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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f719f928dccc27ae9f21364a24c6d3cb460a18a2 | 9,079 | py | Python | stacker/tests/test_plan.py | GoodRx/stacker | 0cf1df67b4ae5aeda5845442c84905909101c238 | [
"BSD-2-Clause"
] | 1 | 2021-11-06T17:01:01.000Z | 2021-11-06T17:01:01.000Z | stacker/tests/test_plan.py | GoodRx/stacker | 0cf1df67b4ae5aeda5845442c84905909101c238 | [
"BSD-2-Clause"
] | null | null | null | stacker/tests/test_plan.py | GoodRx/stacker | 0cf1df67b4ae5aeda5845442c84905909101c238 | [
"BSD-2-Clause"
] | 1 | 2021-11-06T17:00:53.000Z | 2021-11-06T17:00:53.000Z | import unittest
import mock
from stacker.context import Context
from stacker.exceptions import ImproperlyConfigured
from stacker.plan import (
Step,
Plan,
)
from stacker.status import (
COMPLETE,
SKIPPED,
SUBMITTED,
)
from stacker.stack import Stack
from .factories import generate_definition
cou... | 32.894928 | 79 | 0.566142 | import unittest
import mock
from stacker.context import Context
from stacker.exceptions import ImproperlyConfigured
from stacker.plan import (
Step,
Plan,
)
from stacker.status import (
COMPLETE,
SKIPPED,
SUBMITTED,
)
from stacker.stack import Stack
from .factories import generate_definition
cou... | true | true |
f719f96e68fd7b17d73ed6b9460ebade8987ebf6 | 4,908 | py | Python | parseepo/serialize.py | cverluise/parseEPO | be1171a0f8e6fcafa711fa291aebb1fc2260d5e6 | [
"MIT"
] | null | null | null | parseepo/serialize.py | cverluise/parseEPO | be1171a0f8e6fcafa711fa291aebb1fc2260d5e6 | [
"MIT"
] | 3 | 2021-02-02T22:38:50.000Z | 2021-08-23T20:41:10.000Z | parseepo/serialize.py | cverluise/parseEPO | be1171a0f8e6fcafa711fa291aebb1fc2260d5e6 | [
"MIT"
] | null | null | null | import html2text
import pandas as pd
from wasabi import Printer
from parseepo import validate
from parseepo.exception import SingleAttrException
from parseepo.utils import prepare_name
h = html2text.HTML2Text()
msg = Printer()
NAMES = ["EP", "Num", "Ext", "publication_date", "language", "attr", "text"]
NESTED_ATTR = ... | 36.355556 | 92 | 0.581296 | import html2text
import pandas as pd
from wasabi import Printer
from parseepo import validate
from parseepo.exception import SingleAttrException
from parseepo.utils import prepare_name
h = html2text.HTML2Text()
msg = Printer()
NAMES = ["EP", "Num", "Ext", "publication_date", "language", "attr", "text"]
NESTED_ATTR = ... | true | true |
f719fa1fa4ebcfaebccce4b33060c2940a53ad43 | 1,159 | py | Python | src/ursa/scripts/clean_imu_data.py | BillYJT/RR1-IP | 06946f9c79ae7c5e128d83bded3dafd848d49f58 | [
"MIT"
] | null | null | null | src/ursa/scripts/clean_imu_data.py | BillYJT/RR1-IP | 06946f9c79ae7c5e128d83bded3dafd848d49f58 | [
"MIT"
] | null | null | null | src/ursa/scripts/clean_imu_data.py | BillYJT/RR1-IP | 06946f9c79ae7c5e128d83bded3dafd848d49f58 | [
"MIT"
] | 1 | 2020-06-07T00:38:19.000Z | 2020-06-07T00:38:19.000Z | #!/usr/bin/env python
import rospy
import math
from sensor_msgs.msg import Imu
import tf
import tf2_ros
import tf2_geometry_msgs
import geometry_msgs.msg
lastPub = 0
lastClean = 0
def callbackRaw(imu_in):
global lastPub, lastClean
if (lastClean != 0 and lastClean > rospy.Time.now() - rospy.Duration(1)):
return #... | 27.595238 | 74 | 0.744607 | import rospy
import math
from sensor_msgs.msg import Imu
import tf
import tf2_ros
import tf2_geometry_msgs
import geometry_msgs.msg
lastPub = 0
lastClean = 0
def callbackRaw(imu_in):
global lastPub, lastClean
if (lastClean != 0 and lastClean > rospy.Time.now() - rospy.Duration(1)):
return if (lastPub == 0 or im... | false | true |
f719fb0a5fa90c220d27a523e8d540e39d655557 | 5,183 | py | Python | pyampd/ampd.py | luigiluz/pyampd | cd247030f5a4ccd971da837b9b873cacbd7adfb3 | [
"MIT"
] | 25 | 2019-04-13T06:39:33.000Z | 2022-03-11T22:38:46.000Z | pyampd/ampd.py | luigiluz/pyampd | cd247030f5a4ccd971da837b9b873cacbd7adfb3 | [
"MIT"
] | 5 | 2018-12-05T10:07:20.000Z | 2021-02-17T09:08:10.000Z | pyampd/ampd.py | luigiluz/pyampd | cd247030f5a4ccd971da837b9b873cacbd7adfb3 | [
"MIT"
] | 5 | 2020-10-18T12:42:14.000Z | 2021-07-01T05:32:50.000Z | import numpy as np
from scipy.ndimage import uniform_filter1d
from scipy.signal import detrend
def find_peaks_original(x, scale=None, debug=False):
"""Find peaks in quasi-periodic noisy signals using AMPD algorithm.
Automatic Multi-Scale Peak Detection originally proposed in
"An Efficient Algorithm for A... | 29.282486 | 78 | 0.605248 | import numpy as np
from scipy.ndimage import uniform_filter1d
from scipy.signal import detrend
def find_peaks_original(x, scale=None, debug=False):
x = detrend(x)
N = len(x)
L = N // 2
if scale:
L = min(scale, L)
LSM = np.zeros((L, N), dtype=bool)
for k in np.arange(1, L):
... | true | true |
f719fb9a1924b2e4695d476c0d4c308d07b01506 | 9,413 | py | Python | Radiosonde_Data/weekly_cross_section.py | peterwilletts24/Python-Scripts | 975d6b2e2923cbde40d2760eb9574acee2e10388 | [
"MIT"
] | 4 | 2017-05-24T09:14:14.000Z | 2019-01-02T19:20:38.000Z | Radiosonde_Data/weekly_cross_section.py | peterwilletts24/Python-Scripts | 975d6b2e2923cbde40d2760eb9574acee2e10388 | [
"MIT"
] | null | null | null | Radiosonde_Data/weekly_cross_section.py | peterwilletts24/Python-Scripts | 975d6b2e2923cbde40d2760eb9574acee2e10388 | [
"MIT"
] | 3 | 2017-05-24T09:14:15.000Z | 2020-09-28T08:32:02.000Z | #Monthly
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.mlab as ml
import datetime
from dateutil.relativedelta import relativedelta
import re
import numpy as np
from math import sin, cos, atan2, radians, sqrt
import scipy.interpolate
import gc
import pdb
import imp
imp.load_source('GenMe... | 37.652 | 210 | 0.725274 |
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.mlab as ml
import datetime
from dateutil.relativedelta import relativedelta
import re
import numpy as np
from math import sin, cos, atan2, radians, sqrt
import scipy.interpolate
import gc
import pdb
import imp
imp.load_source('GenMeteoFuncs'... | false | true |
f719fc3ddd0729538402b3d0087f650db4bf9a87 | 3,272 | py | Python | extract_features.py | bionlplab/heart_failure_mortality | f3bbfe65fe6f2c2a076acb38697133b472bf2231 | [
"BSD-3-Clause"
] | 4 | 2021-06-06T17:50:44.000Z | 2021-12-27T11:45:34.000Z | extract_features.py | bionlplab/heart_failure_mortality | f3bbfe65fe6f2c2a076acb38697133b472bf2231 | [
"BSD-3-Clause"
] | 1 | 2021-11-28T00:39:50.000Z | 2021-12-08T13:58:56.000Z | extract_features.py | bionlplab/heart_failure_mortality | f3bbfe65fe6f2c2a076acb38697133b472bf2231 | [
"BSD-3-Clause"
] | null | null | null | import pandas as pd
import numpy as np
from utils import *
from sklearn.preprocessing import StandardScaler
from collections import defaultdict
import re
def format_labels(file_path, timelines, mapping):
most_recent = mapping.sort_values(["subject_id", "ordering_date"], ascending=False).drop_duplicates("subject_id", ... | 32.078431 | 128 | 0.755501 | import pandas as pd
import numpy as np
from utils import *
from sklearn.preprocessing import StandardScaler
from collections import defaultdict
import re
def format_labels(file_path, timelines, mapping):
most_recent = mapping.sort_values(["subject_id", "ordering_date"], ascending=False).drop_duplicates("subject_id", ... | true | true |
f719fd14389a9547c6251cef99f54bae3af19a6e | 221 | py | Python | output/models/ms_data/datatypes/facets/non_negative_integer/non_negative_integer_min_exclusive004_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 1 | 2021-08-14T17:59:21.000Z | 2021-08-14T17:59:21.000Z | output/models/ms_data/datatypes/facets/non_negative_integer/non_negative_integer_min_exclusive004_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | 4 | 2020-02-12T21:30:44.000Z | 2020-04-15T20:06:46.000Z | output/models/ms_data/datatypes/facets/non_negative_integer/non_negative_integer_min_exclusive004_xsd/__init__.py | tefra/xsdata-w3c-tests | b6b6a4ac4e0ab610e4b50d868510a8b7105b1a5f | [
"MIT"
] | null | null | null | from output.models.ms_data.datatypes.facets.non_negative_integer.non_negative_integer_min_exclusive004_xsd.non_negative_integer_min_exclusive004 import (
FooType,
Test,
)
__all__ = [
"FooType",
"Test",
]
| 22.1 | 153 | 0.773756 | from output.models.ms_data.datatypes.facets.non_negative_integer.non_negative_integer_min_exclusive004_xsd.non_negative_integer_min_exclusive004 import (
FooType,
Test,
)
__all__ = [
"FooType",
"Test",
]
| true | true |
f719fd37c128d9a9db10d9a47902af2a5eb5d61e | 3,283 | py | Python | lektor/markdown/__init__.py | uk0/lektor | 21bdf99aa1183b4398043f87ba8ed137fad529ce | [
"BSD-3-Clause"
] | null | null | null | lektor/markdown/__init__.py | uk0/lektor | 21bdf99aa1183b4398043f87ba8ed137fad529ce | [
"BSD-3-Clause"
] | null | null | null | lektor/markdown/__init__.py | uk0/lektor | 21bdf99aa1183b4398043f87ba8ed137fad529ce | [
"BSD-3-Clause"
] | null | null | null | import sys
from typing import Any
from typing import Dict
from typing import Hashable
from typing import Type
from typing import TYPE_CHECKING
from weakref import ref as weakref
from deprecated import deprecated
from markupsafe import Markup
from lektor.markdown.controller import ControllerCache
from lektor.markdown.... | 30.682243 | 86 | 0.709108 | import sys
from typing import Any
from typing import Dict
from typing import Hashable
from typing import Type
from typing import TYPE_CHECKING
from weakref import ref as weakref
from deprecated import deprecated
from markupsafe import Markup
from lektor.markdown.controller import ControllerCache
from lektor.markdown.... | true | true |
f719fec77a658c0d0bd1fb9dff8594c94cc357ad | 59,113 | py | Python | venv/lib/python3.6/site-packages/bioblend/galaxy/objects/wrappers.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 1 | 2020-01-22T13:11:23.000Z | 2020-01-22T13:11:23.000Z | venv/lib/python3.6/site-packages/bioblend/galaxy/objects/wrappers.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | venv/lib/python3.6/site-packages/bioblend/galaxy/objects/wrappers.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | null | null | null | # pylint: disable=W0622,E1101
"""
A basic object-oriented interface for Galaxy entities.
"""
import abc
import json
from collections.abc import (
Iterable,
Mapping,
Sequence,
)
from typing import Tuple
import bioblend
from bioblend.util import abstractclass
__all__ = (
'Wrapper',
'Step',
'W... | 33.434955 | 210 | 0.612319 |
import abc
import json
from collections.abc import (
Iterable,
Mapping,
Sequence,
)
from typing import Tuple
import bioblend
from bioblend.util import abstractclass
__all__ = (
'Wrapper',
'Step',
'Workflow',
'LibraryContentInfo',
'HistoryContentInfo',
'DatasetContainer',
'Hi... | true | true |
f719fecd156687882e482eac8d27cf8aaffcf379 | 177 | py | Python | python/positive.py | scienceacademy/apcsp_2021 | 11efd0216d3042e556e726268c622d8f0d568c18 | [
"MIT"
] | null | null | null | python/positive.py | scienceacademy/apcsp_2021 | 11efd0216d3042e556e726268c622d8f0d568c18 | [
"MIT"
] | null | null | null | python/positive.py | scienceacademy/apcsp_2021 | 11efd0216d3042e556e726268c622d8f0d568c18 | [
"MIT"
] | null | null | null | def main():
n = get_positive_int()
def get_positive_int():
while True:
n = int(input("Enter a positive number: "))
if n > 0:
return n
main() | 19.666667 | 51 | 0.542373 | def main():
n = get_positive_int()
def get_positive_int():
while True:
n = int(input("Enter a positive number: "))
if n > 0:
return n
main() | true | true |
f719fee29c71e4ea44c3434fb019c8f5e47ff986 | 16,096 | py | Python | tests/test_brew_views.py | zgoda/brewlog | 13a930b328f81d01a2be9aca07d3b14703b80faa | [
"BSD-3-Clause"
] | 3 | 2019-03-11T04:30:06.000Z | 2020-01-26T03:21:52.000Z | tests/test_brew_views.py | zgoda/brewlog | 13a930b328f81d01a2be9aca07d3b14703b80faa | [
"BSD-3-Clause"
] | 23 | 2019-02-06T20:37:37.000Z | 2020-06-01T07:08:35.000Z | tests/test_brew_views.py | zgoda/brewlog | 13a930b328f81d01a2be9aca07d3b14703b80faa | [
"BSD-3-Clause"
] | null | null | null | import datetime
import pytest
from flask import url_for
from brewlog.ext import db
from brewlog.models import Brew
from . import BrewlogTests
class BrewViewTests(BrewlogTests):
@pytest.fixture(autouse=True)
def set_up(self, user_factory, brewery_factory):
self.public_user = user_factory(
... | 38.879227 | 88 | 0.636245 | import datetime
import pytest
from flask import url_for
from brewlog.ext import db
from brewlog.models import Brew
from . import BrewlogTests
class BrewViewTests(BrewlogTests):
@pytest.fixture(autouse=True)
def set_up(self, user_factory, brewery_factory):
self.public_user = user_factory(
... | true | true |
f719ffebb722b8308f0638a092a790eb9e2845a8 | 18,480 | py | Python | mindmeld/converter/dialogflow.py | derekmpham/mindmeld | 18189f956e4e3eb92df61fde95ec82f73b9efa91 | [
"Apache-2.0"
] | null | null | null | mindmeld/converter/dialogflow.py | derekmpham/mindmeld | 18189f956e4e3eb92df61fde95ec82f73b9efa91 | [
"Apache-2.0"
] | null | null | null | mindmeld/converter/dialogflow.py | derekmpham/mindmeld | 18189f956e4e3eb92df61fde95ec82f73b9efa91 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (c) 2015 Cisco Systems, Inc. and others. 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... | 39.069767 | 97 | 0.541288 |
import json
import logging
import os
import re
from sklearn.model_selection import train_test_split
from mindmeld.converter.converter import Converter
logger = logging.getLogger(__name__)
class DialogflowConverter(Converter):
sys_entity_map = {
"@sys.date-time": "sys_interval",
"@sys.date": ... | true | true |
f71a00fd7c45368e46d3c54f89b23447c46a85a7 | 406 | py | Python | 001085StepikPythonIntrO/Stepik001085PythonIntrOсh01p03_20200410.py | SafonovMikhail/python_000577 | 739f764e80f1ca354386f00b8e9db1df8c96531d | [
"Apache-2.0"
] | null | null | null | 001085StepikPythonIntrO/Stepik001085PythonIntrOсh01p03_20200410.py | SafonovMikhail/python_000577 | 739f764e80f1ca354386f00b8e9db1df8c96531d | [
"Apache-2.0"
] | null | null | null | 001085StepikPythonIntrO/Stepik001085PythonIntrOсh01p03_20200410.py | SafonovMikhail/python_000577 | 739f764e80f1ca354386f00b8e9db1df8c96531d | [
"Apache-2.0"
] | null | null | null | # print(int("a"))
print(int(995.23)) # отбрасывание дробной части
print(float(42)) # приведение к виду с плавающей точкой
print(2 ** 2018) # поддержка длинной арифметики
pow = str(2 ** 2018) # количество цифр
print(pow)
# for i in pow:
# print(pow(i))
print(len(pow))
print("Yin" + " " + "Yang")
print("because ... | 23.882353 | 56 | 0.642857 | print(int(995.23)) print(float(42)) print(2 ** 2018) pow = str(2 ** 2018) print(pow)
print(len(pow))
print("Yin" + " " + "Yang")
print("because " * 42)
pow2=int((str(2) * 100)) ** 2
print(pow2)
print(str(2))
print(len(str(pow2))) | true | true |
f71a011d3e1d15a38ea8652521b28f6d01d84fa7 | 23,145 | py | Python | library.py | whitehead421/library | 2d1d3ef50127560ad6da76b5763ff45bb6d25761 | [
"MIT"
] | null | null | null | library.py | whitehead421/library | 2d1d3ef50127560ad6da76b5763ff45bb6d25761 | [
"MIT"
] | null | null | null | library.py | whitehead421/library | 2d1d3ef50127560ad6da76b5763ff45bb6d25761 | [
"MIT"
] | null | null | null | import time
import string
import random
import os
from termcolor import colored
from collections import Counter
clean_the_screen = ("cls" if os.name == "nt" else "clear")
# Function for listing books with their full information.
def listBooks():
file = open("books.txt", "r")
lines = file.readlines()
f... | 32.87642 | 158 | 0.572391 | import time
import string
import random
import os
from termcolor import colored
from collections import Counter
clean_the_screen = ("cls" if os.name == "nt" else "clear")
def listBooks():
file = open("books.txt", "r")
lines = file.readlines()
file.close()
for i in lines:
splitted = i.split(",")
... | true | true |
f71a0395c544caeb8e59eb6aa3e37e0cba7e4d34 | 325 | py | Python | test.py | deancolten/buzzsprout-manager | a630ee39171b7086ac738e29b721b73c39a1581f | [
"MIT"
] | null | null | null | test.py | deancolten/buzzsprout-manager | a630ee39171b7086ac738e29b721b73c39a1581f | [
"MIT"
] | null | null | null | test.py | deancolten/buzzsprout-manager | a630ee39171b7086ac738e29b721b73c39a1581f | [
"MIT"
] | null | null | null | from bsm import Manager, Episode, EpisodeGroup
from dotenv import load_dotenv
import os
load_dotenv()
ID = os.environ.get("ID")
TOKEN = os.environ.get("TOKEN")
manager = Manager(ID, TOKEN)
print(manager.test_api())
ep = Episode(**{'title': "test upload"})
res = manager.post_episode(ep, 'testfile.mp3', None)
print(... | 19.117647 | 52 | 0.723077 | from bsm import Manager, Episode, EpisodeGroup
from dotenv import load_dotenv
import os
load_dotenv()
ID = os.environ.get("ID")
TOKEN = os.environ.get("TOKEN")
manager = Manager(ID, TOKEN)
print(manager.test_api())
ep = Episode(**{'title': "test upload"})
res = manager.post_episode(ep, 'testfile.mp3', None)
print(... | true | true |
f71a03a12dbb6d843747f75d2f29f96ad24a5738 | 13,861 | py | Python | synapse/rest/media/v1/_base.py | Oliver-Hanikel/synapse | 6276e685345cff0b1dc32a02354914a39da911f0 | [
"Apache-2.0"
] | null | null | null | synapse/rest/media/v1/_base.py | Oliver-Hanikel/synapse | 6276e685345cff0b1dc32a02354914a39da911f0 | [
"Apache-2.0"
] | null | null | null | synapse/rest/media/v1/_base.py | Oliver-Hanikel/synapse | 6276e685345cff0b1dc32a02354914a39da911f0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
# Copyright 2019-2021 The Matrix.org Foundation C.I.C.
#
# 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.o... | 32.011547 | 88 | 0.611283 |
import logging
import os
import urllib
from typing import Awaitable, Dict, Generator, List, Optional, Tuple
from twisted.internet.interfaces import IConsumer
from twisted.protocols.basic import FileSender
from twisted.web.http import Request
from synapse.api.errors import Codes, SynapseError, cs_error
from synapse.h... | true | true |
f71a053bb305614ab4f994386a8208bfe513245c | 1,996 | py | Python | dataslots/__init__.py | cl0ne/dataslots | a91634f33e25c09e48e834a46424b9f80153efa3 | [
"MIT"
] | null | null | null | dataslots/__init__.py | cl0ne/dataslots | a91634f33e25c09e48e834a46424b9f80153efa3 | [
"MIT"
] | null | null | null | dataslots/__init__.py | cl0ne/dataslots | a91634f33e25c09e48e834a46424b9f80153efa3 | [
"MIT"
] | null | null | null | from dataclasses import fields
from warnings import warn
__all__ = ['dataslots', 'with_slots']
def with_slots(*args, **kwargs):
warn("Use dataslots decorator instead of with_slots", category=PendingDeprecationWarning, stacklevel=2)
return dataslots(*args, **kwargs)
def dataslots(_cls=None, *, add_dict=Fals... | 35.642857 | 107 | 0.657816 | from dataclasses import fields
from warnings import warn
__all__ = ['dataslots', 'with_slots']
def with_slots(*args, **kwargs):
warn("Use dataslots decorator instead of with_slots", category=PendingDeprecationWarning, stacklevel=2)
return dataslots(*args, **kwargs)
def dataslots(_cls=None, *, add_dict=Fals... | true | true |
f71a0540bc87f2ea7b4736b69e7e3edf50ca90fb | 4,050 | py | Python | benchmark/startQiskit_Class2296.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_Class2296.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_Class2296.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=33
import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2
import numpy as np
import networkx as nx
def bitwise_... | 34.322034 | 140 | 0.647407 | import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2
import numpy as np
import networkx as nx
def bitwise_xor(s: str, t: str) -> str:
len... | true | true |
f71a06034e69e3e7408c6a1366ef06e34015e677 | 7,238 | py | Python | complex_networks_keras_tf1/models/resnet_blocks_3d.py | QinggangSUN/keras_complex_valued_networks | e7a6c9238645e87a679328e9f8e8834ad0f716e2 | [
"MIT"
] | 8 | 2020-11-29T11:50:04.000Z | 2022-01-15T15:17:47.000Z | complex_networks_keras_tf1/models/resnet_blocks_3d.py | QinggangSUN/keras_complex_valued_networks | e7a6c9238645e87a679328e9f8e8834ad0f716e2 | [
"MIT"
] | null | null | null | complex_networks_keras_tf1/models/resnet_blocks_3d.py | QinggangSUN/keras_complex_valued_networks | e7a6c9238645e87a679328e9f8e8834ad0f716e2 | [
"MIT"
] | 1 | 2021-11-29T08:22:17.000Z | 2021-11-29T08:22:17.000Z | # -*- coding: utf-8 -*-
"""This module implements a number of popular two-dimensional complex valued residual blocks."""
# Authors: Qinggang Sun
#
# Reference:
# Allen Goodman, Allen Goodman, Claire McQuin, Hans Gaiser, et al. keras-resnet
# https://github.com/broadinstitute/keras-resnet
# pylint:disab... | 36.555556 | 119 | 0.644515 |
import keras.layers
import keras.regularizers
from ..layers.activations import layer_activation
from ..layers.bn import ComplexBatchNormalization
from ..layers.conv import ComplexConv3D
def basic_3d(filters,
stage=0,
block=0,
kernel_size=3,
numerical_name=False... | true | true |
f71a06156e7e11289ee61b52977cfcf127cb084b | 1,966 | py | Python | test/docker/integration/kong_client.py | coolersport/kong-oidc | 56393b4f4cca051d2ed9fdba145e679d03aab116 | [
"Apache-2.0"
] | 3 | 2019-09-06T06:27:06.000Z | 2020-03-28T03:22:24.000Z | test/docker/integration/kong_client.py | coolersport/kong-oidc | 56393b4f4cca051d2ed9fdba145e679d03aab116 | [
"Apache-2.0"
] | 1 | 2020-10-30T16:23:27.000Z | 2020-10-30T16:23:27.000Z | test/docker/integration/kong_client.py | coolersport/kong-oidc | 56393b4f4cca051d2ed9fdba145e679d03aab116 | [
"Apache-2.0"
] | 5 | 2019-03-18T22:12:16.000Z | 2022-03-03T22:05:06.000Z | import requests
class KongClient:
def __init__(self, url):
self._endpoint = url
self._session = requests.session()
def create_service(self, name, upstream_url):
url = "{}/services".format(self._endpoint)
payload = {
"name": name,
"url": upstr... | 32.766667 | 76 | 0.558494 | import requests
class KongClient:
def __init__(self, url):
self._endpoint = url
self._session = requests.session()
def create_service(self, name, upstream_url):
url = "{}/services".format(self._endpoint)
payload = {
"name": name,
"url": upstr... | true | true |
f71a0625c1f550c878a13bf9475bc05dbf22e8a9 | 121 | py | Python | docker/optimization/pyOpt/tags/v1.2.0/pyOpt/pyFILTERSD/__init__.py | liujiamingustc/phd | 4f815a738abad43531d02ac66f5bd0d9a1def52a | [
"Apache-2.0"
] | 3 | 2021-01-06T03:01:18.000Z | 2022-03-21T03:02:55.000Z | docker/optimization/pyOpt/tags/v1.2.0/pyOpt/pyFILTERSD/__init__.py | liujiamingustc/phd | 4f815a738abad43531d02ac66f5bd0d9a1def52a | [
"Apache-2.0"
] | null | null | null | docker/optimization/pyOpt/tags/v1.2.0/pyOpt/pyFILTERSD/__init__.py | liujiamingustc/phd | 4f815a738abad43531d02ac66f5bd0d9a1def52a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
try:
from pyFILTERSD import FILTERSD
__all__ = ['FILTERSD']
except:
__all__ = []
#end
| 13.444444 | 35 | 0.636364 |
try:
from pyFILTERSD import FILTERSD
__all__ = ['FILTERSD']
except:
__all__ = []
| true | true |
f71a062d2b5783e4fd92b44153a453460f29e699 | 53,902 | py | Python | Lib/http/client.py | treebee/cpython | e152169da95b52fa41931572bc90857253c4a5dd | [
"CNRI-Python-GPL-Compatible"
] | 1 | 2019-05-29T18:22:03.000Z | 2019-05-29T18:22:03.000Z | Lib/http/client.py | treebee/cpython | e152169da95b52fa41931572bc90857253c4a5dd | [
"CNRI-Python-GPL-Compatible"
] | 4 | 2022-03-30T01:50:22.000Z | 2022-03-30T01:50:28.000Z | Lib/http/client.py | treebee/cpython | e152169da95b52fa41931572bc90857253c4a5dd | [
"CNRI-Python-GPL-Compatible"
] | null | null | null | r"""HTTP/1.1 client library
<intro stuff goes here>
<other stuff, too>
HTTPConnection goes through a number of "states", which define when a client
may legally make another request or fetch the response for a particular
request. This diagram details these state transitions:
(null)
|
| HTTPConnection(... | 37.020604 | 82 | 0.571352 |
import email.parser
import email.message
import http
import io
import re
import socket
import collections.abc
from urllib.parse import urlsplit
__all__ = ["HTTPResponse", "HTTPConnection",
"HTTPException", "NotConnected", "UnknownProtocol",
"UnknownTransferEncoding", "UnimplementedFileMode",
... | true | true |
f71a07d0760e6b2878001901d08de4bc02ae7c09 | 3,381 | py | Python | static_data/mk_lookup.py | flyingsymbols/arewebeatingcovid19 | 78370472432700bb84796035c93868fb1887c055 | [
"MIT"
] | 1 | 2020-04-18T08:41:00.000Z | 2020-04-18T08:41:00.000Z | static_data/mk_lookup.py | flyingsymbols/arewebeatingcovid19 | 78370472432700bb84796035c93868fb1887c055 | [
"MIT"
] | null | null | null | static_data/mk_lookup.py | flyingsymbols/arewebeatingcovid19 | 78370472432700bb84796035c93868fb1887c055 | [
"MIT"
] | null | null | null | import os
import csv
import copy
import json
DIR = os.path.dirname(__file__)
def rel(*p): return os.path.normpath(os.path.join(DIR, *p))
CENSUS_DATA = rel('nst-est2019-alldata.csv')
OUT_JSON = rel('state_data.json')
def main():
state_data = copy.deepcopy(STATE_DATA)
state_name_ind = {} # { name: ind of ... | 33.147059 | 70 | 0.525288 | import os
import csv
import copy
import json
DIR = os.path.dirname(__file__)
def rel(*p): return os.path.normpath(os.path.join(DIR, *p))
CENSUS_DATA = rel('nst-est2019-alldata.csv')
OUT_JSON = rel('state_data.json')
def main():
state_data = copy.deepcopy(STATE_DATA)
state_name_ind = {} state_abbrev_... | true | true |
f71a09128c188832b08bc19072a6ef2f2c8d9dde | 3,136 | py | Python | music_preprocessor/music_preprocessor.py | offy284/Keras-GAN | 6652c626ba584ffd1c25ca4e925e6f131077395c | [
"MIT"
] | null | null | null | music_preprocessor/music_preprocessor.py | offy284/Keras-GAN | 6652c626ba584ffd1c25ca4e925e6f131077395c | [
"MIT"
] | null | null | null | music_preprocessor/music_preprocessor.py | offy284/Keras-GAN | 6652c626ba584ffd1c25ca4e925e6f131077395c | [
"MIT"
] | null | null | null | import itertools
import shutil
import os
from os import listdir
from os.path import isfile, join
from tqdm import tqdm
import numpy as np
import scipy
from scipy.io.wavfile import write, read
from scipy.fftpack import fft
from scipy import signal
from scipy.fft import fftshift
import matplotlib.pyplot as plt
from sklea... | 29.866667 | 112 | 0.607781 | import itertools
import shutil
import os
from os import listdir
from os.path import isfile, join
from tqdm import tqdm
import numpy as np
import scipy
from scipy.io.wavfile import write, read
from scipy.fftpack import fft
from scipy import signal
from scipy.fft import fftshift
import matplotlib.pyplot as plt
from sklea... | true | true |
f71a09cfb0b4712bce6ade7ab4148ea05334dfee | 1,077 | py | Python | database/dbclient.py | sonudoo/password-manager | 6fa1d2ebeba5b0f9cff200b32a581321d109b9cd | [
"MIT"
] | null | null | null | database/dbclient.py | sonudoo/password-manager | 6fa1d2ebeba5b0f9cff200b32a581321d109b9cd | [
"MIT"
] | null | null | null | database/dbclient.py | sonudoo/password-manager | 6fa1d2ebeba5b0f9cff200b32a581321d109b9cd | [
"MIT"
] | null | null | null | import pymongo
class DbClient:
"""Creates an instance of pymongo client and stores it in a private variable.
The instance of this class is injected as a dependency for request validators and processors.
Attributes:
database (Database): The database object.
collection_list (list): List of ... | 32.636364 | 97 | 0.637883 | import pymongo
class DbClient:
database = None
collection_list = None
def __init__(self, mongo_uri, database):
client = pymongo.MongoClient(mongo_uri)
self.database = client[database]
self.collection_list = [collection for collection in self.database.collection_names()]
de... | true | true |
f71a0a1f8ed72da50b25bdb3d34573679f492d53 | 4,542 | py | Python | tests/clvm/test_chialisp_deserialization.py | Tony4467/littlelambocoin-blockchain | 3d4f2b577cd5a2feb324fca50e0981a728583aee | [
"Apache-2.0"
] | 6 | 2021-07-15T16:52:46.000Z | 2021-09-27T16:57:08.000Z | tests/clvm/test_chialisp_deserialization.py | Tony4467/littlelambocoin-blockchain | 3d4f2b577cd5a2feb324fca50e0981a728583aee | [
"Apache-2.0"
] | 6 | 2021-07-27T08:17:34.000Z | 2021-11-30T11:39:19.000Z | tests/clvm/test_chialisp_deserialization.py | Tony4467/littlelambocoin-blockchain | 3d4f2b577cd5a2feb324fca50e0981a728583aee | [
"Apache-2.0"
] | 7 | 2021-08-15T15:10:58.000Z | 2021-10-04T16:47:39.000Z | from unittest import TestCase
from littlelambocoin.types.blockchain_format.program import Program, INFINITE_COST
from littlelambocoin.util.byte_types import hexstr_to_bytes
from littlelambocoin.wallet.puzzles.load_clvm import load_clvm
DESERIALIZE_MOD = load_clvm("littlelambocoinlisp_deserialisation.clvm", package_or... | 39.495652 | 264 | 0.624835 | from unittest import TestCase
from littlelambocoin.types.blockchain_format.program import Program, INFINITE_COST
from littlelambocoin.util.byte_types import hexstr_to_bytes
from littlelambocoin.wallet.puzzles.load_clvm import load_clvm
DESERIALIZE_MOD = load_clvm("littlelambocoinlisp_deserialisation.clvm", package_or... | true | true |
f71a0aa7e2a9704ecbc6e1a45727204696ea1a5b | 2,036 | py | Python | Discord 1.0.0a - REWRITE/EstruturaBots/CogsSharding/main.py | Algueem/Discord-Bot-Python-Tutoriais | cd126828a21fba4be584ffb62f923fa12086307b | [
"MIT"
] | 1 | 2018-10-14T16:45:32.000Z | 2018-10-14T16:45:32.000Z | Discord 1.0.0a - REWRITE/EstruturaBots/CogsSharding/main.py | ikrost/Discord-Bot-Python-Tutoriais | cd126828a21fba4be584ffb62f923fa12086307b | [
"MIT"
] | null | null | null | Discord 1.0.0a - REWRITE/EstruturaBots/CogsSharding/main.py | ikrost/Discord-Bot-Python-Tutoriais | cd126828a21fba4be584ffb62f923fa12086307b | [
"MIT"
] | 2 | 2019-04-26T21:37:38.000Z | 2019-05-07T17:37:26.000Z | import discord
from discord.ext import commands
import json
#vamos abrir o setup json para pegar as informaçoes
with open('bot_setup.json') as vagner:
bot_settings =json.load(vagner)
#lista de comandos
# cmds.info o cmds que dizer o nome da pastar e o info o nome do arquivo
#pode fazer tbm cmds.adm.ban caso qu... | 33.377049 | 121 | 0.632613 | import discord
from discord.ext import commands
import json
with open('bot_setup.json') as vagner:
bot_settings =json.load(vagner)
cmd_open=['cmds.info','cmds.cooldown']
class main(commands.AutoShardedBot):
def __init__(self):
super().__init__(command_prefix=bot_settings['prefixo'],
... | true | true |
f71a0aff4fcdf231c01d2475d9139acabde40491 | 1,135 | py | Python | setup.py | hugis/robotframework-djangorobotlibrary | 89400ea24a5d8ecf4c619fd39dc7d0a547c73fe7 | [
"MIT"
] | null | null | null | setup.py | hugis/robotframework-djangorobotlibrary | 89400ea24a5d8ecf4c619fd39dc7d0a547c73fe7 | [
"MIT"
] | null | null | null | setup.py | hugis/robotframework-djangorobotlibrary | 89400ea24a5d8ecf4c619fd39dc7d0a547c73fe7 | [
"MIT"
] | null | null | null | from os import path
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
with open(path.join(here, "README.md"), encoding="utf-8") as f:
long_description = f.read()
setup(
name="robotframework-djangorobotlibrary",
version="19.1a0",
description="A Robot Framework l... | 31.527778 | 78 | 0.656388 | from os import path
from setuptools import setup, find_packages
here = path.abspath(path.dirname(__file__))
with open(path.join(here, "README.md"), encoding="utf-8") as f:
long_description = f.read()
setup(
name="robotframework-djangorobotlibrary",
version="19.1a0",
description="A Robot Framework l... | true | true |
f71a0b9b1f1d422978ee7d52875c6f364e06e910 | 201 | py | Python | api/words_vector/admin.py | leandrocamposcardoso/VetorDePalavras | 76d442d0343e85a0edc55ca91b76480c30b3127a | [
"MIT"
] | null | null | null | api/words_vector/admin.py | leandrocamposcardoso/VetorDePalavras | 76d442d0343e85a0edc55ca91b76480c30b3127a | [
"MIT"
] | null | null | null | api/words_vector/admin.py | leandrocamposcardoso/VetorDePalavras | 76d442d0343e85a0edc55ca91b76480c30b3127a | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Logs
# Register your models here.
@admin.register(Logs)
class TextAdmin(admin.ModelAdmin):
list_display = ('files', 'vocabulary', 'vectors')
| 20.1 | 53 | 0.746269 | from django.contrib import admin
from .models import Logs
@admin.register(Logs)
class TextAdmin(admin.ModelAdmin):
list_display = ('files', 'vocabulary', 'vectors')
| true | true |
f71a0bd6b7d9c82ddfd1fe5eeabf8b4cdd16ce54 | 1,108 | py | Python | fake_fs.py | osteotek/yamr | d54a092a8520c4b3133db9a87d4fc013879fbf33 | [
"MIT"
] | 3 | 2017-07-11T15:33:35.000Z | 2021-03-11T22:14:33.000Z | fake_fs.py | osteotek/yamr | d54a092a8520c4b3133db9a87d4fc013879fbf33 | [
"MIT"
] | null | null | null | fake_fs.py | osteotek/yamr | d54a092a8520c4b3133db9a87d4fc013879fbf33 | [
"MIT"
] | 1 | 2017-02-19T21:46:35.000Z | 2017-02-19T21:46:35.000Z | import os
from enums import Status
class FakeFS:
def __init__(self, base_dir="/var/fake_fs"):
self.base_dir = base_dir
def get_chunk(self, path):
full_path = self.base_dir + path
if not os.path.isfile(full_path):
return {'status': Status.not_found}
data = None
... | 25.767442 | 62 | 0.5713 | import os
from enums import Status
class FakeFS:
def __init__(self, base_dir="/var/fake_fs"):
self.base_dir = base_dir
def get_chunk(self, path):
full_path = self.base_dir + path
if not os.path.isfile(full_path):
return {'status': Status.not_found}
data = None
... | true | true |
f71a0c12785a008b991a752c3e60e2420e801e74 | 879 | py | Python | MatchSocks.py | zubin-madon/PottyPunksNFT | d43234641ea3f30c963fb3af7edb249862a62788 | [
"MIT"
] | null | null | null | MatchSocks.py | zubin-madon/PottyPunksNFT | d43234641ea3f30c963fb3af7edb249862a62788 | [
"MIT"
] | null | null | null | MatchSocks.py | zubin-madon/PottyPunksNFT | d43234641ea3f30c963fb3af7edb249862a62788 | [
"MIT"
] | null | null | null | #Match socks to pant colour.
import numpy as np
from PIL import Image
import urllib.request
import os
directory = 'layers/layers_for_art_engine/Pant'
for filename in os.listdir(directory):
image = os.path.join(directory, filename)
pant = Image.open(image)
socks = Image.open('layers/socks.png') #change the ... | 35.16 | 89 | 0.622298 | import numpy as np
from PIL import Image
import urllib.request
import os
directory = 'layers/layers_for_art_engine/Pant'
for filename in os.listdir(directory):
image = os.path.join(directory, filename)
pant = Image.open(image)
socks = Image.open('layers/socks.png') width, height = socks.size
pant_c... | true | true |
f71a0cdd77d197858c517e9b653ef4a7fe7e5d24 | 1,462 | py | Python | gae/third_party/poster/__init__.py | Purus/LaunchKitDocker | b8aaf9f1d8943a76ae7e0a81e15e6bebd4b9b08e | [
"Apache-2.0"
] | 2,341 | 2016-07-27T17:23:23.000Z | 2022-03-28T03:55:15.000Z | gae/third_party/poster/__init__.py | Purus/LaunchKitDocker | b8aaf9f1d8943a76ae7e0a81e15e6bebd4b9b08e | [
"Apache-2.0"
] | 52 | 2016-07-27T23:12:21.000Z | 2022-03-11T23:17:41.000Z | gae/third_party/poster/__init__.py | Purus/LaunchKitDocker | b8aaf9f1d8943a76ae7e0a81e15e6bebd4b9b08e | [
"Apache-2.0"
] | 324 | 2016-07-27T18:34:53.000Z | 2022-03-25T08:56:24.000Z | # Copyright (c) 2011 Chris AtLee
#
# 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, publish, distrib... | 44.30303 | 79 | 0.776334 |
import streaminghttp
import encode
version = (0, 8, 1) | true | true |
f71a0d63e90a61ad5e75bd468ec2c1a1b9348342 | 5,306 | py | Python | test/functional/abc-p2p-avalanche.py | kryvel/bitcoin-abc | 6330d8ccc8b1b720c42c8c9239dadc8240ca5025 | [
"MIT"
] | null | null | null | test/functional/abc-p2p-avalanche.py | kryvel/bitcoin-abc | 6330d8ccc8b1b720c42c8c9239dadc8240ca5025 | [
"MIT"
] | null | null | null | test/functional/abc-p2p-avalanche.py | kryvel/bitcoin-abc | 6330d8ccc8b1b720c42c8c9239dadc8240ca5025 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2018 The Bitcoin developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the resolution of forks via avalanche."""
import random
from test_framework.mininode import P2PInterface, m... | 37.366197 | 95 | 0.637392 | import random
from test_framework.mininode import P2PInterface, mininode_lock
from test_framework.messages import AvalancheVote, CInv, msg_avapoll
from test_framework.test_framework import BitcoinTestFramework
from test_framework.util import assert_equal, wait_until
from test_framework import schnorr
BLOCK_ACCEPTED ... | true | true |
f71a0d98d569fd7b3be4fc2f4b330fae23d90e4b | 132,009 | py | Python | tofu/geom/_core_optics.py | Didou09/tofu | 4a4e1f058bab8e7556ed9d518f90807cec605476 | [
"MIT"
] | 6 | 2016-09-15T17:01:19.000Z | 2017-03-06T22:53:10.000Z | tofu/geom/_core_optics.py | Didou09/tofu | 4a4e1f058bab8e7556ed9d518f90807cec605476 | [
"MIT"
] | 9 | 2016-09-14T17:23:52.000Z | 2017-04-13T07:30:07.000Z | tofu/geom/_core_optics.py | Didou09/tofu | 4a4e1f058bab8e7556ed9d518f90807cec605476 | [
"MIT"
] | null | null | null |
"""
This module is the geometrical part of the ToFu general package
It includes all functions and object classes necessary for tomography on Tokamaks
"""
# Built-in
import sys
import os
import warnings
import copy
# Common
import numpy as np
import scipy.interpolate as scpinterp
import scipy.stats as scpstats
impor... | 35.852526 | 81 | 0.521275 |
import sys
import os
import warnings
import copy
import numpy as np
import scipy.interpolate as scpinterp
import scipy.stats as scpstats
import datetime as dtm
import matplotlib.pyplot as plt
import matplotlib as mpl
from tofu import __version__ as __version__
import tofu.pathfile as tfpf
import tofu.utils as util... | true | true |
f71a0da9d68a3d4c9024e6fcb718688385715211 | 83 | py | Python | buttonlist/src/buttonlist/__main__.py | pmfrank/beeware-tutorials | 96274b0a735bd468e946111baf441a527ff0b0d5 | [
"BSD-2-Clause"
] | 1 | 2021-06-04T05:51:39.000Z | 2021-06-04T05:51:39.000Z | buttonlist/src/buttonlist/__main__.py | pmfrank/beeware-tutorials | 96274b0a735bd468e946111baf441a527ff0b0d5 | [
"BSD-2-Clause"
] | null | null | null | buttonlist/src/buttonlist/__main__.py | pmfrank/beeware-tutorials | 96274b0a735bd468e946111baf441a527ff0b0d5 | [
"BSD-2-Clause"
] | null | null | null | from buttonlist.app import main
if __name__ == '__main__':
main().main_loop()
| 16.6 | 31 | 0.698795 | from buttonlist.app import main
if __name__ == '__main__':
main().main_loop()
| true | true |
f71a0f4dbef3bd901ce744bc93811b52faddf399 | 34,662 | py | Python | anuvaad-etl/anuvaad-extractor/document-processor/evaluator/evaluator_string/src/notebooks/tesseract_ocr_evaluation_local.py | srihari-nagaraj/anuvaad | b09b01a033a033e97db6e404c088e0e6332053e4 | [
"MIT"
] | null | null | null | anuvaad-etl/anuvaad-extractor/document-processor/evaluator/evaluator_string/src/notebooks/tesseract_ocr_evaluation_local.py | srihari-nagaraj/anuvaad | b09b01a033a033e97db6e404c088e0e6332053e4 | [
"MIT"
] | null | null | null | anuvaad-etl/anuvaad-extractor/document-processor/evaluator/evaluator_string/src/notebooks/tesseract_ocr_evaluation_local.py | srihari-nagaraj/anuvaad | b09b01a033a033e97db6e404c088e0e6332053e4 | [
"MIT"
] | null | null | null | import glob
import uuid
import json
import requests
import copy,time
import os
import cv2
import numpy as np
from time import sleep
import pandas as pd
import logging
from collections import Counter
import pytesseract
from pytesseract import Output
#from pytesseract import pytesseract
from difflib import SequenceMatche... | 39.523375 | 267 | 0.585454 | import glob
import uuid
import json
import requests
import copy,time
import os
import cv2
import numpy as np
from time import sleep
import pandas as pd
import logging
from collections import Counter
import pytesseract
from pytesseract import Output
from difflib import SequenceMatcher
from io import StringIO
from dynami... | true | true |
f71a0fa1a2c43932c97418939b1e8e7d6e4bf79a | 4,010 | py | Python | tools/bitmap_converter.py | AlexShiLucky/nuttx-apps | 2bafb70ce1e7af96640c501d3ce3d2a2bf29c9e5 | [
"Apache-2.0"
] | 10 | 2021-03-15T03:58:06.000Z | 2021-12-30T15:33:38.000Z | tools/bitmap_converter.py | AlexShiLucky/nuttx-apps | 2bafb70ce1e7af96640c501d3ce3d2a2bf29c9e5 | [
"Apache-2.0"
] | 1 | 2021-02-24T12:30:54.000Z | 2021-02-24T12:30:54.000Z | tools/bitmap_converter.py | AlexShiLucky/nuttx-apps | 2bafb70ce1e7af96640c501d3ce3d2a2bf29c9e5 | [
"Apache-2.0"
] | 4 | 2021-03-06T09:35:58.000Z | 2021-05-24T14:34:11.000Z | #!/usr/bin/env python
'''This script converts from any image type supported by
Python imaging library to the RLE-encoded format used by
NxWidgets.
'''
from PIL import Image
def get_palette(img, maxcolors = 255):
'''Returns a list of colors. If there are too many colors in the image,
the least used are removed.
... | 26.912752 | 100 | 0.635162 |
'''This script converts from any image type supported by
Python imaging library to the RLE-encoded format used by
NxWidgets.
'''
from PIL import Image
def get_palette(img, maxcolors = 255):
'''Returns a list of colors. If there are too many colors in the image,
the least used are removed.
'''
img = img.conve... | false | true |
f71a1006eb8da62d4f7fca2700df5904cd0816c1 | 12,567 | py | Python | keras/wrappers/scikit_learn.py | phanvanthinh98/keras_LSTM | b22cff1e9fd762226ec3dc9d3af3e300484dd833 | [
"Apache-2.0"
] | 1 | 2021-05-03T05:10:03.000Z | 2021-05-03T05:10:03.000Z | keras/wrappers/scikit_learn.py | phanvanthinh98/keras_LSTM | b22cff1e9fd762226ec3dc9d3af3e300484dd833 | [
"Apache-2.0"
] | null | null | null | keras/wrappers/scikit_learn.py | phanvanthinh98/keras_LSTM | b22cff1e9fd762226ec3dc9d3af3e300484dd833 | [
"Apache-2.0"
] | 1 | 2021-11-25T00:17:16.000Z | 2021-11-25T00:17:16.000Z | # Copyright 2015 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.600567 | 80 | 0.659585 |
import copy
import types
import numpy as np
from keras import losses
from keras.models import Sequential
from keras.utils.generic_utils import has_arg
from keras.utils.np_utils import to_categorical
from tensorflow.python.util.tf_export import keras_export
class BaseWrapper(object):
def __init__(self, build_fn=... | true | true |
f71a12030f0c487777bd6c37ee0b866b3054ef36 | 1,894 | py | Python | backend/user/tests/test_models.py | Ssents/stonewell_tech | 2466dbd26105f630bccd87146253ac8adfc4e0bb | [
"MIT"
] | 1 | 2022-03-25T07:44:19.000Z | 2022-03-25T07:44:19.000Z | backend/user/tests/test_models.py | Ssents/stonewell_tech | 2466dbd26105f630bccd87146253ac8adfc4e0bb | [
"MIT"
] | null | null | null | backend/user/tests/test_models.py | Ssents/stonewell_tech | 2466dbd26105f630bccd87146253ac8adfc4e0bb | [
"MIT"
] | null | null | null | from django.test import TestCase, Client
from django.contrib.auth import get_user_model
class ModelTests(TestCase):
def test_create_user_with_email_successful(self):
'''
Test that creating a user with an email is successful
'''
email = 'test@gmail.com'
password = '456@3... | 32.101695 | 87 | 0.621964 | from django.test import TestCase, Client
from django.contrib.auth import get_user_model
class ModelTests(TestCase):
def test_create_user_with_email_successful(self):
email = 'test@gmail.com'
password = '456@3'
username = 'test1'
user = get_user_model().objects.create_user(
... | true | true |
f71a13679ad5560a4a0a810a20a468a27ec122dd | 6,128 | py | Python | devday/talk/migrations/0044_auto_20200310_2010.py | jenslauterbach/devday_website | a827c9237e656842542eff07ec9fa7b39716a0ee | [
"CC-BY-4.0",
"BSD-3-Clause"
] | 6 | 2018-09-30T20:18:01.000Z | 2020-03-12T09:03:38.000Z | devday/talk/migrations/0044_auto_20200310_2010.py | jenslauterbach/devday_website | a827c9237e656842542eff07ec9fa7b39716a0ee | [
"CC-BY-4.0",
"BSD-3-Clause"
] | 260 | 2018-09-30T14:17:57.000Z | 2022-03-04T13:48:34.000Z | devday/talk/migrations/0044_auto_20200310_2010.py | jenslauterbach/devday_website | a827c9237e656842542eff07ec9fa7b39716a0ee | [
"CC-BY-4.0",
"BSD-3-Clause"
] | 9 | 2018-09-30T13:17:21.000Z | 2020-10-03T12:55:05.000Z | # Generated by Django 2.2.10 on 2020-03-10 20:10
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
from django.db import migrations, models
def migrate_speakers(apps, schema_editor):
Talk = apps.get_model("talk", "Talk")
TalkPublishedSpeaker = apps.get_model("talk", "Tal... | 35.218391 | 88 | 0.436847 |
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
from django.db import migrations, models
def migrate_speakers(apps, schema_editor):
Talk = apps.get_model("talk", "Talk")
TalkPublishedSpeaker = apps.get_model("talk", "TalkPublishedSpeaker")
TalkDraftSpeaker = apps.g... | true | true |
f71a147252b727cb58683934b78cbaab53a991a4 | 14,687 | py | Python | torchreid/models/mobilenetv3.py | daniil-lyakhov/deep-object-reid | b0f7d6a2d4cff8c417a66d82c09d16788d81ec67 | [
"Apache-2.0"
] | null | null | null | torchreid/models/mobilenetv3.py | daniil-lyakhov/deep-object-reid | b0f7d6a2d4cff8c417a66d82c09d16788d81ec67 | [
"Apache-2.0"
] | null | null | null | torchreid/models/mobilenetv3.py | daniil-lyakhov/deep-object-reid | b0f7d6a2d4cff8c417a66d82c09d16788d81ec67 | [
"Apache-2.0"
] | null | null | null | import math
import torch
import torch.nn as nn
from torch.cuda.amp import autocast
from torchreid.losses import AngleSimpleLinear
from torchreid.ops import Dropout, EvalModeSetter, rsc
from .common import HSigmoid, HSwish, ModelInterface, make_divisible
import timm
from torchreid.integration.nncf.compression import ... | 34.315421 | 133 | 0.544291 | import math
import torch
import torch.nn as nn
from torch.cuda.amp import autocast
from torchreid.losses import AngleSimpleLinear
from torchreid.ops import Dropout, EvalModeSetter, rsc
from .common import HSigmoid, HSwish, ModelInterface, make_divisible
import timm
from torchreid.integration.nncf.compression import ... | true | true |
f71a168b25957243708b709f360ba988096918a1 | 674 | py | Python | setup.py | ashwin153/pdpyras | 19971ec2df9ab854a91b95a25de452483ea57af0 | [
"MIT"
] | 92 | 2018-08-16T21:35:02.000Z | 2022-03-30T06:52:21.000Z | setup.py | ashwin153/pdpyras | 19971ec2df9ab854a91b95a25de452483ea57af0 | [
"MIT"
] | 53 | 2018-11-26T20:18:01.000Z | 2022-03-22T17:25:19.000Z | setup.py | ashwin153/pdpyras | 19971ec2df9ab854a91b95a25de452483ea57af0 | [
"MIT"
] | 22 | 2018-10-18T14:36:12.000Z | 2022-02-06T21:52:47.000Z | from setuptools import setup, find_packages
__version__ = '4.3.0'
if __name__ == '__main__':
setup(
name='pdpyras',
description="PagerDuty REST API client",
long_description="A basic REST API client for PagerDuty based on Requests' Session class",
py_modules=['pdpyras'],
ve... | 33.7 | 98 | 0.614243 | from setuptools import setup, find_packages
__version__ = '4.3.0'
if __name__ == '__main__':
setup(
name='pdpyras',
description="PagerDuty REST API client",
long_description="A basic REST API client for PagerDuty based on Requests' Session class",
py_modules=['pdpyras'],
ve... | true | true |
f71a16f3990d1459e27c67ec2953c6e70264c9af | 421 | py | Python | configs/__init__.py | whiplash003/pytrorch_template | 4629ede6ade3359a12bd40269fced3b96e8d11b3 | [
"MIT"
] | 4 | 2019-10-11T01:08:47.000Z | 2021-02-27T13:37:05.000Z | configs/__init__.py | qilong97/PyTorch-Project-Framework | e1d791e9ac679907f94f0fbe7b9c930292cb61d3 | [
"MIT"
] | null | null | null | configs/__init__.py | qilong97/PyTorch-Project-Framework | e1d791e9ac679907f94f0fbe7b9c930292cb61d3 | [
"MIT"
] | 5 | 2019-11-01T09:25:00.000Z | 2021-08-23T02:48:45.000Z | import os
from .BaseConfig import BaseConfig
from .BaseTest import BaseTest
from .Env import env
from .Run import Run
__all__ = ['BaseConfig', 'BaseTest', 'Run', 'env', 'all']
def all(config, cfg_dir):
if not os.path.exists(cfg_dir):
os.makedirs(cfg_dir)
cfg_list = list()
for file in sorted(os... | 21.05 | 60 | 0.684086 | import os
from .BaseConfig import BaseConfig
from .BaseTest import BaseTest
from .Env import env
from .Run import Run
__all__ = ['BaseConfig', 'BaseTest', 'Run', 'env', 'all']
def all(config, cfg_dir):
if not os.path.exists(cfg_dir):
os.makedirs(cfg_dir)
cfg_list = list()
for file in sorted(os... | true | true |
f71a18336d3c0e2f947f297b8e9e9e31ea3bbe07 | 895 | py | Python | setup.py | zhs007/trdb2py | d07b874bd37085ed64b5c6c6c2c21a380024d082 | [
"Apache-2.0"
] | null | null | null | setup.py | zhs007/trdb2py | d07b874bd37085ed64b5c6c6c2c21a380024d082 | [
"Apache-2.0"
] | 43 | 2020-12-11T09:07:51.000Z | 2021-05-29T07:31:10.000Z | setup.py | zhs007/trdb2py | d07b874bd37085ed64b5c6c6c2c21a380024d082 | [
"Apache-2.0"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
with open("VERSION", "r") as fversion:
version = fversion.read()
setuptools.setup(
name="trdb2py",
version=version,
author="Zerro Zhao",
author_email="zerrozhao@gmail.com",
description="tradingdb2 for py... | 27.121212 | 54 | 0.620112 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
with open("VERSION", "r") as fversion:
version = fversion.read()
setuptools.setup(
name="trdb2py",
version=version,
author="Zerro Zhao",
author_email="zerrozhao@gmail.com",
description="tradingdb2 for py... | true | true |
f71a184c5dbe74ec302bac2087f436f411cf0919 | 2,633 | py | Python | data_config.py | XieResearchGroup/CLEIT | 226ece5a8763ac010610cbc9f66915caca92775e | [
"MIT"
] | null | null | null | data_config.py | XieResearchGroup/CLEIT | 226ece5a8763ac010610cbc9f66915caca92775e | [
"MIT"
] | null | null | null | data_config.py | XieResearchGroup/CLEIT | 226ece5a8763ac010610cbc9f66915caca92775e | [
"MIT"
] | null | null | null | import os
"""
configuration file includes all related multi-omics datasets
"""
root_data_folder = './data'
raw_data_folder = os.path.join(root_data_folder, 'raw_dat')
preprocessed_data_folder = os.path.join(root_data_folder, 'preprocessed_dat')
gex_feature_file = os.path.join(preprocessed_data_folder, 'uq1000_gex_fea... | 57.23913 | 96 | 0.821117 | import os
root_data_folder = './data'
raw_data_folder = os.path.join(root_data_folder, 'raw_dat')
preprocessed_data_folder = os.path.join(root_data_folder, 'preprocessed_dat')
gex_feature_file = os.path.join(preprocessed_data_folder, 'uq1000_gex_feature.csv')
xena_mut_uq_file = os.path.join(preprocessed_data_folder, '... | true | true |
f71a18b20364f8e9aea1382e54d3b363fe159bcb | 4,188 | py | Python | uptimer/events/meta.py | janw/uptimer | 967b5ed907d620f79ee29ab8be52ba89f1686513 | [
"Apache-2.0"
] | 1 | 2021-08-23T18:40:03.000Z | 2021-08-23T18:40:03.000Z | uptimer/events/meta.py | janw/uptimer | 967b5ed907d620f79ee29ab8be52ba89f1686513 | [
"Apache-2.0"
] | 1 | 2021-01-17T13:31:41.000Z | 2021-01-17T13:31:41.000Z | uptimer/events/meta.py | janw/uptimer | 967b5ed907d620f79ee29ab8be52ba89f1686513 | [
"Apache-2.0"
] | null | null | null | from abc import ABCMeta
from uuid import UUID
import jsonschema
from dateutil.parser import parse as dateparse
from uptimer.events import SCHEMATA_PATH
from uptimer.events.cache import schema_cache
from uptimer.helpers import to_bool, to_none
class EventDefinitionError(ValueError):
pass
class EventMeta(ABCMet... | 34.9 | 88 | 0.61915 | from abc import ABCMeta
from uuid import UUID
import jsonschema
from dateutil.parser import parse as dateparse
from uptimer.events import SCHEMATA_PATH
from uptimer.events.cache import schema_cache
from uptimer.helpers import to_bool, to_none
class EventDefinitionError(ValueError):
pass
class EventMeta(ABCMet... | true | true |
f71a191b20700bf1958d34785c00621fcbe6eda7 | 12,820 | py | Python | hvac/api/secrets_engines/gcp.py | ddeka2910/hvac | 80cf3950157bf003ee6622e6db84bb9d6c90e5f1 | [
"Apache-2.0"
] | 1 | 2020-12-14T04:01:10.000Z | 2020-12-14T04:01:10.000Z | hvac/api/secrets_engines/gcp.py | ddeka2910/hvac | 80cf3950157bf003ee6622e6db84bb9d6c90e5f1 | [
"Apache-2.0"
] | 2 | 2019-07-08T03:09:38.000Z | 2021-07-08T18:17:51.000Z | hvac/api/secrets_engines/gcp.py | ddeka2910/hvac | 80cf3950157bf003ee6622e6db84bb9d6c90e5f1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Gcp methods module."""
import json
import logging
from hvac import exceptions, utils
from hvac.api.vault_api_base import VaultApiBase
from hvac.constants.gcp import ALLOWED_SECRETS_TYPES, SERVICE_ACCOUNT_KEY_ALGORITHMS, SERVICE_ACCOUNT_KEY_TYPES
DEFAULT_MOUNT_POINT = '... | 39.690402 | 135 | 0.616147 | import json
import logging
from hvac import exceptions, utils
from hvac.api.vault_api_base import VaultApiBase
from hvac.constants.gcp import ALLOWED_SECRETS_TYPES, SERVICE_ACCOUNT_KEY_ALGORITHMS, SERVICE_ACCOUNT_KEY_TYPES
DEFAULT_MOUNT_POINT = 'gcp'
class Gcp(VaultApiBase):
def configure(self, credentials=Non... | true | true |
f71a193cb6d839929618acd446da28cc742371b1 | 2,846 | py | Python | examples/tutorial_api_python/02_whole_body_from_image.py | ExSidius/openpose | 69f64206d63a156fa60e9a0a0de6738d27d1c00d | [
"DOC"
] | 12 | 2019-05-10T09:56:39.000Z | 2021-08-09T03:42:28.000Z | examples/tutorial_api_python/02_whole_body_from_image.py | ExSidius/openpose | 69f64206d63a156fa60e9a0a0de6738d27d1c00d | [
"DOC"
] | null | null | null | examples/tutorial_api_python/02_whole_body_from_image.py | ExSidius/openpose | 69f64206d63a156fa60e9a0a0de6738d27d1c00d | [
"DOC"
] | 7 | 2019-06-14T03:38:09.000Z | 2021-08-09T03:43:27.000Z | # From Python
# It requires OpenCV installed for Python
import sys
import cv2
import os
from sys import platform
import argparse
# Import Openpose (Windows/Ubuntu/OSX)
dir_path = os.path.dirname(os.path.realpath(__file__))
try:
# Windows Import
if platform == "win32":
# Change these variables to point ... | 38.986301 | 289 | 0.685875 | import sys
import cv2
import os
from sys import platform
import argparse
dir_path = os.path.dirname(os.path.realpath(__file__))
try:
if platform == "win32":
sys.path.append(dir_path + '/../../python/openpose/Release');
os.environ['PATH'] = os.environ['PATH'] + ';' + dir_path + '/../../... | true | true |
f71a1a2a2d27e09348b69858a543626888f37405 | 21,978 | py | Python | lingvo/core/conv_layers_builder_test.py | Harshs27/lingvo | bd396e651488b2e2c4a7416be077b4a0226c87c8 | [
"Apache-2.0"
] | 2,611 | 2018-10-16T20:14:10.000Z | 2022-03-31T14:48:41.000Z | lingvo/core/conv_layers_builder_test.py | Harshs27/lingvo | bd396e651488b2e2c4a7416be077b4a0226c87c8 | [
"Apache-2.0"
] | 249 | 2018-10-27T06:02:29.000Z | 2022-03-30T18:00:39.000Z | lingvo/core/conv_layers_builder_test.py | Harshs27/lingvo | bd396e651488b2e2c4a7416be077b4a0226c87c8 | [
"Apache-2.0"
] | 436 | 2018-10-25T05:31:45.000Z | 2022-03-31T07:26:03.000Z | # Lint as: python3
# 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 ... | 35.620746 | 80 | 0.602193 |
from absl.testing import parameterized
from lingvo import compat as tf
from lingvo.core import bn_layers
from lingvo.core import conv_layers_builder
from lingvo.core import conv_layers_with_time_padding
from lingvo.core import layers
from lingvo.core import test_utils
import numpy as np
class ConvPaddedLayersTest(te... | true | true |
f71a1a4b45bdc87ee38fe7fcbd95d71913d56e29 | 3,212 | py | Python | flickr.py | vicrobot/Flickr-Downloader | fecac723fca3c0f3e72b9d4581b0bcf52dfda3b5 | [
"MIT"
] | null | null | null | flickr.py | vicrobot/Flickr-Downloader | fecac723fca3c0f3e72b9d4581b0bcf52dfda3b5 | [
"MIT"
] | null | null | null | flickr.py | vicrobot/Flickr-Downloader | fecac723fca3c0f3e72b9d4581b0bcf52dfda3b5 | [
"MIT"
] | null | null | null | import flickrapi
import flickr_api
import urllib.request
import os
import sys
if __name__ != "__main__":
print("File 'flickr.py' not meant for transcendings and imports, direct use only")
sys.exit(0)
#functions
def url_list_maker(uiv):
count = 0
photos = flickr.walk_user(user_id = uiv, per_page = 100,... | 29.740741 | 104 | 0.634184 | import flickrapi
import flickr_api
import urllib.request
import os
import sys
if __name__ != "__main__":
print("File 'flickr.py' not meant for transcendings and imports, direct use only")
sys.exit(0)
def url_list_maker(uiv):
count = 0
photos = flickr.walk_user(user_id = uiv, per_page = 100, extras = '... | true | true |
f71a1ac02563cd912e303318164fa03a1b3451a2 | 527 | py | Python | mydemo/matplotlibDemo/clickEvent.py | 541867329/pydata-notebook | 867f204d7abac96dbae80e6cdd2e3661e554d1dd | [
"MIT"
] | null | null | null | mydemo/matplotlibDemo/clickEvent.py | 541867329/pydata-notebook | 867f204d7abac96dbae80e6cdd2e3661e554d1dd | [
"MIT"
] | null | null | null | mydemo/matplotlibDemo/clickEvent.py | 541867329/pydata-notebook | 867f204d7abac96dbae80e6cdd2e3661e554d1dd | [
"MIT"
] | null | null | null | from matplotlib.pyplot import figure, show
import numpy as npy
from numpy.random import rand
if 1: # picking on a scatter plot (matplotlib.collections.RegularPolyCollection)
x, y, c, s = rand(4, 100)
def onpick3(event):
ind = event.ind
print('onpick3 scatter:', ind, npy.take(x, ind), npy.ta... | 23.954545 | 81 | 0.652751 | from matplotlib.pyplot import figure, show
import numpy as npy
from numpy.random import rand
if 1:
x, y, c, s = rand(4, 100)
def onpick3(event):
ind = event.ind
print('onpick3 scatter:', ind, npy.take(x, ind), npy.take(y, ind))
fig = figure()
ax1 = fig.add_subplot(111)
col = a... | true | true |
f71a1af80e296be1c22cd3a838643279ddd193cd | 313 | py | Python | Lib/objc/_IOAccelerator.py | kanishpatel/Pyto | feec7a1a54f635a6375fa7ede074ff35afbfbb95 | [
"MIT"
] | null | null | null | Lib/objc/_IOAccelerator.py | kanishpatel/Pyto | feec7a1a54f635a6375fa7ede074ff35afbfbb95 | [
"MIT"
] | null | null | null | Lib/objc/_IOAccelerator.py | kanishpatel/Pyto | feec7a1a54f635a6375fa7ede074ff35afbfbb95 | [
"MIT"
] | null | null | null | '''
Classes from the 'IOAccelerator' framework.
'''
try:
from rubicon.objc import ObjCClass
except ValueError:
def ObjCClass(name):
return None
def _Class(name):
try:
return ObjCClass(name)
except NameError:
return None
IOAccelMTLEvent = _Class('IOAccelMTLEvent')
| 15.65 | 43 | 0.661342 |
try:
from rubicon.objc import ObjCClass
except ValueError:
def ObjCClass(name):
return None
def _Class(name):
try:
return ObjCClass(name)
except NameError:
return None
IOAccelMTLEvent = _Class('IOAccelMTLEvent')
| true | true |
f71a1b665af36fbf12688a3e2396cbb73c2862b5 | 230 | py | Python | app/books/urls.py | bayocr/example-docker-django | 550d7ce3e0dd5643616245eed9cbb9ae96812c11 | [
"MIT"
] | null | null | null | app/books/urls.py | bayocr/example-docker-django | 550d7ce3e0dd5643616245eed9cbb9ae96812c11 | [
"MIT"
] | 1 | 2021-05-25T00:56:48.000Z | 2021-05-25T00:56:48.000Z | app/books/urls.py | bayocr/example-docker-django | 550d7ce3e0dd5643616245eed9cbb9ae96812c11 | [
"MIT"
] | null | null | null | from django.urls import path
from .views import BookDetailView, BookListView
app_name = 'books'
urlpatterns = [
path('', BookListView.as_view(), name='list'),
path('<int:pk>/', BookDetailView.as_view(), name='detail')
] | 23 | 62 | 0.695652 | from django.urls import path
from .views import BookDetailView, BookListView
app_name = 'books'
urlpatterns = [
path('', BookListView.as_view(), name='list'),
path('<int:pk>/', BookDetailView.as_view(), name='detail')
] | true | true |
f71a1c4b664e4d204ee0e4819ed647e5e03c985d | 318 | py | Python | cwr_validator/__init__.py | weso/CWR-Validator | 18b83136f44f5bdd2f66c9af866b0e37acf682cb | [
"MIT"
] | 16 | 2015-04-21T15:50:14.000Z | 2021-07-14T07:22:32.000Z | cwr_validator/__init__.py | weso/CWR-Validator | 18b83136f44f5bdd2f66c9af866b0e37acf682cb | [
"MIT"
] | 12 | 2015-02-02T11:32:01.000Z | 2015-04-20T10:45:36.000Z | cwr_validator/__init__.py | weso/CWR-Validator | 18b83136f44f5bdd2f66c9af866b0e37acf682cb | [
"MIT"
] | 4 | 2015-02-01T21:45:03.000Z | 2018-08-20T07:51:02.000Z | # -*- coding: utf-8 -*-
from cwr_validator.app import create_app
"""
CWR Data API Validator WS
~~~~~~~~~~~~~~~~~~~~~~~~~
Validator Web Service for Common Works Registrations.
:copyright: (c) 2015 by WESO
:license: MIT, see LICENSE for more details.
"""
__version__ = '0.0.1'
__license__ = 'MIT'
| 21.2 | 57 | 0.613208 |
from cwr_validator.app import create_app
__version__ = '0.0.1'
__license__ = 'MIT'
| true | true |
f71a1e01f6c37695492ea9e9df0eec7b5250b6b1 | 986 | py | Python | env/Lib/site-packages/OpenGL/GLES2/EXT/texture_type_2_10_10_10_REV.py | 5gconnectedbike/Navio2 | 8c3f2b5d8bbbcea1fc08739945183c12b206712c | [
"BSD-3-Clause"
] | 210 | 2016-04-09T14:26:00.000Z | 2022-03-25T18:36:19.000Z | env/Lib/site-packages/OpenGL/GLES2/EXT/texture_type_2_10_10_10_REV.py | 5gconnectedbike/Navio2 | 8c3f2b5d8bbbcea1fc08739945183c12b206712c | [
"BSD-3-Clause"
] | 72 | 2016-09-04T09:30:19.000Z | 2022-03-27T17:06:53.000Z | env/Lib/site-packages/OpenGL/GLES2/EXT/texture_type_2_10_10_10_REV.py | 5gconnectedbike/Navio2 | 8c3f2b5d8bbbcea1fc08739945183c12b206712c | [
"BSD-3-Clause"
] | 64 | 2016-04-09T14:26:49.000Z | 2022-03-21T11:19:47.000Z | '''OpenGL extension EXT.texture_type_2_10_10_10_REV
This module customises the behaviour of the
OpenGL.raw.GLES2.EXT.texture_type_2_10_10_10_REV to provide a more
Python-friendly API
Overview (from the spec)
This extension adds a new texture data type, unsigned 2.10.10.10 ABGR,
which can be used with RGB or RGB... | 35.214286 | 76 | 0.813387 | from OpenGL import platform, constant, arrays
from OpenGL import extensions, wrapper
import ctypes
from OpenGL.raw.GLES2 import _types, _glgets
from OpenGL.raw.GLES2.EXT.texture_type_2_10_10_10_REV import *
from OpenGL.raw.GLES2.EXT.texture_type_2_10_10_10_REV import _EXTENSION_NAME
def glInitTextureType2101010RevEXT(... | true | true |
f71a1e63deeffcfdc628570bf42b870b09678f9d | 621 | py | Python | debugprov/single_stepping.py | romerlrl/debugprov | 3527f6a3fa623354777aaaed2616b6b3065f8304 | [
"MIT"
] | 2 | 2019-09-26T17:46:12.000Z | 2021-04-21T00:19:59.000Z | debugprov/single_stepping.py | romerlrl/debugprov | 3527f6a3fa623354777aaaed2616b6b3065f8304 | [
"MIT"
] | null | null | null | debugprov/single_stepping.py | romerlrl/debugprov | 3527f6a3fa623354777aaaed2616b6b3065f8304 | [
"MIT"
] | 1 | 2020-09-22T20:37:19.000Z | 2020-09-22T20:37:19.000Z | from debugprov.navgiation_strategy import NavigationStrategy
from debugprov.node import Node
from debugprov.validity import Validity
class SingleStepping(NavigationStrategy):
def navigate(self):
self.recursive_navigate(self.exec_tree.root_node)
self.finish_navigation()
return self.exec... | 34.5 | 60 | 0.706924 | from debugprov.navgiation_strategy import NavigationStrategy
from debugprov.node import Node
from debugprov.validity import Validity
class SingleStepping(NavigationStrategy):
def navigate(self):
self.recursive_navigate(self.exec_tree.root_node)
self.finish_navigation()
return self.exec... | true | true |
f71a1e9ab3b466d5a052c9eb0a36e082154d5dbc | 1,747 | py | Python | igibson/robots/jr2_robot.py | suresh-guttikonda/iGibson | a69e623058180146466cd52d4bb3c00d1facdacf | [
"MIT"
] | 360 | 2020-04-02T11:12:09.000Z | 2022-03-24T21:46:58.000Z | igibson/robots/jr2_robot.py | suresh-guttikonda/iGibson | a69e623058180146466cd52d4bb3c00d1facdacf | [
"MIT"
] | 169 | 2020-04-07T21:01:05.000Z | 2022-03-31T10:07:39.000Z | igibson/robots/jr2_robot.py | suresh-guttikonda/iGibson | a69e623058180146466cd52d4bb3c00d1facdacf | [
"MIT"
] | 94 | 2020-04-09T23:22:17.000Z | 2022-03-17T21:49:03.000Z | import gym
import numpy as np
from igibson.robots.robot_locomotor import LocomotorRobot
class JR2(LocomotorRobot):
"""
JR2 robot (no arm)
Reference: https://cvgl.stanford.edu/projects/jackrabbot/
Uses joint velocity control
"""
def __init__(self, config):
self.config = config
... | 31.196429 | 106 | 0.566113 | import gym
import numpy as np
from igibson.robots.robot_locomotor import LocomotorRobot
class JR2(LocomotorRobot):
def __init__(self, config):
self.config = config
self.velocity = config.get("velocity", 1.0)
LocomotorRobot.__init__(
self,
"jr2_urdf/jr2.urdf",
... | true | true |
f71a1fa441e506dab6e2238a62846f24b22db7ce | 17,068 | py | Python | Training_Raw_data_validation/rawValidation.py | teja-ambati1202/Insurance-Fraud-Detection | a9bbdd5a2af68e0e90f8e16ba43129bab709614b | [
"Apache-2.0"
] | null | null | null | Training_Raw_data_validation/rawValidation.py | teja-ambati1202/Insurance-Fraud-Detection | a9bbdd5a2af68e0e90f8e16ba43129bab709614b | [
"Apache-2.0"
] | null | null | null | Training_Raw_data_validation/rawValidation.py | teja-ambati1202/Insurance-Fraud-Detection | a9bbdd5a2af68e0e90f8e16ba43129bab709614b | [
"Apache-2.0"
] | 1 | 2022-03-27T09:02:29.000Z | 2022-03-27T09:02:29.000Z | import sqlite3
from datetime import datetime
from os import listdir
import os
import re
import json
import shutil
import pandas as pd
from application_logging.logger import App_Logger
class Raw_Data_validation:
"""
This class shall be used for handling all the validation done on ... | 44.563969 | 200 | 0.489278 | import sqlite3
from datetime import datetime
from os import listdir
import os
import re
import json
import shutil
import pandas as pd
from application_logging.logger import App_Logger
class Raw_Data_validation:
def __init__(self,path):
self.Batch_Directory = path
self.schem... | true | true |
f71a1fb42d65587e922d09e984061b07a1aaed3f | 122 | py | Python | askci/plugins/pam_auth/__init__.py | hpsee/askci | ef1e2e75481b71db7fbe774cb81938055aa596d0 | [
"MIT"
] | 3 | 2019-11-21T09:04:36.000Z | 2019-11-23T13:29:43.000Z | askci/plugins/pam_auth/__init__.py | hpsee/askci | ef1e2e75481b71db7fbe774cb81938055aa596d0 | [
"MIT"
] | 13 | 2019-11-21T20:28:23.000Z | 2019-11-26T19:34:22.000Z | askci/plugins/pam_auth/__init__.py | hpsee/askci | ef1e2e75481b71db7fbe774cb81938055aa596d0 | [
"MIT"
] | null | null | null | AUTHENTICATION_BACKENDS = (
"django_pam.auth.backends.PAMBackend",
"django.contrib.auth.backends.ModelBackend",
)
| 24.4 | 48 | 0.754098 | AUTHENTICATION_BACKENDS = (
"django_pam.auth.backends.PAMBackend",
"django.contrib.auth.backends.ModelBackend",
)
| true | true |
f71a227f18ed9f23f6798ac8a5fc17a955b9c0cb | 3,870 | py | Python | QCT/get_S_norm.py | inqlee0704/pyqct | 304612ed558e7c46fe987ecfea8145cbc5721700 | [
"MIT"
] | null | null | null | QCT/get_S_norm.py | inqlee0704/pyqct | 304612ed558e7c46fe987ecfea8145cbc5721700 | [
"MIT"
] | null | null | null | QCT/get_S_norm.py | inqlee0704/pyqct | 304612ed558e7c46fe987ecfea8145cbc5721700 | [
"MIT"
] | null | null | null | # ##############################################################################
# Usage: python get_S_norm.py Subj I1 I2
# Time: ~ 20s
# Ref:
# ##############################################################################
# 20220118, In Kyu Lee
# No version suffix
# ##################################################... | 35.181818 | 115 | 0.640052 | # - IN lobe mask, ex) PMSN03001_IN0_vida-lobes.img
# Output:
# - s* image, ex) PMSN03001_EX0-TO-PMSN03001_IN0-SSTVD_s_norm.img
# - s* stat, ex) PMSN03001_EX0-TO-PMSN03001_IN0-SSTVD_lobar_s_norm.txt
# ##############################################################################w
# import libraries
import os
import ... | true | true |
f71a22b92bee8bbe5221f6a278525d912c8b3c92 | 577 | py | Python | OLD THINGS/faceid_nabeel.py | AmirQadir/Auto-Object-Detection-and-Tracker | 24c6f4d18b0496ef19250ccc42f53a7f1f42ed3f | [
"MIT"
] | 1 | 2019-05-30T00:59:18.000Z | 2019-05-30T00:59:18.000Z | OLD THINGS/faceid_nabeel.py | AmirQadir/Auto-Object-Detection-and-Tracker | 24c6f4d18b0496ef19250ccc42f53a7f1f42ed3f | [
"MIT"
] | null | null | null | OLD THINGS/faceid_nabeel.py | AmirQadir/Auto-Object-Detection-and-Tracker | 24c6f4d18b0496ef19250ccc42f53a7f1f42ed3f | [
"MIT"
] | null | null | null | from FaceID import faceID
import numpy as np
import cv2 as cv
from matplotlib import pyplot as plt
img1 = cv.imread('nabeel.jpg',0) # queryImage
img2 = cv.imread('nabeel_train.jpg',0) # trainImage
print(img1.shape)
rec = faceID()
print("constructor finished")
# crop_img_2 = getCroppedImage(rec,crop_img_2) ... | 23.08 | 72 | 0.743501 | from FaceID import faceID
import numpy as np
import cv2 as cv
from matplotlib import pyplot as plt
img1 = cv.imread('nabeel.jpg',0) img2 = cv.imread('nabeel_train.jpg',0)
print(img1.shape)
rec = faceID()
print("constructor finished")
print(img1.shape)
img1 = cv.resize(img1,(100,100),interpolation=cv.INTER... | true | true |
f71a234f7d07452f93e0a92a0eb80a7ca5668a4f | 5,007 | py | Python | maps/tests/09.py | wayne-wang-1119/maps-project-cs88 | ad330291042cd659142b1db4d5875fec5ebcfa90 | [
"MIT"
] | null | null | null | maps/tests/09.py | wayne-wang-1119/maps-project-cs88 | ad330291042cd659142b1db4d5875fec5ebcfa90 | [
"MIT"
] | null | null | null | maps/tests/09.py | wayne-wang-1119/maps-project-cs88 | ad330291042cd659142b1db4d5875fec5ebcfa90 | [
"MIT"
] | null | null | null | test = {
'name': 'Problem 9',
'points': 4,
'suites': [
{
'cases': [
{
'answer': 'restaurant names',
'choices': [
'restaurant names',
'restaurants',
'restaurant ratings'
],
'hidden': False,
'locked': False,
... | 32.512987 | 92 | 0.425205 | test = {
'name': 'Problem 9',
'points': 4,
'suites': [
{
'cases': [
{
'answer': 'restaurant names',
'choices': [
'restaurant names',
'restaurants',
'restaurant ratings'
],
'hidden': False,
'locked': False,
... | true | true |
f71a245fa32058c020191858dd725ba966da6364 | 728 | py | Python | unstar_github.py | ashwinvis/zotero-tools | fa4ede2382ba6d462325b7cb08c66575cf87ce20 | [
"Apache-2.0"
] | null | null | null | unstar_github.py | ashwinvis/zotero-tools | fa4ede2382ba6d462325b7cb08c66575cf87ce20 | [
"Apache-2.0"
] | null | null | null | unstar_github.py | ashwinvis/zotero-tools | fa4ede2382ba6d462325b7cb08c66575cf87ce20 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
import random
import time
from pygithub import Github
# Ref:
# https://pygithub.readthedocs.io/en/latest/introduction.html#very-short-tutorial
# If you are using an access token to circumvent 2FA, make sure you have
# enabled "repo" scope
g = Github("username", "password")
me = g.get_user()
starred = ... | 30.333333 | 81 | 0.725275 | import random
import time
from pygithub import Github
g = Github("username", "password")
me = g.get_user()
starred = me.get_starred()
for repo in starred:
print("Unstarring", repo)
me.remove_from_starred(repo)
time.sleep(1 + random.random())
| true | true |
f71a24882b5c3b3d085f16743970960081031c33 | 1,508 | py | Python | conda_tools/pack_non_conda.py | Amber-MD/ambertools-binary-build | 257f25cfbe829ee080807c6086d6edf8ec78c534 | [
"MIT"
] | 4 | 2018-12-02T19:43:52.000Z | 2019-12-14T01:15:50.000Z | conda_tools/pack_non_conda.py | Amber-MD/ambertools-binary-build | 257f25cfbe829ee080807c6086d6edf8ec78c534 | [
"MIT"
] | 15 | 2017-09-03T03:37:27.000Z | 2020-10-07T15:19:56.000Z | conda_tools/pack_non_conda.py | Amber-MD/ambertools-binary-build | 257f25cfbe829ee080807c6086d6edf8ec78c534 | [
"MIT"
] | 1 | 2021-06-01T19:18:54.000Z | 2021-06-01T19:18:54.000Z | # Aim: Mostly for phenix users and those don't like using Miniconda
# 1. wget url_to_tar_file.tar
# 2. tar -xf url_to_tar_file.tar
# 3. source amber17/ambersh
# 4. Just it
""" Usage example: python pack_non_conda.py ambertools-17.0.1-py27_1.tar.bz2
Note: You can use file pattern
This script will unpack that bz2 file... | 27.925926 | 104 | 0.68634 |
# 1. wget url_to_tar_file.tar
# 2. tar -xf url_to_tar_file.tar
# 3. source amber17/ambersh
# 4. Just it
import os
import subprocess
from glob import glob
import argparse
# local file, in the same folder as this script
from edit_package import editing_conda_package
import update_shebang
def main():
parser = arg... | true | true |
f71a24ca46c0edd3de051b4f157eaa8487ab5b5d | 2,561 | py | Python | remoteSwitch/lib/rotation.py | zkity/remoteSwitch | 1b66baab87c81a9b79de7b161173fb0c75c03291 | [
"MIT"
] | 1 | 2021-02-19T11:24:41.000Z | 2021-02-19T11:24:41.000Z | remoteSwitch/lib/rotation.py | zkity/remoteSwitch | 1b66baab87c81a9b79de7b161173fb0c75c03291 | [
"MIT"
] | null | null | null | remoteSwitch/lib/rotation.py | zkity/remoteSwitch | 1b66baab87c81a9b79de7b161173fb0c75c03291 | [
"MIT"
] | null | null | null | '''
这段代码源于网上
原文请见 https://my.oschina.net/hechunc/blog/3020284
'''
import RPi.GPIO as GPIO
import time
# 这个类表示单个的SG90模块
class Rotation:
frequency=50 #脉冲频率(Hz)
delta_theta=0.2 #步进转动间隔(度)
min_delay=0.0006 #转动delta_theta的理论耗时(s)
max_delay=0.4 #从0转到180的耗时(s)
def __init__(self,channel,min_theta,max_thet... | 28.455556 | 65 | 0.609137 | import RPi.GPIO as GPIO
import time
class Rotation:
frequency=50 delta_theta=0.2 min_delay=0.0006 max_delay=0.4
def __init__(self,channel,min_theta,max_theta,init_theta=0):
self.channel=channel
if(min_theta<0 or min_theta>180):
self.min_theta=0
else:
... | true | true |
f71a2762ffafdc8fa41231f81f930197ee062c98 | 15,596 | py | Python | trainer.py | a-maumau/pixel_objectness.pytorch | f5acb972be694662d839b99eb33e66a807d6031e | [
"MIT"
] | 4 | 2018-10-28T14:44:24.000Z | 2019-10-27T11:27:12.000Z | trainer.py | a-maumau/pixel_objectness.pytorch | f5acb972be694662d839b99eb33e66a807d6031e | [
"MIT"
] | 2 | 2019-05-10T15:01:45.000Z | 2019-10-11T09:47:51.000Z | trainer.py | a-maumau/pixel_objectness.pytorch | f5acb972be694662d839b99eb33e66a807d6031e | [
"MIT"
] | null | null | null | import os
import math
import argparse
from datetime import datetime
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from tqdm import tqdm
from PIL import Image
import data_loader
from mau_ml_util.train_logger import TrainLogger
#from mau_ml_util.metric import SegmentationMetric... | 40.934383 | 179 | 0.55604 | import os
import math
import argparse
from datetime import datetime
import torch
import torch.nn as nn
import torch.nn.functional as F
import numpy as np
from tqdm import tqdm
from PIL import Image
import data_loader
from mau_ml_util.train_logger import TrainLogger
from metric_from_latest_mmu import SegmentationMet... | true | true |
f71a280976585c5919618be25b73b5e66de54cdf | 4,197 | py | Python | ucsmsdk/mometa/comm/CommSyslogClient.py | anoop1984/python_sdk | c4a226bad5e10ad233eda62bc8f6d66a5a82b651 | [
"Apache-2.0"
] | null | null | null | ucsmsdk/mometa/comm/CommSyslogClient.py | anoop1984/python_sdk | c4a226bad5e10ad233eda62bc8f6d66a5a82b651 | [
"Apache-2.0"
] | null | null | null | ucsmsdk/mometa/comm/CommSyslogClient.py | anoop1984/python_sdk | c4a226bad5e10ad233eda62bc8f6d66a5a82b651 | [
"Apache-2.0"
] | null | null | null | """This module contains the general information for CommSyslogClient ManagedObject."""
import sys, os
from ...ucsmo import ManagedObject
from ...ucscoremeta import UcsVersion, MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class CommSyslogClientConsts():
ADMIN_STATE_DISABLED = "disabled"
ADMIN_STA... | 52.4625 | 264 | 0.671432 | import sys, os
from ...ucsmo import ManagedObject
from ...ucscoremeta import UcsVersion, MoPropertyMeta, MoMeta
from ...ucsmeta import VersionMeta
class CommSyslogClientConsts():
ADMIN_STATE_DISABLED = "disabled"
ADMIN_STATE_ENABLED = "enabled"
FORWARDING_FACILITY_LOCAL0 = "local0"
FORWARDING_FACILIT... | true | true |
f71a28fae36dc01961cc60b2d06bc962234e0ce7 | 12,999 | py | Python | hy/macros.py | silver-dragon/hy | c7b2f47681f54b365da22ec8d65c7dbc59ab7501 | [
"MIT"
] | null | null | null | hy/macros.py | silver-dragon/hy | c7b2f47681f54b365da22ec8d65c7dbc59ab7501 | [
"MIT"
] | null | null | null | hy/macros.py | silver-dragon/hy | c7b2f47681f54b365da22ec8d65c7dbc59ab7501 | [
"MIT"
] | null | null | null | # Copyright 2021 the authors.
# This file is part of Hy, which is free software licensed under the Expat
# license. See the LICENSE.
import sys
import builtins
import importlib
import inspect
import pkgutil
import traceback
from ast import AST
from funcparserlib.parser import NoParseError
from hy._compat import PY3_8... | 34.11811 | 89 | 0.605123 | import sys
import builtins
import importlib
import inspect
import pkgutil
import traceback
from ast import AST
from funcparserlib.parser import NoParseError
from hy._compat import PY3_8
from hy.model_patterns import whole
from hy.models import replace_hy_obj, Expression, Symbol, as_model, is_unpack
from hy.lex import... | true | true |
f71a2b94b5be2676eac49b95b663de23170408de | 9,927 | py | Python | gpt2_model.py | solad5/acgan-gpt2 | 52901a996fd235355f8c3f6b83037c85b1fdb415 | [
"MIT"
] | null | null | null | gpt2_model.py | solad5/acgan-gpt2 | 52901a996fd235355f8c3f6b83037c85b1fdb415 | [
"MIT"
] | null | null | null | gpt2_model.py | solad5/acgan-gpt2 | 52901a996fd235355f8c3f6b83037c85b1fdb415 | [
"MIT"
] | null | null | null | '''
code by TaeHwan Jung(@graykode)
Original Paper and repository here : https://github.com/openai/gpt-2
GPT2 Pytorch Model : https://github.com/huggingface/pytorch-pretrained-BERT
'''
import copy
import torch
import math
import torch.nn as nn
from torch.nn.parameter import Parameter
def gelu(x):
retu... | 38.476744 | 108 | 0.621739 |
import copy
import torch
import math
import torch.nn as nn
from torch.nn.parameter import Parameter
def gelu(x):
return 0.5 * x * (1 + torch.tanh(math.sqrt(2 / math.pi) * (x + 0.044715 * torch.pow(x, 3))))
def load_weight(model, state_dict):
old_keys = []
new_keys = []
for key in state_dict.keys():
... | true | true |
f71a2c9c59e0ff4712893eebaf781a9ad92104c2 | 4,896 | py | Python | library/bigip_software_update.py | Larsende/f5_ansible | 93b0747ba663128e2c8dfc456dad4653cdde4f38 | [
"Apache-2.0"
] | 12 | 2016-12-29T16:09:21.000Z | 2019-06-29T14:12:17.000Z | library/bigip_software_update.py | Larsende/f5_ansible | 93b0747ba663128e2c8dfc456dad4653cdde4f38 | [
"Apache-2.0"
] | 24 | 2017-05-24T07:56:56.000Z | 2017-11-30T09:31:56.000Z | library/bigip_software_update.py | Larsende/f5_ansible | 93b0747ba663128e2c8dfc456dad4653cdde4f38 | [
"Apache-2.0"
] | 26 | 2017-05-31T17:15:32.000Z | 2021-03-29T03:45:06.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | 25.5 | 91 | 0.607639 |
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: bigip_software_update
short_description: Manage the softwar... | true | true |
f71a2cf03b51c5cbf16bd9aeb093968dd349cef9 | 7,353 | py | Python | take_images.py | ManuLado/Enviar-comandos-a-marlin | f7f474ad0459602176114c62e7c97874cb69191b | [
"MIT"
] | 2 | 2021-10-02T20:20:45.000Z | 2021-10-02T20:20:53.000Z | take_images.py | ManuLado/2D-XRay_Scan_control | 5ba596c9b0db47125e2e29ed8084e61d326e8777 | [
"MIT"
] | null | null | null | take_images.py | ManuLado/2D-XRay_Scan_control | 5ba596c9b0db47125e2e29ed8084e61d326e8777 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Graba video leido desde la arducam
# Se le debe indicar el archivo de video a grabar y
# la duración de la captura en segundos.
# SINTAXIS: python capturar_video.py VIDEO TIEMPO
# 1- Ruta del video
# 2- Tiempo de grabacion en segundos
from ctypes import *
import ct... | 28.610895 | 134 | 0.622195 |
from ctypes import *
import ctypes
import sys
import os
import time
from PIL import Image
import numpy as np
import thread as thread
import math
from select import select
from evdev import InputDevice
from evdev import ecodes
from astropy.io import fits
import ArducamSDK
if (len(sys.argv)==3):
NOMBREIMG = sy... | true | true |
f71a2d96365d53c5ef530130fb564554ef725c20 | 1,117 | py | Python | lib/surface/eventflow/triggers/__init__.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | null | null | null | lib/surface/eventflow/triggers/__init__.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | null | null | null | lib/surface/eventflow/triggers/__init__.py | kustodian/google-cloud-sdk | b6bae4137d4b58030adb3dcb1271216dfb19f96d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*- #
# Copyright 2019 Google LLC. 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 requir... | 30.189189 | 79 | 0.726052 |
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from googlecloudsdk.calliope import base
class Triggers(base.Group):
detailed_help = {
'EXAMPLES': """\
To list your existing triggers, run:
$ {command} list
""",
}
| true | true |
f71a2de92ecf79a70555c5ed5b4cafbc45bf3a74 | 4,851 | py | Python | tempest/cli/simple_read_only/test_cinder.py | BeenzSyed/tempest | 7a64ee1216d844f6b99928b53f5c665b84cb8719 | [
"Apache-2.0"
] | null | null | null | tempest/cli/simple_read_only/test_cinder.py | BeenzSyed/tempest | 7a64ee1216d844f6b99928b53f5c665b84cb8719 | [
"Apache-2.0"
] | null | null | null | tempest/cli/simple_read_only/test_cinder.py | BeenzSyed/tempest | 7a64ee1216d844f6b99928b53f5c665b84cb8719 | [
"Apache-2.0"
] | null | null | null | # Copyright 2013 OpenStack Foundation
# 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 requ... | 35.408759 | 78 | 0.632035 |
import logging
import re
import subprocess
import tempest.cli
LOG = logging.getLogger(__name__)
class SimpleReadOnlyCinderClientTest(tempest.cli.ClientTestBase):
def test_cinder_fake_action(self):
self.assertRaises(subprocess.CalledProcessError,
self.cinder,
... | true | true |
f71a2e2450c7afe71a1025c53865035c1ff60cb5 | 268 | py | Python | highiq/io/__init__.py | ClariNerd617/HighIQ | 0305902f889da869535834620bb4fb15ac54b11d | [
"BSD-3-Clause"
] | 6 | 2020-03-16T14:14:45.000Z | 2021-09-21T06:39:57.000Z | highiq/io/__init__.py | ClariNerd617/HighIQ | 0305902f889da869535834620bb4fb15ac54b11d | [
"BSD-3-Clause"
] | null | null | null | highiq/io/__init__.py | ClariNerd617/HighIQ | 0305902f889da869535834620bb4fb15ac54b11d | [
"BSD-3-Clause"
] | 3 | 2019-12-16T19:56:35.000Z | 2021-06-09T14:14:47.000Z | """
=========
highiq.io
=========
.. currentmodule:: highiq.io
This module contains the I/O methods for loading data into and saving data from HighIQ analyses.
.. autosummary::
:toctree: generated/
load_arm_netcdf
"""
from .arm_data import load_arm_netcdf | 16.75 | 96 | 0.682836 | from .arm_data import load_arm_netcdf | true | true |
f71a2e415b2e9d0db183f02c832c777618bce8e9 | 1,292 | py | Python | model-optimizer/extensions/back/RNNSequenceTypeRename.py | calvinfeng/openvino | 11f591c16852637506b1b40d083b450e56d0c8ac | [
"Apache-2.0"
] | null | null | null | model-optimizer/extensions/back/RNNSequenceTypeRename.py | calvinfeng/openvino | 11f591c16852637506b1b40d083b450e56d0c8ac | [
"Apache-2.0"
] | 19 | 2021-03-26T08:11:00.000Z | 2022-02-21T13:06:26.000Z | model-optimizer/extensions/back/RNNSequenceTypeRename.py | calvinfeng/openvino | 11f591c16852637506b1b40d083b450e56d0c8ac | [
"Apache-2.0"
] | 1 | 2021-07-28T17:30:46.000Z | 2021-07-28T17:30:46.000Z | """
Copyright (C) 2018-2021 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to i... | 31.512195 | 86 | 0.681889 | from mo.back.replacement import BackReplacementPattern
from mo.graph.graph import Graph
class RNNSequence(BackReplacementPattern):
enabled = True
def pattern(self):
return dict(
nodes=[
('rnn_layer', {'type': 'RNNSequence'})
],
edges=[]
)
... | true | true |
f71a2e67d16d278f046fedc42260f77f54a931dc | 2,802 | py | Python | vplexapi-7.0.0.0/vplexapi/models/rule_set.py | lhernand3z/python-vplex | 0f94723fd56c7a3a85c4afb3b78046b9c66b93e4 | [
"Apache-2.0"
] | null | null | null | vplexapi-7.0.0.0/vplexapi/models/rule_set.py | lhernand3z/python-vplex | 0f94723fd56c7a3a85c4afb3b78046b9c66b93e4 | [
"Apache-2.0"
] | null | null | null | vplexapi-7.0.0.0/vplexapi/models/rule_set.py | lhernand3z/python-vplex | 0f94723fd56c7a3a85c4afb3b78046b9c66b93e4 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
VPlex REST API
A definition for the next-gen VPlex API # noqa: E501
OpenAPI spec version: 0.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class RuleSet(object):
"""NOTE: This class is auto gen... | 24.79646 | 80 | 0.533904 |
import pprint
import re
import six
class RuleSet(object):
swagger_types = {
'name': 'str'
}
attribute_map = {
'name': 'name'
}
def __init__(self, name=None):
self._name = None
self.discriminator = None
if name is not None:
self.name = ... | true | true |
f71a2e87d4b8d901b178fcd9d35e179c33a8334f | 4,868 | py | Python | BoxThermal.py | AndrewFalkowski/SODIS_SIM | 4d5da3e0872ee747d399d66fdee1633e7d2b8ab1 | [
"MIT"
] | null | null | null | BoxThermal.py | AndrewFalkowski/SODIS_SIM | 4d5da3e0872ee747d399d66fdee1633e7d2b8ab1 | [
"MIT"
] | null | null | null | BoxThermal.py | AndrewFalkowski/SODIS_SIM | 4d5da3e0872ee747d399d66fdee1633e7d2b8ab1 | [
"MIT"
] | null | null | null | import numpy as np
from math import sqrt
import matplotlib.pyplot as plt
import numba
import time
from scipy.integrate import odeint
# a sample differential equation dy/dx = (x-y)/2
# def dydx(x,y):
# return ((x-y)/2)
# # find the value of y for a given x using step size h
# # and an initial value y0 at x0
# ... | 27.044444 | 100 | 0.581758 | import numpy as np
from math import sqrt
import matplotlib.pyplot as plt
import numba
import time
from scipy.integrate import odeint
def box_dim(A_c, h, prct_f):
box_vol = A_c * h
vol_f = box_vol * prct_f m_a = box_vol * (1-prct_f) * 1.225
m_f = vol_f * 997 print('Contained Water: ',... | true | true |
f71a2e97febc43b9fe06cbb74dd070431e79c852 | 5,121 | py | Python | libweasyl/libweasyl/alembic/versions/e2bedd00b085_fill_journal_and_character_hidden_.py | kfkitsune/weasyl | 7e63c6db98ed2debfadbc277509533f72ea078a5 | [
"Apache-2.0"
] | 111 | 2016-05-18T04:18:18.000Z | 2021-11-03T02:05:19.000Z | libweasyl/libweasyl/alembic/versions/e2bedd00b085_fill_journal_and_character_hidden_.py | Weasyl/weasyl | 80c86942c6f20a815086e2895fdad51d3aa77eed | [
"Apache-2.0"
] | 1,103 | 2016-05-29T05:17:53.000Z | 2022-03-31T18:12:40.000Z | libweasyl/libweasyl/alembic/versions/e2bedd00b085_fill_journal_and_character_hidden_.py | kfkitsune/weasyl | 7e63c6db98ed2debfadbc277509533f72ea078a5 | [
"Apache-2.0"
] | 47 | 2016-05-29T20:48:37.000Z | 2021-11-12T09:40:40.000Z | """Fill journal and character hidden/friends-only columns
Revision ID: e2bedd00b085
Revises: 1fbcfecd195e
Create Date: 2021-07-26 05:43:43.742595
"""
# revision identifiers, used by Alembic.
revision = 'e2bedd00b085'
down_revision = '1fbcfecd195e'
from alembic import op
import sqlalchemy as sa
from sqlalchemy impor... | 38.503759 | 185 | 0.540129 |
revision = 'e2bedd00b085'
down_revision = '1fbcfecd195e'
from alembic import op
import sqlalchemy as sa
from sqlalchemy import text
BATCH_SIZE = 10_000
def upgrade():
context = op.get_context()
with context.autocommit_block():
max_charid = context.bind.scalar(text("SELECT max(charid) FROM charact... | true | true |
f71a2f238671395b100919c093a517ccf04d98ac | 2,876 | py | Python | resolwe_bio/processes/slamdunk/alleyoop_utrrates.py | plojyon/resolwe-bio | 45d001a78fcc387b5e3239a34c9da7f40d789022 | [
"Apache-2.0"
] | 12 | 2015-12-07T18:29:27.000Z | 2022-03-16T08:00:18.000Z | resolwe_bio/processes/slamdunk/alleyoop_utrrates.py | plojyon/resolwe-bio | 45d001a78fcc387b5e3239a34c9da7f40d789022 | [
"Apache-2.0"
] | 480 | 2015-11-20T21:46:43.000Z | 2022-03-28T12:40:57.000Z | resolwe_bio/processes/slamdunk/alleyoop_utrrates.py | plojyon/resolwe-bio | 45d001a78fcc387b5e3239a34c9da7f40d789022 | [
"Apache-2.0"
] | 45 | 2015-11-19T14:54:07.000Z | 2022-02-13T21:36:50.000Z | """Run Alleyoop utrrates tool on Slamdunk results."""
import os
from plumbum import TEE
from resolwe.process import (
Cmd,
DataField,
FileField,
IntegerField,
Process,
StringField,
)
class AlleyoopUtrRates(Process):
"""Run Alleyoop utrrates."""
slug = "alleyoop-utr-rates"
proces... | 30.273684 | 93 | 0.585883 | import os
from plumbum import TEE
from resolwe.process import (
Cmd,
DataField,
FileField,
IntegerField,
Process,
StringField,
)
class AlleyoopUtrRates(Process):
slug = "alleyoop-utr-rates"
process_type = "data:alleyoop:utrrates"
name = "Alleyoop UTR Rates"
requirements = {
... | true | true |
f71a2fbd3261e086d9f3bcb7623757c304921595 | 3,328 | py | Python | fixture/orm.py | IKeiran/FPT-Sinyakov | 08c5121d84c394bcee91d087ac2d14581179d2fd | [
"Apache-2.0"
] | null | null | null | fixture/orm.py | IKeiran/FPT-Sinyakov | 08c5121d84c394bcee91d087ac2d14581179d2fd | [
"Apache-2.0"
] | null | null | null | fixture/orm.py | IKeiran/FPT-Sinyakov | 08c5121d84c394bcee91d087ac2d14581179d2fd | [
"Apache-2.0"
] | null | null | null | from pony.orm import *
from datetime import datetime
from model.contact import Contact
from model.group import Group
from pymysql.converters import decoders
class ORMFixtue:
db = Database()
class ORMGroup(db.Entity):
_table_ = 'group_list'
id = PrimaryKey(int, column='group_id')
name... | 41.6 | 133 | 0.679688 | from pony.orm import *
from datetime import datetime
from model.contact import Contact
from model.group import Group
from pymysql.converters import decoders
class ORMFixtue:
db = Database()
class ORMGroup(db.Entity):
_table_ = 'group_list'
id = PrimaryKey(int, column='group_id')
name... | true | true |
f71a300263267957f62029ccbbaaa9d0a69f7565 | 5,677 | py | Python | selfdrive/car/chrysler/carstate.py | choongsoo/openpilot | 3441ee566669f40ffaac622b0ef025e5da570af1 | [
"MIT"
] | 1 | 2022-03-31T05:07:44.000Z | 2022-03-31T05:07:44.000Z | selfdrive/car/chrysler/carstate.py | choongsoo/openpilot | 3441ee566669f40ffaac622b0ef025e5da570af1 | [
"MIT"
] | null | null | null | selfdrive/car/chrysler/carstate.py | choongsoo/openpilot | 3441ee566669f40ffaac622b0ef025e5da570af1 | [
"MIT"
] | null | null | null | from cereal import car
from common.conversions import Conversions as CV
from opendbc.can.parser import CANParser
from opendbc.can.can_define import CANDefine
from selfdrive.car.interfaces import CarStateBase
from selfdrive.car.chrysler.values import DBC, STEER_THRESHOLD
class CarState(CarStateBase):
def __init__(se... | 36.159236 | 131 | 0.630791 | from cereal import car
from common.conversions import Conversions as CV
from opendbc.can.parser import CANParser
from opendbc.can.can_define import CANDefine
from selfdrive.car.interfaces import CarStateBase
from selfdrive.car.chrysler.values import DBC, STEER_THRESHOLD
class CarState(CarStateBase):
def __init__(se... | true | true |
f71a301d080276930f713a265069db17067d03cb | 43 | py | Python | linguistics/bert/__init__.py | idin/mercurius | 48a4ed7843fb5d1946ef8051f23da7b32ab52ca3 | [
"MIT"
] | 7 | 2019-02-24T16:56:46.000Z | 2022-01-30T03:26:49.000Z | linguistics/bert/__init__.py | idin/mercurius | 48a4ed7843fb5d1946ef8051f23da7b32ab52ca3 | [
"MIT"
] | 1 | 2020-07-14T21:00:57.000Z | 2021-02-25T07:12:11.000Z | linguistics/bert/__init__.py | idin/linguistics | ab9568d81b225928beab353174fd97ccb0fe369c | [
"MIT"
] | null | null | null | from .BertVectorizer import BertVectorizer
| 21.5 | 42 | 0.883721 | from .BertVectorizer import BertVectorizer
| true | true |
f71a30533b6634f0a1e795ab1b2cb53461019bfe | 1,928 | py | Python | upvote/gae/lib/bit9/monitoring.py | iwikmai/upvote | 77bb200d0e35a28cc5aed98ceee8e234998814b6 | [
"Apache-2.0"
] | 453 | 2017-10-24T15:29:44.000Z | 2021-09-27T23:21:20.000Z | upvote/gae/lib/bit9/monitoring.py | iwikmai/upvote | 77bb200d0e35a28cc5aed98ceee8e234998814b6 | [
"Apache-2.0"
] | 58 | 2018-03-23T21:19:16.000Z | 2021-05-23T20:06:05.000Z | upvote/gae/lib/bit9/monitoring.py | iwikmai/upvote | 77bb200d0e35a28cc5aed98ceee8e234998814b6 | [
"Apache-2.0"
] | 36 | 2018-03-23T21:25:54.000Z | 2021-09-27T23:21:24.000Z | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 41.913043 | 82 | 0.795643 |
import six
from upvote.gae.utils import monitoring_utils
from upvote.monitoring import metrics
if six.PY3:
long = int
events_to_pull = monitoring_utils.Metric(metrics.BIT9_API.EVENTS_TO_PULL, long)
events_pulled = monitoring_utils.Counter(metrics.BIT9_API.EVENTS_PULLED)
events_to_process = monitoring_utils.Met... | true | true |
f71a332a571fb8fd40a02f9f22795f51a43552c4 | 4,280 | py | Python | single_query_extract.py | Gguinet/semisupervised-alignment | 4f914c2e95ef69fa3aefe312fb9b12e482c6f0b5 | [
"MIT"
] | 2 | 2021-01-16T14:12:21.000Z | 2021-12-31T10:15:39.000Z | single_query_extract.py | Gguinet/semisupervised-alignment | 4f914c2e95ef69fa3aefe312fb9b12e482c6f0b5 | [
"MIT"
] | null | null | null | single_query_extract.py | Gguinet/semisupervised-alignment | 4f914c2e95ef69fa3aefe312fb9b12e482c6f0b5 | [
"MIT"
] | 1 | 2021-03-06T15:52:49.000Z | 2021-03-06T15:52:49.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Modifications for Guinet et al.
import io
import warnings
import numpy as np
import argparse
from utils import *
from query_aux import *
#Disable warnings for Meta-features
warnings.filterwarnings("ignore")
# to use bool for parsing
def str2bool(v):
"""Parse Str... | 25.628743 | 83 | 0.700935 |
import io
import warnings
import numpy as np
import argparse
from utils import *
from query_aux import *
warnings.filterwarnings("ignore")
def str2bool(v):
if isinstance(v, bool):
return v
if v.lower() in ("yes", "true", "t", "y", "1"):
return True
elif v.lower() in ("no", "false", "f", ... | true | true |
f71a33492bc89ba75ddffd485b3bbc63fcd86dc9 | 29,388 | py | Python | source/deepsecurity/api/mac_lists_api.py | felipecosta09/cloudone-workload-controltower-lifecycle | 7927c84d164058b034fc872701b5ee117641f4d1 | [
"Apache-2.0"
] | 1 | 2021-10-30T16:40:09.000Z | 2021-10-30T16:40:09.000Z | source/deepsecurity/api/mac_lists_api.py | felipecosta09/cloudone-workload-controltower-lifecycle | 7927c84d164058b034fc872701b5ee117641f4d1 | [
"Apache-2.0"
] | 1 | 2021-07-28T20:19:03.000Z | 2021-07-28T20:19:03.000Z | source/deepsecurity/api/mac_lists_api.py | felipecosta09/cloudone-workload-controltower-lifecycle | 7927c84d164058b034fc872701b5ee117641f4d1 | [
"Apache-2.0"
] | 1 | 2021-10-30T16:40:02.000Z | 2021-10-30T16:40:02.000Z | # coding: utf-8
"""
Trend Micro Deep Security API
Copyright 2018 - 2020 Trend Micro Incorporated.<br/>Get protected, stay secured, and keep informed with Trend Micro Deep Security's new RESTful API. Access system data and manage security configurations to automate your security workflows and integrate De... | 43.281296 | 311 | 0.605928 |
from __future__ import absolute_import
import re
import six
from deepsecurity.api_client import ApiClient
class MACListsApi(object):
def __init__(self, api_client=None):
if api_client is None:
api_client = ApiClient()
self.api_client = api_client
def crea... | true | true |
f71a3354afd52b38a1b508cdd629a00d472d8746 | 2,651 | py | Python | tests/test_logger.py | agraubert/agutil | d9a568df01959ed985c9c8e77bdd501ac13bdbbf | [
"MIT"
] | 3 | 2017-06-05T15:46:22.000Z | 2019-05-22T21:26:54.000Z | tests/test_logger.py | agraubert/agutil | d9a568df01959ed985c9c8e77bdd501ac13bdbbf | [
"MIT"
] | 93 | 2016-06-22T18:57:47.000Z | 2022-02-14T10:50:27.000Z | tests/test_logger.py | agraubert/agutil | d9a568df01959ed985c9c8e77bdd501ac13bdbbf | [
"MIT"
] | null | null | null | import unittest
import unittest.mock
import os
from py_compile import compile
import sys
import random
import time
import tempfile
from filecmp import cmp
def make_random_string(length=25, lower=0, upper=255):
return "".join(chr(random.randint(lower,upper)) for i in range(length))
def tempname():
(handle, nam... | 32.728395 | 102 | 0.590343 | import unittest
import unittest.mock
import os
from py_compile import compile
import sys
import random
import time
import tempfile
from filecmp import cmp
def make_random_string(length=25, lower=0, upper=255):
return "".join(chr(random.randint(lower,upper)) for i in range(length))
def tempname():
(handle, nam... | true | true |
f71a33a61a60a199f194543768784c8caef1eda7 | 7,886 | py | Python | python/pm4pyPlus.py | rivei/pm4py_with_dash | 05ed524c11b44932783864a4465d400ea1300910 | [
"MIT"
] | null | null | null | python/pm4pyPlus.py | rivei/pm4py_with_dash | 05ed524c11b44932783864a4465d400ea1300910 | [
"MIT"
] | null | null | null | python/pm4pyPlus.py | rivei/pm4py_with_dash | 05ed524c11b44932783864a4465d400ea1300910 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sun Dec 1 22:17:20 2019
@author: Wei
"""
#from dash_app import default_log as log
import pandas as pd
import numpy as np
#import pytz
from datetime import datetime, tzinfo,timedelta
from pm4py.statistics.traces.log import case_statistics
from pm4py.algo.filtering.log.attribute... | 30.565891 | 122 | 0.578113 |
import pandas as pd
import numpy as np
from datetime import datetime, tzinfo,timedelta
from pm4py.statistics.traces.log import case_statistics
from pm4py.algo.filtering.log.attributes import attributes_filter
MAX_TRACES = 9999
def filtered_log_df(log, top_trace_n = MAX_TRACES):
n_cases = 0
caseid = []
a... | true | true |
f71a348d15db2579bb6b6dd7bce60ef5fc4a8a65 | 4,854 | py | Python | pypureclient/flasharray/FA_2_8/models/active_directory.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 14 | 2018-12-07T18:30:27.000Z | 2022-02-22T09:12:33.000Z | pypureclient/flasharray/FA_2_8/models/active_directory.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 28 | 2019-09-17T21:03:52.000Z | 2022-03-29T22:07:35.000Z | pypureclient/flasharray/FA_2_8/models/active_directory.py | Flav-STOR-WL/py-pure-client | 03b889c997d90380ac5d6380ca5d5432792d3e89 | [
"BSD-2-Clause"
] | 15 | 2020-06-11T15:50:08.000Z | 2022-03-21T09:27:25.000Z | # coding: utf-8
"""
FlashArray REST API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: 2.8
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re
import six
import typing
from .... | 35.691176 | 407 | 0.592707 |
import pprint
import re
import six
import typing
from ....properties import Property
if typing.TYPE_CHECKING:
from pypureclient.flasharray.FA_2_8 import models
class ActiveDirectory(object):
swagger_types = {
'name': 'str',
'computer_name': 'str',
'directory_servers': 'list[str]',
... | true | true |
f71a3506e2c79b16c7a1c6ca335f47af41777dc9 | 2,781 | py | Python | antz/io.py | jmschrei/antz | 74c901f543279b1904f2db9f3a70e5dcc7ade182 | [
"MIT"
] | 3 | 2015-05-10T16:00:20.000Z | 2016-06-22T22:03:05.000Z | antz/io.py | jmschrei/antz | 74c901f543279b1904f2db9f3a70e5dcc7ade182 | [
"MIT"
] | null | null | null | antz/io.py | jmschrei/antz | 74c901f543279b1904f2db9f3a70e5dcc7ade182 | [
"MIT"
] | null | null | null | # io.py
# Contact: Jacob Schreiber
# jmschr@cs.washington.edu
'''
This script focuses on data input and output, and currently supports the
following files:
* FastA
'''
from seq import *
class FastA( object ):
'''
This is a FastA file. It can contain many DNA, RNA, or Protein
sequences in it. This can be... | 28.670103 | 80 | 0.665948 |
from seq import *
class FastA( object ):
def __init__( self, sequences ):
self.sequences = sequences
def __str__( self ):
return '\n'.join( sequence.to_fasta() for sequence in self.sequences )
def to_file( self, filename, attrs=None ):
with open( filename, 'w' ) as outfile:
for sequence in sel... | true | true |
f71a3706a5e1e09a9b5ac6542d63281e2cb4bab7 | 1,370 | py | Python | tests/test_platform_api.py | jain-aayush1123/here-location-services-python | 11ad5ef8273b4f243c43bc00ebd470f725b980bc | [
"Apache-2.0"
] | 16 | 2021-02-15T13:49:29.000Z | 2022-03-29T10:34:43.000Z | tests/test_platform_api.py | jain-aayush1123/here-location-services-python | 11ad5ef8273b4f243c43bc00ebd470f725b980bc | [
"Apache-2.0"
] | 8 | 2021-02-27T18:40:46.000Z | 2021-10-03T15:49:27.000Z | tests/test_platform_api.py | jain-aayush1123/here-location-services-python | 11ad5ef8273b4f243c43bc00ebd470f725b980bc | [
"Apache-2.0"
] | 11 | 2021-02-16T04:58:08.000Z | 2022-02-21T20:51:55.000Z | # Copyright (C) 2019-2021 HERE Europe B.V.
# SPDX-License-Identifier: Apache-2.0
"""This module will test platform api module."""
import pytest
from requests_oauthlib import OAuth1
from here_location_services.platform.apis.aaa_oauth2_api import AAAOauth2Api
from here_location_services.platform.apis.api import Api as P... | 34.25 | 97 | 0.750365 | import pytest
from requests_oauthlib import OAuth1
from here_location_services.platform.apis.aaa_oauth2_api import AAAOauth2Api
from here_location_services.platform.apis.api import Api as PlaformApi
from here_location_services.utils import get_apikey
from tests.conftest import get_mock_response
LS_API_KEY = get_apike... | true | true |
f71a37cbfdc3fa96ea44404d682a0922befa7d2d | 13,580 | py | Python | scripts/blame_opt.py | regehr/yarpgen | 025a8cb90df018578c892ec82051ddf74388ec2f | [
"Apache-2.0"
] | null | null | null | scripts/blame_opt.py | regehr/yarpgen | 025a8cb90df018578c892ec82051ddf74388ec2f | [
"Apache-2.0"
] | null | null | null | scripts/blame_opt.py | regehr/yarpgen | 025a8cb90df018578c892ec82051ddf74388ec2f | [
"Apache-2.0"
] | 1 | 2021-03-02T08:54:02.000Z | 2021-03-02T08:54:02.000Z | #!/usr/bin/python3
###############################################################################
#
# Copyright (c) 2015-2020, Intel Corporation
# Copyright (c) 2019-2020, University of Utah
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Li... | 48.848921 | 160 | 0.60891 |
import logging
import os
import re
import common
import gen_test_makefile
import run_gen
icc_blame_opts = ["-from_rtn=0 -to_rtn=", "-num_opt=", "-num-case="]
icc_opt_patterns = ["\(\d+\)", "\(\d+\)\s*\n", "DO ANOTHER.*\(\d+\)"]
icc_opt_name_prefix = "DOING\s*\[\w*\]\s*"
icc_opt_name_suffix = "\s*\(\d*\)\s*\(last o... | true | true |
f71a37e5c9f3342edb98fd5bc2f1279f8371e8c8 | 27,693 | py | Python | src/python/turicreate/data_structures/sketch.py | pappasG/turicreate | 494e313957a6c01333628b182a7d5bc6efea18f8 | [
"BSD-3-Clause"
] | null | null | null | src/python/turicreate/data_structures/sketch.py | pappasG/turicreate | 494e313957a6c01333628b182a7d5bc6efea18f8 | [
"BSD-3-Clause"
] | null | null | null | src/python/turicreate/data_structures/sketch.py | pappasG/turicreate | 494e313957a6c01333628b182a7d5bc6efea18f8 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright © 2017 Apple Inc. All rights reserved.
#
# Use of this source code is governed by a BSD-3-clause license that can
# be found in the LICENSE.txt file or at https://opensource.org/licenses/BSD-3-Clause
"""
Efficiently compute the approximate statistics over an SArray.
"""
from __future... | 36.728117 | 209 | 0.502799 | from __future__ import print_function as _
from __future__ import division as _
from __future__ import absolute_import as _
from .._cython.cy_sketch import UnitySketchProxy
from .._cython.context import debug_trace as cython_context
from .sarray import SArray
from .sframe import SFrame
import operator
from math import... | true | true |
f71a380e5b2adadd88bb74e831433cb584917dad | 965 | py | Python | docs/source/rules/examples/REQ-E004/tester.py | yyang08/swagger-spec-compatibility | e7a6ba6fc53c6a8a92ba26016219a595a8cecbbe | [
"Apache-2.0"
] | 18 | 2019-04-30T21:07:30.000Z | 2021-12-16T17:56:08.000Z | docs/source/rules/examples/REQ-E004/tester.py | yyang08/swagger-spec-compatibility | e7a6ba6fc53c6a8a92ba26016219a595a8cecbbe | [
"Apache-2.0"
] | 30 | 2019-02-26T11:25:44.000Z | 2021-04-16T00:12:11.000Z | docs/source/rules/examples/REQ-E004/tester.py | yyang08/swagger-spec-compatibility | e7a6ba6fc53c6a8a92ba26016219a595a8cecbbe | [
"Apache-2.0"
] | 6 | 2019-02-25T22:12:29.000Z | 2020-12-23T00:24:48.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from os.path import abspath
from bravado.client import SwaggerClient
from jsonschema import ValidationError
from six.moves.urllib.parse import urljoin
from six.moves.urllib.requ... | 31.129032 | 77 | 0.779275 | from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from os.path import abspath
from bravado.client import SwaggerClient
from jsonschema import ValidationError
from six.moves.urllib.parse import urljoin
from six.moves.urllib.request import pathname2url
... | true | true |
f71a3828e5ab1b447e9e0f5e00e3b95d8c4e7d7e | 3,496 | py | Python | examples/upload_a_chapter.py | PythonCoderAS/Hondana | 14a7db9837bbe78212c462f845278777c246e3bf | [
"MIT"
] | 19 | 2021-07-21T01:25:06.000Z | 2022-03-14T21:22:45.000Z | examples/upload_a_chapter.py | PythonCoderAS/Hondana | 14a7db9837bbe78212c462f845278777c246e3bf | [
"MIT"
] | 5 | 2021-12-05T22:21:59.000Z | 2022-03-18T16:30:24.000Z | examples/upload_a_chapter.py | PythonCoderAS/Hondana | 14a7db9837bbe78212c462f845278777c246e3bf | [
"MIT"
] | 12 | 2021-07-17T18:26:33.000Z | 2022-03-21T19:57:46.000Z | """
This example shows three different ways to perform this task.
Please examine all three to find a method you like.
If you ask me: I prefer the first.
"""
import asyncio
import hondana
# Create your client, you must be authorised to upload a chapter.
client = hondana.Client(username="my username", password="my... | 30.4 | 139 | 0.670767 |
import asyncio
import hondana
client = hondana.Client(username="my username", password="my password")
async def main():
chapter = "1"
volume = "1"
translated_language = "en"
title = "..."
scanlator_groups = ["..."]
manga = await client.view_manga("...")
## NOTE: The orde... | true | true |
f71a387c3ff2cd382f14cdd92eec52461942a18f | 945 | py | Python | questions/q354_water_overflow/code.py | aadhityasw/Competitive-Programs | 901a48d35f024a3a87c32a45b7f4531e8004a203 | [
"MIT"
] | null | null | null | questions/q354_water_overflow/code.py | aadhityasw/Competitive-Programs | 901a48d35f024a3a87c32a45b7f4531e8004a203 | [
"MIT"
] | 1 | 2021-05-15T07:56:51.000Z | 2021-05-15T07:56:51.000Z | questions/q354_water_overflow/code.py | aadhityasw/Competitive-Programs | 901a48d35f024a3a87c32a45b7f4531e8004a203 | [
"MIT"
] | null | null | null | class Solution:
def waterOverflow(self, K, R, C):
if R <= 0 or C <= 0 or C > R :
return 0
table = [[K]]
i = 0
while True :
table.append([0]*(i+2))
flag = True
for j in range(i+1) :
if table[i][j] > 1 :
... | 26.25 | 52 | 0.359788 | class Solution:
def waterOverflow(self, K, R, C):
if R <= 0 or C <= 0 or C > R :
return 0
table = [[K]]
i = 0
while True :
table.append([0]*(i+2))
flag = True
for j in range(i+1) :
if table[i][j] > 1 :
... | true | true |
f71a389b852f7333755362f2c4739c7e128d3163 | 173 | py | Python | LR/production/test.py | whz-NJ/PersonalRecommendation | 4887209270f052d6d39bb35ee0c90498496849d8 | [
"Apache-2.0"
] | null | null | null | LR/production/test.py | whz-NJ/PersonalRecommendation | 4887209270f052d6d39bb35ee0c90498496849d8 | [
"Apache-2.0"
] | null | null | null | LR/production/test.py | whz-NJ/PersonalRecommendation | 4887209270f052d6d39bb35ee0c90498496849d8 | [
"Apache-2.0"
] | null | null | null | #看看文件内容有多少列
if __name__ == "__main__":
fp = open("../data/lr_coef")
count = 0
for line in fp:
item = line.strip().split(",")
print (len(item))
| 19.222222 | 38 | 0.531792 | if __name__ == "__main__":
fp = open("../data/lr_coef")
count = 0
for line in fp:
item = line.strip().split(",")
print (len(item))
| true | true |
f71a3969c7a14edff97577d65dbc459028956dcc | 654 | py | Python | projects/migrations/0017_project_user.py | Tuitoek/Awwards | 090b4a0dc7ea3b0b733d61732fca4554baba5e90 | [
"MIT"
] | null | null | null | projects/migrations/0017_project_user.py | Tuitoek/Awwards | 090b4a0dc7ea3b0b733d61732fca4554baba5e90 | [
"MIT"
] | null | null | null | projects/migrations/0017_project_user.py | Tuitoek/Awwards | 090b4a0dc7ea3b0b733d61732fca4554baba5e90 | [
"MIT"
] | 1 | 2021-09-21T12:52:12.000Z | 2021-09-21T12:52:12.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2019-03-20 14:32
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependenc... | 27.25 | 124 | 0.683486 | from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('projects', '0016_auto_20190320_1... | true | true |
f71a397e2dbddfef3306743b9d7789a6cc7dd8b2 | 46,025 | py | Python | selfdrive/car/hyundai/values.py | yunbong2/multi-076 | 5079eab33fbc69097e38cd8aced3c904c11c9bc8 | [
"MIT"
] | null | null | null | selfdrive/car/hyundai/values.py | yunbong2/multi-076 | 5079eab33fbc69097e38cd8aced3c904c11c9bc8 | [
"MIT"
] | null | null | null | selfdrive/car/hyundai/values.py | yunbong2/multi-076 | 5079eab33fbc69097e38cd8aced3c904c11c9bc8 | [
"MIT"
] | 5 | 2020-09-28T06:36:56.000Z | 2020-09-29T13:26:03.000Z | from cereal import car
from selfdrive.car import dbc_dict
from common.params import Params
Ecu = car.CarParams.Ecu
# Steer torque limits
class SteerLimitParams:
STEER_MAX = 280 # 409 is the max, 255 is stock
STEER_DELTA_UP = 5
STEER_DELTA_DOWN = 5
STEER_DRIVER_ALLOWANCE = 50
STEER_DRIVER_MULTIPLIER = 2
S... | 212.096774 | 793 | 0.536274 | from cereal import car
from selfdrive.car import dbc_dict
from common.params import Params
Ecu = car.CarParams.Ecu
class SteerLimitParams:
STEER_MAX = 280 STEER_DELTA_UP = 5
STEER_DELTA_DOWN = 5
STEER_DRIVER_ALLOWANCE = 50
STEER_DRIVER_MULTIPLIER = 2
STEER_DRIVER_FACTOR = 1
class CAR:
AVANTE = "HYUND... | true | true |
f71a3a75821354fee84241165aa869abf4a61832 | 5,614 | py | Python | sdk/python/pulumi_azure_nextgen/documentdb/v20200901/notebook_workspace.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_nextgen/documentdb/v20200901/notebook_workspace.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_nextgen/documentdb/v20200901/notebook_workspace.py | pulumi/pulumi-azure-nextgen | 452736b0a1cf584c2d4c04666e017af6e9b2c15c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__a... | 44.912 | 655 | 0.665301 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__all__ = ['NotebookWorkspace']
class NotebookWorkspace(pulumi.CustomResource):
def __init__(__self__,
resource_name: str,
opts: Op... | true | true |
f71a3c4c2a40dfd2974f50c147e4fa1e98133caa | 1,214 | py | Python | statistical_analysis/gpa_scatter.py | guptarohit994/ECE143_group25_project | e31d0425b2a6114eed6c55bdb0491c2c996b94be | [
"CC0-1.0"
] | null | null | null | statistical_analysis/gpa_scatter.py | guptarohit994/ECE143_group25_project | e31d0425b2a6114eed6c55bdb0491c2c996b94be | [
"CC0-1.0"
] | null | null | null | statistical_analysis/gpa_scatter.py | guptarohit994/ECE143_group25_project | e31d0425b2a6114eed6c55bdb0491c2c996b94be | [
"CC0-1.0"
] | null | null | null |
import helper
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
def plot_gpa_scatter():
"""Plotting scatterplot of grades expected and grade received, using the general department list
"""
# obtaining data
department_df = helper.generate_depts_df(helper.general_dept_list)
com... | 43.357143 | 191 | 0.706755 |
import helper
import numpy as np
import matplotlib.pyplot as plt
import pandas as pd
def plot_gpa_scatter():
department_df = helper.generate_depts_df(helper.general_dept_list)
comp_criteria = ["AvgGradeExpected","AvgGradeReceived"]
lower_bound = 1.5
upper_bound = 4.02
ax = department_df.... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.