hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f76520607a58555a7991328f17813f38c908e3e8 | 682 | py | Python | python/utils/objectify_dict.py | ministryofjustice/securityanalytics-sharedcode | 0b90b7303d297587e8433c6274e57ad86402d528 | [
"MIT"
] | null | null | null | python/utils/objectify_dict.py | ministryofjustice/securityanalytics-sharedcode | 0b90b7303d297587e8433c6274e57ad86402d528 | [
"MIT"
] | 1 | 2022-01-25T10:23:23.000Z | 2022-01-25T10:23:23.000Z | python/utils/objectify_dict.py | ministryofjustice/securityanalytics-sharedcode | 0b90b7303d297587e8433c6274e57ad86402d528 | [
"MIT"
] | 1 | 2021-04-11T06:43:49.000Z | 2021-04-11T06:43:49.000Z | from collections import namedtuple
# This method will recursively convert dictionaries into named tuples, allowing them to be
# used like they were regular objects e.g. foo.bar.baz not foo['bar']['baz']
# it does trade readability of code for a performance hit doing the conversion
def objectify(v):
if isinstance(... | 34.1 | 90 | 0.645161 | from collections import namedtuple
def objectify(v):
if isinstance(v, dict):
for key, value in v.items():
if isinstance(value, (dict, list, tuple)):
v[key] = objectify(value)
return namedtuple('t', v.keys())(**v)
if isinstance(v, list):
return [objectify(x) ... | true | true |
f76520e034bad6b73174fbe32f6b042148b137de | 545 | py | Python | VertexTissue/validate.py | laurentmackay/3d-vertex | 6d6e124ecfaca018d979c5ef17d0b83d1cc0f96c | [
"MIT"
] | null | null | null | VertexTissue/validate.py | laurentmackay/3d-vertex | 6d6e124ecfaca018d979c5ef17d0b83d1cc0f96c | [
"MIT"
] | null | null | null | VertexTissue/validate.py | laurentmackay/3d-vertex | 6d6e124ecfaca018d979c5ef17d0b83d1cc0f96c | [
"MIT"
] | null | null | null | import os
import networkx as nx
import numpy as np
def validate(n,attr='pos'):
try:
G=nx.read_gpickle(f't{n}.pickle')
G1=nx.read_gpickle(f't_fast{n}.pickle')
vals = nx.get_node_attributes(G,attr)
vals1 = nx.get_node_attributes(G1,attr)
max_diff = np.max([np.max(np... | 17.03125 | 97 | 0.587156 | import os
import networkx as nx
import numpy as np
def validate(n,attr='pos'):
try:
G=nx.read_gpickle(f't{n}.pickle')
G1=nx.read_gpickle(f't_fast{n}.pickle')
vals = nx.get_node_attributes(G,attr)
vals1 = nx.get_node_attributes(G1,attr)
max_diff = np.max([np.max(np... | true | true |
f7652143f597909de7c80f7af807d228983eb898 | 269 | py | Python | test/specific-time.py | netoolii/loop-listen | ffebf87aa87241fdfdd5ced05ae8cf1943a534ea | [
"MIT"
] | 2 | 2019-09-04T23:18:07.000Z | 2021-12-16T15:34:03.000Z | test/specific-time.py | netoolii/loop-listen | ffebf87aa87241fdfdd5ced05ae8cf1943a534ea | [
"MIT"
] | null | null | null | test/specific-time.py | netoolii/loop-listen | ffebf87aa87241fdfdd5ced05ae8cf1943a534ea | [
"MIT"
] | 1 | 2020-05-23T12:46:47.000Z | 2020-05-23T12:46:47.000Z | from loop_listen.loop_listen import Loop_listen as Loop
i=5
try:
for i in range(i):
audio = Loop(filename=str(i), threshold=False, max_seconds=3)
audio.listen()
except KeyboardInterrupt:
print('interrupted!')
print('Finalizado com sucesso') | 20.692308 | 69 | 0.698885 | from loop_listen.loop_listen import Loop_listen as Loop
i=5
try:
for i in range(i):
audio = Loop(filename=str(i), threshold=False, max_seconds=3)
audio.listen()
except KeyboardInterrupt:
print('interrupted!')
print('Finalizado com sucesso') | true | true |
f7652200ac0cc923a5718e464d5164e8be74b379 | 38,527 | py | Python | data/j2py_translate/Solvers/UniquenessSolver.py | Lambda-School-Labs/omega2020-ds | c3a1a1f425238f60bb11ffa8b41dfe86a1aca14b | [
"MIT"
] | 4 | 2020-05-13T03:31:24.000Z | 2021-08-30T03:58:32.000Z | data/j2py_translate/Solvers/UniquenessSolver.py | Lambda-School-Labs/omega2020-ds | c3a1a1f425238f60bb11ffa8b41dfe86a1aca14b | [
"MIT"
] | 8 | 2019-12-18T15:07:38.000Z | 2020-08-27T02:13:34.000Z | data/j2py_translate/Solvers/UniquenessSolver.py | Lambda-School-Labs/omega2020-ds | c3a1a1f425238f60bb11ffa8b41dfe86a1aca14b | [
"MIT"
] | 10 | 2020-01-28T23:14:41.000Z | 2021-03-06T02:12:12.000Z | #!/usr/bin/env python
""" generated source for module UniquenessSolver_no_german """
from __future__ import print_function
#
# * Copyright (C) 2008-12 Bernhard Hobiger
# *
# * This file is part of HoDoKu.
# *
# * HoDoKu is free software: you can redistribute it and/or modify
# * it under the terms of the ... | 46.084928 | 935 | 0.53796 | """ generated source for module UniquenessSolver_no_german """
from __future__ import print_function
class UniquenessSolver(AbstractSolver):
""" generated source for class UniquenessSolver """
bugConstraints = [None] * 3
globalStep = SolutionStep(SolutionType.FULL_HOUSE)
steps = ArrayList(... | false | true |
f765236d436a17e2e3976b4be0663987326d9aa8 | 14,132 | py | Python | buildpack/databroker/config_generator/templates/jmx/kafka_connect.py | mayankmendix/cf-mendix-buildpack | 7809b154b6c759780a365638e3fed98b5b2ab4f0 | [
"Apache-2.0"
] | null | null | null | buildpack/databroker/config_generator/templates/jmx/kafka_connect.py | mayankmendix/cf-mendix-buildpack | 7809b154b6c759780a365638e3fed98b5b2ab4f0 | [
"Apache-2.0"
] | null | null | null | buildpack/databroker/config_generator/templates/jmx/kafka_connect.py | mayankmendix/cf-mendix-buildpack | 7809b154b6c759780a365638e3fed98b5b2ab4f0 | [
"Apache-2.0"
] | null | null | null | import os
jmx_metrics = {
"host": "localhost",
"port": 11003,
"java_bin_path": str(os.path.abspath(".local/bin/java")),
"java_options": "-Xmx50m -Xms15m",
"conf": [
{
"include": {
"bean": "kafka.connect:type=connect-worker-metrics",
"attribute": {... | 46.032573 | 102 | 0.429168 | import os
jmx_metrics = {
"host": "localhost",
"port": 11003,
"java_bin_path": str(os.path.abspath(".local/bin/java")),
"java_options": "-Xmx50m -Xms15m",
"conf": [
{
"include": {
"bean": "kafka.connect:type=connect-worker-metrics",
"attribute": {... | true | true |
f76523ba6db09b42154bc23329f0fa8eff174096 | 108 | py | Python | app/models/quote.py | nickobrad/blogs | 4e3c74af42aa54ee70f030bd7fc8ea7993e47f48 | [
"MIT"
] | null | null | null | app/models/quote.py | nickobrad/blogs | 4e3c74af42aa54ee70f030bd7fc8ea7993e47f48 | [
"MIT"
] | null | null | null | app/models/quote.py | nickobrad/blogs | 4e3c74af42aa54ee70f030bd7fc8ea7993e47f48 | [
"MIT"
] | null | null | null | class Quote:
def __init__(self, author, quote):
self.author = author
self.quote = quote | 21.6 | 38 | 0.611111 | class Quote:
def __init__(self, author, quote):
self.author = author
self.quote = quote | true | true |
f765251c9fadc056d6721f640da45bf541d2f3be | 5,103 | py | Python | pd.py | gxjit/PyPodGen | ce1f6858fa47790b8e7cdc85f34565ea0c65c8bb | [
"MIT"
] | 2 | 2020-05-05T07:14:38.000Z | 2020-06-28T23:29:04.000Z | pd.py | gxjit/PyPodGen | ce1f6858fa47790b8e7cdc85f34565ea0c65c8bb | [
"MIT"
] | null | null | null | pd.py | gxjit/PyPodGen | ce1f6858fa47790b8e7cdc85f34565ea0c65c8bb | [
"MIT"
] | null | null | null |
# Copyright (c) 2019 Gurjit Singh
# This source code is licensed under the MIT license that can be found in
# the accompanying LICENSE file or at https://opensource.org/licenses/MIT.
import sys
import datetime
import pathlib
import argparse
from tinytag import TinyTag
def parseArgs():
def dirPath(pth):
... | 27 | 134 | 0.553204 |
import sys
import datetime
import pathlib
import argparse
from tinytag import TinyTag
def parseArgs():
def dirPath(pth):
pthObj = pathlib.Path(pth)
if pthObj.is_dir():
return pthObj
else:
raise argparse.ArgumentTypeError("Invalid Directory path")
parser ... | true | true |
f765260d1fafce2a9c91fdf86440716722da9be7 | 1,672 | py | Python | deep-rl/lib/python2.7/site-packages/OpenGL/raw/EGL/VERSION/EGL_1_1.py | ShujaKhalid/deep-rl | 99c6ba6c3095d1bfdab81bd01395ced96bddd611 | [
"MIT"
] | 210 | 2016-04-09T14:26:00.000Z | 2022-03-25T18:36:19.000Z | deep-rl/lib/python2.7/site-packages/OpenGL/raw/EGL/VERSION/EGL_1_1.py | ShujaKhalid/deep-rl | 99c6ba6c3095d1bfdab81bd01395ced96bddd611 | [
"MIT"
] | 72 | 2016-09-04T09:30:19.000Z | 2022-03-27T17:06:53.000Z | deep-rl/lib/python2.7/site-packages/OpenGL/raw/EGL/VERSION/EGL_1_1.py | ShujaKhalid/deep-rl | 99c6ba6c3095d1bfdab81bd01395ced96bddd611 | [
"MIT"
] | 64 | 2016-04-09T14:26:49.000Z | 2022-03-21T11:19:47.000Z | '''Autogenerated by xml_generate script, do not edit!'''
from OpenGL import platform as _p, arrays
# Code generation uses this
from OpenGL.raw.EGL import _types as _cs
# End users want this...
from OpenGL.raw.EGL._types import *
from OpenGL.raw.EGL import _errors
from OpenGL.constant import Constant as _C
import ctype... | 41.8 | 114 | 0.830144 | from OpenGL import platform as _p, arrays
from OpenGL.raw.EGL import _types as _cs
from OpenGL.raw.EGL._types import *
from OpenGL.raw.EGL import _errors
from OpenGL.constant import Constant as _C
import ctypes
_EXTENSION_NAME = 'EGL_VERSION_EGL_1_1'
def _f( function ):
return _p.createFunction( function,_p.PLATFO... | true | true |
f765269eefcad451f61a224ed3769a1f43fd4e36 | 14,525 | py | Python | abodepy/__main__.py | clang13/abodepy | 8976db27212d0a587b404b6b22140f9f95794f4a | [
"MIT"
] | 1 | 2018-09-09T19:46:38.000Z | 2018-09-09T19:46:38.000Z | abodepy/__main__.py | clang13/abodepy | 8976db27212d0a587b404b6b22140f9f95794f4a | [
"MIT"
] | null | null | null | abodepy/__main__.py | clang13/abodepy | 8976db27212d0a587b404b6b22140f9f95794f4a | [
"MIT"
] | null | null | null | #!/usr/bin/python
"""
abodecl by Wil Schrader - An Abode alarm Python library command line interface.
https://github.com/MisterWil/abodepy
Published under the MIT license - See LICENSE file for more details.
"Abode" is a trademark owned by Abode Systems Inc., see www.goabode.com for
more information. I am in no way ... | 32.349666 | 79 | 0.549948 | import json
import logging
import time
import argparse
import abodepy
import abodepy.helpers.timeline as TIMELINE
from abodepy.exceptions import AbodeException
_LOGGER = logging.getLogger('abodecl')
def setup_logging(log_level=logging.INFO):
logging.basicConfig(level=log_level)
fmt = ("%(asctime)s %(leveln... | true | true |
f76527a855f5c9f82aa6f818e01a15bebd37da74 | 7,195 | py | Python | tests/utils_test.py | isabella232/uis-rnn | 91764ceaad832be651f3d64a809a183e133154d6 | [
"Apache-2.0"
] | 1,454 | 2018-10-23T09:37:57.000Z | 2022-03-17T12:53:24.000Z | tests/utils_test.py | isabella232/uis-rnn | 91764ceaad832be651f3d64a809a183e133154d6 | [
"Apache-2.0"
] | 87 | 2018-11-14T15:35:15.000Z | 2021-07-26T05:08:34.000Z | tests/utils_test.py | isabella232/uis-rnn | 91764ceaad832be651f3d64a809a183e133154d6 | [
"Apache-2.0"
] | 325 | 2018-10-30T21:36:42.000Z | 2022-03-29T12:43:46.000Z | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 39.532967 | 80 | 0.661015 | import unittest
import numpy as np
from uisrnn import utils
class TestEnforceClusterIdUniqueness(unittest.TestCase):
def test_list_of_list(self):
cluster_ids = [['a', 'b', 'c'], ['b', 'c', 'd', 'e']]
new_cluster_ids = utils.enforce_cluster_id_uniqueness(cluster_ids)
self.assertEqual(2, len(new_cluste... | true | true |
f76527fb867165a866fe68db4075daec1c23f351 | 1,575 | py | Python | lib/logs.py | jakerogerz/glazier | 10ee390e79c5fe65933a2699da851e27c03f8c60 | [
"Apache-2.0"
] | null | null | null | lib/logs.py | jakerogerz/glazier | 10ee390e79c5fe65933a2699da851e27c03f8c60 | [
"Apache-2.0"
] | null | null | null | lib/logs.py | jakerogerz/glazier | 10ee390e79c5fe65933a2699da851e27c03f8c60 | [
"Apache-2.0"
] | 1 | 2019-11-25T10:56:20.000Z | 2019-11-25T10:56:20.000Z | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 26.694915 | 74 | 0.720635 |
import logging
import logging.handlers
from glazier.lib import constants
class LogError(Exception):
pass
def GetLogsPath():
path = constants.SYS_LOGS_PATH
if constants.FLAGS.environment == 'WinPE':
path = constants.WINPE_LOGS_PATH
return path
def Setup():
log_file = '%s\\%s' % (GetLogsPath(), cons... | true | true |
f76528b9c283fd305cceb0b1771ff0d74be3c432 | 1,210 | py | Python | searches/fibonacci_search.py | stoneheart/Python | 313a043107bc4882623ad5524a96fbb099d0d161 | [
"MIT"
] | 5 | 2019-12-11T02:51:22.000Z | 2021-07-16T07:08:22.000Z | searches/fibonacci_search.py | Christian1026/Python | 179284a41bf265c59913b72d94bee47d7d6b7414 | [
"MIT"
] | null | null | null | searches/fibonacci_search.py | Christian1026/Python | 179284a41bf265c59913b72d94bee47d7d6b7414 | [
"MIT"
] | 1 | 2020-05-06T12:30:15.000Z | 2020-05-06T12:30:15.000Z | #run using python fibonacci_search.py -v
'''
@params
arr: input array
val: the value to be searched
output: the index of element in the array or -1 if not found
return 0 if input array is empty
'''
def fibonacci_search(arr, val):
"""
>>> fibonacci_search([1,6,7,0,0,0], 6)
1
>>> fibonacci_search([1,-1,... | 23.72549 | 64 | 0.542975 |
def fibonacci_search(arr, val):
fib_N_2 = 0
fib_N_1 = 1
fibNext = fib_N_1 + fib_N_2
length = len(arr)
if length == 0:
return 0
while (fibNext < len(arr)):
fib_N_2 = fib_N_1
fib_N_1 = fibNext
fibNext = fib_N_1 + fib_N_2
index = -1;
while (fibNext > 1):
... | true | true |
f76529ed0422e69792397fbb135692a74a9b2c0f | 22,870 | py | Python | tensorflow/python/distribute/parameter_server_strategy.py | satheeshxolo/tensorflow | 93082af9e866067d5383ec36c8d840b21d91a9f8 | [
"Apache-2.0"
] | 2 | 2019-09-10T17:53:52.000Z | 2021-01-26T10:27:44.000Z | tensorflow/python/distribute/parameter_server_strategy.py | satheeshxolo/tensorflow | 93082af9e866067d5383ec36c8d840b21d91a9f8 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/distribute/parameter_server_strategy.py | satheeshxolo/tensorflow | 93082af9e866067d5383ec36c8d840b21d91a9f8 | [
"Apache-2.0"
] | 1 | 2018-07-05T13:47:24.000Z | 2018-07-05T13:47:24.000Z | # Copyright 2018 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 required by applica... | 40.766488 | 81 | 0.717315 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
from tensorflow.python.distribute import cross_device_ops as cross_device_ops_lib
from tensorflow.python.distribute import device_util
from tensorflow.python.distribute import distribute_lib
from... | true | true |
f7652a0e9e11d8e99e974b23e0ac216c2a4924ec | 1,355 | py | Python | semi_final/noahsark/merge.py | YihaoChan/2021-Tianchi-GAIIC-Track1-Rank-3 | a79a8ae4bc0f8b2662f71df4caaa7fa382735f9f | [
"Apache-2.0"
] | 22 | 2021-06-04T13:01:08.000Z | 2022-02-18T13:19:46.000Z | semi_final/noahsark/merge.py | YihaoChan/2021-Tianchi-GAIIC-Track1-Rank-3 | a79a8ae4bc0f8b2662f71df4caaa7fa382735f9f | [
"Apache-2.0"
] | null | null | null | semi_final/noahsark/merge.py | YihaoChan/2021-Tianchi-GAIIC-Track1-Rank-3 | a79a8ae4bc0f8b2662f71df4caaa7fa382735f9f | [
"Apache-2.0"
] | 2 | 2021-06-06T09:41:08.000Z | 2021-06-09T01:05:10.000Z | # coding: utf-8
import pandas as pd
import numpy as np
def main():
nezha_result = pd.read_csv('./result_nezha.csv', header=None)
nezha_result.columns = ['report_ID', 'label']
dl_result = pd.read_csv('./result_dl.csv', header=None)
dl_result.columns = ['report_ID', 'label']
new_label_nezha = [i.s... | 27.653061 | 82 | 0.59631 | import pandas as pd
import numpy as np
def main():
nezha_result = pd.read_csv('./result_nezha.csv', header=None)
nezha_result.columns = ['report_ID', 'label']
dl_result = pd.read_csv('./result_dl.csv', header=None)
dl_result.columns = ['report_ID', 'label']
new_label_nezha = [i.strip('|').strip(... | true | true |
f7652a7cbcf1158fa8902be66ec75582ed2c1472 | 1,567 | py | Python | VTKviewer.py | Benjamin-Fouquet/Processing-scripts | 87415e8ca10abbf11b46f01a53edb48c57a8b68e | [
"MIT"
] | null | null | null | VTKviewer.py | Benjamin-Fouquet/Processing-scripts | 87415e8ca10abbf11b46f01a53edb48c57a8b68e | [
"MIT"
] | null | null | null | VTKviewer.py | Benjamin-Fouquet/Processing-scripts | 87415e8ca10abbf11b46f01a53edb48c57a8b68e | [
"MIT"
] | null | null | null | #!/bin/env python
"""
Simple VTK example in Python to load an STL mesh and display with a manipulator.
Chris Hodapp, 2014-01-28, (c) 2014
"""
import vtk
def render():
# Create a rendering window and renderer
ren = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren)
# Create a... | 28.490909 | 80 | 0.698149 |
import vtk
def render():
ren = vtk.vtkRenderer()
renWin = vtk.vtkRenderWindow()
renWin.AddRenderer(ren)
iren = vtk.vtkRenderWindowInteractor()
iren.SetRenderWindow(renWin)
style = vtk.vtkInteractorStyleTrackballCamera()
iren.SetInteractorStyle(style)
stlFilename = "magnolia.s... | true | true |
f7652ab48850cfcfddac8b9f2768486154b8e2e3 | 8,158 | py | Python | lxmls/labs/day3.py | khui/lxmls-toolkit | f1a2fb9aa46257b509c79e83182d7d5495061398 | [
"MIT"
] | null | null | null | lxmls/labs/day3.py | khui/lxmls-toolkit | f1a2fb9aa46257b509c79e83182d7d5495061398 | [
"MIT"
] | null | null | null | lxmls/labs/day3.py | khui/lxmls-toolkit | f1a2fb9aa46257b509c79e83182d7d5495061398 | [
"MIT"
] | 1 | 2020-01-09T17:02:50.000Z | 2020-01-09T17:02:50.000Z | import sys
sys.path.append('.')
import lxmls.sequences.crf_online as crfo
import lxmls.sequences.structured_perceptron as spc
import lxmls.readers.pos_corpus as pcc
import lxmls.sequences.id_feature as idfc
import lxmls.sequences.extended_feature as exfc
print "CRF Exercise"
corpus = pcc.PostagCorpus()
train_seq = ... | 37.081818 | 127 | 0.792474 | import sys
sys.path.append('.')
import lxmls.sequences.crf_online as crfo
import lxmls.sequences.structured_perceptron as spc
import lxmls.readers.pos_corpus as pcc
import lxmls.sequences.id_feature as idfc
import lxmls.sequences.extended_feature as exfc
print "CRF Exercise"
corpus = pcc.PostagCorpus()
train_seq = ... | false | true |
f7652bfd18b2ce5ad543a0342bee48175ce8e962 | 75,989 | py | Python | ktrain/core.py | vishalraj-95/ktrain | 26de7fb42f9e576e768a22f9e5984d7d134b6bf0 | [
"Apache-2.0"
] | null | null | null | ktrain/core.py | vishalraj-95/ktrain | 26de7fb42f9e576e768a22f9e5984d7d134b6bf0 | [
"Apache-2.0"
] | null | null | null | ktrain/core.py | vishalraj-95/ktrain | 26de7fb42f9e576e768a22f9e5984d7d134b6bf0 | [
"Apache-2.0"
] | null | null | null | from .imports import *
from .lroptimize.sgdr import *
from .lroptimize.triangular import *
from .lroptimize.lrfinder import *
from .lroptimize.optimization import AdamWeightDecay
from . import utils as U
from .vision.preprocessor import ImagePreprocessor
from .vision.predictor import ImagePredictor
from .text.preproc... | 44.41204 | 186 | 0.586756 | from .imports import *
from .lroptimize.sgdr import *
from .lroptimize.triangular import *
from .lroptimize.lrfinder import *
from .lroptimize.optimization import AdamWeightDecay
from . import utils as U
from .vision.preprocessor import ImagePreprocessor
from .vision.predictor import ImagePredictor
from .text.preproc... | true | true |
f7652ea48b327f87b9ad783156f2e2112b6437f8 | 10,675 | py | Python | cincanregistry/version_maintainer.py | cincanproject/cincan-registry | ec606acaf7920ce808398dbd0286a8ca8ea49928 | [
"MIT"
] | null | null | null | cincanregistry/version_maintainer.py | cincanproject/cincan-registry | ec606acaf7920ce808398dbd0286a8ca8ea49928 | [
"MIT"
] | null | null | null | cincanregistry/version_maintainer.py | cincanproject/cincan-registry | ec606acaf7920ce808398dbd0286a8ca8ea49928 | [
"MIT"
] | null | null | null | import asyncio
import json
import logging
import queue
from concurrent.futures import ThreadPoolExecutor
from datetime import datetime, timedelta
from typing import Dict, Tuple, List
from cincanregistry.models.tool_info import ToolInfo
from cincanregistry.models.version_info import VersionInfo, VersionType
from .check... | 40.283019 | 117 | 0.59082 | import asyncio
import json
import logging
import queue
from concurrent.futures import ThreadPoolExecutor
from datetime import datetime, timedelta
from typing import Dict, Tuple, List
from cincanregistry.models.tool_info import ToolInfo
from cincanregistry.models.version_info import VersionInfo, VersionType
from .check... | true | true |
f765300590ab093975abecc47ab2a7229c1b2403 | 111,555 | py | Python | tests/test_interpret_stmnt.py | rbarzic/PyCParser | 56e086b029011f1b15af1c19f1912203fef1990c | [
"BSD-2-Clause"
] | 289 | 2015-01-23T00:00:23.000Z | 2022-03-26T02:09:36.000Z | tests/test_interpret_stmnt.py | rbarzic/PyCParser | 56e086b029011f1b15af1c19f1912203fef1990c | [
"BSD-2-Clause"
] | 12 | 2015-12-04T08:15:37.000Z | 2021-09-16T18:22:24.000Z | tests/test_interpret_stmnt.py | rbarzic/PyCParser | 56e086b029011f1b15af1c19f1912203fef1990c | [
"BSD-2-Clause"
] | 26 | 2015-09-09T22:57:20.000Z | 2021-09-16T18:23:22.000Z |
from __future__ import print_function
import helpers_test
from cparser import *
from cparser.interpreter import *
from helpers_test import *
import ctypes
def test_interpret_c_cast():
state = parse("int f()\n { int v = (int) 42; return v; } \n")
interpreter = Interpreter()
interpreter.register(state)
... | 26.205074 | 98 | 0.580404 |
from __future__ import print_function
import helpers_test
from cparser import *
from cparser.interpreter import *
from helpers_test import *
import ctypes
def test_interpret_c_cast():
state = parse("int f()\n { int v = (int) 42; return v; } \n")
interpreter = Interpreter()
interpreter.register(state)
... | true | true |
f7653164d1c3715d24d6eefa92550c0fbe7e0677 | 1,163 | py | Python | lldb/packages/Python/lldbsuite/test/lang/cpp/function-qualifiers/TestCppFunctionQualifiers.py | medismailben/llvm-project | e334a839032fe500c3bba22bf976ab7af13ce1c1 | [
"Apache-2.0"
] | 2,338 | 2018-06-19T17:34:51.000Z | 2022-03-31T11:00:37.000Z | lldb/packages/Python/lldbsuite/test/lang/cpp/function-qualifiers/TestCppFunctionQualifiers.py | medismailben/llvm-project | e334a839032fe500c3bba22bf976ab7af13ce1c1 | [
"Apache-2.0"
] | 3,740 | 2019-01-23T15:36:48.000Z | 2022-03-31T22:01:13.000Z | lldb/packages/Python/lldbsuite/test/lang/cpp/function-qualifiers/TestCppFunctionQualifiers.py | medismailben/llvm-project | e334a839032fe500c3bba22bf976ab7af13ce1c1 | [
"Apache-2.0"
] | 500 | 2019-01-23T07:49:22.000Z | 2022-03-30T02:59:37.000Z | import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
def test(self):
self.build()
lldbutil.run_to_source_breakpoint(self,"// break here", lldb.SBFileSpec... | 44.730769 | 128 | 0.693035 | import lldb
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
class TestCase(TestBase):
mydir = TestBase.compute_mydir(__file__)
def test(self):
self.build()
lldbutil.run_to_source_breakpoint(self,"// break here", lldb.SBFileSpec... | true | true |
f7653171b795899de08400a1ad2e13fd1710a9b4 | 784 | py | Python | matplotlib_examples/examples_src/style_sheets/plot_fivethirtyeight.py | xzlmark/webspider | 133c620c65aa45abea1718b0dada09618c2115bf | [
"Apache-2.0"
] | 3 | 2020-04-09T02:35:26.000Z | 2021-02-27T17:00:21.000Z | matplotlib_examples/examples_src/style_sheets/plot_fivethirtyeight.py | colorworlds/webspider | 133c620c65aa45abea1718b0dada09618c2115bf | [
"Apache-2.0"
] | null | null | null | matplotlib_examples/examples_src/style_sheets/plot_fivethirtyeight.py | colorworlds/webspider | 133c620c65aa45abea1718b0dada09618c2115bf | [
"Apache-2.0"
] | 1 | 2020-04-09T02:35:08.000Z | 2020-04-09T02:35:08.000Z | """
===========================
FiveThirtyEight style sheet
===========================
This shows an example of the "fivethirtyeight" styling, which
tries to replicate the styles from FiveThirtyEight.com.
"""
from matplotlib import pyplot as plt
import numpy as np
plt.style.use('fivethirtyeight')
x = np.linspace(... | 24.5 | 61 | 0.639031 |
from matplotlib import pyplot as plt
import numpy as np
plt.style.use('fivethirtyeight')
x = np.linspace(0, 10)
np.random.seed(19680801)
fig, ax = plt.subplots()
ax.plot(x, np.sin(x) + x + np.random.randn(50))
ax.plot(x, np.sin(x) + 0.5 * x + np.random.randn(50))
ax.plot(x, np.sin(x) + 2 * x + np.random.randn(50... | true | true |
f76532a3ba60289bffec17a68d7f6a84736a7d4e | 51,484 | py | Python | public/detection/models/loss.py | uvipen/pytorch-ImageNet-CIFAR-COCO-VOC-training | 87549fd4bff3b17b1716a248a115112ee8d05e4d | [
"MIT"
] | 1 | 2020-09-16T14:27:19.000Z | 2020-09-16T14:27:19.000Z | public/detection/models/loss.py | uvipen/pytorch-ImageNet-CIFAR-COCO-VOC-training | 87549fd4bff3b17b1716a248a115112ee8d05e4d | [
"MIT"
] | null | null | null | public/detection/models/loss.py | uvipen/pytorch-ImageNet-CIFAR-COCO-VOC-training | 87549fd4bff3b17b1716a248a115112ee8d05e4d | [
"MIT"
] | null | null | null | import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
class RetinaLoss(nn.Module):
def __init__(self,
image_w,
image_h,
alpha=0.25,
gamma=2,
beta=1.0 / 9.0,
epsilon=1e... | 49.266986 | 182 | 0.556639 | import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
class RetinaLoss(nn.Module):
def __init__(self,
image_w,
image_h,
alpha=0.25,
gamma=2,
beta=1.0 / 9.0,
epsilon=1e... | true | true |
f765333f650696438ab85cafabae94d463263ca0 | 5,739 | py | Python | restapi/urls.py | leo-lee-4231/hummer | 0b3505c4124b1d40ba3b301951e910d278fb7022 | [
"Apache-2.0"
] | 12 | 2015-10-12T06:42:53.000Z | 2021-11-23T06:54:29.000Z | restapi/urls.py | leo-lee-4231/hummer | 0b3505c4124b1d40ba3b301951e910d278fb7022 | [
"Apache-2.0"
] | 4 | 2016-05-29T07:46:54.000Z | 2021-06-10T17:51:01.000Z | restapi/urls.py | leo-lee-4231/hummer | 0b3505c4124b1d40ba3b301951e910d278fb7022 | [
"Apache-2.0"
] | 12 | 2016-05-25T06:11:25.000Z | 2020-01-07T11:43:35.000Z | from django.conf.urls import include, url
from rest_framework import routers
from restapi.views import (UserViewSet, ProjectViewSet, ImageViewSet,
ApplicationViewSet, PortViewSet, ResourceLimitViewSet, VolumeViewSet,
is_authenticated, create_image, upload_volume, list_hosts,
AutoScalerViewSet, EnvironmentVi... | 30.68984 | 140 | 0.652553 | from django.conf.urls import include, url
from rest_framework import routers
from restapi.views import (UserViewSet, ProjectViewSet, ImageViewSet,
ApplicationViewSet, PortViewSet, ResourceLimitViewSet, VolumeViewSet,
is_authenticated, create_image, upload_volume, list_hosts,
AutoScalerViewSet, EnvironmentVi... | true | true |
f76533feb0d391126bbb531755203d4f990e4d47 | 2,670 | py | Python | circle_core/web/api/replication_links.py | glucoseinc/CircleCore | 577f814ce2944efb6e5997f3d7838c71ce9aea6a | [
"MIT"
] | 3 | 2019-01-11T04:30:18.000Z | 2019-01-11T04:31:18.000Z | circle_core/web/api/replication_links.py | glucoseinc/CircleCore | 577f814ce2944efb6e5997f3d7838c71ce9aea6a | [
"MIT"
] | 16 | 2018-11-21T11:47:18.000Z | 2021-09-01T03:52:35.000Z | circle_core/web/api/replication_links.py | glucoseinc/CircleCore | 577f814ce2944efb6e5997f3d7838c71ce9aea6a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""共有リンク関連APIの実装."""
# community module
from flask import abort, request
# project module
from circle_core.models import MetaDataSession, ReplicationLink
from .api import api
from .utils import respond_failure, respond_success
from ..utils import (oauth_require_read_schema_scope, oauth_requir... | 27.8125 | 113 | 0.72809 |
from flask import abort, request
from circle_core.models import MetaDataSession, ReplicationLink
from .api import api
from .utils import respond_failure, respond_success
from ..utils import (oauth_require_read_schema_scope, oauth_require_write_schema_scope)
@api.route('/replicas/', methods=['GET', 'POST'])
def api... | true | true |
f765356aa3a58272836933c7f3b4fbd0f206c306 | 8,352 | py | Python | helpers.py | bandang0/astro_reduce | d499daa071ab9e20086522e81f7d7f049e9e9268 | [
"MIT"
] | null | null | null | helpers.py | bandang0/astro_reduce | d499daa071ab9e20086522e81f7d7f049e9e9268 | [
"MIT"
] | null | null | null | helpers.py | bandang0/astro_reduce | d499daa071ab9e20086522e81f7d7f049e9e9268 | [
"MIT"
] | 1 | 2022-03-07T14:26:05.000Z | 2022-03-07T14:26:05.000Z | '''helpers module for astro_reduce -- UI constants and handy functions.'''
from hashlib import md5
from json import dump
from os.path import basename
from re import sub
import click
import matplotlib.colors as colors
import numpy as np
from astropy.io import fits
from astropy.visualization import ImageNormalize, ZSca... | 34.945607 | 80 | 0.640086 |
from hashlib import md5
from json import dump
from os.path import basename
from re import sub
import click
import matplotlib.colors as colors
import numpy as np
from astropy.io import fits
from astropy.visualization import ImageNormalize, ZScaleInterval
import astropy.units as u
from astropy.coordinates import SkyCoo... | true | true |
f765356ee83d74771552d8e093944bf20e3a8b60 | 5,727 | py | Python | Class Files/Lab 5/pca_sst.py | sjfreed21/DataAnalysis | b4b852e2faca6633161513ecbfc4295068a6cd78 | [
"Apache-2.0"
] | null | null | null | Class Files/Lab 5/pca_sst.py | sjfreed21/DataAnalysis | b4b852e2faca6633161513ecbfc4295068a6cd78 | [
"Apache-2.0"
] | null | null | null | Class Files/Lab 5/pca_sst.py | sjfreed21/DataAnalysis | b4b852e2faca6633161513ecbfc4295068a6cd78 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Sun Nov 15 11:01:01 2020
In this notebook I give a very simple (and rather uncommented) example of
how to use scikit-learn to perform an Empirical Orthogonal Function
decomposition (EOF analysis, often referred to as well as Principal
Component Analysi... | 26.270642 | 110 | 0.657936 |
import pandas as pd
import numpy as np
from numpy import ma
from matplotlib import pyplot as plt
import xarray as xr
import cartopy.crs as ccrs
import cartopy.feature as cfeature
from metpy.plots import colortables
wdir='/Users/sjfre/Documents/DataAnalysis/Class Files/Lab 5/'
dset = xr.open_dataset(wdir+'ss... | true | true |
f76535cf7744373a441c637bd653638c297df12b | 506 | py | Python | app.py | discoposse/cloud-native-python-example-app | a8bbb4f77c2a8678fd65336cdd60ea881dbe919f | [
"Apache-2.0"
] | 2 | 2021-12-23T16:02:34.000Z | 2022-01-28T23:07:47.000Z | app.py | discoposse/cloud-native-python-example-app | a8bbb4f77c2a8678fd65336cdd60ea881dbe919f | [
"Apache-2.0"
] | null | null | null | app.py | discoposse/cloud-native-python-example-app | a8bbb4f77c2a8678fd65336cdd60ea881dbe919f | [
"Apache-2.0"
] | 4 | 2021-09-05T15:19:32.000Z | 2022-01-31T21:39:46.000Z | from flask import Flask
from flask import Response
from flask import render_template
app = Flask(__name__)
@app.route('/')
def index():
#return render_template("index.html")
return "<h2>This works, which is surprising sometimes. Now with 140% more DevOps!</h2>"
@app.route("/healthz")
def healthz():
re... | 22 | 91 | 0.677866 | from flask import Flask
from flask import Response
from flask import render_template
app = Flask(__name__)
@app.route('/')
def index():
return "<h2>This works, which is surprising sometimes. Now with 140% more DevOps!</h2>"
@app.route("/healthz")
def healthz():
resp = Response("ok")
resp.headers['... | true | true |
f76535d0a159df7ec1587dd39bd7bb8447f86bd0 | 390 | py | Python | data/parse.py | manhcuogntin4/Faster-RCNN | 3f96af624ae627c26b15a72f1667c6e2d0fac363 | [
"BSD-2-Clause"
] | 4 | 2017-05-23T04:12:00.000Z | 2018-10-18T11:28:05.000Z | data/parse.py | manhcuogntin4/Faster-RCNN | 3f96af624ae627c26b15a72f1667c6e2d0fac363 | [
"BSD-2-Clause"
] | null | null | null | data/parse.py | manhcuogntin4/Faster-RCNN | 3f96af624ae627c26b15a72f1667c6e2d0fac363 | [
"BSD-2-Clause"
] | null | null | null | import re
import os
def load_inria_annotations(index):
filename = os.path.join('Annotations', index + '.txt')
with open(filename) as f:
data = f.read()
objs = re.findall('\(\d+, \d+\)[\s\-]+\(\d+, \d+\)', data)
num_objs = len(objs)
return objs
if __name__ == '__main__':
files = ['1', '... | 24.375 | 62 | 0.584615 | import re
import os
def load_inria_annotations(index):
filename = os.path.join('Annotations', index + '.txt')
with open(filename) as f:
data = f.read()
objs = re.findall('\(\d+, \d+\)[\s\-]+\(\d+, \d+\)', data)
num_objs = len(objs)
return objs
if __name__ == '__main__':
files = ['1', '... | false | true |
f7653604e822b21297909329f0ed462f32e0edc9 | 9,952 | py | Python | Tools/scripts/generate_global_objects.py | ErikBjare/cpython | b68431fadb3150134ac6ccbf501cdfeaf4c75678 | [
"0BSD"
] | 1 | 2022-03-25T21:53:34.000Z | 2022-03-25T21:53:34.000Z | Tools/scripts/generate_global_objects.py | dalakatt/cpython | 2f49b97cc5426087b46515254b9a97a22ee8c807 | [
"0BSD"
] | 4 | 2022-03-30T08:54:56.000Z | 2022-03-30T08:55:07.000Z | Tools/scripts/generate_global_objects.py | dalakatt/cpython | 2f49b97cc5426087b46515254b9a97a22ee8c807 | [
"0BSD"
] | 1 | 2022-03-24T19:52:47.000Z | 2022-03-24T19:52:47.000Z | import contextlib
import glob
import io
import os.path
import re
import sys
__file__ = os.path.abspath(__file__)
ROOT = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
INTERNAL = os.path.join(ROOT, 'Include', 'internal')
STRING_LITERALS = {
'empty': '',
'dot': '.',
}
IGNORED = {
'ACTION', #... | 30.811146 | 98 | 0.561395 | import contextlib
import glob
import io
import os.path
import re
import sys
__file__ = os.path.abspath(__file__)
ROOT = os.path.dirname(os.path.dirname(os.path.dirname(__file__)))
INTERNAL = os.path.join(ROOT, 'Include', 'internal')
STRING_LITERALS = {
'empty': '',
'dot': '.',
}
IGNORED = {
'ACTION', ... | true | true |
f765373084183d4a5dee7007fbd3a133de16927b | 1,053 | py | Python | code/utils.py | patchloc/VulnLoc | c7a7d4dac092e3b6302aa8a954518a3348d51d3e | [
"MIT"
] | 8 | 2021-06-08T11:41:59.000Z | 2021-07-08T02:49:45.000Z | code/utils.py | patchloc/VulnLoc | c7a7d4dac092e3b6302aa8a954518a3348d51d3e | [
"MIT"
] | null | null | null | code/utils.py | patchloc/VulnLoc | c7a7d4dac092e3b6302aa8a954518a3348d51d3e | [
"MIT"
] | 1 | 2021-09-12T14:37:59.000Z | 2021-09-12T14:37:59.000Z | import pickle
import string
import numpy as np
import multiprocessing
# system setup
ProcessNum=np.min((10, multiprocessing.cpu_count()))
# Used for generating the random filename
FileNameChars = list(string.letters + string.digits)
FileNameLen = 30
'''
Process the binary file
'''
def read_bin(path):
with open(path... | 18.155172 | 61 | 0.700855 | import pickle
import string
import numpy as np
import multiprocessing
ProcessNum=np.min((10, multiprocessing.cpu_count()))
FileNameChars = list(string.letters + string.digits)
FileNameLen = 30
def read_bin(path):
with open(path, 'rb') as f:
temp = f.readlines()
temp = ''.join(temp)
content = [ord(i) for i in te... | true | true |
f76538d8290c823271d5cebe3eed122bf01a81ae | 781 | py | Python | obras_sociales/migrations/0006_auto_20200721_1001.py | cluster311/ggg | 262173c66fe40ada30083d439a79f16f841f5772 | [
"BSD-3-Clause"
] | 6 | 2020-03-16T02:51:16.000Z | 2020-11-10T00:58:01.000Z | obras_sociales/migrations/0006_auto_20200721_1001.py | cluster311/ggg | 262173c66fe40ada30083d439a79f16f841f5772 | [
"BSD-3-Clause"
] | 204 | 2019-09-19T02:00:57.000Z | 2022-02-10T10:48:52.000Z | obras_sociales/migrations/0006_auto_20200721_1001.py | cluster311/ggg | 262173c66fe40ada30083d439a79f16f841f5772 | [
"BSD-3-Clause"
] | 3 | 2019-09-16T22:59:24.000Z | 2022-03-21T22:52:44.000Z | # Generated by Django 2.2.10 on 2020-07-21 13:01
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('obras_sociales', '0005_auto_20200426_1155'),
]
operations = [
migrations.AddField(
model_name='obrasocialpaciente',
... | 32.541667 | 161 | 0.605634 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('obras_sociales', '0005_auto_20200426_1155'),
]
operations = [
migrations.AddField(
model_name='obrasocialpaciente',
name='parentesco',
field=models.Char... | true | true |
f7653944f1704af5ef93571accb5908780ac8bf8 | 2,090 | py | Python | tensorflow/python/ops/distributions/distributions.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/ops/distributions/distributions.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/ops/distributions/distributions.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 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 required by... | 50.97561 | 93 | 0.774163 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from tensorflow.python.util import deprecation
with deprecation.silence():
from tensorflow.python.ops.distributions.bernoulli import Bernoulli
from tensorflow.python.ops.distributions.beta import... | true | true |
f7653984afca263dec63b1e831818b231b5529c1 | 267 | py | Python | tests/aoc/test_d14.py | klittlepage/aoc2020 | 7135ac08263480a8cc9d6536d7caeb26bf85ae4f | [
"MIT"
] | null | null | null | tests/aoc/test_d14.py | klittlepage/aoc2020 | 7135ac08263480a8cc9d6536d7caeb26bf85ae4f | [
"MIT"
] | null | null | null | tests/aoc/test_d14.py | klittlepage/aoc2020 | 7135ac08263480a8cc9d6536d7caeb26bf85ae4f | [
"MIT"
] | null | null | null | import aoc.d14
from tests.aoc.test_base import BaseTestCase
class TestAll(BaseTestCase):
def test_part_one(self):
self.run_aoc_part(14, 5902420735773, aoc.d14.p_1)
def test_part_two(self):
self.run_aoc_part(14, 3801988250775, aoc.d14.p_2)
| 22.25 | 57 | 0.730337 | import aoc.d14
from tests.aoc.test_base import BaseTestCase
class TestAll(BaseTestCase):
def test_part_one(self):
self.run_aoc_part(14, 5902420735773, aoc.d14.p_1)
def test_part_two(self):
self.run_aoc_part(14, 3801988250775, aoc.d14.p_2)
| true | true |
f76539aaba03a5259fe6c4456fdf60d9720c7b5a | 530 | py | Python | test/pyaz/maps/map/__init__.py | bigdatamoore/py-az-cli | 54383a4ee7cc77556f6183e74e992eec95b28e01 | [
"MIT"
] | null | null | null | test/pyaz/maps/map/__init__.py | bigdatamoore/py-az-cli | 54383a4ee7cc77556f6183e74e992eec95b28e01 | [
"MIT"
] | 9 | 2021-09-24T16:37:24.000Z | 2021-12-24T00:39:19.000Z | test/pyaz/maps/map/__init__.py | bigdatamoore/py-az-cli | 54383a4ee7cc77556f6183e74e992eec95b28e01 | [
"MIT"
] | null | null | null | import json, subprocess
from ... pyaz_utils import get_cli_name, get_params
def list_operation():
params = get_params(locals())
command = "az maps map list-operation " + params
print(command)
output = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout = ... | 29.444444 | 96 | 0.667925 | import json, subprocess
from ... pyaz_utils import get_cli_name, get_params
def list_operation():
params = get_params(locals())
command = "az maps map list-operation " + params
print(command)
output = subprocess.run(command, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout = ... | true | true |
f76539e56b76265b064e776f3858994b3bdf7464 | 12,871 | py | Python | custom/icds/location_reassignment/views.py | tobiasmcnulty/commcare-hq | 234aa1fba98a96de1b625bbd70b2066fc877eed1 | [
"BSD-3-Clause"
] | 1 | 2020-07-14T13:00:23.000Z | 2020-07-14T13:00:23.000Z | custom/icds/location_reassignment/views.py | tobiasmcnulty/commcare-hq | 234aa1fba98a96de1b625bbd70b2066fc877eed1 | [
"BSD-3-Clause"
] | null | null | null | custom/icds/location_reassignment/views.py | tobiasmcnulty/commcare-hq | 234aa1fba98a96de1b625bbd70b2066fc877eed1 | [
"BSD-3-Clause"
] | null | null | null | from datetime import datetime
from django.contrib import messages
from django.http import Http404, HttpResponse, HttpResponseRedirect
from django.urls import reverse
from django.utils.decorators import method_decorator
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_laz... | 47.14652 | 106 | 0.713231 | from datetime import datetime
from django.contrib import messages
from django.http import Http404, HttpResponse, HttpResponseRedirect
from django.urls import reverse
from django.utils.decorators import method_decorator
from django.utils.translation import ugettext as _
from django.utils.translation import ugettext_laz... | true | true |
f7653b201c3d8e0605d0ba87e550c5a1a27ae4d1 | 10,307 | py | Python | freqpattmin/aprioriPartition.py | xinbian/freqPattMin | fe257c80bf84a9020d5ca29941145eebed87a3ce | [
"MIT"
] | null | null | null | freqpattmin/aprioriPartition.py | xinbian/freqPattMin | fe257c80bf84a9020d5ca29941145eebed87a3ce | [
"MIT"
] | null | null | null | freqpattmin/aprioriPartition.py | xinbian/freqPattMin | fe257c80bf84a9020d5ca29941145eebed87a3ce | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Mon Oct 16 21:26:27 2017
@author: Xin
"""
# -*- coding: utf-8 -*-
"""Main module."""
import pandas as pd
import csv
import time
import itertools
import math
import json
#initialization class
class Init:
def __init__(self, filename):
self.file... | 34.129139 | 108 | 0.518192 | """
Created on Mon Oct 16 21:26:27 2017
@author: Xin
"""
"""Main module."""
import pandas as pd
import csv
import time
import itertools
import math
import json
class Init:
def __init__(self, filename):
self.filename = filename
self.data = []
def DataPD(self):
data = pd.read_csv(s... | false | true |
f7653bfed5ef0e93b6dbe6163475da3ded2c6b67 | 54,914 | py | Python | WF-NTP/gui.py | zofkam/mask_rcnn_motility | 0c2b27252d207c28f455e727f7d9ad66c864185c | [
"Unlicense",
"MIT"
] | null | null | null | WF-NTP/gui.py | zofkam/mask_rcnn_motility | 0c2b27252d207c28f455e727f7d9ad66c864185c | [
"Unlicense",
"MIT"
] | null | null | null | WF-NTP/gui.py | zofkam/mask_rcnn_motility | 0c2b27252d207c28f455e727f7d9ad66c864185c | [
"Unlicense",
"MIT"
] | null | null | null | import Tkinter as tk
import ttk
import tkFileDialog
import tkMessageBox
import tkSimpleDialog
import cv2
import cv2.cv as cv
import os
import multiprocessing
import matplotlib
matplotlib.use('TkAgg')
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
from matplotlib.backend_bases import key_press_handler
f... | 40.79792 | 173 | 0.57011 | import Tkinter as tk
import ttk
import tkFileDialog
import tkMessageBox
import tkSimpleDialog
import cv2
import cv2.cv as cv
import os
import multiprocessing
import matplotlib
matplotlib.use('TkAgg')
from matplotlib.backends.backend_tkagg import FigureCanvasTkAgg
from matplotlib.backend_bases import key_press_handler
f... | false | true |
f7653c69822e52446e7f0eaa474a140cbc248450 | 426 | py | Python | apps/cmdb/serializers/label_serializer.py | lovebirdegg/nnms-server | 9fd4563ccca9f29add375d346cdd1c2dd636c512 | [
"MIT"
] | null | null | null | apps/cmdb/serializers/label_serializer.py | lovebirdegg/nnms-server | 9fd4563ccca9f29add375d346cdd1c2dd636c512 | [
"MIT"
] | null | null | null | apps/cmdb/serializers/label_serializer.py | lovebirdegg/nnms-server | 9fd4563ccca9f29add375d346cdd1c2dd636c512 | [
"MIT"
] | null | null | null | # @Time : 2019/4/24 22:34
# @Author : xufqing
from rest_framework import serializers
from ..models import Label
from ..models import DeviceInfo
class LabelSerializer(serializers.ModelSerializer):
'''
标签序列化
'''
hosts = serializers.PrimaryKeyRelatedField(many=True, required=False, queryset=DeviceInf... | 28.4 | 133 | 0.704225 | from rest_framework import serializers
from ..models import Label
from ..models import DeviceInfo
class LabelSerializer(serializers.ModelSerializer):
hosts = serializers.PrimaryKeyRelatedField(many=True, required=False, queryset=DeviceInfo.objects.all(), source='deviceinfo_set')
class Meta:
model = La... | true | true |
f7653c8ef85c59cde313669857240f1239d214bc | 10,683 | py | Python | numpy/lib/tests/test_type_check.py | numpy/numpy-refactor | 6de313865ec3f49bcdd06ccbc879f27e65acf818 | [
"BSD-3-Clause"
] | 15 | 2015-03-23T09:40:07.000Z | 2020-04-19T15:14:49.000Z | numpy/lib/tests/test_type_check.py | jasonmccampbell/numpy-refactor-sprint | f4eb215d2e5c5a37c0c2f279f506abc242dbb38b | [
"BSD-3-Clause"
] | 5 | 2016-07-02T15:34:00.000Z | 2020-09-01T06:45:13.000Z | numpy/lib/tests/test_type_check.py | jasonmccampbell/numpy-refactor-sprint | f4eb215d2e5c5a37c0c2f279f506abc242dbb38b | [
"BSD-3-Clause"
] | 17 | 2015-02-12T21:33:40.000Z | 2021-02-23T06:53:03.000Z | from numpy.testing import *
from numpy.lib import *
from numpy.core import *
from numpy.compat import asbytes
def assert_all(x):
assert(all(x)), x
class TestCommonType(TestCase):
def test_basic(self):
ai32 = array([[1,2],[3,4]], dtype=int32)
af32 = array([[1,2],[3,4]], dtype=float32)
... | 27.462725 | 70 | 0.558832 | from numpy.testing import *
from numpy.lib import *
from numpy.core import *
from numpy.compat import asbytes
def assert_all(x):
assert(all(x)), x
class TestCommonType(TestCase):
def test_basic(self):
ai32 = array([[1,2],[3,4]], dtype=int32)
af32 = array([[1,2],[3,4]], dtype=float32)
... | false | true |
f7653ca90434318d84692534b39ad971d0f07119 | 74 | py | Python | common/determined_common/schemas/expconf/__init__.py | hexieshenghuo/determined | 1e0948d89373ac26e3134c94591114c0951090d6 | [
"Apache-2.0"
] | 1 | 2021-03-29T04:25:27.000Z | 2021-03-29T04:25:27.000Z | common/determined_common/schemas/expconf/__init__.py | hexieshenghuo/determined | 1e0948d89373ac26e3134c94591114c0951090d6 | [
"Apache-2.0"
] | null | null | null | common/determined_common/schemas/expconf/__init__.py | hexieshenghuo/determined | 1e0948d89373ac26e3134c94591114c0951090d6 | [
"Apache-2.0"
] | null | null | null | from determined_common.schemas.expconf._validate import validation_errors
| 37 | 73 | 0.905405 | from determined_common.schemas.expconf._validate import validation_errors
| true | true |
f7653ccfd12ebee8a741fc4224dce65d989c77a5 | 19,252 | py | Python | Experiment_2/Exp2_DotMotion.py | StefHerregods/ConfidenceBounds | 5399647aecf46bf4adee047cbee2b883ac5f14a2 | [
"MIT"
] | null | null | null | Experiment_2/Exp2_DotMotion.py | StefHerregods/ConfidenceBounds | 5399647aecf46bf4adee047cbee2b883ac5f14a2 | [
"MIT"
] | null | null | null | Experiment_2/Exp2_DotMotion.py | StefHerregods/ConfidenceBounds | 5399647aecf46bf4adee047cbee2b883ac5f14a2 | [
"MIT"
] | null | null | null | # november 2021
# Internship project: Confidence bounds
# RANDOM DOT MOTION TASK (variant with 6 confidence options)
# (Does the majority of dots move left or right? How confident are you about your choice?)
# Participants complete multiple blocks of consecutive dot motion trials
# 3 training blocks with increasing co... | 40.530526 | 120 | 0.571265 |
from psychopy import visual as vis
from psychopy import event, core, gui, data
import os
import random
import numpy as np
from time import sleep
pilot = 0
nb_training_trials = 24 nb_main_trials = 60 nb_main_blocks = 12
min_accuracy_1 = 0.85 p_coherence_1 = 0.5
min_accuracy_2 = 0.6
p_coherence_a = 0.10 p_... | true | true |
f7653ce63c406d46d0d8afcc81d825c4d07872cc | 4,097 | py | Python | Views/StackOverflowManagementView.py | shaun-h/PyDoc | 7999d9c97478164eaccc67ca2b023d6afb2da973 | [
"MIT"
] | 21 | 2017-05-19T05:47:27.000Z | 2021-12-11T17:04:48.000Z | Views/StackOverflowManagementView.py | shaun-h/PyDoc | 7999d9c97478164eaccc67ca2b023d6afb2da973 | [
"MIT"
] | null | null | null | Views/StackOverflowManagementView.py | shaun-h/PyDoc | 7999d9c97478164eaccc67ca2b023d6afb2da973 | [
"MIT"
] | 7 | 2017-05-19T06:12:47.000Z | 2020-08-17T19:19:33.000Z | import ui
class StackOverflowManagementView (object):
def __init__(self, download_action, refresh_main_view, delete_action, refresh_stackoverflow_action, theme_manager):
self.data = []
self.delete_action = delete_action
self.download_action = download_action
self.refresh_main_view = refresh_main_view
self.r... | 33.859504 | 131 | 0.747132 | import ui
class StackOverflowManagementView (object):
def __init__(self, download_action, refresh_main_view, delete_action, refresh_stackoverflow_action, theme_manager):
self.data = []
self.delete_action = delete_action
self.download_action = download_action
self.refresh_main_view = refresh_main_view
self.r... | true | true |
f7653d62f4f8a506c04e55e211be5d6d466c8c54 | 2,079 | py | Python | qhub/cli/deploy.py | pierrotsmnrd/qhub | 399684c79f331923444b4fe46fae38ee02bfa2ac | [
"BSD-3-Clause"
] | 100 | 2020-05-06T14:36:51.000Z | 2022-03-31T20:09:29.000Z | qhub/cli/deploy.py | pierrotsmnrd/qhub | 399684c79f331923444b4fe46fae38ee02bfa2ac | [
"BSD-3-Clause"
] | 778 | 2020-04-08T06:28:29.000Z | 2022-03-31T21:32:08.000Z | qhub/cli/deploy.py | pierrotsmnrd/qhub | 399684c79f331923444b4fe46fae38ee02bfa2ac | [
"BSD-3-Clause"
] | 36 | 2020-08-19T21:03:32.000Z | 2022-03-18T17:04:50.000Z | import pathlib
import logging
from ruamel import yaml
from qhub.deploy import deploy_configuration
from qhub.schema import verify
from qhub.render import render_template
logger = logging.getLogger(__name__)
def create_deploy_subcommand(subparser):
subparser = subparser.add_parser("deploy")
subparser.add_ar... | 30.130435 | 149 | 0.679654 | import pathlib
import logging
from ruamel import yaml
from qhub.deploy import deploy_configuration
from qhub.schema import verify
from qhub.render import render_template
logger = logging.getLogger(__name__)
def create_deploy_subcommand(subparser):
subparser = subparser.add_parser("deploy")
subparser.add_ar... | true | true |
f7653eecee938002314f53f43a1fd7f59f14603b | 5,351 | py | Python | test/functional/wallet_hd.py | rishabhworking/colombo | ce34132a1647677a691ce66110d5208f47d62f18 | [
"MIT"
] | 1 | 2019-10-21T16:07:05.000Z | 2019-10-21T16:07:05.000Z | test/functional/wallet_hd.py | rishabhworking/colombo | ce34132a1647677a691ce66110d5208f47d62f18 | [
"MIT"
] | 1 | 2019-11-24T12:14:53.000Z | 2019-11-24T12:33:07.000Z | test/functional/wallet_hd.py | rishabhworking/colombo | ce34132a1647677a691ce66110d5208f47d62f18 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2018 The Bitcoin Core developers
# Copyright (c) 2017 The Raven Core developers
# Copyright (c) 2018 The Colombo Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test Hierarc... | 42.468254 | 105 | 0.64829 |
from test_framework.test_framework import ColomboTestFramework
from test_framework.util import (
assert_equal,
connect_nodes_bi,
)
import shutil
import os
class WalletHDTest(ColomboTestFramework):
def set_test_params(self):
self.setup_clean_chain = True
self.num_nodes = 2
self.extr... | true | true |
f7653f5e954384454957b7985179db6a804e4289 | 1,078 | py | Python | reranker/bleu.py | wangka11/wordAlignment | 22ffab3b42e5ef37f4afae7aca3d7d8ee44ad550 | [
"MIT"
] | 22 | 2015-02-04T07:03:14.000Z | 2021-09-06T16:17:03.000Z | reranker/bleu.py | wangka11/wordAlignment | 22ffab3b42e5ef37f4afae7aca3d7d8ee44ad550 | [
"MIT"
] | null | null | null | reranker/bleu.py | wangka11/wordAlignment | 22ffab3b42e5ef37f4afae7aca3d7d8ee44ad550 | [
"MIT"
] | 14 | 2015-02-22T17:44:14.000Z | 2021-09-06T16:17:06.000Z | import math
from collections import Counter
# Collect BLEU-relevant statistics for a single hypothesis/reference pair.
# Return value is a generator yielding:
# (c, r, numerator1, denominator1, ... numerator4, denominator4)
# Summing the columns across calls to this function on an entire corpus will
# produce a vector... | 41.461538 | 90 | 0.705009 | import math
from collections import Counter
def bleu_stats(hypothesis, reference):
yield len(hypothesis)
yield len(reference)
for n in xrange(1,5):
s_ngrams = Counter([tuple(hypothesis[i:i+n]) for i in xrange(len(hypothesis)+1-n)])
r_ngrams = Counter([tuple(reference[i:i+n]) for i in xrange(len(reference... | true | true |
f7653f92ade8d7da3ea7cbb89dd8526f8cab2beb | 726 | py | Python | joulescope/paths.py | rnestler/pyjoulescope | b9eff73d2236e05d5c3631dbd112c1ef54854005 | [
"Apache-2.0"
] | null | null | null | joulescope/paths.py | rnestler/pyjoulescope | b9eff73d2236e05d5c3631dbd112c1ef54854005 | [
"Apache-2.0"
] | null | null | null | joulescope/paths.py | rnestler/pyjoulescope | b9eff73d2236e05d5c3631dbd112c1ef54854005 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018-2019 Jetperch LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 34.571429 | 74 | 0.763085 |
import os
import pathlib
MYPATH = os.path.dirname(os.path.abspath(__file__))
JOULESCOPE_DIR = os.path.join(pathlib.Path.home(), 'joulescope')
| true | true |
f76540513ad1955e537460458c75ecdf7316c9b0 | 9,123 | py | Python | configs/transfusion_nusc_voxel_LC.py | XuyangBai/mmdetection3d | 53370467c1b88f163cbe7b7300a1f588a6761e35 | [
"Apache-2.0"
] | 109 | 2022-03-23T01:11:06.000Z | 2022-03-31T17:12:32.000Z | configs/transfusion_nusc_voxel_LC.py | XuyangBai/mmdetection3d | 53370467c1b88f163cbe7b7300a1f588a6761e35 | [
"Apache-2.0"
] | null | null | null | configs/transfusion_nusc_voxel_LC.py | XuyangBai/mmdetection3d | 53370467c1b88f163cbe7b7300a1f588a6761e35 | [
"Apache-2.0"
] | 10 | 2022-03-23T08:17:46.000Z | 2022-03-30T09:37:27.000Z | point_cloud_range = [-54.0, -54.0, -5.0, 54.0, 54.0, 3.0]
class_names = [
'car', 'truck', 'construction_vehicle', 'bus', 'trailer', 'barrier',
'motorcycle', 'bicycle', 'pedestrian', 'traffic_cone'
]
voxel_size = [0.075, 0.075, 0.2]
out_size_factor = 8
evaluation = dict(interval=1)
dataset_type = 'NuScenesDatase... | 33.417582 | 114 | 0.59213 | point_cloud_range = [-54.0, -54.0, -5.0, 54.0, 54.0, 3.0]
class_names = [
'car', 'truck', 'construction_vehicle', 'bus', 'trailer', 'barrier',
'motorcycle', 'bicycle', 'pedestrian', 'traffic_cone'
]
voxel_size = [0.075, 0.075, 0.2]
out_size_factor = 8
evaluation = dict(interval=1)
dataset_type = 'NuScenesDatase... | true | true |
f76540c8c761c4425b6e0158b527c854709639b9 | 8,309 | py | Python | notebooks/cbi.py | gmggroup/omf | 022cb6f84e3b1504555eb0964a37f60281efb03c | [
"MIT"
] | 49 | 2018-11-11T21:48:57.000Z | 2022-01-12T22:30:24.000Z | notebooks/cbi.py | gmggroup/omf | 022cb6f84e3b1504555eb0964a37f60281efb03c | [
"MIT"
] | 78 | 2018-10-29T08:52:57.000Z | 2022-03-03T00:55:40.000Z | notebooks/cbi.py | gmggroup/omf | 022cb6f84e3b1504555eb0964a37f60281efb03c | [
"MIT"
] | 7 | 2019-03-06T01:10:52.000Z | 2022-03-31T12:12:26.000Z | import numpy as np
import properties
import z_order_utils
class BaseMetadata(properties.HasProperties):
name = properties.String("Name of the block model", default="")
description = properties.String("Description of the block model", default="")
# Other named metadata?
class BaseOrientation(properties.H... | 33.914286 | 88 | 0.60958 | import numpy as np
import properties
import z_order_utils
class BaseMetadata(properties.HasProperties):
name = properties.String("Name of the block model", default="")
description = properties.String("Description of the block model", default="")
class BaseOrientation(properties.HasProperties):
corne... | true | true |
f765444141b2568f4eaea3c155de8dad75a46612 | 1,065 | py | Python | Commandes/param_setter_and_getter.py | MartinCharrois/skaiAM | 5b90d53f3b36f2c27a902bc71d566f459fd50583 | [
"MIT"
] | 1 | 2021-02-09T15:49:05.000Z | 2021-02-09T15:49:05.000Z | Commandes/param_setter_and_getter.py | MartinCharrois/skaiAM | 5b90d53f3b36f2c27a902bc71d566f459fd50583 | [
"MIT"
] | null | null | null | Commandes/param_setter_and_getter.py | MartinCharrois/skaiAM | 5b90d53f3b36f2c27a902bc71d566f459fd50583 | [
"MIT"
] | 2 | 2021-02-09T16:31:17.000Z | 2022-01-29T16:44:15.000Z | ##### DEPENDENCIES ####
from dronekit import connect, VehicleMode, LocationGlobalRelative,APIException
import time
import socket
import exceptions
import math
import argparse
##### FUNCTIONS #####
def connectMyCopter():
"""
:return: Vehicle object connected to IP adress specified in terminal
"""
pars... | 27.307692 | 78 | 0.716432 | from dronekit import connect, VehicleMode, LocationGlobalRelative,APIException
import time
import socket
import exceptions
import math
import argparse
def connectMyCopter():
parser = argparse.ArgumentParser(description='commands')
parser.add_argument('--connect')
args = parser.parse_args()
conne... | true | true |
f76545478adf85747b9661286b231c7a55b96ef7 | 9,214 | py | Python | vega/networks/pytorch/customs/modnas/arch_space/torch/resnet.py | zjzh/vega | aa6e7b8c69024262fc483ee06113b4d1bd5156d8 | [
"Apache-2.0"
] | null | null | null | vega/networks/pytorch/customs/modnas/arch_space/torch/resnet.py | zjzh/vega | aa6e7b8c69024262fc483ee06113b4d1bd5156d8 | [
"Apache-2.0"
] | null | null | null | vega/networks/pytorch/customs/modnas/arch_space/torch/resnet.py | zjzh/vega | aa6e7b8c69024262fc483ee06113b4d1bd5156d8 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
# This file is adapted from the torchvision library at
# https://github.com/pytorch/vision/blob/master/torchvision/models/resnet.py
# 2020.6.29-Changed for Modular-NAS search space.
# Huawei Technologies Co., Ltd. <linyunfeng5@huawei.com>
# Copyright 2020 Huawei Technologies Co., Ltd.
... | 31.882353 | 119 | 0.626981 |
from functools import partial
import torch.nn as nn
from modnas.registry.construct import DefaultSlotTraversalConstructor
from modnas.registry.construct import register as register_constructor
from modnas.registry.arch_space import register
from ..ops import Identity
from ..slot import Slot
def conv3x3(in_planes,... | true | true |
f76545607aeed78127caec61dcbbd0450e50c938 | 21,207 | py | Python | rllib/agents/es/es.py | mgelbart/ray | 4cec2286572e368a4bd64aae467751a384eff62d | [
"Apache-2.0"
] | 1 | 2022-03-07T06:40:06.000Z | 2022-03-07T06:40:06.000Z | rllib/agents/es/es.py | mgelbart/ray | 4cec2286572e368a4bd64aae467751a384eff62d | [
"Apache-2.0"
] | 29 | 2021-11-24T00:50:07.000Z | 2022-03-19T07:11:36.000Z | rllib/agents/es/es.py | mgelbart/ray | 4cec2286572e368a4bd64aae467751a384eff62d | [
"Apache-2.0"
] | null | null | null | # Code in this file is copied and adapted from
# https://github.com/openai/evolution-strategies-starter.
from collections import namedtuple
import logging
import numpy as np
import random
import time
from typing import Optional
import ray
from ray.rllib.agents import Trainer, TrainerConfig
from ray.rllib.agents.es im... | 36.127768 | 88 | 0.623238 |
from collections import namedtuple
import logging
import numpy as np
import random
import time
from typing import Optional
import ray
from ray.rllib.agents import Trainer, TrainerConfig
from ray.rllib.agents.es import optimizers, utils
from ray.rllib.agents.es.es_tf_policy import ESTFPolicy, rollout
from ray.rllib.en... | true | true |
f7654649d11181a5424b36df26c60918fa51cd1d | 467 | py | Python | sending_emails.py | oforiwaasam/bookshelf | 6921c891004945d6a660cca189bdfbc5e5318099 | [
"MIT"
] | null | null | null | sending_emails.py | oforiwaasam/bookshelf | 6921c891004945d6a660cca189bdfbc5e5318099 | [
"MIT"
] | null | null | null | sending_emails.py | oforiwaasam/bookshelf | 6921c891004945d6a660cca189bdfbc5e5318099 | [
"MIT"
] | null | null | null | import yagmail
receiver = "ikiguma%73628@gmail.com"
body = "Thank you for registering with Bookshelf!"
subject = "Successful Registration!"
html = '<a href="https://bookshelfaacdl.herokuapp.com/"><br />Bookshelf</a>'
def sending_email(receiver, subj, body, html):
yag = yagmail.SMTP("bookshelfaacdl", "&UD0$r?zir... | 24.578947 | 76 | 0.674518 | import yagmail
receiver = "ikiguma%73628@gmail.com"
body = "Thank you for registering with Bookshelf!"
subject = "Successful Registration!"
html = '<a href="https://bookshelfaacdl.herokuapp.com/"><br />Bookshelf</a>'
def sending_email(receiver, subj, body, html):
yag = yagmail.SMTP("bookshelfaacdl", "&UD0$r?zir... | true | true |
f765469499d38ee5339df7d24ba0639dd713db1c | 2,404 | py | Python | frappe-bench/apps/erpnext/erpnext/demo/demo.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/demo/demo.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | frappe-bench/apps/erpnext/erpnext/demo/demo.py | Semicheche/foa_frappe_docker | a186b65d5e807dd4caf049e8aeb3620a799c1225 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import frappe, sys
import erpnext
import frappe.utils
from erpnext.demo.user import hr, sales, purchase, manufacturing, stock, accounts, projects, fixed_asset, education
from erpnext.demo.setup import education, manufacture, setup_data, healthcare
"""
Make a demo
1. Start with ... | 25.574468 | 115 | 0.740017 | from __future__ import unicode_literals
import frappe, sys
import erpnext
import frappe.utils
from erpnext.demo.user import hr, sales, purchase, manufacturing, stock, accounts, projects, fixed_asset, education
from erpnext.demo.setup import education, manufacture, setup_data, healthcare
def make(domain='Manufacturing... | true | true |
f76546f7639eb814f57779836a4467433387e42a | 3,368 | py | Python | qleet/simulators/pqc_trainer.py | AnimeshSinha1309/qaoa-optimizer | 2a93a46bacc99f22f49e7b5121eb3aa9f12c0163 | [
"Apache-2.0"
] | 9 | 2021-09-26T18:43:43.000Z | 2022-03-30T12:34:01.000Z | qleet/simulators/pqc_trainer.py | QLemma/qLEET | 2a93a46bacc99f22f49e7b5121eb3aa9f12c0163 | [
"Apache-2.0"
] | 12 | 2021-09-19T13:29:33.000Z | 2022-01-09T15:22:49.000Z | qleet/simulators/pqc_trainer.py | QLemma/qLEET | 2a93a46bacc99f22f49e7b5121eb3aa9f12c0163 | [
"Apache-2.0"
] | 1 | 2022-03-14T03:02:24.000Z | 2022-03-14T03:02:24.000Z | """The module which houses the Parametrized Quantum Circuit trainer class.
It generates the TensorFlow Quantum model, and allows Keras like API to
train and evaluate a model.
"""
import typing
import cirq
import tqdm.auto as tqdm
import warnings
warnings.filterwarnings("ignore")
import tensorflow as tf
import tens... | 37.842697 | 92 | 0.634204 |
import typing
import cirq
import tqdm.auto as tqdm
import warnings
warnings.filterwarnings("ignore")
import tensorflow as tf
import tensorflow_quantum as tfq
from ..interface.metas import AnalyzerList
from ..interface.circuit import CircuitDescriptor
class PQCSimulatedTrainer:
def __init__(self, circuit: Ci... | true | true |
f765472090fbeea2ec103ad0b8ebaf87b86aa63a | 5,130 | py | Python | proj_test2.py | fors31/regex | 43447155a9fb46b03c7d37271b8187c430af932f | [
"MIT"
] | null | null | null | proj_test2.py | fors31/regex | 43447155a9fb46b03c7d37271b8187c430af932f | [
"MIT"
] | null | null | null | proj_test2.py | fors31/regex | 43447155a9fb46b03c7d37271b8187c430af932f | [
"MIT"
] | null | null | null | from RPQ import loadgraph, runquery, bfs
from parse import NFA, State
import re
def get_outgoing_nodes(filename):
g = loadgraph(filename)
domain_name = list(g.keys())[0].split(":")[0]
nodes_out = set()
node_in = domain_name.lower()
for key in g.keys():
if key.split(":")[0].lower() != node_... | 33.97351 | 156 | 0.629435 | from RPQ import loadgraph, runquery, bfs
from parse import NFA, State
import re
def get_outgoing_nodes(filename):
g = loadgraph(filename)
domain_name = list(g.keys())[0].split(":")[0]
nodes_out = set()
node_in = domain_name.lower()
for key in g.keys():
if key.split(":")[0].lower() != node_... | true | true |
f7654728aff8f643eb97cc770861b3d088d91f09 | 14,481 | py | Python | recipes/IEMOCAP/emotion_recognition/iemocap_prepare.py | Adel-Moumen/speechbrain | 1837bbdab24d40b73f3eb354db00fbb063e5aca4 | [
"Apache-2.0"
] | null | null | null | recipes/IEMOCAP/emotion_recognition/iemocap_prepare.py | Adel-Moumen/speechbrain | 1837bbdab24d40b73f3eb354db00fbb063e5aca4 | [
"Apache-2.0"
] | null | null | null | recipes/IEMOCAP/emotion_recognition/iemocap_prepare.py | Adel-Moumen/speechbrain | 1837bbdab24d40b73f3eb354db00fbb063e5aca4 | [
"Apache-2.0"
] | null | null | null | """
Downloads and creates data manifest files for IEMOCAP
(https://paperswithcode.com/dataset/iemocap).
Authors:
* Mirco Ravanelli, 2021
* Modified by Pierre-Yves Yanni, 2021
* Abdel Heba, 2021
"""
import os
import sys
import re
import json
import random
import logging
import glob
from scipy.io import wavfile
from... | 29.492872 | 159 | 0.580623 |
import os
import sys
import re
import json
import random
import logging
import glob
from scipy.io import wavfile
from speechbrain.utils.data_utils import get_all_files
from speechbrain.dataio.dataio import read_audio
logger = logging.getLogger(__name__)
SAMPLERATE = 16000
NUMBER_UTT = 5531
def prepare_data(
dat... | true | true |
f76548473d566ecca8ab47ad03a8d9280b969898 | 2,463 | py | Python | utils.py | dakota0064/Fluorescent_Robotic_Imager | 423e6df956269fb2d6c438dd5fce1a6cbc947b3d | [
"Apache-2.0"
] | null | null | null | utils.py | dakota0064/Fluorescent_Robotic_Imager | 423e6df956269fb2d6c438dd5fce1a6cbc947b3d | [
"Apache-2.0"
] | null | null | null | utils.py | dakota0064/Fluorescent_Robotic_Imager | 423e6df956269fb2d6c438dd5fce1a6cbc947b3d | [
"Apache-2.0"
] | 2 | 2019-11-15T11:56:36.000Z | 2020-04-08T01:01:50.000Z | import gcodesender as gc
import os
import operator
def ensure_directory(file_path):
"""Checks the given file path for a directory, and creates one if not already present.
Args:
file_path: a string representing a valid URL
"""
directory = os.path.dirname(file_path)
if not os.path.exists(di... | 29.321429 | 120 | 0.492489 | import gcodesender as gc
import os
import operator
def ensure_directory(file_path):
directory = os.path.dirname(file_path)
if not os.path.exists(directory):
os.makedirs(directory)
def setup():
print("> Make your selections and")
print("> press '\"'GO'\" to begin")
print(" ")
#---------... | true | true |
f76548aad3eec011a1a2ce4306818a6664b01ad2 | 4,141 | py | Python | cogs/events.py | Wrdle/BertieBotV3 | 8bc5f762ec8de7192a8635e1bebd9dc1bba6ab0f | [
"MIT"
] | 3 | 2019-02-10T14:42:58.000Z | 2020-04-14T08:32:12.000Z | cogs/events.py | Wrdle/BertieBotV3 | 8bc5f762ec8de7192a8635e1bebd9dc1bba6ab0f | [
"MIT"
] | 1 | 2019-03-16T11:22:07.000Z | 2019-03-16T11:22:07.000Z | cogs/events.py | Wrdle/BertieBotV3 | 8bc5f762ec8de7192a8635e1bebd9dc1bba6ab0f | [
"MIT"
] | null | null | null | from discord.ext import commands
import sqlite3
import os, sys
from colorama import Fore, Back, Style
import threading
from time import sleep
import asyncio
import start
from settings import repeatedTimer, fancyStats, guildStats, databaseMigrator, serverChatLog, chatLeaderboard, configFunctions, welcomeMessages, extr... | 49.891566 | 211 | 0.689206 | from discord.ext import commands
import sqlite3
import os, sys
from colorama import Fore, Back, Style
import threading
from time import sleep
import asyncio
import start
from settings import repeatedTimer, fancyStats, guildStats, databaseMigrator, serverChatLog, chatLeaderboard, configFunctions, welcomeMessages, extr... | true | true |
f76548cfe92a70f6c6f3ffbb4f0f1c780f4f99c1 | 273 | py | Python | day1/strings/solutions/exercise1.py | austind/pyplus-ons | f0fcd6b2a980f75968ab54cd2ae39b42c1f68302 | [
"Apache-2.0"
] | null | null | null | day1/strings/solutions/exercise1.py | austind/pyplus-ons | f0fcd6b2a980f75968ab54cd2ae39b42c1f68302 | [
"Apache-2.0"
] | null | null | null | day1/strings/solutions/exercise1.py | austind/pyplus-ons | f0fcd6b2a980f75968ab54cd2ae39b42c1f68302 | [
"Apache-2.0"
] | 5 | 2019-11-19T18:41:41.000Z | 2020-06-18T14:58:09.000Z | #!/usr/bin/env python
name1 = "Kirk Byers"
name2 = "George Washington"
name3 = "Thomas Jefferson"
name4 = input("Enter fourth name: ")
print()
print("{:>30}".format(name1))
print("{:>30}".format(name2))
print("{:>30}".format(name3))
print("{:>30}".format(name4))
print()
| 19.5 | 36 | 0.648352 | name1 = "Kirk Byers"
name2 = "George Washington"
name3 = "Thomas Jefferson"
name4 = input("Enter fourth name: ")
print()
print("{:>30}".format(name1))
print("{:>30}".format(name2))
print("{:>30}".format(name3))
print("{:>30}".format(name4))
print()
| true | true |
f76549607554620949e0d0a76c04f65553ee5e0a | 930 | py | Python | stat_parser/treebanks/extract.py | lukaswillsie/TOHacks-2021 | e93738f05fb9bc26da8bab047fb2ed7106aeab9c | [
"Apache-2.0"
] | 85 | 2015-01-04T17:46:04.000Z | 2022-03-15T04:32:56.000Z | stat_parser/treebanks/extract.py | lukaswillsie/TOHacks-2021 | e93738f05fb9bc26da8bab047fb2ed7106aeab9c | [
"Apache-2.0"
] | 8 | 2015-09-11T02:58:02.000Z | 2020-01-04T21:59:46.000Z | stat_parser/treebanks/extract.py | lukaswillsie/TOHacks-2021 | e93738f05fb9bc26da8bab047fb2ed7106aeab9c | [
"Apache-2.0"
] | 50 | 2015-04-23T18:20:40.000Z | 2021-11-19T16:19:45.000Z | """
Extract the words from a tree and reverse the tokenization
"""
def get_words(tree):
# Assume well formed
if len(tree) == 2:
return [tree[1]]
else:
return get_words(tree[1]) + get_words(tree[2])
LEFT = {
'``': '"',
'-LRB-': '(',
'$': '$',
}
RIGHT = {
"''": '"',
"-RR... | 20.217391 | 72 | 0.451613 |
def get_words(tree):
if len(tree) == 2:
return [tree[1]]
else:
return get_words(tree[1]) + get_words(tree[2])
LEFT = {
'``': '"',
'-LRB-': '(',
'$': '$',
}
RIGHT = {
"''": '"',
"-RRB-": ')',
}
def get_sentence(tree):
words = get_words(tree)
n = len(words)
... | true | true |
f76549a6313d6f41fe2fe71d9756744e08465e1b | 629 | py | Python | algorithms/Python/implementation/modified kaprekar numbers.py | Kumbong/hackerrank | 36125f3a17c3e0f1fa889495e8ad33b0aa424552 | [
"MIT"
] | 8 | 2019-09-19T19:38:09.000Z | 2022-02-14T13:59:37.000Z | algorithms/Python/implementation/modified kaprekar numbers.py | Kumbong/hacker-rank | 36125f3a17c3e0f1fa889495e8ad33b0aa424552 | [
"MIT"
] | null | null | null | algorithms/Python/implementation/modified kaprekar numbers.py | Kumbong/hacker-rank | 36125f3a17c3e0f1fa889495e8ad33b0aa424552 | [
"MIT"
] | 7 | 2019-09-23T13:17:27.000Z | 2022-01-27T18:02:16.000Z | #!/bin/python3
import math
import os
import random
import re
import sys
# Complete the kaprekarNumbers function below.
def kaprekarNumbers(p, q):
found = False
for n in range(p,q+1):
d = len(str(n))
s = n*n
ds = len(str(s))
l=str(s)[:ds-d]
r=str(s)[ds-d:]
if l ... | 17.472222 | 46 | 0.508744 |
import math
import os
import random
import re
import sys
def kaprekarNumbers(p, q):
found = False
for n in range(p,q+1):
d = len(str(n))
s = n*n
ds = len(str(s))
l=str(s)[:ds-d]
r=str(s)[ds-d:]
if l and int(l)+int(r)==n:
found = True
pri... | true | true |
f7654a14f39334ad245fb76d4fa12f95282d7ffc | 3,342 | py | Python | tests/settings.py | almahmoud/djcloudbridge | 0a00ccefb217cc3962315019405dd176956c1830 | [
"MIT"
] | null | null | null | tests/settings.py | almahmoud/djcloudbridge | 0a00ccefb217cc3962315019405dd176956c1830 | [
"MIT"
] | null | null | null | tests/settings.py | almahmoud/djcloudbridge | 0a00ccefb217cc3962315019405dd176956c1830 | [
"MIT"
] | null | null | null | # -*- coding: utf-8
from __future__ import absolute_import, unicode_literals
import os
import sys
DEBUG = True
USE_TZ = True
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = "33333333333333333333333333333333333333333333333333"
# Build paths inside the project like this: os.path.join(B... | 26.951613 | 91 | 0.676242 | from __future__ import absolute_import, unicode_literals
import os
import sys
DEBUG = True
USE_TZ = True
SECRET_KEY = "33333333333333333333333333333333333333333333333333"
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
if 'test' in sys.argv:
DATABASES = {
"default": {
... | true | true |
f7654a21f50b9c5c27903f437e0f196c100a634b | 16,307 | py | Python | tests/io/test_access_groups_v2.py | mitsuo0114/pyTenable | 304953b1126d51c334a551199f3da820f4cc5b46 | [
"MIT"
] | null | null | null | tests/io/test_access_groups_v2.py | mitsuo0114/pyTenable | 304953b1126d51c334a551199f3da820f4cc5b46 | [
"MIT"
] | null | null | null | tests/io/test_access_groups_v2.py | mitsuo0114/pyTenable | 304953b1126d51c334a551199f3da820f4cc5b46 | [
"MIT"
] | null | null | null | '''
test access_groups
'''
import uuid
import pytest
from tenable.errors import UnexpectedValueError, APIError
from tests.checker import check
@pytest.fixture(name='rules')
def fixture_rules():
'''
Fixture to return access_group rules structure
'''
return [('ipv4', 'eq', ['192.168.0.0/24'])]
@pytest.f... | 36.237778 | 98 | 0.678175 | import uuid
import pytest
from tenable.errors import UnexpectedValueError, APIError
from tests.checker import check
@pytest.fixture(name='rules')
def fixture_rules():
return [('ipv4', 'eq', ['192.168.0.0/24'])]
@pytest.fixture(name='agroup')
def fixture_agroup(request, api, vcr, rules):
with vcr.use_cassette(... | true | true |
f7654a3552a91ad31ff9f3ef79b67e4b1c4fae75 | 6,667 | py | Python | nets/mobilenet_v2.py | 13488151126/mobilenet-yolov4-lite-tf2-main | 3f80aaa73d3dd305abc55fc65e26c309b19d9467 | [
"MIT"
] | null | null | null | nets/mobilenet_v2.py | 13488151126/mobilenet-yolov4-lite-tf2-main | 3f80aaa73d3dd305abc55fc65e26c309b19d9467 | [
"MIT"
] | null | null | null | nets/mobilenet_v2.py | 13488151126/mobilenet-yolov4-lite-tf2-main | 3f80aaa73d3dd305abc55fc65e26c309b19d9467 | [
"MIT"
] | null | null | null | #-------------------------------------------------------------#
# MobileNetV2的网络部分
#-------------------------------------------------------------#
import math
import numpy as np
import tensorflow as tf
from tensorflow.keras import backend
from tensorflow.keras.layers import (Activation, Add, BatchNormalization,
... | 38.761628 | 106 | 0.526924 | import math
import numpy as np
import tensorflow as tf
from tensorflow.keras import backend
from tensorflow.keras.layers import (Activation, Add, BatchNormalization,
Conv2D, Dense, DepthwiseConv2D, Dropout,
GlobalAveragePooling2D,
... | true | true |
f7654a7b1cd9f09f5f3f2ec70c6d5cdb25f6ce05 | 3,842 | py | Python | backend/api/entity/views.py | jeraldlyh/HoloRPG | e835eb1f7a6b18c87007ecf8168d959b4e176a23 | [
"MIT"
] | null | null | null | backend/api/entity/views.py | jeraldlyh/HoloRPG | e835eb1f7a6b18c87007ecf8168d959b4e176a23 | [
"MIT"
] | null | null | null | backend/api/entity/views.py | jeraldlyh/HoloRPG | e835eb1f7a6b18c87007ecf8168d959b4e176a23 | [
"MIT"
] | null | null | null | from rest_framework.decorators import api_view
from rest_framework import status, views
from rest_framework.response import Response
from .serializers import EntitySerializer, UserEntitySerializer
from .services import create_entity, deduct_user_entity, update_or_create_user_entity, claim_income
from .selectors import ... | 45.2 | 114 | 0.7038 | from rest_framework.decorators import api_view
from rest_framework import status, views
from rest_framework.response import Response
from .serializers import EntitySerializer, UserEntitySerializer
from .services import create_entity, deduct_user_entity, update_or_create_user_entity, claim_income
from .selectors import ... | true | true |
f7654abe7b6211fc32594505c865afd10231aa68 | 5,895 | py | Python | log_hs.py | rgbond/sampler_tools | 6a4042d18bb53a4955badbbf2b9cfb877f1b1b69 | [
"Apache-2.0"
] | null | null | null | log_hs.py | rgbond/sampler_tools | 6a4042d18bb53a4955badbbf2b9cfb877f1b1b69 | [
"Apache-2.0"
] | null | null | null | log_hs.py | rgbond/sampler_tools | 6a4042d18bb53a4955badbbf2b9cfb877f1b1b69 | [
"Apache-2.0"
] | 1 | 2021-07-31T21:02:53.000Z | 2021-07-31T21:02:53.000Z | #!/usr/bin/python3
#
# Sets up a simple db to hold tuning parameters and log file names
# Maintains parameters for tuning runs
# Runs halcmds
# Starts and stops sampler runs
#
# Copyright 2021 Robert Bond
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in com... | 26.434978 | 81 | 0.612044 |
import os
import sys
import subprocess
import argparse
import glob
import sqlite3
to_set = {
"pid.x.Pgain": 40.0,
"pid.x.Igain": 0.0,
"pid.x.Dgain": 0.0,
}
to_log = [
"pid.x.Pgain",
"pid.x.Dgain",
"pid.x.Igain",
"pid.x.FF0",
"pid.x.FF1",
"pid.x.FF2",
"pid.x.maxerror",
"ini... | true | true |
f7654d8b546667c10758f9a80d724fe602031877 | 1,804 | py | Python | awsenergylabelercli/awsenergylabelercliexceptions.py | schubergphilis/awsenergylabelercli | 9ba4f34e808a454da4fe8a9b0d9eb26afd9a68d1 | [
"MIT"
] | null | null | null | awsenergylabelercli/awsenergylabelercliexceptions.py | schubergphilis/awsenergylabelercli | 9ba4f34e808a454da4fe8a9b0d9eb26afd9a68d1 | [
"MIT"
] | 1 | 2022-01-25T12:17:15.000Z | 2022-01-25T12:17:15.000Z | awsenergylabelercli/awsenergylabelercliexceptions.py | schubergphilis/awsenergylabelercli | 9ba4f34e808a454da4fe8a9b0d9eb26afd9a68d1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# File: awsenergylabelercliexceptions.py
#
# Copyright 2021 Theodoor Scholte, Costas Tyfoxylos, Jenda Brands
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal ... | 41.953488 | 78 | 0.747783 |
__author__ = '''Theodoor Scholte <tscholte@schubergphilis.com>'''
__docformat__ = '''google'''
__date__ = '''11-11-2021'''
__copyright__ = '''Copyright 2021, Theodoor Scholte'''
__credits__ = ["Theodoor Scholte", "Costas Tyfoxylos", "Jenda Brands"]
__license__ = '''MIT'''
__maintainer__ = '''Theodoor Scholte'''
__ema... | true | true |
f7654eab99e0f2eba7077c225a9d2abeacfdf991 | 3,278 | py | Python | neurips2020/models/depth/bbbp.py | OObasuyi/evidential-deep-learning | 995764dd3a1923ec3b0f35392d2e25e8a6831bd9 | [
"Apache-2.0"
] | 11 | 2021-11-08T20:38:50.000Z | 2022-01-30T02:46:39.000Z | neurips2020/models/depth/bbbp.py | OObasuyi/evidential-deep-learning | 995764dd3a1923ec3b0f35392d2e25e8a6831bd9 | [
"Apache-2.0"
] | 1 | 2022-01-13T19:46:32.000Z | 2022-02-09T16:23:56.000Z | neurips2020/models/depth/bbbp.py | OObasuyi/evidential-deep-learning | 995764dd3a1923ec3b0f35392d2e25e8a6831bd9 | [
"Apache-2.0"
] | 3 | 2021-03-15T18:52:51.000Z | 2021-08-02T14:55:11.000Z | import tensorflow as tf
import tensorflow_probability as tfp
from tensorflow.keras.layers import Conv2D, MaxPooling2D, \
UpSampling2D, Cropping2D, concatenate, ZeroPadding2D, SpatialDropout2D
import functools
def create(input_shape, num_class=1, activation=tf.nn.relu):
opts = locals().copy()
# model = De... | 33.793814 | 114 | 0.630567 | import tensorflow as tf
import tensorflow_probability as tfp
from tensorflow.keras.layers import Conv2D, MaxPooling2D, \
UpSampling2D, Cropping2D, concatenate, ZeroPadding2D, SpatialDropout2D
import functools
def create(input_shape, num_class=1, activation=tf.nn.relu):
opts = locals().copy()
con... | true | true |
f7654fe0c8a616cec19322ece32d2110c2600db3 | 1,512 | py | Python | pass/mockturtle/tests/mt_gen_test.py | milad621/livehd | 370b4274809ef95f880da07a603245bffcadf05e | [
"BSD-3-Clause"
] | 115 | 2019-09-28T13:39:41.000Z | 2022-03-24T11:08:53.000Z | pass/mockturtle/tests/mt_gen_test.py | milad621/livehd | 370b4274809ef95f880da07a603245bffcadf05e | [
"BSD-3-Clause"
] | 120 | 2018-05-16T23:11:09.000Z | 2019-09-25T18:52:49.000Z | pass/mockturtle/tests/mt_gen_test.py | milad621/livehd | 370b4274809ef95f880da07a603245bffcadf05e | [
"BSD-3-Clause"
] | 44 | 2019-09-28T07:53:21.000Z | 2022-02-13T23:21:12.000Z | #!/usr/bin/python
def main():
nums = [5000, 10000, 20000, 30000, 40000, 50000, 60000, 70000, 80000]
# nums = [1, 10]
for num in nums:
f = open("mt_xor_" + str(num) + ".v", "w+")
f.write("module mt_xor_" + str(num) + "(\n")
for i in range(num):
f.write(" input a" + str(i)+ ",\n... | 29.076923 | 82 | 0.383598 |
def main():
nums = [5000, 10000, 20000, 30000, 40000, 50000, 60000, 70000, 80000]
for num in nums:
f = open("mt_xor_" + str(num) + ".v", "w+")
f.write("module mt_xor_" + str(num) + "(\n")
for i in range(num):
f.write(" input a" + str(i)+ ",\n")
f.write(" output wire z... | true | true |
f76550696f91fd1edd93fb204cd779f8e4b89b8f | 9,094 | py | Python | maskrcnn_benchmark/config/paths_catalog.py | KelvinCPChiu/Mask-RCNN-Tless | 2531ca6953f1c4a752c17f061bb8b83feb77f91b | [
"MIT"
] | 1 | 2019-08-19T09:53:22.000Z | 2019-08-19T09:53:22.000Z | maskrcnn_benchmark/config/paths_catalog.py | KelvinCPChiu/Mask-RCNN-Tless | 2531ca6953f1c4a752c17f061bb8b83feb77f91b | [
"MIT"
] | null | null | null | maskrcnn_benchmark/config/paths_catalog.py | KelvinCPChiu/Mask-RCNN-Tless | 2531ca6953f1c4a752c17f061bb8b83feb77f91b | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
"""Centralized catalog of paths."""
import os
class DatasetCatalog(object):
DATA_DIR = "datasets"
DATASETS = {
"coco_2017_train": {
"img_dir": "coco/train2017",
"ann_file": "coco/annotations/instances_trai... | 40.417778 | 121 | 0.58709 |
import os
class DatasetCatalog(object):
DATA_DIR = "datasets"
DATASETS = {
"coco_2017_train": {
"img_dir": "coco/train2017",
"ann_file": "coco/annotations/instances_train2017.json"
},
"coco_2017_val": {
"img_dir": "coco/val2017",
"ann_fi... | true | true |
f76550d146f56857106c174fceed57650240f8ae | 1,709 | py | Python | examples/multitonePygameSampler.py | ZacharyIgielman/PiPiano | 699cd2e13f02105e56281760aebdc43b86e7fdd0 | [
"CC0-1.0"
] | 11 | 2015-01-06T07:04:56.000Z | 2022-02-23T02:31:54.000Z | examples/multitonePygameSampler.py | ZacharyIgielman/PiPiano | 699cd2e13f02105e56281760aebdc43b86e7fdd0 | [
"CC0-1.0"
] | 1 | 2015-01-25T16:35:35.000Z | 2015-01-25T16:35:35.000Z | examples/multitonePygameSampler.py | ZacharyIgielman/PiPiano | 699cd2e13f02105e56281760aebdc43b86e7fdd0 | [
"CC0-1.0"
] | 2 | 2015-01-17T22:32:02.000Z | 2017-11-23T07:09:45.000Z | #!/usr/bin/python
# multitonePygameSampler.py
# this enables you to press the buttoins on PiPiano like a piano, and will play the sounds out of the Pi's audio output like a proper keyboard
# Author : Zachary Igielman
# to run:
# sudo python multitonePygameSampler.py
# to change volume:
# amixer cset numid=1 -- 80%
#... | 21.910256 | 151 | 0.634289 | # Author : Zachary Igielman
# to run:
# sudo python multitonePygameSampler.py
# to change volume:
# amixer cset numid=1 -- 80%
# to change audio outout for Pi (audio jack/HDMI)
# amixer cset numid=3 0 (for auto-detect)
# amixer cset numid=3 1 (for analog)
# amixer cset numid=3 2 (for HDMI)
import RPi.GPIO as GPIO
i... | true | true |
f7655121897aa71420516116a879a69a37719d84 | 2,727 | py | Python | bin/grand_central_aws_accounts_schema.py | gayatrisingh31/grand_central | eae635d865549b8002a42d051d9af69e8688e129 | [
"MIT"
] | 36 | 2019-11-06T20:49:07.000Z | 2021-07-07T02:26:52.000Z | bin/grand_central_aws_accounts_schema.py | gayatrisingh31/grand_central | eae635d865549b8002a42d051d9af69e8688e129 | [
"MIT"
] | 21 | 2019-11-10T05:38:06.000Z | 2022-03-10T15:07:48.000Z | bin/grand_central_aws_accounts_schema.py | gayatrisingh31/grand_central | eae635d865549b8002a42d051d9af69e8688e129 | [
"MIT"
] | 7 | 2020-02-13T22:56:46.000Z | 2022-01-22T05:57:34.000Z | from schema import Schema, And, Optional
import re
def tags_validator(tags):
if tags:
tags = tags.replace(', ', ',').split(',')
tag_pattern = re.compile('^[A-Za-z0-9\-\_]+$')
for tag in tags:
if not tag_pattern.match(tag):
return False
return True
ret... | 54.54 | 370 | 0.700037 | from schema import Schema, And, Optional
import re
def tags_validator(tags):
if tags:
tags = tags.replace(', ', ',').split(',')
tag_pattern = re.compile('^[A-Za-z0-9\-\_]+$')
for tag in tags:
if not tag_pattern.match(tag):
return False
return True
ret... | true | true |
f7655124f8ba514282212d4896b6f0c42c280271 | 4,438 | py | Python | src/debug.py | gri38/hyperlink_preview | f3aaa2fa624bb4b8eec435e77819413e0acf113c | [
"MIT"
] | 2 | 2022-02-04T11:14:56.000Z | 2022-02-08T21:22:28.000Z | src/debug.py | gri38/hyperlink_preview | f3aaa2fa624bb4b8eec435e77819413e0acf113c | [
"MIT"
] | 2 | 2022-03-01T04:31:48.000Z | 2022-03-03T17:08:26.000Z | src/debug.py | gri38/hyperlink_preview | f3aaa2fa624bb4b8eec435e77819413e0acf113c | [
"MIT"
] | null | null | null | from hyperlink_preview.hyperlink_preview import HyperLinkPreview
import json
import sys
import timeit
try:
import gevent
except ImportError:
gevent = None
class Node(object):
def __init__(self, name, id_):
self.name = name
self.id_ = id_
self.children = {}
self.hitCount =... | 29.986486 | 90 | 0.578414 | from hyperlink_preview.hyperlink_preview import HyperLinkPreview
import json
import sys
import timeit
try:
import gevent
except ImportError:
gevent = None
class Node(object):
def __init__(self, name, id_):
self.name = name
self.id_ = id_
self.children = {}
self.hitCount =... | true | true |
f765529848d9c1d635e6c85d72b81d07f052469c | 5,906 | py | Python | integrationhelper/webclient.py | ludeeus/integrationhelper | 3235a40fb22293c5ee6a9af1613fd3bd7c084aca | [
"MIT"
] | null | null | null | integrationhelper/webclient.py | ludeeus/integrationhelper | 3235a40fb22293c5ee6a9af1613fd3bd7c084aca | [
"MIT"
] | 4 | 2019-07-22T15:24:28.000Z | 2019-07-23T07:15:42.000Z | integrationhelper/webclient.py | ludeeus/integrationhelper | 3235a40fb22293c5ee6a9af1613fd3bd7c084aca | [
"MIT"
] | null | null | null | """Web client."""
import asyncio
import socket
import aiohttp
import async_timeout
import backoff
from integrationhelper.const import GOOD_HTTP_CODES
class WebClient:
"""Web client."""
def __init__(self, session=None, logger=None):
"""
Initialize.
Sample Usage:
... | 40.731034 | 89 | 0.542838 | import asyncio
import socket
import aiohttp
import async_timeout
import backoff
from integrationhelper.const import GOOD_HTTP_CODES
class WebClient:
def __init__(self, session=None, logger=None):
self.session = session
if logger is not None:
self.logger = logger
... | true | true |
f765538a1418ef1fb7e9972e585f90bc9c0a376d | 64,195 | py | Python | provision/env/lib/python3.6/site-packages/ansible/modules/packaging/os/yum.py | brightkan/tukole-frontend | 45e1d82a4ae5a65e88e7434f67d4d1a88f462e96 | [
"MIT"
] | 1 | 2020-03-29T18:41:01.000Z | 2020-03-29T18:41:01.000Z | ansible/ansible/modules/packaging/os/yum.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 7 | 2020-09-07T17:27:56.000Z | 2022-03-02T06:25:46.000Z | ansible/ansible/modules/packaging/os/yum.py | SergeyCherepanov/ansible | 875711cd2fd6b783c812241c2ed7a954bf6f670f | [
"MIT"
] | 1 | 2020-10-30T12:48:24.000Z | 2020-10-30T12:48:24.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2012, Red Hat, Inc
# Written by Seth Vidal <skvidal at fedoraproject.org>
# Copyright: (c) 2014, Epic Games, Inc.
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, p... | 39.897452 | 160 | 0.554591 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['stableinterface'],
'supported_by': 'core'}
DOCUMENTATION = '''
---
module: yum
version_added: historical
short_description: Manage... | true | true |
f76553b595c128046799b7eb1e13c149080cca68 | 10,168 | py | Python | fanalysis/mca.py | OlivierGarciaDev/fanalysis | 9aa2cc8b1e5cc5600a05813144973b77143cfe42 | [
"BSD-3-Clause"
] | 21 | 2018-09-18T13:45:11.000Z | 2022-02-07T11:35:16.000Z | fanalysis/mca.py | Pandinosaurus/fanalysis | 9aa2cc8b1e5cc5600a05813144973b77143cfe42 | [
"BSD-3-Clause"
] | 2 | 2020-04-23T16:44:40.000Z | 2020-10-02T19:55:52.000Z | fanalysis/mca.py | Pandinosaurus/fanalysis | 9aa2cc8b1e5cc5600a05813144973b77143cfe42 | [
"BSD-3-Clause"
] | 19 | 2018-09-15T15:08:50.000Z | 2021-09-23T13:19:51.000Z | # -*- coding: utf-8 -*-
""" mca module
"""
# Author: Olivier Garcia <o.garcia.dev@gmail.com>
# License: BSD 3 clause
import numpy as np
from sklearn.preprocessing import LabelBinarizer
from fanalysis.base import Base
class MCA(Base):
""" Multiple Correspondence Analysis (MCA)
This class inherits from... | 36.444444 | 77 | 0.579563 |
import numpy as np
from sklearn.preprocessing import LabelBinarizer
from fanalysis.base import Base
class MCA(Base):
def __init__(self, n_components=None, row_labels=None, var_labels=None,
stats=True):
Base.__init__(self, n_components, row_labels, None, stats)
self.var_labels ... | true | true |
f76554309ea17739d2180c3de23bcf5ec9addda3 | 21,446 | py | Python | thermalComfort/dashboard_nosql/views.py | ISIS2503/ThermalComfortDjango | 1e5677a20e47f60c0296c0cca724ad044662fb4b | [
"MIT"
] | null | null | null | thermalComfort/dashboard_nosql/views.py | ISIS2503/ThermalComfortDjango | 1e5677a20e47f60c0296c0cca724ad044662fb4b | [
"MIT"
] | null | null | null | thermalComfort/dashboard_nosql/views.py | ISIS2503/ThermalComfortDjango | 1e5677a20e47f60c0296c0cca724ad044662fb4b | [
"MIT"
] | null | null | null | from django.shortcuts import render
from django.conf import settings
from django.http import JsonResponse
from pymongo import MongoClient
from dashboard_nosql import urls
from rest_framework import (response, schemas, filters, generics, viewsets,
views)
from rest_framework.parsers import J... | 39.422794 | 241 | 0.485032 | from django.shortcuts import render
from django.conf import settings
from django.http import JsonResponse
from pymongo import MongoClient
from dashboard_nosql import urls
from rest_framework import (response, schemas, filters, generics, viewsets,
views)
from rest_framework.parsers import J... | true | true |
f76554f7786ee273c00e53cfebdd541ec506d218 | 2,424 | py | Python | scout/commands/download/ensembl.py | mhkc/scout | a7162f28c0f3490c3f3376268118fa8e6072a9db | [
"BSD-3-Clause"
] | 111 | 2015-01-15T11:53:20.000Z | 2022-03-26T19:55:24.000Z | scout/commands/download/ensembl.py | mhkc/scout | a7162f28c0f3490c3f3376268118fa8e6072a9db | [
"BSD-3-Clause"
] | 2,995 | 2015-01-15T16:14:20.000Z | 2022-03-31T13:36:32.000Z | scout/commands/download/ensembl.py | mhkc/scout | a7162f28c0f3490c3f3376268118fa8e6072a9db | [
"BSD-3-Clause"
] | 55 | 2015-05-31T19:09:49.000Z | 2021-11-01T10:50:31.000Z | """Code for handling downloading of ensembl files used by scout from CLI"""
import logging
import pathlib
import click
from scout.utils.scout_requests import (
fetch_ensembl_exons,
fetch_ensembl_genes,
fetch_ensembl_transcripts,
)
LOG = logging.getLogger(__name__)
def print_ensembl(out_dir, resource_ty... | 33.205479 | 98 | 0.670792 | import logging
import pathlib
import click
from scout.utils.scout_requests import (
fetch_ensembl_exons,
fetch_ensembl_genes,
fetch_ensembl_transcripts,
)
LOG = logging.getLogger(__name__)
def print_ensembl(out_dir, resource_type, genome_build=None):
if resource_type not in ["genes", "transcripts",... | true | true |
f76556c77a8f1c16b86937254d82cfefa8672cda | 813 | py | Python | tiny_benchmark/maskrcnn_benchmark/data/datasets/evaluation/coco/__init__.py | ucas-vg/TinyBenchmark | 36436df3716d842b6148fb6f6bc7715a2fbdfd92 | [
"MIT"
] | 495 | 2019-12-21T15:04:40.000Z | 2022-03-12T19:20:30.000Z | tiny_benchmark_Salpha/maskrcnn_benchmark/data/datasets/evaluation/coco/__init__.py | SHAOSIHAN/Effective-Fusion-Factor | b77a11c8111d9adbf7bc8372b562c6e57df2c01a | [
"MIT"
] | 55 | 2019-12-25T04:13:51.000Z | 2021-09-18T08:26:37.000Z | tiny_benchmark_Salpha/maskrcnn_benchmark/data/datasets/evaluation/coco/__init__.py | SHAOSIHAN/Effective-Fusion-Factor | b77a11c8111d9adbf7bc8372b562c6e57df2c01a | [
"MIT"
] | 80 | 2019-12-24T08:37:56.000Z | 2022-01-13T06:33:22.000Z | from .coco_eval import do_coco_evaluation
def coco_evaluation(
dataset,
predictions,
output_folder,
box_only,
iou_types,
expected_results,
expected_results_sigma_tol,
ignore_uncertain=False,
use_iod_for_ignore=False,
eval_standard='coco',
gt_file=None,
use_ignore_attr=T... | 25.40625 | 62 | 0.710947 | from .coco_eval import do_coco_evaluation
def coco_evaluation(
dataset,
predictions,
output_folder,
box_only,
iou_types,
expected_results,
expected_results_sigma_tol,
ignore_uncertain=False,
use_iod_for_ignore=False,
eval_standard='coco',
gt_file=None,
use_ignore_attr=T... | true | true |
f765570c52a90e1bfd238b2be0f936a4f723bfda | 7,394 | py | Python | smooth-scroll.py | Screwtapello/kakoune-smooth-scroll | 01d904d6bb9228efb27f366f6048080396bb90ae | [
"MIT"
] | 14 | 2020-07-20T11:27:51.000Z | 2021-12-10T00:36:19.000Z | smooth-scroll.py | Screwtapello/kakoune-smooth-scroll | 01d904d6bb9228efb27f366f6048080396bb90ae | [
"MIT"
] | 12 | 2020-08-09T03:44:09.000Z | 2021-12-09T23:44:49.000Z | smooth-scroll.py | Screwtapello/kakoune-smooth-scroll | 01d904d6bb9228efb27f366f6048080396bb90ae | [
"MIT"
] | 2 | 2020-08-09T02:57:03.000Z | 2021-12-08T08:37:28.000Z | #!/usr/bin/env python3
"""
This module defines a KakSender class to communicate with Kakoune sessions
over Unix sockets. It implements smooth scrolling when executed as a script.
"""
import sys
import os
import time
import socket
SEND_INTERVAL = 2e-3 # min time interval (in s) between two sent scroll events
class ... | 36.245098 | 99 | 0.606167 |
import sys
import os
import time
import socket
SEND_INTERVAL = 2e-3
class KakSender:
def __init__(self) -> None:
self.session = os.environ['kak_session']
self.client = os.environ['kak_client']
self.socket_path = self._get_socket_path(self.session)
def send_cmd(self, cmd: str, clie... | true | true |
f76557bc5a64f6166b640e63545adae2acac5bf6 | 2,257 | py | Python | knosk/core/flowmanager.py | mstyushin/knosk-core | 1d26f7c2f64ace8bed49a42eb1ed50f03ffb6dfe | [
"MIT"
] | 2 | 2019-10-04T13:34:57.000Z | 2019-10-20T10:09:54.000Z | knosk/core/flowmanager.py | mstyushin/knosk-core | 1d26f7c2f64ace8bed49a42eb1ed50f03ffb6dfe | [
"MIT"
] | 4 | 2019-10-02T06:37:48.000Z | 2019-10-07T18:53:45.000Z | knosk/core/flowmanager.py | mstyushin/knosk-core | 1d26f7c2f64ace8bed49a42eb1ed50f03ffb6dfe | [
"MIT"
] | 1 | 2019-10-04T13:35:04.000Z | 2019-10-04T13:35:04.000Z | import logging
LOG = logging.getLogger(__name__)
def default_fallback(ex, route_name, payload, ctx):
LOG.error(
"Error %s occur while handling route %s with payload %s and ctx %s" %
(ex, route_name, payload, ctx))
LOG.exception(ex)
raise ex
class SingleBotFlowFactory:
_botflow = Non... | 31.347222 | 77 | 0.619406 | import logging
LOG = logging.getLogger(__name__)
def default_fallback(ex, route_name, payload, ctx):
LOG.error(
"Error %s occur while handling route %s with payload %s and ctx %s" %
(ex, route_name, payload, ctx))
LOG.exception(ex)
raise ex
class SingleBotFlowFactory:
_botflow = Non... | true | true |
f7655944ff5003a28bb2cf4550b816fe79028e6a | 776 | py | Python | python-sdk/tutorials/using-pipelines/publish_run_extract/extract.py | 0mza987/azureml-examples | 2abb872f1278d4b4e65587e033f38a058512b2e3 | [
"MIT"
] | 1 | 2022-01-15T10:03:19.000Z | 2022-01-15T10:03:19.000Z | python-sdk/tutorials/using-pipelines/publish_run_extract/extract.py | 0mza987/azureml-examples | 2abb872f1278d4b4e65587e033f38a058512b2e3 | [
"MIT"
] | null | null | null | python-sdk/tutorials/using-pipelines/publish_run_extract/extract.py | 0mza987/azureml-examples | 2abb872f1278d4b4e65587e033f38a058512b2e3 | [
"MIT"
] | 1 | 2022-01-08T14:44:38.000Z | 2022-01-08T14:44:38.000Z | import argparse
import os
print("In extract.py")
print("As a data scientist, this is where I use my extract code.")
parser = argparse.ArgumentParser("extract")
parser.add_argument("--input_extract", type=str, help="input_extract data")
parser.add_argument("--output_extract", type=str, help="output_extract directory")... | 32.333333 | 82 | 0.721649 | import argparse
import os
print("In extract.py")
print("As a data scientist, this is where I use my extract code.")
parser = argparse.ArgumentParser("extract")
parser.add_argument("--input_extract", type=str, help="input_extract data")
parser.add_argument("--output_extract", type=str, help="output_extract directory")... | true | true |
f76559bc17355d50782d59683eb6eced7fd668d2 | 853 | py | Python | snake/base/direc.py | AuthurExcalbern/AI-Snake | 5dee76fcecd40add58a432ca8b88880b00ac45b9 | [
"MIT"
] | null | null | null | snake/base/direc.py | AuthurExcalbern/AI-Snake | 5dee76fcecd40add58a432ca8b88880b00ac45b9 | [
"MIT"
] | 1 | 2018-03-24T08:50:32.000Z | 2018-03-28T11:11:50.000Z | snake/base/direc.py | AuthurExcalbern/AI-Snake | 5dee76fcecd40add58a432ca8b88880b00ac45b9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# pylint: disable=C0103,C0111
"""Definition of enum Direc."""
# 定义方向类型的枚举
from enum import Enum, unique
# 导入枚举类Enum和装饰器unique
# unique装饰器检查不会枚举有相同值的元素
@unique
class Direc(Enum):
"""Directions on the game plane."""
# 定义各个方向在游戏中的值
NONE = 0
LEFT = 1
UP ... | 22.447368 | 54 | 0.5932 |
from enum import Enum, unique
@unique
class Direc(Enum):
NONE = 0
LEFT = 1
UP = 2
RIGHT = 3
DOWN = 4
@staticmethod
def opposite(direc):
if direc == Direc.LEFT:
return Direc.RIGHT
elif direc == Direc.RIGHT:
return Direc.LEFT
... | true | true |
f7655a4c7b1a5c603ae1711a8aa7ddf1be5e08f0 | 8,539 | py | Python | DataController.py | pgenera/SenseLink | 8967c0b16b1de68a2f76b52e402b9a06755e7872 | [
"MIT"
] | null | null | null | DataController.py | pgenera/SenseLink | 8967c0b16b1de68a2f76b52e402b9a06755e7872 | [
"MIT"
] | null | null | null | DataController.py | pgenera/SenseLink | 8967c0b16b1de68a2f76b52e402b9a06755e7872 | [
"MIT"
] | null | null | null | # Copyright 2020, Charles Powell
import websockets
import json
import logging
import asyncio
import dpath.util
from socket import gaierror
from asyncio_mqtt import Client, MqttError
from contextlib import AsyncExitStack
from typing import Dict
# Independently set WS logger
wslogger = logging.getLogger('websockets')
w... | 36.648069 | 113 | 0.576063 |
import websockets
import json
import logging
import asyncio
import dpath.util
from socket import gaierror
from asyncio_mqtt import Client, MqttError
from contextlib import AsyncExitStack
from typing import Dict
wslogger = logging.getLogger('websockets')
wslogger.setLevel(logging.WARNING)
MQTT_LOGGER = logging.getLog... | true | true |
f7655abddaf87d96efc35e8694cb4415b1a7ac8c | 112 | py | Python | pyversor/__init__.py | tingelst/pyversor | b5545619bb1b4089803251098c4038d3ef16aac3 | [
"BSD-3-Clause"
] | 13 | 2017-11-02T19:44:08.000Z | 2021-02-07T21:04:03.000Z | pyversor/__init__.py | tingelst/pyversor | b5545619bb1b4089803251098c4038d3ef16aac3 | [
"BSD-3-Clause"
] | 5 | 2017-10-26T07:56:24.000Z | 2017-11-08T15:36:27.000Z | pyversor/__init__.py | tingelst/pyversor | b5545619bb1b4089803251098c4038d3ef16aac3 | [
"BSD-3-Clause"
] | 3 | 2017-09-27T12:23:11.000Z | 2020-05-24T19:13:49.000Z | from . import e3d
from . import e41
from . import c3d
from . import c2d
from . import sta
from . import visuals
| 16 | 21 | 0.732143 | from . import e3d
from . import e41
from . import c3d
from . import c2d
from . import sta
from . import visuals
| true | true |
f7655b96633100f3094af8acf360382535a39c0c | 1,272 | py | Python | flake8-AAE-tests.py | MarkusPiotrowski/flake8-assertAlmostEqual | a5ffd29269d751b9e6ec0d1e12770bcd52c7828a | [
"MIT"
] | null | null | null | flake8-AAE-tests.py | MarkusPiotrowski/flake8-assertAlmostEqual | a5ffd29269d751b9e6ec0d1e12770bcd52c7828a | [
"MIT"
] | null | null | null | flake8-AAE-tests.py | MarkusPiotrowski/flake8-assertAlmostEqual | a5ffd29269d751b9e6ec0d1e12770bcd52c7828a | [
"MIT"
] | null | null | null | """A module as test dummy for flake8-assertAlmostEqual."""
import unittest
class TestSelfAssertEqualDetection(unittest.TestCase):
"""Dummy for flake8-assertAlmostEqual."""
def setUp(self):
"""Set up."""
self.my_result = 5.0473
def test_detection(self):
"""Detect flake8-assertAlm... | 35.333333 | 78 | 0.63522 |
import unittest
class TestSelfAssertEqualDetection(unittest.TestCase):
def setUp(self):
self.my_result = 5.0473
def test_detection(self):
self.assertAlmostEqual(5.05, round(self.my_result, 2))
self.assertEqual(round(self.my_result, 3), 5.047)
# self.assertAlm... | true | true |
f7655ba67f46e1bf66c0e0d9e103cc226d29a369 | 508 | py | Python | tests/core/test_coordinates.py | MarinusHeindl/chesscog | 9022e19b1ad125481b561c765a886285abc16eb0 | [
"MIT"
] | 12 | 2021-07-14T15:49:53.000Z | 2022-03-31T06:21:18.000Z | tests/core/test_coordinates.py | MarinusHeindl/chesscog | 9022e19b1ad125481b561c765a886285abc16eb0 | [
"MIT"
] | 3 | 2020-11-26T14:01:40.000Z | 2021-04-27T14:14:38.000Z | tests/core/test_coordinates.py | MarinusHeindl/chesscog | 9022e19b1ad125481b561c765a886285abc16eb0 | [
"MIT"
] | 2 | 2022-01-04T09:25:23.000Z | 2022-03-23T16:48:28.000Z | import numpy as np
from chesscog.core.coordinates import from_homogenous_coordinates, to_homogenous_coordinates
def test_from_homogenous_coordinates():
coords = np.array([2., 4., 2.])
expected = np.array([1., 2.])
assert np.allclose(from_homogenous_coordinates(coords), expected)
def test_to_homogenous_... | 29.882353 | 92 | 0.746063 | import numpy as np
from chesscog.core.coordinates import from_homogenous_coordinates, to_homogenous_coordinates
def test_from_homogenous_coordinates():
coords = np.array([2., 4., 2.])
expected = np.array([1., 2.])
assert np.allclose(from_homogenous_coordinates(coords), expected)
def test_to_homogenous_... | true | true |
f7655bfe57344bf7b0057cb73327a10400855e30 | 859 | py | Python | tests/functional/users/test_get_users.py | panchiwalashivani/python | eacafb9c597d04da3ac306809939045a17611d69 | [
"MIT"
] | 1 | 2021-09-29T05:07:57.000Z | 2021-09-29T05:07:57.000Z | tests/functional/users/test_get_users.py | panchiwalashivani/python | eacafb9c597d04da3ac306809939045a17611d69 | [
"MIT"
] | null | null | null | tests/functional/users/test_get_users.py | panchiwalashivani/python | eacafb9c597d04da3ac306809939045a17611d69 | [
"MIT"
] | null | null | null | from pubnub.pubnub import PubNub
from pubnub.pnconfiguration import PNConfiguration
from pubnub.endpoints.users.get_users import GetUsers
SUB_KEY = 'sub'
AUTH = 'auth'
def test_get_users():
config = PNConfiguration()
config.subscribe_key = SUB_KEY
config.auth_key = AUTH
users = PubNub(config).get_us... | 26.84375 | 66 | 0.671711 | from pubnub.pubnub import PubNub
from pubnub.pnconfiguration import PNConfiguration
from pubnub.endpoints.users.get_users import GetUsers
SUB_KEY = 'sub'
AUTH = 'auth'
def test_get_users():
config = PNConfiguration()
config.subscribe_key = SUB_KEY
config.auth_key = AUTH
users = PubNub(config).get_us... | true | true |
f7655c226ec5589acdb52f5a70941bcb9ff48ba4 | 1,123 | py | Python | setup.py | frankwiles/django-pagebits | 62a1046face66f80fdb5f4b5c33e956ee273b6c4 | [
"BSD-3-Clause"
] | 4 | 2016-04-10T13:17:26.000Z | 2019-03-12T17:18:59.000Z | setup.py | frankwiles/django-pagebits | 62a1046face66f80fdb5f4b5c33e956ee273b6c4 | [
"BSD-3-Clause"
] | null | null | null | setup.py | frankwiles/django-pagebits | 62a1046face66f80fdb5f4b5c33e956ee273b6c4 | [
"BSD-3-Clause"
] | 6 | 2015-03-27T15:50:46.000Z | 2017-03-09T18:05:47.000Z | import os
from setuptools import setup, find_packages
from pagebits import VERSION
f = open(os.path.join(os.path.dirname(__file__), 'README.rst'))
readme = f.read()
f.close()
setup(
name='django-pagebits',
version=".".join(map(str, VERSION)),
description='django-pagebits is better more end user friendly... | 26.116279 | 92 | 0.60374 | import os
from setuptools import setup, find_packages
from pagebits import VERSION
f = open(os.path.join(os.path.dirname(__file__), 'README.rst'))
readme = f.read()
f.close()
setup(
name='django-pagebits',
version=".".join(map(str, VERSION)),
description='django-pagebits is better more end user friendly... | true | true |
f7655c5fbd285460a5e3c493f1743deefaaa2668 | 3,485 | py | Python | bindings/python/ensmallen/datasets/string/bacillusspfjat27251.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 5 | 2021-02-17T00:44:45.000Z | 2021-08-09T16:41:47.000Z | bindings/python/ensmallen/datasets/string/bacillusspfjat27251.py | AnacletoLAB/ensmallen_graph | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 18 | 2021-01-07T16:47:39.000Z | 2021-08-12T21:51:32.000Z | bindings/python/ensmallen/datasets/string/bacillusspfjat27251.py | AnacletoLAB/ensmallen | b2c1b18fb1e5801712852bcc239f239e03076f09 | [
"MIT"
] | 3 | 2021-01-14T02:20:59.000Z | 2021-08-04T19:09:52.000Z | """
This file offers the methods to automatically retrieve the graph Bacillus sp. FJAT-27251.
The graph is automatically retrieved from the STRING repository.
References
---------------------
Please cite the following if you use the data:
```bib
@article{szklarczyk2019string,
title={STRING v11: protein--protei... | 33.190476 | 223 | 0.676327 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen import Graph
def BacillusSpFjat27251(
directed: bool = False,
preprocess: bool = True,
load_nodes: bool = True,
verbose: int = 2,
cache: bool = True,
cache_path: str = "graphs/string... | true | true |
f7655c615a50a494c9b16a1cfe0a2b654f8b4190 | 12,138 | py | Python | tests/test_table/test_join.py | andriyor/agate | 9b12d4bcc75bf3788e0774e23188f4409c3e7519 | [
"MIT"
] | 663 | 2016-02-16T13:43:00.000Z | 2022-03-13T17:21:19.000Z | tests/test_table/test_join.py | andriyor/agate | 9b12d4bcc75bf3788e0774e23188f4409c3e7519 | [
"MIT"
] | 347 | 2015-08-28T13:46:37.000Z | 2016-02-16T01:53:06.000Z | tests/test_table/test_join.py | andriyor/agate | 9b12d4bcc75bf3788e0774e23188f4409c3e7519 | [
"MIT"
] | 122 | 2016-02-23T02:43:24.000Z | 2022-03-04T17:21:14.000Z | #!/usr/bin/env python
# -*- coding: utf8 -*-
from agate import Table
from agate.data_types import Number, Text
from agate.testcase import AgateTestCase
class TestJoin(AgateTestCase):
def setUp(self):
self.left_rows = (
(1, 4, 'a'),
(2, 3, 'b'),
(None, 2, 'c')
)... | 36.893617 | 98 | 0.551986 |
from agate import Table
from agate.data_types import Number, Text
from agate.testcase import AgateTestCase
class TestJoin(AgateTestCase):
def setUp(self):
self.left_rows = (
(1, 4, 'a'),
(2, 3, 'b'),
(None, 2, 'c')
)
self.right_rows = (
(1,... | true | true |
f7655cc0bed7d368b2a629e73323655ac7846095 | 15,107 | py | Python | src/ml/model/ensemble.py | cse-bristol/smeter-ml | db97902eec77c555c1dd030a676e7ebf5da40314 | [
"Apache-2.0"
] | null | null | null | src/ml/model/ensemble.py | cse-bristol/smeter-ml | db97902eec77c555c1dd030a676e7ebf5da40314 | [
"Apache-2.0"
] | null | null | null | src/ml/model/ensemble.py | cse-bristol/smeter-ml | db97902eec77c555c1dd030a676e7ebf5da40314 | [
"Apache-2.0"
] | null | null | null | """Module for generating an ensemble model from a given config file.
Exports a single class, Ensemble, which provides methods for training the ensemble,
saving the individual model files to disk and making predictions.
"""
import os
import sys
import numpy as np
import tensorflow as tf
import tensorflow.keras as k
fr... | 43.66185 | 119 | 0.62759 |
import os
import sys
import numpy as np
import tensorflow as tf
import tensorflow.keras as k
from typing import Callable
from tensorflow.keras.callbacks import EarlyStopping
from tensorflow.keras.backend import clear_session
from ml.model.cnn import (
base_cnn,
base_cnn_with_static_features,
base_cnn_singl... | true | true |
f7655cfe2b9dd70eac6e13cd615f53351289ae77 | 3,841 | py | Python | eval_exp_field.py | katetolstaya/graph_rl | f48dcfd4b9b0872de49dc5e91b8950fe825d0f0d | [
"MIT"
] | 9 | 2021-03-14T12:29:53.000Z | 2021-11-30T12:33:54.000Z | eval_exp_field.py | katetolstaya/graph_rl | f48dcfd4b9b0872de49dc5e91b8950fe825d0f0d | [
"MIT"
] | null | null | null | eval_exp_field.py | katetolstaya/graph_rl | f48dcfd4b9b0872de49dc5e91b8950fe825d0f0d | [
"MIT"
] | 1 | 2021-04-13T19:23:18.000Z | 2021-04-13T19:23:18.000Z | import numpy as np
import gym
import gym_flock
import glob
import sys
import rl_comm.gnn_fwd as gnn_fwd
from rl_comm.ppo2 import PPO2
from stable_baselines.common.vec_env import SubprocVecEnv
from stable_baselines.common.base_class import BaseRLModel
import matplotlib.pyplot as plt
plt.rcParams['font.family'] = 'serif... | 32.008333 | 113 | 0.611559 | import numpy as np
import gym
import gym_flock
import glob
import sys
import rl_comm.gnn_fwd as gnn_fwd
from rl_comm.ppo2 import PPO2
from stable_baselines.common.vec_env import SubprocVecEnv
from stable_baselines.common.base_class import BaseRLModel
import matplotlib.pyplot as plt
plt.rcParams['font.family'] = 'serif... | true | true |
f7655e3f36d9c22fc65abfe0bfef1729c775fbb1 | 987 | py | Python | setup.py | frostming/Flask-YmlConf | 813a173b6b0dff0dde26b994e1b73015ada14af7 | [
"MIT"
] | 2 | 2017-11-06T20:30:14.000Z | 2022-03-20T19:32:21.000Z | setup.py | frostming/Flask-YmlConf | 813a173b6b0dff0dde26b994e1b73015ada14af7 | [
"MIT"
] | null | null | null | setup.py | frostming/Flask-YmlConf | 813a173b6b0dff0dde26b994e1b73015ada14af7 | [
"MIT"
] | null | null | null | from setuptools import setup
import re
with open('flask_blogtheme.py', 'r') as f:
version = re.search(r'__version__\s*=\s*[\'"](.+)[\'"]', f.read()).group(1)
setup(
name='Flask-BlogTheme',
version=version,
description='Flask extension to read switch theme easily',
author='Frost Ming',
author_e... | 34.034483 | 79 | 0.619048 | from setuptools import setup
import re
with open('flask_blogtheme.py', 'r') as f:
version = re.search(r'__version__\s*=\s*[\'"](.+)[\'"]', f.read()).group(1)
setup(
name='Flask-BlogTheme',
version=version,
description='Flask extension to read switch theme easily',
author='Frost Ming',
author_e... | true | true |
f7655f34b86dc0b22efda9966b03f0fdefabe166 | 3,477 | py | Python | qa/rpc-tests/mempool_resurrect_test.py | TheUCoin/theucoin | 886ed0cff8758e6e625ade8d52597d4cb03ec73a | [
"MIT"
] | null | null | null | qa/rpc-tests/mempool_resurrect_test.py | TheUCoin/theucoin | 886ed0cff8758e6e625ade8d52597d4cb03ec73a | [
"MIT"
] | null | null | null | qa/rpc-tests/mempool_resurrect_test.py | TheUCoin/theucoin | 886ed0cff8758e6e625ade8d52597d4cb03ec73a | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# Copyright (c) 2014 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 resurrection of mined transactions when
# the blockchain is re-organized.
#
from test_framework impo... | 39.067416 | 92 | 0.659189 |
from test_framework import BitcoinTestFramework
from tucoinrpc.authproxy import AuthServiceProxy, JSONRPCException
from util import *
import os
import shutil
class MempoolCoinbaseTest(BitcoinTestFramework):
def setup_network(self):
args = ["-checkmempool", "-debug=mempool"]
self.nodes = ... | true | true |
f7655f71a23c4fd809eeb2e2843fb14ceaa8200e | 7,543 | py | Python | FeatureLayerViews/createViews.py | BertVermeij/CoolScripts | 8b0ec452d4c19babd6b42cf0b944dba831cfeb48 | [
"MIT"
] | 20 | 2021-01-08T11:01:14.000Z | 2022-02-28T08:12:14.000Z | FeatureLayerViews/createViews.py | BertVermeij/CoolScripts | 8b0ec452d4c19babd6b42cf0b944dba831cfeb48 | [
"MIT"
] | null | null | null | FeatureLayerViews/createViews.py | BertVermeij/CoolScripts | 8b0ec452d4c19babd6b42cf0b944dba831cfeb48 | [
"MIT"
] | 3 | 2021-08-06T13:11:05.000Z | 2021-11-07T03:50:25.000Z | import json
import copy
import requests
import datetime
from logUtils import *
# Log file location
_logFilePath = r"D:/Temp/Logging/createViews_[date].log"
# ArcGIS Online
_sourceFLUrl = "[YOUR-FEATURE-LAYER-URL]"
_uniqueValueField = "PROVINCIE"
_username = "[YOUR-USERNAME]"
_password = "[YOUR-PASSWORD]"
# Sript pa... | 34.760369 | 138 | 0.688453 | import json
import copy
import requests
import datetime
from logUtils import *
_logFilePath = r"D:/Temp/Logging/createViews_[date].log"
_sourceFLUrl = "[YOUR-FEATURE-LAYER-URL]"
_uniqueValueField = "PROVINCIE"
_username = "[YOUR-USERNAME]"
_password = "[YOUR-PASSWORD]"
_viewServiceProperties = ["serviceDescription"... | true | true |
f765609ca1bbe310ff2b5d0c5520b71182728615 | 11,170 | py | Python | pysnmp/CADANT-TIME-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/CADANT-TIME-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/CADANT-TIME-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module CADANT-TIME-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CADANT-TIME-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:28:52 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27... | 125.505618 | 1,417 | 0.751119 | Integer, ObjectIdentifier, OctetString = mibBuilder.importSymbols("ASN1", "Integer", "ObjectIdentifier", "OctetString")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ValueRangeConstraint, ValueSizeConstraint, ConstraintsUnion, SingleValueConstraint, ConstraintsIntersection = mibBuilder.impo... | true | true |
f76560c0ba3c9d76ba0c047b49fa36647dc6cef5 | 12,148 | py | Python | sdk/python/lib/pulumi/runtime/proto/provider_pb2_grpc.py | Strife96/pulumi | 66de4a48b78f663f7f6f1487dd15ff2a9d172912 | [
"Apache-2.0"
] | 1 | 2020-01-29T12:58:34.000Z | 2020-01-29T12:58:34.000Z | sdk/python/lib/pulumi/runtime/proto/provider_pb2_grpc.py | Strife96/pulumi | 66de4a48b78f663f7f6f1487dd15ff2a9d172912 | [
"Apache-2.0"
] | null | null | null | sdk/python/lib/pulumi/runtime/proto/provider_pb2_grpc.py | Strife96/pulumi | 66de4a48b78f663f7f6f1487dd15ff2a9d172912 | [
"Apache-2.0"
] | null | null | null | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
from . import plugin_pb2 as plugin__pb2
from . import provider_pb2 as provider__pb2
class ResourceProviderStub(object):
"""ResourceProvider is a service that... | 46.366412 | 118 | 0.746296 | import grpc
from google.protobuf import empty_pb2 as google_dot_protobuf_dot_empty__pb2
from . import plugin_pb2 as plugin__pb2
from . import provider_pb2 as provider__pb2
class ResourceProviderStub(object):
def __init__(self, channel):
self.CheckConfig = channel.unary_unary(
'/pulumirpc.ResourceProvi... | true | true |
f76561154874c36e39a0e86d94121459140653fd | 4,899 | py | Python | unittests/resources/checks_unlisted/deps_complex.py | mboisson/reframe | ebf0141596f19c7df60b59d8ad6211067f55b5e5 | [
"BSD-3-Clause"
] | null | null | null | unittests/resources/checks_unlisted/deps_complex.py | mboisson/reframe | ebf0141596f19c7df60b59d8ad6211067f55b5e5 | [
"BSD-3-Clause"
] | null | null | null | unittests/resources/checks_unlisted/deps_complex.py | mboisson/reframe | ebf0141596f19c7df60b59d8ad6211067f55b5e5 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2016-2020 Swiss National Supercomputing Centre (CSCS/ETH Zurich)
# ReFrame Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
import os
import reframe as rfm
import reframe.utility.sanity as sn
#
# The following tests implement the dependency graph be... | 25.515625 | 76 | 0.60543 |
import os
import reframe as rfm
import reframe.utility.sanity as sn
class BaseTest(rfm.RunOnlyRegressionTest):
def __init__(self):
self.valid_systems = ['*']
self.valid_prog_environs = ['*']
self.sourcesdir = None
self.executable = 'echo'
self._count = int(type(self).__na... | true | true |
f765611dd3c903493060833c65b558fbf56bbe59 | 3,792 | py | Python | flow/benchmarks/rllib/ars_runner.py | remusionita/flow_rl | f26cd13bdcc89c00fe980cd8d7873c88af8e2744 | [
"MIT"
] | 2 | 2020-12-03T21:13:39.000Z | 2022-03-13T09:12:43.000Z | flow/benchmarks/rllib/ars_runner.py | remusionita/flow_rl | f26cd13bdcc89c00fe980cd8d7873c88af8e2744 | [
"MIT"
] | 1 | 2019-12-05T09:04:05.000Z | 2019-12-05T21:23:49.000Z | flow/benchmarks/rllib/ars_runner.py | remusionita/flow_rl | f26cd13bdcc89c00fe980cd8d7873c88af8e2744 | [
"MIT"
] | 3 | 2019-12-07T11:36:21.000Z | 2020-01-04T16:29:57.000Z | """Runs the environments located in flow/benchmarks.
The environment file can be modified in the imports to change the environment
this runner script is executed on. This file runs the ARS algorithm in rllib
and utilizes the hyper-parameters specified in:
Simple random search provides a competitive approach to reinfor... | 30.095238 | 78 | 0.691983 | import json
import argparse
import ray
try:
from ray.rllib.agents.agent import get_agent_class
except ImportError:
from ray.rllib.agents.registry import get_agent_class
from ray.tune import run_experiments
from ray.tune.registry import register_env
from flow.utils.registry import make_create_env
from flow.uti... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.