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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c3e768600e54d3c1c007e307058c3b2ee2dfba3 | 4,554 | py | Python | board.py | SebBlin/p4 | 342753a1e9bf018751cf0f4eff69e8f240df53e7 | [
"MIT"
] | 1 | 2020-06-14T19:10:35.000Z | 2020-06-14T19:10:35.000Z | board.py | SebBlin/p4 | 342753a1e9bf018751cf0f4eff69e8f240df53e7 | [
"MIT"
] | null | null | null | board.py | SebBlin/p4 | 342753a1e9bf018751cf0f4eff69e8f240df53e7 | [
"MIT"
] | null | null | null | import numpy as np
import hashlib
nbcol = 7
nbligne = 6
pion = [' ', 'X', 'O']
def print_top_line():
print(u'\u250c', end = '')
for _ in range(nbcol-1):
print(u'\u2500\u252c', sep = '', end = '')
print(u'\u2500\u2510')
def print_mid_line_empty(tab_line):
for i in range(nbcol):
print(... | 27.433735 | 107 | 0.504172 | import numpy as np
import hashlib
nbcol = 7
nbligne = 6
pion = [' ', 'X', 'O']
def print_top_line():
print(u'\u250c', end = '')
for _ in range(nbcol-1):
print(u'\u2500\u252c', sep = '', end = '')
print(u'\u2500\u2510')
def print_mid_line_empty(tab_line):
for i in range(nbcol):
print(... | true | true |
1c3e769abaf60b187cfc57bec702401e64629712 | 6,620 | py | Python | phase_classification_features.py | cahya-wirawan/phase-detection | ca65442c4f2a30004a17cf79cbe54cf9c2f6925d | [
"MIT"
] | null | null | null | phase_classification_features.py | cahya-wirawan/phase-detection | ca65442c4f2a30004a17cf79cbe54cf9c2f6925d | [
"MIT"
] | null | null | null | phase_classification_features.py | cahya-wirawan/phase-detection | ca65442c4f2a30004a17cf79cbe54cf9c2f6925d | [
"MIT"
] | null | null | null | import argparse
import numpy as np
from keras.wrappers.scikit_learn import KerasClassifier
from keras.callbacks import ModelCheckpoint, TensorBoard
from keras.models import load_model
from sklearn.model_selection import cross_val_score
from sklearn.model_selection import KFold
from sklearn.metrics import confusion_matr... | 52.539683 | 113 | 0.616163 | import argparse
import numpy as np
from keras.wrappers.scikit_learn import KerasClassifier
from keras.callbacks import ModelCheckpoint, TensorBoard
from keras.models import load_model
from sklearn.model_selection import cross_val_score
from sklearn.model_selection import KFold
from sklearn.metrics import confusion_matr... | true | true |
1c3e769dcf5543050992240a4de1783bd64c6643 | 15,400 | py | Python | devlib/trace/ftrace.py | douglas-raillard-arm/devlib | e3d9c4b2fdf5b878b51204713c34d7fc6dd6b305 | [
"Apache-2.0"
] | null | null | null | devlib/trace/ftrace.py | douglas-raillard-arm/devlib | e3d9c4b2fdf5b878b51204713c34d7fc6dd6b305 | [
"Apache-2.0"
] | null | null | null | devlib/trace/ftrace.py | douglas-raillard-arm/devlib | e3d9c4b2fdf5b878b51204713c34d7fc6dd6b305 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 ARM Limited
#
# 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 writin... | 44.252874 | 110 | 0.603117 |
from __future__ import division
import os
import json
import time
import re
import subprocess
from devlib.trace import TraceCollector
from devlib.host import PACKAGE_BIN_DIRECTORY
from devlib.exception import TargetError, HostError
from devlib.utils.misc import check_output, which
TRACE_MARKER_START = 'TRACE_MARKER... | true | true |
1c3e7755abcfd3bfa2f47c0829731b8bf801a9e2 | 8,752 | py | Python | gammapy/irf/edisp/core.py | Rishank2610/gammapy | 3cd64fdb2c53c8e5c697a9b85ef8d0486bff0b76 | [
"BSD-3-Clause"
] | 1 | 2017-11-22T17:07:56.000Z | 2017-11-22T17:07:56.000Z | gammapy/irf/edisp/core.py | Rishank2610/gammapy | 3cd64fdb2c53c8e5c697a9b85ef8d0486bff0b76 | [
"BSD-3-Clause"
] | null | null | null | gammapy/irf/edisp/core.py | Rishank2610/gammapy | 3cd64fdb2c53c8e5c697a9b85ef8d0486bff0b76 | [
"BSD-3-Clause"
] | 1 | 2019-09-04T14:03:33.000Z | 2019-09-04T14:03:33.000Z | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
import scipy.special
from astropy import units as u
from astropy.coordinates import Angle, SkyCoord
from astropy.visualization import quantity_support
from gammapy.maps import MapAxes, MapAxis, RegionGeom
from ..core import IRF
__all__ ... | 31.595668 | 92 | 0.589808 | import numpy as np
import scipy.special
from astropy import units as u
from astropy.coordinates import Angle, SkyCoord
from astropy.visualization import quantity_support
from gammapy.maps import MapAxes, MapAxis, RegionGeom
from ..core import IRF
__all__ = ["EnergyDispersion2D"]
class EnergyDispersion2D(IRF):
t... | true | true |
1c3e78fd908e52d77a53d8e59192195a4a3ac042 | 183 | py | Python | assetfiles/management/commands/findstatic.py | localmed/django-assetfiles | 34089780126989f49e6b890b85a90047704fde37 | [
"MIT"
] | null | null | null | assetfiles/management/commands/findstatic.py | localmed/django-assetfiles | 34089780126989f49e6b890b85a90047704fde37 | [
"MIT"
] | 2 | 2017-02-11T20:10:46.000Z | 2017-02-11T20:10:56.000Z | assetfiles/management/commands/findstatic.py | localmed/django-assetfiles | 34089780126989f49e6b890b85a90047704fde37 | [
"MIT"
] | null | null | null | from django.contrib.staticfiles.management.commands import findstatic
"""
`findstatic` is used in exactly the same way as staticfiles' `findstatic`.
"""
Command = findstatic.Command
| 26.142857 | 74 | 0.786885 | from django.contrib.staticfiles.management.commands import findstatic
Command = findstatic.Command
| true | true |
1c3e79916311ed421944b038cd76799d9f019587 | 2,003 | py | Python | osgtest/tests/test_280_gsiopenssh.py | djw8605/osg-test | 9cbbd48875863cb30627989c12df40e0daf3985c | [
"Apache-2.0"
] | 1 | 2016-03-09T20:24:07.000Z | 2016-03-09T20:24:07.000Z | osgtest/tests/test_280_gsiopenssh.py | djw8605/osg-test | 9cbbd48875863cb30627989c12df40e0daf3985c | [
"Apache-2.0"
] | 122 | 2016-03-23T16:59:07.000Z | 2022-02-23T18:25:34.000Z | osgtest/tests/test_280_gsiopenssh.py | djw8605/osg-test | 9cbbd48875863cb30627989c12df40e0daf3985c | [
"Apache-2.0"
] | 14 | 2016-03-09T17:54:20.000Z | 2021-07-02T15:51:23.000Z | from osgtest.library import core
from osgtest.library import osgunittest
from osgtest.library import files
from osgtest.library import service
SSHD_CONFIG = "/etc/gsissh/sshd_config"
SSHD_CONFIG_TEXT = r'''
Port %(port)s
AuthorizedKeysFile .ssh/authorized_keys
UsePrivilegeSeparation sandbox
GSSAPIAuthentication yes
... | 33.383333 | 100 | 0.673989 | from osgtest.library import core
from osgtest.library import osgunittest
from osgtest.library import files
from osgtest.library import service
SSHD_CONFIG = "/etc/gsissh/sshd_config"
SSHD_CONFIG_TEXT = r'''
Port %(port)s
AuthorizedKeysFile .ssh/authorized_keys
UsePrivilegeSeparation sandbox
GSSAPIAuthentication yes
... | true | true |
1c3e7a4fba332045a6cc535936322932cb36765b | 1,410 | py | Python | Examples/example35.py | ZibraMax/FEM | b868c60408a4f83dec4bb424d66be0b20e2ac71b | [
"MIT"
] | 10 | 2021-03-21T18:38:40.000Z | 2022-02-22T01:32:06.000Z | Examples/example35.py | ZibraMax/FEM | b868c60408a4f83dec4bb424d66be0b20e2ac71b | [
"MIT"
] | null | null | null | Examples/example35.py | ZibraMax/FEM | b868c60408a4f83dec4bb424d66be0b20e2ac71b | [
"MIT"
] | 1 | 2022-02-08T04:40:59.000Z | 2022-02-08T04:40:59.000Z | import numpy as np
import matplotlib.pyplot as plt
from FEM.Torsion2D import Torsion2D
from FEM.Mesh.Delaunay import Delaunay
a = 0.3
b = 0.3
tw = 0.05
tf = 0.05
E = 200000
v = 0.27
G = E / (2 * (1 + v))
phi = 1
vertices = [
[0, 0],
[a, 0],
[a, tf],
[a / 2 + tw / 2, tf],
[a / 2 + tw / 2, tf + b],
... | 27.115385 | 80 | 0.574468 | import numpy as np
import matplotlib.pyplot as plt
from FEM.Torsion2D import Torsion2D
from FEM.Mesh.Delaunay import Delaunay
a = 0.3
b = 0.3
tw = 0.05
tf = 0.05
E = 200000
v = 0.27
G = E / (2 * (1 + v))
phi = 1
vertices = [
[0, 0],
[a, 0],
[a, tf],
[a / 2 + tw / 2, tf],
[a / 2 + tw / 2, tf + b],
... | true | true |
1c3e7aece6b9e5fafeb3f4141d5fc01faaf56eec | 14,849 | py | Python | chrome/test/functional/test_utils.py | gavinp/chromium | 681563ea0f892a051f4ef3d5e53438e0bb7d2261 | [
"BSD-3-Clause"
] | 1 | 2016-03-10T09:13:57.000Z | 2016-03-10T09:13:57.000Z | chrome/test/functional/test_utils.py | gavinp/chromium | 681563ea0f892a051f4ef3d5e53438e0bb7d2261 | [
"BSD-3-Clause"
] | 1 | 2022-03-13T08:39:05.000Z | 2022-03-13T08:39:05.000Z | chrome/test/functional/test_utils.py | gavinp/chromium | 681563ea0f892a051f4ef3d5e53438e0bb7d2261 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import copy
import ctypes
import email
import logging
import os
import platform
import shutil
import smtplib
import subprocess
import sys
import types
i... | 35.270784 | 80 | 0.709947 |
import copy
import ctypes
import email
import logging
import os
import platform
import shutil
import smtplib
import subprocess
import sys
import types
import pyauto_functional
import pyauto
import pyauto_utils
def CopyFileFromDataDirToDownloadDir(test, file_path):
data_file = os.path.join(test.DataDir(), file_pa... | true | true |
1c3e7b52832204ee95f8948fbb41dd0bd1476aab | 222 | py | Python | importError.py | mkseth4774/ine-guide-to-network-programmability-python-course-files | 35c49dfcf8e8f1b69435987a00fb9a236b803d9f | [
"MIT"
] | null | null | null | importError.py | mkseth4774/ine-guide-to-network-programmability-python-course-files | 35c49dfcf8e8f1b69435987a00fb9a236b803d9f | [
"MIT"
] | null | null | null | importError.py | mkseth4774/ine-guide-to-network-programmability-python-course-files | 35c49dfcf8e8f1b69435987a00fb9a236b803d9f | [
"MIT"
] | null | null | null | ##
##
try:
import sys
import os
import time
import somethingthatdoesnotexist
except ImportError:
print('Houston, we have an import problem!')
print('We are going to run anyway!')
##
## End of file...
| 14.8 | 48 | 0.657658 | try:
import sys
import os
import time
import somethingthatdoesnotexist
except ImportError:
print('Houston, we have an import problem!')
print('We are going to run anyway!')
| true | true |
1c3e7e00dd940ceea153638844fe30bac5ad49cd | 1,687 | py | Python | UMSLHackRestAPI/api/migrations/0002_auto_20200222_1833.py | trujivan/climate-impact-changes | 609b8197b0ede1c1fdac3aa82b34e73e6f4526e3 | [
"MIT"
] | 1 | 2020-03-29T17:52:26.000Z | 2020-03-29T17:52:26.000Z | UMSLHackRestAPI/api/migrations/0002_auto_20200222_1833.py | trujivan/climate-impact-changes | 609b8197b0ede1c1fdac3aa82b34e73e6f4526e3 | [
"MIT"
] | 6 | 2021-03-19T00:01:21.000Z | 2021-09-22T18:37:17.000Z | UMSLHackRestAPI/api/migrations/0002_auto_20200222_1833.py | trujivan/climate-impact-changes | 609b8197b0ede1c1fdac3aa82b34e73e6f4526e3 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.3 on 2020-02-23 00:33
import api.models
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('api', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='MLReque... | 41.146341 | 263 | 0.583284 |
import api.models
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('api', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='MLRequest',
fields=[
('id',... | true | true |
1c3e7e4ce8433895dd5660f5df52b956b3fc31ee | 2,269 | py | Python | Chapter10/01-chapter-content/k_means_color_quantization.py | yaojh01/Mastering-OpenCV-4-with-Python | e8f83e314b8ed638edb6515967cfb24361b787af | [
"MIT"
] | 2 | 2021-06-29T22:00:47.000Z | 2021-06-30T02:46:19.000Z | Chapter10/01-chapter-content/k_means_color_quantization.py | yaojh01/Mastering-OpenCV-4-with-Python | e8f83e314b8ed638edb6515967cfb24361b787af | [
"MIT"
] | null | null | null | Chapter10/01-chapter-content/k_means_color_quantization.py | yaojh01/Mastering-OpenCV-4-with-Python | e8f83e314b8ed638edb6515967cfb24361b787af | [
"MIT"
] | 1 | 2019-10-03T20:34:43.000Z | 2019-10-03T20:34:43.000Z | """
K-means clustering algorithm applied to color quantization
"""
# Import required packages:
import numpy as np
import cv2
from matplotlib import pyplot as plt
def show_img_with_matplotlib(color_img, title, pos):
"""Shows an image using matplotlib capabilities"""
# Convert BGR image to RGB
img_RGB = c... | 31.957746 | 111 | 0.72543 |
import numpy as np
import cv2
from matplotlib import pyplot as plt
def show_img_with_matplotlib(color_img, title, pos):
img_RGB = color_img[:, :, ::-1]
ax = plt.subplot(2, 3, pos)
plt.imshow(img_RGB)
plt.title(title)
plt.axis('off')
def color_quantization(image, k):
data = np.flo... | true | true |
1c3e7f168ba1b2c202fb5b181c9780fee159aa25 | 22,828 | py | Python | test/test_md030_ordered.py | jackdewinter/pymarkdown | 7ae408ba0b24506fa07552ffe520750bbff38c53 | [
"MIT"
] | 20 | 2021-01-14T17:39:09.000Z | 2022-03-14T08:35:22.000Z | test/test_md030_ordered.py | jackdewinter/pymarkdown | 7ae408ba0b24506fa07552ffe520750bbff38c53 | [
"MIT"
] | 304 | 2020-08-15T23:24:00.000Z | 2022-03-31T23:34:03.000Z | test/test_md030_ordered.py | jackdewinter/pymarkdown | 7ae408ba0b24506fa07552ffe520750bbff38c53 | [
"MIT"
] | 3 | 2021-08-11T10:26:26.000Z | 2021-11-02T20:41:27.000Z | """
Module to provide tests related to the MD030 rule.
"""
from test.markdown_scanner import MarkdownScanner
import pytest
# pylint: disable=too-many-lines
@pytest.mark.rules
def test_md030_bad_configuration_ol_single():
"""
Test to verify that a configuration error is thrown when supplying the
ol_singl... | 28.714465 | 123 | 0.657307 | from test.markdown_scanner import MarkdownScanner
import pytest
@pytest.mark.rules
def test_md030_bad_configuration_ol_single():
scanner = MarkdownScanner()
supplied_arguments = [
"--set",
"plugins.md030.ol_single=not-integer",
"--strict-config",
"scan",
"test/re... | true | true |
1c3e7fd1b3bed5afdc913af0be1beeb3fd3079e9 | 4,332 | py | Python | analytics/consumer.py | heitorsampaio/analytics-python | 517c812a9c10ee369407521e36c155c738932ae5 | [
"Unlicense",
"MIT"
] | null | null | null | analytics/consumer.py | heitorsampaio/analytics-python | 517c812a9c10ee369407521e36c155c738932ae5 | [
"Unlicense",
"MIT"
] | null | null | null | analytics/consumer.py | heitorsampaio/analytics-python | 517c812a9c10ee369407521e36c155c738932ae5 | [
"Unlicense",
"MIT"
] | null | null | null | import logging
from threading import Thread
import monotonic
import backoff
import json
from analytics.request import post, APIError, DatetimeSerializer
try:
from queue import Empty
except ImportError:
from Queue import Empty
MAX_MSG_SIZE = 32 << 10
# Our servers only accept batches less than 500KB. Here li... | 32.088889 | 79 | 0.559557 | import logging
from threading import Thread
import monotonic
import backoff
import json
from analytics.request import post, APIError, DatetimeSerializer
try:
from queue import Empty
except ImportError:
from Queue import Empty
MAX_MSG_SIZE = 32 << 10
BATCH_SIZE_LIMIT = 475000
class Consumer(Thread):
lo... | true | true |
1c3e8090dc3d1bdc87269a5e3aa02ad54cb1c41d | 276 | py | Python | moveMouse.py | helloprasanna/python | 1f218ddf84bc082dca5906833238389011ae344b | [
"MIT"
] | null | null | null | moveMouse.py | helloprasanna/python | 1f218ddf84bc082dca5906833238389011ae344b | [
"MIT"
] | null | null | null | moveMouse.py | helloprasanna/python | 1f218ddf84bc082dca5906833238389011ae344b | [
"MIT"
] | null | null | null | import pyautogui
import time
print('Press Ctrl-C to quit.')
try:
while True:
x, y = pyautogui.position()
pyautogui.moveTo(x+5, y+5)
print('X : {}, Y : {} '.format(x, y))
time.sleep(5)
except KeyboardInterrupt:
print('Terminated \n')
| 18.4 | 45 | 0.57971 | import pyautogui
import time
print('Press Ctrl-C to quit.')
try:
while True:
x, y = pyautogui.position()
pyautogui.moveTo(x+5, y+5)
print('X : {}, Y : {} '.format(x, y))
time.sleep(5)
except KeyboardInterrupt:
print('Terminated \n')
| true | true |
1c3e81161bf35beb9539000f3765d21bce5ca285 | 2,020 | py | Python | code/knn.py | sornalingam/ml-glossary | 1ef2d23fb73ed785fda9b5d37d465d6d05c80f37 | [
"MIT"
] | 4 | 2020-09-26T01:26:28.000Z | 2021-08-05T20:54:04.000Z | code/knn.py | tusharmishra288/ml-glossary | eac8d91097d6f16801d46cf0c68ae667f49f0eda | [
"MIT"
] | null | null | null | code/knn.py | tusharmishra288/ml-glossary | eac8d91097d6f16801d46cf0c68ae667f49f0eda | [
"MIT"
] | null | null | null | from collections import Counter
from math import sqrt
def euclidean_distance(point1, point2):
distance = 0
for i in range(len(point1)):
distance +=(point1[i] - point2[i]) ** 2
return sqrt(distance)
def mean(labels):
return sum(labels) / len(labels)
def mode(labels):
return Co... | 26.933333 | 89 | 0.585149 | from collections import Counter
from math import sqrt
def euclidean_distance(point1, point2):
distance = 0
for i in range(len(point1)):
distance +=(point1[i] - point2[i]) ** 2
return sqrt(distance)
def mean(labels):
return sum(labels) / len(labels)
def mode(labels):
return Co... | true | true |
1c3e81bc03e97828c120842a812e728cfce91939 | 838 | py | Python | numba/cuda/tests/cudapy/test_userexc.py | uw-ipd/numba | 26dde2b28cadda403a5549a84dc1698900b23f74 | [
"BSD-2-Clause"
] | 3 | 2019-09-30T20:00:36.000Z | 2020-07-13T04:17:15.000Z | numba/cuda/tests/cudapy/test_userexc.py | uw-ipd/numba | 26dde2b28cadda403a5549a84dc1698900b23f74 | [
"BSD-2-Clause"
] | null | null | null | numba/cuda/tests/cudapy/test_userexc.py | uw-ipd/numba | 26dde2b28cadda403a5549a84dc1698900b23f74 | [
"BSD-2-Clause"
] | 1 | 2020-05-07T11:36:27.000Z | 2020-05-07T11:36:27.000Z | from __future__ import print_function, absolute_import, division
from numba.cuda.testing import unittest, SerialMixin
from numba import cuda
class MyError(Exception):
pass
class TestUserExc(SerialMixin, unittest.TestCase):
def test_user_exception(self):
@cuda.jit("void(int32)", debug=True)
... | 26.1875 | 81 | 0.601432 | from __future__ import print_function, absolute_import, division
from numba.cuda.testing import unittest, SerialMixin
from numba import cuda
class MyError(Exception):
pass
class TestUserExc(SerialMixin, unittest.TestCase):
def test_user_exception(self):
@cuda.jit("void(int32)", debug=True)
... | true | true |
1c3e822ee939e2be140a15ab1d0164a58d5ed646 | 7,384 | py | Python | openpyxl/tests/test_cell.py | Wyss/customarrayformatter | 40e395fb272e8e69bf64056748a87c0df716e2a3 | [
"MIT"
] | null | null | null | openpyxl/tests/test_cell.py | Wyss/customarrayformatter | 40e395fb272e8e69bf64056748a87c0df716e2a3 | [
"MIT"
] | null | null | null | openpyxl/tests/test_cell.py | Wyss/customarrayformatter | 40e395fb272e8e69bf64056748a87c0df716e2a3 | [
"MIT"
] | null | null | null | # file openpyxl/tests/test_cell.py
# Copyright (c) 2010-2011 openpyxl
#
# 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,... | 28.291188 | 121 | 0.676192 |
from datetime import time, datetime, timedelta
from nose.tools import eq_, raises, assert_raises
from openpyxl.worksheet import Worksheet
from openpyxl.workbook import Workbook
from openpyxl.shared.exc import ColumnStringIndexException, \
CellCoordinatesException, DataTypeException
from openpyxl.shared.date... | true | true |
1c3e82cc247161ee1625ccb0cabfc3a4f65f897e | 14,062 | py | Python | tests/providers/google/cloud/hooks/test_kubernetes_engine.py | wileeam/airflow | f46be8152a4d89c57db4ca46f5b3339e4876b723 | [
"Apache-2.0"
] | 8 | 2017-04-20T16:15:44.000Z | 2020-10-11T13:44:10.000Z | tests/providers/google/cloud/hooks/test_kubernetes_engine.py | devlocalca/airflow | 58c3542ed25061320ce61dbe0adf451a44c738dd | [
"Apache-2.0"
] | 219 | 2017-03-15T18:40:16.000Z | 2022-02-28T22:52:43.000Z | tests/providers/google/cloud/hooks/test_kubernetes_engine.py | devlocalca/airflow | 58c3542ed25061320ce61dbe0adf451a44c738dd | [
"Apache-2.0"
] | 3 | 2016-07-14T21:51:10.000Z | 2020-10-12T13:26:36.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 44.359621 | 107 | 0.685535 | import unittest
import mock
from google.cloud.container_v1.types import Cluster
from mock import PropertyMock
from airflow import AirflowException
from airflow.providers.google.cloud.hooks.kubernetes_engine import GKEHook
TASK_ID = 'test-gke-cluster-operator'
CLUSTER_NAME = 'test-cluster'
TEST_GCP_PROJECT_ID = 'test... | true | true |
1c3e850e69120700b53c04cd15ff2bb0f49eba20 | 9,662 | py | Python | templateMatching.py | AndrewMDelgado/UTA_ChessBot | e57218526102a95db8e9b4892c1c1b63b1322c98 | [
"MIT"
] | null | null | null | templateMatching.py | AndrewMDelgado/UTA_ChessBot | e57218526102a95db8e9b4892c1c1b63b1322c98 | [
"MIT"
] | null | null | null | templateMatching.py | AndrewMDelgado/UTA_ChessBot | e57218526102a95db8e9b4892c1c1b63b1322c98 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sat Apr 7 14:48:33 2018
@author: lenangungu
"""
import numpy as np
import time
from aruco_detect import detectCode
from aruco_detect import detectCode2
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import skimage.feature as sk
class Ma... | 31.472313 | 161 | 0.477541 | import numpy as np
import time
from aruco_detect import detectCode
from aruco_detect import detectCode2
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import skimage.feature as sk
class Match:
def __init__(self):
self.board = self.createBoard()
def position(self, corners):
... | true | true |
1c3e8580a517f6f1347979a29bbe093e7db77cb0 | 3,627 | py | Python | train.py | ChmarsLuo/Charms-Semantic-Segmentation-Models | 4a8cdf82a218c3d3e1c8d10ef6a9118c8e6f3f89 | [
"Apache-2.0"
] | 5 | 2021-03-09T22:56:03.000Z | 2021-06-18T12:20:34.000Z | train.py | ChmarsLuo/Charms-Semantic-Segmentation-Models | 4a8cdf82a218c3d3e1c8d10ef6a9118c8e6f3f89 | [
"Apache-2.0"
] | null | null | null | train.py | ChmarsLuo/Charms-Semantic-Segmentation-Models | 4a8cdf82a218c3d3e1c8d10ef6a9118c8e6f3f89 | [
"Apache-2.0"
] | 1 | 2021-01-23T08:32:46.000Z | 2021-01-23T08:32:46.000Z | from data import *
from keras.models import load_model
import os
import keras
from keras.optimizers import *
from lr.lr import scheduler
from keras.losses import binary_crossentropy, categorical_crossentropy
from models import MobileNext
from keras.callbacks import ModelCheckpoint, TensorBoard,\
LearningR... | 44.231707 | 121 | 0.570168 | from data import *
from keras.models import load_model
import os
import keras
from keras.optimizers import *
from lr.lr import scheduler
from keras.losses import binary_crossentropy, categorical_crossentropy
from models import MobileNext
from keras.callbacks import ModelCheckpoint, TensorBoard,\
LearningR... | true | true |
1c3e86182db408ba7ef54aa9b065e364e0d389b0 | 660 | py | Python | gencove/command/s3_imports/autoimports/autoimport_list/cli.py | gncv/gencove-cli | b4bcbe5b6a1506544472542af8b2384d21c7cbe4 | [
"Apache-2.0"
] | 1 | 2020-04-28T06:31:53.000Z | 2020-04-28T06:31:53.000Z | gencove/command/s3_imports/autoimports/autoimport_list/cli.py | gncv/gencove-cli | b4bcbe5b6a1506544472542af8b2384d21c7cbe4 | [
"Apache-2.0"
] | null | null | null | gencove/command/s3_imports/autoimports/autoimport_list/cli.py | gncv/gencove-cli | b4bcbe5b6a1506544472542af8b2384d21c7cbe4 | [
"Apache-2.0"
] | 1 | 2021-07-29T08:24:51.000Z | 2021-07-29T08:24:51.000Z | """Project autoimport from S3 URI shell command definition.
"""
import click
from gencove.command.common_cli_options import add_options, common_options
from gencove.constants import Credentials, Optionals
from .main import S3AutoImportList
@click.command("list")
@add_options(common_options)
def autoimport_list(
... | 20.625 | 74 | 0.701515 | import click
from gencove.command.common_cli_options import add_options, common_options
from gencove.constants import Credentials, Optionals
from .main import S3AutoImportList
@click.command("list")
@add_options(common_options)
def autoimport_list(
host,
email,
password,
api_key,
):
S3AutoImpor... | true | true |
1c3e86a43c2a0d5672cd50f8c9ca4f8573b62144 | 376 | py | Python | DiRa_Software/Reference/Source code final 2018-2019/LHU_The_Walker_Digital_race_2019/build/lhucds/detect/thoi_cds/lhu_odometry/catkin_generated/pkg.installspace.context.pc.py | lamhoangtung/DiRa | 6e92f465c0197f3bd60b1e5719c1cc8fa06c5e4c | [
"MIT"
] | 34 | 2019-05-07T08:44:27.000Z | 2020-05-26T13:52:32.000Z | DiRa_Software/Reference/Source code final 2018-2019/LHU_The_Walker_Digital_race_2019/build/lhucds/detect/thoi_cds/lhu_odometry/catkin_generated/pkg.installspace.context.pc.py | giangnt071098/DiRa | 71da5c9f13f3fb32d4cc1efd96d981139fb66ee5 | [
"MIT"
] | 3 | 2019-10-21T04:37:48.000Z | 2019-11-11T12:16:04.000Z | DiRa_Software/Reference/Source code final 2018-2019/LHU_The_Walker_Digital_race_2019/build/lhucds/detect/thoi_cds/lhu_odometry/catkin_generated/pkg.installspace.context.pc.py | giangnt071098/DiRa | 71da5c9f13f3fb32d4cc1efd96d981139fb66ee5 | [
"MIT"
] | 58 | 2019-03-13T09:15:15.000Z | 2021-11-19T08:32:27.000Z | # generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
PROJECT_NAME = "lhu_odometry"
PROJECT_SPACE_DIR = "/h... | 41.777778 | 68 | 0.707447 | CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
PROJECT_NAME = "lhu_odometry"
PROJECT_SPACE_DIR = "/home/nvidia/catkin_ws/install"
PROJECT_VERSION = "0.0.0"
| true | true |
1c3e86ef476debf19f99be68c61128b0c63c8b2c | 14,045 | py | Python | tests/unit/test_redshift_adapter.py | dlb8685/dbt-redshift | c1f02a1931ad6bd9cf0c2eb28bee9bf9e7da3dcf | [
"Apache-2.0"
] | 18 | 2021-10-03T09:15:30.000Z | 2022-03-31T20:32:12.000Z | tests/unit/test_redshift_adapter.py | dlb8685/dbt-redshift | c1f02a1931ad6bd9cf0c2eb28bee9bf9e7da3dcf | [
"Apache-2.0"
] | 42 | 2021-10-05T17:03:10.000Z | 2022-03-31T14:26:25.000Z | tests/unit/test_redshift_adapter.py | dlb8685/dbt-redshift | c1f02a1931ad6bd9cf0c2eb28bee9bf9e7da3dcf | [
"Apache-2.0"
] | 10 | 2021-11-02T13:16:26.000Z | 2022-03-29T07:44:24.000Z | import unittest
from unittest import mock
from unittest.mock import Mock
import agate
import boto3
from dbt.adapters.redshift import (
RedshiftAdapter,
Plugin as RedshiftPlugin,
)
from dbt.clients import agate_helper
from dbt.exceptions import FailedToConnectException
from .utils import config_from_parts_or_... | 38.165761 | 146 | 0.61068 | import unittest
from unittest import mock
from unittest.mock import Mock
import agate
import boto3
from dbt.adapters.redshift import (
RedshiftAdapter,
Plugin as RedshiftPlugin,
)
from dbt.clients import agate_helper
from dbt.exceptions import FailedToConnectException
from .utils import config_from_parts_or_... | true | true |
1c3e877201199503869f4cb34966b4d0ec86b3f6 | 277 | py | Python | src/workflow/configuration/workflow_configuration.py | piotr-kalanski/service-initializer | 1662f9cfce1d7185129063f61d9e4fbd10ec8567 | [
"Apache-2.0"
] | 1 | 2020-04-17T10:46:48.000Z | 2020-04-17T10:46:48.000Z | src/workflow/configuration/workflow_configuration.py | piotr-kalanski/service-initializer | 1662f9cfce1d7185129063f61d9e4fbd10ec8567 | [
"Apache-2.0"
] | 19 | 2020-03-17T18:40:58.000Z | 2020-03-24T18:35:36.000Z | src/workflow/configuration/workflow_configuration.py | piotr-kalanski/service-initializer | 1662f9cfce1d7185129063f61d9e4fbd10ec8567 | [
"Apache-2.0"
] | null | null | null | from typing import List
from workflow.step import Step
class WorkflowConfiguration:
def __init__(self):
self._steps = []
def add_step(self, step: Step):
self._steps.append(step)
def get_steps(self) -> List[Step]:
return self._steps
| 18.466667 | 38 | 0.649819 | from typing import List
from workflow.step import Step
class WorkflowConfiguration:
def __init__(self):
self._steps = []
def add_step(self, step: Step):
self._steps.append(step)
def get_steps(self) -> List[Step]:
return self._steps
| true | true |
1c3e87792f7fd7fb2a6073e2de754f523bdd4629 | 4,719 | py | Python | compare_past_winners.py | pdturney/modeling-symbiosis | 54e17f6619475b4678425d916ca8142e214040f0 | [
"MIT"
] | null | null | null | compare_past_winners.py | pdturney/modeling-symbiosis | 54e17f6619475b4678425d916ca8142e214040f0 | [
"MIT"
] | null | null | null | compare_past_winners.py | pdturney/modeling-symbiosis | 54e17f6619475b4678425d916ca8142e214040f0 | [
"MIT"
] | null | null | null | #
# Compare Past Winners
#
# Peter Turney, February 13, 2020
#
# Compare the top seed in generation N with the top seed
# from every preceding generation.
#
import golly as g
import model_classes as mclass
import model_functions as mfunc
import model_parameters as mparam
import numpy as np
import pickle
... | 34.698529 | 73 | 0.700996 | import golly as g
import model_classes as mclass
import model_functions as mfunc
import model_parameters as mparam
import numpy as np
import pickle
import os
import re
import sys
pickle_dir = mparam.log_directory
analysis_dir = mparam.log_directory
num_generations = mparam.num_generations
width_factor = mpa... | true | true |
1c3e8801d5bccde77ea36af7560697732cf3da40 | 958 | py | Python | isi_sdk_8_0_1/test/test_storagepool_storagepool.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 24 | 2018-06-22T14:13:23.000Z | 2022-03-23T01:21:26.000Z | isi_sdk_8_0_1/test/test_storagepool_storagepool.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 46 | 2018-04-30T13:28:22.000Z | 2022-03-21T21:11:07.000Z | isi_sdk_8_0_1/test/test_storagepool_storagepool.py | mohitjain97/isilon_sdk_python | a371f438f542568edb8cda35e929e6b300b1177c | [
"Unlicense"
] | 29 | 2018-06-19T00:14:04.000Z | 2022-02-08T17:51:19.000Z | # coding: utf-8
"""
Isilon SDK
Isilon SDK - Language bindings for the OneFS API # noqa: E501
OpenAPI spec version: 4
Contact: sdk@isilon.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import unittest
import isi_sdk_8_0_1
from i... | 23.365854 | 101 | 0.722338 |
from __future__ import absolute_import
import unittest
import isi_sdk_8_0_1
from isi_sdk_8_0_1.models.storagepool_storagepool import StoragepoolStoragepool from isi_sdk_8_0_1.rest import ApiException
class TestStoragepoolStoragepool(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):... | true | true |
1c3e883ab8dca08529839fc3dda5a2a6b5a432d2 | 3,389 | py | Python | day3/solution.py | GeertLitjens/advent-of-code-2021 | 4a4f2cfddbd7aeb839498fb4e7a916e1b429b590 | [
"Apache-2.0"
] | 10 | 2021-12-14T19:11:54.000Z | 2022-02-28T13:44:07.000Z | day3/solution.py | GeertLitjens/advent-of-code-2021 | 4a4f2cfddbd7aeb839498fb4e7a916e1b429b590 | [
"Apache-2.0"
] | null | null | null | day3/solution.py | GeertLitjens/advent-of-code-2021 | 4a4f2cfddbd7aeb839498fb4e7a916e1b429b590 | [
"Apache-2.0"
] | null | null | null | """
This day was slightly more challenging. Initially, I thought I might need to apply some binary arithmetic to solve
this problem, however, in the end this was not needed. I did decide to use numpy for fast and easy handling of arrays.
Potentially there is a smarter/faster/code-efficient solution that I didn't think ... | 52.138462 | 119 | 0.660962 |
from utils import Solution
from typing import Any
import numpy as np
class DaySolution(Solution):
def __init__(self, day: int = 3, year: int = 2021) -> None:
super().__init__(day, year)
def _parse_data(self, input_data: str) -> Any:
string_list = [list(x) for x in input_data.split("\n") if x... | true | true |
1c3e88eeb6cbbc89bf3d8872735e281a4c5d0264 | 7,084 | py | Python | src/zope/intid/__init__.py | zopefoundation/zope.intid | 3ae7ac3232167ae6d54dd920ce7fd179ba128615 | [
"ZPL-2.1"
] | null | null | null | src/zope/intid/__init__.py | zopefoundation/zope.intid | 3ae7ac3232167ae6d54dd920ce7fd179ba128615 | [
"ZPL-2.1"
] | 10 | 2016-03-24T15:24:16.000Z | 2021-03-19T11:38:48.000Z | src/zope/intid/__init__.py | zopefoundation/zope.intid | 3ae7ac3232167ae6d54dd920ce7fd179ba128615 | [
"ZPL-2.1"
] | 1 | 2015-04-03T09:06:50.000Z | 2015-04-03T09:06:50.000Z | ##############################################################################
#
# Copyright (c) 2001, 2002 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# TH... | 32.2 | 93 | 0.644975 | import random
import BTrees
from persistent import Persistent
from zope.component import adapter, getAllUtilitiesRegisteredFor, handle
from zope.event import notify
from zope.interface import implementer
from zope.keyreference.interfaces import IKeyReference, NotYet
from zope.lifecycleevent.interfaces import IObjectAd... | true | true |
1c3e89df476a8f3325bd09f766c6144661f65418 | 8,121 | py | Python | NHentai/nhentai.py | AlexandreSenpai/NHentai-API | d209b6f1c9bb0a01c605929ce91b1fd360811afb | [
"MIT"
] | 33 | 2020-07-12T04:00:05.000Z | 2022-03-27T12:50:57.000Z | NHentai/nhentai.py | AlexandreSenpai/NHentai-API | d209b6f1c9bb0a01c605929ce91b1fd360811afb | [
"MIT"
] | 16 | 2020-07-24T14:37:11.000Z | 2022-03-06T01:57:02.000Z | NHentai/nhentai.py | AlexandreSenpai/NHentai-API | d209b6f1c9bb0a01c605929ce91b1fd360811afb | [
"MIT"
] | 14 | 2020-07-09T18:42:13.000Z | 2022-03-11T13:30:06.000Z | import logging
from typing import Optional, Union
from urllib.parse import urljoin
from .utils.cache import Cache
from .base_wrapper import BaseWrapper
from .entities.doujin import Doujin, DoujinThumbnail
from .entities.page import (Page,
SearchPage,
TagListPag... | 36.746606 | 119 | 0.550794 | import logging
from typing import Optional, Union
from urllib.parse import urljoin
from .utils.cache import Cache
from .base_wrapper import BaseWrapper
from .entities.doujin import Doujin, DoujinThumbnail
from .entities.page import (Page,
SearchPage,
TagListPag... | true | true |
1c3e8de387bbb312c047ea617eb3ac0f5779e29a | 377 | py | Python | WtFrac.py | Lam3name/TKP4120 | d433d45841adea50b323d910240a9537e9475b7f | [
"CC0-1.0"
] | null | null | null | WtFrac.py | Lam3name/TKP4120 | d433d45841adea50b323d910240a9537e9475b7f | [
"CC0-1.0"
] | null | null | null | WtFrac.py | Lam3name/TKP4120 | d433d45841adea50b323d910240a9537e9475b7f | [
"CC0-1.0"
] | null | null | null | import scipy.optimize
import numpy as np
import matplotlib.pyplot as plt
import constants as con
def WtFracCO2(alpha):
return ((con.Mw[0])*alpha)/((1+(0.7/0.3))*con.MwMEA)
def WtFracToAbsMol(tot, percent, molarMass):
return((tot*percent)/molarMass*1000) # mol/s
def fracMolToFracWt(tot, percent, molarmass... | 26.928571 | 56 | 0.70557 | import scipy.optimize
import numpy as np
import matplotlib.pyplot as plt
import constants as con
def WtFracCO2(alpha):
return ((con.Mw[0])*alpha)/((1+(0.7/0.3))*con.MwMEA)
def WtFracToAbsMol(tot, percent, molarMass):
return((tot*percent)/molarMass*1000)
def fracMolToFracWt(tot, percent, molarmass):
r... | true | true |
1c3e8ed1f19607ace9274bfadcb5a2b0fc836964 | 13,931 | py | Python | homeassistant/components/logbook.py | GotoCode/home-assistant | 7e39a5c4d50cf5754f5f32a84870ca57a5778b02 | [
"Apache-2.0"
] | 11 | 2017-09-25T13:11:33.000Z | 2020-05-16T21:54:28.000Z | homeassistant/components/logbook.py | GotoCode/home-assistant | 7e39a5c4d50cf5754f5f32a84870ca57a5778b02 | [
"Apache-2.0"
] | 125 | 2018-12-11T07:31:20.000Z | 2021-07-27T08:20:03.000Z | homeassistant/components/logbook.py | y1ngyang/home-assistant | 7e39a5c4d50cf5754f5f32a84870ca57a5778b02 | [
"Apache-2.0"
] | 3 | 2018-05-22T18:52:01.000Z | 2019-07-18T21:30:45.000Z | """
Event parser and human readable log generator.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/logbook/
"""
import asyncio
import logging
from datetime import timedelta
from itertools import groupby
import voluptuous as vol
from homeassistant.core ... | 34.397531 | 79 | 0.612375 | import asyncio
import logging
from datetime import timedelta
from itertools import groupby
import voluptuous as vol
from homeassistant.core import callback
import homeassistant.helpers.config_validation as cv
import homeassistant.util.dt as dt_util
from homeassistant.components import sun
from homeassistant.component... | true | true |
1c3e8f5ccaa603cbef7cff415ec0d35ca6c9628a | 829 | py | Python | maza/modules/creds/cameras/speco/ssh_default_creds.py | ArturSpirin/maza | 56ae6325c08bcedd22c57b9fe11b58f1b38314ca | [
"MIT"
] | 2 | 2020-02-06T20:24:31.000Z | 2022-03-08T19:07:16.000Z | maza/modules/creds/cameras/speco/ssh_default_creds.py | ArturSpirin/maza | 56ae6325c08bcedd22c57b9fe11b58f1b38314ca | [
"MIT"
] | null | null | null | maza/modules/creds/cameras/speco/ssh_default_creds.py | ArturSpirin/maza | 56ae6325c08bcedd22c57b9fe11b58f1b38314ca | [
"MIT"
] | null | null | null | from maza.core.exploit import *
from maza.modules.creds.generic.ssh_default import Exploit as SSHDefault
class Exploit(SSHDefault):
__info__ = {
"name": "Speco Camera Default SSH Creds",
"description": "Module performs dictionary attack against Speco Camera SSH service. "
"I... | 36.043478 | 96 | 0.624849 | from maza.core.exploit import *
from maza.modules.creds.generic.ssh_default import Exploit as SSHDefault
class Exploit(SSHDefault):
__info__ = {
"name": "Speco Camera Default SSH Creds",
"description": "Module performs dictionary attack against Speco Camera SSH service. "
"I... | true | true |
1c3e8f781c2f1741b461701bb73d3a842cced438 | 1,523 | py | Python | tests/test_performance.py | manycoding/pytest-performance | f6473d0ac9c6ac58be9a13d2c9955810dc9962e4 | [
"MIT"
] | 5 | 2020-09-14T12:18:55.000Z | 2022-01-07T11:36:09.000Z | tests/test_performance.py | manycoding/pytest-performance | f6473d0ac9c6ac58be9a13d2c9955810dc9962e4 | [
"MIT"
] | 1 | 2021-09-01T15:06:31.000Z | 2021-09-01T15:06:31.000Z | tests/test_performance.py | manycoding/pytest-performance | f6473d0ac9c6ac58be9a13d2c9955810dc9962e4 | [
"MIT"
] | 1 | 2021-03-11T15:20:05.000Z | 2021-03-11T15:20:05.000Z | # -*- coding: utf-8 -*-
from _pytest.config import ExitCode
from pytest_performance import SKIP_FLAG
def test_performance(testdir):
# Given
testdir.makepyfile("""
def foo():
return 1
def test_sth(performance):
assert 1 == performance(foo, unit='s')
""")
# Whe... | 18.802469 | 59 | 0.580433 | from _pytest.config import ExitCode
from pytest_performance import SKIP_FLAG
def test_performance(testdir):
testdir.makepyfile("""
def foo():
return 1
def test_sth(performance):
assert 1 == performance(foo, unit='s')
""")
result = testdir.runpytest()
... | true | true |
1c3e90d3f35f39a658602e8cef7ee1e6154cdd37 | 709 | py | Python | Intents/__init__.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 4 | 2019-03-11T18:05:49.000Z | 2021-05-22T21:09:09.000Z | Intents/__init__.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | Intents/__init__.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 1 | 2019-03-18T18:53:36.000Z | 2019-03-18T18:53:36.000Z | '''
Python mapping for the Intents framework.
This module does not contain docstrings for the wrapped code, check Apple's
documentation for details on how to use these functions and classes.
'''
import objc
import sys
import Foundation
from Intents import _metadata
from Intents._Intents import *
sys.modules['Inten... | 24.448276 | 75 | 0.705219 |
import objc
import sys
import Foundation
from Intents import _metadata
from Intents._Intents import *
sys.modules['Intents'] = mod = objc.ObjCLazyModule(
"Intents",
"com.apple.Intents",
objc.pathForFramework("/System/Library/Frameworks/Intents.framework"),
_metadata.__dict__, None, {
'__doc_... | true | true |
1c3e91ca1ff386eb0061642315e5264fc880d898 | 609 | py | Python | migrations/0002_auto_20180330_1541.py | j-ollivier/sonov-main | 78123513fa73deae174363750fd64ab3e92a3d2a | [
"Apache-2.0"
] | null | null | null | migrations/0002_auto_20180330_1541.py | j-ollivier/sonov-main | 78123513fa73deae174363750fd64ab3e92a3d2a | [
"Apache-2.0"
] | null | null | null | migrations/0002_auto_20180330_1541.py | j-ollivier/sonov-main | 78123513fa73deae174363750fd64ab3e92a3d2a | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.0.3 on 2018-03-30 13:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='son',
name='audio_file',
field... | 24.36 | 78 | 0.576355 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('main', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='son',
name='audio_file',
field=models.FileField(default='', upload_to='static/... | true | true |
1c3e93fcc37764a327723d2663f9748a7fb8c3b8 | 427 | py | Python | algorithms/mDSDI/src/models/model_factory.py | VinAIResearch/mDSDI | 8ec49085d8389ab490ec633c3ae4bf66be085366 | [
"Apache-2.0"
] | 9 | 2021-09-30T12:39:01.000Z | 2022-03-17T07:49:59.000Z | algorithms/mDSDI/src/models/model_factory.py | VinAIResearch/mDSDI | 8ec49085d8389ab490ec633c3ae4bf66be085366 | [
"Apache-2.0"
] | null | null | null | algorithms/mDSDI/src/models/model_factory.py | VinAIResearch/mDSDI | 8ec49085d8389ab490ec633c3ae4bf66be085366 | [
"Apache-2.0"
] | 1 | 2022-01-13T06:02:04.000Z | 2022-01-13T06:02:04.000Z | from algorithms.mDSDI.src.models.mnistnet import MNIST_CNN, Color_MNIST_CNN
from algorithms.mDSDI.src.models.resnet import ResNet
nets_map = {"mnistnet": MNIST_CNN, "cmnistnet": Color_MNIST_CNN, "resnet50": ResNet}
def get_model(name):
if name not in nets_map:
raise ValueError("Name of model unknown %s"... | 26.6875 | 84 | 0.728337 | from algorithms.mDSDI.src.models.mnistnet import MNIST_CNN, Color_MNIST_CNN
from algorithms.mDSDI.src.models.resnet import ResNet
nets_map = {"mnistnet": MNIST_CNN, "cmnistnet": Color_MNIST_CNN, "resnet50": ResNet}
def get_model(name):
if name not in nets_map:
raise ValueError("Name of model unknown %s"... | true | true |
1c3e9520fb0514245589ee15baf161677033977a | 14,397 | py | Python | selfdrive/updated.py | 919bot/Tessa | 9b48ff9020e8fb6992fc78271f2720fd19e01093 | [
"MIT"
] | null | null | null | selfdrive/updated.py | 919bot/Tessa | 9b48ff9020e8fb6992fc78271f2720fd19e01093 | [
"MIT"
] | null | null | null | selfdrive/updated.py | 919bot/Tessa | 9b48ff9020e8fb6992fc78271f2720fd19e01093 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Safe Update: A simple service that waits for network access and tries to
# update every 10 minutes. It's intended to make the OP update process more
# robust against Git repository corruption. This service DOES NOT try to fix
# an already-corrupt BASEDIR Git repo, only prevent it from happenin... | 37.010283 | 139 | 0.720845 |
# robust against Git repository corruption. This service DOES NOT try to fix
# an already-corrupt BASEDIR Git repo, only prevent it from happening.
#
# During normal operation, both onroad and offroad, the update process makes
# no changes to the BASEDIR install of OP. All update attempts are performed
# in a disposab... | true | true |
1c3e9548ed0e3626ec1a8937ed1278f1b9c00411 | 3,742 | py | Python | server/src/test/unit/weblab/experiment/devices/xilinx_impact/test_impact.py | zstars/weblabdeusto | 09bd9d93d483671bca67ee5c70a9c412eb5d352f | [
"BSD-2-Clause"
] | null | null | null | server/src/test/unit/weblab/experiment/devices/xilinx_impact/test_impact.py | zstars/weblabdeusto | 09bd9d93d483671bca67ee5c70a9c412eb5d352f | [
"BSD-2-Clause"
] | null | null | null | server/src/test/unit/weblab/experiment/devices/xilinx_impact/test_impact.py | zstars/weblabdeusto | 09bd9d93d483671bca67ee5c70a9c412eb5d352f | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2005 onwards University of Deusto
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# This software consists of contributions made by many individuals,
# list... | 29.936 | 72 | 0.66542 | import unittest
import test.unit.configuration as configuration_module
import voodoo.configuration as ConfigurationManager
import weblab.experiment.devices.xilinx_impact.impact as XilinxImpact
import weblab.experiment.devices.xilinx_impact.exc as XilinxImpactErrors
class XilinxImpactTestCase(unittest.TestCase):
... | true | true |
1c3e957f964646052cf94f35d12a79cbb6d2862c | 16,861 | py | Python | tools/mo/unit_tests/mo/back/ReverseInputChannels_test.py | opencv/dldt | c0a2c98a457a08e8853abc18f5bd462169d0b354 | [
"Apache-2.0"
] | 1,127 | 2018-10-15T14:36:58.000Z | 2020-04-20T09:29:44.000Z | tools/mo/unit_tests/mo/back/ReverseInputChannels_test.py | opencv/dldt | c0a2c98a457a08e8853abc18f5bd462169d0b354 | [
"Apache-2.0"
] | 439 | 2018-10-20T04:40:35.000Z | 2020-04-19T05:56:25.000Z | tools/mo/unit_tests/mo/back/ReverseInputChannels_test.py | opencv/dldt | c0a2c98a457a08e8853abc18f5bd462169d0b354 | [
"Apache-2.0"
] | 414 | 2018-10-17T05:53:46.000Z | 2020-04-16T17:29:53.000Z | # Copyright (C) 2018-2022 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
import unittest
from argparse import Namespace
import numpy as np
from openvino.tools.mo.back.ReverseInputChannels import ReverseChannelsPropagationUp, ReverseChannelsPropagationDown, \
InsertReverseChannels
from openvino.tools.mo.... | 54.041667 | 120 | 0.593678 |
import unittest
from argparse import Namespace
import numpy as np
from openvino.tools.mo.back.ReverseInputChannels import ReverseChannelsPropagationUp, ReverseChannelsPropagationDown, \
InsertReverseChannels
from openvino.tools.mo.front.common.partial_infer.utils import int64_array, float32_array
from openvino.t... | true | true |
1c3e9590f25c453699d93c4863127de74e780963 | 7,493 | py | Python | starter_code/learner/learners.py | mbchang/societal-decision-making | 23fd6de4df33f985d360330a9d5a2c29faeb8e52 | [
"MIT"
] | 38 | 2020-08-17T14:18:22.000Z | 2022-02-27T13:12:40.000Z | starter_code/learner/learners.py | mbchang/societal-decision-making | 23fd6de4df33f985d360330a9d5a2c29faeb8e52 | [
"MIT"
] | 3 | 2021-06-08T22:17:35.000Z | 2022-03-12T00:46:27.000Z | starter_code/learner/learners.py | mbchang/societal-decision-making | 23fd6de4df33f985d360330a9d5a2c29faeb8e52 | [
"MIT"
] | 3 | 2020-08-21T05:28:35.000Z | 2022-03-31T17:07:48.000Z | from collections import OrderedDict
from starter_code.learner.learner import Learner
from starter_code.infrastructure.log import log_string, MinigridEnvManager
from starter_code.interfaces.transitions import AgentStepInfo, OptionStepInfo, AuctionStepInfo, OptionAuctionStepInfo
from starter_code.sampler.decentralized_s... | 48.341935 | 180 | 0.613506 | from collections import OrderedDict
from starter_code.learner.learner import Learner
from starter_code.infrastructure.log import log_string, MinigridEnvManager
from starter_code.interfaces.transitions import AgentStepInfo, OptionStepInfo, AuctionStepInfo, OptionAuctionStepInfo
from starter_code.sampler.decentralized_s... | true | true |
1c3e966b1c5c70d1bbee3ae15b82d627d6a88bb5 | 192 | py | Python | Mock/Midterm/q1c-unnerfed.py | RussellDash332/practice-makes-perfect | 917822b461550a2e3679351e467362f95d9e428d | [
"MIT"
] | 2 | 2021-11-18T06:22:09.000Z | 2021-12-25T09:52:57.000Z | Mock/Midterm/q1c-unnerfed.py | RussellDash332/practice-makes-perfect | 917822b461550a2e3679351e467362f95d9e428d | [
"MIT"
] | 2 | 2021-11-17T16:28:00.000Z | 2021-12-01T09:59:40.000Z | Mock/Midterm/q1c-unnerfed.py | RussellDash332/practice-makes-perfect | 917822b461550a2e3679351e467362f95d9e428d | [
"MIT"
] | null | null | null | m, p = "mutton", "python"
mp = m+p+"ton"
if "on" in mp:
if p in mp:
p = "p"
print("yum")
if "on" in p:
print("bum")
elif mp:
print("tum")
| 17.454545 | 26 | 0.390625 | m, p = "mutton", "python"
mp = m+p+"ton"
if "on" in mp:
if p in mp:
p = "p"
print("yum")
if "on" in p:
print("bum")
elif mp:
print("tum")
| true | true |
1c3e96a2f308439d029d90059fce07c86e844515 | 7,848 | py | Python | models/menu.py | juushya/Kvasir | bc9fa5864ed1cf40a3a4fe2dae7f24f754267c78 | [
"BSD-3-Clause"
] | null | null | null | models/menu.py | juushya/Kvasir | bc9fa5864ed1cf40a3a4fe2dae7f24f754267c78 | [
"BSD-3-Clause"
] | null | null | null | models/menu.py | juushya/Kvasir | bc9fa5864ed1cf40a3a4fe2dae7f24f754267c78 | [
"BSD-3-Clause"
] | null | null | null | _a = request.application
response.logo = A(B('KVASIR'), _class="brand")
response.title = settings.title
response.subtitle = settings.subtitle
response.meta.author = '%s <%s>' % (settings.author, settings.author_email)
response.meta.keywords = settings.keywords
response.meta.description = settings.description
response... | 53.753425 | 130 | 0.49554 | _a = request.application
response.logo = A(B('KVASIR'), _class="brand")
response.title = settings.title
response.subtitle = settings.subtitle
response.meta.author = '%s <%s>' % (settings.author, settings.author_email)
response.meta.keywords = settings.keywords
response.meta.description = settings.description
response... | true | true |
1c3e9722782b9f83edcb11429ff520945f9729f7 | 2,066 | py | Python | example/app/settings.py | jbking/django-oidc-provider | f0daed07b2ac7608565b80d4c80ccf04d8c416a8 | [
"MIT"
] | 370 | 2015-03-10T03:12:53.000Z | 2022-03-13T05:49:40.000Z | example/app/settings.py | jbking/django-oidc-provider | f0daed07b2ac7608565b80d4c80ccf04d8c416a8 | [
"MIT"
] | 305 | 2015-02-12T17:58:26.000Z | 2022-02-25T19:48:41.000Z | example/app/settings.py | jbking/django-oidc-provider | f0daed07b2ac7608565b80d4c80ccf04d8c416a8 | [
"MIT"
] | 271 | 2015-03-17T00:57:22.000Z | 2022-02-17T11:21:22.000Z | # Build paths inside the project like this: os.path.join(BASE_DIR, ...)
import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
SECRET_KEY = 'c14d549c574e4d8cf162404ef0b04598'
DEBUG = True
TEMPLATE_DEBUG = False
ALLOWED_HOSTS = ['*']
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',... | 22.456522 | 71 | 0.683446 | import os
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
SECRET_KEY = 'c14d549c574e4d8cf162404ef0b04598'
DEBUG = True
TEMPLATE_DEBUG = False
ALLOWED_HOSTS = ['*']
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
... | true | true |
1c3e998b9342a4dd7b2dce19744c8e34e5d95b7c | 180 | py | Python | tests/web_platform/css_flexbox_1/test_flexbox_flex_0_1_N_unitless_basis.py | fletchgraham/colosseum | 77be4896ee52b8f5956a3d77b5f2ccd2c8608e8f | [
"BSD-3-Clause"
] | null | null | null | tests/web_platform/css_flexbox_1/test_flexbox_flex_0_1_N_unitless_basis.py | fletchgraham/colosseum | 77be4896ee52b8f5956a3d77b5f2ccd2c8608e8f | [
"BSD-3-Clause"
] | null | null | null | tests/web_platform/css_flexbox_1/test_flexbox_flex_0_1_N_unitless_basis.py | fletchgraham/colosseum | 77be4896ee52b8f5956a3d77b5f2ccd2c8608e8f | [
"BSD-3-Clause"
] | 1 | 2020-01-16T01:56:41.000Z | 2020-01-16T01:56:41.000Z | from tests.utils import W3CTestCase
class TestFlexbox_Flex01NUnitlessBasis(W3CTestCase):
vars().update(W3CTestCase.find_tests(__file__, 'flexbox_flex-0-1-N-unitless-basis'))
| 30 | 88 | 0.811111 | from tests.utils import W3CTestCase
class TestFlexbox_Flex01NUnitlessBasis(W3CTestCase):
vars().update(W3CTestCase.find_tests(__file__, 'flexbox_flex-0-1-N-unitless-basis'))
| true | true |
1c3e9a29ee05e6cb175f2be801373c64e64750f2 | 481 | py | Python | test/test_db_matches_ui.py | karagioz/python_training | 47bdbc550eda347f72aaf75dd3569d2c61106356 | [
"Apache-2.0"
] | null | null | null | test/test_db_matches_ui.py | karagioz/python_training | 47bdbc550eda347f72aaf75dd3569d2c61106356 | [
"Apache-2.0"
] | null | null | null | test/test_db_matches_ui.py | karagioz/python_training | 47bdbc550eda347f72aaf75dd3569d2c61106356 | [
"Apache-2.0"
] | null | null | null | from model.group import Group
from timeit import timeit
def test_group_list(app, db):
print(timeit(lambda: app.group.get_group_list(), number=1))
ui_list = app.group.get_group_list()
def clean(group):
return Group(id=group.id, name=group.name.strip())
print(timeit(lambda: map(clean, db.get_gr... | 34.357143 | 87 | 0.715177 | from model.group import Group
from timeit import timeit
def test_group_list(app, db):
print(timeit(lambda: app.group.get_group_list(), number=1))
ui_list = app.group.get_group_list()
def clean(group):
return Group(id=group.id, name=group.name.strip())
print(timeit(lambda: map(clean, db.get_gr... | true | true |
1c3e9a93f3dffeb4d7093c7ec141c50bb1019b1f | 4,850 | py | Python | zeeb_src/lib/scanner.py | th3cyb3rc0p/Zeebsploit | 5d3bee6c3a459f172ef117548c3a895195a249ff | [
"Apache-2.0"
] | 186 | 2019-02-01T16:14:09.000Z | 2022-03-10T06:43:16.000Z | zeeb_src/lib/scanner.py | Tonymmm/Zeebsploit | 5d3bee6c3a459f172ef117548c3a895195a249ff | [
"Apache-2.0"
] | 8 | 2019-02-02T19:09:07.000Z | 2019-10-03T05:06:27.000Z | zeeb_src/lib/scanner.py | Tonymmm/Zeebsploit | 5d3bee6c3a459f172ef117548c3a895195a249ff | [
"Apache-2.0"
] | 65 | 2019-02-25T07:28:03.000Z | 2021-10-30T19:59:57.000Z |
#-*- coding: utf-8 -*-
import asyncio,aiohttp,requests,os,urllib3,aiofiles,re
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
class subdomain_enumeration(object):
def __init__(self,domain):
self.domain = domain
self.url = 'https://dnsdumpster.com'
self.uag = 'M... | 35.925926 | 117 | 0.478144 |
import asyncio,aiohttp,requests,os,urllib3,aiofiles,re
urllib3.disable_warnings(urllib3.exceptions.InsecureRequestWarning)
class subdomain_enumeration(object):
def __init__(self,domain):
self.domain = domain
self.url = 'https://dnsdumpster.com'
self.uag = 'Mozilla/5.0 (compatible;... | true | true |
1c3e9aa4508a692e561336b57c059caf9056b9b3 | 2,948 | py | Python | process.py | yangliu2/BearNotes_to_Notion | ae06f4c3fbdefe2020899416e5b478ad9d434664 | [
"MIT"
] | 1 | 2021-02-07T17:59:26.000Z | 2021-02-07T17:59:26.000Z | process.py | yangliu2/BearNotes_to_Notion | ae06f4c3fbdefe2020899416e5b478ad9d434664 | [
"MIT"
] | null | null | null | process.py | yangliu2/BearNotes_to_Notion | ae06f4c3fbdefe2020899416e5b478ad9d434664 | [
"MIT"
] | null | null | null | from glob import glob
from pathlib import Path
def bear_to_notion(source_folder: str = 'bear_notes',
dst_folder: str = 'changed_notes') -> None:
"""Convert Bear notes in markdown format to Notion formats. It mainly
remove the tags
Args:
source_folder (str, optional): [descriptio... | 33.123596 | 79 | 0.500678 | from glob import glob
from pathlib import Path
def bear_to_notion(source_folder: str = 'bear_notes',
dst_folder: str = 'changed_notes') -> None:
file_list = glob("bear_notes/*.md")
for file in file_list:
output = ""
title = ""
with open(file) as input_f... | true | true |
1c3e9ab846f7918dcf9e79fdc7c1a3960ef0324e | 1,408 | py | Python | terrascript/opsgenie/r.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 507 | 2017-07-26T02:58:38.000Z | 2022-01-21T12:35:13.000Z | terrascript/opsgenie/r.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 135 | 2017-07-20T12:01:59.000Z | 2021-10-04T22:25:40.000Z | terrascript/opsgenie/r.py | mjuenema/python-terrascript | 6d8bb0273a14bfeb8ff8e950fe36f97f7c6e7b1d | [
"BSD-2-Clause"
] | 81 | 2018-02-20T17:55:28.000Z | 2022-01-31T07:08:40.000Z | # terrascript/opsgenie/r.py
# Automatically generated by tools/makecode.py ()
import warnings
warnings.warn(
"using the 'legacy layout' is deprecated", DeprecationWarning, stacklevel=2
)
import terrascript
class opsgenie_alert_policy(terrascript.Resource):
pass
class opsgenie_api_integration(terrascript.R... | 16.372093 | 79 | 0.791193 |
import warnings
warnings.warn(
"using the 'legacy layout' is deprecated", DeprecationWarning, stacklevel=2
)
import terrascript
class opsgenie_alert_policy(terrascript.Resource):
pass
class opsgenie_api_integration(terrascript.Resource):
pass
class opsgenie_custom_role(terrascript.Resource):
pas... | true | true |
1c3e9b4eca04a197b5e9a5aa98e9653eb68cc0da | 213 | py | Python | rapa/__init__.py | FOXOBioScience/rapa | ab226d0c27a867b43a76f576c98a954de9504360 | [
"MIT"
] | 1 | 2021-04-29T16:42:12.000Z | 2021-04-29T16:42:12.000Z | rapa/__init__.py | FoxoTech/rapa | ab226d0c27a867b43a76f576c98a954de9504360 | [
"MIT"
] | 4 | 2021-02-24T18:24:17.000Z | 2021-03-18T17:58:51.000Z | rapa/__init__.py | FOXOBioScience/rapa | ab226d0c27a867b43a76f576c98a954de9504360 | [
"MIT"
] | 1 | 2021-11-12T02:04:05.000Z | 2021-11-12T02:04:05.000Z | # Warnings from dependencies are suppressed everywhere, propagating into all created loggers
import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
from . import rapa
from . import version | 35.5 | 92 | 0.830986 | import warnings
warnings.simplefilter(action='ignore', category=FutureWarning)
from . import rapa
from . import version | true | true |
1c3e9b81fd617497d11f8c7dfa97e3268d0c825b | 17,342 | py | Python | backend/backend/utils/key_client.py | ravirahman/sancus | 6563852b98edeb1068574e2d99e1fc18b815bee3 | [
"MIT"
] | 2 | 2022-03-17T04:50:20.000Z | 2022-03-17T04:51:31.000Z | backend/backend/utils/key_client.py | ravirahman/sancus | 6563852b98edeb1068574e2d99e1fc18b815bee3 | [
"MIT"
] | null | null | null | backend/backend/utils/key_client.py | ravirahman/sancus | 6563852b98edeb1068574e2d99e1fc18b815bee3 | [
"MIT"
] | null | null | null | import logging
import secrets
import uuid
from decimal import Decimal
from typing import List, Optional, Sequence
import petlib.ec
import sqlalchemy.orm
from common.constants import ADMIN_UUID, SECP256K1_ORDER, Blockchain, Currency
from common.utils.uuid import generate_uuid4
from common.utils.zk import NIZK
from comm... | 41.787952 | 116 | 0.589897 | import logging
import secrets
import uuid
from decimal import Decimal
from typing import List, Optional, Sequence
import petlib.ec
import sqlalchemy.orm
from common.constants import ADMIN_UUID, SECP256K1_ORDER, Blockchain, Currency
from common.utils.uuid import generate_uuid4
from common.utils.zk import NIZK
from comm... | true | true |
1c3e9bc31b47a9334ee2b0d528b713b934e10f10 | 62 | py | Python | Python_Code/PRs/num01_Natarajan_Lalgudi.py | abhiramr/ProjectEuler-Abhi | c86a964e5b2dbf79bc494d7d7d28ce7807504cd3 | [
"MIT"
] | 2 | 2019-10-20T12:09:10.000Z | 2021-02-13T05:51:08.000Z | Python_Code/PRs/num01_Natarajan_Lalgudi.py | abhiramr/ProjectEuler_Solutions | c86a964e5b2dbf79bc494d7d7d28ce7807504cd3 | [
"MIT"
] | 1 | 2019-10-20T03:26:55.000Z | 2019-10-20T03:26:55.000Z | Python_Code/PRs/num01_Natarajan_Lalgudi.py | abhiramr/ProjectEuler-Abhi | c86a964e5b2dbf79bc494d7d7d28ce7807504cd3 | [
"MIT"
] | 9 | 2019-10-20T05:47:02.000Z | 2019-10-20T06:06:03.000Z | lst = [x for x in range(1000) if (x%3==0 or x%5==0)]
sum(lst)
| 20.666667 | 52 | 0.564516 | lst = [x for x in range(1000) if (x%3==0 or x%5==0)]
sum(lst)
| true | true |
1c3e9cb2bbe6ea1bde1164fb502cb7f3dd4932b0 | 2,290 | py | Python | src/moderations/management/commands/send_stats_to_gspread.py | definitelysecure/shipwrecked | 3b79c6df63ed3c271ccb1b8a21081c76bcd9f08a | [
"MIT"
] | null | null | null | src/moderations/management/commands/send_stats_to_gspread.py | definitelysecure/shipwrecked | 3b79c6df63ed3c271ccb1b8a21081c76bcd9f08a | [
"MIT"
] | null | null | null | src/moderations/management/commands/send_stats_to_gspread.py | definitelysecure/shipwrecked | 3b79c6df63ed3c271ccb1b8a21081c76bcd9f08a | [
"MIT"
] | null | null | null | import gspread
from oauth2client.service_account import ServiceAccountCredentials
from oauth2client import crypt
from django.core.management.base import BaseCommand
from django.utils import timezone
from moderation.settings import GOOGLE_DOCS_API_PRIVATE_KEY, GOOGLE_DOCS_API_SERVICE_ACCOUNT_EMAIL
from moderations.stats... | 44.901961 | 102 | 0.672926 | import gspread
from oauth2client.service_account import ServiceAccountCredentials
from oauth2client import crypt
from django.core.management.base import BaseCommand
from django.utils import timezone
from moderation.settings import GOOGLE_DOCS_API_PRIVATE_KEY, GOOGLE_DOCS_API_SERVICE_ACCOUNT_EMAIL
from moderations.stats... | true | true |
1c3e9e2510a719d6ad1d93fce4df6c7e85a8f21a | 906 | py | Python | examples/pytorch/answer-generator/predictor.py | SSITB/cortex | cb9b64d466fedaceb1cb9171914ffb31409927fe | [
"Apache-2.0"
] | 1 | 2019-11-25T05:47:35.000Z | 2019-11-25T05:47:35.000Z | examples/pytorch/answer-generator/predictor.py | SSITB/cortex | cb9b64d466fedaceb1cb9171914ffb31409927fe | [
"Apache-2.0"
] | null | null | null | examples/pytorch/answer-generator/predictor.py | SSITB/cortex | cb9b64d466fedaceb1cb9171914ffb31409927fe | [
"Apache-2.0"
] | null | null | null | import wget
import torch
from transformers import GPT2Tokenizer, GPT2LMHeadModel, GPT2Config
import generator
medium_config = GPT2Config(n_embd=1024, n_layer=24, n_head=16)
model = GPT2LMHeadModel(medium_config)
tokenizer = GPT2Tokenizer.from_pretrained("gpt2")
def init(model_path, metadata):
wget.download(
... | 30.2 | 99 | 0.748344 | import wget
import torch
from transformers import GPT2Tokenizer, GPT2LMHeadModel, GPT2Config
import generator
medium_config = GPT2Config(n_embd=1024, n_layer=24, n_head=16)
model = GPT2LMHeadModel(medium_config)
tokenizer = GPT2Tokenizer.from_pretrained("gpt2")
def init(model_path, metadata):
wget.download(
... | true | true |
1c3e9e2c60ee00b4900a5d98d0339667c62cd6c3 | 1,165 | py | Python | test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyFormDataVersionTolerant/setup.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | null | null | null | test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyFormDataVersionTolerant/setup.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | null | null | null | test/vanilla/version-tolerant/Expected/AcceptanceTests/BodyFormDataVersionTolerant/setup.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 30.657895 | 94 | 0.635193 |
from setuptools import setup, find_packages
NAME = "autorestswaggerbatformdataservice"
VERSION = "0.1.0"
REQUIRES = ["msrest>=0.6.21", "azure-core<2.0.0,>=1.20.0"]
setup(
name=NAME,
version=VERSION,
description="AutoRestSwaggerBATFormDataService",
author_email="",
url="",
keywords=["Swagger... | true | true |
1c3e9fbeb5e1b10666670d451af1d807c912d958 | 419 | py | Python | learn_python/json/json_read_write.py | Yeasmin-Tasnima/Python | eb172450c66bbc69133cd92290c4027cafef579f | [
"Apache-2.0"
] | null | null | null | learn_python/json/json_read_write.py | Yeasmin-Tasnima/Python | eb172450c66bbc69133cd92290c4027cafef579f | [
"Apache-2.0"
] | null | null | null | learn_python/json/json_read_write.py | Yeasmin-Tasnima/Python | eb172450c66bbc69133cd92290c4027cafef579f | [
"Apache-2.0"
] | null | null | null | import json
book = {}
book['tom'] = {
'address': 'dhaka',
'phone': 1234
}
book['bob'] = {
'address': 'dinajpur',
'phone': 5678
}
s = json.dumps(book)
# writing
with open('book.txt', 'w') as f:
f.write(s)
# read json file as a string
f = open('book.txt', 'r')
book = f.read()
print(type(book))
p... | 13.516129 | 32 | 0.594272 | import json
book = {}
book['tom'] = {
'address': 'dhaka',
'phone': 1234
}
book['bob'] = {
'address': 'dinajpur',
'phone': 5678
}
s = json.dumps(book)
with open('book.txt', 'w') as f:
f.write(s)
f = open('book.txt', 'r')
book = f.read()
print(type(book))
print(book)
book = json.loads(book)
pri... | true | true |
1c3e9fcb412b8bde1a6852ee7411071417babf41 | 25,595 | py | Python | src/sagemaker/fw_utils.py | ram-nadella/sagemaker-python-sdk | 0ed415f96483f29c2c8b7a320bb825a993e116b2 | [
"Apache-2.0"
] | 1 | 2020-11-20T14:48:24.000Z | 2020-11-20T14:48:24.000Z | src/sagemaker/fw_utils.py | ram-nadella/sagemaker-python-sdk | 0ed415f96483f29c2c8b7a320bb825a993e116b2 | [
"Apache-2.0"
] | null | null | null | src/sagemaker/fw_utils.py | ram-nadella/sagemaker-python-sdk | 0ed415f96483f29c2c8b7a320bb825a993e116b2 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017-2020 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fil... | 36.986994 | 186 | 0.675601 | from __future__ import absolute_import
import logging
import os
import re
import shutil
import tempfile
from collections import namedtuple
import sagemaker.utils
from sagemaker import s3
from sagemaker.utils import get_ecr_image_uri_prefix, ECR_URI_PATTERN
logger = logging.getLogger("sagemaker")
_TAR_SOURCE_FILENAM... | true | true |
1c3e9feb8acf4bdd8e0ad18e90e1fc824b44b79c | 2,294 | py | Python | sandbox/lib/jumpscale/JumpScale9/clients/tarantool/TarantoolQueue.py | Jumpscale/sandbox_linux | 2aacd36b467ef30ac83718abfa82c6883b67a02f | [
"Apache-2.0"
] | null | null | null | sandbox/lib/jumpscale/JumpScale9/clients/tarantool/TarantoolQueue.py | Jumpscale/sandbox_linux | 2aacd36b467ef30ac83718abfa82c6883b67a02f | [
"Apache-2.0"
] | 1 | 2018-04-04T12:13:40.000Z | 2018-05-03T07:57:52.000Z | sandbox/lib/jumpscale/JumpScale9/clients/tarantool/TarantoolQueue.py | Jumpscale/sandbox_linux | 2aacd36b467ef30ac83718abfa82c6883b67a02f | [
"Apache-2.0"
] | null | null | null | from js9 import j
import tarantool
from .TarantoolDB import TarantoolDB
# import itertools
# import sys
# sys.path.append(".")
# from tarantool_queue import *
import tarantool
JSBASE = j.application.jsbase_get_class()
class TarantoolQueue(JSBASE):
def __init__(self, tarantoolclient, name, ttl=0, delay=0):
... | 29.792208 | 86 | 0.576286 | from js9 import j
import tarantool
from .TarantoolDB import TarantoolDB
import tarantool
JSBASE = j.application.jsbase_get_class()
class TarantoolQueue(JSBASE):
def __init__(self, tarantoolclient, name, ttl=0, delay=0):
JSBASE.__init__(self)
self.client = tarantoolclient
self.db = self... | true | true |
1c3ea22503288aedcd8f44cb6c69cdf7b6831548 | 1,362 | py | Python | config.py | ibbad/dna-lceb-web | b4c1d4e121dfea992e072979bfdc0f313c781e32 | [
"Apache-2.0"
] | null | null | null | config.py | ibbad/dna-lceb-web | b4c1d4e121dfea992e072979bfdc0f313c781e32 | [
"Apache-2.0"
] | null | null | null | config.py | ibbad/dna-lceb-web | b4c1d4e121dfea992e072979bfdc0f313c781e32 | [
"Apache-2.0"
] | null | null | null | """
Configuration file for the application.
"""
import os
from helpers.helper_functions import generate_secret_key
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY') or generate_secret_key()
SSL_DISABLE = False
CSRF_ENABLED = False
@staticmeth... | 21.619048 | 70 | 0.69163 | import os
from helpers.helper_functions import generate_secret_key
basedir = os.path.abspath(os.path.dirname(__file__))
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY') or generate_secret_key()
SSL_DISABLE = False
CSRF_ENABLED = False
@staticmethod
def init_app(app):
pass
class T... | true | true |
1c3ea2273509fcdf5847621ef551c86264756c7a | 2,224 | py | Python | rpython/jit/metainterp/test/test_bytearray.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 381 | 2018-08-18T03:37:22.000Z | 2022-02-06T23:57:36.000Z | rpython/jit/metainterp/test/test_bytearray.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 16 | 2018-09-22T18:12:47.000Z | 2022-02-22T20:03:59.000Z | rpython/jit/metainterp/test/test_bytearray.py | nanjekyejoannah/pypy | e80079fe13c29eda7b2a6b4cd4557051f975a2d9 | [
"Apache-2.0",
"OpenSSL"
] | 55 | 2015-08-16T02:41:30.000Z | 2022-03-20T20:33:35.000Z | import py
from rpython.jit.metainterp.test.support import LLJitMixin
from rpython.rlib.jit import JitDriver, dont_look_inside
class TestByteArray(LLJitMixin):
def test_getitem(self):
x = bytearray("foobar")
def fn(n):
assert n >= 0
return x[n]
res = self.interp_oper... | 26.795181 | 58 | 0.504946 | import py
from rpython.jit.metainterp.test.support import LLJitMixin
from rpython.rlib.jit import JitDriver, dont_look_inside
class TestByteArray(LLJitMixin):
def test_getitem(self):
x = bytearray("foobar")
def fn(n):
assert n >= 0
return x[n]
res = self.interp_oper... | true | true |
1c3ea39888e2088ce257dfe36ae474d9f6acca2d | 42,615 | py | Python | pair_fast_forecast_distributed/pairwise_fusion_kd/train_faf_com_kd.py | Chezacar/CollaborationWithLatency | da06abea16f1ffcafc35d27cb69ae3116a345965 | [
"MIT"
] | null | null | null | pair_fast_forecast_distributed/pairwise_fusion_kd/train_faf_com_kd.py | Chezacar/CollaborationWithLatency | da06abea16f1ffcafc35d27cb69ae3116a345965 | [
"MIT"
] | null | null | null | pair_fast_forecast_distributed/pairwise_fusion_kd/train_faf_com_kd.py | Chezacar/CollaborationWithLatency | da06abea16f1ffcafc35d27cb69ae3116a345965 | [
"MIT"
] | null | null | null | # Copyright 2021 MediaBrain Group of CMIC, Shanghai Jiao Tong University. All right reserved.
# The software, documentation and/or data in this file is provided on an "as is" basis,
# and MediaBrain Group has no obligations to provide maintenance, support, updates, enhancements or modifications.
# MediaBrain Group ... | 64.276018 | 652 | 0.639962 | from utils.model import forcast_lstm
import random
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from torch.nn.parallel import DistributedDataParallel as DDP
import torch.distributed as dist
import torch.multiprocessing as mp
import numpy as np
import time
import sys
imp... | true | true |
1c3ea3db82bc9ca8412c76aa081720e97c4c8d00 | 8,617 | py | Python | moler/connection_factory.py | AdamKlekowski/moler | 9d032bad402d9863685b2a8624320566512c14cc | [
"BSD-3-Clause"
] | 2 | 2021-03-14T15:17:10.000Z | 2021-03-15T07:12:12.000Z | moler/connection_factory.py | Laymer/moler | 2d7b89efdc2ca5e9975112b97934b396e24b5505 | [
"BSD-3-Clause"
] | null | null | null | moler/connection_factory.py | Laymer/moler | 2d7b89efdc2ca5e9975112b97934b396e24b5505 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
One of Moler's goals is to be IO-agnostic.
So it can be used under twisted, asyncio, curio any any other IO system.
Moler's connection is very thin layer binding Moler's ConnectionObserver with external IO system.
Connection responsibilities:
- have a means for sending outgoing data via ext... | 43.520202 | 128 | 0.678542 |
__author__ = 'Grzegorz Latuszek, Marcin Usielski, Michal Ernst'
__copyright__ = 'Copyright (C) 2018-2019, Nokia'
__email__ = 'grzegorz.latuszek@nokia.com, marcin.usielski@nokia.com, michal.ernst@nokia.com'
import logging
import platform
import moler.config.connections as connection_cfg
from moler.threaded_moler_conn... | true | true |
1c3ea5491a186402e9d7e441587dc01568439264 | 16,337 | py | Python | src/azure-cli/azure/cli/command_modules/monitor/operations/autoscale_settings.py | digimaun/azure-cli | 298994660f0fde6863cb45a7c3142141ed10f923 | [
"MIT"
] | 1 | 2020-12-12T02:53:24.000Z | 2020-12-12T02:53:24.000Z | src/azure-cli/azure/cli/command_modules/monitor/operations/autoscale_settings.py | digimaun/azure-cli | 298994660f0fde6863cb45a7c3142141ed10f923 | [
"MIT"
] | 1 | 2021-03-01T19:31:38.000Z | 2021-03-01T19:31:38.000Z | src/azure-cli/azure/cli/command_modules/monitor/operations/autoscale_settings.py | digimaun/azure-cli | 298994660f0fde6863cb45a7c3142141ed10f923 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 43.334218 | 118 | 0.700863 |
from knack.log import get_logger
logger = get_logger(__name__)
DEFAULT_PROFILE_NAME = 'default'
def scaffold_autoscale_settings_parameters(client):
import os.path
from knack.util import CLIError
from azure.cli.core.util import get_file_json
curr_dir = os.path.dirname(os.path.realpath(__fil... | true | true |
1c3ea55a9729d4899c05e8ba4f39867721eb3eb4 | 1,468 | py | Python | Src/Nets/KeyPoint/__init__.py | OOXXXXOO/WSNet | b64aa7d80fe0a7aa8a440f2bb6df1f1e497a7620 | [
"Apache-2.0"
] | 12 | 2019-08-20T06:27:15.000Z | 2022-02-15T05:26:58.000Z | Src/Nets/KeyPoint/__init__.py | OOXXXXOO/WSNet | b64aa7d80fe0a7aa8a440f2bb6df1f1e497a7620 | [
"Apache-2.0"
] | null | null | null | Src/Nets/KeyPoint/__init__.py | OOXXXXOO/WSNet | b64aa7d80fe0a7aa8a440f2bb6df1f1e497a7620 | [
"Apache-2.0"
] | 7 | 2019-08-26T03:31:26.000Z | 2022-03-19T06:17:39.000Z | # Copyright 2020 winshare
#
# 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, ... | 54.37037 | 80 | 0.366485 | true | true | |
1c3ea56d42d3313abd71a2446b8e9d75e9fcc94c | 96 | py | Python | cruw/eval/__init__.py | kanishkaisreal/cruw-devkit | 81e2da7de79b112d78c786d7d4be2504704368c7 | [
"MIT"
] | 29 | 2020-12-15T07:17:53.000Z | 2022-03-28T03:04:21.000Z | cruw/eval/__init__.py | kanishkaisreal/cruw-devkit | 81e2da7de79b112d78c786d7d4be2504704368c7 | [
"MIT"
] | 12 | 2021-01-07T02:31:50.000Z | 2022-03-29T02:19:37.000Z | cruw/eval/__init__.py | kanishkaisreal/cruw-devkit | 81e2da7de79b112d78c786d7d4be2504704368c7 | [
"MIT"
] | 11 | 2021-01-13T03:39:57.000Z | 2022-03-04T04:57:34.000Z | from .rod.eval_rod2021 import evaluate_rod2021
from .rod.eval_rodnet import evaluate_rodnet_seq
| 32 | 48 | 0.875 | from .rod.eval_rod2021 import evaluate_rod2021
from .rod.eval_rodnet import evaluate_rodnet_seq
| true | true |
1c3ea5bd4e61f72df060889b3ddac34e67626514 | 10,647 | py | Python | electrumsv/gui/qt/paytoedit.py | bitcartel/electrumsv | 009ea3675292a26a5a197fc8602dafca5453f9c5 | [
"MIT"
] | 1 | 2021-12-28T10:52:11.000Z | 2021-12-28T10:52:11.000Z | electrumsv/gui/qt/paytoedit.py | bitcartel/electrumsv | 009ea3675292a26a5a197fc8602dafca5453f9c5 | [
"MIT"
] | null | null | null | electrumsv/gui/qt/paytoedit.py | bitcartel/electrumsv | 009ea3675292a26a5a197fc8602dafca5453f9c5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2012 thomasv@gitorious
#
# 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 witho... | 34.234727 | 100 | 0.609749 |
import re
import time
from decimal import Decimal
from PyQt5.QtCore import Qt
from PyQt5.QtGui import QFontMetrics, QTextCursor
from PyQt5.QtWidgets import QCompleter, QPlainTextEdit
from bitcoinx import cashaddr, Script, Address, TxOutput
from .qrtextedit import ScanQRTextEdit
from electrumsv.i18n import _
from el... | true | true |
1c3ea5c07c06add4518f160f65a5c991fbe69550 | 878 | py | Python | learn2learn-master/JSrc/jutils.py | hikmatkhan/Higher | b47c758dbe194abd98847a0f935b51f09ab772b0 | [
"MIT"
] | null | null | null | learn2learn-master/JSrc/jutils.py | hikmatkhan/Higher | b47c758dbe194abd98847a0f935b51f09ab772b0 | [
"MIT"
] | null | null | null | learn2learn-master/JSrc/jutils.py | hikmatkhan/Higher | b47c758dbe194abd98847a0f935b51f09ab772b0 | [
"MIT"
] | null | null | null | import random
import learn2learn
import numpy as np
import torch
import torchvision
from learn2learn.data import TaskDataset
from learn2learn.data.transforms import NWays, KShots, LoadData
import wandb
from torch import nn
from torchvision.models import resnet18
from torchvision.transforms import transforms
def fix_s... | 23.72973 | 76 | 0.736902 | import random
import learn2learn
import numpy as np
import torch
import torchvision
from learn2learn.data import TaskDataset
from learn2learn.data.transforms import NWays, KShots, LoadData
import wandb
from torch import nn
from torchvision.models import resnet18
from torchvision.transforms import transforms
def fix_s... | true | true |
1c3ea5e937371a3b5efe0501eae3e78cdfc93c6c | 4,331 | py | Python | da/examples/pingpong/ping.py | yagrawal-sbu/distalgo | 10e6db89b7db05d3b076dcf9295ce4f189558323 | [
"MIT"
] | null | null | null | da/examples/pingpong/ping.py | yagrawal-sbu/distalgo | 10e6db89b7db05d3b076dcf9295ce4f189558323 | [
"MIT"
] | null | null | null | da/examples/pingpong/ping.py | yagrawal-sbu/distalgo | 10e6db89b7db05d3b076dcf9295ce4f189558323 | [
"MIT"
] | null | null | null | # -*- generated by 1.0.9 -*-
import da
PatternExpr_177 = da.pat.TuplePattern([da.pat.ConstantPattern('Ping')])
PatternExpr_182 = da.pat.FreePattern('p')
PatternExpr_201 = da.pat.TuplePattern([da.pat.ConstantPattern('Ping')])
PatternExpr_206 = da.pat.FreePattern('p')
PatternExpr_249 = da.pat.TuplePattern([da.pat.Constan... | 41.644231 | 413 | 0.619487 | import da
PatternExpr_177 = da.pat.TuplePattern([da.pat.ConstantPattern('Ping')])
PatternExpr_182 = da.pat.FreePattern('p')
PatternExpr_201 = da.pat.TuplePattern([da.pat.ConstantPattern('Ping')])
PatternExpr_206 = da.pat.FreePattern('p')
PatternExpr_249 = da.pat.TuplePattern([da.pat.ConstantPattern('Pong')])
PatternExp... | true | true |
1c3ea702689cfcbe442cb760a84ea68038a9b92e | 4,138 | py | Python | Python/create_example_images.py | markvilar/focal | 53b048bc6592b7ad7421ae96c399755570820db6 | [
"Apache-2.0"
] | 1 | 2021-08-09T12:31:27.000Z | 2021-08-09T12:31:27.000Z | Python/create_example_images.py | markvilar/focal | 53b048bc6592b7ad7421ae96c399755570820db6 | [
"Apache-2.0"
] | null | null | null | Python/create_example_images.py | markvilar/focal | 53b048bc6592b7ad7421ae96c399755570820db6 | [
"Apache-2.0"
] | null | null | null | import matplotlib
matplotlib.use("TkAgg")
import matplotlib.pyplot as plt
plt.style.use("./Styles/Scientific.mplstyle")
import cv2
import numpy as np
from PIL import Image
from skimage.metrics import structural_similarity as ssim
from histogram import plot_histogram, plot_histogram_rgb
def normalize_image(arr):
... | 37.279279 | 90 | 0.702997 | import matplotlib
matplotlib.use("TkAgg")
import matplotlib.pyplot as plt
plt.style.use("./Styles/Scientific.mplstyle")
import cv2
import numpy as np
from PIL import Image
from skimage.metrics import structural_similarity as ssim
from histogram import plot_histogram, plot_histogram_rgb
def normalize_image(arr):
... | true | true |
1c3ea740f67d1f5b875602483a82cf37dd383da5 | 201 | py | Python | app/hosts.py | noahbarnette/ugahacks5 | 72059709cf4e6d25bd2dc2e880f3c3590d583115 | [
"MIT"
] | 5 | 2020-07-22T19:18:09.000Z | 2021-02-05T21:30:42.000Z | app/hosts.py | noahbarnette/ugahacks5 | 72059709cf4e6d25bd2dc2e880f3c3590d583115 | [
"MIT"
] | 9 | 2021-01-27T21:42:51.000Z | 2022-03-12T00:20:25.000Z | app/hosts.py | ugahacks/myugahacks | 72059709cf4e6d25bd2dc2e880f3c3590d583115 | [
"MIT"
] | 1 | 2020-02-04T23:49:12.000Z | 2020-02-04T23:49:12.000Z | from django.conf import settings
from django_hosts import patterns, host
host_patterns = patterns('',
host(r'my', settings.ROOT_URLCONF, name='my'),
host(r'blog', 'blog.urls', name='blog'),
)
| 25.125 | 50 | 0.701493 | from django.conf import settings
from django_hosts import patterns, host
host_patterns = patterns('',
host(r'my', settings.ROOT_URLCONF, name='my'),
host(r'blog', 'blog.urls', name='blog'),
)
| true | true |
1c3ea864d959188af0794e432f2e8ea8da76a496 | 2,763 | py | Python | tests/contrib/test_simplejwt.py | bahag-raesenerm/drf-spectacular | fb4c8410357b8a987991888d026167496165e95a | [
"BSD-3-Clause"
] | 1,025 | 2020-03-03T19:29:49.000Z | 2022-03-30T03:23:30.000Z | tests/contrib/test_simplejwt.py | bahag-raesenerm/drf-spectacular | fb4c8410357b8a987991888d026167496165e95a | [
"BSD-3-Clause"
] | 677 | 2020-03-06T15:17:31.000Z | 2022-03-31T20:59:12.000Z | tests/contrib/test_simplejwt.py | bahag-raesenerm/drf-spectacular | fb4c8410357b8a987991888d026167496165e95a | [
"BSD-3-Clause"
] | 145 | 2020-03-10T09:45:44.000Z | 2022-03-26T19:38:43.000Z | from unittest import mock
import pytest
from django.urls import path
from rest_framework import mixins, routers, serializers, viewsets
from tests import assert_schema, generate_schema
try:
from rest_framework_simplejwt.authentication import (
JWTAuthentication, JWTTokenUserAuthentication,
)
from ... | 32.892857 | 94 | 0.704669 | from unittest import mock
import pytest
from django.urls import path
from rest_framework import mixins, routers, serializers, viewsets
from tests import assert_schema, generate_schema
try:
from rest_framework_simplejwt.authentication import (
JWTAuthentication, JWTTokenUserAuthentication,
)
from ... | true | true |
1c3ea900c51ab6a9bddf42c028ecb093a76dbfce | 188 | py | Python | Estudos/110exercicios/Exercicios/ex011.py | romuloferraz/Python | 2e20e7483cf9ea74b0b514f253034002bb56807f | [
"MIT"
] | null | null | null | Estudos/110exercicios/Exercicios/ex011.py | romuloferraz/Python | 2e20e7483cf9ea74b0b514f253034002bb56807f | [
"MIT"
] | null | null | null | Estudos/110exercicios/Exercicios/ex011.py | romuloferraz/Python | 2e20e7483cf9ea74b0b514f253034002bb56807f | [
"MIT"
] | null | null | null | h = float(input('digite a altura(m) da sua parede:\n'))
c = float(input('Digite o comprimento(m) da sua parede:\n'))
print(f'Sua parede tem área = {c*h}m² e consumirá {c*h/2}L de tinta!')
| 47 | 70 | 0.670213 | h = float(input('digite a altura(m) da sua parede:\n'))
c = float(input('Digite o comprimento(m) da sua parede:\n'))
print(f'Sua parede tem área = {c*h}m² e consumirá {c*h/2}L de tinta!')
| true | true |
1c3ea98a7585fb03beb4e762dac750a21ae4a86a | 119 | py | Python | projects/thesis/continuous/custom/continuous/deform_feature/__init__.py | cpark90/rrrcnn | ba66cc391265be76fa3896b66459ff7241b47972 | [
"Apache-2.0"
] | null | null | null | projects/thesis/continuous/custom/continuous/deform_feature/__init__.py | cpark90/rrrcnn | ba66cc391265be76fa3896b66459ff7241b47972 | [
"Apache-2.0"
] | null | null | null | projects/thesis/continuous/custom/continuous/deform_feature/__init__.py | cpark90/rrrcnn | ba66cc391265be76fa3896b66459ff7241b47972 | [
"Apache-2.0"
] | null | null | null | from .deform_feature_map_layer import *
from .deform_orienation_layer import *
from .deformable_by_grad_layer import *
| 29.75 | 39 | 0.848739 | from .deform_feature_map_layer import *
from .deform_orienation_layer import *
from .deformable_by_grad_layer import *
| true | true |
1c3ea9de3eb93f5c90083da7512d23246cd1b525 | 171 | py | Python | tests/project_awesome/b_module.py | ldiary/importlazy | 0af9ee818428f6e9e79fb9391b05063e66a00ecd | [
"MIT"
] | null | null | null | tests/project_awesome/b_module.py | ldiary/importlazy | 0af9ee818428f6e9e79fb9391b05063e66a00ecd | [
"MIT"
] | null | null | null | tests/project_awesome/b_module.py | ldiary/importlazy | 0af9ee818428f6e9e79fb9391b05063e66a00ecd | [
"MIT"
] | null | null | null |
class BModuleClassOne:
class1_attribute = "Attribute of Class One in module B."
class BModuleClassTwo:
class2_attribute = "Attribute of Class Two in module B."
| 21.375 | 60 | 0.748538 |
class BModuleClassOne:
class1_attribute = "Attribute of Class One in module B."
class BModuleClassTwo:
class2_attribute = "Attribute of Class Two in module B."
| true | true |
1c3eaa7ea6c3c365dda9d17a0d39853324bddd4f | 1,030 | py | Python | tests/test_otscraper.py | LSDtopotools/lsdviztools | b6012c0013bea7a0af5e7fa283a8a2268be18e25 | [
"MIT"
] | 2 | 2021-04-01T13:24:49.000Z | 2021-09-15T17:24:19.000Z | tests/test_otscraper.py | LSDtopotools/lsdviztools | b6012c0013bea7a0af5e7fa283a8a2268be18e25 | [
"MIT"
] | 20 | 2020-07-28T11:10:36.000Z | 2021-08-19T13:10:44.000Z | tests/test_otscraper.py | LSDtopotools/lsdviztools | b6012c0013bea7a0af5e7fa283a8a2268be18e25 | [
"MIT"
] | 2 | 2021-04-21T17:40:14.000Z | 2021-09-15T17:24:20.000Z | #!/usr/bin/env python
'''
A script for testing the ot_scraper object
Simon Mudd
06/07/2020
'''
import lsdviztools.lsdbasemaptools as bmt
from lsdviztools.lsdplottingtools import lsdmap_gdalio as gio
import lsdviztools.lsdplottingtools as lsdplt
import rasterio as rio
import numpy as np
import lsdviztools.lsdmapwrappe... | 21.914894 | 161 | 0.737864 |
import lsdviztools.lsdbasemaptools as bmt
from lsdviztools.lsdplottingtools import lsdmap_gdalio as gio
import lsdviztools.lsdplottingtools as lsdplt
import rasterio as rio
import numpy as np
import lsdviztools.lsdmapwrappers as lsdmw
def test_01():
this_DEM = bmt.ot_scraper()
this_DEM.print_parameters()
... | true | true |
1c3eaac3076c50b3e4bc856465dc5a85d4547c31 | 49,441 | py | Python | src/pymor/reductors/neural_network.py | ullmannsven/pymor | 407103ec50efa45d933f0c973314a4d511cae792 | [
"Unlicense"
] | null | null | null | src/pymor/reductors/neural_network.py | ullmannsven/pymor | 407103ec50efa45d933f0c973314a4d511cae792 | [
"Unlicense"
] | 14 | 2022-01-05T09:25:11.000Z | 2022-03-31T17:07:10.000Z | src/pymor/reductors/neural_network.py | ullmannsven/pymor | 407103ec50efa45d933f0c973314a4d511cae792 | [
"Unlicense"
] | null | null | null | # This file is part of the pyMOR project (https://www.pymor.org).
# Copyright pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (https://opensource.org/licenses/BSD-2-Clause)
from pymor.core.config import config
config.require('TORCH')
from numbers import Number
import inspect
... | 46.598492 | 115 | 0.633806 |
from pymor.core.config import config
config.require('TORCH')
from numbers import Number
import inspect
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torch.utils as utils
from pymor.algorithms.pod import pod
from pymor.algorithms.projection import project
from pymor.core.... | true | true |
1c3eab124bcb39e762371cb7056763fe10435167 | 28,138 | py | Python | networkx/readwrite/gml.py | nik0sc/networkx | 3d5f577f5176950473367c89fc4e2fac5fb49ce7 | [
"BSD-3-Clause"
] | null | null | null | networkx/readwrite/gml.py | nik0sc/networkx | 3d5f577f5176950473367c89fc4e2fac5fb49ce7 | [
"BSD-3-Clause"
] | null | null | null | networkx/readwrite/gml.py | nik0sc/networkx | 3d5f577f5176950473367c89fc4e2fac5fb49ce7 | [
"BSD-3-Clause"
] | null | null | null | """
Read graphs in GML format.
"GML, the Graph Modelling Language, is our proposal for a portable
file format for graphs. GML's key features are portability, simple
syntax, extensibility and flexibility. A GML file consists of a
hierarchical key-value lists. Graphs can be annotated with arbitrary
data structures. The ... | 34.356532 | 87 | 0.55473 | from io import StringIO
from ast import literal_eval
from collections import defaultdict
from enum import Enum
from typing import Any, NamedTuple
import networkx as nx
from networkx.exception import NetworkXError
from networkx.utils import open_file
import warnings
import re
import html.entities as htmlentitydefs
__a... | true | true |
1c3eab89ad9c859e5a79f47abfdc6eb5e5425323 | 8,200 | py | Python | gpv2/experiments/trainer_cli.py | allenai/gpv2 | dd8162a446963ed2c73eb24708580bbbe4491191 | [
"Apache-2.0"
] | 13 | 2022-02-03T00:25:35.000Z | 2022-03-20T02:36:05.000Z | gpv2/experiments/trainer_cli.py | allenai/gpv2 | dd8162a446963ed2c73eb24708580bbbe4491191 | [
"Apache-2.0"
] | null | null | null | gpv2/experiments/trainer_cli.py | allenai/gpv2 | dd8162a446963ed2c73eb24708580bbbe4491191 | [
"Apache-2.0"
] | 3 | 2022-01-14T19:15:38.000Z | 2022-02-11T14:12:52.000Z | import logging
from argparse import ArgumentParser
from gpv2.data.dataset import Task
from gpv2.data.gpv_datasets import GpvDataset, CocoCategories
from gpv2.model.model import BeamSearchSpec
from gpv2.train import evaluator
from gpv2.train.evaluator import ResultKey
from gpv2.train.runner import DataLoaderBuilder
fro... | 34.745763 | 103 | 0.682195 | import logging
from argparse import ArgumentParser
from gpv2.data.dataset import Task
from gpv2.data.gpv_datasets import GpvDataset, CocoCategories
from gpv2.model.model import BeamSearchSpec
from gpv2.train import evaluator
from gpv2.train.evaluator import ResultKey
from gpv2.train.runner import DataLoaderBuilder
fro... | true | true |
1c3eac835ba7397893099136aa6bcebacad7b24a | 1,911 | py | Python | Source/utils/labelmaps.py | YacobBY/ICDAR2019-ArT-Recognition-Alchemy | 911c572c2aff4599a74b7974d46ef4cfb17078b9 | [
"MIT"
] | 209 | 2019-08-28T10:42:54.000Z | 2022-01-10T13:49:32.000Z | Source/utils/labelmaps.py | wangxiong101/ICDAR2019-ArT-Recognition-Alchemy | 5b03f73386f0a45ecc498f653d96012caa4a0c76 | [
"MIT"
] | 16 | 2019-09-01T05:12:39.000Z | 2021-03-28T04:00:24.000Z | Source/utils/labelmaps.py | wangxiong101/ICDAR2019-ArT-Recognition-Alchemy | 5b03f73386f0a45ecc498f653d96012caa4a0c76 | [
"MIT"
] | 76 | 2019-09-02T03:11:09.000Z | 2021-11-11T04:42:31.000Z | from __future__ import absolute_import
import string
from . import to_torch, to_numpy
def get_vocabulary(voc_type, EOS='EOS', PADDING='PADDING', UNKNOWN='UNKNOWN'):
'''
voc_type: str: one of 'LOWERCASE', 'ALLCASES', 'ALLCASES_SYMBOLS', 'LOWERCASE_SYMBOLS'
'''
voc = None
types = ['LOW... | 28.102941 | 91 | 0.600733 | from __future__ import absolute_import
import string
from . import to_torch, to_numpy
def get_vocabulary(voc_type, EOS='EOS', PADDING='PADDING', UNKNOWN='UNKNOWN'):
voc = None
types = ['LOWERCASE', 'ALLCASES', 'ALLCASES_SYMBOLS', 'LOWERCASE_SYMBOLS']
if voc_type == 'LOWERCASE':
voc = ... | true | true |
1c3ead84bd5d5e28185269b23e0aa67b71bef3ff | 7,632 | py | Python | ssd.py | kshramt/ssd.pytorch | 91214ba98c282663c117a4f3c691464460b8fa16 | [
"MIT"
] | null | null | null | ssd.py | kshramt/ssd.pytorch | 91214ba98c282663c117a4f3c691464460b8fa16 | [
"MIT"
] | null | null | null | ssd.py | kshramt/ssd.pytorch | 91214ba98c282663c117a4f3c691464460b8fa16 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from layers import *
from data import voc, coco
import os
class SSD(nn.Module):
"""Single Shot Multibox Architecture
The network is composed of a base VGG network followed by the
added multibox conv laye... | 36.342857 | 79 | 0.550183 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
from layers import *
from data import voc, coco
import os
class SSD(nn.Module):
def __init__(self, phase, size, base, extras, head, num_classes):
super(SSD, self).__init__()
self.phase = phase
... | true | true |
1c3ead8902dc5079ac08b7790e806050bc90ad77 | 702 | py | Python | setup.py | thispl/hunter_douglas | 40ac85e9fba607ec8a9aa6a472b486f8b24f8600 | [
"MIT"
] | null | null | null | setup.py | thispl/hunter_douglas | 40ac85e9fba607ec8a9aa6a472b486f8b24f8600 | [
"MIT"
] | null | null | null | setup.py | thispl/hunter_douglas | 40ac85e9fba607ec8a9aa6a472b486f8b24f8600 | [
"MIT"
] | 1 | 2019-12-31T06:52:12.000Z | 2019-12-31T06:52:12.000Z | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import re, ast
with open('requirements.txt') as f:
install_requires = f.read().strip().split('\n')
# get version from __version__ variable in hunter_douglas/__init__.py
_version_re = re.compile(r'__version__\s+=\s+(.*)')
with open('hunter_douglas/_... | 27 | 69 | 0.739316 | from setuptools import setup, find_packages
import re, ast
with open('requirements.txt') as f:
install_requires = f.read().strip().split('\n')
_version_re = re.compile(r'__version__\s+=\s+(.*)')
with open('hunter_douglas/__init__.py', 'rb') as f:
version = str(ast.literal_eval(_version_re.search(
f.read().decode... | true | true |
1c3eae2cb9449c33d73e5d650ec292109dd9831e | 30,227 | py | Python | tensorflow/python/keras/optimizers.py | lambdabaa/tensorflow | b7e7addbd06c3ba414565f1cd50d734a45f6e12d | [
"Apache-2.0"
] | 26 | 2019-11-10T15:33:34.000Z | 2022-03-24T19:56:57.000Z | tensorflow/python/keras/optimizers.py | lambdabaa/tensorflow | b7e7addbd06c3ba414565f1cd50d734a45f6e12d | [
"Apache-2.0"
] | 1 | 2019-08-15T02:49:21.000Z | 2019-09-04T10:10:59.000Z | tensorflow/python/keras/optimizers.py | lambdabaa/tensorflow | b7e7addbd06c3ba414565f1cd50d734a45f6e12d | [
"Apache-2.0"
] | 6 | 2020-03-29T11:10:53.000Z | 2021-06-14T05:39:14.000Z | # Copyright 2015 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... | 35.519389 | 126 | 0.656069 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import six
from six.moves import zip
from tensorflow.python.distribute import distribution_strategy_context
from tensorflow.python.framework import ops
from tensorflow.python.keras import backend as K
from te... | true | true |
1c3eaf2c8d84487059c56d624eb2eba5474de60c | 26,113 | py | Python | source/tomopy/misc/corr.py | WilliamJudge94/tomopy | 301ee367d18ca6d18f2b9b18e2c531c33d4739e4 | [
"BSD-3-Clause"
] | null | null | null | source/tomopy/misc/corr.py | WilliamJudge94/tomopy | 301ee367d18ca6d18f2b9b18e2c531c33d4739e4 | [
"BSD-3-Clause"
] | null | null | null | source/tomopy/misc/corr.py | WilliamJudge94/tomopy | 301ee367d18ca6d18f2b9b18e2c531c33d4739e4 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# #########################################################################
# Copyright (c) 2015-2019, UChicago Argonne, LLC. All rights reserved. #
# #
# Copyright 2015-2019. UChicago Argonne, LLC.... | 30.649061 | 79 | 0.582354 |
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import numpy as np
from scipy.ndimage import filters
import tomopy.util.mproc as mproc
import tomopy.util.dtype as dtype
import tomopy.util.extern as extern
import logging
import warnings
import numexpr as ne... | true | true |
1c3eaf4d4b2cd9a62fb998a099bf380bf5054503 | 10,095 | py | Python | Packs/Phishing/Scripts/PhishingDedupPreprocessingRule/PhishingDedupPreprocessingRule_test.py | sandeepklog/content | 00e67220bf2842ff3931f8493b2b097f07aebcf4 | [
"MIT"
] | null | null | null | Packs/Phishing/Scripts/PhishingDedupPreprocessingRule/PhishingDedupPreprocessingRule_test.py | sandeepklog/content | 00e67220bf2842ff3931f8493b2b097f07aebcf4 | [
"MIT"
] | 2 | 2019-09-18T08:11:22.000Z | 2020-11-24T18:50:28.000Z | Packs/Phishing/Scripts/PhishingDedupPreprocessingRule/PhishingDedupPreprocessingRule_test.py | sandeepklog/content | 00e67220bf2842ff3931f8493b2b097f07aebcf4 | [
"MIT"
] | 2 | 2020-10-11T18:01:32.000Z | 2020-10-14T03:21:23.000Z | from CommonServerPython import *
from PhishingDedupPreprocessingRule import *
import json
ID_CONtER = 0
EXISTING_INCIDENTS = []
RESULTS = None
EXISTING_INCIDENT_ID = DUP_INCIDENT_ID = None
IDS_COUNTER = 0
text = "Imagine there's no countries It isn't hard to do Nothing to kill or die for And no religion too " \
... | 46.520737 | 117 | 0.750173 | from CommonServerPython import *
from PhishingDedupPreprocessingRule import *
import json
ID_CONtER = 0
EXISTING_INCIDENTS = []
RESULTS = None
EXISTING_INCIDENT_ID = DUP_INCIDENT_ID = None
IDS_COUNTER = 0
text = "Imagine there's no countries It isn't hard to do Nothing to kill or die for And no religion too " \
... | true | true |
1c3eafa1dc15b9815c461f8e4e81effe44ea1d93 | 582 | py | Python | tronapi/constants.py | oushu1zhangxiangxuan1/tron-api-python | d93959e758fb967584ad36372e29ab67eaa6dc79 | [
"MIT"
] | 111 | 2018-10-15T19:49:31.000Z | 2022-03-26T02:48:37.000Z | tronapi/constants.py | oushu1zhangxiangxuan1/tron-api-python | d93959e758fb967584ad36372e29ab67eaa6dc79 | [
"MIT"
] | 83 | 2018-10-24T18:49:56.000Z | 2022-03-02T21:36:21.000Z | tronapi/constants.py | oushu1zhangxiangxuan1/tron-api-python | d93959e758fb967584ad36372e29ab67eaa6dc79 | [
"MIT"
] | 78 | 2018-10-16T06:29:10.000Z | 2022-03-18T04:39:53.000Z | # --------------------------------------------------------------------
# Copyright (c) iEXBase. All rights reserved.
# Licensed under the MIT License.
# See License.txt in the project root for license information.
# --------------------------------------------------------------------
# Here we specify default values f... | 41.571429 | 73 | 0.546392 |
DEFAULT_NODES = {
'full_node': 'https://api.trongrid.io',
'solidity_node': 'https://api.trongrid.io',
'event_server': 'https://api.trongrid.io'
}
| true | true |
1c3eb035ee715827be07854c75e698fafd898d35 | 3,278 | py | Python | model/model_api.py | thukg/KG-concept-game | daedea0f9109012a079833de034766ad23c731b6 | [
"MIT"
] | 1 | 2019-09-27T11:05:17.000Z | 2019-09-27T11:05:17.000Z | model/model_api.py | thukg/KG-concept-game | daedea0f9109012a079833de034766ad23c731b6 | [
"MIT"
] | null | null | null | model/model_api.py | thukg/KG-concept-game | daedea0f9109012a079833de034766ad23c731b6 | [
"MIT"
] | null | null | null | from model.random_model import RandomModel
from model.greedy_model import GreedyModel
from model.min_max_model import MinMaxModel
from model.alpha_beta_model import AlphaBetaModel
from model.sprague_grundy_model import SpragueGrundyModel
from model.fully_connected_network_model import FCNModel
import config
def name_t... | 29.00885 | 110 | 0.527761 | from model.random_model import RandomModel
from model.greedy_model import GreedyModel
from model.min_max_model import MinMaxModel
from model.alpha_beta_model import AlphaBetaModel
from model.sprague_grundy_model import SpragueGrundyModel
from model.fully_connected_network_model import FCNModel
import config
def name_t... | true | true |
1c3eb15d7da6787510d8cb568e87d91b919b684c | 2,109 | py | Python | python_bindings/tutorial/lesson_10_aot_compilation_run.py | OAID/Halide | 769b8554ec36b70ea53c73605ad021cf431476fc | [
"Apache-2.0"
] | 4,303 | 2015-01-02T12:04:37.000Z | 2022-03-31T11:35:06.000Z | python_bindings/tutorial/lesson_10_aot_compilation_run.py | OAID/Halide | 769b8554ec36b70ea53c73605ad021cf431476fc | [
"Apache-2.0"
] | 4,323 | 2015-01-01T13:31:25.000Z | 2022-03-31T22:43:57.000Z | python_bindings/tutorial/lesson_10_aot_compilation_run.py | OAID/Halide | 769b8554ec36b70ea53c73605ad021cf431476fc | [
"Apache-2.0"
] | 1,032 | 2015-01-12T12:50:16.000Z | 2022-03-28T01:55:11.000Z | # Before reading this file, see lesson_10_aot_compilation_generate.py
# This is the code that actually uses the Halide pipeline we've
# compiled. It does not depend on libHalide, so we won't do
# "import halide".
#
# Instead, it depends on the header file that lesson_10_generate
# produced when we ran it:
import lesso... | 33.47619 | 87 | 0.656235 |
# compiled. It does not depend on libHalide, so we won't do
import lesson_10_halide
import numpy as np
def main():
input = np.empty((640, 480), dtype=np.uint8, order='F')
for y in range(480):
for x in range(640):
input[x, y] = ... | true | true |
1c3eb3b6d07c2dc5556bce9a07ea0abe005bbfa9 | 52,497 | py | Python | espnet/asr/pytorch_backend/asr_rnn_t.py | Baileyswu/espnet | 7ce470058f8fdb28db00ec2d0bd51d290b109d3b | [
"Apache-2.0"
] | null | null | null | espnet/asr/pytorch_backend/asr_rnn_t.py | Baileyswu/espnet | 7ce470058f8fdb28db00ec2d0bd51d290b109d3b | [
"Apache-2.0"
] | null | null | null | espnet/asr/pytorch_backend/asr_rnn_t.py | Baileyswu/espnet | 7ce470058f8fdb28db00ec2d0bd51d290b109d3b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# encoding: utf-8
# Copyright 2017 Johns Hopkins University (Shinji Watanabe)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Training/decoding definition for the speech recognition task."""
import copy
import json
import logging
import math
import os
import sys
from chainer im... | 35.785276 | 88 | 0.561232 |
import copy
import json
import logging
import math
import os
import sys
from chainer import reporter as reporter_module
from chainer import training
from chainer.training import extensions
from chainer.training.updater import StandardUpdater
import numpy as np
from tensorboardX import SummaryWriter
import torch
fro... | true | true |
1c3eb4f292655133a8344fddffc7c4dc2b1eda07 | 1,773 | py | Python | gencode/python/udmi/schema/model_pointset_point.py | johnrandolph/udmi | 5e9de32fc71de8d006cda2eba4d3372eaf24c7c0 | [
"Apache-2.0"
] | 1 | 2022-02-24T22:57:37.000Z | 2022-02-24T22:57:37.000Z | gencode/python/udmi/schema/model_pointset_point.py | johnrandolph/udmi | 5e9de32fc71de8d006cda2eba4d3372eaf24c7c0 | [
"Apache-2.0"
] | 5 | 2022-02-24T21:32:24.000Z | 2022-03-23T15:52:25.000Z | gencode/python/udmi/schema/model_pointset_point.py | johnrandolph/udmi | 5e9de32fc71de8d006cda2eba4d3372eaf24c7c0 | [
"Apache-2.0"
] | null | null | null | """Generated class for model_pointset_point.json"""
class PointPointsetModel:
"""Generated schema class"""
def __init__(self):
self.units = None
self.writable = None
self.baseline_value = None
self.baseline_tolerance = None
self.baseline_state = None
self.cov_increment = None
self.ref... | 28.142857 | 77 | 0.673999 |
class PointPointsetModel:
def __init__(self):
self.units = None
self.writable = None
self.baseline_value = None
self.baseline_tolerance = None
self.baseline_state = None
self.cov_increment = None
self.ref = None
@staticmethod
def from_dict(source):
if not source:
return N... | true | true |
1c3eb6073760458c9c196286f9f2a366494125d3 | 3,700 | py | Python | test.py | chris0711/curl_rainbow | 2badc1302ef55b8512e6c5a0616045a1a0fd4273 | [
"MIT"
] | 38 | 2020-07-07T11:29:18.000Z | 2022-03-28T13:38:04.000Z | test.py | chris0711/curl_rainbow | 2badc1302ef55b8512e6c5a0616045a1a0fd4273 | [
"MIT"
] | 6 | 2020-08-01T11:44:39.000Z | 2021-06-24T00:15:23.000Z | test.py | chris0711/curl_rainbow | 2badc1302ef55b8512e6c5a0616045a1a0fd4273 | [
"MIT"
] | 18 | 2020-08-07T04:42:37.000Z | 2021-12-08T22:42:14.000Z | # -*- coding: utf-8 -*-
# MIT License
#
# Copyright (c) 2017 Kai Arulkumaran
#
# 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,... | 42.528736 | 434 | 0.687568 | from __future__ import division
import os
import plotly
from plotly.graph_objs import Scatter
from plotly.graph_objs.scatter import Line
import torch
from env import Env
def test(args, T, dqn, val_mem, metrics, results_dir, evaluate=False):
env = Env(args)
env.eval()
metrics['steps'].append(T)
T_rewards, T_Q... | true | true |
1c3eb626753b3d4b15e3faae5bef575eb9c8fca1 | 1,352 | py | Python | veles/paths.py | AkshayJainG/veles | 21106f41a8e7e7e74453cd16a5059a0e6b1c315e | [
"Apache-2.0"
] | 1,007 | 2015-07-20T12:01:41.000Z | 2022-03-30T23:08:35.000Z | veles/paths.py | AkshayJainG/veles | 21106f41a8e7e7e74453cd16a5059a0e6b1c315e | [
"Apache-2.0"
] | 52 | 2015-07-21T10:26:24.000Z | 2019-01-24T05:46:43.000Z | veles/paths.py | AkshayJainG/veles | 21106f41a8e7e7e74453cd16a5059a0e6b1c315e | [
"Apache-2.0"
] | 235 | 2015-07-20T09:42:42.000Z | 2021-12-06T18:12:26.000Z | # -*- coding: utf-8 -*-
"""
.. invisible:
_ _ _____ _ _____ _____
| | | | ___| | | ___/ ___|
| | | | |__ | | | |__ \ `--.
| | | | __|| | | __| `--. \
\ \_/ / |___| |___| |___/\__/ /
\___/\____/\_____|____/\____/
Created on Nov 5, 2014
████████████████████████████████████████... | 33.8 | 79 | 0.598373 |
import os
__root__ = os.path.abspath(os.path.join(os.path.dirname(__file__), ".."))
__home__ = os.path.join(os.environ.get("HOME", "./"), ".veles")
| true | true |
1c3eb762b26ba98f8d24bccb5374ee0b4f2d6251 | 2,755 | py | Python | src/oci/secrets/models/base64_secret_bundle_content_details.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/secrets/models/base64_secret_bundle_content_details.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/secrets/models/base64_secret_bundle_content_details.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 34.012346 | 245 | 0.675136 |
from .secret_bundle_content_details import SecretBundleContentDetails
from oci.util import formatted_flat_dict, NONE_SENTINEL, value_allowed_none_or_none_sentinel from oci.decorators import init_model_state_from_kwargs
@init_model_state_from_kwargs
class Base64SecretBundleContentDetails(SecretBundleContentDetails):... | true | true |
1c3eb839a1a83e35d187d725833190d3a81fc9c5 | 1,049 | py | Python | PR_BCI_team/Team_StarLab/YJKim/shallow_cnn_with_mne/gigadata2.py | PatternRecognition/OpenBMI | d9291ddb81f4319fb3764d7192e0363939a62ee9 | [
"MIT"
] | 217 | 2015-11-02T11:10:29.000Z | 2022-03-22T07:01:12.000Z | PR_BCI_team/Team_StarLab/YJKim/shallow_cnn_with_mne/gigadata2.py | deep-bci-g/OpenBMI | 75daf901b2dbe215852cbff243606dcfcd10f05c | [
"MIT"
] | 24 | 2015-11-02T11:10:45.000Z | 2021-09-08T11:10:33.000Z | PR_BCI_team/Team_StarLab/YJKim/shallow_cnn_with_mne/gigadata2.py | deep-bci-g/OpenBMI | 75daf901b2dbe215852cbff243606dcfcd10f05c | [
"MIT"
] | 112 | 2016-01-22T01:45:44.000Z | 2022-03-22T07:08:19.000Z | import scipy.io as sio
import numpy as np
import mne
def load_gigadata(MI, variable_names, plot=False):
temp = MI[variable_names]
sfreq = 1000 # Sampling frequency
chan = temp.chan.tolist()
# 채널정보 추가해야함
info = mne.create_info(ch_names=chan, sfreq=sfreq, ch_types='eeg')
t = np.hstack((temp.t.... | 33.83871 | 88 | 0.64347 | import scipy.io as sio
import numpy as np
import mne
def load_gigadata(MI, variable_names, plot=False):
temp = MI[variable_names]
sfreq = 1000 chan = temp.chan.tolist()
info = mne.create_info(ch_names=chan, sfreq=sfreq, ch_types='eeg')
t = np.hstack((temp.t.reshape(100, 1), np.zeros((100, 1)... | true | true |
1c3eb889ab3a9e447cb4b4e471bb818daaf9273e | 1,510 | py | Python | chatbot_tutorial/models.py | Jishin4477/Djangobot | 41eda19b683224dcf2efdb80dd178aa03e7bad82 | [
"MIT"
] | null | null | null | chatbot_tutorial/models.py | Jishin4477/Djangobot | 41eda19b683224dcf2efdb80dd178aa03e7bad82 | [
"MIT"
] | null | null | null | chatbot_tutorial/models.py | Jishin4477/Djangobot | 41eda19b683224dcf2efdb80dd178aa03e7bad82 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
from chatbot_tutorial._threading_local import local
def set_current_user(user):
_thread_locals.user = user
def get_current_user():
return getattr(_thread_locals, 'user', None)
class DateTimeBase(models.Model):
created_at = models.... | 29.607843 | 77 | 0.676821 | from django.db import models
from django.contrib.auth.models import User
from chatbot_tutorial._threading_local import local
def set_current_user(user):
_thread_locals.user = user
def get_current_user():
return getattr(_thread_locals, 'user', None)
class DateTimeBase(models.Model):
created_at = models.... | true | true |
1c3eb8a0eae5f3799e563e32e38c6313e70f3209 | 8,763 | py | Python | futu/common/pb/Qot_GetRehab_pb2.py | liteself/py-futu-api | a78f5b46f56d30fb82a42951823afea4b5ed1307 | [
"Apache-2.0"
] | 2 | 2020-03-18T09:54:03.000Z | 2020-05-15T08:13:33.000Z | futu/common/pb/Qot_GetRehab_pb2.py | liteself/py-futu-api | a78f5b46f56d30fb82a42951823afea4b5ed1307 | [
"Apache-2.0"
] | 1 | 2020-04-21T02:42:32.000Z | 2020-04-21T02:42:32.000Z | futu/common/pb/Qot_GetRehab_pb2.py | liteself/py-futu-api | a78f5b46f56d30fb82a42951823afea4b5ed1307 | [
"Apache-2.0"
] | 1 | 2021-02-17T17:46:36.000Z | 2021-02-17T17:46:36.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: Qot_GetRehab.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _... | 33.067925 | 760 | 0.744266 |
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
from google.p... | true | true |
1c3eb8ac4bfe8c177995657ed6dd4e2736b430c7 | 1,896 | py | Python | data/image_folder.py | matsumototo180/pytorch-CycleGAN-and-pix2pix-music | e9b39a51226c3ea67e3463df5218ff4beca8c7f7 | [
"BSD-3-Clause"
] | null | null | null | data/image_folder.py | matsumototo180/pytorch-CycleGAN-and-pix2pix-music | e9b39a51226c3ea67e3463df5218ff4beca8c7f7 | [
"BSD-3-Clause"
] | null | null | null | data/image_folder.py | matsumototo180/pytorch-CycleGAN-and-pix2pix-music | e9b39a51226c3ea67e3463df5218ff4beca8c7f7 | [
"BSD-3-Clause"
] | null | null | null | """A modified image folder class
We modify the official PyTorch image folder (https://github.com/pytorch/vision/blob/master/torchvision/datasets/folder.py)
so that this class can load images from both current directory and its subdirectories.
"""
import torch.utils.data as data
from PIL import Image
import os
IMG_E... | 28.298507 | 122 | 0.611287 |
import torch.utils.data as data
from PIL import Image
import os
IMG_EXTENSIONS = [
'.jpg', '.JPG', '.jpeg', '.JPEG',
'.png', '.PNG', '.ppm', '.PPM', '.bmp', '.BMP',
'.tif', '.TIF', '.tiff', '.TIFF',
'.npy'
]
def is_image_file(filename):
return any(filename.endswith(extension) for extension in I... | true | true |
1c3eba13da06e644c32c86598cdc0ded3557d779 | 6,680 | py | Python | Lib/idlelib/aboutDialog.py | rbuzatu90/hyperv-python | 82bf5a72b4d956ea05affe1644b47e378dec0f4e | [
"bzip2-1.0.6"
] | 69 | 2015-12-28T07:02:51.000Z | 2022-03-31T13:36:42.000Z | Lib/idlelib/aboutDialog.py | rbuzatu90/hyperv-python | 82bf5a72b4d956ea05affe1644b47e378dec0f4e | [
"bzip2-1.0.6"
] | 23 | 2016-03-04T10:43:24.000Z | 2021-03-17T09:58:19.000Z | Lib/idlelib/aboutDialog.py | rbuzatu90/hyperv-python | 82bf5a72b4d956ea05affe1644b47e378dec0f4e | [
"bzip2-1.0.6"
] | 24 | 2016-02-29T11:45:47.000Z | 2021-12-24T08:41:37.000Z | """About Dialog for IDLE
"""
from Tkinter import *
import os
from idlelib import textView
from idlelib import idlever
class AboutDialog(Toplevel):
"""Modal about dialog for idle
"""
def __init__(self, parent, title, _htest=False):
"""
_htest - bool, change box location when running htes... | 45.442177 | 80 | 0.582186 |
from Tkinter import *
import os
from idlelib import textView
from idlelib import idlever
class AboutDialog(Toplevel):
def __init__(self, parent, title, _htest=False):
Toplevel.__init__(self, parent)
self.configure(borderwidth=5)
self.geometry("+%d+%d" % (
p... | true | true |
1c3eba29dfde112cc3cbe366acda5cf030a01733 | 5,117 | py | Python | memsource_cli/models/lqa_settings_dto.py | unofficial-memsource/memsource-cli-client | a6639506b74e95476da87f4375953448b76ea90c | [
"Apache-2.0"
] | 16 | 2019-09-25T00:20:38.000Z | 2021-05-04T05:56:10.000Z | memsource_cli/models/lqa_settings_dto.py | zerodayz/memsource-cli-client | c2574f1467539a49e6637c874e88d75c7ef789b3 | [
"Apache-2.0"
] | 26 | 2019-09-30T14:00:03.000Z | 2021-05-12T11:15:18.000Z | memsource_cli/models/lqa_settings_dto.py | zerodayz/memsource-cli-client | c2574f1467539a49e6637c874e88d75c7ef789b3 | [
"Apache-2.0"
] | 1 | 2021-05-24T16:19:14.000Z | 2021-05-24T16:19:14.000Z | # coding: utf-8
"""
Memsource REST API
Welcome to Memsource's API documentation. To view our legacy APIs please [visit our documentation](https://wiki.memsource.com/wiki/Memsource_API) and for more information about our new APIs, [visit our blog](https://www.memsource.com/blog/2017/10/24/introducing-rest-apis... | 29.923977 | 421 | 0.601133 |
import pprint
import re
import six
from memsource_cli.models.lqa_error_category_dto import LqaErrorCategoryDto from memsource_cli.models.lqa_severity_dto import LqaSeverityDto
class LqaSettingsDto(object):
swagger_types = {
'enabled': 'bool',
'severities': 'list[LqaSeverityDto]',
... | true | true |
1c3eba7512c64be760bcd42530a076ee253a07df | 827 | py | Python | setup.py | keshavdv/hikvision-client | dbebe399ea5ecbbd236488cda28242d134a9f72f | [
"MIT"
] | null | null | null | setup.py | keshavdv/hikvision-client | dbebe399ea5ecbbd236488cda28242d134a9f72f | [
"MIT"
] | null | null | null | setup.py | keshavdv/hikvision-client | dbebe399ea5ecbbd236488cda28242d134a9f72f | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
from os.path import join, dirname
import re
with open('hikvisionapi/__init__.py', 'r') as fd:
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(), re.MULTILINE).group(1)
setup(name='hikvisionapi',
version=version,
... | 39.380952 | 92 | 0.650544 | from setuptools import setup, find_packages
from os.path import join, dirname
import re
with open('hikvisionapi/__init__.py', 'r') as fd:
version = re.search(r'^__version__\s*=\s*[\'"]([^\'"]*)[\'"]',
fd.read(), re.MULTILINE).group(1)
setup(name='hikvisionapi',
version=version,
... | true | true |
1c3eba76465db2b8dee9184bb19fce222cfaebed | 21,677 | py | Python | keras/layers/convolutional_recurrent.py | ypxie/keras-1 | f1ed8d63faa26ce6180faa685839aa32217211c6 | [
"MIT"
] | 1 | 2017-11-15T14:52:07.000Z | 2017-11-15T14:52:07.000Z | keras/layers/convolutional_recurrent.py | ypxie/keras-1 | f1ed8d63faa26ce6180faa685839aa32217211c6 | [
"MIT"
] | null | null | null | keras/layers/convolutional_recurrent.py | ypxie/keras-1 | f1ed8d63faa26ce6180faa685839aa32217211c6 | [
"MIT"
] | 1 | 2021-05-01T09:39:57.000Z | 2021-05-01T09:39:57.000Z | from .. import backend as K
from .. import activations, initializations, regularizers
import numpy as np
from ..engine import Layer, InputSpec
from ..utils.np_utils import conv_output_length
import warnings
class ConvRecurrent2D(Layer):
'''Abstract base class for convolutional recurrent layers.
Do not use in... | 42.420744 | 96 | 0.564562 | from .. import backend as K
from .. import activations, initializations, regularizers
import numpy as np
from ..engine import Layer, InputSpec
from ..utils.np_utils import conv_output_length
import warnings
class ConvRecurrent2D(Layer):
def __init__(self, weights=None, nb_row=None, nb_col=None, nb_filter=None,
... | true | true |
1c3ebae06ecaeff2cc3672f54ae2f7f6aacdadc3 | 1,642 | py | Python | tests/test_fastapi_utils/test_features/test_inferring_router.py | dmontagu/fastapi-auth | d0e86774f66bd43e80376de19bdf034eb228dc07 | [
"MIT"
] | 87 | 2019-12-18T05:43:25.000Z | 2022-03-30T20:04:11.000Z | tests/test_fastapi_utils/test_features/test_inferring_router.py | dmontagu/fastapi-auth | d0e86774f66bd43e80376de19bdf034eb228dc07 | [
"MIT"
] | 2 | 2020-08-07T05:17:18.000Z | 2021-09-14T03:20:04.000Z | tests/test_fastapi_utils/test_features/test_inferring_router.py | dmontagu/fastapi-auth | d0e86774f66bd43e80376de19bdf034eb228dc07 | [
"MIT"
] | 7 | 2020-03-08T17:14:33.000Z | 2022-01-01T21:38:47.000Z | from fastapi import FastAPI
from fastapi_auth.fastapi_util.features.inferring_router import InferringRouter
openapi_spec = {
"info": {"title": "Fast API", "version": "0.1.0"},
"openapi": "3.0.2",
"paths": {
"/1": {
"get": {
"operationId": "endpoint_1_1_get",
... | 29.854545 | 120 | 0.433618 | from fastapi import FastAPI
from fastapi_auth.fastapi_util.features.inferring_router import InferringRouter
openapi_spec = {
"info": {"title": "Fast API", "version": "0.1.0"},
"openapi": "3.0.2",
"paths": {
"/1": {
"get": {
"operationId": "endpoint_1_1_get",
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.