hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c46098610964543336f1caf9a6c92cb98615a0c | 5,335 | py | Python | example/distill/nlp/reader.py | wangxicoding/edl | 75d651e72e5297aba2e597588cf958ea336deb4e | [
"Apache-2.0"
] | 90 | 2020-04-21T01:46:10.000Z | 2022-02-10T09:09:34.000Z | example/distill/nlp/reader.py | wangxicoding/edl | 75d651e72e5297aba2e597588cf958ea336deb4e | [
"Apache-2.0"
] | 37 | 2018-03-02T22:41:15.000Z | 2020-04-22T16:48:36.000Z | example/distill/nlp/reader.py | wangxicoding/edl | 75d651e72e5297aba2e597588cf958ea336deb4e | [
"Apache-2.0"
] | 34 | 2018-03-02T23:28:25.000Z | 2020-03-25T08:50:29.000Z | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 30.485714 | 78 | 0.530834 |
import codecs
import os
import csv
import sys
from paddlehub.dataset import InputExample
from paddlehub.common.dir import DATA_HOME
from paddlehub.dataset.base_nlp_dataset import BaseNLPDataset
import paddle as P
import paddle.fluid.dygraph as D
import numpy as np
def space_tokenizer(i):
return i.split()
def ... | true | true |
1c460c1837c4e7c5359fc82cd3f26054a7ebdf50 | 179 | py | Python | needle/engines/base.py | VICEMedia/needle | c2d28ee07278f1d0bd7ace6a2cb65cfea24f2a7e | [
"BSD-3-Clause"
] | 144 | 2017-04-23T08:52:52.000Z | 2022-03-15T03:40:37.000Z | new_pytest_needle/engines/base.py | Gadzillion/new_pytest_needle | b86de146c443a8377cfab9750aff187c0cb0852d | [
"MIT"
] | 35 | 2015-01-16T15:24:35.000Z | 2017-04-02T22:35:05.000Z | new_pytest_needle/engines/base.py | Gadzillion/new_pytest_needle | b86de146c443a8377cfab9750aff187c0cb0852d | [
"MIT"
] | 24 | 2017-04-23T08:52:57.000Z | 2022-02-02T11:57:21.000Z | class EngineBase(object):
"""
Base class for diff engines.
"""
def assertSameFiles(self, output_file, baseline_file, threshold):
raise NotImplementedError | 25.571429 | 69 | 0.687151 | class EngineBase(object):
def assertSameFiles(self, output_file, baseline_file, threshold):
raise NotImplementedError | true | true |
1c460cfe2369acdf089542529e5400b016579622 | 4,298 | py | Python | temboo/core/Library/LastFm/Artist/GetTopTracks.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 7 | 2016-03-07T02:07:21.000Z | 2022-01-21T02:22:41.000Z | temboo/core/Library/LastFm/Artist/GetTopTracks.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | null | null | null | temboo/core/Library/LastFm/Artist/GetTopTracks.py | jordanemedlock/psychtruths | 52e09033ade9608bd5143129f8a1bfac22d634dd | [
"Apache-2.0"
] | 8 | 2016-06-14T06:01:11.000Z | 2020-04-22T09:21:44.000Z | # -*- coding: utf-8 -*-
###############################################################################
#
# GetTopTracks
# Retrieves the top tracks by an artist on Last.fm, ordered by popularity.
#
# Python versions 2.6, 2.7, 3.x
#
# Copyright 2014, Temboo Inc.
#
# Licensed under the Apache License, Version 2.0 (the "... | 39.796296 | 221 | 0.676826 |
from temboo.core.choreography import Choreography
from temboo.core.choreography import InputSet
from temboo.core.choreography import ResultSet
from temboo.core.choreography import ChoreographyExecution
import json
class GetTopTracks(Choreography):
def __init__(self, temboo_session):
super(GetTopTracks,... | true | true |
1c460e435bc0e519d5da56e295c2516fae50f58a | 2,381 | py | Python | pgmpy/exceptions/Exceptions.py | NunoEdgarGFlowHub/pgmpy | ac0ecc8f5bdd14999c386c6b00a3ce77407b83ce | [
"MIT"
] | 1 | 2016-08-27T18:30:57.000Z | 2016-08-27T18:30:57.000Z | pgmpy/exceptions/Exceptions.py | NunoEdgarGFlowHub/pgmpy | ac0ecc8f5bdd14999c386c6b00a3ce77407b83ce | [
"MIT"
] | null | null | null | pgmpy/exceptions/Exceptions.py | NunoEdgarGFlowHub/pgmpy | ac0ecc8f5bdd14999c386c6b00a3ce77407b83ce | [
"MIT"
] | 1 | 2016-08-27T18:31:00.000Z | 2016-08-27T18:31:00.000Z | #!/usr/bin/env python3
"""Contains all the user-defined exceptions created for PgmPy"""
class MissingParentsError(Exception):
def __init__(self, *missing):
self.missing = missing
def __str__(self):
return repr("Parents are missing: " + str(self.missing))
class ExtraParentsError(Exception):
... | 20.704348 | 68 | 0.642167 |
class MissingParentsError(Exception):
def __init__(self, *missing):
self.missing = missing
def __str__(self):
return repr("Parents are missing: " + str(self.missing))
class ExtraParentsError(Exception):
def __init__(self, *extra):
self.extra = extra
def __str__(self):
... | true | true |
1c460e9948c0b105e16e3c6be296155958f589a9 | 2,555 | py | Python | only_common.py | taotaotao3/only_common | 7dd3700d4bf3935c193b0b6f38a0dafa750ad01c | [
"MIT"
] | null | null | null | only_common.py | taotaotao3/only_common | 7dd3700d4bf3935c193b0b6f38a0dafa750ad01c | [
"MIT"
] | null | null | null | only_common.py | taotaotao3/only_common | 7dd3700d4bf3935c193b0b6f38a0dafa750ad01c | [
"MIT"
] | null | null | null | import sys
import io
import csv
import pprint
import pandas as pd
import pdb
def excommon(arg_1 = 'a.csv', arg_2 = 'b.csv', arg_3 = 'shift-jis'):
print('sys.argv[1]:', arg_1)
print('sys.argv[2]:', arg_2)
print('sys.argv[3]:', arg_3)
df_a = pd.read_csv(arg_1, encoding=arg_3, header=None)
list_a = [... | 37.573529 | 115 | 0.535812 | import sys
import io
import csv
import pprint
import pandas as pd
import pdb
def excommon(arg_1 = 'a.csv', arg_2 = 'b.csv', arg_3 = 'shift-jis'):
print('sys.argv[1]:', arg_1)
print('sys.argv[2]:', arg_2)
print('sys.argv[3]:', arg_3)
df_a = pd.read_csv(arg_1, encoding=arg_3, header=None)
list_a = [... | true | true |
1c460f108d2d697a791df8a9c61f73dfc9837a9b | 2,840 | py | Python | test/functional/test_framework/address.py | IDC-Group/VHKD | 0256ddf1477439ebc84e97132d3673aa61c39b73 | [
"MIT"
] | 3 | 2018-06-23T10:04:45.000Z | 2018-06-25T02:22:01.000Z | test/functional/test_framework/address.py | IDC-Group/VHKD | 0256ddf1477439ebc84e97132d3673aa61c39b73 | [
"MIT"
] | null | null | null | test/functional/test_framework/address.py | IDC-Group/VHKD | 0256ddf1477439ebc84e97132d3673aa61c39b73 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2016 The vhkdCoin Core vhkd
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Encode and decode BASE58, P2PKH and P2SH addresses."""
from .script import hash256, hash160, sha256, CScript, OP... | 32.272727 | 73 | 0.68662 |
from .script import hash256, hash160, sha256, CScript, OP_0
from .util import bytes_to_hex_str, hex_str_to_bytes
from . import segwit_addr
chars = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'
def byte_to_base58(b, version):
result = ''
str = bytes_to_hex_str(b)
str = bytes_to_hex_str(chr... | true | true |
1c460f4074ead61f00745adb8067544b72ddcdf8 | 7,593 | py | Python | tensor2tensor/rl/envs/simulated_batch_env.py | akshitj1/tensor2tensor | a76b0f0afe24c966e26d0112356eb66f5a8a37aa | [
"Apache-2.0"
] | 1 | 2022-03-25T03:07:28.000Z | 2022-03-25T03:07:28.000Z | tensor2tensor/rl/envs/simulated_batch_env.py | akshitj1/tensor2tensor | a76b0f0afe24c966e26d0112356eb66f5a8a37aa | [
"Apache-2.0"
] | 1 | 2022-01-05T06:08:00.000Z | 2022-01-05T06:08:29.000Z | tensor2tensor/rl/envs/simulated_batch_env.py | akshitj1/tensor2tensor | a76b0f0afe24c966e26d0112356eb66f5a8a37aa | [
"Apache-2.0"
] | 1 | 2021-07-15T07:25:08.000Z | 2021-07-15T07:25:08.000Z | # coding=utf-8
# Copyright 2018 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 40.388298 | 85 | 0.703148 |
# https://github.com/tensorflow/agents/blob/master/agents/tools/in_graph_batch_env.py
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensor2tensor.layers import common_layers
from tensor2tensor.rl.envs import in_graph_batch_env
from tensor2tensor.util... | true | true |
1c461034d0e13519aa62b7aed184a164629d184b | 4,234 | py | Python | scripts/py_featextr_server/wordembed_cosine_server.py | MokriyYuriy/FlexNeuART | 49f13e3f9f0b0ea1399ea558436caaedd5233f5c | [
"Apache-2.0"
] | null | null | null | scripts/py_featextr_server/wordembed_cosine_server.py | MokriyYuriy/FlexNeuART | 49f13e3f9f0b0ea1399ea558436caaedd5233f5c | [
"Apache-2.0"
] | null | null | null | scripts/py_featextr_server/wordembed_cosine_server.py | MokriyYuriy/FlexNeuART | 49f13e3f9f0b0ea1399ea558436caaedd5233f5c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import sys
import argparse
sys.path.append('.')
from scripts.py_featextr_server.base_server import BaseQueryHandler, startQueryServer
import numpy as np
from scripts.py_featextr_server.utils import loadEmbeddings, createEmbedMap, robustCosineSimil
# Exclusive==True means that only one getScor... | 35.579832 | 95 | 0.593056 | import sys
import argparse
sys.path.append('.')
from scripts.py_featextr_server.base_server import BaseQueryHandler, startQueryServer
import numpy as np
from scripts.py_featextr_server.utils import loadEmbeddings, createEmbedMap, robustCosineSimil
class CosineSimilQueryHandler(BaseQueryHandler):
def __init__(s... | true | true |
1c4610361f88087ecacad48415ecb6f130687e52 | 409 | py | Python | XiuxiuService/AliSDK/top/api/rest/OpenimChatlogsGetRequest.py | nightHearter/XiuxiuService | 281c2d5eef85936edcd0d9ec97c8d165078f444c | [
"MIT"
] | null | null | null | XiuxiuService/AliSDK/top/api/rest/OpenimChatlogsGetRequest.py | nightHearter/XiuxiuService | 281c2d5eef85936edcd0d9ec97c8d165078f444c | [
"MIT"
] | null | null | null | XiuxiuService/AliSDK/top/api/rest/OpenimChatlogsGetRequest.py | nightHearter/XiuxiuService | 281c2d5eef85936edcd0d9ec97c8d165078f444c | [
"MIT"
] | null | null | null | '''
Created by auto_sdk on 2015.06.16
'''
from top.api.base import RestApi
class OpenimChatlogsGetRequest(RestApi):
def __init__(self,domain='gw.api.taobao.com',port=80):
RestApi.__init__(self,domain, port)
self.begin = None
self.count = None
self.end = None
self.next_key = None
self.user1 = Non... | 24.058824 | 56 | 0.696822 | from top.api.base import RestApi
class OpenimChatlogsGetRequest(RestApi):
def __init__(self,domain='gw.api.taobao.com',port=80):
RestApi.__init__(self,domain, port)
self.begin = None
self.count = None
self.end = None
self.next_key = None
self.user1 = None
self.user2 = None
def getapiname(sel... | true | true |
1c46117a8c4860a623124d64ceca53a37a0253a2 | 4,961 | py | Python | project/Code/video_stabilizer.py | OmerRe/video-processing-methods | 245a89aaa1e774a62da1f043058242841a4f53ee | [
"MIT"
] | 1 | 2022-03-23T13:07:28.000Z | 2022-03-23T13:07:28.000Z | project/Code/video_stabilizer.py | OmerRe/video-processing-methods | 245a89aaa1e774a62da1f043058242841a4f53ee | [
"MIT"
] | null | null | null | project/Code/video_stabilizer.py | OmerRe/video-processing-methods | 245a89aaa1e774a62da1f043058242841a4f53ee | [
"MIT"
] | null | null | null | import cv2
import numpy as np
from Code.utils import fixBorder, convert_to_gray
def stabilize_video(video_frames: list, config: dict) -> list:
"""Creating a stabilized video from an arbitrary input video.
Args:
input_video: cv2.VideoCapture. Video we want to stabilize.
config: dict. Dictionary... | 45.513761 | 119 | 0.712961 | import cv2
import numpy as np
from Code.utils import fixBorder, convert_to_gray
def stabilize_video(video_frames: list, config: dict) -> list:
print("Starting Video Stabilization...")
transforms = find_motion_between_frames(config['video_params'], video_frames, config)
transforms_smooth = calc_smooth_tran... | true | true |
1c4612a1484861de5941c466421c93898e7ec41d | 347 | py | Python | dashboard/main.py | BOJIT/pi-dashboard | 134c3d7b941a470630aceed4e69b8735bcfcebfd | [
"MIT"
] | null | null | null | dashboard/main.py | BOJIT/pi-dashboard | 134c3d7b941a470630aceed4e69b8735bcfcebfd | [
"MIT"
] | null | null | null | dashboard/main.py | BOJIT/pi-dashboard | 134c3d7b941a470630aceed4e69b8735bcfcebfd | [
"MIT"
] | null | null | null | """
Copyright (c)
Author: James Bennion-Pedley
Date: 2021 - present
Licence: MIT
"""
# from dashboard import app
from flask import Blueprint, render_template
from flask_login import login_required, current_user
main = Blueprint('main', __name__)
# Home page
@main.route('/')
@login_required
def index():
return rend... | 16.52381 | 52 | 0.752161 |
from flask import Blueprint, render_template
from flask_login import login_required, current_user
main = Blueprint('main', __name__)
@main.route('/')
@login_required
def index():
return render_template('index.html')
| true | true |
1c461452d26499a8ba2aa4b2b235a47f6a1e796d | 5,474 | py | Python | project/S17-IO-3012/code/bin/benchmark_replicas_import.py | suunni/sp17-i524 | 42dd11b914c03c741dad8a8505c3e091dc6ec412 | [
"Apache-2.0"
] | 2 | 2020-10-30T09:54:25.000Z | 2021-12-14T19:13:18.000Z | project/S17-IO-3012/code/bin/benchmark_replicas_import.py | cloudmesh/sp17-i524 | 42dd11b914c03c741dad8a8505c3e091dc6ec412 | [
"Apache-2.0"
] | 98 | 2017-01-19T04:24:02.000Z | 2017-10-27T11:30:50.000Z | project/S17-IO-3012/code/bin/benchmark_replicas_import.py | cloudmesh/sp17-i524 | 42dd11b914c03c741dad8a8505c3e091dc6ec412 | [
"Apache-2.0"
] | 294 | 2017-01-09T13:18:39.000Z | 2018-07-13T01:32:24.000Z | import matplotlib.pyplot as plt
import sys
import pandas as pd
def get_parm():
"""retrieves mandatory parameter to program
@param: none
@type: n/a
"""
try:
return sys.argv[1]
except:
print ('Must enter file name as parameter')
exit()
def read_file(filename):
"""... | 38.013889 | 144 | 0.735842 | import matplotlib.pyplot as plt
import sys
import pandas as pd
def get_parm():
try:
return sys.argv[1]
except:
print ('Must enter file name as parameter')
exit()
def read_file(filename):
try:
return pd.read_csv(filename)
except:
print ('Error retrieving file')... | true | true |
1c461466a808f85ad09eb1de51759f22e737153d | 10,277 | py | Python | sdk/examples/intkey_python/dgt_intkey/client_cli/intkey_cli.py | DGT-Network/DGT-SDK | 3413ae22e79c13e71264271fa3f82203fd49f0b3 | [
"Apache-2.0"
] | null | null | null | sdk/examples/intkey_python/dgt_intkey/client_cli/intkey_cli.py | DGT-Network/DGT-SDK | 3413ae22e79c13e71264271fa3f82203fd49f0b3 | [
"Apache-2.0"
] | null | null | null | sdk/examples/intkey_python/dgt_intkey/client_cli/intkey_cli.py | DGT-Network/DGT-SDK | 3413ae22e79c13e71264271fa3f82203fd49f0b3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016, 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to ... | 26.763021 | 80 | 0.648827 |
import argparse
import getpass
import logging
import os
import sys
import traceback
import pkg_resources
from colorlog import ColoredFormatter
from dgt_intkey.client_cli.generate import add_generate_parser
from dgt_intkey.client_cli.generate import do_generate
from dgt_intkey.client_cli.populate import add_populate_... | true | true |
1c46148594b66e51e3b670cc5e04060e21b3f2a6 | 1,581 | py | Python | test_config.py | AshishMittal/watson-stt-wer-python | 62dea234665aa5c11a05327e49419d27b87f1b25 | [
"Apache-2.0"
] | 3 | 2021-06-17T14:19:44.000Z | 2022-02-27T18:13:51.000Z | test_config.py | AshishMittal/watson-stt-wer-python | 62dea234665aa5c11a05327e49419d27b87f1b25 | [
"Apache-2.0"
] | 22 | 2021-06-04T13:18:10.000Z | 2022-02-11T21:55:45.000Z | test_config.py | AshishMittal/watson-stt-wer-python | 62dea234665aa5c11a05327e49419d27b87f1b25 | [
"Apache-2.0"
] | 2 | 2021-07-15T19:43:36.000Z | 2022-02-23T09:56:47.000Z | import unittest, os
from config import Config
def getInstance():
return Config('config.ini.sample')
class MyTest(unittest.TestCase):
def test_get_value(self):
c = getInstance()
self.assertEqual(c.getValue('SpeechToText','base_model_name'), 'en-US_NarrowbandModel')
def test_get_missing_se... | 33.638298 | 124 | 0.683112 | import unittest, os
from config import Config
def getInstance():
return Config('config.ini.sample')
class MyTest(unittest.TestCase):
def test_get_value(self):
c = getInstance()
self.assertEqual(c.getValue('SpeechToText','base_model_name'), 'en-US_NarrowbandModel')
def test_get_missing_se... | true | true |
1c46177306b899ada2c53a4c9fa5cec25807641b | 12,569 | py | Python | harmonica/equivalent_layer/harmonic_spherical.py | RichardScottOZ/harmonica | ccb0437ea0ed528cfd144844edab98141c8d08da | [
"BSD-3-Clause"
] | null | null | null | harmonica/equivalent_layer/harmonic_spherical.py | RichardScottOZ/harmonica | ccb0437ea0ed528cfd144844edab98141c8d08da | [
"BSD-3-Clause"
] | 1 | 2022-01-19T03:02:22.000Z | 2022-01-19T20:47:19.000Z | harmonica/equivalent_layer/harmonic_spherical.py | RichardScottOZ/harmonica | ccb0437ea0ed528cfd144844edab98141c8d08da | [
"BSD-3-Clause"
] | 1 | 2022-01-17T23:15:18.000Z | 2022-01-17T23:15:18.000Z | """
Equivalent layer for generic harmonic functions in spherical coordinates
"""
import numpy as np
from numba import jit
from sklearn.utils.validation import check_is_fitted
import verde as vd
import verde.base as vdb
from .utils import jacobian_numba, predict_numba, pop_extra_coords
from ..forward.utils import dista... | 36.32659 | 86 | 0.626701 | import numpy as np
from numba import jit
from sklearn.utils.validation import check_is_fitted
import verde as vd
import verde.base as vdb
from .utils import jacobian_numba, predict_numba, pop_extra_coords
from ..forward.utils import distance_spherical
class EQLHarmonicSpherical(vdb.BaseGridder):
dims = ... | true | true |
1c4618e45d73910b099a098744c5bee6d758142c | 18,581 | py | Python | dali/test/python/test_operator_slice.py | ancientmooner/DALI | 355e8db8130cee0d20e9ae3d698f195278544995 | [
"ECL-2.0",
"Apache-2.0"
] | 5 | 2020-05-09T03:07:07.000Z | 2021-06-15T14:48:04.000Z | dali/test/python/test_operator_slice.py | ancientmooner/DALI | 355e8db8130cee0d20e9ae3d698f195278544995 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | dali/test/python/test_operator_slice.py | ancientmooner/DALI | 355e8db8130cee0d20e9ae3d698f195278544995 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2020-04-26T14:59:51.000Z | 2020-04-26T14:59:51.000Z | # Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 44.135392 | 119 | 0.592379 |
from nvidia.dali.pipeline import Pipeline
import nvidia.dali.ops as ops
import nvidia.dali.types as types
import nvidia.dali as dali
from nvidia.dali.backend_impl import TensorListGPU
import numpy as np
from numpy.testing import assert_array_equal, assert_allclose
import os
from functools import partial
from test_util... | true | true |
1c4618feed0faaaedbc546d3b6511a52116feb26 | 318 | py | Python | Lib/site-packages/django_makemessages_xgettext/management/commands/makemessagesxgettext.py | MortazaviM/Hackim | 28bf9897d1793176711d1c91f5b7ac57bf4b8a36 | [
"bzip2-1.0.6"
] | 2 | 2016-11-16T19:16:51.000Z | 2018-02-23T02:52:35.000Z | django_makemessages_xgettext/management/commands/makemessagesxgettext.py | resulto/django-makemessages-xgettext | 6af1590ec4dc2ffd6670e026d098cb0baa415d54 | [
"BSD-3-Clause"
] | null | null | null | django_makemessages_xgettext/management/commands/makemessagesxgettext.py | resulto/django-makemessages-xgettext | 6af1590ec4dc2ffd6670e026d098cb0baa415d54 | [
"BSD-3-Clause"
] | null | null | null | import django
if django.get_version().startswith("1.7"):
from django_makemessages_xgettext import django17_makemessagesxgettext
Command = django17_makemessagesxgettext.Command
else:
from django_makemessages_xgettext import django18_makemessagesxgettext
Command = django18_makemessagesxgettext.Command
| 35.333333 | 74 | 0.839623 | import django
if django.get_version().startswith("1.7"):
from django_makemessages_xgettext import django17_makemessagesxgettext
Command = django17_makemessagesxgettext.Command
else:
from django_makemessages_xgettext import django18_makemessagesxgettext
Command = django18_makemessagesxgettext.Command
| true | true |
1c4619c76a66576b7e0d2dd8529056fbf1cb9d05 | 67,648 | py | Python | dulwich/tests/test_porcelain.py | stmcginnis/dulwich | c33607e8d76643c6ec44b3010b138d2039c9acec | [
"Apache-2.0"
] | 1 | 2020-08-08T21:55:08.000Z | 2020-08-08T21:55:08.000Z | dulwich/tests/test_porcelain.py | stmcginnis/dulwich | c33607e8d76643c6ec44b3010b138d2039c9acec | [
"Apache-2.0"
] | null | null | null | dulwich/tests/test_porcelain.py | stmcginnis/dulwich | c33607e8d76643c6ec44b3010b138d2039c9acec | [
"Apache-2.0"
] | null | null | null | # test_porcelain.py -- porcelain tests
# Copyright (C) 2013 Jelmer Vernooij <jelmer@jelmer.uk>
#
# Dulwich is dual-licensed under the Apache License, Version 2.0 and the GNU
# General Public License as public by the Free Software Foundation; version 2.0
# or (at your option) any later version. You can redistribute it a... | 37.624027 | 97 | 0.58457 |
from io import BytesIO
try:
from StringIO import StringIO
except ImportError:
from io import StringIO
import errno
import os
import shutil
import tarfile
import tempfile
import time
from dulwich import porcelain
from dulwich.diff_tree import tree_changes
from dulwich.objects import (
Blob,
Tag,
T... | true | true |
1c461aa2e5f63fa27680aa6cf11215cb8e9c8883 | 1,802 | py | Python | rllib/examples/export/onnx_torch.py | mgelbart/ray | 4cec2286572e368a4bd64aae467751a384eff62d | [
"Apache-2.0"
] | 22 | 2018-05-08T05:52:34.000Z | 2020-04-01T10:09:55.000Z | rllib/examples/export/onnx_torch.py | mgelbart/ray | 4cec2286572e368a4bd64aae467751a384eff62d | [
"Apache-2.0"
] | 73 | 2021-09-25T07:11:39.000Z | 2022-03-26T07:10:59.000Z | rllib/examples/export/onnx_torch.py | mgelbart/ray | 4cec2286572e368a4bd64aae467751a384eff62d | [
"Apache-2.0"
] | 10 | 2018-04-27T10:50:59.000Z | 2020-02-24T02:41:43.000Z | from distutils.version import LooseVersion
import numpy as np
import ray
import ray.rllib.agents.ppo as ppo
import onnxruntime
import os
import shutil
import torch
# Configure our PPO trainer
config = ppo.DEFAULT_CONFIG.copy()
config["num_gpus"] = 0
config["num_workers"] = 1
config["framework"] = "torch"
outdir = "e... | 26.115942 | 86 | 0.736404 | from distutils.version import LooseVersion
import numpy as np
import ray
import ray.rllib.agents.ppo as ppo
import onnxruntime
import os
import shutil
import torch
config = ppo.DEFAULT_CONFIG.copy()
config["num_gpus"] = 0
config["num_workers"] = 1
config["framework"] = "torch"
outdir = "export_torch"
if os.path.exis... | true | true |
1c461b183b4ab4d591ec0f8eb4bc1dd4b40c8651 | 152 | py | Python | webapp/urls.py | knschuckmann/Django_tableview | 1b874baf96fc72756e63f9c4178465c7064b9465 | [
"Apache-2.0"
] | null | null | null | webapp/urls.py | knschuckmann/Django_tableview | 1b874baf96fc72756e63f9c4178465c7064b9465 | [
"Apache-2.0"
] | null | null | null | webapp/urls.py | knschuckmann/Django_tableview | 1b874baf96fc72756e63f9c4178465c7064b9465 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from django.urls import path
from webapp import views
urlpatterns = [
path('', views.TableView.as_view(), name='webapp'),
] | 21.714286 | 55 | 0.664474 | from django.urls import path
from webapp import views
urlpatterns = [
path('', views.TableView.as_view(), name='webapp'),
] | true | true |
1c461c15867001aca948defb8fbac5a5e9fb967f | 11,442 | py | Python | tests/Demo.py | adityasingh177/trusted-compute-framework | b91410f6da21ba4d7458dd02048a447bcd4fed5a | [
"Apache-2.0"
] | null | null | null | tests/Demo.py | adityasingh177/trusted-compute-framework | b91410f6da21ba4d7458dd02048a447bcd4fed5a | [
"Apache-2.0"
] | null | null | null | tests/Demo.py | adityasingh177/trusted-compute-framework | b91410f6da21ba4d7458dd02048a447bcd4fed5a | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 40.718861 | 107 | 0.569743 |
import os
import sys
import time
import argparse
import random
import json
import logging
from service_client.generic import GenericServiceClient
import crypto.crypto as crypto
import utility.signature as signature
import worker.worker_details as worker
from shared_kv.shared_kv_interface import KvStorage
import utili... | true | true |
1c461c7ae39191873d06db62c17134524c45c945 | 16,111 | py | Python | vstruct/defs/pcap.py | rnui2k/vivisect | b7b00f2d03defef28b4b8c912e3a8016e956c5f7 | [
"ECL-2.0",
"Apache-2.0"
] | 716 | 2015-01-01T14:41:11.000Z | 2022-03-28T06:51:50.000Z | vstruct/defs/pcap.py | rnui2k/vivisect | b7b00f2d03defef28b4b8c912e3a8016e956c5f7 | [
"ECL-2.0",
"Apache-2.0"
] | 266 | 2015-01-01T15:07:27.000Z | 2022-03-30T15:19:26.000Z | vstruct/defs/pcap.py | rnui2k/vivisect | b7b00f2d03defef28b4b8c912e3a8016e956c5f7 | [
"ECL-2.0",
"Apache-2.0"
] | 159 | 2015-01-01T16:19:44.000Z | 2022-03-21T21:55:34.000Z | import logging
import vstruct
import vstruct.defs.inet as vs_inet
from vstruct.primitives import *
logger = logging.getLogger(__name__)
PCAP_LINKTYPE_ETHER = 1
PCAP_LINKTYPE_RAW = 101
PCAP_LINKTYPE_LINUX_SLL = 113
PCAP_DLT_RAW = 12
PCAPNG_BOM = 0x1A2B3C4D
OPT_ENDOFOPT =... | 32.547475 | 119 | 0.597232 | import logging
import vstruct
import vstruct.defs.inet as vs_inet
from vstruct.primitives import *
logger = logging.getLogger(__name__)
PCAP_LINKTYPE_ETHER = 1
PCAP_LINKTYPE_RAW = 101
PCAP_LINKTYPE_LINUX_SLL = 113
PCAP_DLT_RAW = 12
PCAPNG_BOM = 0x1A2B3C4D
OPT_ENDOFOPT =... | true | true |
1c461db4bc60cf1e92582559dd48bd01ee94d6f7 | 456 | py | Python | src/util/__init__.py | seahrh/coding-interview | 517d19e7e88c02acec4aa6336bc20206ce3f1897 | [
"MIT"
] | null | null | null | src/util/__init__.py | seahrh/coding-interview | 517d19e7e88c02acec4aa6336bc20206ce3f1897 | [
"MIT"
] | null | null | null | src/util/__init__.py | seahrh/coding-interview | 517d19e7e88c02acec4aa6336bc20206ce3f1897 | [
"MIT"
] | null | null | null | from typing import Iterable
# skip mypy check because open issue https://github.com/python/typing/issues/760
def argmin(elements: Iterable) -> int:
"""Returns first index of smallest element."""
return min(enumerate(elements), key=lambda x: x[1])[0] # type: ignore
def argmax(elements: Iterable) ... | 32.571429 | 81 | 0.677632 | from typing import Iterable
def argmin(elements: Iterable) -> int:
return min(enumerate(elements), key=lambda x: x[1])[0]
def argmax(elements: Iterable) -> int:
return max(enumerate(elements), key=lambda x: x[1])[0] | true | true |
1c461e2d8f683c54e0e3cf71b790ddfb6dc91f8a | 2,131 | py | Python | opencv_disparity/test.py | salihmarangoz/StereoDepthEstimation | a068df34329ee0642b5eb4277dedcd7012d78b4d | [
"MIT"
] | null | null | null | opencv_disparity/test.py | salihmarangoz/StereoDepthEstimation | a068df34329ee0642b5eb4277dedcd7012d78b4d | [
"MIT"
] | null | null | null | opencv_disparity/test.py | salihmarangoz/StereoDepthEstimation | a068df34329ee0642b5eb4277dedcd7012d78b4d | [
"MIT"
] | null | null | null | ##################################################################################
# SOURCE: https://github.com/aliyasineser/stereoDepth/blob/master/stereo_depth.py
##################################################################################
import numpy as np
import cv2 as cv
import cv2
from matplotlib import p... | 38.745455 | 136 | 0.63679 |
import numpy as np
import cv2 as cv
import cv2
from matplotlib import pyplot as plt
def depth_map(imgL, imgR):
window_size = 3
left_matcher = cv2.StereoSGBM_create(
minDisparity=0,
numDisparities=12*16, blockSize=window_size,
P1=8 * 5 * window_size,
P2=32... | true | true |
1c461f5be0efef6234d9d0aa8c49ba9cdafb8ecd | 10,102 | py | Python | tests/unit/fs.py | ach3/fibratus | 655f0e6cee88caff4f75488fd90bf1bb00693847 | [
"Apache-2.0"
] | null | null | null | tests/unit/fs.py | ach3/fibratus | 655f0e6cee88caff4f75488fd90bf1bb00693847 | [
"Apache-2.0"
] | null | null | null | tests/unit/fs.py | ach3/fibratus | 655f0e6cee88caff4f75488fd90bf1bb00693847 | [
"Apache-2.0"
] | 1 | 2022-03-07T08:05:34.000Z | 2022-03-07T08:05:34.000Z | # Copyright 2015 by Nedim Sabic (RabbitStack)
# All Rights Reserved.
# http://rabbitstack.github.io
# 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... | 65.597403 | 123 | 0.544447 |
from unittest.mock import Mock
import pytest
from fibratus.common import DotD as dd, NA
from fibratus.fs import FsIO, FileOps
from fibratus.handle import HandleInfo, HandleType
from fibratus.kevent import KEvent
from fibratus.kevent_types import CREATE_FILE, DELETE_FILE, WRITE_FILE, RENAME_FILE, SET_FILE_INFORMATIO... | true | true |
1c461fa375b527ed770883ccd44488bbb7967dad | 1,644 | py | Python | temp_scripts/update_parameters.py | openmaker-eu/watchtower | af4d3e92b4cf0bf93c10e288a8b8ea97079da86d | [
"MIT"
] | 2 | 2017-05-16T10:57:29.000Z | 2017-12-14T11:33:18.000Z | temp_scripts/update_parameters.py | openmaker-eu/watchtower | af4d3e92b4cf0bf93c10e288a8b8ea97079da86d | [
"MIT"
] | 9 | 2018-11-29T07:44:15.000Z | 2021-12-13T19:54:18.000Z | temp_scripts/update_parameters.py | openmaker-eu/watchtower | af4d3e92b4cf0bf93c10e288a8b8ea97079da86d | [
"MIT"
] | 1 | 2019-02-28T19:00:47.000Z | 2019-02-28T19:00:47.000Z | from application.Connections import Connection
from pdb import set_trace
def updateAudienceParameters(topicID, location, signal_strength):
with Connection.Instance().get_cursor() as cur:
sql = (
"UPDATE audience_parameters "
"SET signal_strength = %s "
"WHERE ... | 34.25 | 113 | 0.58455 | from application.Connections import Connection
from pdb import set_trace
def updateAudienceParameters(topicID, location, signal_strength):
with Connection.Instance().get_cursor() as cur:
sql = (
"UPDATE audience_parameters "
"SET signal_strength = %s "
"WHERE ... | true | true |
1c462039acecb8d459a5e841e0c153542b907b5f | 3,583 | py | Python | sympy/concrete/products.py | gnulinooks/sympy | 46f63841f96cd025289b91ba9db3e261138d720a | [
"BSD-3-Clause"
] | 1 | 2016-05-09T10:08:18.000Z | 2016-05-09T10:08:18.000Z | sympy/concrete/products.py | gnulinooks/sympy | 46f63841f96cd025289b91ba9db3e261138d720a | [
"BSD-3-Clause"
] | null | null | null | sympy/concrete/products.py | gnulinooks/sympy | 46f63841f96cd025289b91ba9db3e261138d720a | [
"BSD-3-Clause"
] | null | null | null |
from sympy.core import Basic, S, C, Add, Mul, Symbol, sympify
from sympy.polys import quo, roots
from sympy.simplify import powsimp
class Product(Basic):
"""Represents unevaluated product.
"""
def __new__(cls, term, *symbols, **assumptions):
term = sympify(term)
if term.is_Number:
... | 25.055944 | 80 | 0.476137 |
from sympy.core import Basic, S, C, Add, Mul, Symbol, sympify
from sympy.polys import quo, roots
from sympy.simplify import powsimp
class Product(Basic):
def __new__(cls, term, *symbols, **assumptions):
term = sympify(term)
if term.is_Number:
if term is S.NaN:
return... | true | true |
1c4620bd5f4a647daadaabbb35603c6d6b7b073f | 7,172 | py | Python | fiber/middleware.py | bsimons/django-fiber | 0f4b03217a4aeba6b48908825507fbe8c5732c8d | [
"Apache-2.0"
] | null | null | null | fiber/middleware.py | bsimons/django-fiber | 0f4b03217a4aeba6b48908825507fbe8c5732c8d | [
"Apache-2.0"
] | null | null | null | fiber/middleware.py | bsimons/django-fiber | 0f4b03217a4aeba6b48908825507fbe8c5732c8d | [
"Apache-2.0"
] | null | null | null | import random
import re
import json
from urllib import unquote
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.template import loader, RequestContext
from django.utils.encoding import smart_text
from django.utils.html import escape
from fiber.app_settings import L... | 43.204819 | 198 | 0.641104 | import random
import re
import json
from urllib import unquote
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.template import loader, RequestContext
from django.utils.encoding import smart_text
from django.utils.html import escape
from fiber.app_settings import L... | true | true |
1c46219a94ef2b0745f859e73be317175fb547fb | 391 | py | Python | rsvp/urls.py | DXDSpirits/appsbackend | 2c69487c4e4d6dc78091ba8030889a5ddc990836 | [
"MIT"
] | null | null | null | rsvp/urls.py | DXDSpirits/appsbackend | 2c69487c4e4d6dc78091ba8030889a5ddc990836 | [
"MIT"
] | null | null | null | rsvp/urls.py | DXDSpirits/appsbackend | 2c69487c4e4d6dc78091ba8030889a5ddc990836 | [
"MIT"
] | null | null | null | from django.conf.urls import url, patterns, include
from rest_framework.routers import DefaultRouter
from rsvp import views
router = DefaultRouter()
router.register(r'rsvp', views.RsvpViewSet)
router.register(r'guest', views.GuestViewSet)
urlpatterns = patterns('',
url(r'^', include(router.urls)),
url(r'^api-... | 30.076923 | 83 | 0.754476 | from django.conf.urls import url, patterns, include
from rest_framework.routers import DefaultRouter
from rsvp import views
router = DefaultRouter()
router.register(r'rsvp', views.RsvpViewSet)
router.register(r'guest', views.GuestViewSet)
urlpatterns = patterns('',
url(r'^', include(router.urls)),
url(r'^api-... | true | true |
1c4624dd307575e0198507f2f32738456ad7f101 | 1,086 | py | Python | util.py | mhaberler/jumpvis | 93b3b723d27aab7f3d4319cc91d06432022ddc6d | [
"MIT"
] | null | null | null | util.py | mhaberler/jumpvis | 93b3b723d27aab7f3d4319cc91d06432022ddc6d | [
"MIT"
] | null | null | null | util.py | mhaberler/jumpvis | 93b3b723d27aab7f3d4319cc91d06432022ddc6d | [
"MIT"
] | null | null | null |
def get_bounds(points):
"""
return bounding box of a list of gpxpy points
"""
min_lat = None
max_lat = None
min_lon = None
max_lon = None
min_ele = None
max_ele = None
for point in points:
if min_lat is None or point.latitude < min_lat:
min_lat = point.latit... | 32.909091 | 67 | 0.608656 |
def get_bounds(points):
min_lat = None
max_lat = None
min_lon = None
max_lon = None
min_ele = None
max_ele = None
for point in points:
if min_lat is None or point.latitude < min_lat:
min_lat = point.latitude
if max_lat is None or point.latitude > max_lat:
... | true | true |
1c4624f33204aa75a7cdc3d84fb7b0e45eb71211 | 8,645 | py | Python | vendor-local/lib/python/taggit/managers.py | lmorchard/badg.us | aa75b9cb6858e99de16aa840add0eef9065fdb4c | [
"BSD-3-Clause"
] | 4 | 2015-09-01T01:19:45.000Z | 2018-05-16T16:03:10.000Z | vendor-local/lib/python/taggit/managers.py | lmorchard/badg.us | aa75b9cb6858e99de16aa840add0eef9065fdb4c | [
"BSD-3-Clause"
] | 7 | 2022-01-11T19:42:12.000Z | 2022-01-11T19:42:55.000Z | vendor-local/lib/python/taggit/managers.py | lmorchard/badg.us | aa75b9cb6858e99de16aa840add0eef9065fdb4c | [
"BSD-3-Clause"
] | 3 | 2015-05-21T15:36:01.000Z | 2020-11-20T23:58:12.000Z | from django.contrib.contenttypes.generic import GenericRelation
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db.models.fields.related import ManyToManyRel, RelatedField, add_lazy_relation
from django.db.models.related import RelatedObject
from django.utils.text imp... | 34.035433 | 90 | 0.616888 | from django.contrib.contenttypes.generic import GenericRelation
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.db.models.fields.related import ManyToManyRel, RelatedField, add_lazy_relation
from django.db.models.related import RelatedObject
from django.utils.text imp... | true | true |
1c46258e69edc1d51b3b465582f6145ad636ebc5 | 813 | py | Python | Controller/countryStatisticsHashedUserIdsController.py | lionick/map-ip-to-country | ccc44b511b7cf1451849038bae66e682140a68a9 | [
"Apache-2.0"
] | null | null | null | Controller/countryStatisticsHashedUserIdsController.py | lionick/map-ip-to-country | ccc44b511b7cf1451849038bae66e682140a68a9 | [
"Apache-2.0"
] | null | null | null | Controller/countryStatisticsHashedUserIdsController.py | lionick/map-ip-to-country | ccc44b511b7cf1451849038bae66e682140a68a9 | [
"Apache-2.0"
] | 1 | 2021-03-16T11:07:22.000Z | 2021-03-16T11:07:22.000Z | from datetime import date, timedelta
from Model.ipStatistics import ipStatistics
from Model.countryStatisticsHashedUserId import countryStatisticsHashedUserId
from datetime import datetime, timedelta
class countryStatisticsHashedUserIdsController:
@classmethod
def getDataNotMapped(self):
dateFrom = countryStati... | 33.875 | 77 | 0.723247 | from datetime import date, timedelta
from Model.ipStatistics import ipStatistics
from Model.countryStatisticsHashedUserId import countryStatisticsHashedUserId
from datetime import datetime, timedelta
class countryStatisticsHashedUserIdsController:
@classmethod
def getDataNotMapped(self):
dateFrom = countryStati... | true | true |
1c46261cd54386528b25cc006d779402084d8229 | 484 | py | Python | PyPark/version.py | liuzhuogood/PyPark | e605502344a3bfcc7696ba56f193fd50d773f1ea | [
"Apache-2.0"
] | 1 | 2021-11-16T10:33:01.000Z | 2021-11-16T10:33:01.000Z | PyPark/version.py | liuzhuogood/PyPark | e605502344a3bfcc7696ba56f193fd50d773f1ea | [
"Apache-2.0"
] | null | null | null | PyPark/version.py | liuzhuogood/PyPark | e605502344a3bfcc7696ba56f193fd50d773f1ea | [
"Apache-2.0"
] | null | null | null | import logging
from PyPark.util.zk_util import path_join
def print_infos(pk):
for u in pk.rest.services.keys():
pk.log.info(f"Rest Service : /{path_join(pk.rest_base_url, u)}")
if len(pk.rest.services.keys()) > 0:
logging.info(f"Started By [{pk.group}] http://{pk.ip}:{pk.port}")
if pk.nat... | 32.266667 | 74 | 0.646694 | import logging
from PyPark.util.zk_util import path_join
def print_infos(pk):
for u in pk.rest.services.keys():
pk.log.info(f"Rest Service : /{path_join(pk.rest_base_url, u)}")
if len(pk.rest.services.keys()) > 0:
logging.info(f"Started By [{pk.group}] http://{pk.ip}:{pk.port}")
if pk.nat... | true | true |
1c4626a4a0981b699bd3f0e091123348bc6f9ecc | 1,097 | py | Python | python/ConvertDocx2HtmlUsingWord.py | netchira/netchira.github.io | bed7b1425fe0ec206887be9cf48a571afbded9e8 | [
"CC0-1.0"
] | 6 | 2019-09-25T06:43:01.000Z | 2022-03-11T02:54:47.000Z | python/ConvertDocx2HtmlUsingWord.py | netchira/netchira.github.io | bed7b1425fe0ec206887be9cf48a571afbded9e8 | [
"CC0-1.0"
] | 6 | 2019-01-06T07:35:10.000Z | 2022-02-26T03:46:28.000Z | python/ConvertDocx2HtmlUsingWord.py | netchira/netchira.github.io | bed7b1425fe0ec206887be9cf48a571afbded9e8 | [
"CC0-1.0"
] | 7 | 2021-05-14T07:04:36.000Z | 2022-03-20T18:23:28.000Z | # -*- coding: utf-8 -*-
"""
Created on Mon May 26 21:28:35 2019
Spyderエディタ
For Python ver 2.7
@author: netchira
"""
def ConvertDocx2HtmlUsingWord(DocxFilePath):
import win32com.client
import os
# ファイル拡張子の確認
if os.path.exists(DocxFilePath) and (DocxFilePath[-5:] == ".docx"):
# ファイルパスから拡張子(ピリオド含む... | 26.119048 | 71 | 0.678213 | def ConvertDocx2HtmlUsingWord(DocxFilePath):
import win32com.client
import os
if os.path.exists(DocxFilePath) and (DocxFilePath[-5:] == ".docx"):
str_FilePathNoExt = DocxFilePath[0:-5]
str_HtmlFilePath = str_FilePathNoExt + ".htm"
HtmlFilePath = os.path.a... | true | true |
1c4627682d3ef50f786fa60721404010b28e5f2d | 2,151 | py | Python | misp/utils/wsi_utils.py | zhoudaxia233/misp | c0d36e3f1a1eeac417d6bfff015ea5430f1d0de5 | [
"MIT"
] | 2 | 2019-12-21T10:46:57.000Z | 2019-12-22T14:01:23.000Z | misp/utils/wsi_utils.py | zhoudaxia233/misp | c0d36e3f1a1eeac417d6bfff015ea5430f1d0de5 | [
"MIT"
] | null | null | null | misp/utils/wsi_utils.py | zhoudaxia233/misp | c0d36e3f1a1eeac417d6bfff015ea5430f1d0de5 | [
"MIT"
] | null | null | null | import os
import openslide
from openslide.deepzoom import DeepZoomGenerator
from tqdm import tqdm
__all__ = ['WSI', 'validate_mpp', 'stitch_tiles']
class WSI():
def __init__(self, path: str, tile_size: int = 224):
self.path = path
self.tile_size = tile_size
self.slide = openslide.OpenSlid... | 38.410714 | 114 | 0.666202 | import os
import openslide
from openslide.deepzoom import DeepZoomGenerator
from tqdm import tqdm
__all__ = ['WSI', 'validate_mpp', 'stitch_tiles']
class WSI():
def __init__(self, path: str, tile_size: int = 224):
self.path = path
self.tile_size = tile_size
self.slide = openslide.OpenSlid... | true | true |
1c4627bc2af1de74f5fa845dc646606e7fc21076 | 110,473 | py | Python | ds_discovery/sample/map_companies_fortune1000.py | project-hadron/discovery-transition-ds | 08229ca3b7617b42ce2dd8e47ff93876c0843810 | [
"BSD-3-Clause"
] | 2 | 2020-09-21T17:24:16.000Z | 2021-05-28T18:02:54.000Z | ds_discovery/sample/map_companies_fortune1000.py | project-hadron/discovery-transition-ds | 08229ca3b7617b42ce2dd8e47ff93876c0843810 | [
"BSD-3-Clause"
] | null | null | null | ds_discovery/sample/map_companies_fortune1000.py | project-hadron/discovery-transition-ds | 08229ca3b7617b42ce2dd8e47ff93876c0843810 | [
"BSD-3-Clause"
] | 1 | 2021-07-23T13:52:04.000Z | 2021-07-23T13:52:04.000Z | data={'title': ['Walmart', 'Exxon Mobil', 'Berkshire Hathaway', 'Apple', 'UnitedHealth Group', 'McKesson', 'CVS Health', 'Amazon.com', 'AT&T', 'General Motors', 'Ford Motor', 'AmerisourceBergen', 'Chevron', 'Cardinal Health', 'Costco', 'Verizon', 'Kroger', 'General Electric', 'Walgreens Boots Alliance', 'JPMorgan Chase... | 55,236.5 | 110,472 | 0.712165 | data={'title': ['Walmart', 'Exxon Mobil', 'Berkshire Hathaway', 'Apple', 'UnitedHealth Group', 'McKesson', 'CVS Health', 'Amazon.com', 'AT&T', 'General Motors', 'Ford Motor', 'AmerisourceBergen', 'Chevron', 'Cardinal Health', 'Costco', 'Verizon', 'Kroger', 'General Electric', 'Walgreens Boots Alliance', 'JPMorgan Chase... | true | true |
1c4628a354b0cddbcb048a1d50ce815aaa040404 | 277 | py | Python | dev_global/dev_global/env.py | FrederichRiver/neutrino3 | c16c6ea824999c012252d0e281473a6ab13fd38e | [
"BSD-3-Clause"
] | 1 | 2021-07-12T11:20:58.000Z | 2021-07-12T11:20:58.000Z | dev_global/dev_global/env.py | FrederichRiver/neutrino3 | c16c6ea824999c012252d0e281473a6ab13fd38e | [
"BSD-3-Clause"
] | null | null | null | dev_global/dev_global/env.py | FrederichRiver/neutrino3 | c16c6ea824999c012252d0e281473a6ab13fd38e | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python3
"""
global environment varibles
"""
PYTHON_VERSION = 3.8
LOCAL_TIME_ZONE = 'Beijing'
PROG_NAME = 'Neutrino'
TIME_FMT = '%Y-%m-%d'
LOG_TIME_FMT = "%Y-%m-%d %H:%M:%S"
GITHUB_URL = "https://github.com/FrederichRiver/neutrino3"
EMAIL = "hezhiyuan_tju@163.com"
| 19.785714 | 58 | 0.696751 |
PYTHON_VERSION = 3.8
LOCAL_TIME_ZONE = 'Beijing'
PROG_NAME = 'Neutrino'
TIME_FMT = '%Y-%m-%d'
LOG_TIME_FMT = "%Y-%m-%d %H:%M:%S"
GITHUB_URL = "https://github.com/FrederichRiver/neutrino3"
EMAIL = "hezhiyuan_tju@163.com"
| true | true |
1c462bb178d3b38b6a5d6e1fcb701ca8021f18d6 | 4,671 | py | Python | src/djangoSrc/app_api/settings.py | dighr/nethope_audio | 8571bd6f621920f3fea085be3879cab15ccfc1e6 | [
"MIT"
] | null | null | null | src/djangoSrc/app_api/settings.py | dighr/nethope_audio | 8571bd6f621920f3fea085be3879cab15ccfc1e6 | [
"MIT"
] | 9 | 2021-03-09T21:01:14.000Z | 2022-03-02T06:01:00.000Z | src/djangoSrc/app_api/settings.py | nethopeorg/nethope_audio | 8571bd6f621920f3fea085be3879cab15ccfc1e6 | [
"MIT"
] | null | null | null | """
Django settings for app_api project.
Generated by 'django-admin startproject' using Django 2.2.6.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
#... | 28.309091 | 98 | 0.673946 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '6xxk%%z1ii*9%j(a-8p63(l&v$fb2de1w2fl24b(@rxzgcpk-8'
DEBUG = True
ALLOWED_HOSTS = ['nethope-pr-assessment.appspot.com', '127.0.0.1']
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django... | true | true |
1c462c16ea8f0a10483f7cda6cfdbfbea0e74394 | 615 | py | Python | themes/solarized-light.py | ruturajv/powerline-shell | 2c30b504bc1da01e8f0a2bc2723ad5cc70662ec8 | [
"MIT"
] | null | null | null | themes/solarized-light.py | ruturajv/powerline-shell | 2c30b504bc1da01e8f0a2bc2723ad5cc70662ec8 | [
"MIT"
] | null | null | null | themes/solarized-light.py | ruturajv/powerline-shell | 2c30b504bc1da01e8f0a2bc2723ad5cc70662ec8 | [
"MIT"
] | null | null | null | class Color(DefaultColor):
USERNAME_FG = 15
USERNAME_BG = 4
USERNAME_ROOT_BG = 1
HOSTNAME_FG = 15
HOSTNAME_BG = 10
HOME_SPECIAL_DISPLAY = False
PATH_FG = 10
PATH_BG = 7
CWD_FG = 0
SEPARATOR_FG = 14
READONLY_BG = 1
READONLY_FG = 7
REPO_CLEAN_FG = 0
REPO_CLEAN_B... | 17.083333 | 34 | 0.64065 | class Color(DefaultColor):
USERNAME_FG = 15
USERNAME_BG = 4
USERNAME_ROOT_BG = 1
HOSTNAME_FG = 15
HOSTNAME_BG = 10
HOME_SPECIAL_DISPLAY = False
PATH_FG = 10
PATH_BG = 7
CWD_FG = 0
SEPARATOR_FG = 14
READONLY_BG = 1
READONLY_FG = 7
REPO_CLEAN_FG = 0
REPO_CLEAN_B... | true | true |
1c462cdb35036a78451f4184c423dcc60ac9ac47 | 7,497 | py | Python | poptorch/toolbox/Dataloader_h5.py | balewski/neuron_inverter_benchmark | 4ad8a03c07e174728ccea2bc5f24d1ae620966a8 | [
"MIT"
] | null | null | null | poptorch/toolbox/Dataloader_h5.py | balewski/neuron_inverter_benchmark | 4ad8a03c07e174728ccea2bc5f24d1ae620966a8 | [
"MIT"
] | null | null | null | poptorch/toolbox/Dataloader_h5.py | balewski/neuron_inverter_benchmark | 4ad8a03c07e174728ccea2bc5f24d1ae620966a8 | [
"MIT"
] | 1 | 2022-01-14T22:25:20.000Z | 2022-01-14T22:25:20.000Z | __author__ = "Jan Balewski"
__email__ = "janstar1122@gmail.com"
'''
this data loader reads all data upon start, there is no distributed sampler
reads all data at once and serves them from RAM
- optimized for mult-GPU training
- only used block of data from each H5-file
- reads data from common file for all ranks
- a... | 38.25 | 246 | 0.577431 | __author__ = "Jan Balewski"
__email__ = "janstar1122@gmail.com"
import time, os
import random
import h5py
import numpy as np
from pprint import pprint
import copy
from torch.utils.data import Dataset, DataLoader
import torch
import logging
import poptorch
def get_data_loader(params, inpMD,domain,popopts, ver... | true | true |
1c462d72ef28053c69095bed607d4c067e869b96 | 3,358 | py | Python | expression_evaluation.py | mengguoru/expression_evaluation | a2e4dd45611e4577c38b40de3a718ecd5f77c5ae | [
"MIT"
] | null | null | null | expression_evaluation.py | mengguoru/expression_evaluation | a2e4dd45611e4577c38b40de3a718ecd5f77c5ae | [
"MIT"
] | null | null | null | expression_evaluation.py | mengguoru/expression_evaluation | a2e4dd45611e4577c38b40de3a718ecd5f77c5ae | [
"MIT"
] | null | null | null | '''
expression evaluation
author : mengguoru
date : 2016/03/27
'''
import re
class Expression:
def split(self,expr):
'''split numbers and operators into a array,return the array (without whiteSpace)'''
temp = re.split(r"(\+|\-|\*|\/|\(|\))",re.sub(r"\s+",'',expr))
temp2 = []
for ... | 38.159091 | 98 | 0.432102 | import re
class Expression:
def split(self,expr):
temp = re.split(r"(\+|\-|\*|\/|\(|\))",re.sub(r"\s+",'',expr))
temp2 = []
for i in range(len(temp)):
if temp[i] != '':
temp2.append(temp[i])
return temp2
def infix_to_suffix(self,expr):
stack_o... | true | true |
1c4630086ef30c6136a9edabe95d3911ecb465d4 | 13,194 | py | Python | lambda_function.py | rubrikinc/aws-native-secrets-rotation | c1488cc1b6fc2b89d32c83bd220678ee3bebfdbd | [
"MIT"
] | 1 | 2019-12-20T13:35:34.000Z | 2019-12-20T13:35:34.000Z | lambda_function.py | rubrikinc/aws-native-secrets-rotation | c1488cc1b6fc2b89d32c83bd220678ee3bebfdbd | [
"MIT"
] | null | null | null | lambda_function.py | rubrikinc/aws-native-secrets-rotation | c1488cc1b6fc2b89d32c83bd220678ee3bebfdbd | [
"MIT"
] | 2 | 2019-04-01T22:18:58.000Z | 2020-03-13T15:08:26.000Z | #!/usr/local/bin/python3
import boto3
import logging
import os
import ast
import json
import rubrik_cdm
from copy import deepcopy
import urllib3
urllib3.disable_warnings()
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def lambda_handler(event, context):
"""Secrets Manager Rotation Template
This... | 53.417004 | 167 | 0.719948 |
import boto3
import logging
import os
import ast
import json
import rubrik_cdm
from copy import deepcopy
import urllib3
urllib3.disable_warnings()
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def lambda_handler(event, context):
arn = event['SecretId']
token = event['ClientRequestToken']
st... | true | true |
1c4630ae0f50b4044900f2782a2b8d3bff5fdc1e | 401 | py | Python | task_manager_api/task_manager_api/urls.py | LsbProxy/task_manager_api | b014d74aa3cd5bc9952ac04548350d3a08836c8f | [
"MIT"
] | null | null | null | task_manager_api/task_manager_api/urls.py | LsbProxy/task_manager_api | b014d74aa3cd5bc9952ac04548350d3a08836c8f | [
"MIT"
] | null | null | null | task_manager_api/task_manager_api/urls.py | LsbProxy/task_manager_api | b014d74aa3cd5bc9952ac04548350d3a08836c8f | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('', include('auth.urls')),
path('', include('api.urls')),
path('admin/', admin.site.urls),
]
if settings.DEBUG:
urlpatterns += static(... | 26.733333 | 60 | 0.680798 | from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('', include('auth.urls')),
path('', include('api.urls')),
path('admin/', admin.site.urls),
]
if settings.DEBUG:
urlpatterns += static(... | true | true |
1c4631519443af09252e50a84ea2e878f561085d | 20,551 | py | Python | flux_combined_high_binding/model_857.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | flux_combined_high_binding/model_857.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | flux_combined_high_binding/model_857.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | # exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', '... | 95.143519 | 798 | 0.804146 |
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', 'BaxA'])
Monomer('Apop', ['C3pro', '... | true | true |
1c4631a70ee71cb407b8c93a4400df836801fe55 | 1,365 | py | Python | examples/cellular_example.py | timhunderwood/numpy-to-stl | eea305ae30bb4aa5882d7c66edebe76173da8b06 | [
"MIT"
] | 1 | 2020-12-29T08:56:48.000Z | 2020-12-29T08:56:48.000Z | examples/cellular_example.py | timhunderwood/numpy-to-stl | eea305ae30bb4aa5882d7c66edebe76173da8b06 | [
"MIT"
] | null | null | null | examples/cellular_example.py | timhunderwood/numpy-to-stl | eea305ae30bb4aa5882d7c66edebe76173da8b06 | [
"MIT"
] | 1 | 2021-06-16T02:06:40.000Z | 2021-06-16T02:06:40.000Z | import cellular
import numpy
import mpl_toolkits.mplot3d
import matplotlib.pyplot as plt
import numpy_to_stl
def get_simulated_world(cells_per_day, rule, number_of_days):
world = cellular.World(cells_per_day, rule, ones=False)
world.simulate(number_of_days)
world.display(landscape=True)
return numpy.v... | 29.673913 | 88 | 0.745788 | import cellular
import numpy
import mpl_toolkits.mplot3d
import matplotlib.pyplot as plt
import numpy_to_stl
def get_simulated_world(cells_per_day, rule, number_of_days):
world = cellular.World(cells_per_day, rule, ones=False)
world.simulate(number_of_days)
world.display(landscape=True)
return numpy.v... | true | true |
1c463309478ab2730838c468b3402f7a8124d47e | 3,752 | py | Python | elasticlogger/hooks/elasticsearch/elasticsearch.py | danteay/elasticlogger | 3182e3d1d34564a5e95aaef3c10239d162eb691a | [
"MIT"
] | 1 | 2021-06-27T10:17:16.000Z | 2021-06-27T10:17:16.000Z | elasticlogger/hooks/elasticsearch/elasticsearch.py | danteay/elasticlogger | 3182e3d1d34564a5e95aaef3c10239d162eb691a | [
"MIT"
] | 4 | 2021-06-29T19:41:39.000Z | 2021-09-23T21:47:22.000Z | elasticlogger/hooks/elasticsearch/elasticsearch.py | danteay/elasticlogger | 3182e3d1d34564a5e95aaef3c10239d162eb691a | [
"MIT"
] | 1 | 2022-03-14T18:27:42.000Z | 2022-03-14T18:27:42.000Z | """Elastic search hook function."""
import os
import re
from datetime import datetime
from logging import CRITICAL, DEBUG, ERROR, INFO, WARNING
from typing import Any, AnyStr, Dict, NoReturn, Optional
from elasticsearch import Elasticsearch
from elasticlogger import utils
from elasticlogger.hooks import HookContext
... | 32.068376 | 114 | 0.661247 |
import os
import re
from datetime import datetime
from logging import CRITICAL, DEBUG, ERROR, INFO, WARNING
from typing import Any, AnyStr, Dict, NoReturn, Optional
from elasticsearch import Elasticsearch
from elasticlogger import utils
from elasticlogger.hooks import HookContext
from elasticlogger.ports.elasticsear... | true | true |
1c4633fe467d2a4c8b937c02025f2e49b2342f56 | 420 | py | Python | instapics/forms.py | UMULISA12/Instagram_Ip | 169c9326ef247c85808d9b7b8989c59740887615 | [
"MIT"
] | null | null | null | instapics/forms.py | UMULISA12/Instagram_Ip | 169c9326ef247c85808d9b7b8989c59740887615 | [
"MIT"
] | null | null | null | instapics/forms.py | UMULISA12/Instagram_Ip | 169c9326ef247c85808d9b7b8989c59740887615 | [
"MIT"
] | null | null | null | from .models import Image,Profile,Comment
from django import forms
class NewImageForm(forms.ModelForm):
class Meta:
model=Image
exclude=['profile','pub_date','name','likes','comments']
class NewProfileForm(forms.ModelForm):
class Meta:
model=Profile
exclude=['user']
class NewC... | 24.705882 | 64 | 0.666667 | from .models import Image,Profile,Comment
from django import forms
class NewImageForm(forms.ModelForm):
class Meta:
model=Image
exclude=['profile','pub_date','name','likes','comments']
class NewProfileForm(forms.ModelForm):
class Meta:
model=Profile
exclude=['user']
class NewC... | true | true |
1c4634872f7d494377366f5d864db3ecea175182 | 1,794 | py | Python | dataset/dataset_test.py | Beta3-Data/FacialLandmark-Live-Training | 10b2b464f1deb015a7f152bb14f120f0dc6f9de2 | [
"MIT"
] | null | null | null | dataset/dataset_test.py | Beta3-Data/FacialLandmark-Live-Training | 10b2b464f1deb015a7f152bb14f120f0dc6f9de2 | [
"MIT"
] | null | null | null | dataset/dataset_test.py | Beta3-Data/FacialLandmark-Live-Training | 10b2b464f1deb015a7f152bb14f120f0dc6f9de2 | [
"MIT"
] | null | null | null | from __future__ import print_function, division
import os
import torch
import pandas as pd
from skimage import io, transform
import numpy as np
import matplotlib.pyplot as plt
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms, utils
from FaceLandmarksDataset import FaceLandmar... | 30.40678 | 75 | 0.682832 | from __future__ import print_function, division
import os
import torch
import pandas as pd
from skimage import io, transform
import numpy as np
import matplotlib.pyplot as plt
from torch.utils.data import Dataset, DataLoader
from torchvision import transforms, utils
from FaceLandmarksDataset import FaceLandmar... | true | true |
1c4634bf1a119368bd2b1ab2cfa1775e8ec4d0ce | 9,856 | py | Python | pyzoo/test/zoo/automl/model/test_Seq2Seq.py | Wesley-Du/analytics-zoo | e4ca11b219a43bceec99aba39cf30c8aa368e8b3 | [
"Apache-2.0"
] | 35 | 2020-07-03T06:31:12.000Z | 2020-07-12T08:38:10.000Z | pyzoo/test/zoo/automl/model/test_Seq2Seq.py | Angelina319/analytics-zoo | 439f2c99d657fb20a5ff4bf510869616402ba0cf | [
"Apache-2.0"
] | 2 | 2018-10-31T01:20:05.000Z | 2018-11-02T06:06:35.000Z | pyzoo/test/zoo/automl/model/test_Seq2Seq.py | Angelina319/analytics-zoo | 439f2c99d657fb20a5ff4bf510869616402ba0cf | [
"Apache-2.0"
] | 4 | 2019-02-25T03:26:56.000Z | 2019-03-06T04:41:31.000Z | #
# Copyright 2018 Analytics Zoo Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 48.078049 | 94 | 0.581879 |
import shutil
import tempfile
import pytest
from test.zoo.pipeline.utils.test_utils import ZooTestCase
from zoo.automl.model.Seq2Seq import *
from zoo.automl.feature.time_sequence import TimeSequenceFeatureTransformer
from numpy.testing import assert_array_almost_equal
class TestSeq2Seq(ZooTestCase):
def setu... | true | true |
1c46378d907548f7177d7694871d9e0601053adf | 61,104 | py | Python | python/ccxt/bitfinex2.py | Jsn2win/ccxt | fff369de2192a3b7c71ab1d29d0923db8d5af913 | [
"MIT"
] | null | null | null | python/ccxt/bitfinex2.py | Jsn2win/ccxt | fff369de2192a3b7c71ab1d29d0923db8d5af913 | [
"MIT"
] | null | null | null | python/ccxt/bitfinex2.py | Jsn2win/ccxt | fff369de2192a3b7c71ab1d29d0923db8d5af913 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
from ccxt.bitfinex import bitfinex
import hashlib
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import Authe... | 41.539089 | 207 | 0.45961 |
from ccxt.bitfinex import bitfinex
import hashlib
import math
from ccxt.base.errors import ExchangeError
from ccxt.base.errors import AuthenticationError
from ccxt.base.errors import ArgumentsRequired
from ccxt.base.errors import BadRequest
from ccxt.base.errors import BadSymbol
from ccxt.base.errors import Insuffici... | true | true |
1c46380a9d4866b842ff9a1c2591e0d1ba1f4588 | 11,345 | py | Python | nuitka/tree/ReformulationDictionaryCreation.py | em3ndez/Nuitka | a5a036a94c1842d1cd72f27c0c67461798fdf977 | [
"Apache-2.0"
] | 1 | 2019-09-09T19:27:43.000Z | 2019-09-09T19:27:43.000Z | nuitka/tree/ReformulationDictionaryCreation.py | em3ndez/Nuitka | a5a036a94c1842d1cd72f27c0c67461798fdf977 | [
"Apache-2.0"
] | 1 | 2019-02-21T13:05:17.000Z | 2019-02-21T13:05:17.000Z | nuitka/tree/ReformulationDictionaryCreation.py | em3ndez/Nuitka | a5a036a94c1842d1cd72f27c0c67461798fdf977 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | 36.362179 | 87 | 0.603967 |
from nuitka.nodes.AssignNodes import (
StatementAssignmentVariable,
StatementDelVariable,
StatementReleaseVariable,
)
from nuitka.nodes.AttributeNodes import ExpressionAttributeLookup
from nuitka.nodes.BuiltinIteratorNodes import ExpressionBuiltinIter1
from nuitka.nodes.BuiltinNextNodes import ExpressionBu... | true | true |
1c46385a5596d5e0bd98b187dbff517c3d1d3c1c | 20,549 | py | Python | flux_combined_high_binding/model_741.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | flux_combined_high_binding/model_741.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | flux_combined_high_binding/model_741.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | # exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', '... | 95.134259 | 798 | 0.804127 |
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', 'BaxA'])
Monomer('Apop', ['C3pro', '... | true | true |
1c463a5d7cdbdef19a2f8ee060198069e58e05e9 | 549 | py | Python | core/utils.py | matiaspacheco/cms_wehaa | 999f49344c453afd1cf8f11f36ac6b56b2b7f130 | [
"MIT"
] | null | null | null | core/utils.py | matiaspacheco/cms_wehaa | 999f49344c453afd1cf8f11f36ac6b56b2b7f130 | [
"MIT"
] | null | null | null | core/utils.py | matiaspacheco/cms_wehaa | 999f49344c453afd1cf8f11f36ac6b56b2b7f130 | [
"MIT"
] | null | null | null | # Standard Python library imports.
import math
import re
# Core Django imports.
from django.utils.html import strip_tags
def count_words(html_string):
# html_string = """
# <h1>This is a title</h1>
# """
word_string = strip_tags(html_string)
matching_words = re.findall(r'\w+', word_string)
cou... | 26.142857 | 67 | 0.714026 | import math
import re
from django.utils.html import strip_tags
def count_words(html_string):
# <h1>This is a title</h1>
# """
word_string = strip_tags(html_string)
matching_words = re.findall(r'\w+', word_string)
count = len(matching_words) return count
def read_time(html_string):
cou... | true | true |
1c463a5ecbad7e73fb57009519d7ca474d07af2c | 2,566 | py | Python | web-api/favorites/views.py | Egor4ik325/anyberry | 87787f82f1cec0f32d9d7c7384e7b2771f34af3c | [
"MIT"
] | 1 | 2021-09-12T16:28:52.000Z | 2021-09-12T16:28:52.000Z | web-api/favorites/views.py | Egor4ik325/anyberry | 87787f82f1cec0f32d9d7c7384e7b2771f34af3c | [
"MIT"
] | 2 | 2021-09-06T08:31:56.000Z | 2021-09-06T08:35:25.000Z | web-api/favorites/views.py | Egor4ik325/anyberry | 87787f82f1cec0f32d9d7c7384e7b2771f34af3c | [
"MIT"
] | null | null | null | from berries.models import Berry
from berries.serializers import BerrySerializer
from django.core.cache import cache
from rest_framework import status
from rest_framework.authentication import SessionAuthentication
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from ... | 32.897436 | 69 | 0.687062 | from berries.models import Berry
from berries.serializers import BerrySerializer
from django.core.cache import cache
from rest_framework import status
from rest_framework.authentication import SessionAuthentication
from rest_framework.permissions import IsAuthenticated
from rest_framework.response import Response
from ... | true | true |
1c463a9792c032fff33e3627f78835a1ae9c2a50 | 4,436 | py | Python | elastalert/kibana_external_url_formatter.py | buratinopy/elastalert2 | 27deb8a61dd48798c4686ec95d3e48909903a694 | [
"Apache-2.0"
] | null | null | null | elastalert/kibana_external_url_formatter.py | buratinopy/elastalert2 | 27deb8a61dd48798c4686ec95d3e48909903a694 | [
"Apache-2.0"
] | null | null | null | elastalert/kibana_external_url_formatter.py | buratinopy/elastalert2 | 27deb8a61dd48798c4686ec95d3e48909903a694 | [
"Apache-2.0"
] | null | null | null | import boto3
import os
from urllib.parse import parse_qsl, urlencode, urljoin, urlparse, urlsplit, urlunsplit
import requests
from requests import RequestException
from requests.auth import AuthBase, HTTPBasicAuth
from elastalert.auth import RefeshableAWSRequestsAuth
from elastalert.util import EAException
def appen... | 31.913669 | 86 | 0.665014 | import boto3
import os
from urllib.parse import parse_qsl, urlencode, urljoin, urlparse, urlsplit, urlunsplit
import requests
from requests import RequestException
from requests.auth import AuthBase, HTTPBasicAuth
from elastalert.auth import RefeshableAWSRequestsAuth
from elastalert.util import EAException
def appen... | true | true |
1c463b00bcc93f690abe0126cebd12479e2b2c5d | 1,568 | py | Python | cirq/optimizers/drop_negligible.py | sleichen/Cirq | 02f715203406d1f2af2d86e7561af09a2cdd4d45 | [
"Apache-2.0"
] | 1 | 2020-05-20T00:08:33.000Z | 2020-05-20T00:08:33.000Z | cirq/optimizers/drop_negligible.py | sleichen/Cirq | 02f715203406d1f2af2d86e7561af09a2cdd4d45 | [
"Apache-2.0"
] | null | null | null | cirq/optimizers/drop_negligible.py | sleichen/Cirq | 02f715203406d1f2af2d86e7561af09a2cdd4d45 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The Cirq Developers
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 37.333333 | 78 | 0.714286 |
from typing import TYPE_CHECKING
from cirq import protocols
from cirq.circuits import optimization_pass, circuit as _circuit
if TYPE_CHECKING:
from typing import List, Tuple
from cirq import ops
class DropNegligible(optimization_pass.OptimizationPass):
def __init__(self, tolerance: float = 1e-8) ... | true | true |
1c463cf1cadf9635379497394d42b7e870640036 | 5,782 | py | Python | egs/wenetspeech/ASR/local/text2token.py | zhu-han/icefall | 9f6c748b3098e3e32c704c27c40ec31f2e9d376c | [
"Apache-2.0"
] | null | null | null | egs/wenetspeech/ASR/local/text2token.py | zhu-han/icefall | 9f6c748b3098e3e32c704c27c40ec31f2e9d376c | [
"Apache-2.0"
] | null | null | null | egs/wenetspeech/ASR/local/text2token.py | zhu-han/icefall | 9f6c748b3098e3e32c704c27c40ec31f2e9d376c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2017 Johns Hopkins University (authors: Shinji Watanabe)
# 2022 Xiaomi Corp. (authors: Mingshuang Luo)
#
# See ../../../../LICENSE for clarification regarding multiple authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you m... | 29.350254 | 78 | 0.5422 |
import argparse
import codecs
import re
import sys
from typing import List
from pypinyin import lazy_pinyin, pinyin
is_python2 = sys.version_info[0] == 2
def exist_or_not(i, match_pos):
start_pos = None
end_pos = None
for pos in match_pos:
if pos[0] <= i < pos[1]:
start_pos = pos[0... | true | true |
1c463d061e46a0550d594d6f027f9723b5d225f9 | 43 | py | Python | streams/rewinder/__init__.py | adrn/streams | 6478d37309ba1dff4e13e8e46b93eafb4ef36431 | [
"MIT"
] | null | null | null | streams/rewinder/__init__.py | adrn/streams | 6478d37309ba1dff4e13e8e46b93eafb4ef36431 | [
"MIT"
] | null | null | null | streams/rewinder/__init__.py | adrn/streams | 6478d37309ba1dff4e13e8e46b93eafb4ef36431 | [
"MIT"
] | null | null | null | from .core import *
from .sampler import *
| 14.333333 | 22 | 0.72093 | from .core import *
from .sampler import *
| true | true |
1c463e35fe5e172b70142ced199c9afc204daeb5 | 662 | py | Python | main.py | wang-h/backend-app-fastapi-sqlite | c155229e7187e381457730a40a9d660c0e98440d | [
"MIT"
] | null | null | null | main.py | wang-h/backend-app-fastapi-sqlite | c155229e7187e381457730a40a9d660c0e98440d | [
"MIT"
] | null | null | null | main.py | wang-h/backend-app-fastapi-sqlite | c155229e7187e381457730a40a9d660c0e98440d | [
"MIT"
] | null | null | null | from fastapi import FastAPI
from starlette.middleware.cors import CORSMiddleware
from app.api.api_v1.api import api_router
from app.core.config import settings
app = FastAPI(
title=settings.PROJECT_NAME,
openapi_url="{}/openapi.json".format(settings.API_V1_STR)
)
# 设置跨域请求允许来源
# Set all CORS enabled origins
... | 26.48 | 68 | 0.712991 | from fastapi import FastAPI
from starlette.middleware.cors import CORSMiddleware
from app.api.api_v1.api import api_router
from app.core.config import settings
app = FastAPI(
title=settings.PROJECT_NAME,
openapi_url="{}/openapi.json".format(settings.API_V1_STR)
)
if settings.BACKEND_CORS_ORIGINS:
app.ad... | true | true |
1c463e704757405d935040c3c1db9e5051f1a01b | 3,160 | py | Python | src/python/WMCore/WMRuntime/ScriptInvoke.py | vkuznet/WMCore | 001cc51651052405a7ecd811cde91da611b1dc57 | [
"Apache-2.0"
] | 21 | 2015-11-19T16:18:45.000Z | 2021-12-02T18:20:39.000Z | src/python/WMCore/WMRuntime/ScriptInvoke.py | vkuznet/WMCore | 001cc51651052405a7ecd811cde91da611b1dc57 | [
"Apache-2.0"
] | 5,671 | 2015-01-06T14:38:52.000Z | 2022-03-31T22:11:14.000Z | src/python/WMCore/WMRuntime/ScriptInvoke.py | vkuznet/WMCore | 001cc51651052405a7ecd811cde91da611b1dc57 | [
"Apache-2.0"
] | 67 | 2015-01-21T15:55:38.000Z | 2022-02-03T19:53:13.000Z | #!/usr/bin/env python
"""
_ScriptInvoker_
Util to invoke a Runtime Script and provide it with access to the
various bits of the job that it will need to access via the WMTaskSpace
library
This script will be invoked at runtime from the directory & subshell
environment in which the Runtime Script implementation needs ... | 26.115702 | 77 | 0.631013 |
from __future__ import print_function
from builtins import object
import logging
import os
import sys
import traceback
import WMCore.WMRuntime.Bootstrap as Bootstrap
from WMCore.WMRuntime.ScriptFactory import getScript
class ScriptInvoke(object):
def __init__(self, stepModule, scriptModule):
self.step... | true | true |
1c4640c71ced2b43dbfbe2cdd9de56a41d3e64a9 | 100,233 | py | Python | superset/views/core.py | Altizon/incubator-superset | e55fe43ca67a29518674a1a2137a3dbd4f166864 | [
"Apache-2.0"
] | null | null | null | superset/views/core.py | Altizon/incubator-superset | e55fe43ca67a29518674a1a2137a3dbd4f166864 | [
"Apache-2.0"
] | 5 | 2021-02-02T22:53:35.000Z | 2022-03-29T22:28:22.000Z | superset/views/core.py | mhassant/apache-superset-multi-tenancy | e55fe43ca67a29518674a1a2137a3dbd4f166864 | [
"Apache-2.0"
] | 2 | 2017-12-20T02:44:05.000Z | 2018-02-09T07:19:49.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 36.382214 | 98 | 0.582992 | import logging
import re
from contextlib import closing
from datetime import datetime, timedelta
from typing import Any, cast, Dict, List, Optional, Union
from urllib import parse
import backoff
import msgpack
import pandas as pd
import pyarrow as pa
import simplejson as json
from flask import abort, flash, g, Markup,... | true | true |
1c4641077fa1b4a1700437711e9267173cfd5410 | 160 | py | Python | lights/gridlight_off.py | bprevost/brad_demo | 7c071709f763627d870e2b9e55be332e6af5f4c3 | [
"MIT"
] | null | null | null | lights/gridlight_off.py | bprevost/brad_demo | 7c071709f763627d870e2b9e55be332e6af5f4c3 | [
"MIT"
] | null | null | null | lights/gridlight_off.py | bprevost/brad_demo | 7c071709f763627d870e2b9e55be332e6af5f4c3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import board
import neopixel
NUMPIXELS = 50
pixels = neopixel.NeoPixel(board.D21, NUMPIXELS)
pixels.fill((0, 0, 0)) # Turn off pixels
| 16 | 48 | 0.73125 |
import board
import neopixel
NUMPIXELS = 50
pixels = neopixel.NeoPixel(board.D21, NUMPIXELS)
pixels.fill((0, 0, 0)) | true | true |
1c4641397d7bb7c30bef7cad7ee43801ba62d268 | 2,251 | py | Python | dmgui_au/utilities/find_dropbox.py | Swanson-Hysell-Group/demag_gui_au | d1a233a82ec52dd5907bfee6885668a8c84ae892 | [
"BSD-3-Clause"
] | null | null | null | dmgui_au/utilities/find_dropbox.py | Swanson-Hysell-Group/demag_gui_au | d1a233a82ec52dd5907bfee6885668a8c84ae892 | [
"BSD-3-Clause"
] | null | null | null | dmgui_au/utilities/find_dropbox.py | Swanson-Hysell-Group/demag_gui_au | d1a233a82ec52dd5907bfee6885668a8c84ae892 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
import shutil
try:
import json
except:
pass
def find_dropbox():
"""
Attempts to find local Dropbox folder using json file that Dropbox writes to
users' home directory. Will additionally search for `Hargraves_Data` folder
in th... | 34.106061 | 95 | 0.58685 |
import os
import sys
import shutil
try:
import json
except:
pass
def find_dropbox():
if os.path.isfile(os.path.expanduser(os.path.join("~", ".dropbox", "info.json"))):
drpbx_info_file = os.path.expanduser(os.path.join("~", ".dropbox", "info.json"))
drpbx_info = open(drpbx_info_file, 'r')
... | true | true |
1c46440c615bf74cb4301b1593107054081dbfd6 | 440 | py | Python | venv/Scripts/easy_install-script.py | TG-Techie/HackUMass0111 | 603344064605979b85a2e142caf7a2a7439d60f5 | [
"MIT"
] | null | null | null | venv/Scripts/easy_install-script.py | TG-Techie/HackUMass0111 | 603344064605979b85a2e142caf7a2a7439d60f5 | [
"MIT"
] | 1 | 2019-10-19T09:24:56.000Z | 2019-10-20T05:37:06.000Z | venv/Scripts/easy_install-script.py | TG-Techie/HackUMass0111 | 603344064605979b85a2e142caf7a2a7439d60f5 | [
"MIT"
] | 1 | 2019-10-18T14:18:28.000Z | 2019-10-18T14:18:28.000Z | #!C:\Users\danhi\hackumass0111\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'setuptools==40.8.0','console_scripts','easy_install'
__requires__ = 'setuptools==40.8.0'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '... | 33.846154 | 83 | 0.693182 | __requires__ = 'setuptools==40.8.0'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('setuptools==40.8.0', 'console_scripts', 'easy_install')()
)
| true | true |
1c464563ae1c020a956ead49bce39b9e88737950 | 223 | py | Python | cannes_accomodation/tests/test_accomodation.py | Xogiga/CPOA_INEC_SAVIGNY_VALADE | f33a9e9448f011bcc56abc0c2270bf0c3d9ae43a | [
"MIT"
] | null | null | null | cannes_accomodation/tests/test_accomodation.py | Xogiga/CPOA_INEC_SAVIGNY_VALADE | f33a9e9448f011bcc56abc0c2270bf0c3d9ae43a | [
"MIT"
] | null | null | null | cannes_accomodation/tests/test_accomodation.py | Xogiga/CPOA_INEC_SAVIGNY_VALADE | f33a9e9448f011bcc56abc0c2270bf0c3d9ae43a | [
"MIT"
] | null | null | null | class TestAccomodation:
def test_list_accomodation(self, client):
response = client.get('/accomodation')
assert response.status_code == 200
def test_update_accomodation(client):
pass
| 27.875 | 47 | 0.672646 | class TestAccomodation:
def test_list_accomodation(self, client):
response = client.get('/accomodation')
assert response.status_code == 200
def test_update_accomodation(client):
pass
| true | true |
1c4645726b27358a00869176f220b50c08f8f957 | 7,264 | py | Python | client/log.py | diophung/pyre-check | a488698d86b06b550c0e6e133009c1f396925af2 | [
"MIT"
] | null | null | null | client/log.py | diophung/pyre-check | a488698d86b06b550c0e6e133009c1f396925af2 | [
"MIT"
] | null | null | null | client/log.py | diophung/pyre-check | a488698d86b06b550c0e6e133009c1f396925af2 | [
"MIT"
] | null | null | null | # Copyright (c) 2016-present, Facebook, Inc.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import copy
import io
import logging
import os
import re
import sys
import threading
import time
from typing import List # noqa
LOG = logging.get... | 27.938462 | 87 | 0.58549 |
import copy
import io
import logging
import os
import re
import sys
import threading
import time
from typing import List
LOG = logging.getLogger(__name__)
PERFORMANCE = 15
PROMPT = 50
SUCCESS = 60
stdout = io.StringIO()
class Color:
YELLOW = "\033[33m"
RED = "\033[31m"
class Format:
BOLD = "\033[1... | true | true |
1c4645c2167dbdc5384e8afc9db3098d68ffbf3f | 3,666 | py | Python | scripts/launch_test.py | amarildolikmeta/oac-explore | e3d63992a4ff33c8df593941f498457e94f81eb8 | [
"MIT"
] | null | null | null | scripts/launch_test.py | amarildolikmeta/oac-explore | e3d63992a4ff33c8df593941f498457e94f81eb8 | [
"MIT"
] | null | null | null | scripts/launch_test.py | amarildolikmeta/oac-explore | e3d63992a4ff33c8df593941f498457e94f81eb8 | [
"MIT"
] | 1 | 2021-12-13T15:38:41.000Z | 2021-12-13T15:38:41.000Z | import json
import sys
sys.path.append("../")
from trainer.particle_trainer import ParticleTrainer
from trainer.gaussian_trainer import GaussianTrainer
from trainer.trainer import SACTrainer
import numpy as np
import torch
from main import env_producer, get_policy_producer, get_q_producer
from utils.pythonplusplus impo... | 30.04918 | 95 | 0.678396 | import json
import sys
sys.path.append("../")
from trainer.particle_trainer import ParticleTrainer
from trainer.gaussian_trainer import GaussianTrainer
from trainer.trainer import SACTrainer
import numpy as np
import torch
from main import env_producer, get_policy_producer, get_q_producer
from utils.pythonplusplus impo... | true | true |
1c464629dbe7ff667eaf19f42c16ee577f2ed4fd | 1,277 | py | Python | Echoo/echoo.py | UsedToBe97/Echoo | b08069170bf470415b9fd91fcb943214b69805b8 | [
"MIT"
] | null | null | null | Echoo/echoo.py | UsedToBe97/Echoo | b08069170bf470415b9fd91fcb943214b69805b8 | [
"MIT"
] | null | null | null | Echoo/echoo.py | UsedToBe97/Echoo | b08069170bf470415b9fd91fcb943214b69805b8 | [
"MIT"
] | null | null | null | # import logging
# logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
# level=logging.INFO)
import os
import argparse
import telegram
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
def main(token, chat_id, msg):
bot = telegram.Bot(to... | 30.404762 | 101 | 0.648395 |
import os
import argparse
import telegram
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters
def main(token, chat_id, msg):
bot = telegram.Bot(token=token)
bot.send_message(chat_id=chat_id, text=msg)
def run():
parser = argparse.ArgumentParser(description=r'''Echoo:: A tool let'... | true | true |
1c464866312c86c67ec166f6a47982af30b5e1bc | 9,752 | py | Python | src/v5.1/resources/swagger_client/models/tpdm_teacher_candidate_academic_record_reference.py | xmarcosx/edfi-notebook | 0564ebdf1d0f45a9d25056e7e61369f0a837534d | [
"Apache-2.0"
] | 2 | 2021-04-27T17:18:17.000Z | 2021-04-27T19:14:39.000Z | src/v5.1/resources/swagger_client/models/tpdm_teacher_candidate_academic_record_reference.py | xmarcosx/edfi-notebook | 0564ebdf1d0f45a9d25056e7e61369f0a837534d | [
"Apache-2.0"
] | null | null | null | src/v5.1/resources/swagger_client/models/tpdm_teacher_candidate_academic_record_reference.py | xmarcosx/edfi-notebook | 0564ebdf1d0f45a9d25056e7e61369f0a837534d | [
"Apache-2.0"
] | 1 | 2022-01-06T09:43:11.000Z | 2022-01-06T09:43:11.000Z | # coding: utf-8
"""
Ed-Fi Operational Data Store API
The Ed-Fi ODS / API enables applications to read and write education data stored in an Ed-Fi ODS through a secure REST interface. *** > *Note: Consumers of ODS / API information should sanitize all data for display and storage. The ODS / API provides reas... | 39.642276 | 482 | 0.675759 |
import pprint
import re
import six
from swagger_client.configuration import Configuration
class TpdmTeacherCandidateAcademicRecordReference(object):
swagger_types = {
'education_organization_id': 'int',
'school_year': 'int',
'teacher_candidate_identifier': 'str',
'term_descr... | true | true |
1c464912ecb97ea85dc0a43a1776142eb3f9360b | 1,613 | py | Python | sip/examples/flask_processing_controller/app/api/subarray_list.py | SKA-ScienceDataProcessor/integration-prototype | 5875dc0489f707232534ce75daf3707f909bcd15 | [
"BSD-3-Clause"
] | 3 | 2016-11-08T02:27:05.000Z | 2018-01-22T13:26:11.000Z | sip/examples/flask_processing_controller/app/api/subarray_list.py | SKA-ScienceDataProcessor/integration-prototype | 5875dc0489f707232534ce75daf3707f909bcd15 | [
"BSD-3-Clause"
] | 87 | 2016-11-24T11:09:01.000Z | 2021-03-25T22:23:59.000Z | sip/examples/flask_processing_controller/app/api/subarray_list.py | SKA-ScienceDataProcessor/integration-prototype | 5875dc0489f707232534ce75daf3707f909bcd15 | [
"BSD-3-Clause"
] | 10 | 2016-05-18T09:41:36.000Z | 2019-07-04T10:19:24.000Z | # -*- coding: utf-8 -*-
"""Sub array route"""
import logging
from flask import Blueprint, request
from flask_api import status
from .utils import get_root_url, missing_db_response
from config_db import SchedulingBlockDbClient
BP = Blueprint('subarray_list:', __name__)
DB = SchedulingBlockDbClient()
LOG = logging.get... | 27.810345 | 63 | 0.67018 | import logging
from flask import Blueprint, request
from flask_api import status
from .utils import get_root_url, missing_db_response
from config_db import SchedulingBlockDbClient
BP = Blueprint('subarray_list:', __name__)
DB = SchedulingBlockDbClient()
LOG = logging.getLogger('SIP.EC.PCI')
@BP.route('/subarrays',... | true | true |
1c46491789a2b206ec7a467f93eaa6eeb029b3c1 | 4,899 | py | Python | train_face_recognition.py | JustinWingChungHui/okkindred_facial_recognition | e6744e604d0bf25f9024a2ef2ba7ca9d0760c8b1 | [
"MIT"
] | null | null | null | train_face_recognition.py | JustinWingChungHui/okkindred_facial_recognition | e6744e604d0bf25f9024a2ef2ba7ca9d0760c8b1 | [
"MIT"
] | 5 | 2019-10-21T20:33:13.000Z | 2022-03-12T00:00:19.000Z | train_face_recognition.py | JustinWingChungHui/okkindred_facial_recognition | e6744e604d0bf25f9024a2ef2ba7ca9d0760c8b1 | [
"MIT"
] | null | null | null | # https://github.com/ageitgey/face_recognition/blob/master/examples/face_recognition_knn.py
import math
import os
import pickle
from PIL import Image as PilImage
from sklearn import neighbors
from models import Person, Image, Tag, FaceModel
from secrets import TRAIN_FACE_RECOGNITION_TEMP_DIR
from file_downloader impor... | 31.203822 | 116 | 0.633395 |
import math
import os
import pickle
from PIL import Image as PilImage
from sklearn import neighbors
from models import Person, Image, Tag, FaceModel
from secrets import TRAIN_FACE_RECOGNITION_TEMP_DIR
from file_downloader import download_file, clear_directory
import face_recognition
def get_file_for_tag(tag, image, ... | true | true |
1c4649bc75a615ae3b5e27abb7216ac014db4166 | 36,743 | py | Python | sklearn_extensions/model_selection/_search.py | ruppinlab/tcga-microbiome-prediction | e7923b94738f9bd1b7862bb109002554430d9ace | [
"BSD-3-Clause"
] | 3 | 2022-01-11T08:40:37.000Z | 2022-01-28T08:00:39.000Z | sklearn_extensions/model_selection/_search.py | ruppinlab/tcga-microbiome-prediction | e7923b94738f9bd1b7862bb109002554430d9ace | [
"BSD-3-Clause"
] | null | null | null | sklearn_extensions/model_selection/_search.py | ruppinlab/tcga-microbiome-prediction | e7923b94738f9bd1b7862bb109002554430d9ace | [
"BSD-3-Clause"
] | 1 | 2022-01-11T08:44:08.000Z | 2022-01-11T08:44:08.000Z | """
The :mod:`sklearn_extesions.model_selection._search` includes utilities to
fine-tune the parameters of an estimator.
"""
# Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>,
# Gael Varoquaux <gael.varoquaux@normalesup.org>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# Olivier Grisel... | 42.924065 | 82 | 0.590398 |
from abc import abstractmethod
from collections import defaultdict
from collections.abc import Sequence
from functools import partial
from itertools import product
import numbers
import time
import warnings
import numpy as np
from joblib import Parallel, delayed
from scipy.stats import rankdata
from sklearn.base im... | true | true |
1c464a27e4586e149240c4356a12128973601b60 | 6,714 | py | Python | fw_neopixel_pride.py | tammymakesthings/fw_neopixel_pride | 3d8df503f7161a23b11d9298c62d45b2e6c17d60 | [
"MIT"
] | 2 | 2019-06-09T19:19:34.000Z | 2021-06-02T20:40:21.000Z | fw_neopixel_pride.py | tammymakesthings/fw_neopixel_pride | 3d8df503f7161a23b11d9298c62d45b2e6c17d60 | [
"MIT"
] | null | null | null | fw_neopixel_pride.py | tammymakesthings/fw_neopixel_pride | 3d8df503f7161a23b11d9298c62d45b2e6c17d60 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Pride Flag NetPixel Badge
Displays a bunch of different Pride flags on a NeoPixel grid. Designed for use
with the Adafruit Feather M0 Express and NeoPixel FeatherWing.
Full details at <http://github.com/tammymakesthings/cpy_neopixel_pride>
@author: tammy.cravit
@license: MIT
"""
import s... | 34.608247 | 99 | 0.566279 |
import sys
from time import sleep
ANIMATION_SPEED = 0.3
SHOW_PATTERN_DELAY = 15
PATTERN_INTENSITY = 0.3
NUM_ROWS = 4
NUM_COLS = 8
neopixel_pin = None
pixels = None
if sys.implementation.name == "circuitpython":
import time
import board
import neopixel
# Control pin defaults to #6
neopi... | true | true |
1c464c7f4975739b483955b49e931f3e73459cb0 | 966 | py | Python | pietoolbelt/augmentations/segmentation.py | kitkat52/pietoolbelt | 0e0b5859662fcb43b008218746cc3e76cc66b6b8 | [
"MIT"
] | 1 | 2021-05-30T08:21:12.000Z | 2021-05-30T08:21:12.000Z | pietoolbelt/augmentations/segmentation.py | kitkat52/pietoolbelt | 0e0b5859662fcb43b008218746cc3e76cc66b6b8 | [
"MIT"
] | 7 | 2020-07-07T21:04:08.000Z | 2021-12-13T10:08:17.000Z | pietoolbelt/augmentations/segmentation.py | kitkat52/pietoolbelt | 0e0b5859662fcb43b008218746cc3e76cc66b6b8 | [
"MIT"
] | 1 | 2021-06-17T09:21:39.000Z | 2021-06-17T09:21:39.000Z | import numpy as np
import torch
from .common import BaseAugmentations
__all__ = ['SegmentationAugmentations']
class SegmentationAugmentations(BaseAugmentations):
def __init__(self, is_train: bool, to_pytorch: bool, preprocess: callable):
super().__init__(is_train, to_pytorch, preprocess)
def augmen... | 33.310345 | 111 | 0.68323 | import numpy as np
import torch
from .common import BaseAugmentations
__all__ = ['SegmentationAugmentations']
class SegmentationAugmentations(BaseAugmentations):
def __init__(self, is_train: bool, to_pytorch: bool, preprocess: callable):
super().__init__(is_train, to_pytorch, preprocess)
def augmen... | true | true |
1c464c918d295b7c3a348cdb1a566cf0a3e06af7 | 5,165 | py | Python | starfish/core/experiment/builder/test/factories/all_purpose.py | kne42/starfish | 78b348c9756f367221dcca725cfa5107e5520b33 | [
"MIT"
] | null | null | null | starfish/core/experiment/builder/test/factories/all_purpose.py | kne42/starfish | 78b348c9756f367221dcca725cfa5107e5520b33 | [
"MIT"
] | null | null | null | starfish/core/experiment/builder/test/factories/all_purpose.py | kne42/starfish | 78b348c9756f367221dcca725cfa5107e5520b33 | [
"MIT"
] | null | null | null | from abc import ABCMeta
from typing import Callable, cast, Collection, Mapping, Sequence, Type, Union
import numpy as np
import slicedimage
from starfish.core.experiment.builder import (
build_irregular_image,
FetchedTile,
tile_fetcher_factory,
TileFetcher,
TileIdentifier,
)
from starfish.core.typ... | 39.128788 | 100 | 0.684802 | from abc import ABCMeta
from typing import Callable, cast, Collection, Mapping, Sequence, Type, Union
import numpy as np
import slicedimage
from starfish.core.experiment.builder import (
build_irregular_image,
FetchedTile,
tile_fetcher_factory,
TileFetcher,
TileIdentifier,
)
from starfish.core.typ... | true | true |
1c464cd9a94ce016f5a29a3b4da763617bf225a8 | 75,458 | py | Python | simulator/config_pb2.py | googleinterns/cluster-resource-forecast | 48b67346160e4f9c010552b9b20b8bace1a321ad | [
"Apache-2.0"
] | 25 | 2020-05-06T21:29:04.000Z | 2022-02-17T05:25:25.000Z | simulator/config_pb2.py | touchuyht/cluster-resource-forecast | 48b67346160e4f9c010552b9b20b8bace1a321ad | [
"Apache-2.0"
] | 3 | 2020-06-09T04:14:08.000Z | 2021-04-25T07:30:38.000Z | simulator/config_pb2.py | touchuyht/cluster-resource-forecast | 48b67346160e4f9c010552b9b20b8bace1a321ad | [
"Apache-2.0"
] | 12 | 2020-06-05T00:52:01.000Z | 2021-12-17T06:55:30.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: simulator/config.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from googl... | 33.686607 | 4,812 | 0.620279 | from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Default()
DESCRIPTOR = _descriptor.FileDescriptor(
name="simulator... | true | true |
1c464d12c804104184ab9202416708560155519f | 1,270 | py | Python | packages/pyre/weaver/MixedComments.py | PyreFramework/pyre | 345c7449a3416eea1c1affa74fb32faff30a6aaa | [
"BSD-3-Clause"
] | null | null | null | packages/pyre/weaver/MixedComments.py | PyreFramework/pyre | 345c7449a3416eea1c1affa74fb32faff30a6aaa | [
"BSD-3-Clause"
] | null | null | null | packages/pyre/weaver/MixedComments.py | PyreFramework/pyre | 345c7449a3416eea1c1affa74fb32faff30a6aaa | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2022 all rights reserved
#
class MixedComments:
"""
The mixed commenting strategy: both a block marker pair and an individual line marker
"""
# implemented interface
def commentBlock(self, lines):
"""
Create... | 22.678571 | 89 | 0.568504 |
class MixedComments:
def commentBlock(self, lines):
leader = self.leader + self.commentMarker
yield self.leader + self.startBlock
for line in lines:
yield leader + ' ' + line
yield self.leader + ' ' + self.startBlock
... | true | true |
1c464e80baae8523873eba7c28b31180433a9491 | 244 | py | Python | accounts/templatetags/account_tags.py | GadirMirzayev/Django-E-commerce | 0ca289fdf584b29636a8fc9416319defad0be5a5 | [
"MIT"
] | 1 | 2021-08-20T07:44:39.000Z | 2021-08-20T07:44:39.000Z | accounts/templatetags/account_tags.py | GadirMirzayev/Django-E-commerce | 0ca289fdf584b29636a8fc9416319defad0be5a5 | [
"MIT"
] | null | null | null | accounts/templatetags/account_tags.py | GadirMirzayev/Django-E-commerce | 0ca289fdf584b29636a8fc9416319defad0be5a5 | [
"MIT"
] | null | null | null | from django.template import Library
from accounts.forms import LoginForm, RegistrationForm
register = Library()
@register.simple_tag
def get_login():
return LoginForm
@register.simple_tag
def get_register():
return RegistrationForm | 17.428571 | 54 | 0.795082 | from django.template import Library
from accounts.forms import LoginForm, RegistrationForm
register = Library()
@register.simple_tag
def get_login():
return LoginForm
@register.simple_tag
def get_register():
return RegistrationForm | true | true |
1c464ec8780d8f5ce3fb571d62ddf71de207f74c | 2,383 | py | Python | app/words.py | anbasile/mwe | 2a56b889c7c7f28aa479e477f8e52da7501c2691 | [
"Apache-2.0"
] | null | null | null | app/words.py | anbasile/mwe | 2a56b889c7c7f28aa479e477f8e52da7501c2691 | [
"Apache-2.0"
] | 2 | 2016-08-31T16:21:31.000Z | 2016-09-10T21:50:12.000Z | app/words.py | anbasile/mwe | 2a56b889c7c7f28aa479e477f8e52da7501c2691 | [
"Apache-2.0"
] | null | null | null | import requests
from bs4 import BeautifulSoup
from collections import defaultdict
import pandas as pd
import json
import networkx as nx
from networkx.readwrite import json_graph
import numpy as np
from lightning import Lightning
from colorsys import hsv_to_rgb
from sklearn import datasets
lgn = Lightning(host='http://p... | 35.567164 | 113 | 0.578682 | import requests
from bs4 import BeautifulSoup
from collections import defaultdict
import pandas as pd
import json
import networkx as nx
from networkx.readwrite import json_graph
import numpy as np
from lightning import Lightning
from colorsys import hsv_to_rgb
from sklearn import datasets
lgn = Lightning(host='http://p... | true | true |
1c464fea142c0d5443ee2c8f9823dac623cc81f2 | 10,404 | py | Python | gui/kivy/uix/dialogs/settings.py | lionzeye/reddelectrum | e39497aee08b08bed89efa10072d17fb1e37920c | [
"MIT"
] | null | null | null | gui/kivy/uix/dialogs/settings.py | lionzeye/reddelectrum | e39497aee08b08bed89efa10072d17fb1e37920c | [
"MIT"
] | null | null | null | gui/kivy/uix/dialogs/settings.py | lionzeye/reddelectrum | e39497aee08b08bed89efa10072d17fb1e37920c | [
"MIT"
] | null | null | null | from kivy.app import App
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from reddelectrum.util import base_units
from reddelectrum.i18n import languages
from reddelectrum_gui.kivy.i18n import _
from reddelectrum.plugins import run_hook
from reddelectrum import... | 43.714286 | 157 | 0.569685 | from kivy.app import App
from kivy.factory import Factory
from kivy.properties import ObjectProperty
from kivy.lang import Builder
from reddelectrum.util import base_units
from reddelectrum.i18n import languages
from reddelectrum_gui.kivy.i18n import _
from reddelectrum.plugins import run_hook
from reddelectrum import... | true | true |
1c46504895e0e2d1fa84256a4ac14e48db7125f9 | 19,813 | py | Python | Lib/site-packages/pygments/lexers/html.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | 1 | 2021-12-14T21:23:25.000Z | 2021-12-14T21:23:25.000Z | Lib/site-packages/pygments/lexers/html.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | 1,242 | 2019-08-31T16:03:19.000Z | 2019-08-31T18:00:46.000Z | Lib/site-packages/pygments/lexers/html.py | edupyter/EDUPYTER38 | 396183cea72987506f1ef647c0272a2577c56218 | [
"bzip2-1.0.6"
] | 1 | 2019-10-04T01:56:03.000Z | 2019-10-04T01:56:03.000Z | """
pygments.lexers.html
~~~~~~~~~~~~~~~~~~~~
Lexers for HTML, XML and related markup.
:copyright: Copyright 2006-2022 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import re
from pygments.lexer import RegexLexer, ExtendedRegexLexer, include, bygroups, \
defa... | 32.74876 | 83 | 0.4225 |
import re
from pygments.lexer import RegexLexer, ExtendedRegexLexer, include, bygroups, \
default, using
from pygments.token import Text, Comment, Operator, Keyword, Name, String, \
Punctuation
from pygments.util import looks_like_xml, html_doctype_matches
from pygments.lexers.javascript import JavascriptLex... | true | true |
1c46543448022df5270116046c61a0e794fe676d | 5,784 | py | Python | shakenfist/daemons/resources.py | fidoandfido/shakenfist | 18612b27649310fb2d6ea1b32dce89640e8c857d | [
"Apache-2.0"
] | null | null | null | shakenfist/daemons/resources.py | fidoandfido/shakenfist | 18612b27649310fb2d6ea1b32dce89640e8c857d | [
"Apache-2.0"
] | null | null | null | shakenfist/daemons/resources.py | fidoandfido/shakenfist | 18612b27649310fb2d6ea1b32dce89640e8c857d | [
"Apache-2.0"
] | null | null | null | import os
import psutil
import time
from prometheus_client import Gauge
from prometheus_client import start_http_server
from shakenfist.daemons import daemon
from shakenfist import config
from shakenfist import db
from shakenfist import logutil
from shakenfist import util
LOG, _ = logutil.setup(__name__)
def _get... | 31.434783 | 93 | 0.616355 | import os
import psutil
import time
from prometheus_client import Gauge
from prometheus_client import start_http_server
from shakenfist.daemons import daemon
from shakenfist import config
from shakenfist import db
from shakenfist import logutil
from shakenfist import util
LOG, _ = logutil.setup(__name__)
def _get... | true | true |
1c465512236dd5e487d4620bb11fe1ccf6b857ef | 631 | py | Python | pysoup/logger/__init__.py | illBeRoy/pysoup | 742fd6630e1be27c275cb8dc6ee94412472cb20b | [
"MIT"
] | 4 | 2016-02-21T12:40:44.000Z | 2019-06-13T13:23:19.000Z | pysoup/logger/__init__.py | illBeRoy/pysoup | 742fd6630e1be27c275cb8dc6ee94412472cb20b | [
"MIT"
] | null | null | null | pysoup/logger/__init__.py | illBeRoy/pysoup | 742fd6630e1be27c275cb8dc6ee94412472cb20b | [
"MIT"
] | 1 | 2020-07-16T12:22:12.000Z | 2020-07-16T12:22:12.000Z | import os.path
import pysoup.utils.assets
class Logger(object):
def __init__(self, cwd):
self._log = ''
self._cwd = cwd
def log(self, text):
self._log += '{0}\n'.format(text)
def log_dependency_results(self, failed_dependencies):
for dependency in failed_dependencies:
... | 27.434783 | 68 | 0.59588 | import os.path
import pysoup.utils.assets
class Logger(object):
def __init__(self, cwd):
self._log = ''
self._cwd = cwd
def log(self, text):
self._log += '{0}\n'.format(text)
def log_dependency_results(self, failed_dependencies):
for dependency in failed_dependencies:
... | true | true |
1c4655f9e7e6644dbd5ab06a55417c8f38cfdb63 | 18,981 | py | Python | mindmeld/models/text_models.py | ritvikshrivastava/mindmeld | 48eccac059439ea0f32fa3ac9079415bb006233b | [
"Apache-2.0"
] | 580 | 2019-03-24T20:59:09.000Z | 2022-03-23T17:06:43.000Z | mindmeld/models/text_models.py | ritvikshrivastava/mindmeld | 48eccac059439ea0f32fa3ac9079415bb006233b | [
"Apache-2.0"
] | 199 | 2019-04-30T18:15:46.000Z | 2022-03-22T17:11:33.000Z | mindmeld/models/text_models.py | ritvikshrivastava/mindmeld | 48eccac059439ea0f32fa3ac9079415bb006233b | [
"Apache-2.0"
] | 164 | 2019-04-25T08:27:28.000Z | 2022-03-23T12:44:33.000Z | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Cisco Systems, Inc. and others. 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... | 37 | 97 | 0.61393 |
import logging
import operator
import os
import random
import numpy as np
from sklearn.ensemble import RandomForestClassifier
from sklearn.externals import joblib
from sklearn.feature_extraction import DictVectorizer
from sklearn.feature_selection import SelectFromModel, SelectPercentile
from sklearn.linear_model imp... | true | true |
1c465740ae5fe9f566269cf6b2d71d8bc9882dcb | 28,276 | py | Python | Core/Python/invoke_refresh_inventory.py | prasadrao-dell/OpenManage-Enterprise | f9bd0e821701902d6571a54663a7c9ef4f2308b3 | [
"Apache-2.0"
] | 1 | 2020-07-18T13:05:48.000Z | 2020-07-18T13:05:48.000Z | Core/Python/invoke_refresh_inventory.py | prasadrao-dell/OpenManage-Enterprise | f9bd0e821701902d6571a54663a7c9ef4f2308b3 | [
"Apache-2.0"
] | 11 | 2020-07-22T07:33:14.000Z | 2020-08-20T12:01:55.000Z | Core/Python/invoke_refresh_inventory.py | prasadrao-dell/OpenManage-Enterprise | f9bd0e821701902d6571a54663a7c9ef4f2308b3 | [
"Apache-2.0"
] | 4 | 2020-06-03T11:38:34.000Z | 2020-08-11T10:38:57.000Z | #
# _author_ = Grant Curell <grant_curell@dell.com>
#
# Copyright (c) 2020 Dell EMC Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE... | 44.599369 | 120 | 0.609245 |
import argparse
import json
import sys
import time
from argparse import RawTextHelpFormatter
from pprint import pprint
from urllib.parse import urlparse
from getpass import getpass
try:
import urllib3
import requests
except ModuleNotFoundError:
print("This program requires urllib3 and requests. To instal... | true | true |
1c465889a1c778474e5db6bd5a5c7d2042d61766 | 2,091 | py | Python | source-py/pyBKT/test/hand_specified_model.py | bukeplato/pyBKT | 733a4ccf0de78bef7d47b5a6af7131c7778560db | [
"MIT"
] | 132 | 2018-03-22T06:04:14.000Z | 2022-03-24T21:54:27.000Z | source-py/pyBKT/test/hand_specified_model.py | bukeplato/pyBKT | 733a4ccf0de78bef7d47b5a6af7131c7778560db | [
"MIT"
] | 25 | 2018-01-10T14:00:48.000Z | 2022-03-22T04:00:47.000Z | source-py/pyBKT/test/hand_specified_model.py | bukeplato/pyBKT | 733a4ccf0de78bef7d47b5a6af7131c7778560db | [
"MIT"
] | 46 | 2017-09-12T04:30:58.000Z | 2022-03-10T08:54:52.000Z | import numpy as np
from pyBKT.generate import synthetic_data
from pyBKT.generate import random_model, random_model_uni
from pyBKT.fit import EM_fit
from copy import deepcopy
from pyBKT.util import print_dot
#parameters
num_subparts = 4
num_resources = 2
num_fit_initializations = 25
observation_sequence_lengths = np.fu... | 31.681818 | 111 | 0.724055 | import numpy as np
from pyBKT.generate import synthetic_data
from pyBKT.generate import random_model, random_model_uni
from pyBKT.fit import EM_fit
from copy import deepcopy
from pyBKT.util import print_dot
num_subparts = 4
num_resources = 2
num_fit_initializations = 25
observation_sequence_lengths = np.full(50, 100, ... | true | true |
1c4658b4bb64b7f6ea6eb1dbc078b2ce403e3327 | 369 | py | Python | Problem124.py | Cleancode404/ProjectEuler | 2f93b256b107bfb6a395b8aa197cfeacc599b00b | [
"MIT"
] | null | null | null | Problem124.py | Cleancode404/ProjectEuler | 2f93b256b107bfb6a395b8aa197cfeacc599b00b | [
"MIT"
] | null | null | null | Problem124.py | Cleancode404/ProjectEuler | 2f93b256b107bfb6a395b8aa197cfeacc599b00b | [
"MIT"
] | null | null | null | """
Ordered radicals
"""
def compute(x):
limit = 100000
rads = [0] + [1]* limit
for i in range(2, len(rads)):
if rads[i] == 1:
for j in range(i, len(rads), i):
rads[j] *= i
data = sorted((rads, i) for (i, rad) in enumerate(rads))
return str(data[1000][1])
if... | 18.45 | 60 | 0.517615 |
def compute(x):
limit = 100000
rads = [0] + [1]* limit
for i in range(2, len(rads)):
if rads[i] == 1:
for j in range(i, len(rads), i):
rads[j] *= i
data = sorted((rads, i) for (i, rad) in enumerate(rads))
return str(data[1000][1])
if __name__ =="__main__":
... | true | true |
1c4659f51ad3a120a0b93c0284ea7b59b39d919d | 537 | py | Python | setup.py | sw5cc/tencent-finance | 08da6a75904055a6113a01c86377b613cbe07033 | [
"MIT"
] | null | null | null | setup.py | sw5cc/tencent-finance | 08da6a75904055a6113a01c86377b613cbe07033 | [
"MIT"
] | null | null | null | setup.py | sw5cc/tencent-finance | 08da6a75904055a6113a01c86377b613cbe07033 | [
"MIT"
] | null | null | null | from setuptools import setup
VERSION = '1.0.0'
REPO = 'https://github.com/sw5cc/tencent-finance'
setup(
name='tencent-finance',
py_modules=['tencent_finance'],
version=VERSION,
description='Python library that provides APIs to query finance from http://stock.qq.com',
author='sw5cc',
author_ema... | 28.263158 | 94 | 0.683426 | from setuptools import setup
VERSION = '1.0.0'
REPO = 'https://github.com/sw5cc/tencent-finance'
setup(
name='tencent-finance',
py_modules=['tencent_finance'],
version=VERSION,
description='Python library that provides APIs to query finance from http://stock.qq.com',
author='sw5cc',
author_ema... | true | true |
1c465c0941cce89c8fc109d641fe9e2f109a55e6 | 1,071 | py | Python | python/time_test.py | ysoftman/test_code | 4c71cc7c6a17d73cc84298e3a44051d3ab9d40f8 | [
"MIT"
] | 3 | 2017-12-07T04:29:36.000Z | 2022-01-11T10:58:14.000Z | python/time_test.py | ysoftman/test_code | 4c71cc7c6a17d73cc84298e3a44051d3ab9d40f8 | [
"MIT"
] | 14 | 2018-07-17T05:16:42.000Z | 2022-03-22T00:43:47.000Z | python/time_test.py | ysoftman/test_code | 4c71cc7c6a17d73cc84298e3a44051d3ab9d40f8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# author: ysoftman
# python version : 3.x
# desc : time test
import time
import datetime
if __name__ == '__main__':
# epoch time
print(time.time())
# suspend for 1 sec
time.sleep(1)
# 프로세스 시간(초)
start = time.clock()
# 현재 시간을 struct_time 형식으로 리턴
print(time.lo... | 21.42 | 51 | 0.582633 |
import time
import datetime
if __name__ == '__main__':
print(time.time())
time.sleep(1)
start = time.clock()
print(time.localtime())
print(time.localtime().tm_year)
print(time.localtime().tm_mon)
print(time.localtime().tm_mday)
print(time.localtime().tm_hour)
pr... | true | true |
1c465c6a86486509dd27a24054b97bb891f2c729 | 1,867 | py | Python | tests/components/folder/test_sensor.py | twrecked/core | d3ae8a938cdea9b6e0d443c91c37ac3dbbd459ab | [
"Apache-2.0"
] | 7 | 2019-02-07T14:14:12.000Z | 2019-07-28T06:56:10.000Z | tests/components/folder/test_sensor.py | twrecked/core | d3ae8a938cdea9b6e0d443c91c37ac3dbbd459ab | [
"Apache-2.0"
] | 6 | 2021-02-08T20:54:31.000Z | 2022-03-12T00:50:43.000Z | tests/components/folder/test_sensor.py | klauern/home-assistant-core | c18ba6aec0627e6afb6442c678edb5ff2bb17db6 | [
"Apache-2.0"
] | 2 | 2020-04-19T13:35:24.000Z | 2020-04-19T13:35:51.000Z | """The tests for the folder sensor."""
import os
import unittest
from homeassistant.components.folder.sensor import CONF_FOLDER_PATHS
from homeassistant.setup import setup_component
from tests.common import get_test_home_assistant
CWD = os.path.join(os.path.dirname(__file__))
TEST_FOLDER = "test_folder"
TEST_DIR = o... | 33.945455 | 86 | 0.666845 | import os
import unittest
from homeassistant.components.folder.sensor import CONF_FOLDER_PATHS
from homeassistant.setup import setup_component
from tests.common import get_test_home_assistant
CWD = os.path.join(os.path.dirname(__file__))
TEST_FOLDER = "test_folder"
TEST_DIR = os.path.join(CWD, TEST_FOLDER)
TEST_TXT ... | true | true |
1c465d2bf7cc3b2557d4537d22985e65be65189e | 6,600 | py | Python | utils/models/mobilenet_v2.py | voldemortX/DeeplabV3_PyTorch1.3_Codebase | d22d23e74800fafb58eeb61d6649008745c1a287 | [
"BSD-3-Clause"
] | 1 | 2020-09-17T06:21:39.000Z | 2020-09-17T06:21:39.000Z | utils/models/mobilenet_v2.py | voldemortX/pytorch-segmentation | 9c62c0a721d11c8ea6bf312ecf1c7b238a54dcda | [
"BSD-3-Clause"
] | null | null | null | utils/models/mobilenet_v2.py | voldemortX/pytorch-segmentation | 9c62c0a721d11c8ea6bf312ecf1c7b238a54dcda | [
"BSD-3-Clause"
] | null | null | null | # Modified from mmsegmentation code, referenced from torchvision
import torch.nn as nn
from .builder import MODELS
from ._utils import make_divisible
from .common_models import InvertedResidual
from .utils import load_state_dict_from_url
@MODELS.register()
class MobileNetV2Encoder(nn.Module):
"""MobileNetV2 back... | 42.038217 | 116 | 0.594697 |
import torch.nn as nn
from .builder import MODELS
from ._utils import make_divisible
from .common_models import InvertedResidual
from .utils import load_state_dict_from_url
@MODELS.register()
class MobileNetV2Encoder(nn.Module):
arch_settings = [[1, 16, 1], [6, 24, 2], [6, 32, 3], [6, 64, 4],
... | true | true |
1c465d43539d78553af3d947b0be4daa8319c479 | 20,345 | py | Python | tests/python/unittest/test_higher_order_grad.py | HaoLiuHust/incubator-mxnet | 0deb50b33f29a19bbe4bdc6ff14658afc5000d50 | [
"Apache-2.0"
] | 1 | 2019-02-22T13:53:48.000Z | 2019-02-22T13:53:48.000Z | tests/python/unittest/test_higher_order_grad.py | HaoLiuHust/incubator-mxnet | 0deb50b33f29a19bbe4bdc6ff14658afc5000d50 | [
"Apache-2.0"
] | 1 | 2020-08-27T06:39:07.000Z | 2020-08-31T03:29:27.000Z | tests/python/unittest/test_higher_order_grad.py | HaoLiuHust/incubator-mxnet | 0deb50b33f29a19bbe4bdc6ff14658afc5000d50 | [
"Apache-2.0"
] | 1 | 2020-08-14T22:56:19.000Z | 2020-08-14T22:56:19.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 28.454545 | 105 | 0.621627 |
import math
import random
from functools import reduce
from operator import mul
import random
from common import with_seed, xfail_when_nonstandard_decimal_separator
import mxnet
from mxnet import nd, autograd, gluon
from mxnet.test_utils import (
assert_almost_equal, random_arrays, random_uniform_arrays, rand_sh... | true | true |
1c465dd88414760419bb1ffb6b9b757ef5581d36 | 627 | py | Python | runs/seq-nobro-iter03000.cfg.py | janpawellek/broeval | 57e31aa6e354d0bba88103b44910483e8d982d00 | [
"MIT"
] | null | null | null | runs/seq-nobro-iter03000.cfg.py | janpawellek/broeval | 57e31aa6e354d0bba88103b44910483e8d982d00 | [
"MIT"
] | null | null | null | runs/seq-nobro-iter03000.cfg.py | janpawellek/broeval | 57e31aa6e354d0bba88103b44910483e8d982d00 | [
"MIT"
] | null | null | null |
# Write results to this file
OUTFILE = 'runs/seq-nobro-iter03000.result.csv'
# Source computers for the requests
SOURCE = ['10.0.0.1']
# Should Bro be enabled on the source machines?
SOURCE_BRO = [False]
# Target machines for the requests (aka server)
TARGET = ['10.0.0.2']
# Should Bro be enabled on the target mac... | 21.62069 | 68 | 0.722488 |
OUTFILE = 'runs/seq-nobro-iter03000.result.csv'
SOURCE = ['10.0.0.1']
SOURCE_BRO = [False]
TARGET = ['10.0.0.2']
TARGET_BRO = [False]
MODE = 'seq'
EPOCHS = 100
ITER = 3000
SIZE = 5
| true | true |
1c465eea594f4a857f85aba181b0c6af1aa42352 | 5,672 | py | Python | EvaluateAccuracy.py | sagieppel/Classification-of-the-material-given-region-of-an-image-using-a-convolutional-neural-net-with-attent | 2c78f069d4f4d9be7197b5bff6df39fc239270e4 | [
"MIT"
] | 5 | 2021-01-21T05:04:33.000Z | 2021-12-19T09:49:35.000Z | EvaluateAccuracy.py | sagieppel/Classification-of-the-material-given-region-of-an-image-using-a-convolutional-neural-net-with-attent | 2c78f069d4f4d9be7197b5bff6df39fc239270e4 | [
"MIT"
] | 2 | 2019-11-13T17:35:41.000Z | 2021-06-04T21:40:57.000Z | EvaluateAccuracy.py | sagieppel/Classification-of-the-material-given-region-of-an-image-using-a-convolutional-neural-net-with-attent | 2c78f069d4f4d9be7197b5bff6df39fc239270e4 | [
"MIT"
] | 1 | 2021-12-19T09:49:29.000Z | 2021-12-19T09:49:29.000Z | # Evaluate precision of image classification in a given image region
# Instructions:
# a) Set folder of images in Image_Dir
# c) Set folder for ground truth Annotation in AnnotationDir
# The Label Maps should be saved as png image with same name as the corresponding image and png ending. The value of each pixel corr... | 50.19469 | 199 | 0.542666 |
import Reader as Reader
import torch
import numpy as np
import AttentionNet as Net
UseCuda=True
ImageDir="ExampleData/TrainVal_Set/Images/"
AnnotationDir="ExampleData/TrainVal_Set/Annotations/"
Trained_model_path="logs/WeightRegionMaterialClassificationOpenSurface.torch" EvaluationFile=Trained_model_path.replace(".t... | true | true |
1c465fea1d1ceec23b4315681cacca75310c7202 | 27,098 | py | Python | numpy/core/tests/test_casting_unittests.py | HanumanJat8698/numpy | cbec2c8054ea6150490b9e72eb051848b79344d1 | [
"BSD-3-Clause"
] | 1 | 2022-02-26T03:35:36.000Z | 2022-02-26T03:35:36.000Z | numpy/core/tests/test_casting_unittests.py | HanumanJat8698/numpy | cbec2c8054ea6150490b9e72eb051848b79344d1 | [
"BSD-3-Clause"
] | null | null | null | numpy/core/tests/test_casting_unittests.py | HanumanJat8698/numpy | cbec2c8054ea6150490b9e72eb051848b79344d1 | [
"BSD-3-Clause"
] | null | null | null | """
The tests exercise the casting machinery in a more low-level manner.
The reason is mostly to test a new implementation of the casting machinery.
Unlike most tests in NumPy, these are closer to unit-tests rather
than integration tests.
"""
import pytest
import textwrap
import enum
import itertools
import random
i... | 41.057576 | 84 | 0.565983 |
import pytest
import textwrap
import enum
import itertools
import random
import numpy as np
from numpy.lib.stride_tricks import as_strided
from numpy.testing import assert_array_equal
from numpy.core._multiarray_umath import _get_castingimpl as get_castingimpl
simple_dtypes = "?bhilqBHILQefdFD"
if np.dtype("l").it... | true | true |
1c46600ef51420118bf2adf803f33064109e861f | 2,286 | py | Python | venv/Lib/site-packages/tests/test_310_ClientInfo.py | shehzadulislam/Assignment4 | a9cced70be6ae5d2685027d68032d5849f638301 | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/tests/test_310_ClientInfo.py | shehzadulislam/Assignment4 | a9cced70be6ae5d2685027d68032d5849f638301 | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/tests/test_310_ClientInfo.py | shehzadulislam/Assignment4 | a9cced70be6ae5d2685027d68032d5849f638301 | [
"Apache-2.0"
] | null | null | null | #
# Licensed Materials - Property of IBM
#
# (c) Copyright IBM Corp. 2007-2008
#
import unittest, sys
import ibm_db
import config
from testfunctions import IbmDbTestFunctions
class IbmDbTestCase(unittest.TestCase):
def test_310_ClientInfo(self):
obj = IbmDbTestFunctions()
obj.assert_expectf(self.run_tes... | 30.891892 | 120 | 0.700787 |
import unittest, sys
import ibm_db
import config
from testfunctions import IbmDbTestFunctions
class IbmDbTestCase(unittest.TestCase):
def test_310_ClientInfo(self):
obj = IbmDbTestFunctions()
obj.assert_expectf(self.run_test_310)
def run_test_310(self):
conn = ibm_db.connect(config.database, config.... | true | true |
1c4660eee4c36b65b45ca71a3dfd9c51e6edccdc | 1,545 | py | Python | postprocessing.py | BaerkeDestroyer/tiktok-rss-flat | ec96d901b5d40c0563658c469a6308546e78d0e2 | [
"Apache-2.0"
] | null | null | null | postprocessing.py | BaerkeDestroyer/tiktok-rss-flat | ec96d901b5d40c0563658c469a6308546e78d0e2 | [
"Apache-2.0"
] | null | null | null | postprocessing.py | BaerkeDestroyer/tiktok-rss-flat | ec96d901b5d40c0563658c469a6308546e78d0e2 | [
"Apache-2.0"
] | null | null | null | from TikTokApi import TikTokApi
import csv
from feedgen.feed import FeedGenerator
from datetime import datetime, timezone
# Normal GitHub Pages URL
# ghPagesURL = "https://conoro.github.io/tiktok-rss-flat/"
# Custom Domain
ghPagesURL = "https://baerkedestroyer.github.io/tiktok-rss-flat/"
api = TikTokApi.g... | 34.333333 | 85 | 0.579935 | from TikTokApi import TikTokApi
import csv
from feedgen.feed import FeedGenerator
from datetime import datetime, timezone
ghPagesURL = "https://baerkedestroyer.github.io/tiktok-rss-flat/"
api = TikTokApi.get_instance()
count = 10
with open('subscriptions.csv') as f:
cf = csv.DictReader(f, fieldnam... | true | true |
1c46616705638a9d0e9b20f08577b7cad14f9b79 | 459 | py | Python | config.example.py | entuland/fogibot | e3afe14d53fe9d47178161d9311301c47c960507 | [
"MIT"
] | null | null | null | config.example.py | entuland/fogibot | e3afe14d53fe9d47178161d9311301c47c960507 | [
"MIT"
] | null | null | null | config.example.py | entuland/fogibot | e3afe14d53fe9d47178161d9311301c47c960507 | [
"MIT"
] | null | null | null | host = "chat.example.com"
port = 6697
username = "username"
password = "password"
botname = "botname"
realname = "realname"
owner = "owner"
trigger = botname
channels = [
"##" + botname,
]
sharing_bins = [
"cpy.pt (generic pastes), gist.github.com (multiple files pastes)",
"jsfiddle.net, codepen.io (HTML+CS... | 25.5 | 71 | 0.657952 | host = "chat.example.com"
port = 6697
username = "username"
password = "password"
botname = "botname"
realname = "realname"
owner = "owner"
trigger = botname
channels = [
"##" + botname,
]
sharing_bins = [
"cpy.pt (generic pastes), gist.github.com (multiple files pastes)",
"jsfiddle.net, codepen.io (HTML+CS... | true | true |
1c466226c6dae77cdef9d5c22b9f63c343a0eb11 | 933 | py | Python | bindings/python/src/test/test_package_dependencies.py | cloudsmith-io/cloudsmith-api | bc747fa6ee1d86485e334b08f65687630b3fd87c | [
"Apache-2.0"
] | 9 | 2018-07-02T15:21:40.000Z | 2021-11-24T03:44:39.000Z | bindings/python/src/test/test_package_dependencies.py | cloudsmith-io/cloudsmith-api | bc747fa6ee1d86485e334b08f65687630b3fd87c | [
"Apache-2.0"
] | 8 | 2019-01-08T22:06:12.000Z | 2022-03-16T15:02:37.000Z | bindings/python/src/test/test_package_dependencies.py | cloudsmith-io/cloudsmith-api | bc747fa6ee1d86485e334b08f65687630b3fd87c | [
"Apache-2.0"
] | 1 | 2021-12-06T19:08:05.000Z | 2021-12-06T19:08:05.000Z | # coding: utf-8
"""
Cloudsmith API
The API to the Cloudsmith Service
OpenAPI spec version: v1
Contact: support@cloudsmith.io
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import os
import sys
import unittest
import cloudsmith_api
f... | 20.733333 | 81 | 0.713826 |
from __future__ import absolute_import
import os
import sys
import unittest
import cloudsmith_api
from cloudsmith_api.rest import ApiException
from cloudsmith_api.models.package_dependencies import PackageDependencies
class TestPackageDependencies(unittest.TestCase):
def setUp(self):
pass
def t... | true | true |
1c466290ee5308ecc91a711df4d496fe19a9680e | 674 | py | Python | manage.py | loyer-yuan/REMVocabulary | d86965600f1951c67558b8946bcfd6317d345153 | [
"MIT"
] | 1 | 2021-12-09T09:26:23.000Z | 2021-12-09T09:26:23.000Z | manage.py | loyer-yuan/REMVocabulary | d86965600f1951c67558b8946bcfd6317d345153 | [
"MIT"
] | 1 | 2021-12-07T13:01:23.000Z | 2021-12-12T13:53:47.000Z | manage.py | loyer-yuan/REMVocabulary | d86965600f1951c67558b8946bcfd6317d345153 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'REMVocabulary_DBMS.settings')
try:
from django.core.management import execute_from_command_line
... | 29.304348 | 82 | 0.683976 | import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'REMVocabulary_DBMS.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed a... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.