hexsha stringlengths 40 40 | size int64 4 996k | ext stringclasses 8
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 4 996k | avg_line_length float64 1.33 58.2k | max_line_length int64 2 323k | alphanum_fraction float64 0 0.97 | content_no_comment stringlengths 0 946k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f7f3047ee3d51dcc222a6b162f6906ad57be8089 | 9,838 | py | Python | test/functional/wallet_createwallet.py | wbubblerteam/bubcoin | 0bb0d66397efcdacd782f64b3906d1acaed468cf | [
"MIT"
] | 1 | 2021-08-29T13:37:38.000Z | 2021-08-29T13:37:38.000Z | test/functional/wallet_createwallet.py | wbubblerteam/bubcoin | 0bb0d66397efcdacd782f64b3906d1acaed468cf | [
"MIT"
] | null | null | null | test/functional/wallet_createwallet.py | wbubblerteam/bubcoin | 0bb0d66397efcdacd782f64b3906d1acaed468cf | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2018-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test createwallet arguments.
"""
from test_framework.address import key_to_p2wpkh
from test_framework.... | 57.870588 | 303 | 0.691807 |
from test_framework.address import key_to_p2wpkh
from test_framework.descriptors import descsum_create
from test_framework.key import ECKey
from test_framework.test_framework import BubcoinTestFramework
from test_framework.util import (
assert_equal,
assert_raises_rpc_error,
)
from test_framework.wallet_ut... | true | true |
f7f304cfc715480787730e7eb0e66f78fcb5ed5d | 1,154 | py | Python | scripts/miner.py | sorleone/monero | 54d7ccdae55c9f2f89c78a8e4d6e39d6a6e5e782 | [
"BSD-3-Clause"
] | null | null | null | scripts/miner.py | sorleone/monero | 54d7ccdae55c9f2f89c78a8e4d6e39d6a6e5e782 | [
"BSD-3-Clause"
] | null | null | null | scripts/miner.py | sorleone/monero | 54d7ccdae55c9f2f89c78a8e4d6e39d6a6e5e782 | [
"BSD-3-Clause"
] | null | null | null | # source: https://moneroexamples.github.io/python-json-rpc/
'''
Usage: python3 miner.py [blocks to mine] [wallet address] [port]
'''
import sys
import requests
import json
# execute an rpc request
def execute_rpc(inputs, port):
return requests.post(
"http://localhost:"+port+"/json_rpc", # node is running ... | 26.837209 | 78 | 0.622184 |
import sys
import requests
import json
def execute_rpc(inputs, port):
return requests.post(
"http://localhost:"+port+"/json_rpc",
data=json.dumps(inputs),
headers={'content-type': 'application/json'})
def main():
if(len(sys.argv) < 3):
print("please pass # of blocks, walle... | true | true |
f7f30523ef78a5219b565faccbff4fb889c2eddc | 1,822 | py | Python | Login/views.py | Carlos-Caballero/cs01 | ced6aef7fae8a533851af18e6de545bb83fd427b | [
"MIT"
] | null | null | null | Login/views.py | Carlos-Caballero/cs01 | ced6aef7fae8a533851af18e6de545bb83fd427b | [
"MIT"
] | 11 | 2021-03-19T08:07:49.000Z | 2022-03-12T00:13:51.000Z | Login/views.py | Carlos-Daniel260/cs01 | ced6aef7fae8a533851af18e6de545bb83fd427b | [
"MIT"
] | null | null | null | from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.authtoken.models import Token
from rest_framework.response import Response
from django.shortcuts import get_object_or_404
from django.http import Http404
from rest_framework.views import APIView
from rest_framework.response import Response... | 34.377358 | 78 | 0.648738 | from rest_framework.authtoken.views import ObtainAuthToken
from rest_framework.authtoken.models import Token
from rest_framework.response import Response
from django.shortcuts import get_object_or_404
from django.http import Http404
from rest_framework.views import APIView
from rest_framework.response import Response... | true | true |
f7f305eedc355630f2a5c7c1255207d04d6e5437 | 8,508 | py | Python | histdata/api.py | somehowchris/FX-1-Minute-Data | 54dd6298f8db5f6e8b217562ff014796ce8c5792 | [
"Apache-2.0"
] | null | null | null | histdata/api.py | somehowchris/FX-1-Minute-Data | 54dd6298f8db5f6e8b217562ff014796ce8c5792 | [
"Apache-2.0"
] | 1 | 2021-06-25T15:50:13.000Z | 2021-06-25T15:50:13.000Z | histdata/api.py | somehowchris/FX-1-Minute-Data | 54dd6298f8db5f6e8b217562ff014796ce8c5792 | [
"Apache-2.0"
] | null | null | null | import os
from datetime import datetime
import requests
from bs4 import BeautifulSoup
class TimeFrame:
ONE_MINUTE = 'M1'
TICK_DATA = 'T'
TICK_DATA_LAST = 'T_LAST'
TICK_DATA_BID = 'T_BID'
TICK_DATA_ASK = 'T_ASK'
class Platform:
META_TRADER = 'MT'
GENERIC_ASCII = 'ASCII'
... | 50.343195 | 126 | 0.659497 | import os
from datetime import datetime
import requests
from bs4 import BeautifulSoup
class TimeFrame:
ONE_MINUTE = 'M1'
TICK_DATA = 'T'
TICK_DATA_LAST = 'T_LAST'
TICK_DATA_BID = 'T_BID'
TICK_DATA_ASK = 'T_ASK'
class Platform:
META_TRADER = 'MT'
GENERIC_ASCII = 'ASCII'
... | true | true |
f7f30664d68ecf5b16d28861e5e7471947884982 | 1,704 | py | Python | src/spinnaker_ros_lsm/venv/lib/python2.7/site-packages/pacman/operations/rig_algorithms/rig_route.py | Roboy/LSM_SpiNNaker_MyoArm | 04fa1eaf78778edea3ba3afa4c527d20c491718e | [
"BSD-3-Clause"
] | 2 | 2020-11-01T13:22:11.000Z | 2020-11-01T13:22:20.000Z | src/spinnaker_ros_lsm/venv/lib/python2.7/site-packages/pacman/operations/rig_algorithms/rig_route.py | Roboy/LSM_SpiNNaker_MyoArm | 04fa1eaf78778edea3ba3afa4c527d20c491718e | [
"BSD-3-Clause"
] | null | null | null | src/spinnaker_ros_lsm/venv/lib/python2.7/site-packages/pacman/operations/rig_algorithms/rig_route.py | Roboy/LSM_SpiNNaker_MyoArm | 04fa1eaf78778edea3ba3afa4c527d20c491718e | [
"BSD-3-Clause"
] | null | null | null | from pacman.utilities import rig_converters
from rig.place_and_route.route.ner import route
from spinn_machine.utilities.progress_bar import ProgressBar
class RigRoute(object):
""" Performs routing using rig algorithm
"""
def __call__(self, partitioned_graph, machine, placements):
progress_bar = ... | 34.08 | 73 | 0.684272 | from pacman.utilities import rig_converters
from rig.place_and_route.route.ner import route
from spinn_machine.utilities.progress_bar import ProgressBar
class RigRoute(object):
def __call__(self, partitioned_graph, machine, placements):
progress_bar = ProgressBar(8, "Routing")
vertices_resources... | true | true |
f7f307bb864f1dad548ee0902f16462c169232c2 | 815 | py | Python | comments/migrations/0001_initial.py | KiriKira/Kirikira.moe | 6d5366b6dae27417bb5cf2cfa496a5a710a466a6 | [
"MIT"
] | 11 | 2018-03-20T12:41:06.000Z | 2021-12-08T11:59:52.000Z | comments/migrations/0001_initial.py | KiriKira/Kirikira.moe | 6d5366b6dae27417bb5cf2cfa496a5a710a466a6 | [
"MIT"
] | 1 | 2020-09-22T04:07:02.000Z | 2020-10-14T03:25:15.000Z | comments/migrations/0001_initial.py | KiriKira/Kirikira.moe | 6d5366b6dae27417bb5cf2cfa496a5a710a466a6 | [
"MIT"
] | 6 | 2018-02-10T05:56:57.000Z | 2020-02-08T10:34:55.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Comment',
fields=[
... | 30.185185 | 114 | 0.555828 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('blog', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='Comment',
fields=[
('id', models.Aut... | true | true |
f7f30876108c925913bd55d6fe1062ce2b4a31ce | 2,035 | py | Python | services/storage/client-sdk/python/simcore_service_storage_sdk/__init__.py | KZzizzle/osparc-simcore | 981bc8d193f3f5d507e3225f857e0308c339e163 | [
"MIT"
] | null | null | null | services/storage/client-sdk/python/simcore_service_storage_sdk/__init__.py | KZzizzle/osparc-simcore | 981bc8d193f3f5d507e3225f857e0308c339e163 | [
"MIT"
] | 17 | 2020-10-15T16:06:05.000Z | 2022-03-21T18:48:21.000Z | services/storage/client-sdk/python/simcore_service_storage_sdk/__init__.py | Surfict/osparc-simcore | 1e0b89574ec17ecb089674f9e5daa83d624430c8 | [
"MIT"
] | null | null | null | # coding: utf-8
# flake8: noqa
"""
simcore-service-storage API
API definition for simcore-service-storage service # noqa: E501
OpenAPI spec version: 0.1.0
Contact: support@simcore.io
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
__version__ = "0.1.0"... | 46.25 | 104 | 0.885012 |
from __future__ import absolute_import
__version__ = "0.1.0"
from simcore_service_storage_sdk.api.users_api import UsersApi
from simcore_service_storage_sdk.api_client import ApiClient
from simcore_service_storage_sdk.configuration import Configuration
from simcore_service_storage_sdk.models.error_enveloped... | true | true |
f7f308e2ad33ee34674f6e590b19c73a5fefccab | 2,536 | py | Python | Python/venv/lib/python3.7/site-packages/prometheus_client/openmetrics/exposition.py | HenriqueBuzin/TCC | 5fb9db42e97e28131bff97da3252a9ee33b3684e | [
"Unlicense"
] | 69 | 2019-02-18T12:07:35.000Z | 2022-03-12T10:38:32.000Z | Python/venv/lib/python3.7/site-packages/prometheus_client/openmetrics/exposition.py | HenriqueBuzin/TCC | 5fb9db42e97e28131bff97da3252a9ee33b3684e | [
"Unlicense"
] | 12 | 2018-12-06T22:06:49.000Z | 2022-02-25T17:40:44.000Z | Python/venv/lib/python3.7/site-packages/prometheus_client/openmetrics/exposition.py | HenriqueBuzin/TCC | 5fb9db42e97e28131bff97da3252a9ee33b3684e | [
"Unlicense"
] | 28 | 2019-03-22T01:07:13.000Z | 2022-02-21T16:38:27.000Z | #!/usr/bin/python
from __future__ import unicode_literals
from .. import core
CONTENT_TYPE_LATEST = str('application/openmetrics-text; version=0.0.1; charset=utf-8')
'''Content type of the latest OpenMetrics text format'''
def generate_latest(registry):
'''Returns the metrics from the registry in latest text f... | 41.57377 | 115 | 0.471215 |
from __future__ import unicode_literals
from .. import core
CONTENT_TYPE_LATEST = str('application/openmetrics-text; version=0.0.1; charset=utf-8')
def generate_latest(registry):
output = []
for metric in registry.collect():
mname = metric.name
output.append('# HELP {0} {1}\n'.format(
... | true | true |
f7f3095da2f6fb2b821a67f647cf1a4a5120cb20 | 662 | py | Python | playground/playground.py | RheingoldRiver/misc-cogs | 3013af713999fa3ba5ae70f387febb8b43b33840 | [
"MIT"
] | null | null | null | playground/playground.py | RheingoldRiver/misc-cogs | 3013af713999fa3ba5ae70f387febb8b43b33840 | [
"MIT"
] | null | null | null | playground/playground.py | RheingoldRiver/misc-cogs | 3013af713999fa3ba5ae70f387febb8b43b33840 | [
"MIT"
] | null | null | null | from redbot.core import checks, commands
from redbot.core.utils.chat_formatting import box, pagify
class Playground(commands.Cog):
def __init__(self, bot, *args, **kwargs):
super().__init__(*args, **kwargs)
self.bot = bot
async def red_get_data_for_user(self, *, user_id):
"""Get a user... | 33.1 | 73 | 0.640483 | from redbot.core import checks, commands
from redbot.core.utils.chat_formatting import box, pagify
class Playground(commands.Cog):
def __init__(self, bot, *args, **kwargs):
super().__init__(*args, **kwargs)
self.bot = bot
async def red_get_data_for_user(self, *, user_id):
data = "No da... | true | true |
f7f30a807004daaa6fa3672bc1ac75ccdd1a90d5 | 4,746 | py | Python | Sales prediction model.py | Hemant2801/Big-mart-sales-prediction | cac2748ed6a446095d568e005601d941f586e104 | [
"MIT"
] | 1 | 2021-12-03T09:17:12.000Z | 2021-12-03T09:17:12.000Z | Sales prediction model.py | Hemant2801/Big-mart-sales-prediction | cac2748ed6a446095d568e005601d941f586e104 | [
"MIT"
] | null | null | null | Sales prediction model.py | Hemant2801/Big-mart-sales-prediction | cac2748ed6a446095d568e005601d941f586e104 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# # Importing all the dependencies
# In[1]:
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.model_selection import train_test_split
from sklearn import metrics
from xgboost import XGBRegressor
from sklearn.preprocessing ... | 13.331461 | 121 | 0.682048 |
numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.model_selection import train_test_split
from sklearn import metrics
from xgboost import XGBRegressor
from sklearn.preprocessing import LabelEncoder
s/Hemant/jupyter_codes/ML Project 1/Big mart sales prediction/train.csv')
df.head(... | true | true |
f7f30de5b88cac5ee82220a7320f8a54d453dc10 | 1,222 | py | Python | lru_cache.py | tejeshreddy/python-oops | 117d47891c3a86594abedf71939e8dc628f3c3c4 | [
"Apache-2.0"
] | null | null | null | lru_cache.py | tejeshreddy/python-oops | 117d47891c3a86594abedf71939e8dc628f3c3c4 | [
"Apache-2.0"
] | null | null | null | lru_cache.py | tejeshreddy/python-oops | 117d47891c3a86594abedf71939e8dc628f3c3c4 | [
"Apache-2.0"
] | null | null | null | class Node:
def __init__(self, key, value):
self.key, self.value = key, value
self.prev = None
self.next = None
class LRUCache:
def __init__(self, capacity: int):
self.capacity = capacity
self.cache = {}
self.left = Node(0, 0)
self.right = Node(0, 0)
... | 25.458333 | 63 | 0.540917 | class Node:
def __init__(self, key, value):
self.key, self.value = key, value
self.prev = None
self.next = None
class LRUCache:
def __init__(self, capacity: int):
self.capacity = capacity
self.cache = {}
self.left = Node(0, 0)
self.right = Node(0, 0)
... | true | true |
f7f30dfb08ecbc84e70e3d27d425311c3c3822ce | 4,113 | py | Python | notebooks/numba_mds.py | peekxc/tallem | 949af20c1f50f9b6784ee32463e59123cd64294b | [
"Apache-2.0"
] | null | null | null | notebooks/numba_mds.py | peekxc/tallem | 949af20c1f50f9b6784ee32463e59123cd64294b | [
"Apache-2.0"
] | null | null | null | notebooks/numba_mds.py | peekxc/tallem | 949af20c1f50f9b6784ee32463e59123cd64294b | [
"Apache-2.0"
] | 1 | 2021-07-25T04:58:58.000Z | 2021-07-25T04:58:58.000Z | import os
import numpy as np
import numpy.typing as npt
from numpy.typing import ArrayLike
from typing import *
from .distance import *
from .utility import *
from scipy.sparse.linalg import eigs as truncated_eig
from scipy.linalg import eigh, eig as dense_eig
from scipy.spatial import KDTree
from scipy.sparse import c... | 32.132813 | 118 | 0.650377 | import os
import numpy as np
import numpy.typing as npt
from numpy.typing import ArrayLike
from typing import *
from .distance import *
from .utility import *
from scipy.sparse.linalg import eigs as truncated_eig
from scipy.linalg import eigh, eig as dense_eig
from scipy.spatial import KDTree
from scipy.sparse import c... | true | true |
f7f30f5868ad55075fa9466ca8baf3df8f882e65 | 294 | py | Python | pybeardy.zapper/test/test_zapstate.py | beardypig/zapper-experiments | 23e00fbd3fd7da4634375851094bacaa6a04fe62 | [
"MIT"
] | 3 | 2016-02-01T00:50:04.000Z | 2018-04-18T20:32:40.000Z | pybeardy.zapper/test/test_zapstate.py | beardypig/zapper-experiments | 23e00fbd3fd7da4634375851094bacaa6a04fe62 | [
"MIT"
] | null | null | null | pybeardy.zapper/test/test_zapstate.py | beardypig/zapper-experiments | 23e00fbd3fd7da4634375851094bacaa6a04fe62 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import unittest
from pybeardy.zapper import ZapState
class ZapStateTest(unittest.TestCase):
def test_state(self):
s = ZapState(True, True)
self.assertTrue(s.detect)
self.assertTrue(s.trigger)
if __name__ == '__main__':
unittest.main()
| 18.375 | 38 | 0.683673 |
import unittest
from pybeardy.zapper import ZapState
class ZapStateTest(unittest.TestCase):
def test_state(self):
s = ZapState(True, True)
self.assertTrue(s.detect)
self.assertTrue(s.trigger)
if __name__ == '__main__':
unittest.main()
| true | true |
f7f30fe691676e4c1e8de3d5d1cb4c018e8a8887 | 599 | py | Python | cdk-map-tagger/MapTaggingAutomatorService/app.py | chalee-dev/Migration-automation-library | c0ead6f3f8eadffcb1d2ef6d0c8b303de2039a92 | [
"MIT",
"MIT-0"
] | null | null | null | cdk-map-tagger/MapTaggingAutomatorService/app.py | chalee-dev/Migration-automation-library | c0ead6f3f8eadffcb1d2ef6d0c8b303de2039a92 | [
"MIT",
"MIT-0"
] | null | null | null | cdk-map-tagger/MapTaggingAutomatorService/app.py | chalee-dev/Migration-automation-library | c0ead6f3f8eadffcb1d2ef6d0c8b303de2039a92 | [
"MIT",
"MIT-0"
] | null | null | null | #!/usr/bin/env python3
from aws_cdk import core as cdk
# For consistency with TypeScript code, `cdk` is the preferred import name for
# the CDK's core module. The following line also imports it as `core` for use
# with examples from the CDK Developer's Guide, which are in the process of
# being updated to use `cdk`.... | 33.277778 | 109 | 0.792988 |
from aws_cdk import core as cdk
# with examples from the CDK Developer's Guide, which are in the process of
from aws_cdk import core
from map_tagging_automator_service.map_tagging_automator_service_stack import MapTaggingAutomatorServiceStack
app = core.App()
MapTaggingAutomatorServiceStack(app, "MapTaggingAut... | true | true |
f7f3104125c4bfc87ba9b9b1958afa06a5cb4ae7 | 1,365 | py | Python | setup.py | lolipopshock/notion-df | f6ef35e0ce71f8eb6e82b9c06b5d42706836e3bb | [
"MIT"
] | 14 | 2022-01-06T01:50:46.000Z | 2022-03-30T02:58:57.000Z | setup.py | lolipopshock/notion-df | f6ef35e0ce71f8eb6e82b9c06b5d42706836e3bb | [
"MIT"
] | 20 | 2022-01-06T06:43:12.000Z | 2022-03-30T18:34:15.000Z | setup.py | lolipopshock/notion-df | f6ef35e0ce71f8eb6e82b9c06b5d42706836e3bb | [
"MIT"
] | 3 | 2022-01-07T05:25:22.000Z | 2022-01-30T17:54:29.000Z | from setuptools import setup, find_packages
import os
def get_requirements(req_file):
reqs = []
with open(req_file, "r") as fp:
for line in fp.readlines():
if line.startswith("#") or line.strip() == "":
continue
else:
reqs.append(line.strip())
... | 32.5 | 105 | 0.649817 | from setuptools import setup, find_packages
import os
def get_requirements(req_file):
reqs = []
with open(req_file, "r") as fp:
for line in fp.readlines():
if line.startswith("#") or line.strip() == "":
continue
else:
reqs.append(line.strip())
... | true | true |
f7f310b5f8854d266e5c84b9e567159ce574dbcd | 1,782 | py | Python | nipype/interfaces/ants/tests/test_auto_WarpTimeSeriesImageMultiTransform.py | mfalkiewicz/nipype | 775e21b78fb1ffa2ff9cb12e6f052868bd44d052 | [
"Apache-2.0"
] | 1 | 2015-01-19T13:12:27.000Z | 2015-01-19T13:12:27.000Z | nipype/interfaces/ants/tests/test_auto_WarpTimeSeriesImageMultiTransform.py | bpinsard/nipype | 373bdddba9f675ef153951afa368729e2d8950d2 | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/ants/tests/test_auto_WarpTimeSeriesImageMultiTransform.py | bpinsard/nipype | 373bdddba9f675ef153951afa368729e2d8950d2 | [
"Apache-2.0"
] | null | null | null | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..resampling import WarpTimeSeriesImageMultiTransform
def test_WarpTimeSeriesImageMultiTransform_inputs():
input_map = dict(args=dict(argstr='%s',
),
dimension=dict(argstr='%d',
position=1,
usedefaul... | 27 | 67 | 0.660494 |
from __future__ import unicode_literals
from ..resampling import WarpTimeSeriesImageMultiTransform
def test_WarpTimeSeriesImageMultiTransform_inputs():
input_map = dict(args=dict(argstr='%s',
),
dimension=dict(argstr='%d',
position=1,
usedefault=True,
),
environ=dict(nohash=True,
used... | true | true |
f7f313450878b50a666a2c0d683675474bd3656e | 406 | py | Python | Palindrome.py | balubhasuran/String_Operations | 124d88a10ab9d05ad420ec5c3bdfa3d8b646e9fd | [
"MIT"
] | 1 | 2020-08-27T10:12:56.000Z | 2020-08-27T10:12:56.000Z | Palindrome.py | balubhasuran/String_Operations | 124d88a10ab9d05ad420ec5c3bdfa3d8b646e9fd | [
"MIT"
] | null | null | null | Palindrome.py | balubhasuran/String_Operations | 124d88a10ab9d05ad420ec5c3bdfa3d8b646e9fd | [
"MIT"
] | null | null | null | # Program to check if a string
# is palindrome or not
# change this value for a different output
my_str = 'aIbohPhoBiA'
# make it suitable for caseless comparison
my_str = my_str.casefold()
# reverse the string
rev_str = reversed(my_str)
# check if the string is equal to its reverse
if list(my_str) ==... | 23.882353 | 46 | 0.704433 |
my_str = 'aIbohPhoBiA'
my_str = my_str.casefold()
rev_str = reversed(my_str)
if list(my_str) == list(rev_str):
print("It is palindrome")
else:
print("It is not palindrome") | true | true |
f7f3136f7746db71e24cfccc976750c1f076d39c | 1,175 | py | Python | nipype/interfaces/freesurfer/tests/test_auto_TalairachAVI.py | mfalkiewicz/nipype | 775e21b78fb1ffa2ff9cb12e6f052868bd44d052 | [
"Apache-2.0"
] | 1 | 2015-01-19T13:12:27.000Z | 2015-01-19T13:12:27.000Z | nipype/interfaces/freesurfer/tests/test_auto_TalairachAVI.py | bpinsard/nipype | 373bdddba9f675ef153951afa368729e2d8950d2 | [
"Apache-2.0"
] | null | null | null | nipype/interfaces/freesurfer/tests/test_auto_TalairachAVI.py | bpinsard/nipype | 373bdddba9f675ef153951afa368729e2d8950d2 | [
"Apache-2.0"
] | null | null | null | # AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT
from __future__ import unicode_literals
from ..utils import TalairachAVI
def test_TalairachAVI_inputs():
input_map = dict(args=dict(argstr='%s',
),
atlas=dict(argstr='--atlas %s',
),
environ=dict(nohash=True,
usedefault=True,
),
ign... | 25.543478 | 67 | 0.637447 |
from __future__ import unicode_literals
from ..utils import TalairachAVI
def test_TalairachAVI_inputs():
input_map = dict(args=dict(argstr='%s',
),
atlas=dict(argstr='--atlas %s',
),
environ=dict(nohash=True,
usedefault=True,
),
ignore_exception=dict(deprecated='1.0.0',
nohash=Tru... | true | true |
f7f313c39b8508811c9e4fac3282cd2b7d494fa1 | 15,396 | py | Python | clus/ens_eof_kmeans.py | jhardenberg/EnsClus | c7591aa39d649fc4321ac4db219f241aabcaf295 | [
"Apache-2.0"
] | null | null | null | clus/ens_eof_kmeans.py | jhardenberg/EnsClus | c7591aa39d649fc4321ac4db219f241aabcaf295 | [
"Apache-2.0"
] | null | null | null | clus/ens_eof_kmeans.py | jhardenberg/EnsClus | c7591aa39d649fc4321ac4db219f241aabcaf295 | [
"Apache-2.0"
] | 1 | 2019-02-13T18:00:34.000Z | 2019-02-13T18:00:34.000Z | #*********************************
# ens_eof_kmeans *
#*********************************
# Standard packages
import numpy as np
import sys
import os
from sklearn.cluster import KMeans
import datetime
import math
import pandas as pd
import collections
from itertools import combinations
from numpy import... | 41.723577 | 187 | 0.64244 |
import numpy as np
import sys
import os
from sklearn.cluster import KMeans
import datetime
import math
import pandas as pd
import collections
from itertools import combinations
from numpy import linalg as LA
def clus_eval_indexes(elements, centroids, labels):
PCs = elements
numclus):
lab_clus = l... | true | true |
f7f3141465c29f36d87566a6a09e2e8bb1c8a3cb | 18,445 | py | Python | isee/_version.py | team-mayes/isEE | c22d7cc78a43f0c0a7b2ec18fbc3b628ddef8d54 | [
"BSD-3-Clause"
] | null | null | null | isee/_version.py | team-mayes/isEE | c22d7cc78a43f0c0a7b2ec18fbc3b628ddef8d54 | [
"BSD-3-Clause"
] | 1 | 2021-09-17T18:20:36.000Z | 2021-10-06T16:56:34.000Z | isee/_version.py | team-mayes/isEE | c22d7cc78a43f0c0a7b2ec18fbc3b628ddef8d54 | [
"BSD-3-Clause"
] | null | null | null |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... | 35.403071 | 79 | 0.58444 |
import errno
import os
import re
import subprocess
import sys
def get_keywords():
git_refnames = "$Format:%d$"
git_full = "$Format:%H$"
git_date = "$Format:%ci$"
keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}
return keywords
class Version... | true | true |
f7f314d76f252a81ed8c5be2517ed7122951adc6 | 17,273 | py | Python | lldb/test/API/tools/lldb-vscode/launch/TestVSCode_launch.py | tiwaria1/llvm | 616a396db0610ae0c1992361af005a869ef81897 | [
"Apache-2.0"
] | 1 | 2020-09-10T01:00:18.000Z | 2020-09-10T01:00:18.000Z | lldb/test/API/tools/lldb-vscode/launch/TestVSCode_launch.py | coolstar/llvm-project | e21ccdd5b5667de50de65ee8903a89a21020e89a | [
"Apache-2.0"
] | 9 | 2020-04-24T21:51:04.000Z | 2020-11-06T01:04:09.000Z | lldb/test/API/tools/lldb-vscode/launch/TestVSCode_launch.py | coolstar/llvm-project | e21ccdd5b5667de50de65ee8903a89a21020e89a | [
"Apache-2.0"
] | null | null | null | """
Test lldb-vscode setBreakpoints request
"""
import unittest2
import vscode
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
import lldbvscode_testcase
import time
import os
class TestVSCode_launch(lldbvscode_testcase.VSCodeTestCaseBase):
mydi... | 40.834515 | 85 | 0.588201 |
import unittest2
import vscode
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import lldbutil
import lldbvscode_testcase
import time
import os
class TestVSCode_launch(lldbvscode_testcase.VSCodeTestCaseBase):
mydir = TestBase.compute_mydir(__file__)
@skipI... | true | true |
f7f3151e66557a7a7bda9acd9a6d8503f05a72a1 | 1,602 | py | Python | tests/english.py | kamilpp/andip | 1082234e628b0fc7b2f2fca3a0ee2cb30f0ea74d | [
"MIT"
] | null | null | null | tests/english.py | kamilpp/andip | 1082234e628b0fc7b2f2fca3a0ee2cb30f0ea74d | [
"MIT"
] | null | null | null | tests/english.py | kamilpp/andip | 1082234e628b0fc7b2f2fca3a0ee2cb30f0ea74d | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import unittest
from andip import AnDiP
from andip.provider import FileProvider
class PolishTest(unittest.TestCase):
def setUp(self):
self.ad = AnDiP(FileProvider('../data/english'))
def testGetWordVerb(self):
self.assertEqual(u'am', self.ad.get_word(('verb', 'be', {'number': 'singular... | 51.677419 | 105 | 0.620474 |
import unittest
from andip import AnDiP
from andip.provider import FileProvider
class PolishTest(unittest.TestCase):
def setUp(self):
self.ad = AnDiP(FileProvider('../data/english'))
def testGetWordVerb(self):
self.assertEqual(u'am', self.ad.get_word(('verb', 'be', {'number': 'singular', 'person': 'first'}))... | true | true |
f7f315520fa5d055e05d6b8d423fdb181dabb298 | 19,825 | py | Python | ecogvis/functions/htk_to_nwb/chang2nwb.py | jessierliu/ecogVIS | 86f39eb5f69d1891ac102e269549689083adf3d9 | [
"BSD-3-Clause"
] | 13 | 2020-04-01T22:39:24.000Z | 2022-03-04T13:27:51.000Z | ecogvis/functions/htk_to_nwb/chang2nwb.py | jessierliu/ecogVIS | 86f39eb5f69d1891ac102e269549689083adf3d9 | [
"BSD-3-Clause"
] | 56 | 2020-04-01T14:27:21.000Z | 2022-03-23T21:33:06.000Z | ecogvis/functions/htk_to_nwb/chang2nwb.py | luiztauffer/ecogVIS | c97e79a20b3af1074a3a5e1f1ad864a580c97e04 | [
"BSD-3-Clause"
] | 11 | 2020-05-15T17:48:53.000Z | 2022-02-01T23:55:12.000Z | # -*- coding: utf-8 -*-
"""
Convert ECoG to NWB.
:Author: Ben Dichter, Jessie R. Liu
Modified by Luiz Tauffer on May 30, 2020
"""
from __future__ import print_function
import os
from datetime import datetime
from os import path
from pathlib import Path
import numpy as np
import pandas as pd
from hdmf.backends.hdf5 im... | 36.645102 | 112 | 0.591778 |
from __future__ import print_function
import os
from datetime import datetime
from os import path
from pathlib import Path
import numpy as np
import pandas as pd
from hdmf.backends.hdf5 import H5DataIO
from ndx_ecog import ECoGSubject
from ndx_bipolar_scheme import BipolarSchemeTable, EcephysExt
from pynwb.file impor... | true | true |
f7f3155980289974e5020e3164309446a7e34e44 | 570 | py | Python | Python/nizovi/nizovi.py | rvrheenen/OpenKattis | 7fd59fcb54e86cdf10f56c580c218c62e584f391 | [
"MIT"
] | 12 | 2016-10-03T20:43:43.000Z | 2021-06-12T17:18:42.000Z | Python/nizovi/nizovi.py | rvrheenen/OpenKattis | 7fd59fcb54e86cdf10f56c580c218c62e584f391 | [
"MIT"
] | null | null | null | Python/nizovi/nizovi.py | rvrheenen/OpenKattis | 7fd59fcb54e86cdf10f56c580c218c62e584f391 | [
"MIT"
] | 10 | 2017-11-14T19:56:37.000Z | 2021-02-02T07:39:57.000Z | line = input()
spaces = 0
elements = 0
for i in range(len(line)):
char = line[i]
if char == "{":
elements = 0
print(spaces * " " + char)
spaces += 2
elif char == "}":
spaces -= 2
print(("\n" if elements > 0 else "") + spaces * " " + char, end=("" if (spaces > 0 and li... | 25.909091 | 124 | 0.438596 | line = input()
spaces = 0
elements = 0
for i in range(len(line)):
char = line[i]
if char == "{":
elements = 0
print(spaces * " " + char)
spaces += 2
elif char == "}":
spaces -= 2
print(("\n" if elements > 0 else "") + spaces * " " + char, end=("" if (spaces > 0 and li... | true | true |
f7f315ace0a2d1940579a7ef672924c54235e5bd | 3,002 | py | Python | test/ffmpeg-qsv/decode/vp9.py | wangzj0601/vaapi-fits | df3188dc6624492ba941e4d0e74c2a0ffdf36759 | [
"BSD-3-Clause"
] | null | null | null | test/ffmpeg-qsv/decode/vp9.py | wangzj0601/vaapi-fits | df3188dc6624492ba941e4d0e74c2a0ffdf36759 | [
"BSD-3-Clause"
] | null | null | null | test/ffmpeg-qsv/decode/vp9.py | wangzj0601/vaapi-fits | df3188dc6624492ba941e4d0e74c2a0ffdf36759 | [
"BSD-3-Clause"
] | null | null | null | ###
### Copyright (C) 2018-2019 Intel Corporation
###
### SPDX-License-Identifier: BSD-3-Clause
###
from ....lib import *
from ..util import *
#-------------------------------------------------#
#----------------------8BIT-----------------------#
#-------------------------------------------------#
spec_8bit = load_t... | 35.317647 | 72 | 0.633245 | ash.requires(have_ffmpeg_vp9_qsv_decode)
@slash.requires(using_compatible_driver)
@slash.parametrize(("case"), sorted(spec_8bit.keys()))
@platform_tags(VP9_DECODE_8BIT_PLATFORMS)
def test_8bit(case):
params = spec_8bit[case].copy()
params.update(mformat = mapformat(params["format"]))
if params["mformat"] is None... | true | true |
f7f316e5dd64a7d086b94a7eb910318f5913d9c2 | 7,460 | py | Python | python/oneflow/compatible/single_client/test/ops/test_hardsigmoid.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 3,285 | 2020-07-31T05:51:22.000Z | 2022-03-31T15:20:16.000Z | python/oneflow/compatible/single_client/test/ops/test_hardsigmoid.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 2,417 | 2020-07-31T06:28:58.000Z | 2022-03-31T23:04:14.000Z | python/oneflow/compatible/single_client/test/ops/test_hardsigmoid.py | wangyuyue/oneflow | 0a71c22fe8355392acc8dc0e301589faee4c4832 | [
"Apache-2.0"
] | 520 | 2020-07-31T05:52:42.000Z | 2022-03-29T02:38:11.000Z | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 36.213592 | 87 | 0.627882 |
import os
import random
import unittest
from collections import OrderedDict
from typing import Dict
import numpy as np
from test_util import GenArgList
import oneflow.compatible.single_client.unittest
from oneflow.compatible import single_client as flow
from oneflow.compatible.single_client import typing as tp
def... | true | true |
f7f3174a366c97717d3d58e470331f98b736be61 | 28,127 | py | Python | api_tests/search/views/test_views.py | laurenrevere/osf.io | f08daebf6ff280375ef966fdce4d3b6602c2236e | [
"Apache-2.0"
] | null | null | null | api_tests/search/views/test_views.py | laurenrevere/osf.io | f08daebf6ff280375ef966fdce4d3b6602c2236e | [
"Apache-2.0"
] | 18 | 2020-03-24T16:16:14.000Z | 2022-03-03T22:37:48.000Z | api_tests/search/views/test_views.py | kounoAkihiro/SV-RDM-OSF | 76fb0c739f4cdabf03b5bfd2bc63d83b1c2d4796 | [
"Apache-2.0"
] | 1 | 2021-10-04T21:16:56.000Z | 2021-10-04T21:16:56.000Z | import pytest
import uuid
from api.base.settings.defaults import API_BASE
from api_tests import utils
from framework.auth.core import Auth
from osf.models import MetaSchema
from osf_tests.factories import (
AuthUserFactory,
NodeFactory,
ProjectFactory,
InstitutionFactory,
)
from osf_tests.utils import ... | 36.76732 | 119 | 0.624773 | import pytest
import uuid
from api.base.settings.defaults import API_BASE
from api_tests import utils
from framework.auth.core import Auth
from osf.models import MetaSchema
from osf_tests.factories import (
AuthUserFactory,
NodeFactory,
ProjectFactory,
InstitutionFactory,
)
from osf_tests.utils import ... | true | true |
f7f317add08f41536527cb59e71d25bcc12b36ce | 29,609 | py | Python | absl/flags/tests/_flagvalues_test.py | jaximan/abseil-py | 6493f8b2f5ce3887ce184348fb7cc4c0f8b20e44 | [
"Apache-2.0"
] | 1 | 2019-09-03T15:51:01.000Z | 2019-09-03T15:51:01.000Z | absl/flags/tests/_flagvalues_test.py | jaximan/abseil-py | 6493f8b2f5ce3887ce184348fb7cc4c0f8b20e44 | [
"Apache-2.0"
] | null | null | null | absl/flags/tests/_flagvalues_test.py | jaximan/abseil-py | 6493f8b2f5ce3887ce184348fb7cc4c0f8b20e44 | [
"Apache-2.0"
] | 1 | 2019-09-03T15:50:51.000Z | 2019-09-03T15:50:51.000Z | # Copyright 2017 The Abseil Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 35.673494 | 80 | 0.668716 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import copy
import pickle
import types
import unittest
from absl import logging
from absl.flags import _defines
from absl.flags import _exceptions
from absl.flags import _flag... | true | true |
f7f319539967a275c67545e932b9d43a7c70f352 | 1,135 | py | Python | pdf.py | yesiah/contract-generator | c7cdc1d4bc4da5de3991d6908a9cc8705ef53e52 | [
"MIT"
] | null | null | null | pdf.py | yesiah/contract-generator | c7cdc1d4bc4da5de3991d6908a9cc8705ef53e52 | [
"MIT"
] | null | null | null | pdf.py | yesiah/contract-generator | c7cdc1d4bc4da5de3991d6908a9cc8705ef53e52 | [
"MIT"
] | null | null | null | import pathlib
from fpdf import FPDF
root_path = pathlib.Path(__file__).parent.absolute()
# trade by trade
# prepayment
# bi-weekly
# monthly
def trade_by_trade(self):
path = root_path / "contract-templates/cht/逐筆結.txt"
with open(path, 'rb') as f:
txt = f.read().decode('UTF-8')
self.set_text_c... | 25.795455 | 76 | 0.648458 | import pathlib
from fpdf import FPDF
root_path = pathlib.Path(__file__).parent.absolute()
def trade_by_trade(self):
path = root_path / "contract-templates/cht/逐筆結.txt"
with open(path, 'rb') as f:
txt = f.read().decode('UTF-8')
self.set_text_color(r=0.0, g=100.0, b=0.0)
self.set_fon... | true | true |
f7f319763ee127b78e41f5871e463ceaed73d650 | 7,674 | py | Python | SciDataTool/Functions/change_referential.py | enjoyneer87/SciDataTool | 37ddc4071f1edb1270ee03e43595c3f943fb9bd8 | [
"Apache-2.0"
] | null | null | null | SciDataTool/Functions/change_referential.py | enjoyneer87/SciDataTool | 37ddc4071f1edb1270ee03e43595c3f943fb9bd8 | [
"Apache-2.0"
] | null | null | null | SciDataTool/Functions/change_referential.py | enjoyneer87/SciDataTool | 37ddc4071f1edb1270ee03e43595c3f943fb9bd8 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import scipy.interpolate as scp_int
from SciDataTool.Functions.set_routines import unique_tol
def change_referential_spectrum(
freqs,
wavenumbers_circ,
rotation_speed,
spectrum,
atol=1e-9,
freqs_new=np.array([]),
I1=np.array([]),
Irf_un=np.array([]),
is_double_f... | 31.45082 | 100 | 0.615455 | import numpy as np
import scipy.interpolate as scp_int
from SciDataTool.Functions.set_routines import unique_tol
def change_referential_spectrum(
freqs,
wavenumbers_circ,
rotation_speed,
spectrum,
atol=1e-9,
freqs_new=np.array([]),
I1=np.array([]),
Irf_un=np.array([]),
is_double_f... | true | true |
f7f3197a63d1a77171ea3b316f1cc51ce46796cd | 16,825 | py | Python | cassandra/__init__.py | dotyjim-work/cassandra-python-driver | 8d292edb963d801503067f53d4d61d97fc4957aa | [
"Apache-2.0"
] | null | null | null | cassandra/__init__.py | dotyjim-work/cassandra-python-driver | 8d292edb963d801503067f53d4d61d97fc4957aa | [
"Apache-2.0"
] | null | null | null | cassandra/__init__.py | dotyjim-work/cassandra-python-driver | 8d292edb963d801503067f53d4d61d97fc4957aa | [
"Apache-2.0"
] | null | null | null | # Copyright DataStax, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softwa... | 27.49183 | 108 | 0.664368 |
import logging
class NullHandler(logging.Handler):
def emit(self, record):
pass
logging.getLogger('cassandra').addHandler(NullHandler())
__version_info__ = (3, 13, 0, 3)
__version__ = '.'.join(map(str, __version_info__))
class ConsistencyLevel(object):
ANY = 0
ONE = 1
TWO... | true | true |
f7f3199e9467bb9eb78b3f24613b452ee7e4b866 | 404 | py | Python | darisset/asgi.py | danangharissetiawan/darisset.site | 2b7e13d0b00f4169a3068362d07bade20d32269f | [
"MIT"
] | 1 | 2020-09-30T07:20:56.000Z | 2020-09-30T07:20:56.000Z | darisset/asgi.py | danangharissetiawan/darisset.site | 2b7e13d0b00f4169a3068362d07bade20d32269f | [
"MIT"
] | 10 | 2020-10-29T19:31:25.000Z | 2022-03-19T04:13:32.000Z | darisset/asgi.py | danangharissetiawan/darisset.site | 2b7e13d0b00f4169a3068362d07bade20d32269f | [
"MIT"
] | null | null | null | """
ASGI config for darisset project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETT... | 23.764706 | 79 | 0.789604 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'darisset.settings.production')
application = get_asgi_application()
| true | true |
f7f31a94cff5212f76e1e304877051d756d562f6 | 3,631 | py | Python | napari/plugins/_tests/test_hook_specifications.py | SaraLatif99/napari | b17235ee77d30e58492368a73d7c8d8189397fa4 | [
"BSD-3-Clause"
] | null | null | null | napari/plugins/_tests/test_hook_specifications.py | SaraLatif99/napari | b17235ee77d30e58492368a73d7c8d8189397fa4 | [
"BSD-3-Clause"
] | 1 | 2020-06-19T21:38:50.000Z | 2020-06-20T19:57:39.000Z | napari/plugins/_tests/test_hook_specifications.py | SaraLatif99/napari | b17235ee77d30e58492368a73d7c8d8189397fa4 | [
"BSD-3-Clause"
] | null | null | null | import inspect
import warnings
import pytest
from numpydoc.docscrape import FunctionDoc
from napari.plugins import hook_specifications
# 1. we first create a hook specification decorator:
# ``napari_hook_specification = pluggy.HookspecMarker("napari")``
# 2. when it decorates a function, that function object gets... | 38.62766 | 79 | 0.685211 | import inspect
import warnings
import pytest
from numpydoc.docscrape import FunctionDoc
from napari.plugins import hook_specifications
HOOK_SPECIFICATIONS = [
(name, func)
for name, func in vars(hook_specifications).items()
if hasattr(func, 'napari_spec')
]
@pytest.mark.parametrize("name... | true | true |
f7f31ae91fbf4afc74c954d0762d5d2c899861ef | 48,617 | py | Python | lsteamclient/gen_wrapper.py | stevenlafl/Proton | 11c106ff774308ec69fd2e30235b5d0dcb281fbf | [
"MIT",
"BSD-3-Clause"
] | 7 | 2020-05-28T16:07:57.000Z | 2021-05-25T04:09:19.000Z | lsteamclient/gen_wrapper.py | stevenlafl/Proton | 11c106ff774308ec69fd2e30235b5d0dcb281fbf | [
"MIT",
"BSD-3-Clause"
] | null | null | null | lsteamclient/gen_wrapper.py | stevenlafl/Proton | 11c106ff774308ec69fd2e30235b5d0dcb281fbf | [
"MIT",
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python2
#NOTE: If you make modifications here, consider whether they should
#be duplicated in ../vrclient/gen_wrapper.py
from __future__ import print_function
CLANG_PATH='/usr/lib/clang/9.0.0'
import pprint
import sys
import clang.cindex
import os
import re
import math
sdk_versions = [
"148a",
... | 38.371744 | 271 | 0.57231 |
from __future__ import print_function
CLANG_PATH='/usr/lib/clang/9.0.0'
import pprint
import sys
import clang.cindex
import os
import re
import math
sdk_versions = [
"148a",
"147",
"146",
"145",
"144",
"143y",
"143x",
"143",
"142",
"141",
"140",
"139",
"138a",... | true | true |
f7f31b915b9c154dedbf21efd4a2c0c30497ae81 | 2,265 | py | Python | src/eiffel_graphql_api/graphql/schemas/base.py | magnusbaeck/eiffel-graphql-api | c0cd0dc3fdad7787988599974ace2a4cebf70844 | [
"Apache-2.0"
] | null | null | null | src/eiffel_graphql_api/graphql/schemas/base.py | magnusbaeck/eiffel-graphql-api | c0cd0dc3fdad7787988599974ace2a4cebf70844 | [
"Apache-2.0"
] | null | null | null | src/eiffel_graphql_api/graphql/schemas/base.py | magnusbaeck/eiffel-graphql-api | c0cd0dc3fdad7787988599974ace2a4cebf70844 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Axis Communications AB.
#
# For a full list of individual contributors, please see the commit history.
#
# 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.apac... | 37.131148 | 97 | 0.683002 |
from datetime import datetime
import graphene
from graphene import relay
from .utils import find_type, search, multi_search
from .lib.generic import json_schema_to_graphql, load
class EiffelObjectType(graphene.ObjectType):
links = graphene.List("eiffel_graphql_api.graphql.schemas.union.EiffelLinkUn... | true | true |
f7f31c7cda0bb66b1a8b4b7a5e1643ed3dc8d9a1 | 27,126 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_packet_captures_operations.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 1 | 2020-05-12T23:29:15.000Z | 2020-05-12T23:29:15.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_packet_captures_operations.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | 226 | 2019-07-24T07:57:21.000Z | 2019-10-15T01:07:24.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2020_03_01/operations/_packet_captures_operations.py | iscai-msft/azure-sdk-for-python | 83715b95c41e519d5be7f1180195e2fba136fc0f | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 49.863971 | 215 | 0.69015 |
import uuid
from msrest.pipeline import ClientRawResponse
from msrest.polling import LROPoller, NoPolling
from msrestazure.polling.arm_polling import ARMPolling
from .. import models
class PacketCapturesOperations(object):
models = models
def __init__(self, client, config, serializer, deserializ... | true | true |
f7f31cc3ba143931dd5a32db84ada71ba97590e1 | 806 | py | Python | frappe/desk/doctype/system_console/system_console.py | almeidapaulopt/frappe | 7a406c75cb41cf9c9d893429b313611484f3bbea | [
"MIT"
] | 3 | 2019-01-01T10:46:15.000Z | 2019-01-01T10:46:18.000Z | frappe/desk/doctype/system_console/system_console.py | Anurag810/frappe | 620cad18d60f090f5f9c13a5eefb56e86615de06 | [
"MIT"
] | null | null | null | frappe/desk/doctype/system_console/system_console.py | Anurag810/frappe | 620cad18d60f090f5f9c13a5eefb56e86615de06 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2020, Frappe Technologies and contributors
# License: MIT. See LICENSE
import json
import frappe
from frappe.utils.safe_exec import safe_exec
from frappe.model.document import Document
class SystemConsole(Document):
def run(self):
frappe.only_for('System Manager')
try:
... | 22.388889 | 58 | 0.715881 |
import json
import frappe
from frappe.utils.safe_exec import safe_exec
from frappe.model.document import Document
class SystemConsole(Document):
def run(self):
frappe.only_for('System Manager')
try:
frappe.debug_log = []
safe_exec(self.console)
self.output = '\n'.join(frappe.debug_log)
except:
... | true | true |
f7f31ccb681c49be55c39df404d53b9490c23b74 | 558 | py | Python | csm_test_utils/rds_backup/generation/sqla/db_model.py | opentelekomcloud-infra/csm-test-utils | ec3c4a6bf4d4806e76d0d8dfcfe024c39c9a0e36 | [
"Apache-2.0"
] | 1 | 2021-02-08T08:53:01.000Z | 2021-02-08T08:53:01.000Z | csm_test_utils/rds_backup/generation/sqla/db_model.py | opentelekomcloud-infra/csm-test-utils | ec3c4a6bf4d4806e76d0d8dfcfe024c39c9a0e36 | [
"Apache-2.0"
] | 22 | 2019-10-21T15:10:14.000Z | 2021-04-07T07:27:20.000Z | csm_test_utils/rds_backup/generation/sqla/db_model.py | opentelekomcloud-infra/csm-test-utils | ec3c4a6bf4d4806e76d0d8dfcfe024c39c9a0e36 | [
"Apache-2.0"
] | 1 | 2021-02-08T08:53:07.000Z | 2021-02-08T08:53:07.000Z | import uuid
from sqlalchemy import BigInteger, Column, Text
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class TestRdsTable(Base): # pylint: disable=too-few-public-methods
"""Class representing a model of database for ORM"""
__tablename__ = str(uuid.uuid4())
id = ... | 25.363636 | 67 | 0.700717 | import uuid
from sqlalchemy import BigInteger, Column, Text
from sqlalchemy.ext.declarative import declarative_base
Base = declarative_base()
class TestRdsTable(Base):
__tablename__ = str(uuid.uuid4())
id = Column(BigInteger, primary_key=True, autoincrement=True)
content = Column(Text)
def __in... | true | true |
f7f31cf3219e014b840ef501340534010226058d | 416 | py | Python | pip3.8-script.py | prudhvipaluvayi/user-register | 2460096043723d3c7a009319ecc6c756794cc8a4 | [
"BSD-3-Clause"
] | null | null | null | pip3.8-script.py | prudhvipaluvayi/user-register | 2460096043723d3c7a009319ecc6c756794cc8a4 | [
"BSD-3-Clause"
] | null | null | null | pip3.8-script.py | prudhvipaluvayi/user-register | 2460096043723d3c7a009319ecc6c756794cc8a4 | [
"BSD-3-Clause"
] | null | null | null | #!C:\Users\sys\registration\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==10.0.1','console_scripts','pip3.8'
__requires__ = 'pip==10.0.1'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])... | 32 | 71 | 0.641827 |
__requires__ = 'pip==10.0.1'
import re
import sys
from pkg_resources import load_entry_point
if __name__ == '__main__':
sys.argv[0] = re.sub(r'(-script\.pyw?|\.exe)?$', '', sys.argv[0])
sys.exit(
load_entry_point('pip==10.0.1', 'console_scripts', 'pip3.8')()
)
| true | true |
f7f31d1c6b18a7f2a3be4f9fb09b36dbf8f94ad5 | 417 | py | Python | apps/accounts/migrations/0009_auto_20200319_1613.py | onyxhealth/safhir-vmi | 60ba90e9e8ba00347e0dc32e3061da5285df4ade | [
"Apache-2.0"
] | null | null | null | apps/accounts/migrations/0009_auto_20200319_1613.py | onyxhealth/safhir-vmi | 60ba90e9e8ba00347e0dc32e3061da5285df4ade | [
"Apache-2.0"
] | 9 | 2021-03-19T11:43:09.000Z | 2022-03-12T00:38:43.000Z | apps/accounts/migrations/0009_auto_20200319_1613.py | onyxhealth/safhir-vmi | 60ba90e9e8ba00347e0dc32e3061da5285df4ade | [
"Apache-2.0"
] | null | null | null | # Generated by Django 2.2.10 on 2020-03-19 16:13
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0008_auto_20191123_2239'),
]
operations = [
migrations.AlterField(
model_name='organization',
name='slu... | 21.947368 | 75 | 0.609113 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0008_auto_20191123_2239'),
]
operations = [
migrations.AlterField(
model_name='organization',
name='slug',
field=models.SlugField(blank=Tru... | true | true |
f7f31da12968feeaf16b93c62669a52080c02b48 | 312 | py | Python | jsonite/JavascriptProvider.py | ChrisByrd14/JSONite | db77b535524e424775bc8f65c3809b94229767ae | [
"MIT"
] | null | null | null | jsonite/JavascriptProvider.py | ChrisByrd14/JSONite | db77b535524e424775bc8f65c3809b94229767ae | [
"MIT"
] | null | null | null | jsonite/JavascriptProvider.py | ChrisByrd14/JSONite | db77b535524e424775bc8f65c3809b94229767ae | [
"MIT"
] | null | null | null | from masonite.provider import ServiceProvider
from .Javascript import Javascript
class JavascriptProvider(ServiceProvider):
"""Bind Javascript class into the Service Container."""
wsgi = True
def boot(self):
pass
def register(self):
self.app.bind("Javascript", Javascript)
| 18.352941 | 59 | 0.705128 | from masonite.provider import ServiceProvider
from .Javascript import Javascript
class JavascriptProvider(ServiceProvider):
wsgi = True
def boot(self):
pass
def register(self):
self.app.bind("Javascript", Javascript)
| true | true |
f7f31e6d03c0bb13acf29e547fc0d7dd94b57ee5 | 8,190 | py | Python | tfx/dsl/context_managers/context_manager.py | codesue/tfx | f4d804dbe05741a8df66fd251b87658450703001 | [
"Apache-2.0"
] | 2 | 2019-08-30T20:09:17.000Z | 2019-08-30T20:16:53.000Z | tfx/dsl/context_managers/context_manager.py | codesue/tfx | f4d804dbe05741a8df66fd251b87658450703001 | [
"Apache-2.0"
] | null | null | null | tfx/dsl/context_managers/context_manager.py | codesue/tfx | f4d804dbe05741a8df66fd251b87658450703001 | [
"Apache-2.0"
] | 1 | 2021-07-22T18:32:46.000Z | 2021-07-22T18:32:46.000Z | # Copyright 2021 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 required by applicable law or a... | 34.851064 | 81 | 0.733089 |
import abc
import collections
import threading
import types
from typing import Any, Optional, List, Iterable, Type
import attr
_BaseNode = Any
def _generate_context_id(self) -> str:
return f'{self.__class__.__name__}:{len(_registry.all_contexts)}'
def _peek_registry() -> Optional['DslContext']:... | true | true |
f7f3225da6bef5b62a0eaf1836b1c4e0c18e9e0c | 647 | py | Python | drfexts/constants.py | anyidea/drfexts | d618227fd585f2acaf7954f31035d16130e30384 | [
"Apache-2.0"
] | 4 | 2021-12-08T10:50:37.000Z | 2022-03-05T03:54:56.000Z | drfexts/constants.py | anyidea/drfexts | d618227fd585f2acaf7954f31035d16130e30384 | [
"Apache-2.0"
] | 1 | 2022-02-17T02:34:40.000Z | 2022-02-17T02:34:40.000Z | drfexts/constants.py | anyidea/drfexts | d618227fd585f2acaf7954f31035d16130e30384 | [
"Apache-2.0"
] | null | null | null | from django.db import models
class SimpleStatus(models.IntegerChoices):
VALID = 50, "已生效"
INVALID = 100, "已失效"
class CommonStatus(models.IntegerChoices):
DELETED = 0, "已删除"
TO_SUBMIT = 5, "待提交"
TO_VALID = 10, "待生效"
PAUSED = 25, "暂停中"
VALID = 50, "已生效"
TO_INVALID = 75, "待失效"
INVAL... | 22.310345 | 42 | 0.621329 | from django.db import models
class SimpleStatus(models.IntegerChoices):
VALID = 50, "已生效"
INVALID = 100, "已失效"
class CommonStatus(models.IntegerChoices):
DELETED = 0, "已删除"
TO_SUBMIT = 5, "待提交"
TO_VALID = 10, "待生效"
PAUSED = 25, "暂停中"
VALID = 50, "已生效"
TO_INVALID = 75, "待失效"
INVAL... | true | true |
f7f3226c85ff785580b25fd69d6356605767aca3 | 9,264 | py | Python | plaid/model/transaction_all_of.py | Aky87/plaid-python | af56d445a9e0178b33fb0443f8399dd51c024fe1 | [
"MIT"
] | null | null | null | plaid/model/transaction_all_of.py | Aky87/plaid-python | af56d445a9e0178b33fb0443f8399dd51c024fe1 | [
"MIT"
] | null | null | null | plaid/model/transaction_all_of.py | Aky87/plaid-python | af56d445a9e0178b33fb0443f8399dd51c024fe1 | [
"MIT"
] | null | null | null | """
The Plaid API
The Plaid REST API. Please see https://plaid.com/docs/api for more details. # noqa: E501
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from plaid.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal... | 47.025381 | 478 | 0.618199 |
import re
import sys
from plaid.model_utils import (
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,
)
def lazy_im... | true | true |
f7f3242148e62b1bf4dbf20c3715936d7bd1d076 | 762 | py | Python | _sdk/_paypal/orders/orders_validate_request.py | Memberships-Affiliate-Management-API/membership_and_affiliate_api | 038cb2d4dfa4a47fb8e31dc9d00cd36dd28867d5 | [
"MIT"
] | 1 | 2021-08-31T15:24:48.000Z | 2021-08-31T15:24:48.000Z | _sdk/_paypal/orders/orders_validate_request.py | freelancing-solutions/membership_and_affiliate_api | 038cb2d4dfa4a47fb8e31dc9d00cd36dd28867d5 | [
"MIT"
] | 1 | 2021-10-13T14:11:15.000Z | 2021-10-13T14:11:15.000Z | _sdk/_paypal/orders/orders_validate_request.py | Memberships-Affiliate-Management-API/membership_and_affiliate_api | 038cb2d4dfa4a47fb8e31dc9d00cd36dd28867d5 | [
"MIT"
] | 1 | 2021-08-31T15:25:28.000Z | 2021-08-31T15:25:28.000Z | import paypalhttp
from urllib.parse import quote # Python 3+
# noinspection PyDictCreation
class OrdersValidateRequest:
"""
Validates a payment method and checks it for contingencies.
"""
def __init__(self, order_id):
self.verb = "POST"
self.path = "/v2/checkout/orders/{order_id}/vali... | 33.130435 | 121 | 0.692913 | import paypalhttp
from urllib.parse import quote
class OrdersValidateRequest:
def __init__(self, order_id):
self.verb = "POST"
self.path = "/v2/checkout/orders/{order_id}/validate-payment-method?".replace("{order_id}", quote(str(order_id)))
self.headers = {}
self.headers["Conten... | true | true |
f7f3244612927f459a9a92bc9aa249e3a62575cf | 10,932 | py | Python | Algorithm.Python/stubs/QuantConnect/Data/__Fundamental_59.py | gaoxiaojun/Lean | 9dca43bccb720d0df91e4bfc1d363b71e3a36cb5 | [
"Apache-2.0"
] | 2 | 2020-12-08T11:27:20.000Z | 2021-04-06T13:21:15.000Z | Algorithm.Python/stubs/QuantConnect/Data/__Fundamental_59.py | gaoxiaojun/Lean | 9dca43bccb720d0df91e4bfc1d363b71e3a36cb5 | [
"Apache-2.0"
] | null | null | null | Algorithm.Python/stubs/QuantConnect/Data/__Fundamental_59.py | gaoxiaojun/Lean | 9dca43bccb720d0df91e4bfc1d363b71e3a36cb5 | [
"Apache-2.0"
] | 1 | 2020-12-08T11:27:21.000Z | 2020-12-08T11:27:21.000Z | from .__Fundamental_60 import *
import typing
import System.IO
import System.Collections.Generic
import System
import QuantConnect.Data.Fundamental.MultiPeriodField
import QuantConnect.Data.Fundamental
import QuantConnect.Data
import QuantConnect
import datetime
class RentExpenseSupplementalIncomeStatement(QuantConne... | 31.323782 | 173 | 0.737559 | from .__Fundamental_60 import *
import typing
import System.IO
import System.Collections.Generic
import System
import QuantConnect.Data.Fundamental.MultiPeriodField
import QuantConnect.Data.Fundamental
import QuantConnect.Data
import QuantConnect
import datetime
class RentExpenseSupplementalIncomeStatement(QuantConne... | true | true |
f7f325648393bcbc7e0621b995ab5071418e6bd2 | 7,203 | py | Python | musicplayer.py | anshuman-sahoo1999/music-player-python | e60d1512a96a7be95982c9069d494c80053b4a07 | [
"MIT"
] | 1 | 2021-06-20T06:50:44.000Z | 2021-06-20T06:50:44.000Z | musicplayer.py | anshuman-sahoo1999/music-player-python | e60d1512a96a7be95982c9069d494c80053b4a07 | [
"MIT"
] | null | null | null | musicplayer.py | anshuman-sahoo1999/music-player-python | e60d1512a96a7be95982c9069d494c80053b4a07 | [
"MIT"
] | null | null | null | import os
import threading
import time
import tkinter.messagebox
from tkinter import *
from tkinter import filedialog
from tkinter import ttk
from ttkthemes import themed_tk as tk
from mutagen.mp3 import MP3
from pygame import mixer
root = tk.ThemedTk()
root.get_themes() // Returns a list of ... | 39.146739 | 118 | 0.679439 | import os
import threading
import time
import tkinter.messagebox
from tkinter import *
from tkinter import filedialog
from tkinter import ttk
from ttkthemes import themed_tk as tk
from mutagen.mp3 import MP3
from pygame import mixer
root = tk.ThemedTk()
root.get_themes() // Returns a list of ... | false | true |
f7f326f047c452e5c1661167be96edd8ba4cdf2b | 3,500 | py | Python | nugu/movie_comment_scrapper/build_model/load_model.py | tmddusgood/NUGU_movie_recommendation-1 | 0c87638963d4681583f94def038dcd980270cb14 | [
"MIT"
] | null | null | null | nugu/movie_comment_scrapper/build_model/load_model.py | tmddusgood/NUGU_movie_recommendation-1 | 0c87638963d4681583f94def038dcd980270cb14 | [
"MIT"
] | null | null | null | nugu/movie_comment_scrapper/build_model/load_model.py | tmddusgood/NUGU_movie_recommendation-1 | 0c87638963d4681583f94def038dcd980270cb14 | [
"MIT"
] | 3 | 2020-03-23T02:53:49.000Z | 2021-01-02T20:15:09.000Z | from gensim.models.word2vec import Word2Vec
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
import matplotlib
font_name = matplotlib.font_manager.FontProperties(
fname="C:/Windows/Fonts/gulim.ttc" # 한글 폰트 위치를 넣어주세요
).get_name()
matplotlib.rc('font', family=font_name)
... | 29.166667 | 84 | 0.661429 | from gensim.models.word2vec import Word2Vec
import matplotlib.pyplot as plt
from sklearn.decomposition import PCA
import matplotlib
font_name = matplotlib.font_manager.FontProperties(
fname="C:/Windows/Fonts/gulim.ttc"
).get_name()
matplotlib.rc('font', family=font_name)
def plot_2d_grap... | true | true |
f7f327c8c74626bb4a9e8a97b90b7adcd937d1fe | 59 | py | Python | gunicorn_config.py | wangye/webinfo | b8692a3c3027d861c4cd5808a90ab5606bddb8a9 | [
"MIT"
] | null | null | null | gunicorn_config.py | wangye/webinfo | b8692a3c3027d861c4cd5808a90ab5606bddb8a9 | [
"MIT"
] | null | null | null | gunicorn_config.py | wangye/webinfo | b8692a3c3027d861c4cd5808a90ab5606bddb8a9 | [
"MIT"
] | null | null | null | bind = "0.0.0.0:5000"
workers = 2
threads = 2
timeout = 120 | 14.75 | 21 | 0.644068 | bind = "0.0.0.0:5000"
workers = 2
threads = 2
timeout = 120 | true | true |
f7f327f2f2c99f8ed22f1fdb0868967ef3fe5d98 | 7,983 | py | Python | homeassistant/components/cloud/http_api.py | mfrueh/home-assistant | 5d64628b5bf4713016883282fd54de9c7d5089d0 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/cloud/http_api.py | mfrueh/home-assistant | 5d64628b5bf4713016883282fd54de9c7d5089d0 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/cloud/http_api.py | mfrueh/home-assistant | 5d64628b5bf4713016883282fd54de9c7d5089d0 | [
"Apache-2.0"
] | 1 | 2021-03-13T18:15:31.000Z | 2021-03-13T18:15:31.000Z | """The HTTP api to control the cloud integration."""
import asyncio
from functools import wraps
import logging
import async_timeout
import voluptuous as vol
from homeassistant.components.http import HomeAssistantView
from homeassistant.components.http.data_validator import (
RequestDataValidator)
from . import a... | 30.822394 | 79 | 0.652512 | import asyncio
from functools import wraps
import logging
import async_timeout
import voluptuous as vol
from homeassistant.components.http import HomeAssistantView
from homeassistant.components.http.data_validator import (
RequestDataValidator)
from . import auth_api
from .const import DOMAIN, REQUEST_TIMEOUT
_... | true | true |
f7f3284fe9a75fe40bedccb51ce163dff40c9f73 | 547 | py | Python | core/base.py | ShreyasTheOne/Super-Duper-Fuzzer | b667e2dca3e49a370634ad4b0bd826aca06136b7 | [
"MIT"
] | null | null | null | core/base.py | ShreyasTheOne/Super-Duper-Fuzzer | b667e2dca3e49a370634ad4b0bd826aca06136b7 | [
"MIT"
] | null | null | null | core/base.py | ShreyasTheOne/Super-Duper-Fuzzer | b667e2dca3e49a370634ad4b0bd826aca06136b7 | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
from api_interface import api_configuration
class BaseFuzzer(ABC):
@abstractmethod
def __init__(self, iterations=None):
"""
Initialise SampleFuzzer instance with the API Configuration
Args:
iterations (int): Number of requests to send pe... | 30.388889 | 79 | 0.707495 | from abc import ABC, abstractmethod
from api_interface import api_configuration
class BaseFuzzer(ABC):
@abstractmethod
def __init__(self, iterations=None):
self._API_CONFIGURATION = api_configuration.API_CONFIGURATION.structure
self._endpoints = self._API_CONFIGURATION["endpoints"]
se... | true | true |
f7f329a74147b9d1ded8055dd419f358aace792a | 6,375 | py | Python | drivers/ili93xx/ili9341.py | denise-amiga/micropython-nano-gui | 059d9c3705a4cb46e3bc5c646e0b10409ae97ad6 | [
"MIT"
] | null | null | null | drivers/ili93xx/ili9341.py | denise-amiga/micropython-nano-gui | 059d9c3705a4cb46e3bc5c646e0b10409ae97ad6 | [
"MIT"
] | null | null | null | drivers/ili93xx/ili9341.py | denise-amiga/micropython-nano-gui | 059d9c3705a4cb46e3bc5c646e0b10409ae97ad6 | [
"MIT"
] | null | null | null | # ILI9341 nano-gui driver for ili9341 displays
# As with all nano-gui displays, touch is not supported.
# Copyright (c) Peter Hinch 2020
# Released under the MIT license see LICENSE
# This work is based on the following sources.
# https://github.com/rdagger/micropython-ili9341
# Also this forum thread with ideas from... | 38.403614 | 102 | 0.563451 |
from time import sleep_ms
import gc
import framebuf
import uasyncio as asyncio
@micropython.viper
def _lcopy(dest:ptr8, source:ptr8, lut:ptr8, length:int):
n = 0
for x in range(length):
c = source[x]
d = (c & 0xf0) >> 3
e = (c & 0x0f) << 1
dest[n] = lut[d]
... | true | true |
f7f329c24f782ce7c0393fa79d9b58d791c8599e | 1,669 | py | Python | utils/lr_scheduler.py | WenmuZhou/DABNet_Paddle | b551085009faf07b351df98ecb625e1f82ddd50e | [
"MIT"
] | null | null | null | utils/lr_scheduler.py | WenmuZhou/DABNet_Paddle | b551085009faf07b351df98ecb625e1f82ddd50e | [
"MIT"
] | null | null | null | utils/lr_scheduler.py | WenmuZhou/DABNet_Paddle | b551085009faf07b351df98ecb625e1f82ddd50e | [
"MIT"
] | null | null | null | from paddle.optimizer import lr
class WarmupPolyLR(object):
"""
Cosine learning rate decay
lr = 0.05 * (math.cos(epoch * (math.pi / epochs)) + 1)
Args:
lr(float): initial learning rate
step_each_epoch(int): steps each epoch
epochs(int): total training epochs
last_epoch ... | 33.38 | 135 | 0.567406 | from paddle.optimizer import lr
class WarmupPolyLR(object):
def __init__(self,
learning_rate,
step_each_epoch,
epochs,
warmup_epoch=0,
power=0.9,
end_lr=0,
cycle=False,
last_epo... | true | true |
f7f329e26e9d0ab40a1eae5b7593d8fe4c099fca | 964 | py | Python | src/cupyopt/task_factory.py | staylorx/cupyopt | ea264dedc6797cd1c52ba3c61fb17f307ab278da | [
"Apache-2.0"
] | 4 | 2020-07-27T16:53:56.000Z | 2021-03-12T20:46:34.000Z | src/cupyopt/task_factory.py | staylorx/cupyopt | ea264dedc6797cd1c52ba3c61fb17f307ab278da | [
"Apache-2.0"
] | 10 | 2020-07-28T16:29:07.000Z | 2020-12-07T22:59:25.000Z | src/cupyopt/task_factory.py | staylorx/cupyopt | ea264dedc6797cd1c52ba3c61fb17f307ab278da | [
"Apache-2.0"
] | 2 | 2020-10-19T20:48:25.000Z | 2021-01-15T16:04:04.000Z | """ Factory for creating tasks from nuggets """
from collections.abc import Callable
import prefect
import src.cupyopt.nuggets as nuggets
# prepare a placeholder class for prefect tasks created from nuggets
ptask = lambda: None # pylint: disable=C0103
# gather list of nuggets
NUGGET_LIST = [
f
for f in dir(... | 26.777778 | 75 | 0.680498 | from collections.abc import Callable
import prefect
import src.cupyopt.nuggets as nuggets
ptask = lambda: None
NUGGET_LIST = [
f
for f in dir(nuggets)
if not f.startswith("__") and isinstance(getattr(nuggets, f), Callable)
]
for nugget in NUGGET_LIST:
parent = getattr(nuggets, nugget... | true | true |
f7f329f73b98d32e97ef0b9b604511813e77134b | 5,588 | py | Python | tests/integration/managers/test_proxysql_manager.py | ovaistariq/proxysql-tools | f775fe5de908756da8522092450aec7171fbdbb3 | [
"Apache-2.0"
] | null | null | null | tests/integration/managers/test_proxysql_manager.py | ovaistariq/proxysql-tools | f775fe5de908756da8522092450aec7171fbdbb3 | [
"Apache-2.0"
] | null | null | null | tests/integration/managers/test_proxysql_manager.py | ovaistariq/proxysql-tools | f775fe5de908756da8522092450aec7171fbdbb3 | [
"Apache-2.0"
] | 1 | 2021-11-20T08:37:48.000Z | 2021-11-20T08:37:48.000Z | import pytest
from proxysql_tools.entities.proxysql import (
BACKEND_STATUS_OFFLINE_SOFT,
ProxySQLMySQLBackend,
ProxySQLMySQLUser
)
from proxysql_tools.managers.proxysql_manager import (
ProxySQLManager,
ProxySQLAdminConnectionError
)
def test__can_connect_to_proxysql_admin_interface(proxysql_man... | 33.866667 | 78 | 0.734073 | import pytest
from proxysql_tools.entities.proxysql import (
BACKEND_STATUS_OFFLINE_SOFT,
ProxySQLMySQLBackend,
ProxySQLMySQLUser
)
from proxysql_tools.managers.proxysql_manager import (
ProxySQLManager,
ProxySQLAdminConnectionError
)
def test__can_connect_to_proxysql_admin_interface(proxysql_man... | true | true |
f7f32a4762de720809d6f48f8064524773f39aef | 18,146 | py | Python | sdk/python/pulumi_azure_native/sql/v20170301preview/job_step.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/sql/v20170301preview/job_step.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/sql/v20170301preview/job_step.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
fro... | 45.478697 | 740 | 0.647305 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
from . import outputs
from ._enums import *
from ._inputs import *
__all__ = ['JobStepArgs', 'JobStep']
@pulumi.input_type
class JobStepArgs:
def __init__(__self_... | true | true |
f7f32b18f4c62d59b04589b5916b3e1f3127146b | 3,055 | py | Python | sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/_common/_schema.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | null | null | null | sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/_common/_schema.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | null | null | null | sdk/schemaregistry/azure-schemaregistry/azure/schemaregistry/_common/_schema.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------
#
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# The MIT License (MIT)
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the ""Software""), ... | 33.944444 | 81 | 0.644845 |
from typing import Any, Optional
class SchemaProperties(object):
def __init__(
self,
id=None,
**kwargs
):
self.id = id
self.format = kwargs.get('format')
self.version = kwargs.get('version')
class Schema(object):
def... | true | true |
f7f32b6ed6ea0e24fb76215d05e7fd3fcb7af7fb | 4,360 | py | Python | src/baskerville/models/pipeline_tasks/tasks_base.py | deflect-ca/baskerville | 9659f4b39ab66fcf5329a4eccff15e97245b04f0 | [
"CC-BY-4.0"
] | 2 | 2021-12-03T11:26:38.000Z | 2022-01-12T22:24:29.000Z | src/baskerville/models/pipeline_tasks/tasks_base.py | deflect-ca/baskerville | 9659f4b39ab66fcf5329a4eccff15e97245b04f0 | [
"CC-BY-4.0"
] | 3 | 2022-01-19T15:17:37.000Z | 2022-03-22T04:55:22.000Z | src/baskerville/models/pipeline_tasks/tasks_base.py | deflect-ca/baskerville | 9659f4b39ab66fcf5329a4eccff15e97245b04f0 | [
"CC-BY-4.0"
] | null | null | null | # Copyright (c) 2020, eQualit.ie inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import abc
import datetime
from collections import OrderedDict
from typing import List
import pyspark
from baskerville.mode... | 28.684211 | 78 | 0.656881 |
import abc
import datetime
from collections import OrderedDict
from typing import List
import pyspark
from baskerville.models.config import BaskervilleConfig
from baskerville.models.pipeline_tasks.service_provider import ServiceProvider
from baskerville.util.helpers import get_logger, TimeBucket
class Task(o... | true | true |
f7f32c09846ccac31b26eab34bfc32925894804e | 470 | py | Python | Tele_Aula 2/Dicionario.py | andrenjunior/Linguagem-de-Programa-o-Python | ebffc440bfde7a4c8752872d9cc00e0f83a91e3b | [
"MIT"
] | null | null | null | Tele_Aula 2/Dicionario.py | andrenjunior/Linguagem-de-Programa-o-Python | ebffc440bfde7a4c8752872d9cc00e0f83a91e3b | [
"MIT"
] | null | null | null | Tele_Aula 2/Dicionario.py | andrenjunior/Linguagem-de-Programa-o-Python | ebffc440bfde7a4c8752872d9cc00e0f83a91e3b | [
"MIT"
] | null | null | null | aluno = dict()
aluno['nome'] = str(input('Digite nome: ')) #Digite nome: André
aluno['media'] = float(input('Média: ')) #Média: 9.5
if aluno['media'] >= 7:
aluno['situacao'] = 'Aprovado' #media é > 7, 9.5
else:
aluno['situacao'] = 'Reprovado'
for x, y in aluno.items():
print(f'- {x} é igual a {y}') #me... | 24.736842 | 65 | 0.595745 | aluno = dict()
aluno['nome'] = str(input('Digite nome: '))
aluno['media'] = float(input('Média: '))
if aluno['media'] >= 7:
aluno['situacao'] = 'Aprovado'
else:
aluno['situacao'] = 'Reprovado'
for x, y in aluno.items():
print(f'- {x} é igual a {y}')
print(aluno.keys())
print(aluno.values())
| true | true |
f7f32c4acbf973c5a4b542e28ef00f8aa7e715fc | 3,146 | py | Python | tests/user/forms/registration.py | CosmosTUe/Cosmos | cec2541d3f8ea1944edfaab2090916ba66f9d2f3 | [
"MIT"
] | 1 | 2021-02-01T19:27:07.000Z | 2021-02-01T19:27:07.000Z | tests/user/forms/registration.py | CosmosTUe/Cosmos | cec2541d3f8ea1944edfaab2090916ba66f9d2f3 | [
"MIT"
] | 79 | 2020-08-05T09:01:00.000Z | 2022-03-24T11:27:21.000Z | tests/user/forms/registration.py | CosmosTUe/Cosmos | cec2541d3f8ea1944edfaab2090916ba66f9d2f3 | [
"MIT"
] | 3 | 2021-02-22T18:36:52.000Z | 2021-10-13T17:05:44.000Z | from django.contrib.auth.models import User
from django.test import TestCase
from apps.users.forms import RegisterUserForm
from apps.users.forms.error_codes import DUPLICATE_EMAIL, INVALID_EMAIL
class RegisterUserFormTest(TestCase):
@staticmethod
def generate_form(
first_name="Tosti",
last_na... | 27.840708 | 79 | 0.584552 | from django.contrib.auth.models import User
from django.test import TestCase
from apps.users.forms import RegisterUserForm
from apps.users.forms.error_codes import DUPLICATE_EMAIL, INVALID_EMAIL
class RegisterUserFormTest(TestCase):
@staticmethod
def generate_form(
first_name="Tosti",
last_na... | true | true |
f7f32cc9cfbd27d2d9a69cf8d448cbbaf43a0b2d | 3,633 | py | Python | kumbhserial/helpers.py | indodutch/kumbhserial | f6fb60426f0d7fe1c8a9584205a89fb510436418 | [
"Apache-2.0"
] | null | null | null | kumbhserial/helpers.py | indodutch/kumbhserial | f6fb60426f0d7fe1c8a9584205a89fb510436418 | [
"Apache-2.0"
] | null | null | null | kumbhserial/helpers.py | indodutch/kumbhserial | f6fb60426f0d7fe1c8a9584205a89fb510436418 | [
"Apache-2.0"
] | null | null | null | # Indo-Dutch Kumbh Mela experiment serial device reader
#
# Copyright 2015 Zoltan Beck, Netherlands eScience Center, and
# University of Amsterdam
#
# 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... | 33.027273 | 76 | 0.680429 |
import sys
from datetime import datetime, timezone
import os
import time
def output_filename(directory, prefix, extension):
if not os.path.exists(directory):
os.makedirs(directory)
return os.path.join(directory, '{0}-{1}.{2}'.format(
prefix, time.strftime("%Y%m%d-%H%M%S"), ex... | true | true |
f7f32ce7fdd8392723a5397a4dc49c11d4374076 | 1,277 | py | Python | nimbusinator/supported_control_keys.py | adamstimb/nimbusinator | a7bb7e282b8322c1a97bffc3c40ab0541f746615 | [
"MIT"
] | null | null | null | nimbusinator/supported_control_keys.py | adamstimb/nimbusinator | a7bb7e282b8322c1a97bffc3c40ab0541f746615 | [
"MIT"
] | 16 | 2019-11-23T19:08:45.000Z | 2020-03-13T17:13:23.000Z | nimbusinator/supported_control_keys.py | adamstimb/nimbusinator | a7bb7e282b8322c1a97bffc3c40ab0541f746615 | [
"MIT"
] | null | null | null | from pynput import keyboard
supported_control_keys = {
keyboard.Key.f1: '__F1__',
keyboard.Key.f2: '__F2__',
keyboard.Key.f3: '__F3__',
keyboard.Key.f4: '__F4__',
keyboard.Key.f5: '__F5__',
keyboard.Key.f6: '__F6__',
... | 41.193548 | 56 | 0.502741 | from pynput import keyboard
supported_control_keys = {
keyboard.Key.f1: '__F1__',
keyboard.Key.f2: '__F2__',
keyboard.Key.f3: '__F3__',
keyboard.Key.f4: '__F4__',
keyboard.Key.f5: '__F5__',
keyboard.Key.f6: '__F6__',
... | true | true |
f7f32d5b358f9e07a1f39184dd1a60409178a5fa | 1,217 | py | Python | 2018/day_10/main.py | Repiphany/AoC | d59badb62b82434bccd757e37d6d5c4d0bbf2838 | [
"MIT"
] | null | null | null | 2018/day_10/main.py | Repiphany/AoC | d59badb62b82434bccd757e37d6d5c4d0bbf2838 | [
"MIT"
] | null | null | null | 2018/day_10/main.py | Repiphany/AoC | d59badb62b82434bccd757e37d6d5c4d0bbf2838 | [
"MIT"
] | 1 | 2019-12-06T19:16:12.000Z | 2019-12-06T19:16:12.000Z | #!/usr/bin/env python3
import re
import numpy as np
import scipy.optimize
import sys
def moment(positions):
center_of_mass = np.average(positions, axis = 0)
return np.sum((positions - center_of_mass)**2)
def part_1(positions, velocities):
f = lambda i : moment(positions + i*velocities)
res = scipy.op... | 31.205128 | 71 | 0.593262 |
import re
import numpy as np
import scipy.optimize
import sys
def moment(positions):
center_of_mass = np.average(positions, axis = 0)
return np.sum((positions - center_of_mass)**2)
def part_1(positions, velocities):
f = lambda i : moment(positions + i*velocities)
res = scipy.optimize.minimize(f, x0 ... | true | true |
f7f32eb2da8e0b23547393c4f7d633704cf66995 | 879 | py | Python | thinc/layers/reduce_first.py | bratao/thinc | 32cbe56d65b938e253043f7d9671b07d6c59e742 | [
"MIT"
] | null | null | null | thinc/layers/reduce_first.py | bratao/thinc | 32cbe56d65b938e253043f7d9671b07d6c59e742 | [
"MIT"
] | null | null | null | thinc/layers/reduce_first.py | bratao/thinc | 32cbe56d65b938e253043f7d9671b07d6c59e742 | [
"MIT"
] | null | null | null | from typing import Callable, Tuple, cast, TypeVar
from ..model import Model
from ..config import registry
from ..types import Ragged, ArrayXd
OutT = TypeVar("OutT", bound=ArrayXd)
@registry.layers("reduce_first.v1")
def reduce_first() -> Model[Ragged, OutT]:
"""Reduce sequences to their first element."""
ret... | 30.310345 | 93 | 0.667804 | from typing import Callable, Tuple, cast, TypeVar
from ..model import Model
from ..config import registry
from ..types import Ragged, ArrayXd
OutT = TypeVar("OutT", bound=ArrayXd)
@registry.layers("reduce_first.v1")
def reduce_first() -> Model[Ragged, OutT]:
return Model("reduce_first", forward)
def forward(mo... | true | true |
f7f3306876f8e1b976dcaf48be8eb85dd83f659e | 15,538 | py | Python | gamestonk_terminal/common/residuals_analysis/residuals_api.py | lunarnautics/GamestonkTerminal | a1564289c1f4071861240407a069ee57ecad8b84 | [
"MIT"
] | null | null | null | gamestonk_terminal/common/residuals_analysis/residuals_api.py | lunarnautics/GamestonkTerminal | a1564289c1f4071861240407a069ee57ecad8b84 | [
"MIT"
] | null | null | null | gamestonk_terminal/common/residuals_analysis/residuals_api.py | lunarnautics/GamestonkTerminal | a1564289c1f4071861240407a069ee57ecad8b84 | [
"MIT"
] | null | null | null | """ Residuals API """
__docformat__ = "numpy"
import argparse
from typing import List
from collections import OrderedDict
from matplotlib import pyplot as plt
import pandas as pd
from pandas.plotting import register_matplotlib_converters
import seaborn as sns
from scipy import stats
import statsmodels.api as sm
# pyl... | 27.069686 | 109 | 0.583215 | __docformat__ = "numpy"
import argparse
from typing import List
from collections import OrderedDict
from matplotlib import pyplot as plt
import pandas as pd
from pandas.plotting import register_matplotlib_converters
import seaborn as sns
from scipy import stats
import statsmodels.api as sm
import matplotlib.gridspec... | true | true |
f7f33089339debeb32cfb521f5885cf12287b0d0 | 1,266 | py | Python | workspaces/voyage/server/src/util/testlogs.py | raychorn/svn_hp-projects | d5547906354e2759a93b8030632128e8c4bf3880 | [
"CC0-1.0"
] | null | null | null | workspaces/voyage/server/src/util/testlogs.py | raychorn/svn_hp-projects | d5547906354e2759a93b8030632128e8c4bf3880 | [
"CC0-1.0"
] | null | null | null | workspaces/voyage/server/src/util/testlogs.py | raychorn/svn_hp-projects | d5547906354e2759a93b8030632128e8c4bf3880 | [
"CC0-1.0"
] | null | null | null | '''
$Author: partho.bhowmick@hp.com $
$Date: 2013-05-13 08:42:32 -0500 (Mon, 13 May 2013) $
$Header: https://svn02.atlanta.hp.com/local/ic4vc-dev/server/trunk/src/util/testlogs.py 5376 2013-05-13 13:42:32Z partho.bhowmick@hp.com $
$Revision: 5376 $
'''
import logging
class testlogger:
def __init__(self,... | 33.315789 | 139 | 0.597946 |
import logging
class testlogger:
def __init__(self, name = None, filename= None, level = logging.DEBUG):
if not name:
name = __file__
if not filename:
filename = name + '.log'
self.logger = logging.getLogger(name)
self.name = name
self.log... | true | true |
f7f331af875c49a1934c8e3a51aa5ecfcda4c38d | 102,169 | py | Python | bin/Python27/Lib/site-packages/scipy/stats/_multivariate.py | lefevre-fraser/openmeta-mms | 08f3115e76498df1f8d70641d71f5c52cab4ce5f | [
"MIT"
] | null | null | null | bin/Python27/Lib/site-packages/scipy/stats/_multivariate.py | lefevre-fraser/openmeta-mms | 08f3115e76498df1f8d70641d71f5c52cab4ce5f | [
"MIT"
] | null | null | null | bin/Python27/Lib/site-packages/scipy/stats/_multivariate.py | lefevre-fraser/openmeta-mms | 08f3115e76498df1f8d70641d71f5c52cab4ce5f | [
"MIT"
] | 1 | 2020-08-08T12:44:48.000Z | 2020-08-08T12:44:48.000Z | #
# Author: Joris Vankerschaver 2013
#
from __future__ import division, print_function, absolute_import
import math
import numpy as np
import scipy.linalg
from scipy.misc import doccer
from scipy.special import gammaln, psi, multigammaln
from scipy._lib._util import check_random_state
from scipy.linalg.blas... | 32.968377 | 101 | 0.568206 |
from __future__ import division, print_function, absolute_import
import math
import numpy as np
import scipy.linalg
from scipy.misc import doccer
from scipy.special import gammaln, psi, multigammaln
from scipy._lib._util import check_random_state
from scipy.linalg.blas import drot
__all__ = ['multivari... | true | true |
f7f332866a7d1f3ac2f66b07051703c15f36774d | 1,136 | py | Python | python/vbHmmGaussDataHandler.py | okamoto-kenji/varBayes-HMM | 77afe3c336c9e1ebeb115ca4f0b2bc25060556bd | [
"MIT"
] | 7 | 2016-03-31T06:59:00.000Z | 2019-11-01T06:35:57.000Z | python/vbHmmGaussDataHandler.py | okamoto-kenji/varBayes-HMM | 77afe3c336c9e1ebeb115ca4f0b2bc25060556bd | [
"MIT"
] | null | null | null | python/vbHmmGaussDataHandler.py | okamoto-kenji/varBayes-HMM | 77afe3c336c9e1ebeb115ca4f0b2bc25060556bd | [
"MIT"
] | null | null | null | #! /usr/local/bin/python3.5
# -*- coding: utf-8 -*-
"""
vbHmmGaussDataHandler.py
File loader for VB-HMM-GAUSS data.
Created by OKAMOTO Kenji, SAKO Yasushi and RIKEN
Copyright 2011-2015
Cellular Informatics Laboratory, Advance Science Institute, RIKEN, Japan.
All rights reserved.
@author: kenji
"""
import numpy as np... | 22.27451 | 74 | 0.600352 |
import numpy as np
import vbHmmGauss
def readGaussText(filename, logFP):
with open(filename, "r") as fp:
logFP.write(" Reading data from '{0}' ... ".format(filename))
array = []
for line in fp:
array.append(float(line))
logFP.write("done.\n")
if a... | true | true |
f7f33297e5187eccac2cf8b49c80719a7a1673df | 910 | py | Python | bucky/util/read_config.py | hanijames/bucky | e0d5857e2f53533a16b2c3058adf0379aeb73685 | [
"MIT"
] | null | null | null | bucky/util/read_config.py | hanijames/bucky | e0d5857e2f53533a16b2c3058adf0379aeb73685 | [
"MIT"
] | null | null | null | bucky/util/read_config.py | hanijames/bucky | e0d5857e2f53533a16b2c3058adf0379aeb73685 | [
"MIT"
] | null | null | null | """Parser for the yaml path config file."""
import logging
import pathlib
import sys
import yaml
if "sphinx" in sys.modules:
# replace with human readable descriptions if generating docs
bucky_cfg = {}
for k in ("base_dir", "data_dir", "raw_output_dir", "output_dir", "cache_dir"):
bucky_cfg[k] = "... | 32.5 | 83 | 0.624176 | import logging
import pathlib
import sys
import yaml
if "sphinx" in sys.modules:
bucky_cfg = {}
for k in ("base_dir", "data_dir", "raw_output_dir", "output_dir", "cache_dir"):
bucky_cfg[k] = "config.yml: <" + k + ">"
else:
with (pathlib.Path.cwd() / "config.yml").open(mode="r") as f:
... | true | true |
f7f3331ec565a3b2fefcf1e1344d95d4cb3f1aca | 2,808 | py | Python | release/stubs.min/System/Security/AccessControl_parts/NativeObjectSecurity.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | release/stubs.min/System/Security/AccessControl_parts/NativeObjectSecurity.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | release/stubs.min/System/Security/AccessControl_parts/NativeObjectSecurity.py | tranconbv/ironpython-stubs | a601759e6c6819beff8e6b639d18a24b7e351851 | [
"MIT"
] | null | null | null | class NativeObjectSecurity(CommonObjectSecurity):
""" Provides the ability to control access to native objects without direct manipulation of Access Control Lists (ACLs). Native object types are defined by the System.Security.AccessControl.ResourceType enumeration. """
def ZZZ(self):
"""hardcoded/mock instance o... | 54 | 221 | 0.781695 | class NativeObjectSecurity(CommonObjectSecurity):
def ZZZ(self):
return NativeObjectSecurity()
instance=ZZZ()
@staticmethod
def __new__(self,*args):
AuditRulesModified=property(lambda self: object(),lambda self,v: None,lambda self: None)
"""Gets or sets a Boolean value that specifies whether the group ... | true | true |
f7f3333f590206307ec94f30e77ad7ee4bb19e60 | 2,637 | py | Python | test/functional/yupost_simple_delegation_contract.py | YuPostX/YuPost | 6819089ef2a1823cf2a949c5f15379e6adaa8a29 | [
"MIT"
] | null | null | null | test/functional/yupost_simple_delegation_contract.py | YuPostX/YuPost | 6819089ef2a1823cf2a949c5f15379e6adaa8a29 | [
"MIT"
] | null | null | null | test/functional/yupost_simple_delegation_contract.py | YuPostX/YuPost | 6819089ef2a1823cf2a949c5f15379e6adaa8a29 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from test_framework.test_framework import BitcoinTestFramework
from test_framework.messages import *
from test_framework.script import *
from test_framework.mininode import *
from test_framework.yupost import *
from test_framework.yupostconfig import *
from test_framework.util import *
class Yu... | 43.229508 | 168 | 0.719378 |
from test_framework.test_framework import BitcoinTestFramework
from test_framework.messages import *
from test_framework.script import *
from test_framework.mininode import *
from test_framework.yupost import *
from test_framework.yupostconfig import *
from test_framework.util import *
class YuPostSimpleDelegationCo... | true | true |
f7f3334cbef38c19f84776c5818ede36cdbdc619 | 10,426 | py | Python | configs/KITTI/quasi_dla34_dcn_3dmatch_multibranch_conv_dep_dim_cen_clsrot_sep_aug_confidence_subtrain_mod_anchor_ratio_small_strides_GTA.py | mengmengliu1998/qd-3dt | 9fcd1c0b165793e259deb46a64fcbbdc33735f2f | [
"BSD-3-Clause"
] | 384 | 2021-03-19T11:12:31.000Z | 2022-03-31T01:59:16.000Z | configs/KITTI/quasi_dla34_dcn_3dmatch_multibranch_conv_dep_dim_cen_clsrot_sep_aug_confidence_subtrain_mod_anchor_ratio_small_strides_GTA.py | mengmengliu1998/qd-3dt | 9fcd1c0b165793e259deb46a64fcbbdc33735f2f | [
"BSD-3-Clause"
] | 22 | 2021-04-06T14:28:12.000Z | 2022-03-22T18:02:00.000Z | configs/KITTI/quasi_dla34_dcn_3dmatch_multibranch_conv_dep_dim_cen_clsrot_sep_aug_confidence_subtrain_mod_anchor_ratio_small_strides_GTA.py | mengmengliu1998/qd-3dt | 9fcd1c0b165793e259deb46a64fcbbdc33735f2f | [
"BSD-3-Clause"
] | 73 | 2021-03-20T06:23:26.000Z | 2022-03-16T08:00:21.000Z | # model settings
model = dict(
type='QuasiDense3DSepUncertainty',
pretrained='http://dl.yf.io/dla/models/imagenet/dla34-ba72cf86.pth',
backbone=dict(
type='DLA',
levels=[1, 1, 1, 2, 2, 1],
channels=[16, 32, 64, 128, 256, 512],
block_num=2,
return_levels=True),
nec... | 31.122388 | 130 | 0.577115 |
model = dict(
type='QuasiDense3DSepUncertainty',
pretrained='http://dl.yf.io/dla/models/imagenet/dla34-ba72cf86.pth',
backbone=dict(
type='DLA',
levels=[1, 1, 1, 2, 2, 1],
channels=[16, 32, 64, 128, 256, 512],
block_num=2,
return_levels=True),
neck=dict(
... | true | true |
f7f33477d17ff9ff5588daaff1588d1bc2c7edc4 | 1,695 | py | Python | client/src/event.py | tommccallum/smartbot | 7241aa80a8dfa1f67e411c9000d65addd81ebd3f | [
"MIT"
] | 1 | 2021-01-27T11:18:54.000Z | 2021-01-27T11:18:54.000Z | client/src/event.py | tommccallum/smartbot | 7241aa80a8dfa1f67e411c9000d65addd81ebd3f | [
"MIT"
] | null | null | null | client/src/event.py | tommccallum/smartbot | 7241aa80a8dfa1f67e411c9000d65addd81ebd3f | [
"MIT"
] | null | null | null | from enum import Enum
EVENT_KEY_UP=0
EVENT_BUTTON_PLAY=0
EVENT_KEY_DOWN=1
## no down button equivalent on speaker
EVENT_KEY_LEFT=2
EVENT_BUTTON_PREV=2
EVENT_KEY_RIGHT=3
EVENT_BUTTON_NEXT=3
EVENT_KEY_Q = 4
class EventEnum(Enum):
"""different events"""
NO_EVENT = 0
ALARM_INTERRUPT = 1
CONTINUE = 2
E... | 24.565217 | 90 | 0.642478 | from enum import Enum
EVENT_KEY_UP=0
EVENT_BUTTON_PLAY=0
EVENT_KEY_DOWN=1
EVENT_KEY_RIGHT=3
EVENT_BUTTON_NEXT=3
EVENT_KEY_Q = 4
class EventEnum(Enum):
NO_EVENT = 0
ALARM_INTERRUPT = 1
CONTINUE = 2
ENTER_OWNER = 4
EXIT_OWNER = 5
DEVICE_FOUND = 6
DEVICE_LOST=7,
BLUETOOTH_EVENT=8
KEY_... | true | true |
f7f3356bf4cec6818795c87d67f16343aeb9f70a | 11,840 | py | Python | src/morphology_workflows/tasks/curation.py | alex4200/morphology-workflows | aaf79369202939d0e2a86f37818d760893040a34 | [
"Apache-2.0"
] | null | null | null | src/morphology_workflows/tasks/curation.py | alex4200/morphology-workflows | aaf79369202939d0e2a86f37818d760893040a34 | [
"Apache-2.0"
] | null | null | null | src/morphology_workflows/tasks/curation.py | alex4200/morphology-workflows | aaf79369202939d0e2a86f37818d760893040a34 | [
"Apache-2.0"
] | null | null | null | """Curation tasks."""
import logging
import luigi
from data_validation_framework.task import ElementValidationTask
from data_validation_framework.task import SetValidationTask
from data_validation_framework.task import SkippableMixin
from luigi_tools.parameter import BoolParameter
from luigi_tools.parameter import Opt... | 31.240106 | 100 | 0.676858 | import logging
import luigi
from data_validation_framework.task import ElementValidationTask
from data_validation_framework.task import SetValidationTask
from data_validation_framework.task import SkippableMixin
from luigi_tools.parameter import BoolParameter
from luigi_tools.parameter import OptionalChoiceParameter
... | true | true |
f7f33647f63ef302e76c669cd8ef047d9f0e3ee5 | 2,111 | py | Python | core/sawtooth/cli/admin.py | trust-tech/sawtooth-core | fcd66ff2f13dba51d7642049e0c0306dbee3b07d | [
"Apache-2.0"
] | 1 | 2017-08-04T10:31:00.000Z | 2017-08-04T10:31:00.000Z | core/sawtooth/cli/admin.py | trust-tech/sawtooth-core | fcd66ff2f13dba51d7642049e0c0306dbee3b07d | [
"Apache-2.0"
] | 1 | 2021-12-09T23:11:26.000Z | 2021-12-09T23:11:26.000Z | core/sawtooth/cli/admin.py | trust-tech/sawtooth-core | fcd66ff2f13dba51d7642049e0c0306dbee3b07d | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 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 in wri... | 40.596154 | 80 | 0.755092 |
import logging
from sawtooth.cli.exceptions import CliException
from sawtooth.cli.admin_sub.dev_mode_genesis import add_dev_mode_genesis_parser
from sawtooth.cli.admin_sub.dev_mode_genesis import do_dev_mode_genesis
from sawtooth.cli.admin_sub.poet1_genesis import add_poet1_genesis_parser
from sawtooth.c... | true | true |
f7f337c3643dc12a8400ed9a4d231384058b474b | 487 | py | Python | src/tree/1038.binary-search-tree-to-greater-sum-tree/binary-search-tree-to-greater-sum-tree.py | lyphui/Just-Code | e0c3c3ecb67cb805080ff686e88522b2bffe7741 | [
"MIT"
] | 782 | 2019-11-19T08:20:49.000Z | 2022-03-25T06:59:09.000Z | src/1038.binary-search-tree-to-greater-sum-tree/binary-search-tree-to-greater-sum-tree.py | Heitao5200/Just-Code | 5bb3ee485a103418e693b7ec8e26dc84f3691c79 | [
"MIT"
] | 1 | 2021-03-04T12:21:01.000Z | 2021-03-05T01:23:54.000Z | src/1038.binary-search-tree-to-greater-sum-tree/binary-search-tree-to-greater-sum-tree.py | Heitao5200/Just-Code | 5bb3ee485a103418e693b7ec8e26dc84f3691c79 | [
"MIT"
] | 155 | 2019-11-20T08:20:42.000Z | 2022-03-19T07:28:09.000Z | # Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def bstToGst(self, root: TreeNode) -> TreeNode:
self.sum = 0
def dfs(node):
if node:
... | 24.35 | 51 | 0.472279 |
class Solution:
def bstToGst(self, root: TreeNode) -> TreeNode:
self.sum = 0
def dfs(node):
if node:
dfs(node.right)
node.val += self.sum
self.sum = node.val
dfs(node.left)
dfs(root)
... | true | true |
f7f337c97285b40948c154da47ddf112d7a3b457 | 3,684 | py | Python | format_from_EXCEL.py | py1sl/neutronicstool | da5e459e47bb67afbef9a9387e054023b6c0f048 | [
"MIT"
] | null | null | null | format_from_EXCEL.py | py1sl/neutronicstool | da5e459e47bb67afbef9a9387e054023b6c0f048 | [
"MIT"
] | null | null | null | format_from_EXCEL.py | py1sl/neutronicstool | da5e459e47bb67afbef9a9387e054023b6c0f048 | [
"MIT"
] | null | null | null | """
This tool reads in excel data, formats appropriately and plots graph of beam
current cycles over time.
needs xlrd package
"""
import re
import pandas as pd
import logging
import utilities
def getdate():
"""function to select appropriate start and end date for range of
cycles we are inter... | 32.034783 | 118 | 0.610206 |
import re
import pandas as pd
import logging
import utilities
def getdate():
p = re.compile('[^0-9\s]+')
while True:
date = input("Please input date in the format YYYY M D \n")
m = p.search(date)
if m:
logging.debug('Looks like you have a typo.')
... | true | true |
f7f3391fa23d42f9cb8955586bbc78c8e0d20068 | 23,789 | py | Python | pinecone/core/client/api/vector_operations_api.py | amourao/pinecone-python-client | 89582d3b32726187fea161b5f9765a582ddea76b | [
"ISC"
] | null | null | null | pinecone/core/client/api/vector_operations_api.py | amourao/pinecone-python-client | 89582d3b32726187fea161b5f9765a582ddea76b | [
"ISC"
] | null | null | null | pinecone/core/client/api/vector_operations_api.py | amourao/pinecone-python-client | 89582d3b32726187fea161b5f9765a582ddea76b | [
"ISC"
] | null | null | null | #
# Copyright (c) 2020-2021 Pinecone Systems Inc. All right reserved.
#
"""
Pinecone API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: version not set
Contact: support@pinecone.io
Gener... | 36.71142 | 201 | 0.472655 |
import re
import sys
from pinecone.core.client.api_client import ApiClient, Endpoint as _Endpoint
from pinecone.core.client.model_utils import (
check_allowed_values,
check_validations,
date,
datetime,
file_type,
none_type,
validate_and_convert_types
)
from pinecone.core.client.... | true | true |
f7f339557c5e816cbbdd28799be5cd7da220debf | 1,543 | py | Python | plotly/validators/cone/_lighting.py | fcollonval/plotly.py | 5c7f100db1af8c82bb740a38ef684955a8ed6d0e | [
"MIT"
] | 2 | 2020-03-24T11:41:14.000Z | 2021-01-14T07:59:43.000Z | plotly/validators/cone/_lighting.py | fcollonval/plotly.py | 5c7f100db1af8c82bb740a38ef684955a8ed6d0e | [
"MIT"
] | null | null | null | plotly/validators/cone/_lighting.py | fcollonval/plotly.py | 5c7f100db1af8c82bb740a38ef684955a8ed6d0e | [
"MIT"
] | 4 | 2019-06-03T14:49:12.000Z | 2022-01-06T01:05:12.000Z | import _plotly_utils.basevalidators
class LightingValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name='lighting', parent_name='cone', **kwargs):
super(LightingValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | 39.564103 | 77 | 0.592353 | import _plotly_utils.basevalidators
class LightingValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name='lighting', parent_name='cone', **kwargs):
super(LightingValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
... | true | true |
f7f339621a7392de84c9b0f87fa0b5dcc4c3ab7b | 3,232 | py | Python | games/chess/game.py | samclane/chess-ai | ff5ec1408b89692a3dcfab234aceb844d05df4a5 | [
"MIT"
] | null | null | null | games/chess/game.py | samclane/chess-ai | ff5ec1408b89692a3dcfab234aceb844d05df4a5 | [
"MIT"
] | null | null | null | games/chess/game.py | samclane/chess-ai | ff5ec1408b89692a3dcfab234aceb844d05df4a5 | [
"MIT"
] | null | null | null | # Game: The traditional 8x8 chess board with pieces.
# DO NOT MODIFY THIS FILE
# Never try to directly create an instance of this class, or modify its member variables.
# Instead, you should only be reading its variables and calling its functions.
from joueur.base_game import BaseGame
# import game objects
from game... | 25.650794 | 157 | 0.613552 |
from joueur.base_game import BaseGame
from games.chess.game_object import GameObject
from games.chess.move import Move
from games.chess.piece import Piece
from games.chess.player import Player
class Game(BaseGame):
def __init__(self):
BaseGame.__init__(self)
self._current_player... | true | true |
f7f3398015a889b35293db31c1e1c58b0350c0e9 | 10,522 | py | Python | www/src/Lib/test/test_zipimport_support.py | stefanhoelzl/brython | 433d272e7bb0e3c0994392f8f265bc39e87854f7 | [
"BSD-3-Clause"
] | 652 | 2015-07-26T00:00:17.000Z | 2022-02-24T18:30:04.000Z | www/src/Lib/test/test_zipimport_support.py | SungBeom/BBAM_Brython | 107036ad20a94af1d43e5ce5bd7c73e6a470d687 | [
"BSD-3-Clause"
] | 8 | 2015-09-07T03:38:19.000Z | 2021-05-23T03:18:51.000Z | check-python33-manual/samples/standard_library_337/Lib/test/test_zipimport_support.py | DaveKaretnyk/parsing-utils2 | 40085bbd399fa605f2f2a4708d385a64ffc907de | [
"MIT"
] | 40 | 2015-07-24T19:45:08.000Z | 2021-11-01T14:54:56.000Z | # This test module covers support in various parts of the standard library
# for working with modules located inside zipfiles
# The tests are centralised in this fashion to make it easy to drop them
# if a platform doesn't support zipimport
import test.support
import os
import os.path
import sys
import textwrap
import ... | 42.946939 | 85 | 0.587911 |
import test.support
import os
import os.path
import sys
import textwrap
import zipfile
import zipimport
import doctest
import inspect
import linecache
import pdb
import unittest
from test.script_helper import (spawn_python, kill_python, assert_python_ok,
temp_dir, make_script, make_z... | true | true |
f7f33a128c180bd76c3f3f115f613dbaa6cc3aa7 | 14,460 | py | Python | rlcard3/agents/dqn_agent_pytorch.py | cogitoergoread/muszi-macrohard.hu | e9bbd36b789e670f96622a3a2ba8327f0d897561 | [
"MIT"
] | 1 | 2021-05-27T03:40:37.000Z | 2021-05-27T03:40:37.000Z | rlcard3/agents/dqn_agent_pytorch.py | cogitoergoread/muszi-macrohard.hu | e9bbd36b789e670f96622a3a2ba8327f0d897561 | [
"MIT"
] | null | null | null | rlcard3/agents/dqn_agent_pytorch.py | cogitoergoread/muszi-macrohard.hu | e9bbd36b789e670f96622a3a2ba8327f0d897561 | [
"MIT"
] | 1 | 2022-02-24T11:25:22.000Z | 2022-02-24T11:25:22.000Z | ''' DQN agent
The code is derived from https://github.com/dennybritz/reinforcement-learning/blob/master/DQN/dqn.py
Copyright (c) 2019 Matthew Judell
Copyright (c) 2019 DATA Lab at Texas A&M University
Copyright (c) 2016 Denny Britz
Permission is hereby granted, free of charge, to any person obtaining a copy
of this ... | 38.052632 | 120 | 0.639834 |
import numpy as np
import torch
import torch.nn as nn
from collections import namedtuple
from copy import deepcopy
from rlcard3.agents.dqn_agent import Memory
from rlcard3.utils.utils import remove_illegal
Transition = namedtuple('Transition', ['state', 'action', 'reward', 'next_state', 'done'])
class DQNAgent(obj... | true | true |
f7f33b310b17a2d5be8b2a63ce98c4803d90b119 | 1,455 | py | Python | tests/test_tls.py | businka/Bubot_CoAP | 2b28c63ac3de307547712e66066f324bcc748c6d | [
"MIT"
] | null | null | null | tests/test_tls.py | businka/Bubot_CoAP | 2b28c63ac3de307547712e66066f324bcc748c6d | [
"MIT"
] | null | null | null | tests/test_tls.py | businka/Bubot_CoAP | 2b28c63ac3de307547712e66066f324bcc748c6d | [
"MIT"
] | null | null | null | import unittest
from mbed_tls.mbed_tls_datagram_protocol import TlsDatagramProtocol
from src.Bubot_CoAP import SslMsg
import logging
logger = logging.getLogger()
logging.basicConfig(level=logging.DEBUG)
class TestTslCoap(unittest.TestCase):
def test_decode_client_hello(self):
client_hello = b'\x16\xfe\xf... | 44.090909 | 416 | 0.701718 | import unittest
from mbed_tls.mbed_tls_datagram_protocol import TlsDatagramProtocol
from src.Bubot_CoAP import SslMsg
import logging
logger = logging.getLogger()
logging.basicConfig(level=logging.DEBUG)
class TestTslCoap(unittest.TestCase):
def test_decode_client_hello(self):
client_hello = b'\x16\xfe\xf... | false | true |
f7f33c18bbaa3c724befd3f30b6e0321d722356b | 4,637 | py | Python | rec_to_nwb/processing/nwb/components/iterator/multi_thread_data_iterator.py | LorenFrankLab/rec_to_nwb | d0630f414662963ebbe23aedf8f3ce07628636bc | [
"Apache-2.0"
] | 1 | 2021-01-20T00:26:30.000Z | 2021-01-20T00:26:30.000Z | rec_to_nwb/processing/nwb/components/iterator/multi_thread_data_iterator.py | LorenFrankLab/rec_to_nwb | d0630f414662963ebbe23aedf8f3ce07628636bc | [
"Apache-2.0"
] | 12 | 2020-11-13T01:36:32.000Z | 2022-01-23T20:35:55.000Z | rec_to_nwb/processing/nwb/components/iterator/multi_thread_data_iterator.py | LorenFrankLab/rec_to_nwb | d0630f414662963ebbe23aedf8f3ce07628636bc | [
"Apache-2.0"
] | 3 | 2020-10-20T06:52:45.000Z | 2021-07-06T23:00:53.000Z | import concurrent.futures
import numpy as np
from hdmf.data_utils import DataChunk
from rec_to_nwb.processing.nwb.components.iterator.data_iterator import \
DataIterator
class MultiThreadDataIterator(DataIterator):
def __init__(self, data, number_of_threads=6):
DataIterator.__init__(self, data)
... | 42.541284 | 92 | 0.666163 | import concurrent.futures
import numpy as np
from hdmf.data_utils import DataChunk
from rec_to_nwb.processing.nwb.components.iterator.data_iterator import \
DataIterator
class MultiThreadDataIterator(DataIterator):
def __init__(self, data, number_of_threads=6):
DataIterator.__init__(self, data)
... | true | true |
f7f33c91d13cc1d3297cc086744e3ad79d0e2491 | 3,286 | py | Python | hy/model_patterns.py | vihangd/hy | 781dc35d96258b6e88400ef1eb29c8591d08dcaa | [
"MIT"
] | 1 | 2017-01-15T16:01:10.000Z | 2017-01-15T16:01:10.000Z | hy/model_patterns.py | vihangd/hy | 781dc35d96258b6e88400ef1eb29c8591d08dcaa | [
"MIT"
] | null | null | null | hy/model_patterns.py | vihangd/hy | 781dc35d96258b6e88400ef1eb29c8591d08dcaa | [
"MIT"
] | null | null | null | "Parser combinators for pattern-matching Hy model trees."
from hy.models import Expression, Symbol, Keyword, String, List, Dict, Integer, Float, Complex, Bytes
from funcparserlib.parser import (
some, skip, many, finished, a, Parser, NoParseError, State)
from functools import reduce
from itertools import repeat
fr... | 34.229167 | 101 | 0.651552 |
from hy.models import Expression, Symbol, Keyword, String, List, Dict, Integer, Float, Complex, Bytes
from funcparserlib.parser import (
some, skip, many, finished, a, Parser, NoParseError, State)
from functools import reduce
from itertools import repeat
from collections import namedtuple
from operator import add
... | true | true |
f7f33d04d916a2942854a30e0054c95e0f52f50a | 407 | py | Python | biochallenge/apps/accounts/migrations/0005_auto_20210131_0648.py | bio-ontology-research-group/biochallenge | 9de86af3935547ab2eb5e283a07a2550f028c68b | [
"BSD-2-Clause"
] | null | null | null | biochallenge/apps/accounts/migrations/0005_auto_20210131_0648.py | bio-ontology-research-group/biochallenge | 9de86af3935547ab2eb5e283a07a2550f028c68b | [
"BSD-2-Clause"
] | 15 | 2019-09-04T07:49:40.000Z | 2022-02-10T11:31:17.000Z | biochallenge/apps/accounts/migrations/0005_auto_20210131_0648.py | bio-ontology-research-group/biochallenge | 9de86af3935547ab2eb5e283a07a2550f028c68b | [
"BSD-2-Clause"
] | 1 | 2019-09-03T03:31:28.000Z | 2019-09-03T03:31:28.000Z | # Generated by Django 2.2.17 on 2021-01-31 06:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0004_auto_20201214_0727'),
]
operations = [
migrations.AlterField(
model_name='team',
name='logo',
... | 21.421053 | 73 | 0.599509 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accounts', '0004_auto_20201214_0727'),
]
operations = [
migrations.AlterField(
model_name='team',
name='logo',
field=models.ImageField(blank=True, null... | true | true |
f7f33d9474c2fef4972a9a1b09d37d84b605ea23 | 6,532 | py | Python | train/train.py | RodrigoSanMartin/deploy_API_sagemaker_pytorch_webapp_sentiment_analysis | d7df00b91c05a96ccf0975c621704cacb9bb0a37 | [
"MIT"
] | null | null | null | train/train.py | RodrigoSanMartin/deploy_API_sagemaker_pytorch_webapp_sentiment_analysis | d7df00b91c05a96ccf0975c621704cacb9bb0a37 | [
"MIT"
] | null | null | null | train/train.py | RodrigoSanMartin/deploy_API_sagemaker_pytorch_webapp_sentiment_analysis | d7df00b91c05a96ccf0975c621704cacb9bb0a37 | [
"MIT"
] | null | null | null |
import argparse
import json
import os
import pickle
import sys
import sagemaker_containers
import pandas as pd
import torch
import torch.optim as optim
import torch.utils.data
from model import LSTMClassifier
def model_fn(model_dir):
"""Load the PyTorch model from the `model_dir` directory."""
print("Loadin... | 38.880952 | 116 | 0.65493 |
import argparse
import json
import os
import pickle
import sys
import sagemaker_containers
import pandas as pd
import torch
import torch.optim as optim
import torch.utils.data
from model import LSTMClassifier
def model_fn(model_dir):
print("Loading model.")
model_info = {}
model_info_path = os.pat... | true | true |
f7f33de5d2f2db6e8edb691c898fe86cbb321afb | 169,866 | py | Python | models/transformers/tokenization_utils_base.py | hmthanh/LaTeX_OCR | bf5cf4642aff9cbbd5c4f8f232cd993a38ee6d81 | [
"MIT"
] | null | null | null | models/transformers/tokenization_utils_base.py | hmthanh/LaTeX_OCR | bf5cf4642aff9cbbd5c4f8f232cd993a38ee6d81 | [
"MIT"
] | null | null | null | models/transformers/tokenization_utils_base.py | hmthanh/LaTeX_OCR | bf5cf4642aff9cbbd5c4f8f232cd993a38ee6d81 | [
"MIT"
] | null | null | null | import copy
import json
import os
import re
import warnings
from collections import OrderedDict, UserDict
from contextlib import contextmanager
from dataclasses import dataclass, field
from typing import TYPE_CHECKING, Any, Dict, List, NamedTuple, Optional, Sequence, Tuple, Union
import numpy as np
from packaging impo... | 49.494755 | 222 | 0.622161 | import copy
import json
import os
import re
import warnings
from collections import OrderedDict, UserDict
from contextlib import contextmanager
from dataclasses import dataclass, field
from typing import TYPE_CHECKING, Any, Dict, List, NamedTuple, Optional, Sequence, Tuple, Union
import numpy as np
from packaging impo... | true | true |
f7f33ed6af642f65677bb0223d44010cac437374 | 632 | py | Python | regexp_examples/split_by_case.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 117 | 2015-12-18T07:18:27.000Z | 2022-03-28T00:25:54.000Z | regexp_examples/split_by_case.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 8 | 2018-10-03T09:38:46.000Z | 2021-12-13T19:51:09.000Z | regexp_examples/split_by_case.py | DazEB2/SimplePyScripts | 1dde0a42ba93fe89609855d6db8af1c63b1ab7cc | [
"CC-BY-4.0"
] | 28 | 2016-08-02T17:43:47.000Z | 2022-03-21T08:31:12.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = 'ipetrash'
def split_by_case(text: str) -> list:
import re
return re.findall(r'[a-zA-Z][a-z]+', text)
if __name__ == '__main__':
print(split_by_case('fadeInLeft'))
print(split_by_case('CharSequence'))
print(split_by_case('String'))
... | 28.727273 | 86 | 0.651899 |
__author__ = 'ipetrash'
def split_by_case(text: str) -> list:
import re
return re.findall(r'[a-zA-Z][a-z]+', text)
if __name__ == '__main__':
print(split_by_case('fadeInLeft'))
print(split_by_case('CharSequence'))
print(split_by_case('String'))
print(split_by_case('compareToIgnoreCase'))
... | true | true |
f7f3407458f3aee38bc5b656907bcfc9b47e6d05 | 607 | py | Python | Code12-08.py | jaywoong/learn_algorithm | 31b0da20019d300b730a22da86072c22967a2966 | [
"Apache-2.0"
] | null | null | null | Code12-08.py | jaywoong/learn_algorithm | 31b0da20019d300b730a22da86072c22967a2966 | [
"Apache-2.0"
] | null | null | null | Code12-08.py | jaywoong/learn_algorithm | 31b0da20019d300b730a22da86072c22967a2966 | [
"Apache-2.0"
] | null | null | null | from tkinter import *
window = Tk()
window.geometry("600x600")
photo = PhotoImage(file = 'pet01.gif')
photoAry=[]
h = photo.height()
w = photo.width()
for i in range(h) :
for k in range(w) :
r, g, b = photo.get(i,k)
value = (r + g + b) // 3
photoAry.append(value)
for i in range(len(photoAry)) :
if photoAry[i... | 18.96875 | 48 | 0.604613 | from tkinter import *
window = Tk()
window.geometry("600x600")
photo = PhotoImage(file = 'pet01.gif')
photoAry=[]
h = photo.height()
w = photo.width()
for i in range(h) :
for k in range(w) :
r, g, b = photo.get(i,k)
value = (r + g + b) // 3
photoAry.append(value)
for i in range(len(photoAry)) :
if photoAry[i... | true | true |
f7f3416bf9621c3377c028c1414a95d93f464769 | 11,714 | py | Python | flash/image/detection/data.py | fstroth/lightning-flash | de3f8517410d82ff4a420b3ee4c5bbfee4defb06 | [
"Apache-2.0"
] | 1 | 2021-04-16T12:37:21.000Z | 2021-04-16T12:37:21.000Z | flash/image/detection/data.py | fstroth/lightning-flash | de3f8517410d82ff4a420b3ee4c5bbfee4defb06 | [
"Apache-2.0"
] | null | null | null | flash/image/detection/data.py | fstroth/lightning-flash | de3f8517410d82ff4a420b3ee4c5bbfee4defb06 | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning team.
#
# 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... | 39.177258 | 118 | 0.610722 |
import os
from typing import Any, Callable, Dict, Optional, Sequence, Tuple
from flash.core.data.callback import BaseDataFetcher
from flash.core.data.data_module import DataModule
from flash.core.data.data_source import DataSource, DefaultDataKeys, DefaultDataSources, FiftyOneDataSource
from flash.core.da... | true | true |
f7f341b0fe3b66de6f5d160c8e089b97a9a5cc5d | 512 | py | Python | setup.py | farr/RVChallenge | 1925682f1a19442560401a7fd2a5b2dde9472f11 | [
"MIT"
] | 1 | 2016-03-11T07:57:09.000Z | 2016-03-11T07:57:09.000Z | setup.py | farr/RVChallenge | 1925682f1a19442560401a7fd2a5b2dde9472f11 | [
"MIT"
] | null | null | null | setup.py | farr/RVChallenge | 1925682f1a19442560401a7fd2a5b2dde9472f11 | [
"MIT"
] | null | null | null | from setuptools import setup, Extension
from Cython.Build import cythonize
import numpy as np
setup(
name='rvchallenge',
version="0.0.1",
description='An attempt at competing in the RVChallenge.',
long_description='See https://rv-challenge.wikispaces.com',
author='Will M. Farr',
author_email='... | 24.380952 | 79 | 0.689453 | from setuptools import setup, Extension
from Cython.Build import cythonize
import numpy as np
setup(
name='rvchallenge',
version="0.0.1",
description='An attempt at competing in the RVChallenge.',
long_description='See https://rv-challenge.wikispaces.com',
author='Will M. Farr',
author_email='... | true | true |
f7f34228279aa29a5b08f97bfd3edb8c33041e25 | 19,892 | py | Python | engine.py | vicgalle/ARAMARL | 1f0e3d3f76b345e12ec58029dc62d92f33738084 | [
"MIT"
] | 2 | 2018-12-26T14:46:29.000Z | 2019-10-24T15:46:12.000Z | engine.py | vicgalle/ARAMARL | 1f0e3d3f76b345e12ec58029dc62d92f33738084 | [
"MIT"
] | null | null | null | engine.py | vicgalle/ARAMARL | 1f0e3d3f76b345e12ec58029dc62d92f33738084 | [
"MIT"
] | 1 | 2019-09-07T01:26:25.000Z | 2019-09-07T01:26:25.000Z | """
This module implements several environments, i.e., the simulators in which agents will interact and learn.
Any environment is characterized by the following two methods:
* step : receives the actions taken by the agents, and returns the new state of the simulator and the rewards
perceived by each agent, amongst o... | 30.277017 | 158 | 0.535693 |
import numpy as np
class RMG():
NUM_AGENTS = 2
NUM_ACTIONS = 2
NUM_STATES = NUM_AGENTS*NUM_ACTIONS + 1
def __init__(self, max_steps, payouts, batch_size=1):
self.max_steps = max_steps
self.batch_size = batch_size
self.payout_mat = payouts
self.available_action... | true | true |
f7f342bd2e006a1db16782e4bd7ce408e087ac39 | 3,226 | py | Python | 11_calibration_NHMv10/merge byHRU results with paramdb.py | pnorton-usgs/notebooks | 17a38ecd3f3c052b9bd785c2e53e16a9082d1e71 | [
"MIT"
] | null | null | null | 11_calibration_NHMv10/merge byHRU results with paramdb.py | pnorton-usgs/notebooks | 17a38ecd3f3c052b9bd785c2e53e16a9082d1e71 | [
"MIT"
] | null | null | null | 11_calibration_NHMv10/merge byHRU results with paramdb.py | pnorton-usgs/notebooks | 17a38ecd3f3c052b9bd785c2e53e16a9082d1e71 | [
"MIT"
] | null | null | null | # ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.13.7
# kernelspec:
# display_name: Python [conda env:bandit_38]
# language: python
# name: conda-env-bandi... | 24.439394 | 123 | 0.690019 |
import glob
import numpy as np
import os
import pandas as pd
import sys
from collections import Counter
from pyPRMS.ParamDb import ParamDb
from pyPRMS.ParameterFile import ParameterFile
from pyPRMS.ControlFile import ControlFile
from pyPRMS.ValidParams import ValidParams
base_dir = '/Users/pnorto... | true | true |
f7f34351d391296509fd9cd8db492a9fb7179c13 | 5,865 | py | Python | src/django_otp/plugins/otp_email/tests.py | jaap3/django-otp | d7980bf516018319158570cc75353c905375a3ab | [
"BSD-2-Clause"
] | 318 | 2019-08-27T15:57:05.000Z | 2022-03-30T08:38:29.000Z | src/django_otp/plugins/otp_email/tests.py | jaap3/django-otp | d7980bf516018319158570cc75353c905375a3ab | [
"BSD-2-Clause"
] | 77 | 2019-09-17T11:48:38.000Z | 2022-03-13T17:26:56.000Z | src/django_otp/plugins/otp_email/tests.py | jaap3/django-otp | d7980bf516018319158570cc75353c905375a3ab | [
"BSD-2-Clause"
] | 76 | 2019-08-30T20:29:40.000Z | 2022-03-30T09:14:36.000Z | from datetime import timedelta
from freezegun import freeze_time
from django.core import mail
from django.db import IntegrityError
from django.test.utils import override_settings
from django_otp.forms import OTPAuthenticationForm
from django_otp.tests import TestCase, ThrottlingTestMixin
from .models import EmailDe... | 32.583333 | 113 | 0.646377 | from datetime import timedelta
from freezegun import freeze_time
from django.core import mail
from django.db import IntegrityError
from django.test.utils import override_settings
from django_otp.forms import OTPAuthenticationForm
from django_otp.tests import TestCase, ThrottlingTestMixin
from .models import EmailDe... | true | true |
f7f343997560d8821afe1cbcf3df97f04ca5d04e | 5,923 | py | Python | src/hera/cron_workflow_service.py | bobh66/hera-workflows | 7dc94de3725b13fcba7ff54cd96cb90119ae2591 | [
"MIT"
] | null | null | null | src/hera/cron_workflow_service.py | bobh66/hera-workflows | 7dc94de3725b13fcba7ff54cd96cb90119ae2591 | [
"MIT"
] | null | null | null | src/hera/cron_workflow_service.py | bobh66/hera-workflows | 7dc94de3725b13fcba7ff54cd96cb90119ae2591 | [
"MIT"
] | null | null | null | """Holds the cron workflow service that supports client cron workflow creations"""
from typing import Optional, Tuple
from argo_workflows.apis import CronWorkflowServiceApi
from argo_workflows.models import (
IoArgoprojWorkflowV1alpha1CreateCronWorkflowRequest,
IoArgoprojWorkflowV1alpha1CronWorkflow,
IoArg... | 36.78882 | 124 | 0.644099 | from typing import Optional, Tuple
from argo_workflows.apis import CronWorkflowServiceApi
from argo_workflows.models import (
IoArgoprojWorkflowV1alpha1CreateCronWorkflowRequest,
IoArgoprojWorkflowV1alpha1CronWorkflow,
IoArgoprojWorkflowV1alpha1WorkflowResumeRequest,
IoArgoprojWorkflowV1alpha1WorkflowS... | true | true |
f7f343de208f75adc98ce9e3d5b9cfa5ce959119 | 6,878 | py | Python | multi_arm_bandit/mvn_arm4/mvn_test_arm4_sample10_new.py | zxsted/meta-critic-networks | 1768751f84845bd6fe98a13d5b57dfaca154c1f8 | [
"MIT"
] | 59 | 2018-04-03T05:59:37.000Z | 2022-03-14T22:41:38.000Z | multi_arm_bandit/mvn_arm4/mvn_test_arm4_sample10_new.py | floodsung/meta-critic-networks | 1768751f84845bd6fe98a13d5b57dfaca154c1f8 | [
"MIT"
] | null | null | null | multi_arm_bandit/mvn_arm4/mvn_test_arm4_sample10_new.py | floodsung/meta-critic-networks | 1768751f84845bd6fe98a13d5b57dfaca154c1f8 | [
"MIT"
] | 20 | 2018-04-03T04:30:55.000Z | 2021-12-06T06:57:59.000Z | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import matplotlib.pyplot as plt
import numpy as np
import math
import random
import os
import json
def save_to_json(fname, data):
with open(fname, 'w') as outfile:
json.dump(data, outfile)
# Hyper Param... | 35.091837 | 144 | 0.662693 | import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.autograd import Variable
import matplotlib.pyplot as plt
import numpy as np
import math
import random
import os
import json
def save_to_json(fname, data):
with open(fname, 'w') as outfile:
json.dump(data, outfile)
TASK_NUMS = ... | true | true |
f7f344877857cd7fcdd7e41d70bc22e865f763b3 | 5,938 | py | Python | egs/madcat_arabic/v1/local/process_data.py | huangruizhe/waldo_old | 75ead75c3320643888141573f191f5190f9aa203 | [
"Apache-2.0"
] | 12 | 2018-05-07T05:47:37.000Z | 2020-05-15T15:58:43.000Z | egs/madcat_arabic/v1/local/process_data.py | huangruizhe/waldo_old | 75ead75c3320643888141573f191f5190f9aa203 | [
"Apache-2.0"
] | 53 | 2018-04-29T20:51:17.000Z | 2018-08-22T07:06:56.000Z | egs/madcat_arabic/v1/local/process_data.py | huangruizhe/waldo_old | 75ead75c3320643888141573f191f5190f9aa203 | [
"Apache-2.0"
] | 13 | 2018-04-28T22:00:19.000Z | 2022-01-15T13:24:59.000Z | #!/usr/bin/env python3
# Copyright 2018 Johns Hopkins University (author: Ashish Arora)
# Apache 2.0
""" This script prepares the training, validation and test data for MADCAT Arabic in a pytorch fashion
"""
import sys
import argparse
import os
import torch
from create_mask_from_page_image import get_mask_from_page_... | 40.951724 | 117 | 0.682385 |
import sys
import argparse
import os
import torch
from create_mask_from_page_image import get_mask_from_page_image
from waldo.data_io import DataSaver
from waldo.core_config import CoreConfig
parser = argparse.ArgumentParser(description="Creates line images from page image",
epil... | true | true |
f7f344af834be5187bb54473722498f0ac8f51af | 2,280 | py | Python | hyperopt/tests/test_pyll_utils.py | bjkomer/hyperopt | ddb32ecf384312ae0fd9f9e17d2d9e17e90e6096 | [
"BSD-3-Clause"
] | 2 | 2018-01-10T01:22:07.000Z | 2018-04-06T15:34:47.000Z | hyperopt/tests/test_pyll_utils.py | bjkomer/hyperopt | ddb32ecf384312ae0fd9f9e17d2d9e17e90e6096 | [
"BSD-3-Clause"
] | 1 | 2018-06-26T13:01:39.000Z | 2018-06-26T17:21:46.000Z | hyperopt/tests/test_pyll_utils.py | bjkomer/hyperopt | ddb32ecf384312ae0fd9f9e17d2d9e17e90e6096 | [
"BSD-3-Clause"
] | 3 | 2018-03-08T12:29:11.000Z | 2021-06-07T21:07:55.000Z |
from hyperopt.pyll_utils import EQ
from hyperopt.pyll_utils import expr_to_config
from hyperopt import hp
from hyperopt.pyll import as_apply
def test_expr_to_config():
z = hp.randint('z', 10)
a = hp.choice('a',
[
hp.uniform('b', -1, 1) + z,
{'c':... | 32.571429 | 77 | 0.47193 |
from hyperopt.pyll_utils import EQ
from hyperopt.pyll_utils import expr_to_config
from hyperopt import hp
from hyperopt.pyll import as_apply
def test_expr_to_config():
z = hp.randint('z', 10)
a = hp.choice('a',
[
hp.uniform('b', -1, 1) + z,
{'c':... | false | true |
f7f344cb5977aaebef8b3914d55ca726c7c33ed3 | 604 | py | Python | Examen_2/p2/p2.py | GuidoZalles/Computacion_para_Ingenieria | 2afc06784760ca07786396374397a32ac2c19a27 | [
"Apache-2.0"
] | null | null | null | Examen_2/p2/p2.py | GuidoZalles/Computacion_para_Ingenieria | 2afc06784760ca07786396374397a32ac2c19a27 | [
"Apache-2.0"
] | null | null | null | Examen_2/p2/p2.py | GuidoZalles/Computacion_para_Ingenieria | 2afc06784760ca07786396374397a32ac2c19a27 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Feb 17 08:42:23 2022
@author: User
"""
from tkinter import *
ventana = Tk()
ventana.geometry("500x100")
ventana.title("PREGUNTA 2")
ventana.config(background='dark gray')
label_1 = Label(ventana, text="Contador:")
input_text = Entry(ventana, bg="powder blue")
boton_1 = But... | 21.571429 | 45 | 0.688742 |
from tkinter import *
ventana = Tk()
ventana.geometry("500x100")
ventana.title("PREGUNTA 2")
ventana.config(background='dark gray')
label_1 = Label(ventana, text="Contador:")
input_text = Entry(ventana, bg="powder blue")
boton_1 = Button(ventana, text="Count Up")
boton_2 = Button(ventana, text="Count Down")
boton_3... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.