hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | 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 209 | max_issues_repo_name stringlengths 5 121 | 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 209 | max_forks_repo_name stringlengths 5 121 | 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 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
c2d39d4d749c9482c344224df0f938e773e45df9 | 1,019 | py | Python | practice_python/23_file_overlap.py | facmartoni/python_exercises | 7f05c7491a0eee05e32f04c7f07ddc1ba688b7a2 | [
"Apache-2.0"
] | null | null | null | practice_python/23_file_overlap.py | facmartoni/python_exercises | 7f05c7491a0eee05e32f04c7f07ddc1ba688b7a2 | [
"Apache-2.0"
] | null | null | null | practice_python/23_file_overlap.py | facmartoni/python_exercises | 7f05c7491a0eee05e32f04c7f07ddc1ba688b7a2 | [
"Apache-2.0"
] | 1 | 2021-10-11T00:25:14.000Z | 2021-10-11T00:25:14.000Z | # Given two .txt files that have lists of numbers in them, find the numbers that are overlapping.
# One .txt file has a list of all prime numbers under 1000, and the other .txt file has a list of happy numbers up to 1000.
# (If you forgot, prime numbers are numbers that can’t be divided by any other number.
# And yes,... | 30.878788 | 123 | 0.680079 |
1ca3ba2bf5bb1106e1cf3210f12210bbbbb5a86d | 1,049 | py | Python | catkin_ws/src/cam_proc/src/LED_dummy_image.py | pokeypokeypokey/nsrc-perception-challenge | 6015c5d2562f72e23e46b40e796b8615e3283abf | [
"MIT"
] | null | null | null | catkin_ws/src/cam_proc/src/LED_dummy_image.py | pokeypokeypokey/nsrc-perception-challenge | 6015c5d2562f72e23e46b40e796b8615e3283abf | [
"MIT"
] | null | null | null | catkin_ws/src/cam_proc/src/LED_dummy_image.py | pokeypokeypokey/nsrc-perception-challenge | 6015c5d2562f72e23e46b40e796b8615e3283abf | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import roslib
roslib.load_manifest('cam_proc')
import rospy
from sensor_msgs.msg import Image
import cv2
from cv_bridge import CvBridge, CvBridgeError
import os
TEST_IMAGE_PATH = "/development/test_data/single_camera_images/red_409_380.png"
def dummy_LED_image():
pub = rospy.Publisher("/mul... | 26.897436 | 90 | 0.683508 |
f5cf5b1945f926d8a39aa33524788d053b078365 | 12,984 | py | Python | tests/test_modeling_blenderbot_small.py | johntiger1/transformers | 38fadb6faf30c103531fa5fcd52b3f110e7582d0 | [
"Apache-2.0"
] | 3 | 2021-06-17T16:32:40.000Z | 2021-08-31T09:00:08.000Z | tests/test_modeling_blenderbot_small.py | johntiger1/transformers | 38fadb6faf30c103531fa5fcd52b3f110e7582d0 | [
"Apache-2.0"
] | null | null | null | tests/test_modeling_blenderbot_small.py | johntiger1/transformers | 38fadb6faf30c103531fa5fcd52b3f110e7582d0 | [
"Apache-2.0"
] | 1 | 2021-06-17T16:32:43.000Z | 2021-06-17T16:32:43.000Z | # coding=utf-8
# Copyright 2021, The HuggingFace Inc. team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | 40.448598 | 123 | 0.705253 |
ab9c98de48dccc56f96727da1763ca402b398685 | 343 | py | Python | dgdynamic/__init__.py | Ezbob/dgDynamic | 394de1c138c1517c4cdfead879c43db189752d92 | [
"MIT"
] | null | null | null | dgdynamic/__init__.py | Ezbob/dgDynamic | 394de1c138c1517c4cdfead879c43db189752d92 | [
"MIT"
] | null | null | null | dgdynamic/__init__.py | Ezbob/dgDynamic | 394de1c138c1517c4cdfead879c43db189752d92 | [
"MIT"
] | null | null | null | """
dgdynamic - A python 3 package for dynamic simulation on deviation graph created by the MØD framework.
Written by Anders Busch (2017).
"""
from .mod_dynamics import dgDynamicSim, show_plots
from .structures import HyperGraph
from .utils.exceptions import SimulationError, ModelError
__all__ = ["dgDynamicSim", "show... | 34.3 | 102 | 0.790087 |
0cac0f53e16d44db0c493d1a39d4098c0b0b8c5e | 3,110 | py | Python | demo/live.py | Certseeds/ssd.pytorch | 0a93714114c24a44623b9f03951bee283f524f3a | [
"MIT"
] | null | null | null | demo/live.py | Certseeds/ssd.pytorch | 0a93714114c24a44623b9f03951bee283f524f3a | [
"MIT"
] | null | null | null | demo/live.py | Certseeds/ssd.pytorch | 0a93714114c24a44623b9f03951bee283f524f3a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# coding=utf-8
from __future__ import print_function
import torch
from torch.autograd import Variable
import cv2
import time
from imutils.video import FPS, WebcamVideoStream
import argparse
parser = argparse.ArgumentParser(description='Single Shot MultiBox Detection')
parser.add_argument('--weig... | 33.085106 | 78 | 0.573955 |
95d07171b4802b10a8f2d2ba9ebbe70780c5e35a | 995 | py | Python | setup.py | africlouds/Messaging | 57dcb58b661a1f16c69834dd828e5e63cf16d082 | [
"MIT"
] | 1 | 2021-07-01T11:27:33.000Z | 2021-07-01T11:27:33.000Z | setup.py | africlouds/Messaging | 57dcb58b661a1f16c69834dd828e5e63cf16d082 | [
"MIT"
] | null | null | null | setup.py | africlouds/Messaging | 57dcb58b661a1f16c69834dd828e5e63cf16d082 | [
"MIT"
] | 1 | 2021-07-01T11:27:34.000Z | 2021-07-01T11:27:34.000Z | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from pip.req import parse_requirements
import re, ast
# get version from __version__ variable in messaging/__init__.py
_version_re = re.compile(r'__version__\s+=\s+(.*)')
with open('messaging/__init__.py', 'rb') as f:
version = str(ast.literal_ev... | 36.851852 | 230 | 0.728643 |
ea8afe5e0e91bd0b0ca1d1d50c222af8bd0c49dd | 8,273 | py | Python | utils/media2warc.py | nwoodward/twarc | 4c7ff253ffdfd46a493ca1fcd75e6446667ae832 | [
"MIT"
] | 1 | 2018-12-02T22:52:52.000Z | 2018-12-02T22:52:52.000Z | utils/media2warc.py | nwoodward/twarc | 4c7ff253ffdfd46a493ca1fcd75e6446667ae832 | [
"MIT"
] | 1 | 2016-03-28T22:03:34.000Z | 2016-04-11T18:57:25.000Z | utils/media2warc.py | nwoodward/twarc | 4c7ff253ffdfd46a493ca1fcd75e6446667ae832 | [
"MIT"
] | 1 | 2020-05-23T18:44:52.000Z | 2020-05-23T18:44:52.000Z | #!/usr/bin/env python
"""
This utility extracts media urls from tweet jsonl.gz and save them as warc records.
Warcio (https://github.com/webrecorder/warcio) is a dependency and before you can use it you need to:
% pip install warcio
You run it like this:
% python media2warc.py /mnt/tweets/ferguson/tweets-0001.jsonl... | 32.190661 | 142 | 0.600749 |
650d17f99391efd14de471b9df77c04f06482666 | 12,343 | py | Python | 5.Transformer/Transformer_Greedy.py | YCEternity/NLP_Base_Model | b194796427bb32611e9c41f1344ae38192530e27 | [
"Apache-2.0"
] | null | null | null | 5.Transformer/Transformer_Greedy.py | YCEternity/NLP_Base_Model | b194796427bb32611e9c41f1344ae38192530e27 | [
"Apache-2.0"
] | null | null | null | 5.Transformer/Transformer_Greedy.py | YCEternity/NLP_Base_Model | b194796427bb32611e9c41f1344ae38192530e27 | [
"Apache-2.0"
] | null | null | null | # -*-coding:utf-8-*-
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import matplotlib.pyplot as plt
def make_batch():
input_batch = [[src_vocab[n] for n in sentences[0].split()]]
output_batch = [[tgt_vocab[n] for n in sentences[1].split()]]
target_batch = [[... | 45.884758 | 124 | 0.643199 |
c5e91afafeb383d94ece9b6536ae374ce5782ea8 | 1,747 | py | Python | deafwave/util/validate_alert.py | SparXalt/deafwave-blockchain | 579eac55d55285f750c622bf66a1aa30ed6d949d | [
"Apache-2.0"
] | null | null | null | deafwave/util/validate_alert.py | SparXalt/deafwave-blockchain | 579eac55d55285f750c622bf66a1aa30ed6d949d | [
"Apache-2.0"
] | null | null | null | deafwave/util/validate_alert.py | SparXalt/deafwave-blockchain | 579eac55d55285f750c622bf66a1aa30ed6d949d | [
"Apache-2.0"
] | null | null | null | import json
from pathlib import Path
from blspy import AugSchemeMPL, PublicKeyMPL, SignatureMPL
from deafwave.util.byte_types import hexstr_to_bytes
from deafwave.util.hash import std_hash
def validate_alert_file(file_path: Path, pubkey: str) -> bool:
text = file_path.read_text()
validated = validate_alert(... | 33.596154 | 83 | 0.724671 |
fb35181c19dd846564a94e233ff9fdb8eefe0532 | 19,496 | py | Python | raiden/tests/unit/transfer/test_node.py | christianbrb/raiden | 64f0715af076747b293671157e2cbbd235cab81b | [
"MIT"
] | null | null | null | raiden/tests/unit/transfer/test_node.py | christianbrb/raiden | 64f0715af076747b293671157e2cbbd235cab81b | [
"MIT"
] | 1 | 2019-12-06T16:34:40.000Z | 2019-12-06T16:34:40.000Z | raiden/tests/unit/transfer/test_node.py | jomuel/raiden | 8e3a1e57ebc112171cc6236e09657f32a89f8f3b | [
"MIT"
] | null | null | null | import copy
import pytest
import raiden.transfer.node
from raiden.constants import LOCKSROOT_OF_NO_LOCKS
from raiden.settings import GAS_LIMIT
from raiden.tests.unit.test_channelstate import create_channel_from_models, create_model
from raiden.tests.utils import factories
from raiden.tests.utils.factories import (
... | 40.786611 | 99 | 0.773133 |
b6e3596d0c9378f8ca66f64ec5d54ace7e710a77 | 2,656 | py | Python | setup.py | bertrandda/cfn-lint | a5bea43961974622bc2f49598f73b026b7fa9b80 | [
"MIT-0"
] | null | null | null | setup.py | bertrandda/cfn-lint | a5bea43961974622bc2f49598f73b026b7fa9b80 | [
"MIT-0"
] | null | null | null | setup.py | bertrandda/cfn-lint | a5bea43961974622bc2f49598f73b026b7fa9b80 | [
"MIT-0"
] | null | null | null | """
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: MIT-0
"""
import codecs
import re
from setuptools import find_packages
from setuptools import setup
def get_version(filename):
with codecs.open(filename, 'r', 'utf-8') as fp:
contents = fp.read()
return re.... | 31.619048 | 79 | 0.595633 |
286db1e5d29d75a827338d58d6fffdaa2d312195 | 202 | py | Python | chattenge/users/tests/test_models.py | kvaldivia/chattenge | c307657a3f91a982882f0942bd27320e0736420e | [
"BSD-3-Clause"
] | null | null | null | chattenge/users/tests/test_models.py | kvaldivia/chattenge | c307657a3f91a982882f0942bd27320e0736420e | [
"BSD-3-Clause"
] | 2 | 2022-03-01T04:05:25.000Z | 2022-03-02T04:04:56.000Z | chattenge/users/tests/test_models.py | kvaldivia/chattenge | c307657a3f91a982882f0942bd27320e0736420e | [
"BSD-3-Clause"
] | null | null | null | import pytest
from chattenge.users.models import User
pytestmark = pytest.mark.django_db
def test_user_get_absolute_url(user: User):
assert user.get_absolute_url() == f"/users/{user.username}/"
| 20.2 | 64 | 0.772277 |
5a0eea4d59ff519e6a1c3625157b14c768bc1950 | 4,262 | py | Python | ryu/lib/packet/arp.py | w180112/ryu | aadb6609f585c287b4928db9462baf72c6410718 | [
"Apache-2.0"
] | 975 | 2015-01-03T02:30:13.000Z | 2020-05-07T14:01:48.000Z | ryu/lib/packet/arp.py | DiegoRossiMafioletti/ryu | 6f906e72c92e10bd0264c9b91a2f7bb85b97780c | [
"Apache-2.0"
] | 66 | 2020-05-22T21:55:42.000Z | 2022-03-31T12:35:04.000Z | ryu/lib/packet/arp.py | DiegoRossiMafioletti/ryu | 6f906e72c92e10bd0264c9b91a2f7bb85b97780c | [
"Apache-2.0"
] | 763 | 2015-01-01T03:38:43.000Z | 2020-05-06T15:46:09.000Z | # Copyright (C) 2012 Nippon Telegraph and Telephone 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 appli... | 38.396396 | 79 | 0.583763 |
af2d9077320fe8e676816967b275fa6e99079f0c | 3,843 | py | Python | pythia/pyre/weaver/Weaver.py | willic3/pythia | 2657b95a0c07fd3c914ab6b5f7ec89a8edba004c | [
"BSD-3-Clause"
] | 1 | 2015-11-30T08:01:39.000Z | 2015-11-30T08:01:39.000Z | pythia/pyre/weaver/Weaver.py | willic3/pythia | 2657b95a0c07fd3c914ab6b5f7ec89a8edba004c | [
"BSD-3-Clause"
] | 27 | 2018-05-24T18:31:25.000Z | 2021-10-16T03:57:52.000Z | pythia/pyre/weaver/Weaver.py | willic3/pythia | 2657b95a0c07fd3c914ab6b5f7ec89a8edba004c | [
"BSD-3-Clause"
] | 7 | 2019-07-19T02:30:56.000Z | 2021-06-02T22:00:01.000Z | #!/usr/bin/env python
#
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Michael A.G. Aivazis
# California Institute of Technology
# (C) 1998-2005 All Rights Reserved
#
# <LicenseText>
#
# ~~~~~~~~~~~~~~~~~~~~~~~~... | 27.45 | 106 | 0.594848 |
21b73f177e573fbe65e769f69b421c667af397ea | 10,862 | py | Python | Howie-master/howie/aiml/PatternMgr.py | Srinath-tr/Goferbot | 0f734d01c6504c6c97dbdf45f5adf8b25c0f9fd9 | [
"Apache-2.0",
"bzip2-1.0.6"
] | 1 | 2019-04-23T21:50:08.000Z | 2019-04-23T21:50:08.000Z | Gofer_voice/howie/aiml/PatternMgr.py | Srinath-tr/Goferbot | 0f734d01c6504c6c97dbdf45f5adf8b25c0f9fd9 | [
"Apache-2.0",
"bzip2-1.0.6"
] | null | null | null | Gofer_voice/howie/aiml/PatternMgr.py | Srinath-tr/Goferbot | 0f734d01c6504c6c97dbdf45f5adf8b25c0f9fd9 | [
"Apache-2.0",
"bzip2-1.0.6"
] | 2 | 2019-02-14T08:13:33.000Z | 2019-04-23T21:47:48.000Z | # This class implements the AIML pattern-matching algorithm described
# by Dr. Richard Wallace at the following site:
# http://www.alicebot.org/documentation/matching.html
import marshal
import pprint
import re
import string
import sys
class PatternMgr:
# special dictionary keys
_UNDERSCORE = 0
_STAR = 1
_T... | 33.015198 | 100 | 0.667372 |
bdec3503a68380ded643bf4f655c6a7b2fa0db58 | 1,415 | py | Python | huaweicloud-sdk-dds/setup.py | handsome-baby/huaweicloud-sdk-python-v3 | 6cdcf1da8b098427e58fc3335a387c14df7776d0 | [
"Apache-2.0"
] | 1 | 2021-04-16T07:59:28.000Z | 2021-04-16T07:59:28.000Z | huaweicloud-sdk-dds/setup.py | Lencof/huaweicloud-sdk-python-v3 | d13dc4e2830a83e295be6e4de021999b3376e34e | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-dds/setup.py | Lencof/huaweicloud-sdk-python-v3 | d13dc4e2830a83e295be6e4de021999b3376e34e | [
"Apache-2.0"
] | 1 | 2022-01-17T02:24:18.000Z | 2022-01-17T02:24:18.000Z | # coding: utf-8
from os import path
from setuptools import setup, find_packages
NAME = "huaweicloudsdkdds"
VERSION = "3.0.39-rc"
AUTHOR = "HuaweiCloud SDK"
AUTHOR_EMAIL = "hwcloudsdk@huawei.com"
URL = "https://github.com/huaweicloud/huaweicloud-sdk-python-v3"
DESCRIPTION = "DDS"
this_directory = path.abspath(path.di... | 30.76087 | 78 | 0.670671 |
4b5009d4a80eefe2506bec8d3eebb8b4ea607200 | 1,246 | py | Python | Combination Sum IV.py | sugia/leetcode | 6facec2a54d1d9f133f420c9bce1d1043f57ebc6 | [
"Apache-2.0"
] | null | null | null | Combination Sum IV.py | sugia/leetcode | 6facec2a54d1d9f133f420c9bce1d1043f57ebc6 | [
"Apache-2.0"
] | null | null | null | Combination Sum IV.py | sugia/leetcode | 6facec2a54d1d9f133f420c9bce1d1043f57ebc6 | [
"Apache-2.0"
] | null | null | null | '''
Given an integer array with all positive numbers and no duplicates, find the number of possible combinations that add up to a positive integer target.
Example:
nums = [1, 2, 3]
target = 4
The possible combination ways are:
(1, 1, 1, 1)
(1, 1, 2)
(1, 2, 1)
(1, 3)
(2, 1, 1)
(2, 2)
(3, 1)
Note that different sequ... | 22.654545 | 151 | 0.600321 |
9fa8fa0f136f09ad8f4f3c095a5bd4655cd5bee1 | 3,758 | py | Python | travis_pypi_setup.py | tapilab/json-annotate | 3a88a25dca1fcf2955206ce61bf43e4f751af147 | [
"MIT"
] | 1 | 2017-02-24T02:37:04.000Z | 2017-02-24T02:37:04.000Z | travis_pypi_setup.py | tapilab/json-annotate | 3a88a25dca1fcf2955206ce61bf43e4f751af147 | [
"MIT"
] | 1 | 2016-12-02T22:14:50.000Z | 2016-12-02T22:14:50.000Z | travis_pypi_setup.py | tapilab/json_annotate | 3a88a25dca1fcf2955206ce61bf43e4f751af147 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Update encrypted deploy password in Travis config file
"""
from __future__ import print_function
import base64
import json
import os
from getpass import getpass
import yaml
from cryptography.hazmat.primitives.serialization import load_pem_public_key
from cryptography.h... | 30.552846 | 79 | 0.700639 |
e14a2a30821416c02d8e76cbd4e9983b706a530f | 7,731 | py | Python | osc_sdk_python/outscale_gateway.py | outscale/osc-sdk-python | 0c3644190c6c5227c3e980cb4f974aa538a90134 | [
"BSD-3-Clause"
] | 2 | 2019-10-09T17:20:10.000Z | 2020-12-10T14:31:59.000Z | osc_sdk_python/outscale_gateway.py | outscale/osc-sdk-python | 0c3644190c6c5227c3e980cb4f974aa538a90134 | [
"BSD-3-Clause"
] | 15 | 2019-11-07T14:55:55.000Z | 2022-03-15T09:22:30.000Z | osc_sdk_python/outscale_gateway.py | outscale/osc-sdk-python | 0c3644190c6c5227c3e980cb4f974aa538a90134 | [
"BSD-3-Clause"
] | 8 | 2019-08-30T12:05:12.000Z | 2021-02-19T14:14:38.000Z | import os
import time
import sys
from .call import Call
import ruamel.yaml
type_mapping = {'boolean': 'bool',
'string': 'str',
'integer': 'int',
'array': 'list'}
# Logs Output Options
LOG_NONE = 0
LOG_STDERR = 1
LOG_STDIO = 2
LOG_MEMORY = 4
# what to Log
LOG_ALL = 0
LO... | 36.63981 | 142 | 0.591127 |
87aecba55fb94c98c1fee6b39d31391e219b3c70 | 648 | py | Python | lingobarter/core/admin/__init__.py | LeightonStreet/LingoBarter | 3fffd95c38973ca9b9ce284070522ba758efe489 | [
"Apache-2.0"
] | 7 | 2016-01-22T05:01:52.000Z | 2019-02-07T10:23:12.000Z | lingobarter/core/admin/__init__.py | LeightonStreet/LeightonStreet | 3fffd95c38973ca9b9ce284070522ba758efe489 | [
"Apache-2.0"
] | 6 | 2016-03-26T23:32:47.000Z | 2016-04-01T07:10:42.000Z | lingobarter/core/admin/__init__.py | LeightonStreet/LeightonStreet | 3fffd95c38973ca9b9ce284070522ba758efe489 | [
"Apache-2.0"
] | 1 | 2016-03-26T23:31:00.000Z | 2016-03-26T23:31:00.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*
from flask.ext.admin import Admin
# default admin first
class LingobarterAdmin(Admin):
pass
# create admin
def create_admin(app=None):
return LingobarterAdmin(app, name='Lingobarter', template_mode='bootstrap3')
def configure_admin(app, admin):
# routing ad... | 19.058824 | 80 | 0.612654 |
804e73bf57c22b0982b42797cd21ad9ecc674b8a | 626 | py | Python | Python/169 MajorityElem.py | Fiona08/leetcode | cee3da122e1703cfde811a8f69c207d5ae780d37 | [
"MIT"
] | null | null | null | Python/169 MajorityElem.py | Fiona08/leetcode | cee3da122e1703cfde811a8f69c207d5ae780d37 | [
"MIT"
] | null | null | null | Python/169 MajorityElem.py | Fiona08/leetcode | cee3da122e1703cfde811a8f69c207d5ae780d37 | [
"MIT"
] | null | null | null | #169
# Time: O(n)
# Space: O(1)
# Given an array of size n, find the majority element.
# The majority element is the element that appears more than ⌊ n/2 ⌋ times.
# You may assume that the array is non-empty
# and the majority element always exist in the array.
class arraySol():
def majorityElem(self,nums)... | 25.04 | 75 | 0.603834 |
59e59b5148454aaa1f257feb300ed18a40699048 | 5,247 | py | Python | SnakeGame04.py | Robertsonstuff/SnakeGameSimple | c787a3b4d13ba60e903445c4d4b2fe01fc0c69cb | [
"MIT"
] | null | null | null | SnakeGame04.py | Robertsonstuff/SnakeGameSimple | c787a3b4d13ba60e903445c4d4b2fe01fc0c69cb | [
"MIT"
] | null | null | null | SnakeGame04.py | Robertsonstuff/SnakeGameSimple | c787a3b4d13ba60e903445c4d4b2fe01fc0c69cb | [
"MIT"
] | null | null | null | import copy
import curses
import random
import os
import time
from typing import List, Tuple
# Defining objects for type hints
Apple = List[int] # size 2
Snake = List[List[int]] # size Nx2, with N being Snake's length
Window = curses.window
# Globals
DIRECTIONS = {
curses.KEY_LEFT: 'left',
... | 30.32948 | 100 | 0.618067 |
3c5776668e5c859deef2baa84373c1baf5e7623a | 18,445 | py | Python | services/core-api/app/api/now_applications/resources/now_application_status_resource.py | areyeslo/mds | e8c38e593e09b78e2a57009c0d003d6c4bfa32e6 | [
"Apache-2.0"
] | 1 | 2021-09-17T20:41:45.000Z | 2021-09-17T20:41:45.000Z | services/core-api/app/api/now_applications/resources/now_application_status_resource.py | areyeslo/mds | e8c38e593e09b78e2a57009c0d003d6c4bfa32e6 | [
"Apache-2.0"
] | null | null | null | services/core-api/app/api/now_applications/resources/now_application_status_resource.py | areyeslo/mds | e8c38e593e09b78e2a57009c0d003d6c4bfa32e6 | [
"Apache-2.0"
] | null | null | null | from datetime import datetime, timedelta, timezone
from flask_restplus import Resource, reqparse, inputs
from flask import current_app
from operator import attrgetter
from werkzeug.exceptions import BadRequest, NotFound, NotImplemented
from app.extensions import api, db
from app.api.utils.access_decorators import requ... | 55.557229 | 174 | 0.642342 |
660c786f6cd34f1cfdaa46405ec5f79cc1ac61c9 | 4,835 | py | Python | test/functional/interface_http.py | arjundashrath/PIVX | 5a7b5141a7fcf765729ce31b6a7c0ce9b6d21969 | [
"MIT"
] | 638 | 2017-01-07T23:55:36.000Z | 2022-03-29T21:02:43.000Z | test/functional/interface_http.py | arjundashrath/PIVX | 5a7b5141a7fcf765729ce31b6a7c0ce9b6d21969 | [
"MIT"
] | 1,750 | 2017-01-08T12:29:27.000Z | 2022-03-09T18:32:16.000Z | test/functional/interface_http.py | arjundashrath/PIVX | 5a7b5141a7fcf765729ce31b6a7c0ce9b6d21969 | [
"MIT"
] | 1,461 | 2017-01-08T00:49:42.000Z | 2022-03-20T07:13:39.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2017 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 the RPC HTTP basics."""
import http.client
import urllib.parse
from test_framework.test_framewor... | 43.954545 | 111 | 0.635574 |
34af7790efa779cfac99073dcd815d1dc20bf218 | 86 | py | Python | test cases/common/88 dep fallback/subprojects/boblib/genbob.py | kira78/meson | 0ae840656c5b87f30872072aa8694667c63c96d2 | [
"Apache-2.0"
] | 4,047 | 2015-06-18T10:36:48.000Z | 2022-03-31T09:47:02.000Z | test cases/common/88 dep fallback/subprojects/boblib/genbob.py | kira78/meson | 0ae840656c5b87f30872072aa8694667c63c96d2 | [
"Apache-2.0"
] | 8,206 | 2015-06-14T12:20:48.000Z | 2022-03-31T22:50:37.000Z | test cases/common/88 dep fallback/subprojects/boblib/genbob.py | kira78/meson | 0ae840656c5b87f30872072aa8694667c63c96d2 | [
"Apache-2.0"
] | 1,489 | 2015-06-27T04:06:38.000Z | 2022-03-29T10:14:48.000Z | #!/usr/bin/env python3
import sys
with open(sys.argv[1], 'w') as f:
f.write('')
| 12.285714 | 33 | 0.593023 |
4813731d26cad4c43d621b356be1791c77bcfd21 | 5,211 | py | Python | src/python/tests/testTreeViewerInterface.py | ori-drs/director | 44ab7537a9ce110e70d4c1f5760d7b809c8240a9 | [
"BSD-3-Clause"
] | 18 | 2018-11-05T09:16:11.000Z | 2021-12-21T09:05:50.000Z | src/python/tests/testTreeViewerInterface.py | ori-drs/director | 44ab7537a9ce110e70d4c1f5760d7b809c8240a9 | [
"BSD-3-Clause"
] | 36 | 2018-10-09T21:33:43.000Z | 2020-12-10T11:22:29.000Z | src/python/tests/testTreeViewerInterface.py | ori-drs/director | 44ab7537a9ce110e70d4c1f5760d7b809c8240a9 | [
"BSD-3-Clause"
] | 4 | 2018-11-05T09:16:13.000Z | 2021-09-29T02:18:37.000Z | import director
import os
import subprocess
import json
import threading
import time
import math
import sys
import numpy as np
import lcm
import robotlocomotion as lcmrl
def comms_msg(timestamp, data):
msg = lcmrl.viewer2_comms_t()
msg.format = "treeviewer_json"
msg.format_version_major = 1
msg.format... | 32.166667 | 105 | 0.533871 |
278a3463fe40e197c58145573798fc0b20ba116d | 2,091 | py | Python | rad/rest/client/cli/zone_manager/cmd_zone_manager_create.py | guillermomolina/rad-rest-client | c22528764bdf9dddc5ff7d269d7465d34878a7e3 | [
"Apache-2.0"
] | 1 | 2021-09-17T13:40:13.000Z | 2021-09-17T13:40:13.000Z | rad/rest/client/cli/zone_manager/cmd_zone_manager_create.py | guillermomolina/rad-rest-client | c22528764bdf9dddc5ff7d269d7465d34878a7e3 | [
"Apache-2.0"
] | null | null | null | rad/rest/client/cli/zone_manager/cmd_zone_manager_create.py | guillermomolina/rad-rest-client | c22528764bdf9dddc5ff7d269d7465d34878a7e3 | [
"Apache-2.0"
] | 1 | 2021-09-17T16:26:32.000Z | 2021-09-17T16:26:32.000Z | # Copyright 2021, Guillermo Adrián Molina
#
# 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 ... | 42.673469 | 105 | 0.611669 |
8685c9e75d4b27e71e24b4851247b33372668ac6 | 3,696 | py | Python | pywind/lib/tpl/Template.py | augustand/fdslight | f3d82465aaa27160438b22f9b474be8c5dc100cc | [
"BSD-2-Clause"
] | null | null | null | pywind/lib/tpl/Template.py | augustand/fdslight | f3d82465aaa27160438b22f9b474be8c5dc100cc | [
"BSD-2-Clause"
] | null | null | null | pywind/lib/tpl/Template.py | augustand/fdslight | f3d82465aaa27160438b22f9b474be8c5dc100cc | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
import pywind.lib.tpl.syntax_execute as core_execute
import os, importlib
class TemplateErr(Exception): pass
class template(object):
__user_exts = None
__kwargs = None
__directories = None
# 执行对象,一个模版文件代表一个执行对象
__exe_objects = None
__render_content = None
def _... | 25.489655 | 84 | 0.590639 |
05f4adb58129eddbdee11f23f943194476bb7747 | 18,133 | py | Python | ci-scripts/copyright.py | ezavod/tng | b3a9ec25146760e23a6db377bfcc524abcbb894e | [
"BSD-3-Clause"
] | null | null | null | ci-scripts/copyright.py | ezavod/tng | b3a9ec25146760e23a6db377bfcc524abcbb894e | [
"BSD-3-Clause"
] | null | null | null | ci-scripts/copyright.py | ezavod/tng | b3a9ec25146760e23a6db377bfcc524abcbb894e | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
#
# This code is part of the tng binary trajectory format.
#
# Copyright (c) 2020, by the GROMACS development team.
# TNG was orginally written by Magnus Lundborg, Daniel Spångberg and
# Rossen Apostolov. The API is implemented mainly by Magnus Lundborg,
# Daniel Spångberg and Anders Gärdenäs.
#
... | 40.84009 | 117 | 0.616335 |
b859f6840e1ec3a982c6d48e2606cee4ffe5caa3 | 1,413 | py | Python | dns_debugger/__main__.py | trnsnt/dns-debugger | dd5bdcb7f4280494e327570f72d7ae8a824ab8a8 | [
"MIT"
] | 3 | 2018-03-30T14:36:11.000Z | 2019-07-01T12:43:40.000Z | dns_debugger/__main__.py | trnsnt/dns-debugger | dd5bdcb7f4280494e327570f72d7ae8a824ab8a8 | [
"MIT"
] | null | null | null | dns_debugger/__main__.py | trnsnt/dns-debugger | dd5bdcb7f4280494e327570f72d7ae8a824ab8a8 | [
"MIT"
] | null | null | null | """Run"""
import argparse
from dns_debugger.executors import run_tests
from dns_debugger.ui import console
def run():
"""Parse args and run"""
args, parser = parse_args()
if args.ui == "console":
start_console(args, parser)
elif args.ui == "server":
start_server()
def start_server... | 27.705882 | 103 | 0.639066 |
223c9c353df01fc5f9af77e0eb29da253019f9d2 | 1,046 | py | Python | scripts/benchmark/extract_re_histogram.py | XaverKlemenschits/rti | 0672079da94fd726c597041a6b23ee24d9906e82 | [
"BSD-3-Clause"
] | 3 | 2019-05-16T07:44:36.000Z | 2020-05-08T13:55:12.000Z | scripts/benchmark/extract_re_histogram.py | XaverKlemenschits/rti | 0672079da94fd726c597041a6b23ee24d9906e82 | [
"BSD-3-Clause"
] | null | null | null | scripts/benchmark/extract_re_histogram.py | XaverKlemenschits/rti | 0672079da94fd726c597041a6b23ee24d9906e82 | [
"BSD-3-Clause"
] | 4 | 2020-06-24T08:18:41.000Z | 2021-05-28T10:22:13.000Z | #! /usr/bin/env python
import matplotlib.pyplot as pyplot
import numpy
import sys
import vtk
if len(sys.argv) <= 1:
print('No input file given.')
sys.exit()
infiles = sys.argv[1:]
#print(f'infiles\n{infiles}')
colors = ['blue', 'green', 'red', 'cyan', 'magenta', 'yellow', 'black']
coloridx = 0
for infile in infi... | 28.27027 | 100 | 0.692161 |
ce2348b92d57a05787536e0f0ed693b3a9cc5b9c | 741 | py | Python | GoogleColab/InteligenciaAnalitica/Ex1/stopwords.py | AlexandroLuis/ComputerScience | 273c3f6797737d98ffdf00ae870ceafa3aba59d1 | [
"MIT"
] | 2 | 2021-02-06T21:48:24.000Z | 2022-03-21T00:16:17.000Z | GoogleColab/InteligenciaAnalitica/Ex1/stopwords.py | AlexandroLuis/ComputerScience | 273c3f6797737d98ffdf00ae870ceafa3aba59d1 | [
"MIT"
] | null | null | null | GoogleColab/InteligenciaAnalitica/Ex1/stopwords.py | AlexandroLuis/ComputerScience | 273c3f6797737d98ffdf00ae870ceafa3aba59d1 | [
"MIT"
] | 1 | 2022-02-10T20:59:23.000Z | 2022-02-10T20:59:23.000Z | # remoção de pontuacao e stopwords
def remove_stopwords(text,lang,domain_stopwords=[]):
stop_words = nltk.corpus.stopwords.words(lang) # lang='portuguese' or lang='english'
s = str(text).lower() # tudo para caixa baixa
table = str.maketrans({key: None for key in string.punctuation})
s = s.translate(table... | 32.217391 | 117 | 0.700405 |
6723a75ef1c0adbe97458f130702a7b856ce868c | 5,294 | py | Python | matrix/__main__.py | varkenvarken/Matrix | 187a704133ed83b28cfda66157b44b7f3e3499d8 | [
"MIT"
] | null | null | null | matrix/__main__.py | varkenvarken/Matrix | 187a704133ed83b28cfda66157b44b7f3e3499d8 | [
"MIT"
] | null | null | null | matrix/__main__.py | varkenvarken/Matrix | 187a704133ed83b28cfda66157b44b7f3e3499d8 | [
"MIT"
] | null | null | null | import argparse
import fileinput
import subprocess
from sys import stderr, stdout
def outputfile(filename, ext):
if filename == "-":
f = stdout
else:
f = open(filename + ext, "w")
return f
def printParseTree(filename, ext, parsetree):
f = outputfile(filename, ext)
print("Parsetre... | 26.873096 | 99 | 0.556857 |
3d039d236d82f59d42a4ec12db178267e92aadd7 | 4,963 | py | Python | opacus_lab/models/GPT2/refactor.py | tginart/Opacus-lab | 563a5eebcb1e3b86993d71ffd824249c4b4494fa | [
"Apache-2.0"
] | null | null | null | opacus_lab/models/GPT2/refactor.py | tginart/Opacus-lab | 563a5eebcb1e3b86993d71ffd824249c4b4494fa | [
"Apache-2.0"
] | null | null | null | opacus_lab/models/GPT2/refactor.py | tginart/Opacus-lab | 563a5eebcb1e3b86993d71ffd824249c4b4494fa | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and its affiliates. All Rights Reserved
import torch
import torch.nn as nn
from transformers import GPT2Tokenizer
from .model.attention import AttentionLayer
from .model.embedding import PositionalEmbedding, TokenEmbedding
from .model.feedforward import Posi... | 34.706294 | 84 | 0.670764 |
72fa65e5cbb07f80678f2ded8c4ea92f0997e190 | 1,973 | py | Python | util_scripts/make_contaminated_trainset.py | ishine/pase | 2a41e63e54fa8673efd12c16cdcdd5ad4f0f125e | [
"MIT"
] | 428 | 2019-04-08T04:34:00.000Z | 2022-03-18T08:44:31.000Z | util_scripts/make_contaminated_trainset.py | ishine/pase | 2a41e63e54fa8673efd12c16cdcdd5ad4f0f125e | [
"MIT"
] | 46 | 2019-04-07T23:38:53.000Z | 2022-02-19T12:06:12.000Z | util_scripts/make_contaminated_trainset.py | ishine/pase | 2a41e63e54fa8673efd12c16cdcdd5ad4f0f125e | [
"MIT"
] | 89 | 2019-04-08T18:17:25.000Z | 2022-03-31T02:39:45.000Z | from pase.dataset import *
from torchvision.transforms import Compose
import json
from pase.transforms import *
import tqdm
from torch.utils.data import DataLoader
import soundfile as sf
from train import config_distortions
import random
import numpy as np
import os
import torch
random.seed(1)
np.random.seed(1)
torch.... | 34.017241 | 74 | 0.572225 |
de87ad05f4035c458bcd1ae1cbd82a4294ec7dcd | 747 | py | Python | django_project/hello/hello/urls.py | seoggylee/study | df77ecd16c858425fe721317f09f9c01e96bff65 | [
"CC0-1.0"
] | null | null | null | django_project/hello/hello/urls.py | seoggylee/study | df77ecd16c858425fe721317f09f9c01e96bff65 | [
"CC0-1.0"
] | null | null | null | django_project/hello/hello/urls.py | seoggylee/study | df77ecd16c858425fe721317f09f9c01e96bff65 | [
"CC0-1.0"
] | null | null | null | """hello URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/4.0/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based v... | 33.954545 | 77 | 0.708166 |
c602ea1982b299627a7b1f099ddabb0456d9fbb3 | 6,713 | py | Python | tests/ext_django/tests.py | Khan/wtforms | 4f67591cea47528431304eb8f2c5eb2ae413056b | [
"BSD-3-Clause"
] | null | null | null | tests/ext_django/tests.py | Khan/wtforms | 4f67591cea47528431304eb8f2c5eb2ae413056b | [
"BSD-3-Clause"
] | null | null | null | tests/ext_django/tests.py | Khan/wtforms | 4f67591cea47528431304eb8f2c5eb2ae413056b | [
"BSD-3-Clause"
] | 6 | 2017-03-17T18:26:53.000Z | 2021-11-10T15:27:48.000Z | #!/usr/bin/env python
from __future__ import unicode_literals
import sys, os
TESTS_DIR = os.path.realpath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.insert(0, TESTS_DIR)
##########################################################################
# -- Django Initialization
#
# Unfortunately, we cannot do ... | 38.803468 | 141 | 0.665127 |
7add67281099f69806066fd1fe4729899d8e475d | 26 | py | Python | __init__.py | ValEhk/CryptoTools | 722926a9d95a715a8ede2011d79b7339ed2b3f0b | [
"MIT"
] | null | null | null | __init__.py | ValEhk/CryptoTools | 722926a9d95a715a8ede2011d79b7339ed2b3f0b | [
"MIT"
] | null | null | null | __init__.py | ValEhk/CryptoTools | 722926a9d95a715a8ede2011d79b7339ed2b3f0b | [
"MIT"
] | null | null | null | __all__ = ["cryptotools"]
| 13 | 25 | 0.692308 |
af28f629324d450ea4b5757fb37b98881536e63a | 2,055 | py | Python | Lang/Python/site-package/pySerial/item001_pyserial_cmd.py | Orig5826/Basics | 582e74c83a2b654640fe7c47a1a385a8913cc466 | [
"MIT"
] | 5 | 2018-03-09T13:51:11.000Z | 2021-12-17T02:05:59.000Z | Lang/Python/site-package/pySerial/item001_pyserial_cmd.py | Orig5826/Basics | 582e74c83a2b654640fe7c47a1a385a8913cc466 | [
"MIT"
] | null | null | null | Lang/Python/site-package/pySerial/item001_pyserial_cmd.py | Orig5826/Basics | 582e74c83a2b654640fe7c47a1a385a8913cc466 | [
"MIT"
] | null | null | null |
from pyserial_uart import Uart
class Demo():
def __init__(self):
self.com = Uart(1)
def send(self, cmd, param, data):
if isinstance(cmd, str):
# cmd.replace(' ','',-1) #fromhex内部已经做个去除空格处理
cmd = bytes.fromhex(cmd)
if isinstance(param, str):
param ... | 29.782609 | 60 | 0.542092 |
40a7456f5bf66b7f88219ee9770e833afce17f57 | 9,168 | py | Python | lingvo/core/task_scheduler.py | argideritzalpea/lingvo | 0b13f9b02f8cf2167a1b80a43222257f2140e1e8 | [
"Apache-2.0"
] | 1 | 2020-08-04T08:39:35.000Z | 2020-08-04T08:39:35.000Z | lingvo/core/task_scheduler.py | argideritzalpea/lingvo | 0b13f9b02f8cf2167a1b80a43222257f2140e1e8 | [
"Apache-2.0"
] | null | null | null | lingvo/core/task_scheduler.py | argideritzalpea/lingvo | 0b13f9b02f8cf2167a1b80a43222257f2140e1e8 | [
"Apache-2.0"
] | null | null | null | # Lint as: python2, python3
# Copyright 2018 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
#
... | 31.183673 | 80 | 0.683355 |
e98a553294c0ec83250f5bd36a7350952cc9c74f | 492 | py | Python | testapp/migrations/0001_initial.py | coderanger/migrations-operator-django-test | 8f9fa7f4172d2180bdea09ef290e5888e418686c | [
"Apache-2.0"
] | null | null | null | testapp/migrations/0001_initial.py | coderanger/migrations-operator-django-test | 8f9fa7f4172d2180bdea09ef290e5888e418686c | [
"Apache-2.0"
] | null | null | null | testapp/migrations/0001_initial.py | coderanger/migrations-operator-django-test | 8f9fa7f4172d2180bdea09ef290e5888e418686c | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.1.3 on 2020-11-16 00:13
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='TestModel',
fields=[
('id', models.AutoFiel... | 22.363636 | 114 | 0.579268 |
ae4397cec9b902c5df0546f4c0141336b51ed0e0 | 3,285 | py | Python | mvpa2/tests/test_svdmapper.py | nno/PyMVPA | a125596bf81b8e9848768852f697bd3cff9674c4 | [
"MIT"
] | 227 | 2015-01-17T20:13:54.000Z | 2022-01-26T21:14:30.000Z | mvpa2/tests/test_svdmapper.py | nno/PyMVPA | a125596bf81b8e9848768852f697bd3cff9674c4 | [
"MIT"
] | 364 | 2015-01-05T21:55:09.000Z | 2021-09-09T20:37:55.000Z | mvpa2/tests/test_svdmapper.py | nno/PyMVPA | a125596bf81b8e9848768852f697bd3cff9674c4 | [
"MIT"
] | 111 | 2015-01-06T19:26:41.000Z | 2022-01-26T21:14:31.000Z | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ### ##
#
# See COPYING file distributed along with the PyMVPA package for the
# copyright and license terms.
#
### ### ### ### ###... | 29.594595 | 79 | 0.573212 |
688f8031a2aff805315980819215eb1512aef9e5 | 2,726 | py | Python | huaweicloud-sdk-evs/huaweicloudsdkevs/v2/model/create_snapshot_request.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | 1 | 2021-04-16T07:59:28.000Z | 2021-04-16T07:59:28.000Z | huaweicloud-sdk-evs/huaweicloudsdkevs/v2/model/create_snapshot_request.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-evs/huaweicloudsdkevs/v2/model/create_snapshot_request.py | wuchen-huawei/huaweicloud-sdk-python-v3 | 3683d703f4320edb2b8516f36f16d485cff08fc2 | [
"Apache-2.0"
] | 1 | 2022-01-17T02:24:18.000Z | 2022-01-17T02:24:18.000Z | # coding: utf-8
import pprint
import re
import six
class CreateSnapshotRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the va... | 25.009174 | 74 | 0.53485 |
fc830309fb4fe63489a4de831faf2ac96a319bb9 | 1,095 | py | Python | examples/test_shield.py | freedomofkeima/awaitwhat | 40ba173e9b3bac69960ac0bb4088843c8111314c | [
"MIT"
] | 45 | 2019-08-12T12:15:52.000Z | 2022-03-03T13:27:13.000Z | examples/test_shield.py | freedomofkeima/awaitwhat | 40ba173e9b3bac69960ac0bb4088843c8111314c | [
"MIT"
] | 27 | 2019-08-16T06:32:16.000Z | 2021-07-14T12:15:04.000Z | examples/test_shield.py | freedomofkeima/awaitwhat | 40ba173e9b3bac69960ac0bb4088843c8111314c | [
"MIT"
] | 9 | 2019-09-14T02:05:00.000Z | 2021-06-22T04:14:01.000Z | import asyncio
import awaitwhat
FUTURES = []
async def main():
t = asyncio.create_task(test())
await do_work()
await t
async def do_work():
futs = [frob_a_tree() for i in range(1)]
await asyncio.gather(*futs)
async def frob_a_tree():
await b_tree()
async def b_tree():
f = asyncio.F... | 16.102941 | 63 | 0.607306 |
f597b31ae3936bef7774e6c7bc8e4309077bbc3b | 234 | py | Python | mylibs/__init__.py | komoto48g/hello-world | 83a00d3f3dc618bfd3402f35229e975db9046e83 | [
"MIT"
] | null | null | null | mylibs/__init__.py | komoto48g/hello-world | 83a00d3f3dc618bfd3402f35229e975db9046e83 | [
"MIT"
] | 1 | 2021-04-26T09:14:04.000Z | 2021-05-06T04:51:11.000Z | mylibs/__init__.py | komoto48g/hello-world | 83a00d3f3dc618bfd3402f35229e975db9046e83 | [
"MIT"
] | null | null | null | #! python
# -*- coding: utf-8 -*-
"""pyJeol package
"""
from __future__ import (division, print_function,
absolute_import, unicode_literals)
__version__ = "0.0"
__author__ = "Kazuya O'moto <komoto@jeol.co.jp>"
| 26 | 58 | 0.641026 |
c42721ed7e494b60175ff774ecd39dde4d7de525 | 896 | py | Python | FRCScouting/TheBlueAlliance/tests/test_team.py | xNovax/FRCScouting.ca | caf2774e5854a7386eceb21e57b68c1f9c1f7d2d | [
"MIT"
] | 1 | 2019-06-13T03:07:15.000Z | 2019-06-13T03:07:15.000Z | FRCScouting/TheBlueAlliance/tests/test_team.py | xNovax/FRCScouting.ca | caf2774e5854a7386eceb21e57b68c1f9c1f7d2d | [
"MIT"
] | 8 | 2019-07-04T16:19:06.000Z | 2019-07-12T17:37:51.000Z | FRCScouting/TheBlueAlliance/tests/test_team.py | xNovax/FRCScouting.ca | caf2774e5854a7386eceb21e57b68c1f9c1f7d2d | [
"MIT"
] | null | null | null | from django.test import TestCase
from datetime import date
from TheBlueAlliance.team import *
class TeamTestCase(TestCase):
def test_get_team(self):
print("Testing TBA get_team")
#Should be successful
team3710 = get_team(3710)
self.assertEqual(team3710.team_number, 3710, "Should be... | 37.333333 | 114 | 0.69308 |
ade1945b77f5b382e37989ded6df8b6bf5a053e5 | 1,542 | py | Python | apps/nn/unmaintained/prodnet2.py | GiggleLiu/viznet | 1e5674f0f317176960c6fa9666677aaac57641c9 | [
"MIT"
] | 54 | 2018-01-21T12:33:19.000Z | 2021-11-16T22:23:44.000Z | apps/nn/unmaintained/prodnet2.py | GiggleLiu/viznet | 1e5674f0f317176960c6fa9666677aaac57641c9 | [
"MIT"
] | 5 | 2018-04-02T12:32:13.000Z | 2021-02-04T19:16:15.000Z | apps/nn/unmaintained/prodnet2.py | GiggleLiu/viznet | 1e5674f0f317176960c6fa9666677aaac57641c9 | [
"MIT"
] | 8 | 2018-04-25T08:41:20.000Z | 2020-07-14T14:31:51.000Z | import matplotlib.pyplot as plt
from viznet import DynamicShow, Layerwise, NodeBrush, EdgeBrush
def draw_prodnet2(ax, num_node_visible):
'''CNN to achieve MSR'''
handler = Layerwise()
# brush
conv = NodeBrush('nn.convolution', ax)
input = NodeBrush('nn.input', ax)
output = NodeBrush('nn.output... | 27.535714 | 75 | 0.605707 |
21d999a6fbb6d13b42df0571236e2b536d0d19b6 | 6,838 | py | Python | randomizer.py | iZydro/SpotifyRandomizer | 032dd19dddb71069f8ff4b6f509c237cd5991811 | [
"MIT"
] | null | null | null | randomizer.py | iZydro/SpotifyRandomizer | 032dd19dddb71069f8ff4b6f509c237cd5991811 | [
"MIT"
] | null | null | null | randomizer.py | iZydro/SpotifyRandomizer | 032dd19dddb71069f8ff4b6f509c237cd5991811 | [
"MIT"
] | null | null | null | import spotipy
import os
import spotipy.util as util
from http.server import HTTPServer, BaseHTTPRequestHandler
from threading import Thread
from random import shuffle
# os.environ["SPOTIPY_CLIENT_ID"] = ""
# os.environ["SPOTIPY_CLIENT_SECRET"] = ""
SERVER_PORT = 14523
os.environ["SPOTIPY_REDIRECT_URI"] = "http://loca... | 32.717703 | 522 | 0.655016 |
72c0cb509ea6fdbd36ba3421eb5426b63a17d307 | 1,967 | py | Python | mindspore/nn/probability/bijector/exp.py | peng-zhihui/mindspore | 4e0bc761b228cece8b24a280f15b0915959071dc | [
"Apache-2.0"
] | 55 | 2020-12-17T10:26:06.000Z | 2022-03-28T07:18:26.000Z | mindspore/nn/probability/bijector/exp.py | 77zmf/mindspore | 4e0bc761b228cece8b24a280f15b0915959071dc | [
"Apache-2.0"
] | null | null | null | mindspore/nn/probability/bijector/exp.py | 77zmf/mindspore | 4e0bc761b228cece8b24a280f15b0915959071dc | [
"Apache-2.0"
] | 14 | 2021-01-29T02:39:47.000Z | 2022-03-23T05:00:26.000Z | # Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | 32.783333 | 78 | 0.596848 |
2d0b9f89828c670192a9d2acca64d09ae979584a | 2,960 | py | Python | install/python-installer/scripts/traf_ldap.py | anoopsharma00/incubator-trafodion | b109e2cf5883f8e763af853ab6fad7ce7110d9e8 | [
"Apache-2.0"
] | null | null | null | install/python-installer/scripts/traf_ldap.py | anoopsharma00/incubator-trafodion | b109e2cf5883f8e763af853ab6fad7ce7110d9e8 | [
"Apache-2.0"
] | null | null | null | install/python-installer/scripts/traf_ldap.py | anoopsharma00/incubator-trafodion | b109e2cf5883f8e763af853ab6fad7ce7110d9e8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# @@@ START COPYRIGHT @@@
#
# Licensed to the Apache Software Foundation (ASF) 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 Li... | 37 | 102 | 0.703378 |
341de6ad6b7b20896b31f0c2d3bb40bcffe15020 | 8,017 | py | Python | train/perceptron.py | sealhuang/Jiagu | 228298c12147f0c5ece82ecb98c4fbe4e56f3893 | [
"MIT"
] | null | null | null | train/perceptron.py | sealhuang/Jiagu | 228298c12147f0c5ece82ecb98c4fbe4e56f3893 | [
"MIT"
] | null | null | null | train/perceptron.py | sealhuang/Jiagu | 228298c12147f0c5ece82ecb98c4fbe4e56f3893 | [
"MIT"
] | null | null | null | # -*- coding:utf-8 -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
import os
import gzip
import pickle
import random
from collections import defaultdict
'''
http://honnibal.wordpress.com/2013/09/11/a-good-part-of-speechpos-tagger-in-about-200-lines-of-python/
'''
class AveragedPerceptron(object):
def __init__(self):... | 33.128099 | 102 | 0.532244 |
a577fdeb2be16d93617356b3621c57bda0d6b1f4 | 13,582 | py | Python | waterbutler/providers/cloudfiles/provider.py | birdbrained/waterbutler | 60a6eb7f2dfce88b7a00457034c01b20da0aef23 | [
"Apache-2.0"
] | null | null | null | waterbutler/providers/cloudfiles/provider.py | birdbrained/waterbutler | 60a6eb7f2dfce88b7a00457034c01b20da0aef23 | [
"Apache-2.0"
] | null | null | null | waterbutler/providers/cloudfiles/provider.py | birdbrained/waterbutler | 60a6eb7f2dfce88b7a00457034c01b20da0aef23 | [
"Apache-2.0"
] | null | null | null | import os
import hmac
import json
import time
import asyncio
import hashlib
import functools
import furl
from waterbutler.core import streams
from waterbutler.core import provider
from waterbutler.core import exceptions
from waterbutler.core.path import WaterButlerPath
from waterbutler.providers.cloudfiles import se... | 37.519337 | 105 | 0.592843 |
1316e09f75709e36e57df02226b13b45fc5537cf | 280 | py | Python | web/main/urls.py | Mikhail-Gorelov/ifotechs_task | 075227a7ebf38ab3155cdc2f8454c663849dd335 | [
"MIT"
] | null | null | null | web/main/urls.py | Mikhail-Gorelov/ifotechs_task | 075227a7ebf38ab3155cdc2f8454c663849dd335 | [
"MIT"
] | null | null | null | web/main/urls.py | Mikhail-Gorelov/ifotechs_task | 075227a7ebf38ab3155cdc2f8454c663849dd335 | [
"MIT"
] | null | null | null | from django.contrib.auth.decorators import login_required
from django.urls import path
from django.views.generic import RedirectView
from .views import SetUserTimeZone, TemplateAPIView
urlpatterns = [
path('timezone/', SetUserTimeZone.as_view(), name='set_user_timezone'),
]
| 31.111111 | 75 | 0.807143 |
ac030470a210cb78d315bfe5e60c89f94849e4a1 | 798 | py | Python | tests/monitors/memory/memory_test.py | manang-splunk/signalfx-agent | 079998171a9e770383fffef9b60c24c80081e1a4 | [
"Apache-2.0"
] | null | null | null | tests/monitors/memory/memory_test.py | manang-splunk/signalfx-agent | 079998171a9e770383fffef9b60c24c80081e1a4 | [
"Apache-2.0"
] | 55 | 2022-01-24T11:40:41.000Z | 2022-03-31T11:31:33.000Z | tests/monitors/memory/memory_test.py | manang-splunk/signalfx-agent | 079998171a9e770383fffef9b60c24c80081e1a4 | [
"Apache-2.0"
] | null | null | null | import sys
import pytest
from tests.helpers.agent import Agent
from tests.helpers.metadata import Metadata
from tests.helpers.verify import verify
pytestmark = [pytest.mark.windows, pytest.mark.memory, pytest.mark.monitor_without_endpoints]
METADATA = Metadata.from_package("memory")
def test_memory():
expected... | 27.517241 | 105 | 0.670426 |
1dd321f38aee3be197c73d1209782cd484b66fae | 2,958 | py | Python | scripts/build/devtools_file_hashes.py | gonnavis/devtools-frontend | 93f79d6e7b973f0b7aadde4547733ec0ce1cf11a | [
"BSD-3-Clause"
] | 2,389 | 2015-06-05T05:06:05.000Z | 2022-03-31T07:08:56.000Z | scripts/build/devtools_file_hashes.py | gonnavis/devtools-frontend | 93f79d6e7b973f0b7aadde4547733ec0ce1cf11a | [
"BSD-3-Clause"
] | 157 | 2016-02-03T06:03:25.000Z | 2022-02-03T13:55:47.000Z | scripts/build/devtools_file_hashes.py | gonnavis/devtools-frontend | 93f79d6e7b973f0b7aadde4547733ec0ce1cf11a | [
"BSD-3-Clause"
] | 388 | 2015-10-10T12:45:24.000Z | 2022-03-22T18:11:08.000Z | # Copyright (c) 2014 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and the ... | 35.638554 | 72 | 0.709263 |
064e8c090f5ac132bd83578ab52356edded1cd72 | 7,628 | py | Python | backtest.py | md100play/Stock_Backtester | 03e8bf048f8a5602d8172dff0c1d12f2ed9af7ff | [
"MIT"
] | 1 | 2017-05-28T22:30:07.000Z | 2017-05-28T22:30:07.000Z | backtest.py | MikeDombo/Stock_Backtester | 03e8bf048f8a5602d8172dff0c1d12f2ed9af7ff | [
"MIT"
] | 1 | 2017-05-04T03:28:04.000Z | 2017-05-04T05:45:53.000Z | backtest.py | md100play/Stock_Backtester | 03e8bf048f8a5602d8172dff0c1d12f2ed9af7ff | [
"MIT"
] | null | null | null | # Copyright (c) 2017 by Michael Dombrowski <http://MikeDombrowski.com/>.
#
# This file is part of Python Customizable Stock Backtester <http://github.com/md100play/Stock_Backtester/>.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (... | 45.676647 | 116 | 0.597666 |
62058aeffcc1a5b5e541383b6fc8ec0e76d8eb81 | 2,323 | py | Python | LinkedList/Reverse Linked List II.py | Bomma-Pranay/InterviewBit | 3bc436cffd3afc7a28c67042e1589fbe7547952f | [
"MIT"
] | null | null | null | LinkedList/Reverse Linked List II.py | Bomma-Pranay/InterviewBit | 3bc436cffd3afc7a28c67042e1589fbe7547952f | [
"MIT"
] | null | null | null | LinkedList/Reverse Linked List II.py | Bomma-Pranay/InterviewBit | 3bc436cffd3afc7a28c67042e1589fbe7547952f | [
"MIT"
] | null | null | null | '''
Reverse Link List II
Asked in:
Facebook
Microsoft
Amazon
Reverse a linked list from position m to n. Do it in-place and in one-pass.
For example:
Given 1->2->3->4->5->NULL, m = 2 and n = 4,
return 1->4->3->2->5->NULL.
Note:
Given m, n satisfy the following condition:
1 ≤ m ≤ n ≤ length of list. Note 2:
Usuall... | 25.811111 | 139 | 0.454585 |
8edcc8e4dd14ba87dd3617a578c7b794029ef7eb | 163 | py | Python | analyzer/main.py | li-simon-collab/so-sentiment-toolchain | 9e8e91b8d44c4278066c936225f32680a12917b0 | [
"MIT"
] | 1 | 2019-01-25T14:14:56.000Z | 2019-01-25T14:14:56.000Z | analyzer/main.py | li-simon-collab/so-sentiment-toolchain | 9e8e91b8d44c4278066c936225f32680a12917b0 | [
"MIT"
] | null | null | null | analyzer/main.py | li-simon-collab/so-sentiment-toolchain | 9e8e91b8d44c4278066c936225f32680a12917b0 | [
"MIT"
] | null | null | null | import sys
from analyzer import cli
def main():
args = cli.parse_args(sys.argv[1:])
cli.handle_parsed_args(args)
if __name__ == "__main__":
main()
| 13.583333 | 39 | 0.668712 |
e76d497f0234e65bb74fb7f5a208b4931af86136 | 939 | py | Python | tests/test_meld.py | olierxleben/Flask-Meld | 70b8ed83d87042ea3ecb4f665da0b13c1b397b7f | [
"MIT"
] | 275 | 2020-12-01T18:18:53.000Z | 2022-03-30T22:33:20.000Z | tests/test_meld.py | olierxleben/Flask-Meld | 70b8ed83d87042ea3ecb4f665da0b13c1b397b7f | [
"MIT"
] | 37 | 2020-12-01T13:46:38.000Z | 2022-01-02T23:17:36.000Z | tests/test_meld.py | olierxleben/Flask-Meld | 70b8ed83d87042ea3ecb4f665da0b13c1b397b7f | [
"MIT"
] | 22 | 2020-12-11T05:03:46.000Z | 2022-03-22T05:55:39.000Z | import pytest
from flask_meld.component import get_component_class
def test_module_load_with_app_factory(app_factory_ctx):
component_class = get_component_class("search")
assert component_class.__name__ == "Search"
def test_module_load_with_single_file_app(app_ctx):
component_class = get_component_class... | 31.3 | 65 | 0.789137 |
0277c02e3866d646e70ee337427df3984315e722 | 7,827 | py | Python | edi_835_parser/loops/transaction.py | shalini1017/edi-835-parser | 5c7c9549621a71cea893b37998e4bdea94822c5c | [
"MIT"
] | null | null | null | edi_835_parser/loops/transaction.py | shalini1017/edi-835-parser | 5c7c9549621a71cea893b37998e4bdea94822c5c | [
"MIT"
] | null | null | null | edi_835_parser/loops/transaction.py | shalini1017/edi-835-parser | 5c7c9549621a71cea893b37998e4bdea94822c5c | [
"MIT"
] | null | null | null | from typing import Iterator, Tuple, Optional, List
from edi_835_parser.loops.claim import Claim as ClaimLoop
from edi_835_parser.loops.organization import Organization as OrganizationLoop
from edi_835_parser.segments.utilities import find_identifier
from edi_835_parser.segments.transaction import Transaction as Transa... | 43.243094 | 122 | 0.653763 |
43c4d558a36cff5d53cc98b318227919deb572f4 | 8,036 | py | Python | games/one_dimensional_war.py | polygon1117/cuigames | 4842d1abd027b4fc35cf6d75491bca2aa110e242 | [
"MIT"
] | null | null | null | games/one_dimensional_war.py | polygon1117/cuigames | 4842d1abd027b4fc35cf6d75491bca2aa110e242 | [
"MIT"
] | null | null | null | games/one_dimensional_war.py | polygon1117/cuigames | 4842d1abd027b4fc35cf6d75491bca2aa110e242 | [
"MIT"
] | null | null | null | import random
import sys
sys.path.append('../myutil')
from input_filtered import alphabets_input
alphabets = "abcdefghijklmnopqrstuvwxyz"
class Entity(object):
def __init__(self, hp, gp_recovery_rate, name):
self.hp = hp
self.gp = 0
self.gp_recovery_rate = gp_recovery_rate
self.na... | 30.907692 | 80 | 0.521279 |
e4029295e1dcce431904702669566a50b573fb49 | 503 | py | Python | backend/app/literature/schemas/reference_category_schemas.py | alliance-genome/agr_literature_service_demo | 48cd3a3797f96ef94e6d40d2c94e379bfc48914f | [
"MIT"
] | null | null | null | backend/app/literature/schemas/reference_category_schemas.py | alliance-genome/agr_literature_service_demo | 48cd3a3797f96ef94e6d40d2c94e379bfc48914f | [
"MIT"
] | null | null | null | backend/app/literature/schemas/reference_category_schemas.py | alliance-genome/agr_literature_service_demo | 48cd3a3797f96ef94e6d40d2c94e379bfc48914f | [
"MIT"
] | null | null | null | from enum import Enum
class ReferenceCategory(str, Enum):
Research_Article = "research_article"
Review_Article = "review_article"
Thesis = "thesis"
Book = "book"
Other = "other"
Preprint = "preprint"
Conference_Publication = "conference_publication"
Personal_Communication = "personal_co... | 31.4375 | 61 | 0.737575 |
9dcb7490e9412a833623bdd2b9da13c684517557 | 6,053 | py | Python | telegram_click/parser.py | fossabot/telegram-click | c4982a59b2a6c63de37f247f77e998872ab030ae | [
"MIT"
] | null | null | null | telegram_click/parser.py | fossabot/telegram-click | c4982a59b2a6c63de37f247f77e998872ab030ae | [
"MIT"
] | null | null | null | telegram_click/parser.py | fossabot/telegram-click | c4982a59b2a6c63de37f247f77e998872ab030ae | [
"MIT"
] | null | null | null | # Copyright (c) 2020 Markus Ressel
# .
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publis... | 34.392045 | 104 | 0.660169 |
d2cd2a2fb70c7456d58f4d18d151bca2700bed4c | 1,619 | py | Python | mrmat_python_api_flask/apis/greeting/v1/api.py | MrMatOrg/mrmat-python-api-flask | 404561d5d817ab0703487fb1119ebae6554a6bca | [
"MIT"
] | null | null | null | mrmat_python_api_flask/apis/greeting/v1/api.py | MrMatOrg/mrmat-python-api-flask | 404561d5d817ab0703487fb1119ebae6554a6bca | [
"MIT"
] | null | null | null | mrmat_python_api_flask/apis/greeting/v1/api.py | MrMatOrg/mrmat-python-api-flask | 404561d5d817ab0703487fb1119ebae6554a6bca | [
"MIT"
] | 1 | 2021-07-25T14:31:27.000Z | 2021-07-25T14:31:27.000Z | # MIT License
#
# Copyright (c) 2021 MrMat
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, ... | 38.547619 | 80 | 0.735022 |
fc2941eb07661229cc98dff7bb8eaaca1c400afe | 5,264 | py | Python | Sequence Models/rnn_utils.py | Lullabytherain/deep-learning-coursera-1 | d8ff1d10223ffc23ce89521945610a6326c5bb20 | [
"MIT"
] | null | null | null | Sequence Models/rnn_utils.py | Lullabytherain/deep-learning-coursera-1 | d8ff1d10223ffc23ce89521945610a6326c5bb20 | [
"MIT"
] | null | null | null | Sequence Models/rnn_utils.py | Lullabytherain/deep-learning-coursera-1 | d8ff1d10223ffc23ce89521945610a6326c5bb20 | [
"MIT"
] | null | null | null | import numpy as np
def softmax(x):
e_x = np.exp(x - np.max(x))
return e_x / e_x.sum(axis=0)
def sigmoid(x):
return 1 / (1 + np.exp(-x))
def initialize_adam(parameters) :
"""
Initializes v and s as two python dictionaries with:
- keys: "dW1", "db1", ..., "dWL", "dbL... | 47.854545 | 161 | 0.544643 |
b7a8d34ce129797873c0dd25533a5b5a7f915185 | 28,161 | py | Python | synapse/storage/databases/main/push_rule.py | hailzam/synapse | 837293c314b47e988fe9532115476a6536cd6406 | [
"Apache-2.0"
] | null | null | null | synapse/storage/databases/main/push_rule.py | hailzam/synapse | 837293c314b47e988fe9532115476a6536cd6406 | [
"Apache-2.0"
] | null | null | null | synapse/storage/databases/main/push_rule.py | hailzam/synapse | 837293c314b47e988fe9532115476a6536cd6406 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2014-2016 OpenMarket Ltd
# Copyright 2018 New Vector Ltd
#
# 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... | 35.646835 | 89 | 0.580732 |
dfec1483ea68db33090998cf511a66a7a4590276 | 1,568 | py | Python | seqlearn/tests/test_hmm.py | olimjonibr/seqlearn | 5ea3f5d7a455df639149382061347856cf511cd9 | [
"MIT"
] | 617 | 2015-01-04T14:03:45.000Z | 2022-03-25T11:38:31.000Z | seqlearn/tests/test_hmm.py | olimjonibr/seqlearn | 5ea3f5d7a455df639149382061347856cf511cd9 | [
"MIT"
] | 27 | 2015-04-19T08:00:02.000Z | 2021-03-12T22:06:14.000Z | seqlearn/tests/test_hmm.py | olimjonibr/seqlearn | 5ea3f5d7a455df639149382061347856cf511cd9 | [
"MIT"
] | 107 | 2015-01-12T06:38:40.000Z | 2021-11-28T14:04:15.000Z | from nose.tools import assert_raises
from numpy.testing import assert_array_equal, assert_array_almost_equal
import numpy as np
from seqlearn.hmm import MultinomialHMM
text = [w.split() for w in ["this DT",
"is V",
"a DT",
"test N",... | 32.666667 | 74 | 0.579082 |
cc49e99eadbfefd2a504e72f8a1a6370e803721f | 265 | py | Python | python2.7/file/rename.py | MisterZhouZhou/python3demo | da0b6771cc12e8e1066a115c3f72a90c100108ac | [
"Apache-2.0"
] | 3 | 2019-03-04T08:39:57.000Z | 2019-12-06T08:29:47.000Z | python2.7/file/rename.py | MisterZhouZhou/python3demo | da0b6771cc12e8e1066a115c3f72a90c100108ac | [
"Apache-2.0"
] | null | null | null | python2.7/file/rename.py | MisterZhouZhou/python3demo | da0b6771cc12e8e1066a115c3f72a90c100108ac | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import os
#文件重命名
# os.rename('foo.txt','fo.txt')
# 创建目录
# os.mkdir('test')
# 获取当前目录
# path = os.getcwd()
# print(path)
# os.chdir('/Users/zhouwei/Desktop/python/file/test')
# 删除”/tmp/test”目录
# os.rmdir( "./test" )
| 12.045455 | 53 | 0.596226 |
e0ca1da10ba8e5dbdf757540892ecb629b86e880 | 2,589 | py | Python | data/p4VQE/R4/benchmark/startQiskit_QC312.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R4/benchmark/startQiskit_QC312.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p4VQE/R4/benchmark/startQiskit_QC312.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=3
# total number=12
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
import networkx as nx
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collectio... | 27.542553 | 118 | 0.634994 |
4a9cb2b341f1ccca860abe75f3d49bcccbbe85fd | 21,301 | py | Python | telethon/client/updates.py | pgjones/Telethon | 1be54035e81ee2e7f869fc2a8c20a16760924895 | [
"MIT"
] | 1 | 2019-06-21T19:19:50.000Z | 2019-06-21T19:19:50.000Z | telethon/client/updates.py | pgjones/Telethon | 1be54035e81ee2e7f869fc2a8c20a16760924895 | [
"MIT"
] | 1 | 2020-06-30T20:56:35.000Z | 2020-06-30T20:56:35.000Z | telethon/client/updates.py | SlavikMIPT/Telethon | fece5660f46b1f5b8f464c162914cc51bff6550f | [
"MIT"
] | null | null | null | import asyncio
import itertools
import random
import time
import typing
from .. import events, utils, errors
from ..events.common import EventBuilder, EventCommon
from ..tl import types, functions
if typing.TYPE_CHECKING:
from .telegramclient import TelegramClient
class UpdateMethods:
# region Public metho... | 38.870438 | 93 | 0.563964 |
9c49e54cbd4f4dcb1dc9eb01a52b8fdb8eb931f5 | 2,545 | py | Python | biggan_cifar/losses.py | SuperStar0907/lecam-gan | e502c9b182345ddd03d29edda56b76caa7d8fb41 | [
"Apache-2.0"
] | 135 | 2021-03-23T23:07:47.000Z | 2022-03-30T03:08:42.000Z | biggan_cifar/losses.py | SuperStar0907/lecam-gan | e502c9b182345ddd03d29edda56b76caa7d8fb41 | [
"Apache-2.0"
] | 12 | 2021-04-06T16:57:14.000Z | 2021-12-31T07:06:05.000Z | biggan_cifar/losses.py | SuperStar0907/lecam-gan | e502c9b182345ddd03d29edda56b76caa7d8fb41 | [
"Apache-2.0"
] | 13 | 2021-03-24T14:37:48.000Z | 2022-03-06T13:24:52.000Z | # Copyright 2021 Google 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, soft... | 33.933333 | 94 | 0.685658 |
f66767e30309e7eceaa59a13c70e4ff87d2ca009 | 3,078 | py | Python | apps/kemures/metrics/NDCG/ndcg_controller.py | DiegoCorrea/ouvidoMusical | e8bdb993e2c6ef2fe4a78e844bc60be2738a5ba5 | [
"MIT"
] | 1 | 2021-10-06T19:35:48.000Z | 2021-10-06T19:35:48.000Z | apps/kemures/metrics/NDCG/ndcg_controller.py | DiegoCorrea/ouvido_musical-Back | e8bdb993e2c6ef2fe4a78e844bc60be2738a5ba5 | [
"MIT"
] | null | null | null | apps/kemures/metrics/NDCG/ndcg_controller.py | DiegoCorrea/ouvido_musical-Back | e8bdb993e2c6ef2fe4a78e844bc60be2738a5ba5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import logging
import numpy as np
from django.utils import timezone
from apps.kemures.kernel.config.global_var import AT_LIST
from apps.kemures.metrics.NDCG.DAO.models import NDCG
from apps.kemures.metrics.NDCG.runtime.models import NDCGRunTime
class NDCGController:
def __init__(self, ev... | 36.642857 | 91 | 0.618908 |
b2eb0f587e85b1edcefd3c4a32d757b676b0c7bd | 384 | py | Python | css/wsgi.py | paledger/CSS | e08df8b9872f3feb58c3c57c10ded82929e8887b | [
"MIT"
] | null | null | null | css/wsgi.py | paledger/CSS | e08df8b9872f3feb58c3c57c10ded82929e8887b | [
"MIT"
] | null | null | null | css/wsgi.py | paledger/CSS | e08df8b9872f3feb58c3c57c10ded82929e8887b | [
"MIT"
] | null | null | null | """
WSGI config for css project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTINGS... | 22.588235 | 78 | 0.78125 |
2aacf9e637be3430598d2d28321237d2c84e1ff4 | 148 | py | Python | tests/conftest.py | DanBoothDev/Sand | a20e27123e4c549ba54335437135347843806fc6 | [
"BSD-2-Clause"
] | null | null | null | tests/conftest.py | DanBoothDev/Sand | a20e27123e4c549ba54335437135347843806fc6 | [
"BSD-2-Clause"
] | null | null | null | tests/conftest.py | DanBoothDev/Sand | a20e27123e4c549ba54335437135347843806fc6 | [
"BSD-2-Clause"
] | null | null | null | import pytest
from sand import Sand
@pytest.fixture
def app():
return Sand()
@pytest.fixture
def client(app):
return app.test_session()
| 11.384615 | 29 | 0.709459 |
73179a36f17070cd2cc47c3344725570badc5f9b | 17,732 | py | Python | models/anchor_detr.py | megvii-research/AnchorDETR | 1bd1ce5b86bd09dd20a56ca07534c6f4b694cdcc | [
"Apache-2.0"
] | 160 | 2021-09-18T10:43:02.000Z | 2022-03-24T16:10:40.000Z | models/anchor_detr.py | megvii-model/AnchorDETR | 1bd1ce5b86bd09dd20a56ca07534c6f4b694cdcc | [
"Apache-2.0"
] | 33 | 2021-09-23T10:37:22.000Z | 2022-03-21T07:36:40.000Z | models/anchor_detr.py | megvii-model/AnchorDETR | 1bd1ce5b86bd09dd20a56ca07534c6f4b694cdcc | [
"Apache-2.0"
] | 15 | 2021-09-18T10:44:26.000Z | 2022-02-17T11:21:46.000Z | # ------------------------------------------------------------------------
# Copyright (c) 2021 megvii-model. All Rights Reserved.
# ------------------------------------------------------------------------
# Modified from Deformable DETR (https://github.com/fundamentalvision/Deformable-DETR)
# Copyright (c) 2020 SenseT... | 46.177083 | 119 | 0.615779 |
f3f2d780d1aae04aa8fc24fbd422321d7a360e24 | 12,030 | py | Python | sdk/python/pulumi_azure_native/apimanagement/v20210101preview/api_policy.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/apimanagement/v20210101preview/api_policy.py | sebtelko/pulumi-azure-native | 711ec021b5c73da05611c56c8a35adb0ce3244e4 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/apimanagement/v20210101preview/api_policy.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... | 45.916031 | 1,422 | 0.650956 |
cc53c9dfa93f65c0bcbb04fce1e1da398ccb320b | 2,797 | py | Python | playground/jax_basic/test_xmap.py | yf225/alpa | a7b5f061537e260875c621a82e14265b1df64c5f | [
"Apache-2.0"
] | 114 | 2022-03-02T20:38:16.000Z | 2022-03-31T20:41:50.000Z | playground/jax_basic/test_xmap.py | yf225/alpa | a7b5f061537e260875c621a82e14265b1df64c5f | [
"Apache-2.0"
] | 6 | 2022-03-09T22:04:50.000Z | 2022-03-30T17:53:15.000Z | playground/jax_basic/test_xmap.py | yf225/alpa | a7b5f061537e260875c621a82e14265b1df64c5f | [
"Apache-2.0"
] | 5 | 2022-03-05T12:04:31.000Z | 2022-03-31T03:55:42.000Z | from functools import partial
import numpy as np
import jax
import jax.numpy as jnp
from jax.experimental.maps import Mesh, mesh, xmap
from jax.lax import pdot, pmean, psum
from jax.nn import relu
def test_dist_matmul():
func = xmap(
jnp.vdot,
in_axes=({0: 'left'}, {1: 'right'}),
out_ax... | 24.973214 | 82 | 0.517698 |
46627b84bfe54175c388ca6a1ceaed4f53ef944a | 4,204 | py | Python | person_detector.py | ravenesco/Tinder-Bot | 7f7c83da2dc1f42a36ca3ca09b482581ca80d272 | [
"Apache-2.0"
] | 1 | 2022-02-07T15:55:54.000Z | 2022-02-07T15:55:54.000Z | person_detector.py | ravenesco/Tinder-Bot | 7f7c83da2dc1f42a36ca3ca09b482581ca80d272 | [
"Apache-2.0"
] | null | null | null | person_detector.py | ravenesco/Tinder-Bot | 7f7c83da2dc1f42a36ca3ca09b482581ca80d272 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from object_detection.utils import ops as utils_ops
import tensorflow as tf
from PIL import Image
PERSON_CLASS = 1
SCORE_THRESHOLD = 0.5
def run_inference_for_single_image(image, sess):
ops = tf.compat.v1.get_default_graph().get_operations()
all_tensor_names = {output.name for op in ops for... | 42.897959 | 113 | 0.673168 |
850fa5a6818143ff526a383e2c93a37c2e9b498b | 24,236 | py | Python | src/practice_problem3.py | fultoncn/14-Exam2Practice | 52206d105c7368a5ca548a3fe4afe896e2ac09d4 | [
"MIT"
] | null | null | null | src/practice_problem3.py | fultoncn/14-Exam2Practice | 52206d105c7368a5ca548a3fe4afe896e2ac09d4 | [
"MIT"
] | null | null | null | src/practice_problem3.py | fultoncn/14-Exam2Practice | 52206d105c7368a5ca548a3fe4afe896e2ac09d4 | [
"MIT"
] | null | null | null | """
PRACTICE Test 2, practice_problem 3.
Authors: David Mutchler, Dave Fisher, Valerie Galluzzi, Amanda Stouder,
their colleagues and Colleen Fulton.
""" # DONE: 1. PUT YOUR NAME IN THE ABOVE LINE.
########################################################################
# Students:
#
# These problems have D... | 42.222997 | 82 | 0.459812 |
e302e41cfd63928067b0bdbfa2e7c8594f3db761 | 1,549 | py | Python | utils_tf.py | elephanting/minimal-hand | 78fce3a4849a02a1f06a1bb670627fad943dba9a | [
"MIT"
] | null | null | null | utils_tf.py | elephanting/minimal-hand | 78fce3a4849a02a1f06a1bb670627fad943dba9a | [
"MIT"
] | null | null | null | utils_tf.py | elephanting/minimal-hand | 78fce3a4849a02a1f06a1bb670627fad943dba9a | [
"MIT"
] | null | null | null | import pickle
import sys
sys.path.append('./')
import cv2
import numpy as np
def imresize(img, size):
"""
Resize an image with cv2.INTER_LINEAR.
Parameters
----------
size: (width, height)
"""
return cv2.resize(img, size, cv2.INTER_LINEAR)
def load_pkl(path):
"""
Load pickle data.
Parameter
... | 20.932432 | 70 | 0.644932 |
eb5455c7e1ae456cea31a213cf95710e157a0e23 | 8,284 | py | Python | doc/conf.py | sayatul/trytond-sale-payment-gateway | 7ddcc77d946f4e3a71944477c3e83d7d06866cf7 | [
"BSD-3-Clause"
] | null | null | null | doc/conf.py | sayatul/trytond-sale-payment-gateway | 7ddcc77d946f4e3a71944477c3e83d7d06866cf7 | [
"BSD-3-Clause"
] | 6 | 2015-09-05T00:18:30.000Z | 2016-11-14T07:57:14.000Z | doc/conf.py | sayatul/trytond-sale-payment-gateway | 7ddcc77d946f4e3a71944477c3e83d7d06866cf7 | [
"BSD-3-Clause"
] | 15 | 2015-08-11T13:01:31.000Z | 2017-07-14T06:36:21.000Z | # -*- coding: utf-8 -*-
#
# Sale Payment Gateway documentation build configuration file, created by
# sphinx-quickstart on Wed Dec 17 11:47:54 2014.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerate... | 31.984556 | 79 | 0.719821 |
201c63dccba7d2814d509dede86d6bd88e3568a5 | 2,307 | py | Python | .leetcode/543.diameter-of-binary-tree.py | KuiyuanFu/PythonLeetCode | 8962df2fa838eb7ae48fa59de272ba55a89756d8 | [
"MIT"
] | null | null | null | .leetcode/543.diameter-of-binary-tree.py | KuiyuanFu/PythonLeetCode | 8962df2fa838eb7ae48fa59de272ba55a89756d8 | [
"MIT"
] | null | null | null | .leetcode/543.diameter-of-binary-tree.py | KuiyuanFu/PythonLeetCode | 8962df2fa838eb7ae48fa59de272ba55a89756d8 | [
"MIT"
] | null | null | null | # @lc app=leetcode id=543 lang=python3
#
# [543] Diameter of Binary Tree
#
# https://leetcode.com/problems/diameter-of-binary-tree/description/
#
# algorithms
# Easy (51.21%)
# Likes: 5759
# Dislikes: 356
# Total Accepted: 551.5K
# Total Submissions: 1.1M
# Testcase Example: '[1,2,3,4,5]'
#
# Given the root of a... | 19.887931 | 78 | 0.573039 |
75f99f6e916a5baa175831c215c4017bbdc99cb1 | 1,085 | py | Python | src/get_mrr_score.py | UMass-ReRanker/AlbertReRanker | f5eaddba2f3d82989ce602b62d98ebb8918e3a45 | [
"MIT"
] | null | null | null | src/get_mrr_score.py | UMass-ReRanker/AlbertReRanker | f5eaddba2f3d82989ce602b62d98ebb8918e3a45 | [
"MIT"
] | null | null | null | src/get_mrr_score.py | UMass-ReRanker/AlbertReRanker | f5eaddba2f3d82989ce602b62d98ebb8918e3a45 | [
"MIT"
] | null | null | null | import pandas as pd
import os
import sys
data_dir = sys.argv[1]
rel_output = pd.read_csv(sys.argv[2], sep=' ', header=None, names=['qid', 'Q0', 'did', 'rank', 'prob', 'run_name'])
relations = pd.read_csv(os.path.join(data_dir, sys.argv[3]),
sep=' ', header=None, names=['qid', '0', 'd... | 37.413793 | 115 | 0.606452 |
c47fb5855a67621529b86e3a004ad66cc92d365d | 1,521 | py | Python | app/auth/views.py | willy005/IP_Pitch | 39a188aca79857d549087a1b44be5f53ed03f246 | [
"MIT"
] | 1 | 2019-02-14T23:30:57.000Z | 2019-02-14T23:30:57.000Z | app/auth/views.py | willy005/IP_Pitch | 39a188aca79857d549087a1b44be5f53ed03f246 | [
"MIT"
] | null | null | null | app/auth/views.py | willy005/IP_Pitch | 39a188aca79857d549087a1b44be5f53ed03f246 | [
"MIT"
] | null | null | null | from flask import render_template,redirect,url_for, flash,request
from . import auth
from flask_login import login_user,logout_user,login_required, current_user
from ..models import User
from .forms import LoginForm,RegistrationForm
from .. import db
from ..email import mail_message
@auth.route('/login',methods=['GET... | 36.214286 | 105 | 0.708087 |
6b3eb030bda1ce44b229099b77c98df6cd1fbc01 | 9,813 | py | Python | mrjob/logs/step.py | irskep/mrjob | e21e4f55e38007c00213a478e1465f04833cce75 | [
"Apache-2.0"
] | null | null | null | mrjob/logs/step.py | irskep/mrjob | e21e4f55e38007c00213a478e1465f04833cce75 | [
"Apache-2.0"
] | null | null | null | mrjob/logs/step.py | irskep/mrjob | e21e4f55e38007c00213a478e1465f04833cce75 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2015-2016 Yelp
#
# 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 agre... | 32.92953 | 79 | 0.646693 |
178986b5113b9adce9b5c5bf50d0ff4d41f62c28 | 4,953 | py | Python | vnet_sign.py | takashiki/tool-scripts | 892ef2e107caf8f4248aa32543b8bbb8e92999ce | [
"MIT"
] | 5 | 2016-04-20T01:18:18.000Z | 2021-02-20T03:56:02.000Z | vnet_sign.py | takashiki/tool-scripts | 892ef2e107caf8f4248aa32543b8bbb8e92999ce | [
"MIT"
] | null | null | null | vnet_sign.py | takashiki/tool-scripts | 892ef2e107caf8f4248aa32543b8bbb8e92999ce | [
"MIT"
] | 10 | 2016-05-11T06:37:19.000Z | 2018-09-12T11:42:42.000Z | #!/usr/bin/python2
# -*- coding: utf-8 -*-
#
# This's an auto-sign script for vnet.link
# You should install PIL first, for Ubuntu 14.04:
# sudo apt-get build-dep python-imaging python-pip -y && pip install Pillow
#
# 12/3/2016 Cody Chan <int64ago@gmail.com>
# To support me, register from https://vnet.link/?rc=36900
#... | 71.782609 | 2,912 | 0.43933 |
6b6a9f56483aa07c01ca22db566e5ec437f398a5 | 19,503 | py | Python | omsdk/typemgr/ClassType.py | DanielFroehlich/omsdk | 475d925e4033104957fdc64480fe8f9af0ab6b8a | [
"Apache-2.0"
] | 61 | 2018-02-21T00:02:20.000Z | 2022-01-26T03:47:19.000Z | omsdk/typemgr/ClassType.py | DanielFroehlich/omsdk | 475d925e4033104957fdc64480fe8f9af0ab6b8a | [
"Apache-2.0"
] | 31 | 2018-03-24T05:43:39.000Z | 2022-03-16T07:10:37.000Z | omsdk/typemgr/ClassType.py | DanielFroehlich/omsdk | 475d925e4033104957fdc64480fe8f9af0ab6b8a | [
"Apache-2.0"
] | 25 | 2018-03-13T10:06:12.000Z | 2022-01-26T03:47:21.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
#
# Copyright © 2018 Dell Inc. or its subsidiaries. All rights reserved.
# Dell, EMC, and other trademarks are trademarks of Dell Inc. or its subsidiaries.
# Other trademarks may be trademarks of their respective owners.
#
# Licensed under the Apache License, Ver... | 37.723404 | 107 | 0.564529 |
5559fba262813eda5f35e4cd016655903e6985e7 | 29,286 | py | Python | desktop/libs/notebook/src/notebook/api.py | sqNutrien/hue | 64d56a82b5b800cb2370c0b08142d4cb9451e19a | [
"Apache-2.0"
] | null | null | null | desktop/libs/notebook/src/notebook/api.py | sqNutrien/hue | 64d56a82b5b800cb2370c0b08142d4cb9451e19a | [
"Apache-2.0"
] | null | null | null | desktop/libs/notebook/src/notebook/api.py | sqNutrien/hue | 64d56a82b5b800cb2370c0b08142d4cb9451e19a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | 34.617021 | 316 | 0.70054 |
bd8ab28a38f3bb3f4c658d48cc0ad5d9073cc75e | 2,326 | py | Python | mysfire/processors/image_processor.py | DavidMChan/mysfire | 38172063b17c4935e7f2f68562431f8ec25d958d | [
"MIT"
] | 3 | 2022-02-14T20:36:02.000Z | 2022-03-14T22:55:08.000Z | mysfire/processors/image_processor.py | DavidMChan/mysfire | 38172063b17c4935e7f2f68562431f8ec25d958d | [
"MIT"
] | null | null | null | mysfire/processors/image_processor.py | DavidMChan/mysfire | 38172063b17c4935e7f2f68562431f8ec25d958d | [
"MIT"
] | null | null | null | from typing import Dict, List, Optional, Union, Tuple, Any
import numpy as np
import torch
from ._array_utils import stack_arrays_as_dict
from ._processor import S3Processor
from . import register_processor
TORCHVISION_AVAILABLE = False
try:
import torchvision
TORCHVISION_AVAILABLE = True
except ImportError... | 29.443038 | 99 | 0.636285 |
7122557c7b626aedeb3ab1cd3f09acfe7cbcdd4b | 12,253 | py | Python | skexplain/plot/plot_interpret_curves.py | monte-flora/scikit-explain | d93ca4c77d1d47e613479ae36cc055ffaafea88c | [
"MIT"
] | null | null | null | skexplain/plot/plot_interpret_curves.py | monte-flora/scikit-explain | d93ca4c77d1d47e613479ae36cc055ffaafea88c | [
"MIT"
] | 7 | 2022-03-06T01:51:33.000Z | 2022-03-28T13:06:34.000Z | skexplain/plot/plot_interpret_curves.py | monte-flora/scikit-explain | d93ca4c77d1d47e613479ae36cc055ffaafea88c | [
"MIT"
] | null | null | null | from ..common.utils import to_list, is_list, is_str
from .base_plotting import PlotStructure
from math import log10
import numpy as np
import warnings
class PlotInterpretCurves(PlotStructure):
"""
InterpretCurves handles plotting the ALE and PDP curves and the corresponding
background histogram for the var... | 32.075916 | 88 | 0.526647 |
107797cd2e50308524e797338301a5fbc57d38ff | 44,990 | py | Python | cardio/dataset/dataset/batch_image.py | lbdvriesGT/cardio | da6c478739bd254ccc04ee0ba327fd1610d07a42 | [
"Apache-2.0"
] | 87 | 2018-11-16T08:04:12.000Z | 2022-03-24T20:08:44.000Z | cardio/dataset/dataset/batch_image.py | lbdvriesGT/cardio | da6c478739bd254ccc04ee0ba327fd1610d07a42 | [
"Apache-2.0"
] | 243 | 2018-11-29T02:03:55.000Z | 2022-02-21T08:28:29.000Z | cardio/dataset/dataset/batch_image.py | lbdvriesGT/cardio | da6c478739bd254ccc04ee0ba327fd1610d07a42 | [
"Apache-2.0"
] | 35 | 2019-01-29T14:26:14.000Z | 2021-12-30T01:39:02.000Z | """ Contains Batch classes for images """
import os
import warnings
from numbers import Number
import numpy as np
import PIL
import PIL.ImageOps
import PIL.ImageChops
import PIL.ImageFilter
import PIL.ImageEnhance
from scipy.ndimage.filters import gaussian_filter
from scipy.ndimage.interpolation import map_coordinates... | 40.385996 | 120 | 0.583885 |
8abcef48bdccccc3fea2d2e58a4b27e8103feebf | 616 | py | Python | main.py | atf1999/tba-eventcodes-grab | 7c55a370aeefe9ab3d5c9a92b1b40416ec5ec810 | [
"MIT"
] | null | null | null | main.py | atf1999/tba-eventcodes-grab | 7c55a370aeefe9ab3d5c9a92b1b40416ec5ec810 | [
"MIT"
] | null | null | null | main.py | atf1999/tba-eventcodes-grab | 7c55a370aeefe9ab3d5c9a92b1b40416ec5ec810 | [
"MIT"
] | null | null | null | import argparse
import requests
import json
import datetime
appId = "eventcodesgrab:grabbing event codes:0.1"
content = ""
year = datetime.datetime.now().year
parser = argparse.ArgumentParser(description='Get event codes from tba api')
parser.add_argument('--year', help='year to get event codes')
args = parser.par... | 22.814815 | 100 | 0.681818 |
5e86fda3b41f554d2f3bd339f1584849d2e96099 | 6,131 | py | Python | trakt/core/emitter.py | timbooo/traktforalfred | 35cd786d77f5a7c86884d78b643cac5b76b42844 | [
"MIT"
] | 11 | 2015-02-01T22:22:48.000Z | 2019-01-24T12:18:07.000Z | trakt/core/emitter.py | der-tkw/traktforalfred | 35cd786d77f5a7c86884d78b643cac5b76b42844 | [
"MIT"
] | 3 | 2015-03-26T12:18:02.000Z | 2019-02-21T08:12:04.000Z | trakt/core/emitter.py | timbooo/traktforalfred | 35cd786d77f5a7c86884d78b643cac5b76b42844 | [
"MIT"
] | 2 | 2016-07-19T22:55:16.000Z | 2019-01-24T12:19:08.000Z | import logging
import traceback
# concurrent.futures is optional
try:
from concurrent.futures import ThreadPoolExecutor
except ImportError:
ThreadPoolExecutor = None
log = logging.getLogger(__name__)
class Emitter(object):
threading = False
threading_workers = 2
__constructed ... | 27.248889 | 113 | 0.56092 |
1ecc519d4227df96d2cccff43400135359de098f | 72,324 | py | Python | airflow/bin/cli.py | matt2000/incubator-airflow | 6b2fdbef0ab4bd1ed91e6338bcf6440e782b7035 | [
"Apache-2.0"
] | null | null | null | airflow/bin/cli.py | matt2000/incubator-airflow | 6b2fdbef0ab4bd1ed91e6338bcf6440e782b7035 | [
"Apache-2.0"
] | null | null | null | airflow/bin/cli.py | matt2000/incubator-airflow | 6b2fdbef0ab4bd1ed91e6338bcf6440e782b7035 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Licensed to the Apache Software Foundation (ASF) 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 Licen... | 36.956566 | 90 | 0.54372 |
b664e3bfb814cabfa527580a872cad9d3282c93b | 8,411 | py | Python | tools/extensions/extensions_check.py | VMAJSTER/envoy | bd0ec3d14bc2c6159ee9fafe76355f9607b5c9f7 | [
"Apache-2.0"
] | 1 | 2022-02-15T23:04:31.000Z | 2022-02-15T23:04:31.000Z | tools/extensions/extensions_check.py | VMAJSTER/envoy | bd0ec3d14bc2c6159ee9fafe76355f9607b5c9f7 | [
"Apache-2.0"
] | 66 | 2021-11-01T01:12:48.000Z | 2022-02-14T03:12:42.000Z | tools/extensions/extensions_check.py | VMAJSTER/envoy | bd0ec3d14bc2c6159ee9fafe76355f9607b5c9f7 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Validate extension metadata
import json
import pathlib
import re
import sys
from functools import cached_property
from typing import Iterator
from aio.run import checker
from envoy.base import utils
BUILTIN_EXTENSIONS = (
"envoy.request_id.uuid", "envoy.upstreams.tcp.generic", "envoy.t... | 42.913265 | 99 | 0.704078 |
7b17138a673c8e52cba72b497dda2fcaa6c12707 | 5,171 | py | Python | gradient/cli/workflows.py | macsunmood/gradient-cli | e1046d71cbebf88b6aa4d2c4e30fd8d8d7616b76 | [
"0BSD"
] | null | null | null | gradient/cli/workflows.py | macsunmood/gradient-cli | e1046d71cbebf88b6aa4d2c4e30fd8d8d7616b76 | [
"0BSD"
] | null | null | null | gradient/cli/workflows.py | macsunmood/gradient-cli | e1046d71cbebf88b6aa4d2c4e30fd8d8d7616b76 | [
"0BSD"
] | null | null | null | import click
from gradient.cli import common
from gradient.cli.cli import cli
from gradient.cli.common import ClickGroup, api_key_option
from gradient.commands.workflows import ListWorkflowsCommand, ListWorkflowRunsCommand, GetWorkflowCommand, GetWorkflowRunCommand, CreateWorkflowCommand, CreateWorkflowRunCommand, Wor... | 26.116162 | 198 | 0.684007 |
1df14fe60f6c2a560cacbfba3ae5c1e13bfd25c4 | 5,848 | py | Python | Allura/allura/config/app_cfg.py | rohankumardubey/allura | 9c490a051ca912d28b81ce656441d6fed100cb24 | [
"Apache-2.0"
] | 113 | 2015-03-25T10:33:37.000Z | 2022-02-16T20:55:06.000Z | Allura/allura/config/app_cfg.py | rohankumardubey/allura | 9c490a051ca912d28b81ce656441d6fed100cb24 | [
"Apache-2.0"
] | 4 | 2017-08-04T16:19:07.000Z | 2020-06-08T19:01:33.000Z | Allura/allura/config/app_cfg.py | rohankumardubey/allura | 9c490a051ca912d28b81ce656441d6fed100cb24 | [
"Apache-2.0"
] | 36 | 2015-08-14T16:27:39.000Z | 2022-02-16T20:54:35.000Z | # -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) 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 Apach... | 39.782313 | 118 | 0.689979 |
8964569b370916593aff65161df9e09301043fb4 | 774 | py | Python | geometry.py | yxlao/camtools | 4c7b41cd5a5232a2e8e3e26bca72d372f46099fb | [
"MIT"
] | 3 | 2022-02-15T01:55:42.000Z | 2022-02-15T02:47:08.000Z | geometry.py | yxlao/camtools | 4c7b41cd5a5232a2e8e3e26bca72d372f46099fb | [
"MIT"
] | null | null | null | geometry.py | yxlao/camtools | 4c7b41cd5a5232a2e8e3e26bca72d372f46099fb | [
"MIT"
] | null | null | null | import open3d as o3d
import numpy as np
def create_sphere_lineset(radius=1.0, resolution=10, color=[0, 0, 0]):
sphere_mesh = o3d.geometry.TriangleMesh.create_sphere(radius=radius,
resolution=resolution)
triangles = np.asarray(sphere_mesh.triangles)
... | 36.857143 | 80 | 0.620155 |
3ec0658802560cb09c5a1a92248f738c3af9f343 | 5,369 | py | Python | conda/models/enums.py | sakibguy/conda | 892f9f6a196312765b515b0db53a5558566fe456 | [
"BSD-3-Clause"
] | null | null | null | conda/models/enums.py | sakibguy/conda | 892f9f6a196312765b515b0db53a5558566fe456 | [
"BSD-3-Clause"
] | 3 | 2022-03-03T02:36:53.000Z | 2022-03-03T02:42:50.000Z | conda/models/enums.py | sakibguy/conda | 892f9f6a196312765b515b0db53a5558566fe456 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 2012 Anaconda, Inc
# SPDX-License-Identifier: BSD-3-Clause
from __future__ import absolute_import, division, print_function, unicode_literals
from platform import machine
import sys
from enum import Enum
from ..auxlib.decorators import classproperty
from ..auxlib.ish import da... | 27.818653 | 99 | 0.637549 |
f565813cf3d25a246e21357cef64ed7a85b9a4f6 | 13,037 | py | Python | oslo/pytorch/kernel_fusion/mem_efficient/partitioners.py | Mehrad0711/oslo | 873d771a68bc380903947010da0b66f58f60e496 | [
"Apache-2.0"
] | null | null | null | oslo/pytorch/kernel_fusion/mem_efficient/partitioners.py | Mehrad0711/oslo | 873d771a68bc380903947010da0b66f58f60e496 | [
"Apache-2.0"
] | null | null | null | oslo/pytorch/kernel_fusion/mem_efficient/partitioners.py | Mehrad0711/oslo | 873d771a68bc380903947010da0b66f58f60e496 | [
"Apache-2.0"
] | null | null | null | import copy
import math
import operator
import os
import torch
import torch.fx as fx
import torch.utils._pytree as pytree
from torch.fx.passes import graph_drawer
from oslo.pytorch.kernel_fusion.mem_efficient.compat.partitioners import (
unrecomputable_ops,
)
class InvalidNodeBase(object):
def __repr__(self... | 32.921717 | 273 | 0.634272 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.