hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
752b7d9e196141fa7c5103ab07e73e4f73b5e72a | 264 | py | Python | length9.py | NortySpock/word-trimmer | d98b768284ae257e59579b678d6774c9b4767eab | [
"MIT"
] | null | null | null | length9.py | NortySpock/word-trimmer | d98b768284ae257e59579b678d6774c9b4767eab | [
"MIT"
] | null | null | null | length9.py | NortySpock/word-trimmer | d98b768284ae257e59579b678d6774c9b4767eab | [
"MIT"
] | null | null | null | import sys
import os
master_word_list = []
f = open('dictionary.txt', 'r')
for line in f:
master_word_list.append(line.strip())
f.close()
out = open("8_chars_or_less.txt",'w')
for i in master_word_list:
if len(i) < 9:
out.write(i + '\n')
f.close()
| 15.529412 | 40 | 0.643939 |
c6a6804a161228bfb03570a8f88a9db6d611d968 | 25,003 | py | Python | uhd_restpy/testplatform/sessions/ixnetwork/topology/ntpclock_0d879e81ae3d4c658c1fddb7e0bca059.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 20 | 2019-05-07T01:59:14.000Z | 2022-02-11T05:24:47.000Z | uhd_restpy/testplatform/sessions/ixnetwork/topology/ntpclock_0d879e81ae3d4c658c1fddb7e0bca059.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 60 | 2019-04-03T18:59:35.000Z | 2022-02-22T12:05:05.000Z | uhd_restpy/testplatform/sessions/ixnetwork/topology/ntpclock_0d879e81ae3d4c658c1fddb7e0bca059.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 13 | 2019-05-20T10:48:31.000Z | 2021-10-06T07:45:44.000Z | # MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify,... | 46.560521 | 318 | 0.649482 |
541906f24570747cfafe268dc6354c7edf73bf09 | 245 | py | Python | tests/eth2/beacon/types/test_deposit_input.py | mhchia/trinity | e40e475064ca4605887706e9b0e4f8e2349b10cd | [
"MIT"
] | 2 | 2020-01-30T21:51:00.000Z | 2020-07-22T14:51:05.000Z | tests/eth2/beacon/types/test_deposit_input.py | mhchia/trinity | e40e475064ca4605887706e9b0e4f8e2349b10cd | [
"MIT"
] | null | null | null | tests/eth2/beacon/types/test_deposit_input.py | mhchia/trinity | e40e475064ca4605887706e9b0e4f8e2349b10cd | [
"MIT"
] | null | null | null | from eth2.beacon.types.deposit_input import DepositInput
def test_defaults(sample_deposit_input_params):
deposit_input = DepositInput(**sample_deposit_input_params)
assert deposit_input.pubkey == sample_deposit_input_params['pubkey']
| 30.625 | 72 | 0.828571 |
5d904f4b9897efb4e798d1dc827d27290c8a7913 | 534 | py | Python | AtCoder/ABC/030/d.py | ttyskg/ProgrammingCompetition | 65fb9e131803e4f1a1a6369e68ed1b504f08b00f | [
"MIT"
] | null | null | null | AtCoder/ABC/030/d.py | ttyskg/ProgrammingCompetition | 65fb9e131803e4f1a1a6369e68ed1b504f08b00f | [
"MIT"
] | null | null | null | AtCoder/ABC/030/d.py | ttyskg/ProgrammingCompetition | 65fb9e131803e4f1a1a6369e68ed1b504f08b00f | [
"MIT"
] | null | null | null | import sys
def main():
input = sys.stdin.readline
N, a = map(int, input().split())
k = int(input())
B = [int(b) - 1 for b in input().split()]
a -= 1
cnt = 0
route = []
while cnt < k and B[a] not in route:
a = B[a]
cnt += 1
route.append(a)
if cnt == k:
... | 16.181818 | 45 | 0.470037 |
7f4978942a9ab5d7d705d9a53d158b80b192b27d | 498 | py | Python | Warmup-1/pos_neg.py | SleepNoMore/CodingBat | de49348a2d125f46635a936dad2818bcb63a7f05 | [
"MIT"
] | null | null | null | Warmup-1/pos_neg.py | SleepNoMore/CodingBat | de49348a2d125f46635a936dad2818bcb63a7f05 | [
"MIT"
] | null | null | null | Warmup-1/pos_neg.py | SleepNoMore/CodingBat | de49348a2d125f46635a936dad2818bcb63a7f05 | [
"MIT"
] | null | null | null | '''
Given 2 int values, return True if one is negative and one is positive.
Except if the parameter "negative" is True,
then return True only if both are negative.
'''
def pos_neg(a, b, negative):
if negative:
return a < 0 and b < 0
else:
if a > 0 and b > 0:
return False
el... | 21.652174 | 71 | 0.564257 |
4f319f5d7f7ab284f4eb04848d2eeb1370b462e8 | 509 | py | Python | tests/gsl/permutation_copy.py | lijun99/pyre | 004dfd4c06489b4ba5b32877338ca6440f2d523b | [
"BSD-3-Clause"
] | 3 | 2019-08-02T21:02:47.000Z | 2021-09-08T13:59:43.000Z | tests/gsl/permutation_copy.py | lijun99/pyre | 004dfd4c06489b4ba5b32877338ca6440f2d523b | [
"BSD-3-Clause"
] | null | null | null | tests/gsl/permutation_copy.py | lijun99/pyre | 004dfd4c06489b4ba5b32877338ca6440f2d523b | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2019 all rights reserved
#
"""
Create a permutation
"""
def test():
# get the package
import gsl
# make a permutation
p = gsl.permutation(shape=100).init()
# check that we got a valid permutation back... | 14.138889 | 48 | 0.599214 |
b8e651078ff51f110b396e291ad7e2c06d245d6a | 17,080 | py | Python | cinder/tests/unit/backup/drivers/test_backup_driver_base.py | helenwalsh/cinder | 307fccea4cc9c6496334b0fe137206cb48499bd5 | [
"Apache-2.0"
] | 571 | 2015-01-01T17:47:26.000Z | 2022-03-23T07:46:36.000Z | cinder/tests/unit/backup/drivers/test_backup_driver_base.py | BelieveInFuture/cinder | fff95fa6a68a054488ee087b6e31f4f5e28209dc | [
"Apache-2.0"
] | 37 | 2015-01-22T23:27:04.000Z | 2021-02-05T16:38:48.000Z | cinder/tests/unit/backup/drivers/test_backup_driver_base.py | BelieveInFuture/cinder | fff95fa6a68a054488ee087b6e31f4f5e28209dc | [
"Apache-2.0"
] | 841 | 2015-01-04T17:17:11.000Z | 2022-03-31T12:06:51.000Z | # Copyright 2013 Canonical Ltd.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 43.794872 | 78 | 0.607553 |
2ce38ca52b19d85fbec2db587884291ee6d9d67a | 2,716 | py | Python | ReadISErrors.py | CRZaug/NonlinearWaves | 2adfc2cc5e0c18576c6b73420a913ef1ce23000d | [
"MIT"
] | null | null | null | ReadISErrors.py | CRZaug/NonlinearWaves | 2adfc2cc5e0c18576c6b73420a913ef1ce23000d | [
"MIT"
] | null | null | null | ReadISErrors.py | CRZaug/NonlinearWaves | 2adfc2cc5e0c18576c6b73420a913ef1ce23000d | [
"MIT"
] | null | null | null | """
This code reads in old and new information from IS simulations for the purposes of
beta optimization.
It saves the "new" information to a file, which can then be accessed in the future
as "old" information.
THIS CODE IS MEANT TO BE USED WITH THE SCRIPT "RUNSCRIPTIS"
"""
import csv
import numpy as np
import matp... | 27.16 | 101 | 0.64838 |
e191f94c173a5bb4ee4ba68845751f7d50163e44 | 49,883 | py | Python | riptide/riptide.py | mjenior/riptide | 6cb1d7783ddac5c918f0e1701a13125e1d59b6fd | [
"MIT"
] | 8 | 2019-08-28T23:40:36.000Z | 2021-02-19T02:05:34.000Z | riptide/riptide.py | mjenior/riptide | 6cb1d7783ddac5c918f0e1701a13125e1d59b6fd | [
"MIT"
] | 4 | 2020-09-16T13:47:19.000Z | 2022-02-08T14:17:55.000Z | riptide/riptide.py | mjenior/riptide | 6cb1d7783ddac5c918f0e1701a13125e1d59b6fd | [
"MIT"
] | 2 | 2020-04-18T08:18:00.000Z | 2021-01-14T17:08:54.000Z | #!/usr/bin/python
import os
import copy
import time
import numpy
import cobra
import bisect
import pandas
import warnings
import symengine
import itertools
from cobra.util import solver
from scipy.stats import spearmanr
from numpy.random import permutation
from cobra.flux_analysis import flux_variability_analysis
# ... | 41.743096 | 163 | 0.651685 |
601c01a4c20a8f96f76791d39a0d8f86b0708234 | 5,547 | py | Python | scripts/predict_command_line.py | hanzhiwangchn/SynthSR | 35c2483f1da272855bbeea3e76140845106b623d | [
"Apache-2.0"
] | null | null | null | scripts/predict_command_line.py | hanzhiwangchn/SynthSR | 35c2483f1da272855bbeea3e76140845106b623d | [
"Apache-2.0"
] | null | null | null | scripts/predict_command_line.py | hanzhiwangchn/SynthSR | 35c2483f1da272855bbeea3e76140845106b623d | [
"Apache-2.0"
] | null | null | null | """This script enables to launch predictions with SynthSeg from the terminal.
If you use this code, please the SynthSR paper in:
https://github.com/BBillot/SynthSR/blob/master/bibtex.bib
Copyright 2020 Benjamin Billot
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except i... | 42.022727 | 115 | 0.659275 |
8ebd7b9ef97318e9553dccdedc8ee27f50d98c5e | 619 | py | Python | gui-shop/users_service.py | AtanasovAtanas/python-advanced-jan-22 | 701c5a6e2c934d010250cbc4a1c72222afb3b897 | [
"MIT"
] | 2 | 2022-03-28T10:05:51.000Z | 2022-03-31T04:36:30.000Z | gui-shop/users_service.py | AtanasovAtanas/python-advanced-jan-22 | 701c5a6e2c934d010250cbc4a1c72222afb3b897 | [
"MIT"
] | null | null | null | gui-shop/users_service.py | AtanasovAtanas/python-advanced-jan-22 | 701c5a6e2c934d010250cbc4a1c72222afb3b897 | [
"MIT"
] | 3 | 2022-02-07T19:05:44.000Z | 2022-03-21T11:34:11.000Z | import json
from auth_service import get_current_user
def purchase_product(product_id):
with open('./db/users.txt', 'r+') as file:
current_username = get_current_user()
result = []
for user_line in file:
user_obj = json.loads(user_line.strip())
if user_o... | 28.136364 | 59 | 0.567044 |
8dd85d7795e9a12049821f4fb9cd660cd276c847 | 148,024 | py | Python | distributed/client.py | jjerphan/distributed | 0ce8f2bcb84d306e9a095d75497857dce30145b5 | [
"BSD-3-Clause"
] | null | null | null | distributed/client.py | jjerphan/distributed | 0ce8f2bcb84d306e9a095d75497857dce30145b5 | [
"BSD-3-Clause"
] | null | null | null | distributed/client.py | jjerphan/distributed | 0ce8f2bcb84d306e9a095d75497857dce30145b5 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function, division, absolute_import
import atexit
from collections import defaultdict
from concurrent.futures import ThreadPoolExecutor
from concurrent.futures._base import DoneAndNotDoneFutures, CancelledError
from contextlib import contextmanager
import copy
from datetime import timedelt... | 33.634174 | 112 | 0.563483 |
d3f8199df102c1d9cb63df7a09e4019c31cf2711 | 3,244 | py | Python | apps/trade/migrations/0001_initial.py | sunwei19910119/DjangoShop | 188102dc8ef9f4751f4eeeb7574e95c8cc270484 | [
"MIT"
] | 3 | 2018-08-22T02:41:55.000Z | 2022-03-03T08:49:38.000Z | apps/trade/migrations/0001_initial.py | sunwei19910119/DjangoShop | 188102dc8ef9f4751f4eeeb7574e95c8cc270484 | [
"MIT"
] | null | null | null | apps/trade/migrations/0001_initial.py | sunwei19910119/DjangoShop | 188102dc8ef9f4751f4eeeb7574e95c8cc270484 | [
"MIT"
] | 1 | 2019-10-23T12:24:08.000Z | 2019-10-23T12:24:08.000Z | # Generated by Django 2.0.5 on 2018-07-06 22:04
import datetime
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
('goods', '0001_initial'),
]
operations = [
migrations.CreateModel(
... | 49.907692 | 239 | 0.581381 |
9a1addacfe54872a391c2de5ed823f685d5d7806 | 46 | py | Python | test/login.py | Kingworrior007/first007 | e77e07bea6a3abed93c8f028c5e4d1a73fef7328 | [
"MIT"
] | 1 | 2018-03-09T03:16:17.000Z | 2018-03-09T03:16:17.000Z | test/login.py | X-Warrior007/first007 | e77e07bea6a3abed93c8f028c5e4d1a73fef7328 | [
"MIT"
] | null | null | null | test/login.py | X-Warrior007/first007 | e77e07bea6a3abed93c8f028c5e4d1a73fef7328 | [
"MIT"
] | null | null | null | num = 10
#fixbug
num = 20
num1 = 30
num2 = 40
| 7.666667 | 9 | 0.608696 |
95124e9c78e824786a8bb2b402ebb75be36ee556 | 2,647 | py | Python | tests/python/OpenColorIOTestSuite.py | hobbes1069/OpenColorIO | 5b569ee09c5f31f79fb250a32edcb0ab757696a6 | [
"BSD-3-Clause"
] | null | null | null | tests/python/OpenColorIOTestSuite.py | hobbes1069/OpenColorIO | 5b569ee09c5f31f79fb250a32edcb0ab757696a6 | [
"BSD-3-Clause"
] | null | null | null | tests/python/OpenColorIOTestSuite.py | hobbes1069/OpenColorIO | 5b569ee09c5f31f79fb250a32edcb0ab757696a6 | [
"BSD-3-Clause"
] | null | null | null | import unittest, os, sys
build_location = sys.argv[1]
opencolorio_sse = sys.argv[2].lower() == 'true'
opencolorio_dir = os.path.join(build_location, "src", "OpenColorIO")
pyopencolorio_dir = os.path.join(build_location, "src", "bindings", "python")
if os.name == 'nt':
# On Windows we must append the build type ... | 35.293333 | 112 | 0.731016 |
421b9d3693af767ae14ffd6b7ed0db957684198b | 7,961 | py | Python | kubernetes/client/models/v1_persistent_volume_claim.py | sgwilliams-ebsco/python | 35e6406536c96d4769ff7e2a02bf0fdcb902a509 | [
"Apache-2.0"
] | 1 | 2021-06-10T23:44:11.000Z | 2021-06-10T23:44:11.000Z | kubernetes/client/models/v1_persistent_volume_claim.py | sgwilliams-ebsco/python | 35e6406536c96d4769ff7e2a02bf0fdcb902a509 | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1_persistent_volume_claim.py | sgwilliams-ebsco/python | 35e6406536c96d4769ff7e2a02bf0fdcb902a509 | [
"Apache-2.0"
] | 1 | 2018-11-06T16:33:43.000Z | 2018-11-06T16:33:43.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.12.2
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re... | 33.309623 | 281 | 0.63183 |
6c88d99021190ad35ed64507deb31f6f20567b4d | 1,153 | py | Python | tigerforecast/methods/tests/test_autoregressor.py | danielsuo/TigerForecast | ae18b169d96dd81db88ab27a8b055036845d3a8f | [
"Apache-2.0"
] | 1 | 2020-07-28T09:07:29.000Z | 2020-07-28T09:07:29.000Z | tigerforecast/methods/tests/test_autoregressor.py | danielsuo/TigerForecast | ae18b169d96dd81db88ab27a8b055036845d3a8f | [
"Apache-2.0"
] | null | null | null | tigerforecast/methods/tests/test_autoregressor.py | danielsuo/TigerForecast | ae18b169d96dd81db88ab27a8b055036845d3a8f | [
"Apache-2.0"
] | 1 | 2021-04-12T22:39:26.000Z | 2021-04-12T22:39:26.000Z | # test the Autogressor method class
import tigerforecast
import jax.numpy as np
import matplotlib.pyplot as plt
from tigerforecast.utils.optimizers import *
def test_autoregressor(steps=100, show_plot=True):
T = steps
p, q = 3, 3
n = 3
problem = tigerforecast.problem("ARMA-v0")
cur_x = problem.in... | 27.452381 | 62 | 0.653079 |
444f54fd67e1cbe2d1cc1f4c3d8b97d205cfc032 | 21,588 | py | Python | mslib/msui/mss_qt.py | Nightfurex/MSS | 51a1bc0d4ce759288b5f3a0a46e538aa0c1a8788 | [
"Apache-2.0"
] | null | null | null | mslib/msui/mss_qt.py | Nightfurex/MSS | 51a1bc0d4ce759288b5f3a0a46e538aa0c1a8788 | [
"Apache-2.0"
] | null | null | null | mslib/msui/mss_qt.py | Nightfurex/MSS | 51a1bc0d4ce759288b5f3a0a46e538aa0c1a8788 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
mslib.msui.mss_qt
~~~~~~~~~~~~~~~~~
This module helps with qt
This file is part of mss.
:copyright: Copyright 2017-2018 Joern Ungermann, Reimar Bauer
:copyright: Copyright 2017-2022 by the mss team, see AUTHORS.
:license: APACHE-2.0, see LICENSE for details.
... | 34.485623 | 113 | 0.62771 |
bfd5e73f924b43cd6f9b5bfd1e513a2c674c20d1 | 1,084 | py | Python | Assignment 2/generate_shellcode.py | dtyj/SLAE-x86 | 56c00f44ee448711aa2bc045e2cf689b877d31fd | [
"CC0-1.0"
] | null | null | null | Assignment 2/generate_shellcode.py | dtyj/SLAE-x86 | 56c00f44ee448711aa2bc045e2cf689b877d31fd | [
"CC0-1.0"
] | null | null | null | Assignment 2/generate_shellcode.py | dtyj/SLAE-x86 | 56c00f44ee448711aa2bc045e2cf689b877d31fd | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/python
# coding: utf-8
import sys
import struct
i_port = sys.argv[1]
i_addr= sys.argv[2]
ip_addr_hex = ""
if (int(i_port)) <= 256:
print ("Please use a port above 257")
exit()
port = struct.pack('<L',int(i_port)).encode('hex')[:4]
addresses = i_addr.split(".")
for addr in reversed(addresses):
... | 47.130435 | 674 | 0.594096 |
8919ccf2ad7311039d28129119e09ac3d30cf099 | 3,354 | py | Python | Leetcode/82_remove-duplicates-from-sorted-list-ii.py | diekaltesonne/Contexts | 064f61e84896852d6579675e2423537ee5bf8331 | [
"MIT"
] | null | null | null | Leetcode/82_remove-duplicates-from-sorted-list-ii.py | diekaltesonne/Contexts | 064f61e84896852d6579675e2423537ee5bf8331 | [
"MIT"
] | null | null | null | Leetcode/82_remove-duplicates-from-sorted-list-ii.py | diekaltesonne/Contexts | 064f61e84896852d6579675e2423537ee5bf8331 | [
"MIT"
] | null | null | null | # Definition for singly-linked list.
# class ListNode:
# def __init__(self, val=0, next=None):
# self.val = val
# self.next = next
def _deleteDuplicates(self,head,a,pointer):
if head.next is None:
return 0
else:
if head.val == head.next.val:
a = head.val
... | 32.563107 | 79 | 0.479129 |
d7c625139cd84ea0569a5046f4c2c2070bc7206e | 2,459 | py | Python | benchmark/startPyquil1654.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startPyquil1654.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startPyquil1654.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=5
# total number=63
import pyquil
from pyquil.api import local_forest_runtime, QVMConnection
from pyquil import Program, get_qc
from pyquil.gates import *
import numpy as np
conn = QVMConnection()
def make_circuit()-> Program:
prog = Program() # circuit begin
prog += H(0) # number=3
pr... | 25.614583 | 64 | 0.537617 |
e6fee3a939a3f87579d0c8c88eb349c9b1e554ae | 36 | py | Python | test/__init__.py | TheOpenFutur/jomaul | 22f76cc92b663aae62af441820bd4310718e6b48 | [
"MIT"
] | 1 | 2022-03-14T21:23:33.000Z | 2022-03-14T21:23:33.000Z | test/__init__.py | TheOpenFutur/jomaul | 22f76cc92b663aae62af441820bd4310718e6b48 | [
"MIT"
] | 1 | 2022-03-04T16:58:30.000Z | 2022-03-04T16:58:30.000Z | test/__init__.py | TheOpenFutur/jomaul | 22f76cc92b663aae62af441820bd4310718e6b48 | [
"MIT"
] | null | null | null | from jomaul.test.jomaul import Test
| 18 | 35 | 0.833333 |
fcb0f1199c82f9ed70f3d7d572a3e41add154949 | 1,986 | py | Python | server.py | REX500/chat_system | 2eda8e6557bd13074710308ca521a32c85b1440f | [
"MIT"
] | null | null | null | server.py | REX500/chat_system | 2eda8e6557bd13074710308ca521a32c85b1440f | [
"MIT"
] | null | null | null | server.py | REX500/chat_system | 2eda8e6557bd13074710308ca521a32c85b1440f | [
"MIT"
] | null | null | null |
#!/usr/bin/env python3
"""Server for multithreaded (asynchronous) chat application."""
from socket import AF_INET, socket, SOCK_STREAM
from threading import Thread
def accept_incoming_connections():
"""Sets up handling for incoming clients."""
while True:
client, client_address = SERVER.accept()
... | 29.641791 | 143 | 0.643505 |
0a0920ad98f03982bafa8eaf0a17d0c8be40fefd | 373 | py | Python | fyle.py | arshadkazmi42/is-broken-link-github | 6202cbdc50a8482a0474403146d28ab8782fde3f | [
"MIT"
] | null | null | null | fyle.py | arshadkazmi42/is-broken-link-github | 6202cbdc50a8482a0474403146d28ab8782fde3f | [
"MIT"
] | 1 | 2021-10-19T18:54:56.000Z | 2021-10-19T18:54:56.000Z | fyle.py | arshadkazmi42/is-broken-link-github | 6202cbdc50a8482a0474403146d28ab8782fde3f | [
"MIT"
] | 2 | 2021-11-01T20:22:05.000Z | 2022-01-05T04:49:45.000Z | class Fyle:
def __init__(self, filename):
self.filename = filename
self.lines = []
def read_lines(self):
with open(self.filename) as file:
self.lines = file.readlines()
self.lines = [line.rstrip() for line in self.lines]
return self.lines
d... | 18.65 | 63 | 0.573727 |
056848b6942f235b612d96f2b799196fc9d95f9c | 38,536 | py | Python | differential_evolution.py | carlospolop-forks/one-pixel-attack-keras | f1a8ecef33d30bd7ba2d30490348c9997be6d316 | [
"MIT"
] | null | null | null | differential_evolution.py | carlospolop-forks/one-pixel-attack-keras | f1a8ecef33d30bd7ba2d30490348c9997be6d316 | [
"MIT"
] | null | null | null | differential_evolution.py | carlospolop-forks/one-pixel-attack-keras | f1a8ecef33d30bd7ba2d30490348c9997be6d316 | [
"MIT"
] | null | null | null | """
A slight modification to Scipy's implementation of differential evolution. To speed up predictions, the entire parameters array is passed to `self.func`, where a neural network model can batch its computations and execute in parallel. Search for `CHANGES` to find all code changes.
Dan Kondratyuk 2018
Original cod... | 43.347582 | 281 | 0.607743 |
dee3a5133f56ffada0d14abb7d3e2c7d36f59bcc | 9,901 | py | Python | utils/update_test_checks.py | opencor/llvm-clang | 416d1dd61a1a748e6f20a46e20d0394e252cdbaa | [
"Apache-2.0"
] | 2 | 2018-01-16T20:08:24.000Z | 2018-01-31T17:05:32.000Z | utils/update_test_checks.py | opencor/llvm-clang | 416d1dd61a1a748e6f20a46e20d0394e252cdbaa | [
"Apache-2.0"
] | 18 | 2022-03-08T13:46:16.000Z | 2022-03-23T15:30:29.000Z | utils/update_test_checks.py | opencor/llvm-clang | 416d1dd61a1a748e6f20a46e20d0394e252cdbaa | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""A script to generate FileCheck statements for 'opt' regression tests.
This script is a utility to update LLVM opt test cases with new
FileCheck patterns. It can either update all of the tests in the file or
a single test function.
Example usage:
$ update_test_checks.py --opt=../bin/opt test... | 44.399103 | 149 | 0.644278 |
d11e4eff6f0d31435a2ee6f86c2fab5ae4cc05fe | 3,160 | py | Python | HackBitApp/implement.py | SukhadaM/HackBit-Interview-Preparation-Portal | f4c6b0d7168a4ea4ffcf1569183b1614752d9946 | [
"MIT"
] | null | null | null | HackBitApp/implement.py | SukhadaM/HackBit-Interview-Preparation-Portal | f4c6b0d7168a4ea4ffcf1569183b1614752d9946 | [
"MIT"
] | null | null | null | HackBitApp/implement.py | SukhadaM/HackBit-Interview-Preparation-Portal | f4c6b0d7168a4ea4ffcf1569183b1614752d9946 | [
"MIT"
] | null | null | null | import requests
from bs4 import BeautifulSoup
# if company name is more than one word
# company = "Goldman-Sachs"
def get_question(company_name,baseurl="https://www.geeksforgeeks.org/"):
print(company_name)
company = company_name
urltopic = baseurl + company + "-topics-interview-preparation"
headers... | 25.28 | 121 | 0.552215 |
105fb0a638bff8ac8b935120e1d156d08ea213d8 | 1,155 | py | Python | accounting/izettle_client.py | jacob22/accounting | e2fceea880e3f056703ba97b6cf52b73cd7af93b | [
"Apache-2.0"
] | null | null | null | accounting/izettle_client.py | jacob22/accounting | e2fceea880e3f056703ba97b6cf52b73cd7af93b | [
"Apache-2.0"
] | null | null | null | accounting/izettle_client.py | jacob22/accounting | e2fceea880e3f056703ba97b6cf52b73cd7af93b | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Open End AB
#
# 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, s... | 38.5 | 74 | 0.705628 |
3a500c117bd21306dfad4e2bc44201b7a84ec744 | 13,005 | py | Python | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/lms/djangoapps/badges/backends/tests/test_badgr_backend.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | 3 | 2021-12-15T04:58:18.000Z | 2022-02-06T12:15:37.000Z | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/lms/djangoapps/badges/backends/tests/test_badgr_backend.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | null | null | null | Part-03-Understanding-Software-Crafting-Your-Own-Tools/models/edx-platform/lms/djangoapps/badges/backends/tests/test_badgr_backend.py | osoco/better-ways-of-thinking-about-software | 83e70d23c873509e22362a09a10d3510e10f6992 | [
"MIT"
] | 1 | 2019-01-02T14:38:50.000Z | 2019-01-02T14:38:50.000Z | """
Tests for BadgrBackend
"""
import datetime
from unittest.mock import Mock, call, patch
import json
import ddt
import httpretty
from django.test.utils import override_settings
from lazy.lazy import lazy # lint-amnesty, pylint: disable=no-name-in-module
from edx_django_utils.cache import TieredCache
from common.d... | 43.20598 | 151 | 0.647597 |
85cd7b18f91682da8b7c92e591c5bb5c4519cfff | 7,803 | py | Python | sentry_sdk/integrations/django/__init__.py | agaridata/sentry-python | 432706611282b827f314385eb4cf0eb610c2bfe4 | [
"BSD-2-Clause"
] | null | null | null | sentry_sdk/integrations/django/__init__.py | agaridata/sentry-python | 432706611282b827f314385eb4cf0eb610c2bfe4 | [
"BSD-2-Clause"
] | null | null | null | sentry_sdk/integrations/django/__init__.py | agaridata/sentry-python | 432706611282b827f314385eb4cf0eb610c2bfe4 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import sys
import weakref
from django import VERSION as DJANGO_VERSION
from django.core import signals
try:
import psycopg2.sql
def sql_to_string(sql):
if isinstance(sql, psycopg2.sql.SQL):
return sql.string
return sq... | 27.475352 | 81 | 0.645265 |
82ddfe94a119fc050619bd09d11f8c2df71fc9fc | 9,895 | py | Python | test/fuzz/test_runner.py | bitkin/bitkin | 0203d230d12822a972df4102b1875e9757a56d63 | [
"MIT"
] | null | null | null | test/fuzz/test_runner.py | bitkin/bitkin | 0203d230d12822a972df4102b1875e9757a56d63 | [
"MIT"
] | null | null | null | test/fuzz/test_runner.py | bitkin/bitkin | 0203d230d12822a972df4102b1875e9757a56d63 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2019-2020 The Bitkincoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Run fuzz test targets.
"""
from concurrent.futures import ThreadPoolExecutor, as_completed
import a... | 35.088652 | 180 | 0.600606 |
61d0787b4779705f576f5d46d67b6ddd1f64e5b4 | 2,302 | py | Python | data/p3BR/R1/benchmark/startPyquil307.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R1/benchmark/startPyquil307.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R1/benchmark/startPyquil307.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=2
# total number=56
import pyquil
from pyquil.api import local_forest_runtime, QVMConnection
from pyquil import Program, get_qc
from pyquil.gates import *
import numpy as np
conn = QVMConnection()
def make_circuit()-> Program:
prog = Program() # circuit begin
prog += H(0) # number=1
pr... | 26.45977 | 64 | 0.562554 |
cabbfafec6ac47d78b50e13b19ec30d6e565f89e | 93 | py | Python | app/main/__init__.py | silvianjoki/pitch | 0f90de50720369369ce4c58d15c27a22390499f7 | [
"MIT"
] | null | null | null | app/main/__init__.py | silvianjoki/pitch | 0f90de50720369369ce4c58d15c27a22390499f7 | [
"MIT"
] | null | null | null | app/main/__init__.py | silvianjoki/pitch | 0f90de50720369369ce4c58d15c27a22390499f7 | [
"MIT"
] | null | null | null | from flask import Blueprint
main = Blueprint('main', __name__)
from . import views, forms
| 13.285714 | 34 | 0.741935 |
063dd1a7a77d6142b4228fafbede47cf0dad3b55 | 2,020 | py | Python | sem6000-settings-restore-demo.py | moormaster/voltcraft-sem-6000 | e41766ab6f1eea1950ab70ca28227ec91d777331 | [
"MIT"
] | 2 | 2020-08-20T07:25:12.000Z | 2021-12-04T20:36:46.000Z | sem6000-settings-restore-demo.py | moormaster/voltcraft-sem-6000 | e41766ab6f1eea1950ab70ca28227ec91d777331 | [
"MIT"
] | null | null | null | sem6000-settings-restore-demo.py | moormaster/voltcraft-sem-6000 | e41766ab6f1eea1950ab70ca28227ec91d777331 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import datetime
import json
import sys
from sem6000 import sem6000
from sem6000.message import *
if len(sys.argv) <= 1:
print("Usage: " + sys.argv[0] + " <bluetooth address> <pin> <settings backup file>", file=sys.stderr)
else:
address = sys.argv[1]
pin = sys.argv[2]
json_file = s... | 34.827586 | 185 | 0.665842 |
15d41425255912f9f14c0f06d730fb4bdc9e0cd9 | 27,116 | py | Python | GAN_10.py | drogen120/GAN_MNIST | c828ebccb27706dc5beb503f807e87330a392087 | [
"MIT"
] | null | null | null | GAN_10.py | drogen120/GAN_MNIST | c828ebccb27706dc5beb503f807e87330a392087 | [
"MIT"
] | null | null | null | GAN_10.py | drogen120/GAN_MNIST | c828ebccb27706dc5beb503f807e87330a392087 | [
"MIT"
] | null | null | null | from __future__ import division
import os
import time
import math
from glob import glob
import tensorflow as tf
import numpy as np
from six.moves import xrange
import cv2
from ops import *
from utils import *
import thread
from tensorflow.examples.tutorials.mnist import input_data
def conv_out_size_same(size, stride):... | 47.158261 | 138 | 0.569664 |
2541d067ca4234b2c6a97bb4b0cae3a41f70301b | 4,586 | py | Python | bot.py | ClareCat/CatBot | 25ec7822b153265a2438e8eea88dfdd3e42d9ef1 | [
"MIT"
] | 1 | 2021-11-04T05:36:34.000Z | 2021-11-04T05:36:34.000Z | bot.py | ClareCat/CatBot | 25ec7822b153265a2438e8eea88dfdd3e42d9ef1 | [
"MIT"
] | null | null | null | bot.py | ClareCat/CatBot | 25ec7822b153265a2438e8eea88dfdd3e42d9ef1 | [
"MIT"
] | null | null | null | #!/usr/env python
import ConfigParser
import datetime
import functions
import sys
import time
from twisted.words.protocols import irc
from twisted.internet import reactor, protocol, ssl
from twisted.python import log
from twisted.protocols.policies import TrafficLoggingFactory
from functions import Seen
class CatBot(... | 33.231884 | 116 | 0.631487 |
8073736d976876fdc1f9b1275b274b725abd3973 | 704 | py | Python | homework(november)/homeworkAssigment2/gcd.py | tkanicka/python_learning | 67fc0e8ca6333571f8b0d30f835b759d670a8643 | [
"Unlicense"
] | null | null | null | homework(november)/homeworkAssigment2/gcd.py | tkanicka/python_learning | 67fc0e8ca6333571f8b0d30f835b759d670a8643 | [
"Unlicense"
] | null | null | null | homework(november)/homeworkAssigment2/gcd.py | tkanicka/python_learning | 67fc0e8ca6333571f8b0d30f835b759d670a8643 | [
"Unlicense"
] | null | null | null |
x = int(input("first number: "))
y = int(input("second number: "))
def GCD(x,y):
smallerNumber = min(abs(x),abs(y))
for divisor in range(1,smallerNumber + 1):
if x % divisor == 0 and y % divisor == 0:
gcd = divisor
return gcd
def GCD_recursion(x,y):
higher_number = max(abs(x), abs... | 29.333333 | 115 | 0.589489 |
8ebe2b722cbec61b15f6cb057def9150933f5b9d | 6,564 | py | Python | Trackers.py | DuncanRL/AutomaticMinecraftTimer | 67606e360b12a87e2f7c6295f131a0c7b8e2690e | [
"MIT"
] | null | null | null | Trackers.py | DuncanRL/AutomaticMinecraftTimer | 67606e360b12a87e2f7c6295f131a0c7b8e2690e | [
"MIT"
] | 14 | 2021-01-06T19:19:57.000Z | 2021-03-13T19:19:21.000Z | Trackers.py | DuncanRL/AutomaticMinecraftTimer | 67606e360b12a87e2f7c6295f131a0c7b8e2690e | [
"MIT"
] | null | null | null | import threading
import os
import time
import json
from python_nbt import nbt
class SavesTracker:
def __init__(self, path):
self.path = path
self.running = True
self.mtime = 0
self.latestWorld = None
self.savesLen = 0
self.worldList = []
self.newWorldCalls =... | 34.547368 | 101 | 0.491773 |
a1eee92a7baecf323eaedd7d7f65082ae66f1071 | 840 | py | Python | backend/main_app/migrations/0001_initial.py | AlexGeniusMan/NA-PROJECT | c9ba30490b2f15e47e4496caba95945a03cb9325 | [
"Apache-2.0"
] | null | null | null | backend/main_app/migrations/0001_initial.py | AlexGeniusMan/NA-PROJECT | c9ba30490b2f15e47e4496caba95945a03cb9325 | [
"Apache-2.0"
] | null | null | null | backend/main_app/migrations/0001_initial.py | AlexGeniusMan/NA-PROJECT | c9ba30490b2f15e47e4496caba95945a03cb9325 | [
"Apache-2.0"
] | 1 | 2021-07-03T14:51:12.000Z | 2021-07-03T14:51:12.000Z | # Generated by Django 3.1.5 on 2021-03-03 12:46
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Message',
fields=[
('id', models.AutoField(... | 30 | 114 | 0.572619 |
6445c837f2e7229f936442e6abf320075d8007ad | 2,556 | py | Python | src/model.py | myanjini/ms-reservations | 1270abc4c64e55aad1649c2b9a3fd15091c11edb | [
"MIT"
] | null | null | null | src/model.py | myanjini/ms-reservations | 1270abc4c64e55aad1649c2b9a3fd15091c11edb | [
"MIT"
] | null | null | null | src/model.py | myanjini/ms-reservations | 1270abc4c64e55aad1649c2b9a3fd15091c11edb | [
"MIT"
] | null | null | null | """ Model implementation - saves data to the database """
import os
import sys
import logging as log
import redis
def env_var(name, default):
"""Safely retrieve an env var, with a default"""
return os.environ.get(name) if name in os.environ else default
REDIS_HOST = env_var("REDIS_HOST", '0.0.0.0')
REDIS_PO... | 29.72093 | 74 | 0.583333 |
16264dd326f0d4e9f85ef309d5c45325adadefef | 607 | py | Python | src/uart_project/main.py | RaphaelCavalcante/python-uart | 20d1f0051489fc01f80478e46bab2bab21ecae07 | [
"MIT"
] | null | null | null | src/uart_project/main.py | RaphaelCavalcante/python-uart | 20d1f0051489fc01f80478e46bab2bab21ecae07 | [
"MIT"
] | 5 | 2021-02-08T20:23:23.000Z | 2022-01-13T00:49:40.000Z | src/uart_project/main.py | RaphaelCavalcante/python-uart | 20d1f0051489fc01f80478e46bab2bab21ecae07 | [
"MIT"
] | null | null | null | from datainput import Datainput
from device import Device
import serial
def queryBuild(datainputs):
dataframe = [b'1']
if len(datainputs) > 0 and len(datainputs) < 2:
for dataInput in datainputs:
dataframe.append(str(dataInput.port).encode())
dataframe.append(b'0')
return dataframe
... | 24.28 | 65 | 0.650741 |
176ae35e1f6e52c0a15bfd52d21ba8cc7c5c41fa | 2,388 | py | Python | bamboo_engine/builder/flow/base.py | homholueng/bamboo-engine | 391aa11ef8b70a054b89be47227937ba3d1392bc | [
"MIT"
] | null | null | null | bamboo_engine/builder/flow/base.py | homholueng/bamboo-engine | 391aa11ef8b70a054b89be47227937ba3d1392bc | [
"MIT"
] | null | null | null | bamboo_engine/builder/flow/base.py | homholueng/bamboo-engine | 391aa11ef8b70a054b89be47227937ba3d1392bc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 29.481481 | 115 | 0.627303 |
bf9187b461073ee0f2334367ae4df378c29f0e97 | 5,431 | py | Python | modules/networks/discriminator.py | praeclarumjj3/OLIE | c0a27e7409f7db51b190bfac114677cb7b5dd669 | [
"BSD-2-Clause"
] | 1 | 2021-04-10T19:43:47.000Z | 2021-04-10T19:43:47.000Z | modules/networks/discriminator.py | praeclarumjj3/OLIE | c0a27e7409f7db51b190bfac114677cb7b5dd669 | [
"BSD-2-Clause"
] | null | null | null | modules/networks/discriminator.py | praeclarumjj3/OLIE | c0a27e7409f7db51b190bfac114677cb7b5dd669 | [
"BSD-2-Clause"
] | null | null | null | """
Copyright (C) 2019 NVIDIA Corporation. All rights reserved.
Licensed under the CC BY-NC-SA 4.0 license (https://creativecommons.org/licenses/by-nc-sa/4.0/legalcode).
"""
import torch
import torch.nn as nn
import numpy as np
import torch.nn.functional as F
from modules.networks.base_network import BaseNetwork
from... | 36.945578 | 105 | 0.599705 |
14fce124c94e66cb78b469e25686d0926a811560 | 5,329 | py | Python | lib/surface/deployment_manager/resources/list.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | null | null | null | lib/surface/deployment_manager/resources/list.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | 11 | 2020-02-29T02:51:12.000Z | 2022-03-30T23:20:08.000Z | lib/surface/deployment_manager/resources/list.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | 1 | 2020-07-24T18:47:35.000Z | 2020-07-24T18:47:35.000Z | # -*- coding: utf-8 -*- #
# Copyright 2014 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | 32.493902 | 107 | 0.675737 |
e99a1f97b3d5b8bf37fc904be4d30ed842bf62d8 | 3,787 | py | Python | backend/kesaseteli/applications/views.py | jannetasa/yjdh | 5d86a56c722dfbcee03110f66c7e7ddbea966db9 | [
"MIT"
] | null | null | null | backend/kesaseteli/applications/views.py | jannetasa/yjdh | 5d86a56c722dfbcee03110f66c7e7ddbea966db9 | [
"MIT"
] | null | null | null | backend/kesaseteli/applications/views.py | jannetasa/yjdh | 5d86a56c722dfbcee03110f66c7e7ddbea966db9 | [
"MIT"
] | null | null | null | from datetime import date
from django.contrib.admin.views.decorators import staff_member_required
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from django.utils.decorators import method_decorator
from django.utils.translation import gettext_lazy as _
from django.views.... | 39.447917 | 93 | 0.685767 |
543abe1bcd2f40bfcb8ddbdc8803704678ac0f03 | 1,181 | py | Python | docker/src/clawpack-5.3.1/clawutil/dev/advection_3d_swirl/regression_tests.py | ian-r-rose/visualization | ed6d9fab95eb125e7340ab3fad3ed114ed3214af | [
"CC-BY-4.0"
] | 11 | 2017-01-04T18:19:48.000Z | 2021-02-21T01:46:33.000Z | docker/src/clawpack-5.3.1/clawutil/dev/advection_3d_swirl/regression_tests.py | ian-r-rose/visualization | ed6d9fab95eb125e7340ab3fad3ed114ed3214af | [
"CC-BY-4.0"
] | 8 | 2016-09-22T20:49:51.000Z | 2019-09-06T23:28:13.000Z | docker/src/clawpack-5.3.1/clawutil/dev/advection_3d_swirl/regression_tests.py | ian-r-rose/visualization | ed6d9fab95eb125e7340ab3fad3ed114ed3214af | [
"CC-BY-4.0"
] | 13 | 2016-09-22T20:20:06.000Z | 2020-07-13T14:48:32.000Z | """
Regression tests for swril 3D advection.
"""
import sys
import unittest
import clawpack.amrclaw.test as test
class Advection3DSwirlTest(test.AMRClawRegressionTest):
r"""Basic test for a 3D advection test case"""
def runTest(self, save=False):
# Write out data files
self.load_rundata()... | 24.604167 | 80 | 0.585944 |
adb59f9c674f43fc41c75b5c9cd6298e6b65a82e | 1,408 | py | Python | CodeJam/2021/Qualifiers/cheating_detection.py | cestcedric/GooglesCodingCompetitions | 4acadbf31ffe159e4424d173451e3cd912c17185 | [
"MIT"
] | null | null | null | CodeJam/2021/Qualifiers/cheating_detection.py | cestcedric/GooglesCodingCompetitions | 4acadbf31ffe159e4424d173451e3cd912c17185 | [
"MIT"
] | null | null | null | CodeJam/2021/Qualifiers/cheating_detection.py | cestcedric/GooglesCodingCompetitions | 4acadbf31ffe159e4424d173451e3cd912c17185 | [
"MIT"
] | null | null | null | import numpy as np
def preprocessAnswers(answers):
for i in range(len(answers)):
answers[i] = [ int(c) for c in answers[i] ]
return np.array(answers)
def questionLevel(answers):
# difficulty of question = 1 - probability to be correct
return (1 - answers.sum(axis = 0) / answers.shape[0])
d... | 27.607843 | 70 | 0.632102 |
76f806229d3238940fa031eaacb9f6489981542b | 315 | py | Python | examples/SimpleDemo/source/client.py | kubo39/grpc-dlang | f29b9de048c360c109b123cea327b3aca6e8a5ac | [
"Apache-2.0"
] | 31 | 2019-03-11T03:58:45.000Z | 2022-03-25T06:17:26.000Z | examples/SimpleDemo/source/client.py | kubo39/grpc-dlang | f29b9de048c360c109b123cea327b3aca6e8a5ac | [
"Apache-2.0"
] | 15 | 2019-04-16T13:39:51.000Z | 2022-03-23T00:05:40.000Z | examples/SimpleDemo/source/client.py | kubo39/grpc-dlang | f29b9de048c360c109b123cea327b3aca6e8a5ac | [
"Apache-2.0"
] | 8 | 2019-06-03T15:54:31.000Z | 2021-06-09T19:07:48.000Z | import grpc
import helloworld_pb2
import helloworld_pb2_grpc
host = '127.0.0.1'
PORT = 30051;
if __name__ == "__main__":
channel = grpc.insecure_channel(host + ':' + str(PORT))
client = helloworld_pb2_grpc.GreeterStub(channel)
resp = client.SayHello(helloworld_pb2.HelloRequest(name='Hunt'))
print(resp)
| 22.5 | 66 | 0.742857 |
3d3ab73eb3860dea2dac0ece7df2576939ac22d7 | 4,547 | py | Python | imagecolor.py | kluszczyn/ADS-B-funhouse | 6b271d9daed9ac0b2d5746cba38bb757a20c9eea | [
"MIT"
] | null | null | null | imagecolor.py | kluszczyn/ADS-B-funhouse | 6b271d9daed9ac0b2d5746cba38bb757a20c9eea | [
"MIT"
] | null | null | null | imagecolor.py | kluszczyn/ADS-B-funhouse | 6b271d9daed9ac0b2d5746cba38bb757a20c9eea | [
"MIT"
] | null | null | null | # Copyright (c) 2016 Johan Kanflo (github.com/kanflo)
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, me... | 34.18797 | 104 | 0.590499 |
7866079105570a021df8d221f8f0fca01501a19a | 27,754 | py | Python | os_ken/tests/integrated/common/docker_base.py | rolaya/os-ken | 10009e41539c737c7c423f13e4f5bc5f46d219ff | [
"Apache-2.0"
] | 1 | 2019-04-24T04:01:07.000Z | 2019-04-24T04:01:07.000Z | os_ken/tests/integrated/common/docker_base.py | anlaneg/os-ken | 379a7694c3129cc0156343af71f4fca8830d9de5 | [
"Apache-2.0"
] | null | null | null | os_ken/tests/integrated/common/docker_base.py | anlaneg/os-ken | 379a7694c3129cc0156343af71f4fca8830d9de5 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2015 Nippon Telegraph and Telephone Corporation.
#
# This is based on the following
# https://github.com/osrg/gobgp/test/lib/base.py
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the L... | 34.605985 | 79 | 0.5472 |
cecf89e450c3ff0778d3ecf2a4547b19a74b6d0b | 205 | py | Python | datasets/ppdb.py | mindgarage/Ovation | d2dec77cefacda7d20301922f7a02fad589d3d2f | [
"Apache-2.0"
] | 9 | 2017-09-11T12:12:03.000Z | 2020-05-07T12:47:04.000Z | datasets/ppdb.py | mindgarage/Ovation | d2dec77cefacda7d20301922f7a02fad589d3d2f | [
"Apache-2.0"
] | 16 | 2017-09-14T01:18:24.000Z | 2022-03-11T23:17:56.000Z | datasets/ppdb.py | mindgarage/Ovation | d2dec77cefacda7d20301922f7a02fad589d3d2f | [
"Apache-2.0"
] | 17 | 2017-09-14T00:46:17.000Z | 2019-06-28T03:02:46.000Z | from datasets.sts import STS
class PPDB(STS):
def __init__(self, train_validation_split=None, test_split=None,
use_defaults=True, name='ppdb'):
super().__init__(subset=name)
| 25.625 | 68 | 0.673171 |
87836465d864d0d9bac0935f4a67efedbd285c0a | 13,976 | py | Python | custom_components/melcloud_custom/climate.py | ollo69/melcloud_custom-ha | 4235b51a11673913c6d210d6bc33124f44ffecb7 | [
"Apache-2.0"
] | null | null | null | custom_components/melcloud_custom/climate.py | ollo69/melcloud_custom-ha | 4235b51a11673913c6d210d6bc33124f44ffecb7 | [
"Apache-2.0"
] | null | null | null | custom_components/melcloud_custom/climate.py | ollo69/melcloud_custom-ha | 4235b51a11673913c6d210d6bc33124f44ffecb7 | [
"Apache-2.0"
] | null | null | null | """Platform for climate integration."""
from datetime import timedelta
import logging
from typing import Any, Dict, List, Optional
from pymelcloud import DEVICE_TYPE_ATA, DEVICE_TYPE_ATW, AtaDevice, AtwDevice
import pymelcloud.ata_device as ata
import pymelcloud.atw_device as atw
from pymelcloud.atw_device import (
... | 34.171149 | 94 | 0.673369 |
30e56a329a90d5ab2dfbc96117828df227fad1f3 | 122,099 | py | Python | apps/reader/views.py | Paul3MK/NewsBlur | f912d100c2867e5366fca92abadc50d4253a41d8 | [
"MIT"
] | null | null | null | apps/reader/views.py | Paul3MK/NewsBlur | f912d100c2867e5366fca92abadc50d4253a41d8 | [
"MIT"
] | null | null | null | apps/reader/views.py | Paul3MK/NewsBlur | f912d100c2867e5366fca92abadc50d4253a41d8 | [
"MIT"
] | null | null | null | import datetime
import time
import redis
import requests
import random
import zlib
import re
from django.shortcuts import get_object_or_404
from django.shortcuts import render
from django.contrib.auth.decorators import login_required
from django.template.loader import render_to_string
from django.db import IntegrityErr... | 43.904711 | 172 | 0.628703 |
dda2bc8b06e6e3b0054dfd42028fee43e009c8fd | 8,624 | py | Python | atef/pyepics_compat.py | pcdshub/atef | 9c0bc579fe823da1df411d3cc940456e54d6f515 | [
"BSD-3-Clause-LBNL"
] | null | null | null | atef/pyepics_compat.py | pcdshub/atef | 9c0bc579fe823da1df411d3cc940456e54d6f515 | [
"BSD-3-Clause-LBNL"
] | 10 | 2021-12-01T21:06:28.000Z | 2022-03-25T21:39:56.000Z | atef/pyepics_compat.py | pcdshub/atef | 9c0bc579fe823da1df411d3cc940456e54d6f515 | [
"BSD-3-Clause-LBNL"
] | 2 | 2021-04-02T20:04:34.000Z | 2021-04-15T22:03:40.000Z | from __future__ import annotations
from typing import (Any, ClassVar, Dict, List, Literal, NoReturn, Optional,
Tuple, Union)
from ophyd._dispatch import EventDispatcher, wrap_callback
from ophyd.signal import EpicsSignalBase
try:
from typing import Protocol # Python 3.8+
except ImportError:
... | 29.135135 | 80 | 0.601229 |
74b89dbe46c20ec008254c1dbb54552899899f5f | 45,733 | py | Python | python/pyspark/sql/streaming/readwriter.py | wangyeweikuer/spark | 731aa2cdf8a78835621fbf3de2d3492b27711d1a | [
"BSD-2-Clause",
"Apache-2.0",
"CC0-1.0",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2021-11-18T05:24:48.000Z | 2021-11-18T05:24:48.000Z | python/pyspark/sql/streaming/readwriter.py | wangyeweikuer/spark | 731aa2cdf8a78835621fbf3de2d3492b27711d1a | [
"BSD-2-Clause",
"Apache-2.0",
"CC0-1.0",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 6 | 2018-06-14T11:15:27.000Z | 2019-01-27T12:11:23.000Z | python/pyspark/sql/streaming/readwriter.py | wangyeweikuer/spark | 731aa2cdf8a78835621fbf3de2d3492b27711d1a | [
"BSD-2-Clause",
"Apache-2.0",
"CC0-1.0",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2021-09-19T22:04:32.000Z | 2021-09-19T22:04:32.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 37.030769 | 122 | 0.596309 |
ccbfaaf3f90192e7b8bcf463688785ae6508691b | 17,636 | py | Python | seahub/api2/endpoints/via_repo_token.py | thuma/seahub | 25b658b2986ee92d73fa186a077290b1c0b0e73b | [
"Apache-2.0"
] | 420 | 2015-01-03T11:34:46.000Z | 2022-03-10T07:15:41.000Z | seahub/api2/endpoints/via_repo_token.py | thuma/seahub | 25b658b2986ee92d73fa186a077290b1c0b0e73b | [
"Apache-2.0"
] | 735 | 2015-01-04T21:22:51.000Z | 2022-03-31T09:26:07.000Z | seahub/api2/endpoints/via_repo_token.py | shoeper/seahub | 467a378d58c26a8b735b008398b9068b60b9e345 | [
"Apache-2.0"
] | 379 | 2015-01-05T17:08:03.000Z | 2022-03-06T00:11:50.000Z | import os
import json
import logging
import posixpath
from django.http import HttpResponse
from django.utils.translation import ugettext as _
from rest_framework import status
from rest_framework.authentication import SessionAuthentication
from rest_framework.permissions import IsAuthenticated
from rest_framework.resp... | 40.542529 | 118 | 0.613915 |
488d05b095667094c8b69d018d974e5f938d552b | 12,863 | py | Python | src/qrl/crypto/doctest_data.py | scottdonaldau/QRL | fb78c1cdf227330ace46f590a36cc6a52c7af3fe | [
"MIT"
] | 441 | 2017-04-09T18:45:00.000Z | 2022-03-28T19:51:40.000Z | src/qrl/crypto/doctest_data.py | scottdonaldau/QRL | fb78c1cdf227330ace46f590a36cc6a52c7af3fe | [
"MIT"
] | 415 | 2017-04-11T06:08:34.000Z | 2021-11-24T08:51:27.000Z | src/qrl/crypto/doctest_data.py | scottdonaldau/QRL | fb78c1cdf227330ace46f590a36cc6a52c7af3fe | [
"MIT"
] | 204 | 2017-04-11T05:31:32.000Z | 2022-03-14T19:14:45.000Z | # coding=utf-8
# Distributed under the MIT software license, see the accompanying
# file LICENSE or http://www.opensource.org/licenses/mit-license.php.
from pyqrllib.pyqrllib import hstr2bin, bin2hstr
def binvec2hstr(data):
return [bin2hstr(b) for b in data]
xmss_test_eseed1 = bytes([0x10, 0x02, 0x00] + [0] * 4... | 321.575 | 4,640 | 0.970924 |
55ea26693bd1af09a8ec832c04cb29a79b77da17 | 445 | py | Python | obmed/run.py | praj-foss/obmed | 32a6e815d8875a6fd3ec765c1a50cead2aee1bcf | [
"MIT"
] | null | null | null | obmed/run.py | praj-foss/obmed | 32a6e815d8875a6fd3ec765c1a50cead2aee1bcf | [
"MIT"
] | null | null | null | obmed/run.py | praj-foss/obmed | 32a6e815d8875a6fd3ec765c1a50cead2aee1bcf | [
"MIT"
] | null | null | null | from docopt import docopt
from os.path import expanduser
from obmed import __doc__, __version__, menuparser
def main():
args = docopt(__doc__)
# print(args)
menuparser.load(expanduser(args["--menu"]))
if args["--version"]:
print(__version__)
if args["print"]:
menuparser.activate... | 18.541667 | 54 | 0.647191 |
b6478d00e5816155507f71f79c3305249e9c97c3 | 4,621 | py | Python | plotter.py | s171156/NLP | d2ccf3f9f1a2f7ef9e39329458f682c6cbe0c0f1 | [
"WTFPL"
] | null | null | null | plotter.py | s171156/NLP | d2ccf3f9f1a2f7ef9e39329458f682c6cbe0c0f1 | [
"WTFPL"
] | null | null | null | plotter.py | s171156/NLP | d2ccf3f9f1a2f7ef9e39329458f682c6cbe0c0f1 | [
"WTFPL"
] | null | null | null | import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
class ReviewPlotter:
def __init__(self, headless: bool = False):
if headless:
matplotlib.use('Agg')
self.fig = plt.figure()
self.fig.subplots_adjust(bottom=0.2)
self.ax = [None, No... | 30.806667 | 115 | 0.522831 |
16695ffa6c752cfe929600bd0cb3e4c3616c95b2 | 208 | py | Python | happybat bot/cogs/ban.py | HappyBat1189/HappyBat.tkBot | 9def594b2e421d0e4d524e85690be4ea272ce45f | [
"Apache-2.0"
] | null | null | null | happybat bot/cogs/ban.py | HappyBat1189/HappyBat.tkBot | 9def594b2e421d0e4d524e85690be4ea272ce45f | [
"Apache-2.0"
] | null | null | null | happybat bot/cogs/ban.py | HappyBat1189/HappyBat.tkBot | 9def594b2e421d0e4d524e85690be4ea272ce45f | [
"Apache-2.0"
] | null | null | null | import discord
from discord.ext import commands
class ban(commands.Cog):
def __init__(self, client):
self.client = client
def setup(client):
client.add_cog(ban(client)) | 17.333333 | 33 | 0.639423 |
1088d49df56311c20639e4ba3cb23c4f6adef8fe | 3,767 | py | Python | ga4ghtest/services/trs/api.py | ga4gh/workflow-interop | e2b3422f6867ce632c65e017d7b558f3cce9fcf1 | [
"Apache-2.0"
] | 5 | 2019-04-15T17:37:33.000Z | 2020-04-24T15:18:06.000Z | ga4ghtest/services/trs/api.py | ga4gh/workflow-interop | e2b3422f6867ce632c65e017d7b558f3cce9fcf1 | [
"Apache-2.0"
] | 58 | 2018-12-07T15:55:35.000Z | 2022-02-18T15:42:27.000Z | ga4ghtest/services/trs/api.py | Sage-Bionetworks/synapse-orchestrator | e2b3422f6867ce632c65e017d7b558f3cce9fcf1 | [
"Apache-2.0"
] | 4 | 2018-07-18T23:00:09.000Z | 2018-07-31T20:01:21.000Z | #!/usr/bin/env python
"""
Load API client for a Tool Registry Service (TRS) endpoint based
either on the GA4GH specification or an existing client library.
"""
import logging
from bravado.requests_client import RequestsClient
from ga4ghtest.core.config import trs_config
from .client import TRSClient
logger = logging... | 32.756522 | 118 | 0.747014 |
7e99651f0787def45d32bdeb9070ba3ef94a189a | 7,078 | py | Python | wavegan.py | sandip-baidya/wavegan-1 | a47ec6f1bfe46bb3204f487283effb0a3075b917 | [
"MIT"
] | null | null | null | wavegan.py | sandip-baidya/wavegan-1 | a47ec6f1bfe46bb3204f487283effb0a3075b917 | [
"MIT"
] | null | null | null | wavegan.py | sandip-baidya/wavegan-1 | a47ec6f1bfe46bb3204f487283effb0a3075b917 | [
"MIT"
] | null | null | null | import tensorflow as tf
def conv1d_transpose(
inputs,
filters,
kernel_width,
stride=4,
padding='same',
upsample='zeros'):
if upsample == 'zeros':
return tf.layers.conv2d_transpose(
tf.expand_dims(inputs, axis=1),
filters,
(1, kernel_width),
strides=(1, str... | 28.087302 | 128 | 0.644956 |
d390bbd78e2cf9dcd140c21ee091b5022c7797db | 754 | py | Python | pudb/py3compat.py | fdevibe/pudb | 07c178cf03e4dcb65ba8d3d38b58e029ea7b3de4 | [
"MIT"
] | 4 | 2021-10-14T21:22:25.000Z | 2022-03-12T19:58:48.000Z | pudb/py3compat.py | fdevibe/pudb | 07c178cf03e4dcb65ba8d3d38b58e029ea7b3de4 | [
"MIT"
] | 3 | 2020-06-05T18:53:36.000Z | 2021-06-10T20:47:05.000Z | pudb/py3compat.py | fdevibe/pudb | 07c178cf03e4dcb65ba8d3d38b58e029ea7b3de4 | [
"MIT"
] | 1 | 2022-03-15T22:52:53.000Z | 2022-03-15T22:52:53.000Z | from __future__ import absolute_import, division, print_function
import sys
PY3 = sys.version_info[0] >= 3
if PY3:
raw_input = input
xrange = range
integer_types = (int,)
string_types = (str,)
text_type = str
def execfile(fname, globs, locs=None):
exec(compile(open(fname).read(), fname... | 26 | 78 | 0.681698 |
bdd2cffba8c843b3c2bfe39ef633f302e94eb1fd | 2,537 | py | Python | dtlpy/miscellaneous/zipping.py | dataloop-ai/dtlpy | 2c73831da54686e047ab6aefd8f12a8e53ea97c2 | [
"Apache-2.0"
] | 10 | 2020-05-21T06:25:35.000Z | 2022-01-07T20:34:03.000Z | dtlpy/miscellaneous/zipping.py | dataloop-ai/dtlpy | 2c73831da54686e047ab6aefd8f12a8e53ea97c2 | [
"Apache-2.0"
] | 22 | 2019-11-17T17:25:16.000Z | 2022-03-10T15:14:28.000Z | dtlpy/miscellaneous/zipping.py | dataloop-ai/dtlpy | 2c73831da54686e047ab6aefd8f12a8e53ea97c2 | [
"Apache-2.0"
] | 8 | 2020-03-05T16:23:55.000Z | 2021-12-27T11:10:42.000Z | import pathspec
import numpy as np
import logging
import zipfile
import os
logger = logging.getLogger(name=__name__)
MAX_ZIP_FILE = 100e6 # 100MB
class Zipping:
def __init__(self):
pass
@staticmethod
def zip_directory(zip_filename, directory=None, ignore_max_file_size=False):
"""
... | 36.768116 | 112 | 0.577848 |
83f226b1201d111cef54193c904d58185430aeaf | 3,520 | py | Python | azure-mgmt-monitor/azure/mgmt/monitor/models/alert_rule_resource_py3.py | Christina-Kang/azure-sdk-for-python | bbf982eb06aab04b8151f69f1d230b7f5fb96ebf | [
"MIT"
] | 1 | 2022-03-30T22:39:15.000Z | 2022-03-30T22:39:15.000Z | azure-mgmt-monitor/azure/mgmt/monitor/models/alert_rule_resource_py3.py | Christina-Kang/azure-sdk-for-python | bbf982eb06aab04b8151f69f1d230b7f5fb96ebf | [
"MIT"
] | 54 | 2016-03-25T17:25:01.000Z | 2018-10-22T17:27:54.000Z | azure-mgmt-monitor/azure/mgmt/monitor/models/alert_rule_resource_py3.py | Christina-Kang/azure-sdk-for-python | bbf982eb06aab04b8151f69f1d230b7f5fb96ebf | [
"MIT"
] | 2 | 2017-01-20T18:25:46.000Z | 2017-05-12T21:31:47.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 41.904762 | 167 | 0.628977 |
f186a6f74ac9f290090144d9179f7b3c1c0d60f7 | 2,351 | py | Python | onpolicy/envs/mpe/multi_discrete.py | btx0424/on-policy | 78e095be05a8596afcb4b7de8b3293844717fed6 | [
"MIT"
] | 401 | 2021-03-05T00:08:17.000Z | 2022-03-31T14:47:53.000Z | onpolicy/envs/mpe/multi_discrete.py | btx0424/on-policy | 78e095be05a8596afcb4b7de8b3293844717fed6 | [
"MIT"
] | 35 | 2021-03-06T07:50:09.000Z | 2022-03-29T06:52:08.000Z | onpolicy/envs/mpe/multi_discrete.py | btx0424/on-policy | 78e095be05a8596afcb4b7de8b3293844717fed6 | [
"MIT"
] | 96 | 2021-03-05T05:43:21.000Z | 2022-03-30T10:37:46.000Z | # An old version of OpenAI Gym's multi_discrete.py. (Was getting affected by Gym updates)
# (https://github.com/openai/gym/blob/1fb81d4e3fb780ccf77fec731287ba07da35eb84/gym/spaces/multi_discrete.py)
import numpy as np
import gym
class MultiDiscrete(gym.Space):
"""
- The multi-discrete action space consists o... | 52.244444 | 122 | 0.672054 |
0e69180985a4e1eae171fa6b57368ee3752691d8 | 7,288 | py | Python | paas-ce/paas/esb/components/generic/templates/cmsi/send_voice_msg.py | canway-bk/bk-PaaS | 7a6fe1ef38a7e4e2bd11a6c2efa871a967ac2a3c | [
"Apache-2.0"
] | 767 | 2019-03-25T06:35:43.000Z | 2022-03-30T08:57:51.000Z | paas-ce/paas/esb/components/generic/templates/cmsi/send_voice_msg.py | canway-bk/bk-PaaS | 7a6fe1ef38a7e4e2bd11a6c2efa871a967ac2a3c | [
"Apache-2.0"
] | 194 | 2019-03-29T07:16:41.000Z | 2022-03-30T06:17:49.000Z | paas-ce/paas/esb/components/generic/templates/cmsi/send_voice_msg.py | canway-bk/bk-PaaS | 7a6fe1ef38a7e4e2bd11a6c2efa871a967ac2a3c | [
"Apache-2.0"
] | 381 | 2019-03-25T07:19:54.000Z | 2022-03-29T03:22:42.000Z | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community Edition) available.
Copyright (C) 2017-2018 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 40.043956 | 305 | 0.55118 |
1afc074543e9cd47774492df3e62a435c31878e7 | 2,521 | py | Python | day15-coffee-machine/main.py | frnkvsk/python100days | 70d607ca58a526f0d66544ed65405b2425718108 | [
"Unlicense"
] | null | null | null | day15-coffee-machine/main.py | frnkvsk/python100days | 70d607ca58a526f0d66544ed65405b2425718108 | [
"Unlicense"
] | null | null | null | day15-coffee-machine/main.py | frnkvsk/python100days | 70d607ca58a526f0d66544ed65405b2425718108 | [
"Unlicense"
] | null | null | null |
MENU = {
"espresso": {
"ingredients": {
"water": 50,
"coffee": 18,
},
"cost": 1.5,
},
"latte": {
"ingredients": {
"water": 200,
"milk": 150,
"coffee": 24,
},
"cost": 2.5,
},
"cappuccino": {
... | 28.647727 | 98 | 0.551765 |
2d23ef30d37ad2a0bf3e9131d5cdb91e6508ebb3 | 5,285 | py | Python | noxfile.py | Darkflame72/mc-server-stats | 991020d3bac9aa453fd38546ef3eab914ce250fa | [
"MIT"
] | 1 | 2021-11-24T02:02:34.000Z | 2021-11-24T02:02:34.000Z | noxfile.py | Darkflame72/mc-server-stats | 991020d3bac9aa453fd38546ef3eab914ce250fa | [
"MIT"
] | 22 | 2020-08-26T05:12:46.000Z | 2021-12-20T15:20:45.000Z | noxfile.py | Obsidion-dev/mc-server-stats | 991020d3bac9aa453fd38546ef3eab914ce250fa | [
"MIT"
] | 2 | 2020-10-31T05:54:56.000Z | 2021-02-15T03:11:32.000Z | """Nox sessions."""
import shutil
import sys
from pathlib import Path
from textwrap import dedent
import nox
from nox_poetry import Session
from nox_poetry import session
package = "mcsrvstats"
python_versions = ["3.9", "3.8", "3.7"]
nox.options.sessions = (
"pre-commit",
"safety",
"mypy",
"tests",
... | 27.38342 | 87 | 0.598108 |
147b2bd55caf7c4c73c3949454ff53698292884a | 18,183 | py | Python | Allura/allura/lib/macro.py | 99Kies/allura | 745ab3c5a9bd287b365b699bd38ef94650afc32e | [
"Apache-2.0"
] | 1 | 2021-12-09T21:52:12.000Z | 2021-12-09T21:52:12.000Z | Allura/allura/lib/macro.py | 99Kies/allura | 745ab3c5a9bd287b365b699bd38ef94650afc32e | [
"Apache-2.0"
] | null | null | null | Allura/allura/lib/macro.py | 99Kies/allura | 745ab3c5a9bd287b365b699bd38ef94650afc32e | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (t... | 36.957317 | 118 | 0.61431 |
1a6b67ea2c37e773a6c756ca324135b4dd1a8111 | 17,871 | py | Python | backTestingEngine.py | quanttrade/factor-test | c17b4fdcb9c959772f2002b85ab6acccc61c92ae | [
"MIT"
] | 8 | 2017-04-21T17:47:47.000Z | 2019-08-07T07:40:18.000Z | backTestingEngine.py | kamiseko/factor-test | c17b4fdcb9c959772f2002b85ab6acccc61c92ae | [
"MIT"
] | null | null | null | backTestingEngine.py | kamiseko/factor-test | c17b4fdcb9c959772f2002b85ab6acccc61c92ae | [
"MIT"
] | 2 | 2019-05-30T03:07:35.000Z | 2019-12-31T03:18:05.000Z | #!/Tsan/bin/python
# -*- coding: utf-8 -*-
# Libraries To Use
from __future__ import division
import numpy as np
import pandas as pd
from datetime import datetime,time,date
from collections import OrderedDict
import copy
# Import My own library for factor testing
from SingleFactorTest import factorFilte... | 41.082759 | 142 | 0.529685 |
5636e0f3b96c1224b27092fcfbdc85c28fc6378a | 10,443 | py | Python | code/formatters.py | ulyssesdouglass/knausj_talon | 8a3d7578ab6730f6c28b4f47aca10bac45f14e7e | [
"MIT"
] | null | null | null | code/formatters.py | ulyssesdouglass/knausj_talon | 8a3d7578ab6730f6c28b4f47aca10bac45f14e7e | [
"MIT"
] | null | null | null | code/formatters.py | ulyssesdouglass/knausj_talon | 8a3d7578ab6730f6c28b4f47aca10bac45f14e7e | [
"MIT"
] | null | null | null | from talon import Module, Context, actions, ui, imgui, app
from talon.grammar import Phrase
from typing import List, Union
import logging
import re
ctx = Context()
key = actions.key
edit = actions.edit
words_to_keep_lowercase = "a an the at by for in is of on to up and as but or nor".split()
# The last phrase spoken... | 37.296429 | 167 | 0.66456 |
ea65fe233fdb0eca14233c0f33e1208a32c629b5 | 12,573 | py | Python | app/FileViewer/FileServer/misc/mmpython/video/mkvinfo.py | benyaboy/sage-graphics | 090640167329ace4b6ad266d47db5bb2b0394232 | [
"Unlicense"
] | null | null | null | app/FileViewer/FileServer/misc/mmpython/video/mkvinfo.py | benyaboy/sage-graphics | 090640167329ace4b6ad266d47db5bb2b0394232 | [
"Unlicense"
] | null | null | null | app/FileViewer/FileServer/misc/mmpython/video/mkvinfo.py | benyaboy/sage-graphics | 090640167329ace4b6ad266d47db5bb2b0394232 | [
"Unlicense"
] | 1 | 2021-07-02T10:31:03.000Z | 2021-07-02T10:31:03.000Z | #if 0
# -----------------------------------------------------------------------
# mkvinfo.py - Matroska Streaming Video Files
# -----------------------------------------------------------------------
# $Id: mkvinfo.py,v 1.3 2004/04/18 17:55:26 dischi Exp $
#
# $Log: mkvinfo.py,v $
# Revision 1.3 2004/04/18 17:55:26 d... | 37.870482 | 111 | 0.564304 |
e07d6ddd92f35b19b2ffc5ca3774b6d42bdf8ae3 | 28,060 | py | Python | robosuite/environments/base.py | EylonCohen/robosuite | ad2ffdb33e7d25fb4c18ee169f1d2bc335eb61e3 | [
"MIT"
] | null | null | null | robosuite/environments/base.py | EylonCohen/robosuite | ad2ffdb33e7d25fb4c18ee169f1d2bc335eb61e3 | [
"MIT"
] | null | null | null | robosuite/environments/base.py | EylonCohen/robosuite | ad2ffdb33e7d25fb4c18ee169f1d2bc335eb61e3 | [
"MIT"
] | null | null | null | from collections import OrderedDict
from mujoco_py import MjSim, MjRenderContextOffscreen
from mujoco_py import load_model_from_xml
from robosuite.utils import SimulationError, XMLError, MujocoPyRenderer
import robosuite.utils.macros as macros
from robosuite.models.base import MujocoModel
import numpy as np
REGISTER... | 38.810512 | 120 | 0.641091 |
81d2e2d44d5d754bd696eb8ffe783ee2640d38f7 | 8,982 | py | Python | statsmodels/stats/tests/test_influence.py | equinaut/statsmodels | 6fe8d4e351416727641db4c3d3552f4ec4f46d0e | [
"BSD-3-Clause"
] | 1 | 2020-05-09T08:42:52.000Z | 2020-05-09T08:42:52.000Z | statsmodels/stats/tests/test_influence.py | equinaut/statsmodels | 6fe8d4e351416727641db4c3d3552f4ec4f46d0e | [
"BSD-3-Clause"
] | null | null | null | statsmodels/stats/tests/test_influence.py | equinaut/statsmodels | 6fe8d4e351416727641db4c3d3552f4ec4f46d0e | [
"BSD-3-Clause"
] | 1 | 2020-05-09T08:42:58.000Z | 2020-05-09T08:42:58.000Z | # -*- coding: utf-8 -*-
"""
Created on Tue Jun 12 13:18:12 2018
Author: Josef Perktold
"""
from statsmodels.compat.pandas import testing as pdt
import os.path
import numpy as np
from numpy.testing import assert_allclose
import pandas as pd
import pytest
from statsmodels.regression.linear_model import OLS
from stats... | 36.072289 | 87 | 0.646738 |
589d0f42c3ae0919e7525d8a4f6d109961616c85 | 2,100 | py | Python | qa/rpc-tests/forknotify.py | Ankh-Trust/credit-core | fa6fd67bdc9846cc40ee24f9a64e610e634b9356 | [
"MIT"
] | 2 | 2019-10-31T11:56:31.000Z | 2019-11-02T08:48:45.000Z | qa/rpc-tests/forknotify.py | Ankh-fdn/credit-core | fa6fd67bdc9846cc40ee24f9a64e610e634b9356 | [
"MIT"
] | 2 | 2019-11-22T18:49:20.000Z | 2020-10-06T11:44:46.000Z | qa/rpc-tests/forknotify.py | Ankh-fdn/credit-core | fa6fd67bdc9846cc40ee24f9a64e610e634b9356 | [
"MIT"
] | 1 | 2020-06-09T16:15:27.000Z | 2020-06-09T16:15:27.000Z | #!/usr/bin/env python2
# Copyright (c) 2016-2017 The Duality Blockchain Solutions developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test -alertnotify
#
from test_framework.test_framework import CreditTestFramework
f... | 33.870968 | 108 | 0.630952 |
3abf183033755e5288be71809a9ba861b08d03ab | 1,656 | py | Python | pre_processing/make_mask.py | IvanNik17/Seasonal-Changes-in-Thermal-Surveillance-Imaging | 753ecd2751ac318d4a304c28404ae60dd8e3060c | [
"MIT"
] | 2 | 2021-11-30T06:26:21.000Z | 2022-02-26T10:57:55.000Z | pre_processing/make_mask.py | IvanNik17/Seasonal-Changes-in-Thermal-Surveillance-Imaging | 753ecd2751ac318d4a304c28404ae60dd8e3060c | [
"MIT"
] | null | null | null | pre_processing/make_mask.py | IvanNik17/Seasonal-Changes-in-Thermal-Surveillance-Imaging | 753ecd2751ac318d4a304c28404ae60dd8e3060c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri May 28 10:22:00 2021
@author: IvanTower
"""
import numpy as np
import cv2
import os
import sys
import matplotlib.pyplot as plt
import pandas as pd
sys.path.append(r'../../loaders/pytorch_lightning/')
from dataset import Dataset
def produce_masked_images(cfg):
... | 23 | 100 | 0.618357 |
557ee406669a5d667442649c0737833729b7b8f0 | 9,921 | py | Python | awxkit/awxkit/cli/custom.py | pito111/awx | a3a5db1c44cc265f8fd670fb6f96adbf174e6edd | [
"Apache-2.0"
] | null | null | null | awxkit/awxkit/cli/custom.py | pito111/awx | a3a5db1c44cc265f8fd670fb6f96adbf174e6edd | [
"Apache-2.0"
] | null | null | null | awxkit/awxkit/cli/custom.py | pito111/awx | a3a5db1c44cc265f8fd670fb6f96adbf174e6edd | [
"Apache-2.0"
] | null | null | null | import functools
from six import with_metaclass
from .stdout import monitor, monitor_workflow
from .utils import CustomRegistryMeta, color_enabled
from awxkit.exceptions import NoContent
def handle_custom_actions(resource, action, page):
key = ' '.join([resource, action])
if key in CustomAction.registry:
... | 29.093842 | 95 | 0.633908 |
7f4a73d63027c96c13e4100a8fe25f2a261d6ffd | 10,160 | py | Python | virt/ansible-2.7.0/lib/python2.7/site-packages/ansible/modules/commands/command.py | lakhlaifi/RedHat-Ansible | 27c5077cced9d416081fcd5d69ea44bca0317fa4 | [
"Apache-2.0"
] | 1 | 2019-04-16T21:23:15.000Z | 2019-04-16T21:23:15.000Z | virt/ansible-2.7.0/lib/python2.7/site-packages/ansible/modules/commands/command.py | lakhlaifi/RedHat-Ansible | 27c5077cced9d416081fcd5d69ea44bca0317fa4 | [
"Apache-2.0"
] | 5 | 2020-02-26T20:10:50.000Z | 2021-09-23T23:23:18.000Z | venv/lib/python2.7/site-packages/ansible/modules/commands/command.py | aburan28/ansible-devops-pipeline | 50aa801632ca0828c16faac55732f1e79085f932 | [
"Apache-2.0"
] | 1 | 2020-02-13T14:24:57.000Z | 2020-02-13T14:24:57.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Michael DeHaan <michael.dehaan@gmail.com>, and others
# Copyright: (c) 2016, Toshio Kuratomi <tkuratomi@ansible.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, d... | 35.400697 | 147 | 0.641929 |
3ce15b4d7b8b1db6f5c103c2114fae29cc3ed6e8 | 7,579 | py | Python | templates/AlGaN_nextnano++.py | nextnanopy/nextnanopy | f28266d444f488726f16c9a4eb08e98720f5f683 | [
"BSD-3-Clause"
] | 9 | 2020-12-01T15:32:40.000Z | 2022-03-12T06:36:12.000Z | templates/AlGaN_nextnano++.py | nextnanopy/nextnanopy | f28266d444f488726f16c9a4eb08e98720f5f683 | [
"BSD-3-Clause"
] | 1 | 2022-03-16T14:46:06.000Z | 2022-03-22T14:13:32.000Z | templates/AlGaN_nextnano++.py | nextnanopy/nextnanopy | f28266d444f488726f16c9a4eb08e98720f5f683 | [
"BSD-3-Clause"
] | 4 | 2021-07-06T07:25:47.000Z | 2022-03-12T06:36:18.000Z | import nextnanopy as nn
from nextnanopy.utils.misc import mkdir_if_not_exist
import sys,os
#import numpy as np
import matplotlib.pyplot as plt
import pathlib
# config file is stored in C:\Users\<User>\.nextnanopy-config (home directory)
#++++++++++++++++++++++++++++++++++++++++++++++
# Specify output image format
#++... | 36.613527 | 107 | 0.571184 |
73fbba2aa317d8017ce2b0e852768508d869557b | 1,033 | py | Python | var/spack/repos/builtin/packages/abi-dumper/package.py | healther/spack | 389e9c11f6927ea27d629ed0e77ca0a52e402bc9 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 9 | 2018-04-18T07:51:40.000Z | 2021-09-10T03:56:57.000Z | var/spack/repos/builtin/packages/abi-dumper/package.py | abouteiller/spack | 95f54195021d3d32dec75bed6d8dbbaeac3d921f | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 907 | 2018-04-18T11:17:57.000Z | 2022-03-31T13:20:25.000Z | var/spack/repos/builtin/packages/abi-dumper/package.py | abouteiller/spack | 95f54195021d3d32dec75bed6d8dbbaeac3d921f | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 29 | 2018-11-05T16:14:23.000Z | 2022-02-03T16:07:09.000Z | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class AbiDumper(MakefilePackage):
"""ABI Dumper is a tool to dump ABI of an ELF object containin... | 34.433333 | 97 | 0.719264 |
1470e1adbffc813bf189735e366d5f54586e6238 | 15,044 | py | Python | tests/testbpod.py | cwrowley/modred | 989ac1881fbd8e24e57ca6dd26ee08432e874754 | [
"BSD-2-Clause"
] | null | null | null | tests/testbpod.py | cwrowley/modred | 989ac1881fbd8e24e57ca6dd26ee08432e874754 | [
"BSD-2-Clause"
] | null | null | null | tests/testbpod.py | cwrowley/modred | 989ac1881fbd8e24e57ca6dd26ee08432e874754 | [
"BSD-2-Clause"
] | 1 | 2020-05-09T00:44:20.000Z | 2020-05-09T00:44:20.000Z | #!/usr/bin/env python
"""Test the bpod module"""
import unittest
import copy
import os
from os.path import join
from shutil import rmtree
import numpy as N
import helper
helper.add_to_path(join(join(os.path.dirname(os.path.abspath(__file__)),
'..', 'src')))
import parallel as parallel_mod
_parallel = parallel_mo... | 44.377581 | 91 | 0.645241 |
2057da542202615c72ef4b11dd43cdbc9b763016 | 1,490 | py | Python | scripts/plot_roc_curves.py | bryankim96/deep-learning-gamma | cac4f2d90b6536eedf95c3a07ea73d4c7a69c5b7 | [
"BSD-3-Clause"
] | 5 | 2018-03-06T01:44:41.000Z | 2018-06-22T12:47:03.000Z | scripts/plot_roc_curves.py | bryankim96/deep-learning-gamma | cac4f2d90b6536eedf95c3a07ea73d4c7a69c5b7 | [
"BSD-3-Clause"
] | 33 | 2018-02-08T22:05:38.000Z | 2018-07-13T11:44:51.000Z | scripts/plot_roc_curves.py | bryankim96/deep-learning-gamma | cac4f2d90b6536eedf95c3a07ea73d4c7a69c5b7 | [
"BSD-3-Clause"
] | 2 | 2018-03-13T15:38:46.000Z | 2018-04-12T01:31:42.000Z | import argparse
from itertools import cycle
from matplotlib import pyplot as plt
import pandas as pd
import sklearn.metrics
parser = argparse.ArgumentParser(
description=("Plot ROC curves."))
parser.add_argument(
'predictions_file',
help='pandas hdf file of predictions')
parser.add_argument(
"--output... | 31.041667 | 107 | 0.760403 |
4aba42d97eeaba498d60d07ea910602c495ac2c1 | 46 | py | Python | src/tokenizer.py | sconos/super-octo-chainsaw | 392abf6c6fa6a15a82f7f442c108da2a0613c9d0 | [
"MIT"
] | null | null | null | src/tokenizer.py | sconos/super-octo-chainsaw | 392abf6c6fa6a15a82f7f442c108da2a0613c9d0 | [
"MIT"
] | null | null | null | src/tokenizer.py | sconos/super-octo-chainsaw | 392abf6c6fa6a15a82f7f442c108da2a0613c9d0 | [
"MIT"
] | null | null | null |
class Tokenizer():
def __init__(self):
| 7.666667 | 23 | 0.630435 |
b9c91151b1cf98497683e363a11631499602f875 | 8,596 | py | Python | src/transformers/configuration_transfo_xl.py | hilberthit/transformers | 461ae86812f9d75762bbdae2ac5776f9a5d702ea | [
"Apache-2.0"
] | null | null | null | src/transformers/configuration_transfo_xl.py | hilberthit/transformers | 461ae86812f9d75762bbdae2ac5776f9a5d702ea | [
"Apache-2.0"
] | null | null | null | src/transformers/configuration_transfo_xl.py | hilberthit/transformers | 461ae86812f9d75762bbdae2ac5776f9a5d702ea | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... | 40.739336 | 125 | 0.626803 |
e8e0950bd93512cd20c60d22c157a249e0083bfc | 888 | py | Python | setup.py | seeya/TapoP100 | 2a82bbfbb8de18786c15be4732a89f48c94f4141 | [
"MIT"
] | 1 | 2021-11-26T16:59:12.000Z | 2021-11-26T16:59:12.000Z | setup.py | seeya/TapoP100 | 2a82bbfbb8de18786c15be4732a89f48c94f4141 | [
"MIT"
] | null | null | null | setup.py | seeya/TapoP100 | 2a82bbfbb8de18786c15be4732a89f48c94f4141 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
with open('README.md') as readme_file:
README = readme_file.read()
with open('HISTORY.md') as history_file:
HISTORY = history_file.read()
setup_args = dict(
name='PyP100',
version='0.0.17',
description='A module for controlling the Tp-link Tapo P100/P10... | 27.75 | 103 | 0.686937 |
4f180ac00e8f730bc679c23c150684175f9cbeda | 1,897 | py | Python | bandwidth/messaging/models/media.py | roverdotcom/python-sdk | c6947fb3331b77f0064aeec2dcf0c4ff178de34c | [
"MIT"
] | 5 | 2020-11-04T14:29:37.000Z | 2022-02-23T20:33:07.000Z | bandwidth/messaging/models/media.py | roverdotcom/python-sdk | c6947fb3331b77f0064aeec2dcf0c4ff178de34c | [
"MIT"
] | 3 | 2021-07-23T18:48:48.000Z | 2022-03-15T14:59:07.000Z | bandwidth/messaging/models/media.py | roverdotcom/python-sdk | c6947fb3331b77f0064aeec2dcf0c4ff178de34c | [
"MIT"
] | 8 | 2020-04-14T09:22:53.000Z | 2022-03-11T10:46:06.000Z | # -*- coding: utf-8 -*-
"""
bandwidth
This file was automatically generated by APIMATIC v3.0 (
https://www.apimatic.io ).
"""
class Media(object):
"""Implementation of the 'Media' model.
TODO: type model description here.
Attributes:
content (string): TODO: type description ... | 27.897059 | 79 | 0.579863 |
d5517b3f9d8a0428ff46582a84d6fad67c1e03aa | 7,831 | py | Python | mypyc/test-data/fixtures/ir.py | knbk/mypy | b7670881c375cae5e5db8164dab1ba6633173745 | [
"PSF-2.0"
] | 2 | 2021-09-01T17:44:47.000Z | 2021-09-01T18:10:10.000Z | mypyc/test-data/fixtures/ir.py | knbk/mypy | b7670881c375cae5e5db8164dab1ba6633173745 | [
"PSF-2.0"
] | null | null | null | mypyc/test-data/fixtures/ir.py | knbk/mypy | b7670881c375cae5e5db8164dab1ba6633173745 | [
"PSF-2.0"
] | null | null | null | # These builtins stubs are used implicitly in AST to IR generation
# test cases.
from typing import (
TypeVar, Generic, List, Iterator, Iterable, Dict, Optional, Tuple, Any, Set,
overload, Mapping, Union, Callable, Sequence,
)
T = TypeVar('T')
T_co = TypeVar('T_co', covariant=True)
S = TypeVar('S')
K = TypeVa... | 34.959821 | 92 | 0.615886 |
22b3d22be2519087e04590c47e52801caf9b73d8 | 9,002 | py | Python | burny_common/integration_test_helper.py | BurnySc2/python-template | 625f758463e4add921fe0dd0b1580159a6a15dea | [
"MIT"
] | null | null | null | burny_common/integration_test_helper.py | BurnySc2/python-template | 625f758463e4add921fe0dd0b1580159a6a15dea | [
"MIT"
] | null | null | null | burny_common/integration_test_helper.py | BurnySc2/python-template | 625f758463e4add921fe0dd0b1580159a6a15dea | [
"MIT"
] | null | null | null | import os
import signal
import socket
import subprocess
import time
from pathlib import Path
from typing import Optional, Set
import psutil
import pymongo
import requests # type: ignore
from loguru import logger
from pymongo import MongoClient
WEBSITE_IP = 'http://localhost'
class Timeout:
"""
Run somethin... | 31.585965 | 180 | 0.643635 |
86aaf599f698a3dfd289402c28d454f6154ee02d | 4,261 | py | Python | tools/compute_cmvn_stats.py | JJoving/wenet | 4a2195744dba43fe4fb9ad8d46a2b90a80dbdc4e | [
"Apache-2.0"
] | null | null | null | tools/compute_cmvn_stats.py | JJoving/wenet | 4a2195744dba43fe4fb9ad8d46a2b90a80dbdc4e | [
"Apache-2.0"
] | null | null | null | tools/compute_cmvn_stats.py | JJoving/wenet | 4a2195744dba43fe4fb9ad8d46a2b90a80dbdc4e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# encoding: utf-8
import sys
import argparse
import json
import codecs
import yaml
import torch
import torchaudio
import torchaudio.compliance.kaldi as kaldi
from torch.utils.data import Dataset, DataLoader
torchaudio.set_audio_backend("sox_io")
class CollateFunc(object):
''' Collate func... | 33.81746 | 86 | 0.557381 |
8b2877029f9c58b66940cde32dc70cc715f9bda6 | 421 | py | Python | nsp_project_app/migrations/0024_notification_status.py | Priyansh863/e-backend | c8c1bb8a7c0de96febacfeec76249256c8df3303 | [
"bzip2-1.0.6"
] | null | null | null | nsp_project_app/migrations/0024_notification_status.py | Priyansh863/e-backend | c8c1bb8a7c0de96febacfeec76249256c8df3303 | [
"bzip2-1.0.6"
] | null | null | null | nsp_project_app/migrations/0024_notification_status.py | Priyansh863/e-backend | c8c1bb8a7c0de96febacfeec76249256c8df3303 | [
"bzip2-1.0.6"
] | null | null | null | # Generated by Django 2.2.5 on 2020-10-12 11:56
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('nsp_project_app', '0023_auto_20201012_1722'),
]
operations = [
migrations.AddField(
model_name='notification',
name=... | 22.157895 | 73 | 0.617577 |
5aa8cd54d3e080ebb1348a997d2c8d189cde1d5a | 550 | py | Python | conftest.py | nkoshkina/Python_Training2-Task14 | 8619b2464aef8eab0861e4bf584f8d363da7a0f5 | [
"Apache-2.0"
] | null | null | null | conftest.py | nkoshkina/Python_Training2-Task14 | 8619b2464aef8eab0861e4bf584f8d363da7a0f5 | [
"Apache-2.0"
] | null | null | null | conftest.py | nkoshkina/Python_Training2-Task14 | 8619b2464aef8eab0861e4bf584f8d363da7a0f5 | [
"Apache-2.0"
] | null | null | null | import pytest
from fixture.application import Application
fixture = None
@pytest.fixture
def app(request):
global fixture
if fixture is None:
fixture = Application()
else:
if not fixture.is_valid():
fixture = Application()
fixture.session.ensure_login(username="admin", pass... | 23.913043 | 69 | 0.68 |
bc6e61ec0af48e1c2364c0d79b3bf123516f45a8 | 2,832 | py | Python | dowhy/causal_refuters/data_subset_refuter.py | HeyangGong/dowhy_zh | e768c006fd5ef31ec21f5b3dd6dad4f122035b4f | [
"MIT"
] | 12 | 2020-08-05T09:48:27.000Z | 2022-02-07T15:52:24.000Z | dowhy/causal_refuters/data_subset_refuter.py | HeyangGong/dowhy_zh | e768c006fd5ef31ec21f5b3dd6dad4f122035b4f | [
"MIT"
] | 1 | 2020-03-18T11:47:43.000Z | 2020-03-18T11:47:43.000Z | dowhy/causal_refuters/data_subset_refuter.py | Causal-Inference-ZeroToAll/dowhy | ac03e857de0cf31283323546ca16dd1cebc34eba | [
"MIT"
] | 1 | 2020-08-05T18:08:55.000Z | 2020-08-05T18:08:55.000Z | from dowhy.causal_refuter import CausalRefuter, CausalRefutation
import numpy as np
import logging
class DataSubsetRefuter(CausalRefuter):
"""Refute an estimate by rerunning it on a random subset of the original data.
Supports additional parameters that can be specified in the refute_estimate() method.
-... | 44.25 | 114 | 0.657133 |
cbdf1e4cd1f80704aa809ce34f20c4f212316d75 | 8,600 | py | Python | third_party/chromite/lib/gclient.py | zipated/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | third_party/chromite/lib/gclient.py | cangulcan/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | third_party/chromite/lib/gclient.py | cangulcan/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Common functions used for syncing Chrome."""
from __future__ import print_function
import os
import pprint
from chromite... | 32.45283 | 79 | 0.701395 |
bd1ec919b9fe4012b5883b74900ba21d0c3de441 | 8,761 | py | Python | torchensemble/_base.py | snuml2021tmp/Ensemble-Pytorch | 4fce38ce1ce91a0a8883d1723609c7b4285e52ee | [
"BSD-3-Clause"
] | null | null | null | torchensemble/_base.py | snuml2021tmp/Ensemble-Pytorch | 4fce38ce1ce91a0a8883d1723609c7b4285e52ee | [
"BSD-3-Clause"
] | null | null | null | torchensemble/_base.py | snuml2021tmp/Ensemble-Pytorch | 4fce38ce1ce91a0a8883d1723609c7b4285e52ee | [
"BSD-3-Clause"
] | null | null | null | import abc
import copy
import torch
import logging
import warnings
import numpy as np
import torch.nn as nn
from . import _constants as const
from .utils.logging import get_tb_logger
def torchensemble_model_doc(header="", item="model"):
"""
A decorator on obtaining documentation for different methods in the
... | 30.957597 | 77 | 0.595937 |
6ae86d3ff940c294bff9b0ef554a8b21903d8add | 124 | py | Python | pacote-download/PythonTeste/desafio016.py | Mariana02Santos/Python | a7bf3489b58d691578f888719c1ad6227ad39d74 | [
"MIT"
] | null | null | null | pacote-download/PythonTeste/desafio016.py | Mariana02Santos/Python | a7bf3489b58d691578f888719c1ad6227ad39d74 | [
"MIT"
] | null | null | null | pacote-download/PythonTeste/desafio016.py | Mariana02Santos/Python | a7bf3489b58d691578f888719c1ad6227ad39d74 | [
"MIT"
] | null | null | null | from math import trunc
n = float(input('Digite um número: '))
x = trunc(n)
print('O valor inteiro de {} é {}'.format(n,x))
| 20.666667 | 47 | 0.645161 |
23bdff02aa18efe16909be156bdd6721465f6d32 | 1,294 | py | Python | setup.py | tylerdave/pelican-meetup-info | 58cc22f87b78c32e47b1a4c9e4c6e35b13d14e07 | [
"MIT"
] | 2 | 2019-01-19T03:07:53.000Z | 2021-07-13T00:09:17.000Z | setup.py | tylerdave/pelican-meetup-info | 58cc22f87b78c32e47b1a4c9e4c6e35b13d14e07 | [
"MIT"
] | null | null | null | setup.py | tylerdave/pelican-meetup-info | 58cc22f87b78c32e47b1a4c9e4c6e35b13d14e07 | [
"MIT"
] | 1 | 2021-07-13T00:09:18.000Z | 2021-07-13T00:09:18.000Z | from setuptools import setup
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
install_requires = [
'requests',
]
# Get the long description from the README file
with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
long_description = f.read()
setu... | 33.179487 | 101 | 0.644513 |
7c8ea49ddc79fab29f3364d49eb118304e1266e7 | 10,496 | py | Python | src/hardware_indep/controlplane.c.py | lkpdn/t4p4s | 9df8eefd891e44b8a59b4b8edfb90150b7e484e8 | [
"Apache-2.0"
] | null | null | null | src/hardware_indep/controlplane.c.py | lkpdn/t4p4s | 9df8eefd891e44b8a59b4b8edfb90150b7e484e8 | [
"Apache-2.0"
] | null | null | null | src/hardware_indep/controlplane.c.py | lkpdn/t4p4s | 9df8eefd891e44b8a59b4b8edfb90150b7e484e8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 Eotvos Lorand University, Budapest, Hungary
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 44.66383 | 199 | 0.627001 |
47167fa2b360e5f01ab98bd2d9a3578e73516b6f | 2,600 | py | Python | letsencrypt/certbot-dns-rfc2136/setup.py | fengshukun/intapp | b09e8ee0ebf8eaa1474e1c9bd075ef9fd1fb1726 | [
"MIT"
] | 1 | 2019-12-23T06:39:49.000Z | 2019-12-23T06:39:49.000Z | letsencrypt/certbot-dns-rfc2136/setup.py | fengshukun/intapp | b09e8ee0ebf8eaa1474e1c9bd075ef9fd1fb1726 | [
"MIT"
] | null | null | null | letsencrypt/certbot-dns-rfc2136/setup.py | fengshukun/intapp | b09e8ee0ebf8eaa1474e1c9bd075ef9fd1fb1726 | [
"MIT"
] | null | null | null | import sys
from setuptools import find_packages
from setuptools import setup
from setuptools.command.test import test as TestCommand
version = '1.1.0.dev0'
# Remember to update local-oldest-requirements.txt when changing the minimum
# acme/certbot version.
install_requires = [
'acme>=0.29.0',
'certbot>=1.0.0... | 30.232558 | 84 | 0.623077 |
b2689c545e8264eea0e013641d995f810dcc7c6e | 1,106 | py | Python | stackdiff/cli.py | cariad/stackdiff | d73a5ea20d355fed63e54e99e0101492bb37b7e9 | [
"MIT"
] | null | null | null | stackdiff/cli.py | cariad/stackdiff | d73a5ea20d355fed63e54e99e0101492bb37b7e9 | [
"MIT"
] | 3 | 2021-10-30T10:47:26.000Z | 2021-10-31T09:46:16.000Z | stackdiff/cli.py | cariad/stackdiff | d73a5ea20d355fed63e54e99e0101492bb37b7e9 | [
"MIT"
] | null | null | null | from argparse import ArgumentParser
from typing import IO, List
from boto3.session import Session
from stackdiff.stack_diff import StackDiff
from stackdiff.version import get_version
def entry(cli_args: List[str], writer: IO[str]) -> int:
parser = ArgumentParser(
description="Visualises the changes desc... | 31.6 | 114 | 0.701627 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.