hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | 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 3 239 | max_forks_repo_name stringlengths 5 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.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
797eb1e83483a8cba4ba50c9a317d010080362cb | 1,438 | py | Python | lib/Zipfile.py | zwei2008/cve | 75a3d21ca850b9d3d823e51ccf0878f8f3248bdb | [
"BSD-3-Clause"
] | null | null | null | lib/Zipfile.py | zwei2008/cve | 75a3d21ca850b9d3d823e51ccf0878f8f3248bdb | [
"BSD-3-Clause"
] | null | null | null | lib/Zipfile.py | zwei2008/cve | 75a3d21ca850b9d3d823e51ccf0878f8f3248bdb | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Database layer
# translates database calls to functions
#
# Software is free software released under the "Modified BSD license"
#
# Copyright (c) 2014-2016 Pieter-Jan Moreels - pieterjan.moreels@gmail.com
# imports
import zipfile
import os
def listdir(path, l... | 25.678571 | 80 | 0.61822 |
797eb2714458006f7ff7721c66b3beda365af6a9 | 1,002 | py | Python | Mundo II/D043 - IMC v2.py | Orecruta/Exercicios-Python | 129a15930ea22df1f0a7d6bd39a7ac28be515034 | [
"MIT"
] | null | null | null | Mundo II/D043 - IMC v2.py | Orecruta/Exercicios-Python | 129a15930ea22df1f0a7d6bd39a7ac28be515034 | [
"MIT"
] | null | null | null | Mundo II/D043 - IMC v2.py | Orecruta/Exercicios-Python | 129a15930ea22df1f0a7d6bd39a7ac28be515034 | [
"MIT"
] | null | null | null | print('\033[36;1m-='*6, '\033[4mDESAFIO 043 - IMC V2\033[0;1;36m', '=-'*6)
kg = float(input('\033[m| Digite seu peso: '))
m = float(input('| Digite sua altura (m): '))
imc = kg / (m**2)
print('\033[34;1m-'*60)
print('\033[31;1;4mProcessando...\033[m')
print('\033[34;1m-'*60)
if imc < 18.5:
print(f'\033[mO seu \033... | 52.736842 | 132 | 0.61976 |
797eb2faec2d35efdfb7d78d16afa27a1a502ae1 | 1,571 | py | Python | base/services/table_builder/reference.py | joeportela/tinyAPI | f2469c38a605b00519acd0b79af17d0041f5ae7b | [
"MIT"
] | 6 | 2016-11-18T22:32:44.000Z | 2021-04-01T17:02:13.000Z | base/services/table_builder/reference.py | joeportela/tinyAPI | f2469c38a605b00519acd0b79af17d0041f5ae7b | [
"MIT"
] | 1 | 2018-12-20T23:07:52.000Z | 2018-12-20T23:07:52.000Z | base/services/table_builder/reference.py | joeportela/tinyAPI | f2469c38a605b00519acd0b79af17d0041f5ae7b | [
"MIT"
] | 10 | 2018-02-23T00:08:21.000Z | 2020-10-01T03:06:12.000Z | # ----- Info ------------------------------------------------------------------
__author__ = 'Michael Montero <mcmontero@gmail.com>'
# ----- Imports ---------------------------------------------------------------
import builtins
from tinyAPI.base.config import ConfigManager
__all__ = [
'refv'
]
# ----- Public... | 28.053571 | 79 | 0.543603 |
797eb4f1881e7845fb1704b3f3350dfab41420ed | 2,516 | py | Python | qt/qt_sample_qtchart.py | Storvild/python_examples | 52b0b486fee442bf4b49a13cf8e609cdf4e02e0b | [
"MIT"
] | null | null | null | qt/qt_sample_qtchart.py | Storvild/python_examples | 52b0b486fee442bf4b49a13cf8e609cdf4e02e0b | [
"MIT"
] | null | null | null | qt/qt_sample_qtchart.py | Storvild/python_examples | 52b0b486fee442bf4b49a13cf8e609cdf4e02e0b | [
"MIT"
] | null | null | null | #!e:\virtualenvs\qt\qt_env36\Scripts\python.exe
# -*- coding: utf-8 -*-
#
# Licensed under the terms of the MIT License
# Copyright (c) 2015 Pierre Raybaut
"""
Simple example illustrating Qt Charts capabilities to plot curves with
a high number of points, using OpenGL accelerated series
"""
from PyQt5.QtChart import... | 31.061728 | 71 | 0.660572 |
797eb7ab10eac644fd44b2240c6e4865fc4f177c | 2,625 | py | Python | Google/benchmarks/minigo/implementations/minigo-research-TF-tpu-v4-128/selfplay_timing.py | goswamig/training_results_v0.7 | 4278ce8a0f3d4db6b5e6054277724ca36278d7a3 | [
"Apache-2.0"
] | 48 | 2020-07-29T18:09:23.000Z | 2021-10-09T01:53:33.000Z | Google/benchmarks/minigo/implementations/minigo-research-TF-tpu-v4-128/selfplay_timing.py | goswamig/training_results_v0.7 | 4278ce8a0f3d4db6b5e6054277724ca36278d7a3 | [
"Apache-2.0"
] | 9 | 2021-04-02T02:28:07.000Z | 2022-03-26T18:23:59.000Z | Google/benchmarks/minigo/implementations/minigo-research-TF-tpu-v4-128/selfplay_timing.py | lablup/training_results_v0.7 | f5bb59aa0f8b18b602763abe47d1d24d0d54b197 | [
"Apache-2.0"
] | 42 | 2020-08-01T06:41:24.000Z | 2022-01-20T10:33:08.000Z | # Lint as: python3
# Copyright 2018 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 32.407407 | 92 | 0.704 |
797eb87d1ab1875d02f20634b34281f5e9d8463e | 4,744 | py | Python | security_monkey/watchers/vpc/nat_gateway.py | bungoume/security_monkey | 90c02638a315c78535869ab71a8859d17e011a6a | [
"Apache-2.0"
] | 3 | 2018-05-18T17:32:36.000Z | 2021-12-09T13:46:35.000Z | security_monkey/watchers/vpc/nat_gateway.py | bungoume/security_monkey | 90c02638a315c78535869ab71a8859d17e011a6a | [
"Apache-2.0"
] | 2 | 2018-03-12T17:21:33.000Z | 2020-09-03T15:56:11.000Z | security_monkey/watchers/vpc/nat_gateway.py | cxmcc/security_monkey | ae4c4b5b278505a97f0513f5ae44db3eb23c175c | [
"Apache-2.0"
] | 2 | 2018-06-15T16:55:11.000Z | 2020-04-30T16:26:59.000Z | # Copyright 2016 Bridgewater Associates
#
# 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 appli... | 39.865546 | 98 | 0.573356 |
797eb9280d6dd69d78fb0bb0424c0286159edb23 | 14,722 | py | Python | ospy/usagestats.py | martinpihrt/OSPy | 148ca8f85433ef9528930b4a787ecef15670e1d3 | [
"CC-BY-3.0"
] | 11 | 2016-07-18T12:33:46.000Z | 2021-12-27T17:09:30.000Z | ospy/usagestats.py | martinpihrt/OSPy | 148ca8f85433ef9528930b4a787ecef15670e1d3 | [
"CC-BY-3.0"
] | 9 | 2015-02-20T08:47:55.000Z | 2022-03-31T07:31:53.000Z | ospy/usagestats.py | martinpihrt/OSPy | 148ca8f85433ef9528930b4a787ecef15670e1d3 | [
"CC-BY-3.0"
] | 5 | 2016-05-30T07:03:12.000Z | 2021-12-11T00:29:44.000Z | # -*- coding: utf-8 -*-
from __future__ import print_function
__author__ = 'remram44' # https://github.com/remram44/usagestats
# usagestats = Anonymous usage statistics collector
import logging
import os
import platform
import time
import sys
import subprocess
from ospy.helpers import print_report
try:
import re... | 36.350617 | 110 | 0.579405 |
797eb9641a7a4db8dea0599de7f356958cfcd857 | 281 | py | Python | r2_17.py | wonghoifung/learning-python | ad1691be1d185bfff828779a553b2c59d36d16ea | [
"MIT"
] | null | null | null | r2_17.py | wonghoifung/learning-python | ad1691be1d185bfff828779a553b2c59d36d16ea | [
"MIT"
] | null | null | null | r2_17.py | wonghoifung/learning-python | ad1691be1d185bfff828779a553b2c59d36d16ea | [
"MIT"
] | null | null | null | s = 'Elements are written as "<tag>text</tag>".'
import html
print s
#print html.escape(s)
s = 'Spicy "Jalapeño".'
#import HTMLParser
#p = HTMLParser()
#print p.unescape(s)
t = 'The prompt is >>>'
from xml.sax.saxutils import unescape
print unescape(t)
| 16.529412 | 48 | 0.686833 |
797eb9c24c623f41801d50aa7ea7ac6d90c8144e | 6,054 | py | Python | colossalai/nn/layer/moe/experts.py | mrriteshranjan/ColossalAI | 0d057a1bae67b915a385be7edab7da83413cb645 | [
"Apache-2.0"
] | null | null | null | colossalai/nn/layer/moe/experts.py | mrriteshranjan/ColossalAI | 0d057a1bae67b915a385be7edab7da83413cb645 | [
"Apache-2.0"
] | null | null | null | colossalai/nn/layer/moe/experts.py | mrriteshranjan/ColossalAI | 0d057a1bae67b915a385be7edab7da83413cb645 | [
"Apache-2.0"
] | null | null | null | import math
import torch
import torch.nn as nn
from colossalai.global_variables import moe_env
from colossalai.context import ParallelMode, seed
from colossalai.utils import get_current_device
class MoeExperts(nn.Module):
def __init__(self, comm: str):
super().__init__()
assert comm... | 36.46988 | 108 | 0.62884 |
797eb9e8fd2ce537394cb4db3d7c9d110c171bfc | 4,657 | py | Python | garage_system/mod_main/controllers.py | ggljzr/mi-dip-impl | 3e61f97c2b78ba5b65125d4e35a5da1a26ae9b3d | [
"MIT"
] | null | null | null | garage_system/mod_main/controllers.py | ggljzr/mi-dip-impl | 3e61f97c2b78ba5b65125d4e35a5da1a26ae9b3d | [
"MIT"
] | null | null | null | garage_system/mod_main/controllers.py | ggljzr/mi-dip-impl | 3e61f97c2b78ba5b65125d4e35a5da1a26ae9b3d | [
"MIT"
] | null | null | null | from flask import Blueprint, render_template, request, redirect, url_for, flash, session
from math import ceil
from jinja2 import Markup
from .models.garage import Garage
from .forms import GarageFormBuilder, GarageForm, UserSettingsForm
from .filters import Filters
from garage_system.mod_auth.auth_utils import logi... | 27.233918 | 88 | 0.668027 |
797ebb1cc15df9db333bcbacab7ad63dee57b98c | 323 | py | Python | CholeskyNumpy.py | anhquannguyen21/Cholesky-Factorization | 3a6e589ff8211a4f85163431d062821dec357ce2 | [
"MIT"
] | null | null | null | CholeskyNumpy.py | anhquannguyen21/Cholesky-Factorization | 3a6e589ff8211a4f85163431d062821dec357ce2 | [
"MIT"
] | null | null | null | CholeskyNumpy.py | anhquannguyen21/Cholesky-Factorization | 3a6e589ff8211a4f85163431d062821dec357ce2 | [
"MIT"
] | null | null | null | import numpy as np
A=np.array([[1,-2j],[2j,5]])
print(A)
#A=L.dot(L^H) with A is positive definite matrix and L is lower triangular matrix.
L=np.linalg.cholesky(A)
print(L)
print(L.dot(L.T.conj()))
a=np.array([[4,12,-16],[12,37,-43],[-16,-43,98]])
L=np.linalg.cholesky(a)
print(L)
L_T=L.transpose()
print(L.dot(L_T)... | 17 | 82 | 0.653251 |
797ebcbaabb5493640ab3a9c6649e58169116402 | 2,127 | py | Python | components/level.py | dsmordasov/drl | 028bea6a5f9cc2ac459b32befde5d061bab71639 | [
"Unlicense"
] | null | null | null | components/level.py | dsmordasov/drl | 028bea6a5f9cc2ac459b32befde5d061bab71639 | [
"Unlicense"
] | null | null | null | components/level.py | dsmordasov/drl | 028bea6a5f9cc2ac459b32befde5d061bab71639 | [
"Unlicense"
] | null | null | null | from __future__ import annotations
from typing import TYPE_CHECKING
from components.base_component import BaseComponent
if TYPE_CHECKING:
from entity import Actor
class Level(BaseComponent):
parent: Actor
def __init__(
self,
current_level: int = 1,
current_xp: int = 0,
l... | 28.743243 | 83 | 0.6441 |
797ebcd45f6355bd99f491937b812a1c6fbd0814 | 1,451 | py | Python | 2-svm/code/gen_test_data.py | lukaselmer/ethz-data-mining | cb4215c202efc37f3626a25c8301a4ac36813493 | [
"MIT"
] | 2 | 2015-01-24T18:22:33.000Z | 2019-08-14T06:30:58.000Z | 2-svm/code/gen_test_data.py | lukaselmer/ethz-data-mining | cb4215c202efc37f3626a25c8301a4ac36813493 | [
"MIT"
] | null | null | null | 2-svm/code/gen_test_data.py | lukaselmer/ethz-data-mining | cb4215c202efc37f3626a25c8301a4ac36813493 | [
"MIT"
] | 2 | 2016-01-15T21:12:32.000Z | 2019-08-14T06:30:59.000Z | #!/usr/bin/env python2.7
import sys
import math
import numpy as np
import scipy
from sklearn import linear_model
from sklearn.svm import LinearSVC
#from sklearn.multiclass import OneVsRestClassifier
#from sklearn.svm import LinearSVC
#from sklearn.metrics import accuracy_score
#from sklearn import cross_validation
... | 22.323077 | 80 | 0.608546 |
797ebd4fc9c81c5a356e8b755ed2a5bd7c1093b4 | 229 | py | Python | tests/conftest.py | bkc/pysbe | 6d3e023f63e4874ebbd8d0d3973df8a2b3bc7e30 | [
"Apache-2.0"
] | 2 | 2018-12-07T17:05:14.000Z | 2022-01-17T19:40:45.000Z | tests/conftest.py | bkc/pysbe | 6d3e023f63e4874ebbd8d0d3973df8a2b3bc7e30 | [
"Apache-2.0"
] | 216 | 2018-04-14T22:24:30.000Z | 2019-08-18T17:53:22.000Z | tests/conftest.py | bkc/pysbe | 6d3e023f63e4874ebbd8d0d3973df8a2b3bc7e30 | [
"Apache-2.0"
] | null | null | null | import os
import pytest
@pytest.fixture
def test_data_dir():
"""return path to test data directory"""
return os.path.join(
os.path.dirname(
os.path.abspath(__file__)
),
'data',
)
| 16.357143 | 44 | 0.576419 |
797ebdbe87cd8c2eee3d3ff71fc699fe0a6f882e | 2,072 | py | Python | scripts/import_data/import_conferences.py | panla/kesousou | df6751b0a2e8eeec5122418cd29fe1f99e23f39e | [
"MIT"
] | 1 | 2021-04-27T01:18:45.000Z | 2021-04-27T01:18:45.000Z | scripts/import_data/import_conferences.py | panla/kesousou | df6751b0a2e8eeec5122418cd29fe1f99e23f39e | [
"MIT"
] | 5 | 2020-08-26T14:47:47.000Z | 2021-03-22T08:56:43.000Z | scripts/import_data/import_conferences.py | panla/kesousou | df6751b0a2e8eeec5122418cd29fe1f99e23f39e | [
"MIT"
] | null | null | null | import argparse
import json
import os
import sys
import django
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))))
parser = argparse.ArgumentParser()
parser.add_argument('-i', '--input', type=str, required=True)
args = parser.parse_args()
input_dir = args.input
if not os.... | 32.888889 | 96 | 0.633687 |
797ebe35bc23dbeddf7b814cf45bc8af13424f91 | 773 | py | Python | src/python33/menuPlugins/sample.py | charlesdaniels/hercm | 6d1053576355cecf1164832a36b77cdce625974c | [
"BSD-3-Clause"
] | null | null | null | src/python33/menuPlugins/sample.py | charlesdaniels/hercm | 6d1053576355cecf1164832a36b77cdce625974c | [
"BSD-3-Clause"
] | 32 | 2015-08-07T14:07:06.000Z | 2016-01-18T16:31:45.000Z | src/python33/menuPlugins/sample.py | charlesdaniels/hercm | 6d1053576355cecf1164832a36b77cdce625974c | [
"BSD-3-Clause"
] | null | null | null | import masterPlugin
## blank sample plugin
#
# Doesn't actually do anything, just demonstrates how to do plugins.
class sample(masterPlugin.masterPlugin):
def __init__(this):
super().__init__()
this.command = "sample"
this.aliases = None
this.commandInfo['help'] = """This command ... | 33.608696 | 79 | 0.666235 |
797ebe92fafb9a0e9a71f9e26a7ab1e3f365263b | 5,358 | py | Python | nitorch/data.py | ArneBinder/Pytorch-LRP | c17902138f1d560f1f5d38f401ac856e071a5800 | [
"BSD-3-Clause"
] | 117 | 2019-03-19T08:47:03.000Z | 2022-03-31T04:14:51.000Z | nitorch/data.py | ArneBinder/Pytorch-LRP | c17902138f1d560f1f5d38f401ac856e071a5800 | [
"BSD-3-Clause"
] | 10 | 2019-09-15T14:59:43.000Z | 2022-03-15T14:18:02.000Z | nitorch/data.py | ArneBinder/Pytorch-LRP | c17902138f1d560f1f5d38f401ac856e071a5800 | [
"BSD-3-Clause"
] | 49 | 2019-03-19T08:47:03.000Z | 2021-11-30T01:02:04.000Z | import numpy as np
import nibabel as nib
from scipy.ndimage.interpolation import zoom
import matplotlib.pyplot as plt
import nibabel
import os
def load_nifti(file_path, dtype=np.float32, incl_header=False, z_factor=None, mask=None):
"""
Loads a volumetric image in nifti format (extensions .nii, .nii.gz etc.)
... | 34.567742 | 94 | 0.609183 |
797ebf469f7633eeada26e4848902e2c4ee1c7fb | 13,616 | py | Python | tests/test_resources.py | natbusa/datalabframework | 77f1249f55c76f20f2ef6253c0af2f1943f36226 | [
"MIT"
] | 21 | 2018-09-01T05:50:54.000Z | 2019-06-17T08:39:18.000Z | tests/test_resources.py | natbusa/datafaucet | 77f1249f55c76f20f2ef6253c0af2f1943f36226 | [
"MIT"
] | 9 | 2018-09-06T12:02:58.000Z | 2019-04-15T16:52:52.000Z | tests/test_resources.py | natbusa/datalabframework | 77f1249f55c76f20f2ef6253c0af2f1943f36226 | [
"MIT"
] | 18 | 2017-06-27T22:00:36.000Z | 2019-07-03T09:45:39.000Z | from datafaucet.metadata import resource
from datafaucet.utils import merge
from datafaucet import paths
import os
import pytest
from testfixtures import TempDirectory
@pytest.fixture()
def tempdir():
with TempDirectory() as d:
original_dir = os.getcwd()
os.chdir(d.path)
d.write('main.ip... | 38.792023 | 307 | 0.584974 |
797ec03737b6473300d221af45cfef214422759a | 431 | py | Python | scripts/data_process/embedding2matrix.py | phasorhand/PyTorchText | dcadcba44af0c3731b82d9db1c77f2968d4feac0 | [
"MIT"
] | 1,136 | 2017-08-16T08:49:04.000Z | 2022-03-25T09:49:41.000Z | scripts/data_process/embedding2matrix.py | LydonL/PyTorchText | dcadcba44af0c3731b82d9db1c77f2968d4feac0 | [
"MIT"
] | 13 | 2017-08-29T10:13:03.000Z | 2019-12-19T05:37:17.000Z | scripts/data_process/embedding2matrix.py | LydonL/PyTorchText | dcadcba44af0c3731b82d9db1c77f2968d4feac0 | [
"MIT"
] | 383 | 2017-08-16T08:45:55.000Z | 2022-03-30T06:34:09.000Z | #coding:utf8
'''
将embedding.txt 转成numpy矩阵
'''
import word2vec
import numpy as np
def main(em_file, em_result):
'''
embedding ->numpy
'''
em = word2vec.load(em_file)
vec = (em.vectors)
word2id = em.vocab_hash
# d = dict(vector = vec, word2id = word2id)
# t.save(d,em_result)
np.sav... | 17.958333 | 61 | 0.647332 |
797ec144ac047f1ab61456dbc0ec3235dbe86398 | 7,120 | py | Python | model/model.py | peterhan91/Medical-Robust-Training | 02928666ddca6803ae6df8169c291d3f427c2970 | [
"MIT"
] | 6 | 2020-11-23T21:24:42.000Z | 2021-09-26T17:26:17.000Z | model/model.py | peterhan91/Medical-Robust-Training | 02928666ddca6803ae6df8169c291d3f427c2970 | [
"MIT"
] | null | null | null | model/model.py | peterhan91/Medical-Robust-Training | 02928666ddca6803ae6df8169c291d3f427c2970 | [
"MIT"
] | 1 | 2021-09-30T17:51:05.000Z | 2021-09-30T17:51:05.000Z | # codes are import from https://github.com/xternalz/WideResNet-pytorch/blob/master/wideresnet.py
# original author: xternalz
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
from utils import count_parameters
from model.dsbn import *
class Expression(nn.Module):
def __init__(self, f... | 34.396135 | 116 | 0.60323 |
797ec326c0c6c4db0932d3aa6302d77998d302cf | 1,808 | py | Python | lib/surface/domains/registrations/check_availability.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | null | null | null | lib/surface/domains/registrations/check_availability.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | 11 | 2020-02-29T02:51:12.000Z | 2022-03-30T23:20:08.000Z | lib/surface/domains/registrations/check_availability.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | 1 | 2020-07-24T18:47:35.000Z | 2020-07-24T18:47:35.000Z | # -*- coding: utf-8 -*- #
# Copyright 2019 Google 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 32.872727 | 77 | 0.762721 |
797ec36dba470ea74a457b0d2a23efbe1f22bf17 | 3,377 | py | Python | dataset/gen_test_V.py | Hyunmok-Park/GNN_hyunmok | 86e722ab9754b64819a3016f2530e3629a160565 | [
"MIT"
] | null | null | null | dataset/gen_test_V.py | Hyunmok-Park/GNN_hyunmok | 86e722ab9754b64819a3016f2530e3629a160565 | [
"MIT"
] | null | null | null | dataset/gen_test_V.py | Hyunmok-Park/GNN_hyunmok | 86e722ab9754b64819a3016f2530e3629a160565 | [
"MIT"
] | null | null | null | import os
import pickle
import numpy as np
from utils.topology import NetworkTopology, get_msg_graph
from model.gt_inference import Enumerate
from scipy.sparse import coo_matrix
import argparse
def mkdir(dir_name):
if not os.path.exists(dir_name):
os.makedirs(dir_name)
print('made directory {}'.format(dir_na... | 33.107843 | 109 | 0.603198 |
797ec3a6bb1a437b717056980bb156c8920dbbd2 | 29,980 | py | Python | tensorflow/contrib/learn/python/learn/estimators/linear.py | toptaldev92/tensorflow | 1fd1f65d1b0896149e44a1f105267c27994010d9 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/learn/python/learn/estimators/linear.py | toptaldev92/tensorflow | 1fd1f65d1b0896149e44a1f105267c27994010d9 | [
"Apache-2.0"
] | null | null | null | tensorflow/contrib/learn/python/learn/estimators/linear.py | toptaldev92/tensorflow | 1fd1f65d1b0896149e44a1f105267c27994010d9 | [
"Apache-2.0"
] | 1 | 2021-04-22T09:17:52.000Z | 2021-04-22T09:17:52.000Z | # Copyright 2016 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... | 41.181319 | 82 | 0.687358 |
797ec5312670e169a504a5bc5bc1121875a17ccc | 34,363 | py | Python | pyscf/pbc/tools/pywannier90.py | shufay/pyscf | c7ea840b012a59fce5fa4114ef3274a7cf00165e | [
"Apache-2.0"
] | 1 | 2021-01-07T15:26:49.000Z | 2021-01-07T15:26:49.000Z | pyscf/pbc/tools/pywannier90.py | shufay/pyscf | c7ea840b012a59fce5fa4114ef3274a7cf00165e | [
"Apache-2.0"
] | null | null | null | pyscf/pbc/tools/pywannier90.py | shufay/pyscf | c7ea840b012a59fce5fa4114ef3274a7cf00165e | [
"Apache-2.0"
] | 1 | 2020-07-09T20:34:10.000Z | 2020-07-09T20:34:10.000Z | # Copyright 2014-2020 The PySCF Developers. 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 appl... | 43.061404 | 196 | 0.567907 |
797ec59fb0403c112fbec6b3a5cec3b2e6d947f4 | 53 | py | Python | src/models/__init__.py | adamingas/peru-rivers | 64dc54ca348f462336959b36d7fde111e2e8b388 | [
"MIT"
] | null | null | null | src/models/__init__.py | adamingas/peru-rivers | 64dc54ca348f462336959b36d7fde111e2e8b388 | [
"MIT"
] | 4 | 2021-06-02T00:43:59.000Z | 2022-03-12T00:07:02.000Z | src/models/__init__.py | adamingas/peru-rivers | 64dc54ca348f462336959b36d7fde111e2e8b388 | [
"MIT"
] | null | null | null | """
Package for experiment creation and running.
"""
| 13.25 | 44 | 0.716981 |
797ec5c065165f86bfcb38a250e0681f99c75b0b | 2,411 | py | Python | stapled/core/taskcontext.py | greenhost/stapled | 86b9272adaf07549b7f2ecbd7950d9d327a8d06f | [
"Apache-2.0"
] | 9 | 2017-11-29T18:40:16.000Z | 2022-03-11T07:40:24.000Z | stapled/core/taskcontext.py | greenhost/stapled | 86b9272adaf07549b7f2ecbd7950d9d327a8d06f | [
"Apache-2.0"
] | 5 | 2017-11-29T18:31:53.000Z | 2021-06-01T22:02:18.000Z | stapled/core/taskcontext.py | greenhost/stapled | 86b9272adaf07549b7f2ecbd7950d9d327a8d06f | [
"Apache-2.0"
] | 1 | 2022-03-11T07:40:29.000Z | 2022-03-11T07:40:29.000Z | """
This module defines an extended version of the general purpose
:class:`scheduling.ScheduledTaskContext` for use in the OCSP daemon.
"""
from stapled.scheduling import ScheduledTaskContext
class StapleTaskContext(ScheduledTaskContext):
"""
Adds the following functionality to the
:class:`scheduling.Sche... | 38.887097 | 81 | 0.659892 |
797ec6777b814feca61429bd1b8e62f23ba39529 | 240 | py | Python | egg/resources/help.py | PythonForChange/Egg | 24fe5b9e95654ac41a2be46fbd0e5e7224bf70eb | [
"MIT"
] | null | null | null | egg/resources/help.py | PythonForChange/Egg | 24fe5b9e95654ac41a2be46fbd0e5e7224bf70eb | [
"MIT"
] | null | null | null | egg/resources/help.py | PythonForChange/Egg | 24fe5b9e95654ac41a2be46fbd0e5e7224bf70eb | [
"MIT"
] | null | null | null | from egg.resources.constants import white
from egg.resources.extensions import txt
def help():
T="Welcome to Pyfoch Egg:\nThe Pyfoch Egg-cosystem console\n\n"
T+=txt.read("egg/library/commands")
print(white+T)
return "done" | 30 | 67 | 0.725 |
797ec766364bfc871e25020715300db30e87c78f | 1,558 | py | Python | samples/sample.py | jglazner/daemon | 69fda3eb23df442c6f27c1aee099af4d7cad58f7 | [
"Apache-2.0"
] | null | null | null | samples/sample.py | jglazner/daemon | 69fda3eb23df442c6f27c1aee099af4d7cad58f7 | [
"Apache-2.0"
] | null | null | null | samples/sample.py | jglazner/daemon | 69fda3eb23df442c6f27c1aee099af4d7cad58f7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python2
import sys
import os
import time
import logging
import mimetypes
import traceback
from daemon import GenericDaemon
class SampleDaemon(GenericDaemon):
def __init__(self, pidfile, logger, **kwargs):
super(SampleDaemon, self).__init__(pidfile, logger, **kwargs)
def work(self):
... | 27.333333 | 89 | 0.571245 |
797ec971a7d965db6e243947875b8ff14f5b1708 | 1,002 | py | Python | gitfs/events/__init__.py | josephwinston/gitfs | 6d5387f75696f432ef0702017a92130d090bb999 | [
"Apache-2.0"
] | null | null | null | gitfs/events/__init__.py | josephwinston/gitfs | 6d5387f75696f432ef0702017a92130d090bb999 | [
"Apache-2.0"
] | null | null | null | gitfs/events/__init__.py | josephwinston/gitfs | 6d5387f75696f432ef0702017a92130d090bb999 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 PressLabs SRL
#
# 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,... | 25.05 | 74 | 0.767465 |
797eca32e707c46344d7a7e3074853d82cf47bb0 | 19,920 | py | Python | topology_test.py | josh-mckenzie/apache-cassandra-dtest | da6ad8317e18ebaa5e8b428df79d1da086a19dd9 | [
"Apache-2.0"
] | null | null | null | topology_test.py | josh-mckenzie/apache-cassandra-dtest | da6ad8317e18ebaa5e8b428df79d1da086a19dd9 | [
"Apache-2.0"
] | null | null | null | topology_test.py | josh-mckenzie/apache-cassandra-dtest | da6ad8317e18ebaa5e8b428df79d1da086a19dd9 | [
"Apache-2.0"
] | null | null | null | import re
import time
from threading import Thread
from unittest import skip
from cassandra import ConsistencyLevel
from ccmlib.node import TimeoutError, ToolError
from nose.plugins.attrib import attr
from dtest import Tester, debug, create_ks, create_cf
from tools.assertions import assert_almost_equal, assert_all, a... | 40.323887 | 149 | 0.618624 |
797ecb0cf0bc902ccb72b3722cce332a1b4cb38e | 227 | py | Python | ers_backend/timeframe_annotator/enums.py | dumoulinj/erf | ce38ba8acf8fed8dbf27fb85fa6c024540763286 | [
"MIT"
] | null | null | null | ers_backend/timeframe_annotator/enums.py | dumoulinj/erf | ce38ba8acf8fed8dbf27fb85fa6c024540763286 | [
"MIT"
] | null | null | null | ers_backend/timeframe_annotator/enums.py | dumoulinj/erf | ce38ba8acf8fed8dbf27fb85fa6c024540763286 | [
"MIT"
] | null | null | null | from django_enumfield import enum
class TimeframeAnnotationType(enum.Enum):
NONE = 0
POSITIVE = 1
NEGATIVE = 2
labels = {
NONE: "None",
POSITIVE: "Positive",
NEGATIVE: "Negative"
}
| 17.461538 | 41 | 0.594714 |
797ecebce22c39fce08430993334e0cb4be227e0 | 4,898 | py | Python | core/memeit.py | sameerkumar18/thugmeme | 47cb47454693cce2ef6532d71e9076958991d426 | [
"MIT"
] | 1 | 2020-02-21T08:14:26.000Z | 2020-02-21T08:14:26.000Z | core/memeit.py | sameerkumar18/thugmeme | 47cb47454693cce2ef6532d71e9076958991d426 | [
"MIT"
] | null | null | null | core/memeit.py | sameerkumar18/thugmeme | 47cb47454693cce2ef6532d71e9076958991d426 | [
"MIT"
] | null | null | null | import os
import uuid
from PIL import Image, ImageFont, ImageDraw, ImageOps
# from cv2 import CascadeClassifier, imread, cvtColor, COLOR_BGR2GRAY, rectangle
import cv2
from thugmeme.settings import OBJECT_STORAGE_PROVIDER, OBJECT_STORAGE_CREDENTIALS
from core.upload import Upload
from thugmeme.settings import STATIC... | 37.676923 | 120 | 0.625766 |
797ecf2c93f9ba382a8d6884cecc14c20f4bb182 | 716 | py | Python | algorithms/insertionsort.py | BrPetrus/GraphAndSortVisualisation | 1e4cedffa4e46a6b27cf2fb8d89135fd59363298 | [
"MIT"
] | null | null | null | algorithms/insertionsort.py | BrPetrus/GraphAndSortVisualisation | 1e4cedffa4e46a6b27cf2fb8d89135fd59363298 | [
"MIT"
] | null | null | null | algorithms/insertionsort.py | BrPetrus/GraphAndSortVisualisation | 1e4cedffa4e46a6b27cf2fb8d89135fd59363298 | [
"MIT"
] | null | null | null | from . import sort
class InsertionSort(sort.Sort):
def __init__(self, array):
super().__init__(array)
def sort(self):
for step in range(1, len(self.array)):
key = self.array[step]
j = step - 1
while j >= 0 and key < self.array[j]:
self.swap(... | 21.69697 | 49 | 0.473464 |
797ed03af1cb75cbd7d5fbc670c5f58827e050cf | 2,613 | py | Python | marketplace/deployer_util/set_app_labels.py | dineshmudrakola/marketplace-k8s-app-tools | 9039d4ea85faf6f4959f97e2db90f1a5ec4c5aec | [
"Apache-2.0"
] | 66 | 2018-07-23T01:29:35.000Z | 2021-12-27T15:16:57.000Z | marketplace/deployer_util/set_app_labels.py | dineshmudrakola/marketplace-k8s-app-tools | 9039d4ea85faf6f4959f97e2db90f1a5ec4c5aec | [
"Apache-2.0"
] | 282 | 2018-07-18T17:39:07.000Z | 2022-02-08T09:22:33.000Z | marketplace/deployer_util/set_app_labels.py | dineshmudrakola/marketplace-k8s-app-tools | 9039d4ea85faf6f4959f97e2db90f1a5ec4c5aec | [
"Apache-2.0"
] | 61 | 2018-07-18T11:47:03.000Z | 2022-01-16T21:12:20.000Z | #!/usr/bin/env python3
#
# Copyright 2018 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
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | 30.741176 | 78 | 0.708764 |
797ed0c905461cc9f1958b8e65a0b0ff1a08d365 | 4,167 | py | Python | safe_transaction_service/history/tests/test_index_service.py | metissafe/safe-transaction-service | 49eef20e77b56cdc9e3bf1d7e76e987aeb6a2694 | [
"MIT"
] | null | null | null | safe_transaction_service/history/tests/test_index_service.py | metissafe/safe-transaction-service | 49eef20e77b56cdc9e3bf1d7e76e987aeb6a2694 | [
"MIT"
] | 1 | 2022-02-28T21:28:09.000Z | 2022-02-28T21:28:09.000Z | safe_transaction_service/history/tests/test_index_service.py | tharsis/safe-transaction-service | b699e697caaf5ecccdc5618553cecdd0e21070b7 | [
"MIT"
] | null | null | null | from django.test import TestCase
from eth_account import Account
from web3 import Web3
from gnosis.eth.tests.ethereum_test_case import EthereumTestCaseMixin
from ..models import EthereumTx, MultisigTransaction, SafeStatus
from ..services.index_service import (
IndexService,
IndexServiceProvider,
Transact... | 42.958763 | 110 | 0.717783 |
797ed3fcb0836f25fb6277666ce0cbb7019b03ef | 5,127 | py | Python | code/vgg_face_senet.py | MaxKinny/kaggle_SMILE-Kinship-Recognizing | a8f1878931cb472a6c6caa8b2fb7a3e0a03d805c | [
"MIT"
] | 1 | 2021-07-27T12:08:07.000Z | 2021-07-27T12:08:07.000Z | code/vgg_face_senet.py | MaxKinny/kaggle_SMILE-Kinship-Recognizing | a8f1878931cb472a6c6caa8b2fb7a3e0a03d805c | [
"MIT"
] | 3 | 2020-01-28T22:13:44.000Z | 2022-02-09T23:31:31.000Z | code/vgg_face_senet.py | MaxKinny/kaggle_SMILE-Kinship-Recognizing | a8f1878931cb472a6c6caa8b2fb7a3e0a03d805c | [
"MIT"
] | null | null | null | from collections import defaultdict
from glob import glob
from random import choice, sample
import cv2
import numpy as np
import pandas as pd
from keras.callbacks import ModelCheckpoint, ReduceLROnPlateau
from keras.layers import Input, Dense, GlobalMaxPool2D, GlobalAvgPool2D, Concatenate, Multiply, Dropout, Subtract
... | 31.072727 | 113 | 0.665691 |
797ed41be90aa57e28bab6968fd9965778002a52 | 2,075 | py | Python | darts/core_games/PartyCommands.py | GabrielAmare/Darts | 182748d821b8c1838071f3b28724d0d9b095dcf9 | [
"MIT"
] | null | null | null | darts/core_games/PartyCommands.py | GabrielAmare/Darts | 182748d821b8c1838071f3b28724d0d9b095dcf9 | [
"MIT"
] | null | null | null | darts/core_games/PartyCommands.py | GabrielAmare/Darts | 182748d821b8c1838071f3b28724d0d9b095dcf9 | [
"MIT"
] | null | null | null | from abc import ABC
from typing import TypeVar, Generic
from darts.base_games import BaseConfig, BaseScore, BasePlayer
from darts.constants import PartyState
from darts.commands import Command, Undo, Redo, AddPlayer, AddPlayers, StartParty, AddScore
from darts.errors import InvalidScoreError, UnhandledCommand
from .Pa... | 35.775862 | 91 | 0.658313 |
797ed44ebda98a4bfd970626101c4ea9c4b9e480 | 430 | py | Python | cloud_on_the_fly/conftest.py | ultraNick/cloud_on_the_fly | 253ba1f65916aa7918102649f711b7db1a1680c8 | [
"Apache-1.1"
] | null | null | null | cloud_on_the_fly/conftest.py | ultraNick/cloud_on_the_fly | 253ba1f65916aa7918102649f711b7db1a1680c8 | [
"Apache-1.1"
] | null | null | null | cloud_on_the_fly/conftest.py | ultraNick/cloud_on_the_fly | 253ba1f65916aa7918102649f711b7db1a1680c8 | [
"Apache-1.1"
] | null | null | null | import pytest
from django.conf import settings
from django.test import RequestFactory
from cloud_on_the_fly.users.tests.factories import UserFactory
@pytest.fixture(autouse=True)
def media_storage(settings, tmpdir):
settings.MEDIA_ROOT = tmpdir.strpath
@pytest.fixture
def user() -> settings.AUTH_USER_MODEL:
... | 20.47619 | 62 | 0.790698 |
797ed51570ee819bd3107b3c45d633b4ae1bb6aa | 18,845 | py | Python | tools/js2c.py | RiyoCoder/v8 | e073edfc7dc990cc5f71c4e51ac27b19be16fcb7 | [
"BSD-3-Clause"
] | 1 | 2019-08-22T05:11:06.000Z | 2019-08-22T05:11:06.000Z | tools/js2c.py | RiyoCoder/v8 | e073edfc7dc990cc5f71c4e51ac27b19be16fcb7 | [
"BSD-3-Clause"
] | null | null | null | tools/js2c.py | RiyoCoder/v8 | e073edfc7dc990cc5f71c4e51ac27b19be16fcb7 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2012 the V8 project authors. 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
# noti... | 31.779089 | 98 | 0.684903 |
797ed51b0c0b3fe24bb894bb283940c30d6e184a | 543 | py | Python | algorithms/python/icube_root.py | rik0/rk-exempla | 811f859a0980b0636bbafa2656893d988c4d0e32 | [
"MIT"
] | 1 | 2017-02-20T21:04:47.000Z | 2017-02-20T21:04:47.000Z | algorithms/python/icube_root.py | rik0/rk-exempla | 811f859a0980b0636bbafa2656893d988c4d0e32 | [
"MIT"
] | null | null | null | algorithms/python/icube_root.py | rik0/rk-exempla | 811f859a0980b0636bbafa2656893d988c4d0e32 | [
"MIT"
] | 2 | 2017-02-20T21:04:49.000Z | 2021-05-18T11:29:16.000Z | import numbers
import sys
MAX_INT = sys.maxsize
def isign(x, y):
t = y >> 31
return (abs(x) ^ t)-t
def icube_root(x):
if x < 0:
x = -x
sign = -1
else:
sign = 1
if isinstance(x, numbers.Integral) and :
s = 30
y = 0
while s >= 0:
y *= 2
... | 18.1 | 46 | 0.372007 |
797ed51c7f46163559c9424d7bd91236a8e8ee71 | 12,863 | py | Python | tools/run_tests/artifacts/distribtest_targets.py | jsirois/grpc | 3b1b1a7dc0affae281d74ca70f17631d7fe81bc6 | [
"Apache-2.0"
] | null | null | null | tools/run_tests/artifacts/distribtest_targets.py | jsirois/grpc | 3b1b1a7dc0affae281d74ca70f17631d7fe81bc6 | [
"Apache-2.0"
] | 1 | 2019-10-19T23:20:04.000Z | 2019-10-19T23:20:04.000Z | tools/run_tests/artifacts/distribtest_targets.py | jsirois/grpc | 3b1b1a7dc0affae281d74ca70f17631d7fe81bc6 | [
"Apache-2.0"
] | 1 | 2019-10-19T22:55:21.000Z | 2019-10-19T22:55:21.000Z | #!/usr/bin/env python
# Copyright 2016 gRPC 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 License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 37.501458 | 93 | 0.604214 |
797ed54b7685516ee1bc1fd07d6f0027049893d6 | 8,646 | py | Python | scripts/fixing_redirects.py | Partlo/RoboCade | 89c49b3f793b96aeb9e75672fd150872eb52aa11 | [
"MIT"
] | null | null | null | scripts/fixing_redirects.py | Partlo/RoboCade | 89c49b3f793b96aeb9e75672fd150872eb52aa11 | [
"MIT"
] | null | null | null | scripts/fixing_redirects.py | Partlo/RoboCade | 89c49b3f793b96aeb9e75672fd150872eb52aa11 | [
"MIT"
] | null | null | null | #!/usr/bin/python
"""
Correct all redirect links in featured pages or only one page of each wiki.
Can be used with:
-featured Run over featured pages (for some Wikimedia wikis only)
¶ms;
"""
#
# (C) Pywikibot team, 2004-2021
#
# Distributed under the terms of the MIT license.
#
import re
from contextlib ... | 33.773438 | 79 | 0.555401 |
797ed702f38a683ee03aef5f01b6ca24f510ae1c | 1,958 | py | Python | CNN/model_test.py | vineeths96/FashionMNIST | ec8684e21296b84c78e08ee074a0aada62e10641 | [
"MIT"
] | null | null | null | CNN/model_test.py | vineeths96/FashionMNIST | ec8684e21296b84c78e08ee074a0aada62e10641 | [
"MIT"
] | null | null | null | CNN/model_test.py | vineeths96/FashionMNIST | ec8684e21296b84c78e08ee074a0aada62e10641 | [
"MIT"
] | null | null | null | import os
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2'
import tensorflow as tf
from CNN.model_parameters import *
# Uncomment for generating plots. Requires some libraries (see below)
"""
import seaborn as sns
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.metrics import confusion_matrix
from sklearn.m... | 31.580645 | 107 | 0.716037 |
797ed7243522d9487fd437b6592d15705bfd6331 | 678 | py | Python | stubs/micropython-v1_10-pyboard/gc.py | mattytrentini/micropython-stubs | 4d596273823b69e9e5bcf5fa67f249c374ee0bbc | [
"MIT"
] | null | null | null | stubs/micropython-v1_10-pyboard/gc.py | mattytrentini/micropython-stubs | 4d596273823b69e9e5bcf5fa67f249c374ee0bbc | [
"MIT"
] | null | null | null | stubs/micropython-v1_10-pyboard/gc.py | mattytrentini/micropython-stubs | 4d596273823b69e9e5bcf5fa67f249c374ee0bbc | [
"MIT"
] | null | null | null | """
Module: 'gc' on micropython-v1.10-pyboard
"""
# MCU: {'ver': 'v1.10', 'build': '', 'platform': 'pyboard', 'port': 'pyboard', 'machine': 'PYBv1.1 with STM32F405RG', 'release': '1.10.0', 'nodename': 'pyboard', 'name': 'micropython', 'family': 'micropython', 'sysname': 'pyboard', 'version': '1.10.0'}
# Stubber: 1.5.4
... | 19.371429 | 252 | 0.560472 |
797ed73e06c94e0da7db8511f5ccba90de3410ee | 137 | py | Python | Template.py | Eutrixoides/Advent-of-Code-2020 | 3d7036c8d16caa601b27fdc607f4b2aaf1ae5cb3 | [
"MIT"
] | null | null | null | Template.py | Eutrixoides/Advent-of-Code-2020 | 3d7036c8d16caa601b27fdc607f4b2aaf1ae5cb3 | [
"MIT"
] | null | null | null | Template.py | Eutrixoides/Advent-of-Code-2020 | 3d7036c8d16caa601b27fdc607f4b2aaf1ae5cb3 | [
"MIT"
] | null | null | null | inputs = open("input.txt", "r")
strlist = inputs.read().splitlines()
intlist = [int(i) for i in strlist]
for i in intlist:
input() | 17.125 | 36 | 0.642336 |
797edbfb2cb383a7dc20d1ce0e691d408ab8f88b | 987 | py | Python | jp.atcoder/abc099/abc099_c/8331270.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-09T03:06:25.000Z | 2022-02-09T03:06:25.000Z | jp.atcoder/abc099/abc099_c/8331270.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | 1 | 2022-02-05T22:53:18.000Z | 2022-02-09T01:29:30.000Z | jp.atcoder/abc099/abc099_c/8331270.py | kagemeka/atcoder-submissions | 91d8ad37411ea2ec582b10ba41b1e3cae01d4d6e | [
"MIT"
] | null | null | null | # author: kagemeka
# created: 2019-11-08 02:12:52(JST)
## internal modules
# import collections
import math
import sys
# import string
# import bisect
# import re
# import itertools
# import statistics
# import functools
# import operator
## external modul... | 22.953488 | 64 | 0.491388 |
797edc80c742e89b716dd30c7025291d1c394c9b | 2,161 | py | Python | share/qt/extract_strings_qt.py | ProximaCentauri1989/papara | 1b5d12aa501d07d7072bc7e75ae1421f9d68955d | [
"MIT"
] | null | null | null | share/qt/extract_strings_qt.py | ProximaCentauri1989/papara | 1b5d12aa501d07d7072bc7e75ae1421f9d68955d | [
"MIT"
] | null | null | null | share/qt/extract_strings_qt.py | ProximaCentauri1989/papara | 1b5d12aa501d07d7072bc7e75ae1421f9d68955d | [
"MIT"
] | 2 | 2022-01-04T14:22:47.000Z | 2022-01-25T08:32:05.000Z | #!/usr/bin/python
'''
Extract _("...") strings for translation and convert to Qt stringdefs so that
they can be picked up by Qt linguist.
'''
from __future__ import division,print_function,unicode_literals
from subprocess import Popen, PIPE
import glob
import operator
import os
import sys
OUT_CPP="qt/paparastrings.cpp... | 25.72619 | 105 | 0.619158 |
797edd29535d46a6556d5467c87d734b54b0ff82 | 140 | py | Python | profiles_api/urls.py | MerjemaSarajlija/Profile-python-django | ca6c7a3ffea2642e17d6728e4f1fd76fd75f9c40 | [
"MIT"
] | null | null | null | profiles_api/urls.py | MerjemaSarajlija/Profile-python-django | ca6c7a3ffea2642e17d6728e4f1fd76fd75f9c40 | [
"MIT"
] | null | null | null | profiles_api/urls.py | MerjemaSarajlija/Profile-python-django | ca6c7a3ffea2642e17d6728e4f1fd76fd75f9c40 | [
"MIT"
] | null | null | null | from django.urls import path
from profiles_api import views
urlpatterns = [
path('hello-view/', views.HelloApiView.as_view()) ,
]
| 20 | 60 | 0.707143 |
797edda4eb32d591db7b1b31d57d4780ba8415d4 | 4,134 | py | Python | Other Spider/beike_new_house.py | seasonZhu/AnimationSpider | 10c1e84eb2fb198560b554390fe415c538d42c5a | [
"MIT"
] | 6 | 2019-07-29T12:59:04.000Z | 2021-05-14T08:42:21.000Z | Other Spider/beike_new_house.py | seasonZhu/AnimationSpider | 10c1e84eb2fb198560b554390fe415c538d42c5a | [
"MIT"
] | null | null | null | Other Spider/beike_new_house.py | seasonZhu/AnimationSpider | 10c1e84eb2fb198560b554390fe415c538d42c5a | [
"MIT"
] | null | null | null | import requests
import json
import pandas as pd
from bs4 import BeautifulSoup
columns = ['title', 'place', 'msg', 'perMeter', 'price']
# 通过select获取信息
def getInfo(soup, selector):
infoString = '未知'
info = soup.select(selector)
if len(info) > 0:
infoString = info[0].get_text().replace('\n','').repla... | 35.033898 | 186 | 0.612724 |
797edf153ffd33ad0a73022813a5b187abb49349 | 391 | py | Python | vetcalc/wsgi.py | onnudilol/vetcalc | abb4729a5bb0387b66238468ae8d2fdaa6728014 | [
"MIT"
] | 2 | 2016-10-05T03:05:12.000Z | 2017-02-19T09:04:35.000Z | vetcalc/wsgi.py | onnudilol/vetcalc | abb4729a5bb0387b66238468ae8d2fdaa6728014 | [
"MIT"
] | null | null | null | vetcalc/wsgi.py | onnudilol/vetcalc | abb4729a5bb0387b66238468ae8d2fdaa6728014 | [
"MIT"
] | null | null | null | """
WSGI config for vetcalc project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.9/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTI... | 23 | 78 | 0.785166 |
797ee08e1cc91d64d70496bf38ac7eedf47840c4 | 13,574 | py | Python | day19/solve-19a.py | ggchappell/AdventOfCode2021 | b209f7e26684c35906958ce7b5ee65348041a3f9 | [
"MIT"
] | null | null | null | day19/solve-19a.py | ggchappell/AdventOfCode2021 | b209f7e26684c35906958ce7b5ee65348041a3f9 | [
"MIT"
] | null | null | null | day19/solve-19a.py | ggchappell/AdventOfCode2021 | b209f7e26684c35906958ce7b5ee65348041a3f9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Advent of Code 2021
# Glenn G. Chappell
import sys # .stdin
import re # .search
import itertools # .product, .combinations
import queue # .SimpleQueue
# ======================================================================
# NOTES
# =============================... | 27.422222 | 72 | 0.48394 |
797ee0bb9ca1d2b4733afe6645beae6ee66bc2cc | 84,501 | py | Python | molsysmt/forms/classes/attic/bck_api_openmm_Topology.py | uibcdf/MolSysMT | 9866a6fb090df9fff36af113a45164da4b674c09 | [
"MIT"
] | 3 | 2020-06-02T03:55:52.000Z | 2022-03-21T04:43:52.000Z | molsysmt/forms/classes/attic/bck_api_openmm_Topology.py | uibcdf/MolSysMT | 9866a6fb090df9fff36af113a45164da4b674c09 | [
"MIT"
] | 28 | 2020-06-24T00:55:53.000Z | 2021-07-16T22:09:19.000Z | molsysmt/forms/classes/attic/bck_api_openmm_Topology.py | uibcdf/MolSysMT | 9866a6fb090df9fff36af113a45164da4b674c09 | [
"MIT"
] | 1 | 2021-06-17T18:55:25.000Z | 2021-06-17T18:55:25.000Z | from os.path import basename as _basename
from simtk.openmm.app import Topology as _simtk_openmm_app_Topology
from numpy import array as _array, unique as _unique, ndenumerate as _ndenumerate, concatenate as _concatenate
from numpy import arange as _arange, hstack as _hstack, empty as _empty
form_name=_basename(__file... | 33.746406 | 123 | 0.739021 |
797ee25546a3f9b71ea06dbc8222b77fa78648f8 | 435 | py | Python | pypi_org/app.py | wccalvin/learn-flask | 384a28a534268152292cc97f5a96cccbf78b9adf | [
"MIT"
] | null | null | null | pypi_org/app.py | wccalvin/learn-flask | 384a28a534268152292cc97f5a96cccbf78b9adf | [
"MIT"
] | null | null | null | pypi_org/app.py | wccalvin/learn-flask | 384a28a534268152292cc97f5a96cccbf78b9adf | [
"MIT"
] | null | null | null | import flask
app = flask.Flask(__name__)
def get_latest_packages():
return [
{"name": "flask", "version": "1.2.3"},
{"name": "sqlalchemy", "version": "2.1.0"},
{"name": "passlib", "version": "0.3.2"},
]
@app.route("/")
def index():
test_packages = get_latest_packages()
retur... | 19.772727 | 70 | 0.6 |
797ee275dfb762efba7a99b9441f6f0bb29bbd41 | 1,724 | py | Python | src/data/coco/preprocess_offline.py | NeurAI-Lab/biHomE | 204b7f8ea5b6f4a7245dc90f9930a5ccfea49431 | [
"MIT"
] | 19 | 2021-09-09T10:30:10.000Z | 2022-03-19T08:28:30.000Z | src/data/coco/preprocess_offline.py | NeurAI-Lab/biHomE | 204b7f8ea5b6f4a7245dc90f9930a5ccfea49431 | [
"MIT"
] | 7 | 2021-10-23T01:24:48.000Z | 2022-03-15T19:36:10.000Z | src/data/coco/preprocess_offline.py | NeurAI-Lab/biHomE | 204b7f8ea5b6f4a7245dc90f9930a5ccfea49431 | [
"MIT"
] | 1 | 2021-11-02T21:53:12.000Z | 2021-11-02T21:53:12.000Z | import os
import argparse
from torchvision import transforms
from src.data.coco.dataset import Dataset
from src.data.transforms import Rescale, CenterCrop
def main(raw_dataset_root, output_dataset_root):
###########################################################################
# Prepare output dir
###... | 39.181818 | 116 | 0.475058 |
797ee2a712ca42322a23a030f3958f52908f10b0 | 1,089 | py | Python | fabric_ubuntu/node.py | btmorex/fabric-apt | e4a76562401e5868a611a950b98fe0ab75203ed2 | [
"MIT"
] | null | null | null | fabric_ubuntu/node.py | btmorex/fabric-apt | e4a76562401e5868a611a950b98fe0ab75203ed2 | [
"MIT"
] | null | null | null | fabric_ubuntu/node.py | btmorex/fabric-apt | e4a76562401e5868a611a950b98fe0ab75203ed2 | [
"MIT"
] | null | null | null | from fabric.api import hide, put, run, settings, task
from StringIO import StringIO
from . import apt
@task
def ensure():
with settings(user='root'):
run('wget --quiet https://deb.nodesource.com/gpgkey/nodesource.gpg.key')
run('apt-key add nodesource.gpg.key')
run('rm nodesource.gpg.key')
... | 37.551724 | 91 | 0.617998 |
797ee2ada04ff2ac866ec01c9b8e1494b9a1a51d | 7,994 | py | Python | benchmark/cifar10/cifar10_pytorch.py | animeshtrivedi/surf-ml | 73102c69f303d5b289841e6116a607561e36595c | [
"Apache-2.0"
] | null | null | null | benchmark/cifar10/cifar10_pytorch.py | animeshtrivedi/surf-ml | 73102c69f303d5b289841e6116a607561e36595c | [
"Apache-2.0"
] | null | null | null | benchmark/cifar10/cifar10_pytorch.py | animeshtrivedi/surf-ml | 73102c69f303d5b289841e6116a607561e36595c | [
"Apache-2.0"
] | null | null | null | '''
Cifar10 example in pytorch
https://github.com/pytorch/tutorials/blob/master/beginner_source/blitz/cifar10_tutorial.py
'''
from __future__ import print_function
import argparse
import torch
import torch.nn as nn
import torch.nn.functional as F
import os
import torch.optim as optim
from torchvision import datasets,... | 35.6875 | 112 | 0.59332 |
797ee2e805be335b0f570d92b43aa5a6455ff40c | 194,854 | py | Python | lifelines/tests/test_estimation.py | lordqyxz/lifelines | 5c8a7b136e2fd341836772745af009504947ea9e | [
"MIT"
] | null | null | null | lifelines/tests/test_estimation.py | lordqyxz/lifelines | 5c8a7b136e2fd341836772745af009504947ea9e | [
"MIT"
] | null | null | null | lifelines/tests/test_estimation.py | lordqyxz/lifelines | 5c8a7b136e2fd341836772745af009504947ea9e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import warnings
# pylint: disable=wrong-import-position
warnings.simplefilter(action="ignore", category=DeprecationWarning)
from collections import Counter, Iterable
import os
import pickle
from itertools import combinations
from io import StringIO, BytesIO as stringio
import numpy as np
imp... | 40.225846 | 196 | 0.595892 |
797ee39ab18c5658c14320d3fb50411342b6e211 | 19,123 | py | Python | src/cli/onefuzz/cli.py | tonybaloney/onefuzz | e0f2e9ed5aae006e0054387de7a0ff8c83c8f722 | [
"MIT"
] | 2,692 | 2020-09-15T17:54:21.000Z | 2022-03-31T11:58:57.000Z | src/cli/onefuzz/cli.py | tonybaloney/onefuzz | e0f2e9ed5aae006e0054387de7a0ff8c83c8f722 | [
"MIT"
] | 980 | 2020-09-18T18:23:01.000Z | 2022-03-30T22:20:43.000Z | src/cli/onefuzz/cli.py | nharper285/onefuzz | 1de2cc841d6fc885f8bcb6d032bf5b96ddb52493 | [
"MIT"
] | 177 | 2020-09-16T00:10:56.000Z | 2022-03-30T21:18:10.000Z | #!/usr/bin/env python
#
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
"""
Simple CLI builder on top of a defined API (used for OneFuzz)
"""
import argparse
import datetime
import inspect
import json
import logging
import os
import sys
import traceback
from enum import Enum
from typing impor... | 32.193603 | 98 | 0.559431 |
797ee3a2084458baf45271863d35d30b2e45cb2b | 140 | py | Python | tnt.py | dotenorio/minecraft-pi-python | 52eda63d79f7ddd3274442dac6f0ea2fdae13542 | [
"MIT"
] | null | null | null | tnt.py | dotenorio/minecraft-pi-python | 52eda63d79f7ddd3274442dac6f0ea2fdae13542 | [
"MIT"
] | null | null | null | tnt.py | dotenorio/minecraft-pi-python | 52eda63d79f7ddd3274442dac6f0ea2fdae13542 | [
"MIT"
] | null | null | null | import mcpi.minecraft as minecraft
mc = minecraft.Minecraft.create()
tnt = 46
x, y, z = mc.player.getPos()
mc.setBlock(x+1, y, z, tnt, 1) | 17.5 | 34 | 0.685714 |
797ee3b735c5d429e85f46193c131217cb5d26fe | 879 | py | Python | reservations/tests/test_employee_api.py | kkarolis/cct-subsilocus | b2fd38a184550203410aa29248a6e5d6160acc19 | [
"MIT"
] | 1 | 2020-03-04T18:23:30.000Z | 2020-03-04T18:23:30.000Z | reservations/tests/test_employee_api.py | kkarolis/cct-subsilocus | b2fd38a184550203410aa29248a6e5d6160acc19 | [
"MIT"
] | 5 | 2021-03-18T23:45:40.000Z | 2021-06-10T18:27:09.000Z | reservations/tests/test_employee_api.py | kkarolis/cct-subsilocus | b2fd38a184550203410aa29248a6e5d6160acc19 | [
"MIT"
] | null | null | null | from django.urls import reverse
from rest_framework import status
from .common import APITestCommonCase
class TestEmployeeEndpoint(APITestCommonCase):
def setUp(self):
super().setUp()
self.url = reverse("employee-list")
def test_creating_employee(self):
with self.get_authenticated_c... | 33.807692 | 75 | 0.705347 |
797ee428c2274085d78b6b527a6f54cd293735cb | 194 | py | Python | html/app/__test_gaurd.py | iotech-systems/omms-ui | f656242e0a3cec35de1edacd7f100371b8e903b0 | [
"Apache-2.0"
] | null | null | null | html/app/__test_gaurd.py | iotech-systems/omms-ui | f656242e0a3cec35de1edacd7f100371b8e903b0 | [
"Apache-2.0"
] | null | null | null | html/app/__test_gaurd.py | iotech-systems/omms-ui | f656242e0a3cec35de1edacd7f100371b8e903b0 | [
"Apache-2.0"
] | null | null | null |
import core.guard as guard
c = "openbms-session=f2c584968e824911af89e406fe4f4999; Expiers=Wed, 03-Nov-2021 00:06:28 GMT;"
g: guard.guard = guard.guard()
robj = g.check_session(c)
print(robj)
| 21.555556 | 94 | 0.752577 |
797ee45f7936eeef76da15d504be68becce30590 | 16,026 | py | Python | PaddleNLP/Research/ACL2019-DuConv/retrieval_paddle/source/inputters/data_provider.py | FrancisLiang/models-1 | e14d5bc1ab36d0dd11977f27cff54605bf99c945 | [
"Apache-2.0"
] | 1,319 | 2020-02-14T10:42:07.000Z | 2022-03-31T15:42:18.000Z | PaddleNLP/Research/ACL2019-DuConv/retrieval_paddle/source/inputters/data_provider.py | FrancisLiang/models-1 | e14d5bc1ab36d0dd11977f27cff54605bf99c945 | [
"Apache-2.0"
] | 192 | 2020-02-14T02:53:34.000Z | 2022-03-31T02:25:48.000Z | PaddleNLP/Research/ACL2019-DuConv/retrieval_paddle/source/inputters/data_provider.py | FrancisLiang/models-1 | e14d5bc1ab36d0dd11977f27cff54605bf99c945 | [
"Apache-2.0"
] | 720 | 2020-02-14T02:12:38.000Z | 2022-03-31T12:21:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
######################################################################
# Copyright (c) 2019 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# ... | 34.83913 | 100 | 0.578185 |
797ee56b0930cdd59221a8800be8129fc6c608e8 | 485 | py | Python | src/garage/np/baselines/zero_baseline.py | Maltimore/garage | a3f44b37eeddca37d157766a9a72e8772f104bcd | [
"MIT"
] | 1 | 2020-02-19T00:01:29.000Z | 2020-02-19T00:01:29.000Z | src/garage/np/baselines/zero_baseline.py | Maltimore/garage | a3f44b37eeddca37d157766a9a72e8772f104bcd | [
"MIT"
] | null | null | null | src/garage/np/baselines/zero_baseline.py | Maltimore/garage | a3f44b37eeddca37d157766a9a72e8772f104bcd | [
"MIT"
] | 1 | 2020-02-13T12:05:35.000Z | 2020-02-13T12:05:35.000Z | import numpy as np
from garage.np.baselines.base import Baseline
class ZeroBaseline(Baseline):
def __init__(self, env_spec):
pass
def get_param_values(self, **kwargs):
return None
def set_param_values(self, val, **kwargs):
pass
def fit(self, paths):
pass
def p... | 19.4 | 65 | 0.641237 |
797ee67dbc458426d053a5d7f6ad8393fea442c3 | 8,155 | py | Python | venv/Lib/site-packages/h5py/tests/test_dimension_scales.py | Westlanderz/AI-Plat1 | 1187c22819e5135e8e8189c99b86a93a0d66b8d8 | [
"MIT"
] | 1 | 2022-01-08T12:30:44.000Z | 2022-01-08T12:30:44.000Z | venv/Lib/site-packages/h5py/tests/test_dimension_scales.py | Westlanderz/AI-Plat1 | 1187c22819e5135e8e8189c99b86a93a0d66b8d8 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/h5py/tests/test_dimension_scales.py | Westlanderz/AI-Plat1 | 1187c22819e5135e8e8189c99b86a93a0d66b8d8 | [
"MIT"
] | null | null | null | # This file is part of h5py, a Python interface to the HDF5 library.
#
# http://www.h5py.org
#
# Copyright 2008-2013 Andrew Collette and contributors
#
# License: Standard 3-clause BSD; see "license.txt" for full license terms
# and contributor agreement.
import sys
import numpy as np
from .c... | 38.107477 | 80 | 0.573268 |
797ee72ed70a68118238f204f24b661e9227fbaf | 3,257 | py | Python | cscs-checks/mch/openacc_cuda_mpi_cppstd.py | toxa81/reframe | 81357405c0c53ba9def4048c29774c867c69adc2 | [
"BSD-3-Clause"
] | null | null | null | cscs-checks/mch/openacc_cuda_mpi_cppstd.py | toxa81/reframe | 81357405c0c53ba9def4048c29774c867c69adc2 | [
"BSD-3-Clause"
] | null | null | null | cscs-checks/mch/openacc_cuda_mpi_cppstd.py | toxa81/reframe | 81357405c0c53ba9def4048c29774c867c69adc2 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2016-2021 Swiss National Supercomputing Centre (CSCS/ETH Zurich)
# ReFrame Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
import reframe as rfm
import reframe.utility.osext as osext
import reframe.utility.sanity as sn
@rfm.simple_test
class Opena... | 40.7125 | 76 | 0.56156 |
797ee8114cb796a258e5e5475ea595def0309d71 | 8,407 | py | Python | samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py | tek08/openapi-generator | 5d14b46a5e305b8f1c541b1d6d96751f0626e363 | [
"Apache-2.0"
] | null | null | null | samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py | tek08/openapi-generator | 5d14b46a5e305b8f1c541b1d6d96751f0626e363 | [
"Apache-2.0"
] | null | null | null | samples/openapi3/client/petstore/python/petstore_api/api/fake_classname_tags_123_api.py | tek08/openapi-generator | 5d14b46a5e305b8f1c541b1d6d96751f0626e363 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
OpenAPI Petstore
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
... | 38.741935 | 174 | 0.590579 |
797ee8dd63027d804f876337f1cdba117db6d872 | 1,661 | py | Python | dyslexia/io/load_image.py | YounessDataV/batch9_dyslexia | ec40ac0b79e7269ddc543e55ddc7a241ca313524 | [
"MIT"
] | null | null | null | dyslexia/io/load_image.py | YounessDataV/batch9_dyslexia | ec40ac0b79e7269ddc543e55ddc7a241ca313524 | [
"MIT"
] | null | null | null | dyslexia/io/load_image.py | YounessDataV/batch9_dyslexia | ec40ac0b79e7269ddc543e55ddc7a241ca313524 | [
"MIT"
] | null | null | null | from typing import Union, IO
from pathlib import Path
from PIL import Image, ExifTags
import cv2
import numpy as np
def crop_black_border(img):
tmp = img.copy()
if len(img.shape) == 3:
tmp = cv2.cvtColor(tmp, cv2.COLOR_BGR2GRAY)
_, thresh = cv2.threshold(tmp, 1, 255, cv2.THRESH_BINARY)
... | 26.790323 | 87 | 0.621312 |
797ee9b4e7a41b78962a56971eaaec236499c240 | 816 | py | Python | spark_auto_mapper_fhir/value_sets/v2_0165.py | imranq2/SparkAutoMapper.FHIR | dd23b218fb0097d1edc2f3e688e8d6d4d7278bd2 | [
"Apache-2.0"
] | 1 | 2020-10-31T23:25:07.000Z | 2020-10-31T23:25:07.000Z | spark_auto_mapper_fhir/value_sets/v2_0165.py | icanbwell/SparkAutoMapper.FHIR | 98f368e781b46523142c7cb513c670d659a93c9b | [
"Apache-2.0"
] | null | null | null | spark_auto_mapper_fhir/value_sets/v2_0165.py | icanbwell/SparkAutoMapper.FHIR | 98f368e781b46523142c7cb513c670d659a93c9b | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
from spark_auto_mapper_fhir.fhir_types.uri import FhirUri
from spark_auto_mapper_fhir.value_sets.generic_type import GenericTypeCode
from spark_auto_mapper.type_definitions.defined_types import AutoMapperTextInputType
# This file is auto-generated by generate_classes so do not edi... | 31.384615 | 84 | 0.758578 |
797eea12f1eb22d7a3110ce5f8e212403c68926a | 288 | py | Python | pyro/params/__init__.py | gavincangan/pyro | d9115a6da7edd7e3fecd6b89a850cc137d7e7e9a | [
"MIT"
] | 2 | 2019-01-26T01:53:31.000Z | 2020-02-26T17:39:17.000Z | pyro/params/__init__.py | gavincangan/pyro | d9115a6da7edd7e3fecd6b89a850cc137d7e7e9a | [
"MIT"
] | 4 | 2019-01-31T17:54:03.000Z | 2019-02-07T07:09:51.000Z | pyro/params/__init__.py | gavincangan/pyro | d9115a6da7edd7e3fecd6b89a850cc137d7e7e9a | [
"MIT"
] | 1 | 2018-10-02T18:50:33.000Z | 2018-10-02T18:50:33.000Z | from __future__ import absolute_import, division, print_function
from pyro.params.param_store import module_from_param_with_module_name, param_with_module_name, user_param_name
__all__ = [
"module_from_param_with_module_name",
"param_with_module_name",
"user_param_name",
]
| 28.8 | 111 | 0.822917 |
797eea54747e246ec76e5fb4b9a20a2a26474717 | 1,140 | py | Python | month02/多进程并发模型/IO/day16/poll_server.py | chaofan-zheng/python_leanring_code | 0af44ff39b9ded2c1d2cc96c6d356d21170ac04d | [
"Apache-2.0"
] | 4 | 2021-01-07T14:25:10.000Z | 2021-02-01T10:36:01.000Z | month02/多进程并发模型/IO/day16/poll_server.py | chaofan-zheng/python_leanring_code | 0af44ff39b9ded2c1d2cc96c6d356d21170ac04d | [
"Apache-2.0"
] | null | null | null | month02/多进程并发模型/IO/day16/poll_server.py | chaofan-zheng/python_leanring_code | 0af44ff39b9ded2c1d2cc96c6d356d21170ac04d | [
"Apache-2.0"
] | null | null | null | """
IO并发模型 基于poll方法 tcp
"""
from socket import *
from select import *
HOST = '0.0.0.0'
PORT = 8888
ADDR = (HOST,PORT)
# 创建tcp套接字连接客户端,处理请求
tcp_socket = socket()
tcp_socket.bind(ADDR)
tcp_socket.listen(5)
# 设置为非阻塞IO
tcp_socket.setblocking(False)
p = poll() # 创建poll对象
# 设置监控
p.register(tcp_socket,POLLIN)
# 查找字典 时刻与关... | 20.357143 | 48 | 0.55 |
797eea644896f50b8b75ecb00d0e578f98670671 | 25 | py | Python | redbrick/coco/tests/__init__.py | dereklukacs/redbrick-sdk | 4cf93444c1d808694c1601334f9e039e616dfd3d | [
"MIT"
] | 1 | 2020-11-26T04:25:15.000Z | 2020-11-26T04:25:15.000Z | redbrick/coco/tests/__init__.py | redbrick-ai/redbrick-sdk | 4cf93444c1d808694c1601334f9e039e616dfd3d | [
"MIT"
] | 33 | 2021-02-04T17:51:53.000Z | 2022-03-17T07:28:36.000Z | redbrick/coco/tests/__init__.py | dereklukacs/redbrick-sdk | 4cf93444c1d808694c1601334f9e039e616dfd3d | [
"MIT"
] | 1 | 2021-06-09T10:06:35.000Z | 2021-06-09T10:06:35.000Z | """COCO format tests."""
| 12.5 | 24 | 0.6 |
797eec7f12d0cf50e6e844079d7ff87ea4d041fb | 3,992 | py | Python | lib/coco.py | russelldj/BiSeNet | d29fa741ad5275fab9e1bfc237b02811acf73b98 | [
"MIT"
] | 966 | 2018-12-13T12:11:18.000Z | 2022-03-31T14:13:55.000Z | lib/coco.py | russelldj/BiSeNet | d29fa741ad5275fab9e1bfc237b02811acf73b98 | [
"MIT"
] | 214 | 2019-01-25T10:06:24.000Z | 2022-03-22T01:55:28.000Z | lib/coco.py | russelldj/BiSeNet | d29fa741ad5275fab9e1bfc237b02811acf73b98 | [
"MIT"
] | 247 | 2019-03-04T11:39:06.000Z | 2022-03-30T05:45:56.000Z | #!/usr/bin/python
# -*- encoding: utf-8 -*-
import os
import os.path as osp
import json
import torch
from torch.utils.data import Dataset, DataLoader
import torch.distributed as dist
import cv2
import numpy as np
import lib.transform_cv2 as T
from lib.sampler import RepeatedDistSampler
from lib.base_dataset import B... | 58.705882 | 141 | 0.727204 |
797eed3b113cbf5644ee5b1941ba3fac52d9877c | 4,159 | py | Python | account/tasks.py | fitahol/fitahol | ce84dc909aa98f2dc7594ef26568e015cbfe0e94 | [
"MIT"
] | 2 | 2017-02-20T14:11:30.000Z | 2017-06-11T16:10:33.000Z | account/tasks.py | fitahol/fitahol | ce84dc909aa98f2dc7594ef26568e015cbfe0e94 | [
"MIT"
] | null | null | null | account/tasks.py | fitahol/fitahol | ce84dc909aa98f2dc7594ef26568e015cbfe0e94 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
"""
__created__ = '18/10/2016'
__author__ = 'deling.ma'
"""
import logging
import datetime
import random
from django.contrib.auth import get_user_model
from django.contrib.contenttypes.models import ContentType
from django.db import IntegrityError
from account.models import Coach... | 37.468468 | 83 | 0.616013 |
797eed6d498ddc3cdd72e165f53cfe023cd8b44b | 7,446 | py | Python | zymp/stacked_sites_array.py | Edinburgh-Genome-Foundry/zymp | a0a90be8c09a230f01015971323cab88abf0aa6d | [
"MIT"
] | 8 | 2019-01-17T18:19:18.000Z | 2022-02-09T12:20:35.000Z | zymp/stacked_sites_array.py | Edinburgh-Genome-Foundry/zymp | a0a90be8c09a230f01015971323cab88abf0aa6d | [
"MIT"
] | null | null | null | zymp/stacked_sites_array.py | Edinburgh-Genome-Foundry/zymp | a0a90be8c09a230f01015971323cab88abf0aa6d | [
"MIT"
] | null | null | null | import numpy as np
from dnachisel.biotools import reverse_complement
from Bio import Restriction
import proglog
from .tools import (
enzymes_to_dna_pattern,
get_enzymes_ATGC_sequences,
find_patterns_matches,
reverse_complement,
)
def sites_difference(site1, site2):
"""Return minimal sequence of n... | 35.2891 | 85 | 0.59119 |
797eee70d9fa30c18adf5d0ce52bee595e0c0d73 | 8,491 | py | Python | virt/ansible-latest/lib/python2.7/site-packages/ansible/modules/storage/purestorage/purefb_ds.py | lakhlaifi/RedHat-Ansible | 27c5077cced9d416081fcd5d69ea44bca0317fa4 | [
"Apache-2.0"
] | 1 | 2020-03-29T18:41:01.000Z | 2020-03-29T18:41:01.000Z | ansible/ansible/modules/storage/purestorage/purefb_ds.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 7 | 2020-09-07T17:27:56.000Z | 2022-03-02T06:25:46.000Z | ansible/ansible/modules/storage/purestorage/purefb_ds.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 1 | 2020-10-30T12:48:24.000Z | 2020-10-30T12:48:24.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2018, Simon Dodsley (simon@purestorage.com)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',... | 34.79918 | 120 | 0.65646 |
797eee8cb475d624537f9035d38978940d648034 | 3,686 | py | Python | models/engine/db_storage.py | koukijohn/instakush | 766639f166d5475235a7104a543d1c58828e85a1 | [
"MIT"
] | null | null | null | models/engine/db_storage.py | koukijohn/instakush | 766639f166d5475235a7104a543d1c58828e85a1 | [
"MIT"
] | null | null | null | models/engine/db_storage.py | koukijohn/instakush | 766639f166d5475235a7104a543d1c58828e85a1 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
"""
Database engine
"""
import os
from sqlalchemy import create_engine, MetaData
from sqlalchemy.orm import sessionmaker, scoped_session
from models.base_model import Base
from models import base_model, amenity, city, place, review, state, user
class DBStorage:
"""
handles long term st... | 27.714286 | 72 | 0.536082 |
797eeeb2438c5e1db82620d3b61facb241f2a98c | 30,469 | py | Python | python/sciond/sciond.py | FR4NK-W/osourced-scion | c8fc2fcfaead45dd4dd20d1dd6450bf6d10ebd11 | [
"Apache-2.0"
] | null | null | null | python/sciond/sciond.py | FR4NK-W/osourced-scion | c8fc2fcfaead45dd4dd20d1dd6450bf6d10ebd11 | [
"Apache-2.0"
] | null | null | null | python/sciond/sciond.py | FR4NK-W/osourced-scion | c8fc2fcfaead45dd4dd20d1dd6450bf6d10ebd11 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 ETH Zurich
#
# 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, sof... | 40.788487 | 100 | 0.618793 |
797eef4af0df46aaa2b529a723aa7746f89f0032 | 2,049 | py | Python | src/config/contrail_issu/contrail_issu/issu_contrail_post_sync.py | atsgen/tf-controller | 9321889cdd3d7108980cc88937b2e82956502cc5 | [
"Apache-2.0"
] | 37 | 2020-09-21T10:42:26.000Z | 2022-01-09T10:16:40.000Z | src/config/contrail_issu/contrail_issu/issu_contrail_post_sync.py | atsgen/tf-controller | 9321889cdd3d7108980cc88937b2e82956502cc5 | [
"Apache-2.0"
] | null | null | null | src/config/contrail_issu/contrail_issu/issu_contrail_post_sync.py | atsgen/tf-controller | 9321889cdd3d7108980cc88937b2e82956502cc5 | [
"Apache-2.0"
] | 21 | 2020-08-25T12:48:42.000Z | 2022-03-22T04:32:18.000Z | #!/usr/bin/python
#
# Copyright (c) 2016 Juniper Networks, Inc. All rights reserved.
#
import logging
from pysandesh.gen_py.sandesh.ttypes import SandeshLevel
from contrail_issu.issu_contrail_common import ICCassandraClient
from contrail_issu import issu_contrail_config
def _myprint(x, level):
print(x)
loggi... | 38.660377 | 82 | 0.730112 |
797ef063c03364421d9441bfbfa21989c21f2bd0 | 6,359 | py | Python | test/functional/wallet_listreceivedby.py | brewhaus2/Placeholders-X16R | 8757eef1a0596df490be28a0f259ab26597ac851 | [
"MIT"
] | 23 | 2018-12-18T16:46:37.000Z | 2022-01-03T23:11:09.000Z | test/functional/wallet_listreceivedby.py | brewhaus2/Placeholders-X16R | 8757eef1a0596df490be28a0f259ab26597ac851 | [
"MIT"
] | 1 | 2018-12-15T19:08:42.000Z | 2018-12-15T19:09:35.000Z | test/functional/wallet_listreceivedby.py | brewhaus2/Placeholders-X16R | 8757eef1a0596df490be28a0f259ab26597ac851 | [
"MIT"
] | 11 | 2018-12-12T05:45:24.000Z | 2021-04-23T03:07:21.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Copyright (c) 2017-2018 The Placeholder Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the listreceivedbyaddress RPC."""
from ... | 44.78169 | 139 | 0.633118 |
797ef0908a2641f131ddf7a6a90e6ffea5748589 | 317 | py | Python | usaspending_api/common/etl/etl_query_file.py | gaybro8777/usaspending-api | fe9d730acd632401bbbefa168e3d86d59560314b | [
"CC0-1.0"
] | null | null | null | usaspending_api/common/etl/etl_query_file.py | gaybro8777/usaspending-api | fe9d730acd632401bbbefa168e3d86d59560314b | [
"CC0-1.0"
] | null | null | null | usaspending_api/common/etl/etl_query_file.py | gaybro8777/usaspending-api | fe9d730acd632401bbbefa168e3d86d59560314b | [
"CC0-1.0"
] | null | null | null | from pathlib import Path
from usaspending_api.common.etl import ETLQuery
class ETLQueryFile(ETLQuery):
""" Same as ETLQuery but reads the query from a file. """
def __init__(self, file_path: str) -> None:
super(ETLQueryFile, self).__init__(Path(file_path).read_text())
__all__ = ["ETLQueryFile"]
| 24.384615 | 71 | 0.719243 |
797ef0b3c92344bc87befa4fb4d03bdf18875efb | 6,942 | py | Python | salt/modules/mac_keychain.py | springborland/salt | bee85e477d57e9a171884e54fefb9a59d0835ed0 | [
"Apache-2.0"
] | 1 | 2020-04-09T03:25:10.000Z | 2020-04-09T03:25:10.000Z | salt/modules/mac_keychain.py | springborland/salt | bee85e477d57e9a171884e54fefb9a59d0835ed0 | [
"Apache-2.0"
] | null | null | null | salt/modules/mac_keychain.py | springborland/salt | bee85e477d57e9a171884e54fefb9a59d0835ed0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Install certificates into the keychain on Mac OS
.. versionadded:: 2016.3.0
"""
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import logging
import re
import shlex
# Import Salt libs
import salt.utils.platform
try:
import pipes
H... | 24.704626 | 95 | 0.646067 |
797ef0d49f76c58a0d7032dee81a90dc7d694559 | 3,126 | py | Python | test/cpython/test_opcodes.py | aisk/pyston | ac69cfef0621dbc8901175e84fa2b5cb5781a646 | [
"BSD-2-Clause",
"Apache-2.0"
] | 1 | 2020-02-06T14:28:45.000Z | 2020-02-06T14:28:45.000Z | test/cpython/test_opcodes.py | aisk/pyston | ac69cfef0621dbc8901175e84fa2b5cb5781a646 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | test/cpython/test_opcodes.py | aisk/pyston | ac69cfef0621dbc8901175e84fa2b5cb5781a646 | [
"BSD-2-Clause",
"Apache-2.0"
] | 1 | 2020-02-06T14:29:00.000Z | 2020-02-06T14:29:00.000Z | # expected: fail
# Python test set -- part 2, opcodes
from test.test_support import run_unittest, check_py3k_warnings
import unittest
class OpcodeTest(unittest.TestCase):
def test_try_inside_for_loop(self):
n = 0
for i in range(10):
n = n+i
try: 1 // 0
except N... | 25.414634 | 74 | 0.522713 |
797ef0f7475489ef970997edb6c4fa12cdbd19e4 | 8,484 | py | Python | sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_marketplace_agreements_operations.py | mohamedshabanofficial/azure-sdk-for-python | 81c585f310cd2ec23d2ad145173958914a075a58 | [
"MIT"
] | null | null | null | sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_marketplace_agreements_operations.py | mohamedshabanofficial/azure-sdk-for-python | 81c585f310cd2ec23d2ad145173958914a075a58 | [
"MIT"
] | null | null | null | sdk/datadog/azure-mgmt-datadog/azure/mgmt/datadog/operations/_marketplace_agreements_operations.py | mohamedshabanofficial/azure-sdk-for-python | 81c585f310cd2ec23d2ad145173958914a075a58 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 46.615385 | 137 | 0.669967 |
797ef10aa81616b611fd0d4dd025cfb418c98fde | 24,461 | py | Python | tests/unit/test_vmware_exporter.py | mifrost/vmware_exporter | 8adf069865ad89560524ed3c16f899b74d0c76af | [
"BSD-3-Clause"
] | null | null | null | tests/unit/test_vmware_exporter.py | mifrost/vmware_exporter | 8adf069865ad89560524ed3c16f899b74d0c76af | [
"BSD-3-Clause"
] | null | null | null | tests/unit/test_vmware_exporter.py | mifrost/vmware_exporter | 8adf069865ad89560524ed3c16f899b74d0c76af | [
"BSD-3-Clause"
] | null | null | null | import contextlib
import datetime
from unittest import mock
import pytest
import pytest_twisted
import pytz
from pyVmomi import vim, vmodl
from twisted.internet import defer
from twisted.web.server import NOT_DONE_YET
from vmware_exporter.vmware_exporter import main, HealthzResource, VmwareCollector, VMWareMetricsRes... | 30.198765 | 113 | 0.607947 |
797ef31d2f06d6250d138f281f61e295780f95ba | 8,549 | py | Python | docs/source/generate_api_rst.py | JohnGoertz/Gumbi | 7a7df9bf97bf10cdf5dc8af36026dba578e161c9 | [
"Apache-2.0"
] | 34 | 2021-11-29T11:40:52.000Z | 2022-03-10T09:08:59.000Z | docs/source/generate_api_rst.py | JohnGoertz/Gumbi | 7a7df9bf97bf10cdf5dc8af36026dba578e161c9 | [
"Apache-2.0"
] | 13 | 2021-12-30T17:07:34.000Z | 2022-02-18T18:46:37.000Z | docs/source/generate_api_rst.py | JohnGoertz/Gumbi | 7a7df9bf97bf10cdf5dc8af36026dba578e161c9 | [
"Apache-2.0"
] | null | null | null | import inspect
import os
from datetime import datetime
import pathlib as pl
from typing import Any, Callable, List, Set, Tuple
from types import ModuleType
import gumbi
# TODO: Refactor generate_module_rst.py and document
RST_PATH = "source/"
RST_LEVEL_SYMBOLS = ["=", "-", "~", '"', "'", "^"]
file_h... | 34.059761 | 122 | 0.591765 |
797ef4080003e9940cfa950023fe499ebb5260ea | 510 | py | Python | wprevents/base/views.py | arroway/wprevents | 5ed14c0e85c1a6463a0e72c94836fae81fbe3fda | [
"BSD-3-Clause"
] | 1 | 2015-02-07T10:04:48.000Z | 2015-02-07T10:04:48.000Z | wprevents/base/views.py | yvan-sraka/wprevents | 03f95150fe7c09338c3a17e00a4b85febef87789 | [
"BSD-3-Clause"
] | 6 | 2015-02-07T10:08:38.000Z | 2021-06-06T13:17:24.000Z | wprevents/base/views.py | yvan-sraka/wprevents | 03f95150fe7c09338c3a17e00a4b85febef87789 | [
"BSD-3-Clause"
] | 4 | 2015-01-20T19:48:31.000Z | 2017-04-08T22:10:52.000Z | from django.http import HttpResponseServerError
from django.shortcuts import render
from django.template import RequestContext
from django.template.loader import get_template
def login(request):
return render(request, 'login.html')
def error404(request):
t = get_template('404.html')
res = HttpResponseServerEr... | 22.173913 | 66 | 0.782353 |
797ef41395be99e2df80700253f2ba073a918bf3 | 114 | py | Python | block_chain/tests/utils/__init__.py | Jh123x/Block-Chain | a8b076141130bf543f29052275bd608951964f85 | [
"MIT"
] | null | null | null | block_chain/tests/utils/__init__.py | Jh123x/Block-Chain | a8b076141130bf543f29052275bd608951964f85 | [
"MIT"
] | null | null | null | block_chain/tests/utils/__init__.py | Jh123x/Block-Chain | a8b076141130bf543f29052275bd608951964f85 | [
"MIT"
] | null | null | null | """Tests for Utils"""
from .check_balance_test import CheckBalanceTest
from .check_hash_test import CheckHashTest
| 28.5 | 48 | 0.833333 |
797ef503d4038251654a93e2d96fab153c17482e | 5,467 | py | Python | scripts/plotting/plot_example.py | GOMTAE/Hummingbird_PPO | e25646587b050d507febd20d9b11ef86c321d7e0 | [
"MIT"
] | null | null | null | scripts/plotting/plot_example.py | GOMTAE/Hummingbird_PPO | e25646587b050d507febd20d9b11ef86c321d7e0 | [
"MIT"
] | null | null | null | scripts/plotting/plot_example.py | GOMTAE/Hummingbird_PPO | e25646587b050d507febd20d9b11ef86c321d7e0 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
import random
df_motor = pd.read_csv('/home/ubuntu/bagfiles/3r_mon/4r/motor.csv', header=0)
df_odom = pd.read_csv('/home/ubuntu/bagfiles/realistic/real_gt_odom.csv', header=0)
print(df_motor)
print(df_motor.columns.values)
# S... | 33.335366 | 101 | 0.649351 |
797ef57e026550f06bc2d96f1fd26409629f8fc3 | 877 | py | Python | update.py | egemenzeytinci/recommovie | fbbef77855c66ad37606b7813a7a3cefb38c4e88 | [
"MIT"
] | 14 | 2018-10-10T16:53:38.000Z | 2021-08-09T14:15:44.000Z | update.py | egemenzeytinci/recommovie | fbbef77855c66ad37606b7813a7a3cefb38c4e88 | [
"MIT"
] | null | null | null | update.py | egemenzeytinci/recommovie | fbbef77855c66ad37606b7813a7a3cefb38c4e88 | [
"MIT"
] | 2 | 2019-05-28T08:50:03.000Z | 2020-11-19T09:13:40.000Z | from crawl import main as crawl
from util import get_params
from util.elastic import Elastic
import os
import wget
BASICS = 'https://datasets.imdbws.com/title.basics.tsv.gz'
RATINGS = 'https://datasets.imdbws.com/title.ratings.tsv.gz'
EPISODES = 'https://datasets.imdbws.com/title.episode.tsv.gz'
def main():
elas... | 25.794118 | 66 | 0.68301 |
797ef58d04d25205b3e900c26190f6b7598e6202 | 2,046 | py | Python | contrib/mypy/tests/python/pants_test/contrib/mypy/test_mypy_integration.py | revl/pants | 8ad83e4ca80c095d44efceafd8b41e575da39c65 | [
"Apache-2.0"
] | 1 | 2021-05-05T18:58:28.000Z | 2021-05-05T18:58:28.000Z | contrib/mypy/tests/python/pants_test/contrib/mypy/test_mypy_integration.py | revl/pants | 8ad83e4ca80c095d44efceafd8b41e575da39c65 | [
"Apache-2.0"
] | null | null | null | contrib/mypy/tests/python/pants_test/contrib/mypy/test_mypy_integration.py | revl/pants | 8ad83e4ca80c095d44efceafd8b41e575da39c65 | [
"Apache-2.0"
] | 3 | 2020-06-30T08:28:13.000Z | 2021-07-28T09:35:57.000Z | # Copyright 2017 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from pathlib import Path
from pants.testutil.pants_run_integration_test import PantsRunIntegrationTest
class MypyIntegrationTest(PantsRunIntegrationTest):
cmdline = ["--backend-pac... | 35.275862 | 101 | 0.697947 |
797ef7338b4c4d72fff26e90ece30cc71c6d3edf | 115,241 | py | Python | napari/layers/shapes/shapes.py | kolibril13/napari | b39647d94e587f0255b0d4cc3087855e160a8929 | [
"BSD-3-Clause"
] | null | null | null | napari/layers/shapes/shapes.py | kolibril13/napari | b39647d94e587f0255b0d4cc3087855e160a8929 | [
"BSD-3-Clause"
] | null | null | null | napari/layers/shapes/shapes.py | kolibril13/napari | b39647d94e587f0255b0d4cc3087855e160a8929 | [
"BSD-3-Clause"
] | null | null | null | import warnings
from contextlib import contextmanager
from copy import copy, deepcopy
from itertools import cycle
from typing import Dict, List, Tuple, Union
import numpy as np
from vispy.color import get_color_names
from ...utils.colormaps import Colormap, ValidColormapArg, ensure_colormap
from ...utils.colormaps.st... | 38.985453 | 111 | 0.591291 |
797ef833a3d2c7477c6a0e0718d077b1b4245d9c | 5,080 | py | Python | code/ci360-twilio-connector/aws-lambda/python/twilioMessageRequest/lambda_function.py | sassoftware/ci360-extensions | a8051a8d287ba6c0be818b75c447538d8eb046fc | [
"Apache-2.0"
] | 3 | 2021-11-01T10:45:43.000Z | 2022-02-17T13:07:10.000Z | code/ci360-twilio-connector/aws-lambda/python/twilioMessageRequest/lambda_function.py | sassoftware/ci360-extensions | a8051a8d287ba6c0be818b75c447538d8eb046fc | [
"Apache-2.0"
] | null | null | null | code/ci360-twilio-connector/aws-lambda/python/twilioMessageRequest/lambda_function.py | sassoftware/ci360-extensions | a8051a8d287ba6c0be818b75c447538d8eb046fc | [
"Apache-2.0"
] | null | null | null | """
Copyright © 2021, SAS Institute Inc., Cary, NC, USA. All Rights Reserved.
SPDX-License-Identifier: Apache-2.0
"""
import os
import json
import datetime
import urllib3
print("Initializing function")
# Get the service resource
http = urllib3.PoolManager()
# Initialize global variables
default_sender = os.environ... | 31.75 | 114 | 0.643898 |
797ef886a1bfcf14ffe7c6a7120f79173c93a301 | 166 | py | Python | configuration/apps.py | praveenskumar/sh00t | 88f5eda379f03ae8fe088475d9bd7fb76da1acbc | [
"MIT"
] | 262 | 2017-08-26T04:09:27.000Z | 2022-03-03T22:19:28.000Z | configuration/apps.py | praveenskumar/sh00t | 88f5eda379f03ae8fe088475d9bd7fb76da1acbc | [
"MIT"
] | 23 | 2017-08-22T07:45:48.000Z | 2021-07-25T02:10:56.000Z | configuration/apps.py | praveenskumar/sh00t | 88f5eda379f03ae8fe088475d9bd7fb76da1acbc | [
"MIT"
] | 62 | 2018-08-13T11:06:35.000Z | 2022-01-15T14:54:42.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.apps import AppConfig
class ConfigurationConfig(AppConfig):
name = 'configuration'
| 18.444444 | 39 | 0.753012 |
797ef8a3ecff0800a250a572330cfdaa47309b21 | 799 | py | Python | src/core/urls.py | Meepanya/RecruitmentAgency | 48f51d8511df4cdd6b94e3ce1f7bf3b8b7c0d0ab | [
"MIT"
] | null | null | null | src/core/urls.py | Meepanya/RecruitmentAgency | 48f51d8511df4cdd6b94e3ce1f7bf3b8b7c0d0ab | [
"MIT"
] | null | null | null | src/core/urls.py | Meepanya/RecruitmentAgency | 48f51d8511df4cdd6b94e3ce1f7bf3b8b7c0d0ab | [
"MIT"
] | null | null | null | """core URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based vi... | 34.73913 | 77 | 0.702128 |
797ef918e8ec56f6b3ed5a7c4670e34c67aa88a4 | 1,924 | py | Python | stereo/preprocess/normalize.py | nilsmechtel/stereopy | cd8f34b45ae6667043611e5d02ea46f8ca3f0c7b | [
"MIT"
] | 61 | 2021-04-09T01:00:41.000Z | 2022-03-07T06:19:41.000Z | stereo/preprocess/normalize.py | nilsmechtel/stereopy | cd8f34b45ae6667043611e5d02ea46f8ca3f0c7b | [
"MIT"
] | 20 | 2021-04-13T10:31:04.000Z | 2022-03-29T11:07:30.000Z | stereo/preprocess/normalize.py | nilsmechtel/stereopy | cd8f34b45ae6667043611e5d02ea46f8ca3f0c7b | [
"MIT"
] | 13 | 2021-04-16T08:36:08.000Z | 2022-02-21T20:44:00.000Z | #!/usr/bin/env python3
# coding: utf-8
"""
@author: Ping Qiu qiuping1@genomics.cn
@last modified by: Ping Qiu
@file:normalize.py
@time:2021/03/05
change log:
add basic functions of normalization. by Ping Qiu. 2021/03/05
Refactor the code and add the quantile_norm function. by Ping Qiu. 2021/03/17
add the ... | 32.610169 | 101 | 0.648649 |
797ef9649b6892df90a125363654c8384b66627c | 6,303 | py | Python | homeassistant/components/binary_sensor/wink.py | shire210/home-assistant | 63cd8bbee6f1b74ae9c6c249ac820119a8a573d8 | [
"Apache-2.0"
] | 2 | 2017-02-25T00:27:06.000Z | 2017-02-25T03:09:30.000Z | homeassistant/components/binary_sensor/wink.py | shire210/home-assistant | 63cd8bbee6f1b74ae9c6c249ac820119a8a573d8 | [
"Apache-2.0"
] | 1 | 2017-03-10T22:17:06.000Z | 2017-03-10T22:17:06.000Z | homeassistant/components/binary_sensor/wink.py | shire210/home-assistant | 63cd8bbee6f1b74ae9c6c249ac820119a8a573d8 | [
"Apache-2.0"
] | 2 | 2018-06-03T11:14:44.000Z | 2018-11-04T18:18:12.000Z | """
Support for Wink binary sensors.
For more details about this platform, please refer to the documentation at
at https://home-assistant.io/components/binary_sensor.wink/
"""
import logging
from homeassistant.components.binary_sensor import BinarySensorDevice
from homeassistant.components.wink import WinkDevice, DOM... | 32.158163 | 78 | 0.637633 |
797efa1ac376704222e5511d100b2f562d4ffa6f | 507 | py | Python | src/config/ModelConfig.py | OpenNLPhub/MRC_NER | 27ca063764aed9eb5f2ac672bb10052acbf374a5 | [
"MIT"
] | 4 | 2020-12-28T08:36:21.000Z | 2021-09-30T06:54:21.000Z | src/config/ModelConfig.py | OpenNLPhub/MRC_NER | 27ca063764aed9eb5f2ac672bb10052acbf374a5 | [
"MIT"
] | 1 | 2021-06-10T00:18:15.000Z | 2021-06-10T00:18:15.000Z | src/config/ModelConfig.py | OpenNLPhub/MRC_NER | 27ca063764aed9eb5f2ac672bb10052acbf374a5 | [
"MIT"
] | null | null | null | import os
from os.path import join
cwd=os.getcwd()
''' Path config'''
BERT_BASE_CHINESE=join(cwd,'data','static','bert-base-chinese')
BERT_BASE_ENGLISH=join(cwd,'data','static','bert-base-uncased')
Bert_Pretrained_Model_Map = {
'bert-base-uncased': BERT_BASE_ENGLISH,
'bert-base-chinese': BERT_BASE_CHINESE
}
... | 19.5 | 63 | 0.712032 |
797efaa82f20261b163894ec0adfb0da66c336dc | 2,002 | py | Python | examples/image_processing/marker.py | KurtJacobson/pydm | 5a5cbc6cdb218b77335a3c4ad57a4a49e060e20d | [
"BSD-3-Clause-LBNL"
] | 89 | 2016-05-25T22:01:48.000Z | 2022-03-02T16:21:03.000Z | examples/image_processing/marker.py | KurtJacobson/pydm | 5a5cbc6cdb218b77335a3c4ad57a4a49e060e20d | [
"BSD-3-Clause-LBNL"
] | 653 | 2016-10-15T01:45:02.000Z | 2022-03-31T23:36:39.000Z | examples/image_processing/marker.py | KurtJacobson/pydm | 5a5cbc6cdb218b77335a3c4ad57a4a49e060e20d | [
"BSD-3-Clause-LBNL"
] | 56 | 2016-10-10T14:02:06.000Z | 2022-03-24T14:35:24.000Z | from qtpy import QtCore, QtGui
from pyqtgraph import Point, ROI
from pyqtgraph import functions as fn
import numpy as np
class ImageMarker(ROI):
"""A crosshair ROI. Returns the full image line-out for X and Y at the position of the crosshair."""
def __init__(self, pos=None, size=None, **kargs):
if si... | 33.366667 | 105 | 0.573926 |
797efaeb96a20f4a1b3aac8238039bd7bb0381d5 | 2,081 | py | Python | hloc/get_intrinsics_db.py | obodroid/Hierarchical-Localization | 932ff78ee19c44a817011ac1f9de9616a64c3064 | [
"Apache-2.0"
] | null | null | null | hloc/get_intrinsics_db.py | obodroid/Hierarchical-Localization | 932ff78ee19c44a817011ac1f9de9616a64c3064 | [
"Apache-2.0"
] | null | null | null | hloc/get_intrinsics_db.py | obodroid/Hierarchical-Localization | 932ff78ee19c44a817011ac1f9de9616a64c3064 | [
"Apache-2.0"
] | null | null | null | import cv2
import logging
import numpy as np
from pathlib import Path
from .utils.read_write_model import (
read_cameras_binary, read_images_binary, read_model, write_model,
qvec2rotmat, read_images_text, read_cameras_text)
def create_list_with_intrinsics(model, out, list_file=None, ext='.bin',
... | 40.803922 | 235 | 0.617492 |
797efb2c5d121bb8313618844b4879e965482478 | 11,203 | py | Python | tests/custom_cluster/test_rpc_timeout.py | Keendata/impala | b25e250d321f329b98e017c648df75d052497963 | [
"Apache-2.0"
] | 746 | 2017-12-02T06:02:05.000Z | 2022-03-29T06:59:03.000Z | tests/custom_cluster/test_rpc_timeout.py | xwzbupt/impala | 97dda2b27da99367f4d07699aa046b16cda16dd4 | [
"Apache-2.0"
] | 9 | 2018-01-30T16:16:22.000Z | 2021-08-31T00:13:28.000Z | tests/custom_cluster/test_rpc_timeout.py | xwzbupt/impala | 97dda2b27da99367f4d07699aa046b16cda16dd4 | [
"Apache-2.0"
] | 363 | 2017-12-10T01:08:17.000Z | 2022-03-26T05:25:00.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 46.485477 | 90 | 0.751406 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.