hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
ce7d407480d8a7f47b9d9e91e7767883c6f1e739 | 994 | py | Python | tests/test_imphooks.py | Granitosaurus/xonsh | 3796c4ba3b2e857a02760b260b5a911b148a511d | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | tests/test_imphooks.py | Granitosaurus/xonsh | 3796c4ba3b2e857a02760b260b5a911b148a511d | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | tests/test_imphooks.py | Granitosaurus/xonsh | 3796c4ba3b2e857a02760b260b5a911b148a511d | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | # -*- coding: utf-8 -*-
"""Testing xonsh import hooks"""
import pytest
from xonsh import imphooks # noqa
from xonsh import built_ins
from xonsh.environ import Env
from xonsh.execer import Execer
from xonsh.built_ins import load_builtins, unload_builtins
import builtins
@pytest.yield_fixture(autouse=True)
def imp_en... | 24.243902 | 66 | 0.709256 |
f4a3806a891c33b26809c9c1ba6dd699b56e328e | 21,001 | py | Python | tests/components/insteon/test_config_flow.py | erogleva/core | 994ae09f69afe772150a698953c0d7386a745de2 | [
"Apache-2.0"
] | 6 | 2016-11-25T06:36:27.000Z | 2021-11-16T11:20:23.000Z | tests/components/insteon/test_config_flow.py | erogleva/core | 994ae09f69afe772150a698953c0d7386a745de2 | [
"Apache-2.0"
] | 52 | 2020-07-14T14:12:26.000Z | 2022-03-31T06:24:02.000Z | tests/components/insteon/test_config_flow.py | erogleva/core | 994ae09f69afe772150a698953c0d7386a745de2 | [
"Apache-2.0"
] | 2 | 2019-08-04T13:39:43.000Z | 2020-02-07T23:01:23.000Z | """Test the config flow for the Insteon integration."""
from homeassistant import config_entries, data_entry_flow, setup
from homeassistant.components.insteon.config_flow import (
HUB1,
HUB2,
MODEM_TYPE,
PLM,
STEP_ADD_OVERRIDE,
STEP_ADD_X10,
STEP_CHANGE_HUB_CONFIG,
STEP_HUB_V2,
STEP... | 34.655116 | 88 | 0.677968 |
ef66ae8f5b16f6c48c967efd62cb118cc537be4d | 23,917 | py | Python | onmt/inputters/inputter.py | axenov/BERT-Summarization-for-OpenNMT | b453b33efb4961ec11b9e424f65049e7b7a5146f | [
"MIT"
] | 5 | 2021-03-08T12:53:48.000Z | 2021-09-14T16:18:23.000Z | onmt/inputters/inputter.py | axenov/BERT-Summarization-for-OpenNMT | b453b33efb4961ec11b9e424f65049e7b7a5146f | [
"MIT"
] | null | null | null | onmt/inputters/inputter.py | axenov/BERT-Summarization-for-OpenNMT | b453b33efb4961ec11b9e424f65049e7b7a5146f | [
"MIT"
] | 2 | 2021-03-06T15:28:44.000Z | 2021-07-30T19:36:08.000Z | # -*- coding: utf-8 -*-
import glob
import os
import codecs
import math
from collections import Counter, defaultdict
from itertools import chain, cycle
import torch
import torchtext.data
from torchtext.data import Field
from torchtext.vocab import Vocab
from onmt.inputters.text_dataset import text_fields, TextMultiF... | 36.458841 | 79 | 0.61772 |
f866b865e5666a56b6b97532f601f6abf5871732 | 12,759 | py | Python | egg/zoo/objects_game/train.py | renata-nerenata/EGG | b8532efc3569defabeba6851986cecb0c6640984 | [
"MIT"
] | 1 | 2021-05-26T14:23:25.000Z | 2021-05-26T14:23:25.000Z | egg/zoo/objects_game/train.py | renata-nerenata/EGG | b8532efc3569defabeba6851986cecb0c6640984 | [
"MIT"
] | 1 | 2019-10-31T16:21:01.000Z | 2019-10-31T16:21:01.000Z | egg/zoo/objects_game/train.py | renata-nerenata/EGG | b8532efc3569defabeba6851986cecb0c6640984 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from __future__ import print_function
import argparse
import operator
import pathlib
import numpy as np
import torch.nn.functional as F
impor... | 49.073077 | 203 | 0.62309 |
f2fd2ad184d8dccaf787c971d75b58eb5a7a0ee0 | 1,302 | py | Python | setup.py | TinkerEdgeT/mendel-mdt | f3cc1097ab90ba5713eb3f1769f8c34265ade2fa | [
"Apache-2.0"
] | null | null | null | setup.py | TinkerEdgeT/mendel-mdt | f3cc1097ab90ba5713eb3f1769f8c34265ade2fa | [
"Apache-2.0"
] | null | null | null | setup.py | TinkerEdgeT/mendel-mdt | f3cc1097ab90ba5713eb3f1769f8c34265ade2fa | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
from setuptools import setup, find_packages
from os import path
from io import open
here = path.abspath(path.dirname(__file__))
with open(path.join(here, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
name='mendel-development-tool',
version='1.2',
descrip... | 28.933333 | 78 | 0.630568 |
6c6176059aae48f74200c2bd7a74e48f8714c186 | 13,127 | py | Python | scripts/train_fcn.py | AdityaAS/cycada | 04e062201ec23829e405639c400ce433d8a6da6a | [
"BSD-2-Clause"
] | 1 | 2020-02-22T02:23:56.000Z | 2020-02-22T02:23:56.000Z | scripts/train_fcn.py | AdityaAS/cycada | 04e062201ec23829e405639c400ce433d8a6da6a | [
"BSD-2-Clause"
] | null | null | null | scripts/train_fcn.py | AdityaAS/cycada | 04e062201ec23829e405639c400ce433d8a6da6a | [
"BSD-2-Clause"
] | null | null | null | import sys
sys.path.append('./')
import logging
import os
from os.path import join, exists
from collections import deque
import click
import math
import json
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torchvision
import torchvision.utils as vutils
from tensorboardX imp... | 43.756667 | 135 | 0.588101 |
0d1bb9801bebf3c964f56b4337529760ca807ee1 | 2,834 | py | Python | onnxruntime/test/testdata/transform/noop-add.py | lchang20/onnxruntime | 97b8f6f394ae02c73ed775f456fd85639c91ced1 | [
"MIT"
] | 6,036 | 2019-05-07T06:03:57.000Z | 2022-03-31T17:59:54.000Z | onnxruntime/test/testdata/transform/noop-add.py | lchang20/onnxruntime | 97b8f6f394ae02c73ed775f456fd85639c91ced1 | [
"MIT"
] | 5,730 | 2019-05-06T23:04:55.000Z | 2022-03-31T23:55:56.000Z | onnxruntime/test/testdata/transform/noop-add.py | lchang20/onnxruntime | 97b8f6f394ae02c73ed775f456fd85639c91ced1 | [
"MIT"
] | 1,566 | 2019-05-07T01:30:07.000Z | 2022-03-31T17:06:50.000Z | import onnx
from onnx import helper
from onnx import TensorProto, OperatorSetIdProto
opsets = []
onnxdomain = OperatorSetIdProto()
onnxdomain.version = 12
onnxdomain.domain = "" # The empty string ("") or absence of this field implies the operator set that is defined as part of the ONNX specification.
opsets.append(on... | 39.915493 | 147 | 0.586097 |
2c73f13b4a1a221a17489fe7dd8b692be8fb1e8e | 4,839 | py | Python | experiments/full_simulation/full_forearm_simulation.py | CAMI-DKFZ/simpa_paper_experiments | f5a37d57692b29b78b85d60a38e4dc0aaa5aadfc | [
"MIT"
] | null | null | null | experiments/full_simulation/full_forearm_simulation.py | CAMI-DKFZ/simpa_paper_experiments | f5a37d57692b29b78b85d60a38e4dc0aaa5aadfc | [
"MIT"
] | null | null | null | experiments/full_simulation/full_forearm_simulation.py | CAMI-DKFZ/simpa_paper_experiments | f5a37d57692b29b78b85d60a38e4dc0aaa5aadfc | [
"MIT"
] | null | null | null | # SPDX-FileCopyrightText: 2021 Computer Assisted Medical Interventions Group, DKFZ
# SPDX-FileCopyrightText: 2021 Janek Groehl
# SPDX-License-Identifier: MIT
import simpa as sp
from simpa import Tags
import numpy as np
import matplotlib.pyplot as plt
from utils.save_directory import get_save_path
from utils.create_exa... | 39.341463 | 130 | 0.750775 |
584818d7cfdc28a3e1184ea9ba1cae97bfccbe35 | 1,404 | py | Python | mne_bids/commands/run.py | zuxfoucault/mne-bids | 5c54442bced9b1bdcd4a77c9f5a347dc4b8c552d | [
"BSD-3-Clause"
] | null | null | null | mne_bids/commands/run.py | zuxfoucault/mne-bids | 5c54442bced9b1bdcd4a77c9f5a347dc4b8c552d | [
"BSD-3-Clause"
] | null | null | null | mne_bids/commands/run.py | zuxfoucault/mne-bids | 5c54442bced9b1bdcd4a77c9f5a347dc4b8c552d | [
"BSD-3-Clause"
] | null | null | null | """Command Line Interface for MNE-BIDS."""
# Authors: Teon Brooks <teon.brooks@gmail.com>
# Stefan Appelhoff <stefan.appelhoff@mailbox.org>
#
# License: BSD (3-clause)
import sys
import glob
import subprocess
import os.path as op
import mne_bids
mne_bin_dir = op.abspath(op.dirname(mne_bids.__file__))
valid_c... | 30.521739 | 76 | 0.61396 |
e1be2452850c8da7b6ce5748fbf55dfbc9fce500 | 5,255 | py | Python | conf.py | jmbowman/managing_python_package_dependencies | b1cb94a490f653a14803a869f1f81128bba12356 | [
"CC-BY-4.0"
] | null | null | null | conf.py | jmbowman/managing_python_package_dependencies | b1cb94a490f653a14803a869f1f81128bba12356 | [
"CC-BY-4.0"
] | null | null | null | conf.py | jmbowman/managing_python_package_dependencies | b1cb94a490f653a14803a869f1f81128bba12356 | [
"CC-BY-4.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# flaky_bok-choy_talk documentation build configuration file, created by
# sphinx-quickstart on Thu Apr 20 14:05:02 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present ... | 30.911765 | 100 | 0.693054 |
4e90af5d3be05b07fad62a428d2a9162dd378a9e | 4,992 | py | Python | NVIDIA/benchmarks/deepcam/implementations/pytorch/src/deepCam/utils/parser.py | mlcommons/hpc_results_v1.0 | a3f7469937aa44a48e186160a2e97464970cf72f | [
"Apache-2.0"
] | 3 | 2021-11-18T20:01:35.000Z | 2021-12-17T17:47:23.000Z | NVIDIA/benchmarks/deepcam/implementations/pytorch/src/deepCam/utils/parser.py | mlcommons/hpc_results_v1.0 | a3f7469937aa44a48e186160a2e97464970cf72f | [
"Apache-2.0"
] | 1 | 2022-03-16T07:29:30.000Z | 2022-03-31T10:19:07.000Z | LBNL/benchmarks/deepcam/implementations/deepcam-pytorch/deepCam/utils/parser.py | mlcommons/hpc_results_v1.0 | a3f7469937aa44a48e186160a2e97464970cf72f | [
"Apache-2.0"
] | 1 | 2021-11-18T01:53:25.000Z | 2021-11-18T01:53:25.000Z | import argparse as ap
#dict helper for argparse
class StoreDictKeyPair(ap.Action):
def __call__(self, parser, namespace, values, option_string=None):
my_dict = {}
for kv in values.split(","):
k,v = kv.split("=")
my_dict[k] = v
setattr(namespace, self.dest, my_dict)
... | 84.610169 | 186 | 0.701723 |
a1002f1f8aac3bf35eab69f2051a21bc53745ec8 | 1,524 | py | Python | setup.py | MLGB3/mlgb.indexer | e3e75620f3a4be01cabeff87555716e9c00599eb | [
"Apache-2.0"
] | null | null | null | setup.py | MLGB3/mlgb.indexer | e3e75620f3a4be01cabeff87555716e9c00599eb | [
"Apache-2.0"
] | null | null | null | setup.py | MLGB3/mlgb.indexer | e3e75620f3a4be01cabeff87555716e9c00599eb | [
"Apache-2.0"
] | null | null | null | import os
from setuptools import setup
from setuptools import find_packages
version = open(
os.path.join("mlgb", "indexer", "version.txt")
).read().strip()
description = "Indexing scripts for mlgb."
longdesc = open("README.md").read()
longdesc += open(os.path.join("docs", "HISTORY.rst")).read()
setup(
name=... | 30.48 | 89 | 0.665354 |
403d5581afafab673473df67de55d680e1dd80f4 | 6,859 | py | Python | scripts/purge_participant_data.py | jakehemmerle/beiwe-backend | fd7765a348a0d497341cf084bb4da0c0805748bd | [
"BSD-3-Clause"
] | null | null | null | scripts/purge_participant_data.py | jakehemmerle/beiwe-backend | fd7765a348a0d497341cf084bb4da0c0805748bd | [
"BSD-3-Clause"
] | 67 | 2020-05-22T20:34:52.000Z | 2021-07-28T14:26:57.000Z | scripts/purge_participant_data.py | tx-covid19/beiwe-backend-serverless | b154110c8543e4317d3295c0e8225e9a97b1aad4 | [
"BSD-3-Clause"
] | 2 | 2020-04-03T23:24:56.000Z | 2020-04-13T14:29:02.000Z | # python 2-3 compatibility section
try:
input = raw_input
except NameError:
pass
import imp as _imp
import json
from datetime import datetime
from sys import argv
from os.path import abspath as _abspath
from pprint import pprint
# modify python path so that this script can be targeted directly but still impor... | 32.818182 | 129 | 0.675609 |
458fe67bbd87b47d7f491e3094ffd0b215e8a58d | 10,500 | py | Python | sympy/core/tests/test_functions.py | fperez/sympy | 7d8d096215c8f65ba1d4a9c09af78ec0c3844518 | [
"BSD-3-Clause"
] | null | null | null | sympy/core/tests/test_functions.py | fperez/sympy | 7d8d096215c8f65ba1d4a9c09af78ec0c3844518 | [
"BSD-3-Clause"
] | null | null | null | sympy/core/tests/test_functions.py | fperez/sympy | 7d8d096215c8f65ba1d4a9c09af78ec0c3844518 | [
"BSD-3-Clause"
] | 1 | 2021-11-10T06:39:41.000Z | 2021-11-10T06:39:41.000Z | from sympy import Lambda, Symbol, Function, WildFunction, Derivative, sqrt, \
log, exp, Rational, Real, sign, Basic, sin, cos, diff, I, re, im, \
oo, zoo, nan, E, expand, pi, raises, O, Sum
from sympy.utilities.pytest import XFAIL
from sympy.abc import x, y
from sympy.core.function import PoleError
de... | 30.523256 | 105 | 0.544 |
af14d4c5be099018263b5d35fc0360bbace84777 | 4,137 | py | Python | hotbox_designer/templates.py | dgirondi/hotbox_designer | 2fb3f4ee01662d7607888d3f43721c5c0123068f | [
"BSD-3-Clause-Clear"
] | null | null | null | hotbox_designer/templates.py | dgirondi/hotbox_designer | 2fb3f4ee01662d7607888d3f43721c5c0123068f | [
"BSD-3-Clause-Clear"
] | null | null | null | hotbox_designer/templates.py | dgirondi/hotbox_designer | 2fb3f4ee01662d7607888d3f43721c5c0123068f | [
"BSD-3-Clause-Clear"
] | null | null | null | # coding=utf-8
SQUARE_BUTTON = {
'shape': 'square', # or round
'shape.left': 0.0,
'shape.top': 0.0,
'shape.width': 120.0,
'shape.height': 25.0,
'border': True,
'borderwidth.normal': 1.0,
'borderwidth.hovered': 1.25,
'borderwidth.clicked': 2,
... | 32.574803 | 59 | 0.505439 |
9233da3c979679e4cf1d5214def6de21f2024e1b | 3,046 | py | Python | chaingreen/rpc/rpc_client.py | todortron/chaingreen-blockchain | 89fe435e5dc87de4a7bb4d64c1ad335d81f24b95 | [
"Apache-2.0"
] | 1 | 2021-11-12T20:30:23.000Z | 2021-11-12T20:30:23.000Z | chaingreen/rpc/rpc_client.py | morrillup/chaingreen-blockchain | 0b2d008dd10228670decf360d21448a65fce48a4 | [
"Apache-2.0"
] | 19 | 2021-09-07T08:07:05.000Z | 2022-03-29T08:10:34.000Z | chaingreen/rpc/rpc_client.py | morrillup/chaingreen-blockchain | 0b2d008dd10228670decf360d21448a65fce48a4 | [
"Apache-2.0"
] | null | null | null | import asyncio
from ssl import SSLContext
from typing import Dict, List, Optional, Any
import aiohttp
from chaingreen.server.server import NodeType, ssl_context_for_client
from chaingreen.server.ssl_context import private_ssl_ca_paths
from chaingreen.types.blockchain_format.sized_bytes import bytes32
from chaingreen.... | 40.078947 | 115 | 0.692055 |
56a70b06df0463b3cd3ceaf20f4f4fcb317af191 | 747 | py | Python | bosch_thermostat_client/operation_mode/nefit_dhw.py | bosch-thermostat/bosch-thermostat-client-python | 07d8cf35f38eea0a5d6063bb49d1a5252428dd9a | [
"Apache-2.0"
] | 9 | 2021-01-16T16:46:04.000Z | 2022-03-09T11:43:21.000Z | bosch_thermostat_client/operation_mode/nefit_dhw.py | bosch-thermostat/bosch-thermostat-client-python | 07d8cf35f38eea0a5d6063bb49d1a5252428dd9a | [
"Apache-2.0"
] | 18 | 2020-09-08T07:24:03.000Z | 2021-12-08T21:32:50.000Z | bosch_thermostat_client/operation_mode/nefit_dhw.py | bosch-thermostat/bosch-thermostat-client-python | 07d8cf35f38eea0a5d6063bb49d1a5252428dd9a | [
"Apache-2.0"
] | 10 | 2020-09-19T21:04:09.000Z | 2022-03-09T11:43:45.000Z | """
Operation mode helper for DHW.
"""
from bosch_thermostat_client.const import AUTO, MANUAL, USED, VALUE, ON, OFF
from .base import OperationModeHelper
class NefitDhwOperationModeHelper(OperationModeHelper):
@property
def available_modes(self):
"""Get Bosch operations modes."""
return ["cloc... | 27.666667 | 76 | 0.646586 |
0ae7edb4118c23b02ceefcd4dd9630f3cfbf5964 | 421 | py | Python | sleap/nn/data/__init__.py | preeti98/sleap | 203c3a03c0c54f8dab242611d9a8d24595e98081 | [
"BSD-3-Clause-Clear"
] | 156 | 2020-05-01T18:43:43.000Z | 2022-03-25T10:31:18.000Z | sleap/nn/data/__init__.py | preeti98/sleap | 203c3a03c0c54f8dab242611d9a8d24595e98081 | [
"BSD-3-Clause-Clear"
] | 299 | 2020-04-20T16:37:52.000Z | 2022-03-31T23:54:48.000Z | sleap/nn/data/__init__.py | preeti98/sleap | 203c3a03c0c54f8dab242611d9a8d24595e98081 | [
"BSD-3-Clause-Clear"
] | 41 | 2020-05-14T15:25:21.000Z | 2022-03-25T12:44:54.000Z | from sleap.nn.data import augmentation
from sleap.nn.data import confidence_maps
from sleap.nn.data import instance_centroids
from sleap.nn.data import instance_cropping
from sleap.nn.data import normalization
from sleap.nn.data import pipelines
from sleap.nn.data import providers
from sleap.nn.data import resizing
fro... | 35.083333 | 44 | 0.84323 |
ab0c3bfe03b8c41ed68cef3aef6a33c459564933 | 588 | py | Python | edparser/datasets/cws/sighan2005/pku.py | attardi/iwpt-shared-task-2020 | 3a70c42d53716678776afcccf02d896655777353 | [
"Apache-2.0"
] | 3 | 2020-06-16T12:58:57.000Z | 2021-06-07T21:07:37.000Z | edparser/datasets/cws/sighan2005/pku.py | attardi/iwpt-shared-task-2020 | 3a70c42d53716678776afcccf02d896655777353 | [
"Apache-2.0"
] | 6 | 2020-06-22T07:46:49.000Z | 2022-02-10T02:22:14.000Z | edparser/datasets/cws/sighan2005/pku.py | attardi/iwpt-shared-task-2020 | 3a70c42d53716678776afcccf02d896655777353 | [
"Apache-2.0"
] | 2 | 2020-06-27T07:32:43.000Z | 2020-11-10T07:21:03.000Z | # -*- coding:utf-8 -*-
# Author: hankcs
# Date: 2019-12-21 15:42
from edparser.datasets.cws.sighan2005 import SIGHAN2005, make
SIGHAN2005_PKU_DICT = SIGHAN2005 + "#" + "gold/pku_training_words.utf8"
SIGHAN2005_PKU_TRAIN_FULL = SIGHAN2005 + "#" + "training/pku_training.utf8"
SIGHAN2005_PKU_TRAIN = SIGHAN2005 + "#" + "t... | 42 | 75 | 0.756803 |
0f4be4a272b38001c39a4c9c16a2e2f7c36506bc | 6,405 | py | Python | lte/gateway/python/magma/pipelined/tests/test_check_quota.py | fbcode/magma_old | 054ef8e079478bda36d2b13b8a88386c6dc94ef2 | [
"BSD-3-Clause"
] | null | null | null | lte/gateway/python/magma/pipelined/tests/test_check_quota.py | fbcode/magma_old | 054ef8e079478bda36d2b13b8a88386c6dc94ef2 | [
"BSD-3-Clause"
] | 6 | 2021-03-31T19:59:59.000Z | 2022-01-22T12:56:47.000Z | lte/gateway/python/magma/pipelined/tests/test_check_quota.py | fbcode/magma_old | 054ef8e079478bda36d2b13b8a88386c6dc94ef2 | [
"BSD-3-Clause"
] | null | null | null | """
Copyright (c) 2019-present, Facebook, Inc.
All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. An additional grant
of patent rights can be found in the PATENTS file in the same directory.
"""
import unittest
import warn... | 36.6 | 78 | 0.602654 |
83d4adfe24794f4693429dde191826f6ef5eb0a0 | 716 | py | Python | Algorithm/Easy/1000+/1200RelativeRanks.py | MartinYan623/Lint-Code | 57d2fa441d6496234615736e3f55d0b71aaa51dc | [
"MIT"
] | null | null | null | Algorithm/Easy/1000+/1200RelativeRanks.py | MartinYan623/Lint-Code | 57d2fa441d6496234615736e3f55d0b71aaa51dc | [
"MIT"
] | 1 | 2020-08-08T10:14:53.000Z | 2020-08-08T10:18:37.000Z | Algorithm/Easy/1000+/1200RelativeRanks.py | MartinYan623/Lint-Code | 57d2fa441d6496234615736e3f55d0b71aaa51dc | [
"MIT"
] | null | null | null | class Solution:
"""
@param nums: List[int]
@return: return List[str]
"""
def findRelativeRanks(self, nums):
# write your code here
if len(nums)==1:
return ['Gold Medal']
if len(nums)==2:
if nums[0]>nums[1]:
return ['Gold Medal','Silver ... | 31.130435 | 52 | 0.498603 |
01a463bb859fd788260eb517eb14fa7471a2f5a8 | 294 | py | Python | venv/lib/python3.9/site-packages/asyncpraw/const.py | proxamon/proxabot | 2f4858ca5a77667ddd167bf2256eecf882369a27 | [
"MIT"
] | null | null | null | venv/lib/python3.9/site-packages/asyncpraw/const.py | proxamon/proxabot | 2f4858ca5a77667ddd167bf2256eecf882369a27 | [
"MIT"
] | 12 | 2021-04-11T19:46:06.000Z | 2021-06-18T16:08:37.000Z | venv/lib/python3.9/site-packages/asyncpraw/const.py | EDiasAlberto/proxabot | 2f4858ca5a77667ddd167bf2256eecf882369a27 | [
"MIT"
] | null | null | null | """Async PRAW constants."""
from .endpoints import API_PATH # noqa: F401
__version__ = "7.2.0"
USER_AGENT_FORMAT = f"{{}} Async PRAW/{__version__}"
MAX_IMAGE_SIZE = 512000
MIN_JPEG_SIZE = 128
MIN_PNG_SIZE = 67
JPEG_HEADER = b"\xff\xd8\xff"
PNG_HEADER = b"\x89\x50\x4e\x47\x0d\x0a\x1a\x0a"
| 21 | 52 | 0.717687 |
01a04eb0de5eb21618287e76573da12dccd1460a | 2,027 | py | Python | matplotlib_exercise/select-rectangle.py | terasakisatoshi/pythonCodes | baee095ecee96f6b5ec6431267cdc6c40512a542 | [
"MIT"
] | null | null | null | matplotlib_exercise/select-rectangle.py | terasakisatoshi/pythonCodes | baee095ecee96f6b5ec6431267cdc6c40512a542 | [
"MIT"
] | null | null | null | matplotlib_exercise/select-rectangle.py | terasakisatoshi/pythonCodes | baee095ecee96f6b5ec6431267cdc6c40512a542 | [
"MIT"
] | null | null | null | from __future__ import print_function
import matplotlib.widgets as widgets
import numpy as np
import matplotlib.pyplot as plt
class MyRectangleSelector(widgets.RectangleSelector):
def release(self, event):
super(MyRectangleSelector, self).release(event)
self.to_draw.set_visible(True)
self... | 38.245283 | 79 | 0.579181 |
74773933ec98f561a6440108ecfc8852ac5d7ff6 | 3,598 | py | Python | libreoffice/sw_layout2svg.py | vmiklos/vmexam | ff4ef386d3cfd84b8ed06387cbd87b119dd50448 | [
"MIT"
] | 1 | 2015-02-09T10:21:51.000Z | 2015-02-09T10:21:51.000Z | libreoffice/sw_layout2svg.py | vmiklos/vmexam | ff4ef386d3cfd84b8ed06387cbd87b119dd50448 | [
"MIT"
] | null | null | null | libreoffice/sw_layout2svg.py | vmiklos/vmexam | ff4ef386d3cfd84b8ed06387cbd87b119dd50448 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Quick&dirty script to turn an 'SW_DEBUG=1 ./soffice' layout dump (produced by pressing F12)... | 30.752137 | 148 | 0.603669 |
91eabeb0e1ada57c20ecfe9382fc516366a302b2 | 15,179 | py | Python | lib/python2.7/site-packages/sklearn/externals/joblib/format_stack.py | wfehrnstrom/harmonize | e5661d24b2021739e8ac4bf1d3a530eda4e155b3 | [
"MIT"
] | 6,989 | 2017-07-18T06:23:18.000Z | 2022-03-31T15:58:36.000Z | lib/python2.7/site-packages/sklearn/externals/joblib/format_stack.py | wfehrnstrom/harmonize | e5661d24b2021739e8ac4bf1d3a530eda4e155b3 | [
"MIT"
] | 1,978 | 2017-07-18T09:17:58.000Z | 2022-03-31T14:28:43.000Z | lib/python2.7/site-packages/sklearn/externals/joblib/format_stack.py | wfehrnstrom/harmonize | e5661d24b2021739e8ac4bf1d3a530eda4e155b3 | [
"MIT"
] | 1,228 | 2017-07-18T09:03:13.000Z | 2022-03-29T05:57:40.000Z | """
Represent an exception with a lot of information.
Provides 2 useful functions:
format_exc: format an exception into a complete traceback, with full
debugging instruction.
format_outer_frames: format the current position in the stack call.
Adapted from IPython's VerboseTB.
"""
# Authors: Gael Varoqua... | 36.313397 | 81 | 0.542855 |
2488c3efff097d4a8d9680db7b127792179b2a00 | 494 | py | Python | src/main/resources/rqmjazz/control/retrieve_test_results.py | xebialabs-community/xlr-rqmjazz-plugin | d0053be8558ca36937f64487fd2b8d6ca1e45e68 | [
"MIT"
] | 1 | 2019-07-24T03:25:28.000Z | 2019-07-24T03:25:28.000Z | src/main/resources/rqmjazz/control/retrieve_test_results.py | xebialabs-community/xlr-rqmjazz-plugin | d0053be8558ca36937f64487fd2b8d6ca1e45e68 | [
"MIT"
] | null | null | null | src/main/resources/rqmjazz/control/retrieve_test_results.py | xebialabs-community/xlr-rqmjazz-plugin | d0053be8558ca36937f64487fd2b8d6ca1e45e68 | [
"MIT"
] | null | null | null | # Copyright (c) 2019 XebiaLabs
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
from rqmjazz.core.RQMClient import RQMClient
def process(task_vars):
server = task_vars['server']
client = RQMClient.create_client(server, username = task_vars["username"], password = ta... | 29.058824 | 112 | 0.736842 |
a6042c2ed4a6ebe41f11ab3554a8e66a1b541af4 | 196 | py | Python | Flask_IHome/map_demo_py3.py | haitaoss/flask_project | 84475d035d818382b824d535b55c29dbf61a6162 | [
"Apache-2.0"
] | null | null | null | Flask_IHome/map_demo_py3.py | haitaoss/flask_project | 84475d035d818382b824d535b55c29dbf61a6162 | [
"Apache-2.0"
] | null | null | null | Flask_IHome/map_demo_py3.py | haitaoss/flask_project | 84475d035d818382b824d535b55c29dbf61a6162 | [
"Apache-2.0"
] | null | null | null | li1 = [1, 2, 3, 4]
li2 = [2, 3]
def add(num1, num2):
return num1 + num2
# map函数,参数:函数,调用函数所需的参数
ret = map(add, li1, li2)
print(ret) # python2 返回的是list,python3返回的是map类型
print(list(ret))
| 13.066667 | 47 | 0.632653 |
a7f08c710cadce146ffb15d2f45019b005649163 | 6,940 | py | Python | sdk/lusid/models/index_model_options_all_of.py | slemasne/lusid-sdk-python-preview | 94a97951ec2052bc1672b7be21e52ad2fcf6eea0 | [
"MIT"
] | null | null | null | sdk/lusid/models/index_model_options_all_of.py | slemasne/lusid-sdk-python-preview | 94a97951ec2052bc1672b7be21e52ad2fcf6eea0 | [
"MIT"
] | null | null | null | sdk/lusid/models/index_model_options_all_of.py | slemasne/lusid-sdk-python-preview | 94a97951ec2052bc1672b7be21e52ad2fcf6eea0 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
LUSID API
FINBOURNE Technology # noqa: E501
The version of the OpenAPI document: 0.11.3725
Contact: info@finbourne.com
Generated by: https://openapi-generator.tech
"""
try:
from inspect import getfullargspec
except ImportError:
from inspect import getargspec as getf... | 36.335079 | 138 | 0.636599 |
d137400fc2dc582765d3dea5abfc2723d6105531 | 880 | py | Python | vivisect/impapi/windows/ws2plus_64.py | 4k4xs4pH1r3/vivisect | dea425eed796176309a3be46936eb682598271aa | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | vivisect/impapi/windows/ws2plus_64.py | 4k4xs4pH1r3/vivisect | dea425eed796176309a3be46936eb682598271aa | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | vivisect/impapi/windows/ws2plus_64.py | 4k4xs4pH1r3/vivisect | dea425eed796176309a3be46936eb682598271aa | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # APIs for Windows 64-bit libraries ws2_32, mswsock, wsock32, and wininet.
# Built as a delta from the 32-bit version.
# Format: retval, rettype, callconv, exactname, arglist(type, name)
# arglist type is one of ['int', 'void *']
# arglist name is one of [None, 'funcptr', 'obj', 'ptr']
# List the no... | 33.846154 | 77 | 0.703409 |
7fcff5d1c6a3ec83abb35209620bc08f133c0429 | 2,213 | py | Python | blazar_dashboard/content/hosts/forms.py | stackhpc/blazar-dashboard | c33709700f0c2ccfe89341f22cb608a785216699 | [
"Apache-2.0"
] | 7 | 2017-10-31T10:09:19.000Z | 2019-01-28T21:52:45.000Z | blazar_dashboard/content/hosts/forms.py | stackhpc/blazar-dashboard | c33709700f0c2ccfe89341f22cb608a785216699 | [
"Apache-2.0"
] | 1 | 2017-10-24T20:48:23.000Z | 2017-10-24T21:09:32.000Z | blazar_dashboard/content/hosts/forms.py | stackhpc/blazar-dashboard | c33709700f0c2ccfe89341f22cb608a785216699 | [
"Apache-2.0"
] | 5 | 2017-08-30T16:11:21.000Z | 2021-05-31T14:32:38.000Z | # 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.530303 | 78 | 0.630366 |
69ad62843f399d2a031c7f2d474e1e99fafca09a | 1,282 | py | Python | yowsup/layers/protocol_media/protocolentities/test_message_media_downloadable_video.py | zulu494/Anoa-Bot- | 6666b0257d0c5bd2ce57c473078c4059ecd0fecd | [
"MIT"
] | 1 | 2021-09-11T13:38:47.000Z | 2021-09-11T13:38:47.000Z | yowsup/layers/protocol_media/protocolentities/test_message_media_downloadable_video.py | enigma-chan/Anti-Hoax-Bot | 6666b0257d0c5bd2ce57c473078c4059ecd0fecd | [
"MIT"
] | null | null | null | yowsup/layers/protocol_media/protocolentities/test_message_media_downloadable_video.py | enigma-chan/Anti-Hoax-Bot | 6666b0257d0c5bd2ce57c473078c4059ecd0fecd | [
"MIT"
] | null | null | null | from yowsup.layers.protocol_media.protocolentities.message_media_downloadable_video \
import VideoDownloadableMediaMessageProtocolEntity
from yowsup.layers.protocol_messages.proto.e2e_pb2 import Message
from .test_message_media import MediaMessageProtocolEntityTest
class VideoDownloadableMediaMessageProtocolEntit... | 44.206897 | 86 | 0.74181 |
e029f77b89eb3ff6ee7f7a6ad38c7d54ad772544 | 407 | py | Python | Pensive/asgi.py | ajra7/Pensive | cffd14267aec21e70c99e16b55c961107605f5db | [
"Apache-2.0"
] | null | null | null | Pensive/asgi.py | ajra7/Pensive | cffd14267aec21e70c99e16b55c961107605f5db | [
"Apache-2.0"
] | null | null | null | Pensive/asgi.py | ajra7/Pensive | cffd14267aec21e70c99e16b55c961107605f5db | [
"Apache-2.0"
] | null | null | null | """
ASGI config for Pensive project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault(... | 23.941176 | 79 | 0.7543 |
d661750cffb15a4b4a9159c3979cd55d1614d9f9 | 881 | py | Python | var/spack/repos/builtin/packages/py-alabaster/package.py | msimberg/spack | 27a339eeb28007bf0844e4c331bdd7d9da13da2e | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/py-alabaster/package.py | msimberg/spack | 27a339eeb28007bf0844e4c331bdd7d9da13da2e | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/py-alabaster/package.py | msimberg/spack | 27a339eeb28007bf0844e4c331bdd7d9da13da2e | [
"ECL-2.0",
"Apache-2.0",
"MIT"
] | null | null | null | # Copyright 2013-2019 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 PyAlabaster(PythonPackage):
"""Alabaster is a visually (c)lean, responsive, configurable t... | 38.304348 | 96 | 0.758229 |
80932cb7f60cbb85cdf021c3253544964c757685 | 62,576 | py | Python | calibre-plugin/dialogs.py | stranger-danger-zamu/FanFicFare | 9ea9cf4c681ee76f792e53f0ed3829dadd0bb827 | [
"Apache-2.0"
] | 2 | 2015-04-01T19:00:25.000Z | 2015-04-01T20:09:51.000Z | calibre-plugin/dialogs.py | stranger-danger-zamu/FanFicFare | 9ea9cf4c681ee76f792e53f0ed3829dadd0bb827 | [
"Apache-2.0"
] | null | null | null | calibre-plugin/dialogs.py | stranger-danger-zamu/FanFicFare | 9ea9cf4c681ee76f792e53f0ed3829dadd0bb827 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, unicode_literals, division,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2020, Jim Miller'
__docformat__ = 'restructuredtext en'
import re
from functools import partial
import logging
logger = logging.getLogger(__n... | 37.093065 | 258 | 0.624121 |
f55f67489ae3b6803ef2b8b5142a84b4fb386795 | 4,314 | py | Python | tests/test_units.py | iamliamc/Brick | 45909dbfa39535f265072bc6bc99eb1ce504add5 | [
"BSD-3-Clause"
] | null | null | null | tests/test_units.py | iamliamc/Brick | 45909dbfa39535f265072bc6bc99eb1ce504add5 | [
"BSD-3-Clause"
] | null | null | null | tests/test_units.py | iamliamc/Brick | 45909dbfa39535f265072bc6bc99eb1ce504add5 | [
"BSD-3-Clause"
] | null | null | null | from rdflib import Namespace
import re
import brickschema
from collections import defaultdict
import warnings
import sys
sys.path.append("..")
from bricksrc.namespaces import A, BRICK, TAG, QUDT # noqa: E402
BLDG = Namespace("https://brickschema.org/schema/ExampleBuilding#")
def test_quantity_has_one_quantitykind(... | 32.931298 | 96 | 0.608252 |
ace8ec943ff987d21fe4479f9bcf27bf5aab9d24 | 10,397 | py | Python | tests/cli/test_add.py | julie777/pdm | a6029ca02105d79da4841c701edf73f7315f74eb | [
"MIT"
] | 1 | 2022-03-02T19:43:46.000Z | 2022-03-02T19:43:46.000Z | tests/cli/test_add.py | julie777/pdm | a6029ca02105d79da4841c701edf73f7315f74eb | [
"MIT"
] | 1 | 2022-03-20T07:36:27.000Z | 2022-03-20T07:36:27.000Z | tests/cli/test_add.py | julie777/pdm | a6029ca02105d79da4841c701edf73f7315f74eb | [
"MIT"
] | null | null | null | import shutil
from pathlib import Path
import pytest
from pdm.cli import actions
from pdm.models.pip_shims import Link
from pdm.models.specifiers import PySpecSet
from tests import FIXTURES
@pytest.mark.usefixtures("repository")
def test_add_package(project, working_set, is_dev):
actions.do_add(project, is_dev,... | 37.265233 | 88 | 0.697413 |
e96a7df038b2730ea468a3e0815b91778c6b7e66 | 287 | py | Python | speed-tests/python-libs/backend/json_file.py | tivvit/shus-benchmarks | 4a26ceeb3c5fe58478b3c4a0e8da2f1bdd4b2282 | [
"MIT"
] | null | null | null | speed-tests/python-libs/backend/json_file.py | tivvit/shus-benchmarks | 4a26ceeb3c5fe58478b3c4a0e8da2f1bdd4b2282 | [
"MIT"
] | 1 | 2022-03-13T12:13:37.000Z | 2022-03-13T12:13:37.000Z | speed-tests/python-libs/backend/json_file.py | tivvit/shush-benchmarks | 97869e19a57ea556dcf1e0011b8d1104b4a012a8 | [
"MIT"
] | null | null | null | import json
class JsonFile(object):
def __init__(self, fn):
self.data = json.load(open(fn, "r"))
def __contains__(self, item):
return item in self.data
def get_all(self):
return self.data
def get(self, key):
return self.data.get(key)
| 17.9375 | 44 | 0.602787 |
0fb2df8c0fac99769096596a0bbc30ac0b41100d | 37,177 | py | Python | syft/frameworks/torch/hook/hook.py | brandonhee/PySyft | 31217f28aa3d996b2bb84477fb15a990f0cb9a80 | [
"Apache-2.0"
] | 1 | 2020-07-14T18:19:25.000Z | 2020-07-14T18:19:25.000Z | syft/frameworks/torch/hook/hook.py | brandonhee/PySyft | 31217f28aa3d996b2bb84477fb15a990f0cb9a80 | [
"Apache-2.0"
] | 1 | 2020-01-25T19:33:08.000Z | 2020-01-25T19:33:08.000Z | syft/frameworks/torch/hook/hook.py | brandonhee/PySyft | 31217f28aa3d996b2bb84477fb15a990f0cb9a80 | [
"Apache-2.0"
] | 1 | 2021-12-22T05:16:43.000Z | 2021-12-22T05:16:43.000Z | import copy
from functools import wraps
import logging
from math import inf
import torch
from torch import nn
import types
import weakref
import syft
from syft.generic.frameworks.hook import hook_args
from syft.generic.frameworks.hook.hook import FrameworkHook
from syft.generic.tensor import AbstractTensor
from syft.g... | 39.761497 | 124 | 0.6231 |
50e7f02f7329e714ff496e56fbe9b35c2a32f699 | 3,217 | py | Python | tests/models/test_autoencoders.py | dandelin/pytorch-lightning-bolts | 8652a8a9f6c3e0d4b034e12d1f7b3a339f92cd0f | [
"Apache-2.0"
] | null | null | null | tests/models/test_autoencoders.py | dandelin/pytorch-lightning-bolts | 8652a8a9f6c3e0d4b034e12d1f7b3a339f92cd0f | [
"Apache-2.0"
] | null | null | null | tests/models/test_autoencoders.py | dandelin/pytorch-lightning-bolts | 8652a8a9f6c3e0d4b034e12d1f7b3a339f92cd0f | [
"Apache-2.0"
] | null | null | null | import pytest
import pytorch_lightning as pl
import torch
from pytorch_lightning import seed_everything
from pl_bolts.datamodules import CIFAR10DataModule
from pl_bolts.models.autoencoders import AE, VAE
from pl_bolts.models.autoencoders import resnet18_encoder, resnet18_decoder
from pl_bolts.models.autoencoders impor... | 29.513761 | 115 | 0.700964 |
411fa371cd9b60edc221ad75ad98c1ff5fb952f0 | 8,041 | py | Python | benchmarking/mgd3d.py | 0xDBFB7/Nyion | 9bd1c3a8a70e9d1c75e04ab63325a42cc983dedb | [
"MIT"
] | null | null | null | benchmarking/mgd3d.py | 0xDBFB7/Nyion | 9bd1c3a8a70e9d1c75e04ab63325a42cc983dedb | [
"MIT"
] | null | null | null | benchmarking/mgd3d.py | 0xDBFB7/Nyion | 9bd1c3a8a70e9d1c75e04ab63325a42cc983dedb | [
"MIT"
] | null | null | null | """
2017 (c) A. R. Malipeddi
3D geometric multigrid code for poissons equation in a cube.
- Finite difference method
- 7pt operator
- trilinear interpolation
- Two-color Gauss Seidel smoothing
"""
import matplotlib.pyplot as plt
import numpy as np
def GSrelax(B,nx,ny,nz,u,f,iters=1,flag=1):
'''
Red-Black Gau... | 31.65748 | 160 | 0.456162 |
d8e8c5c667b515fa69e7c17067714412651ba8cc | 453 | py | Python | src/sorunlib/commands.py | simonsobs/sorunlib | 08f638c2dc77d69029acdb6deb1ed2e0fbb8bfc8 | [
"BSD-2-Clause"
] | null | null | null | src/sorunlib/commands.py | simonsobs/sorunlib | 08f638c2dc77d69029acdb6deb1ed2e0fbb8bfc8 | [
"BSD-2-Clause"
] | 6 | 2022-03-10T17:07:20.000Z | 2022-03-14T15:18:44.000Z | src/sorunlib/commands.py | simonsobs/sorunlib | 08f638c2dc77d69029acdb6deb1ed2e0fbb8bfc8 | [
"BSD-2-Clause"
] | null | null | null | import time
import datetime as dt
def wait(target_time):
"""Wait until a specified time.
Args:
target_time (str): Time in ISO format to wait until,
i.e. "2015-10-21T07:28:00"
"""
t0 = dt.datetime.now()
t1 = dt.datetime.fromisoformat(target_time)
assert t1 > t0, f"time {t... | 21.571429 | 60 | 0.624724 |
da0adbbacd391d78f15a1f417375b94a89a01ce0 | 20,426 | py | Python | tmtoolkit/topicmod/evaluate.py | samir-joshi/tmtoolkit | 41f5cbddad539107016680d132ca1ee9ebe49b5c | [
"Apache-2.0"
] | 167 | 2017-11-11T11:49:32.000Z | 2022-03-15T11:45:11.000Z | tmtoolkit/topicmod/evaluate.py | samir-joshi/tmtoolkit | 41f5cbddad539107016680d132ca1ee9ebe49b5c | [
"Apache-2.0"
] | 23 | 2017-11-27T22:44:09.000Z | 2022-02-23T03:31:30.000Z | tmtoolkit/topicmod/evaluate.py | shalevy1/tmtoolkit | 42fdd388e606d6d1c45d80d2364dfa42b8408111 | [
"Apache-2.0"
] | 30 | 2018-03-27T13:00:41.000Z | 2022-03-28T12:15:33.000Z | """
Metrics for topic model evaluation.
In order to run model evaluations in parallel use one of the modules :mod:`~tmtoolkit.topicmod.tm_gensim`,
:mod:`~tmtoolkit.topicmod.tm_lda` or :mod:`~tmtoolkit.topicmod.tm_sklearn`.
"""
import numpy as np
from scipy.spatial.distance import pdist
from scipy.sparse import isspar... | 43.459574 | 126 | 0.679526 |
0c7918907bbf8b6631211ec4d640bfc6bb165e5f | 1,874 | py | Python | capstone/capdb/migrations/0051_auto_20181001_1905.py | rachelaus/capstone | 2affa02706f9b1a99d032c66f258a7421c40a35e | [
"MIT"
] | 134 | 2017-07-12T17:03:06.000Z | 2022-03-27T06:38:29.000Z | capstone/capdb/migrations/0051_auto_20181001_1905.py | rachelaus/capstone | 2affa02706f9b1a99d032c66f258a7421c40a35e | [
"MIT"
] | 1,362 | 2017-06-22T17:42:49.000Z | 2022-03-31T15:28:00.000Z | capstone/capdb/migrations/0051_auto_20181001_1905.py | rachelaus/capstone | 2affa02706f9b1a99d032c66f258a7421c40a35e | [
"MIT"
] | 38 | 2017-06-22T14:46:23.000Z | 2022-03-16T05:32:54.000Z | # Generated by Django 2.0.8 on 2018-10-01 19:05
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('capdb', '0050_fts'),
]
operations = [
migrations.CreateModel(
name='Ngram',
fields=... | 37.48 | 162 | 0.58111 |
e06b3c7184bf1af176c6cbb42dbc511b9ac75f23 | 25,178 | py | Python | rvlyzer/analysis/graphs.py | nessdoor/RVlyzer | 239beb63a4db1653261bc1cc59227ee2ddb77d1a | [
"MIT"
] | null | null | null | rvlyzer/analysis/graphs.py | nessdoor/RVlyzer | 239beb63a4db1653261bc1cc59227ee2ddb77d1a | [
"MIT"
] | null | null | null | rvlyzer/analysis/graphs.py | nessdoor/RVlyzer | 239beb63a4db1653261bc1cc59227ee2ddb77d1a | [
"MIT"
] | null | null | null | from __future__ import annotations
from enum import Enum
from itertools import chain, tee, repeat
from operator import attrgetter
from typing import FrozenSet, List, Tuple, Optional, Mapping, Hashable, Iterable, MutableMapping, \
NamedTuple, Dict, Union
from networkx import DiGraph, simple_cycles, restricted_view... | 43.864111 | 120 | 0.698308 |
d9aa957182d6521f7cd86108ab6408f7edfe4d78 | 2,663 | py | Python | pandas/tests/test_msgpack/test_limits.py | springcoil/pandas | 945075ad78cef652039feb50d60092b0580604e6 | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | 652 | 2015-07-26T00:00:17.000Z | 2022-02-24T18:30:04.000Z | pandas/tests/test_msgpack/test_limits.py | springcoil/pandas | 945075ad78cef652039feb50d60092b0580604e6 | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | 8 | 2015-09-07T03:38:19.000Z | 2021-05-23T03:18:51.000Z | pandas/tests/test_msgpack/test_limits.py | springcoil/pandas | 945075ad78cef652039feb50d60092b0580604e6 | [
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"BSD-3-Clause"
] | 40 | 2015-07-24T19:45:08.000Z | 2021-11-01T14:54:56.000Z | #!/usr/bin/env python
# coding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
import pandas.util.testing as tm
from pandas.msgpack import packb, unpackb, Packer, Unpacker, ExtType
class TestLimits(tm.TestCase):
def test_integer(self):
x = -(2 ** 63)
asser... | 28.031579 | 82 | 0.614345 |
36fa1044f90401ce931c47d01539df024db862bf | 644 | py | Python | edukasi/migrations/0028_auto_20210114_1654.py | irzaip/trampill_py | 74310e44864ab1bb8b20f529c21079cbd8076875 | [
"MIT"
] | 2 | 2020-11-21T04:25:11.000Z | 2021-07-07T08:26:10.000Z | edukasi/migrations/0028_auto_20210114_1654.py | irzaip/trampill_py | 74310e44864ab1bb8b20f529c21079cbd8076875 | [
"MIT"
] | 7 | 2021-07-04T14:55:48.000Z | 2021-09-08T12:51:22.000Z | edukasi/migrations/0028_auto_20210114_1654.py | irzaip/trampill_py | 74310e44864ab1bb8b20f529c21079cbd8076875 | [
"MIT"
] | 1 | 2021-09-10T06:05:49.000Z | 2021-09-10T06:05:49.000Z | # Generated by Django 3.1.2 on 2021-01-14 09:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('edukasi', '0027_review'),
]
operations = [
migrations.AddField(
model_name='review',
name='date_create... | 26.833333 | 122 | 0.509317 |
37db91139e5ae03f7d95a6648f26f63231204928 | 6,491 | py | Python | external/BB2SegNet/refinement_net/core/Engine.py | zhuhu00/MOTSFusion_modify | 190224a7c3fbded69fedf9645a0ebbf08227fb6d | [
"MIT"
] | 154 | 2019-07-25T02:27:39.000Z | 2022-02-18T19:40:43.000Z | external/BB2SegNet/refinement_net/core/Engine.py | zhuhu00/MOTSFusion_modify | 190224a7c3fbded69fedf9645a0ebbf08227fb6d | [
"MIT"
] | 4 | 2019-11-12T00:38:54.000Z | 2021-08-14T08:40:12.000Z | external/BB2SegNet/refinement_net/core/Engine.py | zhuhu00/MOTSFusion_modify | 190224a7c3fbded69fedf9645a0ebbf08227fb6d | [
"MIT"
] | 25 | 2019-09-17T08:49:57.000Z | 2022-03-21T20:11:57.000Z | import tensorflow as tf
from external.BB2SegNet.refinement_net.core import Measures
from external.BB2SegNet.refinement_net.core.Log import log
from external.BB2SegNet.refinement_net.core.Measures import measures_string_to_print, accumulate_measures, compute_measures_average
from external.BB2SegNet.refinement_net.core.... | 45.391608 | 131 | 0.725158 |
2bf1e601e8bd724c073a00fd575e78ced4e13706 | 53,264 | py | Python | src/bondora_api/models/loan_part_details.py | parruc/bondora_api | f36ea8d7149d75a2e5f14a695e5a4e57f0a3518d | [
"Apache-2.0"
] | 8 | 2019-03-09T20:38:27.000Z | 2021-02-10T20:44:22.000Z | src/bondora_api/models/loan_part_details.py | parruc/bondora_api | f36ea8d7149d75a2e5f14a695e5a4e57f0a3518d | [
"Apache-2.0"
] | 1 | 2018-03-06T09:44:21.000Z | 2018-03-06T09:44:21.000Z | src/bondora_api/models/loan_part_details.py | parruc/bondora_api | f36ea8d7149d75a2e5f14a695e5a4e57f0a3518d | [
"Apache-2.0"
] | 3 | 2019-06-03T13:44:05.000Z | 2020-11-16T13:17:38.000Z | # coding: utf-8
"""
Bondora API V1
Bondora API version 1
OpenAPI spec version: v1
Contact: investor@bondora.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance ... | 34.904325 | 1,343 | 0.663863 |
09463f4ceba2674bc43b5fac3a30cc57727dbdfd | 3,012 | py | Python | lib/tests/ServerTestCase.py | Camilo-Mendoza/streamlit-ML | be8aafdf9f334b92a6e056e6c4f994da82587f80 | [
"Apache-2.0"
] | null | null | null | lib/tests/ServerTestCase.py | Camilo-Mendoza/streamlit-ML | be8aafdf9f334b92a6e056e6c4f994da82587f80 | [
"Apache-2.0"
] | 9 | 2021-03-01T20:47:52.000Z | 2022-02-12T20:49:50.000Z | lib/tests/ServerTestCase.py | Camilo-Mendoza/streamlit-ML | be8aafdf9f334b92a6e056e6c4f994da82587f80 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2018-2019 Streamlit 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 applicabl... | 34.227273 | 78 | 0.669323 |
8c0322741b983325f1644cb066eb81b6673866d8 | 26,989 | py | Python | source/pydwf/core/auxiliary/enum_types.py | sidneycadot/pydwf | cd9eba8b45d990f09095bec62b20115f0757baba | [
"MIT"
] | 14 | 2021-05-10T16:19:45.000Z | 2022-03-13T08:30:12.000Z | source/pydwf/core/auxiliary/enum_types.py | sidneycadot/pydwf | cd9eba8b45d990f09095bec62b20115f0757baba | [
"MIT"
] | 22 | 2021-05-01T09:51:09.000Z | 2021-11-13T12:35:36.000Z | source/pydwf/core/auxiliary/enum_types.py | sidneycadot/pydwf | cd9eba8b45d990f09095bec62b20115f0757baba | [
"MIT"
] | 2 | 2021-05-02T12:13:16.000Z | 2022-03-11T21:15:07.000Z | """This module defines Python equivalents of the enumerations found in the C library header file *dwf.h*.
Note:
The obsolete enumerations *TRIGCOND* and *STS* that are defined in the C header file have not been defined here.
*TRIGCOND* has been replaced by |DwfTriggerSlope:link|; *STS* has been replaced by |Dw... | 27.124623 | 154 | 0.666716 |
bebc326041fdb6d1b0586916a42face43bc25ad8 | 6,972 | py | Python | train.py | zijundeng/DM2F-Net | d6f231f8a3f1a3c5ca877b30d8778b9bb9b76668 | [
"MIT"
] | 30 | 2019-07-23T06:44:48.000Z | 2021-03-27T16:18:55.000Z | train.py | zijundeng/DM2F-Net | d6f231f8a3f1a3c5ca877b30d8778b9bb9b76668 | [
"MIT"
] | 3 | 2019-10-29T14:04:30.000Z | 2022-03-30T10:27:08.000Z | train.py | zijundeng/DM2F-Net | d6f231f8a3f1a3c5ca877b30d8778b9bb9b76668 | [
"MIT"
] | 6 | 2019-10-30T03:04:53.000Z | 2022-01-02T14:28:20.000Z | # coding: utf-8
import argparse
import os
import datetime
from tqdm import tqdm
import torch
from torch import nn
from torch import optim
from torch.backends import cudnn
from torch.utils.data import DataLoader
from model import DM2FNet
from tools.config import TRAIN_ITS_ROOT, TEST_SOTS_ROOT
from datasets import ItsD... | 34.686567 | 115 | 0.590361 |
9142b7ea35029a0e278ff84ce14454906bc2d967 | 1,245 | py | Python | mfile/urls.py | vikifox/CMDB | bac9b7da204c3eee344f55bb2187df38ef3b3d4c | [
"Apache-2.0"
] | 16 | 2020-08-13T04:28:50.000Z | 2021-06-10T06:24:51.000Z | mfile/urls.py | vikifox/CMDB | bac9b7da204c3eee344f55bb2187df38ef3b3d4c | [
"Apache-2.0"
] | 1 | 2019-04-15T07:01:42.000Z | 2019-04-15T07:01:42.000Z | mfile/urls.py | vikifox/CMDB | bac9b7da204c3eee344f55bb2187df38ef3b3d4c | [
"Apache-2.0"
] | 2 | 2018-12-05T09:51:34.000Z | 2019-12-16T16:26:41.000Z | """example_project URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
... | 36.617647 | 87 | 0.719679 |
0e06325f4bcdcc1a7d72eb5ff1f9989d17fba35c | 8,374 | py | Python | fpn/train_end2end.py | jyqi/mx-viddet | af89ed736362fecdd1ee5e6584d9b221c59ff8c4 | [
"MIT"
] | null | null | null | fpn/train_end2end.py | jyqi/mx-viddet | af89ed736362fecdd1ee5e6584d9b221c59ff8c4 | [
"MIT"
] | null | null | null | fpn/train_end2end.py | jyqi/mx-viddet | af89ed736362fecdd1ee5e6584d9b221c59ff8c4 | [
"MIT"
] | null | null | null | # --------------------------------------------------------
# Deformable Convolutional Networks
# Copyright (c) 2017 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Modified by Haozhi Qi
# --------------------------------------------------------
# Based on:
# MX-RCNN
# Copyright (c) 2016 by Contri... | 45.264865 | 152 | 0.709219 |
c1cd6be83de1edf00e5353689a3e01683e0f8b0c | 1,379 | py | Python | dialogue-engine/test/programytest/parser/test_factory.py | cotobadesign/cotoba-agent-oss | 3833d56e79dcd7529c3e8b3a3a8a782d513d9b12 | [
"MIT"
] | 104 | 2020-03-30T09:40:00.000Z | 2022-03-06T22:34:25.000Z | dialogue-engine/test/programytest/parser/test_factory.py | cotobadesign/cotoba-agent-oss | 3833d56e79dcd7529c3e8b3a3a8a782d513d9b12 | [
"MIT"
] | 25 | 2020-06-12T01:36:35.000Z | 2022-02-19T07:30:44.000Z | dialogue-engine/test/programytest/parser/test_factory.py | cotobadesign/cotoba-agent-oss | 3833d56e79dcd7529c3e8b3a3a8a782d513d9b12 | [
"MIT"
] | 10 | 2020-04-02T23:43:56.000Z | 2021-05-14T13:47:01.000Z | """
Copyright (c) 2020 COTOBA DESIGN, Inc.
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, publish, distri... | 49.25 | 126 | 0.778825 |
1895bcc815ab09c601263457f04cb70db3750ef1 | 209 | py | Python | tint/testing/sample_files.py | Cxl1013/TINT | 479c5899713d149003096fbbc900b3c52793394d | [
"BSD-2-Clause"
] | 53 | 2017-12-11T14:27:19.000Z | 2021-11-03T06:16:44.000Z | tint/testing/sample_files.py | Cxl1013/TINT | 479c5899713d149003096fbbc900b3c52793394d | [
"BSD-2-Clause"
] | 14 | 2017-09-25T16:08:46.000Z | 2021-11-30T19:25:12.000Z | tint/testing/sample_files.py | Cxl1013/TINT | 479c5899713d149003096fbbc900b3c52793394d | [
"BSD-2-Clause"
] | 38 | 2017-07-24T13:49:06.000Z | 2021-11-03T06:16:43.000Z | """
============
Sample Files
============
Sample files for unit tests.
"""
import os
DATA_PATH = os.path.join(os.path.dirname(__file__), 'data')
SAMPLE_GRID_FILE = os.path.join(DATA_PATH, 'test_grid.nc')
| 14.928571 | 59 | 0.631579 |
34d5eafd9e629f1bec348aad49e25ac6a77c8a23 | 4,277 | py | Python | benchmark/startQiskit_noisy3047.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_noisy3047.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit_noisy3047.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=4
# total number=41
import cirq
import qiskit
from qiskit.providers.aer import QasmSimulator
from qiskit.test.mock import FakeVigo
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import ... | 34.772358 | 140 | 0.653963 |
93cc02a61fcbf1e0ecc0596f34d2f996a33043ee | 231 | py | Python | offline_install/portalocker-2.0.0/portalocker/__about__.py | weisenpan/detectron2-master | a8e0954c414d63fa09e54aeae60e31aa437acaa3 | [
"Apache-2.0"
] | null | null | null | offline_install/portalocker-2.0.0/portalocker/__about__.py | weisenpan/detectron2-master | a8e0954c414d63fa09e54aeae60e31aa437acaa3 | [
"Apache-2.0"
] | null | null | null | offline_install/portalocker-2.0.0/portalocker/__about__.py | weisenpan/detectron2-master | a8e0954c414d63fa09e54aeae60e31aa437acaa3 | [
"Apache-2.0"
] | null | null | null | __package_name__ = 'portalocker'
__author__ = 'Rick van Hattem'
__email__ = 'wolph@wol.ph'
__version__ = '2.0.0'
__description__ = '''Wraps the portalocker recipe for easy usage'''
__url__ = 'https://github.com/WoLpH/portalocker'
| 28.875 | 67 | 0.744589 |
e26e4a1989fd12a46da08aa9ff0d7dfe330613ee | 881 | py | Python | tasks.py | lixiang2017/patchwork | d653591cc8130765978a91d02c4cd108e76cca06 | [
"BSD-2-Clause"
] | 157 | 2015-01-07T06:48:34.000Z | 2022-03-21T10:04:55.000Z | tasks.py | lixiang2017/patchwork | d653591cc8130765978a91d02c4cd108e76cca06 | [
"BSD-2-Clause"
] | 23 | 2015-08-12T06:34:56.000Z | 2021-09-13T19:25:31.000Z | tasks.py | lixiang2017/patchwork | d653591cc8130765978a91d02c4cd108e76cca06 | [
"BSD-2-Clause"
] | 43 | 2016-01-05T05:08:27.000Z | 2021-11-11T13:11:12.000Z | from importlib import import_module
from invocations import docs, travis
from invocations.checks import blacken
from invocations.packaging import release
from invocations.pytest import test, coverage
from invoke import Collection, task
@task
def sanity(c):
"""
Quick sanity check to ensure we're installed su... | 25.911765 | 77 | 0.649262 |
d57013c3a422214c3904f24a839a29eb6d78ce1b | 2,570 | py | Python | cherrypy/test/test_wsgi_ns.py | seshness/bearlol | ff89bc1e66a96b6e55538a5cee38370e08e5b682 | [
"BSD-3-Clause"
] | 2 | 2020-12-28T22:37:45.000Z | 2021-01-23T18:04:46.000Z | cherrypy/test/test_wsgi_ns.py | seshness/bearlol | ff89bc1e66a96b6e55538a5cee38370e08e5b682 | [
"BSD-3-Clause"
] | null | null | null | cherrypy/test/test_wsgi_ns.py | seshness/bearlol | ff89bc1e66a96b6e55538a5cee38370e08e5b682 | [
"BSD-3-Clause"
] | null | null | null | import cherrypy
from cherrypy.test import helper
class WSGI_Namespace_Test(helper.CPWebCase):
def setup_server():
class WSGIResponse(object):
def __init__(self, appresults):
self.appresults = appresults
self.iter = iter(appresults)
... | 31.728395 | 77 | 0.473541 |
abb8f1549151fa72494ab62b8e83933a0bdc8dba | 19,498 | py | Python | venv/lib/python3.8/site-packages/_pytest/terminal.py | LachlanAttwood/ConvertMe | da544b5cacead3213dab76e9e716222b011d7688 | [
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/_pytest/terminal.py | LachlanAttwood/ConvertMe | da544b5cacead3213dab76e9e716222b011d7688 | [
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/_pytest/terminal.py | LachlanAttwood/ConvertMe | da544b5cacead3213dab76e9e716222b011d7688 | [
"MIT"
] | null | null | null | """ terminal reporting of the full testing process.
This is a good source for looking at the various reporting hooks.
"""
import pytest
import py
import sys
def pytest_addoption(parser):
group = parser.getgroup("terminal reporting", "reporting", after="general")
group._addoption('-v', '--verbose', action="cou... | 36.92803 | 85 | 0.544364 |
6c1262fbdb6d9df782631aa31451550c92bb7ef2 | 6,569 | py | Python | setup.py | giammi56/iminuit | afd9f4d48d8e9500875f992f663f1a2f609b9575 | [
"MIT"
] | null | null | null | setup.py | giammi56/iminuit | afd9f4d48d8e9500875f992f663f1a2f609b9575 | [
"MIT"
] | null | null | null | setup.py | giammi56/iminuit | afd9f4d48d8e9500875f992f663f1a2f609b9575 | [
"MIT"
] | null | null | null | # Use CFLAGS="-g -Og -DDEBUG" python setup.py ... for debugging
import os
import platform
from os.path import dirname, join, exists
from glob import glob
from setuptools import setup, Extension
from setuptools.command.build_ext import build_ext
from distutils.ccompiler import CCompiler
from distutils.unixccompiler imp... | 32.359606 | 98 | 0.650023 |
057b5ac645c39da8f8ce5be9de53053ce1161ee0 | 6,229 | py | Python | apps/eth/migrations/0001_squashed_0005_transactionreceipt_evm_hash.py | kevingduck/transmission | c29ae529c02c885cdb0e64a35d7d4750ab1b8001 | [
"Apache-2.0"
] | 19 | 2018-09-04T14:49:01.000Z | 2020-06-09T22:13:10.000Z | apps/eth/migrations/0001_squashed_0005_transactionreceipt_evm_hash.py | kevingduck/transmission | c29ae529c02c885cdb0e64a35d7d4750ab1b8001 | [
"Apache-2.0"
] | 50 | 2018-09-18T17:28:57.000Z | 2021-01-09T16:18:45.000Z | apps/eth/migrations/0001_squashed_0005_transactionreceipt_evm_hash.py | kevingduck/transmission | c29ae529c02c885cdb0e64a35d7d4750ab1b8001 | [
"Apache-2.0"
] | 4 | 2019-12-15T13:44:18.000Z | 2021-06-09T20:39:54.000Z | # Generated by Django 3.0.8 on 2020-10-08 22:05
import apps.eth.fields
import django.core.validators
from django.db import migrations, models
import django.db.migrations.operations.special
import django.db.models.deletion
import django_extensions.db.fields.json
import shipchain_common.utils
class Migration(migration... | 65.568421 | 234 | 0.632686 |
89e9e6c7f00a5a24a4065c8166003486c11ca018 | 9,567 | py | Python | myven/lib/python3.8/site-packages/ansible/modules/network/f5/bigip_traffic_group.py | baltham/dne-dna-code | 4a13309a790a670d2f07e635c9264a0c29976c6a | [
"MIT"
] | 1 | 2021-04-02T08:08:39.000Z | 2021-04-02T08:08:39.000Z | myven/lib/python3.8/site-packages/ansible/modules/network/f5/bigip_traffic_group.py | baltham/dne-dna-code | 4a13309a790a670d2f07e635c9264a0c29976c6a | [
"MIT"
] | null | null | null | myven/lib/python3.8/site-packages/ansible/modules/network/f5/bigip_traffic_group.py | baltham/dne-dna-code | 4a13309a790a670d2f07e635c9264a0c29976c6a | [
"MIT"
] | 1 | 2020-05-03T01:13:16.000Z | 2020-05-03T01:13:16.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2017, F5 Networks Inc.
# GNU General Public License v3.0 (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
... | 28.221239 | 91 | 0.621616 |
d814f7b0291017950bb93fd73c29647f71579dc2 | 2,556 | py | Python | tests/unit/test_models.py | ixc/wagtail-personalisation | 956c1bf4f5846ad86470c41df8b8364bc99ab99b | [
"MIT"
] | null | null | null | tests/unit/test_models.py | ixc/wagtail-personalisation | 956c1bf4f5846ad86470c41df8b8364bc99ab99b | [
"MIT"
] | 2 | 2021-03-11T01:25:00.000Z | 2022-02-10T23:17:24.000Z | tests/unit/test_models.py | ixc/wagtail-personalisation | 956c1bf4f5846ad86470c41df8b8364bc99ab99b | [
"MIT"
] | null | null | null | from __future__ import absolute_import, unicode_literals
import datetime
import pytest
from django.db.models import ProtectedError
from tests.factories.page import ContentPageFactory
from tests.factories.segment import SegmentFactory
from tests.site.pages import models
from wagtail_personalisation.models import Pers... | 33.631579 | 78 | 0.81651 |
bae7ddc1dcb0e1045147077d33b8173211e4d9dd | 5,179 | py | Python | kdaHDFE/kdaHDFE.py | sbaker-dev/kdaHDFE | 8e442f24002deb8b90f6b358777572f271e1df20 | [
"BSD-3-Clause"
] | null | null | null | kdaHDFE/kdaHDFE.py | sbaker-dev/kdaHDFE | 8e442f24002deb8b90f6b358777572f271e1df20 | [
"BSD-3-Clause"
] | null | null | null | kdaHDFE/kdaHDFE.py | sbaker-dev/kdaHDFE | 8e442f24002deb8b90f6b358777572f271e1df20 | [
"BSD-3-Clause"
] | null | null | null | from kdaHDFE import formula_transform, clustered_error, is_nested, robust_err, Result, demean
import statsmodels.api as sm
import pandas as pd
import numpy as np
class HDFE:
def __init__(self, data_frame, formula, robust=False, cm="cgm", ps_def=True, epsilon=1e-8, max_iter=1e6,
mean_squared_erro... | 45.831858 | 120 | 0.63912 |
cfe5fd52542800bd7b4d1bc9e2acaf9ee50d5d1f | 4,140 | py | Python | retriever/modifiedBM25/getEntityMatch/entity_match.py | dheeraj7596/HashNews | 2c849bf6bdda40e8caa328754d5ba3cee2ce507f | [
"MIT"
] | null | null | null | retriever/modifiedBM25/getEntityMatch/entity_match.py | dheeraj7596/HashNews | 2c849bf6bdda40e8caa328754d5ba3cee2ce507f | [
"MIT"
] | null | null | null | retriever/modifiedBM25/getEntityMatch/entity_match.py | dheeraj7596/HashNews | 2c849bf6bdda40e8caa328754d5ba3cee2ce507f | [
"MIT"
] | 1 | 2021-04-28T21:54:39.000Z | 2021-04-28T21:54:39.000Z | # get entity_matches.json and entity_matches_random.json
import pandas as pd
from collections import defaultdict
import json
import argparse
import time
from datetime import datetime, timedelta
# entity_path = "../data/"
# tweet_path = "ne_tweets_ner.txt"
# news_path = "ne_randomnews.txt"
data_path = "/data... | 36.637168 | 96 | 0.657246 |
89441d5a4c0586d49803d1e74637d42f324020cd | 5,989 | py | Python | pybind/slxos/v16r_1_00b/igmp_snooping/ip/igmp/igmp_snooping/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v16r_1_00b/igmp_snooping/ip/igmp/igmp_snooping/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/slxos/v16r_1_00b/igmp_snooping/ip/igmp/igmp_snooping/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | 1 | 2021-11-05T22:15:42.000Z | 2021-11-05T22:15:42.000Z |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | 48.691057 | 494 | 0.711638 |
b0581eba78a64403ab0b340626f84ab97ed016d7 | 1,005 | py | Python | pybamm/input/parameters/lithium-ion/electrolytes/lipf6_EC_EMC_3_7_Landesfeind2019/electrolyte_conductivity_EC_EMC_3_7_Landesfeind2019.py | YannickNoelStephanKuhn/PyBaMM | d90636a755b7b77bbc75ae7bc2728c8ee2fa730a | [
"BSD-3-Clause"
] | 1 | 2021-03-06T15:10:34.000Z | 2021-03-06T15:10:34.000Z | pybamm/input/parameters/lithium_ion/electrolytes/lipf6_EC_EMC_3_7_Landesfeind2019/electrolyte_conductivity_EC_EMC_3_7_Landesfeind2019.py | masoodtamaddon/PyBaMM | a31e2095600bb92e913598ac4d02b2b6b77b31c1 | [
"BSD-3-Clause"
] | 1 | 2021-01-23T08:54:49.000Z | 2021-01-23T08:54:49.000Z | pybamm/input/parameters/lithium_ion/electrolytes/lipf6_EC_EMC_3_7_Landesfeind2019/electrolyte_conductivity_EC_EMC_3_7_Landesfeind2019.py | masoodtamaddon/PyBaMM | a31e2095600bb92e913598ac4d02b2b6b77b31c1 | [
"BSD-3-Clause"
] | 2 | 2020-05-21T23:16:29.000Z | 2020-06-22T10:11:40.000Z | from electrolyte_base_Landesfeind2019 import (
electrolyte_conductivity_base_Landesfeind2019,
)
import numpy as np
def electrolyte_conductivity_EC_EMC_3_7_Landesfeind2019(c_e, T):
"""
Conductivity of LiPF6 in EC:EMC (3:7 w:w) as a function of ion concentration and
temperature. The data comes from [1].... | 30.454545 | 85 | 0.689552 |
1bf4a42baff4f7c431b10e2523657a977dd9e992 | 954 | py | Python | django_school/classroom/views/classroom.py | Juan-Bogota/Django-Chat-Educatech | 146701fcf10e949fdc08114bff284a164e870be6 | [
"MIT"
] | 1 | 2020-06-11T04:00:02.000Z | 2020-06-11T04:00:02.000Z | django_school/classroom/views/classroom.py | Juan-Bogota/Django-Chat-Educatech | 146701fcf10e949fdc08114bff284a164e870be6 | [
"MIT"
] | 4 | 2021-09-08T02:09:11.000Z | 2022-03-12T00:34:57.000Z | django_school/classroom/views/classroom.py | Juan-Bogota/Django-Chat-Educatech | 146701fcf10e949fdc08114bff284a164e870be6 | [
"MIT"
] | 2 | 2020-06-16T16:28:21.000Z | 2020-08-03T15:13:34.000Z |
# Django
# standard library
from django.shortcuts import redirect, render
from django.views.generic import TemplateView
from django.contrib import messages
from django.contrib.auth import authenticate
"""
- Redirecting to the html template
- Model view to be controled by the urls and based on the models
"""
... | 34.071429 | 118 | 0.716981 |
bbb285a72ffc85fa7197ae91658cd9115d75f353 | 67,298 | py | Python | sympy/core/basic.py | pecan-pine/sympy | 3219093a5ae34abd549acf0f4c1b67d419bddc2a | [
"BSD-3-Clause"
] | 1 | 2020-05-04T11:36:24.000Z | 2020-05-04T11:36:24.000Z | sympy/core/basic.py | mmelotti/sympy | bea29026d27cc50c2e6a5501b6a70a9629ed3e18 | [
"BSD-3-Clause"
] | 1 | 2020-04-22T12:45:26.000Z | 2020-04-22T12:45:26.000Z | sympy/core/basic.py | mmelotti/sympy | bea29026d27cc50c2e6a5501b6a70a9629ed3e18 | [
"BSD-3-Clause"
] | null | null | null | """Base class for all the objects in SymPy"""
from collections import defaultdict
from itertools import chain, zip_longest
from .assumptions import BasicMeta, ManagedProperties
from .cache import cacheit
from .sympify import _sympify, sympify, SympifyError
from .compatibility import iterable, ordered, Mapping
from .si... | 32.558297 | 103 | 0.541636 |
622ad4b4f05351c221876743af67071d37ed4608 | 1,098 | py | Python | app/widgets/autotooltipdelegate.py | apardyl/kraksat-receiver | 9d9f17853e2a19c657a096f0dc395142df29cc98 | [
"MIT"
] | 1 | 2019-10-01T19:04:28.000Z | 2019-10-01T19:04:28.000Z | app/widgets/autotooltipdelegate.py | apardyl/kraksat-receiver | 9d9f17853e2a19c657a096f0dc395142df29cc98 | [
"MIT"
] | null | null | null | app/widgets/autotooltipdelegate.py | apardyl/kraksat-receiver | 9d9f17853e2a19c657a096f0dc395142df29cc98 | [
"MIT"
] | null | null | null | import html
from PyQt5.QtCore import QEvent, Qt
from PyQt5.QtWidgets import QStyledItemDelegate, QToolTip
class AutoToolTipDelegate(QStyledItemDelegate):
"""
Item delegate that automatically displays a ToolTip for an item if it is
too long to be displayed.
"""
def helpEvent(self, event, view, op... | 32.294118 | 77 | 0.577413 |
86157feefd3062dbbce8e21d86871d2d51df6771 | 7,126 | py | Python | lib/datasets/imdb.py | svebk/py-faster-rcnn | 1d0c40c42930f8e89634c057a0ed902aace395bd | [
"BSD-2-Clause"
] | null | null | null | lib/datasets/imdb.py | svebk/py-faster-rcnn | 1d0c40c42930f8e89634c057a0ed902aace395bd | [
"BSD-2-Clause"
] | null | null | null | lib/datasets/imdb.py | svebk/py-faster-rcnn | 1d0c40c42930f8e89634c057a0ed902aace395bd | [
"BSD-2-Clause"
] | null | null | null | # --------------------------------------------------------
# Fast R-CNN
# Copyright (c) 2015 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Ross Girshick
# --------------------------------------------------------
import os
import os.path as osp
import PIL
from utils.cython_bbox impor... | 35.277228 | 80 | 0.544345 |
9283c4d9e5efbedd7adb3cfd219f84db2d0d7af2 | 520 | py | Python | .buildozer/android/platform/build-armeabi-v7a/build/venv/lib/python3.7/site-packages/cython.py | VPetras/mobile-test-app | 6708dade6873ae2fb1ecb13aa70662f95fb42dc6 | [
"MIT"
] | 6,663 | 2015-01-02T06:06:43.000Z | 2022-03-31T10:35:02.000Z | cython.py | holzschu/cython | 8f6c7f707b28cb8e76ecbf5fcd089c6255dacdb8 | [
"Apache-2.0"
] | 3,094 | 2015-01-01T15:44:13.000Z | 2022-03-31T19:49:57.000Z | cython.py | scoder/cython | ddaaa7b8bfe9885b7bed432cd0a5ab8191d112cd | [
"Apache-2.0"
] | 1,425 | 2015-01-12T07:21:27.000Z | 2022-03-30T14:10:40.000Z | #!/usr/bin/env python
#
# Cython -- Main Program, generic
#
if __name__ == '__main__':
import os
import sys
# Make sure we import the right Cython
cythonpath, _ = os.path.split(os.path.realpath(__file__))
sys.path.insert(0, cythonpath)
from Cython.Compiler.Main import main
main(comman... | 20.8 | 61 | 0.684615 |
69913efb05036960daa0985af40721d5f3cb2e2f | 483 | py | Python | .jenkins/remove_invisible_code_block_from_ipynb.py | rgommers/tutorials | 9341570d4d8ed2c77371eac3b8520f7038d731ee | [
"BSD-3-Clause"
] | 6,424 | 2017-01-18T17:57:30.000Z | 2022-03-31T11:43:48.000Z | .jenkins/remove_invisible_code_block_from_ipynb.py | rgommers/tutorials | 9341570d4d8ed2c77371eac3b8520f7038d731ee | [
"BSD-3-Clause"
] | 1,713 | 2017-01-18T18:50:08.000Z | 2022-03-31T14:57:25.000Z | .jenkins/remove_invisible_code_block_from_ipynb.py | rgommers/tutorials | 9341570d4d8ed2c77371eac3b8520f7038d731ee | [
"BSD-3-Clause"
] | 3,932 | 2017-01-18T21:11:46.000Z | 2022-03-31T10:24:24.000Z | import sys
from bs4 import BeautifulSoup
ipynb_file_path = sys.argv[1]
output_file_path = sys.argv[2]
with open(ipynb_file_path, 'r', encoding='utf-8') as ipynb_file:
ipynb_lines = ipynb_file.readlines()
ipynb_out_lines = []
for line in ipynb_lines:
if not '%%%%%%INVISIBLE_CODE_BLOCK%%%%%%' in line:
... | 25.421053 | 66 | 0.714286 |
e3949948a19c0babfb11d1a390c1c6a5caed8216 | 2,405 | py | Python | app/grandchallenge/products/templatetags/products_tags.py | nlessmann/grand-challenge.org | 36abf6ccb40e2fc3fd3ff00e81deabd76f7e1ef8 | [
"Apache-2.0"
] | 101 | 2018-04-11T14:48:04.000Z | 2022-03-28T00:29:48.000Z | app/grandchallenge/products/templatetags/products_tags.py | nlessmann/grand-challenge.org | 36abf6ccb40e2fc3fd3ff00e81deabd76f7e1ef8 | [
"Apache-2.0"
] | 1,733 | 2018-03-21T11:56:16.000Z | 2022-03-31T14:58:30.000Z | app/grandchallenge/products/templatetags/products_tags.py | nlessmann/grand-challenge.org | 36abf6ccb40e2fc3fd3ff00e81deabd76f7e1ef8 | [
"Apache-2.0"
] | 42 | 2018-06-08T05:49:07.000Z | 2022-03-29T08:43:01.000Z | from django import template
from django.template.defaultfilters import stringfilter
from django.templatetags.static import static
from grandchallenge.products.models import Product
register = template.Library()
@register.inclusion_tag("products/partials/navbar.html", takes_context=True)
def navbar(context):
url... | 30.0625 | 78 | 0.412474 |
b028018661b0929da5b6a926d65bb750a50efe57 | 444 | py | Python | oldtoronto/test/toronto_archives_test.py | patcon/oldto | 44c099550a4e3cfafa85afbaebd3cd6c33325891 | [
"Apache-2.0"
] | 22 | 2018-04-25T22:03:53.000Z | 2021-07-13T18:43:23.000Z | oldtoronto/test/toronto_archives_test.py | patcon/oldto | 44c099550a4e3cfafa85afbaebd3cd6c33325891 | [
"Apache-2.0"
] | 17 | 2018-04-30T14:04:08.000Z | 2022-02-13T19:52:44.000Z | oldtoronto/test/toronto_archives_test.py | patcon/oldto | 44c099550a4e3cfafa85afbaebd3cd6c33325891 | [
"Apache-2.0"
] | 7 | 2018-05-08T23:32:44.000Z | 2022-01-27T17:49:30.000Z | from nose.tools import eq_
from oldtoronto.toronto_archives import get_citation_hierarchy # noqa
def test_get_citation_hierarchy():
eq_([
'Fonds 200, Series 123',
'Fonds 200'
], get_citation_hierarchy('Fonds 200, Series 123, Item 456'))
eq_([
'Fonds 257, Series 12, File 1983',
... | 26.117647 | 73 | 0.646396 |
c2d312239b275568cb1b0a8a43d8134e332a8999 | 15,649 | py | Python | google/ads/googleads/v4/services/services/campaign_draft_service/transports/grpc.py | batardo/google-ads-python | a39748521847e85138fca593f3be2681352ad024 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v4/services/services/campaign_draft_service/transports/grpc.py | batardo/google-ads-python | a39748521847e85138fca593f3be2681352ad024 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v4/services/services/campaign_draft_service/transports/grpc.py | batardo/google-ads-python | a39748521847e85138fca593f3be2681352ad024 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 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 o... | 42.409214 | 143 | 0.638635 |
a973ea72975b1781675b132cd22a5699afca9e75 | 1,641 | py | Python | image_classification/models/cnn.py | AmanDaVinci/research | 05bbca2fce13ab5d06e43e4f5e0309a87b467d43 | [
"MIT"
] | null | null | null | image_classification/models/cnn.py | AmanDaVinci/research | 05bbca2fce13ab5d06e43e4f5e0309a87b467d43 | [
"MIT"
] | null | null | null | image_classification/models/cnn.py | AmanDaVinci/research | 05bbca2fce13ab5d06e43e4f5e0309a87b467d43 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
from typing import Any, List, Tuple, Dict, Optional, Callable
class CNN(nn.Module):
def __init__(self, in_channels: int, out_dim: int,
device: torch.device, **kwargs):
super().__init__()
self.conv1 = nn.Sequential(
nn.Conv2d(in_... | 34.914894 | 91 | 0.573431 |
adc6e3f448d9840e2d8f4186157680cec57e6c4b | 5,397 | py | Python | cinder/volume/drivers/netapp/dataontap/fc_cmode.py | alexisries/openstack-cinder | 7cc6e45c5ddb8bf771bdb01b867628e41761ae11 | [
"Apache-2.0"
] | 2 | 2019-05-24T14:13:50.000Z | 2019-05-24T14:21:13.000Z | cinder/volume/drivers/netapp/dataontap/fc_cmode.py | vexata/cinder | 7b84c0842b685de7ee012acec40fb4064edde5e9 | [
"Apache-2.0"
] | 3 | 2020-03-02T01:36:30.000Z | 2021-12-13T20:27:46.000Z | cinder/volume/drivers/netapp/dataontap/fc_cmode.py | vexata/cinder | 7b84c0842b685de7ee012acec40fb4064edde5e9 | [
"Apache-2.0"
] | 1 | 2020-03-02T01:32:26.000Z | 2020-03-02T01:32:26.000Z | # Copyright (c) - 2014, Clinton Knight. All rights reserved.
# Copyright (c) - 2016 Mike Rooney. 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
#
# htt... | 39.108696 | 79 | 0.698536 |
95308d4eeb07c6eeb3e00d7bd0014a65e611d07a | 38,538 | py | Python | tests/forms_tests/tests/test_input_formats.py | ericholscher/django | b9a90b371c90a987ed57f7a4a7cc1274c432b438 | [
"BSD-3-Clause"
] | 1 | 2015-11-08T11:42:08.000Z | 2015-11-08T11:42:08.000Z | tests/forms_tests/tests/test_input_formats.py | ericholscher/django | b9a90b371c90a987ed57f7a4a7cc1274c432b438 | [
"BSD-3-Clause"
] | null | null | null | tests/forms_tests/tests/test_input_formats.py | ericholscher/django | b9a90b371c90a987ed57f7a4a7cc1274c432b438 | [
"BSD-3-Clause"
] | null | null | null | from datetime import time, date, datetime
from django import forms
from django.test.utils import override_settings
from django.utils.translation import activate, deactivate
from django.test import SimpleTestCase
@override_settings(TIME_INPUT_FORMATS=["%I:%M:%S %p", "%I:%M %p"], USE_L10N=True)
class LocalizedTimeTest... | 44.449827 | 107 | 0.648892 |
63ca8ec0886983411f04824c6ca872fad9a0d548 | 399 | py | Python | misitiotest/asgi.py | cristianllanca/django_local_library | ba278bef82d53014ae7a84056c91a3f2d24c0d9c | [
"MIT"
] | null | null | null | misitiotest/asgi.py | cristianllanca/django_local_library | ba278bef82d53014ae7a84056c91a3f2d24c0d9c | [
"MIT"
] | null | null | null | misitiotest/asgi.py | cristianllanca/django_local_library | ba278bef82d53014ae7a84056c91a3f2d24c0d9c | [
"MIT"
] | null | null | null | """
ASGI config for misitiotest project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_S... | 23.470588 | 78 | 0.789474 |
fee36336c5ac71bf5d34da3a0e51aefe7e7e7ad4 | 280 | py | Python | tests/conftest.py | sapporojones/eyeson_flask | f1e5e6a52f58d0bc9c977644d0f544c22b415bf0 | [
"MIT"
] | 2 | 2021-01-14T05:35:41.000Z | 2021-01-15T23:35:37.000Z | tests/conftest.py | sapporojones/eyeson_flask | f1e5e6a52f58d0bc9c977644d0f544c22b415bf0 | [
"MIT"
] | 44 | 2021-07-09T23:15:14.000Z | 2022-03-28T21:32:21.000Z | tests/conftest.py | sapporojones/eyeson_flask | f1e5e6a52f58d0bc9c977644d0f544c22b415bf0 | [
"MIT"
] | 1 | 2021-01-14T03:43:17.000Z | 2021-01-14T03:43:17.000Z | """
Dummy conftest.py for eyeson_flask.
If you don't know what this is for, just leave it empty.
Read more about conftest.py under:
- https://docs.pytest.org/en/stable/fixture.html
- https://docs.pytest.org/en/stable/writing_plugins.html
"""
# import pytest
| 25.454545 | 60 | 0.692857 |
bc90d9fd53204f4187e38ac83ad6091fc1a51056 | 478 | py | Python | day4/my_jinja2_ex1.py | grenn72/pynet-ons-feb19 | 5aff7dfa6a697214dc24818819a60b46a261d0d3 | [
"Apache-2.0"
] | null | null | null | day4/my_jinja2_ex1.py | grenn72/pynet-ons-feb19 | 5aff7dfa6a697214dc24818819a60b46a261d0d3 | [
"Apache-2.0"
] | null | null | null | day4/my_jinja2_ex1.py | grenn72/pynet-ons-feb19 | 5aff7dfa6a697214dc24818819a60b46a261d0d3 | [
"Apache-2.0"
] | null | null | null |
import jinja2
bgp_vars = {
'local_as': 10,
'peer1_ip': '10.1.20.2',
'peer1_as': 20,
'peer2_ip': '10.1.30.2',
'peer2_as': 30,
}
bgp_template = """
router bgp {{ local_as }}
neighbor {{ peer1_ip }} remote-as {{ peer1_as }}
update-source loopback99
ebgp-multihop 2
address-family ipv4 u... | 19.12 | 50 | 0.629707 |
42cd337814a63ddad219e861d5abcf0973527b87 | 10,753 | py | Python | tools/SDKTool/src/ui/tree/applications_tree/ui_explore_tree/explore_result.py | Passer-D/GameAISDK | a089330a30b7bfe1f6442258a12d8c0086240606 | [
"Apache-2.0"
] | 1,210 | 2020-08-18T07:57:36.000Z | 2022-03-31T15:06:05.000Z | tools/SDKTool/src/ui/tree/applications_tree/ui_explore_tree/explore_result.py | guokaiSama/GameAISDK | a089330a30b7bfe1f6442258a12d8c0086240606 | [
"Apache-2.0"
] | 37 | 2020-08-24T02:48:38.000Z | 2022-01-30T06:41:52.000Z | tools/SDKTool/src/ui/tree/applications_tree/ui_explore_tree/explore_result.py | guokaiSama/GameAISDK | a089330a30b7bfe1f6442258a12d8c0086240606 | [
"Apache-2.0"
] | 275 | 2020-08-18T08:35:16.000Z | 2022-03-31T15:06:07.000Z | # -*- coding: utf-8 -*-
"""
Tencent is pleased to support the open source community by making GameAISDK available.
This source code file is licensed under the GNU General Public License Version 3.
For full details, please refer to the file "LICENSE.txt" which is provided as part of this source code package.
Copyright... | 38.960145 | 119 | 0.606993 |
21bb34d71827935ab5e4b0ac1772bf8d4a2868d8 | 629 | py | Python | working-library/background/PictureAPI/views.py | FredCof/Fresh-supermarket-Online | 25c1cb28f5b5dc1f85e53ee7de5b055de438c491 | [
"Apache-2.0"
] | 2 | 2021-03-12T16:35:27.000Z | 2021-03-12T16:35:34.000Z | working-library/background/PictureAPI/views.py | FredCof/Fresh-supermarket-Online | 25c1cb28f5b5dc1f85e53ee7de5b055de438c491 | [
"Apache-2.0"
] | 4 | 2021-03-19T13:16:08.000Z | 2021-06-09T19:26:37.000Z | working-library/background/PictureAPI/views.py | FredCof/Fresh-supermarket-Online | 25c1cb28f5b5dc1f85e53ee7de5b055de438c491 | [
"Apache-2.0"
] | null | null | null | from django.views.decorators.csrf import csrf_exempt
from django.http import HttpResponse
from filetype import filetype
from Fresh_market_online.model import User
from LoginAPI.token_module import get_token, out_token
import json
# Create your views here.
@csrf_exempt
def PictureGet(request):
size = request.POST... | 29.952381 | 64 | 0.720191 |
7223cd135afe5a9e6e1c20fa22ccee0967d1d603 | 14,761 | py | Python | games/stocks.py | jobyid/muzero-general | 8b8b9a66f5a86ea5f7ab2041d3838dfac514a9db | [
"MIT"
] | null | null | null | games/stocks.py | jobyid/muzero-general | 8b8b9a66f5a86ea5f7ab2041d3838dfac514a9db | [
"MIT"
] | null | null | null | games/stocks.py | jobyid/muzero-general | 8b8b9a66f5a86ea5f7ab2041d3838dfac514a9db | [
"MIT"
] | null | null | null | import datetime
import os
import numpy
import torch
from .abstract_game import AbstractGame
class MuZeroConfig:
def __init__(self):
# More information is available here: https://github.com/werner-duvaud/muzero-general/wiki/Hyperparameter-Optimization
self.seed = 0 # Seed for numpy, torch and t... | 39.787062 | 244 | 0.590543 |
4e4e42b003eadda5673e6a9b32c8f6e73b584986 | 1,666 | py | Python | setup.py | StackStorm/pyangbind | 4fb5275e850c5174e67c4691d41cf6f1cd526c62 | [
"Apache-2.0"
] | 1 | 2016-11-10T05:07:53.000Z | 2016-11-10T05:07:53.000Z | setup.py | StackStorm/pyangbind | 4fb5275e850c5174e67c4691d41cf6f1cd526c62 | [
"Apache-2.0"
] | null | null | null | setup.py | StackStorm/pyangbind | 4fb5275e850c5174e67c4691d41cf6f1cd526c62 | [
"Apache-2.0"
] | 3 | 2016-11-01T23:51:35.000Z | 2018-05-23T10:09:08.000Z | from setuptools import setup, find_packages
from pip.req import parse_requirements
from codecs import open
from os import path
thisdir = path.abspath(path.dirname(__file__))
pip_reqs = parse_requirements(path.join(thisdir, "requirements.txt"), session=False)
inst_reqs = [str(ir.req) for ir in pip_reqs]
import pyangbi... | 34 | 102 | 0.683073 |
a1f4cd76aca96f41e904b53dce88276a60c944cd | 3,201 | py | Python | tests/compute/test_subgraph.py | vipermu/dgl | c9ac6c9889423019977e431c8b74a7b6c70cdc01 | [
"Apache-2.0"
] | 6 | 2020-04-27T16:31:53.000Z | 2022-03-24T16:27:51.000Z | tests/compute/test_subgraph.py | vipermu/dgl | c9ac6c9889423019977e431c8b74a7b6c70cdc01 | [
"Apache-2.0"
] | null | null | null | tests/compute/test_subgraph.py | vipermu/dgl | c9ac6c9889423019977e431c8b74a7b6c70cdc01 | [
"Apache-2.0"
] | 4 | 2020-03-17T11:21:56.000Z | 2020-07-02T09:42:24.000Z | import numpy as np
from dgl.graph import DGLGraph
import backend as F
D = 5
def generate_graph(grad=False, add_data=True):
g = DGLGraph()
g.add_nodes(10)
# create a graph where 0 is the source and 9 is the sink
for i in range(1, 9):
g.add_edge(0, i)
g.add_edge(i, 9)
# add a back fl... | 26.89916 | 92 | 0.524836 |
9b92c0ec66d6bfd48f7c8e9b12af9c7587d1946c | 139 | py | Python | apps/terraform/terraform.py | brollin/knausj_talon | c7a6f3f5ab7c5696c9b137f8fdf03aae7e259250 | [
"MIT"
] | 2 | 2021-12-01T03:25:48.000Z | 2022-03-07T03:45:01.000Z | apps/terraform/terraform.py | brollin/knausj_talon | c7a6f3f5ab7c5696c9b137f8fdf03aae7e259250 | [
"MIT"
] | 1 | 2022-03-26T15:27:18.000Z | 2022-03-26T15:27:18.000Z | apps/terraform/terraform.py | brollin/knausj_talon | c7a6f3f5ab7c5696c9b137f8fdf03aae7e259250 | [
"MIT"
] | null | null | null | from talon import Module, Context
mod = Module()
mod.tag("terraform_client", desc="tag for enabling terraform commands in your terminal")
| 27.8 | 88 | 0.776978 |
b6de36e29a124e62901136e3dfe7672c3d9dabd4 | 2,967 | py | Python | A3C/models/icm.py | sadeqa/Super-Mario-Bros-RL | e4d0a565359a16684d8617853bf4eb6f8cfc4721 | [
"MIT"
] | 72 | 2019-01-19T13:45:08.000Z | 2022-01-07T10:18:53.000Z | PPO/a2c_ppo_acktr/icm.py | wwxFromTju/Super-Mario-Bros-RL | e4d0a565359a16684d8617853bf4eb6f8cfc4721 | [
"MIT"
] | 4 | 2019-05-03T16:36:23.000Z | 2019-10-21T09:55:14.000Z | PPO/a2c_ppo_acktr/icm.py | wwxFromTju/Super-Mario-Bros-RL | e4d0a565359a16684d8617853bf4eb6f8cfc4721 | [
"MIT"
] | 18 | 2019-01-24T23:11:16.000Z | 2022-03-18T13:52:23.000Z | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
def normalized_columns_initializer(weights, std=1.0):
out = torch.randn(weights.size())
out *= std / torch.sqrt(out.pow(2).sum(1, keepdim=True))
return out
def weights_init(m):
classname = m.__class__.__name__
i... | 38.038462 | 95 | 0.599259 |
2232a2020046bc7d8a4381bd6b87a72e2ba9da6e | 227 | py | Python | Python/BinomialCoefficient.py | patres270/AlgoLib | 8b697e1e9348c559dcabdb6665e1031264c1032a | [
"MIT"
] | 19 | 2018-10-01T15:01:43.000Z | 2022-03-01T01:28:23.000Z | Python/BinomialCoefficient.py | patres270/AlgoLib | 8b697e1e9348c559dcabdb6665e1031264c1032a | [
"MIT"
] | 95 | 2018-10-01T14:43:45.000Z | 2018-12-19T14:20:22.000Z | Python/BinomialCoefficient.py | patres270/AlgoLib | 8b697e1e9348c559dcabdb6665e1031264c1032a | [
"MIT"
] | 93 | 2018-10-01T14:54:28.000Z | 2020-10-02T08:51:29.000Z | """ computing binomial coefficient """
n = int(input("Enter the degree : "))
b = [[1 for j in range(i+1)] for i in range(n+1)]
for i in range(2,n+1):
for j in range(1,i):
b[i][j] = b[i-1][j] + b[i-1][j-1]
print(b) | 25.222222 | 49 | 0.546256 |
5ffa2f46ffe8db80d0e2917311c0ad2ae4caf457 | 2,848 | py | Python | src/vbLib/GetOSVersion.py | mehrdad-shokri/macro_pack | bcc39728ae70f99e95998cbb48a8beb9e7697031 | [
"Apache-2.0"
] | 1,550 | 2017-10-04T13:29:15.000Z | 2022-03-30T20:53:25.000Z | src/vbLib/GetOSVersion.py | mehrdad-shokri/macro_pack | bcc39728ae70f99e95998cbb48a8beb9e7697031 | [
"Apache-2.0"
] | 75 | 2017-10-19T18:55:35.000Z | 2022-02-16T20:17:33.000Z | src/vbLib/GetOSVersion.py | mehrdad-shokri/macro_pack | bcc39728ae70f99e95998cbb48a8beb9e7697031 | [
"Apache-2.0"
] | 358 | 2017-10-07T21:16:02.000Z | 2022-03-25T03:36:17.000Z | """
Get the windows OS version
"""
r"""
#If VBA7 Then
Declare PtrSafe Function RtlGetVersion Lib "NTDLL" (ByRef lpVersionInformation As Long) As Long
#Else
Declare Function RtlGetVersion Lib "NTDLL" (ByRef lpVersionInformation As Long) As Long
#End If
Public Function GetOSVersion() As String
Dim tOSVw... | 29.360825 | 113 | 0.607093 |
7fdbdd0f49f4d6819a63470845c2d579b7974277 | 3,259 | py | Python | src/mano-framework/plugins/service-lifecycle-manager/slm/main.py | CN-UPB/Cloud-NFV-Orchestration | 28a6852f529ac73fe28f4448597f455b2d2fe552 | [
"Apache-2.0"
] | 10 | 2019-01-09T06:32:58.000Z | 2021-11-16T11:36:22.000Z | src/mano-framework/plugins/service-lifecycle-manager/slm/main.py | CN-UPB/Cloud-NFV-Orchestration | 28a6852f529ac73fe28f4448597f455b2d2fe552 | [
"Apache-2.0"
] | 14 | 2019-11-13T06:51:51.000Z | 2021-12-09T02:01:29.000Z | src/mano-framework/plugins/service-lifecycle-manager/slm/main.py | CN-UPB/Cloud-NFV-Orchestration | 28a6852f529ac73fe28f4448597f455b2d2fe552 | [
"Apache-2.0"
] | 7 | 2019-02-06T05:46:56.000Z | 2021-08-21T13:56:07.000Z | import logging
from typing import Dict
from appcfg import get_config
from mongoengine import DoesNotExist, connect
from manobase.messaging import Message
from manobase.plugin import ManoBasePlugin
from slm import version
from slm.exceptions import (
DeployRequestValidationError,
InstantiationError,
Termin... | 31.038095 | 90 | 0.641608 |
10646d9ee5a6e27d44aec1d79c0edb48a9fe510a | 4,253 | py | Python | loss_functions.py | mmonfort/moments_models | c233603fd47625354ad66c4e89521e21206f4980 | [
"BSD-2-Clause"
] | 272 | 2018-01-09T05:30:18.000Z | 2020-03-03T12:30:45.000Z | loss_functions.py | mmonfort/moments_models | c233603fd47625354ad66c4e89521e21206f4980 | [
"BSD-2-Clause"
] | 20 | 2018-01-11T05:52:51.000Z | 2020-02-12T05:47:34.000Z | loss_functions.py | mmonfort/moments_models | c233603fd47625354ad66c4e89521e21206f4980 | [
"BSD-2-Clause"
] | 62 | 2018-01-10T10:51:18.000Z | 2020-03-04T17:31:43.000Z | '''
-- Our loss implementations for wlsep, lsep, warp, bp_mll and bce with optional weighted learning
--
-- If you use these implementations in your paper please cite our paper https://arxiv.org/abs/1911.00232
--
-- scores is the output of the model
-- labels is a binary vector with a 1 indicating a positive class for ... | 54.525641 | 114 | 0.685163 |
e56c4a9ddb4b3ee812eab414620aad63f2b0dc9a | 799 | py | Python | app/urls.py | Sonray/The-share-IP3 | 3783ea73736e8c7a1e3962eb82d0d2a77e92e293 | [
"MIT"
] | null | null | null | app/urls.py | Sonray/The-share-IP3 | 3783ea73736e8c7a1e3962eb82d0d2a77e92e293 | [
"MIT"
] | null | null | null | app/urls.py | Sonray/The-share-IP3 | 3783ea73736e8c7a1e3962eb82d0d2a77e92e293 | [
"MIT"
] | null | null | null | from django.conf.urls import url
from django.conf import settings
from django.conf.urls.static import static
from . import views
urlpatterns = [
url('^$',views.home, name = 'home'),
url(r'^profile/(\w+)',views.profile,name = 'profile'),
url(r'^accounts/profile/$',views.home,name = 'home'),
url(r'^new/... | 42.052632 | 81 | 0.670839 |
c840b8429f01edc0ddfd5c0cfcdf0dc8485c5b9f | 10,891 | py | Python | models/vqvae.py | lisiyao21/Bailando | 125b529b3c596b58b9d70f22c05dc3f04a01895c | [
"MIT"
] | 31 | 2022-03-21T11:46:33.000Z | 2022-03-31T17:59:21.000Z | models/vqvae.py | lisiyao21/Bailando | 125b529b3c596b58b9d70f22c05dc3f04a01895c | [
"MIT"
] | 1 | 2022-03-27T08:44:32.000Z | 2022-03-28T02:01:55.000Z | models/vqvae.py | lisiyao21/Bailando | 125b529b3c596b58b9d70f22c05dc3f04a01895c | [
"MIT"
] | 2 | 2022-03-28T09:35:03.000Z | 2022-03-31T18:18:36.000Z | import numpy as np
import torch as t
import torch.nn as nn
from .encdec import Encoder, Decoder, assert_shape
from .bottleneck import NoBottleneck, Bottleneck
from .utils.logger import average_metrics
# from .utils.audio_utils import audio_postprocess
def dont_update(params):
for param in params:
param.r... | 39.748175 | 153 | 0.59214 |
e006bc80a0e6d8d9c5552ca644bac856cb5ce63e | 1,967 | py | Python | hooks/clang_tidy.py | rambo/pre-commit-hooks | 4c6731ed39da9fe55d0d671d51ddd06123e933fc | [
"Apache-2.0"
] | null | null | null | hooks/clang_tidy.py | rambo/pre-commit-hooks | 4c6731ed39da9fe55d0d671d51ddd06123e933fc | [
"Apache-2.0"
] | null | null | null | hooks/clang_tidy.py | rambo/pre-commit-hooks | 4c6731ed39da9fe55d0d671d51ddd06123e933fc | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""Wrapper script for clang-tidy."""
#############################################################################
import re
import sys
from hooks.utils import ClangAnalyzerCmd
class ClangTidyCmd(ClangAnalyzerCmd):
"""Class for the clang-tidy command."""
command = "clang-tidy"
loo... | 33.913793 | 84 | 0.571429 |
385e03aad268c5cd837d14c1e19b928c009963cf | 594 | py | Python | django_user_agents/templatetags/user_agents.py | avallbona/django-user_agents | b1fa72ee9f9a2ebff74abfb33b7ec6c7fd224554 | [
"MIT"
] | 547 | 2015-01-13T15:01:39.000Z | 2022-03-27T08:35:43.000Z | django_user_agents/templatetags/user_agents.py | avallbona/django-user_agents | b1fa72ee9f9a2ebff74abfb33b7ec6c7fd224554 | [
"MIT"
] | 34 | 2015-04-21T00:27:59.000Z | 2022-03-22T06:28:34.000Z | django_user_agents/templatetags/user_agents.py | avallbona/django-user_agents | b1fa72ee9f9a2ebff74abfb33b7ec6c7fd224554 | [
"MIT"
] | 108 | 2015-01-29T07:37:11.000Z | 2022-03-24T17:03:40.000Z | from django import template
from ..utils import get_and_set_user_agent
register = template.Library()
@register.filter()
def is_mobile(request):
return get_and_set_user_agent(request).is_mobile
@register.filter()
def is_pc(request):
return get_and_set_user_agent(request).is_pc
@register.filter()
def is_... | 18.5625 | 59 | 0.789562 |
a0b8bd638c37d51d1305cb3f6d7cb6beed8bab9a | 2,532 | py | Python | src/visualization/generate_notebook_outputs.py | jolfr/capstone-03 | 3095465170ea0e7e4947cff9edb012344e6a9f05 | [
"MIT"
] | 1 | 2021-12-29T04:32:30.000Z | 2021-12-29T04:32:30.000Z | src/visualization/generate_notebook_outputs.py | jolfr/capstone-03 | 3095465170ea0e7e4947cff9edb012344e6a9f05 | [
"MIT"
] | null | null | null | src/visualization/generate_notebook_outputs.py | jolfr/capstone-03 | 3095465170ea0e7e4947cff9edb012344e6a9f05 | [
"MIT"
] | null | null | null | import os
import nbformat
from traitlets.config import Config
from nbconvert import MarkdownExporter
from nbconvert.writers import FilesWriter
notebookDir = r'C:\Users\thoma\projects\datascience\capstone-03\notebooks'
outputDir = r'C:\Users\thoma\projects\datascience\jupyter-presentation-framework\src\notebooks'
def... | 40.83871 | 103 | 0.539494 |
8d27779cb44626964c688e5a003fbdf508ace3d2 | 3,789 | py | Python | demo/demo_youtop.py | donglaiw/detectron2 | 35efa63d8c6b5a3d3f06c5ee216aef83a8c958e2 | [
"Apache-2.0"
] | null | null | null | demo/demo_youtop.py | donglaiw/detectron2 | 35efa63d8c6b5a3d3f06c5ee216aef83a8c958e2 | [
"Apache-2.0"
] | null | null | null | demo/demo_youtop.py | donglaiw/detectron2 | 35efa63d8c6b5a3d3f06c5ee216aef83a8c958e2 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
import argparse
import glob
import multiprocessing as mp
import os
import time
import tqdm
from detectron2.config import get_cfg
from detectron2.data.detection_utils import read_image
from detectron2.utils.logger import setup_logger
from predicto... | 34.445455 | 295 | 0.66825 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.