hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
41925108c67ac2d0b73b532a142be61a3e5d52da | 1,595 | py | Python | cupy/testing/array.py | ytoyama/yans_chainer_hackathon | 744e7a5a67da8dec2869879f0adfae2d43eaf75c | [
"MIT"
] | null | null | null | cupy/testing/array.py | ytoyama/yans_chainer_hackathon | 744e7a5a67da8dec2869879f0adfae2d43eaf75c | [
"MIT"
] | 1 | 2016-11-09T06:32:32.000Z | 2016-11-09T10:20:04.000Z | cupy/testing/array.py | ytoyama/yans_chainer_hackathon | 744e7a5a67da8dec2869879f0adfae2d43eaf75c | [
"MIT"
] | 1 | 2018-11-18T00:36:51.000Z | 2018-11-18T00:36:51.000Z |
# NumPy-like assertion functions that accept both NumPy and CuPy arrays
| 31.9 | 73 | 0.692163 | import numpy.testing
import cupy
# NumPy-like assertion functions that accept both NumPy and CuPy arrays
def assert_allclose(actual, desired, rtol=1e-7, atol=0, err_msg='',
verbose=True):
numpy.testing.assert_allclose(
cupy.asnumpy(actual), cupy.asnumpy(desired),
rtol=rtol, a... | 0 | 0 | 0 | 0 | 0 | 1,320 | 0 | -11 | 206 |
e5453407a0260d2fa672531e2b6a6e9895a78b85 | 6,821 | py | Python | code_for_figures/suppFig1_annualmean/cmip6_plot_annualmean_change.py | Timh37/SeasonalDSLC_NWES | 9cbc155448dbd0ba07a5b95c5ce49dc3cb4a4187 | [
"MIT"
] | null | null | null | code_for_figures/suppFig1_annualmean/cmip6_plot_annualmean_change.py | Timh37/SeasonalDSLC_NWES | 9cbc155448dbd0ba07a5b95c5ce49dc3cb4a4187 | [
"MIT"
] | null | null | null | code_for_figures/suppFig1_annualmean/cmip6_plot_annualmean_change.py | Timh37/SeasonalDSLC_NWES | 9cbc155448dbd0ba07a5b95c5ce49dc3cb4a4187 | [
"MIT"
] | 1 | 2021-11-19T13:30:04.000Z | 2021-11-19T13:30:04.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
#plot maps of ensemble mean annual mean dslc and wind stress change
@author: thermans
"""
import xarray as xr
import matplotlib.pyplot as plt
import os
import numpy as np
import fnmatch
import cmocean
import cartopy.crs as ccrs
import matplotlib.gridspec as gridspec
... | 50.525926 | 154 | 0.756341 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
#plot maps of ensemble mean annual mean dslc and wind stress change
@author: thermans
"""
import xarray as xr
import matplotlib.pyplot as plt
import os
import numpy as np
import fnmatch
import cmocean
import cartopy.crs as ccrs
import matplotlib
import matplotlib.gri... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -4 | 22 |
0e1d8979796434fec6803abf366ff204854a1441 | 2,148 | py | Python | models/embedder.py | hanq0212/Few_Shot-Neural_Talking_Head | a5d2b4e745531e39d4d4c31a94557c0bd5e6072e | [
"MIT"
] | null | null | null | models/embedder.py | hanq0212/Few_Shot-Neural_Talking_Head | a5d2b4e745531e39d4d4c31a94557c0bd5e6072e | [
"MIT"
] | null | null | null | models/embedder.py | hanq0212/Few_Shot-Neural_Talking_Head | a5d2b4e745531e39d4d4c31a94557c0bd5e6072e | [
"MIT"
] | null | null | null | import torch | 45.702128 | 88 | 0.474395 | import torch
import torch.nn
from models.blocks import *
class Embedder(nn.Module):
def __init__(self,curr_size=224, ideal_size=256, pool_mode = "sum"):
super(Embedder, self).__init__()
self.init_padding= Padding(curr_size=curr_size, ideal=ideal_size)
# downsample
# input: B, 6, ... | 0 | 0 | 0 | 2,069 | 0 | 0 | 0 | 0 | 67 |
2e0ef5edb1fb4a280d5ae05b33226aeb2148eed9 | 4,059 | py | Python | tests/test_parser.py | hirnimeshrampuresoftware/python-tcod | c82d60eaaf12e50b405d55df1026c1d00dd283b6 | [
"BSD-2-Clause"
] | 231 | 2018-06-28T10:07:41.000Z | 2022-03-20T16:17:19.000Z | tests/test_parser.py | hanok2/python-tcod | 807fdca464389e3febd8c86991bd4564d091f48d | [
"BSD-2-Clause"
] | 66 | 2018-06-27T19:04:25.000Z | 2022-03-30T21:15:15.000Z | tests/test_parser.py | hanok2/python-tcod | 807fdca464389e3febd8c86991bd4564d091f48d | [
"BSD-2-Clause"
] | 31 | 2018-09-12T00:35:42.000Z | 2022-03-20T16:17:22.000Z | #!/usr/bin/env python
if __name__ == "__main__":
test_parser()
| 50.7375 | 114 | 0.698694 | #!/usr/bin/env python
import os
from typing import Any
import pytest
import tcod as libtcod
@pytest.mark.filterwarnings("ignore")
def test_parser() -> None:
print("***** File Parser test *****")
parser = libtcod.parser_new()
struct = libtcod.parser_new_struct(parser, "myStruct")
libtcod.struct_add_... | 0 | 3,893 | 0 | 0 | 0 | 0 | 0 | -18 | 114 |
f13c36c38565a5f00a1c93b2baf699d1fcfd7720 | 7,009 | py | Python | utils.py | UKPLab/EACL21-personalized-conversational-system | ff4949f11928b82f5bea06fa62b091cc337f56cc | [
"MIT"
] | 9 | 2021-01-27T22:10:45.000Z | 2021-11-09T23:47:46.000Z | utils.py | UKPLab/EACL21-personalized-conversational-system | ff4949f11928b82f5bea06fa62b091cc337f56cc | [
"MIT"
] | 3 | 2021-03-11T06:04:15.000Z | 2021-08-31T15:44:42.000Z | utils.py | UKPLab/EACL21-personalized-conversational-system | ff4949f11928b82f5bea06fa62b091cc337f56cc | [
"MIT"
] | 1 | 2021-05-10T07:35:01.000Z | 2021-05-10T07:35:01.000Z | # Copyright (c) 2019-present, HuggingFace Inc.
# All rights reserved. This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import json
import logging
import os
import tarfile
import tempfile
import torch
from pytorch_pretrained_bert import cac... | 46.726667 | 153 | 0.659153 | # Copyright (c) 2019-present, HuggingFace Inc.
# All rights reserved. This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import json
import logging
import os
import tarfile
import tempfile
import torch
from pytorch_pretrained_bert import cac... | 30 | 0 | 0 | 126 | 0 | 544 | 0 | 14 | 105 |
6b90888722e66e986dd59cf3304d14be7e22c8b2 | 4,255 | py | Python | lib/roi_data/minibatch.py | GothicAi/AugMask | 1547de027ddac29cc92ec6f98c837f32301fcd67 | [
"MIT"
] | null | null | null | lib/roi_data/minibatch.py | GothicAi/AugMask | 1547de027ddac29cc92ec6f98c837f32301fcd67 | [
"MIT"
] | null | null | null | lib/roi_data/minibatch.py | GothicAi/AugMask | 1547de027ddac29cc92ec6f98c837f32301fcd67 | [
"MIT"
] | 1 | 2020-03-31T22:37:29.000Z | 2020-03-31T22:37:29.000Z | import numpy as np
import cv2
from core.config import cfg
import utils.blob as blob_utils
import roi_data.rpn
def get_minibatch_blob_names(is_training=True):
"""Return blob names in the order in which they are read by the data loader.
"""
# data blob: holds a batch of N images, each with 3 channels
b... | 38.681818 | 106 | 0.610811 | import numpy as np
import cv2
from core.config import cfg
import utils.blob as blob_utils
import roi_data.rpn
def get_minibatch_blob_names(is_training=True):
"""Return blob names in the order in which they are read by the data loader.
"""
# data blob: holds a batch of N images, each with 3 channels
b... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e2103516eeb997f257f194053521245582f812a4 | 2,141 | py | Python | extract.py | josh-austin/color-extractor | d43f350a2340005da9d086aa1e797588c1125270 | [
"MIT"
] | 2 | 2015-01-11T00:00:25.000Z | 2020-06-30T19:39:51.000Z | extract.py | josh-austin/color-extractor | d43f350a2340005da9d086aa1e797588c1125270 | [
"MIT"
] | null | null | null | extract.py | josh-austin/color-extractor | d43f350a2340005da9d086aa1e797588c1125270 | [
"MIT"
] | null | null | null | import sys, os
if __name__ == '__main__':
if len(sys.argv) > 1:
for path in sys.argv[1:]:
name = '.'.join(path.split('.')[:-1])
extractor = Extractor(name)
read = open(path)
write = open(name + '.less', 'w')
variables = open(name + '_... | 31.955224 | 83 | 0.502102 | import sys, os
class Extractor:
def __init__(self, prefix=''):
self.variables = {}
self.prefix = os.path.basename(prefix)
'''
Returns the variable name if a variable with
the value <value> is found.
'''
def find_variable_name(self, value):
for var, val in self.v... | 0 | 0 | 0 | 1,348 | 0 | 0 | 0 | 0 | 24 |
da14e30138a8a6095f020cff0406d675dbf3d07c | 12,557 | py | Python | scripts/auv_models_test.py | michoy/system_identification | 13e2b249e111e00e290461ab392f0e2ad562246d | [
"MIT"
] | null | null | null | scripts/auv_models_test.py | michoy/system_identification | 13e2b249e111e00e290461ab392f0e2ad562246d | [
"MIT"
] | null | null | null | scripts/auv_models_test.py | michoy/system_identification | 13e2b249e111e00e290461ab392f0e2ad562246d | [
"MIT"
] | null | null | null | import unittest
if __name__ == "__main__":
unittest.main()
| 31.951654 | 74 | 0.525285 | import unittest
import numpy as np
from auv_models import linear_surge, diagonal_slow_without_g
from helper import degrees_to_quat_rotation
class SimplifiedSurgeAUVTest(unittest.TestCase):
def test_auv_1DOF(self):
x = 0
u = 0.1
tau = 1
m = 10
d = 20
state = np.ar... | 0 | 0 | 0 | 12,318 | 0 | 0 | 0 | 58 | 114 |
83871a80758a183a877a1739b65f003ef563b450 | 5,998 | py | Python | zdf_downloader.py | leaffan/downloading | c917c394f7519772b8c195e6e922ba40a372dce2 | [
"MIT"
] | 1 | 2017-02-01T15:37:31.000Z | 2017-02-01T15:37:31.000Z | zdf_downloader.py | leaffan/downloading | c917c394f7519772b8c195e6e922ba40a372dce2 | [
"MIT"
] | null | null | null | zdf_downloader.py | leaffan/downloading | c917c394f7519772b8c195e6e922ba40a372dce2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
if __name__ == '__main__':
arg_parser = argparse.ArgumentParser(
description='Download videos from ZDF media library.')
arg_parser.add_argument(
'-d', '--directory', dest='tgt_dir', metavar='target_directory',
required=Tru... | 37.72327 | 79 | 0.603701 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import argparse
import requests
import json
from dateutil.parser import parse
from lxml import html
class ZdfDownloader():
QUALITY_KEYS = ['veryhigh', 'high', 'low']
BROADCAST_BASE_URL = (
"https://api.zdf.de/tmd/2/ngplayer_2_3/vod... | 0 | 0 | 0 | 5,032 | 0 | 0 | 0 | -27 | 158 |
1a245c6ec7443114f7802b71a77b0421f9982bb1 | 11,707 | py | Python | tests/test_aztp_os_selector.py | jeremyschulman/aeon-ztps | 45f649f9453a56da1cc16df183c6292505c33762 | [
"Apache-2.0"
] | null | null | null | tests/test_aztp_os_selector.py | jeremyschulman/aeon-ztps | 45f649f9453a56da1cc16df183c6292505c33762 | [
"Apache-2.0"
] | null | null | null | tests/test_aztp_os_selector.py | jeremyschulman/aeon-ztps | 45f649f9453a56da1cc16df183c6292505c33762 | [
"Apache-2.0"
] | 1 | 2021-07-07T18:10:15.000Z | 2021-07-07T18:10:15.000Z | import yaml
import tempfile
dev_data = {
'os_name': 'cumulus-vx',
'vendor': 'cumulus',
'hw_part_number': '1234',
'hostname': 'cumulus',
'fqdn': 'cumulus.localhost',
'virtual': True,
'service_tag': '1234',
'os_version': '3.1.1',
'hw_version': '1234',
'mac_address': '012345678901... | 36.357143 | 124 | 0.679252 | import os
import yaml
import tempfile
import json
import sys
import copy
from collections import namedtuple
import pytest
from mock import patch
from aeon_ztp.bin import aztp_os_selector
dev_data = {
'os_name': 'cumulus-vx',
'vendor': 'cumulus',
'hw_part_number': '1234',
'hostname': 'cumulus',
'f... | 0 | 5,101 | 0 | 0 | 0 | 4,743 | 0 | -17 | 683 |
e2c2e185e25912314724f45aa243c157fc190970 | 4,322 | py | Python | Compare_simple_warehouse/without_GA/param.py | liuyandong1988/Warehouse_GA | 3dd6f07ae03c3b1a7eb1a961ed03e88a245a4455 | [
"MIT"
] | 1 | 2019-07-30T09:41:53.000Z | 2019-07-30T09:41:53.000Z | Compare_simple_warehouse/without_GA/param.py | liuyandong1988/Warehouse_GA | 3dd6f07ae03c3b1a7eb1a961ed03e88a245a4455 | [
"MIT"
] | null | null | null | Compare_simple_warehouse/without_GA/param.py | liuyandong1988/Warehouse_GA | 3dd6f07ae03c3b1a7eb1a961ed03e88a245a4455 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright 2017 eelium <eelium@eez008>
#
# Distributed under terms of the MIT license.
"""
parameters
"""
# The window refresh rate
REFRESH_INTERVAL = 50
# the ground size
margin_left = 100
margin_right = 100
margin_top = 100
margin_bottom = 100
L =... | 34.576 | 113 | 0.512031 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vim:fenc=utf-8
#
# Copyright © 2017 eelium <eelium@eez008>
#
# Distributed under terms of the MIT license.
import random
"""
parameters
"""
# The window refresh rate
REFRESH_INTERVAL = 50
# the ground size
margin_left = 100
margin_right = 100
margin_top = 100
margin_b... | 2 | 0 | 0 | 0 | 0 | 0 | 0 | -8 | 22 |
5016217d66d62951ba236ae324a5ee4c82ba7fd0 | 59,821 | py | Python | Seth/importer/views.py | Inf1n1te/Seth | 4ccfcba6226f3d284fd955cd0a81316402e8d043 | [
"BSD-3-Clause"
] | 1 | 2020-08-09T01:26:31.000Z | 2020-08-09T01:26:31.000Z | Seth/importer/views.py | Inf1n1te/Seth | 4ccfcba6226f3d284fd955cd0a81316402e8d043 | [
"BSD-3-Clause"
] | 17 | 2017-11-15T10:06:02.000Z | 2019-02-13T15:32:41.000Z | Seth/importer/views.py | Inf1n1te/Seth | 4ccfcba6226f3d284fd955cd0a81316402e8d043 | [
"BSD-3-Clause"
] | null | null | null | from django.core.exceptions import PermissionDenied
from django.shortcuts import get_object_or_404
from django.utils import timezone
import django_excel as excel
from Grades.exceptions import GradeException
from Grades.models import ModuleEdition, Grade, Test, Person
# Create your views here.
def make_grade... | 50.567202 | 172 | 0.567109 | from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.auth.models import User
from django.core.exceptions import PermissionDenied, SuspiciousOperation
from django.db import transaction
from django.db.utils import IntegrityError
from djang... | 0 | 47,600 | 0 | 7,473 | 0 | 0 | 0 | 628 | 631 |
ac15b3969bc4796063311a9d060ccadf45c21a9b | 2,923 | py | Python | lsp.py | blguweb/radiarDetection | 81cb694c17c6ef8736f30ad691f7da82cc83ea4c | [
"MIT"
] | null | null | null | lsp.py | blguweb/radiarDetection | 81cb694c17c6ef8736f30ad691f7da82cc83ea4c | [
"MIT"
] | null | null | null | lsp.py | blguweb/radiarDetection | 81cb694c17c6ef8736f30ad691f7da82cc83ea4c | [
"MIT"
] | null | null | null | #coding=utf-8
import os
import math
#from tqdm import tqdm
def lsp(x,y,th,mv_red_th,mv_green_th):#xymvy
'''
'''
times=30#
num_data_line=600#
data_ls = [[round(0.6 * x,2),0] for x in range(num_data_line)]#
error_range = 6#mv
mv_red_th //= 0.6
mv_green_th //= 0.6
mv_r... | 30.447917 | 274 | 0.517961 | #coding=utf-8
import os
import math
#from tqdm import tqdm
def dis2int(dis):
#将距离从字符串转换成整形
int_dis=0
for i in range(5):
int_dis += int(int(dis[i])*math.pow(10, 4 - i))
return int_dis
def lsp(x,y,th,mv_red_th,mv_green_th):#x与y为五人机绝对坐标系,后二者为mv返回大致角度值(为绝对坐标系中y轴方向顺时针转动角度)
'''
'... | 465 | 0 | 0 | 0 | 0 | 119 | 0 | 0 | 23 |
e0b3ce02e06b9dc10e756ee437b6ab424249cddb | 6,365 | py | Python | basicsr/inference_test.py | ZhangAoCanada/HINet | 6c03a65f70a494186a9fed02ce91cdf8deab105a | [
"MIT"
] | null | null | null | basicsr/inference_test.py | ZhangAoCanada/HINet | 6c03a65f70a494186a9fed02ce91cdf8deab105a | [
"MIT"
] | null | null | null | basicsr/inference_test.py | ZhangAoCanada/HINet | 6c03a65f70a494186a9fed02ce91cdf8deab105a | [
"MIT"
] | null | null | null | # ------------------------------------------------------------------------
# Copyright (c) 2021 megvii-model. All Rights Reserved.
# ------------------------------------------------------------------------
# Modified from BasicSR (https://github.com/xinntao/BasicSR)
# Copyright 2018-2020 BasicSR Authors
# -------------... | 35.758427 | 135 | 0.571092 | # ------------------------------------------------------------------------
# Copyright (c) 2021 megvii-model. All Rights Reserved.
# ------------------------------------------------------------------------
# Modified from BasicSR (https://github.com/xinntao/BasicSR)
# Copyright 2018-2020 BasicSR Authors
# -------------... | 0 | 0 | 0 | 0 | 0 | 5,066 | 0 | 228 | 422 |
977a52aceacc4591282f0f56211f48e3f242cb03 | 194 | py | Python | sort_123.py | malai001/codebank | 6834107ab683a38a8799102278369a66b1c1b336 | [
"bzip2-1.0.6"
] | 1 | 2017-07-11T05:02:12.000Z | 2017-07-11T05:02:12.000Z | sort_123.py | malai001/codebank | 6834107ab683a38a8799102278369a66b1c1b336 | [
"bzip2-1.0.6"
] | null | null | null | sort_123.py | malai001/codebank | 6834107ab683a38a8799102278369a66b1c1b336 | [
"bzip2-1.0.6"
] | null | null | null | a = [1,2,3,1,2,3]
l = 0
m = 0
h = len(a)-1
while(m<=h):
if(a[m]==1):
a[l],a[m] = a[m],a[l]
l+=1
m+=1
elif(a[m]==2):
m+=1
else:
a[h],a[m] = a[m],a[h]
h-=1
print a | 12.125 | 24 | 0.360825 | a = [1,2,3,1,2,3]
l = 0
m = 0
h = len(a)-1
while(m<=h):
if(a[m]==1):
a[l],a[m] = a[m],a[l]
l+=1
m+=1
elif(a[m]==2):
m+=1
else:
a[h],a[m] = a[m],a[h]
h-=1
print a | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0f527fbcf41be763958ea69825ceb32c790d1718 | 5,751 | py | Python | plaso/analysis/test_lib.py | cvandeplas/plaso | b625a2c267ed09505cfac84c9593d8c0922852b1 | [
"Apache-2.0"
] | 3 | 2016-03-11T02:47:08.000Z | 2016-12-24T03:19:27.000Z | plaso/analysis/test_lib.py | cvandeplas/plaso | b625a2c267ed09505cfac84c9593d8c0922852b1 | [
"Apache-2.0"
] | null | null | null | plaso/analysis/test_lib.py | cvandeplas/plaso | b625a2c267ed09505cfac84c9593d8c0922852b1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2014 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual 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 L... | 34.437126 | 79 | 0.738828 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2014 The Plaso Project Authors.
# Please see the AUTHORS file for details on individual 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 L... | 0 | 108 | 0 | 4,472 | 0 | 0 | 0 | 137 | 269 |
ab052d4fcf325877949746f118c6d1847e0459da | 6,901 | py | Python | tests/conftest.py | danbider/lightning-pose | 23dc5f22e4b40fa8b71193322f11fca703fd8ec9 | [
"MIT"
] | 47 | 2021-11-03T07:56:50.000Z | 2022-03-23T12:22:38.000Z | tests/conftest.py | danbider/lightning-pose | 23dc5f22e4b40fa8b71193322f11fca703fd8ec9 | [
"MIT"
] | 2 | 2021-10-19T03:45:12.000Z | 2022-01-25T22:20:42.000Z | tests/conftest.py | danbider/lightning-pose | 23dc5f22e4b40fa8b71193322f11fca703fd8ec9 | [
"MIT"
] | 6 | 2021-11-16T23:32:18.000Z | 2022-03-17T16:55:39.000Z | """Provide pytest fixtures for the entire test suite.
These fixtures create data and data modules that can be reused by other tests. Their
construction relies heavily on the utility functions provided in `utils/scripts.py`.
"""
import torch
_TORCH_DEVICE = "cuda" if torch.cuda.is_available() else "cpu"
TOY_DATA_ROO... | 28.634855 | 84 | 0.705115 | """Provide pytest fixtures for the entire test suite.
These fixtures create data and data modules that can be reused by other tests. Their
construction relies heavily on the utility functions provided in `utils/scripts.py`.
"""
import copy
import imgaug.augmenters as iaa
from omegaconf import ListConfig, OmegaConf
i... | 0 | 5,706 | 0 | 0 | 0 | 0 | 0 | 256 | 564 |
0efa1c8d1416695a1aacbad21331a04b9a79f3f1 | 6,095 | py | Python | tests/test_cosalib_cmdlib.py | shanemcd/coreos-assembler | a295e945bb0f4ba7a998c2440990680157b7e0d9 | [
"Apache-2.0"
] | 249 | 2018-09-11T14:43:09.000Z | 2022-03-26T05:03:11.000Z | tests/test_cosalib_cmdlib.py | shanemcd/coreos-assembler | a295e945bb0f4ba7a998c2440990680157b7e0d9 | [
"Apache-2.0"
] | 2,262 | 2018-08-28T16:56:35.000Z | 2022-03-31T22:40:11.000Z | tests/test_cosalib_cmdlib.py | jmarrero/coreos-assembler | 3f0b818a54767d17600e1b7b9155b6d7d9534353 | [
"Apache-2.0"
] | 148 | 2018-08-29T14:59:19.000Z | 2022-03-14T12:57:42.000Z | import datetime
import os
import platform
import pytest
import subprocess
import sys
import uuid
sys.path.insert(0, 'src')
from cosalib import cmdlib
PY_MAJOR, PY_MINOR, PY_PATCH = platform.python_version_tuple()
def test_run_verbose():
"""
Verify run_verbose returns expected information
"""
result... | 26.732456 | 77 | 0.59475 | import datetime
import os
import platform
import pytest
import subprocess
import sys
import uuid
sys.path.insert(0, 'src')
from cosalib import cmdlib
PY_MAJOR, PY_MINOR, PY_PATCH = platform.python_version_tuple()
def test_run_verbose():
"""
Verify run_verbose returns expected information
"""
result... | 0 | 0 | 0 | 717 | 0 | 1,744 | 0 | 0 | 96 |
daea94a3811d4fbda0c97cd4b522850520def761 | 3,691 | py | Python | release/scripts/startup/bl_ui/properties_workspace.py | mmk-code/blender | c8fc23fdbe09c33f5342ed51735dab50fe4f071b | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 2 | 2019-03-20T13:10:46.000Z | 2019-05-15T20:00:31.000Z | engine/2.80/scripts/startup/bl_ui/properties_workspace.py | byteinc/Phasor | f7d23a489c2b4bcc3c1961ac955926484ff8b8d9 | [
"Unlicense"
] | null | null | null | engine/2.80/scripts/startup/bl_ui/properties_workspace.py | byteinc/Phasor | f7d23a489c2b4bcc3c1961ac955926484ff8b8d9 | [
"Unlicense"
] | null | null | null | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | 31.547009 | 77 | 0.638309 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distrib... | 0 | 0 | 0 | 2,455 | 0 | 0 | 0 | 20 | 159 |
468a25b174ed8ac5bf498b1f130bd5cf63f10a97 | 1,275 | py | Python | setup.py | pfrouleau/wce-triage-v2 | 25610cda55f5cb2170e13e121ae1cbaa92ef7626 | [
"MIT"
] | 3 | 2019-07-25T03:24:23.000Z | 2021-06-23T14:01:34.000Z | setup.py | pfrouleau/wce-triage-v2 | 25610cda55f5cb2170e13e121ae1cbaa92ef7626 | [
"MIT"
] | 1 | 2019-12-20T16:04:19.000Z | 2019-12-20T16:04:19.000Z | setup.py | pfrouleau/wce-triage-v2 | 25610cda55f5cb2170e13e121ae1cbaa92ef7626 | [
"MIT"
] | 2 | 2019-07-25T03:24:26.000Z | 2021-02-14T05:27:11.000Z | import setuptools, sys, os
with open("README.rst", "r") as fh:
long_description = fh.read()
# The wce triage is designed to work with Ubuntu 18.04LTS and after
# that comes with Python 3.6.
python_version = sys.version_info
need_python_version = (3, 6)
if python_version < need_python_version:
raise RuntimeError... | 26.5625 | 73 | 0.661176 | import setuptools, sys, os
with open("README.rst", "r") as fh:
long_description = fh.read()
# The wce triage is designed to work with Ubuntu 18.04LTS and after
# that comes with Python 3.6.
python_version = sys.version_info
need_python_version = (3, 6)
if python_version < need_python_version:
raise RuntimeError... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 22 |
189cd7625aaa95f6630ac9cfcded7b39a36c88fe | 5,500 | py | Python | src/main/python/dev4py/utils/dicts.py | St4rG00se/dev4py-utils | 7507bd443cb231b6362e66ff6b161c8d792f39dc | [
"Apache-2.0"
] | null | null | null | src/main/python/dev4py/utils/dicts.py | St4rG00se/dev4py-utils | 7507bd443cb231b6362e66ff6b161c8d792f39dc | [
"Apache-2.0"
] | null | null | null | src/main/python/dev4py/utils/dicts.py | St4rG00se/dev4py-utils | 7507bd443cb231b6362e66ff6b161c8d792f39dc | [
"Apache-2.0"
] | null | null | null | """
The `dicts` module provides a set of utility functions to simplify dict operations
"""
# Copyright 2022 the original author or authors (i.e.: St4rG00se for Dev4py).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtai... | 32.163743 | 120 | 0.687273 | """
The `dicts` module provides a set of utility functions to simplify dict operations
"""
# Copyright 2022 the original author or authors (i.e.: St4rG00se for Dev4py).
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtai... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bf7ba2bf762b26c528325abaa78c23eea1b93956 | 3,241 | py | Python | hskl/classification.py | qiancao/hskl | 7a530d3e1cc10f0f85e5a1f3edbdcd91f2c2cc8a | [
"BSD-3-Clause"
] | 7 | 2021-03-01T18:07:49.000Z | 2021-09-12T10:22:21.000Z | hskl/classification.py | qiancao/hskl | 7a530d3e1cc10f0f85e5a1f3edbdcd91f2c2cc8a | [
"BSD-3-Clause"
] | null | null | null | hskl/classification.py | qiancao/hskl | 7a530d3e1cc10f0f85e5a1f3edbdcd91f2c2cc8a | [
"BSD-3-Clause"
] | 4 | 2021-03-25T13:36:54.000Z | 2021-05-30T10:25:06.000Z | # -*- coding: utf-8 -*-
"""
hskl
Classification Module
Data I/O conventions
X: (DimX, DimY, NumSpectralChannels) <np.array>
Y: (DimX, DimY) <np.array,dtype=uint8>
0 - ignored
1 - first label
2 - second label
...
"""
# Author: Qian Cao
# License: BSD 3-Clause
from sklearn.utils import all_estimator... | 27.700855 | 82 | 0.639309 | # -*- coding: utf-8 -*-
"""
hskl
Classification Module
Data I/O conventions
X: (DimX, DimY, NumSpectralChannels) <np.array>
Y: (DimX, DimY) <np.array,dtype=uint8>
0 - ignored
1 - first label
2 - second label
...
"""
# Author: Qian Cao
# License: BSD 3-Clause
import numpy as np
from sklearn.utils ... | 0 | 0 | 0 | 1,601 | 0 | 0 | 0 | 87 | 112 |
d4c92148b0ac4e28242be712fafb2a11f6a3d5a4 | 1,106 | py | Python | dynts/utils/populate.py | quantmind/dynts | 21ac57c648bfec402fa6b1fe569496cf098fb5e8 | [
"BSD-3-Clause"
] | 57 | 2015-02-10T13:42:06.000Z | 2022-03-28T14:48:36.000Z | dynts/utils/populate.py | quantmind/dynts | 21ac57c648bfec402fa6b1fe569496cf098fb5e8 | [
"BSD-3-Clause"
] | 1 | 2016-11-01T07:43:05.000Z | 2016-11-01T07:43:05.000Z | dynts/utils/populate.py | quantmind/dynts | 21ac57c648bfec402fa6b1fe569496cf098fb5e8 | [
"BSD-3-Clause"
] | 17 | 2015-05-08T04:09:19.000Z | 2021-08-02T19:24:52.000Z |
def polygen(*coefficients):
'''Polynomial generating function'''
if not coefficients:
return lambda i: 0
else:
c0 = coefficients[0]
coefficients = coefficients[1:]
return _
| 22.12 | 64 | 0.563291 | from datetime import date, timedelta
from random import uniform
from numpy import ndarray
def _generator(x):
return uniform(0, 1)
class gdata(object):
def __init__(self, data):
self.data = data
def __iter__(self):
return (v for v in self.data)
def datepopulate(siz... | 0 | 0 | 0 | 124 | 0 | 515 | 0 | 24 | 204 |
d4bddb57b63ff8699be1cdd5f9d5d69256c5b486 | 4,376 | py | Python | awsm_rank/awsm_rank.py | psacawa/awsm-rank | 36a8900c60c75e33973769162ec12b6dd4017dcd | [
"MIT"
] | null | null | null | awsm_rank/awsm_rank.py | psacawa/awsm-rank | 36a8900c60c75e33973769162ec12b6dd4017dcd | [
"MIT"
] | null | null | null | awsm_rank/awsm_rank.py | psacawa/awsm-rank | 36a8900c60c75e33973769162ec12b6dd4017dcd | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import re
import sys
import argparse
import asyncio
from os import environ
from typing import List
import logging
import subprocess
import requests
from bs4 import BeautifulSoup
logger = logging.getLogger(__name__)
logger.setLevel(logging.INFO)
logger.addHandler(logging.StreamHandler(sys.stdout)... | 33.661538 | 91 | 0.675046 | #!/usr/bin/env python3
import re
import sys
import argparse
import asyncio
import json
from os import environ
from typing import List
from pprint import pprint
import logging
import subprocess
from urllib.parse import urlparse
from aiohttp import ClientSession, ClientError
import requests
from bs4 import BeautifulSoup... | 0 | 0 | 1,259 | 0 | 0 | 126 | 0 | 39 | 180 |
9c94d36e656c8b0972e4d60231610351bbee92fa | 9,994 | py | Python | BioLAMA/best.py | dmis-lab/BioLAMA | 28eabf54af362e58e7b8b8096b3a71c432b4f02b | [
"Apache-2.0"
] | 29 | 2021-09-16T02:26:37.000Z | 2022-03-27T08:48:55.000Z | BioLAMA/best.py | dmis-lab/BioLAMA | 28eabf54af362e58e7b8b8096b3a71c432b4f02b | [
"Apache-2.0"
] | 5 | 2021-09-24T02:32:49.000Z | 2022-03-17T11:53:55.000Z | BioLAMA/best.py | dmis-lab/BioLAMA | 28eabf54af362e58e7b8b8096b3a71c432b4f02b | [
"Apache-2.0"
] | 2 | 2021-12-16T07:09:13.000Z | 2022-03-17T03:47:20.000Z | """
.. module:: BEST
:platform: Unix, linux, Windows
.. moduleauthor:: Sunkyu Kim <sunkyu-kim@korea.ac.kr>
================================
Biomedical Entity Query API v2
================================
API Description
================
This API is for use of BEST(Biomedical Entity Search Tool) in various purposes.... | 30.562691 | 201 | 0.558735 | """
.. module:: BEST
:platform: Unix, linux, Windows
.. moduleauthor:: Sunkyu Kim <sunkyu-kim@korea.ac.kr>
================================
Biomedical Entity Query API v2
================================
API Description
================
This API is for use of BEST(Biomedical Entity Search Tool) in various purposes.... | 12 | 0 | 0 | 4,269 | 0 | 841 | 0 | 0 | 46 |
3faf6cfa0866ca8d6a6f948152e173e23006d08d | 352 | py | Python | python-benchmarking-tools/test/test_log.py | HASTE-project/benchmarking-tools | 3e65cd4019287051a612bc21fa68e4b1a5bbc745 | [
"BSD-3-Clause"
] | null | null | null | python-benchmarking-tools/test/test_log.py | HASTE-project/benchmarking-tools | 3e65cd4019287051a612bc21fa68e4b1a5bbc745 | [
"BSD-3-Clause"
] | null | null | null | python-benchmarking-tools/test/test_log.py | HASTE-project/benchmarking-tools | 3e65cd4019287051a612bc21fa68e4b1a5bbc745 | [
"BSD-3-Clause"
] | null | null | null | import unittest
| 23.466667 | 64 | 0.713068 | import io
import unittest
import unittest.mock
from haste.benchmarking import log
class TestLog(unittest.TestCase):
@unittest.mock.patch('sys.stdout', new_callable=io.StringIO)
def test_log(self, mock_stdout):
log.log('topic', 'message')
print(mock_stdout.getvalue())
self.assertEqual... | 0 | 206 | 0 | 12 | 0 | 0 | 0 | 0 | 117 |
d55115c108a4e0def496b8f1eed2b517ab34ee3a | 1,398 | py | Python | notebooks/chisel-tutorial/src/chisel-tutorial/adder4.py | edwardcwang/magmathon | f9a1e9d93823d0a90e77c968d952d05b553a6a86 | [
"MIT"
] | null | null | null | notebooks/chisel-tutorial/src/chisel-tutorial/adder4.py | edwardcwang/magmathon | f9a1e9d93823d0a90e77c968d952d05b553a6a86 | [
"MIT"
] | null | null | null | notebooks/chisel-tutorial/src/chisel-tutorial/adder4.py | edwardcwang/magmathon | f9a1e9d93823d0a90e77c968d952d05b553a6a86 | [
"MIT"
] | null | null | null |
# coding: utf-8
# In[1]:
import sys
sys.path.append("../../examples")
# In[2]:
T = Bits(4)
# In[3]:
from magma.simulator import PythonSimulator
from magma.bit_vector import BitVector
simulator = PythonSimulator(Adder4)
simulator.set_value(Adder4.a, BitVector(2, num_bits=4))
simulator.set_value(Adder4.b, Bi... | 24.103448 | 82 | 0.619456 |
# coding: utf-8
# In[1]:
import sys
sys.path.append("../../examples")
from full_adder import FullAdder
from magma import *
# In[2]:
T = Bits(4)
class Adder4(Circuit):
name = "Adder4"
IO = ["a", In(T), "b", In(T), "cin", In(Bit), "out", Out(T), "cout", Out(Bit)]
@classmethod
def definition(io):
... | 0 | 655 | 0 | 130 | 0 | 0 | 0 | 9 | 66 |
7bfcdc9926552a8b0a147972eecca053f069298b | 694 | py | Python | Algorithms/0021_Merge_Two_Sorted_Lists/Python/Merge_Two_Sorted_Lists_Solution_1.py | lht19900714/Leetcode_Solutions | dac7a038329a5c1f8a78e86cc6f49116b963f1fb | [
"MIT"
] | null | null | null | Algorithms/0021_Merge_Two_Sorted_Lists/Python/Merge_Two_Sorted_Lists_Solution_1.py | lht19900714/Leetcode_Solutions | dac7a038329a5c1f8a78e86cc6f49116b963f1fb | [
"MIT"
] | null | null | null | Algorithms/0021_Merge_Two_Sorted_Lists/Python/Merge_Two_Sorted_Lists_Solution_1.py | lht19900714/Leetcode_Solutions | dac7a038329a5c1f8a78e86cc6f49116b963f1fb | [
"MIT"
] | null | null | null |
# Space: O(1)
# Time: O(n)
# Recursive approach
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
| 18.756757 | 53 | 0.489914 |
# Space: O(1)
# Time: O(n)
# Recursive approach
# Definition for singly-linked list.
# class ListNode:
# def __init__(self, x):
# self.val = x
# self.next = None
class Solution:
def mergeTwoLists(self, l1, l2):
def helper(l1, l2):
if l1 is None and l2 is None: return No... | 0 | 0 | 0 | 483 | 0 | 0 | 0 | 0 | 23 |
0fcb44b3908d0bb94f87d70dc7b56e91aa980468 | 3,257 | py | Python | dvc/utils/fs.py | ap-kulkarni/dvc | 735b563ce411413d29be4d9ec2eca716356de3b9 | [
"Apache-2.0"
] | null | null | null | dvc/utils/fs.py | ap-kulkarni/dvc | 735b563ce411413d29be4d9ec2eca716356de3b9 | [
"Apache-2.0"
] | null | null | null | dvc/utils/fs.py | ap-kulkarni/dvc | 735b563ce411413d29be4d9ec2eca716356de3b9 | [
"Apache-2.0"
] | null | null | null | import logging
import os
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from dvc.types import StrPath
logger = logging.getLogger(__name__)
def path_isin(child: "StrPath", parent: "StrPath") -> bool:
"""Check if given `child` path is inside `parent`."""
parent = os.path.join(normalize_path(pare... | 26.917355 | 76 | 0.634326 | import errno
import logging
import os
import shutil
import stat
import sys
from typing import TYPE_CHECKING
from dvc.exceptions import DvcException
if TYPE_CHECKING:
from dvc.types import StrPath
logger = logging.getLogger(__name__)
class BasePathNotInCheckedPathException(DvcException):
def __init__(self, ... | 0 | 0 | 0 | 211 | 0 | 2,370 | 0 | -20 | 276 |
e6b4b48425df0aec5cd3b453e554c427e79241d4 | 3,935 | py | Python | tfplot/figure.py | sirspinach/tensorflow-plot | d6ad65cb4392e9adbf65d3dc8086a2eacd1e9f43 | [
"MIT"
] | null | null | null | tfplot/figure.py | sirspinach/tensorflow-plot | d6ad65cb4392e9adbf65d3dc8086a2eacd1e9f43 | [
"MIT"
] | null | null | null | tfplot/figure.py | sirspinach/tensorflow-plot | d6ad65cb4392e9adbf65d3dc8086a2eacd1e9f43 | [
"MIT"
] | null | null | null | ''' Figure utilities. '''
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import types
import matplotlib.pyplot as plt
from matplotlib.figure import Figure
from matplotlib.backends.backend_agg import FigureCanvasAgg
import six
from io i... | 28.309353 | 83 | 0.652097 | ''' Figure utilities. '''
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import types
import matplotlib.pyplot as plt
from matplotlib.figure import Figure
from matplotlib.backends.backend_agg import FigureCanvasAgg
import six
from io i... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
254837b592b886220849629aa4e47fbd84c719a1 | 18,279 | py | Python | campy/private/backends/jbe/platformat.py | TristenSeth/campy | 9e726c342d682239e1c19e6f5645c0b2167d7fab | [
"MIT"
] | 5 | 2018-12-03T19:18:50.000Z | 2021-05-31T07:17:06.000Z | campy/private/backends/jbe/platformat.py | TristenSeth/campy | 9e726c342d682239e1c19e6f5645c0b2167d7fab | [
"MIT"
] | 1 | 2017-06-07T04:33:46.000Z | 2017-06-07T04:33:46.000Z | campy/private/backends/jbe/platformat.py | TristenSeth/campy | 9e726c342d682239e1c19e6f5645c0b2167d7fab | [
"MIT"
] | 1 | 2017-06-06T07:29:07.000Z | 2017-06-06T07:29:07.000Z | """
Java Backend Format Strings
The following section lists format strings for the Java backend, and can/
should be updated as the text API to the Stanford Portable Library changes.
The strings are marked using keyword format syntax, which can be expanded by
keyword in Python
"""
# Platform::filelib_fileExists
# Platf... | 56.070552 | 141 | 0.743914 | """
Java Backend Format Strings
The following section lists format strings for the Java backend, and can/
should be updated as the text API to the Stanford Portable Library changes.
The strings are marked using keyword format syntax, which can be expanded by
keyword in Python
"""
# Platform::filelib_fileExists
# Platf... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ac37cde218154420b284a26ad457b2fee3a27de3 | 1,998 | py | Python | ipproxytool/spiders/proxy/freeproxylists.py | txgyy/ipproxytool | 59db3c4394abaf3df4a31ac35d297a1c7f929f65 | [
"MIT"
] | 11 | 2018-07-24T10:45:54.000Z | 2021-06-30T08:42:18.000Z | ipproxytool/spiders/proxy/freeproxylists.py | txgyy/ipproxytool | 59db3c4394abaf3df4a31ac35d297a1c7f929f65 | [
"MIT"
] | 3 | 2021-03-31T18:28:23.000Z | 2022-03-02T14:54:29.000Z | ipproxytool/spiders/proxy/freeproxylists.py | txgyy/ipproxytool | 59db3c4394abaf3df4a31ac35d297a1c7f929f65 | [
"MIT"
] | 4 | 2018-11-07T07:15:47.000Z | 2020-04-15T14:15:18.000Z | # coding=utf-8
| 33.864407 | 111 | 0.506507 | # coding=utf-8
import urllib
import re
from proxy import Proxy
from .basespider import BaseSpider
from bs4 import BeautifulSoup
class FreeProxyListsSpider(BaseSpider):
name = 'freeproxylists'
def __init__(self, *a, **kwargs):
super(FreeProxyListsSpider, self).__init__(*a, **kwargs)
self.url... | 0 | 0 | 0 | 1,844 | 0 | 0 | 0 | 3 | 135 |
40de51363eddccc28fd1673164d753ebb4fb9c63 | 2,505 | py | Python | python/yugabyte_db_thirdparty/yb_build_thirdparty_main.py | ttyusupov/yugabyte-db-thirdparty | 9680123cfe2d7d623e5ba2e4ed5cfbc42dbd5850 | [
"CC-BY-3.0"
] | null | null | null | python/yugabyte_db_thirdparty/yb_build_thirdparty_main.py | ttyusupov/yugabyte-db-thirdparty | 9680123cfe2d7d623e5ba2e4ed5cfbc42dbd5850 | [
"CC-BY-3.0"
] | null | null | null | python/yugabyte_db_thirdparty/yb_build_thirdparty_main.py | ttyusupov/yugabyte-db-thirdparty | 9680123cfe2d7d623e5ba2e4ed5cfbc42dbd5850 | [
"CC-BY-3.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Yugabyte, 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 ag... | 33.851351 | 99 | 0.741317 | #!/usr/bin/env python3
# Copyright (c) Yugabyte, 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 ag... | 0 | 0 | 0 | 0 | 0 | 1,305 | 0 | 293 | 207 |
f9230cc2630f651c77fc85d50504908444d0686f | 1,195 | py | Python | wikimon_bot/views/google.py | facerecog/wikimon | 212be56277f711ac145972254b3fead3f92e949c | [
"MIT"
] | 7 | 2016-05-06T12:52:20.000Z | 2018-02-13T15:48:15.000Z | wikimon_bot/views/google.py | facerecog/wikimon | 212be56277f711ac145972254b3fead3f92e949c | [
"MIT"
] | null | null | null | wikimon_bot/views/google.py | facerecog/wikimon | 212be56277f711ac145972254b3fead3f92e949c | [
"MIT"
] | 3 | 2017-01-14T14:25:01.000Z | 2021-03-11T21:01:36.000Z | """
GoogleViews:
/s(earch) <term>
/i(mage) <term>
youtube urls
"""
| 38.548387 | 114 | 0.645188 | """
GoogleViews:
/s(earch) <term>
/i(mage) <term>
youtube urls
"""
from ..utils import media_sender
import requests, urllib
class GoogleViews():
def __init__(self, interface_layer):
self.image_sender = media_sender.ImageSender(interface_layer)
self.video_sender = media_sender.Vide... | 0 | 0 | 0 | 1,030 | 0 | 0 | 0 | 13 | 67 |
d3d28355849fba837e5d0a48bc1a5239d87df296 | 4,355 | py | Python | seisflows/solver/specfem3d.py | umairbinwaheed/seisflows | b28cd89e1b37875c2e226f30a8c14d788fa7798f | [
"BSD-2-Clause"
] | 2 | 2021-05-12T03:28:31.000Z | 2021-12-08T14:43:20.000Z | seisflows/solver/specfem3d.py | umairbinwaheed/seisflows | b28cd89e1b37875c2e226f30a8c14d788fa7798f | [
"BSD-2-Clause"
] | null | null | null | seisflows/solver/specfem3d.py | umairbinwaheed/seisflows | b28cd89e1b37875c2e226f30a8c14d788fa7798f | [
"BSD-2-Clause"
] | 1 | 2021-12-08T14:43:49.000Z | 2021-12-08T14:43:49.000Z | from seisflows.tools.config import SeisflowsParameters, SeisflowsPaths
PAR = SeisflowsParameters()
PATH = SeisflowsPaths()
| 25.617647 | 80 | 0.589208 |
import subprocess
from glob import glob
from os.path import join
import numpy as np
import seisflows.seistools.specfem3d as solvertools
from seisflows.seistools.shared import getpar, setpar
from seisflows.tools import unix
from seisflows.tools.code import exists
from seisflows.tools.config import SeisflowsParameter... | 0 | 272 | 0 | 3,619 | 0 | 0 | 0 | 112 | 226 |
d53e3296d343fcbd5e9aedf582b891457907c88c | 4,197 | py | Python | tensormonk/loss/utils.py | Tensor46/TensorMONK | 67617d3fdf8fde072ba9cab42de7d67c79b17494 | [
"MIT"
] | 29 | 2018-07-06T23:57:23.000Z | 2022-03-08T20:38:57.000Z | tensormonk/loss/utils.py | Tensor46/TensorMONK | 67617d3fdf8fde072ba9cab42de7d67c79b17494 | [
"MIT"
] | 3 | 2018-12-14T22:21:26.000Z | 2020-06-19T02:13:34.000Z | tensormonk/loss/utils.py | Tensor46/TensorMONK | 67617d3fdf8fde072ba9cab42de7d67c79b17494 | [
"MIT"
] | 8 | 2018-07-06T23:58:03.000Z | 2021-04-12T01:35:54.000Z | """ TensorMONK :: loss :: utils """
__all__ = ["compute_n_embedding", "compute_top15", "one_hot", "one_hot_idx",
"hard_negative_mask"]
| 39.59434 | 79 | 0.630212 | """ TensorMONK :: loss :: utils """
__all__ = ["compute_n_embedding", "compute_top15", "one_hot", "one_hot_idx",
"hard_negative_mask"]
import torch
import numpy as np
def compute_n_embedding(tensor_size: tuple):
if isinstance(tensor_size, list) or isinstance(tensor_size, tuple):
if len(tensor... | 0 | 3,605 | 0 | 0 | 0 | 292 | 0 | -12 | 160 |
bfafc368176b6513edfd8f2cc1521fbf61f656f2 | 3,885 | py | Python | qiskit/ignis/verification/entanglement/linear.py | yehuda-naveh/qiskit-ignis-1 | 26da6a2173ea3cc46a11753746b6b83c68216c1f | [
"Apache-2.0"
] | null | null | null | qiskit/ignis/verification/entanglement/linear.py | yehuda-naveh/qiskit-ignis-1 | 26da6a2173ea3cc46a11753746b6b83c68216c1f | [
"Apache-2.0"
] | null | null | null | qiskit/ignis/verification/entanglement/linear.py | yehuda-naveh/qiskit-ignis-1 | 26da6a2173ea3cc46a11753746b6b83c68216c1f | [
"Apache-2.0"
] | null | null | null | '''
The module linear.py provides the linear
preparation analogous of parallelize.py.
'''
from qiskit.circuit import Parameter
def get_measurement_circ(n, qregname, cregname, full_measurement=True):
'''
Creates a measurement circuit that can toggle between
measuring the first control qubit or measuring al... | 27.359155 | 72 | 0.646332 | '''
The module linear.py provides the linear
preparation analogous of parallelize.py.
'''
from qiskit import *
from qiskit.circuit import Parameter
def get_measurement_circ(n, qregname, cregname, full_measurement=True):
'''
Creates a measurement circuit that can toggle between
measuring the first control... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -1 | 23 |
b3e616c9c00524f30d047f2ab6854aa68f2005ce | 8,950 | py | Python | mc/db/tests/test_ent.py | aspuru-guzik-group/mission_control | bfe930e1038e9e0d6c4bb327474766e85b2190cb | [
"Apache-2.0"
] | 3 | 2017-09-01T19:49:59.000Z | 2018-06-04T10:30:01.000Z | mc/db/tests/test_ent.py | aspuru-guzik-group/mission_control | bfe930e1038e9e0d6c4bb327474766e85b2190cb | [
"Apache-2.0"
] | null | null | null | mc/db/tests/test_ent.py | aspuru-guzik-group/mission_control | bfe930e1038e9e0d6c4bb327474766e85b2190cb | [
"Apache-2.0"
] | 1 | 2018-12-13T19:48:27.000Z | 2018-12-13T19:48:27.000Z |
from .. import models
| 34.423077 | 78 | 0.513296 | import time
import unittest
import sqlalchemy as _sqla
import sqlalchemy.orm as _sqla_orm
from .. import models
class BaseTestCase(unittest.TestCase):
def setUp(self):
self.engine = _sqla.create_engine('sqlite://')
models.utils.Base.metadata.create_all(self.engine)
self.Session = _sqla_o... | 0 | 0 | 0 | 8,740 | 0 | 0 | 0 | 2 | 181 |
d3994b6e31abc336d878a1cd54606f301a5aaddf | 1,781 | py | Python | main.py | jtprogru/bad-isp-twbot | 79391396694265531049bb715437b35242f5aa46 | [
"WTFPL"
] | 2 | 2020-07-17T17:05:49.000Z | 2020-07-24T16:41:46.000Z | main.py | jtprog/bad-isp-twbot | 79391396694265531049bb715437b35242f5aa46 | [
"WTFPL"
] | 1 | 2021-09-03T14:40:42.000Z | 2021-09-03T14:40:42.000Z | main.py | jtprog/bad-isp-twbot | 79391396694265531049bb715437b35242f5aa46 | [
"WTFPL"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
# Created by JTProgru
# Date: 2019-08-13
# https://jtprog.ru/
__author__ = 'jtprogru'
__version__ = '0.0.1'
__author_email__ = 'mail@jtprog.ru'
import dotenv as d
from pathlib import Path
from speedtest import Speedtest
import json
env = d.get_variables(str(Path(__file__).parent /... | 26.984848 | 111 | 0.66648 | #!/usr/bin/env python
# coding=utf-8
# Created by JTProgru
# Date: 2019-08-13
# https://jtprog.ru/
__author__ = 'jtprogru'
__version__ = '0.0.1'
__author_email__ = 'mail@jtprog.ru'
import twitter
import dotenv as d
from pathlib import Path
from speedtest import Speedtest
import json
env = d.get_variables(str(Path(__... | 36 | 0 | 0 | 0 | 0 | 0 | 0 | -7 | 23 |
e4114e3069a26efc84fae5bfd4804aeb08612c18 | 7,203 | py | Python | mergecounts/utils/cache.py | adthrasher/merge-counts | 87f41bec1c7fd3600e1fff52722ca6cc28509c0c | [
"MIT"
] | 1 | 2022-03-10T02:09:47.000Z | 2022-03-10T02:09:47.000Z | mergecounts/utils/cache.py | adthrasher/merge-counts | 87f41bec1c7fd3600e1fff52722ca6cc28509c0c | [
"MIT"
] | 3 | 2020-08-13T18:39:41.000Z | 2021-06-18T15:12:21.000Z | mergecounts/utils/cache.py | adthrasher/merge-counts | 87f41bec1c7fd3600e1fff52722ca6cc28509c0c | [
"MIT"
] | 1 | 2021-02-18T16:20:58.000Z | 2021-02-18T16:20:58.000Z | """Caching utilities for the merge-counts command line tool."""
import glob
import os
import json
import tempfile
from pathlib import Path
from typing import Dict, Optional
from logzero import logger
from . import errors
CACHE_POINTER_LOCATION = Path.home() / ".mergecounts-cache"
##############################
#... | 33.041284 | 106 | 0.670276 | """Caching utilities for the merge-counts command line tool."""
import glob
import os
import json
import tempfile
from pathlib import Path
from typing import Dict, Optional
from logzero import logger
from . import errors
CACHE_POINTER_LOCATION = Path.home() / ".mergecounts-cache"
class DNAnexusFileCache:
"""A... | 0 | 0 | 0 | 565 | 0 | 0 | 0 | 0 | 23 |
eecdfa932379a2cf4658c04955118aefa60f9289 | 13,522 | py | Python | yahoo_surface_scraper.py | JECSand/yahoo_finance_stock_scraper | 99efce789427a6bc16f874713ba43aed2e68e3ae | [
"MIT"
] | 7 | 2018-04-11T05:30:55.000Z | 2021-12-02T20:36:10.000Z | yahoo_surface_scraper.py | JECSand/yahoo_finance_stock_scraper | 99efce789427a6bc16f874713ba43aed2e68e3ae | [
"MIT"
] | null | null | null | yahoo_surface_scraper.py | JECSand/yahoo_finance_stock_scraper | 99efce789427a6bc16f874713ba43aed2e68e3ae | [
"MIT"
] | 4 | 2020-07-14T21:03:02.000Z | 2022-01-25T01:27:57.000Z | # Connor Sanders
# 10/16/2017
# Yahoo Finance Web Scraper
# Tested on python 2.7 and 3.5
# Returns a JSON File containing financial statement data for a given company or list of companies
# How to use this script:
# Make sure you have the PhantomJS Driver set up. If you need the manually add the path, go to... | 42.25625 | 121 | 0.619139 | # Connor Sanders
# 10/16/2017
# Yahoo Finance Web Scraper
# Tested on python 2.7 and 3.5
# Returns a JSON File containing financial statement data for a given company or list of companies
# How to use this script:
# Make sure you have the PhantomJS Driver set up. If you need the manually add the path, go to... | 0 | 1,322 | 0 | 6,892 | 0 | 2,589 | 0 | 83 | 390 |
10967061082d22a1f1ea01e1906929512f9533e7 | 21,995 | py | Python | src/nodes/gazebo_to_habitat_agent.py | ericchen321/ros_x_habitat | f256b62fe8dda059baaf9bad87cf53f7d769f2f9 | [
"CC-BY-4.0"
] | 24 | 2021-09-10T23:35:53.000Z | 2022-03-31T18:12:20.000Z | src/nodes/gazebo_to_habitat_agent.py | ericchen321/ros_x_habitat | f256b62fe8dda059baaf9bad87cf53f7d769f2f9 | [
"CC-BY-4.0"
] | 4 | 2021-12-11T06:56:58.000Z | 2022-02-23T03:05:00.000Z | src/nodes/gazebo_to_habitat_agent.py | ericchen321/ros_x_habitat | f256b62fe8dda059baaf9bad87cf53f7d769f2f9 | [
"CC-BY-4.0"
] | 7 | 2021-12-17T14:13:27.000Z | 2022-03-31T16:39:28.000Z | #!/usr/bin/env python
if __name__ == "__main__":
main() | 39.702166 | 96 | 0.586815 | #!/usr/bin/env python
import argparse
import numpy as np
import rospy
import message_filters
from message_filters import TimeSynchronizer
from ros_x_habitat.msg import PointGoalWithGPSCompass, DepthImage
from sensor_msgs.msg import Image
from cv_bridge import CvBridge
import cv2
from PIL import Image as PILImage
from n... | 0 | 0 | 0 | 19,425 | 0 | 1,679 | 0 | 321 | 508 |
c9531b3c2f83920008aaf29bed3e2590a463efbf | 2,265 | py | Python | src/didery/controllers/static.py | SmithSamuelM/didery | 8181cd2dd2aa711d0b559acdc8ba1c7e2e8ba2fb | [
"Apache-2.0"
] | 8 | 2018-09-07T09:26:52.000Z | 2021-01-16T12:22:07.000Z | src/didery/controllers/static.py | SmithSamuelM/didery | 8181cd2dd2aa711d0b559acdc8ba1c7e2e8ba2fb | [
"Apache-2.0"
] | 184 | 2018-04-19T17:46:02.000Z | 2019-05-21T19:04:30.000Z | src/didery/controllers/static.py | SmithSamuelM/didery | 8181cd2dd2aa711d0b559acdc8ba1c7e2e8ba2fb | [
"Apache-2.0"
] | 3 | 2018-09-26T19:16:30.000Z | 2018-12-18T18:50:40.000Z | # ================================================== #
# DASHBOARD #
# ================================================== #
# Author: Brady Hammond #
# Created: 05/04/2018 #
# Last Edited: ... | 39.736842 | 80 | 0.381457 | # ================================================== #
# DASHBOARD #
# ================================================== #
# Author: Brady Hammond #
# Created: 05/04/2018 #
# Last Edited: ... | 0 | 0 | 0 | 1,281 | 0 | 0 | 0 | -25 | 89 |
c72a4448e4129fda1ce176b0155b4e9ef10901e5 | 1,234 | py | Python | app.py | jmuelbert/SciHubEVA | 96c5f623d5710806d3ff224f2e6f6ba83e75de56 | [
"MIT"
] | null | null | null | app.py | jmuelbert/SciHubEVA | 96c5f623d5710806d3ff224f2e6f6ba83e75de56 | [
"MIT"
] | 5 | 2021-03-31T20:10:22.000Z | 2022-03-12T00:54:40.000Z | app.py | jmuelbert/SciHubEVA | 96c5f623d5710806d3ff224f2e6f6ba83e75de56 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import locale
from PySide2.QtCore import Qt, QTranslator
from PySide2.QtGui import QGuiApplication, QIcon, QFont
from scihubeva.scihubeva_dialog import SciHubEVADialog
if hasattr(Qt, 'AA_EnableHighDpiScaling'):
QGuiApplication.setAttribute(Qt.AA... | 29.380952 | 101 | 0.73906 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import locale
from PySide2.QtCore import Qt, QTranslator
from PySide2.QtGui import QGuiApplication, QIcon, QFont
from scihubeva.scihubeva_dialog import SciHubEVADialog
from scihubeva.utils import *
import scihubeva.resources
if hasattr(Qt, 'AA_Enab... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 13 | 45 |
718fcbeaca7ad960cba411e1d228ff504c056497 | 531 | py | Python | hass_ci_ignore.py | mikevansighem/homeassistant | 40d1c89113c9bc5ff479bc7374d077027642401b | [
"MIT"
] | 1 | 2021-09-12T17:51:38.000Z | 2021-09-12T17:51:38.000Z | hass_ci_ignore.py | mikevansighem/homeassistant | 40d1c89113c9bc5ff479bc7374d077027642401b | [
"MIT"
] | 54 | 2021-09-19T08:20:53.000Z | 2022-03-28T18:22:25.000Z | hass_ci_ignore.py | mikevansighem/homeassistant | 40d1c89113c9bc5ff479bc7374d077027642401b | [
"MIT"
] | null | null | null | # A basic script to remove any part of the configuration that is described in "hassci"
#Open the file
with open(r'configuration.yaml', 'r') as file:
data = file.read()
# Open ignore file
with open('.hass_ci') as ignore_file:
# Open ignore file and replace matches line by line
for search_t... | 27.947368 | 86 | 0.681733 | # A basic script to remove any part of the configuration that is described in "hassci"
#Open the file
with open(r'configuration.yaml', 'r') as file:
data = file.read()
# Open ignore file
with open('.hass_ci') as ignore_file:
# Open ignore file and replace matches line by line
for search_t... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3189f2abd2559448f78a1d712c311f6a95570583 | 16,948 | py | Python | test/urlobject_test.py | vartagg/urlblocks-new | b6c34ea9cd46ead2b0b1e5479b5b69e3a781cbfe | [
"Unlicense"
] | null | null | null | test/urlobject_test.py | vartagg/urlblocks-new | b6c34ea9cd46ead2b0b1e5479b5b69e3a781cbfe | [
"Unlicense"
] | null | null | null | test/urlobject_test.py | vartagg/urlblocks-new | b6c34ea9cd46ead2b0b1e5479b5b69e3a781cbfe | [
"Unlicense"
] | null | null | null | from urlblocks.six import print_
def dictsort(d):
"""``repr()`` a dictionary with sorted key/value pairs, for doctests."""
items = sorted(d.items())
print_('{' + ', '.join('%r: %r' % (k, v) for k, v in items) + '}')
| 44.020779 | 108 | 0.66645 | import platform
import doctest
import unittest
from nose.tools import assert_raises
from urlblocks import urlblocks as urlblocks_module
from urlblocks import URL
from urlblocks.six import text_type, u, print_
def dictsort(d):
"""``repr()`` a dictionary with sorted key/value pairs, for doctests."""
items = so... | 0 | 0 | 0 | 16,373 | 0 | 0 | 0 | 44 | 294 |
f05f80d6e34a297a39e3d791591e9a691c17b6ec | 572 | py | Python | src/Chapter11/Exercise2.py | djeada/Python-For-Informatics | fc93cb60b6c81ee98b82b76934d39930a0c323d0 | [
"MIT"
] | null | null | null | src/Chapter11/Exercise2.py | djeada/Python-For-Informatics | fc93cb60b6c81ee98b82b76934d39930a0c323d0 | [
"MIT"
] | null | null | null | src/Chapter11/Exercise2.py | djeada/Python-For-Informatics | fc93cb60b6c81ee98b82b76934d39930a0c323d0 | [
"MIT"
] | null | null | null | """
Exercise 2
Write a program to look for lines of the form
New Revision: 39772
And extract the number from each of the lines using a regular expression and
the findall() method. Compute the average of the numbers and print out the
average.
Enter file:mbox.txt
38549.7949721
Enter file:mbox-short.txt
39756.9259259
""... | 21.185185 | 76 | 0.701049 | """
Exercise 2
Write a program to look for lines of the form
New Revision: 39772
And extract the number from each of the lines using a regular expression and
the findall() method. Compute the average of the numbers and print out the
average.
Enter file:mbox.txt
38549.7949721
Enter file:mbox-short.txt
39756.9259259
""... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6dfb198298ffa10c994027b9895b4b8eb50d0e0c | 11,218 | py | Python | circle_vp.py | Prajwal-Prathiksh/Panel_Methods | 387275a2791f616e5cd53e1713c409acc47f8f0a | [
"MIT"
] | null | null | null | circle_vp.py | Prajwal-Prathiksh/Panel_Methods | 387275a2791f616e5cd53e1713c409acc47f8f0a | [
"MIT"
] | null | null | null | circle_vp.py | Prajwal-Prathiksh/Panel_Methods | 387275a2791f616e5cd53e1713c409acc47f8f0a | [
"MIT"
] | null | null | null | ###########################################################################
# Imports
###########################################################################
# Standard library imports
import time as time
import numpy as np
import math as math
import matplotlib.pyplot as plt
from matplotlib import path
# Local im... | 30.734247 | 83 | 0.584953 | ###########################################################################
# Imports
###########################################################################
# Standard library imports
import argparse
import time as time
import numpy as np
import math as math
import matplotlib.pyplot as plt
from matplotlib import p... | 0 | 0 | 0 | 0 | 0 | 1,251 | 0 | -1 | 67 |
30d5b7f4cd7dad7609afa473bd961873ddbb194d | 4,674 | py | Python | msldap/authentication/kerberos/multiplexor.py | blshkv/msldap | 435601df85faa407793555ed0da582aa709e3be1 | [
"MIT"
] | 1 | 2021-11-08T09:11:22.000Z | 2021-11-08T09:11:22.000Z | msldap/authentication/kerberos/multiplexor.py | blshkv/msldap | 435601df85faa407793555ed0da582aa709e3be1 | [
"MIT"
] | null | null | null | msldap/authentication/kerberos/multiplexor.py | blshkv/msldap | 435601df85faa407793555ed0da582aa709e3be1 | [
"MIT"
] | null | null | null |
##
##
## Interface to allow remote kerberos authentication via Multiplexor
##
##
##
##
##
## TODO: RPC auth type is not implemented or tested!!!!
# mutual auth not supported
# encryption is always on
# we dont get the output flags back (lack of time to do the multiplexor protocol... TODO
| 29.961538 | 116 | 0.735344 |
##
##
## Interface to allow remote kerberos authentication via Multiplexor
##
##
##
##
##
## TODO: RPC auth type is not implemented or tested!!!!
from msldap.authentication.spnego.asn1_structs import KRB5Token
from msldap.authentication.kerberos.gssapi import get_gssapi, GSSWrapToken, KRB5_MECH_INDEP_TOKEN
from min... | 0 | 0 | 2,029 | 1,864 | 0 | 0 | 0 | 284 | 202 |
38fce3bd5985202b03c539465a04b5355411b99c | 6,739 | py | Python | plugins/modules/firewall_rule.py | tnaganawa/ansible-collections-tungstenfabric | 548f5233e7ffb9dd19373963ecd79765c6cdd1db | [
"Apache-2.0"
] | 2 | 2020-10-26T10:49:19.000Z | 2021-02-04T10:02:40.000Z | plugins/modules/firewall_rule.py | tnaganawa/ansible-collections-tungstenfabric | 548f5233e7ffb9dd19373963ecd79765c6cdd1db | [
"Apache-2.0"
] | 3 | 2021-02-04T11:40:31.000Z | 2021-02-13T18:27:18.000Z | plugins/modules/firewall_rule.py | tnaganawa/ansible-collections-tungstenfabric | 548f5233e7ffb9dd19373963ecd79765c6cdd1db | [
"Apache-2.0"
] | 1 | 2021-02-04T10:02:46.000Z | 2021-02-04T10:02:46.000Z | #!/usr/bin/python
# Copyright: (c) 2020, Tatsuya Naganawa <tatsuyan201101@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = '''
---
mo... | 30.493213 | 150 | 0.630657 | #!/usr/bin/python
# Copyright: (c) 2020, Tatsuya Naganawa <tatsuyan201101@gmail.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMENTATION = '''
---
mo... | 0 | 0 | 0 | 0 | 0 | 4,462 | 0 | 93 | 157 |
98c88d01d58e03405eb7ae9a6afce512ca4d2ba3 | 3,404 | py | Python | tests/unit/bokeh/models/test_axes.py | g-parki/bokeh | 664ead5306bba64609e734d4105c8aa8cfb76d81 | [
"BSD-3-Clause"
] | null | null | null | tests/unit/bokeh/models/test_axes.py | g-parki/bokeh | 664ead5306bba64609e734d4105c8aa8cfb76d81 | [
"BSD-3-Clause"
] | null | null | null | tests/unit/bokeh/models/test_axes.py | g-parki/bokeh | 664ead5306bba64609e734d4105c8aa8cfb76d81 | [
"BSD-3-Clause"
] | null | null | null | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2022, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | 38.247191 | 86 | 0.439189 | #-----------------------------------------------------------------------------
# Copyright (c) 2012 - 2022, Anaconda, Inc., and Bokeh Contributors.
# All rights reserved.
#
# The full license is in the file LICENSE.txt, distributed with this software.
#-------------------------------------------------------------------... | 0 | 0 | 0 | 0 | 0 | 1,483 | 0 | 72 | 218 |
a478619e6914d1e1305e3507e52c36a7ab9360ac | 887 | py | Python | swarms/test/test_results.py | swarms/python-client | d5b39b5304143266da48c9900c1b605e37e96912 | [
"MIT"
] | 5 | 2017-11-07T19:34:57.000Z | 2017-11-15T12:07:29.000Z | swarms/test/test_results.py | swarms/python-client | d5b39b5304143266da48c9900c1b605e37e96912 | [
"MIT"
] | 5 | 2017-11-22T12:24:37.000Z | 2018-02-10T15:31:21.000Z | swarms/test/test_results.py | swarms/python-client | d5b39b5304143266da48c9900c1b605e37e96912 | [
"MIT"
] | 2 | 2018-02-10T15:14:10.000Z | 2018-04-17T08:11:52.000Z | import unittest
if __name__ == '__main__':
unittest.main()
| 22.175 | 70 | 0.461105 | import unittest
from ..sdk import Client, Results
from . import config
class ResultsTest(unittest.TestCase):
client = Client(config.base_url, config.username, config.password)
results = Results(client)
def test_approve(self):
self.results.approve({
"_links": {
"approve... | 0 | 0 | 0 | 743 | 0 | 0 | 0 | 11 | 67 |
de655777ca8f445cac9d75d319feab564d472995 | 4,942 | py | Python | src/core/utils.py | Viewly/alpha-2 | 6b6d827197489164d8c4bde4f4d591dcec5a2163 | [
"MIT"
] | null | null | null | src/core/utils.py | Viewly/alpha-2 | 6b6d827197489164d8c4bde4f4d591dcec5a2163 | [
"MIT"
] | 1 | 2021-05-07T06:26:16.000Z | 2021-05-07T06:26:16.000Z | src/core/utils.py | Viewly/alpha-2 | 6b6d827197489164d8c4bde4f4d591dcec5a2163 | [
"MIT"
] | null | null | null | import os
import shutil
from contextlib import suppress
logger = None
def ensure_directory(directory, force_recreate=True):
""" Ensure directory will nuke provided path, and create a fresh directory.
Args:
directory (str): A nested path we want to ensure.
force_recreate (bool): If True, it ... | 26.427807 | 89 | 0.630716 | import hashlib
import os
import shutil
from concurrent.futures import ThreadPoolExecutor, as_completed
from contextlib import suppress
from functools import wraps
from typing import List, Any, Union
from funcy import contextmanager
from toolz import keyfilter
logger = None
def sha1sum(filename):
BLOCKSIZE = 655... | 0 | 837 | 0 | 0 | 1,202 | 765 | 0 | 72 | 365 |
574ec9c1bd4120bbf01ba6b4f5112f48fc81ba49 | 7,059 | py | Python | tools/convert_settings.py | sharvil/basis | 58c4c88c69d42ed00082f9b3a9b032603caf5f06 | [
"Apache-2.0"
] | 2 | 2016-04-25T06:48:53.000Z | 2021-05-06T20:24:49.000Z | tools/convert_settings.py | sharvil/basis | 58c4c88c69d42ed00082f9b3a9b032603caf5f06 | [
"Apache-2.0"
] | null | null | null | tools/convert_settings.py | sharvil/basis | 58c4c88c69d42ed00082f9b3a9b032603caf5f06 | [
"Apache-2.0"
] | 5 | 2015-01-21T05:23:29.000Z | 2019-04-05T00:16:53.000Z | #!/usr/bin/python
import math
ANGLE_FACTOR = 2 * math.pi / 40000.0
SPEED_FACTOR = 1 / 1000.0
if __name__ == '__main__':
main()
| 42.017857 | 125 | 0.702791 | #!/usr/bin/python
import argparse
import collections
import json
import math
import os
import struct
import sys
ANGLE_FACTOR = 2 * math.pi / 40000.0
SPEED_FACTOR = 1 / 1000.0
def parseConfig(settingsFile):
settings = {}
curSection = None
lines = [x.strip() for x in settingsFile.readlines()]
for line in lines... | 0 | 0 | 0 | 0 | 0 | 6,730 | 0 | -50 | 248 |
a197e0534d286fb5df7f6e049547cd6674633bc9 | 7,596 | py | Python | .kokoro/trampoline_windows.py | directionless/google-cloud-ruby | bb7c09406b23de5223897d92edc63c21cd44f471 | [
"Apache-2.0"
] | 8 | 2021-04-24T02:35:09.000Z | 2022-01-29T03:05:45.000Z | .kokoro/trampoline_windows.py | directionless/google-cloud-ruby | bb7c09406b23de5223897d92edc63c21cd44f471 | [
"Apache-2.0"
] | 1 | 2019-10-18T15:31:34.000Z | 2019-10-18T17:25:07.000Z | .kokoro/trampoline_windows.py | directionless/google-cloud-ruby | bb7c09406b23de5223897d92edc63c21cd44f471 | [
"Apache-2.0"
] | 3 | 2017-07-20T20:10:34.000Z | 2022-03-31T03:17:01.000Z | #!/usr/env/bin python3
# Copyright 2017 Google 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 ... | 42.674157 | 117 | 0.640864 | #!/usr/env/bin python3
# Copyright 2017 Google 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 ... | 0 | 0 | 0 | 0 | 0 | 3,746 | 0 | -37 | 340 |
8a3df74e4b5fbe81ecc184e48fc757183d8b98da | 2,639 | py | Python | python_data/fintech/funnel_monitor_multiday_v3.py | younhapan/ystdoc | a3fee3c48fc4e35b26b70ab7d9f123be059a4a7a | [
"Apache-2.0"
] | null | null | null | python_data/fintech/funnel_monitor_multiday_v3.py | younhapan/ystdoc | a3fee3c48fc4e35b26b70ab7d9f123be059a4a7a | [
"Apache-2.0"
] | null | null | null | python_data/fintech/funnel_monitor_multiday_v3.py | younhapan/ystdoc | a3fee3c48fc4e35b26b70ab7d9f123be059a4a7a | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
from __future__ import division
import sys
import os
CURRENT_DIR = os.path.abspath(os.path.dirname(__file__))
ADD_PATH = "%s/../"%(CURRENT_DIR)
sys.path.append(ADD_PATH)
from tools.mail import MyEmail
from tools.html import html_with_style
DATA_PATH = "%s/../data/mysql" % (CURRENT_DIR)
send_str = ''... | 35.186667 | 164 | 0.613869 | # encoding: utf-8
from __future__ import division
import sys
import os
import time
import datetime
import pandas as pd
import numpy as np
import math
CURRENT_DIR = os.path.abspath(os.path.dirname(__file__))
ADD_PATH = "%s/../"%(CURRENT_DIR)
sys.path.append(ADD_PATH)
from tools.mail import MyEmail
from tools.html impor... | 399 | 0 | 0 | 0 | 0 | 1,520 | 0 | -31 | 132 |
4826a6c5e8a399c116c685321697eb6d8aca5611 | 11,037 | py | Python | neutron/tests/functional/services/trunk/drivers/openvswitch/agent/test_trunk_manager.py | brandonlogan/neutron | 57364544aa8b0e7cd9d73550f287bcad574ba08c | [
"Apache-2.0"
] | 1 | 2017-09-10T09:57:35.000Z | 2017-09-10T09:57:35.000Z | neutron/tests/functional/services/trunk/drivers/openvswitch/agent/test_trunk_manager.py | brandonlogan/neutron | 57364544aa8b0e7cd9d73550f287bcad574ba08c | [
"Apache-2.0"
] | null | null | null | neutron/tests/functional/services/trunk/drivers/openvswitch/agent/test_trunk_manager.py | brandonlogan/neutron | 57364544aa8b0e7cd9d73550f287bcad574ba08c | [
"Apache-2.0"
] | 1 | 2015-05-05T14:41:11.000Z | 2015-05-05T14:41:11.000Z | # 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 applicable law or agreed to i... | 43.972112 | 79 | 0.655251 | # 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 applicable law or agreed to i... | 0 | 0 | 0 | 9,707 | 0 | 0 | 0 | 201 | 337 |
1960d34bb0ffc10045ff04d14a1b3e8ca3d3eb73 | 115 | py | Python | examples/aiohttp/starwars/starwars/__init__.py | erezsh/tartiflette | c945b02e9025e2524393c1eaec2191745bfc38f4 | [
"MIT"
] | null | null | null | examples/aiohttp/starwars/starwars/__init__.py | erezsh/tartiflette | c945b02e9025e2524393c1eaec2191745bfc38f4 | [
"MIT"
] | null | null | null | examples/aiohttp/starwars/starwars/__init__.py | erezsh/tartiflette | c945b02e9025e2524393c1eaec2191745bfc38f4 | [
"MIT"
] | null | null | null | from starwars.sdl import STARWARSTIFLETTE
__all__ = ["STARWARSTIFLETTE"]
| 23 | 41 | 0.834783 | from starwars.resolvers import resolvers
from starwars.sdl import STARWARSTIFLETTE
__all__ = ["STARWARSTIFLETTE"]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 19 | 22 |
180b06646cf19c497c29cdd0098e87bc487b8b89 | 2,585 | py | Python | src/examples/tcp.py | ettoreleandrotognoli/python-shared | fbee6d9932e8ed52005d3e96a9f6ee79393e13ff | [
"BSD-3-Clause"
] | null | null | null | src/examples/tcp.py | ettoreleandrotognoli/python-shared | fbee6d9932e8ed52005d3e96a9f6ee79393e13ff | [
"BSD-3-Clause"
] | 1 | 2017-11-28T09:21:01.000Z | 2017-11-28T09:21:01.000Z | src/examples/tcp.py | ettoreleandrotognoli/python-shared | fbee6d9932e8ed52005d3e96a9f6ee79393e13ff | [
"BSD-3-Clause"
] | null | null | null | import multiprocessing
import time
from rx.testing import marbles
m = marbles
from rx.concurrency import ThreadPoolScheduler
address = '0.0.0.0'
optimal_thread_count = multiprocessing.cpu_count() + 1
pool_scheduler = ThreadPoolScheduler(optimal_thread_count)
if __name__ == '__main__':
try:
server, m... | 27.5 | 61 | 0.630174 | import json
import multiprocessing
import time
from rx.testing import marbles
m = marbles
from pyshared.core.ref import LocalSharedResourcesManager
from pyshared.core.ref import ResourcesManagerListenerAdapter
from pyshared.core.ref import default_command_mapper
from pyshared.core.rx import ReactiveSharedResourcesSer... | 0 | 546 | 0 | 0 | 0 | 1,005 | 0 | 210 | 267 |
590f98ecefded6017c5e8e01e91e80e62d78afc1 | 34,666 | py | Python | models/polytope_constraints.py | mbroso/constraintnet_facial_detect | 3f53a4694f3c6b229679ef9014ac98573f45fd43 | [
"BSD-3-Clause"
] | null | null | null | models/polytope_constraints.py | mbroso/constraintnet_facial_detect | 3f53a4694f3c6b229679ef9014ac98573f45fd43 | [
"BSD-3-Clause"
] | null | null | null | models/polytope_constraints.py | mbroso/constraintnet_facial_detect | 3f53a4694f3c6b229679ef9014ac98573f45fd43 | [
"BSD-3-Clause"
] | null | null | null | """This file summarizes functionality for the construction of ConstraintNet with
output-constraints in form of convex polytopes. It is possible to constrain
output-parts to different convex polytopes independently.
The functionality for modelling the output-constraints consists namely of:
- Functors to create a ... | 41.122183 | 96 | 0.60855 | """This file summarizes functionality for the construction of ConstraintNet with
output-constraints in form of convex polytopes. It is possible to constrain
output-parts to different convex polytopes independently.
The functionality for modelling the output-constraints consists namely of:
- Functors to create a ... | 0 | 5,929 | 0 | 21,959 | 0 | 0 | 0 | 1 | 206 |
8ba910386837b07f76ab57cbfda10782cf3dacef | 2,785 | py | Python | src/CookieJarRun.py | KaelenCarling/CookieJar | b4c7026b3b50af6c60338208aab1813efb466944 | [
"Apache-2.0"
] | 2 | 2021-05-05T20:08:57.000Z | 2021-05-05T20:09:00.000Z | src/CookieJarRun.py | KaelenCarling/CookieJar | b4c7026b3b50af6c60338208aab1813efb466944 | [
"Apache-2.0"
] | null | null | null | src/CookieJarRun.py | KaelenCarling/CookieJar | b4c7026b3b50af6c60338208aab1813efb466944 | [
"Apache-2.0"
] | 1 | 2021-05-05T18:19:11.000Z | 2021-05-05T18:19:11.000Z |
if __name__ == "__main__":
root = Tk()
# MainApplication(root).pack(side='top', fill='both', expand=True)
MainApplication(root)
root.mainloop()
| 31.647727 | 156 | 0.667864 | import tkinter
from FireFoxCookieMonster import *
from tkinter import *
from tkinter.ttk import *
def getCookies():
databaseLocations = findFirefoxCookieDatabase()
for databaseLocation in databaseLocations:
print("Copying from " + databaseLocation)
firefoxCookieMonster = FireFoxCookieMonster(... | 0 | 0 | 0 | 1,893 | 0 | 560 | 0 | 10 | 157 |
c6f65ae054762a1b75b567b02da9b21b6b1c50bd | 1,123 | py | Python | examples/wf/pymtbl_wf_analyze.py | BuloZB/pymtbl | 914b041a48da9594d1bdac997bae378bdd6b6f58 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | examples/wf/pymtbl_wf_analyze.py | BuloZB/pymtbl | 914b041a48da9594d1bdac997bae378bdd6b6f58 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | examples/wf/pymtbl_wf_analyze.py | BuloZB/pymtbl | 914b041a48da9594d1bdac997bae378bdd6b6f58 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2018-03-04T03:12:33.000Z | 2018-03-04T03:12:33.000Z | #!/usr/bin/env python
import sys
if __name__ == '__main__':
if not len(sys.argv) == 3:
sys.stderr.write('Usage: %s <TXT FILE> <MTBL FILE>\n' % sys.argv[0])
sys.exit(1)
main(sys.argv[1], sys.argv[2])
| 27.390244 | 76 | 0.619768 | #!/usr/bin/env python
import string
import sys
import mtbl
def merge_func(key, val0, val1):
i0 = mtbl.varint_decode(val0)
i1 = mtbl.varint_decode(val1)
return mtbl.varint_encode(i0 + i1)
def main(txt_fname, mtbl_fname):
txt = open(txt_fname)
sorter = mtbl.sorter(merge_func)
writer = mtbl.wri... | 0 | 0 | 0 | 0 | 0 | 825 | 0 | -18 | 92 |
e7f0bc0c3d48e5be1311eacb7034093e6b554f25 | 1,689 | py | Python | responsibleai/tests/tools/shared/test_versions.py | ms-kashyap/responsible-ai-widgets | 56906fb30d9b81a5edc5443d24312bc2d32e5165 | [
"MIT"
] | 119 | 2021-12-02T21:00:47.000Z | 2022-03-31T06:44:31.000Z | responsibleai/tests/tools/shared/test_versions.py | ms-kashyap/responsible-ai-widgets | 56906fb30d9b81a5edc5443d24312bc2d32e5165 | [
"MIT"
] | 293 | 2021-11-30T16:45:49.000Z | 2022-03-31T23:57:13.000Z | responsibleai/tests/tools/shared/test_versions.py | ms-kashyap/responsible-ai-widgets | 56906fb30d9b81a5edc5443d24312bc2d32e5165 | [
"MIT"
] | 28 | 2021-12-07T17:28:04.000Z | 2022-03-31T07:47:11.000Z | # Copyright (c) Microsoft Corporation
# Licensed under the MIT License.
| 27.241935 | 72 | 0.598579 | # Copyright (c) Microsoft Corporation
# Licensed under the MIT License.
import re
import pytest
import semver
from responsibleai._tools.shared.versions import CausalVersions
class TestVersions:
@pytest.mark.parametrize(
'versions_class',
[
CausalVersions,
]
)
def te... | 0 | 1,409 | 0 | -2 | 0 | 0 | 0 | 14 | 195 |
7364ec5a8ae036994247c24918d6f8d961e42d13 | 1,341 | py | Python | PerfTest/NCEP_TimeSeries.py | HDFGroup/hdflab_examples | 1570881ea0aff7bdf8846942308a3e0554d13842 | [
"MIT"
] | 3 | 2018-07-29T09:01:00.000Z | 2019-10-23T03:06:39.000Z | PerfTest/NCEP_TimeSeries.py | HDFGroup/hdflab_examples | 1570881ea0aff7bdf8846942308a3e0554d13842 | [
"MIT"
] | null | null | null | PerfTest/NCEP_TimeSeries.py | HDFGroup/hdflab_examples | 1570881ea0aff7bdf8846942308a3e0554d13842 | [
"MIT"
] | 1 | 2018-09-20T13:44:04.000Z | 2018-09-20T13:44:04.000Z | import sys
import random
import h5pyd
import numpy as np
#
# Extracts a time series for the NCEP dataset
#
# choose random x,y coordinate for the time series
shape = (7850, 720, 1440)
x_index = random.randint(0, shape[2]-1)
y_index = random.randint(0, shape[1]-1)
end_index = shape[0]
if len(sys.argv) > 1:
if sy... | 27.9375 | 87 | 0.648024 | import sys
import random
import h5pyd
import numpy as np
#
# Extracts a time series for the NCEP dataset
#
# choose random x,y coordinate for the time series
shape = (7850, 720, 1440)
x_index = random.randint(0, shape[2]-1)
y_index = random.randint(0, shape[1]-1)
end_index = shape[0]
if len(sys.argv) > 1:
if sy... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
72faed421ef0180af36c32fcb294bf5bb3f9e84e | 1,159 | py | Python | ravepay/settings.py | gbozee/django-ravepay | cc9fba3440457ee2941bee2db464520eb00ad98e | [
"MIT"
] | 7 | 2017-11-22T23:53:49.000Z | 2021-05-03T22:20:44.000Z | ravepay/settings.py | iAmKabiru/django-ravepay | 2d13347300b1d9ab62a23c957e29a33cfddde796 | [
"MIT"
] | 5 | 2020-02-11T21:49:35.000Z | 2021-06-17T10:20:43.000Z | ravepay/settings.py | iAmKabiru/django-ravepay | 2d13347300b1d9ab62a23c957e29a33cfddde796 | [
"MIT"
] | 7 | 2017-12-27T12:28:48.000Z | 2021-05-03T19:54:47.000Z | from django.conf import settings
import os
RAVEPAY_SECRET_KEY = getattr(
settings, "RAVEPAY_SECRET_KEY", os.getenv("RAVEPAY_SECRET_KEY", "")
)
RAVEPAY_PUBLIC_KEY = getattr(
settings, "RAVEPAY_PUBLIC_KEY", os.getenv("RAVEPAY_PUBLIC_KEY", "")
)
ALLOWED_HOSTS = getattr(settings, "ALLOWED_HOSTS", [])
RAVEPAY_WEBHO... | 42.925926 | 86 | 0.791199 | from django.conf import settings
import os
RAVEPAY_SECRET_KEY = getattr(
settings, "RAVEPAY_SECRET_KEY", os.getenv("RAVEPAY_SECRET_KEY", "")
)
RAVEPAY_PUBLIC_KEY = getattr(
settings, "RAVEPAY_PUBLIC_KEY", os.getenv("RAVEPAY_PUBLIC_KEY", "")
)
ALLOWED_HOSTS = getattr(settings, "ALLOWED_HOSTS", [])
RAVEPAY_WEBHO... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3f0cd4a144e337c91c0b0851099666f5b5dbd8bd | 1,794 | py | Python | test/aqua/test_eoh.py | chunfuchen/aqua | fde435203a2799433a4e50897554fa226c8ff1dc | [
"Apache-2.0"
] | null | null | null | test/aqua/test_eoh.py | chunfuchen/aqua | fde435203a2799433a4e50897554fa226c8ff1dc | [
"Apache-2.0"
] | null | null | null | test/aqua/test_eoh.py | chunfuchen/aqua | fde435203a2799433a4e50897554fa226c8ff1dc | [
"Apache-2.0"
] | 2 | 2020-02-13T02:17:58.000Z | 2020-08-09T07:56:25.000Z | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | 29.409836 | 97 | 0.688963 | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any... | 0 | 0 | 0 | 901 | 0 | 0 | 0 | 143 | 157 |
a18e8308da8486a770e2891eeb29e9bbed3cb732 | 610 | py | Python | server/migrations/versions/26e723d032b1_dataset_add_created_at.py | multi-coop/catalogage-donnees | 1d70401ff6c7b01ec051460a253cb105adf65911 | [
"MIT"
] | null | null | null | server/migrations/versions/26e723d032b1_dataset_add_created_at.py | multi-coop/catalogage-donnees | 1d70401ff6c7b01ec051460a253cb105adf65911 | [
"MIT"
] | 14 | 2022-01-25T17:56:52.000Z | 2022-01-28T17:47:59.000Z | server/migrations/versions/26e723d032b1_dataset_add_created_at.py | multi-coop/catalogage-donnees | 1d70401ff6c7b01ec051460a253cb105adf65911 | [
"MIT"
] | null | null | null | """dataset_add_created_at
Revision ID: 26e723d032b1
Revises: 30474ebed7a2
Create Date: 2022-03-16 15:50:00.805743
"""
# revision identifiers, used by Alembic.
revision = "26e723d032b1"
down_revision = "30474ebed7a2"
branch_labels = None
depends_on = None
| 19.0625 | 56 | 0.654098 | """dataset_add_created_at
Revision ID: 26e723d032b1
Revises: 30474ebed7a2
Create Date: 2022-03-16 15:50:00.805743
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "26e723d032b1"
down_revision = "30474ebed7a2"
branch_labels = None
depends_on = None
def upgrade()... | 0 | 0 | 0 | 0 | 0 | 257 | 0 | 3 | 90 |
301336fa9e8bd0f9cddaa1051bfb04ece382cdc8 | 1,336 | py | Python | contours new.py | guyfromthesky/OCR-Project | c126c9844ddecbeefd1de6ae49074d3b56062df3 | [
"MIT"
] | null | null | null | contours new.py | guyfromthesky/OCR-Project | c126c9844ddecbeefd1de6ae49074d3b56062df3 | [
"MIT"
] | null | null | null | contours new.py | guyfromthesky/OCR-Project | c126c9844ddecbeefd1de6ae49074d3b56062df3 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
img_path = r'C:\Users\evan\Documents\GitHub\OCR-Project\BAKR\Crop_IMG__1651113545.png'
import cv2;
import numpy as np;
# Read image
image = cv2.imread(img_path)
cv2.waitKey(0)
# Grayscale
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
# Find Canny edges
edged = cv2.Canny(gray, 20, 2... | 24.290909 | 86 | 0.747754 | import cv2
import numpy as np
img_path = r'C:\Users\evan\Documents\GitHub\OCR-Project\BAKR\Crop_IMG__1651113545.png'
import cv2;
import numpy as np;
# Read image
image = cv2.imread(img_path)
cv2.waitKey(0)
# Grayscale
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
# Find Canny edges
edged = cv2.Canny(gray, 20, 2... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
de173234238504b084701c6804c76ce2b05393e2 | 8,206 | py | Python | bundle/YouCompleteMe/third_party/ycmd/ycmd/request_wrap.py | xiaoyin199/myvim | 910dac2ae265eb4896468d4dd447df4b188ddaf1 | [
"Vim"
] | null | null | null | bundle/YouCompleteMe/third_party/ycmd/ycmd/request_wrap.py | xiaoyin199/myvim | 910dac2ae265eb4896468d4dd447df4b188ddaf1 | [
"Vim"
] | null | null | null | bundle/YouCompleteMe/third_party/ycmd/ycmd/request_wrap.py | xiaoyin199/myvim | 910dac2ae265eb4896468d4dd447df4b188ddaf1 | [
"Vim"
] | null | null | null | # encoding: utf8
#
# Copyright (C) 2014 Google Inc.
#
# This file is part of ycmd.
#
# ycmd is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later vers... | 36.471111 | 80 | 0.677309 | # encoding: utf8
#
# Copyright (C) 2014 Google Inc.
#
# This file is part of ycmd.
#
# ycmd is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later vers... | 18 | 0 | 0 | 5,189 | 0 | 0 | 0 | 157 | 74 |
9b6a1f4320c04cfa1520b5d5adfbae8953ddf82b | 521 | py | Python | cevast/certdb/__init__.py | crocs-muni/cert-validataion-stats | bd61968c0487e634c160f6e25b7bb0eb1bab64fc | [
"MIT"
] | 3 | 2020-06-26T09:31:35.000Z | 2020-06-26T09:32:17.000Z | cevast/certdb/__init__.py | crocs-muni/cert-validataion-stats | bd61968c0487e634c160f6e25b7bb0eb1bab64fc | [
"MIT"
] | null | null | null | cevast/certdb/__init__.py | crocs-muni/cert-validataion-stats | bd61968c0487e634c160f6e25b7bb0eb1bab64fc | [
"MIT"
] | null | null | null | """CertDB is a database managing X.509 certificates."""
__all__ = (
'CertDB',
'CertDBReadOnly',
'CertFileDB',
'CertFileDBReadOnly',
'CertNotAvailableError',
'CertInvalidError',
'CompositeCertDB',
'CompositeCertDBReadOnly',
)
__version__ = '1.1'
__author__ = 'Radim Podola'
from .cert_db... | 27.421053 | 84 | 0.756238 | """CertDB is a database managing X.509 certificates."""
__all__ = (
'CertDB',
'CertDBReadOnly',
'CertFileDB',
'CertFileDBReadOnly',
'CertNotAvailableError',
'CertInvalidError',
'CompositeCertDB',
'CompositeCertDBReadOnly',
)
__version__ = '1.1'
__author__ = 'Radim Podola'
from .cert_db... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
66b94a4f4da0f38a8ab044038a48b3375a219494 | 34,715 | py | Python | mpcpy/units.py | YangyangFu/MPCPy | c9980cbfe7b5ea21b003c2c0bab800099dccf3f1 | [
"BSD-3-Clause-LBNL"
] | 96 | 2017-03-31T09:59:44.000Z | 2022-03-23T18:39:37.000Z | mpcpy/units.py | kuzha/MPCPy | 9f78aa68236f87d39a50de54978c5064f9cc13c6 | [
"BSD-3-Clause-LBNL"
] | 150 | 2017-03-03T17:28:34.000Z | 2021-02-24T20:03:24.000Z | mpcpy/units.py | kuzha/MPCPy | 9f78aa68236f87d39a50de54978c5064f9cc13c6 | [
"BSD-3-Clause-LBNL"
] | 32 | 2017-04-24T18:22:40.000Z | 2022-03-29T17:51:20.000Z | # -*- coding: utf-8 -*-
"""
``units`` classes manage the conversion of units for MPCPy variables. See
documentation on ``variables`` for more information.
"""
#%% Display unit abstract interface
#%% Display unit quantity implementation
#%% Boolean display unit implementation
#%% Temperature display ... | 32.535145 | 75 | 0.658102 | # -*- coding: utf-8 -*-
"""
``units`` classes manage the conversion of units for MPCPy variables. See
documentation on ``variables`` for more information.
"""
from abc import ABCMeta, abstractmethod
import numpy as np
#%% Display unit abstract interface
class _DisplayUnit(object):
__metaclass__ = ABCMeta;
... | 0 | 166 | 0 | 29,448 | 0 | 0 | 0 | 15 | 3,321 |
c5d8549560107cb450a57ac7bf626615ee97a86a | 1,340 | py | Python | hone/tests/csv_utils_test.py | awsrossw/hone | d69dec08ad4dbeb59b6c042443635a2d4937d7c6 | [
"MIT"
] | null | null | null | hone/tests/csv_utils_test.py | awsrossw/hone | d69dec08ad4dbeb59b6c042443635a2d4937d7c6 | [
"MIT"
] | null | null | null | hone/tests/csv_utils_test.py | awsrossw/hone | d69dec08ad4dbeb59b6c042443635a2d4937d7c6 | [
"MIT"
] | null | null | null | import os
import unittest
from hone.utils import csv_utils
dirname = os.path.dirname(__file__)
csv_A_path = os.path.join(dirname, "data", "small_cats_dataset.csv")
csv_B_path = os.path.join(dirname, "data", "comma_test.csv")
small_csv = csv_utils.CSVUtils(csv_A_path)
comma_csv = csv_utils.CSVUtils(csv_B_path)
if __... | 41.875 | 109 | 0.536567 | import os
import unittest
from hone.utils import csv_utils
dirname = os.path.dirname(__file__)
csv_A_path = os.path.join(dirname, "data", "small_cats_dataset.csv")
csv_B_path = os.path.join(dirname, "data", "comma_test.csv")
small_csv = csv_utils.CSVUtils(csv_A_path)
comma_csv = csv_utils.CSVUtils(csv_B_path)
class ... | 0 | 0 | 0 | 955 | 0 | 0 | 0 | 0 | 23 |
816f2f8179bff8e2c67506f066639890aa090d22 | 2,209 | py | Python | testing.py | agakshat/dagger-pg | 89f937e8a9e4876c7e8f73658d3618d590971565 | [
"MIT"
] | 4 | 2020-05-14T07:00:38.000Z | 2021-11-19T23:41:15.000Z | testing.py | agakshat/dagger-pg | 89f937e8a9e4876c7e8f73658d3618d590971565 | [
"MIT"
] | null | null | null | testing.py | agakshat/dagger-pg | 89f937e8a9e4876c7e8f73658d3618d590971565 | [
"MIT"
] | 2 | 2019-07-05T22:46:10.000Z | 2020-10-25T08:54:13.000Z |
if __name__=='__main__':
main() | 36.213115 | 87 | 0.594839 | import gym
import torch
import numpy as np
from networks import ActorNetwork
import argparse
from torch.autograd import Variable
def parse_arguments():
# Command-line flags are defined here.
parser = argparse.ArgumentParser()
parser.add_argument('--env-name', default='LunarLander-v2',
... | 0 | 0 | 0 | 0 | 0 | 1,977 | 0 | -3 | 201 |
bf5d944a7b36974f0c9c2523aa6b947781152c8f | 1,042 | py | Python | operations/fleet_management/migrations/0030_auto_20180320_1535.py | kaizer88/emps | 2669b32c46befcf1a19390fb25013817e6b00980 | [
"MIT"
] | null | null | null | operations/fleet_management/migrations/0030_auto_20180320_1535.py | kaizer88/emps | 2669b32c46befcf1a19390fb25013817e6b00980 | [
"MIT"
] | null | null | null | operations/fleet_management/migrations/0030_auto_20180320_1535.py | kaizer88/emps | 2669b32c46befcf1a19390fb25013817e6b00980 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-03-20 13:35
from __future__ import unicode_literals
| 32.5625 | 161 | 0.644914 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.7 on 2018-03-20 13:35
from __future__ import unicode_literals
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fleet_management', '0029_vehicledriver_reason'),
]
op... | 0 | 0 | 0 | 833 | 0 | 0 | 0 | 27 | 68 |
8f1ef3bb41841eef6301aa9a3f84e7f3cade3a1b | 32,503 | py | Python | qualcoder/merge_projects.py | FantasqueX/QualCoder | 11a9c593fab0bbcf9f55b14501deee878d264e8d | [
"MIT"
] | null | null | null | qualcoder/merge_projects.py | FantasqueX/QualCoder | 11a9c593fab0bbcf9f55b14501deee878d264e8d | [
"MIT"
] | null | null | null | qualcoder/merge_projects.py | FantasqueX/QualCoder | 11a9c593fab0bbcf9f55b14501deee878d264e8d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Copyright (c) 2022 Colin Curtain
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, mer... | 50.945141 | 139 | 0.575362 | # -*- coding: utf-8 -*-
"""
Copyright (c) 2022 Colin Curtain
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, mer... | 0 | 0 | 0 | 30,660 | 0 | 0 | 0 | -14 | 113 |
49d1dad5f4c48818f0f83f49696bf966ba1ac099 | 82 | py | Python | os.py | vishnuhd/k8s-cronjob-python | b7e53f8f9984ff3cbc256b5275345b256ccb0035 | [
"Apache-2.0"
] | null | null | null | os.py | vishnuhd/k8s-cronjob-python | b7e53f8f9984ff3cbc256b5275345b256ccb0035 | [
"Apache-2.0"
] | null | null | null | os.py | vishnuhd/k8s-cronjob-python | b7e53f8f9984ff3cbc256b5275345b256ccb0035 | [
"Apache-2.0"
] | null | null | null | import os
print("Hello",os.getenv('NAME'))
print("Your age is",os.getenv('AGE'))
| 16.4 | 37 | 0.670732 | import os
print("Hello",os.getenv('NAME'))
print("Your age is",os.getenv('AGE'))
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5b7753a7f311460d7b616741278ffa7413e3712c | 2,224 | py | Python | miura/data.py | toumorokoshi/miura | f23e270a9507e5946798b1e897220c9fb1b8d5fa | [
"MIT"
] | 1 | 2017-05-18T11:34:35.000Z | 2017-05-18T11:34:35.000Z | miura/data.py | toumorokoshi/miura | f23e270a9507e5946798b1e897220c9fb1b8d5fa | [
"MIT"
] | null | null | null | miura/data.py | toumorokoshi/miura | f23e270a9507e5946798b1e897220c9fb1b8d5fa | [
"MIT"
] | null | null | null | import re
import yaml
from .exceptions import MiuraException
import logging
logger = logging.getLogger(__name__)
def retrieve_data(file_paths):
"""
passed an iterable list of file_paths, loop through all of them and
generate a dictionary containing all the context
"""
data_dict = {}
for fi... | 31.771429 | 82 | 0.599371 | import os
import re
import yaml
from .exceptions import MiuraException
import logging
logger = logging.getLogger(__name__)
def load_data_from_path(path):
file_paths = load_file_or_directory(path)
return retrieve_data(file_paths)
def load_file_or_directory(path):
"""
given a path, determine if the p... | 0 | 0 | 0 | 0 | 462 | 92 | 0 | -12 | 68 |
1c984379a042e9fd6a8818d0f9d29c518209740c | 6,982 | py | Python | exp_script.py | meelgroup/mgt | ccd51c9094e63eee8234ed7cde128746a481f897 | [
"MIT"
] | 1 | 2020-02-27T19:14:37.000Z | 2020-02-27T19:14:37.000Z | exp_script.py | meelgroup/mgt | ccd51c9094e63eee8234ed7cde128746a481f897 | [
"MIT"
] | null | null | null | exp_script.py | meelgroup/mgt | ccd51c9094e63eee8234ed7cde128746a481f897 | [
"MIT"
] | null | null | null | FILE_GENERAL = "output_file-"
FILE_GENERAL_CMP = "output_file_comparison-"
EXTENSION = ".out"
d = 0.05
FILE_2 = "output_file"
# binomial cofficient, n choosr r
# calculate binary entropy of Bernoulli(p)
# function to parse output file that contains both MGT and LP accuracy and time results
| 30.225108 | 87 | 0.552564 | import ast
import matplotlib.pyplot as plt
from matplotlib import cm
import matplotlib as mpl
from matplotlib.ticker import LinearLocator, FormatStrFormatter
import numpy as np
import os.path
import pandas as pd
import seaborn as sns
import operator as op
from functools import reduce
from setup import DIR # DIR to g... | 0 | 0 | 0 | 0 | 0 | 6,155 | 0 | 44 | 482 |
26869308a0719ae448eb006c4769d94b322635a8 | 894 | py | Python | backend/config/components/auth.py | hnthh/foodgram-project-react | 3383c6a116fded11b4a764b95e6ca4ead03444f3 | [
"MIT"
] | 1 | 2022-02-09T10:42:45.000Z | 2022-02-09T10:42:45.000Z | backend/config/components/auth.py | hnthh/foodgram | 3383c6a116fded11b4a764b95e6ca4ead03444f3 | [
"MIT"
] | null | null | null | backend/config/components/auth.py | hnthh/foodgram | 3383c6a116fded11b4a764b95e6ca4ead03444f3 | [
"MIT"
] | null | null | null | AUTH_USER_MODEL = 'users.User'
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validat... | 28.83871 | 91 | 0.655481 | AUTH_USER_MODEL = 'users.User'
AUTH_PASSWORD_VALIDATORS = [
{
'NAME': 'django.contrib.auth.password_validation.UserAttributeSimilarityValidator',
},
{
'NAME': 'django.contrib.auth.password_validation.MinimumLengthValidator',
},
{
'NAME': 'django.contrib.auth.password_validat... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d4aaa9f499269a7b55947f66eaedbee0e3285e9f | 3,832 | py | Python | stats.py | vlddev/news_downloader | 826ab06ae532fdc829862215c0901399a67e6624 | [
"Apache-2.0"
] | null | null | null | stats.py | vlddev/news_downloader | 826ab06ae532fdc829862215c0901399a67e6624 | [
"Apache-2.0"
] | null | null | null | stats.py | vlddev/news_downloader | 826ab06ae532fdc829862215c0901399a67e6624 | [
"Apache-2.0"
] | null | null | null |
# TODO use https://bitbucket.org/spirit/guess_language
# for language detection | 31.154472 | 112 | 0.59238 | import re
import sys
import logging
from collections import Counter
# TODO use https://bitbucket.org/spirit/guess_language
# for language detection
class TextStats(object):
def __init__(self, text):
self.text = text
self.text_lower = text.lower()
self.words = re.findall(r'\w+', text.lower())
se... | 136 | 0 | 0 | 3,588 | 0 | 0 | 0 | -20 | 111 |
d10a3d88aef5a6ce7c6db2138dda46ee0331ecd1 | 10,992 | py | Python | VideoEncoding/Encoding_H264_OverlayImage/encoding-h264-overlayimage.py | IngridAtMicrosoft/media-services-v3-python | 2eb43f502cd8637961869faf8d0c365ffa1680d2 | [
"MIT"
] | null | null | null | VideoEncoding/Encoding_H264_OverlayImage/encoding-h264-overlayimage.py | IngridAtMicrosoft/media-services-v3-python | 2eb43f502cd8637961869faf8d0c365ffa1680d2 | [
"MIT"
] | null | null | null | VideoEncoding/Encoding_H264_OverlayImage/encoding-h264-overlayimage.py | IngridAtMicrosoft/media-services-v3-python | 2eb43f502cd8637961869faf8d0c365ffa1680d2 | [
"MIT"
] | null | null | null | from datetime import timedelta
from dotenv import load_dotenv
from azure.identity import DefaultAzureCredential
from azure.mgmt.media import AzureMediaServices
from azure.storage.blob import BlobServiceClient
from azure.mgmt.media.models import (Asset, Transform, TransformOutput, StandardEncoderPreset, AacAudio, AacAud... | 40.411765 | 170 | 0.744269 | from datetime import timedelta
from dotenv import load_dotenv
from azure.identity import DefaultAzureCredential
from azure.mgmt.media import AzureMediaServices
from azure.storage.blob import BlobServiceClient
from azure.mgmt.media.models import (
Asset,
Transform,
TransformOutput,
StandardEncoderPreset,
AacAu... | 0 | 0 | 0 | 0 | 0 | 623 | 0 | 32 | 44 |
214372d27e8b106f0a19708dede95d2bbe9fdb00 | 71 | py | Python | reinforcement/__init__.py | SwamyDev/reinforcement | 997f36a193f57b2a4ba34cf7bcee977b10dd1742 | [
"MIT"
] | 7 | 2018-05-15T09:53:18.000Z | 2020-06-28T21:24:49.000Z | reinforcement/__init__.py | SwamyDev/reinforcement | 997f36a193f57b2a4ba34cf7bcee977b10dd1742 | [
"MIT"
] | 7 | 2019-09-08T17:02:56.000Z | 2021-08-25T14:41:20.000Z | reinforcement/__init__.py | SwamyDev/reinforcement | 997f36a193f57b2a4ba34cf7bcee977b10dd1742 | [
"MIT"
] | 1 | 2019-05-07T11:25:29.000Z | 2019-05-07T11:25:29.000Z |
name = "reinforcement"
| 17.75 | 46 | 0.830986 | from reinforcement._version import __version__
name = "reinforcement"
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 25 | 22 |
11de92107fff8f5a01ef8e14f3138244980c3f80 | 29,308 | py | Python | kerfed_api/helpers/shopdoc.py | kerfed/kerfed-api-python | 2824f960fe06c6dd1d060eb3a7a57ceee9082b4f | [
"MIT"
] | null | null | null | kerfed_api/helpers/shopdoc.py | kerfed/kerfed-api-python | 2824f960fe06c6dd1d060eb3a7a57ceee9082b4f | [
"MIT"
] | null | null | null | kerfed_api/helpers/shopdoc.py | kerfed/kerfed-api-python | 2824f960fe06c6dd1d060eb3a7a57ceee9082b4f | [
"MIT"
] | null | null | null | import os
import json
import collections
import numpy as np
import pandas as pd
# in the standard lib
# like regexes but with less annoying wildcards
try:
import webcolors
except BaseException:
webcolors = None
def expand_wildcard(df, key, values):
"""
Expand finish wildcards from our actual materi... | 30.689005 | 77 | 0.52385 | import os
import json
import collections
import numpy as np
import pandas as pd
# in the standard lib
# like regexes but with less annoying wildcards
import re
from fnmatch import fnmatch
try:
import webcolors
except BaseException:
webcolors = None
class OptionsGenerator(object):
def __init__(self,
... | 0 | 0 | 0 | 11,978 | 0 | 467 | 0 | -6 | 116 |
f39a5008d6e1c8e8868931e246ce18a5152cc852 | 1,505 | py | Python | modules/ConfigEngine.py | Reachip/COVID19-France | e7fde76e0a75b51aed1e67a8d21aa80b0b68050a | [
"MIT"
] | 15 | 2020-04-13T21:58:26.000Z | 2020-06-18T07:31:55.000Z | modules/ConfigEngine.py | Reachip/COVID19-France | e7fde76e0a75b51aed1e67a8d21aa80b0b68050a | [
"MIT"
] | 3 | 2020-04-18T16:36:24.000Z | 2020-09-11T13:07:41.000Z | modules/ConfigEngine.py | Reachip/COVID19-France | e7fde76e0a75b51aed1e67a8d21aa80b0b68050a | [
"MIT"
] | 6 | 2020-04-13T22:38:14.000Z | 2020-09-02T19:07:38.000Z | #!/usr/bin/env python
# coding: utf-8
# Twitter: @xrths
# www.xrths.fr
# Importation des librairies.
| 24.274194 | 67 | 0.671761 | #!/usr/bin/env python
# coding: utf-8
# Twitter: @xrths
# www.xrths.fr
# Importation des librairies.
import os
from configparser import ConfigParser
class BaseConfigEngine:
def __init__(self):
self._config_file = os.path.join(
os.path.dirname(__file__), '../config.ini')
self.parser ... | 0 | 614 | 0 | 692 | 0 | 0 | 0 | 4 | 90 |
1713b6c48a37bc34c443e86aa8c3581c0e08d6f2 | 977 | py | Python | vindauga/types/records/directory_search_record.py | gabbpuy/vindauga | d4a51a618d60e83d82fd5fee585d08ff288484f3 | [
"BSD-2-Clause"
] | 5 | 2019-07-03T16:01:46.000Z | 2021-12-22T10:01:04.000Z | vindauga/types/records/directory_search_record.py | gabbpuy/vindauga | d4a51a618d60e83d82fd5fee585d08ff288484f3 | [
"BSD-2-Clause"
] | null | null | null | vindauga/types/records/directory_search_record.py | gabbpuy/vindauga | d4a51a618d60e83d82fd5fee585d08ff288484f3 | [
"BSD-2-Clause"
] | 1 | 2020-09-22T14:25:13.000Z | 2020-09-22T14:25:13.000Z | # -*- coding: utf-8 -*-
| 27.914286 | 82 | 0.650972 | # -*- coding: utf-8 -*-
import datetime
from functools import total_ordering
import os
import stat
from .search_record import SearchRecord, FA_DIREC, FA_ARCH
@total_ordering
class DirectorySearchRecord(SearchRecord):
def setStatInfo(self, filename: str, s: os.stat_result):
self.attr = FA_ARCH
i... | 0 | 793 | 0 | 0 | 0 | 0 | 0 | 25 | 134 |
e1f35d874d627872d0fd19befdafc861ef9953ce | 2,468 | py | Python | bin/global_place/RePlAce/rdf_RePlAce.py | DanielTRYTRYLOOK/RDF-2020 | a6a6c0835a02c8a98ae8e899dec02ed960afb69c | [
"MIT"
] | 3 | 2020-11-08T17:04:04.000Z | 2021-03-28T17:44:12.000Z | bin/global_place/RePlAce/rdf_RePlAce.py | DanielTRYTRYLOOK/RDF-2020 | a6a6c0835a02c8a98ae8e899dec02ed960afb69c | [
"MIT"
] | 1 | 2021-11-30T09:12:06.000Z | 2021-11-30T09:12:06.000Z | bin/global_place/RePlAce/rdf_RePlAce.py | DanielTRYTRYLOOK/RDF-2020 | a6a6c0835a02c8a98ae8e899dec02ed960afb69c | [
"MIT"
] | 4 | 2021-09-01T17:04:22.000Z | 2022-02-11T15:20:45.000Z | '''
File name : rdf_RePlAce.py
Author : Jinwook Jung
Created on : Tue 30 Jul 2019 10:31:18 PM EDT
Last modified : 2020-01-06 15:22:58
Description :
'''
import sys
# FIXME
sys.path.insert(0, '../../../src/stage.py')
| 30.469136 | 79 | 0.597245 | '''
File name : rdf_RePlAce.py
Author : Jinwook Jung
Created on : Tue 30 Jul 2019 10:31:18 PM EDT
Last modified : 2020-01-06 15:22:58
Description :
'''
import subprocess, os, sys, random, yaml, time
from subprocess import Popen, PIPE, CalledProcessError
# FIXME
sys.path.inser... | 0 | 0 | 0 | 1,621 | 0 | 428 | 0 | 67 | 90 |
78fff8947e055f7dafb116d7ee57d17cb30b7833 | 630 | py | Python | Curso/ModuloTkinter/Aula029TabelaMySQL3.py | DavidBitner/Aprendizado-Python | e1dcf18f9473c697fc2302f34a2d3e025ca6c969 | [
"MIT"
] | null | null | null | Curso/ModuloTkinter/Aula029TabelaMySQL3.py | DavidBitner/Aprendizado-Python | e1dcf18f9473c697fc2302f34a2d3e025ca6c969 | [
"MIT"
] | null | null | null | Curso/ModuloTkinter/Aula029TabelaMySQL3.py | DavidBitner/Aprendizado-Python | e1dcf18f9473c697fc2302f34a2d3e025ca6c969 | [
"MIT"
] | null | null | null | import mysql.connector
root = Tk()
root.title("Doidera")
root.geometry("400x400+200+200")
my_db = mysql.connector.connect(
host="localhost",
user="root",
passwd="YourPassword",
database="doidera"
)
# Criar um cursor e inicializa-lo
my_cursor = my_db.cursor()
# Criar tabela
comando_sql = "CREATE TABL... | 22.5 | 55 | 0.626984 | from tkinter import *
import mysql.connector
root = Tk()
root.title("Doidera")
root.geometry("400x400+200+200")
my_db = mysql.connector.connect(
host="localhost",
user="root",
passwd="YourPassword",
database="doidera"
)
# Criar um cursor e inicializa-lo
my_cursor = my_db.cursor()
# Criar tabela
coma... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 22 |
76ea2159e2f0cceb466e1db9b1d5f9c27090f4c3 | 497 | py | Python | homeassistant/components/gree/config_flow.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 6 | 2017-08-02T19:26:39.000Z | 2020-03-14T22:47:41.000Z | homeassistant/components/gree/config_flow.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 60 | 2020-08-03T07:32:56.000Z | 2022-03-31T06:02:07.000Z | homeassistant/components/gree/config_flow.py | tbarbette/core | 8e58c3aa7bc8d2c2b09b6bd329daa1c092d52d3c | [
"Apache-2.0"
] | 14 | 2018-08-19T16:28:26.000Z | 2021-09-02T18:26:53.000Z | """Config flow for Gree."""
from homeassistant import config_entries
from homeassistant.helpers import config_entry_flow
from .const import DOMAIN
config_entry_flow.register_discovery_flow(
DOMAIN, "Gree Climate", _async_has_devices, config_entries.CONN_CLASS_LOCAL_POLL
)
| 27.611111 | 84 | 0.782696 | """Config flow for Gree."""
from homeassistant import config_entries
from homeassistant.helpers import config_entry_flow
from .bridge import DeviceHelper
from .const import DOMAIN
async def _async_has_devices(hass) -> bool:
"""Return if there are devices that can be discovered."""
devices = await DeviceHelpe... | 0 | 0 | 160 | 0 | 0 | 0 | 0 | 11 | 46 |
9e328819b51d43963aa70159e6f94602d4f6590f | 127 | py | Python | PIARS/run.py | qingyang-xi/piars | 193e33f3b01b1c0bfcea58faefb4605ef84539ce | [
"MIT"
] | null | null | null | PIARS/run.py | qingyang-xi/piars | 193e33f3b01b1c0bfcea58faefb4605ef84539ce | [
"MIT"
] | null | null | null | PIARS/run.py | qingyang-xi/piars | 193e33f3b01b1c0bfcea58faefb4605ef84539ce | [
"MIT"
] | null | null | null | import math
import matplotlib.pyplot as plt
print("Hello World!")
x = math.sqrt(30)
print(x)
plt.plot([1,2,3,4,5])
plt.show() | 14.111111 | 31 | 0.692913 | import math
import matplotlib.pyplot as plt
print("Hello World!")
x = math.sqrt(30)
print(x)
plt.plot([1,2,3,4,5])
plt.show() | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6a1c48cbadafe36a82365fc76d25d0196ec2ece7 | 1,601 | py | Python | applications/migrations/0006_add_berth_switch.py | City-of-Helsinki/berth-reservations | a3b1a8c2176f132505527acdf6da3a62199401db | [
"MIT"
] | 3 | 2020-10-13T07:58:48.000Z | 2020-12-22T09:41:50.000Z | applications/migrations/0006_add_berth_switch.py | City-of-Helsinki/berth-reservations | a3b1a8c2176f132505527acdf6da3a62199401db | [
"MIT"
] | 422 | 2018-10-25T10:57:05.000Z | 2022-03-30T05:47:14.000Z | applications/migrations/0006_add_berth_switch.py | City-of-Helsinki/berth-reservations | a3b1a8c2176f132505527acdf6da3a62199401db | [
"MIT"
] | 1 | 2020-04-03T07:38:03.000Z | 2020-04-03T07:38:03.000Z | # Generated by Django 2.1.2 on 2019-04-08 11:55
| 29.109091 | 85 | 0.425984 | # Generated by Django 2.1.2 on 2019-04-08 11:55
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("applications", "0005_add_custom_permissions"),
]
operations = [
migrations.CreateModel(
name="B... | 0 | 0 | 0 | 1,454 | 0 | 0 | 0 | 30 | 68 |
8c54298f976882469a2f9fc037cf3b36c35bb161 | 1,566 | py | Python | trainer_for_failure_classes.py | birlrobotics/rcbht_training_and_online_classification | 4ba605420fd9ab65e9e8173673a6e16f7dcb15df | [
"BSD-3-Clause"
] | null | null | null | trainer_for_failure_classes.py | birlrobotics/rcbht_training_and_online_classification | 4ba605420fd9ab65e9e8173673a6e16f7dcb15df | [
"BSD-3-Clause"
] | null | null | null | trainer_for_failure_classes.py | birlrobotics/rcbht_training_and_online_classification | 4ba605420fd9ab65e9e8173673a6e16f7dcb15df | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import numpy as np
from matplotlib import pyplot as plt
from scipy.interpolate import spline
import os
from config import failure_class_name_to_id
data_type = "SIM"
filepath = "/Users/sklaw_mba/Desktop/ex/dr_juan_proj/workshop/data_cooker_code/parse_rcbht_data/my_training_data/"+d... | 27 | 158 | 0.673691 | #!/usr/bin/env python
import numpy as np
from matplotlib import pyplot as plt
from scipy.interpolate import spline
import os
from config import failure_class_name_to_id
data_type = "SIM"
filepath = "/Users/sklaw_mba/Desktop/ex/dr_juan_proj/workshop/data_cooker_code/parse_rcbht_data/my_training_data/"+d... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b1d071a81d9c5e740d93c53b301f287d816f0bf2 | 3,808 | py | Python | common/preprocess.py | estephe-arnaud/ademfa | 679587b09eb86d2956c73aec100d764ef7fc005c | [
"BSD-3-Clause"
] | 2 | 2021-01-15T22:08:41.000Z | 2022-01-18T14:19:43.000Z | common/preprocess.py | estephe-arnaud/ademfa | 679587b09eb86d2956c73aec100d764ef7fc005c | [
"BSD-3-Clause"
] | null | null | null | common/preprocess.py | estephe-arnaud/ademfa | 679587b09eb86d2956c73aec100d764ef7fc005c | [
"BSD-3-Clause"
] | 1 | 2020-12-30T08:22:19.000Z | 2020-12-30T08:22:19.000Z | """Preprocess."""
from menpodetect.opencv import detect
__DETECTOR__ = detect.load_opencv_frontal_face_detector()
| 24.101266 | 77 | 0.621324 | """Preprocess."""
import numpy as np
import menpo
from menpofit.fitter import align_shape_with_bounding_box
from menpodetect.opencv import detect
import common.utils
import face_alignment.utils
__DETECTOR__ = detect.load_opencv_frontal_face_detector()
class Preprocess(object):
"""Preprocess."""
def __init_... | 0 | 0 | 0 | 3,527 | 0 | 0 | 0 | 28 | 134 |
3eae3efcfc3ddd24c3fb342dbde213ab0a08eaf8 | 12,978 | py | Python | pyimagesource/bank.py | Fhrozen/pyimagesource | 0bd3c8de484694877ea1d152448b7bc0b31b279a | [
"Apache-2.0"
] | 6 | 2020-06-27T09:55:46.000Z | 2022-03-28T01:01:37.000Z | pyimagesource/bank.py | Fhrozen/ism_rir | 0bd3c8de484694877ea1d152448b7bc0b31b279a | [
"Apache-2.0"
] | null | null | null | pyimagesource/bank.py | Fhrozen/ism_rir | 0bd3c8de484694877ea1d152448b7bc0b31b279a | [
"Apache-2.0"
] | 1 | 2019-12-05T08:22:31.000Z | 2019-12-05T08:22:31.000Z | # Copyright 2018 Waseda University (Nelson Yalta)
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agree... | 52.330645 | 108 | 0.642164 | # Copyright 2018 Waseda University (Nelson Yalta)
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agree... | 0 | 0 | 0 | 11,932 | 0 | 277 | 0 | 39 | 136 |
5706a511320dad5fa027e14356e1f5a28e743c19 | 2,895 | py | Python | nnn/nodes/info_node/functions.py | JacobFV/pgi | b4c9af3c4ae94fcb335f20c2a1e7a4ff46ca54e6 | [
"MIT"
] | null | null | null | nnn/nodes/info_node/functions.py | JacobFV/pgi | b4c9af3c4ae94fcb335f20c2a1e7a4ff46ca54e6 | [
"MIT"
] | null | null | null | nnn/nodes/info_node/functions.py | JacobFV/pgi | b4c9af3c4ae94fcb335f20c2a1e7a4ff46ca54e6 | [
"MIT"
] | null | null | null |
from ...utils import types as ts
def f_child_sample_factory(beta: ts.Float = 0):
"""
Args:
beta: softmax temperature. Higher means more random
Returns:
function `f_child_sample`
"""
return f_child_sample
| 40.774648 | 108 | 0.727807 | from typing import Optional, Text, List, Mapping, Callable, Tuple, Union, Counter
import tensorflow as tf
import tensorflow_probability.python.distributions as tfd
from ...utils import types as ts
from ...utils import keys
def f_parent_no_parents(states: ts.NestedTensor, parent_names: List[Text]):
return
def ... | 0 | 0 | 0 | 0 | 0 | 2,267 | 0 | 102 | 276 |
b7ef8b7db02557bd5008a14e944bd388c750285b | 5,371 | py | Python | crossdock/problems/experiment/crossdock_30_50_15_10_10.py | krerkkiat/icpr-2019-public | f3023c009f3335ce58204a45c270cfeb6ef19367 | [
"BSD-3-Clause"
] | null | null | null | crossdock/problems/experiment/crossdock_30_50_15_10_10.py | krerkkiat/icpr-2019-public | f3023c009f3335ce58204a45c270cfeb6ef19367 | [
"BSD-3-Clause"
] | null | null | null | crossdock/problems/experiment/crossdock_30_50_15_10_10.py | krerkkiat/icpr-2019-public | f3023c009f3335ce58204a45c270cfeb6ef19367 | [
"BSD-3-Clause"
] | null | null | null | """
Cross-docking truck data.
This data is generated by a generate_dataset.py script.
Created: Feb 18, 2019 at 07:30:02 PM
Copyright (c) 2022, Krerkkiat Chusap
This souce code is licensed under BSD 3-Clause "New" or "Revised" License (see LICENSE for details).
"""
from pathlib import Path
# Problem data.
name = Pat... | 47.114035 | 100 | 0.432694 | """
Cross-docking truck data.
This data is generated by a generate_dataset.py script.
Created: Feb 18, 2019 at 07:30:02 PM
Copyright (c) 2022, Krerkkiat Chusap
This souce code is licensed under BSD 3-Clause "New" or "Revised" License (see LICENSE for details).
"""
from pathlib import Path
# Problem data.
name = Pat... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1bdf22fe89aeb7adc738880690082b4462bbb261 | 2,226 | py | Python | debug.py | jlandgre/debug | 24ae298b665a708fb13de7c17cd02cf23d747076 | [
"MIT"
] | null | null | null | debug.py | jlandgre/debug | 24ae298b665a708fb13de7c17cd02cf23d747076 | [
"MIT"
] | null | null | null | debug.py | jlandgre/debug | 24ae298b665a708fb13de7c17cd02cf23d747076 | [
"MIT"
] | null | null | null |
#Debug library functions
#Add a new row to dfDebug
| 43.647059 | 104 | 0.615454 | import pandas as pd
import numpy as np
import datetime as dt
#Debug library functions
def init():
data = {'Desc':[], 'colname':[], 'size':[], 'dtype_string':[], 'dtype_int':[],
'dtype_float':[], 'isnull':[], 'notnull':[], 'Desc2':[], 'Val2':[], 'time':[]}
dfDebug = pd.DataFrame(data=data)
#Tri... | 0 | 0 | 0 | 0 | 0 | 1,957 | 0 | -5 | 221 |
c78d66ffc5ac1217de63c18a78706287ebbcb685 | 392 | py | Python | py/experiments/np_test.py | acjensen/control | 273803cace506acb956f11da8d501863a5349892 | [
"MIT"
] | null | null | null | py/experiments/np_test.py | acjensen/control | 273803cace506acb956f11da8d501863a5349892 | [
"MIT"
] | null | null | null | py/experiments/np_test.py | acjensen/control | 273803cace506acb956f11da8d501863a5349892 | [
"MIT"
] | null | null | null | import numpy as np
a = range(100)
A = np.array(a).reshape(len(a)//2, 2)
A = A.ravel().view([('col1', 'i8'), ('col2', 'i8'), ]
).astype([('col1', 'i4'), ('col2', 'i8'), ])
print(A[:5])
# array([(0, 1), (2, 3), (4, 5), (6, 7), (8, 9)],
# dtype=[('col1', '<i4'), ('col2', '<i8')])
print(A.dtype)
... | 26.133333 | 63 | 0.431122 | import numpy as np
a = range(100)
A = np.array(a).reshape(len(a)//2, 2)
A = A.ravel().view([('col1', 'i8'), ('col2', 'i8'), ]
).astype([('col1', 'i4'), ('col2', 'i8'), ])
print(A[:5])
# array([(0, 1), (2, 3), (4, 5), (6, 7), (8, 9)],
# dtype=[('col1', '<i4'), ('col2', '<i8')])
print(A.dtype)
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bd8f8422450a7a9e0f5f2c3dfa55bf94e771b16d | 1,148 | py | Python | Office365_REST_Python_Client-2.1.0-py3.6.egg/examples/file_operations.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | Office365_REST_Python_Client-2.1.0-py3.6.egg/examples/file_operations.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | null | null | null | Office365_REST_Python_Client-2.1.0-py3.6.egg/examples/file_operations.py | EnjoyLifeFund/macHighSierra-py36-pkgs | 5668b5785296b314ea1321057420bcd077dba9ea | [
"BSD-3-Clause",
"BSD-2-Clause",
"MIT"
] | 1 | 2018-03-23T14:49:04.000Z | 2018-03-23T14:49:04.000Z | from examples.settings import settings
from office365.runtime.auth.authentication_context import AuthenticationContext
from office365.sharepoint.client_context import ClientContext
def read_folder_and_files():
"""Read a folder example"""
list_obj = ctx.web.lists.get_by_title(listTitle)
folder = list_obj.r... | 31.027027 | 101 | 0.706446 | from examples.settings import settings
from office365.runtime.auth.authentication_context import AuthenticationContext
from office365.sharepoint.client_context import ClientContext
def read_folder_and_files():
"""Read a folder example"""
list_obj = ctx.web.lists.get_by_title(listTitle)
folder = list_obj.r... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0602385d6a419c8343b8073083c49f7f56815ae0 | 4,874 | py | Python | src/whoosh/lang/snowball/bases.py | matchup-ir/whooshy | 3e8730f4cbb559fd59971c5a2e6d01924d3968c0 | [
"BSD-2-Clause-FreeBSD"
] | 319 | 2016-09-22T15:54:48.000Z | 2022-03-18T02:36:58.000Z | src/whoosh/lang/snowball/bases.py | matchup-ir/whooshy | 3e8730f4cbb559fd59971c5a2e6d01924d3968c0 | [
"BSD-2-Clause-FreeBSD"
] | 85 | 2018-12-11T06:53:06.000Z | 2021-07-30T20:39:12.000Z | src/whoosh/lang/snowball/bases.py | matchup-ir/whooshy | 3e8730f4cbb559fd59971c5a2e6d01924d3968c0 | [
"BSD-2-Clause-FreeBSD"
] | 62 | 2015-07-03T12:34:32.000Z | 2022-02-08T08:21:12.000Z | # Base classes
| 36.373134 | 77 | 0.566065 | # Base classes
class _ScandinavianStemmer(object):
"""
This subclass encapsulates a method for defining the string region R1.
It is used by the Danish, Norwegian, and Swedish stemmer.
"""
def _r1_scandinavian(self, word, vowels):
"""
Return the region R1 that is used by the Scan... | 0 | 0 | 0 | 4,811 | 0 | 0 | 0 | 0 | 46 |
c36ef14937ce48bf1fede8f6a6f4555a4c9a20b7 | 671 | py | Python | myopenpantry/models/ingredients.py | MyOpenPantry/flask-backend | e94702bfa04f36c1a6015ae3e9c37dfb7b923279 | [
"MIT"
] | null | null | null | myopenpantry/models/ingredients.py | MyOpenPantry/flask-backend | e94702bfa04f36c1a6015ae3e9c37dfb7b923279 | [
"MIT"
] | 4 | 2021-03-28T19:47:04.000Z | 2021-05-04T00:59:46.000Z | myopenpantry/models/ingredients.py | MyOpenPantry/flask-backend | e94702bfa04f36c1a6015ae3e9c37dfb7b923279 | [
"MIT"
] | null | null | null |
# ingredients are a base part of recipes. ex "chicken breast"
# association tables will be used to join these with inventory items, as well as the amount needed in recipes
| 37.277778 | 109 | 0.754098 | import sqlalchemy as sa
from sqlalchemy.orm import relationship
from myopenpantry.extensions.database import db
# ingredients are a base part of recipes. ex "chicken breast"
# association tables will be used to join these with inventory items, as well as the amount needed in recipes
class Ingredient(db.Model):
__... | 0 | 0 | 0 | 363 | 0 | 0 | 0 | 46 | 88 |