hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f70001f658d4dfaa72dd4f0d1b3176492f6658bb | 6,442 | py | Python | spider/openwrt.py | CNDB/CNDB | 2e3a41111f604cf2f4f22a7c9370bb3f753e3e88 | [
"BSD-3-Clause"
] | null | null | null | spider/openwrt.py | CNDB/CNDB | 2e3a41111f604cf2f4f22a7c9370bb3f753e3e88 | [
"BSD-3-Clause"
] | null | null | null | spider/openwrt.py | CNDB/CNDB | 2e3a41111f604cf2f4f22a7c9370bb3f753e3e88 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# #*** <License> ************************************************************#
# This module is part of the repository CNDB.
#
# This module is licensed under the terms of the BSD 3-Clause License
# <http://www.c-tanzer.at/license/bsd_3c.html>.
# #*** </License> ***************... | 34.449198 | 78 | 0.472369 |
on import Interface, Inet4, Inet6, unroutable
from spider.common import WLAN_Config
from spider.luci import Version_Mixin
class Status (Page_Tree, Version_Mixin) :
url = 'cgi-bin/luci/freifunk/status/status'
retries = 2
timeout = 10
html_charset = 'utf-8'
... | true | true |
f7000273e22d5a0f2d5b40c38a0ed8511d1b8995 | 2,250 | py | Python | utils/compare.py | adcrn/knest | a274dc9ddb642cc30f837e225f000bf33430eb43 | [
"BSD-3-Clause"
] | 8 | 2018-03-15T23:42:51.000Z | 2020-03-10T06:21:03.000Z | utils/compare.py | deekerno/knest | a274dc9ddb642cc30f837e225f000bf33430eb43 | [
"BSD-3-Clause"
] | 12 | 2018-03-15T19:11:02.000Z | 2018-10-30T10:02:45.000Z | utils/compare.py | adcrn/knest | a274dc9ddb642cc30f837e225f000bf33430eb43 | [
"BSD-3-Clause"
] | null | null | null | # UCF Senior Design 2017-18
# Group 38
from PIL import Image
import cv2
import imagehash
import math
import numpy as np
DIFF_THRES = 20
LIMIT = 2
RESIZE = 1000
def calc_hash(img):
"""
Calculate the wavelet hash of the image
img: (ndarray) image file
"""
# resize image if height > 1000
im... | 24.725275 | 78 | 0.646667 |
from PIL import Image
import cv2
import imagehash
import math
import numpy as np
DIFF_THRES = 20
LIMIT = 2
RESIZE = 1000
def calc_hash(img):
img = resize(img)
return imagehash.whash(Image.fromarray(img))
def compare(hash1, hash2):
return hash1 - hash2
def limit(img, std_hash, count):
... | true | true |
f70002926d1d600b4b068459c9dd40ebf3aef47d | 757 | py | Python | sdk/python/kfp/__main__.py | ConverJens/pipelines | a1d453af214ec9eebad73fb05845dd3499d60d00 | [
"Apache-2.0"
] | 6 | 2020-05-19T02:35:11.000Z | 2020-05-29T17:58:42.000Z | sdk/python/kfp/__main__.py | ConverJens/pipelines | a1d453af214ec9eebad73fb05845dd3499d60d00 | [
"Apache-2.0"
] | 1,932 | 2021-01-25T11:23:37.000Z | 2022-03-31T17:10:18.000Z | sdk/python/kfp/__main__.py | ConverJens/pipelines | a1d453af214ec9eebad73fb05845dd3499d60d00 | [
"Apache-2.0"
] | 11 | 2020-05-19T22:26:41.000Z | 2021-01-25T09:56:21.000Z | # Copyright 2018 Google LLC
#
# 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, ... | 32.913043 | 74 | 0.749009 |
from .cli.cli import main
if __name__ == '__main__':
main()
| true | true |
f7000327daf9ff11a381ce6d5de401ff007d1323 | 1,094 | py | Python | TestProject/app/view/RoomItem.py | ChinSing00/ChatChat | 48654e2e125298c00a558449353e38d0cec06d03 | [
"MIT"
] | null | null | null | TestProject/app/view/RoomItem.py | ChinSing00/ChatChat | 48654e2e125298c00a558449353e38d0cec06d03 | [
"MIT"
] | null | null | null | TestProject/app/view/RoomItem.py | ChinSing00/ChatChat | 48654e2e125298c00a558449353e38d0cec06d03 | [
"MIT"
] | null | null | null | import time
from PyQt5 import QtGui, QtCore
from ui.room_item import Ui_Form
from PyQt5.QtWidgets import QWidget
class Room_Item(QWidget,Ui_Form):
def __init__(self,parent=None,room_data=None):
super(Room_Item,self).__init__(parent)
self.setupUi(self)
self.data = room_data
self.se... | 45.583333 | 138 | 0.659049 | import time
from PyQt5 import QtGui, QtCore
from ui.room_item import Ui_Form
from PyQt5.QtWidgets import QWidget
class Room_Item(QWidget,Ui_Form):
def __init__(self,parent=None,room_data=None):
super(Room_Item,self).__init__(parent)
self.setupUi(self)
self.data = room_data
self.se... | true | true |
f7000371f0315cd55c0b14b33e7e8e56697cfc2e | 10,498 | py | Python | src/winforms/toga_winforms/app.py | holg/toga | 9dd766e749c6cf29cdb1127c7637150381ac396d | [
"BSD-3-Clause"
] | 1 | 2020-07-16T00:46:24.000Z | 2020-07-16T00:46:24.000Z | src/winforms/toga_winforms/app.py | holg/toga | 9dd766e749c6cf29cdb1127c7637150381ac396d | [
"BSD-3-Clause"
] | null | null | null | src/winforms/toga_winforms/app.py | holg/toga | 9dd766e749c6cf29cdb1127c7637150381ac396d | [
"BSD-3-Clause"
] | null | null | null | import asyncio
import re
import sys
import traceback
import toga
from toga import Key
from .keys import toga_to_winforms_key
from .libs import Threading, WinForms, shcore, user32, win_version
from .libs.proactor import WinformsProactorEventLoop
from .window import Window
class MainWindow(Window):
def winforms_F... | 35.952055 | 101 | 0.597638 | import asyncio
import re
import sys
import traceback
import toga
from toga import Key
from .keys import toga_to_winforms_key
from .libs import Threading, WinForms, shcore, user32, win_version
from .libs.proactor import WinformsProactorEventLoop
from .window import Window
class MainWindow(Window):
def winforms_F... | true | true |
f7000456815408e3a0899443a0df077b039855c4 | 1,731 | py | Python | __init__.py | luoxiangyong/qgissprp | 4698462743e11eac486af4b60046b99ae2abc1b0 | [
"BSD-2-Clause"
] | null | null | null | __init__.py | luoxiangyong/qgissprp | 4698462743e11eac486af4b60046b99ae2abc1b0 | [
"BSD-2-Clause"
] | null | null | null | __init__.py | luoxiangyong/qgissprp | 4698462743e11eac486af4b60046b99ae2abc1b0 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
/***************************************************************************
SimplePhotogrammetryRoutePlanner
A QGIS plugin
A imple photogrammetry route planner.
Generated by Plugin Builder: http://g-sherman.github.io/Qgis-Plugin-Builder/
... | 46.783784 | 94 | 0.458117 |
__version__ = "0.4.0"
def classFactory(iface):
from .SimplePhotogrammetryRoutePlanner import SimplePhotogrammetryRoutePlanner
return SimplePhotogrammetryRoutePlanner(iface)
| true | true |
f70004a44b39e2f1be17fb0ebfe7da0897c5e85d | 671 | py | Python | eslearn/utils/lc_featureSelection_variance.py | dongmengshi/easylearn | df528aaa69c3cf61f5459a04671642eb49421dfb | [
"MIT"
] | 19 | 2020-02-29T06:00:18.000Z | 2022-01-24T01:30:14.000Z | eslearn/utils/lc_featureSelection_variance.py | dongmengshi/easylearn | df528aaa69c3cf61f5459a04671642eb49421dfb | [
"MIT"
] | 7 | 2020-04-02T03:05:21.000Z | 2020-11-11T11:45:05.000Z | eslearn/utils/lc_featureSelection_variance.py | dongmengshi/easylearn | df528aaa69c3cf61f5459a04671642eb49421dfb | [
"MIT"
] | 11 | 2020-03-03T03:02:15.000Z | 2020-11-11T14:09:55.000Z | # -*- coding: utf-8 -*-
"""
Created on Tue Jul 24 14:38:20 2018
dimension reduction with VarianceThreshold using sklearn.
Feature selector that removes all low-variance features.
@author: lenovo
"""
from sklearn.feature_selection import VarianceThreshold
import numpy as np
#
np.random.seed(1)
X = np.random.randn(100, 1... | 23.964286 | 57 | 0.709389 |
from sklearn.feature_selection import VarianceThreshold
import numpy as np
np.random.seed(1)
X = np.random.randn(100, 10)
X = np.hstack([X, np.zeros([100, 5])])
def featureSelection_variance(X, thrd):
sel = VarianceThreshold(threshold=thrd)
X_selected = sel.fit_transform(X)
mask = sel.get_support()
... | true | true |
f70004bcd049386ad073e2d45bf8fe56d0639a36 | 3,382 | py | Python | mnist/my_multi_tune3.py | silent567/examples | e9de12549125ecd93a4924f6b8e2bbf66d7635d9 | [
"BSD-3-Clause"
] | null | null | null | mnist/my_multi_tune3.py | silent567/examples | e9de12549125ecd93a4924f6b8e2bbf66d7635d9 | [
"BSD-3-Clause"
] | null | null | null | mnist/my_multi_tune3.py | silent567/examples | e9de12549125ecd93a4924f6b8e2bbf66d7635d9 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
from my_multi_main3 import main
import numpy as np
import argparse
import time
parser = argparse.ArgumentParser(description='PyTorch MNIST Example')
parser.add_argument('--batch-size', type=int, default=64, metavar='N',
help='input batch size for training (defa... | 47.633803 | 106 | 0.642815 |
from my_multi_main3 import main
import numpy as np
import argparse
import time
parser = argparse.ArgumentParser(description='PyTorch MNIST Example')
parser.add_argument('--batch-size', type=int, default=64, metavar='N',
help='input batch size for training (default: 64)')
parser.add_argument('--t... | true | true |
f70004db8d93803fe1fd484a52ec6add2822ccb6 | 1,050 | py | Python | spiker/data/hdf5.py | duguyue100/spiker | 09437be393d7adf132f8ee2682e5b5b009c793a1 | [
"MIT"
] | 1 | 2021-01-13T10:46:44.000Z | 2021-01-13T10:46:44.000Z | spiker/data/hdf5.py | duguyue100/spiker | 09437be393d7adf132f8ee2682e5b5b009c793a1 | [
"MIT"
] | null | null | null | spiker/data/hdf5.py | duguyue100/spiker | 09437be393d7adf132f8ee2682e5b5b009c793a1 | [
"MIT"
] | null | null | null | """HDF5 related files.
This file contains a set of functions that related to read and write
HDF5 files.
Author: Yuhuang Hu
Email : duguyue100@gmail.com
"""
from __future__ import print_function, absolute_import
import h5py
from spiker import log
logger = log.get_logger("data-hdf5", log.DEBUG)
def init_hdf5(file_... | 22.826087 | 68 | 0.629524 | from __future__ import print_function, absolute_import
import h5py
from spiker import log
logger = log.get_logger("data-hdf5", log.DEBUG)
def init_hdf5(file_path, mode="w", cam_type="davis"):
if mode == "w":
dataset = h5py.File(file_path, mode=mode)
dataset.create_group("dvs")
dataset.c... | true | true |
f70006680091e477a9da34fc8c775b99d72def25 | 951 | py | Python | thirdparty/org/apache/arrow/flatbuf/FloatingPoint.py | mrocklin/pygdf | 2de9407427da9497ebdf8951a12857be0fab31bb | [
"Apache-2.0"
] | 5 | 2018-10-17T20:28:42.000Z | 2022-02-15T17:33:01.000Z | thirdparty/org/apache/arrow/flatbuf/FloatingPoint.py | mrocklin/pygdf | 2de9407427da9497ebdf8951a12857be0fab31bb | [
"Apache-2.0"
] | 19 | 2018-07-18T07:15:44.000Z | 2021-02-22T17:00:18.000Z | thirdparty/org/apache/arrow/flatbuf/FloatingPoint.py | mrocklin/pygdf | 2de9407427da9497ebdf8951a12857be0fab31bb | [
"Apache-2.0"
] | 2 | 2020-05-01T09:54:34.000Z | 2021-04-17T10:57:07.000Z | # automatically generated by the FlatBuffers compiler, do not modify
# namespace: flatbuf
import flatbuffers
class FloatingPoint(object):
__slots__ = ['_tab']
@classmethod
def GetRootAsFloatingPoint(cls, buf, offset):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x ... | 30.677419 | 92 | 0.698212 |
import flatbuffers
class FloatingPoint(object):
__slots__ = ['_tab']
@classmethod
def GetRootAsFloatingPoint(cls, buf, offset):
n = flatbuffers.encode.Get(flatbuffers.packer.uoffset, buf, offset)
x = FloatingPoint()
x.Init(buf, n + offset)
return x
def Init(se... | true | true |
f70006c8c5153a3a1bb1f109dc563a53c20f0e43 | 162 | py | Python | .history/Classiles/scynced_lights_20210615191535.py | minefarmer/Coding101-OOP | d5655977559e3bd1acf6a4f185a6121cc3b05ce4 | [
"Unlicense"
] | null | null | null | .history/Classiles/scynced_lights_20210615191535.py | minefarmer/Coding101-OOP | d5655977559e3bd1acf6a4f185a6121cc3b05ce4 | [
"Unlicense"
] | null | null | null | .history/Classiles/scynced_lights_20210615191535.py | minefarmer/Coding101-OOP | d5655977559e3bd1acf6a4f185a6121cc3b05ce4 | [
"Unlicense"
] | null | null | null | """[Scynced Lights]
Class attributes are "shared"
Instance attributes are not shared.
"""
def sub(x, y):
f
class Light:
pass
a = Light()
b = Ligth()
| 10.125 | 35 | 0.62963 | def sub(x, y):
f
class Light:
pass
a = Light()
b = Ligth()
| true | true |
f70006d0df161d84dd7ec30a6d7506b5802d1f0c | 9,378 | py | Python | pyspider/libs/counter.py | willworks/pyspider | 9fc2ffa57324d1a42ef767289faa3a04f4d20f2e | [
"Apache-2.0"
] | 1 | 2015-11-08T07:33:31.000Z | 2015-11-08T07:33:31.000Z | pyspider/libs/counter.py | willworks/pyspider | 9fc2ffa57324d1a42ef767289faa3a04f4d20f2e | [
"Apache-2.0"
] | null | null | null | pyspider/libs/counter.py | willworks/pyspider | 9fc2ffa57324d1a42ef767289faa3a04f4d20f2e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# vim: set et sw=4 ts=4 sts=4 ff=unix fenc=utf8:
# Author: Binux<i@binux.me>
# http://binux.me
# Created on 2012-11-14 17:09:50
from __future__ import unicode_literals, division, absolute_import
import time
import logging
from collections import deque
try:
f... | 27.341108 | 92 | 0.579335 |
from __future__ import unicode_literals, division, absolute_import
import time
import logging
from collections import deque
try:
from UserDict import DictMixin
except ImportError:
from collections import Mapping as DictMixin
import six
from six import iteritems
from six.moves import cPickle
class Bas... | true | true |
f700088372c0eeaff049211c5fe92cdccb5fa804 | 6,706 | py | Python | src/transformers/models/vit/feature_extraction_vit.py | djroxx2000/transformers | 77770ec79883343d32051cfb6a04f64523cd8df1 | [
"Apache-2.0"
] | 723 | 2020-07-16T13:02:25.000Z | 2022-03-31T21:03:55.000Z | src/transformers/models/vit/feature_extraction_vit.py | 4nalog/transformers | 76cadb7943c8492ec481f4f3925e9e8793a32c9d | [
"Apache-2.0"
] | 170 | 2020-07-16T14:39:11.000Z | 2022-03-31T13:02:11.000Z | src/transformers/models/vit/feature_extraction_vit.py | 4nalog/transformers | 76cadb7943c8492ec481f4f3925e9e8793a32c9d | [
"Apache-2.0"
] | 131 | 2020-07-16T14:38:16.000Z | 2022-03-29T19:43:18.000Z | # coding=utf-8
# Copyright 2021 The HuggingFace Inc. team. 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 r... | 45.310811 | 166 | 0.646287 |
from typing import List, Optional, Union
import numpy as np
from PIL import Image
from ...feature_extraction_utils import BatchFeature, FeatureExtractionMixin
from ...file_utils import TensorType
from ...image_utils import IMAGENET_STANDARD_MEAN, IMAGENET_STANDARD_STD, ImageFeatureExtractionMixin, is_t... | true | true |
f700096cbce5db1538215892bb1dcc76b6c37987 | 734 | py | Python | hier/project-euler/euler-067-hackerrank/euler067.py | EliahKagan/old-practice-snapshot | 1b53897eac6902f8d867c8f154ce2a489abb8133 | [
"0BSD"
] | null | null | null | hier/project-euler/euler-067-hackerrank/euler067.py | EliahKagan/old-practice-snapshot | 1b53897eac6902f8d867c8f154ce2a489abb8133 | [
"0BSD"
] | null | null | null | hier/project-euler/euler-067-hackerrank/euler067.py | EliahKagan/old-practice-snapshot | 1b53897eac6902f8d867c8f154ce2a489abb8133 | [
"0BSD"
] | null | null | null | #!/usr/bin/env python3
UNKNOWN = -1
def read_val():
return int(input())
def read_row():
return list(map(int, input().split()))
def read_grid():
return [read_row() for _ in range(read_val())]
def make_blank_row(i):
return [UNKNOWN] * i
def make_blank_grid(n):
return [make_blank_row(i) for i in ... | 20.388889 | 75 | 0.564033 |
UNKNOWN = -1
def read_val():
return int(input())
def read_row():
return list(map(int, input().split()))
def read_grid():
return [read_row() for _ in range(read_val())]
def make_blank_row(i):
return [UNKNOWN] * i
def make_blank_grid(n):
return [make_blank_row(i) for i in range(1, n + 1)]
def ... | true | true |
f7000a85ea7a735edb59575f149fc6ff7ce4b461 | 1,866 | py | Python | tools/apps/find_blender.py | SeijiEmery/unity_tools | cb401e6979b95c081a2ab3f944fc6e4419ccfd0e | [
"MIT"
] | null | null | null | tools/apps/find_blender.py | SeijiEmery/unity_tools | cb401e6979b95c081a2ab3f944fc6e4419ccfd0e | [
"MIT"
] | null | null | null | tools/apps/find_blender.py | SeijiEmery/unity_tools | cb401e6979b95c081a2ab3f944fc6e4419ccfd0e | [
"MIT"
] | null | null | null | import platform
# print(platform.system())
operating_system = platform.system().lower()
if operating_system == 'darwin':
from .blender_utils_macos import get_installed_blender_versions
operating_system_name = 'macos'
elif operating_system == 'linux':
from .blender_utils_linux import get_installed_blender_... | 40.565217 | 132 | 0.681136 | import platform
operating_system = platform.system().lower()
if operating_system == 'darwin':
from .blender_utils_macos import get_installed_blender_versions
operating_system_name = 'macos'
elif operating_system == 'linux':
from .blender_utils_linux import get_installed_blender_versions
operating_sys... | true | true |
f7000b2945cb3703ec7fbc7ccf8cd64d39f12e81 | 8,196 | py | Python | codes/data/image_corruptor.py | neonbjb/DL-Art-School | a6f0f854b987ac724e258af8b042ea4459a571bc | [
"Apache-2.0"
] | 12 | 2020-12-13T12:45:03.000Z | 2022-03-29T09:58:15.000Z | codes/data/image_corruptor.py | neonbjb/DL-Art-School | a6f0f854b987ac724e258af8b042ea4459a571bc | [
"Apache-2.0"
] | 1 | 2020-12-31T01:12:45.000Z | 2021-03-31T11:43:52.000Z | codes/data/image_corruptor.py | neonbjb/DL-Art-School | a6f0f854b987ac724e258af8b042ea4459a571bc | [
"Apache-2.0"
] | 3 | 2020-12-14T06:04:04.000Z | 2020-12-26T19:11:41.000Z | import functools
import random
from math import cos, pi
import cv2
import kornia
import numpy as np
import torch
from kornia.augmentation import ColorJitter
from data.util import read_img
from PIL import Image
from io import BytesIO
# Get a rough visualization of the above distribution. (Y-axis is meaningless, just... | 39.028571 | 122 | 0.554173 | import functools
import random
from math import cos, pi
import cv2
import kornia
import numpy as np
import torch
from kornia.augmentation import ColorJitter
from data.util import read_img
from PIL import Image
from io import BytesIO
from utils.util import opt_get
def kornia_color_jitter_numpy(img, setting):
... | true | true |
f7000b6751e6ca87c8cdd1ca6b7921d866ec80c7 | 159 | py | Python | tests/basics/bytes_format_modulo.py | geowor01/micropython | 7fb13eeef4a85f21cae36f1d502bcc53880e1815 | [
"MIT"
] | 7 | 2019-10-18T13:41:39.000Z | 2022-03-15T17:27:57.000Z | tests/basics/bytes_format_modulo.py | geowor01/micropython | 7fb13eeef4a85f21cae36f1d502bcc53880e1815 | [
"MIT"
] | null | null | null | tests/basics/bytes_format_modulo.py | geowor01/micropython | 7fb13eeef4a85f21cae36f1d502bcc53880e1815 | [
"MIT"
] | 2 | 2020-06-23T09:10:15.000Z | 2020-12-22T06:42:14.000Z | # This test requires CPython3.5
print(b"%%" % ())
print(b"=%d=" % 1)
print(b"=%d=%d=" % (1, 2))
print(b"=%s=" % b"str")
print(b"=%r=" % b"str")
print("PASS") | 17.666667 | 31 | 0.503145 |
print(b"%%" % ())
print(b"=%d=" % 1)
print(b"=%d=%d=" % (1, 2))
print(b"=%s=" % b"str")
print(b"=%r=" % b"str")
print("PASS") | true | true |
f7000bbc055be36dc38b5ab214bad87b6d24f064 | 2,102 | py | Python | tests/test_JpegCompression.py | tt195361/TfDataAugmentation | 0deb987ae5a37816d88eec302bc42db7479ea8df | [
"MIT"
] | null | null | null | tests/test_JpegCompression.py | tt195361/TfDataAugmentation | 0deb987ae5a37816d88eec302bc42db7479ea8df | [
"MIT"
] | null | null | null | tests/test_JpegCompression.py | tt195361/TfDataAugmentation | 0deb987ae5a37816d88eec302bc42db7479ea8df | [
"MIT"
] | null | null | null | #
# test_JpegCompression.py
#
import pytest
import albumentations as A
from .context import TfDataAugmentation as Tfda
from . import test_utils
from .test_utils import TestResult
@pytest.mark.parametrize(
"quality_lower, quality_upper, expected, message", [
# quality_lower
(-1, 100, TestResult.Er... | 28.794521 | 60 | 0.621313 |
import pytest
import albumentations as A
from .context import TfDataAugmentation as Tfda
from . import test_utils
from .test_utils import TestResult
@pytest.mark.parametrize(
"quality_lower, quality_upper, expected, message", [
(-1, 100, TestResult.Error,
"quality_lower < min => Erro... | true | true |
f7000bc963cc817a5a5dca6aba86f5ea6dde667e | 3,008 | py | Python | tests/test_background_swap.py | pclucas14/continuum | 3b9b0fc3c2f21dcaeafbccfa29987cefe55f37a0 | [
"MIT"
] | 4 | 2020-04-15T14:31:42.000Z | 2020-04-24T17:07:34.000Z | tests/test_background_swap.py | pclucas14/continuum | 3b9b0fc3c2f21dcaeafbccfa29987cefe55f37a0 | [
"MIT"
] | 18 | 2020-04-15T14:57:27.000Z | 2020-05-02T14:05:36.000Z | tests/test_background_swap.py | arthurdouillard/continual_loader | 09034db1371e9646ca660fd4d4df73e61bf77067 | [
"MIT"
] | 1 | 2020-04-15T15:50:28.000Z | 2020-04-15T15:50:28.000Z | import os
from torch.utils.data import DataLoader
from continuum.datasets import CIFAR10, InMemoryDataset
from continuum.datasets import MNIST
import torchvision
from continuum.scenarios import TransformationIncremental
import pytest
import numpy as np
from continuum.transforms.bg_swap import BackgroundSwap
DATA_PAT... | 31.010309 | 115 | 0.657247 | import os
from torch.utils.data import DataLoader
from continuum.datasets import CIFAR10, InMemoryDataset
from continuum.datasets import MNIST
import torchvision
from continuum.scenarios import TransformationIncremental
import pytest
import numpy as np
from continuum.transforms.bg_swap import BackgroundSwap
DATA_PAT... | true | true |
f7000c3468a0624d54db99fbbde0ac002173b532 | 2,025 | py | Python | python/communitymanager/lib/const.py | OpenCIOC/communityrepo | 63199a7b620f5c08624e534faf771e5dd2243adb | [
"Apache-2.0"
] | 2 | 2016-01-25T14:40:44.000Z | 2018-01-31T04:30:23.000Z | python/communitymanager/lib/const.py | OpenCIOC/communityrepo | 63199a7b620f5c08624e534faf771e5dd2243adb | [
"Apache-2.0"
] | 5 | 2018-02-07T20:16:49.000Z | 2021-12-13T19:41:43.000Z | python/communitymanager/lib/const.py | OpenCIOC/communityrepo | 63199a7b620f5c08624e534faf771e5dd2243adb | [
"Apache-2.0"
] | 1 | 2018-02-07T20:37:52.000Z | 2018-02-07T20:37:52.000Z | # =========================================================================================
# Copyright 2015 Community Information Online Consortium (CIOC) and KCL Software Solutions
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.... | 32.142857 | 95 | 0.640494 |
import os
JQUERY_VERSION = "1.6.2"
JQUERY_UI_VERSION = "1.8.16"
DATE_TEXT_SIZE = 25
TEXT_SIZE = 85
TEXTAREA_COLS = 85
TEXTAREA_ROWS_SHORT = 2
TEXTAREA_ROWS_LONG = 4
TEXTAREA_ROWS_XLONG = 10
MAX_LENGTH_CHECKLIST_NOTES = 255
EMAIL_LENGTH = 60
_app_path = None
_config_file = None
_app_name = None
s... | true | true |
f7000d37df1b082b8f943334e45282014877347e | 3,280 | py | Python | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_08_01/aio/_configuration.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_08_01/aio/_configuration.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_08_01/aio/_configuration.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 48.235294 | 134 | 0.699695 |
from typing import Any, TYPE_CHECKING
from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMHttpLoggingPolicy
from .._version import VERSION
if TYPE_CHECKING:
from azure.core.credentials_async import AsyncTokenCredential
... | true | true |
f7000e80dc69165127d93dc9b2a8e5454d07d8ca | 852 | py | Python | spongeauth/core/tests/test_x_real_ip_middleware.py | felixoi/SpongeAuth | d44ee52d0b35b2e1909c7bf6bad29aa7b4835b26 | [
"MIT"
] | 10 | 2016-11-18T12:37:24.000Z | 2022-03-04T09:25:25.000Z | spongeauth/core/tests/test_x_real_ip_middleware.py | felixoi/SpongeAuth | d44ee52d0b35b2e1909c7bf6bad29aa7b4835b26 | [
"MIT"
] | 794 | 2016-11-19T18:34:37.000Z | 2022-03-31T16:49:11.000Z | spongeauth/core/tests/test_x_real_ip_middleware.py | PowerNukkit/OreAuth | 96a2926c9601fce6fac471bdb997077f07e8bf9a | [
"MIT"
] | 11 | 2016-11-26T22:30:17.000Z | 2022-03-16T17:20:14.000Z | import django.http
import unittest.mock
from .. import middleware
def get_response(req):
# dummy get_response, just return an empty response
return django.http.HttpResponse()
def test_leaves_remote_addr_alone_if_no_real_ip():
remote_addr = object()
request = unittest.mock.MagicMock()
request.M... | 25.058824 | 76 | 0.75 | import django.http
import unittest.mock
from .. import middleware
def get_response(req):
return django.http.HttpResponse()
def test_leaves_remote_addr_alone_if_no_real_ip():
remote_addr = object()
request = unittest.mock.MagicMock()
request.META = {"REMOTE_ADDR": remote_addr}
middleware.... | true | true |
f7000f03c62e8b3dcc7083fb8b218b5a6f499aa8 | 198 | py | Python | test-relay.py | rn-santos227/medsys | d72ef3b419bdb84cc21022af7ce43813090ef211 | [
"MIT"
] | null | null | null | test-relay.py | rn-santos227/medsys | d72ef3b419bdb84cc21022af7ce43813090ef211 | [
"MIT"
] | null | null | null | test-relay.py | rn-santos227/medsys | d72ef3b419bdb84cc21022af7ce43813090ef211 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import time
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(21, GPIO.OUT)
GPIO.output(21, GPIO.LOW)
time.sleep(3.00)
GPIO.output(21, GPIO.HIGH)
GPIO.cleanup()
| 11.647059 | 26 | 0.717172 |
import time
import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
GPIO.setup(21, GPIO.OUT)
GPIO.output(21, GPIO.LOW)
time.sleep(3.00)
GPIO.output(21, GPIO.HIGH)
GPIO.cleanup()
| true | true |
f7000f942ae83e6e025768748f579184365a76d4 | 305 | py | Python | server/objects/notifier.py | jaxsenh/the-devil-that-lurks | 89fa85c461a8da55a0b7d28e32dd8144d6cac8ca | [
"MIT"
] | 1 | 2020-05-28T03:21:44.000Z | 2020-05-28T03:21:44.000Z | server/objects/notifier.py | jaxsenh/the-devil-that-lurks | 89fa85c461a8da55a0b7d28e32dd8144d6cac8ca | [
"MIT"
] | null | null | null | server/objects/notifier.py | jaxsenh/the-devil-that-lurks | 89fa85c461a8da55a0b7d28e32dd8144d6cac8ca | [
"MIT"
] | null | null | null | from direct.directnotify.DirectNotifyGlobal import directNotify
class Notifier:
def __init__(self, name):
"""
@param name: The name of the notifier. Be sure to add it to your config/Config.prc!
@type name: str
"""
self.notify = directNotify.newCategory(name)
| 27.727273 | 91 | 0.659016 | from direct.directnotify.DirectNotifyGlobal import directNotify
class Notifier:
def __init__(self, name):
self.notify = directNotify.newCategory(name)
| true | true |
f70011c6182da69473e565cf0d8aee9ee61da27a | 221 | py | Python | packaging/squarer/ml_squarer.py | g-nightingale/tox_examples | d7714375c764580b4b8af9db61332ced4e851def | [
"BSD-3-Clause"
] | 10 | 2020-05-23T15:40:43.000Z | 2022-02-06T22:34:10.000Z | packaging/squarer/ml_squarer.py | g-nightingale/tox_examples | d7714375c764580b4b8af9db61332ced4e851def | [
"BSD-3-Clause"
] | null | null | null | packaging/squarer/ml_squarer.py | g-nightingale/tox_examples | d7714375c764580b4b8af9db61332ced4e851def | [
"BSD-3-Clause"
] | 12 | 2020-08-04T11:37:56.000Z | 2022-03-31T23:21:13.000Z | import numpy as np
def train_ml_squarer() -> None:
print("Training!")
def square() -> int:
"""Square a number...maybe"""
return np.random.randint(1, 100)
if __name__ == '__main__':
train_ml_squarer() | 15.785714 | 36 | 0.633484 | import numpy as np
def train_ml_squarer() -> None:
print("Training!")
def square() -> int:
return np.random.randint(1, 100)
if __name__ == '__main__':
train_ml_squarer() | true | true |
f70012b80af6d540ea4880f63579ca63dcbdd2f2 | 6,034 | py | Python | arcade/examples/platform_tutorial/09_load_map.py | yegarti/arcade | 1862e61aab9a7dc646265005b0e808d953a9dfe3 | [
"MIT"
] | null | null | null | arcade/examples/platform_tutorial/09_load_map.py | yegarti/arcade | 1862e61aab9a7dc646265005b0e808d953a9dfe3 | [
"MIT"
] | null | null | null | arcade/examples/platform_tutorial/09_load_map.py | yegarti/arcade | 1862e61aab9a7dc646265005b0e808d953a9dfe3 | [
"MIT"
] | null | null | null | """
Platformer Game
"""
import arcade
# Constants
SCREEN_WIDTH = 1000
SCREEN_HEIGHT = 650
SCREEN_TITLE = "Platformer"
# Constants used to scale our sprites from their original size
CHARACTER_SCALING = 1
TILE_SCALING = 0.5
COIN_SCALING = 0.5
SPRITE_PIXEL_SIZE = 128
GRID_PIXEL_SIZE = SPRITE_PIXEL_SIZE * TILE_SCALING
#... | 30.474747 | 106 | 0.632748 | import arcade
SCREEN_WIDTH = 1000
SCREEN_HEIGHT = 650
SCREEN_TITLE = "Platformer"
CHARACTER_SCALING = 1
TILE_SCALING = 0.5
COIN_SCALING = 0.5
SPRITE_PIXEL_SIZE = 128
GRID_PIXEL_SIZE = SPRITE_PIXEL_SIZE * TILE_SCALING
PLAYER_MOVEMENT_SPEED = 10
GRAVITY = 1
PLAYER_JUMP_SPEED = 20
class MyGame(arcade.Window):
... | true | true |
f7001373a7204c33b024b0c7595942d17d82aa97 | 19,924 | py | Python | lib/ycmd/start.py | mrmansano/sublime-ycmd | fece62f0ce4e9cbf96ed8ba07f5cecb24b21427e | [
"MIT"
] | 12 | 2018-01-24T20:58:10.000Z | 2021-12-21T15:02:10.000Z | lib/ycmd/start.py | mrmansano/sublime-ycmd | fece62f0ce4e9cbf96ed8ba07f5cecb24b21427e | [
"MIT"
] | 4 | 2018-01-13T14:39:45.000Z | 2020-11-25T00:05:27.000Z | lib/ycmd/start.py | mrmansano/sublime-ycmd | fece62f0ce4e9cbf96ed8ba07f5cecb24b21427e | [
"MIT"
] | 2 | 2018-10-23T17:13:44.000Z | 2019-05-12T04:10:17.000Z | #!/usr/bin/env python3
'''
lib/ycmd/start.py
Server bootstrap logic. Includes a utility class for normalizing parameters and
calculating default ones. Also includes a helper to set up the temporary
options file.
'''
import logging
import os
import tempfile
from ..process import (
FileHandles,
Process,
)
from... | 36.291439 | 79 | 0.672656 |
import logging
import os
import tempfile
from ..process import (
FileHandles,
Process,
)
from ..util.fs import (
default_python_binary_path,
save_json_file,
)
from ..ycmd.constants import (
YCMD_LOG_SPOOL_OUTPUT,
YCMD_LOG_SPOOL_SIZE,
YCMD_DEFAULT_SERVER_CHECK_INTERVAL_SECONDS,
YCMD_D... | true | true |
f700138011862872e2cc9ea8d4b8a3ff7174ef9d | 7,359 | py | Python | xflash-serial.py | walczakp/xbox360-teensy-flasher | 594990e835fa0f9111ced1901f52d2fb80d61b4d | [
"MIT"
] | 11 | 2020-04-05T02:36:43.000Z | 2021-11-11T21:56:17.000Z | xflash-serial.py | walczakp/xbox360-flasher | 699a9a80c1a2fbfd7663144267dac950becc0405 | [
"MIT"
] | 1 | 2021-05-11T22:36:39.000Z | 2021-05-13T11:16:01.000Z | xflash-serial.py | walczakp/xbox360-teensy-flasher | 594990e835fa0f9111ced1901f52d2fb80d61b4d | [
"MIT"
] | 2 | 2022-02-21T06:42:06.000Z | 2022-03-26T19:28:09.000Z | #!/usr/bin/env python
import serial
import sys
import struct
import pprint
import argparse
import code
pp = pprint.PrettyPrinter()
class ConsoleUI:
def opStart(self, name):
sys.stdout.write(name.ljust(40))
def opProgress(self, progress, total=-1):
if (total >= 0):
prstr = "0x%04x... | 30.409091 | 131 | 0.552792 |
import serial
import sys
import struct
import pprint
import argparse
import code
pp = pprint.PrettyPrinter()
class ConsoleUI:
def opStart(self, name):
sys.stdout.write(name.ljust(40))
def opProgress(self, progress, total=-1):
if (total >= 0):
prstr = "0x%04x / 0x%04x" % (progres... | true | true |
f70014551e3b05adace4276bbdf12330b4b1aaf7 | 2,503 | py | Python | CIM16/IEC61970/Informative/InfCustomers/ComplianceEvent.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | null | null | null | CIM16/IEC61970/Informative/InfCustomers/ComplianceEvent.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | null | null | null | CIM16/IEC61970/Informative/InfCustomers/ComplianceEvent.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | 1 | 2021-04-02T18:04:49.000Z | 2021-04-02T18:04:49.000Z | # Copyright (C) 2010-2011 Richard Lincoln
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish... | 56.886364 | 823 | 0.75869 |
from CIM16.IEC61968.Common.ActivityRecord import ActivityRecord
class ComplianceEvent(ActivityRecord):
def __init__(self, deadline='', *args, **kw_args):
self.deadline = deadline
super(ComplianceEvent, self).__init__(*args, **kw_args)
_attrs = ["deadline"]
_a... | true | true |
f700169f42c4405db98ca51444ca7070b1d5d538 | 43,726 | py | Python | looking_for_group/games/api_views.py | andrlik/looking-for-group | 0b1cecb37ef0f6d75692fd188130e2c60d09b7d2 | [
"BSD-3-Clause"
] | null | null | null | looking_for_group/games/api_views.py | andrlik/looking-for-group | 0b1cecb37ef0f6d75692fd188130e2c60d09b7d2 | [
"BSD-3-Clause"
] | null | null | null | looking_for_group/games/api_views.py | andrlik/looking-for-group | 0b1cecb37ef0f6d75692fd188130e2c60d09b7d2 | [
"BSD-3-Clause"
] | null | null | null | import logging
from django.db.models.query_utils import Q
from django.shortcuts import get_object_or_404
from django.utils.decorators import method_decorator
from django_filters.rest_framework import DjangoFilterBackend
from drf_yasg import openapi
from drf_yasg.openapi import Parameter
from drf_yasg.utils import no_b... | 34.160938 | 179 | 0.644353 | import logging
from django.db.models.query_utils import Q
from django.shortcuts import get_object_or_404
from django.utils.decorators import method_decorator
from django_filters.rest_framework import DjangoFilterBackend
from drf_yasg import openapi
from drf_yasg.openapi import Parameter
from drf_yasg.utils import no_b... | true | true |
f700171313ea3cd9aba9f32edd0869bb57ac51e3 | 2,851 | py | Python | test/testsql.py | ckarnell/sqlalchemy-stubs | 055c198e26ca700b2d4a365c06bedcfbed0de176 | [
"Apache-2.0"
] | null | null | null | test/testsql.py | ckarnell/sqlalchemy-stubs | 055c198e26ca700b2d4a365c06bedcfbed0de176 | [
"Apache-2.0"
] | 1 | 2019-11-29T16:25:29.000Z | 2020-01-23T16:13:05.000Z | test/testsql.py | ckarnell/sqlalchemy-stubs | 055c198e26ca700b2d4a365c06bedcfbed0de176 | [
"Apache-2.0"
] | 1 | 2019-11-29T16:12:37.000Z | 2019-11-29T16:12:37.000Z | """Mypy style test cases for SQLAlchemy stubs and plugin."""
import os
import os.path
import sys
import pytest # type: ignore # no pytest in typeshed
from mypy.test.config import test_temp_dir
from mypy.test.data import DataDrivenTestCase, DataSuite
from mypy.test.helpers import assert_string_arrays_equal
from myp... | 39.597222 | 98 | 0.58155 |
import os
import os.path
import sys
import pytest import test_temp_dir
from mypy.test.data import DataDrivenTestCase, DataSuite
from mypy.test.helpers import assert_string_arrays_equal
from mypy.util import try_find_python2_interpreter
from mypy import api
this_file_dir = os.path.dirname(os.path.realpath(__file__)... | true | true |
f70018519847d548a5e05bd0b049391f90c31394 | 4,932 | py | Python | tools/release-announcement.py | 19317362/gerrit | bd1e5e9a194dbef18ca502db5c5564f4863011a4 | [
"Apache-2.0"
] | 1 | 2020-09-05T16:50:52.000Z | 2020-09-05T16:50:52.000Z | tools/release-announcement.py | 19317362/gerrit | bd1e5e9a194dbef18ca502db5c5564f4863011a4 | [
"Apache-2.0"
] | null | null | null | tools/release-announcement.py | 19317362/gerrit | bd1e5e9a194dbef18ca502db5c5564f4863011a4 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright (C) 2017 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 31.414013 | 79 | 0.642336 |
from __future__ import print_function
import argparse
import hashlib
import os
import sys
from gnupg import GPG
from jinja2 import Template
class Version:
def __init__(self, version):
self.version = version
parts = version.split('.')
... | true | true |
f70019c6508df560087bb4bd7cafe83ac8584df1 | 19,693 | py | Python | .vscode-server/data/User/History/-1f47d17c/QkLc.py | UNIZAR-30226-2022-09/back-end | 7f20e141e34bf0ae7cce70515a1e4bb0cd85b173 | [
"MIT"
] | null | null | null | .vscode-server/data/User/History/-1f47d17c/QkLc.py | UNIZAR-30226-2022-09/back-end | 7f20e141e34bf0ae7cce70515a1e4bb0cd85b173 | [
"MIT"
] | 1 | 2022-02-16T12:12:43.000Z | 2022-02-16T12:15:03.000Z | .vscode-server/data/User/History/-1f47d17c/QkLc.py | UNIZAR-30226-2022-09/back-end | 7f20e141e34bf0ae7cce70515a1e4bb0cd85b173 | [
"MIT"
] | null | null | null | # from flask import Flask, Blueprint
# from flask_sqlalchemy import SQLAlchemy
# from flask_login import LoginManager
# import os
from flask import Flask, jsonify, request, make_response, redirect, url_for
import jwt
import datetime
import os
from functools import wraps
from flask_sqlalchemy import SQLAlchemy
import u... | 33.321489 | 153 | 0.640583 |
from flask import Flask, jsonify, request, make_response, redirect, url_for
import jwt
import datetime
import os
from functools import wraps
from flask_sqlalchemy import SQLAlchemy
import uuid
from werkzeug.security import generate_password_hash, check_password_hash
from werkzeug.utils import secure_filename
from ... | false | true |
f70019c95c7be20517b76954cfb0e4af80ac4c4a | 6,708 | py | Python | grafeas/models/api_artifact.py | atlassian-forks/client-python | 111cb2184324595931e42233707a58cff77cb6ec | [
"Apache-2.0"
] | 6 | 2018-01-22T21:54:56.000Z | 2020-07-26T14:52:13.000Z | grafeas/models/api_artifact.py | atlassian-forks/client-python | 111cb2184324595931e42233707a58cff77cb6ec | [
"Apache-2.0"
] | 6 | 2018-07-12T12:56:16.000Z | 2021-07-13T00:33:24.000Z | grafeas/models/api_artifact.py | atlassian-forks/client-python | 111cb2184324595931e42233707a58cff77cb6ec | [
"Apache-2.0"
] | 19 | 2018-07-12T11:08:44.000Z | 2022-03-09T06:17:04.000Z | # coding: utf-8
"""
An API to insert and retrieve metadata on cloud artifacts.
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: v1alpha1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
... | 33.54 | 481 | 0.603757 |
import pprint
import re
import six
class ApiArtifact(object):
swagger_types = {
'name': 'str',
'checksum': 'str',
'id': 'str',
'names': 'list[str]'
}
attribute_map = {
'name': 'name',
'checksum': 'checksum',
'id': 'id',
'names': 'nam... | true | true |
f7001ad17b839c3551d7b4c8edcc8b1d1d322b6f | 6,412 | py | Python | asv/plugins/conda.py | prisae/asv | 57c386d7cc27f91ecd8daf1ad2e0413f2efdd39c | [
"BSD-3-Clause"
] | 2 | 2019-08-18T11:05:25.000Z | 2019-11-17T02:07:18.000Z | asv/plugins/conda.py | prisae/asv | 57c386d7cc27f91ecd8daf1ad2e0413f2efdd39c | [
"BSD-3-Clause"
] | 1 | 2019-02-19T17:11:38.000Z | 2019-02-19T17:11:38.000Z | asv/plugins/conda.py | prisae/asv | 57c386d7cc27f91ecd8daf1ad2e0413f2efdd39c | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, unicode_literals, print_function
import re
import os
import tempfile
import six
from .. import environment
from ..console import log
from .. import util
WIN = (os.name == "nt")... | 33.570681 | 93 | 0.547723 |
from __future__ import absolute_import, division, unicode_literals, print_function
import re
import os
import tempfile
import six
from .. import environment
from ..console import log
from .. import util
WIN = (os.name == "nt")
def _find_conda():
if 'CONDA_EXE' in os.environ:
conda = os.environ['CO... | true | true |
f7001b0dd9058f750bdd397267bbd285ae08c0d2 | 25,094 | py | Python | pypy/interpreter/function.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | 1 | 2019-05-27T00:58:46.000Z | 2019-05-27T00:58:46.000Z | pypy/interpreter/function.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | null | null | null | pypy/interpreter/function.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | null | null | null | """
Function objects.
In PyPy there is no difference between built-in and user-defined function
objects; the difference lies in the code object found in their func_code
attribute.
"""
from pypy.rlib.unroll import unrolling_iterable
from pypy.interpreter.error import OperationError
from pypy.interpreter.baseobjspace i... | 41.477686 | 177 | 0.600064 | """
Function objects.
In PyPy there is no difference between built-in and user-defined function
objects; the difference lies in the code object found in their func_code
attribute.
"""
from pypy.rlib.unroll import unrolling_iterable
from pypy.interpreter.error import OperationError
from pypy.interpreter.baseobjspace i... | false | true |
f7001b697392ceebda04fd774fb9d56f47820f4b | 17,633 | py | Python | venv/lib/python3.7/site-packages/torch/utils/benchmark/utils/timer.py | GOOGLE-M/SGC | 78ad8d02b80808302e38559e2d0f430f66a809bd | [
"MIT"
] | null | null | null | venv/lib/python3.7/site-packages/torch/utils/benchmark/utils/timer.py | GOOGLE-M/SGC | 78ad8d02b80808302e38559e2d0f430f66a809bd | [
"MIT"
] | null | null | null | venv/lib/python3.7/site-packages/torch/utils/benchmark/utils/timer.py | GOOGLE-M/SGC | 78ad8d02b80808302e38559e2d0f430f66a809bd | [
"MIT"
] | null | null | null | """Timer class based on the timeit.Timer class, but torch aware."""
import enum
import timeit
import textwrap
from typing import Any, Callable, Dict, List, NoReturn, Optional, Type, Union
import numpy as np
import torch
from torch.utils.benchmark.utils import common, cpp_jit
from torch.utils.benchmark.utils._stubs imp... | 40.166287 | 100 | 0.61969 | import enum
import timeit
import textwrap
from typing import Any, Callable, Dict, List, NoReturn, Optional, Type, Union
import numpy as np
import torch
from torch.utils.benchmark.utils import common, cpp_jit
from torch.utils.benchmark.utils._stubs import TimerClass, TimeitModuleType
from torch.utils.benchmark.utils.va... | true | true |
f7001bd6600b878e6c19cae22c37a1c835b9236c | 19,315 | py | Python | Ranger/src/Range/Range.py | er432/Ranger | a583b332ffe0e5db9f60a5716c9a5504d91fbd39 | [
"BSD-3-Clause"
] | 2 | 2015-03-22T00:31:28.000Z | 2021-01-31T16:24:42.000Z | Ranger/src/Range/Range.py | er432/Ranger | a583b332ffe0e5db9f60a5716c9a5504d91fbd39 | [
"BSD-3-Clause"
] | 1 | 2015-10-06T00:43:51.000Z | 2015-10-06T02:36:36.000Z | Ranger/src/Range/Range.py | er432/Ranger | a583b332ffe0e5db9f60a5716c9a5504d91fbd39 | [
"BSD-3-Clause"
] | 2 | 2016-04-10T08:02:23.000Z | 2020-12-11T06:17:41.000Z | from Ranger.src.Range.Cut import Cut
class Range(object):
"""
Class used to represent a range along some 1-D domain. The range
is represented by 2 cutpoints can can be unbounded by specifying an
aboveAll or belowAll Cut.
"""
def __init__(self, lowerCut, upperCut):
""" Instantiates a Ran... | 31.92562 | 81 | 0.546932 | from Ranger.src.Range.Cut import Cut
class Range(object):
def __init__(self, lowerCut, upperCut):
if not all(map(lambda x: isinstance(x, Cut), (lowerCut,upperCut))):
raise ValueError("Bounds must be Cut objects")
elif lowerCut > upperCut:
raise ValueError("Lower bound cannot... | true | true |
f7001ca968913bd67dab95f067b10995bada69eb | 62 | py | Python | pyrelational/data/__init__.py | RelationRx/pyrelational | 41ededeff84158bd88b76d39006764de3388c821 | [
"Apache-2.0"
] | 42 | 2022-02-09T16:36:37.000Z | 2022-03-25T00:25:34.000Z | pyrelational/data/__init__.py | RelationRx/pyrelational | 41ededeff84158bd88b76d39006764de3388c821 | [
"Apache-2.0"
] | 4 | 2022-03-22T13:22:38.000Z | 2022-03-25T16:14:40.000Z | pyrelational/data/__init__.py | RelationRx/pyrelational | 41ededeff84158bd88b76d39006764de3388c821 | [
"Apache-2.0"
] | 3 | 2022-02-15T17:50:30.000Z | 2022-03-10T18:14:16.000Z | from pyrelational.data.data_manager import GenericDataManager
| 31 | 61 | 0.903226 | from pyrelational.data.data_manager import GenericDataManager
| true | true |
f7001d1417417c71799f65be7cf142530523b8ed | 7,625 | py | Python | selfdrive/car/nissan/values.py | duyetb3/openpilot | 1e906366f8439e3ef3f4f8fc01e2f2ec0f951a86 | [
"MIT"
] | 3 | 2021-11-28T00:43:46.000Z | 2021-12-21T11:32:21.000Z | selfdrive/car/nissan/values.py | byte-iot/openpilot | 7fc1b7dc0a5be75a3ae5d7217b9e887b34947c91 | [
"MIT"
] | 1 | 2022-02-27T14:38:59.000Z | 2022-02-27T14:38:59.000Z | selfdrive/car/nissan/values.py | byte-iot/openpilot | 7fc1b7dc0a5be75a3ae5d7217b9e887b34947c91 | [
"MIT"
] | 5 | 2022-03-24T16:18:47.000Z | 2022-03-30T02:18:49.000Z | from selfdrive.car import dbc_dict
from cereal import car
Ecu = car.CarParams.Ecu
class CarControllerParams:
ANGLE_DELTA_BP = [0., 5., 15.]
ANGLE_DELTA_V = [5., .8, .15] # windup limit
ANGLE_DELTA_VU = [5., 3.5, 0.4] # unwind limit
LKAS_MAX_TORQUE = 1 # A value of 1 is easy to overpower
... | 62.5 | 1,341 | 0.550033 | from selfdrive.car import dbc_dict
from cereal import car
Ecu = car.CarParams.Ecu
class CarControllerParams:
ANGLE_DELTA_BP = [0., 5., 15.]
ANGLE_DELTA_V = [5., .8, .15]
ANGLE_DELTA_VU = [5., 3.5, 0.4]
LKAS_MAX_TORQUE = 1
STEER_THRESHOLD = 1.0
class CAR:
XTRAIL = "NISSAN X-TRAIL 20... | true | true |
f7001d4c7d2dcb48ce84c4cb33d95e2e8be5f394 | 608 | py | Python | elastic_agent_setup/download.py | MSAdministrator/elastic-agent-setup | 5cb8202aaed281f73706556a86657f5525495b56 | [
"MIT"
] | 1 | 2022-02-04T16:59:53.000Z | 2022-02-04T16:59:53.000Z | elastic_agent_setup/download.py | MSAdministrator/elastic-agent-setup | 5cb8202aaed281f73706556a86657f5525495b56 | [
"MIT"
] | 1 | 2021-07-21T11:30:13.000Z | 2021-11-09T14:30:10.000Z | elastic_agent_setup/download.py | MSAdministrator/elastic-agent-setup | 5cb8202aaed281f73706556a86657f5525495b56 | [
"MIT"
] | null | null | null | from .core import Core, Settings
class Download(Core):
host = 'https://artifacts.elastic.co/downloads/beats/elastic-agent/{endpoint}'
endpoint = Settings.download_endpoint
kwargs = {
'stream': True
}
def parse_response(self, response):
self.__logger.debug('Saving file to download... | 32 | 94 | 0.641447 | from .core import Core, Settings
class Download(Core):
host = 'https://artifacts.elastic.co/downloads/beats/elastic-agent/{endpoint}'
endpoint = Settings.download_endpoint
kwargs = {
'stream': True
}
def parse_response(self, response):
self.__logger.debug('Saving file to download... | true | true |
f7001e1d779abcb0aeb35035bb723969df9248a9 | 16,479 | py | Python | mmdet/models/detectors/csp.py | mohammedshariqnawaz/Pedestron | 9785feb94f00e07ae24a662525b4678f12d0fdc8 | [
"Apache-2.0"
] | 4 | 2022-03-09T11:34:30.000Z | 2022-03-30T07:29:21.000Z | mmdet/models/detectors/csp.py | mohammedshariqnawaz/Pedestron | 9785feb94f00e07ae24a662525b4678f12d0fdc8 | [
"Apache-2.0"
] | null | null | null | mmdet/models/detectors/csp.py | mohammedshariqnawaz/Pedestron | 9785feb94f00e07ae24a662525b4678f12d0fdc8 | [
"Apache-2.0"
] | 1 | 2022-03-30T07:29:24.000Z | 2022-03-30T07:29:24.000Z |
from .single_stage import SingleStageDetector
from ..registry import DETECTORS
from mmdet.core import bbox2result
import torch.nn as nn
import torch
from .. import builder
import numpy as np
import cv2
from mmdet.core import bbox2roi, bbox2result, build_assigner, build_sampler
@DETECTORS.register_module
class CSP(Sin... | 46.948718 | 168 | 0.535955 |
from .single_stage import SingleStageDetector
from ..registry import DETECTORS
from mmdet.core import bbox2result
import torch.nn as nn
import torch
from .. import builder
import numpy as np
import cv2
from mmdet.core import bbox2roi, bbox2result, build_assigner, build_sampler
@DETECTORS.register_module
class CSP(Sin... | true | true |
f7001e81c88f6887d923756d3bef3ec22c9f9ddb | 3,110 | py | Python | examples/rfm9x_simpletest.py | lgnashold/Adafruit_CircuitPython_RFM9x | 9350b5d151444499ff022969d9299c8a202d8b7f | [
"MIT"
] | null | null | null | examples/rfm9x_simpletest.py | lgnashold/Adafruit_CircuitPython_RFM9x | 9350b5d151444499ff022969d9299c8a202d8b7f | [
"MIT"
] | null | null | null | examples/rfm9x_simpletest.py | lgnashold/Adafruit_CircuitPython_RFM9x | 9350b5d151444499ff022969d9299c8a202d8b7f | [
"MIT"
] | null | null | null | # Simple demo of sending and recieving data with the RFM95 LoRa radio.
# Author: Tony DiCola
import board
import busio
import digitalio
import adafruit_rfm9x
# Define radio parameters.
RADIO_FREQ_MHZ = 915.0 # Frequency of the radio in Mhz. Must match your
# module! Can be a value like 915.0, 433.0, etc.
# Define ... | 40.921053 | 96 | 0.717685 |
import board
import busio
import digitalio
import adafruit_rfm9x
RADIO_FREQ_MHZ = 915.0
CS = digitalio.DigitalInOut(board.D5)
RESET = digitalio.DigitalInOut(board.D6)
LED = digitalio.DigitalInOut(board.D13)
LED.direction = digitalio.Direction.OUTPUT
spi = busio.SPI(board.SCK, MOSI=board.MOSI, MISO=bo... | true | true |
f7001ef73a819ffe5a62565d38c655c3fc71664d | 13,574 | py | Python | clinical_outcome.py | MichaelAllen1966/stroke_outcome_algorithm | 99050bf4e0b19c38c8973fe10234fee4f230a172 | [
"MIT"
] | null | null | null | clinical_outcome.py | MichaelAllen1966/stroke_outcome_algorithm | 99050bf4e0b19c38c8973fe10234fee4f230a172 | [
"MIT"
] | null | null | null | clinical_outcome.py | MichaelAllen1966/stroke_outcome_algorithm | 99050bf4e0b19c38c8973fe10234fee4f230a172 | [
"MIT"
] | null | null | null | """
Class to hold clinical outcome model.
Predicts probability of good outcome of patient(s) or group(s) of patients.
Call `calculate_outcome_for_all(args)` from outside of the object
Inputs
======
All inputs take np arrays (for multiple groups of patients).
mimic: proportion of patients with stroke mimic
ich: pro... | 33.516049 | 80 | 0.627229 |
import numpy as np
import pandas as pd
class Clinical_outcome:
def __init__(self):
self.name = "Clinical outcome model"
self.thrombectomy_time_no_effect = 8 * 60
self.thrombolysis_time_no_effect = 6.3 * 60
self.maximum_permitted_time_to_thrombectomy = 360
self.maximum_perm... | true | true |
f7001f284c5642d54b622cdec48cd3926702afb2 | 2,137 | py | Python | data/train/python/f7001f284c5642d54b622cdec48cd3926702afb2urls.py | harshp8l/deep-learning-lang-detection | 2a54293181c1c2b1a2b840ddee4d4d80177efb33 | [
"MIT"
] | 84 | 2017-10-25T15:49:21.000Z | 2021-11-28T21:25:54.000Z | data/train/python/f7001f284c5642d54b622cdec48cd3926702afb2urls.py | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 5 | 2015-01-05T07:31:25.000Z | 2021-01-03T00:56:57.000Z | data/train/python/f7001f284c5642d54b622cdec48cd3926702afb2urls.py | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 24 | 2017-11-22T08:31:00.000Z | 2022-03-27T01:22:31.000Z | # -*- coding: utf-8 -*-
from django.conf.urls.defaults import patterns, url
from djangopypi.feeds import ReleaseFeed
urlpatterns = patterns("djangopypi.views",
url(r'^$', "root", name="djangopypi-root"),
url(r'^packages/$','packages.index', name='djangopypi-package-index'),
url(r'^simple/$','packages.simpl... | 54.794872 | 88 | 0.595227 |
from django.conf.urls.defaults import patterns, url
from djangopypi.feeds import ReleaseFeed
urlpatterns = patterns("djangopypi.views",
url(r'^$', "root", name="djangopypi-root"),
url(r'^packages/$','packages.index', name='djangopypi-package-index'),
url(r'^simple/$','packages.simple_index', name='djangop... | true | true |
f7001f45079e3103298a8ceb0386c7b776820464 | 129,647 | py | Python | examples/earnings_surprises/earnings-converter.py | brettelliot/event-study | cffc6a80dbc4b33e68e863488428996af51cc991 | [
"MIT"
] | 2 | 2019-10-20T15:53:20.000Z | 2020-05-30T22:17:20.000Z | examples/earnings_surprises/earnings-converter.py | brettelliot/event-study | cffc6a80dbc4b33e68e863488428996af51cc991 | [
"MIT"
] | 2 | 2021-03-31T18:50:01.000Z | 2021-06-01T22:11:55.000Z | examples/earnings_surprises/earnings-converter.py | brettelliot/event-study | cffc6a80dbc4b33e68e863488428996af51cc991 | [
"MIT"
] | 1 | 2021-07-18T05:22:45.000Z | 2021-07-18T05:22:45.000Z | import pandas as pd
from pandas.compat import StringIO
import numpy
numpy.set_printoptions(threshold=numpy.nan)
def main():
df = pd.read_csv(StringIO(earnings), sep=",", header=None,
names=['symbol', 'exchange', 'eps_pct_diff_surp', 'asof_date'])
df = df.sort_values(by=['asof_date'])
... | 5,185.88 | 128,925 | 0.544826 | import pandas as pd
from pandas.compat import StringIO
import numpy
numpy.set_printoptions(threshold=numpy.nan)
def main():
df = pd.read_csv(StringIO(earnings), sep=",", header=None,
names=['symbol', 'exchange', 'eps_pct_diff_surp', 'asof_date'])
df = df.sort_values(by=['asof_date'])
... | true | true |
f7001f50544c64f723e9cc46eb3ac8d4d5544cb0 | 10,958 | py | Python | neutron/tests/unit/services/metering/agents/test_metering_agent.py | acdc-cloud/neutron | 2510836886555179f9e9e39b1fdbf94296befc51 | [
"Apache-2.0"
] | null | null | null | neutron/tests/unit/services/metering/agents/test_metering_agent.py | acdc-cloud/neutron | 2510836886555179f9e9e39b1fdbf94296befc51 | [
"Apache-2.0"
] | null | null | null | neutron/tests/unit/services/metering/agents/test_metering_agent.py | acdc-cloud/neutron | 2510836886555179f9e9e39b1fdbf94296befc51 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2013 eNovance SAS <licensing@enovance.com>
#
# 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 applicabl... | 40.435424 | 79 | 0.62484 |
import mock
from oslo_config import cfg
from oslo_utils import fixture as utils_fixture
from oslo_utils import timeutils
from oslo_utils import uuidutils
from neutron.conf.services import metering_agent as metering_agent_config
from neutron.services.metering.agents import metering_agent
from neutron.test... | true | true |
f7001f655f7daed3946ab54e83b3f126b421761b | 825 | py | Python | commands/utils.py | j4p/JeBB | 2bc1915170ad99e95f383733909aa47d00496ecd | [
"MIT"
] | 7 | 2019-02-25T05:56:09.000Z | 2020-07-29T03:18:30.000Z | commands/utils.py | winbotscript/JeBB | 63cab9259fe22a10d91bf20e277a83b49ae8ab4f | [
"MIT"
] | 1 | 2020-12-17T09:46:04.000Z | 2020-12-17T09:46:04.000Z | commands/utils.py | winbotscript/JeBB | 63cab9259fe22a10d91bf20e277a83b49ae8ab4f | [
"MIT"
] | 7 | 2018-04-06T14:56:47.000Z | 2020-06-15T15:15:10.000Z | from PIL import ImageChops, Image as PILImage
from http.client import HTTPConnection
from time import sleep
from traceback import format_stack, print_exc
def Tint(image, color):
return ImageChops.blend(image, PILImage.new('RGB', image.size, color), 0.36)
def GetStatusCode(host, path="/"):
""" This function r... | 31.730769 | 80 | 0.675152 | from PIL import ImageChops, Image as PILImage
from http.client import HTTPConnection
from time import sleep
from traceback import format_stack, print_exc
def Tint(image, color):
return ImageChops.blend(image, PILImage.new('RGB', image.size, color), 0.36)
def GetStatusCode(host, path="/"):
try:
conn =... | true | true |
f7002044d0369ad65533164d260b2c8f91cb7841 | 22,513 | py | Python | zipline/data/history_loader.py | SJCosgrove/quantoipian | 70f8d14778a16f771d8c2ee196a5dba0788e920a | [
"Apache-2.0"
] | 412 | 2017-04-30T14:35:47.000Z | 2022-03-29T02:58:33.000Z | zipline/data/history_loader.py | waijay1992/zipline | 8beba055aa4211dc2debc5c3083077cbd19d0bbc | [
"Apache-2.0"
] | 116 | 2017-05-15T04:45:45.000Z | 2020-05-30T19:09:00.000Z | zipline/data/history_loader.py | waijay1992/zipline | 8beba055aa4211dc2debc5c3083077cbd19d0bbc | [
"Apache-2.0"
] | 80 | 2017-05-03T13:17:33.000Z | 2021-02-08T15:42:09.000Z | # Copyright 2016 Quantopian, Inc.
#
# 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 writ... | 37.647157 | 79 | 0.550171 |
from abc import (
ABCMeta,
abstractmethod,
abstractproperty,
)
from numpy import concatenate
from lru import LRU
from pandas import isnull
from pandas.tslib import normalize_date
from toolz import sliding_window
from six import with_metaclass
from zipline.assets import Equity, Future
from z... | true | true |
f7002061c7f0f3fa019227cac800feb6c0e23672 | 1,398 | py | Python | tescolabsapi.py | moreati/tescolabsAPI | bf4d8f863373032b1d76672793261a72c095e332 | [
"Apache-2.0"
] | 3 | 2016-02-09T23:01:42.000Z | 2020-04-27T15:56:17.000Z | tescolabsapi.py | moreati/tescolabsapi | bf4d8f863373032b1d76672793261a72c095e332 | [
"Apache-2.0"
] | null | null | null | tescolabsapi.py | moreati/tescolabsapi | bf4d8f863373032b1d76672793261a72c095e332 | [
"Apache-2.0"
] | null | null | null | import requests
API_URL = 'https://secure.techfortesco.com/tescolabsapi/restservice.aspx'
class TescoLabsApi(object):
def __init__(self, url, developerkey, applicationkey):
self.url = url
self.developerkey = developerkey
self.applicationkey = applicationkey
res = requests.get(self... | 36.789474 | 74 | 0.600858 | import requests
API_URL = 'https://secure.techfortesco.com/tescolabsapi/restservice.aspx'
class TescoLabsApi(object):
def __init__(self, url, developerkey, applicationkey):
self.url = url
self.developerkey = developerkey
self.applicationkey = applicationkey
res = requests.get(self... | true | true |
f70020b4615ef66843d3d64a999da443cca1e88c | 418 | py | Python | catalog/migrations/0003_item_tags.py | yeezy-na-izi/YlDjango | 6fd0763183d76e4f7ca4a9686170d0665d7c04e9 | [
"MIT"
] | 6 | 2022-03-06T10:43:06.000Z | 2022-03-24T13:00:12.000Z | catalog/migrations/0003_item_tags.py | yeezy-na-izi/YlDjango | 6fd0763183d76e4f7ca4a9686170d0665d7c04e9 | [
"MIT"
] | 6 | 2022-03-09T13:22:41.000Z | 2022-03-25T09:21:37.000Z | catalog/migrations/0003_item_tags.py | yeezy-na-izi/YlDjango | 6fd0763183d76e4f7ca4a9686170d0665d7c04e9 | [
"MIT"
] | null | null | null | # Generated by Django 3.2.12 on 2022-03-21 09:04
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('catalog', '0002_tag'),
]
operations = [
migrations.AddField(
model_name='item',
name='tags',
field=mode... | 22 | 102 | 0.598086 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('catalog', '0002_tag'),
]
operations = [
migrations.AddField(
model_name='item',
name='tags',
field=models.ManyToManyField(related_name='items', to='cat... | true | true |
f70020de9b544bc4917fa95a981799188beb21b9 | 7,205 | py | Python | airflow/task/task_runner/base_task_runner.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 2 | 2021-07-30T16:57:37.000Z | 2021-08-03T13:51:47.000Z | airflow/task/task_runner/base_task_runner.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | null | null | null | airflow/task/task_runner/base_task_runner.py | ChaseKnowlden/airflow | 6b71eac1997a7c0db3b8e3aed6b4e65d01871440 | [
"Apache-2.0"
] | 1 | 2020-10-01T08:48:37.000Z | 2020-10-01T08:48:37.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... | 37.526042 | 92 | 0.632061 |
import os
import subprocess
import threading
from pwd import getpwnam
from tempfile import NamedTemporaryFile
from typing import Optional, Union
from airflow.configuration import conf
from airflow.exceptions import AirflowConfigException
from airflow.models.taskinstance import load_error_file
from air... | true | true |
f700212351b1109f477cd1595558da0f8a296141 | 2,130 | py | Python | string_2/end_other.py | nhutnamhcmus/coding-bat-solutions | 5f780a4027a6c3523a72961db1bad547c997fdc6 | [
"MIT"
] | 1 | 2020-09-19T18:02:13.000Z | 2020-09-19T18:02:13.000Z | string_2/end_other.py | nhutnamhcmus/coding-bat-solutions | 5f780a4027a6c3523a72961db1bad547c997fdc6 | [
"MIT"
] | null | null | null | string_2/end_other.py | nhutnamhcmus/coding-bat-solutions | 5f780a4027a6c3523a72961db1bad547c997fdc6 | [
"MIT"
] | null | null | null | # =======================================================================================================================================
# VNU-HCM, University of Science
# Department Computer Science, Faculty of Information Technology
# Authors: Nhut-Nam Le (Tich Phan Suy Rong)
# © 2020
import unittest
"""
Given tw... | 29.178082 | 263 | 0.606103 |
import unittest
def end_other(a, b):
a = a.lower()
b = b.lower()
return (b[(len(b) - len(a)):] == a, a[(len(a) - len(b)):] == b)[len(a) >= len(b)]
class TestEndOther(unittest.TestCase):
def test_case_00(self):
self.assertEqual(end_other('Hiabc', 'abc'), True)
def test_case_01(se... | true | true |
f70021b57f240a3d1691e8e411a6514c4b90cc8a | 1,760 | py | Python | pyglet/text/formats/__init__.py | bitcraft/pyglet | 144257c365ca85528c6a4c5bed8141e683d7a9b6 | [
"BSD-3-Clause"
] | 15 | 2015-01-21T12:29:01.000Z | 2018-12-09T09:17:33.000Z | pyglet/text/formats/__init__.py | bitcraft/pyglet | 144257c365ca85528c6a4c5bed8141e683d7a9b6 | [
"BSD-3-Clause"
] | null | null | null | pyglet/text/formats/__init__.py | bitcraft/pyglet | 144257c365ca85528c6a4c5bed8141e683d7a9b6 | [
"BSD-3-Clause"
] | 9 | 2015-12-12T09:12:46.000Z | 2021-12-26T13:29:14.000Z | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistributi... | 46.315789 | 78 | 0.701136 | true | true | |
f70021d9c1eb3a4cd124e04b0ba9fd752601517e | 793 | py | Python | config.py | WILLGENIUS15/car_blog | 343eb87ed560ac8dc4200b33933f14ab40121e29 | [
"Unlicense"
] | null | null | null | config.py | WILLGENIUS15/car_blog | 343eb87ed560ac8dc4200b33933f14ab40121e29 | [
"Unlicense"
] | null | null | null | config.py | WILLGENIUS15/car_blog | 343eb87ed560ac8dc4200b33933f14ab40121e29 | [
"Unlicense"
] | null | null | null | import os
from dotenv import load_dotenv
load_dotenv()
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY')
SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://fidel:fidel@localhost/blog'
UPLOADED_PHOTOS_DEST = 'app/static/photos'
QUOTES_URL = 'http://quotes.stormconsultancy.co.uk/random.json'
MAIL... | 28.321429 | 81 | 0.737705 | import os
from dotenv import load_dotenv
load_dotenv()
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY')
SQLALCHEMY_DATABASE_URI = 'postgresql+psycopg2://fidel:fidel@localhost/blog'
UPLOADED_PHOTOS_DEST = 'app/static/photos'
QUOTES_URL = 'http://quotes.stormconsultancy.co.uk/random.json'
MAIL... | true | true |
f7002200d716bdb40628ec755274e51d50f19425 | 1,328 | bzl | Python | third_party/tensorflow/tensorflow_configure.bzl | waveflow-team/waveflow | b540a6c670e29071118ba773c26c2e2bd3839ecb | [
"Apache-2.0"
] | 11 | 2018-03-20T16:06:35.000Z | 2020-12-09T12:21:34.000Z | third_party/tensorflow/tensorflow_configure.bzl | kelu124/waveflow | b540a6c670e29071118ba773c26c2e2bd3839ecb | [
"Apache-2.0"
] | 4 | 2018-04-16T13:09:17.000Z | 2018-05-21T06:12:07.000Z | third_party/tensorflow/tensorflow_configure.bzl | kelu124/waveflow | b540a6c670e29071118ba773c26c2e2bd3839ecb | [
"Apache-2.0"
] | 4 | 2018-11-28T20:49:18.000Z | 2021-08-10T07:30:50.000Z | _TF_INCLUDE_PATH = "TF_INCLUDE_PATH"
_TF_LIB_PATH = "TF_LIB_PATH"
def _get_env_var_with_default(repository_ctx, env_var):
"""Returns evironment variable value."""
if env_var in repository_ctx.os.environ:
value = repository_ctx.os.environ[env_var]
return value
else:
fail("Environment variable '%s' was... | 33.2 | 86 | 0.76506 | _TF_INCLUDE_PATH = "TF_INCLUDE_PATH"
_TF_LIB_PATH = "TF_LIB_PATH"
def _get_env_var_with_default(repository_ctx, env_var):
if env_var in repository_ctx.os.environ:
value = repository_ctx.os.environ[env_var]
return value
else:
fail("Environment variable '%s' was not set." % env_var)
def _get_tf_conf(rep... | true | true |
f700222e7f53b12d78b2c42bfd61c27c28fd2f7e | 326 | py | Python | class3/exercises/yaml_ex5.py | ksannedhi/pyplus_course | fc3499f2dfef472dc49fe6caddf2e6e2be160f4b | [
"Apache-2.0"
] | 39 | 2019-03-03T18:16:55.000Z | 2022-02-17T17:05:18.000Z | class3/exercises/yaml_ex5.py | ksannedhi/pyplus_course | fc3499f2dfef472dc49fe6caddf2e6e2be160f4b | [
"Apache-2.0"
] | 1 | 2020-06-17T22:39:28.000Z | 2020-06-17T22:39:28.000Z | class3/exercises/yaml_ex5.py | ksannedhi/pyplus_course | fc3499f2dfef472dc49fe6caddf2e6e2be160f4b | [
"Apache-2.0"
] | 77 | 2019-01-25T10:41:23.000Z | 2022-03-14T21:35:59.000Z | import yaml
from os import path
from netmiko import ConnectHandler
home_dir = path.expanduser("~")
filename = path.join(home_dir, ".netmiko.yml")
with open(filename) as f:
yaml_out = yaml.safe_load(f)
cisco3 = yaml_out["cisco3"]
net_connect = ConnectHandler(**cisco3)
print()
print(net_connect.find_prompt())
pr... | 18.111111 | 46 | 0.742331 | import yaml
from os import path
from netmiko import ConnectHandler
home_dir = path.expanduser("~")
filename = path.join(home_dir, ".netmiko.yml")
with open(filename) as f:
yaml_out = yaml.safe_load(f)
cisco3 = yaml_out["cisco3"]
net_connect = ConnectHandler(**cisco3)
print()
print(net_connect.find_prompt())
pr... | true | true |
f7002370a443669d856313ff04fd39f77597e80e | 30 | py | Python | active_directory2/__init__.py | tjguk/active_directory2 | 0338ea9ea168fd37869689c108fe08f716408c95 | [
"MIT"
] | 2 | 2016-05-30T14:15:42.000Z | 2021-05-15T03:26:22.000Z | active_directory2/__init__.py | tjguk/active_directory2 | 0338ea9ea168fd37869689c108fe08f716408c95 | [
"MIT"
] | null | null | null | active_directory2/__init__.py | tjguk/active_directory2 | 0338ea9ea168fd37869689c108fe08f716408c95 | [
"MIT"
] | null | null | null | # -*- coding: iso-8859-1 -*-
| 15 | 29 | 0.466667 | true | true | |
f70023ec2bdd19efb694e6452ef3524c3321b6c3 | 683 | py | Python | QcloudApi/modules/trade.py | snowxmas/tencentcloud-sdk-python | fb527dcfc6b52a210e79d581f85cb8cde1ea9c85 | [
"Apache-2.0"
] | 465 | 2018-04-27T09:54:59.000Z | 2022-03-29T02:18:01.000Z | QcloudApi/modules/trade.py | snowxmas/tencentcloud-sdk-python | fb527dcfc6b52a210e79d581f85cb8cde1ea9c85 | [
"Apache-2.0"
] | 91 | 2018-04-27T09:48:11.000Z | 2022-03-12T08:04:04.000Z | QcloudApi/modules/trade.py | snowxmas/tencentcloud-sdk-python | fb527dcfc6b52a210e79d581f85cb8cde1ea9c85 | [
"Apache-2.0"
] | 232 | 2018-05-02T08:02:46.000Z | 2022-03-30T08:02:48.000Z | # Copyright 1999-2017 Tencent Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 34.15 | 74 | 0.759883 |
from QcloudApi.modules import base
class Trade(base.Base):
requestHost = 'trade.api.qcloud.com'
| true | true |
f70024c3adadb6d6e062f9fabbda77d016fda559 | 9,099 | py | Python | custom_components/ics_calendar/calendar.py | franc6/ics_calendar | 8bfd05d9d06b80acabb075531f3b62f75668cd64 | [
"Apache-2.0"
] | 29 | 2019-08-21T08:46:34.000Z | 2022-03-10T07:17:32.000Z | custom_components/ics_calendar/calendar.py | franc6/ics_calendar | 8bfd05d9d06b80acabb075531f3b62f75668cd64 | [
"Apache-2.0"
] | 46 | 2019-08-21T11:12:20.000Z | 2022-03-31T12:29:54.000Z | custom_components/ics_calendar/calendar.py | franc6/ics_calendar | 8bfd05d9d06b80acabb075531f3b62f75668cd64 | [
"Apache-2.0"
] | 10 | 2019-08-21T08:47:52.000Z | 2021-07-03T16:56:29.000Z | """Support for ICS Calendar."""
import copy
import logging
from datetime import datetime, timedelta
from urllib.error import ContentTooShortError, HTTPError, URLError
from urllib.request import (
HTTPPasswordMgrWithDefaultRealm,
HTTPBasicAuthHandler,
HTTPDigestAuthHandler,
build_opener,
install_open... | 36.396 | 102 | 0.621057 | import copy
import logging
from datetime import datetime, timedelta
from urllib.error import ContentTooShortError, HTTPError, URLError
from urllib.request import (
HTTPPasswordMgrWithDefaultRealm,
HTTPBasicAuthHandler,
HTTPDigestAuthHandler,
build_opener,
install_opener,
urlopen,
)
import volup... | true | true |
f70024e5f14d8c48a9b1684bda03d5b19a8c5e49 | 16,642 | py | Python | model_zoo/official/cv/ssd/src/dataset.py | taroxd/mindspore | 9bb620ff2caaac7f1c53c4b104935f22352cb88f | [
"Apache-2.0"
] | null | null | null | model_zoo/official/cv/ssd/src/dataset.py | taroxd/mindspore | 9bb620ff2caaac7f1c53c4b104935f22352cb88f | [
"Apache-2.0"
] | null | null | null | model_zoo/official/cv/ssd/src/dataset.py | taroxd/mindspore | 9bb620ff2caaac7f1c53c4b104935f22352cb88f | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 36.575824 | 112 | 0.606057 |
from __future__ import division
import os
import json
import xml.etree.ElementTree as et
import numpy as np
import cv2
import mindspore.dataset as de
import mindspore.dataset.vision.c_transforms as C
from mindspore.mindrecord import FileWriter
from .config import config
from .box_utils import jaccard_... | true | true |
f700254d4ce5eeb6f200af51a86f0d35375b2d2f | 224,141 | py | Python | python/ccxt/binance.py | Cff01/ccxt | be2352a8b166c77a79ae40311975426f0ef4f984 | [
"MIT"
] | 1 | 2021-12-10T16:04:56.000Z | 2021-12-10T16:04:56.000Z | python/ccxt/binance.py | Cff01/ccxt | be2352a8b166c77a79ae40311975426f0ef4f984 | [
"MIT"
] | null | null | null | python/ccxt/binance.py | Cff01/ccxt | be2352a8b166c77a79ae40311975426f0ef4f984 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.base.exchange import Exchange
import json
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationE... | 48.316663 | 10,000 | 0.490834 |
ge import Exchange
import json
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import PermissionDenied
from ccxt.base.errors import AccountSuspended
from ccxt.base.errors import ArgumentsRequired
from ccxt.base.errors import BadRequest
from ccxt.base.... | true | true |
f700255c2c2445ca4d7fc8529c35e511ce7c0578 | 579 | py | Python | blender/arm/logicnode/transform/LN_set_object_transform.py | Lykdraft/armory | da1cf33930ce9a8b1865d35c128fe4842bef2933 | [
"Zlib"
] | null | null | null | blender/arm/logicnode/transform/LN_set_object_transform.py | Lykdraft/armory | da1cf33930ce9a8b1865d35c128fe4842bef2933 | [
"Zlib"
] | null | null | null | blender/arm/logicnode/transform/LN_set_object_transform.py | Lykdraft/armory | da1cf33930ce9a8b1865d35c128fe4842bef2933 | [
"Zlib"
] | null | null | null | from arm.logicnode.arm_nodes import *
class SetTransformNode(ArmLogicTreeNode):
"""Use to set the transform of an object."""
bl_idname = 'LNSetTransformNode'
bl_label = 'Set Object Transform'
arm_version = 1
def init(self, context):
super(SetTransformNode, self).init(context)
self.... | 34.058824 | 55 | 0.708117 | from arm.logicnode.arm_nodes import *
class SetTransformNode(ArmLogicTreeNode):
bl_idname = 'LNSetTransformNode'
bl_label = 'Set Object Transform'
arm_version = 1
def init(self, context):
super(SetTransformNode, self).init(context)
self.add_input('ArmNodeSocketAction', 'In')
se... | true | true |
f70026be89262dcabc1e78f9a1ffaa22cafad438 | 2,272 | py | Python | setup.py | tekktrik/CircuitPython_Org_DisplayIO_Cartesian | cef9af2765aa8cdfc8b6434e4ed29e4e040c003e | [
"MIT"
] | null | null | null | setup.py | tekktrik/CircuitPython_Org_DisplayIO_Cartesian | cef9af2765aa8cdfc8b6434e4ed29e4e040c003e | [
"MIT"
] | 2 | 2022-02-18T19:12:08.000Z | 2022-03-12T19:14:48.000Z | setup.py | tekktrik/CircuitPython_Org_DisplayIO_Cartesian | cef9af2765aa8cdfc8b6434e4ed29e4e040c003e | [
"MIT"
] | 3 | 2021-05-26T10:57:13.000Z | 2022-02-18T17:08:12.000Z | # SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
# SPDX-FileCopyrightText: Copyright (c) 2021 Jose David M. for circuitpython
#
# SPDX-License-Identifier: MIT
"""A setuptools based setup module.
See:
https://packaging.python.org/en/latest/distributing.html
https://github.com/pypa/sample... | 34.953846 | 94 | 0.695423 |
from setuptools import setup, find_packages
from codecs import open
from os import path
here = path.abspath(path.dirname(__file__))
with open(path.join(here, "README.rst"), encoding="utf-8") as f:
long_description = f.read()
setup(
name="circuitpython-displayio-cartesian",
use_scm_version=T... | true | true |
f7002809c326a21adb3489f8362fe6d0df39aa6a | 2,482 | py | Python | ssmpfwd/test/test_helpers.py | grizmin/ssm-port-forwarding | 5894e906049f206aeca58320cd9bd02f5a2b6e7f | [
"MIT"
] | 1 | 2021-08-05T06:45:17.000Z | 2021-08-05T06:45:17.000Z | ssmpfwd/test/test_helpers.py | grizmin/ssm-port-forwarding | 5894e906049f206aeca58320cd9bd02f5a2b6e7f | [
"MIT"
] | null | null | null | ssmpfwd/test/test_helpers.py | grizmin/ssm-port-forwarding | 5894e906049f206aeca58320cd9bd02f5a2b6e7f | [
"MIT"
] | null | null | null | from ssmpfwd.helpers import verify_plugin_version, verbose_debug_quiet, time_decorator
from unittest.mock import MagicMock, patch
import unittest
class TestVerifyPluginVersion(unittest.TestCase):
@patch("ssmpfwd.helpers.subprocess")
def test_verify_plugin_version_success(self, mock_subprocess):
... | 38.78125 | 150 | 0.670427 | from ssmpfwd.helpers import verify_plugin_version, verbose_debug_quiet, time_decorator
from unittest.mock import MagicMock, patch
import unittest
class TestVerifyPluginVersion(unittest.TestCase):
@patch("ssmpfwd.helpers.subprocess")
def test_verify_plugin_version_success(self, mock_subprocess):
... | true | true |
f70028f9fa4d86978ac4bf40e069c11a32974d6b | 5,221 | py | Python | x2.ESR/ESRB.py | doronbehar/lab4 | 90af5a8fd562ba6a35b6ba90611122573e7de485 | [
"MIT"
] | null | null | null | x2.ESR/ESRB.py | doronbehar/lab4 | 90af5a8fd562ba6a35b6ba90611122573e7de485 | [
"MIT"
] | null | null | null | x2.ESR/ESRB.py | doronbehar/lab4 | 90af5a8fd562ba6a35b6ba90611122573e7de485 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import pint
# Use the same registry
from main import ureg
ureg.setup_matplotlib(True)
from uncertainties import ufloat, umath, unumpy
import pandas as pd
from scipy.signal import find_peaks
from scipy.integrate import simpson
from scipy.optimize import curve_fit
plt.rc... | 30.532164 | 82 | 0.684735 | import numpy as np
import matplotlib.pyplot as plt
import pint
from main import ureg
ureg.setup_matplotlib(True)
from uncertainties import ufloat, umath, unumpy
import pandas as pd
from scipy.signal import find_peaks
from scipy.integrate import simpson
from scipy.optimize import curve_fit
plt.rcParams['text.usetex'] =... | true | true |
f70029a1b9d5fe7dd248a9f3e0e32a8709368d7c | 315 | py | Python | receive_sms.py | jatinchowdhury18/DogBot | 8f0487c68a203f518d5b110107acda227aa6f112 | [
"MIT"
] | null | null | null | receive_sms.py | jatinchowdhury18/DogBot | 8f0487c68a203f518d5b110107acda227aa6f112 | [
"MIT"
] | null | null | null | receive_sms.py | jatinchowdhury18/DogBot | 8f0487c68a203f518d5b110107acda227aa6f112 | [
"MIT"
] | null | null | null | from flask import Flask, request, redirect
from twilio.twiml.messaging_response import MessagingResponse
from get_secrets import *
def main():
resp = MessagingResponse()
resp.message ("You have reached the DogBot. Thanks for contacting us :)")
return str(resp)
if __name__ == "__main__":
main()
| 22.5 | 77 | 0.730159 | from flask import Flask, request, redirect
from twilio.twiml.messaging_response import MessagingResponse
from get_secrets import *
def main():
resp = MessagingResponse()
resp.message ("You have reached the DogBot. Thanks for contacting us :)")
return str(resp)
if __name__ == "__main__":
main()
| true | true |
f7002a41f654a061211357f2e1d7380fd76aa69c | 4,738 | py | Python | src/aioyhsm/constants.py | joernheissler/aioyhsm | 598837034ec1d094a4bb544d018cc79036d55dd3 | [
"MIT"
] | null | null | null | src/aioyhsm/constants.py | joernheissler/aioyhsm | 598837034ec1d094a4bb544d018cc79036d55dd3 | [
"MIT"
] | null | null | null | src/aioyhsm/constants.py | joernheissler/aioyhsm | 598837034ec1d094a4bb544d018cc79036d55dd3 | [
"MIT"
] | null | null | null | from __future__ import annotations
from enum import IntEnum
class Algorithm(IntEnum):
"""
https://developers.yubico.com/YubiHSM2/Concepts/Algorithms.html
"""
RSA_PKCS1_SHA1 = 1
RSA_PKCS1_SHA256 = 2
RSA_PKCS1_SHA384 = 3
RSA_PKCS1_SHA512 = 4
RSA_PSS_SHA1 = 5
RSA_PSS_SHA256 = 6
... | 21.733945 | 67 | 0.659772 | from __future__ import annotations
from enum import IntEnum
class Algorithm(IntEnum):
RSA_PKCS1_SHA1 = 1
RSA_PKCS1_SHA256 = 2
RSA_PKCS1_SHA384 = 3
RSA_PKCS1_SHA512 = 4
RSA_PSS_SHA1 = 5
RSA_PSS_SHA256 = 6
RSA_PSS_SHA384 = 7
RSA_PSS_SHA512 = 8
RSA_2048 = 9
RSA_3072 = 10
RSA... | true | true |
f7002af16052213b7cd652135616cee9b3b5d62d | 13,675 | py | Python | panel/tests/test_reactive.py | govinda18/panel | d2b70d9a0a4433d427c627e70328d0bc8621d78b | [
"BSD-3-Clause"
] | 2 | 2018-08-23T16:50:40.000Z | 2018-08-23T20:01:45.000Z | panel/tests/test_reactive.py | pyviz/pyviz_panels | 120019e4318ac51bc2b9d0a1b2eb2239c8a0c9ad | [
"BSD-3-Clause"
] | null | null | null | panel/tests/test_reactive.py | pyviz/pyviz_panels | 120019e4318ac51bc2b9d0a1b2eb2239c8a0c9ad | [
"BSD-3-Clause"
] | null | null | null | import unittest.mock
from functools import partial
import bokeh.core.properties as bp
import param
import pytest
from bokeh.document import Document
from bokeh.io.doc import patch_curdoc
from bokeh.models import Div
from panel.layout import Tabs, WidgetBox
from panel.reactive import Reactive, ReactiveHTML
from pane... | 28.312629 | 121 | 0.631079 | import unittest.mock
from functools import partial
import bokeh.core.properties as bp
import param
import pytest
from bokeh.document import Document
from bokeh.io.doc import patch_curdoc
from bokeh.models import Div
from panel.layout import Tabs, WidgetBox
from panel.reactive import Reactive, ReactiveHTML
from pane... | true | true |
f7002b2400bc2b06679586a2df52f97e215dcc65 | 4,748 | py | Python | mhr_api/src/mhr_api/models/event_tracking.py | cameron-freshworks/ppr | 01d6f5d300c791aebad5e58bb4601e9be2ccfc46 | [
"Apache-2.0"
] | null | null | null | mhr_api/src/mhr_api/models/event_tracking.py | cameron-freshworks/ppr | 01d6f5d300c791aebad5e58bb4601e9be2ccfc46 | [
"Apache-2.0"
] | null | null | null | mhr_api/src/mhr_api/models/event_tracking.py | cameron-freshworks/ppr | 01d6f5d300c791aebad5e58bb4601e9be2ccfc46 | [
"Apache-2.0"
] | null | null | null | # Copyright © 2019 Province of British Columbia
#
# 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 agr... | 40.237288 | 117 | 0.64385 |
from __future__ import annotations
from mhr_api.models import utils as model_utils
from mhr_api.utils.base import BaseEnum
from .db import db
class EventTracking(db.Model):
class EventTrackingTypes(BaseEnum):
SEARCH_REPORT = 'SEARCH_REPORT'
API_NOTIFICATION = 'API_NOTIFICATION'
... | true | true |
f7002c90467435a91e99ee2aae11e1a594ffba14 | 36,375 | py | Python | hydrus/test/TestHydrusSerialisable.py | baibhavvishalpani/hydrus | 1117ebbde9e5d5ec17e469dba6bd8086838cfb89 | [
"WTFPL"
] | null | null | null | hydrus/test/TestHydrusSerialisable.py | baibhavvishalpani/hydrus | 1117ebbde9e5d5ec17e469dba6bd8086838cfb89 | [
"WTFPL"
] | null | null | null | hydrus/test/TestHydrusSerialisable.py | baibhavvishalpani/hydrus | 1117ebbde9e5d5ec17e469dba6bd8086838cfb89 | [
"WTFPL"
] | null | null | null | import unittest
from hydrus.core import HydrusConstants as HC
from hydrus.core import HydrusData
from hydrus.core import HydrusSerialisable
from hydrus.client import ClientApplicationCommand as CAC
from hydrus.client import ClientConstants as CC
from hydrus.client import ClientData
from hydrus.client import ClientDef... | 51.01683 | 576 | 0.674639 | import unittest
from hydrus.core import HydrusConstants as HC
from hydrus.core import HydrusData
from hydrus.core import HydrusSerialisable
from hydrus.client import ClientApplicationCommand as CAC
from hydrus.client import ClientConstants as CC
from hydrus.client import ClientData
from hydrus.client import ClientDef... | true | true |
f7002cf455ba55020c201c52fcb49a79f2741227 | 1,567 | py | Python | src/plugins/sign/req.py | inuEbisu/inuBot | 70bc139100a49983418a9fd7709f2f4899f0c6ea | [
"MIT"
] | null | null | null | src/plugins/sign/req.py | inuEbisu/inuBot | 70bc139100a49983418a9fd7709f2f4899f0c6ea | [
"MIT"
] | null | null | null | src/plugins/sign/req.py | inuEbisu/inuBot | 70bc139100a49983418a9fd7709f2f4899f0c6ea | [
"MIT"
] | null | null | null | import requests
import json
import time
import random
from . import conf, data, lang
from inukit.timestamp import natural_date, natural_time, timestamp_now
def is_same_day(ts1, ts2) -> bool:
def d(ts):
return natural_date(ts, '%Y-%m-%d')
return d(ts1) == d(ts2)
def handle_morning(qq):
last_morning... | 25.688525 | 70 | 0.603701 | import requests
import json
import time
import random
from . import conf, data, lang
from inukit.timestamp import natural_date, natural_time, timestamp_now
def is_same_day(ts1, ts2) -> bool:
def d(ts):
return natural_date(ts, '%Y-%m-%d')
return d(ts1) == d(ts2)
def handle_morning(qq):
last_morning... | true | true |
f7002cfaaf2541347b111dee46c214adbb5b841c | 3,413 | py | Python | app/app/settings.py | hrusfandi/recipe-app-api | 342ec9c30dc327218476a48ce4b65ba042dfe42b | [
"MIT"
] | null | null | null | app/app/settings.py | hrusfandi/recipe-app-api | 342ec9c30dc327218476a48ce4b65ba042dfe42b | [
"MIT"
] | null | null | null | app/app/settings.py | hrusfandi/recipe-app-api | 342ec9c30dc327218476a48ce4b65ba042dfe42b | [
"MIT"
] | null | null | null | """
Django settings for app project.
Generated by 'django-admin startproject' using Django 2.1.15.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
# Bu... | 25.281481 | 91 | 0.685028 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = 'lxb!(o00)qtw0p+6q_vs$01&wtsw(m*s!ol0_6^v*flo^!&ek&'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
f7002dc942023defc41282a811fecb1719c2a9bf | 25,241 | py | Python | tests/blackbox/scopes/test_bb_scopes_updates.py | airencracken/waflz | 00eef42258dd98d0cbc71102061e4951f456803f | [
"Apache-2.0"
] | null | null | null | tests/blackbox/scopes/test_bb_scopes_updates.py | airencracken/waflz | 00eef42258dd98d0cbc71102061e4951f456803f | [
"Apache-2.0"
] | null | null | null | tests/blackbox/scopes/test_bb_scopes_updates.py | airencracken/waflz | 00eef42258dd98d0cbc71102061e4951f456803f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
'''Test config updates '''
# ------------------------------------------------------------------------------
# Imports
# ------------------------------------------------------------------------------
import subprocess
import os
import json
import time
import datetime
import requests
import pytest
... | 47.804924 | 127 | 0.465909 |
import subprocess
import os
import json
import time
import datetime
import requests
import pytest
G_TEST_HOST = 'http://127.0.0.1:12345'
def run_command(command):
p = subprocess.Popen(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = p.communicate()
return (p.re... | true | true |
f7002eb930b1638b61045d541b7e5cad48ca6680 | 1,408 | py | Python | python/setup.py | tohuynh/king-county | 50147256f73bd42b1967c8e9ce15cba10a08a72a | [
"MIT"
] | null | null | null | python/setup.py | tohuynh/king-county | 50147256f73bd42b1967c8e9ce15cba10a08a72a | [
"MIT"
] | 7 | 2022-01-06T04:34:59.000Z | 2022-03-10T03:48:06.000Z | python/setup.py | tohuynh/king-county | 50147256f73bd42b1967c8e9ce15cba10a08a72a | [
"MIT"
] | 1 | 2022-01-07T21:40:24.000Z | 2022-01-07T21:40:24.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
from setuptools import find_packages, setup
test_requirements = [
"black>=19.10b0",
"flake8>=3.8.3",
"flake8-debugger>=3.2.1",
]
dev_requirements = [
*test_requirements,
"wheel>=0.34.2",
]
requirements = [
"cdp-backend[pi... | 24.701754 | 71 | 0.642045 |
from setuptools import find_packages, setup
test_requirements = [
"black>=19.10b0",
"flake8>=3.8.3",
"flake8-debugger>=3.2.1",
]
dev_requirements = [
*test_requirements,
"wheel>=0.34.2",
]
requirements = [
"cdp-backend[pipeline]==3.0.2",
"cdp-scrapers[king_county]>=0.3.2",
]
extra_re... | true | true |
f7002fa28c4f96c4ce9de895ed3dc6923730e7d5 | 705 | py | Python | scrapy_proj/openrecipes/spiders/elanaspantry_feedspider.py | fictivekin/openrecipes | 82b5c080168439b328f76a115aa2011fa4601384 | [
"Apache-2.0"
] | 300 | 2015-01-05T05:37:34.000Z | 2022-03-05T16:24:37.000Z | scrapy_proj/openrecipes/spiders/elanaspantry_feedspider.py | fictivekin/openrecipes | 82b5c080168439b328f76a115aa2011fa4601384 | [
"Apache-2.0"
] | 11 | 2015-05-14T04:15:22.000Z | 2018-01-27T17:22:32.000Z | scrapy_proj/openrecipes/spiders/elanaspantry_feedspider.py | fictivekin/openrecipes | 82b5c080168439b328f76a115aa2011fa4601384 | [
"Apache-2.0"
] | 100 | 2015-01-11T23:14:29.000Z | 2022-03-25T06:03:48.000Z | from scrapy.spider import BaseSpider
from scrapy.http import Request
from scrapy.selector import XmlXPathSelector
from openrecipes.spiders.elanaspantry_spider import ElanaspantryMixin
class ElanaspantryfeedSpider(BaseSpider, ElanaspantryMixin):
name = "elanaspantry.feed"
allowed_domains = [
"www.elana... | 30.652174 | 80 | 0.695035 | from scrapy.spider import BaseSpider
from scrapy.http import Request
from scrapy.selector import XmlXPathSelector
from openrecipes.spiders.elanaspantry_spider import ElanaspantryMixin
class ElanaspantryfeedSpider(BaseSpider, ElanaspantryMixin):
name = "elanaspantry.feed"
allowed_domains = [
"www.elana... | true | true |
f70030098f7ff150f5b43cdb085cc72adcf3e29e | 3,676 | py | Python | AlyMoly/venta/models.py | CreceLibre/alymoly | 1420e305f41301b8548dfbbabfc64330b74403be | [
"MIT"
] | null | null | null | AlyMoly/venta/models.py | CreceLibre/alymoly | 1420e305f41301b8548dfbbabfc64330b74403be | [
"MIT"
] | null | null | null | AlyMoly/venta/models.py | CreceLibre/alymoly | 1420e305f41301b8548dfbbabfc64330b74403be | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#-*- encoding: UTF-8 -*-
###############################################
# Todos los derechos reservados a: #
# CreceLibre Consultores en Tecnologías Ltda. #
# #
# ©Milton Inostroza Aguilera #
# minostro@minostro.com ... | 39.526882 | 134 | 0.661045 |
monto_total = models.PositiveIntegerField()
monto_afecto = models.PositiveIntegerField()
monto_exento = models.PositiveIntegerField()
cantidad_productos = models.PositiveIntegerField()
medio_pago = models.PositiveIntegerField()
monto_pago = models.PositiveIntegerField(null=True)
turno = mo... | true | true |
f700308f76753f938a995240fe09d0f4b13796ba | 5,919 | py | Python | examples/gb1/train_oracle.py | ayushkarnawat/profit | f3c4d601078b52513af6832c3faf75ddafc59ac5 | [
"MIT"
] | null | null | null | examples/gb1/train_oracle.py | ayushkarnawat/profit | f3c4d601078b52513af6832c3faf75ddafc59ac5 | [
"MIT"
] | 1 | 2021-09-15T13:13:12.000Z | 2021-09-15T13:13:12.000Z | examples/gb1/train_oracle.py | ayushkarnawat/profit | f3c4d601078b52513af6832c3faf75ddafc59ac5 | [
"MIT"
] | null | null | null | """Train (basic) densely-connected oracle."""
import os
import time
import multiprocessing as mp
import pandas as pd
import torch
from torch import optim
from torch.utils.data import DataLoader, Subset, TensorDataset, WeightedRandomSampler
from profit.dataset.splitters import split_method_dict
from profit.models.to... | 40.265306 | 85 | 0.653151 |
import os
import time
import multiprocessing as mp
import pandas as pd
import torch
from torch import optim
from torch.utils.data import DataLoader, Subset, TensorDataset, WeightedRandomSampler
from profit.dataset.splitters import split_method_dict
from profit.models.torch import SequenceOracle
from profit.utils.da... | true | true |
f70031964499de2478621f668a6bbbbe0d067348 | 228,842 | py | Python | tests/unit/gapic/deploy_v1/test_cloud_deploy.py | LaudateCorpus1/python-deploy | aaa957f2673db673c3a8e38275d4689323ded044 | [
"Apache-2.0"
] | null | null | null | tests/unit/gapic/deploy_v1/test_cloud_deploy.py | LaudateCorpus1/python-deploy | aaa957f2673db673c3a8e38275d4689323ded044 | [
"Apache-2.0"
] | null | null | null | tests/unit/gapic/deploy_v1/test_cloud_deploy.py | LaudateCorpus1/python-deploy | aaa957f2673db673c3a8e38275d4689323ded044 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... | 39.111605 | 140 | 0.686491 |
import os
import mock
import grpc
from grpc.experimental import aio
import math
import pytest
from proto.marshal.rules.dates import DurationRule, TimestampRule
from google.api_core import client_options
from google.api_core import exceptions as core_exceptions
from google.api_core import future
from g... | true | true |
f70032a4a068d348409de058a25c94f8ceef13fd | 22,657 | py | Python | scripts/printingValidation/venv/lib/python3.9/site-packages/skimage/morphology/tests/test_max_tree.py | Air-Factories-2-0/af2-hyperledger | 7aeeb831cf03fdf7fe64f9500da17c02688a0886 | [
"Apache-2.0"
] | 5 | 2022-01-05T00:41:46.000Z | 2022-03-21T07:22:58.000Z | scripts/printingValidation/venv/lib/python3.9/site-packages/skimage/morphology/tests/test_max_tree.py | Air-Factories-2-0/af2-hyperledger | 7aeeb831cf03fdf7fe64f9500da17c02688a0886 | [
"Apache-2.0"
] | null | null | null | scripts/printingValidation/venv/lib/python3.9/site-packages/skimage/morphology/tests/test_max_tree.py | Air-Factories-2-0/af2-hyperledger | 7aeeb831cf03fdf7fe64f9500da17c02688a0886 | [
"Apache-2.0"
] | 2 | 2022-03-20T17:35:44.000Z | 2022-03-21T18:30:31.000Z | import numpy as np
from skimage.morphology import max_tree, area_closing, area_opening
from skimage.morphology import max_tree_local_maxima, diameter_opening
from skimage.morphology import diameter_closing
from skimage.util import invert
from skimage._shared.testing import assert_array_equal, TestCase
eps = 1e-12
d... | 49.905286 | 76 | 0.404378 | import numpy as np
from skimage.morphology import max_tree, area_closing, area_opening
from skimage.morphology import max_tree_local_maxima, diameter_opening
from skimage.morphology import diameter_closing
from skimage.util import invert
from skimage._shared.testing import assert_array_equal, TestCase
eps = 1e-12
d... | true | true |
f70033d1cbc2d6abea9a13563db9c1b94096e116 | 2,444 | py | Python | utils/dataset.py | Theia-4869/U-RISC | c493b11ab525b39a5ac029c3f83e059d703abaae | [
"MIT"
] | null | null | null | utils/dataset.py | Theia-4869/U-RISC | c493b11ab525b39a5ac029c3f83e059d703abaae | [
"MIT"
] | null | null | null | utils/dataset.py | Theia-4869/U-RISC | c493b11ab525b39a5ac029c3f83e059d703abaae | [
"MIT"
] | null | null | null | import logging
import os
from pathlib import Path
from typing import Any, Callable, Optional
from torch.utils.data import Dataset
from torchvision import transforms
from PIL import Image
import cv2
import numpy as np
class URISC(Dataset):
def __init__(
self,
dir: str,
mode: str = 'trai... | 34.914286 | 131 | 0.641162 | import logging
import os
from pathlib import Path
from typing import Any, Callable, Optional
from torch.utils.data import Dataset
from torchvision import transforms
from PIL import Image
import cv2
import numpy as np
class URISC(Dataset):
def __init__(
self,
dir: str,
mode: str = 'trai... | true | true |
f70034b3c3afba5a914261b55cf0abeab832391c | 1,441 | py | Python | imaginaire/losses/feature_matching.py | hw07216/imaginaire | 87c774114622e39488a5ea8a7728b1a20896afb9 | [
"RSA-MD"
] | 3,308 | 2020-07-15T17:50:13.000Z | 2022-03-31T14:53:31.000Z | imaginaire/losses/feature_matching.py | hw07216/imaginaire | 87c774114622e39488a5ea8a7728b1a20896afb9 | [
"RSA-MD"
] | 132 | 2020-09-20T17:36:28.000Z | 2022-03-28T12:40:03.000Z | src/imaginaire/losses/feature_matching.py | livingbio/imaginaire-fsvid2vid | d82c87aced50afd44fd162491ba5b59056b74034 | [
"RSA-MD"
] | 370 | 2020-09-29T00:34:08.000Z | 2022-03-30T04:12:48.000Z | # Copyright (C) 2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
#
# This work is made available under the Nvidia Source Code License-NC.
# To view a copy of this license, check out LICENSE.md
import torch.nn as nn
class FeatureMatchingLoss(nn.Module):
r"""Compute feature matching loss"""
def __ini... | 36.948718 | 80 | 0.605829 |
import torch.nn as nn
class FeatureMatchingLoss(nn.Module):
def __init__(self, criterion='l1'):
super(FeatureMatchingLoss, self).__init__()
if criterion == 'l1':
self.criterion = nn.L1Loss()
elif criterion == 'l2' or criterion == 'mse':
self.criterion = nn.MSELo... | true | true |
f70034b5d8bc1589a710450b847c2f39ab19cddb | 19,031 | py | Python | cinder/volume/drivers/datera/datera_iscsi.py | traghavendra/cinder-train | 49af592c61da3216c04f5771b8ebf0927c5ce1c8 | [
"Apache-2.0"
] | null | null | null | cinder/volume/drivers/datera/datera_iscsi.py | traghavendra/cinder-train | 49af592c61da3216c04f5771b8ebf0927c5ce1c8 | [
"Apache-2.0"
] | 28 | 2017-08-17T14:46:05.000Z | 2022-03-29T12:42:12.000Z | cinder/volume/drivers/datera/datera_iscsi.py | alokchandra11/cinder | 121d9f512b4a6d1afe6a690effb7c2b379040a7b | [
"Apache-2.0"
] | 3 | 2017-04-27T16:11:40.000Z | 2020-02-12T21:27:00.000Z | # Copyright 2017 Datera
# 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 applic... | 32.255932 | 79 | 0.561347 |
import time
import uuid
from eventlet.green import threading
from oslo_config import cfg
from oslo_log import log as logging
import six
from cinder import exception
from cinder.i18n import _
from cinder import utils
from cinder.volume import configuration
from cinder.volume.drivers.san import san
impo... | true | true |
f7003591f8a18a1fae373eb4663b223dd7a8098b | 1,466 | py | Python | tests/WriteTest.py | FlaminMad/researchProject | 309577602c0974c402a3f7c9cf1ba3e443e963b5 | [
"MIT"
] | null | null | null | tests/WriteTest.py | FlaminMad/researchProject | 309577602c0974c402a3f7c9cf1ba3e443e963b5 | [
"MIT"
] | 2 | 2018-02-12T18:34:01.000Z | 2018-02-12T18:34:33.000Z | tests/WriteTest.py | FlaminMad/researchProject | 309577602c0974c402a3f7c9cf1ba3e443e963b5 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Author: Alexander David Leech
Date: 30/09/2015
Rev: 2
Lang: Python 2.7
Deps: Pyserial, Pymodbus, logging
"""
import time # For sleep functionality
import logging # For detailed error output
from pymodbus... | 39.621622 | 84 | 0.439973 |
import time
import logging
from pymodbus.client.sync import ModbusSerialClient \
as ModbusClient
comSettings = {
"method" : 'rtu',
"port" : 'COM3',
... | true | true |
f70035b606446f284009b95a484ebb6bbfc5b6ed | 12,093 | py | Python | tests/autofix_lib_test.py | charlievieth/all-repos | 279d2910c56567d9518ab41bd8894216b9f649e5 | [
"MIT"
] | null | null | null | tests/autofix_lib_test.py | charlievieth/all-repos | 279d2910c56567d9518ab41bd8894216b9f649e5 | [
"MIT"
] | null | null | null | tests/autofix_lib_test.py | charlievieth/all-repos | 279d2910c56567d9518ab41bd8894216b9f649e5 | [
"MIT"
] | 2 | 2020-09-03T12:50:13.000Z | 2020-10-30T07:45:29.000Z | import os
import subprocess
from unittest import mock
import pytest
from pre_commit.constants import VERSION as PRE_COMMIT_VERSION
import testing.git
from all_repos import autofix_lib
from all_repos import clone
from all_repos import git
from all_repos.config import load_config
@pytest.mark.parametrize(
('cli_r... | 32.772358 | 78 | 0.644753 | import os
import subprocess
from unittest import mock
import pytest
from pre_commit.constants import VERSION as PRE_COMMIT_VERSION
import testing.git
from all_repos import autofix_lib
from all_repos import clone
from all_repos import git
from all_repos.config import load_config
@pytest.mark.parametrize(
('cli_r... | true | true |
f70035de58a42b6f7cb899e0378cdef544b4ada4 | 426 | py | Python | django_quicky/namegen/namegen.py | sametmax/django-quicky | 2a87dbdcc6db400aff5a9119533bd3784fc4afb4 | [
"Zlib"
] | 149 | 2015-01-02T19:48:47.000Z | 2022-02-18T15:43:34.000Z | django_quicky/namegen/namegen.py | keshapps/django-quicky | 2a87dbdcc6db400aff5a9119533bd3784fc4afb4 | [
"Zlib"
] | 3 | 2015-01-28T18:44:42.000Z | 2017-05-23T18:50:02.000Z | django_quicky/namegen/namegen.py | keshapps/django-quicky | 2a87dbdcc6db400aff5a9119533bd3784fc4afb4 | [
"Zlib"
] | 11 | 2015-01-05T19:22:16.000Z | 2021-01-25T13:06:20.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Generate random usernames in
"""
import random
from .names import names as default_names
class NameGenerator(object):
def __init__(self, names=None):
self.names = names or default_names
def __call__(self):
return self.names.pop(rando... | 16.384615 | 64 | 0.638498 |
import random
from .names import names as default_names
class NameGenerator(object):
def __init__(self, names=None):
self.names = names or default_names
def __call__(self):
return self.names.pop(random.randrange(len(self.names)))
def __iter__(self):
while self.names:
... | true | true |
f7003651cdfe6161aff5b98a1b8d08b57ca2b62d | 718 | py | Python | authors/utils/authentication_handlers.py | andela/ah-the-immortals-backend | d0f73bf166ad41f243cff6d82caced2f9facf2f9 | [
"BSD-3-Clause"
] | 2 | 2020-03-11T12:50:18.000Z | 2020-07-23T13:07:07.000Z | authors/utils/authentication_handlers.py | andela/ah-the-immortals-backend | d0f73bf166ad41f243cff6d82caced2f9facf2f9 | [
"BSD-3-Clause"
] | 30 | 2019-04-23T17:00:25.000Z | 2022-02-10T08:45:32.000Z | authors/utils/authentication_handlers.py | andela/ah-the-immortals-backend | d0f73bf166ad41f243cff6d82caced2f9facf2f9 | [
"BSD-3-Clause"
] | 11 | 2019-06-29T11:52:31.000Z | 2022-02-13T02:05:43.000Z | from django.utils import timezone
from rest_framework.authtoken.models import Token
class AuthTokenHandler:
"""
Handles variations in auth token
"""
@staticmethod
def expired_token(auth_token):
"""
Checks expiry of auth token
"""
utc_now = timezone.now()
exp... | 24.758621 | 63 | 0.600279 | from django.utils import timezone
from rest_framework.authtoken.models import Token
class AuthTokenHandler:
@staticmethod
def expired_token(auth_token):
utc_now = timezone.now()
expired = auth_token.created < utc_now - \
timezone.timedelta(hours=24)
return expired
@sta... | true | true |
f700365fe0ecc671437a603b7d5f3a8575dde895 | 511 | py | Python | StemLemPipe/__init__.py | PasaOpasen/Stem-Lem-Pipeline | 98f5ab7e0aa019f5403830fc3e6176d06124f365 | [
"MIT"
] | 1 | 2020-12-03T23:32:07.000Z | 2020-12-03T23:32:07.000Z | StemLemPipe/__init__.py | PasaOpasen/Stem-Lem-Pipeline | 98f5ab7e0aa019f5403830fc3e6176d06124f365 | [
"MIT"
] | null | null | null | StemLemPipe/__init__.py | PasaOpasen/Stem-Lem-Pipeline | 98f5ab7e0aa019f5403830fc3e6176d06124f365 | [
"MIT"
] | null | null | null |
from .useful_functions import get_ngrams, words_to_ngrams_list, remove_hook_words, remove_words
from .transformers import phrases_transform, phrases2lower, phrases_without_excess_symbols
from .tokenizers import text2sentences, split_by_words, sentence_split
from .stemlem_operators import create_stemmer_lemmer, cre... | 25.55 | 95 | 0.861057 |
from .useful_functions import get_ngrams, words_to_ngrams_list, remove_hook_words, remove_words
from .transformers import phrases_transform, phrases2lower, phrases_without_excess_symbols
from .tokenizers import text2sentences, split_by_words, sentence_split
from .stemlem_operators import create_stemmer_lemmer, cre... | true | true |
f700372959084882c409772f7096a8fa1fe06d06 | 971 | py | Python | Vortex/__main__.py | 1upCommunity/Vortex | abd7d6de3f66ba91b9b6b1a8c338420d90832b08 | [
"MIT"
] | null | null | null | Vortex/__main__.py | 1upCommunity/Vortex | abd7d6de3f66ba91b9b6b1a8c338420d90832b08 | [
"MIT"
] | null | null | null | Vortex/__main__.py | 1upCommunity/Vortex | abd7d6de3f66ba91b9b6b1a8c338420d90832b08 | [
"MIT"
] | null | null | null | # internal imports
import dependency_checker
import dependency_installer
import dependency_updater
import logger
from rendering import VortexWindow
# external imports
import pyglet
import sys
# check if python version is too old. If it is, exit.
if sys.version_info < (3, 6): # if python version is less than 3.6
... | 31.322581 | 86 | 0.719876 |
import dependency_checker
import dependency_installer
import dependency_updater
import logger
from rendering import VortexWindow
import pyglet
import sys
if sys.version_info < (3, 6):
logger.critical(
"Vortex", "Python version is too old. Please use python 3.6 or higher.")
sys.exit(1)
if not de... | true | true |
f7003754514cd37f51ea1286be38a5043fe6241f | 1,219 | py | Python | flambe/nlp/transformers/gpt.py | axel-sirota/flambe | 15e985ab456973b40e6b75c6b3d153ea9b4e8849 | [
"MIT"
] | null | null | null | flambe/nlp/transformers/gpt.py | axel-sirota/flambe | 15e985ab456973b40e6b75c6b3d153ea9b4e8849 | [
"MIT"
] | null | null | null | flambe/nlp/transformers/gpt.py | axel-sirota/flambe | 15e985ab456973b40e6b75c6b3d153ea9b4e8849 | [
"MIT"
] | null | null | null | """
Intergation of the pytorch_transformers openai and gpt2 modules.
Note that these objects are only to be used to load
pretrained models. The pytorch-transformers library
wasn't designed to train these models from scratch.
"""
import pytorch_transformers as pt
from flambe.nlp.transformers.utils import Transformer... | 19.983607 | 83 | 0.704676 |
import pytorch_transformers as pt
from flambe.nlp.transformers.utils import TransformerTextField, TransformerEmbedder
class GPTTextField(TransformerTextField):
_cls = pt.OpenAIGPTTokenizer
class GPTEmbedder(TransformerEmbedder):
_cls = pt.OpenAIGPTModel
class GPT2TextField(TransformerTextField):
... | true | true |
f700384c604ac91f885c84ab6ed838d3ba8c4771 | 13,878 | py | Python | pyzoo/zoo/zouwu/model/Seq2Seq.py | GZHoffie/analytics-zoo | d0258aa113ffd1a5c4927376fb32b09fb0baf73c | [
"Apache-2.0"
] | null | null | null | pyzoo/zoo/zouwu/model/Seq2Seq.py | GZHoffie/analytics-zoo | d0258aa113ffd1a5c4927376fb32b09fb0baf73c | [
"Apache-2.0"
] | null | null | null | pyzoo/zoo/zouwu/model/Seq2Seq.py | GZHoffie/analytics-zoo | d0258aa113ffd1a5c4927376fb32b09fb0baf73c | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2018 Analytics Zoo Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 40.343023 | 98 | 0.602392 |
from tensorflow.keras.models import Model
from tensorflow.keras.layers import Input, LSTM, Dense
import tensorflow.keras as keras
from zoo.automl.model.abstract import BaseModel
from zoo.automl.common.util import *
from zoo.automl.common.metrics import Evaluator
class LSTMSeq2Seq(BaseModel):
def... | true | true |
f70038c0705176be86c930b583ff2896d4eb6f71 | 1,547 | py | Python | lib/src/layers/RNN.py | ILoveRedEd55/AIML_Detection_System | b2fdd8475f069884060f7bb31f41953bae057d7b | [
"BSD-3-Clause"
] | null | null | null | lib/src/layers/RNN.py | ILoveRedEd55/AIML_Detection_System | b2fdd8475f069884060f7bb31f41953bae057d7b | [
"BSD-3-Clause"
] | null | null | null | lib/src/layers/RNN.py | ILoveRedEd55/AIML_Detection_System | b2fdd8475f069884060f7bb31f41953bae057d7b | [
"BSD-3-Clause"
] | null | null | null | from src.layers.LayerHelper import *
from settings import LayerSettings as layerSettings
import tensorflow as tf
import os
CUDA_VISIBLE_DEVICES=0
os.environ["CUDA_VISIBLE_DEVICES"] = "0" # set gpu number
def LSTM(name_, inputTensor_, numberOfOutputs_, isTraining_, dropoutProb_=None):
with tf.name_scope(name_):
cell... | 37.731707 | 119 | 0.752424 | from src.layers.LayerHelper import *
from settings import LayerSettings as layerSettings
import tensorflow as tf
import os
CUDA_VISIBLE_DEVICES=0
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
def LSTM(name_, inputTensor_, numberOfOutputs_, isTraining_, dropoutProb_=None):
with tf.name_scope(name_):
cell = tf.nn.rnn_cel... | true | true |
f700393f1927165c9cf9f30f328806087c1c1101 | 12,366 | py | Python | lib/enthought/traits/ui/tk/menu.py | mattfoster/matplotlib | 0b47697b19b77226c633ec6a3d74a2199a153315 | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2016-05-08T18:33:12.000Z | 2016-05-08T18:33:12.000Z | lib/enthought/traits/ui/tk/menu.py | mattfoster/matplotlib | 0b47697b19b77226c633ec6a3d74a2199a153315 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | lib/enthought/traits/ui/tk/menu.py | mattfoster/matplotlib | 0b47697b19b77226c633ec6a3d74a2199a153315 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | #------------------------------------------------------------------------------
# Copyright (c) 2005, Enthought, Inc.
# All rights reserved.
#
# This software is provided without warranty under the terms of the BSD
# license included in enthought/LICENSE.txt and may be redistributed only
# under the conditions describe... | 37.70122 | 81 | 0.404334 |
import wx
import re
import string
help_pat = re.compile( r'(.*){(.*)}(.*)' )
options_pat = re.compile( r'(.*)\[(.*)\](.*)' )
key_map = {
'F1': wx.WXK_F1,
'F2': wx.WXK_F2,
'F3': wx.WXK_F3,
'F4': wx.WXK_F4,
'F5': wx.WXK_F5,
'F6': wx.WXK_F6,
... | false | true |
f70039735ffe11d74efe8cef9ed002422d74d66c | 1,651 | py | Python | externals/libbot/bot2-param/lcmtypes/python/bot_param/request_t.py | ericmanzi/double_pendulum_lqr | 76bba3091295abb7d412c4a3156258918f280c96 | [
"BSD-3-Clause"
] | null | null | null | externals/libbot/bot2-param/lcmtypes/python/bot_param/request_t.py | ericmanzi/double_pendulum_lqr | 76bba3091295abb7d412c4a3156258918f280c96 | [
"BSD-3-Clause"
] | null | null | null | externals/libbot/bot2-param/lcmtypes/python/bot_param/request_t.py | ericmanzi/double_pendulum_lqr | 76bba3091295abb7d412c4a3156258918f280c96 | [
"BSD-3-Clause"
] | null | null | null | """LCM type definitions
This file automatically generated by lcm.
DO NOT MODIFY BY HAND!!!!
"""
import cStringIO as StringIO
import struct
class request_t(object):
__slots__ = ["utime"]
def __init__(self):
self.utime = 0
def encode(self):
buf = StringIO.StringIO()
buf.write(reque... | 30.018182 | 96 | 0.658389 |
import cStringIO as StringIO
import struct
class request_t(object):
__slots__ = ["utime"]
def __init__(self):
self.utime = 0
def encode(self):
buf = StringIO.StringIO()
buf.write(request_t._get_packed_fingerprint())
self._encode_one(buf)
return buf.getvalue()
... | true | true |
f70039ac21b0c913b647473f2df763d599defccb | 670 | py | Python | test_package/conanfile.py | amrayn/conan-easyloggingpp | e8964070859af0fe5164e2b0a56d58265a99f14e | [
"MIT"
] | null | null | null | test_package/conanfile.py | amrayn/conan-easyloggingpp | e8964070859af0fe5164e2b0a56d58265a99f14e | [
"MIT"
] | null | null | null | test_package/conanfile.py | amrayn/conan-easyloggingpp | e8964070859af0fe5164e2b0a56d58265a99f14e | [
"MIT"
] | null | null | null | from conans import ConanFile, CMake
import os
channel = os.getenv("CONAN_CHANNEL", "testing")
username = os.getenv("CONAN_USERNAME", "memsharded")
class EasyLoggingTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
requires = "easyloggingpp/9.94.1@%s/%s" % (username, channel)
generato... | 29.130435 | 82 | 0.632836 | from conans import ConanFile, CMake
import os
channel = os.getenv("CONAN_CHANNEL", "testing")
username = os.getenv("CONAN_USERNAME", "memsharded")
class EasyLoggingTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
requires = "easyloggingpp/9.94.1@%s/%s" % (username, channel)
generato... | true | true |
f7003a232d6ec1fee548b1e75d560f765252f333 | 2,108 | py | Python | itea/inspection/__init__.py | gAldeia/itea-python | 689cd1eff61cd475277d63ca9387c6f9b6b7ee53 | [
"BSD-3-Clause"
] | null | null | null | itea/inspection/__init__.py | gAldeia/itea-python | 689cd1eff61cd475277d63ca9387c6f9b6b7ee53 | [
"BSD-3-Clause"
] | null | null | null | itea/inspection/__init__.py | gAldeia/itea-python | 689cd1eff61cd475277d63ca9387c6f9b6b7ee53 | [
"BSD-3-Clause"
] | null | null | null | # Author: Guilherme Aldeia
# Contact: guilherme.aldeia@ufabc.edu.br
# Version: 1.0.1
# Last modified: 06-07-2021 by Guilherme Aldeia
"""Interaction Transformation expression's **Inspector**
Sub-module containing three classes to help inspect and explain the
results obtained with the itea.
- ``ITExpr_exp... | 39.773585 | 81 | 0.776091 |
from itea.inspection._ITExpr_explainer import ITExpr_explainer
from itea.inspection._ITExpr_inspector import ITExpr_inspector
from itea.inspection._ITExpr_texifier import ITExpr_texifier
from itea.inspection._ITEA_summarizer import ITEA_summarizer
import jax
jax.config.update('jax_platform_nam... | true | true |
f7003b91bb4ee77fca845b180c133744331feb0a | 365 | py | Python | test/plugin_tests.py | builderjer/skill-ovos-timer | b7d15c9ca102d2de0a514402599db1bb542189e8 | [
"Apache-2.0"
] | 2 | 2021-11-18T16:34:12.000Z | 2021-11-20T14:52:54.000Z | test/plugin_tests.py | builderjer/skill-ovos-timer | b7d15c9ca102d2de0a514402599db1bb542189e8 | [
"Apache-2.0"
] | null | null | null | test/plugin_tests.py | builderjer/skill-ovos-timer | b7d15c9ca102d2de0a514402599db1bb542189e8 | [
"Apache-2.0"
] | 1 | 2022-03-11T22:30:23.000Z | 2022-03-11T22:30:23.000Z | # write your first unittest!
import unittest
from ovos_plugin_manager.skills import find_skill_plugins
class TestPlugin(unittest.TestCase):
@classmethod
def setUpClass(self):
self.skill_id = "ovos-skill-timer.OpenVoiceOS"
def test_find_plugin(self):
plugins = find_skill_plugins()
... | 24.333333 | 57 | 0.734247 |
import unittest
from ovos_plugin_manager.skills import find_skill_plugins
class TestPlugin(unittest.TestCase):
@classmethod
def setUpClass(self):
self.skill_id = "ovos-skill-timer.OpenVoiceOS"
def test_find_plugin(self):
plugins = find_skill_plugins()
self.assertIn(self.skill_id,... | true | true |
f7003ce868d990006e15c94a79022efc04576c27 | 6,869 | py | Python | sdc/detection/cnn_classifier.py | tadasdanielius/P5-Vehicle-Detection-And-Tracking | 38513e91d863f7fff50703349aacbe5d5bbfae39 | [
"MIT"
] | null | null | null | sdc/detection/cnn_classifier.py | tadasdanielius/P5-Vehicle-Detection-And-Tracking | 38513e91d863f7fff50703349aacbe5d5bbfae39 | [
"MIT"
] | null | null | null | sdc/detection/cnn_classifier.py | tadasdanielius/P5-Vehicle-Detection-And-Tracking | 38513e91d863f7fff50703349aacbe5d5bbfae39 | [
"MIT"
] | null | null | null | from keras.preprocessing.image import ImageDataGenerator
from keras.models import Sequential
from keras.layers import Convolution2D, MaxPooling2D
from keras.layers import Activation, Dropout, Flatten, Dense, Lambda, ELU
from keras.optimizers import Adam
from sklearn.model_selection import train_test_split
from keras.mo... | 35.963351 | 118 | 0.615519 | from keras.preprocessing.image import ImageDataGenerator
from keras.models import Sequential
from keras.layers import Convolution2D, MaxPooling2D
from keras.layers import Activation, Dropout, Flatten, Dense, Lambda, ELU
from keras.optimizers import Adam
from sklearn.model_selection import train_test_split
from keras.mo... | true | true |
f7003f183c485860f122f79dba419f856151c5fc | 2,935 | py | Python | tests/test_uniswap_add.py | Dahlia-Finance/dahlia_contracts | 3cf35103b2341a2ca07f8b5653946c74cedf3a78 | [
"MIT"
] | 1 | 2022-01-14T11:04:09.000Z | 2022-01-14T11:04:09.000Z | tests/test_uniswap_add.py | Pinnata/pinnata-contracts | 3cf35103b2341a2ca07f8b5653946c74cedf3a78 | [
"MIT"
] | 3 | 2021-12-16T19:54:57.000Z | 2021-12-20T18:32:21.000Z | tests/test_uniswap_add.py | Dahlia-Finance/pinnata_contracts | 3cf35103b2341a2ca07f8b5653946c74cedf3a78 | [
"MIT"
] | 2 | 2021-11-24T05:01:56.000Z | 2021-12-04T00:27:54.000Z | import pytest
from brownie import interface
def test_uniswap_add_two_tokens(
admin, alice, chain, bank, werc20, ufactory, urouter, simple_oracle, oracle, celo, cusd, ceur, UniswapV2SpellV1, UniswapV2Oracle, core_oracle
):
spell = UniswapV2SpellV1.deploy(bank, werc20, urouter, celo, {'from': admin})
cusd.m... | 34.127907 | 145 | 0.586712 | import pytest
from brownie import interface
def test_uniswap_add_two_tokens(
admin, alice, chain, bank, werc20, ufactory, urouter, simple_oracle, oracle, celo, cusd, ceur, UniswapV2SpellV1, UniswapV2Oracle, core_oracle
):
spell = UniswapV2SpellV1.deploy(bank, werc20, urouter, celo, {'from': admin})
cusd.m... | true | true |
f700404190ae8f9854ae05ee091bc6c1b9adc263 | 3,424 | py | Python | verbify_service_websockets/patched_websocket.py | Verbify/verbify-service-websockets | 08ae7b0b930c183a55bb96635d7d7c73faf5f629 | [
"BSD-3-Clause"
] | 94 | 2016-04-19T06:13:22.000Z | 2018-04-19T11:33:28.000Z | verbify_service_websockets/patched_websocket.py | Verbify/verbify-service-websockets | 08ae7b0b930c183a55bb96635d7d7c73faf5f629 | [
"BSD-3-Clause"
] | 10 | 2016-05-18T22:11:55.000Z | 2017-11-17T11:03:24.000Z | verbify_service_websockets/patched_websocket.py | Verbify/verbify-service-websockets | 08ae7b0b930c183a55bb96635d7d7c73faf5f629 | [
"BSD-3-Clause"
] | 17 | 2016-04-19T06:13:24.000Z | 2018-03-24T19:25:53.000Z | """
This module patches a few core functions to add compression capabilities,
since gevent-websocket does not appear to be maintained anymore.
"""
from socket import error
from zlib import (
decompressobj,
MAX_WBITS,
Z_FULL_FLUSH,
)
from geventwebsocket.exceptions import (
ProtocolError,
WebSocketE... | 27.392 | 77 | 0.684871 | from socket import error
from zlib import (
decompressobj,
MAX_WBITS,
Z_FULL_FLUSH,
)
from geventwebsocket.exceptions import (
ProtocolError,
WebSocketError,
)
from geventwebsocket.websocket import (
MSG_SOCKET_DEAD,
Header,
WebSocket,
)
DECOMPRESSOR = decompressobj(-MAX_WBITS)
def ... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.