hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f724555c65e6b8b852f9d596dad3446f0fbf8099 | 448 | py | Python | chap_7/decay_plot.py | jieyanzhu/codes-effective-computation-in-physics | 0c99f2da9d462229e6b174a010d7c7b08af4482b | [
"MIT"
] | null | null | null | chap_7/decay_plot.py | jieyanzhu/codes-effective-computation-in-physics | 0c99f2da9d462229e6b174a010d7c7b08af4482b | [
"MIT"
] | 1 | 2021-12-23T10:09:01.000Z | 2021-12-23T12:06:25.000Z | chap_7/decay_plot.py | jieyanzhu/codes-effective-computation-in-physics | 0c99f2da9d462229e6b174a010d7c7b08af4482b | [
"MIT"
] | null | null | null | import numpy as np
# as in the previous example, load decays.csv into a NumPy array
decaydata = np.loadtxt('decays.csv', delimiter=',', skiprows=1)
# provide handles for the x and y columns
time = decaydata[:,0]
decays = decaydata[:,1]
# import the matplotlib plotting functionality
import pylab as plt
plt.plot(time... | 22.4 | 64 | 0.734375 | import numpy as np
decaydata = np.loadtxt('decays.csv', delimiter=',', skiprows=1)
time = decaydata[:,0]
decays = decaydata[:,1]
import pylab as plt
plt.plot(time, decays)
plt.xlabel('Time (s)')
plt.ylabel('Decays')
plt.title('Decays')
plt.grid(True)
plt.savefig("decays_matplotlib.png")
| true | true |
f72455bce16e4d2b4c4851dc371a6ac3b783489a | 1,136 | py | Python | oautom/execution/lambda_execution.py | FabienArcellier/oautom | ed818a34ca726355b1227d3485052793e159b177 | [
"MIT"
] | null | null | null | oautom/execution/lambda_execution.py | FabienArcellier/oautom | ed818a34ca726355b1227d3485052793e159b177 | [
"MIT"
] | null | null | null | oautom/execution/lambda_execution.py | FabienArcellier/oautom | ed818a34ca726355b1227d3485052793e159b177 | [
"MIT"
] | null | null | null | # pylint: disable=useless-super-delegation
import json
from concurrent.futures import ThreadPoolExecutor, Future
import boto3
from oautom import get_logger
from oautom.execution.execution import Execution
class LambdaExecution(Execution):
def __init__(self, name: str, flow: 'Flow', lambda_function: str, payloa... | 29.128205 | 90 | 0.681338 |
import json
from concurrent.futures import ThreadPoolExecutor, Future
import boto3
from oautom import get_logger
from oautom.execution.execution import Execution
class LambdaExecution(Execution):
def __init__(self, name: str, flow: 'Flow', lambda_function: str, payload: dict = {}):
super().__init__(na... | true | true |
f724577d79ac37b03a6ecb734534f38b37edce0a | 14,449 | py | Python | skimage/measure/tests/test_regionprops.py | jjhelmus/scikit-image | b9b5fde0821fe8bcece2528b30d012c65c64ad6f | [
"BSD-3-Clause"
] | 2 | 2017-03-30T11:22:11.000Z | 2019-03-03T05:18:01.000Z | skimage/measure/tests/test_regionprops.py | jjhelmus/scikit-image | b9b5fde0821fe8bcece2528b30d012c65c64ad6f | [
"BSD-3-Clause"
] | null | null | null | skimage/measure/tests/test_regionprops.py | jjhelmus/scikit-image | b9b5fde0821fe8bcece2528b30d012c65c64ad6f | [
"BSD-3-Clause"
] | 1 | 2019-12-17T14:53:28.000Z | 2019-12-17T14:53:28.000Z | from numpy.testing import assert_array_equal, assert_almost_equal, \
assert_array_almost_equal, assert_raises, assert_equal
import numpy as np
import math
from skimage.measure._regionprops import (regionprops, PROPS, perimeter,
_parse_docs)
SAMPLE = np.array(
[[0, 0,... | 31.479303 | 82 | 0.637207 | from numpy.testing import assert_array_equal, assert_almost_equal, \
assert_array_almost_equal, assert_raises, assert_equal
import numpy as np
import math
from skimage.measure._regionprops import (regionprops, PROPS, perimeter,
_parse_docs)
SAMPLE = np.array(
[[0, 0,... | true | true |
f724579a93aae45369d068c1ff4226dc640ec527 | 1,153 | py | Python | Easy21/plot_cuts.py | vuk119/RL | 2f5309bfff719b2965060492a19d008ed8382856 | [
"MIT"
] | null | null | null | Easy21/plot_cuts.py | vuk119/RL | 2f5309bfff719b2965060492a19d008ed8382856 | [
"MIT"
] | null | null | null | Easy21/plot_cuts.py | vuk119/RL | 2f5309bfff719b2965060492a19d008ed8382856 | [
"MIT"
] | null | null | null | """
Some useful plot functions
"""
import matplotlib.pyplot as plt
import numpy as np
def matrix_surf(m, xlimits=None, ylimits=None, **kwargs):
if xlimits is None:
xlimits = [0, m.shape[0]]
if ylimits is None:
ylimits = [0, m.shape[1]]
Y, X = np.meshgrid(np.arange(ylimits[0], ylimits[1... | 18.901639 | 92 | 0.548135 |
import matplotlib.pyplot as plt
import numpy as np
def matrix_surf(m, xlimits=None, ylimits=None, **kwargs):
if xlimits is None:
xlimits = [0, m.shape[0]]
if ylimits is None:
ylimits = [0, m.shape[1]]
Y, X = np.meshgrid(np.arange(ylimits[0], ylimits[1]), np.arange(xlimits[0], xlimits[1])... | true | true |
f7245a27daac0be722083cf7badfe71aa73117d0 | 110 | py | Python | torsionfit/tests/test_import.py | ChayaSt/torsionfit | 0b810b6da4a930b13c3ab8f8b700c6834824173b | [
"MIT"
] | 14 | 2015-10-09T15:46:09.000Z | 2020-11-25T15:30:28.000Z | torsionfit/tests/test_import.py | ChayaSt/torsionfit | 0b810b6da4a930b13c3ab8f8b700c6834824173b | [
"MIT"
] | 25 | 2015-08-28T02:09:08.000Z | 2019-08-06T19:29:41.000Z | torsionfit/tests/test_import.py | ChayaSt/torsionfit | 0b810b6da4a930b13c3ab8f8b700c6834824173b | [
"MIT"
] | 3 | 2015-05-14T19:34:03.000Z | 2015-07-27T21:46:36.000Z | #!/usr/bin/python
def test_import():
"""
Testing import of torsionfit.
"""
import torsionfit
| 13.75 | 33 | 0.609091 |
def test_import():
import torsionfit
| true | true |
f7245a5a8dda4747976414d44dfdefe86c9c2717 | 1,861 | py | Python | pyvoqc/cirq/voqc_optimization.py | akshajgaur/pyvoqc | 6352d64542be5fed72e7cae941d4a2a7db012a4f | [
"MIT"
] | 1 | 2021-11-17T10:50:50.000Z | 2021-11-17T10:50:50.000Z | pyvoqc/cirq/voqc_optimization.py | akshajgaur/pyvoqc | 6352d64542be5fed72e7cae941d4a2a7db012a4f | [
"MIT"
] | 5 | 2021-03-14T20:13:25.000Z | 2021-04-10T01:15:05.000Z | pyvoqc/cirq/voqc_optimization.py | akshajgaur/pyvoqc | 6352d64542be5fed72e7cae941d4a2a7db012a4f | [
"MIT"
] | 2 | 2021-03-13T16:16:34.000Z | 2022-01-27T19:28:15.000Z | from cirq import circuits, ops, protocols
import cirq
from cirq.contrib.qasm_import import circuit_from_qasm, qasm
import re
import os
from cirq import decompose
from cirq.circuits import Circuit
from pyvoqc.formatting.format_from_qasm import format_from_qasm
from pyvoqc.formatting.rzq_to_rz import rzq_to_rz
from pyvoq... | 36.490196 | 152 | 0.661472 | from cirq import circuits, ops, protocols
import cirq
from cirq.contrib.qasm_import import circuit_from_qasm, qasm
import re
import os
from cirq import decompose
from cirq.circuits import Circuit
from pyvoqc.formatting.format_from_qasm import format_from_qasm
from pyvoqc.formatting.rzq_to_rz import rzq_to_rz
from pyvoq... | true | true |
f7245abaa8a5cb38551388a2aee2cf80e1403e41 | 12,195 | py | Python | Scripts/plot_ProfileVar_Monthly_FDR.py | zmlabe/StratoVari | c5549f54482a2b05e89bded3e3b0b3c9faa686f3 | [
"MIT"
] | 4 | 2019-11-23T19:44:21.000Z | 2020-02-20T16:54:45.000Z | Scripts/plot_ProfileVar_Monthly_FDR.py | zmlabe/StratoVari | c5549f54482a2b05e89bded3e3b0b3c9faa686f3 | [
"MIT"
] | null | null | null | Scripts/plot_ProfileVar_Monthly_FDR.py | zmlabe/StratoVari | c5549f54482a2b05e89bded3e3b0b3c9faa686f3 | [
"MIT"
] | 2 | 2019-06-21T19:27:55.000Z | 2021-02-12T19:13:22.000Z | """
Plot vertical plots of PAMIP data for each month from November to April using
the ensemble mean (300)
Notes
-----
Author : Zachary Labe
Date : 26 June 2019
"""
### Import modules
import numpy as np
import matplotlib.pyplot as plt
import datetime
import read_MonthlyData as MO
import statsmodels.stats.mul... | 36.8429 | 83 | 0.526117 |
tlib.pyplot as plt
import datetime
import read_MonthlyData as MO
import statsmodels.stats.multitest as fdr
import cmocean
import itertools
ectoryfigure = '/home/zlabe/Desktop/STRATOVARI/'
w.month)
currentdy = str(now.day)
currentyr = str(now.year)
currenttime = currentmn + '_' + currentdy + '_' + currentyr
titletim... | true | true |
f7245c8c7d5a9be02f2a22ebc20f3d4370dc8234 | 1,216 | py | Python | package.py | rittikaadhikari/stock-recommendation | 1f14276a955301b1c6fa1c00bd88b00cf5668d8c | [
"MIT"
] | null | null | null | package.py | rittikaadhikari/stock-recommendation | 1f14276a955301b1c6fa1c00bd88b00cf5668d8c | [
"MIT"
] | null | null | null | package.py | rittikaadhikari/stock-recommendation | 1f14276a955301b1c6fa1c00bd88b00cf5668d8c | [
"MIT"
] | null | null | null | # Inspired by npm's package.json file
name = 'hisa'
version = '0.1.0'
release = '0.1.0'
description = 'A stock market predictor and model builder'
long_description = ['README.md']
keywords = ['neural', 'network', 'machine', 'deep',
'learning', 'tensorflow', 'stock', ... | 34.742857 | 74 | 0.591283 |
name = 'hisa'
version = '0.1.0'
release = '0.1.0'
description = 'A stock market predictor and model builder'
long_description = ['README.md']
keywords = ['neural', 'network', 'machine', 'deep',
'learning', 'tensorflow', 'stock', 'market', 'prediction']
authors ... | true | true |
f7245ff14c37b2aedccbcae8d5af768476c65b57 | 587 | py | Python | setup.py | dimitri-yatsenko/adamacs | c83ce744d207fb5fa3e7069a15cff4a52b9dcf52 | [
"MIT"
] | null | null | null | setup.py | dimitri-yatsenko/adamacs | c83ce744d207fb5fa3e7069a15cff4a52b9dcf52 | [
"MIT"
] | null | null | null | setup.py | dimitri-yatsenko/adamacs | c83ce744d207fb5fa3e7069a15cff4a52b9dcf52 | [
"MIT"
] | null | null | null | from setuptools import setup
with open('README.md') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
setup(
name='adamacs',
version='0.0.1',
description='Architectures for Data Management and Computational Support.',
long_description=readme,
author='Daniel Müller-Kom... | 22.576923 | 79 | 0.623509 | from setuptools import setup
with open('README.md') as f:
readme = f.read()
with open('LICENSE') as f:
license = f.read()
setup(
name='adamacs',
version='0.0.1',
description='Architectures for Data Management and Computational Support.',
long_description=readme,
author='Daniel Müller-Kom... | true | true |
f7246097ee00e1071047af06705d6ed6469d67cb | 7,066 | py | Python | tensorflow/contrib/keras/python/keras/models_test.py | DEVESHTARASIA/tensorflow | d3edb8c60ed4fd831d62833ed22f5c23486c561c | [
"Apache-2.0"
] | 384 | 2017-02-21T18:38:04.000Z | 2022-02-22T07:30:25.000Z | tensorflow/contrib/keras/python/keras/models_test.py | DEVESHTARASIA/tensorflow | d3edb8c60ed4fd831d62833ed22f5c23486c561c | [
"Apache-2.0"
] | 15 | 2017-03-01T20:18:43.000Z | 2020-05-07T10:33:51.000Z | tensorflow/contrib/keras/python/keras/models_test.py | DEVESHTARASIA/tensorflow | d3edb8c60ed4fd831d62833ed22f5c23486c561c | [
"Apache-2.0"
] | 81 | 2017-02-21T19:31:19.000Z | 2022-02-22T07:30:24.000Z | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 32.865116 | 80 | 0.649731 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import tempfile
import numpy as np
from tensorflow.contrib.keras.python import keras
from tensorflow.python.platform import test
try:
import h5py
except ImportError:
h5py = Non... | true | true |
f72460e93b5cc9a2ba178d43a0407e7595709d8c | 399 | py | Python | run.py | palazzem/gello | 19fe9e4aa8de485dd829a87047ec64f89b5fa7ee | [
"Apache-2.0"
] | 44 | 2018-03-28T14:22:23.000Z | 2022-03-15T07:25:06.000Z | run.py | palazzem/gello | 19fe9e4aa8de485dd829a87047ec64f89b5fa7ee | [
"Apache-2.0"
] | 44 | 2018-03-28T14:19:03.000Z | 2022-02-16T10:24:57.000Z | run.py | palazzem/gello | 19fe9e4aa8de485dd829a87047ec64f89b5fa7ee | [
"Apache-2.0"
] | 12 | 2018-03-28T14:15:43.000Z | 2021-07-19T17:33:20.000Z | # -*- coding: utf-8 -*-
#
# Unless explicitly stated otherwise all files in this repository are licensed
# under the Apache 2 License.
#
# This product includes software developed at Datadog
# (https://www.datadoghq.com/).
#
# Copyright 2018 Datadog, Inc.
#
"""run.py
Run the application locally by runnnig:
`pyt... | 16.625 | 78 | 0.689223 |
from app import app
if __name__ == '__main__':
app.run()
| true | true |
f7246108e996bd99236ce11f115ac45903250e54 | 399 | py | Python | code/poc/emergency.py | a10pepo/parrot_ar_drone | af3c15379772a7e86082957776ed8c39193170ec | [
"MIT"
] | null | null | null | code/poc/emergency.py | a10pepo/parrot_ar_drone | af3c15379772a7e86082957776ed8c39193170ec | [
"MIT"
] | 3 | 2021-06-08T20:51:39.000Z | 2022-03-12T00:13:08.000Z | code/poc/emergency.py | a10pepo/parrot_ar_drone | af3c15379772a7e86082957776ed8c39193170ec | [
"MIT"
] | 1 | 2020-02-03T16:24:38.000Z | 2020-02-03T16:24:38.000Z | # -*- coding: utf-8 -*-
"""
Created on Wed Dec 18 18:19:15 2019
@author: pepo
"""
import libardrone
import pygame
from time import sleep
import time
import cv2
drone = libardrone.ARDrone()
def operation(sleep):
t1 = time.time()
t2=t1
while t2-t1<sleep:
drone.turn_left()
t2=time.time()
... | 12.090909 | 35 | 0.606516 |
import libardrone
import pygame
from time import sleep
import time
import cv2
drone = libardrone.ARDrone()
def operation(sleep):
t1 = time.time()
t2=t1
while t2-t1<sleep:
drone.turn_left()
t2=time.time()
def main():
drone.land()
if __name__ == '__main__':
main() | true | true |
f724637d889f2486a08417116366b6d3968dc1b4 | 503 | py | Python | ports/gprs_a9/examples/example_31_ssl.py | sebi5361/micropython | 6c054cd124bc6229bee127128264dc0829dea53c | [
"MIT"
] | 79 | 2019-02-07T09:04:50.000Z | 2022-02-20T06:54:44.000Z | ports/gprs_a9/examples/example_31_ssl.py | sebi5361/micropython | 6c054cd124bc6229bee127128264dc0829dea53c | [
"MIT"
] | 100 | 2019-05-16T09:25:23.000Z | 2021-09-20T07:46:54.000Z | ports/gprs_a9/examples/example_31_ssl.py | sebi5361/micropython | 6c054cd124bc6229bee127128264dc0829dea53c | [
"MIT"
] | 25 | 2019-03-20T08:16:57.000Z | 2022-03-11T17:59:36.000Z | # Micropython a9g example
# Source: https://github.com/pulkin/micropython
# Author: pulkin
# Demonstrates how to wrap sockets into ssl tunnel
import cellular
import socket
import ssl
cellular.gprs("internet", "", "")
print("IP", socket.get_local_ip())
host = "httpstat.us"
port = 443
s = socket.socket()
s.connect((host,... | 23.952381 | 70 | 0.719682 |
import cellular
import socket
import ssl
cellular.gprs("internet", "", "")
print("IP", socket.get_local_ip())
host = "httpstat.us"
port = 443
s = socket.socket()
s.connect((host, port))
s = ssl.wrap_socket(s)
message = "GET /200 HTTP/1.1\r\nHost: {}\r\nConnection: close\r\n\r\n"
s.write(message.format(host))
print(... | true | true |
f7246452a8b54521f9de02de28a010c82e5a7bdd | 675 | py | Python | script/dbus_mock.py | lingxiao-Zhu/electron | 2d85b1f8f527d55f884904dbfdde50ee66a49830 | [
"MIT"
] | 88,283 | 2016-04-04T19:29:13.000Z | 2022-03-31T23:33:33.000Z | script/dbus_mock.py | lingxiao-Zhu/electron | 2d85b1f8f527d55f884904dbfdde50ee66a49830 | [
"MIT"
] | 27,327 | 2016-04-04T19:38:58.000Z | 2022-03-31T22:34:10.000Z | script/dbus_mock.py | lingxiao-Zhu/electron | 2d85b1f8f527d55f884904dbfdde50ee66a49830 | [
"MIT"
] | 15,972 | 2016-04-04T19:32:06.000Z | 2022-03-31T08:54:00.000Z | #!/usr/bin/env python
import os
import subprocess
import sys
from dbusmock import DBusTestCase
from lib.config import is_verbose_mode
def stop():
DBusTestCase.stop_dbus(DBusTestCase.system_bus_pid)
DBusTestCase.stop_dbus(DBusTestCase.session_bus_pid)
def start():
log = sys.stdout if is_verbose_mode() e... | 22.5 | 72 | 0.734815 |
import os
import subprocess
import sys
from dbusmock import DBusTestCase
from lib.config import is_verbose_mode
def stop():
DBusTestCase.stop_dbus(DBusTestCase.system_bus_pid)
DBusTestCase.stop_dbus(DBusTestCase.session_bus_pid)
def start():
log = sys.stdout if is_verbose_mode() else open(os.devnull, ... | true | true |
f724678f5e7ade231a5e84c6bdf82ae0868ec843 | 40,659 | py | Python | applications/admin/languages/he.py | misl6/web2py | 4191d4c48c37c66cc7eb293b610a6b6e86870571 | [
"BSD-3-Clause"
] | 1 | 2019-09-05T03:54:51.000Z | 2019-09-05T03:54:51.000Z | applications/admin/languages/he.py | misl6/web2py | 4191d4c48c37c66cc7eb293b610a6b6e86870571 | [
"BSD-3-Clause"
] | null | null | null | applications/admin/languages/he.py | misl6/web2py | 4191d4c48c37c66cc7eb293b610a6b6e86870571 | [
"BSD-3-Clause"
] | 1 | 2019-09-05T03:54:52.000Z | 2019-09-05T03:54:52.000Z | # -*- coding: utf-8 -*-
{
'!langcode!': 'he-il',
'!langname!': 'עברית',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"עדכן" הוא ביטוי אופציונאלי, כגון "field1=newvalue". אינך יוכל להשתמש בjoin, בעת שימוש ב"עדכן" או "מחק".',
'"User Exception" debug ... | 56.004132 | 823 | 0.710618 |
{
'!langcode!': 'he-il',
'!langname!': 'עברית',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"עדכן" הוא ביטוי אופציונאלי, כגון "field1=newvalue". אינך יוכל להשתמש בjoin, בעת שימוש ב"עדכן" או "מחק".',
'"User Exception" debug mode. ': '"User Excepti... | true | true |
f72467ab96456a59cb16d087533c917c2a6562da | 3,363 | py | Python | google/ads/google_ads/v1/proto/services/asset_service_pb2_grpc.py | jiulongw/google-ads-python | 6f5256eb1eeb5a9a95c8cdb9b97988d3a676282e | [
"Apache-2.0"
] | 1 | 2019-11-30T23:42:39.000Z | 2019-11-30T23:42:39.000Z | google/ads/google_ads/v1/proto/services/asset_service_pb2_grpc.py | jiulongw/google-ads-python | 6f5256eb1eeb5a9a95c8cdb9b97988d3a676282e | [
"Apache-2.0"
] | null | null | null | google/ads/google_ads/v1/proto/services/asset_service_pb2_grpc.py | jiulongw/google-ads-python | 6f5256eb1eeb5a9a95c8cdb9b97988d3a676282e | [
"Apache-2.0"
] | 1 | 2020-09-30T17:04:06.000Z | 2020-09-30T17:04:06.000Z | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from google.ads.google_ads.v1.proto.resources import asset_pb2 as google_dot_ads_dot_googleads__v1_dot_proto_dot_resources_dot_asset__pb2
from google.ads.google_ads.v1.proto.services import asset_service_pb2 as google_dot_ads_dot_googlea... | 46.068493 | 152 | 0.803152 |
import grpc
from google.ads.google_ads.v1.proto.resources import asset_pb2 as google_dot_ads_dot_googleads__v1_dot_proto_dot_resources_dot_asset__pb2
from google.ads.google_ads.v1.proto.services import asset_service_pb2 as google_dot_ads_dot_googleads__v1_dot_proto_dot_services_dot_asset__service__pb2
class AssetSe... | true | true |
f72468636003b664ce87050e414e28fea873cd2a | 6,582 | py | Python | uhd_restpy/testplatform/sessions/ixnetwork/impairment/link/link.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 20 | 2019-05-07T01:59:14.000Z | 2022-02-11T05:24:47.000Z | uhd_restpy/testplatform/sessions/ixnetwork/impairment/link/link.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 60 | 2019-04-03T18:59:35.000Z | 2022-02-22T12:05:05.000Z | uhd_restpy/testplatform/sessions/ixnetwork/impairment/link/link.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,... | 36.164835 | 158 | 0.647068 |
from uhd_restpy.base import Base
from uhd_restpy.files import Files
from typing import List, Any, Union
class Link(Base):
__slots__ = ()
_SDM_NAME = 'link'
_SDM_ATT_MAP = {
'ForwardingInterruption': 'forwardingInterruption',
'Name': 'name',
'RxPortName': 'rxPo... | true | true |
f724688f8543cbeb74c6f94451f45052c8b2c1af | 11,189 | py | Python | plugins/modules/oracle_profile.py | blaf-cgi/ansible-oracle-modules | 37905c6ad91808a96f0085c9c1069e166f2e17b4 | [
"MIT"
] | 8 | 2020-08-11T04:21:24.000Z | 2021-12-03T16:21:56.000Z | plugins/modules/oracle_profile.py | blaf-cgi/ansible-oracle-modules | 37905c6ad91808a96f0085c9c1069e166f2e17b4 | [
"MIT"
] | 4 | 2021-03-13T09:09:28.000Z | 2022-01-07T12:38:02.000Z | plugins/modules/oracle_profile.py | blaf-cgi/ansible-oracle-modules | 37905c6ad91808a96f0085c9c1069e166f2e17b4 | [
"MIT"
] | 3 | 2021-03-16T13:48:57.000Z | 2022-03-02T10:43:47.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: oracle_profile
short_description: Manage profiles in an Oracle database
description:
- Manage profiles in an Oracle database
version_added: "0.8.0"
optio... | 32.620991 | 168 | 0.602377 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = '''
---
module: oracle_profile
short_description: Manage profiles in an Oracle database
description:
- Manage profiles in an Oracle database
version_added: "0.8.0"
options:
name:
description:
... | true | true |
f72468caade31cb02d08f32af7db7f38ca7ca5c2 | 1,858 | py | Python | azure_iot_hub/azure/templates/led_matrix_esp32_iot_hub/__init__.py | codycodes/gix-mkrfridays-iot | 8e41040114e58b55a07ecdef7c0f4a669a0b27dc | [
"MIT"
] | 2 | 2020-05-17T05:04:22.000Z | 2020-05-19T17:14:59.000Z | azure_iot_hub/azure/templates/led_matrix_esp32_iot_hub/__init__.py | codycodes/gix-mkrfridays-iot | 8e41040114e58b55a07ecdef7c0f4a669a0b27dc | [
"MIT"
] | 18 | 2020-05-13T22:51:50.000Z | 2020-10-07T04:44:16.000Z | azure_iot_hub/azure/templates/led_matrix_esp32_iot_hub/__init__.py | codycodes/gix-mkrfridays-iot | 8e41040114e58b55a07ecdef7c0f4a669a0b27dc | [
"MIT"
] | 2 | 2020-04-24T21:25:42.000Z | 2020-05-16T19:00:50.000Z | import logging
import azure.functions as func
from azure.iot.hub import IoTHubRegistryManager
# Note that Azure Key Vault doesn't support underscores
# and some other special chars;
# we substitute with a hyphen for underscore
CONNECTION_STRING = "{c2d connection string}"
DEVICE_ID = "{device to invoke}"
ME... | 32.034483 | 70 | 0.599569 | import logging
import azure.functions as func
from azure.iot.hub import IoTHubRegistryManager
# and some other special chars;
# we substitute with a hyphen for underscore
CONNECTION_STRING = "{c2d connection string}"
DEVICE_ID = "{device to invoke}"
MESSAGE_COUNT = 1
def iothub_messaging_sample_run(msg... | true | true |
f72469575b1cfc70bf9f89f7c27364ebc94398cb | 4,622 | py | Python | images/orbit-controller/src/orbit_controller/webhooks/imagereplication_pod_webhook.py | srinivasreddych/aws-orbit-workbench | 2d154addff58d26f5459a73c06148aaf5e9fad46 | [
"Apache-2.0"
] | 94 | 2021-03-19T19:55:11.000Z | 2022-03-31T19:50:01.000Z | images/orbit-controller/src/orbit_controller/webhooks/imagereplication_pod_webhook.py | srinivasreddych/aws-orbit-workbench | 2d154addff58d26f5459a73c06148aaf5e9fad46 | [
"Apache-2.0"
] | 410 | 2021-03-19T18:04:48.000Z | 2022-03-22T13:56:53.000Z | images/orbit-controller/src/orbit_controller/webhooks/imagereplication_pod_webhook.py | srinivasreddych/aws-orbit-workbench | 2d154addff58d26f5459a73c06148aaf5e9fad46 | [
"Apache-2.0"
] | 24 | 2021-03-19T23:16:23.000Z | 2022-03-04T01:05:18.000Z | # Copyright Amazon.com, Inc. or its affiliates. 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
#
# Unl... | 35.553846 | 119 | 0.650151 |
import logging
import os
from copy import deepcopy
from typing import Any, Dict, List, Optional
import kopf
from orbit_controller import ORBIT_API_GROUP, ORBIT_API_VERSION, dynamic_client
from orbit_controller.utils import imagereplication_utils
CONFIG: Dict[str, Any]
@kopf.on.startup()
def configure(... | true | true |
f724699755ba91bea524160dc912b306d1e17208 | 40 | py | Python | boa3_test/example/tuple_test/BoolTuple.py | jplippi/neo3-boa | 052be4adebb665113715bb80067d954f7ad85ad5 | [
"Apache-2.0"
] | 25 | 2020-07-22T19:37:43.000Z | 2022-03-08T03:23:55.000Z | boa3_test/example/tuple_test/BoolTuple.py | jplippi/neo3-boa | 052be4adebb665113715bb80067d954f7ad85ad5 | [
"Apache-2.0"
] | 419 | 2020-04-23T17:48:14.000Z | 2022-03-31T13:17:45.000Z | boa3_test/example/tuple_test/BoolTuple.py | jplippi/neo3-boa | 052be4adebb665113715bb80067d954f7ad85ad5 | [
"Apache-2.0"
] | 15 | 2020-05-21T21:54:24.000Z | 2021-11-18T06:17:24.000Z | def Main():
a = (True, True, False)
| 13.333333 | 27 | 0.525 | def Main():
a = (True, True, False)
| true | true |
f72469d5195720193ad83e59ae342ad8847b12fa | 11,453 | py | Python | planner_svg_gen.py | jc0a20/myplannergen | b1a19733fb393bae6159f12cfb1d239bb81d0c25 | [
"MIT"
] | null | null | null | planner_svg_gen.py | jc0a20/myplannergen | b1a19733fb393bae6159f12cfb1d239bb81d0c25 | [
"MIT"
] | 2 | 2020-05-01T13:54:12.000Z | 2020-05-01T13:55:24.000Z | planner_svg_gen.py | jc0a20/myplannergen | b1a19733fb393bae6159f12cfb1d239bb81d0c25 | [
"MIT"
] | null | null | null | import configparser
import os
import re
import subprocess
import sys
import PyPDF2
config = configparser.ConfigParser()
config.read('config.ini', encoding='utf-8')
INKSCAPE_PATH = config['DEFAULT']['InkscapePath']
def replace_text(target_doc, target_str, replace_str, id_str):
pattern = '''id="''' + id_str + '''"... | 38.56229 | 115 | 0.628045 | import configparser
import os
import re
import subprocess
import sys
import PyPDF2
config = configparser.ConfigParser()
config.read('config.ini', encoding='utf-8')
INKSCAPE_PATH = config['DEFAULT']['InkscapePath']
def replace_text(target_doc, target_str, replace_str, id_str):
pattern = '''id="''' + id_str + '''"... | true | true |
f7246ae56a8cd487abd73fdf982a117465640f8f | 6,658 | py | Python | pciids/pciids.py | ilkermanap/python-pciids | 9a2fcb00d3e0100b9de331047133a42e98242deb | [
"MIT"
] | 5 | 2018-02-12T13:45:45.000Z | 2020-06-04T09:24:52.000Z | pciids/pciids.py | ilkermanap/python-pciids | 9a2fcb00d3e0100b9de331047133a42e98242deb | [
"MIT"
] | 2 | 2016-03-17T09:22:01.000Z | 2020-01-12T23:04:35.000Z | pciids/pciids.py | ilkermanap/python-pciids | 9a2fcb00d3e0100b9de331047133a42e98242deb | [
"MIT"
] | 4 | 2018-09-04T12:57:58.000Z | 2021-07-02T01:01:26.000Z | import os
import bz2
import requests
import glob
global HOME
HOME = "https://pci-ids.ucw.cz"
class Vendor:
"""
Class for vendors. This is the top level class
for the devices belong to a specific vendor.
self.devices is the device dictionary
subdevices are in each device.
"""
def __init__(s... | 30.541284 | 92 | 0.49249 | import os
import bz2
import requests
import glob
global HOME
HOME = "https://pci-ids.ucw.cz"
class Vendor:
def __init__(self, vendorStr):
self.ID = vendorStr.split()[0]
self.name = vendorStr.replace("%s " % self.ID,"")
self.devices = {}
def addDevice(self, deviceStr):
s = devi... | true | true |
f7246b1f729e630e5873f854feff0a703ae952c5 | 3,564 | py | Python | test/functional/feature_notifications.py | cisnes/PINECOIN | a0252cace17ecc1208a07368c0b893d3878459d8 | [
"MIT"
] | null | null | null | test/functional/feature_notifications.py | cisnes/PINECOIN | a0252cace17ecc1208a07368c0b893d3878459d8 | [
"MIT"
] | null | null | null | test/functional/feature_notifications.py | cisnes/PINECOIN | a0252cace17ecc1208a07368c0b893d3878459d8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the -alertnotify, -blocknotify and -walletnotify options."""
import os
from test_framework.addres... | 48.821918 | 152 | 0.670034 |
import os
from test_framework.address import ADDRESS_BCRT1_UNSPENDABLE
from test_framework.test_framework import PineCoinTestFramework
from test_framework.util import assert_equal, wait_until, connect_nodes_bi
class NotificationsTest(PineCoinTestFramework):
def set_test_params(self):
self.num_nodes =... | true | true |
f7246b36becdc63ea725194e371727a55e6be4c1 | 3,932 | py | Python | test/functional/test_framework/blocktools.py | tmiholdings/tmi | f1b6027f025dafc40616cde076df2f4b8cdae8a2 | [
"MIT"
] | null | null | null | test/functional/test_framework/blocktools.py | tmiholdings/tmi | f1b6027f025dafc40616cde076df2f4b8cdae8a2 | [
"MIT"
] | null | null | null | test/functional/test_framework/blocktools.py | tmiholdings/tmi | f1b6027f025dafc40616cde076df2f4b8cdae8a2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The TMIcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Utilities for manipulating blocks and transactions."""
from .mininode import *
from .script import CSc... | 35.423423 | 104 | 0.709054 |
from .mininode import *
from .script import CScript, OP_TRUE, OP_CHECKSIG, OP_RETURN
def create_block(hashprev, coinbase, nTime=None):
block = CBlock()
if nTime is None:
import time
block.nTime = int(time.time()+600)
else:
block.nTime = nTime
block.hashPrevBlock = hashprev... | true | true |
f7246bf98a05892332d4bb0c595fed3c4643f2dc | 2,401 | py | Python | src/pudl/__init__.py | erictleung/pudl | 32bfbf3a959114f766b630f5b873a93b7a930c71 | [
"MIT"
] | null | null | null | src/pudl/__init__.py | erictleung/pudl | 32bfbf3a959114f766b630f5b873a93b7a930c71 | [
"MIT"
] | null | null | null | src/pudl/__init__.py | erictleung/pudl | 32bfbf3a959114f766b630f5b873a93b7a930c71 | [
"MIT"
] | null | null | null | """The Public Utility Data Liberation (PUDL) Project."""
# Create a parent logger for all PUDL loggers to inherit from
import logging
import pkg_resources
import pudl.analysis.mcoe
import pudl.cli
import pudl.constants
import pudl.convert.datapkg_to_sqlite
import pudl.convert.epacems_to_parquet
import pudl.convert.f... | 35.835821 | 76 | 0.82299 |
import logging
import pkg_resources
import pudl.analysis.mcoe
import pudl.cli
import pudl.constants
import pudl.convert.datapkg_to_sqlite
import pudl.convert.epacems_to_parquet
import pudl.convert.ferc1_to_sqlite
import pudl.convert.flatten_datapkgs
import pudl.etl
import pudl.extract.eia860
import pudl.extract.eia... | true | true |
f7246c03ec5401f98478d3072cffa65821a40e6d | 5,510 | py | Python | test/functional/p2p_disconnect_ban.py | Simple-Software-Solutions/RBX-Core | 8cf0dfda708233e080e8729cec0b5014218386e3 | [
"MIT"
] | null | null | null | test/functional/p2p_disconnect_ban.py | Simple-Software-Solutions/RBX-Core | 8cf0dfda708233e080e8729cec0b5014218386e3 | [
"MIT"
] | null | null | null | test/functional/p2p_disconnect_ban.py | Simple-Software-Solutions/RBX-Core | 8cf0dfda708233e080e8729cec0b5014218386e3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test node disconnect and ban behavior"""
import time
from test_framework.test_framework import RbxTest... | 48.333333 | 156 | 0.659891 |
import time
from test_framework.test_framework import RbxTestFramework
from test_framework.util import (
assert_equal,
connect_nodes,
assert_raises_rpc_error,
wait_until,
)
class DisconnectBanTest(RbxTestFramework):
def set_test_params(self):
self.num_nodes = 2
def run_test(self):... | true | true |
f7246cc917719e28deb7b06b6817fd9d7b3f055b | 1,758 | py | Python | core/src/zeit/edit/browser/resources.py | rickdg/vivi | 16134ac954bf8425646d4ad47bdd1f372e089355 | [
"BSD-3-Clause"
] | 5 | 2019-05-16T09:51:29.000Z | 2021-05-31T09:30:03.000Z | core/src/zeit/edit/browser/resources.py | rickdg/vivi | 16134ac954bf8425646d4ad47bdd1f372e089355 | [
"BSD-3-Clause"
] | 107 | 2019-05-24T12:19:02.000Z | 2022-03-23T15:05:56.000Z | core/src/zeit/edit/browser/resources.py | rickdg/vivi | 16134ac954bf8425646d4ad47bdd1f372e089355 | [
"BSD-3-Clause"
] | 3 | 2020-08-14T11:01:17.000Z | 2022-01-08T17:32:19.000Z | from zeit.cms.browser.resources import SplitDirResource, Library
import zeit.cms.browser.resources
import zeit.find.browser.resources
lib_css = Library('zeit.edit', 'resources')
lib_js = Library('zeit.edit.js', 'js')
SplitDirResource('editor.css')
SplitDirResource('fold.js', depends=[zeit.cms.browser.resources.base... | 27.046154 | 70 | 0.713879 | from zeit.cms.browser.resources import SplitDirResource, Library
import zeit.cms.browser.resources
import zeit.find.browser.resources
lib_css = Library('zeit.edit', 'resources')
lib_js = Library('zeit.edit.js', 'js')
SplitDirResource('editor.css')
SplitDirResource('fold.js', depends=[zeit.cms.browser.resources.base... | true | true |
f7246cd07aed951d4878742924bcbfb2fe5565c2 | 329 | py | Python | factioncli/commands/credentials.py | joncave/CLI | e12113594574bd4ca112895c6df59d1ae1c2094f | [
"BSD-3-Clause"
] | null | null | null | factioncli/commands/credentials.py | joncave/CLI | e12113594574bd4ca112895c6df59d1ae1c2094f | [
"BSD-3-Clause"
] | null | null | null | factioncli/commands/credentials.py | joncave/CLI | e12113594574bd4ca112895c6df59d1ae1c2094f | [
"BSD-3-Clause"
] | null | null | null | from cliff.lister import Lister
from factioncli.processing.config import get_passwords
class Credentials(Lister):
"Returns a list of the default credentials for this instance of Faction"
def take_action(self, parsed_args):
passwords = get_passwords()
return ("Type", "Username", "Password"), p... | 29.909091 | 76 | 0.738602 | from cliff.lister import Lister
from factioncli.processing.config import get_passwords
class Credentials(Lister):
def take_action(self, parsed_args):
passwords = get_passwords()
return ("Type", "Username", "Password"), passwords
| true | true |
f7246fb1d3475e6a8f8ea2b2fd45ec7d3e10c62f | 16,568 | py | Python | venv/Lib/site-packages/scipy/sparse/linalg/tests/test_interface.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 353 | 2020-12-10T10:47:17.000Z | 2022-03-31T23:08:29.000Z | venv/Lib/site-packages/scipy/sparse/linalg/tests/test_interface.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 80 | 2020-12-10T09:54:22.000Z | 2022-03-30T22:08:45.000Z | venv/Lib/site-packages/scipy/sparse/linalg/tests/test_interface.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 63 | 2020-12-10T17:10:34.000Z | 2022-03-28T16:27:07.000Z | """Test functions for the sparse.linalg.interface module
"""
from functools import partial
from itertools import product
import operator
import pytest
from pytest import raises as assert_raises, warns
from numpy.testing import assert_, assert_equal
import numpy as np
import scipy.sparse as sparse
from scipy.sparse.l... | 36.736142 | 78 | 0.506639 |
from functools import partial
from itertools import product
import operator
import pytest
from pytest import raises as assert_raises, warns
from numpy.testing import assert_, assert_equal
import numpy as np
import scipy.sparse as sparse
from scipy.sparse.linalg import interface
from scipy.sparse.sputils import matri... | true | true |
f7246fd41a52c4c852543dc3cdc9672346ec9dbe | 6,333 | py | Python | doc/source/conf.py | gaohao95/cffi | 8d1a4ec54db0f3f0e18e4a68c2bdc7f32d0fdd8b | [
"MIT"
] | 1 | 2017-01-05T00:59:03.000Z | 2017-01-05T00:59:03.000Z | doc/source/conf.py | gaohao95/cffi | 8d1a4ec54db0f3f0e18e4a68c2bdc7f32d0fdd8b | [
"MIT"
] | null | null | null | doc/source/conf.py | gaohao95/cffi | 8d1a4ec54db0f3f0e18e4a68c2bdc7f32d0fdd8b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# CFFI documentation build configuration file, created by
# sphinx-quickstart on Thu Jun 14 16:37:47 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All co... | 32.476923 | 80 | 0.722722 |
import sys, os
extensions = ['sphinx.ext.autodoc']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'CFFI'
copyright = u'2012-2015, Armin Rigo, Maciej Fijalkowski'
# |version| and |release|, also used in various other places throughout the
# buil... | true | true |
f72470edb12a542373c15f2c30a033702b46467a | 1,325 | py | Python | tests/test_erd.py | Datateer/erd-python | 528b876bf5adf6114cd1e0aac6a2be14006fd2eb | [
"MIT"
] | 1 | 2021-09-13T06:05:48.000Z | 2021-09-13T06:05:48.000Z | tests/test_erd.py | Datateer/erd-python | 528b876bf5adf6114cd1e0aac6a2be14006fd2eb | [
"MIT"
] | 2 | 2021-01-22T11:20:34.000Z | 2022-01-18T07:20:09.000Z | tests/test_erd.py | Datateer/erd-python | 528b876bf5adf6114cd1e0aac6a2be14006fd2eb | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Tests for `erd` package."""
import unittest
from click.testing import CliRunner
from erd import erd
from erd import cli
class TestErd(unittest.TestCase):
"""Tests for `erd` package."""
def setUp(self):
"""Set up test fixtures, if any."""
def tearDown(self):
"... | 25.980392 | 74 | 0.658113 |
import unittest
from click.testing import CliRunner
from erd import erd
from erd import cli
class TestErd(unittest.TestCase):
def setUp(self):
def tearDown(self):
def test_000_something(self):
def test_command_line_interface(self):
runner = CliRunner()
result = runner.invoke(c... | true | true |
f7247100061d6774afb40c4bea380d62cdfa96b7 | 11,258 | py | Python | modnet/matbench/benchmark.py | sparks-baird/modnet | 2b4a88aa8a3323756b6daee52450569cddd0068b | [
"MIT"
] | 32 | 2020-05-22T11:47:37.000Z | 2022-03-28T12:55:40.000Z | modnet/matbench/benchmark.py | sparks-baird/modnet | 2b4a88aa8a3323756b6daee52450569cddd0068b | [
"MIT"
] | 43 | 2020-06-12T21:09:15.000Z | 2022-03-28T21:05:43.000Z | modnet/matbench/benchmark.py | sparks-baird/modnet | 2b4a88aa8a3323756b6daee52450569cddd0068b | [
"MIT"
] | 22 | 2020-06-19T12:03:02.000Z | 2022-01-17T16:13:38.000Z | import os
from collections import defaultdict
from traceback import print_exc
from typing import List, Dict, Any, Optional, Tuple, Type
import numpy as np
from modnet.preprocessing import MODData
from modnet.models import MODNetModel
from modnet.utils import LOG
from modnet.hyper_opt import FitGenetic
MATBENCH_SEED ... | 34.012085 | 110 | 0.618671 | import os
from collections import defaultdict
from traceback import print_exc
from typing import List, Dict, Any, Optional, Tuple, Type
import numpy as np
from modnet.preprocessing import MODData
from modnet.models import MODNetModel
from modnet.utils import LOG
from modnet.hyper_opt import FitGenetic
MATBENCH_SEED ... | true | true |
f7247128248055fc8b3fc7e0f99d36f794357c24 | 5,958 | py | Python | utils/evaluation.py | lippman1125/pytorch_FAN | ffc9c968478d55cb0c75c062bb8774923f961110 | [
"BSD-3-Clause"
] | 58 | 2019-03-14T20:13:10.000Z | 2022-03-17T07:59:34.000Z | utils/evaluation.py | lippman1125/pytorch_FAN | ffc9c968478d55cb0c75c062bb8774923f961110 | [
"BSD-3-Clause"
] | 7 | 2019-03-29T05:13:39.000Z | 2021-02-08T23:00:32.000Z | utils/evaluation.py | lippman1125/pytorch_FAN | ffc9c968478d55cb0c75c062bb8774923f961110 | [
"BSD-3-Clause"
] | 8 | 2019-05-29T09:05:32.000Z | 2022-03-12T17:00:02.000Z | from __future__ import absolute_import, print_function
import math
import numpy as np
import matplotlib.pyplot as plt
from random import randint
from .misc import *
from .transforms import transform, transform_preds
__all__ = ['accuracy', 'AverageMeter']
def get_preds(scores):
''' get predictions from score ma... | 31.193717 | 100 | 0.553206 | from __future__ import absolute_import, print_function
import math
import numpy as np
import matplotlib.pyplot as plt
from random import randint
from .misc import *
from .transforms import transform, transform_preds
__all__ = ['accuracy', 'AverageMeter']
def get_preds(scores):
assert scores.dim() == 4, 'Score ... | true | true |
f72471beb538717956885400bdf193fde9f2aea9 | 5,531 | py | Python | api/routes/admin/admin_student_routes.py | NoisyBotDude/MIS-Backend | fa402b0a6d5d6862634b0ed55bc57178856c1eba | [
"MIT"
] | null | null | null | api/routes/admin/admin_student_routes.py | NoisyBotDude/MIS-Backend | fa402b0a6d5d6862634b0ed55bc57178856c1eba | [
"MIT"
] | null | null | null | api/routes/admin/admin_student_routes.py | NoisyBotDude/MIS-Backend | fa402b0a6d5d6862634b0ed55bc57178856c1eba | [
"MIT"
] | null | null | null | from fileinput import filename
from urllib.request import Request
from api.drivers import student
from api.drivers.student import student_drivers
from api.middlewares import authentication_middleware
from api.schemas.admin.admin_request_schema import admin_request_schemas
from api.schemas.student.request_schemas impor... | 31.248588 | 85 | 0.605496 | from fileinput import filename
from urllib.request import Request
from api.drivers import student
from api.drivers.student import student_drivers
from api.middlewares import authentication_middleware
from api.schemas.admin.admin_request_schema import admin_request_schemas
from api.schemas.student.request_schemas impor... | true | true |
f724734a995b0486052f20cb0dc53813c6e312e3 | 6,915 | py | Python | analysis/views/views_karyomapping.py | SACGF/variantgrid | 515195e2f03a0da3a3e5f2919d8e0431babfd9c9 | [
"RSA-MD"
] | 5 | 2021-01-14T03:34:42.000Z | 2022-03-07T15:34:18.000Z | analysis/views/views_karyomapping.py | SACGF/variantgrid | 515195e2f03a0da3a3e5f2919d8e0431babfd9c9 | [
"RSA-MD"
] | 551 | 2020-10-19T00:02:38.000Z | 2022-03-30T02:18:22.000Z | analysis/views/views_karyomapping.py | SACGF/variantgrid | 515195e2f03a0da3a3e5f2919d8e0431babfd9c9 | [
"RSA-MD"
] | null | null | null | import csv
from collections import defaultdict, OrderedDict
from django.core.exceptions import PermissionDenied
from django.http.response import StreamingHttpResponse
from django.shortcuts import get_object_or_404, render, redirect
from django.urls.base import reverse
from django.views.decorators.cache import cache_pa... | 43.21875 | 128 | 0.707881 | import csv
from collections import defaultdict, OrderedDict
from django.core.exceptions import PermissionDenied
from django.http.response import StreamingHttpResponse
from django.shortcuts import get_object_or_404, render, redirect
from django.urls.base import reverse
from django.views.decorators.cache import cache_pa... | true | true |
f724736b6941b37c7e6fc68854f6f1512721115e | 1,762 | py | Python | CondTools/IntegrationTest/python/validate_dt_devdb10_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | CondTools/IntegrationTest/python/validate_dt_devdb10_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | CondTools/IntegrationTest/python/validate_dt_devdb10_cfg.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | # The following comments couldn't be translated into the new config version:
# Configuration file for EventSetupTest_t
import FWCore.ParameterSet.Config as cms
process = cms.Process("TEST")
process.PoolDBESSource = cms.ESSource("PoolDBESSource",
loadAll = cms.bool(True),
toGet = cms.VPSet(cms.PSet(
r... | 30.37931 | 118 | 0.641317 |
# Configuration file for EventSetupTest_t
import FWCore.ParameterSet.Config as cms
process = cms.Process("TEST")
process.PoolDBESSource = cms.ESSource("PoolDBESSource",
loadAll = cms.bool(True),
toGet = cms.VPSet(cms.PSet(
record = cms.string('DTT0Rcd'),
tag = cms.string('MTCC_t0')
),
... | true | true |
f724739e7899ac5f3fc808e74a2261f63bf6be67 | 2,010 | py | Python | 3_text/apache_log_parser_split.py | lluxury/P_U_S_A | 1eb9d1fef74f9ce3618ae950f5223f598510be84 | [
"MIT"
] | null | null | null | 3_text/apache_log_parser_split.py | lluxury/P_U_S_A | 1eb9d1fef74f9ce3618ae950f5223f598510be84 | [
"MIT"
] | null | null | null | 3_text/apache_log_parser_split.py | lluxury/P_U_S_A | 1eb9d1fef74f9ce3618ae950f5223f598510be84 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
USAGE:
apache_log_parser_split.py some_log_file
This script takes one command line argument: the name of a log file
to parse. It then parses the log file and generates a report which
associates remote hosts with number of bytes transferred to them.
"""
import sys
def dictify_logline(line... | 30.454545 | 83 | 0.676617 |
import sys
def dictify_logline(line):
split_line = line.split()
return {'remote_host': split_line[0],
'status': split_line[8],
'bytes_sent': split_line[9],
}
def generate_log_report(logfile):
report_dict = {}
for line in logfile:
line_dict = dictify_logline(line)... | true | true |
f724743cde7860172ea7e6028c7280410480dec1 | 7,225 | py | Python | thx_bot/integration_conversations.py | thxprotocol/telegram-bot | d8c77060740f76ed50aab93cb7c6ca83567d1710 | [
"Apache-2.0"
] | null | null | null | thx_bot/integration_conversations.py | thxprotocol/telegram-bot | d8c77060740f76ed50aab93cb7c6ca83567d1710 | [
"Apache-2.0"
] | null | null | null | thx_bot/integration_conversations.py | thxprotocol/telegram-bot | d8c77060740f76ed50aab93cb7c6ca83567d1710 | [
"Apache-2.0"
] | 3 | 2021-10-31T19:20:39.000Z | 2021-12-04T03:35:23.000Z | from telegram.ext import CommandHandler
from telegram.ext import ConversationHandler
from telegram.ext import Filters
from telegram.ext import MessageHandler
from thx_bot.commands import CHOOSING
from thx_bot.commands import CHOOSING_ADD_MEMBER
from thx_bot.commands import CHOOSING_REWARDS
from thx_bot.commands import... | 37.827225 | 97 | 0.701315 | from telegram.ext import CommandHandler
from telegram.ext import ConversationHandler
from telegram.ext import Filters
from telegram.ext import MessageHandler
from thx_bot.commands import CHOOSING
from thx_bot.commands import CHOOSING_ADD_MEMBER
from thx_bot.commands import CHOOSING_REWARDS
from thx_bot.commands import... | true | true |
f72474b80565c33b2edda35cd6580c085dbf16da | 17,832 | py | Python | pybind/nos/v6_0_2c/rbridge_id/router/router_bgp/router_bgp_attributes/neighbor/peer_grps/neighbor_peer_grp/update_source/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/nos/v6_0_2c/rbridge_id/router/router_bgp/router_bgp_attributes/neighbor/peer_grps/neighbor_peer_grp/update_source/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/nos/v6_0_2c/rbridge_id/router/router_bgp/router_bgp_attributes/neighbor/peer_grps/neighbor_peer_grp/update_source/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | 1 | 2021-11-05T22:15:42.000Z | 2021-11-05T22:15:42.000Z |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | 77.868996 | 648 | 0.730316 |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | true | true |
f72475dc8fb021a442a84a5e411f00ab6c251ab0 | 1,015 | py | Python | mud.py | nparry0/mud | ec520795e2206d5e885c343c13e3ead5d2787cd5 | [
"MIT"
] | 2 | 2018-03-15T06:00:18.000Z | 2018-03-22T03:19:38.000Z | mud.py | nparry0/mud | ec520795e2206d5e885c343c13e3ead5d2787cd5 | [
"MIT"
] | null | null | null | mud.py | nparry0/mud | ec520795e2206d5e885c343c13e3ead5d2787cd5 | [
"MIT"
] | null | null | null | import gevent.server
from mud_telnet_handler import MudTelnetHandler
from game_server import GameServer
import argparse
import logging
# Set up logging
log = logging.getLogger()
handler = logging.StreamHandler()
formatter = logging.Formatter('[%(asctime)s] [%(levelname)s] %(message)s')
handler.setFormatter(formatter)
... | 32.741935 | 114 | 0.770443 | import gevent.server
from mud_telnet_handler import MudTelnetHandler
from game_server import GameServer
import argparse
import logging
log = logging.getLogger()
handler = logging.StreamHandler()
formatter = logging.Formatter('[%(asctime)s] [%(levelname)s] %(message)s')
handler.setFormatter(formatter)
log.addHandler(h... | true | true |
f724762d197c2f0292cdab0ed9ca4350acb293d2 | 37,046 | py | Python | allauth/account/tests.py | pkyad/django-allauth | 1ffd9c2c4a121b9cdcb5814209933ce74d4303c5 | [
"MIT"
] | null | null | null | allauth/account/tests.py | pkyad/django-allauth | 1ffd9c2c4a121b9cdcb5814209933ce74d4303c5 | [
"MIT"
] | null | null | null | allauth/account/tests.py | pkyad/django-allauth | 1ffd9c2c4a121b9cdcb5814209933ce74d4303c5 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
import json
from datetime import timedelta
import django
from django.utils.timezone import now
from django.test.utils import override_settings
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test.client import Client
from django.core imp... | 40.093074 | 95 | 0.582195 | from __future__ import absolute_import
import json
from datetime import timedelta
import django
from django.utils.timezone import now
from django.test.utils import override_settings
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test.client import Client
from django.core imp... | true | true |
f72476a51168fd61ef40256da67527b38bad600a | 5,368 | py | Python | core/cache/decorator.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 84 | 2017-10-22T11:01:39.000Z | 2022-02-27T03:43:48.000Z | core/cache/decorator.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 22 | 2017-12-11T07:21:56.000Z | 2021-09-23T02:53:50.000Z | core/cache/decorator.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 23 | 2017-12-06T06:59:52.000Z | 2022-02-24T00:02:25.000Z | # ----------------------------------------------------------------------
# Decorators
# ----------------------------------------------------------------------
# Copyright (C) 2007-2020 The NOC Project
# See LICENSE for details
# ----------------------------------------------------------------------
# NOC modules
from ... | 39.182482 | 97 | 0.404434 |
from noc.core.perf import metrics
from .base import cache as x_cache
def cachedmethod(cache=None, key="cache-%s", lock=None, ttl=None, version=0):
def decorator(method):
if lock:
def wrapper(self, *args, **kwargs):
perf_key = key.replace("-%s", "").replace("-", "_")
... | true | true |
f72476bf2e961b26c53e96e9358bb4c0a54239b7 | 8,355 | py | Python | tron/Vocab/hubCommands.py | sdss/tron | 886c5c5fb6341ad85e4a9f5d6f5ecb6bbc0d8322 | [
"BSD-3-Clause"
] | null | null | null | tron/Vocab/hubCommands.py | sdss/tron | 886c5c5fb6341ad85e4a9f5d6f5ecb6bbc0d8322 | [
"BSD-3-Clause"
] | null | null | null | tron/Vocab/hubCommands.py | sdss/tron | 886c5c5fb6341ad85e4a9f5d6f5ecb6bbc0d8322 | [
"BSD-3-Clause"
] | null | null | null | __all__ = ['hubCommands']
import sys
import Vocab.InternalCmd as InternalCmd
from tron import Misc, g, hub
from tron.Hub.KV.KVDict import kvAsASCII
class hubCommands(InternalCmd.InternalCmd):
""" All the commands that the "hub" package provides.
The user executes these from the command window:
hub st... | 30.830258 | 95 | 0.518971 | __all__ = ['hubCommands']
import sys
import Vocab.InternalCmd as InternalCmd
from tron import Misc, g, hub
from tron.Hub.KV.KVDict import kvAsASCII
class hubCommands(InternalCmd.InternalCmd):
def __init__(self, **argv):
argv['safeCmds'] = r'^\s*(actors|commanders|actorInfo|version|status|ping)\s*$'
... | true | true |
f7247748c768db7db41eded5f66dc4d97b47480c | 964 | py | Python | mats/model/components/gmm2d.py | StanfordASL/MATS | b31a86eb56728fc6025c71c7202ab425b078e3e5 | [
"MIT"
] | 21 | 2020-12-03T05:27:19.000Z | 2022-01-18T02:24:22.000Z | mats/model/components/gmm2d.py | StanfordASL/MATS | b31a86eb56728fc6025c71c7202ab425b078e3e5 | [
"MIT"
] | 1 | 2022-03-29T14:51:51.000Z | 2022-03-29T14:51:51.000Z | mats/model/components/gmm2d.py | StanfordASL/MATS | b31a86eb56728fc6025c71c7202ab425b078e3e5 | [
"MIT"
] | 5 | 2021-01-09T18:12:47.000Z | 2022-03-22T11:45:56.000Z | import torch
import torch.distributions as td
class GMM2D(td.MixtureSameFamily):
def __init__(self, mixture_distribution, component_distribution):
super(GMM2D, self).__init__(mixture_distribution, component_distribution)
def mode_mode(self):
mode_k = torch.argmax(self.mixture_distribution.pro... | 40.166667 | 110 | 0.691909 | import torch
import torch.distributions as td
class GMM2D(td.MixtureSameFamily):
def __init__(self, mixture_distribution, component_distribution):
super(GMM2D, self).__init__(mixture_distribution, component_distribution)
def mode_mode(self):
mode_k = torch.argmax(self.mixture_distribution.pro... | true | true |
f72477b35e362dbce3d14f182fe8455bd0352f5f | 3,916 | py | Python | ironic/objects/base.py | hpproliant/ironic | 4f62cd97196b2a0068700ffb17456912147778d0 | [
"Apache-2.0"
] | null | null | null | ironic/objects/base.py | hpproliant/ironic | 4f62cd97196b2a0068700ffb17456912147778d0 | [
"Apache-2.0"
] | null | null | null | ironic/objects/base.py | hpproliant/ironic | 4f62cd97196b2a0068700ffb17456912147778d0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 IBM Corp.
#
# 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 agree... | 40.371134 | 78 | 0.687692 |
from oslo_versionedobjects import base as object_base
from ironic.objects import fields as object_fields
class IronicObjectRegistry(object_base.VersionedObjectRegistry):
pass
class IronicObject(object_base.VersionedObject):
OBJ_SERIAL_NAMESPACE = 'ironic_object'
OBJ_PROJECT_NAMESPACE = ... | true | true |
f7247810b61f545dbbf06766dccc172c15e03ef6 | 62,418 | py | Python | superset/db_engine_specs.py | emacip/incubator-superset | 594cd7096070a742209851ff9112d5bf4d16a7be | [
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | 1 | 2019-02-05T04:53:37.000Z | 2019-02-05T04:53:37.000Z | superset/db_engine_specs.py | mankoven/incubator-superset | bab7ee7ecf222250287e591d91b38be583c9a2f3 | [
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | 7 | 2021-02-02T23:08:19.000Z | 2022-03-29T22:28:16.000Z | superset/db_engine_specs.py | g4brielvs/incubator-superset | 83ee9178328c5193808fe356ceb3090a299477f6 | [
"Apache-2.0",
"CC-BY-4.0",
"MIT"
] | 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 (the
# "License"); you may not u... | 37.829091 | 126 | 0.594156 |
from collections import namedtuple
import hashlib
import inspect
import logging
import os
import re
import textwrap
import time
from flask import g
from flask_babel import lazy_gettext as _
import pandas
import sqlalchemy as sqla
from sqlalchemy import Column, select
from sqlalchemy.engine import crea... | true | true |
f724783584f78b08b18463f09ec4dd4c262a7666 | 2,714 | py | Python | lib/metrics.py | ppmdatix/rtdl | a01ecd9ae6b673f4e82e51f804ffd7031c7350a0 | [
"Apache-2.0"
] | 298 | 2021-06-22T15:41:18.000Z | 2022-03-09T07:52:30.000Z | lib/metrics.py | ppmdatix/rtdl | a01ecd9ae6b673f4e82e51f804ffd7031c7350a0 | [
"Apache-2.0"
] | 15 | 2021-07-27T05:39:21.000Z | 2022-02-25T11:33:32.000Z | lib/metrics.py | ppmdatix/rtdl | a01ecd9ae6b673f4e82e51f804ffd7031c7350a0 | [
"Apache-2.0"
] | 37 | 2021-06-25T03:56:37.000Z | 2022-03-10T11:07:51.000Z | import typing as ty
import numpy as np
import scipy.special
import sklearn.metrics as skm
from . import util
def calculate_metrics(
task_type: str,
y: np.ndarray,
prediction: np.ndarray,
classification_mode: str,
y_info: ty.Optional[ty.Dict[str, ty.Any]],
) -> ty.Dict[str, float]:
if task_ty... | 31.55814 | 93 | 0.507369 | import typing as ty
import numpy as np
import scipy.special
import sklearn.metrics as skm
from . import util
def calculate_metrics(
task_type: str,
y: np.ndarray,
prediction: np.ndarray,
classification_mode: str,
y_info: ty.Optional[ty.Dict[str, ty.Any]],
) -> ty.Dict[str, float]:
if task_ty... | true | true |
f724797778a03ff70b6b2d2cacc77e8f0dc791c8 | 1,451 | py | Python | api/tests.py | toast38coza/KongOAuth | 827d6f0cb47c67903f0a0236f56cd20c18bb84bb | [
"MIT"
] | null | null | null | api/tests.py | toast38coza/KongOAuth | 827d6f0cb47c67903f0a0236f56cd20c18bb84bb | [
"MIT"
] | null | null | null | api/tests.py | toast38coza/KongOAuth | 827d6f0cb47c67903f0a0236f56cd20c18bb84bb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TestCase, override_settings
from django.contrib.auth import get_user_model
import json
import responses
## responses:
def kong_login_success():
responses.add(
responses.POST,
'https://kong:8443/test/oauth2/toke... | 29.612245 | 123 | 0.637491 |
from __future__ import unicode_literals
from django.test import TestCase, override_settings
from django.contrib.auth import get_user_model
import json
import responses
gin_success():
responses.add(
responses.POST,
'https://kong:8443/test/oauth2/token',
body=json.dumps({'refresh_token': 'r... | true | true |
f7247a8886b4c59ba58b43b090bbe0a5d941f51a | 9,304 | py | Python | monai/transforms/__init__.py | marksgraham/MONAI | 42591511e9493fedd70af857344cc91073b867e8 | [
"Apache-2.0"
] | null | null | null | monai/transforms/__init__.py | marksgraham/MONAI | 42591511e9493fedd70af857344cc91073b867e8 | [
"Apache-2.0"
] | null | null | null | monai/transforms/__init__.py | marksgraham/MONAI | 42591511e9493fedd70af857344cc91073b867e8 | [
"Apache-2.0"
] | 1 | 2021-01-19T19:35:00.000Z | 2021-01-19T19:35:00.000Z | # Copyright 2020 - 2021 MONAI Consortium
# 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 wri... | 22.258373 | 103 | 0.725064 |
from .adaptors import FunctionSignature, adaptor, apply_alias, to_kwargs
from .compose import Compose
from .croppad.array import (
BorderPad,
BoundingRect,
CenterSpatialCrop,
CropForeground,
DivisiblePad,
RandCropByPosNegLabel,
RandSpatialCrop,
RandSpatialCropSamples,
Rand... | true | true |
f7247b2dbd9cf7eb773ad8e4856771996587a897 | 48 | py | Python | samcli/__init__.py | kylelaker/aws-sam-cli | d2917102ef56ac05b9973f96c716612f9638bb62 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | samcli/__init__.py | kylelaker/aws-sam-cli | d2917102ef56ac05b9973f96c716612f9638bb62 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | samcli/__init__.py | kylelaker/aws-sam-cli | d2917102ef56ac05b9973f96c716612f9638bb62 | [
"BSD-2-Clause",
"Apache-2.0"
] | null | null | null | """
SAM CLI version
"""
__version__ = "1.13.1"
| 8 | 22 | 0.583333 |
__version__ = "1.13.1"
| true | true |
f7247b7c5f90f8592a8c662974c56a475935ed18 | 1,394 | py | Python | 505 The Maze II.py | krishna13052001/LeetCode | cd6ec626bea61f0bd9e8493622074f9e69a7a1c3 | [
"MIT"
] | 872 | 2015-06-15T12:02:41.000Z | 2022-03-30T08:44:35.000Z | 505 The Maze II.py | nadeemshaikh-github/LeetCode | 3fb14aeea62a960442e47dfde9f964c7ffce32be | [
"MIT"
] | 8 | 2015-06-21T15:11:59.000Z | 2022-02-01T11:22:34.000Z | 505 The Maze II.py | nadeemshaikh-github/LeetCode | 3fb14aeea62a960442e47dfde9f964c7ffce32be | [
"MIT"
] | 328 | 2015-06-28T03:10:35.000Z | 2022-03-29T11:05:28.000Z | #!/usr/bin/python3
"""
premium question
"""
from typing import List
import heapq
dirs = [(0, -1), (0, 1), (-1, 0), (1, 0)]
class Solution:
def shortestDistance(self, maze: List[List[int]], start: List[int], destination: List[int]) -> int:
"""
No friction rolling ball
F[i][j][dir] = min ... | 28.44898 | 121 | 0.444763 |
from typing import List
import heapq
dirs = [(0, -1), (0, 1), (-1, 0), (1, 0)]
class Solution:
def shortestDistance(self, maze: List[List[int]], start: List[int], destination: List[int]) -> int:
m, n = len(maze), len(maze[0])
D = [[float("inf") for _ in range(n)] for _ in range(m)]
i,... | true | true |
f7247bcaf5d604756097f5b9a64dc5e8efcee241 | 1,801 | py | Python | src/augmented_pickle.py | opskrift/expman | 637bbef34d79ce03311889ce310797e78a9f7710 | [
"MIT"
] | null | null | null | src/augmented_pickle.py | opskrift/expman | 637bbef34d79ce03311889ce310797e78a9f7710 | [
"MIT"
] | 16 | 2021-08-04T12:08:00.000Z | 2021-09-12T13:01:27.000Z | src/augmented_pickle.py | opskrift/opskrift | 637bbef34d79ce03311889ce310797e78a9f7710 | [
"MIT"
] | null | null | null | """
Suppose you have some input data sources `data_in` on which you apply some process `F` parameterized by `args`:
data_out = F(data_in, args)
You want to serialize `data_out`, but also don't want to lose `args`,
to preserve the exact setup that generated the output data.
Now suppose you want to inspect `args` ... | 27.287879 | 111 | 0.675736 |
import pickle
from os import PathLike
from typing import Any, Iterable, Union
def write_augmented_pickle(
metadata: Any,
body: Any,
path: Union[str, PathLike],
) -> None:
with open(path, "wb") as fp:
pickle.dump(metadata, fp)
pickle.dump(body, fp)
def read_augmented_pickle(
pat... | true | true |
f7247d937c3d515dd43275659017e44fc03cb44c | 1,247 | py | Python | crawling/crawler.py | LukasTinnes/sPyRat | 42e012e426befa3876e590be2ea83874d5351d12 | [
"Unlicense"
] | null | null | null | crawling/crawler.py | LukasTinnes/sPyRat | 42e012e426befa3876e590be2ea83874d5351d12 | [
"Unlicense"
] | 3 | 2022-02-07T19:53:47.000Z | 2022-02-13T19:51:33.000Z | crawling/crawler.py | LukasTinnes/sPyRat | 42e012e426befa3876e590be2ea83874d5351d12 | [
"Unlicense"
] | null | null | null | from abc import abstractmethod
from crawling.crawler_data_structures.crawl_data import CrawlData
class Crawler:
"""
An abstract class for other Crawlers to inherit from.
A Crawler should open a given file and attempt to find an associated file pattern at every byte in the given file.
"""
@abstrac... | 31.175 | 118 | 0.623095 | from abc import abstractmethod
from crawling.crawler_data_structures.crawl_data import CrawlData
class Crawler:
@abstractmethod
def crawl(self, file: str) -> CrawlData:
...
@abstractmethod
def crawl_in_range(self, file: str, start_byte: int, end_byte: int) -> CrawlData:
...
@abs... | true | true |
f7247d9b14431ca407254cad9d929acd151162dc | 9,493 | py | Python | docs/conf.py | benedikt-mangold/obfuscate | 4e51b3c3c6d3d869a742f036234632c77cebcb54 | [
"MIT"
] | null | null | null | docs/conf.py | benedikt-mangold/obfuscate | 4e51b3c3c6d3d869a742f036234632c77cebcb54 | [
"MIT"
] | 1 | 2021-06-01T14:48:09.000Z | 2021-06-01T14:48:09.000Z | docs/conf.py | benedikt-mangold/obfuscate | 4e51b3c3c6d3d869a742f036234632c77cebcb54 | [
"MIT"
] | null | null | null | # This file is execfile()d with the current directory set to its containing dir.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
#
# All configuration values have a default; values that are comme... | 33.54417 | 89 | 0.696092 |
import os
import sys
import inspect
import shutil
__location__ = os.path.join(
os.getcwd(), os.path.dirname(inspect.getfile(inspect.currentframe()))
)
sys.path.insert(0, os.path.join(__location__, "../src"))
# setup.py install" in the RTD Advanced Settings.
# Additionally it helps us to avoid ... | true | true |
f7247db16c62de200bc2c5deee5c7ca83220e585 | 4,738 | py | Python | test/streams.py | gonsp/LotterySampling | 92ff14f602c05d747708b522cf05b9f9066c43e0 | [
"MIT"
] | 4 | 2020-06-03T15:17:28.000Z | 2020-09-29T20:52:15.000Z | test/streams.py | gonsp/LotterySampling | 92ff14f602c05d747708b522cf05b9f9066c43e0 | [
"MIT"
] | null | null | null | test/streams.py | gonsp/LotterySampling | 92ff14f602c05d747708b522cf05b9f9066c43e0 | [
"MIT"
] | null | null | null | import itertools
import math
import numpy as np
from abc import abstractmethod
from io import TextIOWrapper
from sorted_list import SortedList
class Stream():
def __init__(self, length, save=True):
self.length = length
self.N = 0
self.n = 0
self.save = save
self.elements =... | 27.387283 | 154 | 0.580625 | import itertools
import math
import numpy as np
from abc import abstractmethod
from io import TextIOWrapper
from sorted_list import SortedList
class Stream():
def __init__(self, length, save=True):
self.length = length
self.N = 0
self.n = 0
self.save = save
self.elements =... | true | true |
f7247e8a17813fa402740c3c525d9fef0664b3d9 | 116 | py | Python | web-app/backend/apps/common/routes/__init__.py | titoeb/kfserving | b072a76842b57e904dbdf46a136474a22051500d | [
"Apache-2.0"
] | 47 | 2022-01-02T09:59:15.000Z | 2022-01-25T11:11:17.000Z | web-app/backend/apps/common/routes/__init__.py | titoeb/kfserving | b072a76842b57e904dbdf46a136474a22051500d | [
"Apache-2.0"
] | 7 | 2021-08-31T23:55:06.000Z | 2022-03-02T11:34:58.000Z | web-app/backend/apps/common/routes/__init__.py | titoeb/kfserving | b072a76842b57e904dbdf46a136474a22051500d | [
"Apache-2.0"
] | 4 | 2022-01-27T08:59:15.000Z | 2022-02-27T14:42:19.000Z | from flask import Blueprint
bp = Blueprint("base_routes", __name__)
from . import delete, get # noqa: F401, E402
| 19.333333 | 45 | 0.732759 | from flask import Blueprint
bp = Blueprint("base_routes", __name__)
from . import delete, get
| true | true |
f7247ef6bd54462db7b045b5ea78324bc3752082 | 256 | py | Python | sessioncontroller/settings.py | synteny/AuroraBot | 179919e1e6cc5f24d9cf3e9295d0f043174a6169 | [
"MIT"
] | 2 | 2015-11-27T11:08:24.000Z | 2018-03-21T15:35:08.000Z | sessioncontroller/settings.py | synteny/AuroraBot | 179919e1e6cc5f24d9cf3e9295d0f043174a6169 | [
"MIT"
] | 2 | 2015-10-27T15:06:09.000Z | 2015-10-28T12:53:12.000Z | sessioncontroller/settings.py | synteny/AuroraBot | 179919e1e6cc5f24d9cf3e9295d0f043174a6169 | [
"MIT"
] | null | null | null | import os
TELEGRAM_TOKEN = os.environ['TELEGRAM_TOKEN']
DATABASE = {
'HOST': os.getenv('DB_PORT_3306_TCP_ADDR', 'localhost'),
'USER': os.getenv('DB_MYSQL_USER', 'root'),
'PASSWORD': os.getenv('DB_MYSQL_PASSWORD', ''),
'NAME': 'aurora',
}
| 23.272727 | 60 | 0.652344 | import os
TELEGRAM_TOKEN = os.environ['TELEGRAM_TOKEN']
DATABASE = {
'HOST': os.getenv('DB_PORT_3306_TCP_ADDR', 'localhost'),
'USER': os.getenv('DB_MYSQL_USER', 'root'),
'PASSWORD': os.getenv('DB_MYSQL_PASSWORD', ''),
'NAME': 'aurora',
}
| true | true |
f7247f14b21d4ad2ba934ab6dab587b66188f368 | 8,305 | py | Python | fpn/operator_py/fpn_roi_pooling.py | CosmosHua/Deformable-ConvNets | 6aeda878a95bcb55eadffbe125804e730574de8d | [
"MIT"
] | 3,976 | 2017-05-05T13:48:27.000Z | 2022-03-30T13:37:48.000Z | fpn/operator_py/fpn_roi_pooling.py | CosmosHua/Deformable-ConvNets | 6aeda878a95bcb55eadffbe125804e730574de8d | [
"MIT"
] | 259 | 2017-05-06T13:30:11.000Z | 2022-03-16T14:11:16.000Z | fpn/operator_py/fpn_roi_pooling.py | CosmosHua/Deformable-ConvNets | 6aeda878a95bcb55eadffbe125804e730574de8d | [
"MIT"
] | 1,051 | 2017-05-05T14:55:57.000Z | 2022-03-23T01:02:47.000Z | # --------------------------------------------------------
# Deformable Convolutional Networks
# Copyright (c) 2017 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Modified by Haozhi Qi, Yuwen Xiong
# --------------------------------------------------------
import mxnet as mx
import numpy as np
... | 56.114865 | 184 | 0.593618 |
import mxnet as mx
import numpy as np
from mxnet.contrib import autograd
import gc
class FPNROIPoolingOperator(mx.operator.CustomOp):
def __init__(self, feat_strides, pooled_height, pooled_width, output_dim, with_deformable):
self.pooled_height = pooled_height
self.pooled_width = pooled_wid... | true | true |
f7247f42ef9c871c8ebd07fc747da69ad689d3a3 | 405 | py | Python | 05/iterator_example.py | alissonit/pythontrap | b7780913d49af2142be4a9674ac435e2a67da201 | [
"MIT"
] | null | null | null | 05/iterator_example.py | alissonit/pythontrap | b7780913d49af2142be4a9674ac435e2a67da201 | [
"MIT"
] | null | null | null | 05/iterator_example.py | alissonit/pythontrap | b7780913d49af2142be4a9674ac435e2a67da201 | [
"MIT"
] | 1 | 2021-03-15T18:26:14.000Z | 2021-03-15T18:26:14.000Z | #CONSTRUINDO UMA CLASSE ITERATOR
class GenItem(object):
def __init__(self, first, last):
self.first = first
self.last = last
def __iter__(self):
return self
def __next__(self):
if self.first > self.last:
raise StopIteration
else:
self.first +... | 22.5 | 36 | 0.577778 |
class GenItem(object):
def __init__(self, first, last):
self.first = first
self.last = last
def __iter__(self):
return self
def __next__(self):
if self.first > self.last:
raise StopIteration
else:
self.first += 1
return self.firs... | true | true |
f72480521f1fad6394a1656241b51fbd1c7d3230 | 14,939 | py | Python | Lib/site-packages/wx-3.0-msw/wx/lib/gridmovers.py | jickieduan/python27 | c752b552396bbed68d8555080d475718cea2edd0 | [
"bzip2-1.0.6"
] | 1 | 2021-02-13T22:40:50.000Z | 2021-02-13T22:40:50.000Z | Lib/site-packages/wx-3.0-msw/wx/lib/gridmovers.py | jickieduan/python27 | c752b552396bbed68d8555080d475718cea2edd0 | [
"bzip2-1.0.6"
] | 1 | 2018-07-28T20:07:04.000Z | 2018-07-30T18:28:34.000Z | Lib/site-packages/wx-3.0-msw/wx/lib/gridmovers.py | jickieduan/python27 | c752b552396bbed68d8555080d475718cea2edd0 | [
"bzip2-1.0.6"
] | 2 | 2019-12-02T01:39:10.000Z | 2021-02-13T22:41:00.000Z | #----------------------------------------------------------------------------
# Name: GridColMover.py
# Purpose: Grid Column Mover Extension
#
# Author: Gerrit van Dyk (email: gerritvd@decillion.net)
#
# Version 0.1
# Date: Nov 19, 2002
# RCS-ID: $Id$
# Licence: wxWindows lic... | 30.240891 | 77 | 0.522391 |
import wx
import wx.grid
wxEVT_COMMAND_GRID_COL_MOVE = wx.NewEventType()
wxEVT_COMMAND_GRID_ROW_MOVE = wx.NewEventType()
EVT_GRID_COL_MOVE = wx.PyEventBinder(wxEVT_COMMAND_GRID_COL_MOVE, 1)
EVT_GRID_ROW_MOVE = wx.PyEventBinder(wxEVT_COMMAND_GRID_ROW_MOVE, 1)
class GridColMoveEvent(w... | true | true |
f72480fcb8551a59e4a32a3f79265c45343d673d | 26,964 | py | Python | fair/forward.py | shaheen19/FAIR | 345c23b3d35918729e7aa49ecb39047494c48a6e | [
"Apache-2.0"
] | 1 | 2019-09-15T02:35:47.000Z | 2019-09-15T02:35:47.000Z | fair/forward.py | shaheen19/FAIR | 345c23b3d35918729e7aa49ecb39047494c48a6e | [
"Apache-2.0"
] | null | null | null | fair/forward.py | shaheen19/FAIR | 345c23b3d35918729e7aa49ecb39047494c48a6e | [
"Apache-2.0"
] | null | null | null | from __future__ import division
import inspect
import numpy as np
import warnings
from scipy.optimize import root
from .ancil import natural, cmip6_volcanic, cmip6_solar, historical_scaling
from .constants import molwt, lifetime, radeff
from .constants.general import M_ATMOS, ppm_gtc
from .defaults import carbon, ther... | 37.870787 | 83 | 0.528371 | from __future__ import division
import inspect
import numpy as np
import warnings
from scipy.optimize import root
from .ancil import natural, cmip6_volcanic, cmip6_solar, historical_scaling
from .constants import molwt, lifetime, radeff
from .constants.general import M_ATMOS, ppm_gtc
from .defaults import carbon, ther... | true | true |
f7248131aa87bcae1465dd9f6fc9da5036cc235d | 29,226 | py | Python | absl/flags/tests/_validators_test.py | mcx/abseil-py | 58ead8c22230a2493006fa0ab9f76776b6e7280f | [
"Apache-2.0"
] | 1,969 | 2017-04-24T22:21:29.000Z | 2022-03-30T13:27:09.000Z | absl/flags/tests/_validators_test.py | mcx/abseil-py | 58ead8c22230a2493006fa0ab9f76776b6e7280f | [
"Apache-2.0"
] | 111 | 2017-09-27T05:45:53.000Z | 2022-03-29T16:48:49.000Z | absl/flags/tests/_validators_test.py | mcx/abseil-py | 58ead8c22230a2493006fa0ab9f76776b6e7280f | [
"Apache-2.0"
] | 240 | 2017-09-26T01:18:10.000Z | 2022-03-31T06:24:40.000Z | # Copyright 2017 The Abseil Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 39.22953 | 80 | 0.685622 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import warnings
from absl.flags import _defines
from absl.flags import _exceptions
from absl.flags import _flagvalues
from absl.flags import _validators
from absl.testing import absltest
clas... | true | true |
f72481a010acb7f8d898500cf94f600286f5da8d | 64,856 | py | Python | pybit/__init__.py | leftcoastgeek/pybit | 3564bd08a5e34c95a15f8a03b100282ddffd3edf | [
"MIT"
] | null | null | null | pybit/__init__.py | leftcoastgeek/pybit | 3564bd08a5e34c95a15f8a03b100282ddffd3edf | [
"MIT"
] | null | null | null | pybit/__init__.py | leftcoastgeek/pybit | 3564bd08a5e34c95a15f8a03b100282ddffd3edf | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
pybit
------------------------
pybit is a lightweight and high-performance API connector for the
RESTful and WebSocket APIs of the Bybit exchange.
Documentation can be found at
https://github.com/verata-veritatis/pybit
:copyright: (c) 2020-2021 verata-veritatis
:license: MIT License
"""... | 33.691429 | 125 | 0.556926 |
import time
import hmac
import json
import logging
import threading
import requests
import websocket
from datetime import datetime as dt
from concurrent.futures import ThreadPoolExecutor
from .exceptions import FailedRequestError, InvalidRequestError
try:
from simplejson.errors import JSONDecodeError
except ... | true | true |
f72482536502a08c92fdd47d1959c93914af950f | 1,330 | py | Python | Competition Codes/packageFunction.py | Harrdy2018/2018-Huawei-Code-Craft | 62fa76c658746550b2e5c8ef059a5c748e93c06c | [
"Apache-2.0"
] | 1 | 2019-04-08T04:15:51.000Z | 2019-04-08T04:15:51.000Z | Competition Codes/packageFunction.py | Harrdy2018/2018-Huawei-Code-Craft | 62fa76c658746550b2e5c8ef059a5c748e93c06c | [
"Apache-2.0"
] | null | null | null | Competition Codes/packageFunction.py | Harrdy2018/2018-Huawei-Code-Craft | 62fa76c658746550b2e5c8ef059a5c748e93c06c | [
"Apache-2.0"
] | 2 | 2018-04-16T10:11:24.000Z | 2019-06-28T06:30:28.000Z | #coding=utf-8
def MultiplePackage(N,C,weight,value,num,physic):
'''
多重背包问题(每个物品都有次数限制)
:param N: 预测的虚拟机种类,如N=pre_num
:param C:输入文件是CPU,那么背包总容量就是MEM,如C=
:param weight: 每个物品的容量数组表示,如weight=[0,5,4,7,2,6]
:param value: 每个物品的价值数组表示,如value=[0,12,3,10,3,6]
:param num:每个物品的个数限制,如num=[0,2,4,1,5,3]
... | 35 | 69 | 0.52406 |
def MultiplePackage(N,C,weight,value,num,physic):
f=[[0 for col in range(C+1)] for row in range(N+1)]
for i in range(1,N+1):
for j in range(1,C+1):
max_num_i=min(j/weight[i],num[i])
f[i][j]=f[i-1][j]
for k in range(max_num_i+1):
... | true | true |
f72482abf2030cf6d190809b6914b9bdbeec552b | 3,074 | py | Python | users/migrations/0001_initial.py | SohailAQ/Rest_Alpha | 326009217f16164c7f4667e7b3dbb82e43cf2469 | [
"MIT"
] | null | null | null | users/migrations/0001_initial.py | SohailAQ/Rest_Alpha | 326009217f16164c7f4667e7b3dbb82e43cf2469 | [
"MIT"
] | null | null | null | users/migrations/0001_initial.py | SohailAQ/Rest_Alpha | 326009217f16164c7f4667e7b3dbb82e43cf2469 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.8 on 2021-10-21 16:43
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_m... | 65.404255 | 329 | 0.656474 |
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
]
operations = [
... | true | true |
f72482c36144879a71a381f8ffacbf087f5e4594 | 28,655 | py | Python | sdk/python/pulumi_kubernetes/core/v1/Event.py | polivbr/pulumi-kubernetes | 36a5fb34240a38a60b52a5f4e55e66e248d9305f | [
"Apache-2.0"
] | 277 | 2018-06-18T14:57:09.000Z | 2022-03-29T04:05:06.000Z | sdk/python/pulumi_kubernetes/core/v1/Event.py | polivbr/pulumi-kubernetes | 36a5fb34240a38a60b52a5f4e55e66e248d9305f | [
"Apache-2.0"
] | 1,447 | 2018-06-20T00:58:34.000Z | 2022-03-31T21:28:43.000Z | sdk/python/pulumi_kubernetes/core/v1/Event.py | polivbr/pulumi-kubernetes | 36a5fb34240a38a60b52a5f4e55e66e248d9305f | [
"Apache-2.0"
] | 95 | 2018-06-30T03:30:05.000Z | 2022-03-29T04:05:09.000Z | # coding=utf-8
# *** WARNING: this file was generated by pulumigen. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outp... | 48.322091 | 401 | 0.658873 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
from ... import meta as _meta
from ._inputs import *
__all__ = ['EventInitArgs', 'Event']
@pulumi.input_type
class EventInitArgs:
def __init... | true | true |
f724835605b65f1f1e1ae6d86dd97f931443263b | 2,525 | py | Python | stats.py | JoKalliauer/resvg-test-suite | c1a0e510bcdb89275b30caeb3725208304a26754 | [
"MIT"
] | 1 | 2021-06-02T11:21:41.000Z | 2021-06-02T11:21:41.000Z | stats.py | adarshkrtiwari/resvg-test-suite | c2cb84b630332ea585fc54ba62e62d35fb4a33dd | [
"MIT"
] | null | null | null | stats.py | adarshkrtiwari/resvg-test-suite | c2cb84b630332ea585fc54ba62e62d35fb4a33dd | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Usage:
# ./stats.py results.csv chart.svg
# ./stats.py official.csv official_chart.svg
import argparse
import csv
import json
import subprocess
UNKNOWN = 0
PASSED = 1
FAILED = 2
CRASHED = 3
PARTIAL = 4
OUT_OF_SCOPE = 5
class RowData:
def __init__(self, name, ... | 22.747748 | 81 | 0.486337 |
import argparse
import csv
import json
import subprocess
UNKNOWN = 0
PASSED = 1
FAILED = 2
CRASHED = 3
PARTIAL = 4
OUT_OF_SCOPE = 5
class RowData:
def __init__(self, name, flags):
self.name = name
self.flags = flags
parser = argparse.ArgumentParser()
parser.add_... | true | true |
f724837677091a92b829fe1dee99ea0c985b84da | 4,804 | py | Python | docs/conf.py | cartovarc/mac-to-ip | 94098096297fe3d64022ecc850923d3cdc9691b1 | [
"MIT"
] | null | null | null | docs/conf.py | cartovarc/mac-to-ip | 94098096297fe3d64022ecc850923d3cdc9691b1 | [
"MIT"
] | null | null | null | docs/conf.py | cartovarc/mac-to-ip | 94098096297fe3d64022ecc850923d3cdc9691b1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# mac_to_ip documentation build configuration file, created by
# sphinx-quickstart on Fri Jun 9 13:47:02 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# A... | 29.472393 | 77 | 0.684013 |
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
import mac_to_ip
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = 'MAC to IP'
copyright = "2021, Carlos Tovar"
author = "... | true | true |
f72483c20810353d6391f7a8ef332c319e49ecf0 | 2,956 | py | Python | pygyver/etl/ometria.py | madedotcom/pygyver | 77da52570951c4ddaba3d60f36a82c64828a9121 | [
"MIT"
] | 1 | 2020-11-25T11:33:11.000Z | 2020-11-25T11:33:11.000Z | pygyver/etl/ometria.py | madedotcom/pygyver | 77da52570951c4ddaba3d60f36a82c64828a9121 | [
"MIT"
] | 21 | 2020-04-17T17:21:05.000Z | 2021-05-21T13:34:51.000Z | pygyver/etl/ometria.py | madedotcom/pygyver | 77da52570951c4ddaba3d60f36a82c64828a9121 | [
"MIT"
] | 2 | 2021-03-05T14:13:00.000Z | 2021-12-30T18:36:40.000Z | """
Ometria API
http://docs.ometria.com/apis/data_api_v2/
- the env vars for the authentication are stored on the kubernetes cluster
under 'ometria-access-credentials'
- functionality:
set api credentials
send custom events
"""
import logging
import os
import requests
class OmetriaExecutor:
"""
Ometr... | 30.163265 | 76 | 0.579838 | import logging
import os
import requests
class OmetriaExecutor:
def __init__(self, env: str):
self.env = env
self.api_endpoint = "https://api.ometria.com/v2"
self.api_key = None
self.api_headers = None
self.payload = None
self.response = None
self.set_api_c... | true | true |
f724849d81b90b9dba25cf9ce12481c3d66b2f7c | 38,765 | py | Python | airflow/models/baseoperator.py | subrays/airflow | 3c8c0b3b6411762a4e4977e519374d9fb16b541d | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | airflow/models/baseoperator.py | subrays/airflow | 3c8c0b3b6411762a4e4977e519374d9fb16b541d | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | airflow/models/baseoperator.py | subrays/airflow | 3c8c0b3b6411762a4e4977e519374d9fb16b541d | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# 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
#... | 38.765 | 102 | 0.629176 |
from abc import ABCMeta, abstractmethod
from cached_property import cached_property
import copy
import functools
import logging
import sys
import warnings
from datetime import timedelta, datetime
from typing import Callable, Dict, Iterable, List, Optional, Set
import jinja2
import six
from airflow ... | true | true |
f72484a7592ee8ca18c8b0897a938b18606428a4 | 6,800 | py | Python | bindings/python/ensmallen_graph/datasets/string/paraprevotellaxylaniphila.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/paraprevotellaxylaniphila.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/paraprevotellaxylaniphila.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | """
This file offers the methods to automatically retrieve the graph Paraprevotella xylaniphila.
The graph is automatically retrieved from the STRING repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime: ... | 35.602094 | 223 | 0.708529 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen_graph import EnsmallenGraph
def ParaprevotellaXylaniphila(
directed: bool = False,
verbose: int = 2,
cache_path: str = "graphs/string",
**additional_graph_kwargs: Dict
) -> EnsmallenGraph:
... | true | true |
f72484fc095b2c9a1f53f18824e2c7709dcae682 | 874 | py | Python | spec_parser/spec_parser/util.py | Parnassius/domify | 262a9b9bf68fd627d963f23abb68c06f424180f2 | [
"MIT"
] | null | null | null | spec_parser/spec_parser/util.py | Parnassius/domify | 262a9b9bf68fd627d963f23abb68c06f424180f2 | [
"MIT"
] | 5 | 2022-03-01T19:53:28.000Z | 2022-03-28T01:32:30.000Z | spec_parser/spec_parser/util.py | Parnassius/domify | 262a9b9bf68fd627d963f23abb68c06f424180f2 | [
"MIT"
] | 1 | 2021-11-08T20:36:36.000Z | 2021-11-08T20:36:36.000Z | from typing import Dict, List
import requests
from bs4 import BeautifulSoup # type: ignore[import]
class _RequestCache:
def __init__(self) -> None:
self._cache: Dict[str, BeautifulSoup] = {}
def __call__(self, page: str) -> BeautifulSoup:
if page.endswith(".html"):
page = page[:... | 26.484848 | 83 | 0.621281 | from typing import Dict, List
import requests
from bs4 import BeautifulSoup
class _RequestCache:
def __init__(self) -> None:
self._cache: Dict[str, BeautifulSoup] = {}
def __call__(self, page: str) -> BeautifulSoup:
if page.endswith(".html"):
page = page[:-5]
if page no... | true | true |
f72485a6ca32241a57f395404a0c19eded7aae2d | 415 | py | Python | Data_Structures/Maps_Hash_Dict/DivisiblePairCount2.py | neha07kumari/algo_ds_101 | b5f87feb4aac5ad45d934a609e7e73eedf280f10 | [
"MIT"
] | 1 | 2022-02-11T19:25:01.000Z | 2022-02-11T19:25:01.000Z | Data_Structures/Maps_Hash_Dict/DivisiblePairCount2.py | neha07kumari/algo_ds_101 | b5f87feb4aac5ad45d934a609e7e73eedf280f10 | [
"MIT"
] | 2 | 2020-10-13T06:49:54.000Z | 2020-10-17T07:16:37.000Z | Data_Structures/Maps_Hash_Dict/DivisiblePairCount2.py | neha07kumari/algo_ds_101 | b5f87feb4aac5ad45d934a609e7e73eedf280f10 | [
"MIT"
] | 14 | 2020-10-13T04:20:57.000Z | 2021-10-01T16:16:13.000Z | def DivisiblePairCount(arr) :
count = 0
k = len(arr)
for i in range(0, k):
for j in range(i+1, k):
if (arr[i] % arr[j] == 0 or arr[j] % arr[i] == 0):
count += 1
return count
if __name__ == "__main__":
#give input in form of a list -- [1,2,3]
arr = [int... | 24.411765 | 73 | 0.508434 | def DivisiblePairCount(arr) :
count = 0
k = len(arr)
for i in range(0, k):
for j in range(i+1, k):
if (arr[i] % arr[j] == 0 or arr[j] % arr[i] == 0):
count += 1
return count
if __name__ == "__main__":
arr = [int(item) for item in ''.join(list(input())... | true | true |
f72485e95740971bc6b7f5bd9e29a91909acdc48 | 92 | py | Python | project_mysql/sales/modelsa.py | righ/djangomodel2alchemymap | c156cd14ff7bfd7d858449819072c18059ecdcd0 | [
"MIT"
] | 17 | 2019-08-20T16:58:18.000Z | 2022-01-15T05:00:52.000Z | project_mysql/sales/modelsa.py | righ/djangomodel2alchemymap | c156cd14ff7bfd7d858449819072c18059ecdcd0 | [
"MIT"
] | 4 | 2020-06-02T00:14:38.000Z | 2021-10-14T16:45:13.000Z | project_mysql/sales/modelsa.py | righ/djangomodel2alchemymap | c156cd14ff7bfd7d858449819072c18059ecdcd0 | [
"MIT"
] | 2 | 2019-12-17T13:15:48.000Z | 2021-04-27T09:09:46.000Z | from d2a import transfer
from . import models
transfer(models, globals(), db_type='mysql')
| 18.4 | 44 | 0.76087 | from d2a import transfer
from . import models
transfer(models, globals(), db_type='mysql')
| true | true |
f724861c26fdb7becc18c6a8a70a39ab6cf71c08 | 6,782 | py | Python | sdk/lusid/models/resource_list_of_get_counterparty_response.py | mneedham/lusid-sdk-python-preview | f4494009d1a2f3431d931c813cab679bdbd92c84 | [
"MIT"
] | null | null | null | sdk/lusid/models/resource_list_of_get_counterparty_response.py | mneedham/lusid-sdk-python-preview | f4494009d1a2f3431d931c813cab679bdbd92c84 | [
"MIT"
] | null | null | null | sdk/lusid/models/resource_list_of_get_counterparty_response.py | mneedham/lusid-sdk-python-preview | f4494009d1a2f3431d931c813cab679bdbd92c84 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
LUSID API
FINBOURNE Technology # noqa: E501
The version of the OpenAPI document: 0.11.3192
Contact: info@finbourne.com
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class ResourceListOfGetCounterpartyResponse(object):
... | 28.495798 | 109 | 0.599823 |
import pprint
import re
import six
class ResourceListOfGetCounterpartyResponse(object):
openapi_types = {
'values': 'list[GetCounterpartyResponse]',
'href': 'str',
'links': 'list[Link]',
'next_page': 'str',
'previous_page': 'str'
}
attribute_map = {
... | true | true |
f72487670d1fd26ffb29aca415344110891be0c5 | 4,468 | py | Python | solidata_api/_models/models_dataset_output.py | entrepreneur-interet-general/solidata_backend | 08ba9151069f2f633461f5166b1954fdeac7854a | [
"MIT"
] | 7 | 2018-12-13T09:50:26.000Z | 2022-03-25T23:59:26.000Z | solidata_api/_models/models_dataset_output.py | entrepreneur-interet-general/solidata_backend | 08ba9151069f2f633461f5166b1954fdeac7854a | [
"MIT"
] | 35 | 2018-10-16T09:06:40.000Z | 2019-03-27T11:12:11.000Z | solidata_api/_models/models_dataset_output.py | entrepreneur-interet-general/solidata_backend | 08ba9151069f2f633461f5166b1954fdeac7854a | [
"MIT"
] | 2 | 2019-02-16T15:19:05.000Z | 2019-02-19T19:27:44.000Z | # -*- encoding: utf-8 -*-
"""
_models/models_dataset_outputs.py
"""
from log_config import log, pformat
log.debug("... loading models_dataset_outputs.py ...")
from flask_restplus import fields
### import data serializers
from solidata_api._serializers.schema_logs import *
from solidata_api._serializers.sche... | 26.282353 | 133 | 0.673679 |
from log_config import log, pformat
log.debug("... loading models_dataset_outputs.py ...")
from flask_restplus import fields
t *
from solidata_api._serializers.schema_generic import *
open_level_edit_show} )
@property
def model(self):
return self.mod
class Dso_infos :
def __init__(self, ns_) :... | true | true |
f72487c1401c258eeaef80d0bad2132c073531cf | 8,204 | py | Python | openapi_client/api/dc_graph_get_report_depot_utilization_v1_api.py | vertica/vertica-accelerator-cli | 706925f58a4bfc2876903396db72363f673be76a | [
"Apache-2.0"
] | null | null | null | openapi_client/api/dc_graph_get_report_depot_utilization_v1_api.py | vertica/vertica-accelerator-cli | 706925f58a4bfc2876903396db72363f673be76a | [
"Apache-2.0"
] | null | null | null | openapi_client/api/dc_graph_get_report_depot_utilization_v1_api.py | vertica/vertica-accelerator-cli | 706925f58a4bfc2876903396db72363f673be76a | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
VAAS API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: 0.0.1
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import re # noqa... | 42.507772 | 148 | 0.615553 |
from __future__ import absolute_import
import re
import six
from openapi_client.api_client import ApiClient
from openapi_client.exceptions import (
ApiTypeError,
ApiValueError
)
class DcGraphGetReportDepotUtilizationV1Api(object):
def __init__(self, api_client=None):
if api_client is ... | true | true |
f724888e65513eebbb1135160df884f5d67661ab | 22,396 | py | Python | pytest_django/plugin.py | oboynitro/pytest-django | e4ebc59b0037e5623706c738ef8cbf09ecd2425d | [
"BSD-3-Clause"
] | 1 | 2020-10-23T02:46:08.000Z | 2020-10-23T02:46:08.000Z | pytest_django/plugin.py | oboynitro/pytest-django | e4ebc59b0037e5623706c738ef8cbf09ecd2425d | [
"BSD-3-Clause"
] | null | null | null | pytest_django/plugin.py | oboynitro/pytest-django | e4ebc59b0037e5623706c738ef8cbf09ecd2425d | [
"BSD-3-Clause"
] | null | null | null | """A pytest plugin which helps testing Django applications
This plugin handles creating and destroying the test environment and
test database and provides some useful text fixtures.
"""
import contextlib
import inspect
from functools import reduce
import os
import pathlib
import sys
import pytest
from .django_compa... | 30.976487 | 92 | 0.655162 |
import contextlib
import inspect
from functools import reduce
import os
import pathlib
import sys
import pytest
from .django_compat import is_django_unittest
from .fixtures import django_assert_num_queries
from .fixtures import django_assert_max_num_queries
from .fixtures import django_db_setup
from .fixture... | true | true |
f72489a44f3b9b2634bf77eab598bc59f36daa24 | 26,662 | py | Python | src/squad/graphs.py | douglasdaly/spot-robot | 7a4fdd7eb5fe5fc2d31180ed6b9f7ea21647bea2 | [
"MIT"
] | null | null | null | src/squad/graphs.py | douglasdaly/spot-robot | 7a4fdd7eb5fe5fc2d31180ed6b9f7ea21647bea2 | [
"MIT"
] | null | null | null | src/squad/graphs.py | douglasdaly/spot-robot | 7a4fdd7eb5fe5fc2d31180ed6b9f7ea21647bea2 | [
"MIT"
] | null | null | null | from typing import Any, Dict, List, Optional, Tuple, Type, Union, overload
import numpy as np
from squad.exceptions import (
EdgeAlreadyExists,
EdgeNotFound,
NodeAlreadyExists,
NodeNotFound,
)
class Node:
"""
Single node in a graph.
"""
def __init__(self, name: str, **data: Any) -> ... | 29.39581 | 78 | 0.543808 | from typing import Any, Dict, List, Optional, Tuple, Type, Union, overload
import numpy as np
from squad.exceptions import (
EdgeAlreadyExists,
EdgeNotFound,
NodeAlreadyExists,
NodeNotFound,
)
class Node:
def __init__(self, name: str, **data: Any) -> None:
self._name = name
self... | true | true |
f72489d8e00e85d8c00ed35e505fae2c30fe7577 | 1,139 | py | Python | Advanced-Algorithms-and-Complexity/Week3 - P vs NP/03 - Budget Allocation/budget_allocation.py | ChristineHu1207/Coursera-Data-Structures-and-Algorithms-Specialization | 27f543ca0778d00ffd624ffcd18bf555660e0168 | [
"MIT"
] | null | null | null | Advanced-Algorithms-and-Complexity/Week3 - P vs NP/03 - Budget Allocation/budget_allocation.py | ChristineHu1207/Coursera-Data-Structures-and-Algorithms-Specialization | 27f543ca0778d00ffd624ffcd18bf555660e0168 | [
"MIT"
] | null | null | null | Advanced-Algorithms-and-Complexity/Week3 - P vs NP/03 - Budget Allocation/budget_allocation.py | ChristineHu1207/Coursera-Data-Structures-and-Algorithms-Specialization | 27f543ca0778d00ffd624ffcd18bf555660e0168 | [
"MIT"
] | null | null | null | # python3
import itertools
n, m = list(map(int, input().split()))
A = []
for i in range(n):
A += [list(map(int, input().split()))]
b = list(map(int, input().split()))
clauses = []
for i, coefficient in enumerate(A):
non_coefficients = [(j, coefficient[j]) for j in range(m) if 0 != coefficient[j]]
l = len(non_c... | 24.76087 | 137 | 0.627744 |
import itertools
n, m = list(map(int, input().split()))
A = []
for i in range(n):
A += [list(map(int, input().split()))]
b = list(map(int, input().split()))
clauses = []
for i, coefficient in enumerate(A):
non_coefficients = [(j, coefficient[j]) for j in range(m) if 0 != coefficient[j]]
l = len(non_coefficien... | true | true |
f72489ec9d755295d9c7b8adc3c280594304173c | 7,911 | py | Python | bokeh/_version.py | timelyportfolio/bokeh | a976a85535cf137c6238ce9e90b41ab14ae8ce22 | [
"BSD-3-Clause"
] | 2 | 2015-07-23T21:19:52.000Z | 2016-01-25T17:00:15.000Z | bokeh/_version.py | brian15co/bokeh | 6cecb7211277b9d838039d0eb15e50a10f9ac3d1 | [
"BSD-3-Clause"
] | null | null | null | bokeh/_version.py | brian15co/bokeh | 6cecb7211277b9d838039d0eb15e50a10f9ac3d1 | [
"BSD-3-Clause"
] | 2 | 2015-12-22T04:13:10.000Z | 2021-07-06T21:18:04.000Z |
IN_LONG_VERSION_PY = True
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by github's download-from-tag
# feature). Distribution tarballs (build by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter ... | 40.362245 | 87 | 0.627102 |
IN_LONG_VERSION_PY = True
# feature). Distribution tarballs (build by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains the computed version number.
# This file is released into the public domain. Generated by
# versioneer-0.7+ (https://github... | true | true |
f7248af32f72c111effbd60171246b9815ed3cb7 | 368 | py | Python | sol_runner.py | Square789/AoC | 041aecb9e1a06b5417bdef0eb0ab70a542be04b5 | [
"MIT"
] | 3 | 2020-12-05T17:43:51.000Z | 2020-12-06T10:37:29.000Z | sol_runner.py | Square789/AoC | 041aecb9e1a06b5417bdef0eb0ab70a542be04b5 | [
"MIT"
] | null | null | null | sol_runner.py | Square789/AoC | 041aecb9e1a06b5417bdef0eb0ab70a542be04b5 | [
"MIT"
] | null | null | null | import importlib
import sys
from aoc_input import get_input
if __name__ == "__main__":
if len(sys.argv) < 3:
print("Specify which file to run! [year, day]")
sys.exit()
try:
year = int(sys.argv[1])
day = int(sys.argv[2])
except ValueError:
print("Integer required!")
sys.exit()
module = importlib.impo... | 18.4 | 56 | 0.673913 | import importlib
import sys
from aoc_input import get_input
if __name__ == "__main__":
if len(sys.argv) < 3:
print("Specify which file to run! [year, day]")
sys.exit()
try:
year = int(sys.argv[1])
day = int(sys.argv[2])
except ValueError:
print("Integer required!")
sys.exit()
module = importlib.impo... | true | true |
f7248b04de6e0f200dd961244469207c2c19aa5a | 39,165 | py | Python | validator/sawtooth_validator/gossip/gossip.py | ltavag/sawtooth-core | 50659f23437b27ecd666d4cf129f812e6adaedc4 | [
"Apache-2.0"
] | 1 | 2018-04-24T11:42:36.000Z | 2018-04-24T11:42:36.000Z | validator/sawtooth_validator/gossip/gossip.py | ltavag/sawtooth-core | 50659f23437b27ecd666d4cf129f812e6adaedc4 | [
"Apache-2.0"
] | null | null | null | validator/sawtooth_validator/gossip/gossip.py | ltavag/sawtooth-core | 50659f23437b27ecd666d4cf129f812e6adaedc4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 Intel Corporation
#
# 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 wri... | 41.664894 | 80 | 0.578808 |
import logging
import copy
import time
import random
import os
import binascii
from threading import Lock
from functools import partial
from collections import namedtuple
from enum import Enum
from sawtooth_validator.concurrent.thread import InstrumentedThread
from sawtooth_validator.protobuf.network_pb2... | true | true |
f7248bd68fe7de142bd9557e71df9eec370b4208 | 4,604 | py | Python | colossalai/nn/optimizer/lamb.py | xdjiangkai/ColossalAI | 4a3d3446b04065fa1c89b78cba673e96115c6325 | [
"Apache-2.0"
] | 1 | 2022-03-12T04:49:19.000Z | 2022-03-12T04:49:19.000Z | colossalai/nn/optimizer/lamb.py | xdjiangkai/ColossalAI | 4a3d3446b04065fa1c89b78cba673e96115c6325 | [
"Apache-2.0"
] | null | null | null | colossalai/nn/optimizer/lamb.py | xdjiangkai/ColossalAI | 4a3d3446b04065fa1c89b78cba673e96115c6325 | [
"Apache-2.0"
] | 1 | 2022-01-06T17:16:32.000Z | 2022-01-06T17:16:32.000Z | """
Adapted from the pytorch-lamb library at https://github.com/cybertronai/pytorch-lamb
"""
import torch
from torch.optim import Optimizer
from colossalai.registry import OPTIMIZERS
@OPTIMIZERS.register_module
class Lamb(Optimizer):
r"""Implements Lamb algorithm.
It has been proposed in `Large Batch Optimi... | 39.350427 | 103 | 0.553649 |
import torch
from torch.optim import Optimizer
from colossalai.registry import OPTIMIZERS
@OPTIMIZERS.register_module
class Lamb(Optimizer):
def __init__(self, params, lr=1e-3, betas=(0.9, 0.999), eps=1e-6,
weight_decay=0, adam=False):
if not 0.0 <= lr:
raise ValueError("In... | true | true |
f7248e344028eb2f0e09ee718bbf90134b69c45e | 29,546 | py | Python | pyqubo/array.py | OpenJij/pyqubo | 47190d3391c83c1c84636ab8f8bff67c8f935dc0 | [
"Apache-2.0"
] | null | null | null | pyqubo/array.py | OpenJij/pyqubo | 47190d3391c83c1c84636ab8f8bff67c8f935dc0 | [
"Apache-2.0"
] | null | null | null | pyqubo/array.py | OpenJij/pyqubo | 47190d3391c83c1c84636ab8f8bff67c8f935dc0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Recruit Communications Co., Ltd.
#
# 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 a... | 36.978723 | 100 | 0.504874 |
from .core import Spin, Binary, Express
import dimod
from dimod.decorators import vartype_argument
import numpy as np
from operator import mul, add
from six.moves import reduce
class Array:
def __init__(self, bit_list):
if isinstance(bit_list, np.ndarray):
self.shape = bit_lis... | true | true |
f7248e4c92268c1a8e4f9a3e78264a4a28b054ff | 533 | py | Python | scripts/flash/plot_hitscores.py | JunCEEE/hummingbird | 0b1bdf5023b92090f31d9bc857e0854a805cf2cd | [
"BSD-2-Clause"
] | 14 | 2016-02-18T23:10:12.000Z | 2021-07-30T09:19:56.000Z | scripts/flash/plot_hitscores.py | JunCEEE/hummingbird | 0b1bdf5023b92090f31d9bc857e0854a805cf2cd | [
"BSD-2-Clause"
] | 66 | 2015-11-18T15:39:45.000Z | 2015-12-06T16:06:20.000Z | scripts/flash/plot_hitscores.py | JunCEEE/hummingbird | 0b1bdf5023b92090f31d9bc857e0854a805cf2cd | [
"BSD-2-Clause"
] | 13 | 2016-07-07T13:15:52.000Z | 2021-11-10T11:56:13.000Z | #!/usr/bin/env python
import h5py
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import sys
runnr = int(sys.argv[1])
filename = '/asap3/flash/gpfs/bl1/2017/data/11001733/processed/hummingbird/r%04d_ol1.h5' %runnr
with h5py.File(filename, 'r') as f:
hitscore = f['entry_1/... | 28.052632 | 95 | 0.729831 |
import h5py
import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import sys
runnr = int(sys.argv[1])
filename = '/asap3/flash/gpfs/bl1/2017/data/11001733/processed/hummingbird/r%04d_ol1.h5' %runnr
with h5py.File(filename, 'r') as f:
hitscore = f['entry_1/result_1/hitscore_lit... | true | true |
f7248ee621042e30291d461ffdf3dcab8f265bba | 106,231 | py | Python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machines_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2021-09-07T18:39:05.000Z | 2021-09-07T18:39:05.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machines_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2021_04_01/aio/operations/_virtual_machines_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.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 may ... | 46.167319 | 873 | 0.668468 |
import functools
from typing import Any, AsyncIterable, Callable, Dict, Generic, Optional, TypeVar, Union
import warnings
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_... | true | true |
f7248f210691f99763f6311365ed9eb869ed4aa4 | 20,439 | py | Python | mlrun/runtimes/pod.py | Michaelliv/mlrun | f155836f71e86cfcc573bcf1aa35762d72feeb5a | [
"Apache-2.0"
] | null | null | null | mlrun/runtimes/pod.py | Michaelliv/mlrun | f155836f71e86cfcc573bcf1aa35762d72feeb5a | [
"Apache-2.0"
] | null | null | null | mlrun/runtimes/pod.py | Michaelliv/mlrun | f155836f71e86cfcc573bcf1aa35762d72feeb5a | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Iguazio
#
# 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, softwa... | 36.563506 | 131 | 0.632467 |
import os
import typing
import uuid
from enum import Enum
from kfp.dsl import ContainerOp, _container_op
from kubernetes import client
import mlrun.errors
import mlrun.utils.regex
from ..config import config as mlconf
from ..utils import logger, normalize_name, update_in, verify_field_regex
from .base i... | true | true |
f7248f61ab2a1f4fb14a9ffc0272aea78e49b1af | 7,677 | py | Python | var/spack/repos/builtin/packages/libint/package.py | rickgcv/spack | 4d4f7393a3522c1f690a2e9a9683bf0f8f3b43a6 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/libint/package.py | rickgcv/spack | 4d4f7393a3522c1f690a2e9a9683bf0f8f3b43a6 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/libint/package.py | rickgcv/spack | 4d4f7393a3522c1f690a2e9a9683bf0f8f3b43a6 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2020-11-08T10:26:48.000Z | 2020-11-08T10:26:48.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)
import os
from spack import *
TUNE_VARIANTS = (
'none',
'cp2k-lmax-4',
'cp2k-lmax-5',
'cp2k-lmax-6',
... | 37.44878 | 95 | 0.558421 |
import os
from spack import *
TUNE_VARIANTS = (
'none',
'cp2k-lmax-4',
'cp2k-lmax-5',
'cp2k-lmax-6',
'cp2k-lmax-7',
'molgw-lmax-4',
'molgw-lmax-5',
'molgw-lmax-6',
'molgw-lmax-7',
)
class Libint(AutotoolsPackage):
homepage = "https://github.com/evaleev/libint"
url =... | true | true |
f7248fd3c08c05e53ab12b8b1c1daa7aa98f5d00 | 11,277 | py | Python | real_time.py | TheoPantaz/Control-of-robotic-vehicle-via-brain-activity | 4cae5a69503659581f510c748f59f045d1f2b145 | [
"MIT"
] | null | null | null | real_time.py | TheoPantaz/Control-of-robotic-vehicle-via-brain-activity | 4cae5a69503659581f510c748f59f045d1f2b145 | [
"MIT"
] | null | null | null | real_time.py | TheoPantaz/Control-of-robotic-vehicle-via-brain-activity | 4cae5a69503659581f510c748f59f045d1f2b145 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Jan 17 18:06:40 2020
@author: Kokkinos
lines for telnet communication: 31,32,136,139,149,152,201,204,212,215,296
"""
from threading import Thread
import numpy as np
import scipy.io as sio
from pylsl import StreamInlet, resolve_stream
from tkinter import *
import telnetlib
i... | 31.412256 | 151 | 0.423162 |
from threading import Thread
import numpy as np
import scipy.io as sio
from pylsl import StreamInlet, resolve_stream
from tkinter import *
import telnetlib
import pickle
import threading
from graphics import Graphics
class rt(Graphics):
def __init__(self, mode = 'IMvsall', tim_window = 4, vote_window = 4, ... | true | true |
f7249040b586c4a22845aeab9c8fe2659a7527ef | 1,126 | py | Python | python/6.net/3.Ext/1.shell_server.py | dunitian/BaseCode | 4855ef4c6dd7c95d7239d2048832d8acfe26e084 | [
"Apache-2.0"
] | 25 | 2018-06-13T08:13:44.000Z | 2020-11-19T14:02:11.000Z | python/6.net/3.Ext/1.shell_server.py | dunitian/BaseCode | 4855ef4c6dd7c95d7239d2048832d8acfe26e084 | [
"Apache-2.0"
] | null | null | null | python/6.net/3.Ext/1.shell_server.py | dunitian/BaseCode | 4855ef4c6dd7c95d7239d2048832d8acfe26e084 | [
"Apache-2.0"
] | 13 | 2018-06-13T08:13:38.000Z | 2022-01-06T06:45:07.000Z | from socket import socket
def main():
with socket() as tcp_socket:
tcp_socket.bind(('', 8080))
tcp_socket.listen()
client_socket, client_addr = tcp_socket.accept()
with client_socket:
print(f"[肉鸡{client_addr}已经上线:]\n")
while True:
cmd = input... | 29.631579 | 65 | 0.562167 | from socket import socket
def main():
with socket() as tcp_socket:
tcp_socket.bind(('', 8080))
tcp_socket.listen()
client_socket, client_addr = tcp_socket.accept()
with client_socket:
print(f"[肉鸡{client_addr}已经上线:]\n")
while True:
cmd = input... | true | true |
f724904db04d50387041ae9ec1500db44a5daf4d | 17,114 | py | Python | src/models/trainer_ext.py | Katarina11/PreSumm | 616e72f038d512e9e9112af375d66a0b2e3db6cd | [
"MIT"
] | null | null | null | src/models/trainer_ext.py | Katarina11/PreSumm | 616e72f038d512e9e9112af375d66a0b2e3db6cd | [
"MIT"
] | null | null | null | src/models/trainer_ext.py | Katarina11/PreSumm | 616e72f038d512e9e9112af375d66a0b2e3db6cd | [
"MIT"
] | null | null | null | import os
import numpy as np
import torch
from tensorboardX import SummaryWriter
import distributed
from models.reporter_ext import ReportMgr, Statistics
from others.logging import logger
from others.utils import test_rouge, rouge_results_to_str
def _tally_parameters(model):
n_params = sum([p.nelement() for p i... | 38.895455 | 112 | 0.521678 | import os
import numpy as np
import torch
from tensorboardX import SummaryWriter
import distributed
from models.reporter_ext import ReportMgr, Statistics
from others.logging import logger
from others.utils import test_rouge, rouge_results_to_str
def _tally_parameters(model):
n_params = sum([p.nelement() for p i... | true | true |
f724910c59315867a42a56fab3deb36f5d3adb7a | 46,062 | py | Python | tensorflow/contrib/bayesflow/python/ops/hmc_impl.py | M155K4R4/Tensorflow | e5e03ef3148303b3dfed89a1492dedf92b45be25 | [
"Apache-2.0"
] | 5 | 2019-05-23T02:59:21.000Z | 2020-02-05T08:20:23.000Z | tensorflow/contrib/bayesflow/python/ops/hmc_impl.py | M155K4R4/Tensorflow | e5e03ef3148303b3dfed89a1492dedf92b45be25 | [
"Apache-2.0"
] | 2 | 2017-08-01T21:11:06.000Z | 2017-08-01T23:07:02.000Z | tensorflow/contrib/bayesflow/python/ops/hmc_impl.py | M155K4R4/Tensorflow | e5e03ef3148303b3dfed89a1492dedf92b45be25 | [
"Apache-2.0"
] | 2 | 2019-09-05T06:43:24.000Z | 2019-09-07T07:58:34.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 38.838111 | 83 | 0.666319 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import numpy as np
from tensorflow.python.framework import dtypes
from tensorflow.python.framework import ops
from tensorflow.python.ops import array_ops
from tensorflow.pytho... | true | true |
f724923d68de6140d8f4a588c2dc56847fda4dbf | 1,235 | py | Python | k8s/redis_component.py | wesfloyd/aave-ui-caching-server | 714149d66b8718d0610dc84faff2854930f05f3f | [
"BSD-3-Clause"
] | null | null | null | k8s/redis_component.py | wesfloyd/aave-ui-caching-server | 714149d66b8718d0610dc84faff2854930f05f3f | [
"BSD-3-Clause"
] | null | null | null | k8s/redis_component.py | wesfloyd/aave-ui-caching-server | 714149d66b8718d0610dc84faff2854930f05f3f | [
"BSD-3-Clause"
] | null | null | null | from kdsl.apps.v1 import Deployment, DeploymentSpec
from kdsl.core.v1 import Service, ServiceSpec, PodSpec, ObjectMeta, ContainerItem
import values
name = "redis"
labels = dict(component=name)
annotations = values.shared_annotations
metadata = ObjectMeta(
name=name,
namespace=values.NAMESPACE,
labels=di... | 20.583333 | 81 | 0.597571 | from kdsl.apps.v1 import Deployment, DeploymentSpec
from kdsl.core.v1 import Service, ServiceSpec, PodSpec, ObjectMeta, ContainerItem
import values
name = "redis"
labels = dict(component=name)
annotations = values.shared_annotations
metadata = ObjectMeta(
name=name,
namespace=values.NAMESPACE,
labels=di... | true | true |
f72492ac2f5be9bca11a91d75997f67a02504d8f | 56,520 | py | Python | letsencrypt-apache/letsencrypt_apache/configurator.py | sinesiobittencourt/letsencrypt | 0c704fa7f27277c838e13deed85e5c1ecbe46e90 | [
"Apache-2.0"
] | 1 | 2015-12-26T22:50:32.000Z | 2015-12-26T22:50:32.000Z | letsencrypt-apache/letsencrypt_apache/configurator.py | sinesiobittencourt/letsencrypt | 0c704fa7f27277c838e13deed85e5c1ecbe46e90 | [
"Apache-2.0"
] | null | null | null | letsencrypt-apache/letsencrypt_apache/configurator.py | sinesiobittencourt/letsencrypt | 0c704fa7f27277c838e13deed85e5c1ecbe46e90 | [
"Apache-2.0"
] | null | null | null | """Apache Configuration based off of Augeas Configurator."""
# pylint: disable=too-many-lines
import filecmp
import logging
import os
import re
import shutil
import socket
import time
import zope.interface
from acme import challenges
from letsencrypt import errors
from letsencrypt import interfaces
from letsencrypt ... | 38.845361 | 95 | 0.608935 |
import filecmp
import logging
import os
import re
import shutil
import socket
import time
import zope.interface
from acme import challenges
from letsencrypt import errors
from letsencrypt import interfaces
from letsencrypt import le_util
from letsencrypt.plugins import common
from letsencrypt_apache import augeas... | true | true |
f724930ad6413116333562d13934d7c53d5d2f11 | 1,084 | py | Python | geocode-run.py | kmcurry/story-where | 8bb1e9cc73f4f6aefb8edf40137ab55d1ecde3f6 | [
"MIT"
] | null | null | null | geocode-run.py | kmcurry/story-where | 8bb1e9cc73f4f6aefb8edf40137ab55d1ecde3f6 | [
"MIT"
] | 25 | 2020-01-02T23:55:30.000Z | 2020-03-15T21:25:16.000Z | geocode-run.py | kmcurry/story-where | 8bb1e9cc73f4f6aefb8edf40137ab55d1ecde3f6 | [
"MIT"
] | null | null | null | from utils.db import Database
from datetime import datetime
import hashlib
import json
import os
import requests
url = 'https://maps.googleapis.com/maps/api/geocode/json'
api_key = os.environ['GOOGLE_MAPS_API_KEY']
params = {'key': api_key, 'address': 'Mountain View, CA'}
print("Downloading entities")
db = Database()... | 26.439024 | 69 | 0.685424 | from utils.db import Database
from datetime import datetime
import hashlib
import json
import os
import requests
url = 'https://maps.googleapis.com/maps/api/geocode/json'
api_key = os.environ['GOOGLE_MAPS_API_KEY']
params = {'key': api_key, 'address': 'Mountain View, CA'}
print("Downloading entities")
db = Database()... | true | true |
f724934d8bc8300e61211e06181ef9feb6293b80 | 4,506 | py | Python | generate.py | djohansson/volk | a6418b5ea289e9130429717654571cf89d603fdc | [
"MIT",
"Unlicense"
] | 1 | 2018-12-23T11:04:22.000Z | 2018-12-23T11:04:22.000Z | Common_3/ThirdParty/OpenSource/volk/generate.py | cmkandpane/The-Forge | 63a3c3038c1b48184b207ebeed5a5548d52648e6 | [
"Apache-2.0"
] | null | null | null | Common_3/ThirdParty/OpenSource/volk/generate.py | cmkandpane/The-Forge | 63a3c3038c1b48184b207ebeed5a5548d52648e6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
from collections import OrderedDict
import sys
import urllib
import xml.etree.ElementTree as etree
import urllib.request
def parse_xml(path):
file = urllib.request.urlopen(path) if path.startswith("http") else open(path, 'r')
with file:
tree = etree.parse(file)
return tree
def patch_file(pat... | 29.25974 | 130 | 0.640923 |
from collections import OrderedDict
import sys
import urllib
import xml.etree.ElementTree as etree
import urllib.request
def parse_xml(path):
file = urllib.request.urlopen(path) if path.startswith("http") else open(path, 'r')
with file:
tree = etree.parse(file)
return tree
def patch_file(path, blocks):
resul... | true | true |
f7249360b251c64a2879289eb9c28f008a4fc9e6 | 8,859 | py | Python | packages/dcos-integration-test/extra/test_legacy_user_management.py | wolf31o2/dcos | 113b8abacfd6d517594f329b621aaf4641b535e7 | [
"Apache-2.0"
] | null | null | null | packages/dcos-integration-test/extra/test_legacy_user_management.py | wolf31o2/dcos | 113b8abacfd6d517594f329b621aaf4641b535e7 | [
"Apache-2.0"
] | null | null | null | packages/dcos-integration-test/extra/test_legacy_user_management.py | wolf31o2/dcos | 113b8abacfd6d517594f329b621aaf4641b535e7 | [
"Apache-2.0"
] | null | null | null | """
A collection of tests covering legacy user management in DC/OS.
Legacy user management is considered to be the user management API offered by
`dcos-oauth` up to DC/OS release 1.12.
Assume that access control is activated in Master Admin Router (could be
disabled with `oauth_enabled`) and therefore authenticate in... | 36.607438 | 80 | 0.703804 | import logging
import uuid
import pytest
from dcos_test_utils import dcos_cli
from test_helpers import get_expanded_config
__maintainer__ = 'jgehrcke'
__contact__ = 'security-team@mesosphere.io'
log = logging.getLogger(__name__)
@pytest.fixture(autouse=True)
def skip_in_downstream():
expanded_config = get_... | true | true |
f72495af7deabdbbf171c378cd19e6201f5d9763 | 3,359 | py | Python | exercise/substitution_matrix.py | naiaralandeta/programming_naiara_landeta | f90f2d7d00bb84e4bc2b34f02c183fa0373fb97e | [
"MIT"
] | null | null | null | exercise/substitution_matrix.py | naiaralandeta/programming_naiara_landeta | f90f2d7d00bb84e4bc2b34f02c183fa0373fb97e | [
"MIT"
] | null | null | null | exercise/substitution_matrix.py | naiaralandeta/programming_naiara_landeta | f90f2d7d00bb84e4bc2b34f02c183fa0373fb97e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Dec 19 10:16:35 2019
@author: naiara
"""
# SCORE MATRIX OR SUBSTITUTION MATRIX
"""
1 = "ACAGGTGGACCT"
2 = "ACTGGTCGACTC"
P(A) = 5/24 P(A, A) = 2/12 P(C, C) = 2/12 P(G, T) = 1
P(C) = 6/24 P(A, C) = 1 P(C, G) = 1... | 33.257426 | 90 | 0.504019 |
import math
seq1 = "ACAGGTGGACCT"
seq2 = "ACTGGTCGACTT"
seq = "CTATATGG"
seq = "CCGGATCG"
def print_matrix(row):
var = ""; list_bases = ["A", "C", "G", "T"]
for i in range(len(row)):
var += list_bases[i] + "\t"
for j in row[i]:
var += str(j) + "\t"
var += "\n"
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.