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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
54437b7edeb0be120ed093b860ffa51cd3fdd790 | 967 | py | Python | botoy/__version__.py | SalimTerryLi/botoy | 16b462fa3a5bea0035d94cb2161726767d8bdbbc | [
"MIT"
] | null | null | null | botoy/__version__.py | SalimTerryLi/botoy | 16b462fa3a5bea0035d94cb2161726767d8bdbbc | [
"MIT"
] | null | null | null | botoy/__version__.py | SalimTerryLi/botoy | 16b462fa3a5bea0035d94cb2161726767d8bdbbc | [
"MIT"
] | null | null | null | # pylint: disable=C0415,C0413
__version__ = '0.0.25'
def check_version():
def _check_version():
import re
from distutils.version import LooseVersion as V
import httpx
try:
resp = httpx.get(
'https://mirrors.aliyun.com/pypi/simple/botoy/', timeout=10
... | 28.441176 | 133 | 0.550155 |
c8421f6cf623b491f9eebd728a00918963f35adb | 2,334 | py | Python | games/game_tick_tack_toe/tick_tack_toe.py | sdenisen/test | 709bcdd16d0f83f03b04e0bc7918bb3785993c59 | [
"Unlicense"
] | null | null | null | games/game_tick_tack_toe/tick_tack_toe.py | sdenisen/test | 709bcdd16d0f83f03b04e0bc7918bb3785993c59 | [
"Unlicense"
] | 2 | 2017-08-24T18:55:37.000Z | 2017-08-24T18:59:06.000Z | games/game_tick_tack_toe/tick_tack_toe.py | sdenisen/test | 709bcdd16d0f83f03b04e0bc7918bb3785993c59 | [
"Unlicense"
] | null | null | null | EMPTY_CELL = "-"
X_CELL = "X"
O_CELL = "O"
def is_defined_winner(array):
# TODO: need to check for winner.
return False
def check_correct_input(cell_input_index, cells_array):
"""
Check that cell_index is satisfied of criteria: digit / cell of array is not filled / and index between 0 and 9.
:pa... | 26.224719 | 116 | 0.626392 |
dea4a4acdca1568f4184909682ecc90bcf7f8f87 | 3,385 | py | Python | tests/models/validators/v2_2_2_3/jsd_bdc3bc8a35908aba5858e78805d22.py | oboehmer/dnacentersdk | 25c4e99900640deee91a56aa886874d9cb0ca960 | [
"MIT"
] | 32 | 2019-09-05T05:16:56.000Z | 2022-03-22T09:50:38.000Z | tests/models/validators/v2_2_2_3/jsd_bdc3bc8a35908aba5858e78805d22.py | oboehmer/dnacentersdk | 25c4e99900640deee91a56aa886874d9cb0ca960 | [
"MIT"
] | 35 | 2019-09-07T18:58:54.000Z | 2022-03-24T19:29:36.000Z | tests/models/validators/v2_2_2_3/jsd_bdc3bc8a35908aba5858e78805d22.py | oboehmer/dnacentersdk | 25c4e99900640deee91a56aa886874d9cb0ca960 | [
"MIT"
] | 18 | 2019-09-09T11:07:21.000Z | 2022-03-25T08:49:59.000Z | # -*- coding: utf-8 -*-
"""Cisco DNA Center GetsTheTemplatesAvailable data model.
Copyright (c) 2019-2021 Cisco Systems.
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, inclu... | 32.238095 | 80 | 0.532053 |
8a0a6a561d3bbd6375a300e364bfaa02afbc06ae | 7,481 | py | Python | src/main/python/progress1bar/progressbar.py | soda480/progress1bar | 51afa33d14c17a3d1df674363573aa7daa774ab3 | [
"Apache-2.0"
] | null | null | null | src/main/python/progress1bar/progressbar.py | soda480/progress1bar | 51afa33d14c17a3d1df674363573aa7daa774ab3 | [
"Apache-2.0"
] | 2 | 2021-09-10T18:56:33.000Z | 2021-10-03T03:53:18.000Z | src/main/python/progress1bar/progressbar.py | soda480/progress1bar | 51afa33d14c17a3d1df674363573aa7daa774ab3 | [
"Apache-2.0"
] | null | null | null | import re
import sys
import logging
import cursor
from colorama import Style
from colorama import Fore
from colorama import Back
from colorama import Cursor
from colorama import init as colorama_init
logger = logging.getLogger(__name__)
TICKER = chr(9632) # ■
PROGRESS_WIDTH = 50
ALIAS_WIDTH = 100
FILL = 2
CLEAR_EOL... | 32.955947 | 125 | 0.55407 |
b6d48018bbd7fb518898b9387d542fdb3cc0411d | 7,428 | py | Python | src/regularization/learning_rate_decay.py | aligholamee/UD730 | 936ef8ae4a0a285de6b19919f351a956c72e4cc8 | [
"MIT"
] | 2 | 2018-02-07T21:31:09.000Z | 2018-02-08T06:34:38.000Z | src/regularization/learning_rate_decay.py | aligholamee/notMNIST | 936ef8ae4a0a285de6b19919f351a956c72e4cc8 | [
"MIT"
] | null | null | null | src/regularization/learning_rate_decay.py | aligholamee/notMNIST | 936ef8ae4a0a285de6b19919f351a956c72e4cc8 | [
"MIT"
] | 2 | 2020-04-07T06:39:26.000Z | 2021-02-03T09:59:38.000Z | # ========================================
# [] File Name : learning_rate_decay.py
#
# [] Creation Date : January 2018
#
# [] Created By : Ali Gholami (aligholami7596@gmail.com)
# ========================================
"""
Training and Validation on notMNIST Dataset.
Implementing some regularization techniqu... | 40.369565 | 137 | 0.643511 |
5b9e6da6891adbffeacbd1d52b4514210f880086 | 770 | py | Python | src/AlienVault.py | anarmammad/Raptor | b957a144aafcc4c636c74bec402995d6da201b18 | [
"MIT"
] | 39 | 2021-03-12T10:01:23.000Z | 2022-02-25T15:25:42.000Z | src/AlienVault.py | anarmammad/Raptor | b957a144aafcc4c636c74bec402995d6da201b18 | [
"MIT"
] | 14 | 2021-03-22T11:40:22.000Z | 2021-04-15T16:30:23.000Z | src/AlienVault.py | anarmammad/Raptor | b957a144aafcc4c636c74bec402995d6da201b18 | [
"MIT"
] | 4 | 2021-03-16T16:06:37.000Z | 2021-07-03T01:14:53.000Z | from .Base import BaseClass
from utils.Utility import LOGGER,Log
class AlienVault(BaseClass):
def __init__(self):
super().__init__()
self.URL="https://otx.alienvault.com/api/v1/indicators/domain/{domain}/passive_dns"
@LOGGER("AlienVault")
def start(self,domain):
resu... | 30.8 | 91 | 0.596104 |
3eb8649b5c3742cce4b7db4cfafd3929085ec74d | 928 | py | Python | shapes/rectangle.py | mgaranina/programming-2021-19fpl | e3f9b95167cd3fd793dcd891a222127c2f1c9abf | [
"MIT"
] | null | null | null | shapes/rectangle.py | mgaranina/programming-2021-19fpl | e3f9b95167cd3fd793dcd891a222127c2f1c9abf | [
"MIT"
] | null | null | null | shapes/rectangle.py | mgaranina/programming-2021-19fpl | e3f9b95167cd3fd793dcd891a222127c2f1c9abf | [
"MIT"
] | null | null | null | """
Programming for linguists
Implementation of the class Rectangle
"""
from math import sqrt
from shapes.shape import Shape
class Rectangle(Shape):
"""
A class for rectangles
"""
def __init__(self, uid: int, width: int, length: int):
super().__init__(uid)
self.width = width
... | 22.634146 | 58 | 0.592672 |
e7272096ffbdf6ee2ccce5a080b7db85dc8d2a4d | 4,217 | py | Python | examples/thermal_options.py | scotthavens/smrf | a492d01a5eef994e00728c1cbed9f693879bbade | [
"CC0-1.0"
] | null | null | null | examples/thermal_options.py | scotthavens/smrf | a492d01a5eef994e00728c1cbed9f693879bbade | [
"CC0-1.0"
] | null | null | null | examples/thermal_options.py | scotthavens/smrf | a492d01a5eef994e00728c1cbed9f693879bbade | [
"CC0-1.0"
] | null | null | null | """
There are many different options for estimating clear sky thermal (long wave) radiation in
SMRF. Currently 4 methods are available and this example will show the differences between
the methods.
20170509 Scott Havens
"""
import sys
import matplotlib.pyplot as plt
import numpy as np
import smrf
# the different ... | 35.737288 | 102 | 0.530235 |
bb4b5eff98a3cc9ac3c78dfba5e98306d260cbcc | 1,686 | py | Python | stubs.min/Autodesk/Revit/DB/__init___parts/ExportLinetypeKey.py | ricardyn/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | 1 | 2021-02-02T13:39:16.000Z | 2021-02-02T13:39:16.000Z | stubs.min/Autodesk/Revit/DB/__init___parts/ExportLinetypeKey.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | stubs.min/Autodesk/Revit/DB/__init___parts/ExportLinetypeKey.py | hdm-dt-fb/ironpython-stubs | 4d2b405eda3ceed186e8adca55dd97c332c6f49d | [
"MIT"
] | null | null | null | class ExportLinetypeKey(object,IDisposable):
"""
A key used to represent an item stored in an Autodesk.Revit.DB.ExportLinetypeTable.
ExportLinetypeKey(originalLinetypeName: str)
ExportLinetypeKey()
ExportLinetypeKey(other: ExportLinetypeKey)
"""
def Dispose(self):
""" Dispose(self: ExportLinetyp... | 33.058824 | 215 | 0.708778 |
fc6ec5643dddc4e23fb6be25aeab8365a8b0528a | 1,191 | py | Python | am_instapound_backend/users/tests/test_forms.py | eryknn/am-instapound-backend | b7114ce323229e92b2770403cb72886726a461ef | [
"MIT"
] | null | null | null | am_instapound_backend/users/tests/test_forms.py | eryknn/am-instapound-backend | b7114ce323229e92b2770403cb72886726a461ef | [
"MIT"
] | null | null | null | am_instapound_backend/users/tests/test_forms.py | eryknn/am-instapound-backend | b7114ce323229e92b2770403cb72886726a461ef | [
"MIT"
] | null | null | null | """
Module for all Form Tests.
"""
import pytest
from django.utils.translation import gettext_lazy as _
from am_instapound_backend.users.forms import UserCreationForm
from am_instapound_backend.users.models import User
pytestmark = pytest.mark.django_db
class TestUserCreationForm:
"""
Test class for all tes... | 29.775 | 87 | 0.63728 |
62dbc2cb8748cb60b55af85f4f1e96960e82056f | 1,078 | py | Python | pmu-tools-master/gen-dot.py | patinnc/60secs | 45ad68e4359e0dfd506f9e3a898c216ed38e7fd0 | [
"MIT"
] | null | null | null | pmu-tools-master/gen-dot.py | patinnc/60secs | 45ad68e4359e0dfd506f9e3a898c216ed38e7fd0 | [
"MIT"
] | null | null | null | pmu-tools-master/gen-dot.py | patinnc/60secs | 45ad68e4359e0dfd506f9e3a898c216ed38e7fd0 | [
"MIT"
] | 1 | 2021-03-22T20:38:10.000Z | 2021-03-22T20:38:10.000Z | #!/usr/bin/env python2
# generate dot diagram of top down tree from module
import sys
max_level = 5
first = 1
if sys.argv[1:] and sys.argv[1][:2] == "-l":
max_level = int(sys.argv[1][2:])
first += 1
if len(sys.argv) > first and sys.argv[first] == "simple":
import simple_ratios
m = simple_ratios
else:
... | 22 | 65 | 0.560297 |
97cefed88ca0991767875cd1e8a8964f91469edb | 852 | py | Python | project-euler/python/problem-004.py | Luc-Saccoccio/coding-contests | 64a6929b9c053024f1a63b7a442014bfe01ed5a3 | [
"WTFPL"
] | 1 | 2021-08-01T09:11:10.000Z | 2021-08-01T09:11:10.000Z | project-euler/python/problem-004.py | Luc-Saccoccio/coding-contests | 64a6929b9c053024f1a63b7a442014bfe01ed5a3 | [
"WTFPL"
] | null | null | null | project-euler/python/problem-004.py | Luc-Saccoccio/coding-contests | 64a6929b9c053024f1a63b7a442014bfe01ed5a3 | [
"WTFPL"
] | null | null | null | # A palindromic number reads the same both ways.
# The largest palindrome made from the product of two 2-digit
# numbers is 9009 = 91 × 99.
# Find the largest palindrome made from the product of
# two 3-digit numbers.
def solution_v1() -> int:
palindrome = 0
for i in range(1000, 100, -1):
for j in rang... | 30.428571 | 66 | 0.576291 |
5bee05f9bdeb7521d0cdbf8208699e35c57c7b02 | 294 | py | Python | ex15.py | Douglas318/curso_python | ab5ee604ff3887e67a76abae66ced4922c400fbe | [
"MIT"
] | null | null | null | ex15.py | Douglas318/curso_python | ab5ee604ff3887e67a76abae66ced4922c400fbe | [
"MIT"
] | null | null | null | ex15.py | Douglas318/curso_python | ab5ee604ff3887e67a76abae66ced4922c400fbe | [
"MIT"
] | null | null | null | from math import hypot
cateto_oposto = float(input('Informe o comprimento do cateto oposto: '))
cateto_adjacente = float(input('Informe o comprimento do cateto adjacente: '))
hipotenusa = hypot(cateto_oposto, cateto_adjacente)
print('O comprimento da hipotenusa é {:.2f}'.format(hipotenusa)) | 42 | 78 | 0.778912 |
4895c95d9d4fc30ec0242dec48e6307c8e6ef2e7 | 82 | py | Python | iniciante/1157.py | samucosta13/URI-Online-Judge | d3dc0c4c3ccf260e02cb3705a11226cbddffb90b | [
"MIT"
] | 2 | 2021-05-28T18:52:53.000Z | 2021-06-04T19:30:39.000Z | iniciante/1157.py | samucosta13/URI-Online-Judge | d3dc0c4c3ccf260e02cb3705a11226cbddffb90b | [
"MIT"
] | null | null | null | iniciante/1157.py | samucosta13/URI-Online-Judge | d3dc0c4c3ccf260e02cb3705a11226cbddffb90b | [
"MIT"
] | null | null | null | N = int(input())
i = 1
while i <= N:
if N%i == 0:
print(i)
i += 1
| 11.714286 | 16 | 0.378049 |
9b4cf94ed1843cfc55770f7c61ca1c575fcc72a3 | 13,950 | py | Python | espnet/nets/ctc_prefix_score.py | roshansh-cmu/espnet | 5fa6dcc4e649dc66397c629d0030d09ecef36b80 | [
"Apache-2.0"
] | null | null | null | espnet/nets/ctc_prefix_score.py | roshansh-cmu/espnet | 5fa6dcc4e649dc66397c629d0030d09ecef36b80 | [
"Apache-2.0"
] | null | null | null | espnet/nets/ctc_prefix_score.py | roshansh-cmu/espnet | 5fa6dcc4e649dc66397c629d0030d09ecef36b80 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Copyright 2018 Mitsubishi Electric Research Labs (Takaaki Hori)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import numpy as np
import six
import torch
class CTCPrefixScoreTH(object):
"""Batch processing of CTCPrefixScore
which is based on Algorithm 2 in WATANABE et ... | 38.857939 | 87 | 0.54724 |
57f9d3f117e7ee6659ae6c39caa51bf1240965f1 | 2,973 | py | Python | openverse_catalog/dags/commoncrawl/commoncrawl_scripts/commoncrawl_s3_syncer/SyncImageProviders.py | yavik-kapadia/openverse-catalog | 853766f2176a96450f456a9fd6675e134c0866e1 | [
"MIT"
] | 25 | 2021-05-06T20:53:45.000Z | 2022-03-30T23:18:50.000Z | openverse_catalog/dags/commoncrawl/commoncrawl_scripts/commoncrawl_s3_syncer/SyncImageProviders.py | yavik-kapadia/openverse-catalog | 853766f2176a96450f456a9fd6675e134c0866e1 | [
"MIT"
] | 272 | 2021-05-17T05:53:00.000Z | 2022-03-31T23:57:20.000Z | openverse_catalog/dags/commoncrawl/commoncrawl_scripts/commoncrawl_s3_syncer/SyncImageProviders.py | yavik-kapadia/openverse-catalog | 853766f2176a96450f456a9fd6675e134c0866e1 | [
"MIT"
] | 13 | 2021-06-12T07:09:06.000Z | 2022-03-29T17:39:13.000Z | # flake8: noqa
import argparse
import os
import re
import boto3
from botocore import UNSIGNED
from botocore.client import Config
BUCKET = os.environ["S3_BUCKET"]
COMMONCRAWL_BUCKET = os.environ.get("COMMONCRAWL_BUCKET", "not_set")
PATH = os.environ["OUTPUT_DIR"]
ACCESS_KEY = os.environ["AWS_ACCESS_KEY"]
SECRET_KEY =... | 28.864078 | 88 | 0.608813 |
32d92158ea1e96a591cd4ad58f436ac35b10ad26 | 6,198 | py | Python | dask_cuda/benchmarks/utils.py | necaris/dask-cuda | 381195162564be133339d82b033f58949e400941 | [
"Apache-2.0"
] | null | null | null | dask_cuda/benchmarks/utils.py | necaris/dask-cuda | 381195162564be133339d82b033f58949e400941 | [
"Apache-2.0"
] | null | null | null | dask_cuda/benchmarks/utils.py | necaris/dask-cuda | 381195162564be133339d82b033f58949e400941 | [
"Apache-2.0"
] | null | null | null | import argparse
from dask.distributed import SSHCluster
from dask_cuda.local_cuda_cluster import LocalCUDACluster
def parse_benchmark_args(description="Generic dask-cuda Benchmark", args_list=[]):
parser = argparse.ArgumentParser(description=description)
parser.add_argument(
"-d", "--devs", default=... | 31.784615 | 87 | 0.607293 |
87b8e5d4a4c403c1e33d8ea9c1529f056cb42aa0 | 646 | py | Python | mapnik_style_generator/utils/PandasMerge.py | sjsafranek/GeoTileServer | 4f39ce3b6dc5bd374d4a683fd7a425e950b218f0 | [
"MIT"
] | 1 | 2017-09-29T21:30:33.000Z | 2017-09-29T21:30:33.000Z | mapnik_style_generator/utils/PandasMerge.py | sjsafranek/go-tileserver | 5453186b5c00281588aeba82311bea8ddf8d8ae2 | [
"BSD-3-Clause"
] | null | null | null | mapnik_style_generator/utils/PandasMerge.py | sjsafranek/go-tileserver | 5453186b5c00281588aeba82311bea8ddf8d8ae2 | [
"BSD-3-Clause"
] | null | null | null | #table join
#stefan safranek
import csv, os, sys, time
import pandas as pd
start_time = time.time() #start time
#File 1
IMPORT_FILE = "Burns_wO_LnLID.csv"
SAVE_FILE = IMPORT_FILE.replace('.csv','') + " MATCHED.csv"
df1 = pd.read_csv("Burns HD 58.csv", index_col=None, usecols=[0,1,2,4], parse_dates=True... | 22.275862 | 90 | 0.690402 |
ed24610abaaa3edb57aa7d7bf0dc316d7c5e9ad8 | 2,596 | py | Python | python-examples/example1.py | mages/api-tutorial | bb3a27723ed79ffeeb819b721f837de50c66c660 | [
"MIT"
] | 14 | 2019-01-06T12:39:24.000Z | 2020-05-10T19:37:33.000Z | python-examples/example1.py | mages/api-tutorial | bb3a27723ed79ffeeb819b721f837de50c66c660 | [
"MIT"
] | null | null | null | python-examples/example1.py | mages/api-tutorial | bb3a27723ed79ffeeb819b721f837de50c66c660 | [
"MIT"
] | 12 | 2019-01-12T19:58:08.000Z | 2020-06-19T00:32:27.000Z | import requests
import pandas as pd
# here you have to enter your actual API key from SimFin
api_key = "YOUR_API_KEY"
# list of tickers we want to get data for
tickers = ["AAPL", "NVDA", "WMT"]
# first: find SimFin IDs
sim_ids = []
for ticker in tickers:
request_url = f'https://simfin.com/api/v1/info/find-id/ti... | 33.714286 | 178 | 0.604006 |
13ef0261d8eaa71897df066f57421868624f4eb2 | 573 | py | Python | setup.py | HelloWorld-py/AudioLib | bf7a2a98de0818ef87f78c501faa24b9107539d1 | [
"MIT"
] | null | null | null | setup.py | HelloWorld-py/AudioLib | bf7a2a98de0818ef87f78c501faa24b9107539d1 | [
"MIT"
] | null | null | null | setup.py | HelloWorld-py/AudioLib | bf7a2a98de0818ef87f78c501faa24b9107539d1 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
long_description = open("README.rst", "r").read()
setup(name='AudioLib',
version='1.1.0',
description='A high level audio playback library for python',
long_description=long_description,
long_description_content_type='text/x-rst',
url='http... | 24.913043 | 67 | 0.682373 |
dc173d6832388c8d951ce7f1936a03f2521fef9e | 142 | py | Python | third_party/python-pinyin/tests/utils.py | zh794390558/DeepSpeech | 34178893327ad359cb816e55d7c66a10244fa08a | [
"Apache-2.0"
] | 1 | 2021-05-14T23:27:13.000Z | 2021-05-14T23:27:13.000Z | third_party/python-pinyin/tests/utils.py | zh794390558/DeepSpeech | 34178893327ad359cb816e55d7c66a10244fa08a | [
"Apache-2.0"
] | null | null | null | third_party/python-pinyin/tests/utils.py | zh794390558/DeepSpeech | 34178893327ad359cb816e55d7c66a10244fa08a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
def has_module(module):
try:
__import__(module)
return True
except ImportError:
pass
| 14.2 | 26 | 0.598592 |
2e43f7cef8193b2273e687e27204c98115078d57 | 19,784 | py | Python | support/docopt.py | ldanko/fmt | 33ea717ee2dc520f09e8b4816b58e227f5e5bba4 | [
"PSF-2.0"
] | 13,148 | 2016-04-27T15:22:55.000Z | 2022-03-31T19:19:21.000Z | support/docopt.py | ldanko/fmt | 33ea717ee2dc520f09e8b4816b58e227f5e5bba4 | [
"PSF-2.0"
] | 2,455 | 2016-04-28T14:09:37.000Z | 2022-03-31T14:22:49.000Z | support/docopt.py | ldanko/fmt | 33ea717ee2dc520f09e8b4816b58e227f5e5bba4 | [
"PSF-2.0"
] | 1,915 | 2016-04-28T01:13:50.000Z | 2022-03-31T13:03:29.000Z | """Pythonic command-line interface parser that will make you smile.
* http://docopt.org
* Repository and issue-tracker: https://github.com/docopt/docopt
* Licensed under terms of MIT license (see LICENSE-MIT)
* Copyright (c) 2013 Vladimir Keleshev, vladimir@keleshev.com
"""
import sys
import re
__all__ = ['doco... | 33.993127 | 79 | 0.561868 |
388927a6f806448d33ff57ac076a4c34b859af8a | 25,000 | py | Python | webserver/python2.7/site-packages/sympy/logic/tests/test_boolalg.py | maxr1876/Radix | bf9a5470908ea0823c8398565086b1e6b960c73b | [
"BSD-2-Clause"
] | 1 | 2018-10-22T09:15:57.000Z | 2018-10-22T09:15:57.000Z | webserver/python2.7/site-packages/sympy/logic/tests/test_boolalg.py | maxr1876/Radix | bf9a5470908ea0823c8398565086b1e6b960c73b | [
"BSD-2-Clause"
] | 1 | 2015-11-01T17:20:32.000Z | 2015-11-01T17:20:32.000Z | webserver/python2.7/site-packages/sympy/logic/tests/test_boolalg.py | maxr1876/Radix | bf9a5470908ea0823c8398565086b1e6b960c73b | [
"BSD-2-Clause"
] | 1 | 2018-10-22T09:17:11.000Z | 2018-10-22T09:17:11.000Z | from __future__ import division
from sympy.assumptions.ask import Q
from sympy.core.numbers import oo
from sympy.core.relational import Equality
from sympy.core.singleton import S
from sympy.core.symbol import (Dummy, symbols)
from sympy.sets.sets import (EmptySet, Interval, Union)
from sympy.simplify.simplify import ... | 31.806616 | 91 | 0.55272 |
bb77db4c851d534733034720a31aa16056608078 | 329 | py | Python | ci/infra/testrunner/tests/test_upgrade_plan_all_fine.py | jvanz/skuba | da18f4aa83fe2ed26fd4cd3cd689e2300f4f386c | [
"Apache-2.0"
] | null | null | null | ci/infra/testrunner/tests/test_upgrade_plan_all_fine.py | jvanz/skuba | da18f4aa83fe2ed26fd4cd3cd689e2300f4f386c | [
"Apache-2.0"
] | null | null | null | ci/infra/testrunner/tests/test_upgrade_plan_all_fine.py | jvanz/skuba | da18f4aa83fe2ed26fd4cd3cd689e2300f4f386c | [
"Apache-2.0"
] | null | null | null | import pytest
@pytest.mark.disruptive
def test_upgrade_plan_all_fine(provision, skuba, kubectl, platform):
"""
Starting from a up-to-date cluster, check what cluster/node plan report.
"""
out = skuba.cluster_upgrade_plan()
assert out.find(
"All nodes match the current cluster version"
... | 23.5 | 76 | 0.68997 |
136fe03a0dec221abd65ea29f0981b6c805592b0 | 1,965 | py | Python | igibson/robots/jr2_robot.py | fxia22/gibson_demos | 5f8d253694b23b41c53959774203ba5787578b74 | [
"MIT"
] | 1 | 2021-08-03T23:59:21.000Z | 2021-08-03T23:59:21.000Z | igibson/robots/jr2_robot.py | fxia22/gibson_demos | 5f8d253694b23b41c53959774203ba5787578b74 | [
"MIT"
] | null | null | null | igibson/robots/jr2_robot.py | fxia22/gibson_demos | 5f8d253694b23b41c53959774203ba5787578b74 | [
"MIT"
] | 1 | 2021-12-01T16:09:01.000Z | 2021-12-01T16:09:01.000Z | import gym
import numpy as np
from igibson.robots.robot_locomotor import LocomotorRobot
class JR2(LocomotorRobot):
"""
JR2 robot (no arm)
Reference: https://cvgl.stanford.edu/projects/jackrabbot/
Uses joint velocity control
"""
def __init__(self, config):
self.config = config
... | 36.388889 | 92 | 0.503308 |
e29d7ff60b3aba46d1bc4f073587253105cfe189 | 9,711 | py | Python | opencood/models/pixor.py | YuanYunshuang/OpenCOOD | 98e07eb45f7fdcd32518b2cf8f9052f73ca80bec | [
"Apache-2.0"
] | null | null | null | opencood/models/pixor.py | YuanYunshuang/OpenCOOD | 98e07eb45f7fdcd32518b2cf8f9052f73ca80bec | [
"Apache-2.0"
] | null | null | null | opencood/models/pixor.py | YuanYunshuang/OpenCOOD | 98e07eb45f7fdcd32518b2cf8f9052f73ca80bec | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Author: Hao Xiang <haxiang@g.ucla.edu>
# License: TDG-Attribution-NonCommercial-NoDistrib
import math
import torch
import torch.nn as nn
import torch.nn.functional as F
def conv3x3(in_planes, out_planes, stride=1, bias=False):
"""3x3 convolution with padding"""
return nn.Conv2d(in... | 31.22508 | 79 | 0.556894 |
d01144633801a05985ada7572743a41cee73c9da | 1,152 | py | Python | gruve/gruve/acquire_open_fda.py | STSILABS/fda-sandbox | cc48fb0c91b6a95c50c58445b78e2f3e114e4ee9 | [
"MIT"
] | 7 | 2015-07-08T12:57:23.000Z | 2020-06-11T04:31:32.000Z | gruve/gruve/acquire_open_fda.py | PluribusDigital/open-fda | c2207314ff9883b7c487155ce6165518d7d94752 | [
"MIT"
] | null | null | null | gruve/gruve/acquire_open_fda.py | PluribusDigital/open-fda | c2207314ff9883b7c487155ce6165518d7d94752 | [
"MIT"
] | 2 | 2016-03-14T16:30:39.000Z | 2017-08-06T20:41:44.000Z | import os
import sys
import csv
from gruve import io, OpenFdaProxy, WebServiceCache
class AcquireOpenFda():
# -------------------------------------------------------------------------
def acquire_labels(self):
''' Retrieve the full set of drug labeling data from the FDA.
Since the FDA data set... | 39.724138 | 80 | 0.53125 |
8b71f7ed82c32a0ea5436c29d9a22800f03b82e0 | 3,592 | py | Python | mmdet/datasets/pipelines/instaboost.py | yypurpose/mmdetection | ec6bfd96eae0af047c623f3d1ec31b0b3f1f4a6c | [
"Apache-2.0"
] | null | null | null | mmdet/datasets/pipelines/instaboost.py | yypurpose/mmdetection | ec6bfd96eae0af047c623f3d1ec31b0b3f1f4a6c | [
"Apache-2.0"
] | null | null | null | mmdet/datasets/pipelines/instaboost.py | yypurpose/mmdetection | ec6bfd96eae0af047c623f3d1ec31b0b3f1f4a6c | [
"Apache-2.0"
] | null | null | null | import numpy as np
from ..builder import PIPELINES
@PIPELINES.register_module()
class InstaBoost(object):
r"""Data augmentation method in `InstaBoost: Boosting Instance
Segmentation Via Probability Map Guided Copy-Pasting
<https://arxiv.org/abs/1908.07801>`_.
Refer to https://github.com/G... | 36.282828 | 80 | 0.515033 |
0d7afacc423bef0dca4b20399c7bffde68dbb33c | 10,858 | py | Python | pan_cortex_data_lake/query.py | sserrata/pan-cortex-data-lake-python | da0bf745559242840bb859660e76b2b3c7c9a442 | [
"ISC"
] | 27 | 2018-03-19T08:12:47.000Z | 2019-12-10T04:15:00.000Z | pan_cortex_data_lake/query.py | sserrata/pan-cortex-data-lake-python | da0bf745559242840bb859660e76b2b3c7c9a442 | [
"ISC"
] | 55 | 2018-03-16T19:53:04.000Z | 2019-04-03T16:34:26.000Z | pan_cortex_data_lake/query.py | sserrata/pan-cortex-data-lake-python | da0bf745559242840bb859660e76b2b3c7c9a442 | [
"ISC"
] | 9 | 2018-03-21T18:03:42.000Z | 2019-10-06T03:56:58.000Z | # -*- coding: utf-8 -*-
"""
:::info
The Query Service is a Palo Alto Networks cloud service which allows
for the storage and retrieval of data stored in the Cortex Data Lake.
Any type of textual data can be stored in the Cortex Data Lake. Palo
Alto Networks firewalls and software can write data to this service, as
can... | 35.953642 | 177 | 0.561614 |
03486dd13ed82d3b511c7d2c0c80cb663842ed22 | 703 | py | Python | users/models.py | HASSAN1A/Instagram-Clone | 9d1ee991e456ed52c9ddc0b159875886bcb55a1e | [
"MIT"
] | 2 | 2021-05-19T12:58:27.000Z | 2021-05-28T14:03:23.000Z | users/models.py | HASSAN1A/Instagram-Clone | 9d1ee991e456ed52c9ddc0b159875886bcb55a1e | [
"MIT"
] | null | null | null | users/models.py | HASSAN1A/Instagram-Clone | 9d1ee991e456ed52c9ddc0b159875886bcb55a1e | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import User
from PIL import Image
from cloudinary.models import CloudinaryField
# Create your models here.
class Profile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
# image = models.ImageField(default='default.jpg', uplo... | 27.038462 | 80 | 0.671408 |
b3f552ca305160b8f68bc0ec5288a23ba0f6ce7f | 1,144 | py | Python | molecule/default/tests/test_default.py | Phill93/ansible-role-traefik | 94c9924636fdfd5efef5096c1b810fffd54d7fcd | [
"MIT"
] | 1 | 2020-02-07T21:36:38.000Z | 2020-02-07T21:36:38.000Z | molecule/default/tests/test_default.py | Phill93/ansible-role-traefik | 94c9924636fdfd5efef5096c1b810fffd54d7fcd | [
"MIT"
] | null | null | null | molecule/default/tests/test_default.py | Phill93/ansible-role-traefik | 94c9924636fdfd5efef5096c1b810fffd54d7fcd | [
"MIT"
] | null | null | null | import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']
).get_hosts('all')
def test_config_dir(host):
conf_dir = "/etc/traefik"
assert host.file(conf_dir).is_directory
assert host.file(conf_dir).user == "ro... | 27.238095 | 63 | 0.715035 |
10e883e6f967fadefd116e079b9f26975e226f58 | 1,087 | py | Python | Association Rules/Nearest Neighbors Supervised.py | eyobghiday/machine-learning | d7165f2b64df6fb780ad30aae55b3b827382bede | [
"MIT"
] | 2 | 2022-02-14T20:20:01.000Z | 2022-03-27T07:06:31.000Z | Association Rules/Nearest Neighbors Supervised.py | eyobghiday/machine-learning | d7165f2b64df6fb780ad30aae55b3b827382bede | [
"MIT"
] | null | null | null | Association Rules/Nearest Neighbors Supervised.py | eyobghiday/machine-learning | d7165f2b64df6fb780ad30aae55b3b827382bede | [
"MIT"
] | null | null | null | # Load the PANDAS library
import numpy
import pandas
from sklearn.neighbors import KNeighborsClassifier
cars = pandas.read_csv('cars.csv', delimiter=',')
cars["CaseID"] = cars["Make"] + "_" + cars.index.values.astype(str)
cars_wIndex = cars.set_index("CaseID")
trainData = cars_wIndex[['Invoice', 'Horsepo... | 27.871795 | 88 | 0.701012 |
665f5194b9b30ec71ebacb76a245acf97344f599 | 681 | py | Python | OpenCV Python/8. Machine Learning/3. K-Means Clusterig/code-version2.py | Ashleshk/Machine-Learning-Data-Science-Deep-Learning | 03357ab98155bf73b8f1d2fd53255cc16bea2333 | [
"MIT"
] | 1 | 2020-05-24T06:55:31.000Z | 2020-05-24T06:55:31.000Z | OpenCV Python/8. Machine Learning/3. K-Means Clusterig/code-version2.py | Ashleshk/Machine-Learning-Data-Science-Deep-Learning | 03357ab98155bf73b8f1d2fd53255cc16bea2333 | [
"MIT"
] | null | null | null | OpenCV Python/8. Machine Learning/3. K-Means Clusterig/code-version2.py | Ashleshk/Machine-Learning-Data-Science-Deep-Learning | 03357ab98155bf73b8f1d2fd53255cc16bea2333 | [
"MIT"
] | null | null | null | import numpy as np
import cv2
from matplotlib import pyplot as plt
X = np.random.randint(25,50,(25,2))
Y = np.random.randint(60,85,(25,2))
Z = np.vstack((X,Y))
# convert to np.float32
Z = np.float32(Z)
# define criteria and apply kmeans()
criteria = (cv2.TERM_CRITERIA_EPS + cv2.TERM_CRITERIA_MAX_ITER, 10, 1.0)
ret,l... | 27.24 | 75 | 0.676946 |
3efabff8e8d6d269cb8a45def2ea80f542988136 | 76 | py | Python | lambdarest/__version__.py | elviejokike/python-lambdarest | 1ad8626a495908f9405fbe1ae1dbce7a1b37b9f4 | [
"MIT"
] | null | null | null | lambdarest/__version__.py | elviejokike/python-lambdarest | 1ad8626a495908f9405fbe1ae1dbce7a1b37b9f4 | [
"MIT"
] | null | null | null | lambdarest/__version__.py | elviejokike/python-lambdarest | 1ad8626a495908f9405fbe1ae1dbce7a1b37b9f4 | [
"MIT"
] | null | null | null | __author__ = 'sloev'
__email__ = 'jgv@trustpilot.com'
__version__ = '5.0.1'
| 19 | 32 | 0.710526 |
6596207ce59b514ac58bc269df25ce3142334079 | 2,092 | py | Python | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/edcps/apis/CreateInstancesRequest.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 14 | 2018-04-19T09:53:56.000Z | 2022-01-27T06:05:48.000Z | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/edcps/apis/CreateInstancesRequest.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 15 | 2018-09-11T05:39:54.000Z | 2021-07-02T12:38:02.000Z | python_code/vnev/Lib/site-packages/jdcloud_sdk/services/edcps/apis/CreateInstancesRequest.py | Ureimu/weather-robot | 7634195af388538a566ccea9f8a8534c5fb0f4b6 | [
"MIT"
] | 33 | 2018-04-20T05:29:16.000Z | 2022-02-17T09:10:05.000Z | # coding=utf8
# Copyright 2018 JDCLOUD.COM
#
# 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 ... | 29.885714 | 75 | 0.707457 |
34a05935846d40746a54d2ca3b92e89169f1efb7 | 9,185 | py | Python | wrappers/do_onedata.py | caredg/lago_ecuador_cloudsim | b5490f01518aae77406481acc5b1b00df67d536c | [
"BSD-3-Clause"
] | null | null | null | wrappers/do_onedata.py | caredg/lago_ecuador_cloudsim | b5490f01518aae77406481acc5b1b00df67d536c | [
"BSD-3-Clause"
] | 2 | 2020-09-17T20:21:17.000Z | 2021-01-11T16:51:19.000Z | wrappers/do_onedata.py | AJRubio-Montero/onedataSim | f5f73c90fde8fc83074172c7e1eb46c04dc9ba80 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
#
################################################################################
# Original Author: A.J. Rubio-Montero (http://orcid.org/0000-0001-6497-753X), #
# CIEMAT - Sci-Track Group (http://rdgroups.ciemat.es/web/sci-track), #
# for the EOSC-Synergy project (EU H2020 RI... | 31.672414 | 120 | 0.60196 |
b83f3289a9af6684f389166cef22617f10b9f303 | 2,520 | py | Python | secc/states/process_supported_app_protocol_request.py | EDF-Lab/EDF | 3ab2d9e1820dfb713bbd54c91ba72d7d32d998f9 | [
"MIT"
] | 16 | 2022-02-11T14:49:04.000Z | 2022-03-30T07:33:45.000Z | secc/states/process_supported_app_protocol_request.py | EDF-Lab/EDF | 3ab2d9e1820dfb713bbd54c91ba72d7d32d998f9 | [
"MIT"
] | 1 | 2022-02-16T15:23:50.000Z | 2022-02-21T15:30:21.000Z | secc/states/process_supported_app_protocol_request.py | EDF-Lab/EDF | 3ab2d9e1820dfb713bbd54c91ba72d7d32d998f9 | [
"MIT"
] | 1 | 2022-03-24T10:52:28.000Z | 2022-03-24T10:52:28.000Z | """
.. module:: process_supported_app_protocol_request
:platform: Unix
:synopsis: A module describing the SupportedAppProtocol state.
.. Copyright 2022 EDF
.. moduleauthor:: Oscar RODRIGUEZ INFANTE, Tony ZHOU, Trang PHAM, Efflam OLLIVIER
.. License:: This source code is licensed under the MIT License.
"""
... | 41.311475 | 110 | 0.677381 |
523af87ead8dd1139cd411cfc2890d23f138f789 | 9,674 | py | Python | monai/networks/blocks/convolutions.py | dzenanz/MONAI | 524c99d90891c061768766b787fe11dc9551d401 | [
"Apache-2.0"
] | 1 | 2020-10-21T22:15:50.000Z | 2020-10-21T22:15:50.000Z | monai/networks/blocks/convolutions.py | yfzheng11/MONAI | 6fa7cf2df3765d8c0a404b4baded8b132b4b0ff0 | [
"Apache-2.0"
] | null | null | null | monai/networks/blocks/convolutions.py | yfzheng11/MONAI | 6fa7cf2df3765d8c0a404b4baded8b132b4b0ff0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, s... | 38.696 | 130 | 0.61412 |
a21d9e8ea519a5f597c0ff014c929174c92f739c | 13,084 | py | Python | rab_postgresql.py | senjianlu/rab_python_packages | 9116ecff2e29889a327f0e1063760edd456f8008 | [
"MIT"
] | 35 | 2021-03-08T06:49:55.000Z | 2022-03-06T00:16:39.000Z | rab_postgresql.py | senjianlu/rab_python_packages | 9116ecff2e29889a327f0e1063760edd456f8008 | [
"MIT"
] | null | null | null | rab_postgresql.py | senjianlu/rab_python_packages | 9116ecff2e29889a327f0e1063760edd456f8008 | [
"MIT"
] | 8 | 2021-03-08T07:31:11.000Z | 2021-09-25T09:19:38.000Z | #!/usr/bin/env python
# -*- coding:UTF-8 -*-
#
# @AUTHOR: Rabbir
# @FILE: /root/GitHub/rab_python_packages/rab_postgresql.py
# @DATE: 2020/12/17 周四
# @TIME: 11:03:40
#
# @DESCRIPTION: 共通包 PostgreSQL 数据库驱动
import sys
import datetime
import psycopg2
import psycopg2.extras
sys.path.append("..") if (".." n... | 28.137634 | 76 | 0.482192 |
76ae4a4f803c1c29fa069533c575c9bf56e0c370 | 90 | py | Python | wk/io/__init__.py | Peiiii/wk | dcf948c1cb36c1eec9b2a554ea0296c6d3dbbdc4 | [
"MIT"
] | null | null | null | wk/io/__init__.py | Peiiii/wk | dcf948c1cb36c1eec9b2a554ea0296c6d3dbbdc4 | [
"MIT"
] | null | null | null | wk/io/__init__.py | Peiiii/wk | dcf948c1cb36c1eec9b2a554ea0296c6d3dbbdc4 | [
"MIT"
] | null | null | null | from .ioutils import *
from .fsutils import *
from .class_store import *
from .db import * | 22.5 | 26 | 0.744444 |
3837fdd100985bec7c3dcad2396e473e97717a38 | 2,859 | py | Python | pysystests/testcfg.py | sumedhpb/testrunner | 9ff887231c75571624abc31a3fb5248110e01203 | [
"Apache-2.0"
] | 14 | 2015-02-06T02:47:57.000Z | 2020-03-14T15:06:05.000Z | pysystests/testcfg.py | sumedhpb/testrunner | 9ff887231c75571624abc31a3fb5248110e01203 | [
"Apache-2.0"
] | 3 | 2019-02-27T19:29:11.000Z | 2021-06-02T02:14:27.000Z | pysystests/testcfg.py | sumedhpb/testrunner | 9ff887231c75571624abc31a3fb5248110e01203 | [
"Apache-2.0"
] | 108 | 2015-03-26T08:58:49.000Z | 2022-03-21T05:21:39.000Z | #TODO: allow workers to pull this from cache
RABBITMQ_IP = "127.0.0.1"
RABBITMQ_LOG_LOCATION = ""
CB_CLUSTER_TAG = "default"
# Add location of cluster's .ini(from where this script is run) for installation
CLUSTER_INI = ""
CLUSTER_RAM_QUOTA = ""
# Add cluster setup json path, templates in triple quoted strings
S... | 36.653846 | 122 | 0.64638 |
484f8b476907ce165209223b6ade94280cb7e103 | 53 | py | Python | src/py/pe_0001.py | shanedrabing/project-euler | 65add91195fdde3c99c843743205be6d0b1fe072 | [
"MIT"
] | null | null | null | src/py/pe_0001.py | shanedrabing/project-euler | 65add91195fdde3c99c843743205be6d0b1fe072 | [
"MIT"
] | null | null | null | src/py/pe_0001.py | shanedrabing/project-euler | 65add91195fdde3c99c843743205be6d0b1fe072 | [
"MIT"
] | null | null | null | sum(set(range(3, 1000, 3)) | set(range(5, 1000, 5)))
| 26.5 | 52 | 0.584906 |
15364d6c98a5d39bc8fb350f1adad33f71403fd7 | 4,892 | py | Python | cloudmersive_convert_api_client/models/get_docx_headers_and_footers_response.py | Cloudmersive/Cloudmersive.APIClient.Python.Convert | dba2fe7257229ebdacd266531b3724552c651009 | [
"Apache-2.0"
] | 3 | 2018-07-25T23:04:34.000Z | 2021-08-10T16:43:10.000Z | cloudmersive_convert_api_client/models/get_docx_headers_and_footers_response.py | Cloudmersive/Cloudmersive.APIClient.Python.Convert | dba2fe7257229ebdacd266531b3724552c651009 | [
"Apache-2.0"
] | 3 | 2020-11-23T10:46:48.000Z | 2021-12-30T14:09:34.000Z | cloudmersive_convert_api_client/models/get_docx_headers_and_footers_response.py | Cloudmersive/Cloudmersive.APIClient.Python.Convert | dba2fe7257229ebdacd266531b3724552c651009 | [
"Apache-2.0"
] | 2 | 2020-01-07T09:48:01.000Z | 2020-11-23T10:47:00.000Z | # coding: utf-8
"""
convertapi
Convert API lets you effortlessly convert file formats and types. # noqa: E501
OpenAPI spec version: v1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import six
class GetDocxHeadersAndFootersRespons... | 28.776471 | 97 | 0.595871 |
8a53ed9ffc095a4514d04c0b9a69a56e6e5cc384 | 16,478 | py | Python | mmedit/datasets/pipelines/loading.py | Mistariano/mmediting | 37cb3cbc48c947e56eaae0b9213b073926578fe7 | [
"Apache-2.0"
] | null | null | null | mmedit/datasets/pipelines/loading.py | Mistariano/mmediting | 37cb3cbc48c947e56eaae0b9213b073926578fe7 | [
"Apache-2.0"
] | null | null | null | mmedit/datasets/pipelines/loading.py | Mistariano/mmediting | 37cb3cbc48c947e56eaae0b9213b073926578fe7 | [
"Apache-2.0"
] | null | null | null | from pathlib import Path
import mmcv
import numpy as np
from mmcv.fileio import FileClient
from mmedit.core.mask import (bbox2mask, brush_stroke_mask, get_irregular_mask,
random_bbox)
from ..registry import PIPELINES
@PIPELINES.register_module()
class LoadImageFromFile(object):
"""... | 34.329167 | 83 | 0.586176 |
89e0d9761dcd12a02e5bd023333672c08f1062e9 | 211 | py | Python | tests/kwik_e_mart/__main__.py | ritvikshrivastava/mindmeld | 48eccac059439ea0f32fa3ac9079415bb006233b | [
"Apache-2.0"
] | 580 | 2019-03-24T20:59:09.000Z | 2022-03-23T17:06:43.000Z | tests/kwik_e_mart/__main__.py | ritvikshrivastava/mindmeld | 48eccac059439ea0f32fa3ac9079415bb006233b | [
"Apache-2.0"
] | 199 | 2019-04-30T18:15:46.000Z | 2022-03-22T17:11:33.000Z | tests/kwik_e_mart/__main__.py | Embodimentgeniuslm3/mindmeld | 042d4ed5400cd1cf8ea1f025eea732359ef68720 | [
"Apache-2.0"
] | 164 | 2019-04-25T08:27:28.000Z | 2022-03-23T12:44:33.000Z | # -*- coding: utf-8 -*-
"""This module defines the command line interface for this app. Use
`python -m <app_name>` to see available commands.
"""
if __name__ == "__main__":
from . import app
app.cli()
| 21.1 | 67 | 0.649289 |
71a812e471d5babaae79ad4aefd14e2d8d633a9c | 4,332 | py | Python | contrib/seeds/generate-seeds.py | ayardo/ayardo-source | cd433f209baddd33f78ca0891686291eef59bdec | [
"MIT"
] | 1 | 2021-08-23T01:15:40.000Z | 2021-08-23T01:15:40.000Z | contrib/seeds/generate-seeds.py | ayardo/ayardo-source | cd433f209baddd33f78ca0891686291eef59bdec | [
"MIT"
] | null | null | null | contrib/seeds/generate-seeds.py | ayardo/ayardo-source | cd433f209baddd33f78ca0891686291eef59bdec | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2017 Wladimir J. van der Laan
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
'''
Script to generate list of seed nodes for chainparams.cpp.
This script expects two text files in the dir... | 31.165468 | 98 | 0.578717 |
72d0eeff72bf2f72550a6860b5726a4aa022c035 | 11,300 | py | Python | pyinfra/api/connectors/ssh.py | gchazot/pyinfra | 40dd01f11086dba2be20fa2f509556abb40d84f8 | [
"MIT"
] | 1 | 2020-04-12T16:15:15.000Z | 2020-04-12T16:15:15.000Z | pyinfra/api/connectors/ssh.py | gchazot/pyinfra | 40dd01f11086dba2be20fa2f509556abb40d84f8 | [
"MIT"
] | null | null | null | pyinfra/api/connectors/ssh.py | gchazot/pyinfra | 40dd01f11086dba2be20fa2f509556abb40d84f8 | [
"MIT"
] | null | null | null | # pyinfra
# File: pyinfra/api/ssh.py
# Desc: handle all SSH related stuff
from __future__ import print_function, unicode_literals
from getpass import getpass
from os import path
from socket import (
error as socket_error,
gaierror,
timeout as timeout_error,
)
import click
import gevent
from paramiko imp... | 29.815303 | 88 | 0.616018 |
f3c98f13347d4f6cd3f154b0c5418952e1634544 | 938 | py | Python | pymath/distinct_powers/__init__.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 3 | 2017-05-02T10:28:13.000Z | 2019-02-06T09:10:11.000Z | pymath/distinct_powers/__init__.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 2 | 2017-06-21T20:39:14.000Z | 2020-02-25T10:28:57.000Z | pymath/distinct_powers/__init__.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 2 | 2016-07-29T04:35:22.000Z | 2017-01-18T17:05:36.000Z | """
Finds how many distinct powers generated by a^b given the range 2 ≤ a ≤ n and 2 ≤ b ≤ n
where n is a positive integer
"""
def distinct_powers(a, b):
"""
Finds and returns the number of distinct powers of a and b
Example:
>>> distinct_powers(5, 5)
15
:param a: Limit of a
:type a int
... | 23.45 | 88 | 0.616205 |
4d38b525d8872aceca038969eeb4ee5e0bf96416 | 1,512 | py | Python | keystone/common/sql/migrate_repo/versions/002_token_id_hash.py | ioram7/keystone | 81b5ad22cc8b85d622a332e62e5c4cb63155b654 | [
"Apache-2.0"
] | 6 | 2016-08-06T09:00:17.000Z | 2021-10-21T23:12:47.000Z | keystone/common/sql/migrate_repo/versions/002_token_id_hash.py | ioram7/keystone | 81b5ad22cc8b85d622a332e62e5c4cb63155b654 | [
"Apache-2.0"
] | 1 | 2021-02-23T10:29:49.000Z | 2021-02-23T10:29:49.000Z | keystone/common/sql/migrate_repo/versions/002_token_id_hash.py | ioram7/keystone | 81b5ad22cc8b85d622a332e62e5c4cb63155b654 | [
"Apache-2.0"
] | 10 | 2016-04-25T20:10:06.000Z | 2021-06-10T15:14:19.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (c) 2012 Red Hat, 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... | 34.363636 | 78 | 0.698413 |
2e9795c791d86b27515d1f7d3fad327aa5cd4c14 | 603 | py | Python | molsysmt/tools/pdb.py | uibcdf/MolSysMT | 9866a6fb090df9fff36af113a45164da4b674c09 | [
"MIT"
] | 3 | 2020-06-02T03:55:52.000Z | 2022-03-21T04:43:52.000Z | molsysmt/tools/pdb.py | uibcdf/MolSysMT | 9866a6fb090df9fff36af113a45164da4b674c09 | [
"MIT"
] | 28 | 2020-06-24T00:55:53.000Z | 2021-07-16T22:09:19.000Z | molsysmt/tools/pdb.py | uibcdf/MolSysMT | 9866a6fb090df9fff36af113a45164da4b674c09 | [
"MIT"
] | 1 | 2021-06-17T18:55:25.000Z | 2021-06-17T18:55:25.000Z | import tempfile
import urllib.request
from pdbfixer.pdbfixer import proteinResidues, rnaResidues, dnaResidues
def tmp_pdb_filename():
filename=tempfile.NamedTemporaryFile(suffix=".pdb").name
return filename
def download_pdb(pdb_id=None, output_filepath=None):
filetype='pdb'
fullurl = 'https://file... | 24.12 | 81 | 0.72471 |
176285fa31c6e2c9c6dd10d5575144d48882e06b | 3,395 | py | Python | tests/test_rfc6031.py | Jamim/pyasn1-modules | 7fafbf8550ab9e8727274903ed96ae849cd24594 | [
"BSD-2-Clause"
] | null | null | null | tests/test_rfc6031.py | Jamim/pyasn1-modules | 7fafbf8550ab9e8727274903ed96ae849cd24594 | [
"BSD-2-Clause"
] | null | null | null | tests/test_rfc6031.py | Jamim/pyasn1-modules | 7fafbf8550ab9e8727274903ed96ae849cd24594 | [
"BSD-2-Clause"
] | null | null | null | #
# This file is part of pyasn1-modules software.
#
# Created by Russ Housley
# Copyright (c) 2019, Vigil Security, LLC
# License: http://snmplabs.com/pyasn1/license.html
#
import sys
from pyasn1.codec.der.decoder import decode as der_decode
from pyasn1.codec.der.encoder import encode as der_encode
from pyasn1_modul... | 37.722222 | 86 | 0.6757 |
fc9d362e201149f82560de3c2f0f88ef2ae18306 | 424 | py | Python | projects/skeleton/setup.py | ThiriThanShwe/pythonexercise | 17d0ab0cc3824a83b8b61b89e6e837aadc2c8743 | [
"MIT"
] | null | null | null | projects/skeleton/setup.py | ThiriThanShwe/pythonexercise | 17d0ab0cc3824a83b8b61b89e6e837aadc2c8743 | [
"MIT"
] | null | null | null | projects/skeleton/setup.py | ThiriThanShwe/pythonexercise | 17d0ab0cc3824a83b8b61b89e6e837aadc2c8743 | [
"MIT"
] | null | null | null | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'description': 'My Project',
'author': 'My Name',
'url': 'URL to get it at.',
'download_url': 'Where to download it.',
'author_email': 'My email.',
'version': '0.1',
'install_requires... | 20.190476 | 44 | 0.584906 |
3faa0fa429a3a0a5244df8f2de9cb024e0e19c7b | 6,021 | py | Python | neural_sp/models/modules/mocha/monotonic_energy.py | ishine/neural_sp | 7995613541d994976b00d80dcc12e2835163acfb | [
"Apache-2.0"
] | 577 | 2018-09-17T14:39:34.000Z | 2022-03-29T10:48:09.000Z | neural_sp/models/modules/mocha/monotonic_energy.py | ishine/neural_sp | 7995613541d994976b00d80dcc12e2835163acfb | [
"Apache-2.0"
] | 221 | 2019-04-21T01:44:09.000Z | 2022-02-10T02:08:47.000Z | neural_sp/models/modules/mocha/monotonic_energy.py | ishine/neural_sp | 7995613541d994976b00d80dcc12e2835163acfb | [
"Apache-2.0"
] | 139 | 2019-01-09T02:18:00.000Z | 2022-03-29T07:40:08.000Z | # Copyright 2021 Kyoto University (Hirofumi Inaguma)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
"""Monotonic energy activation."""
import logging
import math
import numpy as np
import torch
import torch.nn as nn
from neural_sp.models.modules.initialization import init_with_lecun_normal
from neural_s... | 38.107595 | 105 | 0.575984 |
26a10676c81005e99690df7cdb5300e1782e3736 | 1,088 | gyp | Python | n-api/binding.gyp | yjjnls/NewWebassembly | 3292cf50407514f714172a403e619bf8d1d042c1 | [
"MIT"
] | null | null | null | n-api/binding.gyp | yjjnls/NewWebassembly | 3292cf50407514f714172a403e619bf8d1d042c1 | [
"MIT"
] | null | null | null | n-api/binding.gyp | yjjnls/NewWebassembly | 3292cf50407514f714172a403e619bf8d1d042c1 | [
"MIT"
] | null | null | null | {
"targets": [
{
"target_name": "plugin",
# 'defines': ["EMSCRIPTEN_HAS_UNBOUND_TYPE_NAMES=0"],
'include_dirs': [
'include'
],
"sources": ["src/bind.cc",
"../myclass_binding.cc",
"../e... | 40.296296 | 171 | 0.331801 |
9e2dbbe491c79e876802e0ffa825fb03fcf6837e | 2,781 | py | Python | python/example_code/s3/s3.py | AllanFly120/aws-doc-sdk-examples | 380d46c4af7192d8bc73b2ea941f92f60500cf2d | [
"Apache-2.0"
] | 1 | 2020-03-09T17:23:38.000Z | 2020-03-09T17:23:38.000Z | python/example_code/s3/s3.py | AllanFly120/aws-doc-sdk-examples | 380d46c4af7192d8bc73b2ea941f92f60500cf2d | [
"Apache-2.0"
] | null | null | null | python/example_code/s3/s3.py | AllanFly120/aws-doc-sdk-examples | 380d46c4af7192d8bc73b2ea941f92f60500cf2d | [
"Apache-2.0"
] | 1 | 2020-12-15T15:53:29.000Z | 2020-12-15T15:53:29.000Z | # Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# This file is licensed under the Apache License, Version 2.0 (the "License").
# You may not use this file except in compliance with the License. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# This file is d... | 32.337209 | 117 | 0.708378 |
30694f3f78b15c8e58539130b416731fb6a5c1c7 | 2,580 | py | Python | bg_convert.py | tinkerbeast/ffx-ai | b4d0e6397d8c18c2d5a4f423f8f6866a06c6d2b4 | [
"Apache-2.0"
] | null | null | null | bg_convert.py | tinkerbeast/ffx-ai | b4d0e6397d8c18c2d5a4f423f8f6866a06c6d2b4 | [
"Apache-2.0"
] | null | null | null | bg_convert.py | tinkerbeast/ffx-ai | b4d0e6397d8c18c2d5a4f423f8f6866a06c6d2b4 | [
"Apache-2.0"
] | null | null | null | import cv2
import matplotlib.pyplot as plt
import numpy as np
import os
import uuid
def _padd_image(aspect_ratio, img, color=(128, 128, 128)):
im_w = img.shape[1]
im_h = img.shape[0]
im_h_target = (im_w / aspect_ratio[0]) * aspect_ratio[1]
im_w_target = (im_h / aspect_ratio[1]) * aspect_ratio[0]
i... | 34.4 | 95 | 0.631783 |
0cab53589dac9a0386dce666bd681458f73f09a1 | 6,281 | py | Python | gstreamer/detect.py | deepanshu-yadav/coral_bug | f268e06746744dab81f2bba500c849bb11f25f2a | [
"Apache-2.0"
] | 1 | 2020-08-18T10:30:11.000Z | 2020-08-18T10:30:11.000Z | gstreamer/detect.py | deepanshu-yadav/coral_bug | f268e06746744dab81f2bba500c849bb11f25f2a | [
"Apache-2.0"
] | null | null | null | gstreamer/detect.py | deepanshu-yadav/coral_bug | f268e06746744dab81f2bba500c849bb11f25f2a | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 39.753165 | 98 | 0.641618 |
9dec9be204527e7466f3310a5e04bb4e220afcbc | 165 | py | Python | webserver/main.py | nevermore2101/Dota2-WebAI | 920107b7b2716a4cde619f2ffd8ba749de3f9d6e | [
"MIT"
] | null | null | null | webserver/main.py | nevermore2101/Dota2-WebAI | 920107b7b2716a4cde619f2ffd8ba749de3f9d6e | [
"MIT"
] | null | null | null | webserver/main.py | nevermore2101/Dota2-WebAI | 920107b7b2716a4cde619f2ffd8ba749de3f9d6e | [
"MIT"
] | null | null | null | from __future__ import print_function
import local_server as webserver
if __name__ == "__main__":
print('starting web server...')
webserver.start()
| 20.625 | 38 | 0.709091 |
2cf5fdae2636d5f1a23f68bb151d912e9db47761 | 71,029 | py | Python | app/mod_webhook/df_fulfillment.py | h-amg/Android-app-website-and-backend | 925dc4ef6aa7b0e43ddd25589afb8a173b279ebd | [
"Apache-2.0"
] | null | null | null | app/mod_webhook/df_fulfillment.py | h-amg/Android-app-website-and-backend | 925dc4ef6aa7b0e43ddd25589afb8a173b279ebd | [
"Apache-2.0"
] | 1 | 2021-06-02T00:37:24.000Z | 2021-06-02T00:37:24.000Z | app/mod_webhook/df_fulfillment.py | h-amg/XHominid-website-and-backend | 925dc4ef6aa7b0e43ddd25589afb8a173b279ebd | [
"Apache-2.0"
] | null | null | null | # import flask dependencies
from flask import Flask
from flask import Blueprint
from app.mod_webhook.lib import *
from flask import make_response
from flask import jsonify
from flask import request as flrqst
import requests as apirequest
import string
import random
import datetime
import time
from pytz import timezone
... | 32.183507 | 305 | 0.656492 |
7304e001b2a8aae2e4d4edda0b80862a4244c63c | 380 | py | Python | RasPi_Dev/ros_ws/build/world_canvas/world_canvas_libs/world_canvas_client_py/catkin_generated/pkg.develspace.context.pc.py | QianheYu/xtark_driver_dev | 1708888161cf20c0d1f45c99d0da4467d69c26c8 | [
"BSD-3-Clause"
] | 1 | 2022-03-11T03:31:15.000Z | 2022-03-11T03:31:15.000Z | RasPi_Dev/ros_ws/build/world_canvas/world_canvas_libs/world_canvas_client_py/catkin_generated/pkg.develspace.context.pc.py | bravetree/xtark_driver_dev | 1708888161cf20c0d1f45c99d0da4467d69c26c8 | [
"BSD-3-Clause"
] | null | null | null | RasPi_Dev/ros_ws/build/world_canvas/world_canvas_libs/world_canvas_client_py/catkin_generated/pkg.develspace.context.pc.py | bravetree/xtark_driver_dev | 1708888161cf20c0d1f45c99d0da4467d69c26c8 | [
"BSD-3-Clause"
] | null | null | null | # generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else []
PROJECT_CATKIN_DEPENDS = "".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
PROJECT_NAME = "world_canvas_client_py"
PROJECT_SPACE... | 42.222222 | 68 | 0.710526 |
7bf9853310d63e626c64138addf4b31e3924397d | 12,923 | py | Python | sktime/tests/_config.py | chrisholder/sktime | b505529f6460c2d6d05961d7f7f226b81a16bd27 | [
"BSD-3-Clause"
] | null | null | null | sktime/tests/_config.py | chrisholder/sktime | b505529f6460c2d6d05961d7f7f226b81a16bd27 | [
"BSD-3-Clause"
] | null | null | null | sktime/tests/_config.py | chrisholder/sktime | b505529f6460c2d6d05961d7f7f226b81a16bd27 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3 -u
# -*- coding: utf-8 -*-
# copyright: sktime developers, BSD-3-Clause License (see LICENSE file)
__author__ = ["Markus Löning"]
__all__ = ["ESTIMATOR_TEST_PARAMS", "EXCLUDE_ESTIMATORS", "EXCLUDED_TESTS"]
import numpy as np
from sktime.registry import (
ESTIMATOR_TAG_LIST,
BASE_CLASS_... | 40.510972 | 88 | 0.752225 |
e0d20d7efd9d75a3bfaa312037942cdeeae67388 | 42,991 | py | Python | autotest/gcore/tiff_read.py | NathanW2/gdal | a5fc0fa500765f484b497d23ec5459176837e422 | [
"MIT"
] | 2 | 2015-07-24T16:16:34.000Z | 2015-07-24T16:16:37.000Z | autotest/gcore/tiff_read.py | samalone/gdal-ios | beed159503ce550c4e09edb25c168c8344e8998c | [
"MIT"
] | null | null | null | autotest/gcore/tiff_read.py | samalone/gdal-ios | beed159503ce550c4e09edb25c168c8344e8998c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# $Id$
#
# Project: GDAL/OGR Test Suite
# Purpose: Test basic read support for a all datatypes from a TIFF file.
# Author: Frank Warmerdam <warmerdam@pobox.com>
#
##########################... | 32.421569 | 596 | 0.593427 |
20085105813f2fcf6dd5cc272f056b2d9e999649 | 10,459 | py | Python | training_utils/loss_funcs.py | WatChMaL/CNN | 2e14397bca6ced2fdfeab406e3c28561bb3af384 | [
"CNRI-Python",
"RSA-MD"
] | 3 | 2019-05-10T01:38:07.000Z | 2021-09-06T16:30:18.000Z | training_utils/loss_funcs.py | WatChMaL/VAE | 2e14397bca6ced2fdfeab406e3c28561bb3af384 | [
"CNRI-Python",
"RSA-MD"
] | 3 | 2019-05-11T02:44:53.000Z | 2019-05-24T18:37:58.000Z | training_utils/loss_funcs.py | WatChMaL/CNN | 2e14397bca6ced2fdfeab406e3c28561bb3af384 | [
"CNRI-Python",
"RSA-MD"
] | 8 | 2019-05-06T22:39:39.000Z | 2020-11-29T17:15:50.000Z | """
loss_funcs.py
Module with implementations of different loss functions useful for autoencoder training
Author : Abhishek .
"""
# PyTorch imports
from torch import nn
from torch import sum
from torch import mean
from torch import zeros
from torch import bmm
# Activation functions
softmax = nn.Softmax(dim=1)
# --... | 37.220641 | 128 | 0.668228 |
101d2bf8d7a519cb877941be63c155c44059e57c | 467 | py | Python | test/test_pytest/test_pytester_plugin.py | vaindante/flaky | 365558586b56f26892a6a7650d956c51dc99bdff | [
"Apache-2.0"
] | 1 | 2018-06-10T23:31:42.000Z | 2018-06-10T23:31:42.000Z | test/test_pytest/test_pytester_plugin.py | vaindante/flaky | 365558586b56f26892a6a7650d956c51dc99bdff | [
"Apache-2.0"
] | 1 | 2018-09-19T11:29:54.000Z | 2018-09-19T11:29:54.000Z | test/test_pytest/test_pytester_plugin.py | vaindante/flaky | 365558586b56f26892a6a7650d956c51dc99bdff | [
"Apache-2.0"
] | 1 | 2020-11-07T10:31:36.000Z | 2020-11-07T10:31:36.000Z | # coding: utf-8
from __future__ import unicode_literals, absolute_import
pytest_plugins = str('pytester') # pylint:disable=invalid-name
TESTSUITE = """
def test_a_thing():
pass
"""
def test_output_without_capture(testdir):
"""
Test for Issue #82. Flaky was breaking tests using the pytester plugin.
... | 22.238095 | 75 | 0.69379 |
a1260d211002dad2c9b2c89db86d0fe600f4d905 | 1,649 | py | Python | src/sentry/mediators/sentry_app_installations/creator.py | KristianI/sentry | 416bc92ee9a534db3eba1c480447bd43a0cdb924 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/mediators/sentry_app_installations/creator.py | KristianI/sentry | 416bc92ee9a534db3eba1c480447bd43a0cdb924 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/mediators/sentry_app_installations/creator.py | KristianI/sentry | 416bc92ee9a534db3eba1c480447bd43a0cdb924 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
import six
from sentry.mediators import Mediator, Param
from sentry.models import (
ApiAuthorization, ApiGrant, SentryApp, SentryAppInstallation
)
from sentry.utils.cache import memoize
from sentry.tasks.app_platform import installation_webhook
class Creator(Mediator):
... | 28.929825 | 65 | 0.68587 |
d183c9a830a927ea91909a66a93a031c5a925cd7 | 1,476 | py | Python | flamejam/tick.py | firegate666/flamejam | 44f212e6540b41c8e3cfdb1902164d48244e22ce | [
"Zlib"
] | 90 | 2015-01-28T03:31:44.000Z | 2021-07-21T18:27:23.000Z | flamejam/tick.py | firegate666/flamejam | 44f212e6540b41c8e3cfdb1902164d48244e22ce | [
"Zlib"
] | 3 | 2015-06-16T22:44:56.000Z | 2020-01-01T13:42:02.000Z | flamejam/tick.py | firegate666/flamejam | 44f212e6540b41c8e3cfdb1902164d48244e22ce | [
"Zlib"
] | 19 | 2015-04-27T11:49:44.000Z | 2019-12-13T07:57:25.000Z | from flamejam import app, db
from flamejam.models.jam import Jam, JamStatusCode
from flamejam.models.user import User
from uwsgidecorators import timer
from datetime import datetime, timedelta
@timer(1)
def tick(_):
"""This function is meant to be called regularly
Its purpose is to send out mails and do si... | 32.086957 | 101 | 0.582656 |
ac3a906643d78f2a118a5d72cba9eae779070939 | 2,227 | py | Python | examples/homo_logistic_regression/sklearn_comparison.py | ZZIQIN/FATE | cc6783927564cbb15c067d5010f1cdf82a5de20a | [
"Apache-2.0"
] | 1 | 2019-07-29T13:22:36.000Z | 2019-07-29T13:22:36.000Z | examples/homo_logistic_regression/sklearn_comparison.py | ZZIQIN/FATE | cc6783927564cbb15c067d5010f1cdf82a5de20a | [
"Apache-2.0"
] | null | null | null | examples/homo_logistic_regression/sklearn_comparison.py | ZZIQIN/FATE | cc6783927564cbb15c067d5010f1cdf82a5de20a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2019 The FATE 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/lic... | 27.493827 | 76 | 0.66996 |
dc1392128332fefdfb59bfc4b4b6fd9091ba81e5 | 17,177 | py | Python | python/pohuAPI.py | aiwarrior-23/revised_serps | 3cc94eaf8573f6c0d67619171c1e99c2867c57d0 | [
"MIT"
] | null | null | null | python/pohuAPI.py | aiwarrior-23/revised_serps | 3cc94eaf8573f6c0d67619171c1e99c2867c57d0 | [
"MIT"
] | null | null | null | python/pohuAPI.py | aiwarrior-23/revised_serps | 3cc94eaf8573f6c0d67619171c1e99c2867c57d0 | [
"MIT"
] | null | null | null |
import json
from pymongo import MongoClient
from flask import jsonify, request, Flask
from flask_cors import CORS
import flask
from utils.utils import *
from bson import ObjectId
import copy
import requests
import datetime
app = Flask(__name__)
CORS(app)
@app.route("/login",methods=['POST'])
def loginUser():
det... | 39.487356 | 202 | 0.646504 |
1d7810cbfc7c372ee7592ba35f2241dca39070fd | 400 | py | Python | tests/test_module.py | rswarbrick/pycoreir | 855d18eab067d27aad4d4bc11f486fbf43c04f08 | [
"BSD-3-Clause"
] | 13 | 2017-09-28T07:05:18.000Z | 2021-05-21T04:52:05.000Z | tests/test_module.py | rswarbrick/pycoreir | 855d18eab067d27aad4d4bc11f486fbf43c04f08 | [
"BSD-3-Clause"
] | 74 | 2017-09-17T17:35:13.000Z | 2021-09-07T18:42:59.000Z | tests/test_module.py | rswarbrick/pycoreir | 855d18eab067d27aad4d4bc11f486fbf43c04f08 | [
"BSD-3-Clause"
] | 7 | 2018-03-05T23:51:28.000Z | 2020-05-31T20:55:04.000Z | import pytest
import coreir
from coreir.module import NotAGeneratorException
def test_module():
c = coreir.Context()
module_typ = c.Record({"input": c.Array(8, c.BitIn()), "output": c.Array(9, c.Bit())})
module = c.global_namespace.new_module("multiply_by_2", module_typ)
assert module.generated == Fals... | 33.333333 | 90 | 0.72 |
aea73d3b0e170f4355327b4c324b5c41d4236497 | 6,868 | py | Python | cinder/tests/unit/backup/drivers/test_backup_posix.py | helenwalsh/cinder | 307fccea4cc9c6496334b0fe137206cb48499bd5 | [
"Apache-2.0"
] | 1 | 2019-02-17T17:49:41.000Z | 2019-02-17T17:49:41.000Z | cinder/tests/unit/backup/drivers/test_backup_posix.py | BelieveInFuture/cinder | fff95fa6a68a054488ee087b6e31f4f5e28209dc | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/backup/drivers/test_backup_posix.py | BelieveInFuture/cinder | fff95fa6a68a054488ee087b6e31f4f5e28209dc | [
"Apache-2.0"
] | 3 | 2020-06-16T07:29:48.000Z | 2020-06-21T10:22:57.000Z | # Copyright (c) 2015 Red Hat, Inc.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless require... | 37.944751 | 79 | 0.687828 |
f23ff1a2e8a229bcd599132d08de49255dd6a7c3 | 315 | py | Python | mmdepth/configs/new_exps/sunrgbd/sunrgbd_adabins.py | zhyever/DepthFormer | 5e9b49a48bd1654373e6a4ca3976d4de6f1d6941 | [
"Apache-2.0"
] | 4 | 2022-03-21T01:49:05.000Z | 2022-03-21T12:37:52.000Z | mmdepth/configs/new_exps/sunrgbd/sunrgbd_adabins.py | zhyever/DepthFormer | 5e9b49a48bd1654373e6a4ca3976d4de6f1d6941 | [
"Apache-2.0"
] | null | null | null | mmdepth/configs/new_exps/sunrgbd/sunrgbd_adabins.py | zhyever/DepthFormer | 5e9b49a48bd1654373e6a4ca3976d4de6f1d6941 | [
"Apache-2.0"
] | null | null | null | _base_ = [
'../../_base_/datasets/sun_rgbd.py',
'../../_base_/default_runtime.py', '../../_base_/schedules/schedule_cos20x.py'
]
model = dict(
type = 'Adabins',
# model training and testing settings
max_val=10,
train_cfg=dict(),
test_cfg=dict(mode='whole'))
find_unused_parameters=True | 24.230769 | 82 | 0.650794 |
74d5ad022899146649e0b6f19fb72118b21278b3 | 6,428 | py | Python | src/tc_supervised_learning/action_reconstruction_trainer.py | Sebastian-Griesbach/Improving-Policy-Conditioned-Value-Functions | ec4125c5e056753e507df0406fcd60b6b6c3dc25 | [
"MIT"
] | null | null | null | src/tc_supervised_learning/action_reconstruction_trainer.py | Sebastian-Griesbach/Improving-Policy-Conditioned-Value-Functions | ec4125c5e056753e507df0406fcd60b6b6c3dc25 | [
"MIT"
] | null | null | null | src/tc_supervised_learning/action_reconstruction_trainer.py | Sebastian-Griesbach/Improving-Policy-Conditioned-Value-Functions | ec4125c5e056753e507df0406fcd60b6b6c3dc25 | [
"MIT"
] | null | null | null | import torch
from torch import nn
from typing import Union, List
from tqdm import tqdm
from tc_supervised_learning.data_sampler import PolicyDataSampler
from tc_logging.log_handler import LogHandler
class ActionReconstructionTrainer():
LOG_TRAIN_LOSS = "train_loss"
LOG_VALID_LOSS = "valid_loss"
def __ini... | 46.244604 | 165 | 0.698195 |
b8b61bb4354749fba6f6b438beb355c52f257aa4 | 1,503 | py | Python | demo.py | VolkovAK/FastYoloInference | 35af21df9c30663bf1279913b7b1b2a60c75e043 | [
"MIT"
] | 7 | 2020-03-03T06:49:58.000Z | 2020-06-12T09:25:03.000Z | demo.py | VolkovAK/FastYoloInference | 35af21df9c30663bf1279913b7b1b2a60c75e043 | [
"MIT"
] | null | null | null | demo.py | VolkovAK/FastYoloInference | 35af21df9c30663bf1279913b7b1b2a60c75e043 | [
"MIT"
] | 1 | 2020-05-25T22:58:20.000Z | 2020-05-25T22:58:20.000Z | import cv2
import numpy as np
import time
import onnx # we must import onnx before pytorch to avoid segfault while onnx converting :/ (seems to be solved in pytorch 1.5.0)
import torch
from Detector.FYDetector import FYDetector
def draw_bboxes(img, bboxes):
for bbox in bboxes:
cv2.rectangle(img, (int(bbo... | 32.673913 | 129 | 0.64338 |
28a041b56d63643252f8c4d6fe7a6c63bf9c1ed4 | 62 | py | Python | lnt/lnttool/__init__.py | jobvdl1997/llvm-lnt | f4838441d0ae6ecc3af0e8446e9e4a70f546371f | [
"Apache-2.0"
] | 12 | 2015-10-29T19:28:02.000Z | 2020-02-04T21:25:32.000Z | lnt/lnttool/__init__.py | jobvdl1997/llvm-lnt | f4838441d0ae6ecc3af0e8446e9e4a70f546371f | [
"Apache-2.0"
] | 3 | 2017-03-04T14:23:14.000Z | 2019-11-02T21:56:51.000Z | lnt/lnttool/__init__.py | jobvdl1997/llvm-lnt | f4838441d0ae6ecc3af0e8446e9e4a70f546371f | [
"Apache-2.0"
] | 14 | 2015-04-03T03:36:06.000Z | 2019-10-23T14:09:08.000Z | from __future__ import absolute_import
from .main import main
| 20.666667 | 38 | 0.854839 |
b076668f270ec1e4d54fe66215d9e6670d8a7049 | 1,505 | py | Python | allauth/socialaccount/providers/vk/provider.py | harlov/django-allauth | ff03a2730a81fa85fef85f75688004f4c19cf207 | [
"MIT"
] | null | null | null | allauth/socialaccount/providers/vk/provider.py | harlov/django-allauth | ff03a2730a81fa85fef85f75688004f4c19cf207 | [
"MIT"
] | null | null | null | allauth/socialaccount/providers/vk/provider.py | harlov/django-allauth | ff03a2730a81fa85fef85f75688004f4c19cf207 | [
"MIT"
] | null | null | null | from allauth.socialaccount import providers
from allauth.socialaccount.providers.base import ProviderAccount
from allauth.socialaccount.providers.oauth2.provider import OAuth2Provider
from allauth.socialaccount import app_settings
class VKAccount(ProviderAccount):
def get_profile_url(self):
return self.ac... | 30.1 | 74 | 0.660465 |
5f48cc6076520c88a4a569cec74a3e5139063b3e | 11,764 | py | Python | tests/python/gaia-ui-tests/gaiatest/apps/camera/app.py | marshall/gaia | 00722269f5d559595fd2f79d9dd70310758af08c | [
"Apache-2.0"
] | 1 | 2019-02-13T23:44:14.000Z | 2019-02-13T23:44:14.000Z | tests/python/gaia-ui-tests/gaiatest/apps/camera/app.py | marshall/gaia | 00722269f5d559595fd2f79d9dd70310758af08c | [
"Apache-2.0"
] | null | null | null | tests/python/gaia-ui-tests/gaiatest/apps/camera/app.py | marshall/gaia | 00722269f5d559595fd2f79d9dd70310758af08c | [
"Apache-2.0"
] | null | null | null | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import time
try:
from marionette import (expected,
Wait)
from marionette.by import ... | 43.091575 | 128 | 0.722118 |
152c26991bb0a73e314df1094618890413859637 | 11,302 | py | Python | tests/core/test_farmer_harvester_rpc.py | grayfallstown/flax-blockchain | 58351afec41f78e031507d98b000db2087c2c13f | [
"Apache-2.0"
] | null | null | null | tests/core/test_farmer_harvester_rpc.py | grayfallstown/flax-blockchain | 58351afec41f78e031507d98b000db2087c2c13f | [
"Apache-2.0"
] | null | null | null | tests/core/test_farmer_harvester_rpc.py | grayfallstown/flax-blockchain | 58351afec41f78e031507d98b000db2087c2c13f | [
"Apache-2.0"
] | null | null | null | # flake8: noqa: E501
import logging
from secrets import token_bytes
import pytest
from blspy import AugSchemeMPL
from chiapos import DiskPlotter
from flax.consensus.coinbase import create_puzzlehash_for_pk
from flax.plotting.plot_tools import stream_plot_info_ph, stream_plot_info_pk
from flax.protocols import farmer_... | 40.949275 | 139 | 0.618917 |
0317497df0e2b66e6fcdba7bb98852211b8ac67d | 32,968 | py | Python | binobj/fields/base.py | dargueta/binobj | 00d91856678d7ecf17647a9b5cbff1810a39f275 | [
"BSD-3-Clause"
] | 2 | 2018-08-05T13:57:43.000Z | 2021-06-25T15:20:16.000Z | binobj/fields/base.py | dargueta/binobj | 00d91856678d7ecf17647a9b5cbff1810a39f275 | [
"BSD-3-Clause"
] | 2 | 2020-10-26T11:11:17.000Z | 2021-02-24T20:08:10.000Z | binobj/fields/base.py | dargueta/binobj | 00d91856678d7ecf17647a9b5cbff1810a39f275 | [
"BSD-3-Clause"
] | 1 | 2021-02-27T17:29:22.000Z | 2021-02-27T17:29:22.000Z | """Base classes and definitions common to all Fields."""
import abc
import enum
import functools
import io
import os
import typing
import warnings
from typing import Any
from typing import BinaryIO
from typing import Callable
from typing import Generic
from typing import Iterable
from typing import Mapping
from typing... | 38.469078 | 88 | 0.619146 |
ca98d7953623f1165effe6a00668a7a27e78b139 | 494 | py | Python | Lettuce_Tests/features/Test_Change_URLs.py | dblodgett-usgs/pyGDP | c011262622b3f73744a07db93d3024dfed2c4060 | [
"CC0-1.0"
] | 1 | 2021-04-30T19:17:07.000Z | 2021-04-30T19:17:07.000Z | Lettuce_Tests/features/Test_Change_URLs.py | dblodgett-usgs/pyGDP | c011262622b3f73744a07db93d3024dfed2c4060 | [
"CC0-1.0"
] | null | null | null | Lettuce_Tests/features/Test_Change_URLs.py | dblodgett-usgs/pyGDP | c011262622b3f73744a07db93d3024dfed2c4060 | [
"CC0-1.0"
] | 1 | 2021-04-27T19:14:42.000Z | 2021-04-27T19:14:42.000Z | from lettuce import *
from nose.tools import assert_equal
@step(r'Given I want to access shapefiles on some bogus server')
def point_to_bogus_geoserver(step):
import pyGDP
test_pyGDP = pyGDP.pyGDPwebProcessing(wfs_url='https://bogus/bogy/geoserver/wfs')
world.bogus_wfs = test_pyGDP.wfsUrl
@step(r'Then I... | 32.933333 | 85 | 0.775304 |
b1743162dcd538766fca008a147967ac9ac5b0d5 | 6,268 | py | Python | task_set/tasks/losg_problems/model_adapter.py | gunpowder78/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-03-19T04:26:12.000Z | 2022-03-19T04:26:12.000Z | task_set/tasks/losg_problems/model_adapter.py | gunpowder78/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | null | null | null | task_set/tasks/losg_problems/model_adapter.py | gunpowder78/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-03-30T07:20:29.000Z | 2022-03-30T07:20:29.000Z | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 33.340426 | 80 | 0.712827 |
012faa163e5bb9bf3791d97324296421850fb331 | 5,711 | py | Python | Hessian/fc6GAN_Hess_summary_cluster.py | Animadversio/Visual_Neuro_InSilico_Exp | 39b1e65e5613b064361c09c7d3f88496f3a7efd2 | [
"Apache-2.0"
] | 2 | 2020-02-03T18:16:26.000Z | 2020-05-01T18:27:01.000Z | Hessian/fc6GAN_Hess_summary_cluster.py | Animadversio/Visual_Neuro_InSilico_Exp | 39b1e65e5613b064361c09c7d3f88496f3a7efd2 | [
"Apache-2.0"
] | null | null | null | Hessian/fc6GAN_Hess_summary_cluster.py | Animadversio/Visual_Neuro_InSilico_Exp | 39b1e65e5613b064361c09c7d3f88496f3a7efd2 | [
"Apache-2.0"
] | 2 | 2020-01-24T17:27:33.000Z | 2020-08-30T02:54:13.000Z | """
This script summarize and the Hessian computation for FC6 GAN.
at the inverted codes of Pasupathy patches or Evolved codes from monkey experiments.
This is deployed on cluster for painless computation of lots of matrix multiplication
"""
#%%
import sys
sys.path.append("/home/binxu/Visual_Neuro_InSilico_Exp/")
impo... | 39.116438 | 145 | 0.703204 |
3a5a819b2c400f8d036126bf9e3b0154bf14d2f7 | 60,470 | py | Python | geoapps/utils/utils.py | annikan24/geoapps | 3f1f1c8d93cdcbe69a3ad3b7d00096aa135c8f0f | [
"MIT"
] | null | null | null | geoapps/utils/utils.py | annikan24/geoapps | 3f1f1c8d93cdcbe69a3ad3b7d00096aa135c8f0f | [
"MIT"
] | null | null | null | geoapps/utils/utils.py | annikan24/geoapps | 3f1f1c8d93cdcbe69a3ad3b7d00096aa135c8f0f | [
"MIT"
] | null | null | null | # Copyright (c) 2021 Mira Geoscience Ltd.
#
# This file is part of geoapps.
#
# geoapps is distributed under the terms and conditions of the MIT License
# (see LICENSE file at the root of this source code package).
from __future__ import annotations
import gc
import json
import os
import re
from uuid import UUID
... | 29.788177 | 126 | 0.578584 |
fd9a5dbb645522639d2af21e65785aa7db7f5db5 | 1,679 | py | Python | Python/ex3/ex3_nn.py | xAbdalla/Machine_Learning_Exercises-Stanford_University | 2b38413e91948b5d2614407ac9b62a60acd191d2 | [
"MIT"
] | null | null | null | Python/ex3/ex3_nn.py | xAbdalla/Machine_Learning_Exercises-Stanford_University | 2b38413e91948b5d2614407ac9b62a60acd191d2 | [
"MIT"
] | null | null | null | Python/ex3/ex3_nn.py | xAbdalla/Machine_Learning_Exercises-Stanford_University | 2b38413e91948b5d2614407ac9b62a60acd191d2 | [
"MIT"
] | null | null | null | import numpy as np
from scipy.io import loadmat
# from scipy.optimize import fmin_cg
# Ignore overflow and divide by zero of np.log() and np.exp()
# np.seterr(divide = 'ignore')
# np.seterr(over = 'ignore')
def sigmoid(z):
return 1.0 / (1.0 + np.exp(-z))
def predict(Theta1, Theta2, X):
# Useful values
m... | 29.45614 | 95 | 0.556284 |
37de05595298e297c1868a57542e5e9bd9676e5f | 163 | py | Python | src/radical/pilot/agent/executing/__init__.py | karahbit/radical.pilot | c611e1df781749deef899dcf5815728e1d8a962e | [
"MIT"
] | 47 | 2015-03-16T01:08:11.000Z | 2022-02-02T10:36:39.000Z | src/radical/pilot/agent/executing/__init__.py | karahbit/radical.pilot | c611e1df781749deef899dcf5815728e1d8a962e | [
"MIT"
] | 1,856 | 2015-01-02T09:32:20.000Z | 2022-03-31T21:45:06.000Z | src/radical/pilot/agent/executing/__init__.py | karahbit/radical.pilot | c611e1df781749deef899dcf5815728e1d8a962e | [
"MIT"
] | 28 | 2015-06-10T18:15:14.000Z | 2021-11-07T04:36:45.000Z |
__copyright__ = "Copyright 2016, http://radical.rutgers.edu"
__license__ = "MIT"
from .base import *
from .base import AgentExecutingComponent as Executing
| 16.3 | 60 | 0.754601 |
e9eb3c12fddbaa91c8c1900b95f4e80e2ca302aa | 2,723 | py | Python | src/lib/SSIM.py | CodingSheep1229/Dunhuang-Image-Restoration | c99e9aa1e86a2d9413527ae24c44c3e27663ca72 | [
"MIT"
] | null | null | null | src/lib/SSIM.py | CodingSheep1229/Dunhuang-Image-Restoration | c99e9aa1e86a2d9413527ae24c44c3e27663ca72 | [
"MIT"
] | 6 | 2021-06-08T21:12:38.000Z | 2022-03-12T00:21:42.000Z | src/lib/SSIM.py | CodingSheep1229/Dunhuang-Image-Restoration | c99e9aa1e86a2d9413527ae24c44c3e27663ca72 | [
"MIT"
] | null | null | null | #ssim loss pytorch implementation
#from https://github.com/Po-Hsun-Su/pytorch-ssim
import torch
import torch.nn.functional as F
from torch.autograd import Variable
import numpy as np
from math import exp
def gaussian(window_size, sigma):
gauss = torch.Tensor([exp(-(x - window_size//2)**2/float(2*sigma**2)) for x ... | 35.828947 | 104 | 0.651855 |
87fe3634881e4e8bae8672577ae46defb55424bf | 36,593 | py | Python | Population.py | RichardScottOZ/NADSM_PLOSONE | c45813b6a7a01580ae13afb7213a83bfed4b62cb | [
"CC-BY-4.0"
] | null | null | null | Population.py | RichardScottOZ/NADSM_PLOSONE | c45813b6a7a01580ae13afb7213a83bfed4b62cb | [
"CC-BY-4.0"
] | null | null | null | Population.py | RichardScottOZ/NADSM_PLOSONE | c45813b6a7a01580ae13afb7213a83bfed4b62cb | [
"CC-BY-4.0"
] | 1 | 2022-02-11T23:31:08.000Z | 2022-02-11T23:31:08.000Z | from WHM import *
whm = None # package global
from Utils import *
from Geography import *
from PopChronicler import *
import numpy as np
# For speed, we implement population and k as numpy arrays over the entire set of territories
# for rapid update and each polity maintains a mask into these arrays.
class OccupiedTe... | 60.988333 | 175 | 0.643921 |
cce3fed5a104f6e4d78dded4ac18c54c89c8fad5 | 151 | py | Python | src/artifice/paper/routes/story/views.py | artifice-project/artifice-paper | c20e863ced5364fbdd9142d4e336067504c8341c | [
"MIT"
] | null | null | null | src/artifice/paper/routes/story/views.py | artifice-project/artifice-paper | c20e863ced5364fbdd9142d4e336067504c8341c | [
"MIT"
] | null | null | null | src/artifice/paper/routes/story/views.py | artifice-project/artifice-paper | c20e863ced5364fbdd9142d4e336067504c8341c | [
"MIT"
] | null | null | null | from flask import Blueprint
story_blueprint = Blueprint('story', __name__)
@story_blueprint.route('/')
def index():
return '<h1>story page</h1>'
| 18.875 | 46 | 0.715232 |
f20c45eb513d36dbd8ace4c16401383d4cc96490 | 254 | py | Python | 8/8-12.py | liuhanyu200/pygame | 38a68e779e6b0a63edb1758fca98ebbf40bb0444 | [
"BSD-3-Clause"
] | null | null | null | 8/8-12.py | liuhanyu200/pygame | 38a68e779e6b0a63edb1758fca98ebbf40bb0444 | [
"BSD-3-Clause"
] | null | null | null | 8/8-12.py | liuhanyu200/pygame | 38a68e779e6b0a63edb1758fca98ebbf40bb0444 | [
"BSD-3-Clause"
] | null | null | null | # coding:utf-8
def make_sandwich(*toppings):
for topping in toppings:
print("You orderd a " + topping)
# 1、直接调用
make_sandwich('fish', 'cabbage', 'salad')
# 2、通过turple调用
tps = ('fish', 'cabbage', 'salad', 'fanqiejiang')
make_sandwich(*tps)
| 19.538462 | 49 | 0.65748 |
f0b60186a7bceae7cabee1132eb82389a1736634 | 4,913 | py | Python | src/App/FactoryDispatcher.py | dek4nice/Zope | ec4765fc0007c4e78aafcbeef510077444f8551a | [
"ZPL-2.1"
] | 1 | 2018-11-30T12:39:27.000Z | 2018-11-30T12:39:27.000Z | src/App/FactoryDispatcher.py | dek4nice/Zope | ec4765fc0007c4e78aafcbeef510077444f8551a | [
"ZPL-2.1"
] | null | null | null | src/App/FactoryDispatcher.py | dek4nice/Zope | ec4765fc0007c4e78aafcbeef510077444f8551a | [
"ZPL-2.1"
] | 1 | 2018-11-30T12:39:34.000Z | 2018-11-30T12:39:34.000Z | ##############################################################################
#
# Copyright (c) 2002 Zope Foundation and Contributors.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THIS SOFTWARE IS PROVIDED "AS I... | 29.244048 | 78 | 0.637899 |
d4c4c29492c01551bc98ddfc56fba062d46ae94d | 255 | py | Python | test/data/appending_test_cases_output_initial.py | hung135/pythoscope | b4b89b77b5184b25992893e320d58de32ed987f1 | [
"MIT"
] | 78 | 2015-01-03T22:35:30.000Z | 2022-01-09T15:32:57.000Z | test/data/appending_test_cases_output_initial.py | hung135/pythoscope | b4b89b77b5184b25992893e320d58de32ed987f1 | [
"MIT"
] | 15 | 2015-05-26T14:29:20.000Z | 2020-12-08T11:26:44.000Z | test/data/appending_test_cases_output_initial.py | hung135/pythoscope | b4b89b77b5184b25992893e320d58de32ed987f1 | [
"MIT"
] | 30 | 2015-06-05T13:02:11.000Z | 2021-05-31T08:03:28.000Z | import unittest
class TestSomeClass(unittest.TestCase):
def test___init__(self):
assert True # implemented test case
def test_some_method(self):
assert True # implemented test case
if __name__ == '__main__':
unittest.main()
| 21.25 | 43 | 0.701961 |
dbb1c996e7eb4a044ac788dcb90ee19e517c6a9a | 4,922 | py | Python | models/neuralrecon.py | ztmo520/NeuralRecon | 576c2573fc5028c5a6116d344a0774cb95737621 | [
"Apache-2.0"
] | null | null | null | models/neuralrecon.py | ztmo520/NeuralRecon | 576c2573fc5028c5a6116d344a0774cb95737621 | [
"Apache-2.0"
] | null | null | null | models/neuralrecon.py | ztmo520/NeuralRecon | 576c2573fc5028c5a6116d344a0774cb95737621 | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
from .backbone import MnasMulti
from .neucon_network import NeuConNet
from .gru_fusion import GRUFusion
from utils import tocuda
class NeuralRecon(nn.Module):
'''
NeuralRecon main class.
'''
def __init__(self, cfg):
super(NeuralRecon, self).__init__()
... | 41.361345 | 122 | 0.523364 |
57c897fde2c3a329af52c2dacf8bd7bc7b5b9235 | 3,724 | py | Python | tests/test_xbog_calendar.py | syonoki/exchange_calendars | 639ab0f88a874af99bb601824a8ffef2572820d4 | [
"Apache-2.0"
] | 128 | 2021-01-28T10:12:48.000Z | 2022-03-30T16:36:45.000Z | tests/test_xbog_calendar.py | syonoki/exchange_calendars | 639ab0f88a874af99bb601824a8ffef2572820d4 | [
"Apache-2.0"
] | 101 | 2021-01-28T06:25:55.000Z | 2022-03-31T06:15:37.000Z | tests/test_xbog_calendar.py | syonoki/exchange_calendars | 639ab0f88a874af99bb601824a8ffef2572820d4 | [
"Apache-2.0"
] | 52 | 2021-03-07T23:22:41.000Z | 2022-03-30T16:54:06.000Z | import pytest
from exchange_calendars.exchange_calendar_xbog import XBOGExchangeCalendar
from .test_exchange_calendar import ExchangeCalendarTestBase
class TestXBOGCalendar(ExchangeCalendarTestBase):
@pytest.fixture(scope="class")
def calendar_cls(self):
yield XBOGExchangeCalendar
@pytest.fixtur... | 40.478261 | 80 | 0.537863 |
abfb917a1acdc9b2900972b5409c7ead0faf29a3 | 7,907 | py | Python | train.py | prraoo/crf-image-denoising | 8f65d3addb7e808decd66b073f8a7b2da0757d70 | [
"MIT"
] | 1 | 2022-03-28T11:30:09.000Z | 2022-03-28T11:30:09.000Z | train.py | prraoo/crf-image-denoising | 8f65d3addb7e808decd66b073f8a7b2da0757d70 | [
"MIT"
] | null | null | null | train.py | prraoo/crf-image-denoising | 8f65d3addb7e808decd66b073f8a7b2da0757d70 | [
"MIT"
] | null | null | null | import argparse
import logging
import os
import sys
sys.path.insert(0,'D:\\pgm\\Project')
import numpy as np
import torch
import torch.nn as nn
from torch import optim
from tqdm import tqdm
from eval import eval_net
from unet import UNet
from fcn8s import Fcn8s
from dpir import DnCNN
from crfrnn.crfasrnn_model import ... | 39.733668 | 118 | 0.586063 |
378f33b10c8d8875ebe62203b026b8e12c31ac8b | 6,688 | py | Python | bindings/python/ensmallen_graph/datasets/string/streptomycescoelicolor.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/streptomycescoelicolor.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/streptomycescoelicolor.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | """
This file offers the methods to automatically retrieve the graph Streptomyces coelicolor.
The graph is automatically retrieved from the STRING repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime: 202... | 35.386243 | 223 | 0.703798 |
9d3d3804d023ff35c302eb7df0916519ac92dbc6 | 4,000 | py | Python | build/python/tests/assembly/py_assembly_test.py | allansrc/fuchsia | a2c235b33fc4305044d496354a08775f30cdcf37 | [
"BSD-2-Clause"
] | 2 | 2022-02-24T16:24:29.000Z | 2022-02-25T22:33:10.000Z | build/python/tests/assembly/py_assembly_test.py | allansrc/fuchsia | a2c235b33fc4305044d496354a08775f30cdcf37 | [
"BSD-2-Clause"
] | null | null | null | build/python/tests/assembly/py_assembly_test.py | allansrc/fuchsia | a2c235b33fc4305044d496354a08775f30cdcf37 | [
"BSD-2-Clause"
] | null | null | null | # Copyright 2022 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""!/usr/bin/env python3.8"""
import unittest
from assembly import BlobEntry, PackageManifest, PackageMetaData
import serialization
raw_json = """{
"pac... | 35.714286 | 91 | 0.54175 |
4db2ac858b9898a2d0a355f584b97a4fb437b799 | 3,037 | py | Python | ida_kernelcache/__init__.py | vngkv123/ida_kernelcache | c08d63c298aa3c55beb4939deafc642be23a380e | [
"MIT"
] | 4 | 2020-08-13T13:39:37.000Z | 2021-03-04T22:54:15.000Z | ida_kernelcache/__init__.py | vngkv123/ida_kernelcache | c08d63c298aa3c55beb4939deafc642be23a380e | [
"MIT"
] | null | null | null | ida_kernelcache/__init__.py | vngkv123/ida_kernelcache | c08d63c298aa3c55beb4939deafc642be23a380e | [
"MIT"
] | 1 | 2021-03-04T22:54:16.000Z | 2021-03-04T22:54:16.000Z | import ida_bytes
#
# ida_kernelcache/__init__.py
# Brandon Azad
#
# The main ida_kernelcache module containing my iOS kernelcache utilities for IDA.
#
# This isn't kernelcache-specific, but it's useful to have access to in the interpreter and other
# scripts.
import ida_utilities
import ida_auto
import build_struct
i... | 33.373626 | 98 | 0.739875 |
c4c95b224876b9fe55f3319291e01a5d7197dac3 | 548 | py | Python | twisted-deferred/defer-8.py | kaizoku-o/twisted-tutorial | f09f912e2db7e8720a47a19a71e3922d94327fc5 | [
"MIT"
] | null | null | null | twisted-deferred/defer-8.py | kaizoku-o/twisted-tutorial | f09f912e2db7e8720a47a19a71e3922d94327fc5 | [
"MIT"
] | null | null | null | twisted-deferred/defer-8.py | kaizoku-o/twisted-tutorial | f09f912e2db7e8720a47a19a71e3922d94327fc5 | [
"MIT"
] | null | null | null | import sys
from twisted.internet.defer import Deferred
def got_poem(poem):
print(poem)
from twisted.internet import reactor
reactor.stop()
def poem_failed(err):
print("poem download failed", file=sys.stderr)
print("I am terribly sorry", file=sys.stderr)
print("try again later?", file=sys.stde... | 24.909091 | 58 | 0.739051 |
e42c21dd40af470ae8fb2c0a335a702e734146e1 | 816 | py | Python | pyQuARC/code/base_validator.py | NASA-IMPACT/pyQuARC | 9c174624a9d3e340cf91c7925aaae2203515e13f | [
"Apache-2.0"
] | 9 | 2021-03-12T18:04:25.000Z | 2022-03-22T01:30:56.000Z | pyQuARC/code/base_validator.py | NASA-IMPACT/pyQuARC | 9c174624a9d3e340cf91c7925aaae2203515e13f | [
"Apache-2.0"
] | 129 | 2021-04-19T15:42:12.000Z | 2022-03-28T16:50:39.000Z | pyQuARC/code/base_validator.py | NASA-IMPACT/pyQuARC | 9c174624a9d3e340cf91c7925aaae2203515e13f | [
"Apache-2.0"
] | 1 | 2022-03-30T20:33:30.000Z | 2022-03-30T20:33:30.000Z | class BaseValidator:
"""
Base class for all the validators
"""
def __init__(self):
pass
@staticmethod
def eq(first, second):
return first == second
@staticmethod
def neq(first, second):
return first != second
@staticmethod
def lt(first, second):
... | 19.902439 | 47 | 0.610294 |
4e428fb9f0e36076869638d1af71e8bce37c3c1b | 40,922 | py | Python | tensorflow/python/eager/def_function_xla_jit_test.py | Nickmeagan70/tensorflow | 6bfedde8466daced9f40a0e11840f5ce274abc7d | [
"Apache-2.0"
] | 7 | 2022-03-04T21:14:47.000Z | 2022-03-22T23:07:39.000Z | tensorflow/python/eager/def_function_xla_jit_test.py | Nickmeagan70/tensorflow | 6bfedde8466daced9f40a0e11840f5ce274abc7d | [
"Apache-2.0"
] | 1 | 2022-03-08T18:28:46.000Z | 2022-03-08T18:37:20.000Z | tensorflow/python/eager/def_function_xla_jit_test.py | Nickmeagan70/tensorflow | 6bfedde8466daced9f40a0e11840f5ce274abc7d | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 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.446128 | 80 | 0.633156 |
f4c5eb62b63f82b882df6ef89b7c95e8cd0e2259 | 898 | py | Python | users/migrations/0001_initial.py | yahyasaadi/awwwards | bd6a014a7fb6259606fd201e0b8bcc4c82252c2d | [
"MIT"
] | null | null | null | users/migrations/0001_initial.py | yahyasaadi/awwwards | bd6a014a7fb6259606fd201e0b8bcc4c82252c2d | [
"MIT"
] | null | null | null | users/migrations/0001_initial.py | yahyasaadi/awwwards | bd6a014a7fb6259606fd201e0b8bcc4c82252c2d | [
"MIT"
] | null | null | null | # Generated by Django 4.0.3 on 2022-03-15 07:48
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
ope... | 32.071429 | 121 | 0.632517 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.