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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
daee1ebcd2add9ebde107d57d4efdfeae8e98918 | 970 | py | Python | Ar_Script/past/类_游乐场门票.py | archerckk/PyTest | 610dd89df8d70c096f4670ca11ed2f0ca3196ca5 | [
"MIT"
] | null | null | null | Ar_Script/past/类_游乐场门票.py | archerckk/PyTest | 610dd89df8d70c096f4670ca11ed2f0ca3196ca5 | [
"MIT"
] | 1 | 2020-01-19T01:19:57.000Z | 2020-01-19T01:19:57.000Z | Ar_Script/past/类_游乐场门票.py | archerckk/PyTest | 610dd89df8d70c096f4670ca11ed2f0ca3196ca5 | [
"MIT"
] | null | null | null | class Ticket:
time=[1,2]
price = 100
man_num=0
children_num=0
total=0
def getTime(self):
self.time = int(input('请输入你要游玩的时间:1为【平常时间】,2为【周末】:'))
if self.time==1:
return self.time
if self.time==2:
return self.time
def getNum(self):
self... | 30.3125 | 93 | 0.626804 |
565adfdc87f33265fcf23a15c720274d1069a87d | 17,882 | py | Python | transifex/native/parsing.py | transifex/transifex-python | d467e82bba7f0d620a021cf9e7e58c987ba2fbb5 | [
"Apache-2.0"
] | 14 | 2020-04-10T20:54:59.000Z | 2022-03-07T16:13:22.000Z | transifex/native/parsing.py | transifex/transifex-python | d467e82bba7f0d620a021cf9e7e58c987ba2fbb5 | [
"Apache-2.0"
] | 60 | 2020-04-14T12:41:06.000Z | 2022-03-29T06:38:09.000Z | transifex/native/parsing.py | transifex/transifex-python | d467e82bba7f0d620a021cf9e7e58c987ba2fbb5 | [
"Apache-2.0"
] | 6 | 2021-01-01T10:28:11.000Z | 2021-06-10T09:50:26.000Z | from __future__ import unicode_literals
import ast
import re
from collections import namedtuple
from transifex.common._compat import string_types
from transifex.common.utils import generate_key, make_hashable
from transifex.native import consts
from transifex.native.consts import KEY_CONTEXT, KEY_KEY
# PEP 263 magic... | 35.979879 | 83 | 0.587127 |
be55d44f64ed198bab23c8f8429d8538cdcf8c43 | 9,068 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_hub_virtual_network_connections_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-03-24T06:26:11.000Z | 2021-04-18T15:55:59.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_hub_virtual_network_connections_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 4 | 2019-04-17T17:57:49.000Z | 2020-04-24T21:11:22.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_04_01/operations/_hub_virtual_network_connections_operations.py | beltr0n/azure-sdk-for-python | 2f7fb8bee881b0fc0386a0ad5385755ceedd0453 | [
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 48.491979 | 215 | 0.67071 |
52108c3e801185f4f63b3d9ddc8c2a97acbf3f64 | 2,609 | py | Python | _doc/conf.py | brmscheiner/ibeis | 9bb93a6cd74ac47921e734c80917a38609dfe661 | [
"Apache-2.0"
] | null | null | null | _doc/conf.py | brmscheiner/ibeis | 9bb93a6cd74ac47921e734c80917a38609dfe661 | [
"Apache-2.0"
] | null | null | null | _doc/conf.py | brmscheiner/ibeis | 9bb93a6cd74ac47921e734c80917a38609dfe661 | [
"Apache-2.0"
] | null | null | null | from sphinx.ext.autodoc import between
import sphinx_rtd_theme
import sys
import os
# Dont parse IBEIS args
os.environ['IBIES_PARSE_ARGS'] = 'OFF'
os.environ['UTOOL_AUTOGEN_SPHINX_RUNNING'] = 'ON'
sys.path.append('/Users/jason.parham/code/ibeis')
sys.path.append(sys.path.insert(0, os.path.abspath("../")))
autosummar... | 28.67033 | 83 | 0.644308 |
5008436aace1b8e47f6ebc012139e6ecd92acc23 | 5,668 | py | Python | src/cfnlint/rules/resources/Configuration.py | joenye/cfn-python-lint | 837aac504c58fca4a8ca0211bc57ec920c772bb4 | [
"MIT-0"
] | null | null | null | src/cfnlint/rules/resources/Configuration.py | joenye/cfn-python-lint | 837aac504c58fca4a8ca0211bc57ec920c772bb4 | [
"MIT-0"
] | null | null | null | src/cfnlint/rules/resources/Configuration.py | joenye/cfn-python-lint | 837aac504c58fca4a8ca0211bc57ec920c772bb4 | [
"MIT-0"
] | null | null | null | """
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: MIT-0
"""
import six
from cfnlint.rules import CloudFormationLintRule
from cfnlint.rules import RuleMatch
import cfnlint.helpers
class Configuration(CloudFormationLintRule):
"""Check Base Resource Configuration"""
... | 45.709677 | 136 | 0.507586 |
5701cbb0c33b1630c9b25a7960b98d6ed3c01e0c | 5,323 | py | Python | src/viz.py | sawezo/moran_dc | 631012024322c68307f998e9f81f23b73ada5938 | [
"MIT"
] | null | null | null | src/viz.py | sawezo/moran_dc | 631012024322c68307f998e9f81f23b73ada5938 | [
"MIT"
] | null | null | null | src/viz.py | sawezo/moran_dc | 631012024322c68307f998e9f81f23b73ada5938 | [
"MIT"
] | null | null | null | """
visualization functionality
"""
# data science
import numpy as np
import pandas as pd
# visualization
import seaborn as sns
import matplotlib.pyplot as plt
from matplotlib.lines import Line2D
# configurations
sns.set_style("darkgrid")
plt.rcParams["font.family"] = "DejaVu Serif"
def quick_histogram(df, c):
... | 35.486667 | 127 | 0.675935 |
568de88e636dacae7dc6815f0c624b2a5d27a8ac | 31,966 | py | Python | Lib/random.py | arvindm95/unladen-swallow | 8175e37eaea7ca66ed03283b46bc1d2db0d3f9c3 | [
"PSF-2.0"
] | 8 | 2020-08-24T14:21:35.000Z | 2022-01-26T04:49:11.000Z | Lib/random.py | arvindm95/unladen-swallow | 8175e37eaea7ca66ed03283b46bc1d2db0d3f9c3 | [
"PSF-2.0"
] | 1 | 2020-09-07T15:33:56.000Z | 2020-09-07T15:33:56.000Z | Lib/random.py | arvindm95/unladen-swallow | 8175e37eaea7ca66ed03283b46bc1d2db0d3f9c3 | [
"PSF-2.0"
] | 3 | 2017-04-07T12:02:22.000Z | 2020-03-23T12:11:55.000Z | """Random variable generators.
integers
--------
uniform within range
sequences
---------
pick random element
pick random sample
generate random permutation
distributions on the real line:
------------------------------
uniform
... | 35.557286 | 96 | 0.562504 |
466fc8b93f8aab0713226db88a3c5d91fc517f75 | 3,445 | py | Python | RestPy/ixnetwork_restpy/testplatform/sessions/ixnetwork/topology/dhcp6iapd1.py | kakkotetsu/IxNetwork | f9fb614b51bb8988af035967991ad36702933274 | [
"MIT"
] | null | null | null | RestPy/ixnetwork_restpy/testplatform/sessions/ixnetwork/topology/dhcp6iapd1.py | kakkotetsu/IxNetwork | f9fb614b51bb8988af035967991ad36702933274 | [
"MIT"
] | null | null | null | RestPy/ixnetwork_restpy/testplatform/sessions/ixnetwork/topology/dhcp6iapd1.py | kakkotetsu/IxNetwork | f9fb614b51bb8988af035967991ad36702933274 | [
"MIT"
] | null | null | null |
# Copyright 1997 - 2018 by IXIA Keysight
#
# 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, p... | 36.263158 | 190 | 0.744848 |
430aa5efe32a372b37702324536c6409b121525f | 4,276 | py | Python | ci/fireci/tests/integ_tests.py | sfuqua/firebase-android-sdk | cd016144fcbca92629a1a3317a16b1d5087ed682 | [
"Apache-2.0"
] | 12 | 2021-10-21T12:08:42.000Z | 2022-03-23T06:15:22.000Z | ci/fireci/tests/integ_tests.py | sfuqua/firebase-android-sdk | cd016144fcbca92629a1a3317a16b1d5087ed682 | [
"Apache-2.0"
] | 42 | 2020-06-28T04:26:13.000Z | 2021-12-28T07:01:34.000Z | ci/fireci/tests/integ_tests.py | sfuqua/firebase-android-sdk | cd016144fcbca92629a1a3317a16b1d5087ed682 | [
"Apache-2.0"
] | 1 | 2021-09-07T04:38:47.000Z | 2021-09-07T04:38:47.000Z | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 34.483871 | 78 | 0.653882 |
a4bfd8821e266044a86c3664b2d3e40bf9cc300e | 64,890 | py | Python | django/contrib/admin/options.py | riklaunim/django-custom-multisite | 6824aa8628d85e366e73f9adcdb68501e387c7ea | [
"BSD-3-Clause"
] | 7 | 2016-02-09T06:43:14.000Z | 2021-03-12T06:07:50.000Z | django/contrib/admin/options.py | riklaunim/django-custom-multisite | 6824aa8628d85e366e73f9adcdb68501e387c7ea | [
"BSD-3-Clause"
] | null | null | null | django/contrib/admin/options.py | riklaunim/django-custom-multisite | 6824aa8628d85e366e73f9adcdb68501e387c7ea | [
"BSD-3-Clause"
] | null | null | null | from functools import update_wrapper, partial
from django import forms
from django.conf import settings
from django.forms.formsets import all_valid
from django.forms.models import (modelform_factory, modelformset_factory,
inlineformset_factory, BaseInlineFormSet)
from django.contrib.contenttypes.models import Conte... | 43.144947 | 173 | 0.608075 |
8f8b0cfb4c0b237503d33dcdd1b8fe9a5403fffc | 12,269 | py | Python | Datasets/PubFig/SAE_PubFig.py | CristianoPatricio/Thesis | 097405278a568e2ab620ab4965be2c33e59dd9c3 | [
"MIT"
] | null | null | null | Datasets/PubFig/SAE_PubFig.py | CristianoPatricio/Thesis | 097405278a568e2ab620ab4965be2c33e59dd9c3 | [
"MIT"
] | null | null | null | Datasets/PubFig/SAE_PubFig.py | CristianoPatricio/Thesis | 097405278a568e2ab620ab4965be2c33e59dd9c3 | [
"MIT"
] | 1 | 2020-11-07T14:49:12.000Z | 2020-11-07T14:49:12.000Z | import numpy as np
import os
import scipy.io
from sklearn.metrics import classification_report, confusion_matrix
import argparse
from sklearn import preprocessing
from scipy.linalg import solve_sylvester
from scipy.spatial import distance
import pickle
import time
class SAE():
"""docstring for ClassName"""
de... | 38.460815 | 132 | 0.643899 |
88f92c88956ec5533ec0ed254c71b0cc890c280c | 5,803 | py | Python | backend/booking/forms.py | uncle-yura/simple_booking | 91a9609ae4521e4b2d52953112607c69db54d0ee | [
"MIT"
] | null | null | null | backend/booking/forms.py | uncle-yura/simple_booking | 91a9609ae4521e4b2d52953112607c69db54d0ee | [
"MIT"
] | null | null | null | backend/booking/forms.py | uncle-yura/simple_booking | 91a9609ae4521e4b2d52953112607c69db54d0ee | [
"MIT"
] | null | null | null | from django import forms
from django.contrib.auth.models import User
from django.contrib.auth.mixins import LoginRequiredMixin, UserPassesTestMixin
from django.forms.models import inlineformset_factory
from django.forms.widgets import SelectMultiple, Select
from django.utils.translation import gettext_lazy as _
from .... | 29.308081 | 99 | 0.575737 |
ce07f5ab6155d6cf5dc0e69a05002a16f6c6c748 | 34,658 | py | Python | tests/common.py | dlintott/core | a6c83cc46a34084fdc4c0e7221b6ba493f82cbac | [
"Apache-2.0"
] | 1 | 2020-12-24T23:23:24.000Z | 2020-12-24T23:23:24.000Z | tests/common.py | jrhubott/core | 89fe232643134f283c041537e9f6841f47dc1c5e | [
"Apache-2.0"
] | 48 | 2021-01-06T07:02:41.000Z | 2022-03-31T06:10:45.000Z | tests/common.py | jrhubott/core | 89fe232643134f283c041537e9f6841f47dc1c5e | [
"Apache-2.0"
] | 2 | 2021-07-14T20:22:04.000Z | 2021-09-22T08:56:16.000Z | """Test the helper method for writing tests."""
import asyncio
import collections
from collections import OrderedDict
from contextlib import contextmanager
from datetime import timedelta
import functools as ft
from io import StringIO
import json
import logging
import os
import pathlib
import threading
import time
impor... | 30.779751 | 93 | 0.656356 |
7e1f71b0058dfd687a602e38bc1c5e8444c9011f | 327 | py | Python | setup.py | memcmp/catchletters | 2fc7267640838b2d612aedf965b87b29535a976c | [
"WTFPL"
] | 1 | 2015-09-29T07:25:15.000Z | 2015-09-29T07:25:15.000Z | setup.py | memcmp/catchletters | 2fc7267640838b2d612aedf965b87b29535a976c | [
"WTFPL"
] | null | null | null | setup.py | memcmp/catchletters | 2fc7267640838b2d612aedf965b87b29535a976c | [
"WTFPL"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
requirements = [
'cocos2d'
]
setup(
name='catchletters',
packages=['catchletters'],
entry_points={
'console_scripts': [
'catchletters = catchletters.main:main'
]
},
install_requires=requirem... | 16.35 | 51 | 0.602446 |
51774b14606ed9760756806ca60cf2469922971e | 4,035 | py | Python | jupyterlab_git/tests/test_detailed_log.py | EnisBerk/jupyterlab-git | a558c76570b2d75e01717d769771e52e58bfd439 | [
"BSD-3-Clause"
] | 1 | 2021-02-12T17:10:21.000Z | 2021-02-12T17:10:21.000Z | jupyterlab_git/tests/test_detailed_log.py | EnisBerk/jupyterlab-git | a558c76570b2d75e01717d769771e52e58bfd439 | [
"BSD-3-Clause"
] | 1 | 2021-04-08T11:17:12.000Z | 2021-04-08T11:17:12.000Z | jupyterlab_git/tests/test_detailed_log.py | EnisBerk/jupyterlab-git | a558c76570b2d75e01717d769771e52e58bfd439 | [
"BSD-3-Clause"
] | null | null | null | # python lib
from pathlib import Path
from unittest.mock import Mock, call, patch
import pytest
# local lib
from jupyterlab_git.git import Git
from .testutils import FakeContentManager, maybe_future
@pytest.mark.asyncio
async def test_detailed_log():
with patch("jupyterlab_git.git.execute") as mock_execute:
... | 35.394737 | 109 | 0.47088 |
6b17a35cf4bac7c04d0d54632ad52bfc3955a9d1 | 804 | py | Python | manage.py | hasadna/birdee | 304a9e259d69e49535f4529288a01967c9c4c15a | [
"Apache-2.0"
] | 1 | 2017-10-29T05:56:00.000Z | 2017-10-29T05:56:00.000Z | manage.py | hasadna/birdee | 304a9e259d69e49535f4529288a01967c9c4c15a | [
"Apache-2.0"
] | null | null | null | manage.py | hasadna/birdee | 304a9e259d69e49535f4529288a01967c9c4c15a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "birdee.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that the
... | 34.956522 | 77 | 0.641791 |
2ce0eba9cd0846c65241e14a4725c935d2d4d01d | 973 | py | Python | vogue/models/database/bioinfo_sample/mutant.py | mayabrandi/vogue | 463e6417a9168eadb0d11dea2d0f97919494bcd3 | [
"MIT"
] | 1 | 2021-12-16T19:29:17.000Z | 2021-12-16T19:29:17.000Z | vogue/models/database/bioinfo_sample/mutant.py | mayabrandi/vogue | 463e6417a9168eadb0d11dea2d0f97919494bcd3 | [
"MIT"
] | 188 | 2018-10-25T06:13:17.000Z | 2022-02-25T19:47:06.000Z | vogue/models/database/bioinfo_sample/mutant.py | mayabrandi/vogue | 463e6417a9168eadb0d11dea2d0f97919494bcd3 | [
"MIT"
] | null | null | null | from pydantic import BaseModel
class MultiqcPicardAlignmentSummaryMetrics(BaseModel):
total_reads: int # ?
pct_pf_reads_aligned: float
mean_read_length: float
class MultiqcPicardInsertSize(BaseModel):
medin_insert_size: int
class MultiqcPicardWGSMetrics(BaseModel):
median_coverage: float
... | 25.605263 | 82 | 0.818088 |
464049cdc801ecf72c39324591094ee90f1b414f | 1,502 | py | Python | avalanche/envs/play.py | NickLucche/avalanche | 627be32a0a5178bf255a53ada5413fec3df1642f | [
"MIT"
] | 3 | 2021-09-20T11:43:25.000Z | 2022-03-31T09:04:34.000Z | avalanche/envs/play.py | NickLucche/avalanche | 627be32a0a5178bf255a53ada5413fec3df1642f | [
"MIT"
] | null | null | null | avalanche/envs/play.py | NickLucche/avalanche | 627be32a0a5178bf255a53ada5413fec3df1642f | [
"MIT"
] | null | null | null | import argparse
import gym
from avalanche.envs import *
import cv2
from argparse import ArgumentParser
import argparse
if __name__ == "__main__":
args = ArgumentParser()
args.add_argument('-e', '--env', help='Environment id', default='CCartPole-v1')
# any other argument to pass to the env
# args.add_a... | 30.653061 | 86 | 0.550599 |
23c641ed93b5b282caa2e2b590c52120930188d5 | 6,013 | py | Python | qa/rpc-tests/prioritise_transaction.py | v1nc0/macclone14.3 | e91fb2566205b5f4e2e1b2384cd93309a24261c4 | [
"MIT"
] | null | null | null | qa/rpc-tests/prioritise_transaction.py | v1nc0/macclone14.3 | e91fb2566205b5f4e2e1b2384cd93309a24261c4 | [
"MIT"
] | null | null | null | qa/rpc-tests/prioritise_transaction.py | v1nc0/macclone14.3 | e91fb2566205b5f4e2e1b2384cd93309a24261c4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2015-2016 The Machinecoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test PrioritiseTransaction code
#
from test_framework.test_framework import MachinecoinTestFrame... | 41.756944 | 153 | 0.645934 |
7dc6125be72f67018948b028a4df97d1fec15499 | 473 | py | Python | gename/main.py | sorl/gename | d3cade21835c28bf44c9c87d3183235764c1719c | [
"0BSD"
] | null | null | null | gename/main.py | sorl/gename | d3cade21835c28bf44c9c87d3183235764c1719c | [
"0BSD"
] | null | null | null | gename/main.py | sorl/gename | d3cade21835c28bf44c9c87d3183235764c1719c | [
"0BSD"
] | null | null | null | import sqlite3
import os
here = os.path.abspath(os.path.dirname(__file__))
class Gender:
def __init__(self):
self.conn = sqlite3.connect(os.path.join(here, 'names.db'))
self.cur = self.conn.cursor()
def speculate(self, name):
self.cur.execute(
'SELECT gender from name_ge... | 21.5 | 67 | 0.566596 |
2deb12fbe1913da94c0b0840f30dcc01dbdf3623 | 23 | py | Python | yolo/_version.py | TonyZ1Min/Yolo-digit-detector | b805c957d51c8e276fc3206ca782c891ad20dca4 | [
"MIT"
] | 251 | 2018-01-28T17:33:31.000Z | 2022-02-24T06:01:10.000Z | yolo/_version.py | TonyZ1Min/Yolo-digit-detector | b805c957d51c8e276fc3206ca782c891ad20dca4 | [
"MIT"
] | 40 | 2018-01-04T12:49:41.000Z | 2022-01-25T13:59:48.000Z | yolo/_version.py | TonyZ1Min/Yolo-digit-detector | b805c957d51c8e276fc3206ca782c891ad20dca4 | [
"MIT"
] | 104 | 2018-01-25T08:21:22.000Z | 2022-01-17T18:50:01.000Z | __version__ = "develop" | 23 | 23 | 0.782609 |
e0eae2d0e82e656cb7a7dd09d9811efdfa43d8c5 | 8,806 | py | Python | jax3d/projects/nesf/nerfstatic/utils/geometry_utils.py | google-research/jax3d | f08ae174c80cd6c597f8fe5417168c82857eb236 | [
"Apache-2.0"
] | 33 | 2021-12-15T12:59:28.000Z | 2022-03-30T05:29:09.000Z | jax3d/projects/nesf/nerfstatic/utils/geometry_utils.py | google-research/jax3d | f08ae174c80cd6c597f8fe5417168c82857eb236 | [
"Apache-2.0"
] | 5 | 2021-12-15T15:15:03.000Z | 2021-12-15T17:25:27.000Z | jax3d/projects/nesf/nerfstatic/utils/geometry_utils.py | google-research/jax3d | f08ae174c80cd6c597f8fe5417168c82857eb236 | [
"Apache-2.0"
] | 1 | 2022-01-29T18:30:02.000Z | 2022-01-29T18:30:02.000Z | # Copyright 2022 The jax3d Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 32.375 | 87 | 0.682262 |
d9f8d53a915fc2f9a1cc92e0a38022207e846623 | 5,084 | py | Python | log_modules/log_gardening.py | edmund-bishanga/text_proc_expts | 98e075beec4b2f0f731197fc5c8bf794f4b7e00d | [
"MIT"
] | null | null | null | log_modules/log_gardening.py | edmund-bishanga/text_proc_expts | 98e075beec4b2f0f731197fc5c8bf794f4b7e00d | [
"MIT"
] | null | null | null | log_modules/log_gardening.py | edmund-bishanga/text_proc_expts | 98e075beec4b2f0f731197fc5c8bf794f4b7e00d | [
"MIT"
] | null | null | null | #!/usr/bin/python
"""
log gardening module:
Often SysTest Experiments generate logs
These need to be post-processed and analysed
This module aims to have re-usable methods for doing just that...
"""
# pylint: disable=redefined-outer-name
# pylint: disable=invalid-name
# pylint: disable=missing-function-docstring
# p... | 33.012987 | 81 | 0.604249 |
4b78d5ecb63406fd4b42c8af2040d5d90cbfe299 | 7,961 | py | Python | kirppu/util.py | tracon/kirppu | 65c926daa6138b14268693eeac6e6e517a3cd96b | [
"MIT"
] | null | null | null | kirppu/util.py | tracon/kirppu | 65c926daa6138b14268693eeac6e6e517a3cd96b | [
"MIT"
] | 6 | 2017-02-03T07:42:57.000Z | 2019-12-23T14:25:15.000Z | kirppu/util.py | tracon/kirppu | 65c926daa6138b14268693eeac6e6e517a3cd96b | [
"MIT"
] | 6 | 2015-01-26T22:27:26.000Z | 2019-01-20T21:57:51.000Z | # -*- coding: utf-8 -*-
import base64
import math
"""
Miscellaneous utility functions.
"""
def swap(number, i1, i2):
"""
Swap given bits from number.
:param number: A number
:type number: int
:param i1: Bit index
:type i1: int
:param i2: Bit index
:type i2: int
:return: A number ... | 23.835329 | 116 | 0.604824 |
bb39e97ae77a1de24131e880d11f066a2f737fb7 | 2,774 | py | Python | doc/source/code/tut2.py | naiduv/netpyne | 6ecfe1b7223d3e40615274bfec9d53e7d03b534a | [
"MIT"
] | 1 | 2021-04-21T16:48:17.000Z | 2021-04-21T16:48:17.000Z | doc/source/code/tut2.py | bikramkhastgir/netpyne | 20d2dfdecf303c779d6ab97e6ef579835798beb1 | [
"MIT"
] | 1 | 2021-05-04T00:42:12.000Z | 2021-05-04T00:42:12.000Z | doc/source/code/tut2.py | bikramkhastgir/netpyne | 20d2dfdecf303c779d6ab97e6ef579835798beb1 | [
"MIT"
] | 1 | 2021-08-02T14:27:09.000Z | 2021-08-02T14:27:09.000Z | from netpyne import specs, sim
# Network parameters
netParams = specs.NetParams() # object of class NetParams to store the network parameters
## Cell parameters/rules
PYRcell = {'secs': {}}
PYRcell['secs']['soma'] = {'geom': {}, 'mechs': {}} # soma params dict
PYRcell['secs']['soma']['geom'] = {'diam': 18.8, 'L': 1... | 48.666667 | 134 | 0.646359 |
b3fb425983c08f6dd1738c47b6ac85b13136045c | 7,418 | py | Python | 1-lxastro0/code_local/utils/verifications.py | remtav/SpaceNet7_Multi-Temporal_Solutions | ee535c61fc22bffa45331519239c6d1b044b1514 | [
"Apache-2.0"
] | null | null | null | 1-lxastro0/code_local/utils/verifications.py | remtav/SpaceNet7_Multi-Temporal_Solutions | ee535c61fc22bffa45331519239c6d1b044b1514 | [
"Apache-2.0"
] | null | null | null | 1-lxastro0/code_local/utils/verifications.py | remtav/SpaceNet7_Multi-Temporal_Solutions | ee535c61fc22bffa45331519239c6d1b044b1514 | [
"Apache-2.0"
] | null | null | null | from pathlib import Path
from typing import Union, List
import fiona
import rasterio
from rasterio.features import is_valid_geom
from tqdm import tqdm
from utils.create_dataset import MetaSegmentationDataset
from utils.geoutils import lst_ids, get_key_recursive
import logging
logger = logging.getLogger(__name__)
d... | 48.802632 | 121 | 0.675115 |
8915c68bb32c9109980b6db0ec9a0f5649768315 | 15,143 | py | Python | aries-test-harness/features/steps/0023-did-exchange.py | DRK3/aries-agent-test-harness | c64b86bf97d8d6cda0a3f64cff4d68135243a819 | [
"Apache-2.0"
] | null | null | null | aries-test-harness/features/steps/0023-did-exchange.py | DRK3/aries-agent-test-harness | c64b86bf97d8d6cda0a3f64cff4d68135243a819 | [
"Apache-2.0"
] | null | null | null | aries-test-harness/features/steps/0023-did-exchange.py | DRK3/aries-agent-test-harness | c64b86bf97d8d6cda0a3f64cff4d68135243a819 | [
"Apache-2.0"
] | null | null | null | # -----------------------------------------------------------
# Behave Step Definitions for the DID Exchange Protocol 0023
# used to establish connections between Aries Agents based on DIDs.
# 0023 DID Exchange RFC:
# https://github.com/hyperledger/aries-rfcs/blob/master/features/0023-did-exchange/README.md
#
# Current... | 44.801775 | 188 | 0.708314 |
513c44ab69a3daa598238f812bb65ab9249d33e5 | 1,030 | py | Python | example/old/utils.py | caoziyao/pywframe | 96a044134e9887453fa0ca499288ca87c03852d6 | [
"MIT"
] | 1 | 2019-05-20T07:36:17.000Z | 2019-05-20T07:36:17.000Z | example/old/utils.py | caoziyao/pywframe | 96a044134e9887453fa0ca499288ca87c03852d6 | [
"MIT"
] | null | null | null | example/old/utils.py | caoziyao/pywframe | 96a044134e9887453fa0ca499288ca87c03852d6 | [
"MIT"
] | 1 | 2019-05-20T09:02:30.000Z | 2019-05-20T09:02:30.000Z | # coding: utf-8
import datetime
import os
# Python 延迟初始化(lazy property)
# 延迟初始化主要用于提高性能,避免浪费计算,并减少程序的内存需求。
# 只在第一次调用时候被计算之后就把结果缓存起来了。这样的好处是在网络编程中,对HTTP协议的解析,
# 通常会把HTTP的header解析成python的一个字典,而在视图函数的时候,可能不知一次的访问这个header,
# 因此把这个header使用描述器缓存起来,可以减少多余的解析
class lazy_property(object):
"""
Descriptor implementing ... | 25.121951 | 85 | 0.638835 |
3361b11afd5ae2bf8a0e4bff72ef561767d9c286 | 12,324 | py | Python | bin/InstallDB.py | C-EO/craft | a52ead76ce400cc745876bd679eba6f62da70ee5 | [
"BSD-2-Clause"
] | 55 | 2016-11-20T17:08:19.000Z | 2022-03-11T22:19:43.000Z | bin/InstallDB.py | C-EO/craft | a52ead76ce400cc745876bd679eba6f62da70ee5 | [
"BSD-2-Clause"
] | 17 | 2017-09-20T07:52:17.000Z | 2021-12-03T10:03:00.000Z | bin/InstallDB.py | C-EO/craft | a52ead76ce400cc745876bd679eba6f62da70ee5 | [
"BSD-2-Clause"
] | 29 | 2016-12-10T15:00:11.000Z | 2021-12-02T12:54:05.000Z | import sqlite3
from CraftConfig import *
from CraftCore import CraftCore
from CraftOS.osutils import OsUtils
from CraftStandardDirs import CraftStandardDirs
class InstallPackage(object):
""" InstallPackage finalizes an installation.
If you call addInstalled or remInstalled an InstallPackage object is re... | 42.205479 | 126 | 0.62074 |
5f7ac4b35b6c4576e5fb0998d56eb21ec522b58a | 3,499 | py | Python | youtube_dl/extractor/tudou.py | builder07/ytdl | 2c0a5d50af7ecc7302c813d649ee72dcd457a50a | [
"Unlicense"
] | null | null | null | youtube_dl/extractor/tudou.py | builder07/ytdl | 2c0a5d50af7ecc7302c813d649ee72dcd457a50a | [
"Unlicense"
] | null | null | null | youtube_dl/extractor/tudou.py | builder07/ytdl | 2c0a5d50af7ecc7302c813d649ee72dcd457a50a | [
"Unlicense"
] | null | null | null | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_str
class TudouIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?tudou\.com/(?:listplay|programs(?:/view)?|albumplay)/([^/]+/)*(?P<id>[^/?#]+?)(?:\.html)?/?(?:$|[?#])'
_TESTS = [{
... | 36.831579 | 140 | 0.521292 |
fd75ca24f0246a6d6475d447402a274cec6ffbbe | 4,446 | py | Python | nexus/filter_plugins/nexus3_oss_filters.py | remijouannet/ansible-roles | be2153ddcac32a6965ec76144e07e9b366ae687a | [
"Unlicense"
] | 1 | 2019-11-25T13:08:53.000Z | 2019-11-25T13:08:53.000Z | nexus/filter_plugins/nexus3_oss_filters.py | remijouannet/ansible-roles | be2153ddcac32a6965ec76144e07e9b366ae687a | [
"Unlicense"
] | 1 | 2020-09-22T22:01:57.000Z | 2020-09-22T22:01:57.000Z | nexus/filter_plugins/nexus3_oss_filters.py | remijouannet/ansible-roles | be2153ddcac32a6965ec76144e07e9b366ae687a | [
"Unlicense"
] | null | null | null | from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from ansible.errors import AnsibleFilterError
import json
class FilterModule(object):
"""
nexus3-oss role filters
"""
def filters(self):
return {
'nexus_groovy_error': self.nexus_groovy_error,
... | 39 | 114 | 0.613585 |
c575ceebe188dd8eb8265285dd114d86195f207e | 20,316 | py | Python | node/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py | ssjlee93/infosys-kaggle-exercise | 41e1f87bb29aad052473bb7c747470ff90ae9d44 | [
"MIT"
] | null | null | null | node/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py | ssjlee93/infosys-kaggle-exercise | 41e1f87bb29aad052473bb7c747470ff90ae9d44 | [
"MIT"
] | null | null | null | node/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/MSVSVersion.py | ssjlee93/infosys-kaggle-exercise | 41e1f87bb29aad052473bb7c747470ff90ae9d44 | [
"MIT"
] | null | null | null | # Copyright (c) 2013 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Handle version information related to Visual Stuio."""
import errno
import os
import re
import subprocess
import sys
import glob
def JoinPath(*... | 35.332174 | 88 | 0.559854 |
241fed740ac9f0d96be484f5c54050033b728c8d | 2,925 | py | Python | version.py | Recongt/rpi_ws281x | 077c3fb9b783263ee4349477329304f9ddc70dfa | [
"BSD-2-Clause"
] | null | null | null | version.py | Recongt/rpi_ws281x | 077c3fb9b783263ee4349477329304f9ddc70dfa | [
"BSD-2-Clause"
] | null | null | null | version.py | Recongt/rpi_ws281x | 077c3fb9b783263ee4349477329304f9ddc70dfa | [
"BSD-2-Clause"
] | null | null | null | #
# SConstruct
#
# Copyright (c) 2016 Jeremy Garff <jer @ jers.net>
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification, are permitted
# provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright not... | 39.527027 | 99 | 0.668718 |
ec602bb348326b27aa388e440319fe91baa40de0 | 1,985 | py | Python | 01_hello/hello2.py | jonfrei60/tiny_python_projects | 1656ba473821eb2e624b707644f4c1bb2f9952a1 | [
"MIT"
] | null | null | null | 01_hello/hello2.py | jonfrei60/tiny_python_projects | 1656ba473821eb2e624b707644f4c1bb2f9952a1 | [
"MIT"
] | null | null | null | 01_hello/hello2.py | jonfrei60/tiny_python_projects | 1656ba473821eb2e624b707644f4c1bb2f9952a1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Author : Jon Freivald <jonfrei@gmail.com>
Date : 2021-04-08
Purpose: Beat the Bush
"""
import argparse
import os
import sys
# --------------------------------------------------
def get_args():
"""Get command-line arguments"""
parser = argparse.ArgumentParser(
description... | 26.466667 | 70 | 0.440806 |
073b3a79290fff3b9ccb7bca5bfea604ee2fdb9b | 15,410 | py | Python | alibi/utils/tests/test_distributed.py | SeldonIO/alibi | a94b6e3cf6f47aaca560f6d4841e91a62439fa3b | [
"ECL-2.0",
"Apache-2.0"
] | 1,570 | 2019-05-03T06:43:03.000Z | 2022-03-31T02:49:34.000Z | alibi/utils/tests/test_distributed.py | vishalbelsare/alibi | 0556974a28a7ef96ceaa941d419b749f2f82fedb | [
"ECL-2.0",
"Apache-2.0"
] | 511 | 2019-05-02T16:36:15.000Z | 2022-03-31T08:09:43.000Z | alibi/utils/tests/test_distributed.py | vishalbelsare/alibi | 0556974a28a7ef96ceaa941d419b749f2f82fedb | [
"ECL-2.0",
"Apache-2.0"
] | 190 | 2019-05-02T13:41:38.000Z | 2022-03-14T21:18:56.000Z | import inspect
import os
import pytest
import time
import numpy as np
from alibi.utils.distributed import DistributedExplainer, PoolCollection, ResourceError, invert_permutation, \
concatenate_minibatches
from itertools import product
from typing import Any, Dict, List, Optional, Tuple, Union
class MockExplaine... | 38.049383 | 118 | 0.695328 |
b26b1a493628d64f1918d9d2a5f54acebb46ae69 | 1,161 | py | Python | lint/static_analysis.py | hyroai/lint | ea5f18e4bd88c2c88f36a9856fa7f9d36838a7e6 | [
"MIT"
] | 1 | 2021-03-21T03:45:00.000Z | 2021-03-21T03:45:00.000Z | lint/static_analysis.py | hyroai/lint | ea5f18e4bd88c2c88f36a9856fa7f9d36838a7e6 | [
"MIT"
] | 3 | 2020-07-15T16:16:37.000Z | 2022-01-27T01:06:20.000Z | lint/static_analysis.py | hyroai/lint | ea5f18e4bd88c2c88f36a9856fa7f9d36838a7e6 | [
"MIT"
] | null | null | null | import argparse
import ast
from typing import Optional, Sequence, Tuple
import gamla
from lint import comment, dead_code, redundant_lambda
_file_contents_to_messages = gamla.compose_left(
gamla.log_text("{}"),
open,
lambda f: f.read(),
gamla.juxtcat(
gamla.compose_left(
ast.parse,... | 24.702128 | 73 | 0.648579 |
7078a59ac9a356d2de5e027d29c14d8320f555b5 | 499 | py | Python | main.py | brendanfitz/python-tkinter-budget-transaction-processor | 972b171c998aee7b01a61173704b2711c02d2806 | [
"MIT"
] | null | null | null | main.py | brendanfitz/python-tkinter-budget-transaction-processor | 972b171c998aee7b01a61173704b2711c02d2806 | [
"MIT"
] | 1 | 2020-09-11T21:37:58.000Z | 2020-09-12T01:50:42.000Z | main.py | brendanfitz/python-tkinter-budget-transaction-processor | 972b171c998aee7b01a61173704b2711c02d2806 | [
"MIT"
] | null | null | null | import argparse
from budget_transaction_processor import App
from windows import set_dpi_awareness
def main(args):
set_dpi_awareness()
app = App(args.test)
app.mainloop()
def parse_args():
parser = argparse.ArgumentParser()
parser.add_argument(
'-t', '--test',
help="test by running... | 22.681818 | 59 | 0.661323 |
46b2fac2d9c6ecc67e12f6efcbc6ca8f880072a4 | 209 | py | Python | meaningful_agent_training/evaluate_random_agent.py | moriartyjm/netzerotc | 72abcc20d8ed01e6314316848504aba2ba14ad0e | [
"MIT"
] | 10 | 2021-09-17T14:54:26.000Z | 2022-02-08T02:08:46.000Z | meaningful_agent_training/evaluate_random_agent.py | rangl-labs/netzerotc | 72abcc20d8ed01e6314316848504aba2ba14ad0e | [
"MIT"
] | 72 | 2021-07-05T12:31:46.000Z | 2022-03-06T17:06:28.000Z | meaningful_agent_training/evaluate_random_agent.py | moriartyjm/netzerotc | 72abcc20d8ed01e6314316848504aba2ba14ad0e | [
"MIT"
] | 3 | 2021-12-21T23:35:23.000Z | 2022-02-08T02:08:49.000Z | #!/usr/bin/env python
import gym
from util import Evaluate
env = gym.make("rangl:nztc-open-loop-v0")
evaluate = Evaluate(env)
mean_reward = evaluate.random_agent(seeds=[123456])
print(f"{mean_reward=}")
| 14.928571 | 51 | 0.732057 |
2856dbba1dd94bdefcedab764a0ba47177dc8edb | 1,988 | py | Python | Sample/db.py | ayushkumar-25/Login | 9145174ad53ab5793b585c1bb326cdc54a9d31b8 | [
"MIT"
] | null | null | null | Sample/db.py | ayushkumar-25/Login | 9145174ad53ab5793b585c1bb326cdc54a9d31b8 | [
"MIT"
] | 1 | 2021-05-06T11:21:01.000Z | 2021-05-06T11:21:01.000Z | Sample/db.py | ayushkumar-25/Login | 9145174ad53ab5793b585c1bb326cdc54a9d31b8 | [
"MIT"
] | 1 | 2022-02-22T06:31:03.000Z | 2022-02-22T06:31:03.000Z | import sys
from PyQt5 import QtWidgets, QtGui
from PyQt5.QtWidgets import QDialog, QApplication
from PyQt5.uic import loadUi
import pyrebase
firebaseConfig = {'apiKey': "AIzaSyD-UKONeVgyG4wmi7Rym-lZYIn9CDpLI3Y",
'authDomain': "fir-auth-ddfd6.firebaseapp.com",
'databaseURL': "https:/... | 37.509434 | 92 | 0.586519 |
c586461f949dd618161a5f281486380ca9857f93 | 250 | py | Python | bin/metrics.py | why2011btv/FB15K237code | 3778fcd8b425e8f44f4f8bf44562110d25ee32f7 | [
"Apache-2.0"
] | 1 | 2020-11-26T06:56:52.000Z | 2020-11-26T06:56:52.000Z | bin/metrics.py | why2011btv/FB15K237 | 3778fcd8b425e8f44f4f8bf44562110d25ee32f7 | [
"Apache-2.0"
] | null | null | null | bin/metrics.py | why2011btv/FB15K237 | 3778fcd8b425e8f44f4f8bf44562110d25ee32f7 | [
"Apache-2.0"
] | null | null | null | def _cal_loss(self, lstm_outputs):
batch_size = self.options['batch_size']
unroll_steps = self.options['unroll_steps']
n_tokens_vocab = self.options['n_tokens_vocab']
softmax_dim = self.options['lstm']['projection_dim'] # 512
| 35.714286 | 65 | 0.704 |
b314cf7fbdf484f64e0a88e744aab938f6b92063 | 85,529 | py | Python | vip_hci/preproc/recentering.py | carlgogo/vip_exoplanets | 52bd0d7b1503a2b317b1187c429b8fe7fca545b6 | [
"MIT"
] | 1 | 2015-07-23T11:43:59.000Z | 2015-07-23T11:43:59.000Z | vip_hci/preproc/recentering.py | carlgogo/vip_exoplanets | 52bd0d7b1503a2b317b1187c429b8fe7fca545b6 | [
"MIT"
] | null | null | null | vip_hci/preproc/recentering.py | carlgogo/vip_exoplanets | 52bd0d7b1503a2b317b1187c429b8fe7fca545b6 | [
"MIT"
] | null | null | null | #! /usr/bin/env python
"""
Module containing functions for cubes frame registration.
"""
__author__ = 'C. A. Gomez Gonzalez, V. Christiaens, G. Ruane, R. Farkas'
__all__ = ['frame_shift',
'cube_shift',
'frame_center_radon',
'frame_center_satspots',
'cube_recenter_satspots',... | 42.8502 | 97 | 0.575536 |
b139d7e8f474a0a65fe03ce71690307ec7c58911 | 664 | py | Python | 406.py | wilbertgeng/LeetCode_exercise | f00c08e0d28ffa88d61d4262c6d1f49f1fa91ebc | [
"MIT"
] | null | null | null | 406.py | wilbertgeng/LeetCode_exercise | f00c08e0d28ffa88d61d4262c6d1f49f1fa91ebc | [
"MIT"
] | null | null | null | 406.py | wilbertgeng/LeetCode_exercise | f00c08e0d28ffa88d61d4262c6d1f49f1fa91ebc | [
"MIT"
] | null | null | null | """406. Queue Reconstruction by Height"""
class Solution(object):
def reconstructQueue(self, people):
"""
:type people: List[List[int]]
:rtype: List[List[int]]
"""
## R2:
people.sort(key = lambda x: (-x[0], x[1]))
res = []
for p in people:
... | 24.592593 | 80 | 0.487952 |
445dc3980aa354b71e369253ccf22a133e197891 | 2,542 | py | Python | src/nidcpower/examples/nidcpower_measure_record.py | imranadamjee/nimi-python | 1931d17326e13556c46b1cdeb58b7bd36c57b1f3 | [
"MIT"
] | null | null | null | src/nidcpower/examples/nidcpower_measure_record.py | imranadamjee/nimi-python | 1931d17326e13556c46b1cdeb58b7bd36c57b1f3 | [
"MIT"
] | null | null | null | src/nidcpower/examples/nidcpower_measure_record.py | imranadamjee/nimi-python | 1931d17326e13556c46b1cdeb58b7bd36c57b1f3 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import argparse
import nidcpower
import sys
def example(resource_name, options, voltage, length):
with nidcpower.Session(resource_name=resource_name, options=options) as session:
# Configure the session.
session.measure_record_length = length
session.measure_record_leng... | 41 | 203 | 0.671125 |
44a33fbd896fce343a082a902c1d296f5d61e7af | 7,192 | py | Python | security/snyk-aggregate-results/snyk-aggregate-results.py | shreni123/csm | 06fd93d46ab9c17e66df9c1dfcbc48e7dc3d3e52 | [
"MIT"
] | 4 | 2021-11-11T00:18:40.000Z | 2022-01-26T21:07:08.000Z | security/snyk-aggregate-results/snyk-aggregate-results.py | shreni123/csm | 06fd93d46ab9c17e66df9c1dfcbc48e7dc3d3e52 | [
"MIT"
] | 28 | 2021-11-15T21:04:27.000Z | 2022-03-25T17:12:27.000Z | security/snyk-aggregate-results/snyk-aggregate-results.py | shreni123/csm | 06fd93d46ab9c17e66df9c1dfcbc48e7dc3d3e52 | [
"MIT"
] | 6 | 2022-01-11T11:07:23.000Z | 2022-03-30T13:56:17.000Z | #
# MIT License
#
# (C) Copyright 2022 Hewlett Packard Enterprise Development LP
#
# 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 righ... | 38.05291 | 106 | 0.627086 |
e5894327d85d0aa1f86da2d2c80d45f073a0b378 | 1,128 | py | Python | server/myapp/Connect.py | clementfoltran/projectHone | 057d882480a024e393bf410e6fecaf9ca71889e7 | [
"MIT"
] | 2 | 2018-04-09T22:05:41.000Z | 2018-04-10T15:05:41.000Z | server/myapp/Connect.py | owalid/projectHone | 55ae61eb3e0ca935ebf6dd9dccd3cc915e5a0c17 | [
"MIT"
] | 27 | 2018-02-27T15:37:44.000Z | 2018-03-29T06:32:45.000Z | server/myapp/Connect.py | owalid/projectHone | 55ae61eb3e0ca935ebf6dd9dccd3cc915e5a0c17 | [
"MIT"
] | 4 | 2018-02-22T15:04:48.000Z | 2018-04-11T21:05:54.000Z | import tweepy
class Connect:
consumer_key = ""
consumer_secret = ""
access_token = ""
access_token_secret = ""
auth = ""
api = ""
def __init__(self):
with open('Credentials.txt') as c:
for line in c:
if line.startswith("CONSUMER_KEY"):
... | 36.387097 | 80 | 0.531028 |
f9b76069da08ddb08496764454eb97eb50f732d5 | 3,495 | py | Python | Python Code/usefulFns.py | MaunsellLab/MTCAN | de7ca5e489b664a626aad1e9821f589de31c8d64 | [
"MIT"
] | null | null | null | Python Code/usefulFns.py | MaunsellLab/MTCAN | de7ca5e489b664a626aad1e9821f589de31c8d64 | [
"MIT"
] | null | null | null | Python Code/usefulFns.py | MaunsellLab/MTCAN | de7ca5e489b664a626aad1e9821f589de31c8d64 | [
"MIT"
] | null | null | null | import scipy.io as sp
import numpy as np
import matplotlib.pyplot as plt
import math
import os
from collections import defaultdict
def loadMatFile(fileName):
'''
Loads the given matfile and assigns variables to access trial data
Inputs: matfile name, (str)
Outputs: variables, (nd.array)
'''
... | 31.772727 | 128 | 0.62289 |
db14b4b5c48fe17ec5696376cbce98849e1ff097 | 8,391 | py | Python | agol_slicer.py | jessyd72/AGO-slicer | 0a606d21507b73b684271444bd2f408ccfe016fb | [
"MIT"
] | null | null | null | agol_slicer.py | jessyd72/AGO-slicer | 0a606d21507b73b684271444bd2f408ccfe016fb | [
"MIT"
] | null | null | null | agol_slicer.py | jessyd72/AGO-slicer | 0a606d21507b73b684271444bd2f408ccfe016fb | [
"MIT"
] | null | null | null | import arcgis
from arcgis.gis import GIS, User
import json
import tkinter as tk
import xlsxwriter
from xlsxwriter import Workbook
def createWorkbook(output_dir, un):
''' Creates Excel workbook with sheet of
AGOL content for a user. Intended to be used
to create a slicer.'''
workbook = Wor... | 30.849265 | 117 | 0.547015 |
71c36c3b6a3943feec5db2acb98c1810e25051e0 | 1,403 | py | Python | azure-iot-hub/azure/iot/hub/protocol/models/twin_properties_py3.py | olivakar/azure-iot-sdk-python | d8f2403030cf94510d381d8d5ac37af6e8d306f8 | [
"MIT"
] | 1 | 2019-02-06T06:52:44.000Z | 2019-02-06T06:52:44.000Z | azure-iot-hub/azure/iot/hub/protocol/models/twin_properties_py3.py | olivakar/azure-iot-sdk-python | d8f2403030cf94510d381d8d5ac37af6e8d306f8 | [
"MIT"
] | null | null | null | azure-iot-hub/azure/iot/hub/protocol/models/twin_properties_py3.py | olivakar/azure-iot-sdk-python | d8f2403030cf94510d381d8d5ac37af6e8d306f8 | [
"MIT"
] | 1 | 2019-12-17T17:50:43.000Z | 2019-12-17T17:50:43.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may cause incorrect behavior and will be lost if the code is
# regenerated.
# --------------------------------------------------------------------------
from ... | 38.972222 | 79 | 0.617249 |
055f82ce40150853186bc4086441d503304870d9 | 834 | py | Python | sortpapers.py | sampsyo/wax2016 | 59da1dcf081dc50bbe2584589fe40b1e78559f41 | [
"MIT"
] | null | null | null | sortpapers.py | sampsyo/wax2016 | 59da1dcf081dc50bbe2584589fe40b1e78559f41 | [
"MIT"
] | null | null | null | sortpapers.py | sampsyo/wax2016 | 59da1dcf081dc50bbe2584589fe40b1e78559f41 | [
"MIT"
] | null | null | null | import sys
import re
ITEM_RE = r'\* .*\n(?: .*\n|\s*\n)*'
def author(bullet):
"""Given a Markdown bullet, return the last name of the first author.
"""
authors = bullet.split('\n')[1]
authors, _ = authors.split('(', 1)
names = [n.strip() for n in re.split(', and |, | and ', authors)]
return... | 23.166667 | 73 | 0.600719 |
71ec1a679d506914b26870f0d461e6e300fe0c2c | 273 | py | Python | Example/images.py | goodop/api-imjustgood.com | 6406b531c4393fa8a4ace3c206d23895da915caf | [
"MIT"
] | 4 | 2021-01-01T10:20:13.000Z | 2021-11-08T09:32:54.000Z | Example/images.py | goodop/api-imjustgood.com | 6406b531c4393fa8a4ace3c206d23895da915caf | [
"MIT"
] | null | null | null | Example/images.py | goodop/api-imjustgood.com | 6406b531c4393fa8a4ace3c206d23895da915caf | [
"MIT"
] | 25 | 2021-01-09T18:22:32.000Z | 2021-05-29T07:42:06.000Z | from justgood import imjustgood
import random
media = imjustgood("YOUR_APIKEY_HERE")
query = "teacher" # example query
data = media.image(query)
# Get attributes
list_image = data["result"]
result = random.choice(list_image)
print(result)
# Get JSON results
print(data)
| 18.2 | 38 | 0.765568 |
da84a584f797f5b4b571ca54ce8e0c2079154d44 | 12,723 | py | Python | qa/rpc-tests/test_framework/bumessages.py | lycion/TripOne | c6ae7d9163ef4095fe0e143d26f3311182551147 | [
"MIT"
] | 2 | 2019-09-22T21:06:32.000Z | 2019-09-22T21:06:34.000Z | qa/rpc-tests/test_framework/bumessages.py | lycion/TripOne | c6ae7d9163ef4095fe0e143d26f3311182551147 | [
"MIT"
] | null | null | null | qa/rpc-tests/test_framework/bumessages.py | lycion/TripOne | c6ae7d9163ef4095fe0e143d26f3311182551147 | [
"MIT"
] | null | null | null | from .nodemessages import *
class msg_buversion(object):
command = b"buversion"
def __init__(self, addrFromPort=None):
self.addrFromPort = addrFromPort
pass
def deserialize(self, f):
self.addrFromPort = struct.unpack("<H", f.read(2))[0]
return self
def serialize(self... | 28.72009 | 162 | 0.612434 |
4fff6085a374f02b5113b8439ff2ab4081156c0e | 26,009 | py | Python | cloudpathlib/cloudpath.py | genziano/cloudpathlib | a19902ecc2afc03ede3a59e1b5e62a51b6ca1cf6 | [
"MIT"
] | null | null | null | cloudpathlib/cloudpath.py | genziano/cloudpathlib | a19902ecc2afc03ede3a59e1b5e62a51b6ca1cf6 | [
"MIT"
] | null | null | null | cloudpathlib/cloudpath.py | genziano/cloudpathlib | a19902ecc2afc03ede3a59e1b5e62a51b6ca1cf6 | [
"MIT"
] | null | null | null | import abc
from collections import defaultdict
import collections.abc
import fnmatch
import os
from pathlib import Path, PosixPath, PurePosixPath, WindowsPath
from typing import Any, IO, Iterable, Optional, TYPE_CHECKING, Union
from urllib.parse import urlparse
from warnings import warn
if TYPE_CHECKING:
from .cl... | 35.874483 | 111 | 0.615902 |
3669ca3a303c7beb141e78b67b4295b47ab2bf43 | 2,549 | py | Python | Codebase/.Solutions/Asmdef Generate.py | z3nth10n/unity-themes | 8da3f279c5549742a6e55c3e7d176cc6ef68a029 | [
"MIT"
] | 13 | 2018-11-12T14:36:28.000Z | 2020-07-22T13:05:17.000Z | Codebase/.Solutions/Asmdef Generate.py | z3nth10n/unity-themes | 8da3f279c5549742a6e55c3e7d176cc6ef68a029 | [
"MIT"
] | null | null | null | Codebase/.Solutions/Asmdef Generate.py | z3nth10n/unity-themes | 8da3f279c5549742a6e55c3e7d176cc6ef68a029 | [
"MIT"
] | 3 | 2019-04-15T13:14:25.000Z | 2022-01-06T23:07:02.000Z | import os
class AsmData:
def __init__(self):
self.path = ""
self.scope = ""
self.references = []
class AsmGenerate:
def __init__(self):
self.start = os.getcwd() + "\\..\\"
self.template = open("Asmdef Template.txt","r").read()
self.data = {}
self.duplicates = []
self.active = None
self.Scan(self.sta... | 37.485294 | 120 | 0.615143 |
dfc5ef5c76399aa536faab0173166d436f119c0b | 3,987 | py | Python | hfsfolder-ironpython/util/VisitFoldersUtil.py | riquefsouza/hfsfolder | 45a42c2599f48d3d784ee8d91e5323da7a4fea83 | [
"MIT"
] | null | null | null | hfsfolder-ironpython/util/VisitFoldersUtil.py | riquefsouza/hfsfolder | 45a42c2599f48d3d784ee8d91e5323da7a4fea83 | [
"MIT"
] | null | null | null | hfsfolder-ironpython/util/VisitFoldersUtil.py | riquefsouza/hfsfolder | 45a42c2599f48d3d784ee8d91e5323da7a4fea83 | [
"MIT"
] | null | null | null | #
# * Created by SharpDevelop.
# * User: henrique.souza
# * Date: 08/04/2019
# * Time: 14:09
# *
# * To change this template use Tools | Options | Coding | Edit Standard Headers.
#
from System import *
from System.IO import *
from System.Collections.Generic import *
from hfsfolder.model import *
class ... | 30.906977 | 82 | 0.694758 |
93f3d5f674ed8971367fce2b85ff818a7b886751 | 2,179 | py | Python | utils/cn/lichengwu/utils/utils/lang/RemoteRun.py | lichengwu/python_tools | 3ebf70e6a6f6689ce2b615bed1500b8817f0b82a | [
"Apache-2.0"
] | null | null | null | utils/cn/lichengwu/utils/utils/lang/RemoteRun.py | lichengwu/python_tools | 3ebf70e6a6f6689ce2b615bed1500b8817f0b82a | [
"Apache-2.0"
] | null | null | null | utils/cn/lichengwu/utils/utils/lang/RemoteRun.py | lichengwu/python_tools | 3ebf70e6a6f6689ce2b615bed1500b8817f0b82a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#encoding=utf8
__author__ = 'lichengwu'
import pexpect
import sys
import getopt
def run_command(ip, user, password, cmd, tmo=600):
'''
执行远程命令
@ip 命令所在的主机ip
@user 执行命令的用户
@password 用户密码
@cmd 命令
@tmo 命令执行潮湿时间
'''
patterns = [user, '.*[... | 24.483146 | 97 | 0.467187 |
f918995a8beb268ab35a06b93c6985914c77d444 | 1,401 | py | Python | tests/agents/test_td3.py | laszukdawid/ai-traineree | af32940eba8e11012de87b60d78f10f5a3b96c79 | [
"Apache-2.0"
] | 22 | 2020-08-21T03:03:05.000Z | 2022-02-22T10:15:36.000Z | tests/agents/test_td3.py | laszukdawid/ai-traineree | af32940eba8e11012de87b60d78f10f5a3b96c79 | [
"Apache-2.0"
] | 23 | 2021-02-13T20:35:45.000Z | 2022-02-06T20:15:37.000Z | tests/agents/test_td3.py | laszukdawid/ai-traineree | af32940eba8e11012de87b60d78f10f5a3b96c79 | [
"Apache-2.0"
] | 6 | 2020-10-11T08:36:09.000Z | 2021-11-20T18:31:03.000Z | import copy
import pytest
from ai_traineree.agents.td3 import TD3Agent
from conftest import deterministic_interactions
def test_td3_seed(float_1d_space):
# Assign
agent_0 = TD3Agent(float_1d_space, float_1d_space, device='cpu')
agent_1 = TD3Agent(float_1d_space, float_1d_space, device='cpu')
agent_2 ... | 37.864865 | 96 | 0.718059 |
f268a72d5690a8e96331647bdfa25994fdf51f1b | 10,032 | py | Python | src/face_recognition/youtube_dl/extractor/niconico.py | alxgrh/CATANA | 417ffce26db0c2ee9d399399b16c276d5336174d | [
"MIT"
] | 12 | 2017-11-01T12:35:47.000Z | 2020-02-26T19:41:30.000Z | src/face_recognition/youtube_dl/extractor/niconico.py | christiannkoch/CATANA | 417ffce26db0c2ee9d399399b16c276d5336174d | [
"MIT"
] | 8 | 2017-12-05T23:45:54.000Z | 2022-02-09T23:28:51.000Z | src/face_recognition/youtube_dl/extractor/niconico.py | lodemo/CATANA | a349f460772511ccbb16429b40bfb50f774d45d4 | [
"MIT"
] | 6 | 2017-09-09T12:22:53.000Z | 2019-12-17T07:54:18.000Z | # coding: utf-8
from __future__ import unicode_literals
import re
import json
import datetime
from .common import InfoExtractor
from ..compat import (
compat_urlparse,
)
from ..utils import (
ExtractorError,
int_or_none,
parse_duration,
parse_iso8601,
sanitized_Request,
xpath_text,
det... | 36.882353 | 107 | 0.559011 |
58a2c96a438c1354008e1e4620e8edfd31ab3045 | 60,463 | py | Python | am_driver_safe/src/AEKF5_last.py | boffomarco/hrp | 7017d358b8b53c289d0859f7dc61ca0d134843ed | [
"MIT"
] | null | null | null | am_driver_safe/src/AEKF5_last.py | boffomarco/hrp | 7017d358b8b53c289d0859f7dc61ca0d134843ed | [
"MIT"
] | null | null | null | am_driver_safe/src/AEKF5_last.py | boffomarco/hrp | 7017d358b8b53c289d0859f7dc61ca0d134843ed | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# From https://github.com/AtsushiSakai/PythonRobotics/blob/master/Localization/extended_kalman_filter/extended_kalman_filter.py
import math
from math import sin, cos, pi
import matplotlib.pyplot as plt
from matplotlib import colors
import matplotlib as mpl
import seaborn as sns
import rospy... | 40.254993 | 236 | 0.559615 |
e5a3269c43dccf1b56c709a4a26b0eb97f0d71fa | 16,571 | py | Python | mailchimp_marketing_asyncio/models/ab_testing_options.py | john-parton/mailchimp-asyncio | 3865ca0867bec8f537dc1e3256aa3a160c00f8a2 | [
"Apache-2.0"
] | null | null | null | mailchimp_marketing_asyncio/models/ab_testing_options.py | john-parton/mailchimp-asyncio | 3865ca0867bec8f537dc1e3256aa3a160c00f8a2 | [
"Apache-2.0"
] | null | null | null | mailchimp_marketing_asyncio/models/ab_testing_options.py | john-parton/mailchimp-asyncio | 3865ca0867bec8f537dc1e3256aa3a160c00f8a2 | [
"Apache-2.0"
] | 1 | 2022-03-09T14:52:22.000Z | 2022-03-09T14:52:22.000Z | # coding: utf-8
"""
Mailchimp Marketing API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 3.0.74
Contact: apihelp@mailchimp.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import... | 32.878968 | 289 | 0.613059 |
3ee271fb53e111bb7592e8ce743b9de5f7038220 | 15,436 | py | Python | python/IECoreHoudini/ParmTemplates.py | ericmehl/cortex | 054839cc709ce153d1bcaaefe7f340ebe641ec82 | [
"BSD-3-Clause"
] | 386 | 2015-01-02T11:10:43.000Z | 2022-03-10T15:12:20.000Z | python/IECoreHoudini/ParmTemplates.py | ericmehl/cortex | 054839cc709ce153d1bcaaefe7f340ebe641ec82 | [
"BSD-3-Clause"
] | 484 | 2015-01-09T18:28:06.000Z | 2022-03-31T16:02:04.000Z | python/IECoreHoudini/ParmTemplates.py | ericmehl/cortex | 054839cc709ce153d1bcaaefe7f340ebe641ec82 | [
"BSD-3-Clause"
] | 99 | 2015-01-28T23:18:04.000Z | 2022-03-27T00:59:39.000Z | ##########################################################################
#
# Copyright 2010 Dr D Studios Pty Limited (ACN 127 184 954) (Dr. D Studios),
# its affiliates and/or its licensors.
#
# Copyright (c) 2011-2013, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary ... | 34.68764 | 107 | 0.716831 |
595768403a0277a0d740cd5bbb3979eb3c626b06 | 249 | py | Python | Week4/19. PCA.py | HawkingLaugh/Data-Processing-Using-Python | 6c4d7e09317aee41684731d5611f2f0dab217b2b | [
"MIT"
] | null | null | null | Week4/19. PCA.py | HawkingLaugh/Data-Processing-Using-Python | 6c4d7e09317aee41684731d5611f2f0dab217b2b | [
"MIT"
] | null | null | null | Week4/19. PCA.py | HawkingLaugh/Data-Processing-Using-Python | 6c4d7e09317aee41684731d5611f2f0dab217b2b | [
"MIT"
] | null | null | null | from sklearn.decomposition import PCA
from sklearn import datasets
from sklearn import preprocessing
boston = datasets.load_boston()
X = preprocessing.scale(boston.data)
pca = PCA(n_components='mle')
pca.fit(X)
print(pca.explained_variance_ratio_) | 24.9 | 37 | 0.815261 |
fc6d8a2e679d8ccc2db5657ee0b8a7774bae7fde | 4,400 | py | Python | nova/servicegroup/drivers/db.py | bopopescu/nova-22 | e94e289c663b37df2a12dafc9ceaecf8d04432a8 | [
"Apache-2.0"
] | 7 | 2017-06-19T19:37:00.000Z | 2019-06-16T02:06:14.000Z | nova/servicegroup/drivers/db.py | bopopescu/nova-22 | e94e289c663b37df2a12dafc9ceaecf8d04432a8 | [
"Apache-2.0"
] | null | null | null | nova/servicegroup/drivers/db.py | bopopescu/nova-22 | e94e289c663b37df2a12dafc9ceaecf8d04432a8 | [
"Apache-2.0"
] | 6 | 2015-06-20T16:07:28.000Z | 2020-08-19T14:57:59.000Z | # Copyright 2012 IBM Corp.
#
# 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, sof... | 41.121495 | 79 | 0.652727 |
82ef9f85e58efaa2f5f3121aa39b4e3489184ef4 | 3,383 | py | Python | python/Day9.py | Simik31/AOC-2021 | fc0459cf4f3af8439657969b4e957a35e5d56484 | [
"WTFPL"
] | null | null | null | python/Day9.py | Simik31/AOC-2021 | fc0459cf4f3af8439657969b4e957a35e5d56484 | [
"WTFPL"
] | null | null | null | python/Day9.py | Simik31/AOC-2021 | fc0459cf4f3af8439657969b4e957a35e5d56484 | [
"WTFPL"
] | null | null | null | def part_1() -> None:
height_map: list[list[int]] = []
lowest_truths: list[list[bool]] = []
with open("../data/day9.txt") as dFile:
for row in dFile.readlines():
if (row := row.strip()) != "":
height_map.append([])
lowest_truths.append([])
... | 30.754545 | 73 | 0.514632 |
2c16450cc630ea92f0f2be4d13269ee51ce09ed1 | 651,288 | py | Python | torch/testing/_internal/common_methods_invocations.py | EthanLiu1991/pytorch | b10929a14a32c90ac5943cc3f27a3a9105e6f53f | [
"Intel"
] | null | null | null | torch/testing/_internal/common_methods_invocations.py | EthanLiu1991/pytorch | b10929a14a32c90ac5943cc3f27a3a9105e6f53f | [
"Intel"
] | null | null | null | torch/testing/_internal/common_methods_invocations.py | EthanLiu1991/pytorch | b10929a14a32c90ac5943cc3f27a3a9105e6f53f | [
"Intel"
] | null | null | null | from functools import wraps, partial
from itertools import product, chain
import itertools
import collections
import copy
from enum import Enum
import operator
import random
import unittest
import math
import torch
import numpy as np
from torch._six import inf
import collections.abc
from typing import Any, Callable, ... | 46.694006 | 159 | 0.601883 |
9d482e2a4325e91ea734f10081c5ec6124f1398b | 7,827 | py | Python | pitchfork/pitchfork.py | nfplatzke/pitchfork | 1af8d602a2838ae8639f60675f26db650dd10009 | [
"MIT"
] | null | null | null | pitchfork/pitchfork.py | nfplatzke/pitchfork | 1af8d602a2838ae8639f60675f26db650dd10009 | [
"MIT"
] | null | null | null | pitchfork/pitchfork.py | nfplatzke/pitchfork | 1af8d602a2838ae8639f60675f26db650dd10009 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
An unofficial API for pitchfork.com reviews.
author: Michal Czaplinski
email: mmczaplinski@gmail.com
"""
import json
import re
import difflib
import sys
from bs4 import BeautifulSoup
if sys.version_info >= (3, 0):
from urllib.parse import urljoin
from urllib.request import urlopen... | 33.883117 | 114 | 0.606746 |
b6f1d3d87385496fbdbc3cfdcd53f32fdf7349d3 | 5,126 | py | Python | tests/parse/test_frequency.py | gmc-norr/scout | ea8eaaa079c63e4033af6216ec08da4a314f9b5c | [
"BSD-3-Clause"
] | null | null | null | tests/parse/test_frequency.py | gmc-norr/scout | ea8eaaa079c63e4033af6216ec08da4a314f9b5c | [
"BSD-3-Clause"
] | null | null | null | tests/parse/test_frequency.py | gmc-norr/scout | ea8eaaa079c63e4033af6216ec08da4a314f9b5c | [
"BSD-3-Clause"
] | null | null | null | from scout.parse.variant.frequency import (
parse_frequency,
parse_frequencies,
parse_sv_frequencies,
)
def test_parse_frequency(cyvcf2_variant):
# GIVEN a variant dict with a frequency in info_dict
variant = cyvcf2_variant
variant.INFO["1000G"] = 0.01
# WHEN frequency is parsed
freq... | 31.447853 | 87 | 0.730589 |
db3e0f4f2baffac8351560aad12c44d43efce7b3 | 54,509 | py | Python | app/nn/NNDialogue.py | hailiang-wang/aclweb-I17-1074 | 93066d11e959afbd6800a72a0c02c8f700444de3 | [
"Apache-2.0"
] | null | null | null | app/nn/NNDialogue.py | hailiang-wang/aclweb-I17-1074 | 93066d11e959afbd6800a72a0c02c8f700444de3 | [
"Apache-2.0"
] | null | null | null | app/nn/NNDialogue.py | hailiang-wang/aclweb-I17-1074 | 93066d11e959afbd6800a72a0c02c8f700444de3 | [
"Apache-2.0"
] | null | null | null | ######################################################################
######################################################################
# Copyright Tsung-Hsien Wen, Cambridge Dialogue Systems Group, 2017 #
######################################################################
####################################... | 44.937345 | 95 | 0.499294 |
7bae610d3a67ee23a61776ca1e9c536c50e6647b | 3,600 | py | Python | singlecellmultiomics/alleleTools/heterozygousSNPedit.py | zztin/SingleCellMultiOmics | d3035c33eb1375f0703cc49537417b755ad8a693 | [
"MIT"
] | 17 | 2019-05-21T09:12:16.000Z | 2022-02-14T19:26:58.000Z | singlecellmultiomics/alleleTools/heterozygousSNPedit.py | zztin/SingleCellMultiOmics | d3035c33eb1375f0703cc49537417b755ad8a693 | [
"MIT"
] | 70 | 2019-05-20T08:08:45.000Z | 2021-06-22T15:58:01.000Z | singlecellmultiomics/alleleTools/heterozygousSNPedit.py | zztin/SingleCellMultiOmics | d3035c33eb1375f0703cc49537417b755ad8a693 | [
"MIT"
] | 7 | 2020-04-09T15:11:12.000Z | 2022-02-14T15:23:31.000Z | #!/usr/bin/env python3
import pysam
from collections import Counter
import argparse
if __name__ == '__main__':
argparser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
description="""Alter heterozygous SNPs in the reference vcf to the SNPs present in your data. ... | 52.173913 | 167 | 0.655833 |
8719e56119ee375269e508ece0e0998110444f3e | 920 | py | Python | eqpy/nums.py | eriknw/eqpy | e7b898194cdd5b27d614ba49ff90e8c15a8e6a26 | [
"BSD-3-Clause"
] | 5 | 2015-02-01T21:42:36.000Z | 2017-03-06T15:58:50.000Z | eqpy/nums.py | eriknw/eqpy | e7b898194cdd5b27d614ba49ff90e8c15a8e6a26 | [
"BSD-3-Clause"
] | null | null | null | eqpy/nums.py | eriknw/eqpy | e7b898194cdd5b27d614ba49ff90e8c15a8e6a26 | [
"BSD-3-Clause"
] | 3 | 2015-04-10T18:07:55.000Z | 2021-02-19T21:31:22.000Z | import sys
import types
import sympy
from eqpy._utils import isdunder
constants = ['Catalan', 'E', 'EulerGamma', 'GoldenRatio', 'I', 'nan',
'oo', 'pi', 'zoo']
class NumsModule(types.ModuleType):
__call__ = staticmethod(sympy.sympify)
def __init__(self, self_module):
super(NumsModule, s... | 28.75 | 75 | 0.634783 |
0b9abd7ccc56599b9dddc1a2ffff186c84c93fd8 | 614 | py | Python | editing-ui/src/py/controller/home.py | phaus/LibreBlogging | c4420f42385b0c435894b11042410f6343ac6bfc | [
"MIT"
] | null | null | null | editing-ui/src/py/controller/home.py | phaus/LibreBlogging | c4420f42385b0c435894b11042410f6343ac6bfc | [
"MIT"
] | null | null | null | editing-ui/src/py/controller/home.py | phaus/LibreBlogging | c4420f42385b0c435894b11042410f6343ac6bfc | [
"MIT"
] | null | null | null | '''
home.py
Home controller of LibreBlogging.
Author: Nicolas Inden
eMail: nico@smashnet.de
GPG-Key-ID: B2F8AA17
GPG-Fingerprint: A757 5741 FD1E 63E8 357D 48E2 3C68 AE70 B2F8 AA17
License: MIT License
'''
import cherrypy
from controller.base import BaseController
class HomeController(BaseController):
@cherrypy... | 21.928571 | 67 | 0.749186 |
5a478541c24a952253fccea00867124e28938c8a | 98 | py | Python | Lesson3_ControlFlow/1-booleanExpressions.py | StyvenSoft/degree-python | 644953608948f341f5a20ceb9a02976a128b472b | [
"MIT"
] | null | null | null | Lesson3_ControlFlow/1-booleanExpressions.py | StyvenSoft/degree-python | 644953608948f341f5a20ceb9a02976a128b472b | [
"MIT"
] | null | null | null | Lesson3_ControlFlow/1-booleanExpressions.py | StyvenSoft/degree-python | 644953608948f341f5a20ceb9a02976a128b472b | [
"MIT"
] | null | null | null | a = 215
b = 113
if b > a:
print("b is greater than a")
else:
print("b is not greater than a") | 14 | 34 | 0.602041 |
8db80f0e4f0cd5abf80bb798b88c4877e1a48116 | 4,337 | py | Python | coworks/tech/mail.py | gdoumenc/coworks | 97bb3babfd9c652315b5cf830d170cd20485b1d1 | [
"MIT"
] | 23 | 2019-12-26T16:28:40.000Z | 2022-02-22T14:05:47.000Z | coworks/tech/mail.py | gdoumenc/coworks | 97bb3babfd9c652315b5cf830d170cd20485b1d1 | [
"MIT"
] | 15 | 2019-12-24T13:29:29.000Z | 2021-12-28T10:16:36.000Z | coworks/tech/mail.py | gdoumenc/coworks | 97bb3babfd9c652315b5cf830d170cd20485b1d1 | [
"MIT"
] | 4 | 2021-07-10T17:59:51.000Z | 2022-02-14T18:53:00.000Z | import os
import smtplib
from email.message import EmailMessage
import requests
from aws_xray_sdk.core import xray_recorder
from chalice import ChaliceViewError, BadRequestError
from coworks import TechMicroService, FileParam
class MailMicroService(TechMicroService):
"""Mail microservice"""
def __init__(se... | 45.177083 | 140 | 0.595804 |
6b8aa2d6d35ca7b2ae3f3a879dd23054c2859371 | 1,411 | py | Python | tests/gagarin/core/test_token.py | kango31/SpaceIsOurs | d54f60e4cf25e5cdabd1463f1c730f9500531838 | [
"MIT"
] | null | null | null | tests/gagarin/core/test_token.py | kango31/SpaceIsOurs | d54f60e4cf25e5cdabd1463f1c730f9500531838 | [
"MIT"
] | null | null | null | tests/gagarin/core/test_token.py | kango31/SpaceIsOurs | d54f60e4cf25e5cdabd1463f1c730f9500531838 | [
"MIT"
] | null | null | null | import pytest
from gagarin.core.token import Token, OneSidedToken, TwoSidedToken, Face
@pytest.fixture(scope="function")
def token0():
yield Token(color="yellow")
@pytest.fixture(scope="function")
def token1():
yield OneSidedToken(value="+3")
@pytest.fixture(scope="function")
def token2():
face1 = Face(s... | 31.355556 | 72 | 0.647768 |
4c6c82842a5626c9f19cd050fede1ab4077c1535 | 4,308 | py | Python | scikit/nlp/corpus/processor/corpus_processor.py | wxyyxc1992/AIDL-Workbench | fb58ad976c729d2f7f9be2c8941aea05c86f9147 | [
"MIT"
] | 6 | 2018-04-10T03:54:02.000Z | 2019-03-01T09:06:30.000Z | scikit/nlp/corpus/processor/corpus_processor.py | AI-Kits/ai-models | fb58ad976c729d2f7f9be2c8941aea05c86f9147 | [
"MIT"
] | 11 | 2020-09-06T23:37:02.000Z | 2022-03-08T22:57:37.000Z | scikit/nlp/corpus/processor/corpus_processor.py | wx-chevalier/ai-models | fb58ad976c729d2f7f9be2c8941aea05c86f9147 | [
"MIT"
] | 3 | 2017-12-28T15:06:22.000Z | 2018-01-14T12:39:06.000Z | # -*- coding: utf-8 -*-
import fire
import logging
import sys
import re
from gensim import matutils
from gensim import corpora
from gensim.models.ldamulticore import LdaMulticore
from sklearn.feature_extraction.text import CountVectorizer
# 示例文档
default_documents = [['human', 'interface', 'computer'],
... | 27.615385 | 141 | 0.524141 |
88575aec0aa7a8981b4992950b69a6b85915250b | 303 | py | Python | tests/test_readline.py | gvelasq/radian | 2babf9e38138d88d21197345cf5cbd46f02eb615 | [
"MIT"
] | 1 | 2020-10-21T08:53:47.000Z | 2020-10-21T08:53:47.000Z | tests/test_readline.py | gvelasq/radian | 2babf9e38138d88d21197345cf5cbd46f02eb615 | [
"MIT"
] | null | null | null | tests/test_readline.py | gvelasq/radian | 2babf9e38138d88d21197345cf5cbd46f02eb615 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
def test_readline(terminal):
# issue #106
terminal.current_line().assert_startswith("r$>")
terminal.write("cat('hello'); readline('> ')\n")
terminal.previous_line(1).assert_startswith("hello")
terminal.current_line().assert_startswith("> ")
| 30.3 | 56 | 0.716172 |
9757da0e7f80ff716985cd305053aa8cd1692c0c | 2,495 | py | Python | app/models.py | mrillusi0n/project-board | 9606c86d97ea2cba17d29bd232e1b9cd897756b3 | [
"MIT"
] | null | null | null | app/models.py | mrillusi0n/project-board | 9606c86d97ea2cba17d29bd232e1b9cd897756b3 | [
"MIT"
] | null | null | null | app/models.py | mrillusi0n/project-board | 9606c86d97ea2cba17d29bd232e1b9cd897756b3 | [
"MIT"
] | null | null | null | from .extensions import db
from sqlalchemy import String, Boolean, Integer, Column, DateTime
from flask_security import RoleMixin, UserMixin
from werkzeug.security import generate_password_hash, check_password_hash
from datetime import datetime
class User(db.Model, UserMixin):
__tablename__ = 'users'
id = Column(I... | 32.402597 | 101 | 0.741082 |
efe395289e7e34bb2767f95a63b160455cf29e1d | 2,636 | py | Python | sample_config.py | zerofo/sdu-face-alignment | f4b57fde0576d2327369884fd5d5e9a7765a0790 | [
"MIT"
] | 192 | 2019-03-27T02:40:41.000Z | 2022-03-18T15:35:17.000Z | sample_config.py | zerofo/sdu-face-alignment | f4b57fde0576d2327369884fd5d5e9a7765a0790 | [
"MIT"
] | 4 | 2019-04-01T14:51:22.000Z | 2020-11-25T08:22:04.000Z | sample_config.py | zerofo/sdu-face-alignment | f4b57fde0576d2327369884fd5d5e9a7765a0790 | [
"MIT"
] | 38 | 2019-03-30T05:33:48.000Z | 2021-10-01T06:08:17.000Z | import numpy as np
from easydict import EasyDict as edict
config = edict()
#default training/dataset config
config.num_classes = 68
config.record_img_size = 384
config.base_scale = 256
config.input_img_size = 128
config.output_label_size = 64
config.label_xfirst = False
config.losstype = 'heatmap'
config... | 24.867925 | 59 | 0.724203 |
db182187a01912f9e807fbed59926dd516aec0af | 125,994 | py | Python | appengine/swarming/handlers_endpoints_test.py | amymariaparker2401/luci-py | c5902547adc12390df6b09c825a38370f1034e8b | [
"Apache-2.0"
] | null | null | null | appengine/swarming/handlers_endpoints_test.py | amymariaparker2401/luci-py | c5902547adc12390df6b09c825a38370f1034e8b | [
"Apache-2.0"
] | 1 | 2022-03-02T09:56:27.000Z | 2022-03-02T09:56:27.000Z | appengine/swarming/handlers_endpoints_test.py | Lees78/luci-py | 7b854c55f63e648005ae8aa38e2e41cd8f99feda | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env vpython
# coding=utf-8
# Copyright 2015 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
import base64
import datetime
import json
import logging
import os
import random
import sys
import unittest
... | 35.998286 | 80 | 0.599997 |
1d105e2f1238b81790cab42bf927a97d9f9816db | 1,031 | py | Python | 1431KidsForCandies/CandiesKids.py | Easonyesheng/CodePractice | 91c8b09c278f5abb67e90f0096fc83bef975647b | [
"MIT"
] | null | null | null | 1431KidsForCandies/CandiesKids.py | Easonyesheng/CodePractice | 91c8b09c278f5abb67e90f0096fc83bef975647b | [
"MIT"
] | null | null | null | 1431KidsForCandies/CandiesKids.py | Easonyesheng/CodePractice | 91c8b09c278f5abb67e90f0096fc83bef975647b | [
"MIT"
] | null | null | null | """
给你一个数组 candies 和一个整数 extraCandies ,其中 candies[i] 代表第 i 个孩子拥有的糖果数目。
对每一个孩子,检查是否存在一种方案,将额外的 extraCandies 个糖果分配给孩子们之后,此孩子有 最多 的糖果。注意,允许有多个孩子同时拥有 最多 的糖果数目。
示例 1:
输入:candies = [2,3,5,1,3], extraCandies = 3
输出:[true,true,true,false,true]
解释:
孩子 1 有 2 个糖果,如果他得到所有额外的糖果(3个),那么他总共有 5 个糖果,他将成为拥有最多糖果的孩子。
孩子 2 有 3 个糖果,如果... | 26.435897 | 84 | 0.668283 |
6f8e26f2408ae9aaefad146bb69ac9567d0404b9 | 1,838 | py | Python | 01_versoes_pacotes_pip/async_api_calls/tests/test_parser.py | fernandosavio/hackatombo | 9ef412b976c34c3cbd075b512a3bfcafd86b4d98 | [
"MIT"
] | null | null | null | 01_versoes_pacotes_pip/async_api_calls/tests/test_parser.py | fernandosavio/hackatombo | 9ef412b976c34c3cbd075b512a3bfcafd86b4d98 | [
"MIT"
] | null | null | null | 01_versoes_pacotes_pip/async_api_calls/tests/test_parser.py | fernandosavio/hackatombo | 9ef412b976c34c3cbd075b512a3bfcafd86b4d98 | [
"MIT"
] | null | null | null | from io import StringIO
import pytest
from ..version_checker.parser import Package, Version
@pytest.mark.parametrize("line", [
"",
" \t ",
"# comments",
" # comments",
"-r outro-arquivo.txt",
"-r folder/outro-arquivo.txt",
])
def test_ignore_invalid_lines(line):
assert Package.parse(... | 27.029412 | 56 | 0.573449 |
248abc67d2f32ced666a5cdc8baa27816eee29c0 | 14,229 | py | Python | snn_backprop.py | JeanElsner/capsules-neurorobotics | 2f95a75195d681d5473dca0f846180befcc0060f | [
"MIT"
] | null | null | null | snn_backprop.py | JeanElsner/capsules-neurorobotics | 2f95a75195d681d5473dca0f846180befcc0060f | [
"MIT"
] | null | null | null | snn_backprop.py | JeanElsner/capsules-neurorobotics | 2f95a75195d681d5473dca0f846180befcc0060f | [
"MIT"
] | 1 | 2018-07-09T18:42:11.000Z | 2018-07-09T18:42:11.000Z | import os
import torch
import argparse
import numpy as np
import matplotlib.pyplot as plt
import math
from time import time as t
from sklearn.metrics import confusion_matrix
from utils import AverageMeter, gpu_memory_usage
from bindsnet.network import Network, load_network
from bindsnet.utils import get_square_weights
... | 39.30663 | 130 | 0.64488 |
d07dca3e8ff87446e4fbf6a7f21b44c49e0fe932 | 2,589 | py | Python | python/tests/kubernetes/test_with_mars.py | zhiminch/GraphScope | 8992d6960fe1915117d2ee7695f892a798bfa70f | [
"Apache-2.0"
] | 3 | 2022-01-17T09:56:02.000Z | 2022-01-27T12:07:38.000Z | python/tests/kubernetes/test_with_mars.py | zhiminch/GraphScope | 8992d6960fe1915117d2ee7695f892a798bfa70f | [
"Apache-2.0"
] | null | null | null | python/tests/kubernetes/test_with_mars.py | zhiminch/GraphScope | 8992d6960fe1915117d2ee7695f892a798bfa70f | [
"Apache-2.0"
] | 1 | 2022-03-02T14:17:48.000Z | 2022-03-02T14:17:48.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2020-2021 Alibaba Group Holding Limited. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.a... | 28.141304 | 87 | 0.705678 |
df5663726c14c7651a13f0fefe03b0c049ab3f60 | 3,601 | py | Python | libsql/connector.py | masaharu-kato/libsql | d5299ad70701d0753f8b2e205a73f61c9cb87077 | [
"MIT"
] | null | null | null | libsql/connector.py | masaharu-kato/libsql | d5299ad70701d0753f8b2e205a73f61c9cb87077 | [
"MIT"
] | null | null | null | libsql/connector.py | masaharu-kato/libsql | d5299ad70701d0753f8b2e205a73f61c9cb87077 | [
"MIT"
] | null | null | null | """
SQL Connection classes and functions
"""
from abc import abstractmethod, abstractproperty
from typing import List, Optional, Sequence, Union
import mysql.connector
from mysql.connector import errors # type: ignore
import mysql.connector.abstracts # type: ignore
from .schema import Database as DBSchema
class C... | 27.075188 | 107 | 0.625382 |
094ed70092defc5de68ac35cbf1c3d2847809fd5 | 12,270 | py | Python | chia/rpc/wallet_rpc_client.py | wallentx/chia-blockchain | 6bc8a3e204a4f49813093e5b3a99740fddc54a93 | [
"Apache-2.0"
] | 2 | 2022-01-01T18:52:46.000Z | 2022-01-06T17:24:02.000Z | chia/rpc/wallet_rpc_client.py | wallentx/chia-blockchain | 6bc8a3e204a4f49813093e5b3a99740fddc54a93 | [
"Apache-2.0"
] | 33 | 2021-09-28T10:17:59.000Z | 2022-03-29T10:13:18.000Z | chia/rpc/wallet_rpc_client.py | rob-opsi/chia-blockchain | 536d90f3b2d3be6ea78ce64528d04dcaba08fcb4 | [
"Apache-2.0"
] | null | null | null | from pathlib import Path
from typing import Dict, List, Optional, Any, Tuple
from chia.pools.pool_wallet_info import PoolWalletInfo
from chia.rpc.rpc_client import RpcClient
from chia.types.blockchain_format.coin import Coin
from chia.types.blockchain_format.sized_bytes import bytes32
from chia.util.bech32m import dec... | 40.9 | 118 | 0.622738 |
e8991f2170cff898f120bb15549b1facbec7e45e | 12,808 | py | Python | test/test_pyfftw_nbyte_align.py | xnox/pyFFTW | e502b917c8d0718a00a22353f0565e9a63127723 | [
"BSD-3-Clause"
] | 238 | 2016-02-01T10:01:40.000Z | 2022-03-24T22:52:32.000Z | test/test_pyfftw_nbyte_align.py | xnox/pyFFTW | e502b917c8d0718a00a22353f0565e9a63127723 | [
"BSD-3-Clause"
] | 258 | 2016-01-29T21:57:02.000Z | 2022-02-25T15:15:25.000Z | test/test_pyfftw_nbyte_align.py | xnox/pyFFTW | e502b917c8d0718a00a22353f0565e9a63127723 | [
"BSD-3-Clause"
] | 66 | 2016-01-29T21:38:01.000Z | 2022-03-02T21:50:58.000Z | # Copyright 2014 Knowledge Economy Developments Ltd
# Copyright 2014 David Wells
#
# Henry Gomersall
# heng@kedevelopments.co.uk
# David Wells
# drwells <at> vt.edu
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following c... | 34.804348 | 79 | 0.59416 |
dc069fd7e9628848d8f36f987fab229161473440 | 15,545 | py | Python | stgelpDL/hmm/api_acppgeg.py | dmitryv56/stgelpDL | a3dbe9f1a4ff19586dfdfac01748634b47389a6e | [
"MIT"
] | null | null | null | stgelpDL/hmm/api_acppgeg.py | dmitryv56/stgelpDL | a3dbe9f1a4ff19586dfdfac01748634b47389a6e | [
"MIT"
] | null | null | null | stgelpDL/hmm/api_acppgeg.py | dmitryv56/stgelpDL | a3dbe9f1a4ff19586dfdfac01748634b47389a6e | [
"MIT"
] | null | null | null | #!/usr/bin/python3
""" Api for HMM_acppgeg """
import copy
from pathlib import Path
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
from hmm.fwd import fwd_bkw, viterbi, probNormDist
from hmm.HMM import hmm_gmix
from hmm.HMM_drive import emissionDistrib... | 41.233422 | 128 | 0.645224 |
0e2831e70c9330e64358277c0a3d48f7d0ddfeb1 | 733 | py | Python | trust/artifacts/content_trust/authority.py | N0omB/aTLAS_host | 798cb937f13403dea0e46b5269162411c8e9d594 | [
"MIT"
] | null | null | null | trust/artifacts/content_trust/authority.py | N0omB/aTLAS_host | 798cb937f13403dea0e46b5269162411c8e9d594 | [
"MIT"
] | null | null | null | trust/artifacts/content_trust/authority.py | N0omB/aTLAS_host | 798cb937f13403dea0e46b5269162411c8e9d594 | [
"MIT"
] | null | null | null |
def authority(agent_authorities, other_agent, scale):
"""
All authorities of the agent get the scale's maximum, while all others get the minimum to trust value.
:param agent_authorities: The list of agents to be seen as authority by the current agent.
:type agent_authorities: list
:param other_ag... | 36.65 | 109 | 0.717599 |
3d9b7f419c42b66561b0e6e0dc941238e5ada4b3 | 1,768 | py | Python | river/optim/base.py | mfsuve/river | ed015878d1276722e1ffb8b4e914612ae4f41dcb | [
"BSD-3-Clause"
] | 1 | 2020-12-02T04:59:12.000Z | 2020-12-02T04:59:12.000Z | river/optim/base.py | mfsuve/river | ed015878d1276722e1ffb8b4e914612ae4f41dcb | [
"BSD-3-Clause"
] | null | null | null | river/optim/base.py | mfsuve/river | ed015878d1276722e1ffb8b4e914612ae4f41dcb | [
"BSD-3-Clause"
] | null | null | null | import abc
import numbers
import typing
from . import schedulers
class Optimizer(abc.ABC):
"""Optimizer interface.
Every optimizer inherits from this base interface.
Parameters
----------
lr
Attributes
----------
learning_rate : float
Returns the current learning rate value... | 23.263158 | 91 | 0.605204 |
33f0fba858b3ccb892d1e3369114bf6c4422422a | 1,678 | py | Python | shortener/database.py | kerbrek/shortener | f716778ec87b15730e4cd354a31d868f7d98673e | [
"MIT"
] | null | null | null | shortener/database.py | kerbrek/shortener | f716778ec87b15730e4cd354a31d868f7d98673e | [
"MIT"
] | null | null | null | shortener/database.py | kerbrek/shortener | f716778ec87b15730e4cd354a31d868f7d98673e | [
"MIT"
] | null | null | null | import multiprocessing
import os
from pymemcache.client.base import PooledClient
from sqlalchemy import create_engine
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker
WORKERS_DEFAULT = multiprocessing.cpu_count() * 2 + 1
WORKERS = int(os.environ.get("WORKERS", WORKERS_DE... | 31.074074 | 75 | 0.771752 |
65beaf90b096d7e3654cfebbfcefdbde67c3df33 | 4,593 | py | Python | MisterMasticate/models.py | rocketstrong600/MisterMasticate | 4b499ad09d1d5c4910e6120219bfc097036eee68 | [
"MIT"
] | null | null | null | MisterMasticate/models.py | rocketstrong600/MisterMasticate | 4b499ad09d1d5c4910e6120219bfc097036eee68 | [
"MIT"
] | null | null | null | MisterMasticate/models.py | rocketstrong600/MisterMasticate | 4b499ad09d1d5c4910e6120219bfc097036eee68 | [
"MIT"
] | null | null | null | from MisterMasticate import db, login_manager
from flask_login import UserMixin
@login_manager.user_loader
def load_user(user_id):
return User.query.get(int(user_id))
class User(db.Model, UserMixin):
id = db.Column(db.Integer, primary_key=True)
charactername = db.Column(db.String(50), nullable=False)
... | 38.596639 | 95 | 0.67211 |
e6994995c723b13818acd61437793e81b15c658a | 2,749 | py | Python | contrib/testgen/base58.py | sats0k/Testcoin | 15f9955e2ed8e489bf9da48aa0085b3aedaa49fc | [
"MIT"
] | 2 | 2021-05-16T07:37:40.000Z | 2022-02-04T14:00:49.000Z | contrib/testgen/base58.py | sats0k/Testcoin | 15f9955e2ed8e489bf9da48aa0085b3aedaa49fc | [
"MIT"
] | 8 | 2019-02-28T01:41:01.000Z | 2019-11-11T17:30:39.000Z | contrib/testgen/base58.py | sats0k/Testcoin | 15f9955e2ed8e489bf9da48aa0085b3aedaa49fc | [
"MIT"
] | 6 | 2019-02-18T19:09:23.000Z | 2019-11-11T20:56:04.000Z | '''
Bitcoin base58 encoding and decoding.
Based on https://bitcointalk.org/index.php?topic=1026.0 (public domain)
'''
import hashlib
# for compatibility with following code...
class SHA256:
new = hashlib.sha256
if str != bytes:
# Python 3.x
def ord(c):
return c
def chr(n):
return byte... | 26.432692 | 97 | 0.625682 |
46508187827dcae89358f7e738b8d3aa42e8f819 | 2,471 | py | Python | posthog/api/test/test_retention.py | dorucioclea/posthog | a7e792c3fc5c1abc70d8167e1ead12d4ea24f17a | [
"MIT"
] | null | null | null | posthog/api/test/test_retention.py | dorucioclea/posthog | a7e792c3fc5c1abc70d8167e1ead12d4ea24f17a | [
"MIT"
] | null | null | null | posthog/api/test/test_retention.py | dorucioclea/posthog | a7e792c3fc5c1abc70d8167e1ead12d4ea24f17a | [
"MIT"
] | null | null | null | import json
from datetime import datetime
from typing import Any, Dict, List, Optional
from unittest.mock import ANY
import pytest
from django.test import Client
from freezegun.api import freeze_time
from posthog.api.test.test_event_definition import (
EventData,
capture_event,
create_organization,
cr... | 29.416667 | 98 | 0.647916 |
8cd8e024d5072e37c57fda787056ddb4e19db7bf | 693 | py | Python | python3_spider_action/ch03/learn02_requests/learn03_regex.py | Fly365/py-learn | a7c747af70ca2d6dcf244dc89344fbd26b125987 | [
"Apache-2.0"
] | null | null | null | python3_spider_action/ch03/learn02_requests/learn03_regex.py | Fly365/py-learn | a7c747af70ca2d6dcf244dc89344fbd26b125987 | [
"Apache-2.0"
] | null | null | null | python3_spider_action/ch03/learn02_requests/learn03_regex.py | Fly365/py-learn | a7c747af70ca2d6dcf244dc89344fbd26b125987 | [
"Apache-2.0"
] | null | null | null | # encoding=utf8
# match 匹配方法,检测字符串是否匹配
import re
content = "hello 123 4567 world_this is l Regex Demo"
result = re.match("^hello\s\d\d\d\s\d{4}\s\w{10}", content)
print(result)
# 匹配到的内容
print(result.group())
# 输出匹配的范围,即 匹配到结果字符串在原字符串中的位置范围
print(result.span())
'''
使用()括号将想要提取字符串括起来。()实际上标记了一个子表达式开始和结束位置,
被标记每个子表达式会依次... | 22.354839 | 59 | 0.724387 |
ef95b997aa33cd6fed1cb1cfaff4d93487b1c0df | 2,763 | py | Python | examples/dt_fill_gaps_test.py | AMYPAD/NiftyPAD | 80bc005ca409f503a8df3a13a071d2f3f413553f | [
"Apache-2.0"
] | null | null | null | examples/dt_fill_gaps_test.py | AMYPAD/NiftyPAD | 80bc005ca409f503a8df3a13a071d2f3f413553f | [
"Apache-2.0"
] | 2 | 2021-09-06T21:38:43.000Z | 2021-10-05T11:07:08.000Z | examples/dt_fill_gaps_test.py | AMYPAD/NiftyPAD | 80bc005ca409f503a8df3a13a071d2f3f413553f | [
"Apache-2.0"
] | null | null | null | import matplotlib.pyplot as plt
import numpy as np
from niftypad import basis
from niftypad.kt import dt2mft, dt_fill_gaps
from niftypad.models import get_model_inputs
from niftypad.tac import TAC, Ref
# dt
dt = np.array([[
0, 5, 10, 15, 20, 25, 30, 40, 50, 60, 120, 180, 240, 300, 450, 600, 900, 1200, 1800, 2400,... | 41.863636 | 96 | 0.702497 |
7c166621ec985ee1206f137c6217392a08649caa | 7,060 | py | Python | src/eda.py | cmry/augtox | f7ce1269dd5f00895cbb9edb2672069fec081f39 | [
"MIT"
] | 1 | 2022-01-19T18:07:46.000Z | 2022-01-19T18:07:46.000Z | src/eda.py | cmry/augtox | f7ce1269dd5f00895cbb9edb2672069fec081f39 | [
"MIT"
] | null | null | null | src/eda.py | cmry/augtox | f7ce1269dd5f00895cbb9edb2672069fec081f39 | [
"MIT"
] | null | null | null | # flake8: noqa
# Easy data augmentation techniques for text classification
# Jason Wei and Kai Zou
import random
from random import shuffle
random.seed(1)
#stop words list
stop_words = ['i', 'me', 'my', 'myself', 'we', 'our',
'ours', 'ourselves', 'you', 'your', 'yours',
'yourself', 'yourselves', 'he', 'him', ... | 31.517857 | 101 | 0.598584 |
903eb22ef36615bf965bb8f55b8dfac52289df09 | 551 | py | Python | generate.py | Octavian-ai/synthetic-graph-data | b327cfb06d420d216a5377f2ce953355089e0e6b | [
"MIT"
] | 16 | 2018-09-06T09:27:03.000Z | 2021-05-28T01:35:44.000Z | generate.py | Octavian-ai/generate-data | b327cfb06d420d216a5377f2ce953355089e0e6b | [
"MIT"
] | 1 | 2021-02-10T00:02:43.000Z | 2021-02-10T00:02:43.000Z | generate.py | Octavian-ai/generate-data | b327cfb06d420d216a5377f2ce953355089e0e6b | [
"MIT"
] | 7 | 2018-07-23T08:39:54.000Z | 2021-02-08T16:24:54.000Z | #!/usr/bin/env python3
if __name__ == '__main__':
from graph_io import SimpleNodeClient
import argparse
from data_sets import runner
parser = argparse.ArgumentParser()
parser.add_argument('--dataset', type=str, choices=runner.keys())
FLAGS = parser.parse_args()
if FLAGS.dataset is None:
print("Please selec... | 23.956522 | 74 | 0.715064 |
2981f10c53e884c29e4600eba1199176cef5165a | 4,110 | py | Python | vds_external_4x.py | graeme-winter/virtual-realities | 84d67b49be19260878409f176d3210fed212af22 | [
"BSD-3-Clause"
] | null | null | null | vds_external_4x.py | graeme-winter/virtual-realities | 84d67b49be19260878409f176d3210fed212af22 | [
"BSD-3-Clause"
] | null | null | null | vds_external_4x.py | graeme-winter/virtual-realities | 84d67b49be19260878409f176d3210fed212af22 | [
"BSD-3-Clause"
] | null | null | null | # VDS External 4X
#
# Take 32 modules from an Eiger 2XE 16M and arrange as 8 x 4-module data sets
# where the 4 modules are each composed as 2 x 2M:
#
# Original / full detector modules:
#
# [ 0 1 2 3]
# [ 4 5 6 7]
# [ 8 9 10 11]
# [12 13 14 15]
# [16 17 18 19]
# [20 21 22 23]
# [24 25 26 27]
# [28 29 30 31]
#
#... | 28.150685 | 82 | 0.553771 |
38d963bfda078f22429841eef2334b7d3950fbd5 | 42,493 | py | Python | src/sagemaker/local/image.py | satishpasumarthi/sagemaker-python-sdk | 255a339ae985041ef47e3a80da91b9f54bca17b9 | [
"Apache-2.0"
] | 1 | 2021-12-10T16:18:29.000Z | 2021-12-10T16:18:29.000Z | src/sagemaker/local/image.py | satishpasumarthi/sagemaker-python-sdk | 255a339ae985041ef47e3a80da91b9f54bca17b9 | [
"Apache-2.0"
] | 20 | 2021-09-17T20:50:11.000Z | 2021-12-09T00:29:02.000Z | src/sagemaker/local/image.py | satishpasumarthi/sagemaker-python-sdk | 255a339ae985041ef47e3a80da91b9f54bca17b9 | [
"Apache-2.0"
] | null | null | null | # Copyright Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file accompan... | 37.974084 | 100 | 0.636693 |
29dd40437f7024a6d58e35af8cac4449f2f6493c | 407 | py | Python | db_create.py | vahiwe/Pneumonia-Prediction-App | 124f8993ddc8e84ad0e540ae8e4c9cbccf0431a8 | [
"MIT"
] | 6 | 2020-01-26T12:40:52.000Z | 2022-01-11T07:52:25.000Z | db_create.py | vahiwe/Pneumonia-Prediction-App | 124f8993ddc8e84ad0e540ae8e4c9cbccf0431a8 | [
"MIT"
] | 4 | 2021-09-08T01:30:46.000Z | 2022-03-12T00:08:28.000Z | db_create.py | vahiwe/Pneumonia-Prediction-App | 124f8993ddc8e84ad0e540ae8e4c9cbccf0431a8 | [
"MIT"
] | 7 | 2019-12-08T12:51:10.000Z | 2021-11-19T12:42:48.000Z | from app import db
from app.models import User, History
# drop all of the existing database tables
db.drop_all()
# create the database and the database table
db.create_all()
user = User(email="admin@example.com", firstname="John",
lastname="Doe", gender="Male", profession="Radiologist")
user.set_password(... | 23.941176 | 68 | 0.732187 |
7e89b6b1f5024706c20bad1bf88b7452c3e16055 | 504 | py | Python | configs/self6dpp/ssLMO/ss_mlBCE_MaskFull_PredFull_lr1e_5_lower_woCenter_refinePM10_lmoNoBopTest/ss_mlBCE_MaskFull_PredFull_lr1e_5_lower_woCenter_refinePM10_11_glue.py | THU-DA-6D-Pose-Group/self6dpp | c267cfa55e440e212136a5e9940598720fa21d16 | [
"Apache-2.0"
] | 33 | 2021-12-15T07:11:47.000Z | 2022-03-29T08:58:32.000Z | configs/self6dpp/ssLMO/ss_mlBCE_MaskFull_PredFull_lr1e_5_lower_woCenter_refinePM10_lmoNoBopTest/ss_mlBCE_MaskFull_PredFull_lr1e_5_lower_woCenter_refinePM10_11_glue.py | THU-DA-6D-Pose-Group/self6dpp | c267cfa55e440e212136a5e9940598720fa21d16 | [
"Apache-2.0"
] | 3 | 2021-12-15T11:39:54.000Z | 2022-03-29T07:24:23.000Z | configs/self6dpp/ssLMO/ss_mlBCE_MaskFull_PredFull_lr1e_5_lower_woCenter_refinePM10_lmoNoBopTest/ss_mlBCE_MaskFull_PredFull_lr1e_5_lower_woCenter_refinePM10_11_glue.py | THU-DA-6D-Pose-Group/self6dpp | c267cfa55e440e212136a5e9940598720fa21d16 | [
"Apache-2.0"
] | null | null | null | _base_ = ["ss_mlBCE_MaskFull_PredFull_lr1e_5_lower_woCenter_refinePM10_01_ape.py"]
OUTPUT_DIR = "output/self6dpp/ssLMO/ss_mlBCE_MaskFull_PredFull_lr1e_5_lower_woCenter_refinePM10_lmoNoBopTest/glue"
DATASETS = dict(TRAIN=("lmo_NoBopTest_glue_train",), TRAIN2=("lmo_pbr_glue_train",)) # real data # synthetic data
MOD... | 45.818182 | 136 | 0.835317 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.