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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6448bef424e00a080c08c631644ca96fc804f43a | 1,926 | py | Python | 6_survival_analysis/data_utilities.py | jjc2718/mutation-fn | e6bab15109a79c7d42dcdbedb1b949a6289d8958 | [
"BSD-3-Clause"
] | null | null | null | 6_survival_analysis/data_utilities.py | jjc2718/mutation-fn | e6bab15109a79c7d42dcdbedb1b949a6289d8958 | [
"BSD-3-Clause"
] | null | null | null | 6_survival_analysis/data_utilities.py | jjc2718/mutation-fn | e6bab15109a79c7d42dcdbedb1b949a6289d8958 | [
"BSD-3-Clause"
] | null | null | null | """
Utilities for loading and preprocessing relevant data.
"""
import pandas as pd
def load_cnv_data(cnv_file, copy_samples, threshold='moderate'):
"""Load and threshold CNV data file from GDC."""
# load raw copy info tsv file
copy_thresh_df = (
pd.read_csv(cnv_file, sep='\t', index_col=0)
... | 34.392857 | 72 | 0.611111 | """
Utilities for loading and preprocessing relevant data.
"""
import pandas as pd
def load_cnv_data(cnv_file, copy_samples, threshold='moderate'):
"""Load and threshold CNV data file from GDC."""
# load raw copy info tsv file
copy_thresh_df = (
pd.read_csv(cnv_file, sep='\t', index_col=0)
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b569ffa3d70d74180c922aef3a4e0e8b51d61ceb | 2,856 | py | Python | data/test/python/d7a86a2141a7402bd2a6b7fe2a5021a5e47898e7test_RobotController.py | harshp8l/deep-learning-lang-detection | 2a54293181c1c2b1a2b840ddee4d4d80177efb33 | [
"MIT"
] | 84 | 2017-10-25T15:49:21.000Z | 2021-11-28T21:25:54.000Z | data/test/python/d7a86a2141a7402bd2a6b7fe2a5021a5e47898e7test_RobotController.py | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 5 | 2018-03-29T11:50:46.000Z | 2021-04-26T13:33:18.000Z | data/test/python/d7a86a2141a7402bd2a6b7fe2a5021a5e47898e7test_RobotController.py | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 24 | 2017-11-22T08:31:00.000Z | 2022-03-27T01:22:31.000Z | #Tests for RobotController
#Author: Witold Wasilewski 2011 | 38.08 | 119 | 0.723389 | #Tests for RobotController
#Author: Witold Wasilewski 2011
from RoboticFramework.RobotController.RobotController import RobotController
from RoboticFramework.RobotModelBounder import RobotModelBounder
from RoboticFramework.RobotArm import RobotArm
from config import Config
from RoboticFramework.RobotController.Delegat... | 0 | 0 | 0 | 2,354 | 0 | 0 | 0 | 288 | 156 |
0e23a2ee6bb3711665ea38b27a094f8f0a270862 | 12,696 | py | Python | mirdata/annotations.py | chrisdonahue/mirdata | c9906e0948adcc75183f5246e7baa879022efcdb | [
"BSD-3-Clause"
] | 1 | 2021-02-24T08:31:14.000Z | 2021-02-24T08:31:14.000Z | mirdata/annotations.py | chrisdonahue/mirdata | c9906e0948adcc75183f5246e7baa879022efcdb | [
"BSD-3-Clause"
] | 1 | 2021-03-15T20:37:41.000Z | 2021-03-19T10:35:33.000Z | mirdata/annotations.py | chrisdonahue/mirdata | c9906e0948adcc75183f5246e7baa879022efcdb | [
"BSD-3-Clause"
] | 1 | 2021-05-03T19:34:46.000Z | 2021-05-03T19:34:46.000Z | """mirdata annotation data types
"""
import numpy as np
def validate_array_like(array_like, expected_type, expected_dtype, none_allowed=False):
"""Validate that array-like object is well formed
If array_like is None, validation passes automatically.
Args:
array_like (array-like): obje... | 31.503722 | 90 | 0.658239 | """mirdata annotation data types
"""
import numpy as np
class Annotation(object):
"""Annotation base class"""
def __repr__(self):
attributes = [v for v in dir(self) if not v.startswith("_")]
repr_str = f"{self.__class__.__name__}({', '.join(attributes)})"
return repr_str
class BeatD... | 0 | 0 | 0 | 7,949 | 0 | 0 | 0 | 0 | 253 |
262bb9619caacedf94868b2f81681a4d5f616beb | 583 | py | Python | day01/ex02/test.py | agelloz/42AI-python-bootcamp | 843099a6f6ea088f7c2f415ed0a33e9decd20641 | [
"MIT"
] | 1 | 2019-11-11T10:37:49.000Z | 2019-11-11T10:37:49.000Z | day01/ex02/test.py | agelloz/42AI-python-bootcamp | 843099a6f6ea088f7c2f415ed0a33e9decd20641 | [
"MIT"
] | null | null | null | day01/ex02/test.py | agelloz/42AI-python-bootcamp | 843099a6f6ea088f7c2f415ed0a33e9decd20641 | [
"MIT"
] | null | null | null | from vector import Vector
v1 = Vector([0.0, 1.0, 2.0, 3.0])
v2 = Vector(3)
v3 = Vector((10, 15))
v4 = Vector(5)
v5 = Vector([5.0])
print(v1)
print(v2)
print(v3)
print(v4)
print(v5)
print(repr(v5))
print("\nadd")
v6 = v1 + v2
v6 = v3 + v4
v6 = v5 + 4
v6 = 7 + v5
v6 = v2 + 5
v6 = 12 + v1
print("\nsub")
v6 = v1 - v2
v6 =... | 13.55814 | 33 | 0.533448 | from vector import Vector
v1 = Vector([0.0, 1.0, 2.0, 3.0])
v2 = Vector(3)
v3 = Vector((10, 15))
v4 = Vector(5)
v5 = Vector([5.0])
print(v1)
print(v2)
print(v3)
print(v4)
print(v5)
print(repr(v5))
print("\nadd")
v6 = v1 + v2
v6 = v3 + v4
v6 = v5 + 4
v6 = 7 + v5
v6 = v2 + 5
v6 = 12 + v1
print("\nsub")
v6 = v1 - v2
v6 =... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
dfe5f278d54be2b0524b93cd4cd81b3bcb66e416 | 468 | py | Python | main.py | sagnik1511/Viz-It | b13c32d31bd22e8ebb98ded51d933f1431be1b80 | [
"MIT"
] | 18 | 2021-11-28T11:02:31.000Z | 2021-12-08T05:45:04.000Z | main.py | polarizz17/Viz-It | 86ee4c0ababc00c165371b060de93a74fc35dcfc | [
"MIT"
] | null | null | null | main.py | polarizz17/Viz-It | 86ee4c0ababc00c165371b060de93a74fc35dcfc | [
"MIT"
] | 1 | 2021-12-08T17:25:49.000Z | 2021-12-08T17:25:49.000Z | from apps import overview, home, eda, correlation
import streamlit as st
from utils import dev_details
pages = {
'Home' : home.app,
'Overview': overview.app,
'EDA': eda.app,
"Correlation" : correlation.app,
}
if __name__ == "__main__":
_, logo_col, _ = st.sidebar.columns([0.3, 1, 1])
logo_col.... | 26 | 53 | 0.630342 | from apps import overview, home, eda, correlation
import streamlit as st
from utils import dev_details
pages = {
'Home' : home.app,
'Overview': overview.app,
'EDA': eda.app,
"Correlation" : correlation.app,
}
if __name__ == "__main__":
_, logo_col, _ = st.sidebar.columns([0.3, 1, 1])
logo_col.... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a1be89117cd41a7c7d30e1dffb622e338da4249b | 2,631 | py | Python | src/data/user_input_rules.py | AlanGanem/fastai-flow | f5b873fd3bdf917be0bd958b144214d0568df15c | [
"MIT"
] | null | null | null | src/data/user_input_rules.py | AlanGanem/fastai-flow | f5b873fd3bdf917be0bd958b144214d0568df15c | [
"MIT"
] | null | null | null | src/data/user_input_rules.py | AlanGanem/fastai-flow | f5b873fd3bdf917be0bd958b144214d0568df15c | [
"MIT"
] | null | null | null | # Module
import tqdm
def create_rule_masks(df, RULES_JSON_PATH):
'''
Apply rules to IVAMIRO in df (only & operator suported)
:param df: dataframe to apply rules
:param rules_json: json or dict containing rules (each rule is also a dictionary containinf values of features)
:return: df with new ... | 28.912088 | 115 | 0.659445 | # Module
import itertools
import pandas as pd
import tqdm
import json
def import_rules_dict(RULES_JSON_PATH):
# open rules json
with open(RULES_JSON_PATH) as json_file:
rules_dict = dict(json.load(json_file))
return rules_dict
def update_rules_json(new_rules, RULES_PATH):
# glob
# json l... | 0 | 0 | 0 | 0 | 0 | 1,141 | 0 | -17 | 158 |
671e724d740e2e5d0e7ba1f9f739c84cda990ccb | 4,086 | py | Python | work_in_progress/test/NeuralNetwork/LSTM.py | ItamarRocha/StockMarketPy | 9236cc296fc51214f0caf6ada1e905fbc9e12ac4 | [
"MIT"
] | 3 | 2020-05-01T15:17:28.000Z | 2021-07-16T17:55:23.000Z | work_in_progress/test/NeuralNetwork/LSTM.py | ItamarRocha/StockMarketPy | 9236cc296fc51214f0caf6ada1e905fbc9e12ac4 | [
"MIT"
] | 1 | 2020-05-31T22:37:37.000Z | 2020-06-01T02:14:15.000Z | work_in_progress/test/NeuralNetwork/LSTM.py | ItamarRocha/StockMarketPy | 9236cc296fc51214f0caf6ada1e905fbc9e12ac4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 9 18:05:09 2020
@author: itamar
"""
import math
import pandas_datareader as web
import numpy as np
from sklearn.preprocessing import MinMaxScaler
from keras.models import Sequential
from keras.layers import Dense, LSTM
import matplotlib.pyplot as ... | 26.36129 | 100 | 0.740822 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Jan 9 18:05:09 2020
@author: itamar
"""
import math
import pandas_datareader as web
import numpy as np
import pandas as pd
from sklearn.preprocessing import MinMaxScaler
from keras.models import Sequential
from keras.layers import Dense, LSTM
import m... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -2 | 22 |
ed1edf37743e73af672fba4b8a992d0413010776 | 3,118 | py | Python | SynGuar/helper_eval/eval_consts.py | HALOCORE/SynGuar | 8f7f9ba52e83091ad3def501169fd60d20b28321 | [
"MIT"
] | 1 | 2021-06-23T05:10:36.000Z | 2021-06-23T05:10:36.000Z | SynGuar/helper_eval/eval_consts.py | HALOCORE/SynGuar | 8f7f9ba52e83091ad3def501169fd60d20b28321 | [
"MIT"
] | null | null | null | SynGuar/helper_eval/eval_consts.py | HALOCORE/SynGuar | 8f7f9ba52e83091ad3def501169fd60d20b28321 | [
"MIT"
] | null | null | null | import os
abs_join = lambda p1, p2 : os.path.abspath(os.path.join(p1, p2))
SYNTHESIZER_STRPROSE = "StrPROSE"
SYNTHESIZER_STRSTUN = "StrSTUN"
SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))
EXAMPLE_STRPROSE_RELDIR = "../../benchmark/strprose/example_files"
EXAMPLE_STRPROSE_FULLDIR = abs_join(SCRIPT_DIR, EXAMPL... | 47.969231 | 135 | 0.787684 | import os
import json
abs_join = lambda p1, p2 : os.path.abspath(os.path.join(p1, p2))
SYNTHESIZER_STRPROSE = "StrPROSE"
SYNTHESIZER_STRSTUN = "StrSTUN"
SCRIPT_DIR = os.path.abspath(os.path.dirname(__file__))
EXAMPLE_STRPROSE_RELDIR = "../../benchmark/strprose/example_files"
EXAMPLE_STRPROSE_FULLDIR = abs_join(SCRIPT... | 0 | 0 | 0 | 0 | 0 | 609 | 0 | -10 | 91 |
b5d04dc33a64b3222ca5e3accc526395c0691d12 | 907 | py | Python | training/utils.py | axsaucedo/Voice-Cloning-App | 0dceb0175647101ca0873427d92bd3b54487b306 | [
"BSD-3-Clause"
] | 1 | 2021-10-31T23:03:44.000Z | 2021-10-31T23:03:44.000Z | training/utils.py | axsaucedo/Voice-Cloning-App | 0dceb0175647101ca0873427d92bd3b54487b306 | [
"BSD-3-Clause"
] | null | null | null | training/utils.py | axsaucedo/Voice-Cloning-App | 0dceb0175647101ca0873427d92bd3b54487b306 | [
"BSD-3-Clause"
] | null | null | null |
CHECKPOINT_SIZE_MB = 333
BATCH_SIZE_PER_GB = 2.5
LEARNING_RATE_PER_BATCH = 3.125e-5
| 28.34375 | 108 | 0.754135 | import shutil
import torch
CHECKPOINT_SIZE_MB = 333
BATCH_SIZE_PER_GB = 2.5
LEARNING_RATE_PER_BATCH = 3.125e-5
def get_available_memory():
gpu_memory = torch.cuda.get_device_properties(0).total_memory
memory_in_use = torch.cuda.memory_allocated(0)
available_memory = gpu_memory - memory_in_use
availab... | 0 | 0 | 0 | 0 | 0 | 699 | 0 | -17 | 136 |
2a757b168cb5f8c7e9122644ab309c15d2a2fe69 | 4,326 | py | Python | ub/modules/button.py | TAMILVIP007/Ichigo | 9be07bcc96f9e714b745f6d72dfa521f0a34dc90 | [
"MIT"
] | null | null | null | ub/modules/button.py | TAMILVIP007/Ichigo | 9be07bcc96f9e714b745f6d72dfa521f0a34dc90 | [
"MIT"
] | null | null | null | ub/modules/button.py | TAMILVIP007/Ichigo | 9be07bcc96f9e714b745f6d72dfa521f0a34dc90 | [
"MIT"
] | 1 | 2022-03-09T14:42:48.000Z | 2022-03-09T14:42:48.000Z | # Copyright (C) 2020 sandeep.n(.$)
# button post makker for catub thanks to uniborg for the base
# by @sandy1709 (@mrconfused)
import re
from ub import bot
from ub import CMD_HELP
from .. import CMD_HELP
# regex obtained from:
# https://github.com/PaulSonOfLars/tgbot/blob/master/tg_bot/modules/helper_funcs/string_h... | 37.293103 | 200 | 0.654877 | # Copyright (C) 2020 sandeep.n(π.$)
# button post makker for catub thanks to uniborg for the base
# by @sandy1709 (@mrconfused)
import os
import re
from ub import tebot as tgbot
from telethon import Button
from ub import bot
from ub import CMD_HELP, client
from ub.javes_main.heroku_var import Config
from .. import... | 2 | 2,407 | 0 | 0 | 0 | 213 | 0 | 72 | 224 |
920a6e36d50945a9de125e2dc2128d43efd02ec8 | 10,341 | py | Python | userbot/modules/globalbanned.py | eagleprojects/eagle | 5334897d13490057aeb31b97527e9de538056844 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 56 | 2021-04-13T13:22:07.000Z | 2022-02-28T04:08:19.000Z | userbot/modules/globalbanned.py | eagleprojects/eagle | 5334897d13490057aeb31b97527e9de538056844 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 85 | 2021-04-11T17:00:29.000Z | 2022-03-31T22:16:35.000Z | userbot/modules/globalbanned.py | eagleprojects/eagle | 5334897d13490057aeb31b97527e9de538056844 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 140 | 2021-04-13T00:25:11.000Z | 2022-03-31T05:28:22.000Z | # Ported by @PacarFerdilla
# Thanks for catuserbot (c) copyright 2021
from telethon.tl.types import ChatBannedRights
import userbot.modules.sql_helper.gban_sql as gban_sql
from userbot import CMD_HELP
BANNED_RIGHTS = ChatBannedRights(
until_date=None,
view_messages=True,
send_messages=True,
send_media... | 34.935811 | 163 | 0.566676 | # Ported by @PacarFerdilla
# Thanks for catuserbot (c) copyright 2021
import asyncio
import base64
from datetime import datetime
from telethon.errors import BadRequestError
from telethon.tl.functions.channels import EditBannedRequest
from telethon.tl.functions.messages import ImportChatInviteRequest
from telethon.tl.... | 39 | 6,627 | 1,981 | 0 | 0 | 55 | 0 | 208 | 316 |
f1b6102af620e86bd68f193270615d08fe7329cb | 35,245 | py | Python | pysnmp-with-texts/VERTICAL-STATION-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/VERTICAL-STATION-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/VERTICAL-STATION-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module VERTICAL-STATION-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/VERTICAL-STATION-MIB
# Produced by pysmi-0.3.4 at Wed May 1 15:34:11 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (defau... | 171.926829 | 3,462 | 0.791119 | #
# PySNMP MIB module VERTICAL-STATION-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/VERTICAL-STATION-MIB
# Produced by pysmi-0.3.4 at Wed May 1 15:34:11 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (defau... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c8125af23734047c0b4eaab83b752429f4ed55f9 | 7,418 | py | Python | functions/lambda_finder/list_lambdas.py | radon-h2020/radon-function-lib | 2737e006a194021f2c8e4f793f9b99abda966175 | [
"MIT"
] | null | null | null | functions/lambda_finder/list_lambdas.py | radon-h2020/radon-function-lib | 2737e006a194021f2c8e4f793f9b99abda966175 | [
"MIT"
] | 4 | 2021-02-12T09:50:38.000Z | 2021-06-17T10:33:09.000Z | functions/lambda_finder/list_lambdas.py | radon-h2020/radon-function-lib | 2737e006a194021f2c8e4f793f9b99abda966175 | [
"MIT"
] | 2 | 2021-02-22T09:29:28.000Z | 2021-06-12T13:54:18.000Z | # MIT License
# Copyright (c) 2018 Epsagon
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, p... | 34.027523 | 111 | 0.653276 | # MIT License
# Copyright (c) 2018 Epsagon
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, p... | 0 | 0 | 0 | 0 | 0 | 1,034 | 0 | -14 | 67 |
8169192c81ecd801e7aa24536d819be660bd10f4 | 3,188 | py | Python | upurs_usb_port/upload_to_upurs.py | kant/myelin-acorn-electron-hardware | 38fef0a38d005ae0f1b93f4a7da74b0e15f10c0d | [
"Apache-2.0"
] | null | null | null | upurs_usb_port/upload_to_upurs.py | kant/myelin-acorn-electron-hardware | 38fef0a38d005ae0f1b93f4a7da74b0e15f10c0d | [
"Apache-2.0"
] | null | null | null | upurs_usb_port/upload_to_upurs.py | kant/myelin-acorn-electron-hardware | 38fef0a38d005ae0f1b93f4a7da74b0e15f10c0d | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 27.247863 | 117 | 0.6101 | # Copyright 2017 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 0 | 0 | 0 | 0 | 0 | 217 | 0 | 0 | 23 |
3a4955569328dbcfd7e04048aa9f591781663725 | 5,531 | bzl | Python | tools/workspace/cc/repository.bzl | RobotLocomotion/drake-python3.7 | ae397a4c6985262d23e9675b9bf3927c08d027f5 | [
"BSD-3-Clause"
] | 2 | 2021-02-25T02:01:02.000Z | 2021-03-17T04:52:04.000Z | tools/workspace/cc/repository.bzl | RobotLocomotion/drake-python3.7 | ae397a4c6985262d23e9675b9bf3927c08d027f5 | [
"BSD-3-Clause"
] | null | null | null | tools/workspace/cc/repository.bzl | RobotLocomotion/drake-python3.7 | ae397a4c6985262d23e9675b9bf3927c08d027f5 | [
"BSD-3-Clause"
] | 1 | 2021-06-13T12:05:39.000Z | 2021-06-13T12:05:39.000Z | # -*- mode: python -*-
# vi: set ft=python :
"""
Identifies the C/C++ compiler by examining the presence or values of various
predefined C preprocessor macros. Identifies any compiler capable of compiling
C++ code that is supported by CMake 3.12.0.
Note that there are constraint_values @bazel_tools//tools/cpp:clang a... | 32.535294 | 130 | 0.634786 | # -*- mode: python -*-
# vi: set ft=python :
"""
Identifies the C/C++ compiler by examining the presence or values of various
predefined C preprocessor macros. Identifies any compiler capable of compiling
C++ code that is supported by CMake 3.12.0.
Note that there are constraint_values @bazel_tools//tools/cpp:clang a... | 0 | 0 | 0 | 0 | 0 | 4,177 | 0 | 0 | 23 |
ac8d55b4a4631b006db1221c62270ff9ddabfe32 | 3,107 | py | Python | src/clipper/misc.py | Sheer-Curiosity/vcdl2 | 95e3c750934df08022f5651e714e24c4d10700d7 | [
"MIT"
] | null | null | null | src/clipper/misc.py | Sheer-Curiosity/vcdl2 | 95e3c750934df08022f5651e714e24c4d10700d7 | [
"MIT"
] | null | null | null | src/clipper/misc.py | Sheer-Curiosity/vcdl2 | 95e3c750934df08022f5651e714e24c4d10700d7 | [
"MIT"
] | null | null | null |
# There is 100% a better way to do some of the logic in this function, but I really really do not care. | 29.037383 | 104 | 0.639846 | import os
def formatTimestamp(inputTimestamp: list):
tempTimestamp = inputTimestamp
for idx, entry in enumerate(inputTimestamp):
if len(str(entry)) < 2:
tempTimestamp[idx] = f"0{str(entry)}"
return f"{tempTimestamp[0]}:{tempTimestamp[1]}:{tempTimestamp[2]}.{tempTimestamp[3]}"
def calculatePadding(timestampPai... | 0 | 0 | 0 | 0 | 0 | 2,902 | 0 | -12 | 113 |
20f2ff495097925fa6646d54d54484545bcd61c0 | 494 | py | Python | solved/q406.py | zao95/codingdojang-zao95-solving | 409d1696700b453b183947d7bda8abcbbfe95bc5 | [
"WTFPL"
] | 2 | 2021-01-06T14:02:14.000Z | 2022-02-19T17:38:16.000Z | solved/q406.py | zao95/codingdojang-zao95-solving | 409d1696700b453b183947d7bda8abcbbfe95bc5 | [
"WTFPL"
] | null | null | null | solved/q406.py | zao95/codingdojang-zao95-solving | 409d1696700b453b183947d7bda8abcbbfe95bc5 | [
"WTFPL"
] | null | null | null | #
# Question number. 406
#
# http://codingdojang.com/scode/406
# Author: Lee Jeongwoo
# Github name: zao95
# ========== Question ==========
# A .
# A .
# : (m), (n) ( n 1 . n >= 1)
# :
# A .
# ==============================
import math
m = int(input(': '))
n = int(input(' : '))
ans... | 19.76 | 73 | 0.582996 | # 코딩도장 문제풀이
# Question number. 406
# 게시판 페이징
# http://codingdojang.com/scode/406
# Author: Lee Jeongwoo
# Github name: zao95
# ========== Question ==========
# A씨는 게시판 프로그램을 작성하고 있다.
# A씨는 게시물의 총 건수와 한 페이지에 보여줄 게시물수를 입력으로 주었을 때 총 페이지수를 리턴하는 프로그램이 필요하다고 한다.
# 입력 : 총건수(m), 한페이지에 보여줄 게시물수(n) (단 n은 1보다 크거나 같다. n >= 1)
#... | 438 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b3d6ba8f4d2a38b761b1ccf8a43ed317164b9b13 | 1,532 | py | Python | trainings/migrations/0002_historicaltopic.py | pnwclw/cyfmazyr | dfeca513c7334335426d226ec3834af598b08b8c | [
"MIT"
] | 1 | 2020-07-18T11:20:29.000Z | 2020-07-18T11:20:29.000Z | trainings/migrations/0002_historicaltopic.py | panwaclaw/cyfmazyr | dfeca513c7334335426d226ec3834af598b08b8c | [
"MIT"
] | 8 | 2020-05-24T14:08:12.000Z | 2021-09-08T02:03:52.000Z | trainings/migrations/0002_historicaltopic.py | pnwclw/cyfmazyr | dfeca513c7334335426d226ec3834af598b08b8c | [
"MIT"
] | 1 | 2020-05-24T12:24:40.000Z | 2020-05-24T12:24:40.000Z | # Generated by Django 3.0.6 on 2020-05-24 00:32
| 41.405405 | 156 | 0.60705 | # Generated by Django 3.0.6 on 2020-05-24 00:32
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import simple_history.models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... | 0 | 0 | 0 | 1,323 | 0 | 0 | 0 | 48 | 112 |
26de0ef6a7751c4dbc3cbe6d80b62e307586fbc9 | 3,095 | py | Python | numba/tests/test_enums.py | rs2/numba | ee78bfe3e66439197905551a451ea264704a3cdd | [
"BSD-2-Clause"
] | 4 | 2017-06-30T14:22:30.000Z | 2021-01-11T16:47:23.000Z | numba/tests/test_enums.py | rs2/numba | ee78bfe3e66439197905551a451ea264704a3cdd | [
"BSD-2-Clause"
] | 1 | 2017-12-21T23:31:59.000Z | 2017-12-29T16:56:05.000Z | numba/tests/test_enums.py | anton-malakhov/numba | 2e6c224c88774d03a99ad9c1ec4dacf1d4dd7ac7 | [
"BSD-2-Clause"
] | null | null | null | """
Tests for enum support.
"""
from __future__ import print_function
import numba.unittest_support as unittest
if __name__ == '__main__':
unittest.main()
| 24.959677 | 74 | 0.627141 | """
Tests for enum support.
"""
from __future__ import print_function
import enum
import numba.unittest_support as unittest
from numba import jit
from .support import TestCase, tag
from .enum_usecases import *
def compare_usecase(a, b):
return a == b, a != b, a is b, a is not b
def global_usecase(a):
# L... | 0 | 0 | 0 | 2,065 | 0 | 556 | 0 | 10 | 297 |
9bc4ae0eafe6d50697025168f1947b51dec6320f | 1,186 | py | Python | source/python/Deque.py | JoHyukJun/algorithm-analysis | 3eda22ce0eeb52490702206d73c04cff1eb3e72d | [
"Apache-2.0"
] | null | null | null | source/python/Deque.py | JoHyukJun/algorithm-analysis | 3eda22ce0eeb52490702206d73c04cff1eb3e72d | [
"Apache-2.0"
] | null | null | null | source/python/Deque.py | JoHyukJun/algorithm-analysis | 3eda22ce0eeb52490702206d73c04cff1eb3e72d | [
"Apache-2.0"
] | null | null | null | '''
main.py
Created by Jo Hyuk Jun on 2020
Copyright 2020 Jo Hyuk Jun. All rights reserved.
'''
import sys
n = int(sys.stdin.readline().rstrip())
cmd = []
deque = []
for _ in range(n):
cmd.append(list(map(str, sys.stdin.readline().rstrip().split(' '))))
for i in range(n):
if (cmd[i][0... | 21.563636 | 72 | 0.441821 | '''
main.py
Created by Jo Hyuk Jun on 2020
Copyright © 2020 Jo Hyuk Jun. All rights reserved.
'''
import sys
n = int(sys.stdin.readline().rstrip())
cmd = []
deque = []
for _ in range(n):
cmd.append(list(map(str, sys.stdin.readline().rstrip().split(' '))))
for i in range(n):
if (cmd[i][... | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
231943aae2567eb84cdccf69cb0d6a85b0191995 | 4,038 | py | Python | cinder/tests/scheduler/test_host_filters.py | Thingee/cinder | 721e657073d73d639619f839d935a463d32b59b5 | [
"Apache-2.0"
] | 1 | 2015-11-25T10:18:28.000Z | 2015-11-25T10:18:28.000Z | cinder/tests/scheduler/test_host_filters.py | NeCTAR-RC/cinder | e01da23febc530de218ed8eed6737add150c1587 | [
"Apache-2.0"
] | null | null | null | cinder/tests/scheduler/test_host_filters.py | NeCTAR-RC/cinder | e01da23febc530de218ed8eed6737add150c1587 | [
"Apache-2.0"
] | null | null | null | # Copyright 2011 OpenStack Foundation # 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 req... | 43.419355 | 78 | 0.610451 | # Copyright 2011 OpenStack Foundation # 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 req... | 0 | 2,289 | 0 | 841 | 0 | 0 | 0 | 72 | 157 |
3cd563272852f18a189a12f8188b8f91d1bab57d | 1,330 | py | Python | day001-014/day005/day-5-1-exercise.py | sysarghir/100-days-of-python | 8edc7ce102429333d4abd80ac3f4067e4028c66d | [
"MIT"
] | null | null | null | day001-014/day005/day-5-1-exercise.py | sysarghir/100-days-of-python | 8edc7ce102429333d4abd80ac3f4067e4028c66d | [
"MIT"
] | null | null | null | day001-014/day005/day-5-1-exercise.py | sysarghir/100-days-of-python | 8edc7ce102429333d4abd80ac3f4067e4028c66d | [
"MIT"
] | null | null | null | # Average Height
# Instructions
# You are going to write a program that calculates the average student height from a List of heights.
# e.g. `student_heights = [180, 124, 165, 173, 189, 169, 146]`
# The average height can be calculated by adding all the heights together and dividing by the total number of heights.... | 28.297872 | 176 | 0.661654 | # Average Height
# Instructions
# You are going to write a program that calculates the average student height from a List of heights.
# e.g. `student_heights = [180, 124, 165, 173, 189, 169, 146]`
# The average height can be calculated by adding all the heights together and dividing by the total number of heights.... | 22 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3ff0f7ca13cf83cd7659cdf2a61fdb4cd161d57c | 89,955 | py | Python | punkemon v-0-0-6.py | mgavrin/Punkemon | cf7831021ef7bb977a65f61f93e029080ef26ff8 | [
"MIT"
] | null | null | null | punkemon v-0-0-6.py | mgavrin/Punkemon | cf7831021ef7bb977a65f61f93e029080ef26ff8 | [
"MIT"
] | null | null | null | punkemon v-0-0-6.py | mgavrin/Punkemon | cf7831021ef7bb977a65f61f93e029080ef26ff8 | [
"MIT"
] | null | null | null | ################################# PUNKEMON YO!!!!! ###############################
########## Imports from elsewhere
import pygame
import os
fontLoaderCode=open("menu sprite code.py")
exec(fontLoaderCode.read())
battlesCode=open("Battles.py")
exec(battlesCode)
monCode=open("Mons.py")
exec(monCode.read())
worldCode=ope... | 44.731477 | 314 | 0.61264 | ################################# PUNKEMON YO!!!!! ###############################
########## Imports from elsewhere
import pygame
from pygame.locals import *
import random
from random import *
import math
from math import *
import os
import string
fontLoaderCode=open("menu sprite code.py")
exec(fontLoaderCode.read())... | 0 | 0 | 0 | 70,054 | 0 | 84 | 0 | -24 | 528 |
b1aa1068d9ac2711832dc5aa7aa89185bdf31d98 | 15,321 | py | Python | src/common_utils_data/regex_functions.py | Mi524/common_utils_data | 400baf3be1bc96a06bd1f3d70abaf8dd749cfb85 | [
"MIT"
] | null | null | null | src/common_utils_data/regex_functions.py | Mi524/common_utils_data | 400baf3be1bc96a06bd1f3d70abaf8dd749cfb85 | [
"MIT"
] | null | null | null | src/common_utils_data/regex_functions.py | Mi524/common_utils_data | 400baf3be1bc96a06bd1f3d70abaf8dd749cfb85 | [
"MIT"
] | null | null | null | import re
from collections import defaultdict
# keyword_processor = KeywordProcessor()
# for i in ['tests','testss','test','5G is(not','ok','100%','','','','']:
# keyword_processor.add_keyword(i)
# print(keyword_processor.get_all_keywords())
# text = 'tests 100% are do.ne testss/5G is(not ok'
# # t... | 37.186893 | 142 | 0.621826 | import re
from collections import defaultdict
from string import punctuation
import string
from flashtext import KeywordProcessor
# keyword_processor = KeywordProcessor()
# for i in ['tests','testss','test','5G is(not','ok','100%','不可能吧','优势','在哪里','哪里']:
# keyword_processor.add_keyword(i)
# print(... | 4,398 | 0 | 0 | 0 | 0 | 4,172 | 0 | 18 | 386 |
67a933614fef20c96c426d9446f6a66d829171e4 | 15,150 | py | Python | clustering.py | kelicht/cet | 6e4a764e9a0c1a152582b744b277b1e4493daeeb | [
"MIT"
] | null | null | null | clustering.py | kelicht/cet | 6e4a764e9a0c1a152582b744b277b1e4493daeeb | [
"MIT"
] | null | null | null | clustering.py | kelicht/cet | 6e4a764e9a0c1a152582b744b277b1e4493daeeb | [
"MIT"
] | null | null | null |
if(__name__ == '__main__'):
_check(dataset='d', N=10)
| 51.883562 | 316 | 0.571023 | import numpy as np
import time
import pulp
from utils import flatten, Cost
from ce import ActionExtractor
from sklearn.cluster import KMeans
from sklearn.neighbors import KNeighborsClassifier
from sklearn.decomposition import PCA
from sklearn.manifold import TSNE
from matplotlib import pyplot as plt
class Clustering(... | 0 | 0 | 0 | 12,799 | 0 | 1,941 | 0 | 81 | 266 |
ebfd484a01ac35b8d8eec6d58c78628014ddee6f | 3,663 | py | Python | my/location/gpslogger.py | ktaranov/HPI | 3aa21107465b19b8b09884fbda8326617d3324ae | [
"MIT"
] | 1 | 2021-08-04T18:54:53.000Z | 2021-08-04T18:54:53.000Z | my/location/gpslogger.py | ktaranov/HPI | 3aa21107465b19b8b09884fbda8326617d3324ae | [
"MIT"
] | null | null | null | my/location/gpslogger.py | ktaranov/HPI | 3aa21107465b19b8b09884fbda8326617d3324ae | [
"MIT"
] | null | null | null | """
Parse gpslogger https://github.com/mendhak/gpslogger .gpx (xml) files
"""
from ..core import LazyLogger
# For config, see: https://github.com/seanbreckenridge/dotfiles/blob/master/.config/my/my/config/__init__.py
logger = LazyLogger(__name__, level="warning")
from ..core.cfg import make_config
config = make... | 31.307692 | 108 | 0.565111 | """
Parse gpslogger https://github.com/mendhak/gpslogger .gpx (xml) files
"""
from datetime import datetime, timezone
from dataclasses import dataclass
from pathlib import Path
from typing import NamedTuple, Iterator, Set, Dict
from lxml import etree
from ..core import Stats, Paths, LazyLogger
from ..core.error impo... | 0 | 1,937 | 0 | 53 | 772 | 58 | 0 | 161 | 338 |
4549b5704caed463f710e1b6e23a2d53d4b41903 | 7,296 | py | Python | pytagmapper/inside_out_tracker.py | markisus/pytagmapper | c6f38da8f129c7bba930c1f88ea27f81f9b9da37 | [
"MIT"
] | 2 | 2021-10-30T23:22:12.000Z | 2022-01-21T01:33:05.000Z | pytagmapper/inside_out_tracker.py | markisus/pytagmapper | c6f38da8f129c7bba930c1f88ea27f81f9b9da37 | [
"MIT"
] | null | null | null | pytagmapper/inside_out_tracker.py | markisus/pytagmapper | c6f38da8f129c7bba930c1f88ea27f81f9b9da37 | [
"MIT"
] | 1 | 2021-11-20T16:09:22.000Z | 2021-11-20T16:09:22.000Z |
# success of the tracker heavily depends on initialization
# initialization from one of these viewpoints generally will succeed
INIT_TXS_WORLD_VIEWPOINT = [
# topdown views
look_at_origin([0,0,1], [0,1,0]),
look_at_origin([0,0,1], [0,-1,0]),
look_at_origin([0,0,1], [1,0,0]),
look_at_origin([0,0,1],... | 37.22449 | 128 | 0.61472 | import numpy as np
from pytagmapper.geometry import *
from pytagmapper.project import *
from pytagmapper.data import *
from pytagmapper.heuristics import *
def look_at_origin(from_xyz, up_dir):
from_xyz = np.array(from_xyz, dtype=np.float64)
up_dir = np.array(up_dir, dtype=np.float64)
look_dir = -from_xyz
... | 0 | 0 | 0 | 5,501 | 0 | 512 | 0 | 46 | 156 |
fed457364c30491a6e520c7bf8aee44813f0f046 | 2,276 | py | Python | SSD/SSD_FPN_GIoU/model/neck/ssd_neck.py | ForrestPi/ObjectDetection | 54e0821e73f67be5360c36f01229a123c34ab3b3 | [
"MIT"
] | 12 | 2020-03-25T01:24:22.000Z | 2021-09-18T06:40:16.000Z | SSD/SSD_FPN_GIoU/model/neck/ssd_neck.py | ForrestPi/ObjectDetection | 54e0821e73f67be5360c36f01229a123c34ab3b3 | [
"MIT"
] | 1 | 2020-04-22T07:52:36.000Z | 2020-04-22T07:52:36.000Z | SSD/SSD_FPN_GIoU/model/neck/ssd_neck.py | ForrestPi/ObjectDetection | 54e0821e73f67be5360c36f01229a123c34ab3b3 | [
"MIT"
] | 4 | 2020-03-25T01:24:26.000Z | 2020-09-20T11:29:09.000Z | import torch.nn as nn
| 29.558442 | 115 | 0.505712 | import torch.nn as nn
import torch.nn.functional as F
from ..utils import ConvModule
class SSDNeck(nn.Module):
def __init__(self, in_channels = [1024,2048],out_channels = 256,out_map=None,start_level = 0,end_level = None):
super(SSDNeck,self).__init__()
self.in_channels = in_channels
if is... | 0 | 0 | 0 | 2,164 | 0 | 0 | 0 | 19 | 67 |
15fc3dc4f202ef643bcc7c1a3d0324444dfba544 | 10,177 | py | Python | ui_handler.py | firetto/CSC111-Final-Project | d2cc1f9292686bb85c7da8c4312762c05a839df6 | [
"MIT"
] | 1 | 2021-05-06T01:49:46.000Z | 2021-05-06T01:49:46.000Z | ui_handler.py | firetto/CSC111-Final-Project | d2cc1f9292686bb85c7da8c4312762c05a839df6 | [
"MIT"
] | null | null | null | ui_handler.py | firetto/CSC111-Final-Project | d2cc1f9292686bb85c7da8c4312762c05a839df6 | [
"MIT"
] | null | null | null | """
ui_handler.py
Contains the UIHandler method, which contains methods for adding UI elements to the window
and manipulating them.
CSC111 Final Project by Anatoly Zavyalov, Baker Jackson, Elliot Schrider, Rachel Kim
Copyright 2021 Anatoly Zavyalov, Baker Jackson, Elliot Schrider, Rachel Kim
Permission is hereby gran... | 41.369919 | 100 | 0.637909 | """
ui_handler.py
Contains the UIHandler method, which contains methods for adding UI elements to the window
and manipulating them.
CSC111 Final Project by Anatoly Zavyalov, Baker Jackson, Elliot Schrider, Rachel Kim
Copyright 2021 Anatoly Zavyalov, Baker Jackson, Elliot Schrider, Rachel Kim
Permission is hereby gran... | 0 | 0 | 0 | 6,187 | 0 | 0 | 0 | 46 | 89 |
3c8de1e00e31b27ef74d1bc193acb954fb288de5 | 1,082 | py | Python | blag/__init__.py | ChickenNuggers/blag | 61b48106342e7e682d30e92f4cc74c502f12815b | [
"MIT"
] | null | null | null | blag/__init__.py | ChickenNuggers/blag | 61b48106342e7e682d30e92f4cc74c502f12815b | [
"MIT"
] | 1 | 2016-11-19T20:47:28.000Z | 2016-11-24T08:14:29.000Z | blag/__init__.py | ChickenNuggers/blag | 61b48106342e7e682d30e92f4cc74c502f12815b | [
"MIT"
] | null | null | null | from flask import Flask
import sqlite3
import config as config_module
app = Flask(__name__)
config = {}
for item in dir(config_module):
if item[0] != "_":
print("=== Config ===")
for key in (key for key in dir(config_module) if key[0] != "_"):
app.config[key] = getattr(config_module, ... | 23.521739 | 72 | 0.638632 | from flask import Flask
import sqlite3
import config as config_module
app = Flask(__name__)
config = {}
for item in dir(config_module):
if item[0] != "_":
print("=== Config ===")
for key in (key for key in dir(config_module) if key[0] != "_"):
app.config[key] = getattr(config_module, ... | 0 | 94 | 0 | 0 | 0 | 94 | 0 | 0 | 46 |
a1879c1476f051b846212b48098f6963ee2b116a | 716 | py | Python | Chapter2/exercise9.py | careynation/python_class | 61074c75d246010cebfa8610a35f5406c7180896 | [
"MIT"
] | null | null | null | Chapter2/exercise9.py | careynation/python_class | 61074c75d246010cebfa8610a35f5406c7180896 | [
"MIT"
] | null | null | null | Chapter2/exercise9.py | careynation/python_class | 61074c75d246010cebfa8610a35f5406c7180896 | [
"MIT"
] | null | null | null | # @author Carey Nation
# @title Chapter 2, Exercise 8
# @description Calculate tip and tax for a meal
celsius = read_it("Please enter your temperature, in celsius: ")
fahrenheit = convert(celsius)
print("\n%.2fC is %.2fF" % (celsius, fahrenheit))
| 23.096774 | 73 | 0.606145 | # @author Carey Nation
# @title Chapter 2, Exercise 8
# @description Calculate tip and tax for a meal
def read_it(prompt):
# read a single value, makes sure it is a valid number, and return it
valid = False
f = 42 # get it scoped out here so the return can find it
s = 'nothing'
while not valid:
... | 0 | 0 | 0 | 0 | 0 | 418 | 0 | 0 | 46 |
68ea68bb4021b9a7d1bfe4d9d0fd29d5e2d741b1 | 3,297 | py | Python | re_calc/expression_parser.py | LilacRapture/re_calc | d8dc744e26ade3edc545dd6509bf2baf973537a2 | [
"MIT"
] | 1 | 2020-02-27T18:29:52.000Z | 2020-02-27T18:29:52.000Z | re_calc/expression_parser.py | LilacRapture/re_calc | d8dc744e26ade3edc545dd6509bf2baf973537a2 | [
"MIT"
] | 1 | 2020-02-27T18:46:46.000Z | 2020-02-27T18:46:46.000Z | re_calc/expression_parser.py | LilacRapture/ReCalc | d8dc744e26ade3edc545dd6509bf2baf973537a2 | [
"MIT"
] | null | null | null | from re_calc.config import control_tokens, operators, functions
from re_calc.util import is_number
from re_calc.exceptions import CalcException
import re
integer_regex = r"(\d+)"
tech_fractional_float = r"(\.\d+)"
float_regex = r"(\d+\.\d+)"
# regex for different num formats are joined by "regex OR" separator
NUMBER... | 37.044944 | 81 | 0.62663 | from re_calc.config import control_tokens, operators, functions
from re_calc.util import is_number
from re_calc.exceptions import CalcException
import re
integer_regex = r"(\d+)"
tech_fractional_float = r"(\.\d+)"
float_regex = r"(\d+\.\d+)"
# regex for different num formats are joined by "regex OR" separator
NUMBER... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1c31a37db490934407f98f1095e746172a04365d | 26 | py | Python | newfeature.py | rdswanson/rbtesteasybug | 44f0ed52ec7e86d496741c49053b133a01666016 | [
"MIT"
] | null | null | null | newfeature.py | rdswanson/rbtesteasybug | 44f0ed52ec7e86d496741c49053b133a01666016 | [
"MIT"
] | null | null | null | newfeature.py | rdswanson/rbtesteasybug | 44f0ed52ec7e86d496741c49053b133a01666016 | [
"MIT"
] | null | null | null | print "Some new feature!"
| 13 | 25 | 0.730769 | print "Some new feature!"
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
526d9ef03007016f4056d280aee69862a95a0419 | 110 | py | Python | t.py | rpicard92/raspberrypi-arduino-security-system | 7791557a610d2c1dda55cd844f060488cfa1e136 | [
"MIT"
] | null | null | null | t.py | rpicard92/raspberrypi-arduino-security-system | 7791557a610d2c1dda55cd844f060488cfa1e136 | [
"MIT"
] | null | null | null | t.py | rpicard92/raspberrypi-arduino-security-system | 7791557a610d2c1dda55cd844f060488cfa1e136 | [
"MIT"
] | null | null | null | import pytz
from datetime import datetime
tz = pytz.timezone('US/Eastern')
now = datetime.now(tz)
print now | 13.75 | 32 | 0.754545 | import pytz
from datetime import datetime
tz = pytz.timezone('US/Eastern')
now = datetime.now(tz)
print now | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
09c34e0d54070d1869750655fa88089db5d84ed6 | 4,581 | py | Python | python/django/03-apis/apis/models.py | Pearcee/mac-m1-ash | 8b731661735a5f068cfc14d5ad4d055135f352c3 | [
"Apache-2.0"
] | null | null | null | python/django/03-apis/apis/models.py | Pearcee/mac-m1-ash | 8b731661735a5f068cfc14d5ad4d055135f352c3 | [
"Apache-2.0"
] | null | null | null | python/django/03-apis/apis/models.py | Pearcee/mac-m1-ash | 8b731661735a5f068cfc14d5ad4d055135f352c3 | [
"Apache-2.0"
] | null | null | null |
# Entry some data into model
# api/models.py
"""
Server ID,Sponsor,Server Name,Timestamp,Distance,Ping,Download,Upload,Share,IP Address
4058 Wildcard Networks Newcastle upon Tyne 2021-06-23T09:15:13.173107Z 105.4279453 39.982 69624980.03 18494139.82 86.177.254.153
10602 Aspire Technology Solutions Gateshead 2021-... | 32.956835 | 130 | 0.726261 | from django.conf import settings
from django.db import models
from django.utils import timezone
# Entry some data into model
class books(models.Model):
book_name = models.CharField(max_length=10)
author_name = models.CharField(max_length=10)
book_price = models.IntegerField()
book_quantity = models.Int... | 0 | 0 | 0 | 3,295 | 0 | 0 | 0 | 30 | 333 |
ed749cfdd8782d97c57f02aac6d2e606b35e06bb | 5,067 | py | Python | topicblob_st.py | banjtheman/TopicBlob | 4c48f09aba9526357bcb548e4dbecba06a738a8f | [
"Apache-2.0"
] | 3 | 2020-10-09T18:40:53.000Z | 2021-10-30T20:24:04.000Z | topicblob_st.py | banjtheman/TopicBlob | 4c48f09aba9526357bcb548e4dbecba06a738a8f | [
"Apache-2.0"
] | 18 | 2020-10-01T16:48:29.000Z | 2020-10-20T03:58:33.000Z | topicblob_st.py | banjtheman/TopicBlob | 4c48f09aba9526357bcb548e4dbecba06a738a8f | [
"Apache-2.0"
] | 9 | 2020-10-01T18:11:37.000Z | 2020-10-19T00:27:14.000Z | # Wikipeida topic blob example
wiki_pages_default = [
"Facebook(Company)",
"Barack Obama",
"Wikipedia",
"Topic Modeling",
"Python (programming language)",
"Snapchat",
]
# Default pages
if __name__ == "__main__":
main()
| 27.688525 | 176 | 0.662522 | # Wikipeida topic blob example
import random
import wikipedia
import streamlit as st
import pandas as pd
from topicblob import TopicBlob
from streamlit import caching
wiki_pages_default = [
"Facebook(Company)",
"Barack Obama",
"Wikipedia",
"Topic Modeling",
"Python (programming language)",
"... | 0 | 1,271 | 0 | 0 | 0 | 3,189 | 0 | 4 | 341 |
a976864d9f8e5bb46c513d46ee9bd846736e94f2 | 20,397 | py | Python | netforce/tests/unit/napalm/test_eos.py | eBay/pynetforce | 599fbfd4d2dc23c0d70a730c80a0e63a4f461b2f | [
"Apache-2.0"
] | 16 | 2018-01-26T19:29:50.000Z | 2020-07-31T04:50:37.000Z | netforce/tests/unit/napalm/test_eos.py | eBay/pynetforce | 599fbfd4d2dc23c0d70a730c80a0e63a4f461b2f | [
"Apache-2.0"
] | 3 | 2018-02-02T21:45:00.000Z | 2019-09-13T15:31:50.000Z | netforce/tests/unit/napalm/test_eos.py | eBay/pynetforce | 599fbfd4d2dc23c0d70a730c80a0e63a4f461b2f | [
"Apache-2.0"
] | 7 | 2018-01-27T01:08:49.000Z | 2021-01-15T11:03:59.000Z | # Copyright 2018 eBay Inc.
# Copyright 2012 OpenStack LLC.
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0... | 44.927313 | 79 | 0.417218 | # Copyright 2018 eBay Inc.
# Copyright 2012 OpenStack LLC.
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0... | 0 | 0 | 0 | 19,262 | 0 | 0 | 0 | 73 | 364 |
950f2753e021969b86d5511f420b5f157420f4b5 | 1,063 | py | Python | net.py | JIZZ-in-my-pants-NTNU/NTNU-Automatic-Enrollment-2021 | 9aae920885d347057d3e3f875ea4df6e601971c8 | [
"Apache-2.0"
] | null | null | null | net.py | JIZZ-in-my-pants-NTNU/NTNU-Automatic-Enrollment-2021 | 9aae920885d347057d3e3f875ea4df6e601971c8 | [
"Apache-2.0"
] | null | null | null | net.py | JIZZ-in-my-pants-NTNU/NTNU-Automatic-Enrollment-2021 | 9aae920885d347057d3e3f875ea4df6e601971c8 | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
from torchsummary import summary
if __name__ == '__main__':
device = 'cuda' if torch.cuda.is_available() else 'cpu'
model = Net().to(device)
summary(model, (1, 20, 20)) | 25.309524 | 56 | 0.675447 | import torch
import torch.nn as nn
from torchsummary import summary
class Net(nn.Module):
def __init__(self, in_channels=1, num_classes=39):
super(Net, self).__init__()
self._block1 = nn.Sequential(
nn.Conv2d(in_channels, 4, 3, stride=1, padding=1),
nn.BatchNorm2d(4),
nn.LeakyReLU(0.01),
nn.MaxPool2d... | 0 | 0 | 0 | 831 | 0 | 0 | 0 | 0 | 23 |
fa5363a87e7a2e3c77223aa8042cdf96ea35649a | 455 | py | Python | environment/sideshop.py | EdwardYGLi/the_sideshop | a8259bb99a50b187f8a187473b36b1e168fc53ab | [
"MIT"
] | null | null | null | environment/sideshop.py | EdwardYGLi/the_sideshop | a8259bb99a50b187f8a187473b36b1e168fc53ab | [
"MIT"
] | null | null | null | environment/sideshop.py | EdwardYGLi/the_sideshop | a8259bb99a50b187f8a187473b36b1e168fc53ab | [
"MIT"
] | null | null | null | """
Created by Edward Li at 10/6/20
"""
| 21.666667 | 80 | 0.637363 | """
Created by Edward Li at 10/6/20
"""
import numpy as np
class SideShop:
def __init__(self, bench_size = 5, counter_size = 9, starting_money = 1000):
self.bench_size = bench_size
self.counter_size = counter_size
self.starting_money = starting_money
self.bench = [None] * bench_si... | 0 | 0 | 0 | 372 | 0 | 0 | 0 | -3 | 46 |
2400c273eb1f7ada707ef76c3d8e8a89990aaf3e | 486 | py | Python | src/data_preparation/AoA/combine_repetitions_wordbank.py | rgalhama/public_ICCM2021 | 6a528a26c649da0843b7acbc785aa99b80d29a74 | [
"MIT"
] | null | null | null | src/data_preparation/AoA/combine_repetitions_wordbank.py | rgalhama/public_ICCM2021 | 6a528a26c649da0843b7acbc785aa99b80d29a74 | [
"MIT"
] | null | null | null | src/data_preparation/AoA/combine_repetitions_wordbank.py | rgalhama/public_ICCM2021 | 6a528a26c649da0843b7acbc785aa99b80d29a74 | [
"MIT"
] | null | null | null | """
Author : Raquel G. Alhama
Desc:
"""
import sys
if __name__=="__main__":
args=sys.argv[1:]
if len(args) != 1:
print("Usage: combine_repetitions_wordbank.py <file>")
exit(-1)
main(*args)
| 21.130435 | 62 | 0.617284 | """
Author : Raquel G. Alhama
Desc:
"""
import sys
import pandas as pd
def main(fname):
df=pd.read_csv(fname, sep=";")
sdf=df[["uni_lemma", "lexical_class", "aoa",]]
gsdf=sdf.groupby(["uni_lemma","lexical_class"]).mean()
newfname=fname.replace(".csv","_means.csv")
gsdf.to_csv(newfname, sep=";")
i... | 0 | 0 | 0 | 0 | 0 | 223 | 0 | -2 | 45 |
0a1827c34b373bbf5c43c1c317679fde999a079f | 3,598 | py | Python | bebop/editor/models.py | nanvel/bebop | c54ceb0151e26cf90b2df3f20908f8a01c09c896 | [
"MIT"
] | 1 | 2019-01-12T06:34:32.000Z | 2019-01-12T06:34:32.000Z | bebop/editor/models.py | nanvel/bebop | c54ceb0151e26cf90b2df3f20908f8a01c09c896 | [
"MIT"
] | null | null | null | bebop/editor/models.py | nanvel/bebop | c54ceb0151e26cf90b2df3f20908f8a01c09c896 | [
"MIT"
] | null | null | null | import logging
logger = logging.getLogger(__name__)
| 29.491803 | 104 | 0.573096 | import logging
from tornado import gen
from ..common.dynamo import DDBBase
logger = logging.getLogger(__name__)
class DDBEpisode(DDBBase):
TABLE_NAME = 'bebop'
# The data type for the attribute. You can specify S for string data,
# N for numeric data, or B for binary data.
ATTRIBUTE_DEFINITIONS ... | 0 | 1,837 | 0 | 1,621 | 0 | 0 | 0 | 16 | 69 |
693aaf32ed68d1950e3ebddf062ec477ba905a32 | 872 | py | Python | bubble sort.py | Aditya-Kashyap/dsa_python | 9725a10cfbcbe3debaff50cb99b4f22e93d99762 | [
"MIT"
] | null | null | null | bubble sort.py | Aditya-Kashyap/dsa_python | 9725a10cfbcbe3debaff50cb99b4f22e93d99762 | [
"MIT"
] | null | null | null | bubble sort.py | Aditya-Kashyap/dsa_python | 9725a10cfbcbe3debaff50cb99b4f22e93d99762 | [
"MIT"
] | null | null | null | def bubble_sort(array_to_sort):
"""
Simple Sorting Algorithm which Worst Case of O(n2) and Best Case od O(n) if array is already sorted
:param array_to_sort: The Array to be sorted
:return: Sorted Array
"""
n = len(array_to_sort)
for i in range(n-1):
swap = False
for j in ra... | 28.129032 | 103 | 0.530963 | def bubble_sort(array_to_sort):
"""
Simple Sorting Algorithm which Worst Case of O(n2) and Best Case od O(n) if array is already sorted
:param array_to_sort: The Array to be sorted
:return: Sorted Array
"""
n = len(array_to_sort)
for i in range(n-1):
swap = False
for j in ra... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3e275af8678d6e2dc7611df332b5091af46124fd | 4,495 | py | Python | scripts/scil_detect_streamlines_loops.py | fullbat/scilpy | 8f5b95a0b298ac95268c94d04a162b14fe2773ad | [
"MIT"
] | null | null | null | scripts/scil_detect_streamlines_loops.py | fullbat/scilpy | 8f5b95a0b298ac95268c94d04a162b14fe2773ad | [
"MIT"
] | null | null | null | scripts/scil_detect_streamlines_loops.py | fullbat/scilpy | 8f5b95a0b298ac95268c94d04a162b14fe2773ad | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
DESCRIPTION = """
This script can be used to remove loops in two types of streamline datasets:
- Whole brain: For this type, the script removes streamlines if they
make a loop with an angle of more than 360 degrees. It's possible to change
this angle with the -... | 39.429825 | 81 | 0.56218 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import logging
import nibabel as nib
import numpy as np
from scilpy.io.utils import (add_overwrite_arg,
assert_inputs_exist,
assert_outputs_exist,
check_tracts_same_for... | 0 | 0 | 0 | 0 | 0 | 3,265 | 0 | 215 | 181 |
6a9aeebc5c617372c8868cb459b6cbb1f0fcbbe3 | 265 | py | Python | quiz 2 (1).py | Ummed1/Project | 3be222d88a81c3303df510986c08c74200b947de | [
"BSD-3-Clause"
] | null | null | null | quiz 2 (1).py | Ummed1/Project | 3be222d88a81c3303df510986c08c74200b947de | [
"BSD-3-Clause"
] | null | null | null | quiz 2 (1).py | Ummed1/Project | 3be222d88a81c3303df510986c08c74200b947de | [
"BSD-3-Clause"
] | null | null | null | Python 3.6.2 (v3.6.2:5fd33b5, Jul 8 2017, 04:14:34) [MSC v.1900 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> def mystery(l):
l = l[2:5]
return()
>>> list1 = [7,82,44,23,11]
>>> mystery(list1)
()
>>>
| 24.090909 | 90 | 0.577358 | Python 3.6.2 (v3.6.2:5fd33b5, Jul 8 2017, 04:14:34) [MSC v.1900 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> def mystery(l):
l = l[2:5]
return()
>>> list1 = [7,82,44,23,11]
>>> mystery(list1)
()
>>>
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
00bfc7231cdfb91e3edb0620539ba099756c173b | 2,995 | py | Python | examples/ocean_2D_paper/vvp.py | wedeling/FabUQCampaign | f89ee1a7b72ec1c41d6bf662f1b42acd8065cb32 | [
"BSD-3-Clause"
] | 1 | 2020-06-26T10:37:56.000Z | 2020-06-26T10:37:56.000Z | examples/ocean_2D_paper/vvp.py | wedeling/FabUQCampaign | f89ee1a7b72ec1c41d6bf662f1b42acd8065cb32 | [
"BSD-3-Clause"
] | null | null | null | examples/ocean_2D_paper/vvp.py | wedeling/FabUQCampaign | f89ee1a7b72ec1c41d6bf662f1b42acd8065cb32 | [
"BSD-3-Clause"
] | 2 | 2020-04-20T12:50:11.000Z | 2020-04-24T10:35:13.000Z | # This file contains prototype VVP implementations.
#
# These patterns should be purposed for specific settings.
# As such, they do not contain a @task descriptor.
import os
"""
validate_ensemble_output Validation Pattern.
Purpose:
1. given an ensemble of validation output directories, it will:
2. operate a validat... | 39.407895 | 112 | 0.718531 | # This file contains prototype VVP implementations.
#
# These patterns should be purposed for specific settings.
# As such, they do not contain a @task descriptor.
import os
"""
validate_ensemble_output Validation Pattern.
Purpose:
1. given an ensemble of validation output directories, it will:
2. operate a validat... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
44d001dd8db974eaa563c80c08c73ce830935e16 | 1,858 | py | Python | curris/helper.py | a1trl9/curris | f9b55a7a2a8864882f297a4a324ccff182176417 | [
"MIT"
] | null | null | null | curris/helper.py | a1trl9/curris | f9b55a7a2a8864882f297a4a324ccff182176417 | [
"MIT"
] | null | null | null | curris/helper.py | a1trl9/curris | f9b55a7a2a8864882f297a4a324ccff182176417 | [
"MIT"
] | null | null | null | """ common helper module
"""
def elimate_whitespace_around(source):
""" return contents surrounded by whitespaces.
whitespace :: space | tab
"""
if not source:
return source
start, length = 0, len(source)
end, whitespace = length - 1, ' \t'
while start < length:
if source[st... | 26.169014 | 67 | 0.535522 | """ common helper module
"""
def elimate_whitespace_around(source):
""" return contents surrounded by whitespaces.
whitespace :: space | tab
"""
if not source:
return source
start, length = 0, len(source)
end, whitespace = length - 1, ' \t'
while start < length:
if source[st... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3a798996665bff8011af44fac1c04f3067f62a8e | 2,173 | py | Python | charts-external/israelproxy/differ/main.py | omertalmi5/hasadna-k8s | cbc3236e4a9b9a88e227a97a7f5f98d15b62dc83 | [
"MIT"
] | 9 | 2018-10-28T00:28:09.000Z | 2021-11-26T23:02:05.000Z | charts-external/israelproxy/differ/main.py | omertalmi5/hasadna-k8s | cbc3236e4a9b9a88e227a97a7f5f98d15b62dc83 | [
"MIT"
] | 7 | 2019-01-07T18:12:04.000Z | 2021-11-09T18:04:17.000Z | charts-external/israelproxy/differ/main.py | omertalmi5/hasadna-k8s | cbc3236e4a9b9a88e227a97a7f5f98d15b62dc83 | [
"MIT"
] | 15 | 2018-08-13T13:38:17.000Z | 2020-10-08T17:45:32.000Z | #!/usr/bin/env python3
import time, requests, hashlib, os, json, sys, subprocess, traceback
from datetime import datetime
from ruamel import yaml
with open('/etc/differ/config.yaml') as f:
config = yaml.safe_load(f)
INTERVAL_SECONDS = 60*20 # check all diffs every 20 minutes
DIFF_OBJS = config['diff-objs']
DATA_... | 40.240741 | 95 | 0.517717 | #!/usr/bin/env python3
import time, requests, hashlib, os, json, sys, subprocess, traceback
from datetime import datetime
from ruamel import yaml
with open('/etc/differ/config.yaml') as f:
config = yaml.safe_load(f)
INTERVAL_SECONDS = 60*20 # check all diffs every 20 minutes
DIFF_OBJS = config['diff-objs']
DATA_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1c944ddc7f210e2bb69a5e1b3f739d4102061b1f | 1,381 | py | Python | doc/integrations/pytorch/parlai/crowdsourcing/tasks/turn_annotations_static/util.py | novium258/cortx-1 | ce5b939b33b8d24d89b31807ac3bcaa8f24096bc | [
"Apache-2.0"
] | 1 | 2020-09-27T05:00:06.000Z | 2020-09-27T05:00:06.000Z | doc/integrations/pytorch/parlai/crowdsourcing/tasks/turn_annotations_static/util.py | novium258/cortx-1 | ce5b939b33b8d24d89b31807ac3bcaa8f24096bc | [
"Apache-2.0"
] | 1 | 2021-08-04T11:17:39.000Z | 2021-08-04T11:17:39.000Z | doc/integrations/pytorch/parlai/crowdsourcing/tasks/turn_annotations_static/util.py | novium258/cortx-1 | ce5b939b33b8d24d89b31807ac3bcaa8f24096bc | [
"Apache-2.0"
] | 1 | 2021-05-03T13:27:14.000Z | 2021-05-03T13:27:14.000Z | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import random
from mephisto.operations.operator import Operator
from mephisto.tools.scripts import load_db_and... | 33.682927 | 88 | 0.745836 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import random
from mephisto.operations.operator import Operator
from mephisto.tools.scripts import load_db_and... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0f2808657125e397d5f0154b7dcaa22585e90526 | 3,881 | py | Python | comparebruslib.py | Caronthir/TALYS-Launcher | b8d1e1cf8966d0a72bb8ace31d9923e77d22846f | [
"MIT"
] | 4 | 2016-11-02T16:07:26.000Z | 2019-12-04T14:57:23.000Z | comparebruslib.py | ErlendLima/TALYS-Launcher | b8d1e1cf8966d0a72bb8ace31d9923e77d22846f | [
"MIT"
] | 2 | 2017-11-25T18:04:07.000Z | 2017-11-25T18:11:59.000Z | comparebruslib.py | ErlendLima/TALYS-Launcher | b8d1e1cf8966d0a72bb8ace31d9923e77d22846f | [
"MIT"
] | 3 | 2016-11-02T16:16:00.000Z | 2020-02-28T08:23:58.000Z | import re
import os
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("talysdirectory")
parser.add_argument("bruslib")
args = parser.parse_args()
# Regex to extract mass+symbol of element
pattern = re.compile("(\d{1,3}[a-zA-Z]{1,3})")
# Mak... | 34.963964 | 81 | 0.51327 | import re
import os
import argparse
import sys
import pprint
def load_bruslib(directory):
data = {}
# Iterate through the directories
for root, subdirs, files in os.walk(directory):
for file in files:
# Read all files
path = os.path.join(root, file)
try:
... | 0 | 0 | 0 | 0 | 0 | 2,979 | 0 | -19 | 113 |
6d5892c0195f851fcec9bb24b95a2255b0e64ac0 | 3,320 | py | Python | tests/test_from_root_xpublic_key.py | phoenixburton/xhdwallet | 37e450fd4eaceff25786b42c56946e29b041375d | [
"ISC"
] | 1 | 2021-06-26T08:11:21.000Z | 2021-06-26T08:11:21.000Z | tests/test_from_root_xpublic_key.py | phoenixburton/xhdwallet | 37e450fd4eaceff25786b42c56946e29b041375d | [
"ISC"
] | null | null | null | tests/test_from_root_xpublic_key.py | phoenixburton/xhdwallet | 37e450fd4eaceff25786b42c56946e29b041375d | [
"ISC"
] | null | null | null | #!/usr/bin/env python3
import json
import os
# Test Values
base_path: str = os.path.dirname(__file__)
file_path: str = os.path.abspath(os.path.join(base_path, "values.json"))
values = open(file_path, "r", encoding="utf-8")
_: dict = json.loads(values.read())
values.close()
| 52.698413 | 213 | 0.789458 | #!/usr/bin/env python3
import json
import os
from hdwallet import HDWallet
# Test Values
base_path: str = os.path.dirname(__file__)
file_path: str = os.path.abspath(os.path.join(base_path, "values.json"))
values = open(file_path, "r", encoding="utf-8")
_: dict = json.loads(values.read())
values.close()
def test_fr... | 0 | 0 | 0 | 0 | 0 | 2,989 | 0 | 8 | 46 |
9378a5d2028a55aa39ca371630252a88f754f0eb | 5,510 | py | Python | examples/toy_dataset.py | feynmanliang/firefly-monte-carlo | 61a5e120d5c340a0e946dfe4231783c5be5aeb28 | [
"MIT"
] | null | null | null | examples/toy_dataset.py | feynmanliang/firefly-monte-carlo | 61a5e120d5c340a0e946dfe4231783c5be5aeb28 | [
"MIT"
] | null | null | null | examples/toy_dataset.py | feynmanliang/firefly-monte-carlo | 61a5e120d5c340a0e946dfe4231783c5be5aeb28 | [
"MIT"
] | 1 | 2019-03-18T01:24:50.000Z | 2019-03-18T01:24:50.000Z | import matplotlib as mpl
import sys
sys.path.append('..')
# Set hyperparameters
stepsize = 0.001 # size of Metropolis-Hastings step in theta
th0 = 0.20 # scale of weights
N_steps = 3000
N_ess = 2000
# Cosmetic settings
mpl.rcParams['axes.linewidth'] = 3
mpl.rcParams['lines.linewidth'] = 7
mp... | 32.60355 | 105 | 0.54755 | import numpy as np
import numpy.random as npr
from scipy import optimize
import matplotlib as mpl
import matplotlib.pyplot as plt
import pypmc
from mnist import MNIST
from sklearn.decomposition import PCA
import sys
sys.path.append('..')
import flymc as ff
# Set hyperparameters
stepsize = 0.001 # size of Me... | 0 | 0 | 0 | 0 | 0 | 4,836 | 0 | 23 | 222 |
722148731fd1c3d9d614a99858a68b4aa7f6117c | 416 | py | Python | 007-operators/2_comparisons.py | zaiddashti/python-tutorial | 9ae325999a79f5f6471e4126995a2219e5ba33a3 | [
"MIT"
] | null | null | null | 007-operators/2_comparisons.py | zaiddashti/python-tutorial | 9ae325999a79f5f6471e4126995a2219e5ba33a3 | [
"MIT"
] | null | null | null | 007-operators/2_comparisons.py | zaiddashti/python-tutorial | 9ae325999a79f5f6471e4126995a2219e5ba33a3 | [
"MIT"
] | null | null | null | x = 10
y = 5
print("x = " + str(x)) # + is concatination and not addition, will be explained later
print("y = " + str(y))
# equal
print("x == y = " + str(x == y))
# not equal
print("x != y = " + str(x != y))
# greater than
print("x > y = " + str(x > y))
# greater than or equal
print("x >= y = " + str(x >= y))
#... | 17.333333 | 86 | 0.507212 | x = 10
y = 5
print("x = " + str(x)) # + is concatination and not addition, will be explained later
print("y = " + str(y))
# equal
print("x == y = " + str(x == y))
# not equal
print("x != y = " + str(x != y))
# greater than
print("x > y = " + str(x > y))
# greater than or equal
print("x >= y = " + str(x >= y))
#... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
536fd9d7f8332fe614cfe1dd465a0331d4382dd1 | 1,628 | py | Python | tests/test_one.py | rouzbeh-afrasiabi/traintorch | ac3a49e5511463cc60834a8c663f12c02282cc58 | [
"BSD-2-Clause"
] | null | null | null | tests/test_one.py | rouzbeh-afrasiabi/traintorch | ac3a49e5511463cc60834a8c663f12c02282cc58 | [
"BSD-2-Clause"
] | 19 | 2019-10-12T20:18:28.000Z | 2019-12-18T12:20:09.000Z | tests/test_one.py | rouzbeh-afrasiabi/traintorch | ac3a49e5511463cc60834a8c663f12c02282cc58 | [
"BSD-2-Clause"
] | null | null | null | import sys, os
myPath = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, myPath + '/../')
| 37 | 107 | 0.593366 | import pytest
import sys, os
myPath = os.path.dirname(os.path.abspath(__file__))
sys.path.insert(0, myPath + '/../')
from traintorch import *
import numpy as np
import pandas as pd
class TestClass:
def test_metric(self):
test=metric('test',w_size=10,average=False,xaxis_int=True,n_ticks=(5, 5))
ass... | 0 | 0 | 0 | 1,423 | 0 | 0 | 0 | -10 | 112 |
a6eb8c86fea38ca63ed2b3f2345fac1dc5d9b1e5 | 1,196 | py | Python | 7.2.py | Ainevsia/RSA-related | 816101e3951b95b79b59057199179859941f460a | [
"MIT"
] | 7 | 2019-12-31T13:45:36.000Z | 2021-11-14T20:09:02.000Z | 7.2.py | Ainevsia/Algebraic-Number-Theory | 816101e3951b95b79b59057199179859941f460a | [
"MIT"
] | null | null | null | 7.2.py | Ainevsia/Algebraic-Number-Theory | 816101e3951b95b79b59057199179859941f460a | [
"MIT"
] | null | null | null |
def bezout(a, b):
"""
:return s and t st. sa + tb = (a,b)
"""
s, t, sn, tn, r = 1, 0, 0, 1, 1
while r != 0:
q, r = divmod(a, b)
st, tt = sn * (-q) + s, tn * (-q) + t
s, t = sn, tn
sn, tn = st, tt
a, b = b, r
return s, t
for i in range(10):
x, y = ... | 23.92 | 59 | 0.44398 | from fractions import Fraction
from toolkit import *
def bezout(a, b):
"""
:return s and t st. sa + tb = (a,b)
"""
s, t, sn, tn, r = 1, 0, 0, 1, 1
while r != 0:
q, r = divmod(a, b)
st, tt = sn * (-q) + s, tn * (-q) + t
s, t = sn, tn
sn, tn = st, tt
a, b = b,... | 0 | 0 | 0 | 0 | 0 | 659 | 0 | 9 | 90 |
9763e6da8feb9a37927f198790d3720a08b1459d | 31 | py | Python | py/desisim/_version.py | Andrea-MG/desisim | 8308fc44cdc86aea14155b0db5c6f529eeea8423 | [
"BSD-3-Clause"
] | null | null | null | py/desisim/_version.py | Andrea-MG/desisim | 8308fc44cdc86aea14155b0db5c6f529eeea8423 | [
"BSD-3-Clause"
] | null | null | null | py/desisim/_version.py | Andrea-MG/desisim | 8308fc44cdc86aea14155b0db5c6f529eeea8423 | [
"BSD-3-Clause"
] | null | null | null | __version__ = '0.36.0.dev2370'
| 15.5 | 30 | 0.709677 | __version__ = '0.36.0.dev2370'
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
581ecf182716bfe8d168804a5a6851de4f83d7ac | 1,146 | py | Python | wbcms/tiger/urls.py | westurner/wbcms | 9a5c6ae4b07997149b418fcdeefd47c24897c276 | [
"BSD-3-Clause"
] | null | null | null | wbcms/tiger/urls.py | westurner/wbcms | 9a5c6ae4b07997149b418fcdeefd47c24897c276 | [
"BSD-3-Clause"
] | null | null | null | wbcms/tiger/urls.py | westurner/wbcms | 9a5c6ae4b07997149b418fcdeefd47c24897c276 | [
"BSD-3-Clause"
] | null | null | null |
from tiger.views import course_request_create, course_request_update
from tiger.views import course_list
#admin.autodiscover()
urlpatterns = patterns('',
# Courses
url(r'courses/$',
course_list,
name='course_list'),
# Course Requests
url(r'courses/(?P<slug>[\... | 27.95122 | 68 | 0.597731 | from django.conf.urls.defaults import *
from django.contrib import admin
from tiger.views import course_request_create, course_request_update
from tiger.views import course_list, course_detail
from tiger.views import *
from tiger.models import *
#admin.autodiscover()
urlpatterns = patterns('',
# Courses
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 53 | 88 |
437d19ab2a008ce7b37a195c9cc13ba65d14333f | 1,373 | py | Python | app.py | Mann1904/Handwritten-Digit-Recognizer- | bd0f7ca7b59c8897e876a4cb66d5319f4c25cdbd | [
"MIT"
] | null | null | null | app.py | Mann1904/Handwritten-Digit-Recognizer- | bd0f7ca7b59c8897e876a4cb66d5319f4c25cdbd | [
"MIT"
] | null | null | null | app.py | Mann1904/Handwritten-Digit-Recognizer- | bd0f7ca7b59c8897e876a4cb66d5319f4c25cdbd | [
"MIT"
] | null | null | null | import json
import os
import tensorflow as tf
from flask import Flask
app = Flask(__name__)
global model
# load model
with open('model/model_in_json.json', 'r') as f:
model_json = json.load(f)
model = tf.keras.models.model_from_json(model_json)
model.load_weights("model/model.h5")
if __name__ == '__main__':
... | 24.087719 | 63 | 0.669337 | import base64
import json
import re
import os
import numpy as np
import tensorflow as tf
from flask import Flask, render_template, request
from scipy.misc import imread, imresize
app = Flask(__name__)
global model
# load model
with open('model/model_in_json.json', 'r') as f:
model_json = json.load(f)
model = tf.k... | 0 | 566 | 0 | 0 | 0 | 202 | 0 | 21 | 157 |
a3857e61cbdf7c495387480eee37655fd30e07e5 | 39,728 | py | Python | awssystemsmanager_connector.py | splunk-soar-connectors/awssystemsmanager | 13009ae4a868086dd9c9102acf55c470120f2d08 | [
"Apache-2.0"
] | 1 | 2022-02-13T16:39:24.000Z | 2022-02-13T16:39:24.000Z | awssystemsmanager_connector.py | splunk-soar-connectors/awssystemsmanager | 13009ae4a868086dd9c9102acf55c470120f2d08 | [
"Apache-2.0"
] | 2 | 2021-12-09T00:26:55.000Z | 2022-03-09T06:24:56.000Z | awssystemsmanager_connector.py | splunk-soar-connectors/awssystemsmanager | 13009ae4a868086dd9c9102acf55c470120f2d08 | [
"Apache-2.0"
] | null | null | null | # File: awssystemsmanager_connector.py
#
# Copyright (c) 2019-2022 Splunk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 39.569721 | 140 | 0.626636 | # File: awssystemsmanager_connector.py
#
# Copyright (c) 2019-2022 Splunk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 0 | 0 | 0 | 36,141 | 0 | 0 | 0 | 83 | 399 |
f156dd7fa54181c6990291348307f470c438b030 | 544 | py | Python | src/utils/report_months.py | kimvanwyk/ndlc_finances | 7c19a2a9778875fcb08dd7b98685d3aa36f5c7b1 | [
"BSD-3-Clause"
] | null | null | null | src/utils/report_months.py | kimvanwyk/ndlc_finances | 7c19a2a9778875fcb08dd7b98685d3aa36f5c7b1 | [
"BSD-3-Clause"
] | null | null | null | src/utils/report_months.py | kimvanwyk/ndlc_finances | 7c19a2a9778875fcb08dd7b98685d3aa36f5c7b1 | [
"BSD-3-Clause"
] | null | null | null |
if __name__ == '__main__':
print(get_report_months())
| 25.904762 | 47 | 0.544118 | from datetime import date, timedelta
def get_report_months():
today = date.today() + timedelta(weeks=4)
months = [date(today.year, today.month, 1)]
while True:
year = months[-1].year
month = months[-1].month
if months[-1].month > 1:
month -= 1
else:
m... | 0 | 0 | 0 | 0 | 0 | 425 | 0 | 15 | 45 |
cdc626e531852e378dce413240d443d81b7ab07f | 5,154 | py | Python | gestorClientes.py | AndresDuque16/GestorClientes | 25a1157d2135bd5afb0314d1639f7e3a7e496a70 | [
"Apache-2.0"
] | null | null | null | gestorClientes.py | AndresDuque16/GestorClientes | 25a1157d2135bd5afb0314d1639f7e3a7e496a70 | [
"Apache-2.0"
] | null | null | null | gestorClientes.py | AndresDuque16/GestorClientes | 25a1157d2135bd5afb0314d1639f7e3a7e496a70 | [
"Apache-2.0"
] | null | null | null | from tkinter import ttk #treeview
import sqlite3
root = Tk()
root.title('Libreta de Clientes')
conn = sqlite3.connect('gestorCliente.db') #coneccion a la base de datos
c = conn.cursor() #cursor para ejecutar consultas
#creacin de base de datos
c.execute("""
CREATE TABLE if not exists cliente (
... | 39.646154 | 123 | 0.668219 | from tkinter import *
from tkinter import messagebox
from tkinter import ttk #treeview
import sqlite3
root = Tk()
root.title('Libreta de Clientes')
conn = sqlite3.connect('gestorCliente.db') #coneccion a la base de datos
c = conn.cursor() #cursor para ejecutar consultas
#creación de base de datos
c.execu... | 6 | 0 | 0 | 0 | 0 | 3,191 | 0 | 9 | 135 |
8edac4a434ff40d7f5d637b471e2676b77119bc3 | 978 | py | Python | spicedmodel/PlotPlanet.py | mattkjames7/spicedmodel | 7762a37180f8d399a4e16dd666fad5a1bbea1991 | [
"MIT"
] | null | null | null | spicedmodel/PlotPlanet.py | mattkjames7/spicedmodel | 7762a37180f8d399a4e16dd666fad5a1bbea1991 | [
"MIT"
] | null | null | null | spicedmodel/PlotPlanet.py | mattkjames7/spicedmodel | 7762a37180f8d399a4e16dd666fad5a1bbea1991 | [
"MIT"
] | null | null | null | import numpy as np
def PlotPlanet(ax,R=1.0,Center=[0.0,0.0,0.0],zorder=10,NoonTop=True):
'''
Plot the planet in the centre of a set of Axes.
Inputs
======
ax : matplotlib.pyplot.Axes instance
This is the set of axes to plot on.
R : float
Radius to plot planet with.
Center : float
3-element array-like ob... | 27.942857 | 69 | 0.664622 | import numpy as np
def PlotPlanet(ax,R=1.0,Center=[0.0,0.0,0.0],zorder=10,NoonTop=True):
'''
Plot the planet in the centre of a set of Axes.
Inputs
======
ax : matplotlib.pyplot.Axes instance
This is the set of axes to plot on.
R : float
Radius to plot planet with.
Center : float
3-element array-like ob... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
260dbb8d6617ad3cba7e98627e5c0dc79bbcf6a1 | 2,538 | py | Python | rowTransposition_cipher.py | Kchao1910/Playfair-Cipher | 57b2771134d041d2c8dd23e3c577efb10e14a26c | [
"MIT"
] | 1 | 2019-03-17T04:31:47.000Z | 2019-03-17T04:31:47.000Z | rowTransposition_cipher.py | Kchao1910/Playfair-Cipher | 57b2771134d041d2c8dd23e3c577efb10e14a26c | [
"MIT"
] | null | null | null | rowTransposition_cipher.py | Kchao1910/Playfair-Cipher | 57b2771134d041d2c8dd23e3c577efb10e14a26c | [
"MIT"
] | 1 | 2021-04-09T06:58:03.000Z | 2021-04-09T06:58:03.000Z | # CPSC 452 HW1 - Row Transposition Cipher
# Authors: Jake Cliff, Kenny Chao, and Scott Ng
| 23.719626 | 62 | 0.552403 | # CPSC 452 HW1 - Row Transposition Cipher
# Authors: Jake Cliff, Kenny Chao, and Scott Ng
import sys
import cipherCheck
import math
def enc_rowTransposition(message, key):
rows = math.ceil(len(message)/len(key))
columns = len(key)
# Calculate number of characters to fill matrix
totalChars = rows * col... | 0 | 0 | 0 | 0 | 0 | 2,333 | 0 | -24 | 135 |
f0234f48201c20939a27f81f69bbf761563fe3ad | 211 | py | Python | examples/asyncawait.py | quynhanh-ngx/pytago | de976ad8d85702ae665e97978bc4a75d282c857f | [
"MIT"
] | 206 | 2021-06-24T16:16:13.000Z | 2022-03-31T07:44:17.000Z | examples/asyncawait.py | quynhanh-ngx/pytago | de976ad8d85702ae665e97978bc4a75d282c857f | [
"MIT"
] | 13 | 2021-06-24T17:51:36.000Z | 2022-02-23T10:07:17.000Z | examples/asyncawait.py | quynhanh-ngx/pytago | de976ad8d85702ae665e97978bc4a75d282c857f | [
"MIT"
] | 14 | 2021-06-26T02:19:45.000Z | 2022-03-30T03:02:49.000Z | import asyncio
if __name__ == '__main__':
asyncio.run(main())
| 13.1875 | 35 | 0.63981 | import asyncio
async def myAsyncFunction() -> int:
await asyncio.sleep(2)
return 2
async def main():
r = await myAsyncFunction()
print(r)
if __name__ == '__main__':
asyncio.run(main())
| 0 | 0 | 95 | 0 | 0 | 0 | 0 | 0 | 46 |
4a5cdd34ad4fdd7683edc1c46107d4bbe0e3badf | 21,073 | py | Python | CVPRACv2/cvprac_ContainerTest.py | networkop/CVP_Ansible_Modules | 1a850c0374ced5bdc699c1d955258826e6692b38 | [
"BSD-3-Clause"
] | null | null | null | CVPRACv2/cvprac_ContainerTest.py | networkop/CVP_Ansible_Modules | 1a850c0374ced5bdc699c1d955258826e6692b38 | [
"BSD-3-Clause"
] | null | null | null | CVPRACv2/cvprac_ContainerTest.py | networkop/CVP_Ansible_Modules | 1a850c0374ced5bdc699c1d955258826e6692b38 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Copyright (c) 2019, Arista Networks EOS+
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# Redistributions of source code must retain the above copyright notice,
# ... | 47.676471 | 138 | 0.641959 | #!/usr/bin/env python
#
# Copyright (c) 2019, Arista Networks EOS+
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# Redistributions of source code must retain the above copyright notice,
# ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7052d37f9d2a08e22c7d0f1c675de5ec802e027b | 1,510 | py | Python | invenio_app_ils/acquisition/indexer.py | jrcastro2/invenio-app-ils | 502b9e7bac737863905976a1d07e2cd924f5d779 | [
"MIT"
] | null | null | null | invenio_app_ils/acquisition/indexer.py | jrcastro2/invenio-app-ils | 502b9e7bac737863905976a1d07e2cd924f5d779 | [
"MIT"
] | 21 | 2018-11-02T14:19:53.000Z | 2021-06-25T15:16:42.000Z | invenio_app_ils/acquisition/indexer.py | topless/invenio-app-ils | 38f5a6b61cdeaf5fa5776613073fa46af28737a9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2019-2020 CERN.
#
# invenio-app-ils is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Acquisition indexer APIs."""
| 30.816327 | 78 | 0.734437 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2019-2020 CERN.
#
# invenio-app-ils is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Acquisition indexer APIs."""
from datetime import datetime
from celery import shared_task
from flask imp... | 0 | 606 | 0 | 325 | 0 | 0 | 0 | 130 | 204 |
16213ccc93dbdff9c66b124acbe7b5cd93afad3b | 1,206 | py | Python | cohesity_management_sdk/models/type_oracle_protection_source_enum.py | chandrashekar-cohesity/management-sdk-python | 9e6ec99e8a288005804b808c4e9b19fd204e3a8b | [
"Apache-2.0"
] | 1 | 2021-01-07T20:36:22.000Z | 2021-01-07T20:36:22.000Z | cohesity_management_sdk/models/type_oracle_protection_source_enum.py | chandrashekar-cohesity/management-sdk-python | 9e6ec99e8a288005804b808c4e9b19fd204e3a8b | [
"Apache-2.0"
] | null | null | null | cohesity_management_sdk/models/type_oracle_protection_source_enum.py | chandrashekar-cohesity/management-sdk-python | 9e6ec99e8a288005804b808c4e9b19fd204e3a8b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2019 Cohesity Inc.
| 30.15 | 77 | 0.708126 | # -*- coding: utf-8 -*-
# Copyright 2019 Cohesity Inc.
class TypeOracleProtectionSourceEnum(object):
"""Implementation of the 'Type_OracleProtectionSource' enum.
Specifies the type of the managed Object in Oracle Protection Source.
'kRACRootContainer' indicates the entity is a root container to an Oracle... | 0 | 0 | 0 | 1,127 | 0 | 0 | 0 | 0 | 23 |
01819ce1843629dde3d93b6b7f35f7efe11481aa | 1,359 | py | Python | Math/Prime Sum.py | mr-mornin-star/problemSolving | c278e5d090af7370e56789e68b7bb73dc37165f8 | [
"Apache-2.0"
] | null | null | null | Math/Prime Sum.py | mr-mornin-star/problemSolving | c278e5d090af7370e56789e68b7bb73dc37165f8 | [
"Apache-2.0"
] | null | null | null | Math/Prime Sum.py | mr-mornin-star/problemSolving | c278e5d090af7370e56789e68b7bb73dc37165f8 | [
"Apache-2.0"
] | null | null | null | """
Prime Sum
Problem Description
Given an even number A ( greater than 2 ), return two prime numbers whose sum will be equal to given number. If there are more than one solutions possible, return the lexicographically smaller solution.
If [a, b] is one solution with a <= b, and [c,d] is another solution with c <= d,... | 26.647059 | 204 | 0.596762 | """
Prime Sum
Problem Description
Given an even number A ( greater than 2 ), return two prime numbers whose sum will be equal to given number. If there are more than one solutions possible, return the lexicographically smaller solution.
If [a, b] is one solution with a <= b, and [c,d] is another solution with c <= d,... | 0 | 0 | 0 | 572 | 0 | 0 | 0 | 0 | 22 |
52267bbd0316b959d1d58b95d150066d249081dc | 3,581 | py | Python | crypto/chainfunc/solution/solver.py | vidner/codepwnda-ctf | 7e086044b753fe555b44395b79827d2f5b89da1d | [
"Unlicense"
] | 6 | 2021-02-18T15:07:55.000Z | 2022-02-04T01:38:10.000Z | crypto/chainfunc/solution/solver.py | vidner/codepwnda-ctf | 7e086044b753fe555b44395b79827d2f5b89da1d | [
"Unlicense"
] | null | null | null | crypto/chainfunc/solution/solver.py | vidner/codepwnda-ctf | 7e086044b753fe555b44395b79827d2f5b89da1d | [
"Unlicense"
] | null | null | null | import random
import hashlib
# inp = raw_input()
enc = "3f6f706b513c5f65557a6e5a5d736979666663686073677975547a7e516665776a68696a657d6963777572674f7269716f59666f5857605a20566e7b7b5c5a75636c60596b6f68607f76547970717f784d6e6073515a5c686a81756e74755c63667468595d7f76736d5e696e5e607d63"
# print enc
for i in range(13... | 25.397163 | 233 | 0.443172 | import random
import hashlib
def f0(x):
a = 0
b = 1
while(x):
a = a + b
b = a - b
x = x - 1
return (a+b)%10
def f1(x):
a = ""
for i in range(len(x)):
a += chr((ord(x[i])^f0(i))%256)
return a
def f2(x):
q, r, t, k, n, l, y = 1, 0, 1, 1... | 0 | 0 | 0 | 0 | 0 | 2,528 | 0 | 0 | 225 |
389ff2f2dc854b2241051dcae4d45fe0968eda61 | 1,583 | py | Python | tests/run.py | alibaba/FederatedScope | fcf6d237624769ea094cfd68803901622f14fc23 | [
"Apache-2.0"
] | 9 | 2022-03-24T07:59:37.000Z | 2022-03-31T06:47:52.000Z | tests/run.py | alibaba/FederatedScope | fcf6d237624769ea094cfd68803901622f14fc23 | [
"Apache-2.0"
] | 1 | 2022-03-28T13:52:17.000Z | 2022-03-28T13:52:17.000Z | tests/run.py | alibaba/FederatedScope | fcf6d237624769ea094cfd68803901622f14fc23 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Alibaba, Inc. and its affiliates.
import argparse
import os
import sys
file_dir = os.path.join(os.path.dirname(__file__), '..')
sys.path.append(file_dir)
parser = argparse.ArgumentParser('test runner')
parser.add_argument('--list_tests', action='store_true', help='list all tests')
parser.add_argumen... | 31.039216 | 79 | 0.589387 | # Copyright (c) Alibaba, Inc. and its affiliates.
import argparse
import os
import sys
import unittest
file_dir = os.path.join(os.path.dirname(__file__), '..')
sys.path.append(file_dir)
parser = argparse.ArgumentParser('test runner')
parser.add_argument('--list_tests', action='store_true', help='list all tests')
pa... | 0 | 0 | 0 | 0 | 0 | 948 | 0 | -6 | 68 |
a89916277675d1edfd15479740762e0cc90acb4f | 953 | py | Python | twitoff/models.py | yestrella14/twitoff-ye | 2ebe67d1a822fedbe0877482bd9c7577d9a1ac13 | [
"MIT"
] | null | null | null | twitoff/models.py | yestrella14/twitoff-ye | 2ebe67d1a822fedbe0877482bd9c7577d9a1ac13 | [
"MIT"
] | null | null | null | twitoff/models.py | yestrella14/twitoff-ye | 2ebe67d1a822fedbe0877482bd9c7577d9a1ac13 | [
"MIT"
] | null | null | null | from flask_sqlalchemy import SQLAlchemy
DB = SQLAlchemy()
| 28.878788 | 79 | 0.655824 | from flask_sqlalchemy import SQLAlchemy
DB = SQLAlchemy()
class User(DB.Model):
id = DB.Column(DB.BigInteger, primary_key=True)
name = DB.Column(DB.String, nullable=False)
def __repr__(self):
return "<User: {}>".format(self.name)
class Tweet(DB.Model):
id = DB.Column(DB.BigInteger, primary_k... | 0 | 0 | 0 | 542 | 0 | 283 | 0 | 0 | 69 |
8dead120547a2997e99d30a60ce6d94b80b6393c | 4,459 | py | Python | users/forms.py | bycristhian/psp | 019825e010386b6acc8c5466e7a6765218cb10d9 | [
"MIT"
] | 2 | 2020-09-04T17:06:41.000Z | 2020-10-05T01:46:20.000Z | users/forms.py | bycristhian/psp | 019825e010386b6acc8c5466e7a6765218cb10d9 | [
"MIT"
] | null | null | null | users/forms.py | bycristhian/psp | 019825e010386b6acc8c5466e7a6765218cb10d9 | [
"MIT"
] | null | null | null |
# Django
# Models
# Utils
| 28.954545 | 100 | 0.629289 |
# Django
from django import forms
from django.utils.translation import gettext as _
from django.conf import settings
# Models
from django.contrib.auth.models import User
from users.models import ExperienceCompany, PositionCompany, Profile
# Utils
from users.utils import GENERES
from services.email import EmailServic... | 0 | 0 | 0 | 4,035 | 0 | 0 | 0 | 126 | 267 |
0905002943804cede15361fe93d5932702ebcb3e | 1,230 | py | Python | mdf/tests/test_context.py | manahl/mdf | 4b2c78084467791ad883c0b4c53832ad70fc96ef | [
"MIT"
] | 100 | 2015-06-14T23:38:41.000Z | 2019-10-28T03:23:28.000Z | mdf/tests/test_context.py | ahlmss/mdf | 4b2c78084467791ad883c0b4c53832ad70fc96ef | [
"MIT"
] | 6 | 2016-12-28T11:22:12.000Z | 2018-12-02T23:01:08.000Z | mdf/tests/test_context.py | manahl/mdf | 4b2c78084467791ad883c0b4c53832ad70fc96ef | [
"MIT"
] | 40 | 2015-07-21T17:13:56.000Z | 2019-07-29T21:26:49.000Z | from mdf import (varnode)
A = varnode()
| 22.777778 | 96 | 0.599187 | from datetime import datetime
from mdf import (
MDFContext,
varnode,
nansumnode,
evalnode,
now,
shift,
)
from numpy.testing.utils import assert_array_almost_equal
from pandas.core import datetools
import pandas as pd
import unittest
A = varnode()
@nansumnode
def B():
return A() + now().ye... | 0 | 160 | 0 | 705 | 0 | 0 | 0 | 121 | 203 |
cbe87168ed3aaf354d439a33c7e9f73c3e98e082 | 5,732 | py | Python | analysis/graph/messages.py | giovannistanco/iot-trust-task-alloc | 47e0c8186db32ecd563241d05ebdaaf23713a83f | [
"MIT"
] | 8 | 2021-03-10T17:12:47.000Z | 2021-12-09T13:30:56.000Z | analysis/graph/messages.py | giovannistanco/iot-trust-task-alloc | 47e0c8186db32ecd563241d05ebdaaf23713a83f | [
"MIT"
] | 12 | 2020-06-29T13:49:47.000Z | 2022-02-28T13:01:12.000Z | analysis/graph/messages.py | giovannistanco/iot-trust-task-alloc | 47e0c8186db32ecd563241d05ebdaaf23713a83f | [
"MIT"
] | 3 | 2021-05-04T16:24:08.000Z | 2021-12-16T16:47:23.000Z | #!/usr/bin/env python3
from __future__ import annotations
import pathlib
import scipy.stats as stats
import matplotlib.pyplot as plt
plt.rcParams['text.usetex'] = True
plt.rcParams['font.size'] = 12
if __name__ == "__main__":
import argparse
parser = argparse.ArgumentParser(description='Messages sent and r... | 33.91716 | 181 | 0.594906 | #!/usr/bin/env python3
from __future__ import annotations
import math
import pathlib
from ipaddress import IPv6Address
from pprint import pprint
from datetime import datetime, timedelta
import numpy as np
import scipy.stats as stats
import matplotlib.pyplot as plt
import matplotlib.dates as mdates
from analysis.par... | 0 | 0 | 0 | 0 | 0 | 4,629 | 0 | 85 | 225 |
928224abb04ea9ced0d80a67994664dec958690d | 1,484 | py | Python | solutions/056.merge-intervals/merge-intervals.py | wangsongiam/leetcode | 96ff21bca1871816ae51fccb1fa13587b378dc50 | [
"MIT"
] | 3 | 2018-11-25T15:19:57.000Z | 2019-09-28T03:01:11.000Z | solutions/056.merge-intervals/merge-intervals.py | casprwang/leetcode | 96ff21bca1871816ae51fccb1fa13587b378dc50 | [
"MIT"
] | null | null | null | solutions/056.merge-intervals/merge-intervals.py | casprwang/leetcode | 96ff21bca1871816ae51fccb1fa13587b378dc50 | [
"MIT"
] | 3 | 2018-02-11T20:23:44.000Z | 2020-06-05T15:39:56.000Z | # Definition for an interval.
# class Interval:
# def __init__(self, s=0, e=0):
# self.start = s
# self.end = e
| 24.733333 | 52 | 0.421159 | # Definition for an interval.
# class Interval:
# def __init__(self, s=0, e=0):
# self.start = s
# self.end = e
class Solution:
def merge(self, intervals):
"""
:type intervals: List[Interval]
:rtype: List[Interval]
"""
intervals.sort(key=lambda x: x.start... | 0 | 0 | 0 | 1,329 | 0 | 0 | 0 | 0 | 23 |
1c45a859a5271dffa80a1d5cc1763cd482c9913a | 2,912 | py | Python | test/integration_tests/test_roles.py | poldracklab/bids-core | b87a1ef2d3e1c5a79a98c0f0ba82b1b2634bce0e | [
"MIT"
] | 1 | 2016-03-09T01:24:02.000Z | 2016-03-09T01:24:02.000Z | test/integration_tests/test_roles.py | poldracklab/bids-core | b87a1ef2d3e1c5a79a98c0f0ba82b1b2634bce0e | [
"MIT"
] | 15 | 2016-02-17T19:11:32.000Z | 2018-04-12T23:33:06.000Z | test/integration_tests/test_roles.py | poldracklab/bids-core | b87a1ef2d3e1c5a79a98c0f0ba82b1b2634bce0e | [
"MIT"
] | 4 | 2017-04-05T17:34:59.000Z | 2018-01-22T01:40:51.000Z |
base_url = 'http://localhost:8080/api'
adm_user = 'test@user.com'
user = 'other@user.com'
test_data = type('',(object,),{})()
| 25.321739 | 71 | 0.595467 | import requests
import os
import json
import time
from nose.tools import with_setup
base_url = 'http://localhost:8080/api'
adm_user = 'test@user.com'
user = 'other@user.com'
test_data = type('',(object,),{})()
def setup_db():
global session
session = requests.Session()
# all the requests will be performe... | 0 | 1,378 | 0 | 0 | 0 | 1,230 | 0 | -26 | 202 |
7b0d0d6d1fd9941ba19251b6de0c2755dddee22a | 1,458 | py | Python | src/cs165/passport_holder/views.py | kenserr/cs165 | f6f818ae1c05fe492817da8dc460917a0b3020d2 | [
"bzip2-1.0.6"
] | null | null | null | src/cs165/passport_holder/views.py | kenserr/cs165 | f6f818ae1c05fe492817da8dc460917a0b3020d2 | [
"bzip2-1.0.6"
] | null | null | null | src/cs165/passport_holder/views.py | kenserr/cs165 | f6f818ae1c05fe492817da8dc460917a0b3020d2 | [
"bzip2-1.0.6"
] | null | null | null | # Create your views here. | 26.509091 | 66 | 0.768176 | from django.shortcuts import render, get_object_or_404, redirect
from .models import passport_holder
from .forms import passport_holder_form
# Create your views here.
def passport_holder_detail_view(request, id):
obj = passport_holder.objects.get(passport_no=id)
context = {
"object": obj
}
return render(reques... | 0 | 0 | 0 | 0 | 0 | 1,178 | 0 | 75 | 180 |
4048a5206d42424533da25b4a6ffb0c2d6c8b696 | 2,401 | py | Python | global_finprint/annotation/migrations/0019_drop_obs_columns.py | GlobalFinPrint/global_finprint | 8a91ceaaed42aaa716d8c9f27518ba673ebf351c | [
"Apache-2.0"
] | null | null | null | global_finprint/annotation/migrations/0019_drop_obs_columns.py | GlobalFinPrint/global_finprint | 8a91ceaaed42aaa716d8c9f27518ba673ebf351c | [
"Apache-2.0"
] | 6 | 2020-06-05T18:42:32.000Z | 2022-01-13T00:48:57.000Z | global_finprint/annotation/migrations/0019_drop_obs_columns.py | GlobalFinPrint/global_finprint | 8a91ceaaed42aaa716d8c9f27518ba673ebf351c | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
import django.contrib.gis.db.models.fields
import django.db.models.deletion
| 28.583333 | 122 | 0.557684 | from __future__ import unicode_literals
import config.current_user
from django.conf import settings
import django.contrib.gis.db.models.fields
from django.db import migrations, models
import django.db.models.deletion
import django.db.models.manager
class Migration(migrations.Migration):
dependencies = [
... | 0 | 0 | 0 | 2,126 | 0 | 0 | 0 | 45 | 112 |
6b50a35bca39b52edd97dc306a00624664338d72 | 645 | py | Python | launcher_pins.py | videoman/T-ShirtCannon | b88553a6ac0aeac2a2c61a92aed17da093bf72b7 | [
"BSD-3-Clause"
] | null | null | null | launcher_pins.py | videoman/T-ShirtCannon | b88553a6ac0aeac2a2c61a92aed17da093bf72b7 | [
"BSD-3-Clause"
] | null | null | null | launcher_pins.py | videoman/T-ShirtCannon | b88553a6ac0aeac2a2c61a92aed17da093bf72b7 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
# This file defines the output and input pins for the T-Shirt Launcher
# Define our relay outputs
# Each output is triggered via a ULN2803 Darlington Driver
TSHIRT1=4
TSHIRT2=17
TSHIRT3=22
TSHIRT4=18
# Define our LED outputs
# LED status for each barrel
LED1=2
LED2=14
LED3=3
LED4=15
# Either for e... | 20.15625 | 85 | 0.773643 | #!/usr/bin/python
# This file defines the output and input pins for the T-Shirt Launcher
# Define our relay outputs
# Each output is triggered via a ULN2803 Darlington Driver
TSHIRT1=4
TSHIRT2=17
TSHIRT3=22
TSHIRT4=18
# Define our LED outputs
# LED status for each barrel
LED1=2
LED2=14
LED3=3
LED4=15
# Either for e... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
53c94e390b69858f0922b4ee1a0ba97d14588749 | 4,362 | py | Python | aws_instance/backend.py | geekysuavo/aws-instance-tool | 811c8a1a476916b7dad5f5287f83f7fd56280029 | [
"MIT"
] | null | null | null | aws_instance/backend.py | geekysuavo/aws-instance-tool | 811c8a1a476916b7dad5f5287f83f7fd56280029 | [
"MIT"
] | null | null | null | aws_instance/backend.py | geekysuavo/aws-instance-tool | 811c8a1a476916b7dad5f5287f83f7fd56280029 | [
"MIT"
] | null | null | null | import functools
import boto3.ec2
from botocore.exceptions import ClientError
from typing import Dict, List
# use a global EC2 handle.
ec2 = boto3.client("ec2")
def run(command) -> Dict:
"""Execute a command after an initial dry-run"""
try:
command(DryRun=True)
except ClientError as err:
... | 27.433962 | 72 | 0.582072 |
import os
import yaml
import functools
import subprocess
import boto3.ec2
from botocore.exceptions import ClientError
from typing import Dict, List, Tuple
from dataclasses import dataclass
# use a global EC2 handle.
ec2 = boto3.client("ec2")
def run(command) -> Dict:
"""Execute a command after an initial dry-... | 0 | 3,412 | 0 | 0 | 0 | 0 | 0 | -7 | 135 |
8c004459e0c60e668996195da9668c54fa852bd0 | 138 | py | Python | scripts/npc/autogen_naomi.py | hsienjan/SideQuest-Server | 3e88debaf45615b759d999255908f99a15283695 | [
"MIT"
] | null | null | null | scripts/npc/autogen_naomi.py | hsienjan/SideQuest-Server | 3e88debaf45615b759d999255908f99a15283695 | [
"MIT"
] | null | null | null | scripts/npc/autogen_naomi.py | hsienjan/SideQuest-Server | 3e88debaf45615b759d999255908f99a15283695 | [
"MIT"
] | null | null | null | # Character field ID when accessed: 600020000
# ObjectID: 1000000
# ParentID: 9201051
# Object Position X: -937
# Object Position Y: 2658
| 23 | 45 | 0.753623 | # Character field ID when accessed: 600020000
# ObjectID: 1000000
# ParentID: 9201051
# Object Position X: -937
# Object Position Y: 2658
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3f91c07a9469a5f52847fe24a2e19954225a1ab5 | 353 | py | Python | interview-test/src/commands/list_command.py | warstick/phyton | d8b0ee971808af5a0f519ec123940569040846f3 | [
"MIT"
] | null | null | null | interview-test/src/commands/list_command.py | warstick/phyton | d8b0ee971808af5a0f519ec123940569040846f3 | [
"MIT"
] | null | null | null | interview-test/src/commands/list_command.py | warstick/phyton | d8b0ee971808af5a0f519ec123940569040846f3 | [
"MIT"
] | null | null | null | """
IDE: Visual Code
Author: Mani
Date: 01-05-2020
"""
| 23.533333 | 80 | 0.623229 | """
IDE: Visual Code
Author: Mani
Date: 01-05-2020
"""
from module.module import Module
class ListCommand:
# This method returns the information about the installed modules / packages
def execute(self, args):
result = dict()
for m in Module.getInstalled():
result[m.getNa... | 0 | 0 | 0 | 230 | 0 | 0 | 0 | 11 | 45 |
52bdc212ef837796a1b53425e694e3c862058e72 | 600 | py | Python | questions/14.py | xiaochus/LeetCode | bf4d7a39fd6b0fb2682490f90999cb218a910e14 | [
"MIT"
] | 1 | 2018-06-18T04:40:23.000Z | 2018-06-18T04:40:23.000Z | questions/14.py | xiaochus/LeetCode | bf4d7a39fd6b0fb2682490f90999cb218a910e14 | [
"MIT"
] | null | null | null | questions/14.py | xiaochus/LeetCode | bf4d7a39fd6b0fb2682490f90999cb218a910e14 | [
"MIT"
] | 1 | 2020-02-03T12:58:26.000Z | 2020-02-03T12:58:26.000Z | """14. Longest Common Prefix
Write a function to find the longest common prefix string amongst
an array of strings.
"""
| 22.222222 | 65 | 0.506667 | """14. Longest Common Prefix
Write a function to find the longest common prefix string amongst
an array of strings.
"""
class Solution:
def longestCommonPrefix(self, strs):
"""
:type strs: List[str]
:rtype: str
"""
if not strs:
return ""
if len(strs) == ... | 0 | 0 | 0 | 456 | 0 | 0 | 0 | 0 | 23 |
4cfa9bf59c00d3403e437d983b24edcae02cc734 | 466 | py | Python | Module 1/task1_2.py | bondss/python_scripts | e1fd96b15c22811e43f665ec354563f35522d2ad | [
"Apache-2.0"
] | null | null | null | Module 1/task1_2.py | bondss/python_scripts | e1fd96b15c22811e43f665ec354563f35522d2ad | [
"Apache-2.0"
] | null | null | null | Module 1/task1_2.py | bondss/python_scripts | e1fd96b15c22811e43f665ec354563f35522d2ad | [
"Apache-2.0"
] | null | null | null | # TASK:
# : 3 -- .
# :
# SOLUTION:
# Importing modules to work with embedded functions
import sys
import math
# Assigning variables values of three cmd-line arguments
x = float(sys.argv[1])
mu = float(sys.argv[2])
sigma = float(sys.argv[3])
# Calculate given formula
result = (1/(sigma*math.sqrt(2*math.pi))... | 24.526316 | 87 | 0.72103 | # TASK:
# Вхідні дані: 3 дійсних числа -- аргументи командного рядка.
# Вихідні дані: результат обчислення формули
# SOLUTION:
# Importing modules to work with embedded functions
import sys
import math
# Assigning variables values of three cmd-line arguments
x = float(sys.argv[1])
mu = float(sys.argv[2])
sigma = flo... | 166 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
13a30cd02d37af150e969fe94bd9fdd6a3e486b5 | 3,562 | py | Python | GAScore/testbench/handler_wrapper.py | sharm294/shoal | db7dd08a70882585fb9740a39b57b4b7a48b3081 | [
"MIT"
] | 1 | 2021-04-12T06:41:33.000Z | 2021-04-12T06:41:33.000Z | GAScore/testbench/handler_wrapper.py | UofT-HPRC/shoal | db7dd08a70882585fb9740a39b57b4b7a48b3081 | [
"MIT"
] | null | null | null | GAScore/testbench/handler_wrapper.py | UofT-HPRC/shoal | db7dd08a70882585fb9740a39b57b4b7a48b3081 | [
"MIT"
] | null | null | null | import os
from sonar.testbench import Testbench, Module, TestVector, Thread
from sonar.interfaces import AXIS, SAXILite
from sonar_strToInt import strToInt
handler_wrapper = Testbench.default('handler_wrapper')
filepath = os.path.join(os.path.dirname(__file__), 'build/handler_wrapper/')
dut = Module.default("DUT")
... | 33.92381 | 95 | 0.709994 | import os
from sonar.testbench import Testbench, Module, TestVector, Thread
from sonar.interfaces import AXIS, SAXILite
from sonar_strToInt import strToInt
handler_wrapper = Testbench.default('handler_wrapper')
filepath = os.path.join(os.path.dirname(__file__), 'build/handler_wrapper/')
dut = Module.default("DUT")
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b9c1745c8dd2080b3f7d77015b4539d8932c318d | 4,139 | py | Python | maxwell/master.py | maxwell-dev/maxwell-client-python | 9d68ae57974c29d7454f4e95ff3c103e45ac48c7 | [
"Apache-2.0"
] | 1 | 2020-11-18T14:39:19.000Z | 2020-11-18T14:39:19.000Z | maxwell/master.py | maxwell-dev/maxwell-client-python | 9d68ae57974c29d7454f4e95ff3c103e45ac48c7 | [
"Apache-2.0"
] | null | null | null | maxwell/master.py | maxwell-dev/maxwell-client-python | 9d68ae57974c29d7454f4e95ff3c103e45ac48c7 | [
"Apache-2.0"
] | 1 | 2021-07-15T01:59:19.000Z | 2021-07-15T01:59:19.000Z | import pycommons.logger
logger = pycommons.logger.get_instance(__name__)
| 34.206612 | 70 | 0.597487 | import asyncio
import pycommons.logger
import maxwell.protocol.maxwell_protocol_pb2 as protocol_types
from maxwell.connection import Code
from maxwell.connection import Event
logger = pycommons.logger.get_instance(__name__)
class Master(object):
# ===========================================
# apis
# ===... | 0 | 0 | 995 | 2,895 | 0 | 0 | 0 | 63 | 111 |
6ebae8b3507ad4205d902002a6f8493e3b1c9856 | 9,497 | py | Python | psychoblend/ui.py | johannesvollmer/psychopath | 21cd04ce95deea631ef2c7ce50e200215668a3c0 | [
"MIT"
] | null | null | null | psychoblend/ui.py | johannesvollmer/psychopath | 21cd04ce95deea631ef2c7ce50e200215668a3c0 | [
"MIT"
] | null | null | null | psychoblend/ui.py | johannesvollmer/psychopath | 21cd04ce95deea631ef2c7ce50e200215668a3c0 | [
"MIT"
] | null | null | null |
# Use some of the existing buttons.
from bl_ui import properties_render
properties_render.RENDER_PT_render.COMPAT_ENGINES.add('PSYCHOPATH_RENDER')
properties_render.RENDER_PT_dimensions.COMPAT_ENGINES.add('PSYCHOPATH_RENDER')
properties_render.RENDER_PT_output.COMPAT_ENGINES.add('PSYCHOPATH_RENDER')
del properties_ren... | 32.635739 | 116 | 0.679688 | import bpy
# Use some of the existing buttons.
from bl_ui import properties_render
properties_render.RENDER_PT_render.COMPAT_ENGINES.add('PSYCHOPATH_RENDER')
properties_render.RENDER_PT_dimensions.COMPAT_ENGINES.add('PSYCHOPATH_RENDER')
properties_render.RENDER_PT_output.COMPAT_ENGINES.add('PSYCHOPATH_RENDER')
del pro... | 0 | 962 | 0 | 6,402 | 0 | 1,112 | 0 | -11 | 298 |
5aabcd4d51b7a5f6cec8a178ccd6918f0ddb1af7 | 293 | py | Python | IsItAPrivate192Address.py | steveirwincyber/Scripts | 4352804e23b5def283c6b0600701896be56aa910 | [
"Unlicense"
] | 1 | 2020-10-19T17:22:55.000Z | 2020-10-19T17:22:55.000Z | IsItAPrivate192Address.py | steveirwincyber/Scripts | 4352804e23b5def283c6b0600701896be56aa910 | [
"Unlicense"
] | null | null | null | IsItAPrivate192Address.py | steveirwincyber/Scripts | 4352804e23b5def283c6b0600701896be56aa910 | [
"Unlicense"
] | null | null | null | #used to determine if its a private ip address in 192.168.0.0/16
| 29.3 | 64 | 0.590444 | def isprivate(ip):
octet = ip.split('.')
octets = list(map(int,octet))
if octets[0] == 192 and octets[1] == 168:
if 0 <= octets[2] <= 255 and 0 <= octets[3] <= 255:
return True
return False
pass
#used to determine if its a private ip address in 192.168.0.0/16
| 0 | 0 | 0 | 0 | 0 | 206 | 0 | 0 | 22 |
22ad9e929211ef81079ae89356a6d499c45ec457 | 3,621 | py | Python | attachments/migrations/0001_initial.py | liddiard/appletini | fa006e1b71ac60738bb5353e949676755530c781 | [
"MIT"
] | 1 | 2015-03-17T04:13:47.000Z | 2015-03-17T04:13:47.000Z | attachments/migrations/0001_initial.py | liddiard/appletini | fa006e1b71ac60738bb5353e949676755530c781 | [
"MIT"
] | 27 | 2015-04-14T20:18:24.000Z | 2015-06-16T20:01:06.000Z | attachments/migrations/0001_initial.py | liddiard/appletini | fa006e1b71ac60738bb5353e949676755530c781 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
| 43.107143 | 143 | 0.554543 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.core.validators
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0002_remove_content_type_name'),
('authors', '0001_initial'),
]
operations = [... | 0 | 0 | 0 | 3,461 | 0 | 0 | 0 | 27 | 68 |
8a01d5ebf3645cc2775e942cf410251a913020cd | 5,531 | py | Python | paddlevideo/modeling/heads/base.py | ppppeng/cvsport22-figure-skating | c94f9a668f53c8ae34db5a917b5ad1deda8da0c5 | [
"Apache-2.0"
] | null | null | null | paddlevideo/modeling/heads/base.py | ppppeng/cvsport22-figure-skating | c94f9a668f53c8ae34db5a917b5ad1deda8da0c5 | [
"Apache-2.0"
] | null | null | null | paddlevideo/modeling/heads/base.py | ppppeng/cvsport22-figure-skating | c94f9a668f53c8ae34db5a917b5ad1deda8da0c5 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 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... | 37.120805 | 107 | 0.607304 | # Copyright (c) 2020 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 | 109 | 0 | 4,541 | 0 | 0 | 0 | 35 | 136 |
4067e2254c7fff7016edbb7c7552de11a6ab99a3 | 4,617 | py | Python | measure/performance/MSGo.py | isabella232/media-delivery | 663d0a02295aa79c7bdf5338798e409d3476f708 | [
"MIT"
] | 21 | 2020-08-04T04:27:50.000Z | 2022-03-31T22:03:43.000Z | measure/performance/MSGo.py | intel/media-delivery | 7494115ce70788cc2fa29343a8f2cf0c16419b3a | [
"MIT"
] | 24 | 2020-07-03T00:49:23.000Z | 2021-12-02T22:50:58.000Z | measure/performance/MSGo.py | isabella232/media-delivery | 663d0a02295aa79c7bdf5338798e409d3476f708 | [
"MIT"
] | 12 | 2020-07-03T01:47:28.000Z | 2022-03-23T07:40:29.000Z | #! /usr/bin/python3
##################################################################################
# Copyright (c) 2020 Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software... | 51.876404 | 234 | 0.639593 | #! /usr/bin/python3
##################################################################################
# Copyright (c) 2020 Intel Corporation
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 41 | 0 |
f40b7eb8a68e2df24b5da0b5c9bffaa6102f02b6 | 1,712 | py | Python | plaso/events/text_events.py | cvandeplas/plaso | b625a2c267ed09505cfac84c9593d8c0922852b1 | [
"Apache-2.0"
] | 3 | 2016-03-11T02:47:08.000Z | 2016-12-24T03:19:27.000Z | plaso/events/text_events.py | cvandeplas/plaso | b625a2c267ed09505cfac84c9593d8c0922852b1 | [
"Apache-2.0"
] | null | null | null | plaso/events/text_events.py | cvandeplas/plaso | b625a2c267ed09505cfac84c9593d8c0922852b1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2014 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the L... | 34.938776 | 74 | 0.721379 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2014 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the L... | 0 | 0 | 0 | 848 | 0 | 0 | 0 | 25 | 68 |
614ff5b172842cc55b6f1c0f4657babdd9574e43 | 1,145 | py | Python | openstack_dashboard/dashboards/idm/dashboard.py | agaldemas/horizon | 38c4fb7ea1f1d5a00a8e1fae0f7a864a7d09f1ab | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/dashboards/idm/dashboard.py | agaldemas/horizon | 38c4fb7ea1f1d5a00a8e1fae0f7a864a7d09f1ab | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/dashboards/idm/dashboard.py | agaldemas/horizon | 38c4fb7ea1f1d5a00a8e1fae0f7a864a7d09f1ab | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2014 Universidad Politecnica de Madrid
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 30.945946 | 75 | 0.674236 | # Copyright (C) 2014 Universidad Politecnica de Madrid
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 0 | 0 | 0 | 480 | 0 | 0 | 0 | 0 | 23 |
ce7842459573a9a9d59aaf86fabfbefc1bab3549 | 1,297 | py | Python | download_dataset.py | eltonfss/TMDAutoML | cf51d9dc4b7acc4c69a83e248f107bca9d008eac | [
"MIT"
] | 4 | 2019-01-20T19:13:18.000Z | 2022-02-22T22:10:02.000Z | download_dataset.py | eltonfss/TMDAutoML | cf51d9dc4b7acc4c69a83e248f107bca9d008eac | [
"MIT"
] | 1 | 2021-06-18T07:26:56.000Z | 2021-06-29T15:38:42.000Z | download_dataset.py | eltonfss/TMDAutoML | cf51d9dc4b7acc4c69a83e248f107bca9d008eac | [
"MIT"
] | null | null | null | import urllib
import os
# Constant
dataset_dir = './TransportationData'
datasetBalanced = dataset_dir + '/datasetBalanced'
rawOriginaldata = dataset_dir + '/_RawDataOriginal'
url_list = ['http://cs.unibo.it/projects/us-tm2017/static/dataset/extension/5second/dataset_5secondWindow.csv',
'http://cs.unibo.it/... | 34.131579 | 117 | 0.728604 | import urllib
import os
# Constant
dataset_dir = './TransportationData'
datasetBalanced = dataset_dir + '/datasetBalanced'
rawOriginaldata = dataset_dir + '/_RawDataOriginal'
url_list = ['http://cs.unibo.it/projects/us-tm2017/static/dataset/extension/5second/dataset_5secondWindow.csv',
'http://cs.unibo.it/... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1ed1ad90bbb7f458daba222ac3b8b2de75201045 | 3,271 | py | Python | plotta/__init__.py | gzuidhof/plotta-python | 61ec22c11c24e599486aedbeabb4d13ca62c6918 | [
"MIT"
] | null | null | null | plotta/__init__.py | gzuidhof/plotta-python | 61ec22c11c24e599486aedbeabb4d13ca62c6918 | [
"MIT"
] | null | null | null | plotta/__init__.py | gzuidhof/plotta-python | 61ec22c11c24e599486aedbeabb4d13ca62c6918 | [
"MIT"
] | null | null | null |
HOSTNAME = 'localhost'
PORT = 3000
PLOTTA_ENABLED = True
# API endpoint wrappers
| 31.757282 | 109 | 0.636197 | import unirest
import time
import socket
import uuid
HOSTNAME = 'localhost'
PORT = 3000
PLOTTA_ENABLED = True
# API endpoint wrappers
def job_new(job_id, name, node):
payload = {'job_id': job_id, 'name': name, 'node': node}
url = "http://{0}:{1}/api/job/new".format(HOSTNAME, PORT)
return sync_request(url,... | 0 | 0 | 0 | 1,256 | 0 | 1,650 | 0 | -35 | 317 |
257430f2566bf7abcdadbc27fbcfb4ceab9cd18c | 1,051 | py | Python | Train_and_Test_Notebooks/tests/IoU.py | parshwa1999/Map-Segmentation | 0c45c887fb2363125771bccafc27a953ad05ce5a | [
"MIT"
] | 5 | 2020-03-23T18:43:00.000Z | 2021-12-14T09:52:12.000Z | Train_and_Test_Notebooks/tests/IoU.py | parshwa1999/Map-Segmentation | 0c45c887fb2363125771bccafc27a953ad05ce5a | [
"MIT"
] | null | null | null | Train_and_Test_Notebooks/tests/IoU.py | parshwa1999/Map-Segmentation | 0c45c887fb2363125771bccafc27a953ad05ce5a | [
"MIT"
] | 1 | 2020-09-08T12:34:39.000Z | 2020-09-08T12:34:39.000Z | import cv2
import numpy as np
total = 0
for i in range(29):
original = cv2.imread(str(i) + "GroundTruth.png", 0)
predicted = cv2.imread(str(i) + "Prediction_Threshold.png", 0)
#print(np.shape(original))
original = original.flatten()
predicted = predicted.flatten()
original = (original>127)
... | 25.634146 | 99 | 0.573739 | import cv2
import numpy as np
total = 0
for i in range(29):
original = cv2.imread(str(i) + "GroundTruth.png", 0)
predicted = cv2.imread(str(i) + "Prediction_Threshold.png", 0)
#print(np.shape(original))
original = original.flatten()
predicted = predicted.flatten()
original = (original>127)
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
294464d47e73dcdf833d00d706cd3d6297463a47 | 1,488 | py | Python | Block.py | LiorArmon/Python-Hackathon | 075056d8476c6144b2eaa826ff623cf828385c73 | [
"Apache-2.0"
] | null | null | null | Block.py | LiorArmon/Python-Hackathon | 075056d8476c6144b2eaa826ff623cf828385c73 | [
"Apache-2.0"
] | null | null | null | Block.py | LiorArmon/Python-Hackathon | 075056d8476c6144b2eaa826ff623cf828385c73 | [
"Apache-2.0"
] | 2 | 2018-06-26T08:40:17.000Z | 2018-06-27T06:17:55.000Z | import psychopy.core
import psychopy.event
import psychopy.visual
import psychopy.gui | 29.76 | 119 | 0.597446 | import psychopy.core
import psychopy.event
import psychopy.visual
import pandas as pd
import numpy as np
import psychopy.gui
import psychopy.sound
import os
import yaml
import json
from pathlib import Path
import random
from Trial import Trial
class Block:
def __init__(self, stim_list, df, params, win, cue):
... | 0 | 0 | 0 | 1,222 | 0 | 0 | 0 | -40 | 221 |
e1d5805eabcda488c36ca76271466031cb90112e | 17,757 | py | Python | rak811/cli.py | hrnciar/pyrak811 | e62be1c7524224105984531abc8b9bda02a61e26 | [
"Apache-2.0"
] | 45 | 2019-04-23T03:36:07.000Z | 2022-03-23T06:05:46.000Z | rak811/cli.py | hrnciar/pyrak811 | e62be1c7524224105984531abc8b9bda02a61e26 | [
"Apache-2.0"
] | 24 | 2019-05-21T17:18:31.000Z | 2022-03-01T11:18:22.000Z | rak811/cli.py | hrnciar/pyrak811 | e62be1c7524224105984531abc8b9bda02a61e26 | [
"Apache-2.0"
] | 25 | 2019-03-11T14:25:26.000Z | 2022-03-04T15:05:28.000Z | """RAK811 CLI interface.
Provides a command line interface for the RAK811 module (Firmware V2.0).
Copyright 2019, 2021 Philippe Vanhaesendonck
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
... | 25.772134 | 79 | 0.587599 | """RAK811 CLI interface.
Provides a command line interface for the RAK811 module (Firmware V2.0).
Copyright 2019, 2021 Philippe Vanhaesendonck
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
... | 0 | 13,580 | 0 | 1,218 | 0 | 0 | 0 | 27 | 778 |
a54e466881c321eed881e10830f98325604d6d17 | 16,728 | py | Python | code-postprocessing/cocopp/testbedsettings.py | asmaatamna/coco | 4b1497a0e6d4de4a0dd75e03779d6c5349fa21ae | [
"BSD-3-Clause"
] | 2 | 2021-02-15T17:09:24.000Z | 2021-12-28T09:23:01.000Z | code-postprocessing/cocopp/testbedsettings.py | patsp/coco | 4b1497a0e6d4de4a0dd75e03779d6c5349fa21ae | [
"BSD-3-Clause"
] | null | null | null | code-postprocessing/cocopp/testbedsettings.py | patsp/coco | 4b1497a0e6d4de4a0dd75e03779d6c5349fa21ae | [
"BSD-3-Clause"
] | null | null | null |
scenario_rlbased = 'rlbased'
scenario_fixed = 'fixed'
scenario_biobjfixed = 'biobjfixed'
scenario_biobjrlbased = 'biobjrlbased'
scenario_biobjextfixed = 'biobjextfixed'
all_scenarios = [scenario_rlbased, scenario_fixed,
scenario_biobjfixed, scenario_biobjrlbased,
scenario_biobjextfixe... | 45.830137 | 175 | 0.663857 | import os
import numpy as np
import warnings
from . import genericsettings
scenario_rlbased = 'rlbased'
scenario_fixed = 'fixed'
scenario_biobjfixed = 'biobjfixed'
scenario_biobjrlbased = 'biobjrlbased'
scenario_biobjextfixed = 'biobjextfixed'
all_scenarios = [scenario_rlbased, scenario_fixed,
scenar... | 0 | 0 | 0 | 12,542 | 0 | 2,176 | 0 | -13 | 365 |
d05bdb90e6a92f83d84b67e331d6c3e5b11a35e9 | 11,679 | py | Python | gdal2tile-mapslicer/mapslicer/pp/ppserver.py | 13903596952/gdal2tiles | 5bfb8373da4776cab57e0cc58e7422fcedbe2315 | [
"Apache-2.0"
] | 44 | 2015-03-20T23:12:34.000Z | 2022-01-09T16:00:19.000Z | mapslicer/pp/ppserver.py | himaps/mapslicer | 1c60a2d4d3c0296424b2421e09001fcf32075c6e | [
"BSD-3-Clause"
] | 12 | 2015-02-16T20:41:25.000Z | 2021-05-01T05:21:34.000Z | mapslicer/pp/ppserver.py | kalxas/maptiler | 1c60a2d4d3c0296424b2421e09001fcf32075c6e | [
"BSD-3-Clause"
] | 20 | 2015-02-16T20:25:50.000Z | 2021-11-02T12:11:11.000Z | #!/usr/bin/env python
# Parallel Python Software: http://www.parallelpython.com
# Copyright (c) 2005-2009, Vitalii Vanovschi
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of... | 34.553254 | 79 | 0.587379 | #!/usr/bin/env python
# Parallel Python Software: http://www.parallelpython.com
# Copyright (c) 2005-2009, Vitalii Vanovschi
# All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# * Redistributions of... | 0 | 0 | 0 | 4,846 | 0 | 0 | 0 | 0 | 23 |
bf87e4023cb1c5cc6c8cb40d4677fb819d5cc6e4 | 470 | py | Python | dist/py/relay.py | microsoft/jacdac | 2c6548b7e55ac34141e5152c664ca268e873cf09 | [
"CC-BY-4.0",
"MIT"
] | 31 | 2020-07-24T14:49:32.000Z | 2022-03-20T12:20:56.000Z | dist/py/relay.py | microsoft/jacdac | 2c6548b7e55ac34141e5152c664ca268e873cf09 | [
"CC-BY-4.0",
"MIT"
] | 747 | 2020-07-31T22:05:45.000Z | 2022-03-31T23:27:35.000Z | dist/py/relay.py | microsoft/jacdac | 2c6548b7e55ac34141e5152c664ca268e873cf09 | [
"CC-BY-4.0",
"MIT"
] | 17 | 2020-07-31T10:49:01.000Z | 2022-03-15T03:21:43.000Z | # Autogenerated file for Relay
# Add missing from ... import const
_JD_SERVICE_CLASS_RELAY = const(0x183fe656)
_JD_RELAY_VARIANT_ELECTROMECHANICAL = const(0x1)
_JD_RELAY_VARIANT_SOLID_STATE = const(0x2)
_JD_RELAY_VARIANT_REED = const(0x3)
_JD_RELAY_REG_CLOSED = const(JD_REG_INTENSITY)
_JD_RELAY_REG_VARIANT = const(JD_R... | 42.727273 | 50 | 0.851064 | # Autogenerated file for Relay
# Add missing from ... import const
_JD_SERVICE_CLASS_RELAY = const(0x183fe656)
_JD_RELAY_VARIANT_ELECTROMECHANICAL = const(0x1)
_JD_RELAY_VARIANT_SOLID_STATE = const(0x2)
_JD_RELAY_VARIANT_REED = const(0x3)
_JD_RELAY_REG_CLOSED = const(JD_REG_INTENSITY)
_JD_RELAY_REG_VARIANT = const(JD_R... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |