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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ab2c83f37e99946fc18773939c89414615a8bd37 | 255 | py | Python | demo/sd/plot.py | fruchti/stm32f0board | 2a34fe2862dc1043e11d9e5f88738c12c327f3e3 | [
"0BSD"
] | 8 | 2019-01-27T08:03:38.000Z | 2021-06-30T09:02:38.000Z | demo/sd/plot.py | fruchti/stm32f0board | 2a34fe2862dc1043e11d9e5f88738c12c327f3e3 | [
"0BSD"
] | 2 | 2017-03-04T13:53:08.000Z | 2017-03-06T10:11:08.000Z | demo/sd/plot.py | fruchti/stm32f0board | 2a34fe2862dc1043e11d9e5f88738c12c327f3e3 | [
"0BSD"
] | 1 | 2018-05-28T18:57:14.000Z | 2018-05-28T18:57:14.000Z | #!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
data = np.genfromtxt('example-log.csv', delimiter = ',', skip_header = 4, names = ['t', 'T'])
plt.plot(data['t'] / 1e3, data['T'])
plt.ylabel('T/°C')
plt.xlabel('t/s')
plt.show()
| 21.25 | 93 | 0.639216 | #!/usr/bin/env python
import numpy as np
import matplotlib.pyplot as plt
data = np.genfromtxt('example-log.csv', delimiter = ',', skip_header = 4, names = ['t', 'T'])
plt.plot(data['t'] / 1e3, data['T'])
plt.ylabel('T/°C')
plt.xlabel('t/s')
plt.show()
| 0 | 0 | 0 |
d8cd86b3e4996af831013ff034d0799736467c80 | 2,812 | py | Python | net_worth_tracker/coin_gecko.py | sbalk/crypto-tracker | 645c5c27864d533b33331a217ac137bf5a6bb479 | [
"BSD-3-Clause"
] | null | null | null | net_worth_tracker/coin_gecko.py | sbalk/crypto-tracker | 645c5c27864d533b33331a217ac137bf5a6bb479 | [
"BSD-3-Clause"
] | null | null | null | net_worth_tracker/coin_gecko.py | sbalk/crypto-tracker | 645c5c27864d533b33331a217ac137bf5a6bb479 | [
"BSD-3-Clause"
] | null | null | null | from collections import defaultdict
from pycoingecko import CoinGeckoAPI
from net_worth_tracker.utils import euro_per_dollar
| 33.47619 | 87 | 0.578236 | from collections import defaultdict
from pycoingecko import CoinGeckoAPI
from net_worth_tracker.utils import euro_per_dollar
def get_coins(balances, cg: CoinGeckoAPI):
sym2name = { # mapping for duplicates
"auto": "Auto",
"bifi": "Beefy.Finance",
"uni": "Uniswap",
"one": "Harmon... | 2,613 | 0 | 69 |
07cf36e890f823ac4a878d94ebeeb556914a2608 | 4,109 | py | Python | mimic3benchmark/scripts/extract_episodes_from_subjects.py | kwonoh/mimic3-benchmarks | 53ed33d2ba2c077a25a463edc36bcc7088453b4d | [
"MIT"
] | null | null | null | mimic3benchmark/scripts/extract_episodes_from_subjects.py | kwonoh/mimic3-benchmarks | 53ed33d2ba2c077a25a463edc36bcc7088453b4d | [
"MIT"
] | null | null | null | mimic3benchmark/scripts/extract_episodes_from_subjects.py | kwonoh/mimic3-benchmarks | 53ed33d2ba2c077a25a463edc36bcc7088453b4d | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import print_function
import argparse
import os
import sys
from mimic3benchmark.subject import read_stays, read_diagnoses, read_events, get_events_for_stay, add_hours_elpased_to_events
from mimic3benchmark.subject import convert_events_to_timeseries, get_first_v... | 46.168539 | 166 | 0.710148 | from __future__ import absolute_import
from __future__ import print_function
import argparse
import os
import sys
from mimic3benchmark.subject import read_stays, read_diagnoses, read_events, get_events_for_stay, add_hours_elpased_to_events
from mimic3benchmark.subject import convert_events_to_timeseries, get_first_v... | 0 | 0 | 0 |
43580ac6e43b2a1dd5ab256c6f4dbfb2e0abb5e8 | 278 | py | Python | main.py | faruk-ahmad/catsleep | abb447bfaa28db92faf35b1b3aed216b514aa4b5 | [
"MIT"
] | 5 | 2020-05-16T14:48:22.000Z | 2021-07-29T00:50:36.000Z | main.py | faruk-ahmad/catsleep | abb447bfaa28db92faf35b1b3aed216b514aa4b5 | [
"MIT"
] | null | null | null | main.py | faruk-ahmad/catsleep | abb447bfaa28db92faf35b1b3aed216b514aa4b5 | [
"MIT"
] | 1 | 2021-07-29T00:50:40.000Z | 2021-07-29T00:50:40.000Z | """ Main module to start the catsleep tool """
import os
import sys
from catsleep.cat import catsleep as ct
def start_catsleep():
""" Starting point of catsleep """
catsp = ct.CatSleep()
catsp.catsleep_control()
if __name__ == '__main__':
start_catsleep()
| 16.352941 | 46 | 0.683453 | """ Main module to start the catsleep tool """
import os
import sys
from catsleep.cat import catsleep as ct
def start_catsleep():
""" Starting point of catsleep """
catsp = ct.CatSleep()
catsp.catsleep_control()
if __name__ == '__main__':
start_catsleep()
| 0 | 0 | 0 |
2b654a379369c67cf906be0dde2f0cc4a309e1ea | 14,281 | py | Python | util/sql.py | liuyq-617/TUT | 4a3782aebbd627ed5b7d1904d67ec9baa4cfa0df | [
"MIT"
] | null | null | null | util/sql.py | liuyq-617/TUT | 4a3782aebbd627ed5b7d1904d67ec9baa4cfa0df | [
"MIT"
] | null | null | null | util/sql.py | liuyq-617/TUT | 4a3782aebbd627ed5b7d1904d67ec9baa4cfa0df | [
"MIT"
] | null | null | null | ###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or u... | 41.514535 | 127 | 0.543029 | ###################################################################
# Copyright (c) 2016 by TAOS Technologies, Inc.
# All rights reserved.
#
# This file is proprietary and confidential to TAOS Technologies.
# No part of this file may be reproduced, stored, transmitted,
# disclosed or u... | 12,290 | 1,267 | 46 |
b2af9b6188dc1ce6f818c3715168e46e2d6b7c39 | 1,002 | py | Python | directory/migrations/0005_auto_20200404_1519.py | duongdo27/university-directory | 621d7b3592e158635e58dfa7051f1121618f8b82 | [
"MIT"
] | null | null | null | directory/migrations/0005_auto_20200404_1519.py | duongdo27/university-directory | 621d7b3592e158635e58dfa7051f1121618f8b82 | [
"MIT"
] | 5 | 2020-06-06T01:43:12.000Z | 2022-02-10T11:52:23.000Z | directory/migrations/0005_auto_20200404_1519.py | duongdo27/university-directory | 621d7b3592e158635e58dfa7051f1121618f8b82 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.4 on 2020-04-04 15:19
from django.db import migrations, models
import django.db.models.deletion
| 35.785714 | 116 | 0.592814 | # Generated by Django 2.2.4 on 2020-04-04 15:19
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('directory', '0004_student'),
]
operations = [
migrations.CreateModel(
name='Grade',
... | 0 | 855 | 23 |
8503e52307d007c99734efe5d4339b565b6ad9fd | 10,429 | py | Python | reviewboard/diffviewer/tests/test_forms.py | jeyaprabum/Reviewboard | fe4dc611ef961b12b6991a74faa24a22d393fb4a | [
"MIT"
] | 1 | 2019-08-20T03:39:04.000Z | 2019-08-20T03:39:04.000Z | reviewboard/diffviewer/tests/test_forms.py | jeyaprabum/Reviewboard | fe4dc611ef961b12b6991a74faa24a22d393fb4a | [
"MIT"
] | 1 | 2019-08-20T03:39:45.000Z | 2019-08-20T03:39:45.000Z | reviewboard/diffviewer/tests/test_forms.py | jeyaprabum/Reviewboard | fe4dc611ef961b12b6991a74faa24a22d393fb4a | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
import nose
from django.core.files.uploadedfile import SimpleUploadedFile
from kgb import SpyAgency
from reviewboard.admin.import_utils import has_module
from reviewboard.diffviewer.diffutils import (get_original_file,
get_patched_f... | 35.114478 | 78 | 0.55432 | from __future__ import unicode_literals
import nose
from django.core.files.uploadedfile import SimpleUploadedFile
from kgb import SpyAgency
from reviewboard.admin.import_utils import has_module
from reviewboard.diffviewer.diffutils import (get_original_file,
get_patched_f... | 129 | 0 | 31 |
9ad727ae48709f4002d805eca86cd66a89bea364 | 6,282 | py | Python | django_graphene_starter/starter/mutations.py | ngshiheng/django-graphene-starter | 81151b0dc30ed6d1d493be611e930c749044941d | [
"MIT"
] | 9 | 2021-01-14T02:53:02.000Z | 2021-12-29T21:39:37.000Z | django_graphene_starter/starter/mutations.py | ngshiheng/django-graphene-starter | 81151b0dc30ed6d1d493be611e930c749044941d | [
"MIT"
] | 20 | 2021-01-28T00:49:06.000Z | 2022-01-14T19:04:27.000Z | django_graphene_starter/starter/mutations.py | ngshiheng/django-graphene-starter | 81151b0dc30ed6d1d493be611e930c749044941d | [
"MIT"
] | 2 | 2021-10-12T19:24:52.000Z | 2021-12-29T21:39:53.000Z | from django.contrib.auth.models import Permission
from graphene import ID, ClientIDMutation, Field, ResolveInfo, String
from graphql import GraphQLError
from graphql_jwt.decorators import login_required, permission_required, staff_member_required
from graphql_relay import from_global_id
from .models import Article, Pu... | 29.492958 | 136 | 0.663642 | from django.contrib.auth.models import Permission
from graphene import ID, ClientIDMutation, Field, ResolveInfo, String
from graphql import GraphQLError
from graphql_jwt.decorators import login_required, permission_required, staff_member_required
from graphql_relay import from_global_id
from .models import Article, Pu... | 3,423 | 1,881 | 234 |
386847bd6c8e4a0ce2fe7e6744ed08e9e1fcb487 | 48,428 | py | Python | Assignment3/CheckerSuite.py | jimodayne/ppl_hcmut_assignment | 7a06d61e4cda8c76f62a1da5b93ef66d98198b80 | [
"MIT"
] | 1 | 2020-10-20T04:22:01.000Z | 2020-10-20T04:22:01.000Z | Assignment3/CheckerSuite.py | jimodayne/ppl_hcmut_assignment | 7a06d61e4cda8c76f62a1da5b93ef66d98198b80 | [
"MIT"
] | null | null | null | Assignment3/CheckerSuite.py | jimodayne/ppl_hcmut_assignment | 7a06d61e4cda8c76f62a1da5b93ef66d98198b80 | [
"MIT"
] | 1 | 2019-12-03T05:33:13.000Z | 2019-12-03T05:33:13.000Z | import unittest
from TestUtils import TestChecker
from AST import *
from StaticError import *
| 31.063502 | 175 | 0.448522 | import unittest
from TestUtils import TestChecker
from AST import *
from StaticError import *
class CheckerSuite(unittest.TestCase):
def test_redeclare_1(self):
input = """
var i: integer;
procedure main();
begin end
procedure jim();
... | 45,516 | 17 | 2,797 |
e8893e85a7915c77c1afbb8733e0a799aa458867 | 2,811 | py | Python | server.py | dipu-bd/esheba-bot | 733b3eb90839dc9d1a2c7e8b88b1d1a4b876af54 | [
"MIT"
] | 2 | 2018-02-21T11:52:58.000Z | 2018-02-21T15:18:23.000Z | server.py | dipu-bd/esheba-bot | 733b3eb90839dc9d1a2c7e8b88b1d1a4b876af54 | [
"MIT"
] | null | null | null | server.py | dipu-bd/esheba-bot | 733b3eb90839dc9d1a2c7e8b88b1d1a4b876af54 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Implements grpc modules"""
import time
import grpc
import service.service_pb2 as bot_pb
from service import service_pb2_grpc
from EshebaBot.esheba import EshebaBot
from concurrent.futures import ThreadPoolExecutor
# end class
def run_server():
'''Runs the grpc serv... | 29.904255 | 79 | 0.630736 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Implements grpc modules"""
import time
import grpc
import service.service_pb2 as bot_pb
from service import service_pb2_grpc
from EshebaBot.esheba import EshebaBot
from concurrent.futures import ThreadPoolExecutor
class BotService(service_pb2_grpc.BotServiceServicer):
... | 1,374 | 622 | 23 |
8ab328734cf4e679cd9fa239961ea9b994a53be3 | 32,017 | py | Python | jams/date2dec.py | MuellerSeb/jams_python | 1bca04557da79d8f8a4c447f5ccc517c40ab7dfc | [
"MIT"
] | 9 | 2019-06-03T03:24:16.000Z | 2021-12-03T07:14:00.000Z | jams/date2dec.py | MuellerSeb/jams_python | 1bca04557da79d8f8a4c447f5ccc517c40ab7dfc | [
"MIT"
] | 6 | 2020-03-25T21:56:59.000Z | 2021-11-08T14:58:27.000Z | jams/date2dec.py | MuellerSeb/jams_python | 1bca04557da79d8f8a4c447f5ccc517c40ab7dfc | [
"MIT"
] | 5 | 2019-10-17T12:04:33.000Z | 2021-09-28T07:45:07.000Z | #!/usr/bin/env python
"""
date2dec : Converts calendar dates into decimal dates.
This module was written by Arndt Piayda and then enhanced and
maintained by Matthias Cuntz while at Department of Computational
Hydrosystems, Helmholtz Centre for Environmental Research - UFZ,
Leipzig, Germany, and continued by Matthias C... | 43.501359 | 143 | 0.541525 | #!/usr/bin/env python
"""
date2dec : Converts calendar dates into decimal dates.
This module was written by Arndt Piayda and then enhanced and
maintained by Matthias Cuntz while at Department of Computational
Hydrosystems, Helmholtz Centre for Environmental Research - UFZ,
Leipzig, Germany, and continued by Matthias C... | 0 | 0 | 0 |
7ef29728a053d940e0509843c0cb6d3b105cdca3 | 1,533 | py | Python | euslint/test.py | knorth55/euslint | 86e7733e4c14b2a0929fc0e4ca30987fff8e5bc0 | [
"MIT"
] | 3 | 2020-01-21T10:01:18.000Z | 2021-11-17T14:00:53.000Z | euslint/test.py | knorth55/euslint | 86e7733e4c14b2a0929fc0e4ca30987fff8e5bc0 | [
"MIT"
] | null | null | null | euslint/test.py | knorth55/euslint | 86e7733e4c14b2a0929fc0e4ca30987fff8e5bc0 | [
"MIT"
] | null | null | null | from __future__ import print_function
import sys
| 30.058824 | 96 | 0.553816 | from __future__ import print_function
import sys
def test_parenthesis(result, filepath):
if result['parenthesis_open'] != result['parenthesis_close']:
print(
'{0}: parenthesis: # of open/close parenthesises doesn\'t match: {1} != {2}' # NOQA
.format(
filepath, res... | 1,387 | 0 | 92 |
3ad9502ed7ba9edef122cbc544bdebb3ece3107a | 1,067 | py | Python | timekeeper/slice.py | jmcph4/timekeeper | 1ab850739c7071ebd8a4d1a63795d014bfa9c41b | [
"MIT"
] | null | null | null | timekeeper/slice.py | jmcph4/timekeeper | 1ab850739c7071ebd8a4d1a63795d014bfa9c41b | [
"MIT"
] | 5 | 2017-07-19T10:09:32.000Z | 2017-07-30T03:32:56.000Z | timekeeper/slice.py | jmcph4/timekeeper | 1ab850739c7071ebd8a4d1a63795d014bfa9c41b | [
"MIT"
] | null | null | null | from datetime import datetime
MINUTES_IN_DAY = 60 * 24
SECONDS_IN_MINUTE = 60
class Slice(object):
"""
A period of time with a start and an end
"""
DT_FMT = "%Y-%m-%d %H:%M"
@property
@property
@property
@property
| 20.921569 | 83 | 0.575445 | from datetime import datetime
MINUTES_IN_DAY = 60 * 24
SECONDS_IN_MINUTE = 60
class Slice(object):
"""
A period of time with a start and an end
"""
DT_FMT = "%Y-%m-%d %H:%M"
def __init__(self, start, end, category, description):
self._start = start
self._end = end
self... | 626 | 0 | 189 |
07950f4fe308fa50f028e08ebc260033356e3745 | 524 | py | Python | IB_Api/ibapi/enum_implem.py | candypantsnola/QTS_Research | d62ecb1ecc5d5429f58b9f566cdd052e491bae28 | [
"MIT"
] | 20 | 2017-03-05T22:15:29.000Z | 2022-02-18T11:45:50.000Z | IB_Api/ibapi/enum_implem.py | candypantsnola/QTS_Research | d62ecb1ecc5d5429f58b9f566cdd052e491bae28 | [
"MIT"
] | null | null | null | IB_Api/ibapi/enum_implem.py | candypantsnola/QTS_Research | d62ecb1ecc5d5429f58b9f566cdd052e491bae28 | [
"MIT"
] | 14 | 2017-03-05T22:49:04.000Z | 2022-01-02T21:34:19.000Z | """
Copyright (C) 2016 Interactive Brokers LLC. All rights reserved. This code is
subject to the terms and conditions of the IB API Non-Commercial License or the
IB API Commercial License, as applicable.
"""
"""
Simple enum implementation
"""
| 21.833333 | 79 | 0.639313 | """
Copyright (C) 2016 Interactive Brokers LLC. All rights reserved. This code is
subject to the terms and conditions of the IB API Non-Commercial License or the
IB API Commercial License, as applicable.
"""
"""
Simple enum implementation
"""
class Enum:
def __init__(self, *args):
self.idx2name ... | 202 | -10 | 76 |
53a6bc66369df992bd355662eb62da394d93b5c7 | 7,243 | py | Python | scripts/geoCorrection.py | young-oct/Cochlear_Implant | e9b1c10a2596209030c9b88537109e3e42a549b5 | [
"MIT"
] | null | null | null | scripts/geoCorrection.py | young-oct/Cochlear_Implant | e9b1c10a2596209030c9b88537109e3e42a549b5 | [
"MIT"
] | null | null | null | scripts/geoCorrection.py | young-oct/Cochlear_Implant | e9b1c10a2596209030c9b88537109e3e42a549b5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# @Time : 2021-12-03 1:12 p.m.
# @Author : young wang
# @FileName: geoCorrection.py
# @Software: PyCharm
import pydicom
import numpy as np
from OssiviewBufferReader import OssiviewBufferReader
from os.path import join, isfile
from pydicom.uid import generate_uid
import os
from matplotlib i... | 34.327014 | 110 | 0.581389 | # -*- coding: utf-8 -*-
# @Time : 2021-12-03 1:12 p.m.
# @Author : young wang
# @FileName: geoCorrection.py
# @Software: PyCharm
import pydicom
import numpy as np
from OssiviewBufferReader import OssiviewBufferReader
from os.path import join, isfile
from pydicom.uid import generate_uid
import os
from matplotlib i... | 229 | 0 | 23 |
46229f227661a2e0ee158752515d8a125dc96e9c | 6,908 | py | Python | nicos/services/daemon/pyctl.py | ess-dmsc/nicos | 755d61d403ff7123f804c45fc80c7ff4d762993b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 1 | 2021-03-26T10:30:45.000Z | 2021-03-26T10:30:45.000Z | nicos/services/daemon/pyctl.py | ess-dmsc/nicos | 755d61d403ff7123f804c45fc80c7ff4d762993b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 91 | 2020-08-18T09:20:26.000Z | 2022-02-01T11:07:14.000Z | nicos/services/daemon/pyctl.py | ess-dmsc/nicos | 755d61d403ff7123f804c45fc80c7ff4d762993b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 3 | 2020-08-04T18:35:05.000Z | 2021-04-16T11:22:08.000Z | # -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... | 40.635294 | 80 | 0.676173 | # -*- coding: utf-8 -*-
# *****************************************************************************
# NICOS, the Networked Instrument Control System of the MLZ
# Copyright (c) 2009-2021 by the NICOS contributors (see AUTHORS)
#
# This program is free software; you can redistribute it and/or modify it under
# the t... | 682 | -3 | 84 |
be973d364076cfe16697f8ef2e65e048455a24ad | 662 | py | Python | scripts/features/vectorize_glove.py | jfajkowski/stock-market-forecasting | 6a0ae5a0cfe39263a0f448f062cd01283281a0d8 | [
"MIT"
] | null | null | null | scripts/features/vectorize_glove.py | jfajkowski/stock-market-forecasting | 6a0ae5a0cfe39263a0f448f062cd01283281a0d8 | [
"MIT"
] | null | null | null | scripts/features/vectorize_glove.py | jfajkowski/stock-market-forecasting | 6a0ae5a0cfe39263a0f448f062cd01283281a0d8 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import spacy
# %% Load spaCy model
nlp = spacy.load("en_core_web_lg")
# %% Load cleaned data
df = pd.read_csv('./data/interim/Corpus_Cleaned.csv')
# %% Extract document vectors
df['Vector'] = df.loc[:, 'Top1':'Top25'].apply(lambda x: nlp(' '.join([str(s) for s in x])).vector, a... | 33.1 | 107 | 0.681269 | import numpy as np
import pandas as pd
import spacy
# %% Load spaCy model
nlp = spacy.load("en_core_web_lg")
# %% Load cleaned data
df = pd.read_csv('./data/interim/Corpus_Cleaned.csv')
# %% Extract document vectors
df['Vector'] = df.loc[:, 'Top1':'Top25'].apply(lambda x: nlp(' '.join([str(s) for s in x])).vector, a... | 0 | 0 | 0 |
4af3d4bb1190be6fbe80860108d9b52cb30ba440 | 9,165 | py | Python | cogdl/models/nn/pyg_deepergcn.py | xssstory/cogdl | ae8de495c365993f19f04774f083960fd282c2a3 | [
"MIT"
] | 1 | 2021-03-24T10:37:20.000Z | 2021-03-24T10:37:20.000Z | cogdl/models/nn/pyg_deepergcn.py | xssstory/cogdl | ae8de495c365993f19f04774f083960fd282c2a3 | [
"MIT"
] | null | null | null | cogdl/models/nn/pyg_deepergcn.py | xssstory/cogdl | ae8de495c365993f19f04774f083960fd282c2a3 | [
"MIT"
] | null | null | null | import numpy as np
import scipy.sparse as sparse
from typing import Any
from torch.utils.checkpoint import checkpoint
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch_scatter import scatter_max
from .. import register_model, BaseModel
from cogdl.utils import mul_edge_softmax, spmm, get_a... | 33.571429 | 128 | 0.543044 | import numpy as np
import scipy.sparse as sparse
from typing import Any
from torch.utils.checkpoint import checkpoint
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch_scatter import scatter_max
from .. import register_model, BaseModel
from cogdl.utils import mul_edge_softmax, spmm, get_a... | 7,755 | 251 | 178 |
1c0321f9d7d668c68212cb3de8330ca46190e2c0 | 9,523 | py | Python | qiskit/providers/ibmq/api/rest/runtime.py | yoshida-ryuhei/qiskit-ibmq-provider | 2ef10178dcd242dd38971e43749dcc49b8e9dd0d | [
"Apache-2.0"
] | null | null | null | qiskit/providers/ibmq/api/rest/runtime.py | yoshida-ryuhei/qiskit-ibmq-provider | 2ef10178dcd242dd38971e43749dcc49b8e9dd0d | [
"Apache-2.0"
] | null | null | null | qiskit/providers/ibmq/api/rest/runtime.py | yoshida-ryuhei/qiskit-ibmq-provider | 2ef10178dcd242dd38971e43749dcc49b8e9dd0d | [
"Apache-2.0"
] | 1 | 2022-03-24T04:59:34.000Z | 2022-03-24T04:59:34.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 28.426866 | 93 | 0.543001 | # This code is part of Qiskit.
#
# (C) Copyright IBM 2020.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivative wo... | 0 | 0 | 0 |
e25f96dcc37af7a60c2acf75e4cab66c40c2fd43 | 13,214 | py | Python | Scripts/simulation/sims/outfits/outfit_picker_interactions.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | Scripts/simulation/sims/outfits/outfit_picker_interactions.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | Scripts/simulation/sims/outfits/outfit_picker_interactions.py | velocist/TS4CheatsInfo | b59ea7e5f4bd01d3b3bd7603843d525a9c179867 | [
"Apache-2.0"
] | null | null | null | # uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\sims\outfits\outfit_picker_interactions.py
# Compiled at: 2017-06-14 00:32:50
# Size of source mod 2... | 56.712446 | 314 | 0.673831 | # uncompyle6 version 3.7.4
# Python bytecode 3.7 (3394)
# Decompiled from: Python 3.7.9 (tags/v3.7.9:13c94747c7, Aug 17 2020, 18:58:18) [MSC v.1900 64 bit (AMD64)]
# Embedded file name: T:\InGame\Gameplay\Scripts\Server\sims\outfits\outfit_picker_interactions.py
# Compiled at: 2017-06-14 00:32:50
# Size of source mod 2... | 7,011 | 4,963 | 23 |
6d6d856dd9f319c9226bfbfb4269905818c3986e | 3,444 | py | Python | EngineUnit/SchemePath.py | danieldanan1/OpenAPISec-Validator | f1e510547a17b43aa58772b096bee0f28cb0c342 | [
"MIT"
] | 2 | 2022-03-03T13:56:05.000Z | 2022-03-20T15:28:33.000Z | EngineUnit/SchemePath.py | danieldanan1/OpenAPISec-Validator | f1e510547a17b43aa58772b096bee0f28cb0c342 | [
"MIT"
] | null | null | null | EngineUnit/SchemePath.py | danieldanan1/OpenAPISec-Validator | f1e510547a17b43aa58772b096bee0f28cb0c342 | [
"MIT"
] | null | null | null | class PathData:
"""
data structure contain open api scheme (sub scheme) and the variable define in the parents of the current scheme
"""
def __init__(self, scheme: dict, args: dict):
"""
:param scheme: open api scheme (sub scheme)
:param args: the variable define in the parents o... | 36.638298 | 116 | 0.555459 | class PathData:
"""
data structure contain open api scheme (sub scheme) and the variable define in the parents of the current scheme
"""
def __init__(self, scheme: dict, args: dict):
"""
:param scheme: open api scheme (sub scheme)
:param args: the variable define in the parents o... | 177 | 0 | 53 |
175fdff3f17d392973721d815f9bc9ba4d353264 | 16,088 | py | Python | pic2vec/feature_preprocessing.py | datarobot/pic2vec | 2dae5093d10414456ca2210c78dc5c3392b70c8e | [
"BSD-3-Clause"
] | 33 | 2017-08-10T01:12:02.000Z | 2021-06-05T01:49:39.000Z | pic2vec/feature_preprocessing.py | datarobot/pic2vec | 2dae5093d10414456ca2210c78dc5c3392b70c8e | [
"BSD-3-Clause"
] | 22 | 2017-07-24T15:04:29.000Z | 2021-11-15T17:46:59.000Z | pic2vec/feature_preprocessing.py | datarobot/pic2vec | 2dae5093d10414456ca2210c78dc5c3392b70c8e | [
"BSD-3-Clause"
] | 15 | 2017-08-10T15:46:00.000Z | 2021-01-21T08:12:15.000Z | """
This file deals with preprocessing the images for the featurizer.
It gives the user 3 options:
1. Upload a CSV with URL pointers.
2. Upload an image directory with no CSV. The featurizer will generate a CSV automatically.
3. Upload a CSV with an image directory. The CSV will contain pointers to image in the direct... | 33.586639 | 99 | 0.62587 | """
This file deals with preprocessing the images for the featurizer.
It gives the user 3 options:
1. Upload a CSV with URL pointers.
2. Upload an image directory with no CSV. The featurizer will generate a CSV automatically.
3. Upload a CSV with an image directory. The CSV will contain pointers to image in the direct... | 237 | 0 | 23 |
267a4254cefb9bea9fc8ab3f922403e312ff92d3 | 3,592 | py | Python | src/limecc/rule.py | avakar/limecc | 8f597c4ef48fed9f607451abc72531ea92965371 | [
"BSL-1.0"
] | 2 | 2020-12-04T13:21:44.000Z | 2021-03-18T05:17:37.000Z | src/limecc/rule.py | avakar/limecc | 8f597c4ef48fed9f607451abc72531ea92965371 | [
"BSL-1.0"
] | null | null | null | src/limecc/rule.py | avakar/limecc | 8f597c4ef48fed9f607451abc72531ea92965371 | [
"BSL-1.0"
] | 1 | 2017-12-17T23:25:56.000Z | 2017-12-17T23:25:56.000Z | class Rule:
"""Represents a single production rule of a grammar.
Rules are usually written using some sort of BNF-like notation,
for example, 'list ::= list item' would be a valid rule. A rule
always has a single non-terminal symbol on the left and a list
(possibly empty) of arbitrary symbols o... | 33.886792 | 94 | 0.550947 | class Rule:
"""Represents a single production rule of a grammar.
Rules are usually written using some sort of BNF-like notation,
for example, 'list ::= list item' would be a valid rule. A rule
always has a single non-terminal symbol on the left and a list
(possibly empty) of arbitrary symbols o... | 154 | 0 | 54 |
ddb21650c29931a8a6f99ec0513a50ecae5bdc94 | 4,545 | py | Python | tidalclassifier/general_metrics/performance_by_class.py | RustyPanda/tidal-features-classifier | 32e1aa0c074528ed04419d596c2014f78448e11b | [
"MIT"
] | 1 | 2021-05-01T06:08:53.000Z | 2021-05-01T06:08:53.000Z | tidalclassifier/general_metrics/performance_by_class.py | RustyPanda/tidal-features-classifier | 32e1aa0c074528ed04419d596c2014f78448e11b | [
"MIT"
] | null | null | null | tidalclassifier/general_metrics/performance_by_class.py | RustyPanda/tidal-features-classifier | 32e1aa0c074528ed04419d596c2014f78448e11b | [
"MIT"
] | null | null | null | """
Use previous output catalogs to investigate correct and incorrect images
"""
import logging
import os
import json
import pandas as pd
import numpy as np
from astropy.io import fits
from PIL import Image
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import seaborn as sns
from tidalclassi... | 36.36 | 120 | 0.683168 | """
Use previous output catalogs to investigate correct and incorrect images
"""
import logging
import os
import json
import pandas as pd
import numpy as np
from astropy.io import fits
from PIL import Image
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import seaborn as sns
from tidalclassi... | 2,413 | 0 | 69 |
8f43736ec96add1b000086e3ab3c9121c0835928 | 3,867 | py | Python | Final Project/dataProcessor.py | DesirY/Machine-Learning-Library | b4ccb8182b0b748ac2ce9b669bcc0a9386829511 | [
"OLDAP-2.5",
"OLDAP-2.4"
] | null | null | null | Final Project/dataProcessor.py | DesirY/Machine-Learning-Library | b4ccb8182b0b748ac2ce9b669bcc0a9386829511 | [
"OLDAP-2.5",
"OLDAP-2.4"
] | null | null | null | Final Project/dataProcessor.py | DesirY/Machine-Learning-Library | b4ccb8182b0b748ac2ce9b669bcc0a9386829511 | [
"OLDAP-2.5",
"OLDAP-2.4"
] | null | null | null | '''
1. complete the missing data
2. convert the continous feature into discrete feature
3. one-hot encondes the discrete feature generated by the continous feature
4. one-hot encode all discrete feature
'''
import csv
import numpy as np
from numpy import fabs, random
from numpy.lib.function_base import percentile, sor... | 33.921053 | 103 | 0.603051 | '''
1. complete the missing data
2. convert the continous feature into discrete feature
3. one-hot encondes the discrete feature generated by the continous feature
4. one-hot encode all discrete feature
'''
import csv
import numpy as np
from numpy import fabs, random
from numpy.lib.function_base import percentile, sor... | 2,628 | -2 | 199 |
39c497d9a21f5def2807346f1891489cbba240ec | 5,096 | py | Python | regeng.py | tonisidneimc/Regex-Engine | df3b485c27a54a530ed4c85b7911a1779567d655 | [
"MIT"
] | 1 | 2021-11-15T12:03:15.000Z | 2021-11-15T12:03:15.000Z | regeng.py | tonisidneimc/Regex-Engine | df3b485c27a54a530ed4c85b7911a1779567d655 | [
"MIT"
] | null | null | null | regeng.py | tonisidneimc/Regex-Engine | df3b485c27a54a530ed4c85b7911a1779567d655 | [
"MIT"
] | null | null | null | import sys
#operator precedence table
Precedence = {
'|' : 0, #NFA Union Operator
'.' : 1, #NFA Concat Operator
'?' : 2, #NFA zero or one Operator
'*' : 2, #NFA Closure Operator
'+' : 2 #NFA one or more Operator
}
| 20.548387 | 68 | 0.631279 | import sys
def makeRange(start, end):
out = ['(']
for s in range(ord(start), ord(end)) :
out.append(chr(s))
out.append('|')
out.append(end)
return out
def preProcess(expr : str) -> list:
#add . (NFA Concat operator)
#add range
out = []
i = 0
while i < len(expr) :
if expr[i] == '[':
... | 4,387 | -26 | 512 |
9d750eb0d05a0f3fdcf2b80586d947184b6a211f | 1,953 | py | Python | bvid2aid/bvid2aid.py | davidli218/Bilibili-Convert-AV-BV | 24995a8e4facfa021ad47aacf56ab5400a7a4d52 | [
"MIT"
] | 2 | 2020-03-29T13:43:04.000Z | 2020-03-29T13:43:06.000Z | bvid2aid/bvid2aid.py | davidli218/Bilibili-Convert-AV-BV | 24995a8e4facfa021ad47aacf56ab5400a7a4d52 | [
"MIT"
] | null | null | null | bvid2aid/bvid2aid.py | davidli218/Bilibili-Convert-AV-BV | 24995a8e4facfa021ad47aacf56ab5400a7a4d52 | [
"MIT"
] | null | null | null | import converter
import tkinter as tk
from tkinter import messagebox as tkm
import tkinter.font as tkf
if __name__ == '__main__':
# 创建主窗口
window = tk.Tk()
window.title('B站 AV/BV号转换器')
window.geometry('450x300')
window.iconbitmap('BVid2Aid.ico')
window.resizable(width=False, height=False)
... | 36.166667 | 98 | 0.646185 | import converter
import tkinter as tk
from tkinter import messagebox as tkm
import tkinter.font as tkf
if __name__ == '__main__':
def convert():
var_result.set('')
input_id = var_input.get()
if input_id[:2].upper() == 'AV' and len(input_id) >= 3 and input_id[2:].isdigit():
var_r... | 441 | 0 | 26 |
4260ae3291140cae1b6a76bad3a86ec24370aec1 | 2,371 | py | Python | usecases/screen/databuilder.py | aboulay/goyave.py | ce46f582d87a9fc5a455e7f5e1b0103a4571f157 | [
"MIT"
] | null | null | null | usecases/screen/databuilder.py | aboulay/goyave.py | ce46f582d87a9fc5a455e7f5e1b0103a4571f157 | [
"MIT"
] | null | null | null | usecases/screen/databuilder.py | aboulay/goyave.py | ce46f582d87a9fc5a455e7f5e1b0103a4571f157 | [
"MIT"
] | null | null | null | import requests
from usecases.screen.exceptions import UnknownResponseFormat
STATUS_OK = "OK"
STATUS_FAILED = "KO"
INFORMATION_MISSING = "N/A"
| 33.394366 | 79 | 0.574019 | import requests
from usecases.screen.exceptions import UnknownResponseFormat
STATUS_OK = "OK"
STATUS_FAILED = "KO"
INFORMATION_MISSING = "N/A"
class ScreenDataBuilder():
def build(self, screen):
response = self.call_endpoint(screen.get_url(), screen.get_format())
if response["status_code"] != 20... | 2,036 | 5 | 184 |
443d7f2ae6abbd0de6e079c5c5992d6fc450dc36 | 20,808 | py | Python | dataloaders/jets_loader.py | maamdaad/Set2GraphPaper | 883a87f41192e926b45916542cb3c7e24e0be20b | [
"Apache-2.0"
] | null | null | null | dataloaders/jets_loader.py | maamdaad/Set2GraphPaper | 883a87f41192e926b45916542cb3c7e24e0be20b | [
"Apache-2.0"
] | null | null | null | dataloaders/jets_loader.py | maamdaad/Set2GraphPaper | 883a87f41192e926b45916542cb3c7e24e0be20b | [
"Apache-2.0"
] | null | null | null | import os
import uproot3 as uproot
import torch
import torch.nn as nn
import numpy as np
from torch.utils.data import Dataset, DataLoader, Sampler
from datetime import datetime
from tqdm import tqdm
data_dir = 'data/'
node_features_list = ['trk_d0', 'trk_z0', 'trk_phi', 'trk_ctgtheta', 'trk_pt', 'trk_charge']
jet_feat... | 42.292683 | 279 | 0.600634 | import os
import uproot3 as uproot
import torch
import torch.nn as nn
import numpy as np
from torch.utils.data import Dataset, DataLoader, Sampler
from datetime import datetime
from tqdm import tqdm
data_dir = 'data/'
node_features_list = ['trk_d0', 'trk_z0', 'trk_phi', 'trk_ctgtheta', 'trk_pt', 'trk_charge']
jet_feat... | 12,817 | 7,132 | 138 |
59171f89e75d587b6e8d21be1950eeee43eaff00 | 3,082 | py | Python | scripts/training/mlp_rxn_classification_schneider.py | reymond-group/drfp | 921f476f9c4a37d1bce08ae6de5abb1b1589dbbb | [
"MIT"
] | 22 | 2021-07-06T15:02:16.000Z | 2022-02-28T05:36:34.000Z | scripts/training/mlp_rxn_classification_schneider.py | reymond-group/drfp | 921f476f9c4a37d1bce08ae6de5abb1b1589dbbb | [
"MIT"
] | 3 | 2022-01-07T21:17:04.000Z | 2022-02-13T17:07:23.000Z | scripts/training/mlp_rxn_classification_schneider.py | reymond-group/drfp | 921f476f9c4a37d1bce08ae6de5abb1b1589dbbb | [
"MIT"
] | 2 | 2021-12-30T15:33:32.000Z | 2022-02-15T18:28:25.000Z | # Adapted from: https://github.com/rxn4chemistry/rxnfp/blob/master/nbs/10_results_uspto_1k_tpl.ipynb
import pickle
import click
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from sklearn.neural_network import MLPClassifier
import numpy as np
from pathlib import Path
from typi... | 29.075472 | 100 | 0.680727 | # Adapted from: https://github.com/rxn4chemistry/rxnfp/blob/master/nbs/10_results_uspto_1k_tpl.ipynb
import pickle
import click
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
from sklearn.neural_network import MLPClassifier
import numpy as np
from pathlib import Path
from typi... | 1,351 | 0 | 22 |
c33b788d599ba547e10262fcdde3ade831b5af74 | 108 | py | Python | iiifAPI/urls.py | utlib/utl_iiif_api | e2d77ad5a677487e205b840cc800af46b4697eab | [
"Apache-2.0"
] | 4 | 2019-12-08T18:39:37.000Z | 2021-11-09T19:35:44.000Z | iiifAPI/urls.py | utlib/utl_iiif_api | e2d77ad5a677487e205b840cc800af46b4697eab | [
"Apache-2.0"
] | 2 | 2020-06-05T16:45:31.000Z | 2021-06-10T17:30:00.000Z | iiifAPI/urls.py | utlib/utl_iiif_api | e2d77ad5a677487e205b840cc800af46b4697eab | [
"Apache-2.0"
] | 1 | 2019-12-08T18:45:52.000Z | 2019-12-08T18:45:52.000Z | from django.conf.urls import url, include
urlpatterns = [
url(r'', include("iiif_api_services.urls")),
]
| 15.428571 | 45 | 0.712963 | from django.conf.urls import url, include
urlpatterns = [
url(r'', include("iiif_api_services.urls")),
]
| 0 | 0 | 0 |
63af9ed62f00431048a636068510051e35630850 | 11,355 | py | Python | satsearch/scene.py | moegoldberg/sat-search | bb41641423b493e959cca60939b93cd5a2e7e06a | [
"MIT"
] | null | null | null | satsearch/scene.py | moegoldberg/sat-search | bb41641423b493e959cca60939b93cd5a2e7e06a | [
"MIT"
] | null | null | null | satsearch/scene.py | moegoldberg/sat-search | bb41641423b493e959cca60939b93cd5a2e7e06a | [
"MIT"
] | null | null | null | import os
import logging
import requests
import json
from string import Formatter, Template
from datetime import datetime
import satsearch.utils as utils
import satsearch.config as config
import traceback
logger = logging.getLogger(__name__)
class Scenes(object):
""" A collection of Scene objects """
def... | 33.694362 | 103 | 0.547952 | import os
import logging
import requests
import json
from string import Formatter, Template
from datetime import datetime
import satsearch.utils as utils
import satsearch.config as config
import traceback
logger = logging.getLogger(__name__)
class SatSceneError(Exception):
pass
class Scene(object):
def _... | 1,514 | 5,675 | 189 |
345139fc335ea7fad4a568bf6162b0f24dcce035 | 2,093 | py | Python | task/AddFactoryConfiguration.py | wookiee2187/vc3-login-pod | 3c0f5490c094bf0b4587a743efac68d722ea5ee2 | [
"MIT"
] | 1 | 2019-07-17T19:01:34.000Z | 2019-07-17T19:01:34.000Z | task/AddFactoryConfiguration.py | wookiee2187/vc3-login-pod | 3c0f5490c094bf0b4587a743efac68d722ea5ee2 | [
"MIT"
] | null | null | null | task/AddFactoryConfiguration.py | wookiee2187/vc3-login-pod | 3c0f5490c094bf0b4587a743efac68d722ea5ee2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import json
from vc3master.task import VC3Task
| 25.839506 | 68 | 0.491161 | #!/usr/bin/env python
import json
from vc3master.task import VC3Task
class AddFactoryConfiguration(VC3Task):
def runtask(self):
self.log.info("Running task %s" % self.section)
self.infoclient = self.parent.parent.infoclient
doc = self._getdoc()
doc = self._updatedoc(doc)
... | 726 | 1,262 | 23 |
71c1f81f19e00aca998ec5ad79c6a68983c3cece | 787 | py | Python | app/celery_worker.py | wlsouza/fastapi-todolist | c7c75bd73754dde8687e1486a80c77d903e33b31 | [
"MIT"
] | 4 | 2021-09-09T00:20:21.000Z | 2022-01-12T09:08:07.000Z | app/celery_worker.py | wlsouza/fastapi-todolist | c7c75bd73754dde8687e1486a80c77d903e33b31 | [
"MIT"
] | null | null | null | app/celery_worker.py | wlsouza/fastapi-todolist | c7c75bd73754dde8687e1486a80c77d903e33b31 | [
"MIT"
] | null | null | null | import asyncio
from fastapi_mail import FastMail, MessageSchema
from app.core.celery_app import celery_app
from app.core.config import settings
@celery_app.task
| 27.137931 | 73 | 0.695044 | import asyncio
from fastapi_mail import FastMail, MessageSchema
from app.core.celery_app import celery_app
from app.core.config import settings
@celery_app.task
def send_verification_email(email_to: str, first_name: str, token: str):
# TODO: insert link to frontend page resolve it.
verification_link = "htt... | 600 | 0 | 22 |
260c58da8bb16fbbd43ee64ea6de2696eba50546 | 178 | py | Python | LeetCode/1108. Defanging an IP Address/solution.py | InnoFang/algorithms | 01847903f757722b6c877e1631e5413b9376c82e | [
"Apache-2.0"
] | null | null | null | LeetCode/1108. Defanging an IP Address/solution.py | InnoFang/algorithms | 01847903f757722b6c877e1631e5413b9376c82e | [
"Apache-2.0"
] | null | null | null | LeetCode/1108. Defanging an IP Address/solution.py | InnoFang/algorithms | 01847903f757722b6c877e1631e5413b9376c82e | [
"Apache-2.0"
] | null | null | null | """
62 / 62 test cases passed.
Runtime: 32 ms
Memory Usage: 15 MB
"""
| 19.777778 | 48 | 0.617978 | """
62 / 62 test cases passed.
Runtime: 32 ms
Memory Usage: 15 MB
"""
class Solution:
def defangIPaddr(self, address: str) -> str:
return address.replace('.', '[.]')
| 66 | -6 | 48 |
9d1ed8633a3787aa071f7fd2e1b64d4b1c3e54b5 | 276 | py | Python | PyMOTW/source/gettext/gettext_app_builtin.py | axetang/AxePython | 3b517fa3123ce2e939680ad1ae14f7e602d446a6 | [
"Apache-2.0"
] | 1 | 2019-01-04T05:47:50.000Z | 2019-01-04T05:47:50.000Z | PyMOTW/source/gettext/gettext_app_builtin.py | axetang/AxePython | 3b517fa3123ce2e939680ad1ae14f7e602d446a6 | [
"Apache-2.0"
] | 1 | 2020-07-18T03:52:03.000Z | 2020-07-18T04:18:01.000Z | PyMOTW/source/gettext/gettext_app_builtin.py | axetang/AxePython | 3b517fa3123ce2e939680ad1ae14f7e602d446a6 | [
"Apache-2.0"
] | 2 | 2021-03-06T04:28:32.000Z | 2021-03-06T04:59:17.000Z | #!/usr/bin/env python3
# encoding: utf-8
#
# Copyright (c) 2009 Doug Hellmann All rights reserved.
#
"""
"""
# flake8: noqa
#end_pymotw_header
import gettext
gettext.install(
'example',
'locale',
names=['ngettext'],
)
print(_('This message is in the script.'))
| 13.8 | 55 | 0.655797 | #!/usr/bin/env python3
# encoding: utf-8
#
# Copyright (c) 2009 Doug Hellmann All rights reserved.
#
"""
"""
# flake8: noqa
#end_pymotw_header
import gettext
gettext.install(
'example',
'locale',
names=['ngettext'],
)
print(_('This message is in the script.'))
| 0 | 0 | 0 |
9106eea7d831de9c1bd56257c4526b6b5172cb43 | 1,153 | py | Python | setup.py | antoan-angelov/SPACESHIP | 80c5ebf270446433cfbbacc76a6668bad1755cd0 | [
"MIT"
] | 13 | 2015-07-13T22:18:20.000Z | 2017-10-02T20:57:58.000Z | setup.py | antoan-angelov/spaceship | 80c5ebf270446433cfbbacc76a6668bad1755cd0 | [
"MIT"
] | null | null | null | setup.py | antoan-angelov/spaceship | 80c5ebf270446433cfbbacc76a6668bad1755cd0 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(
name="spaceship",
version="0.8.2",
packages=find_packages(),
install_requires=[
'netifaces'
],
url = 'https://github.com/antoan-angelov/spaceship/',
author="Antoan Angelov",
author_email="antoan.angelov+spaceship@gmail.com",
... | 33.911765 | 98 | 0.613183 | from setuptools import setup, find_packages
setup(
name="spaceship",
version="0.8.2",
packages=find_packages(),
install_requires=[
'netifaces'
],
url = 'https://github.com/antoan-angelov/spaceship/',
author="Antoan Angelov",
author_email="antoan.angelov+spaceship@gmail.com",
... | 0 | 0 | 0 |
3737a05c404ea61b4bb08bc6acbc66a7b4fb5a76 | 5,324 | py | Python | 06/hack_assembler.py | linstantnoodles/nand2tetris-solutions | 96f59ca1b444b434decb74d13621bb93b4384d00 | [
"MIT"
] | 1 | 2021-07-12T16:29:05.000Z | 2021-07-12T16:29:05.000Z | 06/hack_assembler.py | linstantnoodles/nand2tetris-solutions | 96f59ca1b444b434decb74d13621bb93b4384d00 | [
"MIT"
] | null | null | null | 06/hack_assembler.py | linstantnoodles/nand2tetris-solutions | 96f59ca1b444b434decb74d13621bb93b4384d00 | [
"MIT"
] | null | null | null | # simplest case: takes a single line and convert it to binary
import sys
import re
# 15 bit addresses
predefined_symbols = {
'THAT': '000000000000100',
'R14': '000000000001110',
'R15': '000000000001111',
'R12': '000000000001100',
'R13': '000000000001101',
'R10': '000000000001010',
'R11': '0... | 28.169312 | 104 | 0.577761 | # simplest case: takes a single line and convert it to binary
import sys
import re
# 15 bit addresses
predefined_symbols = {
'THAT': '000000000000100',
'R14': '000000000001110',
'R15': '000000000001111',
'R12': '000000000001100',
'R13': '000000000001101',
'R10': '000000000001010',
'R11': '0... | 3,015 | 0 | 302 |
93fe983b799470740412429819f66363e9417974 | 303 | py | Python | exercise/package2_test.py | progzc/PythonDemo | 0515fee3511bc132bfddf480014f61ce52080616 | [
"Apache-2.0"
] | null | null | null | exercise/package2_test.py | progzc/PythonDemo | 0515fee3511bc132bfddf480014f61ce52080616 | [
"Apache-2.0"
] | null | null | null | exercise/package2_test.py | progzc/PythonDemo | 0515fee3511bc132bfddf480014f61ce52080616 | [
"Apache-2.0"
] | null | null | null | # 使用import方式进行导入时,只能跟包名或模块名称
# import 包名
import calc2
# import 模块名
import package.module_a
# import 包名+取别名
import package.module_b as mb
# from 包名 import 模块名
# 使用from...import方式可以导入包、模块、函数、变量
from package import module_a
print(package.module_a.a)
print(mb.b)
print(module_a.a)
print(calc2.add(10, 20))
| 18.9375 | 33 | 0.775578 | # 使用import方式进行导入时,只能跟包名或模块名称
# import 包名
import calc2
# import 模块名
import package.module_a
# import 包名+取别名
import package.module_b as mb
# from 包名 import 模块名
# 使用from...import方式可以导入包、模块、函数、变量
from package import module_a
print(package.module_a.a)
print(mb.b)
print(module_a.a)
print(calc2.add(10, 20))
| 0 | 0 | 0 |
58a8e152d6def37f3d5d7b69d24dd706fd0f3bf3 | 883 | py | Python | backend/src/main/middleware/query_debugger.py | baealex/Medium-Clone-in-Django | 1f388ca9d75c05ce3100dfb7ad58ef751c964d19 | [
"MIT"
] | null | null | null | backend/src/main/middleware/query_debugger.py | baealex/Medium-Clone-in-Django | 1f388ca9d75c05ce3100dfb7ad58ef751c964d19 | [
"MIT"
] | null | null | null | backend/src/main/middleware/query_debugger.py | baealex/Medium-Clone-in-Django | 1f388ca9d75c05ce3100dfb7ad58ef751c964d19 | [
"MIT"
] | null | null | null | import functools
import time
from django.db import connection, reset_queries
from django.utils.deprecation import MiddlewareMixin
| 40.136364 | 95 | 0.588901 | import functools
import time
from django.db import connection, reset_queries
from django.utils.deprecation import MiddlewareMixin
class QueryDebugger(MiddlewareMixin):
def process_request(self, request):
reset_queries()
self.number_of_start_queries = len(connection.queries)
self.start = ti... | 660 | 16 | 76 |
4062cdd9c6f4598150444c52457ccc4c69d36780 | 6,261 | py | Python | numba_dppy/ocl/ocldecl.py | Rubtsowa/numba-dppy | 20f9825b144913ebe1f7635c785b334f3743c4cb | [
"Apache-2.0"
] | null | null | null | numba_dppy/ocl/ocldecl.py | Rubtsowa/numba-dppy | 20f9825b144913ebe1f7635c785b334f3743c4cb | [
"Apache-2.0"
] | null | null | null | numba_dppy/ocl/ocldecl.py | Rubtsowa/numba-dppy | 20f9825b144913ebe1f7635c785b334f3743c4cb | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 26.871245 | 87 | 0.679125 | # Copyright 2021 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 2,255 | 1,773 | 352 |
d2ef915d3c44cbcbe44de23fb202e1982762712e | 2,234 | py | Python | setup.py | bfemery-sandia/pvOps | fcdf47443041b3deb70f675481a70e7cf0b3dc93 | [
"BSD-3-Clause"
] | 2 | 2021-04-21T23:42:36.000Z | 2021-05-06T16:18:48.000Z | setup.py | bfemery-sandia/pvOps | fcdf47443041b3deb70f675481a70e7cf0b3dc93 | [
"BSD-3-Clause"
] | 13 | 2021-03-16T17:52:31.000Z | 2021-05-20T21:19:56.000Z | setup.py | bfemery-sandia/pvOps | fcdf47443041b3deb70f675481a70e7cf0b3dc93 | [
"BSD-3-Clause"
] | 4 | 2021-05-26T13:49:21.000Z | 2021-12-17T16:35:06.000Z | #!/usr/bin/env python
try:
from setuptools import setup, find_packages
except ImportError:
raise RuntimeError('setuptools is required')
DESCRIPTION = ('pvops is a python library for the analysis of ' +
'field collected operational data for photovoltaic systems.')
LONG_DESCRIPTION = """
pvops i... | 24.021505 | 78 | 0.691585 | #!/usr/bin/env python
try:
from setuptools import setup, find_packages
except ImportError:
raise RuntimeError('setuptools is required')
DESCRIPTION = ('pvops is a python library for the analysis of ' +
'field collected operational data for photovoltaic systems.')
LONG_DESCRIPTION = """
pvops i... | 0 | 0 | 0 |
73ef5f3120097a8cdf5bcb0606b463078e309cf1 | 6,202 | py | Python | awsudo/rotate.py | numerai/awsudo | a18c1e0a8faceae51361e010d6eee895e08465a6 | [
"MIT"
] | null | null | null | awsudo/rotate.py | numerai/awsudo | a18c1e0a8faceae51361e010d6eee895e08465a6 | [
"MIT"
] | null | null | null | awsudo/rotate.py | numerai/awsudo | a18c1e0a8faceae51361e010d6eee895e08465a6 | [
"MIT"
] | null | null | null | from __future__ import print_function
import os
import sys
import getopt
from os import path
from textwrap import dedent
from retrying import retry
from awsudo.config import CredentialResolver
from awsudo.main import cleanEnvironment
from boto.iam.connection import IAMConnection
from boto.exception import BotoServerEr... | 30.253659 | 99 | 0.671396 | from __future__ import print_function
import os
import sys
import getopt
from os import path
from textwrap import dedent
from retrying import retry
from awsudo.config import CredentialResolver
from awsudo.main import cleanEnvironment
from boto.iam.connection import IAMConnection
from boto.exception import BotoServerEr... | 3,279 | 649 | 161 |
a38b95d160fc8a0e45dcc5bce56d2d8e8fa78398 | 3,464 | py | Python | frontend/tests/sauce_connect.py | connectthefuture/calc | 7f0dc01d9265f26a36c2b9b5ee779fe876e4a494 | [
"CC0-1.0"
] | null | null | null | frontend/tests/sauce_connect.py | connectthefuture/calc | 7f0dc01d9265f26a36c2b9b5ee779fe876e4a494 | [
"CC0-1.0"
] | 1 | 2021-06-10T23:13:04.000Z | 2021-06-10T23:13:04.000Z | frontend/tests/sauce_connect.py | connectthefuture/calc | 7f0dc01d9265f26a36c2b9b5ee779fe876e4a494 | [
"CC0-1.0"
] | null | null | null | import os
import sys
import subprocess
import traceback
import pexpect
if False:
# This is just needed so mypy will work; it's never executed.
from typing import Optional # NOQA
MY_DIR = os.path.abspath(os.path.dirname(__file__))
SAUCE_CONNECT_SH_PATH = os.path.join(MY_DIR, 'sauce_connect.sh')
LOAD_SAUCE_C... | 24.742857 | 75 | 0.58545 | import os
import sys
import subprocess
import traceback
import pexpect
if False:
# This is just needed so mypy will work; it's never executed.
from typing import Optional # NOQA
MY_DIR = os.path.abspath(os.path.dirname(__file__))
SAUCE_CONNECT_SH_PATH = os.path.join(MY_DIR, 'sauce_connect.sh')
LOAD_SAUCE_C... | 2,637 | 4 | 226 |
5d93574711f60399841cfe595d62241e936dfb9a | 20,898 | py | Python | xfel/command_line/striping.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 155 | 2016-11-23T12:52:16.000Z | 2022-03-31T15:35:44.000Z | xfel/command_line/striping.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 590 | 2016-12-10T11:31:18.000Z | 2022-03-30T23:10:09.000Z | xfel/command_line/striping.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 115 | 2016-11-15T08:17:28.000Z | 2022-02-09T15:30:14.000Z | from __future__ import absolute_import, division, print_function
from six.moves import range
# -*- Mode: Python; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*-
#
# LIBTBX_SET_DISPATCHER_NAME cctbx.xfel.stripe_experiment
#
# Given an LCLS experiment results directory and a trial, group results by
# run group... | 36.792254 | 125 | 0.681405 | from __future__ import absolute_import, division, print_function
from six.moves import range
# -*- Mode: Python; c-basic-offset: 2; indent-tabs-mode: nil; tab-width: 8 -*-
#
# LIBTBX_SET_DISPATCHER_NAME cctbx.xfel.stripe_experiment
#
# Given an LCLS experiment results directory and a trial, group results by
# run group... | 6,065 | 5,879 | 69 |
09d3f7a4cbc0a08c36ab107b2e9a993b4875da64 | 253 | py | Python | todoapp/todos/urls.py | kiburualex/Django-Rest-Example | 0208c4cc3e4b1f8189028af77ec5d1714ca98f3f | [
"MIT"
] | null | null | null | todoapp/todos/urls.py | kiburualex/Django-Rest-Example | 0208c4cc3e4b1f8189028af77ec5d1714ca98f3f | [
"MIT"
] | null | null | null | todoapp/todos/urls.py | kiburualex/Django-Rest-Example | 0208c4cc3e4b1f8189028af77ec5d1714ca98f3f | [
"MIT"
] | null | null | null | from django.conf.urls import url
from todos.views import TodoListCreateAPIView, TodoDetailAPIView
urlpatterns = [
url(r'^$', TodoListCreateAPIView.as_view(), name="list"),
url(r'^(?P<pk>[0-9]+)/$', TodoDetailAPIView.as_view(), name="detail"),
] | 36.142857 | 74 | 0.70751 | from django.conf.urls import url
from todos.views import TodoListCreateAPIView, TodoDetailAPIView
urlpatterns = [
url(r'^$', TodoListCreateAPIView.as_view(), name="list"),
url(r'^(?P<pk>[0-9]+)/$', TodoDetailAPIView.as_view(), name="detail"),
] | 0 | 0 | 0 |
10375671b2519220fe8006d0c1a27f71afd695cb | 1,191 | py | Python | fastrf/models/gain_transfer.py | TheDubliner/fastrf | 31761f58ab588cf441eaf200fb3862beeef625b5 | [
"MIT"
] | 4 | 2020-05-29T01:19:09.000Z | 2021-03-16T12:05:26.000Z | fastrf/models/gain_transfer.py | TheDubliner/fastrf | 31761f58ab588cf441eaf200fb3862beeef625b5 | [
"MIT"
] | 166 | 2020-04-16T03:34:53.000Z | 2022-01-03T16:55:14.000Z | fastrf/models/gain_transfer.py | TheDubliner/fastrf | 31761f58ab588cf441eaf200fb3862beeef625b5 | [
"MIT"
] | 2 | 2021-04-25T23:55:56.000Z | 2022-01-10T13:06:19.000Z | from typing import Optional
from fastapi_camelcase import CamelModel
from .common._unit_validators import dB_unit_check_validator, power_unit_validator
from .signals.frequency import Frequency
class GainFrequency(Gain):
"""[Gain at a single frequency]
Arguments:
f {Frequency} -- Single Frequency
... | 20.534483 | 82 | 0.678421 | from typing import Optional
from fastapi_camelcase import CamelModel
from .common._unit_validators import dB_unit_check_validator, power_unit_validator
from .signals.frequency import Frequency
class Power(CamelModel):
value: float
unit: str = "dBm"
_unit_must_be_in_allowed_set = power_unit_validator()
... | 0 | 191 | 46 |
d6016da7b2c4dbdcf86911bd54a3d9dd1f73a7d5 | 1,860 | py | Python | Beginner/2/notes.py | Matthew1906/100DaysOfPython | 94ffff8f5535ce5d574f49c0d7971d64a4575aad | [
"MIT"
] | 1 | 2021-12-25T02:19:18.000Z | 2021-12-25T02:19:18.000Z | Beginner/2/notes.py | Matthew1906/100DaysOfPython | 94ffff8f5535ce5d574f49c0d7971d64a4575aad | [
"MIT"
] | null | null | null | Beginner/2/notes.py | Matthew1906/100DaysOfPython | 94ffff8f5535ce5d574f49c0d7971d64a4575aad | [
"MIT"
] | 1 | 2021-11-25T10:31:47.000Z | 2021-11-25T10:31:47.000Z | # DATA TYPES, NUMBERS, OPERATIONS, TYPE CONVERSION, f-Strings
# 1. Data Types
# a. String
# pulling out an element from the string = subscripting
# the index starts from 0 to length-1
print("Hello"[3])
# b. Integer
# large integers can be separated with _
print(199_000) # show 199000, but it makes it more readable... | 25.479452 | 72 | 0.694086 | # DATA TYPES, NUMBERS, OPERATIONS, TYPE CONVERSION, f-Strings
# 1. Data Types
# a. String
# pulling out an element from the string = subscripting
# the index starts from 0 to length-1
print("Hello"[3])
# b. Integer
# large integers can be separated with _
print(199_000) # show 199000, but it makes it more readable... | 0 | 0 | 0 |
7259758223c1ea78c65b92b87ea2211bfa4cb851 | 399 | py | Python | fusion/migrations/0009_image_probability.py | manoharganta256/Chest-Xray-Prediction | 24d0130a90b9cdbcc2d283fb0e1b5a5df88ed869 | [
"MIT"
] | 1 | 2020-06-23T09:23:54.000Z | 2020-06-23T09:23:54.000Z | fusion/migrations/0009_image_probability.py | manoharganta256/Chest-Xray-Prediction | 24d0130a90b9cdbcc2d283fb0e1b5a5df88ed869 | [
"MIT"
] | 13 | 2020-01-28T22:26:55.000Z | 2022-03-11T23:27:43.000Z | fusion/migrations/0009_image_probability.py | manoharganta256/Chest-Xray-Prediction | 24d0130a90b9cdbcc2d283fb0e1b5a5df88ed869 | [
"MIT"
] | 2 | 2019-02-20T06:40:26.000Z | 2019-10-01T14:07:18.000Z | # Generated by Django 2.0.7 on 2018-08-14 12:53
from django.db import migrations, models
| 21 | 62 | 0.60401 | # Generated by Django 2.0.7 on 2018-08-14 12:53
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fusion', '0008_auto_20180731_1925'),
]
operations = [
migrations.AddField(
model_name='image',
name='probability',
... | 0 | 285 | 23 |
4d42b2279a7e82f48d1b603cbe16c8fb292bfdab | 17,144 | py | Python | utils/convert_logs.py | seemantk/gentoo-viz | fbdf4946528c49ceb568a60b908f4140c4df9c9a | [
"MIT"
] | 1 | 2015-11-05T07:24:28.000Z | 2015-11-05T07:24:28.000Z | utils/convert_logs.py | seemantk/gentoo-viz | fbdf4946528c49ceb568a60b908f4140c4df9c9a | [
"MIT"
] | null | null | null | utils/convert_logs.py | seemantk/gentoo-viz | fbdf4946528c49ceb568a60b908f4140c4df9c9a | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Standard library imports
from datetime import datetime
from optparse import OptionParser
import os
import sys
import time
from xml.sax.saxutils import escape as h
# Some global variables
svn_sep = "------------------------------------------------------------------------"
cvs_sep = "----------------... | 38.963636 | 112 | 0.491367 | #!/usr/bin/python
# Standard library imports
from datetime import datetime
from optparse import OptionParser
import os
import sys
import time
from xml.sax.saxutils import escape as h
# Some global variables
svn_sep = "------------------------------------------------------------------------"
cvs_sep = "----------------... | 412 | 265 | 45 |
15042f5cfa508b9c66e924c9b72c910b5f285e51 | 2,777 | py | Python | setup.py | platform9/express-cli | a653223a129774a05b9f70efd9c4ecbe930beb7b | [
"Apache-2.0"
] | 4 | 2019-12-06T20:39:53.000Z | 2021-01-05T07:01:35.000Z | setup.py | platform9/express-cli | a653223a129774a05b9f70efd9c4ecbe930beb7b | [
"Apache-2.0"
] | 42 | 2019-09-20T20:35:09.000Z | 2021-09-23T23:28:05.000Z | setup.py | platform9/express-cli | a653223a129774a05b9f70efd9c4ecbe930beb7b | [
"Apache-2.0"
] | 5 | 2019-11-19T02:36:01.000Z | 2021-01-05T04:46:48.000Z | """Packaging settings."""
import sys
import os
from codecs import open
from subprocess import call
from setuptools import Command, find_packages, setup
from pf9 import __version__
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='ut... | 29.860215 | 96 | 0.594526 | """Packaging settings."""
import sys
import os
from codecs import open
from subprocess import call
from setuptools import Command, find_packages, setup
from pf9 import __version__
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='ut... | 40 | 0 | 54 |
335d9e38e51aafded1aae038d7380620f7af624f | 364 | py | Python | python-practice/fib_memo.py | davemungo/various | ed7c17f8b75a27fc59b0a5cad6125d64d00cd3ce | [
"MIT"
] | 1 | 2020-01-19T01:21:56.000Z | 2020-01-19T01:21:56.000Z | python-practice/fib_memo.py | davemungo/various | ed7c17f8b75a27fc59b0a5cad6125d64d00cd3ce | [
"MIT"
] | null | null | null | python-practice/fib_memo.py | davemungo/various | ed7c17f8b75a27fc59b0a5cad6125d64d00cd3ce | [
"MIT"
] | 1 | 2021-07-02T14:40:01.000Z | 2021-07-02T14:40:01.000Z | memo = {0:0, 1:1}
if __name__ == "__main__":
print(f"\n0: {fib(0)}")
print(f"\n1: {fib(1)}")
print(f"\n5: {fib(5)}")
print(f"\n10: {fib(10)}")
#for k,v in memo.items(): print(f"{k}: {v}")
| 18.2 | 49 | 0.458791 | memo = {0:0, 1:1}
def fib(n):
#if n == 0: return 0
#if n == 1: return 1
if n not in memo:
memo[n] = fib(n - 1) + fib(n - 2)
return memo[n]
if __name__ == "__main__":
print(f"\n0: {fib(0)}")
print(f"\n1: {fib(1)}")
print(f"\n5: {fib(5)}")
print(f"\n10: {fib(10)}")
#f... | 129 | 0 | 23 |
8e1b6f6dab45af95d9530bb78f0966a8f4fb001b | 9,280 | py | Python | tools/badges/badges.py | hiliang-cmu/ARENA-py | 724e14f4e37112b96d90e94d9e521800bdea0997 | [
"BSD-3-Clause"
] | 4 | 2021-01-22T23:49:52.000Z | 2022-03-04T06:01:18.000Z | tools/badges/badges.py | hiliang-cmu/ARENA-py | 724e14f4e37112b96d90e94d9e521800bdea0997 | [
"BSD-3-Clause"
] | 50 | 2020-08-14T22:24:36.000Z | 2022-03-18T20:41:12.000Z | tools/badges/badges.py | hiliang-cmu/ARENA-py | 724e14f4e37112b96d90e94d9e521800bdea0997 | [
"BSD-3-Clause"
] | 10 | 2019-10-28T20:15:18.000Z | 2021-06-29T18:02:06.000Z | # badges.py
#
# Application responds to users in the scene and updates the user avatar with name and badge updates.
import argparse
import yaml
from arena import *
from gstable import GoogleSheetTable
DFT_CONFIG_FILENAME = './config.yaml'
ACTUSERS = {} # actual users by camera id
config = {}
data = []
# pars... | 36.825397 | 113 | 0.553125 | # badges.py
#
# Application responds to users in the scene and updates the user avatar with name and badge updates.
import argparse
import yaml
from arena import *
from gstable import GoogleSheetTable
DFT_CONFIG_FILENAME = './config.yaml'
ACTUSERS = {} # actual users by camera id
config = {}
data = []
def init_ar... | 8,298 | 0 | 115 |
5b24e95bac4721bbeba7a874eba9aebbddb7a81e | 22,159 | py | Python | legit/cli.py | mycozycloud/legit | 8a0d5abaf430bcfb415ad485c692a91a0d2119ec | [
"BSD-3-Clause"
] | 1 | 2015-12-01T10:28:15.000Z | 2015-12-01T10:28:15.000Z | legit/cli.py | mycozycloud/legit | 8a0d5abaf430bcfb415ad485c692a91a0d2119ec | [
"BSD-3-Clause"
] | null | null | null | legit/cli.py | mycozycloud/legit | 8a0d5abaf430bcfb415ad485c692a91a0d2119ec | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
legit.cli
~~~~~~~~~
This module povides the CLI interface to legit.
"""
import os
import sys
from subprocess import call
from time import sleep
import clint.resources
from clint import args
from clint.eng import join as eng_join
from clint.textui import colored, puts, columns
from .core... | 26.633413 | 118 | 0.60296 | # -*- coding: utf-8 -*-
"""
legit.cli
~~~~~~~~~
This module povides the CLI interface to legit.
"""
import os
import sys
from subprocess import call
from time import sleep
import clint.resources
from clint import args
from clint.eng import join as eng_join
from clint.textui import colored, puts, columns
from .core... | 2,296 | 224 | 207 |
d0a7a9fab93499d68229c9a9670fb4673b7d71b9 | 4,508 | py | Python | trafic_monitor/server_bandwidth/serverbwinfo.py | lehoanghoa/system-resources-monitor | e9f92f326b152a25b2b7097d0ae9642e6d52c24d | [
"BSD-3-Clause"
] | null | null | null | trafic_monitor/server_bandwidth/serverbwinfo.py | lehoanghoa/system-resources-monitor | e9f92f326b152a25b2b7097d0ae9642e6d52c24d | [
"BSD-3-Clause"
] | null | null | null | trafic_monitor/server_bandwidth/serverbwinfo.py | lehoanghoa/system-resources-monitor | e9f92f326b152a25b2b7097d0ae9642e6d52c24d | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import sys
import netsnmp
import re
import memcache
import datetime
import MySQLdb
import time
if __name__ == '__main__':
mc = memcache.Client(['10.30.22.49:11216'], debug=0)
timestamp = int(time.time())
# year = datetime.datetime.now().strftime("%y")
# month = datetime.datetime... | 42.933333 | 153 | 0.566992 | #!/usr/bin/env python
import sys
import netsnmp
import re
import memcache
import datetime
import MySQLdb
import time
def insert_db(server_ip, interface, update_date):
db = MySQLdb.connect(host="10.30.12.110", user="rs_monitor", passwd="QIM1NQ0G3rij", db="resource_monitor")
cur = db.cursor()
query = """REPL... | 3,710 | 0 | 46 |
e0367fce9689fbdc7b80d73e30d5f6ca93ace15c | 2,141 | py | Python | pymatbridge/tests/test_functions.py | matthias-k/python-matlab-bridge | d2cdea9082c6e19b816032313694b24e55fe66cf | [
"BSD-2-Clause"
] | 271 | 2015-01-01T19:02:23.000Z | 2022-03-23T01:02:29.000Z | pymatbridge/tests/test_functions.py | timgates42/python-matlab-bridge | 9822c7b55435662f4f033c5479cc03fea2255755 | [
"BSD-2-Clause"
] | 159 | 2015-01-17T13:58:53.000Z | 2021-09-30T02:46:43.000Z | pymatbridge/tests/test_functions.py | timgates42/python-matlab-bridge | 9822c7b55435662f4f033c5479cc03fea2255755 | [
"BSD-2-Clause"
] | 92 | 2015-01-21T18:25:07.000Z | 2021-10-10T01:59:58.000Z | import numpy as np
import numpy.testing as npt
import test_utils as tu
| 35.683333 | 76 | 0.537599 | import numpy as np
import numpy.testing as npt
import test_utils as tu
class TestFunctions(object):
# Start a Matlab session before running any tests
@classmethod
def setup_class(cls):
cls.mlab = tu.connect_to_matlab()
# Tear down the Matlab session after running all the tests
@classmeth... | 1,726 | 320 | 23 |
8200473171315e86cf9de8c108bdf997d0ad4336 | 5,002 | py | Python | nptime.py | jcatw/subtime | 9ac679f7030aa33825e98139b3786f5c0c750470 | [
"MIT"
] | 1 | 2021-02-23T18:05:38.000Z | 2021-02-23T18:05:38.000Z | nptime.py | jcatw/subtime | 9ac679f7030aa33825e98139b3786f5c0c750470 | [
"MIT"
] | null | null | null | nptime.py | jcatw/subtime | 9ac679f7030aa33825e98139b3786f5c0c750470 | [
"MIT"
] | 1 | 2016-02-01T07:33:51.000Z | 2016-02-01T07:33:51.000Z | #!/usr/bin/env python
"""Non-Pedantic Time
=================
.. moduleauthor:: Thomas Grenfell Smith <thomathom@gmail.com>
Python's :mod:`datetime` module has many uses, but it has a difficulty: you
can't do any arithmetic with :class:`datetime.time`. Only with
:class:`datetime.datetime`. Now, there are good reason... | 37.051852 | 82 | 0.677329 | #!/usr/bin/env python
"""Non-Pedantic Time
=================
.. moduleauthor:: Thomas Grenfell Smith <thomathom@gmail.com>
Python's :mod:`datetime` module has many uses, but it has a difficulty: you
can't do any arithmetic with :class:`datetime.time`. Only with
:class:`datetime.datetime`. Now, there are good reason... | 0 | 0 | 0 |
012e6ff2e4096516df48feb91883691ca3c04b01 | 2,402 | py | Python | library/get_driver.py | batu1579/NCUT-library-auto-answer | d8b8a37548e3b58b6e030323b116450cc4c3178a | [
"MIT"
] | 1 | 2021-08-12T15:45:06.000Z | 2021-08-12T15:45:06.000Z | library/get_driver.py | batu1579/NCUT-library-auto-answer | d8b8a37548e3b58b6e030323b116450cc4c3178a | [
"MIT"
] | null | null | null | library/get_driver.py | batu1579/NCUT-library-auto-answer | d8b8a37548e3b58b6e030323b116450cc4c3178a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding=utf-8
'''
Author: BATU1579
Date: 2021-08-11 15:20:04
LastEditors: BATU1579
LastEditTime: 2021-08-16 22:33:54
Description: file content
'''
import logging
import library.const as g
from time import sleep
# 加载不同浏览器的驱动
if g.BROWSER == "edge":
# edge驱动设置
from msedge.selenium_tools ... | 26.988764 | 88 | 0.696503 | #!/usr/bin/env python
# coding=utf-8
'''
Author: BATU1579
Date: 2021-08-11 15:20:04
LastEditors: BATU1579
LastEditTime: 2021-08-16 22:33:54
Description: file content
'''
import logging
import library.const as g
from time import sleep
def set_github_token():
if g.GH_TOKEN != "":
# 设置github访问令牌
impo... | 1,077 | 4 | 144 |
a2516bc95d05407a9066a94b9a0eb3017a0b9dc9 | 1,507 | py | Python | src/util.py | rucm/GameOfLife | c89b555e5e0b3278625ca98fca6e5b3ef3a1218b | [
"MIT"
] | null | null | null | src/util.py | rucm/GameOfLife | c89b555e5e0b3278625ca98fca6e5b3ef3a1218b | [
"MIT"
] | null | null | null | src/util.py | rucm/GameOfLife | c89b555e5e0b3278625ca98fca6e5b3ef3a1218b | [
"MIT"
] | null | null | null | import os
import sys
import glob
import re
from kivy.lang import Builder
from kivy.event import EventDispatcher
def resource_path():
"""
PyInstaller対策。
"""
if hasattr(sys, '_MEIPASS'):
return os.path.join(sys._MEIPASS)
return os.path.join(os.path.dirname(os.path.abspath(__fil... | 24.306452 | 75 | 0.608494 | import os
import sys
import glob
import re
from kivy.lang import Builder
from kivy.event import EventDispatcher
def resource_path():
"""
PyInstaller対策。
"""
if hasattr(sys, '_MEIPASS'):
return os.path.join(sys._MEIPASS)
return os.path.join(os.path.dirname(os.path.abspath(__fil... | 680 | 0 | 54 |
f1210db225d632bc4264838d79bbf50c705a8bfb | 11,965 | py | Python | tests/user_test.py | bibby/radula | 3f5d248f1a670cd8adb9fbad6f5df000b9e0ef77 | [
"MIT"
] | 16 | 2015-09-08T23:50:56.000Z | 2021-11-15T14:31:41.000Z | tests/user_test.py | bibby/radula | 3f5d248f1a670cd8adb9fbad6f5df000b9e0ef77 | [
"MIT"
] | 14 | 2015-09-09T00:23:25.000Z | 2020-04-13T19:50:03.000Z | tests/user_test.py | bibby/radula | 3f5d248f1a670cd8adb9fbad6f5df000b9e0ef77 | [
"MIT"
] | 9 | 2015-11-02T21:47:13.000Z | 2019-11-13T10:18:10.000Z | import os
import sys
import boto
from nose.tools import assert_in, assert_not_in, raises
from moto import mock_s3
from radula import RadulaProxy, _parse_args, Radula, RadulaError
TEST_BUCKET = "tests"
here = os.path.dirname(os.path.realpath(__file__))
TEST_FILE = os.path.join(here, "testdata.txt")
REMOTE_FILE = os.p... | 29.987469 | 81 | 0.529043 | import os
import sys
import boto
from nose.tools import assert_in, assert_not_in, raises
from moto import mock_s3
from radula import RadulaProxy, _parse_args, Radula, RadulaError
TEST_BUCKET = "tests"
here = os.path.dirname(os.path.realpath(__file__))
TEST_FILE = os.path.join(here, "testdata.txt")
REMOTE_FILE = os.p... | 11,112 | 0 | 225 |
0cfc4a82118b050f98695e3f06958e7fa67805e3 | 10,033 | py | Python | trax/rl/policy_tasks.py | OmarAlsaqa/trax | 2de928fbfc952084fcfebee8dc0b6fc308fa7ad4 | [
"Apache-2.0"
] | null | null | null | trax/rl/policy_tasks.py | OmarAlsaqa/trax | 2de928fbfc952084fcfebee8dc0b6fc308fa7ad4 | [
"Apache-2.0"
] | null | null | null | trax/rl/policy_tasks.py | OmarAlsaqa/trax | 2de928fbfc952084fcfebee8dc0b6fc308fa7ad4 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021 The Trax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 38.737452 | 80 | 0.708661 | # coding=utf-8
# Copyright 2021 The Trax Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 3,256 | 0 | 147 |
4a85eb6c8af532bd1cd1d89406418ddd3d548cf2 | 2,369 | py | Python | Bitcoin/BitcoinPricesAnalyzer.py | shankarganesh1234/MLProjects | 7a9273f0f0d43994dfdee6dc44214f0dd2d92352 | [
"MIT"
] | null | null | null | Bitcoin/BitcoinPricesAnalyzer.py | shankarganesh1234/MLProjects | 7a9273f0f0d43994dfdee6dc44214f0dd2d92352 | [
"MIT"
] | null | null | null | Bitcoin/BitcoinPricesAnalyzer.py | shankarganesh1234/MLProjects | 7a9273f0f0d43994dfdee6dc44214f0dd2d92352 | [
"MIT"
] | null | null | null | import datetime as dt
import BitcoinNewsProcessor as bitcoin_news
import pandas as pd
from matplotlib import pyplot as plt
from sklearn import linear_model
from sklearn.metrics import mean_absolute_error, explained_variance_score
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import Im... | 36.446154 | 103 | 0.769101 | import datetime as dt
import BitcoinNewsProcessor as bitcoin_news
import pandas as pd
from matplotlib import pyplot as plt
from sklearn import linear_model
from sklearn.metrics import mean_absolute_error, explained_variance_score
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import Im... | 497 | 0 | 23 |
a66ee7f929306619db7387d9118056d4fa383382 | 2,303 | py | Python | house_prices/tensorflow/predict.py | pallogu/kaggle_competitions | 4389e4cdfb1fb491f37852abff5bced371505d4a | [
"MIT"
] | null | null | null | house_prices/tensorflow/predict.py | pallogu/kaggle_competitions | 4389e4cdfb1fb491f37852abff5bced371505d4a | [
"MIT"
] | null | null | null | house_prices/tensorflow/predict.py | pallogu/kaggle_competitions | 4389e4cdfb1fb491f37852abff5bced371505d4a | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
import os
import csv
from tensorflow.python.framework import ops
import warnings
from sklearn.model_selection import train_test_split
import loadCleanup
warnings.filterwarnings("ignore")
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
ops.reset_default_graph()
tf.flags.DEFINE_bo... | 37.754098 | 108 | 0.715588 | import tensorflow as tf
import numpy as np
import os
import csv
from tensorflow.python.framework import ops
import warnings
from sklearn.model_selection import train_test_split
import loadCleanup
warnings.filterwarnings("ignore")
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
ops.reset_default_graph()
tf.flags.DEFINE_bo... | 0 | 0 | 0 |
fe78c2a6691c843604c6b86447a8efb489bdc1df | 1,787 | py | Python | myscripts/tropopause/ridge_trough_pdf.py | LSaffin/scripts | 100fc442229ea11f8766a6d78b4db8790c607326 | [
"MIT"
] | 1 | 2020-03-16T13:54:28.000Z | 2020-03-16T13:54:28.000Z | myscripts/tropopause/ridge_trough_pdf.py | LSaffin/scripts | 100fc442229ea11f8766a6d78b4db8790c607326 | [
"MIT"
] | null | null | null | myscripts/tropopause/ridge_trough_pdf.py | LSaffin/scripts | 100fc442229ea11f8766a6d78b4db8790c607326 | [
"MIT"
] | 1 | 2021-01-16T04:54:53.000Z | 2021-01-16T04:54:53.000Z | from datetime import timedelta as dt
import numpy as np
import matplotlib.pyplot as plt
from irise import convert, grid
from irise.diagnostics import rossby_waves
from myscripts.models.um import case_studies
def main(cubes, xbins, ybins, xlabel, ylabel, **kwargs):
"""
"""
# Load variables
thetapv2 = c... | 30.810345 | 77 | 0.663123 | from datetime import timedelta as dt
import numpy as np
import matplotlib.pyplot as plt
from irise import convert, grid
from irise.diagnostics import rossby_waves
from myscripts.models.um import case_studies
def main(cubes, xbins, ybins, xlabel, ylabel, **kwargs):
"""
"""
# Load variables
thetapv2 = c... | 408 | 0 | 46 |
04efc7458bcf26c3c83635e1145b7e8a3492fdc2 | 432 | py | Python | Forming a Magic Square.py | adi-797/Algorithms-Hackerrank | 660694c722c2e2e136e1bc1009482a1699dc5759 | [
"MIT"
] | 2 | 2018-08-31T16:58:57.000Z | 2018-08-31T17:03:50.000Z | Forming a Magic Square.py | adi-797/Algorithms-Hackerrank | 660694c722c2e2e136e1bc1009482a1699dc5759 | [
"MIT"
] | null | null | null | Forming a Magic Square.py | adi-797/Algorithms-Hackerrank | 660694c722c2e2e136e1bc1009482a1699dc5759 | [
"MIT"
] | null | null | null | from itertools import *
X = []
X.extend(list(map(int,input().split())))
X.extend(list(map(int,input().split())))
X.extend(list(map(int,input().split())))
Ans = 81
for P in permutations(range(1,10)):
if sum(P[0:3]) == 15 and sum(P[3:6]) == 15 and sum(P[0::3]) == 15 and sum(P[1::3]) == 15 and P[0] + P[4] + P[8] == ... | 33.230769 | 153 | 0.548611 | from itertools import *
X = []
X.extend(list(map(int,input().split())))
X.extend(list(map(int,input().split())))
X.extend(list(map(int,input().split())))
Ans = 81
for P in permutations(range(1,10)):
if sum(P[0:3]) == 15 and sum(P[3:6]) == 15 and sum(P[0::3]) == 15 and sum(P[1::3]) == 15 and P[0] + P[4] + P[8] == ... | 0 | 0 | 0 |
293f85974fbfe09092b414855c3687a685e5e88a | 7,409 | py | Python | internal/notes/builtin-SAVE/packages/git/package.py | HPCToolkit/hpctest | 5ff4455582bf39e75530a31badcf6142081b386b | [
"BSD-3-Clause"
] | 1 | 2019-01-17T20:07:19.000Z | 2019-01-17T20:07:19.000Z | internal/notes/builtin-SAVE/packages/git/package.py | HPCToolkit/hpctest | 5ff4455582bf39e75530a31badcf6142081b386b | [
"BSD-3-Clause"
] | null | null | null | internal/notes/builtin-SAVE/packages/git/package.py | HPCToolkit/hpctest | 5ff4455582bf39e75530a31badcf6142081b386b | [
"BSD-3-Clause"
] | 2 | 2019-08-06T18:13:57.000Z | 2021-11-05T18:19:49.000Z | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | 36.678218 | 93 | 0.578621 | ##############################################################################
# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | 1,335 | 0 | 132 |
93009b0cf6abdf9849764028962f8ab06a4560d4 | 375 | py | Python | cosmos/ingestion/ingest/process/representation_learning/compute_word_vecs.py | ilmcconnell/Cosmos | 84245034727c30e20ffddee9e02c7e96f3aa115e | [
"Apache-2.0"
] | 30 | 2019-03-14T08:24:34.000Z | 2022-03-09T06:05:44.000Z | cosmos/ingestion/ingest/process/representation_learning/compute_word_vecs.py | ilmcconnell/Cosmos | 84245034727c30e20ffddee9e02c7e96f3aa115e | [
"Apache-2.0"
] | 78 | 2019-02-07T22:14:48.000Z | 2022-03-09T05:59:18.000Z | cosmos/ingestion/ingest/process/representation_learning/compute_word_vecs.py | ilmcconnell/Cosmos | 84245034727c30e20ffddee9e02c7e96f3aa115e | [
"Apache-2.0"
] | 11 | 2019-03-02T01:20:06.000Z | 2022-03-25T07:25:46.000Z | import fasttext
import os
| 31.25 | 78 | 0.664 | import fasttext
import os
def make_vecs(df, n):
content_series = df['content']
result = content_series.str.cat(sep='\n')
wpath = os.path.join('/mytmp', 'content.txt')
with open(wpath, 'w') as wf:
wf.write(result)
model = fasttext.train_unsupervised(wpath, model='skipgram', wordNgrams=n)
... | 326 | 0 | 23 |
fc2c0bd03817564fb76c0ffbc326f12b3450056d | 1,793 | py | Python | cationbot/cogs/auto_role.py | CationHQ/cationbot | 07dc93ec5f4366a8f4a9aee38c663dcbc144f281 | [
"MIT"
] | 2 | 2021-04-28T13:48:46.000Z | 2021-05-31T16:41:16.000Z | cationbot/cogs/auto_role.py | CationHQ/cationbot | 07dc93ec5f4366a8f4a9aee38c663dcbc144f281 | [
"MIT"
] | 14 | 2021-04-07T15:42:18.000Z | 2021-10-01T03:54:25.000Z | cationbot/cogs/auto_role.py | CationHQ/cationbot | 07dc93ec5f4366a8f4a9aee38c663dcbc144f281 | [
"MIT"
] | 2 | 2021-04-28T13:48:47.000Z | 2021-05-31T16:41:22.000Z | import logging
from discord import RawReactionActionEvent as ReactionEvent
from discord.ext import commands
from discord.utils import get
from cationbot.core.bot import Bot
from cationbot.core.env import env
class AutoRole(commands.Cog):
"""Add/Remove the tech/misc roles."""
@commands.Cog.listener()
as... | 31.45614 | 66 | 0.57111 | import logging
from discord import RawReactionActionEvent as ReactionEvent
from discord.ext import commands
from discord.utils import get
from cationbot.core.bot import Bot
from cationbot.core.env import env
class AutoRole(commands.Cog):
"""Add/Remove the tech/misc roles."""
def __init__(self, bot: Bot):
... | 1,057 | 0 | 77 |
d3b468c863340c2a3985524cb649f540f305da8d | 1,768 | py | Python | vcf/filter-vcf-gnomAD+InDel.py | taejoonlab/CINDELA-toolbox | c57e3c99bfeb81aa3ace0a00fbb1dca4095bab49 | [
"Apache-2.0"
] | 1 | 2022-03-23T02:52:47.000Z | 2022-03-23T02:52:47.000Z | vcf/filter-vcf-gnomAD+InDel.py | taejoonlab/CINDELA-toolbox | c57e3c99bfeb81aa3ace0a00fbb1dca4095bab49 | [
"Apache-2.0"
] | null | null | null | vcf/filter-vcf-gnomAD+InDel.py | taejoonlab/CINDELA-toolbox | c57e3c99bfeb81aa3ace0a00fbb1dca4095bab49 | [
"Apache-2.0"
] | 2 | 2022-02-28T14:29:08.000Z | 2022-03-23T02:52:50.000Z | #!/usr/bin/env python3
import os
import gzip
import sys
filename_vcf = sys.argv[1]
gnomAD_list = dict()
dirname_gnomAD = os.path.join(os.path.dirname(os.path.realpath(__file__)),
'..', 'data')
for tmp_filename in os.listdir(dirname_gnomAD):
if not tmp_filename.endswith('vcf.gz'):
... | 28.516129 | 79 | 0.625 | #!/usr/bin/env python3
import os
import gzip
import sys
filename_vcf = sys.argv[1]
gnomAD_list = dict()
dirname_gnomAD = os.path.join(os.path.dirname(os.path.realpath(__file__)),
'..', 'data')
for tmp_filename in os.listdir(dirname_gnomAD):
if not tmp_filename.endswith('vcf.gz'):
... | 0 | 0 | 0 |
c39f576dd12774b1f0f1098699862c1ef5efd31c | 621 | py | Python | 2017/day04.py | kyz/adventofcode | b3dd544624a8fc313ca1fad0d2f02f53bd79ce3d | [
"MIT"
] | null | null | null | 2017/day04.py | kyz/adventofcode | b3dd544624a8fc313ca1fad0d2f02f53bd79ce3d | [
"MIT"
] | null | null | null | 2017/day04.py | kyz/adventofcode | b3dd544624a8fc313ca1fad0d2f02f53bd79ce3d | [
"MIT"
] | null | null | null |
with open("day04.txt") as f:
data = [line for line in f]
identity = lambda s: s
anagram = lambda s: "".join(sorted(s))
print("2017 day 4 part 1: %d" % count_good_passwords(data, identity))
print("2017 day 4 part 2: %d" % count_good_passwords(data, anagram))
| 32.684211 | 76 | 0.647343 | def count_good_passwords(passwords, transform):
return sum([1 if good_password(p, transform) else 0 for p in passwords])
def good_password(password, transform=None):
seen = set()
for word in password.split():
word = transform(word)
if word in seen:
return False
seen.add(... | 297 | 0 | 45 |
2b61197ecd52523417ae8ac8e81d3a201e2cc0e9 | 2,973 | py | Python | flask_cc_api/app.py | suAdminWen/cc-api | a00d9b82583fae57a3cd92ec0478d434f141f172 | [
"MIT"
] | 6 | 2019-03-04T03:08:07.000Z | 2019-07-16T13:43:12.000Z | flask_cc_api/app.py | suAdminWen/cc-api | a00d9b82583fae57a3cd92ec0478d434f141f172 | [
"MIT"
] | 1 | 2021-11-22T15:02:09.000Z | 2021-11-22T15:02:09.000Z | flask_cc_api/app.py | suAdminWen/cc-api | a00d9b82583fae57a3cd92ec0478d434f141f172 | [
"MIT"
] | 1 | 2019-07-01T01:01:27.000Z | 2019-07-01T01:01:27.000Z | import os
from flask import Flask, got_request_exception
from flask_jwt_extended.exceptions import JWTExtendedException
from jwt.exceptions import PyJWTError
from werkzeug.exceptions import HTTPException
from sqlalchemy.exc import OperationalError
from .apis import urls
from .config.celery_config import CeleryConfig
... | 25.62931 | 94 | 0.705684 | import os
from flask import Flask, got_request_exception
from flask_jwt_extended.exceptions import JWTExtendedException
from jwt.exceptions import PyJWTError
from werkzeug.exceptions import HTTPException
from sqlalchemy.exc import OperationalError
from .apis import urls
from .config.celery_config import CeleryConfig
... | 2,018 | 0 | 161 |
8c4fa6b54bc174987598510143da6dbc727f1b1b | 226 | py | Python | setup.py | Filippo125/k8s-deploy-external-dns | b83c74c7e00c9566088a232ce0c5da98b23f8198 | [
"MIT"
] | null | null | null | setup.py | Filippo125/k8s-deploy-external-dns | b83c74c7e00c9566088a232ce0c5da98b23f8198 | [
"MIT"
] | null | null | null | setup.py | Filippo125/k8s-deploy-external-dns | b83c74c7e00c9566088a232ce0c5da98b23f8198 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name='k8s-deploy-external-dns',
version='1.0.0',
packages=['provider'],
url='',
license='',
author='Filippo Ferrazini',
author_email='filippo.ferrazini@gmail.com',
description=''
)
| 17.384615 | 44 | 0.70354 | from setuptools import setup
setup(
name='k8s-deploy-external-dns',
version='1.0.0',
packages=['provider'],
url='',
license='',
author='Filippo Ferrazini',
author_email='filippo.ferrazini@gmail.com',
description=''
)
| 0 | 0 | 0 |
eb0efe51b5ff96e3a95c9b5da1571f176bffa1db | 11,512 | py | Python | mmdet/core/bbox/assigners/atss_cost_assigner_centerall_topk.py | zqcrafts/chanllenge | 03df17d1fd37826eab625e15c29a0a93d7b1e792 | [
"Apache-2.0"
] | null | null | null | mmdet/core/bbox/assigners/atss_cost_assigner_centerall_topk.py | zqcrafts/chanllenge | 03df17d1fd37826eab625e15c29a0a93d7b1e792 | [
"Apache-2.0"
] | null | null | null | mmdet/core/bbox/assigners/atss_cost_assigner_centerall_topk.py | zqcrafts/chanllenge | 03df17d1fd37826eab625e15c29a0a93d7b1e792 | [
"Apache-2.0"
] | null | null | null | import torch
from ..builder import BBOX_ASSIGNERS
from ..iou_calculators import build_iou_calculator
from .assign_result import AssignResult
from .base_assigner import BaseAssigner
from ...bbox.iou_calculators.iou2d_calculator import bbox_overlaps
@BBOX_ASSIGNERS.register_module()
class ATSSCostAssignerCenterAllTopk(... | 44.96875 | 120 | 0.620396 | import torch
from ..builder import BBOX_ASSIGNERS
from ..iou_calculators import build_iou_calculator
from .assign_result import AssignResult
from .base_assigner import BaseAssigner
from ...bbox.iou_calculators.iou2d_calculator import bbox_overlaps
@BBOX_ASSIGNERS.register_module()
class ATSSCostAssignerCenterAllTopk(... | 432 | 0 | 27 |
461171ab862215c08d538c44cd65be4e041ebf5b | 209 | py | Python | PythonExercicios/ex097.py | cedricgenaro/Python | 2ba952b42a9c49efaeb064e230db8d4426cd5ca8 | [
"MIT"
] | null | null | null | PythonExercicios/ex097.py | cedricgenaro/Python | 2ba952b42a9c49efaeb064e230db8d4426cd5ca8 | [
"MIT"
] | null | null | null | PythonExercicios/ex097.py | cedricgenaro/Python | 2ba952b42a9c49efaeb064e230db8d4426cd5ca8 | [
"MIT"
] | null | null | null |
#Programa Principal
escreva('Gustavo Guanabará')
escreva('Curso de Python no YouTube')
escreva('CeV') | 19 | 37 | 0.62201 | def escreva(text):
tam = len(text)+4
print('~' * tam)
print(f' {text}')
print('~' * tam)
#Programa Principal
escreva('Gustavo Guanabará')
escreva('Curso de Python no YouTube')
escreva('CeV') | 84 | 0 | 22 |
8ee341c7ba93d62e611021658c3c6b2a85f2f2ad | 2,006 | py | Python | application/reg.py | RB387/GorbInDocks | e7a76eeae5e2bb781f5465fcbb67ed99dba7bafe | [
"Unlicense"
] | null | null | null | application/reg.py | RB387/GorbInDocks | e7a76eeae5e2bb781f5465fcbb67ed99dba7bafe | [
"Unlicense"
] | 1 | 2019-10-29T17:24:53.000Z | 2019-10-29T17:25:52.000Z | application/reg.py | RB387/GorbInDocks | e7a76eeae5e2bb781f5465fcbb67ed99dba7bafe | [
"Unlicense"
] | 1 | 2019-10-19T12:33:01.000Z | 2019-10-19T12:33:01.000Z | from application import app
from application import decorators
from flask import Blueprint, render_template
from flask import request, session, redirect, url_for
from run import gt
from config import BOT_TOKEN
from push_notifications import notification
import gorbin_tools2
page = Blueprint('reg', __name__,
... | 35.192982 | 92 | 0.683948 | from application import app
from application import decorators
from flask import Blueprint, render_template
from flask import request, session, redirect, url_for
from run import gt
from config import BOT_TOKEN
from push_notifications import notification
import gorbin_tools2
page = Blueprint('reg', __name__,
... | 0 | 0 | 0 |
2cf05109d5cdb588c5f43f4adf0fe63fb4214a91 | 337 | py | Python | generators.py | daviddamilola/python-initial-gra-gra | 9978bfda18f12c87601b110f297da2cb13872d27 | [
"MIT"
] | 1 | 2019-11-07T21:30:21.000Z | 2019-11-07T21:30:21.000Z | generators.py | daviddamilola/python-initial-gra-gra | 9978bfda18f12c87601b110f297da2cb13872d27 | [
"MIT"
] | 2 | 2021-04-06T18:19:09.000Z | 2021-06-02T03:27:18.000Z | generators.py | daviddamilola/python-initial-gra-gra | 9978bfda18f12c87601b110f297da2cb13872d27 | [
"MIT"
] | null | null | null | #A generator is a programming object that produces (that is, generates) a sequence of values
if __name__ == '__main__':
main() | 22.466667 | 92 | 0.611276 | #A generator is a programming object that produces (that is, generates) a sequence of values
def generate_multiples(m, n):
count = 0
while count < n :
yield m * count
count += 1
def main():
for mult in generate_multiples(3, 6):
print(mult, end=' ')
print()
if __name__ == '__ma... | 160 | 0 | 46 |
8ca74d38e3f43575457a1a4fc366c79e05e230c2 | 1,158 | py | Python | builder/minisetting.py | d12y12/DocGenerator | 9e9db94fd80c3099b4c847328b3a0fb33c0159e1 | [
"MIT"
] | null | null | null | builder/minisetting.py | d12y12/DocGenerator | 9e9db94fd80c3099b4c847328b3a0fb33c0159e1 | [
"MIT"
] | null | null | null | builder/minisetting.py | d12y12/DocGenerator | 9e9db94fd80c3099b4c847328b3a0fb33c0159e1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from os.path import join, dirname, abspath
| 31.297297 | 88 | 0.585492 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from os.path import join, dirname, abspath
class Setting:
def __init__(self):
self.attribute = {
"CMD": abspath(join(dirname(dirname(abspath(__file__))), "docbuilder.py")),
"VERSION": join(dirname(dirname(abspath(__file__))), "VERSION... | 889 | -7 | 184 |
5e3a6cae0a14eeecdc12125b7914357de11fc942 | 1,765 | py | Python | ProduceOutputs/boxplot_figure.py | yair-grinb/OSM_Evenets | eea4f6e161129a3b1c5aa4b9d9ea1d6ddfac1f81 | [
"MIT"
] | 1 | 2020-12-02T08:13:04.000Z | 2020-12-02T08:13:04.000Z | ProduceOutputs/boxplot_figure.py | yair-grinb/OSM_Evenets | eea4f6e161129a3b1c5aa4b9d9ea1d6ddfac1f81 | [
"MIT"
] | 5 | 2021-02-11T12:05:13.000Z | 2021-03-22T14:42:38.000Z | ProduceOutputs/boxplot_figure.py | yair-grinb/OSM_Evenets | eea4f6e161129a3b1c5aa4b9d9ea1d6ddfac1f81 | [
"MIT"
] | 1 | 2021-02-22T07:54:53.000Z | 2021-02-22T07:54:53.000Z | import matplotlib.pyplot as plt
from matplotlib import rcParams
import numpy as np
| 45.25641 | 115 | 0.643626 | import matplotlib.pyplot as plt
from matplotlib import rcParams
import numpy as np
def boxplot(df, group_c, data_c, out_dir):
rcParams['font.family'] = 'Times New Roman'
rcParams['font.size'] = 12
events_per_cell = df.groupby(group_c).agg({group_c:'size'}).rename(columns={group_c:'count'})
df = d... | 1,659 | 0 | 23 |
73c02b99316afd5e5df1c8bb4ac815144346a736 | 250 | py | Python | ocp_resources/cluster_service_version.py | kbidarkar/openshift-python-wrapper | 3cd4d6d3b71c82ff87f032a51510d9c9d207f6cb | [
"Apache-2.0"
] | 9 | 2021-07-05T18:35:55.000Z | 2021-12-31T03:09:39.000Z | ocp_resources/cluster_service_version.py | kbidarkar/openshift-python-wrapper | 3cd4d6d3b71c82ff87f032a51510d9c9d207f6cb | [
"Apache-2.0"
] | 418 | 2021-07-04T13:12:09.000Z | 2022-03-30T08:37:45.000Z | ocp_resources/cluster_service_version.py | kbidarkar/openshift-python-wrapper | 3cd4d6d3b71c82ff87f032a51510d9c9d207f6cb | [
"Apache-2.0"
] | 28 | 2021-07-04T12:48:18.000Z | 2022-02-22T15:19:30.000Z | from ocp_resources.resource import NamespacedResource
| 27.777778 | 64 | 0.812 | from ocp_resources.resource import NamespacedResource
class ClusterServiceVersion(NamespacedResource):
api_group = NamespacedResource.ApiGroup.OPERATORS_COREOS_COM
class Status(NamespacedResource.Status):
INSTALLING = "Installing"
| 0 | 172 | 23 |
f66e254413e77da7985a605ab9983934c2652e01 | 3,859 | py | Python | crash_course/ch13/exec/stars.py | dantin/python-by-example | 5769c7a332ebd60fd54e477b6813f2f2a0f3f37f | [
"BSD-3-Clause"
] | null | null | null | crash_course/ch13/exec/stars.py | dantin/python-by-example | 5769c7a332ebd60fd54e477b6813f2f2a0f3f37f | [
"BSD-3-Clause"
] | null | null | null | crash_course/ch13/exec/stars.py | dantin/python-by-example | 5769c7a332ebd60fd54e477b6813f2f2a0f3f37f | [
"BSD-3-Clause"
] | null | null | null |
import pygame
import sys
from pygame.sprite import Group
from pygame.sprite import Sprite
class Settings():
"""A class that stores all settings."""
def __init__(self):
"""Initialize the game's settings."""
# Screen settings
self.screen_width = 1200
self.screen_height = 800
... | 28.798507 | 73 | 0.664939 |
import pygame
import sys
from pygame.sprite import Group
from pygame.sprite import Sprite
class Settings():
"""A class that stores all settings."""
def __init__(self):
"""Initialize the game's settings."""
# Screen settings
self.screen_width = 1200
self.screen_height = 800
... | 0 | 0 | 0 |
43001182af9e9d459753b6ab923450f1ad424668 | 166 | py | Python | aiomodrinth/license.py | Xemay/aiomodrinth | 418e3c2dc67c6d2c45a5745f34c1ddadda5ed47d | [
"MIT"
] | null | null | null | aiomodrinth/license.py | Xemay/aiomodrinth | 418e3c2dc67c6d2c45a5745f34c1ddadda5ed47d | [
"MIT"
] | null | null | null | aiomodrinth/license.py | Xemay/aiomodrinth | 418e3c2dc67c6d2c45a5745f34c1ddadda5ed47d | [
"MIT"
] | null | null | null | from dataclasses import dataclass
from datetime import datetime
from typing import Optional
@dataclass
| 15.090909 | 33 | 0.740964 | from dataclasses import dataclass
from datetime import datetime
from typing import Optional
@dataclass
class License:
id: str
name: str
url: str | None
| 0 | 39 | 22 |
1e41eae05c698b105ef493b49cca2dea4fd5f0ca | 649 | py | Python | gpu_label_start.py | Ruilkyu/kubernetes_start | 9e88a7f1c64899454af8f9be1dd9653ba435e21f | [
"Apache-2.0"
] | 2 | 2020-07-24T14:19:57.000Z | 2020-08-10T18:30:08.000Z | gpu_label_start.py | Ruilkyu/kubernetes_start | 9e88a7f1c64899454af8f9be1dd9653ba435e21f | [
"Apache-2.0"
] | null | null | null | gpu_label_start.py | Ruilkyu/kubernetes_start | 9e88a7f1c64899454af8f9be1dd9653ba435e21f | [
"Apache-2.0"
] | 1 | 2021-07-09T10:29:11.000Z | 2021-07-09T10:29:11.000Z | """
时间:2020/9/22
作者:lurui
功能:k8s集群GPU节点打标签
"""
import os
import sys
basedir = os.path.abspath('.')
a = sys.argv[1]
b = sys.argv[2]
start_label_gpu(a, b)
| 23.178571 | 119 | 0.548536 | """
时间:2020/9/22
作者:lurui
功能:k8s集群GPU节点打标签
"""
import os
import sys
basedir = os.path.abspath('.')
def start_label_gpu(k, v):
nodes_name = basedir + '/cfg/nodes.txt'
nodes = open(nodes_name, mode="r", encoding='utf-8')
for i in nodes.readlines():
a = i.strip('\n').split('.')
try:
... | 469 | 0 | 23 |
cd9f98d9d08fbc57ec77d4c67169791536eb23b8 | 198 | py | Python | src/tsgettoolbox/ulmo/usgs/eddn/__init__.py | timcera/tsgettoolbox | 828306aefaa097a74abd8e71605bd19eeda29058 | [
"BSD-3-Clause"
] | 4 | 2017-11-21T20:22:47.000Z | 2021-09-27T13:27:05.000Z | src/tsgettoolbox/ulmo/usgs/eddn/__init__.py | timcera/tsgettoolbox | 828306aefaa097a74abd8e71605bd19eeda29058 | [
"BSD-3-Clause"
] | 21 | 2016-04-28T16:52:18.000Z | 2021-12-16T17:00:27.000Z | src/tsgettoolbox/ulmo/usgs/eddn/__init__.py | timcera/tsgettoolbox | 828306aefaa097a74abd8e71605bd19eeda29058 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
`USGS Emergency Data Distribution Network`_ services
.. _USGS Emergency Data Distribution Network: http://eddn.usgs.gov/
"""
from .core import decode, get_data
| 22 | 71 | 0.681818 | # -*- coding: utf-8 -*-
"""
`USGS Emergency Data Distribution Network`_ services
.. _USGS Emergency Data Distribution Network: http://eddn.usgs.gov/
"""
from .core import decode, get_data
| 0 | 0 | 0 |
04454c7c6d56c1916f369e62874f19861c2272bf | 6,586 | py | Python | sfeprapy/func/pp.py | fsepy/sfeprapy | 0b1c11b30034793e1231f599cf41e496a9ec56aa | [
"MIT"
] | 4 | 2021-04-11T00:57:43.000Z | 2022-03-10T05:28:48.000Z | sfeprapy/func/pp.py | fsepy/sfeprapy | 0b1c11b30034793e1231f599cf41e496a9ec56aa | [
"MIT"
] | 3 | 2019-10-26T11:31:58.000Z | 2019-11-23T11:27:11.000Z | sfeprapy/func/pp.py | fsepy/sfeprapy | 0b1c11b30034793e1231f599cf41e496a9ec56aa | [
"MIT"
] | null | null | null | import itertools
from typing import Tuple, Union
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
| 35.989071 | 118 | 0.631187 | import itertools
from typing import Tuple, Union
import matplotlib.pyplot as plt
import numpy as np
import seaborn as sns
def lineplot(
x: Union[list, np.ndarray],
y: Union[list, np.ndarray],
legend_labels: Union[list, np.ndarray],
acceptable_reliability: float = None,
figsize... | 6,391 | 0 | 69 |
ce9a1d77d810583c0061ab865254759e04e3abf2 | 2,052 | py | Python | efls-data/deploy/network/grpc_ingress_test.py | universe-hcy/Elastic-Federated-Learning-Solution | 4e047fbbe6ae9809cd631499b7d3a3855dfe2208 | [
"Apache-2.0"
] | 65 | 2021-09-30T01:54:34.000Z | 2022-03-26T13:57:15.000Z | efls-data/deploy/network/grpc_ingress_test.py | universe-hcy/Elastic-Federated-Learning-Solution | 4e047fbbe6ae9809cd631499b7d3a3855dfe2208 | [
"Apache-2.0"
] | 24 | 2021-09-30T09:25:43.000Z | 2022-03-29T06:33:44.000Z | efls-data/deploy/network/grpc_ingress_test.py | universe-hcy/Elastic-Federated-Learning-Solution | 4e047fbbe6ae9809cd631499b7d3a3855dfe2208 | [
"Apache-2.0"
] | 18 | 2021-09-30T09:04:08.000Z | 2022-03-31T10:17:27.000Z | from __future__ import print_function
import argparse
import time
import json
import grpc
import helloworld_pb2
import helloworld_pb2_grpc
service_config_json = json.dumps({
"methodConfig": [{
"name": [{
"service": "helloworld.Greeter",
"method": "SayHello"
}],
"re... | 32.0625 | 90 | 0.617934 | from __future__ import print_function
import argparse
import time
import json
import grpc
import helloworld_pb2
import helloworld_pb2_grpc
service_config_json = json.dumps({
"methodConfig": [{
"name": [{
"service": "helloworld.Greeter",
"method": "SayHello"
}],
"re... | 977 | 0 | 23 |
5037fd7e01010f6788da82654e4ab87623d668dc | 50 | py | Python | adfly/__init__.py | fulcanelly/adfly-api | 26cee094822dbe9050eeeb99e63added94f9ca9f | [
"MIT"
] | 4 | 2020-12-07T22:26:56.000Z | 2021-10-23T00:35:53.000Z | adfly/__init__.py | fulcanelly/adfly-api | 26cee094822dbe9050eeeb99e63added94f9ca9f | [
"MIT"
] | 2 | 2022-01-06T15:59:17.000Z | 2022-01-09T17:51:30.000Z | adfly/__init__.py | fulcanelly/adfly-api | 26cee094822dbe9050eeeb99e63added94f9ca9f | [
"MIT"
] | 2 | 2021-03-24T01:28:26.000Z | 2022-01-06T16:09:40.000Z | from .api import AdflyApi
__all__ = ['AdflyApi']
| 12.5 | 25 | 0.72 | from .api import AdflyApi
__all__ = ['AdflyApi']
| 0 | 0 | 0 |
c7fcd22b33b0552a1a6f399c0084af8c3108b0a6 | 2,637 | py | Python | auth.py | MaksimsVisockis01/-Site_Osta_MV_DK_KI_DP1-1 | 8be88887d8eb0815696d1961ef0a97f47eb1eabd | [
"MIT"
] | null | null | null | auth.py | MaksimsVisockis01/-Site_Osta_MV_DK_KI_DP1-1 | 8be88887d8eb0815696d1961ef0a97f47eb1eabd | [
"MIT"
] | null | null | null | auth.py | MaksimsVisockis01/-Site_Osta_MV_DK_KI_DP1-1 | 8be88887d8eb0815696d1961ef0a97f47eb1eabd | [
"MIT"
] | null | null | null | from __main__ import (
app,
session,
redirect,
render_template,
request,
jsonify,
uuid4,
USERS,
)
from json import (
dumps,
) # https://stackoverflow.com/questions/11994325/how-to-divide-flask-app-into-multiple-py-files
### LOGIN ###
@app.route("/login")
@app.route("/login", meth... | 20.129771 | 96 | 0.506636 | from __main__ import (
app,
session,
redirect,
render_template,
request,
jsonify,
uuid4,
USERS,
)
from json import (
dumps,
) # https://stackoverflow.com/questions/11994325/how-to-divide-flask-app-into-multiple-py-files
### LOGIN ###
@app.route("/login")
def login():
if "user" ... | 2,039 | 0 | 110 |
1fcb29ce051a689e8b1da1db6a53f2202c91ea20 | 1,728 | py | Python | 7-assets/past-student-repos/LambdaSchool-master/m6/62a1/queue/queue.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m6/62a1/queue/queue.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | 7-assets/past-student-repos/LambdaSchool-master/m6/62a1/queue/queue.py | eengineergz/Lambda | 1fe511f7ef550aed998b75c18a432abf6ab41c5f | [
"MIT"
] | null | null | null | """
A queue is a data structure whose primary purpose is to store and
return elements in First In First Out order.
1. [X] Implement the Queue class using an array as the underlying storage structure.
Make sure the Queue tests pass.
2. [X] Re-implement the Queue class, this time using the linked list implementation
... | 41.142857 | 455 | 0.693287 | """
A queue is a data structure whose primary purpose is to store and
return elements in First In First Out order.
1. [X] Implement the Queue class using an array as the underlying storage structure.
Make sure the Queue tests pass.
2. [X] Re-implement the Queue class, this time using the linked list implementation
... | 284 | -9 | 138 |
da83f1ec681ac0da631fc09dfd66e6f6271e1adc | 200 | py | Python | django_flex_user/apps.py | ebenh/django-flex-user | efffb21e4ce33d2ea8665756334e2a391f4b5a72 | [
"MIT"
] | 1 | 2021-09-13T20:26:02.000Z | 2021-09-13T20:26:02.000Z | django_flex_user/apps.py | ebenh/django-flex-user | efffb21e4ce33d2ea8665756334e2a391f4b5a72 | [
"MIT"
] | null | null | null | django_flex_user/apps.py | ebenh/django-flex-user | efffb21e4ce33d2ea8665756334e2a391f4b5a72 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
| 25 | 56 | 0.765 | from django.apps import AppConfig
class DjangoFlexUserConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'django_flex_user'
verbose_name = "Django Flex User"
| 0 | 142 | 23 |
8bdaf9e443330d1be5535c174629736a02bf181c | 1,009 | py | Python | Ninja/Leetcode/52_N-Queens_II.py | cyandterry/Python-Study | b40e6c4db10da417e72247f61146f7570621106a | [
"MIT"
] | 61 | 2015-02-03T20:25:55.000Z | 2021-05-17T19:33:40.000Z | Ninja/Leetcode/52_N-Queens_II.py | cyandterry/Python-Study | b40e6c4db10da417e72247f61146f7570621106a | [
"MIT"
] | null | null | null | Ninja/Leetcode/52_N-Queens_II.py | cyandterry/Python-Study | b40e6c4db10da417e72247f61146f7570621106a | [
"MIT"
] | 37 | 2015-02-04T07:12:52.000Z | 2020-05-16T18:47:16.000Z | """
Follow up for N-Queens problem.
Now, instead outputting board configurations, return the total number of distinct solutions.
"""
# @return an integer
# First remember this is diff to a normal cheesboard,
# placing a n*n chess board
# input 1, expect 1 but not 8
# Keep in mind the way to use se... | 28.828571 | 92 | 0.553023 | """
Follow up for N-Queens problem.
Now, instead outputting board configurations, return the total number of distinct solutions.
"""
class Solution:
# @return an integer
def totalNQueens(self, n):
self.ret = 0
self.totalNQueens_helper(n, [])
return self.ret
def totalNQueens_helper... | 575 | -6 | 103 |
ea7eef11d8266f47e72773c29c0acb7c0a5755e0 | 60,874 | py | Python | tibiapy/bazaar.py | vitorruiz/tibia.py | cc0e4be326138c27004b5081c9bf2054032f0e34 | [
"Apache-2.0"
] | null | null | null | tibiapy/bazaar.py | vitorruiz/tibia.py | cc0e4be326138c27004b5081c9bf2054032f0e34 | [
"Apache-2.0"
] | null | null | null | tibiapy/bazaar.py | vitorruiz/tibia.py | cc0e4be326138c27004b5081c9bf2054032f0e34 | [
"Apache-2.0"
] | null | null | null | """Contains all classes related to the Character Bazaar sections in Tibia.com"""
import datetime
import logging
import re
import urllib.parse
from typing import Dict, List, Optional
import bs4
from tibiapy import InvalidContent, Sex, Vocation, abc
from tibiapy.abc import BaseCharacter
from tibiapy.enums import (Aucti... | 35.187283 | 120 | 0.614959 | """Contains all classes related to the Character Bazaar sections in Tibia.com"""
import datetime
import logging
import re
import urllib.parse
from typing import Dict, List, Optional
import bs4
from tibiapy import InvalidContent, Sex, Vocation, abc
from tibiapy.abc import BaseCharacter
from tibiapy.enums import (Aucti... | 11,377 | 0 | 1,181 |
9acc6b832455cb06239e05470f0f2deb4e416c73 | 649 | py | Python | aula_17/ex81.py | Matheus-Pontes/Curso-Python-3 | a55f6730112ee58d6b23158d50b9d3051dce4448 | [
"MIT"
] | null | null | null | aula_17/ex81.py | Matheus-Pontes/Curso-Python-3 | a55f6730112ee58d6b23158d50b9d3051dce4448 | [
"MIT"
] | null | null | null | aula_17/ex81.py | Matheus-Pontes/Curso-Python-3 | a55f6730112ee58d6b23158d50b9d3051dce4448 | [
"MIT"
] | null | null | null |
num = list()
pos = 0
while True:
num.append(int(input("Digite um valor: ")))
option = " "
while option not in "SN":
option = str(input("Quer continuar? [S/N]: ")).upper().strip()[0]
if option == "N":
break
print("="*30)
print(f"Você digitou a seguinte lista {num}")
print(f"Foram digi... | 21.633333 | 73 | 0.557781 |
num = list()
pos = 0
while True:
num.append(int(input("Digite um valor: ")))
option = " "
while option not in "SN":
option = str(input("Quer continuar? [S/N]: ")).upper().strip()[0]
if option == "N":
break
print("="*30)
print(f"Você digitou a seguinte lista {num}")
print(f"Foram digi... | 0 | 0 | 0 |
e12e9626b148792de7e636b74228c5cb296b7d06 | 5,880 | py | Python | myproject/settings.py | iBlackDev/django-project-template | 44de354c560f3a2b22f3c753c1278a2f49aec75e | [
"MIT"
] | null | null | null | myproject/settings.py | iBlackDev/django-project-template | 44de354c560f3a2b22f3c753c1278a2f49aec75e | [
"MIT"
] | null | null | null | myproject/settings.py | iBlackDev/django-project-template | 44de354c560f3a2b22f3c753c1278a2f49aec75e | [
"MIT"
] | null | null | null | """
Django settings for myproject project.
Generated by 'django-admin startproject' using Django 2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
im... | 28 | 85 | 0.654762 | """
Django settings for myproject project.
Generated by 'django-admin startproject' using Django 2.2.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
import os
im... | 0 | 0 | 0 |
c723db5e68044742e79e7b2b263a886a68201121 | 2,931 | py | Python | scripts/postprocess/counterfactual.py | jjbrophy47/tree_influence | 245ff369ed3f4df3ddba243c7e3172423f385505 | [
"Apache-2.0"
] | null | null | null | scripts/postprocess/counterfactual.py | jjbrophy47/tree_influence | 245ff369ed3f4df3ddba243c7e3172423f385505 | [
"Apache-2.0"
] | null | null | null | scripts/postprocess/counterfactual.py | jjbrophy47/tree_influence | 245ff369ed3f4df3ddba243c7e3172423f385505 | [
"Apache-2.0"
] | null | null | null | """
Evaluate min. no. train examples to edit to flip test prediction.
"""
import os
import sys
import time
import hashlib
import argparse
import resource
from datetime import datetime
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from scipy.stats import sem
from sklearn.metrics import log_lo... | 29.606061 | 100 | 0.633231 | """
Evaluate min. no. train examples to edit to flip test prediction.
"""
import os
import sys
import time
import hashlib
import argparse
import resource
from datetime import datetime
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from scipy.stats import sem
from sklearn.metrics import log_lo... | 2,305 | 0 | 46 |
673349708e69589dca1a2433eb9dd83be423fb39 | 3,105 | py | Python | run_create_sqs.py | HardBoiledSmith/johanna | 0443a9040f0248f0a800c9d4b062e375f997bb6f | [
"MIT"
] | 64 | 2016-11-03T11:20:25.000Z | 2021-05-24T03:08:57.000Z | run_create_sqs.py | HardBoiledSmith/johanna | 0443a9040f0248f0a800c9d4b062e375f997bb6f | [
"MIT"
] | 69 | 2016-11-03T14:09:35.000Z | 2022-02-07T12:52:05.000Z | run_create_sqs.py | HardBoiledSmith/johanna | 0443a9040f0248f0a800c9d4b062e375f997bb6f | [
"MIT"
] | 19 | 2016-11-03T11:04:51.000Z | 2020-06-12T10:40:57.000Z | #!/usr/bin/env python3
import json
import time
from env import env
from run_common import AWSCli
from run_common import print_message
from run_common import print_session
options, args = dict(), list()
if __name__ == "__main__":
from run_common import parse_args
options, args = parse_args()
#############... | 29.018692 | 85 | 0.609018 | #!/usr/bin/env python3
import json
import time
from env import env
from run_common import AWSCli
from run_common import print_message
from run_common import print_session
options, args = dict(), list()
if __name__ == "__main__":
from run_common import parse_args
options, args = parse_args()
def run_create... | 2,018 | 0 | 23 |
adfb62aaffb54cea4e7365973f6615ea4c05d0d9 | 195 | py | Python | applications/plugins/SofaPython/doc/SofaDays_oct2013/3_OneParticle/controller.py | sofa-framework/issofa | 94855f488465bc3ed41223cbde987581dfca5389 | [
"OML"
] | null | null | null | applications/plugins/SofaPython/doc/SofaDays_oct2013/3_OneParticle/controller.py | sofa-framework/issofa | 94855f488465bc3ed41223cbde987581dfca5389 | [
"OML"
] | null | null | null | applications/plugins/SofaPython/doc/SofaDays_oct2013/3_OneParticle/controller.py | sofa-framework/issofa | 94855f488465bc3ed41223cbde987581dfca5389 | [
"OML"
] | null | null | null | import Sofa
import particle
# optionnally, script can create a graph...
| 15 | 44 | 0.769231 | import Sofa
import particle
class Tuto3(Sofa.PythonScriptController):
# optionnally, script can create a graph...
def createGraph(self,node):
particle.oneParticleSample(node)
return 0
| 52 | 20 | 46 |
9c776bf4a18f41ddacb95d8d9ad98e2307bf1add | 852 | py | Python | starboost_up/line_searchers.py | NogaMudrik/starboost | 3ba139b3c4a193bda32c860ad019c263ef3c8a3f | [
"MIT"
] | 22 | 2018-12-01T10:20:41.000Z | 2022-01-02T01:29:31.000Z | starboost_up/line_searchers.py | NogaMudrik/starboost | 3ba139b3c4a193bda32c860ad019c263ef3c8a3f | [
"MIT"
] | 1 | 2021-09-21T03:45:56.000Z | 2021-09-21T10:52:55.000Z | starboost_up/line_searchers.py | NogaMudrik/starboost | 3ba139b3c4a193bda32c860ad019c263ef3c8a3f | [
"MIT"
] | 9 | 2019-02-06T18:56:36.000Z | 2022-01-02T01:29:58.000Z | import abc
import numpy as np
__all__ = ['LeafLineSearcher']
| 20.780488 | 94 | 0.634977 | import abc
import numpy as np
__all__ = ['LeafLineSearcher']
class LineSearcher(abc.ABC):
@abc.abstractmethod
def fit(self, y_true, y_pred, gradient, direction):
pass
@abc.abstractmethod
def update(self, direction):
pass
class LeafLineSearcher(LineSearcher):
def __init__(se... | 534 | 125 | 127 |
43d84b2a5867b9924f3397a506987d8ee53174b1 | 5,411 | py | Python | tests/test_max_count.py | writerai/replaCy | 00a5ff923ebc876165805b267ae8a69d7fdc6405 | [
"MIT"
] | 18 | 2021-11-09T04:19:46.000Z | 2022-03-16T11:18:04.000Z | tests/test_max_count.py | weisisheng/replaCy | 00a5ff923ebc876165805b267ae8a69d7fdc6405 | [
"MIT"
] | 69 | 2020-02-27T19:37:07.000Z | 2021-07-02T17:19:50.000Z | tests/test_max_count.py | weisisheng/replaCy | 00a5ff923ebc876165805b267ae8a69d7fdc6405 | [
"MIT"
] | 4 | 2020-06-11T23:54:26.000Z | 2021-03-18T21:29:59.000Z | import pytest
import spacy
from replacy import ReplaceMatcher
nlp = spacy.load("en_core_web_sm")
# They read us the stories they themselves had written.
match_dict = {
"match-1": {
"patterns": [[
{"LOWER": {"IN": ["they", "she"]}},
{"LEMMA": "read", "TEMPLATE_ID": 1},
... | 29.895028 | 83 | 0.576973 | import pytest
import spacy
from replacy import ReplaceMatcher
nlp = spacy.load("en_core_web_sm")
# They read us the stories they themselves had written.
match_dict = {
"match-1": {
"patterns": [[
{"LOWER": {"IN": ["they", "she"]}},
{"LEMMA": "read", "TEMPLATE_ID": 1},
... | 1,428 | 0 | 92 |
fc89fbbde6018de372f3bc875a96d91d65f826c6 | 2,847 | py | Python | exfi/find_exons.py | jlanga/exfi | 6cd28423213aba0ab8ac191e002396ddc84c4be3 | [
"MIT"
] | 2 | 2017-11-02T11:31:41.000Z | 2020-11-28T07:42:27.000Z | exfi/find_exons.py | jlanga/exfi | 6cd28423213aba0ab8ac191e002396ddc84c4be3 | [
"MIT"
] | 36 | 2017-04-26T09:36:54.000Z | 2021-04-16T12:35:52.000Z | exfi/find_exons.py | jlanga/exon_finder | 6cd28423213aba0ab8ac191e002396ddc84c4be3 | [
"MIT"
] | 2 | 2017-07-23T23:03:36.000Z | 2017-09-29T15:30:55.000Z | #!/usr/bin/env python3
"""
Module to compute positive exons in the bloom filter as follos:
- abyss-bloom kmers to get bed coordinates of each transcriptomic kmer in the BF
- bedtools merge to join overlapping consecutive intervals by k-1bases
- awk to throw away too short intervales (to avoid FPs)
- bedtools merge to ... | 30.287234 | 81 | 0.653319 | #!/usr/bin/env python3
"""
Module to compute positive exons in the bloom filter as follos:
- abyss-bloom kmers to get bed coordinates of each transcriptomic kmer in the BF
- bedtools merge to join overlapping consecutive intervals by k-1bases
- awk to throw away too short intervales (to avoid FPs)
- bedtools merge to ... | 0 | 0 | 0 |
0a4d1093dfd7fd491c45884c8eaeb237327ffb53 | 6,924 | py | Python | littlelambocoin/consensus/vdf_info_computation.py | Tony4467/littlelambocoin-blockchain | 3d4f2b577cd5a2feb324fca50e0981a728583aee | [
"Apache-2.0"
] | 6 | 2021-07-15T16:52:46.000Z | 2021-09-27T16:57:08.000Z | littlelambocoin/consensus/vdf_info_computation.py | Tony4467/littlelambocoin-blockchain | 3d4f2b577cd5a2feb324fca50e0981a728583aee | [
"Apache-2.0"
] | 6 | 2021-07-27T08:17:34.000Z | 2021-11-30T11:39:19.000Z | littlelambocoin/consensus/vdf_info_computation.py | Tony4467/littlelambocoin-blockchain | 3d4f2b577cd5a2feb324fca50e0981a728583aee | [
"Apache-2.0"
] | 7 | 2021-08-15T15:10:58.000Z | 2021-10-04T16:47:39.000Z | from typing import List, Optional
from littlelambocoin.consensus.block_record import BlockRecord
from littlelambocoin.consensus.blockchain_interface import BlockchainInterface
from littlelambocoin.consensus.constants import ConsensusConstants
from littlelambocoin.types.blockchain_format.classgroup import ClassgroupEle... | 44.670968 | 117 | 0.661034 | from typing import List, Optional
from littlelambocoin.consensus.block_record import BlockRecord
from littlelambocoin.consensus.blockchain_interface import BlockchainInterface
from littlelambocoin.consensus.constants import ConsensusConstants
from littlelambocoin.types.blockchain_format.classgroup import ClassgroupEle... | 0 | 0 | 0 |