hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
17b1dff8fe64ef2da095afccaa9e3fdd5b49ac2c | 5,483 | py | Python | webmachine/auth/oauth_res.py | benoitc/dj-webmachine | 77653d73de57388b712eaf50de8c32ec70c182fa | [
"MIT"
] | 6 | 2015-03-29T03:17:53.000Z | 2020-01-21T11:09:26.000Z | webmachine/auth/oauth_res.py | benoitc/dj-webmachine | 77653d73de57388b712eaf50de8c32ec70c182fa | [
"MIT"
] | 1 | 2015-05-28T11:32:44.000Z | 2015-05-28T11:32:44.000Z | webmachine/auth/oauth_res.py | benoitc/dj-webmachine | 77653d73de57388b712eaf50de8c32ec70c182fa | [
"MIT"
] | 4 | 2015-05-20T20:53:02.000Z | 2019-11-12T19:46:07.000Z | # -*- coding: utf-8 -
#
# This file is part of dj-webmachine released under the MIT license.
# See the NOTICE for more information.
from django.template import loader, RequestContext
from django.utils.encoding import iri_to_uri
try:
from restkit import oauth2
except ImportError:
raise ImportError("restkit>=3.... | 32.443787 | 82 | 0.590188 | # -*- coding: utf-8 -
#
# This file is part of dj-webmachine released under the MIT license.
# See the NOTICE for more information.
from django.template import loader, RequestContext
from django.utils.encoding import iri_to_uri
try:
from restkit import oauth2
except ImportError:
raise ImportError("restkit>=3.... | 4,524 | 418 | 23 |
b7fb6d55ddc310c89f7dd03fe9fc2ce8f6e8528e | 1,623 | py | Python | commands/dns.py | thexmarat/routeros-scanner | 8587493c243572218b5a7778d8bcbc698464856b | [
"MIT"
] | null | null | null | commands/dns.py | thexmarat/routeros-scanner | 8587493c243572218b5a7778d8bcbc698464856b | [
"MIT"
] | null | null | null | commands/dns.py | thexmarat/routeros-scanner | 8587493c243572218b5a7778d8bcbc698464856b | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from commands.basecommand import BaseCommand
import re
| 27.508475 | 113 | 0.550216 | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
from commands.basecommand import BaseCommand
import re
class DNS(BaseCommand):
def __init__(self):
self.__name__ = 'DNS Cache'
def run_ssh(self, sshc):
data = self._ssh_data(sshc, '/ip dns print')
enabled = 'allo... | 1,359 | 2 | 126 |
1c2e6507af08539c77c856e95f6d4852bc06d2f2 | 9,590 | py | Python | tests/test_integration.py | repo-helper/formate | 45e4b4fe29af144db714ea90c92cf6e7035ae301 | [
"MIT"
] | 1 | 2022-03-19T07:39:58.000Z | 2022-03-19T07:39:58.000Z | tests/test_integration.py | repo-helper/formate | 45e4b4fe29af144db714ea90c92cf6e7035ae301 | [
"MIT"
] | 14 | 2021-01-25T23:10:04.000Z | 2021-06-29T19:55:38.000Z | tests/test_integration.py | repo-helper/formate | 45e4b4fe29af144db714ea90c92cf6e7035ae301 | [
"MIT"
] | null | null | null | # stdlib
import re
from typing import Union, no_type_check
# 3rd party
import click
import pytest
from _pytest.capture import CaptureResult
from coincidence.regressions import AdvancedDataRegressionFixture, AdvancedFileRegressionFixture
from coincidence.selectors import max_version, min_version, not_pypy, only_pypy
fr... | 25.710456 | 96 | 0.727216 | # stdlib
import re
from typing import Union, no_type_check
# 3rd party
import click
import pytest
from _pytest.capture import CaptureResult
from coincidence.regressions import AdvancedDataRegressionFixture, AdvancedFileRegressionFixture
from coincidence.selectors import max_version, min_version, not_pypy, only_pypy
fr... | 8,169 | 0 | 291 |
e784dd55930201f54c11184d662dda78259fd84c | 7,049 | py | Python | lib/model.py | behzadzarfsaz/DualMemoryLearning | 924905ea14466ac60589e71ff5df6e33e98b6d92 | [
"MIT"
] | null | null | null | lib/model.py | behzadzarfsaz/DualMemoryLearning | 924905ea14466ac60589e71ff5df6e33e98b6d92 | [
"MIT"
] | null | null | null | lib/model.py | behzadzarfsaz/DualMemoryLearning | 924905ea14466ac60589e71ff5df6e33e98b6d92 | [
"MIT"
] | null | null | null | import copy
import logging
import shutil
from math import exp
import numpy as np
from sklearn.preprocessing import StandardScaler, normalize
from sklearn.utils import shuffle
from tqdm import trange
from lib.bqueue import Bqueue
from lib.dnn import Dnn
from lib.helper import Helper
from lib.som import SOM
logging.basi... | 42.981707 | 110 | 0.55483 | import copy
import logging
import shutil
from math import exp
import numpy as np
from sklearn.preprocessing import StandardScaler, normalize
from sklearn.utils import shuffle
from tqdm import trange
from lib.bqueue import Bqueue
from lib.dnn import Dnn
from lib.helper import Helper
from lib.som import SOM
logging.basi... | 6,412 | 170 | 23 |
b85ee2815f52bf02efa5142a630bf19bd92d2932 | 179 | py | Python | tests/project/app/urls.py | j4mie/django-kronos | 71d90a67eb73e9c28666e77611466062ff3e3dda | [
"MIT"
] | 1 | 2015-11-05T11:45:52.000Z | 2015-11-05T11:45:52.000Z | tests/project/app/urls.py | j4mie/django-kronos | 71d90a67eb73e9c28666e77611466062ff3e3dda | [
"MIT"
] | null | null | null | tests/project/app/urls.py | j4mie/django-kronos | 71d90a67eb73e9c28666e77611466062ff3e3dda | [
"MIT"
] | null | null | null | from django.conf.urls.defaults import *
from views import home
urlpatterns = patterns('',
url(r'^$', home, name='home'),
url('fandjango/', include('fandjango.urls'))
)
| 17.9 | 48 | 0.659218 | from django.conf.urls.defaults import *
from views import home
urlpatterns = patterns('',
url(r'^$', home, name='home'),
url('fandjango/', include('fandjango.urls'))
)
| 0 | 0 | 0 |
5ca75dc888384ed0fbf1f22959de7a3910205155 | 247 | py | Python | examples/todo_app/app/__init__.py | MarkoShiva/quart | f6709c6082a3cab9dffdcd937122f4d65a5990f7 | [
"MIT"
] | 1,085 | 2017-11-12T10:56:50.000Z | 2022-03-31T15:14:26.000Z | examples/todo_app/app/__init__.py | MarkoShiva/quart | f6709c6082a3cab9dffdcd937122f4d65a5990f7 | [
"MIT"
] | 139 | 2017-12-04T09:22:48.000Z | 2022-03-26T08:34:07.000Z | examples/todo_app/app/__init__.py | MarkoShiva/quart | f6709c6082a3cab9dffdcd937122f4d65a5990f7 | [
"MIT"
] | 92 | 2017-12-08T09:55:02.000Z | 2022-03-29T20:45:44.000Z | from quart import Quart, flask_patch
from app.main import main
from .extinsions import db
| 17.642857 | 39 | 0.720648 | from quart import Quart, flask_patch
from app.main import main
from .extinsions import db
def create_app():
app = Quart(__name__)
app.config.from_pyfile("config.py")
db.init_app(app)
app.register_blueprint(main)
return app
| 133 | 0 | 23 |
c39eec60b57532ade429a9e3594f24af68db932e | 19,140 | py | Python | pychess/Players/PyChessCECP.py | jacobchrismarsh/chess_senior_project | 7797b1f96fda5d4d268224a21e54a744d17e7b81 | [
"MIT"
] | null | null | null | pychess/Players/PyChessCECP.py | jacobchrismarsh/chess_senior_project | 7797b1f96fda5d4d268224a21e54a744d17e7b81 | [
"MIT"
] | 40 | 2019-05-04T04:46:31.000Z | 2022-02-26T10:37:51.000Z | pychess/Players/PyChessCECP.py | jacobchrismarsh/chess_senior_project | 7797b1f96fda5d4d268224a21e54a744d17e7b81 | [
"MIT"
] | null | null | null | import re
import signal
import sys
from threading import Thread
import pychess
from pychess.Players.PyChess import PyChess
from pychess.System import conf, fident
from pychess.Utils.book import getOpenings
from pychess.Utils.const import (
NORMALCHESS,
FEN_START,
BLACK,
FISCHERRANDOMCHESS,
CRAZYHOU... | 38.05169 | 95 | 0.446708 | import re
import signal
import sys
from threading import Thread
import pychess
from pychess.Players.PyChess import PyChess
from pychess.System import conf, fident
from pychess.Utils.book import getOpenings
from pychess.Utils.const import (
NORMALCHESS,
FEN_START,
BLACK,
FISCHERRANDOMCHESS,
CRAZYHOU... | 17,438 | 6 | 261 |
9fad8fab23d2e89d70ef2d82789107db78ebaf08 | 483 | py | Python | colossalai/nn/layer/parallel_sequence/_utils.py | RichardoLuo/ColossalAI | 797a9dc5a9e801d7499b8667c3ef039a38aa15ba | [
"Apache-2.0"
] | 1,630 | 2021-10-30T01:00:27.000Z | 2022-03-31T23:02:41.000Z | colossalai/nn/layer/parallel_sequence/_utils.py | RichardoLuo/ColossalAI | 797a9dc5a9e801d7499b8667c3ef039a38aa15ba | [
"Apache-2.0"
] | 166 | 2021-10-30T01:03:01.000Z | 2022-03-31T14:19:07.000Z | colossalai/nn/layer/parallel_sequence/_utils.py | RichardoLuo/ColossalAI | 797a9dc5a9e801d7499b8667c3ef039a38aa15ba | [
"Apache-2.0"
] | 253 | 2021-10-30T06:10:29.000Z | 2022-03-31T13:30:06.000Z | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
| 30.1875 | 69 | 0.726708 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
def _calc_incoming_device_range(i, rank, world_size, sub_seq_length):
device_of_incoming_k = (rank - i - 1) % world_size
start_idx = sub_seq_length * device_of_incoming_k
end_idx = sub_seq_length * (device_of_incoming_k + 1)
return start_idx, end_idx
d... | 387 | 0 | 46 |
a54633146fadd221f3a0c7ca6783f0b136db02a8 | 438 | py | Python | staticClassMethod/classmethodCustom.py | liangjie18430/flask_test_myself | 8923e058d834d6ab7326f869b945601c13674105 | [
"BSD-3-Clause"
] | null | null | null | staticClassMethod/classmethodCustom.py | liangjie18430/flask_test_myself | 8923e058d834d6ab7326f869b945601c13674105 | [
"BSD-3-Clause"
] | null | null | null | staticClassMethod/classmethodCustom.py | liangjie18430/flask_test_myself | 8923e058d834d6ab7326f869b945601c13674105 | [
"BSD-3-Clause"
] | null | null | null | print(Class2.get_user("test"))
| 27.375 | 53 | 0.623288 | class MyClassMethod(object):
def __init__(self,function):
self.function = function
def __get__(self, instance, type=None):
def wrapper(*args,**kwargs):
print("class method:",type)
return self.function(type,*args,**kwargs)
return wrapper
class Class2(object):
@... | 258 | 52 | 96 |
c863133d1f0fec6fd6c1d9ca24de23ddc72f2fe4 | 543 | py | Python | tests/parser/dictionary/encoder/other/test_ipi_base.py | orenyodfat/CWR-DataApi | f3b6ba8308c901b6ab87073c155c08e30692333c | [
"MIT"
] | 37 | 2015-04-21T15:33:53.000Z | 2022-02-07T00:02:29.000Z | tests/parser/dictionary/encoder/other/test_ipi_base.py | orenyodfat/CWR-DataApi | f3b6ba8308c901b6ab87073c155c08e30692333c | [
"MIT"
] | 86 | 2015-02-01T22:26:02.000Z | 2021-07-09T08:49:36.000Z | tests/parser/dictionary/encoder/other/test_ipi_base.py | orenyodfat/CWR-DataApi | f3b6ba8308c901b6ab87073c155c08e30692333c | [
"MIT"
] | 27 | 2015-01-26T16:01:09.000Z | 2021-11-08T23:53:55.000Z | # -*- coding: utf-8 -*-
import unittest
from cwr.parser.encoder.dictionary import IPIBaseDictionaryEncoder
"""
Acknowledgement to dictionary encoding tests.
The following cases are tested:
"""
__author__ = 'Bernardo Martínez Garrido'
__license__ = 'MIT'
__status__ = 'Development'
| 20.884615 | 66 | 0.725599 | # -*- coding: utf-8 -*-
import unittest
from cwr.parser.encoder.dictionary import IPIBaseDictionaryEncoder
"""
Acknowledgement to dictionary encoding tests.
The following cases are tested:
"""
__author__ = 'Bernardo Martínez Garrido'
__license__ = 'MIT'
__status__ = 'Development'
class TestIPIBaseEncoding(unitte... | 156 | 24 | 76 |
ed3946252bbf181f1e56534e33e67fe22228f3cb | 1,302 | py | Python | make-examples.py | mattwigway/asu-matplotlib-styles | 1168529d7476ab5519a9754e21243a704f980b8b | [
"CC0-1.0"
] | 1 | 2021-04-09T15:47:19.000Z | 2021-04-09T15:47:19.000Z | make-examples.py | mattwigway/asu-matplotlib-styles | 1168529d7476ab5519a9754e21243a704f980b8b | [
"CC0-1.0"
] | 4 | 2020-05-07T16:57:44.000Z | 2020-05-07T19:12:57.000Z | make-examples.py | mattwigway/asu-matplotlib-styles | 1168529d7476ab5519a9754e21243a704f980b8b | [
"CC0-1.0"
] | null | null | null | # Create example plots for README
import numpy as np
import matplotlib.pyplot as plt
import os.path
create_plot('asu-dark')
create_plot('asu-light')
| 29.590909 | 113 | 0.600614 | # Create example plots for README
import numpy as np
import matplotlib.pyplot as plt
import os.path
def create_plot (style):
# make darn sure we're using the styles from the repo, and not the styles that may be installed on the system
plt.style.use(os.path.join(os.path.dirname(__file__), 'styles', f'{style}.m... | 1,127 | 0 | 23 |
10f7880be68b0fe1ae5479576360e9ca861c278e | 16,979 | py | Python | plugins/imagetools.py | FastmoreCrak/Fantasmas | 1ce7a55b956ccf84660ceb91fdc39fedd0384c2a | [
"CC0-1.0"
] | 1 | 2021-10-04T08:02:29.000Z | 2021-10-04T08:02:29.000Z | plugins/imagetools.py | FastmoreCrak/Fantasmas | 1ce7a55b956ccf84660ceb91fdc39fedd0384c2a | [
"CC0-1.0"
] | null | null | null | plugins/imagetools.py | FastmoreCrak/Fantasmas | 1ce7a55b956ccf84660ceb91fdc39fedd0384c2a | [
"CC0-1.0"
] | null | null | null | # Ultroid - UserBot
# Copyright (C) 2020 TeamUltroid
#
# This file is a part of < https://github.com/TeamUltroid/Ultroid/ >
# PLease read the GNU Affero General Public License in
# <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>.
"""
✘ Commands Available -
• `{i}grey <reply to any media>`
To make ... | 29.375433 | 85 | 0.586077 | # Ultroid - UserBot
# Copyright (C) 2020 TeamUltroid
#
# This file is a part of < https://github.com/TeamUltroid/Ultroid/ >
# PLease read the GNU Affero General Public License in
# <https://www.github.com/TeamUltroid/Ultroid/blob/main/LICENSE/>.
"""
✘ Commands Available -
• `{i}grey <reply to any media>`
To make ... | 14,880 | 0 | 264 |
f8f262256e4880036fe4a485426240fd3f260a78 | 37 | py | Python | cupy_alias/math/misc.py | fixstars/clpy | 693485f85397cc110fa45803c36c30c24c297df0 | [
"BSD-3-Clause"
] | 142 | 2018-06-07T07:43:10.000Z | 2021-10-30T21:06:32.000Z | cupy_alias/math/misc.py | fixstars/clpy | 693485f85397cc110fa45803c36c30c24c297df0 | [
"BSD-3-Clause"
] | 282 | 2018-06-07T08:35:03.000Z | 2021-03-31T03:14:32.000Z | cupy_alias/math/misc.py | fixstars/clpy | 693485f85397cc110fa45803c36c30c24c297df0 | [
"BSD-3-Clause"
] | 19 | 2018-06-19T11:07:53.000Z | 2021-05-13T20:57:04.000Z | from clpy.math.misc import * # NOQA
| 18.5 | 36 | 0.702703 | from clpy.math.misc import * # NOQA
| 0 | 0 | 0 |
0cc45d58110cb6174543a0505e632ae185525ec0 | 1,990 | py | Python | Basics_with_Pytorch/GradientDescent/hw1.py | SoyOscarRH/LearningNeuralNetworks | dd5be94b38b3a0efb3428f76d3416227a92c8265 | [
"MIT"
] | 3 | 2020-01-20T19:56:35.000Z | 2021-09-24T14:47:33.000Z | Basics_with_Pytorch/GradientDescent/hw1.py | SoyOscarRH/LearningNeuralNetworks | dd5be94b38b3a0efb3428f76d3416227a92c8265 | [
"MIT"
] | null | null | null | Basics_with_Pytorch/GradientDescent/hw1.py | SoyOscarRH/LearningNeuralNetworks | dd5be94b38b3a0efb3428f76d3416227a92c8265 | [
"MIT"
] | null | null | null |
x1 = 2.0
x2 = 3.0
ReLu = lambda x: max(0.0, x)
ReLuDer = lambda x: 1 if x > 0 else 0
error_fn = lambda prediction, target: 0.5 * (target - prediction) ** 2
# input
a1 = x1
a2 = x2
w11 = 0.11
w12 = 0.21
w21 = 0.12
w22 = 0.08
w1o = 0.14
w2o = 0.15
y = 1
n = 0.5
# foward
# layer 1
zh1 = (w11 * a1) + (w12 * a2)
zh... | 18.425926 | 71 | 0.682412 |
x1 = 2.0
x2 = 3.0
ReLu = lambda x: max(0.0, x)
ReLuDer = lambda x: 1 if x > 0 else 0
error_fn = lambda prediction, target: 0.5 * (target - prediction) ** 2
# input
a1 = x1
a2 = x2
w11 = 0.11
w12 = 0.21
w21 = 0.12
w22 = 0.08
w1o = 0.14
w2o = 0.15
y = 1
n = 0.5
# foward
# layer 1
zh1 = (w11 * a1) + (w12 * a2)
zh... | 0 | 0 | 0 |
5e6ad37894ff484c99a09273a78bac3f081c7374 | 24,618 | py | Python | medcat/cdb.py | HDRUK/MedCAT | 69c36d1da484ad32520a9b3333adf8f6ebfcbde7 | [
"Apache-2.0"
] | null | null | null | medcat/cdb.py | HDRUK/MedCAT | 69c36d1da484ad32520a9b3333adf8f6ebfcbde7 | [
"Apache-2.0"
] | null | null | null | medcat/cdb.py | HDRUK/MedCAT | 69c36d1da484ad32520a9b3333adf8f6ebfcbde7 | [
"Apache-2.0"
] | null | null | null | """ Representation class for CDB data
"""
import pickle
import numpy as np
from scipy.sparse import dok_matrix
#from gensim.matutils import unitvec
from medcat.utils.matutils import unitvec, sigmoid
from medcat.utils.attr_dict import AttrDict
from medcat.utils.loggers import basic_logger
import os
import pandas as pd
... | 38.525822 | 140 | 0.575311 | """ Representation class for CDB data
"""
import pickle
import numpy as np
from scipy.sparse import dok_matrix
#from gensim.matutils import unitvec
from medcat.utils.matutils import unitvec, sigmoid
from medcat.utils.attr_dict import AttrDict
from medcat.utils.loggers import basic_logger
import os
import pandas as pd
... | 4,990 | 0 | 188 |
4c03df4b5b036cc3c13f8cad12fd34cb4631bfd3 | 11,458 | py | Python | dazeus/dazeus.py | dazeus/dazeus-python | 8b83624f1aee63f41ea6129b3d5924626492a0af | [
"BSD-3-Clause"
] | 1 | 2019-02-10T14:54:08.000Z | 2019-02-10T14:54:08.000Z | dazeus/dazeus.py | dazeus/dazeus-python | 8b83624f1aee63f41ea6129b3d5924626492a0af | [
"BSD-3-Clause"
] | null | null | null | dazeus/dazeus.py | dazeus/dazeus-python | 8b83624f1aee63f41ea6129b3d5924626492a0af | [
"BSD-3-Clause"
] | null | null | null | from .scope import Scope
import socket
import json
| 35.80625 | 113 | 0.563973 | from .scope import Scope
import socket
import json
class DaZeus:
def __init__(self, addr, debug = False):
if ':' not in addr:
raise AttributeError("Invalid address specified, expected: unix:/path/to/file or tcp:host:port")
[proto, location] = addr.split(':', 1)
if proto == 'un... | 10,339 | -8 | 1,075 |
e843de334f3334ef6fcdc8a716988c1da1b98457 | 1,380 | py | Python | tagopsdb/model/ns_vip_binds.py | ifwe/tagopsdb | 5455810cb9ccdd0803975a2513741c43313b1b7d | [
"Apache-2.0"
] | null | null | null | tagopsdb/model/ns_vip_binds.py | ifwe/tagopsdb | 5455810cb9ccdd0803975a2513741c43313b1b7d | [
"Apache-2.0"
] | 1 | 2021-03-25T21:57:08.000Z | 2021-03-25T21:57:08.000Z | tagopsdb/model/ns_vip_binds.py | ifwe/tagopsdb | 5455810cb9ccdd0803975a2513741c43313b1b7d | [
"Apache-2.0"
] | 1 | 2016-08-02T06:05:58.000Z | 2016-08-02T06:05:58.000Z | # Copyright 2016 Ifwe Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 31.363636 | 76 | 0.707971 | # Copyright 2016 Ifwe Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | 0 | 620 | 23 |
96554955e1e867ce4e811b1753e447421a931915 | 29,675 | py | Python | python/play.py | 030helios/Kata2Connect5 | e8ace620284b46f4a50fc0582924cbadf32653e7 | [
"MIT"
] | null | null | null | python/play.py | 030helios/Kata2Connect5 | e8ace620284b46f4a50fc0582924cbadf32653e7 | [
"MIT"
] | 1 | 2021-06-03T14:30:04.000Z | 2021-06-03T14:40:32.000Z | python/play.py | 030helios/Kata2Surakarta | e8ace620284b46f4a50fc0582924cbadf32653e7 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import sys
import os
import argparse
import traceback
import random
import math
import time
import re
import logging
import colorsys
import json
import tensorflow as tf
import numpy as np
from board import Board
from model import Model
import common
description = """
Play go with a trained neural n... | 34.505814 | 171 | 0.658635 | #!/usr/bin/python3
import sys
import os
import argparse
import traceback
import random
import math
import time
import re
import logging
import colorsys
import json
import tensorflow as tf
import numpy as np
from board import Board
from model import Model
import common
description = """
Play go with a trained neural n... | 26,203 | -5 | 275 |
e1f2ff87b306b5118c6404d2e8d28e29a993265e | 1,832 | py | Python | stim_amplitude_scan.py | maxnolte/deciphering_variability | bea48cc3c04e63f3acdd1b86563eb792358c91a8 | [
"MIT"
] | 2 | 2020-04-22T12:02:32.000Z | 2021-06-21T17:35:15.000Z | stim_amplitude_scan.py | maxnolte/deciphering_variability | bea48cc3c04e63f3acdd1b86563eb792358c91a8 | [
"MIT"
] | null | null | null | stim_amplitude_scan.py | maxnolte/deciphering_variability | bea48cc3c04e63f3acdd1b86563eb792358c91a8 | [
"MIT"
] | 3 | 2019-09-26T07:32:50.000Z | 2021-06-21T17:35:29.000Z | import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
plt.rcParams['pdf.fonttype'] = 42
import bluepy
variances = ['0p001', '0p01', '0p05', '0p1', '0p5', '1p0', '1p5', '2p0', '10p0']
bcs = ['/gpfs/bbp.cscs.ch/project/proj9/simulations/nolte/variability/spontaneous/base_seeds_abc... | 36.64 | 161 | 0.686681 | import numpy as np
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
plt.rcParams['pdf.fonttype'] = 42
import bluepy
variances = ['0p001', '0p01', '0p05', '0p1', '0p5', '1p0', '1p5', '2p0', '10p0']
bcs = ['/gpfs/bbp.cscs.ch/project/proj9/simulations/nolte/variability/spontaneous/base_seeds_abc... | 0 | 0 | 0 |
761606c02fc534ca8cbdc3d2fa43d7330287a1ad | 5,312 | py | Python | opengenomebrowser_tools/init_database.py | opengenomebrowser/opengenomebrowser-tools | b6ef2340b2fd67a61373d1d8a0f3ef71cc892d1e | [
"MIT"
] | null | null | null | opengenomebrowser_tools/init_database.py | opengenomebrowser/opengenomebrowser-tools | b6ef2340b2fd67a61373d1d8a0f3ef71cc892d1e | [
"MIT"
] | null | null | null | opengenomebrowser_tools/init_database.py | opengenomebrowser/opengenomebrowser-tools | b6ef2340b2fd67a61373d1d8a0f3ef71cc892d1e | [
"MIT"
] | null | null | null | import os
import json
import shutil
from urllib import request
from .utils import PACKAGE_ROOT
from . import __folder_structure_version__
def init_database(database_dir: str = None) -> None:
"""
Creates a basic OpenGenomeBrowser folders structure.
Result:
database
├── organisms
... | 35.413333 | 144 | 0.650414 | import os
import json
import shutil
from urllib import request
from .utils import PACKAGE_ROOT
from . import __folder_structure_version__
def download_go_data(out: str) -> None:
source_url = 'http://purl.obolibrary.org/obo/go.obo'
print(f'Converting {source_url} -> {out}')
def go_generator(io) -> [str]:... | 2,670 | 0 | 92 |
eec21b3ad639e8afdd2bc2479ae343026b26ed85 | 1,011 | py | Python | src/base/torchvision_dataset.py | bjfranks/Classification-AD | 4eecd6648bb6b54662944921924c8960c2ca236c | [
"MIT"
] | 27 | 2020-05-30T16:27:31.000Z | 2022-03-28T16:45:25.000Z | src/base/torchvision_dataset.py | bjfranks/Classification-AD | 4eecd6648bb6b54662944921924c8960c2ca236c | [
"MIT"
] | 3 | 2021-04-22T10:01:55.000Z | 2022-01-13T02:50:31.000Z | src/base/torchvision_dataset.py | bjfranks/Classification-AD | 4eecd6648bb6b54662944921924c8960c2ca236c | [
"MIT"
] | 7 | 2020-06-15T16:31:23.000Z | 2022-03-23T09:33:32.000Z | from .base_dataset import BaseADDataset
from torch.utils.data import DataLoader
class TorchvisionDataset(BaseADDataset):
"""TorchvisionDataset class for datasets already implemented in torchvision.datasets."""
| 50.55 | 111 | 0.697329 | from .base_dataset import BaseADDataset
from torch.utils.data import DataLoader
class TorchvisionDataset(BaseADDataset):
"""TorchvisionDataset class for datasets already implemented in torchvision.datasets."""
def __init__(self, root: str):
super().__init__(root)
self.image_size = None # tu... | 741 | 0 | 54 |
53ba41eb81896191d5d26dcb15844fd97e74a3e7 | 6,272 | py | Python | frictionless/file.py | augusto-herrmann/frictionless-py | b4ff35f064141a2c04882edb592666ca6b066776 | [
"MIT"
] | 1 | 2021-11-08T22:29:30.000Z | 2021-11-08T22:29:30.000Z | frictionless/file.py | augusto-herrmann/frictionless-py | b4ff35f064141a2c04882edb592666ca6b066776 | [
"MIT"
] | null | null | null | frictionless/file.py | augusto-herrmann/frictionless-py | b4ff35f064141a2c04882edb592666ca6b066776 | [
"MIT"
] | null | null | null | import os
import glob
from pathlib import Path
from .helpers import cached_property
from . import helpers
from . import config
# NOTE:
# For better detection we can add an argument allowing metadata reading
# Exact set of file types needs to be reviewed
class File:
"""File representation"""
@cached_propert... | 30.595122 | 87 | 0.557398 | import os
import glob
from pathlib import Path
from .helpers import cached_property
from . import helpers
from . import config
# NOTE:
# For better detection we can add an argument allowing metadata reading
# Exact set of file types needs to be reviewed
class File:
"""File representation"""
def __init__(se... | 5,184 | 0 | 444 |
bc521fe8e156c2bea30c143fc4f2a1b5f920fe18 | 4,919 | py | Python | data/parsers/spain.py | hdsheena/covid19_scenarios | ea67a75a99c20b0948ef6d377bc6cfbec6e670b5 | [
"MIT"
] | 1,550 | 2020-03-10T13:18:53.000Z | 2022-03-29T13:48:11.000Z | data/parsers/spain.py | hdsheena/covid19_scenarios | ea67a75a99c20b0948ef6d377bc6cfbec6e670b5 | [
"MIT"
] | 835 | 2020-03-09T21:52:19.000Z | 2022-02-02T08:06:21.000Z | data/parsers/spain.py | hdsheena/covid19_scenarios | ea67a75a99c20b0948ef6d377bc6cfbec6e670b5 | [
"MIT"
] | 444 | 2020-03-13T03:24:13.000Z | 2021-11-15T19:08:53.000Z | import sys
import requests
import csv
import io
from datetime import datetime
from collections import defaultdict
from .utils import store_data, stoi
# ------------------------------------------------------------------------
# Globals
deaths_URL = "https://raw.githubusercontent.com/datadista/datasets/master/CO... | 46.847619 | 143 | 0.544623 | import sys
import requests
import csv
import io
from datetime import datetime
from collections import defaultdict
from .utils import store_data, stoi
# ------------------------------------------------------------------------
# Globals
deaths_URL = "https://raw.githubusercontent.com/datadista/datasets/master/CO... | 3,903 | 0 | 23 |
a104266d8b0c9acf1fa4b9cf1a58128f80fb8476 | 6,749 | py | Python | src/pymor/discretizers/advection.py | JuliaBru/pymor | 46343b527267213f4279ea36f208b542ab291c4e | [
"Unlicense"
] | null | null | null | src/pymor/discretizers/advection.py | JuliaBru/pymor | 46343b527267213f4279ea36f208b542ab291c4e | [
"Unlicense"
] | null | null | null | src/pymor/discretizers/advection.py | JuliaBru/pymor | 46343b527267213f4279ea36f208b542ab291c4e | [
"Unlicense"
] | null | null | null | # This file is part of the pyMOR project (http://www.pymor.org).
# Copyright 2013-2016 pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
import numpy as np
from pymor.algorithms.timestepping import ExplicitEulerTimeStepper
from pymor.... | 50.365672 | 120 | 0.659061 | # This file is part of the pyMOR project (http://www.pymor.org).
# Copyright 2013-2016 pyMOR developers and contributors. All rights reserved.
# License: BSD 2-Clause License (http://opensource.org/licenses/BSD-2-Clause)
import numpy as np
from pymor.algorithms.timestepping import ExplicitEulerTimeStepper
from pymor.... | 305 | 0 | 30 |
076f222cfcfc72e18413b42acd4e53e8930fdab1 | 2,403 | py | Python | misc-code/adventure_items.py | cctechwiz-teaching/python-code-camp | 1453bebe44d66f27558eb6204fbf4d5f08cc756e | [
"MIT"
] | 2 | 2019-06-22T17:13:16.000Z | 2019-06-22T17:13:17.000Z | misc-code/adventure_items.py | cctechwiz-teaching/python-code-camp | 1453bebe44d66f27558eb6204fbf4d5f08cc756e | [
"MIT"
] | null | null | null | misc-code/adventure_items.py | cctechwiz-teaching/python-code-camp | 1453bebe44d66f27558eb6204fbf4d5f08cc756e | [
"MIT"
] | null | null | null | """
object_adventure.py
A text adventure with objects you can pick up and put down.
"""
# data setup
rooms = {
'empty': {'name': 'an empty room',
'east': 'bedroom', 'north': 'temple',
'contents': [],
'text': 'The stone floors and walls are cold and damp.'},
'temple': {'name': 'a sma... | 33.375 | 108 | 0.56804 | """
object_adventure.py
A text adventure with objects you can pick up and put down.
"""
# data setup
rooms = {
'empty': {'name': 'an empty room',
'east': 'bedroom', 'north': 'temple',
'contents': [],
'text': 'The stone floors and walls are cold and damp.'},
'temple': {'name': 'a sma... | 0 | 0 | 0 |
4b9d26720cda64f817643aa05a92dd1452685e67 | 17,109 | py | Python | python/graphscope/nx/classes/cache.py | lnfjpt/GraphScope | 917146f86d8387302a2e1de6963115e7568bf3ee | [
"Apache-2.0"
] | 1 | 2021-12-30T02:55:16.000Z | 2021-12-30T02:55:16.000Z | python/graphscope/nx/classes/cache.py | lnfjpt/GraphScope | 917146f86d8387302a2e1de6963115e7568bf3ee | [
"Apache-2.0"
] | null | null | null | python/graphscope/nx/classes/cache.py | lnfjpt/GraphScope | 917146f86d8387302a2e1de6963115e7568bf3ee | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020 Alibaba Group Holding Limited. 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... | 35.867925 | 88 | 0.614004 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020 Alibaba Group Holding Limited. 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... | 6,228 | 0 | 640 |
e96b8708dc8be78814c697d042595105e2d873c2 | 80 | py | Python | Getting_Started_With_Raspberry_Pi_Pico/variable/code.py | gamblor21/Adafruit_Learning_System_Guides | f5dab4a758bc82d0bfc3c299683fe89dc093912a | [
"MIT"
] | 665 | 2017-09-27T21:20:14.000Z | 2022-03-31T09:09:25.000Z | Getting_Started_With_Raspberry_Pi_Pico/variable/code.py | gamblor21/Adafruit_Learning_System_Guides | f5dab4a758bc82d0bfc3c299683fe89dc093912a | [
"MIT"
] | 641 | 2017-10-03T19:46:37.000Z | 2022-03-30T18:28:46.000Z | Getting_Started_With_Raspberry_Pi_Pico/variable/code.py | gamblor21/Adafruit_Learning_System_Guides | f5dab4a758bc82d0bfc3c299683fe89dc093912a | [
"MIT"
] | 734 | 2017-10-02T22:47:38.000Z | 2022-03-30T14:03:51.000Z | """Example of assigning a variable."""
user_name = input("What is your name? ")
| 26.666667 | 40 | 0.6875 | """Example of assigning a variable."""
user_name = input("What is your name? ")
| 0 | 0 | 0 |
ba26ee36cc7ff86ae625d2c3ea20dd09a7c5df07 | 10,605 | py | Python | generator/verify/verification.py | biarmic/OpenCache | bb9e110e434deb83900de328cc76b63901ba582f | [
"BSD-3-Clause"
] | 5 | 2021-09-15T18:29:49.000Z | 2022-03-26T04:41:01.000Z | generator/verify/verification.py | VLSIDA/OpenCache | 0e79bf353c68d57dcc49d78178b12fd0b468f19a | [
"BSD-3-Clause"
] | null | null | null | generator/verify/verification.py | VLSIDA/OpenCache | 0e79bf353c68d57dcc49d78178b12fd0b468f19a | [
"BSD-3-Clause"
] | null | null | null | # See LICENSE for licensing information.
#
# Copyright (c) 2021 Regents of the University of California and The Board
# of Regents for the Oklahoma Agricultural and Mechanical College
# (acting for and on behalf of Oklahoma State University)
# All rights reserved.
#
import os
import datetime
from shutil import copyfile... | 37.341549 | 107 | 0.587553 | # See LICENSE for licensing information.
#
# Copyright (c) 2021 Regents of the University of California and The Board
# of Regents for the Oklahoma Agricultural and Mechanical College
# (acting for and on behalf of Oklahoma State University)
# All rights reserved.
#
import os
import datetime
from shutil import copyfile... | 525 | 0 | 27 |
096bef6a7e19140fbcbbb6f9b9f073ddfde424c9 | 1,904 | py | Python | tests/io/complex/test_sentinel.py | anielsen001/sarpy | 07bf157f54a5304185fc0e1c34010053fd6ae9d9 | [
"MIT"
] | null | null | null | tests/io/complex/test_sentinel.py | anielsen001/sarpy | 07bf157f54a5304185fc0e1c34010053fd6ae9d9 | [
"MIT"
] | null | null | null | tests/io/complex/test_sentinel.py | anielsen001/sarpy | 07bf157f54a5304185fc0e1c34010053fd6ae9d9 | [
"MIT"
] | null | null | null | import os
import time
import logging
import numpy
from . import unittest
from sarpy.io.complex.sentinel import SentinelReader
from sarpy.deprecated.io.complex.sentinel import Reader as DepReader
| 36.615385 | 128 | 0.654937 | import os
import time
import logging
import numpy
from . import unittest
from sarpy.io.complex.sentinel import SentinelReader
from sarpy.deprecated.io.complex.sentinel import Reader as DepReader
def generic_sen_test(instance, test_root, test_file):
assert isinstance(instance, unittest.TestCase)
with instan... | 1,565 | 94 | 46 |
44c5c5559e150d12b5d92e5dc6beacebcad1139e | 2,543 | py | Python | src/model.py | anuragithub/song-lyrics-generator | 83b1e5e456728b8d4ab4e61b4dacd15536392c4d | [
"Apache-2.0"
] | 4 | 2019-09-20T19:55:34.000Z | 2020-03-31T06:00:56.000Z | src/model.py | anuragithub/song-lyrics-generator | 83b1e5e456728b8d4ab4e61b4dacd15536392c4d | [
"Apache-2.0"
] | null | null | null | src/model.py | anuragithub/song-lyrics-generator | 83b1e5e456728b8d4ab4e61b4dacd15536392c4d | [
"Apache-2.0"
] | null | null | null | from keras.preprocessing.text import Tokenizer
from keras.utils import to_categorical
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from keras.layers import Embedding
from keras.preprocessing.sequence import pad_sequences
from keras.utils import plot_model
# mo... | 33.906667 | 103 | 0.666929 | from keras.preprocessing.text import Tokenizer
from keras.utils import to_categorical
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
from keras.layers import Embedding
from keras.preprocessing.sequence import pad_sequences
from keras.utils import plot_model
class Nl... | 1,974 | 2 | 153 |
4f8c478608725f2b5f7f6d757accdd8ed252d898 | 286 | py | Python | firefox_bookmarks_deduplicator/cli_parser.py | james-cube/firefox-bookmarks-deduplicator | 5153d9fd2a79b97e106796f0c3e35ddc920204a6 | [
"MIT"
] | 11 | 2017-09-24T04:13:31.000Z | 2020-08-25T15:40:50.000Z | firefox_bookmarks_deduplicator/cli_parser.py | james-cube/firefox-bookmarks-deduplicator | 5153d9fd2a79b97e106796f0c3e35ddc920204a6 | [
"MIT"
] | 1 | 2018-05-02T19:08:32.000Z | 2018-05-07T23:01:25.000Z | firefox_bookmarks_deduplicator/cli_parser.py | james-cube/firefox-bookmarks-deduplicator | 5153d9fd2a79b97e106796f0c3e35ddc920204a6 | [
"MIT"
] | 2 | 2017-09-24T04:43:17.000Z | 2019-10-20T17:24:00.000Z | import argparse
| 35.75 | 85 | 0.702797 | import argparse
def parse_arguments():
parser = argparse.ArgumentParser()
parser.add_argument('--file', dest='file', help='File to process', required=True)
parser.add_argument('--output', dest='output', help='Output file', required=True)
return parser.parse_args()
| 247 | 0 | 23 |
93162a2be83d4a32945d947bbd5f1a2645032e31 | 9,075 | py | Python | pyfr/readers/gmsh.py | synthetik-technologies/PyFR | 9d4d5e96a8a9d5ca47970ec197b251ae8b0ecdda | [
"BSD-3-Clause"
] | 1 | 2020-06-23T16:37:06.000Z | 2020-06-23T16:37:06.000Z | pyfr/readers/gmsh.py | synthetik-technologies/PyFR | 9d4d5e96a8a9d5ca47970ec197b251ae8b0ecdda | [
"BSD-3-Clause"
] | null | null | null | pyfr/readers/gmsh.py | synthetik-technologies/PyFR | 9d4d5e96a8a9d5ca47970ec197b251ae8b0ecdda | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from collections import defaultdict
import re
import numpy as np
from pyfr.readers import BaseReader, NodalMeshAssembler
from pyfr.readers.nodemaps import GmshNodeMaps
| 33.241758 | 78 | 0.523747 | # -*- coding: utf-8 -*-
from collections import defaultdict
import re
import numpy as np
from pyfr.readers import BaseReader, NodalMeshAssembler
from pyfr.readers.nodemaps import GmshNodeMaps
def msh_section(mshit, section):
endln = '$End{}\n'.format(section)
endix = int(next(mshit)) - 1
for i, l in e... | 7,105 | 1,727 | 46 |
b4da4a65d4e00689281ae22f04447e598748b518 | 246 | py | Python | tests/conftest.py | stephen-bunn/tomlark | 5554801b1bccac2f780770e60ebd8f15e996d89d | [
"0BSD"
] | null | null | null | tests/conftest.py | stephen-bunn/tomlark | 5554801b1bccac2f780770e60ebd8f15e996d89d | [
"0BSD"
] | null | null | null | tests/conftest.py | stephen-bunn/tomlark | 5554801b1bccac2f780770e60ebd8f15e996d89d | [
"0BSD"
] | null | null | null | # -*- encoding: utf-8 -*-
# Copyright (c) 2019 Stephen Bunn <stephen@bunn.io>
# ISC License <https://opensource.org/licenses/isc>
"""
"""
import pytest
from tomlark.parser import Parser
@pytest.fixture
| 15.375 | 51 | 0.686992 | # -*- encoding: utf-8 -*-
# Copyright (c) 2019 Stephen Bunn <stephen@bunn.io>
# ISC License <https://opensource.org/licenses/isc>
"""
"""
import pytest
from tomlark.parser import Parser
@pytest.fixture
def toml_parser():
return Parser()
| 17 | 0 | 22 |
a442d4a0784271f2955bb9cc4bd3cd28feea0760 | 67 | py | Python | glft2vmd/constants.py | Sage-of-Mirrors/gltf2vmd | 76aa5ae25785f8de50351daa27a5b986daa781f0 | [
"MIT"
] | null | null | null | glft2vmd/constants.py | Sage-of-Mirrors/gltf2vmd | 76aa5ae25785f8de50351daa27a5b986daa781f0 | [
"MIT"
] | 6 | 2019-02-05T03:35:26.000Z | 2019-02-07T05:44:15.000Z | glft2vmd/constants.py | Sage-of-Mirrors/gltf2vmd | 76aa5ae25785f8de50351daa27a5b986daa781f0 | [
"MIT"
] | null | null | null | VERSION = 1 # The version number of the format
SECTION_COUNT = 14
| 22.333333 | 47 | 0.746269 | VERSION = 1 # The version number of the format
SECTION_COUNT = 14
| 0 | 0 | 0 |
f2df1d356f4cd6e8c2aa0001414f4ddc09b86330 | 483 | py | Python | appveyor.py | ahtik/appv-39-exp | ab74bbdbabae051a644a7fa6b952234f6d23d567 | [
"Apache-2.0"
] | null | null | null | appveyor.py | ahtik/appv-39-exp | ab74bbdbabae051a644a7fa6b952234f6d23d567 | [
"Apache-2.0"
] | null | null | null | appveyor.py | ahtik/appv-39-exp | ab74bbdbabae051a644a7fa6b952234f6d23d567 | [
"Apache-2.0"
] | null | null | null | import subprocess as sp
| 24.15 | 73 | 0.612836 | import subprocess as sp
def run_command(cmdline, **kwargs):
if not isinstance(cmdline, str):
cmdline = list(map(str, cmdline))
sp.check_call(cmdline, **kwargs)
def run_python(args, **kwargs):
return run_command(["C:\\Python39-x64\\python.exe"] + args, **kwargs)
def python_info():
run_comma... | 387 | 0 | 69 |
5b9afc7b9248105d7d8416827b48e86831ababb9 | 548 | py | Python | easy/problem118/solution.py | cutoutsy/leetcode | 0734f1060a0340370b8234e8072d70c10d4306d9 | [
"Apache-2.0"
] | 1 | 2018-02-25T03:45:04.000Z | 2018-02-25T03:45:04.000Z | easy/problem118/solution.py | cutoutsy/leetcode | 0734f1060a0340370b8234e8072d70c10d4306d9 | [
"Apache-2.0"
] | null | null | null | easy/problem118/solution.py | cutoutsy/leetcode | 0734f1060a0340370b8234e8072d70c10d4306d9 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
| 26.095238 | 59 | 0.410584 | #!/usr/bin/python
# -*- coding: utf-8 -*-
class Solution(object):
def generate(self, numRows):
"""
:type numRows: int
:rtype: List[List[int]]
"""
ans = []
if numRows == 0: return ans
ans.append([1])
for i in range(1,numRows):
row = []
... | 0 | 484 | 22 |
e4f7f7cca2308469990c26afe281704cf43f3897 | 1,532 | py | Python | src/astro/__init__.py | astro-projects/astro | 7fa0404fc690569ff85e379ecca54778f09a9333 | [
"Apache-2.0"
] | 71 | 2021-12-06T22:41:59.000Z | 2022-03-31T21:47:16.000Z | src/astro/__init__.py | astro-projects/astro | 7fa0404fc690569ff85e379ecca54778f09a9333 | [
"Apache-2.0"
] | 171 | 2021-12-14T07:34:57.000Z | 2022-03-31T21:04:15.000Z | src/astro/__init__.py | astro-projects/astro | 7fa0404fc690569ff85e379ecca54778f09a9333 | [
"Apache-2.0"
] | 11 | 2021-12-06T22:46:23.000Z | 2022-03-31T18:09:46.000Z | """A decorator that allows users to run SQL queries natively in Airflow."""
__version__ = "0.9.1"
# The following line is an import work-around to avoid raising a circular dependency issue related to `create_database`
# Without this, if we run the following imports, in this specific order:
# from astro.databases im... | 46.424242 | 119 | 0.727807 | """A decorator that allows users to run SQL queries natively in Airflow."""
__version__ = "0.9.1"
# The following line is an import work-around to avoid raising a circular dependency issue related to `create_database`
# Without this, if we run the following imports, in this specific order:
# from astro.databases im... | 278 | 0 | 22 |
1c84f381723e000bfb669c57e2bd3a49b340519c | 736 | py | Python | packages/pyright-internal/src/tests/samples/variadicTypeVar12.py | Jasha10/pyright | 0ce0cfa10fe7faa41071a2cc417bb449cf8276fe | [
"MIT"
] | 3,934 | 2019-03-22T09:26:41.000Z | 2019-05-06T21:03:08.000Z | packages/pyright-internal/src/tests/samples/variadicTypeVar12.py | Jasha10/pyright | 0ce0cfa10fe7faa41071a2cc417bb449cf8276fe | [
"MIT"
] | 107 | 2019-03-24T04:09:37.000Z | 2019-05-06T17:00:04.000Z | packages/pyright-internal/src/tests/samples/variadicTypeVar12.py | Jasha10/pyright | 0ce0cfa10fe7faa41071a2cc417bb449cf8276fe | [
"MIT"
] | 119 | 2019-03-23T10:48:04.000Z | 2019-05-06T08:57:56.000Z | # This sample tests the case where a variadic TypeVar is used in
# conjunction with a keyword-only parameter. It also tests protocol
# invariance validation when a TypeVarTuple is used in the protocol
# along with a non-variadic TypeVar.
# pyright: strict
from typing import Protocol, TypeVar
from typing_extensions im... | 27.259259 | 89 | 0.691576 | # This sample tests the case where a variadic TypeVar is used in
# conjunction with a keyword-only parameter. It also tests protocol
# invariance validation when a TypeVarTuple is used in the protocol
# along with a non-variadic TypeVar.
# pyright: strict
from typing import Protocol, TypeVar
from typing_extensions im... | 129 | 13 | 72 |
d10a63cc5cb88f955269d4ce6980f67addd2f947 | 4,440 | py | Python | tests/service/contacts_test.py | mherrmann/dnsimple-python | a89127f0bafb2a001c902206fba87cbc4f3bc2d1 | [
"MIT"
] | 12 | 2020-06-18T17:16:03.000Z | 2022-03-23T08:35:49.000Z | tests/service/contacts_test.py | mherrmann/dnsimple-python | a89127f0bafb2a001c902206fba87cbc4f3bc2d1 | [
"MIT"
] | 129 | 2020-06-25T12:15:51.000Z | 2022-03-23T09:42:16.000Z | tests/service/contacts_test.py | mherrmann/dnsimple-python | a89127f0bafb2a001c902206fba87cbc4f3bc2d1 | [
"MIT"
] | 6 | 2020-07-03T09:34:01.000Z | 2021-12-20T04:29:59.000Z | import unittest
import responses
from dnsimple import DNSimpleException
from dnsimple.response import Pagination
from dnsimple.struct import Contact
from tests.helpers import DNSimpleMockResponse, DNSimpleTest
if __name__ == '__main__':
unittest.main()
| 45.773196 | 115 | 0.621847 | import unittest
import responses
from dnsimple import DNSimpleException
from dnsimple.response import Pagination
from dnsimple.struct import Contact
from tests.helpers import DNSimpleMockResponse, DNSimpleTest
class ContactsTest(DNSimpleTest):
@responses.activate
def test_list_contacts(self):
respon... | 3,787 | 368 | 23 |
f84ea56c56e51a875d50bc7307a31889f6562e9b | 423 | py | Python | replacedata/urls.py | judexzhu/dzhops | ffe089a734dd24d88bf433223ab8eb7e2eb099c5 | [
"Apache-2.0"
] | 202 | 2015-05-18T08:48:52.000Z | 2021-07-16T13:59:07.000Z | replacedata/urls.py | judexzhu/dzhops | ffe089a734dd24d88bf433223ab8eb7e2eb099c5 | [
"Apache-2.0"
] | 19 | 2015-11-26T03:54:45.000Z | 2019-03-02T13:58:24.000Z | replacedata/urls.py | Hasal/dzhops | fcd16adc61a941dccdaebee156b545784a5e96a8 | [
"Apache-2.0"
] | 172 | 2015-08-07T15:52:17.000Z | 2021-07-16T13:59:11.000Z | # -*- coding: utf-8 -*-
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'replacedata.views',
# url(r'^$', 'oms.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^repair/history/$', 'repairHistoryDat... | 32.538462 | 75 | 0.664303 | # -*- coding: utf-8 -*-
from django.conf.urls import patterns, include, url
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns(
'replacedata.views',
# url(r'^$', 'oms.views.home', name='home'),
# url(r'^blog/', include('blog.urls')),
url(r'^repair/history/$', 'repairHistoryDat... | 0 | 0 | 0 |
980ab3bc4a57447b3222534b3167de92a4804cb1 | 1,641 | py | Python | neural_sp/models/modules/zoneout.py | SunSki/neural_sp | 4e4aca9b4cda1c7d95a1774d22f4d3298ad4ba4b | [
"Apache-2.0"
] | null | null | null | neural_sp/models/modules/zoneout.py | SunSki/neural_sp | 4e4aca9b4cda1c7d95a1774d22f4d3298ad4ba4b | [
"Apache-2.0"
] | null | null | null | neural_sp/models/modules/zoneout.py | SunSki/neural_sp | 4e4aca9b4cda1c7d95a1774d22f4d3298ad4ba4b | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2019 Kyoto University (Hirofumi Inaguma)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Zoneout regularization."""
import torch.nn as nn
| 28.789474 | 71 | 0.606947 | #! /usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright 2019 Kyoto University (Hirofumi Inaguma)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Zoneout regularization."""
import torch.nn as nn
class ZoneoutCell(nn.Module):
def __init__(self, cell, zoneout_prob_h, zoneout_prob_c):
... | 999 | 378 | 46 |
b3152b4456ead975eb6f74831b450dea9597705e | 810 | py | Python | number programs/sum of digits in anumber.py | ZephyrAveryl777/Python-Programs | 26de85c31af28382d406d27d54186b966a7b1bfc | [
"MIT"
] | 6 | 2020-08-13T11:49:29.000Z | 2021-03-07T05:46:17.000Z | number programs/sum of digits in anumber.py | ZephyrAveryl777/Python-Programs | 26de85c31af28382d406d27d54186b966a7b1bfc | [
"MIT"
] | null | null | null | number programs/sum of digits in anumber.py | ZephyrAveryl777/Python-Programs | 26de85c31af28382d406d27d54186b966a7b1bfc | [
"MIT"
] | 1 | 2021-04-24T06:12:48.000Z | 2021-04-24T06:12:48.000Z | ##Problem Description
##The program takes in a number and finds the sum of digits in a number.
print("-------------------Method 1----------------------------------")
temp=n=int(input("Enter a number: "))
total = 0
while n>0 :
total = total+(n%10)
n=n//10
print("The total sum of digits in the number {0} ... | 33.75 | 80 | 0.437037 | ##Problem Description
##The program takes in a number and finds the sum of digits in a number.
print("-------------------Method 1----------------------------------")
temp=n=int(input("Enter a number: "))
total = 0
while n>0 :
total = total+(n%10)
n=n//10
print("The total sum of digits in the number {0} ... | 73 | 0 | 23 |
8997337d56096fa810ead605e0340df1b628913c | 406 | py | Python | api/filters.py | pca/pca-web | ecee1563ddef24dbd38710b0e8a5c5ec2712898d | [
"MIT"
] | 3 | 2018-03-22T11:03:54.000Z | 2020-12-23T17:00:27.000Z | api/filters.py | drfb/pca-web | ecee1563ddef24dbd38710b0e8a5c5ec2712898d | [
"MIT"
] | 9 | 2018-03-15T15:02:27.000Z | 2022-02-10T07:25:58.000Z | api/filters.py | pca/pca-web-backend | ecee1563ddef24dbd38710b0e8a5c5ec2712898d | [
"MIT"
] | 1 | 2018-03-14T15:24:05.000Z | 2018-03-14T15:24:05.000Z | from rest_framework import exceptions, filters
| 29 | 69 | 0.67734 | from rest_framework import exceptions, filters
class LimitFilter(filters.BaseFilterBackend):
default_limit = 100
def filter_queryset(self, request, queryset, view):
limit = request.query_params.get("limit", self.default_limit)
try:
limit = int(limit)
except ValueError:
... | 260 | 75 | 23 |
f2c241e08bc11d95b523ca06dbb1790a155bc856 | 1,095 | py | Python | pymarlin/utils/writer/aml.py | nifarn/PyMarlin | ea1f5f927aa85112ecebc206d53b5c3ee65704fa | [
"MIT"
] | 20 | 2021-06-09T18:46:45.000Z | 2022-02-09T01:08:13.000Z | pymarlin/utils/writer/aml.py | nifarn/PyMarlin | ea1f5f927aa85112ecebc206d53b5c3ee65704fa | [
"MIT"
] | 50 | 2021-06-09T17:50:35.000Z | 2022-02-07T23:02:30.000Z | pymarlin/utils/writer/aml.py | nifarn/PyMarlin | ea1f5f927aa85112ecebc206d53b5c3ee65704fa | [
"MIT"
] | 5 | 2021-06-21T22:24:30.000Z | 2021-12-21T17:08:21.000Z | """
AML writer module.
"""
from pymarlin.utils.logger.logging_utils import getlogger
from .base import Writer
class Aml(Writer):
"""
This class implements the Azure ML writer for stats.
"""
def log_scalar(self, k, v, step):
"""
Log metric to AML.
"""
kwargs = {
... | 26.707317 | 67 | 0.536073 | """
AML writer module.
"""
from pymarlin.utils.logger.logging_utils import getlogger
from .base import Writer
class Aml(Writer):
"""
This class implements the Azure ML writer for stats.
"""
def __init__(self):
super().__init__(getlogger(__name__))
self.run = None
try:
... | 418 | 0 | 26 |
3f0de62c4c8c48e6ae02cd05d3405f7ac8d21e23 | 377 | py | Python | LectureNote/03.array_linkedlist/14.py | Raziel-JKM/Study_turtleCoding | d09e03605cdc8130db2a279ec8193b29f3bca7a6 | [
"MIT"
] | null | null | null | LectureNote/03.array_linkedlist/14.py | Raziel-JKM/Study_turtleCoding | d09e03605cdc8130db2a279ec8193b29f3bca7a6 | [
"MIT"
] | null | null | null | LectureNote/03.array_linkedlist/14.py | Raziel-JKM/Study_turtleCoding | d09e03605cdc8130db2a279ec8193b29f3bca7a6 | [
"MIT"
] | 2 | 2021-12-13T08:02:31.000Z | 2021-12-18T08:36:23.000Z | # Definition for singly-linked list.
| 25.133333 | 68 | 0.567639 | # Definition for singly-linked list.
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
def mergeTwoLists(self, l1: ListNode, l2: ListNode) -> ListNode:
if (not l1) or (l2 and l1.val > l2.val):
l1, l2 = l2, l1
if l1:
l1.... | 254 | -12 | 97 |
4f8e2aeb8fb094469d36a66d43fac5b6984cbe13 | 240 | py | Python | OCT18A/BITOBYT.py | Chhekur/codechef-solutions | 14ca902ea693139de13ffe5b9f602447bf34b79f | [
"MIT"
] | 1 | 2019-03-25T14:14:47.000Z | 2019-03-25T14:14:47.000Z | OCT18A/BITOBYT.py | Chhekur/codechef-solutions | 14ca902ea693139de13ffe5b9f602447bf34b79f | [
"MIT"
] | null | null | null | OCT18A/BITOBYT.py | Chhekur/codechef-solutions | 14ca902ea693139de13ffe5b9f602447bf34b79f | [
"MIT"
] | null | null | null | for _ in range(int(input())):
n = int(input())
temp = (n - 1) // 26
temp2 = n % 26
ans = 2**temp
if n == 0: print(1,0,0)
elif temp2 > 0 and temp2 < 3: print(ans,0,0)
elif temp2 > 2 and temp2 < 11: print(0,ans,0)
else: print(0,0,ans) | 26.666667 | 46 | 0.570833 | for _ in range(int(input())):
n = int(input())
temp = (n - 1) // 26
temp2 = n % 26
ans = 2**temp
if n == 0: print(1,0,0)
elif temp2 > 0 and temp2 < 3: print(ans,0,0)
elif temp2 > 2 and temp2 < 11: print(0,ans,0)
else: print(0,0,ans) | 0 | 0 | 0 |
b1a4913225fbfc946d7637c1b7948e693eb990e2 | 8,110 | py | Python | LinearRegression.py | Prasanna-Brabourame/Machine-Learning | f27811d1d0b280ac025cfc7d5610c646b9f5de35 | [
"MIT"
] | null | null | null | LinearRegression.py | Prasanna-Brabourame/Machine-Learning | f27811d1d0b280ac025cfc7d5610c646b9f5de35 | [
"MIT"
] | null | null | null | LinearRegression.py | Prasanna-Brabourame/Machine-Learning | f27811d1d0b280ac025cfc7d5610c646b9f5de35 | [
"MIT"
] | null | null | null |
# The problem to be solved:
# We have trucks located in different cities and each truck brings a profit or loss. We have the historical data and determined that the profit depends on the city's population. We want to find this relation.
import numpy as np
print('Welcome to Machine Learning with Python!')
print('Lesso... | 38.254717 | 441 | 0.69815 |
# The problem to be solved:
# We have trucks located in different cities and each truck brings a profit or loss. We have the historical data and determined that the profit depends on the city's population. We want to find this relation.
import numpy as np
print('Welcome to Machine Learning with Python!')
print('Lesso... | 1,120 | 0 | 66 |
451b547531e66a11eedfdad82d0ab5ec2c049406 | 989 | py | Python | remindme/config.py | GochoMugo/remindme | 6cf2f94ce07ead754f1ee5976a7e7d7cbfa1a2e4 | [
"MIT"
] | 17 | 2015-05-02T22:58:07.000Z | 2017-04-17T06:33:43.000Z | remindme/config.py | GochoMugo/remindme | 6cf2f94ce07ead754f1ee5976a7e7d7cbfa1a2e4 | [
"MIT"
] | 8 | 2015-02-14T16:22:27.000Z | 2016-10-26T13:15:19.000Z | remindme/config.py | GochoMugo/remindme | 6cf2f94ce07ead754f1ee5976a7e7d7cbfa1a2e4 | [
"MIT"
] | 2 | 2016-02-26T10:47:56.000Z | 2019-10-09T05:49:51.000Z | import os
import sys
import colorama
from . import metadata
# project metadata
METADATA = metadata
# paths
PATHS = {}
PATHS["home"] = os.path.expanduser("~")
PATHS["db_file"] = os.path.join(PATHS["home"], ".remindme.db")
PATHS["config_file"] = os.path.join(PATHS["home"], ".remindme")
# colors
colorama.init()
COLO... | 21.5 | 63 | 0.722952 | import os
import sys
import colorama
from . import metadata
# project metadata
METADATA = metadata
# paths
PATHS = {}
PATHS["home"] = os.path.expanduser("~")
PATHS["db_file"] = os.path.join(PATHS["home"], ".remindme.db")
PATHS["config_file"] = os.path.join(PATHS["home"], ".remindme")
# colors
colorama.init()
COLO... | 0 | 0 | 0 |
3c4fdc05b6325dc0d014850d64adf6128c1af6de | 1,075 | py | Python | telemetry/telemetry/internal/platform/platform_backend_unittest.py | Martijnve23/catapult | 5c63b19d221af6a12889e8727acc85d93892cab7 | [
"BSD-3-Clause"
] | 1,894 | 2015-04-17T18:29:53.000Z | 2022-03-28T22:41:06.000Z | telemetry/telemetry/internal/platform/platform_backend_unittest.py | Martijnve23/catapult | 5c63b19d221af6a12889e8727acc85d93892cab7 | [
"BSD-3-Clause"
] | 4,640 | 2015-07-08T16:19:08.000Z | 2019-12-02T15:01:27.000Z | telemetry/telemetry/internal/platform/platform_backend_unittest.py | Martijnve23/catapult | 5c63b19d221af6a12889e8727acc85d93892cab7 | [
"BSD-3-Clause"
] | 698 | 2015-06-02T19:18:35.000Z | 2022-03-29T16:57:15.000Z | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import absolute_import
import unittest
import mock
from telemetry.core import platform as platform_module
from telemetry.internal.platform i... | 39.814815 | 74 | 0.728372 | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from __future__ import absolute_import
import unittest
import mock
from telemetry.core import platform as platform_module
from telemetry.internal.platform i... | 604 | 24 | 47 |
704bb3776179c6385b0af47d73095b8ef624dce9 | 960 | py | Python | files/update-lang-list.py | eumel8/translation_checksite | 122acecf10e1de21320f8f0607d45ddada69d032 | [
"Apache-2.0"
] | null | null | null | files/update-lang-list.py | eumel8/translation_checksite | 122acecf10e1de21320f8f0607d45ddada69d032 | [
"Apache-2.0"
] | 4 | 2016-01-30T06:59:50.000Z | 2021-12-02T17:55:54.000Z | files/update-lang-list.py | eumel8/translation_checksite | 122acecf10e1de21320f8f0607d45ddada69d032 | [
"Apache-2.0"
] | 3 | 2016-01-30T03:44:15.000Z | 2016-02-05T10:50:43.000Z | #!/usr/bin/env python
import pprint
import os
from django.conf.locale import LANG_INFO
from django.utils import translation
HORIZON_DIR = '/opt/stack/horizon'
langs_horizon = os.listdir(os.path.join(HORIZON_DIR, 'horizon', 'locale'))
langs_dashboard = os.listdir(os.path.join(HORIZON_DIR, 'openstack_dashboard', 'l... | 28.235294 | 88 | 0.708333 | #!/usr/bin/env python
import pprint
import os
from django.conf.locale import LANG_INFO
from django.utils import translation
def get_django_lang_name(code, all_codes):
code = code.lower().replace('_', '-')
code_orig = code
lang_info = LANG_INFO.get(code)
if not lang_info:
code = code.split('-... | 360 | 0 | 23 |
fe6edc63bbf0559878618a4e33821990cd4a7535 | 235 | py | Python | problems/Codeforces/Birthday.py | jspw/Basic_Python | aa159f576a471c6deebdf1e5f462dfc9ffb4930b | [
"Unlicense"
] | 6 | 2020-06-25T14:52:09.000Z | 2021-08-05T20:54:15.000Z | problems/Codeforces/Birthday.py | jspw/Basic_Python | aa159f576a471c6deebdf1e5f462dfc9ffb4930b | [
"Unlicense"
] | null | null | null | problems/Codeforces/Birthday.py | jspw/Basic_Python | aa159f576a471c6deebdf1e5f462dfc9ffb4930b | [
"Unlicense"
] | null | null | null | _ = input()
m = map(int, input().split())
m = sorted(m)
#print(m)
l=[]
for i in range(len(m)):
if(i%2==0):
l.append(str(m[i]))
for i in range(len(m)-1,0,-1):
if(i%2!=0):
l.append(str(m[i]))
print(' '.join(l)) | 15.666667 | 30 | 0.489362 | _ = input()
m = map(int, input().split())
m = sorted(m)
#print(m)
l=[]
for i in range(len(m)):
if(i%2==0):
l.append(str(m[i]))
for i in range(len(m)-1,0,-1):
if(i%2!=0):
l.append(str(m[i]))
print(' '.join(l)) | 0 | 0 | 0 |
fc6a9e223a774f2d6514568d4a145897adc465d7 | 1,144 | py | Python | figures/ring.py | deepsphere/paper-deepsphere-rlgm2019 | e3b56f48da5b18bcf9a78426b19f203c5c0dda54 | [
"CC-BY-4.0"
] | 1 | 2020-11-05T13:45:40.000Z | 2020-11-05T13:45:40.000Z | figures/ring.py | deepsphere/paper-iclr19-rlgm | e3b56f48da5b18bcf9a78426b19f203c5c0dda54 | [
"CC-BY-4.0"
] | null | null | null | figures/ring.py | deepsphere/paper-iclr19-rlgm | e3b56f48da5b18bcf9a78426b19f203c5c0dda54 | [
"CC-BY-4.0"
] | null | null | null | #!/usr/bin/env python3
import os
import numpy as np
import pygsp as gsp
import matplotlib.pyplot as plt
from matplotlib.patches import Arc
# plt.rc('font', family='Latin Modern Roman')
plt.rc('text', usetex=True)
plt.rc('text.latex', preamble=r'\usepackage{lmodern}')
fig = plt.figure(figsize = (3, 3))
ax = fig.add_... | 27.902439 | 129 | 0.68007 | #!/usr/bin/env python3
import os
import numpy as np
import pygsp as gsp
import matplotlib.pyplot as plt
from matplotlib.patches import Arc
# plt.rc('font', family='Latin Modern Roman')
plt.rc('text', usetex=True)
plt.rc('text.latex', preamble=r'\usepackage{lmodern}')
fig = plt.figure(figsize = (3, 3))
ax = fig.add_... | 0 | 0 | 0 |
8fe47d6e92443b760621ca519956d6954987c080 | 6,343 | py | Python | blend/test/TestConfiguration.py | azavea/blend | 2cafbc326f2e6b3f1947581cca860ff544adada1 | [
"MIT"
] | 1 | 2017-03-06T14:55:29.000Z | 2017-03-06T14:55:29.000Z | blend/test/TestConfiguration.py | azavea/blend | 2cafbc326f2e6b3f1947581cca860ff544adada1 | [
"MIT"
] | null | null | null | blend/test/TestConfiguration.py | azavea/blend | 2cafbc326f2e6b3f1947581cca860ff544adada1 | [
"MIT"
] | null | null | null | # By Justin Walgran
# Copyright (c) 2012 Azavea, Inc.
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, modify, ... | 40.401274 | 116 | 0.700457 | # By Justin Walgran
# Copyright (c) 2012 Azavea, Inc.
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation
# files (the "Software"), to deal in the Software without
# restriction, including without limitation the rights to use,
# copy, modify, ... | 4,482 | 22 | 374 |
1df2c470bc908d95b5dafe0075903631bceab354 | 2,103 | py | Python | release/stubs.min/System/ComponentModel/__init___parts/EditorAttribute.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 182 | 2017-06-27T02:26:15.000Z | 2022-03-30T18:53:43.000Z | release/stubs.min/System/ComponentModel/__init___parts/EditorAttribute.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 28 | 2017-06-27T13:38:23.000Z | 2022-03-15T11:19:44.000Z | release/stubs.min/System/ComponentModel/__init___parts/EditorAttribute.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 67 | 2017-06-28T09:43:59.000Z | 2022-03-20T21:17:10.000Z | class EditorAttribute(Attribute,_Attribute):
"""
Specifies the editor to use to change a property. This class cannot be inherited.
EditorAttribute()
EditorAttribute(typeName: str,baseTypeName: str)
EditorAttribute(typeName: str,baseType: Type)
EditorAttribute(type: Type,baseType: Type)
"""
... | 23.10989 | 215 | 0.682359 | class EditorAttribute(Attribute,_Attribute):
"""
Specifies the editor to use to change a property. This class cannot be inherited.
EditorAttribute()
EditorAttribute(typeName: str,baseTypeName: str)
EditorAttribute(typeName: str,baseType: Type)
EditorAttribute(type: Type,baseType: Type)
"""
... | 10 | 0 | 24 |
7d4df8ca4fd9f6faefafdc8a8cbba5f7922eda77 | 1,876 | py | Python | 07/7.1.py | abe-101/ThinkPython-2 | bcebb1e9b3cc63c403f59c3cc0f33017bb017363 | [
"MIT"
] | 1 | 2021-12-16T16:46:47.000Z | 2021-12-16T16:46:47.000Z | 07/7.1.py | abe-101/ThinkPython-2 | bcebb1e9b3cc63c403f59c3cc0f33017bb017363 | [
"MIT"
] | null | null | null | 07/7.1.py | abe-101/ThinkPython-2 | bcebb1e9b3cc63c403f59c3cc0f33017bb017363 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import math
def mysqrt(a):
"""Compute the square root of a using Newton's method: start with an
approximate answer and iteratively improving it
"""
estimate = a / 2 + 1 # Arbitrary estimae of the square root of a
epsilon = 0.0000001
while True:
approx = (estimate + a... | 31.266667 | 80 | 0.549041 | #!/usr/bin/python3
import math
def mysqrt(a):
"""Compute the square root of a using Newton's method: start with an
approximate answer and iteratively improving it
"""
estimate = a / 2 + 1 # Arbitrary estimae of the square root of a
epsilon = 0.0000001
while True:
approx = (estimate + a... | 0 | 0 | 0 |
5357501235a0317d9378ff13120e58356b60342d | 2,442 | py | Python | pyeurojackpot/predictor.py | slawyn/eurojackpot | 5c8fd43e6e896f758b391c3a41dfdedc71c804a4 | [
"Apache-2.0"
] | null | null | null | pyeurojackpot/predictor.py | slawyn/eurojackpot | 5c8fd43e6e896f758b391c3a41dfdedc71c804a4 | [
"Apache-2.0"
] | null | null | null | pyeurojackpot/predictor.py | slawyn/eurojackpot | 5c8fd43e6e896f758b391c3a41dfdedc71c804a4 | [
"Apache-2.0"
] | null | null | null | from utils import log
from utils import correlate
import random
| 32.56 | 121 | 0.538084 | from utils import log
from utils import correlate
import random
class Predictor:
def __init__(self, history_db, orders_db):
self.history_db = history_db
self.orders_db = orders_db
def predict_simple(self, history_points, statistics):
correlations = [[], [], [], [], []]
guesse... | 2,305 | -5 | 77 |
df668d722b67fd2443fb0e29147acb271a0d6a49 | 63,507 | py | Python | tests/simulations/system/test_system_unitary.py | john-grando/pyExpandObjects | c08b1d1bc45684bc71c0f49b4d2f22c707cd4aa4 | [
"BSD-3-Clause"
] | null | null | null | tests/simulations/system/test_system_unitary.py | john-grando/pyExpandObjects | c08b1d1bc45684bc71c0f49b4d2f22c707cd4aa4 | [
"BSD-3-Clause"
] | 1 | 2021-02-03T01:56:56.000Z | 2021-02-03T01:56:56.000Z | tests/simulations/system/test_system_unitary.py | john-grando/pyExpandObjects | c08b1d1bc45684bc71c0f49b4d2f22c707cd4aa4 | [
"BSD-3-Clause"
] | 1 | 2022-01-11T18:31:05.000Z | 2022-01-11T18:31:05.000Z | from pathlib import Path
from tests.simulations import BaseSimulationTest
from src.epjson_handler import EPJSON
test_dir = Path(__file__).parent.parent.parent
hot_water_objects = {
"HVACTemplate:Plant:Boiler": {
"Main Boiler": {
"boiler_type": "HotWaterBoiler",
"capacity": "Autosi... | 56.652096 | 125 | 0.678366 | from pathlib import Path
from tests.simulations import BaseSimulationTest
from src.epjson_handler import EPJSON
test_dir = Path(__file__).parent.parent.parent
hot_water_objects = {
"HVACTemplate:Plant:Boiler": {
"Main Boiler": {
"boiler_type": "HotWaterBoiler",
"capacity": "Autosi... | 50,781 | 8,897 | 23 |
b309c952311c2ba99fc6444d9dabcacf6b2a8a7a | 1,287 | py | Python | apps/base/migrations/0052_fill_new_item_order.py | KolevDarko/lifehq | 88d92f5fe76f2fb6511f2a892e096d95a69985d8 | [
"MIT"
] | null | null | null | apps/base/migrations/0052_fill_new_item_order.py | KolevDarko/lifehq | 88d92f5fe76f2fb6511f2a892e096d95a69985d8 | [
"MIT"
] | null | null | null | apps/base/migrations/0052_fill_new_item_order.py | KolevDarko/lifehq | 88d92f5fe76f2fb6511f2a892e096d95a69985d8 | [
"MIT"
] | null | null | null | # Generated by Django 2.0 on 2019-01-31 07:28
from django.db import migrations
| 33.868421 | 73 | 0.62704 | # Generated by Django 2.0 on 2019-01-31 07:28
from django.db import migrations
class Migration(migrations.Migration):
def forwards_func(apps, schema_editor):
ProjectTodoList = apps.get_model('base', 'ProjectTodoList')
PersonalTodoList = apps.get_model('base', 'PersonalTodoList')
for proj... | 936 | 247 | 23 |
c32b35ee54e2b205d3b64c553ab89bbe78d5c853 | 7,697 | py | Python | tests/bibkey_formatter/test_formatters/test_author_formatters.py | astamminger/zotero-bibtize | bd518c85d5ea03f952903b721e0d66e8990bd185 | [
"MIT"
] | 2 | 2019-11-20T02:46:46.000Z | 2022-03-08T18:32:32.000Z | tests/bibkey_formatter/test_formatters/test_author_formatters.py | astamminger/zotero-bibtize | bd518c85d5ea03f952903b721e0d66e8990bd185 | [
"MIT"
] | 8 | 2019-11-20T15:31:37.000Z | 2020-05-05T09:07:05.000Z | tests/bibkey_formatter/test_formatters/test_author_formatters.py | astamminger/zotero-bibtize | bd518c85d5ea03f952903b721e0d66e8990bd185 | [
"MIT"
] | null | null | null | """
Test suite for BibKey formatting sequences.
Tests the generation of key contents based on the author entry
"""
from zotero_bibtize.bibkey_formatter import KeyFormatter
#
# Test lower author formatting
#
#
# Test upper author formatting
#
#
# Test capitalized author formatting
#
#
# Test abbreviate... | 36.478673 | 81 | 0.715214 | """
Test suite for BibKey formatting sequences.
Tests the generation of key contents based on the author entry
"""
from zotero_bibtize.bibkey_formatter import KeyFormatter
#
# Test lower author formatting
#
def test_no_author_lower():
key_formatter = KeyFormatter({})
key_format = '[author:lower]'
assert ... | 5,724 | 0 | 364 |
d9bdf38b8225d5bcf36515d8ff0fd7d07cd4ddee | 2,900 | py | Python | ontobio/io/entitywriter.py | alliance-genome/ontobio | 0ec3aa6fea9d4492a9873a4b9b394c4866f741b6 | [
"BSD-3-Clause"
] | null | null | null | ontobio/io/entitywriter.py | alliance-genome/ontobio | 0ec3aa6fea9d4492a9873a4b9b394c4866f741b6 | [
"BSD-3-Clause"
] | null | null | null | ontobio/io/entitywriter.py | alliance-genome/ontobio | 0ec3aa6fea9d4492a9873a4b9b394c4866f741b6 | [
"BSD-3-Clause"
] | null | null | null | """
Classes for exporting entities.
So far only one implementation
"""
import re
external_taxon = re.compile("taxon:([0-9]+)")
internal_taxon = re.compile("NCBITaxon:([0-9]+)")
class EntityWriter():
"""
Abstract superclass of all association writer objects (Gpad, GAF)
"""
# TODO: add to superclass
... | 24.576271 | 80 | 0.556897 | """
Classes for exporting entities.
So far only one implementation
"""
import re
def stringify(s):
if s is None:
return ""
elif isinstance(s,list):
return "|".join(s)
else:
return s
external_taxon = re.compile("taxon:([0-9]+)")
internal_taxon = re.compile("NCBITaxon:([0-9]+)")
de... | 819 | 0 | 124 |
7bc67dc45c88bf77bfd385e03be6efef81543692 | 101 | py | Python | src/pagnn/training/dcn/__init__.py | ostrokach/protein-adjacency-net | fd3ad0b9034eb61b0187752c1f38f7eed1a8f1dc | [
"MIT"
] | 1 | 2022-01-16T12:06:13.000Z | 2022-01-16T12:06:13.000Z | src/pagnn/training/dcn/__init__.py | ostrokach/protein-adjacency-net | fd3ad0b9034eb61b0187752c1f38f7eed1a8f1dc | [
"MIT"
] | null | null | null | src/pagnn/training/dcn/__init__.py | ostrokach/protein-adjacency-net | fd3ad0b9034eb61b0187752c1f38f7eed1a8f1dc | [
"MIT"
] | null | null | null | """Train a network."""
from .args import Args
from .stats import Stats
from .main import main, train
| 20.2 | 29 | 0.732673 | """Train a network."""
from .args import Args
from .stats import Stats
from .main import main, train
| 0 | 0 | 0 |
c90a19220af8528b49927128e469ba9aff6561ab | 291 | py | Python | export_readiness/migrations/0064_merge_20191009_1320.py | uktrade/directory-cms | 8c8d13ce29ea74ddce7a40f3dd29c8847145d549 | [
"MIT"
] | 6 | 2018-03-20T11:19:07.000Z | 2021-10-05T07:53:11.000Z | export_readiness/migrations/0064_merge_20191009_1320.py | uktrade/directory-cms | 8c8d13ce29ea74ddce7a40f3dd29c8847145d549 | [
"MIT"
] | 802 | 2018-02-05T14:16:13.000Z | 2022-02-10T10:59:21.000Z | export_readiness/migrations/0064_merge_20191009_1320.py | uktrade/directory-cms | 8c8d13ce29ea74ddce7a40f3dd29c8847145d549 | [
"MIT"
] | 6 | 2019-01-22T13:19:37.000Z | 2019-07-01T10:35:26.000Z | # Generated by Django 2.2.4 on 2019-10-09 13:20
from django.db import migrations
| 19.4 | 56 | 0.670103 | # Generated by Django 2.2.4 on 2019-10-09 13:20
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('export_readiness', '0063_auto_20191009_1239'),
('export_readiness', '0063_auto_20191008_1307'),
]
operations = [
]
| 0 | 185 | 23 |
e607fd13a8a8af9d7b0dd6db2c1d5a67f9b2d4bc | 16,202 | py | Python | skating_etl/skating_etl.py | gcp825/gcp_public | 3208249658b227de4a3d5e054de8df42042429a5 | [
"Apache-2.0"
] | null | null | null | skating_etl/skating_etl.py | gcp825/gcp_public | 3208249658b227de4a3d5e054de8df42042429a5 | [
"Apache-2.0"
] | null | null | null | skating_etl/skating_etl.py | gcp825/gcp_public | 3208249658b227de4a3d5e054de8df42042429a5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
if __name__ == '__main__': run()
| 70.751092 | 146 | 0.398901 | #!/usr/bin/python3
def run(cloud=False):
# imports
import apache_beam as ab
from apache_beam import io
from apache_beam import ToString as ts
from apache_beam.options.pipeline_options import PipelineOptions, SetupOptions, StandardOptions, GoogleCloudOptions
from gcp_tools import be... | 16,126 | 0 | 23 |
0997b2bb53b3e94433d1abfed3c5673193adb7bc | 1,393 | py | Python | main_adco.py | maple-research-lab/AdCo | a9f25fc18c12df88c732b33700f3bb698454dd3f | [
"MIT"
] | 139 | 2021-03-05T01:20:26.000Z | 2022-03-24T02:25:20.000Z | main_adco.py | maple-research-lab/AdCo | a9f25fc18c12df88c732b33700f3bb698454dd3f | [
"MIT"
] | 12 | 2021-03-09T02:59:40.000Z | 2021-09-27T05:25:25.000Z | main_adco.py | maple-research-lab/AdCo | a9f25fc18c12df88c732b33700f3bb698454dd3f | [
"MIT"
] | 18 | 2021-03-05T02:44:52.000Z | 2022-03-14T02:37:09.000Z | #Copyright (C) 2020 Xiao Wang
#License: MIT for academic use.
#Contact: Xiao Wang (wang3702@purdue.edu, xiaowang20140001@gmail.com)
#Some codes adopted from https://github.com/facebookresearch/moco
import os
from ops.argparser import argparser
from ops.Config_Environment import Config_Environment
import torch.multipr... | 36.657895 | 81 | 0.729361 | #Copyright (C) 2020 Xiao Wang
#License: MIT for academic use.
#Contact: Xiao Wang (wang3702@purdue.edu, xiaowang20140001@gmail.com)
#Some codes adopted from https://github.com/facebookresearch/moco
import os
from ops.argparser import argparser
from ops.Config_Environment import Config_Environment
import torch.multipr... | 781 | 0 | 22 |
c42da29d97d8d02d3ae79a808bef8fbd7963c23f | 2,125 | py | Python | wyze_sdk/signature/__init__.py | RebelTat/wyze-sdk | 249b1df71e80c97fc2e5fb5977431b887f7361c2 | [
"Unlicense"
] | 132 | 2021-05-03T12:33:58.000Z | 2022-03-31T18:03:26.000Z | wyze_sdk/signature/__init__.py | RebelTat/wyze-sdk | 249b1df71e80c97fc2e5fb5977431b887f7361c2 | [
"Unlicense"
] | 51 | 2021-05-01T20:24:20.000Z | 2022-03-30T20:37:05.000Z | wyze_sdk/signature/__init__.py | RebelTat/wyze-sdk | 249b1df71e80c97fc2e5fb5977431b887f7361c2 | [
"Unlicense"
] | 21 | 2021-05-05T14:01:38.000Z | 2022-03-29T02:58:39.000Z | import hashlib
import hmac
from time import time
from typing import Optional, Union
| 31.716418 | 104 | 0.623529 | import hashlib
import hmac
from time import time
from typing import Optional, Union
class Clock:
def now(self) -> float:
return time()
def nonce(self):
return round(self.now() * 1000)
class RequestVerifier:
def __init__(self, signing_secret: str, access_token: Optional[str] = None, cl... | 612 | 1,327 | 100 |
4c1974ce7ed5abfe14e791e0f8209d92e3dcc752 | 638 | py | Python | yk_utils/images/image_parser.py | jppdpf/yk-utils-python | 2c101feda900713c8cbb0223326031ba09cd48e9 | [
"MIT"
] | null | null | null | yk_utils/images/image_parser.py | jppdpf/yk-utils-python | 2c101feda900713c8cbb0223326031ba09cd48e9 | [
"MIT"
] | null | null | null | yk_utils/images/image_parser.py | jppdpf/yk-utils-python | 2c101feda900713c8cbb0223326031ba09cd48e9 | [
"MIT"
] | 1 | 2022-02-16T19:04:33.000Z | 2022-02-16T19:04:33.000Z | """Image parser module.
"""
import os
import base64
def parse_image(image) -> str:
"""Check whether the image is a string or a file path or a file-like object.
:param image:
A base64 string or a file path or a file-like object representing an image.
:return:
Image as a base64 string.
"... | 29 | 83 | 0.628527 | """Image parser module.
"""
import os
import base64
def parse_image(image) -> str:
"""Check whether the image is a string or a file path or a file-like object.
:param image:
A base64 string or a file path or a file-like object representing an image.
:return:
Image as a base64 string.
"... | 0 | 0 | 0 |
3d022cac11f1e60bc2bcab537423ff5ea3705e37 | 3,983 | py | Python | client/gym_carla/experiment_suite/experiment_suite.py | wielgosz-info/carla-rl | 8841c0c7997299ed76388ad93b34834bd6b55d3e | [
"MIT"
] | null | null | null | client/gym_carla/experiment_suite/experiment_suite.py | wielgosz-info/carla-rl | 8841c0c7997299ed76388ad93b34834bd6b55d3e | [
"MIT"
] | null | null | null | client/gym_carla/experiment_suite/experiment_suite.py | wielgosz-info/carla-rl | 8841c0c7997299ed76388ad93b34834bd6b55d3e | [
"MIT"
] | null | null | null | # Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
#
# -------------------------------------------------------------------------------
#
# This file is ... | 32.647541 | 132 | 0.644489 | # Copyright (c) 2017 Computer Vision Center (CVC) at the Universitat Autonoma de
# Barcelona (UAB).
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
#
# -------------------------------------------------------------------------------
#
# This file is ... | 957 | 2,278 | 23 |
96c8a4ff91d3e3ca6afe90078f997ac43327e709 | 3,675 | py | Python | w4_tiled_converter/main.py | restitux/w4-tiled-converter | 7cdee2d425c53a54d46617f9499a43dad3806594 | [
"MIT"
] | null | null | null | w4_tiled_converter/main.py | restitux/w4-tiled-converter | 7cdee2d425c53a54d46617f9499a43dad3806594 | [
"MIT"
] | null | null | null | w4_tiled_converter/main.py | restitux/w4-tiled-converter | 7cdee2d425c53a54d46617f9499a43dad3806594 | [
"MIT"
] | null | null | null | import argparse
import json
from os.path import basename, join, split, splitext
import sys
from w4_tiled_converter import converters
# Convert a tiled tmx tilemap to source files
if __name__ == "__main__":
main()
| 22.826087 | 88 | 0.688163 | import argparse
import json
from os.path import basename, join, split, splitext
import sys
from w4_tiled_converter import converters
# Convert a tiled tmx tilemap to source files
def tilemap_subcommand(filename: str):
print(f"INFO: Processing tilemap {filename}")
name = basename(splitext(splitext(filename)[0]... | 3,360 | 0 | 91 |
3899d52834f5585b5ae4c4435ca9a8f8025273e4 | 404 | py | Python | rallybooking/migrations/0007_rally_site_name.py | DaleShipp/devoncc | 8bec11cf363ac5a5c16eda9a6c50e9f901142211 | [
"BSD-3-Clause"
] | null | null | null | rallybooking/migrations/0007_rally_site_name.py | DaleShipp/devoncc | 8bec11cf363ac5a5c16eda9a6c50e9f901142211 | [
"BSD-3-Clause"
] | null | null | null | rallybooking/migrations/0007_rally_site_name.py | DaleShipp/devoncc | 8bec11cf363ac5a5c16eda9a6c50e9f901142211 | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 2.1.1 on 2018-10-05 22:33
from django.db import migrations, models
| 21.263158 | 63 | 0.60396 | # Generated by Django 2.1.1 on 2018-10-05 22:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('rallybooking', '0006_auto_20181005_2042'),
]
operations = [
migrations.AddField(
model_name='rally',
name='site_name... | 0 | 290 | 23 |
cc323e6f4b8b6d89a4bc83d3a457b2b702135f01 | 154 | py | Python | book_library_app/commands/__init__.py | szymcio32/flask-book-library-api | 9406bb5ff6ec04cc7c049d416913ae084e73a9dc | [
"MIT"
] | 1 | 2022-02-03T17:10:03.000Z | 2022-02-03T17:10:03.000Z | book_library_app/commands/__init__.py | szymcio32/flask-book-library-api | 9406bb5ff6ec04cc7c049d416913ae084e73a9dc | [
"MIT"
] | null | null | null | book_library_app/commands/__init__.py | szymcio32/flask-book-library-api | 9406bb5ff6ec04cc7c049d416913ae084e73a9dc | [
"MIT"
] | 2 | 2021-04-26T20:57:24.000Z | 2021-09-20T10:19:00.000Z | from flask import Blueprint
db_manage_bp = Blueprint('db_manage_cmd', __name__, cli_group=None)
from book_library_app.commands import db_manage_commands | 30.8 | 67 | 0.850649 | from flask import Blueprint
db_manage_bp = Blueprint('db_manage_cmd', __name__, cli_group=None)
from book_library_app.commands import db_manage_commands | 0 | 0 | 0 |
fc6a61ad09b5a2873ca3d0bbf8908a1fe92aac0e | 1,549 | py | Python | example.py | ssocolow/Neural-Network-Saves | 78870623cec9752a765d8bb43d00f0c3f0f677b0 | [
"MIT"
] | 3 | 2019-06-22T05:53:18.000Z | 2019-06-22T05:53:48.000Z | example.py | ssocolow/Neural-Network-Python-Lib | 78870623cec9752a765d8bb43d00f0c3f0f677b0 | [
"MIT"
] | 2 | 2019-06-22T06:16:19.000Z | 2019-06-22T06:22:38.000Z | example.py | ssocolow/Neural-Network-Python-Lib | 78870623cec9752a765d8bb43d00f0c3f0f677b0 | [
"MIT"
] | null | null | null | #importing the library
#nn requires matrix2d.py and the math module and random module for dependencies
import nn
import random
#create the neural network to solve the XOR problem
#takes an array of arrays for argument
#the 2, 4 and 1 represent two nodes in the input and 4 nodes in the hidden layer and 1 node in the ou... | 48.40625 | 141 | 0.769529 | #importing the library
#nn requires matrix2d.py and the math module and random module for dependencies
import nn
import random
#create the neural network to solve the XOR problem
#takes an array of arrays for argument
#the 2, 4 and 1 represent two nodes in the input and 4 nodes in the hidden layer and 1 node in the ou... | 0 | 0 | 0 |
fe1792e616a3318ec0936ccae1a3979964e73622 | 5,345 | py | Python | geeksbot_web/rcon/models.py | dustinpianalto/geeksbot_web | ee02452dd5a61b0487706782020f9647ae202238 | [
"MIT"
] | null | null | null | geeksbot_web/rcon/models.py | dustinpianalto/geeksbot_web | ee02452dd5a61b0487706782020f9647ae202238 | [
"MIT"
] | null | null | null | geeksbot_web/rcon/models.py | dustinpianalto/geeksbot_web | ee02452dd5a61b0487706782020f9647ae202238 | [
"MIT"
] | null | null | null | from django.db import models
from django.core.exceptions import ObjectDoesNotExist
from rest_framework import status
from guilds.models import Guild
from dmessages.models import Message
from users.models import User
from channels.models import Channel
from .utils import create_error_response
from .utils import create_... | 41.434109 | 101 | 0.636109 | from django.db import models
from django.core.exceptions import ObjectDoesNotExist
from rest_framework import status
from guilds.models import Guild
from dmessages.models import Message
from users.models import User
from channels.models import Channel
from .utils import create_error_response
from .utils import create_... | 3,640 | 1,316 | 23 |
daad75627bc6162d2ea4e3136cfa6943ffef9ecd | 1,127 | py | Python | post.py | seqcode/seqview-web-docker-public | 56dfc222fd25a630cbc63d2841d9ce4fb1c7045c | [
"MIT"
] | null | null | null | post.py | seqcode/seqview-web-docker-public | 56dfc222fd25a630cbc63d2841d9ce4fb1c7045c | [
"MIT"
] | null | null | null | post.py | seqcode/seqview-web-docker-public | 56dfc222fd25a630cbc63d2841d9ce4fb1c7045c | [
"MIT"
] | null | null | null | from urllib.parse import urlencode
from urllib.request import Request, urlopen
import json
import argparse
import configparser
main()
| 40.25 | 174 | 0.721384 | from urllib.parse import urlencode
from urllib.request import Request, urlopen
import json
import argparse
import configparser
def main():
parser = argparse.ArgumentParser(description="Post ingest tileset request to higlass")
parser.add_argument('--genome', action="store", dest="genome", default='', help="genome ver... | 945 | 0 | 47 |
eb282e96df605c49958261d1bcdd1be576d4b1bf | 3,574 | py | Python | story_chain/flaskrunner.py | muchu1983/story_chain | 3af4bb158be128a52c753f88eaffaed872d85880 | [
"BSD-3-Clause"
] | null | null | null | story_chain/flaskrunner.py | muchu1983/story_chain | 3af4bb158be128a52c753f88eaffaed872d85880 | [
"BSD-3-Clause"
] | null | null | null | story_chain/flaskrunner.py | muchu1983/story_chain | 3af4bb158be128a52c753f88eaffaed872d85880 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Copyright (C) 2015, MuChu Hsu
Contributed by Muchu Hsu (muchu1983@gmail.com)
This file is part of BSD license
<https://opensource.org/licenses/BSD-3-Clause>
"""
import json
from flask import Flask
from flask import request
from flask import render_template
from flask import jsonify
from sto... | 34.038095 | 94 | 0.689144 | # -*- coding: utf-8 -*-
"""
Copyright (C) 2015, MuChu Hsu
Contributed by Muchu Hsu (muchu1983@gmail.com)
This file is part of BSD license
<https://opensource.org/licenses/BSD-3-Clause>
"""
import json
from flask import Flask
from flask import request
from flask import render_template
from flask import jsonify
from sto... | 2,108 | 0 | 242 |
f0463eb840dd62de3267468df2df8a11a6d08fe8 | 2,913 | py | Python | venv/Lib/site-packages/xero_python/accounting/models/report_fields.py | RobMilinski/Xero-Starter-Branched-Test | c82382e674b34c2336ee164f5a079d6becd1ed46 | [
"MIT"
] | 77 | 2020-02-16T03:50:18.000Z | 2022-03-11T03:53:26.000Z | venv/Lib/site-packages/xero_python/accounting/models/report_fields.py | RobMilinski/Xero-Starter-Branched-Test | c82382e674b34c2336ee164f5a079d6becd1ed46 | [
"MIT"
] | 50 | 2020-04-06T10:15:52.000Z | 2022-03-29T21:27:50.000Z | venv/Lib/site-packages/xero_python/accounting/models/report_fields.py | RobMilinski/Xero-Starter-Branched-Test | c82382e674b34c2336ee164f5a079d6becd1ed46 | [
"MIT"
] | 27 | 2020-06-04T11:16:17.000Z | 2022-03-19T06:27:36.000Z | # coding: utf-8
"""
Xero Accounting API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
Contact: api@xero.com
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
from xero_python.models import BaseModel
... | 24.897436 | 124 | 0.597666 | # coding: utf-8
"""
Xero Accounting API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
Contact: api@xero.com
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
from xero_python.models import BaseModel
... | 0 | 0 | 0 |
f594e48a4780469ce9c3653912d489a7c0714b11 | 1,458 | py | Python | Python Basics/scipy_basics.py | python-sonchau/python-visualization | eb139aaabbff858663a96f8e19e30f1418e4330c | [
"MIT"
] | null | null | null | Python Basics/scipy_basics.py | python-sonchau/python-visualization | eb139aaabbff858663a96f8e19e30f1418e4330c | [
"MIT"
] | null | null | null | Python Basics/scipy_basics.py | python-sonchau/python-visualization | eb139aaabbff858663a96f8e19e30f1418e4330c | [
"MIT"
] | null | null | null | from scipy import stats
import numpy as np
############################
# CALCULATING CORRELATIONS #
############################
array_1 = np.array([1,2,3,4,5,6]) # Create a numpy array from a list
array_2 = array_1 # Create another array with the same values
print(stats.pearsonr(array_1, array_2)) # Calculate t... | 36.45 | 192 | 0.580933 | from scipy import stats
import numpy as np
############################
# CALCULATING CORRELATIONS #
############################
array_1 = np.array([1,2,3,4,5,6]) # Create a numpy array from a list
array_2 = array_1 # Create another array with the same values
print(stats.pearsonr(array_1, array_2)) # Calculate t... | 0 | 0 | 0 |
b76ae8aebcf19bf3deee56b36c1edd3ec1852d21 | 50,717 | py | Python | Src/Scripts/DarunGrim.py | fengjixuchui/DarunGrim | a6cbe5c064f9399423845dea0ab67355d5ac5852 | [
"BSD-3-Clause"
] | null | null | null | Src/Scripts/DarunGrim.py | fengjixuchui/DarunGrim | a6cbe5c064f9399423845dea0ab67355d5ac5852 | [
"BSD-3-Clause"
] | null | null | null | Src/Scripts/DarunGrim.py | fengjixuchui/DarunGrim | a6cbe5c064f9399423845dea0ab67355d5ac5852 | [
"BSD-3-Clause"
] | null | null | null | from PySide.QtCore import *
from PySide.QtGui import *
from PySide.QtSql import *
import DarunGrimDatabase
import DiffEngine
from Graphs import *
import FlowGrapher
import FileStoreBrowser
import FileStoreDatabase
import DarunGrimEngine
import pprint
from multiprocessing import Process
from multiprocessing import Que... | 32.242212 | 318 | 0.763354 | from PySide.QtCore import *
from PySide.QtGui import *
from PySide.QtSql import *
import DarunGrimDatabase
import DiffEngine
from Graphs import *
import FlowGrapher
import FileStoreBrowser
import FileStoreDatabase
import DarunGrimEngine
import pprint
from multiprocessing import Process
from multiprocessing import Que... | 46,966 | 1,645 | 1,277 |
4fb3719d6c98f0ef30141c1f977dfa7d852da269 | 570 | py | Python | test.py | FlyingKiwis/Esipraisal | 47b19baab7f59fd6a0a0f84b85708d017e7ce011 | [
"MIT"
] | 1 | 2020-06-02T03:54:19.000Z | 2020-06-02T03:54:19.000Z | test.py | FlyingKiwis/Esipraisal | 47b19baab7f59fd6a0a0f84b85708d017e7ce011 | [
"MIT"
] | null | null | null | test.py | FlyingKiwis/Esipraisal | 47b19baab7f59fd6a0a0f84b85708d017e7ce011 | [
"MIT"
] | null | null | null | import asyncio
import logging
from Esipraisal.Esipraisal import Esipraisal
ep_log = logging.getLogger("Esipraisal")
ep_log.setLevel(logging.INFO)
ch = logging.StreamHandler()
ch.setLevel(logging.INFO)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
ch.setFormatter(formatter)
ep_lo... | 31.666667 | 151 | 0.777193 | import asyncio
import logging
from Esipraisal.Esipraisal import Esipraisal
ep_log = logging.getLogger("Esipraisal")
ep_log.setLevel(logging.INFO)
ch = logging.StreamHandler()
ch.setLevel(logging.INFO)
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
ch.setFormatter(formatter)
ep_lo... | 0 | 0 | 0 |
69656441d9c0bf3b5e0c5066856ee54e3a84cc09 | 147 | py | Python | reddit2telegram/channels/r_goodanimemes/app.py | mainyordle/reddit2telegram | 1163e15aed3b6ff0fba65b222d3d9798f644c386 | [
"MIT"
] | 187 | 2016-09-20T09:15:54.000Z | 2022-03-29T12:22:33.000Z | reddit2telegram/channels/r_goodanimemes/app.py | mainyordle/reddit2telegram | 1163e15aed3b6ff0fba65b222d3d9798f644c386 | [
"MIT"
] | 84 | 2016-09-22T14:25:07.000Z | 2022-03-19T01:26:17.000Z | reddit2telegram/channels/r_goodanimemes/app.py | mainyordle/reddit2telegram | 1163e15aed3b6ff0fba65b222d3d9798f644c386 | [
"MIT"
] | 172 | 2016-09-21T15:39:39.000Z | 2022-03-16T15:15:58.000Z | #encoding:utf-8
subreddit = 'goodanimemes'
t_channel = '@r_goodanimemes'
| 16.333333 | 38 | 0.755102 | #encoding:utf-8
subreddit = 'goodanimemes'
t_channel = '@r_goodanimemes'
def send_post(submission, r2t):
return r2t.send_simple(submission)
| 49 | 0 | 23 |
ee9a6c5456efb857c26a2d7a258bbd6b0bf0d4f4 | 1,369 | py | Python | pymoo/learning/part_1.py | ubeydtalha/bitirme-projesi | 71601eb04a5e8a0aa93357ddf8b978d68eae6cdc | [
"MIT"
] | null | null | null | pymoo/learning/part_1.py | ubeydtalha/bitirme-projesi | 71601eb04a5e8a0aa93357ddf8b978d68eae6cdc | [
"MIT"
] | null | null | null | pymoo/learning/part_1.py | ubeydtalha/bitirme-projesi | 71601eb04a5e8a0aa93357ddf8b978d68eae6cdc | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
plt.rc('font', family='serif')
X1 , X2 = np.meshgrid(np.linspace(-2,2,500),np.linspace(-2,2,500))
F1 = X1**2 + X2**2
F2 = (X1-1)**2+X2**2
G = X1**2 - X1 + 3/16
G1 = 2 * (X1[0] - 0.1) * (X1[0] - 0.9)
G2 = 20 * (X1[0] - 0.4) * (X1[0] - 0.6)
levels = [0.02, 0.1 , 0... | 29.76087 | 87 | 0.620161 | import numpy as np
import matplotlib.pyplot as plt
plt.rc('font', family='serif')
X1 , X2 = np.meshgrid(np.linspace(-2,2,500),np.linspace(-2,2,500))
F1 = X1**2 + X2**2
F2 = (X1-1)**2+X2**2
G = X1**2 - X1 + 3/16
G1 = 2 * (X1[0] - 0.1) * (X1[0] - 0.9)
G2 = 20 * (X1[0] - 0.4) * (X1[0] - 0.6)
levels = [0.02, 0.1 , 0... | 0 | 0 | 0 |
11e5788ea89ce816b5cc94614412f19c35457815 | 4,923 | py | Python | tests/test_models.py | zbohm/aldryn-translation-tools | 3e86f575fea12124a25a6c2d28e10324347d6c5e | [
"BSD-3-Clause"
] | null | null | null | tests/test_models.py | zbohm/aldryn-translation-tools | 3e86f575fea12124a25a6c2d28e10324347d6c5e | [
"BSD-3-Clause"
] | null | null | null | tests/test_models.py | zbohm/aldryn-translation-tools | 3e86f575fea12124a25a6c2d28e10324347d6c5e | [
"BSD-3-Clause"
] | 1 | 2020-09-10T23:39:48.000Z | 2020-09-10T23:39:48.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TransactionTestCase
from django.utils.translation import ugettext_lazy as _
from test_addon.models import Complex, Simple, Unconventional
| 32.82 | 71 | 0.639651 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.test import TransactionTestCase
from django.utils.translation import ugettext_lazy as _
from test_addon.models import Complex, Simple, Unconventional
class TestTranslatableAutoSlugifyMixin(TransactionTestCase):
def test_simple_slug(se... | 4,334 | 39 | 320 |
6571d06b26e9d55f7b954eee07d36c375ace0e0f | 1,527 | py | Python | api/predict.py | xuhdev/MAX-Breast-Cancer-Mitosis-Detector | c7e777311da070994466f1bf45541451e18b8034 | [
"Apache-2.0"
] | null | null | null | api/predict.py | xuhdev/MAX-Breast-Cancer-Mitosis-Detector | c7e777311da070994466f1bf45541451e18b8034 | [
"Apache-2.0"
] | null | null | null | api/predict.py | xuhdev/MAX-Breast-Cancer-Mitosis-Detector | c7e777311da070994466f1bf45541451e18b8034 | [
"Apache-2.0"
] | null | null | null | from core.model import ModelWrapper
from flask_restplus import fields, abort
from werkzeug.datastructures import FileStorage
from maxfw.core import MAX_API, PredictAPI
input_parser = MAX_API.parser()
input_parser.add_argument('image', type=FileStorage, location='files', required=True,
help='A... | 34.704545 | 113 | 0.683039 | from core.model import ModelWrapper
from flask_restplus import fields, abort
from werkzeug.datastructures import FileStorage
from maxfw.core import MAX_API, PredictAPI
input_parser = MAX_API.parser()
input_parser.add_argument('image', type=FileStorage, location='files', required=True,
help='A... | 0 | 709 | 23 |
13a86095619b618630a1898ef9c8fa97e0d04df6 | 608 | py | Python | examples/03-image/04-quad.py | mcjocobe/drawExploration | 2c50526ef14dea5bc3802b7fda08871919d62ac4 | [
"BSD-3-Clause"
] | 76 | 2015-01-21T11:21:08.000Z | 2022-02-04T13:33:19.000Z | examples/03-image/04-quad.py | mcjocobe/drawExploration | 2c50526ef14dea5bc3802b7fda08871919d62ac4 | [
"BSD-3-Clause"
] | 8 | 2015-11-12T07:42:58.000Z | 2020-06-09T10:01:15.000Z | examples/03-image/04-quad.py | mcjocobe/drawExploration | 2c50526ef14dea5bc3802b7fda08871919d62ac4 | [
"BSD-3-Clause"
] | 23 | 2015-01-12T12:07:40.000Z | 2020-04-13T16:32:15.000Z | # Add the upper directory (where the nodebox module is) to the search path.
import os, sys; sys.path.insert(0, os.path.join("..",".."))
from nodebox.graphics import *
img = Image("creature.png")
# The image.quad property describes the four-sided polygon
# on which an image texture is "mounted".
# This is not necess... | 26.434783 | 75 | 0.703947 | # Add the upper directory (where the nodebox module is) to the search path.
import os, sys; sys.path.insert(0, os.path.join("..",".."))
from nodebox.graphics import *
img = Image("creature.png")
# The image.quad property describes the four-sided polygon
# on which an image texture is "mounted".
# This is not necess... | 30 | 0 | 23 |
0b20183397bcfd04f62df163fded2c064174a562 | 4,874 | py | Python | src/five/grok/meta.py | zopefoundation/five.grok | d5fcbe2e081a4cec96d8ec658498f9fc33963bf9 | [
"ZPL-2.1"
] | 1 | 2016-10-26T16:45:57.000Z | 2016-10-26T16:45:57.000Z | src/five/grok/meta.py | zopefoundation/five.grok | d5fcbe2e081a4cec96d8ec658498f9fc33963bf9 | [
"ZPL-2.1"
] | 2 | 2021-01-05T14:30:32.000Z | 2021-03-25T18:38:06.000Z | src/five/grok/meta.py | zopefoundation/five.grok | d5fcbe2e081a4cec96d8ec658498f9fc33963bf9 | [
"ZPL-2.1"
] | 2 | 2015-04-03T04:41:12.000Z | 2019-08-20T08:02:52.000Z | #############################################################################
#
# Copyright (c) 2008 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFT... | 34.567376 | 78 | 0.659007 | #############################################################################
#
# Copyright (c) 2008 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFT... | 2,584 | 947 | 146 |
699b48ffb0f7def74fa65d53a33552fec5ab2029 | 283 | py | Python | utils/jax_utils/jax_startup.py | Jakob-Unfried/msc-legacy | 2c41f3f714936c25dd534bd66da802c26176fcfa | [
"MIT"
] | 1 | 2021-03-22T14:16:43.000Z | 2021-03-22T14:16:43.000Z | utils/jax_utils/jax_startup.py | Jakob-Unfried/msc-legacy | 2c41f3f714936c25dd534bd66da802c26176fcfa | [
"MIT"
] | null | null | null | utils/jax_utils/jax_startup.py | Jakob-Unfried/msc-legacy | 2c41f3f714936c25dd534bd66da802c26176fcfa | [
"MIT"
] | null | null | null | """
configure jax at startup
"""
from jax.config import config
| 17.6875 | 56 | 0.699647 | """
configure jax at startup
"""
from jax.config import config
def startup():
# Jax config (needs to be executed right at startup)
config.update("jax_enable_x64", True)
def debugging():
config.update("jax_enable_x64", True)
config.update("jax_debug_nans", True)
| 171 | 0 | 46 |
2c5adae6fbb8596c949c80584ff15841235c705d | 968 | py | Python | renew/advancedclass/enumclass.py | ianzhengnan/learnpy | ed1736ac976d56253183399466a167fb9319f869 | [
"Apache-2.0"
] | 1 | 2017-06-12T03:12:29.000Z | 2017-06-12T03:12:29.000Z | renew/advancedclass/enumclass.py | ianzhengnan/learnpy | ed1736ac976d56253183399466a167fb9319f869 | [
"Apache-2.0"
] | null | null | null | renew/advancedclass/enumclass.py | ianzhengnan/learnpy | ed1736ac976d56253183399466a167fb9319f869 | [
"Apache-2.0"
] | null | null | null |
from enum import Enum, unique
Month = Enum('Month', ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'))
for name, member in Month.__members__.items():
print(name, '=>', member, ',', member.value)
# Jan => Month.Jan , 1
# Feb => Month.Feb , 2
# Mar => Month.Mar , 3
# Apr => Month.A... | 18.615385 | 107 | 0.594008 |
from enum import Enum, unique
Month = Enum('Month', ('Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'))
for name, member in Month.__members__.items():
print(name, '=>', member, ',', member.value)
# Jan => Month.Jan , 1
# Feb => Month.Feb , 2
# Mar => Month.Mar , 3
# Apr => Month.A... | 0 | 62 | 22 |
4a3f432f98d5faae9c2eef9e3361d28df42b7a7c | 462 | py | Python | rosmap.py | Jiunan73/flask | 608379fce5f22606ae675d745e02036f17b9043c | [
"MIT"
] | null | null | null | rosmap.py | Jiunan73/flask | 608379fce5f22606ae675d745e02036f17b9043c | [
"MIT"
] | null | null | null | rosmap.py | Jiunan73/flask | 608379fce5f22606ae675d745e02036f17b9043c | [
"MIT"
] | null | null | null | import os
import cv2
| 20.086957 | 61 | 0.575758 | import os
import cv2
class RosMap():
video_source = 0
def __init__(self):
@staticmethod
def set_xy(valx,valy):
return 0
@staticmethod
def frames():
while True:
# read current frame
img = cv2.imread('map-hectorslam.pgm')
#print 'Camera.v... | 282 | 134 | 23 |
cab45f526ea303c3c63b0a5eb65fac294ce0e7d0 | 1,279 | py | Python | force_wfmanager/tests/dummy_classes/dummy_wfmanager.py | force-h2020/force-wfmanager | bcd488cd37092cacd9d0c81b544ee8c1654d1d92 | [
"BSD-2-Clause"
] | 1 | 2019-08-19T16:02:20.000Z | 2019-08-19T16:02:20.000Z | force_wfmanager/tests/dummy_classes/dummy_wfmanager.py | force-h2020/force-wfmanager | bcd488cd37092cacd9d0c81b544ee8c1654d1d92 | [
"BSD-2-Clause"
] | 396 | 2017-07-18T15:19:55.000Z | 2021-05-03T06:23:06.000Z | force_wfmanager/tests/dummy_classes/dummy_wfmanager.py | force-h2020/force-wfmanager | bcd488cd37092cacd9d0c81b544ee8c1654d1d92 | [
"BSD-2-Clause"
] | 2 | 2019-03-05T16:23:10.000Z | 2020-04-16T08:59:11.000Z | # (C) Copyright 2010-2020 Enthought, Inc., Austin, TX
# All rights reserved.
from envisage.core_plugin import CorePlugin
from envisage.ui.tasks.tasks_plugin import TasksPlugin
from force_wfmanager.tests.dummy_classes.dummy_data_view import (
DummyExtensionPluginWithDataView
)
from force_wfmanager.tests.dummy_cl... | 25.078431 | 76 | 0.692729 | # (C) Copyright 2010-2020 Enthought, Inc., Austin, TX
# All rights reserved.
from envisage.core_plugin import CorePlugin
from envisage.ui.tasks.tasks_plugin import TasksPlugin
from force_wfmanager.tests.dummy_classes.dummy_data_view import (
DummyExtensionPluginWithDataView
)
from force_wfmanager.tests.dummy_cl... | 497 | 33 | 207 |
b6394e0ba65095edb60407cb2defdfa6feb51087 | 1,083 | py | Python | mgnt-console/src/app/tests/services/remote.py | streamliner18/ProjectWyze | 1a31b7c222caf0be4e411ce2aa6834fe765c0fe9 | [
"NCSA"
] | 3 | 2017-09-12T23:03:09.000Z | 2019-10-21T23:26:27.000Z | mgnt-console/src/app/tests/services/remote.py | streamliner18/ProjectWyze | 1a31b7c222caf0be4e411ce2aa6834fe765c0fe9 | [
"NCSA"
] | 10 | 2017-09-17T15:00:44.000Z | 2022-02-11T03:38:12.000Z | mgnt-console/src/app/tests/services/remote.py | streamliner18/ProjectWyze | 1a31b7c222caf0be4e411ce2aa6834fe765c0fe9 | [
"NCSA"
] | 2 | 2017-10-02T00:20:19.000Z | 2017-10-02T16:07:45.000Z | from unittest import TestCase
from ...services.remote import get_broker_address, send_internal_signal
from pika import BlockingConnection, ConnectionParameters
from simplejson import loads
| 34.935484 | 71 | 0.645429 | from unittest import TestCase
from ...services.remote import get_broker_address, send_internal_signal
from pika import BlockingConnection, ConnectionParameters
from simplejson import loads
class TestRemote(TestCase):
def testRCSignal(self):
conn = BlockingConnection(
ConnectionParameters(get_b... | 837 | 6 | 49 |
ddff0c4a23bdd4d569ad29d522544468116098ff | 446 | py | Python | tests/py/test_currencies.py | Scrumplex/liberapay.com | 2ef3477ceebc6e85b5db8c5a4a447195889cd4e9 | [
"PostgreSQL",
"CC0-1.0"
] | null | null | null | tests/py/test_currencies.py | Scrumplex/liberapay.com | 2ef3477ceebc6e85b5db8c5a4a447195889cd4e9 | [
"PostgreSQL",
"CC0-1.0"
] | null | null | null | tests/py/test_currencies.py | Scrumplex/liberapay.com | 2ef3477ceebc6e85b5db8c5a4a447195889cd4e9 | [
"PostgreSQL",
"CC0-1.0"
] | null | null | null | from __future__ import division, print_function, unicode_literals
from liberapay.testing import EUR, USD, Harness
| 29.733333 | 85 | 0.674888 | from __future__ import division, print_function, unicode_literals
from liberapay.testing import EUR, USD, Harness
class TestCurrencies(Harness):
def test_convert(self):
original = EUR('1.00')
expected = USD('1.20')
actual = self.db.one("SELECT convert(%s, %s)", (original, expected.curren... | 271 | 9 | 50 |
303f1277d22a2f01641fe04d7dedfbc973da5b6d | 2,565 | py | Python | models/modelos.py | Patataman/StudentApi | 42ff5651cdef2aeda8c012924db39554ab7762ce | [
"MIT"
] | 1 | 2016-03-11T22:42:55.000Z | 2016-03-11T22:42:55.000Z | models/modelos.py | Patataman/StudentApi | 42ff5651cdef2aeda8c012924db39554ab7762ce | [
"MIT"
] | null | null | null | models/modelos.py | Patataman/StudentApi | 42ff5651cdef2aeda8c012924db39554ab7762ce | [
"MIT"
] | null | null | null | from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy import ForeignKey
from sqlalchemy.sql import select
from sqlalchemy.orm import relationship
from sqlalchemy.dialects.postgresql import JSON, TEXT
db = SQLAlchemy()
#Column('user_id', Integer, ForeignKey("user.user_id"), nullable=False),
| 29.147727 | 185 | 0.728265 | from flask.ext.sqlalchemy import SQLAlchemy
from sqlalchemy import ForeignKey
from sqlalchemy.sql import select
from sqlalchemy.orm import relationship
from sqlalchemy.dialects.postgresql import JSON, TEXT
db = SQLAlchemy()
#Column('user_id', Integer, ForeignKey("user.user_id"), nullable=False),
class Persona(db.Mo... | 931 | 1,220 | 115 |
c06efbae0b2f960ea1ad2726615abc68ecf719f4 | 637 | py | Python | problema1.py | enzoyoshio/Problemas | 1e2ce20d9931ef28e57aa54af3fe1708927ebab9 | [
"MIT"
] | null | null | null | problema1.py | enzoyoshio/Problemas | 1e2ce20d9931ef28e57aa54af3fe1708927ebab9 | [
"MIT"
] | null | null | null | problema1.py | enzoyoshio/Problemas | 1e2ce20d9931ef28e57aa54af3fe1708927ebab9 | [
"MIT"
] | null | null | null | # lista de dicionario dado
listDict = [
{1 : 1, 2 : "oi", "nome" : "obrigado"},
{"Bolo" : "Cenoura", "Camarão" : "Verde", "nome" : "Sagrado"},
{1 : 10, "nome" : "oi", "caracol" : "obrigado"},
{"nome":"obrigado"}
]
# a chave que será procurada
nome = "nome"
# inicializando a lista vazia
lista = []
# ... | 27.695652 | 77 | 0.634223 | # lista de dicionario dado
listDict = [
{1 : 1, 2 : "oi", "nome" : "obrigado"},
{"Bolo" : "Cenoura", "Camarão" : "Verde", "nome" : "Sagrado"},
{1 : 10, "nome" : "oi", "caracol" : "obrigado"},
{"nome":"obrigado"}
]
# a chave que será procurada
nome = "nome"
# inicializando a lista vazia
lista = []
# ... | 0 | 0 | 0 |
7c97c1d349a7035b8c108e98916ffaaa384b38ef | 12,469 | py | Python | authors/apps/authentication/views.py | andela/ah-backend-realers | f4b0dbde16fed5e95ab3b1b60e365515e1fe6697 | [
"BSD-3-Clause"
] | null | null | null | authors/apps/authentication/views.py | andela/ah-backend-realers | f4b0dbde16fed5e95ab3b1b60e365515e1fe6697 | [
"BSD-3-Clause"
] | 20 | 2019-05-27T13:05:44.000Z | 2021-06-10T21:29:36.000Z | authors/apps/authentication/views.py | andela/ah-backend-realers | f4b0dbde16fed5e95ab3b1b60e365515e1fe6697 | [
"BSD-3-Clause"
] | 6 | 2019-06-29T11:49:01.000Z | 2020-03-02T12:53:06.000Z | from rest_framework import status, exceptions
from rest_framework.generics import RetrieveUpdateAPIView
from rest_framework.permissions import AllowAny, IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView
from django.conf import settings
from .models import User
from i... | 38.248466 | 121 | 0.678242 | from rest_framework import status, exceptions
from rest_framework.generics import RetrieveUpdateAPIView
from rest_framework.permissions import AllowAny, IsAuthenticated
from rest_framework.response import Response
from rest_framework.views import APIView
from django.conf import settings
from .models import User
from i... | 7,373 | 3,120 | 263 |
fc88e5944833ded64fa3cddeace07e5e0ee6b6f4 | 12,152 | py | Python | visual_phenomics_py/calculate.py | SeBassTian23/Visual-Phenomics-Python | 1ce9f2fff6bf47a7a4a2c9059eb534348b65b2b6 | [
"MIT"
] | null | null | null | visual_phenomics_py/calculate.py | SeBassTian23/Visual-Phenomics-Python | 1ce9f2fff6bf47a7a4a2c9059eb534348b65b2b6 | [
"MIT"
] | null | null | null | visual_phenomics_py/calculate.py | SeBassTian23/Visual-Phenomics-Python | 1ce9f2fff6bf47a7a4a2c9059eb534348b65b2b6 | [
"MIT"
] | null | null | null | """
Calculate additional parameters or recalculate parameters.
"""
from visual_phenomics_py.parameters import *
from visual_phenomics_py.parameters_additional import *
def calculate(df=None, param='', *, fm='fm', f0='f0', fmp='fmp', f0p='f0p', fs='fs', fmpp='fmpp', f0pp='f0pp', fmf0=4.88, alias=None):
"""Calcula... | 44.028986 | 171 | 0.526991 | """
Calculate additional parameters or recalculate parameters.
"""
from visual_phenomics_py.parameters import *
from visual_phenomics_py.parameters_additional import *
def calculate(df=None, param='', *, fm='fm', f0='f0', fmp='fmp', f0p='f0p', fs='fs', fmpp='fmpp', f0pp='f0pp', fmf0=4.88, alias=None):
"""Calcula... | 0 | 0 | 0 |
8650240fd28ccf9c0925b49b1840e0cf02b48178 | 1,489 | py | Python | examples/adjacency_list.py | enpaul/peewee | 177f04cbce02851b0420e2002a72fa91ea9b309b | [
"MIT"
] | 8,289 | 2015-01-01T17:10:34.000Z | 2022-03-30T23:18:33.000Z | examples/adjacency_list.py | enpaul/peewee | 177f04cbce02851b0420e2002a72fa91ea9b309b | [
"MIT"
] | 2,015 | 2015-01-02T16:59:35.000Z | 2022-03-31T02:41:24.000Z | examples/adjacency_list.py | enpaul/peewee | 177f04cbce02851b0420e2002a72fa91ea9b309b | [
"MIT"
] | 1,740 | 2015-01-04T09:48:38.000Z | 2022-03-31T13:44:48.000Z | from peewee import *
db = SqliteDatabase(':memory:')
db.create_tables([Node])
tree = ('root', (
('n1', (
('c11', ()),
('c12', ()))),
('n2', (
('c21', ()),
('c22', (
('g221', ()),
('g222', ()))),
('c23', ()),
('c24', (
('g241... | 25.237288 | 78 | 0.552048 | from peewee import *
db = SqliteDatabase(':memory:')
class Node(Model):
name = TextField()
parent = ForeignKeyField('self', backref='children', null=True)
class Meta:
database = db
def __str__(self):
return self.name
def dump(self, _indent=0):
return (' ' * _indent + s... | 156 | 181 | 23 |
4567d33898daf9c73323f91f151e6d9eeb0b2e78 | 4,159 | py | Python | ihna/kozhukhov/imageanalysis/gui/dataprocessing/spatialfilterdlg.py | serik1987/ihna_kozhuhov_image_analysis | ccfb3b48cbf6b351acb10f8b99315c65281f8ab8 | [
"Unlicense"
] | null | null | null | ihna/kozhukhov/imageanalysis/gui/dataprocessing/spatialfilterdlg.py | serik1987/ihna_kozhuhov_image_analysis | ccfb3b48cbf6b351acb10f8b99315c65281f8ab8 | [
"Unlicense"
] | null | null | null | ihna/kozhukhov/imageanalysis/gui/dataprocessing/spatialfilterdlg.py | serik1987/ihna_kozhuhov_image_analysis | ccfb3b48cbf6b351acb10f8b99315c65281f8ab8 | [
"Unlicense"
] | null | null | null | # -*- coding: utf-8
import numpy as np
import wx
from ihna.kozhukhov.imageanalysis import ImagingMap
from ihna.kozhukhov.imageanalysis.mapprocessing import spatial_filter
from ihna.kozhukhov.imageanalysis.gui.complexmapviewerdlg import ComplexMapViewerDlg
from .datatodataprocessor import DataToDataProcessor
| 38.509259 | 100 | 0.675884 | # -*- coding: utf-8
import numpy as np
import wx
from ihna.kozhukhov.imageanalysis import ImagingMap
from ihna.kozhukhov.imageanalysis.mapprocessing import spatial_filter
from ihna.kozhukhov.imageanalysis.gui.complexmapviewerdlg import ComplexMapViewerDlg
from .datatodataprocessor import DataToDataProcessor
class Sp... | 3,416 | 409 | 23 |
1062e07d343af2a417dc9eb68a948bdc161179f3 | 233 | py | Python | plans/managers.py | Ezenwankwo/health_stack | 7e760397a00d045713e286c75dca4038bc6b0145 | [
"Apache-2.0"
] | null | null | null | plans/managers.py | Ezenwankwo/health_stack | 7e760397a00d045713e286c75dca4038bc6b0145 | [
"Apache-2.0"
] | null | null | null | plans/managers.py | Ezenwankwo/health_stack | 7e760397a00d045713e286c75dca4038bc6b0145 | [
"Apache-2.0"
] | null | null | null | from django.db import models
| 23.3 | 70 | 0.669528 | from django.db import models
class PlanManager(models.Manager):
def create_plan(self, account, name, created):
plan = self.model(account=account, name=name, created=created)
plan.save()
return plan
| 136 | 13 | 54 |
0a0eccb3c3b514b534fa9214a71cc84c4df6c16c | 6,017 | py | Python | pyalgotrade/technical/ma.py | tibkiss/pyalgotrade | 4979315281c362dcba2e6d53da27dc4a7377ebec | [
"Apache-2.0"
] | 2 | 2015-04-03T10:29:14.000Z | 2017-01-21T05:55:00.000Z | pyalgotrade/technical/ma.py | tibkiss/pyalgotrade | 4979315281c362dcba2e6d53da27dc4a7377ebec | [
"Apache-2.0"
] | null | null | null | pyalgotrade/technical/ma.py | tibkiss/pyalgotrade | 4979315281c362dcba2e6d53da27dc4a7377ebec | [
"Apache-2.0"
] | null | null | null | # PyAlgoTrade
#
# Copyright 2011 Gabriel Martin Becedillas Ruiz
#
# 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... | 33.803371 | 116 | 0.651321 | # PyAlgoTrade
#
# Copyright 2011 Gabriel Martin Becedillas Ruiz
#
# 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... | 3,530 | 0 | 426 |
9b3ed565f42449c00168f3699f1390e0084581ea | 528 | py | Python | tests/test_name.py | m2p-consulting/pytest-insta | e0141c57564631edd6378f2a34cd24123f6f648e | [
"MIT"
] | 15 | 2021-02-22T06:23:52.000Z | 2022-03-28T07:34:59.000Z | tests/test_name.py | m2p-consulting/pytest-insta | e0141c57564631edd6378f2a34cd24123f6f648e | [
"MIT"
] | 60 | 2021-04-06T08:25:30.000Z | 2022-03-23T16:47:28.000Z | tests/test_name.py | m2p-consulting/pytest-insta | e0141c57564631edd6378f2a34cd24123f6f648e | [
"MIT"
] | 1 | 2021-04-06T08:32:45.000Z | 2021-04-06T08:32:45.000Z | from typing import Any
| 22 | 52 | 0.647727 | from typing import Any
def test_explicit(snapshot: Any):
value = "foo"
assert snapshot("my_snapshot.txt") == value
assert snapshot("my_snapshot.txt") != value * 2
def test_explicit_json(snapshot: Any):
value = ["foo"]
assert snapshot("my_snapshot.json") == value
assert snapshot("my_snapshot.... | 409 | 0 | 92 |
8a5f497112103293d27e66f42bcc18eee1df1536 | 3,137 | py | Python | src/nninst/backend/tensorflow/trace/resnet_18_cifar10_class_trace.py | uchuhimo/Ptolemy | 5c8ae188af30ee49d38f27d54c67af2eab9489e7 | [
"Apache-2.0"
] | 15 | 2020-08-24T07:11:20.000Z | 2021-09-13T08:03:42.000Z | src/nninst/backend/tensorflow/trace/resnet_18_cifar10_class_trace.py | uchuhimo/Ptolemy | 5c8ae188af30ee49d38f27d54c67af2eab9489e7 | [
"Apache-2.0"
] | 5 | 2021-02-28T17:30:26.000Z | 2021-06-15T09:33:00.000Z | src/nninst/backend/tensorflow/trace/resnet_18_cifar10_class_trace.py | uchuhimo/Ptolemy | 5c8ae188af30ee49d38f27d54c67af2eab9489e7 | [
"Apache-2.0"
] | 3 | 2020-10-22T09:11:11.000Z | 2021-01-16T14:49:34.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 appl... | 31.059406 | 102 | 0.75263 | # 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 appl... | 0 | 0 | 0 |