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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c11f7822c5bd888ca47b611e77c261bcc7260743 | 15,956 | py | Python | tests/annotator/test_structured_incident_annotator.py | langstok/EpiTator | 721fdc444382a0493702ee5976c987954753f47a | [
"Apache-2.0"
] | 40 | 2017-05-27T03:53:22.000Z | 2021-08-07T16:33:58.000Z | tests/annotator/test_structured_incident_annotator.py | langstok/EpiTator | 721fdc444382a0493702ee5976c987954753f47a | [
"Apache-2.0"
] | 25 | 2017-07-17T14:33:24.000Z | 2021-04-09T10:27:56.000Z | tests/annotator/test_structured_incident_annotator.py | langstok/EpiTator | 721fdc444382a0493702ee5976c987954753f47a | [
"Apache-2.0"
] | 9 | 2017-11-15T05:13:53.000Z | 2021-08-07T16:33:59.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
import unittest
from epitator.annotator import AnnoDoc
from epitator.structured_incident_annotator import StructuredIncidentAnnotator
import datetime
# import logging
# from .test_utils import with_log_level
def remove_empty_props(d)... | 32.169355 | 245 | 0.572324 | 15,555 | 0.974197 | 0 | 0 | 0 | 0 | 0 | 0 | 8,877 | 0.555959 |
c1211c97bd0c2cd978848796f6323f97d81c815a | 3,492 | py | Python | fastseq/optimizer/fairseq/__init__.py | nttcs-ds/fastseq | f1338f1125612df318c9d1f030a8457397ed05a6 | [
"MIT"
] | 346 | 2020-11-28T14:25:21.000Z | 2022-03-25T14:50:22.000Z | fastseq/optimizer/fairseq/__init__.py | nttcs-ds/fastseq | f1338f1125612df318c9d1f030a8457397ed05a6 | [
"MIT"
] | 22 | 2020-12-03T18:52:04.000Z | 2022-02-26T05:19:14.000Z | fastseq/optimizer/fairseq/__init__.py | nttcs-ds/fastseq | f1338f1125612df318c9d1f030a8457397ed05a6 | [
"MIT"
] | 35 | 2020-11-30T21:37:45.000Z | 2022-03-23T01:54:51.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
"""
Automatically apply the optimizations if the supported versions of FairSeq
are detected.
"""
import logging
import sys
from packaging import version
from fastseq.config import FASTSEQ_VERSION, MAX_FAIRSEQ_VERSION, MIN_FAIRSEQ_VERSION
from f... | 37.148936 | 106 | 0.71134 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,391 | 0.398339 |
c1219d3a603a918463a09f2d7d78debd9182f482 | 192 | py | Python | eula-scan/app/counts.py | davidbstein/ml-law | 2db439a9b618384c57acb51ddc0d55cf864ed8be | [
"MIT"
] | null | null | null | eula-scan/app/counts.py | davidbstein/ml-law | 2db439a9b618384c57acb51ddc0d55cf864ed8be | [
"MIT"
] | null | null | null | eula-scan/app/counts.py | davidbstein/ml-law | 2db439a9b618384c57acb51ddc0d55cf864ed8be | [
"MIT"
] | null | null | null | import model
print(dict(model._ex("select count(*) policies from tos_text").fetchone()))
print(dict(model._ex("select count(*) companies from company where last_error is null").fetchone()))
| 38.4 | 100 | 0.75 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 106 | 0.552083 |
c123c8a1452dd7217130353820cbbb49ad40ee13 | 1,340 | py | Python | __main__.py | vmenezio/clippr | 78d2d8e14090fcde3c43da1656afae25d7b1629e | [
"MIT"
] | 1 | 2015-12-20T13:32:51.000Z | 2015-12-20T13:32:51.000Z | __main__.py | vmenezio/clippr | 78d2d8e14090fcde3c43da1656afae25d7b1629e | [
"MIT"
] | null | null | null | __main__.py | vmenezio/clippr | 78d2d8e14090fcde3c43da1656afae25d7b1629e | [
"MIT"
] | null | null | null | #! python3
# -*- coding: utf-8 -*-
# [ clipper ] #
# #
# Hey, welcome to clipper! This is a small tool I #
# have been building for personal use as a means #
# to take, analyze and upload screenshots quickly. #
# ... | 37.222222 | 139 | 0.54403 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 909 | 0.677347 |
c1241bde09017aa407e82068b3e6ddb900708f43 | 508 | py | Python | old/LongestSubStringWithoutRepeatingsCharcters.py | jonathanjosef91/LeetCode | 68dd91b1d0e0c607e50378ea7f5529fd47445c4b | [
"MIT"
] | null | null | null | old/LongestSubStringWithoutRepeatingsCharcters.py | jonathanjosef91/LeetCode | 68dd91b1d0e0c607e50378ea7f5529fd47445c4b | [
"MIT"
] | 4 | 2022-02-18T10:08:51.000Z | 2022-02-18T13:12:09.000Z | old/LongestSubStringWithoutRepeatingsCharcters.py | jonathanjosef91/LeetCode | 68dd91b1d0e0c607e50378ea7f5529fd47445c4b | [
"MIT"
] | null | null | null | class Solution:
def lengthOfLongestSubstring(self, s: str) -> int:
if len(s) == 0:
return 0
NUM_OF_CHARS = 256
hist = [0] * NUM_OF_CHARS
l = 0
r = 0
max = 0
while r < len(s):
hist_i = ord(s[r])
hist[hist_i] += 1
... | 23.090909 | 54 | 0.374016 | 508 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c124253bfbcd49e0f1812986a73b8ad635b8c1fb | 936 | py | Python | core/setup.py | DiegoGH117/cellare | c0c68f6f53ee8f31999c3538c327ddca34ba6e94 | [
"MIT"
] | null | null | null | core/setup.py | DiegoGH117/cellare | c0c68f6f53ee8f31999c3538c327ddca34ba6e94 | [
"MIT"
] | null | null | null | core/setup.py | DiegoGH117/cellare | c0c68f6f53ee8f31999c3538c327ddca34ba6e94 | [
"MIT"
] | null | null | null | from setuptools import setup
with open('README.md', 'r') as f:
long_description = f.read()
setup(
name = 'CellARE',
version = '0.0.2',
description = 'A cellular automaton based implementation to run SIR simulations',
py_modules = ['cellare'],
package_dir = {'':'src'},
classif... | 33.428571 | 87 | 0.569444 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 434 | 0.463675 |
c1248143e6872a13760d0d34115b96fb5c387e21 | 12,008 | py | Python | deploy-tools/auction-deploy/tests/test_cli.py | d3centr0z/trustlines-blockchain | b90cba6e4ca7a5194eadc35793cc0fad63d9c761 | [
"MIT"
] | 9 | 2019-02-28T06:24:08.000Z | 2021-05-29T04:43:56.000Z | deploy-tools/auction-deploy/tests/test_cli.py | d3centr0z/trustlines-blockchain | b90cba6e4ca7a5194eadc35793cc0fad63d9c761 | [
"MIT"
] | 425 | 2019-04-02T08:07:27.000Z | 2021-07-01T18:29:02.000Z | deploy-tools/auction-deploy/tests/test_cli.py | d3centr0z/trustlines-blockchain | b90cba6e4ca7a5194eadc35793cc0fad63d9c761 | [
"MIT"
] | 10 | 2019-02-25T08:40:24.000Z | 2022-03-08T10:22:57.000Z | import csv
import re
import pytest
from click.testing import CliRunner
from deploy_tools.cli import test_json_rpc, test_provider
from eth_tester.exceptions import TransactionFailed
from eth_utils import to_checksum_address
import auction_deploy.core
from auction_deploy.cli import AuctionState, main
from auction_deplo... | 30.4 | 123 | 0.713358 | 0 | 0 | 379 | 0.031562 | 4,705 | 0.391822 | 0 | 0 | 3,583 | 0.298384 |
c1257c741492e036061014a924bb9f56f773f5b1 | 10,555 | py | Python | core/plugins/rabbitmq.py | dnegreira/hotsos | c88375d8700bf53faed4e5de55c34bd0bdc66187 | [
"Apache-2.0"
] | null | null | null | core/plugins/rabbitmq.py | dnegreira/hotsos | c88375d8700bf53faed4e5de55c34bd0bdc66187 | [
"Apache-2.0"
] | null | null | null | core/plugins/rabbitmq.py | dnegreira/hotsos | c88375d8700bf53faed4e5de55c34bd0bdc66187 | [
"Apache-2.0"
] | null | null | null | import os
from core.log import log
from core.cli_helpers import CLIHelper
from core.utils import mktemp_dump, sorted_dict
from core.ycheck.events import YEventCheckerBase
from core.searchtools import (
SearchDef,
SequenceSearchDef,
FileSearcher,
)
from core import (
checks,
plugintools,
)
RMQ_SERV... | 34.158576 | 168 | 0.559545 | 9,706 | 0.919564 | 0 | 0 | 7,736 | 0.732923 | 0 | 0 | 1,986 | 0.188157 |
c127d6465fa7c0671438fe8816025b96ec521c2a | 31,776 | py | Python | src/mercs/core/Mercs.py | MattiasDC/mercs | 466962e254c4f56f4a16a31b1a3d7bd893c8e23e | [
"MIT"
] | 11 | 2020-01-28T16:15:53.000Z | 2021-05-20T08:05:42.000Z | src/mercs/core/Mercs.py | MattiasDC/mercs | 466962e254c4f56f4a16a31b1a3d7bd893c8e23e | [
"MIT"
] | null | null | null | src/mercs/core/Mercs.py | MattiasDC/mercs | 466962e254c4f56f4a16a31b1a3d7bd893c8e23e | [
"MIT"
] | 4 | 2020-02-06T09:02:28.000Z | 2022-02-14T09:42:04.000Z | import itertools
import warnings
from inspect import signature
from timeit import default_timer
from sklearn.preprocessing import normalize
import dask
import numpy as np
try:
import shap
except:
msg = "SHAP not found, therefore using SHAP-values for feature importance not available."
warnings.warn(msg)
... | 30.97076 | 113 | 0.606905 | 29,809 | 0.938098 | 0 | 0 | 3,329 | 0.104765 | 0 | 0 | 4,765 | 0.149956 |
c12a3cb2ec282c49961e4c9f8bc0a286e747e3af | 13,135 | py | Python | pysnmp/HUAWEI-LswRSTP-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/HUAWEI-LswRSTP-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/HUAWEI-LswRSTP-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module HUAWEI-LswRSTP-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/HUAWEI-LswRSTP-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:34:33 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, ... | 125.095238 | 1,870 | 0.767035 | 224 | 0.017054 | 0 | 0 | 0 | 0 | 0 | 0 | 2,073 | 0.157823 |
c12c2ac656b7260dfdb953a62cfeab4d5b386d09 | 6,377 | py | Python | src/ydata_quality/duplicates/engine.py | poga/ydata-quality | 0cdda2774b05101c5f4f773b5e946f2a6544da09 | [
"MIT"
] | 242 | 2021-09-22T17:16:49.000Z | 2022-03-30T10:26:25.000Z | src/ydata_quality/duplicates/engine.py | poga/ydata-quality | 0cdda2774b05101c5f4f773b5e946f2a6544da09 | [
"MIT"
] | 13 | 2021-09-23T00:15:10.000Z | 2022-02-04T16:33:42.000Z | src/ydata_quality/duplicates/engine.py | poga/ydata-quality | 0cdda2774b05101c5f4f773b5e946f2a6544da09 | [
"MIT"
] | 21 | 2021-09-24T09:59:30.000Z | 2022-03-16T02:48:11.000Z | """
Implementation of DuplicateChecker engine class to run duplicate records analysis.
"""
from typing import List, Optional, Union
from pandas import DataFrame
from src.ydata_quality.core.warnings import Priority
from ..core import QualityEngine, QualityWarning
from ..utils.auxiliary import find_duplicate_columns
... | 45.877698 | 120 | 0.631175 | 6,054 | 0.949349 | 0 | 0 | 1,404 | 0.220166 | 0 | 0 | 2,136 | 0.334954 |
c12f3aad32b9c24ae341c2d85562fa4d677a6dca | 89 | py | Python | notebooks/classic/exercise/matplotlib-subplots.py | kmunve/ml-workshop | 96a42e663bb656e97231eff17ef4ca21e2a14b0e | [
"MIT"
] | 3 | 2020-02-17T13:35:56.000Z | 2020-10-22T13:15:28.000Z | notebooks/classic/exercise/matplotlib-subplots.py | kmunve/ml-workshop | 96a42e663bb656e97231eff17ef4ca21e2a14b0e | [
"MIT"
] | 7 | 2020-02-09T17:52:44.000Z | 2020-02-09T17:52:53.000Z | notebooks/classic/exercise/matplotlib-subplots.py | kmunve/ml-workshop | 96a42e663bb656e97231eff17ef4ca21e2a14b0e | [
"MIT"
] | 4 | 2019-07-22T17:05:52.000Z | 2020-01-23T12:17:59.000Z | fig, ax = plt.subplots(2, sharex='all', figsize=(10, 5))
fig.savefig("two-subplots.png") | 29.666667 | 56 | 0.674157 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 23 | 0.258427 |
c12f7689727d68b07585dc735616888c343cb5e6 | 3,575 | py | Python | dataio/python/pprint.py | hschwane/offline_production | e14a6493782f613b8bbe64217559765d5213dc1e | [
"MIT"
] | 1 | 2020-12-24T22:00:01.000Z | 2020-12-24T22:00:01.000Z | dataio/python/pprint.py | hschwane/offline_production | e14a6493782f613b8bbe64217559765d5213dc1e | [
"MIT"
] | null | null | null | dataio/python/pprint.py | hschwane/offline_production | e14a6493782f613b8bbe64217559765d5213dc1e | [
"MIT"
] | 3 | 2020-07-17T09:20:29.000Z | 2021-03-30T16:44:18.000Z | import collections
import re
from icecube import icetray
from icecube import dataclasses
from icecube import dataio
def format_line( frame, key, maxwidth = None, ellipsis = '...' ):
'''Given an icecube frame and a key in that frame, return
exactly one line of text describing the I3FrameObject with that key.
... | 30.818966 | 86 | 0.575385 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,252 | 0.35021 |
c12ff6fc86fc337cb5664cef1cd543659806c57c | 600 | py | Python | staris.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | staris.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | staris.py | aertoria/MiscCode | a2e94d0fe0890e6620972f84adcb7976ca9f1408 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#You are climbing a stair case. It takes n steps to reach to the top.
#Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?
class Solution:
# @param {integer} n
# @return {integer}
count=0
def climbStairs(self, n):
self.rec_climb(n)
print self.... | 18.181818 | 97 | 0.675 | 355 | 0.591667 | 0 | 0 | 0 | 0 | 0 | 0 | 273 | 0.455 |
c131857f7131f2f64a0c9cd301cbb4e69c3dcbec | 9,619 | py | Python | CryptoAttacks/Block/ecb.py | akbarszcz/CryptoAttacks | ae675d016b314414a3dc9b23c7d8a32da4c62457 | [
"MIT"
] | 54 | 2017-03-28T23:46:58.000Z | 2022-02-23T01:53:38.000Z | CryptoAttacks/Block/ecb.py | maximmasiutin/CryptoAttacks | d1d47d3cb2ce38738a60b728bc35ce80bfe64374 | [
"MIT"
] | null | null | null | CryptoAttacks/Block/ecb.py | maximmasiutin/CryptoAttacks | d1d47d3cb2ce38738a60b728bc35ce80bfe64374 | [
"MIT"
] | 13 | 2017-03-31T06:07:23.000Z | 2021-11-20T19:01:30.000Z | from __future__ import absolute_import, division, print_function
import string
from builtins import bytes, range
from CryptoAttacks.Math import factors
from CryptoAttacks.Utils import (add_padding, b2h, chunks, log, print_chunks,
random_bytes)
def encryption_oracle(payload):
"""... | 39.584362 | 132 | 0.640607 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,594 | 0.269675 |
c133b030e2d992d0cf7302a80fd9d38d5daf7e7c | 973 | py | Python | codes/convergence_elasticity_advection/bilinear.py | adRenaud/research | 2f0062a1800d7a17577bbfc2393b084253d567f4 | [
"MIT"
] | 1 | 2021-06-18T14:52:03.000Z | 2021-06-18T14:52:03.000Z | codes/comparison/fem/bilinear.py | adRenaud/research | 2f0062a1800d7a17577bbfc2393b084253d567f4 | [
"MIT"
] | 1 | 2019-01-07T13:11:11.000Z | 2019-01-07T13:11:11.000Z | codes/convergence_elasticity_advection/bilinear.py | adRenaud/research | 2f0062a1800d7a17577bbfc2393b084253d567f4 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import numpy as np
def bilinear(x,u_n,u,EPn,Pn,E,Sigy,H):
#initialization
h = x[1:len(x)]-x[:(len(x)-1)]
eps_n = (u_n[1:len(u_n)]-u_n[:(len(u_n)-1)])/h
eps = (u[1:len(u)]-u[:(len(u)-1)])/h
S = np.zeros(len(eps))
EP = np.zeros(len(eps))
P = np.zeros(len(eps))
TM = np... | 28.617647 | 66 | 0.464543 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 177 | 0.181912 |
c133b53053daca0e859c64e76f3f3420f8594a0a | 1,827 | py | Python | MR-OCP/MROCPdjango/computation/algs/max_avg_degree/max_avg_deg.py | justi/m2g | 09e8b889889ee8d8fb08b9b6fcd726fb3d901644 | [
"Apache-2.0"
] | 12 | 2015-03-11T22:07:17.000Z | 2016-01-29T21:24:29.000Z | MR-OCP/MROCPdjango/computation/algs/max_avg_degree/max_avg_deg.py | youngmook/m2g | 09e8b889889ee8d8fb08b9b6fcd726fb3d901644 | [
"Apache-2.0"
] | 213 | 2015-01-30T16:02:57.000Z | 2016-01-29T21:45:02.000Z | MR-OCP/MROCPdjango/computation/algs/max_avg_degree/max_avg_deg.py | youngmook/m2g | 09e8b889889ee8d8fb08b9b6fcd726fb3d901644 | [
"Apache-2.0"
] | 5 | 2015-02-04T13:58:12.000Z | 2016-01-29T21:24:46.000Z | #!/usr/bin/env python
# Copyright 2014 Open Connectome Project (http://openconnecto.me)
#
# 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
#
#... | 38.0625 | 104 | 0.749316 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,280 | 0.700602 |
c13494ee29e2f123470e1509930b8cc4d4a82910 | 4,828 | py | Python | tests/sandbox/.venv_ccf_sandbox/lib/python3.8/site-packages/adtk/_transformer_base.py | iLuSIAnn/test | 10d0a20dc1a646b5c1f6c7bff2960e3f5df0510e | [
"Apache-2.0"
] | null | null | null | tests/sandbox/.venv_ccf_sandbox/lib/python3.8/site-packages/adtk/_transformer_base.py | iLuSIAnn/test | 10d0a20dc1a646b5c1f6c7bff2960e3f5df0510e | [
"Apache-2.0"
] | null | null | null | tests/sandbox/.venv_ccf_sandbox/lib/python3.8/site-packages/adtk/_transformer_base.py | iLuSIAnn/test | 10d0a20dc1a646b5c1f6c7bff2960e3f5df0510e | [
"Apache-2.0"
] | null | null | null | from typing import Union
import pandas as pd
from ._base import (
_NonTrainableMultivariateModel,
_NonTrainableUnivariateModel,
_TrainableMultivariateModel,
_TrainableUnivariateModel,
)
class _NonTrainableUnivariateTransformer(_NonTrainableUnivariateModel):
def predict(
self, ts: Union[p... | 28.233918 | 79 | 0.606462 | 4,612 | 0.955261 | 0 | 0 | 0 | 0 | 0 | 0 | 3,148 | 0.65203 |
c134bdbfe11dbc33ecbecbfb4d500d8cdb08c69d | 3,511 | py | Python | src/accounts/views.py | m2jobe/tafseer | 8f7d4bddbcd8a73c607f39a2b1d27c78aef86a15 | [
"MIT"
] | null | null | null | src/accounts/views.py | m2jobe/tafseer | 8f7d4bddbcd8a73c607f39a2b1d27c78aef86a15 | [
"MIT"
] | null | null | null | src/accounts/views.py | m2jobe/tafseer | 8f7d4bddbcd8a73c607f39a2b1d27c78aef86a15 | [
"MIT"
] | null | null | null | from django.shortcuts import get_object_or_404
from django_rest_logger import log
from knox.auth import TokenAuthentication
from knox.models import AuthToken
from rest_framework import status
from rest_framework.authentication import BasicAuthentication
from rest_framework.generics import GenericAPIView
from rest_frame... | 36.195876 | 117 | 0.710339 | 2,668 | 0.759897 | 0 | 0 | 0 | 0 | 0 | 0 | 550 | 0.156651 |
c1365b2df1fdc2c37aa4c5a090e8a65cce8207d8 | 2,985 | py | Python | enigma.py | danhab99/EnigmaPY | b7526c26ac98675e911a8d0dcaf1acfe6d2659fb | [
"MIT"
] | null | null | null | enigma.py | danhab99/EnigmaPY | b7526c26ac98675e911a8d0dcaf1acfe6d2659fb | [
"MIT"
] | null | null | null | enigma.py | danhab99/EnigmaPY | b7526c26ac98675e911a8d0dcaf1acfe6d2659fb | [
"MIT"
] | null | null | null | import create
from lib import Machine
from lib import Transformer
import argparse
import pickle
from itertools import chain
from random import shuffle
parser = argparse.ArgumentParser(description='A simulation of the enigma encryption algorithm', prog='enigma.py')
subparsers = parser.add_subparsers(help='Which comman... | 33.166667 | 163 | 0.669012 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 730 | 0.244556 |
c13aeff29bda001891c8cf3e8b1bc374fc0c165c | 754 | py | Python | autoimpute/analysis/__init__.py | gjdv/autoimpute | aa418102d3b64fc7e0c0dafa6839746f0b9a6545 | [
"MIT"
] | 191 | 2019-03-16T17:00:33.000Z | 2022-03-11T12:14:17.000Z | autoimpute/analysis/__init__.py | MlataIbrahim/autoimpute | d22cd86db6facd4a68746c8c0fcb3fae70071dac | [
"MIT"
] | 57 | 2019-03-09T23:59:38.000Z | 2022-03-01T08:17:33.000Z | autoimpute/analysis/__init__.py | MlataIbrahim/autoimpute | d22cd86db6facd4a68746c8c0fcb3fae70071dac | [
"MIT"
] | 19 | 2019-04-13T19:01:23.000Z | 2021-05-14T08:59:27.000Z | """Manage the analysis folder from the autoimpute package.
This module handles imports from the analysis folder that should be accessible
whenever someone imports autoimpute.analysis. The list below specifies the
methods and classes that are available on import.
This module handles `from autoimpute.analysis import *`... | 31.416667 | 78 | 0.802387 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 518 | 0.687003 |
c13af56264e5c19bd63a5cb098d1273308f7f27f | 5,962 | py | Python | tests/sdk/test_client_response.py | AitoDotAI/aito-python-tools | 891d433222b04f4ff8a4eeafbb9268516fd215dc | [
"MIT"
] | 6 | 2019-10-16T02:35:06.000Z | 2021-02-03T13:39:43.000Z | tests/sdk/test_client_response.py | AitoDotAI/aito-python-tools | 891d433222b04f4ff8a4eeafbb9268516fd215dc | [
"MIT"
] | 23 | 2020-03-17T13:16:02.000Z | 2021-04-23T15:09:51.000Z | tests/sdk/test_client_response.py | AitoDotAI/aito-python-tools | 891d433222b04f4ff8a4eeafbb9268516fd215dc | [
"MIT"
] | null | null | null | import requests
from parameterized import parameterized, parameterized_class
import aito.client.requests as aito_requests
import aito.schema as aito_schema
from aito.client import AitoClient
from tests.cases import CompareTestCase
from tests.sdk.contexts import grocery_demo_client
def get_requests_resp_and_aito_resp... | 42.283688 | 121 | 0.679638 | 4,492 | 0.753438 | 0 | 0 | 2,834 | 0.475344 | 0 | 0 | 835 | 0.140054 |
c13c4bfee1c9c7430580db61de18561beb73453a | 157 | py | Python | test/integration/default/testinfra/test_docker.py | joe-bowman/docker-formula | efc3cc4ecb86163b179d476ebaf96d9a2fc1d476 | [
"Apache-2.0"
] | null | null | null | test/integration/default/testinfra/test_docker.py | joe-bowman/docker-formula | efc3cc4ecb86163b179d476ebaf96d9a2fc1d476 | [
"Apache-2.0"
] | null | null | null | test/integration/default/testinfra/test_docker.py | joe-bowman/docker-formula | efc3cc4ecb86163b179d476ebaf96d9a2fc1d476 | [
"Apache-2.0"
] | null | null | null | import testinfra
def test_service_is_running_and_enabled(Service):
docker = Service('docker')
assert docker.is_running
assert docker.is_enabled
| 22.428571 | 49 | 0.783439 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 0.050955 |
c13d31a85ce3ce0b7615b9c5e782008402d5a721 | 9,292 | py | Python | lib/worker.py | GuoxiaWang/InstanceLabelTool | ece37a0dfe1467ad24d6d3472adb50b20b6abd24 | [
"MIT"
] | 6 | 2018-10-28T07:43:34.000Z | 2021-04-11T15:15:14.000Z | lib/worker.py | GuoxiaWang/InstanceLabelTool | ece37a0dfe1467ad24d6d3472adb50b20b6abd24 | [
"MIT"
] | 2 | 2019-03-13T15:16:57.000Z | 2019-04-15T02:35:46.000Z | lib/worker.py | GuoxiaWang/InstanceLabelTool | ece37a0dfe1467ad24d6d3472adb50b20b6abd24 | [
"MIT"
] | 1 | 2020-01-16T10:23:36.000Z | 2020-01-16T10:23:36.000Z | """
Copyright (c) 2018- Guoxia Wang
mingzilaochongtu at gmail com
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, subject to the following conditions:
The above cop... | 36.439216 | 113 | 0.567908 | 8,610 | 0.926604 | 0 | 0 | 0 | 0 | 0 | 0 | 1,798 | 0.1935 |
c13ec1a7b5e150d075490c6a5d27c1d7f874d34f | 1,266 | py | Python | ark_nlp/dataset/__init__.py | yubuyuabc/ark-nlp | 165d35cfacd7476791c0aeba19bf43f4f8079553 | [
"Apache-2.0"
] | 1 | 2022-03-23T05:10:55.000Z | 2022-03-23T05:10:55.000Z | ark_nlp/dataset/__init__.py | yubuyuabc/ark-nlp | 165d35cfacd7476791c0aeba19bf43f4f8079553 | [
"Apache-2.0"
] | null | null | null | ark_nlp/dataset/__init__.py | yubuyuabc/ark-nlp | 165d35cfacd7476791c0aeba19bf43f4f8079553 | [
"Apache-2.0"
] | null | null | null | from ark_nlp.dataset.base._dataset import *
from ark_nlp.dataset.base._sentence_classification_dataset import SentenceClassificationDataset
from ark_nlp.dataset.base._sentence_classification_dataset import SentenceClassificationDataset as SCDataset
from ark_nlp.dataset.base._sentence_classification_dataset import Pair... | 70.333333 | 120 | 0.919431 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c142870cdc5b68b605e9ca3cb9dda2dd39df1fad | 674 | py | Python | fastquotes/index/csi.py | YangzhenZhao/fastquotes | 1faba9f7fc7801a11359001e08cefa9cfbc41d64 | [
"MIT"
] | 4 | 2020-11-18T11:25:00.000Z | 2021-04-08T01:02:49.000Z | fastquotes/index/csi.py | YangzhenZhao/fastquotes | 1faba9f7fc7801a11359001e08cefa9cfbc41d64 | [
"MIT"
] | null | null | null | fastquotes/index/csi.py | YangzhenZhao/fastquotes | 1faba9f7fc7801a11359001e08cefa9cfbc41d64 | [
"MIT"
] | 1 | 2020-11-18T11:25:01.000Z | 2020-11-18T11:25:01.000Z | import codecs
import json
import requests
from ..const import CUSTOM_HEADER
def latest_year_data(code: str, latest_year: int) -> list:
"""
lastest_year: 1、3、5
"""
url = (
f"http://www.csindex.com.cn/zh-CN/indices/index-detail/{code}?"
f"earnings_performance={latest_year}%E5%B9%B4&dat... | 23.241379 | 71 | 0.578635 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 206 | 0.303835 |
c144afd84ce935554287482e6c1ce7b3ab3a0525 | 5,596 | py | Python | Python/split-array-into-fibonacci-sequence.py | RideGreg/LeetCode | b70818b1e6947bf29519a24f78816e022ebab59e | [
"MIT"
] | 1 | 2022-01-30T06:55:28.000Z | 2022-01-30T06:55:28.000Z | Python/split-array-into-fibonacci-sequence.py | RideGreg/LeetCode | b70818b1e6947bf29519a24f78816e022ebab59e | [
"MIT"
] | null | null | null | Python/split-array-into-fibonacci-sequence.py | RideGreg/LeetCode | b70818b1e6947bf29519a24f78816e022ebab59e | [
"MIT"
] | 1 | 2021-12-31T03:56:39.000Z | 2021-12-31T03:56:39.000Z | # Time: O(n^3)
# Space: O(n)
# 842
# Given a string S of digits, such as S = "123456579",
# we can split it into a Fibonacci-like sequence [123, 456, 579].
#
# Formally, a Fibonacci-like sequence is a list F of non-negative
# integers such that:
#
# 0 <= F[i] <= 2^31 - 1,
# (that is, each integer fits a 32-bit signed... | 32.16092 | 120 | 0.454789 | 3,672 | 0.656183 | 0 | 0 | 0 | 0 | 0 | 0 | 1,937 | 0.34614 |
c144dd7ed4502a22ce0fcfc2f712cd5108d540e6 | 5,160 | py | Python | substrabac/substrapp/utils.py | GuillaumeCisco/substra-backend | 777ec0cfc10a1aad34cccba449e4923c20786d32 | [
"Apache-2.0"
] | null | null | null | substrabac/substrapp/utils.py | GuillaumeCisco/substra-backend | 777ec0cfc10a1aad34cccba449e4923c20786d32 | [
"Apache-2.0"
] | null | null | null | substrabac/substrapp/utils.py | GuillaumeCisco/substra-backend | 777ec0cfc10a1aad34cccba449e4923c20786d32 | [
"Apache-2.0"
] | null | null | null | import io
import hashlib
import logging
import os
import tempfile
from os import path
from os.path import isfile, isdir
import shutil
import requests
import tarfile
import zipfile
import uuid
from checksumdir import dirhash
from django.conf import settings
from rest_framework import status
class JsonException(Exce... | 27.593583 | 105 | 0.64845 | 836 | 0.162016 | 0 | 0 | 0 | 0 | 0 | 0 | 826 | 0.160078 |
c1472dfe5defd2c2cedbd1490cbcbbe0967be5ae | 67 | py | Python | {{cookiecutter.git_project_name}}/core/views/__init__.py | imAsparky/django-cookiecutter | 6608b46d3b3a75ef8880b18724eb06e9ed7567df | [
"BSD-3-Clause"
] | null | null | null | {{cookiecutter.git_project_name}}/core/views/__init__.py | imAsparky/django-cookiecutter | 6608b46d3b3a75ef8880b18724eb06e9ed7567df | [
"BSD-3-Clause"
] | 128 | 2021-09-28T03:17:40.000Z | 2022-03-19T00:21:50.000Z | {{cookiecutter.git_project_name}}/core/views/__init__.py | imAsparky/django-cookiecutter | 6608b46d3b3a75ef8880b18724eb06e9ed7567df | [
"BSD-3-Clause"
] | null | null | null | """Initialise {{cookiecutter.git_project_name}} Core App Views."""
| 33.5 | 66 | 0.746269 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 66 | 0.985075 |
c1484f680c8d5268a7187ffd0cd5d37747e57a92 | 1,569 | py | Python | Algorithms/Assign1/v2.py | thebishaldeb/ClassAssignments | f44c51695266da0c98d1ab3516c473c6d1008933 | [
"MIT"
] | null | null | null | Algorithms/Assign1/v2.py | thebishaldeb/ClassAssignments | f44c51695266da0c98d1ab3516c473c6d1008933 | [
"MIT"
] | null | null | null | Algorithms/Assign1/v2.py | thebishaldeb/ClassAssignments | f44c51695266da0c98d1ab3516c473c6d1008933 | [
"MIT"
] | null | null | null | # FUNCTION
def med(arr1, arr2, length):
if length == 2:
return findMed( arr1, arr2)
mid = int((length-1)/2)
if (arr1[mid] < arr2[mid]):
return med( arr2[0:mid+1], arr1[-mid-1:length], len(arr2[0:mid+1]))
elif (arr1[mid] > arr2[mid]):
return med( arr1[0:mid+1], ar... | 26.59322 | 82 | 0.586361 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 459 | 0.292543 |
c1486548c7b778a225198dc3750c6bc512122e6c | 4,025 | py | Python | brain-imaging/run_tsne_brain.py | agramfort/spatio-temporal-alignements | 18594cf0372dc874decccecad69e310f84142c88 | [
"BSD-3-Clause"
] | 28 | 2019-10-18T07:29:52.000Z | 2022-01-27T15:12:45.000Z | brain-imaging/run_tsne_brain.py | agramfort/spatio-temporal-alignements | 18594cf0372dc874decccecad69e310f84142c88 | [
"BSD-3-Clause"
] | 2 | 2021-01-16T18:34:31.000Z | 2022-02-03T14:49:34.000Z | brain-imaging/run_tsne_brain.py | agramfort/spatio-temporal-alignements | 18594cf0372dc874decccecad69e310f84142c88 | [
"BSD-3-Clause"
] | 4 | 2021-01-16T17:22:23.000Z | 2022-01-11T03:24:24.000Z |
import mne
import pickle
import numpy as np
from sta import sta_matrix, sdtw_matrix
from sklearn.manifold import TSNE
# change this if you have GPUs
# in our platform, this experiment ran on 4 GPUs in around 20 minutes
n_gpu_devices = 0
def generate_samples(n_samples, n_times, time_point, space_points, M,
... | 37.268519 | 79 | 0.640248 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 764 | 0.189814 |
c14cdcac7d3354fc54dac9a43c5883bc3c65d04c | 2,161 | py | Python | cyphercat/datadefs/cifar10_dataset.py | arafin-lab/model_inversion_experiments | 8e491f22ae847d8d0f2f31caed6ad0078c9b6a49 | [
"Apache-2.0"
] | 101 | 2018-10-26T14:39:19.000Z | 2022-03-28T11:38:45.000Z | cyphercat/datadefs/cifar10_dataset.py | zhampel/cyphercat | 4029ae8683b9056013e6424d8931afe79afa618e | [
"Apache-2.0"
] | 32 | 2018-10-10T23:02:04.000Z | 2019-11-11T21:30:57.000Z | cyphercat/datadefs/cifar10_dataset.py | zhampel/cyphercat | 4029ae8683b9056013e6424d8931afe79afa618e | [
"Apache-2.0"
] | 49 | 2018-10-05T17:54:49.000Z | 2022-02-10T07:47:25.000Z | import torch
from torch.utils.data import Dataset, ConcatDataset
import torchvision
from cyphercat.definitions import DATASETS_DIR, DATASPLITS_DIR
from tqdm import tqdm
import pandas as pd
import numpy as np
import pickle
import os
from .splitter import splitter, dataset_split
def Cifar10_preload_and_split(path=None,... | 32.742424 | 105 | 0.690421 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 730 | 0.337807 |
c14dc762e4ac7e02bd632552dcbebfc3d90dd126 | 31 | py | Python | easyTCP/SERVER/utils/__init__.py | dsal3389/easyTCP | 0a11ffe4726bfd0461c24fa459e417fd2fe3cd7f | [
"MIT"
] | 4 | 2018-12-09T13:57:59.000Z | 2019-10-19T19:34:28.000Z | easyTCP/SERVER/utils/__init__.py | dsal3389/easyTCP | 0a11ffe4726bfd0461c24fa459e417fd2fe3cd7f | [
"MIT"
] | null | null | null | easyTCP/SERVER/utils/__init__.py | dsal3389/easyTCP | 0a11ffe4726bfd0461c24fa459e417fd2fe3cd7f | [
"MIT"
] | null | null | null | #from .BUILD_IN import BUILD_IN | 31 | 31 | 0.83871 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 31 | 1 |
c14f824a0678ada5998332bc22d1955b5b7acece | 19,547 | py | Python | src/muscle_synergies/vicon_data/user_data.py | elvis-sik/muscle_synergies | eff0d016f2032faa9b8fba5363249e6fdb150abf | [
"MIT"
] | 6 | 2021-02-05T21:53:08.000Z | 2022-01-20T16:50:39.000Z | src/muscle_synergies/vicon_data/user_data.py | elvis-sik/muscle_synergies | eff0d016f2032faa9b8fba5363249e6fdb150abf | [
"MIT"
] | 1 | 2021-02-06T14:14:52.000Z | 2021-03-01T03:44:23.000Z | src/muscle_synergies/vicon_data/user_data.py | elvis-sik/muscle_synergies | eff0d016f2032faa9b8fba5363249e6fdb150abf | [
"MIT"
] | null | null | null | """Types that help building the final representation of the data.
From the point of view of the internal API, the main type in this module is
:py:class:`Builder`, which uses the data stored in an
:py:class:`~muscle_synergies.vicon_data.aggregator.Aggregator` to build the
:py:class:`ViconNexusData`. That object, in tur... | 37.020833 | 91 | 0.65785 | 18,445 | 0.943623 | 181 | 0.00926 | 7,687 | 0.393257 | 0 | 0 | 8,625 | 0.441244 |
c1530d1f98179c78b07bae3b02ff2a685a89878e | 1,629 | py | Python | tests/modification-check.py | luisriverag/certbot | 52e207a404ab3600637fc7a24492e2c68512ce2d | [
"Apache-2.0"
] | 1 | 2017-05-14T17:09:38.000Z | 2017-05-14T17:09:38.000Z | tests/modification-check.py | luisriverag/certbot | 52e207a404ab3600637fc7a24492e2c68512ce2d | [
"Apache-2.0"
] | 5 | 2021-03-15T21:43:04.000Z | 2021-07-22T20:31:43.000Z | tests/modification-check.py | luisriverag/certbot | 52e207a404ab3600637fc7a24492e2c68512ce2d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Ensures there have been no changes to important certbot-auto files."""
import hashlib
import os
# Relative to the root of the Certbot repo, these files are expected to exist
# and have the SHA-256 hashes contained in this dictionary. These hashes were
# taken from our v1.14.0 tag which was t... | 33.9375 | 90 | 0.745242 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 982 | 0.602824 |
c153b504e55b04acb0b49c1e4ecd7223c00968b8 | 560 | py | Python | tests/test_load.py | michaelpeterswa/qsml | e3aeb48ac8ba7bb3eca7ec866f6d75258cfdc7c2 | [
"MIT"
] | 7 | 2020-06-28T16:28:54.000Z | 2020-09-18T13:18:55.000Z | tests/test_load.py | michaelpeterswa/qsml | e3aeb48ac8ba7bb3eca7ec866f6d75258cfdc7c2 | [
"MIT"
] | 1 | 2020-06-27T08:36:02.000Z | 2020-06-28T23:30:03.000Z | tests/test_load.py | michaelpeterswa/qsml | e3aeb48ac8ba7bb3eca7ec866f6d75258cfdc7c2 | [
"MIT"
] | 1 | 2020-07-30T05:03:38.000Z | 2020-07-30T05:03:38.000Z | import unittest
import qsml
class TestLoad(unittest.TestCase):
def test_load(self):
file = "tests/load.qsml"
returned_val = {
"myportfolio": {"GOOG": 10, "AAPL": 5, "BRK.B": 1},
"test": {"SNAP": 130, "MSFT": 5, "TSLA": 100},
}
self.assertEqual(qsml.load(file... | 25.454545 | 73 | 0.583929 | 480 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 117 | 0.208929 |
c153e1c37eaaf1da2ce812283ce1bb7f91f0f0b1 | 6,012 | py | Python | votesim/utilities/decorators.py | johnh865/election_sim | b73b7e65f1bb22abb82cbe8442fcf02b0c20894e | [
"MIT"
] | 8 | 2019-10-21T23:24:51.000Z | 2021-09-14T03:04:59.000Z | votesim/utilities/decorators.py | johnh865/election_sim | b73b7e65f1bb22abb82cbe8442fcf02b0c20894e | [
"MIT"
] | 2 | 2021-02-09T23:52:47.000Z | 2021-02-10T04:08:35.000Z | votesim/utilities/decorators.py | johnh865/election_sim | b73b7e65f1bb22abb82cbe8442fcf02b0c20894e | [
"MIT"
] | 1 | 2019-10-21T23:32:18.000Z | 2019-10-21T23:32:18.000Z | """
Collection of utilities such as memoization, automatic property storage, etc
"""
from __future__ import print_function, absolute_import, division
from functools import wraps, partial
import logging
from votesim.utilities import misc
logger = logging.getLogger(__name__)
class memoize:
"""
Decor... | 23.669291 | 100 | 0.58849 | 1,697 | 0.282269 | 0 | 0 | 398 | 0.066201 | 0 | 0 | 2,796 | 0.46507 |
c15402f1ab58bd4a60c7b4bb3dddbb75ea0cbef9 | 10,304 | py | Python | portcran.py | yzgyyang/portcran | 04fa6ce8cd8585ed96aab19177d030b030ff79c9 | [
"BSD-2-Clause"
] | 1 | 2021-07-15T04:35:08.000Z | 2021-07-15T04:35:08.000Z | portcran.py | yzgyyang/portcran | 04fa6ce8cd8585ed96aab19177d030b030ff79c9 | [
"BSD-2-Clause"
] | null | null | null | portcran.py | yzgyyang/portcran | 04fa6ce8cd8585ed96aab19177d030b030ff79c9 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
from argparse import ArgumentParser, Namespace
from pathlib import Path
from re import search
from sys import argv
from typing import Callable, Iterable, List, Optional, TextIO, Tuple
from urllib.request import urlopen, urlretrieve
from ports import Platform, PortError, PortLicense, Ports
from po... | 40.566929 | 120 | 0.595885 | 901 | 0.087442 | 0 | 0 | 1,404 | 0.136258 | 0 | 0 | 2,095 | 0.203319 |
c15423c94eae9054e142abda74c8200dd59d29fa | 6,484 | py | Python | calendarserver/tools/validcalendardata.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | 1 | 2017-02-18T19:22:19.000Z | 2017-02-18T19:22:19.000Z | calendarserver/tools/validcalendardata.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | null | null | null | calendarserver/tools/validcalendardata.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
##
# Copyright (c) 2012-2015 Apple Inc. 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 re... | 27.35865 | 120 | 0.609963 | 4,098 | 0.632017 | 0 | 0 | 0 | 0 | 0 | 0 | 2,100 | 0.323874 |
c155e8b957ea1abd8dd89360b9558b67dc020499 | 1,243 | py | Python | src/gluonts/nursery/torch_arsgls_rbpf/test/basic_tests/conv.py | richardk53/gluon-ts | 5bde492198c0348b550ac6f7269f1740a699ec30 | [
"Apache-2.0"
] | null | null | null | src/gluonts/nursery/torch_arsgls_rbpf/test/basic_tests/conv.py | richardk53/gluon-ts | 5bde492198c0348b550ac6f7269f1740a699ec30 | [
"Apache-2.0"
] | null | null | null | src/gluonts/nursery/torch_arsgls_rbpf/test/basic_tests/conv.py | richardk53/gluon-ts | 5bde492198c0348b550ac6f7269f1740a699ec30 | [
"Apache-2.0"
] | null | null | null | import torch
from torch import nn
from utils.utils import compute_conv_output_img_dims
def test_compute_conv_dims_out():
for width_img in [63, 64, 65, 66]:
dims_img = (width_img, width_img)
inp = torch.randn((10, 1,) + dims_img)
for padding in [0, 1, 2]:
for dilation in [1, 2,... | 38.84375 | 77 | 0.442478 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c1561171d3885a4dc3c76906c27aa5632df77a77 | 589 | py | Python | OOP/deep_dive_tkinter/many_widget_example.py | Amaranese/python-exercises-notes-solutions-projects | 58f7677ecb97971733d9f4ff87fda75e23d7c0cb | [
"Unlicense"
] | 1 | 2021-12-03T12:38:33.000Z | 2021-12-03T12:38:33.000Z | OOP/deep_dive_tkinter/many_widget_example.py | Amaranese/python-exercises-notes-solutions-projects | 58f7677ecb97971733d9f4ff87fda75e23d7c0cb | [
"Unlicense"
] | null | null | null | OOP/deep_dive_tkinter/many_widget_example.py | Amaranese/python-exercises-notes-solutions-projects | 58f7677ecb97971733d9f4ff87fda75e23d7c0cb | [
"Unlicense"
] | null | null | null | import tkinter as tk
parent = tk.Tk()
# tk.WidgetName(parent_frame, options)
tk.Entry(parent, width=25).pack()
tk.Button(parent, text="LOOKOUT!").pack()
tk.Checkbutton(parent, text='RememberMe', variable=tk.IntVar()).pack()
tk.Label(parent, text="What's Your Name?").pack()
tk.OptionMenu(parent, tk.IntVar(), "Select ... | 32.722222 | 83 | 0.702886 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 135 | 0.229202 |
c156565f017d48828a6c04509f6eaa61d605a332 | 432 | py | Python | hardhat/recipes/x11/driver/xf86-video-nouveau.py | stangelandcl/hardhat | 1ad0c5dec16728c0243023acb9594f435ef18f9c | [
"MIT"
] | null | null | null | hardhat/recipes/x11/driver/xf86-video-nouveau.py | stangelandcl/hardhat | 1ad0c5dec16728c0243023acb9594f435ef18f9c | [
"MIT"
] | null | null | null | hardhat/recipes/x11/driver/xf86-video-nouveau.py | stangelandcl/hardhat | 1ad0c5dec16728c0243023acb9594f435ef18f9c | [
"MIT"
] | null | null | null | from ..base import X11DriverBaseRecipe
class Xf86VideoNouveauRecipe(X11DriverBaseRecipe):
def __init__(self, *args, **kwargs):
super(Xf86VideoNouveauRecipe, self).__init__(*args, **kwargs)
self.sha256 = '6d9242ba139c3df7afefffb455573b52' \
'f4427920b978161c00483c64a6da47cb'
... | 33.230769 | 69 | 0.664352 | 390 | 0.902778 | 0 | 0 | 0 | 0 | 0 | 0 | 109 | 0.252315 |
c1588d562ae990566fc09dd0f8d1a7453c6a6f20 | 3,563 | py | Python | fem_dsa/networks/autoencoders.py | idealab-isu/DSA | b9157eb9307c0ff06d91ff2bdcd8f70df5b896cb | [
"BSD-3-Clause"
] | 3 | 2022-01-18T01:33:34.000Z | 2022-03-22T20:46:16.000Z | DiffNet/networks/autoencoders.py | adityabalu/DiffNet | a21e024ad9948fa76fe73796e216a0a6601f2c7c | [
"MIT"
] | 1 | 2022-03-30T10:16:47.000Z | 2022-03-30T10:16:47.000Z | DiffNet/networks/autoencoders.py | adityabalu/DiffNet | a21e024ad9948fa76fe73796e216a0a6601f2c7c | [
"MIT"
] | 2 | 2021-12-01T20:53:24.000Z | 2021-12-02T06:42:39.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
class Encoder(nn.Module):
def __init__(self, in_channels=3, dim=64, n_downsample=3, encoder_type='convolutional'):
super(Encoder, self).__init__()
# Initial convolution block
layers = [
... | 33.299065 | 128 | 0.541959 | 3,449 | 0.968004 | 0 | 0 | 0 | 0 | 0 | 0 | 315 | 0.088409 |
c1598a3545cd8dc90345c280e6f51a6897b9912a | 2,215 | py | Python | week02/03.MoreTesting/fractions/tests_collect_fractions.py | TsvetomirTsvetkov/Python-Course-101 | 1c5ea4631128c22effe3c4ee5a18c43f5e79d463 | [
"MIT"
] | null | null | null | week02/03.MoreTesting/fractions/tests_collect_fractions.py | TsvetomirTsvetkov/Python-Course-101 | 1c5ea4631128c22effe3c4ee5a18c43f5e79d463 | [
"MIT"
] | null | null | null | week02/03.MoreTesting/fractions/tests_collect_fractions.py | TsvetomirTsvetkov/Python-Course-101 | 1c5ea4631128c22effe3c4ee5a18c43f5e79d463 | [
"MIT"
] | null | null | null | # tests_collect_fractions.py
import unittest
from collect_fractions import (
validate_input_collect,
lcm,
collect_fractions
)
class TestValidateInputCollect(unittest.TestCase):
def test_validation_passes_with_correct_input(self):
fractions = [(1, 3), (4, 5)]
validate_input_collect(fractions)
def test_vali... | 25.170455 | 96 | 0.751242 | 2,037 | 0.919639 | 0 | 0 | 0 | 0 | 0 | 0 | 193 | 0.087133 |
c159e41ff48b6f66e8bdd24ff1ed589656d0c172 | 3,278 | py | Python | exporter/management/commands/exporter.py | open-contracting/data-registry | 5a73e7f2334c6af5be23070493842b494b3e5357 | [
"BSD-3-Clause"
] | null | null | null | exporter/management/commands/exporter.py | open-contracting/data-registry | 5a73e7f2334c6af5be23070493842b494b3e5357 | [
"BSD-3-Clause"
] | 170 | 2021-02-12T12:52:37.000Z | 2022-03-28T14:37:05.000Z | exporter/management/commands/exporter.py | open-contracting/data-registry | 5a73e7f2334c6af5be23070493842b494b3e5357 | [
"BSD-3-Clause"
] | null | null | null | import gzip
import logging
import shutil
from django.conf import settings
from django.core.management.base import BaseCommand
from django.db import connections
from yapw.methods.blocking import ack
from exporter.util import Export, create_client
logger = logging.getLogger(__name__)
class Command(BaseCommand):
... | 29.531532 | 113 | 0.556742 | 381 | 0.116229 | 0 | 0 | 0 | 0 | 0 | 0 | 966 | 0.294692 |
c15a19cb03f23c0c130c7938dd4eba13516d4750 | 71 | py | Python | config.py | SuShu19/TiTIC | 7dd83a1527ee0e57e354eb7843c75ad2e53d69fc | [
"Apache-2.0"
] | null | null | null | config.py | SuShu19/TiTIC | 7dd83a1527ee0e57e354eb7843c75ad2e53d69fc | [
"Apache-2.0"
] | null | null | null | config.py | SuShu19/TiTIC | 7dd83a1527ee0e57e354eb7843c75ad2e53d69fc | [
"Apache-2.0"
] | null | null | null | code_path = "F:/发表论文/apsec 2021/TiTIC"
data_path = "D:/fasttext_data"
| 17.75 | 38 | 0.71831 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 52 | 0.658228 |
c15a975febae16e23c4a925f353cceee52893986 | 147 | py | Python | terrascript/pingdom/d.py | jackluo923/python-terrascript | ed4b626e6d28621ea1b02fc16f7277a094d89830 | [
"BSD-2-Clause"
] | 4 | 2022-02-07T21:08:14.000Z | 2022-03-03T04:41:28.000Z | terrascript/pingdom/d.py | jackluo923/python-terrascript | ed4b626e6d28621ea1b02fc16f7277a094d89830 | [
"BSD-2-Clause"
] | null | null | null | terrascript/pingdom/d.py | jackluo923/python-terrascript | ed4b626e6d28621ea1b02fc16f7277a094d89830 | [
"BSD-2-Clause"
] | 2 | 2022-02-06T01:49:42.000Z | 2022-02-08T14:15:00.000Z | # terrascript/pingdom/d.py
import terrascript
class pingdom_contact(terrascript.Data):
pass
class pingdom_team(terrascript.Data):
pass
| 13.363636 | 40 | 0.768707 | 95 | 0.646259 | 0 | 0 | 0 | 0 | 0 | 0 | 26 | 0.176871 |
c15bdeecdedb2772bfcc37455ef18ef0155dfd42 | 154 | py | Python | src/arcrest/hostedservice/__init__.py | kevinsigwart/ArcREST | 2d83bd87e23f3f78d6bba2131e6d47cf8e2e07c1 | [
"Apache-2.0"
] | null | null | null | src/arcrest/hostedservice/__init__.py | kevinsigwart/ArcREST | 2d83bd87e23f3f78d6bba2131e6d47cf8e2e07c1 | [
"Apache-2.0"
] | null | null | null | src/arcrest/hostedservice/__init__.py | kevinsigwart/ArcREST | 2d83bd87e23f3f78d6bba2131e6d47cf8e2e07c1 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from .service import AdminFeatureService, AdminFeatureServiceLayer, AdminMapService, Services
__version__ = "3.5.6" | 51.333333 | 93 | 0.857143 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 0.045455 |
c160f505df5dab1a29a92764a36839b1cc74f021 | 3,357 | py | Python | test_triplegan.py | AmirHosseinAmeli/Triple-GAN | 127948d9e22767d315a4b3ca58fc4a56d92ff9d3 | [
"MIT"
] | 29 | 2020-09-03T08:35:47.000Z | 2022-02-10T18:39:29.000Z | test_triplegan.py | AmirHosseinAmeli/Triple-GAN | 127948d9e22767d315a4b3ca58fc4a56d92ff9d3 | [
"MIT"
] | 6 | 2020-12-22T14:43:14.000Z | 2022-03-12T00:55:24.000Z | test_triplegan.py | AmirHosseinAmeli/Triple-GAN | 127948d9e22767d315a4b3ca58fc4a56d92ff9d3 | [
"MIT"
] | 8 | 2020-10-01T04:03:40.000Z | 2022-03-21T10:23:40.000Z | import copy
import os
import pickle
import torch
import torch.nn as nn
import numpy as np
from library import inputs, eval_inception_score
from Utils.checkpoints import save_context, Logger
from Utils import flags
from Utils import config
import Torture
FLAGS = flags.FLAGS
KEY_ARGUMENTS = config.load_config(FLAGS.c... | 32.278846 | 84 | 0.712541 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 886 | 0.263926 |
c16138a7cd5144aec3ed7335c23d116573f315f9 | 2,093 | py | Python | pages/product_page.py | DedMazzai/stepic_test_project | f5dc9e71c9f18b48edf017cbfde86ada888482e2 | [
"Apache-2.0"
] | null | null | null | pages/product_page.py | DedMazzai/stepic_test_project | f5dc9e71c9f18b48edf017cbfde86ada888482e2 | [
"Apache-2.0"
] | null | null | null | pages/product_page.py | DedMazzai/stepic_test_project | f5dc9e71c9f18b48edf017cbfde86ada888482e2 | [
"Apache-2.0"
] | null | null | null | from .base_page import BasePage
from .locators import ProductPageLocators
class ProductPage(BasePage):
def should_be_button_add_to_basket(self):
assert self.is_element_present(
*ProductPageLocators.BUTTON_ADD_TO_BASKET), "Button add to basket is not presented"
def click_button_add_to_bas... | 49.833333 | 117 | 0.763497 | 2,016 | 0.963211 | 0 | 0 | 0 | 0 | 0 | 0 | 392 | 0.187291 |
c16436e269d25cef8488abc134bc5e666d9d98ac | 2,863 | py | Python | ViyaCasual/CAS/CASTableBase.py | willhaley-bne/ViyaCasual | 9c0ca9b05a9602e67c8d56e2f63eba01e1218e42 | [
"MIT"
] | null | null | null | ViyaCasual/CAS/CASTableBase.py | willhaley-bne/ViyaCasual | 9c0ca9b05a9602e67c8d56e2f63eba01e1218e42 | [
"MIT"
] | null | null | null | ViyaCasual/CAS/CASTableBase.py | willhaley-bne/ViyaCasual | 9c0ca9b05a9602e67c8d56e2f63eba01e1218e42 | [
"MIT"
] | null | null | null | import pandas as pd
class CASTableBase(object):
source_sql = None
source_data = None
source_cas = None
source_caslib = None
cas_table_name = None
caslib = None
decision_source = None
decision = None
db_conn = None
clean_up = False
def __init__(self, viya_conn, db_conn=N... | 28.63 | 96 | 0.653161 | 2,840 | 0.991966 | 0 | 0 | 0 | 0 | 0 | 0 | 76 | 0.026546 |
c164a2131f24d47c407acfa16109127338defe1a | 102 | py | Python | Beecrowd/Python/ex1060.py | yurifalves/Exercises | a4e84ac76b9432f6c2efdeef6e5e2a093c39882d | [
"MIT"
] | null | null | null | Beecrowd/Python/ex1060.py | yurifalves/Exercises | a4e84ac76b9432f6c2efdeef6e5e2a093c39882d | [
"MIT"
] | null | null | null | Beecrowd/Python/ex1060.py | yurifalves/Exercises | a4e84ac76b9432f6c2efdeef6e5e2a093c39882d | [
"MIT"
] | null | null | null | cont = 0
for i in range(6):
if float(input()) >= 0: cont += 1
print(f'{cont} valores positivos')
| 17 | 37 | 0.598039 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 27 | 0.264706 |
c164aad97b718794ec2487936b78ec7212cf88c1 | 1,523 | py | Python | Library/operations.py | marcelodaher/ArraySim | f42db96e30acff6f3ce3829dc89a79ef5473b4db | [
"MIT"
] | 1 | 2019-12-06T16:48:10.000Z | 2019-12-06T16:48:10.000Z | Library/operations.py | marcelodaher/ArraySim | f42db96e30acff6f3ce3829dc89a79ef5473b4db | [
"MIT"
] | null | null | null | Library/operations.py | marcelodaher/ArraySim | f42db96e30acff6f3ce3829dc89a79ef5473b4db | [
"MIT"
] | null | null | null | # coding=utf-8
import numpy as np
def colKRproduct(A,B):
'''
columnwise Khatri-Rao product between matrix A and B
'''
if A.shape[1] != B.shape[1]:
raise TypeError("A and B must have the same number of columns")
q = A.shape[1]
C = np.zeros([A.shape[0]*B.shape[0],q])
for ... | 27.196429 | 76 | 0.512147 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 210 | 0.137705 |
c1653d9ca159307ad4091c89f53debf9a3453ffc | 1,337 | py | Python | gtsfm/runner/run_scene_optimizer_olssonloader.py | swershrimpy/gtsfm | 8d301eb3ef9172345a1ac1369fd4e19764d28946 | [
"Apache-2.0"
] | 122 | 2021-02-07T23:01:58.000Z | 2022-03-30T13:10:35.000Z | gtsfm/runner/run_scene_optimizer_olssonloader.py | swershrimpy/gtsfm | 8d301eb3ef9172345a1ac1369fd4e19764d28946 | [
"Apache-2.0"
] | 273 | 2021-01-30T16:45:26.000Z | 2022-03-16T15:02:33.000Z | gtsfm/runner/run_scene_optimizer_olssonloader.py | swershrimpy/gtsfm | 8d301eb3ef9172345a1ac1369fd4e19764d28946 | [
"Apache-2.0"
] | 13 | 2021-03-12T03:01:27.000Z | 2022-03-11T03:16:54.000Z | import argparse
import os
from pathlib import Path
import gtsfm.utils.logger as logger_utils
from gtsfm.loader.loader_base import LoaderBase
from gtsfm.loader.olsson_loader import OlssonLoader
from gtsfm.runner.gtsfm_runner_base import GtsfmRunnerBase
DATA_ROOT = Path(__file__).resolve().parent.parent.parent / "test... | 31.833333 | 115 | 0.729993 | 881 | 0.658938 | 0 | 0 | 0 | 0 | 0 | 0 | 125 | 0.093493 |
c165a2d6078e507a40ef86207575d3eefb0da508 | 289 | py | Python | test/tests/intmethods.py | kevinxucs/pyston | bdb87c1706ac74a0d15d9bc2bae53798678a5f14 | [
"Apache-2.0"
] | 1 | 2015-11-06T03:39:51.000Z | 2015-11-06T03:39:51.000Z | test/tests/intmethods.py | kevinxucs/pyston | bdb87c1706ac74a0d15d9bc2bae53798678a5f14 | [
"Apache-2.0"
] | null | null | null | test/tests/intmethods.py | kevinxucs/pyston | bdb87c1706ac74a0d15d9bc2bae53798678a5f14 | [
"Apache-2.0"
] | null | null | null | # can't try large numbers yet due to lack of long
for i in xrange(1, 100):
for j in xrange(1, 100):
print i.__divmod__(j)
for i in xrange(1, 12):
for j in xrange(1, 12):
print i | j
print i & j
print i ^ j
print 1 ** 0
print 0 ** 0
print -1 ** 0
| 18.0625 | 49 | 0.546713 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 49 | 0.16955 |
c165a6d6b497f214d3ee7b9ab319db0cb8d9588f | 384 | py | Python | src/reverse/setup.py | fugue/zim-example | 861b197ddc1074375bb9437b3282ab3e517b9019 | [
"MIT"
] | null | null | null | src/reverse/setup.py | fugue/zim-example | 861b197ddc1074375bb9437b3282ab3e517b9019 | [
"MIT"
] | null | null | null | src/reverse/setup.py | fugue/zim-example | 861b197ddc1074375bb9437b3282ab3e517b9019 | [
"MIT"
] | 2 | 2021-03-17T03:02:52.000Z | 2021-07-21T23:31:08.000Z | import os.path
from setuptools import setup, find_packages
with open(os.path.join(os.path.dirname(__file__), "requirements.txt")) as f:
requirements = f.read().strip()
setup(
name="reverse",
version="0.0.0",
description="Reverse data",
packages=find_packages(exclude=["tests"]),
package_data={"... | 25.6 | 76 | 0.690104 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 76 | 0.197917 |
c165ec6055b3d0599812a0a06fa513f8948722c9 | 3,204 | py | Python | tutorial_metarl/tasks/CompositionalTwoArmedBandit.py | akjagadish/tutorial-metarl | 8810eafa783749c70a0575e805810a098b3df0fb | [
"MIT"
] | null | null | null | tutorial_metarl/tasks/CompositionalTwoArmedBandit.py | akjagadish/tutorial-metarl | 8810eafa783749c70a0575e805810a098b3df0fb | [
"MIT"
] | null | null | null | tutorial_metarl/tasks/CompositionalTwoArmedBandit.py | akjagadish/tutorial-metarl | 8810eafa783749c70a0575e805810a098b3df0fb | [
"MIT"
] | null | null | null | import torch
import numpy as np
import math
class CompositionalTwoArmedBandit():
def __init__(self, probs, ctx_dim, num_arms, num_ctx=400, max_ctx=1000):
self.probs = np.asarray(probs)
self.num_arms = num_arms
self.ctx_dim = ctx_dim
self.num_ctx = num_ctx
self.m... | 41.61039 | 102 | 0.626717 | 3,155 | 0.984707 | 0 | 0 | 0 | 0 | 0 | 0 | 257 | 0.080212 |
c1665cfed8ff4a38680780c2f17d5964d1d9ed35 | 70 | py | Python | 00.source-code/02.Python/writeFile.py | wardensky/blogs | e8f347d05b59684f81ea6f7ee8cdbe0d701122f5 | [
"Apache-2.0"
] | 2 | 2018-12-20T12:19:56.000Z | 2019-09-24T06:25:01.000Z | 00.source-code/02.Python/writeFile.py | wardensky/blogs | e8f347d05b59684f81ea6f7ee8cdbe0d701122f5 | [
"Apache-2.0"
] | null | null | null | 00.source-code/02.Python/writeFile.py | wardensky/blogs | e8f347d05b59684f81ea6f7ee8cdbe0d701122f5 | [
"Apache-2.0"
] | 3 | 2018-09-18T06:58:56.000Z | 2019-10-27T09:35:01.000Z | #!/usr/bin/python
f = file('x1.txt', 'w')
f.write('hello')
f.close()
| 11.666667 | 23 | 0.571429 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 35 | 0.5 |
c16896197cec1995065f5c34607ce687f11e89f6 | 2,916 | py | Python | scripts/example.py | alexboden/nba-who-has-more | 590ba8bd062b96ff866c13988eb79a8c7ff0f488 | [
"MIT"
] | null | null | null | scripts/example.py | alexboden/nba-who-has-more | 590ba8bd062b96ff866c13988eb79a8c7ff0f488 | [
"MIT"
] | null | null | null | scripts/example.py | alexboden/nba-who-has-more | 590ba8bd062b96ff866c13988eb79a8c7ff0f488 | [
"MIT"
] | null | null | null | from nba_api.stats.static import players
from nba_api.stats import endpoints
from nba_api.stats.library.parameters import SeasonAll
from nba_api.stats.endpoints import playercareerstats
from nba_api.stats.endpoints import commonplayerinfo
from nba_api.stats.endpoints import playergamelog
import pandas as pd
import tim... | 25.80531 | 126 | 0.718793 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 756 | 0.259259 |
c168f756bc02752d155d2b864b3e1da8b5fa59b8 | 2,653 | py | Python | data/Process_MIR1k.py | carrieeeeewithfivee/tf2_Vocal_Separation_UNet | 5dbb6838bee0d8fbf0f73fa83e8c3d6c1978c67c | [
"MIT"
] | null | null | null | data/Process_MIR1k.py | carrieeeeewithfivee/tf2_Vocal_Separation_UNet | 5dbb6838bee0d8fbf0f73fa83e8c3d6c1978c67c | [
"MIT"
] | 1 | 2022-01-02T06:54:27.000Z | 2022-01-02T12:09:13.000Z | data/Process_MIR1k.py | carrieeeeewithfivee/tf2_Vocal_Separation_UNet | 5dbb6838bee0d8fbf0f73fa83e8c3d6c1978c67c | [
"MIT"
] | null | null | null | import os
from librosa.core import load, stft, istft, magphase
from librosa.output import write_wav
from concurrent.futures import ThreadPoolExecutor
from time import time
import asyncio
import os,glob
import numpy as np
from multiprocessing import cpu_count
#Thanks to https://github.com/jnzhng/keras-unet-vocal-separat... | 35.851351 | 107 | 0.656238 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 722 | 0.272145 |
c1693dff2b16a43c1fe7913423163831050a96a1 | 3,195 | py | Python | utils/utils.py | bo-miao/anomaly_classification | 08829b3cdc488c6c7867f02950b5e22b6a5d5435 | [
"Apache-2.0"
] | null | null | null | utils/utils.py | bo-miao/anomaly_classification | 08829b3cdc488c6c7867f02950b5e22b6a5d5435 | [
"Apache-2.0"
] | null | null | null | utils/utils.py | bo-miao/anomaly_classification | 08829b3cdc488c6c7867f02950b5e22b6a5d5435 | [
"Apache-2.0"
] | null | null | null | from utils import lr_scheduler, metric, prefetch, summary
import os, sys
import time
import numpy as np
from collections import OrderedDict
import glob
import math
import copy
import tqdm
from sklearn.metrics import roc_auc_score, roc_curve, auc
import matplotlib.pyplot as plt
from torch.cuda.amp import autocast
impor... | 30.428571 | 103 | 0.638498 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 205 | 0.064163 |
c169f12d80ecf64a50d7329d9a77f916c0b26871 | 1,960 | py | Python | src/kpi_WV_hs/.ipynb_checkpoints/compute_kpi_1d_v2_prun-checkpoint.py | tlechauveCLS/kpi_mpc | 4dc61d210c2b97e6ac240e54a8d96c35cf9123de | [
"MIT"
] | null | null | null | src/kpi_WV_hs/.ipynb_checkpoints/compute_kpi_1d_v2_prun-checkpoint.py | tlechauveCLS/kpi_mpc | 4dc61d210c2b97e6ac240e54a8d96c35cf9123de | [
"MIT"
] | null | null | null | src/kpi_WV_hs/.ipynb_checkpoints/compute_kpi_1d_v2_prun-checkpoint.py | tlechauveCLS/kpi_mpc | 4dc61d210c2b97e6ac240e54a8d96c35cf9123de | [
"MIT"
] | 1 | 2022-03-23T07:48:27.000Z | 2022-03-23T07:48:27.000Z | #!/home1/datawork/agrouaze/conda_envs2/envs/py2.7_cwave/bin/python
# coding: utf-8
"""
"""
import sys
print(sys.executable)
import subprocess
import logging
from dateutil import rrule
import datetime
if __name__ == '__main__':
root = logging.getLogger ()
if root.handlers:
for handler in root.handlers:
... | 40 | 102 | 0.626531 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 702 | 0.358163 |
c16a520b3532e245375dff9d61f50950a6a91c7f | 20,482 | py | Python | pysrc/simulserver.py | juliusbierk/simultant | 9d454b58797399f60812c4d8c482a57e82b5dba7 | [
"MIT"
] | null | null | null | pysrc/simulserver.py | juliusbierk/simultant | 9d454b58797399f60812c4d8c482a57e82b5dba7 | [
"MIT"
] | null | null | null | pysrc/simulserver.py | juliusbierk/simultant | 9d454b58797399f60812c4d8c482a57e82b5dba7 | [
"MIT"
] | null | null | null | import asyncio
import concurrent
import functools
import json
import numpy as np
import torch
from aiohttp import web
from aiohttp.web_runner import GracefulExit
import aiohttp_cors
import logging
import csv
import multiprocessing
import queue
import pickle
# Local imports:
from torchfcts import function_from_code, get... | 33.412724 | 117 | 0.553803 | 277 | 0.013524 | 0 | 0 | 0 | 0 | 14,579 | 0.711796 | 3,743 | 0.182746 |
c16b54a8fb917e5a067468f0c78cd337a4b77c6b | 4,312 | py | Python | streak/api_get.py | srevinsaju/streak | ff21f39b06da3010568940d335c32bd7d357ca69 | [
"MIT"
] | 2 | 2022-03-07T20:18:46.000Z | 2022-03-08T12:48:04.000Z | streak/api_get.py | srevinsaju/streak | ff21f39b06da3010568940d335c32bd7d357ca69 | [
"MIT"
] | null | null | null | streak/api_get.py | srevinsaju/streak | ff21f39b06da3010568940d335c32bd7d357ca69 | [
"MIT"
] | null | null | null | from flask import jsonify, make_response, request
from . import app
from .api_post import engine, login
from .core import utility_funcs
from sqlalchemy.orm import sessionmaker
from sqlalchemy_cockroachdb import run_transaction
from .api_post import login_required
@app.route("/api/v1/tasks/list")
@login_required
def l... | 28 | 87 | 0.661874 | 0 | 0 | 0 | 0 | 3,710 | 0.86039 | 0 | 0 | 606 | 0.140538 |
c16b90c3a22166a86fb8294e272716e1caa3d0d8 | 4,066 | py | Python | BI/delta.py | aessex24/rindr | 2a546b27ce1c72728bb7a63e60653929ca592cfe | [
"MIT"
] | 1 | 2021-12-21T16:24:18.000Z | 2021-12-21T16:24:18.000Z | BI/delta.py | aessex24/rindr | 2a546b27ce1c72728bb7a63e60653929ca592cfe | [
"MIT"
] | 1 | 2021-12-10T01:05:55.000Z | 2021-12-10T01:05:55.000Z | BI/delta.py | aessex24/rindr | 2a546b27ce1c72728bb7a63e60653929ca592cfe | [
"MIT"
] | 1 | 2021-12-10T00:48:33.000Z | 2021-12-10T00:48:33.000Z | #!/usr/bin/python3
"""
Run "mypy --disallow-untyped-defs --ignore-missing-imports \
--show-error-codes --strict-equality delta.py".
The holidays module lacks type hints.
Next need: explicit Pytests.
Notice the imports are punctuated in an isort style.
"""
from datetime import datetime, timedelta
import sy... | 40.257426 | 118 | 0.624693 | 2,299 | 0.565421 | 0 | 0 | 0 | 0 | 0 | 0 | 1,744 | 0.428923 |
c16c66d300e2ec1188a948c8172e2c9116bd68b9 | 2,831 | py | Python | octopus/modules/account/dao.py | tuub/magnificent-octopus | 62722fbb9eecd0f6727b4d9cc0ef3b732b4702d9 | [
"Apache-2.0"
] | null | null | null | octopus/modules/account/dao.py | tuub/magnificent-octopus | 62722fbb9eecd0f6727b4d9cc0ef3b732b4702d9 | [
"Apache-2.0"
] | null | null | null | octopus/modules/account/dao.py | tuub/magnificent-octopus | 62722fbb9eecd0f6727b4d9cc0ef3b732b4702d9 | [
"Apache-2.0"
] | 2 | 2019-12-17T14:55:17.000Z | 2020-02-03T12:35:24.000Z | from octopus.modules.es import dao
from datetime import datetime
from octopus.modules.account.exceptions import NonUniqueAccountException
def query_filter(q):
"""Function used by the query endpoint to ensure only the relevant account data is returned"""
# q is an esprit.models.Query object
# this limits t... | 36.766234 | 139 | 0.620276 | 2,288 | 0.808195 | 0 | 0 | 1,397 | 0.493465 | 0 | 0 | 669 | 0.236312 |
c16e57e83faead3659a5fd36f3a7c633cdd84012 | 330 | py | Python | app/app/tests.py | aniket463/recipe-app-api | 64d390bea67f840f0d056f6fdb36eb30236be64b | [
"MIT"
] | null | null | null | app/app/tests.py | aniket463/recipe-app-api | 64d390bea67f840f0d056f6fdb36eb30236be64b | [
"MIT"
] | null | null | null | app/app/tests.py | aniket463/recipe-app-api | 64d390bea67f840f0d056f6fdb36eb30236be64b | [
"MIT"
] | null | null | null | from django.test import TestCase
from app.calc import substraction
from app.calc import add
class CalcTests(TestCase):
def test_add_number(self):
#Test that two number added togather
self.assertEqual(add(3,8), 11)
def test_substraction_number(self):
self.assertEqual(substraction(8,3),5... | 27.5 | 45 | 0.709091 | 228 | 0.690909 | 0 | 0 | 0 | 0 | 0 | 0 | 36 | 0.109091 |
c16fb7371862914b59939c00a0c9796c961142c4 | 856 | py | Python | buildbot/master/files/config/passwords.py | ecoal95/saltfs | 4d2596794a70919c2887688d6d116f2f5bb5cf1e | [
"Apache-2.0",
"MIT"
] | 1 | 2021-01-07T18:49:38.000Z | 2021-01-07T18:49:38.000Z | buildbot/master/files/config/passwords.py | ecoal95/saltfs | 4d2596794a70919c2887688d6d116f2f5bb5cf1e | [
"Apache-2.0",
"MIT"
] | null | null | null | buildbot/master/files/config/passwords.py | ecoal95/saltfs | 4d2596794a70919c2887688d6d116f2f5bb5cf1e | [
"Apache-2.0",
"MIT"
] | null | null | null | import json
# Jinja will replace the inside with double-quote-using JSON,
# so use single quotes to delimit the string.
# Use double quotes inside to keep the expression as a single string.
credentials = json.loads('{{ pillar["buildbot"]["credentials"]|json }}')
# json.loads creates unicode strings but Buildbot requir... | 45.052632 | 72 | 0.775701 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 471 | 0.550234 |
c170014093c78e48166681a428ba4bef1d6ab86d | 11,819 | py | Python | analytics/core/tests/unittest_core_processor.py | sadikovi/Pulsar | 3267426cf5bd676a3c4c20cbee88a80b89e65b0f | [
"Apache-2.0"
] | null | null | null | analytics/core/tests/unittest_core_processor.py | sadikovi/Pulsar | 3267426cf5bd676a3c4c20cbee88a80b89e65b0f | [
"Apache-2.0"
] | 29 | 2015-02-23T07:59:13.000Z | 2015-04-05T09:49:53.000Z | analytics/core/tests/unittest_core_processor.py | sadikovi/Pulsar | 3267426cf5bd676a3c4c20cbee88a80b89e65b0f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# import libs
import unittest
import random
import sys
import warnings
# import classes
import analytics.utils.misc as misc
import analytics.exceptions.exceptions as ex
import analytics.core.processor.processor as processor
from types import ListType, DictType
from analytics.core.map.dataitemmap ... | 40.064407 | 77 | 0.607496 | 10,320 | 0.87317 | 0 | 0 | 0 | 0 | 0 | 0 | 1,111 | 0.094001 |
c171e9fdddb0b26706be73c55350884337b985be | 19,654 | py | Python | test/test_get_metadata_functions.py | bjoernmeier/sqlalchemy_exasol | d63e70096f227db5eb68e631e98777e0e68ac178 | [
"BSD-2-Clause"
] | 26 | 2015-10-13T21:43:07.000Z | 2021-09-22T16:58:02.000Z | test/test_get_metadata_functions.py | bjoernmeier/sqlalchemy_exasol | d63e70096f227db5eb68e631e98777e0e68ac178 | [
"BSD-2-Clause"
] | 65 | 2015-01-22T10:05:18.000Z | 2022-01-18T12:11:53.000Z | test/test_get_metadata_functions.py | bjoernmeier/sqlalchemy_exasol | d63e70096f227db5eb68e631e98777e0e68ac178 | [
"BSD-2-Clause"
] | 23 | 2015-01-21T09:27:05.000Z | 2022-01-18T11:40:18.000Z | # -*- coding: UTF-8 -*-
import pytest
from sqlalchemy import create_engine
from sqlalchemy.engine.url import URL
from sqlalchemy.sql.sqltypes import INTEGER, VARCHAR
from sqlalchemy.testing import fixtures, config
from sqlalchemy_exasol.base import EXADialect
TEST_GET_METADATA_FUNCTIONS_SCHEMA = "test_get_metadata_f... | 59.738602 | 177 | 0.666735 | 19,164 | 0.975069 | 0 | 0 | 18,728 | 0.952885 | 0 | 0 | 2,200 | 0.111937 |
c1724e3fcc8f514b866413548912dc98400bc49f | 2,790 | py | Python | entrepreneurial_property/migrations/0015_auto_20180905_0646.py | CzechInvest/ciis | c6102598f564a717472e5e31e7eb894bba2c8104 | [
"MIT"
] | 1 | 2019-05-26T22:24:01.000Z | 2019-05-26T22:24:01.000Z | entrepreneurial_property/migrations/0015_auto_20180905_0646.py | CzechInvest/ciis | c6102598f564a717472e5e31e7eb894bba2c8104 | [
"MIT"
] | 6 | 2019-01-22T14:53:43.000Z | 2020-09-22T16:20:28.000Z | entrepreneurial_property/migrations/0015_auto_20180905_0646.py | CzechInvest/ciis | c6102598f564a717472e5e31e7eb894bba2c8104 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.5 on 2018-09-05 06:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('entrepreneurial_property', '0014_auto_20180905_0629'),
]
operations = [
migrations.AlterModelOptions(
name='brownfieldwastewater... | 37.702703 | 98 | 0.603584 | 2,709 | 0.966809 | 0 | 0 | 0 | 0 | 0 | 0 | 976 | 0.348323 |
c173709b35ae18fdb3b908927a799df5ea385960 | 1,353 | py | Python | backend/app/__init__.py | mushcatshiro/flask-template | 27a1558e831ef2c14622c320a5e6fd6991b94bcf | [
"MIT"
] | null | null | null | backend/app/__init__.py | mushcatshiro/flask-template | 27a1558e831ef2c14622c320a5e6fd6991b94bcf | [
"MIT"
] | null | null | null | backend/app/__init__.py | mushcatshiro/flask-template | 27a1558e831ef2c14622c320a5e6fd6991b94bcf | [
"MIT"
] | null | null | null | from flask import Flask, jsonify
from flask_marshmallow import Marshmallow
from flask_sqlalchemy import SQLAlchemy
from flask_track_usage import TrackUsage
from backend.config import config, Config
from celery import Celery
db = SQLAlchemy()
ma = Marshmallow()
celery = Celery(
__name__,
broker=Config.CELERY_B... | 24.160714 | 63 | 0.702882 | 0 | 0 | 0 | 0 | 361 | 0.266814 | 0 | 0 | 143 | 0.105691 |
c1743e483c31f6d867722bc46b72b5ece150db84 | 1,561 | py | Python | pineboolib/fllegacy/tests/test_settings.py | juanjosepablos/pineboo | f6ce515aec6e0139821bb9c1d62536d9fb50dae4 | [
"MIT"
] | null | null | null | pineboolib/fllegacy/tests/test_settings.py | juanjosepablos/pineboo | f6ce515aec6e0139821bb9c1d62536d9fb50dae4 | [
"MIT"
] | 1 | 2017-10-30T22:00:48.000Z | 2017-11-11T19:34:32.000Z | pineboolib/fllegacy/tests/test_settings.py | juanjosepablos/pineboo | f6ce515aec6e0139821bb9c1d62536d9fb50dae4 | [
"MIT"
] | 1 | 2017-10-30T20:16:38.000Z | 2017-10-30T20:16:38.000Z | """Test_flutil module."""
import unittest
from pineboolib.fllegacy import flsettings
class TestSettings(unittest.TestCase):
def test_settings(self) -> None:
"""Test read functions."""
setting = flsettings.FLSettings()
setting.writeEntryList("test_uno", [""])
setting.writeEntryLi... | 43.361111 | 85 | 0.675208 | 1,471 | 0.942345 | 0 | 0 | 0 | 0 | 0 | 0 | 404 | 0.258808 |
c174bae4ae48802d0df61029ad46df721459ecfb | 1,109 | py | Python | setup.py | nat236919/pyhighstakes | dbe7dcf81febd361b6b0084788d9f176e1008ee7 | [
"MIT"
] | null | null | null | setup.py | nat236919/pyhighstakes | dbe7dcf81febd361b6b0084788d9f176e1008ee7 | [
"MIT"
] | 2 | 2020-01-29T02:03:55.000Z | 2020-01-29T02:05:17.000Z | setup.py | nat236919/pyhighstakes | dbe7dcf81febd361b6b0084788d9f176e1008ee7 | [
"MIT"
] | 1 | 2020-01-28T14:14:45.000Z | 2020-01-28T14:14:45.000Z | """
FILE: setup.py
DESCRIPTION: Set up PyPI as a Python Library
DATE: 27-Jan-2020
"""
import setuptools
with open('README.md') as f:
README = f.read()
setuptools.setup(
author='Nuttaphat Arunoprayoch',
author_email='nat236919@gmail.com',
name='pyhighstakes',
license='MIT',
description='PyHigh... | 30.805556 | 74 | 0.660956 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 664 | 0.598738 |
c1764afdac11e0d9a60b3e199a98aa40f4ecf8a4 | 894 | py | Python | ecommerce/accounts/migrations/0028_auto_20220127_2039.py | mhdirajabi/django-drf-e-commerce | 526044a728f9f073a21386ff7f67ac570f4755c6 | [
"MIT"
] | null | null | null | ecommerce/accounts/migrations/0028_auto_20220127_2039.py | mhdirajabi/django-drf-e-commerce | 526044a728f9f073a21386ff7f67ac570f4755c6 | [
"MIT"
] | null | null | null | ecommerce/accounts/migrations/0028_auto_20220127_2039.py | mhdirajabi/django-drf-e-commerce | 526044a728f9f073a21386ff7f67ac570f4755c6 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.10 on 2022-01-27 17:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0027_alter_totprequest_receiver'),
]
operations = [
migrations.AlterModelOptions(
name='totprequest',
o... | 31.928571 | 135 | 0.621924 | 860 | 0.901468 | 0 | 0 | 0 | 0 | 0 | 0 | 366 | 0.383648 |
c1771dbe757ef772ec9d522997c65b45e5bb1019 | 14,552 | py | Python | kernel/rnn.py | diwu1990/UnaryComputingSim | 1a4746b7bcc2fcde5144a8b42fc94e6f5cd82b8e | [
"MIT"
] | 1 | 2020-06-24T09:54:06.000Z | 2020-06-24T09:54:06.000Z | kernel/rnn.py | RuokaiYin/UnarySim | 343ff9abf356a63d526b1df8eb946ad528690a27 | [
"MIT"
] | null | null | null | kernel/rnn.py | RuokaiYin/UnarySim | 343ff9abf356a63d526b1df8eb946ad528690a27 | [
"MIT"
] | null | null | null | import math
import torch
import copy
from torch import Tensor
import torch.nn as nn
import torch.nn.functional as F
from UnarySim.kernel import FSUAdd
from UnarySim.kernel import FSUMul
from UnarySim.kernel import FSULinear
from torch.cuda.amp import autocast
from typing import List, Tuple, Optional, overload, Union
fr... | 42.17971 | 169 | 0.604178 | 14,028 | 0.963991 | 0 | 0 | 2,274 | 0.156267 | 0 | 0 | 2,952 | 0.202859 |
c1786868690cfefd20cc751e90ea8b47ab54a55a | 323 | py | Python | app/__init__.py | uwase-diane/NewsAPI | 49acb4e22f623818b5ee63f7b545f698953e2387 | [
"Unlicense"
] | null | null | null | app/__init__.py | uwase-diane/NewsAPI | 49acb4e22f623818b5ee63f7b545f698953e2387 | [
"Unlicense"
] | null | null | null | app/__init__.py | uwase-diane/NewsAPI | 49acb4e22f623818b5ee63f7b545f698953e2387 | [
"Unlicense"
] | null | null | null | from flask import Flask
from .config import DevConfig
from flask_bootstrap import Bootstrap
app = Flask(__name__,instance_relative_config= True)
app.config.from_object(DevConfig)
app.config.from_pyfile('config.py')
# Initializing Flask Extensions
bootstrap = Bootstrap(app)
from app import views
from app import er... | 20.1875 | 52 | 0.817337 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 42 | 0.130031 |
c17afdf4c22417a1397dcd7e27fcec9b2af92696 | 3,505 | py | Python | bentosign/bentosign_object.py | BentoSign/python_bentosign | f1f00b1c84af353c3945e1ed09c8460ee836d1be | [
"MIT"
] | null | null | null | bentosign/bentosign_object.py | BentoSign/python_bentosign | f1f00b1c84af353c3945e1ed09c8460ee836d1be | [
"MIT"
] | null | null | null | bentosign/bentosign_object.py | BentoSign/python_bentosign | f1f00b1c84af353c3945e1ed09c8460ee836d1be | [
"MIT"
] | null | null | null | import json
import requests
from .bentosign_errors import BentoSignError
# An BentoSignObject is a dictionary where ``object.key=value`` is a shortcut for ``object[key]=value``
class BentoSignObject(dict):
def __init__(self):
super(BentoSignObject, self).__init__()
# Define __getattr__, __setattr__... | 31.294643 | 103 | 0.607133 | 3,325 | 0.948645 | 0 | 0 | 2,174 | 0.620257 | 0 | 0 | 701 | 0.2 |
c17b28f08989d2fa2b75ad5040f70d15e7571b14 | 2,842 | py | Python | OpenThermML/backup.py | wwlorey/open-thermostat-software | a0521b0d3b65fe9f2bd23f5059971d3a8d773e54 | [
"MIT"
] | 1 | 2020-12-14T02:44:10.000Z | 2020-12-14T02:44:10.000Z | OpenThermML/backup.py | wwlorey/open-thermostat-software | a0521b0d3b65fe9f2bd23f5059971d3a8d773e54 | [
"MIT"
] | null | null | null | OpenThermML/backup.py | wwlorey/open-thermostat-software | a0521b0d3b65fe9f2bd23f5059971d3a8d773e54 | [
"MIT"
] | 1 | 2020-12-12T20:24:43.000Z | 2020-12-12T20:24:43.000Z | predictions = [
[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, ],
[0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0... | 149.578947 | 247 | 0.364532 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c17bdf43121bff61f06c96f3d74874b39434a71f | 267 | py | Python | app1/callbacks.py | DrGFreeman/multi-dash | 377788c4404a9f7b59ba0dbfb697b4db074fdbd4 | [
"Unlicense"
] | null | null | null | app1/callbacks.py | DrGFreeman/multi-dash | 377788c4404a9f7b59ba0dbfb697b4db074fdbd4 | [
"Unlicense"
] | null | null | null | app1/callbacks.py | DrGFreeman/multi-dash | 377788c4404a9f7b59ba0dbfb697b4db074fdbd4 | [
"Unlicense"
] | null | null | null | from datetime import datetime
from dash.dependencies import Input, Output
from app1 import app
@app.callback(Output('placeholder', 'children'),
[Input('update_button', 'n_clicks')])
def update(n_clicks):
return datetime.now().strftime('%H:%M:%S') | 26.7 | 51 | 0.700375 | 0 | 0 | 0 | 0 | 169 | 0.632959 | 0 | 0 | 58 | 0.217228 |
c17c5ab864e3da04534b047a476281e0e31c2fdb | 108 | py | Python | main.py | Aayushpatil77/Gryphon_Web_Crawler | ee52fe2b353cc040e662056d7888ea420c1a49fa | [
"MIT"
] | null | null | null | main.py | Aayushpatil77/Gryphon_Web_Crawler | ee52fe2b353cc040e662056d7888ea420c1a49fa | [
"MIT"
] | 24 | 2021-11-12T20:33:04.000Z | 2021-11-24T14:34:31.000Z | main.py | Aayushpatil77/Gryphon_Web_Crawler | ee52fe2b353cc040e662056d7888ea420c1a49fa | [
"MIT"
] | 5 | 2021-11-10T18:04:23.000Z | 2022-02-22T04:38:16.000Z | from django.http import HttpResponse
def test():
return HttpResponse("Hello, world. #Homepage")
test() | 18 | 50 | 0.731481 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 25 | 0.231481 |
c17d194b756e7fa590502bf845583e715519cb01 | 460 | py | Python | app/career/serializers/weekly_business.py | TIHLDE/Lepton | 60ec0793381f1c1b222f305586e8c2d4345fb566 | [
"MIT"
] | 7 | 2021-03-04T18:49:12.000Z | 2021-03-08T18:25:51.000Z | app/career/serializers/weekly_business.py | TIHLDE/Lepton | 60ec0793381f1c1b222f305586e8c2d4345fb566 | [
"MIT"
] | 251 | 2021-03-04T19:19:14.000Z | 2022-03-31T14:47:53.000Z | app/career/serializers/weekly_business.py | tihlde/Lepton | 5cab3522c421b76373a5c25f49267cfaef7b826a | [
"MIT"
] | 3 | 2021-10-05T19:03:04.000Z | 2022-02-25T13:32:09.000Z | from app.career.models import WeeklyBusiness
from app.common.serializers import BaseModelSerializer
class WeeklyBusinessSerializer(BaseModelSerializer):
class Meta:
model = WeeklyBusiness
fields = (
"id",
"created_at",
"updated_at",
"image",
... | 23 | 54 | 0.523913 | 357 | 0.776087 | 0 | 0 | 0 | 0 | 0 | 0 | 79 | 0.171739 |
c17d66b90ac3507c48eac335d807b7e734538bbd | 3,401 | py | Python | emovix-twitter-detectlang.py | eMOVIX/emovix-twitter-detectlang | d4ad5a9845b9b98fec70490c81481390a24a9af1 | [
"Apache-2.0"
] | null | null | null | emovix-twitter-detectlang.py | eMOVIX/emovix-twitter-detectlang | d4ad5a9845b9b98fec70490c81481390a24a9af1 | [
"Apache-2.0"
] | null | null | null | emovix-twitter-detectlang.py | eMOVIX/emovix-twitter-detectlang | d4ad5a9845b9b98fec70490c81481390a24a9af1 | [
"Apache-2.0"
] | null | null | null | __author__ = 'Jordi Vilaplana'
from pymongo import MongoClient
import detectlanguage
import json
import logging
import time
logging.basicConfig(
filename='emovix_twitter_detectlang.log',
level=logging.WARNING,
format='%(asctime)s %(name)-12s %(levelname)-8s %(message)s',
datefmt='%d-%m-%y %H:%M')
# C... | 36.569892 | 128 | 0.527786 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 709 | 0.208468 |
c17d75beb39c3d0157047d3515d20edb8d4e90a4 | 1,178 | py | Python | src/azure-cli/azure/cli/command_modules/storage/operations/queue.py | YuanyuanNi/azure-cli | 63844964374858bfacd209bfe1b69eb456bd64ca | [
"MIT"
] | 3,287 | 2016-07-26T17:34:33.000Z | 2022-03-31T09:52:13.000Z | src/azure-cli/azure/cli/command_modules/storage/operations/queue.py | YuanyuanNi/azure-cli | 63844964374858bfacd209bfe1b69eb456bd64ca | [
"MIT"
] | 19,206 | 2016-07-26T07:04:42.000Z | 2022-03-31T23:57:09.000Z | src/azure-cli/azure/cli/command_modules/storage/operations/queue.py | YuanyuanNi/azure-cli | 63844964374858bfacd209bfe1b69eb456bd64ca | [
"MIT"
] | 2,575 | 2016-07-26T06:44:40.000Z | 2022-03-31T22:56:06.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 42.071429 | 94 | 0.60017 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 367 | 0.311545 |
c17dc41b3022979fe55065b808584b80b7482833 | 8,793 | py | Python | tests/getl/blocks/load/test_load_entrypoint.py | husqvarnagroup/GETL | 37251abf12bac2efed1fe463b09a288d85969141 | [
"MIT"
] | 8 | 2020-06-10T09:00:17.000Z | 2021-06-07T18:02:19.000Z | tests/getl/blocks/load/test_load_entrypoint.py | husqvarnagroup/GETL | 37251abf12bac2efed1fe463b09a288d85969141 | [
"MIT"
] | 5 | 2020-07-03T10:39:25.000Z | 2021-08-30T14:52:47.000Z | tests/getl/blocks/load/test_load_entrypoint.py | husqvarnagroup/GETL | 37251abf12bac2efed1fe463b09a288d85969141 | [
"MIT"
] | 1 | 2020-05-28T07:53:48.000Z | 2020-05-28T07:53:48.000Z | """Unit test for GETL load method."""
from os import environ
from unittest.mock import Mock
from pyspark.sql import types as T
from getl.blocks.load.entrypoint import (
batch_csv,
batch_delta,
batch_json,
batch_xml,
resolve,
)
# TODO: Need to adapt to different xml version depending on spark vers... | 28.548701 | 85 | 0.60787 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,400 | 0.272944 |
c17f0a03fa3b18a4b271f3edc88481c6be2c623b | 745 | py | Python | arrays/sorting/selection_sort.py | AyoubEssrifi/Data-Structures-Algorithms | d903bccba46cd8f2a35728f47cdfc836d5dfdf1a | [
"MIT"
] | null | null | null | arrays/sorting/selection_sort.py | AyoubEssrifi/Data-Structures-Algorithms | d903bccba46cd8f2a35728f47cdfc836d5dfdf1a | [
"MIT"
] | null | null | null | arrays/sorting/selection_sort.py | AyoubEssrifi/Data-Structures-Algorithms | d903bccba46cd8f2a35728f47cdfc836d5dfdf1a | [
"MIT"
] | null | null | null | import numpy as np
import math
def selection_sort(arr):
"""
Performs a selection sort algorithm
- Time complexity: O(n²)
Args:
arr (list): List to sort
Returns:
(list): Sorted list
"""
i = 0
while i < len(arr):
j = i
min = math.inf
while j < len... | 20.135135 | 44 | 0.507383 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 183 | 0.245308 |
c17f1a7c03757d8295e2618ab5615740ad1e5ea5 | 6,819 | py | Python | dumb_cup/dc.py | Ladvien/ezsp32_upython_env | 5bdec9e1d2eabb117941a5ce0e74570757e87740 | [
"MIT"
] | null | null | null | dumb_cup/dc.py | Ladvien/ezsp32_upython_env | 5bdec9e1d2eabb117941a5ce0e74570757e87740 | [
"MIT"
] | null | null | null | dumb_cup/dc.py | Ladvien/ezsp32_upython_env | 5bdec9e1d2eabb117941a5ce0e74570757e87740 | [
"MIT"
] | 1 | 2020-05-27T13:18:31.000Z | 2020-05-27T13:18:31.000Z | import time
from machine import I2C, Pin, Timer
from dumb_cup.v53l0x import VL53L0X
from dumb_cup.adxl345 import ADXL345
from dumb_cup.spirit_level import SpiritLevel
###############
# Constants
###############
OZ_FULL = const(16)
INIT_SAMPES = const(50)
NUM_SAMPLES = const(15)
RND_PLCS ... | 25.349442 | 90 | 0.592022 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,794 | 0.262934 |
c17f98ab5a946504638ab093524b788e3de36f90 | 2,042 | py | Python | nsh/asteroids/views.py | kowabunga314/NSH | 01dfc56d88e9b3b96e5bed61be24dd1e5080abbc | [
"MIT"
] | null | null | null | nsh/asteroids/views.py | kowabunga314/NSH | 01dfc56d88e9b3b96e5bed61be24dd1e5080abbc | [
"MIT"
] | 1 | 2021-08-31T23:10:01.000Z | 2021-08-31T23:10:01.000Z | nsh/asteroids/views.py | kowabunga314/NSH | 01dfc56d88e9b3b96e5bed61be24dd1e5080abbc | [
"MIT"
] | null | null | null | from requests import api
from rest_framework.decorators import api_view
from rest_framework.response import Response
from asteroids.api import AsteroidApi
from asteroids.serializers import ApproachSerializer
from clients.neows import NeoWs
from django.shortcuts import render
@api_view(['GET'])
def get_closest_approac... | 31.415385 | 92 | 0.760039 | 0 | 0 | 0 | 0 | 1,754 | 0.858962 | 0 | 0 | 362 | 0.177277 |
c1814a99cc81b34203c9bfed3dc84d50f6f96bd3 | 1,313 | py | Python | shell_test.py | zignig/cqparts_bucket | 9707b0948a9dd1ed514e03c291a3b96fddc4a22d | [
"Apache-2.0"
] | 10 | 2018-09-18T08:09:02.000Z | 2022-03-18T06:24:22.000Z | shell_test.py | zignig/cqparts-bucket | 9707b0948a9dd1ed514e03c291a3b96fddc4a22d | [
"Apache-2.0"
] | 1 | 2018-08-09T01:57:32.000Z | 2018-08-09T01:57:32.000Z | shell_test.py | zignig/cqparts-bucket | 9707b0948a9dd1ed514e03c291a3b96fddc4a22d | [
"Apache-2.0"
] | 1 | 2018-12-07T20:14:04.000Z | 2018-12-07T20:14:04.000Z | """
Shell test
# 2019 Simon Kirkby obeygiantrobot@gmail.com
"""
import cadquery as cq
import cqparts
from cqparts.params import PositiveFloat, Int
from cqparts.display import render_props
from cqparts.constraint import Mate
from cqparts.utils.geometry import CoordSystem
from cqparts.search import register
# base s... | 29.840909 | 81 | 0.611577 | 856 | 0.651942 | 0 | 0 | 881 | 0.670982 | 0 | 0 | 143 | 0.108911 |
c181b677ca0d130f4ba82570047a76315f9bae27 | 1,266 | py | Python | test/should-work/client.py | dragazo/PyBlox | 52e895090708810f4af18da746b90278e4ee82f7 | [
"Apache-2.0"
] | 2 | 2021-08-16T14:25:11.000Z | 2021-12-11T19:38:15.000Z | test/should-work/client.py | dragazo/PyBlox | 52e895090708810f4af18da746b90278e4ee82f7 | [
"Apache-2.0"
] | null | null | null | test/should-work/client.py | dragazo/PyBlox | 52e895090708810f4af18da746b90278e4ee82f7 | [
"Apache-2.0"
] | 1 | 2021-09-24T15:32:49.000Z | 2021-09-24T15:32:49.000Z | #!/usr/bin/env python
import netsblox
editor = netsblox.Editor()
phoneiot = editor.phone_iot
public_roles = editor.public_roles
assert type(phoneiot.get_sensors()) == list
assert public_roles.get_public_role_id() == editor.get_public_role_id()
assert phoneiot.get_color(12, 34, 54, 34) == 571220534
assert phoneiot.g... | 38.363636 | 95 | 0.636651 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 116 | 0.091627 |
c183f4d6f31778737b79a4e9462050d2a9596ead | 872 | py | Python | carla_env/__init__.py | janwithb/Carla-Gym-Wrapper | f1ea9fe89427c5a654f5561f214a5fba139b2568 | [
"Apache-2.0"
] | 6 | 2021-04-15T09:22:44.000Z | 2022-02-15T01:07:23.000Z | carla_env/__init__.py | janwithb/Carla-Gym-Wrapper | f1ea9fe89427c5a654f5561f214a5fba139b2568 | [
"Apache-2.0"
] | 2 | 2021-08-23T02:47:40.000Z | 2022-01-17T02:20:47.000Z | carla_env/__init__.py | janwithb/Carla-Gym-Wrapper | f1ea9fe89427c5a654f5561f214a5fba139b2568 | [
"Apache-2.0"
] | 2 | 2021-07-12T06:32:37.000Z | 2021-11-24T14:43:13.000Z | from gym.envs.registration import register
register(
id='CarlaEnv-state-v1',
entry_point='carla_env.carla_env:CarlaEnv',
max_episode_steps=500,
kwargs={
'render': True,
'carla_port': 2000,
'changing_weather_speed': 0.1,
'frame_skip': 1,
'observations_type': 'stat... | 23.567568 | 47 | 0.579128 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 402 | 0.461009 |
c185bdc700271a99b44e838020cbe70d16ab1c2c | 5,039 | py | Python | utilities/fragtop.py | ondrejholecek/fortimonitor | 79b0377f97b084f04396a323a84bb3e8a93d6f2d | [
"BSD-3-Clause"
] | 9 | 2018-10-19T08:47:42.000Z | 2020-08-19T01:58:27.000Z | utilities/fragtop.py | ondrejholecek/fortimonitor | 79b0377f97b084f04396a323a84bb3e8a93d6f2d | [
"BSD-3-Clause"
] | 1 | 2019-11-07T11:24:43.000Z | 2019-11-07T11:52:51.000Z | utilities/fragtop.py | ondrejholecek/fortimonitor | 79b0377f97b084f04396a323a84bb3e8a93d6f2d | [
"BSD-3-Clause"
] | 3 | 2020-04-24T03:51:15.000Z | 2021-12-19T16:08:24.000Z | #!/usr/bin/env python2.7
import os
# to be able to import our modules from the directory above
os.sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from parsers.CurrentTime import ParserCurrentTime
from parsers.Fragmentation import ParserFragmentation
from parsers.ProcessCPU import ParserP... | 39.992063 | 150 | 0.653106 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 2,080 | 0.41278 |
c1870c6bef4d20bdc8064b24eaabb94b95f23f4a | 161 | py | Python | app/admin.py | kirezibana/awards | 7f674430e84e84e5fd39106f3af7c42ee2f6b8ac | [
"Unlicense"
] | null | null | null | app/admin.py | kirezibana/awards | 7f674430e84e84e5fd39106f3af7c42ee2f6b8ac | [
"Unlicense"
] | null | null | null | app/admin.py | kirezibana/awards | 7f674430e84e84e5fd39106f3af7c42ee2f6b8ac | [
"Unlicense"
] | null | null | null | from django.contrib import admin
from .models import Project, Profile, Rate
admin.site.register(Project)
admin.site.register(Profile)
admin.site.register(Rate)
| 23 | 42 | 0.813665 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c187d975a2a0abd411797bab631c97d079d986a0 | 3,250 | py | Python | SCOTUS/SVE/infer_sco50case.py | JeffT13/LegalUISRNN | a5efdba091746a0e04da9faccdad74b3b4cec74f | [
"Apache-2.0"
] | 1 | 2020-11-17T02:33:28.000Z | 2020-11-17T02:33:28.000Z | SCOTUS/SVE/infer_sco50case.py | JeffT13/LegalUISRNN | a5efdba091746a0e04da9faccdad74b3b4cec74f | [
"Apache-2.0"
] | null | null | null | SCOTUS/SVE/infer_sco50case.py | JeffT13/LegalUISRNN | a5efdba091746a0e04da9faccdad74b3b4cec74f | [
"Apache-2.0"
] | null | null | null | ''' SCOTUS d-vec UISRNN inference'''
import sys
sys.path.append("./LegalUISRNN")
import numpy as np
import os, csv
import torch
import uisrnn
case_path = '/scratch/jt2565/sco50/sco50wav_proc_case/'
total_cases = (len(os.listdir(case_path))/2)
train_cases = (total_cases//10)*9
print("# of training:", train_cases)
prin... | 28.761062 | 74 | 0.626462 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 820 | 0.252308 |
c1883470a70c6ef2fb0240606651d61fa3e8412b | 4,143 | py | Python | evaluation/evaluation_template.py | MaviccPRP/Anonymizer | 3d75ed3e97e260b6ded7e188eb3d58d749844e36 | [
"MIT"
] | null | null | null | evaluation/evaluation_template.py | MaviccPRP/Anonymizer | 3d75ed3e97e260b6ded7e188eb3d58d749844e36 | [
"MIT"
] | 2 | 2019-06-14T19:55:39.000Z | 2019-06-14T20:16:11.000Z | evaluation/evaluation_template.py | MaviccPRP/Anonymizer | 3d75ed3e97e260b6ded7e188eb3d58d749844e36 | [
"MIT"
] | 1 | 2020-03-13T14:32:31.000Z | 2020-03-13T14:32:31.000Z | # Evaluation script template for de-identification tool https://github.com/dieterich-lab/Anonymize
from sklearn.metrics import classification_report
from sklearn.metrics import confusion_matrix
from sklearn.metrics import roc_curve, auc
from sklearn.metrics import matthews_corrcoef
from sklearn.metrics import fb... | 30.688889 | 99 | 0.668839 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,046 | 0.252474 |
c1893382322e8407dce4b1d084d353bc65babc08 | 880 | py | Python | tests/utils.py | CrisKP/gyst | c3a86564bcf278d2b6a177b20840d50f71dd63b1 | [
"MIT"
] | 12 | 2017-09-10T01:43:42.000Z | 2020-09-20T01:17:20.000Z | functional_tests/utils.py | HelloMelanieC/FiveUp | ab97d311f163b09146fe330e4360d8e75d769f95 | [
"MIT"
] | 22 | 2016-12-26T21:46:10.000Z | 2022-02-10T08:01:52.000Z | tests/utils.py | CrisKP/gyst | c3a86564bcf278d2b6a177b20840d50f71dd63b1 | [
"MIT"
] | 4 | 2017-08-24T16:01:37.000Z | 2019-02-14T23:50:17.000Z | from contextlib import contextmanager
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
from selenium.webdriver.firefox.webdriver import WebDriver
from selenium.webdriver.support.expected_conditions import staleness_of
from selenium.webdriver.support.ui import WebDriverWait
class SeleniumTestC... | 32.592593 | 74 | 0.761364 | 578 | 0.656818 | 195 | 0.221591 | 512 | 0.581818 | 0 | 0 | 6 | 0.006818 |
c18b1f9e7702a88aea07ec02c274a084bf5ac802 | 411 | py | Python | dictsort.py | robertbyers1111/python | e87558f2432f0a4a86f17c47c6b19e1345625b83 | [
"MIT"
] | null | null | null | dictsort.py | robertbyers1111/python | e87558f2432f0a4a86f17c47c6b19e1345625b83 | [
"MIT"
] | null | null | null | dictsort.py | robertbyers1111/python | e87558f2432f0a4a86f17c47c6b19e1345625b83 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# Iterate through a list of dictionaries, sorted by a field from the dictionaries
response = [
{'a':1, 'b':2222, 'LastModified':1320, 'c':33},
{'a':11, 'LastModified':1229, 'b':222, 'c':3},
{'LastModified':1400,'a':111, 'b':2, 'c':3333},
{'a':1111, 'b':22, 'LastModified':180, 'c':333}
]
respon... | 25.6875 | 81 | 0.627737 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 208 | 0.506083 |
c18c4a2ad72355e5338af8e668969552070e526d | 617 | py | Python | setup.py | urbangrammarai/graphics | 69bf5976a11c783fc8a27f59ef57efefbbee6aa8 | [
"BSD-3-Clause"
] | 1 | 2021-05-30T07:41:23.000Z | 2021-05-30T07:41:23.000Z | setup.py | urbangrammarai/graphics | 69bf5976a11c783fc8a27f59ef57efefbbee6aa8 | [
"BSD-3-Clause"
] | 2 | 2021-02-19T09:00:03.000Z | 2021-10-16T18:59:05.000Z | setup.py | urbangrammarai/graphics | 69bf5976a11c783fc8a27f59ef57efefbbee6aa8 | [
"BSD-3-Clause"
] | null | null | null | import setuptools
with open("README.md", "r", encoding="utf8") as fh:
long_description = fh.read()
setuptools.setup(
name="urbangrammar_graphics",
version="1.2.3",
author="Martin Fleischmann",
author_email="martin@martinfleischmann.net",
python_requires=">=3.6",
install_requires=["matplotl... | 32.473684 | 70 | 0.719611 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 258 | 0.418152 |
c18d7f1c745b04cc0b216ca0de4f5614635c60a7 | 701 | py | Python | Supervised Learning/Tilecoder.py | panchyo0/Reinforcement-Learning | b823d7900f020db154d0a61f3683e0cce29e3797 | [
"MIT"
] | null | null | null | Supervised Learning/Tilecoder.py | panchyo0/Reinforcement-Learning | b823d7900f020db154d0a61f3683e0cce29e3797 | [
"MIT"
] | null | null | null | Supervised Learning/Tilecoder.py | panchyo0/Reinforcement-Learning | b823d7900f020db154d0a61f3683e0cce29e3797 | [
"MIT"
] | null | null | null | numTilings = 8
def tilecode(in1, in2, tileIndices):
# write your tilecoder here (5 lines or so)
for i in range(0,numTilings):
col = (in1 + i*(0.6/numTilings)) // 0.6
row = (in2 + i*(0.6/numTilings)) // 0.6
tile = (i*121) + (11*col) + row
tileIndices[i] = in... | 26.961538 | 77 | 0.584879 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 217 | 0.309558 |
c18ed66e182091851798f0c36bc54305d626d02e | 868 | py | Python | diary/models.py | yheiblog/base_diary | 01c2914019d6581c67071c7823a677e3c3e70950 | [
"MIT"
] | null | null | null | diary/models.py | yheiblog/base_diary | 01c2914019d6581c67071c7823a677e3c3e70950 | [
"MIT"
] | 16 | 2021-06-07T13:23:10.000Z | 2022-02-05T23:18:43.000Z | diary/models.py | yheiblog/base_diary | 01c2914019d6581c67071c7823a677e3c3e70950 | [
"MIT"
] | 1 | 2021-08-18T23:40:21.000Z | 2021-08-18T23:40:21.000Z | from django.db import models
from django.db.models.deletion import CASCADE
from django.contrib.auth.models import AbstractUser
# Create your models here.
class User(AbstractUser):
pass
class Post(models.Model):
id = models.AutoField(primary_key=True)
user = models.ForeignKey(User, on_delete=CASCADE)
title =... | 27.125 | 54 | 0.756912 | 706 | 0.813364 | 0 | 0 | 0 | 0 | 0 | 0 | 57 | 0.065668 |