hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f6d44e6f3bf3b79805140e147d5bb167424d8141 | 702 | py | Python | tf2recommender/applications/neural_cf/ncf_config.py | dvarelas/tensorflow2-recommender | 7798d40c8c06cc2ea786237c9e58d2bb9fcd7462 | [
"MIT"
] | 9 | 2019-10-28T16:34:37.000Z | 2021-07-30T13:56:19.000Z | tf2recommender/applications/neural_cf/ncf_config.py | dvarelas/tensorflow2-recommender | 7798d40c8c06cc2ea786237c9e58d2bb9fcd7462 | [
"MIT"
] | 3 | 2020-11-13T18:28:49.000Z | 2022-02-10T00:35:14.000Z | tf2recommender/applications/neural_cf/ncf_config.py | dvarelas/tensorflow2-recommender | 7798d40c8c06cc2ea786237c9e58d2bb9fcd7462 | [
"MIT"
] | 2 | 2020-05-06T10:05:54.000Z | 2020-10-28T15:44:04.000Z | from tf2recommender.config.local import ColumnNames
config = {
'training_args':
NcfTrainingArguments(
user_dim=10,
item_dim=6,
batch_size=16,
num_epochs=5,
hidden1_dim=8,
hidden2_dim=2),
'col_names':
ColumnNames(user_col='user', item_col='item', rating_... | 26 | 79 | 0.648148 | from tf2recommender.config.local import ColumnNames
class NcfTrainingArguments(object):
def __init__(self, user_dim, item_dim, batch_size, num_epochs, hidden1_dim,
hidden2_dim):
self.user_dim = user_dim
self.item_dim = item_dim
self.batch_size = batch_size
self.num... | 0 | 0 | 0 | 343 | 0 | 0 | 0 | 0 | 23 |
170f040109970ea281f30e9adb297272472bff9e | 1,080 | py | Python | OS/processScheduling/PCB.py | cheniison/Experiment | acc0308e0a4a1e4ef297ecf92231af3aae3aaa74 | [
"MIT"
] | null | null | null | OS/processScheduling/PCB.py | cheniison/Experiment | acc0308e0a4a1e4ef297ecf92231af3aae3aaa74 | [
"MIT"
] | null | null | null | OS/processScheduling/PCB.py | cheniison/Experiment | acc0308e0a4a1e4ef297ecf92231af3aae3aaa74 | [
"MIT"
] | null | null | null | """
"""
"""
PCB
"""
"""
"""
| 22.5 | 73 | 0.552778 | """
进程控制类
"""
"""
PCB
进程控制块
"""
class PCB(object):
def __init__(self, name, a_time, e_time, priority):
self.name = name # 进程名
self.u_time = 0 # 已经被调度的时间
self.a_time = a_time # 进程到来的时间
self.e_time = e_time # 预计需要被调度的时间
self.priority = pri... | 144 | 0 | 0 | 953 | 0 | 0 | 0 | 0 | 44 |
342864ac298e6ca2939aa4bf5515c1cd981ffc49 | 2,856 | py | Python | christinaqqbot/plugins/Rss/__init__.py | Whitesad/ChristinaQQbot | a00aba6bd4cd38dab581c0513d544479bebd934b | [
"MIT"
] | 13 | 2020-12-16T02:43:59.000Z | 2021-05-20T01:30:26.000Z | christinaqqbot/plugins/Rss/__init__.py | Whitesad/ChristinaQQbot | a00aba6bd4cd38dab581c0513d544479bebd934b | [
"MIT"
] | 1 | 2021-03-13T10:26:43.000Z | 2021-03-13T10:26:43.000Z | christinaqqbot/plugins/Rss/__init__.py | Whitesad/ChristinaQQbot | a00aba6bd4cd38dab581c0513d544479bebd934b | [
"MIT"
] | 1 | 2021-08-02T07:20:42.000Z | 2021-08-02T07:20:42.000Z | from nonebot import on_command
from nonebot.rule import to_me
from .util import rss_db_init, rss_server
from christinaqqbot.utils.rule import _gruop_white_list
import threading
rss_db_init()
threading.Thread(target=rss_server).start()
RSS=on_command('rss',rule=to_me()&_gruop_white_list)
| 43.938462 | 146 | 0.639706 | from nonebot import on_command
from nonebot.rule import to_me
from nonebot.adapters.cqhttp import Bot,Event
from nonebot.adapters.cqhttp import MessageSegment as msg
from nonebot.log import logger
from .util import check_rss,update_rss,rss_db_init,rss_server,add_rss,query_user_rss,remove_rss
from .model import Rss
fr... | 375 | 2,203 | 0 | 0 | 0 | 0 | 0 | 124 | 110 |
7ea025cef28abd2aed87e246542bc60614f1532a | 3,975 | py | Python | src/ml_dev_utils/Timer.py | maryamltu/ML-Dev-Utils | db349db00e086c661cdea46b9cbdecf666bb4634 | [
"MIT"
] | 1 | 2021-11-24T13:14:44.000Z | 2021-11-24T13:14:44.000Z | src/ml_dev_utils/Timer.py | maryamltu/ML-Dev-Utils | db349db00e086c661cdea46b9cbdecf666bb4634 | [
"MIT"
] | 3 | 2021-11-12T10:24:14.000Z | 2021-11-12T13:40:24.000Z | src/ml_dev_utils/Timer.py | LTU-Machine-Learning/ML-Dev-Utils | db349db00e086c661cdea46b9cbdecf666bb4634 | [
"MIT"
] | 1 | 2021-11-23T07:31:22.000Z | 2021-11-23T07:31:22.000Z | """
Timer
======
This module measures the execution time and provides three ways to do this:
* **MeasureTime**: Measure time as decorator ``@MeasureTime``.
* **MeasureBlockTime**: Measure as ``with MeasureBlockTime("my_block") as my_block:``.
* **Timer**: Measure as instance ``timer = Timer()``
"""
from __future__ im... | 24.090909 | 95 | 0.626415 | """
Timer
======
This module measures the execution time and provides three ways to do this:
* **MeasureTime**: Measure time as decorator ``@MeasureTime``.
* **MeasureBlockTime**: Measure as ``with MeasureBlockTime("my_block") as my_block:``.
* **Timer**: Measure as instance ``timer = Timer()``
"""
from __future__ im... | 0 | 243 | 0 | 2,180 | 0 | 145 | 0 | -1 | 210 |
ce580b94316d6e7918c749aaea2c9902077dc9ba | 1,046 | py | Python | bad_code.py | the-code-critics/001-datastructures | 2e73cd3c4e7d167829109dd146e6f14bcbdd68ea | [
"Apache-2.0"
] | null | null | null | bad_code.py | the-code-critics/001-datastructures | 2e73cd3c4e7d167829109dd146e6f14bcbdd68ea | [
"Apache-2.0"
] | null | null | null | bad_code.py | the-code-critics/001-datastructures | 2e73cd3c4e7d167829109dd146e6f14bcbdd68ea | [
"Apache-2.0"
] | null | null | null | """
BAD CODE
The problem is in the data structure. Loading the movie database as a list
of lists causes the function movies() to find the movies of a user to be
of linear complexity O(1) and the function shared() to find shared movies to be
of quadratic complexity O(m*m).
The good code has constant complexity O(1) fo... | 24.904762 | 79 | 0.669216 | """
BAD CODE
The problem is in the data structure. Loading the movie database as a list
of lists causes the function movies() to find the movies of a user to be
of linear complexity O(1) and the function shared() to find shared movies to be
of quadratic complexity O(m*m).
The good code has constant complexity O(1) fo... | 0 | 0 | 0 | 0 | 0 | 384 | 0 | 0 | 69 |
db5be8b86783d564dc2306694291dd2112048f72 | 976 | py | Python | python/snail-clock-wise.py | love-adela/snippets | d803938f927e7c2b5c82607052ccf4470fb56204 | [
"MIT"
] | null | null | null | python/snail-clock-wise.py | love-adela/snippets | d803938f927e7c2b5c82607052ccf4470fb56204 | [
"MIT"
] | 5 | 2021-03-19T08:51:02.000Z | 2022-03-12T00:06:30.000Z | python/snail-clock-wise.py | love-adela/snippets | d803938f927e7c2b5c82607052ccf4470fb56204 | [
"MIT"
] | null | null | null | """
C, R (= , ) = 7, 6
[6, 7, 8, 9, 10, 11, 12]
[5, 26, 27, 28, 29, 30, 13]
[4, 25, 38, 39, 40, 31, 14]
[3, 24, 37, 42, 41, 32, 15]
[2, 23, 36, 35, 34, 33, 16]
[1, 22, 21, 20, 19, 18, 17]
"""
C, R = map(int, input().split())
grid = [[0]* C for _ in range(R)]
count, offset = 0, 0
max_size = C*R
while R > 0 and C > ... | 19.918367 | 45 | 0.471311 | """
C, R (= 열, 행) = 7, 6일 때
[6, 7, 8, 9, 10, 11, 12]
[5, 26, 27, 28, 29, 30, 13]
[4, 25, 38, 39, 40, 31, 14]
[3, 24, 37, 42, 41, 32, 15]
[2, 23, 36, 35, 34, 33, 16]
[1, 22, 21, 20, 19, 18, 17]
"""
C, R = map(int, input().split())
grid = [[0]* C for _ in range(R)]
count, offset = 0, 0
max_size = C*R
while R > 0 and ... | 12 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
07c3b621994e21409177b65e1e4572be62531131 | 1,788 | py | Python | bot/utils/errors.py | r8vnhill/stickfix | 9d9b7cafc8e48bbae3e68d3801fac68e7bc78675 | [
"CC-BY-4.0"
] | null | null | null | bot/utils/errors.py | r8vnhill/stickfix | 9d9b7cafc8e48bbae3e68d3801fac68e7bc78675 | [
"CC-BY-4.0"
] | 7 | 2020-03-02T00:41:40.000Z | 2020-04-26T00:35:30.000Z | bot/utils/errors.py | r8vnhill/stickfix | 9d9b7cafc8e48bbae3e68d3801fac68e7bc78675 | [
"CC-BY-4.0"
] | null | null | null | """ "Stickfix" (c) by Ignacio Slater M.
"Stickfix" is licensed under a
Creative Commons Attribution 4.0 International License.
You should have received a copy of the license along with this
work. If not, see <http://creativecommons.org/licenses/by/4.0/>.
"""
from bot.utils.logger import StickfixLogger
... | 28.380952 | 95 | 0.70302 | """ "Stickfix" (c) by Ignacio Slater M.
"Stickfix" is licensed under a
Creative Commons Attribution 4.0 International License.
You should have received a copy of the license along with this
work. If not, see <http://creativecommons.org/licenses/by/4.0/>.
"""
from bot.utils.logger import StickfixLogger
... | 0 | 0 | 0 | 1,103 | 0 | 0 | 0 | 0 | 138 |
9752f7a1a4652a91731a653df38a04021a276350 | 363 | py | Python | engr1330jb/_build/jupyter_execute/lessons/lesson34/lesson34.py | dustykat/engr-1330-psuedo-course | 3e7e31a32a1896fcb1fd82b573daa5248e465a36 | [
"CC0-1.0"
] | null | null | null | engr1330jb/_build/jupyter_execute/lessons/lesson34/lesson34.py | dustykat/engr-1330-psuedo-course | 3e7e31a32a1896fcb1fd82b573daa5248e465a36 | [
"CC0-1.0"
] | null | null | null | engr1330jb/_build/jupyter_execute/lessons/lesson34/lesson34.py | dustykat/engr-1330-psuedo-course | 3e7e31a32a1896fcb1fd82b573daa5248e465a36 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# <div class="alert alert-block alert-info">
# <b><h1>ENGR 1330 Computational Thinking with Data Science </h1></b>
# </div>
#
# Copyright 2021 Theodore G. Cleveland and Farhang Forghanparast
#
# Last GitHub Commit Date:
#
# # 34: KNN Applications
# - application
#
# ... | 12.517241 | 74 | 0.62259 | #!/usr/bin/env python
# coding: utf-8
# <div class="alert alert-block alert-info">
# <b><h1>ENGR 1330 Computational Thinking with Data Science </h1></b>
# </div>
#
# Copyright © 2021 Theodore G. Cleveland and Farhang Forghanparast
#
# Last GitHub Commit Date:
#
# # 34: KNN Applications
# - application
#
#... | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4aefb55f09f838a7c64f0169f098363e5e985123 | 1,124 | py | Python | proteus/tests/levelset/vortex/redist_vortex_3d_p.py | acatwithacomputer/proteus | 80dfad95da6ab4d18a88a035f55c26b03540a864 | [
"MIT"
] | null | null | null | proteus/tests/levelset/vortex/redist_vortex_3d_p.py | acatwithacomputer/proteus | 80dfad95da6ab4d18a88a035f55c26b03540a864 | [
"MIT"
] | 13 | 2018-02-08T23:22:59.000Z | 2020-12-06T19:40:32.000Z | proteus/tests/levelset/vortex/redist_vortex_3d_p.py | acatwithacomputer/proteus | 80dfad95da6ab4d18a88a035f55c26b03540a864 | [
"MIT"
] | 1 | 2020-02-17T03:25:34.000Z | 2020-02-17T03:25:34.000Z | from __future__ import absolute_import
from proteus.mprans import RDLS
from . import ls_vortex_3d_p
name=soname+"_rdls"
LevelModelType = RDLS.LevelModel
coefficients = RDLS.Coefficients(applyRedistancing=applyRedistancing,
epsFact=epsFactRedistance,
... | 27.414634 | 72 | 0.734875 | from __future__ import absolute_import
from proteus import *
from proteus.default_p import *
from math import *
from .vortex import *
from proteus.mprans import RDLS
from . import ls_vortex_3d_p
name=soname+"_rdls"
LevelModelType = RDLS.LevelModel
coefficients = RDLS.Coefficients(applyRedistancing=applyRedistancing,
... | 0 | 0 | 0 | 0 | 0 | 7 | 0 | 7 | 111 |
685f9ac89ba1e48b392a518fb71baa1ecc465d7a | 9,059 | py | Python | text/tests/unittests/text_prediction/mx/test_preprocessing.py | zhiqiangdon/autogluon | 71ee7ef0f05d8f0aad112d8c1719174aa33194d9 | [
"Apache-2.0"
] | 4,462 | 2019-12-09T17:41:07.000Z | 2022-03-31T22:00:41.000Z | text/tests/unittests/text_prediction/mx/test_preprocessing.py | zhiqiangdon/autogluon | 71ee7ef0f05d8f0aad112d8c1719174aa33194d9 | [
"Apache-2.0"
] | 1,408 | 2019-12-09T17:48:59.000Z | 2022-03-31T20:24:12.000Z | text/tests/unittests/text_prediction/mx/test_preprocessing.py | zhiqiangdon/autogluon | 71ee7ef0f05d8f0aad112d8c1719174aa33194d9 | [
"Apache-2.0"
] | 623 | 2019-12-10T02:04:18.000Z | 2022-03-20T17:11:01.000Z |
TEST_CASES = [
['melbourne_airbnb_sample',
'https://autogluon-text-data.s3.amazonaws.com/test_cases/melbourne_airbnb_sample_1000.pq',
'price_label'],
['women_clothing_rating',
'https://autogluon-text-data.s3.amazonaws.com/test_cases/women_clothing_sample.pq',
'Rating']
]
| 56.61875 | 114 | 0.611215 | import pytest
from mxnet.util import use_np
from mxnet.gluon.data import DataLoader
import numpy as np
import numpy.testing as npt
import tempfile
import pickle
import os
from sklearn.model_selection import train_test_split
from autogluon.core.utils.loaders import load_pd
from autogluon.text.text_prediction.mx.preproce... | 0 | 7,879 | 0 | 0 | 0 | 269 | 0 | 272 | 333 |
447f47fb083328074990f66f88cd6f77a299e43c | 239 | py | Python | koabot/__init__.py | luni3359/koa-bot | 3faf4af89f2a414313e651088f6fd16d12e298ec | [
"MIT"
] | 2 | 2020-05-05T03:02:39.000Z | 2021-07-05T13:38:21.000Z | koabot/__init__.py | luni3359/koa-bot | 3faf4af89f2a414313e651088f6fd16d12e298ec | [
"MIT"
] | 65 | 2019-01-05T05:51:47.000Z | 2022-03-26T17:39:20.000Z | koabot/__init__.py | luni3359/koa-bot | 3faf4af89f2a414313e651088f6fd16d12e298ec | [
"MIT"
] | 1 | 2021-01-06T03:39:00.000Z | 2021-01-06T03:39:00.000Z | """__init.py__"""
import sys
MIN_PYTHON_VERSION = (3, 8)
if sys.version_info < MIN_PYTHON_VERSION:
version_str = '.'.join(map(str, MIN_PYTHON_VERSION))
raise EnvironmentError("Python version needs to be at least " + version_str)
| 26.555556 | 80 | 0.728033 | """__init.py__"""
import sys
MIN_PYTHON_VERSION = (3, 8)
if sys.version_info < MIN_PYTHON_VERSION:
version_str = '.'.join(map(str, MIN_PYTHON_VERSION))
raise EnvironmentError("Python version needs to be at least " + version_str)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
43cfe2101cf60101d3e5bb80cfacd472bc8b619b | 1,666 | py | Python | examples/models/file/panels.py | afonit/bokeh | 37a9d6c81ed592d07effd0d3584befd0fc95b53c | [
"BSD-3-Clause"
] | 1 | 2018-12-19T06:52:07.000Z | 2018-12-19T06:52:07.000Z | examples/models/file/panels.py | afonit/bokeh | 37a9d6c81ed592d07effd0d3584befd0fc95b53c | [
"BSD-3-Clause"
] | 1 | 2017-01-12T00:37:38.000Z | 2017-01-12T00:37:38.000Z | examples/models/file/panels.py | afonit/bokeh | 37a9d6c81ed592d07effd0d3584befd0fc95b53c | [
"BSD-3-Clause"
] | 1 | 2018-03-02T09:57:56.000Z | 2018-03-02T09:57:56.000Z | from bokeh.plotting import show, output_file
from bokeh.models import Plot, Circle, ColumnDataSource, DataRange1d, LinearAxis, Range1d
xdr = DataRange1d()
ydr = DataRange1d()
p = Plot(
title=None, toolbar_location=None,
x_range=xdr, y_range=ydr,
plot_width=800, plot_height=800,
min_border=30,
back... | 29.22807 | 96 | 0.696879 | from bokeh.plotting import show, output_file
from bokeh.models import Plot, Title, Circle, ColumnDataSource, DataRange1d, LinearAxis, Range1d
xdr = DataRange1d()
ydr = DataRange1d()
p = Plot(
title=None, toolbar_location=None,
x_range=xdr, y_range=ydr,
plot_width=800, plot_height=800,
min_border=30,
... | 0 | 0 | 0 | 0 | 0 | 88 | 0 | 7 | 23 |
53450aa8be6bf9cdf3995ef618c370fd0916a588 | 83,569 | py | Python | tensorflow_estimator/python/estimator/canned/v1/dnn_testing_utils_v1.py | cyc/estimator | 742a07296c8f584150bb02f97be7207130ded5fd | [
"Apache-2.0"
] | 2 | 2019-05-13T16:37:32.000Z | 2019-09-17T22:01:38.000Z | tensorflow_estimator/python/estimator/canned/v1/dnn_testing_utils_v1.py | cyc/estimator | 742a07296c8f584150bb02f97be7207130ded5fd | [
"Apache-2.0"
] | null | null | null | tensorflow_estimator/python/estimator/canned/v1/dnn_testing_utils_v1.py | cyc/estimator | 742a07296c8f584150bb02f97be7207130ded5fd | [
"Apache-2.0"
] | 2 | 2019-09-17T22:02:05.000Z | 2020-10-22T03:56:07.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 40.081055 | 145 | 0.626895 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 0 | 0 | 0 | 70,191 | 0 | 2,106 | 0 | 665 | 811 |
58b6517a8bf3c3c557d60bc3419a37e754a31431 | 19,945 | py | Python | ietf/settings.py | wpjesus/codematch | eee7405259cce9239ea0545a2a1300ee1accfe94 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2015-09-02T19:53:12.000Z | 2015-09-02T19:53:12.000Z | ietf/settings.py | wpjesus/codematch | eee7405259cce9239ea0545a2a1300ee1accfe94 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | ietf/settings.py | wpjesus/codematch | eee7405259cce9239ea0545a2a1300ee1accfe94 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | # Copyright The IETF Trust 2007, All Rights Reserved
# Django settings for ietf project.
# BASE_DIR and "settings_local" are from
# http://code.djangoproject.com/wiki/SplitSettings
import os
try:
import syslog
syslog.openlog("datatracker", syslog.LOG_PID, syslog.LOG_USER)
except ImportError:
pass
BASE_DI... | 32.85832 | 148 | 0.727501 | # Copyright The IETF Trust 2007, All Rights Reserved
# Django settings for ietf project.
# BASE_DIR and "settings_local" are from
# http://code.djangoproject.com/wiki/SplitSettings
import os
try:
import syslog
syslog.openlog("datatracker", syslog.LOG_PID, syslog.LOG_USER)
except ImportError:
pass
BASE_DI... | 0 | 0 | 0 | 0 | 0 | 359 | 0 | 69 | 162 |
dc9f87a5c8585617df4b878962093d6f8cf38ccc | 2,519 | py | Python | logistic_regression.py | osamadel/neural_nets | 9e91e814c1ef16231c89d40ee0eb766e667cfa11 | [
"MIT"
] | null | null | null | logistic_regression.py | osamadel/neural_nets | 9e91e814c1ef16231c89d40ee0eb766e667cfa11 | [
"MIT"
] | null | null | null | logistic_regression.py | osamadel/neural_nets | 9e91e814c1ef16231c89d40ee0eb766e667cfa11 | [
"MIT"
] | null | null | null | # Logistic regression
#%%
# Importing libraries
import numpy as np
import random
from matplotlib import pyplot as plt
#%%
#%%
# Generating training data
x = np.linspace(1, 10, 1000)[:, np.newaxis].T
y = np.hstack((np.zeros((1,500)), np.ones((1,500))))
# Adding some randomness
y[0,random.randint(0,500)] = 1
y[0,rando... | 27.988889 | 90 | 0.555776 | # Logistic regression
#%%
# Importing libraries
import numpy as np
import random
from matplotlib import pyplot as plt
#%%
class LogisticRegression():
def __init__(self):
self.w = np.random.rand(1,1)
self.b = np.random.rand(1,1)
self.J = 0
def __sigmoid(self, z):
return 1 / ... | 0 | 0 | 0 | 1,525 | 0 | 0 | 0 | 0 | 22 |
e0f9a9874ec2cf91f5ec738ecb05c48483d46fc3 | 956 | py | Python | packages/mpi/Cartesian.py | lijun99/pyre | 004dfd4c06489b4ba5b32877338ca6440f2d523b | [
"BSD-3-Clause"
] | 3 | 2019-08-02T21:02:47.000Z | 2021-09-08T13:59:43.000Z | packages/mpi/Cartesian.py | lijun99/pyre | 004dfd4c06489b4ba5b32877338ca6440f2d523b | [
"BSD-3-Clause"
] | null | null | null | packages/mpi/Cartesian.py | lijun99/pyre | 004dfd4c06489b4ba5b32877338ca6440f2d523b | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# michael a.g. avzis
# orthologue
# (c) 1998-2019 all rights reserved
#
# superclasses
# declaration
# end of file
| 20.782609 | 89 | 0.641213 | # -*- coding: utf-8 -*-
#
# michael a.g. aïvázis
# orthologue
# (c) 1998-2019 all rights reserved
#
# superclasses
from .Communicator import Communicator
# declaration
class Cartesian(Communicator):
"""
An encapsulation of Cartesian communicators
"""
# per-instance public data
axes = None
... | 6 | 0 | 0 | 745 | 0 | 0 | 0 | 17 | 44 |
bc39cc65a64bcc442bf1cdd6f2240c85e9ed3c9c | 4,196 | py | Python | extras/utils.py | narutonz/analyser | 63b62338b54e218412c53bfc3f6731d07f5bf3ee | [
"MIT"
] | null | null | null | extras/utils.py | narutonz/analyser | 63b62338b54e218412c53bfc3f6731d07f5bf3ee | [
"MIT"
] | null | null | null | extras/utils.py | narutonz/analyser | 63b62338b54e218412c53bfc3f6731d07f5bf3ee | [
"MIT"
] | null | null | null |
__author__ = 'MuhamadNoorZainal MuhamadZabidi'
__version__ = '1.5'
| 32.78125 | 113 | 0.539323 | from configparser import ConfigParser
from pymongo import MongoClient
from math import pow, sqrt
__author__ = 'MuhamadNoorZainal MuhamadZabidi'
__version__ = '1.5'
class Database(object):
def __init__(self, col_name):
self.client = MongoClient()
self.db = self.client['Tweets']
... | 0 | 0 | 0 | 248 | 0 | 3,561 | 0 | 31 | 269 |
f58557ac6ec2c79c4276a2580581ed867b280531 | 6,629 | py | Python | utils/enhanced_universal_dependencies_reader.py | coastalcph/HIT-SCIR-CoNLL2019 | 60258a81a2db91ca012be4486ea8475376756374 | [
"Apache-2.0"
] | 5 | 2020-05-27T14:18:50.000Z | 2021-05-28T05:07:19.000Z | utils/enhanced_universal_dependencies_reader.py | coastalcph/HIT-SCIR-CoNLL2019 | 60258a81a2db91ca012be4486ea8475376756374 | [
"Apache-2.0"
] | 1 | 2020-05-25T13:56:00.000Z | 2020-05-25T13:56:00.000Z | utils/enhanced_universal_dependencies_reader.py | coastalcph/HIT-SCIR-CoNLL2019 | 60258a81a2db91ca012be4486ea8475376756374 | [
"Apache-2.0"
] | 1 | 2020-06-02T16:50:04.000Z | 2020-06-02T16:50:04.000Z | import logging
logger = logging.getLogger(__name__)
METADATA_PARSERS = {
"sent_id": lambda key, value: (key, value),
"text": lambda key, value: (key, value),
}
| 42.767742 | 119 | 0.596168 | from typing import Dict, Tuple, List, Any
import logging
from overrides import overrides
from conllu import parse_incr, string_to_file
from allennlp.common.file_utils import cached_path
from allennlp.data.dataset_readers.dataset_reader import DatasetReader
from allennlp.data.fields import Field, TextField, SequenceLa... | 0 | 5,846 | 0 | 0 | 0 | 0 | 0 | 352 | 245 |
83741f809120fb22061ef5cfb9868a00a9efb7dd | 4,891 | py | Python | osr2mp4/VideoProcess/FrameWriter.py | FireRedz/osr2mp4-core | a75c4200efcb6ab5401423ca5883388675f8858c | [
"MIT"
] | 1 | 2021-04-30T10:54:51.000Z | 2021-04-30T10:54:51.000Z | osr2mp4/VideoProcess/FrameWriter.py | FireRedz/osr2mp4-core | a75c4200efcb6ab5401423ca5883388675f8858c | [
"MIT"
] | 4 | 2020-12-16T11:14:08.000Z | 2021-09-09T06:13:43.000Z | osr2mp4/VideoProcess/FrameWriter.py | FireRedz/osr2mp4-core | a75c4200efcb6ab5401423ca5883388675f8858c | [
"MIT"
] | null | null | null |
### TODO: MOVE THIS TO ITS OWN FILE
###
| 27.632768 | 137 | 0.681456 | import os
import time
import traceback
import numpy as np
import math
import cv2
from pathlib import Path
from osr2mp4 import logger
from osr2mp4.global_var import videoextensions
from osr2mp4.Exceptions import CannotCreateVideo, FourccIsNotExtension, WrongFourcc, LibAvNotFound
### TODO: MOVE THIS TO ITS OWN FILE
def ... | 0 | 0 | 0 | 0 | 0 | 4,408 | 0 | 59 | 380 |
5a6f10c0e0590c6201285848780e3ec1595360e5 | 2,092 | py | Python | pytorch_widedeep/preprocessing/base_preprocessor.py | rajshah4/pytorch-widedeep | 6540cd3cb33b2d7f0ad55e73371094e0d4f9907b | [
"MIT"
] | 692 | 2019-10-08T11:14:06.000Z | 2022-03-31T04:06:42.000Z | pytorch_widedeep/preprocessing/base_preprocessor.py | rajshah4/pytorch-widedeep | 6540cd3cb33b2d7f0ad55e73371094e0d4f9907b | [
"MIT"
] | 69 | 2019-12-18T10:53:47.000Z | 2022-03-29T22:45:51.000Z | pytorch_widedeep/preprocessing/base_preprocessor.py | rajshah4/pytorch-widedeep | 6540cd3cb33b2d7f0ad55e73371094e0d4f9907b | [
"MIT"
] | 85 | 2019-11-17T04:54:03.000Z | 2022-02-21T15:43:43.000Z | from sklearn.exceptions import NotFittedError
# This class does not represent any sctructural advantage, but I keep it to
# keep things tidy, as guidance for contribution and because is useful for the
# check_is_fitted function
def check_is_fitted(
estimator: BasePreprocessor,
attributes: List[str] = None,
... | 34.866667 | 78 | 0.690249 | import pandas as pd
from sklearn.exceptions import NotFittedError
from pytorch_widedeep.wdtypes import * # noqa: F403
# This class does not represent any sctructural advantage, but I keep it to
# keep things tidy, as guidance for contribution and because is useful for the
# check_is_fitted function
class BasePrepro... | 0 | 0 | 0 | 451 | 0 | 0 | 0 | 15 | 81 |
897ecfd8db8b8cf97144ce29f763759ba4992a46 | 191 | py | Python | test_resources/postponed_tuple.py | priya1puresoftware/jsons | 65092a0a99a89abb0bd1aa0e68a99e25b12d96c4 | [
"MIT"
] | null | null | null | test_resources/postponed_tuple.py | priya1puresoftware/jsons | 65092a0a99a89abb0bd1aa0e68a99e25b12d96c4 | [
"MIT"
] | null | null | null | test_resources/postponed_tuple.py | priya1puresoftware/jsons | 65092a0a99a89abb0bd1aa0e68a99e25b12d96c4 | [
"MIT"
] | null | null | null | from __future__ import annotations
| 12.733333 | 34 | 0.696335 | from __future__ import annotations
from typing import NamedTuple
class Tuplicity(NamedTuple):
a: int
b: int
class Tuplicitous(NamedTuple):
a: int
b: int
c: Tuplicity
| 0 | 0 | 0 | 77 | 0 | 0 | 0 | 8 | 69 |
dccbac16ee9c8dc57d08c256701d9bb9192d37e8 | 2,059 | py | Python | roles/certs/files/leforward.py | mattsta/mailweb | de5f691e8ddf4dc3534f90c3e5ab4cd6bfd2c100 | [
"Apache-2.0"
] | 9 | 2018-10-22T19:52:02.000Z | 2020-08-07T21:26:33.000Z | roles/certs/files/leforward.py | mattsta/mailweb | de5f691e8ddf4dc3534f90c3e5ab4cd6bfd2c100 | [
"Apache-2.0"
] | 5 | 2019-04-08T22:10:15.000Z | 2019-04-14T09:05:32.000Z | roles/certs/files/leforward.py | mattsta/mailweb | de5f691e8ddf4dc3534f90c3e5ab4cd6bfd2c100 | [
"Apache-2.0"
] | 9 | 2018-10-29T08:44:58.000Z | 2020-09-15T01:18:55.000Z | #!/usr/bin/env python3
""" Run a single-purpose HTTP server.
Server takes all GET requests and redirects them to a new host
if the request URI starts with SUBPATH, otherwise returns 404.
Requests are redirected to the URL provided by --baseurl. """
import argparse
import sys
CHALLENGE_HOST = None
SUBPATH = "/.well... | 29.84058 | 77 | 0.689169 | #!/usr/bin/env python3
""" Run a single-purpose HTTP server.
Server takes all GET requests and redirects them to a new host
if the request URI starts with SUBPATH, otherwise returns 404.
Requests are redirected to the URL provided by --baseurl. """
import socketserver
import http.server
import argparse
import sys
... | 0 | 0 | 0 | 565 | 0 | 0 | 0 | -5 | 91 |
8c11d25bb80a4f6a5f2bd4df18ed10b74a8fb8ef | 1,009 | py | Python | tomes_darcmail/lib/eaxs/ParameterType.py | StateArchivesOfNorthCarolina/docker_dmc | c387a4bcd91346bedf3a4c4f242fb7f35d5a81c1 | [
"MIT"
] | null | null | null | tomes_darcmail/lib/eaxs/ParameterType.py | StateArchivesOfNorthCarolina/docker_dmc | c387a4bcd91346bedf3a4c4f242fb7f35d5a81c1 | [
"MIT"
] | 1 | 2018-11-23T17:04:52.000Z | 2018-11-23T17:04:52.000Z | tomes_darcmail/lib/eaxs/ParameterType.py | StateArchivesOfNorthCarolina/docker_dmc | c387a4bcd91346bedf3a4c4f242fb7f35d5a81c1 | [
"MIT"
] | null | null | null | #############################################################
# 2016-09-26: ParameterType.py
# Author: Jeremy M. Gibson (State Archives of North Carolina)
#
# Description: Implementation of the parameter-type
##############################################################
| 29.676471 | 62 | 0.526264 | #############################################################
# 2016-09-26: ParameterType.py
# Author: Jeremy M. Gibson (State Archives of North Carolina)
#
# Description: Implementation of the parameter-type
##############################################################
from lxml.ElementInclude import etree
class Pa... | 0 | 0 | 0 | 676 | 0 | 0 | 0 | 16 | 45 |
b494a8c94ded6c88c28d5c79277bc50ba9d3062e | 78 | py | Python | models.py | KG5321/aiir_server | 5152d9fc43165f96ec7a4ef11c58f98af938314e | [
"MIT"
] | null | null | null | models.py | KG5321/aiir_server | 5152d9fc43165f96ec7a4ef11c58f98af938314e | [
"MIT"
] | null | null | null | models.py | KG5321/aiir_server | 5152d9fc43165f96ec7a4ef11c58f98af938314e | [
"MIT"
] | null | null | null | #from server import db
#class User(db.Model):
# __tablename__ = 'users'
| 11.142857 | 28 | 0.666667 | #from server import db
#class User(db.Model):
# __tablename__ = 'users'
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e30ecab5bdfb66af55e6a96d71eae30038b881d6 | 2,633 | py | Python | main.py | Rishav-12/PyPaint | f089b076ebb0fec25940fadbf7f0ec04ffc08c8a | [
"MIT"
] | null | null | null | main.py | Rishav-12/PyPaint | f089b076ebb0fec25940fadbf7f0ec04ffc08c8a | [
"MIT"
] | null | null | null | main.py | Rishav-12/PyPaint | f089b076ebb0fec25940fadbf7f0ec04ffc08c8a | [
"MIT"
] | null | null | null | import pygame
pygame.init()
ROWS = 45
COLS = 50
SQUARE_SIZE = 8
WIDTH, HEIGHT = 400, 400
win = pygame.display.set_mode((WIDTH, HEIGHT))
win.fill("white")
pygame.display.set_caption("PyPaint")
COLORS = ["red", "green", "blue", "yellow", "purple", "black"]
drawing_color = COLORS[5]
grid_squares = []
buttons = []
c... | 27.14433 | 101 | 0.659704 | import pygame
pygame.init()
class GridSquare:
def __init__(self, left, top, width, height):
self.rect = pygame.Rect(left, top, width, height)
self.color = "white"
def draw(self, window):
pygame.draw.rect(window, self.color, self.rect)
class ColorButton:
def __init__(self, left, to... | 0 | 0 | 0 | 440 | 0 | 384 | 0 | 0 | 138 |
a059f0453b19080525868db8bb2d3803e22fa1c6 | 1,913 | py | Python | tests/test_s3.py | unj-inovacao/tucuxi | 104b1f178b38dcc625bd64643c0986a1cfee8f53 | [
"MIT"
] | null | null | null | tests/test_s3.py | unj-inovacao/tucuxi | 104b1f178b38dcc625bd64643c0986a1cfee8f53 | [
"MIT"
] | 7 | 2020-05-28T19:10:01.000Z | 2020-08-14T17:34:13.000Z | tests/test_s3.py | unj-inovacao/tucuxi | 104b1f178b38dcc625bd64643c0986a1cfee8f53 | [
"MIT"
] | null | null | null | """Tests for the tucuxi.s3 Module using some fixtures from conftest.py"""
import logging
from typing import Dict
from typing import List
from tucuxi import S3
logger = logging.getLogger(__name__)
def test_set_get_object(s3_name: str, objs: List[Dict[str, str]]) -> None:
"""[summary]
Args:
s3_name (... | 26.569444 | 79 | 0.606377 | """Tests for the tucuxi.s3 Module using some fixtures from conftest.py"""
import logging
from typing import Dict
from typing import List
from tucuxi import S3
logger = logging.getLogger(__name__)
def test_set_get_object(s3_name: str, objs: List[Dict[str, str]]) -> None:
"""[summary]
Args:
s3_name (... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a0b100048d88ef4f6ebe6954f2ce7217f8c1436a | 150 | py | Python | create_db.py | forestmonster/flaskr-tdd | 1891fb165602c135e1332200d75a6008c2d4e543 | [
"MIT"
] | null | null | null | create_db.py | forestmonster/flaskr-tdd | 1891fb165602c135e1332200d75a6008c2d4e543 | [
"MIT"
] | null | null | null | create_db.py | forestmonster/flaskr-tdd | 1891fb165602c135e1332200d75a6008c2d4e543 | [
"MIT"
] | null | null | null | from app import db
# Create the database, and the table within.
db.create_all()
# Commit the changes.
db.session.commit()
| 16.666667 | 44 | 0.76 | from app import db
from models import Flaskr
# Create the database, and the table within.
db.create_all()
# Commit the changes.
db.session.commit()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 22 |
81f40ab41f543f19fa7eaf47b7696d80cc6e647c | 1,277 | py | Python | src/encoded/tests/test_reports_decorators.py | procha2/encoded | e9f122362b71f3b8641023b8d2d5ad531d3484b7 | [
"MIT"
] | 102 | 2015-05-20T01:17:43.000Z | 2022-03-07T06:03:55.000Z | src/encoded/tests/test_reports_decorators.py | procha2/encoded | e9f122362b71f3b8641023b8d2d5ad531d3484b7 | [
"MIT"
] | 901 | 2015-01-07T23:11:57.000Z | 2022-03-18T13:56:12.000Z | src/encoded/tests/test_reports_decorators.py | procha2/encoded | e9f122362b71f3b8641023b8d2d5ad531d3484b7 | [
"MIT"
] | 65 | 2015-02-06T23:00:26.000Z | 2022-01-22T07:58:44.000Z | import pytest
pytestmark = [
pytest.mark.indexing,
pytest.mark.usefixtures('index_workbook'),
]
| 29.022727 | 77 | 0.723571 | import pytest
from encoded.tests.features.conftest import app, app_settings, index_workbook
from pyramid.exceptions import HTTPBadRequest
pytestmark = [
pytest.mark.indexing,
pytest.mark.usefixtures('index_workbook'),
]
def test_reports_decorators_allowed_types_decorator_raises_error():
from encoded.r... | 0 | 61 | 0 | 62 | 0 | 850 | 0 | 80 | 114 |
b5d5243a4213906b3a0fc69cf15b23bfb0ebf84e | 2,713 | py | Python | dataset.py | entn-at/LightSpeech | 48250fbcede4b258ba13ab17e3e83afc5fe85a01 | [
"MIT"
] | 1 | 2021-09-22T01:30:05.000Z | 2021-09-22T01:30:05.000Z | dataset.py | entn-at/LightSpeech | 48250fbcede4b258ba13ab17e3e83afc5fe85a01 | [
"MIT"
] | null | null | null | dataset.py | entn-at/LightSpeech | 48250fbcede4b258ba13ab17e3e83afc5fe85a01 | [
"MIT"
] | 1 | 2021-09-22T01:32:06.000Z | 2021-09-22T01:32:06.000Z | import torch
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
| 28.861702 | 74 | 0.63509 | import torch
from torch.nn import functional as F
from torch.utils.data import Dataset, DataLoader
import numpy as np
import math
import os
import Audio
from text import text_to_sequence
from utils import process_text, pad_1D, pad_2D
import hparams
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu'... | 0 | 0 | 0 | 954 | 0 | 1,365 | 0 | 38 | 269 |
d2d095c48a428f426d6c686a462eac3b84968dc2 | 4,170 | py | Python | aspc/sagelist/models.py | aspc/mainsite | a6ccee0bb921147b7f630d65e01371e451aa3c54 | [
"MIT"
] | 8 | 2015-09-27T07:57:32.000Z | 2018-10-28T06:08:40.000Z | aspc/sagelist/models.py | aspc/mainsite | a6ccee0bb921147b7f630d65e01371e451aa3c54 | [
"MIT"
] | 132 | 2015-01-17T01:22:09.000Z | 2018-11-13T22:05:32.000Z | aspc/sagelist/models.py | aspc/mainsite | a6ccee0bb921147b7f630d65e01371e451aa3c54 | [
"MIT"
] | 20 | 2015-01-16T04:32:30.000Z | 2018-09-03T22:55:05.000Z | from amazon.api import AmazonAPI
from aspc.settings import AMAZON_ACCESS_KEY, AMAZON_SECRET_KEY, AMAZON_ASSOC_TAG
import logging
logger = logging.getLogger(__name__)
amazon = AmazonAPI(AMAZON_ACCESS_KEY, AMAZON_SECRET_KEY, AMAZON_ASSOC_TAG) | 35.948276 | 99 | 0.671223 | from django.db import models
from django.contrib.auth.models import User
from aspc.activityfeed.signals import new_activity, delete_activity
from aspc.courses.models import Course
from amazon.api import AmazonAPI
import datetime
from aspc.settings import AMAZON_ACCESS_KEY, AMAZON_SECRET_KEY, AMAZON_ASSOC_TAG
import jso... | 0 | 169 | 0 | 3,529 | 0 | 0 | 0 | 76 | 155 |
f71aeff53f61023328ab2b142760b44cd1843c8c | 6,750 | py | Python | tests/test_etdrk4fxcy.py | liuyxpp/chebpy | 05a9492d0d78591a39923e4a85a0f24bcc79ae4f | [
"BSD-3-Clause"
] | null | null | null | tests/test_etdrk4fxcy.py | liuyxpp/chebpy | 05a9492d0d78591a39923e4a85a0f24bcc79ae4f | [
"BSD-3-Clause"
] | null | null | null | tests/test_etdrk4fxcy.py | liuyxpp/chebpy | 05a9492d0d78591a39923e4a85a0f24bcc79ae4f | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#/usr/bin/env python
import numpy as np
import matplotlib.pylab as plt
from timer import Timer
from chebpy import ETDRK4FxCy, ETDRK4FxCy2, BC, ETDRK4
from chebpy import ROBIN, DIRICHLET
def test_etdrk4fxcy():
'''
The test function is
u = e^[f(x,y) - t]
where
... | 30.681818 | 79 | 0.493333 | # -*- coding: utf-8 -*-
#/usr/bin/env python
import numpy as np
import matplotlib.pylab as plt
from timer import Timer
from chebpy import ETDRK4FxCy, ETDRK4FxCy2, BC, ETDRK4
from chebpy import ROBIN, DIRICHLET
def test_etdrk4fxcy():
'''
The test function is
u = e^[f(x,y) - t]
where
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
442b315bc6544dd388dc33f7f4ea1f98ba501c4d | 262 | py | Python | cracking_the_coding_interview_qs/1.3/urlify.py | angelusualle/algorithms | 86286a49db2a755bc57330cb455bcbd8241ea6be | [
"Apache-2.0"
] | null | null | null | cracking_the_coding_interview_qs/1.3/urlify.py | angelusualle/algorithms | 86286a49db2a755bc57330cb455bcbd8241ea6be | [
"Apache-2.0"
] | null | null | null | cracking_the_coding_interview_qs/1.3/urlify.py | angelusualle/algorithms | 86286a49db2a755bc57330cb455bcbd8241ea6be | [
"Apache-2.0"
] | null | null | null | # O(n) time, O(n) space | 23.818182 | 37 | 0.492366 | # O(n) time, O(n) space
def urlify(url, length):
urlified_string = ""
i = 0
while i < length:
if url[i] == " ":
urlified_string += "%20"
else:
urlified_string += url[i]
i += 1
return urlified_string | 0 | 0 | 0 | 0 | 0 | 217 | 0 | 0 | 22 |
3144e0f1f0ae2498211769135d5bf19b7308b07b | 304 | py | Python | Extension Attributes/ActiveDirectoryComputerPasswordChangeInterval.py | hhorn76/JAMF | 35b81f305ba58f07c133693deb7d3a25fc82ed4f | [
"MIT"
] | 33 | 2018-11-16T09:20:22.000Z | 2022-03-15T04:16:03.000Z | Extension Attributes/ActiveDirectoryComputerPasswordChangeInterval.py | hhorn76/JAMF | 35b81f305ba58f07c133693deb7d3a25fc82ed4f | [
"MIT"
] | 1 | 2019-07-28T13:50:29.000Z | 2019-11-11T10:47:20.000Z | Extension Attributes/ActiveDirectoryComputerPasswordChangeInterval.py | hhorn76/JAMF | 35b81f305ba58f07c133693deb7d3a25fc82ed4f | [
"MIT"
] | 6 | 2019-05-07T05:28:45.000Z | 2021-12-09T18:01:28.000Z | #!/usr/bin/python
# Written by Heiko 2019.02.07
# Will return the password change interval from Active Directory
import subprocess
result = subprocess.check_output( 'dsconfigad -show | grep \'Password change interval\' | awk \'{print $5}\' ', shell=True).strip()
print '<result>' + result + '</result>' | 38 | 131 | 0.717105 | #!/usr/bin/python
# Written by Heiko 2019.02.07
# Will return the password change interval from Active Directory
import subprocess
result = subprocess.check_output( 'dsconfigad -show | grep \'Password change interval\' | awk \'{print $5}\' ', shell=True).strip()
print '<result>' + result + '</result>' | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
73337f13b10e651882b6e4183226231bc29ca29f | 2,694 | py | Python | furiate.py | veox/furiate | 216aae2a81e9fa1135ba4860f915a9a418bc17a4 | [
"MIT"
] | 2 | 2018-03-23T19:15:55.000Z | 2022-03-15T00:18:34.000Z | furiate.py | veox/furiate | 216aae2a81e9fa1135ba4860f915a9a418bc17a4 | [
"MIT"
] | null | null | null | furiate.py | veox/furiate | 216aae2a81e9fa1135ba4860f915a9a418bc17a4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import getpass
import time
from web3 import Web3, HTTPProvider
from eth_account import Account # will use directly instead of through web3 provider
from schedule import chainids, txs
print(len(txs), 'transactions in schedule.')
with open('infura.key') as keyfile:
infurakey = keyfile.read(... | 32.853659 | 101 | 0.646251 | #!/usr/bin/env python
import getpass
import time
from web3 import Web3, HTTPProvider
from eth_account import Account # will use directly instead of through web3 provider
from schedule import chainids, txs
print(len(txs), 'transactions in schedule.')
with open('infura.key') as keyfile:
infurakey = keyfile.read(... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
dcaa940af3143f7277cd5eb8ee34653746c22c71 | 450 | py | Python | psycopg2/scripts/makedocs.py | moibenko/enstore | 6f2ff5b67ff73872a9e68f2a68b0bdaa70cef9b9 | [
"Intel",
"Unlicense"
] | 4 | 2021-10-17T11:17:59.000Z | 2022-02-28T16:58:40.000Z | psycopg2/scripts/makedocs.py | moibenko/enstore | 6f2ff5b67ff73872a9e68f2a68b0bdaa70cef9b9 | [
"Intel",
"Unlicense"
] | 17 | 2021-10-05T21:44:06.000Z | 2022-03-31T16:58:40.000Z | psycopg2/scripts/makedocs.py | moibenko/enstore | 6f2ff5b67ff73872a9e68f2a68b0bdaa70cef9b9 | [
"Intel",
"Unlicense"
] | 8 | 2021-09-02T18:55:49.000Z | 2022-03-09T21:05:28.000Z | #!/usr/bin/env python
"""Build documentation and api."""
import os
EPYDOC = "python c:/programmi/python23/scripts/epydoc.py"
PSYCOPG = "c:/programmi/python23/lib/site-packages/psycopg2"
os.system("python ext2html.py ../doc/extensions.rst > ../doc/extensions.html")
os.system("%s "
"-o ../doc/api "... | 28.125 | 79 | 0.6 | #!/usr/bin/env python
"""Build documentation and api."""
import os
EPYDOC = "python c:/programmi/python23/scripts/epydoc.py"
PSYCOPG = "c:/programmi/python23/lib/site-packages/psycopg2"
os.system("python ext2html.py ../doc/extensions.rst > ../doc/extensions.html")
os.system("%s "
"-o ../doc/api "... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
940455745fde1d3722c8e9e8897afafdd7e27380 | 1,705 | py | Python | migration/couch/release_6/2.removing_max_length_constraint_in_deletion_form_model.py | ICT4H/dcs-web | fb0f53fad4401cfac1c1789ff28b9d5bda40c975 | [
"Apache-2.0"
] | 1 | 2015-11-02T09:11:12.000Z | 2015-11-02T09:11:12.000Z | migration/couch/release_6/2.removing_max_length_constraint_in_deletion_form_model.py | ICT4H/dcs-web | fb0f53fad4401cfac1c1789ff28b9d5bda40c975 | [
"Apache-2.0"
] | null | null | null | migration/couch/release_6/2.removing_max_length_constraint_in_deletion_form_model.py | ICT4H/dcs-web | fb0f53fad4401cfac1c1789ff28b9d5bda40c975 | [
"Apache-2.0"
] | null | null | null | from migration.couch.utils import configure_csv
log_file = open('migration_release_6_2.log', 'a')
SERVER = 'http://localhost:5984'
configure_csv('dbs_migrated_release_6_2.csv')
db_names = all_db_names(SERVER)
migrate_story_1924() | 34.1 | 83 | 0.719062 | import traceback
import urllib2
from mangrove.contrib.deletion import ENTITY_DELETION_FORM_CODE
from mangrove.datastore.database import get_db_manager
from mangrove.form_model.form_model import get_form_model_by_code
from datetime import datetime
from migration.couch.utils import configure_csv, mark_as_completed, shoul... | 0 | 0 | 0 | 0 | 0 | 1,095 | 0 | 151 | 224 |
e996c3924b4c8fd54b2995fd54bcb58d2946c6c5 | 5,464 | py | Python | pytorch_seed_rl/eval.py | mjanschek/pytorch_seed_rl | bd7415deb8bbb04b11b92439eea0fc2a19bb029d | [
"Apache-2.0"
] | 9 | 2020-06-10T07:17:39.000Z | 2022-01-25T12:09:03.000Z | pytorch_seed_rl/eval.py | mjanschek/pytorch_seed_rl | bd7415deb8bbb04b11b92439eea0fc2a19bb029d | [
"Apache-2.0"
] | null | null | null | pytorch_seed_rl/eval.py | mjanschek/pytorch_seed_rl | bd7415deb8bbb04b11b92439eea0fc2a19bb029d | [
"Apache-2.0"
] | 3 | 2021-02-25T07:19:29.000Z | 2021-07-21T02:15:44.000Z | # Copyright 2020 Michael Janschek
#
# 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 writ... | 33.937888 | 96 | 0.599012 | # Copyright 2020 Michael Janschek
#
# 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 writ... | 0 | 0 | 0 | 0 | 0 | 227 | 0 | 0 | 23 |
5ff2bd52646b91e7f66767014ce247899091949e | 4,293 | py | Python | maddpg.py | zhuohann/MADDPG | 468c9802808fc4783a858238dfe3085510ddddab | [
"MIT"
] | null | null | null | maddpg.py | zhuohann/MADDPG | 468c9802808fc4783a858238dfe3085510ddddab | [
"MIT"
] | 2 | 2021-03-19T02:21:43.000Z | 2022-01-13T01:26:44.000Z | maddpg.py | zhuohann/MADDPG | 468c9802808fc4783a858238dfe3085510ddddab | [
"MIT"
] | null | null | null | # main code that contains the neural network setup
# policy + critic updates
# see ddpg.py for other details in the network
#device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
device = 'cpu'
| 39.027273 | 124 | 0.638947 | # main code that contains the neural network setup
# policy + critic updates
# see ddpg.py for other details in the network
from ddpg import DDPGAgent
import torch.nn.functional as F
import torch
from utilities import soft_update, transpose_to_tensor, transpose_list
import numpy as np
#device = torch.device("cuda" if ... | 0 | 0 | 0 | 3,852 | 0 | 0 | 0 | 52 | 134 |
ca24048f18fef0763e85fb640eb32f0edb9cebac | 5,290 | py | Python | torchrecipes/audio/source_separation/datamodule/librimix.py | nateanl/recipes-1 | 3b46a7479508608f73b6f24deffdc8fcffd25ee5 | [
"BSD-3-Clause"
] | null | null | null | torchrecipes/audio/source_separation/datamodule/librimix.py | nateanl/recipes-1 | 3b46a7479508608f73b6f24deffdc8fcffd25ee5 | [
"BSD-3-Clause"
] | null | null | null | torchrecipes/audio/source_separation/datamodule/librimix.py | nateanl/recipes-1 | 3b46a7479508608f73b6f24deffdc8fcffd25ee5 | [
"BSD-3-Clause"
] | null | null | null | from hydra.core.config_store import ConfigStore
cs = ConfigStore().instance()
cs.store(
group="schema/datamodule",
name="librimix_datamodule_conf",
node=LibriMixDataModuleConf,
package="datamodule",
)
| 32.654321 | 103 | 0.578828 | from dataclasses import dataclass
from typing import (
Optional,
)
import pytorch_lightning as pl
from hydra.core.config_store import ConfigStore
from omegaconf import MISSING
from torch.utils.data import DataLoader
from torchaudio.datasets import LibriMix
from torchrecipes.core.conf import DataModuleConf
from tor... | 0 | 912 | 0 | 3,684 | 0 | 0 | 0 | 205 | 268 |
47ae39801f682d5dfcd382c59b1674a479d7098b | 538 | py | Python | src/euler_python_package/euler_python/easiest/p020.py | wilsonify/euler | 5214b776175e6d76a7c6d8915d0e062d189d9b79 | [
"MIT"
] | null | null | null | src/euler_python_package/euler_python/easiest/p020.py | wilsonify/euler | 5214b776175e6d76a7c6d8915d0e062d189d9b79 | [
"MIT"
] | null | null | null | src/euler_python_package/euler_python/easiest/p020.py | wilsonify/euler | 5214b776175e6d76a7c6d8915d0e062d189d9b79 | [
"MIT"
] | null | null | null | import math
# We do a straightforward computation thanks to Python's built-in arbitrary precision integer type.
def problem020():
"""
n! means n (n 1) ... 3 2 1
For example, 10! = 10 9 ... 3 2 1 = 3628800,
and the sum of the digits in the number 10! is 3 + 6 + 2 + 8 + 8 + 0 + 0 =
... | 21.52 | 99 | 0.557621 | import math
# We do a straightforward computation thanks to Python's built-in arbitrary precision integer type.
def problem020():
"""
n! means n × (n − 1) × ... × 3 × 2 × 1
For example, 10! = 10 × 9 × ... × 3 × 2 × 1 = 3628800,
and the sum of the digits in the number 10! is 3 + 6 + 2 + 8 + 8 ... | 23 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bace4d0c2778a815c0bb09eb4a15f788ed5f6add | 4,271 | py | Python | server/danesfield_server/algorithms/run_metrics.py | Kitware/Danesfield-App | 70d9f5c7c5af2ca92d274c99175783ea43087592 | [
"Apache-2.0"
] | 25 | 2018-12-19T08:45:13.000Z | 2022-03-27T14:20:42.000Z | server/danesfield_server/algorithms/run_metrics.py | Kitware/Danesfield-App | 70d9f5c7c5af2ca92d274c99175783ea43087592 | [
"Apache-2.0"
] | 10 | 2018-11-30T22:21:45.000Z | 2022-01-21T19:43:47.000Z | server/danesfield_server/algorithms/run_metrics.py | Kitware/Danesfield-App | 70d9f5c7c5af2ca92d274c99175783ea43087592 | [
"Apache-2.0"
] | 7 | 2018-12-03T21:42:53.000Z | 2021-09-07T17:09:10.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware Inc. and Contributors
# Distributed under the Apache License, 2.0 (apache.org/licenses/LICENSE-2.0)
# See accompanying Copyright.txt and LICENSE files for details
##########... | 30.949275 | 79 | 0.599625 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware Inc. and Contributors
# Distributed under the Apache License, 2.0 (apache.org/licenses/LICENSE-2.0)
# See accompanying Copyright.txt and LICENSE files for details
##########... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 34 | 0 |
9108793bcfd9000ae19392aed30396e7651c7e74 | 2,193 | py | Python | setup.py | LongJohnCoder/amazon-scraper-python | 41e5bd08b92a617a09a65938e1b783712ee2c220 | [
"MIT"
] | 1 | 2020-04-19T19:55:11.000Z | 2020-04-19T19:55:11.000Z | setup.py | LongJohnCoder/amazon-scraper-python | 41e5bd08b92a617a09a65938e1b783712ee2c220 | [
"MIT"
] | null | null | null | setup.py | LongJohnCoder/amazon-scraper-python | 41e5bd08b92a617a09a65938e1b783712ee2c220 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from setuptools import setup
try: # Pour pip >= 10
from pip._internal.req import parse_requirements
except ImportError: # For pip <= 9
from pip.req import parse_requirements
# Based on http://peterdowns.com/posts/first-time-with-pypi.html
__version__ = '0.0.5' # Should match with __... | 33.227273 | 70 | 0.687187 | # -*- coding: utf-8 -*-
from setuptools import setup
try: # Pour pip >= 10
from pip._internal.req import parse_requirements
except ImportError: # For pip <= 9
from pip.req import parse_requirements
# Based on http://peterdowns.com/posts/first-time-with-pypi.html
__version__ = '0.0.5' # Should match with __... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7eefa56f60ffa41ef7e8f0cd2ba54a70e563451b | 3,728 | py | Python | authors/apps/profiles/tests/test_profile.py | andela-gad/Ah-backend-aquaman | 29cf560063171c2bb8c8aed1ff36436acbc47bc9 | [
"BSD-3-Clause"
] | 3 | 2021-02-20T15:21:33.000Z | 2021-08-20T10:23:08.000Z | authors/apps/profiles/tests/test_profile.py | andela-gad/Ah-backend-aquaman | 29cf560063171c2bb8c8aed1ff36436acbc47bc9 | [
"BSD-3-Clause"
] | 130 | 2019-11-07T02:35:18.000Z | 2021-07-30T02:17:11.000Z | authors/apps/profiles/tests/test_profile.py | CryceTruly/Ah-backend-aquaman | 29cf560063171c2bb8c8aed1ff36436acbc47bc9 | [
"BSD-3-Clause"
] | 6 | 2019-06-29T12:09:37.000Z | 2020-03-06T07:02:55.000Z | """
Test profiles app
"""
| 43.348837 | 98 | 0.690719 | """
Test profiles app
"""
from django.urls import reverse
from authors.apps.profiles.tests.test_base import BaseTestCase
from .test_data import (new_user, update_profile)
class TestProfile(BaseTestCase):
"""Handles tests for the user profile feature/app"""
def test_get_user_profile(self):
"""This t... | 0 | 0 | 0 | 3,531 | 0 | 0 | 0 | 79 | 91 |
479f1f9aa1c23ac909701fa9728139d1a8d79db7 | 1,175 | py | Python | Easy/922.SortArrayByParityII(List).py | YuriSpiridonov/LeetCode | 2dfcc9c71466ffa2ebc1c89e461ddfca92e2e781 | [
"MIT"
] | 39 | 2020-07-04T11:15:13.000Z | 2022-02-04T22:33:42.000Z | Easy/922.SortArrayByParityII(List).py | YuriSpiridonov/LeetCode | 2dfcc9c71466ffa2ebc1c89e461ddfca92e2e781 | [
"MIT"
] | 1 | 2020-07-15T11:53:37.000Z | 2020-07-15T11:53:37.000Z | Easy/922.SortArrayByParityII(List).py | YuriSpiridonov/LeetCode | 2dfcc9c71466ffa2ebc1c89e461ddfca92e2e781 | [
"MIT"
] | 20 | 2020-07-14T19:12:53.000Z | 2022-03-02T06:28:17.000Z | """
Given an array A of non-negative integers, half of the integers in A are
odd, and half of the integers are even.
Sort the array so that whenever A[i] is odd, i is odd; and whenever A[i]
is even, i is even.
You may return any answer array that satisfies this condition.
Example:
Input: ... | 29.375 | 99 | 0.55234 | """
Given an array A of non-negative integers, half of the integers in A are
odd, and half of the integers are even.
Sort the array so that whenever A[i] is odd, i is odd; and whenever A[i]
is even, i is even.
You may return any answer array that satisfies this condition.
Example:
Input: ... | 0 | 0 | 0 | 330 | 0 | 0 | 0 | 0 | 23 |
553078708ac997a7973f97e1f1d54f9592e5dbc7 | 551 | py | Python | DB/PySQLTest2.py | mmihir16/Final-Year-Project | 18ca4f4f29b1fafb6dcd86d262836256acf107f1 | [
"MIT"
] | 1 | 2021-03-11T17:41:44.000Z | 2021-03-11T17:41:44.000Z | DB/PySQLTest2.py | Hemantr05/Graph-based-keyword-extraction | dd1ab03b6549ff166f8a05f763359fa29deaf61c | [
"MIT"
] | 6 | 2021-03-31T19:50:38.000Z | 2022-03-12T00:25:43.000Z | DB/PySQLTest2.py | Hemantr05/Graph-based-keyword-extraction | dd1ab03b6549ff166f8a05f763359fa29deaf61c | [
"MIT"
] | null | null | null | import mysql.connector
mydb = mysql.connector.connect(
host="localhost",
user="root",
passwd="root",
auth_plugin='mysql_native_password',
database='project'
)
print(mydb)
mycursor = mydb.cursor()
thisdict = {
"brand": 6,
"model": 8,
"year": 10
}
print(thisdict)
for i in thisdic... | 17.21875 | 62 | 0.6098 | import mysql.connector
mydb = mysql.connector.connect(
host="localhost",
user="root",
passwd="root",
auth_plugin='mysql_native_password',
database='project'
)
print(mydb)
mycursor = mydb.cursor()
thisdict = {
"brand": 6,
"model": 8,
"year": 10
}
print(thisdict)
for i in thisdic... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
27578380185c70062f34e66e5e00e695a466c432 | 417 | py | Python | browser/user_agent.py | Shiro-Nakamura/Hacking | 748d3d3591209e79600a12f317cddc81e1e05cf9 | [
"MIT"
] | null | null | null | browser/user_agent.py | Shiro-Nakamura/Hacking | 748d3d3591209e79600a12f317cddc81e1e05cf9 | [
"MIT"
] | null | null | null | browser/user_agent.py | Shiro-Nakamura/Hacking | 748d3d3591209e79600a12f317cddc81e1e05cf9 | [
"MIT"
] | null | null | null |
if __name__=="__main__":
main() | 26.0625 | 71 | 0.654676 | import mechanize
def callWithUserAgent(url, userAgent):
browser = mechanize.Browser()
browser.addheaders = userAgent
page = browser.open(url)
source_code = page.read()
print source_code
def main():
url = "http://whatsmyuseragent.org"
userAgent = [('User-agent', 'Opera/9.26 (Windows ... | 0 | 0 | 0 | 0 | 0 | 307 | 0 | -5 | 75 |
96511991fec4352119bf2856b8ae739fd5e8ed3b | 1,245 | py | Python | pymagic/constants.py | harshavardhana/bungee-plugins | d1042b4fd3654890d67393ed65e0064bb30086f8 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | pymagic/constants.py | harshavardhana/bungee-plugins | d1042b4fd3654890d67393ed65e0064bb30086f8 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-03-05T13:16:30.000Z | 2021-03-05T15:20:22.000Z | pymagic/constants.py | harshavardhana/bungee-plugins | d1042b4fd3654890d67393ed65e0064bb30086f8 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
## STOLEN from libmagic man page
MAGIC_NONE = 0x000000 # No flags
MAGIC_DEBUG = 0x000001 # Turn on debugging
MAGIC_SYMLINK = 0x000002 # Follow symlinks
MAGIC_COMPRESS = 0x000004 # Check inside compressed files
MAGIC_DEVICES = 0x000008 # Look at the contents of devices
MAGIC_MIME = 0x000010... | 27.666667 | 69 | 0.786345 | # -*- coding: utf-8 -*-
## STOLEN from libmagic man page
MAGIC_NONE = 0x000000 # No flags
MAGIC_DEBUG = 0x000001 # Turn on debugging
MAGIC_SYMLINK = 0x000002 # Follow symlinks
MAGIC_COMPRESS = 0x000004 # Check inside compressed files
MAGIC_DEVICES = 0x000008 # Look at the contents of devices
MAGIC_MIME = 0x000010... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e679deb964ab3881c46a133f3a394bbc101d75e7 | 1,362 | py | Python | tests/test_synth.py | bilardi/aws-cdk-test-synth | 9117d97ccdcc4331e8cc90dd4ccd205895b62c70 | [
"MIT"
] | 3 | 2021-02-22T17:58:59.000Z | 2021-06-16T11:20:25.000Z | tests/test_synth.py | bilardi/aws-cdk-test-synth | 9117d97ccdcc4331e8cc90dd4ccd205895b62c70 | [
"MIT"
] | null | null | null | tests/test_synth.py | bilardi/aws-cdk-test-synth | 9117d97ccdcc4331e8cc90dd4ccd205895b62c70 | [
"MIT"
] | 1 | 2021-06-30T18:24:40.000Z | 2021-06-30T18:24:40.000Z | import unittest
if __name__ == '__main__':
unittest.main()
| 54.48 | 185 | 0.778267 | import unittest
from aws_cdk_test_synth.test_synth import TestSynth
class TestService(unittest.TestCase):
t = None
def __init__(self, *args, **kwargs):
self.t = TestSynth('tests/s3.yaml')
unittest.TestCase.__init__(self, *args, **kwargs)
def test_remove_asset_parameter_identifier(self):
... | 0 | 0 | 0 | 1,223 | 0 | 0 | 0 | 30 | 45 |
d1bf04974e757d204fd0427f78d60e4f4bafa15e | 7,687 | py | Python | twitterproj/jobmanager.py | chebee7i/twitter | ec1d772c3ef7d2288ac8051efb8637378f3ec195 | [
"Unlicense"
] | 2 | 2018-12-17T02:47:19.000Z | 2021-02-02T05:39:45.000Z | twitterproj/jobmanager.py | chebee7i/twitter | ec1d772c3ef7d2288ac8051efb8637378f3ec195 | [
"Unlicense"
] | null | null | null | twitterproj/jobmanager.py | chebee7i/twitter | ec1d772c3ef7d2288ac8051efb8637378f3ec195 | [
"Unlicense"
] | null | null | null | #! -*- encoding: utf-8 -*-
"""
Some simple helper scripts to aid in distributed job management.
"""
from itertools import izip_longest
#dbname = 'fullsupport_temp.db'
#conn = sqlite3.connect(dbname)
#c = conn.cursor()
#c.execute("""
# CREATE TABLE IF NOT EXISTS machines (n int, k int, id int);
#""")
FREE, RESERVE... | 30.995968 | 84 | 0.52244 | #! -*- encoding: utf-8 -*-
"""
Some simple helper scripts to aid in distributed job management.
"""
from multiprocessing import Process
from itertools import islice, product, izip_longest
import sqlite3
import datetime
import sys
import time
import numpy as np
#dbname = 'fullsupport_temp.db'
#conn = sqlite3.connect... | 0 | 0 | 0 | 6,757 | 0 | 53 | 0 | -6 | 180 |
0d538a29dcb5ff285f57b4cda5cae21ced71419f | 864 | py | Python | programming/python/py.test/conftest.py | 4qu3l3c4r4/Automation-Test-Knowledge-Base | 7f6f1ba374d9277647bde6a7feaa6a6e8b53ae8f | [
"MIT"
] | 191 | 2015-01-11T10:47:03.000Z | 2022-03-14T09:14:50.000Z | programming/python/py.test/conftest.py | TATJAVAPavelKlindziuk/at.info-knowledge-base | 7f6f1ba374d9277647bde6a7feaa6a6e8b53ae8f | [
"MIT"
] | 2 | 2021-06-04T02:10:01.000Z | 2022-03-31T20:21:06.000Z | programming/python/py.test/conftest.py | TATJAVAPavelKlindziuk/at.info-knowledge-base | 7f6f1ba374d9277647bde6a7feaa6a6e8b53ae8f | [
"MIT"
] | 175 | 2015-01-09T16:45:09.000Z | 2022-02-12T23:54:23.000Z | import logging
logging.basicConfig(filename="log.txt", filemode="w")
log = logging.getLogger()
log.setLevel(logging.DEBUG)
handler = logging.StreamHandler()
handler.setLevel(logging.DEBUG)
formatter = logging.Formatter("%(levelname)s - %(message)s")
handler.setFormatter(formatter)
log.addHandler(handler)
| 26.181818 | 60 | 0.743056 | import pytest
import logging
from multiprocessing.process import current_process
from threading import current_thread
import time
logging.basicConfig(filename="log.txt", filemode="w")
log = logging.getLogger()
log.setLevel(logging.DEBUG)
handler = logging.StreamHandler()
handler.setLevel(logging.DEBUG)
formatter = lo... | 0 | 0 | 0 | 0 | 0 | 371 | 0 | 27 | 157 |
038d2f3eed9d426f61bf79d9f496c7ff1201ae12 | 3,104 | py | Python | OOP_Quiz/test.py | HelloYeew/helloyeew-lab-computer-programming-i | 60b05072f32f23bab4a336b506ba7f66e52c045d | [
"MIT"
] | null | null | null | OOP_Quiz/test.py | HelloYeew/helloyeew-lab-computer-programming-i | 60b05072f32f23bab4a336b506ba7f66e52c045d | [
"MIT"
] | null | null | null | OOP_Quiz/test.py | HelloYeew/helloyeew-lab-computer-programming-i | 60b05072f32f23bab4a336b506ba7f66e52c045d | [
"MIT"
] | null | null | null | import time
# class App:
route = Route()
in_route = Bus()
while True:
main_input = input("(n)ew Route, (s)how, (c)hoose, (q)uit : ")
if main_input == "n":
route_name = input("Enter route name : ")
route.add_route(route_name)
for i in range(len(route.all_route)):
print(f"... | 26.305085 | 177 | 0.560889 | import time
class Route:
def __init__(self):
self.__all_route = []
@property
def all_route(self):
return self.__all_route
@all_route.setter
def all_route(self,name):
self.__all_route.append(name)
def add_route(self,name):
self.__all_route.append(name)
class B... | 0 | 403 | 0 | 986 | 0 | 21 | 0 | -10 | 91 |
9c625debeec4fbff9edbf94bffd5b78fdc507ec2 | 1,974 | py | Python | src/tidypy/tools/manifest.py | laundmo/tidypy | 3d08b4f95ed7c8827789222c9670a131cdf965b7 | [
"MIT"
] | 33 | 2018-03-13T21:30:51.000Z | 2022-01-17T02:14:59.000Z | src/tidypy/tools/manifest.py | laundmo/tidypy | 3d08b4f95ed7c8827789222c9670a131cdf965b7 | [
"MIT"
] | 89 | 2017-10-14T16:39:20.000Z | 2022-03-06T17:23:36.000Z | src/tidypy/tools/manifest.py | laundmo/tidypy | 3d08b4f95ed7c8827789222c9670a131cdf965b7 | [
"MIT"
] | 9 | 2018-05-17T16:11:12.000Z | 2021-09-15T01:48:16.000Z |
IGNORE_MSGS = (
'lists of files in version control and sdist match',
)
| 23.223529 | 75 | 0.554205 |
import os
import check_manifest
from .base import Tool, Issue
IGNORE_MSGS = (
'lists of files in version control and sdist match',
)
class CheckManifestIssue(Issue):
tool = 'manifest'
pylint_type = 'W'
class CheckManifestUI(check_manifest.UI):
def __init__(self, dirname):
super().__init... | 0 | 300 | 0 | 1,459 | 0 | 0 | 0 | -4 | 138 |
86a7b452d960dbca273863d9e07b1fc27e306fdf | 2,874 | py | Python | data/process_data.py | max87-arch/distaser-reponses-project | e7d719f32623ac95be75099c8c09d2a82682679c | [
"MIT"
] | null | null | null | data/process_data.py | max87-arch/distaser-reponses-project | e7d719f32623ac95be75099c8c09d2a82682679c | [
"MIT"
] | null | null | null | data/process_data.py | max87-arch/distaser-reponses-project | e7d719f32623ac95be75099c8c09d2a82682679c | [
"MIT"
] | null | null | null |
import pandas as pd
import sqlalchemy as sql
# Extract data
def load_data(messages_filepath, categories_filepath):
"""
the function creates two DateFrame from two input arguments, and it merges them in one DateFrame
:param messages_filepath: the path of messages CSV file
:param categories_filepath: t... | 34.214286 | 110 | 0.672234 | import sys
import pandas as pd
import sqlalchemy as sql
# Extract data
def load_data(messages_filepath, categories_filepath):
"""
the function creates two DateFrame from two input arguments, and it merges them in one DateFrame
:param messages_filepath: the path of messages CSV file
:param categories_... | 0 | 0 | 0 | 0 | 0 | 959 | 0 | -11 | 45 |
bc6b7b1dd123582c8c867d8046e4bc805b8b5f82 | 5,985 | py | Python | tests/unit/restapi/job/test_service.py | usnistgov/dioptra | 08a08e96c27787915bafc75a483431333e2c70ca | [
"CC-BY-4.0"
] | 14 | 2021-06-17T15:16:12.000Z | 2021-11-08T10:25:37.000Z | tests/unit/restapi/job/test_service.py | usnistgov/dioptra | 08a08e96c27787915bafc75a483431333e2c70ca | [
"CC-BY-4.0"
] | 7 | 2021-09-20T20:20:26.000Z | 2022-03-30T13:17:43.000Z | tests/unit/restapi/job/test_service.py | usnistgov/dioptra | 08a08e96c27787915bafc75a483431333e2c70ca | [
"CC-BY-4.0"
] | 4 | 2021-06-29T16:52:42.000Z | 2022-01-21T16:56:45.000Z | # This Software (Dioptra) is being made available as a public service by the
# National Institute of Standards and Technology (NIST), an Agency of the United
# States Department of Commerce. This software was developed in part by employees of
# NIST and in part by NIST contractors. Copyright in portions of this softwar... | 33.435754 | 86 | 0.700251 | # This Software (Dioptra) is being made available as a public service by the
# National Institute of Standards and Technology (NIST), an Agency of the United
# States Department of Commerce. This software was developed in part by employees of
# NIST and in part by NIST contractors. Copyright in portions of this softwar... | 0 | 3,701 | 0 | 0 | 0 | 333 | 0 | 263 | 449 |
a6064af612e9215c80adb42e0781e4f678ffc480 | 853 | py | Python | prime_numbers/benchmark.py | elbertcastaneda/benchmarks_scripts | 07f931b5e39b5d234087c0e755cd1da122946ff3 | [
"Apache-2.0"
] | 1 | 2018-10-26T02:57:59.000Z | 2018-10-26T02:57:59.000Z | prime_numbers/benchmark.py | elbertcastaneda/benchmarks_scripts | 07f931b5e39b5d234087c0e755cd1da122946ff3 | [
"Apache-2.0"
] | null | null | null | prime_numbers/benchmark.py | elbertcastaneda/benchmarks_scripts | 07f931b5e39b5d234087c0e755cd1da122946ff3 | [
"Apache-2.0"
] | null | null | null | import time
def get_primes7(n):
"""
standard optimized sieve algorithm to get a list of prime numbers
--- this is the function to compare your functions against! ---
"""
if n < 2: return []
if n == 2: return [2]
# do only odd numbers starting at 3
s = list(range(3, n+1, 2))
# n**0.... | 23.054054 | 69 | 0.506448 | import time
def get_primes7(n):
"""
standard optimized sieve algorithm to get a list of prime numbers
--- this is the function to compare your functions against! ---
"""
if n < 2: return []
if n == 2: return [2]
# do only odd numbers starting at 3
s = list(range(3, n+1, 2))
# n**0.... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2331ef0dece4777b7de60ca6c255915dd4becb8c | 5,084 | py | Python | app/frontend/main.py | tec-csf/TC3041-PF-Primavera-2019-equipo-12_real | 9b96d3e04cc2c384f6771d72b283e60b41b8491f | [
"Apache-2.0"
] | 1 | 2019-12-10T06:47:11.000Z | 2019-12-10T06:47:11.000Z | app/frontend/main.py | tec-csf/TC3041-PF-Primavera-2019-equipo-12_real | 9b96d3e04cc2c384f6771d72b283e60b41b8491f | [
"Apache-2.0"
] | null | null | null | app/frontend/main.py | tec-csf/TC3041-PF-Primavera-2019-equipo-12_real | 9b96d3e04cc2c384f6771d72b283e60b41b8491f | [
"Apache-2.0"
] | null | null | null | from flask_api import FlaskAPI
import os
import jinja2
''' para separar un string por espacios o comas '''
env = jinja2.Environment()
env.globals.update(zip=zip)
app = FlaskAPI(__name__)
app.jinja_env.filters['zip'] = zip
app.secret_key = "super secret key" # La llave para la sesion
APP_ROOT = os.path.dirname(os.pa... | 33.012987 | 154 | 0.590677 | from flask import Flask, request, redirect, url_for, render_template, session, jsonify
from flask_api import FlaskAPI, status, exceptions
from app.api import api
import cgi
import os
import jinja2
''' para separar un string por espacios o comas '''
import re
env = jinja2.Environment()
env.globals.update(zip=zip)
app... | 0 | 4,418 | 0 | 0 | 0 | 0 | 0 | 64 | 204 |
506ae77c821dcb1952063ff5cc75a80d34bc4089 | 474 | py | Python | moka/templates/pages/moka_success.py | harpiya/moka | 220c4501dc37cc8db8213f2275a071d7b5bc3f69 | [
"MIT"
] | null | null | null | moka/templates/pages/moka_success.py | harpiya/moka | 220c4501dc37cc8db8213f2275a071d7b5bc3f69 | [
"MIT"
] | null | null | null | moka/templates/pages/moka_success.py | harpiya/moka | 220c4501dc37cc8db8213f2275a071d7b5bc3f69 | [
"MIT"
] | null | null | null | # @Author: Saadettin Yasir AKEL <developer>
# @Date: 2019-01-20T18:00:40+03:00
# @Email: yasir@harpiya.com
# @Project: Harpiya Kurumsal Ynetim Sistemi
# @Filename: moka_success.py
# @Last modified by: developer
# @Last modified time: 2019-01-20T21:12:47+03:00
# @License: MIT License. See license.txt
# @Copyright: ... | 24.947368 | 48 | 0.753165 | # @Author: Saadettin Yasir AKEL <developer>
# @Date: 2019-01-20T18:00:40+03:00
# @Email: yasir@harpiya.com
# @Project: Harpiya Kurumsal Yönetim Sistemi
# @Filename: moka_success.py
# @Last modified by: developer
# @Last modified time: 2019-01-20T21:12:47+03:00
# @License: MIT License. See license.txt
# @Copyright:... | 6 | 0 | 0 | 0 | 0 | 42 | 0 | -8 | 46 |
3c237c41a85eb8fead08c4138175368584de93d3 | 8,615 | py | Python | tests/test_query.py | mikecokina/pyopentsdb | b8d78e8f42aed4ebbd6ac3aff925071de41d6b52 | [
"MIT"
] | 2 | 2018-05-09T08:34:30.000Z | 2018-09-25T22:42:09.000Z | tests/test_query.py | mikecokina/pyopentsdb | b8d78e8f42aed4ebbd6ac3aff925071de41d6b52 | [
"MIT"
] | 2 | 2018-12-24T10:51:30.000Z | 2019-01-21T13:55:11.000Z | tests/test_query.py | mikecokina/pyopentsdb | b8d78e8f42aed4ebbd6ac3aff925071de41d6b52 | [
"MIT"
] | null | null | null |
# todo: unify repeating test
| 36.504237 | 111 | 0.497853 | import unittest
from unittest import mock
import datetime
from pyopentsdb import tsdb
from pyopentsdb import errors
from pyopentsdb.query import tsdb_query_metrics_validation
from tests.testutils import get_mock_requests_post, mock_tsdb_connection_error_post, mock_unexpected_error_post
from tests.testutils import Gen... | 0 | 3,498 | 0 | 4,695 | 0 | 0 | 0 | 188 | 201 |
01bb4112bebf1ed660bcd3a162b4074321a79d34 | 234 | py | Python | ckan/controllers/search_adv.py | longnguyencse/ckan-add-search | c5acf59b2a76d40eb69ed6aa5b802809b9ab4f4a | [
"Apache-2.0"
] | null | null | null | ckan/controllers/search_adv.py | longnguyencse/ckan-add-search | c5acf59b2a76d40eb69ed6aa5b802809b9ab4f4a | [
"Apache-2.0"
] | null | null | null | ckan/controllers/search_adv.py | longnguyencse/ckan-add-search | c5acf59b2a76d40eb69ed6aa5b802809b9ab4f4a | [
"Apache-2.0"
] | null | null | null | # encoding: utf-8
import ckan.lib.base as base
CACHE_PARAMETERS = ['__cache', '__no_cache__']
| 19.5 | 65 | 0.726496 | # encoding: utf-8
import ckan.lib.base as base
CACHE_PARAMETERS = ['__cache', '__no_cache__']
class SearchAdvController(base.BaseController):
def index(self):
return base.render('search/index.html', cache_force=True)
| 0 | 0 | 0 | 114 | 0 | 0 | 0 | 0 | 23 |
f065371af046f66cf0c95841b8a0156850176d2c | 183 | py | Python | config.py | the-vampiire/AutoMediaTweeta | 8733443c02f1712c103b559b0b3e94cfdc58eca4 | [
"MIT"
] | null | null | null | config.py | the-vampiire/AutoMediaTweeta | 8733443c02f1712c103b559b0b3e94cfdc58eca4 | [
"MIT"
] | null | null | null | config.py | the-vampiire/AutoMediaTweeta | 8733443c02f1712c103b559b0b3e94cfdc58eca4 | [
"MIT"
] | null | null | null | CONSUMER_KEY = 'paste consumer key here'
CONSUMER_SECRET = 'paste consumer secret here'
ACCESS_TOKEN = 'paste access token here'
ACCESS_TOKEN_SECRET = 'paste access token secret here' | 45.75 | 54 | 0.803279 | CONSUMER_KEY = 'paste consumer key here'
CONSUMER_SECRET = 'paste consumer secret here'
ACCESS_TOKEN = 'paste access token here'
ACCESS_TOKEN_SECRET = 'paste access token secret here' | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a75386a24e0ed59fbf20628b05450d8cf9e37ce3 | 3,769 | py | Python | commands/help.py | pariahsoft/Dennis | b3e0f0804ee5fa3afe2ff5c3218179d25bb3e12c | [
"MIT"
] | 1 | 2017-01-11T10:23:03.000Z | 2017-01-11T10:23:03.000Z | commands/help.py | pariahsoft/Dennis | b3e0f0804ee5fa3afe2ff5c3218179d25bb3e12c | [
"MIT"
] | null | null | null | commands/help.py | pariahsoft/Dennis | b3e0f0804ee5fa3afe2ff5c3218179d25bb3e12c | [
"MIT"
] | null | null | null | ########################################
## Adventure Bot "Dennis" ##
## commands/help.py ##
## Copyright 2012-2013 PariahSoft LLC ##
########################################
## **********
## Permission is hereby granted, free of charge, to any person obtaining a copy
## of this software... | 45.963415 | 116 | 0.635447 | ########################################
## Adventure Bot "Dennis" ##
## commands/help.py ##
## Copyright 2012-2013 PariahSoft LLC ##
########################################
## **********
## Permission is hereby granted, free of charge, to any person obtaining a copy
## of this software... | 0 | 0 | 0 | 0 | 0 | 467 | 0 | 0 | 46 |
8a2464fa8ae3960889bf87aae3a92707ce6eb896 | 678 | py | Python | software/firmware/setup.py | mjaskula/EuroPi | 35b5ef6560080672adf52d38b3d021ed32537c04 | [
"CC0-1.0"
] | 7 | 2022-02-10T07:47:00.000Z | 2022-03-30T19:21:20.000Z | software/firmware/setup.py | stripboard-layouts/EuroPi | 35b5ef6560080672adf52d38b3d021ed32537c04 | [
"CC0-1.0"
] | null | null | null | software/firmware/setup.py | stripboard-layouts/EuroPi | 35b5ef6560080672adf52d38b3d021ed32537c04 | [
"CC0-1.0"
] | null | null | null |
from setuptools import setup
setup(
name="micropython-europi",
version="0.4.0",
description="EuroPi module for MicroPython",
long_description="""The EuroPi is a fully user reprogrammable EuroRack module based on the Raspberry Pi Pico, which allows users to process inputs and controls to produce output... | 30.818182 | 219 | 0.672566 | import sys
from setuptools import setup
setup(
name="micropython-europi",
version="0.4.0",
description="EuroPi module for MicroPython",
long_description="""The EuroPi is a fully user reprogrammable EuroRack module based on the Raspberry Pi Pico, which allows users to process inputs and controls to pro... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -11 | 22 |
2ad472cd7127e7dd5e100e6237dc3a35ae8bdb52 | 1,052 | py | Python | client/__main__.py | SnkSynthesis/networking-multiplayer | f2c71fc39fe975e8f459172631f0797de1c98eb2 | [
"MIT"
] | null | null | null | client/__main__.py | SnkSynthesis/networking-multiplayer | f2c71fc39fe975e8f459172631f0797de1c98eb2 | [
"MIT"
] | null | null | null | client/__main__.py | SnkSynthesis/networking-multiplayer | f2c71fc39fe975e8f459172631f0797de1c98eb2 | [
"MIT"
] | null | null | null | import pygame
from .udpserver_connection import UDPServerConnection
from server.settings import ADDR, PORT
pygame.init()
username = input("Enter username to join (4 characters max): ")
if username == "":
print("Empty username!")
exit()
elif len(username) > 4:
print("Username too long!")
exit()
conn ... | 21.916667 | 66 | 0.655894 | import pygame
from .settings import *
from .player import Player
from .udpserver_connection import UDPServerConnection
from server.settings import ADDR, PORT
pygame.init()
username = input("Enter username to join (4 characters max): ")
if username == "":
print("Empty username!")
exit()
elif len(username) > 4... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 44 |
59fed0f65e70ea577f629ec06a3e8a0c3e66558f | 1,270 | py | Python | ais_usa/icoads/extract_buoy_information.py | falcaopetri/trajectory-data | 7f81343086ccd00d3d9f52899a7032d987fc0a66 | [
"MIT"
] | 1 | 2019-05-21T15:52:28.000Z | 2019-05-21T15:52:28.000Z | ais_usa/icoads/extract_buoy_information.py | falcaopetri/trajectory-data | 7f81343086ccd00d3d9f52899a7032d987fc0a66 | [
"MIT"
] | null | null | null | ais_usa/icoads/extract_buoy_information.py | falcaopetri/trajectory-data | 7f81343086ccd00d3d9f52899a7032d987fc0a66 | [
"MIT"
] | 1 | 2020-08-18T14:38:52.000Z | 2020-08-18T14:38:52.000Z | import os
import glob
import pandas as pd
file_pattern = ':dir/*:year.csv'
proc_dir = 'processed'
buoys_file = os.path.join(proc_dir, 'icoads_buoys_ships.csv')
years = ['2015']
data = None
if not os.path.isdir(proc_dir):
os.mkdir(proc_dir)
for year in years:
print('Processing year', year)
pattern = fil... | 27.021277 | 64 | 0.588189 | import os
import glob
import pandas as pd
file_pattern = ':dir/*:year.csv'
proc_dir = 'processed'
buoys_file = os.path.join(proc_dir, 'icoads_buoys_ships.csv')
years = ['2015']
data = None
if not os.path.isdir(proc_dir):
os.mkdir(proc_dir)
for year in years:
print('Processing year', year)
pattern = fil... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
25d5901b149c28dcc325fe1f670e434cd94c69d5 | 86,036 | py | Python | xarm/x3/xarm.py | tutorintelligence/xArm-Python-SDK | 25e1328d94629277cceb76d0830e41f2402afa2c | [
"BSD-3-Clause"
] | null | null | null | xarm/x3/xarm.py | tutorintelligence/xArm-Python-SDK | 25e1328d94629277cceb76d0830e41f2402afa2c | [
"BSD-3-Clause"
] | null | null | null | xarm/x3/xarm.py | tutorintelligence/xArm-Python-SDK | 25e1328d94629277cceb76d0830e41f2402afa2c | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Software License Agreement (BSD License)
#
# Copyright (c) 2020, UFACTORY, Inc.
# All rights reserved.
#
# Author: Vinman <vinman.wen@ufactory.cc> <vinman.cub@gmail.com>
from .parse import GcodeParser
try:
from ..tools.blockly_tool import BlocklyTool
except:
print('import BlocklyTool mo... | 50.69888 | 175 | 0.602294 | #!/usr/bin/env python3
# Software License Agreement (BSD License)
#
# Copyright (c) 2020, UFACTORY, Inc.
# All rights reserved.
#
# Author: Vinman <vinman.wen@ufactory.cc> <vinman.cub@gmail.com>
import os
import math
import time
import warnings
from collections.abc import Iterable
from ..core.config.x_config import XC... | 294 | 44,954 | 0 | 40,019 | 0 | 0 | 0 | 162 | 420 |
0cb35bee7f1707cfa8e5ff92e9e8623b81268f17 | 2,681 | py | Python | py/DREAM/Output/ScalarQuantity.py | chalmersplasmatheory/DREAM | 715637ada94f5e35db16f23c2fd49bb7401f4a27 | [
"MIT"
] | 12 | 2020-09-07T11:19:10.000Z | 2022-02-17T17:40:19.000Z | py/DREAM/Output/ScalarQuantity.py | chalmersplasmatheory/DREAM | 715637ada94f5e35db16f23c2fd49bb7401f4a27 | [
"MIT"
] | 110 | 2020-09-02T15:29:24.000Z | 2022-03-09T09:50:01.000Z | py/DREAM/Output/ScalarQuantity.py | chalmersplasmatheory/DREAM | 715637ada94f5e35db16f23c2fd49bb7401f4a27 | [
"MIT"
] | 3 | 2021-05-21T13:24:31.000Z | 2022-02-11T14:43:12.000Z | # Base class for scalar quantities (single value evolving in time)
#
from . OutputException import OutputException
from . UnknownQuantity import UnknownQuantity
| 27.080808 | 123 | 0.556136 | # Base class for scalar quantities (single value evolving in time)
#
import matplotlib.pyplot as plt
import numpy as np
from . OutputException import OutputException
from . UnknownQuantity import UnknownQuantity
class ScalarQuantity(UnknownQuantity):
def __init__(self, name, data, grid, output, attr=list(... | 0 | 0 | 0 | 2,441 | 0 | 0 | 0 | 7 | 68 |
10dd171801927325b706dc8440d59f81c0862711 | 503 | py | Python | workflow/__main__.py | vanaoff/workflow | 57be3cdfc9034c233fe0f1c242939a51f9ee353f | [
"MIT"
] | 5 | 2017-11-22T11:40:20.000Z | 2019-11-01T08:51:24.000Z | workflow/__main__.py | vanaoff/workflow | 57be3cdfc9034c233fe0f1c242939a51f9ee353f | [
"MIT"
] | null | null | null | workflow/__main__.py | vanaoff/workflow | 57be3cdfc9034c233fe0f1c242939a51f9ee353f | [
"MIT"
] | 1 | 2018-07-14T19:32:02.000Z | 2018-07-14T19:32:02.000Z | from logging.config import dictConfig
import yaml
from pkg_resources import resource_stream
from workflow import logger, __version__
from workflow.builder import process_project
from workflow.config import Config
dictConfig(yaml.load(resource_stream(__name__, 'log.yml')))
if __name__ == '__main__':
c = Config()... | 31.4375 | 98 | 0.7833 | from logging.config import dictConfig
import yaml
from pkg_resources import resource_stream
from workflow import logger, __version__
from workflow.builder import process_project
from workflow.config import Config
dictConfig(yaml.load(resource_stream(__name__, 'log.yml')))
if __name__ == '__main__':
c = Config()... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
94e5ce3415ae1995d0c18b6cee46d4bdc60e4899 | 2,217 | py | Python | final_perceptron.py | venkys2002/Natural-Language-Processing-Projects | 83ad645b5ead73f3212ff9af90f2b57238551eee | [
"MIT"
] | 3 | 2017-04-14T17:45:09.000Z | 2019-11-08T23:51:33.000Z | final_perceptron.py | venkys2002/Natural-Language-Processing-Projects | 83ad645b5ead73f3212ff9af90f2b57238551eee | [
"MIT"
] | null | null | null | final_perceptron.py | venkys2002/Natural-Language-Processing-Projects | 83ad645b5ead73f3212ff9af90f2b57238551eee | [
"MIT"
] | 1 | 2017-04-05T13:10:13.000Z | 2017-04-05T13:10:13.000Z | import json, timeit
from collections import defaultdict
filename_dict = dict()
filelist = []
feature_weights = defaultdict(int)
avg_weights = defaultdict(int)
json_dict = defaultdict(int)
if __name__ == '__main__':
start = timeit.default_timer()
with open('train.json',mode='r',encoding=None... | 33.590909 | 110 | 0.571042 | import os,sys,random,json,timeit
from collections import defaultdict
filename_dict = dict()
filelist = []
feature_weights = defaultdict(int)
avg_weights = defaultdict(int)
json_dict = defaultdict(int)
def learn_model():
global filelist,feature_weights,filename_dict,avg_weights,json_dict
bias = 0
... | 0 | 0 | 0 | 0 | 0 | 1,083 | 0 | 13 | 25 |
a608e6a827c2a606c3d7aa7c5cc4b35cf7d6f0aa | 645 | py | Python | experiments/coil20.py | Guanzhou-Ke/conan | 5eb0a051e3a2893a12fe690ac443471abbcd1ee3 | [
"MIT"
] | 5 | 2021-11-16T04:03:46.000Z | 2022-03-21T04:55:43.000Z | experiments/coil20.py | Guanzhou-Ke/conan | 5eb0a051e3a2893a12fe690ac443471abbcd1ee3 | [
"MIT"
] | 1 | 2022-03-27T01:58:50.000Z | 2022-03-27T01:58:50.000Z | experiments/coil20.py | Guanzhou-Ke/conan | 5eb0a051e3a2893a12fe690ac443471abbcd1ee3 | [
"MIT"
] | 1 | 2021-08-31T14:29:38.000Z | 2021-08-31T14:29:38.000Z | from .default import Experiment
coil20 = Experiment(
arch='alexnet',
hidden_dim=1024,
verbose=True,
log_dir='./logs/mytest',
device='cuda',
extra_record=True,
opt='adam',
epochs=50,
lr=1e-3,
batch_size=24,
cluster_hidden_dim=512,
ds_name='coil-20',
img_size=128,
... | 20.806452 | 49 | 0.64186 | from .default import Experiment
coil20 = Experiment(
arch='alexnet',
hidden_dim=1024,
verbose=True,
log_dir='./logs/mytest',
device='cuda',
extra_record=True,
opt='adam',
epochs=50,
lr=1e-3,
batch_size=24,
cluster_hidden_dim=512,
ds_name='coil-20',
img_size=128,
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4485d1b25eee47e3893f8f4f7de8bce4b09548d2 | 610 | py | Python | wechat_group_members.py | SanMuHe/wechat-group-members | 9ec9e1de0806286b5949b3eaa9ad2cca1a94931b | [
"MIT"
] | 2 | 2018-12-10T11:17:49.000Z | 2020-02-21T08:43:29.000Z | wechat_group_members.py | SanMuHe/wechat-group-members | 9ec9e1de0806286b5949b3eaa9ad2cca1a94931b | [
"MIT"
] | null | null | null | wechat_group_members.py | SanMuHe/wechat-group-members | 9ec9e1de0806286b5949b3eaa9ad2cca1a94931b | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
main()
| 21.785714 | 81 | 0.647541 | import argparse
import json
from wechat import WeChat
def main():
parser = argparse.ArgumentParser()
parser.add_argument('group_name', help='name of the WeChat roup')
args = parser.parse_args()
if args.group_name == '':
print('group_name cannot be empty.')
return
wechat = WeChat... | 0 | 0 | 0 | 0 | 0 | 493 | 0 | -12 | 90 |
0fb053d4b1d008ee15ad9fdafb9f9f564a33167e | 851 | py | Python | core/settings/develop.py | HiroshiFuu/cs-balloting | 565eb3ee88769d88b27705828c10c7b5be964ef5 | [
"MIT"
] | null | null | null | core/settings/develop.py | HiroshiFuu/cs-balloting | 565eb3ee88769d88b27705828c10c7b5be964ef5 | [
"MIT"
] | null | null | null | core/settings/develop.py | HiroshiFuu/cs-balloting | 565eb3ee88769d88b27705828c10c7b5be964ef5 | [
"MIT"
] | null | null | null | # Overrides
SECRET_KEY = 'za#q^j+$6frru&3*)b0yl=#9wmue%rf38akqux(fjvl-&zy@_l'
DEBUG = True
ALLOWED_HOSTS = ['*']
RUNSERVERPLUS_SERVER_ADDRESS_PORT = '0.0.0.0:8000'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': os.environ.get('DATABASE_NAME'),
'USER': os.enviro... | 23 | 65 | 0.638073 | # Overrides
from .base import * # noqa: F401
SECRET_KEY = 'za#q^j+$6frru&3*)b0yl=#9wmue%rf38akqux(fjvl-&zy@_l'
DEBUG = True
ALLOWED_HOSTS = ['*']
RUNSERVERPLUS_SERVER_ADDRESS_PORT = '0.0.0.0:8000'
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.mysql',
'NAME': os.environ.get('DATABASE... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -2 | 36 |
d463f2386641ef044e6ff0bbb4979032dff95297 | 2,356 | py | Python | FlatBuf_ZMQ/pub.py | asgokhale/DistributedSystemsCourse | 9ae24ed65e7a7ef849c7e39ec5a1a8cc5973c12f | [
"Apache-2.0"
] | 4 | 2022-01-16T17:36:49.000Z | 2022-02-07T16:57:33.000Z | FlatBuf_ZMQ/pub.py | asgokhale/DistributedSystemsCourse | 9ae24ed65e7a7ef849c7e39ec5a1a8cc5973c12f | [
"Apache-2.0"
] | null | null | null | FlatBuf_ZMQ/pub.py | asgokhale/DistributedSystemsCourse | 9ae24ed65e7a7ef849c7e39ec5a1a8cc5973c12f | [
"Apache-2.0"
] | 1 | 2022-01-25T23:51:51.000Z | 2022-01-25T23:51:51.000Z | # Author: Aniruddha Gokhale
# Created: Fall 2019
# Modified: Spring 2021
#
# Purpose: demonstrate publishing of topic data type using flatbuffers
#
# Here our topic comprises a sequence number, a timestamp, and a data buffer
# of several uint32 numbers (whose value is not relevant to us)
# The different packages... | 34.144928 | 86 | 0.671902 | # Author: Aniruddha Gokhale
# Created: Fall 2019
# Modified: Spring 2021
#
# Purpose: demonstrate publishing of topic data type using flatbuffers
#
# Here our topic comprises a sequence number, a timestamp, and a data buffer
# of several uint32 numbers (whose value is not relevant to us)
# The different packages... | 0 | 0 | 0 | 0 | 0 | 1,777 | 0 | -43 | 196 |
f40bc7d3160eadfc52b286cba5b3998715fadee9 | 3,196 | py | Python | scripts/get_data.py | krsnad/qlib | 0c316cd3670e5df9e3afdd0907fb9f6aa2a64d3e | [
"MIT"
] | null | null | null | scripts/get_data.py | krsnad/qlib | 0c316cd3670e5df9e3afdd0907fb9f6aa2a64d3e | [
"MIT"
] | null | null | null | scripts/get_data.py | krsnad/qlib | 0c316cd3670e5df9e3afdd0907fb9f6aa2a64d3e | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import fire
if __name__ == "__main__":
fire.Fire(GetData)
| 32.282828 | 218 | 0.612015 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import fire
import zipfile
import requests
from tqdm import tqdm
from pathlib import Path
from loguru import logger
class GetData:
REMOTE_URL = "http://fintech.msra.cn/stock_data/downloads"
def __init__(self, delete_zip_file=False):
... | 0 | 269 | 0 | 2,659 | 0 | 0 | 0 | -6 | 133 |
1ebe31d14c4ca999190f82ba507ca5d33abf3499 | 987 | py | Python | cryptokit/ecc.py | istommao/cryptok | 9630e3744d9ca8c25c58122a5027ece7d93ff40a | [
"MIT"
] | 25 | 2016-10-22T03:23:56.000Z | 2021-05-24T12:36:05.000Z | cryptokit/ecc.py | istommao/cryptok | 9630e3744d9ca8c25c58122a5027ece7d93ff40a | [
"MIT"
] | null | null | null | cryptokit/ecc.py | istommao/cryptok | 9630e3744d9ca8c25c58122a5027ece7d93ff40a | [
"MIT"
] | 6 | 2017-03-23T05:25:06.000Z | 2019-10-24T12:03:32.000Z | # coding: utf-8
"""Elliptic Curve Signature Algorithms."""
from __future__ import unicode_literals
| 25.973684 | 58 | 0.656535 | # coding: utf-8
"""Elliptic Curve Signature Algorithms."""
from __future__ import unicode_literals
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import hashes
from cryptography.hazmat.primitives.asymmetric import ec
class ECCrypto(object):
ALGORITHM_DICT = {
... | 0 | 0 | 0 | 698 | 0 | 0 | 0 | 98 | 90 |
1c12099e458a2126334f24ca79c20c39e10e6612 | 19,086 | py | Python | megatron/mpu/tests/test_layers.py | laekov/Megatron-LM | 37cec9af5ce93cd0da05a52513928bf55b70f3ac | [
"MIT"
] | null | null | null | megatron/mpu/tests/test_layers.py | laekov/Megatron-LM | 37cec9af5ce93cd0da05a52513928bf55b70f3ac | [
"MIT"
] | null | null | null | megatron/mpu/tests/test_layers.py | laekov/Megatron-LM | 37cec9af5ce93cd0da05a52513928bf55b70f3ac | [
"MIT"
] | 1 | 2021-01-16T10:10:17.000Z | 2021-01-16T10:10:17.000Z | # coding=utf-8
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 35.943503 | 80 | 0.679975 | # coding=utf-8
# Copyright (c) 2020, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 0 | 0 | 0 | 504 | 0 | 15,945 | 0 | 15 | 341 |
b7b13aa6a0c2a5312fa06503eabd9b5acced1ed3 | 171 | py | Python | pyndv/__init__.py | vit0r/nvdcve | 8cab188f96e7b39a8c0460b39f20d9bb2e2a52af | [
"MIT"
] | 2 | 2020-01-22T13:59:46.000Z | 2020-02-28T05:37:57.000Z | pyndv/__init__.py | vit0r/nvdcve | 8cab188f96e7b39a8c0460b39f20d9bb2e2a52af | [
"MIT"
] | 1 | 2021-03-10T14:28:01.000Z | 2021-04-03T05:09:23.000Z | pyndv/__init__.py | vit0r/nvdcve | 8cab188f96e7b39a8c0460b39f20d9bb2e2a52af | [
"MIT"
] | 1 | 2019-09-29T16:58:11.000Z | 2019-09-29T16:58:11.000Z | """
Lib load modules for pyndv
"""
import logging
from pyndv import core
logging.basicConfig(format="%(levelname)s: %(message)s", level=logging.INFO)
__all__ = core
| 12.214286 | 76 | 0.719298 | """
Lib load modules for pyndv
"""
import logging
from pyndv import core
logging.basicConfig(format="%(levelname)s: %(message)s", level=logging.INFO)
__all__ = core
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
422cfd6d5eadc1ee7c2372d8768354fe964027f1 | 4,951 | py | Python | src/Figure3/gene_expr.py | jonathanperrie/iscDNase-seq | 11852c08ac5b6d66ae918910ed3ac212d37ddad6 | [
"MIT"
] | null | null | null | src/Figure3/gene_expr.py | jonathanperrie/iscDNase-seq | 11852c08ac5b6d66ae918910ed3ac212d37ddad6 | [
"MIT"
] | null | null | null | src/Figure3/gene_expr.py | jonathanperrie/iscDNase-seq | 11852c08ac5b6d66ae918910ed3ac212d37ddad6 | [
"MIT"
] | null | null | null | import matplotlib
matplotlib.use('agg')
from glob import glob
import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import mannwhitneyu
# returns list of genes that have expression above 0 for cell type within 10,000 bp from tss
# find gene expression for individual annotated peak set
# x[-3:-1] refer ... | 33.006667 | 150 | 0.689558 | import matplotlib
matplotlib.use('agg')
from glob import glob
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
import matplotlib.patches as mpatches
from statsmodels.distributions.empirical_distribution import ECDF
from scipy.stats import ranksums
from scipy.stats import ttest_ind
from scipy.stat... | 0 | 0 | 0 | 0 | 0 | 762 | 0 | 81 | 132 |
a3afc460a7da40167895cacc96fe3bfa39a1dda2 | 369 | py | Python | setup.py | marweck/pso-mlp | 6476d0b1e0ae869fd1884213ab03d29e68962858 | [
"MIT"
] | 2 | 2021-07-16T19:05:44.000Z | 2022-02-08T23:25:42.000Z | setup.py | marweck/pso-mlp | 6476d0b1e0ae869fd1884213ab03d29e68962858 | [
"MIT"
] | null | null | null | setup.py | marweck/pso-mlp | 6476d0b1e0ae869fd1884213ab03d29e68962858 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(
name='pso-nn',
version='',
packages=['pso'],
package_dir={'': 'src'},
url='',
license='',
author='Marcio Carvalho',
author_email='marweck@gmail.com',
description='',
check_format=True,
# Enable type checking
test_mypy=False,
# Enab... | 19.421053 | 37 | 0.612466 | from setuptools import setup
setup(
name='pso-nn',
version='',
packages=['pso'],
package_dir={'': 'src'},
url='',
license='',
author='Marcio Carvalho',
author_email='marweck@gmail.com',
description='',
check_format=True,
# Enable type checking
test_mypy=False,
# Enab... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
77386eca51cc212c713f76d00a042d1254fa7d5f | 1,666 | py | Python | Solutions/Problem_060.py | PraneethJain/Project-Euler | 54fe34da444803ea55c49e4a4cda3ad6d4bca3b8 | [
"MIT"
] | 2 | 2022-03-11T21:31:52.000Z | 2022-03-11T21:37:14.000Z | Solutions/Problem_060.py | PraneethJain/Project-Euler-100 | 54fe34da444803ea55c49e4a4cda3ad6d4bca3b8 | [
"MIT"
] | null | null | null | Solutions/Problem_060.py | PraneethJain/Project-Euler-100 | 54fe34da444803ea55c49e4a4cda3ad6d4bca3b8 | [
"MIT"
] | 1 | 2022-03-07T12:55:36.000Z | 2022-03-07T12:55:36.000Z | from prime import primelist
from itertools import product
from time import time
# ATTEMPT 2 (FASTER)
t1 = time()
prime_list = set(primelist(10**4))
for p1, p2 in product(prime_list, repeat=2):
if p2 > p1:
if thingy(p1, p2):
for p3 in prime_list:
if p3 > p2:
... | 38.744186 | 88 | 0.42617 | from prime import primelist, primecheck
from itertools import product
from time import time
def thingy(p1: int, p2: int) -> bool:
return primecheck(int((str(p1) + str(p2)))) and primecheck(int(str(p2) + str(p1)))
# ATTEMPT 2 (FASTER)
t1 = time()
prime_list = set(primelist(10**4))
for p1, p2 in product(prime_lis... | 0 | 0 | 0 | 0 | 0 | 103 | 0 | 12 | 23 |
21508edf8bbe8cd9556037349b3a6e2b31f885ea | 4,915 | py | Python | binData.py | stephen-w-bailey/fast-n-deep-faces | 53173c6367dfa3a20d3193ad7a0e77ac1e898f02 | [
"BSD-3-Clause"
] | 40 | 2020-06-26T10:56:39.000Z | 2022-01-26T10:43:34.000Z | binData.py | stephen-w-bailey/fast-n-deep-faces | 53173c6367dfa3a20d3193ad7a0e77ac1e898f02 | [
"BSD-3-Clause"
] | 7 | 2020-07-01T07:10:11.000Z | 2022-03-07T00:07:41.000Z | binData.py | stephen-w-bailey/fast-n-deep-faces | 53173c6367dfa3a20d3193ad7a0e77ac1e898f02 | [
"BSD-3-Clause"
] | 13 | 2020-06-30T11:57:41.000Z | 2022-02-20T17:24:00.000Z |
if __name__=='__main__':
main()
| 33.435374 | 132 | 0.60061 | import argparse
import matplotlib.pyplot as plt
import numpy as np
import os
import pickle
from sklearn.decomposition import PCA
import sys
import tqdm
import yaml
import PoseGenerator
def samplePoints(v,f,n):
# Compute the area of each triangle in the base mesh
vf = v[f.reshape(-1)].reshape((-1,3,3))
a,... | 0 | 0 | 0 | 0 | 0 | 4,624 | 0 | -35 | 290 |
f64f65ecb39629fd4ad639101475666b051f047a | 6,435 | py | Python | jimmy/jimmy.py | lorenzocerrone/just-yaml-pp | d5dd78301e86b1cd6e451721ef87ad96fa8511ce | [
"MIT"
] | null | null | null | jimmy/jimmy.py | lorenzocerrone/just-yaml-pp | d5dd78301e86b1cd6e451721ef87ad96fa8511ce | [
"MIT"
] | null | null | null | jimmy/jimmy.py | lorenzocerrone/just-yaml-pp | d5dd78301e86b1cd6e451721ef87ad96fa8511ce | [
"MIT"
] | null | null | null | from jimmy.constructors.math_constructors import build_range, build_lin_space, build_log_space, sum_nodes
from jimmy.constructors.path_constructors import home_path, unique_path, make_absolute, join_paths, make_path, find_glob
from jimmy.constructors.constructors import join, jimmy_constructor, time_stamp
default_c... | 32.014925 | 120 | 0.620047 | import pathlib
import time
import yaml
import itertools
import copy
from jimmy.constructors.math_constructors import build_range, build_lin_space, build_log_space, sum_nodes
from jimmy.constructors.path_constructors import home_path, unique_path, make_absolute, join_paths, make_path, find_glob
from jimmy.constructors.... | 0 | 704 | 0 | 2,512 | 0 | 1,886 | 0 | -25 | 363 |
1f5d520504c06509169db086d8bb5a6e191f46b0 | 881 | py | Python | 1-50/11_container-with-most-water.py | ChenhaoJiang/LeetCode-Solution | b2119ad938c18f75948d0f5cf4ae3773820dcc93 | [
"MIT"
] | 16 | 2019-03-30T07:25:27.000Z | 2020-07-28T15:34:53.000Z | 1-50/11_container-with-most-water.py | ChenhaoJiang/LeetCode-Solution | b2119ad938c18f75948d0f5cf4ae3773820dcc93 | [
"MIT"
] | null | null | null | 1-50/11_container-with-most-water.py | ChenhaoJiang/LeetCode-Solution | b2119ad938c18f75948d0f5cf4ae3773820dcc93 | [
"MIT"
] | 2 | 2020-06-26T13:02:14.000Z | 2020-07-28T04:59:15.000Z | """
n a1a2...an (i, ai) n i (i, ai) (i, 0)
x
n 2
Ex:
input: [1,8,6,2,5,4,8,3,7]
output: 49
"""
"""
My thinking:
"""
| 27.53125 | 96 | 0.62202 | """
给定 n 个非负整数 a1,a2,...,an,每个数代表坐标中的一个点 (i, ai) 。在坐标内画 n 条垂直线,垂直线 i 的两个端点分别为 (i, ai) 和 (i, 0)。找出其中的
两条线,使得它们与 x 轴共同构成的容器可以容纳最多的水。
说明:你不能倾斜容器,且 n 的值至少为 2。
Ex:
input: [1,8,6,2,5,4,8,3,7]
output: 49
"""
class Solution(object):
def maxArea(self, height):
"""
:type height: List[int]
:rtype: int
... | 780 | 0 | 0 | 470 | 0 | 0 | 0 | 0 | 22 |
43facb3033022b1e16f15cfc16e3549d2174f944 | 945 | py | Python | script/spec_pack.py | oslab-swrc/Krace | 739bd2327cd5af0a6521baa0ff996784b05348ed | [
"MIT"
] | null | null | null | script/spec_pack.py | oslab-swrc/Krace | 739bd2327cd5af0a6521baa0ff996784b05348ed | [
"MIT"
] | null | null | null | script/spec_pack.py | oslab-swrc/Krace | 739bd2327cd5af0a6521baa0ff996784b05348ed | [
"MIT"
] | null | null | null |
# int
# ptr
# str
| 24.230769 | 73 | 0.57672 | import struct
from spec_const import SPEC_PTR_SIZE
# int
def _get_int_pack_format(bits: int, signed: bool) -> str:
if (bits, signed) == (8, False):
return 'B'
if (bits, signed) == (8, True):
return 'b'
if (bits, signed) == (16, False):
return 'H'
if (bits, signed) == (16, True... | 0 | 0 | 0 | 0 | 0 | 779 | 0 | 7 | 134 |
8cc8daca968dda219ab25de0f9f5247568b12be4 | 13,341 | py | Python | src/modules/message_reactions.py | pongo/rapturebot | d38bd793636fa30e609b148b71b2d7c8047570e3 | [
"MIT"
] | 9 | 2018-08-19T12:55:58.000Z | 2021-07-17T15:38:40.000Z | src/modules/message_reactions.py | pongo/rapturebot | d38bd793636fa30e609b148b71b2d7c8047570e3 | [
"MIT"
] | 124 | 2018-07-31T13:43:58.000Z | 2022-03-11T23:27:43.000Z | src/modules/message_reactions.py | pongo/rapturebot | d38bd793636fa30e609b148b71b2d7c8047570e3 | [
"MIT"
] | 3 | 2019-10-21T13:18:14.000Z | 2021-02-09T11:05:10.000Z | import re
import telegram
import src.config as config
from src.utils.cache import cache
from src.utils.handlers_helpers import is_command_enabled_for_chat
from src.utils.logger_helpers import get_logger
logger = get_logger(__name__)
re_img = re.compile(r"\.(jpg|jpeg|png)$", re.IGNORECASE)
re_gdeleha = re.compile(r"( ... | 37.369748 | 103 | 0.70482 | import random
import re
import requests
import telegram
from telegram.ext import run_async
import src.config as config
from src.commands.khaleesi.khaleesi import Khaleesi
from src.commands.khaleesi.random_khaleesi import RandomKhaleesi
from src.commands.orzik import orzik_correction
from src.commands.welcome import s... | 1,297 | 6,925 | 0 | 0 | 0 | 2,879 | 0 | 622 | 807 |
13ef1c0eac9639997a0083c6eb03ad56c2f41276 | 7,861 | py | Python | Patterns/Expressions.py | mostobriv/IDAXrefXplorer | c570423ee8209a0284e7ea620a4f3b8ca7cdff9e | [
"MIT"
] | null | null | null | Patterns/Expressions.py | mostobriv/IDAXrefXplorer | c570423ee8209a0284e7ea620a4f3b8ca7cdff9e | [
"MIT"
] | null | null | null | Patterns/Expressions.py | mostobriv/IDAXrefXplorer | c570423ee8209a0284e7ea620a4f3b8ca7cdff9e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import sys
import Nodes
module = sys.modules[__name__]
for i in Nodes.TWO_OP:
setattr(module, i[0] + "Expr", BinaryGen(i[0] + "Expr", i[1]))
for i in Nodes.ONE_OP:
setattr(module, i[0] + "Expr", UnaryGen(i[0] + "Expr", i[1]))
| 27.295139 | 83 | 0.554001 | # -*- coding: utf-8 -*-
import sys
import Patterns as p
import Nodes
class BindExpr(p.Pattern):
def __init__(self, type, expr_pattern):
super(BindExpr, self).__init__()
self.type = type
self.pattern = expr_pattern
def check(self, expr, ctx):
if self.pattern.check(expr, ctx):... | 0 | 0 | 0 | 6,674 | 0 | 450 | 0 | -1 | 459 |
1f95f9c8b03cab723783bd014cb382230074cbe6 | 615 | py | Python | src/basic/01_syntax/str.py | hbulpf/pydemo | 2989cc50781230718e46dcac5dc0ca70630ebffe | [
"Apache-2.0"
] | 6 | 2020-03-24T15:58:42.000Z | 2020-04-18T13:32:41.000Z | src/basic/01_syntax/str.py | hbulpf/pydemo | 2989cc50781230718e46dcac5dc0ca70630ebffe | [
"Apache-2.0"
] | 1 | 2022-01-13T03:51:17.000Z | 2022-01-13T03:51:17.000Z | src/basic/01_syntax/str.py | hbulpf/pydemo | 2989cc50781230718e46dcac5dc0ca70630ebffe | [
"Apache-2.0"
] | 1 | 2020-02-01T09:36:05.000Z | 2020-02-01T09:36:05.000Z | # bbytes
print('ABC'.encode('ascii'))
print('ABC'.encode('utf-8'))
print(''.encode('utf-8'))
a = b'\xe4\xb8\xad\xff'.decode('utf-8',errors='ignore')
print(a)
print(len(a),len(b'\xe4\xb8\xad'),len(''.encode('utf-8')))
print('')
# r
print(r'seek\t\n\\')
print('''line1
line2
line3''')
print(r'''line1
line2
line3''')
prin... | 18.636364 | 79 | 0.601626 | # b表示bytes
print('ABC'.encode('ascii'))
print('ABC'.encode('utf-8'))
print('中文'.encode('utf-8'))
a = b'\xe4\xb8\xad\xff'.decode('utf-8',errors='ignore')
print(a)
print(len(a),len(b'\xe4\xb8\xad'),len('中'.encode('utf-8')))
print('中文测试正常')
# r表示内部字符默认不转义
print(r'seek\t\n\\')
print('''line1
line2
line3''')
print(r'''line... | 117 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5a4b5a138f83d90c0431a4e84a9684e8fb99883a | 7,359 | py | Python | newcode/server/honey_server.py | rchatterjee/nocrack | 16523cb3f316a2a4ed147fe23f942b485d27d605 | [
"MIT"
] | 21 | 2015-05-12T17:38:07.000Z | 2021-01-10T19:54:55.000Z | newcode/server/honey_server.py | rchatterjee/nocrack | 16523cb3f316a2a4ed147fe23f942b485d27d605 | [
"MIT"
] | 7 | 2015-08-27T10:57:40.000Z | 2020-04-18T08:36:42.000Z | newcode/server/honey_server.py | rchatterjee/nocrack | 16523cb3f316a2a4ed147fe23f942b485d27d605 | [
"MIT"
] | 14 | 2015-08-27T10:53:37.000Z | 2022-03-24T15:48:47.000Z | import binascii
import os
import re
import sys
from Crypto import Random
from flask import Flask
from flask_sqlalchemy import SQLAlchemy
BASE_DIR = os.getcwd()
sys.path.append(BASE_DIR)
try:
except ImportError:
print("** Install pyopenssl **")
sys.path.append('/usr/lib64/python2.6/site-packages/')
# TODO: wi... | 28.858824 | 99 | 0.66259 | import binascii
import datetime
import json
import os
import re
import sys
from Crypto import Random
from Crypto.Cipher import AES
from Crypto.Hash import SHA256
from Crypto.Protocol.KDF import PBKDF1
from Crypto.Util import Counter
from flask import Flask, request
from flask_sqlalchemy import SQLAlchemy
BASE_DIR = o... | 0 | 1,231 | 0 | 1,722 | 0 | 2,207 | 0 | 202 | 685 |
4938cfafc0d92e4b282376a46d6ae14644000f0f | 5,164 | py | Python | explorer/mqtt_demos/1_mqtt_receiver_demo.py | JBerny/astroplant_explorer | 09828599a7e0cc555685e12d31466029a29e6ae0 | [
"BSD-2-Clause"
] | null | null | null | explorer/mqtt_demos/1_mqtt_receiver_demo.py | JBerny/astroplant_explorer | 09828599a7e0cc555685e12d31466029a29e6ae0 | [
"BSD-2-Clause"
] | null | null | null | explorer/mqtt_demos/1_mqtt_receiver_demo.py | JBerny/astroplant_explorer | 09828599a7e0cc555685e12d31466029a29e6ae0 | [
"BSD-2-Clause"
] | null | null | null | """
Demo/test program for the MQTT utilities.
See https://github.com/sensemakersamsterdam/astroplant_explorer
"""
# (c) Sensemakersams.org and others. See https://github.com/sensemakersamsterdam/astroplant_explorer
# Author: Gijs Mos
#
##
# H O W T O U S E
#
# Edit configuration.json and pick a nice 'ae_id' for y... | 41.312 | 100 | 0.726181 | """
Demo/test program for the MQTT utilities.
See https://github.com/sensemakersamsterdam/astroplant_explorer
"""
# (c) Sensemakersams.org and others. See https://github.com/sensemakersamsterdam/astroplant_explorer
# Author: Gijs Mos
#
##
# H O W T O U S E
#
# Edit configuration.json and pick a nice 'ae_id' for y... | 0 | 0 | 0 | 0 | 0 | 269 | 0 | 0 | 69 |
42e17899f7c62b231182993e14c599634a6292a4 | 12,325 | py | Python | parse.py | jiuguai/dataparse | 68eac5108e4adf655cccff46b62b1e74a24a6d79 | [
"MIT"
] | null | null | null | parse.py | jiuguai/dataparse | 68eac5108e4adf655cccff46b62b1e74a24a6d79 | [
"MIT"
] | null | null | null | parse.py | jiuguai/dataparse | 68eac5108e4adf655cccff46b62b1e74a24a6d79 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import matplotlib.pyplot as plt
from bokeh.plotting import figure as _figure
from bokeh.palettes import brewer
import warnings
warnings.filterwarnings('ignore')
#
## jupyter
#
##
#
##
def filterIQR(data,cols,out_cols=[],filter_count = 1,whis = 3):
"""
... | 28.662791 | 114 | 0.573955 | # -*- coding: utf-8 -*-
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
from bokeh.plotting import figure as _figure,show,Figure
from bokeh.models import ColumnDataSource
from bokeh.layouts import gridplot
from bokeh.palettes import brewer
from bokeh.transform import jit... | 1,329 | 365 | 0 | 0 | 0 | 6,772 | 0 | 81 | 589 |
b2bc2af418f5fbddb1954b419f9db53ff0b1d589 | 9,833 | py | Python | smpp/twisted/server.py | jookies/smpp.twisted | 6b826ad34e547c96736e65a7695c904d117d78f4 | [
"Apache-2.0"
] | 3 | 2021-02-08T02:51:50.000Z | 2022-02-20T07:56:59.000Z | smpp/twisted/server.py | jookies/smpp.twisted | 6b826ad34e547c96736e65a7695c904d117d78f4 | [
"Apache-2.0"
] | null | null | null | smpp/twisted/server.py | jookies/smpp.twisted | 6b826ad34e547c96736e65a7695c904d117d78f4 | [
"Apache-2.0"
] | 1 | 2021-11-07T21:54:47.000Z | 2021-11-07T21:54:47.000Z | # Jasmin update: direct import of UsernamePassword instead of cred
LOG_CATEGORY="smpp.twisted.server"
#pylint: disable=inherit-non-class
# Jasmin update: using UsernamePassword instead of cred.credentials.UsernamePassword
| 42.201717 | 205 | 0.654327 | from smpp.twisted.protocol import SMPPServerProtocol
from smpp.pdu import pdu_types
from zope.interface import Interface
from twisted.internet.protocol import ServerFactory
# Jasmin update: direct import of UsernamePassword instead of cred
from twisted.cred.credentials import UsernamePassword
from twisted.cre... | 0 | 0 | 0 | 9,161 | 0 | 0 | 0 | 129 | 309 |
a5dff7855d7cf98d0aa28890c56833ed7e6a75f0 | 4,789 | py | Python | scripts/wiggle.py | Osaka-University-Harada-Laboratory/sda5f_tutorials | cf2ca805955545687676b7fec2c52d76aed36147 | [
"MIT"
] | null | null | null | scripts/wiggle.py | Osaka-University-Harada-Laboratory/sda5f_tutorials | cf2ca805955545687676b7fec2c52d76aed36147 | [
"MIT"
] | null | null | null | scripts/wiggle.py | Osaka-University-Harada-Laboratory/sda5f_tutorials | cf2ca805955545687676b7fec2c52d76aed36147 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import math
import rospy
from geometry_msgs.msg import Pose, Quaternion, Vector3
from moveit_commander import RobotCommander, MoveGroupCommander
from tf.transformations import quaternion_from_euler, euler_from_quaternion
def euler_to_quaternion(euler):
"""Converts euler angles to quaternion... | 35.213235 | 75 | 0.719148 | #!/usr/bin/env python
import math
import rospy
from geometry_msgs.msg import Pose, Quaternion, Vector3
from moveit_commander import RobotCommander, MoveGroupCommander
from tf.transformations import quaternion_from_euler, euler_from_quaternion
def euler_to_quaternion(euler):
"""Converts euler angles to quaternion... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b3f156a50e91315d4c5a494448beafbda81c7e85 | 79 | py | Python | locale/pot/api/examples/_autosummary/pyvista-examples-examples-load_airplane-1.py | tkoyama010/pyvista-doc-translations | 23bb813387b7f8bfe17e86c2244d5dd2243990db | [
"MIT"
] | 4 | 2020-08-07T08:19:19.000Z | 2020-12-04T09:51:11.000Z | locale/pot/api/examples/_autosummary/pyvista-examples-examples-load_airplane-1.py | tkoyama010/pyvista-doc-translations | 23bb813387b7f8bfe17e86c2244d5dd2243990db | [
"MIT"
] | 19 | 2020-08-06T00:24:30.000Z | 2022-03-30T19:22:24.000Z | locale/pot/api/examples/_autosummary/pyvista-examples-examples-load_airplane-1.py | tkoyama010/pyvista-doc-translations | 23bb813387b7f8bfe17e86c2244d5dd2243990db | [
"MIT"
] | 1 | 2021-03-09T07:50:40.000Z | 2021-03-09T07:50:40.000Z | from pyvista import examples
dataset = examples.load_airplane()
dataset.plot()
| 19.75 | 34 | 0.810127 | from pyvista import examples
dataset = examples.load_airplane()
dataset.plot()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
07535e63fcad90c3d056822dbaf0f4478a436996 | 5,296 | py | Python | napari_arboretum/visualisation/vispy_plotter.py | lowe-lab-ucl/arboretum | bb23b25ce66e51df6b0a8fbbe1a17cc0e54eaed3 | [
"MIT"
] | 3 | 2021-12-29T16:48:00.000Z | 2022-03-31T09:19:55.000Z | napari_arboretum/visualisation/vispy_plotter.py | lowe-lab-ucl/arboretum | bb23b25ce66e51df6b0a8fbbe1a17cc0e54eaed3 | [
"MIT"
] | 25 | 2021-11-30T11:29:06.000Z | 2022-03-31T13:07:13.000Z | napari_arboretum/visualisation/vispy_plotter.py | lowe-lab-ucl/arboretum | bb23b25ce66e51df6b0a8fbbe1a17cc0e54eaed3 | [
"MIT"
] | 4 | 2021-12-21T00:51:26.000Z | 2022-03-09T15:55:45.000Z |
__all__ = ["VisPyPlotter"]
| 30.436782 | 88 | 0.568731 | from dataclasses import dataclass
from typing import Optional
import numpy as np
from qtpy.QtWidgets import QWidget
from vispy import scene
from ..tree import Annotation, Edge
from .base_plotter import TreePlotterQWidgetBase
__all__ = ["VisPyPlotter"]
@dataclass
class Bounds:
xmin: float
xmax: float
ym... | 0 | 515 | 0 | 4,454 | 0 | 0 | 0 | 71 | 225 |
f597c5361d3dd711fa6c1531b0d43104d46761fe | 1,207 | py | Python | foreign.py | pceuropa/bitcoin-exchange | 4f27f674cf74acf20df8fdd909fa402212cc994d | [
"MIT"
] | 6 | 2017-10-30T15:36:49.000Z | 2022-02-06T01:05:28.000Z | foreign.py | alimogh/bitcoin-exchange | 4f27f674cf74acf20df8fdd909fa402212cc994d | [
"MIT"
] | null | null | null | foreign.py | alimogh/bitcoin-exchange | 4f27f674cf74acf20df8fdd909fa402212cc994d | [
"MIT"
] | 3 | 2017-10-31T17:04:20.000Z | 2022-02-06T01:06:03.000Z | # !/usr/bin/env python3
#-*- coding:utf-8 -*-
"""
Foreign exange PLN, Euro ,USDT , BTC
"""
from argparse import ArgumentParser
from bittrex.bittrex import Ask
if __name__ == '__main__':
currencies = all_rates()
ask = Ask('usdt-btc')
btc = ask.marketsummary()
btc = btc["Last"]
pln_usd = 1 / cur... | 25.145833 | 75 | 0.608119 | # !/usr/bin/env python3
#-*- coding:utf-8 -*-
"""
Foreign exange PLN, Euro ,USDT , BTC
"""
from urllib.request import urlopen
from json import load
from argparse import ArgumentParser
from bittrex.bittrex import Ask
def rates():
url = "http://api.fixer.io/latest?base=USD"
rates = load(urlopen(url))
ret... | 0 | 0 | 0 | 0 | 0 | 210 | 0 | 13 | 91 |
a275121665febc865263a9fe4b7cf46b959871d2 | 912 | py | Python | main_website/urls.py | Jonak-Adipta-Kalita/JAK-Website | 39c3723e95d99e990a2e23dbb05746def2ac903a | [
"MIT"
] | 1 | 2021-08-31T14:21:16.000Z | 2021-08-31T14:21:16.000Z | main_website/urls.py | Jonak-Adipta-Kalita/JAK-Website | 39c3723e95d99e990a2e23dbb05746def2ac903a | [
"MIT"
] | 74 | 2021-11-03T03:19:12.000Z | 2022-03-31T03:23:49.000Z | main_website/urls.py | Jonak-Adipta-Kalita/JAK-Website | 39c3723e95d99e990a2e23dbb05746def2ac903a | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.urls import path, include
from main_app.views import handler404 as page_not_found
from django.conf.urls import url
from django.conf import settings
from django.views.static import serve
admin.site.site_header = "Developer: Jonak"
admin.site.site_title = ""
admin.site.index_... | 33.777778 | 82 | 0.714912 | from django.contrib import admin
from django.urls import path, include
from main_app.views import handler404 as page_not_found
from django.conf.urls import url
from django.conf import settings
from django.views.static import serve
from django.views.generic import TemplateView
admin.site.site_header = "Developer: Jonak... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 24 | 22 |
2774b143f7258f9330eb80895702593bbc2a706b | 2,571 | py | Python | tests/test_region_classifier.py | NREL/reVX | 4d62eb2c003c3b53b959f7a58bdc342d18098884 | [
"BSD-3-Clause"
] | 7 | 2020-04-06T00:29:55.000Z | 2022-01-23T20:00:14.000Z | tests/test_region_classifier.py | NREL/reVX | 4d62eb2c003c3b53b959f7a58bdc342d18098884 | [
"BSD-3-Clause"
] | 67 | 2020-02-28T20:15:35.000Z | 2022-03-31T21:34:52.000Z | tests/test_region_classifier.py | NREL/reVX | 4d62eb2c003c3b53b959f7a58bdc342d18098884 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""reVX PLEXOS unit test module
"""
import os
import pytest
import pandas as pd
from pandas.testing import assert_series_equal
import tempfile
import traceback
from rex.utilities.loggers import LOGGERS
from reVX import TESTDATADIR
from reVX.utilities.region_classifier import RegionClassifier
f... | 28.88764 | 74 | 0.616103 | # -*- coding: utf-8 -*-
"""reVX PLEXOS unit test module
"""
from click.testing import CliRunner
import os
import pytest
import pandas as pd
from pandas.testing import assert_series_equal
import tempfile
import traceback
from rex.utilities.loggers import LOGGERS
from reVX import TESTDATADIR
from reVX.utilities.region_... | 0 | 78 | 0 | 0 | 0 | 0 | 0 | 14 | 45 |
cb201375eff732507f71ccc42bbbe0884d60bfcc | 92 | py | Python | file_append.py | chauhanmahavir/Python-Basics | c250a9eee203e1188a968ba2c60262442719fa49 | [
"MIT"
] | 1 | 2020-08-05T05:38:44.000Z | 2020-08-05T05:38:44.000Z | file_append.py | chauhanmahavir/Python-Basics | c250a9eee203e1188a968ba2c60262442719fa49 | [
"MIT"
] | null | null | null | file_append.py | chauhanmahavir/Python-Basics | c250a9eee203e1188a968ba2c60262442719fa49 | [
"MIT"
] | null | null | null | new='\nNew Message'
savefile=open('first.txt','a')
savefile.write(new)
savefile.close()
| 18.4 | 31 | 0.695652 | new='\nNew Message'
savefile=open('first.txt','a')
savefile.write(new)
savefile.close()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7e3be4b32a303cce5ac7b2bcba206c71b9c59459 | 129 | py | Python | import_product_inventory/models/__init__.py | TerraColligo/tc_odoo_addons | 464c062a54ef07c0ec158b0f5a3cb5aae9fbada1 | [
"CC0-1.0"
] | null | null | null | import_product_inventory/models/__init__.py | TerraColligo/tc_odoo_addons | 464c062a54ef07c0ec158b0f5a3cb5aae9fbada1 | [
"CC0-1.0"
] | null | null | null | import_product_inventory/models/__init__.py | TerraColligo/tc_odoo_addons | 464c062a54ef07c0ec158b0f5a3cb5aae9fbada1 | [
"CC0-1.0"
] | null | null | null | # -*- coding: utf-8 -*- | 25.8 | 42 | 0.775194 | # -*- coding: utf-8 -*-
from . import pos_category
from . import product_import_batch
from . import product_cierres_import_batch | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 39 | 67 |
ff01997242706cf7d282bafd34ab4dbda3bfa92e | 7,501 | py | Python | test_cifar10.py | KawtareDK/Intern_CEFE | 501fc4fa4b1980c0b99d0257e5af12dc708d5cba | [
"Apache-2.0"
] | null | null | null | test_cifar10.py | KawtareDK/Intern_CEFE | 501fc4fa4b1980c0b99d0257e5af12dc708d5cba | [
"Apache-2.0"
] | null | null | null | test_cifar10.py | KawtareDK/Intern_CEFE | 501fc4fa4b1980c0b99d0257e5af12dc708d5cba | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Jan 6 09:24:13 2022
@author: kawta
"""
import tensorflow.keras
import keras
import numpy as np
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout, Flatten
from tensorflow.keras.layers import Conv2D, MaxPooling2D
import matplo... | 31.384937 | 182 | 0.64658 | # -*- coding: utf-8 -*-
"""
Created on Thu Jan 6 09:24:13 2022
@author: kawta
"""
import tensorflow.keras
import keras
import numpy as np
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense, Dropout, Flatten
from tensorflow.keras.layers import Conv2D, MaxPooling2D
import matplo... | 10 | 0 | 0 | 0 | 0 | 0 | 0 | -1 | 44 |
2b1deea7dbaa00f0a56aa55e7e02f35d83f77c85 | 734 | py | Python | prepomm/ff_models.py | dwhswenson/prepomm | 1109c4ae03f13f2c111e1d243243f45d0e28ceb2 | [
"MIT"
] | null | null | null | prepomm/ff_models.py | dwhswenson/prepomm | 1109c4ae03f13f2c111e1d243243f45d0e28ceb2 | [
"MIT"
] | null | null | null | prepomm/ff_models.py | dwhswenson/prepomm | 1109c4ae03f13f2c111e1d243243f45d0e28ceb2 | [
"MIT"
] | null | null | null | """
Tools to facilitate working with force fields in OpenMM
"""
| 27.185185 | 55 | 0.587193 | """
Tools to facilitate working with force fields in OpenMM
"""
class FFModels(object):
def __init__(self, protein, water, **kwargs):
self.protein = protein
self.water = water
self.kwargs = kwargs
extras = [ff for ff in set(kwargs.values())
if ff not in [protein, w... | 0 | 118 | 0 | 529 | 0 | 0 | 0 | 0 | 23 |