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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
96f1ecf86f3570e45942d406c783b37418afc6f3 | 2,429 | py | Python | post scripts/nzbget.py | 0x20Man/Watcher3 | 4656b42bc5879a3741bb95f534b7c6612a25264d | [
"Apache-2.0"
] | 320 | 2017-03-28T23:33:45.000Z | 2022-02-17T08:45:01.000Z | post scripts/nzbget.py | 0x20Man/Watcher3 | 4656b42bc5879a3741bb95f534b7c6612a25264d | [
"Apache-2.0"
] | 300 | 2017-03-28T19:22:54.000Z | 2021-12-01T01:11:55.000Z | post scripts/nzbget.py | 0x20Man/Watcher3 | 4656b42bc5879a3741bb95f534b7c6612a25264d | [
"Apache-2.0"
] | 90 | 2017-03-29T16:12:43.000Z | 2022-03-01T06:23:48.000Z | #!/usr/bin/env python3
##########################################
######## DO NOT MODIFY THIS FILE! ########
## CONFIGURE API INFO THROUGH NZBGET UI ##
##########################################
#####################################
### NZBGET POST-PROCESSING SCRIPT ###
# Script to send post-processing info
# to Wat... | 25.568421 | 88 | 0.638534 | #!/usr/bin/env python3
##########################################
######## DO NOT MODIFY THIS FILE! ########
## CONFIGURE API INFO THROUGH NZBGET UI ##
##########################################
#####################################
### NZBGET POST-PROCESSING SCRIPT ###
# Script to send post-processing info
# to Wat... | 0 | 0 | 0 |
ef387d2c054f16a804a9f4197b54ae8a1d91b4c6 | 7,547 | py | Python | 7dof_arm_reaching/dynamical_system/modulation.py | YilunZhou/RoCUS | fb64aeac941f454b1b7edbc7c5cf06123ee2c4d4 | [
"MIT"
] | 7 | 2020-11-20T20:45:49.000Z | 2021-12-14T19:27:20.000Z | 7dof_arm_reaching/dynamical_system/modulation.py | YilunZhou/RoCUS | fb64aeac941f454b1b7edbc7c5cf06123ee2c4d4 | [
"MIT"
] | 1 | 2021-03-03T03:57:21.000Z | 2021-03-03T03:57:21.000Z | 7dof_arm_reaching/dynamical_system/modulation.py | YilunZhou/RoCUS | fb64aeac941f454b1b7edbc7c5cf06123ee2c4d4 | [
"MIT"
] | 4 | 2020-11-20T17:00:27.000Z | 2021-04-01T00:53:50.000Z | import pickle
import numpy as np
| 34.304545 | 134 | 0.67762 | import pickle
import numpy as np
class Modulator():
def __init__(self, typ, svm_fn):
self.model, self.svm_gamma, self.svm_C = pickle.load(open(svm_fn, 'rb'))
self.classifier = self.model['classifier']
self.max_dist = self.model['max_dist']
if typ == 'original':
self.ref_pts = self.model['reference_points']... | 5,225 | 2,197 | 92 |
6ffe3f3c46e951741a2348efd1a296965723ad43 | 8,281 | py | Python | tests/server_commands_test.py | dmvass/aioredis | b4b823e4dc453256ba8173eb82568c321e712da5 | [
"MIT"
] | 1 | 2020-11-09T12:07:17.000Z | 2020-11-09T12:07:17.000Z | tests/server_commands_test.py | idfumg/aioredis | b4b823e4dc453256ba8173eb82568c321e712da5 | [
"MIT"
] | null | null | null | tests/server_commands_test.py | idfumg/aioredis | b4b823e4dc453256ba8173eb82568c321e712da5 | [
"MIT"
] | null | null | null | import time
import pytest
import sys
from unittest import mock
from aioredis import ReplyError
from _testutils import redis_version
@pytest.mark.run_loop
@pytest.mark.run_loop
@pytest.mark.skipif(sys.platform == 'win32',
reason="No unixsocket on Windows")
@pytest.mark.run_loop
@redis_version... | 26.205696 | 76 | 0.626011 | import time
import pytest
import sys
from unittest import mock
from aioredis import ReplyError
from _testutils import redis_version
@pytest.mark.run_loop
async def test_client_list(redis, server, request):
name = request.node.callspec.id
assert (await redis.client_setname(name))
res = await redis.client... | 6,383 | 0 | 484 |
6021efd44d4f1064ae268a64d46e53ed55a07725 | 684 | py | Python | spacy/tests/regression/test_issue514.py | cmgreivel/spaCy | a31506e06060c559abfeda043503935691af2e98 | [
"MIT"
] | 88 | 2018-05-06T17:28:23.000Z | 2022-03-06T20:19:16.000Z | spacy/tests/regression/test_issue514.py | cmgreivel/spaCy | a31506e06060c559abfeda043503935691af2e98 | [
"MIT"
] | 12 | 2018-07-19T15:11:57.000Z | 2021-08-05T11:58:29.000Z | spacy/tests/regression/test_issue514.py | cmgreivel/spaCy | a31506e06060c559abfeda043503935691af2e98 | [
"MIT"
] | 10 | 2018-07-28T22:43:04.000Z | 2020-11-22T22:58:21.000Z | # coding: utf-8
from __future__ import unicode_literals
from ..util import get_doc
import pytest
@pytest.mark.skip
@pytest.mark.models('en')
def test_issue514(EN):
"""Test serializing after adding entity"""
text = ["This", "is", "a", "sentence", "about", "pasta", "."]
vocab = EN.entity.vocab
doc = g... | 29.73913 | 79 | 0.641813 | # coding: utf-8
from __future__ import unicode_literals
from ..util import get_doc
import pytest
@pytest.mark.skip
@pytest.mark.models('en')
def test_issue514(EN):
"""Test serializing after adding entity"""
text = ["This", "is", "a", "sentence", "about", "pasta", "."]
vocab = EN.entity.vocab
doc = g... | 0 | 0 | 0 |
3c0f5517a82dd76fdd643790158a153c97622604 | 33,251 | py | Python | felapps/utils/datautils.py | archman/felapps | 89532a592070d2a0cf07f0f2b4c723cbf1c1bd33 | [
"MIT"
] | 2 | 2018-04-01T14:37:39.000Z | 2021-03-12T04:16:12.000Z | felapps/utils/datautils.py | Archman/felapps | 89532a592070d2a0cf07f0f2b4c723cbf1c1bd33 | [
"MIT"
] | null | null | null | felapps/utils/datautils.py | Archman/felapps | 89532a592070d2a0cf07f0f2b4c723cbf1c1bd33 | [
"MIT"
] | 2 | 2016-07-10T11:14:33.000Z | 2019-07-06T05:42:10.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
python modules for data processing utilities:
dataworkshop: main GUI framework for data post-processing
Author: Tong Zhang
Created: Sep. 23rd, 2015
"""
from __future__ import print_function
import wx
import time
import threading
import numpy as np
import matplotli... | 36.700883 | 711 | 0.575682 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
python modules for data processing utilities:
dataworkshop: main GUI framework for data post-processing
Author: Tong Zhang
Created: Sep. 23rd, 2015
"""
from __future__ import print_function
import wx
import time
import threading
import numpy as np
import matplotli... | 29,226 | 2,444 | 839 |
0e3b46656c23599cd8a969f49b8a2012277079ed | 3,187 | py | Python | urls.py | smithdc1/djangopackages | 8762a787fe968cbf5f772c6199d1362743c85db9 | [
"MIT"
] | null | null | null | urls.py | smithdc1/djangopackages | 8762a787fe968cbf5f772c6199d1362743c85db9 | [
"MIT"
] | null | null | null | urls.py | smithdc1/djangopackages | 8762a787fe968cbf5f772c6199d1362743c85db9 | [
"MIT"
] | null | null | null | from django.conf import settings
from django.urls import include
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, re_path
from django.views.generic.base import TemplateView
from core import __version__
from core.apiv1 import apiv1_gone
from homepage.views import... | 39.345679 | 109 | 0.69407 | from django.conf import settings
from django.urls import include
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, re_path
from django.views.generic.base import TemplateView
from core import __version__
from core.apiv1 import apiv1_gone
from homepage.views import... | 0 | 0 | 0 |
ece45c88a28119865f49d467e7ba473afb8f4bd1 | 4,456 | py | Python | emol/emol/utility/testing.py | lrt512/emol | e1dd3462632a525c3b9701d4fd9a332d19c93b85 | [
"MIT"
] | null | null | null | emol/emol/utility/testing.py | lrt512/emol | e1dd3462632a525c3b9701d4fd9a332d19c93b85 | [
"MIT"
] | null | null | null | emol/emol/utility/testing.py | lrt512/emol | e1dd3462632a525c3b9701d4fd9a332d19c93b85 | [
"MIT"
] | null | null | null | """Utilities for unit testing."""
from importlib import __import__
import pytest
import sys
class Mocktoday(object):
"""A context manager for to fake out datetime.date.today.
Monkeypatches the given module to swap out today with our
own function so that we can say that "today" is any date we want.
... | 29.706667 | 76 | 0.611984 | """Utilities for unit testing."""
from importlib import __import__
import pytest
import sys
class Mocktoday(object):
"""A context manager for to fake out datetime.date.today.
Monkeypatches the given module to swap out today with our
own function so that we can say that "today" is any date we want.
... | 604 | 0 | 238 |
205c7319fc964e5283e50d0c679b1e59f8bfea0a | 3,558 | py | Python | functions/source/infrastructure/delete-resources-associated-with-lambda.py | jy-git/quickstart-mcafee-epo | 5e7c198c829ae65d47d3b2c7ca0c6fb2c164b42d | [
"Apache-2.0"
] | null | null | null | functions/source/infrastructure/delete-resources-associated-with-lambda.py | jy-git/quickstart-mcafee-epo | 5e7c198c829ae65d47d3b2c7ca0c6fb2c164b42d | [
"Apache-2.0"
] | null | null | null | functions/source/infrastructure/delete-resources-associated-with-lambda.py | jy-git/quickstart-mcafee-epo | 5e7c198c829ae65d47d3b2c7ca0c6fb2c164b42d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Invoked by: Cloudformation custom actions
# Returns: Error or status message
#
# deletes the resources assocated with lambda like eni
import boto3
import http.client
import urllib
import json
import uuid
import threading
from time import sleep
| 44.475 | 191 | 0.613828 | #!/usr/bin/env python3
# Invoked by: Cloudformation custom actions
# Returns: Error or status message
#
# deletes the resources assocated with lambda like eni
import boto3
import http.client
import urllib
import json
import uuid
import threading
from time import sleep
def handler(event, context):
print(event)
... | 3,243 | 0 | 46 |
4bbe4405e4e826a1c8c658fcb0e0dfb79a6e0ac3 | 35,474 | py | Python | meerk40t/core/planner.py | aniziorodrigues/meerk40t | ca1180b690a2f25748fe04cb7fdbf270520deab9 | [
"MIT"
] | null | null | null | meerk40t/core/planner.py | aniziorodrigues/meerk40t | ca1180b690a2f25748fe04cb7fdbf270520deab9 | [
"MIT"
] | null | null | null | meerk40t/core/planner.py | aniziorodrigues/meerk40t | ca1180b690a2f25748fe04cb7fdbf270520deab9 | [
"MIT"
] | null | null | null | from copy import copy
from ..device.lasercommandconstants import (
COMMAND_BEEP,
COMMAND_FUNCTION,
COMMAND_HOME,
COMMAND_MODE_RAPID,
COMMAND_MOVE,
COMMAND_SET_ABSOLUTE,
COMMAND_SET_POSITION,
COMMAND_UNLOCK,
COMMAND_WAIT,
COMMAND_WAIT_FINISH,
)
from ..kernel import Modifier
from ... | 37.459345 | 139 | 0.490838 | from copy import copy
from ..device.lasercommandconstants import (
COMMAND_BEEP,
COMMAND_FUNCTION,
COMMAND_HOME,
COMMAND_MODE_RAPID,
COMMAND_MOVE,
COMMAND_SET_ABSOLUTE,
COMMAND_SET_POSITION,
COMMAND_UNLOCK,
COMMAND_WAIT,
COMMAND_WAIT_FINISH,
)
from ..kernel import Modifier
from ... | 33,491 | 0 | 338 |
3bcf36d95e381b2661b334770f16b6dd6e45f090 | 844 | py | Python | gradients/keras_gradients.py | Froskekongen/MA8701 | 53c206bff2896ec6c021325813b3cc27bf7a9cb3 | [
"MIT"
] | 1 | 2019-01-29T11:41:53.000Z | 2019-01-29T11:41:53.000Z | gradients/keras_gradients.py | Froskekongen/MA8701 | 53c206bff2896ec6c021325813b3cc27bf7a9cb3 | [
"MIT"
] | null | null | null | gradients/keras_gradients.py | Froskekongen/MA8701 | 53c206bff2896ec6c021325813b3cc27bf7a9cb3 | [
"MIT"
] | null | null | null | # Example taken from:
# https://stackoverflow.com/questions/39561560/getting-gradient-of-model-output-w-r-t-weights-using-keras
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
from tensorflow.keras import backend as K
import tensorflow as tf
import numpy as np
model = Sequen... | 33.76 | 105 | 0.799763 | # Example taken from:
# https://stackoverflow.com/questions/39561560/getting-gradient-of-model-output-w-r-t-weights-using-keras
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
from tensorflow.keras import backend as K
import tensorflow as tf
import numpy as np
model = Sequen... | 0 | 0 | 0 |
2293f17a3cc49a7c9816f20c2e58e11f37eebe27 | 11,931 | py | Python | Venues/Base/ouch/ouchvenue.py | yurishd/VenueSimulator | 474f52093e70aefb23cdab16326011ad31b6b1ac | [
"Apache-2.0"
] | null | null | null | Venues/Base/ouch/ouchvenue.py | yurishd/VenueSimulator | 474f52093e70aefb23cdab16326011ad31b6b1ac | [
"Apache-2.0"
] | null | null | null | Venues/Base/ouch/ouchvenue.py | yurishd/VenueSimulator | 474f52093e70aefb23cdab16326011ad31b6b1ac | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import os
import sys
import inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0, parentdir)
from Engine.engine import VenueBaseCmdProcessor, ClientBaseCmdProcessor, ClientBaseCmdTraits, VenueBaseCmd... | 36.710769 | 154 | 0.588718 | #!/usr/bin/python
import os
import sys
import inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0, parentdir)
from Engine.engine import VenueBaseCmdProcessor, ClientBaseCmdProcessor, ClientBaseCmdTraits, VenueBaseCmd... | 8,808 | 2,246 | 214 |
7517f9f00c5b4db031f327d457e57355f369f80f | 3,369 | py | Python | getStocksList.py | akashgiri/stocks-list | 3569fe250aadb271f1637b8f274b7a2f87924b28 | [
"MIT"
] | 11 | 2017-05-23T08:50:57.000Z | 2021-03-08T20:58:48.000Z | getStocksList.py | webclinic017/stocks-list | 3569fe250aadb271f1637b8f274b7a2f87924b28 | [
"MIT"
] | 1 | 2021-08-10T08:24:50.000Z | 2021-08-10T08:24:50.000Z | getStocksList.py | webclinic017/stocks-list | 3569fe250aadb271f1637b8f274b7a2f87924b28 | [
"MIT"
] | 7 | 2020-04-28T03:37:01.000Z | 2021-09-12T16:09:06.000Z | #!/usr/bin/python
import json
import re
import requests
try:
from BeautifulSoup import BeautifulSoup
except ImportError:
from bs4 import BeautifulSoup
try:
inputFile = open("input.json")
except Exception, e:
print e
exit()
try:
urls = json.load(inputFile)['urls']
except Exception, e:
prin... | 31.194444 | 84 | 0.62986 | #!/usr/bin/python
import json
import re
import requests
try:
from BeautifulSoup import BeautifulSoup
except ImportError:
from bs4 import BeautifulSoup
try:
inputFile = open("input.json")
except Exception, e:
print e
exit()
try:
urls = json.load(inputFile)['urls']
except Exception, e:
prin... | 1,011 | 0 | 22 |
3b8ff913708dfb19cda137eb69d74c6b5523de54 | 10,111 | py | Python | deepdish/image.py | raphaelquast/deepdish | 44b5259c629724fb95e97e75a4ac6d1bf6737e27 | [
"BSD-3-Clause"
] | 253 | 2015-01-14T01:20:16.000Z | 2022-02-23T09:10:26.000Z | deepdish/image.py | raphaelquast/deepdish | 44b5259c629724fb95e97e75a4ac6d1bf6737e27 | [
"BSD-3-Clause"
] | 46 | 2015-04-07T04:38:20.000Z | 2021-10-30T06:40:14.000Z | deepdish/image.py | raphaelquast/deepdish | 44b5259c629724fb95e97e75a4ac6d1bf6737e27 | [
"BSD-3-Clause"
] | 55 | 2015-02-12T04:16:59.000Z | 2022-03-25T01:17:24.000Z | """
Basic functions for working with images.
"""
from __future__ import division, print_function, absolute_import
import itertools as itr
import numpy as np
def _import_skimage():
"""Import scikit-image, with slightly modified `ImportError` message"""
try:
import skimage
except ImportError:
... | 27.550409 | 79 | 0.606864 | """
Basic functions for working with images.
"""
from __future__ import division, print_function, absolute_import
import itertools as itr
import numpy as np
def _import_skimage():
"""Import scikit-image, with slightly modified `ImportError` message"""
try:
import skimage
except ImportError:
... | 510 | 0 | 23 |
1df9b23e668ef7f42e62eff8e5f7cd5ef6ee2f29 | 347 | py | Python | utest/test/api/plugin_tester.py | hugovk/SeleniumLibrary | 489178c1beb16a4b90747ed35bad7dac80a1cc24 | [
"ECL-2.0",
"Apache-2.0"
] | 792 | 2015-09-28T15:22:48.000Z | 2022-03-27T21:31:34.000Z | utest/test/api/plugin_tester.py | hugovk/SeleniumLibrary | 489178c1beb16a4b90747ed35bad7dac80a1cc24 | [
"ECL-2.0",
"Apache-2.0"
] | 710 | 2015-08-20T13:31:20.000Z | 2022-03-24T15:33:20.000Z | utest/test/api/plugin_tester.py | hugovk/SeleniumLibrary | 489178c1beb16a4b90747ed35bad7dac80a1cc24 | [
"ECL-2.0",
"Apache-2.0"
] | 429 | 2016-10-26T08:26:09.000Z | 2022-03-28T23:19:42.000Z | from SeleniumLibrary.base import LibraryComponent, keyword
| 21.6875 | 58 | 0.665706 | from SeleniumLibrary.base import LibraryComponent, keyword
class plugin_tester(LibraryComponent):
def __init__(self, ctx):
LibraryComponent.__init__(self, ctx)
ctx.event_firing_webdriver = "should be last"
@keyword
def foo(self):
self.info("foo")
@keyword
def bar(self, ar... | 141 | 123 | 23 |
d14ce38a38465f69d4216a97195ad16bd4b89b4c | 2,062 | py | Python | config_tempest/services/share.py | openstack/python-tempestconf | 505e20a4dd771536257a4c4db645da707f727668 | [
"Apache-2.0"
] | 7 | 2017-10-31T13:29:35.000Z | 2019-11-11T11:01:27.000Z | config_tempest/services/share.py | openstack/python-tempestconf | 505e20a4dd771536257a4c4db645da707f727668 | [
"Apache-2.0"
] | null | null | null | config_tempest/services/share.py | openstack/python-tempestconf | 505e20a4dd771536257a4c4db645da707f727668 | [
"Apache-2.0"
] | 2 | 2018-02-14T17:04:22.000Z | 2020-02-14T16:45:33.000Z | # Copyright 2018 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 32.21875 | 79 | 0.652764 | # Copyright 2018 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 1,073 | 214 | 23 |
dfdf3ca6161feecf2f1ab0729e0b1ba2d6863dc4 | 10,581 | py | Python | indig/migrations/0001_initial.py | Paulo-Lopes-Estevao/indicativos-globais | 7dc75f954ba03a38eb8f7529541b3cb84b40472a | [
"BSD-3-Clause"
] | 2 | 2021-10-02T23:10:25.000Z | 2021-10-03T00:59:45.000Z | indig/migrations/0001_initial.py | Paulo-Lopes-Estevao/indicativos-globais | 7dc75f954ba03a38eb8f7529541b3cb84b40472a | [
"BSD-3-Clause"
] | null | null | null | indig/migrations/0001_initial.py | Paulo-Lopes-Estevao/indicativos-globais | 7dc75f954ba03a38eb8f7529541b3cb84b40472a | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 3.2.5 on 2021-08-04 11:38
from django.db import migrations, models
| 112.56383 | 172 | 0.480484 | # Generated by Django 3.2.5 on 2021-08-04 11:38
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Indicativos',
fields=[
('id', models.BigAuto... | 0 | 10,665 | 23 |
269b5b588e5c38f22883170f0d0bcc9a95f1fe56 | 752 | py | Python | src/run_thread.py | wu-clan/automated_api | 6c41ddc3b900608403855afb9e740ce31e24186f | [
"MulanPSL-1.0"
] | null | null | null | src/run_thread.py | wu-clan/automated_api | 6c41ddc3b900608403855afb9e740ce31e24186f | [
"MulanPSL-1.0"
] | null | null | null | src/run_thread.py | wu-clan/automated_api | 6c41ddc3b900608403855afb9e740ce31e24186f | [
"MulanPSL-1.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import unittest
from concurrent.futures.thread import ThreadPoolExecutor
from src.common.log import log
from src.core.path_settings import TEST_CASES
def run_thread(suits, thread_num: int = 8):
"""
多线程运行所有用例
:param suits: 测试用例
:param thread_num: 线程数
... | 23.5 | 80 | 0.658245 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import unittest
from concurrent.futures.thread import ThreadPoolExecutor
from src.common.log import log
from src.core.path_settings import TEST_CASES
def run_thread(suits, thread_num: int = 8):
"""
多线程运行所有用例
:param suits: 测试用例
:param thread_num: 线程数
... | 0 | 0 | 0 |
173442fd66bd382253d8052d338549cae5c43235 | 1,212 | py | Python | test/queue_test.py | merlinran/acorn-precision-farming-rover | 228bbeb537550df79ae57985c427975ffa828bcd | [
"Apache-2.0"
] | 143 | 2021-02-23T16:17:32.000Z | 2022-03-30T09:42:27.000Z | test/queue_test.py | Twisted-Fields/acorn-precision-farming-rover | 228bbeb537550df79ae57985c427975ffa828bcd | [
"Apache-2.0"
] | 19 | 2021-05-13T19:03:21.000Z | 2022-03-25T08:46:44.000Z | test/queue_test.py | merlinran/acorn-precision-farming-rover | 228bbeb537550df79ae57985c427975ffa828bcd | [
"Apache-2.0"
] | 17 | 2021-02-23T22:02:24.000Z | 2022-03-20T15:12:20.000Z | import multiprocessing as mp
import time
import random
random.seed()
send_queue = mp.Queue()
receive_queue = mp.Queue()
proc = mp.Process(target=send_fast, args=(send_queue, receive_queue,))
proc.start()
send_slow(send_queue, receive_queue)
| 23.764706 | 70 | 0.585809 | import multiprocessing as mp
import time
import random
random.seed()
def AppendFIFO(list, value, max_values):
list.append(value)
while len(list) > max_values:
list.pop(0)
return list
def send_slow(queue1, queue2):
somelist = []
maxlen = 500
sequence = 0
while True:
queue... | 895 | 0 | 69 |
8396a9d9b2a4309161a07836228c77d7d56278cc | 1,644 | py | Python | benchmark/utils.py | rebryk/mcc-benchmark | 1f43f21c8a9d312822e0cc37d172d64a20df5203 | [
"MIT"
] | null | null | null | benchmark/utils.py | rebryk/mcc-benchmark | 1f43f21c8a9d312822e0cc37d172d64a20df5203 | [
"MIT"
] | null | null | null | benchmark/utils.py | rebryk/mcc-benchmark | 1f43f21c8a9d312822e0cc37d172d64a20df5203 | [
"MIT"
] | null | null | null | import json
from datetime import datetime
from pathlib import Path
import numpy as np
import requests
def download_file(url: str, path: Path):
"""Download file from the given url and store it to path."""
response = requests.get(url, stream=True)
with path.open('wb') as file:
for data in response.... | 26.095238 | 101 | 0.643552 | import json
from datetime import datetime
from pathlib import Path
import numpy as np
import requests
def download_file(url: str, path: Path):
"""Download file from the given url and store it to path."""
response = requests.get(url, stream=True)
with path.open('wb') as file:
for data in response.... | 581 | 66 | 180 |
901b8fa0d9651ecca60c3c94f1686c973c1c721e | 439 | py | Python | code/chapter6-1.py | justinchou/quant-python | e487287f9320e7ce70fb86720752790066675daf | [
"MIT"
] | 6 | 2019-01-13T04:16:23.000Z | 2021-05-27T11:22:20.000Z | code/chapter6-1.py | justinchou/quant-python | e487287f9320e7ce70fb86720752790066675daf | [
"MIT"
] | null | null | null | code/chapter6-1.py | justinchou/quant-python | e487287f9320e7ce70fb86720752790066675daf | [
"MIT"
] | 1 | 2020-05-06T09:47:53.000Z | 2020-05-06T09:47:53.000Z | # -*- coding: UTF-8 -*-
v = 14
if type(v) != int:
print("Error: Only Support Integer!")
elif v % 2 == 0:
print(0)
elif v % 2 == 1:
print(v)
v = 12
print(type(v))
v = 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000... | 18.291667 | 165 | 0.697039 | # -*- coding: UTF-8 -*-
v = 14
if type(v) != int:
print("Error: Only Support Integer!")
elif v % 2 == 0:
print(0)
elif v % 2 == 1:
print(v)
v = 12
print(type(v))
v = 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000... | 0 | 0 | 0 |
9a2d2988b8ce214d87f56664a561ef3db9eff341 | 3,428 | py | Python | src/law_evaluate.py | tridungduong16/counterfactual_fairness_game_theoretic | 794d5224f9c656c06e5eb197ebbe1875f1856e7e | [
"MIT"
] | null | null | null | src/law_evaluate.py | tridungduong16/counterfactual_fairness_game_theoretic | 794d5224f9c656c06e5eb197ebbe1875f1856e7e | [
"MIT"
] | null | null | null | src/law_evaluate.py | tridungduong16/counterfactual_fairness_game_theoretic | 794d5224f9c656c06e5eb197ebbe1875f1856e7e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed May 5 13:17:22 2021
@author: trduong
"""
# import os, sys;
# sys.path.append(os.path.dirname(os.path.realpath(__file__)))
import pandas as pd
import numpy as np
import logging
import yaml
import pyro
import torch
import pyro.distributions as dist
im... | 31.449541 | 93 | 0.672695 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed May 5 13:17:22 2021
@author: trduong
"""
# import os, sys;
# sys.path.append(os.path.dirname(os.path.realpath(__file__)))
import pandas as pd
import numpy as np
import logging
import yaml
import pyro
import torch
import pyro.distributions as dist
im... | 451 | 0 | 23 |
adb016baa3e8625282dbf878a5baf0903e126cad | 2,220 | py | Python | DailyProgrammer/DP20150909B.py | DayGitH/Python-Challenges | bc32f1332a92fcc2dfa6f5ea4d95f8a8d64c3edf | [
"MIT"
] | 2 | 2020-12-23T18:59:22.000Z | 2021-04-14T13:16:09.000Z | DailyProgrammer/DP20150909B.py | DayGitH/Python-Challenges | bc32f1332a92fcc2dfa6f5ea4d95f8a8d64c3edf | [
"MIT"
] | null | null | null | DailyProgrammer/DP20150909B.py | DayGitH/Python-Challenges | bc32f1332a92fcc2dfa6f5ea4d95f8a8d64c3edf | [
"MIT"
] | null | null | null | """
[2015-09-09] Challenge #231 [Intermediate] Set Game Solver
https://www.reddit.com/r/dailyprogrammer/comments/3ke4l6/20150909_challenge_231_intermediate_set_game/
Our apologies for the delay in getting this posted, there was some technical difficulties behind the scenes.
# Description
Set is a card game where eac... | 30 | 119 | 0.705856 | """
[2015-09-09] Challenge #231 [Intermediate] Set Game Solver
https://www.reddit.com/r/dailyprogrammer/comments/3ke4l6/20150909_challenge_231_intermediate_set_game/
Our apologies for the delay in getting this posted, there was some technical difficulties behind the scenes.
# Description
Set is a card game where eac... | -1 | 0 | 23 |
c25ba572dda366b17dc6ec364d73480172c682e0 | 2,243 | py | Python | vae_experiments/evaluation_models/lenet_DoubleMNIST.py | KamilDeja/multiband_vae | 077c582e6f4d3e4b52c495c0d7c932d2c852a5d2 | [
"MIT"
] | 3 | 2021-06-24T02:23:57.000Z | 2022-02-16T10:24:48.000Z | vae_experiments/evaluation_models/lenet_DoubleMNIST.py | KamilDeja/multiband_vae | 077c582e6f4d3e4b52c495c0d7c932d2c852a5d2 | [
"MIT"
] | null | null | null | vae_experiments/evaluation_models/lenet_DoubleMNIST.py | KamilDeja/multiband_vae | 077c582e6f4d3e4b52c495c0d7c932d2c852a5d2 | [
"MIT"
] | null | null | null | from torch.nn import Module
from torch import nn
##### Part forward without last classification layer for the purpose of FID computing
| 29.12987 | 89 | 0.522069 | from torch.nn import Module
from torch import nn
class Model(Module):
def __init__(self):
super(Model, self).__init__()
dropout_rate = 0.4
self.conv1 = nn.Conv2d(1, 32, 5)
self.relu1 = nn.LeakyReLU()
self.pool1 = nn.MaxPool2d(2)
self.bn1 = nn.BatchNorm2d(32)
... | 2,001 | -1 | 102 |
b46dbd3f0d25354d42fc31a481918fd65590961c | 11,316 | py | Python | tests/test_paypal.py | devkral/web-payments-paypal | 779e7d0324be4da165d282d145cc8693718ba7e7 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | tests/test_paypal.py | devkral/web-payments-paypal | 779e7d0324be4da165d282d145cc8693718ba7e7 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | tests/test_paypal.py | devkral/web-payments-paypal | 779e7d0324be4da165d282d145cc8693718ba7e7 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | import simplejson as json
from decimal import Decimal
import datetime
from unittest import TestCase
from unittest.mock import patch, MagicMock
from requests import HTTPError
from web_payments_paypal import PaypalProvider, PaypalCardProvider
from web_payments import RedirectNeeded, PaymentError, PaymentStatus
from web_... | 40.414286 | 119 | 0.603835 | import simplejson as json
from decimal import Decimal
import datetime
from unittest import TestCase
from unittest.mock import patch, MagicMock
from requests import HTTPError
from web_payments_paypal import PaypalProvider, PaypalCardProvider
from web_payments import RedirectNeeded, PaymentError, PaymentStatus
from web_... | 9,719 | 443 | 181 |
1d1c4504c85e36ed7f7c31c53177fc83e9df60cf | 1,815 | py | Python | 04_Semantik_Stimmungsanalyse/nltk_stimmungsanalyse.py | felixdittrich92/NLP | 1097d43dd1c99762b6a909a876a765bc79245471 | [
"MIT"
] | null | null | null | 04_Semantik_Stimmungsanalyse/nltk_stimmungsanalyse.py | felixdittrich92/NLP | 1097d43dd1c99762b6a909a876a765bc79245471 | [
"MIT"
] | null | null | null | 04_Semantik_Stimmungsanalyse/nltk_stimmungsanalyse.py | felixdittrich92/NLP | 1097d43dd1c99762b6a909a876a765bc79245471 | [
"MIT"
] | null | null | null | import nltk
import numpy as np
import pandas as pd
from nltk.sentiment.vader import SentimentIntensityAnalyzer
from sklearn.metrics import accuracy_score, classification_report, confusion_matrix
nltk.download('vader_lexicon')
sid = SentimentIntensityAnalyzer()
a = 'This was a good movie'
score = sid.polarity_scores(a... | 28.359375 | 83 | 0.725069 | import nltk
import numpy as np
import pandas as pd
from nltk.sentiment.vader import SentimentIntensityAnalyzer
from sklearn.metrics import accuracy_score, classification_report, confusion_matrix
nltk.download('vader_lexicon')
sid = SentimentIntensityAnalyzer()
a = 'This was a good movie'
score = sid.polarity_scores(a... | 0 | 0 | 0 |
7feb6314836599c7766b552d9748f6c4cf81e70c | 1,288 | py | Python | spinup/algos/pytorch/dqn/core.py | liushunyu/stable-spinningup | 7ece777a564b05334c78005eda094ed729d31304 | [
"MIT"
] | null | null | null | spinup/algos/pytorch/dqn/core.py | liushunyu/stable-spinningup | 7ece777a564b05334c78005eda094ed729d31304 | [
"MIT"
] | null | null | null | spinup/algos/pytorch/dqn/core.py | liushunyu/stable-spinningup | 7ece777a564b05334c78005eda094ed729d31304 | [
"MIT"
] | null | null | null | import numpy as np
import torch
import torch.nn as nn
| 26.833333 | 99 | 0.653727 | import numpy as np
import torch
import torch.nn as nn
def combined_shape(length, shape=None):
if shape is None:
return (length,)
return (length, shape) if np.isscalar(shape) else (length, *shape)
def mlp(sizes, activation, output_activation=nn.Identity):
layers = []
for j in range(len(sizes)... | 989 | 17 | 223 |
a01e4b886a698b66093a3f3ef7d101ef683869cc | 887 | py | Python | src/servo.py | dancj/pid_distance_control | f479660f59266d97cd8277d501af27c2dcf32b68 | [
"MIT"
] | null | null | null | src/servo.py | dancj/pid_distance_control | f479660f59266d97cd8277d501af27c2dcf32b68 | [
"MIT"
] | null | null | null | src/servo.py | dancj/pid_distance_control | f479660f59266d97cd8277d501af27c2dcf32b68 | [
"MIT"
] | null | null | null | # ref: https://tutorials-raspberrypi.com/raspberry-pi-servo-motor-control/
import RPi.GPIO as GPIO
import time
servoPIN = 17
GPIO.setmode(GPIO.BCM)
GPIO.setup(servoPIN, GPIO.OUT)
| 25.342857 | 74 | 0.550169 | # ref: https://tutorials-raspberrypi.com/raspberry-pi-servo-motor-control/
import RPi.GPIO as GPIO
import time
servoPIN = 17
GPIO.setmode(GPIO.BCM)
GPIO.setup(servoPIN, GPIO.OUT)
def run():
p = GPIO.PWM(servoPIN, 50) # GPIO 17 for PWM with 50Hz
p.start(2.5) # Initialization
try:
while True:
... | 682 | 0 | 23 |
d0c70f2f56531a661dce48670b99058aa7fac45e | 219 | py | Python | setup.py | virtualmadden/Project.Euler | e68df9ad4c37759faee97f9a3ed1dbe46686f3b3 | [
"MIT"
] | 2 | 2015-12-17T20:00:14.000Z | 2015-12-18T21:03:08.000Z | setup.py | virtualmadden/Project.Euler | e68df9ad4c37759faee97f9a3ed1dbe46686f3b3 | [
"MIT"
] | 1 | 2018-02-15T19:01:58.000Z | 2018-02-15T19:01:58.000Z | setup.py | virtualmadden/Project.Euler | e68df9ad4c37759faee97f9a3ed1dbe46686f3b3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from distutils.core import setup
setup(name='Project.Euler',
version='0.0.1',
description='Python3 implementation of Project Euler problems.',
author='Jonathan Madden',
)
| 21.9 | 70 | 0.675799 | #!/usr/bin/env python
from distutils.core import setup
setup(name='Project.Euler',
version='0.0.1',
description='Python3 implementation of Project Euler problems.',
author='Jonathan Madden',
)
| 0 | 0 | 0 |
9589cba61dbb5fecf70f784f5ca36ddc24042d12 | 3,869 | py | Python | clickuz/views.py | aziz837/ClickUz | 75fcb43f025ad994dad1df6b628a284a1a710954 | [
"MIT"
] | 39 | 2020-05-02T13:39:25.000Z | 2022-03-30T10:12:54.000Z | clickuz/views.py | aziz837/ClickUz | 75fcb43f025ad994dad1df6b628a284a1a710954 | [
"MIT"
] | null | null | null | clickuz/views.py | aziz837/ClickUz | 75fcb43f025ad994dad1df6b628a284a1a710954 | [
"MIT"
] | 9 | 2020-05-02T19:41:24.000Z | 2022-03-14T08:11:11.000Z | from rest_framework.views import APIView, Response
from .models import Transaction
from rest_framework.permissions import AllowAny
from .click_authorization import click_authorization
from .serializer import ClickUzSerializer
from .status import *
| 35.172727 | 113 | 0.633239 | from rest_framework.views import APIView, Response
from .models import Transaction
from rest_framework.permissions import AllowAny
from .click_authorization import click_authorization
from .serializer import ClickUzSerializer
from .status import *
class ClickUzMerchantAPIView(APIView):
authentication_classes = []... | 976 | 2,621 | 23 |
166974adb32f7cb7c47952ee2fbe1317079fb489 | 8,104 | py | Python | csrc/asm_test/common/rv_instruction_table.py | hossein1387/pito_riscv | 94df6f2201798765984017c82d1fdf0355f68d45 | [
"MIT"
] | 3 | 2021-05-25T08:40:55.000Z | 2022-01-05T07:05:39.000Z | csrc/asm_test/common/rv_instruction_table.py | hossein1387/pito_riscv | 94df6f2201798765984017c82d1fdf0355f68d45 | [
"MIT"
] | 5 | 2021-07-25T01:12:16.000Z | 2022-02-17T20:30:38.000Z | csrc/asm_test/common/rv_instruction_table.py | hossein1387/pito_riscv | 94df6f2201798765984017c82d1fdf0355f68d45 | [
"MIT"
] | 3 | 2021-08-11T07:59:07.000Z | 2022-01-05T07:05:43.000Z | from collections import defaultdict
instruction_list = lambda:defaultdict(instruction_list)
instruction_table = instruction_list()
# RV32I
## Branch
instruction_table['0x18']['0'] = 'beq'
instruction_table['0x18']['1'] = 'bne'
instruction_table['0x18']['4'] = 'blt'
instruction_table['0x18']['5'] = 'bge'
instruction_t... | 40.723618 | 59 | 0.607725 | from collections import defaultdict
instruction_list = lambda:defaultdict(instruction_list)
instruction_table = instruction_list()
# RV32I
## Branch
instruction_table['0x18']['0'] = 'beq'
instruction_table['0x18']['1'] = 'bne'
instruction_table['0x18']['4'] = 'blt'
instruction_table['0x18']['5'] = 'bge'
instruction_t... | 0 | 0 | 0 |
893632e380fb8c6890ac1b8f7608b131fb23ec8a | 477 | py | Python | 002.6_formatandonum.py | thaistlsantos/Python-ByLearn | 472da86fd713be6e0faeecdb0c5b01c85f06cb32 | [
"MIT"
] | null | null | null | 002.6_formatandonum.py | thaistlsantos/Python-ByLearn | 472da86fd713be6e0faeecdb0c5b01c85f06cb32 | [
"MIT"
] | null | null | null | 002.6_formatandonum.py | thaistlsantos/Python-ByLearn | 472da86fd713be6e0faeecdb0c5b01c85f06cb32 | [
"MIT"
] | null | null | null | # Podemos modificar a saídas dos números sem modificar os valores reais
# Ex: Número 2 => Valor é 2. Saída => 2.00 => Valor ainda é 2
# Número 2.5 => Valor é 2.5 Saída => 2 => Valor ainda é 2.5
numero = 1.61
print(numero)
# Para inteiros uso o 'd' e para floats uso o 'f'
# para numeros quebrados ele arredonda
print(... | 26.5 | 71 | 0.658281 | # Podemos modificar a saídas dos números sem modificar os valores reais
# Ex: Número 2 => Valor é 2. Saída => 2.00 => Valor ainda é 2
# Número 2.5 => Valor é 2.5 Saída => 2 => Valor ainda é 2.5
numero = 1.61
print(numero)
# Para inteiros uso o 'd' e para floats uso o 'f'
# para numeros quebrados ele arredonda
print(... | 0 | 0 | 0 |
59d4833c3402fbab0186555a8c74eb27efcc0439 | 947 | py | Python | entities/api_views.py | acdh-oeaw/gtrans | 6f56b1d09de0cad503273bf8a01cd81e25220524 | [
"MIT"
] | 1 | 2020-03-15T16:14:02.000Z | 2020-03-15T16:14:02.000Z | entities/api_views.py | acdh-oeaw/gtrans | 6f56b1d09de0cad503273bf8a01cd81e25220524 | [
"MIT"
] | 14 | 2018-11-09T08:34:23.000Z | 2022-02-10T08:15:53.000Z | entities/api_views.py | acdh-oeaw/gtrans | 6f56b1d09de0cad503273bf8a01cd81e25220524 | [
"MIT"
] | null | null | null | from rest_framework import viewsets
from rest_framework.response import Response
from . serializers import *
from . models import *
from . api_renderers import GeoJsonRenderer
from rest_framework.settings import api_settings
| 27.057143 | 88 | 0.761352 | from rest_framework import viewsets
from rest_framework.response import Response
from . serializers import *
from . models import *
from . api_renderers import GeoJsonRenderer
from rest_framework.settings import api_settings
class PlaceViewSet(viewsets.ModelViewSet):
queryset = Place.objects.all()
serializer_... | 143 | 483 | 92 |
c58a067838dae447e1e943b788d5ca820ceb1c11 | 398 | py | Python | tornado-native/app.py | glasnt/cloudrun-python-examples | 7cd35932ce77f30900af4272be008f6485d5b13b | [
"Apache-2.0"
] | 2 | 2021-09-25T20:09:06.000Z | 2021-11-03T11:53:30.000Z | tornado-native/app.py | glasnt/cloudrun-python-examples | 7cd35932ce77f30900af4272be008f6485d5b13b | [
"Apache-2.0"
] | null | null | null | tornado-native/app.py | glasnt/cloudrun-python-examples | 7cd35932ce77f30900af4272be008f6485d5b13b | [
"Apache-2.0"
] | null | null | null | import os
import tornado.ioloop
import tornado.web
port = os.environ.get('PORT', 8080)
if __name__ == "__main__":
app = make_app()
app.listen(port)
tornado.ioloop.IOLoop.current().start()
| 18.952381 | 46 | 0.655779 | import os
import tornado.ioloop
import tornado.web
port = os.environ.get('PORT', 8080)
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.write("👋 Hello tornado")
def make_app():
return tornado.web.Application([
(r"/", MainHandler),
])
if __name__ == "__main__":
app... | 101 | 25 | 72 |
74a478dfcd8560a0399203b0175dabf0e88b4a77 | 771 | py | Python | backend/urls.py | lakshbhasin/VoterValidation | 2249f387046b5039b650e3b5c63b9d3d3b7aea8f | [
"Apache-2.0"
] | 6 | 2018-11-02T14:10:54.000Z | 2020-07-14T02:38:03.000Z | backend/urls.py | lakshbhasin/VoterValidation | 2249f387046b5039b650e3b5c63b9d3d3b7aea8f | [
"Apache-2.0"
] | 2 | 2021-06-10T20:56:46.000Z | 2021-06-10T20:58:54.000Z | backend/urls.py | lakshbhasin/VoterValidation | 2249f387046b5039b650e3b5c63b9d3d3b7aea8f | [
"Apache-2.0"
] | null | null | null | """
backend URL Configuration
See the voter_validation folder for more details.
"""
import backend.settings as settings
from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic import RedirectView
urlpatterns = [
url(r'^private/admin/', include(admin.site.urls)),
url... | 26.586207 | 57 | 0.687419 | """
backend URL Configuration
See the voter_validation folder for more details.
"""
import backend.settings as settings
from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic import RedirectView
urlpatterns = [
url(r'^private/admin/', include(admin.site.urls)),
url... | 0 | 0 | 0 |
b351a6b9265c99d1a43e8b32e8417a22a8340ef5 | 950 | py | Python | youdao.py | Qizhen-Yang/dictionaree | 93339b6a267aa9d1c9fa85c2793288ef6f13898d | [
"MIT"
] | null | null | null | youdao.py | Qizhen-Yang/dictionaree | 93339b6a267aa9d1c9fa85c2793288ef6f13898d | [
"MIT"
] | null | null | null | youdao.py | Qizhen-Yang/dictionaree | 93339b6a267aa9d1c9fa85c2793288ef6f13898d | [
"MIT"
] | null | null | null | import requests
from bs4 import BeautifulSoup | 43.181818 | 163 | 0.642105 | import requests
from bs4 import BeautifulSoup
def search(word):
header = {"User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.131 Safari/537.36", "Cookie": "Youdao"}
result = requests.get("http://youdao.com/w/eng/" + word, headers=header)
result_bs = Beau... | 882 | 0 | 23 |
9722ca970a47cbaf0f78497e03f84149c31742f1 | 2,441 | py | Python | src/draw.py | delbio/maze | cbc58ebb2c54f300f6413b770b57b0cab0750672 | [
"MIT"
] | null | null | null | src/draw.py | delbio/maze | cbc58ebb2c54f300f6413b770b57b0cab0750672 | [
"MIT"
] | null | null | null | src/draw.py | delbio/maze | cbc58ebb2c54f300f6413b770b57b0cab0750672 | [
"MIT"
] | null | null | null | from .models import WALL, EMPTY
from .a_star_search import reconstruct_path, end_reached
START = 100
GOAL = 200
HORIZONTAL_PATH = 300
VERTICAL_PATH = 400
CHAR_MAPPING = {
WALL: '#',
EMPTY: ' ',
GOAL: 'E',
HORIZONTAL_PATH: '-',
VERTICAL_PATH: '|',
... | 35.897059 | 132 | 0.652192 | from .models import WALL, EMPTY
from .a_star_search import reconstruct_path, end_reached
START = 100
GOAL = 200
HORIZONTAL_PATH = 300
VERTICAL_PATH = 400
CHAR_MAPPING = {
WALL: '#',
EMPTY: ' ',
GOAL: 'E',
HORIZONTAL_PATH: '-',
VERTICAL_PATH: '|',
... | 1,945 | 0 | 161 |
d87eb980fe0d49f89f076a89c36f3595711cb054 | 238 | py | Python | Chapter07/example9.py | arifmudi/Advanced-Python-Programming-Second-Edition | 55e8fb16127873b5285980301f9a0331d135253c | [
"MIT"
] | 19 | 2021-06-11T11:23:44.000Z | 2022-03-27T21:15:26.000Z | Chapter07/example9.py | arifmudi/Advanced-Python-Programming-Second-Edition | 55e8fb16127873b5285980301f9a0331d135253c | [
"MIT"
] | null | null | null | Chapter07/example9.py | arifmudi/Advanced-Python-Programming-Second-Edition | 55e8fb16127873b5285980301f9a0331d135253c | [
"MIT"
] | 16 | 2021-04-18T12:43:02.000Z | 2022-03-26T05:47:34.000Z |
if __name__ == "__main__":
generator = parrot()
generator.send(None)
generator.send("Hello")
generator.send("World")
| 19.833333 | 48 | 0.605042 | def parrot():
while True:
message = yield
print("Parrot says: {}".format(message))
if __name__ == "__main__":
generator = parrot()
generator.send(None)
generator.send("Hello")
generator.send("World")
| 81 | 0 | 22 |
72ae043e728048fcf22f2f33d47445dc1ad7ef25 | 6,549 | py | Python | cogdl/layers/deepergcn_layer.py | 1049451037/cogdl | 554f30e879e91b73a9160cabbd6b89a9a2555f49 | [
"MIT"
] | null | null | null | cogdl/layers/deepergcn_layer.py | 1049451037/cogdl | 554f30e879e91b73a9160cabbd6b89a9a2555f49 | [
"MIT"
] | null | null | null | cogdl/layers/deepergcn_layer.py | 1049451037/cogdl | 554f30e879e91b73a9160cabbd6b89a9a2555f49 | [
"MIT"
] | null | null | null | from typing import Optional
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.checkpoint import checkpoint
from .mlp_layer import MLP
from cogdl.utils import get_activation, mul_edge_softmax, get_norm_layer
class ResGNNLayer(nn.Module):
"""
Implementation of DeeperGCN in p... | 31.637681 | 124 | 0.561612 | from typing import Optional
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.checkpoint import checkpoint
from .mlp_layer import MLP
from cogdl.utils import get_activation, mul_edge_softmax, get_norm_layer
class GENConv(nn.Module):
def __init__(
self,
in_feats:... | 5,493 | 20 | 309 |
d3779b70c96cb314b1329f747be6b60a284cbaef | 3,725 | py | Python | examples/acoustics/reverberation.py | AssembleSoftware/IoTPy | d4b7b516ef95a45cff69827003d5e2d205f2ba55 | [
"BSD-3-Clause"
] | 28 | 2017-12-19T20:21:44.000Z | 2022-02-04T09:44:03.000Z | examples/acoustics/reverberation.py | AssembleSoftware/IoTPy | d4b7b516ef95a45cff69827003d5e2d205f2ba55 | [
"BSD-3-Clause"
] | 4 | 2020-05-30T20:21:58.000Z | 2020-07-11T20:49:31.000Z | examples/acoustics/reverberation.py | sdeepaknarayanan/IoTPy | ba022c3d6696527b834a865b9cf403d90665145b | [
"BSD-3-Clause"
] | 11 | 2017-05-21T15:37:41.000Z | 2021-10-16T13:45:11.000Z | import sys
import os
import threading
import matplotlib.pyplot as plt
sys.path.append(os.path.abspath("../../IoTPy/multiprocessing"))
sys.path.append(os.path.abspath("../../IoTPy/core"))
sys.path.append(os.path.abspath("../../IoTPy/agent_types"))
sys.path.append(os.path.abspath("../../IoTPy/helper_functions"))
sys.path... | 34.813084 | 79 | 0.662013 | import sys
import os
import threading
import matplotlib.pyplot as plt
sys.path.append(os.path.abspath("../../IoTPy/multiprocessing"))
sys.path.append(os.path.abspath("../../IoTPy/core"))
sys.path.append(os.path.abspath("../../IoTPy/agent_types"))
sys.path.append(os.path.abspath("../../IoTPy/helper_functions"))
sys.path... | 2,579 | 0 | 68 |
4a110c228cce4bf1775db65c76bb3e408071cc0d | 3,330 | py | Python | predict.py | vkso/FER | b7207341139ff451753a4c4640530e915673fc7c | [
"Apache-2.0"
] | null | null | null | predict.py | vkso/FER | b7207341139ff451753a4c4640530e915673fc7c | [
"Apache-2.0"
] | null | null | null | predict.py | vkso/FER | b7207341139ff451753a4c4640530e915673fc7c | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
from customParameters import *
import myMethod as myMethod
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sn
import argparse
# use method:
# python predict.py --model myModel --type whole_history_epoch
# python predict.py --model myVGG --type whole --lo... | 32.970297 | 108 | 0.653453 | import tensorflow as tf
from customParameters import *
import myMethod as myMethod
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sn
import argparse
# use method:
# python predict.py --model myModel --type whole_history_epoch
# python predict.py --model myVGG --type whole --lo... | 1,449 | 0 | 46 |
bd9618684ee9aa6ba04758da7fc013217b24a7d9 | 1,830 | py | Python | stubs.min/Autodesk/Revit/DB/__init___parts/LinkConversionData.py | ricardyn/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | 1 | 2021-02-02T13:39:16.000Z | 2021-02-02T13:39:16.000Z | stubs.min/Autodesk/Revit/DB/__init___parts/LinkConversionData.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | stubs.min/Autodesk/Revit/DB/__init___parts/LinkConversionData.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | class LinkConversionData(object,IDisposable):
"""
This class contains the information necessary to re-create a Revit document
from an external source.
"""
def Dispose(self):
""" Dispose(self: LinkConversionData) """
pass
def GetOptions(self):
"""
GetOptions(self: LinkConversionData) -> IDict... | 33.888889 | 215 | 0.698907 | class LinkConversionData(object,IDisposable):
"""
This class contains the information necessary to re-create a Revit document
from an external source.
"""
def Dispose(self):
""" Dispose(self: LinkConversionData) """
pass
def GetOptions(self):
"""
GetOptions(self: LinkConversionData) -> IDict... | 0 | 0 | 0 |
12799787f265bb70c9f6b67467052ec9d67b80a1 | 2,788 | py | Python | solar/core/tags_set_parser.py | Mirantis/solar | 7d12e56d403d70a923cd1caa9c7e3c8cf6fc57aa | [
"Apache-2.0"
] | 7 | 2015-09-07T22:52:32.000Z | 2016-01-14T09:27:09.000Z | solar/core/tags_set_parser.py | Mirantis/solar | 7d12e56d403d70a923cd1caa9c7e3c8cf6fc57aa | [
"Apache-2.0"
] | 117 | 2015-09-08T05:46:16.000Z | 2016-04-14T16:46:33.000Z | solar/core/tags_set_parser.py | Mirantis/solar | 7d12e56d403d70a923cd1caa9c7e3c8cf6fc57aa | [
"Apache-2.0"
] | 21 | 2015-09-08T06:34:50.000Z | 2015-12-09T09:14:24.000Z | # Copyright 2015 Mirantis, 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 ... | 21.952756 | 78 | 0.638451 | # Copyright 2015 Mirantis, 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 ... | 871 | 25 | 354 |
d6d15eb5e93e20bf074c366f1af36b930d073f22 | 4,235 | py | Python | detect_face.py | SuiMingYang/sales-message-classify | 1b9ce984e907b688096c2287ad80e495034b347c | [
"MIT"
] | 1 | 2020-09-01T10:37:51.000Z | 2020-09-01T10:37:51.000Z | detect_face.py | SuiMingYang/sales-message-classify | 1b9ce984e907b688096c2287ad80e495034b347c | [
"MIT"
] | null | null | null | detect_face.py | SuiMingYang/sales-message-classify | 1b9ce984e907b688096c2287ad80e495034b347c | [
"MIT"
] | null | null | null | import os
#图像分类
from cv2 import cv2
from PIL import Image,ImageDraw
from datetime import datetime
import time
from pytesseract import image_to_string
#detectFaces()返回图像中所有人脸的矩形坐标(矩形左上、右下顶点)
#使用haar特征的级联分类器haarcascade_frontalface_default.xml,在haarcascades目录下还有其他的训练好的xml文件可供选择。
#注:haarcascades目录下训练好的分类器必须以灰度图... | 35 | 103 | 0.621015 | import os
#图像分类
from cv2 import cv2
from PIL import Image,ImageDraw
from datetime import datetime
import time
from pytesseract import image_to_string
class Detect():
def __init__(self):
pass
#detectFaces()返回图像中所有人脸的矩形坐标(矩形左上、右下顶点)
#使用haar特征的级联分类器haarcascade_frontalface_default.xml,在haarcascades目录下还... | 3,470 | -6 | 258 |
7eb30442ce40c63ba4ecf1205aff46a6a36ac699 | 1,794 | py | Python | utils/rules/movie.py | 18645956947/TripleIE | 326e0844ed2cd167a084658bd89703ed94a6e484 | [
"MIT"
] | null | null | null | utils/rules/movie.py | 18645956947/TripleIE | 326e0844ed2cd167a084658bd89703ed94a6e484 | [
"MIT"
] | 1 | 2019-04-02T06:51:07.000Z | 2019-04-02T11:14:38.000Z | utils/rules/movie.py | 18645956947/TripleIE | 326e0844ed2cd167a084658bd89703ed94a6e484 | [
"MIT"
] | 1 | 2019-04-02T02:11:08.000Z | 2019-04-02T02:11:08.000Z | import re
from utils.rules.base import Base
| 32.618182 | 151 | 0.522854 | import re
from utils.rules.base import Base
class Movie(Base):
def __init__(self, sentence):
super(Movie, self).__init__(sentence)
def get_result(self):
# 电影规则
str = ''
m_1 = re.search(
r'(.*)月*(.*)(评分|评论|单日票房|实时票房|电影单价|电影票销售数量|每日销售量|每日总票房|单张利润|销售额|片长)(.*)(大于|小于|大... | 2,213 | -3 | 76 |
b53eb8e0919b384e408a28ab9f4a15b1a9246884 | 1,250 | py | Python | bot.py | RealCyGuy/Auto-Disconnect | a24002d682535bdf106781de9e6e10952f609aa1 | [
"MIT"
] | null | null | null | bot.py | RealCyGuy/Auto-Disconnect | a24002d682535bdf106781de9e6e10952f609aa1 | [
"MIT"
] | null | null | null | bot.py | RealCyGuy/Auto-Disconnect | a24002d682535bdf106781de9e6e10952f609aa1 | [
"MIT"
] | null | null | null | __version__ = "0.1.0"
import os
import discord
from dotenv import load_dotenv
load_dotenv()
bot = AutoDisconnect()
token = os.environ.get("TOKEN", None)
if token is None or len(token.strip()) == 0:
print("\nA bot token is necessary for the bot to function.\n")
raise RuntimeError
else:
bot.run(token)
| 26.595745 | 84 | 0.6072 | __version__ = "0.1.0"
import os
import discord
from dotenv import load_dotenv
load_dotenv()
class AutoDisconnect(discord.Client):
def __init__(self, *args, **kwargs):
super().__init__(activity=discord.Game("get disconnected"), *args, **kwargs)
self.channel_id = int(os.environ.get("CHANNEL_ID", ... | 784 | 16 | 130 |
2123a2a1dad3596e33fee1e857e6a3de2e73e4bd | 312 | py | Python | src/python/fundamentals/gradient-descent/problems/c.py | kevmo314/transformers | 0370daeb5d1f9ef2fd98a5ed28d7b457befac517 | [
"MIT"
] | 1 | 2020-08-02T19:28:25.000Z | 2020-08-02T19:28:25.000Z | src/python/fundamentals/gradient-descent/problems/c.py | kevmo314/transformers | 0370daeb5d1f9ef2fd98a5ed28d7b457befac517 | [
"MIT"
] | null | null | null | src/python/fundamentals/gradient-descent/problems/c.py | kevmo314/transformers | 0370daeb5d1f9ef2fd98a5ed28d7b457befac517 | [
"MIT"
] | null | null | null | from typing import Callable, Tuple
| 26 | 74 | 0.599359 | from typing import Callable, Tuple
def gradient_descent_2d(
grad_x: Callable[[float, float], float], # grad_x(x, y) = ∂f(x, y)/∂x
grad_y: Callable[[float, float], float], # grad_y(x, y) = ∂f(x, y)/∂y
alpha: float,
x: float,
y: float,
) -> Tuple[float, float]:
pass # Implement this.
| 261 | 0 | 23 |
1426c3a6dbcd345a9e8e10aaccd536cf07cace3f | 1,098 | py | Python | migrations/versions/2019_03_21_add_titles_to_charts_and_tables.py | AlexKouzy/ethnicity-facts-and-figures-publisher | 18ab2495a8633f585e18e607c7f75daa564a053d | [
"MIT"
] | 1 | 2021-10-06T13:48:36.000Z | 2021-10-06T13:48:36.000Z | migrations/versions/2019_03_21_add_titles_to_charts_and_tables.py | AlexKouzy/ethnicity-facts-and-figures-publisher | 18ab2495a8633f585e18e607c7f75daa564a053d | [
"MIT"
] | 116 | 2018-11-02T17:20:47.000Z | 2022-02-09T11:06:22.000Z | migrations/versions/2019_03_21_add_titles_to_charts_and_tables.py | racedisparityaudit/rd_cms | a12f0e3f5461cc41eed0077ed02e11efafc5dd76 | [
"MIT"
] | 2 | 2018-11-09T16:47:35.000Z | 2020-04-09T13:06:48.000Z | """Add titles to charts and tables
This is in preparation for storing the titles of charts and tables in
a separate database column, rather than as part of the JSON objects.
Revision ID: 2019_03_21_add_titles
Revises: 2019_03_20_tidy_up_dimension
Create Date: 2019-03-14 15:11:33.560576
"""
from alembic import op
imp... | 29.675676 | 113 | 0.743169 | """Add titles to charts and tables
This is in preparation for storing the titles of charts and tables in
a separate database column, rather than as part of the JSON objects.
Revision ID: 2019_03_21_add_titles
Revises: 2019_03_20_tidy_up_dimension
Create Date: 2019-03-14 15:11:33.560576
"""
from alembic import op
imp... | 545 | 0 | 46 |
b5204682d45506f2896e79ad6cf44a8f933dcf52 | 4,748 | py | Python | evolution_analysis/code/HGT_analysis/HGT_from_non_fungi/code/s3_get_taxonomy.py | SysBioChalmers/Multi_scale_evolution | b5f28ead733872519bc0758df034a076224c4253 | [
"MIT"
] | 1 | 2020-05-27T13:43:55.000Z | 2020-05-27T13:43:55.000Z | evolution_analysis/code/HGT_analysis/HGT_from_non_fungi/code/s3_get_taxonomy.py | SysBioChalmers/Multi_scale_evolution | b5f28ead733872519bc0758df034a076224c4253 | [
"MIT"
] | null | null | null | evolution_analysis/code/HGT_analysis/HGT_from_non_fungi/code/s3_get_taxonomy.py | SysBioChalmers/Multi_scale_evolution | b5f28ead733872519bc0758df034a076224c4253 | [
"MIT"
] | 1 | 2021-03-24T18:29:29.000Z | 2021-03-24T18:29:29.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Step2 : BLAST hits were parsed to retrieve associated taxonomic information
# using the NCBI's taxonomy database.
# Downloaded resource:
# wget ftp://ftp.ncbi.nih.gov/pub/taxonomy/taxdump.tar.gz
# tar -zxvf taxdump.tar.gz
# https://www.biostars.org/p/222183/
# ... | 28.261905 | 125 | 0.581929 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Step2 : BLAST hits were parsed to retrieve associated taxonomic information
# using the NCBI's taxonomy database.
# Downloaded resource:
# wget ftp://ftp.ncbi.nih.gov/pub/taxonomy/taxdump.tar.gz
# tar -zxvf taxdump.tar.gz
# https://www.biostars.org/p/222183/
# ... | 2,905 | 0 | 161 |
7ddf97b23204b21ac6a8aedc6aca4815be914f52 | 4,134 | py | Python | src/whylogs/tests/unit/core/statistics/test_schematracker.py | bernease/cli-demo-1 | 895d9eddc95ca3dd43b7ae8b33a8fbdedbc855f5 | [
"Apache-2.0"
] | null | null | null | src/whylogs/tests/unit/core/statistics/test_schematracker.py | bernease/cli-demo-1 | 895d9eddc95ca3dd43b7ae8b33a8fbdedbc855f5 | [
"Apache-2.0"
] | null | null | null | src/whylogs/tests/unit/core/statistics/test_schematracker.py | bernease/cli-demo-1 | 895d9eddc95ca3dd43b7ae8b33a8fbdedbc855f5 | [
"Apache-2.0"
] | null | null | null | from whylabs.logs.proto import InferredType
from whylabs.logs.core.statistics import SchemaTracker
Type = InferredType.Type
| 27.197368 | 77 | 0.664973 | from whylabs.logs.proto import InferredType
from whylabs.logs.core.statistics import SchemaTracker
Type = InferredType.Type
def multiple_track(tracker, counts: dict):
for item, count in counts.items():
for i in range(count):
tracker.track(item)
def test_track_nothing_should_return_unknown():... | 3,746 | 0 | 253 |
d0af38c905bc7b420694fc9c8d72b18557033577 | 839 | py | Python | api.py | Reyvel/ref-final-project-backend | 33afa0548af3fdb967a6f9c149b480028821f8e1 | [
"MIT"
] | null | null | null | api.py | Reyvel/ref-final-project-backend | 33afa0548af3fdb967a6f9c149b480028821f8e1 | [
"MIT"
] | null | null | null | api.py | Reyvel/ref-final-project-backend | 33afa0548af3fdb967a6f9c149b480028821f8e1 | [
"MIT"
] | null | null | null | import msgpack
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
import settings
app = FastAPI()
origins = [
'http://localhost:3000',
]
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=['*'],
allow_headers=['*']
)
@... | 24.676471 | 56 | 0.573302 | import msgpack
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
import settings
app = FastAPI()
origins = [
'http://localhost:3000',
]
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=['*'],
allow_headers=['*']
)
@... | 472 | 0 | 22 |
a4dd4a478ebea95668dc6ede87d349f094e71b61 | 5,552 | py | Python | data_prep_scripts/get_callsign_info.py | ctartist621/old-betsy | 58530fd91f0f87edbe92bf9885392ac6b4ce6cfc | [
"MIT"
] | null | null | null | data_prep_scripts/get_callsign_info.py | ctartist621/old-betsy | 58530fd91f0f87edbe92bf9885392ac6b4ce6cfc | [
"MIT"
] | null | null | null | data_prep_scripts/get_callsign_info.py | ctartist621/old-betsy | 58530fd91f0f87edbe92bf9885392ac6b4ce6cfc | [
"MIT"
] | null | null | null | import asyncio
import os
from threading import Timer
import aiofiles
import aiohttp
import pandas as pd
import untangle
from aiohttp import ClientSession
from progress.bar import Bar
username = os.getenv("HAMQTH_USERNAME")
password = os.getenv("HAMQTH_PASSWORD")
api_root = "https://www.hamqth.com/xml.php"
auth_uri = ... | 33.648485 | 144 | 0.590058 | import asyncio
import os
from threading import Timer
import aiofiles
import aiohttp
import pandas as pd
import untangle
from aiohttp import ClientSession
from progress.bar import Bar
username = os.getenv("HAMQTH_USERNAME")
password = os.getenv("HAMQTH_PASSWORD")
api_root = "https://www.hamqth.com/xml.php"
auth_uri = ... | 4,312 | 141 | 140 |
74edcc21bfdfeef76fbef98079856e400eec28ad | 231 | py | Python | May/Day28-Missing Number.py | tayyrov/Daily_Coding_Challenge | 9e54a725082530dca1229dfcd973d04975374220 | [
"MIT"
] | 1 | 2022-01-01T21:54:45.000Z | 2022-01-01T21:54:45.000Z | May/Day28-Missing Number.py | tayyrov/Daily_Coding_Challenge | 9e54a725082530dca1229dfcd973d04975374220 | [
"MIT"
] | null | null | null | May/Day28-Missing Number.py | tayyrov/Daily_Coding_Challenge | 9e54a725082530dca1229dfcd973d04975374220 | [
"MIT"
] | null | null | null | """
Question Source:Leetcode
Level: Easy
Topic: Math
Solver: Tayyrov
Date: 28.05.2022
"""
from typing import List
| 17.769231 | 43 | 0.619048 | """
Question Source:Leetcode
Level: Easy
Topic: Math
Solver: Tayyrov
Date: 28.05.2022
"""
from typing import List
def missingNumber(nums: List[int]) -> int:
ln = len(nums)
return ln * (ln + 1) // 2 - sum(nums) | 86 | 0 | 24 |
6a52aa238a206943e0976594da88c1534f748d56 | 403 | py | Python | swiftwind/settings/urls.py | m-den-i/swiftwind | 3af9a1ec3327a992f1d3f2c11fefbb3c06cadbce | [
"MIT"
] | 11 | 2016-12-13T00:46:48.000Z | 2020-07-28T13:44:12.000Z | swiftwind/settings/urls.py | m-den-i/swiftwind | 3af9a1ec3327a992f1d3f2c11fefbb3c06cadbce | [
"MIT"
] | 15 | 2017-11-29T19:38:32.000Z | 2018-11-02T21:08:04.000Z | swiftwind/settings/urls.py | m-den-i/swiftwind | 3af9a1ec3327a992f1d3f2c11fefbb3c06cadbce | [
"MIT"
] | 4 | 2018-10-23T12:39:04.000Z | 2019-12-30T11:06:23.000Z | from django.conf.urls import url
from django.contrib import admin
from . import views
urlpatterns = [
url(r'^$', views.GeneralSettingsView.as_view(), name='general'),
url(r'^technical/$', views.TechnicalSettingsView.as_view(), name='technical'),
url(r'^teller/$', views.TellerSettingsView.as_view(), name='... | 33.583333 | 82 | 0.702233 | from django.conf.urls import url
from django.contrib import admin
from . import views
urlpatterns = [
url(r'^$', views.GeneralSettingsView.as_view(), name='general'),
url(r'^technical/$', views.TechnicalSettingsView.as_view(), name='technical'),
url(r'^teller/$', views.TellerSettingsView.as_view(), name='... | 0 | 0 | 0 |
788ba6d26d356f3d66960ecf81b290466f0a58b7 | 7,921 | py | Python | testify/test_result.py | timgates42/Testify | 50045dfc239e0118a88487b95b27a9c17732b4cf | [
"Apache-2.0"
] | null | null | null | testify/test_result.py | timgates42/Testify | 50045dfc239e0118a88487b95b27a9c17732b4cf | [
"Apache-2.0"
] | null | null | null | testify/test_result.py | timgates42/Testify | 50045dfc239e0118a88487b95b27a9c17732b4cf | [
"Apache-2.0"
] | null | null | null | # Copyright 2009 Yelp
#
# 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, software
... | 36.84186 | 127 | 0.620629 | # Copyright 2009 Yelp
#
# 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, software
... | 5,646 | 1,346 | 46 |
c28884618590ab07181ba314399eee06f9e0c118 | 3,164 | py | Python | twitter/monitor.py | phoenix351/berita-api | 6548c9097736e7aaa49b4be6d3f9502075f60f1d | [
"MIT"
] | null | null | null | twitter/monitor.py | phoenix351/berita-api | 6548c9097736e7aaa49b4be6d3f9502075f60f1d | [
"MIT"
] | null | null | null | twitter/monitor.py | phoenix351/berita-api | 6548c9097736e7aaa49b4be6d3f9502075f60f1d | [
"MIT"
] | null | null | null | from Database import Database_connection as db
database = db()
qy = """
INSERT INTO `berita_detail` (`judul`, `waktu`, `tag`, `isi`, `sumber`) VALUES
('Mentan harap tatanan normal baru pulihkan permintaan produk pertanian', '2020-06-07', '[normal baru,new normal,petani]', ' Dengan kebijakan normal baru utamanya di sekt... | 186.117647 | 2,813 | 0.825221 | from Database import Database_connection as db
database = db()
qy = """
INSERT INTO `berita_detail` (`judul`, `waktu`, `tag`, `isi`, `sumber`) VALUES
('Mentan harap tatanan normal baru pulihkan permintaan produk pertanian', '2020-06-07', '[normal baru,new normal,petani]', ' Dengan kebijakan normal baru utamanya di sekt... | 0 | 0 | 0 |
7eea654809c7f7d973ae8eefe76d18979ef844b1 | 1,869 | py | Python | custombot/utils/loader.py | other-z/custombot | 4e53f096491ce5b388f92bbdb2e58f6ecc5dcee6 | [
"MIT"
] | 1 | 2021-02-20T07:27:33.000Z | 2021-02-20T07:27:33.000Z | custombot/utils/loader.py | other-z/custombot | 4e53f096491ce5b388f92bbdb2e58f6ecc5dcee6 | [
"MIT"
] | null | null | null | custombot/utils/loader.py | other-z/custombot | 4e53f096491ce5b388f92bbdb2e58f6ecc5dcee6 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
@Topic:
@Date: 2020/12/8
@Author: other.z
@Copyright(C): 2020-2023 other.z Inc. All rights reserved.
"""
import py
import os
import json
import yaml
import warnings
from dotenv import dotenv_values, find_dotenv
| 20.538462 | 90 | 0.5939 | # coding: utf-8
"""
@Topic:
@Date: 2020/12/8
@Author: other.z
@Copyright(C): 2020-2023 other.z Inc. All rights reserved.
"""
import py
import os
import json
import yaml
import warnings
from dotenv import dotenv_values, find_dotenv
class _LoaderBase:
suffixs = []
def __init__(self, filepath):
... | 1,046 | 437 | 138 |
3fa4b4fa52abc9f245081402e6639fe81ea003c4 | 6,752 | py | Python | mosviz/controls/tests/test_slit_controller.py | rosteen/mosviz | 90f8ac095b3b41117917878be51b9a6d6afa9595 | [
"BSD-3-Clause"
] | null | null | null | mosviz/controls/tests/test_slit_controller.py | rosteen/mosviz | 90f8ac095b3b41117917878be51b9a6d6afa9595 | [
"BSD-3-Clause"
] | null | null | null | mosviz/controls/tests/test_slit_controller.py | rosteen/mosviz | 90f8ac095b3b41117917878be51b9a6d6afa9595 | [
"BSD-3-Clause"
] | null | null | null | import pytest
import numpy as np
from astropy.wcs import WCS
import astropy.units as u
from astropy.coordinates import SkyCoord
from astropy.wcs.utils import proj_plane_pixel_area
from mosviz.viewers.mos_viewer import MOSVizViewer
def construct_test_wcs(ra=0., dec=0., x=0., y=0., area=1.0):
"""
Constructs ... | 30.278027 | 83 | 0.647068 | import pytest
import numpy as np
from astropy.wcs import WCS
import astropy.units as u
from astropy.coordinates import SkyCoord
from astropy.wcs.utils import proj_plane_pixel_area
from mosviz.viewers.mos_viewer import MOSVizViewer
def construct_test_wcs(ra=0., dec=0., x=0., y=0., area=1.0):
"""
Constructs ... | 0 | 0 | 0 |
718b5bef13c6446057058242ee77fdd12823e77a | 4,020 | py | Python | examples/lime_MMBT_example.py | junqi-jiang/mmxai | 08ae70a6d443fbdfa92dba6cd285429e85ac851f | [
"MIT"
] | 6 | 2021-05-19T16:44:46.000Z | 2021-05-19T16:46:43.000Z | examples/lime_MMBT_example.py | junqi-jiang/mmxai | 08ae70a6d443fbdfa92dba6cd285429e85ac851f | [
"MIT"
] | 8 | 2021-05-19T17:23:29.000Z | 2021-06-09T09:58:02.000Z | examples/lime_MMBT_example.py | junqi-jiang/mmxai | 08ae70a6d443fbdfa92dba6cd285429e85ac851f | [
"MIT"
] | null | null | null | from mmf.models.mmbt import MMBT
from mmxai.interpretability.classification.lime.lime_multimodal import LimeMultimodalExplainer
import numpy as np
from PIL import Image
from skimage.segmentation import mark_boundaries
from skimage import img_as_ubyte
import matplotlib.pyplot as plt
import torch
import json
import re
... | 29.777778 | 94 | 0.648259 | from mmf.models.mmbt import MMBT
from mmxai.interpretability.classification.lime.lime_multimodal import LimeMultimodalExplainer
import numpy as np
from PIL import Image
from skimage.segmentation import mark_boundaries
from skimage import img_as_ubyte
import matplotlib.pyplot as plt
import torch
import json
import re
... | 2,901 | 0 | 46 |
9c451013147b6dc471fab46150af3490ce0bf58a | 5,247 | py | Python | Python/_10_02/Dog/stdarray.py | MBkkt/Homework | db92bdb9262f1737d637f01d5cf2d3680e379a7b | [
"MIT"
] | 1 | 2019-04-07T18:27:29.000Z | 2019-04-07T18:27:29.000Z | Python/_10_02/Dog/stdarray.py | MBkkt/Homework | db92bdb9262f1737d637f01d5cf2d3680e379a7b | [
"MIT"
] | 1 | 2019-10-02T23:01:01.000Z | 2019-10-02T23:01:01.000Z | Python/_10_02/Dog/stdarray.py | MBkkt/Homework | db92bdb9262f1737d637f01d5cf2d3680e379a7b | [
"MIT"
] | 2 | 2018-10-19T22:42:54.000Z | 2019-03-10T14:57:59.000Z | """
stdarray.py
The stdarray module defines functions related to creating, reading,
and writing one- and two-dimensional arrays.
"""
import _10_02.Dog.stdio as stdio
#=======================================================================
# Array creation functions
#==================================================... | 28.98895 | 72 | 0.482371 | """
stdarray.py
The stdarray module defines functions related to creating, reading,
and writing one- and two-dimensional arrays.
"""
import _10_02.Dog.stdio as stdio
#=======================================================================
# Array creation functions
#==================================================... | 0 | 0 | 0 |
fdd0c94f13eaf25e938ee66fe93dd266a06f71da | 256 | py | Python | gork/utils.py | gkmngrgn/gork | 7b2bf2dc8e2404010fbe0908000fefb07d86af05 | [
"MIT"
] | 2 | 2019-11-24T14:34:29.000Z | 2020-11-05T19:56:50.000Z | gork/utils.py | gkmngrgn/gork | 7b2bf2dc8e2404010fbe0908000fefb07d86af05 | [
"MIT"
] | null | null | null | gork/utils.py | gkmngrgn/gork | 7b2bf2dc8e2404010fbe0908000fefb07d86af05 | [
"MIT"
] | 1 | 2021-04-01T12:41:27.000Z | 2021-04-01T12:41:27.000Z | from gork.palette import COLOR_TREE, PALETTE
from gork.structs import RGB, Color
DEFAULT_PIXEL_SIZE = 10
DEFAULT_N_CLUSTERS = 256
| 23.272727 | 53 | 0.773438 | from gork.palette import COLOR_TREE, PALETTE
from gork.structs import RGB, Color
DEFAULT_PIXEL_SIZE = 10
DEFAULT_N_CLUSTERS = 256
def get_nearest_color(rgb: RGB) -> Color:
distance, result = COLOR_TREE.query(rgb.as_tuple)
return PALETTE[result]
| 101 | 0 | 23 |
83d8b8ed8643019877177093b60f2bb8a1d77fc2 | 5,775 | py | Python | tests/objects.py | nicolaspi/config-state | bbf99c7084b88a4a491f7de3fcf27eeb619c7036 | [
"Apache-2.0"
] | 2 | 2021-08-23T10:01:16.000Z | 2021-10-13T02:27:28.000Z | tests/objects.py | nicolaspi/config-state | bbf99c7084b88a4a491f7de3fcf27eeb619c7036 | [
"Apache-2.0"
] | null | null | null | tests/objects.py | nicolaspi/config-state | bbf99c7084b88a4a491f7de3fcf27eeb619c7036 | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
from pathlib import Path
from config_state.config_state import ConfigField
from config_state.config_state import ConfigState
from config_state.config_state import reference
from config_state.config_state import stateproperty
from config_state.config_state import StateVar
... | 31.048387 | 77 | 0.686234 | from datetime import datetime
from pathlib import Path
from config_state.config_state import ConfigField
from config_state.config_state import ConfigState
from config_state.config_state import reference
from config_state.config_state import stateproperty
from config_state.config_state import StateVar
def date_factor... | 960 | 4,006 | 487 |
67d91682b7361980dedb029fa4ec3aa3743a4f6d | 3,910 | py | Python | implementations/rest/bin/authhandlers.py | djsincla/SplunkModularInputsPythonFramework | 1dd215214f3d2644cb358e41f4105fe40cff5393 | [
"Apache-2.0"
] | 3 | 2020-08-31T00:59:26.000Z | 2021-10-19T22:01:00.000Z | implementations/rest/bin/authhandlers.py | djsincla/SplunkModularInputsPythonFramework | 1dd215214f3d2644cb358e41f4105fe40cff5393 | [
"Apache-2.0"
] | null | null | null | implementations/rest/bin/authhandlers.py | djsincla/SplunkModularInputsPythonFramework | 1dd215214f3d2644cb358e41f4105fe40cff5393 | [
"Apache-2.0"
] | null | null | null | from requests.auth import AuthBase
import hmac
import base64
import hashlib
import urlparse
import urllib
#add your custom auth handler class to this module
#template
#example of adding a client certificate
#example of adding a client certificate
#cloudstack auth example | 29.179104 | 100 | 0.586701 | from requests.auth import AuthBase
import hmac
import base64
import hashlib
import urlparse
import urllib
#add your custom auth handler class to this module
class MyEncryptedCredentialsAuthHAndler(AuthBase):
def __init__(self,**args):
# setup any auth-related data here
#self.username = args['usern... | 2,908 | 112 | 576 |
4a96a26f90fa620c4f0488eeb021bdcb55be8d20 | 4,399 | py | Python | gltrader/ui/notifications/notification_row.py | davidmnoll/gltrader | 599f07f68e4146f1774d00e9b10ba8330247e11e | [
"MIT"
] | 4 | 2020-02-26T14:21:27.000Z | 2021-11-15T07:32:34.000Z | gltrader/ui/notifications/notification_row.py | davidmnoll/gltrader | 599f07f68e4146f1774d00e9b10ba8330247e11e | [
"MIT"
] | null | null | null | gltrader/ui/notifications/notification_row.py | davidmnoll/gltrader | 599f07f68e4146f1774d00e9b10ba8330247e11e | [
"MIT"
] | null | null | null | """
This lists a raw balances response from the API
"""
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.properties import NumericProperty
from kivy.graphics import Color, Rectangle
from ..buttons import SingleMarketButton, RemoveNotificationButton, ActionDoButton
from ...notifi... | 43.127451 | 150 | 0.586724 | """
This lists a raw balances response from the API
"""
from kivy.uix.gridlayout import GridLayout
from kivy.uix.label import Label
from kivy.properties import NumericProperty
from kivy.graphics import Color, Rectangle
from ..buttons import SingleMarketButton, RemoveNotificationButton, ActionDoButton
from ...notifi... | 0 | 0 | 0 |
90c09b0d490998ee977bd6c9fbfae3cb214a287a | 1,650 | py | Python | scripts/tools.py | Alex-bzh/syllabricks | 7763da169f5fc42e7c3e75b02e42116de0d609ad | [
"MIT"
] | null | null | null | scripts/tools.py | Alex-bzh/syllabricks | 7763da169f5fc42e7c3e75b02e42116de0d609ad | [
"MIT"
] | null | null | null | scripts/tools.py | Alex-bzh/syllabricks | 7763da169f5fc42e7c3e75b02e42116de0d609ad | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#-*- coding: utf-8 -*-
#
# Modules to import
#
import csv, json
#
# Custom functions
#
def nbSyllables(word, sep):
"""
Counts the number of syllables in a word
@param String word: the word
@param String sep: the separator to use
"""
return len(word.split(s... | 25 | 65 | 0.572727 | #!/usr/bin/env python
#-*- coding: utf-8 -*-
#
# Modules to import
#
import csv, json
#
# Custom functions
#
def nbSyllables(word, sep):
"""
Counts the number of syllables in a word
@param String word: the word
@param String sep: the separator to use
"""
return len(word.split(s... | 0 | 0 | 0 |
f90f399dbc7099b3e6721b1ffbe4b8e263c3e18d | 1,705 | py | Python | data_processor/previous/temp.py | lhq1/legal-predicetion | 0919732d9aecba17630a3dcaedd3611ca990010c | [
"MIT"
] | 87 | 2018-08-27T14:59:11.000Z | 2022-03-01T07:29:27.000Z | data_processor/previous/temp.py | lllybi/TopJudge | c9186b132e79830fd4e855777b06a601d76bf0a2 | [
"MIT"
] | 6 | 2018-10-11T09:29:05.000Z | 2020-12-14T02:29:28.000Z | data_processor/previous/temp.py | lllybi/TopJudge | c9186b132e79830fd4e855777b06a601d76bf0a2 | [
"MIT"
] | 31 | 2018-08-28T00:44:59.000Z | 2022-02-18T18:17:01.000Z | # coding: UTF-8
import os
import json
import re
in_path = "/disk/mysql/law_data/final_data/"
out_path = "/disk/mysql/law_data/temp_data/"
mid_text = u"\t"
num_process = 4
num_file = 20
accusation_file = "/home/zhx/law_pre/data_processor/accusation_list2.txt"
f = open(accusation_file, "r")
accusation_list = json.loa... | 24.014085 | 118 | 0.577126 | # coding: UTF-8
import os
import json
import re
in_path = "/disk/mysql/law_data/final_data/"
out_path = "/disk/mysql/law_data/temp_data/"
mid_text = u"\t"
num_process = 4
num_file = 20
accusation_file = "/home/zhx/law_pre/data_processor/accusation_list2.txt"
f = open(accusation_file, "r")
accusation_list = json.loa... | 809 | 0 | 46 |
609377c98a5d2c961225e96546221a60ab3bcec8 | 13,373 | py | Python | stevedore/datasets_hist.py | SirYetz/Containerized-Forecasting-Workflow | 4a0e9b64f31448bd84d98d72394417f5154e43ef | [
"MIT"
] | 6 | 2018-10-02T10:48:11.000Z | 2020-03-30T23:01:25.000Z | stevedore/datasets_hist.py | SirYetz/Containerized-Forecasting-Workflow | 4a0e9b64f31448bd84d98d72394417f5154e43ef | [
"MIT"
] | null | null | null | stevedore/datasets_hist.py | SirYetz/Containerized-Forecasting-Workflow | 4a0e9b64f31448bd84d98d72394417f5154e43ef | [
"MIT"
] | 3 | 2019-02-11T02:50:21.000Z | 2021-03-05T02:42:38.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
IBM Containerized Forecasting Workflow
DESCRIPTION
This file contains the class representing the different sources of input data sets.
AUTHOR
Timothy Lynar <timlynar@au1.ibm.com>, IBM Research, Melbourne, Australia
Frank Suits <frankst@au1.ibm.com>, IBM ... | 39.800595 | 100 | 0.631197 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
IBM Containerized Forecasting Workflow
DESCRIPTION
This file contains the class representing the different sources of input data sets.
AUTHOR
Timothy Lynar <timlynar@au1.ibm.com>, IBM Research, Melbourne, Australia
Frank Suits <frankst@au1.ibm.com>, IBM ... | 4,964 | 0 | 209 |
13d5546d1473c01447ce107a1e761d1cf39df8b8 | 2,083 | py | Python | src/trackers/chexx.py | hmgoalie35/chexx | 095ea2adbec6fe04d7c2110cc14e5f42ea765b0f | [
"MIT"
] | null | null | null | src/trackers/chexx.py | hmgoalie35/chexx | 095ea2adbec6fe04d7c2110cc14e5f42ea765b0f | [
"MIT"
] | 1 | 2020-04-12T17:57:39.000Z | 2020-04-12T17:57:39.000Z | src/trackers/chexx.py | hmgoalie35/chexx | 095ea2adbec6fe04d7c2110cc14e5f42ea765b0f | [
"MIT"
] | null | null | null | from math import floor
import cv2 as cv
from conf import DATA_MODEL_DIR
from readers.base import BaseReader
GREEN = (0, 255, 0)
BLACK = (0, 0, 0)
| 30.632353 | 96 | 0.540086 | from math import floor
import cv2 as cv
from conf import DATA_MODEL_DIR
from readers.base import BaseReader
GREEN = (0, 255, 0)
BLACK = (0, 0, 0)
class ChexxTracker(BaseReader):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
self.net = cv.dnn.readNetFromTensorflow(
... | 1,846 | 10 | 76 |
976d9278cf401df8f430afbf2f7b0d0b70fbd717 | 444 | py | Python | 17 Heat capacity.py | L0ganhowlett/Python_workbook-Ben_Stephenson | ab711257bd2da9b34c6001a8e09d20bfc0114a3f | [
"MIT"
] | null | null | null | 17 Heat capacity.py | L0ganhowlett/Python_workbook-Ben_Stephenson | ab711257bd2da9b34c6001a8e09d20bfc0114a3f | [
"MIT"
] | null | null | null | 17 Heat capacity.py | L0ganhowlett/Python_workbook-Ben_Stephenson | ab711257bd2da9b34c6001a8e09d20bfc0114a3f | [
"MIT"
] | null | null | null | #17 Heat Capacity
#Asking for masss of water.
m = float(input("Enter the mass of water in grams = "))
T = float(input("Enter the temperature change in degree celsius = "))
C = 4.186 * (2.7777e-7)
q = m * T * C
print("Total energy required to raise ",m," grams of a material by ",T," degrees Celsius is ",q," kilowa... | 40.363636 | 114 | 0.657658 | #17 Heat Capacity
#Asking for masss of water.
m = float(input("Enter the mass of water in grams = "))
T = float(input("Enter the temperature change in degree celsius = "))
C = 4.186 * (2.7777e-7)
q = m * T * C
print("Total energy required to raise ",m," grams of a material by ",T," degrees Celsius is ",q," kilowa... | 0 | 0 | 0 |
1648168d9dc163ada0f7db9901891b4345612cc4 | 3,631 | py | Python | test/unit/ggrc/converters/handlers/test_mapping_column_handler.py | farcry4998/ggrc-core | c469039dabb55033c1b379850feb19e8dda2e2a1 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2019-01-04T10:55:14.000Z | 2019-01-04T10:55:14.000Z | test/unit/ggrc/converters/handlers/test_mapping_column_handler.py | farcry4998/ggrc-core | c469039dabb55033c1b379850feb19e8dda2e2a1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/unit/ggrc/converters/handlers/test_mapping_column_handler.py | farcry4998/ggrc-core | c469039dabb55033c1b379850feb19e8dda2e2a1 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 2018 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Tests for the MappingColumnHandler class"""
import unittest
from mock import MagicMock
from mock import patch
from ggrc.converters.handlers.handlers import MappingColumnHandler
... | 37.43299 | 78 | 0.732856 | # -*- coding: utf-8 -*-
# Copyright (C) 2018 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Tests for the MappingColumnHandler class"""
import unittest
from mock import MagicMock
from mock import patch
from ggrc.converters.handlers.handlers import MappingColumnHandler
... | 131 | 0 | 24 |
d3982f490b09236404bbc09b37f3132f1d76ad93 | 1,058 | py | Python | students/k3342/laboratory_works/Evgenov_Sergei/laboratory_work_1/homework_project_evgenov/homework_app/migrations/0002_auto_20200607_1405.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 10 | 2020-03-20T09:06:12.000Z | 2021-07-27T13:06:02.000Z | students/k3342/laboratory_works/Evgenov_Sergei/laboratory_work_1/homework_project_evgenov/homework_app/migrations/0002_auto_20200607_1405.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 134 | 2020-03-23T09:47:48.000Z | 2022-03-12T01:05:19.000Z | students/k3342/laboratory_works/Evgenov_Sergei/laboratory_work_1/homework_project_evgenov/homework_app/migrations/0002_auto_20200607_1405.py | TonikX/ITMO_ICT_-WebProgramming_2020 | ba566c1b3ab04585665c69860b713741906935a0 | [
"MIT"
] | 71 | 2020-03-20T12:45:56.000Z | 2021-10-31T19:22:25.000Z | # Generated by Django 3.0.5 on 2020-06-07 11:05
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
| 27.842105 | 121 | 0.599244 | # Generated by Django 3.0.5 on 2020-06-07 11:05
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('homework_app', '0001_ini... | 0 | 878 | 23 |
95dc51f047e2078a05d5badb90d6fa6e74768be5 | 9,349 | py | Python | tests/test_forcefield.py | gabrielbradford/mdgo | 5e3fcfe735bf32db283136d741f1c7dc2b13d8c4 | [
"MIT"
] | 1 | 2021-12-15T01:18:13.000Z | 2021-12-15T01:18:13.000Z | tests/test_forcefield.py | gabrielbradford/mdgo | 5e3fcfe735bf32db283136d741f1c7dc2b13d8c4 | [
"MIT"
] | 4 | 2021-11-12T20:48:34.000Z | 2021-12-14T23:41:47.000Z | tests/test_forcefield.py | gabrielbradford/mdgo | 5e3fcfe735bf32db283136d741f1c7dc2b13d8c4 | [
"MIT"
] | 4 | 2021-11-12T21:10:53.000Z | 2022-02-07T19:30:57.000Z | import os
import sys
import tempfile
import unittest
from io import StringIO
import numpy as np
import pytest
from mdgo.forcefield import *
test_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "test_files")
if __name__ == "__main__":
unittest.main()
| 54.040462 | 114 | 0.63579 | import os
import sys
import tempfile
import unittest
from io import StringIO
import numpy as np
import pytest
from mdgo.forcefield import *
test_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "test_files")
class FFcrawlerTest(unittest.TestCase):
def test_chrome(self) -> None:
with open(... | 2,934 | 6,067 | 72 |
6f1ce3c1397cc5140b41f86584f1d82192fd2683 | 225 | py | Python | multi_tenant_users/compat.py | bitsick/django-multi-tenant-users | 750dab3953342c9d02b7dc337fbc4749af6f2146 | [
"Apache-2.0"
] | 7 | 2018-01-12T04:31:42.000Z | 2021-12-17T15:27:51.000Z | multi_tenant_users/compat.py | bitsick/django-multi-tenant-users | 750dab3953342c9d02b7dc337fbc4749af6f2146 | [
"Apache-2.0"
] | null | null | null | multi_tenant_users/compat.py | bitsick/django-multi-tenant-users | 750dab3953342c9d02b7dc337fbc4749af6f2146 | [
"Apache-2.0"
] | 1 | 2022-03-18T08:19:10.000Z | 2022-03-18T08:19:10.000Z | """Provides support for django-tenat-schemas and django-tenants."""
try:
from django_tenants.utils import schema_context # NOQA: F401
except ImportError:
from tenant_schemas.utils import schema_context # NOQA: F401
| 37.5 | 67 | 0.773333 | """Provides support for django-tenat-schemas and django-tenants."""
try:
from django_tenants.utils import schema_context # NOQA: F401
except ImportError:
from tenant_schemas.utils import schema_context # NOQA: F401
| 0 | 0 | 0 |
52b4f6eb9858e08ee282051dac34293eb41dbc6f | 1,188 | py | Python | chapter4/solutions/isolve.py | hexu1985/Doing.Math.With.Python | b6a02805cd450325e794a49f55d2d511f9db15a5 | [
"MIT"
] | 109 | 2015-08-28T10:23:24.000Z | 2022-02-15T01:39:51.000Z | chapter4/solutions/isolve.py | hexu1985/Doing.Math.With.Python | b6a02805cd450325e794a49f55d2d511f9db15a5 | [
"MIT"
] | 6 | 2015-12-07T19:35:30.000Z | 2021-05-01T07:25:42.000Z | chapter4/solutions/isolve.py | hexu1985/Doing.Math.With.Python | b6a02805cd450325e794a49f55d2d511f9db15a5 | [
"MIT"
] | 74 | 2015-10-15T18:09:15.000Z | 2022-01-30T05:06:21.000Z | '''
isolve.py
Single variable inequality solver
'''
from sympy import Symbol, sympify, SympifyError
from sympy import solve_poly_inequality, solve_rational_inequalities
from sympy import solve_univariate_inequality, Poly
from sympy.core.relational import Relational, Equality
if __name__ == '__main__':
ineq = inp... | 28.97561 | 83 | 0.670034 | '''
isolve.py
Single variable inequality solver
'''
from sympy import Symbol, sympify, SympifyError
from sympy import solve_poly_inequality, solve_rational_inequalities
from sympy import solve_univariate_inequality, Poly
from sympy.core.relational import Relational, Equality
def isolve(ineq_obj):
x = Symbol('x')... | 455 | 0 | 23 |
91b44e17d70badb72631a661a123680ed9e2daaa | 3,913 | py | Python | Compiler/relu_lib.py | abdelrahamanaly/beyond_rabbit | 932ad4c16c9c9dc37fc6ac9ddef48d21cb58317b | [
"MIT"
] | null | null | null | Compiler/relu_lib.py | abdelrahamanaly/beyond_rabbit | 932ad4c16c9c9dc37fc6ac9ddef48d21cb58317b | [
"MIT"
] | null | null | null | Compiler/relu_lib.py | abdelrahamanaly/beyond_rabbit | 932ad4c16c9c9dc37fc6ac9ddef48d21cb58317b | [
"MIT"
] | null | null | null | from Compiler.types import sint, sfix
from Compiler.rabbit_lib import rabbit_sint, Mode as rabbit_mode
# in this case, for complex types, a register of type string would make sense.
# returns RELUX(x) on sfix as in pytorch
# X is a 3D matrix
# returns RELU(X) as in pytorch
# returns Matrices as it is the r... | 29.421053 | 106 | 0.594173 | from Compiler.types import sint, sfix
from Compiler.rabbit_lib import rabbit_sint, Mode as rabbit_mode
class Gradient:
OFF, ON = range(2)
class Mode:
SFIX, SINT = range(2)
class relu_response:
def __init__(self, x, c):
self.__x = x
self.__c = c
def get_value(self):
return ... | 3,108 | 32 | 345 |
400e3a228a31547dec6830a90b5a2075dcb2585f | 7,709 | py | Python | torchdynamo/eval_frame.py | jansel/torchdynamo | df478179e881c6fc17e91a4fe075659a29407777 | [
"BSD-3-Clause"
] | 41 | 2021-09-14T14:58:06.000Z | 2022-02-25T12:36:22.000Z | torchdynamo/eval_frame.py | facebookresearch/torchdynamo | eb33efc75e3a76dc5f9c698bb4fd7de3242a2b3c | [
"BSD-3-Clause"
] | 62 | 2022-03-11T00:12:37.000Z | 2022-03-31T20:04:27.000Z | torchdynamo/eval_frame.py | jansel/torchdynamo | df478179e881c6fc17e91a4fe075659a29407777 | [
"BSD-3-Clause"
] | 6 | 2021-11-19T17:50:56.000Z | 2022-02-10T22:31:58.000Z | import contextlib
import copy
import functools
import logging
import threading
import torch
from torchdynamo.utils import checkpoint_params
from torchdynamo.utils import clone_inputs
from . import config
from . import convert_frame
from . import skipfiles
from . import utils
from .mutation_guard import install_gener... | 29.200758 | 88 | 0.661564 | import contextlib
import copy
import functools
import logging
import threading
import torch
from torchdynamo.utils import checkpoint_params
from torchdynamo.utils import clone_inputs
from . import config
from . import convert_frame
from . import skipfiles
from . import utils
from .mutation_guard import install_gener... | 3,928 | 163 | 369 |
103eb7969b153576abaa873d17ec8cb2b8905540 | 49,081 | py | Python | src/syft/proto/grid/messages/dataset_messages_pb2.py | godormad/PySyft | fcb3374b6318dcccf377175fb8db6f70e9e1d1e3 | [
"Apache-2.0"
] | null | null | null | src/syft/proto/grid/messages/dataset_messages_pb2.py | godormad/PySyft | fcb3374b6318dcccf377175fb8db6f70e9e1d1e3 | [
"Apache-2.0"
] | null | null | null | src/syft/proto/grid/messages/dataset_messages_pb2.py | godormad/PySyft | fcb3374b6318dcccf377175fb8db6f70e9e1d1e3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: proto/grid/messages/dataset_messages.proto
"""Generated protocol buffer code."""
# third party
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import re... | 33.872326 | 3,411 | 0.623031 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: proto/grid/messages/dataset_messages.proto
"""Generated protocol buffer code."""
# third party
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import re... | 0 | 0 | 0 |
8a45bc13240aad437a6179c942d5bebc1efc34c3 | 49,662 | py | Python | src/transformers/modeling_tf_distilbert.py | leogao2/transformers | 850197d888375135157cfcf3d795007849420e07 | [
"Apache-2.0"
] | 1 | 2021-04-20T17:01:32.000Z | 2021-04-20T17:01:32.000Z | src/transformers/modeling_tf_distilbert.py | leogao2/transformers | 850197d888375135157cfcf3d795007849420e07 | [
"Apache-2.0"
] | null | null | null | src/transformers/modeling_tf_distilbert.py | leogao2/transformers | 850197d888375135157cfcf3d795007849420e07 | [
"Apache-2.0"
] | 1 | 2020-09-10T21:01:41.000Z | 2020-09-10T21:01:41.000Z | # coding=utf-8
# Copyright 2019-present, the HuggingFace Inc. team, The Google AI Language Team and Facebook, 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.or... | 45.898336 | 161 | 0.66425 | # coding=utf-8
# Copyright 2019-present, the HuggingFace Inc. team, The Google AI Language Team and Facebook, 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.or... | 10,293 | 30,678 | 425 |
a78f8d1a0138c8fa74ca70c5cb32e3c25570a937 | 1,369 | py | Python | main.py | FundingCircle/json2html-flask | 8fdafbca9acb09d449c7dba9618e1881940fc77e | [
"MIT"
] | null | null | null | main.py | FundingCircle/json2html-flask | 8fdafbca9acb09d449c7dba9618e1881940fc77e | [
"MIT"
] | null | null | null | main.py | FundingCircle/json2html-flask | 8fdafbca9acb09d449c7dba9618e1881940fc77e | [
"MIT"
] | null | null | null | """
JSON 2 HTML convertor
=====================
(c) Varun Malhotra 2013
http://softvar.github.io
Original Source Code: https://github.com/softvar/json2html-flask
------------
LICENSE: MIT
--------
"""
# -*- coding: utf-8 -*-
import json
import collections
import html.parser
from flask import json
from flask import... | 23.20339 | 112 | 0.672754 | """
JSON 2 HTML convertor
=====================
(c) Varun Malhotra 2013
http://softvar.github.io
Original Source Code: https://github.com/softvar/json2html-flask
------------
LICENSE: MIT
--------
"""
# -*- coding: utf-8 -*-
import json
import collections
import html.parser
from flask import json
from flask import... | 34 | 0 | 22 |
e1541643753e838913bac568bbee5c4a752cd52f | 2,200 | py | Python | typeidea/blog/models.py | jiaschien/typeidea | ff5512628c71428dabc7c1767fb8c356708c7d09 | [
"MIT"
] | null | null | null | typeidea/blog/models.py | jiaschien/typeidea | ff5512628c71428dabc7c1767fb8c356708c7d09 | [
"MIT"
] | null | null | null | typeidea/blog/models.py | jiaschien/typeidea | ff5512628c71428dabc7c1767fb8c356708c7d09 | [
"MIT"
] | null | null | null | from django.contrib.auth.models import User
from django.db import models
| 33.333333 | 79 | 0.665909 | from django.contrib.auth.models import User
from django.db import models
class Category(models.Model):
STATUS_NORMAL = 1
STATUS_DELETE = 0
STATUS_ITERMS = (
(STATUS_NORMAL, '正常'),
(STATUS_DELETE, '删除'),
)
name = models.CharField(max_length=50, verbose_name="名称") ... | 0 | 2,210 | 69 |
6efae192a5f8b3f57d1651cb80148ff02914d4c4 | 10,081 | py | Python | ordlookup/oleaut32.py | weiyangye/GetPECopyrightInfo | 08b74036cd5e881c0e71d0984dc172365ac842aa | [
"Info-ZIP"
] | 716 | 2015-01-01T14:41:11.000Z | 2022-03-28T06:51:50.000Z | ordlookup/oleaut32.py | weiyangye/GetPECopyrightInfo | 08b74036cd5e881c0e71d0984dc172365ac842aa | [
"Info-ZIP"
] | 266 | 2015-01-01T15:07:27.000Z | 2022-03-30T15:19:26.000Z | ordlookup/oleaut32.py | weiyangye/GetPECopyrightInfo | 08b74036cd5e881c0e71d0984dc172365ac842aa | [
"Info-ZIP"
] | 159 | 2015-01-01T16:19:44.000Z | 2022-03-21T21:55:34.000Z | ord_names = {
2:'SysAllocString',
3:'SysReAllocString',
4:'SysAllocStringLen',
5:'SysReAllocStringLen',
6:'SysFreeString',
7:'SysStringLen',
8:'VariantInit',
9:'VariantClear',
10:'VariantCopy',
11:'VariantCopyInd',
12:'VariantChangeType',
13:'VariantTimeToDosDateTime',
... | 25.139651 | 41 | 0.643984 | ord_names = {
2:'SysAllocString',
3:'SysReAllocString',
4:'SysAllocStringLen',
5:'SysReAllocStringLen',
6:'SysFreeString',
7:'SysStringLen',
8:'VariantInit',
9:'VariantClear',
10:'VariantCopy',
11:'VariantCopyInd',
12:'VariantChangeType',
13:'VariantTimeToDosDateTime',
... | 0 | 0 | 0 |
313c5b079ddff81130a19654cc682f569c5a0595 | 3,016 | py | Python | 3 - Preprocessing dataset for melody generation pt 1/code/preprocess.py | MauiDesign/Musikalkemistgenerating-melodies-with-rnn-lstm | b3976fe4726fbe6674ebb9f8be7ad5805dd97650 | [
"MIT"
] | 48 | 2020-05-12T08:05:41.000Z | 2022-03-30T15:52:32.000Z | 3 - Preprocessing dataset for melody generation pt 1/code/preprocess.py | MauiDesign/Musikalkemistgenerating-melodies-with-rnn-lstm | b3976fe4726fbe6674ebb9f8be7ad5805dd97650 | [
"MIT"
] | 1 | 2021-07-04T05:27:36.000Z | 2021-07-04T05:27:36.000Z | 3 - Preprocessing dataset for melody generation pt 1/code/preprocess.py | MauiDesign/Musikalkemistgenerating-melodies-with-rnn-lstm | b3976fe4726fbe6674ebb9f8be7ad5805dd97650 | [
"MIT"
] | 23 | 2020-06-09T13:22:22.000Z | 2022-03-31T03:07:59.000Z | import os
import music21 as m21
KERN_DATASET_PATH = "path/to/dataset"
# durations are expressed in quarter length
ACCEPTABLE_DURATIONS = [
0.25, # 16th note
0.5, # 8th note
0.75,
1.0, # quarter note
1.5,
2, # half note
3,
4 # whole note
]
def load_songs_in_kern(dataset_path):
"""... | 26 | 95 | 0.660477 | import os
import music21 as m21
KERN_DATASET_PATH = "path/to/dataset"
# durations are expressed in quarter length
ACCEPTABLE_DURATIONS = [
0.25, # 16th note
0.5, # 8th note
0.75,
1.0, # quarter note
1.5,
2, # half note
3,
4 # whole note
]
def load_songs_in_kern(dataset_path):
"""... | 492 | 0 | 23 |
1ab6765da0378e6ff736794ebd2af3aa773a342c | 103 | py | Python | Recommendations/CF/Movies/movies-cf-app-python/adapters/bigdata/spark/spark_submit/__init__.py | javakishore-veleti/Data-Tech-Stack-Solutions | e60120d19a7b5be53da688b9c6ba7daa2a7e1b3d | [
"MIT"
] | null | null | null | Recommendations/CF/Movies/movies-cf-app-python/adapters/bigdata/spark/spark_submit/__init__.py | javakishore-veleti/Data-Tech-Stack-Solutions | e60120d19a7b5be53da688b9c6ba7daa2a7e1b3d | [
"MIT"
] | null | null | null | Recommendations/CF/Movies/movies-cf-app-python/adapters/bigdata/spark/spark_submit/__init__.py | javakishore-veleti/Data-Tech-Stack-Solutions | e60120d19a7b5be53da688b9c6ba7daa2a7e1b3d | [
"MIT"
] | null | null | null | from adapters.bigdata.spark.spark_submit.cli_main import register_adapter_impl
register_adapter_impl() | 34.333333 | 78 | 0.893204 | from adapters.bigdata.spark.spark_submit.cli_main import register_adapter_impl
register_adapter_impl() | 0 | 0 | 0 |
4fcbfb15a9f1919c3131271dad8e4c000be094f0 | 109 | py | Python | utils/ascii-sum.py | EvanHahn/brainfuck-web-app | 487cc274f056752494d7bea7013f05a3c89f6c09 | [
"Unlicense"
] | 120 | 2016-04-08T22:54:50.000Z | 2022-03-25T01:15:23.000Z | utils/ascii-sum.py | cascalheira/brainfuck-web-app | 487cc274f056752494d7bea7013f05a3c89f6c09 | [
"Unlicense"
] | null | null | null | utils/ascii-sum.py | cascalheira/brainfuck-web-app | 487cc274f056752494d7bea7013f05a3c89f6c09 | [
"Unlicense"
] | 14 | 2017-03-09T19:01:11.000Z | 2022-03-04T06:01:27.000Z | #!/usr/bin/env python
from sys import argv
result = 0
for c in argv[1]:
result += ord(c)
print(result)
| 12.111111 | 21 | 0.651376 | #!/usr/bin/env python
from sys import argv
result = 0
for c in argv[1]:
result += ord(c)
print(result)
| 0 | 0 | 0 |
26d824566c9b423eb0db6d1a7768022f646a10ff | 267 | py | Python | tests/conftest.py | PyDemic/pydemic | 7e748e4bbe5c1f7fb209271af0ff8afb8fbd4fd5 | [
"MIT"
] | 3 | 2020-05-10T23:52:41.000Z | 2021-08-31T14:38:24.000Z | tests/conftest.py | PyDemic/pydemic | 7e748e4bbe5c1f7fb209271af0ff8afb8fbd4fd5 | [
"MIT"
] | 1 | 2020-09-27T03:26:51.000Z | 2022-03-30T12:18:08.000Z | tests/conftest.py | PyDemic/pydemic | 7e748e4bbe5c1f7fb209271af0ff8afb8fbd4fd5 | [
"MIT"
] | 1 | 2020-10-01T04:07:39.000Z | 2020-10-01T04:07:39.000Z | from pydemic.testing import en
| 29.666667 | 87 | 0.730337 | from pydemic.testing import en
def pytest_configure(config):
config.addinivalue_line("markers", "slow: mark tests that take long to run")
config.addinivalue_line(
"markers", "external: mark tests that use external resources from the internet"
)
| 212 | 0 | 23 |
3b7db7a58c84e313a87154255140d756d20d63db | 997 | py | Python | darksite/account/test/schema/test_log_in_mutation.py | UNCDarkside/DarksiteAPI | a4bc1f4adee7ecfba840ad45da22513f88acbbd0 | [
"MIT"
] | null | null | null | darksite/account/test/schema/test_log_in_mutation.py | UNCDarkside/DarksiteAPI | a4bc1f4adee7ecfba840ad45da22513f88acbbd0 | [
"MIT"
] | 46 | 2018-12-19T06:53:37.000Z | 2019-01-11T18:20:05.000Z | darksite/account/test/schema/test_log_in_mutation.py | UNCDarkside/DarksiteAPI | a4bc1f4adee7ecfba840ad45da22513f88acbbd0 | [
"MIT"
] | null | null | null | from unittest import mock
import pytest
from account import schema
def test_log_in_invalid_credentials(db):
"""
If the provided credentials don't match a user, an exception should
be raised.
"""
mutation = schema.LogIn()
with pytest.raises(Exception):
mutation.mutate(None, email="f... | 24.317073 | 76 | 0.693079 | from unittest import mock
import pytest
from account import schema
class DummyInfo:
def __init__(self, context):
self.context = context
def test_log_in_invalid_credentials(db):
"""
If the provided credentials don't match a user, an exception should
be raised.
"""
mutation = schema.... | 38 | -5 | 49 |
0f28dba61d436119cb72e1ad578c4bc9a490ee0c | 50,377 | py | Python | examples/libtest/ClassTest.py | takipsizad/pyjs | 54db0ba6747aca744f9f3c3e985a17e913dfb951 | [
"ECL-2.0",
"Apache-2.0"
] | 739 | 2015-01-01T02:05:11.000Z | 2022-03-30T15:26:16.000Z | examples/libtest/ClassTest.py | takipsizad/pyjs | 54db0ba6747aca744f9f3c3e985a17e913dfb951 | [
"ECL-2.0",
"Apache-2.0"
] | 33 | 2015-03-25T23:17:04.000Z | 2021-08-19T08:25:22.000Z | examples/libtest/ClassTest.py | takipsizad/pyjs | 54db0ba6747aca744f9f3c3e985a17e913dfb951 | [
"ECL-2.0",
"Apache-2.0"
] | 167 | 2015-01-01T22:27:47.000Z | 2022-03-17T13:29:19.000Z | import sys
from UnitTest import UnitTest, IN_BROWSER
# syntax check
# import a, b, c
if True:
import imports.circ1
from imports import exec_order, imports as IMPORTS
from imports import exec_order as EXEC_ORDER
import I18N
from imports.classes import WithAttribute
import imports.decors # must be in this form
gl... | 33.274108 | 184 | 0.603152 | import sys
from UnitTest import UnitTest, IN_BROWSER
# syntax check
# import a, b, c
if True:
import imports.circ1
from imports import exec_order, imports as IMPORTS
from imports import exec_order as EXEC_ORDER
import I18N
from imports.classes import WithAttribute
import imports.decors # must be in this form
gl... | 40,188 | 6,413 | 2,389 |
4da70072383f47dd0190ff3831a4d946952de55d | 26 | py | Python | detector/YOLOv3/nms/__init__.py | tenghehan/reid_without_id | d1d0ff273b1ef19fc6da8cbbf210527779b37455 | [
"MIT"
] | 2,175 | 2018-10-05T09:13:12.000Z | 2022-03-31T10:00:33.000Z | detector/YOLOv3/nms/__init__.py | tenghehan/reid_without_id | d1d0ff273b1ef19fc6da8cbbf210527779b37455 | [
"MIT"
] | 232 | 2018-09-29T06:39:43.000Z | 2022-03-21T09:26:29.000Z | detector/YOLOv3/nms/__init__.py | tenghehan/reid_without_id | d1d0ff273b1ef19fc6da8cbbf210527779b37455 | [
"MIT"
] | 665 | 2018-10-06T07:52:29.000Z | 2022-03-27T23:51:34.000Z | from .nms import boxes_nms | 26 | 26 | 0.846154 | from .nms import boxes_nms | 0 | 0 | 0 |
5245ec313baa01b218b015463d7468714caad528 | 14,647 | py | Python | dualbound/Arnoldi/shell_Green_Taylor_Arnoldi_spatialDiscretization_mp.py | PengningChao/emdb-sphere | d20ac81ab4fd744f87788bda46d3aa19598658ee | [
"MIT"
] | null | null | null | dualbound/Arnoldi/shell_Green_Taylor_Arnoldi_spatialDiscretization_mp.py | PengningChao/emdb-sphere | d20ac81ab4fd744f87788bda46d3aa19598658ee | [
"MIT"
] | null | null | null | dualbound/Arnoldi/shell_Green_Taylor_Arnoldi_spatialDiscretization_mp.py | PengningChao/emdb-sphere | d20ac81ab4fd744f87788bda46d3aa19598658ee | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 5 21:46:50 2020
@author: pengning
"""
import numpy as np
import scipy.special as sp
import matplotlib.pyplot as plt
from .shell_domain import shell_rho_M, shell_rho_N
import mpmath
from mpmath import mp
from .dipole_field import mp_spherical_jn, m... | 48.339934 | 242 | 0.709429 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed Aug 5 21:46:50 2020
@author: pengning
"""
import numpy as np
import scipy.special as sp
import matplotlib.pyplot as plt
from .shell_domain import shell_rho_M, shell_rho_N
import mpmath
from mpmath import mp
from .dipole_field import mp_spherical_jn, m... | 7,075 | 0 | 77 |
dd1d64b45d54b14818bed0cb693ce901fbcacf2d | 608 | py | Python | apps/booking/migrations/0002_auto_20210306_1210.py | aadrm/breakoutwagtail | cf4ce09153adf2b5e14f15ffbc82bda754d427b3 | [
"MIT"
] | null | null | null | apps/booking/migrations/0002_auto_20210306_1210.py | aadrm/breakoutwagtail | cf4ce09153adf2b5e14f15ffbc82bda754d427b3 | [
"MIT"
] | null | null | null | apps/booking/migrations/0002_auto_20210306_1210.py | aadrm/breakoutwagtail | cf4ce09153adf2b5e14f15ffbc82bda754d427b3 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.4 on 2021-03-06 12:10
from django.db import migrations, models
| 25.333333 | 86 | 0.595395 | # Generated by Django 3.1.4 on 2021-03-06 12:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('booking', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='room',
name='description_de',
... | 0 | 494 | 23 |
f007493556dbfced9f2017c7ca394d365c220852 | 1,812 | py | Python | Python/grouping.py | arigo/vr-sketch-3 | 97491e40476278cd6d487f2516b12a3d9db84c2d | [
"MIT"
] | null | null | null | Python/grouping.py | arigo/vr-sketch-3 | 97491e40476278cd6d487f2516b12a3d9db84c2d | [
"MIT"
] | null | null | null | Python/grouping.py | arigo/vr-sketch-3 | 97491e40476278cd6d487f2516b12a3d9db84c2d | [
"MIT"
] | null | null | null | from model import ModelStep, Group
| 29.704918 | 76 | 0.663355 | from model import ModelStep, Group
def newgroup(app):
for e in list(app.selected_edges):
if e.group is not app.curgroup:
app.selected_edges.discard(e)
for g in list(app.selected_subgroups):
if g.parent is not app.curgroup:
app.selected_subgroups.discard(g)
app.selec... | 1,729 | 0 | 46 |
8368dcc980f0f55291ed6b124a6dcb787dbb823c | 11,429 | py | Python | fastNLP/api/api.py | YanLiqi/fastNLP | a8c45796158a3b8dbc81e22412bd6e4e4b97539a | [
"Apache-2.0"
] | 4 | 2019-01-19T13:58:10.000Z | 2019-01-19T15:07:48.000Z | fastNLP/api/api.py | YanLiqi/fastNLP | a8c45796158a3b8dbc81e22412bd6e4e4b97539a | [
"Apache-2.0"
] | null | null | null | fastNLP/api/api.py | YanLiqi/fastNLP | a8c45796158a3b8dbc81e22412bd6e4e4b97539a | [
"Apache-2.0"
] | null | null | null | import warnings
import torch
warnings.filterwarnings('ignore')
import os
from fastNLP.core.dataset import DataSet
from fastNLP.api.utils import load_url
from fastNLP.api.processor import ModelProcessor
from reproduction.chinese_word_segment.cws_io.cws_reader import ConllCWSReader
from reproduction.pos_tag_model.pos... | 34.218563 | 117 | 0.584391 | import warnings
import torch
warnings.filterwarnings('ignore')
import os
from fastNLP.core.dataset import DataSet
from fastNLP.api.utils import load_url
from fastNLP.api.processor import ModelProcessor
from reproduction.chinese_word_segment.cws_io.cws_reader import ConllCWSReader
from reproduction.pos_tag_model.pos... | 6,163 | 3,280 | 417 |
7111b1a2c76d6630b980fbd687a898d741e2754a | 27,468 | py | Python | code/cctp.py | progami/CCTP | 37a35cb46d0d449c8bfc1e494432f4aac4a2e84f | [
"Unlicense"
] | null | null | null | code/cctp.py | progami/CCTP | 37a35cb46d0d449c8bfc1e494432f4aac4a2e84f | [
"Unlicense"
] | null | null | null | code/cctp.py | progami/CCTP | 37a35cb46d0d449c8bfc1e494432f4aac4a2e84f | [
"Unlicense"
] | 1 | 2021-02-01T19:37:57.000Z | 2021-02-01T19:37:57.000Z | import decimal
import logging
import os
import smtplib
import time
import warnings
from datetime import datetime
import pandas as pd
import zmq
from binance.client import Client
from coinmarketcap import Market
from colorama import init, Fore, Back, Style
# noinspection PyUnresolvedReferences
from sentimentAnalyse impo... | 45.78 | 120 | 0.594 | import decimal
import logging
import os
import smtplib
import time
import warnings
from datetime import datetime
import pandas as pd
import zmq
from binance.client import Client
from coinmarketcap import Market
from colorama import init, Fore, Back, Style
# noinspection PyUnresolvedReferences
from sentimentAnalyse impo... | 17,321 | 9,253 | 46 |
0ebeaa3edc54cfb4230c1f81934806f7230fbd87 | 144 | py | Python | app/main/__init__.py | Alexotieno1717/pitch | 103996667ed7a69aff1b9d3ca84f7546444fce58 | [
"MIT"
] | 1 | 2020-09-21T07:02:27.000Z | 2020-09-21T07:02:27.000Z | app/main/__init__.py | Alexotieno1717/pitch | 103996667ed7a69aff1b9d3ca84f7546444fce58 | [
"MIT"
] | null | null | null | app/main/__init__.py | Alexotieno1717/pitch | 103996667ed7a69aff1b9d3ca84f7546444fce58 | [
"MIT"
] | null | null | null | from flask import Blueprint
main = Blueprint('main', __name__)
# try:
from app.main import views
# except:
# print('*'*50,"Error","*"*50)
| 16 | 34 | 0.652778 | from flask import Blueprint
main = Blueprint('main', __name__)
# try:
from app.main import views
# except:
# print('*'*50,"Error","*"*50)
| 0 | 0 | 0 |
4e7ea87e00c20a20918afd2226e47c3ff0b5664e | 14,412 | py | Python | sqltills/parsetree.py | Moro-Code/SQLTills | 65ba0b77bc3850ac88029e417064005418570987 | [
"MIT"
] | null | null | null | sqltills/parsetree.py | Moro-Code/SQLTills | 65ba0b77bc3850ac88029e417064005418570987 | [
"MIT"
] | null | null | null | sqltills/parsetree.py | Moro-Code/SQLTills | 65ba0b77bc3850ac88029e417064005418570987 | [
"MIT"
] | null | null | null | """
this module contains the neccesary datastructures that are used by the utility functions in the cruds module
Contents
--------
Expression
This class is used to construct a function with the specified expression
"""
#types used to give type hintings wherever possible
import typing
#the sqlalchemy DeclarativeM... | 47.407895 | 161 | 0.588815 | """
this module contains the neccesary datastructures that are used by the utility functions in the cruds module
Contents
--------
Expression
This class is used to construct a function with the specified expression
"""
#types used to give type hintings wherever possible
import typing
#the sqlalchemy DeclarativeM... | 377 | 0 | 104 |
a3a2ade6e36fd50c18e3023466a85b252ba5b679 | 5,206 | py | Python | modules/demo/graph/python/convert_matrix.py | AjayThorve/rapids-js-1 | 48aa0baf849e802f595bc2ae054ebdde8b57fc8c | [
"Apache-2.0"
] | 1 | 2021-06-24T23:08:49.000Z | 2021-06-24T23:08:49.000Z | modules/demo/graph/python/convert_matrix.py | AjayThorve/rapids-js-1 | 48aa0baf849e802f595bc2ae054ebdde8b57fc8c | [
"Apache-2.0"
] | null | null | null | modules/demo/graph/python/convert_matrix.py | AjayThorve/rapids-js-1 | 48aa0baf849e802f595bc2ae054ebdde8b57fc8c | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 43.383333 | 94 | 0.619862 | # Copyright (c) 2021, NVIDIA CORPORATION.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 3,816 | 0 | 162 |
d89ee534dab95a3edfc25ef43d8063f70878a6a3 | 1,800 | py | Python | Probability Calculator/prob_calculator.py | thevirtualbuddy/Python-freecodecamp | fb6ea19385da68ba4c8735024ada4a1eae3074d0 | [
"MIT"
] | null | null | null | Probability Calculator/prob_calculator.py | thevirtualbuddy/Python-freecodecamp | fb6ea19385da68ba4c8735024ada4a1eae3074d0 | [
"MIT"
] | null | null | null | Probability Calculator/prob_calculator.py | thevirtualbuddy/Python-freecodecamp | fb6ea19385da68ba4c8735024ada4a1eae3074d0 | [
"MIT"
] | null | null | null | import copy
import random
# Consider using the modules imported above.
| 29.508197 | 90 | 0.601111 | import copy
import random
# Consider using the modules imported above.
class Hat:
def __init__(self, **kwargs):
self.Originalcontents = dict()
self.contents = []
for key, value in kwargs.items():
self.Originalcontents[key]=value
for i in range(value):
... | 1,628 | -11 | 103 |
4d50f23be5fa23de4c485b333a22295e42a4c1dc | 509 | py | Python | tests/acceptance/test_account_settings.py | seukjung/sentry-custom | c5f6bb2019aef3caff7f3e2b619f7a70f2b9b963 | [
"BSD-3-Clause"
] | 1 | 2018-03-05T15:40:12.000Z | 2018-03-05T15:40:12.000Z | tests/acceptance/test_account_settings.py | seukjung/sentry-custom | c5f6bb2019aef3caff7f3e2b619f7a70f2b9b963 | [
"BSD-3-Clause"
] | 8 | 2019-12-28T23:49:55.000Z | 2022-03-02T04:34:18.000Z | tests/acceptance/test_account_settings.py | zaasmi/codeerrorhelp | 1ab8d3e314386b9b2d58dad9df45355bf6014ac9 | [
"BSD-3-Clause"
] | 2 | 2021-01-26T09:53:39.000Z | 2022-03-22T09:01:47.000Z | from __future__ import absolute_import
from sentry.testutils import AcceptanceTestCase
| 29.941176 | 57 | 0.705305 | from __future__ import absolute_import
from sentry.testutils import AcceptanceTestCase
class AccountSettingsTest(AcceptanceTestCase):
def setUp(self):
super(AccountSettingsTest, self).setUp()
self.user = self.create_user('foo@example.com')
self.login_as(self.user)
self.path = '/ac... | 319 | 25 | 76 |
1baa095d1373f3e2ca29897fc3b861c778187db3 | 4,058 | py | Python | kivy/tests/test_uix_stacklayout.py | Galland/kivy | 95a6bf279883d706f645e4629c16d5ee1038f0ec | [
"MIT"
] | 13,889 | 2015-01-01T06:43:41.000Z | 2022-03-31T17:37:56.000Z | kivy/tests/test_uix_stacklayout.py | Galland/kivy | 95a6bf279883d706f645e4629c16d5ee1038f0ec | [
"MIT"
] | 4,570 | 2015-01-01T17:58:52.000Z | 2022-03-31T18:42:16.000Z | kivy/tests/test_uix_stacklayout.py | Galland/kivy | 95a6bf279883d706f645e4629c16d5ee1038f0ec | [
"MIT"
] | 3,786 | 2015-01-01T09:20:45.000Z | 2022-03-30T21:15:05.000Z | '''
uix.stacklayout tests
=====================
'''
import unittest
from kivy.uix.stacklayout import StackLayout
from kivy.uix.widget import Widget
| 33.53719 | 74 | 0.561853 | '''
uix.stacklayout tests
=====================
'''
import unittest
from kivy.uix.stacklayout import StackLayout
from kivy.uix.widget import Widget
class UixStackLayoutTest(unittest.TestCase):
def test_stacklayout_no_children(self):
sl = StackLayout()
sl.do_layout()
def test_stacklayout_de... | 3,618 | 23 | 266 |
1a3b05d93297931d9a07f0d409ff4332d52b0801 | 3,482 | py | Python | django_sso_app/core/authentication/middleware/base.py | paiuolo/django-sso-app | 75b96c669dc0b176dc77e08f018a3e97d259f636 | [
"MIT"
] | 1 | 2021-11-16T15:16:08.000Z | 2021-11-16T15:16:08.000Z | django_sso_app/core/authentication/middleware/base.py | paiuolo/django-sso-app | 75b96c669dc0b176dc77e08f018a3e97d259f636 | [
"MIT"
] | null | null | null | django_sso_app/core/authentication/middleware/base.py | paiuolo/django-sso-app | 75b96c669dc0b176dc77e08f018a3e97d259f636 | [
"MIT"
] | null | null | null | import logging
from django.contrib import auth
from django.urls import reverse
from django.utils.deprecation import MiddlewareMixin # https://stackoverflow.com/questions/42232606/django
# -exception-middleware-typeerror-object-takes-no-parameters
from django.conf ... | 41.452381 | 114 | 0.696439 | import logging
from django.contrib import auth
from django.urls import reverse
from django.utils.deprecation import MiddlewareMixin # https://stackoverflow.com/questions/42232606/django
# -exception-middleware-typeerror-object-takes-no-parameters
from django.conf ... | 1,499 | 0 | 158 |
7ea0731e7b6e04efd9653597929b263532f95e7f | 5,117 | py | Python | link_shortener/api/tests/test_api_retrieve.py | vojta-janousek/link-shortener | 1462a62b9a505d043291b3ccd03afbb709535600 | [
"MIT"
] | null | null | null | link_shortener/api/tests/test_api_retrieve.py | vojta-janousek/link-shortener | 1462a62b9a505d043291b3ccd03afbb709535600 | [
"MIT"
] | null | null | null | link_shortener/api/tests/test_api_retrieve.py | vojta-janousek/link-shortener | 1462a62b9a505d043291b3ccd03afbb709535600 | [
"MIT"
] | 1 | 2020-08-07T11:16:05.000Z | 2020-08-07T11:16:05.000Z | '''
Copyright (C) 2020 Link Shortener Authors (see AUTHORS in Documentation).
Licensed under the MIT (Expat) License (see LICENSE in Documentation).
'''
from decouple import config
from unittest import TestCase
from json import loads
from link_shortener.server import create_app
| 33.444444 | 78 | 0.624976 | '''
Copyright (C) 2020 Link Shortener Authors (see AUTHORS in Documentation).
Licensed under the MIT (Expat) License (see LICENSE in Documentation).
'''
from decouple import config
from unittest import TestCase
from json import loads
from link_shortener.server import create_app
class TestRetrieveLinksAPI(TestCase):... | 245 | 4,543 | 46 |