hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | 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 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | 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 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6e88a6af99b663684578ee3bce56424a72669541 | 10,574 | py | Python | gs_quant/test/timeseries/test_measures_risk_models.py | S-Manglik/gs-quant | af22aa8574571db45ddc2a9627d25a26bd00e09b | [
"Apache-2.0"
] | null | null | null | gs_quant/test/timeseries/test_measures_risk_models.py | S-Manglik/gs-quant | af22aa8574571db45ddc2a9627d25a26bd00e09b | [
"Apache-2.0"
] | null | null | null | gs_quant/test/timeseries/test_measures_risk_models.py | S-Manglik/gs-quant | af22aa8574571db45ddc2a9627d25a26bd00e09b | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 Goldman Sachs.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing,
software di... | 35.844068 | 115 | 0.648477 |
07f87d24a093939b2e9cdcbd94ceee750e9ded5b | 25,358 | py | Python | astropy/io/registry.py | bastianbeischer/astropy | 6054cc78b22a6bcd4b37fdfdec02f5331b957355 | [
"BSD-3-Clause"
] | 1 | 2020-05-10T21:17:24.000Z | 2020-05-10T21:17:24.000Z | astropy/io/registry.py | bastianbeischer/astropy | 6054cc78b22a6bcd4b37fdfdec02f5331b957355 | [
"BSD-3-Clause"
] | null | null | null | astropy/io/registry.py | bastianbeischer/astropy | 6054cc78b22a6bcd4b37fdfdec02f5331b957355 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import contextlib
import pathlib
import re
import sys
import inspect
import os
from collections import OrderedDict
from operator import itemgetter
import numpy as np
__all__ = ['register_reader', 'register_writer', 'register_identifier',
'id... | 34.976552 | 91 | 0.617044 |
1b9447fc9144727ec4f7a5c1928fdaaa9cb812a4 | 595 | py | Python | examples/example_1/data_analysis.py | NeuralEnsemble/neurotune | a17f0fd192b20e29b032826b6c54568e0bbef445 | [
"BSD-3-Clause"
] | 9 | 2016-08-10T20:52:57.000Z | 2021-04-12T05:32:36.000Z | examples/example_1/data_analysis.py | NeuralEnsemble/neurotune | a17f0fd192b20e29b032826b6c54568e0bbef445 | [
"BSD-3-Clause"
] | 9 | 2017-02-01T12:05:47.000Z | 2022-01-31T09:48:09.000Z | examples/example_1/data_analysis.py | NeuralEnsemble/neurotune | a17f0fd192b20e29b032826b6c54568e0bbef445 | [
"BSD-3-Clause"
] | 3 | 2017-02-20T14:30:30.000Z | 2021-08-17T17:34:03.000Z | from pyelectro import analysis as pye_analysis
from matplotlib import pyplot
file_name = '100pA_1a.csv'
t,v=pye_analysis.load_csv_data(file_name)
analysis_var={'peak_delta':0.1,'baseline':0,'dvdt_threshold':2,'peak_threshold':0}
analysis=pye_analysis.IClampAnalysis(v,
t,
... | 27.045455 | 82 | 0.591597 |
f4f521772fa67ed1df077c75c8f44d9065266a78 | 2,194 | py | Python | tests/unit/router/tests_router.py | pyl1b/p2p0mq | c2d9e26f66c27e59d6c1e24a15996c54c5cfc0a2 | [
"MIT"
] | null | null | null | tests/unit/router/tests_router.py | pyl1b/p2p0mq | c2d9e26f66c27e59d6c1e24a15996c54c5cfc0a2 | [
"MIT"
] | 1 | 2019-12-06T21:19:09.000Z | 2019-12-06T21:19:09.000Z | tests/unit/router/tests_router.py | pyl1b/p2p0mq | c2d9e26f66c27e59d6c1e24a15996c54c5cfc0a2 | [
"MIT"
] | 1 | 2020-06-30T06:02:49.000Z | 2020-06-30T06:02:49.000Z | # -*- coding: utf-8 -*-
"""
"""
from __future__ import unicode_literals
from __future__ import print_function
import logging
import threading
from unittest import TestCase
from unittest.mock import MagicMock
from p2p0mq.concerns.ask_around import AskAroundConcern
from p2p0mq.message import Message
from p2p0mq.message... | 30.054795 | 78 | 0.665451 |
1838e442fc704ad7f62ad87e3adc98be2f4e0ac9 | 25,500 | py | Python | anima/render/arnold/h2a.py | MehmetErer/anima | f92ae599b5a4c181fc8e131a9ccdde537e635303 | [
"MIT"
] | 101 | 2015-02-08T22:20:11.000Z | 2022-03-21T18:56:42.000Z | anima/render/arnold/h2a.py | Khosiyat/anima | f631c08400547f49ac5f1feeb730f22c255eb771 | [
"MIT"
] | 23 | 2016-11-30T08:33:21.000Z | 2021-01-26T12:11:12.000Z | anima/render/arnold/h2a.py | Khosiyat/anima | f631c08400547f49ac5f1feeb730f22c255eb771 | [
"MIT"
] | 27 | 2015-01-03T06:49:45.000Z | 2021-12-28T03:30:54.000Z | # -*- coding: utf-8 -*-
import os
import gzip
import struct
import time
from anima.render.arnold import base85
reload(base85)
try:
import hou
except ImportError:
hou = None
from cStringIO import StringIO
class Buffer(object):
"""Buffer class for efficient string concatenation.
This class uses cS... | 31.25 | 105 | 0.637451 |
71f7b29195e86eab59426ea2d54a0df8eb95715a | 36,620 | py | Python | lib/commands.py | aghamir/electrum | 586aee45eb36bd797333cf23440ed6a8e2bc8ec4 | [
"MIT"
] | null | null | null | lib/commands.py | aghamir/electrum | 586aee45eb36bd797333cf23440ed6a8e2bc8ec4 | [
"MIT"
] | 2 | 2020-04-12T02:45:18.000Z | 2020-04-12T02:46:01.000Z | lib/commands.py | aghamir/electrum | 586aee45eb36bd797333cf23440ed6a8e2bc8ec4 | [
"MIT"
] | 1 | 2018-10-07T01:08:21.000Z | 2018-10-07T01:08:21.000Z | #!/usr/bin/env python
#
# Electrum - lightweight Bitcoin client
# Copyright (C) 2011 thomasv@gitorious
#
# 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 witho... | 41.007839 | 172 | 0.628646 |
4df53161bdd68e84e108db0c0cb2ff2a201cb22d | 624 | py | Python | research/plot.py | thautwarm/BioInfoPlus | b3f404d3f13cfccf4694cfba586ac7efcbf5bf29 | [
"Apache-2.0"
] | null | null | null | research/plot.py | thautwarm/BioInfoPlus | b3f404d3f13cfccf4694cfba586ac7efcbf5bf29 | [
"Apache-2.0"
] | 1 | 2017-10-31T15:27:03.000Z | 2018-02-08T18:38:38.000Z | research/plot.py | thautwarm/BioInfoPlus | b3f404d3f13cfccf4694cfba586ac7efcbf5bf29 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri Nov 17 11:43:29 2017
@author: misakawa
"""
import numpy as np
from matplotlib import pyplot as plt
def plot_frequency(frequency):
ind2key = dict(zip(range(len(frequency)), (i[0] for i in frequency)))
ind = np.arange(len(frequency))
bar_split = ind[-1] if ind[-... | 24.96 | 73 | 0.649038 |
a0a76a3649f5c9a252c81fa3209d5b174cc75380 | 2,516 | py | Python | gemelli/q2/tests/test_data_transformations.py | ahdilmore/gemelli | c419b0392e87daefe800c645b837abc4172a9a26 | [
"BSD-3-Clause"
] | 32 | 2020-08-31T20:59:20.000Z | 2022-03-31T15:07:05.000Z | gemelli/q2/tests/test_data_transformations.py | ahdilmore/gemelli | c419b0392e87daefe800c645b837abc4172a9a26 | [
"BSD-3-Clause"
] | 24 | 2020-09-01T12:07:11.000Z | 2022-03-29T18:08:51.000Z | gemelli/q2/tests/test_data_transformations.py | ahdilmore/gemelli | c419b0392e87daefe800c645b837abc4172a9a26 | [
"BSD-3-Clause"
] | 10 | 2020-09-06T04:24:14.000Z | 2021-12-29T13:03:18.000Z | import unittest
import os
import numpy as np
from qiime2 import Artifact
import numpy.testing as npt
from biom import load_table, Table
from biom.util import biom_open
from os.path import sep as os_path_sep
from click.testing import CliRunner
from skbio.util import get_data_path
from qiime2.plugins.gemelli.actions impo... | 40.580645 | 74 | 0.612878 |
01db4640e5349b531898c18ebe44cf0a6d9589c4 | 8,348 | py | Python | ci/plugins/testScript.py | rafzi/etiss | c1b7ff3a7d3704bf707b1c0dfe15eb2e1aaddd32 | [
"BSD-3-Clause"
] | 2 | 2021-03-17T15:50:15.000Z | 2021-04-28T18:36:52.000Z | ci/plugins/testScript.py | rafzi/etiss | c1b7ff3a7d3704bf707b1c0dfe15eb2e1aaddd32 | [
"BSD-3-Clause"
] | null | null | null | ci/plugins/testScript.py | rafzi/etiss | c1b7ff3a7d3704bf707b1c0dfe15eb2e1aaddd32 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python3
#
# Copyright 2018 Infineon Technologies AG
#
# This file is part of ETISS tool, see <https://gitlab.lrz.de/de-tum-ei-eda-open/etiss>
#
# The initial version of this software has been created with the funding support by the German Federal
# Ministry of Education and Research(BMBF) in the project Effe... | 37.773756 | 108 | 0.716579 |
23bb45957871cd5743931d3bb81c333a6ccf3b3d | 294 | py | Python | Python_OOP_Softuni/Iterators_Generators_Exercises/venv/reader.py | borisboychev/SoftUni | 22062312f08e29a1d85377a6d41ef74966d37e99 | [
"MIT"
] | 1 | 2020-12-14T23:25:19.000Z | 2020-12-14T23:25:19.000Z | Python_OOP_Softuni/Iterators_Generators_Exercises/venv/reader.py | borisboychev/SoftUni | 22062312f08e29a1d85377a6d41ef74966d37e99 | [
"MIT"
] | null | null | null | Python_OOP_Softuni/Iterators_Generators_Exercises/venv/reader.py | borisboychev/SoftUni | 22062312f08e29a1d85377a6d41ef74966d37e99 | [
"MIT"
] | null | null | null | def read_next(*args):
for seq in args:
for el in seq:
<<<<<<< HEAD
yield el
""""Test Code"""
for item in read_next('string', (2,), {'d': 1, 'i': 2, 'c': 3, 't': 4}):
print(item, end='')
=======
yield el
>>>>>>> d79c1c8db2dfefe6e4c829e5cb5aa8db78b2579e
| 21 | 72 | 0.506803 |
9a3a8cdd1da508d5825493a26a0b0e422a154691 | 2,371 | py | Python | nas4candle/nasapi/search/nas/model/trainer/regressor_train_valid.py | scrlnas2019/nas4candle | 318959424cc66819c816054a87bd1cb5d426e2e7 | [
"BSD-3-Clause"
] | 1 | 2021-01-22T04:03:00.000Z | 2021-01-22T04:03:00.000Z | nas4candle/nasapi/search/nas/model/trainer/regressor_train_valid.py | scrlnas2019/nas4candle | 318959424cc66819c816054a87bd1cb5d426e2e7 | [
"BSD-3-Clause"
] | 1 | 2021-01-23T00:14:17.000Z | 2021-01-23T00:14:17.000Z | nas4candle/nasapi/search/nas/model/trainer/regressor_train_valid.py | scrlnas2019/nas4candle | 318959424cc66819c816054a87bd1cb5d426e2e7 | [
"BSD-3-Clause"
] | 2 | 2019-11-27T04:42:00.000Z | 2021-01-22T04:06:59.000Z | import tensorflow as tf
import numpy as np
import math
import traceback
from sklearn.metrics import mean_squared_error
import nas4candle.nasapi.search.nas.model.arch as a
import nas4candle.nasapi.search.nas.model.train_utils as U
from nas4candle.nasapi.search import util
from nas4candle.nasapi.search.nas.utils._loggin... | 36.476923 | 87 | 0.6124 |
3daea7c8e51a71ac1c65c7173c84b08d702e260d | 2,446 | py | Python | scripts/learn.py | DeepRank/DeepRank_Mut | 5e3272a9f2472e0cf3e81d294909e963eb1f7ce5 | [
"Apache-2.0"
] | null | null | null | scripts/learn.py | DeepRank/DeepRank_Mut | 5e3272a9f2472e0cf3e81d294909e963eb1f7ce5 | [
"Apache-2.0"
] | 9 | 2021-11-01T11:01:55.000Z | 2021-12-13T09:56:17.000Z | scripts/learn.py | DeepRank/DeepRank_Mut | 5e3272a9f2472e0cf3e81d294909e963eb1f7ce5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import sys
import os
import logging
import torch.optim as optim
# Assure that python can find the deeprank files:
deeprank_root = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.insert(0, deeprank_root)
from deeprank.learn.NeuralNet import NeuralNet
from deeprank.learn.Dat... | 28.44186 | 102 | 0.631643 |
300f684e1bc2f6c2a50d6d0a93479b8dd9505eac | 5,382 | py | Python | neurolab/error.py | Gabs48/SpringMassNetworks | d917ef242ed99b02f82e9ff8697960d0d1d65178 | [
"MIT"
] | 3 | 2019-11-27T15:35:20.000Z | 2021-12-09T08:20:34.000Z | neurolab/error.py | Gabs48/SpringMassNetworks | d917ef242ed99b02f82e9ff8697960d0d1d65178 | [
"MIT"
] | null | null | null | neurolab/error.py | Gabs48/SpringMassNetworks | d917ef242ed99b02f82e9ff8697960d0d1d65178 | [
"MIT"
] | 1 | 2021-03-16T15:42:36.000Z | 2021-03-16T15:42:36.000Z | # -*- coding: utf-8 -*-
""" Train error functions with derivatives
:Example:
>>> msef = MSE()
>>> x = np.array([[1.0, 0.0], [2.0, 0.0]])
>>> msef(x, 0)
1.25
>>> # calc derivative:
>>> msef.deriv(x[0], 0)
array([ 1., 0.])
"""
import numpy as np
class MSE(... | 21.789474 | 61 | 0.455221 |
7ded1e80e3687e981d87ec43722f4c70d9378f7a | 9,186 | py | Python | Scripts/json_config_parse.py | cobalt2727/FEX | 13087f8425aeaad28dc81bed46a83e1d72ff0db8 | [
"MIT"
] | 628 | 2020-03-06T14:01:32.000Z | 2022-03-31T06:35:14.000Z | Scripts/json_config_parse.py | cobalt2727/FEX | 13087f8425aeaad28dc81bed46a83e1d72ff0db8 | [
"MIT"
] | 576 | 2020-03-06T08:25:12.000Z | 2022-03-30T04:05:29.000Z | Scripts/json_config_parse.py | cobalt2727/FEX | 13087f8425aeaad28dc81bed46a83e1d72ff0db8 | [
"MIT"
] | 38 | 2020-03-07T06:10:00.000Z | 2022-03-29T09:27:36.000Z | from enum import Flag
import json
import struct
import sys
class Regs(Flag):
REG_NONE = 0
REG_RIP = (1 << 0)
REG_RAX = (1 << 1)
REG_RBX = (1 << 2)
REG_RCX = (1 << 3)
REG_RDX = (1 << 4)
REG_RSI = (1 << 5)
REG_RDI = (1 << 6)
REG_RBP = (1 << 7)
REG_RSP = (1 << 8)... | 29.824675 | 76 | 0.571957 |
14476118d2c51e2f9e9d22f67930b7afd3309ae5 | 10,330 | py | Python | src/process_documents/classes/patent.py | patent-analysis/ta | 5afe946468939c66ea7d7156649f780cc31a2ee0 | [
"MIT"
] | null | null | null | src/process_documents/classes/patent.py | patent-analysis/ta | 5afe946468939c66ea7d7156649f780cc31a2ee0 | [
"MIT"
] | 50 | 2021-03-15T17:08:53.000Z | 2021-07-04T02:44:47.000Z | src/process_documents/classes/patent.py | patent-analysis/ta | 5afe946468939c66ea7d7156649f780cc31a2ee0 | [
"MIT"
] | null | null | null | import string
import re
import xml.etree.ElementTree as et
import logging
import datetime
logger = logging.getLogger()
logger.setLevel(logging.INFO)
def find(tree, element):
elem = tree.find(element)
if elem == None:
return ''
return elem.text
def find_all_nested(tree, parent, element):
parent... | 47.385321 | 179 | 0.534753 |
8b464f5d22c0fba6557ba470c6a5b4850a90034e | 7,383 | py | Python | NAS/nni/examples/nas/darts/model.py | TiffanyTseng54/SimpleCVReproduction | 52754eb924c6c094af0b8089a1bd7af0be7ec1a3 | [
"Apache-2.0"
] | 1 | 2022-03-03T06:04:34.000Z | 2022-03-03T06:04:34.000Z | NAS/nni/examples/nas/darts/model.py | Twenty3hree/SimpleCVReproduction | 9939f8340c54dbd69b0017cecad875dccf428f26 | [
"Apache-2.0"
] | null | null | null | NAS/nni/examples/nas/darts/model.py | Twenty3hree/SimpleCVReproduction | 9939f8340c54dbd69b0017cecad875dccf428f26 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from collections import OrderedDict
import torch
import torch.nn as nn
import ops
from nni.nas.pytorch import mutables
class AuxiliaryHead(nn.Module):
""" Auxiliary head in 2/3 place of network to let the gradient flow well """
# 辅助头 ... | 35.495192 | 101 | 0.562238 |
9758b15b37055e7afc3869e6726bdee49c50d260 | 10,757 | py | Python | pystrf/audio.py | choldgraf/pySTRF | 26e66febd5f2f84e195645cfe4432954173caf14 | [
"BSD-2-Clause"
] | 3 | 2018-05-21T21:22:04.000Z | 2021-09-17T08:12:01.000Z | pystrf/audio.py | choldgraf/pySTRF | 26e66febd5f2f84e195645cfe4432954173caf14 | [
"BSD-2-Clause"
] | null | null | null | pystrf/audio.py | choldgraf/pySTRF | 26e66febd5f2f84e195645cfe4432954173caf14 | [
"BSD-2-Clause"
] | null | null | null | """A collection of functions for auditory processing and analysis."""
import numpy as np
import pandas as pd
from brian import Hz, kHz
from brian import hears
from .sig import compress_signal
__all__ = ['create_torc',
'spectrogram_audio',
'spectrogram_nsl',
'create_center_frequencies'... | 34.257962 | 79 | 0.647206 |
3b310d8fe093a4c25ec5c89a82af6f734ab73b66 | 7,824 | py | Python | gpflow/quadrature.py | lexxx233/GPflow | 7285baa5201de7e2e71dd5f903b228132a310edc | [
"Apache-2.0"
] | 1 | 2018-08-22T06:34:59.000Z | 2018-08-22T06:34:59.000Z | gpflow/quadrature.py | lexxx233/GPflow | 7285baa5201de7e2e71dd5f903b228132a310edc | [
"Apache-2.0"
] | null | null | null | gpflow/quadrature.py | lexxx233/GPflow | 7285baa5201de7e2e71dd5f903b228132a310edc | [
"Apache-2.0"
] | 2 | 2019-03-09T11:46:11.000Z | 2021-12-20T10:22:34.000Z | # Copyright 2017-2018 the GPflow authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 38.541872 | 101 | 0.61797 |
056e59204c50353161b9c534920e1eb1e7513077 | 1,098 | py | Python | hunter_douglas/hunter_douglas/doctype/employee_induction/employee_induction.py | thispl/hunter-douglas | b3a3a8a7087a042703ff33259a62b8b13ca87c82 | [
"MIT"
] | null | null | null | hunter_douglas/hunter_douglas/doctype/employee_induction/employee_induction.py | thispl/hunter-douglas | b3a3a8a7087a042703ff33259a62b8b13ca87c82 | [
"MIT"
] | null | null | null | hunter_douglas/hunter_douglas/doctype/employee_induction/employee_induction.py | thispl/hunter-douglas | b3a3a8a7087a042703ff33259a62b8b13ca87c82 | [
"MIT"
] | 1 | 2019-12-31T06:52:12.000Z | 2019-12-31T06:52:12.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2020, VHRS and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
import random
from frappe.model.document import Document
class EmployeeInduction(Document):
pass
@frappe.whitelist()
def create_questions_entr... | 28.894737 | 50 | 0.67031 |
c9d7b43bdf56fce7cebb9b671eeddd43bc79de6c | 2,368 | py | Python | linsolver/io.py | aradi/linsolve2 | e3d3fe3a41d7668552c68ea0db9e4b649f6d0221 | [
"BSD-2-Clause"
] | null | null | null | linsolver/io.py | aradi/linsolve2 | e3d3fe3a41d7668552c68ea0db9e4b649f6d0221 | [
"BSD-2-Clause"
] | null | null | null | linsolver/io.py | aradi/linsolve2 | e3d3fe3a41d7668552c68ea0db9e4b649f6d0221 | [
"BSD-2-Clause"
] | 1 | 2020-06-30T07:47:14.000Z | 2020-06-30T07:47:14.000Z | '''Input/output routines for the equation solver.'''
import numpy as np
_ERROR_PREFIX = "ERROR::"
def read_input(inputfile):
'''Reads the input for the solver.
Args:
inputfile: Name of the input file.
Returns:
Tuple (A, b) containing the coefficient matrix A and RHS of the
equa... | 28.190476 | 79 | 0.63049 |
0801776f2cbfd669209f3ed2d92cff426079af49 | 519 | py | Python | networking/pi/broadcast.py | kmackenzieii/marauders-map | 0027d2880cec8e5ef77b7e5c6454f43ef17b9867 | [
"MIT"
] | null | null | null | networking/pi/broadcast.py | kmackenzieii/marauders-map | 0027d2880cec8e5ef77b7e5c6454f43ef17b9867 | [
"MIT"
] | null | null | null | networking/pi/broadcast.py | kmackenzieii/marauders-map | 0027d2880cec8e5ef77b7e5c6454f43ef17b9867 | [
"MIT"
] | null | null | null | from socket import *
class BroadcastSocket:
def __init__(self, port):
self.s = socket(AF_INET, SOCK_DGRAM)
self.port = port
self.s.bind(('', 0))
self.s.setsockopt(SOL_SOCKET, SO_BROADCAST, 1)
def send(self, data):
self.s.sendto(data, ('', self.port))
def change_port(self, port):
self.port = port
def... | 21.625 | 48 | 0.647399 |
b26336b8d198f5c401bd67eaa0af817d46ec9de6 | 4,324 | py | Python | common/src/stack/command/stack/commands/add/storage/partition/__init__.py | sammeidinger/stack | a8085dce179dbe903f65f136f4b63bcc076cc057 | [
"BSD-3-Clause"
] | 123 | 2015-05-12T23:36:45.000Z | 2017-07-05T23:26:57.000Z | common/src/stack/command/stack/commands/add/storage/partition/__init__.py | sammeidinger/stack | a8085dce179dbe903f65f136f4b63bcc076cc057 | [
"BSD-3-Clause"
] | 177 | 2015-06-05T19:17:47.000Z | 2017-07-07T17:57:24.000Z | common/src/stack/command/stack/commands/add/storage/partition/__init__.py | sammeidinger/stack | a8085dce179dbe903f65f136f4b63bcc076cc057 | [
"BSD-3-Clause"
] | 32 | 2015-06-07T02:25:03.000Z | 2017-06-23T07:35:35.000Z | # @copyright@
# Copyright (c) 2006 - 2019 Teradata
# All rights reserved. Stacki(r) v5.x stacki.com
# https://github.com/Teradata/stacki/blob/master/LICENSE.txt
# @copyright@
import stack.commands
from stack.argument_processors.scope import ScopeArgProcessor
from stack.exception import CommandError, ParamRequired, Par... | 28.447368 | 120 | 0.683164 |
23743e842353e430aefb7974b424833e7edd62a5 | 780 | py | Python | workers/python-worker/ciworker/test/config_parser_test.py | idekerlab/ci-service-template | 5d46f030afe01a959c6afad0af35217347f4483a | [
"MIT"
] | 2 | 2015-10-02T18:41:09.000Z | 2015-10-16T20:57:01.000Z | workers/python-worker/ciworker/test/config_parser_test.py | afcarl/ci-service-template | 5d46f030afe01a959c6afad0af35217347f4483a | [
"MIT"
] | 15 | 2015-05-05T22:46:37.000Z | 2021-01-20T22:55:30.000Z | workers/python-worker/ciworker/test/config_parser_test.py | afcarl/ci-service-template | 5d46f030afe01a959c6afad0af35217347f4483a | [
"MIT"
] | 7 | 2015-04-20T20:48:36.000Z | 2015-11-13T02:35:36.000Z | # -*- coding: utf-8 -*-
import unittest
import os
from ciworker.config_parser import ConfigParser
class TestConfigParser(unittest.TestCase):
def test_parse_config(self):
print('\n\n---------- Config Parser Test Start -------------\n')
config_file = 'config.yml'
full_path = os.path.joi... | 22.941176 | 74 | 0.620513 |
64bb685d61952e6af95ed189b0bd9113b5a47d5d | 1,706 | py | Python | gpMgmt/bin/gppylib/commands/dca.py | henglabs/gpdb | 09a8cc05ac90d63c64c6d432ca35179b55a461b2 | [
"PostgreSQL",
"Apache-2.0"
] | null | null | null | gpMgmt/bin/gppylib/commands/dca.py | henglabs/gpdb | 09a8cc05ac90d63c64c6d432ca35179b55a461b2 | [
"PostgreSQL",
"Apache-2.0"
] | 6 | 2018-08-04T07:51:37.000Z | 2018-11-26T07:09:44.000Z | gpMgmt/bin/gppylib/commands/dca.py | henglabs/gpdb | 09a8cc05ac90d63c64c6d432ca35179b55a461b2 | [
"PostgreSQL",
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python2
#
# Copyright (c) Greenplum Inc 2011. All Rights Reserved.
#
"""
Module for commands that are DCA specific
"""
import os
from gppylib.gplog import get_default_logger
from base import Command, LOCAL, REMOTE
logger = get_default_logger()
# NOTE THIS IS A CHECK FOR 1040 or later appliance
def i... | 28.433333 | 67 | 0.613716 |
09df6e87b814e62b0bdeef63e35e467f565fdc9b | 2,537 | py | Python | lib/gadfly/serialize.py | dszmaj/wikidpad | 1127375665935524ddb623da8dd5137038c7e53e | [
"Apache-2.0",
"MIT"
] | 16 | 2015-02-05T17:32:04.000Z | 2022-01-14T13:46:36.000Z | lib/gadfly/serialize.py | dszmaj/wikidpad | 1127375665935524ddb623da8dd5137038c7e53e | [
"Apache-2.0",
"MIT"
] | 8 | 2015-06-20T20:02:41.000Z | 2016-02-23T14:52:32.000Z | lib/gadfly/serialize.py | dszmaj/wikidpad | 1127375665935524ddb623da8dd5137038c7e53e | [
"Apache-2.0",
"MIT"
] | 11 | 2015-05-19T09:17:16.000Z | 2017-09-14T00:43:13.000Z | ''' essentially, specialized pickle for this app:
:Author: Aaron Watters
:Maintainers: http://gadfly.sf.net/
:Copyright: Aaron Robert Watters, 1994
:Id: $Id: serialize.py,v 1.1 2006/01/07 15:01:25 Michael Butscher Exp $:
'''
# TODO need to fix serialization/deserialization of btand and btor
import types
d... | 30.202381 | 78 | 0.658258 |
6bbab73ed466680859987740e517716f4b7b560e | 45,171 | py | Python | API/src/main/resources/Lib/xlrd/formatting.py | MiguelDomingues/SikuliX1 | 4ff932ae616b1c1fd5409f6e8fbf6c4615aa52f3 | [
"MIT"
] | 4 | 2021-04-27T10:48:39.000Z | 2022-02-13T12:04:04.000Z | API/src/main/resources/Lib/xlrd/formatting.py | MiguelDomingues/SikuliX1 | 4ff932ae616b1c1fd5409f6e8fbf6c4615aa52f3 | [
"MIT"
] | null | null | null | API/src/main/resources/Lib/xlrd/formatting.py | MiguelDomingues/SikuliX1 | 4ff932ae616b1c1fd5409f6e8fbf6c4615aa52f3 | [
"MIT"
] | null | null | null | # -*- coding: cp1252 -*-
##
# Module for formatting information.
#
##
# No part of the content of this file was derived from the works of David Giffin.
from __future__ import print_function
DEBUG = 0
import re
from struct import unpack
from .timemachine import *
from .biffh import BaseObject, unpack_unicode, unpack... | 35.85 | 106 | 0.571561 |
decf079693e495754e7bf9ad60cfe50bc0c027e9 | 483 | py | Python | catchphrase/batman.py | scnerd/catchphrase | 45678d0a3ff5122c2cc8f5c9fd12a27223cd6719 | [
"MIT"
] | null | null | null | catchphrase/batman.py | scnerd/catchphrase | 45678d0a3ff5122c2cc8f5c9fd12a27223cd6719 | [
"MIT"
] | null | null | null | catchphrase/batman.py | scnerd/catchphrase | 45678d0a3ff5122c2cc8f5c9fd12a27223cd6719 | [
"MIT"
] | null | null | null | import pkg_resources
import json
import random
# List of real quotes provided courtesy of BuzzFeed
# https://www.buzzfeed.com/spenceralthouse/the-definitive-ranking-of-robins-exclamations-from-batma
with open(pkg_resources.resource_filename(__name__, "batman.json")) as f:
real_holy_phrases = json.load(f) # typ... | 24.15 | 99 | 0.747412 |
64d31f1964944a5535cb77ba345b6bd293701113 | 3,386 | py | Python | dtk/test/test_inertia.py | moorepants/DynamicistToolKit | fdf23ef20378be6ff90c937924fa142fb8cd18a5 | [
"Unlicense"
] | 9 | 2015-06-03T01:45:51.000Z | 2020-12-26T19:59:26.000Z | dtk/test/test_inertia.py | moorepants/DynamicistToolKit | fdf23ef20378be6ff90c937924fa142fb8cd18a5 | [
"Unlicense"
] | 8 | 2015-03-25T06:35:24.000Z | 2022-01-26T10:58:35.000Z | dtk/test/test_inertia.py | moorepants/DynamicistToolKit | fdf23ef20378be6ff90c937924fa142fb8cd18a5 | [
"Unlicense"
] | 5 | 2015-03-24T04:31:45.000Z | 2016-08-31T20:13:04.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# external libraries
import numpy as np
from numpy import testing
# local libraries
from ..inertia import *
def test_euler_rotation(display=False):
# body-three 1-2-3
a = [15., 0., 0.]
order = (1, 2, 3)
R = euler_rotation(a, order)
C = np.matrix([[1.... | 25.651515 | 78 | 0.471057 |
b227c51e80d00045a5190b9059fd9b1c11cf80d3 | 399 | py | Python | Exercises/Blackjack/dealer.py | Gwarglemar/PythonExercises | 3261892dea4d51b320cde2ce8a47e67a67609d30 | [
"MIT"
] | 1 | 2019-05-04T04:49:17.000Z | 2019-05-04T04:49:17.000Z | Exercises/Blackjack/dealer.py | Gwarglemar/Python | 3261892dea4d51b320cde2ce8a47e67a67609d30 | [
"MIT"
] | null | null | null | Exercises/Blackjack/dealer.py | Gwarglemar/Python | 3261892dea4d51b320cde2ce8a47e67a67609d30 | [
"MIT"
] | null | null | null | from person import Person
class Dealer(Person):
def show_hand(self,revealed=False):
output = "Dealer's hand: "
x = 1
for card in self.hand:
if x == 1 and revealed == False:
output = output + '<HIDDEN>' + ' | '
x += 1
else: ... | 28.5 | 53 | 0.446115 |
b87215d868979786241c8650bbec9e7e486c58a5 | 1,028 | py | Python | plato/clients/registry.py | SamuelGong/plato | 726f965620e63dfe18cc2edf07cc010a751f0231 | [
"Apache-2.0"
] | null | null | null | plato/clients/registry.py | SamuelGong/plato | 726f965620e63dfe18cc2edf07cc010a751f0231 | [
"Apache-2.0"
] | null | null | null | plato/clients/registry.py | SamuelGong/plato | 726f965620e63dfe18cc2edf07cc010a751f0231 | [
"Apache-2.0"
] | null | null | null | """
The registry that contains all available federated learning clients.
Having a registry of all available classes is convenient for retrieving an instance based
on a configuration at run-time.
"""
import logging
from collections import OrderedDict
from plato.clients import (
simple,
mistnet,
)
from plato.c... | 27.783784 | 133 | 0.719844 |
9c465b24d23f1858b6c8d521e0e84574f9f7a6cf | 3,722 | py | Python | examples/rivers/squeeze_rivers.py | bilgetutak/pyroms | 3b0550f26f4ac181b7812e14a7167cd1ca0797f0 | [
"BSD-3-Clause"
] | 75 | 2016-04-05T07:15:57.000Z | 2022-03-04T22:49:54.000Z | examples/rivers/squeeze_rivers.py | hadfieldnz/pyroms-mgh | cd0fe39075825f97a7caf64e2c4c5a19f23302fd | [
"BSD-3-Clause"
] | 27 | 2017-02-26T04:27:49.000Z | 2021-12-01T17:26:56.000Z | examples/rivers/squeeze_rivers.py | ESMG/PyCNAL_legacy | a4f6547bce872068a5bb5751231017bc3e4a4503 | [
"BSD-3-Clause"
] | 56 | 2016-05-11T06:19:14.000Z | 2022-03-22T19:04:17.000Z | import re
import numpy as np
import netCDF4
import sys
import pdb
infile = sys.argv[1]
outfile = sys.argv[2]
#pdb.set_trace()
nc_rivers = netCDF4.Dataset(infile, 'r')
sign = nc_rivers.variables['river_sign'][:]
xi = nc_rivers.variables['river_Xposition'][:]
eta = nc_rivers.variables['river_Eposition'][:]
dir = nc_ri... | 28.630769 | 76 | 0.68834 |
99205072a5507d82d3daaf101c9c57637e088996 | 2,093 | py | Python | testsuite/tests/operator/test_annotations.py | dlaso99/3scale-tests | b31a3b3596af6d632b393e383c0417ea56bd95ca | [
"Apache-2.0"
] | null | null | null | testsuite/tests/operator/test_annotations.py | dlaso99/3scale-tests | b31a3b3596af6d632b393e383c0417ea56bd95ca | [
"Apache-2.0"
] | null | null | null | testsuite/tests/operator/test_annotations.py | dlaso99/3scale-tests | b31a3b3596af6d632b393e383c0417ea56bd95ca | [
"Apache-2.0"
] | null | null | null | """
Check if annotations of operator pod are present
"""
from typing import Tuple, List, Union
import pytest
from packaging.version import Version # noqa # pylint: disable=unused-import
from testsuite import TESTED_VERSION # noqa # pylint: disable=unused-import
from testsuite.capabilities import Capability
pytestm... | 36.719298 | 110 | 0.715719 |
a7f80a433f85fe3db530e914d844a307c5b6ce04 | 8,651 | py | Python | parsuite/parsers/nmap.py | arch4ngel/parsuite | 69c66b4f5af092d63f4ba83d0193e93efe16a66e | [
"MIT"
] | 59 | 2019-03-22T18:49:53.000Z | 2021-10-13T00:16:26.000Z | parsuite/parsers/nmap.py | arch4ngel/parsuite | 69c66b4f5af092d63f4ba83d0193e93efe16a66e | [
"MIT"
] | 1 | 2019-05-07T04:36:51.000Z | 2022-03-28T19:28:56.000Z | parsuite/parsers/nmap.py | arch4ngel/parsuite | 69c66b4f5af092d63f4ba83d0193e93efe16a66e | [
"MIT"
] | 6 | 2019-03-22T23:32:53.000Z | 2020-08-17T18:27:59.000Z | #!/usr/bin/env python3
from parsuite.abstractions.xml.nmap import *
from xml.etree.ElementTree import ElementTree
from parsuite.abstractions.xml.generic import network_host as nh
from sys import exit
import re
def parse_http_links(tree,*args,**kwargs):
links = []
for ehost in tree.findall('.//host'):
... | 30.568905 | 80 | 0.485609 |
5ef2cff033e4a8e6c2f792a744d334595082cbd7 | 103 | py | Python | py_tdlib/constructors/remove_recently_found_chat.py | Mr-TelegramBot/python-tdlib | 2e2d21a742ebcd439971a32357f2d0abd0ce61eb | [
"MIT"
] | 24 | 2018-10-05T13:04:30.000Z | 2020-05-12T08:45:34.000Z | py_tdlib/constructors/remove_recently_found_chat.py | MrMahdi313/python-tdlib | 2e2d21a742ebcd439971a32357f2d0abd0ce61eb | [
"MIT"
] | 3 | 2019-06-26T07:20:20.000Z | 2021-05-24T13:06:56.000Z | py_tdlib/constructors/remove_recently_found_chat.py | MrMahdi313/python-tdlib | 2e2d21a742ebcd439971a32357f2d0abd0ce61eb | [
"MIT"
] | 5 | 2018-10-05T14:29:28.000Z | 2020-08-11T15:04:10.000Z | from ..factory import Method
class removeRecentlyFoundChat(Method):
chat_id = None # type: "int53"
| 17.166667 | 38 | 0.747573 |
2374275d23749becf389887e3730410b30d93c3a | 15,706 | py | Python | Chapter02/urllib_test.py | elephantscale/Hands-On-Web-Scraping-with-Python | 013069a23c5bc3846ab475c5774bc6ff9a27c348 | [
"MIT"
] | 43 | 2019-03-05T12:37:35.000Z | 2022-01-24T11:43:37.000Z | Chapter02/urllib_test.py | elephantscale/Hands-On-Web-Scraping-with-Python | 013069a23c5bc3846ab475c5774bc6ff9a27c348 | [
"MIT"
] | 1 | 2019-12-29T10:34:13.000Z | 2020-08-10T07:19:28.000Z | Chapter02/urllib_test.py | elephantscale/Hands-On-Web-Scraping-with-Python | 013069a23c5bc3846ab475c5774bc6ff9a27c348 | [
"MIT"
] | 42 | 2019-05-02T10:28:35.000Z | 2022-02-16T16:45:48.000Z | Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) [MSC v.1914 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.
>>> import urllib
>>> import requests
>>> dir(urllib)
['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '... | 67.698276 | 1,749 | 0.71807 |
840bde4c6107fe1c45d7de5d29ef8a006bbbb0f8 | 1,951 | py | Python | safe_relay_service/tokens/management/commands/add_token.py | vaporyorg/safe-relay-service | 1289c3d31639f83aa2c0110ff3b84a69212b81f5 | [
"MIT"
] | 2 | 2020-10-19T09:59:11.000Z | 2021-02-04T12:26:12.000Z | safe_relay_service/tokens/management/commands/add_token.py | vaporyorg/safe-relay-service | 1289c3d31639f83aa2c0110ff3b84a69212b81f5 | [
"MIT"
] | 24 | 2019-12-11T14:43:38.000Z | 2022-03-01T12:37:24.000Z | safe_relay_service/tokens/management/commands/add_token.py | vaporyorg/safe-relay-service | 1289c3d31639f83aa2c0110ff3b84a69212b81f5 | [
"MIT"
] | null | null | null | from django.core.management.base import BaseCommand
from gnosis.eth import EthereumClientProvider
from gnosis.eth.ethereum_client import InvalidERC20Info
from ...models import Token
class Command(BaseCommand):
help = 'Update list of tokens'
def add_arguments(self, parser):
# Positional arguments
... | 44.340909 | 114 | 0.589954 |
196bb055559bf45de94b3261732b25c289cba8bf | 2,648 | py | Python | src/thirdparty/v8/tools/utils.py | kripken/intensityengine | 9ae352b4f526ecb180004ae4968db7f64f140762 | [
"MIT"
] | 31 | 2015-01-18T20:27:31.000Z | 2021-07-03T03:58:47.000Z | deps/v8/tools/utils.py | cramforce/node | 3538d902aa9d86eff3285e605b949ab321600dfc | [
"MIT"
] | 4 | 2015-07-05T21:09:37.000Z | 2019-09-06T14:34:59.000Z | deps/v8/tools/utils.py | cramforce/node | 3538d902aa9d86eff3285e605b949ab321600dfc | [
"MIT"
] | 11 | 2015-02-03T19:24:10.000Z | 2019-09-20T10:59:50.000Z | # Copyright 2008 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditi... | 31.903614 | 73 | 0.703172 |
701c6c3a8f6a1246239a7f0be33c4b52380b9821 | 4,122 | py | Python | tfx/orchestration/portable/beam_executor_operator.py | avelez93/tfx | 75fbb6a7d50e99138609be3ca4c3a204a13a2195 | [
"Apache-2.0"
] | 1,813 | 2019-02-04T17:17:30.000Z | 2022-03-29T13:39:30.000Z | tfx/orchestration/portable/beam_executor_operator.py | avelez93/tfx | 75fbb6a7d50e99138609be3ca4c3a204a13a2195 | [
"Apache-2.0"
] | 2,710 | 2019-02-14T00:41:00.000Z | 2022-03-31T07:23:00.000Z | tfx/orchestration/portable/beam_executor_operator.py | avelez93/tfx | 75fbb6a7d50e99138609be3ca4c3a204a13a2195 | [
"Apache-2.0"
] | 731 | 2019-02-04T17:59:18.000Z | 2022-03-31T06:45:51.000Z | # Copyright 2021 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 41.636364 | 90 | 0.761038 |
eb22f059e78f76024c43b55935ef327e904d3f26 | 496 | py | Python | Dummies/speed.py | GabrielCFigueira/SIRS | 60696bbe8c4123ea72b3dd736a3c7a245fe1d895 | [
"MIT"
] | null | null | null | Dummies/speed.py | GabrielCFigueira/SIRS | 60696bbe8c4123ea72b3dd736a3c7a245fe1d895 | [
"MIT"
] | null | null | null | Dummies/speed.py | GabrielCFigueira/SIRS | 60696bbe8c4123ea72b3dd736a3c7a245fe1d895 | [
"MIT"
] | null | null | null | import random
import GenericDummy
class Speed(GenericDummy.GenericDummy):
def __init__(self):
super(Speed, self).__init__()
self.version = '00001010101000000000000000000000'
self.id = 'spdsnszeus'
self.name = 'speed'
self.port = 5003
def update_state(self):
i =... | 22.545455 | 57 | 0.631048 |
484b02153248c1f900e756d54ebbd1f113f98a17 | 92 | py | Python | forms_app/apps.py | cs-fullstack-master/django-review1 | d4becb525fba2344f5a4171befb7cd0465b5d44b | [
"Apache-2.0"
] | null | null | null | forms_app/apps.py | cs-fullstack-master/django-review1 | d4becb525fba2344f5a4171befb7cd0465b5d44b | [
"Apache-2.0"
] | 8 | 2020-02-12T00:30:10.000Z | 2021-06-10T18:16:37.000Z | forms_app/apps.py | cs-fullstack-master/django-review1 | d4becb525fba2344f5a4171befb7cd0465b5d44b | [
"Apache-2.0"
] | null | null | null | from django.apps import AppConfig
class FormsAppConfig(AppConfig):
name = 'forms_app'
| 15.333333 | 33 | 0.76087 |
a64f6c04bc835d51b9b7e46a87566ee6c9a6844a | 9,575 | py | Python | env/lib/python3.8/site-packages/plotly/graph_objs/choroplethmapbox/colorbar/_tickformatstop.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | env/lib/python3.8/site-packages/plotly/graph_objs/choroplethmapbox/colorbar/_tickformatstop.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | env/lib/python3.8/site-packages/plotly/graph_objs/choroplethmapbox/colorbar/_tickformatstop.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | from plotly.basedatatypes import BaseTraceHierarchyType as _BaseTraceHierarchyType
import copy as _copy
class Tickformatstop(_BaseTraceHierarchyType):
# class properties
# --------------------
_parent_path_str = "choroplethmapbox.colorbar"
_path_str = "choroplethmapbox.colorbar.tickformatstop"
_v... | 33.714789 | 85 | 0.57201 |
8eb3f9d5e18157b101613b30f06b5b8f8ff4b6e4 | 2,970 | py | Python | ane/2_compile/hwx_parse.py | ClaudRenoire/tinygrad | 73ae6d78211e79c8e84c1e8f5ca1cdadd444734c | [
"MIT"
] | null | null | null | ane/2_compile/hwx_parse.py | ClaudRenoire/tinygrad | 73ae6d78211e79c8e84c1e8f5ca1cdadd444734c | [
"MIT"
] | null | null | null | ane/2_compile/hwx_parse.py | ClaudRenoire/tinygrad | 73ae6d78211e79c8e84c1e8f5ca1cdadd444734c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sys
from hexdump import hexdump
from macholib import MachO
def get_macho(fn):
# mod to make the header okay
# MH_CIGAM_64 is good
dat = open(fn, "rb").read()
dat = b"\xcf\xfa\xed\xfe"+dat[4:]
from tempfile import NamedTemporaryFile
with NamedTemporaryFile(delete=False) as f:
... | 25.826087 | 134 | 0.569024 |
8fb7fc83aa28647e96c4707110e38ac14b7a2a6d | 7,840 | py | Python | model.py | Anwarvic/ConvS2S | 7938dbba03dcc0f8592191e49ffd49852270bd02 | [
"Apache-2.0"
] | 4 | 2021-09-07T10:53:53.000Z | 2021-12-06T07:01:07.000Z | model.py | Anwarvic/ConvS2S | 7938dbba03dcc0f8592191e49ffd49852270bd02 | [
"Apache-2.0"
] | null | null | null | model.py | Anwarvic/ConvS2S | 7938dbba03dcc0f8592191e49ffd49852270bd02 | [
"Apache-2.0"
] | null | null | null | """
Adapted from this blog post:
https://charon.me/posts/pytorch/pytorch_seq2seq_5
"""
import math
import torch
class Encoder(torch.nn.Module):
def __init__(self,
input_dim,
emb_dim,
hid_dim,
n_layers,
kernel_size,
... | 43.555556 | 124 | 0.589923 |
bb4af785e25ff54e33dcdb9bdd58e6043a61b621 | 468 | py | Python | Bot/cogs/Commands/thejaggycommand.py | NoNameNeededStudios/NoNameNeeded-bot | a5d71d8e21b8a4795a3f11a41b398fc6fe07d9c8 | [
"MIT"
] | 4 | 2021-01-10T16:36:11.000Z | 2021-02-10T13:46:20.000Z | Bot/cogs/Commands/thejaggycommand.py | NoNameNeededStudios/NoNameNeeded-bot | a5d71d8e21b8a4795a3f11a41b398fc6fe07d9c8 | [
"MIT"
] | 1 | 2021-01-29T14:50:16.000Z | 2021-01-29T14:54:31.000Z | Bot/cogs/Commands/thejaggycommand.py | NoNameNeededStudios/NoNameNeeded-bot | a5d71d8e21b8a4795a3f11a41b398fc6fe07d9c8 | [
"MIT"
] | null | null | null | from cogs.imports import *
class jagggy(commands.Cog):
def __init__(self, client):
self.client = client
@commands.command(aliases=["space", "s p a c e"])
async def jaggy(self,ctx,*,kaggy):
if "@" in kaggy:
await ctx.send("No Mentions or @s")
else:
... | 24.631579 | 54 | 0.544872 |
461328ee9f498e3b0d8f01843025c08d4c3ee31c | 31,229 | py | Python | src/robot/run.py | PaulVittorino/robotframework | 5c59523c7a2c2fcaf604ca49cba476271404ff3a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/robot/run.py | PaulVittorino/robotframework | 5c59523c7a2c2fcaf604ca49cba476271404ff3a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/robot/run.py | PaulVittorino/robotframework | 5c59523c7a2c2fcaf604ca49cba476271404ff3a | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2008-2015 Nokia Networks
# Copyright 2016- Robot Framework Foundation
#
# 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.or... | 56.78 | 80 | 0.59259 |
6858f5aa18ca774675193db67103bfb4395b0bc5 | 4,823 | py | Python | kubernetes/client/models/v1_self_subject_access_review_spec.py | craigtracey/python | 177564c655c0ea3f9cf38e61ca275ef6c6256aab | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1_self_subject_access_review_spec.py | craigtracey/python | 177564c655c0ea3f9cf38e61ca275ef6c6256aab | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1_self_subject_access_review_spec.py | craigtracey/python | 177564c655c0ea3f9cf38e61ca275ef6c6256aab | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.9.4
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
... | 31.116129 | 106 | 0.638607 |
e884081b98df68d67d4e8994fddce229448f5eed | 2,633 | py | Python | tfx/orchestration/config/config_utils.py | avelez93/tfx | 75fbb6a7d50e99138609be3ca4c3a204a13a2195 | [
"Apache-2.0"
] | 1,813 | 2019-02-04T17:17:30.000Z | 2022-03-29T13:39:30.000Z | tfx/orchestration/config/config_utils.py | avelez93/tfx | 75fbb6a7d50e99138609be3ca4c3a204a13a2195 | [
"Apache-2.0"
] | 2,710 | 2019-02-14T00:41:00.000Z | 2022-03-31T07:23:00.000Z | tfx/orchestration/config/config_utils.py | avelez93/tfx | 75fbb6a7d50e99138609be3ca4c3a204a13a2195 | [
"Apache-2.0"
] | 731 | 2019-02-04T17:59:18.000Z | 2022-03-31T06:45:51.000Z | # Copyright 2019 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 41.793651 | 76 | 0.767566 |
d8bfcc8409a842a50d6272ae2adc2fd645878efe | 8,910 | py | Python | EthanBrown.SublimeText2.UtilPackages/tools/PackageCache/SideBarEnhancements/sidebar/desktop/__init__.py | michaelray/Iristyle-ChocolateyPackages | 5051538253ff095af4b64d469137b23420f28be0 | [
"MIT"
] | 18 | 2015-01-14T13:36:47.000Z | 2020-10-22T19:53:57.000Z | desktop/__init__.py | jcemer/SublimeHighlight | 7c30a65258136f0b77ee0529ab93647f429a98ed | [
"MIT"
] | 12 | 2015-04-13T13:56:14.000Z | 2017-02-04T08:35:35.000Z | desktop/__init__.py | jcemer/SublimeHighlight | 7c30a65258136f0b77ee0529ab93647f429a98ed | [
"MIT"
] | 30 | 2015-01-20T12:32:53.000Z | 2019-01-26T12:39:02.000Z | #!/usr/bin/env python
"""
Simple desktop integration for Python. This module provides desktop environment
detection and resource opening support for a selection of common and
standardised desktop environments.
Copyright (C) 2005, 2006, 2007, 2008, 2009 Paul Boddie <paul@boddie.org.uk>
This program is free software; ... | 31.595745 | 124 | 0.66936 |
435b57f3faaa9caceee7ad3568a27515a1048e75 | 1,948 | py | Python | data_loader.py | young-du/traffic-analysis | f5a2b6102b6cc1b476606f8adf42fd749886a9f9 | [
"MIT"
] | null | null | null | data_loader.py | young-du/traffic-analysis | f5a2b6102b6cc1b476606f8adf42fd749886a9f9 | [
"MIT"
] | null | null | null | data_loader.py | young-du/traffic-analysis | f5a2b6102b6cc1b476606f8adf42fd749886a9f9 | [
"MIT"
] | null | null | null | ''' use "pcap_data_loader" or "pcapng_data_loader" to load data
each row of data looks like:
[
source, destination,
(sending) numPackets per unit time, time range, timestamp_std, packet_length_mean, packet_length_std, time_to_live_mean, time_to_live_std,
(receiving) numPackets per unit ... | 29.515152 | 147 | 0.633984 |
4e09c573792cc26bc458431a4838a5a82f386180 | 3,773 | py | Python | marusa_scripts/marusa_grid_velocity.py | tcrundall/chronostar | bdb5cd965e862ba5cc21bee75d5c8620e106c0cc | [
"MIT"
] | null | null | null | marusa_scripts/marusa_grid_velocity.py | tcrundall/chronostar | bdb5cd965e862ba5cc21bee75d5c8620e106c0cc | [
"MIT"
] | null | null | null | marusa_scripts/marusa_grid_velocity.py | tcrundall/chronostar | bdb5cd965e862ba5cc21bee75d5c8620e106c0cc | [
"MIT"
] | null | null | null | #! /usr/bin/env python
try:
import matplotlib as mpl
mpl.use('Agg')
except ImportError:
pass
from distutils.dir_util import mkpath
from distutils.errors import DistutilsFileError
import logging
import numpy as np
import sys
from emcee.utils import MPIPool
sys.path.insert(0, '..')
import chronostar.retired... | 28.801527 | 77 | 0.591572 |
3fe91e57e46754a877417871c8b968c653e9b158 | 14,477 | py | Python | sphinx/pycode/pgen2/pgen.py | rweickelt/sphinx | 1a4c41a7691e8f78d42e2db221192962c53b27df | [
"BSD-2-Clause"
] | null | null | null | sphinx/pycode/pgen2/pgen.py | rweickelt/sphinx | 1a4c41a7691e8f78d42e2db221192962c53b27df | [
"BSD-2-Clause"
] | null | null | null | sphinx/pycode/pgen2/pgen.py | rweickelt/sphinx | 1a4c41a7691e8f78d42e2db221192962c53b27df | [
"BSD-2-Clause"
] | null | null | null | # Copyright 2004-2005 Elemental Security, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
from __future__ import print_function
from six import iteritems
from collections import OrderedDict
# Pgen imports
from sphinx.pycode.pgen2 import grammar, token, tokenize
if False:
# For type an... | 35.834158 | 78 | 0.504732 |
3ae5449d2f5367a8fb543a23bada58169b1c199b | 2,279 | py | Python | src/pcogram/api.py | hiway/python-one100 | 139f8170a6f9276a2ee98476a41c48364afff5ae | [
"MIT"
] | 1 | 2017-12-02T07:28:07.000Z | 2017-12-02T07:28:07.000Z | src/pcogram/api.py | hiway/python-one100 | 139f8170a6f9276a2ee98476a41c48364afff5ae | [
"MIT"
] | 12 | 2017-11-18T11:24:09.000Z | 2017-11-26T21:11:02.000Z | src/pcogram/api.py | hiway/pcogram | 139f8170a6f9276a2ee98476a41c48364afff5ae | [
"MIT"
] | null | null | null | import requests
from . import DEFAULT_API_ENDPOINT
class PcogramAPI(object):
def __init__(self, username='', token='', endpoint=DEFAULT_API_ENDPOINT):
self.endpoint = endpoint
self.username = username
self.token = token
def get_url(self, path):
return self.endpoint + path
... | 32.557143 | 77 | 0.563405 |
3caa1526e6e044848d6c4c9a0a914df75c61f4a9 | 1,151 | py | Python | utils/average_cv_results.py | yiskw713/asrf | 9623f1e8d9a1171333a4eeb65d190997b6c44a95 | [
"MIT"
] | 29 | 2020-07-15T21:27:20.000Z | 2022-03-31T02:11:55.000Z | utils/average_cv_results.py | yiskw713/asrf | 9623f1e8d9a1171333a4eeb65d190997b6c44a95 | [
"MIT"
] | 7 | 2020-10-06T19:23:59.000Z | 2022-03-12T00:51:59.000Z | utils/average_cv_results.py | yiskw713/asrf | 9623f1e8d9a1171333a4eeb65d190997b6c44a95 | [
"MIT"
] | 9 | 2021-01-21T14:47:33.000Z | 2022-02-12T01:18:29.000Z | import argparse
import glob
import os
import numpy as np
import pandas as pd
def get_arguments() -> argparse.Namespace:
"""
parse all the arguments from command line inteface
return a list of parsed arguments
"""
parser = argparse.ArgumentParser(description="average cross validation results.")
... | 24.489362 | 88 | 0.65682 |
6f291f289cdf2e0727a46f6634211520904b0afa | 466 | py | Python | timestamped_filename.py | wizardofozzie/Ten-lines-or-less | 56ff2d173e2f5d97c62ed9906aefd0f5afd941a4 | [
"Apache-2.0"
] | 3 | 2017-06-17T23:48:58.000Z | 2021-05-07T06:06:29.000Z | timestamped_filename.py | dedsec-9/Ten-lines-or-less | 56ff2d173e2f5d97c62ed9906aefd0f5afd941a4 | [
"Apache-2.0"
] | null | null | null | timestamped_filename.py | dedsec-9/Ten-lines-or-less | 56ff2d173e2f5d97c62ed9906aefd0f5afd941a4 | [
"Apache-2.0"
] | 1 | 2021-05-16T11:31:56.000Z | 2021-05-16T11:31:56.000Z | #!/usr/bin/env python
# 'sample.txt' --> 'sample_2016_01_23_18_07_23.txt'
# YYYY_MM_DD_hh_mm_ss order sorts oldest to newest.
import datetime, os
def timestamped_filename(file_name):
root, ext = os.path.splitext(file_name)
return '{}{:_%Y_%m_%d_%H_%M_%S}{}'.format(root, datetime.datetime.now(), ext)
if __na... | 27.411765 | 81 | 0.708155 |
a16bbe5edb9f230553af9ad9c42d99fa36d82285 | 2,607 | py | Python | mods/LA/raanes2015.py | franktoffel/dapper | 373a27273ea109f349e5edcdcef0cfe0b83b925e | [
"MIT"
] | 3 | 2021-07-31T10:13:11.000Z | 2022-01-14T16:52:04.000Z | mods/LA/raanes2015.py | franktoffel/dapper | 373a27273ea109f349e5edcdcef0cfe0b83b925e | [
"MIT"
] | null | null | null | mods/LA/raanes2015.py | franktoffel/dapper | 373a27273ea109f349e5edcdcef0cfe0b83b925e | [
"MIT"
] | null | null | null | # Reproduce results from fig2 of
# Raanes, Patrick Nima, Alberto Carrassi, and Laurent Bertino (2015):
# "Extending the square root method to account for additive forecast noise in ensemble methods."
from common import *
from mods.LA.core import sinusoidal_sample, Fmat
from mods.Lorenz95.core import LPs
# Burn-in al... | 27.734043 | 96 | 0.63598 |
ff1a2131bc5f055ff3572985b27a65b0cb90527e | 831 | py | Python | hc/api/tests/test_ensuretriggers.py | mosesokemwa/healthcheck | 8af35e135818cfd8431b63565f482106c82cf163 | [
"BSD-3-Clause"
] | null | null | null | hc/api/tests/test_ensuretriggers.py | mosesokemwa/healthcheck | 8af35e135818cfd8431b63565f482106c82cf163 | [
"BSD-3-Clause"
] | 34 | 2019-09-05T06:41:12.000Z | 2021-06-25T15:25:28.000Z | hc/api/tests/test_ensuretriggers.py | mosesokemwa/healthcheck | 8af35e135818cfd8431b63565f482106c82cf163 | [
"BSD-3-Clause"
] | null | null | null | from datetime import timedelta
from django.test import TestCase
from django.utils import timezone
from hc.api.management.commands.ensuretriggers import Command
from hc.api.models import Check
class EnsureTriggersTestCase(TestCase):
def test_ensure_triggers(self):
Command().handle()
check = Che... | 27.7 | 74 | 0.690734 |
bbc5cda6441fc696beea666edd8ad6818ef7ea95 | 101,206 | py | Python | virtual/lib/python3.8/site-packages/pip/_vendor/chardet/langhungarianmodel.py | Jamesmwangi245/flask-3 | fb5bdb44cc55a45a27a206d08cb811bedfc6b21e | [
"MIT"
] | 38,667 | 2015-01-01T00:15:34.000Z | 2022-03-31T22:57:03.000Z | virtual/lib/python3.8/site-packages/pip/_vendor/chardet/langhungarianmodel.py | Jamesmwangi245/flask-3 | fb5bdb44cc55a45a27a206d08cb811bedfc6b21e | [
"MIT"
] | 8,417 | 2015-01-01T13:03:16.000Z | 2022-03-31T17:40:27.000Z | virtual/lib/python3.8/site-packages/pip/_vendor/chardet/langhungarianmodel.py | Jamesmwangi245/flask-3 | fb5bdb44cc55a45a27a206d08cb811bedfc6b21e | [
"MIT"
] | 11,269 | 2015-01-01T08:41:17.000Z | 2022-03-31T16:12:52.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from pip._vendor.chardet.sbcharsetprober import SingleByteCharSetModel
# 3: Positive
# 2: Likely
# 1: Unlikely
# 0: Negative
HUNGARIAN_LANG_MODEL = {
28: { # 'A'
28: 0, # 'A'
40: 1, # 'B'
54: 1, # 'C'
45: 2, # 'D'
32: 1, ... | 21.760052 | 128 | 0.194811 |
0fe758fb66974ed3afacc09c65795daf3a0b2b80 | 2,793 | py | Python | src/sample.py | ZVengin/Image-Captioning- | b078a3d9f483dcb8ebb3cf4a01452a43a416813d | [
"MIT"
] | null | null | null | src/sample.py | ZVengin/Image-Captioning- | b078a3d9f483dcb8ebb3cf4a01452a43a416813d | [
"MIT"
] | null | null | null | src/sample.py | ZVengin/Image-Captioning- | b078a3d9f483dcb8ebb3cf4a01452a43a416813d | [
"MIT"
] | null | null | null | import torch
import os
import numpy as np
import matplotlib.pyplot as plt
from torchvision import transforms
from vocabulary import Vocabulary
from model import EncoderCNN,DecoderRNN
from PIL import Image
device=torch.device('cuda' if torch.cuda.is_available() else 'cpu')
def load_image(imgae_path, tran... | 31.738636 | 99 | 0.616541 |
d39ef1a96e8f186484524c2b83dc5ae00c9a9e7d | 404 | py | Python | news/migrations/0022_auto_20190707_1653.py | Nigar-mr/News | b75b78cc9fa64259f4239b1d456daa5224040ce4 | [
"MIT"
] | null | null | null | news/migrations/0022_auto_20190707_1653.py | Nigar-mr/News | b75b78cc9fa64259f4239b1d456daa5224040ce4 | [
"MIT"
] | null | null | null | news/migrations/0022_auto_20190707_1653.py | Nigar-mr/News | b75b78cc9fa64259f4239b1d456daa5224040ce4 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.2 on 2019-07-07 12:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('news', '0021_auto_20190707_1633'),
]
operations = [
migrations.AlterField(
model_name='news',
name='title',
... | 21.263158 | 74 | 0.601485 |
8dc2a38f809fa81c1e5406c30d9fb7125c2bc1e3 | 2,737 | py | Python | setup.py | yyang768osu/polarcode | ecea40b0b4ee4945cf78be3db07ae1e1b53a8719 | [
"MIT"
] | 2 | 2020-10-18T08:01:05.000Z | 2022-01-05T12:46:52.000Z | setup.py | yyang768osu/polarcode | ecea40b0b4ee4945cf78be3db07ae1e1b53a8719 | [
"MIT"
] | null | null | null | setup.py | yyang768osu/polarcode | ecea40b0b4ee4945cf78be3db07ae1e1b53a8719 | [
"MIT"
] | null | null | null | import os
import re
import sys
import platform
import subprocess
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext
from distutils.version import LooseVersion
class CMakeExtension(Extension):
def __init__(self, name, sourcedir=''):
Extension.__init__(self, name, so... | 36.986486 | 98 | 0.605773 |
c1bd4a4392b158acd21e1926357f83965aed793a | 3,571 | py | Python | misc/cx_setup.py | award7/dicomsort | b83a8d9468a6599cfc36f497dcdb38ea62c2c783 | [
"MIT"
] | 15 | 2015-02-26T17:27:48.000Z | 2019-10-22T12:28:24.000Z | misc/cx_setup.py | award7/dicomsort | b83a8d9468a6599cfc36f497dcdb38ea62c2c783 | [
"MIT"
] | 61 | 2020-02-07T21:56:23.000Z | 2022-03-31T22:12:08.000Z | misc/cx_setup.py | suever/dicomsort | d2a09887ebe7e3f2bcdc07eb1375d995ba365205 | [
"MIT"
] | 7 | 2015-09-07T04:47:29.000Z | 2019-03-18T09:29:48.000Z | import os
import sys
from setuptools import find_packages
from cx_Freeze import setup, Executable
current = os.path.realpath(os.path.dirname(__file__))
parent = os.path.realpath(os.path.join(current, '..'))
sys.path.insert(0, parent)
from dicomsort import Metadata as meta # noqa: E402
BASE_PATH = os.path.abspath(... | 26.065693 | 79 | 0.539065 |
1b29e402a119c27430deac7637186d31faded4d9 | 10,610 | py | Python | examples/common/python/connectors/direct/tcs_listener/tcs_listener.py | iExecBlockchainComputing/trusted-compute-framework | 0ea5122e66a89314fd5f2aca72d3046df93cb7a9 | [
"Apache-2.0"
] | 1 | 2021-07-07T06:12:27.000Z | 2021-07-07T06:12:27.000Z | examples/common/python/connectors/direct/tcs_listener/tcs_listener.py | iExecBlockchainComputing/trusted-compute-framework | 0ea5122e66a89314fd5f2aca72d3046df93cb7a9 | [
"Apache-2.0"
] | null | null | null | examples/common/python/connectors/direct/tcs_listener/tcs_listener.py | iExecBlockchainComputing/trusted-compute-framework | 0ea5122e66a89314fd5f2aca72d3046df93cb7a9 | [
"Apache-2.0"
] | 2 | 2019-09-14T06:00:29.000Z | 2020-04-02T10:21:42.000Z | # Copyright 2019 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 37.359155 | 145 | 0.624882 |
3e6f99ebfcf2a6ae0eb4fe24a35e7d259d111874 | 4,123 | py | Python | tests/conftest.py | harokki/fastapi-authenticated | baca823d3489739843b4df68f57fa785da7bf50d | [
"MIT"
] | null | null | null | tests/conftest.py | harokki/fastapi-authenticated | baca823d3489739843b4df68f57fa785da7bf50d | [
"MIT"
] | null | null | null | tests/conftest.py | harokki/fastapi-authenticated | baca823d3489739843b4df68f57fa785da7bf50d | [
"MIT"
] | null | null | null | from contextlib import AbstractContextManager
from typing import Callable, Dict, Generator, Tuple
import pytest
from dependency_injector import containers, providers
from fastapi.testclient import TestClient
from sqlalchemy.orm import Session
from app.database import Database
from app.domains.entities.role import Rol... | 29.876812 | 87 | 0.726898 |
bc6fab264f4e7d629bc3f47a285addfa296919c1 | 674 | py | Python | tsp/nearest_neighbour.py | shaardie/tsp | 5b2ace29387882101f4e817196b32e98dc564b7e | [
"MIT"
] | null | null | null | tsp/nearest_neighbour.py | shaardie/tsp | 5b2ace29387882101f4e817196b32e98dc564b7e | [
"MIT"
] | null | null | null | tsp/nearest_neighbour.py | shaardie/tsp | 5b2ace29387882101f4e817196b32e98dc564b7e | [
"MIT"
] | null | null | null | import numpy
def nearest_neighbour(matrix, start=0):
"""Solve the TSP with the nearest neighbour algorithm.
The algorithm will work on the incoming matrix.
For details take a look at
https://en.wikipedia.org/wiki/Nearest_neighbour_algorithm
:param matrix: Matrix describing the TSP.
:type mat... | 28.083333 | 61 | 0.672107 |
f32e2837c3a056e95de91501e8a360e87c501a58 | 47,600 | py | Python | cogs/cmds/econ.py | Dhruvin-Purohit/Villager-Bot | aa2402e69c53d81489f80eb4e5cf327d57ac6a15 | [
"MIT"
] | 1 | 2021-05-14T11:54:14.000Z | 2021-05-14T11:54:14.000Z | cogs/cmds/econ.py | Dhruvin-Purohit/Villager-Bot | aa2402e69c53d81489f80eb4e5cf327d57ac6a15 | [
"MIT"
] | null | null | null | cogs/cmds/econ.py | Dhruvin-Purohit/Villager-Bot | aa2402e69c53d81489f80eb4e5cf327d57ac6a15 | [
"MIT"
] | null | null | null | from discord.ext import commands, tasks
from util.misc import make_health_bar
import discord
import asyncio
import aiohttp
import random
import arrow
import math
class Econ(commands.Cog):
def __init__(self, bot):
self.bot = bot
self.d = bot.d
self.db = bot.get_cog('Database')
if... | 41.176471 | 156 | 0.590504 |
0c1a7cd483ebe469119e4fb982a69bf1bbb74770 | 1,553 | py | Python | networks/util/torch_ops.py | solomon-ma/PaMIR | 010ba7686b52e62b46c123ca89717a921bbaa9d5 | [
"Unlicense"
] | 82 | 2021-04-22T07:08:42.000Z | 2022-03-10T09:40:30.000Z | networks/util/torch_ops.py | solomon-ma/PaMIR | 010ba7686b52e62b46c123ca89717a921bbaa9d5 | [
"Unlicense"
] | 15 | 2021-05-17T09:50:30.000Z | 2022-03-30T03:17:14.000Z | networks/util/torch_ops.py | solomon-ma/PaMIR | 010ba7686b52e62b46c123ca89717a921bbaa9d5 | [
"Unlicense"
] | 9 | 2021-05-10T11:41:57.000Z | 2022-01-12T05:18:25.000Z | import torch
def rgb2hsv(rgb):
shape = rgb.size()
assert shape[-1] == 3
if len(shape) == 2:
r, g, b = rgb[:, 0], rgb[:, 1], rgb[:, 2]
mx = torch.max(rgb, dim=1)[0]
mn = torch.min(rgb, dim=1)[0]
df = mx - mn + 1e-6
hr = (60 * ((g - b) / df) + 360) % 360
hg = ... | 31.06 | 71 | 0.451384 |
0911ba5d829f3a31c6a8bc990499855ebad01125 | 1,422 | py | Python | afb/core/primitives/dict_lib/direct.py | dave-msk/afb | d5e9147f81dabc7a433be75fd3114e6b4f79aa66 | [
"Apache-2.0"
] | 1 | 2021-08-28T04:46:30.000Z | 2021-08-28T04:46:30.000Z | afb/core/primitives/dict_lib/direct.py | dave-msk/afb | d5e9147f81dabc7a433be75fd3114e6b4f79aa66 | [
"Apache-2.0"
] | 1 | 2019-03-08T08:28:41.000Z | 2019-03-08T13:00:55.000Z | afb/core/primitives/dict_lib/direct.py | dave-msk/afb | d5e9147f81dabc7a433be75fd3114e6b4f79aa66 | [
"Apache-2.0"
] | 1 | 2019-02-27T09:12:49.000Z | 2019-02-27T09:12:49.000Z | # Copyright 2021 (David) Siu-Kei Muk. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 29.020408 | 80 | 0.677918 |
19a882ccad16c55b5d93f552f02cb13a413785c6 | 629 | py | Python | py_trees/version.py | a17hq/py_trees | 6cbe11d76083c592340c7c0f50050cebcf0d0f0b | [
"BSD-3-Clause"
] | 201 | 2019-02-27T08:42:11.000Z | 2022-03-19T10:09:04.000Z | py_trees/version.py | a17hq/py_trees | 6cbe11d76083c592340c7c0f50050cebcf0d0f0b | [
"BSD-3-Clause"
] | 119 | 2019-02-25T10:21:29.000Z | 2022-03-08T18:04:05.000Z | py_trees/version.py | a17hq/py_trees | 6cbe11d76083c592340c7c0f50050cebcf0d0f0b | [
"BSD-3-Clause"
] | 59 | 2019-03-20T08:31:11.000Z | 2022-03-03T08:22:23.000Z | #
# License: BSD
# https://raw.githubusercontent.com/splintered-reality/py_trees/devel/LICENSE
#
##############################################################################
# Documentation
##############################################################################
"""
Version number provided separately here so... | 31.45 | 79 | 0.370429 |
ceb75b93a461740a972e37487749b49c9649c83c | 351 | py | Python | Python3/scripts-python3/desafios/mundo01/desafio022.py | Joey-Resende/Estudando-Python | d38212dd6753b35d4f8d2aae79ec41f92cf16d58 | [
"MIT"
] | null | null | null | Python3/scripts-python3/desafios/mundo01/desafio022.py | Joey-Resende/Estudando-Python | d38212dd6753b35d4f8d2aae79ec41f92cf16d58 | [
"MIT"
] | null | null | null | Python3/scripts-python3/desafios/mundo01/desafio022.py | Joey-Resende/Estudando-Python | d38212dd6753b35d4f8d2aae79ec41f92cf16d58 | [
"MIT"
] | null | null | null | nome = str(input('Digite seu nome completo: ')).strip()
print('Analisando seu nome...')
print(f'Seu nome em maiúsculas é {nome.upper()}')
print(f'Seu nome em minúsculas é {nome.lower()}')
print(f'Seu nome tem ao todo {len(nome) - nome.split()} letras')
separa = nome.split()
print(f'Seu primeiro nome é {separa[0]} e ele... | 43.875 | 75 | 0.68661 |
6a4a8cce593835520faa469e9655dcc79cf60772 | 6,508 | py | Python | test/api/test_misc.py | xu-hao/ddcr-api | f69c80a84d413078bd36985b6579d2bc32329b8f | [
"MIT"
] | 2 | 2018-10-03T16:58:57.000Z | 2021-10-04T22:10:48.000Z | test/api/test_misc.py | xu-hao/ddcr-api | f69c80a84d413078bd36985b6579d2bc32329b8f | [
"MIT"
] | 195 | 2019-06-26T17:56:33.000Z | 2022-03-30T20:46:05.000Z | test/api/test_misc.py | xu-hao/ddcr-api | f69c80a84d413078bd36985b6579d2bc32329b8f | [
"MIT"
] | 5 | 2018-09-10T19:45:29.000Z | 2020-10-26T17:59:05.000Z | """Test miscellaneous endpoints."""
import json
from fastapi.testclient import TestClient
import pytest
from icees_api.app import APP
from ..util import load_data, do_verify_feature_count_response, escape_quotes
testclient = TestClient(APP)
table = "patient"
year = 2010
names = [
"AgeStudyStart",
"Albuterol... | 25.224806 | 99 | 0.576675 |
808aef40927b09f3c8c62d237b8f65746241988b | 381 | py | Python | Django WebApp/KU/wsgi.py | kakamband/Espial | 98726b07d8236bffd8fa013c811c28a2d924c7c6 | [
"MIT"
] | 1 | 2021-02-21T16:50:35.000Z | 2021-02-21T16:50:35.000Z | Django WebApp/KU/wsgi.py | kakamband/Espial | 98726b07d8236bffd8fa013c811c28a2d924c7c6 | [
"MIT"
] | null | null | null | Django WebApp/KU/wsgi.py | kakamband/Espial | 98726b07d8236bffd8fa013c811c28a2d924c7c6 | [
"MIT"
] | null | null | null | """
WSGI config for KU 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/3.1/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_M... | 22.411765 | 78 | 0.779528 |
0f6efee134e1226b422cdb843ab49d165dc6bdce | 66,354 | py | Python | pycqed/analysis_v2/base_analysis.py | peendebak/PycQED_py3 | c85d511cf49f6f7e08365a7d9abe6019d05cb2ed | [
"MIT"
] | null | null | null | pycqed/analysis_v2/base_analysis.py | peendebak/PycQED_py3 | c85d511cf49f6f7e08365a7d9abe6019d05cb2ed | [
"MIT"
] | null | null | null | pycqed/analysis_v2/base_analysis.py | peendebak/PycQED_py3 | c85d511cf49f6f7e08365a7d9abe6019d05cb2ed | [
"MIT"
] | null | null | null | """
File containing the BaseDataAnalyis class.
"""
import warnings
from inspect import signature
import os
import numpy as np
import copy
import logging
from collections import OrderedDict
import numbers
from matplotlib import pyplot as plt
from pycqed.analysis import analysis_toolbox as a_tools
from pycqed.utilities.g... | 40.583486 | 116 | 0.547081 |
5cf437f6add7d822d069d4b4569b587bad290c02 | 439 | py | Python | forumsweats/commands/infinite_counter.py | duckiecousingaming/forum-sweats | 6addf3159e59902a6905c25240bf54f8a7a00e76 | [
"MIT"
] | null | null | null | forumsweats/commands/infinite_counter.py | duckiecousingaming/forum-sweats | 6addf3159e59902a6905c25240bf54f8a7a00e76 | [
"MIT"
] | null | null | null | forumsweats/commands/infinite_counter.py | duckiecousingaming/forum-sweats | 6addf3159e59902a6905c25240bf54f8a7a00e76 | [
"MIT"
] | null | null | null | from forumsweats import db
name = 'infinite-counting'
aliases = (
'inf-count', 'inf-counting', 'inf-counter', 'infinite-count', 'infinite-counter'
'infinitecounting', 'infcount', 'infcounting', 'infcounter', 'infinitecount', 'infinitecounter')
async def run(message):
'Tells you the current value of the number in ... | 33.769231 | 97 | 0.751708 |
e2aba3276923e7031470acbf039f84ded772917b | 1,843 | py | Python | quiz_master/quiz_app/tests/views/test_AddQuizView.py | DiyanKalaydzhiev23/quiz_master | d8624a59d5bfc52c13ede72b024d1178c17c1780 | [
"MIT"
] | null | null | null | quiz_master/quiz_app/tests/views/test_AddQuizView.py | DiyanKalaydzhiev23/quiz_master | d8624a59d5bfc52c13ede72b024d1178c17c1780 | [
"MIT"
] | null | null | null | quiz_master/quiz_app/tests/views/test_AddQuizView.py | DiyanKalaydzhiev23/quiz_master | d8624a59d5bfc52c13ede72b024d1178c17c1780 | [
"MIT"
] | null | null | null | from django.urls import reverse
from quiz_master.quiz_app.models import Quiz
from quiz_master.common.utils import SetUpMixin
class AddQuizTests(SetUpMixin):
def test_get__expect_correct_template(self):
self.client.force_login(self.user_one)
response = self.client.get(reverse('add quiz'))
s... | 36.137255 | 65 | 0.628866 |
320093cb0ba744d7ae4afa6b394f71ae26cd23fc | 1,209 | py | Python | backend/app/alembic/versions/29c86643dd99_.py | lianjy357/vue-element-admin-fastapi | 70f697af33ca747a154d0de129f4cbd7f9d03f7b | [
"MIT"
] | 10 | 2020-12-16T07:31:29.000Z | 2022-01-27T08:01:22.000Z | backend/app/alembic/versions/29c86643dd99_.py | lianjy357/vue-element-admin-fastapi | 70f697af33ca747a154d0de129f4cbd7f9d03f7b | [
"MIT"
] | null | null | null | backend/app/alembic/versions/29c86643dd99_.py | lianjy357/vue-element-admin-fastapi | 70f697af33ca747a154d0de129f4cbd7f9d03f7b | [
"MIT"
] | 3 | 2021-03-18T11:38:21.000Z | 2021-09-02T06:23:15.000Z | """
Revision ID: 29c86643dd99
Revises: 7d8b02600f1c
Create Date: 2020-07-13 10:36:17.629851
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '29c86643dd99'
down_revision = '7d8b02600f1c'
branch_labels = None
depends_on = None
def upgrade():
# ### commands ... | 32.675676 | 89 | 0.695616 |
08abd7afecebedd194b3419ccbf50794a7664e4b | 1,631 | py | Python | templates/pbwu86r.py | djee-ms/webrtc-scripts | 3f2eb87b1baa3f49c6341d144e0b3c3be11c78ae | [
"BSD-2-Clause"
] | 2 | 2018-11-04T21:47:26.000Z | 2019-07-23T16:48:52.000Z | templates/pbwu86r.py | djee-ms/webrtc-scripts | 3f2eb87b1baa3f49c6341d144e0b3c3be11c78ae | [
"BSD-2-Clause"
] | 5 | 2018-11-30T18:38:15.000Z | 2019-04-23T22:00:37.000Z | templates/pbwu86r.py | djee-ms/webrtc-scripts | 3f2eb87b1baa3f49c6341d144e0b3c3be11c78ae | [
"BSD-2-Clause"
] | 6 | 2018-11-09T22:29:28.000Z | 2020-12-03T13:17:28.000Z | #List of targets for which will be performed specified actions. Supported target is webrtc. In future it will be added support for ortc.
targets = [ 'webrtc' ]
#List of target cpus. Supported cpus are arm, x86 and x64
targetCPUs = [ 'x86' ]
#List of target platforms. Supported cpus are win and winuwp
targetPlatforms = ... | 58.25 | 136 | 0.767627 |
aa7e777e37954e0a79a02be65c247a8d373d8cdb | 18,182 | py | Python | connections/Rest_Connection.py | sumedhpb/TAF | fc6f4cb8dc0b8234393f2e52a7b4a1aa723d9449 | [
"Apache-2.0"
] | null | null | null | connections/Rest_Connection.py | sumedhpb/TAF | fc6f4cb8dc0b8234393f2e52a7b4a1aa723d9449 | [
"Apache-2.0"
] | null | null | null | connections/Rest_Connection.py | sumedhpb/TAF | fc6f4cb8dc0b8234393f2e52a7b4a1aa723d9449 | [
"Apache-2.0"
] | null | null | null | """
Created on Sep 25, 2017
@author: riteshagarwal
"""
import base64
import json
import traceback
import socket
import time
from Cb_constants import constants, CbServer
from TestInput import TestInputSingleton
from common_lib import sleep
from global_vars import logger
from membase.api import httplib2
import requests... | 46.382653 | 119 | 0.54301 |
409ffe5783e356a6c535d243ab5c02884bc20e66 | 953 | py | Python | nodes/Object/SetObjectRotation.py | atticus-lv/RenderNode | 8a4797a2186b76fedebc5d634cff298e69089474 | [
"Apache-2.0"
] | 17 | 2021-11-21T09:26:55.000Z | 2022-03-09T06:56:01.000Z | nodes/Object/SetObjectRotation.py | atticus-lv/RenderNode | 8a4797a2186b76fedebc5d634cff298e69089474 | [
"Apache-2.0"
] | 1 | 2021-12-05T13:02:48.000Z | 2021-12-06T08:02:34.000Z | nodes/Object/SetObjectRotation.py | atticus-lv/RenderNode | 8a4797a2186b76fedebc5d634cff298e69089474 | [
"Apache-2.0"
] | 4 | 2021-11-23T14:49:34.000Z | 2021-12-30T15:04:58.000Z | import bpy
from bpy.props import *
from ...nodes.BASE.node_base import RenderNodeBase
class RenderNodeSetObjectRotation(RenderNodeBase):
bl_idname = 'RenderNodeSetObjectRotation'
bl_label = 'Set Object Rotation'
def init(self, context):
self.create_input('RenderNodeSocketTask', 'task', 'Task')
... | 29.78125 | 88 | 0.701994 |
528f6560f4b060e4698c1d44b5bc54227bb3278e | 1,467 | py | Python | Lowest Common Ancestor of a Binary Search Tree.py | sugia/leetcode | 6facec2a54d1d9f133f420c9bce1d1043f57ebc6 | [
"Apache-2.0"
] | null | null | null | Lowest Common Ancestor of a Binary Search Tree.py | sugia/leetcode | 6facec2a54d1d9f133f420c9bce1d1043f57ebc6 | [
"Apache-2.0"
] | null | null | null | Lowest Common Ancestor of a Binary Search Tree.py | sugia/leetcode | 6facec2a54d1d9f133f420c9bce1d1043f57ebc6 | [
"Apache-2.0"
] | null | null | null | '''
Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.
According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two nodes v and w as the lowest node in T that has both v and w as descendants (where we allow a node to be a descen... | 29.34 | 229 | 0.584185 |
74ed7d45f42826630b569ca61fee9b4ddfc98876 | 560 | py | Python | examples/send_data_zip.py | gjpower/python-sdk | e2f1bd7078afe0ed13364037992477a13ca8e4dc | [
"MIT"
] | 18 | 2018-09-25T11:47:28.000Z | 2021-12-14T20:28:39.000Z | examples/send_data_zip.py | gjpower/python-sdk | e2f1bd7078afe0ed13364037992477a13ca8e4dc | [
"MIT"
] | 57 | 2018-11-08T12:40:30.000Z | 2022-03-31T13:01:19.000Z | examples/send_data_zip.py | gjpower/python-sdk | e2f1bd7078afe0ed13364037992477a13ca8e4dc | [
"MIT"
] | 34 | 2018-11-05T16:09:15.000Z | 2022-03-08T10:51:34.000Z | import os
from devo.sender import Sender, SenderConfigSSL
server = "us.elb.relay.logtrust.net"
port = 443
key = os.getenv('DEVO_SENDER_KEY')
cert = os.getenv('DEVO_SENDER_CERT')
chain = os.getenv('DEVO_SENDER_CHAIN')
engine_config = SenderConfigSSL(address=(server, port),
key=key, cert... | 25.454545 | 67 | 0.658929 |
4aa93d8adadc3259922145072086aae697310ce6 | 5,966 | py | Python | AdvLaneline_moduletest.py | ebots-hung/CarND-Advanced-Lane-Lines | 277e120ebfea0849dce4232eaa01507c0e5ad2b3 | [
"MIT"
] | null | null | null | AdvLaneline_moduletest.py | ebots-hung/CarND-Advanced-Lane-Lines | 277e120ebfea0849dce4232eaa01507c0e5ad2b3 | [
"MIT"
] | null | null | null | AdvLaneline_moduletest.py | ebots-hung/CarND-Advanced-Lane-Lines | 277e120ebfea0849dce4232eaa01507c0e5ad2b3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @Author: QH Lam
# @Date: 2021-06-09
# @Module name: test_CameraCalibration.py
# @Module description: test Camera Calibration module
import os
import cv2
import glob
import numpy as np
from AdvLaneline_utils import Camera_Calibration, Image_Undistortion, P... | 49.305785 | 228 | 0.666946 |
189968ef73df523b211e1feee049617724365d83 | 3,942 | py | Python | tests/kms/test_kms.py | kazhala/fawsf | 4abefb2301f7b489b11ed3f0b303faafa5941d5b | [
"MIT"
] | 66 | 2020-07-26T12:43:30.000Z | 2022-01-25T12:09:40.000Z | tests/kms/test_kms.py | kazhala/fawsf | 4abefb2301f7b489b11ed3f0b303faafa5941d5b | [
"MIT"
] | null | null | null | tests/kms/test_kms.py | kazhala/fawsf | 4abefb2301f7b489b11ed3f0b303faafa5941d5b | [
"MIT"
] | 3 | 2020-07-26T22:09:45.000Z | 2020-07-28T01:09:26.000Z | import sys
import os
import io
import unittest
from unittest.mock import patch
from fzfaws.kms import KMS
from fzfaws.utils import Pyfzf, FileLoader
from botocore.paginate import Paginator
from pathlib import Path
class TestKMS(unittest.TestCase):
def setUp(self):
fileloader = FileLoader()
config_... | 37.542857 | 90 | 0.584982 |
a8b2a93aab8c856826eb7312b783bf5fd3f725ee | 5,703 | py | Python | api_worker/work_with_api.py | Valden92/VK-friends-report | af51e46b575d02b34f1f7e132b3bb0a3ce183925 | [
"Unlicense"
] | 1 | 2022-01-23T16:04:38.000Z | 2022-01-23T16:04:38.000Z | api_worker/work_with_api.py | Valden92/VK-friends-report | af51e46b575d02b34f1f7e132b3bb0a3ce183925 | [
"Unlicense"
] | null | null | null | api_worker/work_with_api.py | Valden92/VK-friends-report | af51e46b575d02b34f1f7e132b3bb0a3ce183925 | [
"Unlicense"
] | null | null | null | import requests
class VkApiGet:
"""Работает с VK api."""
def __init__(self, user_id, access_token, parameters):
"""Инициализация параметров.
:param user_id: ID пользователя, по которому делается запрос с целью извлечения его подписчиков;
:param access_token: ваш токен (токен приложени... | 42.559701 | 118 | 0.624759 |
2c2e955dba25ddab2a5209368d119de8c2d58ea9 | 439 | py | Python | sumtype/__init__.py | lubieowoce/sumtype | 29dccfa17083dd7437946480f30116b27b4e6b88 | [
"BSD-3-Clause"
] | 25 | 2018-09-10T18:27:28.000Z | 2021-08-16T19:22:12.000Z | sumtype/__init__.py | lubieowoce/sumtype | 29dccfa17083dd7437946480f30116b27b4e6b88 | [
"BSD-3-Clause"
] | 1 | 2018-10-04T09:18:21.000Z | 2018-10-11T15:04:19.000Z | sumtype/__init__.py | lubieowoce/sumtype | 29dccfa17083dd7437946480f30116b27b4e6b88 | [
"BSD-3-Clause"
] | null | null | null | # Main user-facing api
from .sumtype import sumtype
__all__ = ['sumtype']
# Expose the actual functions `sumtype` calls
from .sumtype_slots import sumtype as make_sumtype
from .sumtype_slots import untyped_sumtype as make_untyped_sumtype
# Expose submodules
# from . import sumtype as sumtype
from . impor... | 27.4375 | 66 | 0.758542 |
3d4294eec93f675da71883523794adf13a280c6e | 1,589 | py | Python | src/keycloakclient/admin/user/usergroup.py | phoebebright/python-keycloak-client | 8590fbcdbda8edbe993a01bbff06d9d9be679c5e | [
"MIT"
] | null | null | null | src/keycloakclient/admin/user/usergroup.py | phoebebright/python-keycloak-client | 8590fbcdbda8edbe993a01bbff06d9d9be679c5e | [
"MIT"
] | null | null | null | src/keycloakclient/admin/user/usergroup.py | phoebebright/python-keycloak-client | 8590fbcdbda8edbe993a01bbff06d9d9be679c5e | [
"MIT"
] | null | null | null | import json
from keycloakclient.admin import KeycloakAdminBase
class UserGroups(KeycloakAdminBase):
_BASE = "/auth/admin/realms/{realm}/users/{user_id}"
_paths = {
'collection': _BASE + '/groups',
'single': _BASE + '/groups/{group_id}'
}
def __init__(self, realm_name, user_id, *args,... | 27.877193 | 61 | 0.480176 |
c0b9e1fbacdd3782301da5d0bf3df97bafea74c1 | 9,998 | py | Python | roloboxd/roloboxd.py | XenGi/cugcontrol | 7a4682f1bb4dbd2f27cd270de146b12ee03220fb | [
"MIT"
] | 2 | 2018-05-03T16:02:43.000Z | 2019-03-05T09:58:58.000Z | roloboxd/roloboxd.py | XenGi/cugcontrol | 7a4682f1bb4dbd2f27cd270de146b12ee03220fb | [
"MIT"
] | null | null | null | roloboxd/roloboxd.py | XenGi/cugcontrol | 7a4682f1bb4dbd2f27cd270de146b12ee03220fb | [
"MIT"
] | 1 | 2018-01-21T01:48:57.000Z | 2018-01-21T01:48:57.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# vim: ts=4:et
import os
import sys
import asyncio
import serial.aio
import RPi.GPIO as GPIO
import configparser
import json
import urllib.request
from datetime import datetime
DRUM_CONFIGS_DIR = os.path.join(os.path.dirname(__file__), 'drum_configs')
MAIN_CONFIG_FILENA... | 33.438127 | 111 | 0.592719 |
438222ee33f9b9c819e728ad919a0290e550321e | 1,776 | py | Python | django_file_form/uploader.py | dureba/django-file-form | ef143564013256c926d50a4c4e6391018a70461e | [
"Apache-2.0"
] | null | null | null | django_file_form/uploader.py | dureba/django-file-form | ef143564013256c926d50a4c4e6391018a70461e | [
"Apache-2.0"
] | null | null | null | django_file_form/uploader.py | dureba/django-file-form | ef143564013256c926d50a4c4e6391018a70461e | [
"Apache-2.0"
] | null | null | null | import os
import uuid
from django.core.exceptions import PermissionDenied
from . import conf
from .ajaxuploader.backends.local import LocalUploadBackend
from .ajaxuploader.views import AjaxFileUploader
from .models import UploadedFile
from .util import load_class
class FileFormUploadBackend(LocalUploadBackend):
... | 31.714286 | 79 | 0.677928 |
18b0426a23e21acae46c78cdf232eb072348264b | 6,531 | py | Python | src/unity/python/turicreate/_scripts/_pylambda_worker.py | LeeCenY/turicreate | fb2f3bf313e831ceb42a2e10aacda6e472ea8d93 | [
"BSD-3-Clause"
] | null | null | null | src/unity/python/turicreate/_scripts/_pylambda_worker.py | LeeCenY/turicreate | fb2f3bf313e831ceb42a2e10aacda6e472ea8d93 | [
"BSD-3-Clause"
] | null | null | null | src/unity/python/turicreate/_scripts/_pylambda_worker.py | LeeCenY/turicreate | fb2f3bf313e831ceb42a2e10aacda6e472ea8d93 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright © 2017 Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can
# be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
from __future__ import print_function as _
from __future__ import division as _
from... | 34.555556 | 99 | 0.574338 |
3af3c5e36056ab99577c921498c8b2e26b19e441 | 32,495 | py | Python | python/services/composer/environment.py | trodge/declarative-resource-client-library | 2cb7718a5074776b3113cc18a7483b54022238f3 | [
"Apache-2.0"
] | 16 | 2021-01-08T19:35:22.000Z | 2022-03-23T16:23:49.000Z | python/services/composer/environment.py | trodge/declarative-resource-client-library | 2cb7718a5074776b3113cc18a7483b54022238f3 | [
"Apache-2.0"
] | 1 | 2021-01-13T04:59:56.000Z | 2021-01-13T04:59:56.000Z | python/services/composer/environment.py | LaudateCorpus1/declarative-resource-client-library | a559c4333587fe9531cef150532e6fcafff153e4 | [
"Apache-2.0"
] | 11 | 2021-03-18T11:27:28.000Z | 2022-03-12T06:49:14.000Z | # Copyright 2021 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 36.634724 | 108 | 0.675858 |
e62d989e94a354359cfeb4561491eb83dd3e2d9a | 266 | py | Python | wiki/forms.py | MackRoe/makewiki_v2 | 7139e05b7e6dbb826c8d367db91db861abba6ab8 | [
"MIT"
] | null | null | null | wiki/forms.py | MackRoe/makewiki_v2 | 7139e05b7e6dbb826c8d367db91db861abba6ab8 | [
"MIT"
] | 6 | 2020-06-06T00:36:20.000Z | 2022-02-10T14:20:19.000Z | wiki/forms.py | MackRoe/makewiki_v2 | 7139e05b7e6dbb826c8d367db91db861abba6ab8 | [
"MIT"
] | null | null | null | from django import forms
from wiki.models import Page
from django.forms import ModelForm
class PageForm(ModelForm):
""" Render and process a form based on the Page model. """
class Meta:
model = Page
fields = ['title', 'content', 'author']
| 24.181818 | 62 | 0.672932 |
2e91e79a727ffb88a794538bb528a1163857dd83 | 4,946 | py | Python | src/docserver/api/schemas.py | djpugh/docserver | 8b272ae8fe75b4773da6111a074a141bcf4698c9 | [
"MIT"
] | 1 | 2020-12-29T09:16:51.000Z | 2020-12-29T09:16:51.000Z | src/docserver/api/schemas.py | djpugh/docserver | 8b272ae8fe75b4773da6111a074a141bcf4698c9 | [
"MIT"
] | 36 | 2020-11-14T18:47:37.000Z | 2022-03-26T15:37:25.000Z | src/docserver/api/schemas.py | djpugh/docserver | 8b272ae8fe75b4773da6111a074a141bcf4698c9 | [
"MIT"
] | null | null | null | from datetime import datetime
import fnmatch
import logging
import os
from typing import List, Optional
from pkg_resources import parse_version
from pkg_resources.extern.packaging.version import LegacyVersion
from pydantic import AnyUrl, BaseModel, validator
from werkzeug.utils import secure_filename
from docserver.c... | 30.530864 | 142 | 0.686818 |
96b301f96b28951d652a5ffb26300b0d71e2c135 | 2,281 | py | Python | aliyun-python-sdk-cdn/aliyunsdkcdn/request/v20180510/DescribeDomainRealTimeHttpCodeDataRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-cdn/aliyunsdkcdn/request/v20180510/DescribeDomainRealTimeHttpCodeDataRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-cdn/aliyunsdkcdn/request/v20180510/DescribeDomainRealTimeHttpCodeDataRequest.py | liumihust/aliyun-openapi-python-sdk | c7b5dd4befae4b9c59181654289f9272531207ef | [
"Apache-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 34.044776 | 86 | 0.766769 |
2964e18e930ff5aa871a3ffa49d5d7123e7c9b24 | 9,372 | py | Python | tests/slicing/test-runner-debug.py | vwvw/dg | d071060a3e7fde23703172b8eb2ccd04447d7222 | [
"MIT"
] | 316 | 2016-02-19T19:08:02.000Z | 2022-03-29T02:05:59.000Z | tests/slicing/test-runner-debug.py | vwvw/dg | d071060a3e7fde23703172b8eb2ccd04447d7222 | [
"MIT"
] | 366 | 2015-04-17T15:34:44.000Z | 2022-03-31T16:38:13.000Z | tests/slicing/test-runner-debug.py | vwvw/dg | d071060a3e7fde23703172b8eb2ccd04447d7222 | [
"MIT"
] | 116 | 2016-02-03T15:42:12.000Z | 2022-03-02T19:58:58.000Z | #!/usr/bin/env python3
from os import chdir, environ, getcwd
from os.path import abspath, basename, dirname, join
from shutil import rmtree
from subprocess import DEVNULL, PIPE, Popen
from sys import argv, stdout
clang_has_sanitizers = False
debug = False
have_svf = False
# going to be (possibly) re-set in set_envir... | 27.564706 | 79 | 0.562953 |
fb7126e67e19ee99b7518f522b85df99100e3e23 | 5,522 | py | Python | bin/check_smoker_plugin.py | Slabimic/smoker | 4f34b2fc3cb5941d4c8a07c8b202eedcd8b4c528 | [
"BSD-3-Clause"
] | null | null | null | bin/check_smoker_plugin.py | Slabimic/smoker | 4f34b2fc3cb5941d4c8a07c8b202eedcd8b4c528 | [
"BSD-3-Clause"
] | null | null | null | bin/check_smoker_plugin.py | Slabimic/smoker | 4f34b2fc3cb5941d4c8a07c8b202eedcd8b4c528 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (C) 2007-2013, GoodData(R) Corporation. All rights reserved
"""
Check Smoker plugin and force it's run by option.
Return Nagios-friendly result. We can't send much data so just send if it's alright or not or print first line of
standard non-component messages i... | 42.806202 | 119 | 0.591271 |
00c747099acad5497ab96d0211c84aad7e2032ae | 4,875 | py | Python | dask_cuda/device_host_file.py | msadang/dask-cuda | e9aee6c3f91054d8589affd8e3ec0041f1731a4e | [
"Apache-2.0"
] | 1 | 2020-11-06T03:20:10.000Z | 2020-11-06T03:20:10.000Z | dask_cuda/device_host_file.py | msadang/dask-cuda | e9aee6c3f91054d8589affd8e3ec0041f1731a4e | [
"Apache-2.0"
] | 16 | 2020-10-28T16:24:23.000Z | 2020-11-06T13:52:08.000Z | dask_cuda/device_host_file.py | msadang/dask-cuda | e9aee6c3f91054d8589affd8e3ec0041f1731a4e | [
"Apache-2.0"
] | null | null | null | import functools
import os
from zict import Buffer, File, Func
from zict.common import ZictBase
import dask
from distributed.protocol import (
dask_deserialize,
dask_serialize,
deserialize,
deserialize_bytes,
serialize,
serialize_bytelist,
)
from distributed.utils import nbytes
from distribute... | 31.655844 | 87 | 0.677128 |
1bce94a17f9715096d2652f1d0e98db2309bbc34 | 3,867 | py | Python | Part 7 - Deep Learning Basics/Section 1 - Artificial Neural Networks/Artificial_neural_net.py | rudrajit1729/Machine-Learning-Codes-And-Templates | f36e92e9e103fa96549596e38be4c5fa29b2765d | [
"MIT"
] | 4 | 2020-03-28T13:46:21.000Z | 2020-12-12T07:24:26.000Z | Part 7 - Deep Learning Basics/Section 1 - Artificial Neural Networks/Artificial_neural_net.py | rudrajit1729/Machine-Learning-Codes-And-Templates | f36e92e9e103fa96549596e38be4c5fa29b2765d | [
"MIT"
] | null | null | null | Part 7 - Deep Learning Basics/Section 1 - Artificial Neural Networks/Artificial_neural_net.py | rudrajit1729/Machine-Learning-Codes-And-Templates | f36e92e9e103fa96549596e38be4c5fa29b2765d | [
"MIT"
] | 1 | 2020-05-10T01:34:28.000Z | 2020-05-10T01:34:28.000Z | # -*- coding: utf-8 -*-
"""
Created on Mon Nov 11 20:56:19 2019
@author: RUDRAJIT
"""
# Artificial Neural Network
# Installing Theano
# pip install --upgrade --no-deps git+git://github.com/Theano/Theano.git
# Installing Tensorflow
# Install Tensorflow from the website: https://www.tensorflow.org/versio... | 30.210938 | 107 | 0.725886 |
65082a431c74f5f4752add3b335a67be8bcef515 | 1,665 | py | Python | apps/transaction/models.py | anyiv/Kuropoly-Team-DC | 727a614884272ff521d141193c58d4a54c15be03 | [
"MIT"
] | 1 | 2021-04-11T13:51:07.000Z | 2021-04-11T13:51:07.000Z | apps/transaction/models.py | anyiv/Kuropoly-Team-DC | 727a614884272ff521d141193c58d4a54c15be03 | [
"MIT"
] | null | null | null | apps/transaction/models.py | anyiv/Kuropoly-Team-DC | 727a614884272ff521d141193c58d4a54c15be03 | [
"MIT"
] | null | null | null | from django.db import models
from apps.users.models import User
from datetime import datetime
from django.contrib import admin
# Create your models here.
class TransactionType(models.Model):
"""Modelo del tipo de transaccion"""
idTrType = models.CharField(max_length=8, primary_key=True)
name = models.CharF... | 32.647059 | 73 | 0.682883 |
3dd479131db6a5ebb4f0cc61b167f7862c6cbe5f | 2,661 | py | Python | tests/properties_test.py | am-ivanov/dace | c35f0b3cecc04a2c9fb668bd42a72045891e7a42 | [
"BSD-3-Clause"
] | 1 | 2021-09-13T06:36:18.000Z | 2021-09-13T06:36:18.000Z | tests/properties_test.py | 1C4nfaN/dace | 4d65e0951c112160fe783766404a806b6043b521 | [
"BSD-3-Clause"
] | null | null | null | tests/properties_test.py | 1C4nfaN/dace | 4d65e0951c112160fe783766404a806b6043b521 | [
"BSD-3-Clause"
] | null | null | null | """Unit tests for dace.sdfg.properties module."""
import unittest
import sympy as sp
import dace
from collections import OrderedDict
class PropertyTests(unittest.TestCase):
"""Implements unit tests for dace.sdfg.properties.Property class."""
def test_indirect_properties(self):
m = dace.sdfg.nodes.Ma... | 34.115385 | 78 | 0.584367 |
d73b5e7b89fe50b39abc2f6fcf0e987afd39cf71 | 3,141 | py | Python | stravaplots/stravaplots/settings.py | sdrogers/stravaplots | c9364f8dabdc4ee8d6a170ac7b7177f263084fba | [
"MIT"
] | null | null | null | stravaplots/stravaplots/settings.py | sdrogers/stravaplots | c9364f8dabdc4ee8d6a170ac7b7177f263084fba | [
"MIT"
] | 2 | 2020-02-12T01:02:44.000Z | 2020-06-05T18:32:01.000Z | stravaplots/stravaplots/settings.py | sdrogers/stravaplots | c9364f8dabdc4ee8d6a170ac7b7177f263084fba | [
"MIT"
] | null | null | null | """
Django settings for stravaplots project.
Generated by 'django-admin startproject' using Django 1.11.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import ... | 25.745902 | 91 | 0.696593 |
29387a1a4702c330749b311f9dc035220874c060 | 1,090 | py | Python | test_analysis.py | ryrolio/IA_Lent_Project | 9023dfb199b5db7676fef61f0fca46ab69707461 | [
"MIT"
] | null | null | null | test_analysis.py | ryrolio/IA_Lent_Project | 9023dfb199b5db7676fef61f0fca46ab69707461 | [
"MIT"
] | null | null | null | test_analysis.py | ryrolio/IA_Lent_Project | 9023dfb199b5db7676fef61f0fca46ab69707461 | [
"MIT"
] | 1 | 2022-01-28T11:46:05.000Z | 2022-01-28T11:46:05.000Z | ### This file is the Unit Test for the analysis.py module
import matplotlib
import pytest
import math
import numpy as np
from floodsystem.analysis import *
from floodsystem.stationdata import *
from floodsystem.datafetcher import *
def test_polyfit():
# Number of Data Points
N = 20
# Create a set of d... | 24.772727 | 58 | 0.680734 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.