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 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c35a247b4bb1cb6218f6cb0c90d1d9a63a5f510 | 9,603 | py | Python | tests/clvm/test_puzzles.py | AedgeCoin/aedge-blockchain2 | 8a690026e73b59572d6d40da5003bab1bbd71057 | [
"Apache-2.0"
] | 6 | 2021-10-12T03:51:57.000Z | 2022-02-09T04:28:48.000Z | tests/clvm/test_puzzles.py | AedgeCoin/aedge-blockchain2 | 8a690026e73b59572d6d40da5003bab1bbd71057 | [
"Apache-2.0"
] | 4 | 2021-10-11T18:36:46.000Z | 2021-10-17T18:18:16.000Z | tests/clvm/test_puzzles.py | AedgeCoin/aedge-blockchain2 | 8a690026e73b59572d6d40da5003bab1bbd71057 | [
"Apache-2.0"
] | 4 | 2021-11-05T17:20:37.000Z | 2022-03-16T02:59:05.000Z | from typing import Iterable, List, Tuple
from unittest import TestCase
from blspy import AugSchemeMPL, BasicSchemeMPL, G1Element, G2Element
from aedge.types.blockchain_format.program import Program
from aedge.types.blockchain_format.sized_bytes import bytes32
from aedge.types.coin_spend import CoinSpend
from aedge.ty... | 39.356557 | 111 | 0.75289 | from typing import Iterable, List, Tuple
from unittest import TestCase
from blspy import AugSchemeMPL, BasicSchemeMPL, G1Element, G2Element
from aedge.types.blockchain_format.program import Program
from aedge.types.blockchain_format.sized_bytes import bytes32
from aedge.types.coin_spend import CoinSpend
from aedge.ty... | true | true |
1c35a290382adab8e3e0c12672d1944211c3a49a | 2,958 | py | Python | aliyun-python-sdk-live/aliyunsdklive/request/v20161101/AddCasterComponentRequest.py | xiaozhao1/aliyun-openapi-python-sdk | 7297b69619fbe18a053ce552df9ab378b7c5719f | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-live/aliyunsdklive/request/v20161101/AddCasterComponentRequest.py | xiaozhao1/aliyun-openapi-python-sdk | 7297b69619fbe18a053ce552df9ab378b7c5719f | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-live/aliyunsdklive/request/v20161101/AddCasterComponentRequest.py | xiaozhao1/aliyun-openapi-python-sdk | 7297b69619fbe18a053ce552df9ab378b7c5719f | [
"Apache-2.0"
] | 1 | 2021-01-26T05:01:42.000Z | 2021-01-26T05:01:42.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... | 32.866667 | 79 | 0.768087 |
from aliyunsdkcore.request import RpcRequest
class AddCasterComponentRequest(RpcRequest):
def __init__(self):
RpcRequest.__init__(self, 'live', '2016-11-01', 'AddCasterComponent','live')
def get_ImageLayerContent(self):
return self.get_query_params().get('ImageLayerContent')
def set_Im... | true | true |
1c35a2ad15dfa1c50bd1adefee46c6ed4261f1ab | 3,696 | py | Python | StreamPy/TestExamplesListToStreams/test_example_list_multi_in_single_out_stateless.py | AnomalyInc/StreamPy | 94abca276b2857de48259f4f42ef95efbdf5f6d1 | [
"Apache-2.0"
] | 2 | 2017-04-27T11:04:27.000Z | 2019-02-07T21:03:32.000Z | StreamPy/TestExamplesListToStreams/test_example_list_multi_in_single_out_stateless.py | StreamPy/StreamPy | 94abca276b2857de48259f4f42ef95efbdf5f6d1 | [
"Apache-2.0"
] | null | null | null | StreamPy/TestExamplesListToStreams/test_example_list_multi_in_single_out_stateless.py | StreamPy/StreamPy | 94abca276b2857de48259f4f42ef95efbdf5f6d1 | [
"Apache-2.0"
] | null | null | null | """This module contains examples of stream_func where f_type
is 'element' and stream_func has a list of multiple input streams,
a single output stream, and the operation is stateless. These
examples must have a LIST of input streams and not a single
input stream.
The functions on static Python data structures are of t... | 29.333333 | 84 | 0.647727 | """This module contains examples of stream_func where f_type
is 'element' and stream_func has a list of multiple input streams,
a single output stream, and the operation is stateless. These
examples must have a LIST of input streams and not a single
input stream.
The functions on static Python data structures are of t... | false | true |
1c35a2c55a9edc93f75b27cf557964534bc944c3 | 16,462 | py | Python | codeformatter/lib/scssbeautifier/css/beautifier.py | ephenyxshop/sublimetext-codeformatter | f4af5682b3e28d7ec0b450808bc0c0ad6b017fa9 | [
"MIT"
] | 676 | 2015-01-01T03:56:14.000Z | 2022-03-31T18:20:47.000Z | python/cssbeautifier/css/beautifier.py | Houfeng/js-beautify | 0076b9f342875be32067725d61538086e902725e | [
"MIT"
] | 331 | 2015-01-02T19:31:30.000Z | 2022-03-19T03:24:29.000Z | python/cssbeautifier/css/beautifier.py | Houfeng/js-beautify | 0076b9f342875be32067725d61538086e902725e | [
"MIT"
] | 196 | 2015-01-02T20:48:12.000Z | 2022-03-13T06:48:19.000Z | from __future__ import print_function
import sys
import re
import copy
from .options import BeautifierOptions
from jsbeautifier.core.options import mergeOpts
from jsbeautifier.core.output import Output
from jsbeautifier.__version__ import __version__
#
# The MIT License (MIT)
# Copyright (c) 2007-2017 Einar Lielmanis... | 36.339956 | 137 | 0.537177 | from __future__ import print_function
import sys
import re
import copy
from .options import BeautifierOptions
from jsbeautifier.core.options import mergeOpts
from jsbeautifier.core.output import Output
from jsbeautifier.__version__ import __version__
def default_options():
return Beautifi... | true | true |
1c35a3299e5dc555e4a406f196805aa546c90319 | 25,181 | py | Python | tensorflow_federated/python/core/impl/computation/function_utils.py | alessiomora/federated | 3b501067ed7062aaec3cc8830aaec0a7cf8f0942 | [
"Apache-2.0"
] | 1 | 2021-05-10T10:49:34.000Z | 2021-05-10T10:49:34.000Z | tensorflow_federated/python/core/impl/computation/function_utils.py | alessiomora/federated | 3b501067ed7062aaec3cc8830aaec0a7cf8f0942 | [
"Apache-2.0"
] | null | null | null | tensorflow_federated/python/core/impl/computation/function_utils.py | alessiomora/federated | 3b501067ed7062aaec3cc8830aaec0a7cf8f0942 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018, The TensorFlow Federated 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 o... | 41.348112 | 91 | 0.713554 |
import functools
import inspect
import types
import typing
from typing import Any, Callable, Dict, List, Mapping, Optional, Sequence, Tuple, Union
from tensorflow_federated.python.common_libs import py_typecheck
from tensorflow_federated.python.common_libs import structure
from tensorflow_federated.pytho... | true | true |
1c35a34531ffadf1c4956f663b32f6b78f00ab93 | 8,020 | py | Python | train.py | sam1373/glow-tts | e38e9f0d149c55d3726b059802971145746d99cd | [
"MIT"
] | null | null | null | train.py | sam1373/glow-tts | e38e9f0d149c55d3726b059802971145746d99cd | [
"MIT"
] | null | null | null | train.py | sam1373/glow-tts | e38e9f0d149c55d3726b059802971145746d99cd | [
"MIT"
] | null | null | null | import os
import json
import argparse
import math
import torch
from torch import nn, optim
from torch.nn import functional as F
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
import torch.multiprocessing as mp
import torch.distributed as dist
from apex.parallel import Distribu... | 40.505051 | 230 | 0.673317 | import os
import json
import argparse
import math
import torch
from torch import nn, optim
from torch.nn import functional as F
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
import torch.multiprocessing as mp
import torch.distributed as dist
from apex.parallel import Distribu... | true | true |
1c35a46820e838ec02df61e6d7846407f0d6f7e6 | 1,562 | py | Python | tests/test_forced_phot_inject.py | askap-vast/forced_phot | 8f4307825781743755d189418a9cb9111aaf0b63 | [
"MIT"
] | null | null | null | tests/test_forced_phot_inject.py | askap-vast/forced_phot | 8f4307825781743755d189418a9cb9111aaf0b63 | [
"MIT"
] | null | null | null | tests/test_forced_phot_inject.py | askap-vast/forced_phot | 8f4307825781743755d189418a9cb9111aaf0b63 | [
"MIT"
] | null | null | null | import time
import warnings
from astropy import units as u, constants as c
from astropy.coordinates import SkyCoord
from astropy.io import fits
from astropy.io.fits.verify import VerifyWarning
from astropy.table import Table
import astropy.wcs
from astropy.utils.exceptions import AstropyWarning
from matplotlib import p... | 33.234043 | 86 | 0.741357 | import time
import warnings
from astropy import units as u, constants as c
from astropy.coordinates import SkyCoord
from astropy.io import fits
from astropy.io.fits.verify import VerifyWarning
from astropy.table import Table
import astropy.wcs
from astropy.utils.exceptions import AstropyWarning
from matplotlib import p... | true | true |
1c35a4b6d41045fe785dbc29ec44ff85ef64509a | 4,575 | py | Python | PyQuM/ver(1.1)/pyqum/display.py | takehuge/PYQUM | bfc9d9b1c2f4246c7aac3a371baaf587c99f8069 | [
"MIT"
] | null | null | null | PyQuM/ver(1.1)/pyqum/display.py | takehuge/PYQUM | bfc9d9b1c2f4246c7aac3a371baaf587c99f8069 | [
"MIT"
] | null | null | null | PyQuM/ver(1.1)/pyqum/display.py | takehuge/PYQUM | bfc9d9b1c2f4246c7aac3a371baaf587c99f8069 | [
"MIT"
] | null | null | null | # Loading Basics
from colorama import init, Back, Fore
init(autoreset=True) #to convert termcolor to wins color
from os.path import basename as bs
myname = bs(__file__).split('.')[0] # This py-script's name
from flask import Blueprint, render_template, request, redirect, Response, stream_with_context
import random, js... | 36.895161 | 149 | 0.558033 |
from colorama import init, Back, Fore
init(autoreset=True)
from os.path import basename as bs
myname = bs(__file__).split('.')[0]
from flask import Blueprint, render_template, request, redirect, Response, stream_with_context
import random, json, glob, time
import numpy as np
from pyqum import stream_template
bp =... | true | true |
1c35a4f586b8f36ca18fe3a5c76fe04643e128f0 | 131 | py | Python | invest_scenario_generator_summary.py | phargogh/invest-natcap.invest-3 | ee96055a4fa034d9a95fa8ccc6259ab03264e6c1 | [
"BSD-3-Clause"
] | null | null | null | invest_scenario_generator_summary.py | phargogh/invest-natcap.invest-3 | ee96055a4fa034d9a95fa8ccc6259ab03264e6c1 | [
"BSD-3-Clause"
] | null | null | null | invest_scenario_generator_summary.py | phargogh/invest-natcap.invest-3 | ee96055a4fa034d9a95fa8ccc6259ab03264e6c1 | [
"BSD-3-Clause"
] | null | null | null | import invest_natcap.iui.modelui
if __name__ == '__main__':
invest_natcap.iui.modelui.main('scenario-generator-summary.json')
| 26.2 | 69 | 0.778626 | import invest_natcap.iui.modelui
if __name__ == '__main__':
invest_natcap.iui.modelui.main('scenario-generator-summary.json')
| true | true |
1c35a5a8ef74d6c695b4741787fb1b953ad1bb5e | 4,016 | py | Python | MODEL/model_bag_classifier.py | quincy-125/DigiPath_CLAM_TF | 8b7ab50caaca13f666268b0f4e071d123e190978 | [
"MIT"
] | 5 | 2021-05-10T17:23:46.000Z | 2022-02-27T22:33:03.000Z | MODEL/model_bag_classifier.py | quincy-125/DigiPath_CLAM_TF | 8b7ab50caaca13f666268b0f4e071d123e190978 | [
"MIT"
] | null | null | null | MODEL/model_bag_classifier.py | quincy-125/DigiPath_CLAM_TF | 8b7ab50caaca13f666268b0f4e071d123e190978 | [
"MIT"
] | 2 | 2020-12-12T00:15:21.000Z | 2021-05-10T17:23:57.000Z | import tensorflow as tf
import numpy as np
class S_Bag(tf.keras.Model):
def __init__(self, dim_compress_features=512, n_class=2):
super(S_Bag, self).__init__()
self.dim_compress_features = dim_compress_features
self.n_class = n_class
self.s_bag_model = tf.keras.models.Sequential()... | 38.615385 | 117 | 0.627241 | import tensorflow as tf
import numpy as np
class S_Bag(tf.keras.Model):
def __init__(self, dim_compress_features=512, n_class=2):
super(S_Bag, self).__init__()
self.dim_compress_features = dim_compress_features
self.n_class = n_class
self.s_bag_model = tf.keras.models.Sequential()... | true | true |
1c35a5b23716abd9d9b68128141ad5d8c46c52d4 | 16,669 | py | Python | dmd/dmd.py | HaldexBrake/ReducedOrderModeling | d56917f52018dabd317c1a9a583efe0b90cc9e7b | [
"Apache-2.0"
] | 2 | 2020-09-23T08:15:38.000Z | 2021-05-05T13:09:19.000Z | dmd/dmd.py | HaldexBrake/ReducedOrderModeling | d56917f52018dabd317c1a9a583efe0b90cc9e7b | [
"Apache-2.0"
] | null | null | null | dmd/dmd.py | HaldexBrake/ReducedOrderModeling | d56917f52018dabd317c1a9a583efe0b90cc9e7b | [
"Apache-2.0"
] | 1 | 2022-03-05T05:53:28.000Z | 2022-03-05T05:53:28.000Z | """
"""
from pyfmi import load_fmu
import numpy as np
from scipy.linalg import eig
from numpy.linalg import svd, solve, inv, norm
import matplotlib.pyplot as plt
from sympy import symbols, lambdify
def create_input_vec(time_vec, inp_type='sin', amp=10.0, freq=1.0, delta_time=1.0, duration=1):
"""Constructs an in... | 35.092632 | 140 | 0.601476 | from pyfmi import load_fmu
import numpy as np
from scipy.linalg import eig
from numpy.linalg import svd, solve, inv, norm
import matplotlib.pyplot as plt
from sympy import symbols, lambdify
def create_input_vec(time_vec, inp_type='sin', amp=10.0, freq=1.0, delta_time=1.0, duration=1):
if amp == 0:
u = Non... | true | true |
1c35a6637f534abf4a37763fe1915c35e18e1f94 | 10,705 | py | Python | fluid/DeepASR/train.py | phlrain/models | 59adc0d6f38cd2351e16608d6c9d4e72dd5e7fea | [
"Apache-2.0"
] | 1 | 2018-09-12T09:36:44.000Z | 2018-09-12T09:36:44.000Z | fluid/DeepASR/train.py | phlrain/models | 59adc0d6f38cd2351e16608d6c9d4e72dd5e7fea | [
"Apache-2.0"
] | null | null | null | fluid/DeepASR/train.py | phlrain/models | 59adc0d6f38cd2351e16608d6c9d4e72dd5e7fea | [
"Apache-2.0"
] | 2 | 2018-06-14T13:59:36.000Z | 2018-11-14T12:34:47.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import os
import numpy as np
import argparse
import time
import paddle.fluid as fluid
import data_utils.augmentor.trans_mean_variance_norm as trans_mean_variance_norm
import data_utils.augmentor.tra... | 36.535836 | 89 | 0.58795 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import sys
import os
import numpy as np
import argparse
import time
import paddle.fluid as fluid
import data_utils.augmentor.trans_mean_variance_norm as trans_mean_variance_norm
import data_utils.augmentor.tra... | true | true |
1c35a6b02678f7ef62a5d7a45ee173d8bed8fcb8 | 3,308 | py | Python | Statstool-Desktop/SetupWindow.py | Declaminius/EU4-MP-Statstool | 2df7b7f08f1c97257dec325322a2e491ea856432 | [
"MIT"
] | 1 | 2020-10-06T14:48:32.000Z | 2020-10-06T14:48:32.000Z | Statstool-Desktop/SetupWindow.py | Declaminius/EU4-MP-Statstool | 2df7b7f08f1c97257dec325322a2e491ea856432 | [
"MIT"
] | 3 | 2021-09-08T02:36:13.000Z | 2022-03-12T00:50:09.000Z | Statstool-Desktop/SetupWindow.py | Declaminius/EU4-MP-Statstool | 2df7b7f08f1c97257dec325322a2e491ea856432 | [
"MIT"
] | 1 | 2020-09-26T15:31:24.000Z | 2020-09-26T15:31:24.000Z | # -*- coding: utf-8 -*-
"""
Created on Wed Dec 25 02:14:51 2019
@author: Florian
"""
import PyQt5.QtWidgets as Widgets
import PyQt5.QtGui as Gui
import PyQt5.QtCore as Core
from parserfunctions import edit_parse
from Savegame import Savegame
from config import icon_dir, old_nations_list, new_nations_list
class Setup... | 33.414141 | 130 | 0.738513 |
import PyQt5.QtWidgets as Widgets
import PyQt5.QtGui as Gui
import PyQt5.QtCore as Core
from parserfunctions import edit_parse
from Savegame import Savegame
from config import icon_dir, old_nations_list, new_nations_list
class SetupWindow(Widgets.QMainWindow):
switch_window = Core.pyqtSignal()
def __init__(self):... | true | true |
1c35a6b30dedb9e02bf92ea0967bf9cfc0bd983b | 1,793 | py | Python | otherUsefulScripts/compile_all_plots.py | MagnusHaughey/liverMitoDNAPipeline | 0d63a41ea626bca032473450e3d10d451744f175 | [
"MIT"
] | null | null | null | otherUsefulScripts/compile_all_plots.py | MagnusHaughey/liverMitoDNAPipeline | 0d63a41ea626bca032473450e3d10d451744f175 | [
"MIT"
] | null | null | null | otherUsefulScripts/compile_all_plots.py | MagnusHaughey/liverMitoDNAPipeline | 0d63a41ea626bca032473450e3d10d451744f175 | [
"MIT"
] | null | null | null |
import numpy as np
import glob
import subprocess
import sys
parent_dir = sys.argv[1]
all_files = []
for file in glob.glob(parent_dir + "/*scatterPlot.pdf"):
file = file.split("/")[-1]
all_files.append(file[:-20])
all_files = sorted(set(all_files))
#print(all_files)
#exit(0)
f = open(parent_dir + "/all_SNV_plo... | 51.228571 | 550 | 0.663134 |
import numpy as np
import glob
import subprocess
import sys
parent_dir = sys.argv[1]
all_files = []
for file in glob.glob(parent_dir + "/*scatterPlot.pdf"):
file = file.split("/")[-1]
all_files.append(file[:-20])
all_files = sorted(set(all_files))
f = open(parent_dir + "/all_SNV_plots.tex" , 'w')
f.write("... | true | true |
1c35a6e1e0a001f7ac58faac00836738f1d077db | 1,866 | py | Python | shap/benchmark/methods.py | JiechengZhao/shap | ec26a1e0ccdf0a3885943e63502cf479194c13d1 | [
"MIT"
] | null | null | null | shap/benchmark/methods.py | JiechengZhao/shap | ec26a1e0ccdf0a3885943e63502cf479194c13d1 | [
"MIT"
] | null | null | null | shap/benchmark/methods.py | JiechengZhao/shap | ec26a1e0ccdf0a3885943e63502cf479194c13d1 | [
"MIT"
] | null | null | null | from .. import LinearExplainer
from .. import KernelExplainer
from .. import SamplingExplainer
from .. import TreeExplainer
from ..explainers import other
method_dict = {
"Linear SHAP (corr)": lambda model, X: LinearExplainer(model, X, nsamples=1000).shap_values,
"Linear SHAP (ind)": lambda model, X: LinearExp... | 43.395349 | 145 | 0.690782 | from .. import LinearExplainer
from .. import KernelExplainer
from .. import SamplingExplainer
from .. import TreeExplainer
from ..explainers import other
method_dict = {
"Linear SHAP (corr)": lambda model, X: LinearExplainer(model, X, nsamples=1000).shap_values,
"Linear SHAP (ind)": lambda model, X: LinearExp... | true | true |
1c35a6e7cc220a027ff5cd4f4aaa716267fd3830 | 18,310 | py | Python | private/templates/EVASS/config.py | hitesh96db/eden | 8e1b22d7d4b92c0bce5b6172d57298949a2f0582 | [
"MIT"
] | null | null | null | private/templates/EVASS/config.py | hitesh96db/eden | 8e1b22d7d4b92c0bce5b6172d57298949a2f0582 | [
"MIT"
] | null | null | null | private/templates/EVASS/config.py | hitesh96db/eden | 8e1b22d7d4b92c0bce5b6172d57298949a2f0582 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
try:
# Python 2.7
from collections import OrderedDict
except:
# Python 2.6
from gluon.contrib.simplejson.ordered_dict import OrderedDict
from gluon import current
from gluon.storage import Storage
from gluon.validators import IS_NOT_EMPTY, IS_EMPTY_OR, IS_IN_SET
from s3 import... | 38.874735 | 147 | 0.593501 |
try:
from collections import OrderedDict
except:
from gluon.contrib.simplejson.ordered_dict import OrderedDict
from gluon import current
from gluon.storage import Storage
from gluon.validators import IS_NOT_EMPTY, IS_EMPTY_OR, IS_IN_SET
from s3 import s3_date, S3Represent
T = current.T
settings =... | true | true |
1c35a8ea0984c9b012086dfb54aee13e6e258451 | 16,518 | py | Python | venv/Lib/site-packages/scipy/_lib/_util.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 6 | 2019-12-21T21:15:54.000Z | 2021-04-20T17:35:24.000Z | venv/Lib/site-packages/scipy/_lib/_util.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 20 | 2021-05-03T18:02:23.000Z | 2022-03-12T12:01:04.000Z | venv/Lib/site-packages/scipy/_lib/_util.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 3 | 2021-01-31T16:40:52.000Z | 2021-08-29T18:32:34.000Z | import functools
import operator
import sys
import warnings
import numbers
from collections import namedtuple
import inspect
import math
import numpy as np
try:
from numpy.random import Generator as Generator
except ImportError:
class Generator(): # type: ignore[no-redef]
pass
def _lazywhere(cond, ... | 34.484342 | 84 | 0.618658 | import functools
import operator
import sys
import warnings
import numbers
from collections import namedtuple
import inspect
import math
import numpy as np
try:
from numpy.random import Generator as Generator
except ImportError:
class Generator():
pass
def _lazywhere(cond, arrays, f, fillvalue=Non... | true | true |
1c35a915fceb0b31f4541e4a9cb30f32209280a0 | 2,441 | py | Python | task-example.py | EverAzureRest/batch_examples | 7daec97a468770c3d07cdb02f67951e5be75c153 | [
"MIT"
] | null | null | null | task-example.py | EverAzureRest/batch_examples | 7daec97a468770c3d07cdb02f67951e5be75c153 | [
"MIT"
] | null | null | null | task-example.py | EverAzureRest/batch_examples | 7daec97a468770c3d07cdb02f67951e5be75c153 | [
"MIT"
] | null | null | null |
from datetime import datetime, timedelta
import azure.batch.batch_auth as batchauth
import azure.batch._batch_service_client as batch
import uuid
import datetime
import time
# Batch account credentials
BATCH_ACCOUNT_NAME = ''
BATCH_ACCOUNT_URL = ''
BATCH_ACCOUNT_KEY = ''
# Create a Batch service client. We'll now b... | 24.656566 | 90 | 0.711184 |
from datetime import datetime, timedelta
import azure.batch.batch_auth as batchauth
import azure.batch._batch_service_client as batch
import uuid
import datetime
import time
BATCH_ACCOUNT_NAME = ''
BATCH_ACCOUNT_URL = ''
BATCH_ACCOUNT_KEY = ''
# service in addition to Storage.
credentials = batchauth.SharedKeyCre... | true | true |
1c35a9dccb3bab73f67b1b1fbe686f62f3c44b14 | 58,897 | py | Python | oscar/lib/python2.7/site-packages/django/test/testcases.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/django/test/testcases.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/django/test/testcases.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
import difflib
import json
import posixpath
import sys
import threading
import unittest
import warnings
from collections import Counter
from contextlib import contextmanager
from copy import copy
from functools import wraps
from unittest.util import safe_repr
fro... | 41.800568 | 118 | 0.596856 | from __future__ import unicode_literals
import difflib
import json
import posixpath
import sys
import threading
import unittest
import warnings
from collections import Counter
from contextlib import contextmanager
from copy import copy
from functools import wraps
from unittest.util import safe_repr
fro... | true | true |
1c35aa1277ffe802f90bac0cd78c1c4a49041400 | 69,352 | py | Python | hack/test_errata.py | Davoska/cincinnati-graph-data | 3bc79fdcefa72f570e0757c0bfd46d4302543264 | [
"Apache-2.0"
] | null | null | null | hack/test_errata.py | Davoska/cincinnati-graph-data | 3bc79fdcefa72f570e0757c0bfd46d4302543264 | [
"Apache-2.0"
] | null | null | null | hack/test_errata.py | Davoska/cincinnati-graph-data | 3bc79fdcefa72f570e0757c0bfd46d4302543264 | [
"Apache-2.0"
] | null | null | null | import copy
import datetime
import os
import tempfile
import unittest
import urllib
from unittest.mock import MagicMock
from unittest.mock import patch
import errata
class GithubUserMock():
def __init__(self, login):
self.login = login
class GithubLabelMock():
def __init__(self, name):
self... | 40.509346 | 194 | 0.552818 | import copy
import datetime
import os
import tempfile
import unittest
import urllib
from unittest.mock import MagicMock
from unittest.mock import patch
import errata
class GithubUserMock():
def __init__(self, login):
self.login = login
class GithubLabelMock():
def __init__(self, name):
self... | true | true |
1c35aa5795469720903de6148dacc6c54b641b80 | 8,290 | py | Python | Tensorflow-master/experiments/2D_car/car_env.py | gustasvs/AI | 23360a8865e8211568594c2b2ced11dcdc9b0006 | [
"MIT"
] | 1 | 2022-02-03T18:21:28.000Z | 2022-02-03T18:21:28.000Z | Tensorflow-master/experiments/2D_car/car_env.py | gustasvs/AI | 23360a8865e8211568594c2b2ced11dcdc9b0006 | [
"MIT"
] | null | null | null | Tensorflow-master/experiments/2D_car/car_env.py | gustasvs/AI | 23360a8865e8211568594c2b2ced11dcdc9b0006 | [
"MIT"
] | null | null | null | import numpy as np
import pyglet
pyglet.clock.set_fps_limit(10000)
class CarEnv(object):
n_sensor = 5
action_dim = 1
state_dim = n_sensor
viewer = None
viewer_xy = (1080, 720)
sensor_max = 150.
start_point = [100, 100]
speed = 50.
dt = 0.1
def __init__(self, discrete_action=... | 34.39834 | 141 | 0.516164 | import numpy as np
import pyglet
pyglet.clock.set_fps_limit(10000)
class CarEnv(object):
n_sensor = 5
action_dim = 1
state_dim = n_sensor
viewer = None
viewer_xy = (1080, 720)
sensor_max = 150.
start_point = [100, 100]
speed = 50.
dt = 0.1
def __init__(self, discrete_action=... | true | true |
1c35acc60445d40021308b66c56037df70001c8a | 1,341 | py | Python | tests/test_0806-empty-lists-cartesian-fix.py | BioGeek/awkward-1.0 | 0cfb4e43c41d5c7d9830cc7b1d750485c0a93eb2 | [
"BSD-3-Clause"
] | 519 | 2019-10-17T12:36:22.000Z | 2022-03-26T23:28:19.000Z | tests/test_0806-empty-lists-cartesian-fix.py | BioGeek/awkward-1.0 | 0cfb4e43c41d5c7d9830cc7b1d750485c0a93eb2 | [
"BSD-3-Clause"
] | 924 | 2019-11-03T21:05:01.000Z | 2022-03-31T22:44:30.000Z | tests/test_0806-empty-lists-cartesian-fix.py | BioGeek/awkward-1.0 | 0cfb4e43c41d5c7d9830cc7b1d750485c0a93eb2 | [
"BSD-3-Clause"
] | 56 | 2019-12-17T15:49:22.000Z | 2022-03-09T20:34:06.000Z | # BSD 3-Clause License; see https://github.com/scikit-hep/awkward-1.0/blob/main/LICENSE
from __future__ import absolute_import
import pytest # noqa: F401
import numpy as np # noqa: F401
import awkward as ak # noqa: F401
def test_empty_arrays_cartesian():
one = ak.Array([])
two = one = ak.Array([])
w... | 28.531915 | 87 | 0.61745 |
from __future__ import absolute_import
import pytest
import numpy as np
import awkward as ak
def test_empty_arrays_cartesian():
one = ak.Array([])
two = one = ak.Array([])
with pytest.raises(ValueError) as err:
ak.to_list(ak.cartesian([one, two]))
assert isinstance(err.value, ValueE... | true | true |
1c35ad0d92514753f02b80b801f52e4c875bc666 | 678 | py | Python | publichealth/home/migrations/0006_auto_20170308_2025.py | pcoder/public-health-ch | cebc4849653560c54238b67814074353ff7c01f3 | [
"MIT"
] | 2 | 2020-10-29T16:27:21.000Z | 2021-06-07T12:47:46.000Z | publichealth/home/migrations/0006_auto_20170308_2025.py | pcoder/public-health-ch | cebc4849653560c54238b67814074353ff7c01f3 | [
"MIT"
] | 11 | 2017-05-09T10:50:28.000Z | 2021-12-15T17:01:23.000Z | publichealth/home/migrations/0006_auto_20170308_2025.py | pcoder/public-health-ch | cebc4849653560c54238b67814074353ff7c01f3 | [
"MIT"
] | 4 | 2017-04-24T13:06:55.000Z | 2021-06-04T02:18:32.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-03-08 19:25
from __future__ import unicode_literals
from django.db import migrations
import wagtail.core.fields
class Migration(migrations.Migration):
dependencies = [
('home', '0005_auto_20170308_2023'),
]
operations = [
migr... | 25.111111 | 76 | 0.610619 |
from __future__ import unicode_literals
from django.db import migrations
import wagtail.core.fields
class Migration(migrations.Migration):
dependencies = [
('home', '0005_auto_20170308_2023'),
]
operations = [
migrations.AlterField(
model_name='homepage',
name=... | true | true |
1c35ad55636c2686b513661ccc358f40c7bd6bba | 1,571 | py | Python | tests/test_featurizers/test_fasttext_featurizer.py | tienhoang1994/rasa-nlu-examples | fe12dbc814d992382c1ca1d926b340139200928f | [
"Apache-2.0"
] | 1 | 2022-03-31T17:00:38.000Z | 2022-03-31T17:00:38.000Z | tests/test_featurizers/test_fasttext_featurizer.py | tienhoang1994/rasa-nlu-examples | fe12dbc814d992382c1ca1d926b340139200928f | [
"Apache-2.0"
] | null | null | null | tests/test_featurizers/test_fasttext_featurizer.py | tienhoang1994/rasa-nlu-examples | fe12dbc814d992382c1ca1d926b340139200928f | [
"Apache-2.0"
] | null | null | null | import pathlib
import pytest
from rasa.nlu.tokenizers.whitespace_tokenizer import WhitespaceTokenizer
from .dense_featurizer_checks import dense_standard_test_combinations
from rasa_nlu_examples.featurizers.dense.fasttext_featurizer import FastTextFeaturizer
from rasa.engine.storage.resource import Resource
from rasa... | 32.061224 | 86 | 0.809675 | import pathlib
import pytest
from rasa.nlu.tokenizers.whitespace_tokenizer import WhitespaceTokenizer
from .dense_featurizer_checks import dense_standard_test_combinations
from rasa_nlu_examples.featurizers.dense.fasttext_featurizer import FastTextFeaturizer
from rasa.engine.storage.resource import Resource
from rasa... | true | true |
1c35ae89ea08ad34a1f9ffe529f3f9ee74d3d51c | 1,203 | py | Python | venv/lib/python3.8/site-packages/test/test_api_service_out.py | akshitgoyal/csc398nlp | 6adf80cb7fa3737f88faf73a6e818da495b95ab4 | [
"MIT"
] | 1 | 2020-09-28T10:09:25.000Z | 2020-09-28T10:09:25.000Z | venv/lib/python3.8/site-packages/test/test_api_service_out.py | akshitgoyal/NLP-Research-Project | 6adf80cb7fa3737f88faf73a6e818da495b95ab4 | [
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/test/test_api_service_out.py | akshitgoyal/NLP-Research-Project | 6adf80cb7fa3737f88faf73a6e818da495b95ab4 | [
"MIT"
] | 1 | 2020-07-01T18:46:20.000Z | 2020-07-01T18:46:20.000Z | # coding: utf-8
"""
NamSor API v2
NamSor API v2 : enpoints to process personal names (gender, cultural origin or ethnicity) in all alphabets or languages. Use GET methods for small tests, but prefer POST methods for higher throughput (batch processing of up to 100 names at a time). Need something you can't fi... | 29.341463 | 385 | 0.720698 |
from __future__ import absolute_import
import unittest
import openapi_client
from openapi_client.models.api_service_out import APIServiceOut
from openapi_client.rest import ApiException
class TestAPIServiceOut(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
pass
de... | true | true |
1c35aecec3f373c15ba7cd460b115cc89022eb60 | 111 | py | Python | datatrans/fooddata/__init__.py | KooCook/datatrans | 65c80da4d8a1ed67963b9d704b361c864cb1151b | [
"BSD-3-Clause"
] | 1 | 2020-10-24T04:07:42.000Z | 2020-10-24T04:07:42.000Z | datatrans/fooddata/__init__.py | KooCook/datatrans | 65c80da4d8a1ed67963b9d704b361c864cb1151b | [
"BSD-3-Clause"
] | null | null | null | datatrans/fooddata/__init__.py | KooCook/datatrans | 65c80da4d8a1ed67963b9d704b361c864cb1151b | [
"BSD-3-Clause"
] | null | null | null | from datatrans.fooddata import api
from datatrans.fooddata import detail
from datatrans.fooddata import search
| 27.75 | 37 | 0.864865 | from datatrans.fooddata import api
from datatrans.fooddata import detail
from datatrans.fooddata import search
| true | true |
1c35afab8a78f4681bf577dc3bbd6a8f18a92c36 | 657 | py | Python | kospeech/checkpoint/__init__.py | daiyaanarfeen/kospeech | 5aff5c7647e5cceceddf7b22c991777fc3792400 | [
"Apache-2.0"
] | 257 | 2020-06-06T14:20:47.000Z | 2021-08-12T05:01:39.000Z | kospeech/checkpoint/__init__.py | daiyaanarfeen/kospeech | 5aff5c7647e5cceceddf7b22c991777fc3792400 | [
"Apache-2.0"
] | 100 | 2020-06-08T00:39:28.000Z | 2021-08-04T11:22:02.000Z | kospeech/checkpoint/__init__.py | daiyaanarfeen/kospeech | 5aff5c7647e5cceceddf7b22c991777fc3792400 | [
"Apache-2.0"
] | 96 | 2020-06-10T06:12:52.000Z | 2021-08-09T14:40:01.000Z | # Copyright (c) 2020, Soohwan Kim. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | 41.0625 | 74 | 0.768645 |
from kospeech.checkpoint.checkpoint import Checkpoint
| true | true |
1c35b01d681087d3df62b6a76903aa79019ea58d | 509 | py | Python | magPi_02_pygameGraphicsWindow.py | oniMoNaku/thePit | f82d2dc70346e6188fca493a4b9373aa99ccfa32 | [
"Unlicense"
] | null | null | null | magPi_02_pygameGraphicsWindow.py | oniMoNaku/thePit | f82d2dc70346e6188fca493a4b9373aa99ccfa32 | [
"Unlicense"
] | null | null | null | magPi_02_pygameGraphicsWindow.py | oniMoNaku/thePit | f82d2dc70346e6188fca493a4b9373aa99ccfa32 | [
"Unlicense"
] | null | null | null | # today is 389e
# the python pit
# magPi - 02
# OPEN A PYGAME GRAPHICS WINDOW
import os, pygame
from pygame.locals import *
pygame.init()
clock = pygame.time.Clock()
os.environ['SDL_VIDEO_WINDOW_POS'] = 'center'
# This title appears along the top of the graphics window
pygame.display.set_caption("The Title Of My Progr... | 33.933333 | 67 | 0.760314 |
import os, pygame
from pygame.locals import *
pygame.init()
clock = pygame.time.Clock()
os.environ['SDL_VIDEO_WINDOW_POS'] = 'center'
pygame.display.set_caption("The Title Of My Program")
screen = pygame.display.set_mode([400,200],0,32)
pygame.time.wait(5000) | true | true |
1c35b0a824439fa3f3b63575ab92750ffcf360c6 | 7,628 | py | Python | tests/unit/test_opentelemetry_tracing.py | jprice-quizlet/python-bigquery | dcfbac267fbf66d189b0cc7e76f4712122a74b7b | [
"Apache-2.0"
] | null | null | null | tests/unit/test_opentelemetry_tracing.py | jprice-quizlet/python-bigquery | dcfbac267fbf66d189b0cc7e76f4712122a74b7b | [
"Apache-2.0"
] | null | null | null | tests/unit/test_opentelemetry_tracing.py | jprice-quizlet/python-bigquery | dcfbac267fbf66d189b0cc7e76f4712122a74b7b | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 35.812207 | 86 | 0.700708 |
import datetime
import sys
import mock
try:
import opentelemetry
from opentelemetry import trace
from opentelemetry.sdk.trace import TracerProvider
from opentelemetry.sdk.trace.export import SimpleExportSpanProcessor
from opentelemetry.sdk.trace.export.in_memory_span_exporter import ... | true | true |
1c35b178ec8c60bfe97e723609f7a883c6a014de | 2,808 | py | Python | sensorflow/console.py | maxpowel/sensorflow-python | 7c6f23087fbff085c43dd6d3bc00ce8dae884484 | [
"MIT"
] | null | null | null | sensorflow/console.py | maxpowel/sensorflow-python | 7c6f23087fbff085c43dd6d3bc00ce8dae884484 | [
"MIT"
] | null | null | null | sensorflow/console.py | maxpowel/sensorflow-python | 7c6f23087fbff085c43dd6d3bc00ce8dae884484 | [
"MIT"
] | null | null | null | import sensorflow
import cmd
# example of config: ds18b20 0x28 0xFF 0x10 0x93 0x6F 0x14 0x4 0x11
# example of config: dht 11 14
# 28ff5d216d1404cd
# 28FF608D6F140451
# 28FF10936F140411
# Robohuerto
# dht 11 9
# dht 21 6
# ina219
print("Initializing...")
source = sensorflow.SerialSource()
serializer = sensorflow.JsonSer... | 26.742857 | 145 | 0.530627 | import sensorflow
import cmd
print("Initializing...")
source = sensorflow.SerialSource()
serializer = sensorflow.JsonSerializer()
sf = sensorflow.Sensorflow(source=source, serializer=serializer)
sf.ping()
def ds18b20(params):
return sensorflow.DS18B20Sensor([int(i, 0) for i in params])
def dht(params)... | true | true |
1c35b191a748d9f7c658e46f2120c2f6153782c5 | 1,247 | py | Python | html2md/commands/KeepTag.py | IstvanOri/HTML2MD | f358a25135f9ca28266c774dafc4948cb8df33e6 | [
"Beerware"
] | null | null | null | html2md/commands/KeepTag.py | IstvanOri/HTML2MD | f358a25135f9ca28266c774dafc4948cb8df33e6 | [
"Beerware"
] | null | null | null | html2md/commands/KeepTag.py | IstvanOri/HTML2MD | f358a25135f9ca28266c774dafc4948cb8df33e6 | [
"Beerware"
] | 1 | 2021-11-08T01:53:55.000Z | 2021-11-08T01:53:55.000Z | import re
from html2md.commands.Command import Command
class KeepTag(Command):
"""
Command that keeps the original HTML tag. Any number of parameters can be passed for this Command. If no
parameters are passed, all attributes will be kept. If at least one parameter is passed, then only those
attribut... | 31.175 | 108 | 0.57097 | import re
from html2md.commands.Command import Command
class KeepTag(Command):
SHORT_TAGS = ["img", "br"]
def __init__(self, args):
super().__init__()
self._whitelist = []
for key, value in args.items():
self._whitelist.append(value)
def __copy__(self):
retu... | true | true |
1c35b406fe80a3f1d3c20b084895811eb57aef56 | 1,704 | py | Python | cluster/silhouette.py | thomas-mazumder/project5 | b8f2eda71dcfb550d030a2ee2d9b136005198aca | [
"MIT"
] | null | null | null | cluster/silhouette.py | thomas-mazumder/project5 | b8f2eda71dcfb550d030a2ee2d9b136005198aca | [
"MIT"
] | null | null | null | cluster/silhouette.py | thomas-mazumder/project5 | b8f2eda71dcfb550d030a2ee2d9b136005198aca | [
"MIT"
] | null | null | null | import numpy as np
from scipy.spatial.distance import cdist
class Silhouette:
def __init__(self, metric: str = "euclidean"):
"""
inputs:
metric: str
the name of the distance metric to use
"""
self._metric = metric
def score(self, X: np.ndarra... | 32.150943 | 94 | 0.545188 | import numpy as np
from scipy.spatial.distance import cdist
class Silhouette:
def __init__(self, metric: str = "euclidean"):
self._metric = metric
def score(self, X: np.ndarray, y: np.ndarray) -> np.ndarray:
s = np.zeros(X.shape[0])
distances = cdist(X, X, self._metric)
... | true | true |
1c35b41d2b552f2d8aeffa311e0ce09792ebbbc7 | 1,486 | py | Python | lingobarter/core/app.py | LeightonStreet/LingoBarter | 3fffd95c38973ca9b9ce284070522ba758efe489 | [
"Apache-2.0"
] | 7 | 2016-01-22T05:01:52.000Z | 2019-02-07T10:23:12.000Z | lingobarter/core/app.py | LeightonStreet/LeightonStreet | 3fffd95c38973ca9b9ce284070522ba758efe489 | [
"Apache-2.0"
] | 6 | 2016-03-26T23:32:47.000Z | 2016-04-01T07:10:42.000Z | lingobarter/core/app.py | LeightonStreet/LeightonStreet | 3fffd95c38973ca9b9ce284070522ba758efe489 | [
"Apache-2.0"
] | 1 | 2016-03-26T23:31:00.000Z | 2016-03-26T23:31:00.000Z | from flask import Flask, Blueprint
# noinspection PyProtectedMember
from flask.helpers import _endpoint_from_view_func
from lingobarter.core.config import LingobarterConfig
from lingobarter.utils.aliases import dispatch_aliases
class LingobarterApp(Flask):
"""
Implements customizations on Flask
- Config h... | 34.55814 | 87 | 0.709287 | from flask import Flask, Blueprint
from flask.helpers import _endpoint_from_view_func
from lingobarter.core.config import LingobarterConfig
from lingobarter.utils.aliases import dispatch_aliases
class LingobarterApp(Flask):
config_class = LingobarterConfig
def make_config(self, instance_relative=False):
... | true | true |
1c35b4d5930fa5ad8ea2fa1ce9f5dcc19f8380d7 | 3,523 | py | Python | MARS/test_single_stream.py | zzz2010/Contrib | d351d83da718145cef9f6c98598f7fedc027efe5 | [
"Apache-2.0"
] | 20 | 2020-03-13T13:40:32.000Z | 2022-03-10T07:31:48.000Z | MARS/test_single_stream.py | zzz2010/Contrib | d351d83da718145cef9f6c98598f7fedc027efe5 | [
"Apache-2.0"
] | 34 | 2020-02-20T11:04:58.000Z | 2022-03-12T00:54:26.000Z | MARS/test_single_stream.py | zzz2010/Contrib | d351d83da718145cef9f6c98598f7fedc027efe5 | [
"Apache-2.0"
] | 41 | 2020-02-14T09:34:39.000Z | 2022-03-10T07:31:42.000Z | #coding=utf-8
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
#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... | 39.58427 | 150 | 0.644905 |
import getpass
import os
import socket
import numpy as np
from PIL import Image, ImageFilter
import argparse
import time
import sys
import pdb
import math
from utils import *
from dataset.dataset import *
from dataset.preprocess_data import *
from models.model import generate_model
from opts import pars... | true | true |
1c35b4de14d7b520bf863c15dc70dc198786a1fb | 1,443 | py | Python | components/forms.py | alexdeathway/Gecom | 2a0fc87887d73d15eba183625dc8a429defe851f | [
"MIT"
] | 7 | 2021-11-15T06:28:05.000Z | 2022-02-22T11:36:00.000Z | components/forms.py | alexdeathway/Gecom | 2a0fc87887d73d15eba183625dc8a429defe851f | [
"MIT"
] | 3 | 2021-11-02T16:10:49.000Z | 2022-02-01T08:30:38.000Z | components/forms.py | alexdeathway/Gecom | 2a0fc87887d73d15eba183625dc8a429defe851f | [
"MIT"
] | null | null | null | from django import forms
from .models import ComponentsModel
from games.models import OrganisationModel
class ComponentCreationForm(forms.ModelForm):
def __init__(self,*args, **kwargs):
request=kwargs.pop("request")
vendor=OrganisationModel.objects.filter(owner=request.user)
... | 29.44898 | 73 | 0.543313 | from django import forms
from .models import ComponentsModel
from games.models import OrganisationModel
class ComponentCreationForm(forms.ModelForm):
def __init__(self,*args, **kwargs):
request=kwargs.pop("request")
vendor=OrganisationModel.objects.filter(owner=request.user)
... | true | true |
1c35b57c2f4cfea93ddbdf6894d8b6e1688954c3 | 2,276 | py | Python | brl_gym/scripts/maze/run.py | gilwoolee/brl_gym | 9c0784e9928f12d2ee0528c79a533202d3afb640 | [
"BSD-3-Clause"
] | 2 | 2020-08-07T05:50:44.000Z | 2022-03-03T08:46:10.000Z | brl_gym/scripts/maze/run.py | gilwoolee/brl_gym | 9c0784e9928f12d2ee0528c79a533202d3afb640 | [
"BSD-3-Clause"
] | null | null | null | brl_gym/scripts/maze/run.py | gilwoolee/brl_gym | 9c0784e9928f12d2ee0528c79a533202d3afb640 | [
"BSD-3-Clause"
] | null | null | null | import os
import glob
#os.system('source ~/venv/brl/bin/activate')
rootdir = "/home/gilwoo/models/maze/"
algos = [x[0] for x in os.walk(rootdir) if "checkpoints" in x[0]]
num_trials = 500
dry_run = False
algo_to_alg = {
# "single_expert_rbpo": ["bppo2_expert", "Maze-entropy-hidden-no-reward-v0"],
# "entropy... | 38.576271 | 263 | 0.612039 | import os
import glob
rootdir = "/home/gilwoo/models/maze/"
algos = [x[0] for x in os.walk(rootdir) if "checkpoints" in x[0]]
num_trials = 500
dry_run = False
algo_to_alg = {
"bpo_noent": ["ppo2","Maze-no-entropy-v0", 0.0],
}
for algo in algos:
algname = algo.s... | true | true |
1c35b69db59c65edc0e17a2718112c7f160758e4 | 2,810 | py | Python | NewTests/test2LevelReconstruction.py | Yuval-H/iclr_17_compression | f9b04a6cb93e32d17c2f2548614690dee8840d78 | [
"MIT"
] | null | null | null | NewTests/test2LevelReconstruction.py | Yuval-H/iclr_17_compression | f9b04a6cb93e32d17c2f2548614690dee8840d78 | [
"MIT"
] | null | null | null | NewTests/test2LevelReconstruction.py | Yuval-H/iclr_17_compression | f9b04a6cb93e32d17c2f2548614690dee8840d78 | [
"MIT"
] | null | null | null |
import torch.nn.functional as F
import torch
from torchvision import transforms
import matplotlib.pyplot as plt
import os
from PIL import Image, ImageChops
import glob
import numpy as np
from model_new import *
from model import *
device = 'cuda' if torch.cuda.is_available() else 'cpu'
# Load the small images AE mo... | 38.493151 | 129 | 0.753737 |
import torch.nn.functional as F
import torch
from torchvision import transforms
import matplotlib.pyplot as plt
import os
from PIL import Image, ImageChops
import glob
import numpy as np
from model_new import *
from model import *
device = 'cuda' if torch.cuda.is_available() else 'cpu'
model_orig_weights = '/home/... | true | true |
1c35b6f97058cc0c4330c60686dccc5d255a7f0c | 780 | py | Python | tests/wallet/test_taproot.py | zcomputerwiz/profit-blockchain | d6d4337ea7c418c66f05f22a263e94190452aed6 | [
"Apache-2.0"
] | 7 | 2022-03-15T01:33:35.000Z | 2022-03-26T21:29:45.000Z | tests/wallet/test_taproot.py | zcomputerwiz/profit-blockchain | d6d4337ea7c418c66f05f22a263e94190452aed6 | [
"Apache-2.0"
] | 3 | 2022-03-19T23:02:18.000Z | 2022-03-19T23:02:19.000Z | tests/wallet/test_taproot.py | zcomputerwiz/profit-blockchain | d6d4337ea7c418c66f05f22a263e94190452aed6 | [
"Apache-2.0"
] | null | null | null | from profit.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import (
DEFAULT_HIDDEN_PUZZLE,
calculate_synthetic_offset,
calculate_synthetic_public_key,
)
from tests.core.make_block_generator import int_to_public_key
class TestTaproot:
def test_1(self):
for main_secret_exponent in range(500... | 37.142857 | 82 | 0.733333 | from profit.wallet.puzzles.p2_delegated_puzzle_or_hidden_puzzle import (
DEFAULT_HIDDEN_PUZZLE,
calculate_synthetic_offset,
calculate_synthetic_public_key,
)
from tests.core.make_block_generator import int_to_public_key
class TestTaproot:
def test_1(self):
for main_secret_exponent in range(500... | true | true |
1c35b7241c7dbc5dfd5192653c881704f6539a0f | 474 | py | Python | src/identity.py | Neotoxic-off/Obit | a1ecab8e1b49f3c65cdb0ab09d7b366712fb5c86 | [
"BSL-1.0"
] | 1 | 2021-12-31T15:46:45.000Z | 2021-12-31T15:46:45.000Z | src/identity.py | Neotoxic-off/Obit | a1ecab8e1b49f3c65cdb0ab09d7b366712fb5c86 | [
"BSL-1.0"
] | null | null | null | src/identity.py | Neotoxic-off/Obit | a1ecab8e1b49f3c65cdb0ab09d7b366712fb5c86 | [
"BSL-1.0"
] | null | null | null | from src.request import Request
class Identity:
def __init__(self):
self.request = Request()
def get(self, proxies):
result = None
print("[wait] checking identity")
result = self.request.get("https://ident.me", proxies)
if (result.status_code == 200):
print... | 27.882353 | 68 | 0.592827 | from src.request import Request
class Identity:
def __init__(self):
self.request = Request()
def get(self, proxies):
result = None
print("[wait] checking identity")
result = self.request.get("https://ident.me", proxies)
if (result.status_code == 200):
print... | true | true |
1c35b92ff10a96e3a19c0e13cad7b453da696748 | 6,910 | py | Python | recognize-from-microphone.py | ArpanBose11/Music_Recogniser_Omega | 584ca1e77436a54ac2589bb9be839ec392b8b2c2 | [
"MIT"
] | null | null | null | recognize-from-microphone.py | ArpanBose11/Music_Recogniser_Omega | 584ca1e77436a54ac2589bb9be839ec392b8b2c2 | [
"MIT"
] | null | null | null | recognize-from-microphone.py | ArpanBose11/Music_Recogniser_Omega | 584ca1e77436a54ac2589bb9be839ec392b8b2c2 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import argparse
import sys
from argparse import RawTextHelpFormatter
from itertools import zip_longest as izip_longest
import numpy as np
from termcolor import colored
import libs.fingerprint as fingerprint
from libs.config import get_config
from libs.db_sqlite import SqliteDatabase
from libs.reader... | 28.089431 | 115 | 0.568596 |
import argparse
import sys
from argparse import RawTextHelpFormatter
from itertools import zip_longest as izip_longest
import numpy as np
from termcolor import colored
import libs.fingerprint as fingerprint
from libs.config import get_config
from libs.db_sqlite import SqliteDatabase
from libs.reader_microphone impor... | true | true |
1c35b96af9004b6beceeebdee70a73cd32a44a80 | 1,587 | py | Python | jumodjango/miner/web/crawler.py | jumoconnect/openjumo | 828d993bfbb83777d10a68de6964c7d5bb2c7bd0 | [
"MIT"
] | 5 | 2015-03-11T18:59:46.000Z | 2018-08-17T17:49:45.000Z | jumodjango/miner/web/crawler.py | kmrifat/openjumo | 828d993bfbb83777d10a68de6964c7d5bb2c7bd0 | [
"MIT"
] | 2 | 2020-06-05T16:52:17.000Z | 2021-02-08T20:24:26.000Z | jumodjango/miner/web/crawler.py | kmrifat/openjumo | 828d993bfbb83777d10a68de6964c7d5bb2c7bd0 | [
"MIT"
] | 6 | 2016-02-04T00:45:30.000Z | 2021-07-07T17:14:50.000Z | import string
import urllib2
import logging
import httplib
# This is the kind of task where coroutines really shine
green_lib = None
try:
import gevent
import gevent.pool
from gevent import monkey
monkey.patch_all()
green_lib = 'gevent'
except ImportError:
import eventlet
from eventlet i... | 28.854545 | 78 | 0.58097 | import string
import urllib2
import logging
import httplib
green_lib = None
try:
import gevent
import gevent.pool
from gevent import monkey
monkey.patch_all()
green_lib = 'gevent'
except ImportError:
import eventlet
from eventlet import monkey_patch
monkey_patch()
green_lib = 'e... | false | true |
1c35ba045499097a897b08a3e1511354eb895582 | 5,781 | py | Python | ux/dialog.py | jmcb/urwidx | 88b9cb6e02d19bc4c21b1c2fe3ee008bb03931f2 | [
"MIT",
"Unlicense"
] | 3 | 2016-07-20T00:15:08.000Z | 2022-02-14T01:27:40.000Z | ux/dialog.py | jmcb/urwidx | 88b9cb6e02d19bc4c21b1c2fe3ee008bb03931f2 | [
"MIT",
"Unlicense"
] | null | null | null | ux/dialog.py | jmcb/urwidx | 88b9cb6e02d19bc4c21b1c2fe3ee008bb03931f2 | [
"MIT",
"Unlicense"
] | null | null | null | #!/usr/bin/env python
import form, app, urwid, layout, button
class Dialog (form.Form):
"""
A modular Form designed to be displayed over the top of other forms.
"""
def __init__ (self, parent, width, height, align='center', valign='middle', shadow=u'\u2592', top_widget=None):
"""
In... | 33.416185 | 316 | 0.618751 |
import form, app, urwid, layout, button
class Dialog (form.Form):
"""
A modular Form designed to be displayed over the top of other forms.
"""
def __init__ (self, parent, width, height, align='center', valign='middle', shadow=u'\u2592', top_widget=None):
"""
Initialise a dialog. Re... | false | true |
1c35ba0c374f56cfcfb07200f010c3f7ffe0a64f | 3,736 | py | Python | src/ralph/ui/reports.py | quamilek/ralph | bf7231ea096924332b874718b33cd1f43f9c783b | [
"Apache-2.0"
] | null | null | null | src/ralph/ui/reports.py | quamilek/ralph | bf7231ea096924332b874718b33cd1f43f9c783b | [
"Apache-2.0"
] | null | null | null | src/ralph/ui/reports.py | quamilek/ralph | bf7231ea096924332b874718b33cd1f43f9c783b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import datetime
from django.db.models.sql.aggregates import Aggregate
from ralph.discovery.models import HistoryCost, Devic... | 32.206897 | 80 | 0.625 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import datetime
from django.db.models.sql.aggregates import Aggregate
from ralph.discovery.models import HistoryCost, DeviceType
class SpanSum(Aggregate):
sql_fu... | true | true |
1c35bae7b1f6110d35946c875695eb3d2011b0e3 | 4,496 | py | Python | bootcamp/articles/views.py | suhailvs/bootcamp | 23295a99085a843566367b73c134a83eb520c24d | [
"MIT"
] | null | null | null | bootcamp/articles/views.py | suhailvs/bootcamp | 23295a99085a843566367b73c134a83eb520c24d | [
"MIT"
] | null | null | null | bootcamp/articles/views.py | suhailvs/bootcamp | 23295a99085a843566367b73c134a83eb520c24d | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect, get_object_or_404
from django.http import HttpResponseForbidden, HttpResponseBadRequest, HttpResponse
from bootcamp.articles.models import Article, Tag, ArticleComment
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from bootcamp.articles.forms imp... | 35.68254 | 126 | 0.657028 | from django.shortcuts import render, redirect, get_object_or_404
from django.http import HttpResponseForbidden, HttpResponseBadRequest, HttpResponse
from bootcamp.articles.models import Article, Tag, ArticleComment
from django.core.paginator import Paginator, EmptyPage, PageNotAnInteger
from bootcamp.articles.forms imp... | true | true |
1c35bcf3fe4ea9bab6b8ad290a59a43bd504079a | 11,508 | py | Python | BookReviewsSentimentAnalyzer.py | hoossainalik/goodreads-reviewer | b4f47856b5c0e88f9bd5bc55b91f2cba8909ef27 | [
"MIT"
] | null | null | null | BookReviewsSentimentAnalyzer.py | hoossainalik/goodreads-reviewer | b4f47856b5c0e88f9bd5bc55b91f2cba8909ef27 | [
"MIT"
] | null | null | null | BookReviewsSentimentAnalyzer.py | hoossainalik/goodreads-reviewer | b4f47856b5c0e88f9bd5bc55b91f2cba8909ef27 | [
"MIT"
] | null | null | null | """-------------------------------------------
Package Name: BookReviewsSentimentAnalyzer
Author: Hussain Ali Khan
Version: 1.0.1
Last Modified: 12/02/2018
-------------------------------------------
"""
import sys
from PyQt5.QtWidgets import QDialog, QApplication, QMainWindow, QMessageBox, QDesktopWidget
fr... | 39.010169 | 120 | 0.539277 |
import sys
from PyQt5.QtWidgets import QDialog, QApplication, QMainWindow, QMessageBox, QDesktopWidget
from PyQt5.uic import loadUi
from PyQt5.QtCore import pyqtSlot, QTimer
import goodreads_api_client as gr
from PyQt5 import QtWidgets, QtGui
import requests
from requests import HTTPError
from bs4 import Beau... | true | true |
1c35bdf289ce9f23ba9e64b3a7ab60587588ed9e | 10,238 | py | Python | search/DrNAS/nb201space_progressive.py | MAC-AutoML/XNAS | 2c54ceb09b255cbcabd67f3c39fc777c4b2403f4 | [
"MIT"
] | 9 | 2021-04-21T08:14:03.000Z | 2021-11-26T11:52:40.000Z | search/DrNAS/nb201space_progressive.py | MAC-AutoML/XNAS | 2c54ceb09b255cbcabd67f3c39fc777c4b2403f4 | [
"MIT"
] | null | null | null | search/DrNAS/nb201space_progressive.py | MAC-AutoML/XNAS | 2c54ceb09b255cbcabd67f3c39fc777c4b2403f4 | [
"MIT"
] | 6 | 2021-05-19T02:36:43.000Z | 2021-12-03T07:21:37.000Z | import os
import torch
import torch.nn as nn
import torch.utils
import torch.backends.cudnn as cudnn
import xnas.core.logging as logging
import xnas.core.config as config
import xnas.core.meters as meters
import xnas.search_space.DrNAS.utils as utils
from xnas.core.builders import build_loss_fun, DrNAS_builder
from xn... | 32.814103 | 86 | 0.558312 | import os
import torch
import torch.nn as nn
import torch.utils
import torch.backends.cudnn as cudnn
import xnas.core.logging as logging
import xnas.core.config as config
import xnas.core.meters as meters
import xnas.search_space.DrNAS.utils as utils
from xnas.core.builders import build_loss_fun, DrNAS_builder
from xn... | true | true |
1c35be3873b7e48e75b63672aeaff5e197a474f9 | 1,339 | py | Python | contrib/devtools/fix-copyright-headers.py | estamat/cryptotest | 24bce31b81e33e5eec259096b5a40322812c40cf | [
"MIT"
] | 1 | 2019-01-13T02:36:42.000Z | 2019-01-13T02:36:42.000Z | contrib/devtools/fix-copyright-headers.py | estamat/cryptotest | 24bce31b81e33e5eec259096b5a40322812c40cf | [
"MIT"
] | null | null | null | contrib/devtools/fix-copyright-headers.py | estamat/cryptotest | 24bce31b81e33e5eec259096b5a40322812c40cf | [
"MIT"
] | 2 | 2018-12-05T19:19:57.000Z | 2018-12-30T19:34:09.000Z | #!/usr/bin/env python
'''
Run this script to update all the copyright headers of files
that were changed this year.
For example:
// Copyright (c) 2009-2012 The Bitcoin Core developers
it will change it to
// Copyright (c) 2009-2015 The Bitcoin Core developers
'''
import os
import time
import re
year = time.gmtime(... | 28.489362 | 77 | 0.634802 |
'''
Run this script to update all the copyright headers of files
that were changed this year.
For example:
// Copyright (c) 2009-2012 The Bitcoin Core developers
it will change it to
// Copyright (c) 2009-2015 The Bitcoin Core developers
'''
import os
import time
import re
year = time.gmtime()[0]
CMD_GIT_DATE = '... | false | true |
1c35be6009f1f3b90929631d9c03a85e7c351068 | 3,913 | py | Python | netbox/extras/admin.py | Netnod/netbox | 24344ccfafe6a6f6e71099fa2593a4eb8e737d5f | [
"Apache-2.0"
] | 1 | 2022-01-11T10:33:15.000Z | 2022-01-11T10:33:15.000Z | netbox/extras/admin.py | Netnod/netbox | 24344ccfafe6a6f6e71099fa2593a4eb8e737d5f | [
"Apache-2.0"
] | null | null | null | netbox/extras/admin.py | Netnod/netbox | 24344ccfafe6a6f6e71099fa2593a4eb8e737d5f | [
"Apache-2.0"
] | null | null | null | from django import forms
from django.contrib import admin
from netbox.admin import admin_site
from utilities.forms import LaxURLField
from .models import CustomField, CustomFieldChoice, CustomLink, Graph, ExportTemplate, TopologyMap, Webhook
def order_content_types(field):
"""
Order the list of available Con... | 25.083333 | 116 | 0.645029 | from django import forms
from django.contrib import admin
from netbox.admin import admin_site
from utilities.forms import LaxURLField
from .models import CustomField, CustomFieldChoice, CustomLink, Graph, ExportTemplate, TopologyMap, Webhook
def order_content_types(field):
queryset = field.queryset.order_by('app... | true | true |
1c35befc12f70e13e97a2aa569fc76e1372a6279 | 5,252 | py | Python | BluePlug/QtWork.py | liufeng3486/BluePlug | c7c5c769ed35c71ebc542d34848d6bf309abd051 | [
"MIT"
] | 1 | 2019-01-27T04:08:05.000Z | 2019-01-27T04:08:05.000Z | BluePlug/QtWork.py | liufeng3486/BluePlug | c7c5c769ed35c71ebc542d34848d6bf309abd051 | [
"MIT"
] | 5 | 2021-03-18T21:35:20.000Z | 2022-01-13T00:58:18.000Z | BluePlug/QtWork.py | liufeng3486/BluePlug | c7c5c769ed35c71ebc542d34848d6bf309abd051 | [
"MIT"
] | null | null | null | from PyQt5 import QtCore
from BluePlug.Base import *
import BluePlug.Init as Init
import BluePlug.Login as Login
from subprocess import Popen, PIPE, STDOUT
# import Answer,DailyQuest,PetFight,PlotCopy
# import SetInit
import BluePlug.MainQuest as MainQuest
# import CreateRole as CreateRole
import time,shutil
class Wor... | 34.781457 | 132 | 0.56588 | from PyQt5 import QtCore
from BluePlug.Base import *
import BluePlug.Init as Init
import BluePlug.Login as Login
from subprocess import Popen, PIPE, STDOUT
import BluePlug.MainQuest as MainQuest
import time,shutil
class Worker(QtCore.QThread):
sinOut = QtCore.pyqtSignal(str)
sinOut2 = QtCore.pyqtSignal(str... | true | true |
1c35bf9c42a54b0ce049fb9e066a1d6d5b21b754 | 1,724 | py | Python | Setup/SendMail.py | djtorch26/DSP_FinalProject | 202d51778f79aaaf18573504c51dcc4c85021ac3 | [
"MIT"
] | null | null | null | Setup/SendMail.py | djtorch26/DSP_FinalProject | 202d51778f79aaaf18573504c51dcc4c85021ac3 | [
"MIT"
] | null | null | null | Setup/SendMail.py | djtorch26/DSP_FinalProject | 202d51778f79aaaf18573504c51dcc4c85021ac3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Apr 22 09:29:36 2020
This works with python Version 3 only
@author: Dawson
"""
import os
import smtplib
from email import encoders
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email.mime.text import MIMEText
gmail_user = ""
gmail... | 28.262295 | 137 | 0.667053 |
import os
import smtplib
from email import encoders
from email.mime.multipart import MIMEMultipart
from email.mime.base import MIMEBase
from email.mime.text import MIMEText
gmail_user = ""
gmail_pwd = ""
to = "djtorch123@gmail.com"
def emailFile(file):
attach = file
if "test" in file:
su... | true | true |
1c35bff77d70074ae8e9d66cad3a8a97caf271d0 | 451 | py | Python | libweasyl/libweasyl/alembic/versions/cbe0ea91af79_remove_non_original_audio_upload_report_.py | greysteil/wzl-test | 0f863b9e7c58e5861437618bd590126ca323140c | [
"Apache-2.0"
] | 1 | 2019-02-15T04:21:48.000Z | 2019-02-15T04:21:48.000Z | libweasyl/libweasyl/alembic/versions/cbe0ea91af79_remove_non_original_audio_upload_report_.py | kfkitsune/wzl-test | 27297ccb42e24d652a29aa82f5a667c7d9a6d8de | [
"Apache-2.0"
] | 254 | 2017-12-23T19:36:43.000Z | 2020-04-14T21:46:13.000Z | libweasyl/libweasyl/alembic/versions/cbe0ea91af79_remove_non_original_audio_upload_report_.py | greysteil/wzl-test | 0f863b9e7c58e5861437618bd590126ca323140c | [
"Apache-2.0"
] | 1 | 2017-12-23T18:42:16.000Z | 2017-12-23T18:42:16.000Z | # encoding: utf-8
"""Remove “Non-original audio upload” report type
Revision ID: cbe0ea91af79
Revises: c8c088918278
Create Date: 2016-08-11 01:21:10.906138
"""
# revision identifiers, used by Alembic.
revision = 'cbe0ea91af79'
down_revision = 'c8c088918278'
from alembic import op
def upgrade():
op.execute('U... | 18.791667 | 82 | 0.745011 |
revision = 'cbe0ea91af79'
down_revision = 'c8c088918278'
from alembic import op
def upgrade():
op.execute('UPDATE reportcomment SET violation = 2020 WHERE violation = 2100')
def downgrade():
raise Exception('Irreversible migration')
| true | true |
1c35bffd725f29b683628d85125e5290faeee3bc | 283 | py | Python | helloworld/demo/management/commands/what_time_is_it.py | mingregister/helloworld | fd3bf75e8567b5be8fc6b89cfb3c874fc1c58276 | [
"Apache-2.0"
] | 13 | 2018-08-25T22:02:24.000Z | 2021-11-13T22:09:44.000Z | helloworld/demo/management/commands/what_time_is_it.py | mingregister/helloworld | fd3bf75e8567b5be8fc6b89cfb3c874fc1c58276 | [
"Apache-2.0"
] | null | null | null | helloworld/demo/management/commands/what_time_is_it.py | mingregister/helloworld | fd3bf75e8567b5be8fc6b89cfb3c874fc1c58276 | [
"Apache-2.0"
] | 7 | 2018-08-27T20:17:02.000Z | 2022-02-28T01:11:38.000Z | from django.core.management.base import BaseCommand
from django.utils import timezone
class Command(BaseCommand):
help = 'Displays current time'
def handle(self, *args, **kwargs):
time = timezone.now().strftime('%X')
self.stdout.write("It's now %s" % time)
| 28.3 | 51 | 0.681979 | from django.core.management.base import BaseCommand
from django.utils import timezone
class Command(BaseCommand):
help = 'Displays current time'
def handle(self, *args, **kwargs):
time = timezone.now().strftime('%X')
self.stdout.write("It's now %s" % time)
| true | true |
1c35c00d8c1d4ca62b074e558a9ce9247f3099f5 | 3,604 | py | Python | src/site-packages/pyicloud/services/reminders.py | nficano/alexa-find-my-iphone | d4621fd9d891cd820167c0cfdee2dc69cecac3ce | [
"MIT"
] | 9 | 2018-06-10T20:32:10.000Z | 2021-11-21T03:54:41.000Z | pyicloud/services/reminders.py | memkeytm/pyicloud | 46e1253ca5f608035ce862627c69190fc61c5bb2 | [
"MIT"
] | 479 | 2019-07-30T11:47:46.000Z | 2021-08-03T10:43:11.000Z | pyicloud/services/reminders.py | memkeytm/pyicloud | 46e1253ca5f608035ce862627c69190fc61c5bb2 | [
"MIT"
] | 5 | 2018-09-14T18:00:18.000Z | 2020-11-04T07:26:35.000Z | from __future__ import absolute_import
from datetime import datetime, timedelta
import time
import uuid
import json
from tzlocal import get_localzone
class RemindersService(object):
def __init__(self, service_root, session, params):
self.session = session
self.params = params
self._servic... | 32.468468 | 79 | 0.450333 | from __future__ import absolute_import
from datetime import datetime, timedelta
import time
import uuid
import json
from tzlocal import get_localzone
class RemindersService(object):
def __init__(self, service_root, session, params):
self.session = session
self.params = params
self._servic... | true | true |
1c35c01a4e5d4244e1a3f8834e76867cd11b8334 | 771 | py | Python | classification/rebalancing.py | GT-RIPL/UNO-IC | 6a95f2c6bc52ad80bfb1da53fd046a3d4db310d0 | [
"MIT"
] | 24 | 2020-11-11T03:49:50.000Z | 2022-03-21T04:23:32.000Z | classification/rebalancing.py | GT-RIPL/UNO-IC | 6a95f2c6bc52ad80bfb1da53fd046a3d4db310d0 | [
"MIT"
] | 1 | 2021-07-15T02:46:34.000Z | 2021-07-15T02:46:34.000Z | classification/rebalancing.py | GT-RIPL/UNO-IC | 6a95f2c6bc52ad80bfb1da53fd046a3d4db310d0 | [
"MIT"
] | 2 | 2021-02-04T01:28:19.000Z | 2021-02-25T09:20:27.000Z | import torch
def prior_recbalancing(logit,beta,s_prior,t_prior=None):
# logit (b,c,h,w): pre-softmax network output
# beta (1,): user controlled hyperparameter
# s_prior (1,c): source (training) data prior
# t_prior (1,c): target (test) data prior (most likely uniform)
prob = torch.nn.Softmax(dim=1)(logit)
... | 32.125 | 79 | 0.675746 | import torch
def prior_recbalancing(logit,beta,s_prior,t_prior=None):
prob = torch.nn.Softmax(dim=1)(logit)
inv_prior = 1/s_prior
inv_prior[inv_prior == float("inf")] = 0
inv_prior = inv_prior.unsqueeze(0).float()
if t_prior is None:
prob_r = prob*inv_prior
else:
pro... | true | true |
1c35c09ad7a1f0eedac5ed226e72d2ede6b782d1 | 392 | py | Python | blog/migrations/0004_auto_20220105_0959.py | ns377792/Blog-in-django | 7bebbf7ce364f76a609fbe7c2815eacf2c47978e | [
"MIT"
] | null | null | null | blog/migrations/0004_auto_20220105_0959.py | ns377792/Blog-in-django | 7bebbf7ce364f76a609fbe7c2815eacf2c47978e | [
"MIT"
] | null | null | null | blog/migrations/0004_auto_20220105_0959.py | ns377792/Blog-in-django | 7bebbf7ce364f76a609fbe7c2815eacf2c47978e | [
"MIT"
] | 1 | 2022-01-16T09:14:55.000Z | 2022-01-16T09:14:55.000Z | # Generated by Django 2.2.12 on 2022-01-05 04:29
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0003_auto_20220105_0307'),
]
operations = [
migrations.AlterField(
model_name='blogpost',
name='description... | 20.631579 | 51 | 0.604592 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0003_auto_20220105_0307'),
]
operations = [
migrations.AlterField(
model_name='blogpost',
name='description',
field=models.CharField(max_length... | true | true |
1c35c09ca8a8d96ab8bd36dfc9356abab5e3e5ce | 148 | py | Python | Python/Math/Power - Mod Power/solution.py | oleg-cherednik/hackerrank | a76580e300ad7af248ad7c7d6839777e554cc379 | [
"Apache-2.0"
] | 7 | 2020-04-02T16:18:46.000Z | 2021-02-12T14:06:44.000Z | Python/Math/Power - Mod Power/solution.py | oleg-cherednik/HackerRank | a76580e300ad7af248ad7c7d6839777e554cc379 | [
"Apache-2.0"
] | null | null | null | Python/Math/Power - Mod Power/solution.py | oleg-cherednik/HackerRank | a76580e300ad7af248ad7c7d6839777e554cc379 | [
"Apache-2.0"
] | 11 | 2020-05-06T08:28:43.000Z | 2021-12-08T17:25:45.000Z | #!/bin/python3
if __name__ == '__main__':
a = int(input())
b = int(input())
m = int(input())
print(a ** b)
print(pow(a, b, m))
| 16.444444 | 26 | 0.493243 |
if __name__ == '__main__':
a = int(input())
b = int(input())
m = int(input())
print(a ** b)
print(pow(a, b, m))
| true | true |
1c35c11409bf4f95b165e08bfd0e51c3cf1849fd | 885 | py | Python | moto/glacier/urls.py | gtourkas/moto | 307104417b579d23d02f670ff55217a2d4a16bee | [
"Apache-2.0"
] | 5,460 | 2015-01-01T01:11:17.000Z | 2022-03-31T23:45:38.000Z | moto/glacier/urls.py | gtourkas/moto | 307104417b579d23d02f670ff55217a2d4a16bee | [
"Apache-2.0"
] | 4,475 | 2015-01-05T19:37:30.000Z | 2022-03-31T13:55:12.000Z | moto/glacier/urls.py | gtourkas/moto | 307104417b579d23d02f670ff55217a2d4a16bee | [
"Apache-2.0"
] | 1,831 | 2015-01-14T00:00:44.000Z | 2022-03-31T20:30:04.000Z | from .responses import GlacierResponse
url_bases = [r"https?://glacier\.(.+)\.amazonaws.com"]
response = GlacierResponse()
url_paths = {
"{0}/(?P<account_number>.+)/vaults$": response.all_vault_response,
"{0}/(?P<account_number>.+)/vaults/(?P<vault_name>[^/]+)$": response.vault_response,
"{0}/(?P<account... | 55.3125 | 132 | 0.674576 | from .responses import GlacierResponse
url_bases = [r"https?://glacier\.(.+)\.amazonaws.com"]
response = GlacierResponse()
url_paths = {
"{0}/(?P<account_number>.+)/vaults$": response.all_vault_response,
"{0}/(?P<account_number>.+)/vaults/(?P<vault_name>[^/]+)$": response.vault_response,
"{0}/(?P<account... | true | true |
1c35c203c21c962485e649012e8eb15906f2f4ce | 2,157 | py | Python | contrib/examples/sensors/sample_polling_sensor.py | UbuntuEvangelist/st2 | 36af04f2caa03b396fb8ab00fd6d700e827fda8d | [
"Apache-2.0"
] | 1 | 2020-11-21T10:11:25.000Z | 2020-11-21T10:11:25.000Z | contrib/examples/sensors/sample_polling_sensor.py | UbuntuEvangelist/st2 | 36af04f2caa03b396fb8ab00fd6d700e827fda8d | [
"Apache-2.0"
] | 1 | 2015-06-08T15:27:11.000Z | 2015-06-08T15:27:11.000Z | contrib/examples/sensors/sample_polling_sensor.py | UbuntuEvangelist/st2 | 36af04f2caa03b396fb8ab00fd6d700e827fda8d | [
"Apache-2.0"
] | 13 | 2017-01-12T11:07:20.000Z | 2019-04-19T09:55:49.000Z | from st2reactor.sensor.base import PollingSensor
class SimplePollingSensor(PollingSensor):
"""
* self._sensor_service
- provides utilities like
get_logger() for writing to logs.
dispatch() for dispatching triggers into the system.
* self._config
- contains configura... | 38.517857 | 95 | 0.635605 | from st2reactor.sensor.base import PollingSensor
class SimplePollingSensor(PollingSensor):
def setup(self):
pass
def poll(self):
# health information about your instances:
# some_data = aws_client.get('')
# payload = self._to_p... | true | true |
1c35c2188225f1996dd0aacc01f3551ffbf9e18b | 20,878 | py | Python | tests/cli/test_init_sqlite.py | lfpll/great_expectations | f61fa7c2e6e813cd5ff84ab7403e05271cada257 | [
"Apache-2.0"
] | 1 | 2020-04-10T18:07:58.000Z | 2020-04-10T18:07:58.000Z | tests/cli/test_init_sqlite.py | lfpll/great_expectations | f61fa7c2e6e813cd5ff84ab7403e05271cada257 | [
"Apache-2.0"
] | null | null | null | tests/cli/test_init_sqlite.py | lfpll/great_expectations | f61fa7c2e6e813cd5ff84ab7403e05271cada257 | [
"Apache-2.0"
] | null | null | null | import os
import re
import shutil
import pytest
from click.testing import CliRunner
from sqlalchemy import create_engine
from great_expectations import DataContext
from great_expectations.cli import cli
from great_expectations.data_context.util import file_relative_path
from great_expectations.util import gen_directo... | 36.183709 | 101 | 0.670562 | import os
import re
import shutil
import pytest
from click.testing import CliRunner
from sqlalchemy import create_engine
from great_expectations import DataContext
from great_expectations.cli import cli
from great_expectations.data_context.util import file_relative_path
from great_expectations.util import gen_directo... | true | true |
1c35c23d2f75b4199e2713d59f34db2e7f69c57a | 3,951 | py | Python | desktop/core/ext-py/dnspython-1.15.0/dns/rdtypes/ANY/CERT.py | kokosing/hue | 2307f5379a35aae9be871e836432e6f45138b3d9 | [
"Apache-2.0"
] | 5,079 | 2015-01-01T03:39:46.000Z | 2022-03-31T07:38:22.000Z | desktop/core/ext-py/dnspython-1.15.0/dns/rdtypes/ANY/CERT.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 1,623 | 2015-01-01T08:06:24.000Z | 2022-03-30T19:48:52.000Z | desktop/core/ext-py/dnspython-1.15.0/dns/rdtypes/ANY/CERT.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 2,033 | 2015-01-04T07:18:02.000Z | 2022-03-28T19:55:47.000Z | # Copyright (C) 2003-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | 32.385246 | 78 | 0.643888 |
import struct
import base64
import dns.exception
import dns.dnssec
import dns.rdata
import dns.tokenizer
_ctype_by_value = {
1: 'PKIX',
2: 'SPKI',
3: 'PGP',
253: 'URI',
254: 'OID',
}
_ctype_by_name = {
'PKIX': 1,
'SPKI': 2,
'PGP': 3,
'URI': 253,
'OID': 254,
}
... | true | true |
1c35c2e143571df334c4f6293a81344f48ae102a | 632 | py | Python | tests/test_pytest_mypy.py | bochecha/pytest-mypy | c163fc321514c493bf6ea6c0dcf4459f0727d268 | [
"MIT"
] | null | null | null | tests/test_pytest_mypy.py | bochecha/pytest-mypy | c163fc321514c493bf6ea6c0dcf4459f0727d268 | [
"MIT"
] | null | null | null | tests/test_pytest_mypy.py | bochecha/pytest-mypy | c163fc321514c493bf6ea6c0dcf4459f0727d268 | [
"MIT"
] | null | null | null | def test_mypy_success(testdir):
testdir.makepyfile('''
def myfunc(x: int) -> int:
return x * 2
def test_myfunc():
assert myfunc(12)
''')
result = testdir.runpytest('--mypy', '-v')
assert result.ret == 0
def test_mypy_error(testdir):
testdir.makepyfile('''... | 21.066667 | 66 | 0.549051 | def test_mypy_success(testdir):
testdir.makepyfile('''
def myfunc(x: int) -> int:
return x * 2
def test_myfunc():
assert myfunc(12)
''')
result = testdir.runpytest('--mypy', '-v')
assert result.ret == 0
def test_mypy_error(testdir):
testdir.makepyfile('''... | true | true |
1c35c2e919e86cb1344d8a697147b9570d07f8c5 | 2,170 | py | Python | clients/bbg/blpapi-python/examples/unittests/market-data-notifier/src/token_generator.py | vegabook/dstreams | 9a2919b36ba2901522a61737a593fea28a655777 | [
"MIT"
] | 228 | 2017-06-20T16:14:06.000Z | 2022-03-30T02:04:47.000Z | clients/bbg/blpapi-python/examples/unittests/market-data-notifier/src/token_generator.py | vegabook/dstreams | 9a2919b36ba2901522a61737a593fea28a655777 | [
"MIT"
] | 3 | 2017-05-04T02:48:36.000Z | 2018-02-01T13:59:46.000Z | clients/bbg/blpapi-python/examples/unittests/market-data-notifier/src/token_generator.py | vegabook/dstreams | 9a2919b36ba2901522a61737a593fea28a655777 | [
"MIT"
] | 84 | 2017-11-21T14:56:20.000Z | 2022-03-31T15:22:22.000Z | """Sample token generator for testing."""
import blpapi
TOKEN_SUCCESS = blpapi.Name("TokenGenerationSuccess")
TOKEN_FAILURE = blpapi.Name("TokenGenerationFailure")
TOKEN = blpapi.Name("token")
# pylint: disable=too-few-public-methods
class TokenGenerator():
"""Generates a token for later authorization."""
d... | 38.75 | 76 | 0.710599 |
import blpapi
TOKEN_SUCCESS = blpapi.Name("TokenGenerationSuccess")
TOKEN_FAILURE = blpapi.Name("TokenGenerationFailure")
TOKEN = blpapi.Name("token")
class TokenGenerator():
def __init__(self, session):
self._session = session
def generate(self, event_queue=None):
token = None
if... | true | true |
1c35c3189d23f65367d999d8662a458f07d02cbc | 755 | py | Python | tools/svg_to_pgn.py | Leviathan321/ChessDiagramRecognition | c46effa3a9d49ae29fa55e82733e7fc7ba41c043 | [
"MIT"
] | 6 | 2020-07-27T19:10:30.000Z | 2021-08-17T02:23:53.000Z | tools/svg_to_pgn.py | Leviathan321/ChessDiagramRecognition | c46effa3a9d49ae29fa55e82733e7fc7ba41c043 | [
"MIT"
] | 10 | 2020-06-17T15:19:26.000Z | 2021-01-01T23:13:01.000Z | tools/svg_to_pgn.py | Leviathan321/ChessDiagramRecognition | c46effa3a9d49ae29fa55e82733e7fc7ba41c043 | [
"MIT"
] | 7 | 2020-08-10T05:13:57.000Z | 2022-01-13T09:26:21.000Z | ################################################################################
# Convert a svg image to pgn format
################################################################################
import cairosvg
################################################################################
########################... | 32.826087 | 80 | 0.239735 | true | true | |
1c35c32dbe3e3aec380a3b6a46b5f030037d23e1 | 4,888 | py | Python | 1. FUNDAMENTOS/3. PROGRAMACION ESTADISTICA CON PYTHON/3. my project/Part 1/heart.py | alvarochiqui/edem | d28861b04d9053848e26c24056395e5381ed398e | [
"Apache-2.0"
] | null | null | null | 1. FUNDAMENTOS/3. PROGRAMACION ESTADISTICA CON PYTHON/3. my project/Part 1/heart.py | alvarochiqui/edem | d28861b04d9053848e26c24056395e5381ed398e | [
"Apache-2.0"
] | null | null | null | 1. FUNDAMENTOS/3. PROGRAMACION ESTADISTICA CON PYTHON/3. my project/Part 1/heart.py | alvarochiqui/edem | d28861b04d9053848e26c24056395e5381ed398e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Tue Nov 16 18:17:34 2021
@author: alvar
"""
#Importamos todas las librerias necesarias para el proyecto
import os #sistema operativo
import pandas as pd #gestionar datframes
import numpy as np #numeric python vectores
im... | 30.17284 | 96 | 0.740385 |
import os
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
os.chdir(r'C:\Users\alvar\Desktop\EDEM\2. GITHUB\edem\Estadistica Python\my project')
heart = pd.read_csv ('heart.csv', sep=',')
os.getcwd()
print(heart)
print(he... | true | true |
1c35c41f5fdc2320979c9ed9aff80941d45c4c7b | 2,986 | py | Python | credentials_test.py | chiriket/Password-Locker | da40d20b886fcef01cc053a0c46a8caf91111877 | [
"MIT"
] | null | null | null | credentials_test.py | chiriket/Password-Locker | da40d20b886fcef01cc053a0c46a8caf91111877 | [
"MIT"
] | null | null | null | credentials_test.py | chiriket/Password-Locker | da40d20b886fcef01cc053a0c46a8caf91111877 | [
"MIT"
] | null | null | null | import unittest # Importing the unittest module
from credentials import Credentials # Importing the credentials class
class TestCredentials(unittest.TestCase):
'''
Test class that defines test cases for the credential class behaviours.
Args:
unittest.TestCase: TestCase class that helps in creatin... | 35.129412 | 100 | 0.659745 | import unittest
from credentials import Credentials
class TestCredentials(unittest.TestCase):
def tearDown(self):
Credentials.credential_list = []
def setUp(self):
self.new_credentials = Credentials("Twitter","Chiri","pass123")
def test_init(self):
self.assertEqual(s... | true | true |
1c35c44907649702b009572b98943488db90e845 | 941 | py | Python | src/webservice/frame.py | AzemaBaptiste/SoundLandscape | a9a27606301dd3c9000474960668ea11bada1452 | [
"BSD-3-Clause"
] | 1 | 2019-05-13T22:05:06.000Z | 2019-05-13T22:05:06.000Z | src/webservice/frame.py | AzemaBaptiste/SoundLandscape | a9a27606301dd3c9000474960668ea11bada1452 | [
"BSD-3-Clause"
] | null | null | null | src/webservice/frame.py | AzemaBaptiste/SoundLandscape | a9a27606301dd3c9000474960668ea11bada1452 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import base64
import cv2
from flask import Blueprint
from src.data.webcam_images import VideoCamera
CAMERA_APP = Blueprint('camera_app', __name__)
@CAMERA_APP.route("/api/frame/get_camera_face", methods=["POST", "GET"])
def get_camera_face():
"""Get img from face.
:return: (str) f... | 22.404762 | 73 | 0.686504 |
import base64
import cv2
from flask import Blueprint
from src.data.webcam_images import VideoCamera
CAMERA_APP = Blueprint('camera_app', __name__)
@CAMERA_APP.route("/api/frame/get_camera_face", methods=["POST", "GET"])
def get_camera_face():
CAMERA_FACE = VideoCamera(0)
frame = CAMERA_FACE.get_frame()
... | true | true |
1c35c513fb04c17f37bc0f40cdba4ccee9ab1721 | 1,042 | py | Python | setup.py | nuhamozaini/deepvec | a4019b685559d7aafce58d9e0b7afd0bb7d872d9 | [
"MIT"
] | 1 | 2019-04-04T08:53:21.000Z | 2019-04-04T08:53:21.000Z | setup.py | nuhamozaini/deepvec | a4019b685559d7aafce58d9e0b7afd0bb7d872d9 | [
"MIT"
] | null | null | null | setup.py | nuhamozaini/deepvec | a4019b685559d7aafce58d9e0b7afd0bb7d872d9 | [
"MIT"
] | null | null | null | from distutils.core import setup
from io import open
with open("README.rst", "r") as fh:
long_description = fh.read()
setup(
name='deepvec',
packages=['deepvec'],
version='0.2',
license='MIT',
description='Tensorflow wrapper for classification',
long_description=long_description,
autho... | 32.5625 | 110 | 0.639155 | from distutils.core import setup
from io import open
with open("README.rst", "r") as fh:
long_description = fh.read()
setup(
name='deepvec',
packages=['deepvec'],
version='0.2',
license='MIT',
description='Tensorflow wrapper for classification',
long_description=long_description,
autho... | true | true |
1c35c69d29f37b4c8fa1d900d63f1ab1b4805776 | 7,623 | py | Python | pl_examples/basic_examples/conv_sequential_example.py | skmatz/pytorch-lightning | fc6d4027334b8869f02a3bdca0a0846f1cf79928 | [
"Apache-2.0"
] | null | null | null | pl_examples/basic_examples/conv_sequential_example.py | skmatz/pytorch-lightning | fc6d4027334b8869f02a3bdca0a0846f1cf79928 | [
"Apache-2.0"
] | null | null | null | pl_examples/basic_examples/conv_sequential_example.py | skmatz/pytorch-lightning | fc6d4027334b8869f02a3bdca0a0846f1cf79928 | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 33.581498 | 120 | 0.642398 |
import math
from argparse import ArgumentParser
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
import pytorch_lightning as pl
from pl_examples import cli_lightning_logo
from pytorch_lightning import Trainer
from pytorch_lightning.metrics.functional import accuracy
f... | true | true |
1c35c80dc11669568aa1e14f01fb8d018a0141ec | 10,831 | py | Python | Code/all-starter-code/linkedlist.py | Prones94/CS-1.3-Core-Data-Structures | 35c6b859dcde741cab0d2596ccf96a137dc3065a | [
"MIT"
] | null | null | null | Code/all-starter-code/linkedlist.py | Prones94/CS-1.3-Core-Data-Structures | 35c6b859dcde741cab0d2596ccf96a137dc3065a | [
"MIT"
] | null | null | null | Code/all-starter-code/linkedlist.py | Prones94/CS-1.3-Core-Data-Structures | 35c6b859dcde741cab0d2596ccf96a137dc3065a | [
"MIT"
] | null | null | null | #!python
class Node(object):
def __init__(self, data):
"""Initialize this node with the given data."""
self.data = data
self.next = None
def __repr__(self):
"""Return a string representation of this node."""
return 'Node({!r})'.format(self.data)
class LinkedList(obje... | 40.114815 | 79 | 0.575939 |
class Node(object):
def __init__(self, data):
self.data = data
self.next = None
def __repr__(self):
return 'Node({!r})'.format(self.data)
class LinkedList(object):
def __init__(self, iterable=None):
self.head = None
self.tail = None
self.size = 0
... | true | true |
1c35c9661ac08bed450194c2318fc510b368dd9d | 71 | py | Python | atcoder/corp/ddcc2016_qa.py | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | 1 | 2018-11-12T15:18:55.000Z | 2018-11-12T15:18:55.000Z | atcoder/corp/ddcc2016_qa.py | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | null | null | null | atcoder/corp/ddcc2016_qa.py | knuu/competitive-programming | 16bc68fdaedd6f96ae24310d697585ca8836ab6e | [
"MIT"
] | null | null | null | A, B, C = map(int, input().split())
print('{:.20f}'.format(C * B / A))
| 23.666667 | 35 | 0.507042 | A, B, C = map(int, input().split())
print('{:.20f}'.format(C * B / A))
| true | true |
1c35c9e083095ca9cfbcb56a938324a7ae79c11b | 6,685 | py | Python | starterbot/lib/python2.7/site-packages/slackclient/_server.py | dshaps10/StarterBot | 95c2ad467ecd76650fc1b59daf5b894800d6f0e3 | [
"MIT"
] | null | null | null | starterbot/lib/python2.7/site-packages/slackclient/_server.py | dshaps10/StarterBot | 95c2ad467ecd76650fc1b59daf5b894800d6f0e3 | [
"MIT"
] | null | null | null | starterbot/lib/python2.7/site-packages/slackclient/_server.py | dshaps10/StarterBot | 95c2ad467ecd76650fc1b59daf5b894800d6f0e3 | [
"MIT"
] | null | null | null | from slackclient._slackrequest import SlackRequest
from slackclient._channel import Channel
from slackclient._user import User
from slackclient._util import SearchList
from ssl import SSLError
from websocket import create_connection
import json
class Server(object):
'''
The Server object owns the websocket c... | 31.384977 | 100 | 0.566492 | from slackclient._slackrequest import SlackRequest
from slackclient._channel import Channel
from slackclient._user import User
from slackclient._util import SearchList
from ssl import SSLError
from websocket import create_connection
import json
class Server(object):
def __init__(self, token, connect=True):
... | true | true |
1c35ca73c09d506e9d55236a5bc09733d95fafa5 | 2,793 | py | Python | QUANTAXIS/QAFetch/base.py | kingore/QUANTAXIS | ead08c4ccd4db6467d3a9a2533cef2fb6b6c95ad | [
"MIT"
] | 1 | 2018-02-21T05:00:57.000Z | 2018-02-21T05:00:57.000Z | QUANTAXIS/QAFetch/base.py | ariesii/QUANTAXIS | a09d8784619e39ae74e13689011b08cdcc8431c4 | [
"MIT"
] | null | null | null | QUANTAXIS/QAFetch/base.py | ariesii/QUANTAXIS | a09d8784619e39ae74e13689011b08cdcc8431c4 | [
"MIT"
] | 1 | 2018-03-24T16:05:04.000Z | 2018-03-24T16:05:04.000Z | # coding:utf-8
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2018 yutiansut/QUANTAXIS
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation th... | 40.478261 | 138 | 0.634085 |
headers = {'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8',
'Accept-Encoding': 'gzip, deflate',
'Accept-Language': 'zh-CN,zh;q=0.9',
'Cache-Control': 'max-age=0',
'Connection': 'keep-alive',
... | true | true |
1c35cd9adb0c85b88590392345e600e9bf237706 | 9,577 | py | Python | implementations/srgan/srgan_pl.py | jsyoo61/PyTorch-GAN | 2d528c5f9818b0d1110c33808947643f81a75bbb | [
"MIT"
] | null | null | null | implementations/srgan/srgan_pl.py | jsyoo61/PyTorch-GAN | 2d528c5f9818b0d1110c33808947643f81a75bbb | [
"MIT"
] | null | null | null | implementations/srgan/srgan_pl.py | jsyoo61/PyTorch-GAN | 2d528c5f9818b0d1110c33808947643f81a75bbb | [
"MIT"
] | null | null | null | """
Super-resolution of CelebA using Generative Adversarial Networks.
The dataset can be downloaded from: https://www.dropbox.com/sh/8oqt9vytwxb3s4r/AADIKlz8PR9zr6Y20qbkunrba/Img/img_align_celeba.zip?dl=0
(if not available there see if options are listed at http://mmlab.ie.cuhk.edu.hk/projects/CelebA.html)
Instrustion ... | 39.904167 | 173 | 0.677874 |
import argparse
import os
import numpy as np
import math
import itertools
import sys
import torchvision.transforms as transforms
from torchvision.utils import save_image, make_grid
from torch.utils.data import DataLoader
from torch.autograd import Variable
from models import *
from datasets import *
import torch.n... | true | true |
1c35cf2bc06adac2edb14614591c9dbe864c2054 | 1,447 | py | Python | luwu/utils/file_util.py | AaronJny/luwu | 05ee0bc605926661e42cada6cff5e281f4506291 | [
"MIT"
] | 19 | 2021-01-30T03:04:31.000Z | 2022-01-09T10:33:12.000Z | luwu/utils/file_util.py | AaronJny/luwu | 05ee0bc605926661e42cada6cff5e281f4506291 | [
"MIT"
] | 4 | 2021-04-15T02:10:53.000Z | 2021-06-24T12:17:29.000Z | luwu/utils/file_util.py | AaronJny/luwu | 05ee0bc605926661e42cada6cff5e281f4506291 | [
"MIT"
] | 5 | 2021-03-02T07:29:12.000Z | 2022-01-09T10:32:49.000Z | # -*- coding: utf-8 -*-
# @Author : AaronJny
# @LastEditTime : 2021-03-15
# @FilePath : /LuWu/luwu/utils/file_util.py
# @Desc :
import os
import time
from uuid import uuid1
from glob import glob
from luwu.utils import cmd_util
from loguru import logger
def abspath(filepath):
if filepath:
... | 24.525424 | 75 | 0.630961 |
import os
import time
from uuid import uuid1
from glob import glob
from luwu.utils import cmd_util
from loguru import logger
def abspath(filepath):
if filepath:
return os.path.abspath(os.path.expanduser(filepath))
else:
return ""
LUWU_TMP_DIR_ROOT = abspath("~/.luwu/tmp")
def mkdirs(d... | true | true |
1c35d02c76912387c8c0d48ec77217aeb67083f6 | 1,469 | py | Python | server/routes/routes_home.py | prsolucoes/firedash | 31e4364088200a63bed5754c527061554c139a27 | [
"MIT"
] | 2 | 2019-10-04T21:52:40.000Z | 2019-11-05T20:11:04.000Z | server/routes/routes_home.py | prsolucoes/firedash | 31e4364088200a63bed5754c527061554c139a27 | [
"MIT"
] | 2 | 2021-05-08T00:40:24.000Z | 2021-05-08T00:40:42.000Z | server/routes/routes_home.py | paulo-coutinho/firedash | 31e4364088200a63bed5754c527061554c139a27 | [
"MIT"
] | 2 | 2019-09-16T15:45:25.000Z | 2019-10-04T21:52:44.000Z | import os
from flask import render_template, Blueprint, send_from_directory, current_app
from config.data import config_data
routes_home = Blueprint("home", __name__)
@routes_home.route("/", defaults={"path": ""})
@routes_home.route("/<path:path>")
def action_catch_all(path):
if config_data["web_cli_enabled"]:... | 28.25 | 140 | 0.641253 | import os
from flask import render_template, Blueprint, send_from_directory, current_app
from config.data import config_data
routes_home = Blueprint("home", __name__)
@routes_home.route("/", defaults={"path": ""})
@routes_home.route("/<path:path>")
def action_catch_all(path):
if config_data["web_cli_enabled"]:... | true | true |
1c35d050815b9cdf658203a170875c7e4d0749ff | 3,308 | py | Python | Athos/tests/tf/unittests/test_non_linear.py | mpc-msri-dev/EzPC | a489c49d5c92f51df0277a7e5751e1b8baeb0bc1 | [
"MIT"
] | null | null | null | Athos/tests/tf/unittests/test_non_linear.py | mpc-msri-dev/EzPC | a489c49d5c92f51df0277a7e5751e1b8baeb0bc1 | [
"MIT"
] | null | null | null | Athos/tests/tf/unittests/test_non_linear.py | mpc-msri-dev/EzPC | a489c49d5c92f51df0277a7e5751e1b8baeb0bc1 | [
"MIT"
] | null | null | null | '''
Authors: Pratik Bhatu.
Copyright:
Copyright (c) 2021 Microsoft Research
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, co... | 40.341463 | 87 | 0.726723 | import tensorflow as tf
import numpy as np
import pytest
import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), "..", "..", ".."))
from tests.utils import Config, Compiler, assert_almost_equal
@pytest.mark.skip(reason="[non-linear] Haven't made non-linear functionalities public")
@pytest.mar... | true | true |
1c35d0a3ab1bdafc146123180f084381439c529a | 1,784 | py | Python | rcc8_table.py | CaFaSa/ternary-projective-relations | 66e6a9b3792e950cf53d848c5a86170bc810fef4 | [
"MIT"
] | null | null | null | rcc8_table.py | CaFaSa/ternary-projective-relations | 66e6a9b3792e950cf53d848c5a86170bc810fef4 | [
"MIT"
] | 9 | 2018-09-18T11:04:05.000Z | 2019-01-23T15:19:19.000Z | rcc8_table.py | CaFaSa/ternary-projective-relations | 66e6a9b3792e950cf53d848c5a86170bc810fef4 | [
"MIT"
] | null | null | null | from collections import defaultdict
#T composition table
T=defaultdict(dict)
U={'DC','EC','EQ','TPP','NTPP','TPPi','NTPPi','PO'}
O={'EQ','TPP','NTPP','TPPi','NTTPi','PO'}
T['DC']={'DC':U, 'EC':{'DC','EC','PO','TPP','NTPP'},'PO':{'DC','EC','PO','TPP','NTPP'},'TPP':{'DC','EC','PO','TPP','NTPP'},'NTPP':{'DC','EC','PO'... | 74.333333 | 201 | 0.471973 | from collections import defaultdict
T=defaultdict(dict)
U={'DC','EC','EQ','TPP','NTPP','TPPi','NTPPi','PO'}
O={'EQ','TPP','NTPP','TPPi','NTTPi','PO'}
T['DC']={'DC':U, 'EC':{'DC','EC','PO','TPP','NTPP'},'PO':{'DC','EC','PO','TPP','NTPP'},'TPP':{'DC','EC','PO','TPP','NTPP'},'NTPP':{'DC','EC','PO','TPP','NTPP'},'TPPi... | true | true |
1c35d0dd4fb4025d909ea5c166f05978e111964a | 265 | py | Python | tests/artificial/transf_None/trend_LinearTrend/cycle_12/ar_/test_artificial_32_None_LinearTrend_12__0.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | tests/artificial/transf_None/trend_LinearTrend/cycle_12/ar_/test_artificial_32_None_LinearTrend_12__0.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 1 | 2019-11-30T23:39:38.000Z | 2019-12-01T04:34:35.000Z | tests/artificial/transf_None/trend_LinearTrend/cycle_12/ar_/test_artificial_32_None_LinearTrend_12__0.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | import pyaf.Bench.TS_datasets as tsds
import pyaf.tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "LinearTrend", cycle_length = 12, transform = "None", sigma = 0.0, exog_count = 0, ar_order = 0); | 37.857143 | 160 | 0.728302 | import pyaf.Bench.TS_datasets as tsds
import pyaf.tests.artificial.process_artificial_dataset as art
art.process_dataset(N = 32 , FREQ = 'D', seed = 0, trendtype = "LinearTrend", cycle_length = 12, transform = "None", sigma = 0.0, exog_count = 0, ar_order = 0); | true | true |
1c35d117446b110efee6159784d102f5fd4ad147 | 343 | py | Python | aula4_pt1/views.py | ulisses9si/curso-flask | 2bde146f39d4eea78b98a8189ce76afd622ea54a | [
"Unlicense"
] | null | null | null | aula4_pt1/views.py | ulisses9si/curso-flask | 2bde146f39d4eea78b98a8189ce76afd622ea54a | [
"Unlicense"
] | null | null | null | aula4_pt1/views.py | ulisses9si/curso-flask | 2bde146f39d4eea78b98a8189ce76afd622ea54a | [
"Unlicense"
] | null | null | null | """Extensão Flask"""
from flask import Flask, request
def init_app(app: Flask):
"""Inicialização de extensões"""
@app.route("/")
def index():
print(request.args)
return "Esta rodando aguarde"
@app.route("/contato")
def contato():
return "<form><input type='t... | 21.4375 | 58 | 0.571429 | from flask import Flask, request
def init_app(app: Flask):
@app.route("/")
def index():
print(request.args)
return "Esta rodando aguarde"
@app.route("/contato")
def contato():
return "<form><input type='text'></input></form>"
| true | true |
1c35d1223d4b40e592b04a994e6978a0965730e4 | 2,794 | py | Python | guardianbot/interactions.py | shiftinv/GuardianBot | 2c5faef7ba4bf35e9f7fc814dd88f432f0af89da | [
"Apache-2.0"
] | 2 | 2021-11-21T12:30:44.000Z | 2021-11-22T13:39:27.000Z | guardianbot/interactions.py | shiftinv/GuardianBot | 2c5faef7ba4bf35e9f7fc814dd88f432f0af89da | [
"Apache-2.0"
] | null | null | null | guardianbot/interactions.py | shiftinv/GuardianBot | 2c5faef7ba4bf35e9f7fc814dd88f432f0af89da | [
"Apache-2.0"
] | null | null | null | from disnake.ext import commands
from typing import Callable, Dict, List, Optional, TypeVar, Union
from . import multicmd, types, utils
from .config import Config
class CustomSyncBot(commands.Bot):
async def _sync_application_command_permissions(self) -> None:
for command in self.application_commands:
... | 36.763158 | 126 | 0.653901 | from disnake.ext import commands
from typing import Callable, Dict, List, Optional, TypeVar, Union
from . import multicmd, types, utils
from .config import Config
class CustomSyncBot(commands.Bot):
async def _sync_application_command_permissions(self) -> None:
for command in self.application_commands:
... | true | true |
1c35d173246b53fefd76fea0ee73619eb3487e35 | 1,515 | py | Python | game/core/tools/roomSuport.py | Galtvam/projeto-de-redes | 351f84074ea8739de52f280e5f52f7d1da6af728 | [
"MIT"
] | 2 | 2019-05-30T23:14:52.000Z | 2021-03-31T04:43:55.000Z | game/core/tools/roomSuport.py | Galtvam/projeto-de-redes | 351f84074ea8739de52f280e5f52f7d1da6af728 | [
"MIT"
] | 1 | 2019-07-01T18:08:11.000Z | 2019-07-01T18:08:11.000Z | game/core/tools/roomSuport.py | Galtvam/projeto-de-redes | 351f84074ea8739de52f280e5f52f7d1da6af728 | [
"MIT"
] | null | null | null | #coding: utf-8
def extractListOfRooms(peersList):
rooms = {}
for peer in peersList:
if peer[2] and (peer[3] != None):
rooms[peer[3]] = peer
return rooms
def extractPlayersInRoom(roomID, peersList):
players = []
for peer in peersList:
if peer[2] and (peer[3] == roomID):
... | 24.047619 | 49 | 0.532673 |
def extractListOfRooms(peersList):
rooms = {}
for peer in peersList:
if peer[2] and (peer[3] != None):
rooms[peer[3]] = peer
return rooms
def extractPlayersInRoom(roomID, peersList):
players = []
for peer in peersList:
if peer[2] and (peer[3] == roomID):
ni... | true | true |
1c35d1b4130224fc95c6a593379fa7b96eb1a7ee | 8,013 | py | Python | pypegasus/base/ttypes.py | XiaoMi/pegasus-python-client | 877ed3bdc193d44d10dbe9b89b4f1acf3f681587 | [
"Apache-2.0"
] | 8 | 2018-07-19T09:33:44.000Z | 2022-03-27T15:59:53.000Z | pypegasus/base/ttypes.py | XiaoMi/pegasus-python-client | 877ed3bdc193d44d10dbe9b89b4f1acf3f681587 | [
"Apache-2.0"
] | 8 | 2018-03-02T08:11:10.000Z | 2022-02-11T03:38:33.000Z | pypegasus/base/ttypes.py | XiaoMi/pegasus-python-client | 877ed3bdc193d44d10dbe9b89b4f1acf3f681587 | [
"Apache-2.0"
] | 8 | 2018-02-27T07:38:28.000Z | 2021-03-25T02:53:19.000Z | #
# Autogenerated by Thrift Compiler (0.9.3)
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py
#
from aenum import Enum
import socket
import struct
from thrift.Thrift import TType
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
try:
fro... | 24.135542 | 188 | 0.669911 |
from aenum import Enum
import socket
import struct
from thrift.Thrift import TType
from thrift.transport import TTransport
from thrift.protocol import TBinaryProtocol
try:
from thrift.protocol import fastbinary
except:
fastbinary = None
class blob:
thrift_spec = (
)
def read(self, iprot):
se... | true | true |
1c35d2067aef56bee8c2fb53ec03f7259ed5bb43 | 22,085 | py | Python | flightrl/stable-baselines3/stable_baselines3/common/logger.py | arsimone/flightmare | c546d9d54970c7ad803f3ada4c2ea64c51ab7287 | [
"MIT"
] | null | null | null | flightrl/stable-baselines3/stable_baselines3/common/logger.py | arsimone/flightmare | c546d9d54970c7ad803f3ada4c2ea64c51ab7287 | [
"MIT"
] | null | null | null | flightrl/stable-baselines3/stable_baselines3/common/logger.py | arsimone/flightmare | c546d9d54970c7ad803f3ada4c2ea64c51ab7287 | [
"MIT"
] | null | null | null | import datetime
import json
import os
import sys
import tempfile
import warnings
from collections import defaultdict
from typing import Any, Dict, List, Optional, Sequence, TextIO, Tuple, Union
import numpy as np
import pandas
import torch as th
try:
from torch.utils.tensorboard import SummaryWriter
except Import... | 31.237624 | 125 | 0.591578 | import datetime
import json
import os
import sys
import tempfile
import warnings
from collections import defaultdict
from typing import Any, Dict, List, Optional, Sequence, TextIO, Tuple, Union
import numpy as np
import pandas
import torch as th
try:
from torch.utils.tensorboard import SummaryWriter
except Import... | true | true |
1c35d30f441730bd6bc9b240eade1dd952b106d9 | 594 | py | Python | examples/rockblock_send_text.py | OperatorFoundation/Adafruit_CircuitPython_RockBlock | d98b530faba55e71a1872ddaaab0ae507e86362c | [
"MIT"
] | null | null | null | examples/rockblock_send_text.py | OperatorFoundation/Adafruit_CircuitPython_RockBlock | d98b530faba55e71a1872ddaaab0ae507e86362c | [
"MIT"
] | null | null | null | examples/rockblock_send_text.py | OperatorFoundation/Adafruit_CircuitPython_RockBlock | d98b530faba55e71a1872ddaaab0ae507e86362c | [
"MIT"
] | null | null | null | # pylint: disable=wrong-import-position
import time
# CircuitPython / Blinka
import board
uart = board.UART()
uart.baudrate = 19200
# via USB cable
# import serial
# uart = serial.Serial("/dev/ttyUSB0", 19200)
from adafruit_rockblock import RockBlock
rb = RockBlock(uart)
# set the text
rb.text_out = "hello world"... | 18 | 45 | 0.710438 |
import time
import board
uart = board.UART()
uart.baudrate = 19200
from adafruit_rockblock import RockBlock
rb = RockBlock(uart)
rb.text_out = "hello world"
print("Talking to satellite...")
status = rb.satellite_transfer()
retry = 0
while status[0] > 8:
time.sleep(10)
status = rb.satellite_transf... | true | true |
1c35d361c6c540bfb4a02dbd495449ea98ed33fb | 1,041 | py | Python | audio.py | Anti-Counter021/Discord-Audio-bot | 1e10b8f2ffb12304269e9ca2dd40da5ea282adf6 | [
"MIT"
] | null | null | null | audio.py | Anti-Counter021/Discord-Audio-bot | 1e10b8f2ffb12304269e9ca2dd40da5ea282adf6 | [
"MIT"
] | null | null | null | audio.py | Anti-Counter021/Discord-Audio-bot | 1e10b8f2ffb12304269e9ca2dd40da5ea282adf6 | [
"MIT"
] | null | null | null | import asyncio
import discord
import youtube_dl.utils
youtube_dl.utils.bug_reports_message = lambda: ''
ytdl_format_options = {
'format': 'bestaudio/best',
'restrictfilenames': True,
'noplaylist': True,
'nocheckcertificate': True,
'ignoreerrors': False,
'logtostderr': False,
'quiet': True... | 26.025 | 104 | 0.642651 | import asyncio
import discord
import youtube_dl.utils
youtube_dl.utils.bug_reports_message = lambda: ''
ytdl_format_options = {
'format': 'bestaudio/best',
'restrictfilenames': True,
'noplaylist': True,
'nocheckcertificate': True,
'ignoreerrors': False,
'logtostderr': False,
'quiet': True... | true | true |
1c35d45a02f04139580da7a76ff13868f9a6fc6e | 9,795 | py | Python | captcha.py | Zhas1ke/Captcha_Generator | 72be27f298b8475643f037082b06b453a2dc9b78 | [
"MIT"
] | null | null | null | captcha.py | Zhas1ke/Captcha_Generator | 72be27f298b8475643f037082b06b453a2dc9b78 | [
"MIT"
] | null | null | null | captcha.py | Zhas1ke/Captcha_Generator | 72be27f298b8475643f037082b06b453a2dc9b78 | [
"MIT"
] | null | null | null | import numpy as np
import cv2
import string
import math
import os
import uuid
import random
##############################################
grad_img = cv2.imread('grad.png')
def sp_noise(image,prob):
'''
Add salt and pepper noise to image
prob: Probability of the noise
'''
output = np.zeros(image.sh... | 33.775862 | 119 | 0.528229 | import numpy as np
import cv2
import string
import math
import os
import uuid
import random
inner_bottom_right):
(x1, y1), (x2, y2) = outer_top_left, outer_bottom_right
(i1, j1), (i2, j2) = inner_top_left, inner_bottom_right
delta_x = np.random.randint(x1-i1, x2-i2)
delta_y = np.random.... | true | true |
1c35d4ca457d208328b483d9b22e632210ef3f26 | 3,896 | py | Python | aws_lambda/lambda_function.py | ia-flash/matchvec | e418c55c55a273f6a73fc048b3259967960c7e4f | [
"Apache-2.0"
] | 11 | 2019-10-30T08:14:49.000Z | 2021-09-28T07:46:58.000Z | aws_lambda/lambda_function.py | ia-flash/matchvec | e418c55c55a273f6a73fc048b3259967960c7e4f | [
"Apache-2.0"
] | 15 | 2019-09-09T07:31:41.000Z | 2022-03-11T23:54:18.000Z | aws_lambda/lambda_function.py | ia-flash/matchvec | e418c55c55a273f6a73fc048b3259967960c7e4f | [
"Apache-2.0"
] | 2 | 2019-10-31T21:10:27.000Z | 2022-02-14T19:39:57.000Z | import io
import re
from os import listdir, getenv
import json
import base64
import numpy as np
import cv2
from PIL import Image
from matchvec import predict_class, predict_objects, predict_anonym
from urllib.request import urlopen
from requests_toolbelt.multipart import decoder
pattern = re.compile('(?<=form-data; na... | 36.754717 | 95 | 0.497177 | import io
import re
from os import listdir, getenv
import json
import base64
import numpy as np
import cv2
from PIL import Image
from matchvec import predict_class, predict_objects, predict_anonym
from urllib.request import urlopen
from requests_toolbelt.multipart import decoder
pattern = re.compile('(?<=form-data; na... | true | true |
1c35d5860cc2768a17999b15772ec1eef57bef33 | 5,683 | py | Python | pymtl3/dsl/ComponentLevel5.py | kevinyuan/pymtl3 | 5949e6a4acc625c0ccbbb25be3af1d0db683df3c | [
"BSD-3-Clause"
] | 152 | 2020-06-03T02:34:11.000Z | 2022-03-30T04:16:45.000Z | pymtl3/dsl/ComponentLevel5.py | kevinyuan/pymtl3 | 5949e6a4acc625c0ccbbb25be3af1d0db683df3c | [
"BSD-3-Clause"
] | 139 | 2019-05-29T00:37:09.000Z | 2020-05-17T16:49:26.000Z | pymtl3/dsl/ComponentLevel5.py | kevinyuan/pymtl3 | 5949e6a4acc625c0ccbbb25be3af1d0db683df3c | [
"BSD-3-Clause"
] | 22 | 2020-05-18T13:42:05.000Z | 2022-03-11T08:37:51.000Z | """
========================================================================
ComponentLevel5.py
========================================================================
We allow CallerPort to be connected to CalleePort
Author : Shunning Jiang
Date : Dec 29, 2018
"""
from .ComponentLevel1 import ComponentLevel1
from ... | 35.298137 | 110 | 0.602147 | from .ComponentLevel1 import ComponentLevel1
from .ComponentLevel2 import ComponentLevel2
from .ComponentLevel4 import ComponentLevel4
from .Connectable import CalleePort, CallerPort, Const, Interface, MethodPort, Signal
from .errors import InvalidConnectionError, MultiWriterError
from .NamedObject import NamedObject
f... | true | true |
1c35d5ef64b773afab4d2baa905b6a3c1f17a8aa | 5,270 | py | Python | discord/calls.py | Werseter/discord.py | 00a659c6526b2445162b52eaf970adbd22c6d35d | [
"MIT"
] | null | null | null | discord/calls.py | Werseter/discord.py | 00a659c6526b2445162b52eaf970adbd22c6d35d | [
"MIT"
] | null | null | null | discord/calls.py | Werseter/discord.py | 00a659c6526b2445162b52eaf970adbd22c6d35d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2015-2017 Rapptz
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to u... | 33.782051 | 103 | 0.660911 |
import datetime
from . import utils
from .enums import VoiceRegion, try_enum
from .member import VoiceState
class CallMessage:
def __init__(self, message, **kwargs):
self.message = message
self.ended_timestamp = utils.parse_time(kwargs.get('ended_timestamp'))
self.participants = kwargs... | true | true |
1c35d6843446e8e93931c4d347edc5d320dcc788 | 520 | py | Python | backend_sqlalchemy/backend_app/models/findingsRel.py | jiz148/medical_app | 2f8b3f299ff6a87e62ac7483b6d2bac156a08874 | [
"MIT"
] | null | null | null | backend_sqlalchemy/backend_app/models/findingsRel.py | jiz148/medical_app | 2f8b3f299ff6a87e62ac7483b6d2bac156a08874 | [
"MIT"
] | null | null | null | backend_sqlalchemy/backend_app/models/findingsRel.py | jiz148/medical_app | 2f8b3f299ff6a87e62ac7483b6d2bac156a08874 | [
"MIT"
] | null | null | null | from backend_sqlalchemy.backend_app.db import db
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import declarative_base, relationship, backref
from backend_sqlalchemy.backend_app.models.visit import VisitModel
from backend_sqlalchemy.backend_app.models.findings import FindingsModel
from sqlalchemy... | 30.588235 | 90 | 0.834615 | from backend_sqlalchemy.backend_app.db import db
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import declarative_base, relationship, backref
from backend_sqlalchemy.backend_app.models.visit import VisitModel
from backend_sqlalchemy.backend_app.models.findings import FindingsModel
from sqlalchemy... | true | true |
1c35d71d1c705db39e3a1901e9c33bae29f5887b | 13,792 | py | Python | calico/felix/test/test_frules.py | fasaxc/felix | b5d58c0e9bad5fd3bfa81fc6ff5633dd40265622 | [
"Apache-2.0"
] | null | null | null | calico/felix/test/test_frules.py | fasaxc/felix | b5d58c0e9bad5fd3bfa81fc6ff5633dd40265622 | [
"Apache-2.0"
] | null | null | null | calico/felix/test/test_frules.py | fasaxc/felix | b5d58c0e9bad5fd3bfa81fc6ff5633dd40265622 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2014 Metaswitch Networks
#
# 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 applicab... | 38.52514 | 81 | 0.47339 |
from copy import copy
import logging
import mock
import unittest
import calico.felix.frules as frules
from calico.felix.futils import IPV4, IPV6, FailedSystemCall
import calico.felix.ipsets
import calico.felix.test.stub_ipsets as stub_ipsets
expected_ipsets = stub_ipsets.IpsetState()
log = logging.ge... | true | true |
1c35d76f9d1528b71dca25ece2b7e7615442d6a2 | 79,661 | py | Python | archive/fabfile.py | louis-pre/NewsBlur | b4e9a56041ff187ef77b38dfd0778daf41b53f4f | [
"MIT"
] | 3,073 | 2015-01-01T07:20:18.000Z | 2022-03-31T20:33:41.000Z | archive/fabfile.py | louis-pre/NewsBlur | b4e9a56041ff187ef77b38dfd0778daf41b53f4f | [
"MIT"
] | 1,054 | 2015-01-02T13:32:35.000Z | 2022-03-30T04:21:21.000Z | archive/fabfile.py | louis-pre/NewsBlur | b4e9a56041ff187ef77b38dfd0778daf41b53f4f | [
"MIT"
] | 676 | 2015-01-03T16:40:29.000Z | 2022-03-30T14:00:40.000Z | from fabric.api import cd, lcd, env, local, parallel, serial
from fabric.api import put, run, settings, sudo, prefix
from fabric.operations import prompt
from fabric.contrib import django
from fabric.contrib import files
from fabric.state import connections
# from fabric.colors import red, green, blue, cyan, magenta, w... | 38.006202 | 204 | 0.631363 | from fabric.api import cd, lcd, env, local, parallel, serial
from fabric.api import put, run, settings, sudo, prefix
from fabric.operations import prompt
from fabric.contrib import django
from fabric.contrib import files
from fabric.state import connections
from boto.s3.connection import S3Connection
from boto.s3.key ... | true | true |
1c35d8b18e1794c2240a997c32bd2f5a6d14aee4 | 5,989 | py | Python | calculator.py | craig9/lathe-threading-calculator | 7912dfd839a6d9f2504eed3396f9e678a9238fb1 | [
"MIT"
] | null | null | null | calculator.py | craig9/lathe-threading-calculator | 7912dfd839a6d9f2504eed3396f9e678a9238fb1 | [
"MIT"
] | null | null | null | calculator.py | craig9/lathe-threading-calculator | 7912dfd839a6d9f2504eed3396f9e678a9238fb1 | [
"MIT"
] | null | null | null | #!/usr/bin/python
from operator import mul,itemgetter
import sys
from itertools import permutations
from math import pi, cos
gears = [20, 30, 32, 35, 45, 50, 50, 55, 60, 64, 64, 64, 65]
quad_gears = {1:1, 63:80, 70:80, 80:63, 80:70}
qc_gears = {1:16, 2:18, 3:19, 4:20, 5:22, 6:24, 7:26, 8:28, 9:30, 10:32}
#iso_mm_p... | 35.229412 | 238 | 0.628986 |
from operator import mul,itemgetter
import sys
from itertools import permutations
from math import pi, cos
gears = [20, 30, 32, 35, 45, 50, 50, 55, 60, 64, 64, 64, 65]
quad_gears = {1:1, 63:80, 70:80, 80:63, 80:70}
qc_gears = {1:16, 2:18, 3:19, 4:20, 5:22, 6:24, 7:26, 8:28, 9:30, 10:32}
iso_mm_pitches = [3.996,... | false | true |
1c35d8dcaf872e8dc63e0b7c8949ce04feb59a02 | 10,757 | py | Python | models/resnet_2p1d.py | kk2487/3dresnet | d7161a70ed6c2f8dcbe89f9b6bad2ef6cc5b5d94 | [
"MIT"
] | null | null | null | models/resnet_2p1d.py | kk2487/3dresnet | d7161a70ed6c2f8dcbe89f9b6bad2ef6cc5b5d94 | [
"MIT"
] | null | null | null | models/resnet_2p1d.py | kk2487/3dresnet | d7161a70ed6c2f8dcbe89f9b6bad2ef6cc5b5d94 | [
"MIT"
] | null | null | null | import math
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
def get_inplanes():
return [64, 128, 256, 512]
def conv1x3x3(in_planes, mid_planes, stride=1):
return nn.Conv3d(in_planes,
mid_planes,
kernel_size=(1, 3, 3)... | 34.925325 | 119 | 0.525704 | import math
from functools import partial
import torch
import torch.nn as nn
import torch.nn.functional as F
def get_inplanes():
return [64, 128, 256, 512]
def conv1x3x3(in_planes, mid_planes, stride=1):
return nn.Conv3d(in_planes,
mid_planes,
kernel_size=(1, 3, 3)... | true | true |
1c35d95a84884bcda70944a0f090125b57b980cd | 4,252 | py | Python | Fig5b_lipid_droplets_area.py | MortisHuang/VIFFI-image-analysis | ad144970e9cb53d61119dd96370157251c03cc07 | [
"MIT"
] | null | null | null | Fig5b_lipid_droplets_area.py | MortisHuang/VIFFI-image-analysis | ad144970e9cb53d61119dd96370157251c03cc07 | [
"MIT"
] | null | null | null | Fig5b_lipid_droplets_area.py | MortisHuang/VIFFI-image-analysis | ad144970e9cb53d61119dd96370157251c03cc07 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Nov 14 18:35:15 2019
@author: Mortis
"""
import numpy as np
import scipy.ndimage as ndimage
import scipy.ndimage.filters as filters
import glob
import os
from PIL import Image
import pandas as pd
import copy
import datetime
#%% Set the output file location
r... | 33.480315 | 94 | 0.599718 |
import numpy as np
import scipy.ndimage as ndimage
import scipy.ndimage.filters as filters
import glob
import os
from PIL import Image
import pandas as pd
import copy
import datetime
run_data = datetime.datetime.now().strftime("%Y_%m_%d")
result_path=r"./Fig5_{}/".format(run_data)
if not os.path.exists(r... | true | true |
1c35dade20cbdab22715eba330944a249b47f391 | 3,150 | py | Python | scripts/writing/hyperopt-model-tables.py | heytitle/Syllable-based-Neural-Thai-Word-Segmentation | bb8a4f0dbabe31a65f9bfa1fd784000544e3e7f5 | [
"MIT"
] | 8 | 2020-10-22T10:15:29.000Z | 2021-09-15T08:11:34.000Z | scripts/writing/hyperopt-model-tables.py | heytitle/Syllable-based-Neural-Thai-Word-Segmentation | bb8a4f0dbabe31a65f9bfa1fd784000544e3e7f5 | [
"MIT"
] | 3 | 2021-07-04T06:14:53.000Z | 2021-11-09T03:07:16.000Z | scripts/writing/hyperopt-model-tables.py | heytitle/Syllable-based-Neural-Thai-Word-Segmentation | bb8a4f0dbabe31a65f9bfa1fd784000544e3e7f5 | [
"MIT"
] | null | null | null | # This generates model hyperopt tables for Appendix
import yaml
import pandas as pd
from attacut import utils
OUTPUT = "./writing/tables/hyperopt-model-tables.tex"
table = r"""
\begin{table*}
\centering
\begin{tabular}{lc}
\toprule
\textbf{Average training duration} & %(avg_training).0f minutes \\
\textbf{Average ... | 35.393258 | 92 | 0.590794 |
import yaml
import pandas as pd
from attacut import utils
OUTPUT = "./writing/tables/hyperopt-model-tables.tex"
table = r"""
\begin{table*}
\centering
\begin{tabular}{lc}
\toprule
\textbf{Average training duration} & %(avg_training).0f minutes \\
\textbf{Average validation word-level $F_1$} & %(avg_val_f1)2.2f$\... | true | true |
1c35dafc3b8f2e33945c74a548ca881860fad516 | 2,006 | py | Python | test/test_min_max_stack.py | kisliakovsky/structures | 19969470a7e9b150b077082cc8ca0c2fc9be279e | [
"MIT"
] | null | null | null | test/test_min_max_stack.py | kisliakovsky/structures | 19969470a7e9b150b077082cc8ca0c2fc9be279e | [
"MIT"
] | null | null | null | test/test_min_max_stack.py | kisliakovsky/structures | 19969470a7e9b150b077082cc8ca0c2fc9be279e | [
"MIT"
] | null | null | null | from unittest import TestCase
from src.stack import MinMaxStack
class TestMinMaxStack(TestCase):
def test_push(self):
stack = MinMaxStack[int]()
stack.push((None, None))
stack.push((1, None))
stack.push((None, 4))
stack.push((2, None))
stack.push((None, 3))
... | 30.861538 | 92 | 0.563809 | from unittest import TestCase
from src.stack import MinMaxStack
class TestMinMaxStack(TestCase):
def test_push(self):
stack = MinMaxStack[int]()
stack.push((None, None))
stack.push((1, None))
stack.push((None, 4))
stack.push((2, None))
stack.push((None, 3))
... | true | true |
1c35db4708c0469265f6ce43cecb30f2ba3a546c | 1,177 | py | Python | gamechangerml/src/utilities/np_utils.py | ekmixon/gamechanger-ml | e7967261a4b2f21b06347020cd7e6a010538eb8f | [
"MIT"
] | 11 | 2021-05-05T17:52:10.000Z | 2022-02-04T15:12:29.000Z | gamechangerml/src/utilities/np_utils.py | ekmixon/gamechanger-ml | e7967261a4b2f21b06347020cd7e6a010538eb8f | [
"MIT"
] | 76 | 2021-07-24T02:33:16.000Z | 2022-03-20T22:40:46.000Z | gamechangerml/src/utilities/np_utils.py | ekmixon/gamechanger-ml | e7967261a4b2f21b06347020cd7e6a010538eb8f | [
"MIT"
] | 6 | 2021-06-30T22:18:56.000Z | 2022-03-22T16:54:50.000Z | """
A collection of `numpy` utilities.
"""
import logging
import numpy as np
logger = logging.getLogger(__name__)
def is_zero_vector(v):
"""
Tests if a vector is a zero vector.
Args:
v (numpy.ndarray): vector
Returns:
boolean: True if every element is zero
"""
return np.all... | 19.616667 | 63 | 0.621071 | import logging
import numpy as np
logger = logging.getLogger(__name__)
def is_zero_vector(v):
return np.all(v == 0.0)
def l2_norm_by_row(matrix):
return np.sqrt(np.einsum("ij,ij->i", matrix, matrix))
def l2_normed_matrix(matrix):
l2 = l2_norm_by_row(matrix)
return matrix / l2[:, None]
def l2_n... | true | true |
1c35dd5104ab1bd7b70c00ed07b14970e87e950b | 3,940 | py | Python | presalytics/lib/themes/ooxml.py | presalytics/python-client | 5d80b78562126feeeb49af4738e2c1aed12dce3a | [
"MIT"
] | 4 | 2020-02-21T16:30:46.000Z | 2021-01-12T12:22:03.000Z | presalytics/lib/themes/ooxml.py | presalytics/python-client | 5d80b78562126feeeb49af4738e2c1aed12dce3a | [
"MIT"
] | 4 | 2019-12-28T19:30:08.000Z | 2020-03-31T19:27:45.000Z | presalytics/lib/themes/ooxml.py | presalytics/python-client | 5d80b78562126feeeb49af4738e2c1aed12dce3a | [
"MIT"
] | null | null | null | import typing
import presalytics
import presalytics.client.auth
import presalytics.story.components
import presalytics.story.outline
import presalytics.story.util
import presalytics.client.presalytics_ooxml_automation.models
class OoxmlTheme(presalytics.story.components.ThemeBase):
"""
TODO: Review whether th... | 37.52381 | 102 | 0.63198 | import typing
import presalytics
import presalytics.client.auth
import presalytics.story.components
import presalytics.story.outline
import presalytics.story.util
import presalytics.client.presalytics_ooxml_automation.models
class OoxmlTheme(presalytics.story.components.ThemeBase):
name: str
ooxml_id: str
... | true | true |
1c35ddf24a07d5e4617b24a5101c7fad8dff9e53 | 1,527 | py | Python | process_cuwb_data/honeycomb_imu_data.py | WildflowerSchools/wf-process-cuwb-data | 8d94eeec82401f0f62ce1e0b7fdefd49e0328921 | [
"MIT"
] | null | null | null | process_cuwb_data/honeycomb_imu_data.py | WildflowerSchools/wf-process-cuwb-data | 8d94eeec82401f0f62ce1e0b7fdefd49e0328921 | [
"MIT"
] | 2 | 2020-10-01T18:18:05.000Z | 2020-12-17T22:40:06.000Z | process_cuwb_data/honeycomb_imu_data.py | WildflowerSchools/wf-process-cuwb-data | 8d94eeec82401f0f62ce1e0b7fdefd49e0328921 | [
"MIT"
] | null | null | null | from honeycomb_io import fetch_cuwb_position_data, fetch_cuwb_accelerometer_data, fetch_cuwb_gyroscope_data, fetch_cuwb_magnetometer_data, add_device_assignment_info, add_device_entity_assignment_info, add_tray_material_assignment_info
from .utils.util import filter_entity_type
def fetch_imu_data(imu_type,
... | 32.489362 | 235 | 0.670596 | from honeycomb_io import fetch_cuwb_position_data, fetch_cuwb_accelerometer_data, fetch_cuwb_gyroscope_data, fetch_cuwb_magnetometer_data, add_device_assignment_info, add_device_entity_assignment_info, add_tray_material_assignment_info
from .utils.util import filter_entity_type
def fetch_imu_data(imu_type,
... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.