hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
88f414f5dfb87ed6915f3632e429f5db096be2dc | 9,169 | py | Python | extra_foam/pipeline/f_worker.py | European-XFEL/EXtra-foam | f8d225db6b8923d0cce9db2b8c8a80613600b64c | [
"BSD-3-Clause"
] | 7 | 2019-11-27T09:31:37.000Z | 2022-02-12T21:28:49.000Z | extra_foam/pipeline/f_worker.py | European-XFEL/EXtra-foam | f8d225db6b8923d0cce9db2b8c8a80613600b64c | [
"BSD-3-Clause"
] | 172 | 2019-12-03T07:56:02.000Z | 2022-03-25T15:46:45.000Z | extra_foam/pipeline/f_worker.py | European-XFEL/EXtra-foam | f8d225db6b8923d0cce9db2b8c8a80613600b64c | [
"BSD-3-Clause"
] | 9 | 2019-11-27T09:32:38.000Z | 2022-01-05T09:56:10.000Z | """
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
Author: Jun Zhu <jun.zhu@xfel.eu>
Copyright (C) European X-Ray Free-Electron Laser Facility GmbH.
All rights reserved.
"""
| 33.463504 | 80 | 0.550333 | """
Distributed under the terms of the BSD 3-Clause License.
The full license is in the file LICENSE, distributed with this software.
Author: Jun Zhu <jun.zhu@xfel.eu>
Copyright (C) European X-Ray Free-Electron Laser Facility GmbH.
All rights reserved.
"""
import multiprocessing as mp
from threading import Event
from... | 0 | 208 | 0 | 7,735 | 0 | 0 | 0 | 564 | 400 |
32606e926d34bcdec145a4d0848ce4631c9f6737 | 623 | py | Python | tests/utils/test_PCA_with_scaling.py | gagneurlab/gfeat | a5ddb081567253ee2d6046485f81941bebb1f0f9 | [
"MIT"
] | 2 | 2018-09-28T21:30:07.000Z | 2020-06-09T15:54:24.000Z | tests/utils/test_PCA_with_scaling.py | gagneurlab/gfeat | a5ddb081567253ee2d6046485f81941bebb1f0f9 | [
"MIT"
] | 1 | 2021-11-15T17:47:48.000Z | 2021-11-15T17:47:48.000Z | tests/utils/test_PCA_with_scaling.py | gagneurlab/gfeat | a5ddb081567253ee2d6046485f81941bebb1f0f9 | [
"MIT"
] | null | null | null | """
Test PCA_with_scaling
"""
| 31.15 | 77 | 0.617978 | """
Test PCA_with_scaling
"""
from gfeat.utils import PCA_with_standard_sample_deviation_scaling
import numpy as np
import pandas as pd
import numpy.testing as npt
def test_get_codon_pairs_count():
matrix = np.array([[62, 68, 5], [24, 94, 93], [96, 223, 23], [5, 9, 44]])
df = pd.DataFrame(matrix)
res = P... | 0 | 0 | 0 | 0 | 0 | 434 | 0 | 46 | 112 |
c965544761f5246eaa459ee8fcab07a64d643e37 | 150 | py | Python | web/apps/settings/index.py | sean-hayes/zoom | eda69c64ceb69dd87d2f7a5dfdaeea52ef65c581 | [
"MIT"
] | 1 | 2017-05-11T17:24:49.000Z | 2017-05-11T17:24:49.000Z | web/apps/settings/index.py | sean-hayes/zoom | eda69c64ceb69dd87d2f7a5dfdaeea52ef65c581 | [
"MIT"
] | null | null | null | web/apps/settings/index.py | sean-hayes/zoom | eda69c64ceb69dd87d2f7a5dfdaeea52ef65c581 | [
"MIT"
] | 1 | 2020-07-20T00:33:27.000Z | 2020-07-20T00:33:27.000Z | """
settings.index
"""
| 15 | 47 | 0.64 | """
settings.index
"""
import zoom
def view(**_):
content = 'System settings will go here.'
return zoom.page(content, title='Settings')
| 0 | 0 | 0 | 0 | 0 | 87 | 0 | -10 | 46 |
0029a64919fb65d3dbc6116e6ea58b54af4347bc | 5,931 | py | Python | paddlehub/common/hub_server.py | Austendeng/PaddleHub | b363eaedaf77d21152920cce652c719278ec809d | [
"Apache-2.0"
] | null | null | null | paddlehub/common/hub_server.py | Austendeng/PaddleHub | b363eaedaf77d21152920cce652c719278ec809d | [
"Apache-2.0"
] | null | null | null | paddlehub/common/hub_server.py | Austendeng/PaddleHub | b363eaedaf77d21152920cce652c719278ec809d | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 36.386503 | 93 | 0.629236 | # Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 0 | 0 | 0 | 4,889 | 0 | 0 | 0 | 40 | 179 |
0e2619046312db618159b3dc7b62606764bfada6 | 639 | py | Python | cd.py | kenteroshima/fedora_cheatsheet | aa745db3067e0ea0ebb4523abf2a81c6af5ed384 | [
"MIT"
] | null | null | null | cd.py | kenteroshima/fedora_cheatsheet | aa745db3067e0ea0ebb4523abf2a81c6af5ed384 | [
"MIT"
] | null | null | null | cd.py | kenteroshima/fedora_cheatsheet | aa745db3067e0ea0ebb4523abf2a81c6af5ed384 | [
"MIT"
] | null | null | null |
root = Tk()
root.title("Tkinter 15min timer")
root.geometry("250x200")
count = 0
compliment = Label(root, text="")
compliment.grid(row=0, column=0)
totalLabel = Label(root, text=f'Total: {count} times')
totalLabel.grid(row=1, column=0)
Label(root, text="What good will I do from now?").grid(row=2, column=0)
Button(r... | 21.3 | 71 | 0.682316 | from tkinter import *
import time
root = Tk()
root.title("Tkinter 15min timer")
root.geometry("250x200")
count = 0
def start():
global count
root.withdraw()
time.sleep(900)
root.deiconify()
compliment.configure(text="Nice work! ^ ^")
count += 1
totalLabel.configure(text=f'Total: {count}... | 0 | 0 | 0 | 0 | 0 | 189 | 0 | -10 | 67 |
7aad572a3ecaf753d7d70bde4356a141b7f9ca12 | 27,320 | py | Python | descritor_de_rede.py | ViniciusFonsekaDeOliveira/complex-networks | 016f997b5929cdb9ac91775e4ed24cc442c60a65 | [
"CC0-1.0"
] | null | null | null | descritor_de_rede.py | ViniciusFonsekaDeOliveira/complex-networks | 016f997b5929cdb9ac91775e4ed24cc442c60a65 | [
"CC0-1.0"
] | null | null | null | descritor_de_rede.py | ViniciusFonsekaDeOliveira/complex-networks | 016f997b5929cdb9ac91775e4ed24cc442c60a65 | [
"CC0-1.0"
] | null | null | null |
# Retorna um indice gerados aleatoriamente e sem repetio dentro do intervalo de 0 a n.
# @param numero_total_de_vertices: numero total de vertices do grafo original
# P(f) o tamanho do componente gigante apos remover uma taxa f de vrtices.
# dado uma rede, atacamos os ns de maior grau at que no sobr... | 36.426667 | 119 | 0.682577 | import math
import numpy as np
from random import randint
from random import sample
import matplotlib.pyplot as plt
import matplotlib.path as mpath
import igraph as ig
from matplotlib import pylab
import pandas as pd
from scipy.stats import ks_2samp as kolmogorov_smirnov_similarity
def numero_de_vertices(grafo):
... | 198 | 0 | 0 | 0 | 0 | 24,594 | 0 | 63 | 1,357 |
d3e6234bab8e0560102214d3160cbf13462720b8 | 4,046 | py | Python | altair_catplot/utils.py | justinbois/altair-catplot | b0afb8a62657ca7d97df7a8151f8347539db01d6 | [
"MIT"
] | 22 | 2018-09-10T16:21:12.000Z | 2021-12-15T09:49:13.000Z | altair_catplot/utils.py | justinbois/altair-catplot | b0afb8a62657ca7d97df7a8151f8347539db01d6 | [
"MIT"
] | 3 | 2018-10-14T17:45:08.000Z | 2021-11-11T19:32:38.000Z | altair_catplot/utils.py | justinbois/altair-catplot | b0afb8a62657ca7d97df7a8151f8347539db01d6 | [
"MIT"
] | null | null | null | import altair as alt
from altair.utils.schemapi import Undefined, UndefinedType
def _check_catplot_transform(transform, mark):
"""Check to make sure transform is valid for catplot.
Parameters
----------
transform : str or list of strings
Which transform to use. Valid entries are:
... | 31.364341 | 115 | 0.537321 | import altair as alt
from altair.utils.schemapi import Undefined, UndefinedType
def _check_catplot_transform(transform, mark):
"""Check to make sure transform is valid for catplot.
Parameters
----------
transform : str or list of strings
Which transform to use. Valid entries are:
... | 0 | 0 | 0 | 0 | 0 | 245 | 0 | 0 | 23 |
f3eb0a2b27ef10284f29404142ce87ba6b972374 | 622 | py | Python | submissions/joi2018yo/c.py | m-star18/atcoder | 08e475810516602fa088f87daf1eba590b4e07cc | [
"Unlicense"
] | 1 | 2021-05-10T01:16:28.000Z | 2021-05-10T01:16:28.000Z | submissions/joi2018yo/c.py | m-star18/atcoder | 08e475810516602fa088f87daf1eba590b4e07cc | [
"Unlicense"
] | 3 | 2021-05-11T06:14:15.000Z | 2021-06-19T08:18:36.000Z | submissions/joi2018yo/c.py | m-star18/atcoder | 08e475810516602fa088f87daf1eba590b4e07cc | [
"Unlicense"
] | null | null | null | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)
h, w = map(int, readline().split())
a = [list(map(int, readline().split())) for _ in range(h)]
ans = float('inf')
for i in range(h):
for j in range(w):
v = c... | 20.733333 | 58 | 0.5209 | import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10 ** 7)
h, w = map(int, readline().split())
a = [list(map(int, readline().split())) for _ in range(h)]
def check(i, j):
cnt = 0
for y in range(h):
if i == y:
... | 0 | 0 | 0 | 0 | 0 | 217 | 0 | 0 | 23 |
791c831685b5f2b634575445c8d3a1a4ef68c1b8 | 5,701 | py | Python | fp_pred_group/preprocessor/preprocess_feat.py | ndkgit339/filledpause_prediction_group | db511c081f155ec2c23afe82bc44c03c38618590 | [
"MIT"
] | 1 | 2022-02-25T01:03:40.000Z | 2022-02-25T01:03:40.000Z | fp_pred_group/preprocessor/preprocess_feat.py | ndkgit339/filledpause_prediction_group | db511c081f155ec2c23afe82bc44c03c38618590 | [
"MIT"
] | null | null | null | fp_pred_group/preprocessor/preprocess_feat.py | ndkgit339/filledpause_prediction_group | db511c081f155ec2c23afe82bc44c03c38618590 | [
"MIT"
] | null | null | null |
#
# import fasttext
# import fasttext.util
#
if __name__=="__main__":
main() | 38.52027 | 97 | 0.630591 | import time
from pathlib import Path
from tqdm import tqdm
import hydra
from omegaconf import DictConfig
# 言語処理
# import fasttext
# import fasttext.util
from transformers import BertTokenizer, BertModel
# データ処理
import numpy as np
import torch
def extract_feats(config):
start = time.time()
# FPs
with ope... | 27 | 99 | 0 | 0 | 0 | 5,248 | 0 | 11 | 245 |
66a490be6b07f8d2ac46551d1a939dcb2d7984a8 | 266 | py | Python | examples/test-read.py | benbaptist/packet-framer | fd6502531c05c4f0f005a180f0f7cca311c2f732 | [
"MIT"
] | null | null | null | examples/test-read.py | benbaptist/packet-framer | fd6502531c05c4f0f005a180f0f7cca311c2f732 | [
"MIT"
] | null | null | null | examples/test-read.py | benbaptist/packet-framer | fd6502531c05c4f0f005a180f0f7cca311c2f732 | [
"MIT"
] | null | null | null | from packetframer import PacketFramer
TEST_PATH = "/tmp/amazing_fifo"
framer = PacketFramer(
fh_read=open(TEST_PATH, "rb")
)
while True:
packet = framer.read_packet()
if not packet:
print("All done!")
break
print("Read", packet)
| 15.647059 | 37 | 0.650376 | from packetframer import PacketFramer
TEST_PATH = "/tmp/amazing_fifo"
framer = PacketFramer(
fh_read=open(TEST_PATH, "rb")
)
while True:
packet = framer.read_packet()
if not packet:
print("All done!")
break
print("Read", packet)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
27fe495d9e4ec040bb2ef8f8dad464a2c709aeb9 | 1,230 | py | Python | old_version/blur_3.4.py | Anonymous160609/Agent_based_Model_GEOG5990 | 53dca09bd85403fb8a6e3b7b5d51fdd203e68f69 | [
"FSFAP"
] | null | null | null | old_version/blur_3.4.py | Anonymous160609/Agent_based_Model_GEOG5990 | 53dca09bd85403fb8a6e3b7b5d51fdd203e68f69 | [
"FSFAP"
] | null | null | null | old_version/blur_3.4.py | Anonymous160609/Agent_based_Model_GEOG5990 | 53dca09bd85403fb8a6e3b7b5d51fdd203e68f69 | [
"FSFAP"
] | null | null | null | '''
log:
IndexError: list index out of range
#WRONG agent number is 99**n
#for i = 0 j = 0 at the start of the run,
#the line sum += data[i-1][j] is trying to read into negative list space that doesn't exist
'''
# blur ---------------------------------------
import matplotlib.pyplot
import random
data = []
processe... | 22.363636 | 91 | 0.573984 | '''
log:
IndexError: list index out of range
#WRONG agent number is 99**n
#for i = 0 j = 0 at the start of the run,
#the line sum += data[i-1][j] is trying to read into negative list space that doesn't exist
'''
# blur ---------------------------------------
import matplotlib.pyplot
import random
data = []
processe... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a21a795b8aeab1cf5fd7c438226534f34bc8ca41 | 1,310 | py | Python | parentopticon/gui.py | EliRibble/parentopticon | 8593d7f72fac9706f1bd8e8326ac932f5af95a32 | [
"MIT"
] | null | null | null | parentopticon/gui.py | EliRibble/parentopticon | 8593d7f72fac9706f1bd8e8326ac932f5af95a32 | [
"MIT"
] | null | null | null | parentopticon/gui.py | EliRibble/parentopticon | 8593d7f72fac9706f1bd8e8326ac932f5af95a32 | [
"MIT"
] | null | null | null | import os
import subprocess
ROOT = os.path.dirname(os.path.dirname(__file__))
def show_alert(title: str, content: str) -> None:
"""Show an alert message using the desktop notifier."""
subprocess.call(["notify-send", title, content])
def show_denied(program_name: str, reason: str) -> None:
"""Tell the user the... | 27.87234 | 79 | 0.703053 | import os
import subprocess
ROOT = os.path.dirname(os.path.dirname(__file__))
class NoApplication(tk.Frame):
"""An application to tell the client 'no'"""
def __init__(self, program_name, reason, master=None):
super().__init__(master)
self.master = master
self.program_name = program_name
self.reason = reason... | 0 | 0 | 0 | 795 | 0 | 0 | 0 | 0 | 23 |
6102dd3a40815ea5c2953ce47241d5b615900eb9 | 2,250 | py | Python | Own/textEncryption.py | kmykoh97/Basic-Programming-SJTU | be3887c45b92e32427336ad4ff8252b63991d9f2 | [
"Apache-2.0"
] | null | null | null | Own/textEncryption.py | kmykoh97/Basic-Programming-SJTU | be3887c45b92e32427336ad4ff8252b63991d9f2 | [
"Apache-2.0"
] | null | null | null | Own/textEncryption.py | kmykoh97/Basic-Programming-SJTU | be3887c45b92e32427336ad4ff8252b63991d9f2 | [
"Apache-2.0"
] | null | null | null | #Text Encryption Project
#Created by MyKoh
#2017-09-24
words = raw_input("Please enter words in small letter you wish to encrypt")
#To encrypt to numbers in sequence ie: 'a' = 1
#To encrypt to ASCII codes
textToNumberConversion()
| 29.220779 | 75 | 0.520889 | #Text Encryption Project
#Created by MyKoh
#2017-09-24
words = raw_input("Please enter words in small letter you wish to encrypt")
#To encrypt to numbers in sequence ie: 'a' = 1
def textToNumberConversion():
result = []
for character in words:
if character == 'a':
result.append(1)
... | 0 | 0 | 0 | 0 | 0 | 1,972 | 0 | 0 | 44 |
53df32c1ef458b8d1511e9d4e14e3603e21534a5 | 525 | py | Python | Scripts/ip-calc.py | BeTheMike/Meandering-Python | 5c57597e292e7530739bf9f8b649a82e3f1ca0cf | [
"Apache-2.0"
] | null | null | null | Scripts/ip-calc.py | BeTheMike/Meandering-Python | 5c57597e292e7530739bf9f8b649a82e3f1ca0cf | [
"Apache-2.0"
] | null | null | null | Scripts/ip-calc.py | BeTheMike/Meandering-Python | 5c57597e292e7530739bf9f8b649a82e3f1ca0cf | [
"Apache-2.0"
] | 1 | 2018-06-16T22:41:02.000Z | 2018-06-16T22:41:02.000Z | import ipcalc
import sys
# Pull address from input
# addrString = raw_input("Address (x.x.x.x/x): ")
addrString = sys.argv[1]
#Pull netmask
subnet = ipcalc.Network(addrString)
# Generate empty list
AddrList = []
# Append items to the list
for x in ipcalc.Network(addrString):
AddrList.append(str(x))
# Print it out ... | 27.631579 | 60 | 0.699048 | import ipcalc
import sys
# Pull address from input
# addrString = raw_input("Address (x.x.x.x/x): ")
addrString = sys.argv[1]
#Pull netmask
subnet = ipcalc.Network(addrString)
# Generate empty list
AddrList = []
# Append items to the list
for x in ipcalc.Network(addrString):
AddrList.append(str(x))
# Print it out ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7cd4def60a21124a4a6b1088c01c15055df22af3 | 11,216 | py | Python | tensorflow_quantum/python/optimizers/spsa_minimizer.py | lockwo/quantum | de57af9330ac7f5bf8298d202081c29fb2a956b8 | [
"Apache-2.0"
] | null | null | null | tensorflow_quantum/python/optimizers/spsa_minimizer.py | lockwo/quantum | de57af9330ac7f5bf8298d202081c29fb2a956b8 | [
"Apache-2.0"
] | null | null | null | tensorflow_quantum/python/optimizers/spsa_minimizer.py | lockwo/quantum | de57af9330ac7f5bf8298d202081c29fb2a956b8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The TensorFlow Quantum Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 40.490975 | 80 | 0.592011 | # Copyright 2021 The TensorFlow Quantum Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d4d3a34bdc534b68c881bc0fb552a9f617417548 | 5,662 | py | Python | src/client_libraries/python/microsoft/dynamics/customerinsights/api/models/data_source_metadata.py | microsoft/Dynamics365-CustomerInsights-Client-Libraries | e00632f7972717b03e0fb1a9e2667e8f9444a0fe | [
"MIT"
] | null | null | null | src/client_libraries/python/microsoft/dynamics/customerinsights/api/models/data_source_metadata.py | microsoft/Dynamics365-CustomerInsights-Client-Libraries | e00632f7972717b03e0fb1a9e2667e8f9444a0fe | [
"MIT"
] | null | null | null | src/client_libraries/python/microsoft/dynamics/customerinsights/api/models/data_source_metadata.py | microsoft/Dynamics365-CustomerInsights-Client-Libraries | e00632f7972717b03e0fb1a9e2667e8f9444a0fe | [
"MIT"
] | 7 | 2021-02-11T19:48:57.000Z | 2021-12-17T08:00:15.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
| 45.296 | 124 | 0.64094 | # coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from ... | 0 | 0 | 0 | 5,284 | 0 | 0 | 0 | 17 | 46 |
227d032e2fa5c4936e49fde43d51d0e488096b42 | 145 | py | Python | exercícios/EX_CursoEmVideo/ex003.py | jose-carlos-code/CursoEmvideo-python | 8c9b82db2c2b906f6d8f2359a680b9b3af25da43 | [
"MIT"
] | 1 | 2021-01-11T15:10:36.000Z | 2021-01-11T15:10:36.000Z | exercícios/EX_CursoEmVideo/ex003.py | jose-carlos-code/CursoEmvideo-python | 8c9b82db2c2b906f6d8f2359a680b9b3af25da43 | [
"MIT"
] | null | null | null | exercícios/EX_CursoEmVideo/ex003.py | jose-carlos-code/CursoEmvideo-python | 8c9b82db2c2b906f6d8f2359a680b9b3af25da43 | [
"MIT"
] | null | null | null | n1 = int(input('me diga um numero: '))
n2 = int(input('me diga outro numero: '))
s = n1 + n2
print('a soma entre {} {} {}'.format(n1, n2, s))
| 29 | 51 | 0.572414 | n1 = int(input('me diga um numero: '))
n2 = int(input('me diga outro numero: '))
s = n1 + n2
print('a soma entre {} {} é {}'.format(n1, n2, s))
| 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
522f01e8517f31d9a245315dab7156df94c0cc2c | 5,976 | py | Python | LPC/Django/noticias/app_noticias/views.py | JottaF/ProjetosFacul | d9538e811fc5915692152af34c6939275f4abc27 | [
"MIT"
] | null | null | null | LPC/Django/noticias/app_noticias/views.py | JottaF/ProjetosFacul | d9538e811fc5915692152af34c6939275f4abc27 | [
"MIT"
] | null | null | null | LPC/Django/noticias/app_noticias/views.py | JottaF/ProjetosFacul | d9538e811fc5915692152af34c6939275f4abc27 | [
"MIT"
] | null | null | null | from app_noticias.models import Tag
| 33.573034 | 118 | 0.64508 | from django.shortcuts import render, redirect, reverse
from django.views.generic.edit import FormView
from django.http import HttpResponse, Http404, HttpResponseRedirect
from app_noticias.forms import ContatoForm, TagForm, AddNoticiaForm
from django.contrib.auth.models import User
from app_noticias.models import Tag
fr... | 4 | 0 | 0 | 0 | 0 | 5,197 | 0 | 217 | 523 |
7ff937fe7856c01791969e3d2ae4cb291a7822da | 4,064 | py | Python | aztk/client/base/helpers/get_application_log.py | atg-abhishek/aztk | e3d060e58373c316fddbc0907f08b1430e1b2691 | [
"MIT"
] | null | null | null | aztk/client/base/helpers/get_application_log.py | atg-abhishek/aztk | e3d060e58373c316fddbc0907f08b1430e1b2691 | [
"MIT"
] | null | null | null | aztk/client/base/helpers/get_application_log.py | atg-abhishek/aztk | e3d060e58373c316fddbc0907f08b1430e1b2691 | [
"MIT"
] | null | null | null | import time
import azure.batch.models as batch_models
import azure.batch.models.batch_error as batch_error
from aztk.utils import constants
output_file = constants.TASK_WORKING_DIR + "/" + constants.SPARK_SUBMIT_LOGS_FILE
def __wait_for_app_to_be_running(batch_client, cluster_id: str, application_name: str) -> batc... | 36.285714 | 118 | 0.694636 | import time
import azure
import azure.batch.models as batch_models
import azure.batch.models.batch_error as batch_error
from aztk import error, models
from aztk.utils import constants, helpers
output_file = constants.TASK_WORKING_DIR + "/" + constants.SPARK_SUBMIT_LOGS_FILE
def __check_task_node_exist(batch_client... | 0 | 0 | 0 | 0 | 0 | 3,148 | 0 | 9 | 161 |
2ef3f1bb0151fdc9ab85b450461ab6c39b800ad7 | 882 | py | Python | Approximating_e/main.py | PeterConway314/MathsMiniProjects | 5d51bfe85dd238fa0aebb703ae322a6122716642 | [
"MIT"
] | null | null | null | Approximating_e/main.py | PeterConway314/MathsMiniProjects | 5d51bfe85dd238fa0aebb703ae322a6122716642 | [
"MIT"
] | null | null | null | Approximating_e/main.py | PeterConway314/MathsMiniProjects | 5d51bfe85dd238fa0aebb703ae322a6122716642 | [
"MIT"
] | null | null | null | '''
I heard that summing numbers in [0,1] until the total is >1 will
require an average of e numbers.
This code puts that to the test.
Hopefully pretty graphs, other visualisations, and optimisations
to be added later.
'''
import math
# import matplotlib.pyplot as plt
# Generate a number in the range [0,1] inclusive... | 25.2 | 72 | 0.68254 | '''
I heard that summing numbers in [0,1] until the total is >1 will
require an average of e numbers.
This code puts that to the test.
Hopefully pretty graphs, other visualisations, and optimisations
to be added later.
'''
import random
import math
# import matplotlib.pyplot as plt
# Generate a number in the range ... | 0 | 0 | 0 | 0 | 0 | 146 | 0 | -8 | 67 |
9635c940c5ee576251586f67481b124490292e1e | 2,659 | py | Python | 20-fs-ias-lec/groups/01-dev2dev/Code/BTonly/lib/logMerge/logStore/transconn/database_connector.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 8 | 2020-03-17T21:12:18.000Z | 2021-12-12T15:55:54.000Z | 20-fs-ias-lec/groups/01-dev2dev/Code/BTonly/lib/logMerge/logStore/transconn/database_connector.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 2 | 2021-07-19T06:18:43.000Z | 2022-02-10T12:17:58.000Z | 20-fs-ias-lec/groups/01-dev2dev/Code/BTonly/lib/logMerge/logStore/transconn/database_connector.py | Kyrus1999/BACnet | 5be8e1377252166041bcd0b066cce5b92b077d06 | [
"MIT"
] | 25 | 2020-03-20T09:32:45.000Z | 2021-07-18T18:12:59.000Z | from ..funcs.log import create_logger
logger = create_logger('DatabaseConnector')
"""The database connector allows the network layer to access database functionality.
It is meant to be used mostly by logMerge and logSync for their purposes, however, others should feel free to
use it as well.
"""
| 45.844828 | 119 | 0.71117 | from ..database.database_handler import DatabaseHandler as dataBaseHandler
from ..funcs.log import create_logger
from ..verific.verify_insertion import Verification
logger = create_logger('DatabaseConnector')
"""The database connector allows the network layer to access database functionality.
It is meant to be used m... | 0 | 0 | 0 | 2,209 | 0 | 0 | 0 | 83 | 67 |
73953a0b777e231168044c33bd1667eddada17fe | 152 | py | Python | src/holographer/__init__.py | xguse/holographer | d389655772afc5a5c4e458c763d59c25a8508f18 | [
"MIT"
] | null | null | null | src/holographer/__init__.py | xguse/holographer | d389655772afc5a5c4e458c763d59c25a8508f18 | [
"MIT"
] | null | null | null | src/holographer/__init__.py | xguse/holographer | d389655772afc5a5c4e458c763d59c25a8508f18 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Top-level package for Holographer."""
__author__ = """Gus Dunn"""
__email__ = 'w.gus.dunn@gmail.com'
__version__ = '0.0.2'
| 19 | 40 | 0.625 | # -*- coding: utf-8 -*-
"""Top-level package for Holographer."""
__author__ = """Gus Dunn"""
__email__ = 'w.gus.dunn@gmail.com'
__version__ = '0.0.2'
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8ea4ff60dbd45c87a48eac14c5b632ff27ce3332 | 15,415 | py | Python | tests/basic/sessions_client.py | billmcchesney1/sessionOffload | 816d1572bff5f2b60bd402c22b7973f0370e1c47 | [
"Apache-2.0"
] | null | null | null | tests/basic/sessions_client.py | billmcchesney1/sessionOffload | 816d1572bff5f2b60bd402c22b7973f0370e1c47 | [
"Apache-2.0"
] | null | null | null | tests/basic/sessions_client.py | billmcchesney1/sessionOffload | 816d1572bff5f2b60bd402c22b7973f0370e1c47 | [
"Apache-2.0"
] | null | null | null | #============LICENSE_START=============================================================================================================
# Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
#===================================================================
# Licensed under the Apache License, Version ... | 46.996951 | 135 | 0.684333 | #============LICENSE_START=============================================================================================================
# Copyright (C) 2020 AT&T Intellectual Property. All rights reserved.
#===================================================================
# Licensed under the Apache License, Version ... | 0 | 0 | 0 | 781 | 0 | 12,959 | 0 | -38 | 634 |
5e4940de5f22dbea769a2dfdcbca37a148eeef18 | 1,290 | py | Python | github_timeline_rss/util.py | narfman0/github_timeline_rss | af07d80a35da3fc993f4a18db4671f0b05a05970 | [
"MIT"
] | 1 | 2017-06-18T20:53:25.000Z | 2017-06-18T20:53:25.000Z | github_timeline_rss/util.py | narfman0/github_timeline_rss | af07d80a35da3fc993f4a18db4671f0b05a05970 | [
"MIT"
] | null | null | null | github_timeline_rss/util.py | narfman0/github_timeline_rss | af07d80a35da3fc993f4a18db4671f0b05a05970 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
ENDPOINT = "https://api.github.com/users/{username}/received_events"
TITLE = "{username}'s github timeline"
SUBTITLE = "Timeline as of {date}"
AUTHOR = "{}'s github"
FEED_TITLE = "{} {} {}"
URL = "https://github.com/{}"
| 32.25 | 78 | 0.608527 | # -*- coding: utf-8 -*-
from datetime import datetime
import requests
from werkzeug.contrib.atom import AtomFeed
ENDPOINT = "https://api.github.com/users/{username}/received_events"
TITLE = "{username}'s github timeline"
SUBTITLE = "Timeline as of {date}"
AUTHOR = "{}'s github"
FEED_TITLE = "{} {} {}"
URL = "https://... | 0 | 0 | 0 | 0 | 0 | 931 | 0 | 23 | 89 |
40b02c371f00485094c3589c663dbab0df6e6447 | 11,760 | py | Python | src/test/tinc/tincrepo/mpp/models/optimizer_sql_performance_tc.py | lintzc/GPDB | b48c8b97da18f495c10065d0853db87960aebae2 | [
"PostgreSQL",
"Apache-2.0"
] | null | null | null | src/test/tinc/tincrepo/mpp/models/optimizer_sql_performance_tc.py | lintzc/GPDB | b48c8b97da18f495c10065d0853db87960aebae2 | [
"PostgreSQL",
"Apache-2.0"
] | null | null | null | src/test/tinc/tincrepo/mpp/models/optimizer_sql_performance_tc.py | lintzc/GPDB | b48c8b97da18f495c10065d0853db87960aebae2 | [
"PostgreSQL",
"Apache-2.0"
] | 1 | 2018-12-04T09:13:57.000Z | 2018-12-04T09:13:57.000Z | """
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the 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
... | 37.452229 | 158 | 0.616667 | """
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the 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
... | 0 | 5,798 | 0 | 4,762 | 0 | 0 | 0 | 46 | 385 |
b1204298f20c8174831bfbf82bba60dfd2d46b28 | 946 | py | Python | practice/findfile.py | JackyYuanjie/python-scripts | 490eb9668bda6db004ae87d204588fb6ffe56051 | [
"Apache-2.0"
] | 1 | 2021-07-08T05:09:38.000Z | 2021-07-08T05:09:38.000Z | practice/findfile.py | JackyYuanjie/python-scripts | 490eb9668bda6db004ae87d204588fb6ffe56051 | [
"Apache-2.0"
] | null | null | null | practice/findfile.py | JackyYuanjie/python-scripts | 490eb9668bda6db004ae87d204588fb6ffe56051 | [
"Apache-2.0"
] | 1 | 2020-01-09T07:29:17.000Z | 2020-01-09T07:29:17.000Z | # -*- coding:utf-8 -*-
import glob
#
# yijian = glob.glob(r"F:\*\*\*.docx")
# print(yijian)
"""
pythonglob
Unix shell
* :
? :
*.* : [hello.txt,cat.xls,xxx234s.doc]
?.* : [1.txt,h.py]
?.gif: [x.gif,2.gif]
glob.glob(path)list:[]
"""
def get_all():
... | 20.12766 | 52 | 0.581395 | # -*- coding:utf-8 -*-
import glob
# 获取指定目录下的内容
# yijian = glob.glob(r"F:\*\*\*.docx")
# print(yijian)
"""
在python中,glob模块是用来查找匹配的文件的
在查找的条件中,需要用到Unix shell中的匹配规则:
* : 匹配所有
? : 匹配一个字符
*.* : 匹配如:[hello.txt,cat.xls,xxx234s.doc]
?.* : 匹配如:[1.txt,h.py]
?.gif: ... | 429 | 0 | 0 | 0 | 0 | 199 | 0 | 0 | 23 |
28472e4e49e3405700c37e2183c8e16721f120f1 | 3,393 | py | Python | os_classes/ocea257/chapter1.py | profxj/os_classes | 8435e985c8e33a3e736a5c330866054e8ffcbed7 | [
"BSD-3-Clause"
] | null | null | null | os_classes/ocea257/chapter1.py | profxj/os_classes | 8435e985c8e33a3e736a5c330866054e8ffcbed7 | [
"BSD-3-Clause"
] | 4 | 2020-04-04T18:28:36.000Z | 2020-05-07T17:26:15.000Z | os_classes/ocea257/chapter1.py | profxj/os_classes | 8435e985c8e33a3e736a5c330866054e8ffcbed7 | [
"BSD-3-Clause"
] | null | null | null |
'''
Problem 1.2
'''
'''
Problem 1.2
'''
'''
Problem 1.8
'''
| 24.410072 | 86 | 0.62069 | import numpy as np
'''
Problem 1.2
'''
def expo_func(omega, t):
return np.exp(-1*omega*(t + np.abs(t)))
def first_forward(t, wdt, omega=1.):
# For convenience, set omega = 1
dt = wdt / omega
# Evaluate
tdt = t + dt
expf = expo_func(omega, t)
expf_plus = expo_func(omega, tdt)
# Finite... | 0 | 0 | 0 | 0 | 0 | 3,010 | 0 | -3 | 321 |
f888892343cec2930131f72ab6eba3f87a76d84e | 4,107 | py | Python | instruction/field/entity.py | HansGR/WorldsCollide | af227be553e120ee004b130598360c61daf7df59 | [
"MIT"
] | 7 | 2022-01-15T02:53:53.000Z | 2022-02-17T00:51:32.000Z | instruction/field/entity.py | HansGR/WorldsCollide | af227be553e120ee004b130598360c61daf7df59 | [
"MIT"
] | 8 | 2022-01-16T02:45:24.000Z | 2022-03-21T02:08:27.000Z | instruction/field/entity.py | HansGR/WorldsCollide | af227be553e120ee004b130598360c61daf7df59 | [
"MIT"
] | 5 | 2022-01-15T02:53:38.000Z | 2022-01-19T17:42:10.000Z |
CAMERA, PARTY0, PARTY1, PARTY2, PARTY3 = range(0x30, 0x35)
| 28.72028 | 84 | 0.652301 | from instruction.event import _Instruction
from instruction.entity import *
CAMERA, PARTY0, PARTY1, PARTY2, PARTY3 = range(0x30, 0x35)
class MoveDiagonal(_Instruction):
def __init__(self, dir1, dist1, dir2, dist2):
import data.direction as direction
dir_letter = { direction.UP : "u", direction.RIG... | 0 | 0 | 0 | 3,373 | 0 | 0 | 0 | 32 | 642 |
41b793722d1e6835be0600ae34316a5cd9589fab | 2,688 | py | Python | cloud_accounts/cld_sync.py | PaloAltoNetworks/pcs-migration-management | 766c8c861befa92e593b23ad6d248e33f62054bb | [
"ISC"
] | 1 | 2022-03-17T12:51:45.000Z | 2022-03-17T12:51:45.000Z | cloud_accounts/cld_sync.py | PaloAltoNetworks/pcs-migration-management | 766c8c861befa92e593b23ad6d248e33f62054bb | [
"ISC"
] | 2 | 2021-11-03T15:34:40.000Z | 2021-12-14T19:50:20.000Z | cloud_accounts/cld_sync.py | PaloAltoNetworks/pcs-migration-management | 766c8c861befa92e593b23ad6d248e33f62054bb | [
"ISC"
] | 4 | 2021-11-09T17:57:01.000Z | 2022-01-24T17:41:21.000Z | from cloud_accounts import cld_migrate, cld_get, cld_compare, cld_update, cld_delete
def sync(tenant_sessions: list, addMode: bool, upMode: bool, delMode: bool, logger:object):
'''Update, add, or delete cloud accounts to normalize all tenants to be the same as the source tenant'''
added_cloud = []
updated... | 43.354839 | 194 | 0.684152 | from sdk.color_print import c_print
from cloud_accounts import cld_migrate, cld_get, cld_compare, cld_update, cld_delete
def sync(tenant_sessions: list, addMode: bool, upMode: bool, delMode: bool, logger:object):
'''Update, add, or delete cloud accounts to normalize all tenants to be the same as the source tenant'... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 14 | 22 |
728d2f7486a44e8d23a3215d652832c4f82f1212 | 3,516 | py | Python | tests/gene_sequence_tests/test_gene_sequence_functions.py | michaelhall28/darwinian_shift | 7554532379d1650e9174fdf3ab0a0f0074b4d2c5 | [
"MIT"
] | null | null | null | tests/gene_sequence_tests/test_gene_sequence_functions.py | michaelhall28/darwinian_shift | 7554532379d1650e9174fdf3ab0a0f0074b4d2c5 | [
"MIT"
] | null | null | null | tests/gene_sequence_tests/test_gene_sequence_functions.py | michaelhall28/darwinian_shift | 7554532379d1650e9174fdf3ab0a0f0074b4d2c5 | [
"MIT"
] | null | null | null | import os
FILE_DIR = os.path.dirname(os.path.realpath(__file__))
| 54.9375 | 120 | 0.655859 | from darwinian_shift.utils.gene_sequence_functions import *
from tests.conftest import EXON_FILE, REFERENCE_FASTA_FILE
import pickle
import os
import numpy as np
from pandas.testing import assert_frame_equal
import pytest
FILE_DIR = os.path.dirname(os.path.realpath(__file__))
@pytest.mark.parametrize("gene,transcript... | 0 | 700 | 0 | 0 | 0 | 2,444 | 0 | 80 | 224 |
15cc8a84c1e9641b63310af88809ae077958d882 | 917 | py | Python | Codeforces/C_Grandma_Capa_Knits_a_Scarf.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | Codeforces/C_Grandma_Capa_Knits_a_Scarf.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | Codeforces/C_Grandma_Capa_Knits_a_Scarf.py | anubhab-code/Competitive-Programming | de28cb7d44044b9e7d8bdb475da61e37c018ac35 | [
"MIT"
] | null | null | null | for _ in range(int(input())):
n = int(input())
s = input()
alpha = set(s)
ans = n
countImpossible = 0
for i in alpha:
curr = 0
lb, ub = 0, n - 1
while lb < ub:
if s[lb] == s[ub]:
lb += 1
ub -= 1
continue
... | 25.472222 | 37 | 0.309706 | for _ in range(int(input())):
n = int(input())
s = input()
alpha = set(s)
ans = n
countImpossible = 0
for i in alpha:
curr = 0
lb, ub = 0, n - 1
while lb < ub:
if s[lb] == s[ub]:
lb += 1
ub -= 1
continue
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
06f3494061afc4d5cd05a9d35fee5503ab23679f | 1,227 | py | Python | src/promnesia/sources/hackernews.py | karlicoss/were-you-here | bc1a798386d3cd3b362b3c2d362498a2df2daae6 | [
"MIT"
] | 2 | 2018-06-04T05:59:02.000Z | 2019-08-25T21:45:07.000Z | src/promnesia/sources/hackernews.py | karlicoss/were-you-here | bc1a798386d3cd3b362b3c2d362498a2df2daae6 | [
"MIT"
] | 1 | 2019-07-14T13:23:45.000Z | 2019-07-14T13:23:45.000Z | src/promnesia/sources/hackernews.py | karlicoss/were-you-here | bc1a798386d3cd3b362b3c2d362498a2df2daae6 | [
"MIT"
] | null | null | null | '''
Uses [[https://github.com/karlicoss/HPI][HPI]] dogsheep module to import
Hacker News items.
'''
| 29.214286 | 72 | 0.548492 | '''
Uses [[https://github.com/karlicoss/HPI][HPI]] dogsheep module to import
Hacker News items.
'''
import textwrap
from promnesia.common import Visit, Loc, Results
def index() -> Results:
from . import hpi
from my.hackernews import dogsheep
for item in dogsheep.items():
if isinstance(item, Exc... | 3 | 0 | 0 | 0 | 1,035 | 0 | 0 | 21 | 69 |
3013d6318ebcca79568b59c329de03eb84f3b683 | 1,065 | py | Python | world_export/image.py | drewp/megasecond | 13cd93e356b426e093135bf8402efec513e2fa46 | [
"CC-BY-4.0"
] | 2 | 2021-01-02T19:38:05.000Z | 2021-04-06T07:51:27.000Z | world_export/image.py | jeremy-coleman/megasecond | 0ba6b453c1b35fcd7b33256ccd07ca7d0615dc39 | [
"CC-BY-4.0"
] | null | null | null | world_export/image.py | jeremy-coleman/megasecond | 0ba6b453c1b35fcd7b33256ccd07ca7d0615dc39 | [
"CC-BY-4.0"
] | 1 | 2021-04-06T07:51:35.000Z | 2021-04-06T07:51:35.000Z | import logging
log = logging.getLogger()
| 34.354839 | 103 | 0.676995 | import logging
import numpy
from PIL import Image
from dirs import dest
log = logging.getLogger()
def save_builtin(img, path):
# having blender save was turning the image back to black!
path.parent.mkdir(parents=True, exist_ok=True)
img.filepath = str(path).replace('.png', '-builtinsave.png')
img.fi... | 0 | 0 | 0 | 0 | 0 | 918 | 0 | -9 | 113 |
2c373032362281ea1ed86e8848b602e5f2deb7ef | 1,411 | py | Python | calculomedia.py | jeffersonklamas/calculo-media-python | 046ef9df93bc9fb4e4b3d8b4de72fb831eacf993 | [
"MIT"
] | null | null | null | calculomedia.py | jeffersonklamas/calculo-media-python | 046ef9df93bc9fb4e4b3d8b4de72fb831eacf993 | [
"MIT"
] | null | null | null | calculomedia.py | jeffersonklamas/calculo-media-python | 046ef9df93bc9fb4e4b3d8b4de72fb831eacf993 | [
"MIT"
] | null | null | null |
#----------------------------------------------
# Teste de clculo e tomada de deciso
#
# Conceito A = nota >= 9 and < 10
# Conceito B = nota >= 8 and 8,99999
# Conceito C = nota >= 7 and 7,99999
# Conceito D = nota >= 6 and 6,99999
# Conceito R = nota < 5
#
#----------------------------------------------
main() | 36.179487 | 97 | 0.571935 |
#----------------------------------------------
# Teste de cálculo e tomada de decisão
#
# Conceito A = nota >= 9 and < 10
# Conceito B = nota >= 8 and 8,99999
# Conceito C = nota >= 7 and 7,99999
# Conceito D = nota >= 6 and 6,99999
# Conceito R = nota < 5
#
#----------------------------------------------
import os
f... | 8 | 0 | 0 | 0 | 0 | 1,031 | 0 | -4 | 67 |
f8a598e07e60a7d1d957086d98481c2021e695b3 | 13,391 | py | Python | scripts/shelf/locBaker.py | kohyuk91/hkTools | 0125c486b32375fb1dd30465f892e6bd23c07114 | [
"BSD-3-Clause"
] | 10 | 2020-04-30T21:48:07.000Z | 2022-03-07T04:02:50.000Z | scripts/shelf/locBaker.py | kohyuk91/hkTools | 0125c486b32375fb1dd30465f892e6bd23c07114 | [
"BSD-3-Clause"
] | 2 | 2020-04-27T01:55:31.000Z | 2021-01-28T06:30:29.000Z | scripts/shelf/locBaker.py | kohyuk91/mayaMatchmoveTools | 0125c486b32375fb1dd30465f892e6bd23c07114 | [
"BSD-3-Clause"
] | 1 | 2020-11-20T06:53:35.000Z | 2020-11-20T06:53:35.000Z | # BSD 3-Clause License
#
# Copyright (c) 2020, Hyuk Ko
# 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 ... | 41.586957 | 171 | 0.663207 | # BSD 3-Clause License
#
# Copyright (c) 2020, Hyuk Ko
# 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 ... | 0 | 3,783 | 0 | 7,305 | 0 | 50 | 0 | 46 | 209 |
69a12a987282352bc5e2033a8726243fe91694fe | 9,447 | py | Python | tmv/images.py | brettbeeson/tmv | 0771a88d1cb06bb938555fa967eb8c44f5f846d5 | [
"MIT"
] | 1 | 2021-11-09T19:38:33.000Z | 2021-11-09T19:38:33.000Z | tmv/images.py | brettbeeson/tmv | 0771a88d1cb06bb938555fa967eb8c44f5f846d5 | [
"MIT"
] | null | null | null | tmv/images.py | brettbeeson/tmv | 0771a88d1cb06bb938555fa967eb8c44f5f846d5 | [
"MIT"
] | null | null | null | """ Stuff to generate and modify images """
# pylint: disable=line-too-long, logging-fstring-interpolation, dangerous-default-value, logging-not-lazy
from datetime import timedelta, datetime as dt
import logging
from pathlib import Path
import os
from dateutil.rrule import rrule, SECONDLY
from PIL import Image, ImageDr... | 36.616279 | 163 | 0.610247 | """ Stuff to generate and modify images """
# pylint: disable=line-too-long, logging-fstring-interpolation, dangerous-default-value, logging-not-lazy
from datetime import timedelta, datetime as dt
import sys
import glob
import logging
import argparse
from pathlib import Path
import os
from dateutil.rrule import rrule, ... | 0 | 0 | 0 | 1,769 | 0 | 2,781 | 0 | 53 | 202 |
a67f514046bb4d5bb3a2494fca843238f7913af1 | 43 | py | Python | unigui/userset.py | Claus1/unigui | 972c0c98a61321d83df568f79a82cfaa2a472ebe | [
"MIT"
] | 47 | 2020-12-25T10:14:33.000Z | 2022-03-31T18:59:13.000Z | userset.py | stopinspb/unigui | 353b6c1708c9dd9176406cff1c861643ceeb43da | [
"MIT"
] | 1 | 2020-12-25T10:25:17.000Z | 2021-04-26T19:25:35.000Z | userset.py | stopinspb/unigui | 353b6c1708c9dd9176406cff1c861643ceeb43da | [
"MIT"
] | 4 | 2021-02-02T13:59:07.000Z | 2021-12-28T10:08:22.000Z | user = None | 14.333333 | 15 | 0.674419 | user = None
def get_user():
return user | 0 | 0 | 0 | 0 | 0 | 10 | 0 | 0 | 22 |
86021fcc4233e5f63324a6586a1724d74a385cd7 | 904 | py | Python | amberelectric/model/actual_interval.py | madpilot/amberelectric.py | ffb26389d8022e8cdfa803fd51365c586686bd21 | [
"Apache-2.0"
] | 3 | 2021-06-22T03:09:21.000Z | 2022-03-17T03:53:03.000Z | amberelectric/model/actual_interval.py | madpilot/amberelectric.py | ffb26389d8022e8cdfa803fd51365c586686bd21 | [
"Apache-2.0"
] | 4 | 2021-09-11T05:44:08.000Z | 2021-10-02T12:15:38.000Z | amberelectric/model/actual_interval.py | madpilot/amberelectric.py | ffb26389d8022e8cdfa803fd51365c586686bd21 | [
"Apache-2.0"
] | 3 | 2021-10-01T12:00:57.000Z | 2022-03-17T09:55:49.000Z | from .interval import Interval
| 22.6 | 56 | 0.519912 | from .interval import Interval
from datetime import date, datetime
from .interval import Interval, SpikeStatus, ChannelType
class ActualInterval(Interval):
def __init__(
self,
duration: float,
spot_per_kwh: float,
per_kwh: float,
date: date,
nem_time: datetime,
... | 0 | 0 | 0 | 756 | 0 | 0 | 0 | 49 | 67 |
2242df7f69650e46d7c0b5c82a10a6458e3f8629 | 30,560 | py | Python | swatches.py | bmduffy/pycasa | 0294811515ea8b0d9adbcce9ef36495de45842ec | [
"CC0-1.0"
] | 1 | 2022-01-13T16:14:44.000Z | 2022-01-13T16:14:44.000Z | swatches.py | bmduffy/pycasa | 0294811515ea8b0d9adbcce9ef36495de45842ec | [
"CC0-1.0"
] | null | null | null | swatches.py | bmduffy/pycasa | 0294811515ea8b0d9adbcce9ef36495de45842ec | [
"CC0-1.0"
] | null | null | null |
#noinspection PyOldStyleClasses
# end class
# end def
if __name__ == "__main__":
main() # run the main application window | 42.444444 | 120 | 0.52945 | import sys
from glyphview import ( GlyphView, GlyphScene, GlyphItem )
from PyQt4.QtGui import ( QApplication, QDialog, QPen, QBrush, QHBoxLayout,
QPushButton, QVBoxLayout, QGraphicsRectItem, QGraphicsSimpleTextItem,
QPixmap, QFileDialog, QPainter, QComboBox, QSpin... | 0 | 2,302 | 0 | 27,452 | 0 | 140 | 0 | 356 | 182 |
230c01c5bd6c1e972b9711281ff7465c1aa0ffcc | 338 | py | Python | tests/return/return04.py | ktok07b6/polyphony | 657c5c7440520db6b4985970bd50547407693ac4 | [
"MIT"
] | 83 | 2015-11-30T09:59:13.000Z | 2021-08-03T09:12:28.000Z | tests/return/return04.py | jesseclin/polyphony | 657c5c7440520db6b4985970bd50547407693ac4 | [
"MIT"
] | 4 | 2017-02-10T01:43:11.000Z | 2020-07-14T03:52:25.000Z | tests/return/return04.py | jesseclin/polyphony | 657c5c7440520db6b4985970bd50547407693ac4 | [
"MIT"
] | 11 | 2016-11-18T14:39:15.000Z | 2021-02-23T10:05:20.000Z |
test()
| 17.789474 | 37 | 0.497041 | from polyphony import testbench
def return04(x, y, z):
s = 1
for i in range(x):
for j in range(y):
if i == j == z:
return i
s = s * 2
return s
@testbench
def test():
assert 1 == return04(0, 0, 0)
assert 2 == return04(1, 1, 1)
assert 1024 == return04(... | 0 | 107 | 0 | 0 | 0 | 145 | 0 | 10 | 68 |
a520fdd2dcd36abd8953f2ec3cd9fd1764ed83f1 | 142 | py | Python | ex049.py | gabrielwai/exercicios_de_Python | 3767775748db7c501a6e0364edf7ba4f079e62f9 | [
"MIT"
] | null | null | null | ex049.py | gabrielwai/exercicios_de_Python | 3767775748db7c501a6e0364edf7ba4f079e62f9 | [
"MIT"
] | null | null | null | ex049.py | gabrielwai/exercicios_de_Python | 3767775748db7c501a6e0364edf7ba4f079e62f9 | [
"MIT"
] | null | null | null | tabuada = int(input('Qual tabuada queres saber?: '))
for cont in range(0, 11):
print('{} x {} = {}'.format(tabuada,cont,tabuada*cont))
| 35.5 | 60 | 0.619718 | tabuada = int(input('Qual tabuada queres saber?: '))
for cont in range(0, 11):
print('{} x {} = {}'.format(tabuada,cont,tabuada*cont))
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4f011e62d4c223cb11883a64840a812fa6a214f6 | 1,286 | py | Python | imagesoup/colors.py | zendai/ImageSoup | cd4696c42ae7ae90dcba42d538cb33beaccad7be | [
"MIT"
] | 72 | 2017-09-08T04:47:31.000Z | 2021-12-21T13:18:39.000Z | imagesoup/colors.py | zendai/ImageSoup | cd4696c42ae7ae90dcba42d538cb33beaccad7be | [
"MIT"
] | 4 | 2017-09-08T04:56:04.000Z | 2021-11-17T14:22:04.000Z | imagesoup/colors.py | zendai/ImageSoup | cd4696c42ae7ae90dcba42d538cb33beaccad7be | [
"MIT"
] | 8 | 2017-09-09T14:36:49.000Z | 2021-08-05T21:13:48.000Z |
import webcolors
CSS3_COLORS = webcolors.CSS3_NAMES_TO_HEX.keys()
| 29.227273 | 73 | 0.681182 | from collections import Counter
import webcolors
CSS3_COLORS = webcolors.CSS3_NAMES_TO_HEX.keys()
def color_analysis(image):
if image.mode != 'RGB':
image = image.convert('RGB')
# initialize a Counter starting from zero
color_counter = Counter({color: 0 for color in Counter(CSS3_COLORS)})
... | 0 | 0 | 0 | 0 | 0 | 1,113 | 0 | 10 | 91 |
fa93406ba792c7c6a457dfa550e6617f70e521af | 262 | py | Python | codes/proposal/proposal_config/configs/__init__.py | sarvai/proposals | 578c0094db52594cd85acb843df82fe3c19db46d | [
"Apache-2.0"
] | null | null | null | codes/proposal/proposal_config/configs/__init__.py | sarvai/proposals | 578c0094db52594cd85acb843df82fe3c19db46d | [
"Apache-2.0"
] | null | null | null | codes/proposal/proposal_config/configs/__init__.py | sarvai/proposals | 578c0094db52594cd85acb843df82fe3c19db46d | [
"Apache-2.0"
] | null | null | null | from . import base as baseline
from . import conf_proposal
from . import conf_proposal_patch
configurations = {}
configurations['baseline'] = baseline
configurations['conf_proposal'] = conf_proposal
configurations['conf_proposal_patch'] = conf_proposal_patch
| 23.818182 | 59 | 0.80916 | from . import base as baseline
from . import conf_proposal
from . import conf_proposal_patch
configurations = {}
configurations['baseline'] = baseline
configurations['conf_proposal'] = conf_proposal
configurations['conf_proposal_patch'] = conf_proposal_patch
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e6f06c1c290eac49cb5859a6d4b66ef84beb0502 | 10,869 | py | Python | Scripts/Analyzer_102.py | ShepherdCode/Soars2021 | ab4f304eaa09e52d260152397a6c53d7a05457da | [
"MIT"
] | 1 | 2021-08-16T14:49:04.000Z | 2021-08-16T14:49:04.000Z | Scripts/Analyzer_102.py | ShepherdCode/Soars2021 | ab4f304eaa09e52d260152397a6c53d7a05457da | [
"MIT"
] | null | null | null | Scripts/Analyzer_102.py | ShepherdCode/Soars2021 | ab4f304eaa09e52d260152397a6c53d7a05457da | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# # Analyzer
#
# Statistically, visually, and through machine learning compare mRNA and lncRNA sequences from GENCODE v38.
#
# Assume the user downloaded files from GENCODE v38 [FTP](http://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_38/)
# to a subdirectory called... | 30.445378 | 127 | 0.746987 | #!/usr/bin/env python
# coding: utf-8
# # Analyzer
#
# Statistically, visually, and through machine learning compare mRNA and lncRNA sequences from GENCODE v38.
#
# Assume the user downloaded files from GENCODE v38 [FTP](http://ftp.ebi.ac.uk/pub/databases/gencode/Gencode_human/release_38/)
# to a subdirectory called... | 0 | 0 | 0 | 0 | 0 | 123 | 0 | 303 | 510 |
d6fdd614120b04250fdc37b59c0e02e801c271dd | 12,449 | py | Python | uftpd_dirtrav.py | Arinerron/uftp_dirtrav | 5e32e684ae72bbbf0c54cabf44804c77deb8edc4 | [
"Unlicense"
] | 18 | 2019-08-31T22:26:25.000Z | 2021-10-17T00:25:04.000Z | uftpd_dirtrav.py | Arinerron/uftp_dirtrav | 5e32e684ae72bbbf0c54cabf44804c77deb8edc4 | [
"Unlicense"
] | null | null | null | uftpd_dirtrav.py | Arinerron/uftp_dirtrav | 5e32e684ae72bbbf0c54cabf44804c77deb8edc4 | [
"Unlicense"
] | 2 | 2020-03-15T22:16:19.000Z | 2020-04-22T22:05:57.000Z | #!/usr/bin/env python3
# Author: Aaron Esau (Arinerron) <security@aaronesau.com>
# Writeup: https://aaronesau.com/blog/posts/6
# Product: uftpd 2.6-2.10
# CVE ID: CVE-2020-5221
# This exploit uses a directory traversal vulnerability and escapes uftpd's
# crappy implementation of a chroot jail. It does not require au... | 29.570071 | 167 | 0.580047 | #!/usr/bin/env python3
# Author: Aaron Esau (Arinerron) <security@aaronesau.com>
# Writeup: https://aaronesau.com/blog/posts/6
# Product: uftpd 2.6-2.10
# CVE ID: CVE-2020-5221
# This exploit uses a directory traversal vulnerability and escapes uftpd's
# crappy implementation of a chroot jail. It does not require au... | 0 | 0 | 0 | 1,793 | 0 | 2,475 | 0 | 6 | 223 |
6b23020d9c54f5afe30e9e7a6d143c63771033c1 | 5,374 | py | Python | exstracs/exstracs_onlineenv.py | bnanita/trafficapi | ba22faa609ce0f79b3791dca2c403591a26ee2e2 | [
"MIT"
] | null | null | null | exstracs/exstracs_onlineenv.py | bnanita/trafficapi | ba22faa609ce0f79b3791dca2c403591a26ee2e2 | [
"MIT"
] | null | null | null | exstracs/exstracs_onlineenv.py | bnanita/trafficapi | ba22faa609ce0f79b3791dca2c403591a26ee2e2 | [
"MIT"
] | null | null | null | """
Name: ExSTraCS_Online_Environement.py
Authors: Ryan Urbanowicz - Written at Dartmouth College, Hanover, NH, USA
Contact: ryan.j.urbanowicz@darmouth.edu
Created: April 25, 2014
Modified: August 25,2014
Description: ExSTraCS is best suited to offline iterative learning, however this module has b... | 52.686275 | 160 | 0.652773 | """
Name: ExSTraCS_Online_Environement.py
Authors: Ryan Urbanowicz - Written at Dartmouth College, Hanover, NH, USA
Contact: ryan.j.urbanowicz@darmouth.edu
Created: April 25, 2014
Modified: August 25,2014
Description: ExSTraCS is best suited to offline iterative learning, however this module has b... | 0 | 0 | 0 | 2,585 | 0 | 0 | 0 | 74 | 204 |
ccbdc66770bafcb5caa8a1c2c46254496cc67c08 | 4,354 | py | Python | mpdb/sandbox/cP_EOS.py | stuart-nolan/mpdb | 79a8847b4763ac4c6a22ad2ec0ee18a148d8a785 | [
"BSD-2-Clause"
] | null | null | null | mpdb/sandbox/cP_EOS.py | stuart-nolan/mpdb | 79a8847b4763ac4c6a22ad2ec0ee18a148d8a785 | [
"BSD-2-Clause"
] | null | null | null | mpdb/sandbox/cP_EOS.py | stuart-nolan/mpdb | 79a8847b4763ac4c6a22ad2ec0ee18a148d8a785 | [
"BSD-2-Clause"
] | null | null | null | """
cP_EOS.py
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2021 Stuart Nolan. All rights reserved.
"""
import CoolProp.CoolProp as cP
from CoolProp import AbstractState as cPAS
from tabulate import tabulate
from scipy.optimize import minimize
"""
from CoolProp/include/DataStructures.h
0 iphase_liquid, < Subcr... | 34.015625 | 98 | 0.644924 | """
cP_EOS.py
SPDX-License-Identifier: BSD-2-Clause
Copyright (c) 2021 Stuart Nolan. All rights reserved.
"""
import pdb
import CoolProp.CoolProp as cP
from CoolProp import AbstractState as cPAS
from tabulate import tabulate
from scipy.optimize import minimize
def cEOS_fit_kij(kij, data, cPAS_EOS):
cPAS_EOS.set_b... | 0 | 0 | 0 | 0 | 0 | 1,201 | 0 | -11 | 68 |
2e1d63ddee144c3b2fa0f6cfbf6ed7acc87d8e70 | 1,801 | py | Python | train/analyze_weather.py | open-climate-tech/firecam | d0041332f3d8ba38b7db3b6426010bff0099f569 | [
"Apache-2.0"
] | 9 | 2020-11-25T03:51:50.000Z | 2022-02-13T19:19:51.000Z | train/analyze_weather.py | open-climate-tech/firecam | d0041332f3d8ba38b7db3b6426010bff0099f569 | [
"Apache-2.0"
] | 6 | 2020-03-27T01:35:10.000Z | 2022-03-26T16:20:31.000Z | train/analyze_weather.py | open-climate-tech/firecam | d0041332f3d8ba38b7db3b6426010bff0099f569 | [
"Apache-2.0"
] | 3 | 2020-06-08T15:49:40.000Z | 2022-01-24T11:18:40.000Z | # Copyright 2020 Open Climate Tech Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 32.160714 | 113 | 0.702388 | # Copyright 2020 Open Climate Tech Contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 0 | 0 | 0 | 0 | 0 | 772 | 0 | 45 | 201 |
8c385fad9549c6e7137f9ebafc807f929188ff7b | 1,067 | py | Python | ipython_config.py | aws-samples/amazon-sagemaker-groundtruth-and-amazon-comprehend-ner-examples | ce15d76bc5550eab0e81606b3886e7635d594430 | [
"MIT-0"
] | 2 | 2020-09-22T16:49:02.000Z | 2020-10-29T08:43:35.000Z | ipython_config.py | aws-samples/amazon-sagemaker-groundtruth-and-amazon-comprehend-ner-examples | ce15d76bc5550eab0e81606b3886e7635d594430 | [
"MIT-0"
] | null | null | null | ipython_config.py | aws-samples/amazon-sagemaker-groundtruth-and-amazon-comprehend-ner-examples | ce15d76bc5550eab0e81606b3886e7635d594430 | [
"MIT-0"
] | 1 | 2020-09-02T14:07:33.000Z | 2020-09-02T14:07:33.000Z | import os
import subprocess
####################################################################################################
# Additional PYTHONPATH to allow notebooks to import custom modules at a few pre-defined places.
_cwd = os.getcwd()
_line = 'sys.path.append("{}")'
_pythonpath = [
"import sys, os",
... | 35.566667 | 114 | 0.525773 | import os
import subprocess
####################################################################################################
# Additional PYTHONPATH to allow notebooks to import custom modules at a few pre-defined places.
_cwd = os.getcwd()
_line = 'sys.path.append("{}")'
_pythonpath = [
"import sys, os",
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b407c2f1bab07f13e3d63109f63dceb0506e96cc | 1,155 | py | Python | scripts/logger_server.py | martmists-gh/BDSP | d6326c5d3ad9697ea65269ed47aa0b63abac2a0a | [
"MIT"
] | 1 | 2022-01-15T20:20:27.000Z | 2022-01-15T20:20:27.000Z | scripts/logger_server.py | martmists-gh/BDSP | d6326c5d3ad9697ea65269ed47aa0b63abac2a0a | [
"MIT"
] | null | null | null | scripts/logger_server.py | martmists-gh/BDSP | d6326c5d3ad9697ea65269ed47aa0b63abac2a0a | [
"MIT"
] | null | null | null | import asyncio
import logging
import sys
logging.basicConfig(format="{message}",
style='{',
datefmt="%H:%M:%S",
level=logging.DEBUG)
if __name__ == "__main__":
asyncio.run(main(*sys.argv[1:]))
| 26.860465 | 98 | 0.575758 | import asyncio
import logging
import sys
logging.basicConfig(format="{message}",
style='{',
datefmt="%H:%M:%S",
level=logging.DEBUG)
async def handle_connection(reader, writer):
addr = writer.get_extra_info('peername')[0]
logging.debug(f"[{addr}] C... | 0 | 0 | 847 | 0 | 0 | 0 | 0 | 0 | 46 |
47097dc2f5b262c4baf57ee1a7704380aa4c9964 | 5,109 | py | Python | src/counterfactual_explanation/flow_ssl/invertible/parts.py | tridungduong16/fairCE | b13c72c253d875e68c0294b91aaddcbf93460d92 | [
"MIT"
] | null | null | null | src/counterfactual_explanation/flow_ssl/invertible/parts.py | tridungduong16/fairCE | b13c72c253d875e68c0294b91aaddcbf93460d92 | [
"MIT"
] | null | null | null | src/counterfactual_explanation/flow_ssl/invertible/parts.py | tridungduong16/fairCE | b13c72c253d875e68c0294b91aaddcbf93460d92 | [
"MIT"
] | null | null | null | import torch.nn as nn
I = Id()
| 28.702247 | 88 | 0.602271 | import torch
import torch.nn as nn
import numpy as np
from ..utils import export
from torch.nn import functional as F
@export
class iSequential(torch.nn.Sequential):
def inverse(self,y):
for module in reversed(self._modules.values()):
assert hasattr(module,'inverse'), '{} has no inverse define... | 0 | 3,306 | 0 | 1,413 | 0 | 0 | 0 | 8 | 341 |
4afc8e5614a4adb276bf0b3c984f661c12a4ee8e | 1,883 | py | Python | userManagment/urls.py | uzairAK/serverom-panel | 3dcde05ad618e6bef280db7d3180f926fe2ab1db | [
"MIT"
] | null | null | null | userManagment/urls.py | uzairAK/serverom-panel | 3dcde05ad618e6bef280db7d3180f926fe2ab1db | [
"MIT"
] | null | null | null | userManagment/urls.py | uzairAK/serverom-panel | 3dcde05ad618e6bef280db7d3180f926fe2ab1db | [
"MIT"
] | null | null | null | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.loadUserHome, name='loadUsersHome'),
url(r'^viewProfile', views.viewProfile, name='viewProfile'),
url(r'^createUser', views.createUser, name='createUser'),
url(r'^submitUserCreation', views.submitUserCreation, name... | 52.305556 | 96 | 0.742963 | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.loadUserHome, name='loadUsersHome'),
url(r'^viewProfile', views.viewProfile, name='viewProfile'),
url(r'^createUser', views.createUser, name='createUser'),
url(r'^submitUserCreation', views.submitUserCreation, name... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1cf1041e33e0a58c8bce7696f67e71f732c8f26d | 838 | py | Python | endorsement/views/session.py | uw-it-aca/service-endorsement | a1ba3e4221bb3fe6c81c9f6947ad5e93f10a4a45 | [
"Apache-2.0"
] | 3 | 2017-10-16T17:19:32.000Z | 2019-07-31T22:31:48.000Z | endorsement/views/session.py | uw-it-aca/service-endorsement | a1ba3e4221bb3fe6c81c9f6947ad5e93f10a4a45 | [
"Apache-2.0"
] | 284 | 2016-06-17T18:21:31.000Z | 2022-03-21T16:55:03.000Z | endorsement/views/session.py | uw-it-aca/service-endorsement | a1ba3e4221bb3fe6c81c9f6947ad5e93f10a4a45 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
import logging
logger = logging.getLogger(__name__)
| 28.896552 | 71 | 0.749403 | # Copyright 2021 UW-IT, University of Washington
# SPDX-License-Identifier: Apache-2.0
import hashlib
import json
import logging
from userservice.user import get_original_user, get_override_user
logger = logging.getLogger(__name__)
def log_session_key(request):
session_key = request.session.session_key
if se... | 0 | 0 | 0 | 0 | 0 | 557 | 0 | 27 | 112 |
dd0b89a4dbb866d5e203fdf5a2a70e4692f387fa | 477 | py | Python | scripts/populate_behaviors.py | vsoch/CogatPheno | c3b964d40a4fe501857e68f422e4da557625dd0d | [
"MIT"
] | null | null | null | scripts/populate_behaviors.py | vsoch/CogatPheno | c3b964d40a4fe501857e68f422e4da557625dd0d | [
"MIT"
] | 12 | 2015-07-07T21:07:26.000Z | 2015-11-05T01:10:49.000Z | scripts/populate_behaviors.py | vsoch/CogPheno | c3b964d40a4fe501857e68f422e4da557625dd0d | [
"MIT"
] | null | null | null | #!/usr/bin/python
import numpy
from textblob import Word
from cogpheno.apps.assessments.models import BehavioralTrait
from cogpheno.apps.assessments.views import for term in terms:
make_new_concept(term)
from textblob.wordnet import Synset
# Add parts of speech
for behavior in BehavioralTrait.objects.all():
... | 21.681818 | 60 | 0.725367 | #!/usr/bin/python
import numpy
from textblob import Word
from cogpheno.apps.assessments.models import BehavioralTrait
from cogpheno.apps.assessments.views import
for term in terms:
make_new_concept(term)
from textblob.wordnet import Synset
# Add parts of speech
for behavior in BehavioralTrait.objects.all():
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 |
3233af617ef44e3621671df145df97d2c22da3da | 375 | py | Python | 2019/10 October/dp10182019.py | vishrutkmr7/DailyPracticeProblemsDIP | d1bfbc75f2024736c22c05385f753a90ddcfa0f5 | [
"MIT"
] | 5 | 2019-08-06T02:34:41.000Z | 2022-01-08T03:03:16.000Z | 2019/10 October/dp10182019.py | ourangzeb/DailyPracticeProblemsDIP | 66c07af88754e5d59b243e3ee9f02db69f7c0a77 | [
"MIT"
] | 15 | 2021-06-01T14:04:16.000Z | 2022-03-08T21:17:22.000Z | 2019/10 October/dp10182019.py | ourangzeb/DailyPracticeProblemsDIP | 66c07af88754e5d59b243e3ee9f02db69f7c0a77 | [
"MIT"
] | 4 | 2019-09-19T20:00:05.000Z | 2021-08-16T11:31:51.000Z | # This problem was recently asked by Uber:
# Given a number of integers, combine them so it would create the largest number.
print(largestNum([17, 7, 2, 45, 72]))
# 77245217
| 22.058824 | 81 | 0.666667 | # This problem was recently asked by Uber:
# Given a number of integers, combine them so it would create the largest number.
from itertools import permutations
def largestNum(nums):
# Fill this in.
lst = []
for i in permutations(nums, len(nums)):
lst.append("".join(map(str, i)))
return max(l... | 0 | 0 | 0 | 0 | 0 | 138 | 0 | 13 | 45 |
6473a5efc37f72e776278a8833b7a7b38e9f6703 | 12,618 | py | Python | classes/signature.py | Gamer-Grad/whdbx_web | d506d173c5f82ff3a486185f4c1f9eb90705c311 | [
"MIT"
] | null | null | null | classes/signature.py | Gamer-Grad/whdbx_web | d506d173c5f82ff3a486185f4c1f9eb90705c311 | [
"MIT"
] | null | null | null | classes/signature.py | Gamer-Grad/whdbx_web | d506d173c5f82ff3a486185f4c1f9eb90705c311 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
| 35.948718 | 102 | 0.537011 | # -*- coding: utf-8 -*-
from . import database
from . import sitecfg
from . import sleeper
from . import loot_prices
class WHSignatureWave:
def __init__(self, sig_id: int):
self.sig_id = sig_id
self.wave_id = 0
self.is_capital = False
self.sleepers_str = ''
self.sleeper_id... | 0 | 0 | 0 | 12,404 | 0 | 0 | 0 | 5 | 181 |
135cf2e118c1d2233a48328a38f6c6c5e7fe14fd | 521 | py | Python | projetinhos/ex#71-simulador_de_caixa_eletronico.py | dani-fn/Projetinhos_Python | 692ff0a7f57d8f8f2e28f7b2c38bb6401e013bdb | [
"MIT"
] | null | null | null | projetinhos/ex#71-simulador_de_caixa_eletronico.py | dani-fn/Projetinhos_Python | 692ff0a7f57d8f8f2e28f7b2c38bb6401e013bdb | [
"MIT"
] | null | null | null | projetinhos/ex#71-simulador_de_caixa_eletronico.py | dani-fn/Projetinhos_Python | 692ff0a7f57d8f8f2e28f7b2c38bb6401e013bdb | [
"MIT"
] | null | null | null | print('-' * 28)
print('{:^28}'.format('BANCO DANIMONEY'))
print('-' * 28)
valor = int(input('Quanto deseja sacar? R$'))
total = valor
ced50 = total // 50
total %= 50
ced20 = total // 20
total %= 20
ced10 = total // 10
total %= 10
ced1 = total // 1
total %= 1
if ced50 > 0:
print(f'Total de {ced50} cdul... | 23.681818 | 47 | 0.583493 | print('-' * 28)
print('{:^28}'.format('BANCO DANIMONEY'))
print('-' * 28)
valor = int(input('Quanto deseja sacar? R$'))
total = valor
ced50 = total // 50
total %= 50
ced20 = total // 20
total %= 20
ced10 = total // 10
total %= 10
ced1 = total // 1
total %= 1
if ced50 > 0:
print(f'Total de {ced50} cédu... | 8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a64dc029926431c011a3836faabcd26c3d898f23 | 6,744 | py | Python | pyapprox/tests/test_nataf_transformation.py | ConnectedSystems/pyapprox | 4f405654c707cba83d211f327c0f0fdbc95efa29 | [
"MIT"
] | 26 | 2019-12-16T02:21:15.000Z | 2022-03-17T09:59:18.000Z | pyapprox/tests/test_nataf_transformation.py | ConnectedSystems/pyapprox | 4f405654c707cba83d211f327c0f0fdbc95efa29 | [
"MIT"
] | 9 | 2020-03-03T03:04:55.000Z | 2021-08-19T22:50:42.000Z | pyapprox/tests/test_nataf_transformation.py | ConnectedSystems/pyapprox | 4f405654c707cba83d211f327c0f0fdbc95efa29 | [
"MIT"
] | 7 | 2020-03-02T03:49:17.000Z | 2021-02-17T02:07:53.000Z | import unittest
if __name__=='__main__':
nataf_test_suite = unittest.TestLoader().loadTestsFromTestCase(
TestNatafTransformation)
unittest.TextTestRunner(verbosity=2).run(nataf_test_suite)
| 41.121951 | 79 | 0.676601 | from pyapprox.nataf_transformation import *
from pyapprox.probability_measure_sampling import rejection_sampling
from scipy.stats import norm as normal_rv
from scipy.stats import beta as beta_rv
from scipy.stats import gamma as gamma_rv
from functools import partial
import unittest
from pyapprox.utilities import get_te... | 0 | 0 | 0 | 6,170 | 0 | 0 | 0 | 179 | 176 |
5de1432d9c58c7669d666ded7e525494abba4f8f | 1,430 | py | Python | speedtest.py | class-tools/Web-Class-Helper | bfcbf9a6931f7fa1e782a547bf56a608aaecd9b8 | [
"MIT"
] | 1 | 2022-03-19T06:38:39.000Z | 2022-03-19T06:38:39.000Z | speedtest.py | class-tools/Web-Class-Helper | bfcbf9a6931f7fa1e782a547bf56a608aaecd9b8 | [
"MIT"
] | 2 | 2022-03-19T03:12:18.000Z | 2022-03-22T05:44:24.000Z | speedtest.py | class-tools/Web-Class-Helper | bfcbf9a6931f7fa1e782a547bf56a608aaecd9b8 | [
"MIT"
] | null | null | null | '''
Web Class Helper Speed Testing Module 2.0.1
This source code file is under MIT License.
Copyright (c) 2022 Class Tools Develop Team
Contributors: jsh-jsh ren-yc
'''
root = Tk()
root.geometry('200x100')
root.title('Speed Test')
root.resizable(width = False, height = False)
Label(width = 100, height = 50, name = 'sp... | 30.425532 | 110 | 0.639161 | '''
Web Class Helper Speed Testing Module 2.0.1
This source code file is under MIT License.
Copyright (c) 2022 Class Tools Develop Team
Contributors: jsh-jsh ren-yc
'''
import psutil
import sys
from tkinter import *
from tkinter.messagebox import showerror
from time import sleep
def errno_1():
showerror(title = "F... | 18 | 0 | 0 | 0 | 0 | 791 | 0 | 1 | 179 |
c144aea2da65c1a76ec764fab14ae5d70088b049 | 9,892 | py | Python | app/api/api_class.py | azumia/huatian-admin-be | 2cfa118477327eef3369887c8039bdc807bcd3e2 | [
"MIT"
] | null | null | null | app/api/api_class.py | azumia/huatian-admin-be | 2cfa118477327eef3369887c8039bdc807bcd3e2 | [
"MIT"
] | null | null | null | app/api/api_class.py | azumia/huatian-admin-be | 2cfa118477327eef3369887c8039bdc807bcd3e2 | [
"MIT"
] | null | null | null | import logging
from flask import Blueprint
bp = Blueprint("class", __name__, url_prefix='/class/')
logger = logging.getLogger(__name__)
| 34.830986 | 132 | 0.598868 | import logging
import random
from types import CodeType, new_class
import uuid
import os
from flask import Blueprint, jsonify, session, request, current_app
from datetime import datetime, timedelta
from decimal import Decimal
from sqlalchemy.sql.expression import null
from app.models.model import Class, StuCls, Studen... | 501 | 8,503 | 0 | 0 | 0 | 0 | 0 | 504 | 580 |
0d7c9d84d6540a05cf97d6e841351a13d9203cee | 2,877 | py | Python | CartPole-v0_4_Double_Q-Learning.py | AntonSax/openai-gym | c6d636aee62c4883287bf826b72e5e6b0ddf19c0 | [
"MIT"
] | null | null | null | CartPole-v0_4_Double_Q-Learning.py | AntonSax/openai-gym | c6d636aee62c4883287bf826b72e5e6b0ddf19c0 | [
"MIT"
] | null | null | null | CartPole-v0_4_Double_Q-Learning.py | AntonSax/openai-gym | c6d636aee62c4883287bf826b72e5e6b0ddf19c0 | [
"MIT"
] | null | null | null | import numpy as np
import gym
#discretize the spaces
pole_theta_space = np.linspace(-0.20943951, 0.20943951, 10)
pole_theta_velocity_space = np.linspace(-4, 4, 10)
cart_position_space = np.linspace(-2.4, 2.4, 10)
cart_velocity_space = np.linspace(-4, 4, 10)
if __name__ == '__main__':
env = gym.make('CartPole-v0')... | 32.325843 | 83 | 0.606882 | import numpy as np
import matplotlib.pyplot as plt
import gym
def maxAction(Q1, Q2, state):
values = np.array([Q1[state,a] + Q2[state,a] for a in range(2)])
action = np.argmax(values)
return action
#discretize the spaces
pole_theta_space = np.linspace(-0.20943951, 0.20943951, 10)
pole_theta_velocity_space... | 0 | 0 | 0 | 0 | 0 | 742 | 0 | 10 | 91 |
c8f580ad26bcba621812e6da82734455d7c3a325 | 555 | py | Python | src/angr/radare2/serial/reverse/solve.py | Sylhare/Flag | 8f056593466c8611fae0f5ed0d39c711f694f41b | [
"MIT"
] | null | null | null | src/angr/radare2/serial/reverse/solve.py | Sylhare/Flag | 8f056593466c8611fae0f5ed0d39c711f694f41b | [
"MIT"
] | 4 | 2019-02-06T16:08:56.000Z | 2019-03-17T20:12:50.000Z | src/angr/radare2/serial/reverse/solve.py | Sylhare/Flag | 8f056593466c8611fae0f5ed0d39c711f694f41b | [
"MIT"
] | null | null | null |
"""
Solving reserial - NOT WORKING
flag: EZAV
```
python solve.py
```
"""
if __name__ == "__main__":
main()
| 17.903226 | 57 | 0.695495 | import angr
import sys
"""
Solving reserial - NOT WORKING
flag: EZAV
```
python solve.py
```
"""
def main():
proj = angr.Project("reserial")
state = proj.factory.blank_state(addr=0x100000ea4)
simgr = proj.factory.simulation_manager(state)
simgr.explore(find=0x100000f30)
solution_state = simgr... | 0 | 0 | 0 | 0 | 0 | 392 | 0 | -21 | 67 |
87325a06d7aabe469b3212f8c4c6ef5766437234 | 1,452 | py | Python | developing/misc/GUI.py | Pyro4Bot-RoboLab/PYRobot | 917ec23f2abf483a29f652cd2b43e1eaa49b82be | [
"MIT"
] | null | null | null | developing/misc/GUI.py | Pyro4Bot-RoboLab/PYRobot | 917ec23f2abf483a29f652cd2b43e1eaa49b82be | [
"MIT"
] | null | null | null | developing/misc/GUI.py | Pyro4Bot-RoboLab/PYRobot | 917ec23f2abf483a29f652cd2b43e1eaa49b82be | [
"MIT"
] | null | null | null |
Application()
| 29.632653 | 68 | 0.626722 | from tkinter import *
from misc.findrobots import findrobots
class Application:
def __init__(self):
self.window = Tk()
# Adding a menu bar
self.menu_bar = Menu(self.window)
# Adding the file menu in the menu bar
self.file_menu = Menu(self.menu_bar, tearoff=0)
sel... | 0 | 0 | 0 | 1,351 | 0 | 0 | 0 | 17 | 67 |
918f2179ae201870a1d333f929b08edd43bfc3a3 | 5,608 | py | Python | otto-network-setup.py | ntc-chip-revived/otto-network-setup | 81b197e37cff1a2cb0ad8b9f7345cc86d89666e2 | [
"MIT"
] | null | null | null | otto-network-setup.py | ntc-chip-revived/otto-network-setup | 81b197e37cff1a2cb0ad8b9f7345cc86d89666e2 | [
"MIT"
] | null | null | null | otto-network-setup.py | ntc-chip-revived/otto-network-setup | 81b197e37cff1a2cb0ad8b9f7345cc86d89666e2 | [
"MIT"
] | 1 | 2020-08-16T07:31:37.000Z | 2020-08-16T07:31:37.000Z | #!/usr/bin/python
import subprocess
import bottle
from bottle import route, static_file, debug, run, get, redirect
from bottle import post, request, template, response
import os, inspect, json, time, sys
import random
from threading import Thread, RLock
#enable bottle debug
debug(True)
# WebApp route path
# get dir... | 29.829787 | 120 | 0.624108 | #!/usr/bin/python
import subprocess
import bottle
from bottle import route, static_file, debug, run, get, redirect
from bottle import post, request, template, response
import os, inspect, json, time, sys
import random
from threading import Thread, RLock
#enable bottle debug
debug(True)
# WebApp route path
# get dir... | 0 | 3,090 | 0 | 0 | 0 | 1,041 | 0 | 0 | 276 |
7bd4c4a32fbc76e4c0e08e85eb3a4bd19e9b9733 | 2,745 | py | Python | pycloud/pycloud/model/user.py | SEI-AMS/pycloud | 62764e9d2aae280e019306e3b151b7218bf82f4d | [
"MIT"
] | 14 | 2015-08-20T11:54:56.000Z | 2018-05-23T21:07:44.000Z | pycloud/pycloud/model/user.py | SEI-TAS/pycloud | 62764e9d2aae280e019306e3b151b7218bf82f4d | [
"MIT"
] | 10 | 2015-10-17T07:33:54.000Z | 2018-04-27T20:50:52.000Z | pycloud/pycloud/model/user.py | SEI-AMS/pycloud | 62764e9d2aae280e019306e3b151b7218bf82f4d | [
"MIT"
] | 8 | 2016-03-31T07:04:26.000Z | 2018-04-09T18:08:10.000Z | # KVM-based Discoverable Cloudlet (KD-Cloudlet)
# Copyright (c) 2015 Carnegie Mellon University.
# All Rights Reserved.
#
# THIS SOFTWARE IS PROVIDED "AS IS," WITH NO WARRANTIES WHATSOEVER. CARNEGIE MELLON UNIVERSITY EXPRESSLY DISCLAIMS TO THE FULLEST EXTENT PERMITTEDBY LAW ALL EXPRESS, IMPLIED, AND STATUTORY WARRANT... | 42.230769 | 344 | 0.530055 | # KVM-based Discoverable Cloudlet (KD-Cloudlet)
# Copyright (c) 2015 Carnegie Mellon University.
# All Rights Reserved.
#
# THIS SOFTWARE IS PROVIDED "AS IS," WITH NO WARRANTIES WHATSOEVER. CARNEGIE MELLON UNIVERSITY EXPRESSLY DISCLAIMS TO THE FULLEST EXTENT PERMITTEDBY LAW ALL EXPRESS, IMPLIED, AND STATUTORY WARRANT... | 0 | 158 | 0 | 1,011 | 0 | 0 | 0 | 16 | 67 |
65f108f9e80250522f0fde104b71f1f7901ed661 | 920 | py | Python | src/pyams_file/interfaces/archive.py | Py-AMS/pyams-file | a5155791787ba38e221896e9ce7d33177ae8a05b | [
"ZPL-2.1"
] | null | null | null | src/pyams_file/interfaces/archive.py | Py-AMS/pyams-file | a5155791787ba38e221896e9ce7d33177ae8a05b | [
"ZPL-2.1"
] | null | null | null | src/pyams_file/interfaces/archive.py | Py-AMS/pyams-file | a5155791787ba38e221896e9ce7d33177ae8a05b | [
"ZPL-2.1"
] | null | null | null | #
# Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net>
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRAN... | 28.75 | 75 | 0.741304 | #
# Copyright (c) 2008-2015 Thierry Florac <tflorac AT ulthar.net>
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
# WARRAN... | 0 | 0 | 0 | 220 | 0 | 0 | 0 | 15 | 46 |
39670e5990a61002823abc8c9d4762fcb932ab37 | 183 | py | Python | test3.py | liubaishuo-github/peening-post-processor | 61f4c2d2385469bc1e9d1b7a692b72eb6afd7f75 | [
"MIT"
] | null | null | null | test3.py | liubaishuo-github/peening-post-processor | 61f4c2d2385469bc1e9d1b7a692b72eb6afd7f75 | [
"MIT"
] | null | null | null | test3.py | liubaishuo-github/peening-post-processor | 61f4c2d2385469bc1e9d1b7a692b72eb6afd7f75 | [
"MIT"
] | null | null | null | import rotation_matrix
x_apt = 30
y_apt = -7.6
z_apt = 22
ii = -0.5
jj = -0.6
kk = 0.33
last_b = 30.234
rotation_matrix.transf(x_apt, y_apt, z_apt, ii, jj, kk, last_b)
| 14.076923 | 64 | 0.622951 | import rotation_matrix
x_apt = 30
y_apt = -7.6
z_apt = 22
ii = -0.5
jj = -0.6
kk = 0.33
last_b = 30.234
rotation_matrix.transf(x_apt, y_apt, z_apt, ii, jj, kk, last_b)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
578371437081a0f33464e1315a35e142ac8ff31c | 1,681 | py | Python | scripts/ci/copyright_check.py | danielsn/rmc | 8b23f12502cbb1b4d0458b2bb4d47e0312dc7a5d | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | scripts/ci/copyright_check.py | danielsn/rmc | 8b23f12502cbb1b4d0458b2bb4d47e0312dc7a5d | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | scripts/ci/copyright_check.py | danielsn/rmc | 8b23f12502cbb1b4d0458b2bb4d47e0312dc7a5d | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2021-08-21T23:39:31.000Z | 2021-08-21T23:39:31.000Z | #!/usr/bin/python3
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0 OR MIT
import sys
if __name__ == "__main__":
filenames = sys.argv[1:]
checks = [copyright_check(fname) for fname in filenames]
for i in range(len(filenames)):
print(f'C... | 32.326923 | 100 | 0.657347 | #!/usr/bin/python3
# Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
# SPDX-License-Identifier: Apache-2.0 OR MIT
import re
import sys
def copyright_check(filename):
fo = open(filename)
lines = fo.readlines()
# The check is failed if the file is empty
if len(lines) == 0:
ret... | 0 | 0 | 0 | 0 | 0 | 1,159 | 0 | -12 | 45 |
bc605bea67a9e2a0931b942e465f1433ea6ca077 | 3,696 | py | Python | secure_socket.py | arthurdais/mimic-socks | dac3f1ad9255ce306662b30ee22c262e92718264 | [
"MIT"
] | null | null | null | secure_socket.py | arthurdais/mimic-socks | dac3f1ad9255ce306662b30ee22c262e92718264 | [
"MIT"
] | null | null | null | secure_socket.py | arthurdais/mimic-socks | dac3f1ad9255ce306662b30ee22c262e92718264 | [
"MIT"
] | null | null | null | import logging
ENCODING = 'utf-8'
LEN_COLUMN_LEN = 6
iv_param = 'This is an IV456'
CRYPTO_INPUT_LEN_UNIT = 16
CIPHER_LEN_UNIT = 16 # aes16
MAX_SALT_LEN = CIPHER_LEN_UNIT * 100 - 1 # pack(CIPHER_LEN_UNIT)
logging.basicConfig(level=logging.INFO)
if __name__ == '__main__':
sock = SecureSocket('', 'ThisIs SecretKey'... | 35.2 | 105 | 0.67289 |
from random import randint, sample, choice
import string
from Crypto.Cipher import AES
import struct
import select
import logging
from socket_bytes_producer import SocketBytesProducer
ENCODING = 'utf-8'
LEN_COLUMN_LEN = 6
iv_param = 'This is an IV456'
CRYPTO_INPUT_LEN_UNIT = 16
CIPHER_LEN_UNIT = 16 # aes密文长度为16的倍数
MA... | 192 | 0 | 0 | 2,825 | 0 | 0 | 0 | 37 | 156 |
e9540224efd859e48f9e719325bea31c54c000c4 | 920 | py | Python | tests/test_localapi.py | Mike-de-bike/python-airzone | 8e87b15f1690075d0dcbad3012d0910706dedab6 | [
"MIT"
] | null | null | null | tests/test_localapi.py | Mike-de-bike/python-airzone | 8e87b15f1690075d0dcbad3012d0910706dedab6 | [
"MIT"
] | null | null | null | tests/test_localapi.py | Mike-de-bike/python-airzone | 8e87b15f1690075d0dcbad3012d0910706dedab6 | [
"MIT"
] | null | null | null | """Local Api tests."""
import os
from airzone.localapi import OperationMode, Speed
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
response_test_path = os.path.join(THIS_DIR, "data/response.json")
def test_create_machine(mock_machine):
"""Test the creation of a machine and zones with a valid json."""
... | 30.666667 | 73 | 0.715217 | """Local Api tests."""
import json
import os
import pytest # type: ignore
import requests_mock # type: ignore
from airzone.localapi import Machine, OperationMode, Speed
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
response_test_path = os.path.join(THIS_DIR, "data/response.json")
@pytest.fixture
def mock... | 0 | 383 | 0 | 0 | 0 | 0 | 0 | -10 | 122 |
ac3518fe88dc81fc044e8568d8c81557665448b9 | 10,721 | py | Python | mla/mla/injection.py | jasonfan1997/umd_icecube_analysis_tutorial | 50bf3af27f81d719953ac225f199e733b5c0bddf | [
"Apache-2.0"
] | null | null | null | mla/mla/injection.py | jasonfan1997/umd_icecube_analysis_tutorial | 50bf3af27f81d719953ac225f199e733b5c0bddf | [
"Apache-2.0"
] | null | null | null | mla/mla/injection.py | jasonfan1997/umd_icecube_analysis_tutorial | 50bf3af27f81d719953ac225f199e733b5c0bddf | [
"Apache-2.0"
] | null | null | null | '''Spectral Modelling'''
from __future__ import print_function, division
| 46.613043 | 150 | 0.557317 | '''Spectral Modelling'''
from __future__ import print_function, division
import numpy as np
import numpy.lib.recfunctions as rf
from mla.spectral import *
from mla.timing import *
import scipy.stats
from mla import tools
class PSinjector(object):
r'''injector of point source'''
def __init__(self, spectrum, mc... | 0 | 0 | 0 | 10,468 | 0 | 0 | 0 | 16 | 155 |
87bd75ce94ba637a8d92c812bb8c0ba33947dd4f | 9,941 | py | Python | ptstructure/layout/ptppyolov2/ppyolov2_layout.py | Amanda-Barbara/PaddleOCR2Pytorch | 7f2c85f23b13981a48a37cb90160dcd69cf21260 | [
"Apache-2.0"
] | null | null | null | ptstructure/layout/ptppyolov2/ppyolov2_layout.py | Amanda-Barbara/PaddleOCR2Pytorch | 7f2c85f23b13981a48a37cb90160dcd69cf21260 | [
"Apache-2.0"
] | null | null | null | ptstructure/layout/ptppyolov2/ppyolov2_layout.py | Amanda-Barbara/PaddleOCR2Pytorch | 7f2c85f23b13981a48a37cb90160dcd69cf21260 | [
"Apache-2.0"
] | null | null | null | import torch.nn as nn
ALL_CLASSES_PubLayNet = [
'Text', 'Title', 'List', 'Table', 'Figure',
] # PubLayNet
ALL_CLASSES_TableBank = ['Table'] # TableBank
| 37.093284 | 117 | 0.578916 | import os, sys
import numpy as np
import cv2
import torch
import torch.nn as nn
from .ppyolov2_base import PPYOLOv2Base
from .utils import Decode
from .pt_utils import yolo_box, matrix_nms
ALL_CLASSES_PubLayNet = [
'Text', 'Title', 'List', 'Table', 'Figure',
] # PubLayNet
ALL_CLASSES_TableBank = ['Tabl... | 0 | 106 | 0 | 9,452 | 0 | 0 | 0 | 13 | 200 |
8a01297d9b6592445047efa7c1c7e3649142cb0a | 1,013 | py | Python | caixeiro_viajante/main.py | danielicapui/topicos-uern | 99fc93855c234c9c31704468962dd95dc081f5e6 | [
"MIT"
] | null | null | null | caixeiro_viajante/main.py | danielicapui/topicos-uern | 99fc93855c234c9c31704468962dd95dc081f5e6 | [
"MIT"
] | null | null | null | caixeiro_viajante/main.py | danielicapui/topicos-uern | 99fc93855c234c9c31704468962dd95dc081f5e6 | [
"MIT"
] | null | null | null | import sys
if __name__=='__main__':
main(sys.argv) | 37.518519 | 88 | 0.731491 | import sys
from heuristica import *
from adapter import Adapter
from guloso import rotaMinima
def mostrar_guloso(matriz):
global rota_inicial,custo_inicial
rota_inicial,custo_inicial=Adapter.adaptar_rota(Adapter.adaptar_matriz(matriz,0,-1))
print("Algoritmo guloso")
print(f'Custo total:{custo_inicial} e... | 0 | 0 | 0 | 0 | 0 | 810 | 0 | 17 | 132 |
fabae91abab8c362ced97a0cce43d8dd55da6c70 | 1,524 | py | Python | archive/production/load_cabi_tracker.py | georgetown-analytics/DC-Bikeshare | 9f5a6a3256cff15a29f0dca6e9a9d8098ab2df28 | [
"MIT"
] | 11 | 2018-07-01T16:43:05.000Z | 2020-07-17T19:08:16.000Z | archive/production/load_cabi_tracker.py | noahnewberger/Bikeshare-DC | 42676654d103cdaddfb76db76d1eece533251261 | [
"MIT"
] | 5 | 2021-02-08T20:21:12.000Z | 2021-12-13T19:47:04.000Z | archive/production/load_cabi_tracker.py | noahnewberger/Bikeshare-DC | 42676654d103cdaddfb76db76d1eece533251261 | [
"MIT"
] | 5 | 2018-10-05T19:54:20.000Z | 2020-10-27T11:54:09.000Z | import pandas as pd
import numpy as np
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
import zipfile
gauth = GoogleAuth()
gauth.LocalWebserverAuth() # Creates local webserver and auto handles authentication.
drive = GoogleDrive(gauth)
# Download all CaBi Tracker files from our Google Dri... | 39.076923 | 125 | 0.701444 | import requests
import pandas as pd
import numpy as np
import io
from datetime import date, timedelta
from pydrive.auth import GoogleAuth
from pydrive.drive import GoogleDrive
import zipfile
gauth = GoogleAuth()
gauth.LocalWebserverAuth() # Creates local webserver and auto handles authentication.
drive = GoogleDrive... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 66 |
dd4601cc36a9f085dd1ccaa2f6d3429ddaa23a3b | 215 | py | Python | ege/prog_task_list.py | dluschan/olymp | dfbf4352dbc7f6fd7563e7bd19aff6fd67fb50b7 | [
"MIT"
] | null | null | null | ege/prog_task_list.py | dluschan/olymp | dfbf4352dbc7f6fd7563e7bd19aff6fd67fb50b7 | [
"MIT"
] | null | null | null | ege/prog_task_list.py | dluschan/olymp | dfbf4352dbc7f6fd7563e7bd19aff6fd67fb50b7 | [
"MIT"
] | 1 | 2018-09-14T18:50:48.000Z | 2018-09-14T18:50:48.000Z | task = [[i + 1, 0] for i in range(12)]
for i in range(int(input())):
task[int(input()) - 1][1] += 1
for i, t in sorted(filter(lambda t: t[1] != 0, task), key = lambda x: x[1], reverse = True):
print(i, t)
| 26.875 | 92 | 0.544186 | task = [[i + 1, 0] for i in range(12)]
for i in range(int(input())):
task[int(input()) - 1][1] += 1
for i, t in sorted(filter(lambda t: t[1] != 0, task), key = lambda x: x[1], reverse = True):
print(i, t)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fada4fdbfd7d89eacbc57838d062c8af684571ce | 8,615 | py | Python | os_charms_tools/rendered_bundle.py | n-pochet/openstack-charms-tools | b21e2e92f7f628e554c07237117f8ab7ff7c8da4 | [
"Apache-2.0"
] | null | null | null | os_charms_tools/rendered_bundle.py | n-pochet/openstack-charms-tools | b21e2e92f7f628e554c07237117f8ab7ff7c8da4 | [
"Apache-2.0"
] | null | null | null | os_charms_tools/rendered_bundle.py | n-pochet/openstack-charms-tools | b21e2e92f7f628e554c07237117f8ab7ff7c8da4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright 2017 Canonical Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 36.504237 | 79 | 0.599304 | #!/usr/bin/env python3
#
# Copyright 2017 Canonical Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 0 | 0 | 0 | 7,289 | 0 | 0 | 0 | 120 | 180 |
807fc9cdbb333eb0f7fb93e6c9c0fc909c2c9f2a | 1,522 | py | Python | ALGO/sorting/insertion_sort.py | jainrocky/LORD | 15c923129f6d5e024f6606a7d6005adfc9f9af90 | [
"MIT"
] | 2 | 2020-09-24T21:24:26.000Z | 2021-11-03T09:15:40.000Z | ALGO/sorting/insertion_sort.py | jainrocky/LORD | 15c923129f6d5e024f6606a7d6005adfc9f9af90 | [
"MIT"
] | 4 | 2021-06-08T22:23:44.000Z | 2022-03-12T00:48:19.000Z | ALGO/sorting/insertion_sort.py | jainrocky/LORD | 15c923129f6d5e024f6606a7d6005adfc9f9af90 | [
"MIT"
] | 1 | 2021-02-22T06:11:38.000Z | 2021-02-22T06:11:38.000Z | import os, sys, random
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'utils'))
if __name__=='__main__':
n = 100
item=[None]*n
for i in range(n):
item[i] = random.random()*100
insertion_sort(item, begin=0, end=len(item)-1, visualise=True)
more = False
i... | 29.269231 | 118 | 0.531537 | import os, sys, random, warnings
sys.path.append(os.path.join(os.path.dirname(__file__), '..', '..', 'utils'))
from sorting_visualise import vis
def insertion_sort(item, begin, end, visualise=None, condition=None):
if condition is None:
condition=lambda first, second: first <= second
if visualise:
... | 0 | 0 | 0 | 0 | 0 | 792 | 0 | 22 | 45 |
132cfde7e22480231cf035ccec9d27bf1bb5fe86 | 2,015 | py | Python | tests/test_sensor.py | xxoolm/integration | b4ae25f42ca78ec671354972f53871e4d5b66972 | [
"MIT"
] | null | null | null | tests/test_sensor.py | xxoolm/integration | b4ae25f42ca78ec671354972f53871e4d5b66972 | [
"MIT"
] | 45 | 2021-07-21T13:32:44.000Z | 2022-03-28T06:15:40.000Z | tests/test_sensor.py | xxoolm/integration | b4ae25f42ca78ec671354972f53871e4d5b66972 | [
"MIT"
] | null | null | null | """HACS Sensor Test Suite."""
# pylint: disable=missing-docstring
| 30.530303 | 73 | 0.737469 | """HACS Sensor Test Suite."""
# pylint: disable=missing-docstring
import pytest
from custom_components.hacs.repositories import HacsIntegrationRepository
from custom_components.hacs.sensor import (
HACSSensor,
async_setup_entry,
async_setup_platform,
)
def mock_setup(entities): # pylint: disable=unused-... | 0 | 1,147 | 0 | 0 | 0 | 482 | 0 | 133 | 182 |
5d97bde6d9305d921ebf4e627eed4c3a4c4333e1 | 639 | py | Python | plus_one.py | erjan/coding_exercises | 53ba035be85f1e7a12b4d4dbf546863324740467 | [
"Apache-2.0"
] | null | null | null | plus_one.py | erjan/coding_exercises | 53ba035be85f1e7a12b4d4dbf546863324740467 | [
"Apache-2.0"
] | null | null | null | plus_one.py | erjan/coding_exercises | 53ba035be85f1e7a12b4d4dbf546863324740467 | [
"Apache-2.0"
] | null | null | null | '''
Given a non-empty array of digits representing a
non-negative integer, plus one to the integer.
The digits are stored such that the most significant digit is at the
head of the list, and each element in the array contain a single digit.
You may assume the integer does not contain any leading zero, except the nu... | 25.56 | 89 | 0.615023 | '''
Given a non-empty array of digits representing a
non-negative integer, plus one to the integer.
The digits are stored such that the most significant digit is at the
head of the list, and each element in the array contain a single digit.
You may assume the integer does not contain any leading zero, except the nu... | 0 | 0 | 0 | 275 | 0 | 0 | 0 | 0 | 23 |
9fb444e98e90ad70258cea8cacd863260f84e73e | 6,674 | py | Python | post_process.py | kslam07/RWA3-UA | b786659783901196554bd1b93f2c790f4b9a574b | [
"MIT"
] | null | null | null | post_process.py | kslam07/RWA3-UA | b786659783901196554bd1b93f2c790f4b9a574b | [
"MIT"
] | null | null | null | post_process.py | kslam07/RWA3-UA | b786659783901196554bd1b93f2c790f4b9a574b | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
def plot_circulatory_loads(alpha_circ, dalpha_circ, cl_circ, cl_ss, x_wake, y_wake, u_inf, c, time_arr, plot_wake=False):
"""
Plots the circulatory and non-circulatory CL as function of the angle of attack, alpha
:param alpha_circ: corresponding AoA for ... | 38.356322 | 121 | 0.577465 | import numpy as np
import matplotlib.pyplot as plt
import numba as nb
@nb.njit
def lumpvor2d(xcol, zcol, xvor, zvor, circvor=1):
"""
Compute the velocity at an arbitrary collocation point (xcol, zcol) due
to vortex element of circulation circvor, placed at (xvor, zvor).
:param xcol: x-coordinate of t... | 0 | 3,336 | 0 | 0 | 0 | 0 | 0 | -3 | 91 |
eca75df50474ce2c977256304f0c599943eb4269 | 494 | py | Python | signatures/decode.py | CybercentreCanada/assemblyline-service-jsjaws | 957f1d9de5d0446286ad728dc4d64b94ea0499e8 | [
"MIT"
] | null | null | null | signatures/decode.py | CybercentreCanada/assemblyline-service-jsjaws | 957f1d9de5d0446286ad728dc4d64b94ea0499e8 | [
"MIT"
] | null | null | null | signatures/decode.py | CybercentreCanada/assemblyline-service-jsjaws | 957f1d9de5d0446286ad728dc4d64b94ea0499e8 | [
"MIT"
] | null | null | null | """
These are all of the signatures related to decoding
"""
| 26 | 82 | 0.607287 | """
These are all of the signatures related to decoding
"""
from signatures.abstracts import Signature
class Unescape(Signature):
def __init__(self):
super().__init__(
heuristic_id=3,
name="unescape",
description="JavaScript uses unescape() to decode an encod... | 0 | 0 | 0 | 360 | 0 | 0 | 0 | 21 | 48 |
b7c6847834a869b008cf6fe82b0c09997aa5ab13 | 1,324 | py | Python | fapws2/log.py | william-os4y/fapws2 | 5752af742b763517ce0a52d0f0c00b40b186edf8 | [
"MIT"
] | 2 | 2016-05-08T16:02:32.000Z | 2018-02-17T15:03:09.000Z | fapws2/log.py | william-os4y/fapws2 | 5752af742b763517ce0a52d0f0c00b40b186edf8 | [
"MIT"
] | null | null | null | fapws2/log.py | william-os4y/fapws2 | 5752af742b763517ce0a52d0f0c00b40b186edf8 | [
"MIT"
] | null | null | null | # stdlib imports
import sys
import time
# FAPWS imports
import config
import errors
access_logfid = sys.stdout
error_logfid = sys.stdout
def setup():
'''Update some global variables based on command-line configuration.
'''
try:
if config.conf['error_log']:
error_logfid... | 32.292683 | 135 | 0.570997 | # stdlib imports
import sys
import time
# FAPWS imports
import config
import errors
access_logfid = sys.stdout
error_logfid = sys.stdout
def error(data):
ts = time.strftime('%d/%b/%Y:%H:%M:%S', time.gmtime())
error_logfid.write("%s: %s\n" % (ts, data))
error_logfid.flush()
def access(ip,... | 0 | 0 | 0 | 0 | 0 | 415 | 0 | 0 | 50 |
3474daf56431eddd7ac31e9b804091177430700b | 11,372 | py | Python | SC101 - Github/Class&Object (Campy, Mouse Event)/my_drawing.py | huangichen97/sc-projects | ddbbe32f68d8257027973520efd0282ee4c79513 | [
"MIT"
] | 1 | 2020-12-22T15:28:28.000Z | 2020-12-22T15:28:28.000Z | SC101 - Github/Class&Object (Campy, Mouse Event)/my_drawing.py | huangichen97/sc-projects | ddbbe32f68d8257027973520efd0282ee4c79513 | [
"MIT"
] | null | null | null | SC101 - Github/Class&Object (Campy, Mouse Event)/my_drawing.py | huangichen97/sc-projects | ddbbe32f68d8257027973520efd0282ee4c79513 | [
"MIT"
] | null | null | null | """
File: my_drawing.py
Name: Ethan Huang
----------------------
TODO:
This program is a drawing I create for the drawing competition of StanCode101
It builds an interface from the background to the front layer,
mimicking the "Kahoot" game to ask users to choose the real Karel.
"""
from campy.graphics.gobjects import ... | 28.079012 | 77 | 0.620735 | """
File: my_drawing.py
Name: Ethan Huang
----------------------
TODO:
This program is a drawing I create for the drawing competition of StanCode101
It builds an interface from the background to the front layer,
mimicking the "Kahoot" game to ask users to choose the real Karel.
"""
from campy.graphics.gobjects import ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
71f274344498c9a16419b5175e0001414a11003b | 3,813 | py | Python | dotsandboxes/DotsAndBoxesGame.py | user01/alpha-zero-general | 7edf122015e02a2e78168ac9f6eaa5c5e20600cc | [
"MIT"
] | 2,836 | 2017-12-18T02:11:38.000Z | 2022-03-30T09:07:15.000Z | dotsandboxes/DotsAndBoxesGame.py | user01/alpha-zero-general | 7edf122015e02a2e78168ac9f6eaa5c5e20600cc | [
"MIT"
] | 212 | 2017-12-28T06:47:57.000Z | 2022-01-06T20:22:26.000Z | dotsandboxes/DotsAndBoxesGame.py | user01/alpha-zero-general | 7edf122015e02a2e78168ac9f6eaa5c5e20600cc | [
"MIT"
] | 892 | 2017-12-18T08:56:45.000Z | 2022-03-29T23:00:45.000Z | import sys
sys.path.append('..')
| 30.261905 | 109 | 0.521637 | import sys
import numpy as np
sys.path.append('..')
from Game import Game
from .DotsAndBoxesLogic import Board
class DotsAndBoxesGame(Game):
def __init__(self, n=3):
self.n = n
def getInitBoard(self):
# return initial board (numpy board)
b = Board(self.n)
return np.array(b.pi... | 0 | 504 | 0 | 3,174 | 0 | 0 | 0 | 12 | 89 |
84a3866d9a00f4da80684854da25b223b27e4b1a | 2,323 | py | Python | Week6/convertCSV2JSON.py | SiebrenKazemier/DataVisualisatie | 5ab2f2c2c2722fb03f33387e6be41a62a4f7f286 | [
"BSD-3-Clause"
] | null | null | null | Week6/convertCSV2JSON.py | SiebrenKazemier/DataVisualisatie | 5ab2f2c2c2722fb03f33387e6be41a62a4f7f286 | [
"BSD-3-Clause"
] | null | null | null | Week6/convertCSV2JSON.py | SiebrenKazemier/DataVisualisatie | 5ab2f2c2c2722fb03f33387e6be41a62a4f7f286 | [
"BSD-3-Clause"
] | null | null | null | ###############################################################################
# Name: Siebren Kazemier
# Student number: 12516597
# School: Uva
# Project: Assignment week 4, Converting CSV file to JSON
###############################################################################
# csv_file = read_csv("voorraad_won... | 37.467742 | 79 | 0.63969 | ###############################################################################
# Name: Siebren Kazemier
# Student number: 12516597
# School: Uva
# Project: Assignment week 4, Converting CSV file to JSON
###############################################################################
import pandas as pd
# csv_file = r... | 0 | 0 | 0 | 0 | 0 | 1,776 | 0 | -2 | 115 |
4f1f7b37b6c52228a8018893f575ac237bcd3e04 | 343 | py | Python | 40 Algorithm challenge/challenge 11.py | T0dCNg/All-In-One | f86d7f46d3a4fafde5c5d087cffe1e3414870c48 | [
"Unlicense"
] | 1 | 2022-01-27T16:28:51.000Z | 2022-01-27T16:28:51.000Z | 40 Algorithm challenge/challenge 11.py | T0dCNg/All-In-One | f86d7f46d3a4fafde5c5d087cffe1e3414870c48 | [
"Unlicense"
] | null | null | null | 40 Algorithm challenge/challenge 11.py | T0dCNg/All-In-One | f86d7f46d3a4fafde5c5d087cffe1e3414870c48 | [
"Unlicense"
] | null | null | null | #Challenge 11
#The program asks the user to input two numbers.
#It will then outputthe larger of these two numbers.
num1 = int(input("please enter a number: "))
num2 = int(input("please enter a second number: "))
if num1 > num2:
print("Num1 is bigger")
elif num2 > num1:
print("Num2 is bigger")
else:
pr... | 24.5 | 53 | 0.682216 | #Challenge 11
#The program asks the user to input two numbers.
#It will then outputthe larger of these two numbers.
num1 = int(input("please enter a number: "))
num2 = int(input("please enter a second number: "))
if num1 > num2:
print("Num1 is bigger")
elif num2 > num1:
print("Num2 is bigger")
else:
pr... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
80297a64130b389ca1ae389aada77e0fa7b2f586 | 16,078 | py | Python | relogic/textkit/semparse/sql/crawled_sql/sql_preprocess.py | Impavidity/data_preprocessing | 47ebbf69fa5d853441e517bb8d4919ceb8552a06 | [
"MIT"
] | null | null | null | relogic/textkit/semparse/sql/crawled_sql/sql_preprocess.py | Impavidity/data_preprocessing | 47ebbf69fa5d853441e517bb8d4919ceb8552a06 | [
"MIT"
] | null | null | null | relogic/textkit/semparse/sql/crawled_sql/sql_preprocess.py | Impavidity/data_preprocessing | 47ebbf69fa5d853441e517bb8d4919ceb8552a06 | [
"MIT"
] | null | null | null | import json
if __name__ == "__main__":
sqls = []
sql = "SELECT feature_id AS glycine_trna_primary_transcript_id, feature.* FROM feature INNER JOIN cvterm ON (feature.type_id = cvterm.cvterm_id) WHERE cvterm.name = 'glycine_tRNA_primary_transcript'"
sqls.append(sql)
sql = "select * from students except all (s... | 64.830645 | 2,079 | 0.697972 | from relogic.textkit.semparse.sql.crawled_sql.sql_helper import get_query_tables, get_query_columns, get_query_tokens, generalize_sql
from relogic.textkit.semparse.sql.crawled_sql.verify_sequence import verify
import sqlparse
import copy
from moz_sql_parser import format, parse
import re
import json
def extract_tables... | 0 | 0 | 0 | 0 | 412 | 8,210 | 0 | 157 | 408 |
6415818612b9b00b2f69a98c4cba802c114d26cb | 5,055 | py | Python | extune/sacred/experiment.py | imsb-uke/podometric_u_net | a33afcc186d618889df73c7ab2941dfbb63574ac | [
"MIT"
] | null | null | null | extune/sacred/experiment.py | imsb-uke/podometric_u_net | a33afcc186d618889df73c7ab2941dfbb63574ac | [
"MIT"
] | null | null | null | extune/sacred/experiment.py | imsb-uke/podometric_u_net | a33afcc186d618889df73c7ab2941dfbb63574ac | [
"MIT"
] | null | null | null |
# from extune.settings import EXPERIMENTS_DIR, MODULE_DIR
# from extune.model import model_fn, train_fn, input_fn
from extune.sacred.ingredients import data_ingredient
# from network.config import Config
from sacred import Experiment
# from run_hyperband import cfg
# class trainingConfig(Config):
# # GPUs and... | 29.561404 | 91 | 0.692582 | import os
# from extune.settings import EXPERIMENTS_DIR, MODULE_DIR
from extune.sacred.utils import config_logger
# from extune.model import model_fn, train_fn, input_fn
from extune.sacred.ingredients import data_ingredient
from network.train_network import train_network
# from network.config import Config
from ten... | 0 | 3,863 | 0 | 215 | 0 | 0 | 0 | 71 | 182 |
1fe466362a9fb1ac0f05be41a151b53e7ebf60f9 | 1,063 | py | Python | check_db_connection.py | dvkruchinin/python_tr | eaa901759e78f6036491556f71f9f19d5830bd98 | [
"MIT"
] | null | null | null | check_db_connection.py | dvkruchinin/python_tr | eaa901759e78f6036491556f71f9f19d5830bd98 | [
"MIT"
] | null | null | null | check_db_connection.py | dvkruchinin/python_tr | eaa901759e78f6036491556f71f9f19d5830bd98 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding:utf-8
"""
Name : check_db_connection.py
Author : Dmitry Kruchinin
Date : 7/1/2021
Desc:
"""
from fixture.orm import ORMFixture
from model.group import Group
db = ORMFixture(host="localhost", database="addressbook", user="root", password="")
try:
groups = db.get_groups_lis... | 27.973684 | 83 | 0.677328 | #!/usr/bin/env python
# coding:utf-8
"""
Name : check_db_connection.py
Author : Dmitry Kruchinin
Date : 7/1/2021
Desc:
"""
from fixture.orm import ORMFixture
from model.group import Group
db = ORMFixture(host="localhost", database="addressbook", user="root", password="")
try:
groups = db.get_groups_lis... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f226f5b29cea6e5805d44621cabbfa69795b3ba2 | 69,288 | py | Python | pycti/api/opencti_api_client.py | rhaist/client-python | 680e656177736e181b5b39a3083c9c8e96cafdd9 | [
"Apache-2.0"
] | null | null | null | pycti/api/opencti_api_client.py | rhaist/client-python | 680e656177736e181b5b39a3083c9c8e96cafdd9 | [
"Apache-2.0"
] | null | null | null | pycti/api/opencti_api_client.py | rhaist/client-python | 680e656177736e181b5b39a3083c9c8e96cafdd9 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
import urllib3
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
| 35.243133 | 111 | 0.5449 | # coding: utf-8
import io
import magic
from typing import List
from deprecated import deprecated
import requests
import urllib3
import datetime
import dateutil.parser
import json
import logging
from pycti.api.opencti_api_connector import OpenCTIApiConnector
from pycti.api.opencti_api_job import OpenCTIApiJob
from py... | 0 | 36,482 | 0 | 31,005 | 0 | 0 | 0 | 901 | 798 |
b9e5b7fec5a918cefe1740a7563f8a590cb4003c | 11,039 | py | Python | antelope_core/entities/entities.py | AntelopeLCA/core | ee40685add52ba41a462e2147fe8c377c6ba2a80 | [
"BSD-3-Clause"
] | 1 | 2021-10-06T18:42:49.000Z | 2021-10-06T18:42:49.000Z | antelope_core/entities/entities.py | AntelopeLCA/core | ee40685add52ba41a462e2147fe8c377c6ba2a80 | [
"BSD-3-Clause"
] | 6 | 2021-01-09T08:56:46.000Z | 2022-03-29T08:26:21.000Z | antelope_core/entities/entities.py | AntelopeLCA/core | ee40685add52ba41a462e2147fe8c377c6ba2a80 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function, unicode_literals
entity_types = ('process', 'flow', 'quantity', 'fragment')
entity_refs = {
'process': 'exchange',
'flow': 'quantity',
'quantity': 'unit',
'fragment': 'fragment'
}
| 32.372434 | 120 | 0.557206 | from __future__ import print_function, unicode_literals
import uuid
from itertools import chain
from numbers import Number
from antelope import CatalogRef, BaseEntity, PropertyExists
from synonym_dict import LowerDict
entity_types = ('process', 'flow', 'quantity', 'fragment')
entity_refs = {
'process': 'exchang... | 0 | 944 | 0 | 9,570 | 0 | 28 | 0 | 52 | 204 |
c60c5448080cae4d43e5f8c21e210d3a8200a27e | 815 | py | Python | 03. G2EGM/last_period.py | alanlujan91/ConsumptionSavingNotebooks | 4455500d17fed4dd1f3f4844aeb5dd5d3b89903f | [
"MIT"
] | 20 | 2019-03-09T02:08:49.000Z | 2022-03-28T15:56:04.000Z | 03. G2EGM/last_period.py | alanlujan91/ConsumptionSavingNotebooks | 4455500d17fed4dd1f3f4844aeb5dd5d3b89903f | [
"MIT"
] | 1 | 2019-06-03T18:33:44.000Z | 2019-07-02T13:51:21.000Z | 03. G2EGM/last_period.py | alanlujan91/ConsumptionSavingNotebooks | 4455500d17fed4dd1f3f4844aeb5dd5d3b89903f | [
"MIT"
] | 34 | 2019-02-26T19:27:37.000Z | 2021-12-27T09:34:04.000Z |
# consav | 20.897436 | 59 | 0.516564 | import numpy as np
from numba import njit
import utility
# consav
from consav import linear_interp # for linear interpolation
@njit
def solve(sol,par,G2EGM=True):
# unpack
t = par.T-1
c = sol.c[t]
d = sol.d[t]
inv_v = sol.inv_v[t]
inv_vm = sol.inv_vm[t]
if G2EGM:
inv_vn = sol.inv... | 0 | 665 | 0 | 0 | 0 | 0 | 0 | 2 | 139 |
0b29e37527968b31aab01a478ce0275081e99f07 | 25,117 | py | Python | cinder/volume/drivers/datera/datera_iscsi.py | 2020human/cinder | 04528318848620e4ce2639ea2dd5323783dc7a1f | [
"Apache-2.0"
] | null | null | null | cinder/volume/drivers/datera/datera_iscsi.py | 2020human/cinder | 04528318848620e4ce2639ea2dd5323783dc7a1f | [
"Apache-2.0"
] | null | null | null | cinder/volume/drivers/datera/datera_iscsi.py | 2020human/cinder | 04528318848620e4ce2639ea2dd5323783dc7a1f | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Datera
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 33.941892 | 79 | 0.54708 | # Copyright 2016 Datera
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 0 | 22,466 | 0 | 0 | 0 | 0 | 0 | 130 | 401 |
a6313dc85a1cd2ba4443016989accd28ddc50e99 | 260 | py | Python | dd_1/Part 1/Section 09 - Modules, Packages and Namespaces/02 - How Python Imports Modules/example2/main.py | Rebell-Leader/bg | 616a40286fe1d34db2916762c477676ed8067cdb | [
"Apache-2.0"
] | 3,266 | 2017-08-06T16:51:46.000Z | 2022-03-30T07:34:24.000Z | python-tuts/0-beginner/8-Modules_Packages_Namespaces/02 - How Python imports Modules/Eg.2/main.py | amcs1729/Artificial-Intelligence-Deep-Learning-Machine-Learning-Tutorials | 6581190cf3623a0217f0babf437c3e519d19e64a | [
"Apache-2.0"
] | 150 | 2017-08-28T14:59:36.000Z | 2022-03-11T23:21:35.000Z | python-tuts/0-beginner/8-Modules_Packages_Namespaces/02 - How Python imports Modules/Eg.2/main.py | amcs1729/Artificial-Intelligence-Deep-Learning-Machine-Learning-Tutorials | 6581190cf3623a0217f0babf437c3e519d19e64a | [
"Apache-2.0"
] | 1,449 | 2017-08-06T17:40:59.000Z | 2022-03-31T12:03:24.000Z | # main.py
# even though test was added to sys.modules
# in module1, we can still access it from here
import test
print(test())
# don't do this! It's a bad hack to illustrate how import looks
# in sys.modules for the symbol we are importing
| 18.571429 | 63 | 0.738462 | # main.py
import module1
# even though test was added to sys.modules
# in module1, we can still access it from here
import test
print(test())
# don't do this! It's a bad hack to illustrate how import looks
# in sys.modules for the symbol we are importing
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | -7 | 22 |
33bb41922d2ff835e00c2580b69e6a7ca85a1620 | 3,172 | py | Python | src/django_ftl/templatetags/ftl.py | django-ftl/django-ftl | c34e4956741b17b3af10c3f543a90a0fdc6c8dd7 | [
"MIT"
] | 38 | 2018-05-19T15:17:23.000Z | 2022-03-03T17:52:55.000Z | src/django_ftl/templatetags/ftl.py | django-ftl/django-ftl | c34e4956741b17b3af10c3f543a90a0fdc6c8dd7 | [
"MIT"
] | 3 | 2020-04-02T09:22:55.000Z | 2021-11-22T21:19:52.000Z | src/django_ftl/templatetags/ftl.py | django-ftl/django-ftl | c34e4956741b17b3af10c3f543a90a0fdc6c8dd7 | [
"MIT"
] | 3 | 2019-04-17T10:07:27.000Z | 2021-11-23T11:50:50.000Z | from __future__ import absolute_import, print_function, unicode_literals
from django import template
register = template.Library()
MODE_SERVER = 'server'
MODES = [
MODE_SERVER
]
MODE_VAR_NAME = '__ftl_mode'
BUNDLE_VAR_NAME = '__ftl_bundle'
| 28.836364 | 94 | 0.653531 | from __future__ import absolute_import, print_function, unicode_literals
import contextlib
import six
from django import template
from django.template.base import token_kwargs
from django.utils.module_loading import import_string
import django_ftl
register = template.Library()
MODE_SERVER = 'server'
MODES = [
... | 0 | 1,279 | 0 | 1,062 | 0 | 266 | 0 | 37 | 274 |
48b6240dbec6d14739dbb306ca9ddcd38f25475e | 3,359 | py | Python | src/hmi/log.py | aldorobertoavila/EniBot-S | d19b076129819aab1277657d7869bd62aa15a5fa | [
"MIT"
] | null | null | null | src/hmi/log.py | aldorobertoavila/EniBot-S | d19b076129819aab1277657d7869bd62aa15a5fa | [
"MIT"
] | null | null | null | src/hmi/log.py | aldorobertoavila/EniBot-S | d19b076129819aab1277657d7869bd62aa15a5fa | [
"MIT"
] | 1 | 2021-11-28T04:10:30.000Z | 2021-11-28T04:10:30.000Z | import tkinter.ttk as ttk
| 30.536364 | 99 | 0.614171 | import tkinter as tk
import tkinter.ttk as ttk
from tkinter import scrolledtext
from datetime import datetime
import logging
import queue
import time
class Timer:
def __init__(self, ref=0):
self.ref = ref
def seconds(self):
return time.time() - self.ref
def get_filename():
return date... | 0 | 0 | 0 | 2,776 | 0 | 311 | 0 | -8 | 249 |
fa6bceac8eddf5b789fdcb52284d40e57d0772e1 | 665 | py | Python | HelloWorld/Primitive Types/stringMethods.py | lazywithcrazyness/PythonForBeginners | 7667d16e4f0fd0f4e659e65ab7482f5a40fa5c5c | [
"MIT"
] | null | null | null | HelloWorld/Primitive Types/stringMethods.py | lazywithcrazyness/PythonForBeginners | 7667d16e4f0fd0f4e659e65ab7482f5a40fa5c5c | [
"MIT"
] | null | null | null | HelloWorld/Primitive Types/stringMethods.py | lazywithcrazyness/PythonForBeginners | 7667d16e4f0fd0f4e659e65ab7482f5a40fa5c5c | [
"MIT"
] | null | null | null | course = ' Python for Beginners '
print(len(course)) # Genereal perpous function
print(course.upper())
print(course)
print(course.lower())
print(course.title())
print(course.lstrip())
print(course.rstrip())
# Returns the index of the first occurrence of the character.
print(course.find('P'))
print(course.find('B'... | 27.708333 | 61 | 0.717293 | course = ' Python for Beginners '
print(len(course)) # Genereal perpous function
print(course.upper())
print(course)
print(course.lower())
print(course.title())
print(course.lstrip())
print(course.rstrip())
# Returns the index of the first occurrence of the character.
print(course.find('P'))
print(course.find('B'... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e6a9d1ef9e3c90385307c2ef7ca9901da035b156 | 5,053 | py | Python | create_robot_dset.py | vishalBindal/simsg | 2f062131f5c6f07162e1036d3dee803f1cf71979 | [
"Apache-2.0"
] | null | null | null | create_robot_dset.py | vishalBindal/simsg | 2f062131f5c6f07162e1036d3dee803f1cf71979 | [
"Apache-2.0"
] | null | null | null | create_robot_dset.py | vishalBindal/simsg | 2f062131f5c6f07162e1036d3dee803f1cf71979 | [
"Apache-2.0"
] | null | null | null | import torch
import numpy as np
import shutil
import os
import torch
import cv2
from torchvision.ops.boxes import box_iou
import matplotlib.patches as patches
import json
'''
This script can be used to convert dataset to the following form
- a folder containing scene images (labeled as 0.png, 1.png and so on)
- a file... | 26.594737 | 104 | 0.556105 | import pickle
import torch
import numpy as np
import shutil
import os
import torch
import cv2
from torchvision.ops.boxes import box_iou
import matplotlib.pyplot as plt
import matplotlib.patches as patches
import json
'''
This script can be used to convert dataset to the following form
- a folder containing scene image... | 0 | 0 | 0 | 0 | 0 | 299 | 0 | 2 | 90 |
95a81c5ebfa78f88d87606e66f50c9d7dfacae46 | 2,816 | py | Python | Modelchecking_torch.py | hamzajaved05/text2map | c1d824896cf3b9e658687d77762766471b176bc8 | [
"MIT"
] | null | null | null | Modelchecking_torch.py | hamzajaved05/text2map | c1d824896cf3b9e658687d77762766471b176bc8 | [
"MIT"
] | null | null | null | Modelchecking_torch.py | hamzajaved05/text2map | c1d824896cf3b9e658687d77762766471b176bc8 | [
"MIT"
] | null | null | null | """
Author: Hamza
Dated: 20.04.2019
Project: texttomap
"""
import pickle
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from util.word_encoding import getklass
device = torch.device('cuda:0' if torch.cuda.is_available() else 'cpu')
print(device... | 27.339806 | 90 | 0.649503 | """
Author: Hamza
Dated: 20.04.2019
Project: texttomap
"""
import pickle
import matplotlib.pyplot as plt
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils import data
from util.word_encoding import getklass
device = torch.device('cuda:0' if torch.cuda.is_availab... | 0 | 0 | 0 | 1,182 | 0 | 0 | 0 | 7 | 68 |
8415756b0e2e5742d740f5ab56747711ef9abd30 | 11,611 | py | Python | tests/integration_tests/connection_utils_integration_test.py | ZacharyATanenbaum/service_framework | b5dde4407998350d1b7ad09284110b986fd4e12a | [
"MIT"
] | 1 | 2020-03-20T21:33:56.000Z | 2020-03-20T21:33:56.000Z | tests/integration_tests/connection_utils_integration_test.py | ZacharyATanenbaum/service_framework | b5dde4407998350d1b7ad09284110b986fd4e12a | [
"MIT"
] | 1 | 2020-03-22T03:48:45.000Z | 2020-03-22T03:48:45.000Z | tests/integration_tests/connection_utils_integration_test.py | ZacharyATanenbaum/service_framework | b5dde4407998350d1b7ad09284110b986fd4e12a | [
"MIT"
] | null | null | null | """ Integration Test File for service_framework.connection_utils.py """
import logging
import pytest
from service_framework.utils import connection_utils
from service_framework.connections.out.requester import Requester
LOG = logging.getLogger(__name__)
def test_connection_utils__base_connection__valid_validate_add... | 31.381081 | 88 | 0.615279 | """ Integration Test File for service_framework.connection_utils.py """
import logging
import pytest
from service_framework.utils import connection_utils
from service_framework.connections.out.requester import Requester
LOG = logging.getLogger(__name__)
def test_connection_utils__base_connection__valid_validate_add... | 0 | 5,448 | 0 | 2,147 | 0 | 0 | 0 | 0 | 46 |