hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | 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 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | 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 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e814ccb074a4b2193546c71add25201510ffc62e | 5,632 | py | Python | tests/unit/spm.py | johngrasty/salt | f66b18d8ee52eb988c3dbd8ba3ff6a6173c8aea5 | [
"Apache-2.0"
] | null | null | null | tests/unit/spm.py | johngrasty/salt | f66b18d8ee52eb988c3dbd8ba3ff6a6173c8aea5 | [
"Apache-2.0"
] | 1 | 2015-09-02T12:49:48.000Z | 2015-09-02T19:22:58.000Z | tests/unit/spm.py | johngrasty/salt | f66b18d8ee52eb988c3dbd8ba3ff6a6173c8aea5 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
# Import Python libs
from __future__ import absolute_import
import os
import shutil
import tempfile
# Import Salt Testing libs
from salttesting import TestCase
from salttesting.helpers import ensure_in_syspath, destructiveTest
import salt.config
import salt.spm
ensure_in_syspath('../')
_TMP_SPM = ... | 32 | 99 | 0.561967 |
e814df08842f45f1a97684e729c48be85e1ea16d | 5,289 | py | Python | speech_recognizer/scripts/mp3_dataset_converter_multithreading.py | naderabdalghani/project-rev | 3205d42a2220372783ab49ce8c3c70a4c4b9ad7e | [
"Apache-2.0"
] | 2 | 2021-12-13T04:19:30.000Z | 2022-02-16T16:27:20.000Z | speech_recognizer/scripts/mp3_dataset_converter_multithreading.py | MuhanadAtef/project-rev | 3205d42a2220372783ab49ce8c3c70a4c4b9ad7e | [
"Apache-2.0"
] | null | null | null | speech_recognizer/scripts/mp3_dataset_converter_multithreading.py | MuhanadAtef/project-rev | 3205d42a2220372783ab49ce8c3c70a4c4b9ad7e | [
"Apache-2.0"
] | 2 | 2021-08-17T06:25:36.000Z | 2021-08-17T12:45:33.000Z | """ Utility script to convert common voice into wav and create the training, validation and testing json files for.
This file is run once only to get the converted data
"""
import threading
import json
import csv
from tqdm import tqdm
from pydub import AudioSegment
from mutagen.mp3 import MP3
from ..config import C... | 39.766917 | 128 | 0.5744 |
e814ef09356b68bb11b39dc08e17452c28557adf | 3,287 | py | Python | tests/test_visitors.py | UniStuttgart-VISUS/damast | 05ceb150e86227d81f0f4bb441af6d4f8bce65ee | [
"MIT"
] | 2 | 2021-12-22T17:01:02.000Z | 2022-01-18T17:05:48.000Z | tests/test_visitors.py | UniStuttgart-VISUS/damast | 05ceb150e86227d81f0f4bb441af6d4f8bce65ee | [
"MIT"
] | 94 | 2021-12-22T11:21:57.000Z | 2022-03-31T22:40:56.000Z | tests/test_visitors.py | UniStuttgart-VISUS/damast | 05ceb150e86227d81f0f4bb441af6d4f8bce65ee | [
"MIT"
] | 1 | 2022-01-04T09:04:47.000Z | 2022-01-04T09:04:47.000Z | import os
import pytest
import damast
import flask
import urllib.parse
import base64
import sqlite3
from functools import namedtuple
from passlib.hash import sha256_crypt, sha512_crypt, bcrypt
from passlib.context import CryptContext
from conftest import get_headers
Roles = namedtuple('Roles', 'roles,valid')
_visitor... | 31.009434 | 113 | 0.572559 |
e814f1ed29413024a6db91359881df7696f3b574 | 5,657 | py | Python | sdk/iothub/azure-mgmt-iothub/tests/test_mgmt_iothub.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/iothub/azure-mgmt-iothub/tests/test_mgmt_iothub.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/iothub/azure-mgmt-iothub/tests/test_mgmt_iothub.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # coding: utf-8
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#---------------------------------------------------------------------... | 34.493902 | 112 | 0.554357 |
e81550ed0ad10df6261321a80e09425d2cae55e1 | 2,334 | py | Python | openstackclient/tests/common/test_configuration.py | redhat-openstack/python-openstackclient | 7dc2e1dc08b0692a3accb343c62451fb3d83f4cd | [
"Apache-2.0"
] | null | null | null | openstackclient/tests/common/test_configuration.py | redhat-openstack/python-openstackclient | 7dc2e1dc08b0692a3accb343c62451fb3d83f4cd | [
"Apache-2.0"
] | null | null | null | openstackclient/tests/common/test_configuration.py | redhat-openstack/python-openstackclient | 7dc2e1dc08b0692a3accb343c62451fb3d83f4cd | [
"Apache-2.0"
] | null | null | null | # 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, software
# distrib... | 31.12 | 77 | 0.649957 |
e815826d05f9380665fec30903d93a318f4adc0f | 7,506 | py | Python | examples/stwave_duck/example_inv_stwave.py | jonghyunharrylee/PCGA | ed1b46f33847eafde685c97ef28d473baf63cf2f | [
"BSD-3-Clause"
] | 16 | 2018-09-09T11:27:20.000Z | 2022-03-09T01:46:37.000Z | examples/stwave_duck/example_inv_stwave.py | jonghyunharrylee/PCGA | ed1b46f33847eafde685c97ef28d473baf63cf2f | [
"BSD-3-Clause"
] | 8 | 2018-03-19T19:36:38.000Z | 2022-01-26T20:09:27.000Z | examples/stwave_duck/example_inv_stwave.py | jonghyunharrylee/PCGA | ed1b46f33847eafde685c97ef28d473baf63cf2f | [
"BSD-3-Clause"
] | 12 | 2018-06-29T13:16:40.000Z | 2022-03-09T01:46:25.000Z | import matplotlib
matplotlib.use("Agg")
import matplotlib.pyplot as plt
import numpy as np
import stwave as st
from pyPCGA import PCGA
import math
import datetime as dt
# model domain and discretization
N = np.array([110,83])
m = np.prod(N)
dx = np.array([5.,5.])
xmin = np.array([0. + dx[0]/2., 0. + dx[... | 35.742857 | 116 | 0.620703 |
e8158bf77d7113b47288b33dd30be5698d432a36 | 1,698 | py | Python | rsl_comm_py/examples/example_um7_change_quat_rate.py | RedshiftLabsPtyLtd/rsl_comm_py | e53b4e85079898c894dac25842a08bcc303edfbb | [
"MIT"
] | null | null | null | rsl_comm_py/examples/example_um7_change_quat_rate.py | RedshiftLabsPtyLtd/rsl_comm_py | e53b4e85079898c894dac25842a08bcc303edfbb | [
"MIT"
] | null | null | null | rsl_comm_py/examples/example_um7_change_quat_rate.py | RedshiftLabsPtyLtd/rsl_comm_py | e53b4e85079898c894dac25842a08bcc303edfbb | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Author: Dr. Konstantin Selyunin
# License: MIT
# Date: 27 November 2020
# Modified: 08 December 2021
import logging
import sys
from pathlib import Path
from rsl_comm_py.um7_serial import UM7Serial
if __name__ == '__main__':
logging.basicConfig(
level=logging.WARNING,
f... | 32.653846 | 80 | 0.704358 |
e8159fc46e454e4f84b487e62e699e80c3f27011 | 4,286 | py | Python | devito/logger.py | cc-a/devito | 24ede9131473f69c1e44ba3b852f8654d3fd953e | [
"MIT"
] | null | null | null | devito/logger.py | cc-a/devito | 24ede9131473f69c1e44ba3b852f8654d3fd953e | [
"MIT"
] | null | null | null | devito/logger.py | cc-a/devito | 24ede9131473f69c1e44ba3b852f8654d3fd953e | [
"MIT"
] | 1 | 2020-01-13T01:17:24.000Z | 2020-01-13T01:17:24.000Z | """The Devito logger."""
import logging
import sys
from contextlib import contextmanager
__all__ = ('set_log_level', 'set_log_noperf',
'log', 'warning', 'error', 'perf', 'perf_adv', 'dse', 'dse_warning',
'dle', 'dle_warning',
'RED', 'GREEN', 'BLUE')
logger = logging.getLogger('Devit... | 24.214689 | 83 | 0.628091 |
e815adbe215fb7e360cf8f5a630195d487324d44 | 1,754 | py | Python | tests/test_save.py | BrunoMot/devito | b6e077857765b7b5fad812ec5774635ca4c6fbb7 | [
"MIT"
] | 2 | 2019-04-05T20:52:23.000Z | 2019-11-03T21:36:53.000Z | tests/test_save.py | BrunoMot/devito | b6e077857765b7b5fad812ec5774635ca4c6fbb7 | [
"MIT"
] | 9 | 2019-06-11T20:54:19.000Z | 2020-04-06T17:56:10.000Z | tests/test_save.py | BrunoMot/devito | b6e077857765b7b5fad812ec5774635ca4c6fbb7 | [
"MIT"
] | 2 | 2018-11-15T12:03:48.000Z | 2018-11-15T13:16:19.000Z | import numpy as np
from conftest import skipif
from devito import Buffer, Grid, Eq, Operator, TimeFunction, solve
pytestmark = skipif(['yask', 'ops'])
def initial(nt, nx, ny):
xx, yy = np.meshgrid(np.linspace(0., 1., nx, dtype=np.float32),
np.linspace(0., 1., ny, dtype=np.float32))
... | 29.233333 | 75 | 0.624857 |
e815b385203b2d4b3acd11650c3726f846c6e2b6 | 8,602 | py | Python | rrt/test_rrt.py | SeunghyunLim/path_planning_algorithms | a160a71c30c403cddfa6fb3fb54416f4a8a857e3 | [
"Apache-2.0"
] | null | null | null | rrt/test_rrt.py | SeunghyunLim/path_planning_algorithms | a160a71c30c403cddfa6fb3fb54416f4a8a857e3 | [
"Apache-2.0"
] | null | null | null | rrt/test_rrt.py | SeunghyunLim/path_planning_algorithms | a160a71c30c403cddfa6fb3fb54416f4a8a857e3 | [
"Apache-2.0"
] | null | null | null | """
Path planning Sample Code with Randomized Rapidly-Exploring Random Trees (RRT)
author: AtsushiSakai(@Atsushi_twi)
"""
import math
import random
import matplotlib.pyplot as plt
import numpy as np
show_animation = True
class RRT:
"""
Class for RRT planning
"""
class Node:
"""
RRT... | 30.942446 | 79 | 0.547082 |
e815c8bb77cd66d5d1b3bef6168365f6247fe385 | 3,376 | py | Python | accuratetempo/generator.py | hendriks73/accurate-tempo | b064fdac7fa5149654d9bac77b907f5306d0a9bf | [
"CC-BY-3.0"
] | null | null | null | accuratetempo/generator.py | hendriks73/accurate-tempo | b064fdac7fa5149654d9bac77b907f5306d0a9bf | [
"CC-BY-3.0"
] | null | null | null | accuratetempo/generator.py | hendriks73/accurate-tempo | b064fdac7fa5149654d9bac77b907f5306d0a9bf | [
"CC-BY-3.0"
] | null | null | null | """
Keras sequence to be used as generator.
"""
import numpy as np
from tensorflow.keras.utils import Sequence
def identity_tempo_augmenter():
return 1.0
def discrete_tempo_augmenter():
f = [x / 100.0 for x in range(80, 124, 4)]
return np.random.choice(f)
def uniform_tempo_augmenter():
return np.... | 31.259259 | 118 | 0.629147 |
e815d2eb2d76ac7ad9b96e36ced42ea2801f6d81 | 23,397 | py | Python | src/sage/rings/asymptotic/misc.py | saraedum/sage-renamed | d2da67b14da2ad766a5906425d60d43a3b3e1270 | [
"BSL-1.0"
] | null | null | null | src/sage/rings/asymptotic/misc.py | saraedum/sage-renamed | d2da67b14da2ad766a5906425d60d43a3b3e1270 | [
"BSL-1.0"
] | null | null | null | src/sage/rings/asymptotic/misc.py | saraedum/sage-renamed | d2da67b14da2ad766a5906425d60d43a3b3e1270 | [
"BSL-1.0"
] | null | null | null | r"""
Asymptotic Expansions --- Miscellaneous
AUTHORS:
- Daniel Krenn (2015)
ACKNOWLEDGEMENT:
- Benjamin Hackl, Clemens Heuberger and Daniel Krenn are supported by the
Austrian Science Fund (FWF): P 24644-N26.
- Benjamin Hackl is supported by the Google Summer of Code 2015.
Functions, Classes and Methods
======... | 31.617568 | 99 | 0.538402 |
e815df25ea3bef304159555d5999f1888ed3398b | 5,702 | py | Python | recipes/mobvoihotwords/test.py | wangwei2009/speechbrain | ebbac4561a9c9101786e0ab0b1105017eb655fc8 | [
"Apache-2.0"
] | null | null | null | recipes/mobvoihotwords/test.py | wangwei2009/speechbrain | ebbac4561a9c9101786e0ab0b1105017eb655fc8 | [
"Apache-2.0"
] | null | null | null | recipes/mobvoihotwords/test.py | wangwei2009/speechbrain | ebbac4561a9c9101786e0ab0b1105017eb655fc8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env/python3
"""Recipe for training a speech enhancement system with spectral masking.
To run this recipe, do the following:
> python train.py train.yaml --data_folder /path/to/save/mini_librispeech
To read the code, first scroll to the bottom to see the "main" code.
This gives a high-level overview of what... | 33.345029 | 128 | 0.685549 |
e815e165f41f64dba043b8da5eec1e2d688ddf0d | 1,959 | py | Python | alipay/aop/api/domain/DeliveryFullSendConfig.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/DeliveryFullSendConfig.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/DeliveryFullSendConfig.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.DeliveryContentInfo import DeliveryContentInfo
class DeliveryFullSendConfig(object):
def __init__(self):
self._delivery_content_info = None
self._delivery_flo... | 32.65 | 93 | 0.679939 |
e815f25d8068f4fd0dd26708cf641abedd11910a | 3,565 | py | Python | src/pipx/commands/reinstall.py | stjordanis/pipx | 5e26b3b857a568be7fde40a9ef2caa8f7c0c040d | [
"MIT"
] | 3 | 2021-08-21T11:38:27.000Z | 2021-09-03T01:18:28.000Z | src/pipx/commands/reinstall.py | stjordanis/pipx | 5e26b3b857a568be7fde40a9ef2caa8f7c0c040d | [
"MIT"
] | null | null | null | src/pipx/commands/reinstall.py | stjordanis/pipx | 5e26b3b857a568be7fde40a9ef2caa8f7c0c040d | [
"MIT"
] | 1 | 2020-04-19T21:11:47.000Z | 2020-04-19T21:11:47.000Z | import sys
from pathlib import Path
from typing import List, Sequence
from packaging.utils import canonicalize_name
import pipx.shared_libs # import instead of from so mockable in tests
from pipx.commands.inject import inject_dep
from pipx.commands.install import install
from pipx.commands.uninstall import uninstall... | 31.830357 | 87 | 0.663114 |
e8161470b0256cc13ac4669af1c1a1049f1329ac | 1,137 | py | Python | rl_memory/erik/old/tools.py | eskalnes/RL_memory | bd1a5cc07a41be89ea9f8de9edc2a2b557dcedbb | [
"MIT"
] | null | null | null | rl_memory/erik/old/tools.py | eskalnes/RL_memory | bd1a5cc07a41be89ea9f8de9edc2a2b557dcedbb | [
"MIT"
] | null | null | null | rl_memory/erik/old/tools.py | eskalnes/RL_memory | bd1a5cc07a41be89ea9f8de9edc2a2b557dcedbb | [
"MIT"
] | 1 | 2021-08-01T17:32:45.000Z | 2021-08-01T17:32:45.000Z | import numpy as np
def discount_rate(episode_idx, num_episodes, discount=.95):
"""[summary]
Args:
episode_idx (int): The integer encoding for the episode.
num_episodes (int): The total number of episodes.
discount (float, optional): Discount factor. Defaults to .95.
https:... | 29.921053 | 70 | 0.630607 |
e8162511ea3f0ab6bcfa961932b8dd5d23159c91 | 302 | py | Python | tests/xlfunctions_vs_excel/xnpv_test.py | ckp95/xlcalculator | 8f3f04a2a0a2ecb12c3d5837a5b13519137ae427 | [
"MIT"
] | 54 | 2020-04-26T09:18:29.000Z | 2022-03-30T08:47:45.000Z | tests/xlfunctions_vs_excel/xnpv_test.py | st-lo/xlcalculator | 19190ec90e948b7ab1eceb06448b96cc1728bc51 | [
"MIT"
] | 41 | 2020-05-04T04:12:36.000Z | 2022-01-31T02:41:05.000Z | tests/xlfunctions_vs_excel/xnpv_test.py | st-lo/xlcalculator | 19190ec90e948b7ab1eceb06448b96cc1728bc51 | [
"MIT"
] | 21 | 2020-05-21T20:49:23.000Z | 2022-02-20T14:15:56.000Z | from .. import testing
class NPVTest(testing.FunctionalTestCase):
filename = "XNPV.xlsx"
def test_evaluation_A1(self):
excel_value = self.evaluator.get_cell_value('Sheet1!A1')
value = self.evaluator.evaluate('Sheet1!A1')
self.assertEqualTruncated(excel_value, value)
| 27.454545 | 64 | 0.711921 |
e81628a1f3071931ca295e94f06cf405bafebf15 | 2,947 | py | Python | tests/test_pydent/test_models/models/test_operation_type.py | aquariumbio/trident | d1712cae544103fb145e3171894e4b35141f6813 | [
"MIT"
] | 5 | 2019-01-21T11:12:05.000Z | 2020-03-05T20:52:14.000Z | tests/test_pydent/test_models/models/test_operation_type.py | aquariumbio/pydent | d1712cae544103fb145e3171894e4b35141f6813 | [
"MIT"
] | 28 | 2020-11-18T02:07:09.000Z | 2021-06-08T15:49:41.000Z | tests/test_pydent/test_models/models/test_operation_type.py | aquariumbio/trident | d1712cae544103fb145e3171894e4b35141f6813 | [
"MIT"
] | 2 | 2021-02-27T19:23:45.000Z | 2021-09-14T10:29:07.000Z | import pytest
from pydent.models import OperationType
# def test_operation_type_codes(session):
# ot = session.OperationType.find(1065)
# ot.codes
#
#
# def test_operation_type_ops(session):
# ot = session.OperationType.find(1065)
# ot.operations
def test_operation_type_field_type(fake_session):
... | 34.267442 | 92 | 0.505599 |
e816341c94438c3c14d7bdba105c8a27f5cf4dc6 | 4,144 | py | Python | postfix_sync/tests/test_mapping.py | wulmer/churchtools-automation | 8fa7e3d96c42a6a03ffc37a269ba3b95a856d83e | [
"MIT"
] | null | null | null | postfix_sync/tests/test_mapping.py | wulmer/churchtools-automation | 8fa7e3d96c42a6a03ffc37a269ba3b95a856d83e | [
"MIT"
] | null | null | null | postfix_sync/tests/test_mapping.py | wulmer/churchtools-automation | 8fa7e3d96c42a6a03ffc37a269ba3b95a856d83e | [
"MIT"
] | null | null | null | import subprocess
import pytest
from postfix_sync import Mapping
def test_parsing_from_file(mapping_file):
mf = Mapping.fromfile(mapping_file)
assert len(mf) == 5
def test_parsing_comment_only():
mf = Mapping.fromtext("# some@alias for@testing\n")
assert len(mf) == 0
mf = Mapping.fromtext(" ... | 32.124031 | 80 | 0.644546 |
e816416ca09d7383d62656daedc0b55a035518d1 | 22,043 | py | Python | alipay/aop/api/domain/AlipayEcoMycarParkingParkinglotinfoUpdateModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/AlipayEcoMycarParkingParkinglotinfoUpdateModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/AlipayEcoMycarParkingParkinglotinfoUpdateModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.BusinessItem import BusinessItem
class AlipayEcoMycarParkingParkinglotinfoUpdateModel(object):
def __init__(self):
self._agent_id = None
self._business_isv = ... | 36.254934 | 105 | 0.62183 |
e81686a3d2b7740b0b5f4b62362350de45b862bc | 1,287 | py | Python | .experiments/swizzlings.py | nmbr73/Fetch-n-Fuse | 3ca8c786e161eeb25650885e35dc7665465142c0 | [
"MIT"
] | null | null | null | .experiments/swizzlings.py | nmbr73/Fetch-n-Fuse | 3ca8c786e161eeb25650885e35dc7665465142c0 | [
"MIT"
] | 10 | 2022-01-13T22:11:34.000Z | 2022-01-29T11:10:03.000Z | .experiments/swizzlings.py | nmbr73/Fetch-n-Fuse | 3ca8c786e161eeb25650885e35dc7665465142c0 | [
"MIT"
] | null | null | null |
# Erzeugt alle Defines fuer alle Swizzlings.
# Quick and dirty - braucht nicht schön sein.
# Der komische Kommentar vor jedem Define ist dazu da,
# daß das 'fuse' nachher nur die tatsächlich benötigten
# defines in die fertige Fuse übernimmt.
chars=['x','y','z','w']
print("#if defined(USE_NATIVE_METAL_IMPL)")
for ... | 28.6 | 130 | 0.561772 |
e81689fadb2cfdcf975b2cdb75e0e51400e3542d | 1,578 | py | Python | helpers/encryption.py | nickdale2021/breezy_google_drive_link | 770b4b8775b1601b2efb51fa189625f1c40786ce | [
"CC0-1.0"
] | null | null | null | helpers/encryption.py | nickdale2021/breezy_google_drive_link | 770b4b8775b1601b2efb51fa189625f1c40786ce | [
"CC0-1.0"
] | null | null | null | helpers/encryption.py | nickdale2021/breezy_google_drive_link | 770b4b8775b1601b2efb51fa189625f1c40786ce | [
"CC0-1.0"
] | null | null | null | from Crypto.Cipher import AES
import os
import base64
block_size = 16
secret = os.environ["ENCRYPTION_SECRET"]
def un_pad(word):
"""
Removes additional padding from string
:param word: <string>
:return: string after removing padding from it <string>
"""
padding_length = ord(word[len(word)... | 29.222222 | 70 | 0.723701 |
e816d2b89d58fc869ff8c89283717aa065e3b16a | 12,911 | py | Python | infra/services/lkgr_finder/__main__.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | infra/services/lkgr_finder/__main__.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 7 | 2022-02-15T01:11:37.000Z | 2022-03-02T12:46:13.000Z | infra/services/lkgr_finder/__main__.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Fetch the latest results for a pre-selected set of builders we care about.
If we find a 'good' revision -- based on criteria exp... | 40.728707 | 80 | 0.614902 |
e816f278fb4ab2e70b5f21239cc19e8d2fe21f14 | 31 | py | Python | btd6_memory_info/generated/System/Net/WebHeaderCollection/web_header_collection.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/System/Net/WebHeaderCollection/web_header_collection.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/System/Net/WebHeaderCollection/web_header_collection.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | class WebHeaderCollection: pass | 31 | 31 | 0.903226 |
e81703b89298e62adef66af68e7c6696801011d3 | 61,671 | py | Python | cinder/tests/unit/volume/drivers/synology/test_synology_common.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/volume/drivers/synology/test_synology_common.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | 2 | 2018-10-25T13:04:01.000Z | 2019-08-17T13:15:24.000Z | cinder/tests/unit/volume/drivers/synology/test_synology_common.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | 2 | 2018-10-17T13:32:50.000Z | 2018-11-08T08:39:39.000Z | # Copyright (c) 2016 Synology Co., Ltd.
# 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 re... | 37.017407 | 79 | 0.523958 |
e8170c1d5a7ad82844a59a49d9bba7d30912dc37 | 1,359 | py | Python | var/spack/repos/builtin/packages/r-pkgbuild/package.py | kehw/spack | 4f49b1a9301447a8cf880c99820cad65e5c2d7e3 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2020-09-10T22:50:08.000Z | 2021-01-12T22:18:54.000Z | var/spack/repos/builtin/packages/r-pkgbuild/package.py | kehw/spack | 4f49b1a9301447a8cf880c99820cad65e5c2d7e3 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2021-01-08T22:23:53.000Z | 2022-03-30T11:08:17.000Z | var/spack/repos/builtin/packages/r-pkgbuild/package.py | kehw/spack | 4f49b1a9301447a8cf880c99820cad65e5c2d7e3 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class RPkgbuild(RPackage):
"""pkgbuild: Find Tools Needed to Build R Packages"""
homepage =... | 45.3 | 95 | 0.679912 |
e817132c4b7bd0855f237ccdbc36d944dfcecc35 | 7,741 | py | Python | tests/test_tidyr_pivot_wide.py | stjordanis/datar | 4e2b5db026ad35918954576badef9951928c0cb1 | [
"MIT"
] | 110 | 2021-03-09T04:10:40.000Z | 2022-03-13T10:28:20.000Z | tests/test_tidyr_pivot_wide.py | sthagen/datar | 1218a549e2f0547c7b5a824ca6d9adf1bf96ba46 | [
"MIT"
] | 54 | 2021-06-20T18:53:44.000Z | 2022-03-29T22:13:07.000Z | tests/test_tidyr_pivot_wide.py | sthagen/datar | 1218a549e2f0547c7b5a824ca6d9adf1bf96ba46 | [
"MIT"
] | 11 | 2021-06-18T03:03:14.000Z | 2022-02-25T11:48:26.000Z | # tests grabbed from:
# https://github.com/tidyverse/tidyr/blob/HEAD/tests/testthat/test-pivot-wide.R
import pytest
from datar.all import *
from datar.core.exceptions import ColumnNotExistingError
from pandas.testing import assert_frame_equal
from .conftest import assert_iterable_equal
def test_can_pivot_all_cols_to_w... | 35.672811 | 99 | 0.582095 |
e817276b4635e0ed4a3a7c79ef5b8dc627d4b113 | 7,072 | py | Python | py/axonchisel/metrics/run/servant/servant.py | axonchisel/ax_metrics | a2db75c9ef9a9752997ccb112e8db68c1c8584a0 | [
"MIT"
] | 10 | 2016-08-26T18:57:28.000Z | 2021-09-19T19:21:16.000Z | py/axonchisel/metrics/run/servant/servant.py | axonchisel/ax_metrics | a2db75c9ef9a9752997ccb112e8db68c1c8584a0 | [
"MIT"
] | 1 | 2015-01-08T19:54:54.000Z | 2015-01-09T01:24:17.000Z | py/axonchisel/metrics/run/servant/servant.py | axonchisel/ax_metrics | a2db75c9ef9a9752997ccb112e8db68c1c8584a0 | [
"MIT"
] | 3 | 2015-01-08T23:32:58.000Z | 2016-09-23T02:38:26.000Z | """
Ax_Metrics - Servant Main Controller - Recommended Ax_Metrics Public Interface
------------------------------------------------------------------------------
Author: Dan Kamins <dos at axonchisel dot net>
Copyright (c) 2014 Dan Kamins, AxonChisel.net
"""
# --------------------------------------------------------... | 32.292237 | 80 | 0.61496 |
e8172abb6c45a85e3635a3a92285ae0802c88ddf | 2,202 | py | Python | octoeb/utils/config.py | com4/octoeb | 590a4dc03cb75d2037f002fcc7ff79cf2da6142b | [
"MIT"
] | null | null | null | octoeb/utils/config.py | com4/octoeb | 590a4dc03cb75d2037f002fcc7ff79cf2da6142b | [
"MIT"
] | null | null | null | octoeb/utils/config.py | com4/octoeb | 590a4dc03cb75d2037f002fcc7ff79cf2da6142b | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import os
import sys
import six
logger = logging.getLogger(__name__)
CACHE = {}
def get_config(validate=True):
"""Read octoeb configs.
Return... | 27.873418 | 89 | 0.673025 |
e81749b0554a790f17e6318509e93fd93d7d5e24 | 522 | py | Python | setup.py | buckbaskin/couchpotato | 238305b8d1d8e8ac3accfc2e62c4adda2da655e1 | [
"MIT"
] | null | null | null | setup.py | buckbaskin/couchpotato | 238305b8d1d8e8ac3accfc2e62c4adda2da655e1 | [
"MIT"
] | 1 | 2017-09-21T20:15:35.000Z | 2017-09-21T20:15:35.000Z | setup.py | buckbaskin/couchpotato | 238305b8d1d8e8ac3accfc2e62c4adda2da655e1 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
'''
PyPI setup.py file
'''
from distutils.core import setup
ver = '0.1.1'
setup(name='couchpotato',
packages=['couchpotato'],
version=ver,
description='Module for lazily evaluating Python functions',
author='Buck Baskin',
author_email='mobile.wbaskin+pypi@gmail.com... | 26.1 | 80 | 0.664751 |
e81758126601063f24803d1f30bf48f74120065a | 33,450 | py | Python | aslprep/workflows/asl/resampling.py | lawlessrd/aslprep | 22ec61f482cc3561f4fd35d769af0fe8bc2e80cb | [
"BSD-3-Clause"
] | 2 | 2022-03-18T18:31:12.000Z | 2022-03-18T18:31:26.000Z | aslprep/workflows/asl/resampling.py | kha-dija1/aslprep | ce1ed4a8fa23f64aaa7d6bb0977582586e6a7039 | [
"BSD-3-Clause"
] | null | null | null | aslprep/workflows/asl/resampling.py | kha-dija1/aslprep | ce1ed4a8fa23f64aaa7d6bb0977582586e6a7039 | [
"BSD-3-Clause"
] | null | null | null | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Resampling workflows
++++++++++++++++++++
.. autofunction:: init_asl_surf_wf
.. autofunction:: init_asl_std_trans_wf
.. autofunction:: init_asl_preproc_trans_wf
"""
from ...config import DEFAULT_MEMOR... | 40.252708 | 100 | 0.632496 |
e8177189ccf9ef4722a68bbf9c25aaa70ab7008f | 1,509 | py | Python | tools/dockerize/webportal/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/compat/utils.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | 1 | 2019-09-11T11:56:19.000Z | 2019-09-11T11:56:19.000Z | tools/dockerize/webportal/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/compat/utils.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | null | null | null | tools/dockerize/webportal/usr/lib/python2.7/site-packages/oslo_db/sqlalchemy/compat/utils.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | null | null | null | # 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, software
# d... | 33.533333 | 78 | 0.698476 |
e8177c06de9ef355be7d3e62ab49a09040b8e0ea | 4,254 | py | Python | Recommender/build.py | teamclouday/Mooner | ed7deed101e92b1d8f5ec47091cdbdadb2c1159c | [
"MIT"
] | null | null | null | Recommender/build.py | teamclouday/Mooner | ed7deed101e92b1d8f5ec47091cdbdadb2c1159c | [
"MIT"
] | null | null | null | Recommender/build.py | teamclouday/Mooner | ed7deed101e92b1d8f5ec47091cdbdadb2c1159c | [
"MIT"
] | null | null | null | # This file will build a database for each of the ids in crawled csv
# How it works
# For each of the ids, read through the tweets
# run Sentiment model and Topic model on them
# calculate a representative value for these features
# store the result into a database (could be a csv file)
from model import *
# define t... | 42.118812 | 96 | 0.439586 |
e8178f3a744a85504308b095b200617f0faa6fcb | 1,459 | py | Python | event/PeriodicEvent.py | adhocmaster/pyns | 607feb56baf0900535130195163eac331e131a2e | [
"MIT"
] | 1 | 2021-06-15T06:21:14.000Z | 2021-06-15T06:21:14.000Z | event/PeriodicEvent.py | adhocmaster/pyns | 607feb56baf0900535130195163eac331e131a2e | [
"MIT"
] | null | null | null | event/PeriodicEvent.py | adhocmaster/pyns | 607feb56baf0900535130195163eac331e131a2e | [
"MIT"
] | 1 | 2021-06-15T06:21:18.000Z | 2021-06-15T06:21:18.000Z | from event.GenericEvent import GenericEvent
class PeriodicEvent(GenericEvent):
"""This is a periodic event like above, except that it has
an optional maximum number of occurrences."""
def __init__(self, name, time, periodicity, num_occurrences=None):
"""
Let's document this constructor a ... | 38.394737 | 77 | 0.622344 |
e817921ac181a06f8abb8462da0232805559c8c9 | 6,614 | py | Python | gcn/models.py | jindi-tju/MRFasGCN | 41b94278b80bbcb256097a5a3dfb6a433d9dbdc7 | [
"MIT"
] | 2 | 2021-06-20T03:34:09.000Z | 2022-03-24T07:22:56.000Z | gcn/models.py | jindi-tju/MRFasGCN | 41b94278b80bbcb256097a5a3dfb6a433d9dbdc7 | [
"MIT"
] | null | null | null | gcn/models.py | jindi-tju/MRFasGCN | 41b94278b80bbcb256097a5a3dfb6a433d9dbdc7 | [
"MIT"
] | 1 | 2022-03-17T01:26:07.000Z | 2022-03-17T01:26:07.000Z | from gcn.layers import *
from gcn.metrics import *
flags = tf.app.flags
FLAGS = flags.FLAGS
class Model(object):
def __init__(self, **kwargs):
allowed_kwargs = {'name', 'logging'}
for kwarg in kwargs.keys():
assert kwarg in allowed_kwargs, 'Invalid keyword argument: ' + kwarg
... | 34.994709 | 112 | 0.530995 |
e81797849d09b7b4c2dd30e1378764c113322c36 | 2,942 | py | Python | LRB_Core.py | tyrope/lionroarbot | 3696436f89571461c2c79bb0b09ba0a02a23fa69 | [
"EFL-2.0"
] | 3 | 2015-01-14T07:07:10.000Z | 2016-05-11T03:48:23.000Z | LRB_Core.py | tyrope/lionroarbot | 3696436f89571461c2c79bb0b09ba0a02a23fa69 | [
"EFL-2.0"
] | 9 | 2015-03-15T10:01:09.000Z | 2019-08-22T23:49:42.000Z | LRB_Core.py | tyrope/lionroarbot | 3696436f89571461c2c79bb0b09ba0a02a23fa69 | [
"EFL-2.0"
] | null | null | null | #coding: utf8
"""
LRB-Core.py - LionRoarBot Core module.
Copyright 2014-2015, Dimitri "Tyrope" Molenaars <tyrope@tyrope.nl>
Licensed under the Eiffel Forum License 2.
These modules are built on top of the Sopel system.
http://sopel.chat/
"""
from sopel.tools import SopelMemory
from sopel.module import commands, event... | 36.320988 | 120 | 0.616247 |
e817b06bfa9c709e124d648b2af2556f38bed2f6 | 315 | py | Python | foxtail/clinics/migrations/0002_remove_clinic_slug.py | scottbarnes/foxtail | b9faf95ad622d7aa967288698018202cc22b4893 | [
"MIT"
] | 5 | 2021-01-17T22:55:24.000Z | 2021-01-18T21:05:18.000Z | foxtail/clinics/migrations/0002_remove_clinic_slug.py | scottbarnes/foxtail | b9faf95ad622d7aa967288698018202cc22b4893 | [
"MIT"
] | null | null | null | foxtail/clinics/migrations/0002_remove_clinic_slug.py | scottbarnes/foxtail | b9faf95ad622d7aa967288698018202cc22b4893 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.5 on 2020-05-04 17:31
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('clinics', '0001_initial'),
]
operations = [
migrations.RemoveField(
model_name='clinic',
name='slug',
),
]
| 17.5 | 47 | 0.574603 |
e817bbdd42bd3167de52d1288c3ca52713d26ef4 | 11,147 | py | Python | python/doc/conf.py | DonaldFoss/ApacheArrow | 4226adfbc6b3dff10b3fe7a6691b30bcc94140bd | [
"Apache-2.0"
] | 2 | 2017-02-16T18:56:56.000Z | 2019-04-15T05:24:26.000Z | python/doc/conf.py | DonaldFoss/ApacheArrow | 4226adfbc6b3dff10b3fe7a6691b30bcc94140bd | [
"Apache-2.0"
] | 1 | 2019-06-26T14:03:22.000Z | 2019-06-26T14:40:19.000Z | python/doc/conf.py | DonaldFoss/ApacheArrow | 4226adfbc6b3dff10b3fe7a6691b30bcc94140bd | [
"Apache-2.0"
] | 1 | 2019-06-27T22:17:43.000Z | 2019-06-27T22:17:43.000Z | # -*- coding: utf-8 -*-
#
# 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... | 29.489418 | 80 | 0.707993 |
e817befc6e86edcd3e89d8c72c4e9354c100e951 | 8,336 | py | Python | BigGAN_128.py | Mistobaan/BigGAN-TPU-TensorFlow | 0abb339aef8d69ee8deddf0c0be4e9a165753c23 | [
"MIT"
] | null | null | null | BigGAN_128.py | Mistobaan/BigGAN-TPU-TensorFlow | 0abb339aef8d69ee8deddf0c0be4e9a165753c23 | [
"MIT"
] | null | null | null | BigGAN_128.py | Mistobaan/BigGAN-TPU-TensorFlow | 0abb339aef8d69ee8deddf0c0be4e9a165753c23 | [
"MIT"
] | null | null | null | import time
from ops import *
from utils import *
from tensorflow.contrib.data import prefetch_to_device, shuffle_and_repeat, map_and_batch
from tensorflow.contrib.opt import MovingAverageOptimizer
import logging
logger = logging.getLogger(__name__)
class BigGAN_128(object):
def __init__(self, args):
pass
####... | 32.310078 | 152 | 0.621761 |
e817dcd5358510e77b0b92386ba4b64cb494786c | 2,513 | py | Python | src/trainers/simple_trainer.py | MohamedAli1995/Cifar-100-Classifier | 924704a81ce13062825a88b90b80e8ac2ba45d63 | [
"MIT"
] | 2 | 2019-05-12T16:11:20.000Z | 2020-04-10T22:39:57.000Z | src/trainers/simple_trainer.py | MohamedAli1995/Cifar-100-Classifier | 924704a81ce13062825a88b90b80e8ac2ba45d63 | [
"MIT"
] | null | null | null | src/trainers/simple_trainer.py | MohamedAli1995/Cifar-100-Classifier | 924704a81ce13062825a88b90b80e8ac2ba45d63 | [
"MIT"
] | null | null | null | from src.base.base_train import BaseTrain
from tqdm import tqdm
import numpy as np
class SimpleTrainer(BaseTrain):
def __init__(self, sess, model, data, config, logger):
super(SimpleTrainer, self).__init__(sess, model, data, config, logger)
def train_epoch(self):
loop = tqdm(range(self.data.n... | 34.902778 | 108 | 0.577 |
e817e6133419c3ac9402ca126bee8583f80ce619 | 254 | py | Python | tests/component/test_render_component.py | pauleveritt/wired_components | a9072d5fc48680d5ff895887842ffd0f06bc0081 | [
"MIT"
] | 1 | 2019-09-15T12:30:44.000Z | 2019-09-15T12:30:44.000Z | tests/component/test_render_component.py | pauleveritt/wired_components | a9072d5fc48680d5ff895887842ffd0f06bc0081 | [
"MIT"
] | null | null | null | tests/component/test_render_component.py | pauleveritt/wired_components | a9072d5fc48680d5ff895887842ffd0f06bc0081 | [
"MIT"
] | null | null | null | def test_render_component(txn_container):
from wired_components.component import render_component
result = render_component(
txn_container,
'Breadcrumb',
label='somelabel9'
)
assert result == 'label is somelabel9'
| 28.222222 | 59 | 0.69685 |
e8181f42a816de938146348a8b884f4be2c9a199 | 10,329 | py | Python | apysc/_animation/animation_parallel.py | ynsnf/apysc | b10ffaf76ec6beb187477d0a744fca00e3efc3fb | [
"MIT"
] | null | null | null | apysc/_animation/animation_parallel.py | ynsnf/apysc | b10ffaf76ec6beb187477d0a744fca00e3efc3fb | [
"MIT"
] | null | null | null | apysc/_animation/animation_parallel.py | ynsnf/apysc | b10ffaf76ec6beb187477d0a744fca00e3efc3fb | [
"MIT"
] | null | null | null | """Class implementation for the parallel animation value.
"""
import re
from typing import Generic
from typing import List
from typing import Match
from typing import Optional
from typing import TypeVar
from typing import Union
from apysc._animation.animation_base import AnimationBase
from apysc._animatio... | 36.62766 | 79 | 0.558815 |
e8186b3b76073a18e34acd8d35f3108cca6b15b9 | 994 | py | Python | webapp/flask-tdd-docker/project/tests/test_admin.py | zeroam/build-your-own-x | e7932cd25145aa3c347511db6846b1242dbb30eb | [
"MIT"
] | null | null | null | webapp/flask-tdd-docker/project/tests/test_admin.py | zeroam/build-your-own-x | e7932cd25145aa3c347511db6846b1242dbb30eb | [
"MIT"
] | 5 | 2021-04-08T21:59:04.000Z | 2022-02-10T14:19:59.000Z | webapp/flask-tdd-docker/project/tests/test_admin.py | zeroam/build-your-own-x | e7932cd25145aa3c347511db6846b1242dbb30eb | [
"MIT"
] | null | null | null | import os
from project import create_app, db
def test_admin_view_dev():
os.environ["FLASK_ENV"] = "development"
assert os.getenv("FLASK_ENV") == "development"
app = create_app()
app.config.from_object("project.config.TestingConfig")
with app.app_context():
db.session.remove()
db.d... | 29.235294 | 58 | 0.636821 |
e818816a2a6ba2d7570627ee960fe07333a6aba2 | 1,568 | py | Python | setup.py | cryptomental/python-goloslib | 0766f9b48e478bc3cdd18b22a6b5867b82a9f81e | [
"MIT"
] | 1 | 2017-04-08T05:08:35.000Z | 2017-04-08T05:08:35.000Z | setup.py | cryptomental/python-goloslib | 0766f9b48e478bc3cdd18b22a6b5867b82a9f81e | [
"MIT"
] | null | null | null | setup.py | cryptomental/python-goloslib | 0766f9b48e478bc3cdd18b22a6b5867b82a9f81e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from setuptools import setup
from pip.req import parse_requirements
# Work around mbcs bug in distutils.
# http://bugs.python.org/issue10945
import codecs
try:
codecs.lookup('mbcs')
except LookupError:
ascii = codecs.lookup('ascii')
codecs.register(lambda name, enc=ascii: {True: enc}... | 35.636364 | 78 | 0.594388 |
e818a75c13bb2777b1739d23cc4dd1e0c1753c43 | 1,967 | py | Python | fusionsid/filter.py | FusionSid/FusionSidAPI.py | e1b50622bf4fcec8265f8fd4e9b3ac79b580d286 | [
"MIT"
] | 5 | 2022-03-05T23:29:33.000Z | 2022-03-20T07:44:20.000Z | fusionsid/filter.py | FusionSid/FusionSidAPI.py | e1b50622bf4fcec8265f8fd4e9b3ac79b580d286 | [
"MIT"
] | null | null | null | fusionsid/filter.py | FusionSid/FusionSidAPI.py | e1b50622bf4fcec8265f8fd4e9b3ac79b580d286 | [
"MIT"
] | null | null | null | from typing import Literal
from datetime import datetime
from .http import HTTPClient
from .image import BaseImage
class FilteredImage(BaseImage):
"""The filtered image"""
def __init__(self, image_bytes) -> None:
super().__init__(image_bytes=image_bytes)
self.created_at = datetime.now()
cl... | 26.226667 | 121 | 0.553635 |
e818b45061a571e80095364f642419988952c186 | 1,455 | py | Python | data/transcoder_evaluation_gfg/python/MINIMUM_INCREMENT_K_OPERATIONS_MAKE_ELEMENTS_EQUAL.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 241 | 2021-07-20T08:35:20.000Z | 2022-03-31T02:39:08.000Z | data/transcoder_evaluation_gfg/python/MINIMUM_INCREMENT_K_OPERATIONS_MAKE_ELEMENTS_EQUAL.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 49 | 2021-07-22T23:18:42.000Z | 2022-03-24T09:15:26.000Z | data/transcoder_evaluation_gfg/python/MINIMUM_INCREMENT_K_OPERATIONS_MAKE_ELEMENTS_EQUAL.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 71 | 2021-07-21T05:17:52.000Z | 2022-03-29T23:49:28.000Z | # Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
def f_gold ( arr , n , k ) :
max1 = max ( arr )
res = 0
for i in range ( 0 , n ) :
if ( ( max1 - arr [ i ] )... | 38.289474 | 138 | 0.527148 |
e818d71d94e3130b95ecdc75ec3fccdc55618505 | 15,018 | py | Python | packages/vaex-core/vaex/settings.py | And0k/vaex | 298d0d5c6ace0ea4c335339fef10ba7ee54cc077 | [
"MIT"
] | 337 | 2016-02-11T07:36:35.000Z | 2018-12-10T07:17:35.000Z | packages/vaex-core/vaex/settings.py | And0k/vaex | 298d0d5c6ace0ea4c335339fef10ba7ee54cc077 | [
"MIT"
] | 127 | 2016-07-06T15:43:14.000Z | 2018-12-11T18:46:27.000Z | packages/vaex-core/vaex/settings.py | And0k/vaex | 298d0d5c6ace0ea4c335339fef10ba7ee54cc077 | [
"MIT"
] | 29 | 2016-10-05T14:15:28.000Z | 2018-11-29T10:17:00.000Z | import os
import logging
import vaex.utils
import collections
import json
import multiprocessing
import sys
from pydantic import BaseModel, BaseSettings, Field
from typing import List, Union, Optional, Dict
from enum import Enum
from .config import ConfigDefault
logger = logging.getLogger("vaex.settings")
_default_h... | 40.048 | 246 | 0.651818 |
e818d9fdca52070fc633f3c03efbeb55574968e8 | 53 | py | Python | snake/__init__.py | uaiuaief/Machine-Learning-for-Snake-Game | 1a36ef4468eea9f80f44fb1b8d115790262320c5 | [
"MIT"
] | null | null | null | snake/__init__.py | uaiuaief/Machine-Learning-for-Snake-Game | 1a36ef4468eea9f80f44fb1b8d115790262320c5 | [
"MIT"
] | null | null | null | snake/__init__.py | uaiuaief/Machine-Learning-for-Snake-Game | 1a36ef4468eea9f80f44fb1b8d115790262320c5 | [
"MIT"
] | null | null | null | from snake.main import SnakeAPP
app = SnakeAPP()
| 13.25 | 32 | 0.716981 |
e818e1abd5589864e8e65ad57a01aa1c324291b3 | 1,230 | py | Python | data/county_level/raw/ahrf_health/download.py | Alicegif/covid19-severity-prediction | adb3f483e00444949aaaa46830b0cb5531525cfa | [
"MIT"
] | 2 | 2020-05-15T14:42:02.000Z | 2020-05-22T08:51:47.000Z | data_new/county_level/raw/ahrf_health/download.py | rahul263-stack/covid19-severity-prediction | f581adb2fccb12d5ab3f3c59ee120f484703edf5 | [
"MIT"
] | null | null | null | data_new/county_level/raw/ahrf_health/download.py | rahul263-stack/covid19-severity-prediction | f581adb2fccb12d5ab3f3c59ee120f484703edf5 | [
"MIT"
] | null | null | null | #! /usr/bin/python3
import pandas as pd
import os
from sas7bdat import SAS7BDAT
import AHRF_parser
# download raw data files
os.system("wget https://data.hrsa.gov//DataDownload/AHRF/AHRF_2018-2019_SAS.zip -O ahrf_raw_sas.zip")
os.system("unzip ahrf_raw_sas.zip")
os.system("wget https://data.hrsa.gov//DataDownload/AHRF... | 34.166667 | 101 | 0.686992 |
e818e981e8dfad0e272a1faac029f47f23c5b00d | 1,819 | py | Python | unit_tests/glhe/aggregation/test_sub_hourly_method.py | stianchris/GLHE | 80c3eecca81ffd50d5077f87027c9441292452f5 | [
"MIT"
] | 2 | 2018-11-06T08:04:04.000Z | 2020-10-09T14:52:36.000Z | unit_tests/glhe/aggregation/test_sub_hourly_method.py | stianchris/GLHE | 80c3eecca81ffd50d5077f87027c9441292452f5 | [
"MIT"
] | 68 | 2018-03-27T01:43:22.000Z | 2019-09-09T12:05:44.000Z | unit_tests/glhe/aggregation/test_sub_hourly_method.py | mitchute/GLHE | 80c3eecca81ffd50d5077f87027c9441292452f5 | [
"MIT"
] | 4 | 2018-05-24T03:02:44.000Z | 2021-08-16T13:54:09.000Z | import os
import tempfile
import unittest
from glhe.aggregation.sub_hourly import SubHour
class TestSubHourMethod(unittest.TestCase):
@staticmethod
def add_instance():
temp_dir = tempfile.mkdtemp()
temp_csv = os.path.join(temp_dir, 'temp.csv')
with open(temp_csv, 'w') as f:
... | 22.7375 | 53 | 0.518417 |
e819fec9271127e5a5b2279f94e3e4d0f16ed995 | 3,973 | py | Python | alipay/aop/api/request/AlipayPayAppChannelPreconsultRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/request/AlipayPayAppChannelPreconsultRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/request/AlipayPayAppChannelPreconsultRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayPayAppChannelPreconsultModel import AlipayPayAppChannelPreconsultModel
class AlipayPayAppChannelPreconsultRequest(object):
... | 27.4 | 148 | 0.644853 |
e81a2e00872433199688e0413be0fffe2d4e871d | 1,097 | py | Python | bfc/opt/initialmemory.py | staceb/esotope-bfc | 0f4992cce44f3fbf1046ec1c6c981bc4fad023f7 | [
"MIT"
] | 25 | 2015-08-24T11:40:10.000Z | 2022-03-24T03:11:25.000Z | bfc/opt/initialmemory.py | staceb/esotope-bfc | 0f4992cce44f3fbf1046ec1c6c981bc4fad023f7 | [
"MIT"
] | 30 | 2017-11-22T16:01:15.000Z | 2017-11-22T16:10:27.000Z | bfc/opt/initialmemory.py | staceb/esotope-bfc | 0f4992cce44f3fbf1046ec1c6c981bc4fad023f7 | [
"MIT"
] | 2 | 2018-11-08T15:04:11.000Z | 2021-01-26T17:24:13.000Z | # This is a part of Esotope Brainfuck Compiler.
from bfc.nodes import *
from bfc.expr import *
from bfc.cond import *
from bfc.opt.base import BaseOptimizerPass, Transformer
class OptimizerPass(BaseOptimizerPass):
# adds redundant SetMemory nodes for later passes. other passes don't know
# about initial memo... | 30.472222 | 82 | 0.625342 |
e81a577a6c09a26d8c6e5b4721c0c3a42a663608 | 797 | py | Python | 2019/day15.py | gcalmettes/AdventOfCode2017 | 374347c981b603981b7d0b21dad3fc594b126c82 | [
"MIT"
] | 1 | 2021-12-12T22:59:49.000Z | 2021-12-12T22:59:49.000Z | 2019/day15.py | gcalmettes/AdventOfCode2017 | 374347c981b603981b7d0b21dad3fc594b126c82 | [
"MIT"
] | null | null | null | 2019/day15.py | gcalmettes/AdventOfCode2017 | 374347c981b603981b7d0b21dad3fc594b126c82 | [
"MIT"
] | 1 | 2019-12-03T05:37:49.000Z | 2019-12-03T05:37:49.000Z | """
https://adventofcode.com/2019/day/15
"""
from typing import Tuple, List, NamedTuple
from intcodeComputer import IntcodeComputer
from collections import defaultdict
from enum import Enum
class Direction:
NORTH: int=1
SOUTH: int=2
WEST: int=3
EAST: int=4
def find_oxygen(program):
paths = []
# ... | 18.97619 | 59 | 0.648683 |
e81a5c9c3c12d12f36989913a37b9a6c74603350 | 4,392 | py | Python | test/test_v1_extra_wechatpay_jsapi_config.py | justapnet/justap-server-sdk-python | 2d3110c6447833334fa2f7e93ffa63e06913df17 | [
"Apache-2.0"
] | null | null | null | test/test_v1_extra_wechatpay_jsapi_config.py | justapnet/justap-server-sdk-python | 2d3110c6447833334fa2f7e93ffa63e06913df17 | [
"Apache-2.0"
] | null | null | null | test/test_v1_extra_wechatpay_jsapi_config.py | justapnet/justap-server-sdk-python | 2d3110c6447833334fa2f7e93ffa63e06913df17 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Justap API
欢迎阅读 Justap Api 文档 Justap 是为移动端应用和PC端应用打造的下一代聚合支付SAAS服务平台,通过一个 SDK 即可快速的支持各种形式的应用,并且一次接口完成多个不同支付渠道的接入。平台除了支持服务商子商户模式,同时还对商家自有商户(即自己前往微信、支付宝等机构开户)提供了完整的支持。 感谢您的支持,我们将不断探索,为您提供更优质的服务!如需技术支持可前往商户中心提交工单,支持工程师会尽快与您取得联系! # 文档说明 采用 REST 风格设计。所有接口请求地址都是可预期的以及面向资源的。使用规范的 HTTP 响应代码来表示请... | 107.121951 | 3,404 | 0.772769 |
e81a6bfb80ac35d45d4178ce9184dfa117d0874c | 1,865 | py | Python | Element_Analytics/libs/analytics/logpreprocessor.py | drproduck/Element-Analytics | aa1a77578e6401b4e82ce9fe9072c796496d878d | [
"MIT"
] | 1 | 2019-12-09T09:43:30.000Z | 2019-12-09T09:43:30.000Z | Element_Analytics/libs/analytics/logpreprocessor.py | drproduck/Element-Analytics | aa1a77578e6401b4e82ce9fe9072c796496d878d | [
"MIT"
] | 37 | 2018-02-04T04:41:46.000Z | 2018-04-29T20:39:09.000Z | Element_Analytics/libs/analytics/logpreprocessor.py | drproduck/Element-Analytics | aa1a77578e6401b4e82ce9fe9072c796496d878d | [
"MIT"
] | null | null | null | """
This module processes csv's file and return a
pandas dataframe for analytics module to work with
"""
import libs.utilities.pathtools as pt
import os
import pandas as pd
# import time
from libs.analytics.datetable import DATE_TABLE
class LogNotFoundException(Exception):
""" Custom exception when
a log ... | 30.57377 | 92 | 0.659517 |
e81a71ea5817d592e50b0d143208bb84290914e2 | 3,406 | py | Python | batchglm/train/tf/glm_nb/model.py | SabrinaRichter/batchglm | 2da429f895f7eb577a835da334f4ae146a9422ce | [
"BSD-3-Clause"
] | null | null | null | batchglm/train/tf/glm_nb/model.py | SabrinaRichter/batchglm | 2da429f895f7eb577a835da334f4ae146a9422ce | [
"BSD-3-Clause"
] | null | null | null | batchglm/train/tf/glm_nb/model.py | SabrinaRichter/batchglm | 2da429f895f7eb577a835da334f4ae146a9422ce | [
"BSD-3-Clause"
] | null | null | null | import logging
import tensorflow as tf
import numpy as np
from .external import ProcessModelGLM, ModelVarsGLM, BasicModelGraphGLM
from .external import pkg_constants
logger = logging.getLogger(__name__)
class ProcessModel(ProcessModelGLM):
def param_bounds(
self,
dtype
):
... | 31.537037 | 79 | 0.559894 |
e81a8f21341f8f6b970b3aa58f7e3194e5bdb3e3 | 691 | py | Python | smallab/utilities/experiment_loading/experiment_loader.py | octopuscabbage/smallab | 0be3d49e7b9e81fd8104aba81eb1410b1593b585 | [
"BSD-2-Clause"
] | 5 | 2019-11-01T20:55:40.000Z | 2021-06-17T06:15:32.000Z | smallab/utilities/experiment_loading/experiment_loader.py | octopuscabbage/smallab | 0be3d49e7b9e81fd8104aba81eb1410b1593b585 | [
"BSD-2-Clause"
] | 58 | 2019-11-01T18:02:20.000Z | 2021-08-31T21:54:41.000Z | smallab/utilities/experiment_loading/experiment_loader.py | octopuscabbage/smallab | 0be3d49e7b9e81fd8104aba81eb1410b1593b585 | [
"BSD-2-Clause"
] | 2 | 2020-05-06T23:29:05.000Z | 2020-10-07T05:07:09.000Z | import json
import pickle
import os
from tqdm import tqdm
from smallab.file_locations import get_experiment_save_directory
def experiment_iterator(name,use_tqdm=False):
iterator = os.walk(get_experiment_save_directory(name))
if use_tqdm:
iterator = tqdm(list(iterator), desc="Loading Experiments")
... | 30.043478 | 67 | 0.623734 |
e81aa369d2688d584d982795cca53ef30682a590 | 982 | py | Python | tests/jsonlint.py | nickrusso42518/narc | f79c21b24d7f5538d45a383763bbd6c6db966299 | [
"BSD-3-Clause"
] | 43 | 2019-12-21T20:06:28.000Z | 2022-03-16T14:36:25.000Z | tests/jsonlint.py | ccie59071/narc | f79c21b24d7f5538d45a383763bbd6c6db966299 | [
"BSD-3-Clause"
] | 27 | 2019-12-21T21:50:12.000Z | 2021-01-27T15:59:38.000Z | tests/jsonlint.py | ccie59071/narc | f79c21b24d7f5538d45a383763bbd6c6db966299 | [
"BSD-3-Clause"
] | 8 | 2020-04-10T20:10:22.000Z | 2021-12-29T18:39:07.000Z | #!/usr/bin/env python
"""
Author: Nick Russo
Purpose: Trivial JSON linter to run before connecting to network devices.
"""
import os
import json
import sys
def main():
"""
Find all JSON files and ensure they are formatted correctly.
"""
path = "host_vars/"
failed = False
# For every JSON f... | 23.95122 | 75 | 0.568228 |
e81aa792dadb18d250b2ac16d603dcd6a60f2cb6 | 3,368 | py | Python | taskflow/tests/unit/worker_based/test_types.py | JonasMie/taskflow | 942bb76d9cf69a87e7c78f0e231ce9b94e69bb37 | [
"Apache-2.0"
] | 299 | 2015-01-11T01:36:28.000Z | 2022-03-11T08:56:27.000Z | taskflow/tests/unit/worker_based/test_types.py | JonasMie/taskflow | 942bb76d9cf69a87e7c78f0e231ce9b94e69bb37 | [
"Apache-2.0"
] | 4 | 2015-02-06T11:12:58.000Z | 2018-10-19T18:55:58.000Z | taskflow/tests/unit/worker_based/test_types.py | jimbobhickville/taskflow | 6ea991ce94f5be46b7e4726b4c4f014e10407786 | [
"Apache-2.0"
] | 67 | 2015-01-11T14:34:24.000Z | 2022-01-14T02:57:03.000Z | # -*- coding: utf-8 -*-
# Copyright (C) 2014 Yahoo! 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... | 42.1 | 78 | 0.668646 |
e81aa878b5e937860143947a65e9673ffc5e21e1 | 101,238 | py | Python | MedTAG_Dockerized/MedTAG_sket_dock_App/utils_download.py | MedTAG/medtag-core | f2dae7b38230179d71babede7e4910631d91053f | [
"MIT"
] | 6 | 2021-12-20T12:15:17.000Z | 2022-02-02T15:28:42.000Z | MedTAG_Dockerized/MedTAG_sket_dock_App/utils_download.py | MedTAG/medtag-core | f2dae7b38230179d71babede7e4910631d91053f | [
"MIT"
] | 1 | 2022-03-07T14:57:44.000Z | 2022-03-11T18:11:55.000Z | MedTAG_Dockerized/MedTAG_sket_dock_App/utils_download.py | MedTAG/medtag-core | f2dae7b38230179d71babede7e4910631d91053f | [
"MIT"
] | 2 | 2021-05-29T09:44:38.000Z | 2021-12-28T03:53:40.000Z | import psycopg2
import csv
from MedTAG_sket_dock_App.utils import *
from bioc import *
from datetime import date
"""This file manages the creation of the files to be downloaded by the users"""
def generate_bioc(json_keys,json_keys_to_ann,username,action,language,usecase,institute,form,annotation_mode,report_type,bat... | 70.158004 | 1,063 | 0.555128 |
e81ab538cc8a1efa3553ccd704357ea9bed99137 | 3,241 | py | Python | core/agent.py | sld/dp-agent | 02729887f8db3c99ac2c6a3e5e7be7fa6849a1ba | [
"Apache-2.0"
] | null | null | null | core/agent.py | sld/dp-agent | 02729887f8db3c99ac2c6a3e5e7be7fa6849a1ba | [
"Apache-2.0"
] | null | null | null | core/agent.py | sld/dp-agent | 02729887f8db3c99ac2c6a3e5e7be7fa6849a1ba | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
from typing import Sequence, Hashable, Any, TypeVar, Callable, List, Dict
from itertools import compress
import operator
from core.service import Service
from core.state_manager import StateManager, get_state
from core.skill_manager import SkillManager
from core.hardcode_utterances import... | 48.373134 | 111 | 0.707189 |
e81ab76aeb0dc2c2631b0166e0acaebb2807efe9 | 572 | py | Python | shelter/migrations/0015_sheltergallery.py | kermox/schronisko-krakow | 8f8c546894e4b683ce463debad27db72ef820f90 | [
"MIT"
] | 1 | 2020-11-17T18:50:44.000Z | 2020-11-17T18:50:44.000Z | shelter/migrations/0015_sheltergallery.py | kermox/schronisko-krakow | 8f8c546894e4b683ce463debad27db72ef820f90 | [
"MIT"
] | 9 | 2020-10-23T18:42:45.000Z | 2022-03-12T00:39:57.000Z | shelter/migrations/0015_sheltergallery.py | kermox/schronisko-krakow | 8f8c546894e4b683ce463debad27db72ef820f90 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.5 on 2020-10-08 20:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('shelter', '0014_auto_20201008_1913'),
]
operations = [
migrations.CreateModel(
name='ShelterGallery',
fields=[
... | 27.238095 | 114 | 0.606643 |
e81ac983ad5637fc03592f3a721a05f233c2b95a | 1,952 | py | Python | trellozilla/__init__.py | moisesguimaraes/trellozilla | 09779fbc29df5896c895aaa30e8a49ac57b7c1fc | [
"Apache-2.0"
] | 2 | 2019-09-26T10:04:51.000Z | 2021-01-28T16:18:31.000Z | trellozilla/__init__.py | moisesguimaraes/trellozilla | 09779fbc29df5896c895aaa30e8a49ac57b7c1fc | [
"Apache-2.0"
] | null | null | null | trellozilla/__init__.py | moisesguimaraes/trellozilla | 09779fbc29df5896c895aaa30e8a49ac57b7c1fc | [
"Apache-2.0"
] | 1 | 2021-01-19T14:11:00.000Z | 2021-01-19T14:11:00.000Z | import functools
import pbr.version
from oslo_log import log as logging
from trellozilla.core import bugzilla
from trellozilla.core import config
from trellozilla.core import trello
__version__ = pbr.version.VersionInfo("trellozilla").version_string()
LOG = logging.getLogger(__name__)
class TrelloZilla:
def ... | 27.111111 | 74 | 0.638832 |
e81acbe1ef2ced22dcee9cc937704bc2672c21b0 | 6,207 | py | Python | key_monad/common_func.py | verbalsaintmars/key_monad | 3122fd18af65b6f91463a62060760d0560139e15 | [
"MIT"
] | null | null | null | key_monad/common_func.py | verbalsaintmars/key_monad | 3122fd18af65b6f91463a62060760d0560139e15 | [
"MIT"
] | null | null | null | key_monad/common_func.py | verbalsaintmars/key_monad | 3122fd18af65b6f91463a62060760d0560139e15 | [
"MIT"
] | null | null | null | import copy
import json
import os
def remove_root_duplicate(result):
"""
COW enabled while modifing result.
:param result: dict
e.g
original dict:
{'A': 1, 'B': {'A': 3, 'C': {'B': {'A': 4}}, 'D': 4}}
remote root duplicate dict:
{'A': 1, 'B': {'D': 4}}
"""
cow_r... | 29.417062 | 79 | 0.576768 |
e81ae39b5cfb15383b27e59d48ac014b89ea4494 | 2,136 | py | Python | src/common/state/regenerateall.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 226 | 2018-12-29T01:13:49.000Z | 2022-03-30T19:16:31.000Z | src/common/state/regenerateall.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 5,100 | 2019-01-14T18:19:25.000Z | 2022-03-31T23:08:36.000Z | src/common/state/regenerateall.py | visit-dav/vis | c08bc6e538ecd7d30ddc6399ec3022b9e062127e | [
"BSD-3-Clause"
] | 84 | 2019-01-24T17:41:50.000Z | 2022-03-10T10:01:46.000Z | #!/usr/local/apps/bin/python
import os, string, sys
#
# Get the output of a command as a tuple of strings.
#
def GetFilenames(command):
p = os.popen(command)
files = p.readlines()
p.close()
return files
#
# Get a list of all files that have a .code extension and contain "CreateNode".
#
def GetCreateN... | 26.37037 | 79 | 0.578652 |
e81ae55329ac59ffa74dc84ce7fca39bcad02c7b | 333 | py | Python | meteo/db/ops.py | bpptkg/bpptkg-meteo | 8b554c58ffa5bc41377e8bdde7434abaaae49c27 | [
"MIT"
] | null | null | null | meteo/db/ops.py | bpptkg/bpptkg-meteo | 8b554c58ffa5bc41377e8bdde7434abaaae49c27 | [
"MIT"
] | 2 | 2021-11-22T03:42:28.000Z | 2022-01-13T09:26:06.000Z | meteo/db/ops.py | bpptkg/bpptkg-meteo | 8b554c58ffa5bc41377e8bdde7434abaaae49c27 | [
"MIT"
] | null | null | null | from .sessions import session_scope
def bulk_insert(engine, model, entries):
"""
Insert entries to database model.
This operation is done by using SQLAlchemy session bulk insert mappings.
"""
with session_scope(engine) as session:
session.bulk_insert_mappings(model, entries)
sess... | 23.785714 | 76 | 0.708709 |
e81b45e93e6bd527e02a87364d97aa7de4c3cbed | 2,643 | py | Python | acme/agents/tf/d4pg/agent_test.py | novatig/acme | 7774e4a22519d8b05951320864e5308974eaad2a | [
"Apache-2.0"
] | 1 | 2020-08-31T23:46:32.000Z | 2020-08-31T23:46:32.000Z | acme/agents/tf/d4pg/agent_test.py | novatig/acme | 7774e4a22519d8b05951320864e5308974eaad2a | [
"Apache-2.0"
] | 1 | 2021-01-25T15:39:56.000Z | 2021-01-25T15:39:56.000Z | acme/agents/tf/d4pg/agent_test.py | novatig/acme | 7774e4a22519d8b05951320864e5308974eaad2a | [
"Apache-2.0"
] | 2 | 2021-01-07T11:35:19.000Z | 2021-01-07T12:16:21.000Z | # python3
# Copyright 2018 DeepMind Technologies Limited. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless re... | 30.034091 | 78 | 0.721907 |
e81b67391015a90c0e47a43564df6147694c06e3 | 8,568 | py | Python | shortener/tests.py | mariob0y/URLshortener | 9da13e6fca776fbcbafd2f562b94ada1a0aadbd8 | [
"MIT"
] | 1 | 2021-02-15T16:09:58.000Z | 2021-02-15T16:09:58.000Z | shortener/tests.py | mariob0y/URLshortener | 9da13e6fca776fbcbafd2f562b94ada1a0aadbd8 | [
"MIT"
] | null | null | null | shortener/tests.py | mariob0y/URLshortener | 9da13e6fca776fbcbafd2f562b94ada1a0aadbd8 | [
"MIT"
] | null | null | null | from django.test import TestCase
from shortener import shortener
from shortener.models import UrlProfile
from django.contrib.auth import get_user_model
import time
class UrlMapTestCase(TestCase):
def setUp(self):
self.bob = get_user_model().objects.create_user('bob',
... | 46.064516 | 79 | 0.559407 |
e81bae39c117390ad5c6b18b6bfce8c2b64657f7 | 7,139 | py | Python | entropy/main.py | eleGAN23/QVAE | 7315aae7a03637dcc2e2226644d591c4f034527e | [
"MIT"
] | 10 | 2021-03-25T11:56:37.000Z | 2021-12-25T19:40:29.000Z | entropy/main.py | eleGAN23/QVAE | 7315aae7a03637dcc2e2226644d591c4f034527e | [
"MIT"
] | null | null | null | entropy/main.py | eleGAN23/QVAE | 7315aae7a03637dcc2e2226644d591c4f034527e | [
"MIT"
] | 1 | 2021-12-28T10:39:57.000Z | 2021-12-28T10:39:57.000Z | import argparse
import os
import pickle
import time
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import PIL
import torch
import torch.optim as optim
import torchvision
from PIL import Image
from torch import nn
from torch.nn import functional as F
from datasets import QProper_signals1, QProp... | 32.303167 | 95 | 0.607088 |
e81be085061f9747512c2772ddba716f1f16a374 | 32,097 | py | Python | strawberryfields/backends/bosonicbackend/backend.py | felipeoyarce/strawberryfields | adb0f9919decc3a6544ddae26eb98c1afb76f7c8 | [
"Apache-2.0"
] | 1 | 2021-04-10T08:40:09.000Z | 2021-04-10T08:40:09.000Z | strawberryfields/backends/bosonicbackend/backend.py | felipeoyarce/strawberryfields | adb0f9919decc3a6544ddae26eb98c1afb76f7c8 | [
"Apache-2.0"
] | null | null | null | strawberryfields/backends/bosonicbackend/backend.py | felipeoyarce/strawberryfields | adb0f9919decc3a6544ddae26eb98c1afb76f7c8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Xanadu Quantum Technologies Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agre... | 38.439521 | 120 | 0.558432 |
e81be7542b48ccadc466ae495f9c7e5e9ee2c447 | 1,969 | py | Python | psephology/api.py | rjw57/psephology | 37aa078b5c9412222e53dc177f81a321424fd533 | [
"MIT"
] | null | null | null | psephology/api.py | rjw57/psephology | 37aa078b5c9412222e53dc177f81a321424fd533 | [
"MIT"
] | null | null | null | psephology/api.py | rjw57/psephology | 37aa078b5c9412222e53dc177f81a321424fd533 | [
"MIT"
] | 1 | 2021-04-26T08:07:47.000Z | 2021-04-26T08:07:47.000Z | """
The :py:mod:`.api` module provides a Flask blueprint which implements the JSON
API.
"""
from flask import Blueprint, jsonify, request, abort, flash
from sqlalchemy.orm import joinedload
from psephology.model import db, import_results, Constituency, Voting
from psephology import query
blueprint = Blueprint('api'... | 26.972603 | 80 | 0.588624 |
e81c3a11916c30c7d1726cdf02190a0734ddc654 | 625 | py | Python | nicos_mlz/sans1/setups/wut1.py | mlz-ictrl/nicos | a6de0bc194ba42e3dc04a033713b41b5499ba8e1 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 12 | 2019-11-06T15:40:36.000Z | 2022-01-01T16:23:00.000Z | nicos_mlz/sans1/setups/wut1.py | ess-dmsc/nicos | 755d61d403ff7123f804c45fc80c7ff4d762993b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 91 | 2020-08-18T09:20:26.000Z | 2022-02-01T11:07:14.000Z | nicos_mlz/sans1/setups/wut1.py | mlz-ictrl/nicos | a6de0bc194ba42e3dc04a033713b41b5499ba8e1 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 6 | 2020-01-11T10:52:30.000Z | 2022-02-25T12:35:23.000Z | description = 'wut readout'
# group = 'lowlevel'
devices = dict(
s1_wut1 = device('nicos_mlz.sans1.devices.wut.WutReadValue',
hostname = 'sans1wut1.sans1.frm2',
port = 1,
description = 'sensor 1 of wut box 1',
fmtstr = '%.2F',
lowlevel = False,
loglevel = 'info',
... | 25 | 64 | 0.536 |
e81c4e359435fada0abc6e481300a8ebc5fb7399 | 1,503 | py | Python | tools/json_schema_compiler/util_cc_helper.py | Wzzzx/chromium-crosswalk | 768dde8efa71169f1c1113ca6ef322f1e8c9e7de | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2019-01-28T08:09:58.000Z | 2021-11-15T15:32:10.000Z | tools/json_schema_compiler/util_cc_helper.py | maidiHaitai/haitaibrowser | a232a56bcfb177913a14210e7733e0ea83a6b18d | [
"BSD-3-Clause"
] | null | null | null | tools/json_schema_compiler/util_cc_helper.py | maidiHaitai/haitaibrowser | a232a56bcfb177913a14210e7733e0ea83a6b18d | [
"BSD-3-Clause"
] | 6 | 2020-09-23T08:56:12.000Z | 2021-11-18T03:40:49.000Z | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
_API_UTIL_NAMESPACE = 'json_schema_compiler::util'
class UtilCCHelper(object):
"""A util class that generates code that uses
tools/json_schema_comp... | 34.953488 | 80 | 0.697272 |
e81c6444611a3d41c48b8cd2c5b6c5a38accc614 | 8,162 | py | Python | Scripts/create_train_test_inputs.py | FarjadMalik/aigoeswild | c40cb8116ead9dd6538b8d87ed1e4910866ad4f9 | [
"MIT"
] | 1 | 2021-09-29T07:33:50.000Z | 2021-09-29T07:33:50.000Z | Scripts/create_train_test_inputs.py | FarjadMalik/aigoeswild | c40cb8116ead9dd6538b8d87ed1e4910866ad4f9 | [
"MIT"
] | null | null | null | Scripts/create_train_test_inputs.py | FarjadMalik/aigoeswild | c40cb8116ead9dd6538b8d87ed1e4910866ad4f9 | [
"MIT"
] | null | null | null | import argparse
import os
import pandas as pd
from sklearn.utils import shuffle
def split_species(specie_set, test_count, valid_count, seed=42):
# Create empty dataframes
train_set = pd.DataFrame(columns=specie_set.columns)
test_set = pd.DataFrame(columns=specie_set.columns)
valid_set = pd.DataFrame(... | 48.874251 | 115 | 0.684146 |
e81c65ae4a1fb986a6703086d12faf2f97f273a3 | 755 | py | Python | user_notifications/admin.py | moonbirddk/networked-toolbox | b059b77bfda173794b3cad55874cb06edc70d0e1 | [
"BSD-2-Clause-FreeBSD"
] | 2 | 2016-09-02T12:45:31.000Z | 2018-02-10T10:18:11.000Z | user_notifications/admin.py | Socialsquare/networked-toolbox | b059b77bfda173794b3cad55874cb06edc70d0e1 | [
"BSD-2-Clause-FreeBSD"
] | 17 | 2020-03-24T15:58:05.000Z | 2022-02-10T08:08:57.000Z | user_notifications/admin.py | moonbirddk/networked-toolbox | b059b77bfda173794b3cad55874cb06edc70d0e1 | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2018-01-05T08:02:18.000Z | 2018-01-05T08:02:18.000Z | # -*- coding: utf-8 -*-
from django.contrib import admin
from .models import UserNotification
class UserNotificationAdmin(admin.ModelAdmin):
raw_id_fields = ('recipient',)
list_display = ('recipient', 'actor',
'level', 'target', 'unread', 'public')
list_filter = ('level', 'unread'... | 23.59375 | 61 | 0.572185 |
e81c6e0be9be9dbb1d6d52a5a83f86cecab9b578 | 588 | py | Python | models/methods/SwinTrack/positional_encoding/learned.py | zhangzhengde0225/SwinTrack | 526be17f8ef266cb924c6939bd8dda23e9b73249 | [
"MIT"
] | 143 | 2021-12-03T02:33:36.000Z | 2022-03-29T00:01:48.000Z | models/methods/SwinTrack/positional_encoding/learned.py | zhangzhengde0225/SwinTrack | 526be17f8ef266cb924c6939bd8dda23e9b73249 | [
"MIT"
] | 33 | 2021-12-03T10:32:05.000Z | 2022-03-31T02:13:55.000Z | models/methods/SwinTrack/positional_encoding/learned.py | zhangzhengde0225/SwinTrack | 526be17f8ef266cb924c6939bd8dda23e9b73249 | [
"MIT"
] | 24 | 2021-12-04T06:46:42.000Z | 2022-03-30T07:57:47.000Z | import torch
import torch.nn as nn
from timm.models.layers import trunc_normal_
class Learned2DPositionalEncoder(nn.Module):
def __init__(self, dim, w, h):
super(Learned2DPositionalEncoder, self).__init__()
self.w_pos = nn.Parameter(torch.empty(w, dim))
self.h_pos = nn.Parameter(torch.empt... | 32.666667 | 80 | 0.642857 |
e81c754414dfe209d8d55d2e8d2ebd09aa4b3c80 | 212 | py | Python | setup.py | qzed/linux-surfacegen5-dtx-daemon | 1b48933a4e8666d8b63b9e4f7a314d4a9bd7c8f8 | [
"MIT"
] | 1 | 2019-03-22T19:47:14.000Z | 2019-03-22T19:47:14.000Z | setup.py | qzed/linux-surfacegen5-dtx-daemon | 1b48933a4e8666d8b63b9e4f7a314d4a9bd7c8f8 | [
"MIT"
] | 2 | 2019-04-08T01:19:44.000Z | 2019-04-20T19:50:53.000Z | setup.py | qzed/linux-surfacegen5-dtx-daemon | 1b48933a4e8666d8b63b9e4f7a314d4a9bd7c8f8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from distutils.core import setup
setup(
name='surface_dtx',
version='0.1.5',
packages=['surface_dtx'],
package_dir={'surface_dtx': 'dtx'},
requires=['dbus', 'toml'],
)
| 17.666667 | 39 | 0.627358 |
e81ca21a204751bf0639ed82c5a69bd5b05f570b | 3,665 | py | Python | test/redis_data_test.py | erprice/fes | 3f62a6059bd8f5262488efb35f8b2d3582eeabdf | [
"Apache-2.0"
] | null | null | null | test/redis_data_test.py | erprice/fes | 3f62a6059bd8f5262488efb35f8b2d3582eeabdf | [
"Apache-2.0"
] | null | null | null | test/redis_data_test.py | erprice/fes | 3f62a6059bd8f5262488efb35f8b2d3582eeabdf | [
"Apache-2.0"
] | null | null | null | import redis_data
import test_utils
def test_add_and_get_payload():
id_hash = test_utils.get_random_string()
expiration = test_utils.get_random_int()
redis_data.add(id_hash, expiration, test_utils.TEST_PAYLOAD)
result = redis_data.get_event_payload(id_hash)
assert result == test_utils.TEST_PAYLOA... | 32.433628 | 81 | 0.742974 |
e81caf24e1bdbf436bd37bb1024babac36b558d6 | 4,823 | py | Python | sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_02/aio/operations/_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-09T08:59:13.000Z | 2022-03-09T08:59:13.000Z | sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_02/aio/operations/_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/iothub/azure-mgmt-iothub/azure/mgmt/iothub/v2021_07_02/aio/operations/_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.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 ... | 43.45045 | 133 | 0.669915 |
e81cd6bb6aa473998cc26bd2656dcafaedfcc2fa | 586 | py | Python | theseus/base/datasets/__init__.py | kaylode/shrec22-pothole | 700d1632de686214e42a2f56aeaceab30c8b9a3f | [
"MIT"
] | 1 | 2022-03-19T11:52:53.000Z | 2022-03-19T11:52:53.000Z | theseus/base/datasets/__init__.py | kaylode/shrec22-pothole | 700d1632de686214e42a2f56aeaceab30c8b9a3f | [
"MIT"
] | null | null | null | theseus/base/datasets/__init__.py | kaylode/shrec22-pothole | 700d1632de686214e42a2f56aeaceab30c8b9a3f | [
"MIT"
] | 1 | 2022-03-19T11:53:10.000Z | 2022-03-19T11:53:10.000Z | from theseus.registry import Registry
from torch.utils.data import DataLoader, Dataset
from .dataloader import DataLoaderWithCollator
from .dataset import ChainDataset, ConcatDataset, ImageDataset, VideoDataset
DATASET_REGISTRY = Registry('DATASET')
DATASET_REGISTRY.register(Dataset)
DATASET_REGISTRY.register(ChainDat... | 39.066667 | 76 | 0.87372 |
e81cdcc4c4a912fbf47adedceb96dbf0882653a5 | 14,891 | py | Python | executor/src/transpiler/kubernetes_spec_logic.py | gavinmbell/benchmark-ai-1 | a697e67d68b843fe9350e55871dad867bab5d51d | [
"Apache-2.0"
] | 6 | 2020-09-29T09:03:04.000Z | 2022-03-14T06:52:25.000Z | executor/src/transpiler/kubernetes_spec_logic.py | gavinmbell/benchmark-ai-1 | a697e67d68b843fe9350e55871dad867bab5d51d | [
"Apache-2.0"
] | null | null | null | executor/src/transpiler/kubernetes_spec_logic.py | gavinmbell/benchmark-ai-1 | a697e67d68b843fe9350e55871dad867bab5d51d | [
"Apache-2.0"
] | 4 | 2020-10-01T07:49:22.000Z | 2021-06-16T19:44:12.000Z | # Copyright 2019 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://www.apache.org/licenses/LICENSE-2.0
#
# or in the "l... | 43.668622 | 120 | 0.645692 |
e81ce5c7fbfbd2e1569dc043219dea973d9f56f4 | 10,066 | py | Python | neurom/io/neurolucida.py | NeuroDataDesign/NeuroM | 61a7b5de0c3bf3c07d6eb3270c28d21be6ea7865 | [
"BSD-3-Clause"
] | null | null | null | neurom/io/neurolucida.py | NeuroDataDesign/NeuroM | 61a7b5de0c3bf3c07d6eb3270c28d21be6ea7865 | [
"BSD-3-Clause"
] | 3 | 2019-11-15T05:22:14.000Z | 2019-12-09T01:56:24.000Z | neurom/io/neurolucida.py | NeuroDataDesign/NeuroM | 61a7b5de0c3bf3c07d6eb3270c28d21be6ea7865 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2016, Ecole Polytechnique Federale de Lausanne, Blue Brain Project
# All rights reserved.
#
# This file is part of NeuroM <https://github.com/BlueBrain/NeuroM>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are ... | 36.871795 | 90 | 0.625174 |
e81cfa3d87bba097bb765c5eb23a3a4fd62d0a34 | 3,283 | py | Python | Field Extraction/Database/dbHandler.py | uit-hdl/rhd-codes | 7b62584fae75c6ff9ce84bc38230bce5da582bbf | [
"MIT"
] | 3 | 2019-06-30T13:02:07.000Z | 2021-06-14T08:52:23.000Z | Field Extraction/Database/dbHandler.py | uit-hdl/rhd-codes | 7b62584fae75c6ff9ce84bc38230bce5da582bbf | [
"MIT"
] | null | null | null | Field Extraction/Database/dbHandler.py | uit-hdl/rhd-codes | 7b62584fae75c6ff9ce84bc38230bce5da582bbf | [
"MIT"
] | 1 | 2019-11-03T19:43:49.000Z | 2019-11-03T19:43:49.000Z | import sqlite3
import cv2
from Database import init_db
class DbHandler:
def __init__(self, db_loc, connection=None):
self.db_loc = db_loc
self.connection = connection
self.cursor = None
if self.connection is None:
self.connection = sqlite3.connect(db_loc)
in... | 38.623529 | 164 | 0.583917 |
e81d20b7de151dbf0ae45e8db3cc1212d044f829 | 797 | py | Python | ABLIRC/bin/public/clip_xiaoshu.py | ablifedev/ABLIRC | 875278b748a8e22ada2c76c3c76dbf970be4a6a4 | [
"MIT"
] | 1 | 2020-02-25T13:08:20.000Z | 2020-02-25T13:08:20.000Z | ABLIRC/bin/public/clip_xiaoshu.py | ablifedev/ABLIRC | 875278b748a8e22ada2c76c3c76dbf970be4a6a4 | [
"MIT"
] | 1 | 2020-02-25T13:16:03.000Z | 2020-02-25T13:16:03.000Z | ABLIRC/bin/public/clip_xiaoshu.py | ablifedev/ABLIRC | 875278b748a8e22ada2c76c3c76dbf970be4a6a4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: anchen
# @Date: 2016-10-19 17:11:32
# @Last Modified by: anchen
# @Last Modified time: 2016-11-14 14:10:54
import os,re
import sys
for paramIndex in range(0,len(sys.argv)):
if sys.argv[paramIndex] == "-i":
input_file=sys.argv[paramIndex+1]
f1=op... | 24.90625 | 42 | 0.65872 |
e81d21802bc1e48fce2fcb19699293a43f330da5 | 2,455 | py | Python | tests/app/main/test_errorhandlers.py | cds-snc/notification-admin | d4056798bf889ad29893667bbb67ead2f8e466e4 | [
"MIT"
] | 16 | 2019-11-05T21:35:49.000Z | 2022-01-12T15:00:32.000Z | tests/app/main/test_errorhandlers.py | cds-snc/notification-admin | d4056798bf889ad29893667bbb67ead2f8e466e4 | [
"MIT"
] | 509 | 2019-07-11T22:03:19.000Z | 2022-03-30T15:19:26.000Z | tests/app/main/test_errorhandlers.py | cds-snc/notification-admin | d4056798bf889ad29893667bbb67ead2f8e466e4 | [
"MIT"
] | 8 | 2020-02-21T20:19:29.000Z | 2022-03-31T14:17:02.000Z | import pytest
from bs4 import BeautifulSoup
from flask import Response, url_for
from flask_wtf.csrf import CSRFError
from notifications_python_client.errors import HTTPError
def test_bad_url_returns_page_not_found(client):
response = client.get("/bad_url")
assert response.status_code == 404
page = Beautif... | 37.19697 | 90 | 0.73442 |
e81d2b7d855e99ffd260412cf86f5562e6e54c9f | 446 | py | Python | ytree/frontends/moria/__init__.py | ytree-project/ytree | 4ba1d3e6efd1e647c594b2c0de51b0217de7a45c | [
"BSD-3-Clause-Clear"
] | 3 | 2020-02-28T10:25:39.000Z | 2021-04-13T07:18:35.000Z | ytree/frontends/moria/__init__.py | ytree-project/ytree | 4ba1d3e6efd1e647c594b2c0de51b0217de7a45c | [
"BSD-3-Clause-Clear"
] | 36 | 2019-12-03T17:33:29.000Z | 2022-02-18T10:39:25.000Z | ytree/frontends/moria/__init__.py | ytree-project/ytree | 4ba1d3e6efd1e647c594b2c0de51b0217de7a45c | [
"BSD-3-Clause-Clear"
] | 6 | 2019-08-22T16:01:34.000Z | 2020-08-25T09:57:17.000Z | """
moria frontend
"""
#-----------------------------------------------------------------------------
# Copyright (c) ytree development team. All rights reserved.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed with this software.
#----------... | 24.777778 | 78 | 0.477578 |
e81d5d0395f3c08241afe5c9ba36193ef669da95 | 3,250 | py | Python | leetcode_python/String/reverse-words-in-a-string-ii.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/String/reverse-words-in-a-string-ii.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/String/reverse-words-in-a-string-ii.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | """
186. Reverse Words in a String II
Medium
Given a character array s, reverse the order of the words.
A word is defined as a sequence of non-space characters. The words in s will be separated by a single space.
Your code must solve the problem in-place, i.e. without allocating extra space.
Example 1:
Input: ... | 27.310924 | 108 | 0.495077 |
e81d7b97d920436ff77565228b4be4af031657a7 | 6,566 | py | Python | litholog/sequence/io.py | rgmyr/litholog | d628dac9f758eee46f85a4b668a3fd242cf9e76e | [
"Apache-2.0"
] | 11 | 2021-02-10T15:59:39.000Z | 2022-02-14T23:51:40.000Z | litholog/sequence/io.py | rgmyr/litholog | d628dac9f758eee46f85a4b668a3fd242cf9e76e | [
"Apache-2.0"
] | 3 | 2021-04-16T13:46:45.000Z | 2021-11-04T04:03:17.000Z | litholog/sequence/io.py | rgmyr/litholog | d628dac9f758eee46f85a4b668a3fd242cf9e76e | [
"Apache-2.0"
] | 2 | 2021-12-21T08:48:57.000Z | 2022-03-27T15:35:03.000Z | """
IO classes & functions
"""
import operator
from abc import ABC, abstractmethod
import numpy as np
import pandas as pd
from litholog import Bed, utils
def check_order(df, topcol, basecol, raise_error=True):
"""
Check that all rows are either depth ordered or elevation_ordered.
Returns 'elevation' or ... | 34.925532 | 114 | 0.61057 |
e81da07a054f2e07a8648ef01c1ba44b852f53a7 | 2,578 | py | Python | .leetcode/446.arithmetic-slices-ii-subsequence.py | KuiyuanFu/PythonLeetCode | 8962df2fa838eb7ae48fa59de272ba55a89756d8 | [
"MIT"
] | null | null | null | .leetcode/446.arithmetic-slices-ii-subsequence.py | KuiyuanFu/PythonLeetCode | 8962df2fa838eb7ae48fa59de272ba55a89756d8 | [
"MIT"
] | null | null | null | .leetcode/446.arithmetic-slices-ii-subsequence.py | KuiyuanFu/PythonLeetCode | 8962df2fa838eb7ae48fa59de272ba55a89756d8 | [
"MIT"
] | null | null | null | # @lc app=leetcode id=446 lang=python3
#
# [446] Arithmetic Slices II - Subsequence
#
# https://leetcode.com/problems/arithmetic-slices-ii-subsequence/description/
#
# algorithms
# Hard (34.45%)
# Likes: 809
# Dislikes: 74
# Total Accepted: 27.4K
# Total Submissions: 79.5K
# Testcase Example: '[2,4,6,8,10]'
#
# ... | 20.140625 | 77 | 0.595423 |
e81dbd23afaf25d2cb8a21092aedb2236f38b279 | 17,573 | py | Python | lib/matplotlib/tests/test_colors.py | yuvallanger/matplotlib | e0020d318a9a9685594c6bff4631f74599321459 | [
"MIT",
"BSD-3-Clause"
] | 8 | 2017-04-11T08:55:30.000Z | 2022-03-25T04:31:26.000Z | lib/matplotlib/tests/test_colors.py | epgauss/matplotlib | c9898ea9a30c67c579ab27cd61b68e2abae0fb0e | [
"MIT",
"BSD-3-Clause"
] | null | null | null | lib/matplotlib/tests/test_colors.py | epgauss/matplotlib | c9898ea9a30c67c579ab27cd61b68e2abae0fb0e | [
"MIT",
"BSD-3-Clause"
] | 14 | 2015-10-05T04:15:46.000Z | 2020-06-11T18:06:02.000Z | from __future__ import (absolute_import, division, print_function,
unicode_literals)
import six
import itertools
from distutils.version import LooseVersion as V
from nose.tools import assert_raises
import numpy as np
from numpy.testing.utils import assert_array_equal, assert_array_almost_equa... | 39.051111 | 79 | 0.521937 |
e81dd64ef4d274a0c0e5f2f3b5bf7934ecb70dc7 | 23,019 | py | Python | atom/proton/python/proton_api/api/business_financial_management_api.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | 11 | 2019-04-16T02:11:17.000Z | 2021-12-16T22:51:40.000Z | atom/proton/python/proton_api/api/business_financial_management_api.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | 81 | 2019-11-19T23:24:28.000Z | 2022-03-28T11:35:47.000Z | atom/proton/python/proton_api/api/business_financial_management_api.py | AbhiGupta03/SDK | f3a61aae7a847f07f0c22a154ca88dc378e9d25e | [
"Apache-2.0"
] | 11 | 2020-07-08T02:29:56.000Z | 2022-03-28T10:05:33.000Z | # coding: utf-8
"""
Hydrogen Proton API
Financial engineering module of Hydrogen Atom # noqa: E501
OpenAPI spec version: 1.9.2
Contact: info@hydrogenplatform.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from __future__ import absolute_import
import re # noqa: F401... | 43.432075 | 165 | 0.645206 |
e81dd67d12d1d5acf0450ee5d2d2d0383322a4d6 | 7,647 | py | Python | examples/M1detailed/cfg.py | sanjayankur31/netpyne | d8b7e94cabeb27e23e30853ff17ae86518b35ac2 | [
"MIT"
] | null | null | null | examples/M1detailed/cfg.py | sanjayankur31/netpyne | d8b7e94cabeb27e23e30853ff17ae86518b35ac2 | [
"MIT"
] | null | null | null | examples/M1detailed/cfg.py | sanjayankur31/netpyne | d8b7e94cabeb27e23e30853ff17ae86518b35ac2 | [
"MIT"
] | null | null | null | """
cfg.py
Simulation configuration for M1 model (using NetPyNE)
"""
from netpyne import specs
import pickle
cfg = specs.SimConfig()
#------------------------------------------------------------------------------
#
# SIMULATION CONFIGURATION
#
#-----------------------------------------------------------------------... | 37.856436 | 215 | 0.463188 |
e81dd89b796105ab9dcad7639600baffcac3aae5 | 2,232 | py | Python | Internet-Worm/venv_macos/lib/python3.8/site-packages/SeleniumLogin/utils/cookies.py | Qiaozhi94/Python-Projects | aefc6cf49c1f4f2cc9beba8dbe80cfa826ba75c4 | [
"MIT"
] | 31 | 2019-06-02T07:14:15.000Z | 2022-03-06T13:16:35.000Z | SeleniumLogin/utils/cookies.py | wenxuefeng3930/SeleniumLogin | 62b2c58d52c2d1423a08e3327e1257e8e954724f | [
"MIT"
] | 1 | 2021-11-10T18:21:03.000Z | 2021-11-10T18:21:03.000Z | SeleniumLogin/utils/cookies.py | wenxuefeng3930/SeleniumLogin | 62b2c58d52c2d1423a08e3327e1257e8e954724f | [
"MIT"
] | 17 | 2020-05-08T11:11:22.000Z | 2021-12-25T07:50:56.000Z | '''
Function:
关于cookies的一些工具函数
Author:
Charles
微信公众号:
Charles的皮卡丘
GitHub:
https://github.com/CharlesPikachu
更新日期:
2020-05-08
'''
import json
import pickle
from selenium import webdriver
'''保存webdriver.Chrome对象的cookies'''
def saveBrowserCookies(browser, cookiespath, encoding='utf-8'):
infos_return = {'is_success... | 31.43662 | 125 | 0.737903 |
e81de22a825162b5f2195f9c32ee678704e6d477 | 2,421 | py | Python | manual_control.py | jesbu1/gym-minigrid | fd799f90bcd88d5418dcb074140e65862d44f064 | [
"Apache-2.0"
] | null | null | null | manual_control.py | jesbu1/gym-minigrid | fd799f90bcd88d5418dcb074140e65862d44f064 | [
"Apache-2.0"
] | null | null | null | manual_control.py | jesbu1/gym-minigrid | fd799f90bcd88d5418dcb074140e65862d44f064 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
import time
import argparse
import numpy as np
import gym
import gym_minigrid
from gym_minigrid.wrappers import *
from gym_minigrid.window import Window
def redraw(img):
if not args.agent_view:
img = env.render('rgb_array', tile_size=args.tile_size)
window.show_img(img)
def re... | 20.344538 | 79 | 0.617513 |
e81de7667713d76698c50c22d36a8e4ccc5da53c | 956 | py | Python | filter.py | aakash257/pandemic-news | 73378012253dcd131546e4e2b8b6fd30e7e7b786 | [
"MIT"
] | null | null | null | filter.py | aakash257/pandemic-news | 73378012253dcd131546e4e2b8b6fd30e7e7b786 | [
"MIT"
] | null | null | null | filter.py | aakash257/pandemic-news | 73378012253dcd131546e4e2b8b6fd30e7e7b786 | [
"MIT"
] | null | null | null | covid_wordset = ['covid', 'pandemic']
class myDict(dict):
"""
create an empty dictionary and append key-value pairs
"""
def __init__(self):
self = dict()
def add(self, key, value):
self[key] = value
pandemic_daily_news_dict = myDict()
def filter_pandemic_news(news_dic... | 31.866667 | 79 | 0.621339 |
e81df534d5fe949b7d6741d0369872780eeb7741 | 5,737 | py | Python | draw3dobb.py | kevin-kaixu/grass_pytorch | 1d8dc6dcc0ab3ca029e449f57c37ba3910a4f90a | [
"Apache-2.0"
] | 85 | 2017-10-25T02:54:05.000Z | 2022-03-17T07:25:10.000Z | draw3dobb.py | kevin-kaixu/grass_pytorch | 1d8dc6dcc0ab3ca029e449f57c37ba3910a4f90a | [
"Apache-2.0"
] | 4 | 2017-11-16T13:28:54.000Z | 2020-04-18T09:10:38.000Z | draw3dobb.py | kevin-kaixu/grass_pytorch | 1d8dc6dcc0ab3ca029e449f57c37ba3910a4f90a | [
"Apache-2.0"
] | 17 | 2017-11-12T09:57:30.000Z | 2021-12-27T19:17:57.000Z | from __future__ import print_function, division
from matplotlib import pyplot as plt
import numpy as np
from numpy import linalg as LA
from mpl_toolkits.mplot3d import Axes3D
def tryPlot():
cmap = plt.get_cmap('jet_r')
fig = plt.figure()
ax = Axes3D(fig)
draw(ax, [-0.0152730000000000,-0.113074400000000... | 51.684685 | 152 | 0.657138 |
e81e1102b66b0e62ac3c55ce0fe8acdb5c498358 | 1,792 | py | Python | tests/st/ops/test_fused_relu_grad_bn_reduce_grad.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 286 | 2020-06-23T06:40:44.000Z | 2022-03-30T01:27:49.000Z | tests/st/ops/test_fused_relu_grad_bn_reduce_grad.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 10 | 2020-07-31T03:26:59.000Z | 2021-12-27T15:00:54.000Z | tests/st/ops/test_fused_relu_grad_bn_reduce_grad.py | tianjiashuo/akg | a9cbf642063fb1086a93e8bc6be6feb145689817 | [
"Apache-2.0"
] | 30 | 2020-07-17T01:04:14.000Z | 2021-12-27T14:05:19.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 35.84 | 112 | 0.663504 |
e81e1720d5745471e7c17f1e86f37c1c0c4c1fbd | 97 | py | Python | pyinspect/Node/Types/Directory.py | SvenHepkema/pyinspect | 1015b5144c7b99e3354758496ea74cc6f8e76172 | [
"MIT"
] | null | null | null | pyinspect/Node/Types/Directory.py | SvenHepkema/pyinspect | 1015b5144c7b99e3354758496ea74cc6f8e76172 | [
"MIT"
] | null | null | null | pyinspect/Node/Types/Directory.py | SvenHepkema/pyinspect | 1015b5144c7b99e3354758496ea74cc6f8e76172 | [
"MIT"
] | null | null | null | class FileDirectory:
terminal_color = '\033[91m'
def tree_sign():
return "DIR: " | 19.4 | 31 | 0.608247 |
e81e21a595eecabad65a026a931abe46d1a10bda | 720 | py | Python | setup.py | mksa1981/xioami_sensor_poller | d9e4c79207877f8b5f78def155bcb06ddacbf060 | [
"MIT"
] | 1 | 2021-02-05T14:20:07.000Z | 2021-02-05T14:20:07.000Z | setup.py | mksa1981/xioami_sensor_poller | d9e4c79207877f8b5f78def155bcb06ddacbf060 | [
"MIT"
] | null | null | null | setup.py | mksa1981/xioami_sensor_poller | d9e4c79207877f8b5f78def155bcb06ddacbf060 | [
"MIT"
] | null | null | null | import setuptools
with open("README.md", "r", encoding="utf-8") as fh:
long_description = fh.read()
setuptools.setup(
name="xiaomi_poller", # Replace with your own username
version="0.0.2",
author="Mikael Andersen",
author_email="andersen.mikael@gmail.com",
description="BLE scanner for Xiaomi... | 32.727273 | 59 | 0.679167 |
e81e2dc2f5637e08d1b532338326186fef39ce9f | 14,199 | py | Python | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_images_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2021-09-07T18:39:05.000Z | 2021-09-07T18:39:05.000Z | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_images_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/compute/azure-mgmt-compute/azure/mgmt/compute/v2016_04_30_preview/aio/operations/_virtual_machine_images_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.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 ... | 42.511976 | 221 | 0.676738 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.