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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0ff06848217ed3681bc4876e8ad79a90cb96f248 | 1,278 | py | Python | bot.py | Gagan-10/pyro_frwd_bot | e8b56cbf6284dd40800db2aec0bcc9f6d9419f15 | [
"Apache-2.0"
] | null | null | null | bot.py | Gagan-10/pyro_frwd_bot | e8b56cbf6284dd40800db2aec0bcc9f6d9419f15 | [
"Apache-2.0"
] | null | null | null | bot.py | Gagan-10/pyro_frwd_bot | e8b56cbf6284dd40800db2aec0bcc9f6d9419f15 | [
"Apache-2.0"
] | 1 | 2021-07-04T04:33:22.000Z | 2021-07-04T04:33:22.000Z | import logging
import asyncio
import os
from pyrogram import Client, filters
logging.basicConfig(
format='%(levelname)5s - %(name)s - %(message)s',
level=0
)
LOGGER = logging.getLogger("root")
LOGGER.setLevel(logging._nameToLevel[os.environ.get("log_level", "NOTSET").upper()])
string_session = os.environ.g... | 25.56 | 89 | 0.731612 | import logging
import asyncio
import os
from pyrogram import Client, filters
logging.basicConfig(
format='%(levelname)5s - %(name)s - %(message)s',
level=0
)
LOGGER = logging.getLogger("root")
LOGGER.setLevel(logging._nameToLevel[os.environ.get("log_level", "NOTSET").upper()])
string_session = os.environ.g... | 226 | 0 | 44 |
470758ee21ff2a22cbd1ecbce083c86c68da23c1 | 1,374 | py | Python | octavia/tests/unit/image/drivers/noop_driver/test_driver.py | zhangi/octavia | e68c851fecf55e1b5ffe7d5b849f729626af28a3 | [
"Apache-2.0"
] | 129 | 2015-06-23T08:06:23.000Z | 2022-03-31T12:38:20.000Z | octavia/tests/unit/image/drivers/noop_driver/test_driver.py | zhangi/octavia | e68c851fecf55e1b5ffe7d5b849f729626af28a3 | [
"Apache-2.0"
] | 6 | 2016-05-20T11:05:27.000Z | 2021-03-23T06:05:52.000Z | octavia/tests/unit/image/drivers/noop_driver/test_driver.py | zhangi/octavia | e68c851fecf55e1b5ffe7d5b849f729626af28a3 | [
"Apache-2.0"
] | 166 | 2015-07-15T16:24:05.000Z | 2022-03-02T20:54:36.000Z | # Copyright 2020 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 or agr... | 34.35 | 75 | 0.706696 | # Copyright 2020 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 or agr... | 509 | 20 | 77 |
6dfa6921805aafb1c080c1db6f47b6e22b6e52d6 | 7,364 | py | Python | Scripts/RemoveVerticalOffset.py | broxtopd/SFM-Processing | 2d6f4fc5748d0db212842a006d4ccce3ae0e84dc | [
"MIT"
] | null | null | null | Scripts/RemoveVerticalOffset.py | broxtopd/SFM-Processing | 2d6f4fc5748d0db212842a006d4ccce3ae0e84dc | [
"MIT"
] | null | null | null | Scripts/RemoveVerticalOffset.py | broxtopd/SFM-Processing | 2d6f4fc5748d0db212842a006d4ccce3ae0e84dc | [
"MIT"
] | null | null | null | import sys, os, shutil
import subprocess
from osgeo import gdal
from osgeo.gdalconst import *
import tempfile
import numpy as np
sys.path.insert(1, os.path.dirname(os.path.realpath(__file__)) + '/../')
from GeoRefPars import GeoRefPars
# Removes vertical offset for an for a ground point cloud with uncertain g... | 44.095808 | 168 | 0.63566 | import sys, os, shutil
import subprocess
from osgeo import gdal
from osgeo.gdalconst import *
import tempfile
import numpy as np
sys.path.insert(1, os.path.dirname(os.path.realpath(__file__)) + '/../')
from GeoRefPars import GeoRefPars
# Removes vertical offset for an for a ground point cloud with uncertain g... | 0 | 0 | 0 |
16d6b0504a61f587a159bffc9e40a94165c3807a | 13,916 | py | Python | tests/plugins/test_openid.py | taus-semmle/kinto | a4cd7c6413d1d7809fe02670c0224959390dc25d | [
"Apache-2.0"
] | null | null | null | tests/plugins/test_openid.py | taus-semmle/kinto | a4cd7c6413d1d7809fe02670c0224959390dc25d | [
"Apache-2.0"
] | null | null | null | tests/plugins/test_openid.py | taus-semmle/kinto | a4cd7c6413d1d7809fe02670c0224959390dc25d | [
"Apache-2.0"
] | null | null | null | import unittest
from unittest import mock
from kinto.core.testing import DummyRequest
from kinto.plugins.openid import OpenIDConnectPolicy
from kinto.plugins.openid.utils import fetch_openid_config
from .. import support
| 43.4875 | 99 | 0.659529 | import unittest
from unittest import mock
from kinto.core.testing import DummyRequest
from kinto.plugins.openid import OpenIDConnectPolicy
from kinto.plugins.openid.utils import fetch_openid_config
from .. import support
def get_openid_configuration(url):
base_url = url.replace("/.well-known/openid-configuratio... | 12,191 | 588 | 905 |
0d69c6f9e4c0b06d6484e7fbc6b6d1882eed3358 | 8,699 | py | Python | bcs-ui/backend/tests/helm/app/test_utils.py | laodiu/bk-bcs | 2a956a42101ff6487ff521fb3ef429805bfa7e26 | [
"Apache-2.0"
] | 1 | 2021-11-16T08:15:13.000Z | 2021-11-16T08:15:13.000Z | bcs-ui/backend/tests/helm/app/test_utils.py | laodiu/bk-bcs | 2a956a42101ff6487ff521fb3ef429805bfa7e26 | [
"Apache-2.0"
] | null | null | null | bcs-ui/backend/tests/helm/app/test_utils.py | laodiu/bk-bcs | 2a956a42101ff6487ff521fb3ef429805bfa7e26 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 271.84375 | 3,756 | 0.620071 | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making 蓝鲸智云PaaS平台社区版 (BlueKing PaaS Community
Edition) available.
Copyright (C) 2017-2021 THL A29 Limited, a Tencent company. All rights reserved.
Licensed under the MIT License (the "License"); you may not use this file except in co... | 271 | 0 | 23 |
2c04ea16448ad25374f173a5b3f0f6650c13fa5c | 112 | py | Python | lesson10/legb3.py | drednout/letspython | 9747442d63873b5f71e2c15ed5528bd98ad5ac31 | [
"BSD-2-Clause"
] | 1 | 2015-11-26T15:53:58.000Z | 2015-11-26T15:53:58.000Z | lesson10/legb3.py | drednout/letspython | 9747442d63873b5f71e2c15ed5528bd98ad5ac31 | [
"BSD-2-Clause"
] | null | null | null | lesson10/legb3.py | drednout/letspython | 9747442d63873b5f71e2c15ed5528bd98ad5ac31 | [
"BSD-2-Clause"
] | null | null | null | x = 1
f()
print("globally, x={}".format(x))
| 11.2 | 33 | 0.473214 | x = 1
def f():
global x
x = 2
print("in f, x={}".format(x))
f()
print("globally, x={}".format(x))
| 44 | 0 | 23 |
a3aa05e597d13f67acaa82a3abc3d35f823b65f0 | 518 | py | Python | CS305_Computer-Network/Lab4-socket/Echo-Server.py | Eveneko/SUSTech-Courses | 0420873110e91e8d13e6e85a974f1856e01d28d6 | [
"MIT"
] | 4 | 2020-11-11T11:56:57.000Z | 2021-03-11T10:05:09.000Z | CS305_Computer-Network/Lab4-socket/Echo-Server.py | Eveneko/SUSTech-Courses | 0420873110e91e8d13e6e85a974f1856e01d28d6 | [
"MIT"
] | null | null | null | CS305_Computer-Network/Lab4-socket/Echo-Server.py | Eveneko/SUSTech-Courses | 0420873110e91e8d13e6e85a974f1856e01d28d6 | [
"MIT"
] | 3 | 2021-01-07T04:14:11.000Z | 2021-04-27T13:41:36.000Z | import socket
if __name__ == "__main__":
try:
echo()
except KeyboardInterrupt:
exit() | 23.545455 | 60 | 0.5 | import socket
def echo():
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind(('127.0.0.1', 5555))
sock.listen(10)
while True:
conn, address = sock.accept()
while True:
data = conn.recv(2048)
if data and data != b'exit':
conn.send(da... | 385 | 0 | 22 |
867169c5cb95c528d91ff9a8929f06c50a130b6c | 147 | py | Python | python/helpers/pydev/tests_pydevd_python/my_extensions/pydevd_plugins/extensions/__init__.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/helpers/pydev/pydevd_plugins/extensions/types/__init__.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/helpers/pydev/pydevd_plugins/extensions/types/__init__.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | try:
__import__('pkg_resources').declare_namespace(__name__)
except:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
| 24.5 | 59 | 0.761905 | try:
__import__('pkg_resources').declare_namespace(__name__)
except:
import pkgutil
__path__ = pkgutil.extend_path(__path__, __name__)
| 0 | 0 | 0 |
ee70cd3ee753442147507e1cc07ddb76132eb92d | 2,056 | py | Python | Materials.py | manveti/shipgen | c008f1c4bb3be7c67d4634c458aa7dfac48df0b5 | [
"MIT"
] | 1 | 2022-03-15T00:11:09.000Z | 2022-03-15T00:11:09.000Z | Materials.py | hanok2/shipgen | c008f1c4bb3be7c67d4634c458aa7dfac48df0b5 | [
"MIT"
] | null | null | null | Materials.py | hanok2/shipgen | c008f1c4bb3be7c67d4634c458aa7dfac48df0b5 | [
"MIT"
] | 1 | 2022-03-15T00:11:10.000Z | 2022-03-15T00:11:10.000Z | import os.path
import ConfigFile
from Constants import *
BLOCK = 'block'
SLOPE = 'slope'
CORNER = 'corner'
EXTERIOR_DEFAULT = "Light Armor"
EXTERIOR_CONFIG = {
TYPE_SM: {
BLOCK: "1 2",
SLOPE: "1 2",
CORNER: "1 2",
},
TYPE_LG: {
BLOCK: "1 2",
SLOPE: "1 2",
CORNER: "1 2",
},
}
INTERIOR_DEFAULT = "Int... | 24.771084 | 107 | 0.664883 | import os.path
import ConfigFile
from Constants import *
BLOCK = 'block'
SLOPE = 'slope'
CORNER = 'corner'
EXTERIOR_DEFAULT = "Light Armor"
EXTERIOR_CONFIG = {
TYPE_SM: {
BLOCK: "1 2",
SLOPE: "1 2",
CORNER: "1 2",
},
TYPE_LG: {
BLOCK: "1 2",
SLOPE: "1 2",
CORNER: "1 2",
},
}
INTERIOR_DEFAULT = "Int... | 1,545 | -6 | 92 |
e7a3578c0980fbe822c28ac5ab0f35f4a6a6f1d2 | 4,703 | py | Python | src/cogs/unsplash.py | pure-cheekbones/hot-bot-pol-pot | 107082318659e402261bbccacaccc7a701c2d8ba | [
"MIT"
] | 3 | 2021-08-29T07:45:30.000Z | 2021-08-29T21:10:18.000Z | src/cogs/unsplash.py | pure-cheekbones/hot-bot-pol-pot | 107082318659e402261bbccacaccc7a701c2d8ba | [
"MIT"
] | null | null | null | src/cogs/unsplash.py | pure-cheekbones/hot-bot-pol-pot | 107082318659e402261bbccacaccc7a701c2d8ba | [
"MIT"
] | 2 | 2021-10-04T15:07:41.000Z | 2022-01-07T17:42:37.000Z | from os import environ
from typing import ContextManager, Optional, Union
from aiohttp import request
from discord.ext.commands.core import guild_only
from src.data_clusters.configuration.server_vars import server
from discord import Member, Reaction, Embed, channel, colour
from discord.ext.commands import Cog, bot, c... | 33.35461 | 124 | 0.575165 | from os import environ
from typing import ContextManager, Optional, Union
from aiohttp import request
from discord.ext.commands.core import guild_only
from src.data_clusters.configuration.server_vars import server
from discord import Member, Reaction, Embed, channel, colour
from discord.ext.commands import Cog, bot, c... | 3,813 | 326 | 168 |
8fef6ae80ef2401159b86038263f12464f4fb621 | 269 | py | Python | nexusdash2/nexusdash/__init__.py | fmichalo/n9k-programmability | 3a359df5f048ea8c7695e47e9014ffdfe03835f4 | [
"Apache-2.0"
] | 2 | 2015-02-03T20:35:11.000Z | 2021-06-01T04:08:41.000Z | nexusdash2/nexusdash/__init__.py | fmichalo/n9k-programmability | 3a359df5f048ea8c7695e47e9014ffdfe03835f4 | [
"Apache-2.0"
] | null | null | null | nexusdash2/nexusdash/__init__.py | fmichalo/n9k-programmability | 3a359df5f048ea8c7695e47e9014ffdfe03835f4 | [
"Apache-2.0"
] | null | null | null | # http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html
from __future__ import absolute_import
# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
from .celery import app as celery_app | 44.833333 | 78 | 0.791822 | # http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html
from __future__ import absolute_import
# This will make sure the app is always imported when
# Django starts so that shared_task will use this app.
from .celery import app as celery_app | 0 | 0 | 0 |
f0116cd97e8d55449ce07c760c277edda7cd215f | 3,031 | py | Python | chatty_goose/cqr/ntr.py | jacklin64/chatty-goose | acb49fad6acdfb433aabc03a8be36f29bfcfc761 | [
"Apache-2.0"
] | 24 | 2021-03-08T09:53:59.000Z | 2022-03-17T06:47:06.000Z | chatty_goose/cqr/ntr.py | jacklin64/chatty-goose | acb49fad6acdfb433aabc03a8be36f29bfcfc761 | [
"Apache-2.0"
] | 10 | 2021-03-08T13:35:54.000Z | 2021-11-15T03:32:37.000Z | chatty_goose/cqr/ntr.py | jacklin64/chatty-goose | acb49fad6acdfb433aabc03a8be36f29bfcfc761 | [
"Apache-2.0"
] | 8 | 2021-03-03T00:37:18.000Z | 2021-08-01T00:50:47.000Z | import logging
import time
import torch
from typing import Optional
from chatty_goose.settings import NtrSettings
from spacy.lang.en import English
from transformers import T5ForConditionalGeneration, T5Tokenizer
from .cqr import ConversationalQueryRewriter
__all__ = ["Ntr"]
class Ntr(ConversationalQueryRewriter):... | 33.677778 | 105 | 0.628835 | import logging
import time
import torch
from typing import Optional
from chatty_goose.settings import NtrSettings
from spacy.lang.en import English
from transformers import T5ForConditionalGeneration, T5Tokenizer
from .cqr import ConversationalQueryRewriter
__all__ = ["Ntr"]
class Ntr(ConversationalQueryRewriter):... | 2,564 | 0 | 81 |
72e17695fa6812a78b90659f0bbee5a5b14b0e64 | 9,962 | py | Python | Bot/tasks/im2txt.py | Frikallo/YAKbot | bc798fe4ead1f6a3e4828960ea77e2a8f07b5fdc | [
"MIT"
] | 1 | 2022-02-21T00:02:57.000Z | 2022-02-21T00:02:57.000Z | Bot/tasks/im2txt.py | Frikallo/YAKbot | bc798fe4ead1f6a3e4828960ea77e2a8f07b5fdc | [
"MIT"
] | 1 | 2022-01-12T19:41:39.000Z | 2022-01-14T03:56:56.000Z | Bot/tasks/im2txt.py | Frikallo/BATbot | bc798fe4ead1f6a3e4828960ea77e2a8f07b5fdc | [
"MIT"
] | null | null | null | import collections
import torch
import PIL
import pytorch_lightning as pl
import numpy as np
import torchvision.transforms.functional as F
import webdataset as wds
from pathlib import Path
from torchvision import transforms as T
from random import randint, choice
from torch.utils.data import DataLoader
from PIL import... | 33.317726 | 97 | 0.56043 | import collections
import torch
import PIL
import pytorch_lightning as pl
import numpy as np
import torchvision.transforms.functional as F
import webdataset as wds
from pathlib import Path
from torchvision import transforms as T
from random import randint, choice
from torch.utils.data import DataLoader
from PIL import... | 6,028 | 1,309 | 234 |
edea7506d46522a734417e4f7b59ebf848d9ed33 | 5,111 | py | Python | python/londiste.py | Neroe4eDev/Londiste | 933dfb255736ef68a04c2c322f9887033e2adfd0 | [
"0BSD",
"Unlicense"
] | null | null | null | python/londiste.py | Neroe4eDev/Londiste | 933dfb255736ef68a04c2c322f9887033e2adfd0 | [
"0BSD",
"Unlicense"
] | null | null | null | python/londiste.py | Neroe4eDev/Londiste | 933dfb255736ef68a04c2c322f9887033e2adfd0 | [
"0BSD",
"Unlicense"
] | null | null | null | #! /usr/bin/env python
"""Londiste launcher.
"""
import sys, os, optparse, signal, skytools
# python 2.3 will try londiste.py first...
import sys, os.path
if os.path.exists(os.path.join(sys.path[0], 'londiste.py')) \
and not os.path.isdir(os.path.join(sys.path[0], 'londiste')):
del sys.path[0]
from londiste... | 37.580882 | 82 | 0.599296 | #! /usr/bin/env python
"""Londiste launcher.
"""
import sys, os, optparse, signal, skytools
# python 2.3 will try londiste.py first...
import sys, os.path
if os.path.exists(os.path.join(sys.path[0], 'londiste.py')) \
and not os.path.isdir(os.path.join(sys.path[0], 'londiste')):
del sys.path[0]
from londiste... | 2,269 | 641 | 23 |
5e6773c308304439a03274941f1457d2c57822f4 | 12,241 | py | Python | InfotecsPython/script.py | JesusProfile/colloquium | 206b27c5ea553350ac7a7c5e1c3d9797add47be5 | [
"MIT"
] | null | null | null | InfotecsPython/script.py | JesusProfile/colloquium | 206b27c5ea553350ac7a7c5e1c3d9797add47be5 | [
"MIT"
] | null | null | null | InfotecsPython/script.py | JesusProfile/colloquium | 206b27c5ea553350ac7a7c5e1c3d9797add47be5 | [
"MIT"
] | null | null | null | # python3
import json
import socket
import sys
from email.parser import Parser
from functools import lru_cache
from urllib.parse import parse_qs, urlparse, urlencode, quote
import re # for regulars
MAX_LINE = 64 * 1024
MAX_HEADERS = 100
if __name__ == '__main__':
serv = Server()
try:
serv.serv... | 33.536986 | 97 | 0.535087 | # python3
import json
import socket
import sys
from email.parser import Parser
from functools import lru_cache
from urllib.parse import parse_qs, urlparse, urlencode, quote
import re # for regulars
MAX_LINE = 64 * 1024
MAX_HEADERS = 100
class Server:
def __init__(self):
self._host = '127.0.0.1'
... | 11,255 | 214 | 624 |
db7a2a590cbd3ccb3a4e00727109d45f722dcfc1 | 6,794 | py | Python | workloadsecurityconnector_aws.py | GeorgeDavis-TM/WorkloadSecurityConnector-AWS | 16294479307d563dea39c28d4805685dbc5d3abf | [
"MIT"
] | null | null | null | workloadsecurityconnector_aws.py | GeorgeDavis-TM/WorkloadSecurityConnector-AWS | 16294479307d563dea39c28d4805685dbc5d3abf | [
"MIT"
] | null | null | null | workloadsecurityconnector_aws.py | GeorgeDavis-TM/WorkloadSecurityConnector-AWS | 16294479307d563dea39c28d4805685dbc5d3abf | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import json
import urllib3
import boto3
from botocore.exceptions import ClientError
from boto3 import Session
f = open("config.json", "r+")
configObj = json.loads(f.read())
f.close()
headers = {
"Content-Type": "application/json",
"api-secret-key": configObj["c1wsApiKey"],
"api-vers... | 39.271676 | 352 | 0.61937 | #!/usr/bin/env python3
import json
import urllib3
import boto3
from botocore.exceptions import ClientError
from boto3 import Session
f = open("config.json", "r+")
configObj = json.loads(f.read())
f.close()
headers = {
"Content-Type": "application/json",
"api-secret-key": configObj["c1wsApiKey"],
"api-vers... | 6,214 | 0 | 207 |
e5d1d3f73d7dc19875fc6ba4e0d15a2d3d40974b | 805 | py | Python | utils/audio/pc_text_to_voice.py | westoun/moneypenny | a6b4904e369a14b71a6fddab0bf2d5180229291b | [
"MIT"
] | 1 | 2020-09-14T18:15:32.000Z | 2020-09-14T18:15:32.000Z | utils/audio/pc_text_to_voice.py | westoun/moneypenny | a6b4904e369a14b71a6fddab0bf2d5180229291b | [
"MIT"
] | null | null | null | utils/audio/pc_text_to_voice.py | westoun/moneypenny | a6b4904e369a14b71a6fddab0bf2d5180229291b | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Note: This file became necessary as a workaround
# since pyttsx3 is not thread-safe.
# See https://github.com/nateshmbhat/pyttsx3/issues/8
# for further details.
import pyttsx3
# id: 3 is french, 4 is german, 10 & 28 is english
import sys
text = str(sys.argv[1])
try:
language = str(s... | 19.166667 | 57 | 0.684472 | #!/usr/bin/env python3
# Note: This file became necessary as a workaround
# since pyttsx3 is not thread-safe.
# See https://github.com/nateshmbhat/pyttsx3/issues/8
# for further details.
import pyttsx3
# id: 3 is french, 4 is german, 10 & 28 is english
import sys
def init_engine(language_code):
engine = pyttsx3... | 234 | 0 | 46 |
bbfab1f3930c8cbd9b09e2c4f5e3ad08d28fbeb1 | 1,018 | py | Python | sso/user/migrations/0006_emailaddress.py | uktrade/staff-sso | c23da74415befdaed60649a9a940b1ba8331581e | [
"MIT"
] | 7 | 2018-07-30T16:18:52.000Z | 2022-03-21T12:58:20.000Z | sso/user/migrations/0006_emailaddress.py | uktrade/staff-sso | c23da74415befdaed60649a9a940b1ba8331581e | [
"MIT"
] | 55 | 2017-06-26T12:49:01.000Z | 2022-03-09T15:48:49.000Z | sso/user/migrations/0006_emailaddress.py | uktrade/staff-sso | c23da74415befdaed60649a9a940b1ba8331581e | [
"MIT"
] | 1 | 2020-05-28T07:17:26.000Z | 2020-05-28T07:17:26.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-11-22 17:13
from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
| 27.513514 | 95 | 0.465619 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.2 on 2017-11-22 17:13
from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("user", "0005_auto_20171106_1515"),
]
operations = ... | 0 | 806 | 23 |
3e63de3cca4cc234c42f209a7094758193f8b21c | 4,128 | py | Python | tweets/api/views.py | Hassanzadeh-sd/tweetme | a25db991694ed1c44c76fbb1880fdc4837ea320b | [
"MIT"
] | 12 | 2019-05-24T11:06:17.000Z | 2021-05-11T15:57:52.000Z | tweets/api/views.py | Hassanzadeh-sd/tweetme | a25db991694ed1c44c76fbb1880fdc4837ea320b | [
"MIT"
] | 10 | 2020-02-12T00:20:48.000Z | 2022-03-11T23:48:26.000Z | tweets/api/views.py | Hassanzadeh-sd/tweetme | a25db991694ed1c44c76fbb1880fdc4837ea320b | [
"MIT"
] | null | null | null | from rest_framework import generics
from .serializers import TweetModelSerializer
from ..models import Tweet
from django.db.models import Q
from rest_framework import permissions
from .pagination import TweetsSetPagination
from rest_framework.views import APIView
from rest_framework.response import Response | 38.579439 | 95 | 0.659641 | from rest_framework import generics
from .serializers import TweetModelSerializer
from ..models import Tweet
from django.db.models import Q
from rest_framework import permissions
from .pagination import TweetsSetPagination
from rest_framework.views import APIView
from rest_framework.response import Response
class Sear... | 2,623 | 1,055 | 142 |
8f29d2f8083c474fd5766686a4e02cdca211bd6f | 6,689 | py | Python | Automatic Transfer Scripts/LexicalChange.py | lvyiwei1/StylePTB | 42c80a07b999501d741f0c5e71481e627b758e3c | [
"CC-BY-4.0"
] | 36 | 2021-04-13T06:56:44.000Z | 2022-03-23T16:35:09.000Z | Automatic Transfer Scripts/LexicalChange.py | lvyiwei1/StylePTB | 42c80a07b999501d741f0c5e71481e627b758e3c | [
"CC-BY-4.0"
] | 3 | 2021-04-17T08:54:07.000Z | 2022-03-12T21:35:50.000Z | Automatic Transfer Scripts/LexicalChange.py | lvyiwei1/StylePTB | 42c80a07b999501d741f0c5e71481e627b758e3c | [
"CC-BY-4.0"
] | 3 | 2021-05-17T11:24:25.000Z | 2022-03-10T07:52:40.000Z | from nltk.corpus import treebank
from nltk.tree import Tree
from nltk.stem import WordNetLemmatizer
wnl = WordNetLemmatizer()
from nltk.corpus import wordnet as wn
import VerbMorph
import PTBdata
import pickle
#selects first synonym
import create2koriginal
import copy
if __name__ == "__main__":
f = open... | 33.782828 | 115 | 0.517417 | from nltk.corpus import treebank
from nltk.tree import Tree
from nltk.stem import WordNetLemmatizer
wnl = WordNetLemmatizer()
from nltk.corpus import wordnet as wn
import VerbMorph
import PTBdata
import pickle
#selects first synonym
def defaultselectfunc(l):
if len(l)>1:
return l[1]
return l[0]
def c... | 5,142 | 0 | 183 |
ba107ddc61295d645875a7f271eedaa4181c5057 | 1,164 | py | Python | MCapp/filewatcher.py | magnarch/dissertation | 68b56554dd5a14e97ff1c0338e2d0ae7309fde1c | [
"MIT"
] | null | null | null | MCapp/filewatcher.py | magnarch/dissertation | 68b56554dd5a14e97ff1c0338e2d0ae7309fde1c | [
"MIT"
] | 2 | 2020-02-12T00:20:40.000Z | 2020-06-05T20:57:42.000Z | MCapp/filewatcher.py | magnarch/minicooper | 68b56554dd5a14e97ff1c0338e2d0ae7309fde1c | [
"MIT"
] | null | null | null | import sys
import os
import json
import time
import post_to_server
import argparse
if __name__ == "__main__":
main(sys.argv[1:])
| 35.272727 | 177 | 0.668385 | import sys
import os
import json
import time
import post_to_server
import argparse
def main(argv):
parser = argparse.ArgumentParser()
parser.add_argument('--folder', default='./')
parser.add_argument('--IP', default='127.0.0.1:8000')
args = parser.parse_args(argv)
args_dict = vars(args)
WATCHED... | 1,007 | 0 | 23 |
347f4d56881a85774c72116ebe61ca227fd39bd8 | 1,848 | py | Python | Trigger_azure/fonctions/fonctions.py | Nico34000/cloud_library_nicolas | 7b762a705baeb19208e1448f11df88f03e4d265e | [
"MIT"
] | null | null | null | Trigger_azure/fonctions/fonctions.py | Nico34000/cloud_library_nicolas | 7b762a705baeb19208e1448f11df88f03e4d265e | [
"MIT"
] | null | null | null | Trigger_azure/fonctions/fonctions.py | Nico34000/cloud_library_nicolas | 7b762a705baeb19208e1448f11df88f03e4d265e | [
"MIT"
] | null | null | null | import os
import mysql.connector
import json
from jinja2 import Template
config_sql = {
'host':os.environ['HOST_SQL_AZURE'],
'user':os.environ['USER_SQL_AZURE'],
'password':os.environ['PASSWORD_SQL_AZURE'],
'database':os.environ['DATABASE_SQL_AZURE'],
'client_flags': [mysql.connector.ClientFlag.SSL],
'ssl... | 22 | 57 | 0.637987 | import os
import mysql.connector
import json
from jinja2 import Template
config_sql = {
'host':os.environ['HOST_SQL_AZURE'],
'user':os.environ['USER_SQL_AZURE'],
'password':os.environ['PASSWORD_SQL_AZURE'],
'database':os.environ['DATABASE_SQL_AZURE'],
'client_flags': [mysql.connector.ClientFlag.SSL],
'ssl... | 1,229 | 0 | 161 |
b09e2ec0375a04f7082446388ed3ad8f60874111 | 1,134 | py | Python | detect_fraud_email_enron/tools/utils.py | gotamist/other_machine_learning | 70c7f5367ed5cf9b6fd4818cda16add24a2b468d | [
"MIT"
] | null | null | null | detect_fraud_email_enron/tools/utils.py | gotamist/other_machine_learning | 70c7f5367ed5cf9b6fd4818cda16add24a2b468d | [
"MIT"
] | null | null | null | detect_fraud_email_enron/tools/utils.py | gotamist/other_machine_learning | 70c7f5367ed5cf9b6fd4818cda16add24a2b468d | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 25 08:55:11 2018
@author: gotamist
"""
def clean_and_move_up_poi(df):
''' Make 'poi' the first feature, remove lines having just nans
'''
import pandas as pd
import numpy as np
f_list = list(df)
x_list = f_list #I need the ... | 28.35 | 105 | 0.584656 | #!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Created on Tue Sep 25 08:55:11 2018
@author: gotamist
"""
def clean_and_move_up_poi(df):
''' Make 'poi' the first feature, remove lines having just nans
'''
import pandas as pd
import numpy as np
f_list = list(df)
x_list = f_list #I need the ... | 338 | 0 | 23 |
3001afde61940e88f304032ce4e921465dc94f47 | 1,004 | py | Python | tests/test_activities.py | Agilicus/copper-sdk | dfdecd4aa76bdd47661fdd4bfada7781f8eae835 | [
"MIT"
] | 4 | 2021-01-03T07:40:01.000Z | 2021-09-03T09:21:02.000Z | tests/test_activities.py | Agilicus/copper-sdk | dfdecd4aa76bdd47661fdd4bfada7781f8eae835 | [
"MIT"
] | 5 | 2020-09-03T17:28:13.000Z | 2021-10-04T22:47:23.000Z | tests/test_activities.py | Agilicus/copper-sdk | dfdecd4aa76bdd47661fdd4bfada7781f8eae835 | [
"MIT"
] | 4 | 2021-01-07T05:30:49.000Z | 2021-09-13T08:08:54.000Z | import vcr
from copper_sdk.activities import Activities
@vcr.use_cassette('tests/vcr_cassettes/activities-list.yml', filter_headers=['X-PW-AccessToken', 'X-PW-UserEmail'])
def test_activities_list(copper):
'''Test list activities'''
response = copper.activities().list({
'page_size': 10,
})
ass... | 30.424242 | 117 | 0.663347 | import vcr
from copper_sdk.activities import Activities
@vcr.use_cassette('tests/vcr_cassettes/activities-list.yml', filter_headers=['X-PW-AccessToken', 'X-PW-UserEmail'])
def test_activities_list(copper):
'''Test list activities'''
response = copper.activities().list({
'page_size': 10,
})
ass... | 0 | 0 | 0 |
de4f8531f4d2faed22bd859f32d4905d82fa2e15 | 8,734 | py | Python | bidaf/data_loader.py | qianyingw/bioqa | 0511597e3b1cd6eaafe893677ed601c7303befef | [
"MIT"
] | null | null | null | bidaf/data_loader.py | qianyingw/bioqa | 0511597e3b1cd6eaafe893677ed601c7303befef | [
"MIT"
] | null | null | null | bidaf/data_loader.py | qianyingw/bioqa | 0511597e3b1cd6eaafe893677ed601c7303befef | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 3 18:47:55 2020
@author: qwang
"""
import os
import json
import torch
from torchtext import data
import torchtext.vocab as vocab
#%% Process for qanet only
#%%
# %% Instance
# args = {
# 'batch_size': 32,
# ... | 38.817778 | 142 | 0.549347 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Aug 3 18:47:55 2020
@author: qwang
"""
import os
import json
import torch
from torchtext import data
import torchtext.vocab as vocab
#%% Process for qanet only
def pad_tokens(tokens, max_len):
if len(tokens) <= max_len:
tokens = tokens ... | 5,888 | 11 | 284 |
efb76aa94d086ff0f04ad3596a8456c94adf0807 | 158 | py | Python | myapp/main.py | roedebaron/python-for-android | e57aff57aa538160178517716959f817e16b7da1 | [
"MIT"
] | null | null | null | myapp/main.py | roedebaron/python-for-android | e57aff57aa538160178517716959f817e16b7da1 | [
"MIT"
] | null | null | null | myapp/main.py | roedebaron/python-for-android | e57aff57aa538160178517716959f817e16b7da1 | [
"MIT"
] | null | null | null | from kivy.app import App
from kivy.uix.button import Button
MainApp().run() | 19.75 | 37 | 0.708861 | from kivy.app import App
from kivy.uix.button import Button
class MainApp(App):
def build(self):
return Button(text="Hello World")
MainApp().run() | 33 | -2 | 47 |
7558f040dfe8e456d2fde328a7b5069c490f2fd0 | 1,622 | py | Python | preprocessing/datetime.py | uberkinder/Robusta-AutoML | 9faee4c17ad9f37b09760f9fffea715cdbf2d1fb | [
"MIT"
] | 2 | 2019-04-26T19:40:31.000Z | 2019-10-12T15:18:29.000Z | preprocessing/datetime.py | uberkinder/Robusta-AutoML | 9faee4c17ad9f37b09760f9fffea715cdbf2d1fb | [
"MIT"
] | null | null | null | preprocessing/datetime.py | uberkinder/Robusta-AutoML | 9faee4c17ad9f37b09760f9fffea715cdbf2d1fb | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from sklearn.base import BaseEstimator, TransformerMixin
__all__ = [
'DatetimeConverter1D',
'DatetimeConverter',
'CyclicEncoder',
]
class CyclicEncoder(BaseEstimator, TransformerMixin):
"""Cyclic Encoder
Convert x to the [cos(2*pi*t), sin(2*pi*t)] pair... | 22.527778 | 72 | 0.586313 | import pandas as pd
import numpy as np
from sklearn.base import BaseEstimator, TransformerMixin
__all__ = [
'DatetimeConverter1D',
'DatetimeConverter',
'CyclicEncoder',
]
class DatetimeConverter1D(BaseEstimator, TransformerMixin):
def __init__(self, **params):
self.params = params
def... | 751 | 74 | 286 |
9a273354a19a34cfa2a33481c207eb60e028b4f5 | 3,999 | py | Python | source/world.py | kchevali/Localization | f9abf470bef37016518406c8b65a8f5edf7c62e8 | [
"MIT"
] | null | null | null | source/world.py | kchevali/Localization | f9abf470bef37016518406c8b65a8f5edf7c62e8 | [
"MIT"
] | null | null | null | source/world.py | kchevali/Localization | f9abf470bef37016518406c8b65a8f5edf7c62e8 | [
"MIT"
] | null | null | null | from node import Node
from random import randint
from math import sqrt, pi, e
import pygame as pg
if __name__ == '__main__':
pass
| 31.242188 | 121 | 0.493373 | from node import Node
from random import randint
from math import sqrt, pi, e
import pygame as pg
class World:
def __init__(self, width, height, blockSize, transmitRange, agentCount, anchorCount, errDist):
pg.init()
pg.display.set_caption("Localization Sim")
self.width = width
self... | 3,606 | -9 | 265 |
924bde2d147f9329b460942e869afbae2d63f4f7 | 7,748 | py | Python | google_compute_engine/metadata_scripts/script_retriever.py | jrw972/compute-image-packages | f5b2ae581c4bb2d02d4d86918a27baa81dd30861 | [
"Apache-2.0"
] | null | null | null | google_compute_engine/metadata_scripts/script_retriever.py | jrw972/compute-image-packages | f5b2ae581c4bb2d02d4d86918a27baa81dd30861 | [
"Apache-2.0"
] | 2 | 2018-06-10T18:10:31.000Z | 2018-06-29T13:10:15.000Z | google_compute_engine/metadata_scripts/script_retriever.py | jrw972/compute-image-packages | f5b2ae581c4bb2d02d4d86918a27baa81dd30861 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# Copyright 2016 Google 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 appli... | 36.037209 | 80 | 0.688694 | #!/usr/bin/python
# Copyright 2016 Google 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 appli... | 0 | 0 | 0 |
fdb0de39b17ce6faa979c47e5b91b69793112187 | 1,915 | py | Python | src/preprocess/buildData_notuse.py | zhouqilin1993/CodeSumy | ea824e6a45f42b73aba85187eb056e75e0b16a36 | [
"MIT"
] | 1 | 2018-08-30T11:37:35.000Z | 2018-08-30T11:37:35.000Z | src/preprocess/buildData_notuse.py | zhouqilin1993/CodeSumy | ea824e6a45f42b73aba85187eb056e75e0b16a36 | [
"MIT"
] | null | null | null | src/preprocess/buildData_notuse.py | zhouqilin1993/CodeSumy | ea824e6a45f42b73aba85187eb056e75e0b16a36 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import sys
sys.path.append("..")
from src.seq2seq import setting
import re
import collections
import json
# 将下载得到的数据进行预处理,处理结果放置到到workdir目录中
# 获取GitHub和StackOverflow的数据,并将处理后的数据放到workdir目录下
if __name__ == '__main__':
buildVocab("so","java")
buildVocab("so","csharp")
| 29.921875 | 77 | 0.591645 | # -*- coding: utf-8 -*-
import sys
sys.path.append("..")
from src.seq2seq import setting
import re
import collections
import json
# 将下载得到的数据进行预处理,处理结果放置到到workdir目录中
def tokenizeNL(nl):
nl = nl.strip().decode('utf-8').encode('ascii', 'replace')
return re.findall(r"[\w]+|[^\s\w]", nl)
def tokenizeCode(code, la... | 1,600 | 0 | 69 |
f8bc9b48dadf247d6218a64c8d04306d447dd74d | 2,039 | py | Python | src/config/api-server/vnc_cfg_api_server/resources/port_profile.py | atsgen/tf-controller | 9321889cdd3d7108980cc88937b2e82956502cc5 | [
"Apache-2.0"
] | 37 | 2020-09-21T10:42:26.000Z | 2022-01-09T10:16:40.000Z | src/config/api-server/vnc_cfg_api_server/resources/port_profile.py | atsgen/tf-controller | 9321889cdd3d7108980cc88937b2e82956502cc5 | [
"Apache-2.0"
] | null | null | null | src/config/api-server/vnc_cfg_api_server/resources/port_profile.py | atsgen/tf-controller | 9321889cdd3d7108980cc88937b2e82956502cc5 | [
"Apache-2.0"
] | 21 | 2020-08-25T12:48:42.000Z | 2022-03-22T04:32:18.000Z | #
# Copyright (c) 2018 Juniper Networks, Inc. All rights reserved.
#
from vnc_api.gen.resource_common import PortProfile
from vnc_cfg_api_server.resources._resource_base import ResourceMixin
| 32.365079 | 71 | 0.62874 | #
# Copyright (c) 2018 Juniper Networks, Inc. All rights reserved.
#
from vnc_api.gen.resource_common import PortProfile
from vnc_cfg_api_server.resources._resource_base import ResourceMixin
class PortProfileServer(ResourceMixin, PortProfile):
@staticmethod
def validate_storm_control_back_refs(obj_dict):
... | 1,482 | 340 | 23 |
093a0c672f3627f1f5e237a45fb6d67c6e9a5291 | 5,061 | py | Python | sdk/python/pulumi_aws_native/amplifyuibuilder/get_theme.py | pulumi/pulumi-aws-native | 1ae4a4d9c2256b2a79ca536f8d8497b28d10e4c3 | [
"Apache-2.0"
] | 29 | 2021-09-30T19:32:07.000Z | 2022-03-22T21:06:08.000Z | sdk/python/pulumi_aws_native/amplifyuibuilder/get_theme.py | pulumi/pulumi-aws-native | 1ae4a4d9c2256b2a79ca536f8d8497b28d10e4c3 | [
"Apache-2.0"
] | 232 | 2021-09-30T19:26:26.000Z | 2022-03-31T23:22:06.000Z | sdk/python/pulumi_aws_native/amplifyuibuilder/get_theme.py | pulumi/pulumi-aws-native | 1ae4a4d9c2256b2a79ca536f8d8497b28d10e4c3 | [
"Apache-2.0"
] | 4 | 2021-11-10T19:42:01.000Z | 2022-02-05T10:15:49.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from... | 35.893617 | 147 | 0.652638 | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from... | 2,437 | 606 | 71 |
e7573205ad57285fdc719344e937849e5fb2b370 | 7,325 | py | Python | batch_nas_algorithms.py | ntienvu/TW_NAS | 72a6d3c933978663c583661eee765bc316f66572 | [
"Apache-2.0"
] | 4 | 2021-11-01T14:01:39.000Z | 2022-02-28T03:04:27.000Z | batch_nas_algorithms.py | ntienvu/TW_NAS | 72a6d3c933978663c583661eee765bc316f66572 | [
"Apache-2.0"
] | null | null | null | batch_nas_algorithms.py | ntienvu/TW_NAS | 72a6d3c933978663c583661eee765bc316f66572 | [
"Apache-2.0"
] | 2 | 2021-06-08T09:13:03.000Z | 2021-11-01T14:01:45.000Z | import sys
sys.path.insert(0,'..')
import pickle
import sys
import copy
import numpy as np
from argparse import Namespace
from data import Data
#from acquisition_functions import acq_fn
#from bo.bo.probo import ProBO
#from bo.dom.list import ListDomain
from bo.pp.pp_gp_my_distmat import MyGpDistmatPP
#from argparse i... | 29.776423 | 91 | 0.629625 | import sys
sys.path.insert(0,'..')
import pickle
import sys
import copy
import numpy as np
from argparse import Namespace
from data import Data
#from acquisition_functions import acq_fn
#from bo.bo.probo import ProBO
#from bo.dom.list import ListDomain
from bo.pp.pp_gp_my_distmat import MyGpDistmatPP
#from argparse i... | 1,757 | 0 | 95 |
dca940391dee39844187a43021eaf8685becdc7f | 716 | py | Python | tests/test_cockpit/settings.py | wx-b/cockpit | af91391ddab2a8aef85905b081ccf67d94c1a0e5 | [
"MIT"
] | 367 | 2021-02-12T17:22:55.000Z | 2022-03-29T20:47:35.000Z | tests/test_cockpit/settings.py | wx-b/cockpit | af91391ddab2a8aef85905b081ccf67d94c1a0e5 | [
"MIT"
] | 11 | 2021-04-30T07:58:51.000Z | 2022-02-22T15:54:42.000Z | tests/test_cockpit/settings.py | wx-b/cockpit | af91391ddab2a8aef85905b081ccf67d94c1a0e5 | [
"MIT"
] | 19 | 2021-07-14T12:16:13.000Z | 2022-02-17T16:48:00.000Z | """Settings used by the tests in this submodule."""
import torch
from tests.settings import SETTINGS as GLOBAL_SETTINGS
from tests.utils.data import load_toy_data
from tests.utils.models import load_toy_model
from tests.utils.problem import make_problems_with_ids
LOCAL_SETTINGS = [
{
"data_fn": lambda: l... | 29.833333 | 80 | 0.726257 | """Settings used by the tests in this submodule."""
import torch
from tests.settings import SETTINGS as GLOBAL_SETTINGS
from tests.utils.data import load_toy_data
from tests.utils.models import load_toy_model
from tests.utils.problem import make_problems_with_ids
LOCAL_SETTINGS = [
{
"data_fn": lambda: l... | 0 | 0 | 0 |
a5706e7d656e4ed8fd9824d5e9e5fd69a7fda25b | 238 | py | Python | cryptofeed_werks/exchanges/binance/constants.py | globophobe/crypto-tick-data | 7ec5d1e136b9bc27ae936f55cf6ab7fe5e37bda4 | [
"MIT"
] | 7 | 2021-12-30T02:38:17.000Z | 2022-03-08T16:14:35.000Z | cryptofeed_werks/exchanges/binance/constants.py | globophobe/crypto-tick-data | 7ec5d1e136b9bc27ae936f55cf6ab7fe5e37bda4 | [
"MIT"
] | null | null | null | cryptofeed_werks/exchanges/binance/constants.py | globophobe/crypto-tick-data | 7ec5d1e136b9bc27ae936f55cf6ab7fe5e37bda4 | [
"MIT"
] | 1 | 2022-01-28T00:18:45.000Z | 2022-01-28T00:18:45.000Z | BINANCE_API_KEY = "BINANCE_API_KEY"
BINANCE_MAX_WEIGHT = "BINANCE_MAX_WEIGHT"
API_URL = "https://api.binance.com/api/v3"
MAX_RESULTS = 1000
# Response 429, when x-mbx-used-weight-1m is 1200
MAX_WEIGHT = 1200
MIN_ELAPSED_PER_REQUEST = 0
| 23.8 | 49 | 0.781513 | BINANCE_API_KEY = "BINANCE_API_KEY"
BINANCE_MAX_WEIGHT = "BINANCE_MAX_WEIGHT"
API_URL = "https://api.binance.com/api/v3"
MAX_RESULTS = 1000
# Response 429, when x-mbx-used-weight-1m is 1200
MAX_WEIGHT = 1200
MIN_ELAPSED_PER_REQUEST = 0
| 0 | 0 | 0 |
f237bfbc0208b499c03817fb7c941603954defec | 1,558 | py | Python | PrepareAudio.py | CarpCodeTech/kaldi-docker | e141a930e16965b93aa60793209a6fa4a012a02b | [
"MIT"
] | null | null | null | PrepareAudio.py | CarpCodeTech/kaldi-docker | e141a930e16965b93aa60793209a6fa4a012a02b | [
"MIT"
] | null | null | null | PrepareAudio.py | CarpCodeTech/kaldi-docker | e141a930e16965b93aa60793209a6fa4a012a02b | [
"MIT"
] | null | null | null | ##This code is to prepare audio for pure kaldi prototype, it assumes audios are in wav format
""" Command-line usage:
python PrepareAudio.py Audio_folder wav_rspecifier spk2utt_rspecifier
"""
import os
import re
import shutil
from sys import exit
import sys
import getopt
import subprocess
if __name__ == '__main__... | 34.622222 | 112 | 0.584724 | ##This code is to prepare audio for pure kaldi prototype, it assumes audios are in wav format
""" Command-line usage:
python PrepareAudio.py Audio_folder wav_rspecifier spk2utt_rspecifier
"""
import os
import re
import shutil
from sys import exit
import sys
import getopt
import subprocess
if __name__ == '__main__... | 0 | 0 | 0 |
f3caa8be6c03e7eb061e1afef642f57f865b0d09 | 8,391 | py | Python | release.py | sosey/testbot | 578a3b74e921fd32711f9d50ef32d35e01ae63e0 | [
"BSD-3-Clause"
] | null | null | null | release.py | sosey/testbot | 578a3b74e921fd32711f9d50ef32d35e01ae63e0 | [
"BSD-3-Clause"
] | null | null | null | release.py | sosey/testbot | 578a3b74e921fd32711f9d50ef32d35e01ae63e0 | [
"BSD-3-Clause"
] | null | null | null | """
Get the release information from a specific repository
curl 'https://api.github.com/repos/sosey/testbot/releases'
testbot.rel is example response for the sosey/testbot repo
# used to render the markdown to HTML which can be walked
# or used in the html page as-is
pip install mistune
# Use bs4 to walk the html tre... | 32.523256 | 209 | 0.622929 | """
Get the release information from a specific repository
curl 'https://api.github.com/repos/sosey/testbot/releases'
testbot.rel is example response for the sosey/testbot repo
# used to render the markdown to HTML which can be walked
# or used in the html page as-is
pip install mistune
# Use bs4 to walk the html tre... | 0 | 0 | 0 |
35616cd00cf44f937d04f42847145b2a72318ea0 | 2,553 | py | Python | src/oop_ext/_type_checker_fixture.py | nicoddemus/oop-ext | 279c80eae56783c02d99ba7b94a8d2df7eb1aec3 | [
"MIT"
] | 12 | 2019-03-08T12:56:42.000Z | 2021-12-01T18:15:01.000Z | src/oop_ext/_type_checker_fixture.py | nicoddemus/oop-ext | 279c80eae56783c02d99ba7b94a8d2df7eb1aec3 | [
"MIT"
] | 30 | 2019-03-08T19:33:00.000Z | 2022-01-25T20:32:41.000Z | src/oop_ext/_type_checker_fixture.py | nicoddemus/oop-ext | 279c80eae56783c02d99ba7b94a8d2df7eb1aec3 | [
"MIT"
] | 1 | 2019-08-08T16:55:41.000Z | 2019-08-08T16:55:41.000Z | # mypy: disallow-untyped-defs
# mypy: disallow-any-decorated
import os
import re
from textwrap import dedent
import mypy.api
from pathlib import Path
from typing import List, Tuple
import attr
import pytest
@attr.s(auto_attribs=True)
class _Result:
"""
Encapsulates the result of a call to ``mypy.api``, prov... | 28.054945 | 91 | 0.599295 | # mypy: disallow-untyped-defs
# mypy: disallow-any-decorated
import os
import re
from textwrap import dedent
import mypy.api
from pathlib import Path
from typing import List, Tuple
import attr
import pytest
@attr.s(auto_attribs=True)
class _Result:
"""
Encapsulates the result of a call to ``mypy.api``, prov... | 1,517 | 0 | 212 |
7bc19e6d0bd67432e13cc1400c9b8954ed0cc3b6 | 6,202 | py | Python | clubsandwich/ui/layout_options.py | eldarbogdanov/clubsandwich | dc1fb1f96eb8544547c4c25efef16a50bd1a79c5 | [
"MIT"
] | 66 | 2017-04-17T01:08:46.000Z | 2022-02-14T21:40:39.000Z | clubsandwich/ui/layout_options.py | eldarbogdanov/clubsandwich | dc1fb1f96eb8544547c4c25efef16a50bd1a79c5 | [
"MIT"
] | 19 | 2017-04-17T23:57:22.000Z | 2021-02-16T18:32:08.000Z | clubsandwich/ui/layout_options.py | eldarbogdanov/clubsandwich | dc1fb1f96eb8544547c4c25efef16a50bd1a79c5 | [
"MIT"
] | 17 | 2017-05-19T21:49:57.000Z | 2022-02-16T12:53:28.000Z | from collections import namedtuple
from numbers import Real
_LayoutOptions = namedtuple(
'_LayoutOptions',
['width', 'height', 'top', 'right', 'bottom', 'left'])
class LayoutOptions(_LayoutOptions):
"""
:param LayoutOptionValue width: width spec
:param LayoutOptionValue height: height spec
:... | 33.524324 | 80 | 0.582876 | from collections import namedtuple
from numbers import Real
_LayoutOptions = namedtuple(
'_LayoutOptions',
['width', 'height', 'top', 'right', 'bottom', 'left'])
class LayoutOptions(_LayoutOptions):
"""
:param LayoutOptionValue width: width spec
:param LayoutOptionValue height: height spec
:... | 2,360 | 0 | 135 |
693ddc5ec535bf5dcd05a8d5aee9489b99a4cfe3 | 2,635 | py | Python | pseudo/tree_transformer.py | mifieldxu/pseudo-lang | 889477c094236dc36526984be6f6537a4875e5a9 | [
"MIT"
] | 661 | 2016-03-12T07:32:36.000Z | 2018-11-12T14:31:30.000Z | pseudo/tree_transformer.py | mifieldxu/pseudo-lang | 889477c094236dc36526984be6f6537a4875e5a9 | [
"MIT"
] | 21 | 2016-03-07T03:49:17.000Z | 2018-11-05T08:30:42.000Z | pseudo/tree_transformer.py | mifieldxu/pseudo-lang | 889477c094236dc36526984be6f6537a4875e5a9 | [
"MIT"
] | 45 | 2016-03-07T03:48:09.000Z | 2018-04-16T20:55:47.000Z | from pseudo.pseudo_tree import Node
class TreeTransformer:
'''
visits recursively nodes of the tree
with defined transform_<node_type> methods and transforms in place
'''
before = None
after = None
whitelist = None # if a set, transform only those nodes, optimization
current_class = ... | 38.188406 | 122 | 0.57685 | from pseudo.pseudo_tree import Node
class TreeTransformer:
'''
visits recursively nodes of the tree
with defined transform_<node_type> methods and transforms in place
'''
before = None
after = None
whitelist = None # if a set, transform only those nodes, optimization
current_class = ... | 2,110 | 0 | 81 |
473c69aacc4d0d3808b8a3ae3f94e32fd4039856 | 861 | py | Python | LeetCode/Problems/39_combination_sum.py | hooyao/LeetCode-Py3 | f462b66ae849f4332a4b150f206dd49c7519e83b | [
"MIT"
] | null | null | null | LeetCode/Problems/39_combination_sum.py | hooyao/LeetCode-Py3 | f462b66ae849f4332a4b150f206dd49c7519e83b | [
"MIT"
] | null | null | null | LeetCode/Problems/39_combination_sum.py | hooyao/LeetCode-Py3 | f462b66ae849f4332a4b150f206dd49c7519e83b | [
"MIT"
] | null | null | null | import sys
if __name__ == '__main__':
main(*sys.argv[1:])
| 24.6 | 58 | 0.529617 | import sys
class Solution:
def combinationSum(self, candidates, target):
"""
:type candidates: List[int]
:type target: int
:rtype: List[List[int]]
"""
return self.dfs(candidates, target)
def dfs(self, candidates, target):
result = []
for i in ra... | 516 | 233 | 46 |
21eb0142345755c518434887ad53e3986ae41455 | 4,923 | py | Python | exatrkx/src/tfgraphs/utils.py | sbconlon/exatrkx-iml2020 | 5101a3bae5a15e8e0557837a8d0b9fd9e122a026 | [
"Apache-2.0"
] | 6 | 2020-10-27T21:42:27.000Z | 2021-04-18T02:06:30.000Z | exatrkx/src/tfgraphs/utils.py | sbconlon/exatrkx-iml2020 | 5101a3bae5a15e8e0557837a8d0b9fd9e122a026 | [
"Apache-2.0"
] | null | null | null | exatrkx/src/tfgraphs/utils.py | sbconlon/exatrkx-iml2020 | 5101a3bae5a15e8e0557837a8d0b9fd9e122a026 | [
"Apache-2.0"
] | 6 | 2020-11-04T23:45:10.000Z | 2021-03-26T09:06:00.000Z | import matplotlib.pyplot as plt
import sklearn.metrics
import networkx as nx
import numpy as np
import pandas as pd
fontsize=16
minor_size=14 | 36.466667 | 110 | 0.617713 | import matplotlib.pyplot as plt
import sklearn.metrics
import networkx as nx
import numpy as np
import pandas as pd
fontsize=16
minor_size=14
def get_pos(Gp):
pos = {}
for node in Gp.nodes():
r, phi, z = Gp.nodes[node]['pos'][:3]
x = r * np.cos(phi)
y = r * np.sin(phi)
pos[nod... | 4,688 | 0 | 92 |
d9fd69c9fecbe6a7d97ea88a7268e134dac6ae42 | 2,469 | py | Python | scobra/analysis/Pareto.py | nihalzp/scobra | de1faa73fb4d186d9567bfa8e174b3fd6f1833ef | [
"MIT"
] | 7 | 2016-03-16T09:03:41.000Z | 2019-09-20T05:55:02.000Z | scobra/analysis/Pareto.py | nihalzp/scobra | de1faa73fb4d186d9567bfa8e174b3fd6f1833ef | [
"MIT"
] | 11 | 2019-10-03T15:04:58.000Z | 2020-05-11T17:27:10.000Z | scobra/analysis/Pareto.py | nihalzp/scobra | de1faa73fb4d186d9567bfa8e174b3fd6f1833ef | [
"MIT"
] | 6 | 2016-03-16T09:04:54.000Z | 2021-07-24T15:03:41.000Z | from ..classes.pareto import pareto
import random
def Pareto(model, objectives, objdirec, runs, GetPoints=True, tol=1e-10):
""" pre: objectives = [["reac"],{"reac2":x}]
post: turning points of Pareto front """
state = model.GetState()
rv = pareto()
model.SetObjDirec(objdirec)
anchor = []
... | 38.578125 | 73 | 0.498987 | from ..classes.pareto import pareto
import random
def Pareto(model, objectives, objdirec, runs, GetPoints=True, tol=1e-10):
""" pre: objectives = [["reac"],{"reac2":x}]
post: turning points of Pareto front """
state = model.GetState()
rv = pareto()
model.SetObjDirec(objdirec)
anchor = []
... | 0 | 0 | 0 |
ba51e543b2f51c2d862edf4058083c74dbe60178 | 1,477 | py | Python | src/print_and_read.py | Shumpei-Kikuta/RolX | d17609180f0d1da40b1ae93de4ee0e8c0366b364 | [
"MIT"
] | null | null | null | src/print_and_read.py | Shumpei-Kikuta/RolX | d17609180f0d1da40b1ae93de4ee0e8c0366b364 | [
"MIT"
] | null | null | null | src/print_and_read.py | Shumpei-Kikuta/RolX | d17609180f0d1da40b1ae93de4ee0e8c0366b364 | [
"MIT"
] | null | null | null | import json
import numpy as np
import pandas as pd
import networkx as nx
from texttable import Texttable
def data_reader(input_path):
"""
Function to read a csv edge list and transform it to a networkx graph object.
"""
data = np.array(pd.read_csv(input_path))
return data
def log_setup(args_in... | 25.912281 | 105 | 0.608666 | import json
import numpy as np
import pandas as pd
import networkx as nx
from texttable import Texttable
def data_reader(input_path):
"""
Function to read a csv edge list and transform it to a networkx graph object.
"""
data = np.array(pd.read_csv(input_path))
return data
def log_setup(args_in... | 158 | 0 | 23 |
4c50d5f807206aed7e471417c6ca93b284a799e4 | 6,774 | py | Python | addons/website_sale_coupon/tests/test_sale_coupon_multiwebsite.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | addons/website_sale_coupon/tests/test_sale_coupon_multiwebsite.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | addons/website_sale_coupon/tests/test_sale_coupon_multiwebsite.py | SHIVJITH/Odoo_Machine_Test | 310497a9872db7844b521e6dab5f7a9f61d365a4 | [
"Apache-2.0"
] | null | null | null | # Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.sale_coupon.tests.test_program_numbers import TestSaleCouponProgramNumbers
from odoo.addons.website.tools import MockRequest
from odoo.exceptions import UserError
from odoo.tests import tagged
@tagged('-at_install', 'post_ins... | 45.16 | 149 | 0.618837 | # Part of Odoo. See LICENSE file for full copyright and licensing details.
from odoo.addons.sale_coupon.tests.test_program_numbers import TestSaleCouponProgramNumbers
from odoo.addons.website.tools import MockRequest
from odoo.exceptions import UserError
from odoo.tests import tagged
@tagged('-at_install', 'post_ins... | 648 | 5,777 | 22 |
14cc919df0578ea35a942e7d8f60ec3bd6e5bf7d | 5,600 | py | Python | WisRecCloud/apps/recall/task.py | DooBeDooBa/WisRecCloud | 1801fc05c8aaabc5e668ce30eb83e26c65855ef1 | [
"CC0-1.0"
] | 1 | 2019-12-13T08:48:35.000Z | 2019-12-13T08:48:35.000Z | WisRecCloud/apps/recall/task.py | DooBeDooBa/WisRecCloud | 1801fc05c8aaabc5e668ce30eb83e26c65855ef1 | [
"CC0-1.0"
] | 20 | 2020-01-28T23:12:37.000Z | 2022-03-12T00:08:52.000Z | WisRecCloud/apps/recall/task.py | DooBeDooBa/WisRecCloud | 1801fc05c8aaabc5e668ce30eb83e26c65855ef1 | [
"CC0-1.0"
] | null | null | null | import json
import redis
from celery import Celery
import pandas as pd
import math
import pymysql
app = Celery(
'get_key_words',
backend='redis://localhost:6379/8'
)
@app.task
def get_key(user_api_key, api_key):
"""
:param user_api_key:
:param api_key:
:return:
"""
conn = pymysql.conn... | 32.748538 | 118 | 0.575179 | import json
import redis
from celery import Celery
import pandas as pd
import math
import pymysql
app = Celery(
'get_key_words',
backend='redis://localhost:6379/8'
)
@app.task
def get_key(user_api_key, api_key):
"""
:param user_api_key:
:param api_key:
:return:
"""
conn = pymysql.conn... | 1,344 | 0 | 22 |
1eba706beb117ef3b2905afc1fd42a03afc20fc4 | 4,102 | py | Python | sandbox/larva_brain.py | neurodata/bgm | b04162f84820f81cf719e8a5ddd4dae34d8f5f41 | [
"MIT"
] | 1 | 2022-03-29T14:53:11.000Z | 2022-03-29T14:53:11.000Z | sandbox/larva_brain.py | neurodata/bgm | b04162f84820f81cf719e8a5ddd4dae34d8f5f41 | [
"MIT"
] | null | null | null | sandbox/larva_brain.py | neurodata/bgm | b04162f84820f81cf719e8a5ddd4dae34d8f5f41 | [
"MIT"
] | null | null | null | #%% [markdown]
# # Matching when including the contralateral connections
#%% [markdown]
# ## Preliminaries
#%%
import datetime
import os
import time
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from giskard.plot import adjplot, matched_stripplot,... | 24.562874 | 73 | 0.661872 | #%% [markdown]
# # Matching when including the contralateral connections
#%% [markdown]
# ## Preliminaries
#%%
import datetime
import os
import time
from pathlib import Path
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from giskard.plot import adjplot, matched_stripplot,... | 198 | 0 | 46 |
7d58e6bfbca6ddc1fd109a5af6ed2758d6c322d1 | 5,671 | py | Python | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/hr_holidays/report/holidays_summary_report.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | 1 | 2019-12-19T01:53:13.000Z | 2019-12-19T01:53:13.000Z | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/hr_holidays/report/holidays_summary_report.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | null | null | null | apps/odoo/lib/odoo-10.0.post20170615-py2.7.egg/odoo/addons/hr_holidays/report/holidays_summary_report.py | gtfarng/Odoo_migrade | 9cc28fae4c379e407645248a29d22139925eafe7 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import timedelta
from dateutil.relativedelta import relativedelta
from odoo import api, fields, models
| 47.655462 | 137 | 0.587903 | # -*- coding: utf-8 -*-
# Part of Odoo. See LICENSE file for full copyright and licensing details.
from datetime import timedelta
from dateutil.relativedelta import relativedelta
from odoo import api, fields, models
class HrHolidaySummaryReport(models.AbstractModel):
_name = 'report.hr_holidays.report_holidayssu... | 5,140 | 290 | 23 |
5581c1ebee357f3dfeb30ae89b2502f626c5ed33 | 521 | py | Python | ex075.py | pepev123/PythonEx | 8f39751bf87a9099d7b733aa829988595dab2344 | [
"MIT"
] | null | null | null | ex075.py | pepev123/PythonEx | 8f39751bf87a9099d7b733aa829988595dab2344 | [
"MIT"
] | null | null | null | ex075.py | pepev123/PythonEx | 8f39751bf87a9099d7b733aa829988595dab2344 | [
"MIT"
] | null | null | null | v1 = int(input('Digite o primeiro valor: '))
v2 = int(input('Digite o segundo valor: '))
v3 = int(input('Digite o terceiro valor: '))
v4 = int(input('Digite o quarto valor: '))
v5 = int(input('Digite o quinto valor: '))
lista = (v1, v2, v3, v4, v5)
print(f'O 9 apareceu {lista.count(9)} vezes.')
if lista.count(3) > 0:
... | 32.5625 | 64 | 0.612284 | v1 = int(input('Digite o primeiro valor: '))
v2 = int(input('Digite o segundo valor: '))
v3 = int(input('Digite o terceiro valor: '))
v4 = int(input('Digite o quarto valor: '))
v5 = int(input('Digite o quinto valor: '))
lista = (v1, v2, v3, v4, v5)
print(f'O 9 apareceu {lista.count(9)} vezes.')
if lista.count(3) > 0:
... | 0 | 0 | 0 |
f4656671d5efe09db1beb6b7b73d157a0ca91436 | 3,616 | py | Python | ppcd/core/infer.py | geoyee/PdRSCD | 4a1a7256320f006c15e3e5b5b238fdfba8198853 | [
"Apache-2.0"
] | 44 | 2021-04-21T02:41:55.000Z | 2022-03-09T03:01:16.000Z | ppcd/core/infer.py | MinZHANG-WHU/PdRSCD | 612976225201d78adc7ff99529ada17b41fedc5d | [
"Apache-2.0"
] | 2 | 2021-09-30T07:52:47.000Z | 2022-02-12T09:05:35.000Z | ppcd/core/infer.py | MinZHANG-WHU/PdRSCD | 612976225201d78adc7ff99529ada17b41fedc5d | [
"Apache-2.0"
] | 6 | 2021-07-23T02:18:39.000Z | 2022-01-14T01:15:50.000Z | import os
import cv2
import paddle
from tqdm import tqdm
# from paddle.io import DataLoader
from ppcd.datasets import DataLoader
from ppcd.tools import splicing_list, save_tif
# 进行滑框预测 | 37.278351 | 87 | 0.575774 | import os
import cv2
import paddle
from tqdm import tqdm
# from paddle.io import DataLoader
from ppcd.datasets import DataLoader
from ppcd.tools import splicing_list, save_tif
def Infer(model,
infer_data,
params_path=None,
save_img_path=None,
threshold=0.5):
# 数据读取器
i... | 3,460 | 0 | 45 |
6bda4b7629b500829e21a60127c096aba2859b72 | 5,651 | py | Python | insurancecompany/insurancecompany/controllers.py | karthikpalavalli/csci5448 | 4d2c84f5ee9080e032e7d73c33c7378f8a813938 | [
"MIT"
] | null | null | null | insurancecompany/insurancecompany/controllers.py | karthikpalavalli/csci5448 | 4d2c84f5ee9080e032e7d73c33c7378f8a813938 | [
"MIT"
] | null | null | null | insurancecompany/insurancecompany/controllers.py | karthikpalavalli/csci5448 | 4d2c84f5ee9080e032e7d73c33c7378f8a813938 | [
"MIT"
] | null | null | null | from models import Admin, UserProxy, Customer
from db_models import db, db_session, UserDB, AppointmentsDB, InsurancePlanDB
from insurance_plan import BasicHealthPlan, CancerCare, CardiacCare, BasicLifePlan, ULIPBenefits, ComboPlan
if __name__ == "__main__":
# Add new user
new_user = add_user()
# Fe... | 31.747191 | 114 | 0.606972 | from models import Admin, UserProxy, Customer
from db_models import db, db_session, UserDB, AppointmentsDB, InsurancePlanDB
from insurance_plan import BasicHealthPlan, CancerCare, CardiacCare, BasicLifePlan, ULIPBenefits, ComboPlan
def add_user():
default_admin = Admin(username='karthik',
... | 4,981 | 0 | 115 |
ce5a2416c780442544d0d5e9283fbaff98d9c5b6 | 9,882 | py | Python | hn2pdf.py | KyrillosL/HackerNewsToPDF | 489e8225d14550c874c2eb448005e8313662eac6 | [
"BSD-3-Clause"
] | null | null | null | hn2pdf.py | KyrillosL/HackerNewsToPDF | 489e8225d14550c874c2eb448005e8313662eac6 | [
"BSD-3-Clause"
] | null | null | null | hn2pdf.py | KyrillosL/HackerNewsToPDF | 489e8225d14550c874c2eb448005e8313662eac6 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
"""Python-Pinboard
Python script for downloading your saved stories and saved comments on Hacker News.
"""
__version__ = "1.1"
__license__ = "BSD"
__copyright__ = "Copyright 2013-2014, Luciano Fiandesio"
__author__ = "Luciano Fiandesio <http://fiandes.io/> & John David Pressman <http://jdpressman... | 40.334694 | 121 | 0.589152 | #!/usr/bin/env python
"""Python-Pinboard
Python script for downloading your saved stories and saved comments on Hacker News.
"""
__version__ = "1.1"
__license__ = "BSD"
__copyright__ = "Copyright 2013-2014, Luciano Fiandesio"
__author__ = "Luciano Fiandesio <http://fiandes.io/> & John David Pressman <http://jdpressman... | 5,727 | 0 | 115 |
82b747acfb6cfbe2be68b0df919e205e2f108117 | 1,679 | py | Python | server/routes/static.py | fpernice-google/website | e2675629b42701f65722471b0d3b552babd2a6c5 | [
"Apache-2.0"
] | null | null | null | server/routes/static.py | fpernice-google/website | e2675629b42701f65722471b0d3b552babd2a6c5 | [
"Apache-2.0"
] | null | null | null | server/routes/static.py | fpernice-google/website | e2675629b42701f65722471b0d3b552babd2a6c5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Google LLC
#
# 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, ... | 24.691176 | 74 | 0.753425 | # Copyright 2020 Google LLC
#
# 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, ... | 491 | 0 | 176 |
661836a327f7265f3f12be21776da646ba529953 | 1,231 | py | Python | arxiv/decorator.py | hbristow/django-arxiv | 04e499e064de74ef3aebe64e8445dc2c56536a2a | [
"BSD-3-Clause"
] | null | null | null | arxiv/decorator.py | hbristow/django-arxiv | 04e499e064de74ef3aebe64e8445dc2c56536a2a | [
"BSD-3-Clause"
] | null | null | null | arxiv/decorator.py | hbristow/django-arxiv | 04e499e064de74ef3aebe64e8445dc2c56536a2a | [
"BSD-3-Clause"
] | null | null | null | import functools
import collections
# ----------------------------------------------------------------------------
# Memoization/Caching
# ----------------------------------------------------------------------------
class cached(object):
"""Last 100 value memoization for functions of any arguments"""
def __in... | 32.394737 | 78 | 0.515028 | import functools
import collections
# ----------------------------------------------------------------------------
# Memoization/Caching
# ----------------------------------------------------------------------------
class cached(object):
"""Last 100 value memoization for functions of any arguments"""
def __in... | 498 | 0 | 27 |
15df36598c12c993de9c380506f7d9fd1078269a | 2,766 | py | Python | backend/mypkg/trained_bot.py | DKeen0123/SentiMind | 0ffb702e88879b3e2e02d3d94a703b1f8a785bd3 | [
"MIT"
] | 5 | 2018-04-09T16:47:53.000Z | 2018-07-05T11:03:25.000Z | backend/mypkg/trained_bot.py | DKeen0123/SentiMind | 0ffb702e88879b3e2e02d3d94a703b1f8a785bd3 | [
"MIT"
] | 2 | 2018-04-09T17:40:40.000Z | 2020-07-07T21:12:07.000Z | backend/mypkg/trained_bot.py | marcusfgardiner/SentiMind | d14b366ab36190df0bf3c867a149b7260ed1e2e4 | [
"MIT"
] | 3 | 2018-04-12T22:14:55.000Z | 2018-04-17T10:36:58.000Z | import wheel
import pandas as pd
import nltk
import numpy
import sklearn as skl
import pickle
f = open('./mypkg/bananoulli_20k.pickle', 'rb')
classifier = pickle.load(f)
f.close
df = pd.DataFrame(pd.read_csv('./mypkg/testingdataset.csv'))
sentiment_column = (df.iloc[:, [1]])
sentiment_array = sentiment_column.value... | 28.515464 | 91 | 0.612437 | import wheel
import pandas as pd
import nltk
import numpy
import sklearn as skl
import pickle
f = open('./mypkg/bananoulli_20k.pickle', 'rb')
classifier = pickle.load(f)
f.close
df = pd.DataFrame(pd.read_csv('./mypkg/testingdataset.csv'))
sentiment_column = (df.iloc[:, [1]])
sentiment_array = sentiment_column.value... | 983 | 0 | 138 |
0ce3a0003147fa52ff085740d54a1eff50de0ab4 | 181 | py | Python | djvision/dashboard/forms.py | carthage-college/django-djvision | 90af7e1da56f9abd35d87444e0cf4a0b46c9d999 | [
"MIT"
] | null | null | null | djvision/dashboard/forms.py | carthage-college/django-djvision | 90af7e1da56f9abd35d87444e0cf4a0b46c9d999 | [
"MIT"
] | 1 | 2020-07-16T20:38:59.000Z | 2020-07-16T20:38:59.000Z | djvision/dashboard/forms.py | carthage-college/django-djvision | 90af7e1da56f9abd35d87444e0cf4a0b46c9d999 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django import forms
| 16.454545 | 61 | 0.662983 | # -*- coding: utf-8 -*-
from django import forms
class DetailCreatedForm(forms.Form):
created_at = forms.DateField(label="Created on or after")
class Meta:
pass
| 0 | 108 | 23 |
4deb9652fac25a75cd254d2b6953dcca8aee71d4 | 669 | py | Python | boto/dynamodb/exceptions.py | krux/boto | 496adaff8988164e61c2d6f259b7eda671899079 | [
"BSD-3-Clause"
] | null | null | null | boto/dynamodb/exceptions.py | krux/boto | 496adaff8988164e61c2d6f259b7eda671899079 | [
"BSD-3-Clause"
] | null | null | null | boto/dynamodb/exceptions.py | krux/boto | 496adaff8988164e61c2d6f259b7eda671899079 | [
"BSD-3-Clause"
] | null | null | null | """
Exceptions that are specific to the dynamodb module.
"""
from boto.exception import BotoServerError, BotoClientError
class DynamoDBExpiredTokenError(BotoServerError):
"""
Raised when a DynamoDB security token expires. This is generally boto's
(or the user's) notice to renew their DynamoDB security tok... | 23.068966 | 75 | 0.715994 | """
Exceptions that are specific to the dynamodb module.
"""
from boto.exception import BotoServerError, BotoClientError
class DynamoDBExpiredTokenError(BotoServerError):
"""
Raised when a DynamoDB security token expires. This is generally boto's
(or the user's) notice to renew their DynamoDB security tok... | 0 | 0 | 0 |
ca7d4dfb6b9cf6148be6352040539f797a96377a | 1,288 | py | Python | src/count_min_sketch.py | doksketch/effective-bassoon | 2b8a6bbe6a82b96d1443f521061cfbffafe4d9c8 | [
"MIT"
] | null | null | null | src/count_min_sketch.py | doksketch/effective-bassoon | 2b8a6bbe6a82b96d1443f521061cfbffafe4d9c8 | [
"MIT"
] | null | null | null | src/count_min_sketch.py | doksketch/effective-bassoon | 2b8a6bbe6a82b96d1443f521061cfbffafe4d9c8 | [
"MIT"
] | null | null | null | # Count-Min Sketch - вероятностная структура данных для быстрого примерного подсчёта частоты встречаемости элементов
import random
from collections import Counter
if __name__ == '__main__':
data = [random.randint(0, 5) for i in range(100)]
print(Counter(data))
cms = CountMinSketch(top_k=3)
for i in ... | 32.2 | 116 | 0.64441 | # Count-Min Sketch - вероятностная структура данных для быстрого примерного подсчёта частоты встречаемости элементов
import random
from collections import Counter
class CountMinSketch:
def __init__(self, top_k):
self.total_hashes = top_k
self.min_sketch = [[0] * self.total_hashes ** 2] * self.tot... | 501 | 0 | 131 |
faf7aed00416d5bc183b1f1e0f0c7bccf21b314b | 2,671 | py | Python | stimulus_presentation/generate_spatial_gratings.py | gzoumpourlis/muse-lsl | 309d339b475e2b8914f2a96616ea0fb9d014b84e | [
"BSD-3-Clause"
] | 5 | 2019-01-22T11:24:11.000Z | 2022-03-29T04:59:59.000Z | stimulus_presentation/generate_spatial_gratings.py | gzoumpourlis/muse-lsl | 309d339b475e2b8914f2a96616ea0fb9d014b84e | [
"BSD-3-Clause"
] | null | null | null | stimulus_presentation/generate_spatial_gratings.py | gzoumpourlis/muse-lsl | 309d339b475e2b8914f2a96616ea0fb9d014b84e | [
"BSD-3-Clause"
] | 4 | 2018-03-12T06:56:20.000Z | 2020-12-24T07:53:21.000Z | """
Generate spatial gratings
=========================
Stimulus presentation based on gratings of different spatial frequencies
for generating ERPs, high frequency oscillations, and alpha reset.
Inspired from:
> Hermes, Dora, K. J. Miller, B. A. Wandell, and Jonathan Winawer. "Stimulus
dependence of gamma oscillati... | 26.186275 | 77 | 0.655185 | """
Generate spatial gratings
=========================
Stimulus presentation based on gratings of different spatial frequencies
for generating ERPs, high frequency oscillations, and alpha reset.
Inspired from:
> Hermes, Dora, K. J. Miller, B. A. Wandell, and Jonathan Winawer. "Stimulus
dependence of gamma oscillati... | 0 | 0 | 0 |
47440badfacebb3df762d7bd5080ce06af9cc492 | 4,523 | py | Python | executables/rfoutlets_coffee.py | mjvandermeulen/rpi-automation | 0b328cab8876929e46235482d217dc4771dfdc6a | [
"MIT"
] | null | null | null | executables/rfoutlets_coffee.py | mjvandermeulen/rpi-automation | 0b328cab8876929e46235482d217dc4771dfdc6a | [
"MIT"
] | null | null | null | executables/rfoutlets_coffee.py | mjvandermeulen/rpi-automation | 0b328cab8876929e46235482d217dc4771dfdc6a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# EQUAL PARTS VINEGAR AND WATER
#
# https://www.goodhousekeeping.com/home/cleaning/tips/a26565/cleaning-coffee-maker/
#
# Fill the reservoir with equal parts vinegar and water, and place a paper filter
# into the machine's empty basket. Position the pot in place, and "brew" the solution
# halfway... | 35.614173 | 123 | 0.636746 | #!/usr/bin/env python
# EQUAL PARTS VINEGAR AND WATER
#
# https://www.goodhousekeeping.com/home/cleaning/tips/a26565/cleaning-coffee-maker/
#
# Fill the reservoir with equal parts vinegar and water, and place a paper filter
# into the machine's empty basket. Position the pot in place, and "brew" the solution
# halfway... | 313 | 0 | 23 |
f6c593febed2e63f1abe9c1ff092a8e95e3f2f01 | 538 | py | Python | hasher-matcher-actioner/hmalib/common/tests/test_actioner_models.py | king40or1/ThreatExchange | 95680d1568241bf63249f91480bbf1c7bbe9b699 | [
"BSD-3-Clause"
] | null | null | null | hasher-matcher-actioner/hmalib/common/tests/test_actioner_models.py | king40or1/ThreatExchange | 95680d1568241bf63249f91480bbf1c7bbe9b699 | [
"BSD-3-Clause"
] | null | null | null | hasher-matcher-actioner/hmalib/common/tests/test_actioner_models.py | king40or1/ThreatExchange | 95680d1568241bf63249f91480bbf1c7bbe9b699 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import unittest
from hmalib.common.actioner_models import Label
| 31.647059 | 70 | 0.702602 | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import unittest
from hmalib.common.actioner_models import Label
class LabelsTestCase(unittest.TestCase):
def test_label_validation(self):
l = Label("some key", "some value")
# Just validate that no error is raised
def tes... | 306 | 19 | 76 |
a20559159ffc09aa188a9b5b13110229a0e2c738 | 3,350 | py | Python | src/models/model_trainer.py | arturgontijo/NN_compression | 4ba46b244eadf0ff492276d4df8777943e79f48a | [
"MIT"
] | 1 | 2021-03-29T17:06:11.000Z | 2021-03-29T17:06:11.000Z | src/models/model_trainer.py | arturgontijo/NN_compression | 4ba46b244eadf0ff492276d4df8777943e79f48a | [
"MIT"
] | null | null | null | src/models/model_trainer.py | arturgontijo/NN_compression | 4ba46b244eadf0ff492276d4df8777943e79f48a | [
"MIT"
] | null | null | null | from __future__ import print_function
import tensorflow as tf
import sys
| 37.640449 | 133 | 0.575821 | from __future__ import print_function
import tensorflow as tf
import sys
class ModelTrainer:
def vocab_encode(self, text):
return [self.config.vocab.index(x) for x in text if x in self.config.vocab]
def vocab_decode(self, array):
return ''.join([self.config.vocab[x] for x in array])
def... | 3,039 | -2 | 238 |
2736277a53237f46e0acbb4ec1ae3029afa37982 | 2,623 | py | Python | oosc/oosc/absence/views.py | C4DLabOrg/da_api | 3d876576a189ce35c6b4b2f1c728f4b91e4b2ed0 | [
"MIT"
] | null | null | null | oosc/oosc/absence/views.py | C4DLabOrg/da_api | 3d876576a189ce35c6b4b2f1c728f4b91e4b2ed0 | [
"MIT"
] | null | null | null | oosc/oosc/absence/views.py | C4DLabOrg/da_api | 3d876576a189ce35c6b4b2f1c728f4b91e4b2ed0 | [
"MIT"
] | null | null | null | from django.shortcuts import render
# Create your views here.
from oosc.absence.models import Absence
from oosc.absence.serializers import AbsenceSerializer
from rest_framework import generics
from oosc.attendance.models import Attendance
from django.db.models import Count,Case,When,IntegerField,Q,Value,CharField,Text... | 43.716667 | 230 | 0.767061 | from django.shortcuts import render
# Create your views here.
from oosc.absence.models import Absence
from oosc.absence.serializers import AbsenceSerializer
from rest_framework import generics
from oosc.attendance.models import Attendance
from django.db.models import Count,Case,When,IntegerField,Q,Value,CharField,Text... | 1,751 | 110 | 68 |
c4b0826e953f6f1ab95cbc97226284183a18fa5a | 11,750 | py | Python | python/taichi/examples/graph/stable_fluid_graph.py | DongqiShen/taichi | 974aab98f3a039f64335554286f447f64c2ea393 | [
"MIT"
] | null | null | null | python/taichi/examples/graph/stable_fluid_graph.py | DongqiShen/taichi | 974aab98f3a039f64335554286f447f64c2ea393 | [
"MIT"
] | null | null | null | python/taichi/examples/graph/stable_fluid_graph.py | DongqiShen/taichi | 974aab98f3a039f64335554286f447f64c2ea393 | [
"MIT"
] | null | null | null | # References:
# http://developer.download.nvidia.com/books/HTML/gpugems/gpugems_ch38.html
# https://github.com/PavelDoGreat/WebGL-Fluid-Simulation
# https://www.bilibili.com/video/BV1ZK411H7Hc?p=4
# https://github.com/ShaneFX/GAMES201/tree/master/HW01
import argparse
import numpy as np
import taichi as ti
ti.init(ar... | 34.457478 | 90 | 0.549362 | # References:
# http://developer.download.nvidia.com/books/HTML/gpugems/gpugems_ch38.html
# https://github.com/PavelDoGreat/WebGL-Fluid-Simulation
# https://www.bilibili.com/video/BV1ZK411H7Hc?p=4
# https://github.com/ShaneFX/GAMES201/tree/master/HW01
import argparse
import numpy as np
import taichi as ti
ti.init(ar... | 4,792 | -1 | 419 |
3e568985abf2f3cfda71ff8ca8fe57a1de05b7f3 | 7,658 | py | Python | data_functions.py | Cadarn/agn_spectra_app | 11041ea2b4607d6d0ed98856f0ddada2bdb738fb | [
"MIT"
] | 1 | 2021-03-03T12:02:17.000Z | 2021-03-03T12:02:17.000Z | data_functions.py | Cadarn/agn_spectra_app | 11041ea2b4607d6d0ed98856f0ddada2bdb738fb | [
"MIT"
] | 2 | 2020-10-31T02:39:53.000Z | 2020-10-31T02:41:31.000Z | data_functions.py | Cadarn/agn_spectra_app | 11041ea2b4607d6d0ed98856f0ddada2bdb738fb | [
"MIT"
] | null | null | null | """
AGN spectral model generation functions
Copyright: Adam Hill (2020)
"""
import numpy as np
import pandas as pd
from tqdm import tqdm
from scipy.interpolate import RegularGridInterpolator
def merge_dict_dfs(d, common_column):
"""
Main purpose:
- merges all the dataframes collected in the
... | 44.523256 | 172 | 0.629799 | """
AGN spectral model generation functions
Copyright: Adam Hill (2020)
"""
import numpy as np
import pandas as pd
from tqdm import tqdm
from scipy.interpolate import RegularGridInterpolator
def merge_dict_dfs(d, common_column):
"""
Main purpose:
- merges all the dataframes collected in the
... | 0 | 0 | 0 |
c4c400f5b32fdbe5ce4be7931734db96f1825fdb | 1,709 | py | Python | data/train/python/c4c400f5b32fdbe5ce4be7931734db96f1825fdburls.py | harshp8l/deep-learning-lang-detection | 2a54293181c1c2b1a2b840ddee4d4d80177efb33 | [
"MIT"
] | 84 | 2017-10-25T15:49:21.000Z | 2021-11-28T21:25:54.000Z | data/train/python/c4c400f5b32fdbe5ce4be7931734db96f1825fdburls.py | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 5 | 2018-03-29T11:50:46.000Z | 2021-04-26T13:33:18.000Z | data/train/python/c4c400f5b32fdbe5ce4be7931734db96f1825fdburls.py | vassalos/deep-learning-lang-detection | cbb00b3e81bed3a64553f9c6aa6138b2511e544e | [
"MIT"
] | 24 | 2017-11-22T08:31:00.000Z | 2022-03-27T01:22:31.000Z | from django.conf.urls import patterns, include, url
from django.contrib import admin
from tastypie.api import Api
from centros.api import *
from clientes.api import *
from compras.api import *
from contactos.api import *
from cotizaciones.api import *
from equipos.api import *
from familias.api import *
from historial... | 32.865385 | 58 | 0.818607 | from django.conf.urls import patterns, include, url
from django.contrib import admin
from tastypie.api import Api
from centros.api import *
from clientes.api import *
from compras.api import *
from contactos.api import *
from cotizaciones.api import *
from equipos.api import *
from familias.api import *
from historial... | 0 | 0 | 0 |
64ab3544724934a991a0858b5b7718856273fb9b | 1,488 | py | Python | tests/unit/samplers/test_mesh_samplers.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 1,142 | 2016-10-10T08:55:30.000Z | 2022-03-30T04:46:16.000Z | tests/unit/samplers/test_mesh_samplers.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 195 | 2016-10-10T08:30:37.000Z | 2022-02-17T12:51:17.000Z | tests/unit/samplers/test_mesh_samplers.py | bernssolg/pyntcloud-master | 84cf000b7a7f69a2c1b36f9624f05f65160bf992 | [
"MIT"
] | 215 | 2017-02-28T00:50:29.000Z | 2022-03-22T17:01:31.000Z | import pytest
from pyntcloud.samplers import RandomMeshSampler
@pytest.mark.parametrize("n", [
1,
5,
10,
50,
100
])
@pytest.mark.usefixtures("diamond")
@pytest.mark.parametrize("rgb,normals", [
(False, False),
(True, False),
(True, True),
(False, True)
])
@pytest.mark.usefixture... | 21.565217 | 81 | 0.612231 | import pytest
from pyntcloud.samplers import RandomMeshSampler
@pytest.mark.parametrize("n", [
1,
5,
10,
50,
100
])
@pytest.mark.usefixtures("diamond")
def test_RandomMeshSampler_n_argument(diamond, n):
sampler = RandomMeshSampler(
pyntcloud=diamond,
n=n,
rgb=True,
... | 977 | 0 | 66 |
1518c7ea6a64cfa5331babb8a8dc61e8ec29325d | 304 | py | Python | notifications/tests/helpers.py | konradko/directory-api | e9cd05b1deaf575e94352c46ddbd1857d8119fda | [
"MIT"
] | 1 | 2021-11-06T12:08:26.000Z | 2021-11-06T12:08:26.000Z | notifications/tests/helpers.py | konradko/directory-api | e9cd05b1deaf575e94352c46ddbd1857d8119fda | [
"MIT"
] | null | null | null | notifications/tests/helpers.py | konradko/directory-api | e9cd05b1deaf575e94352c46ddbd1857d8119fda | [
"MIT"
] | null | null | null | from notifications.tests.factories import SupplierEmailNotificationFactory
| 33.777778 | 74 | 0.819079 | from notifications.tests.factories import SupplierEmailNotificationFactory
def build_suppier_email_notification_factory(SupplierEmailNotification):
class HistoricFactory(SupplierEmailNotificationFactory):
class Meta:
model = SupplierEmailNotification
return HistoricFactory
| 205 | 0 | 23 |
d9c383cc9cc941244a8de219cabe478afc811a9b | 7,733 | py | Python | vault/datadog_checks/vault/vault.py | brentm5/integrations-core | 5cac8788c95d8820435ef9c5d32d6a5463cf491d | [
"BSD-3-Clause"
] | 4 | 2021-06-21T19:21:49.000Z | 2021-06-23T21:21:55.000Z | vault/datadog_checks/vault/vault.py | brentm5/integrations-core | 5cac8788c95d8820435ef9c5d32d6a5463cf491d | [
"BSD-3-Clause"
] | null | null | null | vault/datadog_checks/vault/vault.py | brentm5/integrations-core | 5cac8788c95d8820435ef9c5d32d6a5463cf491d | [
"BSD-3-Clause"
] | 1 | 2021-06-21T19:21:51.000Z | 2021-06-21T19:21:51.000Z | # (C) Datadog, Inc. 2018
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import warnings
from time import time as timestamp
import requests
from six import string_types
from urllib3.exceptions import InsecureRequestWarning
from datadog_checks.checks import AgentCheck
from datadog_che... | 39.055556 | 108 | 0.585025 | # (C) Datadog, Inc. 2018
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
import warnings
from time import time as timestamp
import requests
from six import string_types
from urllib3.exceptions import InsecureRequestWarning
from datadog_checks.checks import AgentCheck
from datadog_che... | 6,850 | 414 | 23 |
c96d5b62c7c62750a78dc609fb8b00de2a672e4a | 424 | py | Python | problem_3.py | vineeths96/Pattern-Recognition-1 | b7cee4f59bf037fad76e66dd24ff66c1d3fe9049 | [
"MIT"
] | null | null | null | problem_3.py | vineeths96/Pattern-Recognition-1 | b7cee4f59bf037fad76e66dd24ff66c1d3fe9049 | [
"MIT"
] | null | null | null | problem_3.py | vineeths96/Pattern-Recognition-1 | b7cee4f59bf037fad76e66dd24ff66c1d3fe9049 | [
"MIT"
] | 1 | 2021-08-15T17:21:16.000Z | 2021-08-15T17:21:16.000Z | import os
from problem_3.load_data import load_data
from problem_3.problem_3a import problem_3a
from problem_3.problem_3b import problem_3b
# Create results directory
os.makedirs('results', exist_ok=True)
# Problem 3a
X_train, Y_train, X_test, Y_test = load_data('a')
problem_3a(X_train, Y_train, X_test, Y_test)
# P... | 26.5 | 49 | 0.792453 | import os
from problem_3.load_data import load_data
from problem_3.problem_3a import problem_3a
from problem_3.problem_3b import problem_3b
# Create results directory
os.makedirs('results', exist_ok=True)
# Problem 3a
X_train, Y_train, X_test, Y_test = load_data('a')
problem_3a(X_train, Y_train, X_test, Y_test)
# P... | 0 | 0 | 0 |
0a3a1d806499dced14fcb67cd4b59b22e9d08d77 | 849 | py | Python | setup.py | satyaog/pybenzinaparse | ff97e5b26555afee7a0ceaf9b0bd1a7e92374be3 | [
"MIT"
] | null | null | null | setup.py | satyaog/pybenzinaparse | ff97e5b26555afee7a0ceaf9b0bd1a7e92374be3 | [
"MIT"
] | null | null | null | setup.py | satyaog/pybenzinaparse | ff97e5b26555afee7a0ceaf9b0bd1a7e92374be3 | [
"MIT"
] | null | null | null | import glob
from setuptools import setup, find_packages
try:
import pypandoc
long_description = pypandoc.convert("README.md", "rst")
except(IOError, ImportError):
long_description = open("README.md").read()
setup(
name="pybenzinaparse",
version="0.2.2",
packages=find_packages(exclude=["test_*"... | 31.444444 | 99 | 0.6702 | import glob
from setuptools import setup, find_packages
try:
import pypandoc
long_description = pypandoc.convert("README.md", "rst")
except(IOError, ImportError):
long_description = open("README.md").read()
setup(
name="pybenzinaparse",
version="0.2.2",
packages=find_packages(exclude=["test_*"... | 0 | 0 | 0 |
edf7a7dece23b7613df27359ee9783353e1d4cf4 | 6,202 | py | Python | proj5/pghw05.py | insomniaccat/deepLearning_spring2017 | 2c770809d0bb7896d37db527e4353e899ba49420 | [
"MIT"
] | 1 | 2020-03-04T06:50:38.000Z | 2020-03-04T06:50:38.000Z | proj5/pghw05.py | insomniaccat/deepLearning_spring2017 | 2c770809d0bb7896d37db527e4353e899ba49420 | [
"MIT"
] | null | null | null | proj5/pghw05.py | insomniaccat/deepLearning_spring2017 | 2c770809d0bb7896d37db527e4353e899ba49420 | [
"MIT"
] | null | null | null | #Author: Usama Munir Sheikh
#The following code implements an LSTM recurrent neural network
#for classifying tweets as positive or negative
#in the sentiment140 dataset http://help.sentiment140.com/for-students/
#It was written for my Intro to Deep Learning Course
#taught by Professor Qiang Ji in Spring 2017
import... | 32.471204 | 115 | 0.706224 | #Author: Usama Munir Sheikh
#The following code implements an LSTM recurrent neural network
#for classifying tweets as positive or negative
#in the sentiment140 dataset http://help.sentiment140.com/for-students/
#It was written for my Intro to Deep Learning Course
#taught by Professor Qiang Ji in Spring 2017
import... | 5,694 | 0 | 23 |
ceb6898c641cfb4002ca3b57c862541acb373866 | 2,861 | py | Python | test/models/test_autoreg.py | gpescia/MyNetKet | 958510966a5870d9d491de0628903cf1fc210921 | [
"Apache-2.0"
] | null | null | null | test/models/test_autoreg.py | gpescia/MyNetKet | 958510966a5870d9d491de0628903cf1fc210921 | [
"Apache-2.0"
] | null | null | null | test/models/test_autoreg.py | gpescia/MyNetKet | 958510966a5870d9d491de0628903cf1fc210921 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 The NetKet Authors - All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 32.146067 | 86 | 0.594547 | # Copyright 2021 The NetKet Authors - All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 1,128 | 0 | 22 |
03881bddee50a658bae810ebeae349ced5d95d0f | 16,307 | py | Python | tests/pytests/integration/runners/state/orchestrate/test_orchestrate.py | haodeon/salt | af2964f4ddbf9c5635d1528a495e473996cc7b71 | [
"Apache-2.0"
] | null | null | null | tests/pytests/integration/runners/state/orchestrate/test_orchestrate.py | haodeon/salt | af2964f4ddbf9c5635d1528a495e473996cc7b71 | [
"Apache-2.0"
] | null | null | null | tests/pytests/integration/runners/state/orchestrate/test_orchestrate.py | haodeon/salt | af2964f4ddbf9c5635d1528a495e473996cc7b71 | [
"Apache-2.0"
] | null | null | null | """
Tests for state.orchestrate
"""
import os
import pytest
pytestmark = [
pytest.mark.slow_test,
]
def test_orchestrate_output(salt_run_cli, salt_minion, salt_master):
"""
Ensure the orchestrate runner outputs useful state data.
In Issue #31330, the output only contains ['outputter:', ' highsta... | 30.480374 | 96 | 0.601398 | """
Tests for state.orchestrate
"""
import os
import pytest
pytestmark = [
pytest.mark.slow_test,
]
def test_orchestrate_output(salt_run_cli, salt_minion, salt_master):
"""
Ensure the orchestrate runner outputs useful state data.
In Issue #31330, the output only contains ['outputter:', ' highsta... | 0 | 0 | 0 |
ded002448cfa7e16c5ce5015ad96af4af0573fea | 3,274 | py | Python | modules/aerodyn/ad_BAR_RNAMotion/CreateMotion.py | OpenFAST/openfast-regression | 7892739f47f312ce014711192fd70253ea40c8e8 | [
"Apache-2.0"
] | null | null | null | modules/aerodyn/ad_BAR_RNAMotion/CreateMotion.py | OpenFAST/openfast-regression | 7892739f47f312ce014711192fd70253ea40c8e8 | [
"Apache-2.0"
] | null | null | null | modules/aerodyn/ad_BAR_RNAMotion/CreateMotion.py | OpenFAST/openfast-regression | 7892739f47f312ce014711192fd70253ea40c8e8 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# Local
import weio
def vel_bump(time, A=1, half=False):
"""
velocity bump, position goes from 0 to A between time[0] and time[-1]
half is false: velocity 0 -> max -> 0
half is True: velocity 0 -> max
"""
time-=tim... | 25.184615 | 110 | 0.576359 | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
# Local
import weio
def vel_bump(time, A=1, half=False):
"""
velocity bump, position goes from 0 to A between time[0] and time[-1]
half is false: velocity 0 -> max -> 0
half is True: velocity 0 -> max
"""
time-=tim... | 228 | 0 | 23 |
476bfdea3b5aa53f26a2194456c20aecdb4920ed | 79 | py | Python | data/datasets/utils/__init__.py | qinwang-ai/Contact-Distil | 5e98389de70e0d9c4d16bd91ca1326689dc220a6 | [
"Apache-2.0"
] | null | null | null | data/datasets/utils/__init__.py | qinwang-ai/Contact-Distil | 5e98389de70e0d9c4d16bd91ca1326689dc220a6 | [
"Apache-2.0"
] | null | null | null | data/datasets/utils/__init__.py | qinwang-ai/Contact-Distil | 5e98389de70e0d9c4d16bd91ca1326689dc220a6 | [
"Apache-2.0"
] | null | null | null | from .batch_converter import BatchConverter
from .data_reader import DataReader | 39.5 | 43 | 0.886076 | from .batch_converter import BatchConverter
from .data_reader import DataReader | 0 | 0 | 0 |
29c5a6df6defacf45ddb0a6ce456af9940b51621 | 3,572 | py | Python | example_scripts/dirLoader.py | KingsPM/pySQVD | e882e4c3a8d57226c124b52404898e92c9a1bb64 | [
"MIT"
] | null | null | null | example_scripts/dirLoader.py | KingsPM/pySQVD | e882e4c3a8d57226c124b52404898e92c9a1bb64 | [
"MIT"
] | null | null | null | example_scripts/dirLoader.py | KingsPM/pySQVD | e882e4c3a8d57226c124b52404898e92c9a1bb64 | [
"MIT"
] | null | null | null | import os
import re
import sys
import time
from pysqvd import SQVD
'''
Simple loading script from directory structure
root/<group>/workflow/panelid+version/sample/BAM+VCF+BEDGRAPH
'''
if __name__ == "__main__":
# grab username and password
user = os.environ.get("SQVDUSER", default="admin")
passwd = os.en... | 40.590909 | 92 | 0.510078 | import os
import re
import sys
import time
from pysqvd import SQVD
'''
Simple loading script from directory structure
root/<group>/workflow/panelid+version/sample/BAM+VCF+BEDGRAPH
'''
def main(host, user, passwd, directory, dwell_time):
# configure the API connection
sqvd = SQVD(username=user, password=passwd... | 2,446 | 0 | 23 |
eaa75f603aafdb6e54c92923660e65cf2356b31b | 147 | py | Python | pathfile.py | M4TH1EU/john-the-ia | 35db1430350e2144695baeef17a67819b9724497 | [
"Unlicense"
] | 2 | 2021-05-05T20:49:55.000Z | 2021-05-05T21:03:02.000Z | pathfile.py | M4TH1EU/john-the-ia | 35db1430350e2144695baeef17a67819b9724497 | [
"Unlicense"
] | null | null | null | pathfile.py | M4TH1EU/john-the-ia | 35db1430350e2144695baeef17a67819b9724497 | [
"Unlicense"
] | null | null | null | # THIS FILE DON'T DO ANYTHING EXCEPT GIVE ME THE PROJECT PATH (i'm listening for better ideas)
if __name__ == '__main__':
print("DO NOTHING")
| 29.4 | 94 | 0.714286 | # THIS FILE DON'T DO ANYTHING EXCEPT GIVE ME THE PROJECT PATH (i'm listening for better ideas)
if __name__ == '__main__':
print("DO NOTHING")
| 0 | 0 | 0 |
12cddfd703815a58c0e703ae7e1becdf862baa86 | 553 | py | Python | PythonClient/astrodrone/utils.py | jeremyhardy/AirSim | ddebcf1d9ad97dd93e248bcfd411e9cdb00e783b | [
"MIT"
] | null | null | null | PythonClient/astrodrone/utils.py | jeremyhardy/AirSim | ddebcf1d9ad97dd93e248bcfd411e9cdb00e783b | [
"MIT"
] | null | null | null | PythonClient/astrodrone/utils.py | jeremyhardy/AirSim | ddebcf1d9ad97dd93e248bcfd411e9cdb00e783b | [
"MIT"
] | null | null | null | import airsim
| 26.333333 | 95 | 0.717902 | import airsim
def qnorm(quaternion):
while(quaternion.get_length()!=1):
quaternion = quaternion.sgn()
return quaternion
def quat2vec(quaternion):
vector = airsim.Vector3r(quaternion.x_val, quaternion.y_val, quaternion.z_val)
return vector
def vec2quat(vector):
quaternion = air... | 431 | 0 | 101 |
4e69aacfba71738ff06579bf4a85e097b5391a41 | 20,553 | py | Python | vespa/interfaces/inline/philips/run_inline_vespa_philips.py | vespa-mrs/vespa | 6d3e84a206ec427ac1304e70c7fadf817432956b | [
"BSD-3-Clause"
] | null | null | null | vespa/interfaces/inline/philips/run_inline_vespa_philips.py | vespa-mrs/vespa | 6d3e84a206ec427ac1304e70c7fadf817432956b | [
"BSD-3-Clause"
] | 4 | 2021-04-17T13:58:31.000Z | 2022-01-20T14:19:57.000Z | vespa/interfaces/inline/philips/run_inline_vespa_philips.py | vespa-mrs/vespa | 6d3e84a206ec427ac1304e70c7fadf817432956b | [
"BSD-3-Clause"
] | 3 | 2021-06-05T16:34:57.000Z | 2022-01-19T16:13:22.000Z |
# Python modules
import os
import io
import base64
import traceback
import datetime
import pathlib
# 3rd party modules
import matplotlib
matplotlib.use('Agg')
import numpy as np
from pydicom import Dataset, FileDataset, dcmread, read_file
# Our modules
import vespa.interfaces.inline.vespa_inline_engine as vie
impor... | 54.373016 | 3,758 | 0.67776 |
# Python modules
import os
import io
import base64
import traceback
import datetime
import pathlib
# 3rd party modules
import matplotlib
matplotlib.use('Agg')
import numpy as np
from pydicom import Dataset, FileDataset, dcmread, read_file
# Our modules
import vespa.interfaces.inline.vespa_inline_engine as vie
impor... | 6,801 | 0 | 69 |
cbdc4378671115d23a90b8ecd17b6a7d7dd767c5 | 905 | py | Python | stellargraph/core/utils.py | anonymnous-gituser/stellargraph | 8c2872a8907f8ccef79256238c6c0d21b94cf2f3 | [
"Apache-2.0"
] | 1 | 2019-07-15T08:56:05.000Z | 2019-07-15T08:56:05.000Z | stellargraph/core/utils.py | subpath/stellargraph | 60edf4a6268f29b49b7c768c382e235af4108506 | [
"Apache-2.0"
] | null | null | null | stellargraph/core/utils.py | subpath/stellargraph | 60edf4a6268f29b49b7c768c382e235af4108506 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright 2018 Data61, CSIRO
#
# 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... | 30.166667 | 82 | 0.711602 | # -*- coding: utf-8 -*-
#
# Copyright 2018 Data61, CSIRO
#
# 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... | 0 | 0 | 0 |
294ada3ece65f13dbc7fbda4391ac82e9c40d818 | 2,706 | py | Python | src/AppiumLibrary/keywords/_android_utils.py | stevenkcolin/AppiumLibrarySteve | 87e5d09be749542d0a3ab16ad1b1522a9570e4da | [
"Apache-2.0"
] | 2 | 2016-07-11T08:01:37.000Z | 2020-07-30T07:20:27.000Z | src/AppiumLibrary/keywords/_android_utils.py | stevenkcolin/AppiumLibrarySteve | 87e5d09be749542d0a3ab16ad1b1522a9570e4da | [
"Apache-2.0"
] | null | null | null | src/AppiumLibrary/keywords/_android_utils.py | stevenkcolin/AppiumLibrarySteve | 87e5d09be749542d0a3ab16ad1b1522a9570e4da | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import base64
from keywordgroup import KeywordGroup
from appium.webdriver.connectiontype import ConnectionType
| 36.08 | 102 | 0.578344 | # -*- coding: utf-8 -*-
import base64
from keywordgroup import KeywordGroup
from appium.webdriver.connectiontype import ConnectionType
class _AndroidUtilsKeywords(KeywordGroup):
# Public
def get_network_connection_status(self):
"""Returns an integer bitmask specifying the network connection type.
... | 0 | 2,547 | 23 |
e066197b442ba032e2f568218267b4a10c8feeef | 2,402 | py | Python | examples/RuleBasedEngine.py | MATHEMA-GmbH/Owl-Racer-AI-Client-Python | 3a16a254710e4a2e868e8569e7d6a67050cbc180 | [
"MIT"
] | null | null | null | examples/RuleBasedEngine.py | MATHEMA-GmbH/Owl-Racer-AI-Client-Python | 3a16a254710e4a2e868e8569e7d6a67050cbc180 | [
"MIT"
] | null | null | null | examples/RuleBasedEngine.py | MATHEMA-GmbH/Owl-Racer-AI-Client-Python | 3a16a254710e4a2e868e8569e7d6a67050cbc180 | [
"MIT"
] | null | null | null | import time
from owlracer.env import Env as Owlracer_Env
from owlracer import owlParser
@owlParser
if __name__ == '__main__':
main_loop()
| 27.609195 | 145 | 0.568693 | import time
from owlracer.env import Env as Owlracer_Env
from owlracer import owlParser
def calculate_action(step_result, list):
distance_right = step_result.distance.right
distance_front_right = step_result.distance.frontRight
distance_left = step_result.distance.left
distance_front_left = step_resul... | 2,211 | 0 | 45 |
a941edd32a80157885771b3caed6ba002cfcd163 | 876 | py | Python | config.py | red-green/youtube-to-podcast | 569cdbbaca95a287a34dbcabb1782b23de3f42d4 | [
"Unlicense"
] | null | null | null | config.py | red-green/youtube-to-podcast | 569cdbbaca95a287a34dbcabb1782b23de3f42d4 | [
"Unlicense"
] | null | null | null | config.py | red-green/youtube-to-podcast | 569cdbbaca95a287a34dbcabb1782b23de3f42d4 | [
"Unlicense"
] | null | null | null | ### channel configuration
CHANNEL_NAME = 'ThreatWire'
CHANNEL_PLAYLIST_ID = 'PLW5y1tjAOzI0Sx4UU2fncEwQ9BQLr5Vlu'
ITEMS_TO_SCAN = 5
FG_YOUTUBE = 'https://www.youtube.com/channel/UC3s0BtrBJpwNDaflRSoiieQ' # channel link
FG_AUTHOR = {'name':'Shannon Morse','email':'shannon@hak5.org'}
### data storage and history
ITEMS... | 26.545455 | 142 | 0.736301 | ### channel configuration
CHANNEL_NAME = 'ThreatWire'
CHANNEL_PLAYLIST_ID = 'PLW5y1tjAOzI0Sx4UU2fncEwQ9BQLr5Vlu'
ITEMS_TO_SCAN = 5
FG_YOUTUBE = 'https://www.youtube.com/channel/UC3s0BtrBJpwNDaflRSoiieQ' # channel link
FG_AUTHOR = {'name':'Shannon Morse','email':'shannon@hak5.org'}
### data storage and history
ITEMS... | 0 | 0 | 0 |
25659b11d01bf9d7aa939a9d338807126094201c | 3,640 | py | Python | examples/sas_interconnects.py | Manoj-M-97/python-hpOneView | 134f158f4fd857e7454383186f2975e8bb0568c8 | [
"MIT"
] | null | null | null | examples/sas_interconnects.py | Manoj-M-97/python-hpOneView | 134f158f4fd857e7454383186f2975e8bb0568c8 | [
"MIT"
] | null | null | null | examples/sas_interconnects.py | Manoj-M-97/python-hpOneView | 134f158f4fd857e7454383186f2975e8bb0568c8 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
###
# (C) Copyright (2012-2019) Hewlett Packard Enterprise Development LP
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limi... | 34.018692 | 96 | 0.709066 | # -*- coding: utf-8 -*-
###
# (C) Copyright (2012-2019) Hewlett Packard Enterprise Development LP
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limi... | 0 | 0 | 0 |
a83d95d0bdb34524a4d9657cff33c959ab96b482 | 19,189 | py | Python | src/apscheduler/datastores/async_/sqlalchemy.py | spaceack/apscheduler | ce5262c05a663677fd74a43c7a315bd5e3def902 | [
"MIT"
] | null | null | null | src/apscheduler/datastores/async_/sqlalchemy.py | spaceack/apscheduler | ce5262c05a663677fd74a43c7a315bd5e3def902 | [
"MIT"
] | null | null | null | src/apscheduler/datastores/async_/sqlalchemy.py | spaceack/apscheduler | ce5262c05a663677fd74a43c7a315bd5e3def902 | [
"MIT"
] | null | null | null | from __future__ import annotations
import json
import logging
from contextlib import AsyncExitStack, closing
from datetime import datetime, timedelta, timezone
from json import JSONDecodeError
from typing import Any, Callable, Dict, Iterable, List, Optional, Set, Tuple, Type, Union
from uuid import UUID
import sniffi... | 45.471564 | 99 | 0.614675 | from __future__ import annotations
import json
import logging
from contextlib import AsyncExitStack, closing
from datetime import datetime, timedelta, timezone
from json import JSONDecodeError
from typing import Any, Callable, Dict, Iterable, List, Optional, Set, Tuple, Type, Union
from uuid import UUID
import sniffi... | 16,222 | 1,549 | 68 |
054cd7fa94295f629465d6c8d8d5104a5b922b0f | 5,505 | py | Python | analysis/ConsensusAnalysis.py | glatard/narps | c5d0700de6dabfa9c090761ef4aa7c26f1c066c2 | [
"MIT"
] | null | null | null | analysis/ConsensusAnalysis.py | glatard/narps | c5d0700de6dabfa9c090761ef4aa7c26f1c066c2 | [
"MIT"
] | null | null | null | analysis/ConsensusAnalysis.py | glatard/narps | c5d0700de6dabfa9c090761ef4aa7c26f1c066c2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
"""
run consensus analysis to identify overall pattern
analysis method developed by T Nichols and J Mumford
"""
import os
import sys
import glob
import numpy
import nibabel
import nilearn.plotting
import nilearn.input_data
import matplotlib.pyplot as plt
from statsmodels.stats.mu... | 29.438503 | 78 | 0.592189 | #!/usr/bin/env python
# coding: utf-8
"""
run consensus analysis to identify overall pattern
analysis method developed by T Nichols and J Mumford
"""
import os
import sys
import glob
import numpy
import nibabel
import nilearn.plotting
import nilearn.input_data
import matplotlib.pyplot as plt
from statsmodels.stats.mu... | 3,236 | 0 | 46 |
48111bf76386d688236fee2e8fec8f616bedd277 | 687 | py | Python | tests/conftest.py | treyhunner/countdown | bee05652893aa3472c001a3eb270c9139bafe32c | [
"MIT"
] | 1 | 2022-01-12T07:28:25.000Z | 2022-01-12T07:28:25.000Z | tests/conftest.py | treyhunner/countdown | bee05652893aa3472c001a3eb270c9139bafe32c | [
"MIT"
] | 33 | 2021-12-30T00:16:08.000Z | 2022-03-31T07:33:26.000Z | tests/conftest.py | treyhunner/countdown-cli | bee05652893aa3472c001a3eb270c9139bafe32c | [
"MIT"
] | null | null | null | """PyTest configuration."""
from __future__ import annotations
from typing import Any
from _pytest.assertion import truncate
truncate.DEFAULT_MAX_LINES = 40
truncate.DEFAULT_MAX_CHARS = 40 * 80
| 24.535714 | 88 | 0.588064 | """PyTest configuration."""
from __future__ import annotations
from typing import Any
from _pytest.assertion import truncate
truncate.DEFAULT_MAX_LINES = 40
truncate.DEFAULT_MAX_CHARS = 40 * 80
def pytest_assertrepr_compare(
op: str,
left: Any,
right: Any,
) -> list[str] | None: # pragma: nocover
... | 468 | 0 | 23 |
5c13847f5b6842c147a8bcfea3eed5cfff7826be | 3,444 | py | Python | src/scenepic/mesh.py | microsoft/scenepic | e3fd2c6312fa670a92b7888962b6812c262c6759 | [
"MIT"
] | 28 | 2021-10-05T08:51:26.000Z | 2022-03-18T11:19:23.000Z | src/scenepic/mesh.py | microsoft/scenepic | e3fd2c6312fa670a92b7888962b6812c262c6759 | [
"MIT"
] | 17 | 2021-10-05T11:36:17.000Z | 2022-02-10T13:33:43.000Z | src/scenepic/mesh.py | microsoft/scenepic | e3fd2c6312fa670a92b7888962b6812c262c6759 | [
"MIT"
] | 2 | 2021-12-12T16:42:51.000Z | 2022-02-23T11:50:14.000Z | """Module which extends the scenepic Mesh type."""
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import numpy as np
from ._scenepic import Mesh, MeshUpdate
class VertexBuffer:
"""Class which provides dictionary access to vertex buffer blocks.
Description:
The different p... | 31.888889 | 104 | 0.64489 | """Module which extends the scenepic Mesh type."""
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
import numpy as np
from ._scenepic import Mesh, MeshUpdate
class VertexBuffer:
"""Class which provides dictionary access to vertex buffer blocks.
Description:
The different p... | 0 | 0 | 0 |
dee147bb1bd19ae8509dfa5dacb3a056e3445202 | 1,279 | py | Python | admin.py | zhengxinxing/bespeak_meal | 0c64d9389afb408e74353051569c5e1018752223 | [
"MIT"
] | null | null | null | admin.py | zhengxinxing/bespeak_meal | 0c64d9389afb408e74353051569c5e1018752223 | [
"MIT"
] | null | null | null | admin.py | zhengxinxing/bespeak_meal | 0c64d9389afb408e74353051569c5e1018752223 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.db import models
from django import forms
from bespeak_meal.models import Person, Person_category, Week_menu
admin.site.register(Person, PersonAdmin)
admin.site.register(Person_category, Person_categoryAdmin)
admin.site.register(Week_menu, Week_menuAdmin) | 29.068182 | 66 | 0.648944 | from django.contrib import admin
from django.db import models
from django import forms
from bespeak_meal.models import Person, Person_category, Week_menu
class PersonAdmin(admin.ModelAdmin):
list_display = ('name', 'category', 'remarks')
fieldsets = [
(None, {'fields': ['name']}),
('... | 38 | 1,009 | 92 |
21977069d3e5088253cd63c286fd5c97ffb85f66 | 204 | py | Python | dashboard/urls.py | dt-self-service/self-service-app | 36e1608c08917972344341886241c3d51ff6c885 | [
"MIT"
] | 2 | 2020-08-14T15:46:51.000Z | 2020-08-20T07:43:50.000Z | dashboard/urls.py | dt-self-service/self-service-app | 36e1608c08917972344341886241c3d51ff6c885 | [
"MIT"
] | 16 | 2020-06-14T17:16:48.000Z | 2021-12-13T20:48:58.000Z | dashboard/urls.py | dt-self-service/self-service-app | 36e1608c08917972344341886241c3d51ff6c885 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('', views.home, name='admin-home'),
path('tables/', views.tables, name='tables'),
path('get_tenant', views.get_tenant),
] | 25.5 | 49 | 0.666667 | from django.urls import path
from . import views
urlpatterns = [
path('', views.home, name='admin-home'),
path('tables/', views.tables, name='tables'),
path('get_tenant', views.get_tenant),
] | 0 | 0 | 0 |
07b277e7996093cb49581853b24656c92d364351 | 5,660 | py | Python | lib/python2.7/site-packages/appionlib/apRadon.py | leschzinerlab/myami-3.2-freeHand | 974b8a48245222de0d9cfb0f433533487ecce60d | [
"MIT"
] | null | null | null | lib/python2.7/site-packages/appionlib/apRadon.py | leschzinerlab/myami-3.2-freeHand | 974b8a48245222de0d9cfb0f433533487ecce60d | [
"MIT"
] | null | null | null | lib/python2.7/site-packages/appionlib/apRadon.py | leschzinerlab/myami-3.2-freeHand | 974b8a48245222de0d9cfb0f433533487ecce60d | [
"MIT"
] | 1 | 2019-09-05T20:58:37.000Z | 2019-09-05T20:58:37.000Z | #!/usr/bin/env python
import sys
import time
import math
import numpy
from scipy import ndimage
from pyami import imagefun
from appionlib import apDisplay
from appionlib.apImage import imagefile
#=========================
def classicradon(image, stepsize=2):
"""
computes Radon transform of image
"""
radonlist = ... | 28.019802 | 84 | 0.682155 | #!/usr/bin/env python
import sys
import time
import math
import numpy
from scipy import ndimage
from pyami import imagefun
from appionlib import apDisplay
from appionlib.apImage import imagefile
#=========================
def classicradon(image, stepsize=2):
"""
computes Radon transform of image
"""
radonlist = ... | 1,547 | 0 | 44 |
033d1509e978b1a962b5e1fddcf5d23c3c27e8e6 | 8,101 | py | Python | lagou/middlewares.py | JairusTse/lagou_spider | 37887bf8eb0fb80df4abd117dc5eb2f24b8a5312 | [
"MIT"
] | null | null | null | lagou/middlewares.py | JairusTse/lagou_spider | 37887bf8eb0fb80df4abd117dc5eb2f24b8a5312 | [
"MIT"
] | null | null | null | lagou/middlewares.py | JairusTse/lagou_spider | 37887bf8eb0fb80df4abd117dc5eb2f24b8a5312 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
# ua_list = [
# 'Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:47.0) Gecko/20100101 Firefox/47.0',
# ... | 56.65035 | 1,789 | 0.710283 | # -*- coding: utf-8 -*-
# Define here the models for your spider middleware
#
# See documentation in:
# https://docs.scrapy.org/en/latest/topics/spider-middleware.html
from scrapy import signals
class LagouSpiderMiddleware(object):
# Not all methods need to be defined. If a method is not defined,
# scrapy a... | 5,083 | 695 | 150 |
970e618696198330d69062cee61245ffe5bebcc4 | 2,475 | py | Python | backintime/market_data_storage/market_data_storage.py | akim-mukhtarov/backtesting | 2d0491b919885eeddd62c4079c9c7292381cb4f9 | [
"MIT"
] | null | null | null | backintime/market_data_storage/market_data_storage.py | akim-mukhtarov/backtesting | 2d0491b919885eeddd62c4079c9c7292381cb4f9 | [
"MIT"
] | null | null | null | backintime/market_data_storage/market_data_storage.py | akim-mukhtarov/backtesting | 2d0491b919885eeddd62c4079c9c7292381cb4f9 | [
"MIT"
] | null | null | null | from ..candles_providers import CandlesProvider
from ..candle_properties import CandleProperties
from ..timeframes import Timeframes
from .timeframe_values import TimeframeValues
from .float_generator import FloatGenerator
class MarketDataStorage:
"""
Stores historical market data that was reserved b... | 33 | 95 | 0.621818 | from ..candles_providers import CandlesProvider
from ..candle_properties import CandleProperties
from ..timeframes import Timeframes
from .timeframe_values import TimeframeValues
from .float_generator import FloatGenerator
class MarketDataStorage:
"""
Stores historical market data that was reserved b... | 107 | 0 | 27 |
5c8c52a3029a1ee7c398f84a284a8491329cff3d | 763 | py | Python | django/tiantian/utils/usermiddleware.py | zhang15780/web_project | 820708ae68f4d1bc06cdde4a86e40a5457c11df8 | [
"Apache-2.0"
] | null | null | null | django/tiantian/utils/usermiddleware.py | zhang15780/web_project | 820708ae68f4d1bc06cdde4a86e40a5457c11df8 | [
"Apache-2.0"
] | null | null | null | django/tiantian/utils/usermiddleware.py | zhang15780/web_project | 820708ae68f4d1bc06cdde4a86e40a5457c11df8 | [
"Apache-2.0"
] | null | null | null | import datetime
from django.http import HttpResponseRedirect
from django.utils.deprecation import MiddlewareMixin
from users.models import UserSession
| 29.346154 | 64 | 0.593709 | import datetime
from django.http import HttpResponseRedirect
from django.utils.deprecation import MiddlewareMixin
from users.models import UserSession
class AuthMiddleware(MiddlewareMixin):
def process_request(self, request):
ticket = request.COOKIES.get('ticket')
if not ticket:
re... | 542 | 17 | 49 |
5d74b09cb62947a39695f78253f454a7bc34429e | 5,816 | py | Python | pyscf/gto/ecp.py | mtreinish/pyscf | b3c86bc145c180230cb6aba81e9c47b5764aeec4 | [
"Apache-2.0"
] | 1 | 2021-01-24T13:35:42.000Z | 2021-01-24T13:35:42.000Z | pyscf/gto/ecp.py | holy0213/pyscf | aff8a94003cc47ff5e741ce648d877b008a0c59e | [
"Apache-2.0"
] | 36 | 2018-08-22T19:44:03.000Z | 2020-05-09T10:02:36.000Z | pyscf/gto/ecp.py | holy0213/pyscf | aff8a94003cc47ff5e741ce648d877b008a0c59e | [
"Apache-2.0"
] | 4 | 2018-02-14T16:28:28.000Z | 2019-08-12T16:40:30.000Z | #!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. 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
#
# U... | 33.234286 | 88 | 0.627407 | #!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. 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
#
# U... | 2,916 | 0 | 69 |
f73abc1e615309be1749df31916bc425ccea0619 | 352 | py | Python | setup.py | Ykobe/fingerid | 9c7cbeb3f0350c64a210c262e47264246dde4997 | [
"Apache-2.0"
] | 11 | 2015-10-08T07:19:05.000Z | 2020-05-27T12:10:31.000Z | setup.py | Ykobe/fingerid | 9c7cbeb3f0350c64a210c262e47264246dde4997 | [
"Apache-2.0"
] | 7 | 2016-05-25T21:37:28.000Z | 2018-10-03T09:37:31.000Z | setup.py | Ykobe/fingerid | 9c7cbeb3f0350c64a210c262e47264246dde4997 | [
"Apache-2.0"
] | 4 | 2018-11-20T01:07:05.000Z | 2020-01-12T11:36:14.000Z |
from setuptools import setup, find_packages
config = {
'description':'fingerid-package',
'author':'Huibin Shen',
'url':'project https://github.com/icdishb/fingerid',
'author_email':'huibin.shen@aalto.fi',
'version':'1.4',
'install_requires':['nose'],
'packages':find_packages(),
'name'... | 20.705882 | 56 | 0.644886 |
from setuptools import setup, find_packages
config = {
'description':'fingerid-package',
'author':'Huibin Shen',
'url':'project https://github.com/icdishb/fingerid',
'author_email':'huibin.shen@aalto.fi',
'version':'1.4',
'install_requires':['nose'],
'packages':find_packages(),
'name'... | 0 | 0 | 0 |
f7900d5a9d979ce44979ab77dce6b668305c892e | 10,251 | py | Python | brainspace/mesh/mesh_operations.py | josemariamoreira/BrainSpace | d7e8e65c6463a81146e7fcfcca902feef04d329d | [
"BSD-3-Clause"
] | null | null | null | brainspace/mesh/mesh_operations.py | josemariamoreira/BrainSpace | d7e8e65c6463a81146e7fcfcca902feef04d329d | [
"BSD-3-Clause"
] | null | null | null | brainspace/mesh/mesh_operations.py | josemariamoreira/BrainSpace | d7e8e65c6463a81146e7fcfcca902feef04d329d | [
"BSD-3-Clause"
] | null | null | null | """
Basic functions on surface meshes.
"""
# Author: Oualid Benkarim <oualid.benkarim@mcgill.ca>
# License: BSD 3 clause
import warnings
import numpy as np
from vtk import (vtkDataObject, vtkThreshold, vtkGeometryFilter,
vtkAppendPolyData)
from .array_operations import get_connected_components
fro... | 26.083969 | 80 | 0.63067 | """
Basic functions on surface meshes.
"""
# Author: Oualid Benkarim <oualid.benkarim@mcgill.ca>
# License: BSD 3 clause
import warnings
import numpy as np
from vtk import (vtkDataObject, vtkThreshold, vtkGeometryFilter,
vtkAppendPolyData)
from .array_operations import get_connected_components
fro... | 0 | 0 | 0 |
6e6c4bb0d8e1c54ef117d7ffe34d100e86242340 | 6,117 | py | Python | netdata/importer/protocol_graph.py | mincode/netdata | 4369a3bfb473509eff92083e03f214d5b75f6074 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | netdata/importer/protocol_graph.py | mincode/netdata | 4369a3bfb473509eff92083e03f214d5b75f6074 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | netdata/importer/protocol_graph.py | mincode/netdata | 4369a3bfb473509eff92083e03f214d5b75f6074 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | import psycopg2
import networkx
import logging
import math
from datetime import datetime, timezone
def log_info(msg):
"""
Print info log message.
:params msg: message text.
"""
logging.info(' ' + msg)
def log_debug(msg):
"""
Print debug log message.
:params msg: message text.
"""... | 30.738693 | 79 | 0.571849 | import psycopg2
import networkx
import logging
import math
from datetime import datetime, timezone
def log_info(msg):
"""
Print info log message.
:params msg: message text.
"""
logging.info(' ' + msg)
def log_debug(msg):
"""
Print debug log message.
:params msg: message text.
"""... | 590 | 0 | 54 |
151570e8807be229fb2172ad445b66e7ea21f516 | 7,410 | py | Python | markov_pilot/wrappers/varySetpointsWrapper.py | opt12/gym-jsbsim-eee | fa61d0d4679fd65b5736fc562fe268714b4e08d8 | [
"MIT"
] | 7 | 2020-11-10T07:33:40.000Z | 2021-06-23T07:25:43.000Z | markov_pilot/wrappers/varySetpointsWrapper.py | opt12/gym-jsbsim-eee | fa61d0d4679fd65b5736fc562fe268714b4e08d8 | [
"MIT"
] | null | null | null | markov_pilot/wrappers/varySetpointsWrapper.py | opt12/gym-jsbsim-eee | fa61d0d4679fd65b5736fc562fe268714b4e08d8 | [
"MIT"
] | 5 | 2020-07-12T00:10:59.000Z | 2021-06-22T09:13:13.000Z | #!/usr/bin/env python3
import sys
sys.path.append(r'/home/felix/git/gym-jsbsim-eee/') #TODO: Is this a good idea? Dunno! It works!
import gym
import numpy as np
import math
import random
import markov_pilot.environment.properties as prp
from abc import ABC, abstractmethod
from markov_pilot.environment.pr... | 42.83237 | 124 | 0.648988 | #!/usr/bin/env python3
import sys
sys.path.append(r'/home/felix/git/gym-jsbsim-eee/') #TODO: Is this a good idea? Dunno! It works!
import gym
import numpy as np
import math
import random
import markov_pilot.environment.properties as prp
from abc import ABC, abstractmethod
from markov_pilot.environment.pr... | 3,372 | 48 | 432 |