hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | 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 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | 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 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6a762fb2592438b205199d3906152892bcd08d42 | 6,617 | py | Python | cortex/rois.py | pulkitag/pycortex | f329dccbe3f04dc4556b930f284bcddd760fc76b | [
"BSD-2-Clause"
] | 1 | 2021-03-08T22:52:52.000Z | 2021-03-08T22:52:52.000Z | cortex/rois.py | candleinwindsteve/pycortex | 988dc996a33f16208537a2e8ffe14e2ae3ea6647 | [
"BSD-2-Clause"
] | null | null | null | cortex/rois.py | candleinwindsteve/pycortex | 988dc996a33f16208537a2e8ffe14e2ae3ea6647 | [
"BSD-2-Clause"
] | null | null | null | import os
import tempfile
import binascii
import cStringIO
import numpy as np
import networkx as nx
from db import surfs
from svgroi import get_roipack, _make_layer, _find_layer, parser
from lxml import etree
from dataset import VertexData
from polyutils import Surface, boundary_edges
from utils import get_curvature,... | 41.099379 | 144 | 0.548889 |
cdb5d1399d4f941bb01e2bf44f49534692f79af4 | 1,676 | py | Python | scripts/view_shield_images.py | charlesblakemore/sem_processing | 1ec8ac4b3eff4886f7a86529c590eed7cc15cbba | [
"MIT"
] | null | null | null | scripts/view_shield_images.py | charlesblakemore/sem_processing | 1ec8ac4b3eff4886f7a86529c590eed7cc15cbba | [
"MIT"
] | null | null | null | scripts/view_shield_images.py | charlesblakemore/sem_processing | 1ec8ac4b3eff4886f7a86529c590eed7cc15cbba | [
"MIT"
] | null | null | null | import sys, os, time, re
import numpy as np
import matplotlib.pyplot as plt
import scipy.optimize as opti
from bead_util import find_all_fnames
import sem_util as su
img_dir = '/Users/manifestation/Stanford/beads/photos/sem/20191014_shield_v2_pc1_second-HF-clean/'
max_file = 1000
substr = '2000x_40deg.tif'
... | 20.691358 | 98 | 0.554893 |
d90bfcd24eba882c1801d443caa84c56dab64b75 | 1,379 | py | Python | 2021/d5p1.py | zmerlynn/advent-of-code | 20daa2df1ff57fff89fc88ea778cae59755424e3 | [
"BSD-3-Clause"
] | null | null | null | 2021/d5p1.py | zmerlynn/advent-of-code | 20daa2df1ff57fff89fc88ea778cae59755424e3 | [
"BSD-3-Clause"
] | null | null | null | 2021/d5p1.py | zmerlynn/advent-of-code | 20daa2df1ff57fff89fc88ea778cae59755424e3 | [
"BSD-3-Clause"
] | 1 | 2021-12-25T00:12:44.000Z | 2021-12-25T00:12:44.000Z | #!/usr/bin/python3
import collections
import fileinput
import numpy as np
import re
import sys
def solve(inp):
lines = []
max_x, max_y = 0, 0
for line in inp:
p1, p2 = re.split('\s+->\s', line.strip())
p1, p2 = point(p1), point(p2)
if p1[0] != p2[0] and p1[1] != p2[1]:
... | 25.537037 | 116 | 0.524293 |
de857c3819b6b326fb3d453eab5b2f6cb8ff999d | 3,280 | py | Python | waymo_open_dataset/utils/test_utils.py | DKandrew/waymo-open-dataset | b2b2fc8f06ed6801aec1ea2d406d559bff08b6b5 | [
"Apache-2.0"
] | 1,814 | 2019-08-20T18:30:38.000Z | 2022-03-31T04:14:51.000Z | waymo_open_dataset/utils/test_utils.py | meyerjo/waymo-open-dataset | 655c1fddb0071ab24544eb54c6690f09d7a9a1c3 | [
"Apache-2.0"
] | 418 | 2019-08-20T22:38:02.000Z | 2022-03-31T07:51:15.000Z | waymo_open_dataset/utils/test_utils.py | meyerjo/waymo-open-dataset | 655c1fddb0071ab24544eb54c6690f09d7a9a1c3 | [
"Apache-2.0"
] | 420 | 2019-08-21T10:59:06.000Z | 2022-03-31T08:31:44.000Z | # Copyright 2019 The Waymo Open Dataset 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... | 30.943396 | 80 | 0.671646 |
0b1b21b3c2c1df1dc776f62faaed23d6f2ce353f | 3,299 | py | Python | fibo/protocols/wallet_protocol.py | Fibo-Network/fibo-blockchain | 34471efc081a52443e874749bb8ea3dc50b59891 | [
"Apache-2.0"
] | null | null | null | fibo/protocols/wallet_protocol.py | Fibo-Network/fibo-blockchain | 34471efc081a52443e874749bb8ea3dc50b59891 | [
"Apache-2.0"
] | null | null | null | fibo/protocols/wallet_protocol.py | Fibo-Network/fibo-blockchain | 34471efc081a52443e874749bb8ea3dc50b59891 | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass
from typing import List, Optional, Tuple
from fibo.types.blockchain_format.coin import Coin
from fibo.types.blockchain_format.program import Program
from fibo.types.blockchain_format.sized_bytes import bytes32
from fibo.types.header_block import HeaderBlock
from fibo.types.spend_bundl... | 21.147436 | 116 | 0.776902 |
7ef0ba2ab96a01aef4994d5de747605120527114 | 1,913 | py | Python | deploy/text_classification/Predictor.py | amirgholipour/mlops_project | ddd88886c4d887b756c79973ea5524660a2c82e1 | [
"BSD-3-Clause"
] | null | null | null | deploy/text_classification/Predictor.py | amirgholipour/mlops_project | ddd88886c4d887b756c79973ea5524660a2c82e1 | [
"BSD-3-Clause"
] | null | null | null | deploy/text_classification/Predictor.py | amirgholipour/mlops_project | ddd88886c4d887b756c79973ea5524660a2c82e1 | [
"BSD-3-Clause"
] | null | null | null | import tensorflow as tf
import joblib
import numpy as np
import json
import traceback
import sys
import os
class Predictor(object):
def __init__(self):
self.loaded = False
def load(self):
print("Loading model",os.getpid())
self.model = tf.keras.models.load_model('model.h5', compile... | 31.360656 | 118 | 0.576581 |
46bda75ba178ea92567ed3a30dbcd16d090831c2 | 27,188 | py | Python | dbisshit.py | kaplanski/DBISshit | 60c7c3c8fd13462c24b627539332917e2a268f16 | [
"MIT"
] | null | null | null | dbisshit.py | kaplanski/DBISshit | 60c7c3c8fd13462c24b627539332917e2a268f16 | [
"MIT"
] | null | null | null | dbisshit.py | kaplanski/DBISshit | 60c7c3c8fd13462c24b627539332917e2a268f16 | [
"MIT"
] | null | null | null | #!/usr/bin/env python -B
#DBISshit! 0.1b - the python app that mimics a database
#Copyright (c) 2018 Jan-Daniel Kaplanski
###-------imports------###
from subprocess import call
from datetime import datetime
from os import name as osname
from os import chmod
from os.path import exists
from time import sleep
from sys ... | 33.237164 | 156 | 0.608872 |
b3212ddc8c5b722c1101b999b81c8ed3951de013 | 9,982 | py | Python | src/eval_meas.py | lishuai1993/FairMOT | b224d61a24038cc7dc38d186e48e25e89c5daa6c | [
"MIT"
] | null | null | null | src/eval_meas.py | lishuai1993/FairMOT | b224d61a24038cc7dc38d186e48e25e89c5daa6c | [
"MIT"
] | null | null | null | src/eval_meas.py | lishuai1993/FairMOT | b224d61a24038cc7dc38d186e48e25e89c5daa6c | [
"MIT"
] | null | null | null | import os
import os.path as osp
import numpy as np
from tqdm import tqdm
import cv2
import shutil
import matplotlib.pyplot as plt
import matplotlib
matplotlib.use('TkAgg')
import _init_paths
from tracking_utils import visualization as vis
from tracking_utils.log import logger
from tracking_utils.timer imp... | 36.833948 | 137 | 0.607794 |
86df210e442dbdab880476ac63700e71e2505061 | 494 | py | Python | Egzersiz/bilal/regexegzersiz2.py | ibrahimediz/ornekproje | c5ebeafc43a9c6d2aa639d0d95eedbce65991576 | [
"Apache-2.0"
] | null | null | null | Egzersiz/bilal/regexegzersiz2.py | ibrahimediz/ornekproje | c5ebeafc43a9c6d2aa639d0d95eedbce65991576 | [
"Apache-2.0"
] | null | null | null | Egzersiz/bilal/regexegzersiz2.py | ibrahimediz/ornekproje | c5ebeafc43a9c6d2aa639d0d95eedbce65991576 | [
"Apache-2.0"
] | null | null | null |
isimler = """
Merhaba
123123123123
2022-12-12
Mr. Simit
Mr. Kızılay
Mr. Kahverengi
Mr. Lacivert
Ms. Kırmızı
Ms. Yeşil
Mrs. Siyah
Mrs. Mavi
edizibrahim@patika.dev
patika@kodluyoruz.com
"""
##isimleri ayıklama
# pattern = re.compile(r"(Mr|Mrs|Ms).?\s(\w+)")
# matches = pattern.finditer(isimler)
# for match in matches:
... | 17.034483 | 47 | 0.700405 |
c6e8e81000aca4a53907836e9ef2b534c990510e | 10,600 | py | Python | ThirdAssigment/plots.py | PaiZuZe/MAC0460-machineLearning | 98031412d8835afad0fde318b5c57a613bfb4fc8 | [
"Apache-2.0"
] | null | null | null | ThirdAssigment/plots.py | PaiZuZe/MAC0460-machineLearning | 98031412d8835afad0fde318b5c57a613bfb4fc8 | [
"Apache-2.0"
] | 1 | 2018-09-16T16:31:36.000Z | 2018-09-16T16:31:36.000Z | ThirdAssigment/plots.py | PaiZuZe/MAC0460-machineLearning | 98031412d8835afad0fde318b5c57a613bfb4fc8 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
def plot_points_regression(x,
y,
title,
xlabel,
ylabel,
prediction=None,
... | 34.304207 | 93 | 0.553679 |
c5721f064e98b77681161a1bb9b152b1c1ec4f9c | 13,306 | py | Python | colour/models/tests/test_cie_lab.py | aurelienpierre/colour | 3ac45c12fbc0493e49ba4d4b2cb253df9fe14c47 | [
"BSD-3-Clause"
] | null | null | null | colour/models/tests/test_cie_lab.py | aurelienpierre/colour | 3ac45c12fbc0493e49ba4d4b2cb253df9fe14c47 | [
"BSD-3-Clause"
] | null | null | null | colour/models/tests/test_cie_lab.py | aurelienpierre/colour | 3ac45c12fbc0493e49ba4d4b2cb253df9fe14c47 | [
"BSD-3-Clause"
] | null | null | null | """Defines the unit tests for the :mod:`colour.models.cie_lab` module."""
import numpy as np
import unittest
from itertools import permutations
from colour.models import XYZ_to_Lab, Lab_to_XYZ, Lab_to_LCHab, LCHab_to_Lab
from colour.utilities import domain_range_scale, ignore_numpy_errors
__author__ = "Colour Develo... | 32.533007 | 83 | 0.56809 |
a22d4d22a892bb62ff9f39136884bd8bd64256e1 | 6,212 | py | Python | my_args.py | rxys/DAIN | 147791520d8bbb4d19e72c0222a59f5f3d7d218c | [
"MIT"
] | null | null | null | my_args.py | rxys/DAIN | 147791520d8bbb4d19e72c0222a59f5f3d7d218c | [
"MIT"
] | null | null | null | my_args.py | rxys/DAIN | 147791520d8bbb4d19e72c0222a59f5f3d7d218c | [
"MIT"
] | null | null | null | import os
import datetime
import argparse
import numpy
import networks
import torch
modelnames = networks.__all__
# import datasets
datasetNames = ('Vimeo_90K_interp') #datasets.__all__
parser = argparse.ArgumentParser(description='DAIN')
parser.add_argument('--debug',action = 'store_true', help='Enable debug mode'... | 52.201681 | 160 | 0.673213 |
25b057e612a0ca3106ae124468875dffffb39e39 | 2,107 | py | Python | bonus_top_interview_questions/227. Basic Calculator II.py | JacopoPan/leetcode-top100-liked-questions | 03dc05f087d05805d54b7585ce740338f3128833 | [
"MIT"
] | null | null | null | bonus_top_interview_questions/227. Basic Calculator II.py | JacopoPan/leetcode-top100-liked-questions | 03dc05f087d05805d54b7585ce740338f3128833 | [
"MIT"
] | null | null | null | bonus_top_interview_questions/227. Basic Calculator II.py | JacopoPan/leetcode-top100-liked-questions | 03dc05f087d05805d54b7585ce740338f3128833 | [
"MIT"
] | null | null | null | """
Runtime: 189 ms, faster than 16.21% of Python3 online submissions for Basic Calculator II.
Memory Usage: 20.1 MB, less than 5.55% of Python3 online submissions for Basic Calculator II.
"""
from typing import List
from typing import Optional
class Solution:
def calculate(self, s: str) -> int:
s = s.repl... | 30.985294 | 93 | 0.452302 |
261cb36ffd4219f6f299c0db0ddefcae270fde1b | 2,244 | py | Python | archived/archive-WSPS/input-checker/input_checker.py | XiaoxiongXie/WRF-SUEWS | 51f8d2359b394016e65121f3baab908b1ad4d89c | [
"MIT"
] | 2 | 2020-09-24T09:15:31.000Z | 2020-09-28T16:16:30.000Z | archived/archive-WSPS/input-checker/input_checker.py | XiaoxiongXie/WRF-SUEWS | 51f8d2359b394016e65121f3baab908b1ad4d89c | [
"MIT"
] | 3 | 2020-09-24T13:46:24.000Z | 2020-10-01T09:54:17.000Z | archived/archive-WSPS/input-checker/input_checker.py | XiaoxiongXie/WRF-SUEWS | 51f8d2359b394016e65121f3baab908b1ad4d89c | [
"MIT"
] | 2 | 2020-10-01T09:46:58.000Z | 2022-01-09T10:38:21.000Z | # %%
#import yaml
#yaml.warnings({'YAMLLoadWarning': False})
import xarray as xr
import numpy as np
import pandas as pd
import json
import glob
import os
# %%
# the check list file with ranges and logics
check_file = 'check_file_suews.json'
# opening the check list file
def open_check_file(check_file):
wit... | 23.375 | 87 | 0.60205 |
9d358430f00ecead9b8842c993c9f1dfce303c82 | 77 | py | Python | Contest/ABC017/a/main.py | mpses/AtCoder | 9c101fcc0a1394754fcf2385af54b05c30a5ae2a | [
"CC0-1.0"
] | null | null | null | Contest/ABC017/a/main.py | mpses/AtCoder | 9c101fcc0a1394754fcf2385af54b05c30a5ae2a | [
"CC0-1.0"
] | null | null | null | Contest/ABC017/a/main.py | mpses/AtCoder | 9c101fcc0a1394754fcf2385af54b05c30a5ae2a | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python3
print(eval("+eval(input().replace(' ','*'))"*3) // 10) | 38.5 | 54 | 0.571429 |
cf6d0c37bd9ca81dc3e1fff8d44fabdfd0a0e04a | 8,525 | py | Python | habitat_sim/agent/agent.py | BKAUTO/Trinocular-habitat-sim | 7ad70669095926cc4d5438befa65b019d0f91a8c | [
"MIT"
] | null | null | null | habitat_sim/agent/agent.py | BKAUTO/Trinocular-habitat-sim | 7ad70669095926cc4d5438befa65b019d0f91a8c | [
"MIT"
] | null | null | null | habitat_sim/agent/agent.py | BKAUTO/Trinocular-habitat-sim | 7ad70669095926cc4d5438befa65b019d0f91a8c | [
"MIT"
] | null | null | null | #!/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.
from typing import Any, Dict, List, Union
import attr
import numpy as np
import habitat_sim.bindings as hsim
import ha... | 33.431373 | 117 | 0.646452 |
487346778035cb20009d6ce8589677cd1a3a32c3 | 5,062 | py | Python | tests/ti_deps/deps/prev_dagrun_dep.py | rubeshdcube/incubator-airflow | 5419fbb78a2ea2388456c356d2f899ea1991b2de | [
"Apache-2.0"
] | 4 | 2017-06-25T14:09:31.000Z | 2020-11-20T09:51:24.000Z | tests/ti_deps/deps/prev_dagrun_dep.py | rubeshdcube/incubator-airflow | 5419fbb78a2ea2388456c356d2f899ea1991b2de | [
"Apache-2.0"
] | 1 | 2017-07-04T07:31:15.000Z | 2017-07-06T06:01:42.000Z | tests/ti_deps/deps/prev_dagrun_dep.py | rubeshdcube/incubator-airflow | 5419fbb78a2ea2388456c356d2f899ea1991b2de | [
"Apache-2.0"
] | 2 | 2018-04-09T15:13:50.000Z | 2019-06-14T07:19:46.000Z | # -*- coding: utf-8 -*-
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
... | 35.152778 | 88 | 0.627815 |
4880c7d3d760e270416605ea2eeb3e315262a7e1 | 871 | py | Python | plugins/execs.py | CPSLK/userbot | 7d3ddd03e6a780493732f83e8015cae6145008f9 | [
"MIT"
] | 1 | 2020-07-09T18:17:01.000Z | 2020-07-09T18:17:01.000Z | plugins/execs.py | CPSLK/userbot | 7d3ddd03e6a780493732f83e8015cae6145008f9 | [
"MIT"
] | null | null | null | plugins/execs.py | CPSLK/userbot | 7d3ddd03e6a780493732f83e8015cae6145008f9 | [
"MIT"
] | 1 | 2020-07-16T02:14:36.000Z | 2020-07-16T02:14:36.000Z | import io
import re
import html
import traceback
from contextlib import redirect_stdout
from pyrogram import Client, Filters
from config import cmds
@Client.on_message(Filters.command("exec", prefixes=".") & Filters.me)
async def execs(client, message):
strio = io.StringIO()
code = re.split(r"[\n ]+", messa... | 29.033333 | 99 | 0.649828 |
8f1e5504dad2e6b433415327a00fa088ad326115 | 6,583 | py | Python | frappe/event_streaming/doctype/document_type_mapping/document_type_mapping.py | Don-Leopardo/frappe | 39097b05a7a9904776a435ee2c3d7a579d429389 | [
"MIT"
] | 3,755 | 2015-01-06T07:47:43.000Z | 2022-03-31T20:54:23.000Z | frappe/event_streaming/doctype/document_type_mapping/document_type_mapping.py | Don-Leopardo/frappe | 39097b05a7a9904776a435ee2c3d7a579d429389 | [
"MIT"
] | 7,369 | 2015-01-01T19:59:41.000Z | 2022-03-31T23:02:05.000Z | frappe/event_streaming/doctype/document_type_mapping/document_type_mapping.py | Don-Leopardo/frappe | 39097b05a7a9904776a435ee2c3d7a579d429389 | [
"MIT"
] | 2,685 | 2015-01-07T17:51:03.000Z | 2022-03-31T23:16:24.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2019, Frappe Technologies and contributors
# License: MIT. See LICENSE
import frappe
import json
from frappe import _
from frappe.model.document import Document
from frappe.model import default_fields
class DocumentTypeMapping(Document):
def validate(self):
self.validate_inne... | 38.723529 | 136 | 0.745557 |
de8936834be2d4b2cffff2d2c096de83b1812b0f | 1,168 | py | Python | tests/test_image_to_boxes.py | amenezes/aiopytesseract | 9ed8bcebbea87c39b194934e0fa99cf26b328a3c | [
"Apache-2.0"
] | 2 | 2022-02-25T07:09:22.000Z | 2022-03-13T04:20:57.000Z | tests/test_image_to_boxes.py | amenezes/aiopytesseract | 9ed8bcebbea87c39b194934e0fa99cf26b328a3c | [
"Apache-2.0"
] | null | null | null | tests/test_image_to_boxes.py | amenezes/aiopytesseract | 9ed8bcebbea87c39b194934e0fa99cf26b328a3c | [
"Apache-2.0"
] | null | null | null | from pathlib import Path
import pytest
import aiopytesseract
from aiopytesseract.models import Box
from aiopytesseract.exceptions import TesseractRuntimeError
@pytest.mark.asyncio
@pytest.mark.parametrize("image", ["tests/samples/file-sample_150kB.png"])
async def test_image_to_boxes_with_str_image(image):
boxe... | 30.736842 | 82 | 0.78339 |
7a39fbd265fbc708c4a6cda41219da7f26dbe56f | 9,508 | py | Python | main.py | jackdevey/Govee-CLI | e7fd5818032a5d0640141210a1ccdd9b06c07ea1 | [
"WTFPL"
] | 2 | 2021-12-04T03:00:17.000Z | 2022-01-16T03:14:55.000Z | main.py | jackdevey/Govee-CLI | e7fd5818032a5d0640141210a1ccdd9b06c07ea1 | [
"WTFPL"
] | 1 | 2021-02-24T14:37:56.000Z | 2021-03-14T17:00:34.000Z | main.py | jackdevey/Govee-CLI | e7fd5818032a5d0640141210a1ccdd9b06c07ea1 | [
"WTFPL"
] | null | null | null | import os
import pathlib
import requests
import json
import click
import contextVars
__author__ = "jack-txt & HarryDev06"
@click.group()
@click.pass_context
def main(ctx):
"""
Govee API v1.1.0 by jack-txt & HarryDev06
THIS PRODUCT IS NOT AFFILIATED WITH GOVEE
"""
key = os.environ.get('GOVEE_K... | 33.013889 | 171 | 0.555217 |
de862c32cff0abe47d4d5365be49d76e13fccf04 | 2,834 | py | Python | augmentor/sl_intents_tool.py | samlet/stack | 47db17fd4fdab264032f224dca31a4bb1d19b754 | [
"Apache-2.0"
] | 3 | 2020-01-11T13:55:38.000Z | 2020-08-25T22:34:15.000Z | augmentor/sl_intents_tool.py | samlet/stack | 47db17fd4fdab264032f224dca31a4bb1d19b754 | [
"Apache-2.0"
] | null | null | null | augmentor/sl_intents_tool.py | samlet/stack | 47db17fd4fdab264032f224dca31a4bb1d19b754 | [
"Apache-2.0"
] | 1 | 2021-01-01T05:21:44.000Z | 2021-01-01T05:21:44.000Z | import streamlit as st
from interacts.common import display_lang_selector
from interacts.sl_utils import all_labels, write_styles
from interacts.tracker_streamlit import enable_streamlit_tracker
from sagas.nlu.utils import fix_sents
enable_streamlit_tracker()
write_styles()
def sidebar():
cur_lang=display_lang_s... | 34.987654 | 102 | 0.627735 |
c95f070a99b12c02aac6d14a3fade1526cd9a58e | 1,005 | py | Python | apps/profiles/forms.py | ecognize-hub/ecognize | e448098d7c5e815c68a7650b14b31d23976a8900 | [
"Apache-2.0"
] | 1 | 2021-04-17T12:53:34.000Z | 2021-04-17T12:53:34.000Z | apps/profiles/forms.py | ecognize-hub/ecognize | e448098d7c5e815c68a7650b14b31d23976a8900 | [
"Apache-2.0"
] | null | null | null | apps/profiles/forms.py | ecognize-hub/ecognize | e448098d7c5e815c68a7650b14b31d23976a8900 | [
"Apache-2.0"
] | null | null | null | from django import forms
from crispy_forms.helper import FormHelper
from .models import UserCreatedGroup, UserProfile
from django.urls import reverse
class CreateNewGroupForm(forms.ModelForm):
class Meta:
model = UserCreatedGroup
fields = ['display_name', 'visible', 'logo', 'join_mode']
def _... | 32.419355 | 66 | 0.672637 |
b359f0dc2af009bdedb25781fd48d355169a03d0 | 1,263 | py | Python | corehq/apps/cachehq/tests.py | johan--/commcare-hq | 86ee99c54f55ee94e4c8f2f6f30fc44e10e69ebd | [
"BSD-3-Clause"
] | null | null | null | corehq/apps/cachehq/tests.py | johan--/commcare-hq | 86ee99c54f55ee94e4c8f2f6f30fc44e10e69ebd | [
"BSD-3-Clause"
] | 1 | 2022-03-12T01:03:25.000Z | 2022-03-12T01:03:25.000Z | corehq/apps/cachehq/tests.py | johan--/commcare-hq | 86ee99c54f55ee94e4c8f2f6f30fc44e10e69ebd | [
"BSD-3-Clause"
] | null | null | null | from copy import deepcopy
from mock import patch
from django.test import SimpleTestCase
from corehq.apps.cachehq.mixins import CachedCouchDocumentMixin
from dimagi.ext.jsonobject import JsonObject, StringProperty
class Super(JsonObject):
@classmethod
def get(cls, *args, **kwargs):
pass
def save(s... | 30.804878 | 74 | 0.688044 |
a3c8d1cdad61c28d1c9d67e52723b8ce54101cb8 | 8,255 | py | Python | python/ray/air/train/integrations/tensorflow/tensorflow_trainer.py | orcahmlee/ray | 298742d7241681ee1f307ec0dd3cd7e9713a3c7d | [
"Apache-2.0"
] | null | null | null | python/ray/air/train/integrations/tensorflow/tensorflow_trainer.py | orcahmlee/ray | 298742d7241681ee1f307ec0dd3cd7e9713a3c7d | [
"Apache-2.0"
] | 41 | 2021-09-21T01:13:48.000Z | 2022-03-19T07:12:22.000Z | python/ray/air/train/integrations/tensorflow/tensorflow_trainer.py | LaudateCorpus1/ray | 20cf2edfef7103c269358a49a48c2159315ee132 | [
"Apache-2.0"
] | null | null | null | from typing import Callable, Optional, Dict, Tuple, Type, Union
import tensorflow as tf
from ray.train.tensorflow import TensorflowConfig
from ray.air.trainer import GenDataset
from ray.air.train.data_parallel_trainer import DataParallelTrainer, _load_checkpoint
from ray.air.config import ScalingConfig, RunConfig, Dat... | 39.309524 | 87 | 0.644094 |
64149d1d8564de5dfecd205e63eb014aa23c352b | 7,178 | py | Python | gateapi-python/gate_api/models/multi_chain_address_item.py | jarenmt/IEOPUMP | 220f7f612d299f7305e82fe6c33661e6871f2d86 | [
"MIT"
] | null | null | null | gateapi-python/gate_api/models/multi_chain_address_item.py | jarenmt/IEOPUMP | 220f7f612d299f7305e82fe6c33661e6871f2d86 | [
"MIT"
] | null | null | null | gateapi-python/gate_api/models/multi_chain_address_item.py | jarenmt/IEOPUMP | 220f7f612d299f7305e82fe6c33661e6871f2d86 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Gate API v4
Welcome to Gate.io API APIv4 provides spot, margin and futures trading operations. There are public APIs to retrieve the real-time market statistics, and private APIs which needs authentication to trade on user's behalf. # noqa: E501
Contact: support@mail.gate.io
Gen... | 29.661157 | 239 | 0.602257 |
d90aea1870c68692fe64741cd0f792932adae3ce | 484 | py | Python | source/core/migrations/0001_initial.py | pedroaraujocaldeira/reconhecimento-image | 2e45237abd1a44907af6aec3666a37f741fd0e82 | [
"MIT"
] | null | null | null | source/core/migrations/0001_initial.py | pedroaraujocaldeira/reconhecimento-image | 2e45237abd1a44907af6aec3666a37f741fd0e82 | [
"MIT"
] | 13 | 2020-06-01T04:33:22.000Z | 2022-03-12T00:32:38.000Z | source/core/migrations/0001_initial.py | pedroaraujocaldeira/reconhecimento-image | 2e45237abd1a44907af6aec3666a37f741fd0e82 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.3 on 2018-11-10 11:27
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Image',
fields=[
('id', models.AutoField(au... | 22 | 114 | 0.568182 |
0a156d7cf8e7849d836aab337c6da816ed13483b | 791 | py | Python | src/scancode/lockfile.py | s4-2/scancode-toolkit | 8931b42e2630b94d0cabc834dfb3c16f01f82321 | [
"Apache-2.0",
"CC-BY-4.0"
] | 1,511 | 2015-07-01T15:29:03.000Z | 2022-03-30T13:40:05.000Z | src/scancode/lockfile.py | s4-2/scancode-toolkit | 8931b42e2630b94d0cabc834dfb3c16f01f82321 | [
"Apache-2.0",
"CC-BY-4.0"
] | 2,695 | 2015-07-01T16:01:35.000Z | 2022-03-31T19:17:44.000Z | src/scancode/lockfile.py | s4-2/scancode-toolkit | 8931b42e2630b94d0cabc834dfb3c16f01f82321 | [
"Apache-2.0",
"CC-BY-4.0"
] | 540 | 2015-07-01T15:08:19.000Z | 2022-03-31T12:13:11.000Z | #
# Copyright (c) nexB Inc. and others. All rights reserved.
# ScanCode is a trademark of nexB Inc.
# SPDX-License-Identifier: Apache-2.0
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text.
# See https://github.com/nexB/scancode-toolkit for support or download.
# See https://aboutcode.org for more in... | 23.264706 | 73 | 0.69153 |
031bdcb44aabc50f0a0c1a5e81ebad68e0ade9e8 | 11,602 | py | Python | dejavu/database_sql.py | yimikai/dejavu | 7f53f2ab6896b38cfd54cc396e2326a98b957d07 | [
"MIT"
] | 4 | 2017-06-17T02:08:28.000Z | 2020-11-25T04:46:56.000Z | dejavu/database_sql.py | kibichii-icode/dejavu | 7f53f2ab6896b38cfd54cc396e2326a98b957d07 | [
"MIT"
] | 7 | 2020-02-12T03:00:42.000Z | 2021-06-10T21:43:13.000Z | dejavu/database_sql.py | kibichii-icode/dejavu | 7f53f2ab6896b38cfd54cc396e2326a98b957d07 | [
"MIT"
] | 2 | 2019-09-02T04:28:32.000Z | 2021-05-04T10:25:21.000Z | from __future__ import absolute_import
from itertools import izip_longest
import Queue
import MySQLdb as mysql
from MySQLdb.cursors import DictCursor
from dejavu.database import Database
class SQLDatabase(Database):
"""
Queries:
1) Find duplicates (shouldn't be any, though):
select `hash`, `so... | 31.02139 | 128 | 0.603172 |
24b54349b1b8fd4fb38bbc59997e291ad1a480fc | 14,209 | py | Python | utils/dataset/beam_dataset.py | airbert-vln/airbert | a4f667db9fb4021094c738dd8d23739aee3785a5 | [
"MIT"
] | 17 | 2021-07-30T14:08:24.000Z | 2022-03-30T13:57:02.000Z | utils/dataset/beam_dataset.py | airbert-vln/airbert | a4f667db9fb4021094c738dd8d23739aee3785a5 | [
"MIT"
] | 4 | 2021-09-09T03:02:18.000Z | 2022-03-24T13:55:55.000Z | utils/dataset/beam_dataset.py | airbert-vln/airbert | a4f667db9fb4021094c738dd8d23739aee3785a5 | [
"MIT"
] | 2 | 2021-08-30T11:51:16.000Z | 2021-09-03T09:18:50.000Z | # pylint: disable=no-member, not-callable
import logging
import os
import itertools
import random
import copy
from typing import List, Iterator, TypeVar, Union, Tuple
import numpy as np
import torch
from transformers import BertTokenizer
from torch.utils.data import Dataset
from utils.dataset.common import (
get_h... | 36.810881 | 88 | 0.596946 |
0ef7b60cb4307d6344c62a2d00af2050e23af348 | 16,009 | py | Python | tasks/models/resnet_evonorm.py | epfml/relaysgd | 536f809f2a5fed5f5004b3f49857d67462ac89d2 | [
"MIT"
] | 3 | 2021-10-31T21:00:36.000Z | 2022-03-03T13:04:16.000Z | tasks/models/resnet_evonorm.py | epfml/relaysgd | 536f809f2a5fed5f5004b3f49857d67462ac89d2 | [
"MIT"
] | null | null | null | tasks/models/resnet_evonorm.py | epfml/relaysgd | 536f809f2a5fed5f5004b3f49857d67462ac89d2 | [
"MIT"
] | 2 | 2022-02-19T05:25:09.000Z | 2022-03-17T15:41:14.000Z | # -*- coding: utf-8 -*-
import math
import functools
from collections import OrderedDict
import torch
import torch.nn as nn
__all__ = ["resnet_evonorm"]
class SwishImplementation(torch.autograd.Function):
@staticmethod
def forward(ctx, i):
ctx.save_for_backward(i)
return i * torch.sigmoid(i... | 30.609943 | 90 | 0.528515 |
3292c7643b2e5ba0db38f609812c657ef2affecb | 1,657 | py | Python | b88d80170_fake_data/generate.py | archfiery/fake-data | 44833995ca2e4410d25a6f354c8d6ddec199040d | [
"Apache-2.0"
] | null | null | null | b88d80170_fake_data/generate.py | archfiery/fake-data | 44833995ca2e4410d25a6f354c8d6ddec199040d | [
"Apache-2.0"
] | null | null | null | b88d80170_fake_data/generate.py | archfiery/fake-data | 44833995ca2e4410d25a6f354c8d6ddec199040d | [
"Apache-2.0"
] | null | null | null | from .address import *
from .company import *
from .personal_data import *
from .name import first_name
"""
The amount of information we capture is small, but will be enlarged through iterations
Generate numP number of people, and
numC number of companies
Each person is associated with a company, via different rela... | 23.671429 | 86 | 0.617381 |
9ee82b3bf90650f686fef3d3072123293c838955 | 1,340 | py | Python | src/repovisor/__main__.py | gjcooper/repovisor | 22d1861fda8a86f47cd5ff1f286b39c30a218f53 | [
"BSD-3-Clause"
] | 2 | 2020-12-17T00:10:56.000Z | 2022-03-24T06:09:51.000Z | src/repovisor/__main__.py | gjcooper/repovisor | 22d1861fda8a86f47cd5ff1f286b39c30a218f53 | [
"BSD-3-Clause"
] | 3 | 2017-11-15T22:57:34.000Z | 2019-07-03T00:59:08.000Z | src/repovisor/__main__.py | gjcooper/repovisor | 22d1861fda8a86f47cd5ff1f286b39c30a218f53 | [
"BSD-3-Clause"
] | null | null | null | from repovisor import repovisor as rv
import click
@click.group()
@click.version_option()
def main():
pass
@main.command(name='search')
@click.argument('folders', nargs=-1, type=click.Path(exists=True, file_okay=False, resolve_path=True))
@click.option('--brief', '-b', is_flag=True, help='Use the short form of ... | 44.666667 | 126 | 0.664925 |
49a805b46937a2becd3fa903497f431c0f9d0315 | 5,676 | py | Python | src/m9_using_objects.py | harperis/03-AccumulatorsAndFunctionsWithParameters | b7103344f95fcf20ca0ce78418ab1cee0597dd1a | [
"MIT"
] | null | null | null | src/m9_using_objects.py | harperis/03-AccumulatorsAndFunctionsWithParameters | b7103344f95fcf20ca0ce78418ab1cee0597dd1a | [
"MIT"
] | null | null | null | src/m9_using_objects.py | harperis/03-AccumulatorsAndFunctionsWithParameters | b7103344f95fcf20ca0ce78418ab1cee0597dd1a | [
"MIT"
] | null | null | null | """
This module lets you practice ** using objects **, including:
-- CONSTRUCTING objects,
-- applying METHODS to them, and
-- accessing their DATA via INSTANCE VARIABLES
Authors: David Mutchler, Dave Fisher, Vibha Alangar, Mark Hays, Amanda Stouder,
their colleagues and Isaac Harper.
""" # Done: 1. P... | 31.88764 | 79 | 0.570296 |
181a765b950c68044e014a8b6a685b04ff383012 | 2,661 | py | Python | nmigen/back/verilog.py | davidlattimore/nmigen | 8fe319f065807f421b092e7ffb8b90748512bf8c | [
"BSD-2-Clause"
] | 1 | 2022-02-21T16:04:10.000Z | 2022-02-21T16:04:10.000Z | nmigen/back/verilog.py | davidlattimore/nmigen | 8fe319f065807f421b092e7ffb8b90748512bf8c | [
"BSD-2-Clause"
] | 5 | 2021-03-19T00:08:54.000Z | 2021-10-02T15:02:28.000Z | nmigen/back/verilog.py | davidlattimore/nmigen | 8fe319f065807f421b092e7ffb8b90748512bf8c | [
"BSD-2-Clause"
] | null | null | null | from .._toolchain.yosys import *
from . import rtlil
__all__ = ["YosysError", "convert", "convert_fragment"]
def _convert_rtlil_text(rtlil_text, *, strip_internal_attrs=False, write_verilog_opts=()):
# this version requirement needs to be synchronized with the one in setup.py!
yosys = find_yosys(lambda ver:... | 42.919355 | 99 | 0.682074 |
e39c818c2a4c0655d637396a59f2761ecfd88c0e | 1,026 | py | Python | 200-299/210-219/219.py | dcragusa/LeetCode | 01c30de0832b378a1b054d80d1ea1d3f09a2abd3 | [
"MIT"
] | null | null | null | 200-299/210-219/219.py | dcragusa/LeetCode | 01c30de0832b378a1b054d80d1ea1d3f09a2abd3 | [
"MIT"
] | null | null | null | 200-299/210-219/219.py | dcragusa/LeetCode | 01c30de0832b378a1b054d80d1ea1d3f09a2abd3 | [
"MIT"
] | null | null | null | """
Given an integer array nums and an integer k, return true if there are two distinct indices i and j in the array such
that nums[i] == nums[j] and abs(i - j) <= k.
Example 1:
Input: nums = [1, 2, 3, 1], k = 3, Output: True
Example 2:
Input: nums = [1, 0, 1, 1], k = 1, Output: True
Example 3:
Input: nums = [1, 2... | 31.090909 | 117 | 0.658869 |
ad2804250b7d6713c9fb127c83cc7f601a78cbad | 192 | py | Python | src/compas_ui/rhino/ui/COMPAS/dev/COMPAS__saveas_cmd.py | BlockResearchGroup/compas_ui | 8b5a6121eee837d306bf20c44c91f94a5c185f90 | [
"MIT"
] | null | null | null | src/compas_ui/rhino/ui/COMPAS/dev/COMPAS__saveas_cmd.py | BlockResearchGroup/compas_ui | 8b5a6121eee837d306bf20c44c91f94a5c185f90 | [
"MIT"
] | 3 | 2022-02-24T17:56:30.000Z | 2022-03-31T09:48:40.000Z | src/compas_ui/rhino/ui/COMPAS/dev/COMPAS__saveas_cmd.py | BlockResearchGroup/compas_ui | 8b5a6121eee837d306bf20c44c91f94a5c185f90 | [
"MIT"
] | null | null | null | from compas_ui.ui import UI
__commandname__ = "COMPAS__saveas"
@UI.error()
def RunCommand(is_interactive):
ui = UI()
ui.saveas()
if __name__ == "__main__":
RunCommand(True)
| 12 | 34 | 0.677083 |
21494b241feb1066318a4c3a63733ebe946e4b39 | 1,699 | py | Python | 01_gen_data.py | babarosa08/BaiduXJ | b060d165b9dd36fd2a70b279b68d18e77fe1f8ec | [
"MIT"
] | 1 | 2018-06-14T04:00:03.000Z | 2018-06-14T04:00:03.000Z | 01_gen_data.py | babarosa08/BaiduXJ | b060d165b9dd36fd2a70b279b68d18e77fe1f8ec | [
"MIT"
] | null | null | null | 01_gen_data.py | babarosa08/BaiduXJ | b060d165b9dd36fd2a70b279b68d18e77fe1f8ec | [
"MIT"
] | null | null | null | import os
import shutil
import sys
DATA_PATH = '/home/huligang/workspace/BaiDuXJD2018/data'
TRAIN_PATH = '/home/huligang/workspace/BaiDuXJD2018/data/train/'
VAL_PATH = '/home/huligang/workspace/BaiDuXJD2018/data/val/'
TEST_PATH = '/home/huligang/workspace/BaiDuXJD2018/data/test'
TRAIN_FILE = '/home/huligang/workspace... | 28.79661 | 79 | 0.675103 |
ee7056fe7a08e4224934ad0836e42cdb48795a8e | 9,338 | py | Python | script/old/vartsv_table-0.0.1.py | genepii/seqmet | 89fdab79131c861d4a5aae364ecdbeb3a9e0ae23 | [
"MIT"
] | null | null | null | script/old/vartsv_table-0.0.1.py | genepii/seqmet | 89fdab79131c861d4a5aae364ecdbeb3a9e0ae23 | [
"MIT"
] | null | null | null | script/old/vartsv_table-0.0.1.py | genepii/seqmet | 89fdab79131c861d4a5aae364ecdbeb3a9e0ae23 | [
"MIT"
] | null | null | null | import os
import sys
import getopt
import math
import copy
def main(argv):
global tsv
global ref
global bed
global oup
global datatype
tsv = ''
ref = ''
bed = ''
oup = ''
datatype = 'norm'
try:
opts, args = getopt.getopt(argv, 'ht:r:b:o:d:', ['--help', '--tsv', '--re... | 42.834862 | 344 | 0.514136 |
944ee02af1746c07ed2f0fa891fdf9a0b6453cd7 | 3,877 | py | Python | examples/admin/set_password.py | syaiful6/aerospike-client-python | 59fa0d36aa899a164282643fe49b27d12aaf323f | [
"Apache-2.0"
] | 105 | 2015-01-07T09:51:13.000Z | 2022-03-24T04:23:54.000Z | examples/admin/set_password.py | syaiful6/aerospike-client-python | 59fa0d36aa899a164282643fe49b27d12aaf323f | [
"Apache-2.0"
] | 180 | 2015-01-01T19:29:50.000Z | 2022-03-19T14:14:06.000Z | examples/admin/set_password.py | syaiful6/aerospike-client-python | 59fa0d36aa899a164282643fe49b27d12aaf323f | [
"Apache-2.0"
] | 94 | 2015-01-21T19:17:48.000Z | 2022-01-31T07:17:47.000Z | # -*- coding: utf-8 -*-
################################################################################
# Copyright 2013-2021 Aerospike, 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
... | 32.041322 | 89 | 0.446737 |
cd4fb0bad8846091c96ee09ba6e362b0bcbb3276 | 12 | py | Python | projects/mako/test.py | fleimgruber/python | 2e735762c73651cffc027ca850b2a58d87d54b49 | [
"Unlicense"
] | 25 | 2021-10-30T19:54:59.000Z | 2022-03-29T06:11:02.000Z | projects/mako/test.py | fleimgruber/python | 2e735762c73651cffc027ca850b2a58d87d54b49 | [
"Unlicense"
] | 21 | 2021-10-19T01:09:38.000Z | 2022-03-24T16:08:53.000Z | projects/mako/test.py | fleimgruber/python | 2e735762c73651cffc027ca850b2a58d87d54b49 | [
"Unlicense"
] | 3 | 2022-01-25T20:25:13.000Z | 2022-03-08T02:58:50.000Z | import mako
| 6 | 11 | 0.833333 |
694afc6bd0008541f5cf1afdac8fb90c75209b2c | 1,959 | py | Python | cf_xarray/tests/__init__.py | ocefpaf/cf-xarray | 7bdb033395c8959a5d8147fe148ec987c1122387 | [
"Apache-2.0"
] | 91 | 2020-06-01T16:24:17.000Z | 2022-03-30T23:17:45.000Z | cf_xarray/tests/__init__.py | ocefpaf/cf-xarray | 7bdb033395c8959a5d8147fe148ec987c1122387 | [
"Apache-2.0"
] | 245 | 2020-06-01T16:16:48.000Z | 2022-03-31T14:15:59.000Z | cf_xarray/tests/__init__.py | ocefpaf/cf-xarray | 7bdb033395c8959a5d8147fe148ec987c1122387 | [
"Apache-2.0"
] | 29 | 2020-06-01T15:57:27.000Z | 2022-01-19T16:44:14.000Z | import importlib
import re
from contextlib import contextmanager
from distutils import version
import dask
import pytest
@contextmanager
def raises_regex(error, pattern):
__tracebackhide__ = True
with pytest.raises(error) as excinfo:
yield
message = str(excinfo.value)
if not re.search(pattern... | 28.808824 | 76 | 0.677897 |
fb4509267fb994db2e7ad09aa12a9ac7a647e6e4 | 1,151 | py | Python | gui/component/navigation_bar.py | acc-cosc-1336/cosc-1336-fall-2017-RobScaley | 44c807ac95a6348f5643941d745b9232a127610e | [
"MIT"
] | null | null | null | gui/component/navigation_bar.py | acc-cosc-1336/cosc-1336-fall-2017-RobScaley | 44c807ac95a6348f5643941d745b9232a127610e | [
"MIT"
] | null | null | null | gui/component/navigation_bar.py | acc-cosc-1336/cosc-1336-fall-2017-RobScaley | 44c807ac95a6348f5643941d745b9232a127610e | [
"MIT"
] | null | null | null | from tkinter import LEFT
from tkinter.ttk import Frame, Button
class NavigationBar(Frame):
def __init__(self, parent, data_source):
Frame.__init__(self, parent)
self.data_source = data_source
self.init_form()
def init_form(self):
nextButton = Button(self, text="Ne... | 31.972222 | 87 | 0.629018 |
c60b1a37bc6cd21450aa86672bd743b8fd1b0747 | 18,363 | py | Python | qa/rpc-tests/test_framework/comptool.py | mirzaei-ce/core-rezabit | 39c65eab32ca33a498c440556860163731a79195 | [
"MIT"
] | null | null | null | qa/rpc-tests/test_framework/comptool.py | mirzaei-ce/core-rezabit | 39c65eab32ca33a498c440556860163731a79195 | [
"MIT"
] | null | null | null | qa/rpc-tests/test_framework/comptool.py | mirzaei-ce/core-rezabit | 39c65eab32ca33a498c440556860163731a79195 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
#
# Distributed under the MIT/X11 software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
from mininode import *
from blockstore import BlockStore, TxStore
from util import p2p_port
'''
This is a tool for comparing two or more rezabitds to ... | 44.035971 | 145 | 0.602461 |
e55894eb9b946d49b32faf653e07bece54394cb9 | 239,821 | py | Python | imgaug/augmenters/geometric.py | fmder/imgaug | 4c81c7a7503b64f54d76144385ea4330fd7c8a84 | [
"MIT"
] | null | null | null | imgaug/augmenters/geometric.py | fmder/imgaug | 4c81c7a7503b64f54d76144385ea4330fd7c8a84 | [
"MIT"
] | null | null | null | imgaug/augmenters/geometric.py | fmder/imgaug | 4c81c7a7503b64f54d76144385ea4330fd7c8a84 | [
"MIT"
] | null | null | null | """Augmenters that apply affine or similar transformations.
List of augmenters:
* :class:`Affine`
* :class:`ScaleX`
* :class:`ScaleY`
* :class:`TranslateX`
* :class:`TranslateY`
* :class:`Rotate`
* :class:`ShearX`
* :class:`ShearY`
* :class:`AffineCv2`
* :class:`PiecewiseAffine... | 41.758837 | 223 | 0.579795 |
ef6912f36ffa9956d1263aff3fce019a653d1916 | 1,686 | py | Python | visualization_process/embedded_visualization.py | imdreamer2018/privacy-preserving-for-face-recognition | be7dde549c7a168085d89b17635ad8bdd375e04b | [
"MIT"
] | 9 | 2020-07-28T19:59:46.000Z | 2021-12-16T07:14:12.000Z | visualization_process/embedded_visualization.py | imdreamer2018/privacy-preserving-for-face-recognition | be7dde549c7a168085d89b17635ad8bdd375e04b | [
"MIT"
] | 10 | 2020-05-17T06:23:39.000Z | 2022-02-10T01:53:06.000Z | visualization_process/embedded_visualization.py | imdreamer2018/privacy-preserving-for-face-recognition | be7dde549c7a168085d89b17635ad8bdd375e04b | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
from sklearn.manifold import TSNE
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.cm as cm
# load embedded
embedded = np.load('../face_embedded_data/paper/embedded_nn4_lfw_10.npy')
# load customDataset
metadata = np.load('../face_embedded_data/paper/metadat... | 31.811321 | 99 | 0.668446 |
dd652ada96d9b41ba839df9e3b936e0ca54de346 | 1,875 | py | Python | scanALSpySC_MFedit/example_hdf5.py | MFraund/PyALS_BL11_DAQGUI | 88c923ebc31d68e653b49cea2c265f52221c9e95 | [
"MIT"
] | 1 | 2022-03-07T11:10:13.000Z | 2022-03-07T11:10:13.000Z | scanALSpySC_MFedit/example_hdf5.py | MFraund/PyALS_BL11_DAQGUI | 88c923ebc31d68e653b49cea2c265f52221c9e95 | [
"MIT"
] | null | null | null | scanALSpySC_MFedit/example_hdf5.py | MFraund/PyALS_BL11_DAQGUI | 88c923ebc31d68e653b49cea2c265f52221c9e95 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@copyright: (C) 2020 Surface Concept GmbH
Test HDF5 streaming.
"""
OUTPUTFILEPATH = "testA.h5" # warning! this file is overwritten if it exists
def test_hdf5_streaming():
""" Performs 1 measurement and streams DLD events to a HDF5 file. """
import scTDC
device = scTDC.D... | 30.241935 | 78 | 0.650133 |
41f09dcbd83519b02b0dd6c9c2188c98fa990e42 | 43,242 | py | Python | bdOdonto/sistema_fichas/migrations/0001_initial.py | FACTOSolution/bdOdonto | e6cbbcef1faa8c77dc6e72b8888e5eaac8f046e2 | [
"MIT"
] | null | null | null | bdOdonto/sistema_fichas/migrations/0001_initial.py | FACTOSolution/bdOdonto | e6cbbcef1faa8c77dc6e72b8888e5eaac8f046e2 | [
"MIT"
] | null | null | null | bdOdonto/sistema_fichas/migrations/0001_initial.py | FACTOSolution/bdOdonto | e6cbbcef1faa8c77dc6e72b8888e5eaac8f046e2 | [
"MIT"
] | 1 | 2019-10-18T20:16:28.000Z | 2019-10-18T20:16:28.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-09-30 18:09
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migratio... | 77.494624 | 339 | 0.586212 |
fb7433f6d0e11b20f7798826091977669863151e | 2,832 | py | Python | gulpy/inputs/writer.py | learningmatter-mit/gulpy | a1894a40392fd9fa95cdee06b0253b340add8f49 | [
"MIT"
] | 1 | 2021-05-27T18:39:45.000Z | 2021-05-27T18:39:45.000Z | gulpy/inputs/writer.py | learningmatter-mit/gulpy | a1894a40392fd9fa95cdee06b0253b340add8f49 | [
"MIT"
] | null | null | null | gulpy/inputs/writer.py | learningmatter-mit/gulpy | a1894a40392fd9fa95cdee06b0253b340add8f49 | [
"MIT"
] | 1 | 2022-01-16T19:15:29.000Z | 2022-01-16T19:15:29.000Z | class FileWriter:
def __init__(self):
pass
def __repr__(self):
return self.__str__()
def __str__(self):
return f"<FileWriter base class>"
def write_file(self, filename):
with open(filename, "w") as f:
f.write(self.__str__())
class InputWriter(FileWriter):... | 28.606061 | 83 | 0.52613 |
505c493684d15d1bc58e108f11dc57fbf2ce8583 | 7,813 | py | Python | board/views.py | bluebamus/django_function_based_web_site | 5d3b453334110b6d49e5dbe09607df839bc5b649 | [
"MIT"
] | null | null | null | board/views.py | bluebamus/django_function_based_web_site | 5d3b453334110b6d49e5dbe09607df839bc5b649 | [
"MIT"
] | null | null | null | board/views.py | bluebamus/django_function_based_web_site | 5d3b453334110b6d49e5dbe09607df839bc5b649 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect, get_object_or_404
from django.urls import reverse
from django.views.decorators.http import require_POST
from django.core.paginator import Paginator
from django.http import Http404
from user.models import Usert
from tag.models import Tag
from .models import Board, Comment
f... | 33.388889 | 98 | 0.596826 |
075544f1815e04d3655877f2aaf0575a72b009c2 | 9,283 | py | Python | OpenCLGA/shuffler_chromosome.py | czarnobylu/OpenCLGA | c002b5177104db5bcdbb0192db25fbbb45516f27 | [
"MIT"
] | 112 | 2017-04-07T06:02:10.000Z | 2022-02-18T11:49:11.000Z | OpenCLGA/shuffler_chromosome.py | czarnobylu/OpenCLGA | c002b5177104db5bcdbb0192db25fbbb45516f27 | [
"MIT"
] | 25 | 2016-11-22T08:22:53.000Z | 2017-03-01T14:46:33.000Z | OpenCLGA/shuffler_chromosome.py | czarnobylu/OpenCLGA | c002b5177104db5bcdbb0192db25fbbb45516f27 | [
"MIT"
] | 34 | 2017-05-22T02:56:08.000Z | 2022-02-06T05:20:56.000Z | #!/usr/bin/python3
import numpy
import pyopencl as cl
from .simple_gene import SimpleGene
class ShufflerChromosome:
# ShufflerChromosome - a chromosome contains a list of Genes.
# __genes - an ordered list of Genes
# __name - name of the chromosome
# __improving_func - function name in kernel to guran... | 43.787736 | 94 | 0.537434 |
cc404a9b8472cd20e5a44ee64a650b35ba7bd0af | 2,297 | py | Python | datalad_neuroimaging/tests/test_aggregation.py | mih/datalad-neuroimaging | f83ba994a6b208c297501be3f18aeabb3da51e8b | [
"MIT"
] | null | null | null | datalad_neuroimaging/tests/test_aggregation.py | mih/datalad-neuroimaging | f83ba994a6b208c297501be3f18aeabb3da51e8b | [
"MIT"
] | null | null | null | datalad_neuroimaging/tests/test_aggregation.py | mih/datalad-neuroimaging | f83ba994a6b208c297501be3f18aeabb3da51e8b | [
"MIT"
] | null | null | null | # emacs: -*- mode: python-mode; py-indent-offset: 4; tab-width: 4; indent-tabs-mode: nil -*-
# -*- coding: utf-8 -*-
# ex: set sts=4 ts=4 sw=4 noet:
# ## ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the datalad package for the
# copyright and... | 38.932203 | 92 | 0.578581 |
fbae392cd679790bb480391e764f8dc74bcd1c3d | 14,909 | py | Python | DataExtractor.py | godfatherlmh/LoLAnalyzer | 0b265b33230316ab1a1459a9767ef7527a4a4f89 | [
"MIT"
] | null | null | null | DataExtractor.py | godfatherlmh/LoLAnalyzer | 0b265b33230316ab1a1459a9767ef7527a4a4f89 | [
"MIT"
] | null | null | null | DataExtractor.py | godfatherlmh/LoLAnalyzer | 0b265b33230316ab1a1459a9767ef7527a4a4f89 | [
"MIT"
] | null | null | null | # Extract the useful data from game files (json)
# Append the useful data to a csv file
import pickle
import os
import queue
import sys
from collections import OrderedDict
import multiprocessing
from multiprocessing.managers import BaseManager, NamespaceProxy
import time
import Modes
import pandas as pd
from collectio... | 40.958791 | 149 | 0.563284 |
1dd5dfdbaa47fa3805caac66e75ff94a042ded92 | 26,812 | py | Python | pennylane/fourier/visualize.py | MoritzWillmann/pennylane | 2b07d22cfcc6406ba28e5c647062340b240a4ee5 | [
"Apache-2.0"
] | 539 | 2018-11-13T08:45:42.000Z | 2020-07-27T18:17:16.000Z | pennylane/fourier/visualize.py | MoritzWillmann/pennylane | 2b07d22cfcc6406ba28e5c647062340b240a4ee5 | [
"Apache-2.0"
] | 588 | 2018-11-14T10:21:47.000Z | 2020-07-28T06:27:14.000Z | pennylane/fourier/visualize.py | MoritzWillmann/pennylane | 2b07d22cfcc6406ba28e5c647062340b240a4ee5 | [
"Apache-2.0"
] | 165 | 2018-11-13T18:58:56.000Z | 2020-07-27T17:18:17.000Z | # Copyright 2018-2021 Xanadu Quantum Technologies 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... | 37.033149 | 104 | 0.622184 |
380cf98e5945843fdfa2aa354b3f06c71f8a2460 | 7,028 | py | Python | model/evaluator.py | nikhilrayaprolu/LM-IT-DIL-CNN-CRF | 22f3e4d1b766447d1992ccb479dd17ec9e28811d | [
"Apache-2.0"
] | 1 | 2019-10-03T05:59:08.000Z | 2019-10-03T05:59:08.000Z | model/evaluator.py | nikhilrayaprolu/LM-IT-DIL-CNN-CRF | 22f3e4d1b766447d1992ccb479dd17ec9e28811d | [
"Apache-2.0"
] | null | null | null | model/evaluator.py | nikhilrayaprolu/LM-IT-DIL-CNN-CRF | 22f3e4d1b766447d1992ccb479dd17ec9e28811d | [
"Apache-2.0"
] | null | null | null | """
.. module:: evaluator
:synopsis: evaluation method (f1 score and accuracy)
.. moduleauthor:: Liyuan Liu, Frank Xu
"""
import torch
import numpy as np
import itertools
import model.utils as utils
from torch.autograd import Variable
from model.crf import CRFDecode_vb
class eval_batch:
"""Base class for... | 32.688372 | 144 | 0.609704 |
79040c03d6dad6d08291960465ba46fab0ba9ac7 | 1,634 | py | Python | venv/lib/python3.8/site-packages/vsts/build/v4_1/models/source_provider_attributes.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/vsts/build/v4_1/models/source_provider_attributes.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/vsts/build/v4_1/models/source_provider_attributes.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------------------------------------... | 48.058824 | 101 | 0.585679 |
40d0ce524357f045f6a05a4e8be18aa8d31a632f | 3,566 | py | Python | rl_algorithms/per/ddpg_agent.py | MrSyee/rl_algorithms | 5b5276982032f8a8a614b9466849b7b3ef245b3e | [
"MIT"
] | 1 | 2020-05-18T04:53:07.000Z | 2020-05-18T04:53:07.000Z | rl_algorithms/per/ddpg_agent.py | minseop4898/rl_algorithms | d56ea25a294e850f433b1120faebea3a0bfe0c54 | [
"MIT"
] | 2 | 2020-03-25T08:22:17.000Z | 2020-03-26T06:02:05.000Z | rl_algorithms/per/ddpg_agent.py | MrSyee/rl_algorithms | 5b5276982032f8a8a614b9466849b7b3ef245b3e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""DDPG agent with PER for episodic tasks in OpenAI Gym.
- Author: Kh Kim
- Contact: kh.kim@medipixel.io
- Paper: https://arxiv.org/pdf/1509.02971.pdf
https://arxiv.org/pdf/1511.05952.pdf
"""
from typing import Tuple
import torch
import torch.nn as nn
from rl_algorithms.common.buffe... | 37.93617 | 88 | 0.678351 |
2930ecbeb8b33c7c9df98a1314c28955891daff2 | 1,035 | py | Python | TextMessage.py | Vaishnavy080/Email-and-Text-Messages-Scheduler | 98fa0a50a34c2bed1fa3b84112e9a2bf668ade82 | [
"Apache-2.0"
] | null | null | null | TextMessage.py | Vaishnavy080/Email-and-Text-Messages-Scheduler | 98fa0a50a34c2bed1fa3b84112e9a2bf668ade82 | [
"Apache-2.0"
] | null | null | null | TextMessage.py | Vaishnavy080/Email-and-Text-Messages-Scheduler | 98fa0a50a34c2bed1fa3b84112e9a2bf668ade82 | [
"Apache-2.0"
] | null | null | null | import requests
import json
API_ENDPOINT = "https://api.sms-magic.com/v1/sms/send"
msg_delivery_status_url = 'https://api.sms-magic.com/v1/sms/status'
API_KEY = "54b197ee146649517b9e5b47172cd1ee"
# data to be sent to api
def send_sms_get(number,msg):
headers = {'apiKey': API_KEY}
send_sms_data = {'m... | 34.5 | 96 | 0.635749 |
0da6f7177a88e40f44a66a3573c87d916a3a75de | 5,500 | py | Python | configs/shareresnet/faster_rcnn_r50_fpn_1x_shareresnet_7s.py | ziming-liu/ObjectDet | 6e25fa784114b9773b052d9d5465aa6fed93468a | [
"Apache-2.0"
] | null | null | null | configs/shareresnet/faster_rcnn_r50_fpn_1x_shareresnet_7s.py | ziming-liu/ObjectDet | 6e25fa784114b9773b052d9d5465aa6fed93468a | [
"Apache-2.0"
] | null | null | null | configs/shareresnet/faster_rcnn_r50_fpn_1x_shareresnet_7s.py | ziming-liu/ObjectDet | 6e25fa784114b9773b052d9d5465aa6fed93468a | [
"Apache-2.0"
] | null | null | null | # model settings
model = dict(
type='FasterRCNN',
pretrained='modelzoo://resnet50',
backbone=dict(
type='shareResNet',
depth=50,
num_stages=7,
num_branch = 4,
strides=(1, 2, 2, 2,2 ,2,2),
dilations=(1, 1, 1, 1,1,1,1),
out_indices=(0, 1, 2, 3,4,5,6),
... | 30.726257 | 80 | 0.588727 |
5397677a22ba9fcc95ec2af2332d48402ca329d1 | 7,231 | py | Python | vision/object_detection/core/batcher_test.py | TeamAutonomousCarOffenburg/TACO_2018 | ebb63e466578fc3911269d4a714ebff0a516dbf6 | [
"BSD-3-Clause"
] | 1 | 2019-09-11T23:06:25.000Z | 2019-09-11T23:06:25.000Z | vision/object_detection/core/batcher_test.py | TeamAutonomousCarOffenburg/TACO_2018 | ebb63e466578fc3911269d4a714ebff0a516dbf6 | [
"BSD-3-Clause"
] | null | null | null | vision/object_detection/core/batcher_test.py | TeamAutonomousCarOffenburg/TACO_2018 | ebb63e466578fc3911269d4a714ebff0a516dbf6 | [
"BSD-3-Clause"
] | 1 | 2019-04-08T09:52:24.000Z | 2019-04-08T09:52:24.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 42.786982 | 80 | 0.514313 |
d651685d324465ead219c6ddfb3033bdc8f60b00 | 8,159 | py | Python | {{cookiecutter.project_name}}/manager/cli.py | pratik-shivarkar/fastapi-boilerplate | 5885e538b391ff8e4b5d53d966f5cfa16acb39fc | [
"MIT"
] | 1 | 2021-09-21T17:54:17.000Z | 2021-09-21T17:54:17.000Z | {{cookiecutter.project_name}}/manager/cli.py | pratik-shivarkar/fastapi-cookiecutter | 5885e538b391ff8e4b5d53d966f5cfa16acb39fc | [
"MIT"
] | null | null | null | {{cookiecutter.project_name}}/manager/cli.py | pratik-shivarkar/fastapi-cookiecutter | 5885e538b391ff8e4b5d53d966f5cfa16acb39fc | [
"MIT"
] | null | null | null | import os
import sys
import click
from datetime import date
from urllib.parse import urlparse
from sqlalchemy.orm import Session
from hypercorn.asyncio import serve
from hypercorn.config import Config
from sqlalchemy import create_engine, sql
from dotenv import load_dotenv, find_dotenv
load_dotenv(find_dotenv())
from... | 35.942731 | 123 | 0.638926 |
5f3a12799004ca1cd8f29cf251fbd12ac6f307fa | 50,519 | py | Python | rmgpy/test_data/testing_database/kinetics/libraries/GRI-Mech3.0/reactions.py | keceli/RMG-Py | 17c7870195a4feb6e8bf8974292f9bcdca1a1d9d | [
"MIT"
] | 7 | 2017-10-04T16:04:14.000Z | 2021-03-27T21:54:41.000Z | rmgpy/test_data/testing_database/kinetics/libraries/GRI-Mech3.0/reactions.py | speth/RMG-Py | 1d2c2b684580396e984459d9347628a5ceb80e2e | [
"MIT"
] | 72 | 2016-06-06T18:18:49.000Z | 2019-11-17T03:21:10.000Z | rmgpy/test_data/testing_database/kinetics/libraries/GRI-Mech3.0/reactions.py | speth/RMG-Py | 1d2c2b684580396e984459d9347628a5ceb80e2e | [
"MIT"
] | 6 | 2017-10-04T15:37:05.000Z | 2021-12-29T06:50:16.000Z | #!/usr/bin/env python
# encoding: utf-8
name = "GRI-Mech3.0"
shortDesc = u"Natural Gas Combustion Mechanism (without NOx chemistry)"
longDesc = u"""
The thermodynamic and kinetic parameters in the GRI-Mech 3.0 mechanism have
been collectively estimated from literature search and then optimized to a set
of representa... | 25.096374 | 116 | 0.433045 |
0dc80f833349f7bba5975586cdf2be2820142c90 | 21,049 | py | Python | storage/fase2/team15/storage/isam/InterfazBD.py | Josue-Zea/tytus | f9e4be9a8c03eb698fade7a748972e4f52d46685 | [
"MIT"
] | 35 | 2020-12-07T03:11:43.000Z | 2021-04-15T17:38:16.000Z | storage/fase2/team15/storage/isam/InterfazBD.py | Josue-Zea/tytus | f9e4be9a8c03eb698fade7a748972e4f52d46685 | [
"MIT"
] | 47 | 2020-12-09T01:29:09.000Z | 2021-01-13T05:37:50.000Z | storage/fase2/team15/storage/isam/InterfazBD.py | Josue-Zea/tytus | f9e4be9a8c03eb698fade7a748972e4f52d46685 | [
"MIT"
] | 556 | 2020-12-07T03:13:31.000Z | 2021-06-17T17:41:10.000Z | from tkinter import *
from tkinter import messagebox
from tkinter import simpledialog
from tkinter import ttk
import json
from . import Table
from tkinter import filedialog
from . import ISAMMode as Storage
from .DataBase import DataBase
from .Table import Table
import os
import pickle
#--------------------------------... | 46.67184 | 199 | 0.612286 |
4c18f6c8e916e7975cb39cfccff154bbab143fb4 | 12,396 | py | Python | impacket/dcerpc/v5/even.py | iamjmat/impacket | 61da73fcc793259e6d1487fff9835e638487fe04 | [
"Apache-1.1"
] | 61 | 2020-07-23T14:07:59.000Z | 2021-11-24T14:15:57.000Z | impacket/dcerpc/v5/even.py | 3ozir/impacket | d1ced941eb2235ed365b13f661b1d5b4bc2683f3 | [
"Apache-1.1"
] | null | null | null | impacket/dcerpc/v5/even.py | 3ozir/impacket | d1ced941eb2235ed365b13f661b1d5b4bc2683f3 | [
"Apache-1.1"
] | 21 | 2021-06-29T23:14:54.000Z | 2022-03-24T13:13:58.000Z | # SECUREAUTH LABS. Copyright 2018 SecureAuth Corporation. All rights reserved.
#
# This software is provided under under a slightly modified version
# of the Apache Software License. See the accompanying LICENSE file
# for more information.
#
# Author: Alberto Solino (@agsolino)
# Itamar Mizrahi (@MrAnde7son)
#... | 30.912718 | 149 | 0.605679 |
dec616c19128d689d72a89eab2cc6c3dd0a8b163 | 4,133 | py | Python | src/common/admin.py | danpercic86/e-notary | ba15a9a80e2091593fb088feacfaf9574c816d6e | [
"Apache-2.0"
] | null | null | null | src/common/admin.py | danpercic86/e-notary | ba15a9a80e2091593fb088feacfaf9574c816d6e | [
"Apache-2.0"
] | null | null | null | src/common/admin.py | danpercic86/e-notary | ba15a9a80e2091593fb088feacfaf9574c816d6e | [
"Apache-2.0"
] | null | null | null | import os.path
from typing import Tuple, Dict
import pandas
from django.conf import settings
from django.contrib.admin import ModelAdmin, register
from django.forms import ModelForm, FileField, FileInput
from django.shortcuts import redirect
from faker import Faker
from common.models import Example, Client, IdUpload,... | 29.312057 | 83 | 0.574401 |
d32eadff7a7392d9e1a74357342aab26728337e0 | 2,994 | py | Python | ext/djangojinja2.py | captainmalloc/jinja | 540b260198285f0ed41fbe80c0b1b6f13be579c1 | [
"BSD-3-Clause"
] | 1 | 2020-07-06T05:53:18.000Z | 2020-07-06T05:53:18.000Z | ext/djangojinja2.py | captainmalloc/jinja | 540b260198285f0ed41fbe80c0b1b6f13be579c1 | [
"BSD-3-Clause"
] | null | null | null | ext/djangojinja2.py | captainmalloc/jinja | 540b260198285f0ed41fbe80c0b1b6f13be579c1 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
djangojinja2
~~~~~~~~~~~~
Adds support for Jinja to Django.
Configuration variables:
======================= =============================================
Key Description
======================= =============================================
... | 34.413793 | 78 | 0.629927 |
11c195e99e0b5759ef285fcfa2c5eb571b586b6e | 10,796 | py | Python | google/ads/google_ads/v3/services/conversion_adjustment_upload_service_client.py | jphanwebstaurant/google-ads-python | 600812b2afcc4d57f00b47dfe436620ce50bfe9b | [
"Apache-2.0"
] | 1 | 2019-11-30T23:42:39.000Z | 2019-11-30T23:42:39.000Z | google/ads/google_ads/v3/services/conversion_adjustment_upload_service_client.py | jphanwebstaurant/google-ads-python | 600812b2afcc4d57f00b47dfe436620ce50bfe9b | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v3/services/conversion_adjustment_upload_service_client.py | jphanwebstaurant/google-ads-python | 600812b2afcc4d57f00b47dfe436620ce50bfe9b | [
"Apache-2.0"
] | 1 | 2020-09-30T17:04:06.000Z | 2020-09-30T17:04:06.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2019 Google LLC
#
# 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
#
# Unless required by applicable law... | 46.534483 | 170 | 0.663486 |
d39414a749071ddb7629db9ae8294506088e15f0 | 31,536 | py | Python | test/selenium/src/lib/constants/locator.py | Smotko/ggrc-core | b3abb58b24e7559960d71a94ba79c75539e7fe29 | [
"Apache-2.0"
] | null | null | null | test/selenium/src/lib/constants/locator.py | Smotko/ggrc-core | b3abb58b24e7559960d71a94ba79c75539e7fe29 | [
"Apache-2.0"
] | 12 | 2015-01-08T14:50:19.000Z | 2017-11-29T19:37:53.000Z | test/selenium/src/lib/constants/locator.py | Smotko/ggrc-core | b3abb58b24e7559960d71a94ba79c75539e7fe29 | [
"Apache-2.0"
] | 1 | 2015-01-08T13:25:09.000Z | 2015-01-08T13:25:09.000Z | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: jernej@reciprocitylabs.com
# Maintained By: jernej@reciprocitylabs.com
"""Locators for all the elements"""
# pylint: disable=too-few-public-methods... | 37.101176 | 79 | 0.668411 |
120801f0b5021e3d0b3926ac63f4f25c736a7caa | 341 | py | Python | biobb_dna/utils/transform.py | bioexcel/biobb_dna | 7b61937d1683629949ffd7e1abb55831dcd25060 | [
"Apache-2.0"
] | null | null | null | biobb_dna/utils/transform.py | bioexcel/biobb_dna | 7b61937d1683629949ffd7e1abb55831dcd25060 | [
"Apache-2.0"
] | 1 | 2021-10-30T07:25:54.000Z | 2021-10-30T07:25:54.000Z | biobb_dna/utils/transform.py | bioexcel/biobb_dna | 7b61937d1683629949ffd7e1abb55831dcd25060 | [
"Apache-2.0"
] | null | null | null | def inverse_complement(sequence, dna=True):
"""compute inverse complement sequence."""
if dna:
A_complement = "T"
else:
A_complement = "U"
complement = {
"A": A_complement,
A_complement: "A",
"G": "C",
"C": "G"
}
return "".join([complement[b] for b... | 24.357143 | 59 | 0.524927 |
5b29ed2d28e0d9be6e72da847eac5332061bd8c9 | 11,006 | py | Python | main.py | yunsujeon/BMT | a1598c589fa5cdb5a6cb257cda1da1593d05f8d7 | [
"MIT"
] | null | null | null | main.py | yunsujeon/BMT | a1598c589fa5cdb5a6cb257cda1da1593d05f8d7 | [
"MIT"
] | null | null | null | main.py | yunsujeon/BMT | a1598c589fa5cdb5a6cb257cda1da1593d05f8d7 | [
"MIT"
] | null | null | null | import argparse
from pprint import pprint
from utilities.config_constructor import Config
from scripts.train_captioning_module import train_cap
from scripts.train_proposal_generator import train_prop
from scripts.eval_on_learned_props import eval_on_learned_props
def main(cfg):
if cfg.procedure == 'train_cap':
... | 59.815217 | 110 | 0.658822 |
07a91a657f319617dcf963e3ca7a752037049897 | 3,038 | py | Python | Exec/hydro_tests/Sod_stellar/testsuite_analysis/test3-helm.py | MargotF/Castro | 5cdb549af422ef44c9b1822d0fefe043b3533c57 | [
"BSD-3-Clause-LBNL"
] | 178 | 2017-05-03T18:07:03.000Z | 2022-03-31T22:34:53.000Z | Exec/hydro_tests/Sod_stellar/testsuite_analysis/test3-helm.py | MargotF/Castro | 5cdb549af422ef44c9b1822d0fefe043b3533c57 | [
"BSD-3-Clause-LBNL"
] | 1,334 | 2017-05-04T14:23:24.000Z | 2022-03-28T00:12:06.000Z | Exec/hydro_tests/Sod_stellar/testsuite_analysis/test3-helm.py | MargotF/Castro | 5cdb549af422ef44c9b1822d0fefe043b3533c57 | [
"BSD-3-Clause-LBNL"
] | 86 | 2017-06-12T15:27:51.000Z | 2022-03-09T22:21:44.000Z | #!/usr/bin/env python3
# run as: ./test3-helm.py castro_exec_dir plotfle
# note: this relies on fextract.XXXX.ex being in your path somewhere
import sys
import os
import shutil
import numpy as np
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
def process(castro_exec_dir, plotfile):
ru... | 24.304 | 101 | 0.615866 |
d5a34e835cb6a9d40750be9723412e496de5ddc6 | 559 | py | Python | setup.py | axju/pyclean | 16ad3f44ee6ce3f2b0b12eaae220633c897580b1 | [
"MIT"
] | 1 | 2018-11-23T22:45:07.000Z | 2018-11-23T22:45:07.000Z | setup.py | axju/pyclean | 16ad3f44ee6ce3f2b0b12eaae220633c897580b1 | [
"MIT"
] | 2 | 2018-11-23T23:00:05.000Z | 2019-10-10T07:39:11.000Z | setup.py | axju/pyclean | 16ad3f44ee6ce3f2b0b12eaae220633c897580b1 | [
"MIT"
] | 1 | 2019-09-23T06:43:29.000Z | 2019-09-23T06:43:29.000Z | from setuptools import setup
def readme():
with open('README.md') as f:
return f.read()
setup(name='pycleanup',
version='0.0.1',
description='Clean up your working directory.',
long_description=readme(),
keywords='Clean up',
url='https://github.com/axju/pyclean',
author... | 26.619048 | 65 | 0.617174 |
f581a6178138afd921d7ace13828e898e68ee137 | 4,408 | py | Python | rivalcfg/handlers/buttons/layout_qwerty.py | Clueninja/rivalcfg | f7e2a3480c5f0b9a0b992ba5af7ff2025b2af346 | [
"WTFPL"
] | 604 | 2016-03-31T12:22:26.000Z | 2022-03-31T18:51:50.000Z | rivalcfg/handlers/buttons/layout_qwerty.py | Clueninja/rivalcfg | f7e2a3480c5f0b9a0b992ba5af7ff2025b2af346 | [
"WTFPL"
] | 162 | 2016-04-17T10:58:08.000Z | 2022-03-11T18:59:18.000Z | rivalcfg/handlers/buttons/layout_qwerty.py | Clueninja/rivalcfg | f7e2a3480c5f0b9a0b992ba5af7ff2025b2af346 | [
"WTFPL"
] | 89 | 2016-04-10T08:56:58.000Z | 2022-03-18T21:04:10.000Z | """
This file contains the layout for QWERTY (en_US) keyboards.
"""
# fmt: off
#: The layout
layout = {
# Alphanumeric
"A": 0x04,
"B": 0x05,
"C": 0x06,
"D": 0x07,
"E": 0x08,
"F": 0x09,
"G": 0x0A,
"H": 0x0B,
"I": 0x0C,
"J": 0x0D,
"K": 0x0E,
"L": 0x0F,
"M": 0x10... | 18.065574 | 59 | 0.463702 |
5d463d168910c2c4ac777c6202405f3ef6c834dd | 6,518 | py | Python | traffic_control/admin/road_marking.py | City-of-Helsinki/city-infrastructure-platform | c14513a9e54405412085f1047f91ec58b263eac0 | [
"CC0-1.0"
] | 2 | 2020-11-23T22:08:58.000Z | 2022-03-02T13:13:20.000Z | traffic_control/admin/road_marking.py | City-of-Helsinki/city-infrastructure-platform | c14513a9e54405412085f1047f91ec58b263eac0 | [
"CC0-1.0"
] | 170 | 2019-12-31T13:37:04.000Z | 2022-03-12T14:03:35.000Z | traffic_control/admin/road_marking.py | City-of-Helsinki/city-infrastructure-platform | c14513a9e54405412085f1047f91ec58b263eac0 | [
"CC0-1.0"
] | 3 | 2020-05-08T05:58:02.000Z | 2022-03-15T16:07:25.000Z | from django.contrib.gis import admin
from django.db import models
from django.utils.translation import gettext_lazy as _
from ..constants import HELSINKI_LATITUDE, HELSINKI_LONGITUDE
from ..forms import AdminFileWidget
from ..mixins import (
EnumChoiceValueDisplayAdminMixin,
SoftDeleteAdminMixin,
UserStamp... | 27.158333 | 87 | 0.486652 |
80ab6b07fe31868e61bf742c8915572f28ddceb3 | 2,409 | py | Python | test/test-tools/Archive/mathv1.py | LeastAuthority/Benchmark-Pendle-Smart-Contracts | 5116f44cb0828d74b77ebfb14f394d61103112bb | [
"MIT"
] | null | null | null | test/test-tools/Archive/mathv1.py | LeastAuthority/Benchmark-Pendle-Smart-Contracts | 5116f44cb0828d74b77ebfb14f394d61103112bb | [
"MIT"
] | null | null | null | test/test-tools/Archive/mathv1.py | LeastAuthority/Benchmark-Pendle-Smart-Contracts | 5116f44cb0828d74b77ebfb14f394d61103112bb | [
"MIT"
] | null | null | null | '''
Python version of Pendle's V1 Math Lib
'''
import helper
PRECISION_BITS = 40
ONE = 1 << PRECISION_BITS
PRECISION_POW = 100
def rmul(x, y):
return ((ONE // 2 + (x) * (y)) >> PRECISION_BITS)
def rdiv(x, y):
return (y // 2 + x * ONE) // (y)
def countLeadingZeros(_p, _q):
denomator = (1 << 255)
... | 19.272 | 53 | 0.50851 |
4446a09b60cf868c2d2ee54975500925ea0b5493 | 9,956 | py | Python | pypicloud/storage/s3.py | pepastach/pypicloud | 42ad82a52bc4b7f1da79179f089ee2b094c76865 | [
"MIT"
] | 1 | 2021-04-10T04:18:36.000Z | 2021-04-10T04:18:36.000Z | pypicloud/storage/s3.py | jweede/pypicloud | 3015160ed6fd7f8ffc3a3e4513e7fb91dd340921 | [
"MIT"
] | null | null | null | pypicloud/storage/s3.py | jweede/pypicloud | 3015160ed6fd7f8ffc3a3e4513e7fb91dd340921 | [
"MIT"
] | null | null | null | """ Store packages in S3 """
import logging
import posixpath
from datetime import datetime, timedelta
from urllib.parse import quote, urlparse
import boto3
from botocore.config import Config
from botocore.exceptions import ClientError
from botocore.signers import CloudFrontSigner
from cryptography.hazmat.backends impo... | 36.072464 | 98 | 0.590398 |
2e3542f9c3cb701d805b00055da3dbc97e3fb13f | 22,072 | py | Python | inter_MSA.py | he-h/Covid-Mobility-Network-Analysis | 8464b0a25db03585219c1fc6d8e257a9ed826628 | [
"MIT"
] | 1 | 2021-01-07T19:57:46.000Z | 2021-01-07T19:57:46.000Z | inter_MSA.py | hhe-bot/Covid-Mobility-Network-Analysis | 8464b0a25db03585219c1fc6d8e257a9ed826628 | [
"MIT"
] | 1 | 2020-09-23T06:10:29.000Z | 2020-09-25T15:41:33.000Z | inter_MSA.py | haoyu0831/Covid-Mobility-Network-Analysis | 8464b0a25db03585219c1fc6d8e257a9ed826628 | [
"MIT"
] | null | null | null | from model import *
from plot import *
import powerlaw
from statistics import median
from matplotlib.lines import Line2D
from read_file import *
import matplotlib.pyplot as plt
from mpl_toolkits.basemap import Basemap as Basemap
import json
import csv
import os
from haversine import haversine
# NY NJ PA 5602
# LA 447... | 38.790861 | 149 | 0.509197 |
3509989fa9e5f811b55a930f69c060902c3edcc6 | 1,296 | py | Python | ddns/config.py | dongbum/DDNS-Route53 | 936b2ebe433a2f90f020b88bce13a236de3b5fbc | [
"MIT"
] | 11 | 2019-08-26T12:44:21.000Z | 2022-01-25T08:54:11.000Z | ddns/config.py | dongbum/DDNS-Route53 | 936b2ebe433a2f90f020b88bce13a236de3b5fbc | [
"MIT"
] | 2 | 2019-10-01T01:22:56.000Z | 2019-10-02T01:34:35.000Z | ddns/config.py | dongbum/DDNS-Route53 | 936b2ebe433a2f90f020b88bce13a236de3b5fbc | [
"MIT"
] | 1 | 2021-04-23T18:15:58.000Z | 2021-04-23T18:15:58.000Z | # -*- coding: utf-8 -*-
import os, configparser
from ddns.customerror import ConfigParserError
class Config:
def __init__(self):
try:
if os.path.exists('config.ini'):
config = configparser.ConfigParser()
config.read('config.ini')
self.domain = co... | 44.689655 | 87 | 0.579475 |
e3a0dca60469edc07da75854bb783a292ee5ff1f | 7,839 | py | Python | videoanalyst/data/target/target_impl/utils/make_densebox_target_v1.py | TragedyN/SiamFCpp | 65d80a66eb40d81ca09fa2dbf32636fbc414ec0d | [
"MIT"
] | 737 | 2019-12-24T13:34:43.000Z | 2022-03-28T11:38:24.000Z | videoanalyst/data/target/target_impl/utils/make_densebox_target_v1.py | ShiAngWang/video_analyst | de4f86363cc408695428b423e8d6e346aa35149b | [
"MIT"
] | 129 | 2020-02-13T04:08:28.000Z | 2022-03-17T04:13:09.000Z | videoanalyst/data/target/target_impl/utils/make_densebox_target_v1.py | ShiAngWang/video_analyst | de4f86363cc408695428b423e8d6e346aa35149b | [
"MIT"
] | 179 | 2019-12-31T04:53:12.000Z | 2022-03-25T06:32:20.000Z | # encoding: utf-8
# [Version 1] this is a archived version of densebox target maker
# current version is under _make_densebox_target.py_ (i.e. without "_v1" suffix)
import os
from typing import Dict, Tuple
import numpy as np
DUMP_FLAG = False # dump intermediate results for debugging
DUMP_DIR = "dump"
DUMP_SUFFIX =... | 37.328571 | 136 | 0.579028 |
80d539219eb1f2429b8f8f63bf623bb6e856a614 | 539 | py | Python | sandbox/length-dist.py | ctSkennerton/khmer | f5428c5bdfe009ce39b125fa6e18077c534dc747 | [
"BSD-3-Clause"
] | null | null | null | sandbox/length-dist.py | ctSkennerton/khmer | f5428c5bdfe009ce39b125fa6e18077c534dc747 | [
"BSD-3-Clause"
] | null | null | null | sandbox/length-dist.py | ctSkennerton/khmer | f5428c5bdfe009ce39b125fa6e18077c534dc747 | [
"BSD-3-Clause"
] | null | null | null | #! /usr/bin/env python
#
# This file is part of khmer, http://github.com/ged-lab/khmer/, and is
# Copyright (C) Michigan State University, 2009-2013. It is licensed under
# the three-clause BSD license; see doc/LICENSE.txt.
# Contact: khmer-project@idyll.org
#
import sys
import screed
from screed import fasta
filein ... | 22.458333 | 74 | 0.697588 |
4d8ae1edbbe0b0f29458d56894d484cc2f3dc5fb | 2,006 | py | Python | src/bookmarklet_result/show.py | artilf/bookmarks-lambda | f1d0c9d94f5793240e844e4d99e30fa2e5a331cf | [
"MIT"
] | null | null | null | src/bookmarklet_result/show.py | artilf/bookmarks-lambda | f1d0c9d94f5793240e844e4d99e30fa2e5a331cf | [
"MIT"
] | null | null | null | src/bookmarklet_result/show.py | artilf/bookmarks-lambda | f1d0c9d94f5793240e844e4d99e30fa2e5a331cf | [
"MIT"
] | null | null | null | from pathlib import Path
from typing import Optional
from jinja2 import Template
from logger.my_logger import MyLogger
from models.article import Article
from tools.base64 import urlsafe_decode
from tools.bookmarklet_tools import (
get_raw_encoded_article,
get_raw_encoded_message,
is_success,
)
logger = ... | 27.479452 | 86 | 0.721336 |
9513a05700830089ee0d3201247913353cd3e934 | 1,400 | py | Python | airbyte-integrations/bases/base-normalization/normalization/destination_type.py | rajatariya21/airbyte | 11e70a7a96e2682b479afbe6f709b9a5fe9c4a8d | [
"MIT"
] | null | null | null | airbyte-integrations/bases/base-normalization/normalization/destination_type.py | rajatariya21/airbyte | 11e70a7a96e2682b479afbe6f709b9a5fe9c4a8d | [
"MIT"
] | 4 | 2021-04-30T08:10:26.000Z | 2021-04-30T13:53:34.000Z | airbyte-integrations/bases/base-normalization/normalization/destination_type.py | rajatariya21/airbyte | 11e70a7a96e2682b479afbe6f709b9a5fe9c4a8d | [
"MIT"
] | null | null | null | # MIT License
#
# Copyright (c) 2020 Airbyte
#
# 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, publ... | 38.888889 | 80 | 0.757857 |
fc5c2cb55b6b215970099f86c6bdfbcda89c8934 | 8,087 | py | Python | Result.py | UmeedChandel/FaceGrab | 9d7e226c790bcd9f5b3c4297765b6d403a7a7838 | [
"MIT"
] | 1 | 2021-06-07T16:22:53.000Z | 2021-06-07T16:22:53.000Z | Result.py | Tulikajain1210/FaceGrab | b1453dc1ccd077fdd67c4683dcb0098fb37f4068 | [
"MIT"
] | 1 | 2021-06-07T16:33:14.000Z | 2021-06-07T16:33:14.000Z | Result.py | Tulikajain1210/FaceGrab | b1453dc1ccd077fdd67c4683dcb0098fb37f4068 | [
"MIT"
] | 2 | 2021-06-07T03:04:32.000Z | 2021-06-07T16:21:51.000Z | from PyQt5 import QtCore, QtGui, QtWidgets
from PyQt5.QtGui import QPixmap
class Ui_ResultPage(object):
def openWindow(self):
from Search import Ui_SearchPage
self.window = QtWidgets.QDialog()
self.ui = Ui_SearchPage()
self.ui.setupUi(self.window)
self.window.show()
de... | 42.119792 | 85 | 0.645975 |
dabf65e6165ab5872b2e42ca21ab0572435cd718 | 3,149 | py | Python | data/process_data.py | kschuessler/udacity_disaster_response_pipeline | 68ed6c79d50ce131a975a20eef1a860de6162a58 | [
"FTL",
"CNRI-Python",
"blessing"
] | null | null | null | data/process_data.py | kschuessler/udacity_disaster_response_pipeline | 68ed6c79d50ce131a975a20eef1a860de6162a58 | [
"FTL",
"CNRI-Python",
"blessing"
] | null | null | null | data/process_data.py | kschuessler/udacity_disaster_response_pipeline | 68ed6c79d50ce131a975a20eef1a860de6162a58 | [
"FTL",
"CNRI-Python",
"blessing"
] | null | null | null | import sys
import pandas as pd
from sqlalchemy import create_engine
def load_data(messages_filepath, categories_filepath):
"""
INPUT:
messages_filepath - path to the csv file holding messages data
categories_filepath - path to the csv file holding categories data
OUTPUT:
df - a dat... | 32.802083 | 93 | 0.656716 |
8d3ede7cac8abe7314143e211b13847bed4f0e15 | 812 | py | Python | source_files/example_1/example_1_plot_beam_vibration_data.py | ARTS-Laboratory/Introducton-to-Python-for-engineers | e852b3b35a48afea7839fca5043708caf2f84b03 | [
"MIT"
] | null | null | null | source_files/example_1/example_1_plot_beam_vibration_data.py | ARTS-Laboratory/Introducton-to-Python-for-engineers | e852b3b35a48afea7839fca5043708caf2f84b03 | [
"MIT"
] | null | null | null | source_files/example_1/example_1_plot_beam_vibration_data.py | ARTS-Laboratory/Introducton-to-Python-for-engineers | e852b3b35a48afea7839fca5043708caf2f84b03 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Nov 15 16:05:28 2019
@author: austin
"""
import IPython as IP
IP.get_ipython().magic('reset -sf')
import numpy as np
import scipy as sp
import matplotlib as mpl
import matplotlib.pyplot as plt
plt.close('all')
#%% Load and plot data
D = np.loadtxt(... | 20.3 | 70 | 0.681034 |
02913434d5db4e3c09f6aa02eb890cf3c26c0d78 | 2,059 | py | Python | setup.py | heylouiz/spidermon | 3ae2c46d1cf5b46efb578798b881264be3e68394 | [
"BSD-3-Clause"
] | null | null | null | setup.py | heylouiz/spidermon | 3ae2c46d1cf5b46efb578798b881264be3e68394 | [
"BSD-3-Clause"
] | null | null | null | setup.py | heylouiz/spidermon | 3ae2c46d1cf5b46efb578798b881264be3e68394 | [
"BSD-3-Clause"
] | null | null | null | from setuptools import setup, find_packages
test_requirements = [
"pytest>=2.7.0",
"pytest-cov",
"pytest-mock",
"jinja2",
"lxml",
"scrapy",
"slackclient>=1.3.0,<2.0.0",
"twisted>=19.7.0",
]
setup(
name="spidermon",
version="1.11.0",
url="https://github.com/scrapinghub/spide... | 32.171875 | 88 | 0.581836 |
2e87e8e8e61abe9afb627a3a71c1f408cc48dffb | 7,903 | py | Python | tests/units/consensus/change_candidate_test.py | iconloop/LFT2 | 3862d63aaf148f99240c6d4a54408dc2520b94c6 | [
"Apache-2.0"
] | 23 | 2020-02-10T10:08:20.000Z | 2021-11-17T02:02:06.000Z | tests/units/consensus/change_candidate_test.py | iconloop/LFT2 | 3862d63aaf148f99240c6d4a54408dc2520b94c6 | [
"Apache-2.0"
] | 3 | 2020-03-05T07:18:16.000Z | 2020-06-01T09:03:11.000Z | tests/units/consensus/change_candidate_test.py | iconloop/LFT2 | 3862d63aaf148f99240c6d4a54408dc2520b94c6 | [
"Apache-2.0"
] | 6 | 2020-02-21T02:02:40.000Z | 2021-12-01T23:35:07.000Z | import os
import pytest
from typing import Tuple
from mock import MagicMock
from lft.app.data import DefaultDataFactory, DefaultData
from lft.app.vote import DefaultVoteFactory
from lft.app.epoch import RotateEpoch
from lft.consensus.messages.vote import Vote
from lft.event import EventSystem
from lft.consensus import ... | 40.116751 | 123 | 0.670884 |
d8aec1f758f0d86a2f97b97b75372a3fadd57d40 | 358 | py | Python | servicectl/exceptions.py | TheEdgeOfRage/servicectl | c3a52bc00caaa8272dcda96e5f63e43b84bffd56 | [
"BSD-3-Clause"
] | null | null | null | servicectl/exceptions.py | TheEdgeOfRage/servicectl | c3a52bc00caaa8272dcda96e5f63e43b84bffd56 | [
"BSD-3-Clause"
] | null | null | null | servicectl/exceptions.py | TheEdgeOfRage/servicectl | c3a52bc00caaa8272dcda96e5f63e43b84bffd56 | [
"BSD-3-Clause"
] | null | null | null | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2019 Pavle Portic <pavle.portic@tilda.center>
#
# Distributed under terms of the BSD-3-Clause license.
class ServiceUpdateError(Exception):
pass
class StackRevertFailed(Exception):
pass
class ImageNotFound(Exception):
pass
class ... | 14.916667 | 59 | 0.73743 |
8083dab912703045d1ed97107132acfe420e7433 | 2,171 | py | Python | src/cc_catalog_airflow/dags/provider_api_scripts/common/requester.py | ayushbansal07/cccatalog | 27d1ae2b8b65d2bebf1e32d4541346a92382ba4a | [
"MIT"
] | 1 | 2020-02-07T22:47:47.000Z | 2020-02-07T22:47:47.000Z | src/cc_catalog_airflow/dags/provider_api_scripts/common/requester.py | ayushbansal07/cccatalog | 27d1ae2b8b65d2bebf1e32d4541346a92382ba4a | [
"MIT"
] | null | null | null | src/cc_catalog_airflow/dags/provider_api_scripts/common/requester.py | ayushbansal07/cccatalog | 27d1ae2b8b65d2bebf1e32d4541346a92382ba4a | [
"MIT"
] | null | null | null | import logging
import requests
import time
logger = logging.getLogger(__name__)
class DelayedRequester:
"""
Provides a method `get` that is a wrapper around `get` from the
`requests` module (i.e., it simply passes along whatever arguments it
receives). The difference is that when this class is initi... | 35.590164 | 74 | 0.607554 |
d3d93d4929b4fc5c6f03e4506ebd5da375be4b7d | 4,583 | py | Python | src/t/scripts/update.py | danpalmer/t | 0f8f9eb90c754d477a19200b31c3b3c7cc142d8d | [
"MIT"
] | 1 | 2022-01-11T11:17:14.000Z | 2022-01-11T11:17:14.000Z | src/t/scripts/update.py | danpalmer/t | 0f8f9eb90c754d477a19200b31c3b3c7cc142d8d | [
"MIT"
] | null | null | null | src/t/scripts/update.py | danpalmer/t | 0f8f9eb90c754d477a19200b31c3b3c7cc142d8d | [
"MIT"
] | null | null | null | import pathlib
import platform
import stat
import sys
import tarfile
import tempfile
from typing import Any, List, Tuple
import click
import httpx
from t import cli
from t.__version__ import VERSION
from t.settings import UPDATE_REPO
from t.utils import github, output
@cli.command(help=f"Check {'/'.join(UPDATE_REPO... | 27.608434 | 84 | 0.634737 |
9ddbdf80e1894186454f2f6193d9774c47cff3c8 | 612 | py | Python | hackerrank/Python/HTML Parser - Part 2/solution.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | 4 | 2020-07-24T01:59:50.000Z | 2021-07-24T15:14:08.000Z | hackerrank/Python/HTML Parser - Part 2/solution.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | null | null | null | hackerrank/Python/HTML Parser - Part 2/solution.py | ATrain951/01.python-com_Qproject | c164dd093954d006538020bdf2e59e716b24d67c | [
"MIT"
] | null | null | null | from abc import ABC
from html.parser import HTMLParser
class MyHTMLParser(HTMLParser, ABC):
def handle_comment(self, comment):
if '\n' in comment:
print('>>> Multi-line Comment')
else:
print('>>> Single-line Comment')
print(comment)
def handle_data(self, data):... | 21.103448 | 44 | 0.542484 |
b3c08db3749a720d96f023204a519ecca5181f8b | 124 | py | Python | mypython/forloop1.py | priyalbhatewara123/Python-programs | 90b84310101b76c14b89f256ee9206711908a4ae | [
"bzip2-1.0.6"
] | null | null | null | mypython/forloop1.py | priyalbhatewara123/Python-programs | 90b84310101b76c14b89f256ee9206711908a4ae | [
"bzip2-1.0.6"
] | null | null | null | mypython/forloop1.py | priyalbhatewara123/Python-programs | 90b84310101b76c14b89f256ee9206711908a4ae | [
"bzip2-1.0.6"
] | null | null | null | num = [11,89,7,48,100]
for nums in num:
if nums % 5 == 0:
print(nums)
break
else:
print("not found") | 17.714286 | 22 | 0.516129 |
59156d9f3d98665c18144e626347dd2c3632106d | 5,716 | py | Python | opencga-client/src/main/python/pyopencga/rest_clients/user_client.py | opencb/opencga | b598b0adbda424c98bf6aa8b862cbb6d2992419b | [
"Apache-2.0"
] | 146 | 2015-03-05T19:14:22.000Z | 2022-03-30T03:46:48.000Z | opencga-client/src/main/python/pyopencga/rest_clients/user_client.py | opencb/opencga | b598b0adbda424c98bf6aa8b862cbb6d2992419b | [
"Apache-2.0"
] | 1,623 | 2015-01-27T00:30:36.000Z | 2022-03-31T14:42:33.000Z | opencga-client/src/main/python/pyopencga/rest_clients/user_client.py | opencb/opencga | b598b0adbda424c98bf6aa8b862cbb6d2992419b | [
"Apache-2.0"
] | 93 | 2015-01-28T17:13:01.000Z | 2022-03-09T20:46:47.000Z | """
WARNING: AUTOGENERATED CODE
This code was generated by a tool.
Autogenerated on: 2021-05-21 14:06:25
Manual changes to this file may cause unexpected behavior in your application.
Manual changes to this file will be overwritten if the code is regenerated.
"""
from pyopencga.rest_clients._pare... | 35.725 | 149 | 0.627362 |
54d853097daa028f63b78cec5ea564979a0dca55 | 5,763 | py | Python | bin/input_module_pagerduty_api_incidents.py | daianmartinho/TA-PagerDuty | d15e3709a80ffc8c3425b6dee2a6c2ebb22a9987 | [
"MIT"
] | 3 | 2017-10-18T19:25:59.000Z | 2021-06-28T19:18:00.000Z | bin/input_module_pagerduty_api_incidents.py | daianmartinho/TA-PagerDuty | d15e3709a80ffc8c3425b6dee2a6c2ebb22a9987 | [
"MIT"
] | 2 | 2018-01-02T15:21:54.000Z | 2018-01-23T16:11:44.000Z | bin/input_module_pagerduty_api_incidents.py | daianmartinho/TA-PagerDuty | d15e3709a80ffc8c3425b6dee2a6c2ebb22a9987 | [
"MIT"
] | 2 | 2017-10-18T19:15:45.000Z | 2018-03-28T16:55:17.000Z |
# encoding = utf-8
import os
import sys
import time
import base64
import urlparse
import json
from datetime import datetime, timedelta
def validate_input(helper, definition):
pd_api_token = definition.parameters.get('api_token', None)
pd_pagesize = definition.parameters.get('api_limit', None)
pd_daysago... | 50.113043 | 200 | 0.671352 |
adc6f2e65df87623032490f50567d440e1a8c9a0 | 5,143 | py | Python | nevergrad/instrumentation/test_variables.py | enthought/nevergrad | 2a0f778aa316264e785d0e6305a897679b3b97f7 | [
"MIT"
] | null | null | null | nevergrad/instrumentation/test_variables.py | enthought/nevergrad | 2a0f778aa316264e785d0e6305a897679b3b97f7 | [
"MIT"
] | null | null | null | nevergrad/instrumentation/test_variables.py | enthought/nevergrad | 2a0f778aa316264e785d0e6305a897679b3b97f7 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import typing as tp
import pytest
import numpy as np
from nevergrad.parametrization import parameter as p
from nevergrad.... | 41.813008 | 121 | 0.674315 |
5358ad5539dd7b5b7e57aa46663bdb40adc56f57 | 4,681 | bzl | Python | third_party/polymer.bzl | hakanhp/chanel | 6825b60e86c46daabb18f40f1e45d3de2ff8e983 | [
"Apache-2.0"
] | null | null | null | third_party/polymer.bzl | hakanhp/chanel | 6825b60e86c46daabb18f40f1e45d3de2ff8e983 | [
"Apache-2.0"
] | null | null | null | third_party/polymer.bzl | hakanhp/chanel | 6825b60e86c46daabb18f40f1e45d3de2ff8e983 | [
"Apache-2.0"
] | null | null | null | """TensorFlow Model Analysis Polymer Dependencies"""
load("@io_bazel_rules_closure//closure:defs.bzl", "web_library_external")
def tensorflow_model_analysis_polymer_workspace():
"""Download TensorFlow Model Analysis polymer dependencies."""
web_library_external(
name = "org_googlewebcomponents_google_apis"... | 34.419118 | 107 | 0.611835 |
845aaef83eeff048910fab30bbc15230f8a93062 | 10,072 | py | Python | examples/pytorch/graphsage/train_sampling.py | ydwu4/dgl-hack | b0fee8b9723c71f45bcf00301653fc71bfa82bc1 | [
"Apache-2.0"
] | null | null | null | examples/pytorch/graphsage/train_sampling.py | ydwu4/dgl-hack | b0fee8b9723c71f45bcf00301653fc71bfa82bc1 | [
"Apache-2.0"
] | null | null | null | examples/pytorch/graphsage/train_sampling.py | ydwu4/dgl-hack | b0fee8b9723c71f45bcf00301653fc71bfa82bc1 | [
"Apache-2.0"
] | null | null | null | import dgl
import numpy as np
import torch as th
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.multiprocessing as mp
from torch.utils.data import DataLoader
import dgl.function as fn
import dgl.nn.pytorch as dglnn
import time
import argparse
from _thread import start_new... | 38.296578 | 137 | 0.625794 |
c9a219a85a16125a0525474708fcdaf322a59e18 | 2,070 | py | Python | pythononwheels/start/handlers/powhandlermixin.py | fakegit/pow_devel | 4288d9c48261ec54414f295b25d444eee523a85f | [
"MIT"
] | 24 | 2015-08-06T07:32:00.000Z | 2022-03-24T22:05:01.000Z | pythononwheels/start/handlers/powhandlermixin.py | fakegit/pow_devel | 4288d9c48261ec54414f295b25d444eee523a85f | [
"MIT"
] | 37 | 2017-04-14T19:16:40.000Z | 2021-08-17T21:05:51.000Z | pythononwheels/start/handlers/powhandlermixin.py | fakegit/pow_devel | 4288d9c48261ec54414f295b25d444eee523a85f | [
"MIT"
] | 2 | 2016-05-25T08:29:32.000Z | 2020-11-21T10:44:31.000Z |
import tornado.web
import werkzeug.security
from {{appname}}.conf.config import myapp
class PowHandlerMixin():
"""
The Base Pow Handler Mixin Handler
This is Place to put common stuff for all your
Standard AND WebSocket handlers which will remain unaffected by any PoW Changes.
... | 39.807692 | 95 | 0.632367 |
6288a32f68b30120ff5325bbcfa68243cf41f37d | 13,248 | py | Python | .history/src/Simulador_20200710221308.py | eduardodut/Trabalho_final_estatistica_cd | fbedbbea6bdd7a79e1d62030cde0fab4e93fc338 | [
"MIT"
] | null | null | null | .history/src/Simulador_20200710221308.py | eduardodut/Trabalho_final_estatistica_cd | fbedbbea6bdd7a79e1d62030cde0fab4e93fc338 | [
"MIT"
] | null | null | null | .history/src/Simulador_20200710221308.py | eduardodut/Trabalho_final_estatistica_cd | fbedbbea6bdd7a79e1d62030cde0fab4e93fc338 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from Matriz_esferica import Matriz_esferica
from Individuo import Individuo, Fabrica_individuo
import random
from itertools import permutations
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
from scipy.sparse import csr_matrix, lil_matrix
class S... | 40.024169 | 179 | 0.642059 |
4f4678572e89a7b6f4e1e5faf00d0b4385a87cc4 | 1,944 | py | Python | connectfour/test/test_negamax.py | amwhalen/connectfour | 4f01bc4a94a04ae729c66c0498fe64b1ce8585f6 | [
"MIT"
] | 1 | 2017-10-12T05:20:02.000Z | 2017-10-12T05:20:02.000Z | connectfour/test/test_negamax.py | amwhalen/connectfour | 4f01bc4a94a04ae729c66c0498fe64b1ce8585f6 | [
"MIT"
] | null | null | null | connectfour/test/test_negamax.py | amwhalen/connectfour | 4f01bc4a94a04ae729c66c0498fe64b1ce8585f6 | [
"MIT"
] | null | null | null | import unittest
import connectfour.board
import connectfour.board_factory
from connectfour.players.negamax import NegamaxPlayer
from copy import deepcopy
class TestBoard(unittest.TestCase):
def setUp(self):
pass
def test_negamax(self):
n = NegamaxPlayer(4)
self.assertEquals(n.getName(), "Ne... | 26.27027 | 70 | 0.486111 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.