hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | 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 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
cc919e7be7aeac013c4e2a2dfbd52a5d32112b0f | 653 | py | Python | src/main.py | peb-adr/boteweber-backend | 85d7e0b87d4fde316f679af8917de67a9615c8fd | [
"MIT"
] | null | null | null | src/main.py | peb-adr/boteweber-backend | 85d7e0b87d4fde316f679af8917de67a9615c8fd | [
"MIT"
] | null | null | null | src/main.py | peb-adr/boteweber-backend | 85d7e0b87d4fde316f679af8917de67a9615c8fd | [
"MIT"
] | null | null | null | import json
from src import sql, rest
from src import config
def main():
init_config()
sql.init()
rest.serve()
def init_config():
with open('rest_config.json', 'r') as f:
c = json.loads(f.read())
f.close()
if type(c) != dict:
c = {}
config.rest = c
with open('s... | 16.74359 | 44 | 0.50536 |
5ce6665ba09324f309e7d4399dfef9d956c8d9a6 | 2,294 | py | Python | Software/Python/grove_led_fade.py | benmcclelland/GrovePi | 1e48137b6007ffd4ce430e821d2aa744349e362a | [
"MIT"
] | 482 | 2015-01-09T03:06:14.000Z | 2022-03-24T10:05:07.000Z | Software/Python/grove_led_fade.py | benmcclelland/GrovePi | 1e48137b6007ffd4ce430e821d2aa744349e362a | [
"MIT"
] | 257 | 2015-01-13T14:08:17.000Z | 2022-01-20T08:43:50.000Z | Software/Python/grove_led_fade.py | benmcclelland/GrovePi | 1e48137b6007ffd4ce430e821d2aa744349e362a | [
"MIT"
] | 510 | 2015-01-27T17:15:44.000Z | 2022-03-29T01:27:13.000Z | #!/usr/bin/env python
#
# GrovePi Example for using the Grove LED for LED Fade effect (http://www.seeedstudio.com/wiki/Grove_-_LED_Socket_Kit)
#
# The GrovePi connects the Raspberry Pi and Grove sensors. You can learn more about GrovePi here: http://www.dexterindustries.com/GrovePi
#
# Have a question about this exam... | 31 | 139 | 0.730166 |
de3035254912425aebffef9003dcf8aeb6dceb93 | 7,012 | py | Python | ga_solve_sudoku.py | anandpathak/sudoku-solve | 1a1365aa5a1ec32f4053b8b4d76dc3658bb64f87 | [
"MIT"
] | null | null | null | ga_solve_sudoku.py | anandpathak/sudoku-solve | 1a1365aa5a1ec32f4053b8b4d76dc3658bb64f87 | [
"MIT"
] | null | null | null | ga_solve_sudoku.py | anandpathak/sudoku-solve | 1a1365aa5a1ec32f4053b8b4d76dc3658bb64f87 | [
"MIT"
] | null | null | null | '''
Solve sudoku using Genetic Algorithm
'''
import random
import numpy as np
from generator import Generator
GENERATOR = Generator()
class GeneticSolution:
'''
Identify the solution for the sudoku problem where some of the values are not provided
in the 9x9 sudoku matrix using Genetic Algorith... | 42.49697 | 128 | 0.578722 |
fc5bfac35c82c9f0cff9673e8e67bb1db06f6e92 | 770 | py | Python | leetcode/1710_maximum_units_on_a_truck.py | jacquerie/leetcode | a05e6b832eb0e0740aaff7b2eb3109038ad404bf | [
"MIT"
] | 3 | 2018-05-10T09:56:49.000Z | 2020-11-07T18:09:42.000Z | leetcode/1710_maximum_units_on_a_truck.py | jacquerie/leetcode | a05e6b832eb0e0740aaff7b2eb3109038ad404bf | [
"MIT"
] | null | null | null | leetcode/1710_maximum_units_on_a_truck.py | jacquerie/leetcode | a05e6b832eb0e0740aaff7b2eb3109038ad404bf | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from typing import List
class Solution:
def maximumUnits(self, boxTypes: List[List[int]], truckSize: int) -> int:
sorted_box_types, result = sorted(boxTypes, key=lambda el: el[1], reverse=True), 0
for number_of_boxes, number_of_units_per_box in sorted_box_types:
... | 33.478261 | 90 | 0.627273 |
6211300b0103f570a97e97cbfd520363151ab26c | 3,281 | py | Python | python/fate_flow/tests/api_tests/data_access_test.py | MiKKiYang/FATE-Flow | 0b846c943a57f3d089885db22b2e08ef78fb73ed | [
"Apache-2.0"
] | 22 | 2021-08-17T06:36:40.000Z | 2022-03-25T03:18:04.000Z | python/fate_flow/tests/api_tests/data_access_test.py | MiKKiYang/FATE-Flow | 0b846c943a57f3d089885db22b2e08ef78fb73ed | [
"Apache-2.0"
] | 24 | 2021-08-11T09:21:00.000Z | 2022-03-29T13:33:14.000Z | python/fate_flow/tests/api_tests/data_access_test.py | MiKKiYang/FATE-Flow | 0b846c943a57f3d089885db22b2e08ef78fb73ed | [
"Apache-2.0"
] | 17 | 2021-05-13T16:03:22.000Z | 2022-03-16T14:26:57.000Z | import os
import time
import unittest
import requests
from fate_flow.entity.run_status import JobStatus
from fate_flow.utils.base_utils import get_fate_flow_directory
from fate_flow.settings import API_VERSION, HOST, HTTP_PORT
class TestDataAccess(unittest.TestCase):
def setUp(self):
self.data_dir = os.... | 51.265625 | 141 | 0.595855 |
d30707602975c496eac2bdb538f7e3553320f234 | 176 | py | Python | datadog_checks_base/datadog_checks/base/utils/tagging.py | brentm5/integrations-core | 5cac8788c95d8820435ef9c5d32d6a5463cf491d | [
"BSD-3-Clause"
] | null | null | null | datadog_checks_base/datadog_checks/base/utils/tagging.py | brentm5/integrations-core | 5cac8788c95d8820435ef9c5d32d6a5463cf491d | [
"BSD-3-Clause"
] | null | null | null | datadog_checks_base/datadog_checks/base/utils/tagging.py | brentm5/integrations-core | 5cac8788c95d8820435ef9c5d32d6a5463cf491d | [
"BSD-3-Clause"
] | null | null | null | # (C) Datadog, Inc. 2018
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
try:
import tagger
except ImportError:
from ..stubs import tagger
| 19.555556 | 53 | 0.727273 |
503708939d0dc68f9352ab4dfd70da10c6314165 | 16,815 | py | Python | python_modules/dagster-graphql/dagster_graphql/implementation/pipeline_execution_manager.py | vatervonacht/dagster | 595d78c883ef20618052ac1575fe46cde51fd541 | [
"Apache-2.0"
] | 3 | 2020-04-28T16:27:33.000Z | 2020-07-22T07:43:30.000Z | python_modules/dagster-graphql/dagster_graphql/implementation/pipeline_execution_manager.py | vatervonacht/dagster | 595d78c883ef20618052ac1575fe46cde51fd541 | [
"Apache-2.0"
] | null | null | null | python_modules/dagster-graphql/dagster_graphql/implementation/pipeline_execution_manager.py | vatervonacht/dagster | 595d78c883ef20618052ac1575fe46cde51fd541 | [
"Apache-2.0"
] | 1 | 2021-02-21T12:16:47.000Z | 2021-02-21T12:16:47.000Z | from __future__ import absolute_import
import abc
import logging
import os
import sys
import time
from queue import Empty
import gevent
import six
from dagster import ExecutionTargetHandle, PipelineDefinition, PipelineExecutionResult, check
from dagster.core.errors import DagsterSubprocessError
from dagster.core.eve... | 35.700637 | 100 | 0.669105 |
e140a62cfdc232fbcf7f25e59b6a6a284859854c | 3,182 | py | Python | amaascore/transactions/cash_transaction.py | amaas-fintech/amaas-core-sdk-python | bd77884de6e5ab05d864638addeb4bb338a51183 | [
"Apache-2.0"
] | null | null | null | amaascore/transactions/cash_transaction.py | amaas-fintech/amaas-core-sdk-python | bd77884de6e5ab05d864638addeb4bb338a51183 | [
"Apache-2.0"
] | 8 | 2017-06-06T09:42:41.000Z | 2018-01-16T10:16:16.000Z | amaascore/transactions/cash_transaction.py | amaas-fintech/amaas-core-sdk-python | bd77884de6e5ab05d864638addeb4bb338a51183 | [
"Apache-2.0"
] | 8 | 2017-01-18T04:14:01.000Z | 2017-12-01T08:03:10.000Z | from __future__ import absolute_import, division, print_function, unicode_literals
from amaascore.transactions.transaction import Transaction
class CashTransaction(Transaction):
def __init__(self, asset_manager_id, asset_book_id, counterparty_book_id, transaction_action,
asset_id, quantity, tra... | 47.492537 | 107 | 0.47643 |
a3f3176d6fde0467cb24982da253daa159984f45 | 5,658 | py | Python | online_judge/uvatool/uva.py | 18argon/online_judge_tool | 3a403289dcc1f7ff9dc6b074a1b165c98325a327 | [
"MIT"
] | 1 | 2019-09-19T02:39:49.000Z | 2019-09-19T02:39:49.000Z | online_judge/uvatool/uva.py | 18argon/online_judge_tool | 3a403289dcc1f7ff9dc6b074a1b165c98325a327 | [
"MIT"
] | 2 | 2021-03-31T19:18:59.000Z | 2021-12-13T20:13:56.000Z | online_judge/uvatool/uva.py | 18argon/online_judge_tool | 3a403289dcc1f7ff9dc6b074a1b165c98325a327 | [
"MIT"
] | null | null | null | import os
import re
import pickle
from lxml.html import fromstring
from online_judge import OnlineJudge
from .utils import ActionMethod, languages
from .uhunt import UHunt
from .verdict import Verdict
HOME_URL = lambda: 'http://uva.onlinejudge.org/'
SESSIONS_DIR = lambda: 'data/sessions'
SUBMIT_URL = lambda: 'https:/... | 32.147727 | 110 | 0.592082 |
2c48192b3ef4f9330855778309b001e050ad26c1 | 2,078 | py | Python | sources/ometiff/setup.py | Do-AI/large_image | ecf6f28dc8fabc79534c7c39e0307512b9734b08 | [
"Apache-2.0"
] | null | null | null | sources/ometiff/setup.py | Do-AI/large_image | ecf6f28dc8fabc79534c7c39e0307512b9734b08 | [
"Apache-2.0"
] | null | null | null | sources/ometiff/setup.py | Do-AI/large_image | ecf6f28dc8fabc79534c7c39e0307512b9734b08 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
from setuptools import setup, find_packages
def prerelease_local_scheme(version):
"""
Return local scheme version unless building on master in CircleCI.
This function returns the local scheme version number
(e.g. 0.0.0.dev<N>+g<HASH>) unless building on CircleCI for a... | 33.516129 | 88 | 0.650144 |
e457044443ea7b8a6921e097df4b45b92c962c81 | 5,508 | py | Python | stylegan2_pytorch/cli.py | Gokkulnath/stylegan2-pytorch | 4465ba38f4ecfff14500867d1fe07345a1e02eb3 | [
"MIT"
] | 1 | 2021-09-28T02:29:21.000Z | 2021-09-28T02:29:21.000Z | stylegan2_pytorch/cli.py | Gokkulnath/stylegan2-pytorch | 4465ba38f4ecfff14500867d1fe07345a1e02eb3 | [
"MIT"
] | null | null | null | stylegan2_pytorch/cli.py | Gokkulnath/stylegan2-pytorch | 4465ba38f4ecfff14500867d1fe07345a1e02eb3 | [
"MIT"
] | 1 | 2021-12-12T13:38:08.000Z | 2021-12-12T13:38:08.000Z | import os
import fire
import random
from retry.api import retry_call
from tqdm import tqdm
from datetime import datetime
from functools import wraps
from stylegan2_pytorch import Trainer, NanException
import torch
import torch.multiprocessing as mp
import torch.distributed as dist
import numpy as np
def cast_list(el... | 29.297872 | 145 | 0.653413 |
15869b838df5747495402f06f62ac7b1b47ad138 | 5,486 | py | Python | tests/pruning/test_onnx_export.py | hussam789/nncf | 3bf9d00f370e759f4b44d04d3be5e970500dc6a0 | [
"Apache-2.0"
] | 1 | 2022-01-26T09:36:03.000Z | 2022-01-26T09:36:03.000Z | tests/pruning/test_onnx_export.py | mk-nvidia/nncf | e9d487cca8e3e64e6bb12ad7fed38cc850eb9440 | [
"Apache-2.0"
] | null | null | null | tests/pruning/test_onnx_export.py | mk-nvidia/nncf | e9d487cca8e3e64e6bb12ad7fed38cc850eb9440 | [
"Apache-2.0"
] | null | null | null | """
Copyright (c) 2020 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 writin... | 53.262136 | 112 | 0.580569 |
dde1ef2c807a29fe0d7922218da37319afc9d46d | 153 | py | Python | ch-1/__init__.py | LAsbun/network | 14d52ee89058a745d5caebe542fbc33ff8eb0f0a | [
"Apache-2.0"
] | null | null | null | ch-1/__init__.py | LAsbun/network | 14d52ee89058a745d5caebe542fbc33ff8eb0f0a | [
"Apache-2.0"
] | null | null | null | ch-1/__init__.py | LAsbun/network | 14d52ee89058a745d5caebe542fbc33ff8eb0f0a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 17/2/15 上午9:19
# @Author : sws
# @Site :
# @File : __init__.py.py
# @Software: PyCharm | 21.857143 | 27 | 0.542484 |
e55a7791c154c412b5b8cda89b38c1c8e1618335 | 5,885 | py | Python | src/Cache/cache.py | shapovalovdev/AlgorythmsAndDataStructures | 34d5f38c089e0ba902813607f08847fbdc7361ab | [
"Apache-2.0"
] | null | null | null | src/Cache/cache.py | shapovalovdev/AlgorythmsAndDataStructures | 34d5f38c089e0ba902813607f08847fbdc7361ab | [
"Apache-2.0"
] | null | null | null | src/Cache/cache.py | shapovalovdev/AlgorythmsAndDataStructures | 34d5f38c089e0ba902813607f08847fbdc7361ab | [
"Apache-2.0"
] | null | null | null | # class NativeDictionary:
# def __init__(self, sz):
# self.size = sz
# self.keys = [None] * self.size
# self.values = [None] * self.size
#
# def hash_fun(self, key):
# # в качестве key поступают строки!
# # всегда возвращает корректный индекс слота
# def hashing(v... | 29.572864 | 108 | 0.492778 |
b35a5ef360fd08d4b5432b1eaf196676091484ac | 4,357 | py | Python | jsonrpc/jsonrpc1.py | grkhr/json-rpc | 3d5da2b2d97c55512a7e0bcbef594c847c287582 | [
"MIT"
] | null | null | null | jsonrpc/jsonrpc1.py | grkhr/json-rpc | 3d5da2b2d97c55512a7e0bcbef594c847c287582 | [
"MIT"
] | null | null | null | jsonrpc/jsonrpc1.py | grkhr/json-rpc | 3d5da2b2d97c55512a7e0bcbef594c847c287582 | [
"MIT"
] | 1 | 2021-06-22T10:42:05.000Z | 2021-06-22T10:42:05.000Z | from . import six
from .base import JSONRPCBaseRequest, JSONRPCBaseResponse
from .exceptions import JSONRPCInvalidRequestException, JSONRPCError
class JSONRPC10Request(JSONRPCBaseRequest):
""" JSON-RPC 1.0 Request.
A remote method is invoked by sending a request to a remote service.
The request is a si... | 28.109677 | 79 | 0.609594 |
906394d9ae1fc577438dcc60985b17cf74d15253 | 1,612 | py | Python | coursera/algorithmic-toolbox/week-6/dynamic-programming/3_maximum_value_of_an_arithmetic_expression/solution.py | kamilsk/algo | 08b446760543844d62ecb98c98cd641203a60932 | [
"MIT"
] | 4 | 2019-07-26T21:29:09.000Z | 2022-01-09T01:21:46.000Z | coursera/algorithmic-toolbox/week-6/dynamic-programming/3_maximum_value_of_an_arithmetic_expression/solution.py | kamilsk/algo | 08b446760543844d62ecb98c98cd641203a60932 | [
"MIT"
] | null | null | null | coursera/algorithmic-toolbox/week-6/dynamic-programming/3_maximum_value_of_an_arithmetic_expression/solution.py | kamilsk/algo | 08b446760543844d62ecb98c98cd641203a60932 | [
"MIT"
] | null | null | null | # python3
from collections import namedtuple
from unittest import TestCase
test = namedtuple('test', 'expression expected')
def calculate(a: int, b: int, op: chr) -> int:
if op == '+':
return a + b
elif op == '-':
return a - b
elif op == '*':
return a * b
else:
assert ... | 28.785714 | 101 | 0.492556 |
c43b44522f9a84d0bb9bb9e937343a1327b4bd64 | 12,620 | py | Python | certbot/tests/util.py | mausinixterra/letsencrypt | 2d4f36cc9fedafa91b9877ec2ec1f9f83da4ecd3 | [
"Apache-2.0"
] | 2 | 2018-10-03T15:33:57.000Z | 2020-06-09T20:28:29.000Z | certbot/tests/util.py | mausinixterra/letsencrypt | 2d4f36cc9fedafa91b9877ec2ec1f9f83da4ecd3 | [
"Apache-2.0"
] | null | null | null | certbot/tests/util.py | mausinixterra/letsencrypt | 2d4f36cc9fedafa91b9877ec2ec1f9f83da4ecd3 | [
"Apache-2.0"
] | 3 | 2018-02-09T21:05:38.000Z | 2019-06-10T00:39:00.000Z | """Test utilities.
.. warning:: This module is not part of the public API.
"""
import multiprocessing
import os
import pkg_resources
import shutil
import tempfile
import unittest
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives import serialization
import mock
import OpenS... | 32.525773 | 84 | 0.675911 |
e2f432738793eb3b248386577dda815d91780d1e | 19,493 | py | Python | stable_baselines/acktr/acktr_disc.py | Miffyli/stable-baselines | 153ce701b3275073fb50e51cfa0963a466c6634a | [
"MIT"
] | 1 | 2021-11-10T09:35:34.000Z | 2021-11-10T09:35:34.000Z | stable_baselines/acktr/acktr_disc.py | Miffyli/stable-baselines | 153ce701b3275073fb50e51cfa0963a466c6634a | [
"MIT"
] | null | null | null | stable_baselines/acktr/acktr_disc.py | Miffyli/stable-baselines | 153ce701b3275073fb50e51cfa0963a466c6634a | [
"MIT"
] | 1 | 2020-02-26T20:08:20.000Z | 2020-02-26T20:08:20.000Z | """
Discrete acktr
"""
import time
from collections import deque
import tensorflow as tf
import numpy as np
from gym.spaces import Box, Discrete
from stable_baselines import logger
from stable_baselines.common import explained_variance, ActorCriticRLModel, tf_util, SetVerbosity, TensorboardWriter
from stable_baselin... | 52.683784 | 120 | 0.599241 |
93d0954a697b77e5d195bce4b3f301883fd6b720 | 3,759 | py | Python | contrib/seeds/makeseeds.py | Saints97/Katana | 694312cdda7063ee70c74f6f822a91964bf77d4d | [
"MIT"
] | null | null | null | contrib/seeds/makeseeds.py | Saints97/Katana | 694312cdda7063ee70c74f6f822a91964bf77d4d | [
"MIT"
] | null | null | null | contrib/seeds/makeseeds.py | Saints97/Katana | 694312cdda7063ee70c74f6f822a91964bf77d4d | [
"MIT"
] | 1 | 2020-11-16T08:01:39.000Z | 2020-11-16T08:01:39.000Z | #!/usr/bin/env python
#
# Generate seeds.txt from Pieter's DNS seeder
#
NSEEDS=512
MAX_SEEDS_PER_ASN=2
MIN_BLOCKS = 200000
# These are hosts that have been observed to be behaving strangely (e.g.
# aggressively connecting to every node).
SUSPICIOUS_HOSTS = set([
"130.211.129.106", "178.63.107.226",
"83.81.1... | 31.588235 | 186 | 0.579675 |
7d7d0c037a8ff8fb8aed8281632ed399f7d39336 | 22,133 | py | Python | python/ray/serve/tests/test_cli.py | quarkzou/ray | 49de29969df0c55a5969b8ffbfc7d62459e5024b | [
"Apache-2.0"
] | 1 | 2022-03-28T06:18:30.000Z | 2022-03-28T06:18:30.000Z | python/ray/serve/tests/test_cli.py | ArneTroch99/ray | f51cb09e02c2797fd857adb0e7fd44d4dd4222d5 | [
"Apache-2.0"
] | null | null | null | python/ray/serve/tests/test_cli.py | ArneTroch99/ray | f51cb09e02c2797fd857adb0e7fd44d4dd4222d5 | [
"Apache-2.0"
] | null | null | null | import json
import os
from pathlib import Path
import subprocess
import sys
import signal
import pytest
import requests
import ray
from ray import serve
from ray.tests.conftest import tmp_working_dir # noqa: F401, E501
from ray._private.test_utils import wait_for_condition
from ray.dashboard.optional_utils import RAY... | 32.216885 | 88 | 0.589211 |
ee1c5a321ba960b304c5600aa8baecf4f3d6da0a | 374 | py | Python | setup.py | eisen-ai/eisen | f8f96531ac1faead4a64b565b5d689fb18dc3086 | [
"MIT"
] | 2 | 2020-06-02T23:46:32.000Z | 2020-08-18T22:06:14.000Z | setup.py | eisen-ai/eisen | f8f96531ac1faead4a64b565b5d689fb18dc3086 | [
"MIT"
] | null | null | null | setup.py | eisen-ai/eisen | f8f96531ac1faead4a64b565b5d689fb18dc3086 | [
"MIT"
] | 1 | 2020-07-08T09:11:28.000Z | 2020-07-08T09:11:28.000Z | from setuptools import setup, find_packages
VERSION = "0.1.10"
with open("requirements.txt") as f:
install_requires = f.read().strip().split("\n")
setup(
name="eisen",
version=VERSION,
description="Eisen Meta Package (installs all components of Eisen)",
packages=find_packages(),
install_requ... | 22 | 72 | 0.695187 |
91f6801839eb12bce3c3dd540cd5311ad73028b8 | 1,351 | py | Python | tests/benchmark.py | xoolive/geodesy | d30c1bf1bddd51a0363c0c3d7b801ad1720ff81b | [
"MIT"
] | 8 | 2015-02-19T19:29:03.000Z | 2021-01-27T07:59:45.000Z | tests/benchmark.py | xoolive/geodesy | d30c1bf1bddd51a0363c0c3d7b801ad1720ff81b | [
"MIT"
] | 6 | 2015-10-28T14:40:34.000Z | 2022-02-03T17:01:16.000Z | tests/benchmark.py | xoolive/geodesy | d30c1bf1bddd51a0363c0c3d7b801ad1720ff81b | [
"MIT"
] | 8 | 2015-12-20T20:55:19.000Z | 2022-02-03T06:38:58.000Z | import geodesy.sphere as geo
import numpy as np
import time
size = 360 * 60 - 1
p1 = [0 for i in range(size)]
p2 = [i / 60. for i in range(size)]
p3 = [0 for i in range(size)]
p4 = [(i + 1) / 60. for i in range(size)]
p1_64 = np.array(p1, np.float64)
p2_64 = np.array(p2, np.float64)
p3_64 = np.array(p3, np.float64)
... | 24.125 | 76 | 0.600296 |
9823d7be6b75ff20b924d8cbcde3d5eb484340d9 | 1,196 | py | Python | mitty/lib/evcfparse.py | ozemsbg/Mitty | 5fc6ad399c5366442034b59dfd1c0f9bab199a3f | [
"Apache-2.0"
] | 12 | 2016-08-13T23:31:26.000Z | 2020-03-31T09:23:27.000Z | mitty/lib/evcfparse.py | ozemsbg/Mitty | 5fc6ad399c5366442034b59dfd1c0f9bab199a3f | [
"Apache-2.0"
] | 13 | 2017-01-25T03:54:07.000Z | 2021-02-17T05:55:15.000Z | mitty/lib/evcfparse.py | ozemsbg/Mitty | 5fc6ad399c5366442034b59dfd1c0f9bab199a3f | [
"Apache-2.0"
] | 2 | 2016-11-17T01:25:14.000Z | 2017-10-25T10:57:10.000Z | """Functions to help parse an EVCF as we want
Helpful docs:
https://github.com/ga4gh/benchmarking-tools/blob/master/doc/ref-impl/intermediate.md
"""
cat_dict = {
'TPTP': 'TP', # These are all seen in combination with alternate representations
'TP.': 'TP',
'TPFP': 'TP',
'.FP': 'FP',
'FN.': 'FN',
'FNFP... | 22.566038 | 84 | 0.592809 |
9ed4866338d1e9e28245a219fc297a714b7d35f7 | 872 | py | Python | tests/sdk/test_sdk_metrics.py | askanna-io/askanna-python | b6a1dec3b9911888f3d769cef46ce8c2d5cb0dfe | [
"Apache-2.0"
] | 1 | 2021-02-22T15:53:47.000Z | 2021-02-22T15:53:47.000Z | tests/sdk/test_sdk_metrics.py | askanna-io/askanna-python | b6a1dec3b9911888f3d769cef46ce8c2d5cb0dfe | [
"Apache-2.0"
] | null | null | null | tests/sdk/test_sdk_metrics.py | askanna-io/askanna-python | b6a1dec3b9911888f3d769cef46ce8c2d5cb0dfe | [
"Apache-2.0"
] | null | null | null | import unittest
from askanna import track_metric, track_metrics
class SDKMetricsTest(unittest.TestCase):
def setUp(self):
pass
def test_track_metric(self):
track_metric("metricname", "metric_value", "metric_label")
def test_track_metrics(self):
track_metrics(metrics={
... | 26.424242 | 66 | 0.616972 |
7de819e7fe94feee17c1832200bf77ecc10845a6 | 29,643 | py | Python | fiftyone/core/patches.py | Bukkster/fiftyone | c061216de5094131c8ce8718d8a6ac58056b003e | [
"Apache-2.0"
] | 1 | 2022-03-14T02:49:37.000Z | 2022-03-14T02:49:37.000Z | fiftyone/core/patches.py | Bukkster/fiftyone | c061216de5094131c8ce8718d8a6ac58056b003e | [
"Apache-2.0"
] | null | null | null | fiftyone/core/patches.py | Bukkster/fiftyone | c061216de5094131c8ce8718d8a6ac58056b003e | [
"Apache-2.0"
] | null | null | null | """
Patches views.
| Copyright 2017-2022, Voxel51, Inc.
| `voxel51.com <https://voxel51.com/>`_
|
"""
from copy import deepcopy
import eta.core.utils as etau
import fiftyone.core.aggregations as foa
import fiftyone.core.dataset as fod
import fiftyone.core.fields as fof
import fiftyone.core.labels as fol
import fifty... | 32.115926 | 104 | 0.616368 |
c7f28bcb3cdfa358ca325ba1790d9e78121d4f34 | 421 | py | Python | venv/Scripts/pip3-script.py | wlcobb/mysite | 4f30711e0f0219f6abaee1f7519d45f5df8bc71c | [
"MIT"
] | null | null | null | venv/Scripts/pip3-script.py | wlcobb/mysite | 4f30711e0f0219f6abaee1f7519d45f5df8bc71c | [
"MIT"
] | null | null | null | venv/Scripts/pip3-script.py | wlcobb/mysite | 4f30711e0f0219f6abaee1f7519d45f5df8bc71c | [
"MIT"
] | null | null | null | #!C:\Users\wcobb\PycharmProjects\isqa4900\mysite\venv\Scripts\python.exe
# EASY-INSTALL-ENTRY-SCRIPT: 'pip==10.0.1','console_scripts','pip3'
__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)?$', '', s... | 32.384615 | 72 | 0.674584 |
85c9fcbe4b7794bd4251cfecfa4126661d25810e | 4,015 | py | Python | fangyan_tones/scripts/download_wavs.py | wlans4/fangyan_tones | bb108ecf771cdad9acd8a9197e2babaf37c681e1 | [
"Apache-2.0"
] | null | null | null | fangyan_tones/scripts/download_wavs.py | wlans4/fangyan_tones | bb108ecf771cdad9acd8a9197e2babaf37c681e1 | [
"Apache-2.0"
] | null | null | null | fangyan_tones/scripts/download_wavs.py | wlans4/fangyan_tones | bb108ecf771cdad9acd8a9197e2babaf37c681e1 | [
"Apache-2.0"
] | null | null | null | import subprocess
import glob
import time
from fangyan_tones.utils.wav_utils import split_segment, separate_audio
import pathlib
example_songs = [
# "https://youtu.be/OR-0wptI_u0", "https://youtu.be/8CD06hC1KGU",
# "https://youtu.be/wr-6wwt8RXk", "https://youtu.be/nhyT8HDT4lg",
# "https://youtu.be/55yJh4S... | 40.15 | 155 | 0.583562 |
8353cd914552bc9b84be96d9ffb72d300fe0919a | 2,857 | py | Python | model-optimizer/extensions/middle/BiasAddBroadcasting.py | Dimitri1/openvino | 05d97220d21a2ed91377524883485fdadf660761 | [
"Apache-2.0"
] | 3 | 2020-02-09T23:25:37.000Z | 2021-01-19T09:44:12.000Z | model-optimizer/extensions/middle/BiasAddBroadcasting.py | Dimitri1/openvino | 05d97220d21a2ed91377524883485fdadf660761 | [
"Apache-2.0"
] | null | null | null | model-optimizer/extensions/middle/BiasAddBroadcasting.py | Dimitri1/openvino | 05d97220d21a2ed91377524883485fdadf660761 | [
"Apache-2.0"
] | 2 | 2020-04-18T16:24:39.000Z | 2021-01-19T09:42:19.000Z | """
Copyright (c) 2019 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... | 37.592105 | 115 | 0.692685 |
fb1506f9cc9963d802ef2582f1dc3710dbb0c388 | 1,329 | py | Python | pre_commit_hooks/no_commit_to_branch.py | cristianu0612/pre-commit | 9993d9113e24f87cae4e3a2a321efa4dce2aa68e | [
"MIT"
] | 3 | 2020-03-16T11:04:15.000Z | 2020-10-19T19:37:54.000Z | pre_commit_hooks/no_commit_to_branch.py | ozs7/commit_hooks | a6add1c672b641e2b46a9831ace57ccd0749cee8 | [
"MIT"
] | null | null | null | pre_commit_hooks/no_commit_to_branch.py | ozs7/commit_hooks | a6add1c672b641e2b46a9831ace57ccd0749cee8 | [
"MIT"
] | 1 | 2022-01-05T09:54:29.000Z | 2022-01-05T09:54:29.000Z | import argparse
import re
from typing import AbstractSet
from typing import Optional
from typing import Sequence
from pre_commit_hooks.util import CalledProcessError
from pre_commit_hooks.util import cmd_output
def is_on_branch(
protected: AbstractSet[str],
patterns: AbstractSet[str] = frozenset(),
)... | 27.6875 | 78 | 0.653875 |
71fb88a98853f818eab7aa6be746c041076c1fdd | 708 | py | Python | 3Sum Closest.py | cacciatora/LintCode | 8aef1c13346fef95f2a8710efc0447462506d534 | [
"MIT"
] | null | null | null | 3Sum Closest.py | cacciatora/LintCode | 8aef1c13346fef95f2a8710efc0447462506d534 | [
"MIT"
] | null | null | null | 3Sum Closest.py | cacciatora/LintCode | 8aef1c13346fef95f2a8710efc0447462506d534 | [
"MIT"
] | null | null | null | class Solution:
"""
@param numbers: Give an array numbers of n integer
@param target: An integer
@return: return the sum of the three integers, the sum closest target.
"""
def threeSumClosest(self, numbers, target):
numbers.sort()
ans = None
for i in range(len(numbers)):... | 32.181818 | 74 | 0.49435 |
4a3026f2843d69ce80a910a0a1c5978628a1ba2d | 1,743 | py | Python | leetcode_python/Math/minimum-factorization.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | 18 | 2019-08-01T07:45:02.000Z | 2022-03-31T18:05:44.000Z | leetcode_python/Math/minimum-factorization.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Math/minimum-factorization.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | 15 | 2019-12-29T08:46:20.000Z | 2022-03-08T14:14:05.000Z | # leetcode 625. Minimum Factorization
# Given a positive integer a, find the smallest positive integer b whose multiplication of each digit equals to a.
# If there is no answer or the answer is not fit in 32-bit signed integer, then return 0.
# Example 1
# Input:
# 48
# Output:
# 68
# Example 2
# Input:
# 15
... | 22.934211 | 114 | 0.536431 |
184cb4e57c76386833e14fdb82b5e3607b5f06de | 27,084 | py | Python | ixnetwork_restpy/testplatform/sessions/ixnetwork/traffic/trafficitem/configelement/stack/fCoERPNL_template.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 20 | 2019-05-07T01:59:14.000Z | 2022-02-11T05:24:47.000Z | ixnetwork_restpy/testplatform/sessions/ixnetwork/traffic/trafficitem/configelement/stack/fCoERPNL_template.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 60 | 2019-04-03T18:59:35.000Z | 2022-02-22T12:05:05.000Z | ixnetwork_restpy/testplatform/sessions/ixnetwork/traffic/trafficitem/configelement/stack/fCoERPNL_template.py | OpenIxia/ixnetwork_restpy | f628db450573a104f327cf3c737ca25586e067ae | [
"MIT"
] | 13 | 2019-05-20T10:48:31.000Z | 2021-10-06T07:45:44.000Z | from ixnetwork_restpy.base import Base
from ixnetwork_restpy.files import Files
class FCoERPNL(Base):
__slots__ = ()
_SDM_NAME = 'fCoERPNL'
_SDM_ATT_MAP = {
'FcoeHeaderVersion': 'fCoERPNL.header.fcoeHeader.version-1',
'FcoeHeaderReserved': 'fCoERPNL.header.fcoeHeader.reserved-2',
'... | 39.423581 | 531 | 0.668328 |
944d39c4bba2fca3104a9cba6e5e47a6618c3ac8 | 1,028 | py | Python | DepthAI/Nodes/FrameOps/BackgroundSubstractionNode.py | luxonis/DepthAI-PyFlow | 500308bc976f07d114305d7fecb50fe2039f54fe | [
"MIT"
] | 11 | 2020-07-23T08:02:28.000Z | 2021-06-19T16:20:23.000Z | DepthAI/Nodes/FrameOps/BackgroundSubstractionNode.py | luxonis/DepthAI-PyFlow | 500308bc976f07d114305d7fecb50fe2039f54fe | [
"MIT"
] | 2 | 2020-08-14T05:55:21.000Z | 2020-12-29T11:25:30.000Z | DepthAI/Nodes/FrameOps/BackgroundSubstractionNode.py | luxonis/DepthAI-PyFlow | 500308bc976f07d114305d7fecb50fe2039f54fe | [
"MIT"
] | null | null | null | from PyFlow.Core import NodeBase
from PyFlow.Core.Common import *
from PyFlow.Core.NodeBase import NodePinsSuggestionsHelper
from DepthAI.Pins.FramePin import Frame
class BackgroundSubstractionNode(NodeBase):
def __init__(self, name):
super(BackgroundSubstractionNode, self).__init__(name)
self.fr... | 27.783784 | 67 | 0.690661 |
24864bf9600a5672e721b7c56b60dbeb58db27fa | 1,745 | py | Python | tests/baseline/test_seq2seq_data_processor.py | icoxfog417/DialogueBreakdownDetection2016 | 53f88194bf0aacdb17c8132885f6e81e30e78931 | [
"Apache-2.0"
] | 5 | 2016-10-17T07:36:01.000Z | 2020-03-16T12:41:58.000Z | tests/baseline/test_seq2seq_data_processor.py | icoxfog417/DialogueBreakdownDetection2016 | 53f88194bf0aacdb17c8132885f6e81e30e78931 | [
"Apache-2.0"
] | null | null | null | tests/baseline/test_seq2seq_data_processor.py | icoxfog417/DialogueBreakdownDetection2016 | 53f88194bf0aacdb17c8132885f6e81e30e78931 | [
"Apache-2.0"
] | 1 | 2018-12-09T18:38:17.000Z | 2018-12-09T18:38:17.000Z | import unittest
import os
import sys
sys.path.append(os.path.join(os.path.dirname(__file__), "../../"))
import numpy as np
import tensorflow as tf
from model.dataset.loader import Loader
from model.baseline.seq2seq_data_processor import Seq2SeqDataProcessor
class TestSeq2SeqDataProcessor(unittest.TestCase):
def ... | 36.354167 | 93 | 0.652149 |
f202e4096fa222f731a1e83ae0e3dbff68c5b3d8 | 310 | py | Python | flasktest.py | Mewr11/rPi2 | 7d1c08461fbd2a710602318d43743c25afc97fbf | [
"MIT"
] | null | null | null | flasktest.py | Mewr11/rPi2 | 7d1c08461fbd2a710602318d43743c25afc97fbf | [
"MIT"
] | null | null | null | flasktest.py | Mewr11/rPi2 | 7d1c08461fbd2a710602318d43743c25afc97fbf | [
"MIT"
] | null | null | null | '''
Run this test program each time you start up your virtualenv environment.
Please refer to README.md for instructions on how to set up virtualenv.
'''
from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello():
return 'Hello World!'
if __name__ == '__main__':
app.run(debug=True)
| 19.375 | 73 | 0.709677 |
98aaf2fd7e45709e5023b122aa760b365311765f | 25,553 | py | Python | python_server/main.py | SummerSad/cvfood-server | e844c4b2b03eab33052b89405161a3e5def67156 | [
"MIT"
] | 1 | 2022-01-07T12:24:27.000Z | 2022-01-07T12:24:27.000Z | python_server/main.py | SummerSad/cvfood-server | e844c4b2b03eab33052b89405161a3e5def67156 | [
"MIT"
] | null | null | null | python_server/main.py | SummerSad/cvfood-server | e844c4b2b03eab33052b89405161a3e5def67156 | [
"MIT"
] | null | null | null | import os
import sys
import psycopg2
import json
from flask import Flask, request, g
from datetime import date, datetime
app = Flask(__name__)
DATABASE_URL = os.environ['DATABASE_URL']
def get_db():
db = getattr(g, '_database', None)
if db is None:
db = g._database = psycopg2.connect(DATABASE_URL)
... | 34.765986 | 111 | 0.577114 |
8bb452458dee6f10533baa66f2bdeaef6d284520 | 24,224 | py | Python | sdk/python/pulumi_azure_native/containerinstance/v20180901/container_group.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/containerinstance/v20180901/container_group.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/containerinstance/v20180901/container_group.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"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... | 50.153209 | 1,918 | 0.6759 |
f8f02c6ae562e5fce6f0e1c9ba4f94d9a2f29e8a | 2,624 | py | Python | env/lib/python3.6/site-packages/telegram/games/animation.py | rogerscristo/BotFWD | 4f2ab1f4f4543c157ca0a79084536c065f74159f | [
"MIT"
] | null | null | null | env/lib/python3.6/site-packages/telegram/games/animation.py | rogerscristo/BotFWD | 4f2ab1f4f4543c157ca0a79084536c065f74159f | [
"MIT"
] | 3 | 2017-09-01T22:18:30.000Z | 2017-09-01T22:24:57.000Z | env/lib/python3.6/site-packages/telegram/games/animation.py | rogerscristo/BotFWD | 4f2ab1f4f4543c157ca0a79084536c065f74159f | [
"MIT"
] | 3 | 2018-02-22T22:20:27.000Z | 2018-04-22T10:58:24.000Z | #!/usr/bin/env python
#
# A library that provides a Python interface to the Telegram Bot API
# Copyright (C) 2015-2017
# Leandro Toledo de Souza <devs@python-telegram-bot.org>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as publish... | 38.028986 | 98 | 0.646723 |
0aca7bd65efd83ff93b4f7e6bf02579aeece0622 | 684 | py | Python | Python/Syntax/Multiline.py | piovezan/SOpt | a5ec90796b7bdf98f0675457fc4bb99c8695bc40 | [
"MIT"
] | 148 | 2017-08-03T01:49:27.000Z | 2022-03-26T10:39:30.000Z | Python/Syntax/Multiline.py | piovezan/SOpt | a5ec90796b7bdf98f0675457fc4bb99c8695bc40 | [
"MIT"
] | 3 | 2017-11-23T19:52:05.000Z | 2020-04-01T00:44:40.000Z | Python/Syntax/Multiline.py | piovezan/SOpt | a5ec90796b7bdf98f0675457fc4bb99c8695bc40 | [
"MIT"
] | 59 | 2017-08-03T01:49:19.000Z | 2022-03-31T23:24:38.000Z | glossario = {
'concatenar': 'Concatenar é a junção de 2 cadeias de caracteres'
' e que dá origem a uma nova string' \
' que é formada pela junça das 2 partes.',
'identar': 'Indentar é o recuo do texto em relação a sua margem',
'array': 'Arrays são estruturas de dados' \
' sem... | 40.235294 | 73 | 0.638889 |
a4d2a342ada076c8b4a09dfa0ab171326a90fafa | 3,100 | py | Python | official/nlp/keras_nlp/layers/position_embedding.py | TUDelftHao/models | faf0c2dc442ceaa8425aff73abd00f92f3137b7b | [
"Apache-2.0"
] | 1 | 2020-09-28T13:07:19.000Z | 2020-09-28T13:07:19.000Z | official/nlp/keras_nlp/layers/position_embedding.py | TUDelftHao/models | faf0c2dc442ceaa8425aff73abd00f92f3137b7b | [
"Apache-2.0"
] | null | null | null | official/nlp/keras_nlp/layers/position_embedding.py | TUDelftHao/models | faf0c2dc442ceaa8425aff73abd00f92f3137b7b | [
"Apache-2.0"
] | 1 | 2020-09-28T13:07:23.000Z | 2020-09-28T13:07:23.000Z | # Copyright 2020 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 34.831461 | 80 | 0.68871 |
dd23e9bee1c0d79f049b88a48ee3c6c9d066b533 | 8,137 | py | Python | bsuite/baselines/actor_critic_rnn/actor_critic_rnn.py | neale/bsuite | 0430d90bc2d74d604f5a2215bc524de4c614d97e | [
"Apache-2.0"
] | 2 | 2020-03-11T07:32:03.000Z | 2021-02-17T20:19:03.000Z | bsuite/baselines/actor_critic_rnn/actor_critic_rnn.py | neale/bsuite | 0430d90bc2d74d604f5a2215bc524de4c614d97e | [
"Apache-2.0"
] | null | null | null | bsuite/baselines/actor_critic_rnn/actor_critic_rnn.py | neale/bsuite | 0430d90bc2d74d604f5a2215bc524de4c614d97e | [
"Apache-2.0"
] | 1 | 2020-09-06T00:35:43.000Z | 2020-09-06T00:35:43.000Z | # pylint: disable=g-bad-file-header
# Copyright 2019 DeepMind Technologies Limited. 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/... | 38.563981 | 80 | 0.700381 |
1f71676ddcf19b042fd41353f27bbe84a9fc08e9 | 510 | py | Python | backend/hmobiweb/apps/monitoring_solutions/migrations/0005_auto_20210102_1445.py | starkyller/dissertacao | b182b29171942066f59e8d222039a431dd3fe203 | [
"MIT"
] | null | null | null | backend/hmobiweb/apps/monitoring_solutions/migrations/0005_auto_20210102_1445.py | starkyller/dissertacao | b182b29171942066f59e8d222039a431dd3fe203 | [
"MIT"
] | null | null | null | backend/hmobiweb/apps/monitoring_solutions/migrations/0005_auto_20210102_1445.py | starkyller/dissertacao | b182b29171942066f59e8d222039a431dd3fe203 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.4 on 2021-01-02 14:45
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('monitoring_solutions', '0004_auto_20201230_1607'),
]
operations = [
migrations.AlterField(
model_name='solution',
na... | 26.842105 | 154 | 0.656863 |
99db4283c84526306403b4345510597f96d06204 | 11,490 | py | Python | pyfda/filterbroker.py | erdem-kose/pyfda | c1600ae7094df1e64e0aae12db742a3657d99e9f | [
"MIT"
] | 1 | 2021-05-17T21:27:39.000Z | 2021-05-17T21:27:39.000Z | pyfda/filterbroker.py | erdem-kose/pyfda | c1600ae7094df1e64e0aae12db742a3657d99e9f | [
"MIT"
] | null | null | null | pyfda/filterbroker.py | erdem-kose/pyfda | c1600ae7094df1e64e0aae12db742a3657d99e9f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# This file is part of the pyFDA project hosted at https://github.com/chipmuenk/pyfda
#
# Copyright © pyFDA Project Contributors
# Licensed under the terms of the MIT License
# (see file LICENSE in root directory for details)
"""
Dynamic parameters and settings are exchanged via the dictionar... | 44.534884 | 93 | 0.430287 |
1a8ca9482a81c41d4fc86bf3ab96520a834d5bef | 7,622 | py | Python | startup/76-GID.py | NSLS-II-OPLS/profile_collection | 8c1987fc99a477f21d4e879bbc12a8551788fa4f | [
"BSD-3-Clause"
] | null | null | null | startup/76-GID.py | NSLS-II-OPLS/profile_collection | 8c1987fc99a477f21d4e879bbc12a8551788fa4f | [
"BSD-3-Clause"
] | 4 | 2021-01-06T14:51:40.000Z | 2021-01-12T05:32:41.000Z | startup/76-GID.py | NSLS-II-OPLS/profile_collection | 8c1987fc99a477f21d4e879bbc12a8551788fa4f | [
"BSD-3-Clause"
] | null | null | null | def gid_scan_stitch(scan_dict={}, md=None, detector = pilatus300k, alphai = 0.1 ):
"""
Run GID scans
Parameters:
-----------
:param md: Metadata to be recoreded in databroker document
:type md: Dictionnary
:param exp_time: Aexposure time in seconds
:type exp_time: float
:param detec... | 40.115789 | 122 | 0.595644 |
d51375f43d6778391da21cf4c7c48562b02f96e7 | 5,879 | py | Python | aiohttp/client_proto.py | livercat/aiohttp | 7f7b12af3b684396738e52762d64b7eb58e7930c | [
"Apache-2.0"
] | 1 | 2019-03-30T03:58:48.000Z | 2019-03-30T03:58:48.000Z | aiohttp/client_proto.py | livercat/aiohttp | 7f7b12af3b684396738e52762d64b7eb58e7930c | [
"Apache-2.0"
] | null | null | null | aiohttp/client_proto.py | livercat/aiohttp | 7f7b12af3b684396738e52762d64b7eb58e7930c | [
"Apache-2.0"
] | 1 | 2019-03-20T19:34:04.000Z | 2019-03-20T19:34:04.000Z | import asyncio
import asyncio.streams
from contextlib import suppress
from .client_exceptions import (ClientOSError, ClientPayloadError,
ServerDisconnectedError)
from .http import HttpResponseParser
from .streams import EMPTY_PAYLOAD, DataQueue
class ResponseHandler(DataQueue, asyncio... | 31.438503 | 76 | 0.558768 |
88243816b5c153e1b1d5894767a3409a5bb49a8b | 7,836 | py | Python | contrib/bitrpc/bitrpc.py | mybittask/logicrypt | 90fb44ad8ee3394976d73af4eb6f059ed506d4ca | [
"MIT"
] | null | null | null | contrib/bitrpc/bitrpc.py | mybittask/logicrypt | 90fb44ad8ee3394976d73af4eb6f059ed506d4ca | [
"MIT"
] | null | null | null | contrib/bitrpc/bitrpc.py | mybittask/logicrypt | 90fb44ad8ee3394976d73af4eb6f059ed506d4ca | [
"MIT"
] | null | null | null | from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:9458")
else:
access = Ser... | 24.110769 | 79 | 0.668198 |
af1496a3531af46af8dce839d874edbc70d3d740 | 1,173 | py | Python | Db2Db.py | djjohns/postgres_examples | c3e54dfa870e4cb457272beef8f4fc17d85c30c6 | [
"MIT"
] | null | null | null | Db2Db.py | djjohns/postgres_examples | c3e54dfa870e4cb457272beef8f4fc17d85c30c6 | [
"MIT"
] | null | null | null | Db2Db.py | djjohns/postgres_examples | c3e54dfa870e4cb457272beef8f4fc17d85c30c6 | [
"MIT"
] | null | null | null | import pandas as pd
from apply_sql_template import apply_sql_template
from engines.conns import Thor, Odin
from sql.test_tbl_sql import select_all_messages, select_all
class Db2Db():
''' Uses pandas to move a copy a table from on db to another.
Expects src_db as a sqlalchemy conn, query as a str, target_tbl a... | 34.5 | 133 | 0.684569 |
e8c0ae1d6f66457f70c4fa8d615e8cf65b198030 | 1,525 | py | Python | setup.py | arthurbarros/haystack | 886f5ba90ed15aecd10c509a8e57334eefcf69c2 | [
"Apache-2.0"
] | null | null | null | setup.py | arthurbarros/haystack | 886f5ba90ed15aecd10c509a8e57334eefcf69c2 | [
"Apache-2.0"
] | null | null | null | setup.py | arthurbarros/haystack | 886f5ba90ed15aecd10c509a8e57334eefcf69c2 | [
"Apache-2.0"
] | null | null | null | from io import open
from setuptools import find_packages, setup
with open("requirements.txt") as f:
parsed_requirements = f.read().splitlines()
# remove blank lines, comments and links to specific git commits
parsed_requirements = [
x.strip()
for x in parsed_requirements
if ((x.strip()[0] != "#") and ... | 41.216216 | 146 | 0.690492 |
a32fa4a4d6737ed64e5be47ef22415e74f293ddd | 3,148 | py | Python | leads/migrations/0001_initial.py | exenin/Django-CRM | 009461beb2279590c656465c6b47cd2e1e5aaa70 | [
"MIT"
] | 2 | 2019-11-06T07:57:13.000Z | 2019-11-06T07:57:15.000Z | leads/migrations/0001_initial.py | exenin/Django-CRM | 009461beb2279590c656465c6b47cd2e1e5aaa70 | [
"MIT"
] | 8 | 2020-06-05T20:58:52.000Z | 2022-03-11T23:48:48.000Z | leads/migrations/0001_initial.py | exenin/Django-CRM | 009461beb2279590c656465c6b47cd2e1e5aaa70 | [
"MIT"
] | 5 | 2020-03-21T09:55:05.000Z | 2020-04-03T06:51:02.000Z | # Generated by Django 2.1.2 on 2019-01-28 07:07
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import phonenumber_field.modelfields
class Migration(migrations.Migration):
initial = True
dependencies = [
('accounts', '0001_initial'),
... | 64.244898 | 319 | 0.641042 |
e2c02b22dbd82c2da3b63378030ea08b07013775 | 129 | py | Python | djangojobboard/core/admin.py | jnnnn1999/Online-Thai-Video-Content-Search-System | a3291ec340d97f6dea3b23ad311692dedb72db60 | [
"MIT"
] | null | null | null | djangojobboard/core/admin.py | jnnnn1999/Online-Thai-Video-Content-Search-System | a3291ec340d97f6dea3b23ad311692dedb72db60 | [
"MIT"
] | null | null | null | djangojobboard/core/admin.py | jnnnn1999/Online-Thai-Video-Content-Search-System | a3291ec340d97f6dea3b23ad311692dedb72db60 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import File, Transcribe
admin.site.register(File)
admin.site.register(Transcribe) | 21.5 | 36 | 0.821705 |
e4802cc1d7217bac5c0e5e2c91a6799dc28b7613 | 1,498 | py | Python | integrationtest/vm/virtualrouter/volume/test_crt_vm_2_volumes.py | sherry546/zstack-woodpecker | 54a37459f2d72ce6820974feaa6eb55772c3d2ce | [
"Apache-2.0"
] | 2 | 2016-03-23T08:45:44.000Z | 2017-06-26T02:40:46.000Z | integrationtest/vm/virtualrouter/volume/test_crt_vm_2_volumes.py | KevinDavidMitnick/zstack-woodpecker | 96257faaf3c362168d008bdb47002025ad669b24 | [
"Apache-2.0"
] | null | null | null | integrationtest/vm/virtualrouter/volume/test_crt_vm_2_volumes.py | KevinDavidMitnick/zstack-woodpecker | 96257faaf3c362168d008bdb47002025ad669b24 | [
"Apache-2.0"
] | 2 | 2020-03-12T03:11:28.000Z | 2021-07-26T01:57:58.000Z | '''
Create a VM with 2 additional data volumes
@author: Youyk
'''
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.test_lib as test_lib
import zstackwoodpecker.test_state as test_state
import os
test_stub = test_lib.lib_get_test_stub()
test_obj_dict = test_state.TestStateDict()
... | 39.421053 | 174 | 0.742991 |
fb490a0d80c784abbe0f537455b362099b34797a | 4,086 | py | Python | src/app/Ticket.py | reside-ic/youtrack-integration | c94f2dabf9c217b5d97b6a01520400ddfe5997e4 | [
"MIT"
] | 2 | 2020-03-16T21:45:18.000Z | 2020-09-16T07:24:48.000Z | src/app/Ticket.py | reside-ic/youtrack-integration | c94f2dabf9c217b5d97b6a01520400ddfe5997e4 | [
"MIT"
] | null | null | null | src/app/Ticket.py | reside-ic/youtrack-integration | c94f2dabf9c217b5d97b6a01520400ddfe5997e4 | [
"MIT"
] | null | null | null |
class Ticket:
def __init__(self, payload, yt_api, gh_api, users_dict):
self.payload = payload
self.action = payload["action"]
self.yt_api = yt_api
self.gh_api = gh_api
self.users_dict = users_dict
self.pr = payload["pull_request"]
self.url = self.pr["html_ur... | 40.86 | 79 | 0.514929 |
3987f0a93f4769f9f650289c58da09495bfdb766 | 717 | py | Python | renormalizer/tests/parameter_exact.py | liwt31/Renormalizer | 123a9d53f4f5f32c0088c255475f0ee60d02c745 | [
"Apache-2.0"
] | null | null | null | renormalizer/tests/parameter_exact.py | liwt31/Renormalizer | 123a9d53f4f5f32c0088c255475f0ee60d02c745 | [
"Apache-2.0"
] | null | null | null | renormalizer/tests/parameter_exact.py | liwt31/Renormalizer | 123a9d53f4f5f32c0088c255475f0ee60d02c745 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import numpy as np
from renormalizer.mps import Mpo
from renormalizer.model import Phonon, Mol, MolList
from renormalizer.utils import Quantity
from renormalizer.utils.qutip_utils import get_clist, get_blist, get_hamiltonian, get_gs
OMEGA = 1
DISPLACEMENT = 1
N_LEVELS = 2
N_SITES = 3
J = 1
p... | 27.576923 | 88 | 0.757322 |
f12e6b1494f310a05b6cb2ebf4f3613bda286ba8 | 1,335 | py | Python | serverless_functions/aws/python/face_recognition/image_recognition/image_recognition.py | francescom412/ServerlessFlowBench | 798008f8399bb500940f7b675e31190b6f1201df | [
"ISC"
] | null | null | null | serverless_functions/aws/python/face_recognition/image_recognition/image_recognition.py | francescom412/ServerlessFlowBench | 798008f8399bb500940f7b675e31190b6f1201df | [
"ISC"
] | null | null | null | serverless_functions/aws/python/face_recognition/image_recognition/image_recognition.py | francescom412/ServerlessFlowBench | 798008f8399bb500940f7b675e31190b6f1201df | [
"ISC"
] | null | null | null | import boto3
import urllib.request as request
REKOGNITION_CLIENT = boto3.client("rekognition")
# noinspection DuplicatedCode,PyUnusedLocal
def lambda_handler(event, context):
# search for url in request
url = None
if event.get('queryStringParameters') is not None:
if 'url' in event['queryStringParameters']:
... | 21.885246 | 113 | 0.701124 |
3ecd8a96de18bfa76c37ab4a078a573324799532 | 5,742 | py | Python | KwikCluster/KwikCluster.py | benbo/QPR_CP1 | 107e74ae1bf759ddf2e714210f1cd94e4e1bdb14 | [
"Apache-2.0"
] | 1 | 2016-04-29T15:13:04.000Z | 2016-04-29T15:13:04.000Z | KwikCluster/KwikCluster.py | benbo/QPR_CP1 | 107e74ae1bf759ddf2e714210f1cd94e4e1bdb14 | [
"Apache-2.0"
] | null | null | null | KwikCluster/KwikCluster.py | benbo/QPR_CP1 | 107e74ae1bf759ddf2e714210f1cd94e4e1bdb14 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from copy import deepcopy
import cProfile
from MinHash import MinHash
from MinHash import Banding
import sys
import getopt
from numpy import Inf
__author__ = 'Matt Barnes'
def main(argv):
number_hash_functions = 200
threshold = 0.9
header_lines = 0
number_threads = 1
max_li... | 38.797297 | 155 | 0.655869 |
29180655d185ed13d7664c88e5146f70da253bbb | 2,294 | py | Python | helpers/environment_control.py | Matesxs/CarlaSimulator-Playground | 981c4badcf49849a926374da04d214e75328c0f4 | [
"MIT"
] | 1 | 2021-09-30T20:59:32.000Z | 2021-09-30T20:59:32.000Z | helpers/environment_control.py | Matesxs/CarlaSimulator-Playground | 981c4badcf49849a926374da04d214e75328c0f4 | [
"MIT"
] | null | null | null | helpers/environment_control.py | Matesxs/CarlaSimulator-Playground | 981c4badcf49849a926374da04d214e75328c0f4 | [
"MIT"
] | null | null | null | import carla
import time
import atexit
import sys
import os
import subprocess
import psutil
import settings
from helpers.logger import init_logger
logger = init_logger("ENV Controll", False)
def operating_system():
logger.debug(os.name)
return 'windows' if os.name == 'nt' else 'linux'
def get_binary():
return... | 28.320988 | 249 | 0.707498 |
578d43bedd0261a4bb3ce4e77a46f8589228fcb8 | 6,739 | py | Python | docs/conf.py | mbenlioglu/mst | 4f06eb5e488f3925a2418249d3e76e3c0f5a8b16 | [
"MIT"
] | null | null | null | docs/conf.py | mbenlioglu/mst | 4f06eb5e488f3925a2418249d3e76e3c0f5a8b16 | [
"MIT"
] | null | null | null | docs/conf.py | mbenlioglu/mst | 4f06eb5e488f3925a2418249d3e76e3c0f5a8b16 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file does only contain a selection of the most common options. For a
# full list see the documentation:
# http://www.sphinx-doc.org/en/master/config
# -- Path setup ------------------------------------------------------------... | 31.344186 | 108 | 0.644754 |
1ab8597938a1757d47749be0ef073c863bb3d54b | 400 | py | Python | lgsmcp/controlpanel/urls.py | Denperidge/LinuxGSM-Controlpanel | e5b936b18ef2b4f4c4784f8eca1de0a668927fae | [
"MIT"
] | 1 | 2021-09-25T20:47:08.000Z | 2021-09-25T20:47:08.000Z | lgsmcp/controlpanel/urls.py | Denperidge/LinuxGSM-Controlpanel | e5b936b18ef2b4f4c4784f8eca1de0a668927fae | [
"MIT"
] | 1 | 2020-07-31T11:18:44.000Z | 2020-07-31T11:18:44.000Z | lgsmcp/controlpanel/urls.py | Denperidge/LinuxGSM-Controlpanel | e5b936b18ef2b4f4c4784f8eca1de0a668927fae | [
"MIT"
] | 2 | 2021-05-21T22:13:01.000Z | 2021-12-28T20:13:02.000Z | from django.urls import path
from . import views
urlpatterns = [
path('', views.index, name='cp-index'), # Index page with information about gameserver
path('lgsm/', views.lgsm, name='cp-lgsm'),
path('login/', views.loginToGameserver, name='cp-login'), # Allow to log into gameserver
path('logout/', ... | 40 | 98 | 0.6925 |
3e566297d6da6df41f20a23a5a07ddda76e5ffe4 | 251 | py | Python | mcpipy/mcpi/settings.py | sprintingkiwi/pycraft_mod | a1ce8817ccff3e701aa787a2e531df5a6cc8f887 | [
"MIT"
] | 15 | 2017-08-27T15:33:19.000Z | 2021-05-05T07:30:57.000Z | pycraft_minetest-0.7/pycraft_minetest/settings.py | Lopastudio/complete-builder-for-minetest | 23f1bca1f2aa87146c759ad3e8e5b8d62aec57a4 | [
"MIT"
] | 2 | 2018-11-30T19:56:02.000Z | 2021-09-24T05:20:39.000Z | pycraft_minetest-0.7/pycraft_minetest/settings.py | Lopastudio/complete-builder-for-minetest | 23f1bca1f2aa87146c759ad3e8e5b8d62aec57a4 | [
"MIT"
] | 4 | 2018-05-10T19:37:06.000Z | 2019-09-02T19:28:14.000Z | from os import environ
MINECRAFT_POCKET_EDITION = 0
MINECRAFT_PI = 1
MINECRAFT_DESKTOP = 2
minecraftType = MINECRAFT_DESKTOP
try:
minecraftType = int(environ['MINECRAFT_TYPE'])
except:
pass
isPE = ( minecraftType != MINECRAFT_DESKTOP )
| 15.6875 | 51 | 0.752988 |
0542bed660c8644ddac7b752d9fce069b3cbbc9a | 344 | py | Python | chapter15/asyncrates.py | haru-256/ExpertPython3_Source | 5ef412ef217c6078248ff9546e23ed9b69aadcff | [
"MIT"
] | 9 | 2021-07-30T07:57:55.000Z | 2021-12-30T12:38:21.000Z | chapter15/asyncrates.py | haru-256/ExpertPython3_Source | 5ef412ef217c6078248ff9546e23ed9b69aadcff | [
"MIT"
] | null | null | null | chapter15/asyncrates.py | haru-256/ExpertPython3_Source | 5ef412ef217c6078248ff9546e23ed9b69aadcff | [
"MIT"
] | 2 | 2021-09-05T11:39:50.000Z | 2021-09-17T05:27:37.000Z | import aiohttp
ACCESS_KEY = '<ACCESS_KEY>'
async def get_rates(session: aiohttp.ClientSession, base: str):
async with session.get(
f"http://api.exchangeratesapi.io/latest?access_key={ACCESS_KEY}&base={base}"
) as response:
rates = (await response.json())['rates']
rates[base] = 1.
... | 24.571429 | 84 | 0.65407 |
8bc4333711e0870bf84bb9c96797769dc56467ff | 3,381 | py | Python | fairseq/optim/nag.py | aiboxlab/TSPNet | 359402151afd262857cde6fae3fc13445d73c9a7 | [
"MIT"
] | 83 | 2020-10-11T04:44:52.000Z | 2022-01-11T13:59:50.000Z | fairseq/optim/nag.py | aiboxlab/TSPNet | 359402151afd262857cde6fae3fc13445d73c9a7 | [
"MIT"
] | 9 | 2020-12-12T10:12:00.000Z | 2021-03-28T16:05:08.000Z | fairseq/optim/nag.py | aiboxlab/TSPNet | 359402151afd262857cde6fae3fc13445d73c9a7 | [
"MIT"
] | 11 | 2020-12-17T13:38:56.000Z | 2022-03-12T23:39:41.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import torch
from torch.optim.optimizer import Optimizer, required
from . import FairseqOptimizer, register_optimizer
@register_... | 33.475248 | 97 | 0.5664 |
ed4525ddfa7995d5f167fc7c18ec430af4784c0d | 3,288 | py | Python | rllib/utils/tf_run_builder.py | hershg/ray | a1744f67fe954d8408c5b84e28ecccc130157f8e | [
"Apache-2.0"
] | 12 | 2020-10-15T08:11:50.000Z | 2021-12-11T03:10:47.000Z | rllib/utils/tf_run_builder.py | hershg/ray | a1744f67fe954d8408c5b84e28ecccc130157f8e | [
"Apache-2.0"
] | 4 | 2019-03-04T13:03:24.000Z | 2019-06-06T11:25:07.000Z | rllib/utils/tf_run_builder.py | hershg/ray | a1744f67fe954d8408c5b84e28ecccc130157f8e | [
"Apache-2.0"
] | 2 | 2021-01-28T09:53:11.000Z | 2021-10-03T17:29:41.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import os
import time
from ray.rllib.utils.debug import log_once
from ray.rllib.utils import try_import_tf
tf = try_import_tf()
logger = logging.getLogger(__name__)
class TFRunBuilder(object)... | 34.25 | 79 | 0.62135 |
221780602eb58951079b5de3241c9eba9caef01d | 12,675 | py | Python | tests/genomic_file/test_genomic_file_resources.py | ConnorBarnhill/kf-api-dataservice | 547df467a307788882469a25c947a14965a26336 | [
"Apache-2.0"
] | null | null | null | tests/genomic_file/test_genomic_file_resources.py | ConnorBarnhill/kf-api-dataservice | 547df467a307788882469a25c947a14965a26336 | [
"Apache-2.0"
] | null | null | null | tests/genomic_file/test_genomic_file_resources.py | ConnorBarnhill/kf-api-dataservice | 547df467a307788882469a25c947a14965a26336 | [
"Apache-2.0"
] | null | null | null | import json
import pytest
from unittest.mock import MagicMock, patch
from requests.exceptions import HTTPError
from flask import url_for
from urllib.parse import urlencode
from dataservice.extensions import db
from dataservice.api.study.models import Study
from dataservice.api.participant.models import Participant
fr... | 31.296296 | 80 | 0.641262 |
8142d72e0a08875cf5ac08afccdd48868ecffa41 | 1,975 | py | Python | function_autoencoder_decoder_gru/plot_tfrecords.py | knicko/tf-lstm-sinus | 912b64fe8c68fa592c6118a202c80eafd89a6634 | [
"MIT"
] | null | null | null | function_autoencoder_decoder_gru/plot_tfrecords.py | knicko/tf-lstm-sinus | 912b64fe8c68fa592c6118a202c80eafd89a6634 | [
"MIT"
] | null | null | null | function_autoencoder_decoder_gru/plot_tfrecords.py | knicko/tf-lstm-sinus | 912b64fe8c68fa592c6118a202c80eafd89a6634 | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
from time import sleep
import pandas as pd
import matplotlib.pyplot as plt
import config
tfrecords_filename = config.data_tmp_folder + config.data_tfrecord_filename
record_iterator = tf.python_io.tf_record_iterator(path=tfrecords_filename)
for string_record in record_iterato... | 33.474576 | 78 | 0.622278 |
f35080b16f0a453e4317e541fa21eaaae2c23852 | 2,882 | py | Python | code/api/enrich.py | CiscoSecurity/tr-05-serverless-palo-alto-autofocus | eb9ffbaed1fc8bd49c3f2a5db77229d7441c3716 | [
"MIT"
] | null | null | null | code/api/enrich.py | CiscoSecurity/tr-05-serverless-palo-alto-autofocus | eb9ffbaed1fc8bd49c3f2a5db77229d7441c3716 | [
"MIT"
] | 3 | 2020-12-15T15:40:51.000Z | 2021-01-25T10:56:01.000Z | code/api/enrich.py | CiscoSecurity/tr-05-serverless-palo-alto-autofocus | eb9ffbaed1fc8bd49c3f2a5db77229d7441c3716 | [
"MIT"
] | null | null | null | from concurrent.futures.thread import ThreadPoolExecutor
from functools import partial
from flask import Blueprint, g, current_app
from api.client import ApiClient
from api.entities import Entity, SOURCE_NAME
from api.schemas import ObservableSchema
from api.utils import (
get_json,
get_api_key,
jsonify_d... | 26.440367 | 78 | 0.637405 |
822852956267e97c1f65835ca2ef71773139a6bd | 925 | py | Python | frappe/data_migration/doctype/data_migration_connector/connectors/frappe_connection.py | oryxsolutions/frappe | d193ea22d17ca40d57432040a8afad72287d9e23 | [
"MIT"
] | null | null | null | frappe/data_migration/doctype/data_migration_connector/connectors/frappe_connection.py | oryxsolutions/frappe | d193ea22d17ca40d57432040a8afad72287d9e23 | [
"MIT"
] | null | null | null | frappe/data_migration/doctype/data_migration_connector/connectors/frappe_connection.py | oryxsolutions/frappe | d193ea22d17ca40d57432040a8afad72287d9e23 | [
"MIT"
] | null | null | null | import frappe
from frappe.frappeclient import FrappeClient
from .base import BaseConnection
class FrappeConnection(BaseConnection):
def __init__(self, connector):
self.connector = connector
self.connection = FrappeClient(
self.connector.hostname, self.connector.username, self.get_password()
)
self.name_f... | 28.030303 | 92 | 0.757838 |
b22039dcef991749b99f7ffb6945fb6e20a0affa | 850 | py | Python | Code Examples/Guessing Game.py | bensk/cs11 | 58658bc308be61167324a7f051b03497440f7e7f | [
"MIT"
] | null | null | null | Code Examples/Guessing Game.py | bensk/cs11 | 58658bc308be61167324a7f051b03497440f7e7f | [
"MIT"
] | null | null | null | Code Examples/Guessing Game.py | bensk/cs11 | 58658bc308be61167324a7f051b03497440f7e7f | [
"MIT"
] | null | null | null | user_name = raw_input("What's your name? \n").capitalize()
print "Hello there " + user_name
upper_bound = int(raw_input("What's the largest number you'd like to choose? \n"))
from random import randint
answer = randint(0, upper_bound)
print "Ok, now choose a number between 1 and " + str(upper_bound)
guess = int(raw... | 32.692308 | 116 | 0.651765 |
9aea18a9d2a600334667cc5c8ad48a94c78d5f65 | 6,294 | py | Python | tests/apps/app1/http/routes/api.py | coboyoshi/uvicore | 9cfdeeac83000b156fe48f068b4658edaf51c8de | [
"MIT"
] | 11 | 2021-03-22T22:07:49.000Z | 2022-03-08T16:18:33.000Z | tests/apps/app1/http/routes/api.py | coboyoshi/uvicore | 9cfdeeac83000b156fe48f068b4658edaf51c8de | [
"MIT"
] | 12 | 2021-03-04T05:51:24.000Z | 2021-09-22T05:16:18.000Z | tests/apps/app1/http/routes/api.py | coboyoshi/uvicore | 9cfdeeac83000b156fe48f068b4658edaf51c8de | [
"MIT"
] | 2 | 2021-03-25T14:49:56.000Z | 2021-11-17T23:20:29.000Z | import uvicore
from uvicore.support.dumper import dump, dd
from uvicore.http import Request, response
from uvicore.http.routing import Routes, ApiRouter, ModelRouter
from app1.models.post import Post
#from uvicore.auth.middleware import Guard
from uvicore.http.routing import Guard
from uvicore.auth.models import Use... | 27.726872 | 110 | 0.54258 |
4aa91960a1fd525a589359342fb2e04106f305ee | 6,722 | py | Python | st2reactor/st2reactor/rules/tester.py | shusugmt/st2 | 31da26badfb4ca3fb3e8cae07cfeec4791191afd | [
"Apache-2.0"
] | 1 | 2020-11-09T21:05:33.000Z | 2020-11-09T21:05:33.000Z | st2reactor/st2reactor/rules/tester.py | ellerbrock/st2 | b3a0d9f82053c1fd5adb616dc8331bad427cd11f | [
"Apache-2.0"
] | 3 | 2021-03-25T23:57:10.000Z | 2021-03-26T00:01:05.000Z | st2reactor/st2reactor/rules/tester.py | ellerbrock/st2 | b3a0d9f82053c1fd5adb616dc8331bad427cd11f | [
"Apache-2.0"
] | null | null | null | # Licensed to the StackStorm, Inc ('StackStorm') under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use th... | 42.0125 | 99 | 0.661708 |
488045b1e45ba2e3f2c94f7585f13de6974c7914 | 9,440 | py | Python | location_register/converter/ratu.py | OlexandrTopuzov/Data_converter | 0ac2319ccaae790af35ab2202724c65d83d32ecc | [
"MIT"
] | null | null | null | location_register/converter/ratu.py | OlexandrTopuzov/Data_converter | 0ac2319ccaae790af35ab2202724c65d83d32ecc | [
"MIT"
] | null | null | null | location_register/converter/ratu.py | OlexandrTopuzov/Data_converter | 0ac2319ccaae790af35ab2202724c65d83d32ecc | [
"MIT"
] | null | null | null | import logging
import requests
from django.conf import settings
from django.utils import timezone
from data_ocean.converter import Converter, BulkCreateManager
from data_ocean.downloader import Downloader
from data_ocean.models import Register
from data_ocean.utils import clean_name, change_to_full_name
from location... | 43.302752 | 113 | 0.614619 |
8be65774812b9141088b806cb961ef67dc47a103 | 23 | py | Python | scripts/lc/support/__init__.py | ouankou/rose | 76f2a004bd6d8036bc24be2c566a14e33ba4f825 | [
"BSD-3-Clause"
] | 488 | 2015-01-09T08:54:48.000Z | 2022-03-30T07:15:46.000Z | scripts/lc/support/__init__.py | ouankou/rose | 76f2a004bd6d8036bc24be2c566a14e33ba4f825 | [
"BSD-3-Clause"
] | 174 | 2015-01-28T18:41:32.000Z | 2022-03-31T16:51:05.000Z | scripts/lc/support/__init__.py | ouankou/rose | 76f2a004bd6d8036bc24be2c566a14e33ba4f825 | [
"BSD-3-Clause"
] | 146 | 2015-04-27T02:48:34.000Z | 2022-03-04T07:32:53.000Z | __author__ = 'charles'
| 11.5 | 22 | 0.73913 |
2ae28ed3f6a509b8e0b59b7cae8a8d251604eb68 | 1,511 | py | Python | tatk/policy/mle/multiwoz/train.py | libing125/tatk | 1473a162cf45a4a40a60473169bc034234412b2e | [
"Apache-2.0"
] | 81 | 2019-03-12T13:40:29.000Z | 2022-01-17T10:59:21.000Z | tatk/policy/mle/multiwoz/train.py | zqwerty/tatk | fafabc45d02ad889f59354acac4e3b1367e7d4bf | [
"Apache-2.0"
] | 35 | 2019-03-13T14:05:05.000Z | 2021-08-25T15:38:14.000Z | tatk/policy/mle/multiwoz/train.py | zqwerty/tatk | fafabc45d02ad889f59354acac4e3b1367e7d4bf | [
"Apache-2.0"
] | 41 | 2019-03-13T09:40:24.000Z | 2022-03-07T17:59:07.000Z | import os
import torch
import logging
import json
import sys
root_dir = os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))))
sys.path.append(root_dir)
from tatk.policy.rlmodule import MultiDiscretePolicy
from tatk.policy.vector.vector_multiwoz import MultiWozVe... | 37.775 | 121 | 0.724686 |
e43e90762123b580d235dde0ab7dd970b090f57a | 252 | py | Python | demo03.py | rexzhang2014/mypydemo | 33468bd346bbfdfa8ae35ae99d6ad66b3adb6a82 | [
"Apache-2.0"
] | null | null | null | demo03.py | rexzhang2014/mypydemo | 33468bd346bbfdfa8ae35ae99d6ad66b3adb6a82 | [
"Apache-2.0"
] | null | null | null | demo03.py | rexzhang2014/mypydemo | 33468bd346bbfdfa8ae35ae99d6ad66b3adb6a82 | [
"Apache-2.0"
] | null | null | null | import time
cases = [
'range(10)', # 0-9
'range(1,10)', # 1-10
'range(1,10,2)', # 1,3,5,7,9
'range(10,0,-1)', # 10-1
]
for c in cases :
l = [i for i in eval(c)]
print('Output of {} is : {}'.format(c, l))
time.sleep(0.5)
| 16.8 | 46 | 0.472222 |
0130ed07e3a654c104f3b64c211ec0d77c452d9f | 7,375 | py | Python | manila/api/v1/router.py | vponomaryov/manila | ffe135a5b35a0964179f0dc148d569037f26a929 | [
"Apache-2.0"
] | null | null | null | manila/api/v1/router.py | vponomaryov/manila | ffe135a5b35a0964179f0dc148d569037f26a929 | [
"Apache-2.0"
] | null | null | null | manila/api/v1/router.py | vponomaryov/manila | ffe135a5b35a0964179f0dc148d569037f26a929 | [
"Apache-2.0"
] | null | null | null | # Copyright 2011 OpenStack LLC.
# Copyright 2011 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the... | 43.639053 | 78 | 0.592407 |
b2bdc6f88e3b6d5c7ef2288ddeef6b01eddbd7d0 | 796 | py | Python | tests/plugins/test_albavision.py | xcgx/streamlink | b635e0d9d0fe9363817a96ec7d31faefed95cb57 | [
"BSD-2-Clause"
] | 6 | 2020-11-13T22:48:09.000Z | 2021-03-05T14:38:40.000Z | tests/plugins/test_albavision.py | xcgx/streamlink | b635e0d9d0fe9363817a96ec7d31faefed95cb57 | [
"BSD-2-Clause"
] | 3 | 2020-04-07T18:40:42.000Z | 2020-09-23T15:43:18.000Z | tests/plugins/test_albavision.py | xcgx/streamlink | b635e0d9d0fe9363817a96ec7d31faefed95cb57 | [
"BSD-2-Clause"
] | 3 | 2021-10-10T12:30:16.000Z | 2022-03-03T12:51:38.000Z | import unittest
from streamlink.plugins.albavision import Albavision
from tests.plugins import PluginCanHandleUrl
class TestPluginCanHandleUrlAlbavision(PluginCanHandleUrl):
__plugin__ = Albavision
should_match = [
"https://www.elnueve.com.ar/en-vivo",
"http://www.rts.com.ec/envivo",
... | 29.481481 | 96 | 0.690955 |
b9196e598d34668f0bc8a5a2329c8d2bfdd6d499 | 1,789 | py | Python | e2e/Libs/RandomX.py | rikublock/Meros | 7a3ae9c78af388eb523bc8a2c840018fc058ef44 | [
"CC0-1.0"
] | null | null | null | e2e/Libs/RandomX.py | rikublock/Meros | 7a3ae9c78af388eb523bc8a2c840018fc058ef44 | [
"CC0-1.0"
] | null | null | null | e2e/Libs/RandomX.py | rikublock/Meros | 7a3ae9c78af388eb523bc8a2c840018fc058ef44 | [
"CC0-1.0"
] | 1 | 2021-02-08T23:46:35.000Z | 2021-02-08T23:46:35.000Z | #Types.
from typing import Any
#CTypes.
from ctypes import cdll, c_int, c_char, \
Array, c_char_p, c_void_p, create_string_buffer, byref
#OS standard lib.
import os
#Import the RandomX library.
#pylint: disable=invalid-name
RandomXLib: Any
if os.name == "nt":
RandomXLib = cdll.LoadLibrary("e2e/Libs/mc_r... | 30.322034 | 92 | 0.787591 |
1e7fcd623defc11b6c29984b33933b9e55517b21 | 25,216 | py | Python | main.py | ambimanus/demand-response-cohda | 29b03f9fb264cd1e169ed2ed9a895df9558cb214 | [
"MIT"
] | 1 | 2017-05-04T16:18:23.000Z | 2017-05-04T16:18:23.000Z | main.py | ambimanus/demand-response-cohda | 29b03f9fb264cd1e169ed2ed9a895df9558cb214 | [
"MIT"
] | null | null | null | main.py | ambimanus/demand-response-cohda | 29b03f9fb264cd1e169ed2ed9a895df9558cb214 | [
"MIT"
] | 1 | 2020-07-26T18:07:31.000Z | 2020-07-26T18:07:31.000Z | # coding=utf8
from __future__ import division
import sys
import os
import copy
import pickle
import datetime
import numpy as np
import scipy as sp
import scipy.linalg as la
# import scipy.io as sio
import configuration
# import stats
# import analyze
from WindGen import import_M2
from cohda import uvic as cohda
fro... | 41.817579 | 130 | 0.616196 |
37ca91916338b4baf1a396480a5e34dd50c5c163 | 2,121 | py | Python | Tutorials/Intro_To_NN/NNDL-solutions/code/chap6p4-9/display_transformed_image.py | lev1khachatryan/ASDS_CV | c9f0c0412002e929bcb7cc2fc6e5392977a9fa76 | [
"MIT"
] | 5 | 2019-12-13T16:26:10.000Z | 2020-01-10T07:44:05.000Z | Tutorials/Intro_To_NN/NNDL-solutions/code/chap6p4-9/display_transformed_image.py | lev1khachatryan/ASDS_CV | c9f0c0412002e929bcb7cc2fc6e5392977a9fa76 | [
"MIT"
] | 1 | 2020-01-07T16:48:21.000Z | 2020-03-18T18:43:37.000Z | Tutorials/Intro_To_NN/NNDL-solutions/code/chap6p4-9/display_transformed_image.py | lev1khachatryan/ASDS_CV | c9f0c0412002e929bcb7cc2fc6e5392977a9fa76 | [
"MIT"
] | null | null | null | import network3
import numpy as np
import scipy
import matplotlib.pyplot as plt
import PIL
training_data, _, _ = network3.load_data_shared()
training_x, training_y = training_data
x = training_x.get_value()[0] # vector corresponding to a 5
x_img = np.reshape(x, (-1, 28)) # recognizable 5
y = training_y.eval()[0] # ... | 34.209677 | 75 | 0.614804 |
0efd0ce427410b47fdc7e457ba933336fc014b8d | 29,121 | py | Python | tests/test_base.py | Styria-Digital/django-unload | 96ecc548045726374a9b1a40c3a76ee8a5242a2f | [
"BSD-2-Clause"
] | 16 | 2016-07-05T11:55:41.000Z | 2020-07-08T07:17:45.000Z | tests/test_base.py | Styria-Digital/django-unload | 96ecc548045726374a9b1a40c3a76ee8a5242a2f | [
"BSD-2-Clause"
] | 13 | 2016-07-06T13:01:11.000Z | 2019-05-29T14:13:26.000Z | tests/test_base.py | Styria-Digital/django-unload | 96ecc548045726374a9b1a40c3a76ee8a5242a2f | [
"BSD-2-Clause"
] | 2 | 2018-07-30T18:38:48.000Z | 2021-03-14T20:33:27.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import os
from django.apps import apps
from django.conf import settings
from django.test import TestCase
from django.test.utils import override_settings
from unload.base import Template
from unload.utils import get_contents
class TestBase(TestCase):
... | 46.444976 | 79 | 0.623811 |
8e7df8844d93cc84b09a736016b07c70d83b92ff | 7,365 | py | Python | app/db/crud/whitelist_events.py | noob77777/ergopad-api | 50e822b4e54a210688664ca209afcdd09c1bfc2d | [
"MIT"
] | null | null | null | app/db/crud/whitelist_events.py | noob77777/ergopad-api | 50e822b4e54a210688664ca209afcdd09c1bfc2d | [
"MIT"
] | 23 | 2022-03-09T11:31:32.000Z | 2022-03-31T08:53:27.000Z | app/db/crud/whitelist_events.py | noob77777/ergopad-api | 50e822b4e54a210688664ca209afcdd09c1bfc2d | [
"MIT"
] | 2 | 2022-02-16T03:40:05.000Z | 2022-02-16T22:40:15.000Z | from fastapi import status
from sqlalchemy.orm import Session
from starlette.responses import JSONResponse
from db.models import whitelistEvents, events
from db.schemas import whitelistEvents as schema
############################################
### CRUD OPERATIONS FOR WHITELIST EVENTS ###
###########################... | 38.968254 | 136 | 0.685947 |
e03b1f705e0ba2d50e1a58a9689b5357150346f7 | 8,024 | py | Python | examples/yolov3/darknet.py | LDOUBLEV/hapi | 1b2e866edca6ff3aa4bd32c96ca5082b1cab426f | [
"Apache-2.0"
] | null | null | null | examples/yolov3/darknet.py | LDOUBLEV/hapi | 1b2e866edca6ff3aa4bd32c96ca5082b1cab426f | [
"Apache-2.0"
] | null | null | null | examples/yolov3/darknet.py | LDOUBLEV/hapi | 1b2e866edca6ff3aa4bd32c96ca5082b1cab426f | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserve.
#
#Licensed under the Apache License, Version 2.0 (the "License");
#you may not use this file except in compliance with the License.
#You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
#Unless required by applicable... | 33.433333 | 121 | 0.585867 |
f4a30a3213140edbfccec740fe93c9074428a75e | 2,110 | py | Python | strava/formatters.py | bwilczynski/strava-cli | 54e05663f897bb710e886b4d834eca940b0c4378 | [
"MIT"
] | 15 | 2019-01-24T21:20:13.000Z | 2022-03-16T23:17:43.000Z | strava/formatters.py | bwilczynski/strava-cli | 54e05663f897bb710e886b4d834eca940b0c4378 | [
"MIT"
] | 7 | 2020-01-10T06:43:29.000Z | 2021-09-23T19:07:20.000Z | strava/formatters.py | bwilczynski/strava-cli | 54e05663f897bb710e886b4d834eca940b0c4378 | [
"MIT"
] | 10 | 2019-05-09T17:51:16.000Z | 2022-03-16T23:17:56.000Z | import math
import re
from datetime import datetime, timezone
import click
from strava import emoji
import strava.settings
N_A = "N/A"
KM_TO_MI = 0.6213712
def format_seconds(seconds):
if seconds > 3600:
mins = math.floor(seconds / 60)
return f"{math.floor(mins / 60):.0f}h {mins % 60:.0f}m"
... | 24.534884 | 77 | 0.652607 |
de2402952f751e0b17738a09e54a4d3c09addbf6 | 14,969 | py | Python | tests/basics/BuiltinsTest.py | juanfra684/Nuitka | 0e276895fadabefb598232f2ccf8cc7736c9a85b | [
"Apache-2.0"
] | 1 | 2020-04-13T18:56:02.000Z | 2020-04-13T18:56:02.000Z | tests/basics/BuiltinsTest.py | juanfra684/Nuitka | 0e276895fadabefb598232f2ccf8cc7736c9a85b | [
"Apache-2.0"
] | 1 | 2020-07-11T17:53:56.000Z | 2020-07-11T17:53:56.000Z | tests/basics/BuiltinsTest.py | juanfra684/Nuitka | 0e276895fadabefb598232f2ccf8cc7736c9a85b | [
"Apache-2.0"
] | null | null | null | # Copyright 2020, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python tests originally created or extracted from other peoples work. The
# parts were too small to be protected.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the ... | 22.013235 | 88 | 0.636115 |
876a4cda5892201b4d6bbdea44dedb686e7b7585 | 5,630 | py | Python | msgraph-cli-extensions/v1_0/sites_v1_0/azext_sites_v1_0/vendored_sdks/sites/aio/operations/_sites_onenote_section_groups_sections_parent_notebook_operations.py | thewahome/msgraph-cli | 33127d9efa23a0e5f5303c93242fbdbb73348671 | [
"MIT"
] | null | null | null | msgraph-cli-extensions/v1_0/sites_v1_0/azext_sites_v1_0/vendored_sdks/sites/aio/operations/_sites_onenote_section_groups_sections_parent_notebook_operations.py | thewahome/msgraph-cli | 33127d9efa23a0e5f5303c93242fbdbb73348671 | [
"MIT"
] | null | null | null | msgraph-cli-extensions/v1_0/sites_v1_0/azext_sites_v1_0/vendored_sdks/sites/aio/operations/_sites_onenote_section_groups_sections_parent_notebook_operations.py | thewahome/msgraph-cli | 33127d9efa23a0e5f5303c93242fbdbb73348671 | [
"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 may ... | 50.267857 | 216 | 0.710302 |
cd4e6c2d22434a996c3f440698029e94ae223e7b | 1,874 | py | Python | scripts/end_to_end_test/smart_contract_tests/init_owner_address.py | chr15murray/ledger | 85be05221f19598de8c6c58652139a1f2d9e362f | [
"Apache-2.0"
] | 96 | 2018-08-23T16:49:05.000Z | 2021-11-25T00:47:16.000Z | scripts/end_to_end_test/smart_contract_tests/init_owner_address.py | chr15murray/ledger | 85be05221f19598de8c6c58652139a1f2d9e362f | [
"Apache-2.0"
] | 1,011 | 2018-08-17T12:25:21.000Z | 2021-11-18T09:30:19.000Z | scripts/end_to_end_test/smart_contract_tests/init_owner_address.py | chr15murray/ledger | 85be05221f19598de8c6c58652139a1f2d9e362f | [
"Apache-2.0"
] | 65 | 2018-08-20T20:05:40.000Z | 2022-02-26T23:54:35.000Z | # ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# 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
#
# htt... | 30.721311 | 90 | 0.664888 |
ab856c3119e39789fce3a810589c29e54f85c322 | 3,997 | py | Python | EQUATIONS/FOR_RESOLUTION_STUDY/MomentumXResolutionStudy.py | mmicromegas/ransX | 2faaa786e00cfd14dce0e18f0793cd0252428d2a | [
"BSD-2-Clause"
] | 4 | 2019-04-22T11:43:47.000Z | 2020-09-16T00:28:15.000Z | EQUATIONS/FOR_RESOLUTION_STUDY/MomentumXResolutionStudy.py | mmicromegas/ransX | 2faaa786e00cfd14dce0e18f0793cd0252428d2a | [
"BSD-2-Clause"
] | 34 | 2019-07-01T09:11:00.000Z | 2022-03-30T13:35:43.000Z | EQUATIONS/FOR_RESOLUTION_STUDY/MomentumXResolutionStudy.py | mmicromegas/ransX | 2faaa786e00cfd14dce0e18f0793cd0252428d2a | [
"BSD-2-Clause"
] | 1 | 2020-09-16T00:28:17.000Z | 2020-09-16T00:28:17.000Z | import numpy as np
from scipy import integrate
import matplotlib.pyplot as plt
from UTILS.Calculus import Calculus
from UTILS.SetAxisLimit import SetAxisLimit
from UTILS.Tools import Tools
from UTILS.Errors import Errors
import sys
# Theoretical background https://arxiv.org/abs/1401.5176
# Mocak, Meakin, Viallet, Ar... | 29.828358 | 112 | 0.567676 |
30d1d4343e77e488fdd7fa537e4c8663670c44f6 | 1,693 | py | Python | rasa/nlu/convert.py | sarvex/rasa | ac1197b3f80071bb213d4fa66d5d24b4fc01e30e | [
"Apache-2.0"
] | 1 | 2021-08-02T03:42:30.000Z | 2021-08-02T03:42:30.000Z | rasa/nlu/convert.py | sarvex/rasa | ac1197b3f80071bb213d4fa66d5d24b4fc01e30e | [
"Apache-2.0"
] | 79 | 2021-08-19T09:49:24.000Z | 2022-03-14T12:10:54.000Z | rasa/nlu/convert.py | sarvex/rasa | ac1197b3f80071bb213d4fa66d5d24b4fc01e30e | [
"Apache-2.0"
] | 1 | 2021-07-19T12:59:26.000Z | 2021-07-19T12:59:26.000Z | import argparse
import os
from typing import Text, Union
from rasa.shared.utils.cli import print_error
import rasa.shared.nlu.training_data.loading
from rasa.nlu.utils import write_to_file
def convert_training_data(
data_file: Union[list, Text], out_file: Text, output_format: Text, language: Text
) -> None:
... | 32.557692 | 85 | 0.655641 |
172df9f22a58958c1219670bdce63a73f94ee3b1 | 658 | py | Python | src/my_project/easy_problems/from201to250/largest_perimeter_triangle.py | ivan1016017/LeetCodeAlgorithmProblems | 454284b76634cc34ed41f7fa30d857403cedf1bf | [
"MIT"
] | null | null | null | src/my_project/easy_problems/from201to250/largest_perimeter_triangle.py | ivan1016017/LeetCodeAlgorithmProblems | 454284b76634cc34ed41f7fa30d857403cedf1bf | [
"MIT"
] | 1 | 2021-09-22T12:26:14.000Z | 2021-09-22T12:26:14.000Z | src/my_project/easy_problems/from201to250/largest_perimeter_triangle.py | ivan1016017/LeetCodeAlgorithmProblems | 454284b76634cc34ed41f7fa30d857403cedf1bf | [
"MIT"
] | null | null | null | from typing import List
class Solution:
def largestPerimeter(self, nums: List[int]) -> int:
nums.sort(reverse=True)
len_nums: int = len(nums)
answer: int = 0
for i in range(2,len_nums):
if nums[i-2] - nums[i-1] <nums[i]:
answer = nums[i... | 23.5 | 56 | 0.554711 |
de12cf8a8923fb90cbe75385245640fce76d68d5 | 2,661 | py | Python | conway.py | mxmeinhold/py-video-conway | c492b09d4f954c049c833d5bceb2238ae3eb1d03 | [
"MIT"
] | null | null | null | conway.py | mxmeinhold/py-video-conway | c492b09d4f954c049c833d5bceb2238ae3eb1d03 | [
"MIT"
] | null | null | null | conway.py | mxmeinhold/py-video-conway | c492b09d4f954c049c833d5bceb2238ae3eb1d03 | [
"MIT"
] | null | null | null | """ Conway's game of life """
from copy import deepcopy
import random
from typing import Any, Literal
import itertools
from functools import cache
Option = Literal[0, 1]
class Conway:
""" An implementation of a board for Conway's game of life
Attributes:
rows: int - the number of rows in the grid
... | 31.678571 | 89 | 0.545284 |
e4d6e6df3eb56fa433a48d8ad9e73804562dfe0c | 5,056 | py | Python | functional_node_sort.py | Debraj2399/Zebra | ef33fb287f6a6f76ad947fe9df90c154268d4b5d | [
"MIT"
] | 4 | 2021-03-04T10:44:56.000Z | 2021-05-05T11:37:00.000Z | functional_node_sort.py | Debraj2399/Zebra | ef33fb287f6a6f76ad947fe9df90c154268d4b5d | [
"MIT"
] | null | null | null | functional_node_sort.py | Debraj2399/Zebra | ef33fb287f6a6f76ad947fe9df90c154268d4b5d | [
"MIT"
] | 2 | 2021-03-04T10:58:23.000Z | 2021-03-11T11:38:44.000Z | import config as con
def functional_indexing():
###########################################################################################################################
for output_node_index in range(len(con.OUTPUT_NODE)):
for node_traverse in con.NODE_DATA:
if con.OUTPUT_NODE[output_node_index]... | 38.892308 | 132 | 0.560127 |
a473f0861c2222cd493872f7b2b32715c1ca919e | 18,143 | py | Python | clouddq/main.py | pbalm/cloud-data-quality | b106a5705fa3b6592a1acbfca5f32776919293c2 | [
"Apache-2.0"
] | 1 | 2021-11-07T15:03:33.000Z | 2021-11-07T15:03:33.000Z | clouddq/main.py | ant-laz/cloud-data-quality | 2f41ec692e7a0ec8988bb8e715fcf5e926fa47be | [
"Apache-2.0"
] | null | null | null | clouddq/main.py | ant-laz/cloud-data-quality | 2f41ec692e7a0ec8988bb8e715fcf5e926fa47be | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 36.801217 | 85 | 0.649562 |
060155dd519651c39a78417883b98b7ee35e9e01 | 947 | py | Python | src/djangotoolbox/setup.py | adamjmcgrath/glancydesign | 826ede7c639879d5b79ee730eb5e91422768cb02 | [
"BSD-3-Clause"
] | 1 | 2020-04-21T02:52:25.000Z | 2020-04-21T02:52:25.000Z | src/djangotoolbox/setup.py | adamjmcgrath/glancydesign | 826ede7c639879d5b79ee730eb5e91422768cb02 | [
"BSD-3-Clause"
] | null | null | null | src/djangotoolbox/setup.py | adamjmcgrath/glancydesign | 826ede7c639879d5b79ee730eb5e91422768cb02 | [
"BSD-3-Clause"
] | null | null | null | from setuptools import setup, find_packages
DESCRIPTION = "Djangotoolbox for Django-nonrel"
LONG_DESCRIPTION = None
try:
LONG_DESCRIPTION = open('README.rst').read()
except:
pass
CLASSIFIERS = [
'Development Status :: 4 - Beta',
'Intended Audience :: Developers',
'Operating System :: OS Independe... | 27.852941 | 68 | 0.670539 |
3ffac6eba2728778ed746c144032e80da0182eb2 | 39,253 | py | Python | antipetros_discordbot/auxiliary_classes/aux_server_classes/server_item.py | official-antistasi-community/Antipetros_Discord_Bot | 1b5c8b61c09e61cdff671e259f0478d343a50c8d | [
"MIT"
] | null | null | null | antipetros_discordbot/auxiliary_classes/aux_server_classes/server_item.py | official-antistasi-community/Antipetros_Discord_Bot | 1b5c8b61c09e61cdff671e259f0478d343a50c8d | [
"MIT"
] | null | null | null | antipetros_discordbot/auxiliary_classes/aux_server_classes/server_item.py | official-antistasi-community/Antipetros_Discord_Bot | 1b5c8b61c09e61cdff671e259f0478d343a50c8d | [
"MIT"
] | 1 | 2021-02-12T01:10:51.000Z | 2021-02-12T01:10:51.000Z | """
[summary]
[extended_summary]
"""
# region [Imports]
import gc
from copy import deepcopy
import asyncio
import unicodedata
import discord
from enum import Enum, auto, unique
import os
from textwrap import indent, dedent
import re
from asyncstdlib import map as async_map
from typing import TYPE_CHECKING, Union, I... | 44.504535 | 228 | 0.642652 |
d15a800c56607eb757d4771cd3dc457539b3acdb | 36,426 | py | Python | keras/layers/core.py | ProgArt/stock_quant_keras | 9a58f7b29026270afbec58c9255750b527ceff27 | [
"MIT"
] | 9 | 2018-06-28T12:52:00.000Z | 2020-09-25T10:32:43.000Z | keras/layers/core.py | WeixiaoGao/keras | 29a22a8d59b5e2c4282f1e7f664d82595049eb9d | [
"MIT"
] | null | null | null | keras/layers/core.py | WeixiaoGao/keras | 29a22a8d59b5e2c4282f1e7f664d82595049eb9d | [
"MIT"
] | 7 | 2018-07-02T08:55:46.000Z | 2020-04-25T20:59:49.000Z | # -*- coding: utf-8 -*-
"""Core Keras layers.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import copy
import types as python_types
import warnings
from .. import backend as K
from .. import activations
from .. import initializers... | 38.464625 | 139 | 0.615961 |
472c0f554869d4cca10595252bb6e9df8b356597 | 2,597 | py | Python | tests/modules/test_games.py | Repu379/expecto-botronum | 42c69a6f2dd8a692280b18dd74f522df2f675061 | [
"MIT"
] | null | null | null | tests/modules/test_games.py | Repu379/expecto-botronum | 42c69a6f2dd8a692280b18dd74f522df2f675061 | [
"MIT"
] | null | null | null | tests/modules/test_games.py | Repu379/expecto-botronum | 42c69a6f2dd8a692280b18dd74f522df2f675061 | [
"MIT"
] | null | null | null | """test_games.py
tests for games
by Annika"""
import dummies
import games
class TestGames():
"""Test the games module
"""
module = games.Module()
connection = dummies.DummyConnection()
def testReversio(self) -> None:
"""Tests the reversio commands
"""
self.module.r... | 34.626667 | 86 | 0.606469 |
7778e1fb40d4b3a2692eee984669d0e9d0f09c13 | 189 | py | Python | src/goto/config.py | siddhantrao23/goto | e927edcaabc87ee44fcf438b7775689c4c4fbbc8 | [
"MIT"
] | null | null | null | src/goto/config.py | siddhantrao23/goto | e927edcaabc87ee44fcf438b7775689c4c4fbbc8 | [
"MIT"
] | null | null | null | src/goto/config.py | siddhantrao23/goto | e927edcaabc87ee44fcf438b7775689c4c4fbbc8 | [
"MIT"
] | null | null | null | '''Configuration for goto'''
STYLE = {
'fg': 'green'
}
DETAIL = {
'fg': 'green',
'bold': True
}
ERROR = {
'fg': 'red',
'bold': True
}
BORING = {
'fg': 'white'
}
| 9.45 | 28 | 0.444444 |
56b7bba671d1618db6c70593ec3de5ee52a28e4a | 39,690 | py | Python | nb2plots/nbplots.py | frenzymadness/nb2plots | 1762fd81ae29362ad86f70bf21019137f6dffb26 | [
"BSD-2-Clause"
] | 32 | 2015-11-27T16:56:35.000Z | 2020-07-26T14:53:55.000Z | nb2plots/nbplots.py | frenzymadness/nb2plots | 1762fd81ae29362ad86f70bf21019137f6dffb26 | [
"BSD-2-Clause"
] | 18 | 2017-07-28T16:42:38.000Z | 2022-03-02T12:55:04.000Z | nb2plots/nbplots.py | frenzymadness/nb2plots | 1762fd81ae29362ad86f70bf21019137f6dffb26 | [
"BSD-2-Clause"
] | 8 | 2017-05-01T18:03:42.000Z | 2022-02-28T11:12:32.000Z | """
A directive for including a matplotlib plot in a Sphinx document.
This directive is based on the ``plot`` directive of matplotlib, with thanks.
By default, in HTML output, `nbplot` will include a .png file with a
link to a high-res .png and .pdf. In LaTeX output, it will include a
.pdf.
The source code for the ... | 36.016334 | 80 | 0.616024 |
47be39c68e583600820824b7b34ac3cb8e471eaa | 15,712 | py | Python | tests/components/media_player/test_cast.py | don66/home-assistant | a277470363c0758bb305410aad49c257ff8bac40 | [
"Apache-2.0"
] | 7 | 2018-08-03T10:15:36.000Z | 2019-03-25T13:31:55.000Z | tests/components/media_player/test_cast.py | sara0871/https-wakatime.com-android-studio | 5a15b2c036b332c17d5f6a06664378e9273d684f | [
"Apache-2.0"
] | 3 | 2021-09-08T03:06:43.000Z | 2022-03-12T00:56:04.000Z | tests/components/media_player/test_cast.py | sara0871/https-wakatime.com-android-studio | 5a15b2c036b332c17d5f6a06664378e9273d684f | [
"Apache-2.0"
] | 3 | 2018-12-04T11:54:27.000Z | 2019-08-31T14:41:32.000Z | """The tests for the Cast Media player platform."""
# pylint: disable=protected-access
import asyncio
from typing import Optional
from unittest.mock import patch, MagicMock, Mock
from uuid import UUID
import attr
import pytest
from homeassistant.exceptions import PlatformNotReady
from homeassistant.helpers.typing imp... | 37.678657 | 79 | 0.701693 |
6c0e96029e2a6dfd5dd3525b86713d41350dfee0 | 3,422 | py | Python | visualisation.py | MarvinCS/DNS_Sniffer | aa40dde0f1e4d10588bb94e117e2d5c4376970a2 | [
"MIT"
] | 6 | 2018-09-18T17:54:55.000Z | 2020-04-11T22:46:30.000Z | visualisation.py | MarvinCS/DNS_Sniffer | aa40dde0f1e4d10588bb94e117e2d5c4376970a2 | [
"MIT"
] | null | null | null | visualisation.py | MarvinCS/DNS_Sniffer | aa40dde0f1e4d10588bb94e117e2d5c4376970a2 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
from db import Connection_handler
class Pie_Chart:
"""This class contains methods to generate pie-charts based on matplotlib"""
@staticmethod
def showTopTenDomains():
"""Creates a pie chart with the top ten domains"""
labels, sizes = Pie_Chart.__getTopTenDo... | 38.022222 | 106 | 0.651373 |
1a36246171e1728f2a83ede57369262117ec3274 | 17,617 | py | Python | django/core/validators.py | nik0811/django | f3a87912c37defe3961f61c3b53cbf4c2e2f14fc | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | django/core/validators.py | nik0811/django | f3a87912c37defe3961f61c3b53cbf4c2e2f14fc | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | django/core/validators.py | nik0811/django | f3a87912c37defe3961f61c3b53cbf4c2e2f14fc | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | import ipaddress
import os
import re
from urllib.parse import urlsplit, urlunsplit
from django.core.exceptions import ValidationError
from django.utils.deconstruct import deconstructible
from django.utils.functional import SimpleLazyObject
from django.utils.ipv6 import is_valid_ipv6_address
from django.utils.translati... | 34.816206 | 110 | 0.597945 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.