hexsha stringlengths 40 40 | size int64 5 2.06M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 248 | max_stars_repo_name stringlengths 5 125 | 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 248 | max_issues_repo_name stringlengths 5 125 | 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 248 | max_forks_repo_name stringlengths 5 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 5 2.06M | avg_line_length float64 1 1.02M | max_line_length int64 3 1.03M | alphanum_fraction float64 0 1 | count_classes int64 0 1.6M | score_classes float64 0 1 | count_generators int64 0 651k | score_generators float64 0 1 | count_decorators int64 0 990k | score_decorators float64 0 1 | count_async_functions int64 0 235k | score_async_functions float64 0 1 | count_documentation int64 0 1.04M | score_documentation float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
24ff234f920bab09fe239546c8831800ee8f0daa | 3,968 | py | Python | sphinx_lesson/directives.py | robertodr/sphinx-lesson | 311a51cd42d85cafad26b76366d7147c326c1759 | [
"MIT"
] | null | null | null | sphinx_lesson/directives.py | robertodr/sphinx-lesson | 311a51cd42d85cafad26b76366d7147c326c1759 | [
"MIT"
] | null | null | null | sphinx_lesson/directives.py | robertodr/sphinx-lesson | 311a51cd42d85cafad26b76366d7147c326c1759 | [
"MIT"
] | null | null | null | """Add some sphinx-docutils directives related to lessons.
"""
# pylint: disable=E701
import os
from docutils import nodes
from docutils.parsers.rst.directives.admonitions \
import Admonition as AdmonitionDirective
from sphinx.util.docutils import SphinxDirective
from sphinx.util.logging import getLogger
from . im... | 34.206897 | 130 | 0.681956 | 2,256 | 0.568548 | 0 | 0 | 299 | 0.075353 | 0 | 0 | 1,624 | 0.409274 |
24ffa281701166331532a6d684f818550c073997 | 4,696 | py | Python | language/serene/text_matcher.py | Xtuden-com/language | 70c0328968d5ffa1201c6fdecde45bbc4fec19fc | [
"Apache-2.0"
] | 1,199 | 2018-10-16T01:30:18.000Z | 2022-03-31T21:05:24.000Z | language/serene/text_matcher.py | Xtuden-com/language | 70c0328968d5ffa1201c6fdecde45bbc4fec19fc | [
"Apache-2.0"
] | 116 | 2018-10-18T03:31:46.000Z | 2022-03-24T13:40:50.000Z | language/serene/text_matcher.py | Xtuden-com/language | 70c0328968d5ffa1201c6fdecde45bbc4fec19fc | [
"Apache-2.0"
] | 303 | 2018-10-22T12:35:12.000Z | 2022-03-27T17:38:17.000Z | # coding=utf-8
# Copyright 2018 The Google AI Language Team 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 ... | 32.611111 | 106 | 0.688671 | 3,744 | 0.797274 | 0 | 0 | 0 | 0 | 0 | 0 | 2,291 | 0.487862 |
70000a0effbae8943e38a948112d24880ec73970 | 1,099 | py | Python | setup.py | hulusibaysal/EksiGundem | 6b0130a89c0c42b365dea847027ff3e13c4c4240 | [
"MIT"
] | null | null | null | setup.py | hulusibaysal/EksiGundem | 6b0130a89c0c42b365dea847027ff3e13c4c4240 | [
"MIT"
] | null | null | null | setup.py | hulusibaysal/EksiGundem | 6b0130a89c0c42b365dea847027ff3e13c4c4240 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from pathlib import Path
from setuptools import setup
CURRENT_DIR = Path(__file__).parent
def get_long_description():
readme_md = CURRENT_DIR / "README.md"
with open(readme_md, encoding="utf8") as ld_file:
return ld_file.read()
setup(
name="eksi",... | 26.804878 | 67 | 0.658781 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 445 | 0.40054 |
7001e2e5450d227861c09e67f69e32ff38986c9e | 4,596 | py | Python | asci_art.py | JonathanFromm/HackerspaceTemplatePackage | b0bd5e77cd36417901b064e82812d365c55ff421 | [
"MIT"
] | null | null | null | asci_art.py | JonathanFromm/HackerspaceTemplatePackage | b0bd5e77cd36417901b064e82812d365c55ff421 | [
"MIT"
] | null | null | null | asci_art.py | JonathanFromm/HackerspaceTemplatePackage | b0bd5e77cd36417901b064e82812d365c55ff421 | [
"MIT"
] | null | null | null | class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
def happy_face():
print(' ')
print(bcolors.OKGREEN+' ^ ^ '+bcolors.ENDC)
print(bcolor... | 35.353846 | 130 | 0.572454 | 202 | 0.043951 | 0 | 0 | 0 | 0 | 0 | 0 | 765 | 0.166449 |
70031ea92c28e396deb633661ccd21348ccd84ec | 795 | py | Python | paths.py | ShuaiW/kaggle-heart | 022997f27add953c74af2b371c67d9d86cbdccc3 | [
"MIT"
] | 182 | 2016-03-15T01:51:29.000Z | 2021-04-21T09:49:05.000Z | paths.py | weidezhang/kaggle-heart | 022997f27add953c74af2b371c67d9d86cbdccc3 | [
"MIT"
] | 1 | 2018-06-22T16:46:12.000Z | 2018-06-22T21:08:09.000Z | paths.py | weidezhang/kaggle-heart | 022997f27add953c74af2b371c67d9d86cbdccc3 | [
"MIT"
] | 61 | 2016-03-15T00:58:28.000Z | 2020-03-06T22:00:41.000Z | """Module for reading the SETTINGS.json file.
"""
import json
import os
with open(os.path.dirname(os.path.realpath(__file__)) + '/SETTINGS.json') as data_file:
PATHS = json.load(data_file)
TRAIN_DATA_PATH = PATHS["TRAIN_DATA_PATH"]
TEST_DATA_PATH = PATHS["VALIDATE_DATA_PATH"]
PKL_TRAIN_DATA_PATH = PATHS["PKL_TRA... | 34.565217 | 87 | 0.8 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 310 | 0.389937 |
700529f087345e2c10ecc73eaeb6cb41b5f20690 | 433 | py | Python | debug/debug08.py | adamlukomski/pykron | 5e4c4b840af2cf574dab8417a97b7f0fc4080878 | [
"BSD-2-Clause"
] | null | null | null | debug/debug08.py | adamlukomski/pykron | 5e4c4b840af2cf574dab8417a97b7f0fc4080878 | [
"BSD-2-Clause"
] | null | null | null | debug/debug08.py | adamlukomski/pykron | 5e4c4b840af2cf574dab8417a97b7f0fc4080878 | [
"BSD-2-Clause"
] | null | null | null |
# what not to do - use empty function
# race conditions may cause it not to finish right away
# but the timeout will catch it
# UPDATE: solved in d9c4fad
import sys
sys.path.append('..')
from pykron.core import Pykron, PykronLogger
import time
app = Pykron()
@app.AsyncRequest(timeout=0.5)
def fun4():
return ... | 16.037037 | 55 | 0.727483 | 0 | 0 | 0 | 0 | 55 | 0.127021 | 0 | 0 | 162 | 0.374134 |
7005d5f528431853e55b70e8b2c13f2e752e74a6 | 8,563 | py | Python | (sandbox,tobemerged)/pythongis/vector/(old)/geom_safe.py | karimbahgat/pythongis | 1042ea14de4e2aafd55de4e01d86b7d379d55999 | [
"MIT"
] | 4 | 2015-12-05T14:31:55.000Z | 2018-02-09T05:54:36.000Z | (sandbox,tobemerged)/pythongis/vector/(old)/geom_safe.py | karimbahgat/pythongis | 1042ea14de4e2aafd55de4e01d86b7d379d55999 | [
"MIT"
] | null | null | null | (sandbox,tobemerged)/pythongis/vector/(old)/geom_safe.py | karimbahgat/pythongis | 1042ea14de4e2aafd55de4e01d86b7d379d55999 | [
"MIT"
] | 1 | 2018-10-24T01:08:11.000Z | 2018-10-24T01:08:11.000Z | import sys, os, itertools, operator
import datetime
import shapely
from shapely.geometry import asShape as geoj2geom
from shapely.geometry import mapping as geom2geoj
import rtree
from . import loader
class Feature:
def __init__(self, table, row, geometry):
"geometry must be a geojson dictionary o... | 30.045614 | 185 | 0.564288 | 8,333 | 0.97314 | 1,228 | 0.143408 | 409 | 0.047764 | 0 | 0 | 1,687 | 0.19701 |
70069527a46c915cd2978c2c7d78d1acde10b272 | 1,970 | py | Python | 2021/five/day10.py | BenningtonComputing/adventofcode | f162163862e122ac15495e14d138601379fab382 | [
"MIT"
] | null | null | null | 2021/five/day10.py | BenningtonComputing/adventofcode | f162163862e122ac15495e14d138601379fab382 | [
"MIT"
] | null | null | null | 2021/five/day10.py | BenningtonComputing/adventofcode | f162163862e122ac15495e14d138601379fab382 | [
"MIT"
] | 1 | 2021-12-27T09:31:30.000Z | 2021-12-27T09:31:30.000Z | #!/usr/bin/env python3
"""
day10-2021.py - my solution to day 10 of advent of code 2021.
the link to the problem is:
https://adventofcode.com/2021/day/10
use by running `./aoc-day10-2021.py [input]`
this code was originally posted here:
... | 21.648352 | 81 | 0.57868 | 695 | 0.352792 | 0 | 0 | 0 | 0 | 0 | 0 | 590 | 0.299492 |
7006ed71317775974197d8422ff224edfdfa01ac | 9,264 | py | Python | nxsdk_modules_ncl/epl/src/computeResults.py | biagiom/models | 79489a3c429b3027dd420840bbccfee5e8c9a879 | [
"BSD-3-Clause"
] | 54 | 2020-03-04T17:37:17.000Z | 2022-02-22T13:16:10.000Z | nxsdk_modules_ncl/epl/src/computeResults.py | biagiom/models | 79489a3c429b3027dd420840bbccfee5e8c9a879 | [
"BSD-3-Clause"
] | 9 | 2020-08-26T13:17:54.000Z | 2021-11-09T09:02:00.000Z | nxsdk_modules_ncl/epl/src/computeResults.py | biagiom/models | 79489a3c429b3027dd420840bbccfee5e8c9a879 | [
"BSD-3-Clause"
] | 26 | 2020-03-18T17:09:34.000Z | 2021-11-22T16:23:14.000Z | # Copyright(c) 2019-2020 Intel Corporation All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
# * Redistributions of source code must retain the above copyright
# notice, this list of condition... | 35.358779 | 95 | 0.619603 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,128 | 0.337651 |
7007c14a0f8dc8efb9e61a001c85b2fc1dedea08 | 315 | py | Python | main.py | EliseevEgor/Simple-Parser | ab0df998cf777fc04c221cd34a1cb4ecf83cb10a | [
"MIT"
] | null | null | null | main.py | EliseevEgor/Simple-Parser | ab0df998cf777fc04c221cd34a1cb4ecf83cb10a | [
"MIT"
] | null | null | null | main.py | EliseevEgor/Simple-Parser | ab0df998cf777fc04c221cd34a1cb4ecf83cb10a | [
"MIT"
] | null | null | null | import os
import uvicorn as uvicorn
import telegram_bot
import fastAPI_server.start_fast_api as fAPI
if __name__ == '__main__':
telegram_bot.__init__()
ROOT_DIR = os.path.dirname(os.path.abspath(__file__))
fAPI.init_elems(ROOT_DIR)
uvicorn.run(fAPI.app, host='0.0.0.0', port=8000, lifespan="on")
| 24.230769 | 67 | 0.739683 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 23 | 0.073016 |
70093c19345ca7b163a2cb4f6904b25e16e97891 | 983 | py | Python | Spider.py | yxg995995/yxg | 7865cb8bd6fca4d59278365afdb96529a7757386 | [
"MIT"
] | null | null | null | Spider.py | yxg995995/yxg | 7865cb8bd6fca4d59278365afdb96529a7757386 | [
"MIT"
] | null | null | null | Spider.py | yxg995995/yxg | 7865cb8bd6fca4d59278365afdb96529a7757386 | [
"MIT"
] | null | null | null | import requests
import json
from DataBase import *
def getdaydata():#爬取股票每天的价格并插入到数据库保存
durl='''http://quotes.money.163.com/service/chddata.html?code=1000001&start=20200106&end=20210106&
fields=TCLOSE;HIGH;LOW;TOPEN;LCLOSE;CHG;PCHG;TURNOVER;VOTURNOVER;VATURNOVER;TCAP;MCAP'''
r=requests.get(durl)
... | 39.32 | 102 | 0.641913 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 567 | 0.501326 |
7009af1b31e60c7a799c07d75cb72a9357e77d47 | 2,135 | py | Python | src/pyexpressions/concrete/PyAnnAssign.py | Xiddoc/ComPy | 7d26f95209d0615d7eb188fa02470ddae5311fca | [
"MIT"
] | null | null | null | src/pyexpressions/concrete/PyAnnAssign.py | Xiddoc/ComPy | 7d26f95209d0615d7eb188fa02470ddae5311fca | [
"MIT"
] | 9 | 2022-02-23T10:32:44.000Z | 2022-03-27T17:55:43.000Z | src/pyexpressions/concrete/PyAnnAssign.py | Xiddoc/ComPy | 7d26f95209d0615d7eb188fa02470ddae5311fca | [
"MIT"
] | null | null | null | """
Assign an annotation (and possibly a value) to a variable.
"""
from _ast import AnnAssign, Name
from typing import Optional
from src.compiler.Util import Util
from src.pyexpressions.abstract.PyExpression import PyExpression
from src.pyexpressions.concrete.PyName import PyName
from src.pyexpressions.highlevel.PyIde... | 35 | 110 | 0.671194 | 1,579 | 0.739578 | 0 | 0 | 0 | 0 | 0 | 0 | 647 | 0.303044 |
700adc4ff1b09523fb554fd02562d6b99ea12187 | 3,941 | py | Python | testLogReader/testingUtils.py | simcesplatform/LogReader | eadeb7061df6fccdd0c7845284ab1a85df1bc20c | [
"MIT"
] | null | null | null | testLogReader/testingUtils.py | simcesplatform/LogReader | eadeb7061df6fccdd0c7845284ab1a85df1bc20c | [
"MIT"
] | null | null | null | testLogReader/testingUtils.py | simcesplatform/LogReader | eadeb7061df6fccdd0c7845284ab1a85df1bc20c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2021 Tampere University and VTT Technical Research Centre of Finland
# This software was developed as a part of the ProCemPlus project: https://www.senecc.fi/projects/procemplus
# This source code is licensed under the MIT license. See LICENSE in the repository root directory.
# Auth... | 41.484211 | 119 | 0.689165 | 196 | 0.049721 | 0 | 0 | 0 | 0 | 0 | 0 | 2,087 | 0.529427 |
700c2f0c5f5d02e18dff51805b19cfdc82f63425 | 4,111 | py | Python | sqlparse/__init__.py | Yelp/sqlparse | a29c8c1fb827863c6b57d8811ed3b69e982a3877 | [
"BSD-3-Clause"
] | 4 | 2015-03-16T17:08:44.000Z | 2017-02-21T22:33:18.000Z | sqlparse/__init__.py | Yelp/sqlparse | a29c8c1fb827863c6b57d8811ed3b69e982a3877 | [
"BSD-3-Clause"
] | 3 | 2015-09-30T23:53:08.000Z | 2016-05-27T18:37:02.000Z | sqlparse/__init__.py | Yelp/sqlparse | a29c8c1fb827863c6b57d8811ed3b69e982a3877 | [
"BSD-3-Clause"
] | 7 | 2015-03-16T20:55:44.000Z | 2020-06-18T18:17:51.000Z | # Copyright (C) 2008 Andi Albrecht, albrecht.andi@gmail.com
#
# This module is part of python-sqlparse and is released under
# the BSD License: http://www.opensource.org/licenses/bsd-license.php.
"""Parse SQL statements."""
__version__ = '0.1.14'
# Setup namespace
from sqlparse import engine
from sqlparse import f... | 31.868217 | 78 | 0.711992 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,798 | 0.437363 |
700f946fb5baca6452e61d3f1e007eb88ce90d87 | 1,543 | py | Python | ghost/urls.py | Microcore/Quantic | 727234a5e9e58217eb8235b6d0f27fe1b95f5f83 | [
"MIT"
] | null | null | null | ghost/urls.py | Microcore/Quantic | 727234a5e9e58217eb8235b6d0f27fe1b95f5f83 | [
"MIT"
] | 7 | 2015-04-25T05:04:46.000Z | 2015-04-26T08:24:36.000Z | ghost/urls.py | Microcore/Quantic | 727234a5e9e58217eb8235b6d0f27fe1b95f5f83 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
# from django.contrib import admin
# admin.autodiscover()
urlpatterns = patterns('',
# Login view
url(r'^$', 'ghost.views.index_view'),
url(r'^login/$', 'ghost.views.lo... | 37.634146 | 65 | 0.62022 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,152 | 0.746598 |
700ff1e444ff7f1930953d197f9dc705fff91e95 | 2,094 | py | Python | train_val_split.py | chintak/face_detection | 8370977f084fd66a9ddcc549a1b4ea8b030d23ac | [
"Apache-2.0"
] | 4 | 2016-05-04T11:27:24.000Z | 2018-10-20T15:50:57.000Z | train_val_split.py | chintak/face_detection | 8370977f084fd66a9ddcc549a1b4ea8b030d23ac | [
"Apache-2.0"
] | null | null | null | train_val_split.py | chintak/face_detection | 8370977f084fd66a9ddcc549a1b4ea8b030d23ac | [
"Apache-2.0"
] | null | null | null | import os
import pandas as pd
from pandas import read_csv
import glob
from joblib import Parallel, delayed
import numpy as np
import argparse
def read_facescrub_img_list(folder, actor_label_txt, actress_label_txt, accept_pattern='*.jpg'):
full_names = glob.glob(os.path.join(folder, accept_pattern))
only_names... | 38.777778 | 100 | 0.688634 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 319 | 0.15234 |
701176938ee12ffb5b5372fd1b648cf68178d256 | 508 | py | Python | Ignatov_Mikhail_dz_9/exercise_2.py | HellFrozenRain/GB_Homework_Python_1 | b0baea6b7efecc6bd649618d0aeba93be57a389a | [
"MIT"
] | null | null | null | Ignatov_Mikhail_dz_9/exercise_2.py | HellFrozenRain/GB_Homework_Python_1 | b0baea6b7efecc6bd649618d0aeba93be57a389a | [
"MIT"
] | null | null | null | Ignatov_Mikhail_dz_9/exercise_2.py | HellFrozenRain/GB_Homework_Python_1 | b0baea6b7efecc6bd649618d0aeba93be57a389a | [
"MIT"
] | null | null | null | class Road:
m = 25
def __init__(self, length: int, width:int):
self._length = length
self._width = width
def calculatiion(self, s: int):
print(f' road length: {self._length} m')
print(f' road width: {self._width} m')
print(f' road thikness: {s} cm')
result = ... | 33.866667 | 91 | 0.612205 | 451 | 0.887795 | 0 | 0 | 0 | 0 | 0 | 0 | 165 | 0.324803 |
7011b2ae0614609670b4e97d7fc81ec2fb09c3bb | 455 | py | Python | tests/test_numpy.py | python-pipe/hellp | 51fd7c9143ee8ce6392b9b877036ad4347ad29a5 | [
"MIT"
] | 123 | 2018-07-31T19:17:27.000Z | 2022-03-18T15:29:07.000Z | tests/test_numpy.py | python-pipe/hellp | 51fd7c9143ee8ce6392b9b877036ad4347ad29a5 | [
"MIT"
] | 11 | 2019-05-01T18:01:59.000Z | 2022-01-01T06:43:36.000Z | tests/test_numpy.py | python-pipe/hellp | 51fd7c9143ee8ce6392b9b877036ad4347ad29a5 | [
"MIT"
] | 4 | 2019-06-07T12:03:53.000Z | 2021-05-10T20:29:44.000Z | from sspipe import p, px
import numpy as np
def test_scalar_rhs():
assert np.int32(1) | p(lambda x: x + 1) | (px == 2)
def test_scalar_lhs():
assert 2 | px + np.int32(1)
def test_rhs():
assert np.array([1, 2]) | p(lambda x: x.sum()) | (px == 3)
def test_rhs_px():
assert np.array([1, 2]) | (px.su... | 16.851852 | 62 | 0.558242 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
70172a8d868fb43d2b1244f1bbe19248e7fbd7f5 | 3,866 | py | Python | src/sane_fin_site/fin_storage/migrations/0001_initial.py | StanleySane/sane-fin-site | 4e7341aa3bc17d12f6cf3741ed2fec4bf554b9f9 | [
"BSD-3-Clause"
] | null | null | null | src/sane_fin_site/fin_storage/migrations/0001_initial.py | StanleySane/sane-fin-site | 4e7341aa3bc17d12f6cf3741ed2fec4bf554b9f9 | [
"BSD-3-Clause"
] | null | null | null | src/sane_fin_site/fin_storage/migrations/0001_initial.py | StanleySane/sane-fin-site | 4e7341aa3bc17d12f6cf3741ed2fec4bf554b9f9 | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 4.0.3 on 2022-03-18 15:22
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='CachedItem',
fields=[
... | 44.436782 | 149 | 0.592602 | 3,740 | 0.967408 | 0 | 0 | 0 | 0 | 0 | 0 | 770 | 0.199172 |
70175e2bdb8d47ee92c2a767d8aea7a4295bf422 | 935 | py | Python | pytoolbox/utility/logger.py | knutanha/python-toolbox | 16505101d9375b8ab5e085492223dfb606868872 | [
"MIT"
] | null | null | null | pytoolbox/utility/logger.py | knutanha/python-toolbox | 16505101d9375b8ab5e085492223dfb606868872 | [
"MIT"
] | null | null | null | pytoolbox/utility/logger.py | knutanha/python-toolbox | 16505101d9375b8ab5e085492223dfb606868872 | [
"MIT"
] | null | null | null | import datetime
import enum
class LogLevel(enum.Enum):
ERROR = 0
INFO = 1
DEBUG = 2
class LogManager:
def __init__(self, domain_name, log_level=LogLevel.INFO, output_type='text'):
self.__domain_name = domain_name
self.__output_type = output_type
self.__log_level = self.__get_... | 31.166667 | 136 | 0.627807 | 902 | 0.964706 | 0 | 0 | 207 | 0.22139 | 0 | 0 | 129 | 0.137968 |
70181f30e72e0f68764f53dfd0b38a713dacd8ea | 651 | py | Python | chapter 4 - quicksort/binary-search-recursive.py | kingisaac95/grokking-algorithms | 32cca84f8b6577deb83fa77e1d9dec754b59b776 | [
"Apache-2.0"
] | null | null | null | chapter 4 - quicksort/binary-search-recursive.py | kingisaac95/grokking-algorithms | 32cca84f8b6577deb83fa77e1d9dec754b59b776 | [
"Apache-2.0"
] | null | null | null | chapter 4 - quicksort/binary-search-recursive.py | kingisaac95/grokking-algorithms | 32cca84f8b6577deb83fa77e1d9dec754b59b776 | [
"Apache-2.0"
] | null | null | null | # find position of `target` in subarray nums[left…right]
def binary_search(list, left, right, target):
# base case
if left > right:
return -1
mid = (left + right) // 2
if list[mid] == target:
return mid
elif list[mid] > target:
# move right pointer to the item before mid
... | 26.04 | 58 | 0.623656 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 153 | 0.234303 |
70190c25c52cf54777c3b3dbdf96f6a2c2775501 | 4,206 | py | Python | scripts/roberta_experiment/roberta_classification_simple.py | sarnthil/emotion-classification-roles | 1fdd3a8cbdac5ab2ad9598a101b763882df78280 | [
"MIT"
] | 1 | 2022-02-17T14:16:20.000Z | 2022-02-17T14:16:20.000Z | scripts/roberta_experiment/roberta_classification_simple.py | sarnthil/emotion-classification-roles | 1fdd3a8cbdac5ab2ad9598a101b763882df78280 | [
"MIT"
] | null | null | null | scripts/roberta_experiment/roberta_classification_simple.py | sarnthil/emotion-classification-roles | 1fdd3a8cbdac5ab2ad9598a101b763882df78280 | [
"MIT"
] | null | null | null | import logging
import random
from pathlib import Path
from datetime import datetime, timezone
import click
import datasets as nlp
import torch
import numpy as np
import pandas as pd
from simpletransformers.classification import ClassificationModel
from sklearn.metrics import f1_score, accuracy_score, recall_score, pre... | 31.62406 | 194 | 0.697813 | 0 | 0 | 0 | 0 | 2,605 | 0.619353 | 0 | 0 | 661 | 0.157156 |
7019f22f9c05c70055ec9fdf171e0251420fb7a8 | 1,090 | py | Python | chapter_3/testargv.py | bimri/programming_python | ba52ccd18b9b4e6c5387bf4032f381ae816b5e77 | [
"MIT"
] | null | null | null | chapter_3/testargv.py | bimri/programming_python | ba52ccd18b9b4e6c5387bf4032f381ae816b5e77 | [
"MIT"
] | null | null | null | chapter_3/testargv.py | bimri/programming_python | ba52ccd18b9b4e6c5387bf4032f381ae816b5e77 | [
"MIT"
] | null | null | null | "Command-Line Arguments"
'''
The sys module is also where Python makes available the words typed on the command
that is used to start a Python script. These words are usually referred to as commandline
arguments and show up in sys.argv, a built-in list of strings.
'''
import sys
print(sys.argv)
'''
C:\...\PP4E\S... | 32.058824 | 89 | 0.718349 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,060 | 0.967153 |
701cc13b80e73e6036a93390352d580fb8410617 | 2,552 | py | Python | libraries/numbers.py | yoratoni/Euler-Python | 8272eed12162a9bdc33302554bb1af30e56a3e8b | [
"MIT"
] | null | null | null | libraries/numbers.py | yoratoni/Euler-Python | 8272eed12162a9bdc33302554bb1af30e56a3e8b | [
"MIT"
] | null | null | null | libraries/numbers.py | yoratoni/Euler-Python | 8272eed12162a9bdc33302554bb1af30e56a3e8b | [
"MIT"
] | null | null | null | from math import floor, ceil, sqrt, log2
from libraries import Digits
class Numbers:
@staticmethod
def is_perfect_square(n: int) -> bool:
'''Returns True if "n" is a perfect square.
Explanations:
https://www.quora.com/What-is-the-quickest-way-to-determine-if-a-number-is-a-perf... | 23.412844 | 99 | 0.487461 | 2,479 | 0.971395 | 0 | 0 | 2,432 | 0.952978 | 0 | 0 | 1,213 | 0.475313 |
701f2a15136d5b62583702284b584bce2f46610e | 7,131 | py | Python | s4/clarity/utils/artifact_ancestry.py | AvroNelson/s4-clarity-lib | af6f2ec77cdb7f942f5ea3990a61950aa2a1b3a4 | [
"MIT"
] | 11 | 2019-04-11T16:29:36.000Z | 2022-01-31T18:32:27.000Z | s4/clarity/utils/artifact_ancestry.py | AvroNelson/s4-clarity-lib | af6f2ec77cdb7f942f5ea3990a61950aa2a1b3a4 | [
"MIT"
] | 9 | 2019-04-13T17:08:39.000Z | 2021-12-07T23:31:01.000Z | s4/clarity/utils/artifact_ancestry.py | AvroNelson/s4-clarity-lib | af6f2ec77cdb7f942f5ea3990a61950aa2a1b3a4 | [
"MIT"
] | 10 | 2019-04-13T14:29:43.000Z | 2021-04-01T01:35:51.000Z | # Copyright 2017 Semaphore Solutions, Inc.
# ---------------------------------------------------------------------------
from collections import defaultdict
def get_parent_artifacts(lims, artifacts):
"""
Helper method to get the parent artifacts keyed to the supplied artifacts
:param LIMS lims:
:par... | 47.225166 | 130 | 0.715468 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 3,010 | 0.422101 |
701f6cd529e5e7fa4f16f7edc5345178425ab490 | 6,829 | py | Python | App/softwares_env/softwares/houdini_wizard/plugin.py | Wizard-collab/wizard | c2ec623fe011626716493c232b895fb0513f68ff | [
"MIT"
] | null | null | null | App/softwares_env/softwares/houdini_wizard/plugin.py | Wizard-collab/wizard | c2ec623fe011626716493c232b895fb0513f68ff | [
"MIT"
] | null | null | null | App/softwares_env/softwares/houdini_wizard/plugin.py | Wizard-collab/wizard | c2ec623fe011626716493c232b895fb0513f68ff | [
"MIT"
] | null | null | null | import hou
from wizard.prefs.main import prefs
from wizard.vars import defaults
from wizard.tools import log
from wizard.asset import main as asset_core
from softwares.houdini_wizard.tools import *
from wizard.tools import utility as utils
import os
import traceback
import shutil
from wizard.project import wall
from wi... | 37.729282 | 126 | 0.634793 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 638 | 0.093425 |
70219ccc098c06dd4bf333f450b426259e4c5b79 | 999 | py | Python | src/timers.py | julianviso/GW2FractalDailies | 02314c3d3c440b5359d11b3b38d986568105ef79 | [
"MIT"
] | 3 | 2018-04-21T05:14:49.000Z | 2018-06-13T11:05:32.000Z | src/timers.py | julianviso/GW2FractalDailies | 02314c3d3c440b5359d11b3b38d986568105ef79 | [
"MIT"
] | 18 | 2018-03-01T22:48:35.000Z | 2018-03-15T22:55:07.000Z | src/timers.py | julianviso/GW2FractalDailies | 02314c3d3c440b5359d11b3b38d986568105ef79 | [
"MIT"
] | null | null | null | import discord
from discord.ext import commands
#Helper Libraries
from datetime import datetime
import feedparser
import json
#Utils
import strings
#IRI: changed 'Server' to 'timers'
class timers(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.group(name="server", pass_context=True)... | 30.272727 | 94 | 0.686687 | 766 | 0.766767 | 0 | 0 | 669 | 0.66967 | 437 | 0.437437 | 161 | 0.161161 |
7022affd5d60868600ba08f00c4b7658c014b223 | 3,749 | py | Python | experiments/overalltests/report.py | WojciechMula/parsing-int-series | f0a45c8b1251018e52dac9ebf1d98e8dfb705755 | [
"BSD-2-Clause"
] | 19 | 2018-04-20T06:51:42.000Z | 2022-02-24T02:12:00.000Z | experiments/overalltests/report.py | WojciechMula/parsing-int-series | f0a45c8b1251018e52dac9ebf1d98e8dfb705755 | [
"BSD-2-Clause"
] | 2 | 2018-04-20T09:53:37.000Z | 2018-04-27T19:01:16.000Z | experiments/overalltests/report.py | WojciechMula/parsing-int-series | f0a45c8b1251018e52dac9ebf1d98e8dfb705755 | [
"BSD-2-Clause"
] | 3 | 2019-02-25T19:26:51.000Z | 2020-11-04T00:50:42.000Z | import sys
import os.path
if __name__ == '__main__' and __package__ is None:
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from table import Table
from loader import load
from utils import groupby
from report_writer import RestWriter
from prettyprint import *
class Report(objec... | 27.566176 | 106 | 0.523873 | 3,183 | 0.849026 | 0 | 0 | 0 | 0 | 0 | 0 | 344 | 0.091758 |
7022f0ca1aa21cce0352584f798c251857a2f29c | 1,110 | py | Python | guniflask/web/__init__.py | jadbin/guniflask | 36253a962c056abf34884263c6919b02b921ad9c | [
"MIT"
] | 12 | 2018-09-06T06:14:59.000Z | 2021-04-18T06:30:44.000Z | guniflask/web/__init__.py | jadbin/guniflask | 36253a962c056abf34884263c6919b02b921ad9c | [
"MIT"
] | null | null | null | guniflask/web/__init__.py | jadbin/guniflask | 36253a962c056abf34884263c6919b02b921ad9c | [
"MIT"
] | 2 | 2019-09-08T22:01:26.000Z | 2020-08-03T07:23:29.000Z | from .bind_annotation import blueprint
from .bind_annotation import delete_route
from .bind_annotation import get_route
from .bind_annotation import head_route
from .bind_annotation import patch_route
from .bind_annotation import post_route
from .bind_annotation import put_route
from .bind_annotation import route
from ... | 41.111111 | 49 | 0.882883 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7024b9fb216d801eb9ede1d16916c23d924df7a0 | 508 | py | Python | modules/versioning.py | jpolgesek/superdeploytool | b3bd7e3f409b110b8beab49d80f59b5c6cd28411 | [
"BSD-3-Clause"
] | 3 | 2019-07-04T05:00:36.000Z | 2020-02-09T14:20:35.000Z | modules/versioning.py | jpolgesek/superdeploytool | b3bd7e3f409b110b8beab49d80f59b5c6cd28411 | [
"BSD-3-Clause"
] | null | null | null | modules/versioning.py | jpolgesek/superdeploytool | b3bd7e3f409b110b8beab49d80f59b5c6cd28411 | [
"BSD-3-Clause"
] | null | null | null | #coding: utf-8
import os
import time
def get_version_string(dev = False, safe = True):
version = ["SDT-"]
try:
version.append(os.environ['GITLAB_TAG'].replace(".", ""))
except:
version.append("400")
try:
version.append(os.environ['CI_COMMIT_SHA'][:8])
except:
version.append("M")
try:
version.append(... | 17.517241 | 59 | 0.653543 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 82 | 0.161417 |
70257036b3b2cfab8988c675cf019d292c546a3e | 110 | py | Python | application/utils/utils.py | campos537/deep-fashion-system | 1de31dd6260cc967e1832cff63ae7e537a3a4e9d | [
"Unlicense"
] | 1 | 2021-04-06T00:43:26.000Z | 2021-04-06T00:43:26.000Z | application/utils/utils.py | campos537/deep-fashion-system | 1de31dd6260cc967e1832cff63ae7e537a3a4e9d | [
"Unlicense"
] | null | null | null | application/utils/utils.py | campos537/deep-fashion-system | 1de31dd6260cc967e1832cff63ae7e537a3a4e9d | [
"Unlicense"
] | null | null | null | import base64
def get_result(result):
stream = base64.decodebytes(result)
return stream.decode()
| 18.333333 | 39 | 0.709091 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7026d3905231076109cce84e7fcd5feb02e48371 | 5,376 | py | Python | sr/robot3/astoria.py | srobo/sr-robot3 | af88d44d681c4f730c2196eaab8c7cbaf4e39d98 | [
"MIT"
] | 4 | 2020-08-31T15:33:09.000Z | 2022-01-22T18:50:20.000Z | sr/robot3/astoria.py | srobo/sr-robot3 | af88d44d681c4f730c2196eaab8c7cbaf4e39d98 | [
"MIT"
] | 22 | 2020-07-02T20:59:09.000Z | 2022-02-23T20:47:17.000Z | sr/robot3/astoria.py | srobo/sr-robot3 | af88d44d681c4f730c2196eaab8c7cbaf4e39d98 | [
"MIT"
] | null | null | null | """Integration with Astoria."""
import asyncio
import logging
from json import JSONDecodeError, loads
from pathlib import Path
from typing import Match, NamedTuple, Optional
from astoria.common.broadcast_event import StartButtonBroadcastEvent
from astoria.common.consumer import StateConsumer
from astoria.common.messa... | 35.84 | 89 | 0.638393 | 4,791 | 0.891183 | 0 | 0 | 815 | 0.1516 | 2,164 | 0.40253 | 1,115 | 0.207403 |
70271af1935553bf3f9705882222dbc48f6d6a66 | 224 | py | Python | tests/test_day_16_puzzle_1.py | LuckyJosh/advent-of-code-2017 | 17498d385857dee4bb44ded5668d56c758b0a601 | [
"MIT"
] | null | null | null | tests/test_day_16_puzzle_1.py | LuckyJosh/advent-of-code-2017 | 17498d385857dee4bb44ded5668d56c758b0a601 | [
"MIT"
] | null | null | null | tests/test_day_16_puzzle_1.py | LuckyJosh/advent-of-code-2017 | 17498d385857dee4bb44ded5668d56c758b0a601 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# encoding: utf-8
from aoc2017.day_16 import permutations_1
def test_permutations_1_1():
input_ = "s1,x3/4,pe/b"
output = "baedc"
assert permutations_1(input_, num_programs=5) == output
| 20.363636 | 59 | 0.705357 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 60 | 0.267857 |
7027a4d1caf0562a27d727b8404b172b031ef778 | 70,409 | py | Python | bmModerator.py | Dokument/BM-Moderator | 5e42e7470d7bb8557b685c7bf340952552ff34b6 | [
"MIT"
] | 4 | 2015-09-19T16:02:23.000Z | 2021-12-02T09:40:26.000Z | bmModerator.py | Dokument/BM-Moderator | 5e42e7470d7bb8557b685c7bf340952552ff34b6 | [
"MIT"
] | null | null | null | bmModerator.py | Dokument/BM-Moderator | 5e42e7470d7bb8557b685c7bf340952552ff34b6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Created by Adam Melton (.dok) referenceing https://bitmessage.org/wiki/API_Reference for API documentation
# Distributed under the MIT/X11 software license. See the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
import time
import sys
import os
import json
i... | 42.906155 | 238 | 0.596898 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 22,333 | 0.31719 |
702856a844bc02746010db0b224ea515479a1f56 | 428 | py | Python | geocontrib/migrations/0014_featuretype_title_optional.py | neogeo-technologies/collab | d205efd0a05b98c8c1781a777c0512b042580b73 | [
"Apache-2.0"
] | 3 | 2019-09-10T09:03:02.000Z | 2019-10-24T08:23:21.000Z | geocontrib/migrations/0014_featuretype_title_optional.py | neogeo-technologies/geocontrib | 868bbcdbb575cf8ff0ab2bb6782e64fd1ac0ee6f | [
"Apache-2.0"
] | 14 | 2020-01-27T09:49:33.000Z | 2021-06-14T08:04:10.000Z | geocontrib/migrations/0014_featuretype_title_optional.py | neogeo-technologies/geocontrib | 868bbcdbb575cf8ff0ab2bb6782e64fd1ac0ee6f | [
"Apache-2.0"
] | 9 | 2020-01-16T12:37:39.000Z | 2021-04-22T09:57:59.000Z | # Generated by Django 2.2.24 on 2021-09-21 10:21
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('geocontrib', '0013_importtask'),
]
operations = [
migrations.AddField(
model_name='featuretype',
name='title_option... | 22.526316 | 85 | 0.623832 | 334 | 0.780374 | 0 | 0 | 0 | 0 | 0 | 0 | 123 | 0.287383 |
70286ba80aa0dcbcd5927cc49e7eaf9282e97eb5 | 11,998 | py | Python | examples/virsim/heatmap_PO.py | wedeling/FabUQCampaign | f89ee1a7b72ec1c41d6bf662f1b42acd8065cb32 | [
"BSD-3-Clause"
] | 1 | 2020-06-26T10:37:56.000Z | 2020-06-26T10:37:56.000Z | examples/virsim/heatmap_PO.py | wedeling/FabUQCampaign | f89ee1a7b72ec1c41d6bf662f1b42acd8065cb32 | [
"BSD-3-Clause"
] | null | null | null | examples/virsim/heatmap_PO.py | wedeling/FabUQCampaign | f89ee1a7b72ec1c41d6bf662f1b42acd8065cb32 | [
"BSD-3-Clause"
] | 2 | 2020-04-20T12:50:11.000Z | 2020-04-24T10:35:13.000Z | """
@author: Federica Gugole
__license__= "LGPL"
"""
import numpy as np
import easyvvuq as uq
import os
import pandas as pd
from mpl_toolkits.mplot3d import Axes3D
import matplotlib.pyplot as plt
from matplotlib.ticker import ScalarFormatter, NullFormatter
plt.rcParams.update({'font.size': 20})
plt.rcParams['figure.f... | 44.60223 | 138 | 0.699783 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,844 | 0.153692 |
702871323b08cb3d0bde41f82365acd11a63fda1 | 715 | py | Python | util/FeatureExtractor.py | GaoZiqiang/Multiview-ObjectDetection | 41d28bc15622b4d3a863ba4c8b53b06f6b3b1568 | [
"MIT"
] | 370 | 2018-05-22T06:46:35.000Z | 2022-03-18T07:20:21.000Z | util/FeatureExtractor.py | GaoZiqiang/Multiview-ObjectDetection | 41d28bc15622b4d3a863ba4c8b53b06f6b3b1568 | [
"MIT"
] | 51 | 2018-06-21T02:04:07.000Z | 2022-03-22T08:25:03.000Z | util/FeatureExtractor.py | GaoZiqiang/Multiview-ObjectDetection | 41d28bc15622b4d3a863ba4c8b53b06f6b3b1568 | [
"MIT"
] | 107 | 2018-06-04T21:03:04.000Z | 2022-03-26T13:38:29.000Z | import torch.nn as nn
from IPython import embed
class FeatureExtractor(nn.Module):
def __init__(self,submodule,extracted_layers):
super(FeatureExtractor,self).__init__()
self.submodule = submodule
self.extracted_layers = extracted_layers
def forward(self, x):
outputs = []
... | 35.75 | 69 | 0.586014 | 666 | 0.931469 | 0 | 0 | 0 | 0 | 0 | 0 | 17 | 0.023776 |
702ab5d14dffadaaaf35c2b6190c43a4011cbf37 | 2,758 | py | Python | 075_sort_colors.py | gengwg/leetcode | 0af5256ec98149ef5863f3bba78ed1e749650f6e | [
"Apache-2.0"
] | 2 | 2018-04-24T19:17:40.000Z | 2018-04-24T19:33:52.000Z | 075_sort_colors.py | gengwg/leetcode | 0af5256ec98149ef5863f3bba78ed1e749650f6e | [
"Apache-2.0"
] | null | null | null | 075_sort_colors.py | gengwg/leetcode | 0af5256ec98149ef5863f3bba78ed1e749650f6e | [
"Apache-2.0"
] | 3 | 2020-06-17T05:48:52.000Z | 2021-01-02T06:08:25.000Z | # -*- coding: utf-8 -*-
"""
75. Sort Colors
Given an array with n objects colored red, white or blue,
sort them so that objects of the same color are adjacent,
with the colors in the order red, white and blue.
Here, we will use the integers 0, 1, and 2
to represent the color red, white, and blue respectively.
Note:
... | 28.142857 | 79 | 0.533358 | 2,293 | 0.727013 | 0 | 0 | 0 | 0 | 0 | 0 | 2,113 | 0.669943 |
702be8919da263b06d997a50b76d2360b8199c9d | 3,004 | py | Python | BioClients/lincs/Client.py | jeremyjyang/BioClients | b78ab2b948c79616fed080112e31d383346bec58 | [
"CC0-1.0"
] | 10 | 2020-05-26T07:29:14.000Z | 2021-12-06T21:33:40.000Z | BioClients/lincs/Client.py | jeremyjyang/BioClients | b78ab2b948c79616fed080112e31d383346bec58 | [
"CC0-1.0"
] | 1 | 2021-10-05T12:25:30.000Z | 2021-10-05T17:05:56.000Z | BioClients/lincs/Client.py | jeremyjyang/BioClients | b78ab2b948c79616fed080112e31d383346bec58 | [
"CC0-1.0"
] | 2 | 2021-03-16T03:20:24.000Z | 2021-08-08T20:17:10.000Z | #!/usr/bin/env python3
"""
LINCS REST API client
New (2019) iLINCS:
http://www.ilincs.org/ilincs/APIinfo
http://www.ilincs.org/ilincs/APIdocumentation
(http://lincsportal.ccs.miami.edu/dcic/api/ DEPRECATED?)
"""
###
import sys,os,argparse,re,time,json,logging
#
from .. import lincs
#
##################################... | 34.528736 | 116 | 0.689414 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,275 | 0.424434 |
702d9230949781af5e800d83e6baff01ebc0e462 | 85 | py | Python | app/snyk/config.py | snyk-schmidtty/snyk-watcher | e9dc94389e0aaaba3d2b6b3a03b23d5224aabfa9 | [
"MIT"
] | 18 | 2021-02-18T04:31:20.000Z | 2022-03-26T02:22:47.000Z | app/snyk/config.py | snyk-schmidtty/snyk-watcher | e9dc94389e0aaaba3d2b6b3a03b23d5224aabfa9 | [
"MIT"
] | 1 | 2022-02-16T22:43:49.000Z | 2022-02-16T22:43:49.000Z | app/snyk/config.py | snyk-schmidtty/snyk-watcher | e9dc94389e0aaaba3d2b6b3a03b23d5224aabfa9 | [
"MIT"
] | 6 | 2021-02-25T18:10:38.000Z | 2022-02-16T22:52:41.000Z | import os
def get_snyk_token():
return os.environ.get('SECRET_SNYK_API_TOKEN')
| 14.166667 | 50 | 0.752941 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 23 | 0.270588 |
702deac53a6f7eec5736db9cd85faf43d09eb46d | 117 | py | Python | tests/m3u/__init__.py | kyleheyne/mopidy | 3b1b0dd2e9052cadb7bd1a29e724498f9fba7bca | [
"Apache-2.0"
] | 2 | 2019-02-13T15:16:55.000Z | 2019-02-18T08:47:29.000Z | tests/m3u/__init__.py | kyleheyne/mopidy | 3b1b0dd2e9052cadb7bd1a29e724498f9fba7bca | [
"Apache-2.0"
] | 40 | 2019-02-13T09:33:00.000Z | 2019-02-19T13:21:12.000Z | tests/m3u/__init__.py | kyleheyne/mopidy | 3b1b0dd2e9052cadb7bd1a29e724498f9fba7bca | [
"Apache-2.0"
] | 1 | 2021-10-01T17:26:30.000Z | 2021-10-01T17:26:30.000Z | from __future__ import absolute_import, unicode_literals
def generate_song(i):
return 'dummy:track:song%s' % i
| 19.5 | 56 | 0.769231 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 20 | 0.17094 |
702ffbf7e8d1d0ad0ebb44737dc759a0391e4cba | 13,693 | py | Python | datagrid_gtk3/utils/transformations.py | nowsecure/datagrid-gtk3 | 28083a4b9b4e2e0c7fbe2755d8464d2b02163086 | [
"MIT"
] | 17 | 2015-07-02T20:02:42.000Z | 2021-05-06T06:08:13.000Z | datagrid_gtk3/utils/transformations.py | esosaja/datagrid-gtk3 | 28083a4b9b4e2e0c7fbe2755d8464d2b02163086 | [
"MIT"
] | 32 | 2015-04-27T16:49:10.000Z | 2015-08-25T16:07:29.000Z | datagrid_gtk3/utils/transformations.py | esosaja/datagrid-gtk3 | 28083a4b9b4e2e0c7fbe2755d8464d2b02163086 | [
"MIT"
] | 8 | 2015-04-28T10:45:03.000Z | 2016-10-06T08:22:39.000Z | """Data transformation utils."""
import datetime
import logging
import HTMLParser
from decimal import Decimal
import dateutil.parser
from gi.repository import Gtk
from datagrid_gtk3.utils import imageutils
from datagrid_gtk3.utils import dateutils
from datagrid_gtk3.utils import stringutils
logger = logging.getLog... | 30.028509 | 79 | 0.682027 | 0 | 0 | 0 | 0 | 11,884 | 0.867889 | 0 | 0 | 7,846 | 0.572994 |
70308c9bdc16492685bb5f8a040a5a606edea463 | 3,974 | py | Python | src/models/kmeans.py | stevieg3/when-do-reading-comprehension-models-learn | 22d348bb9b340ee84ecd135670890c1b1fe0db18 | [
"MIT"
] | null | null | null | src/models/kmeans.py | stevieg3/when-do-reading-comprehension-models-learn | 22d348bb9b340ee84ecd135670890c1b1fe0db18 | [
"MIT"
] | null | null | null | src/models/kmeans.py | stevieg3/when-do-reading-comprehension-models-learn | 22d348bb9b340ee84ecd135670890c1b1fe0db18 | [
"MIT"
] | null | null | null | import argparse
import logging
import pandas as pd
import numpy as np
from tslearn.clustering import TimeSeriesKMeans
from tqdm import tqdm
logging.basicConfig(format="%(asctime)s - %(message)s", level=logging.INFO)
SEEDS = [27, 28, 29]
MODELS = ['dbert', 'dbidaf', 'droberta', 'squad']
DEV_DATA_SIZES = {
'dber... | 28.797101 | 118 | 0.682436 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 731 | 0.183946 |
7030f0982bdae2e9f2824ec5016f8698dc386f6c | 496 | py | Python | omnibot/numeric.py | AunSiro/omnibot | 7f95814907c5903c5996c70c22e2342562dedadb | [
"MIT"
] | null | null | null | omnibot/numeric.py | AunSiro/omnibot | 7f95814907c5903c5996c70c22e2342562dedadb | [
"MIT"
] | null | null | null | omnibot/numeric.py | AunSiro/omnibot | 7f95814907c5903c5996c70c22e2342562dedadb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Oct 22 18:21:32 2020
@author: Siro Moreno
"""
import numpy as np
l = 0.2096
L = 0.2096
L_2 = (L + l) / (2 ** 0.5)
l_2 = 0.0
r = 0.0667
m = 15.75
I_w = 0.00266
I_z = 0.461
phi_dot_max = 2 * np.pi * 7000 / (49 * 60)
psi_dot_max = phi_dot_max * 0.0667 / (2 ** 0.5 * 0.29642)
... | 17.714286 | 63 | 0.566532 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 88 | 0.177419 |
7031785a0dfa5b63b843961bc1f7373b3543b899 | 8,301 | py | Python | scripts/analyze_leaderboard.py | VIDA-NYU/alphad3m | db40193a448300d87442c451f9da17fa5cb845fd | [
"Apache-2.0"
] | null | null | null | scripts/analyze_leaderboard.py | VIDA-NYU/alphad3m | db40193a448300d87442c451f9da17fa5cb845fd | [
"Apache-2.0"
] | null | null | null | scripts/analyze_leaderboard.py | VIDA-NYU/alphad3m | db40193a448300d87442c451f9da17fa5cb845fd | [
"Apache-2.0"
] | null | null | null | import os
import re
import logging
import pandas as pd
from bs4 import BeautifulSoup
from os.path import join, exists, dirname
from prettytable import PrettyTable
logger = logging.getLogger(__name__)
ALL_TA2S = {'NYU-TA2', 'CMU-TA2', 'UCB-TA2', 'Uncharted-TA2', 'SRI-TA2', 'Texas A&M-TA2', 'D3M ENSEMBLE-TA2', 'NEW-NYU... | 38.077982 | 124 | 0.654499 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,792 | 0.215878 |
7031e7b7a07729e1593c15fa18b6a42894035c58 | 522 | py | Python | ArmstrongN.py | JHONATAN9A/Algritmo_num_narcisistas | b40cff2588b41efecf180e932cd7a104974d72c7 | [
"MIT"
] | null | null | null | ArmstrongN.py | JHONATAN9A/Algritmo_num_narcisistas | b40cff2588b41efecf180e932cd7a104974d72c7 | [
"MIT"
] | null | null | null | ArmstrongN.py | JHONATAN9A/Algritmo_num_narcisistas | b40cff2588b41efecf180e932cd7a104974d72c7 | [
"MIT"
] | null | null | null | def proceso(num, suma=0):
numero = []
for i in str(num):
exp = int(i) ** len(str(num))
numero.append(exp)
if len(numero) == len(str(num)):
total = sum(numero)
return num, total
numero.clear()
entrada = input()
datos = []
for i in range(int(entrada)):
entrada2 ... | 18 | 37 | 0.557471 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 26 | 0.049808 |
7032edb61921b45f1c8f0a54a32060e1a5dc7971 | 683 | py | Python | core/urls.py | mburst/burstolio | aa3c89986b600a2c444ed6a39d07e8f2013e1b7e | [
"BSD-2-Clause"
] | 2 | 2015-10-21T09:00:21.000Z | 2017-01-19T09:53:05.000Z | core/urls.py | mburst/burstolio | aa3c89986b600a2c444ed6a39d07e8f2013e1b7e | [
"BSD-2-Clause"
] | 6 | 2021-04-08T18:22:12.000Z | 2022-02-10T10:50:11.000Z | core/urls.py | mburst/burstolio | aa3c89986b600a2c444ed6a39d07e8f2013e1b7e | [
"BSD-2-Clause"
] | 1 | 2015-08-18T05:20:59.000Z | 2015-08-18T05:20:59.000Z | from django.conf.urls import url
from django.views.generic import TemplateView
from core import views
from core.feeds import rss_feed, atom_feed
app_name = 'core'
urlpatterns = [
url(r'^$', views.blog, name='home'),
url(r'^blog/$', views.blog, name='blog'),
url(r'^blog/(?P<slug>.*)/$', views.entry, name=... | 35.947368 | 80 | 0.66325 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 206 | 0.301611 |
7032f2619f5d9022162264acdbe5700a7785cd5d | 1,110 | py | Python | clib/printenv.py | 7exe/lostia-professional-dev | 148b86286abf7bd89f7ff96ba83b5b629442ebd8 | [
"MIT"
] | null | null | null | clib/printenv.py | 7exe/lostia-professional-dev | 148b86286abf7bd89f7ff96ba83b5b629442ebd8 | [
"MIT"
] | null | null | null | clib/printenv.py | 7exe/lostia-professional-dev | 148b86286abf7bd89f7ff96ba83b5b629442ebd8 | [
"MIT"
] | null | null | null | import command
import sys
count = 0
newEnvVarName = []
newEnvVarValue = []
for I in command.env_var_name:
newEnvVarName.append(I.replace("\n",""))
for I in command.env_var_value:
newEnvVarValue.append(I.replace("\n",""))
endPrint = False
for I in command.env_var_name:
if(command.new_arg_parser("-0") or command.... | 28.461538 | 99 | 0.587387 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 72 | 0.064865 |
7036904272e13a83b49efc934453218e894c4ca2 | 3,050 | py | Python | scripts/artifacts/textnowCallLogs.py | JamieSharpe/ALEAPP | acb06736d772d75c9dc0fd58b9f2a1726e795fb4 | [
"MIT"
] | null | null | null | scripts/artifacts/textnowCallLogs.py | JamieSharpe/ALEAPP | acb06736d772d75c9dc0fd58b9f2a1726e795fb4 | [
"MIT"
] | null | null | null | scripts/artifacts/textnowCallLogs.py | JamieSharpe/ALEAPP | acb06736d772d75c9dc0fd58b9f2a1726e795fb4 | [
"MIT"
] | null | null | null | import datetime
from scripts.ilapfuncs import timeline, open_sqlite_db_readonly
from scripts.plugin_base import ArtefactPlugin
from scripts.ilapfuncs import logfunc, tsv
from scripts import artifact_report
class TextNowCallLogsPlugin(ArtefactPlugin):
"""
"""
def __init__(self):
super().__init__(... | 37.195122 | 150 | 0.543934 | 2,840 | 0.931148 | 0 | 0 | 0 | 0 | 0 | 0 | 857 | 0.280984 |
7036e2c26d71d55c8481efe9233c9812c9f0408e | 277 | py | Python | medicalboard/users/forms.py | japrogramer/BoardStream | d9d30bf2d873591f3be377e14885fc70e26a74b8 | [
"BSD-3-Clause"
] | null | null | null | medicalboard/users/forms.py | japrogramer/BoardStream | d9d30bf2d873591f3be377e14885fc70e26a74b8 | [
"BSD-3-Clause"
] | null | null | null | medicalboard/users/forms.py | japrogramer/BoardStream | d9d30bf2d873591f3be377e14885fc70e26a74b8 | [
"BSD-3-Clause"
] | null | null | null | from django.apps import apps
from django import forms
from django.contrib.auth import get_user_model
from .models import Follow
# Follow = apps.get_model('Users', 'Follow')
class FollowForm(forms.ModelForm):
class Meta:
exclude = set()
model = Follow
| 17.3125 | 46 | 0.711191 | 98 | 0.353791 | 0 | 0 | 0 | 0 | 0 | 0 | 44 | 0.158845 |
7037e9a6bcb772f5d5c6de5b125d568f1673c72f | 2,145 | py | Python | omnibot_description/launch/display.launch.py | felipemohr/omniBot | e235b0bf016ecc82a917cb9ec7d86f62accd4e81 | [
"Apache-2.0"
] | 2 | 2022-01-06T16:23:49.000Z | 2022-02-20T12:10:09.000Z | omnibot_description/launch/display.launch.py | felipemohr/omniBot | e235b0bf016ecc82a917cb9ec7d86f62accd4e81 | [
"Apache-2.0"
] | null | null | null | omnibot_description/launch/display.launch.py | felipemohr/omniBot | e235b0bf016ecc82a917cb9ec7d86f62accd4e81 | [
"Apache-2.0"
] | 1 | 2022-03-10T01:33:00.000Z | 2022-03-10T01:33:00.000Z | import launch
from launch.substitutions import Command, LaunchConfiguration
from launch_ros.substitutions import FindPackageShare
from launch_ros.actions import Node
import os
def generate_launch_description():
pkg_share = FindPackageShare(package='omnibot_description').find('omnibot_description')
default_model_pa... | 42.058824 | 100 | 0.716084 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 577 | 0.268998 |
703a9b063f761ade9c2123a1def345dd3a9fc462 | 138 | py | Python | pyplex/gl/__init__.py | pyplex/pyplex | 66e19acb3efd1a8a69d28022edcb0b6ad5cb6b11 | [
"MIT"
] | 5 | 2018-01-17T09:08:38.000Z | 2020-09-20T20:38:51.000Z | pyplex/gl/__init__.py | pyplex/pyplex | 66e19acb3efd1a8a69d28022edcb0b6ad5cb6b11 | [
"MIT"
] | null | null | null | pyplex/gl/__init__.py | pyplex/pyplex | 66e19acb3efd1a8a69d28022edcb0b6ad5cb6b11 | [
"MIT"
] | null | null | null | from .gl import GL20, GL21, GL30, GL31, GL32, GL33, GL40, GL41, GL42, GL43, GL44, GL45, GL_ANY
from .enum import *
from .constant import * | 46 | 94 | 0.710145 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
703aacd66e46deed1090e868e263e907aa004b9c | 78 | py | Python | metaL/core/__init__.py | ponyatov/metaLmin | 6634b67465ea448c4a763d7c035b851579378ffd | [
"MIT"
] | null | null | null | metaL/core/__init__.py | ponyatov/metaLmin | 6634b67465ea448c4a763d7c035b851579378ffd | [
"MIT"
] | null | null | null | metaL/core/__init__.py | ponyatov/metaLmin | 6634b67465ea448c4a763d7c035b851579378ffd | [
"MIT"
] | null | null | null | from .object import *
from .ns import *
from .io import *
from .time import *
| 15.6 | 21 | 0.692308 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
703b0d817daf3c22ee84731783d61b246681b5da | 13,307 | py | Python | db_adapter/curw_obs/timeseries/timeseries.py | CUrW-SL/curw_db_adapter | 9d9ef24f42080910e0bd251bc7f001b0a4b0ab31 | [
"MIT"
] | 2 | 2019-04-26T07:50:33.000Z | 2019-09-28T20:15:33.000Z | db_adapter/curw_obs/timeseries/timeseries.py | CUrW-SL/curw_db_adapter | 9d9ef24f42080910e0bd251bc7f001b0a4b0ab31 | [
"MIT"
] | 1 | 2019-04-03T09:30:38.000Z | 2019-04-20T18:11:59.000Z | db_adapter/curw_obs/timeseries/timeseries.py | shadhini/curw_db_adapter | 4db8e1ea8794ffbd0dce29ac954a13315e83d843 | [
"MIT"
] | null | null | null | import pandas as pd
import hashlib
import json
import traceback
from pymysql import IntegrityError
from datetime import datetime, timedelta
from db_adapter.logger import logger
from db_adapter.exceptions import DatabaseAdapterError, DuplicateEntryError
from db_adapter.curw_obs.station import StationEnum
from db_adapte... | 39.841317 | 128 | 0.559931 | 12,941 | 0.972496 | 0 | 0 | 1,052 | 0.079056 | 0 | 0 | 6,245 | 0.469302 |
703d952afd1d46ba74ddbc33b7e1cb8c8c05aa16 | 1,148 | py | Python | apps/sales/urls.py | jorgesaw/kstore | 4ec6612eeeb96edb7b7bd374fd0520733c58451c | [
"MIT"
] | null | null | null | apps/sales/urls.py | jorgesaw/kstore | 4ec6612eeeb96edb7b7bd374fd0520733c58451c | [
"MIT"
] | 5 | 2021-03-19T10:16:00.000Z | 2022-02-10T09:16:32.000Z | apps/sales/urls.py | jorgesaw/kstore | 4ec6612eeeb96edb7b7bd374fd0520733c58451c | [
"MIT"
] | null | null | null | """Sales app URLs."""
# Django
from django.urls import path, include
# Views
from .views import customers as customers_views
from .views import sales as sales_views
urlpatterns = [
path('customers/', customers_views.CustomerFilterListViev.as_view(), name='customers'),
path('customers/create/', ... | 45.92 | 110 | 0.708188 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 358 | 0.311847 |
703da8b7398940bbb0b6d9ff84c7efd2ef81c2cf | 671 | py | Python | python3/learn-python/Loops and Iterations - For-While Loops.py | Nahid-Hassan/code-snippets | 24bd4b81564887822a0801a696001fcbeb6a7a75 | [
"MIT"
] | 2 | 2020-09-29T04:09:41.000Z | 2020-10-18T13:33:36.000Z | python3/learn-python/Loops and Iterations - For-While Loops.py | Nahid-Hassan/code-snippets | 24bd4b81564887822a0801a696001fcbeb6a7a75 | [
"MIT"
] | null | null | null | python3/learn-python/Loops and Iterations - For-While Loops.py | Nahid-Hassan/code-snippets | 24bd4b81564887822a0801a696001fcbeb6a7a75 | [
"MIT"
] | 1 | 2021-12-26T04:55:55.000Z | 2021-12-26T04:55:55.000Z | ############### for ###################
nums = [1, 2, 3, 4, 5]
# simple loop
for num in nums:
print(num)
# break keyword
for num in nums:
if num == 3:
print("found")
break
print(num)
# continue keyword
for num in nums:
if num == 3:
print("found")
continue
print(num... | 14.586957 | 39 | 0.463487 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 227 | 0.338301 |
703e4e98ab16c2be1441e85c762d949e4c5d97f4 | 1,704 | py | Python | 4_Median-of-Two-Sorted-Arrays.py | Coalin/Daily-LeetCode-Exercise | a064dcdc3a82314be4571d342c4807291a24f69f | [
"MIT"
] | 3 | 2018-07-05T05:51:10.000Z | 2019-05-04T08:35:44.000Z | 4_Median-of-Two-Sorted-Arrays.py | Coalin/Daily-LeetCode-Exercise | a064dcdc3a82314be4571d342c4807291a24f69f | [
"MIT"
] | null | null | null | 4_Median-of-Two-Sorted-Arrays.py | Coalin/Daily-LeetCode-Exercise | a064dcdc3a82314be4571d342c4807291a24f69f | [
"MIT"
] | null | null | null | # Method I:
# Accepted while the time complexity equals to O(nlogn) due to the sort function.
# 66.68%; 144ms.
class Solution(object):
def findMedianSortedArrays(self, nums1, nums2):
"""
:type nums1: List[int]
:type nums2: List[int]
:rtype: float
"""
len_1 = len(nums... | 28.881356 | 81 | 0.508803 | 1,411 | 0.828052 | 0 | 0 | 0 | 0 | 0 | 0 | 477 | 0.27993 |
703eb8f1a89f48d0c52579466960933c96dd59e6 | 7,830 | py | Python | python_scripts/extract.py | Sessa93/continuous-auth-service | c4131521a7960ab709c0eeaf43686ddea9bd8ba2 | [
"MIT"
] | 9 | 2018-09-17T07:33:05.000Z | 2022-02-13T12:41:03.000Z | python_scripts/extract.py | mykola-nec/keystroke- | e045bbbae1205629a4cc4bd369c0a0b5dd6fd93f | [
"MIT"
] | 1 | 2018-10-24T05:32:08.000Z | 2018-10-24T05:32:08.000Z | python_scripts/extract.py | mykola-nec/keystroke- | e045bbbae1205629a4cc4bd369c0a0b5dd6fd93f | [
"MIT"
] | 3 | 2018-10-20T14:37:23.000Z | 2021-04-19T13:45:00.000Z | # pylint: disable = C0111, C0103, C0411, C0301, W0102, C0330, W0603
"""This module is used to extract the key_holds times and digraph
up_down times from the raw events of the subjects."""
import read_write
import numpy as np
import operator
import time
import general_purpose
import sys
import py_node_communication a... | 40.569948 | 147 | 0.627075 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,898 | 0.370115 |
7041318399ceaa12c9af5eb0808df75d0fc60902 | 37,836 | py | Python | src/borg/repository.py | musoke/borg | 808379921c4a679bb597db42b4412840d66f4fb1 | [
"BSD-3-Clause"
] | null | null | null | src/borg/repository.py | musoke/borg | 808379921c4a679bb597db42b4412840d66f4fb1 | [
"BSD-3-Clause"
] | null | null | null | src/borg/repository.py | musoke/borg | 808379921c4a679bb597db42b4412840d66f4fb1 | [
"BSD-3-Clause"
] | null | null | null | import errno
import os
import shutil
import struct
from binascii import unhexlify
from collections import defaultdict
from configparser import ConfigParser
from datetime import datetime
from functools import partial
from itertools import islice
from zlib import crc32
import msgpack
import logging
logger = logging.get... | 42.086763 | 130 | 0.597341 | 36,949 | 0.976557 | 1,813 | 0.047917 | 66 | 0.001744 | 0 | 0 | 8,077 | 0.213474 |
704239be8a576b9afe64abe3d128ac6481c4c3c9 | 848 | py | Python | care/facility/api/serializers/uccbedrequest.py | tncwr/care | 97731bfa8371332d898d82152e9cd85bbedea8c5 | [
"MIT"
] | null | null | null | care/facility/api/serializers/uccbedrequest.py | tncwr/care | 97731bfa8371332d898d82152e9cd85bbedea8c5 | [
"MIT"
] | null | null | null | care/facility/api/serializers/uccbedrequest.py | tncwr/care | 97731bfa8371332d898d82152e9cd85bbedea8c5 | [
"MIT"
] | null | null | null | from django.db.models import F
from rest_framework import serializers
from care.facility.models.uccbedrequest import UCCBedRequest
from care.users.api.serializers.user import UserBaseMinimumSerializer
from config.serializers import ChoiceField
from care.facility.api.serializers import TIMESTAMP_FIELDS
class UCCBed... | 26.5 | 85 | 0.693396 | 539 | 0.635613 | 0 | 0 | 0 | 0 | 0 | 0 | 116 | 0.136792 |
704531b99c3207b1f632a1232fdc5ebbfdf4152e | 28,802 | py | Python | builder/builder.py | jmcb/murderrl | d5e1e06a16f8a9816e0bd6dcb2fad1738348c62c | [
"Unlicense",
"MIT"
] | 5 | 2015-04-16T18:47:05.000Z | 2021-11-15T22:56:29.000Z | builder/builder.py | jmcb/murderrl | d5e1e06a16f8a9816e0bd6dcb2fad1738348c62c | [
"Unlicense",
"MIT"
] | null | null | null | builder/builder.py | jmcb/murderrl | d5e1e06a16f8a9816e0bd6dcb2fad1738348c62c | [
"Unlicense",
"MIT"
] | 4 | 2015-11-11T18:54:30.000Z | 2021-08-22T03:59:57.000Z | #!/usr/bin/env python
"""
Attempt to create a "manor" akin to::
###############################################
#.........#......#........#...........#.......#
#.........#......#........#...........#.......#
#.........#......#........#...........#.......#
#.........#......#........#...........#.......#
###... | 36.597205 | 201 | 0.619436 | 4,051 | 0.14065 | 0 | 0 | 0 | 0 | 0 | 0 | 8,732 | 0.303173 |
70465e9867bb2b388f94f65d7c4303d55318d2bb | 1,126 | py | Python | mtorch/core/data/data_loaders/vision/cifar10.py | NullConvergence/torch_temp | 29a0d7190f0be6124f51bd85b8320cd8b3cef29a | [
"MIT"
] | 3 | 2019-08-08T13:23:50.000Z | 2019-08-15T15:29:36.000Z | mtorch/core/data/data_loaders/vision/cifar10.py | NullConvergence/torch-template | 29a0d7190f0be6124f51bd85b8320cd8b3cef29a | [
"MIT"
] | 10 | 2019-09-20T21:25:22.000Z | 2019-10-16T10:52:04.000Z | mtorch/core/data/data_loaders/vision/cifar10.py | NullConvergence/mtorch | 29a0d7190f0be6124f51bd85b8320cd8b3cef29a | [
"MIT"
] | 2 | 2019-08-08T13:23:52.000Z | 2019-08-08T19:46:55.000Z | from torchvision import datasets, transforms
from core.data.data_loaders.base import BaseDataLoader
class CIFAR10Loader(BaseDataLoader):
""" CIFAR10 data loading + transformations """
def __init__(self, data_dir,
batch_size=128,
training=True,
validation_spl... | 36.322581 | 79 | 0.601243 | 1,023 | 0.908526 | 0 | 0 | 0 | 0 | 0 | 0 | 177 | 0.157194 |
7046602c016348dec7c023f79d562d05998a1063 | 1,751 | py | Python | rtutil/content_data.py | yaakiyu/rt-bot | f68bca95c516e08c31ecc846524dcea4c8ba1503 | [
"BSD-4-Clause"
] | null | null | null | rtutil/content_data.py | yaakiyu/rt-bot | f68bca95c516e08c31ecc846524dcea4c8ba1503 | [
"BSD-4-Clause"
] | null | null | null | rtutil/content_data.py | yaakiyu/rt-bot | f68bca95c516e08c31ecc846524dcea4c8ba1503 | [
"BSD-4-Clause"
] | null | null | null | # RT Util - Content Data
from typing import TypedDict, Any
from textwrap import shorten
from discord import Embed
from orjson import loads
from .utils import is_json
__all__ = (
"ContentData", "disable_content_json", "enable_content_json",
"convert_content_json", "to_text"
)
class ContentData(TypedDict... | 29.677966 | 95 | 0.683038 | 157 | 0.081813 | 0 | 0 | 0 | 0 | 0 | 0 | 627 | 0.326733 |
704714d83f647fd1d63d1eea3b51b21e192ee2bc | 1,270 | py | Python | simmbse/link.py | tsherburne/ma_sim | 4082da1c80401dec4293415bc9e9239a6bb8185d | [
"BSD-3-Clause"
] | null | null | null | simmbse/link.py | tsherburne/ma_sim | 4082da1c80401dec4293415bc9e9239a6bb8185d | [
"BSD-3-Clause"
] | null | null | null | simmbse/link.py | tsherburne/ma_sim | 4082da1c80401dec4293415bc9e9239a6bb8185d | [
"BSD-3-Clause"
] | null | null | null | import simpy
DEF_LINK_CAPACITY = 5
DEF_LINK_DELAY = 5
class Link:
"""
A link is the physical implementation of an interface.
"""
def __init__(self, env, capacity, delay):
self.env = env
self.delay = delay
self.msg = simpy.Store(env)
self.capacity = simpy.Container(env... | 25.918367 | 77 | 0.583465 | 1,212 | 0.954331 | 793 | 0.624409 | 0 | 0 | 0 | 0 | 269 | 0.211811 |
7047d5cefa65f2e1e003e6c7a82fbac36e8eb44c | 2,163 | py | Python | dovetail/tests/unit/test_parser.py | hashnfv/hashnfv-dovetail | 73f332fc513f184513be483db6a108bd3c7b7d9b | [
"Apache-2.0"
] | null | null | null | dovetail/tests/unit/test_parser.py | hashnfv/hashnfv-dovetail | 73f332fc513f184513be483db6a108bd3c7b7d9b | [
"Apache-2.0"
] | null | null | null | dovetail/tests/unit/test_parser.py | hashnfv/hashnfv-dovetail | 73f332fc513f184513be483db6a108bd3c7b7d9b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# lingui.zeng@huawei.com
# All rights reserved. This program and the accompanying materials
# are made available under the terms of the Apache License, Version 2.0
# which accompanies this distribution, and is available at
# http://www.apache.org/licenses/LICENSE-2.0
#
"""
Test 'parser' module
... | 33.796875 | 75 | 0.66343 | 1,579 | 0.730005 | 0 | 0 | 1,624 | 0.750809 | 0 | 0 | 757 | 0.349977 |
7049b0e74f2f6f27ca826c944b216b0e20f61a74 | 1,125 | py | Python | backend/mysite/student/serializers.py | sun0225SUN/Student-Data-Vision | 94b2fbaef425cb2b51b3295059b1b7acca85cfcd | [
"MIT"
] | 2 | 2022-02-16T12:57:45.000Z | 2022-02-24T14:09:00.000Z | backend/mysite/student/serializers.py | sun0225SUN/Student-Data-Vision | 94b2fbaef425cb2b51b3295059b1b7acca85cfcd | [
"MIT"
] | null | null | null | backend/mysite/student/serializers.py | sun0225SUN/Student-Data-Vision | 94b2fbaef425cb2b51b3295059b1b7acca85cfcd | [
"MIT"
] | null | null | null | from rest_framework import serializers
from .models import * # Student, StarInfo, SexInfo, GeoInfo, AnhuiGeoInfo, ProvinceInfo
class SexInfoSerializer(serializers.ModelSerializer):
class Meta:
model = SexInfo
fields = ['name', 'value']
# 星座信息序列化器
class StarInfoSerializer(serializer... | 21.634615 | 89 | 0.641778 | 897 | 0.751886 | 0 | 0 | 0 | 0 | 0 | 0 | 249 | 0.208718 |
704bf79ef27daaf63edd9449ba7583e9a752f111 | 923 | py | Python | lib/mongoLib/mongoOperations.py | ronnygeo/YelpSocialEffects | 55315af989be97c2785ee50c7accf5372ed06bce | [
"Unlicense",
"MIT"
] | null | null | null | lib/mongoLib/mongoOperations.py | ronnygeo/YelpSocialEffects | 55315af989be97c2785ee50c7accf5372ed06bce | [
"Unlicense",
"MIT"
] | null | null | null | lib/mongoLib/mongoOperations.py | ronnygeo/YelpSocialEffects | 55315af989be97c2785ee50c7accf5372ed06bce | [
"Unlicense",
"MIT"
] | null | null | null | from pymongo import MongoClient
client = MongoClient()
db = client['yelp']
movie_collection = db.movies
ratings_collection = db.ratings
tags_collection = db.tags
links_collection = db.links
def findUser(userId):
return db.user.find_one({"user_id": userId})
def find_movie(name):
for movie in movie_collectio... | 23.666667 | 79 | 0.630553 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 213 | 0.230769 |
704c104a01777ddf21029bc89ce3fac781b60738 | 1,072 | py | Python | app/utils/cosineSimilarity.py | P-DOX/MultiModelNLP | 9ab93fdc6f90c829d3d63249565df9fc0e45f119 | [
"Apache-2.0"
] | null | null | null | app/utils/cosineSimilarity.py | P-DOX/MultiModelNLP | 9ab93fdc6f90c829d3d63249565df9fc0e45f119 | [
"Apache-2.0"
] | null | null | null | app/utils/cosineSimilarity.py | P-DOX/MultiModelNLP | 9ab93fdc6f90c829d3d63249565df9fc0e45f119 | [
"Apache-2.0"
] | null | null | null | from nltk.corpus import stopwords
from nltk.tokenize import word_tokenize
# X = input("Enter first string: ").lower()
# Y = input("Enter second string: ").lower()
# X ="I love horror movies"
# Y ="Lights out is a horror movie"
def cosineSimilarity(X, Y):
# tokenization
X_list = word_tokenize(X)
... | 29.777778 | 54 | 0.58209 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 367 | 0.342351 |
704d370e7369a707e23ae29b6401b5069afcd189 | 1,303 | py | Python | YANG/001_devnet_yang-netconf-restconf/netconf_intro_get_config.py | CalvinDawgz/Python-Projects | cc5d1e93bcbe124c1864a49cc3dfbca7db520928 | [
"MIT"
] | 1 | 2021-07-10T09:22:55.000Z | 2021-07-10T09:22:55.000Z | YANG/001_devnet_yang-netconf-restconf/netconf_intro_get_config.py | CalvinDawgz/Python-Projects | cc5d1e93bcbe124c1864a49cc3dfbca7db520928 | [
"MIT"
] | null | null | null | YANG/001_devnet_yang-netconf-restconf/netconf_intro_get_config.py | CalvinDawgz/Python-Projects | cc5d1e93bcbe124c1864a49cc3dfbca7db520928 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
iosxe_hostname = "ios-xe-mgmt.cisco.com"
iosxe_netconf_port = 10000
iosxe_username = "developer"
iosxe_password = "C1sco12345"
from ncclient import manager
import xmltodict
import xml.dom.minidom
# Create an XML filter for targeted NETCONF queries
netconf_filter = """
<filter>
<interfaces xm... | 27.723404 | 88 | 0.718342 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 736 | 0.56485 |
704ece007cac76b4214891671e52a643444b368a | 1,375 | py | Python | crawl_movies/pipelines.py | KevinLJJ/crawl_movies | 16d03a8a18fee57582ff3fb0b80ba0d12a824f96 | [
"MIT"
] | null | null | null | crawl_movies/pipelines.py | KevinLJJ/crawl_movies | 16d03a8a18fee57582ff3fb0b80ba0d12a824f96 | [
"MIT"
] | null | null | null | crawl_movies/pipelines.py | KevinLJJ/crawl_movies | 16d03a8a18fee57582ff3fb0b80ba0d12a824f96 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
from crawl_movies.models.mongo import MovieDetail, WorkerDetail
class CrawlMoviesPipeline(object):
def process_item(self... | 24.122807 | 66 | 0.522909 | 1,181 | 0.818434 | 0 | 0 | 0 | 0 | 0 | 0 | 656 | 0.454608 |
704f9d6253b758f6c2018d25a5de126b3018f3f2 | 427 | py | Python | Algorithms/Easy/1394. Find Lucky Integer in an Array/answer.py | KenWoo/Algorithm | 4012a2f0a099a502df1e5df2e39faa75fe6463e8 | [
"Apache-2.0"
] | null | null | null | Algorithms/Easy/1394. Find Lucky Integer in an Array/answer.py | KenWoo/Algorithm | 4012a2f0a099a502df1e5df2e39faa75fe6463e8 | [
"Apache-2.0"
] | null | null | null | Algorithms/Easy/1394. Find Lucky Integer in an Array/answer.py | KenWoo/Algorithm | 4012a2f0a099a502df1e5df2e39faa75fe6463e8 | [
"Apache-2.0"
] | null | null | null | from typing import List
class Solution:
def findLucky(self, arr: List[int]) -> int:
dict = {}
for a in arr:
dict.setdefault(a, 0)
dict[a] += 1
res = -1
for k, v in dict.items():
if k == v:
res = max(res, k)
return res
if... | 20.333333 | 47 | 0.468384 | 289 | 0.676815 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 0.023419 |
704fd7adeafe4b3c7852a5ce2db279a718b6a6db | 1,882 | py | Python | cauldron/test/cli/server/routes/synchronize/test_sync_open.py | DanMayhew/cauldron | ac41481830fc1a363c145f4b58ce785aac054d10 | [
"MIT"
] | null | null | null | cauldron/test/cli/server/routes/synchronize/test_sync_open.py | DanMayhew/cauldron | ac41481830fc1a363c145f4b58ce785aac054d10 | [
"MIT"
] | null | null | null | cauldron/test/cli/server/routes/synchronize/test_sync_open.py | DanMayhew/cauldron | ac41481830fc1a363c145f4b58ce785aac054d10 | [
"MIT"
] | null | null | null | import json
import os
import cauldron
from cauldron.test import support
from cauldron.test.support.flask_scaffolds import FlaskResultsTest
EXAMPLE_PROJECTS_DIRECTORY = os.path.realpath(os.path.join(
os.path.dirname(os.path.realpath(cauldron.__file__)),
'resources',
'examples'
))
class TestSyncOpen(Flask... | 28.953846 | 75 | 0.664187 | 1,585 | 0.842189 | 0 | 0 | 0 | 0 | 0 | 0 | 394 | 0.209352 |
70523f493b7d38b249e11082c64f836106e49316 | 2,166 | py | Python | common/vision/models/digits.py | billzhonggz/Transfer-Learning-Library | d7a6e4298e571d5101e05515a2ab1f171160ef89 | [
"MIT"
] | 1,474 | 2020-07-24T02:55:55.000Z | 2022-03-31T12:35:56.000Z | common/vision/models/digits.py | mxliu/Transfer-Learning-Library | 7b0ccb3a8087ecc65daf4b1e815e5a3f42106641 | [
"MIT"
] | 70 | 2020-08-05T10:47:33.000Z | 2022-03-31T03:48:54.000Z | common/vision/models/digits.py | mxliu/Transfer-Learning-Library | 7b0ccb3a8087ecc65daf4b1e815e5a3f42106641 | [
"MIT"
] | 312 | 2020-08-01T11:08:39.000Z | 2022-03-30T06:03:47.000Z | """
@author: Junguang Jiang
@contact: JiangJunguang1123@outlook.com
"""
import torch.nn as nn
class LeNet(nn.Sequential):
def __init__(self, num_classes=10):
super(LeNet, self).__init__(
nn.Conv2d(1, 20, kernel_size=5),
nn.MaxPool2d(2),
nn.ReLU(),
nn.Conv2d(... | 26.096386 | 117 | 0.545245 | 1,496 | 0.690674 | 0 | 0 | 0 | 0 | 0 | 0 | 499 | 0.230379 |
7053994678a4357d47cfc599844f36810176dba3 | 6,164 | py | Python | cviceni10/mind.py | malja/cvut-python | 945aa0fefb72c65a97c505e38597881d8433f93b | [
"MIT"
] | null | null | null | cviceni10/mind.py | malja/cvut-python | 945aa0fefb72c65a97c505e38597881d8433f93b | [
"MIT"
] | null | null | null | cviceni10/mind.py | malja/cvut-python | 945aa0fefb72c65a97c505e38597881d8433f93b | [
"MIT"
] | null | null | null | import itertools
class mind:
"""
Třída řešící hru Mastermind ve třech úrovních obtížnosti.
Podporované módy:
1) Hádání 4 pozic se 6 barvami
2) Hádání 5 pozic s 7 barvami
3) Hádání 6 pozic s 8 barvami
O zadání, učování správného řešení a ohodnocování jednotlivých tahů
... | 29.21327 | 85 | 0.541045 | 6,455 | 0.997219 | 0 | 0 | 0 | 0 | 0 | 0 | 3,396 | 0.524641 |
70543f99f9e6f1e388a540a99c2e97732d9e9ee6 | 3,245 | py | Python | fw_test_harness/html_report_generator.py | PX4/fw-test-harness | 5c35b2f947c3247d95b54a0fc613bf48fbded7da | [
"MIT"
] | 2 | 2015-09-24T18:14:00.000Z | 2015-12-15T03:28:46.000Z | fw_test_harness/html_report_generator.py | PX4/fw-test-harness | 5c35b2f947c3247d95b54a0fc613bf48fbded7da | [
"MIT"
] | null | null | null | fw_test_harness/html_report_generator.py | PX4/fw-test-harness | 5c35b2f947c3247d95b54a0fc613bf48fbded7da | [
"MIT"
] | 2 | 2016-06-02T01:40:19.000Z | 2019-08-09T10:03:48.000Z | #!/usr/bin/env python
import argparse
from yattag import Doc
import matplotlib.pyplot as plt, mpld3
import collections
class HtmlReportGenerator:
"""Generates html reports"""
def __init__(self, args):
"""Constructor"""
self.args = args
self.report = "" # the html string
self.... | 31.504854 | 81 | 0.538059 | 2,599 | 0.800924 | 0 | 0 | 0 | 0 | 0 | 0 | 1,161 | 0.357781 |
705470c5d6de5aaf51115a99bde2ca4ec64eb827 | 341 | py | Python | screenshooter/listener.py | engelmi/screenshooter | 9a1433d5306b506e6661212b650f8f5430bb8614 | [
"MIT"
] | 1 | 2020-08-01T13:35:16.000Z | 2020-08-01T13:35:16.000Z | screenshooter/listener.py | engelmi/screenshooter | 9a1433d5306b506e6661212b650f8f5430bb8614 | [
"MIT"
] | 1 | 2019-07-25T08:42:06.000Z | 2019-07-25T08:42:06.000Z | screenshooter/listener.py | engelmi/screenshooter | 9a1433d5306b506e6661212b650f8f5430bb8614 | [
"MIT"
] | null | null | null |
class ScreenGrabListener(object):
"""
Basic listener class to process a grabbed image via the screenshooter.
"""
def process(self, grabbed_image):
"""
Abstract method. Processes a grabbed image.
:param grabbed_image: The grabbed image as PIL.Image.
"""
raise Not... | 26.230769 | 74 | 0.639296 | 339 | 0.994135 | 0 | 0 | 0 | 0 | 0 | 0 | 217 | 0.636364 |
705779fc95331f18047ab12ddb0742f0946134c2 | 3,055 | py | Python | restclients/sws/v5/notice.py | uw-it-cte/uw-restclients | 2b09348bf066e5508304401f93f281805e965af5 | [
"Apache-2.0"
] | null | null | null | restclients/sws/v5/notice.py | uw-it-cte/uw-restclients | 2b09348bf066e5508304401f93f281805e965af5 | [
"Apache-2.0"
] | null | null | null | restclients/sws/v5/notice.py | uw-it-cte/uw-restclients | 2b09348bf066e5508304401f93f281805e965af5 | [
"Apache-2.0"
] | null | null | null | """
Interfaceing with the Student Web Service,
for notice resource
"""
import copy
import logging
from restclients.models.sws import Notice, NoticeAttribute
from restclients.sws import get_resource
from dateutil import parser
import pytz
notice_res_url_prefix = "/student/v5/notice/"
logger = logging.getLogger(__name... | 33.944444 | 78 | 0.60491 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 584 | 0.191162 |
705807e28589aed3f29367b0717ee4329f43b530 | 2,654 | py | Python | vulcan/_utils.py | v0idzz/vulcan-api | 1ae83d90236e678042a9f85f6c34b6bd82bf279f | [
"MIT"
] | 49 | 2019-01-10T22:10:19.000Z | 2022-01-10T17:07:51.000Z | vulcan/_utils.py | v0idzz/vulcan-api | 1ae83d90236e678042a9f85f6c34b6bd82bf279f | [
"MIT"
] | 47 | 2019-01-08T21:04:17.000Z | 2022-03-21T04:02:37.000Z | vulcan/_utils.py | v0idzz/vulcan-api | 1ae83d90236e678042a9f85f6c34b6bd82bf279f | [
"MIT"
] | 31 | 2019-05-04T14:05:33.000Z | 2021-11-01T18:51:16.000Z | # -*- coding: utf-8 -*-
import asyncio
import logging
import math
import platform
import time
import urllib
import uuid as _uuid
from datetime import datetime
import aiohttp
import requests
APP_NAME = "DzienniczekPlus 2.0"
APP_VERSION = "1.4.2"
APP_OS = "Android"
APP_USER_AGENT = "Dart/2.10 (dart:io)"
log = logging... | 23.280702 | 87 | 0.620573 | 45 | 0.016956 | 0 | 0 | 0 | 0 | 825 | 0.310852 | 694 | 0.261492 |
7058092211009357bacdd3e00eaae3ca9bf62a90 | 518 | py | Python | chkuser2.py | YousefAllam221b/QuickStor | 59cbbb6e7be358bde0adced49ba3f3ff9a92e6de | [
"Apache-2.0"
] | null | null | null | chkuser2.py | YousefAllam221b/QuickStor | 59cbbb6e7be358bde0adced49ba3f3ff9a92e6de | [
"Apache-2.0"
] | null | null | null | chkuser2.py | YousefAllam221b/QuickStor | 59cbbb6e7be358bde0adced49ba3f3ff9a92e6de | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3.6
import sys,etcdget,subprocess,time
with open('Data/chkuser2','w') as f:
f.write(str(sys.argv))
y=[]
z=[]
x=etcdget.etcdget('updlogged/'+sys.argv[1])
z.append(sys.argv[2])
y.append(x[0])
cmdline=['./pump.sh','UnixChkUser2']+sys.argv[1:]
result=subprocess.run(cmdline,stdout=subprocess.PIPE)
while f... | 27.263158 | 53 | 0.687259 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 105 | 0.202703 |
705a3d4ced89bcfa03e85f9fc886f6c3b10c1d03 | 715 | py | Python | blog/migrations/0001_initial.py | AndyBowskill/andybowskill | d3d449e2c44c14cec18c4e5a0ee3970fe1fbb7d6 | [
"MIT"
] | null | null | null | blog/migrations/0001_initial.py | AndyBowskill/andybowskill | d3d449e2c44c14cec18c4e5a0ee3970fe1fbb7d6 | [
"MIT"
] | null | null | null | blog/migrations/0001_initial.py | AndyBowskill/andybowskill | d3d449e2c44c14cec18c4e5a0ee3970fe1fbb7d6 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.5 on 2021-02-04 19:45
from django.db import migrations, models
import django.db.models.manager
class Migration(migrations.Migration):
initial = True
dependencies = []
operations = [
migrations.CreateModel(
name="Blog",
fields=[
... | 25.535714 | 79 | 0.521678 | 590 | 0.825175 | 0 | 0 | 0 | 0 | 0 | 0 | 94 | 0.131469 |
705a67e947bb08a691c95b9f12624b016023afa5 | 4,269 | py | Python | neural_network.py | harsh020/ml_subpack | d36e97922ec17d84526884555181045ad50e8809 | [
"MIT"
] | null | null | null | neural_network.py | harsh020/ml_subpack | d36e97922ec17d84526884555181045ad50e8809 | [
"MIT"
] | 6 | 2019-10-06T13:41:55.000Z | 2019-10-16T18:14:04.000Z | neural_network.py | harsh020/ml_subpack | d36e97922ec17d84526884555181045ad50e8809 | [
"MIT"
] | null | null | null | import numpy as np
from scipy.optimize import fmin_cg
from utils.optimize import gradient_desc, computeNumericalGradient
from utils.utility import sigmoid, sigmoid_grad, ravel, unravel
import sys
np.set_printoptions(threshold=sys.maxsize)
np.seterr(divide = 'ignore')
class NeuralNetwork:
def __init__(self, hidde... | 30.934783 | 127 | 0.539236 | 3,997 | 0.936285 | 0 | 0 | 0 | 0 | 0 | 0 | 720 | 0.168658 |
705b4d5cd84623195126b2771150fa91e444a907 | 4,597 | py | Python | dpsutil/environment/environment.py | connortran216/DPS_Util | 8e6af59c3cc5d4addf3694ee0dfede08206ec4b3 | [
"MIT"
] | 1 | 2021-01-19T03:14:42.000Z | 2021-01-19T03:14:42.000Z | dpsutil/environment/environment.py | connortran216/DPS_Util | 8e6af59c3cc5d4addf3694ee0dfede08206ec4b3 | [
"MIT"
] | 1 | 2021-01-27T09:50:33.000Z | 2021-01-27T09:50:33.000Z | dpsutil/environment/environment.py | connortran216/DPS_Util | 8e6af59c3cc5d4addf3694ee0dfede08206ec4b3 | [
"MIT"
] | 3 | 2020-03-24T02:49:47.000Z | 2021-02-26T04:05:06.000Z | from dpsutil.attrdict import DefaultDict, AttrDict
from dpsutil.attrdict.decorator import _get_vars_cls
from os import environ
class Environment(DefaultDict):
"""
Environment: Auto pair environment parameters fit with default, which provided before.
Implement attrdict.DefaultDict
Auto check and broad... | 32.373239 | 111 | 0.616924 | 3,937 | 0.856428 | 0 | 0 | 245 | 0.053296 | 0 | 0 | 2,467 | 0.536654 |
705b8955240faf6cb0cd184dc93e8b934d2a6298 | 6,192 | py | Python | stats.py | glommer/ghstats | bd874a05fb23f75aed0f0675a9929b5afdfd3f52 | [
"Apache-2.0"
] | null | null | null | stats.py | glommer/ghstats | bd874a05fb23f75aed0f0675a9929b5afdfd3f52 | [
"Apache-2.0"
] | null | null | null | stats.py | glommer/ghstats | bd874a05fb23f75aed0f0675a9929b5afdfd3f52 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import requests
import sys
import datetime
from dateutil.parser import parse
import argparse
class User:
cache = {}
def __init__(self, userurl, token):
headers = {'Authorization': 'token {}'.format(token)}
if userurl in User.cache:
self.info = User.cache[user... | 32.082902 | 150 | 0.580426 | 2,108 | 0.340439 | 0 | 0 | 0 | 0 | 0 | 0 | 1,240 | 0.200258 |
705c834021988f2e1ca4df337084e3a2e833583a | 1,068 | py | Python | day 5/4-normal_dist.py | JackRab/10-days-of-statistics | 68ebb74a689e28a2ff225be96a5e9b59c9abe783 | [
"MIT"
] | null | null | null | day 5/4-normal_dist.py | JackRab/10-days-of-statistics | 68ebb74a689e28a2ff225be96a5e9b59c9abe783 | [
"MIT"
] | null | null | null | day 5/4-normal_dist.py | JackRab/10-days-of-statistics | 68ebb74a689e28a2ff225be96a5e9b59c9abe783 | [
"MIT"
] | null | null | null | """
Objective
In this challenge, we go further with normal distributions.
Task
The final grades for a Physics exam taken by a large group of students have a mean of mu=70 and
a standard deviation of sigma=10. If we can approximate the distribution of these grades by a normal distribution,
what percentage of the stu... | 35.6 | 115 | 0.701311 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 757 | 0.708801 |
705d1006eed6327deb0841912866c9c9f51e9ab7 | 418 | py | Python | PS2/GroupAss/Trajectories/trajectory_utils.py | MattTurnock/PlanetarySciencesMatt | 81954d2182d9577bd7327a98c45963ae42968df4 | [
"MIT"
] | null | null | null | PS2/GroupAss/Trajectories/trajectory_utils.py | MattTurnock/PlanetarySciencesMatt | 81954d2182d9577bd7327a98c45963ae42968df4 | [
"MIT"
] | null | null | null | PS2/GroupAss/Trajectories/trajectory_utils.py | MattTurnock/PlanetarySciencesMatt | 81954d2182d9577bd7327a98c45963ae42968df4 | [
"MIT"
] | null | null | null | import numpy as np
from astropy import units as u
def C3toDV(C3, muE, rOrbit, outputUnits=None):
"""
Assumes all units are SI base if not stated
:param C3:
:param muE:
:param rOrbit:
:param outputUnits:
:return:
"""
# print(C3, muE, rOrbit)
DV = np.sqrt(C3 + (2*muE/rOrbit)) - n... | 20.9 | 59 | 0.61244 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 170 | 0.406699 |
705da61ca28beb4cbccf634052b516bed03caf59 | 654 | py | Python | setup.py | fksato/vmz_interface | 985e7129f4bf266a6226dbc2b7e108dafc8b917a | [
"Apache-2.0"
] | null | null | null | setup.py | fksato/vmz_interface | 985e7129f4bf266a6226dbc2b7e108dafc8b917a | [
"Apache-2.0"
] | null | null | null | setup.py | fksato/vmz_interface | 985e7129f4bf266a6226dbc2b7e108dafc8b917a | [
"Apache-2.0"
] | null | null | null | from setuptools import setup, find_packages
requirements = [
"tqdm",
]
setup(
name='vmz_interface',
version='0.1.0',
packages=find_packages(exclude=['tests']),
url='https://github.com/fksato/vmz_interface',
author='Fukushi Sato',
author_email='f.kazuo.sato@gmail.com',
description='Facebook VMZ interface',
in... | 26.16 | 51 | 0.640673 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 338 | 0.51682 |
705de60f199bd5095fe33004172b3313546ce5d4 | 3,132 | py | Python | api/v2/views/parties.py | Davidodari/POLITICO-API | 479560f7accc3a6e46a8cec34c4f435ae9284138 | [
"MIT"
] | 1 | 2019-09-05T23:20:21.000Z | 2019-09-05T23:20:21.000Z | api/v2/views/parties.py | Davidodari/POLITICO-API | 479560f7accc3a6e46a8cec34c4f435ae9284138 | [
"MIT"
] | 4 | 2019-02-12T10:06:12.000Z | 2019-02-20T05:00:40.000Z | api/v2/views/parties.py | Davidodari/POLITICO-API | 479560f7accc3a6e46a8cec34c4f435ae9284138 | [
"MIT"
] | 4 | 2019-02-08T23:54:24.000Z | 2019-02-19T16:26:59.000Z | from flask import Blueprint, request, jsonify, make_response
from api.v2.models.parties import PartiesModelDb
from flask_jwt_extended import jwt_required
from . import check_user, id_conversion, resource_handler
parties_api_v2 = Blueprint('parties_v2', __name__, url_prefix="/api/v2")
@parties_api_v2.route("/parties"... | 44.742857 | 119 | 0.664112 | 0 | 0 | 0 | 0 | 2,831 | 0.903895 | 0 | 0 | 753 | 0.240421 |
705e3b446233d2f6c1287b4611d5abe26c570d0a | 1,307 | py | Python | demo.py | Li-Pro/Clipboard | 329be81902d6fc5e29e60c85d660a86055e5c3ac | [
"MIT"
] | 2 | 2020-05-20T06:34:33.000Z | 2020-05-30T02:32:37.000Z | demo.py | Li-Pro/Clipboarder | 329be81902d6fc5e29e60c85d660a86055e5c3ac | [
"MIT"
] | null | null | null | demo.py | Li-Pro/Clipboarder | 329be81902d6fc5e29e60c85d660a86055e5c3ac | [
"MIT"
] | null | null | null | from pathlib import Path
import re
import time
from capture import getClipboardImage, NoImageData
PATHNAME_REGEX = re.compile(r'(\w+\.*)*\w')
def regexMatch(regex, s):
return regex.fullmatch(s) != None
def imgCompare(img1, img2):
if (not img1) or (not img2):
return False
h, w = img1.size
if not img2.size ==... | 18.671429 | 54 | 0.651875 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 159 | 0.121653 |
706002b48666a37499861a75991efe6d866c08af | 1,288 | py | Python | document/code/exo_demo_1/results.py | lebrice/george | 14c4c89906c770528dad2b80973aab0320141fe5 | [
"MIT"
] | 9 | 2018-01-20T16:51:30.000Z | 2020-12-06T22:13:44.000Z | document/code/exo_demo_1/results.py | lebrice/george | 14c4c89906c770528dad2b80973aab0320141fe5 | [
"MIT"
] | null | null | null | document/code/exo_demo_1/results.py | lebrice/george | 14c4c89906c770528dad2b80973aab0320141fe5 | [
"MIT"
] | 4 | 2017-08-31T21:59:56.000Z | 2022-03-03T20:01:42.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import division, print_function
__all__ = ["results"]
import os
import triangle
import numpy as np
import cPickle as pickle
import matplotlib.pyplot as pl
def results(fn):
model, sampler = pickle.load(open(fn, "rb"))
mu = np.median(model.f)
... | 27.404255 | 69 | 0.632764 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 219 | 0.170031 |
706047b9ae6c7b0c95aae34cd316a11a431e74e3 | 2,681 | py | Python | vae/model_torch.py | tpvt99/sbcs5478 | 56e4a70462691a40252d7f51da7c45d44d9ca822 | [
"MIT"
] | null | null | null | vae/model_torch.py | tpvt99/sbcs5478 | 56e4a70462691a40252d7f51da7c45d44d9ca822 | [
"MIT"
] | null | null | null | vae/model_torch.py | tpvt99/sbcs5478 | 56e4a70462691a40252d7f51da7c45d44d9ca822 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import numpy as np
class Encoder(nn.Module):
"""Maps MNIST digits to a triplet (z_mean, z_log_var, z)."""
def __init__(self, latent_dim, input_shape, name="encoder", **kwargs):
super(Encoder, self).__init__()
self.dense_proj = nn.Sequential(
nn.... | 35.746667 | 138 | 0.603133 | 2,617 | 0.976128 | 0 | 0 | 0 | 0 | 0 | 0 | 264 | 0.098471 |
70634f2f852c70987a8353d2bd23f6aa46115566 | 2,277 | py | Python | pymetamap/MetaMapLite.py | liquet-ai/pymetamap | 05db8f9625cb1f3b8e4b5e2133624ba799b86a1b | [
"Apache-2.0"
] | 151 | 2015-01-26T21:11:07.000Z | 2022-03-02T08:16:24.000Z | pymetamap/MetaMapLite.py | liquet-ai/pymetamap | 05db8f9625cb1f3b8e4b5e2133624ba799b86a1b | [
"Apache-2.0"
] | 47 | 2016-03-05T11:45:54.000Z | 2022-01-25T17:48:14.000Z | pymetamap/MetaMapLite.py | liquet-ai/pymetamap | 05db8f9625cb1f3b8e4b5e2133624ba799b86a1b | [
"Apache-2.0"
] | 69 | 2015-07-09T02:56:16.000Z | 2021-12-04T17:49:20.000Z | # 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
# distributed under the Li... | 44.647059 | 131 | 0.709267 | 1,661 | 0.729469 | 0 | 0 | 705 | 0.309618 | 0 | 0 | 1,270 | 0.557751 |
7063fade463f2ff5785707f51f17ad043d668b7e | 1,779 | py | Python | examples/chi2_fit.py | HDembinski/pyik | fc9e87dec88484458479225c1ec2357ff48b5bb7 | [
"BSD-3-Clause"
] | 11 | 2018-04-16T08:07:11.000Z | 2022-02-14T15:19:22.000Z | examples/chi2_fit.py | HDembinski/pyik | fc9e87dec88484458479225c1ec2357ff48b5bb7 | [
"BSD-3-Clause"
] | 10 | 2018-04-09T13:57:16.000Z | 2019-04-28T11:28:55.000Z | examples/chi2_fit.py | HDembinski/pyik | fc9e87dec88484458479225c1ec2357ff48b5bb7 | [
"BSD-3-Clause"
] | 4 | 2017-09-22T10:24:57.000Z | 2020-11-24T10:24:30.000Z | # -*- coding: utf-8 -*-
"""
This example demonstrates fitting a model to a (simulated) dataset using
numpyext.chi2_fit, which wraps Minuit.
"""
import numpy as np
from matplotlib import pyplot
from pyik.fit import ChiSquareFunction
from pyik.mplext import cornertext
np.random.seed(1)
def model(x, pars):
"""A sli... | 25.782609 | 94 | 0.649241 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 652 | 0.366498 |
70649b12e8177f792e96cdeb6bd72018b6de7576 | 5,406 | py | Python | Python/esys/lsm/doc/Overview.py | danielfrascarelli/esys-particle | e56638000fd9c4af77e21c75aa35a4f8922fd9f0 | [
"Apache-2.0"
] | null | null | null | Python/esys/lsm/doc/Overview.py | danielfrascarelli/esys-particle | e56638000fd9c4af77e21c75aa35a4f8922fd9f0 | [
"Apache-2.0"
] | null | null | null | Python/esys/lsm/doc/Overview.py | danielfrascarelli/esys-particle | e56638000fd9c4af77e21c75aa35a4f8922fd9f0 | [
"Apache-2.0"
] | null | null | null | #############################################################
## ##
## Copyright (c) 2003-2017 by The University of Queensland ##
## Centre for Geoscience Computing ##
## http://earth.uq.edu.au/centre-geoscience-computing ##
## ... | 34.653846 | 100 | 0.699593 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 5,073 | 0.938402 |
7066c0de46a9cb6cbb4bbc49dad20327a5f51884 | 4,483 | py | Python | tour5_damage_bond/damage2d_explorer.py | bmcs-group/bmcs_tutorial | 4e008e72839fad8820a6b663a20d3f188610525d | [
"MIT"
] | null | null | null | tour5_damage_bond/damage2d_explorer.py | bmcs-group/bmcs_tutorial | 4e008e72839fad8820a6b663a20d3f188610525d | [
"MIT"
] | null | null | null | tour5_damage_bond/damage2d_explorer.py | bmcs-group/bmcs_tutorial | 4e008e72839fad8820a6b663a20d3f188610525d | [
"MIT"
] | null | null | null |
import numpy as np
import sympy as sp
import bmcs_utils.api as bu
from bmcs_cross_section.pullout import MATS1D5BondSlipD
s_x, s_y = sp.symbols('s_x, s_y')
kappa_ = sp.sqrt( s_x**2 + s_y**2 )
get_kappa = sp.lambdify( (s_x, s_y), kappa_, 'numpy' )
def get_tau_s(s_x_n1, s_y_n1, Eps_n, bs, **kw):
'''Get the stress ... | 33.706767 | 89 | 0.602052 | 2,759 | 0.615436 | 0 | 0 | 0 | 0 | 0 | 0 | 347 | 0.077404 |
706745eb0046576ce77b57a2d81861de6f37d9a2 | 2,042 | py | Python | plugins/hanime.py | streamlink-plugins/streamlink-plugins | 64a3dd5d98a94cf5e61f0faa22821f58c6be9258 | [
"Unlicense"
] | 1 | 2021-08-17T07:26:59.000Z | 2021-08-17T07:26:59.000Z | plugins/hanime.py | streamlink-plugins/streamlink-plugins | 64a3dd5d98a94cf5e61f0faa22821f58c6be9258 | [
"Unlicense"
] | 1 | 2021-07-20T05:56:21.000Z | 2021-08-05T00:07:45.000Z | plugins/hanime.py | streamlink-plugins/streamlink-plugins | 64a3dd5d98a94cf5e61f0faa22821f58c6be9258 | [
"Unlicense"
] | null | null | null | import re
from streamlink.plugin import Plugin, pluginmatcher
from streamlink.plugin.api import validate
from streamlink.stream import HLSStream
_post_schema = validate.Schema({
'hentai_video': validate.Schema({
'name': validate.text,
'is_visible': bool
}),
'videos_... | 29.171429 | 102 | 0.539667 | 1,312 | 0.642507 | 1,130 | 0.553379 | 1,412 | 0.691479 | 0 | 0 | 494 | 0.24192 |
7069c3bc8265659738e027a9e3bc09e4e52e6f67 | 558 | py | Python | rules/PlaybookExtension.py | dockpack/ansible-lint-rules | 794ae9b0c034adee20b677ed26888c508847f507 | [
"MIT"
] | null | null | null | rules/PlaybookExtension.py | dockpack/ansible-lint-rules | 794ae9b0c034adee20b677ed26888c508847f507 | [
"MIT"
] | null | null | null | rules/PlaybookExtension.py | dockpack/ansible-lint-rules | 794ae9b0c034adee20b677ed26888c508847f507 | [
"MIT"
] | 1 | 2020-08-11T08:32:55.000Z | 2020-08-11T08:32:55.000Z | from ansiblelint import AnsibleLintRule
import os
class PlaybookExtension(AnsibleLintRule):
id = 'E101'
shortdesc = 'Playbooks should have the ".yml" extension'
description = ''
tags = ['playbook']
done = [] # already noticed path list
def match(self, file, text):
if file['type'] != ... | 25.363636 | 60 | 0.589606 | 505 | 0.905018 | 0 | 0 | 0 | 0 | 0 | 0 | 117 | 0.209677 |
706c68208b42d394b8a5aacf46f45e4eb99996af | 2,712 | py | Python | src/tests/test_pagure_flask_ui_app_index.py | yifengyou/learn-pagure | e54ba955368918c92ad2be6347b53bb2c24a228c | [
"Unlicense"
] | null | null | null | src/tests/test_pagure_flask_ui_app_index.py | yifengyou/learn-pagure | e54ba955368918c92ad2be6347b53bb2c24a228c | [
"Unlicense"
] | null | null | null | src/tests/test_pagure_flask_ui_app_index.py | yifengyou/learn-pagure | e54ba955368918c92ad2be6347b53bb2c24a228c | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
"""
(c) 2017 - Copyright Red Hat Inc
Authors:
Pierre-Yves Chibon <pingou@pingoured.fr>
"""
from __future__ import unicode_literals, absolute_import
import datetime
import unittest
import shutil
import sys
import os
import six
import json
import pygit2
from mock import patch, MagicMock... | 28.547368 | 71 | 0.598451 | 2,200 | 0.811209 | 0 | 0 | 0 | 0 | 0 | 0 | 940 | 0.346608 |
706c9213e500aaaf1819246602b29a0148ed5c14 | 3,255 | py | Python | src/server/message-distributor/message-distributor.py | fredsongyu/mmitss-az | 62fb59a9e5a19f62a1096971f3cc0ecc04599106 | [
"Apache-2.0"
] | 10 | 2018-12-05T14:48:59.000Z | 2022-02-17T02:10:51.000Z | src/server/message-distributor/message-distributor.py | fredsongyu/mmitss-az | 62fb59a9e5a19f62a1096971f3cc0ecc04599106 | [
"Apache-2.0"
] | null | null | null | src/server/message-distributor/message-distributor.py | fredsongyu/mmitss-az | 62fb59a9e5a19f62a1096971f3cc0ecc04599106 | [
"Apache-2.0"
] | 8 | 2018-11-16T06:38:25.000Z | 2022-03-09T18:22:59.000Z | '''
***************************************************************************************
© 2019 Arizona Board of Regents on behalf of the University of Arizona with rights
granted for USDOT OSADP distribution with the Apache 2.0 open source license.
*********************************************************... | 40.6875 | 115 | 0.623656 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,628 | 0.5 |
706d7cd8cb065536c3b42bd8a949922e75604f14 | 7,281 | py | Python | digsby/src/gui/pref/noobcontactlayoutpanel.py | ifwe/digsby | f5fe00244744aa131e07f09348d10563f3d8fa99 | [
"Python-2.0"
] | 35 | 2015-08-15T14:32:38.000Z | 2021-12-09T16:21:26.000Z | digsby/src/gui/pref/noobcontactlayoutpanel.py | niterain/digsby | 16a62c7df1018a49eaa8151c0f8b881c7e252949 | [
"Python-2.0"
] | 4 | 2015-09-12T10:42:57.000Z | 2017-02-27T04:05:51.000Z | digsby/src/gui/pref/noobcontactlayoutpanel.py | niterain/digsby | 16a62c7df1018a49eaa8151c0f8b881c7e252949 | [
"Python-2.0"
] | 15 | 2015-07-10T23:58:07.000Z | 2022-01-23T22:16:33.000Z | import wx
from cgui import SimplePanel
from gui.pref.prefcontrols import mark_pref,get_pref
class NoobContactLayoutPanel(wx.Panel):
def __init__(self, parent):
wx.Panel.__init__(self,parent)
self.links = parent.links
self.Sizer = wx.BoxSizer(wx.VERTICAL)
self.grid = wx.FlexGridSizer... | 36.223881 | 87 | 0.441972 | 7,185 | 0.986815 | 0 | 0 | 355 | 0.048757 | 0 | 0 | 545 | 0.074852 |
706edcd839b842521a152f5c40bd0ec18890c49e | 35,466 | py | Python | post_optimization_studies/mad_analyses/four_cuts_eff_flow_chart/Output/Histos/MadAnalysis5job_0/selection_7.py | sheride/axion_pheno | 7d3fc08f5ae5b17a3500eba19a2e43f87f076ce5 | [
"MIT"
] | null | null | null | post_optimization_studies/mad_analyses/four_cuts_eff_flow_chart/Output/Histos/MadAnalysis5job_0/selection_7.py | sheride/axion_pheno | 7d3fc08f5ae5b17a3500eba19a2e43f87f076ce5 | [
"MIT"
] | null | null | null | post_optimization_studies/mad_analyses/four_cuts_eff_flow_chart/Output/Histos/MadAnalysis5job_0/selection_7.py | sheride/axion_pheno | 7d3fc08f5ae5b17a3500eba19a2e43f87f076ce5 | [
"MIT"
] | null | null | null | def selection_7():
# Library import
import numpy
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
# Library version
matplotlib_version = matplotlib.__version__
numpy_version = numpy.__version__
# Histo binning
xBinning = numpy.lin... | 182.814433 | 2,022 | 0.74742 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,556 | 0.072069 |