hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k β | max_stars_repo_stars_event_min_datetime stringlengths 24 24 β | max_stars_repo_stars_event_max_datetime stringlengths 24 24 β | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k β | max_issues_repo_issues_event_min_datetime stringlengths 24 24 β | max_issues_repo_issues_event_max_datetime stringlengths 24 24 β | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k β | max_forks_repo_forks_event_min_datetime stringlengths 24 24 β | max_forks_repo_forks_event_max_datetime stringlengths 24 24 β | content stringlengths 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f745b321a9d0365fce2574ae9cb5b3a1ee8c62aa | 1,549 | py | Python | remme/ws/utils.py | REMME-ONU/remme-core-temp | 2d68f284c3cb8156b4c3742dd0104d8406bd87f6 | [
"Apache-2.0"
] | null | null | null | remme/ws/utils.py | REMME-ONU/remme-core-temp | 2d68f284c3cb8156b4c3742dd0104d8406bd87f6 | [
"Apache-2.0"
] | null | null | null | remme/ws/utils.py | REMME-ONU/remme-core-temp | 2d68f284c3cb8156b4c3742dd0104d8406bd87f6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 REMME
#
# 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, softwa... | 28.163636 | 74 | 0.650742 |
import ujson
from .constants import Status
def serialize(payload):
return ujson.dumps(payload)
def deserialize(payload):
return ujson.loads(payload)
def create_res_payload(status, data, id, type):
payload = {
'type': type,
'status': status.name.lower(),
}
if id:... | true | true |
f745b3db2aded6eafa3ced2618e23b101a84de22 | 18,416 | py | Python | cli/internal/commands/register.py | MasonAmerica/mason-cl | ac9ac5041b12090b94958ec41d2b5a294c4b61e6 | [
"Apache-2.0"
] | 9 | 2019-12-05T23:50:46.000Z | 2021-09-16T17:49:27.000Z | cli/internal/commands/register.py | MasonAmerica/mason-cl | ac9ac5041b12090b94958ec41d2b5a294c4b61e6 | [
"Apache-2.0"
] | 5 | 2018-03-19T21:00:15.000Z | 2021-07-24T08:35:13.000Z | cli/internal/commands/register.py | MasonAmerica/mason-cl | ac9ac5041b12090b94958ec41d2b5a294c4b61e6 | [
"Apache-2.0"
] | 3 | 2018-07-08T14:51:03.000Z | 2021-11-24T17:32:39.000Z | import abc
import copy
import os
import tempfile
from abc import abstractmethod
from threading import Lock
import click
import six
import yaml
from tqdm import tqdm
from cli.config import Config
from cli.internal.commands.command import Command
from cli.internal.models.apk import Apk
from cli.internal.models.artifact... | 35.689922 | 98 | 0.614411 | import abc
import copy
import os
import tempfile
from abc import abstractmethod
from threading import Lock
import click
import six
import yaml
from tqdm import tqdm
from cli.config import Config
from cli.internal.commands.command import Command
from cli.internal.models.apk import Apk
from cli.internal.models.artifact... | true | true |
f745b4541731685b3b5f7e59fb36223fca03f8f5 | 3,992 | py | Python | code/id53.py | hanfengzhai/DARPA-FFT | 61705c1dcbe7a75a54003db5e8f7db3717e3040c | [
"MIT"
] | null | null | null | code/id53.py | hanfengzhai/DARPA-FFT | 61705c1dcbe7a75a54003db5e8f7db3717e3040c | [
"MIT"
] | null | null | null | code/id53.py | hanfengzhai/DARPA-FFT | 61705c1dcbe7a75a54003db5e8f7db3717e3040c | [
"MIT"
] | null | null | null | import time
from scipy import fftpack
import book_format
book_format.set_style()
import kf_book.kf_internal as kf_internal
from kf_book.kf_internal import DogSimulation
from kf_book import book_plots as book_plots
import numpy as np
from matplotlib import pyplot
import scipy.io
import pandas as pd
import pandas_datarea... | 28.719424 | 149 | 0.716683 | import time
from scipy import fftpack
import book_format
book_format.set_style()
import kf_book.kf_internal as kf_internal
from kf_book.kf_internal import DogSimulation
from kf_book import book_plots as book_plots
import numpy as np
from matplotlib import pyplot
import scipy.io
import pandas as pd
import pandas_datarea... | true | true |
f745b523845f855e4f2d6ea60b42cedae433aaa7 | 521 | py | Python | contest/20190303_ABC120/D.py | miyuush/AtCoder | 9481f15b69b99f56334a623f5a63dbb5e6359522 | [
"MIT"
] | null | null | null | contest/20190303_ABC120/D.py | miyuush/AtCoder | 9481f15b69b99f56334a623f5a63dbb5e6359522 | [
"MIT"
] | null | null | null | contest/20190303_ABC120/D.py | miyuush/AtCoder | 9481f15b69b99f56334a623f5a63dbb5e6359522 | [
"MIT"
] | null | null | null | # Union-findγδ½Ώγ
# θ«ζζ€η΄’γ«γ―(Disjoint Set)
from scipy.special import comb
n, m = map(int, input().split())
a = []
b = []
for i in range(m):
a0, b0 = [int(i) for i in input().split()]
a.append(a0)
b.append(b0)
a.append(b)
l = len(a)
cmb = comb(m, 2, exact=True)
base = int(cmb / 2) + 1
for _ in range(m):
... | 16.28125 | 46 | 0.50096 |
from scipy.special import comb
n, m = map(int, input().split())
a = []
b = []
for i in range(m):
a0, b0 = [int(i) for i in input().split()]
a.append(a0)
b.append(b0)
a.append(b)
l = len(a)
cmb = comb(m, 2, exact=True)
base = int(cmb / 2) + 1
for _ in range(m):
l -= 2
if l > base:
prin... | true | true |
f745b599473b50abb86d819c3bfffe20c1566d3f | 2,798 | py | Python | test.py | drg0072/Assessment_25_jan_2020 | f4f68c04d006dc2da0335e3ad2c18ada20f936d2 | [
"MIT"
] | null | null | null | test.py | drg0072/Assessment_25_jan_2020 | f4f68c04d006dc2da0335e3ad2c18ada20f936d2 | [
"MIT"
] | null | null | null | test.py | drg0072/Assessment_25_jan_2020 | f4f68c04d006dc2da0335e3ad2c18ada20f936d2 | [
"MIT"
] | null | null | null | import unittest
from pathlib import Path
import mock
import requests_mock
def check_upload_to_aws_s3(csv_path, s3_bucket):
assert isinstance(csv_path, Path)
return True
class MyTestCase(unittest.TestCase):
def setUp(self) -> None:
import os
os.makedirs("test", exist_ok=True)
os... | 34.121951 | 105 | 0.617584 | import unittest
from pathlib import Path
import mock
import requests_mock
def check_upload_to_aws_s3(csv_path, s3_bucket):
assert isinstance(csv_path, Path)
return True
class MyTestCase(unittest.TestCase):
def setUp(self) -> None:
import os
os.makedirs("test", exist_ok=True)
os... | true | true |
f745b601bcdd8308aeb3d008f30e1617f958ab27 | 2,191 | py | Python | tools/process_images.py | kuralesache/kuralesache.github.io | 56b2587e794c41bd1fb7ffb64de736cd9e02a86c | [
"MIT"
] | null | null | null | tools/process_images.py | kuralesache/kuralesache.github.io | 56b2587e794c41bd1fb7ffb64de736cd9e02a86c | [
"MIT"
] | null | null | null | tools/process_images.py | kuralesache/kuralesache.github.io | 56b2587e794c41bd1fb7ffb64de736cd9e02a86c | [
"MIT"
] | null | null | null | from PIL import Image
import glob
import os.path
import re
import json
def get_frame(path):
return int(path.rpartition('.')[0].rpartition('\\')[2])
for character in glob.glob('.\\raw\\*'):
character_name = character.rpartition('\\')[2]
for move in glob.glob(character + '\\*'):
move_name = move.rp... | 32.220588 | 87 | 0.61068 | from PIL import Image
import glob
import os.path
import re
import json
def get_frame(path):
return int(path.rpartition('.')[0].rpartition('\\')[2])
for character in glob.glob('.\\raw\\*'):
character_name = character.rpartition('\\')[2]
for move in glob.glob(character + '\\*'):
move_name = move.rp... | true | true |
f745b625486c2526d215fcbcd929eafa82958fd3 | 801 | py | Python | src/001-constant.py | peterorum/ashrae | 6527eb71b2102565bb71b402db700b561cea138c | [
"MIT"
] | null | null | null | src/001-constant.py | peterorum/ashrae | 6527eb71b2102565bb71b402db700b561cea138c | [
"MIT"
] | null | null | null | src/001-constant.py | peterorum/ashrae | 6527eb71b2102565bb71b402db700b561cea138c | [
"MIT"
] | null | null | null | # baseline: constant 0
# local score 4.668
# kaggle score 4.69
import sys # pylint: disable=unused-import
import numpy as np
import pandas as pd
from sklearn.metrics import mean_squared_error
from time import time
import os
is_kaggle = os.environ['HOME'] == '/tmp'
zipext = '' if is_kaggle else '.zip'
# load data
... | 19.071429 | 87 | 0.699126 |
import sys
import numpy as np
import pandas as pd
from sklearn.metrics import mean_squared_error
from time import time
import os
is_kaggle = os.environ['HOME'] == '/tmp'
zipext = '' if is_kaggle else '.zip'
train = pd.read_csv(f'../input/train.csv{zipext}')
test = pd.read_csv(f'../input/test.csv{zipext}')
... | true | true |
f745b751c48a86131628aaf2764f06fc892b8802 | 1,065 | py | Python | irise/constants.py | LSaffin/iris-extensions | 95efe46c36874c387fa76135f0c75490e3398e45 | [
"MIT"
] | 3 | 2019-04-18T13:46:44.000Z | 2020-03-16T13:54:24.000Z | irise/constants.py | LSaffin/iris-extensions | 95efe46c36874c387fa76135f0c75490e3398e45 | [
"MIT"
] | 1 | 2021-06-10T12:48:43.000Z | 2021-06-10T12:48:44.000Z | irise/constants.py | LSaffin/iris-extensions | 95efe46c36874c387fa76135f0c75490e3398e45 | [
"MIT"
] | null | null | null | """
Useful scientific constants defined as iris cubes
Uses constants defined by metpy.constansts
"""
from scipy import constants
from metpy import constants as mpconst
from iris.cube import Cube
# Ratio of radians to degrees
radians_per_degree = Cube(constants.degree, units='radians degrees-1')
# Import all const... | 27.307692 | 70 | 0.6723 |
from scipy import constants
from metpy import constants as mpconst
from iris.cube import Cube
radians_per_degree = Cube(constants.degree, units='radians degrees-1')
for constant in mpconst.__all__:
x = mpconst.__dict__[constant]
units = str(x.units).replace(" ", "").replace("dimensionless", "")
exec(... | true | true |
f745b7860e4c9a74e7a0a34c0e5a848fd121383d | 2,936 | py | Python | pstests/models/deepfm_criteo.py | sj1104/Het | 81b7e9f0f593108db969fc46a1af3df74b825230 | [
"Apache-2.0"
] | 2 | 2021-12-05T07:11:04.000Z | 2021-12-15T07:53:48.000Z | pstests/models/deepfm_criteo.py | sj1104/Het | 81b7e9f0f593108db969fc46a1af3df74b825230 | [
"Apache-2.0"
] | null | null | null | pstests/models/deepfm_criteo.py | sj1104/Het | 81b7e9f0f593108db969fc46a1af3df74b825230 | [
"Apache-2.0"
] | 3 | 2021-04-01T22:39:13.000Z | 2021-04-21T11:51:57.000Z | from athena import gpu_ops as ad
from athena import optimizer
from athena import initializers as init
from athena import dataloader as dl
from athena import ndarray
import numpy as np
import time
# https://zhuanlan.zhihu.com/p/109933924
def dfm_criteo(dense, sparse, labels):
batch_size = 128
feature_dimensio... | 41.942857 | 133 | 0.699591 | from athena import gpu_ops as ad
from athena import optimizer
from athena import initializers as init
from athena import dataloader as dl
from athena import ndarray
import numpy as np
import time
def dfm_criteo(dense, sparse, labels):
batch_size = 128
feature_dimension = 33762577
embedding_size = 128
... | true | true |
f745b7d7c5d380a1f4378ad4dca67236860126a9 | 1,750 | py | Python | regym/rl_algorithms/TQL/repeated_update_q_learning.py | Danielhp95/Regym | f0f0be0ad23bf1a3410ecd9ed9b8025947d6080a | [
"MIT"
] | 6 | 2019-12-03T21:07:12.000Z | 2021-03-25T13:09:39.000Z | regym/rl_algorithms/TQL/repeated_update_q_learning.py | Danielhp95/Generalized-RL-Self-Play-Framework | 64e02e143070ca6eb8bc8f898c431f59cd229341 | [
"MIT"
] | 1 | 2019-01-29T18:43:32.000Z | 2019-01-31T17:31:39.000Z | regym/rl_algorithms/TQL/repeated_update_q_learning.py | Danielhp95/Regym | f0f0be0ad23bf1a3410ecd9ed9b8025947d6080a | [
"MIT"
] | 4 | 2019-08-01T10:29:41.000Z | 2021-12-06T21:44:30.000Z | import numpy as np
class RepeatedUpdateQLearningAlgorithm():
'''
Repeated Update Q Learning (RUQL) as introduced in:
"Addressing the Policy Bias of Q-Learning by Repeating Updates" - Sherief Abdallah, Michael Kaisers
'''
def __init__(self, state_space_size, action_space_size, hashing_function, dis... | 50 | 123 | 0.696 | import numpy as np
class RepeatedUpdateQLearningAlgorithm():
def __init__(self, state_space_size, action_space_size, hashing_function, discount_factor, learning_rate, temperature):
self.Q_table = np.zeros((state_space_size, action_space_size), dtype=np.float64)
self.learning_rate = learning_rate
... | true | true |
f745b878767abc7d653af46e27f85e9fb9372c1a | 4,933 | py | Python | model/loss.py | PandoraLS/WG-WaveNet | 5f27e61cc4d3554af8c16fa35345831099b703e8 | [
"MIT"
] | 58 | 2020-11-09T13:23:00.000Z | 2022-02-10T05:59:17.000Z | model/loss.py | PandoraLS/WG-WaveNet | 5f27e61cc4d3554af8c16fa35345831099b703e8 | [
"MIT"
] | null | null | null | model/loss.py | PandoraLS/WG-WaveNet | 5f27e61cc4d3554af8c16fa35345831099b703e8 | [
"MIT"
] | 10 | 2020-11-16T08:29:09.000Z | 2022-03-10T20:03:15.000Z | import torch
import librosa
import numpy as np
import torch.nn.functional as F
from hparams import hparams as hps
from utils.util import to_arr, mode
class Loss(torch.nn.Module):
def __init__(self):
super(Loss, self).__init__()
self.d = 2*hps.sigma*hps.sigma
self.loss = MultiResolutionSTFTLoss(hps.fft_sizes, h... | 31.825806 | 100 | 0.675046 | import torch
import librosa
import numpy as np
import torch.nn.functional as F
from hparams import hparams as hps
from utils.util import to_arr, mode
class Loss(torch.nn.Module):
def __init__(self):
super(Loss, self).__init__()
self.d = 2*hps.sigma*hps.sigma
self.loss = MultiResolutionSTFTLoss(hps.fft_sizes, h... | true | true |
f745b8948b37f9e3a8233031c45194010d994862 | 1,451 | py | Python | keyfunctions/core.py | cugni/keyfunctions-python | 7236ec69a3c03cc7f7d4e26ebd90118781de4379 | [
"Apache-2.0"
] | null | null | null | keyfunctions/core.py | cugni/keyfunctions-python | 7236ec69a3c03cc7f7d4e26ebd90118781de4379 | [
"Apache-2.0"
] | null | null | null | keyfunctions/core.py | cugni/keyfunctions-python | 7236ec69a3c03cc7f7d4e26ebd90118781de4379 | [
"Apache-2.0"
] | null | null | null | from functools import reduce
import keyfunctions.globals as consts
def create_key(values, depth):
"""
This function returns a Z-order key for any number of dimensions.
:param values: a list of floats - one of dimension - each of them with value between 0 and 1 [0,1)
:param depth: an strictly positi... | 31.543478 | 103 | 0.636113 | from functools import reduce
import keyfunctions.globals as consts
def create_key(values, depth):
mul = 1 << depth
val_casted = [int(value * mul) for value in values]
key = ""
for i in range(0, depth):
mask = 1 << i
last = reduce(
lambda x, y: x | y,
[((value & ... | true | true |
f745b97a89a464f937d48b13ccc441a8d0175d7f | 3,261 | py | Python | lspreader/nearest.py | noobermin/lspreader | b4989ba32507fdcf87cc226ba93422639ed5c5fb | [
"MIT"
] | null | null | null | lspreader/nearest.py | noobermin/lspreader | b4989ba32507fdcf87cc226ba93422639ed5c5fb | [
"MIT"
] | null | null | null | lspreader/nearest.py | noobermin/lspreader | b4989ba32507fdcf87cc226ba93422639ed5c5fb | [
"MIT"
] | 1 | 2015-12-28T20:17:22.000Z | 2015-12-28T20:17:22.000Z |
# Copyright (c) 2015, 2016 Gregory K. Ngirmang
# All rights reserved.
#
# Copyright (C) Pauli Virtanen, 2010.
# All rights reserved.
#
# Copyright (c) 2001, 2002 Enthought, Inc.
# All rights reserved.
#
# Copyright (c) 2003-2012 SciPy Developers.
# All rights reserved.
#
# Redistribution and use in source and binary ... | 38.364706 | 77 | 0.705918 |
def nearest_indices(xs, XS):
xs=_ndim_coords_from_arrays(xs);
XS = _ndim_coords_from_arrays(XS, ndim=xs.shape[1])
if XS.shape[-1] != xs.shape[1]:
raise ValueError("dimensions of the points don't the sample points")
#the magical kd-tree
_,i = cKDTree(xs).... | true | true |
f745ba35cb7f64d2d7a981637a6c2dac9d802f20 | 4,032 | py | Python | emulator/brainflow_emulator/galea_udp.py | Andrey1994/brainflow | 6b776859fba6a629b1acd471ae5d1320bffe9ca5 | [
"MIT"
] | 53 | 2018-12-11T13:35:47.000Z | 2020-04-21T00:08:13.000Z | emulator/brainflow_emulator/galea_udp.py | Andrey1994/brainflow | 6b776859fba6a629b1acd471ae5d1320bffe9ca5 | [
"MIT"
] | 14 | 2019-06-12T05:22:27.000Z | 2020-04-20T19:14:44.000Z | emulator/brainflow_emulator/galea_udp.py | Andrey1994/brainflow | 6b776859fba6a629b1acd471ae5d1320bffe9ca5 | [
"MIT"
] | 9 | 2019-04-13T19:03:16.000Z | 2020-04-07T16:42:20.000Z | import enum
import logging
import random
import socket
import struct
import subprocess
import sys
import threading
import time
from brainflow_emulator.emulate_common import TestFailureError, log_multilines
class State(enum.Enum):
wait = 'wait'
stream = 'stream'
class Message(enum.Enum):
start_stream = ... | 34.461538 | 116 | 0.59871 | import enum
import logging
import random
import socket
import struct
import subprocess
import sys
import threading
import time
from brainflow_emulator.emulate_common import TestFailureError, log_multilines
class State(enum.Enum):
wait = 'wait'
stream = 'stream'
class Message(enum.Enum):
start_stream = ... | true | true |
f745bb06721d82acc48d2e40450a3fc6445226d9 | 1,701 | py | Python | src/data/pokedex_reader.py | justingolden21/pogo | 5b7e3e3a4244a7e1a372e21e2e136f28d1b1122a | [
"MIT"
] | null | null | null | src/data/pokedex_reader.py | justingolden21/pogo | 5b7e3e3a4244a7e1a372e21e2e136f28d1b1122a | [
"MIT"
] | null | null | null | src/data/pokedex_reader.py | justingolden21/pogo | 5b7e3e3a4244a7e1a372e21e2e136f28d1b1122a | [
"MIT"
] | null | null | null | from urllib.request import urlopen
import json
url = "https://raw.githubusercontent.com/pokemongo-dev-contrib/pokemongo-json-pokedex/master/output/pokemon.json"
response = urlopen(url)
final_data = []
json_data = json.loads(response.read())
for p in json_data:
final_data.append({
'dex': p['dex'],
... | 35.4375 | 113 | 0.608466 | from urllib.request import urlopen
import json
url = "https://raw.githubusercontent.com/pokemongo-dev-contrib/pokemongo-json-pokedex/master/output/pokemon.json"
response = urlopen(url)
final_data = []
json_data = json.loads(response.read())
for p in json_data:
final_data.append({
'dex': p['dex'],
... | true | true |
f745bb1bfbb39502b4e78edca4f584761878e994 | 7,109 | py | Python | pyathena/util.py | kanga333/PyAthena | 487baa66ae203c3541d37191600f1f3219a2e1ac | [
"MIT"
] | null | null | null | pyathena/util.py | kanga333/PyAthena | 487baa66ae203c3541d37191600f1f3219a2e1ac | [
"MIT"
] | null | null | null | pyathena/util.py | kanga333/PyAthena | 487baa66ae203c3541d37191600f1f3219a2e1ac | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
import functools
import logging
import threading
import re
import uuid
import tenacity
from past.builtins import xrange
from tenacity import (after_log, retry_if_exception,
stop_after_attempt, ... | 33.065116 | 90 | 0.61598 |
from __future__ import absolute_import
from __future__ import unicode_literals
import functools
import logging
import threading
import re
import uuid
import tenacity
from past.builtins import xrange
from tenacity import (after_log, retry_if_exception,
stop_after_attempt, wait_exponential)
from... | true | true |
f745bb30ab7214a23de64755b51931ce39cdf9ca | 3,370 | py | Python | ZSSGAN/utils/svm.py | 1170300521/StyleGAN-nada | 1b6dc2d7dcbc37dd2e29af2f8b59d7635e6a26ec | [
"MIT"
] | null | null | null | ZSSGAN/utils/svm.py | 1170300521/StyleGAN-nada | 1b6dc2d7dcbc37dd2e29af2f8b59d7635e6a26ec | [
"MIT"
] | null | null | null | ZSSGAN/utils/svm.py | 1170300521/StyleGAN-nada | 1b6dc2d7dcbc37dd2e29af2f8b59d7635e6a26ec | [
"MIT"
] | null | null | null | import numpy as np
from sklearn import svm
def train_boundary(pos_codes, neg_codes, split_ratio=0.7):
pos_ids = np.arange(len(pos_codes))
np.random.shuffle(pos_ids)
train_pos_num = int(len(pos_ids) * split_ratio)
train_pos_codes = pos_codes[pos_ids[:train_pos_num]]
val_pos_codes = pos_codes[pos_id... | 48.142857 | 141 | 0.688427 | import numpy as np
from sklearn import svm
def train_boundary(pos_codes, neg_codes, split_ratio=0.7):
pos_ids = np.arange(len(pos_codes))
np.random.shuffle(pos_ids)
train_pos_num = int(len(pos_ids) * split_ratio)
train_pos_codes = pos_codes[pos_ids[:train_pos_num]]
val_pos_codes = pos_codes[pos_id... | true | true |
f745bb5229c790bd55517c632a803296f84c82c4 | 1,350 | py | Python | final/170401073/client.py | ismailaltayy/blm304 | c242abdc8fccdb9f9e20705157551d15fe1efbf1 | [
"Unlicense"
] | null | null | null | final/170401073/client.py | ismailaltayy/blm304 | c242abdc8fccdb9f9e20705157551d15fe1efbf1 | [
"Unlicense"
] | null | null | null | final/170401073/client.py | ismailaltayy/blm304 | c242abdc8fccdb9f9e20705157551d15fe1efbf1 | [
"Unlicense"
] | null | null | null | #Mehmet Salih Γelik 170401073
import socket
import datetime
import os
import time
import sys
ipiste=str(input("Sunucunun ip adresini giriniz :"))
HOST = ipiste
PORT = 142
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.connect((HOST, PORT))
a=time.time()
data = s.recv(1024)
... | 24.107143 | 95 | 0.67037 |
import socket
import datetime
import os
import time
import sys
ipiste=str(input("Sunucunun ip adresini giriniz :"))
HOST = ipiste
PORT = 142
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
s.connect((HOST, PORT))
a=time.time()
data = s.recv(1024)
b=time.time()
data=d... | true | true |
f745bc73c1d06793298bb84a8d39127380e53e66 | 280 | py | Python | pymarketstore/__init__.py | ncheikh/pymarketstore | bfac7883af7b13db460aa509f00ccf9102ead2e3 | [
"Apache-2.0"
] | null | null | null | pymarketstore/__init__.py | ncheikh/pymarketstore | bfac7883af7b13db460aa509f00ccf9102ead2e3 | [
"Apache-2.0"
] | null | null | null | pymarketstore/__init__.py | ncheikh/pymarketstore | bfac7883af7b13db460aa509f00ccf9102ead2e3 | [
"Apache-2.0"
] | null | null | null | from .client import Client # noqa
from .params import Params, ListSymbolsFormat # noqa
from .jsonrpc_client import MsgpackRpcClient # noqa
from .grpc_client import GRPCClient # noqa
# alias
Param = Params # noqa
from .stream import StreamConn # noqa
__version__ = '0.18'
| 23.333333 | 53 | 0.757143 | from .client import Client
from .params import Params, ListSymbolsFormat
from .jsonrpc_client import MsgpackRpcClient
from .grpc_client import GRPCClient
Param = Params
from .stream import StreamConn
__version__ = '0.18'
| true | true |
f745bcec8d593210c1b4d45842f761b0a279416a | 7,510 | py | Python | main.py | Giuseppe5/pytorch-ocr | f8e89295e911c7a3eec6e3aa13335c031cd3adfe | [
"Apache-2.0"
] | 33 | 2018-08-21T03:06:08.000Z | 2021-10-10T08:13:35.000Z | main.py | Giuseppe5/pytorch-ocr | f8e89295e911c7a3eec6e3aa13335c031cd3adfe | [
"Apache-2.0"
] | 4 | 2019-03-19T04:18:21.000Z | 2020-12-07T11:25:16.000Z | main.py | Giuseppe5/pytorch-ocr | f8e89295e911c7a3eec6e3aa13335c031cd3adfe | [
"Apache-2.0"
] | 14 | 2018-09-18T14:06:06.000Z | 2022-01-25T11:18:08.000Z | # Copyright (c) 2018, Xilinx, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of ... | 45.792683 | 145 | 0.71518 |
import argparse
import json
import os
import torch
import numpy as np
from ocr import PytorchOCRTrainer
torch.backends.cudnn.enabled = False
torch.set_printoptions(precision=10)
class objdict(dict):
def __getattr__(self, name):
if name in self:
return self[name]
... | true | true |
f745bd562bd747d6576f8be43de326d57d3ec63f | 1,936 | py | Python | homeassistant/components/pocketcasts/sensor.py | learn-home-automation/core | c5d8792c3487e9b418b1e7d623bf59e7dbddd6b7 | [
"Apache-2.0"
] | 22,481 | 2020-03-02T13:09:59.000Z | 2022-03-31T23:34:28.000Z | homeassistant/components/pocketcasts/sensor.py | learn-home-automation/core | c5d8792c3487e9b418b1e7d623bf59e7dbddd6b7 | [
"Apache-2.0"
] | 31,101 | 2020-03-02T13:00:16.000Z | 2022-03-31T23:57:36.000Z | homeassistant/components/pocketcasts/sensor.py | learn-home-automation/core | c5d8792c3487e9b418b1e7d623bf59e7dbddd6b7 | [
"Apache-2.0"
] | 11,411 | 2020-03-02T14:19:20.000Z | 2022-03-31T22:46:07.000Z | """Support for Pocket Casts."""
from datetime import timedelta
import logging
from pycketcasts import pocketcasts
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
import homeassistant.helpers.config_validati... | 28.057971 | 84 | 0.682851 | from datetime import timedelta
import logging
from pycketcasts import pocketcasts
import voluptuous as vol
from homeassistant.components.sensor import PLATFORM_SCHEMA, SensorEntity
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
import homeassistant.helpers.config_validation as cv
_LOGGER = logging.getL... | true | true |
f745bd6904723b2c6e66c28b1272301945670b33 | 1,900 | py | Python | display_hdf5.py | alsmeirelles/ResRep | abc8d221cfa153de577ca1bbba515cc7abb94378 | [
"MIT"
] | null | null | null | display_hdf5.py | alsmeirelles/ResRep | abc8d221cfa153de577ca1bbba515cc7abb94378 | [
"MIT"
] | null | null | null | display_hdf5.py | alsmeirelles/ResRep | abc8d221cfa153de577ca1bbba515cc7abb94378 | [
"MIT"
] | null | null | null | from utils.misc import read_hdf5
from utils.misc import extract_deps_from_weights_file
import sys
import numpy as np
wf = sys.argv[1]
deps = extract_deps_from_weights_file(wf)
di = read_hdf5(wf)
num_kernel_params = 0
conv_kernel_cnt = 0
matrix_param_cnt = 0
vec_param_cnt = 0
bias_cnt = 0
beta_cnt = 0
gamma_cnt = 0
m... | 32.758621 | 126 | 0.608947 | from utils.misc import read_hdf5
from utils.misc import extract_deps_from_weights_file
import sys
import numpy as np
wf = sys.argv[1]
deps = extract_deps_from_weights_file(wf)
di = read_hdf5(wf)
num_kernel_params = 0
conv_kernel_cnt = 0
matrix_param_cnt = 0
vec_param_cnt = 0
bias_cnt = 0
beta_cnt = 0
gamma_cnt = 0
m... | true | true |
f745bde6b0ea73a8714799c958929e7b29d1411b | 179 | py | Python | aalert/config.py | nravic/py-amber_alert | cbe0446e6bbc5c1bd02d02383779e4daad600db5 | [
"MIT"
] | 4 | 2016-07-02T09:12:42.000Z | 2016-12-08T13:41:30.000Z | aalert/config.py | nravic/py-amber_alert | cbe0446e6bbc5c1bd02d02383779e4daad600db5 | [
"MIT"
] | null | null | null | aalert/config.py | nravic/py-amber_alert | cbe0446e6bbc5c1bd02d02383779e4daad600db5 | [
"MIT"
] | null | null | null | DEBUG = True
SQLALCHEMY_DATABASE_URI = 'postgresql://scire@localhost/testing_environ'
SECRET_KEY = 'something_secret'
BCRYPT_LOG_ROUNDS = 12
SQLALCHEMY_TRACK_MODIFICATIONS = True
| 29.833333 | 72 | 0.837989 | DEBUG = True
SQLALCHEMY_DATABASE_URI = 'postgresql://scire@localhost/testing_environ'
SECRET_KEY = 'something_secret'
BCRYPT_LOG_ROUNDS = 12
SQLALCHEMY_TRACK_MODIFICATIONS = True
| true | true |
f745bea55be7bc50bd089f0de9013d3a4778b03b | 686 | py | Python | setup.py | R3v1L/django-wordcensor | e79941b4467a2e35811450f014df799acdfebfd9 | [
"MIT"
] | null | null | null | setup.py | R3v1L/django-wordcensor | e79941b4467a2e35811450f014df799acdfebfd9 | [
"MIT"
] | null | null | null | setup.py | R3v1L/django-wordcensor | e79941b4467a2e35811450f014df799acdfebfd9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import os
from setuptools import setup, find_packages
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
# Allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-wordcensor',
pa... | 28.583333 | 78 | 0.674927 |
import os
from setuptools import setup, find_packages
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-wordcensor',
packages = find_packages(),
version='0.1',
description='D... | true | true |
f745bfdd3b42e18240e741339c0021135483a70b | 136,341 | py | Python | lingvo/tasks/car/input_preprocessors.py | xsppp/gpipe_with_Mnist | 4486e675c7b52c7519a6d39f97e9b22ed5461944 | [
"Apache-2.0"
] | 1 | 2020-10-19T06:14:06.000Z | 2020-10-19T06:14:06.000Z | lingvo/tasks/car/input_preprocessors.py | albertsh10/lingvo | 5cd8aff375e7f8fc3c6fb065ce3f40854eb6f31a | [
"Apache-2.0"
] | null | null | null | lingvo/tasks/car/input_preprocessors.py | albertsh10/lingvo | 5cd8aff375e7f8fc3c6fb065ce3f40854eb6f31a | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
# Copyright 2019 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 38.212164 | 80 | 0.678402 |
from lingvo import compat as tf
from lingvo.core import base_layer
from lingvo.core import py_utils
from lingvo.core import schedule
from lingvo.tasks.car import car_lib
from lingvo.tasks.car import detection_3d_lib
from lingvo.tasks.car import geometry
from lingvo.tasks.car import ops
import numpy as n... | true | true |
f745c19a8067d383c92cc57e87b4c864b16e58fb | 28,243 | py | Python | gdal/swig/python/samples/gdalpythonserver.py | trundev/gdal | d5777940975f2784980ef0b7561eeeb655fd0ab5 | [
"MIT"
] | 2 | 2018-03-22T22:31:00.000Z | 2021-07-16T01:34:47.000Z | gdal/swig/python/samples/gdalpythonserver.py | trundev/gdal | d5777940975f2784980ef0b7561eeeb655fd0ab5 | [
"MIT"
] | 3 | 2019-02-27T00:43:06.000Z | 2019-06-28T21:57:10.000Z | gdal/swig/python/samples/gdalpythonserver.py | trundev/gdal | d5777940975f2784980ef0b7561eeeb655fd0ab5 | [
"MIT"
] | 1 | 2021-04-26T14:47:38.000Z | 2021-04-26T14:47:38.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# *****************************************************************************
# $Id$
#
# Project: GDAL
# Purpose: GDAL API_PROXY server written in Python
# Author: Even Rouault, <even dot rouault at spatialys.com>
#
# ******************************************************... | 32.538018 | 153 | 0.589243 |
import os
import struct
import sys
from osgeo import gdal
class GDALPythonServerRasterBand(object):
def __init__(self, gdal_band):
self.gdal_band = gdal_band
self.XSize = gdal_band.XSize
self.YSize = gdal_band.YSize
self.Band = gdal_band.GetBand()... | true | true |
f745c26a5ab7e82031bae20a05540a6f438dbde8 | 27,371 | py | Python | lime/lime_tabular.py | thegalang/lime | a4cd83e20c838c782728c02f07e21ab01d17f3fa | [
"BSD-2-Clause"
] | null | null | null | lime/lime_tabular.py | thegalang/lime | a4cd83e20c838c782728c02f07e21ab01d17f3fa | [
"BSD-2-Clause"
] | null | null | null | lime/lime_tabular.py | thegalang/lime | a4cd83e20c838c782728c02f07e21ab01d17f3fa | [
"BSD-2-Clause"
] | null | null | null | """
Functions for explaining classifiers that use tabular data (matrices).
"""
import collections
import copy
from functools import partial
import json
import warnings
import numpy as np
import sklearn
import sklearn.preprocessing
from sklearn.utils import check_random_state
from lime.discretize import QuartileDiscre... | 46.079125 | 94 | 0.598955 | import collections
import copy
from functools import partial
import json
import warnings
import numpy as np
import sklearn
import sklearn.preprocessing
from sklearn.utils import check_random_state
from lime.discretize import QuartileDiscretizer
from lime.discretize import DecileDiscretizer
from lime.discretize import... | true | true |
f745c30e8e7360e2bd396aa1f4a8435eed98d99d | 3,167 | py | Python | tests/misc/non_compliant.py | Neradoc/circuitpython | 932131b4ff4b95066a872b5b299a84e80b7c45d3 | [
"MIT",
"BSD-3-Clause",
"MIT-0",
"Unlicense"
] | 3,010 | 2017-01-07T23:43:33.000Z | 2022-03-31T06:02:59.000Z | tests/misc/non_compliant.py | Neradoc/circuitpython | 932131b4ff4b95066a872b5b299a84e80b7c45d3 | [
"MIT",
"BSD-3-Clause",
"MIT-0",
"Unlicense"
] | 4,478 | 2017-01-06T01:35:02.000Z | 2022-03-31T23:03:27.000Z | tests/misc/non_compliant.py | Neradoc/circuitpython | 932131b4ff4b95066a872b5b299a84e80b7c45d3 | [
"MIT",
"BSD-3-Clause",
"MIT-0",
"Unlicense"
] | 1,149 | 2017-01-09T00:35:23.000Z | 2022-03-31T21:24:29.000Z | # tests for things that are not implemented, or have non-compliant behaviour
try:
import array
import struct
except ImportError:
print("SKIP")
raise SystemExit
# when super can't find self
try:
exec("def f(): super()")
except SyntaxError:
print("SyntaxError")
# store to exception attribute is... | 20.301282 | 80 | 0.693716 |
try:
import array
import struct
except ImportError:
print("SKIP")
raise SystemExit
try:
exec("def f(): super()")
except SyntaxError:
print("SyntaxError")
# store to exception attribute is not allowed
try:
ValueError().x = 0
except AttributeError:
print("AttributeError")
# array del... | true | true |
f745c33aad1483cfc5453d188bbb73a7e31cbdef | 26,956 | py | Python | BaseTools/Source/Python/Eot/CParser4/CListener.py | GlovePuppet/edk2 | 8028f03032182f2c72e7699e1d14322bb5586581 | [
"BSD-2-Clause"
] | 2,757 | 2018-04-28T21:41:36.000Z | 2022-03-29T06:33:36.000Z | BaseTools/Source/Python/Eot/CParser4/CListener.py | HouQiming/edk2 | ba07eef98ec49068d6453aba2aed73f6e7d7f600 | [
"BSD-2-Clause"
] | 20 | 2019-07-23T15:29:32.000Z | 2022-01-21T12:53:04.000Z | BaseTools/Source/Python/Eot/CParser4/CListener.py | HouQiming/edk2 | ba07eef98ec49068d6453aba2aed73f6e7d7f600 | [
"BSD-2-Clause"
] | 449 | 2018-05-09T05:54:05.000Z | 2022-03-30T14:54:18.000Z | # Generated from C.g4 by ANTLR 4.7.1
from antlr4 import *
if __name__ is not None and "." in __name__:
from .CParser import CParser
else:
from CParser import CParser
## @file
# The file defines the parser for C source files.
#
# THIS FILE IS AUTO-GENENERATED. PLEASE DON NOT MODIFY THIS FILE.
# This ... | 33.074847 | 80 | 0.699659 |
from antlr4 import *
if __name__ is not None and "." in __name__:
from .CParser import CParser
else:
from CParser import CParser
import Ecc.CodeFragment as CodeFragment
import Ecc.FileProfile as FileProfile
class CListener(ParseTreeListener):
Translation_unit(self,ctx):
... | true | true |
f745c374238e85d02dabf3c7fdf366e8e85436c8 | 2,653 | py | Python | flask_security/babel.py | antlarr/flask-security | e60e089288bb563df3d66dd9ac27b4952506062b | [
"MIT"
] | null | null | null | flask_security/babel.py | antlarr/flask-security | e60e089288bb563df3d66dd9ac27b4952506062b | [
"MIT"
] | null | null | null | flask_security/babel.py | antlarr/flask-security | e60e089288bb563df3d66dd9ac27b4952506062b | [
"MIT"
] | null | null | null | """
flask_security.babel
~~~~~~~~~~~~~~~~~~~~
I18N support for Flask-Security.
As of Flask-Babel 2.0.0 - it supports the Flask-BabelEx Domain extension - and it
is maintained. (Flask-BabelEx is no longer maintained). So we start with that,
then fall back to Flask-BabelEx, then fall back to a N... | 28.836957 | 85 | 0.601206 |
from flask import current_app
from .utils import config_value as cv
def has_babel_ext():
return current_app and "babel" in current_app.extensions
_domain_cls = None
try:
from flask_babel import Domain
import babel.support
_domain_cls = Domain
_dir_keyword = "translation_directories"
e... | true | true |
f745c4db5b050df9ed1a130f567e8d1522951d44 | 36,514 | py | Python | dynamics/dynamics.py | OllieBoyne/dog-dynamics | c472f984cb04e6dea932be6a42f4daaf174fb44c | [
"Apache-2.0"
] | 1 | 2020-10-04T18:40:23.000Z | 2020-10-04T18:40:23.000Z | dynamics/dynamics.py | OllieBoyne/dog-dynamics | c472f984cb04e6dea932be6a42f4daaf174fb44c | [
"Apache-2.0"
] | null | null | null | dynamics/dynamics.py | OllieBoyne/dog-dynamics | c472f984cb04e6dea932be6a42f4daaf174fb44c | [
"Apache-2.0"
] | null | null | null | """DEFINES THE INVERSEDYNAMICS SOLVER, A Solver for solving the joint based model of a dog."""
from scipy import optimize, signal
from data.data_loader import C3DData, load_force_plate_data, ForcePlateData, SMALData, get_delay_between, DataSources, \
path_join
from vis.utils import *
from vis import visualisations
f... | 36.920121 | 194 | 0.691899 |
from scipy import optimize, signal
from data.data_loader import C3DData, load_force_plate_data, ForcePlateData, SMALData, get_delay_between, DataSources, \
path_join
from vis.utils import *
from vis import visualisations
from dynamics.footfall_detector import FootfallDetector
from tqdm import tqdm
g = 9.81
freq_fo... | true | true |
f745c68cb1628be5bb8685f132df4cbb3d3c320f | 6,432 | py | Python | utils/video.py | gosticks/body-pose-animation | eb1b5876a845f277d43bfc18dcd48c4a9c694c06 | [
"MIT"
] | null | null | null | utils/video.py | gosticks/body-pose-animation | eb1b5876a845f277d43bfc18dcd48c4a9c694c06 | [
"MIT"
] | null | null | null | utils/video.py | gosticks/body-pose-animation | eb1b5876a845f277d43bfc18dcd48c4a9c694c06 | [
"MIT"
] | null | null | null | from dataset import SMPLyDataset
import pickle
from typing import Tuple
from model import SMPLyModel
from renderer import DefaultRenderer
import cv2
from tqdm import tqdm
import numpy as np
from scipy import interpolate
def make_video(images, video_name: str, fps=30, ext: str = "mp4", post_process_frame=None):
im... | 32.649746 | 116 | 0.619403 | from dataset import SMPLyDataset
import pickle
from typing import Tuple
from model import SMPLyModel
from renderer import DefaultRenderer
import cv2
from tqdm import tqdm
import numpy as np
from scipy import interpolate
def make_video(images, video_name: str, fps=30, ext: str = "mp4", post_process_frame=None):
im... | true | true |
f745c7568983625b7139e72ff059c2efc819ba09 | 3,360 | py | Python | homeassistant/components/airly/config_flow.py | Kalypox/core | ffc4941968bf68acedb063c884f2e268398085fd | [
"Apache-2.0"
] | null | null | null | homeassistant/components/airly/config_flow.py | Kalypox/core | ffc4941968bf68acedb063c884f2e268398085fd | [
"Apache-2.0"
] | 43 | 2020-12-21T08:16:47.000Z | 2022-03-31T06:05:04.000Z | homeassistant/components/airly/config_flow.py | Kalypox/core | ffc4941968bf68acedb063c884f2e268398085fd | [
"Apache-2.0"
] | null | null | null | """Adds config flow for Airly."""
from airly import Airly
from airly.exceptions import AirlyError
import async_timeout
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import (
CONF_API_KEY,
CONF_LATITUDE,
CONF_LONGITUDE,
CONF_NAME,
HTTP_UNAUTHORIZED,
)
fro... | 31.401869 | 88 | 0.592857 | from airly import Airly
from airly.exceptions import AirlyError
import async_timeout
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import (
CONF_API_KEY,
CONF_LATITUDE,
CONF_LONGITUDE,
CONF_NAME,
HTTP_UNAUTHORIZED,
)
from homeassistant.helpers.aiohttp_cl... | true | true |
f745c8361aa8651dc0d07db1a3dbf09ced98d04d | 10,119 | py | Python | airflow/providers/hashicorp/secrets/vault.py | emilioego/airflow | 3457c7847cd24413ff5b622e65c27d8370f94502 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 79 | 2021-10-15T07:32:27.000Z | 2022-03-28T04:10:19.000Z | airflow/providers/hashicorp/secrets/vault.py | emilioego/airflow | 3457c7847cd24413ff5b622e65c27d8370f94502 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 210 | 2021-07-17T00:25:52.000Z | 2021-12-29T00:44:48.000Z | airflow/providers/hashicorp/secrets/vault.py | emilioego/airflow | 3457c7847cd24413ff5b622e65c27d8370f94502 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 23 | 2021-10-15T02:36:37.000Z | 2022-03-17T02:59:27.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 44.187773 | 109 | 0.66558 |
from typing import Optional
from airflow.providers.hashicorp._internal_client.vault_client import _VaultClient
from airflow.secrets import BaseSecretsBackend
from airflow.utils.log.logging_mixin import LoggingMixin
class VaultBackend(BaseSecretsBackend, LoggingMixin):
def __init__(
... | true | true |
f745c86319472fc3e6986d507c51dabb15ef48a7 | 353 | py | Python | plugins/labels/__init__.py | deeponion/electrum-deeponion | 0cb769ff7cd5eece2db29cc0f78ef5fa376eb9e2 | [
"MIT"
] | 3 | 2018-09-29T13:50:29.000Z | 2019-05-18T23:09:44.000Z | plugins/labels/__init__.py | truongdoithuong/electrum-deeponion | 0cb769ff7cd5eece2db29cc0f78ef5fa376eb9e2 | [
"MIT"
] | null | null | null | plugins/labels/__init__.py | truongdoithuong/electrum-deeponion | 0cb769ff7cd5eece2db29cc0f78ef5fa376eb9e2 | [
"MIT"
] | 5 | 2018-09-29T13:50:34.000Z | 2020-11-21T12:46:41.000Z | from electrum_deeponion.i18n import _
fullname = _('LabelSync')
description = ' '.join([
_("Save your wallet labels on a remote server, and synchronize them across multiple devices where you use Electrum."),
_("Labels, transactions IDs and addresses are encrypted before they are sent to the remote server.")
])... | 35.3 | 122 | 0.733711 | from electrum_deeponion.i18n import _
fullname = _('LabelSync')
description = ' '.join([
_("Save your wallet labels on a remote server, and synchronize them across multiple devices where you use Electrum."),
_("Labels, transactions IDs and addresses are encrypted before they are sent to the remote server.")
])... | true | true |
f745cb5e3c1333f0bab35aa4e43e5f25c04a1c04 | 634 | py | Python | GraphLearning/src/distributed/torch.py | caditi97/exatrkx-ctd2020 | ed090ddfcc9e2e623fb45000fca71d5ad6ccf3b9 | [
"BSD-3-Clause-LBNL"
] | 6 | 2020-07-10T14:33:46.000Z | 2021-06-01T10:40:13.000Z | GraphLearning/src/distributed/torch.py | caditi97/exatrkx-ctd2020 | ed090ddfcc9e2e623fb45000fca71d5ad6ccf3b9 | [
"BSD-3-Clause-LBNL"
] | null | null | null | GraphLearning/src/distributed/torch.py | caditi97/exatrkx-ctd2020 | ed090ddfcc9e2e623fb45000fca71d5ad6ccf3b9 | [
"BSD-3-Clause-LBNL"
] | 4 | 2020-07-30T14:25:55.000Z | 2021-04-21T03:47:01.000Z | """Utility code for running native pytorch distributed"""
import os
import torch.distributed as dist
def init_workers_file():
rank = int(os.environ['SLURM_PROCID'])
n_ranks = int(os.environ['SLURM_NTASKS'])
sync_file = 'file:///tmp/%s_%s_pytorch_sync' % (
os.environ['USER'], os.environ['SLURM_JOB... | 30.190476 | 74 | 0.678233 |
import os
import torch.distributed as dist
def init_workers_file():
rank = int(os.environ['SLURM_PROCID'])
n_ranks = int(os.environ['SLURM_NTASKS'])
sync_file = 'file:///tmp/%s_%s_pytorch_sync' % (
os.environ['USER'], os.environ['SLURM_JOB_ID'])
dist.init_process_group(backend='nccl', world_s... | true | true |
f745cbad287f45184e13a3f265f913749e94fc20 | 1,018 | py | Python | pkgs/sdk-pkg/src/genie/libs/sdk/libs/abstracted_libs/iosxr/init_exec_commands.py | miott/genielibs | 6464642cdd67aa2367bdbb12561af4bb060e5e62 | [
"Apache-2.0"
] | 94 | 2018-04-30T20:29:15.000Z | 2022-03-29T13:40:31.000Z | pkgs/sdk-pkg/src/genie/libs/sdk/libs/abstracted_libs/iosxr/init_exec_commands.py | miott/genielibs | 6464642cdd67aa2367bdbb12561af4bb060e5e62 | [
"Apache-2.0"
] | 67 | 2018-12-06T21:08:09.000Z | 2022-03-29T18:00:46.000Z | pkgs/sdk-pkg/src/genie/libs/sdk/libs/abstracted_libs/iosxr/init_exec_commands.py | miott/genielibs | 6464642cdd67aa2367bdbb12561af4bb060e5e62 | [
"Apache-2.0"
] | 49 | 2018-06-29T18:59:03.000Z | 2022-03-10T02:07:59.000Z | '''IOSXR implementation of InitExecCommands class'''
class InitExecCommands(object):
"""InitExecCommands class
`InitExecCommands` class provides the functionality to retrieve the
platform specific initiation executed commands.
"""
def get_commands(self):
"""Method to return the list of ... | 28.277778 | 79 | 0.636542 |
class InitExecCommands(object):
def get_commands(self):
init_commands = ['term length 0', 'term width 0']
return init_commands | true | true |
f745cd4946f48dd0fae6848f226b80a6166a1f5f | 21,621 | py | Python | riptable/tests/test_accum2.py | 972d5defe3218bd62b741e6a2f11f5b3/riptable | bb928c11752e831ec701f91964979b31db53826a | [
"BSD-2-Clause-Patent"
] | 307 | 2020-08-27T20:25:11.000Z | 2022-03-08T15:51:19.000Z | riptable/tests/test_accum2.py | 972d5defe3218bd62b741e6a2f11f5b3/riptable | bb928c11752e831ec701f91964979b31db53826a | [
"BSD-2-Clause-Patent"
] | 206 | 2020-08-17T19:07:15.000Z | 2022-03-18T11:53:55.000Z | riptable/tests/test_accum2.py | 972d5defe3218bd62b741e6a2f11f5b3/riptable | bb928c11752e831ec701f91964979b31db53826a | [
"BSD-2-Clause-Patent"
] | 10 | 2020-08-28T00:22:05.000Z | 2021-04-30T20:22:28.000Z | import unittest
import pandas as pd
import pytest
import riptable as rt
# N.B. TL;DR We have to import the actual implementation module to override the module global
# variable "tm.N" and "tm.K".
# In pandas 1.0 they move the code from pandas/util/testing.py to pandas/_testing.py.
# The "import ... | 39.027076 | 175 | 0.542019 | import unittest
import pandas as pd
import pytest
import riptable as rt
# our attempt to override the "tm.N" and "tm.K" will not change the actual value for
# makeTimeDataFrame, which will produce data with different shape and make the test
# "test_accum_table" fail. Maybe we want to reconsid... | true | true |
f745cd518e5ade7224b34ff114b0d59e6f29ec35 | 630 | py | Python | test/actions-none/gyptest-none.py | uilianries/gyp | d995c5b0906571e0037869e3c9b008f344e8ca92 | [
"BSD-3-Clause"
] | null | null | null | test/actions-none/gyptest-none.py | uilianries/gyp | d995c5b0906571e0037869e3c9b008f344e8ca92 | [
"BSD-3-Clause"
] | null | null | null | test/actions-none/gyptest-none.py | uilianries/gyp | d995c5b0906571e0037869e3c9b008f344e8ca92 | [
"BSD-3-Clause"
] | 3 | 2018-11-20T12:04:16.000Z | 2019-07-01T02:52:04.000Z | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Verifies actions can be in 'none' type targets with source files.
"""
import TestGyp
test = TestGyp.TestGyp()
if test.format == 'xcod... | 22.5 | 74 | 0.733333 |
import TestGyp
test = TestGyp.TestGyp()
if test.format == 'xcode-ninja':
test.skip(bug=527)
test.run_gyp('none_with_source_files.gyp', chdir='src')
test.relocate('src', 'relocate/src')
test.build('none_with_source_files.gyp', chdir='relocate/src')
file_content = 'foo.cc\n'
test.built_file_must_match('fak... | true | true |
f745cf54c64152649d39a0a8864cfc85bea5c75c | 667 | py | Python | django/apps/photo/migrations/0030_auto_20181027_0035.py | Haakenlid/tassen | 911a2541c77eca522ba5a723f175786f4f9eb481 | [
"Apache-2.0"
] | 16 | 2017-03-21T03:53:37.000Z | 2021-08-14T06:28:02.000Z | django/apps/photo/migrations/0030_auto_20181027_0035.py | universitas/universitas.no | 911a2541c77eca522ba5a723f175786f4f9eb481 | [
"Apache-2.0"
] | 104 | 2017-03-25T00:12:46.000Z | 2021-03-09T22:40:58.000Z | django/apps/photo/migrations/0030_auto_20181027_0035.py | Haakenlid/tassen | 911a2541c77eca522ba5a723f175786f4f9eb481 | [
"Apache-2.0"
] | 6 | 2017-03-21T03:53:40.000Z | 2020-06-07T14:15:38.000Z | # Generated by Django 2.1.2 on 2018-10-26 22:35
from django.db import migrations
import apps.photo.cropping.boundingbox
import utils.model_fields
class Migration(migrations.Migration):
dependencies = [
('photo', '0029_auto_20181023_0021'),
]
operations = [
migrations.AlterField(
... | 24.703704 | 70 | 0.601199 |
from django.db import migrations
import apps.photo.cropping.boundingbox
import utils.model_fields
class Migration(migrations.Migration):
dependencies = [
('photo', '0029_auto_20181023_0021'),
]
operations = [
migrations.AlterField(
model_name='imagefile',
name=... | true | true |
f745cf7fa3052b54d18145658082a6b9f42d183d | 23 | py | Python | instance/config.py | DancunManyinsa/Personal-Blog | 700c72b56caa7a79f00b9b716d84c5be877d8cdb | [
"MIT"
] | null | null | null | instance/config.py | DancunManyinsa/Personal-Blog | 700c72b56caa7a79f00b9b716d84c5be877d8cdb | [
"MIT"
] | null | null | null | instance/config.py | DancunManyinsa/Personal-Blog | 700c72b56caa7a79f00b9b716d84c5be877d8cdb | [
"MIT"
] | 2 | 2019-11-30T10:33:16.000Z | 2021-02-03T06:29:40.000Z | SECRET_KEY = 'mysecret' | 23 | 23 | 0.782609 | SECRET_KEY = 'mysecret' | true | true |
f745d04598a5e311d9143b28e67384959d1735d6 | 537 | py | Python | strategy/strategies/crystalball/cbsub.py | firebird631/siis | 8d64e8fb67619aaa5c0a62fda9de51dedcd47796 | [
"PostgreSQL"
] | null | null | null | strategy/strategies/crystalball/cbsub.py | firebird631/siis | 8d64e8fb67619aaa5c0a62fda9de51dedcd47796 | [
"PostgreSQL"
] | null | null | null | strategy/strategies/crystalball/cbsub.py | firebird631/siis | 8d64e8fb67619aaa5c0a62fda9de51dedcd47796 | [
"PostgreSQL"
] | null | null | null | # @date 2019-01-19
# @author Frederic Scherma, All rights reserved without prejudices.
# @license Copyright (c) 2019 Dream Overflow
# Crystal Ball strategy sub-strategy base class.
from strategy.timeframebasedsub import TimeframeBasedSub
class CrystalBallStrategySub(TimeframeBasedSub):
"""
Bitcoin Alpha sub ... | 29.833333 | 106 | 0.739292 |
from strategy.timeframebasedsub import TimeframeBasedSub
class CrystalBallStrategySub(TimeframeBasedSub):
def __init__(self, strategy_trader, params):
super().__init__(strategy_trader, params['timeframe'], params['depth'], params['history'], params)
self.setup_indicators(params)
| true | true |
f745d1f0390903b007e90853e8d7137c3b405da7 | 2,592 | py | Python | push_data_to_ccos/push_data_via_git.py | shubhanshu02/ccos-scripts | 2411281cc6b7124f8b18a8ce044b9bd51394051b | [
"MIT"
] | 14 | 2020-02-07T22:46:02.000Z | 2021-02-28T16:10:16.000Z | push_data_to_ccos/push_data_via_git.py | shubhanshu02/ccos-scripts | 2411281cc6b7124f8b18a8ce044b9bd51394051b | [
"MIT"
] | 83 | 2020-02-07T15:57:23.000Z | 2022-02-14T16:04:33.000Z | push_data_to_ccos/push_data_via_git.py | shubhanshu02/ccos-scripts | 2411281cc6b7124f8b18a8ce044b9bd51394051b | [
"MIT"
] | 32 | 2020-02-24T21:08:40.000Z | 2021-04-12T12:22:32.000Z | #!/usr/bin/env python3
# vim: set fileencoding=utf-8:
# Standard library
import json
import logging
import os
# Third-party
import git
# First-party/Local
import log
GIT_USER_NAME = "CC creativecommons.github.io Bot"
GIT_USER_EMAIL = "cc-creativecommons-github-io-bot@creativecommons.org"
GITHUB_USERNAME = "cc-crea... | 30.139535 | 79 | 0.724537 |
import json
import logging
import os
import git
import log
GIT_USER_NAME = "CC creativecommons.github.io Bot"
GIT_USER_EMAIL = "cc-creativecommons-github-io-bot@creativecommons.org"
GITHUB_USERNAME = "cc-creativecommons-github-io-bot"
GITHUB_ORGANIZATION = "creativecommons"
GITHUB_REPO_NAME = "creativecommons... | true | true |
f745d355db6932cdcb41af5ad3cfa1ebfbde2540 | 9,561 | py | Python | tests/python/unittest/test_io.py | ishandutta2007/incubator-mxnet | 54a3c58c49fdfac595a348301b6f0701db09d4ab | [
"Apache-2.0"
] | null | null | null | tests/python/unittest/test_io.py | ishandutta2007/incubator-mxnet | 54a3c58c49fdfac595a348301b6f0701db09d4ab | [
"Apache-2.0"
] | null | null | null | tests/python/unittest/test_io.py | ishandutta2007/incubator-mxnet | 54a3c58c49fdfac595a348301b6f0701db09d4ab | [
"Apache-2.0"
] | null | null | null | # 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... | 34.767273 | 150 | 0.594185 |
import mxnet as mx
from mxnet.test_utils import *
import numpy as np
import os, gzip
import pickle as pickle
import time
try:
import h5py
except ImportError:
h5py = None
import sys
from common import get_data
import unittest
def test_MNISTIter():
get_data.GetMNIST_ubyte()
batch... | true | true |
f745d4a9f9a19444a1c1a71f3efede1b708de820 | 735 | py | Python | Secao 3 - Pre-processamento com Pandas e scikit-learm/template_credit_data.py | flaviofontes29/Machine-Learning-e-Data-Science-com-Python | 7b8188b6e7003426ae3a6d46d91d61494135a2b7 | [
"MIT"
] | null | null | null | Secao 3 - Pre-processamento com Pandas e scikit-learm/template_credit_data.py | flaviofontes29/Machine-Learning-e-Data-Science-com-Python | 7b8188b6e7003426ae3a6d46d91d61494135a2b7 | [
"MIT"
] | null | null | null | Secao 3 - Pre-processamento com Pandas e scikit-learm/template_credit_data.py | flaviofontes29/Machine-Learning-e-Data-Science-com-Python | 7b8188b6e7003426ae3a6d46d91d61494135a2b7 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
base = pd.read_csv('credit_data.csv')
base.loc[base.age < 0, 'age'] = 40.92
previsores = base.iloc[:, 1:4].values
classe = base.iloc[:, 4].values
from sklearn.impute import SimpleImputer
imputer = SimpleImputer(missing_values = np.nan, strategy = 'mean')
imputer ... | 35 | 145 | 0.761905 | import pandas as pd
import numpy as np
base = pd.read_csv('credit_data.csv')
base.loc[base.age < 0, 'age'] = 40.92
previsores = base.iloc[:, 1:4].values
classe = base.iloc[:, 4].values
from sklearn.impute import SimpleImputer
imputer = SimpleImputer(missing_values = np.nan, strategy = 'mean')
imputer ... | true | true |
f745d5ddebe2b30246598f896777b20a69768059 | 879 | py | Python | train_test_split.py | tomvdon/lidar-bonnetal | 0bb78eb9a731e98e6f3b893d735b6c3ca96cb0e8 | [
"MIT"
] | null | null | null | train_test_split.py | tomvdon/lidar-bonnetal | 0bb78eb9a731e98e6f3b893d735b6c3ca96cb0e8 | [
"MIT"
] | null | null | null | train_test_split.py | tomvdon/lidar-bonnetal | 0bb78eb9a731e98e6f3b893d735b6c3ca96cb0e8 | [
"MIT"
] | null | null | null | import shutil
import os
import glob
import numpy as np
from sklearn.model_selection import train_test_split
import shutil
import re
clouds = glob.glob('range_images/point_cloud_*.pcd')
train, test = train_test_split(clouds, test_size=0.20, random_state=42)
for file in train:
shutil.copy(file, "simulated_data/seque... | 38.217391 | 77 | 0.662116 | import shutil
import os
import glob
import numpy as np
from sklearn.model_selection import train_test_split
import shutil
import re
clouds = glob.glob('range_images/point_cloud_*.pcd')
train, test = train_test_split(clouds, test_size=0.20, random_state=42)
for file in train:
shutil.copy(file, "simulated_data/seque... | true | true |
f745d61facecf176819f6e0b1334bf6b5d46de14 | 29,170 | py | Python | tests/unittests/test_network_install.py | cloudify-cosmo/cloudify-nsx-plugin | d7b2abbe384e55aaf47b2c8474ab07f622eb83b5 | [
"Apache-2.0"
] | 2 | 2017-03-08T21:44:54.000Z | 2019-01-16T06:00:16.000Z | tests/unittests/test_network_install.py | cloudify-cosmo/cloudify-nsx-plugin | d7b2abbe384e55aaf47b2c8474ab07f622eb83b5 | [
"Apache-2.0"
] | 3 | 2017-01-26T13:26:31.000Z | 2017-02-03T14:51:45.000Z | tests/unittests/test_network_install.py | cloudify-cosmo/cloudify-nsx-plugin | d7b2abbe384e55aaf47b2c8474ab07f622eb83b5 | [
"Apache-2.0"
] | 5 | 2016-12-28T15:26:02.000Z | 2017-01-30T08:46:10.000Z | # Copyright (c) 2017 GigaSpaces Technologies Ltd. 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 ... | 37.63871 | 77 | 0.472335 |
import unittest
import library.test_nsx_base as test_nsx_base
import pytest
import mock
import copy
import cloudify_nsx.network.dhcp_bind as dhcp_bind
import cloudify_nsx.network.dhcp_pool as dhcp_pool
import cloudify_nsx.network.dlr_dgw as dlr_dgw
import cloudify_nsx.network.bgp_neighbour_filter as bgp_ne... | true | true |
f745d672c6c8846c0f310d6ee2c69fa724a275f0 | 2,342 | py | Python | aydin/util/nsi/demo/nearest_self_image.py | royerloic/aydin | f9c61a24030891d008c318b250da5faec69fcd7d | [
"BSD-3-Clause"
] | 78 | 2021-11-08T16:11:23.000Z | 2022-03-27T17:51:04.000Z | aydin/util/nsi/demo/nearest_self_image.py | royerloic/aydin | f9c61a24030891d008c318b250da5faec69fcd7d | [
"BSD-3-Clause"
] | 19 | 2021-11-08T17:15:40.000Z | 2022-03-30T17:46:55.000Z | aydin/util/nsi/demo/nearest_self_image.py | royerloic/aydin | f9c61a24030891d008c318b250da5faec69fcd7d | [
"BSD-3-Clause"
] | 7 | 2021-11-09T17:42:32.000Z | 2022-03-09T00:37:57.000Z | # flake8: noqa
import numpy as np
from skimage.data import camera
from aydin.features.standard_features import StandardFeatureGenerator
from aydin.io.datasets import (
normalise,
add_noise,
dots,
lizard,
pollen,
characters,
cropped_newyork,
)
from aydin.it.fgr import ImageTranslatorFGR
from... | 30.025641 | 78 | 0.726302 |
import numpy as np
from skimage.data import camera
from aydin.features.standard_features import StandardFeatureGenerator
from aydin.io.datasets import (
normalise,
add_noise,
dots,
lizard,
pollen,
characters,
cropped_newyork,
)
from aydin.it.fgr import ImageTranslatorFGR
from aydin.it.tran... | true | true |
f745d776fc18e571e903bb228b2471bc4e734ac6 | 4,746 | py | Python | build/PureCloudPlatformClientV2/models/validation_service_request.py | cjohnson-ctl/platform-client-sdk-python | 38ce53bb8012b66e8a43cc8bd6ff00cf6cc99100 | [
"MIT"
] | null | null | null | build/PureCloudPlatformClientV2/models/validation_service_request.py | cjohnson-ctl/platform-client-sdk-python | 38ce53bb8012b66e8a43cc8bd6ff00cf6cc99100 | [
"MIT"
] | null | null | null | build/PureCloudPlatformClientV2/models/validation_service_request.py | cjohnson-ctl/platform-client-sdk-python | 38ce53bb8012b66e8a43cc8bd6ff00cf6cc99100 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Copyright 2016 SmartBear Software
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applica... | 30.229299 | 139 | 0.599031 |
from pprint import pformat
from six import iteritems
import re
import json
from ..utils import sanitize_for_serialization
class ValidationServiceRequest(object):
def __init__(self):
self.swagger_types = {
'date_import_ended': 'datetime',
'file_url': 'str'
}
self... | true | true |
f745d7a939a7a0b447f7b70b5cf5b95b31066f21 | 3,440 | py | Python | venv/Lib/site-packages/django_tables2/export/export.py | lsmiley/esstools-adminlte-3 | ec3a7334be0ab05e9d336e397d6edb881131b932 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/django_tables2/export/export.py | lsmiley/esstools-adminlte-3 | ec3a7334be0ab05e9d336e397d6edb881131b932 | [
"MIT"
] | null | null | null | venv/Lib/site-packages/django_tables2/export/export.py | lsmiley/esstools-adminlte-3 | ec3a7334be0ab05e9d336e397d6edb881131b932 | [
"MIT"
] | null | null | null | from django.core.exceptions import ImproperlyConfigured
from django.http import HttpResponse
try:
from tablib import Dataset
except ImportError: # pragma: no cover
raise ImproperlyConfigured(
"You must have tablib installed in order to use the django-tables2 export functionality"
)
class TableEx... | 32.45283 | 96 | 0.629942 | from django.core.exceptions import ImproperlyConfigured
from django.http import HttpResponse
try:
from tablib import Dataset
except ImportError:
raise ImproperlyConfigured(
"You must have tablib installed in order to use the django-tables2 export functionality"
)
class TableExport:
CSV = "... | true | true |
f745d7ae46fba7a5afcd08f46d3722c6e6d8dfb1 | 241 | py | Python | service-workers/service-worker/resources/subdir/import-scripts-echo.py | meyerweb/wpt | f04261533819893c71289614c03434c06856c13e | [
"BSD-3-Clause"
] | 14,668 | 2015-01-01T01:57:10.000Z | 2022-03-31T23:33:32.000Z | service-workers/service-worker/resources/subdir/import-scripts-echo.py | meyerweb/wpt | f04261533819893c71289614c03434c06856c13e | [
"BSD-3-Clause"
] | 7,642 | 2018-05-28T09:38:03.000Z | 2022-03-31T20:55:48.000Z | service-workers/service-worker/resources/subdir/import-scripts-echo.py | meyerweb/wpt | f04261533819893c71289614c03434c06856c13e | [
"BSD-3-Clause"
] | 5,941 | 2015-01-02T11:32:21.000Z | 2022-03-31T16:35:46.000Z | def main(req, res):
return ([
(b'Cache-Control', b'no-cache, must-revalidate'),
(b'Pragma', b'no-cache'),
(b'Content-Type', b'application/javascript')],
b'echo_output = "%s (subdir/)";\n' % req.GET[b'msg'])
| 34.428571 | 59 | 0.551867 | def main(req, res):
return ([
(b'Cache-Control', b'no-cache, must-revalidate'),
(b'Pragma', b'no-cache'),
(b'Content-Type', b'application/javascript')],
b'echo_output = "%s (subdir/)";\n' % req.GET[b'msg'])
| true | true |
f745d7c7ffa63d00938ca01b5141bd3eae2a4609 | 9,892 | py | Python | tests/test_modeling_flax_vit.py | arunraja-hub/transformers | eb2e006b35938e7b6476d3bfc55343ebfe5ec501 | [
"Apache-2.0"
] | 101 | 2021-12-22T00:03:51.000Z | 2022-03-30T07:39:09.000Z | tests/test_modeling_flax_vit.py | 4nalog/transformers | 76cadb7943c8492ec481f4f3925e9e8793a32c9d | [
"Apache-2.0"
] | 13 | 2020-10-13T11:41:11.000Z | 2022-02-16T14:13:31.000Z | tests/test_modeling_flax_vit.py | 4nalog/transformers | 76cadb7943c8492ec481f4f3925e9e8793a32c9d | [
"Apache-2.0"
] | 13 | 2020-10-04T05:06:00.000Z | 2022-02-09T01:14:59.000Z | # Copyright 2021 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicabl... | 40.876033 | 117 | 0.676911 |
import inspect
import unittest
import numpy as np
from transformers import ViTConfig, is_flax_available
from transformers.testing_utils import require_flax, slow
from .test_configuration_common import ConfigTester
from .test_modeling_flax_common import FlaxModelTesterMixin, floats_tensor
if is_flax_a... | true | true |
f745d819eb3e31a23392b891ea6e03082255202e | 697 | py | Python | commands/gay.py | DiscordHackers/BetterBot-1.0.2.2 | bf9b5b3368c654bcc4bf144572a7d331e154abe2 | [
"Apache-2.0"
] | null | null | null | commands/gay.py | DiscordHackers/BetterBot-1.0.2.2 | bf9b5b3368c654bcc4bf144572a7d331e154abe2 | [
"Apache-2.0"
] | null | null | null | commands/gay.py | DiscordHackers/BetterBot-1.0.2.2 | bf9b5b3368c654bcc4bf144572a7d331e154abe2 | [
"Apache-2.0"
] | null | null | null | import disnake as discord
import random
from disnake.ext import commands
from api.check import utils, block
from api.server import base, main
class Gay(commands.Cog):
def __init__(self, client):
self.client = client
@commands.command()
@block.block()
async def gay(self, ctx, user: discord.Me... | 27.88 | 172 | 0.680057 | import disnake as discord
import random
from disnake.ext import commands
from api.check import utils, block
from api.server import base, main
class Gay(commands.Cog):
def __init__(self, client):
self.client = client
@commands.command()
@block.block()
async def gay(self, ctx, user: discord.Me... | true | true |
f745d846d970f31dadaaae955208983cff0a8ca5 | 2,241 | py | Python | powerline_shell/segments/fossil.py | Dakedres/powerline-shell | 352d26846aa5d3beb6c92ee26588536bc399117c | [
"MIT"
] | 2,656 | 2017-11-28T05:11:53.000Z | 2022-03-31T14:10:18.000Z | powerline_shell/segments/fossil.py | jceaser/powerline-shell | a9b8c9bb39dbfb7ec3c639e497b5a76fa6dcb8cc | [
"MIT"
] | 193 | 2017-11-28T23:20:17.000Z | 2022-03-25T12:57:55.000Z | powerline_shell/segments/fossil.py | jceaser/powerline-shell | a9b8c9bb39dbfb7ec3c639e497b5a76fa6dcb8cc | [
"MIT"
] | 387 | 2017-11-29T22:33:39.000Z | 2022-03-31T18:24:35.000Z | import os
import subprocess
from ..utils import RepoStats, ThreadedSegment, get_subprocess_env
def _get_fossil_branch():
branches = os.popen("fossil branch 2>/dev/null").read().strip().split("\n")
return ''.join([
i.replace('*','').strip()
for i in branches
if i.startswith('*')
])
... | 31.125 | 79 | 0.594824 | import os
import subprocess
from ..utils import RepoStats, ThreadedSegment, get_subprocess_env
def _get_fossil_branch():
branches = os.popen("fossil branch 2>/dev/null").read().strip().split("\n")
return ''.join([
i.replace('*','').strip()
for i in branches
if i.startswith('*')
])
... | true | true |
f745dbb9b6d6eba54e7dced54edf0a1fc7b852d7 | 238 | py | Python | winton_kafka_streams/state/__init__.py | jkramarz/winton-kafka-streams | 22526da71454a8b9c7bba53e4f59f645535de602 | [
"Apache-2.0"
] | null | null | null | winton_kafka_streams/state/__init__.py | jkramarz/winton-kafka-streams | 22526da71454a8b9c7bba53e4f59f645535de602 | [
"Apache-2.0"
] | null | null | null | winton_kafka_streams/state/__init__.py | jkramarz/winton-kafka-streams | 22526da71454a8b9c7bba53e4f59f645535de602 | [
"Apache-2.0"
] | null | null | null | """
import state will import all possible pre-defined state classes
"""
from .simple import SimpleStore
from .in_memory_key_value_store import InMemoryKeyValueStore
from .change_logging_key_value_store import ChangeLoggingKeyValueStore
| 26.444444 | 70 | 0.852941 |
from .simple import SimpleStore
from .in_memory_key_value_store import InMemoryKeyValueStore
from .change_logging_key_value_store import ChangeLoggingKeyValueStore
| true | true |
f745dc4a7c1d0d482ce3a62777d7918a081b47d5 | 3,453 | py | Python | myproject/myproject/settings.py | scaraclette/WebBoard | e35cec96589063e75fcba52898fadfa4e3f961fd | [
"MIT"
] | 1 | 2019-12-14T20:32:17.000Z | 2019-12-14T20:32:17.000Z | myproject/myproject/settings.py | scaraclette/WebBoard | e35cec96589063e75fcba52898fadfa4e3f961fd | [
"MIT"
] | 5 | 2021-03-19T08:34:20.000Z | 2022-02-10T10:15:32.000Z | myproject/myproject/settings.py | scaraclette/WebBoard | e35cec96589063e75fcba52898fadfa4e3f961fd | [
"MIT"
] | null | null | null | """
Django settings for myproject project.
Generated by 'django-admin startproject' using Django 3.0.3.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
... | 25.389706 | 91 | 0.692152 |
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = '@s&a-qn-&2k$&=^hva*0j%1sku8=y*)pjr!p$)ociyb^m#czmp'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.content... | true | true |
f745dcc43706f2a2de37f9e5ac7978230a1da325 | 607 | py | Python | part3_rclpy_basic/part3_3_py_original_msg_example/setup.py | Ar-Ray-code/rclpy_tutorial | be14741eb88154653c7c559ee3736a01f742a735 | [
"Apache-2.0"
] | 1 | 2021-06-08T06:53:21.000Z | 2021-06-08T06:53:21.000Z | part3_rclpy_basic/part3_3_py_original_msg_example/setup.py | Ar-Ray-code/rclpy_tutorial | be14741eb88154653c7c559ee3736a01f742a735 | [
"Apache-2.0"
] | null | null | null | part3_rclpy_basic/part3_3_py_original_msg_example/setup.py | Ar-Ray-code/rclpy_tutorial | be14741eb88154653c7c559ee3736a01f742a735 | [
"Apache-2.0"
] | null | null | null | import os
from glob import glob
from setuptools import setup, find_packages
package_name = 'part3_3_py_original_msg_example'
setup(
name=package_name,
version='0.0.0',
packages=find_packages(),
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name])... | 26.391304 | 81 | 0.629325 | import os
from glob import glob
from setuptools import setup, find_packages
package_name = 'part3_3_py_original_msg_example'
setup(
name=package_name,
version='0.0.0',
packages=find_packages(),
data_files=[
('share/ament_index/resource_index/packages',
['resource/' + package_name])... | true | true |
f745dcf95b41499211d2770245293430a21e9937 | 3,741 | py | Python | pmagpy/controlled_vocabularies2.py | yamamon75/PmagPy | fa5b189800a239683fc17c6b312cdfdd839a46c3 | [
"BSD-3-Clause"
] | null | null | null | pmagpy/controlled_vocabularies2.py | yamamon75/PmagPy | fa5b189800a239683fc17c6b312cdfdd839a46c3 | [
"BSD-3-Clause"
] | null | null | null | pmagpy/controlled_vocabularies2.py | yamamon75/PmagPy | fa5b189800a239683fc17c6b312cdfdd839a46c3 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
from __future__ import print_function
from __future__ import absolute_import
import json
import os
from builtins import object
import pandas as pd
from pandas import Series
from . import find_pmag_dir
pmag_dir = find_pmag_dir.get_pmag_dir()
data_model_dir = os.path.join(pmag_dir, 'pmagpy', 'dat... | 36.320388 | 105 | 0.660251 |
from __future__ import print_function
from __future__ import absolute_import
import json
import os
from builtins import object
import pandas as pd
from pandas import Series
from . import find_pmag_dir
pmag_dir = find_pmag_dir.get_pmag_dir()
data_model_dir = os.path.join(pmag_dir, 'pmagpy', 'data_model')
if not os... | true | true |
f745e12e75a47013f92b584a44b3eff975b6403c | 12,254 | py | Python | temporalio/api/operatorservice/v1/request_response_pb2.py | cretz/temporal-sdk-python | 431ca1967d365556a9cf5aa9aac00243b71059f8 | [
"MIT"
] | 55 | 2022-01-31T22:02:22.000Z | 2022-03-30T11:17:21.000Z | temporalio/api/operatorservice/v1/request_response_pb2.py | cretz/temporal-sdk-python | 431ca1967d365556a9cf5aa9aac00243b71059f8 | [
"MIT"
] | 7 | 2022-02-04T14:08:46.000Z | 2022-03-22T13:27:30.000Z | temporalio/api/operatorservice/v1/request_response_pb2.py | cretz/temporal-sdk-python | 431ca1967d365556a9cf5aa9aac00243b71059f8 | [
"MIT"
] | 4 | 2022-01-31T17:31:49.000Z | 2022-03-29T01:04:46.000Z | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: temporal/api/operatorservice/v1/request_response.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.prot... | 55.198198 | 1,958 | 0.798188 |
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Def... | true | true |
f745e13b65b12b3ad749b5364d4f3befcd02b56b | 10,762 | py | Python | tests/integration/states/pkg.py | trebuchet-deploy/salt | dcdf1148248912a4592f0f48d2303903588729cc | [
"Apache-2.0"
] | 1 | 2015-08-20T21:55:17.000Z | 2015-08-20T21:55:17.000Z | tests/integration/states/pkg.py | trebuchet-deploy/salt | dcdf1148248912a4592f0f48d2303903588729cc | [
"Apache-2.0"
] | null | null | null | tests/integration/states/pkg.py | trebuchet-deploy/salt | dcdf1148248912a4592f0f48d2303903588729cc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
tests for pkg state
'''
# Import Salt Testing libs
from salttesting import skipIf
from salttesting.helpers import (
destructiveTest,
ensure_in_syspath,
requires_system_grains,
requires_salt_modules
)
ensure_in_syspath('../../')
# Import python libs
import os
import time
#... | 38.028269 | 81 | 0.630366 |
from salttesting import skipIf
from salttesting.helpers import (
destructiveTest,
ensure_in_syspath,
requires_system_grains,
requires_salt_modules
)
ensure_in_syspath('../../')
import os
import time
import integration
import salt.utils
_PKG_TARGETS = {
'Arch': ['python2-django', 'libpng'],
... | true | true |
f745e219c5457a73c962d6a32bfb8338d1280c50 | 5,644 | py | Python | backend/bot.py | loehnertz/telegram-voicemail-bot | bedd6a4c79b696a420d558258d92d3808b577c2f | [
"MIT"
] | 2 | 2020-03-18T11:28:36.000Z | 2020-09-14T07:27:00.000Z | backend/bot.py | loehnertz/telegram-voicemail-bot | bedd6a4c79b696a420d558258d92d3808b577c2f | [
"MIT"
] | null | null | null | backend/bot.py | loehnertz/telegram-voicemail-bot | bedd6a4c79b696a420d558258d92d3808b577c2f | [
"MIT"
] | 1 | 2020-09-14T07:27:03.000Z | 2020-09-14T07:27:03.000Z | import json
import logging
import os
from datetime import datetime
from pathlib import Path
from telegram import ParseMode
from telegram.ext import Updater, MessageHandler, Filters
from uploader import Uploader
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO)
log... | 34.206061 | 118 | 0.666194 | import json
import logging
import os
from datetime import datetime
from pathlib import Path
from telegram import ParseMode
from telegram.ext import Updater, MessageHandler, Filters
from uploader import Uploader
logging.basicConfig(format='%(asctime)s - %(name)s - %(levelname)s - %(message)s', level=logging.INFO)
log... | true | true |
f745e2720a7225f670cdfc49f01e505bca12db6c | 1,742 | py | Python | school/simpleApi/tests.py | kiarashplusplus/PaperPileSchool | 40f91eea15d743bd22f918cec42e9c778b3d6d7d | [
"MIT"
] | null | null | null | school/simpleApi/tests.py | kiarashplusplus/PaperPileSchool | 40f91eea15d743bd22f918cec42e9c778b3d6d7d | [
"MIT"
] | null | null | null | school/simpleApi/tests.py | kiarashplusplus/PaperPileSchool | 40f91eea15d743bd22f918cec42e9c778b3d6d7d | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.core.files.uploadedfile import SimpleUploadedFile
from simpleApi.models import Teacher, Student, Gradeable
class TeacherTestCase(TestCase):
def setUp(self):
s = Student.objects.create(username="student1", password="student", first_name="student")
Teacher... | 34.156863 | 97 | 0.643513 | from django.test import TestCase
from django.core.files.uploadedfile import SimpleUploadedFile
from simpleApi.models import Teacher, Student, Gradeable
class TeacherTestCase(TestCase):
def setUp(self):
s = Student.objects.create(username="student1", password="student", first_name="student")
Teacher... | true | true |
f745e32a7277a7e36a3941fc84916671c1bd82c7 | 520 | py | Python | ecweb/migrations/0011_auto_20180103_0243.py | jamesperes/EC | c887a1a9f08ce5432d129f2c526f21d1a140ffa6 | [
"MIT"
] | 12 | 2017-12-12T00:09:34.000Z | 2018-01-31T03:21:10.000Z | ecweb/migrations/0011_auto_20180103_0243.py | jamesperes/EC | c887a1a9f08ce5432d129f2c526f21d1a140ffa6 | [
"MIT"
] | 19 | 2017-12-10T01:34:09.000Z | 2018-01-06T13:52:15.000Z | ecweb/migrations/0011_auto_20180103_0243.py | jamesperes/EC | c887a1a9f08ce5432d129f2c526f21d1a140ffa6 | [
"MIT"
] | 11 | 2017-12-10T15:35:48.000Z | 2017-12-29T12:16:09.000Z | # Generated by Django 2.0 on 2018-01-03 02:43
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ecweb', '0010_event'),
]
operations = [
migrations.AlterField(
model_name='event',
name='end_event',
field... | 21.666667 | 51 | 0.561538 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('ecweb', '0010_event'),
]
operations = [
migrations.AlterField(
model_name='event',
name='end_event',
field=models.DateTimeField(blank=True),
),... | true | true |
f745e37628159f202886150b0229fec79760fa3a | 47,122 | py | Python | src/azure-cli/azure/cli/command_modules/resource/tests/hybrid_2019_03_01/test_resource.py | akashsinghal/azure-cli | 8ab2f7604a834de790bdea849b3e83f2466428b9 | [
"MIT"
] | 1 | 2016-09-15T23:10:48.000Z | 2016-09-15T23:10:48.000Z | src/azure-cli/azure/cli/command_modules/resource/tests/hybrid_2019_03_01/test_resource.py | akashsinghal/azure-cli | 8ab2f7604a834de790bdea849b3e83f2466428b9 | [
"MIT"
] | 1 | 2021-06-02T02:37:12.000Z | 2021-06-02T02:37:12.000Z | src/azure-cli/azure/cli/command_modules/resource/tests/hybrid_2019_03_01/test_resource.py | akashsinghal/azure-cli | 8ab2f7604a834de790bdea849b3e83f2466428b9 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 48.182004 | 249 | 0.604855 |
import json
import os
import time
import mock
import unittest
from azure_devtools.scenario_tests.const import MOCKED_SUBSCRIPTION_ID
from azure_devtools.scenario_tests import AllowLargeResponse
from azure.cli.testsdk import ScenarioTest, LiveScenarioTest, ResourceGroupPreparer, create_random_name, live_only, reco... | true | true |
f745e39c3de4cf3d888870a2720a680aa12e32d9 | 10,951 | py | Python | certipy/request.py | balance1libra/Certipy | 9933c9493fef7c43d95da5cdcf59cb40d237e858 | [
"MIT"
] | 2 | 2021-10-10T07:33:44.000Z | 2021-11-09T10:46:55.000Z | certipy/request.py | rootsecdev/Certipy | 70a94feccfacdb27b170394ee30ca91f5a9cab2c | [
"MIT"
] | 2 | 2021-10-10T07:33:54.000Z | 2021-11-08T10:10:30.000Z | certipy/request.py | nittaya1990/Certipy | 70a94feccfacdb27b170394ee30ca91f5a9cab2c | [
"MIT"
] | null | null | null | # Certipy - Active Directory certificate abuse
#
# Description:
# Request a new certificate
#
# Authors:
# @ollypwn (https://github.com/ollypwn)
#
# References:
# https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-icpr/d98e6cfb-87ba-4915-b3ec-a1b7c6129a53
# https://docs.microsoft.com/en-us/openspec... | 34.221875 | 115 | 0.604054 |
import argparse
import logging
from typing import Tuple
from asn1crypto import algos, core, csr, keys, x509
try:
from Cryptodome.Hash import SHA256
from Cryptodome.PublicKey import RSA
from Cryptodome.Signature import PKCS1_v1_5
except ImportError:
from Crypto.Hash import SHA256
... | true | true |
f745e39f8c9a8acb7382396a71c42853dd142c7b | 6,488 | py | Python | ambari-server/src/main/resources/stacks/PHD/3.0.0.0/services/HBASE/package/scripts/params.py | kennyballou/ambari | 8985bcf11296d540a861a8634c17d6b9b1accd5a | [
"Apache-2.0"
] | null | null | null | ambari-server/src/main/resources/stacks/PHD/3.0.0.0/services/HBASE/package/scripts/params.py | kennyballou/ambari | 8985bcf11296d540a861a8634c17d6b9b1accd5a | [
"Apache-2.0"
] | null | null | null | ambari-server/src/main/resources/stacks/PHD/3.0.0.0/services/HBASE/package/scripts/params.py | kennyballou/ambari | 8985bcf11296d540a861a8634c17d6b9b1accd5a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
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");... | 47.014493 | 174 | 0.787608 |
from functions import calc_xmn_from_xms
from resource_management import *
import status_params
config = Script.get_config()
exec_tmp_dir = Script.get_tmp_dir()
rpm_version = default("/configurations/cluster-env/rpm_version", None)
if rpm_version:
hadoop_bin_dir = format("/usr/phd/current/hadoop-client/bin")
... | true | true |
f745e467b76979d4b4c18e968fbc21b6d67789c2 | 3,657 | py | Python | dump_command_args.py | bytedance/Hammer | 388ed20b3d9b34f33f5357d75f8fe5d726782ec8 | [
"MIT"
] | 97 | 2022-02-08T09:00:57.000Z | 2022-03-23T05:33:35.000Z | dump_command_args.py | bytedance/Hammer | 388ed20b3d9b34f33f5357d75f8fe5d726782ec8 | [
"MIT"
] | null | null | null | dump_command_args.py | bytedance/Hammer | 388ed20b3d9b34f33f5357d75f8fe5d726782ec8 | [
"MIT"
] | 7 | 2022-02-08T15:13:02.000Z | 2022-03-19T19:11:13.000Z | # python3.7
"""Dumps available arguments of all commands (configurations).
This file parses the arguments of all commands provided in `configs/` and dump
the results as a json file. Each parsed argument includes the name, argument
type, default value, and the help message (description). The dumped file looks
like
{
... | 30.22314 | 80 | 0.456385 |
import sys
import json
from configs import CONFIG_POOL
def parse_args_from_config(config):
recommended_opts = config.get_recommended_options()
args = dict()
for opt_group, opts in config.get_options().items():
args[opt_group] = dict(
type='object',
properties=dict()
... | true | true |
f745e4d3f50ae411320702056acb7e9294fb66fa | 5,393 | py | Python | openpnm/io/CSV.py | halotudio/openPNM-copy2 | d400ec65e9421256a531f6d22a38255b002d5dcb | [
"MIT"
] | 1 | 2021-05-01T11:10:43.000Z | 2021-05-01T11:10:43.000Z | openpnm/io/CSV.py | halotudio/openPNM-copy2 | d400ec65e9421256a531f6d22a38255b002d5dcb | [
"MIT"
] | null | null | null | openpnm/io/CSV.py | halotudio/openPNM-copy2 | d400ec65e9421256a531f6d22a38255b002d5dcb | [
"MIT"
] | null | null | null | import re
import numpy as np
from openpnm.io.Pandas import Pandas
from openpnm.io import GenericIO, Dict
from openpnm.utils import logging, Workspace
logger = logging.getLogger(__name__)
ws = Workspace()
class CSV(GenericIO):
r"""
Reads and writes CSV (comma-separated-value files) containing pore and
thro... | 36.439189 | 79 | 0.587428 | import re
import numpy as np
from openpnm.io.Pandas import Pandas
from openpnm.io import GenericIO, Dict
from openpnm.utils import logging, Workspace
logger = logging.getLogger(__name__)
ws = Workspace()
class CSV(GenericIO):
@classmethod
def save(cls, *args, **kwargs):
cls.export_data(*args, **kwarg... | true | true |
f745e4f386d7d65d542fc14f785105f1ccbc9e99 | 3,811 | py | Python | tb_login.py | ardian-sh/simple-crud_cli | 4733a09d985ea3e3328f5558889dcbf344db6aca | [
"Unlicense"
] | 1 | 2021-12-10T18:11:28.000Z | 2021-12-10T18:11:28.000Z | tb_login.py | ardian-sh/simple-crud_cli | 4733a09d985ea3e3328f5558889dcbf344db6aca | [
"Unlicense"
] | null | null | null | tb_login.py | ardian-sh/simple-crud_cli | 4733a09d985ea3e3328f5558889dcbf344db6aca | [
"Unlicense"
] | null | null | null | """
-import mysql.conecctor -> memanggil function conecctor dari modul mysql
-from connect_Db import Connect_db -> memanggil class connect_db di file connect_Db yang telah di buat sebelumnya
-from Validation import Validations-> memanggil class Validataions yang ada pada file Validation
-from termcolor import color... | 51.5 | 136 | 0.637366 | from connect_Db import Connect_db
import mysql.connector
from termcolor import colored
from Validation import Validations
from os import system
class Tb_Login:
Valid = Validations()
conn = Connect_db()
def login (self):
while True:
... | true | true |
f745e5769876f89e5661629058a6671628a76722 | 4,087 | py | Python | src/si/util/cv.py | inestm28/si | a82ba37bd628c5ebdc723f5e1a9894832c8f1a76 | [
"Apache-2.0"
] | null | null | null | src/si/util/cv.py | inestm28/si | a82ba37bd628c5ebdc723f5e1a9894832c8f1a76 | [
"Apache-2.0"
] | null | null | null | src/si/util/cv.py | inestm28/si | a82ba37bd628c5ebdc723f5e1a9894832c8f1a76 | [
"Apache-2.0"
] | null | null | null | from .util import train_test_split
import numpy as np
import itertools
# MODEL SELECTION
class Cross_Validation:
#avaliar a performance de um modelo
def __init__(self, model, dataset,score=None, **kwargs):
self.model=model #modelo que se quer avaliar
self.dataset=dataset
self.cv=kwargs... | 46.977011 | 172 | 0.631515 | from .util import train_test_split
import numpy as np
import itertools
class Cross_Validation:
def __init__(self, model, dataset,score=None, **kwargs):
self.model=model
self.dataset=dataset
self.cv=kwargs.get('cv',3)
self.split=kwargs.get('split', 0.8)
self.train_sc... | true | true |
f745e627baa4f27c556fa93c5bc6a8607a16af32 | 16,200 | py | Python | tests/test_visualization.py | EmadAlamoudi/libpetab-python-MS | 7d21d79e9c02200d361a19c737d61c0e56123ca0 | [
"MIT"
] | null | null | null | tests/test_visualization.py | EmadAlamoudi/libpetab-python-MS | 7d21d79e9c02200d361a19c737d61c0e56123ca0 | [
"MIT"
] | null | null | null | tests/test_visualization.py | EmadAlamoudi/libpetab-python-MS | 7d21d79e9c02200d361a19c737d61c0e56123ca0 | [
"MIT"
] | null | null | null | import warnings
from os import path
from tempfile import TemporaryDirectory
import pytest
from petab.C import *
from petab.visualize import (plot_data_and_simulation,
plot_measurements_by_observable,
save_vis_spec)
import matplotlib.pyplot as plt
@pytest.fixtu... | 42.1875 | 79 | 0.614444 | import warnings
from os import path
from tempfile import TemporaryDirectory
import pytest
from petab.C import *
from petab.visualize import (plot_data_and_simulation,
plot_measurements_by_observable,
save_vis_spec)
import matplotlib.pyplot as plt
@pytest.fixtu... | true | true |
f745e6f3a37289bf61f2bd949c9ce1767d1c69a0 | 665 | py | Python | manage.py | KamarulAdha/DRF-ML | 2036ac6b3b3eb593d28ab89c948bf4ad2a4aa6dd | [
"MIT"
] | null | null | null | manage.py | KamarulAdha/DRF-ML | 2036ac6b3b3eb593d28ab89c948bf4ad2a4aa6dd | [
"MIT"
] | null | null | null | manage.py | KamarulAdha/DRF-ML | 2036ac6b3b3eb593d28ab89c948bf4ad2a4aa6dd | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'deploy_ml.settings')
try:
from django.core.management import execute_from_command_line
except Im... | 28.913043 | 73 | 0.679699 |
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'deploy_ml.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installed and "
... | true | true |
f745e756a3c746620d8f06b21a137f14a0bd0090 | 8,887 | py | Python | sympy/physics/quantum/tests/test_qubit.py | Corwinpro/sympy | a2efa19333fa0b3b18db872efabbb46248cde63b | [
"BSD-3-Clause"
] | 15 | 2020-06-29T08:33:39.000Z | 2022-02-12T00:28:51.000Z | sympy/physics/quantum/tests/test_qubit.py | Corwinpro/sympy | a2efa19333fa0b3b18db872efabbb46248cde63b | [
"BSD-3-Clause"
] | 13 | 2020-03-24T17:53:51.000Z | 2022-02-10T20:01:14.000Z | sympy/physics/quantum/tests/test_qubit.py | Corwinpro/sympy | a2efa19333fa0b3b18db872efabbb46248cde63b | [
"BSD-3-Clause"
] | 11 | 2020-06-29T08:40:24.000Z | 2022-02-24T17:39:16.000Z | import random
from sympy import Integer, Matrix, Rational, sqrt, symbols
from sympy.core.compatibility import range, long
from sympy.physics.quantum.qubit import (measure_all, measure_partial,
matrix_to_qubit, matrix_to_density,
qubit_to... | 35.126482 | 82 | 0.577585 | import random
from sympy import Integer, Matrix, Rational, sqrt, symbols
from sympy.core.compatibility import range, long
from sympy.physics.quantum.qubit import (measure_all, measure_partial,
matrix_to_qubit, matrix_to_density,
qubit_to... | true | true |
f745e76cea4e9ad672f082bfa7a6f6884ed8aaa8 | 50,976 | py | Python | tapas/utils/tf_example_utils.py | jeffersonHsieh/tapas | a2f1c8c763c08487bed6b91884dac946dd766ab9 | [
"Apache-2.0"
] | null | null | null | tapas/utils/tf_example_utils.py | jeffersonHsieh/tapas | a2f1c8c763c08487bed6b91884dac946dd766ab9 | [
"Apache-2.0"
] | null | null | null | tapas/utils/tf_example_utils.py | jeffersonHsieh/tapas | a2f1c8c763c08487bed6b91884dac946dd766ab9 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2019 The Google AI Language Team 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 ... | 35.4246 | 88 | 0.6834 |
import collections
import dataclasses
import hashlib
import random
from typing import Iterable, List, Mapping, Optional, Text, Tuple
from absl import logging
from apache_beam import metrics as beam_metrics
from tapas.protos import annotated_text_pb2
from tapas.protos import interaction_pb2
from tapas.p... | true | true |
f745e793ceef9af56edbe7b18f4d314c4bdc9c93 | 2,269 | py | Python | app/service/check_service.py | chenbocheng/fast_api_monitor | e22ab9dcc412e48bfa4728071eb7d12ff7f3e60a | [
"MIT"
] | null | null | null | app/service/check_service.py | chenbocheng/fast_api_monitor | e22ab9dcc412e48bfa4728071eb7d12ff7f3e60a | [
"MIT"
] | null | null | null | app/service/check_service.py | chenbocheng/fast_api_monitor | e22ab9dcc412e48bfa4728071eb7d12ff7f3e60a | [
"MIT"
] | null | null | null | from typing import Dict, List
from model.check import Check
from utils.logger import get_service_logger
from utils.config import Global
from utils.util import md5hash, jsondump, is_url
from datetime import datetime
from os import path
import json
LOGGER = get_service_logger('CHECK_SRV')
def save_item(check: Check) -... | 26.383721 | 108 | 0.677391 | from typing import Dict, List
from model.check import Check
from utils.logger import get_service_logger
from utils.config import Global
from utils.util import md5hash, jsondump, is_url
from datetime import datetime
from os import path
import json
LOGGER = get_service_logger('CHECK_SRV')
def save_item(check: Check) -... | true | true |
f745e7d886139a51e44723e4e47a010f3bb26716 | 726 | py | Python | objects/CSCG/_2d/mesh/trace/main.py | mathischeap/mifem | 3242e253fb01ca205a76568eaac7bbdb99e3f059 | [
"MIT"
] | 1 | 2020-10-14T12:48:35.000Z | 2020-10-14T12:48:35.000Z | objects/CSCG/_2d/mesh/trace/main.py | mathischeap/mifem | 3242e253fb01ca205a76568eaac7bbdb99e3f059 | [
"MIT"
] | null | null | null | objects/CSCG/_2d/mesh/trace/main.py | mathischeap/mifem | 3242e253fb01ca205a76568eaac7bbdb99e3f059 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from screws.freeze.main import FrozenOnly
from objects.CSCG._2d.mesh.trace.visualize import _2dCSCG_Trace_Visualize
from objects.CSCG._2d.mesh.trace.elements.main import _2dCSCG_Trace_Elements
class _2dCSCG_Trace(FrozenOnly):
def __init__(self, mesh):
self._mesh_ = mesh
s... | 27.923077 | 76 | 0.721763 |
from screws.freeze.main import FrozenOnly
from objects.CSCG._2d.mesh.trace.visualize import _2dCSCG_Trace_Visualize
from objects.CSCG._2d.mesh.trace.elements.main import _2dCSCG_Trace_Elements
class _2dCSCG_Trace(FrozenOnly):
def __init__(self, mesh):
self._mesh_ = mesh
self._elements_ = _2dCSC... | true | true |
f745eb82b5343d2c5ba8d7af5b72c98c06d4ce98 | 34,522 | py | Python | fa_icons.py | anowlcalledjosh/i3-workspace-names-daemon | 5071193d242cef33a9130461aca88ea8eb38b266 | [
"MIT"
] | 1 | 2019-03-20T18:00:39.000Z | 2019-03-20T18:00:39.000Z | fa_icons.py | anowlcalledjosh/i3-workspace-names-daemon | 5071193d242cef33a9130461aca88ea8eb38b266 | [
"MIT"
] | 31 | 2019-05-09T12:23:36.000Z | 2019-06-23T18:41:08.000Z | fa_icons.py | anowlcalledjosh/i3-workspace-names-daemon | 5071193d242cef33a9130461aca88ea8eb38b266 | [
"MIT"
] | null | null | null | # font-awesome icon-name to unicode mapping
icons = {
"500px": "\uf26e",
"accessible-icon": "\uf368",
"accusoft": "\uf369",
"acquisitions-incorporated": "\uf6af",
"ad": "\uf641",
"address-book": "\uf2b9",
"address-card": "\uf2bb",
"adjust": "\uf042",
"adn": "\uf170",
"adversal": ... | 27.354992 | 52 | 0.50394 |
icons = {
"500px": "\uf26e",
"accessible-icon": "\uf368",
"accusoft": "\uf369",
"acquisitions-incorporated": "\uf6af",
"ad": "\uf641",
"address-book": "\uf2b9",
"address-card": "\uf2bb",
"adjust": "\uf042",
"adn": "\uf170",
"adversal": "\uf36a",
"affiliatetheme": "\uf36b",
... | true | true |
f745eceb9817883b7b61543188f076f1f8121c7b | 23,603 | py | Python | src/ralph/ui/views/ventures.py | jjagodzinski/ralph | 000a22bcc934dc2051e7a09ab1e84bd1c25a9e73 | [
"Apache-2.0"
] | null | null | null | src/ralph/ui/views/ventures.py | jjagodzinski/ralph | 000a22bcc934dc2051e7a09ab1e84bd1c25a9e73 | [
"Apache-2.0"
] | null | null | null | src/ralph/ui/views/ventures.py | jjagodzinski/ralph | 000a22bcc934dc2051e7a09ab1e84bd1c25a9e73 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import re
import datetime
import calendar
from django.contrib import messages
from django.db import models as db
from django.http import HttpResp... | 36.368259 | 96 | 0.56103 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import re
import datetime
import calendar
from django.contrib import messages
from django.db import models as db
from django.http import HttpResponseRedirect, HttpRespo... | true | true |
f745ed47fda383eb50ce5fb7c7e9fee5cb1f9693 | 183 | py | Python | accounts/admin.py | samwel2000/STOCKMANAGER | 8d350e39f106f0b46549d39486fb0e17391b2ee8 | [
"MIT"
] | null | null | null | accounts/admin.py | samwel2000/STOCKMANAGER | 8d350e39f106f0b46549d39486fb0e17391b2ee8 | [
"MIT"
] | null | null | null | accounts/admin.py | samwel2000/STOCKMANAGER | 8d350e39f106f0b46549d39486fb0e17391b2ee8 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import *
# Register your models here.
# admin.site.register(Role)
admin.site.register(Profile)
# admin.site.register(UserAuthorization)
| 22.875 | 40 | 0.79235 | from django.contrib import admin
from .models import *
admin.site.register(Profile)
| true | true |
f745ef1a23848a6b71d0b50dc07fb74b66c2bb75 | 269 | py | Python | env/lib/python3.8/site-packages/plotly/graph_objs/layout/title/__init__.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | env/lib/python3.8/site-packages/plotly/graph_objs/layout/title/__init__.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | env/lib/python3.8/site-packages/plotly/graph_objs/layout/title/__init__.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import sys
if sys.version_info < (3, 7):
from ._font import Font
from ._pad import Pad
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
__name__, [], ["._font.Font", "._pad.Pad"]
)
| 22.416667 | 55 | 0.665428 | import sys
if sys.version_info < (3, 7):
from ._font import Font
from ._pad import Pad
else:
from _plotly_utils.importers import relative_import
__all__, __getattr__, __dir__ = relative_import(
__name__, [], ["._font.Font", "._pad.Pad"]
)
| true | true |
f745efb7c5c8b18b3d8ea3a96bdee9c9fe30f636 | 9,971 | py | Python | databricks_cli/oauth/oauth.py | sweisdb/databricks-cli | 5444cb8b94ef481e1656845f588d8d118bc352db | [
"Apache-2.0"
] | null | null | null | databricks_cli/oauth/oauth.py | sweisdb/databricks-cli | 5444cb8b94ef481e1656845f588d8d118bc352db | [
"Apache-2.0"
] | null | null | null | databricks_cli/oauth/oauth.py | sweisdb/databricks-cli | 5444cb8b94ef481e1656845f588d8d118bc352db | [
"Apache-2.0"
] | null | null | null | # Databricks CLI
# Copyright 2021 Databricks, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"), except
# that the use of services to which certain application programming
# interfaces (each, an "API") connect requires that the user first obtain
# a license for the use of the APIs from Databricks,... | 35.610714 | 98 | 0.719988 |
import base64
import hashlib
import json
import os
import webbrowser
from datetime import datetime, timedelta, tzinfo
import click
import jwt
from jwt import PyJWTError
import oauthlib.oauth2
from oauthlib.oauth2.rfc6749.errors import OAuth2Error
import requests
from requests.exceptions imp... | true | true |
f745f22aacc01962c8b3f16c0fde0a5d3abc3c83 | 5,765 | py | Python | train/login/Login.py | hellovvorld/12306 | e5224519ebb55ed971f69d4943453b099bb1d3fd | [
"MIT"
] | 1 | 2019-02-01T11:31:04.000Z | 2019-02-01T11:31:04.000Z | train/login/Login.py | youaregoo/12306 | e5224519ebb55ed971f69d4943453b099bb1d3fd | [
"MIT"
] | null | null | null | train/login/Login.py | youaregoo/12306 | e5224519ebb55ed971f69d4943453b099bb1d3fd | [
"MIT"
] | null | null | null | import time
from conf.constant import TYPE_LOGIN_NORMAL_WAY, TYPE_LOGIN_OTHER_WAY
from conf.urls_conf import loginUrls
from configure import USER_PWD, USER_NAME
from net.NetUtils import EasyHttp
from train.login.Capthca import Captcha
from utils import Utils
from utils.Log import Log
from conf.constant import CAPTCHA_... | 35.807453 | 115 | 0.612316 | import time
from conf.constant import TYPE_LOGIN_NORMAL_WAY, TYPE_LOGIN_OTHER_WAY
from conf.urls_conf import loginUrls
from configure import USER_PWD, USER_NAME
from net.NetUtils import EasyHttp
from train.login.Capthca import Captcha
from utils import Utils
from utils.Log import Log
from conf.constant import CAPTCHA_... | true | true |
f745f2e26fa5e5fcfbe3f3eb18b4acecb1418df7 | 332 | py | Python | tests/test_utils.py | arunima811/zendesk-ticket-viewer | 3e567cbc6b0af29b9cb722ff1a1ac3cf73c671c1 | [
"MIT"
] | null | null | null | tests/test_utils.py | arunima811/zendesk-ticket-viewer | 3e567cbc6b0af29b9cb722ff1a1ac3cf73c671c1 | [
"MIT"
] | null | null | null | tests/test_utils.py | arunima811/zendesk-ticket-viewer | 3e567cbc6b0af29b9cb722ff1a1ac3cf73c671c1 | [
"MIT"
] | null | null | null | from zendesk_viewer.utils import string_utils
def test_chunkstring():
str = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad"
chunks = list(string_utils.chunkstring(str, 25))
assert len(chunks) == 6
assert "".join(ch... | 47.428571 | 146 | 0.740964 | from zendesk_viewer.utils import string_utils
def test_chunkstring():
str = "Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad"
chunks = list(string_utils.chunkstring(str, 25))
assert len(chunks) == 6
assert "".join(ch... | true | true |
f745f3bd599bb4ad6d277d723b26fecbee4ab636 | 72,272 | py | Python | app/bq_service.py | s2t2/tweet-analyzer-py | 0a398fc47101a2d602d8c4116c970f1076a58f27 | [
"MIT"
] | 5 | 2020-04-02T12:03:57.000Z | 2020-10-18T19:29:15.000Z | app/bq_service.py | s2t2/tweet-analyzer-py | 0a398fc47101a2d602d8c4116c970f1076a58f27 | [
"MIT"
] | 22 | 2020-03-31T02:00:34.000Z | 2021-06-30T17:59:01.000Z | app/bq_service.py | s2t2/tweet-analyzer-py | 0a398fc47101a2d602d8c4116c970f1076a58f27 | [
"MIT"
] | 3 | 2020-04-04T16:08:08.000Z | 2020-10-20T01:32:46.000Z | from datetime import datetime, timedelta, timezone
import os
from functools import lru_cache
from pprint import pprint
from dotenv import load_dotenv
from google.cloud import bigquery
from google.cloud.bigquery import QueryJobConfig, ScalarQueryParameter
from app import APP_ENV, seek_confirmation
from app.decorators.... | 39.065946 | 161 | 0.585261 | from datetime import datetime, timedelta, timezone
import os
from functools import lru_cache
from pprint import pprint
from dotenv import load_dotenv
from google.cloud import bigquery
from google.cloud.bigquery import QueryJobConfig, ScalarQueryParameter
from app import APP_ENV, seek_confirmation
from app.decorators.... | true | true |
f745f46df087097bb04b880ed308460064abbb8f | 91 | py | Python | tools/Polygraphy/polygraphy/tools/__init__.py | martellz/TensorRT | f182e83b30b5d45aaa3f9a041ff8b3ce83e366f4 | [
"Apache-2.0"
] | 4 | 2021-04-16T13:49:38.000Z | 2022-01-16T08:58:07.000Z | tools/Polygraphy/polygraphy/tools/__init__.py | martellz/TensorRT | f182e83b30b5d45aaa3f9a041ff8b3ce83e366f4 | [
"Apache-2.0"
] | null | null | null | tools/Polygraphy/polygraphy/tools/__init__.py | martellz/TensorRT | f182e83b30b5d45aaa3f9a041ff8b3ce83e366f4 | [
"Apache-2.0"
] | 2 | 2021-02-04T14:46:10.000Z | 2021-02-04T14:56:08.000Z | from polygraphy.tools.base import Tool
from polygraphy.tools.registry import TOOL_REGISTRY
| 30.333333 | 51 | 0.868132 | from polygraphy.tools.base import Tool
from polygraphy.tools.registry import TOOL_REGISTRY
| true | true |
f745f5d61cb9a19e3065e33303a67ed5412d618b | 3,463 | py | Python | src/etc/mklldeps.py | tedhorst/rust | 2ec3e60e4993dcfe9e5da9b3c05ebf086d2fb1e6 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2017-12-18T20:48:50.000Z | 2017-12-18T20:48:51.000Z | src/etc/mklldeps.py | tedhorst/rust | 2ec3e60e4993dcfe9e5da9b3c05ebf086d2fb1e6 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | src/etc/mklldeps.py | tedhorst/rust | 2ec3e60e4993dcfe9e5da9b3c05ebf086d2fb1e6 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1 | 2019-11-04T23:18:22.000Z | 2019-11-04T23:18:22.000Z | # Copyright 2013-2014 The Rust Project Developers. See the COPYRIGHT
# file at the top-level directory of this distribution and at
# http://rust-lang.org/COPYRIGHT.
#
# Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
# http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
# <LICENSE-MIT or ht... | 31.198198 | 81 | 0.586197 |
import os
import sys
import subprocess
import itertools
from os import path
f = open(sys.argv[1], 'wb')
components = sys.argv[2].split(' ')
components = [i for i in components if i]
enable_static = sys.argv[3]
f.write("""// Copyright 2013 The Rust Project Developers. See the COPYRIGHT
// file at the top-... | true | true |
f745f5eb71e37d7347397f6428e66be95f8b0416 | 70 | py | Python | demo_ServerUser.py | SunnyLi1106/Comspy | 33aae6094c8ae3394173cea0354650d9e8b4d164 | [
"MIT"
] | 1 | 2022-03-03T03:28:40.000Z | 2022-03-03T03:28:40.000Z | demo_ServerUser.py | SunnyLi1106/Comspy | 33aae6094c8ae3394173cea0354650d9e8b4d164 | [
"MIT"
] | null | null | null | demo_ServerUser.py | SunnyLi1106/Comspy | 33aae6094c8ae3394173cea0354650d9e8b4d164 | [
"MIT"
] | null | null | null | import comspy.user.Server_Chinese
comspy.user.Server_Chinese.start(5) | 35 | 35 | 0.857143 | import comspy.user.Server_Chinese
comspy.user.Server_Chinese.start(5) | true | true |
f745f70e8b29ebb02a86bb0338082f9d9300d7ec | 1,546 | py | Python | Resources/books/long_short_term_memory_networks_with_python/code/lesson_12/tune_batch_size.py | gdepalma93/bright-athlete-academy | 54ba0cc6633637c1bd6d90120153e04b981244bf | [
"MIT"
] | null | null | null | Resources/books/long_short_term_memory_networks_with_python/code/lesson_12/tune_batch_size.py | gdepalma93/bright-athlete-academy | 54ba0cc6633637c1bd6d90120153e04b981244bf | [
"MIT"
] | null | null | null | Resources/books/long_short_term_memory_networks_with_python/code/lesson_12/tune_batch_size.py | gdepalma93/bright-athlete-academy | 54ba0cc6633637c1bd6d90120153e04b981244bf | [
"MIT"
] | null | null | null | from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from matplotlib import pyplot
from pandas import DataFrame
from numpy import array
# return training data
def get_train():
seq = [[0.0, 0.1], [0.1, 0.2], [0.2, 0.3], [0.3, 0.4], [0.4, 0.5]]
seq = array(seq)
X, y = seq[:... | 26.20339 | 74 | 0.670116 | from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from matplotlib import pyplot
from pandas import DataFrame
from numpy import array
def get_train():
seq = [[0.0, 0.1], [0.1, 0.2], [0.2, 0.3], [0.3, 0.4], [0.4, 0.5]]
seq = array(seq)
X, y = seq[:, 0], seq[:, 1]
X = X... | true | true |
f745f72561b7ba0fa2a85443a88e8843418632ef | 699 | py | Python | storage/etl_utils/__init__.py | publichealthengland/coronavirus-dashboard-pipeline-etl | efcf5c77091afe8a0f7edce2e5934fe8c1f6dc1c | [
"MIT"
] | 7 | 2021-02-14T12:42:56.000Z | 2022-03-02T09:14:22.000Z | storage/etl_utils/__init__.py | publichealthengland/coronavirus-dashboard-pipeline-etl | efcf5c77091afe8a0f7edce2e5934fe8c1f6dc1c | [
"MIT"
] | 19 | 2021-11-03T09:21:00.000Z | 2022-03-07T09:26:47.000Z | storage/etl_utils/__init__.py | publichealthengland/coronavirus-dashboard-pipeline-etl | efcf5c77091afe8a0f7edce2e5934fe8c1f6dc1c | [
"MIT"
] | 2 | 2021-03-03T16:52:51.000Z | 2022-02-28T16:22:33.000Z | #!/usr/bin python3
"""
<Description of the programme>
Author: Pouria Hadjibagheri <pouria.hadjibagheri@phe.gov.uk>
Created: 27 Dec 2020
License: MIT
Contributors: Pouria Hadjibagheri
"""
# Imports
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Python:... | 24.964286 | 90 | 0.423462 |
from .utils import *
__author__ = "Pouria Hadjibagheri"
__copyright__ = "Copyright (c) 2020, Public Health England"
__license__ = "MIT"
__version__ = "0.0.1"
| true | true |
f745f737f3b914ae97464ff19a0901ffb3b56d9e | 9,915 | py | Python | env/lib/python3.7/site-packages/art/defences/preprocessor/variance_minimization.py | GU-DataLab/fairness-and-missing-values | 36a900aa235d1d53bd57e11c89e3f73f9a585aca | [
"MIT"
] | 1 | 2021-09-09T13:19:34.000Z | 2021-09-09T13:19:34.000Z | env/lib/python3.7/site-packages/art/defences/preprocessor/variance_minimization.py | GU-DataLab/fairness-and-missing-values | 36a900aa235d1d53bd57e11c89e3f73f9a585aca | [
"MIT"
] | 10 | 2021-10-04T23:25:53.000Z | 2022-03-24T23:20:38.000Z | art/defences/preprocessor/variance_minimization.py | guozfeng/adversarial-robustness-toolbox | 4b9383d2e383ae49a0cd6c94e3c9cf7c3a584581 | [
"MIT"
] | 1 | 2021-09-09T13:19:35.000Z | 2021-09-09T13:19:35.000Z | # MIT License
#
# Copyright (C) The Adversarial Robustness Toolbox (ART) Authors 2018
#
# 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
# r... | 42.922078 | 120 | 0.628543 |
from __future__ import absolute_import, division, print_function, unicode_literals
import logging
from typing import Optional, Tuple, TYPE_CHECKING
import numpy as np
from scipy.optimize import minimize
from tqdm import tqdm
from art.config import ART_NUMPY_DTYPE
from art.defences.preprocessor.prepr... | true | true |
f745f74342af9ff60462a350e7498ad02eb477f2 | 409 | py | Python | Kinect Science Fair/RemoveTrash.py | JBPrew/Konnect | 02c0990aa7eb861b01c879e89d57f35c7b1db7c6 | [
"MIT"
] | 4 | 2020-11-09T20:01:27.000Z | 2021-04-04T20:49:05.000Z | Kinect Science Fair/RemoveTrash.py | JBPrew/Konnect | 02c0990aa7eb861b01c879e89d57f35c7b1db7c6 | [
"MIT"
] | 1 | 2021-03-03T20:01:52.000Z | 2021-04-11T19:19:43.000Z | Kinect Science Fair/RemoveTrash.py | JBPrew/Konnect | 02c0990aa7eb861b01c879e89d57f35c7b1db7c6 | [
"MIT"
] | null | null | null | import csv
with open('Depth Data/KinectDataRaw.csv', 'r', newline='') as file:
reader = csv.reader(file)
fileWriter = open("Depth Data/KinectData.csv", "w")
for row in reader:
target = row.pop(0) #Remove the target
if target != "Trash":
row = list(map(int, row))
fileW... | 34.083333 | 73 | 0.564792 | import csv
with open('Depth Data/KinectDataRaw.csv', 'r', newline='') as file:
reader = csv.reader(file)
fileWriter = open("Depth Data/KinectData.csv", "w")
for row in reader:
target = row.pop(0)
if target != "Trash":
row = list(map(int, row))
fileWriter.write(target... | true | true |
f745f775784f8c5dac50c6e623d25c608e1b5768 | 8,407 | py | Python | opensoar/task/race_task.py | tpatja/opensoar | ab08153f3edbab94b1a024a2734162e965163b74 | [
"MIT"
] | null | null | null | opensoar/task/race_task.py | tpatja/opensoar | ab08153f3edbab94b1a024a2734162e965163b74 | [
"MIT"
] | null | null | null | opensoar/task/race_task.py | tpatja/opensoar | ab08153f3edbab94b1a024a2734162e965163b74 | [
"MIT"
] | null | null | null | from opensoar.task.task import Task
from opensoar.utilities.helper_functions import calculate_distance, double_iterator, \
seconds_time_difference_fixes, add_seconds
class RaceTask(Task):
"""
Race task.
"""
def __init__(self, waypoints, timezone=None, start_opening=None, start_time_buffer=0, mult... | 42.035 | 121 | 0.611276 | from opensoar.task.task import Task
from opensoar.utilities.helper_functions import calculate_distance, double_iterator, \
seconds_time_difference_fixes, add_seconds
class RaceTask(Task):
def __init__(self, waypoints, timezone=None, start_opening=None, start_time_buffer=0, multistart=False):
super().... | true | true |
f745f8cf0b69a004853fd4193cae1e2fca3a25ed | 1,698 | py | Python | function.py | anmol1455/python | 8e3858bdebb21ec3c9e8147ceef17a82b4a36926 | [
"bzip2-1.0.6"
] | null | null | null | function.py | anmol1455/python | 8e3858bdebb21ec3c9e8147ceef17a82b4a36926 | [
"bzip2-1.0.6"
] | null | null | null | function.py | anmol1455/python | 8e3858bdebb21ec3c9e8147ceef17a82b4a36926 | [
"bzip2-1.0.6"
] | null | null | null | x=int(input("enter the number 1"))
y=int(input("enter the number 2"))
def sumt(n,m):#function with argument no return
print("sum operation \n")
sumt=n+m
print("sum is",sumt)
def subs(n,m):#function with argument with return
print("substraction operation \n")
subs=n-m
print("difference is",subs)... | 42.45 | 130 | 0.673734 | x=int(input("enter the number 1"))
y=int(input("enter the number 2"))
def sumt(n,m):
print("sum operation \n")
sumt=n+m
print("sum is",sumt)
def subs(n,m):
print("substraction operation \n")
subs=n-m
print("difference is",subs)
return subs
... | true | true |
f745f90df41772dbaff857c5616dd9484690b90f | 6,602 | py | Python | test/util/bitcoin-util-test.py | BarrelCrudeCoin/BarrelCrudeCoin | 3bef9c1419dec7da56c9a9b1b815de06a54f94ce | [
"MIT"
] | 4 | 2021-03-15T21:33:02.000Z | 2021-08-10T18:18:44.000Z | test/util/bitcoin-util-test.py | blockconsortium/BarrelCrudeCoin | 6cba56f636f72c0aeba79a0ea1cb9ac71da83691 | [
"MIT"
] | 1 | 2021-11-07T20:13:31.000Z | 2021-11-07T20:13:31.000Z | test/util/bitcoin-util-test.py | BarrelCrudeCoin/BarrelCrudeCoin | 3bef9c1419dec7da56c9a9b1b815de06a54f94ce | [
"MIT"
] | 2 | 2021-03-15T21:33:05.000Z | 2021-03-16T03:05:47.000Z | #!/usr/bin/env python3
# Copyright 2014 BitPay Inc.
# Copyright 2016-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test framework for barrelcrudecoin utils.
Runs automatically during `make che... | 37.511364 | 125 | 0.633899 |
import argparse
import binascii
import configparser
import difflib
import json
import logging
import os
import pprint
import subprocess
import sys
def main():
config = configparser.ConfigParser()
config.optionxform = str
config.read_file(open(os.path.join(os.path.dirname(__file__), "../config.ini"), ... | true | true |
f745fa450d656e747110cbb1b28870fc0bec8df8 | 2,588 | py | Python | vital_sqi/sqi/dtw_sqi.py | meta00/vital_sqi | 7e64a26c9d56af26bfbd25c3ba30211414f5f845 | [
"MIT"
] | 4 | 2021-09-30T08:18:02.000Z | 2022-03-04T10:00:00.000Z | vital_sqi/sqi/dtw_sqi.py | meta00/vital_sqi | 7e64a26c9d56af26bfbd25c3ba30211414f5f845 | [
"MIT"
] | 25 | 2021-05-14T06:31:44.000Z | 2021-06-11T18:23:17.000Z | vital_sqi/sqi/dtw_sqi.py | meta00/vital_sqi | 7e64a26c9d56af26bfbd25c3ba30211414f5f845 | [
"MIT"
] | 3 | 2021-05-30T21:19:02.000Z | 2021-12-02T11:29:02.000Z | import numpy as np
import sys
import os
if bool(getattr(sys, 'ps1', sys.flags.interactive)):
old_stdout = sys.stdout
sys.stdout = open(os.devnull, 'w')
from dtw import dtw
sys.stdout = old_stdout
else:
from dtw import dtw
from vital_sqi.common.generate_template import (
ppg_absolute_dual_sk... | 33.179487 | 82 | 0.671175 | import numpy as np
import sys
import os
if bool(getattr(sys, 'ps1', sys.flags.interactive)):
old_stdout = sys.stdout
sys.stdout = open(os.devnull, 'w')
from dtw import dtw
sys.stdout = old_stdout
else:
from dtw import dtw
from vital_sqi.common.generate_template import (
ppg_absolute_dual_sk... | true | true |
f745faf9bb9ce32693a37fc189beda37992c9c21 | 2,833 | py | Python | visualiser/facades/ociDatabaseSystem.py | antoniogomezr/oci-designer-tookit | 0f8756bf778cbbc923df2020ea11cf384e855590 | [
"UPL-1.0",
"Apache-2.0"
] | null | null | null | visualiser/facades/ociDatabaseSystem.py | antoniogomezr/oci-designer-tookit | 0f8756bf778cbbc923df2020ea11cf384e855590 | [
"UPL-1.0",
"Apache-2.0"
] | null | null | null | visualiser/facades/ociDatabaseSystem.py | antoniogomezr/oci-designer-tookit | 0f8756bf778cbbc923df2020ea11cf384e855590 | [
"UPL-1.0",
"Apache-2.0"
] | 1 | 2022-01-05T19:58:10.000Z | 2022-01-05T19:58:10.000Z | #!/usr/bin/python
# Copyright (c) 2020, Oracle and/or its affiliates.
# Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl.
"""Provide Module Description
"""
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~#
__author__ = ["And... | 38.283784 | 132 | 0.616661 |
__author__ = ["Andrew Hopkinson (Oracle Cloud Solutions A-Team)"]
__version__ = "1.0.0"
__module__ = "ociDatabaseSystem"
import oci
from common.okitLogging import getLogger
from common.okitCommon import logJson
from facades.ociConnection import OCIDatabaseConnection
logger = getLogger()
class OCIDatabaseSy... | true | true |
f745fd33ee13aea7516b847e8a0906cf09e91960 | 3,265 | py | Python | PyFunceble/converter/internal_url.py | NeolithEra/PyFunceble | 58db861d36224f279a460f4959aaa2e140ce749f | [
"MIT"
] | null | null | null | PyFunceble/converter/internal_url.py | NeolithEra/PyFunceble | 58db861d36224f279a460f4959aaa2e140ce749f | [
"MIT"
] | null | null | null | PyFunceble/converter/internal_url.py | NeolithEra/PyFunceble | 58db861d36224f279a460f4959aaa2e140ce749f | [
"MIT"
] | null | null | null | """
The tool to check the availability or syntax of domains, IPv4, IPv6 or URL.
::
βββββββ βββ ββββββββββββββ βββββββ βββ ββββββββββββββββββββββ βββ ββββββββ
ββββββββββββ βββββββββββββββ ββββββββ ββββββββββββββββββββββββββββββ ββββββββ
ββββββββ βββββββ ββββββ βββ βββββββββ ββββββ ... | 33.316327 | 88 | 0.596631 |
from PyFunceble.abstracts import Version
from PyFunceble.exceptions import WrongParameterType
from .base import ConverterBase
class InternalUrl(ConverterBase):
def __init__(self, data_to_convert):
if not isinstance(data_to_convert, str):
raise WrongParameterType(
f"<data_to_... | true | true |
f745fd423d9e3711f50f22f4f17422842262e37f | 3,574 | py | Python | script_move.py | RamzeyXD/Move_Self_Bot | 5589b7cde9c7ce7c024cd72b129136099f68bb4c | [
"MIT"
] | null | null | null | script_move.py | RamzeyXD/Move_Self_Bot | 5589b7cde9c7ce7c024cd72b129136099f68bb4c | [
"MIT"
] | null | null | null | script_move.py | RamzeyXD/Move_Self_Bot | 5589b7cde9c7ce7c024cd72b129136099f68bb4c | [
"MIT"
] | null | null | null | import discord
import asyncio
from discord.utils import get
import time
from colorama import Fore
# create client object.
client = discord.Client()
# Main decorator for search user and give parameters to wraper function
def find_member(func):
async def wrap(*args, **kwargs):
print(client.user)
use... | 25.898551 | 91 | 0.6662 | import discord
import asyncio
from discord.utils import get
import time
from colorama import Fore
client = discord.Client()
def find_member(func):
async def wrap(*args, **kwargs):
print(client.user)
user_id = args[0]
server_name = args[1]
servers = client.guilds
target = []
for serve... | true | true |
f745fdd14a295c4e8651c7fb9d08f457f9e60559 | 460 | py | Python | checkov/terraform/checks/provider/base_registry.py | pmalkki/checkov | b6cdf386dd976fe27c16fed6d550756a678a5d7b | [
"Apache-2.0"
] | 4,013 | 2019-12-09T13:16:54.000Z | 2022-03-31T14:31:01.000Z | checkov/terraform/checks/provider/base_registry.py | pmalkki/checkov | b6cdf386dd976fe27c16fed6d550756a678a5d7b | [
"Apache-2.0"
] | 1,258 | 2019-12-17T09:55:51.000Z | 2022-03-31T19:17:17.000Z | checkov/terraform/checks/provider/base_registry.py | pmalkki/checkov | b6cdf386dd976fe27c16fed6d550756a678a5d7b | [
"Apache-2.0"
] | 638 | 2019-12-19T08:57:38.000Z | 2022-03-30T21:38:37.000Z | from typing import Dict, Any, Tuple
from checkov.common.checks.base_check_registry import BaseCheckRegistry
class Registry(BaseCheckRegistry):
def extract_entity_details(self, entity: Dict[str, Any]) -> Tuple[str, str, Dict[str, Any]]:
provider_type = list(entity.keys())[0]
provider_name = list(e... | 38.333333 | 96 | 0.73913 | from typing import Dict, Any, Tuple
from checkov.common.checks.base_check_registry import BaseCheckRegistry
class Registry(BaseCheckRegistry):
def extract_entity_details(self, entity: Dict[str, Any]) -> Tuple[str, str, Dict[str, Any]]:
provider_type = list(entity.keys())[0]
provider_name = list(e... | true | true |
f745fdd8e7b60b82211e9dc4f64b7b0ae9197b3d | 8,966 | py | Python | sdk/python/pulumi_azure_nextgen/documentdb/v20200601preview/mongo_db_resource_mongo_db_collection.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/documentdb/v20200601preview/mongo_db_resource_mongo_db_collection.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/documentdb/v20200601preview/mongo_db_resource_mongo_db_collection.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 53.053254 | 596 | 0.679344 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from . import outputs
from ._inputs import *
__all__ = ['MongoDBResourceMongoDBCollection']
class MongoDBResourceMongoDBCollection(pulumi.CustomResource):
def __i... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.