hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | 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 125 | 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 125 | 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.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
235a3d4ff0e5d1bf5fecc1e13735fcee732041fe | 256 | py | Python | service-workers/service-worker/resources/404.py | ziransun/wpt | ab8f451eb39eb198584d547f5d965ef54df2a86a | [
"BSD-3-Clause"
] | 777 | 2017-08-29T15:15:32.000Z | 2022-03-21T05:29:41.000Z | service-workers/service-worker/resources/404.py | ziransun/wpt | ab8f451eb39eb198584d547f5d965ef54df2a86a | [
"BSD-3-Clause"
] | 66 | 2017-08-30T18:31:18.000Z | 2021-08-02T10:59:35.000Z | service-workers/service-worker/resources/404.py | ziransun/wpt | ab8f451eb39eb198584d547f5d965ef54df2a86a | [
"BSD-3-Clause"
] | 123 | 2017-08-30T01:19:34.000Z | 2022-03-17T22:55:31.000Z | # iframe does not fire onload event if the response's content-type is not
# text/plain or text/html so this script exists if you want to test a 404 load
# in an iframe.
| 42.666667 | 78 | 0.710938 | # iframe does not fire onload event if the response's content-type is not
# text/plain or text/html so this script exists if you want to test a 404 load
# in an iframe.
def main(req, res):
return 404, [('Content-Type', 'text/plain')], "Page not found"
| 65 | 0 | 22 |
517c22cfe82043b38d80851cd70c2a6b3727da78 | 1,001 | py | Python | tests/integration/modules/test_chocolatey.py | fake-name/salt | d8f04936e4407f51946e32e8166159778f6c31a5 | [
"Apache-2.0"
] | 1 | 2020-07-22T18:41:34.000Z | 2020-07-22T18:41:34.000Z | tests/integration/modules/test_chocolatey.py | fake-name/salt | d8f04936e4407f51946e32e8166159778f6c31a5 | [
"Apache-2.0"
] | 2 | 2021-04-30T21:17:57.000Z | 2021-12-13T20:40:23.000Z | tests/integration/modules/test_chocolatey.py | fake-name/salt | d8f04936e4407f51946e32e8166159778f6c31a5 | [
"Apache-2.0"
] | 1 | 2015-08-26T09:46:04.000Z | 2015-08-26T09:46:04.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import pytest
import salt.modules.chocolatey as choco
import salt.utils.platform
from tests.support.case import ModuleCase
from tests.support.helpers import destructiveTest
from tests.support.unit import skipIf
@skipIf(not salt.utils.platform.is_windows... | 29.441176 | 84 | 0.701299 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import pytest
import salt.modules.chocolatey as choco
import salt.utils.platform
from tests.support.case import ModuleCase
from tests.support.helpers import destructiveTest
from tests.support.unit import skipIf
@skipIf(not salt.utils.platform.is_windows... | 131 | 0 | 27 |
54b275eb16735587a1855a2f0bdbedc10d14a7d7 | 103 | py | Python | Bangu/Semana 4/Exemplo007/main.py | profoswaldo/Unisuam_2022-1 | cd0faad61480030d1320515a8104373ada70545b | [
"MIT"
] | 2 | 2022-03-25T02:04:11.000Z | 2022-03-25T09:26:44.000Z | Bangu/Semana 4/Exemplos de Sala de Aula/Exemplo007/main.py | profoswaldo/Unisuam_2022-1 | cd0faad61480030d1320515a8104373ada70545b | [
"MIT"
] | null | null | null | Bangu/Semana 4/Exemplos de Sala de Aula/Exemplo007/main.py | profoswaldo/Unisuam_2022-1 | cd0faad61480030d1320515a8104373ada70545b | [
"MIT"
] | null | null | null | # Desenvolva um algoritmo em Python que exiba os números de 1 a 10
for i in range(1,11,1):
print(i) | 20.6 | 66 | 0.708738 | # Desenvolva um algoritmo em Python que exiba os números de 1 a 10
for i in range(1,11,1):
print(i) | 0 | 0 | 0 |
d563aab732864dee1d4c974c112d8fdbf4d1c265 | 4,480 | py | Python | aaxus/api/authentication.py | JonLMyers/MetroTransitAPI | d8f467570368cd563d69564b680cfdd47ad6b622 | [
"MIT"
] | null | null | null | aaxus/api/authentication.py | JonLMyers/MetroTransitAPI | d8f467570368cd563d69564b680cfdd47ad6b622 | [
"MIT"
] | null | null | null | aaxus/api/authentication.py | JonLMyers/MetroTransitAPI | d8f467570368cd563d69564b680cfdd47ad6b622 | [
"MIT"
] | null | null | null | """ Authentication Managment API """
import json
from flask import jsonify, request
from flask_restful import Resource, reqparse
from aaxus import rest_api
from aaxus.models.user import User
from aaxus.models.token import RevokedToken
from aaxus.services.confirm_email import generate_confirmation_token, confirm_token
f... | 35.555556 | 147 | 0.616964 | """ Authentication Managment API """
import json
from flask import jsonify, request
from flask_restful import Resource, reqparse
from aaxus import rest_api
from aaxus.models.user import User
from aaxus.models.token import RevokedToken
from aaxus.services.confirm_email import generate_confirmation_token, confirm_token
f... | 3,217 | 272 | 270 |
830e4dc5902bdde8b1fa900975eb2f5de536a7dd | 2,041 | py | Python | rurina2/widgets/seekbar.py | TeaCondemns/rurina | 43725ebea5872953125271a9abb300a4e3a80a64 | [
"MIT"
] | null | null | null | rurina2/widgets/seekbar.py | TeaCondemns/rurina | 43725ebea5872953125271a9abb300a4e3a80a64 | [
"MIT"
] | null | null | null | rurina2/widgets/seekbar.py | TeaCondemns/rurina | 43725ebea5872953125271a9abb300a4e3a80a64 | [
"MIT"
] | null | null | null | from widgets.button import DraggableButton
from prefabs.inputter import pressed
from base_node import get_surface
from widgets.progressbar import *
from prefabs.surface import blit
from shape import Circle
import pygame
__all__ = [
'HSeekbar'
]
| 30.014706 | 111 | 0.577658 | from widgets.button import DraggableButton
from prefabs.inputter import pressed
from base_node import get_surface
from widgets.progressbar import *
from prefabs.surface import blit
from shape import Circle
import pygame
class HSeekbar(HProgressBar):
hovered = pressed = False
def __init__(self, *args, thumb_c... | 1,620 | 146 | 23 |
c592d14c7fed3cf420a8da1908a48c85bf4957eb | 5,834 | py | Python | app/DBModel.py | Bye-lemon/Open-Lab-Management-System | f72197cd4cf9979868a74c89b493ffc6047ab933 | [
"MIT"
] | 2 | 2018-08-20T07:39:09.000Z | 2021-08-04T12:10:18.000Z | app/DBModel.py | Bye-lemon/Open-Lab-Management-System | f72197cd4cf9979868a74c89b493ffc6047ab933 | [
"MIT"
] | null | null | null | app/DBModel.py | Bye-lemon/Open-Lab-Management-System | f72197cd4cf9979868a74c89b493ffc6047ab933 | [
"MIT"
] | null | null | null | from flask import current_app
from flask_login import UserMixin, AnonymousUserMixin
import hashlib
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from werkzeug.security import generate_password_hash, check_password_hash
from . import db, login_manager
login_manager.anonymous_user = Anonymo... | 31.365591 | 96 | 0.631985 | from flask import current_app
from flask_login import UserMixin, AnonymousUserMixin
import hashlib
from itsdangerous import TimedJSONWebSignatureSerializer as Serializer
from werkzeug.security import generate_password_hash, check_password_hash
from . import db, login_manager
class Permission:
ACCESS = 1
RENT ... | 3,804 | 1,430 | 232 |
c6cd5547ae9d02f6abe1e847bd89b6af58659d03 | 2,105 | py | Python | fitbenchmarking/utils/log.py | fitbenchmarking/fitbenchmarking | ea398efa61f071dc64fe7c3b484d5bb4e1897856 | [
"BSD-3-Clause"
] | 6 | 2019-07-22T01:56:10.000Z | 2021-12-10T05:29:30.000Z | fitbenchmarking/utils/log.py | fitbenchmarking/fitbenchmarking | ea398efa61f071dc64fe7c3b484d5bb4e1897856 | [
"BSD-3-Clause"
] | 677 | 2019-04-29T10:23:49.000Z | 2022-03-22T12:01:30.000Z | fitbenchmarking/utils/log.py | fitbenchmarking/fitbenchmarking | ea398efa61f071dc64fe7c3b484d5bb4e1897856 | [
"BSD-3-Clause"
] | 8 | 2019-06-13T10:32:17.000Z | 2020-12-09T15:08:40.000Z | """
Utility functions to support logging for the fitbenchmarking
project.
"""
import logging
import sys
def setup_logger(log_file='./fitbenchmarking.log', name='fitbenchmarking',
append=False, level='INFO'):
"""
Define the location and style of the log file.
:param log_file: path to the ... | 31.893939 | 78 | 0.658907 | """
Utility functions to support logging for the fitbenchmarking
project.
"""
import logging
import sys
def setup_logger(log_file='./fitbenchmarking.log', name='fitbenchmarking',
append=False, level='INFO'):
"""
Define the location and style of the log file.
:param log_file: path to the ... | 0 | 0 | 0 |
483ef9813db17a4867c3963274a126d2a0424222 | 6,517 | py | Python | glue/plugins/wcs_autolinking/tests/test_wcs_autolinking.py | nilswagner/glue | 1e16776f557482cc8444d2b8ecbb813ce691a70d | [
"BSD-3-Clause"
] | null | null | null | glue/plugins/wcs_autolinking/tests/test_wcs_autolinking.py | nilswagner/glue | 1e16776f557482cc8444d2b8ecbb813ce691a70d | [
"BSD-3-Clause"
] | null | null | null | glue/plugins/wcs_autolinking/tests/test_wcs_autolinking.py | nilswagner/glue | 1e16776f557482cc8444d2b8ecbb813ce691a70d | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from astropy.wcs import WCS
from glue.core import Data, DataCollection
from glue.plugins.wcs_autolinking.wcs_autolinking import wcs_autolink, WCSLink
from glue.core.link_helpers import MultiLink
from glue.core.tests.test_state import clone
from glue.dialogs.link_editor.state import EditableLinkFunct... | 26.81893 | 79 | 0.621758 | import numpy as np
from astropy.wcs import WCS
from glue.core import Data, DataCollection
from glue.plugins.wcs_autolinking.wcs_autolinking import wcs_autolink, WCSLink
from glue.core.link_helpers import MultiLink
from glue.core.tests.test_state import clone
from glue.dialogs.link_editor.state import EditableLinkFunct... | 5,996 | 0 | 184 |
a2b04a774a050b592b74932e6b84e1905667488d | 985 | py | Python | tools/beerocks_analyzer/logger_setup.py | WeiXiaoQian/prplMesh | 4a86f5378d8bf77148dcfa1da474a47bd31416c1 | [
"BSD-2-Clause-Patent"
] | 85 | 2018-10-24T22:18:35.000Z | 2022-02-24T09:11:56.000Z | tools/beerocks_analyzer/logger_setup.py | WeiXiaoQian/prplMesh | 4a86f5378d8bf77148dcfa1da474a47bd31416c1 | [
"BSD-2-Clause-Patent"
] | 1,105 | 2018-10-03T14:04:58.000Z | 2020-08-14T21:22:55.000Z | tools/beerocks_analyzer/logger_setup.py | WeiXiaoQian/prplMesh | 4a86f5378d8bf77148dcfa1da474a47bd31416c1 | [
"BSD-2-Clause-Patent"
] | 43 | 2018-11-12T22:51:40.000Z | 2021-12-26T07:40:39.000Z | import logging
import logging.config
import yaml
class StderrFilter(logging.Filter):
"""Simple filter which only outputs the following levels: WARNING, ERROR, CRITICAL.
"""
class FormatRecordFactory(logging.LogRecord):
"""A factory which formats messages with str.format."""
def getMessage(self):
... | 28.970588 | 87 | 0.674112 | import logging
import logging.config
import yaml
class StderrFilter(logging.Filter):
"""Simple filter which only outputs the following levels: WARNING, ERROR, CRITICAL.
"""
def filter(self, rec):
return rec.levelno in (logging.WARNING, logging.ERROR, logging.CRITICAL)
def setup_logger():
wi... | 275 | 0 | 50 |
945deff42e68b848cb8e0c24012b247f3479b378 | 1,945 | py | Python | SiF/bruker/views.py | karendahlaarhus/TDT4140-programvareutvikling | f966ff3f2286c4875edbb5c77d1f9073a10b56c6 | [
"MIT"
] | null | null | null | SiF/bruker/views.py | karendahlaarhus/TDT4140-programvareutvikling | f966ff3f2286c4875edbb5c77d1f9073a10b56c6 | [
"MIT"
] | null | null | null | SiF/bruker/views.py | karendahlaarhus/TDT4140-programvareutvikling | f966ff3f2286c4875edbb5c77d1f9073a10b56c6 | [
"MIT"
] | null | null | null | from django.shortcuts import render, redirect
from django.views.generic import TemplateView
from .forms import BrukerForm
from .models import bruker
from vaskelister.models import Vaskeliste
from studentby.models import studentby
from kollektiv.models import kollektiv
| 49.871795 | 133 | 0.620566 | from django.shortcuts import render, redirect
from django.views.generic import TemplateView
from .forms import BrukerForm
from .models import bruker
from vaskelister.models import Vaskeliste
from studentby.models import studentby
from kollektiv.models import kollektiv
class LoginView(TemplateView):
def get(self, r... | 1,591 | 9 | 75 |
14794996cf5cc4c97234a6d47ee5b25a2cf5a071 | 2,019 | py | Python | src/prepare_corpus/prepare_chat.py | lingeen/lingeen-Ying | b7d4771d556e2168bd3dfae15b39336046319a9c | [
"Apache-2.0"
] | null | null | null | src/prepare_corpus/prepare_chat.py | lingeen/lingeen-Ying | b7d4771d556e2168bd3dfae15b39336046319a9c | [
"Apache-2.0"
] | null | null | null | src/prepare_corpus/prepare_chat.py | lingeen/lingeen-Ying | b7d4771d556e2168bd3dfae15b39336046319a9c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# @Time : 2020/12/27 10:58 PM
# @Author : Kevin
from src.utils.sentence_process import cut_sentence_by_character
from tqdm import tqdm
from src import config
if __name__ == '__main__':
# cut_chat_data_by_character()
clean_blank_pair()
| 35.421053 | 111 | 0.684497 | # -*- coding: utf-8 -*-
# @Time : 2020/12/27 10:58 PM
# @Author : Kevin
from src.utils.sentence_process import cut_sentence_by_character
from tqdm import tqdm
from src import config
def cut_chat_data_by_character():
asks=open(config.project_home_path_prefix+"/data/chat/ask.txt",'r').readlines()
with open... | 1,731 | 0 | 46 |
3024091a4fe382c0c7160623dc086f20d381b1e8 | 4,702 | py | Python | MotorControl1/leg_animation.py | albertgo98/BipedalRobot | dc354061fceec5317f441901f842afc889167edb | [
"MIT"
] | null | null | null | MotorControl1/leg_animation.py | albertgo98/BipedalRobot | dc354061fceec5317f441901f842afc889167edb | [
"MIT"
] | null | null | null | MotorControl1/leg_animation.py | albertgo98/BipedalRobot | dc354061fceec5317f441901f842afc889167edb | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets import Slider, Button
import math
from scipy.optimize import fsolve
#Define Link Lengths
l1 = 2
l2 = 4.977
l3 = 2
l4 = 4
l5 = 1.5
l6 = 6
#Initial Motorized Joint Angles
theta_1 = -(math.pi/180)*110
theta_4 = -(math.pi/180)*80
#Fixed Joint A ... | 21.276018 | 78 | 0.671629 | import numpy as np
import matplotlib.pyplot as plt
from matplotlib.widgets import Slider, Button
import math
from scipy.optimize import fsolve
def equations(vars, *args):
x, y = vars
eq1 = (args[0]-x)**2+(args[1]-y)**2-l2**2
eq2 = (args[2]-x)**2+(args[3]-y)**2-l3**2
return [eq1, eq2]
#Define Link Lengths
l1 ... | 1,916 | 0 | 69 |
dd8ae9bac29601db4cfa6829363b7f9d800c654f | 2,444 | py | Python | common/test/test_common_funcs.py | eribean/RyStats | 1cdd0ea55a074cc81e61d2845216f395ba095f10 | [
"MIT"
] | 4 | 2021-08-05T11:47:30.000Z | 2021-10-31T12:03:48.000Z | common/test/test_common_funcs.py | eribean/RyStats | 1cdd0ea55a074cc81e61d2845216f395ba095f10 | [
"MIT"
] | 12 | 2021-08-05T11:43:22.000Z | 2021-10-29T18:05:48.000Z | common/test/test_common_funcs.py | eribean/RyStats | 1cdd0ea55a074cc81e61d2845216f395ba095f10 | [
"MIT"
] | null | null | null | import unittest
import numpy as np
from RyStats.common import entropy, hypersphere, procrustes_rotation
class TestCommonFunctions(unittest.TestCase):
"""Tests fixture for the common functions."""
def test_entropy(self):
"""Testing entropy calculations."""
# One value in each column should h... | 35.941176 | 75 | 0.644845 | import unittest
import numpy as np
from RyStats.common import entropy, hypersphere, procrustes_rotation
class TestCommonFunctions(unittest.TestCase):
"""Tests fixture for the common functions."""
def test_entropy(self):
"""Testing entropy calculations."""
# One value in each column should h... | 0 | 0 | 0 |
a7900cc4ec96dee2a0e9be99b04a3748a6903f1d | 5,199 | py | Python | tensorflow_graphics/rendering/tests/rasterization_test_utils.py | Tensorflow-Devs/graphics | e03fb62b8ee15a026bde7e27e4f3aa5ebc9413a1 | [
"Apache-2.0"
] | null | null | null | tensorflow_graphics/rendering/tests/rasterization_test_utils.py | Tensorflow-Devs/graphics | e03fb62b8ee15a026bde7e27e4f3aa5ebc9413a1 | [
"Apache-2.0"
] | null | null | null | tensorflow_graphics/rendering/tests/rasterization_test_utils.py | Tensorflow-Devs/graphics | e03fb62b8ee15a026bde7e27e4f3aa5ebc9413a1 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The TensorFlow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 39.386364 | 79 | 0.728025 | # Copyright 2020 The TensorFlow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 64 | 0 | 23 |
bdfa321a6f6c992562487a7695a81c379316beca | 1,366 | py | Python | vectornet/main.py | chickenfingerwu/pytorch-CycleGAN-and-pix2pix | 367033f7d265fc7307ed0c917a4f8d19b298e6b7 | [
"BSD-3-Clause"
] | null | null | null | vectornet/main.py | chickenfingerwu/pytorch-CycleGAN-and-pix2pix | 367033f7d265fc7307ed0c917a4f8d19b298e6b7 | [
"BSD-3-Clause"
] | null | null | null | vectornet/main.py | chickenfingerwu/pytorch-CycleGAN-and-pix2pix | 367033f7d265fc7307ed0c917a4f8d19b298e6b7 | [
"BSD-3-Clause"
] | null | null | null | from config import get_config
from utils import prepare_dirs_and_logger, save_config
if __name__ == "__main__":
config, unparsed = get_config()
main(config)
| 31.045455 | 54 | 0.625183 | from config import get_config
from utils import prepare_dirs_and_logger, save_config
def main(config):
prepare_dirs_and_logger(config)
save_config(config)
if config.is_train:
from trainer import Trainer
if config.dataset == 'line':
from data_line import BatchManager
el... | 1,175 | 0 | 23 |
d1ccffa481c9fd8b36ac469a66a71168dcb228c3 | 91 | py | Python | utils/directories.py | Speters1086/res_strava_reader | cab5e98d40df451251b20584155fad68767e97d9 | [
"MIT"
] | null | null | null | utils/directories.py | Speters1086/res_strava_reader | cab5e98d40df451251b20584155fad68767e97d9 | [
"MIT"
] | 3 | 2020-09-29T08:25:39.000Z | 2020-09-29T08:26:55.000Z | utils/directories.py | Speters1086/res_strava_reader | cab5e98d40df451251b20584155fad68767e97d9 | [
"MIT"
] | null | null | null | import os
PROJECT_ROOT_DIR = os.path.abspath(os.path.join(__file__, os.pardir, os.pardir)) | 30.333333 | 80 | 0.78022 | import os
PROJECT_ROOT_DIR = os.path.abspath(os.path.join(__file__, os.pardir, os.pardir)) | 0 | 0 | 0 |
968cac91fe3b29659fd2848b4c9d0c0822767f33 | 2,819 | py | Python | models/eligibility_trace_tf/world/updater.py | qLience/AI-Pump-for-Underfloor-Heating-systems | 9696f36b59d2821bd5f61b2304b43406d7d9c549 | [
"MIT"
] | 31 | 2018-07-23T17:50:42.000Z | 2022-02-23T18:25:52.000Z | models/eligibility_trace_tf/world/updater.py | qLience/AI-Pump-for-Underfloor-Heating-systems | 9696f36b59d2821bd5f61b2304b43406d7d9c549 | [
"MIT"
] | null | null | null | models/eligibility_trace_tf/world/updater.py | qLience/AI-Pump-for-Underfloor-Heating-systems | 9696f36b59d2821bd5f61b2304b43406d7d9c549 | [
"MIT"
] | 9 | 2018-07-23T17:50:45.000Z | 2020-07-31T13:31:14.000Z | import time
from collections import deque
from models.eligibility_trace_tf.world.memory.n_step_replay_memory import NStepReplayMemory, Transition, NStepTransition
| 39.152778 | 120 | 0.655552 | import time
from collections import deque
from models.eligibility_trace_tf.world.memory.n_step_replay_memory import NStepReplayMemory, Transition, NStepTransition
class Updater:
def __init__(self, reward_calculator, ai_input_provider, ai, score_history, env, params):
self.params = params
self.en... | 2,584 | -7 | 76 |
4bff910221ac8403d256f69405e95a0999311a10 | 355 | py | Python | scripts/xli_utilities.py | ilyaus/jmeter-log-analyzer | 21f04dda84e6f69a3958e66cecb7d6b8c3108421 | [
"MIT"
] | null | null | null | scripts/xli_utilities.py | ilyaus/jmeter-log-analyzer | 21f04dda84e6f69a3958e66cecb7d6b8c3108421 | [
"MIT"
] | 1 | 2019-12-11T17:54:42.000Z | 2020-11-06T15:33:16.000Z | scripts/xli_utilities.py | ilyaus/jmeter-log-analyzer | 21f04dda84e6f69a3958e66cecb7d6b8c3108421 | [
"MIT"
] | null | null | null | import re
| 20.882353 | 80 | 0.622535 | import re
def s3_path_combine(*args):
ret_val = ('/'.join(args)).replace('//', '/').replace('https:/', 'https://')
ret_val = ret_val[1:] if ret_val.startswith('/') else ret_val
return ret_val
def do_match(regex, string, group_idx=1):
match = re.search(regex, string)
if match:
return mat... | 297 | 0 | 46 |
bb15e1e433cd27112b9b2c8ee4a9ff9f77dd179a | 3,792 | py | Python | util/probabilistic_ordinal_embedding.py | narutatsuri/uniform-distribution-corpus-generator | 9c2ca1db3495ff160ba43fc86ce356e1a4eca792 | [
"MIT"
] | null | null | null | util/probabilistic_ordinal_embedding.py | narutatsuri/uniform-distribution-corpus-generator | 9c2ca1db3495ff160ba43fc86ce356e1a4eca792 | [
"MIT"
] | null | null | null | util/probabilistic_ordinal_embedding.py | narutatsuri/uniform-distribution-corpus-generator | 9c2ca1db3495ff160ba43fc86ce356e1a4eca792 | [
"MIT"
] | null | null | null | from util.functions import *
from util import *
from tqdm import tqdm
import matplotlib.pyplot as plt
import itertools
def probabilistic_ordinal_embedding_prepare_data_for_training(dataset,
model):
"""
"""
triplets = []
for word... | 41.67033 | 137 | 0.589662 | from util.functions import *
from util import *
from tqdm import tqdm
import matplotlib.pyplot as plt
import itertools
class probabilistic_ordinal_embedding(object):
def __init__(self, dimension):
self.N = dimension
self.X_train = []
self.alpha = 0.0001
self.onehots = get_onehots(s... | 2,028 | 25 | 216 |
6381b9238a0d7b759f27af4599f8bcd432a5514f | 4,219 | py | Python | shops/frame_test.py | haihai210/tcds | c7138750d3003a5904a2c4dcfd6bd00527447e5e | [
"Apache-2.0"
] | null | null | null | shops/frame_test.py | haihai210/tcds | c7138750d3003a5904a2c4dcfd6bd00527447e5e | [
"Apache-2.0"
] | null | null | null | shops/frame_test.py | haihai210/tcds | c7138750d3003a5904a2c4dcfd6bd00527447e5e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun Nov 12 17:17:09 2017
@author: sh
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import pickle
import tools_lib as tool
import math
load_predata_path = 'F:\\tcds\\shop\\predata\\'
file = open(load_predata_path + 'data_mall_shop.pkl'... | 40.567308 | 138 | 0.57004 | # -*- coding: utf-8 -*-
"""
Created on Sun Nov 12 17:17:09 2017
@author: sh
"""
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import pickle
import tools_lib as tool
import math
load_predata_path = 'F:\\tcds\\shop\\predata\\'
file = open(load_predata_path + 'data_mall_shop.pkl'... | 0 | 0 | 0 |
da8967fce9299c69f20e117d98640cbdaf3d0812 | 8,555 | py | Python | tests/test_environments.py | UTexas-PSAAP/Parla.py | 3d92a156be41983e32576940ef6baffd78d4eb84 | [
"BSD-3-Clause"
] | 11 | 2020-06-22T16:20:15.000Z | 2022-03-20T22:54:40.000Z | tests/test_environments.py | UTexas-PSAAP/Parla.py | 3d92a156be41983e32576940ef6baffd78d4eb84 | [
"BSD-3-Clause"
] | 86 | 2019-10-24T07:43:05.000Z | 2022-03-28T05:20:17.000Z | tests/test_environments.py | UTexas-PSAAP/Parla.py | 3d92a156be41983e32576940ef6baffd78d4eb84 | [
"BSD-3-Clause"
] | 7 | 2019-10-24T05:46:27.000Z | 2022-02-09T19:47:58.000Z | import logging
import threading
from time import sleep
import pytest
from parla import Parla, TaskEnvironment
from parla.cpu import cpu
from parla.environments import EnvironmentComponentInstance, EnvironmentComponentDescriptor
from parla.tasks import *
logger = logging.getLogger(__name__)
def repetitions():
""... | 37.358079 | 111 | 0.611689 | import logging
import threading
from time import sleep
import pytest
from parla import Parla, TaskEnvironment
from parla.cpu import cpu
from parla.environments import EnvironmentComponentInstance, EnvironmentComponentDescriptor
from parla.tasks import *
logger = logging.getLogger(__name__)
def repetitions():
""... | 6,869 | 70 | 389 |
c835af8e95bd7e7754f6f34f2a6e360fe5a23bf7 | 2,148 | py | Python | tests/test_dates.py | uk-gov-mirror/ministryofjustice.money-to-prisoners-common | 283a72e796915c99cc5ed53b44f67d79628ffac8 | [
"MIT"
] | 7 | 2016-01-05T12:21:57.000Z | 2020-01-17T07:23:31.000Z | tests/test_dates.py | uk-gov-mirror/ministryofjustice.money-to-prisoners-common | 283a72e796915c99cc5ed53b44f67d79628ffac8 | [
"MIT"
] | 82 | 2015-09-30T11:52:54.000Z | 2022-03-28T09:11:21.000Z | tests/test_dates.py | uk-gov-mirror/ministryofjustice.money-to-prisoners-common | 283a72e796915c99cc5ed53b44f67d79628ffac8 | [
"MIT"
] | 1 | 2021-04-11T06:14:15.000Z | 2021-04-11T06:14:15.000Z | from unittest import mock
from datetime import date
from django.test import SimpleTestCase
from mtp_common.dates import WorkdayChecker
TEST_HOLIDAYS = {'england-and-wales': {
'division': 'england-and-wales',
'events': [
{'title': 'Boxing Day', 'date': '2016-12-26', 'notes': '', 'bunting': True},
... | 38.357143 | 101 | 0.696462 | from unittest import mock
from datetime import date
from django.test import SimpleTestCase
from mtp_common.dates import WorkdayChecker
TEST_HOLIDAYS = {'england-and-wales': {
'division': 'england-and-wales',
'events': [
{'title': 'Boxing Day', 'date': '2016-12-26', 'notes': '', 'bunting': True},
... | 1,409 | 24 | 293 |
6edc45ee69cb4b3cb110556b26254eff9d6e0399 | 2,414 | py | Python | attention/experiments/attention_networks_testing.py | fbickfordsmith/attention-msc | 1e816ddc9a40446096f7c6b61648e23065c54d5b | [
"MIT"
] | 1 | 2020-06-21T07:55:44.000Z | 2020-06-21T07:55:44.000Z | attention/experiments/attention_networks_testing.py | fbickfordsmith/attention | 1e816ddc9a40446096f7c6b61648e23065c54d5b | [
"MIT"
] | null | null | null | attention/experiments/attention_networks_testing.py | fbickfordsmith/attention | 1e816ddc9a40446096f7c6b61648e23065c54d5b | [
"MIT"
] | null | null | null | """
Test attention networks on ImageNet.
"""
gpu = input('GPU: ')
type_category_set = input('Category-set type in {diff, sem, sim, size}: ')
version_wnids = input('Version number (WNIDs): ')
version_weights = input('Version number (weights): ')
start = int(input('Start category set: '))
stop = int(input('Stop category... | 38.935484 | 80 | 0.735708 | """
Test attention networks on ImageNet.
"""
gpu = input('GPU: ')
type_category_set = input('Category-set type in {diff, sem, sim, size}: ')
version_wnids = input('Version number (WNIDs): ')
version_weights = input('Version number (weights): ')
start = int(input('Start category set: '))
stop = int(input('Stop category... | 0 | 0 | 0 |
136dd0b8714a32a8c10e304ef9ffafb08f9b2474 | 758 | py | Python | test.py | thevaccinetracker/data_engine | 5a0c43cf0653a0b0f1e3da6c0f2d605aef143a07 | [
"MIT"
] | null | null | null | test.py | thevaccinetracker/data_engine | 5a0c43cf0653a0b0f1e3da6c0f2d605aef143a07 | [
"MIT"
] | null | null | null | test.py | thevaccinetracker/data_engine | 5a0c43cf0653a0b0f1e3da6c0f2d605aef143a07 | [
"MIT"
] | null | null | null | statement = """"Institute of Medical Biology, Chinese Academy of Medical Sciences",Vaccine,Inactivated virus,Phase II,Phase II began June 2020,Inactivated,NCT04412538,Unknown,,,N/A,https://docs.google.com/document/d/1Y4nCJJ4njzD1wiHbufCY6gqfRmj49Qn_qNgOJD62Wik/edit,6/23/2020"""
parseRowToCell(statement) | 36.095238 | 278 | 0.645119 | statement = """"Institute of Medical Biology, Chinese Academy of Medical Sciences",Vaccine,Inactivated virus,Phase II,Phase II began June 2020,Inactivated,NCT04412538,Unknown,,,N/A,https://docs.google.com/document/d/1Y4nCJJ4njzD1wiHbufCY6gqfRmj49Qn_qNgOJD62Wik/edit,6/23/2020"""
def parseRowToCell(row):
isSingleWo... | 429 | 0 | 23 |
da085cac0f85020ccf226fc9e9f1d7f3d3149154 | 1,764 | py | Python | cats/cat2k.py | CoroboBred/MultiCat-Mania | 734b0a1d0cf077a79b0389873116f5eaf3ca44c2 | [
"MIT"
] | 5 | 2021-03-12T05:14:41.000Z | 2021-04-18T16:54:53.000Z | cats/cat2k.py | CoroboBred/MultiCat-Mania | 734b0a1d0cf077a79b0389873116f5eaf3ca44c2 | [
"MIT"
] | null | null | null | cats/cat2k.py | CoroboBred/MultiCat-Mania | 734b0a1d0cf077a79b0389873116f5eaf3ca44c2 | [
"MIT"
] | 1 | 2021-03-16T05:48:57.000Z | 2021-03-16T05:48:57.000Z | from PyQt5 import QtWidgets, QtGui, QtCore # import PyQt5 widgets
from cats import cat
| 34.588235 | 94 | 0.633787 | from PyQt5 import QtWidgets, QtGui, QtCore # import PyQt5 widgets
from cats import cat
class Cat1k(cat.Cat):
def __init__(self, key, textures, timer):
super(Cat1k, self).__init__()
self.key = key
class Cat2k(cat.Cat):
def __init__(self, keys, textures, timer):
super(Cat2k, self).__i... | 1,522 | 0 | 152 |
29257d470b4037494c38c2b98a791beb890fc0a8 | 10,468 | py | Python | tune_sklearn/_trainable.py | holgern/tune-sklearn | a16b5e1726911db5d03770b0d5c77eda6c8937ed | [
"Apache-2.0"
] | null | null | null | tune_sklearn/_trainable.py | holgern/tune-sklearn | a16b5e1726911db5d03770b0d5c77eda6c8937ed | [
"Apache-2.0"
] | null | null | null | tune_sklearn/_trainable.py | holgern/tune-sklearn | a16b5e1726911db5d03770b0d5c77eda6c8937ed | [
"Apache-2.0"
] | null | null | null | """ Helper class to train models using Ray backend
"""
import ray
from ray.tune import Trainable
from sklearn.base import clone
from sklearn.model_selection import cross_validate
from sklearn.utils.metaestimators import _safe_split
import numpy as np
import os
from pickle import PicklingError
import ray.cloudpickle as... | 37.927536 | 80 | 0.55512 | """ Helper class to train models using Ray backend
"""
import ray
from ray.tune import Trainable
from sklearn.base import clone
from sklearn.model_selection import cross_validate
from sklearn.utils.metaestimators import _safe_split
import numpy as np
import os
from pickle import PicklingError
import ray.cloudpickle as... | 739 | 0 | 269 |
867b49dd16e43d71eee9efabd6f31114e794ac04 | 651 | py | Python | src/dsfs/linalg/matrix.py | dbradf/dsfs | efcd08ca56b4e14b926cc824f15474b04a9d94cb | [
"Apache-2.0"
] | null | null | null | src/dsfs/linalg/matrix.py | dbradf/dsfs | efcd08ca56b4e14b926cc824f15474b04a9d94cb | [
"Apache-2.0"
] | null | null | null | src/dsfs/linalg/matrix.py | dbradf/dsfs | efcd08ca56b4e14b926cc824f15474b04a9d94cb | [
"Apache-2.0"
] | null | null | null | from typing import List, Tuple, Callable
from dsfs.linalg.vector import Vector
Matrix = List[List[float]]
| 23.25 | 85 | 0.662058 | from typing import List, Tuple, Callable
from dsfs.linalg.vector import Vector
Matrix = List[List[float]]
def shape(A: Matrix) -> Tuple[int, int]:
num_rows = len(A)
num_cols = len(A[0]) if A else 0
return num_rows, num_cols
def get_row(A: Matrix, i: int) -> Vector:
return A[i]
def get_column(A: ... | 423 | 0 | 115 |
a1c01a9ec80e340aef33ae7d3eb75484d417c4b9 | 379 | py | Python | src/split_stub.py | Sriharsha-Pamidi/Multi-Class-Fit-Prediction | 52577977d85060c2713b83646593b708e561b7ce | [
"MIT"
] | null | null | null | src/split_stub.py | Sriharsha-Pamidi/Multi-Class-Fit-Prediction | 52577977d85060c2713b83646593b708e561b7ce | [
"MIT"
] | null | null | null | src/split_stub.py | Sriharsha-Pamidi/Multi-Class-Fit-Prediction | 52577977d85060c2713b83646593b708e561b7ce | [
"MIT"
] | 1 | 2022-01-12T06:20:34.000Z | 2022-01-12T06:20:34.000Z | #!/usr/bin/env python
# coding: utf-8
import pandas as pd
import numpy as np
dataset = pd.read_json('../data/renttherunway_final_data.json.gz', lines=True)
dataset = dataset.dropna()
train_data, validation_data, test_data = np.split(dataset.sample(frac=1, random_state=42),
... | 23.6875 | 96 | 0.630607 | #!/usr/bin/env python
# coding: utf-8
import pandas as pd
import numpy as np
dataset = pd.read_json('../data/renttherunway_final_data.json.gz', lines=True)
dataset = dataset.dropna()
train_data, validation_data, test_data = np.split(dataset.sample(frac=1, random_state=42),
... | 0 | 0 | 0 |
1859dd1982b8032ae6d2c4c0b3175f50a6d07d91 | 1,572 | py | Python | saleor/search/backends/postgresql_dashboard.py | jdruiter/saleor | 9393ac20bd3e82c8ec1f17f6e47e3d7379f20419 | [
"BSD-3-Clause"
] | null | null | null | saleor/search/backends/postgresql_dashboard.py | jdruiter/saleor | 9393ac20bd3e82c8ec1f17f6e47e3d7379f20419 | [
"BSD-3-Clause"
] | 1 | 2022-02-10T14:46:00.000Z | 2022-02-10T14:46:00.000Z | saleor/search/backends/postgresql_dashboard.py | jdruiter/saleor | 9393ac20bd3e82c8ec1f17f6e47e3d7379f20419 | [
"BSD-3-Clause"
] | null | null | null | from django.contrib.postgres.search import SearchVector
from ...product.models import Product
from ...order.models import Order
from ...userprofile.models import User
def search_products(phrase):
'''Dashboard full text product search'''
sv = SearchVector('name', 'description')
return Product.objects.anno... | 29.660377 | 72 | 0.680662 | from django.contrib.postgres.search import SearchVector
from ...product.models import Product
from ...order.models import Order
from ...userprofile.models import User
def search_products(phrase):
'''Dashboard full text product search'''
sv = SearchVector('name', 'description')
return Product.objects.anno... | 0 | 0 | 0 |
9ab4c60fad4ff9e157ce876c386b033381bca22f | 2,433 | py | Python | two_thinning/strategies/multi_stage_threshold_strategy.py | varikakasandor/dissertation-balls-into-bins | fba69dd5ffd0b4984795c9a5ec119bf8c6f47d9e | [
"Apache-2.0"
] | null | null | null | two_thinning/strategies/multi_stage_threshold_strategy.py | varikakasandor/dissertation-balls-into-bins | fba69dd5ffd0b4984795c9a5ec119bf8c6f47d9e | [
"Apache-2.0"
] | null | null | null | two_thinning/strategies/multi_stage_threshold_strategy.py | varikakasandor/dissertation-balls-into-bins | fba69dd5ffd0b4984795c9a5ec119bf8c6f47d9e | [
"Apache-2.0"
] | null | null | null | from math import log, floor
from two_thinning.strategies.strategy_base import StrategyBase
| 45.055556 | 195 | 0.567201 | from math import log, floor
from two_thinning.strategies.strategy_base import StrategyBase
class MultiStageThresholdStrategy(StrategyBase):
def __init__(self, n, m, T, L_0, l):
# TODO: In itself should be called with t=m/n, L_0=0, l=(log n)^beta_k
super(MultiStageThresholdStrategy, self).__init__... | 2,183 | 27 | 130 |
4abe19c89e4f72f2631c8e376ba5637438a8b590 | 455 | py | Python | menubuilder/templatetags/menubuilder_tags.py | marsxn/menu-builder | eced8a4f797a4630c49bec693ac69f7798693afd | [
"MIT"
] | null | null | null | menubuilder/templatetags/menubuilder_tags.py | marsxn/menu-builder | eced8a4f797a4630c49bec693ac69f7798693afd | [
"MIT"
] | null | null | null | menubuilder/templatetags/menubuilder_tags.py | marsxn/menu-builder | eced8a4f797a4630c49bec693ac69f7798693afd | [
"MIT"
] | null | null | null | # -*- enconding:utf-8 -*-
from django import template
from menubuilder.models import Menu
register = template.Library()
@register.inclusion_tag("tags/menu.html", takes_context=True)
| 23.947368 | 61 | 0.650549 | # -*- enconding:utf-8 -*-
from django import template
from menubuilder.models import Menu
register = template.Library()
@register.inclusion_tag("tags/menu.html", takes_context=True)
def create_menu(context, slug):
try:
menu = Menu.objects.get(slug__iexact=slug)
except Menu.DoesNotExist:
menu... | 247 | 0 | 22 |
1b941d08ee8e5de16318abc96e8c2d8aeb8e53e2 | 12,010 | py | Python | src/OrderbookAnalyser.py | gbarany/crypto-arbitrage-finder | 8b1dcf14cce795f4d0bbfa640abf3e13fe75eedb | [
"Apache-2.0"
] | 6 | 2020-02-25T09:40:57.000Z | 2022-03-30T09:20:02.000Z | src/OrderbookAnalyser.py | gbarany/crypto-arbitrage-finder | 8b1dcf14cce795f4d0bbfa640abf3e13fe75eedb | [
"Apache-2.0"
] | null | null | null | src/OrderbookAnalyser.py | gbarany/crypto-arbitrage-finder | 8b1dcf14cce795f4d0bbfa640abf3e13fe75eedb | [
"Apache-2.0"
] | 1 | 2020-04-22T11:39:47.000Z | 2020-04-22T11:39:47.000Z | from ArbitrageGraph import ArbitrageGraph
from ArbitrageGraphNeo import ArbitrageGraphNeo
from FeeStore import FeeStore
from OrderBook import OrderBook, OrderBookPair, Asset
from PriceStore import PriceStore
import datetime
import logging
from FWLiveParams import FWLiveParams
import asyncio
from utilities import timed
... | 44.317343 | 211 | 0.634804 | from ArbitrageGraph import ArbitrageGraph
from ArbitrageGraphNeo import ArbitrageGraphNeo
from FeeStore import FeeStore
from OrderBook import OrderBook, OrderBookPair, Asset
from PriceStore import PriceStore
import datetime
import logging
from FWLiveParams import FWLiveParams
import asyncio
from utilities import timed
... | 10,815 | 447 | 130 |
7cdeaa648075821574cd763383a6a6403f1be995 | 61,896 | py | Python | openmmtools/storage/iodrivers.py | yihengwuKP/openmmtools | 8bf446742f75acb4008e51c0a102bb7f314d1da3 | [
"MIT"
] | 1 | 2019-11-01T14:22:57.000Z | 2019-11-01T14:22:57.000Z | openmmtools/storage/iodrivers.py | yihengwuKP/openmmtools | 8bf446742f75acb4008e51c0a102bb7f314d1da3 | [
"MIT"
] | 1 | 2019-06-13T08:27:54.000Z | 2019-06-13T08:27:54.000Z | openmmtools/storage/iodrivers.py | yihengwuKP/openmmtools | 8bf446742f75acb4008e51c0a102bb7f314d1da3 | [
"MIT"
] | null | null | null | #!/usr/bin/env/python
# =============================================================================
# MODULE DOCSTRING
# =============================================================================
"""
Module which houses all the handling instructions for reading and writing to netCDF files for a given type.
This... | 38.207407 | 122 | 0.600685 | #!/usr/bin/env/python
# =============================================================================
# MODULE DOCSTRING
# =============================================================================
"""
Module which houses all the handling instructions for reading and writing to netCDF files for a given type.
This... | 17,879 | 0 | 1,875 |
fc8e742db99aff6d2def1d3be59cf89186f7d0ba | 2,763 | py | Python | mail_pusher/utils.py | qq20004604/Mail-Report-System | 59d2390431251d8ffd0435cab510a37900f2dc17 | [
"Apache-2.0"
] | 1 | 2020-07-29T08:54:46.000Z | 2020-07-29T08:54:46.000Z | mail_pusher/utils.py | qq20004604/Mail-Report-System | 59d2390431251d8ffd0435cab510a37900f2dc17 | [
"Apache-2.0"
] | 6 | 2021-03-19T10:24:43.000Z | 2021-09-22T19:30:43.000Z | mail_pusher/utils.py | qq20004604/Mail-Report-System | 59d2390431251d8ffd0435cab510a37900f2dc17 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from django.utils import timezone
from .models import RegVerifyMailModel, REG_EXPIRE_TIME
from package import mail_client
# 检查该用户当前是否可以推送验证码邮件
# 检查邮件和验证码是否正确
# 推送验证码邮件
# 推送订阅邮件(都调用这个api推送)
# 推送启动邮件邮件(都调用这个api推送)
| 34.974684 | 98 | 0.5827 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from django.utils import timezone
from .models import RegVerifyMailModel, REG_EXPIRE_TIME
from package import mail_client
# 检查该用户当前是否可以推送验证码邮件
def can_send_regcode_email(email, ip):
# 验证规则:
# 1. 3 分钟内 1 封;
# 2. 1 小时内 5 封;
# 3. 24 小时 10 封;
# 邮箱地址 和 ip ... | 2,616 | 0 | 110 |
a5987e4eb3f12343ad9ec4c139a554828e58dc73 | 376 | py | Python | test2.py | matzegltg/miau | 89b580baccbd258fbfd81bc19b46603a07873f14 | [
"MIT"
] | null | null | null | test2.py | matzegltg/miau | 89b580baccbd258fbfd81bc19b46603a07873f14 | [
"MIT"
] | 1 | 2021-05-07T15:50:51.000Z | 2021-05-07T15:50:51.000Z | test2.py | matzegltg/miau | 89b580baccbd258fbfd81bc19b46603a07873f14 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
# Fixing random state for reproducibility
np.random.seed(19680801)
x = np.random.rand(10)
y = np.random.rand(10)
z = np.sqrt(x**2 + y**2)
fig, axs = plt.subplots(2, 3, sharex=True, sharey=True)
# marker symbol
axs[0, 0].scatter(x, y, s=80, c=z, marker=">")
axs[0, 0... | 20.888889 | 55 | 0.680851 | import numpy as np
import matplotlib.pyplot as plt
# Fixing random state for reproducibility
np.random.seed(19680801)
x = np.random.rand(10)
y = np.random.rand(10)
z = np.sqrt(x**2 + y**2)
fig, axs = plt.subplots(2, 3, sharex=True, sharey=True)
# marker symbol
axs[0, 0].scatter(x, y, s=80, c=z, marker=">")
axs[0, 0... | 0 | 0 | 0 |
3c425a9c4570b93fafda1c6179554db26068be44 | 2,797 | py | Python | specvqgan/onset_baseline/utils/data_sampler.py | XYPB/SpecVQGAN | ed3c0f86c41bc408824979305d9c4f6df0877973 | [
"MIT"
] | null | null | null | specvqgan/onset_baseline/utils/data_sampler.py | XYPB/SpecVQGAN | ed3c0f86c41bc408824979305d9c4f6df0877973 | [
"MIT"
] | null | null | null | specvqgan/onset_baseline/utils/data_sampler.py | XYPB/SpecVQGAN | ed3c0f86c41bc408824979305d9c4f6df0877973 | [
"MIT"
] | null | null | null | import copy
import csv
import json
import numpy as np
import os
import pickle
import random
import torch
from torch.utils.data.sampler import Sampler
import pdb
class ASMRSampler(Sampler):
"""
Total videos: 2794. The sampler ends when last $BATCH_SIZE videos are left.
"""
| 32.905882 | 81 | 0.601359 | import copy
import csv
import json
import numpy as np
import os
import pickle
import random
import torch
from torch.utils.data.sampler import Sampler
import pdb
class ASMRSampler(Sampler):
"""
Total videos: 2794. The sampler ends when last $BATCH_SIZE videos are left.
"""
def __init__(self, list_sa... | 2,274 | 10 | 223 |
739d3d099fcf65945b4820df45eb34f357bcd0c0 | 2,922 | py | Python | lc0714_best_time_to_buy_and_sell_stock_with_transaction_fee.py | bowen0701/python-algorithms-data-structures | e625f59a9fc59e4728825078d4434a7968a724e5 | [
"BSD-2-Clause"
] | 8 | 2019-03-18T06:37:24.000Z | 2022-01-30T07:50:58.000Z | lc0714_best_time_to_buy_and_sell_stock_with_transaction_fee.py | bowen0701/python-algorithms-data-structures | e625f59a9fc59e4728825078d4434a7968a724e5 | [
"BSD-2-Clause"
] | null | null | null | lc0714_best_time_to_buy_and_sell_stock_with_transaction_fee.py | bowen0701/python-algorithms-data-structures | e625f59a9fc59e4728825078d4434a7968a724e5 | [
"BSD-2-Clause"
] | null | null | null | """Leetcode 714. Best Time to Buy and Sell Stock with Transaction Fee
Medium
URL: https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/
Your are given an array of integers prices, for which the i-th element is the price of
a given stock on day i; and a non-negative integer fee representi... | 27.566038 | 88 | 0.582478 | """Leetcode 714. Best Time to Buy and Sell Stock with Transaction Fee
Medium
URL: https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/
Your are given an array of integers prices, for which the i-th element is the price of
a given stock on day i; and a non-negative integer fee representi... | 185 | 1,651 | 69 |
939f46ff7b3701ea5aa26dc92a3ccf588e8d1a71 | 1,983 | py | Python | ngs_utils/ensembl/generate_cds_bed.py | pdiakumis/NGS_Utils | 9eae9f8d5f0e408118d429fde90e297dbac9ae15 | [
"MIT"
] | 3 | 2018-06-06T01:41:51.000Z | 2020-08-20T11:36:06.000Z | ngs_utils/ensembl/generate_cds_bed.py | pdiakumis/NGS_Utils | 9eae9f8d5f0e408118d429fde90e297dbac9ae15 | [
"MIT"
] | 4 | 2019-11-28T03:34:54.000Z | 2021-06-24T23:04:55.000Z | ngs_utils/ensembl/generate_cds_bed.py | pdiakumis/NGS_Utils | 9eae9f8d5f0e408118d429fde90e297dbac9ae15 | [
"MIT"
] | 5 | 2018-03-15T12:43:38.000Z | 2021-06-24T23:12:48.000Z | #!/usr/bin/env python
import ngs_utils.ensembl as ebl
import os
import shutil
from optparse import OptionParser, SUPPRESS_HELP
from os.path import isfile, join, basename, dirname, pardir
from ngs_utils import logger
from ngs_utils.file_utils import file_transaction, adjust_path, safe_mkdir, verify_file
''' Generates... | 34.189655 | 163 | 0.658598 | #!/usr/bin/env python
import ngs_utils.ensembl as ebl
import os
import shutil
from optparse import OptionParser, SUPPRESS_HELP
from os.path import isfile, join, basename, dirname, pardir
from ngs_utils import logger
from ngs_utils.file_utils import file_transaction, adjust_path, safe_mkdir, verify_file
''' Generates... | 1,386 | 0 | 23 |
c81b5e76ee09ead4a18ea60317fb89ab05a096a3 | 1,731 | py | Python | moses/tests/test_io.py | l04m33/moses | 4106b700f46d0dae2f238a56849f3eaf8e639491 | [
"MIT"
] | 7 | 2016-03-28T09:05:11.000Z | 2021-11-26T16:05:25.000Z | moses/tests/test_io.py | l04m33/moses | 4106b700f46d0dae2f238a56849f3eaf8e639491 | [
"MIT"
] | 2 | 2017-06-30T23:33:28.000Z | 2020-04-13T14:23:55.000Z | moses/tests/test_io.py | l04m33/moses | 4106b700f46d0dae2f238a56849f3eaf8e639491 | [
"MIT"
] | 5 | 2017-05-26T12:51:59.000Z | 2020-04-13T12:33:01.000Z | import unittest
import asyncio
import moses.io as io
from . import dummy
| 34.62 | 79 | 0.705373 | import unittest
import asyncio
import moses.io as io
from . import dummy
class TestUDPRelayProtocol(unittest.TestCase):
def test_datagram_received(self):
writer_mock, dummy_write = dummy.make_dummy_writer()
udp_relay = io.UDPRelayProtocol(writer_mock)
udp_relay.datagram_received(b'12345678... | 1,458 | 46 | 152 |
4c4deb3a16ba837e466b59de00e7b0b355e00220 | 458 | py | Python | documentation_threading/03_thread_objects/thread_objects_03.py | software-foundations/learning-distributed-systems | b09f60742a88acf466fcf724e1368b95363682fa | [
"MIT"
] | null | null | null | documentation_threading/03_thread_objects/thread_objects_03.py | software-foundations/learning-distributed-systems | b09f60742a88acf466fcf724e1368b95363682fa | [
"MIT"
] | null | null | null | documentation_threading/03_thread_objects/thread_objects_03.py | software-foundations/learning-distributed-systems | b09f60742a88acf466fcf724e1368b95363682fa | [
"MIT"
] | null | null | null | import threading
thread_01 = threading.Thread(
# name='t1',
target=target_function,
kwargs={'person_01': 'Bruno', 'person_02': 'Hanna'})
thread_01.start()
thread_01.join()
print('executed after join thread 01')
| 18.32 | 74 | 0.70524 | import threading
def target_function(person_01: str = 'p1', person_02: str = 'p2') -> None:
print(threading.current_thread().name)
print(threading.current_thread().is_alive())
print(f'person_01: {person_01}')
print(f'person_02: {person_02}')
thread_01 = threading.Thread(
# name='t1',
target=target_func... | 211 | 0 | 23 |
56d605ffcdce16e4e693e5b85a793c74ca3a652d | 20,973 | py | Python | ml4tc/machine_learning/conv_lstm_architecture.py | NOAA-GSL/ml4tc | e9f8faa51e5bfb86b2a78648d7b1d0e61d09b6c0 | [
"MIT"
] | null | null | null | ml4tc/machine_learning/conv_lstm_architecture.py | NOAA-GSL/ml4tc | e9f8faa51e5bfb86b2a78648d7b1d0e61d09b6c0 | [
"MIT"
] | null | null | null | ml4tc/machine_learning/conv_lstm_architecture.py | NOAA-GSL/ml4tc | e9f8faa51e5bfb86b2a78648d7b1d0e61d09b6c0 | [
"MIT"
] | null | null | null | """Methods for building convolutional LSTM."""
import numpy
import keras
from gewittergefahr.gg_utils import error_checking
from gewittergefahr.deep_learning import architecture_utils
from ml4tc.machine_learning import cnn_architecture
INPUT_DIMENSIONS_KEY = 'input_dimensions'
NUM_LAYERS_BY_BLOCK_KEY = 'num_layers_by... | 42.114458 | 80 | 0.739951 | """Methods for building convolutional LSTM."""
import numpy
import keras
from gewittergefahr.gg_utils import error_checking
from gewittergefahr.deep_learning import architecture_utils
from ml4tc.machine_learning import cnn_architecture
INPUT_DIMENSIONS_KEY = 'input_dimensions'
NUM_LAYERS_BY_BLOCK_KEY = 'num_layers_by... | 0 | 0 | 0 |
68ce8e521626b0dd2dab0d6ea9e39e26675d3f03 | 13,805 | py | Python | simulator/static/python/rbatools/rba/core/species.py | tlubitz/rba | 073b591ff6047ee8df00288ecfe45094e2b7d195 | [
"MIT"
] | null | null | null | simulator/static/python/rbatools/rba/core/species.py | tlubitz/rba | 073b591ff6047ee8df00288ecfe45094e2b7d195 | [
"MIT"
] | null | null | null | simulator/static/python/rbatools/rba/core/species.py | tlubitz/rba | 073b591ff6047ee8df00288ecfe45094e2b7d195 | [
"MIT"
] | null | null | null | """Module defining Machinery, Species and ProcessingMap classes."""
# python 2/3 compatibility
from __future__ import division, print_function, absolute_import
# global imports
from collections import namedtuple
from scipy.sparse import (
csr_matrix, csc_matrix, lil_matrix, coo_matrix, hstack, eye
)
import nu... | 42.608025 | 79 | 0.638899 | """Module defining Machinery, Species and ProcessingMap classes."""
# python 2/3 compatibility
from __future__ import division, print_function, absolute_import
# global imports
from collections import namedtuple
from scipy.sparse import (
csr_matrix, csc_matrix, lil_matrix, coo_matrix, hstack, eye
)
import nu... | 1,515 | 0 | 81 |
db6eeb0cb0b20da09112cc105a0ad05e4ea8a592 | 1,748 | py | Python | mediagoblin/plugins/processing_info/__init__.py | gnu-mirror-unofficial/mediagoblin | 522a61b24a1b7767682eaf7b29c59e40a0a9b73f | [
"CC0-1.0"
] | 1 | 2021-09-21T02:24:43.000Z | 2021-09-21T02:24:43.000Z | mediagoblin/plugins/processing_info/__init__.py | jgarte/mediagoblin-mirror | c4599508b02f2e61df3a97ff314766a62a3e5934 | [
"CC0-1.0"
] | null | null | null | mediagoblin/plugins/processing_info/__init__.py | jgarte/mediagoblin-mirror | c4599508b02f2e61df3a97ff314766a62a3e5934 | [
"CC0-1.0"
] | 1 | 2021-09-21T02:25:20.000Z | 2021-09-21T02:25:20.000Z | # GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either versio... | 33.615385 | 77 | 0.730549 | # GNU MediaGoblin -- federated, autonomous media hosting
# Copyright (C) 2011, 2012 MediaGoblin contributors. See AUTHORS.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either versio... | 591 | 0 | 46 |
ca0fadae775f849a2b0ae902e75b518832fc9702 | 12,335 | py | Python | photometry/src/calc_zptmag_apparent_mags_hierarchical_ILAPHv5.py | gnarayan/WDdata | 010edd14c9bd6bef1e52734b1b784354049a3573 | [
"MIT"
] | 3 | 2018-12-03T20:03:19.000Z | 2022-01-14T19:47:44.000Z | photometry/src/calc_zptmag_apparent_mags_hierarchical_ILAPHv5.py | gnarayan/WDdata | 010edd14c9bd6bef1e52734b1b784354049a3573 | [
"MIT"
] | null | null | null | photometry/src/calc_zptmag_apparent_mags_hierarchical_ILAPHv5.py | gnarayan/WDdata | 010edd14c9bd6bef1e52734b1b784354049a3573 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
import os
import glob
import numpy as np
from astropy.io import ascii
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
import astropy.table as at
from numpy.lib.recfunctions import append_fields
from scipy.stats import linregress
import pymc3 as pm
im... | 42.098976 | 166 | 0.597081 | #!/usr/bin/env python
import sys
import os
import glob
import numpy as np
from astropy.io import ascii
import matplotlib.pyplot as plt
from matplotlib.backends.backend_pdf import PdfPages
import astropy.table as at
from numpy.lib.recfunctions import append_fields
from scipy.stats import linregress
import pymc3 as pm
im... | 11,883 | 0 | 23 |
a72c7ec9b7f1146027818df667358d64c427b3b0 | 2,559 | py | Python | tests/test_middleware.py | everhide/everbug | 72da1372510a2116e45c23da934a40dca1f4dbd5 | [
"MIT"
] | 182 | 2018-06-15T07:07:11.000Z | 2021-06-15T21:53:58.000Z | tests/test_middleware.py | everhide/everbug | 72da1372510a2116e45c23da934a40dca1f4dbd5 | [
"MIT"
] | 7 | 2018-06-15T07:03:58.000Z | 2018-09-13T08:43:19.000Z | tests/test_middleware.py | everhide/everbug | 72da1372510a2116e45c23da934a40dca1f4dbd5 | [
"MIT"
] | 3 | 2018-06-15T20:44:51.000Z | 2018-09-12T19:05:39.000Z | import logging
from django.test import Client, TestCase, override_settings
from everbug.middleware import Header
| 34.581081 | 79 | 0.679172 | import logging
from django.test import Client, TestCase, override_settings
from everbug.middleware import Header
class TestTracer(TestCase):
@classmethod
def setUp(cls):
# Disable notices for expected 404 status
logging.disable(logging.ERROR)
cls.client = Client()
@classmethod
... | 1,589 | 831 | 23 |
434c9ca41791496f44748309fb8177691e1e2b32 | 2,317 | py | Python | ReadyToGo/registration/views.py | korey-h/ReadyToGo | 060927a9658f40df34eb8bc7599af5dafe3a2e89 | [
"Apache-2.0"
] | null | null | null | ReadyToGo/registration/views.py | korey-h/ReadyToGo | 060927a9658f40df34eb8bc7599af5dafe3a2e89 | [
"Apache-2.0"
] | null | null | null | ReadyToGo/registration/views.py | korey-h/ReadyToGo | 060927a9658f40df34eb8bc7599af5dafe3a2e89 | [
"Apache-2.0"
] | null | null | null | from django.core.paginator import Paginator
from django.shortcuts import get_object_or_404, render
from django.urls import reverse
from django.views.generic.edit import CreateView, DeleteView, UpdateView
from .forms import RegForm
from .models import Cups, Participants, Races
| 30.090909 | 79 | 0.6694 | from django.core.paginator import Paginator
from django.shortcuts import get_object_or_404, render
from django.urls import reverse
from django.views.generic.edit import CreateView, DeleteView, UpdateView
from .forms import RegForm
from .models import Cups, Participants, Races
def index(request):
races = Races.ob... | 1,474 | 397 | 161 |
039e1504f90367655a81f68f749b287b053ec962 | 489 | py | Python | pacman-termux/test/pacman/tests/skip-remove-with-glob-chars.py | Maxython/pacman-for-termux | 3b208eb9274cbfc7a27fca673ea8a58f09ebad47 | [
"MIT"
] | 23 | 2021-05-21T19:11:06.000Z | 2022-03-31T18:14:20.000Z | source/pacman-6.0.1/test/pacman/tests/skip-remove-with-glob-chars.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 11 | 2021-05-21T12:08:44.000Z | 2021-12-21T08:30:08.000Z | source/pacman-6.0.1/test/pacman/tests/skip-remove-with-glob-chars.py | Scottx86-64/dotfiles-1 | 51004b1e2b032664cce6b553d2052757c286087d | [
"Unlicense"
] | 1 | 2021-09-26T08:44:40.000Z | 2021-09-26T08:44:40.000Z | self.description = "transferred file with glob characters that match a removed file"
lp = pmpkg("foo")
lp.files = ["foo/b*r", "foo/bar"]
self.addpkg2db("local", lp)
sp1 = pmpkg("foo", "1.0-2")
self.addpkg(sp1)
sp2 = pmpkg("bar", "1.0-2")
sp2.files = ["foo/b*r"]
self.addpkg(sp2)
self.args = "-U %s %s" % (sp1.filenam... | 24.45 | 84 | 0.666667 | self.description = "transferred file with glob characters that match a removed file"
lp = pmpkg("foo")
lp.files = ["foo/b*r", "foo/bar"]
self.addpkg2db("local", lp)
sp1 = pmpkg("foo", "1.0-2")
self.addpkg(sp1)
sp2 = pmpkg("bar", "1.0-2")
sp2.files = ["foo/b*r"]
self.addpkg(sp2)
self.args = "-U %s %s" % (sp1.filenam... | 0 | 0 | 0 |
933a2b06638629c8b915c8d5b2a03a2db983bef3 | 5,478 | py | Python | minent/utils.py | DistrictDataLabs/minimum-entropy | f27f0bf5d01e122fda76e3cb27bbe4b36f3e782a | [
"Apache-2.0"
] | 14 | 2016-12-28T05:56:38.000Z | 2021-04-11T00:12:16.000Z | minent/utils.py | DistrictDataLabs/minimum-entropy | f27f0bf5d01e122fda76e3cb27bbe4b36f3e782a | [
"Apache-2.0"
] | 32 | 2016-07-05T18:44:46.000Z | 2016-08-15T14:46:36.000Z | minent/utils.py | DistrictDataLabs/minimum-entropy | f27f0bf5d01e122fda76e3cb27bbe4b36f3e782a | [
"Apache-2.0"
] | 4 | 2016-08-09T20:52:13.000Z | 2020-03-04T00:38:27.000Z | # minent.utils
# Project level utilities
#
# Author: Benjamin Bengfort <benjamin@bengfort.com>
# Created: Thu Oct 23 14:09:04 2014 -0400
#
# Copyright (C) 2014 Bengfort.com
# For license information, see LICENSE.txt
#
# ID: utils.py [24fa113] benjamin@bengfort.com $
"""
Project level utilities
"""
################... | 30.433333 | 105 | 0.563709 | # minent.utils
# Project level utilities
#
# Author: Benjamin Bengfort <benjamin@bengfort.com>
# Created: Thu Oct 23 14:09:04 2014 -0400
#
# Copyright (C) 2014 Bengfort.com
# For license information, see LICENSE.txt
#
# ID: utils.py [24fa113] benjamin@bengfort.com $
"""
Project level utilities
"""
################... | 337 | 0 | 107 |
895352ff3c2cb5e76abd6f31c9fad037fd0ea75c | 40 | py | Python | tests/exceptions/valid_package/x.py | kogut/statick | 6cbe43b5ac78275a12af3ac5aa325833368d0767 | [
"CC0-1.0"
] | 54 | 2018-08-27T19:12:41.000Z | 2022-03-31T04:16:40.000Z | tests/exceptions/valid_package/x.py | gregtkogut/statick | 11a8f950d50b52903a25f4f00c7cd52a90eff56c | [
"CC0-1.0"
] | 288 | 2018-08-28T13:17:44.000Z | 2022-03-21T20:05:19.000Z | tests/exceptions/valid_package/x.py | gregtkogut/statick | 11a8f950d50b52903a25f4f00c7cd52a90eff56c | [
"CC0-1.0"
] | 12 | 2018-08-28T13:18:39.000Z | 2022-03-21T19:27:16.000Z | #!/usr/bin/env python3
x = 0 # NOLINT
| 10 | 22 | 0.6 | #!/usr/bin/env python3
x = 0 # NOLINT
| 0 | 0 | 0 |
c4b3ceb15c0b6205d9c1a1fcb70a1080c830c83b | 5,881 | py | Python | experiments/examples/riemann_linear_regression/plot_coreset_pts.py | DominicBroadbentCompass/bayesian-coresets-optimization | 3657f2ebfc4f0e6b36f5c651b0651f06d7e3d6b1 | [
"MIT"
] | 5 | 2021-05-21T02:34:17.000Z | 2022-03-29T15:17:26.000Z | experiments/examples/riemann_linear_regression/plot_coreset_pts.py | DominicBroadbentCompass/bayesian-coresets-optimization | 3657f2ebfc4f0e6b36f5c651b0651f06d7e3d6b1 | [
"MIT"
] | 2 | 2021-03-12T04:07:52.000Z | 2021-03-15T12:56:05.000Z | experiments/examples/riemann_linear_regression/plot_coreset_pts.py | DominicBroadbentCompass/bayesian-coresets-optimization | 3657f2ebfc4f0e6b36f5c651b0651f06d7e3d6b1 | [
"MIT"
] | 4 | 2020-06-23T04:51:43.000Z | 2021-02-04T15:07:41.000Z | import os
import sys
import bokeh.layouts as bkl
import bokeh.plotting as bkp
import numpy as np
from bokeh.models import Label
from bokeh.io import export_svgs
import cairosvg
# make it so we can import models/etc from parent folder
sys.path.insert(1, os.path.join(sys.path[0], '../common'))
from plotting import *
fr... | 40.840278 | 123 | 0.584084 | import os
import sys
import bokeh.layouts as bkl
import bokeh.plotting as bkp
import numpy as np
from bokeh.models import Label
from bokeh.io import export_svgs
import cairosvg
# make it so we can import models/etc from parent folder
sys.path.insert(1, os.path.join(sys.path[0], '../common'))
from plotting import *
fr... | 0 | 0 | 0 |
6ae3c0d5905afeaf1197370765846d90cf8945df | 9,129 | py | Python | lib/cleanupSupport.py | bbockelm/glideinWMS | a2b39e3d4ff6c4527efad54b1eefe728a4ec9d18 | [
"BSD-3-Clause"
] | null | null | null | lib/cleanupSupport.py | bbockelm/glideinWMS | a2b39e3d4ff6c4527efad54b1eefe728a4ec9d18 | [
"BSD-3-Clause"
] | 3 | 2015-12-02T19:37:45.000Z | 2016-01-20T03:21:48.000Z | lib/cleanupSupport.py | bbockelm/glideinWMS | a2b39e3d4ff6c4527efad54b1eefe728a4ec9d18 | [
"BSD-3-Clause"
] | 1 | 2015-12-01T23:02:41.000Z | 2015-12-01T23:02:41.000Z | import os
import stat
import time
import re
import pwd
import logSupport
import condorPrivsep
from pidSupport import register_sighandler, unregister_sighandler
MY_USERNAME = pwd.getpwuid(os.getuid())[0]
cleaners = Cleanup()
class CredCleanup(Cleanup):
"""
Cleans up old credential files.
"""
... | 37.261224 | 126 | 0.588235 | import os
import stat
import time
import re
import pwd
import logSupport
import condorPrivsep
from pidSupport import register_sighandler, unregister_sighandler
MY_USERNAME = pwd.getpwuid(os.getuid())[0]
class Cleanup:
def __init__(self):
self.cleanup_objects = []
self.cleanup_pids = []
def ad... | 7,812 | 30 | 562 |
c75fb5bd1e4347fcdfd480e952b18707325ca037 | 483 | py | Python | styrobot/util/auth.py | ThatRedKite/styrobot | c6c449aec99cb59c4695f739d59efe2def0e0064 | [
"MIT"
] | 1 | 2021-08-02T23:19:31.000Z | 2021-08-02T23:19:31.000Z | styrobot/util/auth.py | ThatRedKite/styrobot | c6c449aec99cb59c4695f739d59efe2def0e0064 | [
"MIT"
] | null | null | null | styrobot/util/auth.py | ThatRedKite/styrobot | c6c449aec99cb59c4695f739d59efe2def0e0064 | [
"MIT"
] | 1 | 2021-07-28T02:26:54.000Z | 2021-07-28T02:26:54.000Z | from . import database
| 32.2 | 103 | 0.623188 | from . import database
async def is_authorized(user, guild_id=None, con=None):
if user.guild_permissions.administrator:
return True
else:
role_str = await database.get_guild_setting(guild_id, 'settings.manage', default=None, con=con)
if (role_str is not None) and (role_str.is_numeric()... | 436 | 0 | 23 |
4754aeac6a9b31ae57ba8abcec4a83579918f56e | 528 | py | Python | scripts/cleanUnAnnotated.py | HaseloffLab/MarpoDB | 40a15f4ce828e3e51b5d58527fa6f7f6f1a61bff | [
"MIT"
] | 3 | 2020-11-23T21:50:04.000Z | 2022-01-16T18:20:46.000Z | scripts/cleanUnAnnotated.py | HaseloffLab/MarpoDB | 40a15f4ce828e3e51b5d58527fa6f7f6f1a61bff | [
"MIT"
] | 4 | 2021-03-18T20:23:44.000Z | 2022-01-13T00:41:16.000Z | scripts/cleanUnAnnotated.py | HaseloffLab/MarpoDB | 40a15f4ce828e3e51b5d58527fa6f7f6f1a61bff | [
"MIT"
] | 2 | 2017-05-21T16:42:23.000Z | 2018-06-14T00:10:48.000Z | import sys
from partsdb.partsdb import PartsDB
from tables import *
marpodb = PartsDB('postgresql:///'+sys.argv[1], Base = Base)
session = marpodb.Session()
n=0
i=0
for gene in session.query(Gene).all():
n = session.query(InterProHit).filter(InterProHit.targetID == gene.cds.id).count()
if n == 0:
session.quer... | 20.307692 | 83 | 0.685606 | import sys
from partsdb.partsdb import PartsDB
from tables import *
marpodb = PartsDB('postgresql:///'+sys.argv[1], Base = Base)
session = marpodb.Session()
n=0
i=0
for gene in session.query(Gene).all():
n = session.query(InterProHit).filter(InterProHit.targetID == gene.cds.id).count()
if n == 0:
session.quer... | 0 | 0 | 0 |
95eb658a498b918d220df247f0463420f88fca34 | 675 | py | Python | test/hummingbot/client/config/test_config_validators.py | coreydemarse/hummingbot | 48dd45b103622b198ca8e833ed9de7d0ad573ed9 | [
"Apache-2.0"
] | 11 | 2020-09-15T08:21:59.000Z | 2022-03-19T05:06:59.000Z | test/hummingbot/client/config/test_config_validators.py | coreydemarse/hummingbot | 48dd45b103622b198ca8e833ed9de7d0ad573ed9 | [
"Apache-2.0"
] | null | null | null | test/hummingbot/client/config/test_config_validators.py | coreydemarse/hummingbot | 48dd45b103622b198ca8e833ed9de7d0ad573ed9 | [
"Apache-2.0"
] | 5 | 2020-09-18T12:59:31.000Z | 2021-06-27T01:46:16.000Z | from unittest import TestCase
import hummingbot.client.config.config_validators as config_validators
| 39.705882 | 106 | 0.797037 | from unittest import TestCase
import hummingbot.client.config.config_validators as config_validators
class TimestampValidationTests(TestCase):
def test_validation_does_not_fail_with_valid_timestamp_string(self):
timestamp_string = "2021-06-23 10:15:20"
self.assertIsNone(config_validators.valida... | 475 | 20 | 77 |
8b3e8fde236a85c41a3d04001f6078e679ef57fc | 2,314 | py | Python | lib/compile_servers.py | suzuki-shunsuke/ansible-playbook-example | 1efaabee03669cf2a5643a4906836057137ae85b | [
"MIT"
] | 1 | 2022-02-09T06:36:02.000Z | 2022-02-09T06:36:02.000Z | lib/compile_servers.py | suzuki-shunsuke/ansible-playbook-example | 1efaabee03669cf2a5643a4906836057137ae85b | [
"MIT"
] | null | null | null | lib/compile_servers.py | suzuki-shunsuke/ansible-playbook-example | 1efaabee03669cf2a5643a4906836057137ae85b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import yaml
| 34.029412 | 71 | 0.556612 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import yaml
class Compiler(object):
def get_sshcfg_str(self, **kwargs):
return "\n".join([
"Host {type}-{idx}.{env}",
" HostName {ip}",
" User {user}",
" IdentityFile ssh-keys/{type}.{env}",
... | 1,949 | 2 | 292 |
88da7d9a20a168331a8ea282309e364777206fe2 | 767 | py | Python | pipe.py | abersheeran/only-pipe | 05c6a9c5ece75f8e0a7a126c7d590a7c9b3ea066 | [
"MIT"
] | 18 | 2021-01-11T05:12:59.000Z | 2021-01-22T03:25:43.000Z | pipe.py | abersheeran/only-pipe | 05c6a9c5ece75f8e0a7a126c7d590a7c9b3ea066 | [
"MIT"
] | null | null | null | pipe.py | abersheeran/only-pipe | 05c6a9c5ece75f8e0a7a126c7d590a7c9b3ea066 | [
"MIT"
] | 1 | 2021-03-17T03:18:20.000Z | 2021-03-17T03:18:20.000Z | from functools import partial
class F(partial):
"""
Python Pipe. e.g.`range(10) | F(filter, lambda x: x % 2) | F(sum)`
WARNING: There will be a small performance loss when building a
pipeline. Please do not use it in performance-sensitive locations.
"""
class FF(partial):
"""
Python Pip... | 23.96875 | 77 | 0.647979 | from functools import partial
class F(partial):
"""
Python Pipe. e.g.`range(10) | F(filter, lambda x: x % 2) | F(sum)`
WARNING: There will be a small performance loss when building a
pipeline. Please do not use it in performance-sensitive locations.
"""
def __ror__(self, other):
retu... | 163 | 0 | 77 |
4bf3a19ec98cd43f5e688d4048420b5d072f0d8e | 2,068 | py | Python | object_detection/utils/test_utils_test.py | travisyates81/object-detection | 931bebfa54798c08d2c401e9c1bad39015d8c832 | [
"MIT"
] | 1 | 2019-09-19T18:24:55.000Z | 2019-09-19T18:24:55.000Z | object_detection/utils/test_utils_test.py | travisyates81/object-detection | 931bebfa54798c08d2c401e9c1bad39015d8c832 | [
"MIT"
] | null | null | null | object_detection/utils/test_utils_test.py | travisyates81/object-detection | 931bebfa54798c08d2c401e9c1bad39015d8c832 | [
"MIT"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Travis Yates
"""Tests for object_detection.utils.test_utils."""
import numpy as np
import tensorflow as tf
from object_detection.utils import test_utils
if __name__ == '__main__':
tf.test.main()
| 32.825397 | 71 | 0.488395 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Travis Yates
"""Tests for object_detection.utils.test_utils."""
import numpy as np
import tensorflow as tf
from object_detection.utils import test_utils
class TestUtilsTest(tf.test.TestCase):
def test_diagonal_gradient_image(self):
"""Tests i... | 0 | 1,776 | 23 |
b771ad0f895c2b37b349d102fe8f76c44e0a9eeb | 114 | py | Python | demo.py | Arui66/FPSAutomaticAiming | 87674385d42b065b984b38a2ff59e7f2d4f07dc9 | [
"Apache-2.0"
] | 129 | 2021-09-01T19:27:31.000Z | 2022-03-31T07:50:34.000Z | demo.py | Arui66/FPSAutomaticAiming | 87674385d42b065b984b38a2ff59e7f2d4f07dc9 | [
"Apache-2.0"
] | 19 | 2021-09-06T06:55:49.000Z | 2022-03-30T10:16:19.000Z | demo.py | Arui66/FPSAutomaticAiming | 87674385d42b065b984b38a2ff59e7f2d4f07dc9 | [
"Apache-2.0"
] | 50 | 2021-09-04T11:41:37.000Z | 2022-03-30T15:18:01.000Z | import keyboard
keyboard.hook(abc)
keyboard.wait()
| 10.363636 | 29 | 0.605263 | import keyboard
def abc(x):
if x.name == 'caps lock':
print(x)
keyboard.hook(abc)
keyboard.wait()
| 37 | 0 | 23 |
26c53a3b827de8fe9c3a7cabaad1103103b8ffe9 | 3,791 | py | Python | subcommands/consolidate_data.py | brunomateus/open_source_android_apps | 143deea78ff125b4dd5e88b89f48dc3a9e8bcdfa | [
"MIT"
] | 2 | 2019-11-18T18:01:27.000Z | 2021-05-13T18:16:17.000Z | subcommands/consolidate_data.py | brunomateus/open_source_android_apps | 143deea78ff125b4dd5e88b89f48dc3a9e8bcdfa | [
"MIT"
] | null | null | null | subcommands/consolidate_data.py | brunomateus/open_source_android_apps | 143deea78ff125b4dd5e88b89f48dc3a9e8bcdfa | [
"MIT"
] | 3 | 2019-07-18T19:33:04.000Z | 2021-01-13T21:13:29.000Z | """Consolidate repository data from several previous steps.
Use -h or --help for more information.
"""
import argparse
import csv
import logging
import sys
from util.parse import \
parse_repo_to_package_file, \
consolidate_data
__log__ = logging.getLogger(__name__)
FIELDNAMES = [
'id',
'name',
... | 32.681034 | 79 | 0.660248 | """Consolidate repository data from several previous steps.
Use -h or --help for more information.
"""
import argparse
import csv
import logging
import sys
from util.parse import \
parse_repo_to_package_file, \
consolidate_data
__log__ = logging.getLogger(__name__)
FIELDNAMES = [
'id',
'name',
... | 0 | 0 | 0 |
c72e662d53852fd2bde3391d495db630ad9e60ef | 677 | py | Python | tests/pubmed/package1/test_example_mod2.py | toritori1000/pubmedrepo | cc81871bb7a2abd3209d99863cf31872b1d0798c | [
"MIT"
] | null | null | null | tests/pubmed/package1/test_example_mod2.py | toritori1000/pubmedrepo | cc81871bb7a2abd3209d99863cf31872b1d0798c | [
"MIT"
] | null | null | null | tests/pubmed/package1/test_example_mod2.py | toritori1000/pubmedrepo | cc81871bb7a2abd3209d99863cf31872b1d0798c | [
"MIT"
] | null | null | null | import unittest
from pubmed.package1.example_mod2 import ExampleMod2
if __name__ == '__main__':
# Run tests with the warning such as below ignored (not shown).
# InsecureRequestWarning: Unverified HTTPS request
# ResourceWarning: unclosed <ssl.SSLSocket fd=5, ...
unittest.main(warnings='ignore')
| 21.15625 | 67 | 0.670606 | import unittest
from pubmed.package1.example_mod2 import ExampleMod2
class ExampleModTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
pass
@classmethod
def tearDownClass(cls):
pass
def setUp(self):
pass
def tearDown(self):
pass
def test_examp... | 149 | 188 | 23 |
fce02a6f176f615eb2ab37324b654bce65ed48c8 | 449 | py | Python | Python Code/basicPython.py | Joshrogan/Python | 48a4fee328c60bc7a937e1e0b16485523d89cfd7 | [
"MIT"
] | 1 | 2019-11-19T19:40:10.000Z | 2019-11-19T19:40:10.000Z | Python Code/basicPython.py | Joshrogan/Python | 48a4fee328c60bc7a937e1e0b16485523d89cfd7 | [
"MIT"
] | 1 | 2019-11-26T19:39:58.000Z | 2019-11-26T19:39:58.000Z | Python Code/basicPython.py | Joshrogan/Python | 48a4fee328c60bc7a937e1e0b16485523d89cfd7 | [
"MIT"
] | 1 | 2019-11-26T19:39:11.000Z | 2019-11-26T19:39:11.000Z | # The following code is of week one of python
print("Hello my name is George!")
print("This is my dog Max!")
print('o----')
print(' ||||')
# some maths!
print(50 - 10)
# let's make a variable for year I was born in by inputting!
# make sure to click on the black screen to type an press enter!
year = input("What year... | 28.0625 | 83 | 0.685969 | # The following code is of week one of python
print("Hello my name is George!")
print("This is my dog Max!")
print('o----')
print(' ||||')
# some maths!
print(50 - 10)
# let's make a variable for year I was born in by inputting!
# make sure to click on the black screen to type an press enter!
year = input("What year... | 0 | 0 | 0 |
4ddc6c328ceb1612d72a6ac1c529289d0fe46b7e | 376 | py | Python | wordcount.py | phamvanhanh6720/Bigdata | 5310fc3ce5b1b21341489df89cb76be0a5a09020 | [
"MIT"
] | 2 | 2022-01-01T15:27:51.000Z | 2022-01-03T15:00:49.000Z | wordcount.py | phamvanhanh6720/Bigdata | 5310fc3ce5b1b21341489df89cb76be0a5a09020 | [
"MIT"
] | null | null | null | wordcount.py | phamvanhanh6720/Bigdata | 5310fc3ce5b1b21341489df89cb76be0a5a09020 | [
"MIT"
] | 1 | 2022-02-13T02:40:21.000Z | 2022-02-13T02:40:21.000Z | import sys
from pyspark import SparkContext
sc = SparkContext(appName="WordCountExample")
lines = sc.textFile(sys.argv[1])
counts = lines.flatMap(lambda x: x.split(' ')) \
.map(lambda x: (x, 1)) \
.reduceByKey(lambda x, y: x+y)
output = counts.collect()
for (word, count) in o... | 31.333333 | 49 | 0.593085 | import sys
from pyspark import SparkContext
sc = SparkContext(appName="WordCountExample")
lines = sc.textFile(sys.argv[1])
counts = lines.flatMap(lambda x: x.split(' ')) \
.map(lambda x: (x, 1)) \
.reduceByKey(lambda x, y: x+y)
output = counts.collect()
for (word, count) in o... | 0 | 0 | 0 |
d32952302b91522d6b6545acd1efb885c7259b9c | 1,968 | py | Python | azext_iot/sdk/pnp/dataplane/models/model_search_options_py3.py | srinivasaraogattupalli/azure-iot-cli-extension | 9885dd528fe363f5c118f3b735ad22fd4e1a86f4 | [
"MIT"
] | null | null | null | azext_iot/sdk/pnp/dataplane/models/model_search_options_py3.py | srinivasaraogattupalli/azure-iot-cli-extension | 9885dd528fe363f5c118f3b735ad22fd4e1a86f4 | [
"MIT"
] | null | null | null | azext_iot/sdk/pnp/dataplane/models/model_search_options_py3.py | srinivasaraogattupalli/azure-iot-cli-extension | 9885dd528fe363f5c118f3b735ad22fd4e1a86f4 | [
"MIT"
] | null | null | null | # 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 ... | 41 | 151 | 0.629573 | # 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 ... | 384 | 0 | 27 |
a2196d0f7780a7b4bed211a4ace46aa572a79d85 | 6,286 | py | Python | interractive.py | olom70/map | 4ae5279f401dbe9ac06d8000713579a12dc7561a | [
"CC0-1.0"
] | null | null | null | interractive.py | olom70/map | 4ae5279f401dbe9ac06d8000713579a12dc7561a | [
"CC0-1.0"
] | null | null | null | interractive.py | olom70/map | 4ae5279f401dbe9ac06d8000713579a12dc7561a | [
"CC0-1.0"
] | null | null | null | #%%
import configparser
config = configparser.ConfigParser()
config.read('map_indicators.ini')
config.sections()
tables = config['Database']['tables'].split()
print(tables)
# %%
import configparser
def init(inifile : str) -> bool:
'''
check if everything is ok prior to entering the main loop
'''
c... | 26.635593 | 104 | 0.635539 | #%%
import configparser
config = configparser.ConfigParser()
config.read('map_indicators.ini')
config.sections()
tables = config['Database']['tables'].split()
print(tables)
# %%
import configparser
def init(inifile : str) -> bool:
'''
check if everything is ok prior to entering the main loop
'''
c... | 2,984 | 0 | 311 |
b0dda212206426046b9871d8c294638c1d4846e8 | 779 | py | Python | orphanet/join_xml_sources.py | MRCIEU/mendelvar_standalone | fcde92fc012aa9dae7e7674b23387219921cadc9 | [
"MIT"
] | 3 | 2021-04-01T01:59:02.000Z | 2021-07-28T15:05:36.000Z | orphanet/join_xml_sources.py | MRCIEU/mendelvar_standalone | fcde92fc012aa9dae7e7674b23387219921cadc9 | [
"MIT"
] | null | null | null | orphanet/join_xml_sources.py | MRCIEU/mendelvar_standalone | fcde92fc012aa9dae7e7674b23387219921cadc9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import pandas as pd
#Full outer join on the 3 tables produced based on the 3 XML Orphanet files.
filename1 = "orphanet_xml1_parsed"
filename4 = "orphanet_xml4_parsed"
filename6 = "orphanet_xml6_parsed"
f1_df = pd.read_csv(filename1, sep="\t", index_col=False, dtype=str, na_filter = False, encoding... | 51.933333 | 105 | 0.741977 | #!/usr/bin/env python
import pandas as pd
#Full outer join on the 3 tables produced based on the 3 XML Orphanet files.
filename1 = "orphanet_xml1_parsed"
filename4 = "orphanet_xml4_parsed"
filename6 = "orphanet_xml6_parsed"
f1_df = pd.read_csv(filename1, sep="\t", index_col=False, dtype=str, na_filter = False, encoding... | 0 | 0 | 0 |
16a145283dfcd7cfb3244c5f692e7ecaba970b3f | 446 | py | Python | examples/discord_simple.py | NextChai/Tixte | 8b91c3e9e26abda20891e81399af81e00beb985e | [
"MIT"
] | 1 | 2021-08-05T05:25:36.000Z | 2021-08-05T05:25:36.000Z | examples/discord_simple.py | NextChai/Tixte | 8b91c3e9e26abda20891e81399af81e00beb985e | [
"MIT"
] | null | null | null | examples/discord_simple.py | NextChai/Tixte | 8b91c3e9e26abda20891e81399af81e00beb985e | [
"MIT"
] | null | null | null | import tixte
import discord
client = discord.Client(intents=discord.Intents.all(), command_prefix='!')
client.tixte = tixte.Client('your-master-token')
@client.event | 37.166667 | 74 | 0.715247 | import tixte
import discord
client = discord.Client(intents=discord.Intents.all(), command_prefix='!')
client.tixte = tixte.Client('your-master-token')
@client.event
async def on_member_join(member):
if member.id == 146348630926819328: # Specific user
file = discord.File("my_image.png")
url = awa... | 257 | 0 | 22 |
98e7a9b5456fd1c3d1b56c245f45739fcabe6f84 | 1,651 | py | Python | pyscreenshot/plugins/wxscreen.py | robocorp/pyscreenshot | 7cf03b23f4bdf1e4a2e3df1893de598e852dd346 | [
"BSD-2-Clause"
] | 1 | 2021-03-17T17:02:28.000Z | 2021-03-17T17:02:28.000Z | pyscreenshot/plugins/wxscreen.py | robocorp/rpaframework-screenshot | 7cf03b23f4bdf1e4a2e3df1893de598e852dd346 | [
"BSD-2-Clause"
] | null | null | null | pyscreenshot/plugins/wxscreen.py | robocorp/rpaframework-screenshot | 7cf03b23f4bdf1e4a2e3df1893de598e852dd346 | [
"BSD-2-Clause"
] | null | null | null | import logging
from PIL import Image
from pyscreenshot.plugins.backend import CBackend
from pyscreenshot.util import platform_is_osx, py2
if py2():
to_bytes = buffer
else:
to_bytes = bytes
log = logging.getLogger(__name__)
# based on:
# http://stackoverflow.com/questions/69645/take-a-screenshot-via-a-python-... | 23.927536 | 86 | 0.583283 | import logging
from PIL import Image
from pyscreenshot.plugins.backend import CBackend
from pyscreenshot.util import platform_is_osx, py2
if py2():
to_bytes = buffer
else:
to_bytes = bytes
log = logging.getLogger(__name__)
# based on:
# http://stackoverflow.com/questions/69645/take-a-screenshot-via-a-python-... | 1,081 | 176 | 46 |
aa75d306658a5a58ed88b755444ad851dc7528d4 | 807 | py | Python | ltapysg/bus.py | Codestian/ltapy | 73dc1624d144e7b3d0e15621dabb204654174ead | [
"MIT"
] | 1 | 2021-07-23T21:44:08.000Z | 2021-07-23T21:44:08.000Z | ltapysg/bus.py | Codestian/ltapysg | 73dc1624d144e7b3d0e15621dabb204654174ead | [
"MIT"
] | null | null | null | ltapysg/bus.py | Codestian/ltapysg | 73dc1624d144e7b3d0e15621dabb204654174ead | [
"MIT"
] | null | null | null | from .api import call
# Retrieve arrival timings for all buses operating for specified bus stop. Each bus has 3 recurring timings.
# Retrieve data of all operating bus services.
# Retrieve data of all operating bus routes.
# Retrieve data of bus stops. Max number of records per page is 500.
| 32.28 | 108 | 0.733581 | from .api import call
# Retrieve arrival timings for all buses operating for specified bus stop. Each bus has 3 recurring timings.
async def get_bus_arrival(api_key, bus_stop_code):
data = await call(api_key, "BusArrivalv2?BusStopCode=" + str(bus_stop_code))
return data["Services"]
# Retrieve data of all ope... | 420 | 0 | 88 |
35e9a17669a701d342e2843ef03d2d4370c7db2f | 11,720 | py | Python | malort/tests/test_malort_stats.py | CamDavidsonPilon/malort | bd463fe57fd7a15ccd24a1c7cfedefea4b31d3ac | [
"MIT"
] | 1 | 2021-03-06T13:17:33.000Z | 2021-03-06T13:17:33.000Z | malort/tests/test_malort_stats.py | CamDavidsonPilon/malort | bd463fe57fd7a15ccd24a1c7cfedefea4b31d3ac | [
"MIT"
] | null | null | null | malort/tests/test_malort_stats.py | CamDavidsonPilon/malort | bd463fe57fd7a15ccd24a1c7cfedefea4b31d3ac | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Malort Tests
Test Runner: PyTest
Notes:
* Expected values for string samples are any values that the sample
could contain, not the exact values.
"""
import os
import unittest
import pytest
import malort as mt
from malort.test_helpers import TestHelpers, TEST_FILES_1, TEST_FILES_2
| 42.773723 | 79 | 0.355546 | # -*- coding: utf-8 -*-
"""
Malort Tests
Test Runner: PyTest
Notes:
* Expected values for string samples are any values that the sample
could contain, not the exact values.
"""
import os
import unittest
import pytest
import malort as mt
from malort.test_helpers import TestHelpers, TEST_FILES_1, TEST_FILES_2
clas... | 10,975 | 224 | 204 |
a23937f232f1c962225838089f5638608f661285 | 46 | py | Python | losses/__init__.py | Lolik-Bolik/binary_classification | 5bdb4a4dde185e9e95e8bcf61dc7972f7e4a6c20 | [
"MIT"
] | 8 | 2020-10-21T19:05:48.000Z | 2021-01-18T11:13:20.000Z | losses/__init__.py | Lolik-Bolik/binary_classification | 5bdb4a4dde185e9e95e8bcf61dc7972f7e4a6c20 | [
"MIT"
] | null | null | null | losses/__init__.py | Lolik-Bolik/binary_classification | 5bdb4a4dde185e9e95e8bcf61dc7972f7e4a6c20 | [
"MIT"
] | null | null | null | from .labelsmoothing import LabelSmoothingLoss | 46 | 46 | 0.913043 | from .labelsmoothing import LabelSmoothingLoss | 0 | 0 | 0 |
fa6cb68e7f76699a4fda284654ae386e6c7bc077 | 14,401 | py | Python | stabilizer_code.py | shubhamchandak94/stabilizer_code | 327a748befa79102e8aaa1f14d828065e7b3b8f0 | [
"MIT"
] | 3 | 2019-10-02T12:51:54.000Z | 2021-12-15T06:02:00.000Z | stabilizer_code.py | manhduc1811/stabilizer_code | 327a748befa79102e8aaa1f14d828065e7b3b8f0 | [
"MIT"
] | null | null | null | stabilizer_code.py | manhduc1811/stabilizer_code | 327a748befa79102e8aaa1f14d828065e7b3b8f0 | [
"MIT"
] | 3 | 2020-01-08T23:16:29.000Z | 2021-02-12T16:17:34.000Z | import numpy as np
import itertools
from pyquil import Program
from pyquil.gates import MEASURE
# all references are to chapter 4 of Gottesman's thesis, chapter 4
# https://arxiv.org/pdf/quant-ph/9705052.pdf
tuple2pauli = {(0,0):'I', (0,1): 'Z', (1,0): 'X', (1,1): 'Y'}
| 45.572785 | 169 | 0.568711 | import numpy as np
import itertools
from pyquil import Program
from pyquil.gates import MEASURE
# all references are to chapter 4 of Gottesman's thesis, chapter 4
# https://arxiv.org/pdf/quant-ph/9705052.pdf
tuple2pauli = {(0,0):'I', (0,1): 'Z', (1,0): 'X', (1,1): 'Y'}
def pauli2controlledpauli(pauli,i,j):
p = P... | 13,837 | 0 | 291 |
87ae92510405ce5640b6b5cd5bd551000dc5eb08 | 4,238 | py | Python | SearchAndExtractFromGDoc.py | pmanandhar1452/GoogleDocumentSearchExtract | e4e513fb7ed5798c06a5e7de9e7b80437f87757f | [
"MIT"
] | null | null | null | SearchAndExtractFromGDoc.py | pmanandhar1452/GoogleDocumentSearchExtract | e4e513fb7ed5798c06a5e7de9e7b80437f87757f | [
"MIT"
] | null | null | null | SearchAndExtractFromGDoc.py | pmanandhar1452/GoogleDocumentSearchExtract | e4e513fb7ed5798c06a5e7de9e7b80437f87757f | [
"MIT"
] | null | null | null | __author__ = "Prakash Manandhar"
__copyright__ = "Copyright 2021, Prakash Manandhar"
__credits__ = ["Prakash Manandhar"]
__license__ = "MIT"
__version__ = "1.1"
__maintainer__ = "Prakash Manandhar"
__email__ = "prakashm@alum.mit.edu"
__status__ = "Production"
import argparse
import re
import os.path
from googleapiclie... | 36.534483 | 97 | 0.660453 | __author__ = "Prakash Manandhar"
__copyright__ = "Copyright 2021, Prakash Manandhar"
__credits__ = ["Prakash Manandhar"]
__license__ = "MIT"
__version__ = "1.1"
__maintainer__ = "Prakash Manandhar"
__email__ = "prakashm@alum.mit.edu"
__status__ = "Production"
import argparse
import re
import os.path
from googleapiclie... | 777 | 0 | 46 |
01ec477fe7a14ef6903a2d62b4d67db5df21d50b | 1,778 | py | Python | load_behavioural_results_ctl.py | MadsJensen/agency_connectivity | b45adbc133573de1ebdcff0edb17e43f1691c577 | [
"BSD-3-Clause"
] | null | null | null | load_behavioural_results_ctl.py | MadsJensen/agency_connectivity | b45adbc133573de1ebdcff0edb17e43f1691c577 | [
"BSD-3-Clause"
] | null | null | null | load_behavioural_results_ctl.py | MadsJensen/agency_connectivity | b45adbc133573de1ebdcff0edb17e43f1691c577 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Mon Jun 27 13:53:50 2016
@author: au194693
"""
import numpy as np
import scipy.io as sio
import pandas as pd
from my_settings import (tf_folder, subjects_ctl)
data = sio.loadmat("/Volumes/My_Passport/agency_connectivity/" +
"results/data_all_Ctrl.mat")["data... | 30.135593 | 78 | 0.545557 | # -*- coding: utf-8 -*-
"""
Created on Mon Jun 27 13:53:50 2016
@author: au194693
"""
import numpy as np
import scipy.io as sio
import pandas as pd
from my_settings import (tf_folder, subjects_ctl)
data = sio.loadmat("/Volumes/My_Passport/agency_connectivity/" +
"results/data_all_Ctrl.mat")["data... | 0 | 0 | 0 |
6e87fe71c011822c624797f44b1afda5a4a3adf6 | 94 | py | Python | lambdata_jayadamo/__init__.py | JayAdamo/lambdata | 655e12b4fc0db0d9947dfcbd54981252525579f3 | [
"MIT"
] | null | null | null | lambdata_jayadamo/__init__.py | JayAdamo/lambdata | 655e12b4fc0db0d9947dfcbd54981252525579f3 | [
"MIT"
] | null | null | null | lambdata_jayadamo/__init__.py | JayAdamo/lambdata | 655e12b4fc0db0d9947dfcbd54981252525579f3 | [
"MIT"
] | 1 | 2020-08-05T01:58:58.000Z | 2020-08-05T01:58:58.000Z | #!/usr/bin/env python
"""
lambdata - a collection of Data Science helper functions
"""
| 9.4 | 57 | 0.659574 | #!/usr/bin/env python
"""
lambdata - a collection of Data Science helper functions
"""
| 0 | 0 | 0 |
489c927abbaf24f9fd6cd54bebaf466d20351095 | 4,469 | py | Python | search/info/modules/search_content/views.py | aircov/- | 2e306b846dcdd3c57f1dba4493dc3d2babb036a7 | [
"Apache-2.0"
] | null | null | null | search/info/modules/search_content/views.py | aircov/- | 2e306b846dcdd3c57f1dba4493dc3d2babb036a7 | [
"Apache-2.0"
] | null | null | null | search/info/modules/search_content/views.py | aircov/- | 2e306b846dcdd3c57f1dba4493dc3d2babb036a7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@time : 2020/05/10 12:14
@author : 姚明伟
"""
import json
import pickle
from flask import request, jsonify, make_response
from info.modules.search_content.search_script_conf import get_tips_word
from info.utils.content import search_content_indistinct, search_content_exact
from info.utils.... | 29.019481 | 116 | 0.626762 | # -*- coding: utf-8 -*-
"""
@time : 2020/05/10 12:14
@author : 姚明伟
"""
import json
import pickle
from flask import request, jsonify, make_response
from info.modules.search_content.search_script_conf import get_tips_word
from info.utils.content import search_content_indistinct, search_content_exact
from info.utils.... | 1,926 | 0 | 67 |
4537802d0067de55f96a213b04144019b31ab30e | 14,258 | py | Python | python-watcher-2.0.0/watcher/tests/objects/test_audit.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | null | null | null | python-watcher-2.0.0/watcher/tests/objects/test_audit.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | python-watcher-2.0.0/watcher/tests/objects/test_audit.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 2 | 2020-03-15T01:24:15.000Z | 2020-07-22T20:34:26.000Z | # Copyright 2015 OpenStack Foundation
# 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 requ... | 43.736196 | 79 | 0.677304 | # Copyright 2015 OpenStack Foundation
# 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 requ... | 10,799 | 2,363 | 69 |
1b407c21fd2b5a9d6d5fed1674df3508e49d5520 | 8,081 | py | Python | export_onnx.py | ozendelait/pytorch-semseg | 200491febd653bd26befcd5b3d52c614aa832b7e | [
"MIT"
] | 1 | 2021-04-30T07:46:32.000Z | 2021-04-30T07:46:32.000Z | export_onnx.py | ozendelait/pytorch-semseg | 200491febd653bd26befcd5b3d52c614aa832b7e | [
"MIT"
] | null | null | null | export_onnx.py | ozendelait/pytorch-semseg | 200491febd653bd26befcd5b3d52c614aa832b7e | [
"MIT"
] | 1 | 2022-01-21T17:31:46.000Z | 2022-01-21T17:31:46.000Z | import os
import torch
import torch.nn.functional as F
from collections import OrderedDict
import argparse
from ptsemseg.models import get_model
from ptsemseg.utils import convert_state_dict
import numpy as np
#based on https://github.com/ducha-aiki/ucn-pytorch/blob/master/Utils.py ; commit de5bdec from Oct 4, 20... | 46.442529 | 207 | 0.667368 | import os
import torch
import torch.nn.functional as F
from collections import OrderedDict
import argparse
from ptsemseg.models import get_model
from ptsemseg.utils import convert_state_dict
import numpy as np
#based on https://github.com/ducha-aiki/ucn-pytorch/blob/master/Utils.py ; commit de5bdec from Oct 4, 20... | 6,766 | 183 | 665 |
726d509fec324c57e3d5696c10602c9ba9bea1a5 | 267 | py | Python | suldocs/form.py | suldoc/djangoAPI | dd85ffcec0fba7ec98097ebf41f374781c47f1cc | [
"Apache-2.0"
] | null | null | null | suldocs/form.py | suldoc/djangoAPI | dd85ffcec0fba7ec98097ebf41f374781c47f1cc | [
"Apache-2.0"
] | 1 | 2019-08-21T07:40:57.000Z | 2019-08-21T07:40:57.000Z | suldocs/form.py | suldoc/djangoAPI | dd85ffcec0fba7ec98097ebf41f374781c47f1cc | [
"Apache-2.0"
] | null | null | null | from django import forms
from .models.taste_note import TasteNoteModel
| 26.7 | 93 | 0.651685 | from django import forms
from .models.taste_note import TasteNoteModel
class PostForm(forms.ModelForm):
class Meta:
model = TasteNoteModel
fields = ('user_id', 'name', 'comment', 'stars_taste', 'stars_costvalue', 'img_path',
)
| 0 | 172 | 23 |
de125dd185d4c85d699be3dfe4cdafc8237403b3 | 3,831 | py | Python | setup.py | HendrikVE/my_pi_drei | 7e0392dced6e54791690929d968195282796cbd8 | [
"MIT"
] | null | null | null | setup.py | HendrikVE/my_pi_drei | 7e0392dced6e54791690929d968195282796cbd8 | [
"MIT"
] | 1 | 2018-02-03T23:14:38.000Z | 2018-02-03T23:17:06.000Z | setup.py | HendrikVE/my_pi_drei | 7e0392dced6e54791690929d968195282796cbd8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
* Copyright (C) 2017 Hendrik van Essen
*
* This file is subject to the terms and conditions of the MIT License
* See the file LICENSE in the top level directory for more details.
"""
"""setup script"""
"""
BASIC SYSTEM PRIVATE COMPUTER
sudo apt-get install python... | 25.370861 | 120 | 0.655703 | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
"""
* Copyright (C) 2017 Hendrik van Essen
*
* This file is subject to the terms and conditions of the MIT License
* See the file LICENSE in the top level directory for more details.
"""
"""setup script"""
"""
BASIC SYSTEM PRIVATE COMPUTER
sudo apt-get install python... | 0 | 0 | 0 |
d2786ce486ba4e4c5fe70310ec678555c0662715 | 6,728 | py | Python | movie_genre_predictor.py | iamritviksharma/movie-genre-predictor | 42d86e199d4ddf90f91412f71cc033f7ae34b58d | [
"MIT"
] | null | null | null | movie_genre_predictor.py | iamritviksharma/movie-genre-predictor | 42d86e199d4ddf90f91412f71cc033f7ae34b58d | [
"MIT"
] | null | null | null | movie_genre_predictor.py | iamritviksharma/movie-genre-predictor | 42d86e199d4ddf90f91412f71cc033f7ae34b58d | [
"MIT"
] | null | null | null | import re
import sys
import nltk
import json
import argparse
import pandas as pd
from nltk.corpus import stopwords
from sklearn.metrics import f1_score
from sklearn.model_selection import train_test_split
from sklearn.svm import LinearSVC
from sklearn.multiclass import OneVsRestClassifier
from sklearn.preprocessing im... | 44.853333 | 153 | 0.68475 | import re
import sys
import nltk
import json
import argparse
import pandas as pd
from nltk.corpus import stopwords
from sklearn.metrics import f1_score
from sklearn.model_selection import train_test_split
from sklearn.svm import LinearSVC
from sklearn.multiclass import OneVsRestClassifier
from sklearn.preprocessing im... | 4,265 | 1 | 122 |
298b8b6fda9878e37273622e4601e97c86891d46 | 2,882 | py | Python | src/statistics.py | GuanLab/timesias | 899d1a42c8df98f6540bcfaa1782751ee7cc6536 | [
"MIT"
] | 2 | 2021-10-21T17:28:37.000Z | 2022-03-16T00:49:05.000Z | src/statistics.py | GuanLab/timesias | 899d1a42c8df98f6540bcfaa1782751ee7cc6536 | [
"MIT"
] | null | null | null | src/statistics.py | GuanLab/timesias | 899d1a42c8df98f6540bcfaa1782751ee7cc6536 | [
"MIT"
] | null | null | null | from scipy.stats import pearsonr, spearmanr
from sklearn.metrics import precision_recall_curve, roc_curve, auc
import pandas as pd
import numpy as np
def pearsonr_cor(pred, label):
""" Return Pearson's correlation between prediction and label
"""
cor, _ = pearsonr(pred, label)
return cor
def spearmanr_... | 26.685185 | 79 | 0.622137 | from scipy.stats import pearsonr, spearmanr
from sklearn.metrics import precision_recall_curve, roc_curve, auc
import pandas as pd
import numpy as np
def pearsonr_cor(pred, label):
""" Return Pearson's correlation between prediction and label
"""
cor, _ = pearsonr(pred, label)
return cor
def spearmanr_... | 0 | 0 | 0 |
6a3d5fc6930e4fdb3839937e31771fbced25f62e | 1,332 | py | Python | doc/scripts/show-versions.py | Kunhui-Li/acrn-hypervisor | f3305b6373494f3051888fe8c22b4293745cd1e7 | [
"BSD-3-Clause"
] | 2 | 2020-09-14T06:48:39.000Z | 2020-10-12T14:21:01.000Z | doc/scripts/show-versions.py | Kunhui-Li/acrn-hypervisor | f3305b6373494f3051888fe8c22b4293745cd1e7 | [
"BSD-3-Clause"
] | 1 | 2019-04-11T10:23:42.000Z | 2019-04-11T10:23:42.000Z | doc/scripts/show-versions.py | Kunhui-Li/acrn-hypervisor | f3305b6373494f3051888fe8c22b4293745cd1e7 | [
"BSD-3-Clause"
] | 2 | 2019-03-25T02:54:20.000Z | 2019-03-27T04:06:21.000Z | #!/usr/bin/env python3
#
# Copyright (c) 2018, Intel Corporation
#
# SPDX-License-Identifier: BSD-3-Clause
#
# Show installed versions of doc building tools
import os.path
import sys
import pkg_resources
import subprocess
# Check all requirements listed in requirements.txt and print out version installed (if any)
pri... | 30.272727 | 114 | 0.641141 | #!/usr/bin/env python3
#
# Copyright (c) 2018, Intel Corporation
#
# SPDX-License-Identifier: BSD-3-Clause
#
# Show installed versions of doc building tools
import os.path
import sys
import pkg_resources
import subprocess
class color:
PURPLE = '\033[95m'
CYAN = '\033[96m'
DARKCYAN = '\033[36m'
BLUE = '\03... | 0 | 210 | 23 |
727d4f7e3389f93c70f3b869e04c44bc3d533cc9 | 1,780 | py | Python | CalibTracker/SiStripESProducers/test/python/checkphase2cabling_cfg.py | SWuchterl/cmssw | 769b4a7ef81796579af7d626da6039dfa0347b8e | [
"Apache-2.0"
] | 6 | 2017-09-08T14:12:56.000Z | 2022-03-09T23:57:01.000Z | CalibTracker/SiStripESProducers/test/python/checkphase2cabling_cfg.py | SWuchterl/cmssw | 769b4a7ef81796579af7d626da6039dfa0347b8e | [
"Apache-2.0"
] | 545 | 2017-09-19T17:10:19.000Z | 2022-03-07T16:55:27.000Z | CalibTracker/SiStripESProducers/test/python/checkphase2cabling_cfg.py | SWuchterl/cmssw | 769b4a7ef81796579af7d626da6039dfa0347b8e | [
"Apache-2.0"
] | 14 | 2017-10-04T09:47:21.000Z | 2019-10-23T18:04:45.000Z | import FWCore.ParameterSet.Config as cms
process = cms.Process("Demo")
process.load("FWCore.MessageService.MessageLogger_cfi")
process.MessageLogger = cms.Service("MessageLogger",
debugModules = cms.untracked.vstring("*"),
cout = cms.untracked.PSet(
threshold = cms.untracked.string('DEBUG')
),
... | 35.6 | 97 | 0.730899 | import FWCore.ParameterSet.Config as cms
process = cms.Process("Demo")
process.load("FWCore.MessageService.MessageLogger_cfi")
process.MessageLogger = cms.Service("MessageLogger",
debugModules = cms.untracked.vstring("*"),
cout = cms.untracked.PSet(
threshold = cms.untracked.string('DEBUG')
),
... | 0 | 0 | 0 |
3235bef2b64c4ed44383d234156a2f4855b1ef64 | 158 | py | Python | python/errors_and_exceptions/incorrect_regex.py | avenet/hackerrank | e522030a023af4ff50d5fc64bd3eba30144e006c | [
"MIT"
] | null | null | null | python/errors_and_exceptions/incorrect_regex.py | avenet/hackerrank | e522030a023af4ff50d5fc64bd3eba30144e006c | [
"MIT"
] | null | null | null | python/errors_and_exceptions/incorrect_regex.py | avenet/hackerrank | e522030a023af4ff50d5fc64bd3eba30144e006c | [
"MIT"
] | null | null | null | import re
cases = int(input())
for case in range(cases):
try:
re.compile(input())
print(True)
except re.error:
print(False)
| 14.363636 | 27 | 0.563291 | import re
cases = int(input())
for case in range(cases):
try:
re.compile(input())
print(True)
except re.error:
print(False)
| 0 | 0 | 0 |
5c79163248b243078743b5d3dfe3980d7050c117 | 9,687 | py | Python | qm-theory-benchmark/data/torsiondrives_benchmark.py | MobleyLab/qm-theory-benchmark | e7f0a002ecf7ec8ded2c34b1b65b96467884df61 | [
"MIT"
] | null | null | null | qm-theory-benchmark/data/torsiondrives_benchmark.py | MobleyLab/qm-theory-benchmark | e7f0a002ecf7ec8ded2c34b1b65b96467884df61 | [
"MIT"
] | null | null | null | qm-theory-benchmark/data/torsiondrives_benchmark.py | MobleyLab/qm-theory-benchmark | e7f0a002ecf7ec8ded2c34b1b65b96467884df61 | [
"MIT"
] | null | null | null | import copy
import io
from collections import defaultdict
import click
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib import rcParams
from matplotlib.backends.backend_pdf import PdfPages
from openff.toolkit.topology import Molecule
from PIL import Image
fro... | 30.948882 | 83 | 0.533395 | import copy
import io
from collections import defaultdict
import click
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from matplotlib import rcParams
from matplotlib.backends.backend_pdf import PdfPages
from openff.toolkit.topology import Molecule
from PIL import Image
fro... | 7,332 | 0 | 22 |
b993def195f9c4c9aae8101628c90d98f3c754f7 | 1,045 | py | Python | Chapter10/linkedList.py | hexinatgithub/CLRS | c765db7806b566be18ae1c8f6777ebb61a25dfe0 | [
"MIT"
] | 1 | 2016-10-27T15:02:16.000Z | 2016-10-27T15:02:16.000Z | Chapter10/linkedList.py | hexinatgithub/CLRS | c765db7806b566be18ae1c8f6777ebb61a25dfe0 | [
"MIT"
] | null | null | null | Chapter10/linkedList.py | hexinatgithub/CLRS | c765db7806b566be18ae1c8f6777ebb61a25dfe0 | [
"MIT"
] | null | null | null | class elements(object):
"""docstring for elements"""
class linkedList(object):
"""docstring for linkedList"""
# l = linkedList()
# x1 = elements(key=5)
# x2 = elements(key=6)
# x3 = elements(key=7)
# x4 = elements(key=8)
# x5 = elements(key=9)
# l.list_insert(x1)
# l.list_insert(x2)
# l.list_insert(x3)
# l.list_i... | 18.333333 | 37 | 0.645933 | class elements(object):
"""docstring for elements"""
def __init__(self, key):
super(elements, self).__init__()
self.pre = None
self.key = key
self.next = None
class linkedList(object):
"""docstring for linkedList"""
def __init__(self):
super(linkedList, self).__init__()
self.nil = elements(None)
sel... | 471 | 0 | 118 |
b9adfc1e47c2ec6be5bf71142ad5ed0f499e3d15 | 2,393 | py | Python | adb.py | CyberMonitor/adb | 6f0b336aa7dae9578cac340cfc1dd67374a5a4af | [
"MIT"
] | 1 | 2021-12-10T18:31:41.000Z | 2021-12-10T18:31:41.000Z | adb.py | CyberMonitor/adb | 6f0b336aa7dae9578cac340cfc1dd67374a5a4af | [
"MIT"
] | null | null | null | adb.py | CyberMonitor/adb | 6f0b336aa7dae9578cac340cfc1dd67374a5a4af | [
"MIT"
] | null | null | null | from argparse import ArgumentParser
from argparse import RawDescriptionHelpFormatter
import sys
import build
import os
from pathlib import Path
args = get_args(sys.argv)
if args.listadversaries == True:
adversary_list = os.listdir(os.path.join(Path(__file__).parent, "adversary"))
for item in adversary_list:
... | 45.150943 | 169 | 0.65608 | from argparse import ArgumentParser
from argparse import RawDescriptionHelpFormatter
import sys
import build
import os
from pathlib import Path
def get_args(arg_list):
del arg_list[0]
try:
parser = ArgumentParser(description='program description', formatter_class=RawDescriptionHelpFormatter, prog='prog... | 1,488 | 0 | 23 |
e6b49d8f58e205ff8481bbdb1ea24f0909f30e0c | 649 | py | Python | snowctl/connect.py | Rouhija/snowflake-cli | aaef22a4e73c378e149610e7baf0ca5f900db156 | [
"MIT"
] | null | null | null | snowctl/connect.py | Rouhija/snowflake-cli | aaef22a4e73c378e149610e7baf0ca5f900db156 | [
"MIT"
] | null | null | null | snowctl/connect.py | Rouhija/snowflake-cli | aaef22a4e73c378e149610e7baf0ca5f900db156 | [
"MIT"
] | null | null | null | import sys
import snowflake.connector
from snowflake.sqlalchemy import URL
from sqlalchemy import create_engine
| 29.5 | 60 | 0.599384 | import sys
import snowflake.connector
from snowflake.sqlalchemy import URL
from sqlalchemy import create_engine
def snowflake_connect(conf):
print('Connecting to snowflake... ', end='', flush=True)
try:
engine = create_engine(URL(
user=conf['user'],
password=conf['password'],
... | 514 | 0 | 23 |
a47b724cd00ade7c197c4e23a8991904ad20cd95 | 2,107 | py | Python | model/virus_file.py | FellowHashbrown/virus.sh | 757e50fa402f63ab7161518dcec7e1441aa880dd | [
"MIT"
] | null | null | null | model/virus_file.py | FellowHashbrown/virus.sh | 757e50fa402f63ab7161518dcec7e1441aa880dd | [
"MIT"
] | null | null | null | model/virus_file.py | FellowHashbrown/virus.sh | 757e50fa402f63ab7161518dcec7e1441aa880dd | [
"MIT"
] | null | null | null | from typing import TYPE_CHECKING
if TYPE_CHECKING:
from model import Directory
from model import NormalFile
class VirusFile(NormalFile):
"""The VirusFile class is the structure that acts as a Virus File on the
filesystem that still has lines of data but also deletes files that are
not other virus fil... | 35.711864 | 100 | 0.601804 | from typing import TYPE_CHECKING
if TYPE_CHECKING:
from model import Directory
from model import NormalFile
class VirusFile(NormalFile):
"""The VirusFile class is the structure that acts as a Virus File on the
filesystem that still has lines of data but also deletes files that are
not other virus fil... | 460 | 0 | 54 |
934b67d4290ba042674635e6d16d5a9349437d7f | 462 | py | Python | plot/plot.py | RuoAndo/Usenix_LISA19 | 966ee9593cf924ef8a8ace45cdb826b74b3b9001 | [
"MIT"
] | null | null | null | plot/plot.py | RuoAndo/Usenix_LISA19 | 966ee9593cf924ef8a8ace45cdb826b74b3b9001 | [
"MIT"
] | null | null | null | plot/plot.py | RuoAndo/Usenix_LISA19 | 966ee9593cf924ef8a8ace45cdb826b74b3b9001 | [
"MIT"
] | null | null | null | #coding:utf-8
# K-means
import numpy as np
import sys
import matplotlib.pyplot as plt
argvs = sys.argv
if __name__ == "__main__":
data = np.genfromtxt(argvs[1], delimiter=",")
print(data)
#plt.subplot(2, 1, 1)
plt.plot(data[:,3])
data2 = np.genfromtxt(argvs[2], delimiter=",")
print(data2)
... | 16.5 | 50 | 0.588745 | #coding:utf-8
# K-means
import numpy as np
import sys
import matplotlib.pyplot as plt
argvs = sys.argv
if __name__ == "__main__":
data = np.genfromtxt(argvs[1], delimiter=",")
print(data)
#plt.subplot(2, 1, 1)
plt.plot(data[:,3])
data2 = np.genfromtxt(argvs[2], delimiter=",")
print(data2)
... | 0 | 0 | 0 |
26c113ab0aa0a4e40565dd5f43597c497b985366 | 8,240 | py | Python | model.py | 594422814/ContrastCorr | 9b117944275933132fad6921bbabb3afddca60bd | [
"MIT"
] | 34 | 2020-12-09T08:04:41.000Z | 2021-09-07T14:15:27.000Z | model.py | 594422814/ContrastCorr | 9b117944275933132fad6921bbabb3afddca60bd | [
"MIT"
] | null | null | null | model.py | 594422814/ContrastCorr | 9b117944275933132fad6921bbabb3afddca60bd | [
"MIT"
] | 9 | 2020-12-11T07:14:38.000Z | 2022-03-18T02:23:26.000Z | import copy
import torch
import torch.nn as nn
import torch.nn.functional as F
from libs.net_utils import NLM, NLM_dot, NLM_woSoft, NLM_NC_woSoft, Batch_Contrastive
from torchvision.models import resnet18
from libs.autoencoder import encoder3, decoder3, encoder_res18, encoder_res50
from libs.utils import *
import pdb... | 33.632653 | 152 | 0.701214 | import copy
import torch
import torch.nn as nn
import torch.nn.functional as F
from libs.net_utils import NLM, NLM_dot, NLM_woSoft, NLM_NC_woSoft, Batch_Contrastive
from torchvision.models import resnet18
from libs.autoencoder import encoder3, decoder3, encoder_res18, encoder_res50
from libs.utils import *
import pdb... | 5,819 | 13 | 140 |
ce92d65b19e53232170e22e1a49d257ea38bcdce | 1,108 | py | Python | day11/test_day11.py | lukasHD/adventOfCode2020 | fa171f3ad8232a0542d544d3de9b2b9d8fdf8ccd | [
"MIT"
] | null | null | null | day11/test_day11.py | lukasHD/adventOfCode2020 | fa171f3ad8232a0542d544d3de9b2b9d8fdf8ccd | [
"MIT"
] | null | null | null | day11/test_day11.py | lukasHD/adventOfCode2020 | fa171f3ad8232a0542d544d3de9b2b9d8fdf8ccd | [
"MIT"
] | null | null | null | import day11 as day
from helper import loadingUtils
INPUTFOLDER = day.get_path()
| 25.181818 | 64 | 0.694043 | import day11 as day
from helper import loadingUtils
INPUTFOLDER = day.get_path()
def test_part_1():
result = day.run_part_1(INPUTFOLDER+"/test1")
assert result == 37
def test_part_1_real():
result = day.run_part_1(INPUTFOLDER+"/input1")
assert result == 2178
def test_view_2():
seatmap = loadin... | 860 | 0 | 161 |
4881bacc93ebf7813cff88692566192aa95fce8e | 815 | py | Python | tests/test_overdoses.py | aculpcano/md-accidental-overdoses | 9a558fee8b2f80ea81824d09078b886dc6f0ccd0 | [
"MIT"
] | null | null | null | tests/test_overdoses.py | aculpcano/md-accidental-overdoses | 9a558fee8b2f80ea81824d09078b886dc6f0ccd0 | [
"MIT"
] | null | null | null | tests/test_overdoses.py | aculpcano/md-accidental-overdoses | 9a558fee8b2f80ea81824d09078b886dc6f0ccd0 | [
"MIT"
] | null | null | null | from unittest import TestCase, main
import overdoses
import pandas as pd
from pandas.util.testing import assert_series_equal
if __name__ == '__main__':
main()
| 29.107143 | 78 | 0.72638 | from unittest import TestCase, main
import overdoses
import pandas as pd
from pandas.util.testing import assert_series_equal
class OverdosesTestCase(TestCase):
@staticmethod
def test_get_database_data():
actual_result = overdoses.OverdoseDatabase().query(2013, 'Alcohol')
actual_result = pd.D... | 540 | 84 | 23 |
92f20fb56f93431fc20b90d0fba5ee34fd9c98cf | 5,590 | py | Python | Chapter 5/B05034_ch5_SRC_V2/src_ch5_python2/wargame/test/test_wargame.py | kunal2494/Learning-Python-Application-Development | 241bec5d5340e95cd68aef813c9ce8b0fca98986 | [
"MIT"
] | 64 | 2016-12-15T20:38:45.000Z | 2022-03-31T06:38:39.000Z | Chapter 5/B05034_ch5_SRC_V2/src_ch5_python2/wargame/test/test_wargame.py | kunal2494/Learning-Python-Application-Development | 241bec5d5340e95cd68aef813c9ce8b0fca98986 | [
"MIT"
] | null | null | null | Chapter 5/B05034_ch5_SRC_V2/src_ch5_python2/wargame/test/test_wargame.py | kunal2494/Learning-Python-Application-Development | 241bec5d5340e95cd68aef813c9ce8b0fca98986 | [
"MIT"
] | 48 | 2016-09-14T20:01:31.000Z | 2021-11-25T09:03:37.000Z | """wargame.test.test_wargame
This module contains unit tests for various modules in wargame package.
This module is compatible with Python 2.7.9. It contains
supporting code for the book, Learning Python Application Development,
Packt Publishing.
:copyright: 2016, Ninad Sathaye
:license: The MIT License (MIT) . See... | 36.064516 | 80 | 0.635242 | """wargame.test.test_wargame
This module contains unit tests for various modules in wargame package.
This module is compatible with Python 2.7.9. It contains
supporting code for the book, Learning Python Application Development,
Packt Publishing.
:copyright: 2016, Ninad Sathaye
:license: The MIT License (MIT) . See... | 0 | 0 | 0 |
f9666c6ec0041af7308b803c057156ce910286a6 | 3,232 | py | Python | scripts/important_classes.py | YandexLazyBoy/hotline_miami | 785966c13ad5b537a3b6ac25c2f5f293310d61d7 | [
"Unlicense"
] | null | null | null | scripts/important_classes.py | YandexLazyBoy/hotline_miami | 785966c13ad5b537a3b6ac25c2f5f293310d61d7 | [
"Unlicense"
] | null | null | null | scripts/important_classes.py | YandexLazyBoy/hotline_miami | 785966c13ad5b537a3b6ac25c2f5f293310d61d7 | [
"Unlicense"
] | null | null | null | from data.classes.players import *
| 35.516484 | 98 | 0.605817 | from data.classes.players import *
class Group(pygame.sprite.AbstractGroup):
def draw(self, surface):
sprites = self.sprites()
surface_blit = surface.blit
for spr in sprites:
self.spritedict[spr] = surface_blit(spr.image, spr.rect)
self.lostsprites = []
class LayeredG... | 2,872 | 66 | 304 |
588814726948fc619cc4f732d850d8dc0738281f | 7,335 | py | Python | scripts/replicate_analysis.py | ThibaultLatrille/MutationSelectionDrift | 7b9e4fe5b181413823ddba9b637af553f977836c | [
"Unlicense",
"MIT"
] | 1 | 2022-01-20T14:54:20.000Z | 2022-01-20T14:54:20.000Z | scripts/replicate_analysis.py | ThibaultLatrille/MutationSelectionDrift | 7b9e4fe5b181413823ddba9b637af553f977836c | [
"Unlicense",
"MIT"
] | null | null | null | scripts/replicate_analysis.py | ThibaultLatrille/MutationSelectionDrift | 7b9e4fe5b181413823ddba9b637af553f977836c | [
"Unlicense",
"MIT"
] | null | null | null | import os
from glob import glob
from ete3 import Tree
from plot_module import *
os.chdir("../DataEmpirical")
exp_dirs = sorted(
set(["_".join(i.split("_")[:-1]) for i in os.listdir("Experiments") if ("Replicates" in i) and ("Isopods" in i)]))
os.makedirs("Analysis/DataFrame", exist_ok=True)
file_format = "pdf"
... | 53.152174 | 120 | 0.537423 | import os
from glob import glob
from ete3 import Tree
from plot_module import *
os.chdir("../DataEmpirical")
exp_dirs = sorted(
set(["_".join(i.split("_")[:-1]) for i in os.listdir("Experiments") if ("Replicates" in i) and ("Isopods" in i)]))
os.makedirs("Analysis/DataFrame", exist_ok=True)
file_format = "pdf"
... | 203 | 0 | 46 |
887e5593219d048269e4975d255cfbc1fec3e380 | 1,092 | py | Python | autotune/optimizers/random_search.py | aprams/autotune | ea7cbf5fe9b334345c4de81c2d562b818519a002 | [
"MIT"
] | 3 | 2019-04-26T10:22:43.000Z | 2020-01-15T19:04:30.000Z | autotune/optimizers/random_search.py | aprams/autotune | ea7cbf5fe9b334345c4de81c2d562b818519a002 | [
"MIT"
] | 28 | 2019-05-22T17:33:28.000Z | 2022-03-11T23:49:15.000Z | autotune/optimizers/random_search.py | aprams/autotune | ea7cbf5fe9b334345c4de81c2d562b818519a002 | [
"MIT"
] | 1 | 2020-01-15T19:09:15.000Z | 2020-01-15T19:09:15.000Z | import random
import numpy as np
from autotune.param_space import Param
from typing import Callable
from .hyper_param_opt import AbstractHyperParameterOptimizer
| 36.4 | 114 | 0.699634 | import random
import numpy as np
from autotune.param_space import Param
from typing import Callable
from .hyper_param_opt import AbstractHyperParameterOptimizer
class RandomSearchOptimizer(AbstractHyperParameterOptimizer):
name="RandomSearch"
def __init__(self, hyper_param_list: list, eval_fn: Callable, call... | 761 | 145 | 23 |
b4f3eb60e431c7491803dd069e84e30527feb685 | 59,350 | py | Python | tests/test_DeriveAlive.py | cs207-group19/Automatic-Differentiation | e01add64b3c310f64ae1902c39f41fd2695299cb | [
"MIT"
] | 9 | 2019-02-11T03:53:34.000Z | 2021-11-19T21:41:05.000Z | tests/test_DeriveAlive.py | cs207-group19/cs207-FinalProject | e01add64b3c310f64ae1902c39f41fd2695299cb | [
"MIT"
] | null | null | null | tests/test_DeriveAlive.py | cs207-group19/cs207-FinalProject | e01add64b3c310f64ae1902c39f41fd2695299cb | [
"MIT"
] | 3 | 2019-11-19T01:20:27.000Z | 2020-11-04T19:05:15.000Z | # Test suite for DeriveAlive module
# These lines should be included for Travis/Coverall
import sys
sys.path.append('../')
import DeriveAlive.DeriveAlive as da
import numpy as np
import math
def test_DeriveAlive_Var():
'''Test constructor of Var class to ensure proper variable initializations.'''
# Run tests with... | 32.150596 | 103 | 0.497473 | # Test suite for DeriveAlive module
# These lines should be included for Travis/Coverall
import sys
sys.path.append('../')
import DeriveAlive.DeriveAlive as da
import numpy as np
import math
def test_DeriveAlive_Var():
'''Test constructor of Var class to ensure proper variable initializations.'''
def test_scalar_... | 53,542 | 0 | 2,679 |
953608a1cbe781703af9335942853c23d2d669b3 | 1,498 | py | Python | ngsTools/io/__init__.py | Vassyli/ngstools | ced1ca7ca6e5137f7dde35c68c06a4b245b5fd00 | [
"MIT"
] | null | null | null | ngsTools/io/__init__.py | Vassyli/ngstools | ced1ca7ca6e5137f7dde35c68c06a4b245b5fd00 | [
"MIT"
] | null | null | null | ngsTools/io/__init__.py | Vassyli/ngstools | ced1ca7ca6e5137f7dde35c68c06a4b245b5fd00 | [
"MIT"
] | null | null | null | """Subpackage for handling import and export of sequencing data.
"""
import os
from .GenomFeatureReader import GenomFeatureReader
from .GenomReader import GenomReader
from .SamReader import SamReader, SamAlignedRead
from .BaseAlignedRead import BaseAlignedRead
from .BedtoolsIntersectionReader import BedtoolsIntersec... | 28.264151 | 95 | 0.692924 | """Subpackage for handling import and export of sequencing data.
"""
import os
from .GenomFeatureReader import GenomFeatureReader
from .GenomReader import GenomReader
from .SamReader import SamReader, SamAlignedRead
from .BaseAlignedRead import BaseAlignedRead
from .BedtoolsIntersectionReader import BedtoolsIntersec... | 0 | 0 | 0 |
52ab3370f8083da5020f4f251fd3c07d6f530208 | 3,730 | py | Python | QNEM/history.py | SimBussy/C-mix | 1976edbb367bb27e7bb415384e8219b4ba99de61 | [
"MIT"
] | 5 | 2018-06-05T07:30:11.000Z | 2020-11-24T17:41:37.000Z | QNEM/history.py | SimBussy/C-mix | 1976edbb367bb27e7bb415384e8219b4ba99de61 | [
"MIT"
] | null | null | null | QNEM/history.py | SimBussy/C-mix | 1976edbb367bb27e7bb415384e8219b4ba99de61 | [
"MIT"
] | 2 | 2019-06-06T10:34:58.000Z | 2021-10-06T19:57:46.000Z | # -*- coding: utf-8 -*-
# Author: Simon Bussy <simon.bussy@gmail.com>
import numpy as np
from collections import defaultdict
class History():
"""A class to manage the history along iterations of a solver.
"""
def clear(self):
"""Reset history values"""
self.values = defaultdict(list)... | 30.325203 | 78 | 0.594906 | # -*- coding: utf-8 -*-
# Author: Simon Bussy <simon.bussy@gmail.com>
import numpy as np
from collections import defaultdict
def n_iter_func(n_iter=0, **kwargs):
return n_iter
def obj_func(obj=0, **kwargs):
return obj
def rel_obj_func(rel_obj=0, **kwargs):
return rel_obj
def spars_func(coeffs=None,... | 1,592 | 0 | 227 |