hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
790c4cdbd1634d4e8ab5589ffeb64063bf179072 | 13,443 | py | Python | NaiveBayesClassifier.py | atahiraj/MLMovieReviewClassifier | 87ee1ddeeddd36117b97f3772df9ed3dc7fa1da0 | [
"MIT"
] | null | null | null | NaiveBayesClassifier.py | atahiraj/MLMovieReviewClassifier | 87ee1ddeeddd36117b97f3772df9ed3dc7fa1da0 | [
"MIT"
] | null | null | null | NaiveBayesClassifier.py | atahiraj/MLMovieReviewClassifier | 87ee1ddeeddd36117b97f3772df9ed3dc7fa1da0 | [
"MIT"
] | null | null | null | import re
import numpy
import math
import sys
#implementing the stop words and
def extractCleanWords(review):
stopWords = ["in", "i", "me", "my", "myself", "we", "our", "ours", "ourselves", "you",
"your", "yours", "yourself", "yourselves", "he", "him", "his", "himself", "she",
"her", "hers", "hers... | 39.654867 | 179 | 0.612512 | import re
import numpy
import math
import sys
def extractCleanWords(review):
stopWords = ["in", "i", "me", "my", "myself", "we", "our", "ours", "ourselves", "you",
"your", "yours", "yourself", "yourselves", "he", "him", "his", "himself", "she",
"her", "hers", "herself", "it", "its", "itself", "the... | true | true |
790c4d1a5bb2537983cd5241bfbfbce93c31f024 | 1,583 | py | Python | bibliopixel/control/keyboard.py | rec/leds | ed5fd11ed155e7008d4ef6d5b3d82cd7f8b3ed6a | [
"MIT"
] | 253 | 2015-01-03T23:17:57.000Z | 2021-12-14T02:31:08.000Z | bibliopixel/control/keyboard.py | rec/leds | ed5fd11ed155e7008d4ef6d5b3d82cd7f8b3ed6a | [
"MIT"
] | 879 | 2015-01-11T16:07:25.000Z | 2021-12-10T16:24:31.000Z | bibliopixel/control/keyboard.py | rec/leds | ed5fd11ed155e7008d4ef6d5b3d82cd7f8b3ed6a | [
"MIT"
] | 71 | 2015-01-04T01:02:47.000Z | 2022-03-25T18:30:10.000Z | import getpass, platform, sys, threading
from .. util import log
from . control import ExtractedControl
# See https://stackoverflow.com/questions/42603000
DARWIN_ROOT_WARNING = """
In MacOS, pynput must to be running as root in order to get keystrokes.
Try running your program like this:
sudo %s <your commands h... | 23.279412 | 71 | 0.60897 | import getpass, platform, sys, threading
from .. util import log
from . control import ExtractedControl
DARWIN_ROOT_WARNING = """
In MacOS, pynput must to be running as root in order to get keystrokes.
Try running your program like this:
sudo %s <your commands here>
"""
INSTALL_ERROR = """
Please install the p... | true | true |
790c4f18ec4cb2893207635b674172ab900ba258 | 8,886 | py | Python | .history/pages/intro_20220303160531.py | rypaik/Streamlit_Ref | 5ce11cecbe8307238463c126b88b3beed66c99fa | [
"MIT"
] | null | null | null | .history/pages/intro_20220303160531.py | rypaik/Streamlit_Ref | 5ce11cecbe8307238463c126b88b3beed66c99fa | [
"MIT"
] | null | null | null | .history/pages/intro_20220303160531.py | rypaik/Streamlit_Ref | 5ce11cecbe8307238463c126b88b3beed66c99fa | [
"MIT"
] | null | null | null | """
Off Multipage Cheatsheet
https://github.com/daniellewisDL/streamlit-cheat-sheet
@daniellewisDL : https://github.com/daniellewisDL
"""
import streamlit as st
from pathlib import Path
import base64
from modules.toc import *
# Initial page config
st.set_page_config(
page_title='Code Compendium Intro Page',
... | 26.845921 | 228 | 0.658226 | """
Off Multipage Cheatsheet
https://github.com/daniellewisDL/streamlit-cheat-sheet
@daniellewisDL : https://github.com/daniellewisDL
"""
import streamlit as st
from pathlib import Path
import base64
from modules.toc import *
st.set_page_config(
page_title='Code Compendium Intro Page',
layout="wide",
)... | false | true |
790c4f569deac0e789782b59e58ef492e5915eaf | 4,394 | py | Python | train/tfms.py | lluissalord/radiology_ai | 8b842502206f4bad53c2825beb1f58d2ed054d0d | [
"MIT"
] | 3 | 2021-02-08T10:58:22.000Z | 2021-08-18T19:51:27.000Z | train/tfms.py | lluissalord/radiology_ai | 8b842502206f4bad53c2825beb1f58d2ed054d0d | [
"MIT"
] | null | null | null | train/tfms.py | lluissalord/radiology_ai | 8b842502206f4bad53c2825beb1f58d2ed054d0d | [
"MIT"
] | null | null | null | from fastai.data.all import IntToFloatTensor
from fastai.vision.learner import *
from fastai.vision.augment import *
from fastai.vision.core import PILImageBW, PILImage
from fastai.vision.data import *
from preprocessing.transforms import *
# from preprocessing.dicom import *
from preprocessing.misc import *
def ge... | 30.303448 | 197 | 0.561447 | from fastai.data.all import IntToFloatTensor
from fastai.vision.learner import *
from fastai.vision.augment import *
from fastai.vision.core import PILImageBW, PILImage
from fastai.vision.data import *
from preprocessing.transforms import *
from preprocessing.misc import *
def get_item_tfms(run_params):
item_... | true | true |
790c5016a7012f3bdea209e0d82aeb0e30f0aae5 | 5,783 | py | Python | onmt/utils/parse.py | ACL2020-Submission/ACL2020 | 2a3d6e26d22c650cad823c68b65ee315aa1fe22c | [
"MIT"
] | null | null | null | onmt/utils/parse.py | ACL2020-Submission/ACL2020 | 2a3d6e26d22c650cad823c68b65ee315aa1fe22c | [
"MIT"
] | null | null | null | onmt/utils/parse.py | ACL2020-Submission/ACL2020 | 2a3d6e26d22c650cad823c68b65ee315aa1fe22c | [
"MIT"
] | null | null | null | import configargparse as cfargparse
import os
import torch
import onmt.opts as opts
from onmt.utils.logging import logger
class ArgumentParser(cfargparse.ArgumentParser):
def __init__(
self,
config_file_parser_class=cfargparse.YAMLConfigFileParser,
formatter_clas... | 41.307143 | 79 | 0.6175 | import configargparse as cfargparse
import os
import torch
import onmt.opts as opts
from onmt.utils.logging import logger
class ArgumentParser(cfargparse.ArgumentParser):
def __init__(
self,
config_file_parser_class=cfargparse.YAMLConfigFileParser,
formatter_clas... | true | true |
790c5028cb5c7b0ac170367e3ba00736ba805ec9 | 14,528 | py | Python | Configuration/PyReleaseValidation/scripts/runTheMatrix.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 1 | 2020-06-08T11:39:24.000Z | 2020-06-08T11:39:24.000Z | Configuration/PyReleaseValidation/scripts/runTheMatrix.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | null | null | null | Configuration/PyReleaseValidation/scripts/runTheMatrix.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 1 | 2020-07-26T16:42:20.000Z | 2020-07-26T16:42:20.000Z | #!/usr/bin/env python
from __future__ import print_function
import sys
from Configuration.PyReleaseValidation.MatrixReader import MatrixReader
from Configuration.PyReleaseValidation.MatrixRunner import MatrixRunner
from Configuration.PyReleaseValidation.MatrixInjector import MatrixInjector,performInjectionOptionTest
... | 41.390313 | 216 | 0.489744 |
from __future__ import print_function
import sys
from Configuration.PyReleaseValidation.MatrixReader import MatrixReader
from Configuration.PyReleaseValidation.MatrixRunner import MatrixRunner
from Configuration.PyReleaseValidation.MatrixInjector import MatrixInjector,performInjectionOptionTest
def showRaw... | true | true |
790c50c393f7e3d5309afc7e342afd439d7cb2e5 | 1,043 | py | Python | src/sage/algebras/algebra_element.py | robertwb/sage | 1b1e6f608d1ef8ee664bb19e991efbbc68cbd51f | [
"BSL-1.0"
] | 2 | 2018-06-30T01:37:35.000Z | 2018-06-30T01:37:39.000Z | src/sage/algebras/algebra_element.py | boothby/sage | 1b1e6f608d1ef8ee664bb19e991efbbc68cbd51f | [
"BSL-1.0"
] | null | null | null | src/sage/algebras/algebra_element.py | boothby/sage | 1b1e6f608d1ef8ee664bb19e991efbbc68cbd51f | [
"BSL-1.0"
] | null | null | null | """
Base class for algebra elements
"""
#*****************************************************************************
# Copyright (C) 2005 William Stein <wstein@gmail.com>
#
# Distributed under the terms of the GNU General Public License (GPL)
#
# This code is distributed in the hope that it will be useful,... | 31.606061 | 120 | 0.612656 |
from sage.misc.superseded import deprecation
deprecation(21141, "the module sage.algebras.algebra_element is deprecated, import from sage.structure.element instead")
from sage.structure.element import AlgebraElement
def is_AlgebraElement(x):
return isinstance(x, AlgebraElement)
| true | true |
790c51f87e0d519f54f3f2959899dd92256edd48 | 3,168 | py | Python | python/opscore/RO/ParseMsg/ParseData.py | sdss/opscore | dd4f2b2ad525fe3dfe3565463de2c079a7e1232e | [
"BSD-3-Clause"
] | null | null | null | python/opscore/RO/ParseMsg/ParseData.py | sdss/opscore | dd4f2b2ad525fe3dfe3565463de2c079a7e1232e | [
"BSD-3-Clause"
] | 1 | 2021-08-17T21:08:14.000Z | 2021-08-17T21:08:14.000Z | python/opscore/RO/ParseMsg/ParseData.py | sdss/opscore | dd4f2b2ad525fe3dfe3565463de2c079a7e1232e | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""Parse a keyword-value message.
History:
2002-12-16 ROwen
2003-06-25 ROwen Modified to return an opscore.RO.Alg.OrderedDict
2003-11-19 ROwen Modified header: keywords with no values may have an '='.
Added "noValKey=" to test cases as it caused an infinite loop.
2004-0... | 39.111111 | 92 | 0.636048 |
__all__ = ["parseKeyValueData"]
from .GetKeyword import getKeyword
from .GetValues import getValues
import opscore.RO.Alg
def parseKeyValueData(astr):
dataDict = opscore.RO.Alg.OrderedDict()
if astr == '':
return dataDict
nextInd = 0
while nextInd is not None:
keyword, nextInd = getK... | true | true |
790c53f7e56d39b1a643d9e18dc20fad39757347 | 507 | py | Python | python/ray/dataframe/index.py | cathywu/ray | 8e333977e0991738558f4c8bb737da5fb29df0c6 | [
"Apache-2.0"
] | 2 | 2017-12-19T08:18:51.000Z | 2018-01-19T02:42:28.000Z | python/ray/dataframe/index.py | cathywu/ray | 8e333977e0991738558f4c8bb737da5fb29df0c6 | [
"Apache-2.0"
] | 5 | 2018-01-04T22:54:34.000Z | 2018-02-06T23:48:20.000Z | python/ray/dataframe/index.py | cathywu/ray | 8e333977e0991738558f4c8bb737da5fb29df0c6 | [
"Apache-2.0"
] | 3 | 2018-01-04T21:18:42.000Z | 2019-01-20T05:34:33.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import pandas as pd
class Index(object):
def __init__(self, idx):
self.idx = idx
@classmethod
def to_pandas(indices):
if isinstance(indices[0], pd.RangeIndex):
merged... | 23.045455 | 49 | 0.625247 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import pandas as pd
class Index(object):
def __init__(self, idx):
self.idx = idx
@classmethod
def to_pandas(indices):
if isinstance(indices[0], pd.RangeIndex):
merged... | true | true |
790c54967d8d9b1d0670a59bf6bf62083c10aa50 | 3,073 | py | Python | tests/core/full_node/test_hint_store.py | ReadyNeutron/shitcoin-blockchain | 80add4e545ad22a317244f7fd958d118a5a75c5d | [
"Apache-2.0"
] | 174 | 2021-06-16T17:49:22.000Z | 2022-03-17T03:03:17.000Z | tests/core/full_node/test_hint_store.py | ReadyNeutron/shitcoin-blockchain | 80add4e545ad22a317244f7fd958d118a5a75c5d | [
"Apache-2.0"
] | 49 | 2021-06-17T14:10:53.000Z | 2022-01-31T11:04:21.000Z | tests/core/full_node/test_hint_store.py | ReadyNeutron/shitcoin-blockchain | 80add4e545ad22a317244f7fd958d118a5a75c5d | [
"Apache-2.0"
] | 80 | 2021-06-17T14:23:31.000Z | 2022-02-24T05:52:47.000Z | import asyncio
import logging
import pytest
from clvm.casts import int_to_bytes
from flax.consensus.blockchain import Blockchain
from flax.full_node.hint_store import HintStore
from flax.types.blockchain_format.coin import Coin
from flax.types.condition_opcodes import ConditionOpcode
from flax.types.condition_with_arg... | 33.402174 | 118 | 0.66645 | import asyncio
import logging
import pytest
from clvm.casts import int_to_bytes
from flax.consensus.blockchain import Blockchain
from flax.full_node.hint_store import HintStore
from flax.types.blockchain_format.coin import Coin
from flax.types.condition_opcodes import ConditionOpcode
from flax.types.condition_with_arg... | true | true |
790c565a9dbfdbb2e6752d4dc069ec6a95b66119 | 240 | py | Python | 07_RSI/ch03/sum.py | zzz0072/Python_Exercises | 9918aa8197a77ef237e5e60306c7785eca5cb1d3 | [
"BSD-2-Clause"
] | null | null | null | 07_RSI/ch03/sum.py | zzz0072/Python_Exercises | 9918aa8197a77ef237e5e60306c7785eca5cb1d3 | [
"BSD-2-Clause"
] | null | null | null | 07_RSI/ch03/sum.py | zzz0072/Python_Exercises | 9918aa8197a77ef237e5e60306c7785eca5cb1d3 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
def sum_recursin(numList):
if len(numList) == 1:
return numList[0]
else:
return numList[0] + sum_recursin(numList[1:])
if __name__ == "__main__":
print(sum_recursin(list(range(1, 101))))
| 21.818182 | 53 | 0.629167 |
def sum_recursin(numList):
if len(numList) == 1:
return numList[0]
else:
return numList[0] + sum_recursin(numList[1:])
if __name__ == "__main__":
print(sum_recursin(list(range(1, 101))))
| true | true |
790c57916664bdf52a3d4db6c000e84b671e95b2 | 1,489 | py | Python | run.py | alvarlagerlof/ball-pid | 6122e729782750818449645f97db41b31503a9aa | [
"MIT"
] | null | null | null | run.py | alvarlagerlof/ball-pid | 6122e729782750818449645f97db41b31503a9aa | [
"MIT"
] | null | null | null | run.py | alvarlagerlof/ball-pid | 6122e729782750818449645f97db41b31503a9aa | [
"MIT"
] | null | null | null | from math import ceil
from time import sleep
from config import *
from servo import *
from camera import *
from pid import *
# Init
servo1 = Servo(2)
servo2 = Servo(3)
servo_count = 0
#servo1.setAngle(90)
#sleep(1)
#servo2.setAngle(90)
#sleep(1)
camera = Camera()
PID = PID()
# Loop
while True:
data = ca... | 17.72619 | 137 | 0.534587 | from math import ceil
from time import sleep
from config import *
from servo import *
from camera import *
from pid import *
servo1 = Servo(2)
servo2 = Servo(3)
servo_count = 0
camera = Camera()
PID = PID()
while True:
data = camera.getBallPos()
if not (data[0] and data[1]):
print("N... | false | true |
790c589fa941e030ddafe079129ac8e67b8eeaee | 1,246 | py | Python | app/__init__.py | codebr3ak/Fast-Food-Fast | e8acf2a9b9bbc6ac7974a932a84c4dc344a4f968 | [
"MIT"
] | null | null | null | app/__init__.py | codebr3ak/Fast-Food-Fast | e8acf2a9b9bbc6ac7974a932a84c4dc344a4f968 | [
"MIT"
] | null | null | null | app/__init__.py | codebr3ak/Fast-Food-Fast | e8acf2a9b9bbc6ac7974a932a84c4dc344a4f968 | [
"MIT"
] | 1 | 2021-03-10T05:21:37.000Z | 2021-03-10T05:21:37.000Z | """
module init
"""
from flask import Flask
<<<<<<< HEAD
from config import config_options
from flask_sqlalchemy import SQLAlchemy
import os
=======
from config import DevelopmentConfig
from .views import orders_blue_print
>>>>>>> ba86ec7ade79a936b81e04ee8b80a97cf8f97770
def create_app(DevelopmentConfig):
"""
... | 21.118644 | 56 | 0.693419 | """
module init
"""
from flask import Flask
<<<<<<< HEAD
from config import config_options
from flask_sqlalchemy import SQLAlchemy
import os
=======
from config import DevelopmentConfig
from .views import orders_blue_print
>>>>>>> ba86ec7ade79a936b81e04ee8b80a97cf8f97770
def create_app(DevelopmentConfig):
"""
... | false | true |
790c594f7ddb0992fcaa78a7176ea150f0f11fb4 | 692 | py | Python | MetaLearning/MatchingNetworks/storage.py | likesiwell/DL_Code_Repos | 8e5eb7c8a0e77ea6768ba8c755f671e7f9d02097 | [
"MIT"
] | 1 | 2018-02-05T13:52:18.000Z | 2018-02-05T13:52:18.000Z | MetaLearning/MatchingNetworks/storage.py | likesiwell/DL_Code_Repos | 8e5eb7c8a0e77ea6768ba8c755f671e7f9d02097 | [
"MIT"
] | null | null | null | MetaLearning/MatchingNetworks/storage.py | likesiwell/DL_Code_Repos | 8e5eb7c8a0e77ea6768ba8c755f671e7f9d02097 | [
"MIT"
] | null | null | null | import csv
def save_statistics(experiment_name, line_to_add):
with open("{}.csv".format(experiment_name), 'a') as f:
writer = csv.writer(f)
writer.writerow(line_to_add)
def load_statistics(experiment_name):
data_dict = dict()
with open("{}.csv".format(experiment_name), 'r') as f:
l... | 25.62963 | 58 | 0.58237 | import csv
def save_statistics(experiment_name, line_to_add):
with open("{}.csv".format(experiment_name), 'a') as f:
writer = csv.writer(f)
writer.writerow(line_to_add)
def load_statistics(experiment_name):
data_dict = dict()
with open("{}.csv".format(experiment_name), 'r') as f:
l... | true | true |
790c5a487bdcae7102f84217bc9e433fc15e4b6e | 16,078 | py | Python | tests/test_chatbot.py | nadimpayak/ChatBot | cce2377cb445000a5b2e3bc39b955276ae217740 | [
"BSD-3-Clause"
] | null | null | null | tests/test_chatbot.py | nadimpayak/ChatBot | cce2377cb445000a5b2e3bc39b955276ae217740 | [
"BSD-3-Clause"
] | null | null | null | tests/test_chatbot.py | nadimpayak/ChatBot | cce2377cb445000a5b2e3bc39b955276ae217740 | [
"BSD-3-Clause"
] | null | null | null | from tests.base_case import ChatBotTestCase
from chatterbot.logic import LogicAdapter
from chatterbot.conversation import Statement
class ChatterBotResponseTestCase(ChatBotTestCase):
def test_conversation_values_persisted_to_response(self):
response = self.chatbot.get_response('Hello', persist_values_to_... | 38.464115 | 123 | 0.668056 | from tests.base_case import ChatBotTestCase
from chatterbot.logic import LogicAdapter
from chatterbot.conversation import Statement
class ChatterBotResponseTestCase(ChatBotTestCase):
def test_conversation_values_persisted_to_response(self):
response = self.chatbot.get_response('Hello', persist_values_to_... | true | true |
790c5b379c0da24ecfec766b38b7d9d3632b32e1 | 2,638 | py | Python | plot_mds_cond.py | jona-sassenhagen/URIAL | ed4e9cc99bac0a7ec8772ad72c3d85581be71de0 | [
"BSD-3-Clause"
] | null | null | null | plot_mds_cond.py | jona-sassenhagen/URIAL | ed4e9cc99bac0a7ec8772ad72c3d85581be71de0 | [
"BSD-3-Clause"
] | null | null | null | plot_mds_cond.py | jona-sassenhagen/URIAL | ed4e9cc99bac0a7ec8772ad72c3d85581be71de0 | [
"BSD-3-Clause"
] | null | null | null | def plot_mds_cond(rdm):
'''function to visualize RDM via multidimensional scaling'''
# big kudos to Jona Sassenhagen for doing an amazing job
# adding condition names and colors to the mds plot
# import modules and functions
import numpy as np
import pandas as pd
import seaborn as sns
... | 32.975 | 88 | 0.653904 | def plot_mds_cond(rdm):
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn import manifold
from sklearn.decomposition import PCA
from matplotlib.collections import LineCollection
ex_col=0)
df.index = df.columns ... | true | true |
790c5bf214ecb97f0755569e215d0f279d8471ee | 6,965 | py | Python | visualize.py | mirtorande/grpf-tool | 5c20365366503f28d63f861f1b0326cf1dcdcd7e | [
"CC0-1.0"
] | 1 | 2021-03-25T20:51:13.000Z | 2021-03-25T20:51:13.000Z | visualize.py | mirtorande/grpf-tool | 5c20365366503f28d63f861f1b0326cf1dcdcd7e | [
"CC0-1.0"
] | null | null | null | visualize.py | mirtorande/grpf-tool | 5c20365366503f28d63f861f1b0326cf1dcdcd7e | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python3
from matplotlib.patches import Circle, Rectangle, ConnectionPatch
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import animation
from math import floor
Colors = ['green', 'purple', 'orange', 'red', 'blue', 'yellow']
class Animation:
def __init__(self, my_map, starts, g... | 41.706587 | 158 | 0.535822 |
from matplotlib.patches import Circle, Rectangle, ConnectionPatch
import matplotlib.pyplot as plt
import numpy as np
from matplotlib import animation
from math import floor
Colors = ['green', 'purple', 'orange', 'red', 'blue', 'yellow']
class Animation:
def __init__(self, my_map, starts, goals, paths, predictio... | true | true |
790c5cd73f720c4705a7e0c57f532296b4321a6d | 5,650 | py | Python | test/unit/test_parkingy_things.py | hexter2018/sentinel | 99dc1f1b6eeb49d2b98eddddb2c43d9e350940c9 | [
"MIT"
] | null | null | null | test/unit/test_parkingy_things.py | hexter2018/sentinel | 99dc1f1b6eeb49d2b98eddddb2c43d9e350940c9 | [
"MIT"
] | null | null | null | test/unit/test_parkingy_things.py | hexter2018/sentinel | 99dc1f1b6eeb49d2b98eddddb2c43d9e350940c9 | [
"MIT"
] | null | null | null | import pytest
import sys
import os
os.environ['SENTINEL_CONFIG'] = os.path.normpath(os.path.join(os.path.dirname(__file__), '../test_sentinel.conf'))
sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), '../../lib')))
@pytest.fixture
def valid_parking_address(network='mainnet'):
return 'yYe8Kw... | 40.070922 | 380 | 0.777699 | import pytest
import sys
import os
os.environ['SENTINEL_CONFIG'] = os.path.normpath(os.path.join(os.path.dirname(__file__), '../test_sentinel.conf'))
sys.path.append(os.path.normpath(os.path.join(os.path.dirname(__file__), '../../lib')))
@pytest.fixture
def valid_parking_address(network='mainnet'):
return 'yYe8Kw... | true | true |
790c5ceee140cc410ea703f768529c4f172a1fea | 2,260 | py | Python | examples/Boyd_lqr.py | msakai/chainer-differentiable-mpc | dba5712f42a684748515d9ad5e2ff2823516c88e | [
"MIT"
] | 10 | 2019-10-07T03:00:42.000Z | 2022-01-14T01:49:14.000Z | examples/Boyd_lqr.py | msakai/chainer-differentiable-mpc | dba5712f42a684748515d9ad5e2ff2823516c88e | [
"MIT"
] | null | null | null | examples/Boyd_lqr.py | msakai/chainer-differentiable-mpc | dba5712f42a684748515d9ad5e2ff2823516c88e | [
"MIT"
] | 6 | 2019-10-08T05:04:40.000Z | 2022-02-28T09:40:54.000Z | # -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# text_representation:
# extension: .py
# format_name: light
# format_version: '1.4'
# jupytext_version: 1.2.1
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# ---
import sys
print(sys.path)
sys.... | 23.298969 | 96 | 0.567257 |
import sys
print(sys.path)
sys.path.append("../lqr")
from lqr_recursion import LqrRecursion
import chainer
import numpy as np
import matplotlib.pyplot as plt
T =51
f = None
n_state =3
n_ctrl =1
n_sc = n_ctrl +n_state
F =chainer.Variable(np.array([(np.array([[
1.0,0, 0, 1],
[1,1.0,0,0],
[0, 1,... | true | true |
790c5e3bc06dbbfc7cc0dd46b37ad7eaabe03919 | 282 | py | Python | core/modules/handler/__init__.py | codacy-badger/nebula-2 | 81a257f6485da1899a2cb1df348a57332aa4b55c | [
"Apache-2.0"
] | null | null | null | core/modules/handler/__init__.py | codacy-badger/nebula-2 | 81a257f6485da1899a2cb1df348a57332aa4b55c | [
"Apache-2.0"
] | null | null | null | core/modules/handler/__init__.py | codacy-badger/nebula-2 | 81a257f6485da1899a2cb1df348a57332aa4b55c | [
"Apache-2.0"
] | null | null | null | __all__ = ["main_handler",
"welcome",
"bad_words",
"admin_command",
"joke",
"send_nudes",
"custom_handler",
"delete_buttons",
"super_ban_handler"
]
from core.modules.handler import * | 23.5 | 34 | 0.478723 | __all__ = ["main_handler",
"welcome",
"bad_words",
"admin_command",
"joke",
"send_nudes",
"custom_handler",
"delete_buttons",
"super_ban_handler"
]
from core.modules.handler import * | true | true |
790c5e409b73da6e783e80a037b3297ffd5fb732 | 2,047 | py | Python | tests/tagtrain/test_remove.py | c17r/TagTrain | 5aa1ca36439cc5e81d0c691f905a4bb879b78399 | [
"MIT"
] | null | null | null | tests/tagtrain/test_remove.py | c17r/TagTrain | 5aa1ca36439cc5e81d0c691f905a4bb879b78399 | [
"MIT"
] | 7 | 2020-03-24T17:54:31.000Z | 2021-09-21T12:34:34.000Z | tests/tagtrain/test_remove.py | c17r/TagTrain | 5aa1ca36439cc5e81d0c691f905a4bb879b78399 | [
"MIT"
] | null | null | null | from unittest.mock import MagicMock, patch, call
from tagtrain import data
from . import fake
from tagtrain.tagtrain.tt_remove import Remove
@patch('tagtrain.data.by_owner.remove_user_from_group')
def test_unknown_group(remove_user_from_group):
remove_user_from_group.side_effect = data.Group.DoesNotExist()
... | 38.622642 | 106 | 0.778701 | from unittest.mock import MagicMock, patch, call
from tagtrain import data
from . import fake
from tagtrain.tagtrain.tt_remove import Remove
@patch('tagtrain.data.by_owner.remove_user_from_group')
def test_unknown_group(remove_user_from_group):
remove_user_from_group.side_effect = data.Group.DoesNotExist()
... | true | true |
790c5e8c77ccc8d864f5d6056fd6ac278203a09d | 1,531 | py | Python | statsd/client/udp.py | cclauss/pystatsd-1 | 1c90b9fdf322680e2625da659abc2aa5d79b5bff | [
"MIT"
] | null | null | null | statsd/client/udp.py | cclauss/pystatsd-1 | 1c90b9fdf322680e2625da659abc2aa5d79b5bff | [
"MIT"
] | null | null | null | statsd/client/udp.py | cclauss/pystatsd-1 | 1c90b9fdf322680e2625da659abc2aa5d79b5bff | [
"MIT"
] | 1 | 2020-11-01T04:03:38.000Z | 2020-11-01T04:03:38.000Z | from __future__ import absolute_import, division, unicode_literals
import socket
from .base import StatsClientBase, PipelineBase
class Pipeline(PipelineBase):
def __init__(self, client):
super(Pipeline, self).__init__(client)
self._maxudpsize = client._maxudpsize
def _send(self):
d... | 30.019608 | 66 | 0.594383 | from __future__ import absolute_import, division, unicode_literals
import socket
from .base import StatsClientBase, PipelineBase
class Pipeline(PipelineBase):
def __init__(self, client):
super(Pipeline, self).__init__(client)
self._maxudpsize = client._maxudpsize
def _send(self):
d... | true | true |
790c5f4af793f98a8a8efe7949d616b14f82edda | 2,828 | py | Python | src/predictionAlgorithms/machineLearning/helpers/callbacks.py | aivaras-ciurlionis/meteo | 434759d16f7cca505d280475611d1fef5176827b | [
"MIT"
] | null | null | null | src/predictionAlgorithms/machineLearning/helpers/callbacks.py | aivaras-ciurlionis/meteo | 434759d16f7cca505d280475611d1fef5176827b | [
"MIT"
] | 6 | 2020-05-23T11:30:48.000Z | 2022-03-11T23:45:06.000Z | src/predictionAlgorithms/machineLearning/helpers/callbacks.py | aivaras-ciurlionis/meteo | 434759d16f7cca505d280475611d1fef5176827b | [
"MIT"
] | null | null | null | import keras
from sklearn.metrics import roc_auc_score
from src.predictionAlgorithms.machineLearning.helpers.validation import Validation
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import numpy as np
import os
import glob
class Callbacks(keras.callbacks.Callback):
validationSequences =... | 28 | 82 | 0.597595 | import keras
from sklearn.metrics import roc_auc_score
from src.predictionAlgorithms.machineLearning.helpers.validation import Validation
import matplotlib
matplotlib.use('agg')
import matplotlib.pyplot as plt
import numpy as np
import os
import glob
class Callbacks(keras.callbacks.Callback):
validationSequences =... | true | true |
790c5f9070d838cdcf8fa8c3eb3daa1d9f51e605 | 3,766 | py | Python | olfactometry/utils.py | olfa-lab/PyBpodGUI | 73895e493d982fd1d3abb5c8b521de116ef87c79 | [
"MIT"
] | null | null | null | olfactometry/utils.py | olfa-lab/PyBpodGUI | 73895e493d982fd1d3abb5c8b521de116ef87c79 | [
"MIT"
] | null | null | null | olfactometry/utils.py | olfa-lab/PyBpodGUI | 73895e493d982fd1d3abb5c8b521de116ef87c79 | [
"MIT"
] | 1 | 2021-12-03T16:18:57.000Z | 2021-12-03T16:18:57.000Z | import os
import json
import logging
import serial
from serial.tools import list_ports
import time
CONFIG_FILENAME_DEFAULT = 'olfa_config.json'
def get_olfa_config(config_filename=''):
"""
Find and parse olfactometer configuration JSON.
:param config_filename: string with path to configuration.
:re... | 36.921569 | 115 | 0.674456 | import os
import json
import logging
import serial
from serial.tools import list_ports
import time
CONFIG_FILENAME_DEFAULT = 'olfa_config.json'
def get_olfa_config(config_filename=''):
if not config_filename:
logging.info("No olfa config file specified, looking for default in OLFA_CONFIG os variable")
... | true | true |
790c5fcb996d72b9571af6b7d6b1843518659273 | 7,274 | py | Python | src/drf_yasg/renderers.py | yihuang/drf-yasg | e860ce315f85b93731b5d7a7dfcc91149d2a1948 | [
"BSD-3-Clause"
] | null | null | null | src/drf_yasg/renderers.py | yihuang/drf-yasg | e860ce315f85b93731b5d7a7dfcc91149d2a1948 | [
"BSD-3-Clause"
] | null | null | null | src/drf_yasg/renderers.py | yihuang/drf-yasg | e860ce315f85b93731b5d7a7dfcc91149d2a1948 | [
"BSD-3-Clause"
] | null | null | null | import six
from django.shortcuts import render, resolve_url
from django.utils.functional import Promise
from rest_framework.renderers import BaseRenderer, JSONRenderer, TemplateHTMLRenderer
from rest_framework.utils import json
from .app_settings import redoc_settings, swagger_settings
from .codecs import VALIDATORS,... | 41.096045 | 110 | 0.690267 | import six
from django.shortcuts import render, resolve_url
from django.utils.functional import Promise
from rest_framework.renderers import BaseRenderer, JSONRenderer, TemplateHTMLRenderer
from rest_framework.utils import json
from .app_settings import redoc_settings, swagger_settings
from .codecs import VALIDATORS,... | true | true |
790c61d66ec9360ba20d79b6857506daf66299c9 | 287,940 | py | Python | core/domain/prod_validation_jobs_one_off_test.py | cclauss/oppia | 7ad9d06e434c589f0aaa015252ca65872557b7eb | [
"Apache-2.0"
] | null | null | null | core/domain/prod_validation_jobs_one_off_test.py | cclauss/oppia | 7ad9d06e434c589f0aaa015252ca65872557b7eb | [
"Apache-2.0"
] | null | null | null | core/domain/prod_validation_jobs_one_off_test.py | cclauss/oppia | 7ad9d06e434c589f0aaa015252ca65872557b7eb | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2019 The Oppia 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 requi... | 45.437904 | 80 | 0.623512 |
import ast
import datetime
import math
import random
import time
import types
from constants import constants
from core import jobs_registry
from core.domain import collection_domain
from core.domain import collection_services
from core.domain import exp_domain
from core.domain import exp_services
fro... | true | true |
790c61e7caf3c5a4f8d9695f7cbfc3e62c4f4f4b | 3,191 | py | Python | catalog/packages/serializers/vnf_pkg_software_image_info.py | onap/archive-vfc-nfvo-catalog | 24b92a2210c2063935d313f08e1da1e9cee45f3f | [
"Apache-2.0"
] | 1 | 2019-09-25T05:38:42.000Z | 2019-09-25T05:38:42.000Z | catalog/packages/serializers/vnf_pkg_software_image_info.py | onap/archive-vfc-nfvo-catalog | 24b92a2210c2063935d313f08e1da1e9cee45f3f | [
"Apache-2.0"
] | 3 | 2021-02-03T08:59:39.000Z | 2022-03-18T02:18:12.000Z | catalog/packages/serializers/vnf_pkg_software_image_info.py | onap/modeling-etsicatalog | b16b4579ea80bf82fa497e4934b2bb8728845b58 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 ZTE Corporation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 32.896907 | 102 | 0.65246 |
from rest_framework import serializers
from .checksum import ChecksumSerializer
class VnfPackageSoftwareImageInfoSerializer(serializers.Serializer):
id = serializers.CharField(
help_text="Identifier of the software image.",
required=True,
allow_null=False,
allow_blank... | true | true |
790c63efac271f58e148285b1f49e65a7b5b0f1f | 1,945 | py | Python | jax/experimental/jax2tf/tests/tf_test_util.py | BuddenD/jax | 269da0ae584cfe840f34e9f871f13c28e2772de5 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-07-10T03:59:22.000Z | 2021-07-10T03:59:22.000Z | jax/experimental/jax2tf/tests/tf_test_util.py | BuddenD/jax | 269da0ae584cfe840f34e9f871f13c28e2772de5 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | jax/experimental/jax2tf/tests/tf_test_util.py | BuddenD/jax | 269da0ae584cfe840f34e9f871f13c28e2772de5 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 38.9 | 80 | 0.701285 |
import numpy as np
from typing import Any, Callable, Tuple
import tensorflow as tf
from jax.config import config
from jax import dtypes
from jax.experimental import jax2tf
from jax import test_util as jtu
class JaxToTfTestCase(jtu.JaxTestCase):
def assertDtypesMatch(self, x, y, *, canonicalize_dtyp... | true | true |
790c641b1df01558b4d6684daf150ecb67a02a07 | 387 | py | Python | porta/wsgi.py | Asisrael/examen | 8b3c2a8c9578c5ba1d0135822df696804401f2ab | [
"bzip2-1.0.6"
] | null | null | null | porta/wsgi.py | Asisrael/examen | 8b3c2a8c9578c5ba1d0135822df696804401f2ab | [
"bzip2-1.0.6"
] | null | null | null | porta/wsgi.py | Asisrael/examen | 8b3c2a8c9578c5ba1d0135822df696804401f2ab | [
"bzip2-1.0.6"
] | null | null | null | """
WSGI config for porta project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTING... | 22.764706 | 78 | 0.782946 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'porta.settings')
application = get_wsgi_application()
| true | true |
790c64262f02cb1d9cb0e7ff120b22923f664d0b | 2,257 | py | Python | misc/sealog_repeater_receive.py | WHOIGit/ndsf-sealog-server | e57843e3e23a924ccf6fc1ef1e40d92f36a3b612 | [
"MIT"
] | 4 | 2019-10-29T21:53:13.000Z | 2021-12-02T00:38:42.000Z | misc/sealog_repeater_receive.py | WHOIGit/ndsf-sealog-server | e57843e3e23a924ccf6fc1ef1e40d92f36a3b612 | [
"MIT"
] | 14 | 2020-05-28T16:39:30.000Z | 2021-05-22T06:01:40.000Z | misc/sealog_repeater_receive.py | WHOIGit/ndsf-sealog-server | e57843e3e23a924ccf6fc1ef1e40d92f36a3b612 | [
"MIT"
] | 1 | 2020-01-31T00:00:42.000Z | 2020-01-31T00:00:42.000Z | #!/usr/bin/env python3
# still in development
#
import asyncio
import websockets
import json
import requests
eventsAPIPath = '/api/v1/events'
localServerIP = '0.0.0.0'
localServerAPIPort = '8000'
localServerWSPort = '8000'
localServerPath = '/sealog-server'
localToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI... | 31.347222 | 251 | 0.692955 |
import asyncio
import websockets
import json
import requests
eventsAPIPath = '/api/v1/events'
localServerIP = '0.0.0.0'
localServerAPIPort = '8000'
localServerWSPort = '8000'
localServerPath = '/sealog-server'
localToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjU5ODFmMTY3MjEyYjM0OGFlZDdmYTlmNSIsInNjb3Bl... | true | true |
790c659a50c3d3b7ede5f45a212e71ef09b14018 | 1,442 | py | Python | Data Fusion Test/Minimos Quadrados Puro.py | Raphael-C-Almeida/Wireless-Sensor-Network | 8d12b06ddec1b5f3da28fd9b94b43bc4ac4518cf | [
"MIT"
] | 1 | 2018-11-25T20:08:48.000Z | 2018-11-25T20:08:48.000Z | Data Fusion Test/Minimos Quadrados Puro.py | Raphael-C-Almeida/Wireless-Sensor-Network | 8d12b06ddec1b5f3da28fd9b94b43bc4ac4518cf | [
"MIT"
] | null | null | null | Data Fusion Test/Minimos Quadrados Puro.py | Raphael-C-Almeida/Wireless-Sensor-Network | 8d12b06ddec1b5f3da28fd9b94b43bc4ac4518cf | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
def gen_data(n, start=0, end=10):
x = np.linspace(start, end, n)
y = np.sin(10*x) - x*x
return y
def gen_data_osc(n):
return np.array([1024 + (-2)**(-i/100) for i in range(n)])
def gen_data_rand(n):
return np.random.randn(n) + 0.3*np.... | 24.862069 | 78 | 0.613731 | import matplotlib.pyplot as plt
import numpy as np
def gen_data(n, start=0, end=10):
x = np.linspace(start, end, n)
y = np.sin(10*x) - x*x
return y
def gen_data_osc(n):
return np.array([1024 + (-2)**(-i/100) for i in range(n)])
def gen_data_rand(n):
return np.random.randn(n) + 0.3*np.... | true | true |
790c65c42dd20d86f9f0074087714fdd05634d1a | 2,722 | py | Python | env/Lib/site-packages/tests/test_PR.py | L0dz/auto-post | 91563235a74336e4326a13b142c05c6755e0cf47 | [
"Apache-2.0"
] | null | null | null | env/Lib/site-packages/tests/test_PR.py | L0dz/auto-post | 91563235a74336e4326a13b142c05c6755e0cf47 | [
"Apache-2.0"
] | 6 | 2019-12-17T13:32:08.000Z | 2021-06-02T00:49:29.000Z | cineBot/lib/python3.6/site-packages/tests/test_PR.py | furkanalpereny/cineBot | cb93b6fc6ab25ba0601067f54b6824a8462f470d | [
"MIT"
] | null | null | null | """
Tests meant to be run with pytest
"""
import sys
import os
import pytest
from moviepy.editor import *
from moviepy.video.tools.interpolators import Trajectory
import sys
sys.path.append("tests")
import download_media
from test_helper import PYTHON_VERSION, TMP_DIR, TRAVIS
def test_download_media(capsys):
w... | 27.77551 | 79 | 0.630051 |
import sys
import os
import pytest
from moviepy.editor import *
from moviepy.video.tools.interpolators import Trajectory
import sys
sys.path.append("tests")
import download_media
from test_helper import PYTHON_VERSION, TMP_DIR, TRAVIS
def test_download_media(capsys):
with capsys.disabled():
download_med... | true | true |
790c65e13683bf49316ebe0a262eadf6d21d4058 | 5,280 | py | Python | apps/vit/api.py | Visualway/Vitary | c7db9a25837fa7390b2177b9db48e73c6f1ab3c8 | [
"BSD-3-Clause"
] | 4 | 2021-12-24T16:07:44.000Z | 2022-03-04T02:30:20.000Z | apps/vit/api.py | Visualway/Vitary | c7db9a25837fa7390b2177b9db48e73c6f1ab3c8 | [
"BSD-3-Clause"
] | 4 | 2021-12-30T13:32:56.000Z | 2022-03-15T03:58:48.000Z | apps/vit/api.py | Visualway/Vitary | c7db9a25837fa7390b2177b9db48e73c6f1ab3c8 | [
"BSD-3-Clause"
] | null | null | null | import json
import re
from django.http import JsonResponse
from django.db.models import Q
from django.urls import reverse
from django.views.decorators.csrf import csrf_exempt
from apps.vit.models import Vit
from apps.notification.utilities import notify
from apps.vit.utilities import find_mention, find_plustag
from .... | 39.111111 | 146 | 0.586174 | import json
import re
from django.http import JsonResponse
from django.db.models import Q
from django.urls import reverse
from django.views.decorators.csrf import csrf_exempt
from apps.vit.models import Vit
from apps.notification.utilities import notify
from apps.vit.utilities import find_mention, find_plustag
from .... | true | true |
790c663c396e5ece82b4204d3424a93b2fd0eb35 | 7,912 | py | Python | src/eval.py | hummat/convolutional_occupancy_networks | bb351edff59c196e01aa687943e19fee4ac11077 | [
"MIT"
] | null | null | null | src/eval.py | hummat/convolutional_occupancy_networks | bb351edff59c196e01aa687943e19fee4ac11077 | [
"MIT"
] | null | null | null | src/eval.py | hummat/convolutional_occupancy_networks | bb351edff59c196e01aa687943e19fee4ac11077 | [
"MIT"
] | null | null | null | import logging
import numpy as np
import trimesh
from src.common import compute_iou
# from scipy.spatial import cKDTree
from src.utils.libkdtree import KDTree
from src.utils.libmesh import check_mesh_contains
# Maximum values for bounding box [-0.5, 0.5]^3
EMPTY_PCL_DICT = {
'completeness': np.sqrt(3),
'accu... | 36.293578 | 126 | 0.605536 | import logging
import numpy as np
import trimesh
from src.common import compute_iou
from src.utils.libkdtree import KDTree
from src.utils.libmesh import check_mesh_contains
EMPTY_PCL_DICT = {
'completeness': np.sqrt(3),
'accuracy': np.sqrt(3),
'completeness2': 3,
'accuracy2': 3,
'chamfer': 6,
}... | true | true |
790c66547531536f4bc1eeec53b6e037c55a0e43 | 14,452 | py | Python | tensorflow_probability/python/internal/backend/numpy/numpy_array.py | simeoncarstens/probability | 054a720ff9f221dd9660acd7ce7fb38a1dbb1290 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/internal/backend/numpy/numpy_array.py | simeoncarstens/probability | 054a720ff9f221dd9660acd7ce7fb38a1dbb1290 | [
"Apache-2.0"
] | 2 | 2021-08-25T16:14:51.000Z | 2022-02-10T04:47:11.000Z | tensorflow_probability/python/internal/backend/numpy/numpy_array.py | michalbrys/probability | 054a720ff9f221dd9660acd7ce7fb38a1dbb1290 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 29.736626 | 111 | 0.679076 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import functools
import numpy as np
from tensorflow_probability.python.internal.backend.numpy import _utils as utils
from tensorflow_probability.python.internal.backend.numpy import ops
from te... | true | true |
790c66566a61f71f21523cf5a6ec3643721ff40a | 6,021 | py | Python | src/model/sed_ogits.py | Vanova/mfom_attribute_detection | 450cf79226f2b26407aa0d2636d0f5217d6f4f48 | [
"MIT"
] | 11 | 2019-03-02T11:05:28.000Z | 2022-02-15T15:51:46.000Z | src/model/sed_ogits.py | Vanova/mfom_attribute_detection | 450cf79226f2b26407aa0d2636d0f5217d6f4f48 | [
"MIT"
] | null | null | null | src/model/sed_ogits.py | Vanova/mfom_attribute_detection | 450cf79226f2b26407aa0d2636d0f5217d6f4f48 | [
"MIT"
] | 5 | 2019-03-02T11:05:31.000Z | 2020-09-01T20:33:05.000Z | import keras.backend as K
from keras.models import Model
from keras.layers import Dense, MaxPooling2D, Conv2D, Activation, \
Dropout, Reshape, Input, BatchNormalization, GRU, Bidirectional, Permute, TimeDistributed
from keras.optimizers import Adam, SGD, Adadelta, RMSprop
import src.model.mfom as mfom
import src.mo... | 39.352941 | 122 | 0.603222 | import keras.backend as K
from keras.models import Model
from keras.layers import Dense, MaxPooling2D, Conv2D, Activation, \
Dropout, Reshape, Input, BatchNormalization, GRU, Bidirectional, Permute, TimeDistributed
from keras.optimizers import Adam, SGD, Adadelta, RMSprop
import src.model.mfom as mfom
import src.mo... | true | true |
790c667af0b3ef0f91b2ea3e4d81e454bdd15744 | 1,239 | py | Python | db_characters.py | JackNolanDev/vennt-server | 03c6c450d50f9f7e8ab0bb844a1cad6b68e5aa47 | [
"MIT"
] | null | null | null | db_characters.py | JackNolanDev/vennt-server | 03c6c450d50f9f7e8ab0bb844a1cad6b68e5aa47 | [
"MIT"
] | null | null | null | db_characters.py | JackNolanDev/vennt-server | 03c6c450d50f9f7e8ab0bb844a1cad6b68e5aa47 | [
"MIT"
] | null | null | null | # Josh Aaron Miller 2021
# VenntDB methods for Characters
import venntdb
from constants import *
# VenntDB Methods
def character_exists(self, username, char_id):
return self.get_character(username, char_id) is not None
def get_character(self, username, char_id):
self.assert_valid("accounts",... | 30.219512 | 77 | 0.702986 |
import venntdb
from constants import *
def character_exists(self, username, char_id):
return self.get_character(username, char_id) is not None
def get_character(self, username, char_id):
self.assert_valid("accounts", username, "characters")
if self.is_valid("accounts", username, "charac... | true | true |
790c6680a68ee15abeaeba01dd8ecfef161ac03b | 2,404 | py | Python | examples/test_cam_config.py | vihank/gym-donkeycar | 2e3cd780d92f3d5da5a0f9c67272a0cd3f08befe | [
"MIT"
] | null | null | null | examples/test_cam_config.py | vihank/gym-donkeycar | 2e3cd780d92f3d5da5a0f9c67272a0cd3f08befe | [
"MIT"
] | null | null | null | examples/test_cam_config.py | vihank/gym-donkeycar | 2e3cd780d92f3d5da5a0f9c67272a0cd3f08befe | [
"MIT"
] | null | null | null | """ Test the gym's code for configuring the DonkeyCar's camera settings.
"""
import os
import argparse
import gym
import gym_donkeycar
import numpy as np
import uuid
if __name__ == "__main__":
# Initialize the donkey environment
# where env_name one of:
env_list = [
"donkey-warehouse-v0",
... | 27.953488 | 129 | 0.553245 |
import os
import argparse
import gym
import gym_donkeycar
import numpy as np
import uuid
if __name__ == "__main__":
env_list = [
"donkey-warehouse-v0",
"donkey-generated-roads-v0",
"donkey-avc-sparkfun-v0",
"donkey-generated-track-v0",
"donkey-roboracingleague-tr... | true | true |
790c6760cbb5ba7a7d7f0f6662088b050841c907 | 2,274 | py | Python | pyqtgraph/opengl/items/GLMeshItem.py | robertsj/poropy | 481a604339c9fa797817b2b0a55448329685c1d8 | [
"MIT"
] | 1 | 2018-02-11T11:24:14.000Z | 2018-02-11T11:24:14.000Z | pyqtgraph/opengl/items/GLMeshItem.py | robertsj/poropy | 481a604339c9fa797817b2b0a55448329685c1d8 | [
"MIT"
] | 1 | 2018-06-12T16:15:31.000Z | 2018-06-12T16:15:31.000Z | pyqtgraph/opengl/items/GLMeshItem.py | robertsj/poropy | 481a604339c9fa797817b2b0a55448329685c1d8 | [
"MIT"
] | 7 | 2015-03-27T16:58:07.000Z | 2022-01-01T17:44:02.000Z | from OpenGL.GL import *
from .. GLGraphicsItem import GLGraphicsItem
from .. MeshData import MeshData
from pyqtgraph.Qt import QtGui
import pyqtgraph as pg
from .. import shaders
import numpy as np
__all__ = ['GLMeshItem']
class GLMeshItem(GLGraphicsItem):
"""
**Bases:** :class:`GLGraphicsItem <pyqtgraph.op... | 28.78481 | 87 | 0.559367 | from OpenGL.GL import *
from .. GLGraphicsItem import GLGraphicsItem
from .. MeshData import MeshData
from pyqtgraph.Qt import QtGui
import pyqtgraph as pg
from .. import shaders
import numpy as np
__all__ = ['GLMeshItem']
class GLMeshItem(GLGraphicsItem):
def __init__(self, faces, vertexes=None):
if is... | true | true |
790c67d4a5356bd910dc789a418e8517e5910df9 | 3,052 | py | Python | src/api/auth/bkiam/urls.py | Chromico/bk-base | be822d9bbee544a958bed4831348185a75604791 | [
"MIT"
] | 84 | 2021-06-30T06:20:23.000Z | 2022-03-22T03:05:49.000Z | src/api/auth/bkiam/urls.py | Chromico/bk-base | be822d9bbee544a958bed4831348185a75604791 | [
"MIT"
] | 7 | 2021-06-30T06:21:16.000Z | 2022-03-29T07:36:13.000Z | src/api/auth/bkiam/urls.py | Chromico/bk-base | be822d9bbee544a958bed4831348185a75604791 | [
"MIT"
] | 40 | 2021-06-30T06:21:26.000Z | 2022-03-29T12:42:26.000Z | # -*- coding: utf-8 -*
"""
Tencent is pleased to support the open source community by making BK-BASE 蓝鲸基础平台 available.
Copyright (C) 2021 THL A29 Limited, a Tencent company. All rights reserved.
BK-BASE 蓝鲸基础平台 is licensed under the MIT License.
License for BK-BASE 蓝鲸基础平台:
----------------------------------------------... | 44.882353 | 111 | 0.753277 |
from django.conf.urls import url
from iam.contrib.django.dispatcher.dispatchers import (
DjangoBasicResourceApiDispatcher,
success_response,
)
from iam.resource.utils import get_filter_obj, get_page_obj
from auth.bkiam import IAM_REGISTERED_SYSTEM
from auth.bkiam import resources
from auth.bkiam.backend impor... | true | true |
790c68773133933418a5d386eacb3bbd8b661688 | 7,002 | py | Python | ns-3-dev/doc/models/source/conf.py | maxvonhippel/snake | 0805773dc34e1480dffaae40174aa1f82d1c6ce8 | [
"BSD-3-Clause"
] | 11 | 2015-11-24T11:07:28.000Z | 2021-12-23T04:10:29.000Z | ns-3-dev/doc/models/source/conf.py | maxvonhippel/snake | 0805773dc34e1480dffaae40174aa1f82d1c6ce8 | [
"BSD-3-Clause"
] | null | null | null | ns-3-dev/doc/models/source/conf.py | maxvonhippel/snake | 0805773dc34e1480dffaae40174aa1f82d1c6ce8 | [
"BSD-3-Clause"
] | 6 | 2016-03-01T06:32:21.000Z | 2022-03-24T19:31:41.000Z | # -*- coding: utf-8 -*-
#
# ns-3 documentation build configuration file, created by
# sphinx-quickstart on Tue Dec 14 09:00:39 2010.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All co... | 32.267281 | 80 | 0.716938 |
import sys, os
extensions = ['sphinx.ext.pngmath']
templates_path = ['_templates']
source_suffix = '.rst'
master_doc = 'index'
project = u'ns-3'
copyright = u'2011, ns-3 project'
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The... | true | true |
790c69b6b006c6113255c1134a1cd5745849694b | 1,706 | py | Python | scripts/processing_scripts/raw_scrape_processing.py | sai-krishna-msk/KickAssist | 7fb256e3ef4beff231332f6491ebb975f3fe4b43 | [
"MIT"
] | null | null | null | scripts/processing_scripts/raw_scrape_processing.py | sai-krishna-msk/KickAssist | 7fb256e3ef4beff231332f6491ebb975f3fe4b43 | [
"MIT"
] | 7 | 2021-06-08T21:18:49.000Z | 2022-03-12T00:24:33.000Z | scripts/processing_scripts/raw_scrape_processing.py | sai-krishna-msk/KickAssist | 7fb256e3ef4beff231332f6491ebb975f3fe4b43 | [
"MIT"
] | null | null | null |
import os
import sys
path = os.getcwd()
package_path = (os.path.abspath(os.path.join(path, os.pardir))).replace('\\', '/')+'/'
sys.path.insert(1, package_path)
from config.config import *
##############################################Scrape-1###################################################
def contains(text , su... | 34.12 | 107 | 0.611958 |
import os
import sys
path = os.getcwd()
package_path = (os.path.abspath(os.path.join(path, os.pardir))).replace('\\', '/')+'/'
sys.path.insert(1, package_path)
from config.config import *
| true | true |
790c6a37e8a5d4de2bc90959adfbdcde3b8e33e3 | 1,317 | py | Python | tests/functional/dashboard/test_hook.py | cage1016/django-oscar-hooks | 3dc6fedb1cccc7ad0a120c609599ee418b17f9d9 | [
"BSD-3-Clause"
] | 3 | 2016-06-01T22:58:39.000Z | 2021-02-08T04:14:14.000Z | tests/functional/dashboard/test_hook.py | cage1016/django-oscar-hooks | 3dc6fedb1cccc7ad0a120c609599ee418b17f9d9 | [
"BSD-3-Clause"
] | 2 | 2020-04-15T08:26:50.000Z | 2020-05-31T19:28:06.000Z | tests/functional/dashboard/test_hook.py | cage1016/django-oscar-hooks | 3dc6fedb1cccc7ad0a120c609599ee418b17f9d9 | [
"BSD-3-Clause"
] | null | null | null | from django.core.urlresolvers import reverse
from oscar.core.loading import get_model
from oscar.test.testcases import WebTestCase, add_permissions
from oscar.test.factories import (
CategoryFactory, PartnerFactory, ProductFactory, ProductAttributeFactory)
from hooks.test.factories import (
HookEventFactory,... | 32.121951 | 95 | 0.699317 | from django.core.urlresolvers import reverse
from oscar.core.loading import get_model
from oscar.test.testcases import WebTestCase, add_permissions
from oscar.test.factories import (
CategoryFactory, PartnerFactory, ProductFactory, ProductAttributeFactory)
from hooks.test.factories import (
HookEventFactory,... | true | true |
790c6b9006ec8858bb51f19dce28a4f5869a97fe | 13,424 | py | Python | qiskit/optimization/algorithms/recursive_minimum_eigen_optimizer.py | Cristian-Malinescu/qiskit-aqua | b29596800447c3130a20ec72a18b7fd8ed9fdb2f | [
"Apache-2.0"
] | null | null | null | qiskit/optimization/algorithms/recursive_minimum_eigen_optimizer.py | Cristian-Malinescu/qiskit-aqua | b29596800447c3130a20ec72a18b7fd8ed9fdb2f | [
"Apache-2.0"
] | null | null | null | qiskit/optimization/algorithms/recursive_minimum_eigen_optimizer.py | Cristian-Malinescu/qiskit-aqua | b29596800447c3130a20ec72a18b7fd8ed9fdb2f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modif... | 43.584416 | 100 | 0.65003 |
from copy import deepcopy
from enum import Enum
from typing import Optional, Union, List, Tuple, Dict
import logging
import numpy as np
from qiskit.aqua.algorithms import NumPyMinimumEigensolver
from qiskit.aqua.utils.validation import validate_min
from .optimization_algorithm import OptimizationAlgori... | true | true |
790c6bbc06bf28c97b8abd222424095a64d7b052 | 335 | py | Python | SEARCHING/EASY/Sqrt(x)/Code.py | HassanRahim26/LEETCODE | c0ec81b037ff7b2d6e6030ac9835c21ed825100f | [
"MIT"
] | 3 | 2021-08-31T11:02:28.000Z | 2022-01-17T08:07:00.000Z | SEARCHING/EASY/Sqrt(x)/Code.py | HassanRahim26/LEETCODE | c0ec81b037ff7b2d6e6030ac9835c21ed825100f | [
"MIT"
] | null | null | null | SEARCHING/EASY/Sqrt(x)/Code.py | HassanRahim26/LEETCODE | c0ec81b037ff7b2d6e6030ac9835c21ed825100f | [
"MIT"
] | null | null | null | # PROBLEM LINK:- https://leetcode.com/problems/sqrtx/
class Solution:
def mySqrt(self, x):
a = 1e-6
low = 1
high = x
while high - low > a:
mid = (high + low)/2
if mid * mid < x:
low = mid
else:
high = mid
re... | 22.333333 | 53 | 0.426866 |
class Solution:
def mySqrt(self, x):
a = 1e-6
low = 1
high = x
while high - low > a:
mid = (high + low)/2
if mid * mid < x:
low = mid
else:
high = mid
return int(high)
| true | true |
790c6d754b2f6b4a829eb710e03b699641ff0b23 | 551 | py | Python | src/version.py | StevenBaby/chess | 1aa3065d974351df58a5620c78ca80a10a385321 | [
"MIT"
] | 10 | 2021-06-17T21:45:59.000Z | 2022-03-23T04:02:45.000Z | src/version.py | StevenBaby/chess | 1aa3065d974351df58a5620c78ca80a10a385321 | [
"MIT"
] | 2 | 2021-05-30T11:52:44.000Z | 2021-06-29T11:06:31.000Z | src/version.py | StevenBaby/chess | 1aa3065d974351df58a5620c78ca80a10a385321 | [
"MIT"
] | 1 | 2021-06-19T03:41:23.000Z | 2021-06-19T03:41:23.000Z | # coding=utf-8
VERSION = '1.8.1'
__VERSION__ = VERSION
def increase():
import os
import re
filename = os.path.abspath(__file__)
with open(filename, encoding='utf8') as file:
content = file.read()
match = re.search(r"VERSION = '(\d+).(\d+).(\d+)'", content)
old = f'{match.group(1)}.{m... | 25.045455 | 72 | 0.598911 |
VERSION = '1.8.1'
__VERSION__ = VERSION
def increase():
import os
import re
filename = os.path.abspath(__file__)
with open(filename, encoding='utf8') as file:
content = file.read()
match = re.search(r"VERSION = '(\d+).(\d+).(\d+)'", content)
old = f'{match.group(1)}.{match.group(2)}... | true | true |
790c6d832bf56b9e7c35fdae1589b565cce84fd9 | 147 | py | Python | src/backend/tests/factories/record_factory.py | NickSchimek/recordexpungPDX | 34ed0f3cb5b7368a935a11306d3143d0d154c2de | [
"CNRI-Python",
"RSA-MD",
"Xnet",
"Linux-OpenIB",
"FTL",
"X11"
] | null | null | null | src/backend/tests/factories/record_factory.py | NickSchimek/recordexpungPDX | 34ed0f3cb5b7368a935a11306d3143d0d154c2de | [
"CNRI-Python",
"RSA-MD",
"Xnet",
"Linux-OpenIB",
"FTL",
"X11"
] | 93 | 2019-12-07T01:43:50.000Z | 2021-08-01T13:30:44.000Z | src/backend/tests/factories/record_factory.py | NickSchimek/recordexpungPDX | 34ed0f3cb5b7368a935a11306d3143d0d154c2de | [
"CNRI-Python",
"RSA-MD",
"Xnet",
"Linux-OpenIB",
"FTL",
"X11"
] | null | null | null | from expungeservice.models.record import Record
class RecordFactory:
@staticmethod
def create(cases):
return Record(list(cases))
| 18.375 | 47 | 0.727891 | from expungeservice.models.record import Record
class RecordFactory:
@staticmethod
def create(cases):
return Record(list(cases))
| true | true |
790c6e105d00aa08941205a5c43b27df00b37ef3 | 1,383 | py | Python | deprecated/led_control.py | isarlab-department-engineering/ros_dt_stop_light_detection | 32d0e9f0c4a9f80510c450adc87764444e910d31 | [
"BSD-3-Clause"
] | null | null | null | deprecated/led_control.py | isarlab-department-engineering/ros_dt_stop_light_detection | 32d0e9f0c4a9f80510c450adc87764444e910d31 | [
"BSD-3-Clause"
] | null | null | null | deprecated/led_control.py | isarlab-department-engineering/ros_dt_stop_light_detection | 32d0e9f0c4a9f80510c450adc87764444e910d31 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# this node will be implemented on the master node
# this is a test script for drive motor
# in function of stop and front lights detection
# this script will be implemented in another node
# import libraries
import rospy,sys,time,atexit,numpy
from std_msgs.msg import String,Int16MultiArray
... | 23.844828 | 83 | 0.737527 |
import rospy,sys,time,atexit,numpy
from std_msgs.msg import String,Int16MultiArray
avoidingVehicle = False
array = Int16MultiArray()
array.data = []
controlPub = rospy.Publisher("cmd",Int16MultiArray,queue_size=1)
def turnOffMotors():
array.data = [0,0,0,0]
controlPub.publish(array)
def setSpeed(motor1,m... | true | true |
790c6e1bd0f1dc5b21d694dc4c0d511cdb5ede6d | 415 | py | Python | videomaker/functions/savePreset.py | TheTimebike/VideoMaker-Studio | 289fd3b9f3c27d298ee94b1e79415a20ec084c4c | [
"MIT"
] | 4 | 2019-03-03T12:10:20.000Z | 2021-09-05T12:30:25.000Z | videomaker/functions/savePreset.py | TheTimebike/VideoMaker-Studio | 289fd3b9f3c27d298ee94b1e79415a20ec084c4c | [
"MIT"
] | null | null | null | videomaker/functions/savePreset.py | TheTimebike/VideoMaker-Studio | 289fd3b9f3c27d298ee94b1e79415a20ec084c4c | [
"MIT"
] | 2 | 2019-03-27T23:40:34.000Z | 2019-10-07T11:09:32.000Z | import json
from videomaker.functions.packageData import packageData
from videomaker.functions.addPreset import addOption
def savePreset(focus):
preset = packageData(focus, verify=False)
with open("./presets/{0}.json".format(preset["subredditName"]), "w+") as out:
json.dump(preset, out, indent=4)
a... | 41.5 | 99 | 0.73253 | import json
from videomaker.functions.packageData import packageData
from videomaker.functions.addPreset import addOption
def savePreset(focus):
preset = packageData(focus, verify=False)
with open("./presets/{0}.json".format(preset["subredditName"]), "w+") as out:
json.dump(preset, out, indent=4)
a... | true | true |
790c7007d3b665975df26aa73591e924e9115794 | 6,815 | py | Python | github_archive/test/test_get_github.py | hellkite500/github_scrape | e9d3b10b434349e08a92ef97e8414c8b9f0c7584 | [
"CC0-1.0"
] | null | null | null | github_archive/test/test_get_github.py | hellkite500/github_scrape | e9d3b10b434349e08a92ef97e8414c8b9f0c7584 | [
"CC0-1.0"
] | null | null | null | github_archive/test/test_get_github.py | hellkite500/github_scrape | e9d3b10b434349e08a92ef97e8414c8b9f0c7584 | [
"CC0-1.0"
] | null | null | null | import unittest
from typing import Optional
from pathlib import Path
from time import strftime, gmtime
from github import Github
import json
import yaml
from .. import get_repo_meta, clone_and_archive
from ..get_github import dump_list
from pathlib import Path
class TestGetGithub(unittest.TestCase):
"""
Te... | 44.253247 | 151 | 0.650624 | import unittest
from typing import Optional
from pathlib import Path
from time import strftime, gmtime
from github import Github
import json
import yaml
from .. import get_repo_meta, clone_and_archive
from ..get_github import dump_list
from pathlib import Path
class TestGetGithub(unittest.TestCase):
_current_dir =... | true | true |
790c7063d06c1fc8c43a95332b64d7e32dc32159 | 14,307 | py | Python | trainer/trainer.py | Renovamen/Image-Captioning | de8d4f553a22e967fa56a01d5b4a2206b9431771 | [
"MIT"
] | 5 | 2020-11-03T16:08:18.000Z | 2022-01-17T03:56:15.000Z | trainer/trainer.py | Renovamen/Image-Caption | de8d4f553a22e967fa56a01d5b4a2206b9431771 | [
"MIT"
] | null | null | null | trainer/trainer.py | Renovamen/Image-Caption | de8d4f553a22e967fa56a01d5b4a2206b9431771 | [
"MIT"
] | 1 | 2020-11-03T11:29:36.000Z | 2020-11-03T11:29:36.000Z | import time
from typing import Optional, Dict
import torch
from torch import nn, optim
from torch.utils.data import DataLoader
from torch.nn.utils.rnn import pack_padded_sequence
from utils import TensorboardWriter, AverageMeter, save_checkpoint, accuracy, \
clip_gradient, adjust_learning_rate
from metrics import ... | 36.77892 | 121 | 0.551618 | import time
from typing import Optional, Dict
import torch
from torch import nn, optim
from torch.utils.data import DataLoader
from torch.nn.utils.rnn import pack_padded_sequence
from utils import TensorboardWriter, AverageMeter, save_checkpoint, accuracy, \
clip_gradient, adjust_learning_rate
from metrics import ... | true | true |
790c70b70ca4c956926737136d747698a3c0c9c8 | 4,357 | py | Python | tests/test_command_line.py | Strubbl/map-machine | e2c6f8cd373bc5dba322129112cfa58874a8321b | [
"MIT"
] | null | null | null | tests/test_command_line.py | Strubbl/map-machine | e2c6f8cd373bc5dba322129112cfa58874a8321b | [
"MIT"
] | null | null | null | tests/test_command_line.py | Strubbl/map-machine | e2c6f8cd373bc5dba322129112cfa58874a8321b | [
"MIT"
] | null | null | null | """
Test command line commands.
"""
from pathlib import Path
from subprocess import PIPE, Popen
__author__ = "Sergey Vartanov"
__email__ = "me@enzet.ru"
from xml.etree import ElementTree
from xml.etree.ElementTree import Element
from map_machine.ui.cli import COMMAND_LINES
LOG: bytes = (
b"INFO Constructing way... | 32.274074 | 80 | 0.614184 | from pathlib import Path
from subprocess import PIPE, Popen
__author__ = "Sergey Vartanov"
__email__ = "me@enzet.ru"
from xml.etree import ElementTree
from xml.etree.ElementTree import Element
from map_machine.ui.cli import COMMAND_LINES
LOG: bytes = (
b"INFO Constructing ways...\n"
b"INFO Constructing node... | true | true |
790c70dd7b2d68161eee7a1e5b35a2002b99546d | 816 | py | Python | rcrs_core/commands/AKTell.py | roborescue/rcrs-core-python | 9e48e5778ee7ccd524d3f9ba47d23d892e175d66 | [
"BSD-3-Clause"
] | 1 | 2022-03-11T12:27:29.000Z | 2022-03-11T12:27:29.000Z | rcrs_core/commands/AKTell.py | roborescue/rcrs-core-python | 9e48e5778ee7ccd524d3f9ba47d23d892e175d66 | [
"BSD-3-Clause"
] | 1 | 2022-01-12T19:57:51.000Z | 2022-01-12T19:57:51.000Z | rcrs_core/commands/AKTell.py | roborescue/rcrs-core-python | 9e48e5778ee7ccd524d3f9ba47d23d892e175d66 | [
"BSD-3-Clause"
] | null | null | null | from rcrs_core.commands.Command import Command
from rcrs_core.worldmodel.entityID import EntityID
from rcrs_core.connection import URN
from rcrs_core.connection import RCRSProto_pb2
class AKTell(Command):
def __init__(self, agent_id: EntityID, time: int, message: str) -> None:
super().__init__()
... | 35.478261 | 92 | 0.708333 | from rcrs_core.commands.Command import Command
from rcrs_core.worldmodel.entityID import EntityID
from rcrs_core.connection import URN
from rcrs_core.connection import RCRSProto_pb2
class AKTell(Command):
def __init__(self, agent_id: EntityID, time: int, message: str) -> None:
super().__init__()
... | true | true |
790c7255a53b1468fcafec62c1b123a267fb8466 | 782 | py | Python | project/urls.py | lucasazevedo/visitor-control | 2daed747f68d04b1bda98bd51fe0876044e1cc54 | [
"MIT"
] | null | null | null | project/urls.py | lucasazevedo/visitor-control | 2daed747f68d04b1bda98bd51fe0876044e1cc54 | [
"MIT"
] | null | null | null | project/urls.py | lucasazevedo/visitor-control | 2daed747f68d04b1bda98bd51fe0876044e1cc54 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.urls import path
from django.contrib.auth import views as auth_views
from dashboard.views import index
from visitantes.views import registrar_visitante, informacoes_visitante, finalizar_visita
urlpatterns = [
path('admin/', admin.site.urls),
path('', index, name='i... | 46 | 95 | 0.757033 | from django.contrib import admin
from django.urls import path
from django.contrib.auth import views as auth_views
from dashboard.views import index
from visitantes.views import registrar_visitante, informacoes_visitante, finalizar_visita
urlpatterns = [
path('admin/', admin.site.urls),
path('', index, name='i... | true | true |
790c756cda0990da4d1266cee7ef46ccdca9f80f | 8,453 | py | Python | pyserini/hsearch/__main__.py | leungjch/pyserini | 04aa129910adf45266fe93a4d3947cdac2030570 | [
"Apache-2.0"
] | null | null | null | pyserini/hsearch/__main__.py | leungjch/pyserini | 04aa129910adf45266fe93a4d3947cdac2030570 | [
"Apache-2.0"
] | null | null | null | pyserini/hsearch/__main__.py | leungjch/pyserini | 04aa129910adf45266fe93a4d3947cdac2030570 | [
"Apache-2.0"
] | null | null | null | #
# Pyserini: Reproducible IR research with sparse and dense representations
#
# 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... | 45.691892 | 153 | 0.655507 |
import argparse
import json
import os
import sys
from tqdm import tqdm
from pyserini.dsearch import SimpleDenseSearcher
from pyserini.query_iterator import get_query_iterator, TopicsFormat
from pyserini.output_writer import get_output_writer, OutputFormat
from pyserini.search import ImpactSearcher, Si... | true | true |
790c756cf18615f4e523d293f14c696d95a09f44 | 14,175 | py | Python | quantum/tests/unit/openvswitch/test_ovs_lib.py | hyunsun/quantum | 40c4ec9495d05620a3cced4cc2bb98d7f6e52bbb | [
"Apache-2.0"
] | 1 | 2021-04-18T15:23:19.000Z | 2021-04-18T15:23:19.000Z | quantum/tests/unit/openvswitch/test_ovs_lib.py | hyunsun/quantum | 40c4ec9495d05620a3cced4cc2bb98d7f6e52bbb | [
"Apache-2.0"
] | null | null | null | quantum/tests/unit/openvswitch/test_ovs_lib.py | hyunsun/quantum | 40c4ec9495d05620a3cced4cc2bb98d7f6e52bbb | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012, Nicira, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#... | 40.616046 | 78 | 0.567478 |
import mox
from quantum.agent.linux import ovs_lib, utils
from quantum.openstack.common import uuidutils
from quantum.tests import base
class OVS_Lib_Test(base.BaseTestCase):
def setUp(self):
super(OVS_Lib_Test, self).setUp()
self.BR_NAME = "br-int"
self.TO = "--timeout=... | true | true |
790c759b73c878a7b39473583ec0ffc5dfbb10f0 | 6,196 | py | Python | smock.py | serverboards/serverboards-plugin-google-drive | 2295df2c8c42d1667e80d00d2038aabd2fe15b62 | [
"Apache-2.0"
] | null | null | null | smock.py | serverboards/serverboards-plugin-google-drive | 2295df2c8c42d1667e80d00d2038aabd2fe15b62 | [
"Apache-2.0"
] | null | null | null | smock.py | serverboards/serverboards-plugin-google-drive | 2295df2c8c42d1667e80d00d2038aabd2fe15b62 | [
"Apache-2.0"
] | null | null | null | import json
import yaml
"""
SMock -- Serverboards Mock library -- Mock comfortably.
This library helps to mock function and method calls, getting the data
from an external yaml file.
"""
class MockWrapper:
"""
Wraps all the data returned by the mocked function to behave like a
dictionary, like an object... | 25.497942 | 102 | 0.576017 | import json
import yaml
class MockWrapper:
def __init__(self, data):
self.__data = data
def __getattr__(self, key):
if key not in self.__data:
raise KeyError("'%s' not found in %s" % (key, self.__data.keys()))
return self.__getitem__(key)
def __call__(self):
... | true | true |
790c77c112f04ac750b068e50533564b671bd615 | 7,851 | py | Python | caffe-tensorflow/examples/imagenet/models/googlenet.py | petercheng00/PSPNet-Keras-tensorflow | d50583786a3e8782dd1b735d268e57392cd8c646 | [
"MIT"
] | 3,209 | 2015-11-10T06:52:59.000Z | 2022-03-10T05:17:28.000Z | caffe-tensorflow/examples/imagenet/models/googlenet.py | petercheng00/PSPNet-Keras-tensorflow | d50583786a3e8782dd1b735d268e57392cd8c646 | [
"MIT"
] | 174 | 2015-11-10T21:32:54.000Z | 2021-11-09T15:51:30.000Z | caffe-tensorflow/examples/imagenet/models/googlenet.py | petercheng00/PSPNet-Keras-tensorflow | d50583786a3e8782dd1b735d268e57392cd8c646 | [
"MIT"
] | 1,218 | 2015-11-10T23:55:48.000Z | 2022-01-07T07:36:57.000Z | from kaffe.tensorflow import Network
class GoogleNet(Network):
def setup(self):
(self.feed('data')
.conv(7, 7, 64, 2, 2, name='conv1_7x7_s2')
.max_pool(3, 3, 2, 2, name='pool1_3x3_s2')
.lrn(2, 2e-05, 0.75, name='pool1_norm1')
.conv(1, 1, 64, 1, 1, name='c... | 41.539683 | 72 | 0.531907 | from kaffe.tensorflow import Network
class GoogleNet(Network):
def setup(self):
(self.feed('data')
.conv(7, 7, 64, 2, 2, name='conv1_7x7_s2')
.max_pool(3, 3, 2, 2, name='pool1_3x3_s2')
.lrn(2, 2e-05, 0.75, name='pool1_norm1')
.conv(1, 1, 64, 1, 1, name='c... | true | true |
790c7801f182960ff2919d3799dd5e962f483844 | 18,300 | py | Python | pypy/objspace/std/stringtype.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | 1 | 2019-05-27T00:58:46.000Z | 2019-05-27T00:58:46.000Z | pypy/objspace/std/stringtype.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | null | null | null | pypy/objspace/std/stringtype.py | woodrow/pyoac | b5dc59e6a38e7912db47f26fb23ffa4764a3c0e7 | [
"MIT"
] | null | null | null | from pypy.objspace.std.stdtypedef import *
from pypy.objspace.std.basestringtype import basestring_typedef
from sys import maxint
from pypy.rlib.objectmodel import specialize
def wrapstr(space, s):
from pypy.objspace.std.stringobject import W_StringObject
from pypy.objspace.std.ropeobject import rope, W_RopeO... | 55.287009 | 87 | 0.549727 | from pypy.objspace.std.stdtypedef import *
from pypy.objspace.std.basestringtype import basestring_typedef
from sys import maxint
from pypy.rlib.objectmodel import specialize
def wrapstr(space, s):
from pypy.objspace.std.stringobject import W_StringObject
from pypy.objspace.std.ropeobject import rope, W_RopeO... | true | true |
790c789ef0591a9f2be37f1d51653b8952fa335a | 844 | py | Python | ita/web/beaker/converters.py | Tezar/Assigment-generator | 2a3d0d10f1e3b215a79efc727e26d2ebbf1bb7a3 | [
"Apache-2.0"
] | null | null | null | ita/web/beaker/converters.py | Tezar/Assigment-generator | 2a3d0d10f1e3b215a79efc727e26d2ebbf1bb7a3 | [
"Apache-2.0"
] | null | null | null | ita/web/beaker/converters.py | Tezar/Assigment-generator | 2a3d0d10f1e3b215a79efc727e26d2ebbf1bb7a3 | [
"Apache-2.0"
] | 1 | 2020-07-24T05:48:47.000Z | 2020-07-24T05:48:47.000Z |
# (c) 2005 Ian Bicking and contributors; written for Paste (http://pythonpaste.org)
# Licensed under the MIT license: http://www.opensource.org/licenses/mit-license.php
def asbool(obj):
if isinstance(obj, str):
obj = obj.strip().lower()
if obj in ['true', 'yes', 'on', 'y', 't', '1']:
r... | 28.133333 | 84 | 0.5391 |
def asbool(obj):
if isinstance(obj, str):
obj = obj.strip().lower()
if obj in ['true', 'yes', 'on', 'y', 't', '1']:
return True
elif obj in ['false', 'no', 'off', 'n', 'f', '0']:
return False
else:
raise ValueError(
"String is n... | true | true |
790c7949e38fea35c440f0cd1ae210a7ab63f104 | 6,169 | py | Python | model/studentB.py | eungbean/knowledge-distillation-cifar10 | 683379804c8724d097a845cee85f130b6767dbd7 | [
"MIT"
] | 1 | 2021-02-27T15:13:32.000Z | 2021-02-27T15:13:32.000Z | model/studentB.py | eungbean/knowledge-distillation-cifar10 | 683379804c8724d097a845cee85f130b6767dbd7 | [
"MIT"
] | 9 | 2019-12-16T22:16:55.000Z | 2021-09-08T01:23:09.000Z | model/studentB.py | eungbean/knowledge-distillation-cifar10 | 683379804c8724d097a845cee85f130b6767dbd7 | [
"MIT"
] | null | null | null | """
Baseline CNN, losss function and metrics
Also customizes knowledge distillation (KD) loss function here
"""
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
class Flatten(nn.Module):
def forward(self, input):
return input.view(input.size(0), -1)
"""
This is t... | 40.058442 | 119 | 0.625385 | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
class Flatten(nn.Module):
def forward(self, input):
return input.view(input.size(0), -1)
class studentB(nn.Module):
def __init__(self, params):
super(studentB, self).__init__()
self.num_channels = pa... | true | true |
790c795137c30a0537925494d86f409b70e93998 | 4,148 | py | Python | scripts/freebasemappingupload.py | notconfusing/pywikibot-fr-welcome-bot | 6e07b7e74166a47c9425816e79786308df369ac2 | [
"MIT"
] | 1 | 2020-01-03T11:52:01.000Z | 2020-01-03T11:52:01.000Z | scripts/freebasemappingupload.py | notconfusing/pywikibot-fr-welcome-bot | 6e07b7e74166a47c9425816e79786308df369ac2 | [
"MIT"
] | 2 | 2019-11-07T13:46:32.000Z | 2019-11-07T14:20:53.000Z | scripts/freebasemappingupload.py | notconfusing/pywikibot-fr-welcome-bot | 6e07b7e74166a47c9425816e79786308df369ac2 | [
"MIT"
] | 1 | 2020-04-14T14:52:24.000Z | 2020-04-14T14:52:24.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Script to upload the mappings of Freebase to Wikidata.
Can be easily adapted to upload other String identifiers as well
This bot needs the dump from
https://developers.google.com/freebase/data#freebase-wikidata-mappings
The script takes a single parameter:
-filename: th... | 32.920635 | 79 | 0.583173 |
from __future__ import absolute_import, division, unicode_literals
import gzip
import os
import sys
import pywikibot
class FreebaseMapperRobot(object):
def __init__(self, filename):
self.repo = pywikibot.Site('wikidata', 'wikidata').data_repository()
self.filename = filename
if... | true | true |
790c7a0c2a88b22dd3182e9569eb81e432c95c8f | 4,590 | py | Python | hsst/utility/dfs_subgraph_enumeration.py | matichorvat/hsst | 9804892aa8cf2a226a3e406451fa4ecdbc7338cc | [
"MIT"
] | null | null | null | hsst/utility/dfs_subgraph_enumeration.py | matichorvat/hsst | 9804892aa8cf2a226a3e406451fa4ecdbc7338cc | [
"MIT"
] | null | null | null | hsst/utility/dfs_subgraph_enumeration.py | matichorvat/hsst | 9804892aa8cf2a226a3e406451fa4ecdbc7338cc | [
"MIT"
] | null | null | null | from collections import defaultdict
from hsst.utility import search
from hsst.utility.graph import SemanticGraph
class SubgraphEnumeration(object):
def __init__(self, graph, node_set_size_limit=0):
self.full_node_set = graph.nodes
self.full_edge_set = graph.edges
self.current_node_set =... | 38.898305 | 115 | 0.652505 | from collections import defaultdict
from hsst.utility import search
from hsst.utility.graph import SemanticGraph
class SubgraphEnumeration(object):
def __init__(self, graph, node_set_size_limit=0):
self.full_node_set = graph.nodes
self.full_edge_set = graph.edges
self.current_node_set =... | true | true |
790c7a1b4c501fb03fc116411c54360745164692 | 2,803 | py | Python | figure_3/model_III/sobolev_alignment/train_VAE.py | saroudant/sobolev_alignment_manuscript | 2b4d7ce4bbdac3a32ad8c02b950b4d1c91cda193 | [
"MIT"
] | null | null | null | figure_3/model_III/sobolev_alignment/train_VAE.py | saroudant/sobolev_alignment_manuscript | 2b4d7ce4bbdac3a32ad8c02b950b4d1c91cda193 | [
"MIT"
] | null | null | null | figure_3/model_III/sobolev_alignment/train_VAE.py | saroudant/sobolev_alignment_manuscript | 2b4d7ce4bbdac3a32ad8c02b950b4d1c91cda193 | [
"MIT"
] | null | null | null | """
This script:
- Train Sobolev Alignment.
- Save the two networks.
"""
import os, sys, getopt
import pandas as pd
import numpy as np
import re
from anndata import AnnData
import torch
from pickle import dump, load
from copy import deepcopy
import gc
from sobolev_alignment import SobolevAlignment
# Import params
fr... | 26.443396 | 119 | 0.727435 |
import os, sys, getopt
import pandas as pd
import numpy as np
import re
from anndata import AnnData
import torch
from pickle import dump, load
from copy import deepcopy
import gc
from sobolev_alignment import SobolevAlignment
from model_III_synthetic_params import *
from read_data import read_data
n_artificial_s... | true | true |
790c7b5b9f22d1052daa93cf8ab7e00c67f239ff | 5,297 | py | Python | sympycore/basealgebra/tests/test_matches.py | radovankavicky/pymaclab | 21da758f64ed0b62969c9289576f677e977cfd98 | [
"Apache-2.0"
] | 96 | 2015-01-25T05:59:56.000Z | 2021-12-29T14:05:22.000Z | sympycore/basealgebra/tests/test_matches.py | 1zinnur9/pymaclab | 21da758f64ed0b62969c9289576f677e977cfd98 | [
"Apache-2.0"
] | 3 | 2015-12-17T19:25:46.000Z | 2018-06-19T07:05:20.000Z | sympycore/basealgebra/tests/test_matches.py | 1zinnur9/pymaclab | 21da758f64ed0b62969c9289576f677e977cfd98 | [
"Apache-2.0"
] | 36 | 2016-01-31T15:22:01.000Z | 2021-03-29T07:03:07.000Z |
from sympycore import CollectingField as Algebra
Symbol = Algebra.Symbol
Number = Algebra.Number
Add = Algebra.Add
Mul = Algebra.Mul
Pow = Algebra.Pow
Terms = Algebra.Terms
Factors = Algebra.Factors
def test_symbol():
p = Symbol('p')
s = Symbol('s')
t = Symbol('t')
assert s.matches(s)=={}
assert ... | 29.427778 | 103 | 0.537474 |
from sympycore import CollectingField as Algebra
Symbol = Algebra.Symbol
Number = Algebra.Number
Add = Algebra.Add
Mul = Algebra.Mul
Pow = Algebra.Pow
Terms = Algebra.Terms
Factors = Algebra.Factors
def test_symbol():
p = Symbol('p')
s = Symbol('s')
t = Symbol('t')
assert s.matches(s)=={}
assert ... | true | true |
790c7d33ed5f2d9646494d9e9137958f6fb0bbd0 | 9,689 | py | Python | napalm_yang/models/openconfig/interfaces/interface/subinterfaces/subinterface/ipv4/unnumbered/interface_ref/config/__init__.py | ckishimo/napalm-yang | 8f2bd907bd3afcde3c2f8e985192de74748baf6c | [
"Apache-2.0"
] | 64 | 2016-10-20T15:47:18.000Z | 2021-11-11T11:57:32.000Z | napalm_yang/models/openconfig/interfaces/interface/subinterfaces/subinterface/ipv4/unnumbered/interface_ref/config/__init__.py | ckishimo/napalm-yang | 8f2bd907bd3afcde3c2f8e985192de74748baf6c | [
"Apache-2.0"
] | 126 | 2016-10-05T10:36:14.000Z | 2019-05-15T08:43:23.000Z | napalm_yang/models/openconfig/interfaces/interface/subinterfaces/subinterface/ipv4/unnumbered/interface_ref/config/__init__.py | ckishimo/napalm-yang | 8f2bd907bd3afcde3c2f8e985192de74748baf6c | [
"Apache-2.0"
] | 63 | 2016-11-07T15:23:08.000Z | 2021-09-22T14:41:16.000Z | # -*- coding: utf-8 -*-
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListTy... | 38.756 | 338 | 0.618846 |
from operator import attrgetter
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType
from pyangbind.lib.yangtypes import RestrictedClassType
from pyangbind.lib.yangtypes import TypedListType
from pyangbind.lib.yangtypes import YANGBool
from pyangbind.lib.yangtypes import YANGListType
from pyangbind.lib.y... | true | true |
790c7d52cffef7989eab03b3b36c8feaf7bb9e54 | 639 | py | Python | changebase.py | quake0day/oj | c09333d1738f8735de0d5d825db6f4b707585670 | [
"MIT"
] | null | null | null | changebase.py | quake0day/oj | c09333d1738f8735de0d5d825db6f4b707585670 | [
"MIT"
] | null | null | null | changebase.py | quake0day/oj | c09333d1738f8735de0d5d825db6f4b707585670 | [
"MIT"
] | null | null | null | class Solution(object):
def changebase(self, n, base):
digits = "0123456789ABCDEF"
remstack = []
while n > 0:
rem = n % base
remstack.append(rem)
n = n / base
newString = ""
while not len(remstack) == 0:
newString += digits[remstack.pop()]
return newString
... | 21.3 | 46 | 0.544601 | class Solution(object):
def changebase(self, n, base):
digits = "0123456789ABCDEF"
remstack = []
while n > 0:
rem = n % base
remstack.append(rem)
n = n / base
newString = ""
while not len(remstack) == 0:
newString += digits[remstack.pop()]
return newString
... | false | true |
790c7da827e14ff727534ea42036678e1841c3da | 377 | py | Python | chat_unifier/file_iterators/trillian_xml.py | mtlynch/chat_unifier | 7449ca4f2dd48d8b76fc29e150643076dd0b3334 | [
"MIT"
] | 2 | 2018-10-16T18:39:06.000Z | 2019-01-22T01:38:09.000Z | chat_unifier/file_iterators/trillian_xml.py | mtlynch/chat_unifier | 7449ca4f2dd48d8b76fc29e150643076dd0b3334 | [
"MIT"
] | 2 | 2018-10-19T00:00:21.000Z | 2018-10-19T17:15:25.000Z | chat_unifier/file_iterators/trillian_xml.py | mtlynch/chat_unifier | 7449ca4f2dd48d8b76fc29e150643076dd0b3334 | [
"MIT"
] | null | null | null | import os
def iterate_files(directory):
for root, dirs, filenames in os.walk(directory):
for filename in filenames:
if _is_log_file(filename):
yield os.path.join(root, filename)
def _is_log_file(filename):
basename, extension = os.path.splitext(filename)
return ((exte... | 26.928571 | 73 | 0.660477 | import os
def iterate_files(directory):
for root, dirs, filenames in os.walk(directory):
for filename in filenames:
if _is_log_file(filename):
yield os.path.join(root, filename)
def _is_log_file(filename):
basename, extension = os.path.splitext(filename)
return ((exte... | true | true |
790c7dc745912cc64eded0455518ab84c72d7f34 | 1,261 | py | Python | 2021/09-2.py | lsangers/AdventOfCode | 5e4d1bb71c80609ef1472e5167922ed378ab06d6 | [
"MIT"
] | 1 | 2021-12-03T10:35:45.000Z | 2021-12-03T10:35:45.000Z | 2021/09-2.py | lsangers/AdventOfCode | 5e4d1bb71c80609ef1472e5167922ed378ab06d6 | [
"MIT"
] | null | null | null | 2021/09-2.py | lsangers/AdventOfCode | 5e4d1bb71c80609ef1472e5167922ed378ab06d6 | [
"MIT"
] | null | null | null | import os
import sys
filename = __file__[:-5] + '-input'
with open(filename) as f:
board = list(map(lambda s: list(map(int, list(s))), f.read().splitlines()))
max_row = len(board)
max_col = len(board[0])
def get_neighbors(row, col):
n = []
if(row > 0):
n.append((row-1,col))
if(row+1 < max_r... | 24.72549 | 145 | 0.610626 | import os
import sys
filename = __file__[:-5] + '-input'
with open(filename) as f:
board = list(map(lambda s: list(map(int, list(s))), f.read().splitlines()))
max_row = len(board)
max_col = len(board[0])
def get_neighbors(row, col):
n = []
if(row > 0):
n.append((row-1,col))
if(row+1 < max_r... | true | true |
790c7e2d9fdf394a11fec5da3617ad43ec97070e | 5,702 | py | Python | cacreader/pyscard-2.0.2/smartcard/test/framework/testcase_readergroups.py | kyletanyag/LL-Smartcard | 02abea9de5a13f8bae4d7832ab34cb7f0d9514c9 | [
"BSD-3-Clause"
] | null | null | null | cacreader/pyscard-2.0.2/smartcard/test/framework/testcase_readergroups.py | kyletanyag/LL-Smartcard | 02abea9de5a13f8bae4d7832ab34cb7f0d9514c9 | [
"BSD-3-Clause"
] | null | null | null | cacreader/pyscard-2.0.2/smartcard/test/framework/testcase_readergroups.py | kyletanyag/LL-Smartcard | 02abea9de5a13f8bae4d7832ab34cb7f0d9514c9 | [
"BSD-3-Clause"
] | null | null | null | #! /usr/bin/env python3
"""Unit tests for smartcard.readers.ReaderGroups
This test case can be executed individually, or with all other test cases
thru testsuite_framework.py.
__author__ = "http://www.gemalto.com"
Copyright 2001-2012 gemalto
Author: Jean-Daniel Aussel, mailto:jean-daniel.aussel@gemalto.com
This fil... | 35.197531 | 76 | 0.632936 |
import platform
import unittest
from smartcard.System import readergroups
from smartcard.scard import resourceManager
if 'winscard' == resourceManager and \
-1 == platform.platform().find('Windows-7'):
class testcase_readergroups(unittest.TestCase):
pinpadgroup = 'Pinpad$Readers'
biogroup ... | true | true |
790c7eff2b6847934590088a080fd9be468a144e | 3,147 | py | Python | Nivek maths/nivek-maths.py | ThiccTT/nivek-maths | 37f222b3ddc72455313eb619a79bc6045b89b506 | [
"MIT"
] | null | null | null | Nivek maths/nivek-maths.py | ThiccTT/nivek-maths | 37f222b3ddc72455313eb619a79bc6045b89b506 | [
"MIT"
] | null | null | null | Nivek maths/nivek-maths.py | ThiccTT/nivek-maths | 37f222b3ddc72455313eb619a79bc6045b89b506 | [
"MIT"
] | null | null | null | import kanu
while True:
print('\n Select one:')
print('\t1 -> Solve a linear equation')
print('\t2 -> Simplify any expression')
print('\t3 -> Is this number a Perfect Square?')
print('\t4 -> Get Prime Numbers')
print('\t5 -> START A NUCLEAR WAR :)')
print('\t6 -> Factor Integers')... | 27.849558 | 61 | 0.479504 | import kanu
while True:
print('\n Select one:')
print('\t1 -> Solve a linear equation')
print('\t2 -> Simplify any expression')
print('\t3 -> Is this number a Perfect Square?')
print('\t4 -> Get Prime Numbers')
print('\t5 -> START A NUCLEAR WAR :)')
print('\t6 -> Factor Integers')... | true | true |
790c80f4c14bdf6903ead32c4acdbd76b70246ed | 530 | py | Python | tests/utils/interactive_python.py | Bukkster/fiftyone | c061216de5094131c8ce8718d8a6ac58056b003e | [
"Apache-2.0"
] | 3 | 2022-01-18T06:13:33.000Z | 2022-02-14T13:28:23.000Z | tests/utils/interactive_python.py | Bukkster/fiftyone | c061216de5094131c8ce8718d8a6ac58056b003e | [
"Apache-2.0"
] | null | null | null | tests/utils/interactive_python.py | Bukkster/fiftyone | c061216de5094131c8ce8718d8a6ac58056b003e | [
"Apache-2.0"
] | null | null | null | """
A script that simulates a Python shell and accepts arbitrary commands to
execute. For use by service tests.
| Copyright 2017-2022, Voxel51, Inc.
| `voxel51.com <https://voxel51.com/>`_
|
"""
import os
os.environ["FIFTYONE_DISABLE_SERVICES"] = "1"
from fiftyone.service.ipc import IPCServer
env = {}
def handle_... | 19.62963 | 72 | 0.688679 | import os
os.environ["FIFTYONE_DISABLE_SERVICES"] = "1"
from fiftyone.service.ipc import IPCServer
env = {}
def handle_message(message):
try:
code = compile(message, "", "eval")
except SyntaxError:
code = compile(message, "", "exec")
return eval(code, env)
IPCServer(handle_message).se... | true | true |
790c8212906e2e6267368f455cbefe1625b1c2d4 | 9,512 | py | Python | train.py | finite-infinity/tensorflow-serving-yolov3 | d9244b2b12c2c6370638f48109f7a8f2ffeaa4c4 | [
"MIT"
] | 428 | 2019-10-15T15:30:01.000Z | 2022-03-30T02:14:44.000Z | train.py | finite-infinity/tensorflow-serving-yolov3 | d9244b2b12c2c6370638f48109f7a8f2ffeaa4c4 | [
"MIT"
] | 115 | 2019-10-24T12:59:26.000Z | 2022-03-12T00:02:34.000Z | train.py | finite-infinity/tensorflow-serving-yolov3 | d9244b2b12c2c6370638f48109f7a8f2ffeaa4c4 | [
"MIT"
] | 131 | 2019-10-21T06:40:12.000Z | 2022-03-18T21:26:18.000Z | #! /usr/bin/env python
# coding=utf-8
import os
import time
import shutil
import numpy as np
import tensorflow as tf
import core.utils as utils
from tqdm import tqdm
from core.dataset import Dataset
from core.yolov3 import YOLOV3
from core.config import cfg
class YoloTrain(object):
def __init__(self): # 从config文... | 51.978142 | 130 | 0.610387 |
import os
import time
import shutil
import numpy as np
import tensorflow as tf
import core.utils as utils
from tqdm import tqdm
from core.dataset import Dataset
from core.yolov3 import YOLOV3
from core.config import cfg
class YoloTrain(object):
def __init__(self):
self.anchor_per_scale = cfg.YOLO.ANCH... | true | true |
790c82c158782609b311d42e9802acdd50fad13c | 586 | py | Python | projectBase/background/collectSubRedditsforCovid.py | hseyindemir/swe_773_hdemir | f8ab5086284e0b6dc1923cb1c1b73e4514613df4 | [
"PostgreSQL",
"Unlicense",
"MIT"
] | null | null | null | projectBase/background/collectSubRedditsforCovid.py | hseyindemir/swe_773_hdemir | f8ab5086284e0b6dc1923cb1c1b73e4514613df4 | [
"PostgreSQL",
"Unlicense",
"MIT"
] | 9 | 2020-11-02T17:30:48.000Z | 2021-01-20T06:48:17.000Z | projectBase/background/collectSubRedditsforCovid.py | hseyindemir/swe_773_hdemir | f8ab5086284e0b6dc1923cb1c1b73e4514613df4 | [
"PostgreSQL",
"Unlicense",
"MIT"
] | null | null | null | import praw
import database_infrastructure.dbHandler as dbController
from apscheduler.schedulers.background import BackgroundScheduler
import redditController.collectSubredditsForAsync as redditController
def collectSubredditsForCovid():
redditController.collectSubredditsForCovid('covid')
redditController.col... | 32.555556 | 69 | 0.793515 | import praw
import database_infrastructure.dbHandler as dbController
from apscheduler.schedulers.background import BackgroundScheduler
import redditController.collectSubredditsForAsync as redditController
def collectSubredditsForCovid():
redditController.collectSubredditsForCovid('covid')
redditController.col... | true | true |
790c8392467ad202258620063e9fd445dd446396 | 1,311 | py | Python | tests/readme_example_test.py | mister-bailey/e3nn | 43d4b12f5ba5947583feb35f4e0662b73aae5618 | [
"MIT"
] | null | null | null | tests/readme_example_test.py | mister-bailey/e3nn | 43d4b12f5ba5947583feb35f4e0662b73aae5618 | [
"MIT"
] | null | null | null | tests/readme_example_test.py | mister-bailey/e3nn | 43d4b12f5ba5947583feb35f4e0662b73aae5618 | [
"MIT"
] | null | null | null |
# pylint: disable=missing-docstring, line-too-long, invalid-name, arguments-differ, no-member, pointless-statement
from functools import partial
import torch
from e3nn import Kernel, rs
from e3nn.non_linearities.norm import Norm
from e3nn.non_linearities.rescaled_act import swish
from e3nn.point.operations import Co... | 31.214286 | 114 | 0.762777 |
from functools import partial
import torch
from e3nn import Kernel, rs
from e3nn.non_linearities.norm import Norm
from e3nn.non_linearities.rescaled_act import swish
from e3nn.point.operations import Convolution
from e3nn.radial import GaussianRadialModel
Rs_in = [(1, 0), (2, 1)]
Rs_out = [(1, 1)]
RadialMod... | true | true |
790c83bde7978a528a445d3b39187b4932030a65 | 2,400 | py | Python | LuciferMoringstar_Robot/admins/chat.py | PR0FESS0R-99/LuciferMoringstar-Robot | d4864b7be54f066e8241e7067eb086f835d3ec9d | [
"MIT"
] | 20 | 2022-02-05T17:35:24.000Z | 2022-03-31T12:23:29.000Z | LuciferMoringstar_Robot/admins/chat.py | PR0FESS0R-99/LuciferMoringstar-Robot | d4864b7be54f066e8241e7067eb086f835d3ec9d | [
"MIT"
] | 8 | 2022-02-07T17:29:39.000Z | 2022-03-18T17:30:31.000Z | LuciferMoringstar_Robot/admins/chat.py | PR0FESS0R-99/LuciferMoringstar-Robot | d4864b7be54f066e8241e7067eb086f835d3ec9d | [
"MIT"
] | 137 | 2022-02-05T14:50:15.000Z | 2022-03-31T12:23:42.000Z | # MIT License
# Copyright (c) 2022 Muhammed
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publi... | 50 | 186 | 0.750833 |
from pyrogram import Client as lucifermoringstar_robot , filters, enums
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
from LuciferMoringstar_Robot import ADMINS, CREATOR_USERNAME
@lucifermoringstar_robot.on_message((filters.group | filters.private) & filters.command('l... | true | true |
790c844cb49cb3321bf8dff698dec4c13b34d721 | 1,945 | py | Python | spirl/configs/few_shot_imitation_learning/kitchen/hierarchical_cl_gc_top_bot_excluded_demo_topknob_bot_hinge_slide_oneshot/conf.py | kouroshHakha/fist | 328c098789239fd892e17edefd799fc1957ab637 | [
"BSD-3-Clause"
] | 8 | 2021-10-14T03:14:23.000Z | 2022-03-15T21:31:17.000Z | spirl/configs/few_shot_imitation_learning/kitchen/hierarchical_cl_gc_top_bot_excluded_demo_topknob_bot_hinge_slide_oneshot/conf.py | kouroshHakha/fist | 328c098789239fd892e17edefd799fc1957ab637 | [
"BSD-3-Clause"
] | null | null | null | spirl/configs/few_shot_imitation_learning/kitchen/hierarchical_cl_gc_top_bot_excluded_demo_topknob_bot_hinge_slide_oneshot/conf.py | kouroshHakha/fist | 328c098789239fd892e17edefd799fc1957ab637 | [
"BSD-3-Clause"
] | 1 | 2021-09-13T20:42:28.000Z | 2021-09-13T20:42:28.000Z | import os
from spirl.models.closed_loop_spirl_mdl import GoalClSPiRLMdl
from spirl.components.logger import Logger
from spirl.utils.general_utils import AttrDict
from spirl.configs.default_data_configs.kitchen import data_spec
from spirl.components.evaluator import TopOfNSequenceEvaluator
from spirl.data.kitchen.src.k... | 30.873016 | 112 | 0.759897 | import os
from spirl.models.closed_loop_spirl_mdl import GoalClSPiRLMdl
from spirl.components.logger import Logger
from spirl.utils.general_utils import AttrDict
from spirl.configs.default_data_configs.kitchen import data_spec
from spirl.components.evaluator import TopOfNSequenceEvaluator
from spirl.data.kitchen.src.k... | true | true |
790c8482c1e66dc7260d46dfd9b7f13d639df13f | 1,019 | py | Python | proj02_loops/proj02_01.py | ryanaspears/VSA | 6532a447a6afc4bdc14eff58b99be9361e29e8f9 | [
"MIT"
] | null | null | null | proj02_loops/proj02_01.py | ryanaspears/VSA | 6532a447a6afc4bdc14eff58b99be9361e29e8f9 | [
"MIT"
] | null | null | null | proj02_loops/proj02_01.py | ryanaspears/VSA | 6532a447a6afc4bdc14eff58b99be9361e29e8f9 | [
"MIT"
] | null | null | null | # Name:
# Date:
# proj02: sum
# Write a program that prompts the user to enter numbers, one per line,
# ending with a line containing 0, and keep a running sum of the numbers.
# Only print out the sum after all the numbers are entered
# (at least in your final version). Each time you read in a number,
# you can immed... | 35.137931 | 84 | 0.697743 |
input_sum = 0
var = 1
while var != 0:
input1 = raw_input("Enter a number to sum, or 0 to indicate you are finished: ")
input_sum = int(input1) + input_sum
if int(input1) == 0:
var = 0
print"The sum of your numbers is: " + str(input_sum)
| false | true |
790c8484bbd71d0aa80124fd55ed271bdea204d5 | 11,210 | py | Python | zerver/migrations/0209_user_profile_no_empty_password.py | Bpapman/zulip | 76eeb4f6bf7d6f706337c1bbc3d6e19818c945d8 | [
"Apache-2.0"
] | null | null | null | zerver/migrations/0209_user_profile_no_empty_password.py | Bpapman/zulip | 76eeb4f6bf7d6f706337c1bbc3d6e19818c945d8 | [
"Apache-2.0"
] | null | null | null | zerver/migrations/0209_user_profile_no_empty_password.py | Bpapman/zulip | 76eeb4f6bf7d6f706337c1bbc3d6e19818c945d8 | [
"Apache-2.0"
] | 1 | 2020-07-06T11:43:28.000Z | 2020-07-06T11:43:28.000Z | # Generated by Django 1.11.24 on 2019-10-16 22:48
from typing import Any, Set, Union
import ujson
from django.conf import settings
from django.contrib.auth.hashers import check_password, make_password
from django.db import migrations
from django.db.backends.postgresql.schema import DatabaseSchemaEditor
from django.db... | 48.73913 | 97 | 0.692507 |
from typing import Any, Set, Union
import ujson
from django.conf import settings
from django.contrib.auth.hashers import check_password, make_password
from django.db import migrations
from django.db.backends.postgresql.schema import DatabaseSchemaEditor
from django.db.migrations.state import StateApps
from django.ut... | true | true |
790c860c3dff2bab32c7d3d6ac54f79baebccdb6 | 2,840 | py | Python | systori/apps/directory/test_models.py | systori/systori | e309c63e735079ff6032fdaf1db354ec872b28b1 | [
"BSD-3-Clause"
] | 12 | 2018-01-30T00:44:06.000Z | 2020-07-13T05:20:48.000Z | systori/apps/directory/test_models.py | systori/systori | e309c63e735079ff6032fdaf1db354ec872b28b1 | [
"BSD-3-Clause"
] | 36 | 2018-03-06T17:49:50.000Z | 2020-06-23T19:26:00.000Z | systori/apps/directory/test_models.py | systori/systori | e309c63e735079ff6032fdaf1db354ec872b28b1 | [
"BSD-3-Clause"
] | 3 | 2018-08-03T07:03:09.000Z | 2020-07-09T20:21:10.000Z | from django.test import TestCase
from ..company.models import Company
from ..project.models import *
from .models import *
def create_contact_data(self):
self.company = Company.objects.create(schema="test", name="Test")
self.company.activate()
self.project = Project.objects.create(name="my project")
s... | 35.5 | 85 | 0.65493 | from django.test import TestCase
from ..company.models import Company
from ..project.models import *
from .models import *
def create_contact_data(self):
self.company = Company.objects.create(schema="test", name="Test")
self.company.activate()
self.project = Project.objects.create(name="my project")
s... | true | true |
790c876c497a26028208d38a1aa0636aa1e15800 | 2,020 | py | Python | venv/Lib/site-packages/pyrogram/raw/functions/messages/get_dialog_unread_marks.py | iamgeorgiy/heroku-userbot | 5a92417d16f8ead949d88cb38da213fc2da5d3a4 | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/pyrogram/raw/functions/messages/get_dialog_unread_marks.py | iamgeorgiy/heroku-userbot | 5a92417d16f8ead949d88cb38da213fc2da5d3a4 | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/pyrogram/raw/functions/messages/get_dialog_unread_marks.py | iamgeorgiy/heroku-userbot | 5a92417d16f8ead949d88cb38da213fc2da5d3a4 | [
"Apache-2.0"
] | null | null | null | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2020 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 30.149254 | 103 | 0.631188 |
from io import BytesIO
from pyrogram.raw.core.primitives import Int, Long, Int128, Int256, Bool, Bytes, String, Double, Vector
from pyrogram.raw.core import TLObject
from pyrogram import raw
from typing import List, Union, Any
| true | true |
790c87d6ab5b6406edbaf5b2a2fb86acf561e471 | 24,973 | py | Python | utils/cleanup.py | fsanges/glTools | 8ff0899de43784a18bd4543285655e68e28fb5e5 | [
"MIT"
] | 165 | 2015-01-26T05:22:04.000Z | 2022-03-22T02:50:41.000Z | utils/cleanup.py | qeeji/glTools | 8ff0899de43784a18bd4543285655e68e28fb5e5 | [
"MIT"
] | 5 | 2015-12-02T02:39:44.000Z | 2020-12-09T02:45:54.000Z | utils/cleanup.py | qeeji/glTools | 8ff0899de43784a18bd4543285655e68e28fb5e5 | [
"MIT"
] | 83 | 2015-02-10T17:18:24.000Z | 2022-02-10T07:16:47.000Z | import maya.mel as mm
import maya.cmds as mc
import glTools.utils.attribute
import glTools.utils.base
import glTools.utils.layer
import glTools.utils.reference
import glTools.utils.shader
import glTools.utils.shape
import glTools.utils.transform
import re
# ===========
# - Cleanup -
# ===========
def toggleCons(sta... | 25.851967 | 174 | 0.699916 | import maya.mel as mm
import maya.cmds as mc
import glTools.utils.attribute
import glTools.utils.base
import glTools.utils.layer
import glTools.utils.reference
import glTools.utils.shader
import glTools.utils.shape
import glTools.utils.transform
import re
def toggleCons(state):
conList = mc.ls('*Con*_jnt',typ... | true | true |
790c8a5ad4870b39b761cf8182a056f45a6f79f3 | 446 | py | Python | data/scripts/templates/object/mobile/shared_warren_bors_teraud.py | obi-two/GameServer | 7d37024e2291a97d49522610cd8f1dbe5666afc2 | [
"MIT"
] | 20 | 2015-02-23T15:11:56.000Z | 2022-03-18T20:56:48.000Z | data/scripts/templates/object/mobile/shared_warren_bors_teraud.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | null | null | null | data/scripts/templates/object/mobile/shared_warren_bors_teraud.py | apathyboy/swganh | 665128efe9154611dec4cb5efc61d246dd095984 | [
"MIT"
] | 20 | 2015-04-04T16:35:59.000Z | 2022-03-24T14:54:37.000Z | #### NOTICE: THIS FILE IS AUTOGENERATED
#### MODIFICATIONS MAY BE LOST IF DONE IMPROPERLY
#### PLEASE SEE THE ONLINE DOCUMENTATION FOR EXAMPLES
from swgpy.object import *
def create(kernel):
result = Creature()
result.template = "object/mobile/shared_warren_bors_teraud.iff"
result.attribute_template_id = 9
resu... | 26.235294 | 64 | 0.730942 | true | true | |
790c8b129da1130af784e30e95e0fd923fc98ff0 | 5,432 | py | Python | tests/speed.py | cvzi/foodemoji | b43d80f5a6abada96d8383a5fb442e4bf4083631 | [
"MIT"
] | 1 | 2021-07-28T18:31:59.000Z | 2021-07-28T18:31:59.000Z | tests/speed.py | cvzi/foodemoji | b43d80f5a6abada96d8383a5fb442e4bf4083631 | [
"MIT"
] | null | null | null | tests/speed.py | cvzi/foodemoji | b43d80f5a6abada96d8383a5fb442e4bf4083631 | [
"MIT"
] | 1 | 2018-10-23T09:20:52.000Z | 2018-10-23T09:20:52.000Z | # -*- coding: utf-8 -*-
# https://github.com/cvzi/foodemoji
import sys
import os
import timeit
try:
import foodemoji
except ImportError:
include = os.path.relpath(os.path.join(os.path.dirname(__file__), ".."))
sys.path.insert(0, include)
import foodemoji
print("Imported foodemoji from %s" % os.path... | 36.952381 | 780 | 0.726804 |
import sys
import os
import timeit
try:
import foodemoji
except ImportError:
include = os.path.relpath(os.path.join(os.path.dirname(__file__), ".."))
sys.path.insert(0, include)
import foodemoji
print("Imported foodemoji from %s" % os.path.abspath(os.path.join(include, "foodemoji")))
PY2 = sys.v... | true | true |
790c8bd261da619e5576efa5d9c7891f5c5b2620 | 3,856 | py | Python | loss/robust_loss_pytorch/robust_loss_pytorch/cubic_spline.py | milesgray/CALAE | a2ab2f7d9ee17cc6c24ff6ac370b0373537079ac | [
"Apache-2.0"
] | 522 | 2019-05-15T23:09:14.000Z | 2022-03-19T14:17:22.000Z | robust_loss_pytorch/cubic_spline.py | durandtibo/robust_loss_pytorch | 911378b855f567e942336ae609cb8edb52e55228 | [
"Apache-2.0"
] | 31 | 2019-06-03T10:55:22.000Z | 2022-03-24T21:58:46.000Z | robust_loss_pytorch/cubic_spline.py | durandtibo/robust_loss_pytorch | 911378b855f567e942336ae609cb8edb52e55228 | [
"Apache-2.0"
] | 80 | 2019-05-29T14:21:49.000Z | 2022-01-11T07:52:50.000Z | # coding=utf-8
# Copyright 2019 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 39.346939 | 79 | 0.713174 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import torch
def interpolate1d(x, values, tangents):
assert torch.is_tensor(x)
assert torch.is_tensor(values)
assert torch.is_tensor(tangents)
float_dtype = x.dtype... | true | true |
790c8c1d71d3b4e18a00157853ed455148a3968d | 519 | py | Python | crafters/numeric/ArrayStringReader/tests/test_arraystringreader.py | carlosb1/jina-hub | f298d0f136c8627dd720d7a4e3eb9031655f5ccb | [
"Apache-2.0"
] | 1 | 2022-03-01T12:43:17.000Z | 2022-03-01T12:43:17.000Z | crafters/numeric/ArrayStringReader/tests/test_arraystringreader.py | carlosb1/jina-hub | f298d0f136c8627dd720d7a4e3eb9031655f5ccb | [
"Apache-2.0"
] | null | null | null | crafters/numeric/ArrayStringReader/tests/test_arraystringreader.py | carlosb1/jina-hub | f298d0f136c8627dd720d7a4e3eb9031655f5ccb | [
"Apache-2.0"
] | null | null | null | import numpy as np
from .. import ArrayStringReader
def test_arraystringreader():
"""here is my test code
https://docs.pytest.org/en/stable/getting-started.html#create-your-first-test
"""
size = 8
sample_array = np.random.rand(size).astype('float32')
text = ','.join([str(x) for x in sample_a... | 25.95 | 81 | 0.687861 | import numpy as np
from .. import ArrayStringReader
def test_arraystringreader():
size = 8
sample_array = np.random.rand(size).astype('float32')
text = ','.join([str(x) for x in sample_array])
reader = ArrayStringReader()
crafted_doc = reader.craft(text, 0)
assert crafted_doc['blob'].shape[... | true | true |
790c8ccc9ff42ab78d01890aefd7ce0b436f416c | 109 | py | Python | mayan/apps/dependencies/__init__.py | Syunkolee9891/Mayan-EDMS | 3759a9503a264a180b74cc8518388f15ca66ac1a | [
"Apache-2.0"
] | 1 | 2021-06-17T18:24:25.000Z | 2021-06-17T18:24:25.000Z | mayan/apps/dependencies/__init__.py | Syunkolee9891/Mayan-EDMS | 3759a9503a264a180b74cc8518388f15ca66ac1a | [
"Apache-2.0"
] | 7 | 2020-06-06T00:01:04.000Z | 2022-01-13T01:47:17.000Z | mayan/apps/dependencies/__init__.py | Syunkolee9891/Mayan-EDMS | 3759a9503a264a180b74cc8518388f15ca66ac1a | [
"Apache-2.0"
] | 1 | 2020-07-29T21:03:27.000Z | 2020-07-29T21:03:27.000Z | from __future__ import unicode_literals
default_app_config = 'mayan.apps.dependencies.apps.DependenciesApp'
| 27.25 | 67 | 0.862385 | from __future__ import unicode_literals
default_app_config = 'mayan.apps.dependencies.apps.DependenciesApp'
| true | true |
790c8cd6cde18e829123f7a660cbb5a6be0b5d99 | 16,078 | py | Python | docs/conf.py | vlive1111/airflow | 7825e8f59034645ab3247229be83a3aa90baece1 | [
"Apache-2.0"
] | null | null | null | docs/conf.py | vlive1111/airflow | 7825e8f59034645ab3247229be83a3aa90baece1 | [
"Apache-2.0"
] | null | null | null | docs/conf.py | vlive1111/airflow | 7825e8f59034645ab3247229be83a3aa90baece1 | [
"Apache-2.0"
] | null | null | null | # flake8: noqa
# Disable Flake8 because of all the sphinx imports
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you un... | 38.009456 | 138 | 0.678505 |
import os
import sys
from glob import glob
from typing import List
import airflow
from airflow.configuration import default_config_yaml
try:
import sphinx_airflow_theme
airflow_theme_is_available = True
except ImportError:
airflow_theme_is_available = False
os.enviro... | true | true |
790c8dc814e7074f4e401866caea91228581eec8 | 6,628 | py | Python | hubblestack/log.py | instructure/hubble | d94ec81f478e3a59611faa0c125fd120e9f43d0b | [
"Apache-2.0"
] | 2 | 2019-11-30T19:36:25.000Z | 2020-09-23T06:28:26.000Z | hubblestack/log.py | instructure/hubble | d94ec81f478e3a59611faa0c125fd120e9f43d0b | [
"Apache-2.0"
] | 3 | 2020-08-03T18:14:02.000Z | 2020-08-03T22:43:44.000Z | hubblestack/log.py | instructure/hubble | d94ec81f478e3a59611faa0c125fd120e9f43d0b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Logging for the hubble daemon
"""
import logging
import time
import hubblestack.splunklogging
# These patterns will not be logged by "conf_publisher" and "emit_to_splunk"
PATTERNS_TO_FILTER = ["password", "token", "passphrase", "privkey",
"keyid", "s3.key", "splun... | 28.943231 | 99 | 0.664152 |
import logging
import time
import hubblestack.splunklogging
PATTERNS_TO_FILTER = ["password", "token", "passphrase", "privkey",
"keyid", "s3.key", "splunk_token"]
SPLUNK = logging.SPLUNK = 25
PROFILE = logging.PROFILE = 15
TRACE = logging.TRACE = 5
GARBAGE = logging.GARBAGE = 1
QUIET = l... | true | true |
790c8de998b51f0c481a10acc216410fd391a3c0 | 502 | py | Python | Fine-tuning/Utility Files/wikiann_preprocessor.py | Vaidehi99/OBPE | e844c3268d3d698eeca96cd2646441601474155b | [
"Apache-2.0"
] | null | null | null | Fine-tuning/Utility Files/wikiann_preprocessor.py | Vaidehi99/OBPE | e844c3268d3d698eeca96cd2646441601474155b | [
"Apache-2.0"
] | null | null | null | Fine-tuning/Utility Files/wikiann_preprocessor.py | Vaidehi99/OBPE | e844c3268d3d698eeca96cd2646441601474155b | [
"Apache-2.0"
] | null | null | null | import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--infile", default=None, type=str, required=True, help="path of input file to preprocess")
parser.add_argument("--outfile", default=None, type=str, required=True,help="output file path")
args = parser.parse_args()
lines=open(args.infile,'r').readl... | 31.375 | 111 | 0.699203 | import argparse
parser = argparse.ArgumentParser()
parser.add_argument("--infile", default=None, type=str, required=True, help="path of input file to preprocess")
parser.add_argument("--outfile", default=None, type=str, required=True,help="output file path")
args = parser.parse_args()
lines=open(args.infile,'r').readl... | true | true |
790c8eadf2fdde222a7edbfa4ff632907727f155 | 2,970 | py | Python | Software/Funcionales/funciones_LambdaCDM_AGN.py | matiasleize/tesis_licenciatura | 5df6e341314583702b466b8ed7977d410f0ee457 | [
"MIT"
] | null | null | null | Software/Funcionales/funciones_LambdaCDM_AGN.py | matiasleize/tesis_licenciatura | 5df6e341314583702b466b8ed7977d410f0ee457 | [
"MIT"
] | null | null | null | Software/Funcionales/funciones_LambdaCDM_AGN.py | matiasleize/tesis_licenciatura | 5df6e341314583702b466b8ed7977d410f0ee457 | [
"MIT"
] | null | null | null | """
Created on Sun Feb 2 13:28:48 2020
@author: matias
"""
import numpy as np
from numpy.linalg import inv
from matplotlib import pyplot as plt
import time
import camb
from scipy.integrate import cumtrapz as cumtrapz
from scipy.integrate import simps as simps
from scipy.interpolate import interp1d
from scipy.constant... | 28.557692 | 91 | 0.676431 | import numpy as np
from numpy.linalg import inv
from matplotlib import pyplot as plt
import time
import camb
from scipy.integrate import cumtrapz as cumtrapz
from scipy.integrate import simps as simps
from scipy.interpolate import interp1d
from scipy.constants import c as c_luz
c_luz_km = c_luz/1000
import sys
import... | true | true |
790c8fb53feaa528655dc48d7224c7c5ffda0117 | 7,725 | py | Python | services/director-v2/tests/unit/test_modules_director_v0.py | GitHK/osparc-simcore-forked | 5b01a28d1b8028afcf9a735e1d46a73daa13686e | [
"MIT"
] | null | null | null | services/director-v2/tests/unit/test_modules_director_v0.py | GitHK/osparc-simcore-forked | 5b01a28d1b8028afcf9a735e1d46a73daa13686e | [
"MIT"
] | 17 | 2020-10-15T16:06:05.000Z | 2022-03-21T18:48:21.000Z | services/director-v2/tests/unit/test_modules_director_v0.py | GitHK/osparc-simcore-forked | 5b01a28d1b8028afcf9a735e1d46a73daa13686e | [
"MIT"
] | null | null | null | # pylint:disable=unused-variable
# pylint:disable=unused-argument
# pylint:disable=redefined-outer-name
# pylint:disable=protected-access
import json
import re
import urllib.parse
from collections import namedtuple
from pathlib import Path
from random import randint
from typing import Callable, List
from uuid import u... | 33.733624 | 127 | 0.71767 |
import json
import re
import urllib.parse
from collections import namedtuple
from pathlib import Path
from random import randint
from typing import Callable, List
from uuid import uuid4
import pytest
import respx
from fastapi import FastAPI, status
from models_library.services import ServiceDockerData, ServiceKey... | true | true |
790c9459fd20a479a63780067f6e8bbb4410f33b | 30,755 | py | Python | findsqlinj.py | ThomasTJdev/python_gdork_sqli | 9f0254733601b5ead8799cbc8539fdf712db49b5 | [
"MIT"
] | 58 | 2017-01-23T11:36:29.000Z | 2022-02-20T16:53:25.000Z | findsqlinj.py | ThomasTJdev/python_gdork_sqli | 9f0254733601b5ead8799cbc8539fdf712db49b5 | [
"MIT"
] | 2 | 2017-01-26T15:14:46.000Z | 2018-12-29T08:03:43.000Z | findsqlinj.py | ThomasTJdev/python_gdork_sqli | 9f0254733601b5ead8799cbc8539fdf712db49b5 | [
"MIT"
] | 33 | 2017-01-22T01:53:42.000Z | 2021-12-13T20:47:20.000Z | #!/usr/bin/python python3
#
# Python script for finding websites which are prone to SQL injections
# Do crawling on bing or google for possible vuln urls
# Check url with qoute ' and catch error messages
# Run sqlmap against urls
#
# License:
# MIT - (c) 2016 ThomasTJ (TTJ)
#
import sys # Qui... | 46.040419 | 206 | 0.497773 |
# Run sqlmap against urls
#
# License:
# MIT - (c) 2016 ThomasTJ (TTJ)
#
import sys # Quit the shiat
import os # Working with files and starting sqlmap
import re # Searching web results for vuln
import requests # Cal... | true | true |
790c945b942734c8447cae4a5be22ceb46f4e28d | 95 | py | Python | SimpleNews/apps.py | cww97/newsChain | 1243c47176ddfa680a69da0d325056698b11ad59 | [
"WTFPL"
] | null | null | null | SimpleNews/apps.py | cww97/newsChain | 1243c47176ddfa680a69da0d325056698b11ad59 | [
"WTFPL"
] | 2 | 2020-04-30T14:43:42.000Z | 2020-07-19T14:37:34.000Z | SimpleNews/apps.py | cww97/newsChain | 1243c47176ddfa680a69da0d325056698b11ad59 | [
"WTFPL"
] | null | null | null | from django.apps import AppConfig
class SimplenewsConfig(AppConfig):
name = 'SimpleNews'
| 15.833333 | 34 | 0.768421 | from django.apps import AppConfig
class SimplenewsConfig(AppConfig):
name = 'SimpleNews'
| true | true |
790c951b07f4f5575656be117cc473bed050b786 | 501 | py | Python | utils.py | domorelivelonger/rss-telegram-bot | c1bc3b2c9219eaeb4daa186874675128ee5386af | [
"MIT"
] | 1 | 2021-08-31T16:52:46.000Z | 2021-08-31T16:52:46.000Z | utils.py | domorelivelonger/rss-telegram-bot | c1bc3b2c9219eaeb4daa186874675128ee5386af | [
"MIT"
] | null | null | null | utils.py | domorelivelonger/rss-telegram-bot | c1bc3b2c9219eaeb4daa186874675128ee5386af | [
"MIT"
] | null | null | null | # Get substring using 'start' and 'end' position.
def get_substring_or_empty(data, start, end=''):
if start in data:
if '' == start:
f = 0
else:
f = len(start)
f = data.find(start) + f
data = data[f:]
else:
return ''
if end in data:
... | 20.04 | 49 | 0.447106 |
def get_substring_or_empty(data, start, end=''):
if start in data:
if '' == start:
f = 0
else:
f = len(start)
f = data.find(start) + f
data = data[f:]
else:
return ''
if end in data:
if '' == end:
f = len(data)
... | true | true |
790c95727d163da9103c29441e784b656b234fcd | 4,274 | py | Python | tests/integration/benchmark_runner/common/oc/test_oc_without_operator.py | RobertKrawitz/benchmark-runner | 671fd638ba139d74a3356673ad27b78b35a6a66a | [
"Apache-2.0"
] | 10 | 2021-07-21T21:44:20.000Z | 2022-02-24T22:01:13.000Z | tests/integration/benchmark_runner/common/oc/test_oc_without_operator.py | RobertKrawitz/benchmark-runner | 671fd638ba139d74a3356673ad27b78b35a6a66a | [
"Apache-2.0"
] | 83 | 2021-07-20T14:37:44.000Z | 2022-03-24T13:48:04.000Z | tests/integration/benchmark_runner/common/oc/test_oc_without_operator.py | RobertKrawitz/benchmark-runner | 671fd638ba139d74a3356673ad27b78b35a6a66a | [
"Apache-2.0"
] | 6 | 2021-07-14T21:12:48.000Z | 2022-02-15T12:48:27.000Z |
# Tests that are not required benchmark-operator pod
from benchmark_runner.common.oc.oc import OC
from tests.integration.benchmark_runner.test_environment_variables import *
import tempfile
import tarfile
import time
from benchmark_runner.common.prometheus.prometheus_snapshot import PrometheusSnapshot
def test_oc_g... | 26.060976 | 141 | 0.704024 |
from benchmark_runner.common.oc.oc import OC
from tests.integration.benchmark_runner.test_environment_variables import *
import tempfile
import tarfile
import time
from benchmark_runner.common.prometheus.prometheus_snapshot import PrometheusSnapshot
def test_oc_get_ocp_server_version():
oc = OC(kubeadmin_passw... | true | true |
790c95ac63865502589c094f74b76d70fd67aee3 | 15,667 | py | Python | dipper/sources/Panther.py | putmantime/dipper | 583d76207877096a84a98a379c904ea9c960c400 | [
"BSD-3-Clause"
] | null | null | null | dipper/sources/Panther.py | putmantime/dipper | 583d76207877096a84a98a379c904ea9c960c400 | [
"BSD-3-Clause"
] | null | null | null | dipper/sources/Panther.py | putmantime/dipper | 583d76207877096a84a98a379c904ea9c960c400 | [
"BSD-3-Clause"
] | 1 | 2022-01-04T14:34:33.000Z | 2022-01-04T14:34:33.000Z | import tarfile
import re
import logging
from dipper.sources.Source import Source
from dipper.models.assoc.OrthologyAssoc import OrthologyAssoc
from dipper.models.Model import Model
from dipper.models.Dataset import Dataset
from dipper import config
from dipper import curie_map
__author__ = 'nicole'
logger = logging.... | 37.037825 | 79 | 0.544329 | import tarfile
import re
import logging
from dipper.sources.Source import Source
from dipper.models.assoc.OrthologyAssoc import OrthologyAssoc
from dipper.models.Model import Model
from dipper.models.Dataset import Dataset
from dipper import config
from dipper import curie_map
__author__ = 'nicole'
logger = logging.... | true | true |
790c96dd4c7bcfd16d5ba09119835c9e3fc6ce48 | 1,006 | py | Python | blog/templatetags/markdown_html.py | whitecat-22/blog_site | 21fae0cabacfa206341ec78deefd681f21f2c291 | [
"MIT"
] | 1 | 2021-08-19T23:56:38.000Z | 2021-08-19T23:56:38.000Z | blog/templatetags/markdown_html.py | whitecat-22/blog_site | 21fae0cabacfa206341ec78deefd681f21f2c291 | [
"MIT"
] | null | null | null | blog/templatetags/markdown_html.py | whitecat-22/blog_site | 21fae0cabacfa206341ec78deefd681f21f2c291 | [
"MIT"
] | null | null | null | from django import template
from django.utils.safestring import mark_safe
import markdown
from markdownx.utils import markdownify
from markdownx.settings import (
MARKDOWNX_MARKDOWN_EXTENSIONS,
MARKDOWNX_MARKDOWN_EXTENSION_CONFIGS
)
from markdown.extensions import Extension
register = template.Library()
@reg... | 25.15 | 63 | 0.762425 | from django import template
from django.utils.safestring import mark_safe
import markdown
from markdownx.utils import markdownify
from markdownx.settings import (
MARKDOWNX_MARKDOWN_EXTENSIONS,
MARKDOWNX_MARKDOWN_EXTENSION_CONFIGS
)
from markdown.extensions import Extension
register = template.Library()
@reg... | true | true |
790c97fefa96c656310b481d8467d21f9c7aefe6 | 279 | py | Python | unittest/code.py | MahanBi/python-tests | b7d8b8a1b6176bd991bd81fdc357203abc6c5288 | [
"Apache-2.0"
] | null | null | null | unittest/code.py | MahanBi/python-tests | b7d8b8a1b6176bd991bd81fdc357203abc6c5288 | [
"Apache-2.0"
] | null | null | null | unittest/code.py | MahanBi/python-tests | b7d8b8a1b6176bd991bd81fdc357203abc6c5288 | [
"Apache-2.0"
] | null | null | null | def add(a: int, b: int) -> int:
return a + b
def subtract(a: int, b: int) -> int:
return a - b
def multiply(a: int, b: int or str) -> int:
return a * b
"""
...
----------------------------------------------------------------------
Ran 3 tests in 0.000s
OK
"""
| 13.95 | 70 | 0.387097 | def add(a: int, b: int) -> int:
return a + b
def subtract(a: int, b: int) -> int:
return a - b
def multiply(a: int, b: int or str) -> int:
return a * b
| true | true |
790c981f4cc854524f7a2a7c9050b86f4e6f0725 | 2,453 | py | Python | nemo/collections/nlp/data/text_normalization/utils.py | JMichaelStringer/NeMo | b5b29a69ccb0ec3d8c9ace2f33872ee99858a559 | [
"Apache-2.0"
] | 1 | 2021-09-10T10:40:51.000Z | 2021-09-10T10:40:51.000Z | nemo/collections/nlp/data/text_normalization/utils.py | JMichaelStringer/NeMo | b5b29a69ccb0ec3d8c9ace2f33872ee99858a559 | [
"Apache-2.0"
] | null | null | null | nemo/collections/nlp/data/text_normalization/utils.py | JMichaelStringer/NeMo | b5b29a69ccb0ec3d8c9ace2f33872ee99858a559 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 34.069444 | 111 | 0.6596 |
import string
from copy import deepcopy
from nltk import word_tokenize
from tqdm import tqdm
import nemo.collections.nlp.data.text_normalization.constants as constants
__all__ = ['read_data_file', 'normalize_str']
def read_data_file(fp):
insts, w_words, s_words, classes = [], [], [], []
w... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.