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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
8f87d26ada09e54c6030427e9f9f150d9d1ab487 | 697 | py | Python | tests/test_cyclic_rotation.py | rafaelcb21/codility | 32f1e6a4cab7d8be42602eabcef1bf68c86bbb88 | [
"MIT"
] | null | null | null | tests/test_cyclic_rotation.py | rafaelcb21/codility | 32f1e6a4cab7d8be42602eabcef1bf68c86bbb88 | [
"MIT"
] | null | null | null | tests/test_cyclic_rotation.py | rafaelcb21/codility | 32f1e6a4cab7d8be42602eabcef1bf68c86bbb88 | [
"MIT"
] | null | null | null | import unittest
# Command to execute the test:
# python -m unittest -v
if __name__ == '__main__':
unittest.main
| 34.85 | 73 | 0.593974 | import unittest
from lesson_02_arrays.cyclic_rotation import solution
# Command to execute the test:
# python -m unittest -v
class TestCyclicRotation(unittest.TestCase):
def test_cyclic_rotation(self):
self.assertEqual(solution([3, 8, 9, 7, 6], 1), [6, 3, 8, 9, 7])
self.assertEqual(solution([... | 0 | 0 | 0 | 502 | 0 | 0 | 0 | 32 | 45 |
7bffd9d425a51bc9b41f82493b2d2efaf2e16d5c | 30,316 | py | Python | venv/lib/python3.8/site-packages/azure/mgmt/billing/operations/_products_operations.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/azure/mgmt/billing/operations/_products_operations.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/azure/mgmt/billing/operations/_products_operations.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 47.294852 | 198 | 0.663346 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 0 | 0 | 0 | 29,737 | 0 | 0 | 0 | 14 | 68 |
b0b5862205555b250f94351cc3d17be364a3bd12 | 1,883 | py | Python | editorcontainer/rightclickmenu/rightclickmenu.py | AutomataRaven/azaharTEA | 2d5a7d96b37bca9b3a914e305e493824a0f60207 | [
"MIT"
] | 5 | 2019-03-10T16:33:21.000Z | 2021-04-07T17:24:32.000Z | editorcontainer/rightclickmenu/rightclickmenu.py | Errantgod/azaharTEA | 2d5a7d96b37bca9b3a914e305e493824a0f60207 | [
"MIT"
] | 8 | 2017-02-11T06:21:28.000Z | 2017-02-22T05:50:35.000Z | editorcontainer/rightclickmenu/rightclickmenu.py | Errantgod/azaharTEA | 2d5a7d96b37bca9b3a914e305e493824a0f60207 | [
"MIT"
] | 2 | 2019-10-05T20:20:15.000Z | 2020-06-28T18:46:58.000Z | """Contains the class :py:class:`.RightClickMenu`, a menu to open in the
:py:class:`editorcontainer.editor.editor.Editor`."""
| 34.236364 | 90 | 0.624535 | """Contains the class :py:class:`.RightClickMenu`, a menu to open in the
:py:class:`editorcontainer.editor.editor.Editor`."""
from kivy.uix.popup import Popup
from kivy.properties import ObjectProperty
from kivy.uix.widget import Widget
from kivy.uix.bubble import Bubble
class RightClickMenu(Bubble):
"""Right cli... | 0 | 0 | 0 | 1,587 | 0 | 0 | 0 | 58 | 112 |
c9683bd54614a9a7dfe0f7bbfb5e2e3f1bd554ff | 1,145 | py | Python | tests/silk/test-meta.py | sjdv1982/silk | 232e759cabfc7a87550d1e50ed9c4de4e0e57bf4 | [
"MIT"
] | null | null | null | tests/silk/test-meta.py | sjdv1982/silk | 232e759cabfc7a87550d1e50ed9c4de4e0e57bf4 | [
"MIT"
] | 1 | 2021-04-06T09:08:39.000Z | 2021-04-06T09:10:02.000Z | tests/silk/test-meta.py | sjdv1982/silk | 232e759cabfc7a87550d1e50ed9c4de4e0e57bf4 | [
"MIT"
] | null | null | null | from pprint import pprint
pprint(Coordinate.schema)
c = Coordinate()
c.validate()
c = Coordinate(3)
pprint(c.schema)
print(c.unsilk)
c.a = 10
print(c.aa())
print(c.a2)
c.a2 = 1002
c.validate()
print(c.a.unsilk)
c.validate()
c.a = 11 # Error
c.validate() | 23.367347 | 80 | 0.648908 | from pprint import pprint
from silk import Silk
from functools import partial
from silk.meta import meta, validator
class Coordinate(metaclass=meta):
a = 1 # not a class default, but a type inference!
# It is equivalent to: schema.properties.a.type = "integer"
# If you want class default instead:
# -... | 0 | 155 | 0 | 624 | 0 | 0 | 0 | 24 | 88 |
0e186ac6c2cebe1c03bef33664b126fb504212b3 | 469 | py | Python | 2015/2015_20b.py | davidxiao93/Advent-of-Code | 29503100ae4eb46b048fc3ab68ff0181c6f00ee5 | [
"MIT"
] | null | null | null | 2015/2015_20b.py | davidxiao93/Advent-of-Code | 29503100ae4eb46b048fc3ab68ff0181c6f00ee5 | [
"MIT"
] | null | null | null | 2015/2015_20b.py | davidxiao93/Advent-of-Code | 29503100ae4eb46b048fc3ab68ff0181c6f00ee5 | [
"MIT"
] | null | null | null | input = """36000000"""
house = 1
target = int(input)
while True:
count = num_presents(house)
if count > target:
print(house)
break
house += 1
| 19.541667 | 58 | 0.565032 | input = """36000000"""
import math
def num_presents(h):
sum_factors = set()
for i in range(1, math.floor(math.sqrt(h)) + 1):
if h % i == 0:
sum_factors.add(i)
sum_factors.add(int(h/i))
sum_factors = {f for f in sum_factors if h / f <= 50 }
return sum(sum_factors) * 11
... | 0 | 0 | 0 | 0 | 0 | 260 | 0 | -10 | 46 |
6a1853f15d4f61eda2e2e664729b6325676daf2d | 9,801 | py | Python | gifviewer/gui/_qtdesignerforms/mainview_ui.py | FlyBoy8869/gifviewer | 23341eb9c13e2e7ec56c095b71e222d1af7be1a6 | [
"MIT"
] | null | null | null | gifviewer/gui/_qtdesignerforms/mainview_ui.py | FlyBoy8869/gifviewer | 23341eb9c13e2e7ec56c095b71e222d1af7be1a6 | [
"MIT"
] | null | null | null | gifviewer/gui/_qtdesignerforms/mainview_ui.py | FlyBoy8869/gifviewer | 23341eb9c13e2e7ec56c095b71e222d1af7be1a6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/Users/charles/PycharmProjects/gifviewer/gifviewer/gui/_qtdesignerforms/mainview_ui.ui'
#
# Created by: PyQt5 UI code generator 5.15.2
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit th... | 55.061798 | 141 | 0.73166 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file '/Users/charles/PycharmProjects/gifviewer/gifviewer/gui/_qtdesignerforms/mainview_ui.ui'
#
# Created by: PyQt5 UI code generator 5.15.2
#
# WARNING: Any manual changes made to this file will be lost when pyuic5 is
# run again. Do not edit th... | 0 | 0 | 0 | 9,368 | 0 | 0 | 0 | 21 | 46 |
15fad686dd3795c36d7f65d58b86fbecbf16fb54 | 8,569 | py | Python | gkutils/commonutils/coneSearchCassandra.py | genghisken/gkutils | 0c8aa06d813de72b1cd9cba11219a78952799420 | [
"MIT"
] | null | null | null | gkutils/commonutils/coneSearchCassandra.py | genghisken/gkutils | 0c8aa06d813de72b1cd9cba11219a78952799420 | [
"MIT"
] | 1 | 2021-11-19T19:28:52.000Z | 2021-11-19T19:29:57.000Z | gkutils/commonutils/coneSearchCassandra.py | genghisken/gkutils | 0c8aa06d813de72b1cd9cba11219a78952799420 | [
"MIT"
] | null | null | null | """Query cassandra by RA and dec. The coords variable should be RA and dec, comma separated with NO SPACE. (To facilitate negative declinations.)
Usage:
%s <configFile> <coords> [--radius=<radius>] [--coordsfromfile] [--saveresults] [--resultslocation=<resultslocation>] [--number=<number>] [--table=<table>] [--namec... | 42.211823 | 461 | 0.627378 | """Query cassandra by RA and dec. The coords variable should be RA and dec, comma separated with NO SPACE. (To facilitate negative declinations.)
Usage:
%s <configFile> <coords> [--radius=<radius>] [--coordsfromfile] [--saveresults] [--resultslocation=<resultslocation>] [--number=<number>] [--table=<table>] [--namec... | 0 | 0 | 0 | 0 | 0 | 4,134 | 0 | 106 | 179 |
7ccc3ce477807eda670c158af9c88422c29a1fe3 | 1,876 | py | Python | backup_folders.py | TrentWeiss/pythonscripts | fb08945c0511bd40e48e7c23a49f57f6d29da590 | [
"BSD-3-Clause"
] | null | null | null | backup_folders.py | TrentWeiss/pythonscripts | fb08945c0511bd40e48e7c23a49f57f6d29da590 | [
"BSD-3-Clause"
] | null | null | null | backup_folders.py | TrentWeiss/pythonscripts | fb08945c0511bd40e48e7c23a49f57f6d29da590 | [
"BSD-3-Clause"
] | null | null | null | #/usr/bin/env python
from paramiko import SSHClient
from scp import SCPClient
import os
import getpass
import argparse
parser = argparse.ArgumentParser("7z folders and scp the resulting archives to a backup server")
parser.add_argument('folders', metavar='folder', type=str, nargs='+', help='The folders to back up')
... | 38.285714 | 123 | 0.736674 | #/usr/bin/env python
from paramiko import SSHClient
from scp import SCPClient
import os
import getpass
import py7zr
import argparse
import subprocess
def sevenZipFolder(folder: str):
folder = os.path.normpath(folder)
archive_name = os.path.basename(folder) + ".7z"
print("7zipping %s into %s" %(folder, arc... | 0 | 0 | 0 | 0 | 0 | 253 | 0 | -13 | 67 |
7804e7b85767da2f56c57d0ad467c1067726e0c1 | 2,312 | py | Python | a2/plotting.py | WendyH1108/IntSys-Education | e85dedec2ef51b0e6482ec026535dd0338ecb905 | [
"MIT"
] | 1 | 2021-12-02T21:23:35.000Z | 2021-12-02T21:23:35.000Z | a2/plotting.py | WendyH1108/IntSys-Education | e85dedec2ef51b0e6482ec026535dd0338ecb905 | [
"MIT"
] | null | null | null | a2/plotting.py | WendyH1108/IntSys-Education | e85dedec2ef51b0e6482ec026535dd0338ecb905 | [
"MIT"
] | 12 | 2020-03-03T00:36:10.000Z | 2021-11-30T19:16:38.000Z | import numpy as np
import matplotlib.pyplot as plt
def plot_binary_logistic_boundary(logreg, X, y, xlim, ylim):
"""Plots the boundary given by the trained logistic regressor
:param logreg: Logistic Regrssor model
:type logreg: logistic_regression.LogisticRegressionModel
:param X: The features and... | 32.111111 | 73 | 0.617215 | import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets import make_classification
import typing
def plot_binary_logistic_boundary(logreg, X, y, xlim, ylim):
"""Plots the boundary given by the trained logistic regressor
:param logreg: Logistic Regrssor model
:type logreg: logistic_re... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 19 | 44 |
9c8974bb9d5d60c5af22e1619e47dec36acf74a6 | 1,423 | py | Python | tools/demo.py | conquerhuang/FDSiamFC | d43a254b0fa1e309d6625132b25950803bf34b0d | [
"MIT"
] | 2 | 2022-03-18T02:14:36.000Z | 2022-03-18T02:14:39.000Z | tools/demo.py | scott-mao/FDSiamFC | d43a254b0fa1e309d6625132b25950803bf34b0d | [
"MIT"
] | null | null | null | tools/demo.py | scott-mao/FDSiamFC | d43a254b0fa1e309d6625132b25950803bf34b0d | [
"MIT"
] | 1 | 2022-02-28T05:15:45.000Z | 2022-02-28T05:15:45.000Z | from __future__ import absolute_import
import os
import glob
import numpy as np
from siamfc import TrackerFDSiamFC
if __name__ == '__main__':
# demo video, you can copy any video sequences from OTB dataset and put it into videos folder as the demo video.
seq_dir = os.path.expanduser(r'../videos/Basketball/'... | 39.527778 | 116 | 0.716093 | from __future__ import absolute_import
import os
import glob
import numpy as np
from siamfc import TrackerFDSiamFC
if __name__ == '__main__':
# demo video, you can copy any video sequences from OTB dataset and put it into videos folder as the demo video.
seq_dir = os.path.expanduser(r'../videos/Basketball/'... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
db13cc62c00939409d89ec4b3a57b2d6f68169f0 | 3,626 | py | Python | futaba/cogs/crosspost/core.py | Ma-wa-re/futaba | ecc01325b0747e46896bcb5fdf6408d9fc21dbc0 | [
"MIT"
] | 23 | 2018-09-17T09:06:27.000Z | 2021-05-27T15:21:37.000Z | futaba/cogs/crosspost/core.py | Ma-wa-re/futaba | ecc01325b0747e46896bcb5fdf6408d9fc21dbc0 | [
"MIT"
] | 257 | 2018-08-18T21:27:54.000Z | 2020-12-29T23:27:10.000Z | futaba/cogs/crosspost/core.py | Ma-wa-re/futaba | ecc01325b0747e46896bcb5fdf6408d9fc21dbc0 | [
"MIT"
] | 22 | 2018-09-09T09:03:13.000Z | 2021-11-09T03:34:34.000Z | """
Cog for handling crosspost-style spam.
"""
import logging
logger = logging.getLogger(__name__)
__all__ = ["Crosspost"]
| 34.533333 | 132 | 0.636514 | """
Cog for handling crosspost-style spam.
"""
import logging
from futaba.str_builder import StringBuilder
from ..abc import AbstractCog
from collections import OrderedDict
from discord import MessageType
from binascii import crc32
logger = logging.getLogger(__name__)
__all__ = ["Crosspost"]
class Crosspost(Abstr... | 0 | 0 | 2,325 | 956 | 0 | 0 | 0 | 60 | 157 |
5e7dc643e5d6141739cf2cc2515a68ebe8964feb | 1,017 | py | Python | Week10/quad.py | glender/JHU_Cryptology | 2bc973ffd6f84ba4f70748308d4cff0dd4c91a05 | [
"MIT"
] | null | null | null | Week10/quad.py | glender/JHU_Cryptology | 2bc973ffd6f84ba4f70748308d4cff0dd4c91a05 | [
"MIT"
] | null | null | null | Week10/quad.py | glender/JHU_Cryptology | 2bc973ffd6f84ba4f70748308d4cff0dd4c91a05 | [
"MIT"
] | 1 | 2018-09-04T01:17:42.000Z | 2018-09-04T01:17:42.000Z | #! /bin/python
__author__ = "glender"
__copyright__ = "Copyright (c) 2018 glender"
__credits__ = [ "glender" ]
__license__ = "MIT"
__version__ = "0.1"
__maintainer__ = "glender"
__email__ = "None"
__status__ = "Production"
# Elliptic curve class
c = curve(71, 1, 28)
for x in range(0, c.getOver()):
val = c.calculate... | 23.651163 | 112 | 0.574238 | #! /bin/python
__author__ = "glender"
__copyright__ = "Copyright (c) 2018 glender"
__credits__ = [ "glender" ]
__license__ = "MIT"
__version__ = "0.1"
__maintainer__ = "glender"
__email__ = "None"
__status__ = "Production"
# Elliptic curve class
class curve:
# Init class
def __init__(self, p, a, b):
# y^2 = x^3 +... | 0 | 0 | 0 | 406 | 0 | 0 | 0 | 0 | 22 |
bcc7824896aed6053e30119e5fe6eca740a31c42 | 1,286 | py | Python | file_rename.py | fengjiqiang/CreateDataset_IXS_80_2018 | fc541e8f9e80a7a119847321dfd1f01253859af6 | [
"Apache-2.0"
] | 1 | 2018-12-07T15:53:42.000Z | 2018-12-07T15:53:42.000Z | file_rename.py | fengjiqiang/CreateDataset_IXS_80_2018 | fc541e8f9e80a7a119847321dfd1f01253859af6 | [
"Apache-2.0"
] | null | null | null | file_rename.py | fengjiqiang/CreateDataset_IXS_80_2018 | fc541e8f9e80a7a119847321dfd1f01253859af6 | [
"Apache-2.0"
] | null | null | null | import os
'''
Acadian_Flycatcher/Acadian_Flycatcher_1.jpg
Acadian_Flycatcher/Acadian_Flycatcher_2.jpg
...
'''
def reName(dirname):
'''
'''
#
for category in os.listdir(dirname):
# print(category)
catdir = os.path.join(dirname, category)
#
i... | 26.791667 | 85 | 0.533437 | import os
import numpy as np
'''
图片文件重命名
格式:
Acadian_Flycatcher/Acadian_Flycatcher_1.jpg
Acadian_Flycatcher/Acadian_Flycatcher_2.jpg
...
'''
def reName(dirname):
'''
实现将所有类别中的所有文件重新命名
'''
# 该文件夹下所有的文件(包括文件夹)
for category in os.listdir(dirname):
# print(category)
... | 282 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 24 |
58dff0b83371b9e4e566e4b33cbc606853f0c893 | 1,098 | py | Python | src/build_scripts/utils/sugar/char_check_func.py | 1024sparrow/traliva | db8e9579747d5d89aed09a488561f9498fc723e7 | [
"MIT"
] | 1 | 2017-12-01T09:43:27.000Z | 2017-12-01T09:43:27.000Z | src/build_scripts/utils/sugar/char_check_func.py | 1024sparrow/traliva | db8e9579747d5d89aed09a488561f9498fc723e7 | [
"MIT"
] | 1 | 2021-09-19T13:22:32.000Z | 2021-09-19T13:22:32.000Z | src/build_scripts/utils/sugar/char_check_func.py | 1024sparrow/traliva | db8e9579747d5d89aed09a488561f9498fc723e7 | [
"MIT"
] | 1 | 2021-12-03T00:20:41.000Z | 2021-12-03T00:20:41.000Z | #!/usr/bin/env python3
## True, - (';', '.', ')' ..)
| 21.115385 | 87 | 0.571949 | #!/usr/bin/env python3
## True, если указанный символ - пробельный символ или спецсимвол(';', '.', ')' и т.д.)
def is_spacespec(p_char):
if p_char.isspace():
return True
if p_char.isalpha():
return False
if p_char == '_':
return False
if p_char == '$':
return False
i... | 122 | 0 | 0 | 0 | 0 | 862 | 0 | 0 | 114 |
648f1d7191f3106f8c8c4f87bc572f5d9a6cd6a4 | 3,004 | py | Python | samples/apps/marketplace_sample/appengine_utilities/interface/main.py | dorosh/gdata-python-client | eb6826ba1e6046a202158d4fefa672150efa0ca5 | [
"Apache-2.0"
] | 483 | 2015-01-07T18:03:08.000Z | 2021-12-22T00:05:55.000Z | samples/apps/marketplace_sample/appengine_utilities/interface/main.py | dorosh/gdata-python-client | eb6826ba1e6046a202158d4fefa672150efa0ca5 | [
"Apache-2.0"
] | 68 | 2015-01-05T17:25:36.000Z | 2021-12-06T20:43:34.000Z | samples/apps/marketplace_sample/appengine_utilities/interface/main.py | dorosh/gdata-python-client | eb6826ba1e6046a202158d4fefa672150efa0ca5 | [
"Apache-2.0"
] | 297 | 2015-01-02T20:05:06.000Z | 2022-03-17T22:25:34.000Z | '''
Copyright (c) 2008, appengine-utilities project
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the ... | 60.08 | 754 | 0.73269 | '''
Copyright (c) 2008, appengine-utilities project
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the ... | 0 | 0 | 0 | 958 | 0 | 205 | 0 | 99 | 202 |
0a46bc002a176319cf4f16e2e5796e015914a36f | 2,617 | py | Python | cross_dimensional_monte_carlo.py | tcompa/cross_dimensional_monte_carlo | f5925c02140bf289ac933a2d58203fad95eecfd6 | [
"MIT"
] | 1 | 2018-03-22T08:45:13.000Z | 2018-03-22T08:45:13.000Z | cross_dimensional_monte_carlo.py | tcompa/cross_dimensional_monte_carlo | f5925c02140bf289ac933a2d58203fad95eecfd6 | [
"MIT"
] | null | null | null | cross_dimensional_monte_carlo.py | tcompa/cross_dimensional_monte_carlo | f5925c02140bf289ac933a2d58203fad95eecfd6 | [
"MIT"
] | 1 | 2018-08-26T14:49:49.000Z | 2018-08-26T14:49:49.000Z | '''
program: cross_dimensional_monte_carlo.py
created: 2016-07-13 -- 19:30 CEST
author: tc
'''
import random
import cPickle
from probability_distributions import prob as P
# Parameters for the a-priori distributions
xmin = 0.0
xmax = 10.0
def apriori_prob(nold, nnew, x):
'''
Return the *normalized* a-prio... | 25.407767 | 72 | 0.59572 | '''
program: cross_dimensional_monte_carlo.py
created: 2016-07-13 -- 19:30 CEST
author: tc
'''
import random
import cPickle
from probability_distributions import prob as P
# Parameters for the a-priori distributions
xmin = 0.0
xmax = 10.0
def apriori_prob(nold, nnew, x):
'''
Return the *normalized* a-prio... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3179c4225df915e3b24346f0e39ede5b69b43b90 | 66,479 | py | Python | skyline/settings.py | VictorPronchev/skyline | 60833ceeb9c908f88336340c976b0488ef6f99e2 | [
"MIT"
] | null | null | null | skyline/settings.py | VictorPronchev/skyline | 60833ceeb9c908f88336340c976b0488ef6f99e2 | [
"MIT"
] | null | null | null | skyline/settings.py | VictorPronchev/skyline | 60833ceeb9c908f88336340c976b0488ef6f99e2 | [
"MIT"
] | null | null | null | """
Shared settings
IMPORTANT NOTE:
These settings are described with docstrings for the purpose of automated
documentation. You may find reading some of the docstrings easier to understand
or read in the documentation itself.
http://earthgecko-skyline.readthedocs.io/en/latest/skyline.html#module-settings
"""
RED... | 36.367068 | 147 | 0.762105 | """
Shared settings
IMPORTANT NOTE:
These settings are described with docstrings for the purpose of automated
documentation. You may find reading some of the docstrings easier to understand
or read in the documentation itself.
http://earthgecko-skyline.readthedocs.io/en/latest/skyline.html#module-settings
"""
RED... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f89e681d96d48dfd37013f6b6d3852f4fa6097eb | 426 | py | Python | pyAudioAnalysis/test.py | mgottsacker34/pyAudioAnalysis | 84f406491d346bab8374b74a05ee1f5e34ec25da | [
"Apache-2.0"
] | null | null | null | pyAudioAnalysis/test.py | mgottsacker34/pyAudioAnalysis | 84f406491d346bab8374b74a05ee1f5e34ec25da | [
"Apache-2.0"
] | null | null | null | pyAudioAnalysis/test.py | mgottsacker34/pyAudioAnalysis | 84f406491d346bab8374b74a05ee1f5e34ec25da | [
"Apache-2.0"
] | 1 | 2018-11-29T21:07:25.000Z | 2018-11-29T21:07:25.000Z | from pyAudioAnalysis import audioSegmentation as aS
inputWavFile = "data/meeting-021219/part-1-nosilence.wav"
gtFile = inputWavFile.replace(".wav", ".segments")
[flagsInd, classesAll, acc, CM] = aS.mtFileClassification(inputWavFile, "data/knnSpeakerFemaleMale", "knn", plot_results=False, gt_file=gtFile)
print('flagsI... | 38.727273 | 143 | 0.723005 | from pyAudioAnalysis import audioSegmentation as aS
inputWavFile = "data/meeting-021219/part-1-nosilence.wav"
gtFile = inputWavFile.replace(".wav", ".segments")
[flagsInd, classesAll, acc, CM] = aS.mtFileClassification(inputWavFile, "data/knnSpeakerFemaleMale", "knn", plot_results=False, gt_file=gtFile)
print('flagsI... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7b6525ae5efb8c2cf620241ff65bc9f635f94f22 | 186 | py | Python | VistualProject/DataProcessing/csvtestingstuff.py | ForensicTools/pcap-meta-data-viewer-PMDV--CSEC462-2171-halbert-qiu- | b70a11351b884c8488072fddec2a30867f280b7d | [
"Apache-2.0"
] | null | null | null | VistualProject/DataProcessing/csvtestingstuff.py | ForensicTools/pcap-meta-data-viewer-PMDV--CSEC462-2171-halbert-qiu- | b70a11351b884c8488072fddec2a30867f280b7d | [
"Apache-2.0"
] | null | null | null | VistualProject/DataProcessing/csvtestingstuff.py | ForensicTools/pcap-meta-data-viewer-PMDV--CSEC462-2171-halbert-qiu- | b70a11351b884c8488072fddec2a30867f280b7d | [
"Apache-2.0"
] | null | null | null | __author__ = 'Patrick'
import csv
b= open('eggs.csv','a')
a=csv.writer(b)
data=[["hello","thisworks"]]
a.writerows(data)
data=[["hello","thisworks2"]]
a.writerows(data)
b.close() | 20.666667 | 30 | 0.650538 | __author__ = 'Patrick'
import csv
b= open('eggs.csv','a')
a=csv.writer(b)
data=[["hello","thisworks"]]
a.writerows(data)
data=[["hello","thisworks2"]]
a.writerows(data)
b.close() | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ff1e2b77cc905b929323ded4a5ff7998e240937a | 4,747 | py | Python | lutil.py | MVV-GIT/LiMoNS | 1dcd4fedec47609f960f5eeb184b505fa62e1b02 | [
"Apache-2.0"
] | null | null | null | lutil.py | MVV-GIT/LiMoNS | 1dcd4fedec47609f960f5eeb184b505fa62e1b02 | [
"Apache-2.0"
] | null | null | null | lutil.py | MVV-GIT/LiMoNS | 1dcd4fedec47609f960f5eeb184b505fa62e1b02 | [
"Apache-2.0"
] | null | null | null |
version = '0.1.3.43'
# color scheme
c_black = '\033[30m' # black
c_red = '\033[31m' # red
c_green = '\033[32m' # green
c_yellow = '\033[33m' # yellow
c_blue = '\033[34m' # blue
c_magenta = '\033[35m' # magenta
c_cyan = '\033[36m' # cyan
c_white = '\033[37m' # white
c_norm = '\033[39m'
cb_white = '\033[47m'
cb... | 33.195804 | 154 | 0.615125 | import http.client
import os
import sys
from datetime import datetime, timedelta
import platform
import docker
import psutil
version = '0.1.3.43'
# color scheme
c_black = '\033[30m' # black
c_red = '\033[31m' # red
c_green = '\033[32m' # green
c_yellow = '\033[33m' # yellow
c_blue = '\033[34m' # blue
c_magenta =... | 0 | 0 | 0 | 0 | 0 | 3,592 | 0 | -29 | 315 |
dfe7b103f21e20a82228338c3becf42719f44fbb | 2,217 | py | Python | python_testcontainers_smtp_example/candy.py | ipsedixit-org/python-testcontainers-smtp-example | eee9052e023545aa16881c152cd84f2f2e2be2e7 | [
"Apache-2.0"
] | 1 | 2021-07-18T05:45:53.000Z | 2021-07-18T05:45:53.000Z | python_testcontainers_smtp_example/candy.py | ipsedixit-org/python-testcontainers-smtp-example | eee9052e023545aa16881c152cd84f2f2e2be2e7 | [
"Apache-2.0"
] | null | null | null | python_testcontainers_smtp_example/candy.py | ipsedixit-org/python-testcontainers-smtp-example | eee9052e023545aa16881c152cd84f2f2e2be2e7 | [
"Apache-2.0"
] | null | null | null | import logging
ALARM_CANDY = "No more candy!!!"
MAIL_MESSAGE_BODY = "Oh no! No more candy..."
logger = logging.getLogger(__name__)
| 29.959459 | 104 | 0.638701 | import logging
from dataclasses import dataclass
from python_testcontainers_smtp_example.mail_util import send
ALARM_CANDY = "No more candy!!!"
MAIL_MESSAGE_BODY = "Oh no! No more candy..."
logger = logging.getLogger(__name__)
@dataclass
class ConfEmail:
enable_send_email: bool
host: str
port: int
... | 0 | 105 | 0 | 1,810 | 0 | 0 | 0 | 52 | 114 |
81ee7fc89abe3d54c2c7a48a7cd53cf70568c409 | 6,885 | py | Python | js_locations/models.py | compoundpartners/js-locations | 3c0f756b2cad3867a7eec30b3c707d69a2dbdbe2 | [
"BSD-3-Clause"
] | null | null | null | js_locations/models.py | compoundpartners/js-locations | 3c0f756b2cad3867a7eec30b3c707d69a2dbdbe2 | [
"BSD-3-Clause"
] | null | null | null | js_locations/models.py | compoundpartners/js-locations | 3c0f756b2cad3867a7eec30b3c707d69a2dbdbe2 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
try:
from django.core.urlresolvers import reverse, NoReverseMatch
except ImportError:
# Django 2.0
from django.urls import reverse, NoReverseMatch
from django.db import models
from django.contrib.postgres.fields import JSONField
from django.u... | 39.568966 | 115 | 0.690922 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
try:
from django.core.urlresolvers import reverse, NoReverseMatch
except ImportError:
# Django 2.0
from django.urls import reverse, NoReverseMatch
from django.db import models
from django.contrib.postgres.fields import JSONField
from django.u... | 6 | 5,573 | 0 | 26 | 0 | 0 | 0 | 11 | 72 |
08bdc983ce14d10d1f4fcaf63d31d61fd323428a | 16,164 | py | Python | py/instalog/plugins/input_log_file.py | arccode/factory | a1b0fccd68987d8cd9c89710adc3c04b868347ec | [
"BSD-3-Clause"
] | 3 | 2022-01-06T16:52:52.000Z | 2022-03-07T11:30:47.000Z | py/instalog/plugins/input_log_file.py | arccode/factory | a1b0fccd68987d8cd9c89710adc3c04b868347ec | [
"BSD-3-Clause"
] | null | null | null | py/instalog/plugins/input_log_file.py | arccode/factory | a1b0fccd68987d8cd9c89710adc3c04b868347ec | [
"BSD-3-Clause"
] | 1 | 2021-10-24T01:47:22.000Z | 2021-10-24T01:47:22.000Z | #!/usr/bin/env python3
#
# Copyright 2016 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Input log file plugin.
Repeatedly reads lines from a set of log files. Truncates each file when the
maximum size has been re... | 36.405405 | 80 | 0.664811 | #!/usr/bin/env python3
#
# Copyright 2016 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Input log file plugin.
Repeatedly reads lines from a set of log files. Truncates each file when the
maximum size has been re... | 0 | 0 | 0 | 14,695 | 0 | 0 | 0 | 76 | 313 |
6b070699bd25fcf944da9b60e7f0267d6ae19f48 | 103,370 | py | Python | cinder/tests/unit/api/contrib/test_backups.py | hashsos/hashcloudos-cinder | 6d8b648399e2160b419e3f9535eb520c7de9120e | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/api/contrib/test_backups.py | hashsos/hashcloudos-cinder | 6d8b648399e2160b419e3f9535eb520c7de9120e | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/api/contrib/test_backups.py | hashsos/hashcloudos-cinder | 6d8b648399e2160b419e3f9535eb520c7de9120e | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
# 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/LICEN... | 46.542098 | 79 | 0.586776 | # Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
# 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/LICEN... | 0 | 101,871 | 0 | 0 | 0 | 0 | 0 | 215 | 487 |
262e7aae6c86dcd2d19f846748d503a8e71ff325 | 1,093 | py | Python | terroroftinytown/tracker/base.py | Flashfire42/terroroftinytown | c52be7ac0f7abc37f4c90955e5c96b91f935903a | [
"MIT"
] | 59 | 2015-03-05T21:30:06.000Z | 2022-01-31T05:50:34.000Z | terroroftinytown/tracker/base.py | Flashfire42/terroroftinytown | c52be7ac0f7abc37f4c90955e5c96b91f935903a | [
"MIT"
] | 33 | 2015-01-10T02:27:08.000Z | 2022-02-08T18:26:56.000Z | terroroftinytown/tracker/base.py | Flashfire42/terroroftinytown | c52be7ac0f7abc37f4c90955e5c96b91f935903a | [
"MIT"
] | 16 | 2015-03-06T19:51:53.000Z | 2021-11-16T03:50:52.000Z | # encoding=utf-8
ACCOUNT_COOKIE_NAME = 'tottu'
ACCOUNT_TOKEN_COOKIE_NAME = 'tottt'
| 29.540541 | 75 | 0.674291 | # encoding=utf-8
import tornado.web
from terroroftinytown.tracker.model import User
ACCOUNT_COOKIE_NAME = 'tottu'
ACCOUNT_TOKEN_COOKIE_NAME = 'tottt'
class BaseHandler(tornado.web.RequestHandler):
def get_current_user(self):
username_raw = self.get_secure_cookie(ACCOUNT_COOKIE_NAME)
token = sel... | 0 | 0 | 0 | 916 | 0 | 0 | 0 | 23 | 68 |
8c203994651b71dbe4f317ada01d0abe1d3ccd60 | 1,929 | py | Python | examples/publications/2013MNRAS.429..895P/disk_script/boxedfi.py | rknop/amuse | 85d5bdcc29cfc87dc69d91c264101fafd6658aec | [
"Apache-2.0"
] | 131 | 2015-06-04T09:06:57.000Z | 2022-02-01T12:11:29.000Z | examples/publications/2013MNRAS.429..895P/disk_script/boxedfi.py | rknop/amuse | 85d5bdcc29cfc87dc69d91c264101fafd6658aec | [
"Apache-2.0"
] | 690 | 2015-10-17T12:18:08.000Z | 2022-03-31T16:15:58.000Z | examples/publications/2013MNRAS.429..895P/disk_script/boxedfi.py | rieder/amuse | 3ac3b6b8f922643657279ddee5c8ab3fc0440d5e | [
"Apache-2.0"
] | 102 | 2015-01-22T10:00:29.000Z | 2022-02-09T13:29:43.000Z |
from amuse.units import nbody_system
from amuse.units import units
import amuse.datamodel as core
from amuse.community.fi.interface import Fi
from amuse.ext.gasplummer import MakePlummerGasModel
if __name__=="__main__":
Ngas=1000
conv = nbody_system.nbody_to_si(100 | units.MSun, 1 | units.parsec)
dt=c... | 31.112903 | 69 | 0.713841 |
from amuse.units import nbody_system
from amuse.units import units
import amuse.datamodel as core
from amuse.community.fi.interface import Fi
from amuse.ext.gasplummer import MakePlummerGasModel
class BoxedFi(Fi):
def __init__(self, *args, **kargs):
Fi.__init__(self, *args, **kargs)
self.escapers=core.Pa... | 0 | 0 | 0 | 854 | 0 | 0 | 0 | 0 | 23 |
83e88dd4459f542726a672934178b4ea56ea199e | 56,803 | py | Python | coursebuilder/tests/functional/modules_notifications.py | nptel-ac-in/seek | 2bca9d64499e160b2da9bed6e97fcda712feec72 | [
"Apache-2.0"
] | null | null | null | coursebuilder/tests/functional/modules_notifications.py | nptel-ac-in/seek | 2bca9d64499e160b2da9bed6e97fcda712feec72 | [
"Apache-2.0"
] | null | null | null | coursebuilder/tests/functional/modules_notifications.py | nptel-ac-in/seek | 2bca9d64499e160b2da9bed6e97fcda712feec72 | [
"Apache-2.0"
] | 2 | 2020-09-29T17:04:18.000Z | 2021-05-13T07:07:04.000Z | # Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 44.170295 | 80 | 0.680351 | # Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 0 | 0 | 0 | 55,468 | 0 | 0 | 0 | 123 | 497 |
46bcc3151e80ad6b871ad05ca7572a0a93c0e44a | 5,705 | py | Python | start.py | adibalcan/crawlingbot | 9f2a8b13dccafcc07cf7760e1498cf51cf691277 | [
"MIT"
] | 1 | 2016-10-07T14:10:58.000Z | 2016-10-07T14:10:58.000Z | start.py | adibalcan/crawlingbot | 9f2a8b13dccafcc07cf7760e1498cf51cf691277 | [
"MIT"
] | null | null | null | start.py | adibalcan/crawlingbot | 9f2a8b13dccafcc07cf7760e1498cf51cf691277 | [
"MIT"
] | null | null | null | from poll import Poll
import threading
import time
import config
import gc
poll = Poll([])
# TEST WEBSITES
websites = [
'{"domain":"http://info-aschaffenburg.de"}',
'{"domain":"http://3dhouse.ir"}',
'{"domain":"http://tvblast.tv"}',
'{"domain":"http://templatekunena.co... | 30.837838 | 124 | 0.553024 | from website import Website
from poll import Poll
import threading
from pprint import pprint
import time
import sys
import os
import config
from utils import logutils, urlutils
import gc
import codecs
import json
from utils import queueconnection
poll = Poll([])
# TEST WEBSITES
websites = [
'{"domain":"h... | 0 | 0 | 0 | 0 | 0 | 3,440 | 0 | -4 | 314 |
118ec3ea7d998d58d8cce94b43fc3cc008c916cd | 288 | py | Python | apis/apis.py | huangtao1/moms | a3d1b46fba25d815c9a6e49622a026a7c2b4d3ae | [
"MIT"
] | null | null | null | apis/apis.py | huangtao1/moms | a3d1b46fba25d815c9a6e49622a026a7c2b4d3ae | [
"MIT"
] | 1 | 2020-08-07T03:12:18.000Z | 2020-08-07T03:12:18.000Z | apis/apis.py | huangtao1/moms | a3d1b46fba25d815c9a6e49622a026a7c2b4d3ae | [
"MIT"
] | null | null | null | from fastapi import APIRouter
from apis.login.controller import login_router
from apis.users.controller import user_router
api_router = APIRouter()
# router
api_router.include_router(login_router, tags=["login"])
api_router.include_router(user_router, prefix="/users", tags=["users"])
| 32 | 71 | 0.8125 | from fastapi import APIRouter
from apis.login.controller import login_router
from apis.users.controller import user_router
api_router = APIRouter()
# router注册
api_router.include_router(login_router, tags=["login"])
api_router.include_router(user_router, prefix="/users", tags=["users"])
| 6 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5c9e1391f65afcaf963110d47ee12c6730d53ef5 | 5,807 | py | Python | redshift_paper/code/red_sequence.py | jkadowaki/paper_plots | d52a4d8a5676d5d2e00fbda008c9ad7978e68d8c | [
"MIT"
] | null | null | null | redshift_paper/code/red_sequence.py | jkadowaki/paper_plots | d52a4d8a5676d5d2e00fbda008c9ad7978e68d8c | [
"MIT"
] | null | null | null | redshift_paper/code/red_sequence.py | jkadowaki/paper_plots | d52a4d8a5676d5d2e00fbda008c9ad7978e68d8c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from __future__ import print_function
import warnings
warnings.simplefilter("ignore", UserWarning)
warnings.filterwarnings("ignore", category=UserWarning)
import matplotlib.pyplot as plt
plt.rc('text', usetex=True)
font = {'family' : 'normal',
#'weight' : 'bold',
'size' : 16}
p... | 34.565476 | 87 | 0.536938 | #!/usr/bin/env python
from __future__ import print_function
import warnings
warnings.simplefilter("ignore", UserWarning)
warnings.filterwarnings("ignore", category=UserWarning)
import matplotlib.pyplot as plt
plt.rc('text', usetex=True)
font = {'family' : 'normal',
#'weight' : 'bold',
'size' : 16}
p... | 0 | 0 | 0 | 0 | 0 | 98 | 0 | 0 | 112 |
16059337346c2ac15f76e29a1a27545810562bc0 | 859 | py | Python | demandCustomize/cloudPlatform/migrations/0005_auto_20170516_1717.py | liushouyun/equipment | 58ff32679d03e9fc911204080d0c476a878a8cd6 | [
"Apache-2.0"
] | null | null | null | demandCustomize/cloudPlatform/migrations/0005_auto_20170516_1717.py | liushouyun/equipment | 58ff32679d03e9fc911204080d0c476a878a8cd6 | [
"Apache-2.0"
] | null | null | null | demandCustomize/cloudPlatform/migrations/0005_auto_20170516_1717.py | liushouyun/equipment | 58ff32679d03e9fc911204080d0c476a878a8cd6 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-05-16 17:17
from __future__ import unicode_literals
| 27.709677 | 53 | 0.633295 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.4 on 2017-05-16 17:17
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('cloudPlatform', '0004_auto_20170516_1716'),
]
operations = [
migrations.RenameField... | 0 | 0 | 0 | 688 | 0 | 0 | 0 | 11 | 46 |
3067db6dfd998246c0edb56d99751d7aad3113bc | 1,569 | py | Python | wrapi/endpoints/workflows.py | dtitkin/wrapi | d26f327abebb55ca6d2e099d2c76c75af9def888 | [
"MIT"
] | 7 | 2020-12-25T14:59:26.000Z | 2021-02-16T15:50:50.000Z | wrapi/endpoints/workflows.py | dtitkin/wrapi | d26f327abebb55ca6d2e099d2c76c75af9def888 | [
"MIT"
] | 7 | 2020-12-25T15:29:05.000Z | 2020-12-25T15:38:26.000Z | wrapi/endpoints/workflows.py | dtitkin/wrapi | d26f327abebb55ca6d2e099d2c76c75af9def888 | [
"MIT"
] | 1 | 2021-02-24T06:50:56.000Z | 2021-02-24T06:50:56.000Z | from __future__ import annotations
| 26.59322 | 110 | 0.681963 | from __future__ import annotations
from typing import Optional
from pydantic.fields import Field
from pydantic.types import StrictBool
from ..api import BodyParams, EndpointData
from ..types_.endpoint import BaseEndpoint
from ..types_.inputs import WorkflowCustomField
from ..types_.scalar import WorkflowId
class W... | 0 | 809 | 0 | 351 | 0 | 0 | 0 | 119 | 252 |
dbe91c7082a4f47da1a0853e77a437dc6a2e51be | 3,079 | py | Python | src/rpg_trajectory_evaluation/plot_utils.py | KevinYuan666/rpg_trajectory_evaluation | fbdf7001c6bab09d89c3219f6b46eba3e843fbb8 | [
"MIT"
] | null | null | null | src/rpg_trajectory_evaluation/plot_utils.py | KevinYuan666/rpg_trajectory_evaluation | fbdf7001c6bab09d89c3219f6b46eba3e843fbb8 | [
"MIT"
] | null | null | null | src/rpg_trajectory_evaluation/plot_utils.py | KevinYuan666/rpg_trajectory_evaluation | fbdf7001c6bab09d89c3219f6b46eba3e843fbb8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
"""
@author: Christian Forster
"""
from matplotlib import rc
rc('font', **{'family': 'serif', 'serif': ['Cardo']})
rc('text', usetex=True)
FORMAT = '.pdf'
| 32.755319 | 80 | 0.584281 | #!/usr/bin/env python2
"""
@author: Christian Forster
"""
import os
import yaml
import numpy as np
import matplotlib.pyplot as plt
import matplotlib as mpl
import matplotlib.lines as mlines
from mpl_toolkits.mplot3d import Axes3D
from matplotlib import rc
rc('font', **{'family': 'serif', 'serif': ['Cardo']})
rc('text'... | 0 | 0 | 0 | 0 | 0 | 2,583 | 0 | 18 | 293 |
847cf239602af5120935f6c6032925201ceda41e | 911 | py | Python | docs/conf.py | thurinj/mtuq | 8c539ac9da4c0e7eb72c5218b7818107c44fecc7 | [
"BSD-2-Clause"
] | 23 | 2019-09-20T16:51:05.000Z | 2022-03-28T18:09:56.000Z | docs/conf.py | thurinj/mtuq | 8c539ac9da4c0e7eb72c5218b7818107c44fecc7 | [
"BSD-2-Clause"
] | 14 | 2019-09-25T06:06:43.000Z | 2022-03-10T18:05:46.000Z | docs/conf.py | thurinj/mtuq | 8c539ac9da4c0e7eb72c5218b7818107c44fecc7 | [
"BSD-2-Clause"
] | 6 | 2019-12-13T12:55:28.000Z | 2022-02-03T18:10:30.000Z | import sys, os
sys.path.insert(0, os.path.abspath('.'))
extensions = [
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
]
# basic options
html_theme = 'bootstrap'
html_title = "MTUQ Documentation"
master_doc = 'index'
source_suffix = '.rst'
templat... | 21.186047 | 79 | 0.69045 | import sys, os
sys.path.insert(0, os.path.abspath('.'))
extensions = [
'sphinx.ext.intersphinx',
'sphinx.ext.viewcode',
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
]
# basic options
html_theme = 'bootstrap'
html_title = "MTUQ Documentation"
master_doc = 'index'
source_suffix = '.rst'
templat... | 0 | 0 | 0 | 0 | 0 | 53 | 0 | 0 | 23 |
e790262bf41ddded954477fa7139996f5897daf2 | 7,430 | py | Python | grapevine/models/__init__.py | craiglabenz/django-grapevine | d71d510814ba965fe836b3e6a522945e74c01120 | [
"MIT"
] | 7 | 2015-04-02T20:47:55.000Z | 2022-01-20T13:49:31.000Z | grapevine/models/__init__.py | craiglabenz/django-grapevine | d71d510814ba965fe836b3e6a522945e74c01120 | [
"MIT"
] | 3 | 2020-02-12T00:31:44.000Z | 2021-06-10T20:07:23.000Z | grapevine/models/__init__.py | craiglabenz/django-grapevine | d71d510814ba965fe836b3e6a522945e74c01120 | [
"MIT"
] | 2 | 2015-05-21T16:23:52.000Z | 2020-09-04T21:31:39.000Z | from __future__ import unicode_literals
# Django
# 3rd Party
# Local Apps
| 34.239631 | 113 | 0.619381 | from __future__ import unicode_literals
import uuid
import time
import traceback
# Django
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.models import ContentType
from django.db import models
from django.utils import timezone
# 3rd Party
import html2text
# Local Ap... | 0 | 2,608 | 0 | 4,402 | 0 | 0 | 0 | 96 | 245 |
c6f2a925670246a6ee9ba4d3618233e71c236fec | 6,548 | py | Python | localize_dataset.py | heruberuto/fact-checking | baa955eabaa60facf4ae83a6e8fc446cc3a8e9ba | [
"MIT"
] | 2 | 2020-05-17T10:23:37.000Z | 2022-02-19T08:33:23.000Z | localize_dataset.py | heruberuto/fact-checking | baa955eabaa60facf4ae83a6e8fc446cc3a8e9ba | [
"MIT"
] | null | null | null | localize_dataset.py | heruberuto/fact-checking | baa955eabaa60facf4ae83a6e8fc446cc3a8e9ba | [
"MIT"
] | 2 | 2020-06-23T12:36:24.000Z | 2022-02-19T08:33:37.000Z | # -*- coding: utf-8 -*-
import json
import sys
from google.cloud import translate_v3 # TODO: pip install google-cloud-translate
GOOGLE_CLIENT = translate_v3.TranslationServiceClient()
SOURCE_FILE, SOURCE_LANGUAGE, TARGET_FILE, TARGET_LANGUAGE = sys.stdin, "en", sys.stdout, "cs"
GOOGLE_PATH, GOOGLE_BUFFER_SIZE = GOOG... | 35.586957 | 151 | 0.595754 | # -*- coding: utf-8 -*-
import hashlib
import json
import os
import sys
import urllib
import requests
from slugify import slugify
from google.cloud import translate_v3 # TODO: pip install google-cloud-translate
GOOGLE_CLIENT = translate_v3.TranslationServiceClient()
SOURCE_FILE, SOURCE_LANGUAGE, TARGET_FILE, TARGET... | 0 | 0 | 0 | 0 | 0 | 3,984 | 0 | -27 | 295 |
80e51236d534df3020f53f4c43a575aa43aa9e3c | 37 | py | Python | tests/components/alert/__init__.py | domwillcode/home-assistant | f170c80bea70c939c098b5c88320a1c789858958 | [
"Apache-2.0"
] | 30,023 | 2016-04-13T10:17:53.000Z | 2020-03-02T12:56:31.000Z | tests/components/alert/__init__.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 31,101 | 2020-03-02T13:00:16.000Z | 2022-03-31T23:57:36.000Z | tests/components/alert/__init__.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 11,956 | 2016-04-13T18:42:31.000Z | 2020-03-02T09:32:12.000Z | """Tests for the alert component."""
| 18.5 | 36 | 0.675676 | """Tests for the alert component."""
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6474466d640187483ebed8410c6c2648e0b35e7f | 5,604 | py | Python | tests/test_handlers_collection.py | pjstanle/reV | c22c620749747022a65d2a98a99beef804849ee6 | [
"BSD-3-Clause"
] | 37 | 2020-03-04T05:24:23.000Z | 2022-02-24T14:39:49.000Z | tests/test_handlers_collection.py | pjstanle/reV | c22c620749747022a65d2a98a99beef804849ee6 | [
"BSD-3-Clause"
] | 174 | 2020-03-03T18:18:53.000Z | 2022-03-08T22:00:40.000Z | tests/test_handlers_collection.py | pjstanle/reV | c22c620749747022a65d2a98a99beef804849ee6 | [
"BSD-3-Clause"
] | 16 | 2020-08-10T13:43:36.000Z | 2021-11-19T22:43:36.000Z | # -*- coding: utf-8 -*-
"""
pytests for output collection
"""
import h5py
import numpy as np
import os
import pytest
import tempfile
from reV.handlers.collection import Collector
from reV import TESTDATADIR
from rex.utilities.loggers import init_logger
TEMP_DIR = os.path.join(TESTDATADIR, 'ri_gen_collect')
H5_DIR = ... | 32.393064 | 76 | 0.597074 | # -*- coding: utf-8 -*-
"""
pytests for output collection
"""
import h5py
import numpy as np
import os
import pytest
import tempfile
from reV.handlers.collection import Collector
from reV import TESTDATADIR
from rex.utilities.loggers import init_logger
TEMP_DIR = os.path.join(TESTDATADIR, 'ri_gen_collect')
H5_DIR = ... | 0 | 0 | 0 | 0 | 0 | 176 | 0 | 0 | 34 |
2eae246c4669ee791e0146fa0902aee50b368ca4 | 1,382 | py | Python | calculadora.py | pangoro24/calculadora-python | 213aaa6893ffb6025b17ca37b88d3d51253c0bd5 | [
"MIT"
] | null | null | null | calculadora.py | pangoro24/calculadora-python | 213aaa6893ffb6025b17ca37b88d3d51253c0bd5 | [
"MIT"
] | null | null | null | calculadora.py | pangoro24/calculadora-python | 213aaa6893ffb6025b17ca37b88d3d51253c0bd5 | [
"MIT"
] | null | null | null |
#in module
#main functions
if __name__ == '__main__':
main()
| 20.626866 | 88 | 0.523878 | import os
import sys
import time
import datetime
import asyncio
import logging #.log
#in module
class cal():
def __init__(self,a,b):
self.a=a
self.b=b
def add(self):
return self.a+self.b
def mul(self):
return self.a*self.b
def div(self):
return self.a/self.b
... | 0 | 0 | 0 | 245 | 0 | 881 | 0 | -53 | 229 |
815554c4970720f433ad11e6f21207c937d3b0cd | 513 | py | Python | setup.py | simongarisch/pdf_hunter | 84486a15737659c9c5039f1c8b2d4d49d48cb7e6 | [
"MIT"
] | null | null | null | setup.py | simongarisch/pdf_hunter | 84486a15737659c9c5039f1c8b2d4d49d48cb7e6 | [
"MIT"
] | null | null | null | setup.py | simongarisch/pdf_hunter | 84486a15737659c9c5039f1c8b2d4d49d48cb7e6 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(
name="pdf_hunter",
version="0.1.6",
author="Simon Garisch",
author_email="gatman946@gmail.com",
description="Download PDF links from a webpage",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
... | 30.176471 | 67 | 0.699805 | from setuptools import setup, find_packages
setup(
name="pdf_hunter",
version="0.1.6",
author="Simon Garisch",
author_email="gatman946@gmail.com",
description="Download PDF links from a webpage",
long_description=open("README.md").read(),
long_description_content_type="text/markdown",
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8532c99e8a8433241294b42f1d47108571d2bbf0 | 983 | py | Python | tokens.py | manuel-io/minicloud | bdf6a08709f5c9d0d92caddc1c719c438b6970ce | [
"MIT"
] | 1 | 2021-01-15T02:10:32.000Z | 2021-01-15T02:10:32.000Z | tokens.py | manuel-io/minicloud | bdf6a08709f5c9d0d92caddc1c719c438b6970ce | [
"MIT"
] | 3 | 2020-06-13T00:02:13.000Z | 2021-09-12T13:20:16.000Z | tokens.py | manuel-io/minicloud | bdf6a08709f5c9d0d92caddc1c719c438b6970ce | [
"MIT"
] | null | null | null | import psycopg2
| 27.305556 | 78 | 0.571719 | import sys, psycopg2, psycopg2.extras
def generate(user_id, db):
try:
with db.cursor(cursor_factory = psycopg2.extras.DictCursor) as cursor:
cursor.execute("""
INSERT INTO minicloud_auths (user_id) VALUES (%s) RETURNING token
""", [int(user_id)])
data = curs... | 0 | 0 | 0 | 0 | 0 | 899 | 0 | 22 | 46 |
948236d16aa61cbe37c905d506ddbade94c22df4 | 4,193 | py | Python | PELEpharmacophore/analysis/meanshift_analyzer.py | martimunicoy/PELEpharmacophore | e571688e9e4ceec48a77e0bb1486ba8c0a54e773 | [
"MIT"
] | 4 | 2021-02-10T12:18:00.000Z | 2022-03-23T10:34:34.000Z | PELEpharmacophore/analysis/meanshift_analyzer.py | martimunicoy/PELEpharmacophore | e571688e9e4ceec48a77e0bb1486ba8c0a54e773 | [
"MIT"
] | 4 | 2021-02-26T10:43:52.000Z | 2021-03-29T10:26:52.000Z | PELEpharmacophore/analysis/meanshift_analyzer.py | martimunicoy/PELEpharmacophore | e571688e9e4ceec48a77e0bb1486ba8c0a54e773 | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
target = MeanshiftAnalyzer("/home/ana/GitRepositories/PELEpharmacophore/tests/data/simulation_1")
target.set_ligand("L", "SB2", 800)
#features={'HBD': ['NC1'], 'HBA': ['NB1', 'NC3', 'O2'], 'ALI': ['FD3', 'C1'], 'ARO': ['CA5', 'CD1']}
#features={'NEG': ['C2'], 'ALI': ['C1']}
... | 36.780702 | 147 | 0.606487 | import os
import numpy as np
from itertools import chain
from sklearn.cluster import MeanShift
import PELEpharmacophore.helpers as hl
import PELEpharmacophore.analysis.simulation_analyzer as sa
import PELEpharmacophore.output.pharmacophore_writer as pw
class MeanshiftAnalyzer(sa.SimulationAnalyzer):
"""
Class ... | 0 | 0 | 0 | 3,070 | 0 | 0 | 0 | 99 | 200 |
f2030100c34e5c8ed097b6486ed9204a8385dd41 | 7,573 | py | Python | tests/test_stack.py | astamiviswakarma/yowsup-celery | 75f8edf8832ab1c3370e58a049a2e74e1691276e | [
"ISC"
] | null | null | null | tests/test_stack.py | astamiviswakarma/yowsup-celery | 75f8edf8832ab1c3370e58a049a2e74e1691276e | [
"ISC"
] | null | null | null | tests/test_stack.py | astamiviswakarma/yowsup-celery | 75f8edf8832ab1c3370e58a049a2e74e1691276e | [
"ISC"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
try:
from unittest import mock
except ImportError:
| 36.408654 | 113 | 0.644923 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import unittest
import inspect
import threading
from yowsup.layers.interface import YowInterfaceLayer
from yowsup.layers.network import YowNetworkLayer
from yowsup.layers import YowLayerEvent, EventCallback
from tests.utils import success_protocol_entity, failure_protocol_... | 0 | 1,140 | 0 | 5,699 | 0 | 0 | 0 | 289 | 328 |
f2f1a25d5b65a458058174313de40e7340d092e8 | 7,848 | py | Python | factual/KEQA_WSDM19/augment_process_dataset.py | hasnain2808/transfer-learning-conv-ai | ed19a12d2e4fb4e79c8aff55b402ebbdf3180891 | [
"MIT"
] | null | null | null | factual/KEQA_WSDM19/augment_process_dataset.py | hasnain2808/transfer-learning-conv-ai | ed19a12d2e4fb4e79c8aff55b402ebbdf3180891 | [
"MIT"
] | null | null | null | factual/KEQA_WSDM19/augment_process_dataset.py | hasnain2808/transfer-learning-conv-ai | ed19a12d2e4fb4e79c8aff55b402ebbdf3180891 | [
"MIT"
] | null | null | null | import argparse
#import logging
#from nltk.tokenize.treebank import TreebankWordTokenizer
#tokenizer = TreebankWordTokenizer()
#logger = logging.getLogger()
#logger.disabled = True
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Augment dataset with line ids, shorted names, entity names')
... | 41.967914 | 134 | 0.549439 | import os
import sys
import argparse
import re
#import logging
from fuzzywuzzy import process, fuzz
#from nltk.tokenize.treebank import TreebankWordTokenizer
from util import www2fb, processed_text
#tokenizer = TreebankWordTokenizer()
#logger = logging.getLogger()
#logger.disabled = True
def get_indices(src_list, pat... | 0 | 0 | 0 | 0 | 0 | 6,784 | 0 | -2 | 203 |
70ab76905ed1d1430074cacbd4a76211b0b55312 | 1,833 | py | Python | options/base_options.py | Zetinator/car_classificator | b8ea88cb1d3b8000001666bbe6ba97b14512ce95 | [
"MIT"
] | null | null | null | options/base_options.py | Zetinator/car_classificator | b8ea88cb1d3b8000001666bbe6ba97b14512ce95 | [
"MIT"
] | null | null | null | options/base_options.py | Zetinator/car_classificator | b8ea88cb1d3b8000001666bbe6ba97b14512ce95 | [
"MIT"
] | null | null | null | """general options to pass when initializing
all the options you would pass to the command line are here
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
| 47 | 150 | 0.695035 | """general options to pass when initializing
all the options you would pass to the command line are here
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import argparse
import os
class BaseOptions():
def __init__(self):
self.parser = argpar... | 0 | 0 | 0 | 1,564 | 0 | 0 | 0 | -18 | 68 |
81ec0744f667cdd629824bda551a8e12e6aa655b | 11,613 | py | Python | kivy/storage/__init__.py | Sentient07/kivy | e5022e1cc84b1bcda6e4619d618509dc4ea7da04 | [
"MIT"
] | 317 | 2015-07-30T07:47:41.000Z | 2022-03-30T00:38:39.000Z | kivy/storage/__init__.py | Sentient07/kivy | e5022e1cc84b1bcda6e4619d618509dc4ea7da04 | [
"MIT"
] | 42 | 2015-07-30T10:32:46.000Z | 2021-11-23T02:44:47.000Z | kivy/storage/__init__.py | Sentient07/kivy | e5022e1cc84b1bcda6e4619d618509dc4ea7da04 | [
"MIT"
] | 69 | 2015-08-04T03:27:30.000Z | 2021-12-27T09:53:26.000Z | '''
Storage
=======
.. versionadded:: 1.7.0
.. warning::
This module is still experimental, and the API is subject to change in a
future version.
Usage
-----
The idea behind the Storage module is to be able to load/store any number of
key/value pairs via an indexed key. The default model is abstract so you... | 28.74505 | 79 | 0.598037 | '''
Storage
=======
.. versionadded:: 1.7.0
.. warning::
This module is still experimental, and the API is subject to change in a
future version.
Usage
-----
The idea behind the Storage module is to be able to load/store any number of
key/value pairs via an indexed key. The default model is abstract so you... | 0 | 0 | 0 | 8,249 | 0 | 0 | 0 | 32 | 90 |
3c910a0e566c395a70b82e96d4a2af36a8603315 | 2,221 | py | Python | tests/gpflow/experimental/check_shapes/utils.py | uri-granta/GPflow | 94b432847cb82c7627a57987f5c5ddd7fc400414 | [
"Apache-2.0"
] | null | null | null | tests/gpflow/experimental/check_shapes/utils.py | uri-granta/GPflow | 94b432847cb82c7627a57987f5c5ddd7fc400414 | [
"Apache-2.0"
] | null | null | null | tests/gpflow/experimental/check_shapes/utils.py | uri-granta/GPflow | 94b432847cb82c7627a57987f5c5ddd7fc400414 | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 The GPflow Contributors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 32.661765 | 100 | 0.716344 | # Copyright 2022 The GPflow Contributors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 0 | 18 | 0 | 0 | 0 | 900 | 0 | 211 | 135 |
afb3bfa7c4fa9f5831d7c859243bcd092e2714e9 | 3,492 | py | Python | Detectron2_COCO_DataSegmentation_from_Marine_checkpoints.py | Philliec459/Marine-Object-Detection-using-Detectron2-with-Nautical-Training-Weights | f1ee9041502a60cf735e638b3d426521f2c5c7bb | [
"MIT"
] | 8 | 2020-08-17T03:11:40.000Z | 2022-02-19T10:36:37.000Z | Detectron2_COCO_DataSegmentation_from_Marine_checkpoints.py | Philliec459/Marine-Object-Detection-using-Detectron2-with-Nautical-Training-Weights | f1ee9041502a60cf735e638b3d426521f2c5c7bb | [
"MIT"
] | null | null | null | Detectron2_COCO_DataSegmentation_from_Marine_checkpoints.py | Philliec459/Marine-Object-Detection-using-Detectron2-with-Nautical-Training-Weights | f1ee9041502a60cf735e638b3d426521f2c5c7bb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
First, Import all variables
"""
from detectron2.data import DatasetCatalog, MetadataCatalog
import matplotlib.pyplot as plt
import random
import os
import cv2
#from detectron2.engine import DefaultTrainer
from detectron2.utils.visualizer i... | 26.059701 | 130 | 0.670103 | # -*- coding: utf-8 -*-
"""
Spyder Editor
This is a temporary script file.
First, Import all variables
"""
import detectron2
from detectron2.data import DatasetCatalog, MetadataCatalog
import matplotlib.pyplot as plt
import random
import os
import cv2
#from detectron2.engine import DefaultTrainer
from detectron2.... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 14 | 67 |
61a8d0fcd16a4770213c58e7d643b0019afedb08 | 761 | py | Python | saleor/page/migrations/0009_auto_20190412_1551.py | ruszhov/saleor-shop | df0c27c61055a0f20eb27fe2aa5082970397f553 | [
"BSD-3-Clause"
] | null | null | null | saleor/page/migrations/0009_auto_20190412_1551.py | ruszhov/saleor-shop | df0c27c61055a0f20eb27fe2aa5082970397f553 | [
"BSD-3-Clause"
] | 5 | 2021-03-09T16:22:37.000Z | 2022-02-10T19:10:03.000Z | saleor/page/migrations/0009_auto_20190412_1551.py | ruszhov/saleor-shop | df0c27c61055a0f20eb27fe2aa5082970397f553 | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 2.1.7 on 2019-04-12 12:51
| 30.44 | 135 | 0.65046 | # Generated by Django 2.1.7 on 2019-04-12 12:51
import django.core.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('page', '0008_auto_20190412_1539'),
]
operations = [
migrations.AlterField(
model_name='page',
... | 0 | 0 | 0 | 617 | 0 | 0 | 0 | 27 | 68 |
fee1345b57bfa234446432c91e727e47ea648547 | 853 | py | Python | sample.py | tecdan/NCE_Alias_Sampling | 25c568ca347130c73f9bddcc13cfbe21adc72951 | [
"MIT"
] | null | null | null | sample.py | tecdan/NCE_Alias_Sampling | 25c568ca347130c73f9bddcc13cfbe21adc72951 | [
"MIT"
] | null | null | null | sample.py | tecdan/NCE_Alias_Sampling | 25c568ca347130c73f9bddcc13cfbe21adc72951 | [
"MIT"
] | null | null | null | """A minimal sample script for illustration of basic usage of NCE module"""
import torch
from nce import IndexLinear
class_freq = [0, 2, 2, 3, 4, 5, 6] # an unigram class probability
freq_count = torch.FloatTensor(class_freq)
print("total counts for all tokens:", freq_count.sum())
noise = freq_count / freq_count.sum... | 28.433333 | 75 | 0.732708 | """A minimal sample script for illustration of basic usage of NCE module"""
import torch
from nce import IndexLinear
class_freq = [0, 2, 2, 3, 4, 5, 6] # an unigram class probability
freq_count = torch.FloatTensor(class_freq)
print("total counts for all tokens:", freq_count.sum())
noise = freq_count / freq_count.sum... | 108 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1a05d880645ff330017fcf9d64141136e59cc1a9 | 259 | py | Python | tests/detector/config_module_does_not_inherit/__init__.py | dadaloop82/viseron | 1c6c446a4856e16c0e2ed6b9323d169fbdcae20f | [
"MIT"
] | 399 | 2020-08-31T21:13:07.000Z | 2022-03-31T18:54:26.000Z | tests/detector/config_module_does_not_inherit/__init__.py | dadaloop82/viseron | 1c6c446a4856e16c0e2ed6b9323d169fbdcae20f | [
"MIT"
] | 157 | 2020-09-01T18:59:56.000Z | 2022-03-25T07:14:19.000Z | tests/detector/config_module_does_not_inherit/__init__.py | dadaloop82/viseron | 1c6c446a4856e16c0e2ed6b9323d169fbdcae20f | [
"MIT"
] | 53 | 2020-09-01T07:35:59.000Z | 2022-03-28T23:21:16.000Z | """Dummy Config class that does not inherit from AbstractDetectorConfig."""
| 37 | 79 | 0.814672 | """Dummy Config class that does not inherit from AbstractDetectorConfig."""
from viseron.detector import AbstractObjectDetection
class ObjectDetection(AbstractObjectDetection):
"""Dummy Config class that does not inherit from AbstractDetectorConfig."""
| 0 | 0 | 0 | 106 | 0 | 0 | 0 | 31 | 45 |
84a067f42711764638f792974b5f89168d1ceea8 | 12,393 | py | Python | SS04_feature_ML_regres.py | neuropheno-org/DeepNMA | ee861b0037ccb922b40c8de5dfff1651cd2b63ca | [
"MIT"
] | null | null | null | SS04_feature_ML_regres.py | neuropheno-org/DeepNMA | ee861b0037ccb922b40c8de5dfff1651cd2b63ca | [
"MIT"
] | 8 | 2020-08-12T23:20:03.000Z | 2020-10-12T20:01:30.000Z | SS04_feature_ML_regres.py | neuropheno-org/DeepNMA | ee861b0037ccb922b40c8de5dfff1651cd2b63ca | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 15 13:49:04 2020
@author: adonay
"""
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import csv
import seaborn as sns
from sklearn.model_selection import cross_val_predict
from sklearn.linear_model import (RidgeCV)
import u... | 36.66568 | 145 | 0.574195 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Oct 15 13:49:04 2020
@author: adonay
"""
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import csv
import seaborn as sns
from sklearn import linear_model, preprocessing
from sklearn.model_selection import cross_val_score, cros... | 0 | 0 | 0 | 0 | 0 | 996 | 0 | 431 | 179 |
77af834c35cb2e4081c2e99ab4f882181a4b4169 | 8,230 | py | Python | anvil/main.py | DataBiosphere/FHIR-Implementation | 7e8b8d5b21a08e46ffd8ab7c8df59ba99f4e0b1d | [
"MIT"
] | 6 | 2020-10-28T14:49:08.000Z | 2021-07-17T15:23:10.000Z | anvil/main.py | DataBiosphere/FHIR-Implementation | 7e8b8d5b21a08e46ffd8ab7c8df59ba99f4e0b1d | [
"MIT"
] | 5 | 2021-01-13T21:16:06.000Z | 2021-01-29T17:34:02.000Z | anvil/main.py | DataBiosphere/FHIR-Implementation | 7e8b8d5b21a08e46ffd8ab7c8df59ba99f4e0b1d | [
"MIT"
] | null | null | null | import os
import logging
import json
from dotenv import load_dotenv
from anvil.gen3.entities import Entities
from anvil.terra.workspace import Workspace
from anvil.transformers.fhir.transformer import FhirTransformer
load_dotenv()
AVRO_PATH = os.getenv('AVRO_PATH', './export_2020-11-04T17_48_47.avro')
OUTPUT_DIR = ... | 37.752294 | 217 | 0.639368 | import os
import logging
import json
from dotenv import load_dotenv
from anvil.gen3.entities import Entities
from anvil.terra.reconciler import Reconciler
from anvil.terra.workspace import Workspace
from anvil.terra.sample import Sample
from anvil.transformers.fhir.transformer import FhirTransformer
from anvil.util.r... | 0 | 0 | 0 | 0 | 1,712 | 1,821 | 0 | 196 | 313 |
df6a551f8c1a2a2d3bbed9bd228d97e5fb188b54 | 2,069 | py | Python | marley/sharknado/int_crowding/functions.py | cool-RR/grid_royale | 26e2614eb9b986e9bee180e85edfa9a955b6cc8f | [
"MIT"
] | 255 | 2020-10-11T08:36:17.000Z | 2021-04-18T16:10:38.000Z | marley/sharknado/int_crowding/functions.py | cool-RR/marley | fcc39de8964eaf1a28872173538c17ea246591b3 | [
"MIT"
] | 24 | 2020-10-11T08:38:21.000Z | 2021-01-23T16:33:41.000Z | marley/sharknado/int_crowding/functions.py | cool-RR/marley | fcc39de8964eaf1a28872173538c17ea246591b3 | [
"MIT"
] | 29 | 2020-10-11T10:55:30.000Z | 2021-09-21T16:44:20.000Z | # Copyright 2020 Ram Rachum and collaborators.
# This program is distributed under the MIT license.
from __future__ import annotations
from .. import int_crowding
| 39.788462 | 100 | 0.620106 | # Copyright 2020 Ram Rachum and collaborators.
# This program is distributed under the MIT license.
from __future__ import annotations
import itertools
from .pointing import Point
from .. import int_crowding
def intervals_to_points(intervals: Iterable[int_crowding.Interval]) -> Tuple[Point, ...]:
return tuple(... | 0 | 0 | 0 | 0 | 0 | 1,786 | 0 | 1 | 115 |
c482362238b49b7475397377992f5eba9f900d4f | 531 | py | Python | 0x0B-python-input_output/10-class_to_json.py | FatChicken277/holbertonschool-higher_level_programming | 520d6310a5e2a874f8c5f5185d0fb769b6412e7c | [
"CNRI-Python"
] | null | null | null | 0x0B-python-input_output/10-class_to_json.py | FatChicken277/holbertonschool-higher_level_programming | 520d6310a5e2a874f8c5f5185d0fb769b6412e7c | [
"CNRI-Python"
] | null | null | null | 0x0B-python-input_output/10-class_to_json.py | FatChicken277/holbertonschool-higher_level_programming | 520d6310a5e2a874f8c5f5185d0fb769b6412e7c | [
"CNRI-Python"
] | null | null | null | #!/usr/bin/python3
"""This module contains a function that returns the dictionary
description with simple data structure (list, dictionary, string,
integer and boolean) for JSON serialization of an object.
"""
def class_to_json(obj):
"""Returns the dictionary description with simple data
structure (li... | 26.55 | 69 | 0.700565 | #!/usr/bin/python3
"""This module contains a function that returns the dictionary
description with simple data structure (list, dictionary, string,
integer and boolean) for JSON serialization of an object.
"""
def class_to_json(obj):
"""Returns the dictionary description with simple data
structure (li... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1147f50a4979bf62aa76fd748614fbf7f6fd7db1 | 1,756 | py | Python | 2021/day-09/day-09.py | mrMetalWood/advent-of-code | b850aa50474c622e23e924c5da53775b4cae05b2 | [
"MIT"
] | 1 | 2018-12-02T12:38:31.000Z | 2018-12-02T12:38:31.000Z | 2021/day-09/day-09.py | mrMetalWood/advent-of-code | b850aa50474c622e23e924c5da53775b4cae05b2 | [
"MIT"
] | 7 | 2020-07-16T14:03:31.000Z | 2020-12-02T10:46:49.000Z | 2021/day-09/day-09.py | mrMetalWood/advent-of-code | b850aa50474c622e23e924c5da53775b4cae05b2 | [
"MIT"
] | null | null | null | from collections import defaultdict
import os
with open(os.path.join(os.path.dirname(__file__), "input.txt"), "r") as file:
rows = [l.strip() for l in file.readlines()]
grid = defaultdict(lambda: 9)
for y, row in enumerate(rows):
for x, col in enumerate(row):
grid[(x, y)] = int(col)
... | 26.208955 | 83 | 0.538155 | from collections import defaultdict
from collections import deque
import os
with open(os.path.join(os.path.dirname(__file__), "input.txt"), "r") as file:
rows = [l.strip() for l in file.readlines()]
grid = defaultdict(lambda: 9)
for y, row in enumerate(rows):
for x, col in enumerate(row):
... | 0 | 0 | 0 | 0 | 0 | 1,184 | 0 | 8 | 68 |
0be01d2a4ffbf97e41fa2c0073959b968ce3fe91 | 12,984 | py | Python | phylotoast/test/test_biom_calc.py | bhawan1/phylotoast | 87d4b00f5da30855b9eb05398f2f605dcf61de38 | [
"MIT"
] | 19 | 2015-07-11T18:22:45.000Z | 2022-02-05T19:57:49.000Z | phylotoast/test/test_biom_calc.py | bhawan1/phylotoast | 87d4b00f5da30855b9eb05398f2f605dcf61de38 | [
"MIT"
] | 16 | 2015-12-24T22:11:54.000Z | 2021-12-18T20:26:17.000Z | phylotoast/test/test_biom_calc.py | bhawan1/phylotoast | 87d4b00f5da30855b9eb05398f2f605dcf61de38 | [
"MIT"
] | 7 | 2016-01-07T02:34:26.000Z | 2019-10-24T22:03:54.000Z | #!/usr/bin/env python
"""
:Author: Akshay Paropkari
:Date Created: 10/15/2014
:Abstract: Automated Tests for BIOM calculation.
"""
import unittest
if __name__ == "__main__":
unittest.main()
| 49.557252 | 90 | 0.527418 | #!/usr/bin/env python
"""
:Author: Akshay Paropkari
:Date Created: 10/15/2014
:Abstract: Automated Tests for BIOM calculation.
"""
import math
import unittest
from phylotoast import biom_calc as bc
from biom import load_table
class biom_calc_Test(unittest.TestCase):
def setUp(self):
"""
Initializi... | 0 | 0 | 0 | 12,686 | 0 | 0 | 0 | 13 | 89 |
d2f61e71cc9ddff50d82b5ffc5aa52a2502c25fa | 2,369 | py | Python | tests/event_broker/test_publish_and_subscribe.py | filfreire/questions-three | 1d1d621d5647407bf2d1b271e0b9c7c9f1afc5c8 | [
"MIT"
] | 5 | 2019-07-22T06:04:07.000Z | 2021-07-23T06:01:51.000Z | tests/event_broker/test_publish_and_subscribe.py | filfreire/questions-three | 1d1d621d5647407bf2d1b271e0b9c7c9f1afc5c8 | [
"MIT"
] | 15 | 2020-07-28T17:33:40.000Z | 2021-08-23T17:30:05.000Z | tests/event_broker/test_publish_and_subscribe.py | filfreire/questions-three | 1d1d621d5647407bf2d1b271e0b9c7c9f1afc5c8 | [
"MIT"
] | 4 | 2019-08-25T22:41:59.000Z | 2020-10-21T14:28:15.000Z | from unittest import main
if "__main__" == __name__:
main()
| 32.902778 | 75 | 0.693964 | from unittest import TestCase, main
from expects import expect, be_empty, have_length
from questions_three.event_broker import EventBroker
from twin_sister.expects_matchers import contain_all_items_in
class Subscriber:
def __init__(self, event=None):
self.received = []
if event:
self... | 0 | 0 | 0 | 2,078 | 0 | 0 | 0 | 109 | 114 |
0757f824769c9f20fb6044e378da5849a0c46cff | 1,230 | py | Python | alarms_project/models.py | hussu97/alarmous | 09bee975db56703ffd54602b50823f17f11613bf | [
"Apache-1.1"
] | 3 | 2019-08-19T10:43:51.000Z | 2021-12-12T00:25:43.000Z | alarms_project/models.py | hussu97/alarmous | 09bee975db56703ffd54602b50823f17f11613bf | [
"Apache-1.1"
] | 2 | 2020-06-05T22:25:20.000Z | 2021-06-10T21:49:37.000Z | alarms_project/models.py | hussu97/alarmous | 09bee975db56703ffd54602b50823f17f11613bf | [
"Apache-1.1"
] | null | null | null | import rules
rules.add_rule('can_edit_alarm',is_alarm_creator)
rules.add_perm('alarm.edit_alarm', is_alarm_creator)
# Create your models here. | 37.272727 | 122 | 0.713008 | from django.db import models
from django.contrib.auth.models import User
from rules.contrib.models import RulesModel
import rules
@rules.predicate
def is_alarm_creator(user, alarm):
return alarm.creator == user
rules.add_rule('can_edit_alarm',is_alarm_creator)
rules.add_perm('alarm.edit_alarm', is_alarm_creator)
#... | 0 | 63 | 0 | 840 | 0 | 0 | 0 | 51 | 134 |
4444fafcfd80f6cf8e33443f33af1a304aa4f7f4 | 259 | py | Python | catalog/views/__init__.py | iraquitan/catalog-app-flask | 563981ddc8d55c62428cd4811bdea73ee8f8a846 | [
"MIT"
] | null | null | null | catalog/views/__init__.py | iraquitan/catalog-app-flask | 563981ddc8d55c62428cd4811bdea73ee8f8a846 | [
"MIT"
] | null | null | null | catalog/views/__init__.py | iraquitan/catalog-app-flask | 563981ddc8d55c62428cd4811bdea73ee8f8a846 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
* Created by PyCharm.
* Project: catalog
* Author name: Iraquitan Cordeiro Filho
* Author login: pma007
* File: __init__.py
* Date: 2/23/16
* Time: 14:39
* To change this templates use File | Settings | File Templates.
"""
| 21.583333 | 65 | 0.65251 | # -*- coding: utf-8 -*-
"""
* Created by PyCharm.
* Project: catalog
* Author name: Iraquitan Cordeiro Filho
* Author login: pma007
* File: __init__.py
* Date: 2/23/16
* Time: 14:39
* To change this templates use File | Settings | File Templates.
"""
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
62936fa4851bbc68bf94e196429cab47093a48bf | 2,394 | py | Python | src/UC_AST.py | chjon/UnitConvertor | b02e4248a7069940763df9d390bb9344990a8ff8 | [
"MIT"
] | null | null | null | src/UC_AST.py | chjon/UnitConvertor | b02e4248a7069940763df9d390bb9344990a8ff8 | [
"MIT"
] | 9 | 2020-12-16T21:06:25.000Z | 2020-12-26T17:43:23.000Z | src/UC_AST.py | chjon/UnitConvertor | b02e4248a7069940763df9d390bb9344990a8ff8 | [
"MIT"
] | null | null | null | import src.UC_Common as UC_Common
import src.UC_Unit as UC_Unit | 27.204545 | 75 | 0.718881 | import src.UC_Common as UC_Common
import src.UC_Unit as UC_Unit
class AST_Add:
def __init__(self, left, right):
self.left = left
self.right = right
def __str__(self):
return f"({str(self.left)} + {str(self.right)})"
def evaluate(self, convertor):
leftResult = self.left.evaluate(convertor)
rightResult =... | 0 | 0 | 0 | 2,193 | 0 | 0 | 0 | 0 | 138 |
5c455c17ba57bacc56474dffb826adbecb46a242 | 8,083 | py | Python | karesansui/urls.py | Kairiw/karesansui | d5a3acfe40b3953fb4f8d6f51e30d0307309a6ee | [
"MIT"
] | 54 | 2015-01-09T16:49:34.000Z | 2022-02-03T10:08:30.000Z | karesansui/urls.py | Kairiw/karesansui | d5a3acfe40b3953fb4f8d6f51e30d0307309a6ee | [
"MIT"
] | 2 | 2016-02-22T08:23:36.000Z | 2021-05-10T04:13:01.000Z | karesansui/urls.py | Kairiw/karesansui | d5a3acfe40b3953fb4f8d6f51e30d0307309a6ee | [
"MIT"
] | 27 | 2015-08-21T13:33:49.000Z | 2021-11-19T02:56:20.000Z | # -*- coding: utf-8 -*-
#
# This file is part of Karesansui Core.
#
# Copyright (C) 2009-2012 HDE, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including withou... | 43.224599 | 79 | 0.783249 | # -*- coding: utf-8 -*-
#
# This file is part of Karesansui Core.
#
# Copyright (C) 2009-2012 HDE, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including withou... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
92a3d2de462fdebf1fdaf1414141fd87e81bd746 | 1,555 | py | Python | pyy1/.pycharm_helpers/python_stubs/-1550516950/apt_pkg/Hashes.py | pyy1988/pyy_test1 | 6bea878409e658aa87441384419be51aaab061e7 | [
"Apache-2.0"
] | null | null | null | pyy1/.pycharm_helpers/python_stubs/-1550516950/apt_pkg/Hashes.py | pyy1988/pyy_test1 | 6bea878409e658aa87441384419be51aaab061e7 | [
"Apache-2.0"
] | null | null | null | pyy1/.pycharm_helpers/python_stubs/-1550516950/apt_pkg/Hashes.py | pyy1988/pyy_test1 | 6bea878409e658aa87441384419be51aaab061e7 | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
# module apt_pkg
# from /usr/lib/python3/dist-packages/apt_pkg.cpython-35m-x86_64-linux-gnu.so
# by generator 1.145
"""
Classes and functions wrapping the apt-pkg library.
The apt_pkg module provides several classes and functions for accessing
the functionality provided by the apt-pkg library. Typica... | 33.804348 | 106 | 0.69582 | # encoding: utf-8
# module apt_pkg
# from /usr/lib/python3/dist-packages/apt_pkg.cpython-35m-x86_64-linux-gnu.so
# by generator 1.145
"""
Classes and functions wrapping the apt-pkg library.
The apt_pkg module provides several classes and functions for accessing
the functionality provided by the apt-pkg library. Typica... | 0 | 176 | 0 | 882 | 0 | 0 | 0 | 5 | 46 |
b06da22c601e6159b7da1fca0a42f25158675e55 | 16,626 | py | Python | pycatia/navigator_interfaces/marker_2D.py | evereux/catia_python | 08948585899b12587b0415ce3c9191a408b34897 | [
"MIT"
] | 90 | 2019-02-21T10:05:28.000Z | 2022-03-19T01:53:41.000Z | pycatia/navigator_interfaces/marker_2D.py | Luanee/pycatia | ea5eef8178f73de12404561c00baf7a7ca30da59 | [
"MIT"
] | 99 | 2019-05-21T08:29:12.000Z | 2022-03-25T09:55:15.000Z | pycatia/navigator_interfaces/marker_2D.py | Luanee/pycatia | ea5eef8178f73de12404561c00baf7a7ca30da59 | [
"MIT"
] | 26 | 2019-04-04T06:31:36.000Z | 2022-03-30T07:24:47.000Z | #! usr/bin/python3.6
"""
Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-06-11 12:40:47.360445
.. warning::
The notes denoted "CAA V5 Visual Basic Help" are to be used as reference only.
They are there as a guide as to how the visual basic / catscript function... | 34.13963 | 111 | 0.444003 | #! usr/bin/python3.6
"""
Module initially auto generated using V5Automation files from CATIA V5 R28 on 2020-06-11 12:40:47.360445
.. warning::
The notes denoted "CAA V5 Visual Basic Help" are to be used as reference only.
They are there as a guide as to how the visual basic / catscript function... | 0 | 7,827 | 0 | 8,331 | 0 | 0 | 0 | 37 | 46 |
1cbab6cea657ea64358c863eede9d7bcb5bce467 | 5,115 | py | Python | CAIL2020/htfltpu/install/pytorch-xla-env-setup.py | ShenDezhou/CAIL | c4cfa98ab4ecedbce34a7a5a186830486047540c | [
"Apache-2.0"
] | 71 | 2020-07-16T01:49:27.000Z | 2022-03-27T16:55:00.000Z | CAIL2020/htfltpu/install/pytorch-xla-env-setup.py | ShenDezhou/CAIL | c4cfa98ab4ecedbce34a7a5a186830486047540c | [
"Apache-2.0"
] | 11 | 2020-09-18T14:26:25.000Z | 2022-02-09T23:49:33.000Z | __explorations__/2020_31/pytorch-xla-env-setup.py | tyoc213/blog | ebabd6f4d2fe2791f22c348e0a97184120acea28 | [
"Apache-2.0"
] | 16 | 2020-07-15T07:24:30.000Z | 2022-03-19T05:41:11.000Z | #!/usr/bin/env python
# Sample usage:
# python env-setup.py --version 1.5 --apt-packages libomp5
import argparse
import collections
from datetime import datetime
VersionConfig = collections.namedtuple('VersionConfig',
['wheels', 'tpu', 'py_version', 'cuda_version'])
DEFAULT_CUD... | 31.574074 | 100 | 0.695992 | #!/usr/bin/env python
# Sample usage:
# python env-setup.py --version 1.5 --apt-packages libomp5
import argparse
import collections
from datetime import datetime
import os
import platform
import re
import requests
import subprocess
import threading
import sys
VersionConfig = collections.namedtuple('VersionConfig',
... | 0 | 0 | 0 | 0 | 0 | 3,488 | 0 | -56 | 338 |
f40501bb096d4f1abeac69133b2059166ce02a20 | 15,926 | py | Python | multidiff/diffusion_matrix.py | chemical-diffusion/multi-diffusion | e582fef0c275cc5c1503a8fee6222132fcf71873 | [
"BSD-3-Clause"
] | 2 | 2017-01-14T17:44:36.000Z | 2017-10-19T20:15:48.000Z | multidiff/diffusion_matrix.py | chemical-diffusion/multi-diffusion | e582fef0c275cc5c1503a8fee6222132fcf71873 | [
"BSD-3-Clause"
] | 7 | 2017-01-26T08:12:31.000Z | 2019-07-29T15:48:42.000Z | multidiff/diffusion_matrix.py | chemical-diffusion/multi-diffusion | e582fef0c275cc5c1503a8fee6222132fcf71873 | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from scipy.special import erf
from scipy import optimize
# ---------------------------- Preprocessing ----------------------------------
def _normalize_profiles(profiles, c_mean):
"""
Rescale concentration profiles to fluctuations around the average value.
... | 39.914787 | 93 | 0.575537 | import numpy as np
import matplotlib.pyplot as plt
from scipy.special import erf
from scipy import optimize
# ---------------------------- Preprocessing ----------------------------------
def _dc_from_profiles(profiles):
dc, c_mean = [], []
for profile in profiles:
n_comp, n_pts = profile.shape
... | 0 | 0 | 0 | 0 | 0 | 3,464 | 0 | 0 | 150 |
9a6e2fc462b2e02e9733633750ebac7627c7c79c | 3,331 | py | Python | plenum/test/consensus/order_service/test_can_send_3pc.py | ken-ebert/indy-plenum | 7578798df456d06ffe24f488452fab3f1b3f00f1 | [
"Apache-2.0"
] | null | null | null | plenum/test/consensus/order_service/test_can_send_3pc.py | ken-ebert/indy-plenum | 7578798df456d06ffe24f488452fab3f1b3f00f1 | [
"Apache-2.0"
] | null | null | null | plenum/test/consensus/order_service/test_can_send_3pc.py | ken-ebert/indy-plenum | 7578798df456d06ffe24f488452fab3f1b3f00f1 | [
"Apache-2.0"
] | null | null | null |
# ToDO: uncomment this test, if pre_view_change_in_progress will be used
# def test_can_send_3pc_batch_pre_view_change(orderer, mode):
# orderer.replica.node.pre_view_change_in_progress = True
# primary_validator.replica.node.mode = mode
# assert not primary_validator.can_send_3pc_batch()
| 45.013514 | 113 | 0.799159 | import pytest
from plenum.common.startable import Mode
def test_can_send_3pc_batch_by_primary_only(primary_orderer):
assert primary_orderer.can_send_3pc_batch()
primary_orderer.primary_name = "SomeNode:0"
assert not primary_orderer.can_send_3pc_batch()
def test_can_send_3pc_batch_not_participating(prim... | 0 | 1,931 | 0 | 0 | 0 | 848 | 0 | 11 | 229 |
08e327d5b3773231cf76dba37667f3c77459e5dd | 14,365 | py | Python | tests/lambda_test.py | logzio/aws-cost-and-usage-auto-deployment | 58f82c54eade67ed1575ccda8bac55c042e81b2a | [
"Apache-2.0"
] | 8 | 2018-10-01T17:38:11.000Z | 2020-11-05T21:22:58.000Z | tests/lambda_test.py | logzio/aws-cost-and-usage-lambda | 58f82c54eade67ed1575ccda8bac55c042e81b2a | [
"Apache-2.0"
] | 1 | 2021-06-28T19:03:27.000Z | 2021-06-28T19:03:27.000Z | tests/lambda_test.py | logzio/aws-cost-and-usage-auto-deployment | 58f82c54eade67ed1575ccda8bac55c042e81b2a | [
"Apache-2.0"
] | 2 | 2019-03-20T08:23:31.000Z | 2020-01-07T13:58:04.000Z | import logging
import src.shipper as shipper
import unittest
from logging.config import fileConfig
# create logger assuming running from ./run script
fileConfig('tests/logging_config.ini')
logger = logging.getLogger(__name__)
CONFIGURATION_FILE = 'tests/config.yaml'
SAMPLE_CSV_GZIP_1 = 'tests/reports/test-billing-rep... | 44.750779 | 119 | 0.594152 | import boto3
import csv
import datetime
import gzip
import httpretty
import json
import logging
import os
import src.lambda_function as worker
import src.shipper as shipper
import unittest
import yaml
from . import utils
from csv import DictReader
from logging.config import fileConfig
from src.shipper import BadLogsEx... | 0 | 4,987 | 0 | 8,513 | 0 | 0 | 0 | 41 | 310 |
f33b7279981e2674c2c6759c223169bd67487709 | 2,153 | py | Python | ninfs/gui/confighandler.py | Jhynjhiruu/ninfs | 9e0f5889cafd595c56e2db936177ef1b0f4ac02e | [
"MIT"
] | 213 | 2019-04-18T04:43:18.000Z | 2022-03-29T06:25:38.000Z | ninfs/gui/confighandler.py | Jhynjhiruu/ninfs | 9e0f5889cafd595c56e2db936177ef1b0f4ac02e | [
"MIT"
] | 55 | 2019-04-20T01:21:26.000Z | 2022-03-26T02:40:17.000Z | ninfs/gui/confighandler.py | Jhynjhiruu/ninfs | 9e0f5889cafd595c56e2db936177ef1b0f4ac02e | [
"MIT"
] | 17 | 2019-05-11T22:15:31.000Z | 2021-10-06T03:46:51.000Z | # This file is a part of ninfs.
#
# Copyright (c) 2017-2021 Ian Burgwin
# This file is licensed under The MIT License (MIT).
# You can find the full license text in LICENSE.md in the root of this project.
from configparser import ConfigParser
from os import environ, makedirs
from os.path import expanduser, isdir, join... | 27.602564 | 92 | 0.664654 | # This file is a part of ninfs.
#
# Copyright (c) 2017-2021 Ian Burgwin
# This file is licensed under The MIT License (MIT).
# You can find the full license text in LICENSE.md in the root of this project.
from configparser import ConfigParser
from os import environ, makedirs
from os.path import expanduser, isdir, join... | 0 | 0 | 0 | 0 | 0 | 296 | 0 | 0 | 69 |
4dc4bb804a775f67630c95326b9b56cb720d3fa2 | 154 | py | Python | eyelab/__init__.py | MedVisBonn/eyelab | 658997be88b87087e81820e26986b0fc938e5c2d | [
"MIT"
] | null | null | null | eyelab/__init__.py | MedVisBonn/eyelab | 658997be88b87087e81820e26986b0fc938e5c2d | [
"MIT"
] | null | null | null | eyelab/__init__.py | MedVisBonn/eyelab | 658997be88b87087e81820e26986b0fc938e5c2d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Top-level package for eyelab."""
__author__ = """Olivier Morelle"""
__email__ = "oli4morelle@gmail.com"
__version__ = "0.3.2"
| 22 | 35 | 0.649351 | # -*- coding: utf-8 -*-
"""Top-level package for eyelab."""
__author__ = """Olivier Morelle"""
__email__ = "oli4morelle@gmail.com"
__version__ = "0.3.2"
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
54334be0cf8ba3cae9dec30c8263fea060a446f6 | 4,563 | py | Python | src/annalist_root/annalist/tests/test_generic_elements.py | gklyne/annalist | 82e7ef2d56a400325e7618fa9e590072ee8a71d3 | [
"MIT"
] | 18 | 2015-02-20T23:09:13.000Z | 2020-11-13T06:06:43.000Z | src/annalist_root/annalist/tests/test_generic_elements.py | gklyne/annalist | 82e7ef2d56a400325e7618fa9e590072ee8a71d3 | [
"MIT"
] | 30 | 2015-01-03T09:56:28.000Z | 2021-06-10T20:58:55.000Z | src/annalist_root/annalist/tests/test_generic_elements.py | gklyne/annalist | 82e7ef2d56a400325e7618fa9e590072ee8a71d3 | [
"MIT"
] | 5 | 2015-02-02T09:01:23.000Z | 2018-06-14T20:05:28.000Z | from __future__ import unicode_literals
from __future__ import absolute_import, division, print_function
"""
Tests for generic page elements not covered by other tests
"""
__author__ = "Graham Klyne (GK@ACM.ORG)"
__copyright__ = "Copyright 2018, G. Klyne"
__license__ = "MIT (http://opensource.org/licenses/... | 32.827338 | 117 | 0.644751 | from __future__ import unicode_literals
from __future__ import absolute_import, division, print_function
"""
Tests for generic page elements not covered by other tests
"""
__author__ = "Graham Klyne (GK@ACM.ORG)"
__copyright__ = "Copyright 2018, G. Klyne"
__license__ = "MIT (http://opensource.org/licenses/... | 0 | 162 | 0 | 3,089 | 0 | 0 | 0 | 421 | 314 |
aa9c350722808778d006fe87ba3aa4c3931175d6 | 123 | py | Python | estate/core/apps.py | asloan7/estate | 07d9802198947bfcd25d019b5c79610a9a81e25e | [
"MIT"
] | 95 | 2017-11-02T12:47:24.000Z | 2021-08-14T22:44:53.000Z | estate/core/apps.py | asloan7/estate | 07d9802198947bfcd25d019b5c79610a9a81e25e | [
"MIT"
] | 6 | 2018-10-28T22:30:41.000Z | 2018-10-29T01:08:47.000Z | estate/core/apps.py | asloan7/estate | 07d9802198947bfcd25d019b5c79610a9a81e25e | [
"MIT"
] | 63 | 2017-10-31T13:36:35.000Z | 2022-02-04T01:56:59.000Z | from __future__ import unicode_literals
| 15.375 | 39 | 0.780488 | from __future__ import unicode_literals
from django.apps import AppConfig
class APIConfig(AppConfig):
name = 'core'
| 0 | 0 | 0 | 24 | 0 | 0 | 0 | 12 | 46 |
f0c142a2912fb2fe0a3e936caf5b7d10ed9fe976 | 1,500 | py | Python | pynextcaller/tests/base.py | trezorg/nextcaller-python-api | 452ea9dbd945d8bf1bc2122ac1ffb886346d78cc | [
"MIT"
] | null | null | null | pynextcaller/tests/base.py | trezorg/nextcaller-python-api | 452ea9dbd945d8bf1bc2122ac1ffb886346d78cc | [
"MIT"
] | null | null | null | pynextcaller/tests/base.py | trezorg/nextcaller-python-api | 452ea9dbd945d8bf1bc2122ac1ffb886346d78cc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
try:
from unittest import mock
except ImportError:
from .. import transport
| 28.846154 | 66 | 0.675333 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import unittest
try:
from unittest import mock
except ImportError:
import mock
from ..client import NextCallerClient, NextCallerPlatformClient
from .. import transport
class BaseTestCase(unittest.TestCase):
class FakeResponse(object):
... | 0 | 0 | 0 | 1,212 | 0 | 0 | 0 | 26 | 116 |
ed79b8872d0353b944045d77a3b550a09342bdbf | 5,536 | py | Python | baselines/prep_baseline.py | lessleslie/slm-code-generation | 017ac0828faf3467e9f85883e27be09ec3898b14 | [
"MIT"
] | 64 | 2020-06-23T06:27:42.000Z | 2022-03-30T07:44:52.000Z | baselines/prep_baseline.py | lessleslie/slm-code-generation | 017ac0828faf3467e9f85883e27be09ec3898b14 | [
"MIT"
] | 11 | 2020-07-14T23:29:31.000Z | 2021-09-17T15:17:49.000Z | baselines/prep_baseline.py | tech-srl/slm-code-generation | 15fe4e1df82e49587f725577f870ca12dc42903a | [
"MIT"
] | 6 | 2020-07-09T08:42:04.000Z | 2021-03-02T14:35:31.000Z | import re
from argparse import ArgumentParser
PRED_TOKEN = 'PRED'
modifiers = ['public', 'private', 'protected', 'static']
target_type = TargetType.seq
RE_WORDS = re.compile(r'''
# Find words in a string. Order matters!
[A-Z]+(?=[A-Z][a-z]) | # All upper case before a capitalized word
[A-Z]?[a-z]+ | #... | 40.408759 | 146 | 0.629516 | import json
import multiprocessing as mp
import re
from argparse import ArgumentParser
from enum import Enum, auto
import javalang
from functools import partial
PRED_TOKEN = 'PRED'
modifiers = ['public', 'private', 'protected', 'static']
class TargetType(Enum):
seq = auto()
tree = auto()
@staticmethod
... | 0 | 118 | 0 | 64 | 0 | 3,038 | 0 | 5 | 248 |
14281a6800675772e8d905d8f911d7546bb4fd9e | 490 | py | Python | setup.py | ankit98verma/CLI | 38013da923f990be7495713ebcc8e355a3fe2576 | [
"MIT"
] | null | null | null | setup.py | ankit98verma/CLI | 38013da923f990be7495713ebcc8e355a3fe2576 | [
"MIT"
] | 2 | 2020-02-18T22:49:16.000Z | 2020-02-25T21:41:28.000Z | setup.py | ankit98verma/CLI | 38013da923f990be7495713ebcc8e355a3fe2576 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(
name='CLI',
version='1.0.4',
packages=find_packages(exclude=['test']),
url='https://github.com/ankit98verma/CLI',
author='Ankit Verma',
license='MIT',
author_email='ankitvermajnp@gmail.com',
description='CLI interface',
e... | 23.333333 | 47 | 0.557143 | from setuptools import setup, find_packages
setup(
name='CLI',
version='1.0.4',
packages=find_packages(exclude=['test']),
url='https://github.com/ankit98verma/CLI',
author='Ankit Verma',
license='MIT',
author_email='ankitvermajnp@gmail.com',
description='CLI interface',
e... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8a456df11a3bf1085d52b4f279e2177c9ea480e9 | 2,734 | py | Python | demos/csrf/csrf.py | timgates42/pysqli | 37418c9b3fbb760b97f28f6583f0d84f66bbff45 | [
"MIT"
] | 56 | 2015-02-05T07:28:57.000Z | 2022-03-10T05:35:34.000Z | demos/csrf/csrf.py | timgates42/pysqli | 37418c9b3fbb760b97f28f6583f0d84f66bbff45 | [
"MIT"
] | null | null | null | demos/csrf/csrf.py | timgates42/pysqli | 37418c9b3fbb760b97f28f6583f0d84f66bbff45 | [
"MIT"
] | 17 | 2015-07-06T09:23:36.000Z | 2021-11-08T11:14:27.000Z | import re
from pysqli import Context
from pysqli.dbms import Mysql5
from pysqli.core.injector import PostInjector
from pysqli.core.triggers import RegexpTrigger, Trigger
from urllib2 import Request, urlopen
from threading import Lock
# Injection context as discovered manually
c = Context(
method='blind',
comment='#... | 29.717391 | 96 | 0.616313 | import re
from pysqli import Context
from pysqli.dbms import Mysql5
from pysqli.core.injector import PostInjector
from pysqli.core.triggers import RegexpTrigger, Trigger
from urllib2 import Request,urlopen
from threading import Lock
class CSRFPostInjector(PostInjector):
'''
This is a sample of an injector abl... | 0 | 0 | 0 | 1,761 | 0 | 0 | 0 | -1 | 23 |
6fc885242e3b45b1a3c33d10a36e21f7faf7e252 | 3,404 | py | Python | tests/contrib/aiohttp/test_request.py | soheltarir/dd-trace-py | 65864cea98e8b3602fee619cb8f5b749b5e70bb3 | [
"BSD-3-Clause"
] | null | null | null | tests/contrib/aiohttp/test_request.py | soheltarir/dd-trace-py | 65864cea98e8b3602fee619cb8f5b749b5e70bb3 | [
"BSD-3-Clause"
] | null | null | null | tests/contrib/aiohttp/test_request.py | soheltarir/dd-trace-py | 65864cea98e8b3602fee619cb8f5b749b5e70bb3 | [
"BSD-3-Clause"
] | null | null | null | # flake8: noqa
| 32.113208 | 77 | 0.629847 | # flake8: noqa
import threading
import asyncio
import aiohttp_jinja2
from urllib import request
from nose.tools import eq_
from aiohttp.test_utils import unittest_run_loop
from ddtrace.pin import Pin
from ddtrace.constants import EVENT_SAMPLE_RATE_KEY
from ddtrace.contrib.aiohttp.patch import patch, unpatch
from ddtr... | 0 | 2,532 | 0 | 445 | 0 | 0 | 0 | 143 | 268 |
32cd0a81d986e63fa7018a27ae49fac607779b0c | 1,069 | py | Python | opcdb/migrations/0005_auto_20191023_0011.py | Ecotrust/OPCDB | f639408c9cfdfa392a9233042f40e116c703fff1 | [
"MIT"
] | null | null | null | opcdb/migrations/0005_auto_20191023_0011.py | Ecotrust/OPCDB | f639408c9cfdfa392a9233042f40e116c703fff1 | [
"MIT"
] | 7 | 2021-03-19T02:36:29.000Z | 2022-01-21T23:51:38.000Z | opcdb/migrations/0005_auto_20191023_0011.py | Ecotrust/OPCDB | f639408c9cfdfa392a9233042f40e116c703fff1 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.6 on 2019-10-23 00:11
| 31.441176 | 99 | 0.603368 | # Generated by Django 2.2.6 on 2019-10-23 00:11
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('opcdb', '0004_auto_20191022_2352'),
]
operations = [
migrations.AlterField(
model_name='landingrecord',
name='busine... | 0 | 0 | 0 | 955 | 0 | 0 | 0 | 19 | 46 |
e9ebf7baeccb06cde68fc62dcda2619d29773ac1 | 8,353 | py | Python | epic_battle_royale.py | breno-aberle/rl-pong-project | 9dc0d12e4bbcdb2905d46f66e84fac6d70c7831d | [
"MIT"
] | 1 | 2021-11-16T08:41:59.000Z | 2021-11-16T08:41:59.000Z | epic_battle_royale.py | breno-aberle/rl-pong-project | 9dc0d12e4bbcdb2905d46f66e84fac6d70c7831d | [
"MIT"
] | null | null | null | epic_battle_royale.py | breno-aberle/rl-pong-project | 9dc0d12e4bbcdb2905d46f66e84fac6d70c7831d | [
"MIT"
] | null | null | null | import argparse
parser = argparse.ArgumentParser()
parser.add_argument("dir", type=str, help="Directory with agents.")
parser.add_argument("--render", "-r", action="store_true", help="Render the competition.")
parser.add_argument("--games", "-g", type=int, default=100, help="Number of games.")
parser.add_argument("--m... | 32.756863 | 107 | 0.601461 | import argparse
import sys
import os
from pong_testbench import PongTestbench
from multiprocessing import Process, Queue
from matplotlib import font_manager
from time import sleep
import importlib
import traceback
import numpy as np
import pickle
parser = argparse.ArgumentParser()
parser.add_argument("dir", type=str, ... | 0 | 0 | 0 | 0 | 0 | 7,445 | 0 | 11 | 289 |
d181efad30b9476007386274382c85f1e6cd702c | 1,861 | py | Python | exam/mainapp/migrations/0001_initial.py | malfin/exam_project | 8b707ff6cbd09b096273a97165adc15c28f838e0 | [
"Apache-2.0"
] | null | null | null | exam/mainapp/migrations/0001_initial.py | malfin/exam_project | 8b707ff6cbd09b096273a97165adc15c28f838e0 | [
"Apache-2.0"
] | null | null | null | exam/mainapp/migrations/0001_initial.py | malfin/exam_project | 8b707ff6cbd09b096273a97165adc15c28f838e0 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.2 on 2022-03-30 08:12
| 40.456522 | 142 | 0.579796 | # Generated by Django 3.2 on 2022-03-30 08:12
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Category',
fields=[
... | 224 | 0 | 0 | 1,604 | 0 | 0 | 0 | 30 | 68 |
cb14c2b7303dec7d3cbd0dfd0671686e4f286c2f | 524 | py | Python | interior_meet/designs/migrations/0006_alter_design_type.py | L-Ignatova/interior_meet | 64c4cb1ef795c03fa17d4b847fc94bf2edf90d7a | [
"MIT"
] | null | null | null | interior_meet/designs/migrations/0006_alter_design_type.py | L-Ignatova/interior_meet | 64c4cb1ef795c03fa17d4b847fc94bf2edf90d7a | [
"MIT"
] | null | null | null | interior_meet/designs/migrations/0006_alter_design_type.py | L-Ignatova/interior_meet | 64c4cb1ef795c03fa17d4b847fc94bf2edf90d7a | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2021-07-24 13:44
| 27.578947 | 190 | 0.60687 | # Generated by Django 3.2.5 on 2021-07-24 13:44
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('designs', '0005_alter_design_title'),
]
operations = [
migrations.AlterField(
model_name='design',
name='type',
... | 0 | 0 | 0 | 410 | 0 | 0 | 0 | 19 | 46 |
a68c95b67ca5efddf2fff5c21a48f169e5740f3e | 1,452 | py | Python | Rock paper scissors/rock-paper-scissors.py | chrispliakos-gr/credit-calculator | 284671258699b0820c77d0f6c73854ee2fb1b146 | [
"MIT"
] | null | null | null | Rock paper scissors/rock-paper-scissors.py | chrispliakos-gr/credit-calculator | 284671258699b0820c77d0f6c73854ee2fb1b146 | [
"MIT"
] | 5 | 2020-07-28T09:24:27.000Z | 2020-08-16T16:46:08.000Z | Rock paper scissors/rock-paper-scissors.py | chrispliakos-gr/credit-calculator | 284671258699b0820c77d0f6c73854ee2fb1b146 | [
"MIT"
] | null | null | null | import random
possible_inputs = ["fire", "rock", "gun", "lightning", "devil", "dragon", "water", "air", "paper",
"sponge", "wolf", "tree", "human", "snake", "scissors"]
name = input("Enter your name: > ")
print(f"Hello, {name}")
ratings = open('rating.txt', 'r')
ratings_list = ratings.read().spli... | 33 | 98 | 0.603306 | import random
possible_inputs = ["fire", "rock", "gun", "lightning", "devil", "dragon", "water", "air", "paper",
"sponge", "wolf", "tree", "human", "snake", "scissors"]
name = input("Enter your name: > ")
print(f"Hello, {name}")
ratings = open('rating.txt', 'r')
ratings_list = ratings.read().spli... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b864c0463875406a5f1a4ae9e80700656bbb93b2 | 2,305 | py | Python | dm_location/009_gangnam4_specific/2_mining_direction.py | yaicv/real-time-tracking-of-criminal-vehicles | 5fc5852a38ff106e9801ca858b5915a1c29b93c0 | [
"MIT"
] | null | null | null | dm_location/009_gangnam4_specific/2_mining_direction.py | yaicv/real-time-tracking-of-criminal-vehicles | 5fc5852a38ff106e9801ca858b5915a1c29b93c0 | [
"MIT"
] | null | null | null | dm_location/009_gangnam4_specific/2_mining_direction.py | yaicv/real-time-tracking-of-criminal-vehicles | 5fc5852a38ff106e9801ca858b5915a1c29b93c0 | [
"MIT"
] | null | null | null | import pandas as pd
import matplotlib.pyplot as plt
rawdata = pd.read_csv('total.txt', sep = "\t", names=['timestamp', 'date', 'id', 'y', 'x'])
feature = rawdata[['timestamp', 'date', 'id', 'x', 'y']]
data_sort = feature.sort_values(['id', 'date'], ascending=[True, True])
data_sort.to_csv('total4.csv')
raw... | 35.461538 | 126 | 0.515401 | from sklearn.cluster import DBSCAN
from sklearn import datasets
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
rawdata = pd.read_csv('total.txt', sep = "\t", names=['timestamp', 'date', 'id', 'y', 'x'])
feature = rawdata[['timestamp', 'date', 'id', 'x', 'y']]
d... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 17 | 92 |
43bdf60c6f617ab653f52b42a30bd6529519c043 | 6,122 | py | Python | applications/ShapeOptimizationApplication/python_scripts/response_functions/face_angle.py | KlausBSautter/Kratos | 245b30e38497a242bbdf999278e9c1b6175a573a | [
"BSD-4-Clause"
] | 778 | 2017-01-27T16:29:17.000Z | 2022-03-30T03:01:51.000Z | applications/ShapeOptimizationApplication/python_scripts/response_functions/face_angle.py | KlausBSautter/Kratos | 245b30e38497a242bbdf999278e9c1b6175a573a | [
"BSD-4-Clause"
] | 6,634 | 2017-01-15T22:56:13.000Z | 2022-03-31T15:03:36.000Z | applications/ShapeOptimizationApplication/python_scripts/response_functions/face_angle.py | philbucher/Kratos | 1ceb900dbacfab344e27e32285250eafc52093ec | [
"BSD-4-Clause"
] | 224 | 2017-02-07T14:12:49.000Z | 2022-03-06T23:09:34.000Z | # importing the Kratos Library
# ==============================================================================
| 43.728571 | 168 | 0.665142 | # importing the Kratos Library
import KratosMultiphysics as KM
from KratosMultiphysics import Parameters, Logger
from KratosMultiphysics.response_functions.response_function_interface import ResponseFunctionInterface
import KratosMultiphysics.ShapeOptimizationApplication as KSO
import time as timer
def _AddCondition... | 0 | 632 | 0 | 4,641 | 0 | 420 | 0 | 159 | 156 |
7ea59089ddef99df33c9e49f7c5c3fa8e0615663 | 674 | py | Python | demo/tests/locust/locustfile.py | miikkij/pythontraining | d77209e2f393d33f195b7829d308b9ec14984fb6 | [
"MIT"
] | null | null | null | demo/tests/locust/locustfile.py | miikkij/pythontraining | d77209e2f393d33f195b7829d308b9ec14984fb6 | [
"MIT"
] | null | null | null | demo/tests/locust/locustfile.py | miikkij/pythontraining | d77209e2f393d33f195b7829d308b9ec14984fb6 | [
"MIT"
] | null | null | null | import os
import sys
sys.path.append(os.path.abspath('../user_client'))
| 22.466667 | 59 | 0.673591 | import os
import sys
sys.path.append(os.path.abspath('../user_client'))
from locust import Locust, TaskSet, task
from user_client import UserClient
from utils import ClientWrapper
class CustomLocust(Locust):
def __init__(self, *args, **kwargs):
super(CustomLocust, self).__init__(*args, **kwargs)
s... | 0 | 87 | 0 | 337 | 0 | 0 | 0 | 42 | 136 |
776fdcbe5ce64b9f0bdb3f3ef3a7a9184f99f508 | 2,119 | py | Python | High School Teaching & Projects/Projekty - Programovanie sINF-4R/Grafika - Hry/snake/had_1.1.py | mpuheim/Various | b96caabde036530329f0ebbe2e3f176dfe691d1c | [
"RSA-MD"
] | null | null | null | High School Teaching & Projects/Projekty - Programovanie sINF-4R/Grafika - Hry/snake/had_1.1.py | mpuheim/Various | b96caabde036530329f0ebbe2e3f176dfe691d1c | [
"RSA-MD"
] | null | null | null | High School Teaching & Projects/Projekty - Programovanie sINF-4R/Grafika - Hry/snake/had_1.1.py | mpuheim/Various | b96caabde036530329f0ebbe2e3f176dfe691d1c | [
"RSA-MD"
] | null | null | null | import tkinter
#vytvorenie hernej plochy
# vytvorenie hada
# pohyb hada
# aktualizacia hry
#start programu
canvas = tkinter.Canvas(width=300,height=200)
canvas.pack()
#nastavenie globalnych premennych
had_x=[3,3,3,2,1]
had_y=[4,3,2,2,2]
had_r=[] #tu budete ukladat vykreslene stvorce
smer_x = 1 #smer v x-ov... | 26.822785 | 80 | 0.667768 | import tkinter
import random
#vytvorenie hernej plochy
def draw_area():
#premalujeme celu plochu na bielo jednym velkym obdlznikom
#canvas.create_rectangle(0, 0, 300, 200, fill='white', outline='')
# ale lepsie je zmazat nakreslene utvary
for stvorec in had_r:
canvas.delete(stvorec)
# ... | 0 | 0 | 0 | 0 | 0 | 1,449 | 0 | -8 | 156 |
32ce958f97001d596cba20e7a91ad99418ddb6a5 | 2,771 | py | Python | sstcam_sandbox/d190209_spectra/spe_scipy.py | watsonjj/CHECLabPySB | 91330d3a6f510a392f635bd7f4abd2f77871322c | [
"BSD-3-Clause"
] | null | null | null | sstcam_sandbox/d190209_spectra/spe_scipy.py | watsonjj/CHECLabPySB | 91330d3a6f510a392f635bd7f4abd2f77871322c | [
"BSD-3-Clause"
] | null | null | null | sstcam_sandbox/d190209_spectra/spe_scipy.py | watsonjj/CHECLabPySB | 91330d3a6f510a392f635bd7f4abd2f77871322c | [
"BSD-3-Clause"
] | 1 | 2021-03-30T09:46:56.000Z | 2021-03-30T09:46:56.000Z | import numpy as np
SQRT2PI = np.sqrt(2.0 * np.pi)
K = np.arange(1, 250)
KN = K[:, None]
JN = K[None, :]
# @jit
| 32.6 | 90 | 0.663298 | from scipy.special import binom
from scipy.stats import norm as normal, poisson
import numpy as np
from numba import jit
SQRT2PI = np.sqrt(2.0 * np.pi)
K = np.arange(1, 250)
KN = K[:, None]
JN = K[None, :]
@jit(fastmath=True, parallel=True)
def mapm_scipy(x, norm, eped, eped_sigma, spe, spe_sigma, lambda_):
# O... | 0 | 669 | 0 | 0 | 0 | 1,791 | 0 | 36 | 157 |
c9f9f709c4bccdd4befa13f04cb029b302b41721 | 1,520 | py | Python | algorithms/sort/mergesort.py | pikulak/learning | ecb69c620b8a983bc275fe5400cb0d207a86a6f1 | [
"Apache-2.0"
] | null | null | null | algorithms/sort/mergesort.py | pikulak/learning | ecb69c620b8a983bc275fe5400cb0d207a86a6f1 | [
"Apache-2.0"
] | null | null | null | algorithms/sort/mergesort.py | pikulak/learning | ecb69c620b8a983bc275fe5400cb0d207a86a6f1 | [
"Apache-2.0"
] | null | null | null | import sys
def merge(array, first, middle, last):
"""
Function for merging array.
:param array: array with items <list>
:param first: first index in array <int>
:param middle: middle index in array <int>
:param last: last index in array <int>
"""
left = array[first:middle]
right = ... | 23.030303 | 52 | 0.573684 | import sys
def merge(array, first, middle, last):
"""
Function for merging array.
:param array: array with items <list>
:param first: first index in array <int>
:param middle: middle index in array <int>
:param last: last index in array <int>
"""
left = array[first:middle]
right = ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d49a640c158f158171b8b872269ee82d32b85976 | 15,274 | py | Python | neutron_lbaas/drivers/common/agent_driver_base.py | gotostack/neutron-lbaas | aea6f1f3c512ef94c89210d919f3b807b907edbe | [
"Apache-2.0"
] | null | null | null | neutron_lbaas/drivers/common/agent_driver_base.py | gotostack/neutron-lbaas | aea6f1f3c512ef94c89210d919f3b807b907edbe | [
"Apache-2.0"
] | null | null | null | neutron_lbaas/drivers/common/agent_driver_base.py | gotostack/neutron-lbaas | aea6f1f3c512ef94c89210d919f3b807b907edbe | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Rackspace.
#
# 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 ... | 43.025352 | 79 | 0.682336 | # Copyright 2015 Rackspace.
#
# 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 ... | 0 | 0 | 0 | 13,458 | 0 | 0 | 0 | 305 | 451 |
4d3cdfee70c66e7a103c6df4959f09a91711e5f9 | 170 | py | Python | localflavor/be/be_regions.py | 3DHubs/localflavor | d84f7e13c738402790ab84ab894227c509826b02 | [
"BSD-3-Clause"
] | 1 | 2022-01-31T11:12:03.000Z | 2022-01-31T11:12:03.000Z | localflavor/be/be_regions.py | 3DHubs/localflavor | d84f7e13c738402790ab84ab894227c509826b02 | [
"BSD-3-Clause"
] | 2 | 2021-04-22T09:02:20.000Z | 2021-09-20T09:23:45.000Z | localflavor/be/be_regions.py | 3DHubs/localflavor | d84f7e13c738402790ab84ab894227c509826b02 | [
"BSD-3-Clause"
] | 1 | 2021-02-05T09:42:52.000Z | 2021-02-05T09:42:52.000Z | from localflavor.stub import _
#: ISO codes
REGION_CHOICES = (
('BRU', _('Brussels Capital Region')),
('VLG', _('Flemish Region')),
('WAL', _('Wallonia'))
)
| 18.888889 | 42 | 0.6 | from localflavor.stub import _
#: ISO codes
REGION_CHOICES = (
('BRU', _('Brussels Capital Region')),
('VLG', _('Flemish Region')),
('WAL', _('Wallonia'))
)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
78191ab04da6415baa39e4bb6ecaac974607317b | 2,294 | py | Python | dashboard/services/predictions.py | cmheisel/project-status-dashboard | 1a0b7bd9bf5e44487bf8fbac8a66be79039853e8 | [
"MIT"
] | 7 | 2016-07-15T14:46:34.000Z | 2020-01-09T02:37:43.000Z | dashboard/services/predictions.py | cmheisel/project-status-dashboard | 1a0b7bd9bf5e44487bf8fbac8a66be79039853e8 | [
"MIT"
] | 57 | 2016-07-09T20:07:29.000Z | 2018-04-08T18:36:07.000Z | dashboard/services/predictions.py | cmheisel/project-status-dashboard | 1a0b7bd9bf5e44487bf8fbac8a66be79039853e8 | [
"MIT"
] | 1 | 2016-07-11T19:53:09.000Z | 2016-07-11T19:53:09.000Z | import logging
from better.lib import Forecaster
from .summaries import for_date_range
logger = logging.getLogger('dashboard.services.pedictions')
def throughput_history(summaries):
"""Calculates the change in completion for a list of summaries.
Args:
summaries (List[ProjectSummary]): List of proje... | 41.709091 | 106 | 0.707498 | import logging
from better.lib import Forecaster
from .summaries import for_date_range
logger = logging.getLogger('dashboard.services.pedictions')
def throughput_history(summaries):
"""Calculates the change in completion for a list of summaries.
Args:
summaries (List[ProjectSummary]): List of proje... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
caf038f3150337b9143ca8b77c288db88c324327 | 109 | py | Python | src/providers/constants.py | helenapoleri/reinforcement-filesystem | 3fb839c07563384adba4abdd0fec61ebf76a2530 | [
"BSD-2-Clause"
] | null | null | null | src/providers/constants.py | helenapoleri/reinforcement-filesystem | 3fb839c07563384adba4abdd0fec61ebf76a2530 | [
"BSD-2-Clause"
] | null | null | null | src/providers/constants.py | helenapoleri/reinforcement-filesystem | 3fb839c07563384adba4abdd0fec61ebf76a2530 | [
"BSD-2-Clause"
] | null | null | null | """This file contains the providers ids strings.
"""
# Providers
DROPBOX = 'dropbox'
ONEDRIVE = 'one_drive'
| 15.571429 | 48 | 0.715596 | """This file contains the providers ids strings.
"""
# Providers
DROPBOX = 'dropbox'
ONEDRIVE = 'one_drive'
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
39f926d6cbd096339a8c17a97d1747441c6b822f | 3,384 | py | Python | src/AoC_2020/d10_jolts_with_defaultdict/jolts.py | derailed-dash/Advent-of-Code | 12378baf33ef4a59958e84eb60e795b6530c22ba | [
"MIT"
] | 9 | 2021-12-31T20:13:03.000Z | 2022-03-05T07:05:06.000Z | src/AoC_2020/d10_jolts_with_defaultdict/jolts.py | derailed-dash/Advent-of-Code | 12378baf33ef4a59958e84eb60e795b6530c22ba | [
"MIT"
] | 1 | 2022-01-25T08:35:04.000Z | 2022-01-29T00:07:00.000Z | src/AoC_2020/d10_jolts_with_defaultdict/jolts.py | derailed-dash/Advent-of-Code | 12378baf33ef4a59958e84eb60e795b6530c22ba | [
"MIT"
] | null | null | null | """
Author: Darren
Date: 11/12/2020
Solving: https://adventofcode.com/2020/day/10
The initial output from the console is 0 jolts.
We have a bag of joltage adapters.
Any adapter can take input of 1, 2 or 3 jolts lower than its rated joltage.
Our device is rated 3 jolts higher than any adapter in the bag.
Part 1: cre... | 33.50495 | 125 | 0.668735 | """
Author: Darren
Date: 11/12/2020
Solving: https://adventofcode.com/2020/day/10
The initial output from the console is 0 jolts.
We have a bag of joltage adapters.
Any adapter can take input of 1, 2 or 3 jolts lower than its rated joltage.
Our device is rated 3 jolts higher than any adapter in the bag.
Part 1: cre... | 0 | 0 | 0 | 0 | 0 | 2,182 | 0 | -2 | 113 |
3ecb88cdde510140cc7d63557bf8e407568d3c01 | 9,395 | py | Python | mlp/admin.py | dennereed/paleocore | d6da6c39cde96050ee4b9e7213ec1200530cbeee | [
"MIT"
] | 1 | 2021-02-05T19:50:13.000Z | 2021-02-05T19:50:13.000Z | mlp/admin.py | dennereed/paleocore | d6da6c39cde96050ee4b9e7213ec1200530cbeee | [
"MIT"
] | 59 | 2020-06-17T22:21:51.000Z | 2022-02-10T05:00:01.000Z | mlp/admin.py | dennereed/paleocore | d6da6c39cde96050ee4b9e7213ec1200530cbeee | [
"MIT"
] | 2 | 2020-07-01T14:11:09.000Z | 2020-08-10T17:27:26.000Z | from django.contrib import admin
import projects.admin
# TODO Why does the line below raise an error!
############################
# Register Admin Classes #
############################
admin.site.register(Occurrence, OccurrenceAdmin)
admin.site.register(Archaeology, ArchaeologyAdmin)
admin.site.register(Biol... | 50.783784 | 113 | 0.663757 | from django.contrib import admin
from import_export import resources
from django.contrib.auth.decorators import permission_required
from django.core.exceptions import ObjectDoesNotExist
from django.http import HttpResponse, HttpResponseRedirect
from django.urls import reverse, path
from .models import *
import project... | 0 | 0 | 0 | 8,502 | 0 | 0 | 0 | 131 | 323 |
ff475a9e2fd015361083367fbfc087c38dc4de9f | 1,555 | py | Python | mi/core/instrument/test/test_data_decorator.py | rmanoni/mi-instrument | 1a74ebf7c31131c856fc06d91bef7c72fcfadb54 | [
"BSD-2-Clause"
] | null | null | null | mi/core/instrument/test/test_data_decorator.py | rmanoni/mi-instrument | 1a74ebf7c31131c856fc06d91bef7c72fcfadb54 | [
"BSD-2-Clause"
] | null | null | null | mi/core/instrument/test/test_data_decorator.py | rmanoni/mi-instrument | 1a74ebf7c31131c856fc06d91bef7c72fcfadb54 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
"""
@package ion.services.mi.test.test_data_decorator
@file ion/services/mi/test/test_data_decorator.py
@author Steve Foley
@brief Some unit tests for R2 instrument agent data decorators
"""
__author__ = 'Steve Foley'
__license__ = 'Apache 2.0'
import logging
mi_logger = logging.getLogger('mi_l... | 34.555556 | 116 | 0.684244 | #!/usr/bin/env python
"""
@package ion.services.mi.test.test_data_decorator
@file ion/services/mi/test/test_data_decorator.py
@author Steve Foley
@brief Some unit tests for R2 instrument agent data decorators
"""
__author__ = 'Steve Foley'
__license__ = 'Apache 2.0'
import logging
import unittest
from mi.core.unit_t... | 0 | 939 | 0 | 0 | 0 | 0 | 0 | 65 | 177 |
9c13375bd4f7d7daf5671fbcf8306826ab7bc04d | 160 | py | Python | nlp/handler/ner/__init__.py | AlexanderFalk/nlpproject | 6767132e0925ce502ab7130af16cc325aa63f2ef | [
"Apache-2.0"
] | null | null | null | nlp/handler/ner/__init__.py | AlexanderFalk/nlpproject | 6767132e0925ce502ab7130af16cc325aa63f2ef | [
"Apache-2.0"
] | null | null | null | nlp/handler/ner/__init__.py | AlexanderFalk/nlpproject | 6767132e0925ce502ab7130af16cc325aa63f2ef | [
"Apache-2.0"
] | null | null | null |
__version__ = "0.0.1" | 32 | 60 | 0.81875 | from .custom_ner import NER
from .utils import NerDataset, Split, get_labels
from .arguments import ModelArguments, DataTrainingArguments
__version__ = "0.0.1" | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 72 | 66 |
9fb6ea012af3e83c8e9a7f15104db61c53a1e4e1 | 14,758 | py | Python | test/test_errors.py | timothyrenner/svl | a74c09c49f2e14046acd4b0eeb861f8fef6bca96 | [
"MIT"
] | 8 | 2019-03-27T12:49:21.000Z | 2020-10-10T11:16:25.000Z | test/test_errors.py | timothyrenner/svl | a74c09c49f2e14046acd4b0eeb861f8fef6bca96 | [
"MIT"
] | 65 | 2018-08-26T14:48:45.000Z | 2020-03-17T12:24:42.000Z | test/test_errors.py | timothyrenner/svl | a74c09c49f2e14046acd4b0eeb861f8fef6bca96 | [
"MIT"
] | 1 | 2019-09-13T19:39:07.000Z | 2019-09-13T19:39:07.000Z | import pytest
from svl.compiler.errors import (SvlSyntaxError, SvlMissingValue, SvlMissingParen, SvlTypeError, SvlUnsupportedDeclaration)
from svl.compiler.ast import parse_svl
def test_missing_dataset_definition():
""" Tests that the parse_svl function raises a SvlMissingValue
exception when there's a m... | 27.792844 | 76 | 0.684171 | import pytest
from svl.compiler.errors import (
SvlSyntaxError,
SvlMissingValue,
SvlMissingParen,
SvlTypeError,
SvlUnsupportedDeclaration,
)
from svl.compiler.ast import parse_svl
def test_missing_dataset_definition():
""" Tests that the parse_svl function raises a SvlMissingValue
exc... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 23 | 0 |
e420e9b94a947248465a68f20981d34a68af0c3e | 10,571 | py | Python | Titanic/Titanic.py | blakefren/Kaggle | 557e515a9fbb9a6233bd570dcee116809b41c88b | [
"MIT"
] | null | null | null | Titanic/Titanic.py | blakefren/Kaggle | 557e515a9fbb9a6233bd570dcee116809b41c88b | [
"MIT"
] | null | null | null | Titanic/Titanic.py | blakefren/Kaggle | 557e515a9fbb9a6233bd570dcee116809b41c88b | [
"MIT"
] | null | null | null | # Starter code for Kaggle - Titanic Survivor dataset.
#
# Objective: classify Titanic passengers as surviving or perishing.
#
# Uses a SVM with Gaussian (RBF) kernel.
#
#
# By Blake French
import os
import pandas as pd
from sklearn.metrics import accuracy_score
from sklearn.model_selection import GridSearchCV
fro... | 42.115538 | 147 | 0.659919 | # Starter code for Kaggle - Titanic Survivor dataset.
#
# Objective: classify Titanic passengers as surviving or perishing.
#
# Uses a SVM with Gaussian (RBF) kernel.
#
#
# By Blake French
import os
import re
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn... | 0 | 0 | 0 | 0 | 0 | 5,846 | 0 | 65 | 154 |
60c94d6bf2465c9ed8cc157ba788fc0289920e06 | 2,913 | py | Python | test/e2e/e2e/utils.py | wja30/cortex_0.31 | 522ec6226526dee6b4f8c3ed67bdf2b913d25de3 | [
"Apache-2.0"
] | 1 | 2020-09-09T04:04:30.000Z | 2020-09-09T04:04:30.000Z | test/e2e/e2e/utils.py | wja30/cortex_0.31 | 522ec6226526dee6b4f8c3ed67bdf2b913d25de3 | [
"Apache-2.0"
] | null | null | null | test/e2e/e2e/utils.py | wja30/cortex_0.31 | 522ec6226526dee6b4f8c3ed67bdf2b913d25de3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Cortex Labs, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 28.841584 | 98 | 0.682115 | # Copyright 2021 Cortex Labs, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wri... | 0 | 0 | 0 | 0 | 0 | 2,017 | 0 | 13 | 295 |
05e10c1e44837b111dc010213b67a5b8f893f7e0 | 3,918 | py | Python | demo/trt0.py | Zanderzt/TensorRT_Mask_RCNN | df799e7ac7392b557a834ced92d0cb9b84d24df9 | [
"MIT"
] | 8 | 2020-06-19T00:23:51.000Z | 2022-03-27T16:49:18.000Z | demo/trt0.py | Zanderzt/TensorRT_Mask_RCNN | df799e7ac7392b557a834ced92d0cb9b84d24df9 | [
"MIT"
] | 2 | 2020-06-20T03:29:29.000Z | 2022-01-21T21:24:43.000Z | demo/trt0.py | Zanderzt/TensorRT_Mask_RCNN | df799e7ac7392b557a834ced92d0cb9b84d24df9 | [
"MIT"
] | 5 | 2019-12-28T05:34:12.000Z | 2021-08-31T05:51:53.000Z | import tensorrt as trt
import pycuda.driver as cuda
from timeit import default_timer as timer
TRT_LOGGER = trt.Logger(trt.Logger.WARNING)
with trt.Builder(TRT_LOGGER) as builder, \
builder.create_network() as network, \
trt.OnnxParser(network, TRT_LOGGER) as parser:
builder.max_workspace_size = (1 <... | 35.618182 | 104 | 0.654671 | import tensorrt as trt
import pycuda.driver as cuda
import pycuda.autoinit
import torch
from timeit import default_timer as timer
TRT_LOGGER = trt.Logger(trt.Logger.WARNING)
with trt.Builder(TRT_LOGGER) as builder, \
builder.create_network() as network, \
trt.OnnxParser(network, TRT_LOGGER) as parser:
... | 48 | 0 | 0 | 0 | 0 | 358 | 0 | -8 | 67 |