hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | 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 245 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | 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 245 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 2 1.02M | avg_line_length float64 1 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f70abea11c4ac66c4b8b1ef3a65628f1877a4566 | 3,940 | py | Python | guilded/ext/commands/context.py | DakshG07/KOOLIOMAN | 84d851f9d88e99e884dc6cc38a5638af0c29da9c | [
"MIT"
] | null | null | null | guilded/ext/commands/context.py | DakshG07/KOOLIOMAN | 84d851f9d88e99e884dc6cc38a5638af0c29da9c | [
"MIT"
] | null | null | null | guilded/ext/commands/context.py | DakshG07/KOOLIOMAN | 84d851f9d88e99e884dc6cc38a5638af0c29da9c | [
"MIT"
] | null | null | null | """
MIT License
Copyright (c) 2020-present shay (shayypy)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge,... | 36.82243 | 78 | 0.712944 |
import guilded.abc
class Context(guilded.abc.Messageable):
def __init__(self, **attrs):
self.message = attrs.pop('message', None)
self._state = attrs.pop('state', self.message._state)
self.bot = attrs.pop('bot', None)
self.args = attrs.pop('args', [])
self.kwargs = attrs.p... | true | true |
f70ac048c7ab163d01374fa17be97ba5e98dd62a | 5,492 | py | Python | ioos_qc/results.py | glos/ioos_qc | 17e69ad582275be7ad0f5a2af40c11d810b344e8 | [
"Apache-2.0"
] | 31 | 2019-10-09T15:08:38.000Z | 2022-01-21T23:45:22.000Z | ioos_qc/results.py | glos/ioos_qc | 17e69ad582275be7ad0f5a2af40c11d810b344e8 | [
"Apache-2.0"
] | 49 | 2019-10-09T18:58:29.000Z | 2022-02-08T22:52:34.000Z | ioos_qc/results.py | glos/ioos_qc | 17e69ad582275be7ad0f5a2af40c11d810b344e8 | [
"Apache-2.0"
] | 13 | 2019-10-08T19:47:34.000Z | 2022-03-19T18:42:25.000Z | #!/usr/bin/env python
# coding=utf-8
import logging
from typing import NamedTuple, List
from dataclasses import dataclass
from collections import OrderedDict as odict, defaultdict
import numpy as np
from ioos_qc.qartod import QartodFlags
L = logging.getLogger(__name__) # noqa
class CallResult(NamedTuple):
pack... | 33.284848 | 102 | 0.629825 | import logging
from typing import NamedTuple, List
from dataclasses import dataclass
from collections import OrderedDict as odict, defaultdict
import numpy as np
from ioos_qc.qartod import QartodFlags
L = logging.getLogger(__name__)
class CallResult(NamedTuple):
package: str
test: str
function: callabl... | true | true |
f70ac14f2dee5acf23ce8ff4dca5cf048c116003 | 7,350 | py | Python | getProductInfo.py | dongil618/Cafe24toSmartstore | 909e2cdf2927d5ecacb7a6484c84f18de67cb47e | [
"MIT"
] | null | null | null | getProductInfo.py | dongil618/Cafe24toSmartstore | 909e2cdf2927d5ecacb7a6484c84f18de67cb47e | [
"MIT"
] | null | null | null | getProductInfo.py | dongil618/Cafe24toSmartstore | 909e2cdf2927d5ecacb7a6484c84f18de67cb47e | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup as bs
import requests
from urllib.request import urlopen
from urllib.parse import quote
import re
import time
def getProductInfo(productNameIndex):
headers = {"User-Agent": "Mozilla/5.0"}
color = []
size = []
price = ""
instruction = ""
sizeGuide = ""
category... | 37.692308 | 90 | 0.460408 | from bs4 import BeautifulSoup as bs
import requests
from urllib.request import urlopen
from urllib.parse import quote
import re
import time
def getProductInfo(productNameIndex):
headers = {"User-Agent": "Mozilla/5.0"}
color = []
size = []
price = ""
instruction = ""
sizeGuide = ""
category... | true | true |
f70ac22e6b088bf21a6bc6c89c1e2ab6834b5bfe | 5,592 | py | Python | alchemist_py/project_manager.py | Kenta11/alchemist_py | 49d013dde4688f663eb2d35519347047739ecace | [
"MIT"
] | null | null | null | alchemist_py/project_manager.py | Kenta11/alchemist_py | 49d013dde4688f663eb2d35519347047739ecace | [
"MIT"
] | 1 | 2021-08-04T14:14:09.000Z | 2021-08-04T14:14:09.000Z | alchemist_py/project_manager.py | Kenta11/alchemist_py | 49d013dde4688f663eb2d35519347047739ecace | [
"MIT"
] | 1 | 2021-07-15T07:05:42.000Z | 2021-07-15T07:05:42.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import git
import os
import re
import sys
import toml
from pathlib import Path
from alchemist_py.brokergen import createProject
from alchemist_py.deviceinfo import searchDevice
from alchemist_py.plugin_manager import PluginManager
class Manager(object):
def __init_... | 34.732919 | 240 | 0.505722 |
import git
import os
import re
import sys
import toml
from pathlib import Path
from alchemist_py.brokergen import createProject
from alchemist_py.deviceinfo import searchDevice
from alchemist_py.plugin_manager import PluginManager
class Manager(object):
def __init__(self):
config = toml.load(open("Alche... | true | true |
f70ac248b9ef28a76627a9460455648ecfe49916 | 1,177 | py | Python | src/services/incomesService.py | TTIP-UNQ-Team6/gastapp_back | 0613aba610f765b55cb3bb10fec4d0d5f3685f88 | [
"MIT"
] | null | null | null | src/services/incomesService.py | TTIP-UNQ-Team6/gastapp_back | 0613aba610f765b55cb3bb10fec4d0d5f3685f88 | [
"MIT"
] | null | null | null | src/services/incomesService.py | TTIP-UNQ-Team6/gastapp_back | 0613aba610f765b55cb3bb10fec4d0d5f3685f88 | [
"MIT"
] | null | null | null | import pymongo
from bson import ObjectId
from src.services import config
collection = config.db.incomes
def search_by_user_email(user_email, itype):
return collection.find({"user_email": user_email, "itype": itype})
def sum_amounts_by_user(user_email, itype):
pipeline = [{"$match": {"user_email": user_ema... | 24.020408 | 130 | 0.634664 | import pymongo
from bson import ObjectId
from src.services import config
collection = config.db.incomes
def search_by_user_email(user_email, itype):
return collection.find({"user_email": user_email, "itype": itype})
def sum_amounts_by_user(user_email, itype):
pipeline = [{"$match": {"user_email": user_ema... | true | true |
f70ac2d9c5ad8d01fcd7341073e93a56903015f3 | 737 | py | Python | Operations/SC_DFA.py | ClarkLabUVA/hctsa-py | 4382a7e852d21cdfefdac1a4a09ea6e11abd9be1 | [
"MIT"
] | 6 | 2020-08-14T00:16:19.000Z | 2022-01-20T05:49:12.000Z | Operations/SC_DFA.py | fairscape/hctsa-py | 4382a7e852d21cdfefdac1a4a09ea6e11abd9be1 | [
"MIT"
] | null | null | null | Operations/SC_DFA.py | fairscape/hctsa-py | 4382a7e852d21cdfefdac1a4a09ea6e11abd9be1 | [
"MIT"
] | 4 | 2020-08-14T00:22:45.000Z | 2021-02-18T05:31:14.000Z | def SC_DFA(y):
N = len(y)
tau = int(np.floor(N/2))
y = y - np.mean(y)
x = np.cumsum(y)
taus = np.arange(5,tau+1)
ntau = len(taus)
F = np.zeros(ntau)
for i in range(ntau):
t = int(taus[i])
x_buff = x[:N - N % t]
x_buff = x_buff.reshape((int(N / t),t))
... | 14.45098 | 69 | 0.464043 | def SC_DFA(y):
N = len(y)
tau = int(np.floor(N/2))
y = y - np.mean(y)
x = np.cumsum(y)
taus = np.arange(5,tau+1)
ntau = len(taus)
F = np.zeros(ntau)
for i in range(ntau):
t = int(taus[i])
x_buff = x[:N - N % t]
x_buff = x_buff.reshape((int(N / t),t))
... | true | true |
f70ac35da3aea0122566e6991b7d2d9cdf82c5b6 | 473 | py | Python | chemreg/utils/management/commands/lint.py | Chemical-Curation/chemcurator | bcd7fab84e407f06502e6873c38820724d4e54e7 | [
"MIT"
] | 1 | 2020-10-05T18:02:24.000Z | 2020-10-05T18:02:24.000Z | chemreg/utils/management/commands/lint.py | Chemical-Curation/chemcurator_django | bcd7fab84e407f06502e6873c38820724d4e54e7 | [
"MIT"
] | 207 | 2020-01-30T19:17:44.000Z | 2021-02-24T19:45:29.000Z | chemreg/utils/management/commands/lint.py | Chemical-Curation/chemcurator_django | bcd7fab84e407f06502e6873c38820724d4e54e7 | [
"MIT"
] | null | null | null | import subprocess
from django.conf import settings
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = "Automatically fixes formatting issues and reports any other linting errors"
def handle(self, *args, **options):
subprocess.run(["isort", "--apply", "--quiet"], c... | 33.785714 | 87 | 0.701903 | import subprocess
from django.conf import settings
from django.core.management.base import BaseCommand
class Command(BaseCommand):
help = "Automatically fixes formatting issues and reports any other linting errors"
def handle(self, *args, **options):
subprocess.run(["isort", "--apply", "--quiet"], c... | true | true |
f70ac41ed03f636596fe6dd578ad492699f6b41c | 410 | py | Python | template_extends/template_extends/wsgi.py | BillionsRichard/pycharmWorkspace | 709e2681fc6d85ff52fb25717215a365f51073aa | [
"Apache-2.0"
] | null | null | null | template_extends/template_extends/wsgi.py | BillionsRichard/pycharmWorkspace | 709e2681fc6d85ff52fb25717215a365f51073aa | [
"Apache-2.0"
] | null | null | null | template_extends/template_extends/wsgi.py | BillionsRichard/pycharmWorkspace | 709e2681fc6d85ff52fb25717215a365f51073aa | [
"Apache-2.0"
] | null | null | null | """
WSGI config for template_extends project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJ... | 24.117647 | 78 | 0.795122 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "template_extends.settings")
application = get_wsgi_application()
| true | true |
f70ac69af650810765016d290bfa000e9f4b2f74 | 30,759 | py | Python | tests/test_assets.py | semio/zipline | f13e9fd1253a500771bf10217b1d37031272c03c | [
"Apache-2.0"
] | null | null | null | tests/test_assets.py | semio/zipline | f13e9fd1253a500771bf10217b1d37031272c03c | [
"Apache-2.0"
] | null | null | null | tests/test_assets.py | semio/zipline | f13e9fd1253a500771bf10217b1d37031272c03c | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2015 Quantopian, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 35.933411 | 79 | 0.559934 |
import sys
from unittest import TestCase
from datetime import datetime, timedelta
import pickle
import uuid
import warnings
import pandas as pd
from pandas.tseries.tools import normalize_date
from pandas.util.testing import assert_frame_equal
from nose_parameterized import parameterized
from numpy import full
fro... | true | true |
f70ac6e62fb9f9e5e0c7c2c31fe3b1b5c0bbd9d6 | 539 | py | Python | manage.py | Yaawei/allfeed | 1739c975e541eead4c14b7b4fc28ccf755c356f3 | [
"MIT"
] | null | null | null | manage.py | Yaawei/allfeed | 1739c975e541eead4c14b7b4fc28ccf755c356f3 | [
"MIT"
] | null | null | null | manage.py | Yaawei/allfeed | 1739c975e541eead4c14b7b4fc28ccf755c356f3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "allfeed.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are ... | 33.6875 | 73 | 0.686456 | import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "allfeed.settings")
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise ImportError(
"Couldn't import Django. Are you sure it's installe... | true | true |
f70ac71ee9ad98039917cae3b7458fec58f7ca1d | 760 | py | Python | mvpsite/users/constants.py | mianamir/advance_django_rest_framework_project | 3870f2dbe7b585a236928f90c1792cd337ce8911 | [
"MIT"
] | null | null | null | mvpsite/users/constants.py | mianamir/advance_django_rest_framework_project | 3870f2dbe7b585a236928f90c1792cd337ce8911 | [
"MIT"
] | null | null | null | mvpsite/users/constants.py | mianamir/advance_django_rest_framework_project | 3870f2dbe7b585a236928f90c1792cd337ce8911 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
__author__ = "Amir Savvy"
__copyright__ = "Copyright 2021, MVP Vending Machine Project"
__credits__ = ["amir savvy"]
__license__ = "GPL"
__version__ = "1.0.1"
__maintainer__ = "Amir Savvy"
__email__ = "mianamirlahore@gmail.com"
__status__ = "Production"
# User info
TEST_NORMAL_USER_EMAIL = f"n... | 21.111111 | 61 | 0.717105 |
__author__ = "Amir Savvy"
__copyright__ = "Copyright 2021, MVP Vending Machine Project"
__credits__ = ["amir savvy"]
__license__ = "GPL"
__version__ = "1.0.1"
__maintainer__ = "Amir Savvy"
__email__ = "mianamirlahore@gmail.com"
__status__ = "Production"
TEST_NORMAL_USER_EMAIL = f"normal@user.com"
TEST_SUPER_USER_EM... | true | true |
f70ac738976aa113d492dc6d741bdbfabbc75b3f | 852 | py | Python | air_pollution_death_rate_related/scripts/air_pollution/feature_generating.py | nghitrampham/air_pollution_death_rate_related | 3fd72b9684e8362de5706ba37c1d90b844d4afe0 | [
"MIT"
] | null | null | null | air_pollution_death_rate_related/scripts/air_pollution/feature_generating.py | nghitrampham/air_pollution_death_rate_related | 3fd72b9684e8362de5706ba37c1d90b844d4afe0 | [
"MIT"
] | 15 | 2019-12-10T02:05:58.000Z | 2022-03-12T00:06:38.000Z | air_pollution_death_rate_related/scripts/air_pollution/feature_generating.py | nghitrampham/CSE583_FinalProject | 3fd72b9684e8362de5706ba37c1d90b844d4afe0 | [
"MIT"
] | 1 | 2020-06-04T17:48:21.000Z | 2020-06-04T17:48:21.000Z | """
This module is mainly used to conduct feature engineering for predicting air quality index model
"""
import warnings
import helpers
warnings.filterwarnings('ignore')
if __name__ == '__main__':
PATH = r'air_pollution_death_rate_related/data/data_air_raw/daily_aqi_by_county_'
### use most recent 3 years to ... | 42.6 | 96 | 0.725352 | import warnings
import helpers
warnings.filterwarnings('ignore')
if __name__ == '__main__':
PATH = r'air_pollution_death_rate_related/data/data_air_raw/daily_aqi_by_county_'
RAW_DATA = helpers.read_raw_data(PATH, [2016, 2017, 2018])
DATA = helpers.data_cleaning(RAW_DATA)
for county_name in list(D... | true | true |
f70ac98cc6fb632c2f2d00ce1693c59f019da7a1 | 2,537 | py | Python | xlsxwriter/test/comparison/test_autofilter09.py | Aeon1/XlsxWriter | 6871b6c3fe6c294632054ea91f23d9e27068bcc1 | [
"BSD-2-Clause-FreeBSD"
] | 2 | 2019-07-25T06:08:09.000Z | 2019-11-01T02:33:56.000Z | xlsxwriter/test/comparison/test_autofilter09.py | Aeon1/XlsxWriter | 6871b6c3fe6c294632054ea91f23d9e27068bcc1 | [
"BSD-2-Clause-FreeBSD"
] | 13 | 2019-07-14T00:29:05.000Z | 2019-11-26T06:16:46.000Z | xlsxwriter/test/comparison/test_autofilter09.py | Aeon1/XlsxWriter | 6871b6c3fe6c294632054ea91f23d9e27068bcc1 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2019, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | 28.829545 | 79 | 0.551439 |
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
def setUp(self):
self.set_filename('autofilter09.xlsx')
self.set_text_file('autofilter_data.txt')
def test_create_file(self):
workbook = Workbo... | true | true |
f70ac9c888e434188cbef3a72ff9b7b53e5fafd7 | 6,079 | py | Python | moai/metadata/didl.py | TPY17/moai | 6a57069489bcbb0d084f3220bfae5b5d7aac945d | [
"BSD-3-Clause"
] | 10 | 2015-05-10T21:23:04.000Z | 2020-07-01T05:49:15.000Z | moai/metadata/didl.py | TPY17/moai | 6a57069489bcbb0d084f3220bfae5b5d7aac945d | [
"BSD-3-Clause"
] | 4 | 2015-01-13T20:53:51.000Z | 2022-03-15T10:28:51.000Z | moai/metadata/didl.py | TPY17/moai | 6a57069489bcbb0d084f3220bfae5b5d7aac945d | [
"BSD-3-Clause"
] | 11 | 2015-04-08T13:29:28.000Z | 2021-06-25T10:31:27.000Z |
from lxml.builder import ElementMaker
from moai.metadata.mods import NL_MODS, XSI_NS
class DIDL(object):
"""A metadata prefix implementing the DARE DIDL metadata format
this format is registered under the name "didl"
Note that this format re-uses oai_dc and mods formats that come with
MOAI b... | 39.474026 | 124 | 0.481165 |
from lxml.builder import ElementMaker
from moai.metadata.mods import NL_MODS, XSI_NS
class DIDL(object):
def __init__(self, prefix, config, db):
self.prefix = prefix
self.config = config
self.db = db
self.ns = {'didl': "urn:mpeg:mpeg21:2002:02-DIDL-NS",
... | true | true |
f70acb1d9d6ab4d5e2a9f26d917e68d79dd1a235 | 4,081 | py | Python | pyleecan/Generator/run_generate_classes.py | stephane-eisen/pyleecan | 8444b8131c9eff11a616da8277fb1f280c8f70e5 | [
"Apache-2.0"
] | 1 | 2021-07-08T01:27:24.000Z | 2021-07-08T01:27:24.000Z | pyleecan/Generator/run_generate_classes.py | ecs-kev/pyleecan | 1faedde4b24acc6361fa1fdd4e980eaec4ca3a62 | [
"Apache-2.0"
] | null | null | null | pyleecan/Generator/run_generate_classes.py | ecs-kev/pyleecan | 1faedde4b24acc6361fa1fdd4e980eaec4ca3a62 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import sys
from os.path import dirname, abspath, normpath, join, realpath
from os import listdir, remove, system
import json
from datetime import datetime
begin = len(normpath(abspath(join(dirname(__file__), "../.."))))
end = len(normpath(abspath(join(dirname(__file__), ".."))))
MAIN_DIR = dir... | 34.880342 | 109 | 0.626562 | import sys
from os.path import dirname, abspath, normpath, join, realpath
from os import listdir, remove, system
import json
from datetime import datetime
begin = len(normpath(abspath(join(dirname(__file__), "../.."))))
end = len(normpath(abspath(join(dirname(__file__), ".."))))
MAIN_DIR = dirname(realpath(__file__))... | true | true |
f70accc5c7667aed9b51008137aea4509675a89c | 432 | py | Python | CONTENT/DS-n-Algos/ALGO/__PYTHON/word_count.py | Bryan-Guner-Backup/DS-ALGO-OFFICIAL | 2ef3b4518389274da25f526c928d880b4e4ec26f | [
"Apache-2.0"
] | null | null | null | CONTENT/DS-n-Algos/ALGO/__PYTHON/word_count.py | Bryan-Guner-Backup/DS-ALGO-OFFICIAL | 2ef3b4518389274da25f526c928d880b4e4ec26f | [
"Apache-2.0"
] | null | null | null | CONTENT/DS-n-Algos/ALGO/__PYTHON/word_count.py | Bryan-Guner-Backup/DS-ALGO-OFFICIAL | 2ef3b4518389274da25f526c928d880b4e4ec26f | [
"Apache-2.0"
] | null | null | null | file=open("sample.txt","r")
d=dict()
for lines in file:
lines=lines.strip()
lines=lines.lower()
words=lines.split(" ")
for word in words:
if word in d:
d[word]=d[word]+1
else:
d[word]=1
find=str(input("enter the word to count: "))
find=find.lower()... | 22.736842 | 45 | 0.534722 | file=open("sample.txt","r")
d=dict()
for lines in file:
lines=lines.strip()
lines=lines.lower()
words=lines.split(" ")
for word in words:
if word in d:
d[word]=d[word]+1
else:
d[word]=1
find=str(input("enter the word to count: "))
find=find.lower()... | true | true |
f70acd48249c6db38e2012a0abcc3a8d09d9c8f7 | 2,069 | py | Python | pybamm/models/submodels/thermal/x_full/x_full_no_current_collector.py | danieljtait/PyBaMM | f9d6143770e4a01099f06e3574142424730f731a | [
"BSD-3-Clause"
] | null | null | null | pybamm/models/submodels/thermal/x_full/x_full_no_current_collector.py | danieljtait/PyBaMM | f9d6143770e4a01099f06e3574142424730f731a | [
"BSD-3-Clause"
] | null | null | null | pybamm/models/submodels/thermal/x_full/x_full_no_current_collector.py | danieljtait/PyBaMM | f9d6143770e4a01099f06e3574142424730f731a | [
"BSD-3-Clause"
] | null | null | null | #
# Class for full thermal submodel
#
import pybamm
from .base_x_full import BaseModel
class NoCurrentCollector(BaseModel):
"""Class for full x-direction thermal submodel without current collectors
Parameters
----------
param : parameter class
The parameters to use for this submodel
**... | 28.736111 | 78 | 0.569841 | import pybamm
from .base_x_full import BaseModel
class NoCurrentCollector(BaseModel):
def __init__(self, param):
super().__init__(param)
def set_rhs(self, variables):
T = variables["Cell temperature"]
q = variables["Heat flux"]
Q = variables["Total heating"]
self.rh... | true | true |
f70acd8bcb229f5b9f12c1e63b3ec56b34848bb9 | 1,023 | py | Python | leetcode/array/medium/combinationSum.py | joway/PyAlgorithm | 0420fbcbebad3b746db63b9e9a5878b4af8ad6ac | [
"MIT"
] | 1 | 2016-08-23T14:24:44.000Z | 2016-08-23T14:24:44.000Z | leetcode/array/medium/combinationSum.py | joway/PyAlgorithm | 0420fbcbebad3b746db63b9e9a5878b4af8ad6ac | [
"MIT"
] | null | null | null | leetcode/array/medium/combinationSum.py | joway/PyAlgorithm | 0420fbcbebad3b746db63b9e9a5878b4af8ad6ac | [
"MIT"
] | null | null | null | """ Summary
"""
class Solution(object):
"""
Problem:
https://leetcode.com/problems/combination-sum/
Example:
given candidate set [2, 3, 6, 7] and target 7,
A solution set is:
[
[7],
[2, 2, 3]
]
"""
def combinationSum(self, candidates, t... | 21.765957 | 96 | 0.474096 |
class Solution(object):
def combinationSum(self, candidates, target):
candidates.sort()
rets = []
for i in candidates:
if i > target:
break
elif i == target:
rets.append([i])
else:
rets += ([sorted([i] + x... | true | true |
f70ace3bc9ff4b2e0804d716b66fba3887fa8cf9 | 582 | py | Python | kpop_project/data_preprocessing_execution.py | chunjuihsu/chunjuihsu.github.io | 2256b7d340393351a484215f3d23841944d4b3ea | [
"CC-BY-3.0"
] | null | null | null | kpop_project/data_preprocessing_execution.py | chunjuihsu/chunjuihsu.github.io | 2256b7d340393351a484215f3d23841944d4b3ea | [
"CC-BY-3.0"
] | null | null | null | kpop_project/data_preprocessing_execution.py | chunjuihsu/chunjuihsu.github.io | 2256b7d340393351a484215f3d23841944d4b3ea | [
"CC-BY-3.0"
] | null | null | null | import pandas as pd
import youtube_api_comments_to_mongodb as ym
import text_classification_and_sentiment_analysis as ta
dbpw = 'kpop'
collection_name = 'comments'
data = ym.mongo_to_dataframe(dbpw, collection_name)
allcomments, englishcomments = ta.dataframe_preparation(data)
tt_set, englishcomments =... | 30.631579 | 78 | 0.752577 | import pandas as pd
import youtube_api_comments_to_mongodb as ym
import text_classification_and_sentiment_analysis as ta
dbpw = 'kpop'
collection_name = 'comments'
data = ym.mongo_to_dataframe(dbpw, collection_name)
allcomments, englishcomments = ta.dataframe_preparation(data)
tt_set, englishcomments =... | true | true |
f70acec2724ccc45198a62b6a42519afcda8cad5 | 205 | py | Python | basic-lang-fun/oop.py | diegopacheco/python-playground | 8e6ba427df6922fb578c2328babbf3466687ccbf | [
"Unlicense"
] | null | null | null | basic-lang-fun/oop.py | diegopacheco/python-playground | 8e6ba427df6922fb578c2328babbf3466687ccbf | [
"Unlicense"
] | null | null | null | basic-lang-fun/oop.py | diegopacheco/python-playground | 8e6ba427df6922fb578c2328babbf3466687ccbf | [
"Unlicense"
] | null | null | null | class Person:
def __init__(self, name, age):
self.name = name
self.age = age
def __str__(self):
return "{" + self.name + " " + str(self.age) + "}"
p1 = Person("John", 36)
print(p1) | 18.636364 | 58 | 0.556098 | class Person:
def __init__(self, name, age):
self.name = name
self.age = age
def __str__(self):
return "{" + self.name + " " + str(self.age) + "}"
p1 = Person("John", 36)
print(p1) | true | true |
f70acf373ecdb330c0ce11c3f2115bd7f4f066b1 | 6,494 | py | Python | toolbox/sampling/__init__.py | keunhong/toolbox | e8d1dadab4d9ccf8d78fe86ea933819ac6a07fca | [
"MIT"
] | null | null | null | toolbox/sampling/__init__.py | keunhong/toolbox | e8d1dadab4d9ccf8d78fe86ea933819ac6a07fca | [
"MIT"
] | null | null | null | toolbox/sampling/__init__.py | keunhong/toolbox | e8d1dadab4d9ccf8d78fe86ea933819ac6a07fca | [
"MIT"
] | null | null | null | import logging
import random
from typing import List, Tuple
import numpy as np
from skimage.transform import resize
from scipy.ndimage import zoom
from toolbox import images
from toolbox.images import crop, mask_bbox
from .poisson_disk import sample_poisson_uniform
logger = logging.getLogger(__name__)
class PatchT... | 33.474227 | 82 | 0.59963 | import logging
import random
from typing import List, Tuple
import numpy as np
from skimage.transform import resize
from scipy.ndimage import zoom
from toolbox import images
from toolbox.images import crop, mask_bbox
from .poisson_disk import sample_poisson_uniform
logger = logging.getLogger(__name__)
class PatchT... | true | true |
f70acf587d8569458f8fa30ddf05f354f81bb523 | 3,453 | py | Python | SCANNER_FTX_PERP.py | medialandstudio/bias | 9548a2b66c0134c797fa3d00de3711cfef9dbb70 | [
"MIT"
] | null | null | null | SCANNER_FTX_PERP.py | medialandstudio/bias | 9548a2b66c0134c797fa3d00de3711cfef9dbb70 | [
"MIT"
] | null | null | null | SCANNER_FTX_PERP.py | medialandstudio/bias | 9548a2b66c0134c797fa3d00de3711cfef9dbb70 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 7 12:02:50 2021
@author: ministudio
"""
from datetime import datetime, timezone
import pandas as pd
import numpy as np
from alive_progress import alive_bar
def get_all_futures(ftx_client):
tickers = ftx_client.fetchMarkets()
list_perp =[... | 37.532609 | 135 | 0.515204 |
from datetime import datetime, timezone
import pandas as pd
import numpy as np
from alive_progress import alive_bar
def get_all_futures(ftx_client):
tickers = ftx_client.fetchMarkets()
list_perp =[]
for ticker in tickers:
if 'PERP' in ticker['id']:
list_perp.append(ticker['i... | true | true |
f70ad0a021e9df323e1559c8795babc352e2834b | 144 | py | Python | app/http/http_statuses.py | dimamik/AGH_Learning_Cards | bef1ce8e763fb7b21058f918ec6f02be41bb7a11 | [
"PostgreSQL",
"MIT"
] | null | null | null | app/http/http_statuses.py | dimamik/AGH_Learning_Cards | bef1ce8e763fb7b21058f918ec6f02be41bb7a11 | [
"PostgreSQL",
"MIT"
] | null | null | null | app/http/http_statuses.py | dimamik/AGH_Learning_Cards | bef1ce8e763fb7b21058f918ec6f02be41bb7a11 | [
"PostgreSQL",
"MIT"
] | null | null | null | HTTP_OK = 200
HTTP_CREATED = 201
HTTP_NO_CONTENT = 204
HTTP_BAD_REQUEST = 400
HTTP_UNAUTHORIZED = 401
HTTP_NOT_FOUND = 404
HTTP_CONFLICT = 409
| 16 | 23 | 0.798611 | HTTP_OK = 200
HTTP_CREATED = 201
HTTP_NO_CONTENT = 204
HTTP_BAD_REQUEST = 400
HTTP_UNAUTHORIZED = 401
HTTP_NOT_FOUND = 404
HTTP_CONFLICT = 409
| true | true |
f70ad21fcb02d7452db608ef78fa61ed151d9c8f | 1,560 | py | Python | Cryptocurrency/Dashcoin/dash-gbp.py | uberfastman/bitbar-plugins | b61903dc31360d67c63ed24abdba3ba71ace3d56 | [
"MIT"
] | null | null | null | Cryptocurrency/Dashcoin/dash-gbp.py | uberfastman/bitbar-plugins | b61903dc31360d67c63ed24abdba3ba71ace3d56 | [
"MIT"
] | 1 | 2019-11-21T07:31:36.000Z | 2019-11-21T07:31:36.000Z | Cryptocurrency/Dashcoin/dash-gbp.py | uberfastman/bitbar-plugins | b61903dc31360d67c63ed24abdba3ba71ace3d56 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# coding=utf-8
#
# <bitbar.title>Dashcoin Ticker (£1GBP)</bitbar.title>
# <bitbar.version>v1.0</bitbar.version>
# <bitbar.author>impshum</bitbar.author>
# <bitbar.author.github>impshum</bitbar.author.github>
# <bitbar.desc>Displays current Dashcoin price for £1 from Coinmarketcap</bitbar.desc>
# <bitb... | 60 | 494 | 0.830769 |
from urllib import urlopen
url = urlopen('https://coinmarketcap-nexuist.rhcloud.com/api/dash').read()
import json
result = json.loads(url)
def flow():
if result ['change'] > '0':
print (' £%.4f | image=iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABmJLR0QAyQACAALwzISXAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAB3R... | true | true |
f70ad326400c79c347d2103ccb8c135960a427fe | 3,622 | py | Python | e2e/Tests/Consensus/Verification/UnknownInBlockTest.py | kayabaNerve/Currency | 260ebc20f1704f42ad6183fee39ad58ec6d07961 | [
"CC0-1.0"
] | 66 | 2019-01-14T08:39:52.000Z | 2022-01-06T11:39:15.000Z | e2e/Tests/Consensus/Verification/UnknownInBlockTest.py | kayabaNerve/Currency | 260ebc20f1704f42ad6183fee39ad58ec6d07961 | [
"CC0-1.0"
] | 228 | 2019-01-16T15:42:44.000Z | 2022-02-05T07:48:07.000Z | e2e/Tests/Consensus/Verification/UnknownInBlockTest.py | kayabaNerve/Currency | 260ebc20f1704f42ad6183fee39ad58ec6d07961 | [
"CC0-1.0"
] | 19 | 2019-01-14T08:53:04.000Z | 2021-11-03T20:19:28.000Z | #Tests proper handling of Verifications with Transactions which don't exist.
from typing import Dict, List, Any
import json
from pytest import raises
from e2e.Libs.Minisketch import Sketch
from e2e.Classes.Merit.Block import Block
from e2e.Classes.Merit.Merit import Merit
from e2e.Classes.Consensus.VerificationPack... | 35.861386 | 114 | 0.67725 |
from typing import Dict, List, Any
import json
from pytest import raises
from e2e.Libs.Minisketch import Sketch
from e2e.Classes.Merit.Block import Block
from e2e.Classes.Merit.Merit import Merit
from e2e.Classes.Consensus.VerificationPacket import VerificationPacket
from e2e.Meros.RPC import RPC
from e2e.Meros.Me... | true | true |
f70ad3439734e192b877fd56e646278509bf7ab3 | 5,191 | py | Python | epytope/Data/pssms/arb/mat/B_4002_10.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 7 | 2021-02-01T18:11:28.000Z | 2022-01-31T19:14:07.000Z | epytope/Data/pssms/arb/mat/B_4002_10.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 22 | 2021-01-02T15:25:23.000Z | 2022-03-14T11:32:53.000Z | epytope/Data/pssms/arb/mat/B_4002_10.py | christopher-mohr/epytope | 8ac9fe52c0b263bdb03235a5a6dffcb72012a4fd | [
"BSD-3-Clause"
] | 4 | 2021-05-28T08:50:38.000Z | 2022-03-14T11:45:32.000Z | B_4002_10 = {0: {'A': 0.22337100816803507, 'C': -0.08721732138853625, 'E': -0.05776024940539231, 'D': -0.8062336491499029, 'G': -0.22235775138309136, 'F': 0.41616940014979253, 'I': -0.2625598958640791, 'H': -0.2842266678402531, 'K': -0.11806916630138095, 'M': 0.3503963704784862, 'L': -0.11175681610077592, 'N': -0.65597... | 5,191 | 5,191 | 0.695434 | B_4002_10 = {0: {'A': 0.22337100816803507, 'C': -0.08721732138853625, 'E': -0.05776024940539231, 'D': -0.8062336491499029, 'G': -0.22235775138309136, 'F': 0.41616940014979253, 'I': -0.2625598958640791, 'H': -0.2842266678402531, 'K': -0.11806916630138095, 'M': 0.3503963704784862, 'L': -0.11175681610077592, 'N': -0.65597... | true | true |
f70ad3c71c856f0bf20b70565cd7cc3539e3b885 | 1,071 | py | Python | examples/ethercat/ecat_load_save_config.py | ingeniamc/ingenialink-python | 6011931697e48456f5638c2848303aac2e5bcb75 | [
"MIT"
] | 15 | 2017-08-30T13:43:14.000Z | 2022-03-29T07:04:30.000Z | examples/ethercat/ecat_load_save_config.py | ingeniamc/ingenialink-python | 6011931697e48456f5638c2848303aac2e5bcb75 | [
"MIT"
] | 11 | 2017-08-28T11:23:18.000Z | 2022-03-28T23:48:11.000Z | examples/ethercat/ecat_load_save_config.py | ingeniamc/ingenialink-python | 6011931697e48456f5638c2848303aac2e5bcb75 | [
"MIT"
] | 9 | 2017-09-30T08:28:42.000Z | 2022-03-12T19:11:43.000Z | import sys
from ingenialink.ethercat.network import EthercatNetwork
def connect_slave():
net = EthercatNetwork("\\Device\\NPF_{192D1D2F-C684-467D-A637-EC07BD434A63}")
servo = net.connect_to_slave(
target=1,
dictionary='../../resources/dictionaries/cap-net-e_eoe_0.7.1.xdf')
return servo, n... | 28.184211 | 81 | 0.722689 | import sys
from ingenialink.ethercat.network import EthercatNetwork
def connect_slave():
net = EthercatNetwork("\\Device\\NPF_{192D1D2F-C684-467D-A637-EC07BD434A63}")
servo = net.connect_to_slave(
target=1,
dictionary='../../resources/dictionaries/cap-net-e_eoe_0.7.1.xdf')
return servo, n... | true | true |
f70ad3db5e51eb1972ea537132216676ff99ecf8 | 917 | py | Python | test/python/importer/jit_ir/node_import/function-block-arg-adjustment.py | denolf/torch-mlir | d3a4a7f5d40e11f5dc3fb33fcfee4c2305ccb7c3 | [
"Apache-2.0"
] | 213 | 2021-09-24T03:26:53.000Z | 2022-03-30T07:11:48.000Z | test/python/importer/jit_ir/node_import/function-block-arg-adjustment.py | denolf/torch-mlir | d3a4a7f5d40e11f5dc3fb33fcfee4c2305ccb7c3 | [
"Apache-2.0"
] | 247 | 2021-09-23T18:49:45.000Z | 2022-03-31T17:19:02.000Z | test/python/importer/jit_ir/node_import/function-block-arg-adjustment.py | denolf/torch-mlir | d3a4a7f5d40e11f5dc3fb33fcfee4c2305ccb7c3 | [
"Apache-2.0"
] | 68 | 2021-09-23T18:23:20.000Z | 2022-03-29T11:18:58.000Z | # -*- Python -*-
# This file is licensed under a pytorch-style license
# See LICENSE.pytorch for license information.
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
from utils import create_script_function
# RUN: %PYTHON %s | torch-mlir-opt | FileCheck %s
mb = ModuleBuilder()
# CHECK-LABEL: ... | 36.68 | 124 | 0.652126 |
from torch_mlir.dialects.torch.importer.jit_ir import ModuleBuilder
from utils import create_script_function
mb = ModuleBuilder()
mb.import_function(create_script_function("__torch__.refined_block_arg", """
graph(%0 : Float(1, 384)):
return (%0)
"""))
mb.module.operation.print()
print()
| true | true |
f70ad4082dd1bb7084d23df4a8316b5464b670e8 | 198 | py | Python | Rank of a matrix.py | srijithmass/RANK-OF-A-MATRIX | f0b2dacac02159a1385cfa23b180859444013911 | [
"BSD-3-Clause"
] | null | null | null | Rank of a matrix.py | srijithmass/RANK-OF-A-MATRIX | f0b2dacac02159a1385cfa23b180859444013911 | [
"BSD-3-Clause"
] | null | null | null | Rank of a matrix.py | srijithmass/RANK-OF-A-MATRIX | f0b2dacac02159a1385cfa23b180859444013911 | [
"BSD-3-Clause"
] | null | null | null | #Program to find the rank of a matrix.
#Developed by: SRIJITH R
#RegisterNumber: 21004191
import numpy as np
A=np.array([[5,-3,-10],[2,2,-3],[-3,-1,5]])
val=np.linalg.matrix_rank(A)
print(val) | 28.285714 | 44 | 0.676768 | import numpy as np
A=np.array([[5,-3,-10],[2,2,-3],[-3,-1,5]])
val=np.linalg.matrix_rank(A)
print(val) | true | true |
f70ad45594920c02ebd62ebd037cc86e54c3965b | 386 | py | Python | OOP_formy/src/pages/file_upload.py | AntonioIonica/Automation_testing | 6f7c94c55677b0958e6fada24058f1a00d2c0d0e | [
"MIT"
] | null | null | null | OOP_formy/src/pages/file_upload.py | AntonioIonica/Automation_testing | 6f7c94c55677b0958e6fada24058f1a00d2c0d0e | [
"MIT"
] | null | null | null | OOP_formy/src/pages/file_upload.py | AntonioIonica/Automation_testing | 6f7c94c55677b0958e6fada24058f1a00d2c0d0e | [
"MIT"
] | null | null | null | """
File upload page using a png file
"""
from selenium.webdriver.common.by import By
from pages.base_page import BasePage
class FileUpload(BasePage):
FILE_UP = (By.ID, 'file-upload-field')
def upload_file(self):
file_up = self.driver.find_element(*self.FILE_UP)
file_up.send_keys('C:/Users/a... | 25.733333 | 102 | 0.735751 |
from selenium.webdriver.common.by import By
from pages.base_page import BasePage
class FileUpload(BasePage):
FILE_UP = (By.ID, 'file-upload-field')
def upload_file(self):
file_up = self.driver.find_element(*self.FILE_UP)
file_up.send_keys('C:/Users/anton/PycharmProjects/Automation_testing/ex... | true | true |
f70ad46c0497f4e4a064bac799bd8fe96b0efbdf | 24,834 | py | Python | pandaclient/PdbUtils.py | matthewfeickert/panda-client | 077bb692a6f42ced0b388c96b8fd64ca032d6df7 | [
"Apache-2.0"
] | 7 | 2016-01-26T21:37:26.000Z | 2020-09-10T07:44:54.000Z | pandaclient/PdbUtils.py | matthewfeickert/panda-client | 077bb692a6f42ced0b388c96b8fd64ca032d6df7 | [
"Apache-2.0"
] | 12 | 2017-10-11T09:15:01.000Z | 2021-11-17T00:23:18.000Z | pandaclient/PdbUtils.py | matthewfeickert/panda-client | 077bb692a6f42ced0b388c96b8fd64ca032d6df7 | [
"Apache-2.0"
] | 9 | 2017-07-20T08:06:36.000Z | 2021-11-15T04:22:06.000Z | import os
import re
import sys
import time
import datetime
from .MiscUtils import commands_get_status_output
try:
long()
except Exception:
long = int
from . import PLogger
from .LocalJobSpec import LocalJobSpec
from .LocalJobsetSpec import LocalJobsetSpec
class PdbProxy:
# constructor
def __init__(se... | 32.168394 | 176 | 0.573488 | import os
import re
import sys
import time
import datetime
from .MiscUtils import commands_get_status_output
try:
long()
except Exception:
long = int
from . import PLogger
from .LocalJobSpec import LocalJobSpec
from .LocalJobsetSpec import LocalJobsetSpec
class PdbProxy:
def __init__(self,verbose=Fal... | true | true |
f70ad47ffabe1481941f0bc8e4a61baa6b6b05a1 | 1,012 | py | Python | examples/projections/azim/azim_gnomonic.py | jbusecke/pygmt | 9ef6338dbb9bdd4c31dda94da6d4126852a6cd85 | [
"BSD-3-Clause"
] | 326 | 2019-02-13T09:33:39.000Z | 2022-03-25T17:24:05.000Z | examples/projections/azim/azim_gnomonic.py | jbusecke/pygmt | 9ef6338dbb9bdd4c31dda94da6d4126852a6cd85 | [
"BSD-3-Clause"
] | 1,153 | 2019-01-22T19:14:32.000Z | 2022-03-31T22:07:03.000Z | examples/projections/azim/azim_gnomonic.py | jbusecke/pygmt | 9ef6338dbb9bdd4c31dda94da6d4126852a6cd85 | [
"BSD-3-Clause"
] | 160 | 2019-02-10T15:24:19.000Z | 2022-03-31T09:07:41.000Z | r"""
Gnomonic
========
The point of perspective of the gnomonic projection lies at the center of the
earth. As a consequence great circles (orthodromes) on the surface of the Earth
are displayed as straight lines, which makes it suitable for distance
estimation for navigational purposes. It is neither conformal nor eq... | 38.923077 | 79 | 0.737154 | import pygmt
fig = pygmt.Figure()
fig.coast(projection="F-90/15/12c", region="g", frame="20g20", land="gray")
fig.show()
| true | true |
f70ad5093842eab9fb077c1fdda2fe3c11e10e3c | 656 | py | Python | Data Science salary prediction/FlaskAPI/app.py | negiaditya/PROJECTS-Data_Science | d26e1fdfc6ce51f02e65c4dbca3edfb5cd97f0a1 | [
"Apache-2.0"
] | null | null | null | Data Science salary prediction/FlaskAPI/app.py | negiaditya/PROJECTS-Data_Science | d26e1fdfc6ce51f02e65c4dbca3edfb5cd97f0a1 | [
"Apache-2.0"
] | null | null | null | Data Science salary prediction/FlaskAPI/app.py | negiaditya/PROJECTS-Data_Science | d26e1fdfc6ce51f02e65c4dbca3edfb5cd97f0a1 | [
"Apache-2.0"
] | null | null | null | import flask
from flask import Flask,jsonify,request
import json
from data_input import data_in
import numpy as np
import pickle
def load_models():
file_name = './models/model_file.p'
with open(file_name,'rb') as pickled:
data = pickle.load(pickled)
model = data['model']
return model
app = Flask(__name__)
@... | 21.16129 | 48 | 0.72561 | import flask
from flask import Flask,jsonify,request
import json
from data_input import data_in
import numpy as np
import pickle
def load_models():
file_name = './models/model_file.p'
with open(file_name,'rb') as pickled:
data = pickle.load(pickled)
model = data['model']
return model
app = Flask(__name__)
@... | true | true |
f70ad5c86243064fffc2399ecd32d4857976c4ce | 1,585 | py | Python | system_tests/conftest.py | Juliana-Morais/data-attribute-recommendation-python-sdk | 95afcfff97ec4f71c5bf10953c0dfa813635636e | [
"Apache-2.0"
] | null | null | null | system_tests/conftest.py | Juliana-Morais/data-attribute-recommendation-python-sdk | 95afcfff97ec4f71c5bf10953c0dfa813635636e | [
"Apache-2.0"
] | null | null | null | system_tests/conftest.py | Juliana-Morais/data-attribute-recommendation-python-sdk | 95afcfff97ec4f71c5bf10953c0dfa813635636e | [
"Apache-2.0"
] | null | null | null | import os
import pytest
from sap.aibus.dar.client.data_manager_client import DataManagerClient
from sap.aibus.dar.client.inference_client import InferenceClient
from sap.aibus.dar.client.model_manager_client import ModelManagerClient
from sap.aibus.dar.client.util.credentials import OnlineCredentialsSource
from sap.a... | 25.15873 | 81 | 0.796215 | import os
import pytest
from sap.aibus.dar.client.data_manager_client import DataManagerClient
from sap.aibus.dar.client.inference_client import InferenceClient
from sap.aibus.dar.client.model_manager_client import ModelManagerClient
from sap.aibus.dar.client.util.credentials import OnlineCredentialsSource
from sap.a... | true | true |
f70ad74e8814bb9a9280d0b92fbb15dd2c7d28a8 | 12,779 | py | Python | parse_scripts/parquet_parsers/galaxy_to_parquet.py | lfdversluis/wta-tools | e9d505df03fff9bb57208dfb82212977ef5e7ca2 | [
"Apache-2.0"
] | 3 | 2019-08-19T10:38:36.000Z | 2020-06-18T10:36:36.000Z | parse_scripts/parquet_parsers/galaxy_to_parquet.py | lfdversluis/wta-tools | e9d505df03fff9bb57208dfb82212977ef5e7ca2 | [
"Apache-2.0"
] | 8 | 2020-02-12T09:53:53.000Z | 2021-03-29T11:16:20.000Z | parse_scripts/parquet_parsers/galaxy_to_parquet.py | lfdversluis/wta-tools | e9d505df03fff9bb57208dfb82212977ef5e7ca2 | [
"Apache-2.0"
] | 2 | 2020-06-17T08:46:02.000Z | 2020-11-26T11:23:48.000Z | import json
import os
import sys
from datetime import datetime
import numpy as np
import pandas as pd
from objects.task import Task
from objects.workflow import Workflow
from objects.workload import Workload
pd.set_option('display.max_columns', None)
USAGE = 'Usage: python(3) ./galaxy_to_parquet.py galaxy_folder'
N... | 39.686335 | 189 | 0.587683 | import json
import os
import sys
from datetime import datetime
import numpy as np
import pandas as pd
from objects.task import Task
from objects.workflow import Workflow
from objects.workload import Workload
pd.set_option('display.max_columns', None)
USAGE = 'Usage: python(3) ./galaxy_to_parquet.py galaxy_folder'
N... | true | true |
f70ad7a5a099f3526ce640efd8badbc902145d66 | 4,566 | py | Python | DeNN/visualization/gradcam.py | KillerStrike17/PyDeNN | 2f0dfaf3e092a4f995ed30e2f8db946e30724551 | [
"MIT"
] | null | null | null | DeNN/visualization/gradcam.py | KillerStrike17/PyDeNN | 2f0dfaf3e092a4f995ed30e2f8db946e30724551 | [
"MIT"
] | null | null | null | DeNN/visualization/gradcam.py | KillerStrike17/PyDeNN | 2f0dfaf3e092a4f995ed30e2f8db946e30724551 | [
"MIT"
] | null | null | null | import seaborn as sns
import matplotlib.pyplot as plt
import torch
import numpy as np
import cv2
from .cam import GradCAM
# def load_gradcam(images, labels, model, device, target_layers):
def load_gradcam(test, model, device, target_layers,size = 25,classified = True):
_images = []
_target = []
_pred = [... | 33.086957 | 210 | 0.644985 | import seaborn as sns
import matplotlib.pyplot as plt
import torch
import numpy as np
import cv2
from .cam import GradCAM
def load_gradcam(test, model, device, target_layers,size = 25,classified = True):
_images = []
_target = []
_pred = []
model.eval()
with torch.no_grad():
... | true | true |
f70ad7d05a2e436c22816e9e6a1f162afbc6f7d6 | 1,239 | py | Python | tests/common/factories/__init__.py | tgiardina/rpp-h | fece590f901b052a59c19a24acfeba52cee33c84 | [
"BSD-2-Clause"
] | 2,103 | 2015-01-07T12:47:49.000Z | 2022-03-29T02:38:25.000Z | tests/common/factories/__init__.py | tgiardina/rpp-h | fece590f901b052a59c19a24acfeba52cee33c84 | [
"BSD-2-Clause"
] | 4,322 | 2015-01-04T17:18:01.000Z | 2022-03-31T17:06:02.000Z | tests/common/factories/__init__.py | tgiardina/rpp-h | fece590f901b052a59c19a24acfeba52cee33c84 | [
"BSD-2-Clause"
] | 389 | 2015-01-24T04:10:02.000Z | 2022-03-28T08:00:16.000Z | """Factory classes for easily generating test objects."""
from .activation import Activation
from .annotation import Annotation
from .annotation_moderation import AnnotationModeration
from .auth_client import AuthClient, ConfidentialAuthClient
from .auth_ticket import AuthTicket
from .authz_code import AuthzCode
from .... | 25.8125 | 59 | 0.736885 | from .activation import Activation
from .annotation import Annotation
from .annotation_moderation import AnnotationModeration
from .auth_client import AuthClient, ConfidentialAuthClient
from .auth_ticket import AuthTicket
from .authz_code import AuthzCode
from .base import set_session
from .document import Document, Do... | true | true |
f70ad80bd35605612bc45255182035b9ed96ec72 | 26,266 | py | Python | sdk/search/azure-search-documents/azure/search/documents/indexes/models/_models.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | null | null | null | sdk/search/azure-search-documents/azure/search/documents/indexes/models/_models.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | null | null | null | sdk/search/azure-search-documents/azure/search/documents/indexes/models/_models.py | ankitarorabit/azure-sdk-for-python | dd90281cbad9400f8080754a5ef2f56791a5a88f | [
"MIT"
] | null | null | null | # -------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
# --------------------------------------------------------------------------
import msr... | 44.822526 | 130 | 0.666299 | import msrest.serialization
from .._generated.models import (
LexicalAnalyzer,
LexicalTokenizer,
AnalyzeRequest,
CustomAnalyzer as _CustomAnalyzer,
PatternAnalyzer as _PatternAnalyzer,
PatternTokenizer as _PatternTokenizer,
SearchResourceEncryptionKey as _SearchResourceEncryptionKey,
Sea... | true | true |
f70ad8f76ec5067e05cba3acf173b8f2bee21594 | 648 | py | Python | train.py | 21171-somesh/Document-Clusturer | 43183c0b44b848e75999cee23e2dd8f8504f3c93 | [
"MIT"
] | 2 | 2019-04-22T18:59:45.000Z | 2019-06-03T15:45:00.000Z | train.py | 21171-somesh/Document-Clusturer | 43183c0b44b848e75999cee23e2dd8f8504f3c93 | [
"MIT"
] | null | null | null | train.py | 21171-somesh/Document-Clusturer | 43183c0b44b848e75999cee23e2dd8f8504f3c93 | [
"MIT"
] | null | null | null | import os
import nltk
import re
from gensim import corpora, models, similarities
from cleaning import clean
def train():
#Loads the data from the local storage
synopses = []
for filename in os.listdir('cnn-stories'):
with open('cnn-stories/' + filename, 'r') as infile:
synopses.append(infile.read())
#Cleans ... | 28.173913 | 110 | 0.746914 | import os
import nltk
import re
from gensim import corpora, models, similarities
from cleaning import clean
def train():
synopses = []
for filename in os.listdir('cnn-stories'):
with open('cnn-stories/' + filename, 'r') as infile:
synopses.append(infile.read())
corpus, dictionary = clean(synopses)
corpor... | true | true |
f70ad93723bc0cc59c9e4a2393a8c832aca01a12 | 17,701 | py | Python | google/cloud/aiplatform_v1/services/specialist_pool_service/transports/grpc.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | 1 | 2022-03-30T05:23:29.000Z | 2022-03-30T05:23:29.000Z | google/cloud/aiplatform_v1/services/specialist_pool_service/transports/grpc.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | null | null | null | google/cloud/aiplatform_v1/services/specialist_pool_service/transports/grpc.py | sakagarwal/python-aiplatform | 62b4a1ea589235910c6e87f027899a29bf1bacb1 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2022 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... | 44.032338 | 102 | 0.647591 | import warnings
from typing import Callable, Dict, Optional, Sequence, Tuple, Union
from google.api_core import grpc_helpers
from google.api_core import operations_v1
from google.api_core import gapic_v1
import google.auth from google.auth import credentials as ga_credentials from google.auth.transport.grpc import S... | true | true |
f70ad9d8555a185e24666047cca27b4352cd70d8 | 1,322 | py | Python | packages/weevely/core/config.py | ZooAtmosphereGroup/HelloPackages | 0ccffd33bf927b13d28c8f715ed35004c33465d9 | [
"Apache-2.0"
] | null | null | null | packages/weevely/core/config.py | ZooAtmosphereGroup/HelloPackages | 0ccffd33bf927b13d28c8f715ed35004c33465d9 | [
"Apache-2.0"
] | null | null | null | packages/weevely/core/config.py | ZooAtmosphereGroup/HelloPackages | 0ccffd33bf927b13d28c8f715ed35004c33465d9 | [
"Apache-2.0"
] | null | null | null | # Base path for log files and sessions
base_path = '~/.weevely/'
# History path
history_path = '~/.weevely/history'
# Session path
sessions_path = '~/.weevely/sessions/'
sessions_ext = '.session'
# Supported Channels
channels = [
# Obfuscated channel inside POST requests introduced
# in Weevely 3.6
'Obf... | 26.979592 | 62 | 0.712557 | base_path = '~/.weevely/'
history_path = '~/.weevely/history'
sessions_path = '~/.weevely/sessions/'
sessions_ext = '.session'
channels = [
'ObfPost',
]
add_random_param_nocache = False
additional_headers = []
agent_templates_folder_path = 'bd/agents/'
obfuscators_templates_folder_path = 'bd/obfuscato... | true | true |
f70ada9d3216e0fafca4da86d8a5c4c9d69bc80e | 1,428 | py | Python | demos/text_classification/train_text_classification_bert.py | yangheng95/LCF-ABSA | 0eeb4788269a498d34c2aff942e03af78026617e | [
"MIT"
] | 31 | 2019-10-07T03:05:39.000Z | 2020-06-17T01:34:21.000Z | demos/text_classification/train_text_classification_bert.py | yangheng95/LCF-ABSA | 0eeb4788269a498d34c2aff942e03af78026617e | [
"MIT"
] | 7 | 2019-10-16T13:37:52.000Z | 2020-03-30T03:40:56.000Z | demos/text_classification/train_text_classification_bert.py | yangheng95/LCF-ABSA | 0eeb4788269a498d34c2aff942e03af78026617e | [
"MIT"
] | 3 | 2020-01-12T13:03:35.000Z | 2020-06-11T08:26:01.000Z | # -*- coding: utf-8 -*-
# file: train_text_classification_bert.py
# time: 2021/8/5
# author: yangheng <yangheng@m.scnu.edu.cn>
# github: https://github.com/yangheng95
# Copyright (C) 2021. All Rights Reserved.
from pyabsa import TextClassificationTrainer, ClassificationConfigManager, ClassificationDatasetList
... | 47.6 | 101 | 0.734594 |
from pyabsa import TextClassificationTrainer, ClassificationConfigManager, ClassificationDatasetList
from pyabsa.functional import BERTClassificationModelList
classification_config_english = ClassificationConfigManager.get_classification_config_english()
classification_config_english.model = BERTClassificationMo... | true | true |
f70adcd6f0c2d4785c71d8c4122e7bd260cf8c8b | 1,559 | py | Python | tests/cornac/datasets/test_movielens.py | carmanzhang/cornac | 215efd0ffa7b8ee1afe1ac6b5cc650ee6303ace3 | [
"Apache-2.0"
] | 597 | 2018-07-17T10:59:56.000Z | 2022-03-31T07:59:36.000Z | tests/cornac/datasets/test_movielens.py | carmanzhang/cornac | 215efd0ffa7b8ee1afe1ac6b5cc650ee6303ace3 | [
"Apache-2.0"
] | 137 | 2018-10-12T10:52:11.000Z | 2022-03-04T15:26:49.000Z | tests/cornac/datasets/test_movielens.py | carmanzhang/cornac | 215efd0ffa7b8ee1afe1ac6b5cc650ee6303ace3 | [
"Apache-2.0"
] | 112 | 2018-07-26T04:36:34.000Z | 2022-03-31T02:29:34.000Z | # Copyright 2018 The Cornac 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 ... | 33.891304 | 83 | 0.654907 |
import unittest
import random
import time
from cornac.datasets import movielens
class TestMovieLens(unittest.TestCase):
def test_load_feedback(self):
random.seed(time.time())
if random.random() > 0.8:
ml_100k = movielens.load_feedback()
self.assertEqual(len(ml_10... | true | true |
f70add09c6753971def6cb61aa3311e6e70eaed2 | 2,289 | py | Python | store_data.py | jaeckie/covid19-containment-embeddings | e27e63266113231ee399f3a55f76b823d514c6f7 | [
"MIT"
] | null | null | null | store_data.py | jaeckie/covid19-containment-embeddings | e27e63266113231ee399f3a55f76b823d514c6f7 | [
"MIT"
] | null | null | null | store_data.py | jaeckie/covid19-containment-embeddings | e27e63266113231ee399f3a55f76b823d514c6f7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Apr 4 15:37:43 2020
@author: moder
"""
import os
from datetime import datetime
import pandas as pd
import urllib.request
from bs4 import BeautifulSoup
user_agent = "user_agent = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64)"
def scrap_wikipedia_text(url):
request = urllib... | 34.681818 | 95 | 0.606815 | import os
from datetime import datetime
import pandas as pd
import urllib.request
from bs4 import BeautifulSoup
user_agent = "user_agent = 'Mozilla/5.0 (Windows NT 6.1; Win64; x64)"
def scrap_wikipedia_text(url):
request = urllib.request.Request(url, data=None, headers={'User-Agent' : user_agent})
html = url... | true | true |
f70add5cf3160d549f4b2591ff4c1811d0af48bb | 5,189 | py | Python | loss.py | VIROBO-15/yolov1 | b7824a6cc7e89a6c29ab63f636a236d923fa0a64 | [
"MIT"
] | null | null | null | loss.py | VIROBO-15/yolov1 | b7824a6cc7e89a6c29ab63f636a236d923fa0a64 | [
"MIT"
] | null | null | null | loss.py | VIROBO-15/yolov1 | b7824a6cc7e89a6c29ab63f636a236d923fa0a64 | [
"MIT"
] | null | null | null | import torch
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
LAMBDA_COORD = 5
LAMBDA_NOOBJ = 0.5
def calc_loss(inp , target, opt):
if inp.size(0) != target.size(0):
raise Exception("Batch size does not match")
total_loss = torch.tensor(0.0)
#total_loss = total_loss.dtype(te... | 31.259036 | 138 | 0.532665 | import torch
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
LAMBDA_COORD = 5
LAMBDA_NOOBJ = 0.5
def calc_loss(inp , target, opt):
if inp.size(0) != target.size(0):
raise Exception("Batch size does not match")
total_loss = torch.tensor(0.0)
for i in range(inp.size(0)):... | true | true |
f70adda29dacc58b9008a96759b8020e2da89fb5 | 149 | py | Python | Basic_API/myproject/basic_api/apps.py | garimazthakur/Learning_Django | 1be5115a4fa9802993824b16ddc1009d1d1fc148 | [
"Apache-2.0"
] | null | null | null | Basic_API/myproject/basic_api/apps.py | garimazthakur/Learning_Django | 1be5115a4fa9802993824b16ddc1009d1d1fc148 | [
"Apache-2.0"
] | null | null | null | Basic_API/myproject/basic_api/apps.py | garimazthakur/Learning_Django | 1be5115a4fa9802993824b16ddc1009d1d1fc148 | [
"Apache-2.0"
] | null | null | null | from django.apps import AppConfig
class BasicApiConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'basic_api'
| 21.285714 | 56 | 0.765101 | from django.apps import AppConfig
class BasicApiConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'basic_api'
| true | true |
f70addf5f1bdab1c36a8baa247be36b38e7ec07a | 6,089 | py | Python | law/job/dashboard.py | mschnepf/law | 7e9e54bb13984a22226ed6f2313780af8dde118a | [
"BSD-3-Clause"
] | null | null | null | law/job/dashboard.py | mschnepf/law | 7e9e54bb13984a22226ed6f2313780af8dde118a | [
"BSD-3-Clause"
] | null | null | null | law/job/dashboard.py | mschnepf/law | 7e9e54bb13984a22226ed6f2313780af8dde118a | [
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
"""
Definition of the job dashboard interface.
"""
__all__ = ["BaseJobDashboard", "NoJobDashboard", "cache_by_status"]
import time
import functools
from contextlib import contextmanager
from abc import ABCMeta, abstractmethod
import six
def cache_by_status(func):
"""
Decorator for :py:me... | 32.736559 | 100 | 0.642634 |
__all__ = ["BaseJobDashboard", "NoJobDashboard", "cache_by_status"]
import time
import functools
from contextlib import contextmanager
from abc import ABCMeta, abstractmethod
import six
def cache_by_status(func):
@functools.wraps(func)
def wrapper(self, job_data, event, job_num, *args, **kwargs):
... | true | true |
f70adf2b66abb9478b88c14aa93f488e2872631b | 5,168 | py | Python | src/ansiblelint/formatters/__init__.py | xoxys/ansible-lint | a009515d2f9cebc147fb02a00ef897526018f1dd | [
"MIT"
] | null | null | null | src/ansiblelint/formatters/__init__.py | xoxys/ansible-lint | a009515d2f9cebc147fb02a00ef897526018f1dd | [
"MIT"
] | null | null | null | src/ansiblelint/formatters/__init__.py | xoxys/ansible-lint | a009515d2f9cebc147fb02a00ef897526018f1dd | [
"MIT"
] | null | null | null | """Output formatters."""
import os
from pathlib import Path
from typing import TYPE_CHECKING, Generic, TypeVar, Union
import rich
if TYPE_CHECKING:
from ansiblelint.errors import MatchError
T = TypeVar('T', bound='BaseFormatter')
class BaseFormatter(Generic[T]):
"""Formatter of ansible-lint output.
Ba... | 35.156463 | 113 | 0.620937 | import os
from pathlib import Path
from typing import TYPE_CHECKING, Generic, TypeVar, Union
import rich
if TYPE_CHECKING:
from ansiblelint.errors import MatchError
T = TypeVar('T', bound='BaseFormatter')
class BaseFormatter(Generic[T]):
def __init__(self, base_dir: Union[str, Path], display_relative_path... | true | true |
f70adf6cbf6163a3f4aa41d1344c3e513b4e7594 | 6,397 | py | Python | src/pymap3d/tests/test_latitude.py | EpicWink/pymap3d | 021e9924f94b2bb5b7148cd00f03d3557619fe27 | [
"BSD-2-Clause"
] | 1 | 2021-05-05T20:17:17.000Z | 2021-05-05T20:17:17.000Z | src/pymap3d/tests/test_latitude.py | EpicWink/pymap3d | 021e9924f94b2bb5b7148cd00f03d3557619fe27 | [
"BSD-2-Clause"
] | null | null | null | src/pymap3d/tests/test_latitude.py | EpicWink/pymap3d | 021e9924f94b2bb5b7148cd00f03d3557619fe27 | [
"BSD-2-Clause"
] | null | null | null | import pytest
from pytest import approx
from math import radians, inf
import pymap3d as pm
@pytest.mark.parametrize(
"geodetic_lat,alt_m,geocentric_lat",
[(0, 0, 0), (90, 0, 90), (-90, 0, -90), (45, 0, 44.80757678), (-45, 0, -44.80757678)],
)
def test_geodetic_alt_geocentric(geodetic_lat, alt_m, geocentric_l... | 36.346591 | 100 | 0.706425 | import pytest
from pytest import approx
from math import radians, inf
import pymap3d as pm
@pytest.mark.parametrize(
"geodetic_lat,alt_m,geocentric_lat",
[(0, 0, 0), (90, 0, 90), (-90, 0, -90), (45, 0, 44.80757678), (-45, 0, -44.80757678)],
)
def test_geodetic_alt_geocentric(geodetic_lat, alt_m, geocentric_l... | true | true |
f70adf83b566478b793627f9a744332eef59285a | 649 | py | Python | py2c/abc/manager.py | timgates42/Py2C | b5c9fd238db589f6d7709482901e33ffebb764eb | [
"BSD-3-Clause"
] | 149 | 2015-01-03T14:21:20.000Z | 2022-03-19T06:23:26.000Z | py2c/abc/manager.py | timgates42/Py2C | b5c9fd238db589f6d7709482901e33ffebb764eb | [
"BSD-3-Clause"
] | 5 | 2019-06-15T18:52:25.000Z | 2021-07-18T18:19:56.000Z | py2c/abc/manager.py | timgates42/Py2C | b5c9fd238db589f6d7709482901e33ffebb764eb | [
"BSD-3-Clause"
] | 62 | 2015-03-02T08:15:31.000Z | 2022-03-14T04:02:35.000Z | """An Abstract Base Class for Managers
"""
import abc
from py2c.utils import verify_attribute
__all__ = ["Manager"]
class Manager(object, metaclass=abc.ABCMeta):
"""Base class of all managers
"""
def __init__(self):
super().__init__()
verify_attribute(self, "options", dict)
@abc.a... | 22.37931 | 73 | 0.617874 |
import abc
from py2c.utils import verify_attribute
__all__ = ["Manager"]
class Manager(object, metaclass=abc.ABCMeta):
def __init__(self):
super().__init__()
verify_attribute(self, "options", dict)
@abc.abstractmethod def run(self, options, *args, **kwargs):
raise NotImplemen... | true | true |
f70adfb5e0c2020651397d903b579cb71d6d8d6a | 6,408 | py | Python | tsai/data/mixed.py | dnth/tsai | 641d5bb75f3aa75889c00a4bb60d96510b4c5605 | [
"Apache-2.0"
] | 1 | 2021-12-03T20:44:55.000Z | 2021-12-03T20:44:55.000Z | tsai/data/mixed.py | dnth/tsai | 641d5bb75f3aa75889c00a4bb60d96510b4c5605 | [
"Apache-2.0"
] | null | null | null | tsai/data/mixed.py | dnth/tsai | 641d5bb75f3aa75889c00a4bb60d96510b4c5605 | [
"Apache-2.0"
] | 1 | 2021-11-14T02:58:25.000Z | 2021-11-14T02:58:25.000Z | # AUTOGENERATED! DO NOT EDIT! File to edit: nbs/022_data.mixed.ipynb (unless otherwise specified).
__all__ = ['MixedDataLoader', 'MixedDataLoaders', 'get_mixed_dls']
# Cell
from ..imports import *
# Cell
# This implementation of a mixed dataloader is based on a great implementation created by Zach Mueller in this fa... | 38.836364 | 125 | 0.593945 |
__all__ = ['MixedDataLoader', 'MixedDataLoaders', 'get_mixed_dls']
from ..imports import *
from packaging import version
from fastai.data.load import _FakeLoader
from torch.utils.data.dataloader import _MultiProcessingDataLoaderIter, _SingleProcessDataLoaderIter, _DatasetKind
_loaders = (_MultiProcessingDataLoaderI... | true | true |
f70adfb91065c384fd4247793ef097d44b87aa12 | 1,838 | bzl | Python | deps/prebuilt_protoc_deps.bzl | heartless-clown/rules_proto | 99c0d0c7a00c1df7221afc3331b5d859a02c420f | [
"Apache-2.0"
] | 249 | 2018-10-24T21:11:08.000Z | 2022-03-31T03:28:34.000Z | deps/prebuilt_protoc_deps.bzl | heartless-clown/rules_proto | 99c0d0c7a00c1df7221afc3331b5d859a02c420f | [
"Apache-2.0"
] | 147 | 2018-12-05T18:58:13.000Z | 2022-03-26T15:41:07.000Z | deps/prebuilt_protoc_deps.bzl | heartless-clown/rules_proto | 99c0d0c7a00c1df7221afc3331b5d859a02c420f | [
"Apache-2.0"
] | 126 | 2018-11-20T22:34:48.000Z | 2022-03-18T13:42:05.000Z | """
GENERATED FILE - DO NOT EDIT (created via @build_stack_rules_proto//cmd/depsgen)
"""
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def _maybe(repo_rule, name, **kwargs):
if name not in native.existing_rules():
repo_rule(name = name, **kwargs)
def prebuilt_protoc_deps():
pre... | 27.848485 | 104 | 0.632753 |
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def _maybe(repo_rule, name, **kwargs):
if name not in native.existing_rules():
repo_rule(name = name, **kwargs)
def prebuilt_protoc_deps():
prebuilt_protoc_linux() prebuilt_protoc_osx() prebuilt_protoc_windows()
def preb... | true | true |
f70adff244a996e05d8cdfd8c5098172e41ab655 | 30,557 | py | Python | trunk/MOPS_Timings.py | n5iln/railmops | f7d3b446435b31bad8cddf343f18ca7efb9eac10 | [
"Unlicense"
] | 1 | 2015-03-30T12:10:56.000Z | 2015-03-30T12:10:56.000Z | trunk/MOPS_Timings.py | n5iln/railmops | f7d3b446435b31bad8cddf343f18ca7efb9eac10 | [
"Unlicense"
] | null | null | null | trunk/MOPS_Timings.py | n5iln/railmops | f7d3b446435b31bad8cddf343f18ca7efb9eac10 | [
"Unlicense"
] | null | null | null | '''
Timings Class
Arrival and departure times for all Route Sections on a Route on a particular
schedule and shows the time into a section and the time out of a section
Model Operations Processing System. Copyright Brian Fairbairn 2009-2010. Licenced under the EUPL.
You may not use this work except in complia... | 40.526525 | 120 | 0.491148 |
import MOPS_Element
class cTimings(MOPS_Element.cElement):
extract_code = 'select * from timings'
extract_header = 'id|section|schedule|depart_station|arrive_station|planned_depart|planned_arrive\n'
def adtims(self, message):
if self.show_access(message, 'ADTIMS schedule', 'S') !=... | true | true |
f70ae05e1e355304e928e6fc4760453b28642856 | 757 | py | Python | python/test/test_biadjacent.py | EQt/graphidx | 9716488cf29f6235072fc920fa1a473bf88e954f | [
"MIT"
] | 4 | 2020-04-03T15:18:30.000Z | 2022-01-06T15:22:48.000Z | python/test/test_biadjacent.py | EQt/graphidx | 9716488cf29f6235072fc920fa1a473bf88e954f | [
"MIT"
] | null | null | null | python/test/test_biadjacent.py | EQt/graphidx | 9716488cf29f6235072fc920fa1a473bf88e954f | [
"MIT"
] | null | null | null | import numpy as np
from graphidx.idx import BiAdjacent
def square():
head = np.array([0, 0, 1, 2])
tail = np.array([1, 2, 3, 3])
return BiAdjacent(head, tail)
def test_sqare():
neigh = square()
assert repr(neigh) == "BiAdjacent[m = 4, n = 4]"
assert set(neigh[0]) == {1, 2}
assert set(nei... | 23.65625 | 52 | 0.548217 | import numpy as np
from graphidx.idx import BiAdjacent
def square():
head = np.array([0, 0, 1, 2])
tail = np.array([1, 2, 3, 3])
return BiAdjacent(head, tail)
def test_sqare():
neigh = square()
assert repr(neigh) == "BiAdjacent[m = 4, n = 4]"
assert set(neigh[0]) == {1, 2}
assert set(nei... | true | true |
f70ae09d3d78cf87978fb48a1ad8112b54e656d2 | 3,833 | py | Python | src/Products/PluginRegistry/interfaces.py | zopefoundation/Products.PluginRegistry | 5093cec2ef2c0769ac19e854d19acd9cae27c878 | [
"ZPL-2.1"
] | null | null | null | src/Products/PluginRegistry/interfaces.py | zopefoundation/Products.PluginRegistry | 5093cec2ef2c0769ac19e854d19acd9cae27c878 | [
"ZPL-2.1"
] | 13 | 2016-02-27T22:32:34.000Z | 2021-09-21T06:46:05.000Z | src/Products/PluginRegistry/interfaces.py | zopefoundation/Products.PluginRegistry | 5093cec2ef2c0769ac19e854d19acd9cae27c878 | [
"ZPL-2.1"
] | 2 | 2015-04-03T05:26:05.000Z | 2015-10-16T08:22:24.000Z | ##############################################################################
#
# Copyright (c) 2001 Zope Foundation and Contributors
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this
# distribution.
# THIS SOFTWARE IS PROVIDED "AS ... | 31.941667 | 79 | 0.623272 |
from zope.interface import Interface
class IPluginRegistry(Interface):
def listPluginTypeInfo():
def listPlugins(plugin_type):
def listPluginIds(plugin_type):
def activatePlugin(plugin_type, plugin_id):
def deactivatePlugin(plugin_type, plugin_id):
def movePluginsUp(plugin_type, ids... | true | true |
f70ae09eab8088111ac2aa5d19572f95f48b55f4 | 1,923 | py | Python | tests/test_sock.py | xxNB/gunicorn | fde9fcfaaaa5db628bcb16644de524122ef0f057 | [
"MIT"
] | 1 | 2020-04-03T18:00:08.000Z | 2020-04-03T18:00:08.000Z | tests/test_sock.py | xgfone/gunicorn | 3857ebc4a7ca52cc7ad5a89a62f2cf94519e426b | [
"MIT"
] | 1 | 2016-08-04T09:36:31.000Z | 2016-08-04T09:36:31.000Z | tests/test_sock.py | xgfone/gunicorn | 3857ebc4a7ca52cc7ad5a89a62f2cf94519e426b | [
"MIT"
] | 1 | 2021-02-22T14:46:39.000Z | 2021-02-22T14:46:39.000Z | # -*- coding: utf-8 -
#
# This file is part of gunicorn released under the MIT license.
# See the NOTICE for more information.
try:
import unittest.mock as mock
except ImportError:
import mock
from gunicorn import sock
@mock.patch('os.stat')
def test_create_sockets_unix_bytes(stat):
conf = mock.Mock(add... | 31.52459 | 76 | 0.703588 |
try:
import unittest.mock as mock
except ImportError:
import mock
from gunicorn import sock
@mock.patch('os.stat')
def test_create_sockets_unix_bytes(stat):
conf = mock.Mock(address=[b'127.0.0.1:8000'])
log = mock.Mock()
with mock.patch.object(sock.UnixSocket, '__init__', lambda *args: None):
... | true | true |
f70ae137d2eb886399cbe83df02b37e5d3c5be8f | 11,876 | py | Python | arkane/encorr/ae.py | tza0035/RMG-Py | 38c49f7107d1b19e4a534408a1040ddd313b8596 | [
"MIT"
] | 250 | 2015-06-06T23:32:00.000Z | 2022-03-22T16:45:16.000Z | arkane/encorr/ae.py | tza0035/RMG-Py | 38c49f7107d1b19e4a534408a1040ddd313b8596 | [
"MIT"
] | 1,781 | 2015-05-26T23:52:00.000Z | 2022-03-31T19:07:54.000Z | arkane/encorr/ae.py | tza0035/RMG-Py | 38c49f7107d1b19e4a534408a1040ddd313b8596 | [
"MIT"
] | 161 | 2015-06-02T14:28:59.000Z | 2022-03-02T19:37:14.000Z | #!/usr/bin/env python3
###############################################################################
# #
# RMG - Reaction Mechanism Generator #
# ... | 43.028986 | 119 | 0.575867 |
import importlib
import json
import logging
from collections import Counter
from typing import Dict, Hashable, List, Union
import numpy as np
from scipy.stats import distributions
from rmgpy import constants
from rmgpy.molecule import get_element, Molecule
import arkane.encorr.data as data
from arkane.encorr.refe... | true | true |
f70ae202c9bbc57106e38b3a87518d56915eb222 | 1,997 | py | Python | guillotina/tests/test_commands.py | diefenbach/guillotina | a8c7247fca8294752901f643b35c5ed1c5dee76d | [
"BSD-2-Clause"
] | null | null | null | guillotina/tests/test_commands.py | diefenbach/guillotina | a8c7247fca8294752901f643b35c5ed1c5dee76d | [
"BSD-2-Clause"
] | null | null | null | guillotina/tests/test_commands.py | diefenbach/guillotina | a8c7247fca8294752901f643b35c5ed1c5dee76d | [
"BSD-2-Clause"
] | null | null | null | import json
import os
from tempfile import mkstemp
import pytest
from guillotina import testing
from guillotina.commands import get_settings
from guillotina.commands.run import RunCommand
DATABASE = os.environ.get('DATABASE', 'DUMMY')
def test_run_command(command_arguments):
_, filepath = mkstemp(suffix='.py')... | 28.126761 | 93 | 0.656485 | import json
import os
from tempfile import mkstemp
import pytest
from guillotina import testing
from guillotina.commands import get_settings
from guillotina.commands.run import RunCommand
DATABASE = os.environ.get('DATABASE', 'DUMMY')
def test_run_command(command_arguments):
_, filepath = mkstemp(suffix='.py')... | true | true |
f70ae20e0c6f0ebe03040dfd7db2eca4e293191c | 37,560 | py | Python | test/test_adaptor_pytorch.py | intel/lp-opt-tool | 130eefa3586b38df6c0ff78cc8807ae273f6a63f | [
"Apache-2.0"
] | 52 | 2020-08-04T04:31:48.000Z | 2020-11-29T02:34:32.000Z | test/test_adaptor_pytorch.py | intel/lp-opt-tool | 130eefa3586b38df6c0ff78cc8807ae273f6a63f | [
"Apache-2.0"
] | null | null | null | test/test_adaptor_pytorch.py | intel/lp-opt-tool | 130eefa3586b38df6c0ff78cc8807ae273f6a63f | [
"Apache-2.0"
] | 7 | 2020-08-21T01:08:55.000Z | 2020-11-29T03:36:55.000Z | import torch
import torch.nn as nn
import torch.nn.quantized as nnq
from torch.quantization import QuantStub, DeQuantStub
import torchvision
import unittest
import os
from neural_compressor.adaptor import FRAMEWORKS
from neural_compressor.model import MODELS
from neural_compressor.adaptor.pytorch import PyTorchVersionM... | 38.13198 | 125 | 0.557535 | import torch
import torch.nn as nn
import torch.nn.quantized as nnq
from torch.quantization import QuantStub, DeQuantStub
import torchvision
import unittest
import os
from neural_compressor.adaptor import FRAMEWORKS
from neural_compressor.model import MODELS
from neural_compressor.adaptor.pytorch import PyTorchVersionM... | true | true |
f70ae3517f3d8b2963d6bc5c320c15fd5a4c04f2 | 988 | py | Python | Apteki/migrations/0001_initial.py | Daneev/Django_test | 7c0cf5ab28b3faba3cd8dfad60a3194a3eff11d6 | [
"Apache-2.0"
] | null | null | null | Apteki/migrations/0001_initial.py | Daneev/Django_test | 7c0cf5ab28b3faba3cd8dfad60a3194a3eff11d6 | [
"Apache-2.0"
] | null | null | null | Apteki/migrations/0001_initial.py | Daneev/Django_test | 7c0cf5ab28b3faba3cd8dfad60a3194a3eff11d6 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.4 on 2017-08-23 16:50
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Lekars... | 31.870968 | 126 | 0.581984 | from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Lekarstv',
fields=[
('id', models.AutoField(auto_cr... | true | true |
f70ae444d51b1c010b6a015103dbd35afc54919e | 1,352 | py | Python | python/old/hiddenBlock.py | BenOsborn/Cerci | 5785ae0c9db8a88a5ac8d91aed29cdf0c0c7854a | [
"Apache-2.0"
] | null | null | null | python/old/hiddenBlock.py | BenOsborn/Cerci | 5785ae0c9db8a88a5ac8d91aed29cdf0c0c7854a | [
"Apache-2.0"
] | null | null | null | python/old/hiddenBlock.py | BenOsborn/Cerci | 5785ae0c9db8a88a5ac8d91aed29cdf0c0c7854a | [
"Apache-2.0"
] | null | null | null | from resources import relu, learnFunc, dot
class HiddenBlock:
def __init__(self, weights, bias):
self.weights = weights
self.bias = bias
def feedForward(self, hidden_inputs):
output = [
relu(
dot(hidden_inputs, weights) + self.bias
)
for... | 33.8 | 85 | 0.579882 | from resources import relu, learnFunc, dot
class HiddenBlock:
def __init__(self, weights, bias):
self.weights = weights
self.bias = bias
def feedForward(self, hidden_inputs):
output = [
relu(
dot(hidden_inputs, weights) + self.bias
)
for... | true | true |
f70ae5186d99b2365c6e21842c72a147f0715710 | 9,285 | py | Python | tests/tensorflow/test_tensorflow_model_export.py | 0wu/mlflow | 2b5a21af05defcfa80255c081b5d9f07443f3f64 | [
"Apache-2.0"
] | null | null | null | tests/tensorflow/test_tensorflow_model_export.py | 0wu/mlflow | 2b5a21af05defcfa80255c081b5d9f07443f3f64 | [
"Apache-2.0"
] | null | null | null | tests/tensorflow/test_tensorflow_model_export.py | 0wu/mlflow | 2b5a21af05defcfa80255c081b5d9f07443f3f64 | [
"Apache-2.0"
] | null | null | null | # pep8: disable=E501
from __future__ import print_function
import collections
import os
import pandas
import shutil
import unittest
import pandas as pd
import sklearn.datasets as datasets
import tensorflow as tf
from mlflow import tensorflow, pyfunc
from mlflow import tracking
from mlflow.utils.file_utils import Te... | 49.919355 | 99 | 0.566505 |
from __future__ import print_function
import collections
import os
import pandas
import shutil
import unittest
import pandas as pd
import sklearn.datasets as datasets
import tensorflow as tf
from mlflow import tensorflow, pyfunc
from mlflow import tracking
from mlflow.utils.file_utils import TempDir
class TestMod... | true | true |
f70ae55504722915015de818a6e0d47a6ddfbf80 | 4,881 | py | Python | test/functional/wallet_import_with_label.py | natangl/refnet | 59c1f1cdae3d79b1c6756185fe8051bd656f1e49 | [
"MIT"
] | null | null | null | test/functional/wallet_import_with_label.py | natangl/refnet | 59c1f1cdae3d79b1c6756185fe8051bd656f1e49 | [
"MIT"
] | null | null | null | test/functional/wallet_import_with_label.py | natangl/refnet | 59c1f1cdae3d79b1c6756185fe8051bd656f1e49 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2018 The Refnet Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the behavior of RPC importprivkey on set and unset labels of
addresses.
It tests different cases in whi... | 35.889706 | 85 | 0.589224 |
from test_framework.test_framework import RefnetTestFramework
from test_framework.wallet_util import test_address
class ImportWithLabel(RefnetTestFramework):
def set_test_params(self):
self.num_nodes = 2
self.setup_clean_chain = True
def skip_test_if_missing_module(self):
self.skip_i... | true | true |
f70ae599068c451f51ac29a3025118f4af8d1413 | 2,139 | py | Python | g_function_weak_coupling/G_function.py | helene-todd/XPPAUT_code | e4caf112c03889a68eed0f4e5fa9d9d436918914 | [
"MIT"
] | null | null | null | g_function_weak_coupling/G_function.py | helene-todd/XPPAUT_code | e4caf112c03889a68eed0f4e5fa9d9d436918914 | [
"MIT"
] | null | null | null | g_function_weak_coupling/G_function.py | helene-todd/XPPAUT_code | e4caf112c03889a68eed0f4e5fa9d9d436918914 | [
"MIT"
] | null | null | null | from matplotlib import cm, rcParams
import matplotlib.pyplot as plt
import numpy as np
import math as math
import random as rand
""" G(phi) function in Rinzel & Lewis' article (2003) under weak coupling """
""" This is under weak coupling theory, although one can note that gamma only serves to scale the function """
... | 25.464286 | 164 | 0.635344 | from matplotlib import cm, rcParams
import matplotlib.pyplot as plt
import numpy as np
import math as math
import random as rand
c = ['#aa3863', '#d97020', '#ef9f07', '#449775', '#3b7d86']
rcParams.update({'figure.autolayout': True})
def T(I):
return math.log(I/(I-1))
def G(phi, I, gamma):
if phi != 0 and p... | true | true |
f70ae60535808681e6fb238519e5687bcd959b2c | 1,086 | py | Python | exoplanet/theano_ops/starry/base_op.py | Junjun1guo/exoplanet | 5df07b16cf7f8770f02fa53598ae3961021cfd0f | [
"MIT"
] | 2 | 2020-05-29T07:10:48.000Z | 2021-04-07T06:43:53.000Z | exoplanet/theano_ops/starry/base_op.py | Junjun1guo/exoplanet | 5df07b16cf7f8770f02fa53598ae3961021cfd0f | [
"MIT"
] | null | null | null | exoplanet/theano_ops/starry/base_op.py | Junjun1guo/exoplanet | 5df07b16cf7f8770f02fa53598ae3961021cfd0f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import division, print_function
__all__ = ["StarryBaseOp"]
import pkg_resources
from theano import gof
from ..build_utils import get_compile_args, get_cache_version
class StarryBaseOp(gof.COp):
__props__ = ()
func_file = None
func_name = None
def __init__... | 26.487805 | 74 | 0.634438 |
from __future__ import division, print_function
__all__ = ["StarryBaseOp"]
import pkg_resources
from theano import gof
from ..build_utils import get_compile_args, get_cache_version
class StarryBaseOp(gof.COp):
__props__ = ()
func_file = None
func_name = None
def __init__(self):
super(St... | true | true |
f70ae64b1876509c4ce63dc278cd4d9e00c288bd | 293 | py | Python | fileopener.py | PiSaucer/jumpcutter | 3b5c723b3b70244471c26345c3bd686bf445b25b | [
"MIT"
] | null | null | null | fileopener.py | PiSaucer/jumpcutter | 3b5c723b3b70244471c26345c3bd686bf445b25b | [
"MIT"
] | null | null | null | fileopener.py | PiSaucer/jumpcutter | 3b5c723b3b70244471c26345c3bd686bf445b25b | [
"MIT"
] | null | null | null | from tkinter import *
from tkinter.filedialog import askopenfilename
import time
Tk().withdraw() # we don't want a full GUI, so keep the root window from appearing
filename = askopenfilename() # show an "Open" dialog box and return the path to the selected file
print(filename)
time.sleep(1)
| 32.555556 | 97 | 0.774744 | from tkinter import *
from tkinter.filedialog import askopenfilename
import time
Tk().withdraw() filename = askopenfilename() # show an "Open" dialog box and return the path to the selected file
print(filename)
time.sleep(1)
| true | true |
f70ae6e8124f0eeef44e323640c73e9d0141dc7c | 4,098 | py | Python | run_analyst.py | nevertheless-ui/TelegramData_Analyst | 6c7b33560a2b8b26bce99c9a82efa6b4796d5828 | [
"MIT"
] | null | null | null | run_analyst.py | nevertheless-ui/TelegramData_Analyst | 6c7b33560a2b8b26bce99c9a82efa6b4796d5828 | [
"MIT"
] | null | null | null | run_analyst.py | nevertheless-ui/TelegramData_Analyst | 6c7b33560a2b8b26bce99c9a82efa6b4796d5828 | [
"MIT"
] | null | null | null | # Filename: analyst.py
"""Analyst is a tool to look up (and export selected) data and insights
from exported data from chats and channels in Telegram
using Python and PyQt5."""
import sys
import pandas as pd
from pathlib import Path
from PyQt5 import QtWidgets, QtCore
from PyQt5 import uic
from backend import (
... | 31.523077 | 92 | 0.678136 |
import sys
import pandas as pd
from pathlib import Path
from PyQt5 import QtWidgets, QtCore
from PyQt5 import uic
from backend import (
converter,
handler,
)
__version__ = '0.1'
__author__ = 'Artyom Filippenko'
df = pd.DataFrame({'a': ['Mary', 'Jim', 'John'],
'b': [100, 200, 300],
... | true | true |
f70ae90ab76967c88f0a8aa21711c21e46566272 | 2,516 | py | Python | tests/1_local/test_ping.py | kpimparkar/cloudmesh-cloud | cb5ec6c2c8e5eb8c41a697cb67e72183808adb64 | [
"Apache-2.0"
] | null | null | null | tests/1_local/test_ping.py | kpimparkar/cloudmesh-cloud | cb5ec6c2c8e5eb8c41a697cb67e72183808adb64 | [
"Apache-2.0"
] | null | null | null | tests/1_local/test_ping.py | kpimparkar/cloudmesh-cloud | cb5ec6c2c8e5eb8c41a697cb67e72183808adb64 | [
"Apache-2.0"
] | null | null | null | ###############################################################
# pytest -v --capture=no tests/1_local/test_name.py
# pytest -v tests/1_local/test_name.py
# pytest -v --capture=no tests/1_local/test_name.py:Test_name.<METHIDNAME>
###############################################################
import pytest
from clou... | 29.6 | 75 | 0.521463 |
import pytest
from cloudmesh.common.StopWatch import StopWatch
from cloudmesh.common3.host import Host
from cloudmesh.common.Printer import Printer
from cloudmesh.common3.Benchmark import Benchmark
from cloudmesh.common.util import HEADING
Benchmark.debug()
hosts = ['127.0.0.1',
'localhost',
'www.... | true | true |
f70ae99dd663fc32f1c74a2e029d50b8365dd95c | 3,993 | py | Python | tlib/networks/VGGnet_train.py | shallowyuan/cosegmentor-crf | c84a9418b70f3f3c7c6a7e998de5835182619f30 | [
"BSD-2-Clause"
] | null | null | null | tlib/networks/VGGnet_train.py | shallowyuan/cosegmentor-crf | c84a9418b70f3f3c7c6a7e998de5835182619f30 | [
"BSD-2-Clause"
] | null | null | null | tlib/networks/VGGnet_train.py | shallowyuan/cosegmentor-crf | c84a9418b70f3f3c7c6a7e998de5835182619f30 | [
"BSD-2-Clause"
] | null | null | null | import tensorflow as tf
from networks.network import Network
#define
n_classes = 21
_feat_stride = [16,]
anchor_scales = [8, 16, 32]
class VGGnet_train(Network):
def __init__(self, trainable=True):
self.inputs = []
self.data = tf.placeholder(tf.float32, shape=[None, None, None, 3])
#self... | 40.744898 | 147 | 0.539194 | import tensorflow as tf
from networks.network import Network
n_classes = 21
_feat_stride = [16,]
anchor_scales = [8, 16, 32]
class VGGnet_train(Network):
def __init__(self, trainable=True):
self.inputs = []
self.data = tf.placeholder(tf.float32, shape=[None, None, None, 3])
... | true | true |
f70aea4b89b68eac3f7c8bada0d6ff77a9ea5c18 | 1,575 | py | Python | algorithms/pattern_matching/kmp.py | rrwt/daily-coding-challenge | b16fc365fd142ebab429e605cb146c8bb0bc97a2 | [
"MIT"
] | 1 | 2019-04-18T03:29:02.000Z | 2019-04-18T03:29:02.000Z | algorithms/pattern_matching/kmp.py | rrwt/daily-coding-challenge | b16fc365fd142ebab429e605cb146c8bb0bc97a2 | [
"MIT"
] | null | null | null | algorithms/pattern_matching/kmp.py | rrwt/daily-coding-challenge | b16fc365fd142ebab429e605cb146c8bb0bc97a2 | [
"MIT"
] | null | null | null | """
KMP pattern matching algorithm.
Finds matching patterns in text in linear time.
Text: A longer string of length n. (n > m)
Pattern: Substring to be searched for of length m.
Works by precompiling the pattern string to create a LPS string array.
LPS: Longest Proper Prefix. Longest prefix string that is also a suffix... | 25.403226 | 76 | 0.526349 |
def compute_lps(pattern: str, m: int) -> list:
lps = [0] * m
i, j = 1, 0
while i < m:
if pattern[i] == pattern[j]:
j += 1
lps[i] = j
i += 1
else:
if j > 0:
j = lps[j - 1]
else:
... | true | true |
f70aebfd8d72e36ce7a654aef6710e7290e9ca98 | 602 | py | Python | pyapple/interface/exceptions.py | fxrcha/PyApple | 6f1336c63583204d4b2b723dd1de8d1895e42430 | [
"MIT"
] | 13 | 2021-02-21T04:16:40.000Z | 2022-03-21T23:34:18.000Z | pyapple/interface/exceptions.py | fxrcha/PyApple | 6f1336c63583204d4b2b723dd1de8d1895e42430 | [
"MIT"
] | null | null | null | pyapple/interface/exceptions.py | fxrcha/PyApple | 6f1336c63583204d4b2b723dd1de8d1895e42430 | [
"MIT"
] | 4 | 2021-02-21T04:16:42.000Z | 2021-03-13T00:22:42.000Z | class HTTPException(Exception):
"""
Exception which happens when HTTP status code is not 200 (OK).
"""
def __init__(self, code, url) -> None:
self.error = f"While requesting to {url}, request returned status {code}."
def __str__(self) -> str:
return self.error
class NoCatalogResu... | 26.173913 | 82 | 0.641196 | class HTTPException(Exception):
def __init__(self, code, url) -> None:
self.error = f"While requesting to {url}, request returned status {code}."
def __str__(self) -> str:
return self.error
class NoCatalogResult(Exception):
def __init__(self, product_id) -> None:
self.error = f"... | true | true |
f70aec16628b9cde66e6d82f41b5f6d38354523d | 1,451 | py | Python | mongo_connector/constants.py | hannelita/mongo-connector | 3df79c656b11bc8f540b42e0a4604bb71a1e2434 | [
"Apache-2.0"
] | 15 | 2015-01-06T08:10:21.000Z | 2017-03-12T23:06:43.000Z | mongo_connector/constants.py | hannelita/mongo-connector | 3df79c656b11bc8f540b42e0a4604bb71a1e2434 | [
"Apache-2.0"
] | 16 | 2015-03-11T09:28:33.000Z | 2016-03-06T14:45:54.000Z | mongo_connector/constants.py | hannelita/mongo-connector | 3df79c656b11bc8f540b42e0a4604bb71a1e2434 | [
"Apache-2.0"
] | 13 | 2015-03-21T13:39:10.000Z | 2022-03-14T11:50:24.000Z | # Copyright 2013-2014 MongoDB, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 33.744186 | 77 | 0.772571 |
DEFAULT_BATCH_SIZE = -1
DEFAULT_COMMIT_INTERVAL = None
DEFAULT_MAX_BULK = 1000
DEFAULT_UNIQUE_KEY = "_id"
DEFAULT_SYSLOG_HOST = "localhost:512"
DEFAULT_SYSLOG_FACILITY = "user"
DEFAULT_LOGFILE_WHEN = "midnight"
DEFAULT_LOGFILE_INTERVAL = 1
DEFAULT_LOGFILE_BACKUPCOUNT = 7
| true | true |
f70aec762062680c5259cfb5eb77332eb404d8dd | 4,433 | py | Python | mcpython/common/state/ui/UIPartScrollBar.py | mcpython4-coding/core | 8698efe93f5a25421bfa508d769d8fdc8e9ce24c | [
"CC0-1.0",
"MIT"
] | 2 | 2019-11-02T05:26:11.000Z | 2019-11-03T08:52:18.000Z | mcpython/common/state/ui/UIPartScrollBar.py | mcpython4-coding/core | 8698efe93f5a25421bfa508d769d8fdc8e9ce24c | [
"CC0-1.0",
"MIT"
] | 25 | 2019-11-02T05:24:29.000Z | 2022-02-09T14:09:08.000Z | mcpython/common/state/ui/UIPartScrollBar.py | mcpython4-coding/core | 8698efe93f5a25421bfa508d769d8fdc8e9ce24c | [
"CC0-1.0",
"MIT"
] | 5 | 2019-11-09T05:36:06.000Z | 2021-11-28T13:07:08.000Z | """
mcpython - a minecraft clone written in python licenced under the MIT-licence
(https://github.com/mcpython4-coding/core)
Contributors: uuk, xkcdjerry (inactive)
Based on the game of fogleman (https://github.com/fogleman/Minecraft), licenced under the MIT-licence
Original game "minecraft" by Mojang Studios (www.m... | 34.364341 | 103 | 0.653508 | import asyncio
import mcpython.engine.ResourceLoader
import mcpython.util.texture
import PIL.Image
import pyglet
from mcpython.engine.rendering.RenderingLayerManager import MIDDLE_GROUND
from mcpython.util.annotation import onlyInClient
from pyglet.window import mouse
from .AbstractUIPart import AbstractUIPart
IMAGE... | true | true |
f70aed25eac5fe4624ab902697caf6abcdb2c22f | 1,117 | py | Python | plugins/resources/LAST_189/last-merge-batches.py | CampagneLaboratory/gobyweb2-plugins | 8d5a95371a8a33c3f0bcdef34f7b579bdfeda49b | [
"Apache-2.0"
] | 1 | 2015-10-03T14:01:54.000Z | 2015-10-03T14:01:54.000Z | plugins/resources/LAST_230/last-merge-batches.py | CampagneLaboratory/gobyweb2-plugins | 8d5a95371a8a33c3f0bcdef34f7b579bdfeda49b | [
"Apache-2.0"
] | null | null | null | plugins/resources/LAST_230/last-merge-batches.py | CampagneLaboratory/gobyweb2-plugins | 8d5a95371a8a33c3f0bcdef34f7b579bdfeda49b | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python
# Copyright 2010, 2011 Martin C. Frith
import fileinput, itertools, optparse, os, signal, sys
def batches(lines):
for line in lines:
if line.startswith("# batch"):
yield line
else:
print line,
while True:
yield None
def lastMergeBatches(... | 27.243902 | 93 | 0.640107 |
import fileinput, itertools, optparse, os, signal, sys
def batches(lines):
for line in lines:
if line.startswith("# batch"):
yield line
else:
print line,
while True:
yield None
def lastMergeBatches(fileNames):
files = map(fileinput.input, fileNames)
b ... | false | true |
f70aed7ed6e1e8d9c85bf0f6c2447a7ce378f443 | 18,439 | py | Python | inb/linkedin/settings.py | JoshiAyush/linkedin-bot | f333218678ab6bc468644dca50aec684b4e29bde | [
"MIT"
] | 2 | 2021-05-30T07:03:31.000Z | 2021-06-03T03:00:31.000Z | inb/linkedin/settings.py | JoshiAyush/linkedin-bot | f333218678ab6bc468644dca50aec684b4e29bde | [
"MIT"
] | 3 | 2021-05-28T10:32:03.000Z | 2021-06-18T09:45:21.000Z | inb/linkedin/settings.py | JoshiAyush/linkedin-bot | f333218678ab6bc468644dca50aec684b4e29bde | [
"MIT"
] | 1 | 2021-03-22T16:01:40.000Z | 2021-03-22T16:01:40.000Z | # Copyright 2021, joshiayus Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and th... | 37.940329 | 130 | 0.719996 |
import re
import os
import sys
import click
import pathlib
import logging
import subprocess
from urllib import (request, parse)
try:
from gettext import gettext as _ except ImportError:
_ = lambda msg: msg
CONNECTION_LIMIT_EXCEED_EXCEPTION_MESSAGE = """Invalid connection limit %d.
LinkedIn does not allow to se... | true | true |
f70aee199c5545672cba5de1ccc8222cc8715ead | 6,272 | py | Python | google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/services/types/feed_item_service.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/services/types/feed_item_service.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/services/types/feed_item_service.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# 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... | 31.837563 | 112 | 0.656888 | import proto
from google.ads.googleads.v7.enums.types import response_content_type as gage_response_content_type
from google.ads.googleads.v7.resources.types import feed_item as gagr_feed_item
from google.protobuf import field_mask_pb2 from google.rpc import status_pb2
__protobuf__ = proto.module(
package='go... | true | true |
f70aeeecd3129be0699bbccd47f8bc33eb31ff00 | 13,131 | py | Python | Thesis@3.9.1/Lib/site-packages/setuptools/_distutils/command/config.py | nverbois/TFE21-232 | 7113837b5263b5c508bfc6903cb6982b48aa7ee4 | [
"MIT"
] | null | null | null | Thesis@3.9.1/Lib/site-packages/setuptools/_distutils/command/config.py | nverbois/TFE21-232 | 7113837b5263b5c508bfc6903cb6982b48aa7ee4 | [
"MIT"
] | null | null | null | Thesis@3.9.1/Lib/site-packages/setuptools/_distutils/command/config.py | nverbois/TFE21-232 | 7113837b5263b5c508bfc6903cb6982b48aa7ee4 | [
"MIT"
] | null | null | null | """distutils.command.config
Implements the Distutils 'config' command, a (mostly) empty command class
that exists mainly to be sub-classed by specific module distributions and
applications. The idea is that while every "config" command is different,
at least they're all named the same, and users always see "config" i... | 34.830239 | 88 | 0.596527 |
import os, re
from distutils.core import Command
from distutils.errors import DistutilsExecError
from distutils.sysconfig import customize_compiler
from distutils import log
LANG_EXT = {"c": ".c", "c++": ".cxx"}
class config(Command):
description = "prepare to build"
user_options = [
("compiler="... | true | true |
f70aef653d2ef3b2e8701681f111cc6df59eb702 | 407 | py | Python | packages/python/plotly/plotly/validators/splom/_hoverinfosrc.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/splom/_hoverinfosrc.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/splom/_hoverinfosrc.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class HoverinfosrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="hoverinfosrc", parent_name="splom", **kwargs):
super(HoverinfosrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | 33.916667 | 82 | 0.68059 | import _plotly_utils.basevalidators
class HoverinfosrcValidator(_plotly_utils.basevalidators.SrcValidator):
def __init__(self, plotly_name="hoverinfosrc", parent_name="splom", **kwargs):
super(HoverinfosrcValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | true | true |
f70af01d82997fdd5c275f0119e776bc23bc6b61 | 1,730 | py | Python | local_image.py | EnterpriseWS/visitor_badge | 98593be190af299148068598b7074c4105a7d20e | [
"MIT"
] | null | null | null | local_image.py | EnterpriseWS/visitor_badge | 98593be190af299148068598b7074c4105a7d20e | [
"MIT"
] | null | null | null | local_image.py | EnterpriseWS/visitor_badge | 98593be190af299148068598b7074c4105a7d20e | [
"MIT"
] | null | null | null | from PIL import Image
from datetime import datetime
import sys
import base64
from io import BytesIO
import platform
import urllib.parse
IMG_FOLDER = ''
if platform.system() == 'Linux':
IMG_FOLDER = 'images/'
elif platform.system() == 'Windows':
IMG_FOLDER = '.\\images\\'
def get_base64_image(filename: str = ... | 35.306122 | 83 | 0.554913 | from PIL import Image
from datetime import datetime
import sys
import base64
from io import BytesIO
import platform
import urllib.parse
IMG_FOLDER = ''
if platform.system() == 'Linux':
IMG_FOLDER = 'images/'
elif platform.system() == 'Windows':
IMG_FOLDER = '.\\images\\'
def get_base64_image(filename: str = ... | true | true |
f70af03c0b36276c0b4f3b78e7ca52a6c4bd0075 | 3,242 | py | Python | br_record.py | purplewish07/pybrother | fe94d95ae90c677a72a82e2a3c7a602f3f16803f | [
"Unlicense"
] | null | null | null | br_record.py | purplewish07/pybrother | fe94d95ae90c677a72a82e2a3c7a602f3f16803f | [
"Unlicense"
] | null | null | null | br_record.py | purplewish07/pybrother | fe94d95ae90c677a72a82e2a3c7a602f3f16803f | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------
# Date: 2021/01/06
# Author: Shaun
# 檔案功能描述:
# 自動抓取機台狀態,更新資料庫,配合bash腳本,寫入系統排程crontab -e
# -------------------------------------------------------------------
import socket
# import pymysql
... | 31.784314 | 124 | 0.546885 | import socket
import os
import time
from datetime import datetime
cnc_config = [('cnc46', "192.168.3.46")]
def get_from_brother(ip='127.0.0.1', port=10000):
client = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
client.settimeout(10)
try:
client.connect((ip, port))
instruct = '%CLOD WKCN... | true | true |
f70af04d64e25ed6b095196a829ad2d2f12abde2 | 35,753 | py | Python | mermaid/forward_models.py | HastingsGreer/mermaid | bd13c5fc427eb8cd9054973a8eaaeb302078182d | [
"Apache-2.0"
] | 120 | 2019-10-29T23:53:02.000Z | 2022-03-30T02:59:58.000Z | mermaid/forward_models.py | HastingsGreer/mermaid | bd13c5fc427eb8cd9054973a8eaaeb302078182d | [
"Apache-2.0"
] | 10 | 2019-11-05T09:28:35.000Z | 2022-01-09T19:12:51.000Z | mermaid/forward_models.py | HastingsGreer/mermaid | bd13c5fc427eb8cd9054973a8eaaeb302078182d | [
"Apache-2.0"
] | 19 | 2019-11-10T13:34:39.000Z | 2022-03-13T20:30:10.000Z | """
Package defining various dynamic forward models as well as convenience methods to generate the
right hand sides (RHS) of the related partial differential equations.
Currently, the following forward models are implemented:
#. An advection equation for images
#. An advection equation for maps
#. The EPDi... | 40.17191 | 176 | 0.609795 | from __future__ import print_function
from __future__ import absolute_import
from builtins import range
from builtins import object
from abc import ABCMeta, abstractmethod
import numpy as np
from . import finite_differences_multi_channel as fdm
from . import utils
from .data_wrapper import MyTensor
from future.utils i... | true | true |
f70af051aa8623d4b8e4b7eaf375f8307bb9bfdb | 3,988 | py | Python | stackdriver_log_formatter/formatter.py | tmshn/python-stackdriver-formatter | 7cb424283cae47a56a2e4f0c98cb654e6c819bf6 | [
"MIT"
] | 2 | 2020-03-13T06:07:35.000Z | 2020-07-02T13:24:44.000Z | stackdriver_log_formatter/formatter.py | tmshn/python-stackdriver-formatter | 7cb424283cae47a56a2e4f0c98cb654e6c819bf6 | [
"MIT"
] | 9 | 2019-08-13T10:00:07.000Z | 2019-08-13T10:11:24.000Z | stackdriver_log_formatter/formatter.py | tmshn/python-stackdriver-formatter | 7cb424283cae47a56a2e4f0c98cb654e6c819bf6 | [
"MIT"
] | null | null | null | from collections.abc import Mapping
from datetime import datetime
import logging
from typing import Optional
from stackdriver_log_formatter.serializer import DefaultFunc, dumps
class StackdriverLogFormatter(logging.Formatter):
"""Log formatter suitable for Stackdriver Logging.
This formatter print log as a ... | 34.982456 | 93 | 0.604313 | from collections.abc import Mapping
from datetime import datetime
import logging
from typing import Optional
from stackdriver_log_formatter.serializer import DefaultFunc, dumps
class StackdriverLogFormatter(logging.Formatter):
DATE_FORMAT = '%Y-%m-%dT%H:%M:%S.%fZ'
def __init__(self, *, default: DefaultFunc=... | true | true |
f70af54400dc4d7f00f926ece3a5f21098a359e1 | 3,841 | py | Python | Redis/owlbot.py | chingor13/google-cloud-php | b110b4b6d354d2a74674ce3a63d619f3f14e84a2 | [
"Apache-2.0"
] | 411 | 2016-09-02T15:39:15.000Z | 2018-09-20T15:15:20.000Z | Redis/owlbot.py | chingor13/google-cloud-php | b110b4b6d354d2a74674ce3a63d619f3f14e84a2 | [
"Apache-2.0"
] | 786 | 2016-08-23T01:22:16.000Z | 2018-09-20T19:26:41.000Z | Redis/owlbot.py | chingor13/google-cloud-php | b110b4b6d354d2a74674ce3a63d619f3f14e84a2 | [
"Apache-2.0"
] | 182 | 2016-08-23T13:29:37.000Z | 2018-09-20T17:27:06.000Z | # Copyright 2018 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, s... | 30.484127 | 122 | 0.643582 |
import logging
from pathlib import Path
import subprocess
import synthtool as s
from synthtool.languages import php
from synthtool import _tracked_paths
logging.basicConfig(level=logging.DEBUG)
src = Path(f"../{php.STAGING_DIR}/Redis").resolve()
dest = Path().resolve()
_tracked_paths.add(src)
php.owlbot_main(
... | true | true |
f70af59cb50cd0fd6732b83ac04eb6a2a19b41d6 | 902 | py | Python | car_detection.py | jitendrasb24/Car-Detection-OpenCV | 92a68158bde3ae6168d09b38a6301af4362425ec | [
"MIT"
] | 1 | 2021-07-30T21:58:26.000Z | 2021-07-30T21:58:26.000Z | car_detection.py | jitendrasb24/Car-Detection-OpenCV | 92a68158bde3ae6168d09b38a6301af4362425ec | [
"MIT"
] | null | null | null | car_detection.py | jitendrasb24/Car-Detection-OpenCV | 92a68158bde3ae6168d09b38a6301af4362425ec | [
"MIT"
] | null | null | null | #import libraries of python opencv
import cv2
# capture video/ video path
cap = cv2.VideoCapture('cars.mp4')
#use trained cars XML classifiers
car_cascade = cv2.CascadeClassifier('haarcascade_cars.xml')
#read until video is completed
while True:
#capture frame by frame
ret, frame = cap.read()
#convert ... | 23.736842 | 59 | 0.672949 | import cv2
cap = cv2.VideoCapture('cars.mp4')
car_cascade = cv2.CascadeClassifier('haarcascade_cars.xml')
while True:
ret, frame = cap.read()
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
cars = car_cascade.detectMultiScale(gray, 1.1, 3)
for (x,y,w,h) in cars:
cv2.rec... | true | true |
f70af5dc5a014d27ac2dd0ca237b6c9fbe2e74e4 | 573 | py | Python | asgi_websub/hub.py | Kludex/fastapi-websub | 1e109545e9ae26f9e36f10252ed321c41053224e | [
"MIT"
] | 1 | 2021-02-10T13:01:17.000Z | 2021-02-10T13:01:17.000Z | asgi_websub/hub.py | Kludex/fastapi-websub | 1e109545e9ae26f9e36f10252ed321c41053224e | [
"MIT"
] | null | null | null | asgi_websub/hub.py | Kludex/fastapi-websub | 1e109545e9ae26f9e36f10252ed321c41053224e | [
"MIT"
] | null | null | null | """
A WebSub Hub is an implementation that handles subscription requests and distributes
the content to subscribers when the corresponding topic URL has been updated. Hubs
MUST support subscription requests with a secret and deliver
[authenticated requests](https://www.w3.org/TR/websub/#authenticated-content-distributi... | 40.928571 | 90 | 0.799302 |
class Hub:
...
| true | true |
f70af5e60d89feffafc4ac1b749d41267d474801 | 20,299 | py | Python | test/iscsi_tgt/rpc_config/rpc_config.py | westerndigitalcorporation/spdk | 8b76ace55fcd60890e5346b71d345511cd0735a7 | [
"BSD-3-Clause"
] | null | null | null | test/iscsi_tgt/rpc_config/rpc_config.py | westerndigitalcorporation/spdk | 8b76ace55fcd60890e5346b71d345511cd0735a7 | [
"BSD-3-Clause"
] | null | null | null | test/iscsi_tgt/rpc_config/rpc_config.py | westerndigitalcorporation/spdk | 8b76ace55fcd60890e5346b71d345511cd0735a7 | [
"BSD-3-Clause"
] | 3 | 2021-03-26T09:00:56.000Z | 2021-03-26T09:01:20.000Z | #!/usr/bin/env python
import os
import os.path
import re
import sys
import time
import json
import random
from subprocess import check_call, call, check_output, Popen, PIPE, CalledProcessError
netmask = ('127.0.0.1', '127.0.0.0')
rpc_param = {
'target_ip': '127.0.0.1',
'port': 3260,
'initiator_name': 'AN... | 46.664368 | 139 | 0.642987 |
import os
import os.path
import re
import sys
import time
import json
import random
from subprocess import check_call, call, check_output, Popen, PIPE, CalledProcessError
netmask = ('127.0.0.1', '127.0.0.0')
rpc_param = {
'target_ip': '127.0.0.1',
'port': 3260,
'initiator_name': 'ANY',
'netmask': net... | false | true |
f70af7721a9f5b84af3224a3f8ec3e5b86a4b268 | 3,268 | py | Python | tests/unit_tests/test_notice.py | i8enn/aiovertica | 508c5a6a7b05e618c290271f404dee5e41c1d9a7 | [
"Apache-2.0"
] | 1 | 2021-11-29T10:23:42.000Z | 2021-11-29T10:23:42.000Z | tests/unit_tests/test_notice.py | i8enn/aiovertica | 508c5a6a7b05e618c290271f404dee5e41c1d9a7 | [
"Apache-2.0"
] | null | null | null | tests/unit_tests/test_notice.py | i8enn/aiovertica | 508c5a6a7b05e618c290271f404dee5e41c1d9a7 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019-2021 Micro Focus or one of its affiliates.
#
# 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 applic... | 40.345679 | 126 | 0.687576 |
from __future__ import print_function, division, absolute_import
import mock
from .base import VerticaPythonUnitTestCase
from aiovertica.messages import NoticeResponse
from aiovertica.errors import QueryError
class NoticeTestCase(VerticaPythonUnitTestCase):
SAMPLE_DATA = {b'S': 'FATAL',
b'H'... | true | true |
f70af7796f844e524d5d7ecb7ec6b3b1df6ca720 | 4,888 | py | Python | rl_games/common/segment_tree.py | NikitaRdn/rl_games | 50d9a460f8ba41de5dbac4abed04f8de9b849f4f | [
"MIT"
] | 193 | 2019-05-28T01:48:56.000Z | 2022-03-31T07:56:37.000Z | rl_games/common/segment_tree.py | NikitaRdn/rl_games | 50d9a460f8ba41de5dbac4abed04f8de9b849f4f | [
"MIT"
] | 35 | 2020-01-28T22:15:51.000Z | 2022-03-28T22:10:54.000Z | rl_games/common/segment_tree.py | NikitaRdn/rl_games | 50d9a460f8ba41de5dbac4abed04f8de9b849f4f | [
"MIT"
] | 37 | 2019-06-28T01:09:53.000Z | 2022-03-26T09:14:06.000Z | import operator
class SegmentTree(object):
def __init__(self, capacity, operation, neutral_element):
"""Build a Segment Tree data structure.
https://en.wikipedia.org/wiki/Segment_tree
Can be used as regular array, but with two
important differences:
a) setting item's va... | 36.207407 | 109 | 0.557488 | import operator
class SegmentTree(object):
def __init__(self, capacity, operation, neutral_element):
assert capacity > 0 and capacity & (capacity - 1) == 0, "capacity must be positive and a power of 2."
self._capacity = capacity
self._value = [neutral_element for _ in range(2 * capacity)]
... | true | true |
f70af7f247a2d22961c36fe039a604db4f490235 | 10,146 | py | Python | tests/integration/verify/v2/service/rate_limit/test_bucket.py | BrimmingDev/twilio-python | 3226b5fed92b3c2ce64f03e6b19fc4792ef7647f | [
"MIT"
] | 1,362 | 2015-01-04T10:25:18.000Z | 2022-03-24T10:07:08.000Z | tests/integration/verify/v2/service/rate_limit/test_bucket.py | BrimmingDev/twilio-python | 3226b5fed92b3c2ce64f03e6b19fc4792ef7647f | [
"MIT"
] | 299 | 2015-01-30T09:52:39.000Z | 2022-03-31T23:03:02.000Z | tests/integration/verify/v2/service/rate_limit/test_bucket.py | BrimmingDev/twilio-python | 3226b5fed92b3c2ce64f03e6b19fc4792ef7647f | [
"MIT"
] | 622 | 2015-01-03T04:43:09.000Z | 2022-03-29T14:11:00.000Z | # coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class BucketTestCase(Integratio... | 44.113043 | 194 | 0.583974 |
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class BucketTestCase(IntegrationTestCase):
def test_create_request(self):
self.holodeck.mock(Response(500, ''))
with self.assertR... | true | true |
f70af9e0821e905487a6177fe9cec05be0014885 | 701 | py | Python | com/puzzlesolver/cross_over.py | bekirduran/AI_Puzzle_Solver | 7e8c007802d1e4596dd09edd97bafeb7a4ff7f61 | [
"MIT"
] | null | null | null | com/puzzlesolver/cross_over.py | bekirduran/AI_Puzzle_Solver | 7e8c007802d1e4596dd09edd97bafeb7a4ff7f61 | [
"MIT"
] | null | null | null | com/puzzlesolver/cross_over.py | bekirduran/AI_Puzzle_Solver | 7e8c007802d1e4596dd09edd97bafeb7a4ff7f61 | [
"MIT"
] | null | null | null | import numpy as np
# This class generating new list item given first of list item row and second of list item row
class Crossover:
@staticmethod
def crossover(best):
row_begin_index = 0
row_half = 2
cross_list = []
for i in range(len(best) - 1):
first_part1 = best... | 29.208333 | 94 | 0.621969 | import numpy as np
class Crossover:
@staticmethod
def crossover(best):
row_begin_index = 0
row_half = 2
cross_list = []
for i in range(len(best) - 1):
first_part1 = best[i][row_begin_index:row_half, :]
first_part2 = best[i + 1][row_half:, :]
... | true | true |
f70af9fd28bd05e69268c8b7a15da6da05539c50 | 2,299 | py | Python | handlers/commandInfo.py | secondfry/school21-randomcoffee | 261b8d562d02b5a79b12603e0b74c90289523408 | [
"MIT"
] | 3 | 2021-02-28T12:00:26.000Z | 2021-03-14T03:00:42.000Z | handlers/commandInfo.py | secondfry/school21-randomcoffee | 261b8d562d02b5a79b12603e0b74c90289523408 | [
"MIT"
] | null | null | null | handlers/commandInfo.py | secondfry/school21-randomcoffee | 261b8d562d02b5a79b12603e0b74c90289523408 | [
"MIT"
] | null | null | null | from typing import Dict, Any
from telegram import Update, ParseMode
from telegram.ext import CallbackContext
from config.constants import (
USER_DATA_V1_SETTINGS_CAMPUS,
USER_DATA_V1_SETTINGS_ONLINE,
USER_DATA_V1_INTRA_LOGIN,
USER_DATA_V1_INTRA_CAMPUS,
USER_DATA_V1_SETTINGS_ACTIVE,
USER_DATA_V... | 28.382716 | 115 | 0.676816 | from typing import Dict, Any
from telegram import Update, ParseMode
from telegram.ext import CallbackContext
from config.constants import (
USER_DATA_V1_SETTINGS_CAMPUS,
USER_DATA_V1_SETTINGS_ONLINE,
USER_DATA_V1_INTRA_LOGIN,
USER_DATA_V1_INTRA_CAMPUS,
USER_DATA_V1_SETTINGS_ACTIVE,
USER_DATA_V... | true | true |
f70afa56a030c0bd6f0835494dee2ed74f7dff35 | 3,337 | py | Python | src/gui.py | ksern94/six-percent | a3eb637d72d47f396945a4488222d63ae93df53d | [
"MIT"
] | 1 | 2020-10-17T08:56:41.000Z | 2020-10-17T08:56:41.000Z | src/gui.py | ksern94/six-percent | a3eb637d72d47f396945a4488222d63ae93df53d | [
"MIT"
] | null | null | null | src/gui.py | ksern94/six-percent | a3eb637d72d47f396945a4488222d63ae93df53d | [
"MIT"
] | null | null | null | import logging
import os
import re
import sys
from typing import Any, Dict
import PySimpleGUI as sg # type: ignore
from PySimpleGUI.PySimpleGUI import Column # type: ignore
from .utils.encryption import encrypt_password, generate_key
logger = logging.getLogger(__name__)
def login_gui() -> Dict[str, Any]:
sg.... | 34.05102 | 169 | 0.596943 | import logging
import os
import re
import sys
from typing import Any, Dict
import PySimpleGUI as sg from PySimpleGUI.PySimpleGUI import Column
from .utils.encryption import encrypt_password, generate_key
logger = logging.getLogger(__name__)
def login_gui() -> Dict[str, Any]:
sg.theme('DarkTeal12')
def c... | true | true |
f70afac02a6128129ed13868fbdec50f32f336fa | 1,077 | py | Python | src/cards.py | tylernickr/cribbage | 04d594c2c9fcc2faf96f17bfa3d75b76b9ee36f8 | [
"MIT"
] | null | null | null | src/cards.py | tylernickr/cribbage | 04d594c2c9fcc2faf96f17bfa3d75b76b9ee36f8 | [
"MIT"
] | null | null | null | src/cards.py | tylernickr/cribbage | 04d594c2c9fcc2faf96f17bfa3d75b76b9ee36f8 | [
"MIT"
] | null | null | null | from random import shuffle
class Deck(object):
CARD_VALUES = ['A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K']
CARD_SUITS = ['H', 'D', 'S', 'C']
@staticmethod
def get_shuffled_deck():
deck = Deck()
deck.shuffle()
return deck
def __init__(self):
se... | 22.914894 | 93 | 0.559889 | from random import shuffle
class Deck(object):
CARD_VALUES = ['A', '2', '3', '4', '5', '6', '7', '8', '9', '10', 'J', 'Q', 'K']
CARD_SUITS = ['H', 'D', 'S', 'C']
@staticmethod
def get_shuffled_deck():
deck = Deck()
deck.shuffle()
return deck
def __init__(self):
se... | true | true |
f70afaf5df169b83dcb2c1b6ed171ffa8616d273 | 5,747 | py | Python | tensorflow/python/compiler/tensorrt/test/trt_mode_test.py | huonw/tensorflow | 85f47254af7cc230a4a031998dffe770b7edbb9d | [
"Apache-2.0"
] | 1 | 2020-10-01T16:52:51.000Z | 2020-10-01T16:52:51.000Z | tensorflow/python/compiler/tensorrt/test/trt_mode_test.py | huonw/tensorflow | 85f47254af7cc230a4a031998dffe770b7edbb9d | [
"Apache-2.0"
] | 1 | 2022-02-10T01:08:48.000Z | 2022-02-10T01:08:48.000Z | tensorflow/python/compiler/tensorrt/test/trt_mode_test.py | huonw/tensorflow | 85f47254af7cc230a4a031998dffe770b7edbb9d | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 35.257669 | 93 | 0.712894 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from unittest import SkipTest
from tensorflow.compiler.tf2tensorrt.wrap_py_utils import get_linked_tensorrt_version
from tensorflow.python.compiler.tensorrt.test import tf_trt_integration_test_base as trt_te... | true | true |
f70afc2cecdad59dc581cd68886b60f4e9f9968e | 870 | py | Python | ax/modelbridge/numpy.py | mpolson64/Ax-1 | cf9e12cc1253efe0fc893f2620e99337e0927a26 | [
"MIT"
] | 1 | 2022-02-10T10:51:40.000Z | 2022-02-10T10:51:40.000Z | ax/modelbridge/numpy.py | mpolson64/Ax-1 | cf9e12cc1253efe0fc893f2620e99337e0927a26 | [
"MIT"
] | null | null | null | ax/modelbridge/numpy.py | mpolson64/Ax-1 | cf9e12cc1253efe0fc893f2620e99337e0927a26 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import List
from ax.modelbridge.array import ArrayModelBridge
from ax.models.numpy_base import NumpyMode... | 31.071429 | 73 | 0.757471 |
from typing import List
from ax.modelbridge.array import ArrayModelBridge
from ax.models.numpy_base import NumpyModel
class NumpyModelBridge(ArrayModelBridge):
model: NumpyModel
outcomes: List[str]
parameters: List[str]
| true | true |
f70afc3ff1c2e6df15de3340a6c530b958a903f9 | 26,367 | py | Python | src/transformers/training_args.py | hlahkar/transformers | c19d04623eacfbc2c452397a5eda0fde42db3fc5 | [
"Apache-2.0"
] | null | null | null | src/transformers/training_args.py | hlahkar/transformers | c19d04623eacfbc2c452397a5eda0fde42db3fc5 | [
"Apache-2.0"
] | null | null | null | src/transformers/training_args.py | hlahkar/transformers | c19d04623eacfbc2c452397a5eda0fde42db3fc5 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The HuggingFace Team. 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 applicabl... | 49.009294 | 142 | 0.64668 |
import dataclasses
import json
import os
from dataclasses import dataclass, field
from enum import Enum
from typing import Any, Dict, List, Optional, Tuple
from .file_utils import cached_property, is_torch_available, is_torch_tpu_available, torch_required
from .trainer_utils import EvaluationStrategy
from .utils impo... | true | true |
f70afc80da633e56f080f73b9d417cce0188dc99 | 4,232 | py | Python | influxdb_client/domain/variable_assignment.py | rhajek/influxdb-client-python | 852e6f1b1161df4d67eabc19cdb6b323a46b88e2 | [
"MIT"
] | null | null | null | influxdb_client/domain/variable_assignment.py | rhajek/influxdb-client-python | 852e6f1b1161df4d67eabc19cdb6b323a46b88e2 | [
"MIT"
] | null | null | null | influxdb_client/domain/variable_assignment.py | rhajek/influxdb-client-python | 852e6f1b1161df4d67eabc19cdb6b323a46b88e2 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
Influx API Service
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
OpenAPI spec version: 0.1.0
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
class Vari... | 25.341317 | 124 | 0.548204 |
import pprint
import re
import six
class VariableAssignment(object):
openapi_types = {
'type': 'str',
'id': 'Identifier',
'init': 'Expression'
}
attribute_map = {
'type': 'type',
'id': 'id',
'init': 'init'
}
def __init__(self, type=None, id=N... | true | true |
f70afe6072a76e5fe93f7e3e26275edc78dfaba1 | 784 | py | Python | main/zlib/template.py | ismith/cports | 9fe76e231872e0b03b425252b5fc5e1d9af2a6d8 | [
"BSD-2-Clause"
] | null | null | null | main/zlib/template.py | ismith/cports | 9fe76e231872e0b03b425252b5fc5e1d9af2a6d8 | [
"BSD-2-Clause"
] | null | null | null | main/zlib/template.py | ismith/cports | 9fe76e231872e0b03b425252b5fc5e1d9af2a6d8 | [
"BSD-2-Clause"
] | null | null | null | pkgname = "zlib"
version = "1.2.11"
revision = 0
build_style = "configure"
short_desc = "Compression/decompression Library"
maintainer = "q66 <q66@chimera-linux.org>"
license = "Zlib"
homepage = "http://www.zlib.net"
distfiles = [f"{homepage}/{pkgname}-{version}.tar.gz"]
checksum = ["c3e5e9fdd5004dcb542feda5ee4f0ff0744... | 25.290323 | 79 | 0.640306 | pkgname = "zlib"
version = "1.2.11"
revision = 0
build_style = "configure"
short_desc = "Compression/decompression Library"
maintainer = "q66 <q66@chimera-linux.org>"
license = "Zlib"
homepage = "http://www.zlib.net"
distfiles = [f"{homepage}/{pkgname}-{version}.tar.gz"]
checksum = ["c3e5e9fdd5004dcb542feda5ee4f0ff0744... | true | true |
f70afe9d202280156e80d97bbe01c5a86d7add8a | 154 | py | Python | tests/test_nba_py_shotchart.py | evanmjohnson/nba-awards-predictor | 33fbf48252bc7b85c5e406be13e957988c418182 | [
"BSD-3-Clause"
] | 1,189 | 2015-08-25T22:51:49.000Z | 2022-03-25T06:29:04.000Z | tests/test_nba_py_shotchart.py | calestini/nba_py | ffeaf4251d796ff9313367a752a45a0d7b16489e | [
"BSD-3-Clause"
] | 111 | 2015-08-28T15:41:10.000Z | 2021-05-17T11:12:04.000Z | tests/test_nba_py_shotchart.py | calestini/nba_py | ffeaf4251d796ff9313367a752a45a0d7b16489e | [
"BSD-3-Clause"
] | 377 | 2015-08-26T00:35:07.000Z | 2022-02-07T18:29:33.000Z | from nba_py import shotchart
from nba_py.player import get_player
def test():
pid = get_player('Kevin', 'Durant')
assert shotchart.ShotChart(pid) | 25.666667 | 39 | 0.746753 | from nba_py import shotchart
from nba_py.player import get_player
def test():
pid = get_player('Kevin', 'Durant')
assert shotchart.ShotChart(pid) | true | true |
f70b001653854db2cd84ceba965fb48abc9e0a5c | 18,327 | py | Python | wagtail/wagtailusers/tests.py | jordij/wagtail | d4259e133b80d5648266db181029dfbe0fbcf885 | [
"BSD-3-Clause"
] | null | null | null | wagtail/wagtailusers/tests.py | jordij/wagtail | d4259e133b80d5648266db181029dfbe0fbcf885 | [
"BSD-3-Clause"
] | null | null | null | wagtail/wagtailusers/tests.py | jordij/wagtail | d4259e133b80d5648266db181029dfbe0fbcf885 | [
"BSD-3-Clause"
] | 1 | 2019-02-04T13:57:39.000Z | 2019-02-04T13:57:39.000Z | from __future__ import unicode_literals
import unittest
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group, Permission
from django.utils import six
from wagtail.tests.utils import WagtailTestUtils
f... | 41.938215 | 134 | 0.6569 | from __future__ import unicode_literals
import unittest
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.contrib.auth import get_user_model
from django.contrib.auth.models import Group, Permission
from django.utils import six
from wagtail.tests.utils import WagtailTestUtils
f... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.