hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
14d196aa419739f9d9472812d6036fd95de0f110 | 2,143 | py | Python | airflow/providers/sftp/sensors/sftp.py | augusto-herrmann/airflow | 7ee4295dd3f7dba4fcd763286c7823bb1707fe99 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 4 | 2021-06-26T13:37:35.000Z | 2022-01-11T15:49:44.000Z | airflow/providers/sftp/sensors/sftp.py | augusto-herrmann/airflow | 7ee4295dd3f7dba4fcd763286c7823bb1707fe99 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 33 | 2021-07-25T10:29:30.000Z | 2022-03-30T04:39:06.000Z | airflow/providers/sftp/sensors/sftp.py | augusto-herrmann/airflow | 7ee4295dd3f7dba4fcd763286c7823bb1707fe99 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 35.716667 | 91 | 0.699487 |
b7dbc4b243c0cf5dc97e96ff0d030654076c7fb0 | 866 | py | Python | trcdproc/navigate/absorp.py | zmitchell/trcdproc | dbae216deeb56774bdeba18b92657118f83928f5 | [
"MIT"
] | null | null | null | trcdproc/navigate/absorp.py | zmitchell/trcdproc | dbae216deeb56774bdeba18b92657118f83928f5 | [
"MIT"
] | null | null | null | trcdproc/navigate/absorp.py | zmitchell/trcdproc | dbae216deeb56774bdeba18b92657118f83928f5 | [
"MIT"
] | null | null | null | from typing import Generator
from trcdproc.core import DeltaAChannel, H5File, subgroups
def paths_for_signal(src_file: H5File, chan: DeltaAChannel) -> Generator[str, None, None]:
"""Yields the paths to each dataset corresponding to the specified signal
Args:
src_file (H5File): The file containing the... | 33.307692 | 90 | 0.650115 |
4149a2099b547bbb381d9897669f28bb232d2d89 | 55 | py | Python | src/iam_sarif_report/__init__.py | georgealton/iam-policy-validator-to-sarif | a753c9b1c41ae1250ed24cdd64f9eab5d98d678d | [
"MIT"
] | 3 | 2021-11-17T10:37:48.000Z | 2022-01-17T11:03:05.000Z | src/iam_sarif_report/__init__.py | georgealton/iam-policy-validator-to-sarif | a753c9b1c41ae1250ed24cdd64f9eab5d98d678d | [
"MIT"
] | null | null | null | src/iam_sarif_report/__init__.py | georgealton/iam-policy-validator-to-sarif | a753c9b1c41ae1250ed24cdd64f9eab5d98d678d | [
"MIT"
] | null | null | null | from .domain import converter
__all__ = ["converter"]
| 13.75 | 29 | 0.745455 |
a89a1cdca17e413ae01bf80c2391ce0e05b0bfbc | 8,607 | py | Python | dev/archery/archery/lang/python.py | davisusanibar/arrow | 07ac9fd86c6225f493943e4ab0ff35b0fdbfb2ae | [
"CC-BY-3.0",
"Apache-2.0",
"CC0-1.0",
"MIT"
] | 1 | 2021-11-24T04:43:52.000Z | 2021-11-24T04:43:52.000Z | dev/archery/archery/lang/python.py | davisusanibar/arrow | 07ac9fd86c6225f493943e4ab0ff35b0fdbfb2ae | [
"CC-BY-3.0",
"Apache-2.0",
"CC0-1.0",
"MIT"
] | 2 | 2021-11-17T14:36:51.000Z | 2022-01-23T16:49:53.000Z | dev/archery/archery/lang/python.py | davisusanibar/arrow | 07ac9fd86c6225f493943e4ab0ff35b0fdbfb2ae | [
"CC-BY-3.0",
"Apache-2.0",
"CC0-1.0",
"MIT"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 36.163866 | 79 | 0.600093 |
c02402004ad3b7e92b6fe96624a8c4ee5dc2b705 | 9,479 | py | Python | tensorflow/python/keras/activations_test.py | EricRemmerswaal/tensorflow | 141ff27877579c81a213fa113bd1b474c1749aca | [
"Apache-2.0"
] | 190,993 | 2015-11-09T13:17:30.000Z | 2022-03-31T23:05:27.000Z | tensorflow/python/keras/activations_test.py | EricRemmerswaal/tensorflow | 141ff27877579c81a213fa113bd1b474c1749aca | [
"Apache-2.0"
] | 48,461 | 2015-11-09T14:21:11.000Z | 2022-03-31T23:17:33.000Z | tensorflow/python/keras/activations_test.py | EricRemmerswaal/tensorflow | 141ff27877579c81a213fa113bd1b474c1749aca | [
"Apache-2.0"
] | 104,981 | 2015-11-09T13:40:17.000Z | 2022-03-31T19:51:54.000Z | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 36.041825 | 80 | 0.670113 |
7e3caff749a07dd85acead93a28adfca32b38ea7 | 6,177 | py | Python | web/app.py | drunkONdata/fetch_dog_adoption | 51e4c999a88e46ceb2daf9d2c2c343f310ad9a80 | [
"MIT"
] | 1 | 2019-07-03T01:53:03.000Z | 2019-07-03T01:53:03.000Z | web/durka.py | drunkONdata/fetch_dog_adoption | 51e4c999a88e46ceb2daf9d2c2c343f310ad9a80 | [
"MIT"
] | null | null | null | web/durka.py | drunkONdata/fetch_dog_adoption | 51e4c999a88e46ceb2daf9d2c2c343f310ad9a80 | [
"MIT"
] | null | null | null | import os
import flask
from flask import Flask, request, redirect, url_for, render_template
from werkzeug.utils import secure_filename
import werkzeug
import numpy as np
import tensorflow as tf
import pandas as pd
from PIL import ExifTags, Image
from keras.applications import VGG16
from keras.preprocessing import ima... | 37.210843 | 115 | 0.658572 |
60c2825064cf9900464cacb978978a9752be7f08 | 2,408 | py | Python | scripts/item/consume_2434589.py | pantskun/swordiemen | fc33ffec168e6611587fdc75de8270f6827a4176 | [
"MIT"
] | null | null | null | scripts/item/consume_2434589.py | pantskun/swordiemen | fc33ffec168e6611587fdc75de8270f6827a4176 | [
"MIT"
] | null | null | null | scripts/item/consume_2434589.py | pantskun/swordiemen | fc33ffec168e6611587fdc75de8270f6827a4176 | [
"MIT"
] | null | null | null | # Piece of Darkness (2434589)
from net.swordie.ms.constants import JobConstants
def exchangePieces(gear):
if not sm.hasItem(parentID, 5):
sm.sendSayOkay(''.join(["You need #b5 #i", repr(parentID), "# #z", repr(parentID), "##k to exchange for #b#i", repr(gear), "# #z", repr(gear), "##k."]))
elif not sm... | 38.83871 | 160 | 0.698505 |
ea11fe23c865bbbabe4277139fcdc40725d50bb0 | 9,488 | py | Python | demos/blog/venv/lib/python2.7/site-packages/torndb.py | Einsteinish/PyTonado | 79a4e406b9fea94687c6c656ebc11543cbfc7a99 | [
"Apache-2.0"
] | null | null | null | demos/blog/venv/lib/python2.7/site-packages/torndb.py | Einsteinish/PyTonado | 79a4e406b9fea94687c6c656ebc11543cbfc7a99 | [
"Apache-2.0"
] | null | null | null | demos/blog/venv/lib/python2.7/site-packages/torndb.py | Einsteinish/PyTonado | 79a4e406b9fea94687c6c656ebc11543cbfc7a99 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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 a... | 35.803774 | 106 | 0.639439 |
5ada283a913e99b7a3c67aebe5bf48e32adedad7 | 1,456 | py | Python | tests/unit/network/CubicTemplateTest.py | halotudio/openPNM-copy2 | d400ec65e9421256a531f6d22a38255b002d5dcb | [
"MIT"
] | 2 | 2019-08-24T09:17:40.000Z | 2020-07-05T07:21:21.000Z | tests/unit/network/CubicTemplateTest.py | halotudio/openPNM-copy2 | d400ec65e9421256a531f6d22a38255b002d5dcb | [
"MIT"
] | 2 | 2020-06-26T19:58:23.000Z | 2021-12-14T07:16:41.000Z | tests/unit/network/CubicTemplateTest.py | halotudio/openPNM-copy2 | d400ec65e9421256a531f6d22a38255b002d5dcb | [
"MIT"
] | null | null | null | import numpy as np
import openpnm as op
from skimage.morphology import ball, disk
class CubicTemplateTest:
def setup_class(self):
pass
def teardown_class(self):
pass
def test_2D_template(self):
net = op.network.CubicTemplate(template=disk(10), spacing=1)
assert net.Np == ... | 28.54902 | 88 | 0.572802 |
56e669eafda6460265c721c30002d741b7dc3ccb | 2,006 | py | Python | upvote/gae/utils/env_utils_test.py | iwikmai/upvote | 77bb200d0e35a28cc5aed98ceee8e234998814b6 | [
"Apache-2.0"
] | 453 | 2017-10-24T15:29:44.000Z | 2021-09-27T23:21:20.000Z | upvote/gae/utils/env_utils_test.py | iwikmai/upvote | 77bb200d0e35a28cc5aed98ceee8e234998814b6 | [
"Apache-2.0"
] | 58 | 2018-03-23T21:19:16.000Z | 2021-05-23T20:06:05.000Z | upvote/gae/utils/env_utils_test.py | iwikmai/upvote | 77bb200d0e35a28cc5aed98ceee8e234998814b6 | [
"Apache-2.0"
] | 36 | 2018-03-23T21:25:54.000Z | 2021-09-27T23:21:24.000Z | # Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 32.885246 | 74 | 0.768195 |
2c2a88b24b3305983f302062b903392c895199bc | 702 | py | Python | tfaipscenarios/atr/datapipeline/loadprocessor.py | Planet-AI-GmbH/tfaip_example_scenarios | 43921b26a0f4c2571904fb69806b2728ee846ef8 | [
"Apache-2.0"
] | null | null | null | tfaipscenarios/atr/datapipeline/loadprocessor.py | Planet-AI-GmbH/tfaip_example_scenarios | 43921b26a0f4c2571904fb69806b2728ee846ef8 | [
"Apache-2.0"
] | null | null | null | tfaipscenarios/atr/datapipeline/loadprocessor.py | Planet-AI-GmbH/tfaip_example_scenarios | 43921b26a0f4c2571904fb69806b2728ee846ef8 | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass
from typing import Type
import cv2
from paiargparse import pai_dataclass
from tfaip.base import Sample
from tfaip.base.data.pipeline.processor.dataprocessor import DataProcessorParams, MappingDataProcessor
@pai_dataclass
@dataclass
class LoadProcessorParams(DataProcessorParams):
... | 28.08 | 102 | 0.752137 |
b59e6a8e195bcb52721ceba417f515d42e76a4d9 | 23,704 | py | Python | checkov/kustomize/runner.py | BenjaDiaz/checkov | c53e32f1654e4ee771abf2001b3cb7df16752f6e | [
"Apache-2.0"
] | null | null | null | checkov/kustomize/runner.py | BenjaDiaz/checkov | c53e32f1654e4ee771abf2001b3cb7df16752f6e | [
"Apache-2.0"
] | 3 | 2022-03-07T20:37:31.000Z | 2022-03-21T20:20:14.000Z | checkov/kustomize/runner.py | BenjaDiaz/checkov | c53e32f1654e4ee771abf2001b3cb7df16752f6e | [
"Apache-2.0"
] | null | null | null | import io
import logging
import os
import pathlib
import shutil
import subprocess # nosec
import tempfile
import yaml
from checkov.common.graph.graph_builder import CustomAttributes
from checkov.common.output.record import Record
from checkov.common.output.report import Report, CheckType
from checkov.common.runners.... | 55.90566 | 198 | 0.616183 |
a056f4b664e87862bc4b6daf025e1415ead8c3d0 | 74,604 | py | Python | externals/numeric_bindings/libs/numeric/bindings/tools/netlib.py | ljktest/siconos | 85b60e62beca46e6bf06bfbd65670089e86607c7 | [
"Apache-2.0"
] | 137 | 2015-06-16T15:55:28.000Z | 2022-03-26T06:01:59.000Z | externals/numeric_bindings/libs/numeric/bindings/tools/netlib.py | ljktest/siconos | 85b60e62beca46e6bf06bfbd65670089e86607c7 | [
"Apache-2.0"
] | 381 | 2015-09-22T15:31:08.000Z | 2022-02-14T09:05:23.000Z | externals/numeric_bindings/libs/numeric/bindings/tools/netlib.py | ljktest/siconos | 85b60e62beca46e6bf06bfbd65670089e86607c7 | [
"Apache-2.0"
] | 30 | 2015-08-06T22:57:51.000Z | 2022-03-02T20:30:20.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2008 Thomas Klimpel and Rutger ter Borg
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
#
import re, os.path, copy, bindings
from types import StringTy... | 42.412735 | 225 | 0.620476 |
1ba8ab07420ee1a9f1fbb63713e867a5eaa69375 | 24,018 | py | Python | fit-sdk-swift/RZFitFile/fitconv.py | edalmau/connectstats | 761eeba320c9570abc3afea323e4d3907cacee43 | [
"MIT"
] | 1 | 2020-08-04T07:29:47.000Z | 2020-08-04T07:29:47.000Z | fit-sdk-swift/RZFitFile/fitconv.py | edalmau/connectstats | 761eeba320c9570abc3afea323e4d3907cacee43 | [
"MIT"
] | null | null | null | fit-sdk-swift/RZFitFile/fitconv.py | edalmau/connectstats | 761eeba320c9570abc3afea323e4d3907cacee43 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
#
#
import re
import argparse
import json
import os
multiplier_offset_fix = {
"total_training_effect" : (10, 0 ),
"total_anaerobic_training_effect" : (10, 0),
}
# If name appears here, will be marked as public
swift_public_func = {
'rzfit_mesg_num_string' : 1,
}
class Context:
... | 33.497908 | 144 | 0.494629 |
b80cb86c5f6a91b991ab6b268b20682f70195a04 | 5,197 | py | Python | bot/conversations/limits/messages.py | borissimkin/moneykeeper-bot | 45f7ed92be187db71d28c5326a5b62cb587c88bf | [
"MIT"
] | 2 | 2021-08-04T08:04:31.000Z | 2022-01-21T13:00:28.000Z | bot/conversations/limits/messages.py | borissimkin/moneykeeper-bot | 45f7ed92be187db71d28c5326a5b62cb587c88bf | [
"MIT"
] | 2 | 2021-06-08T21:07:54.000Z | 2021-09-08T01:46:50.000Z | bot/conversations/limits/messages.py | borissimkin/moneykeeper-bot | 45f7ed92be187db71d28c5326a5b62cb587c88bf | [
"MIT"
] | null | null | null | from bot import config
from bot.conversations.limits.utils import current_amount_money_daily_limit_user, \
current_amount_money_weekly_limit_user, current_amount_money_monthly_limit_user, get_emoji_for_limit
from bot.models import CategoryConsumption, TypeLimit, Limit
def text_exit_point():
return 'Вы вышли и... | 36.090278 | 113 | 0.655763 |
e6ab96c0448575efa9cd96754eb30610a03d201a | 21,800 | py | Python | tensor2tensor/data_generators/generator_utils.py | xueeinstein/tensor2tensor | b42e7bae72044916d465b7e298569b2823fe9bc0 | [
"Apache-2.0"
] | null | null | null | tensor2tensor/data_generators/generator_utils.py | xueeinstein/tensor2tensor | b42e7bae72044916d465b7e298569b2823fe9bc0 | [
"Apache-2.0"
] | null | null | null | tensor2tensor/data_generators/generator_utils.py | xueeinstein/tensor2tensor | b42e7bae72044916d465b7e298569b2823fe9bc0 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 35.16129 | 97 | 0.68344 |
6b56234e85055e1c86bea12f4884e7b8c74b7b8d | 6,502 | py | Python | sdk/python/pulumi_azure_nextgen/authorization/v20151001preview/policy_assignment.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/authorization/v20151001preview/policy_assignment.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/authorization/v20151001preview/policy_assignment.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
__a... | 46.113475 | 915 | 0.661489 |
b8771057718c8dba29abb340ad20d0204c592942 | 996 | py | Python | lambdas/jumpcloud/test/test_usersystembinding.py | zimingd/aws-infra | 89922f6d2a148b14119a8b8164dd4b06d465d94e | [
"Apache-2.0"
] | null | null | null | lambdas/jumpcloud/test/test_usersystembinding.py | zimingd/aws-infra | 89922f6d2a148b14119a8b8164dd4b06d465d94e | [
"Apache-2.0"
] | null | null | null | lambdas/jumpcloud/test/test_usersystembinding.py | zimingd/aws-infra | 89922f6d2a148b14119a8b8164dd4b06d465d94e | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
JumpCloud APIs
V1 & V2 versions of JumpCloud's API. The previous version of JumpCloud's API. This set of endpoints allows JumpCloud customers to manage commands, systems, & system users.
OpenAPI spec version: 1.0
Generated by: https://github.com/swagger-api/swagger-codegen.gi... | 22.133333 | 175 | 0.704819 |
00b3ad54fbe4dddadb7380411749908b86839458 | 26,469 | py | Python | tune/android/tune/external/deap/tools/support.py | listenlink/isaac | b0a265ee45337f92f1e8e9f2fb08a057292b0240 | [
"MIT"
] | 17 | 2017-01-22T10:40:52.000Z | 2021-12-01T07:42:40.000Z | tune/android/tune/external/deap/tools/support.py | listenlink/isaac | b0a265ee45337f92f1e8e9f2fb08a057292b0240 | [
"MIT"
] | 3 | 2017-01-19T07:17:29.000Z | 2017-02-08T06:07:48.000Z | tune/android/tune/external/deap/tools/support.py | listenlink/isaac | b0a265ee45337f92f1e8e9f2fb08a057292b0240 | [
"MIT"
] | 13 | 2017-01-10T13:21:03.000Z | 2021-08-11T11:44:06.000Z | from __future__ import division
try:
import cPickle as pickle
except ImportError:
import pickle
from bisect import bisect_right
from collections import defaultdict
from copy import deepcopy
from functools import partial
from itertools import chain
from operator import eq
def identity(obj):
"""Returns di... | 40.847222 | 94 | 0.599494 |
214b018ddb09d99862dd7f35cf3664c892162f96 | 1,489 | py | Python | setup.py | qinxian1989/newlinecharacterconv | 69675e96641337aeba95f5a6cd8c71a00f04a030 | [
"MIT"
] | null | null | null | setup.py | qinxian1989/newlinecharacterconv | 69675e96641337aeba95f5a6cd8c71a00f04a030 | [
"MIT"
] | null | null | null | setup.py | qinxian1989/newlinecharacterconv | 69675e96641337aeba95f5a6cd8c71a00f04a030 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""The setup script."""
from setuptools import setup, find_packages
from newlinecharacterconv.version import version
with open('README.rst',encoding='utf8') as readme_file:
readme = readme_file.read()
with open('HISTORY.rst') as history_file:
history = history_file.read()
requirements ... | 29.78 | 87 | 0.664876 |
a363cf2ebd8077e873213b95ded3b20c1e3cc5b8 | 1,075 | py | Python | bot.py | Lethal-Impact/Discord-Server-Users | 35485edf98aff0f9ee1cc82c06c5c09c4e74a47d | [
"MIT"
] | null | null | null | bot.py | Lethal-Impact/Discord-Server-Users | 35485edf98aff0f9ee1cc82c06c5c09c4e74a47d | [
"MIT"
] | null | null | null | bot.py | Lethal-Impact/Discord-Server-Users | 35485edf98aff0f9ee1cc82c06c5c09c4e74a47d | [
"MIT"
] | null | null | null | import discord
import os
client = discord.Client()
async def get_server_count():
all=online=0
for member in client.get_all_members():
if member.bot:
continue
else:
all += 1
if member.status != discord.Status.offline:
online += 1
return al... | 26.219512 | 78 | 0.660465 |
fae72fa46852f4cccf854203954b4f29d7287035 | 1,442 | py | Python | samples/snippets/natality_tutorial_test.py | tmatsuo/python-bigquery | 8360487582f245d20893acbe8cbf92d0fc4cd9d9 | [
"Apache-2.0"
] | 1 | 2020-08-11T15:52:43.000Z | 2020-08-11T15:52:43.000Z | samples/snippets/natality_tutorial_test.py | skondla/python-bigquery | 8360487582f245d20893acbe8cbf92d0fc4cd9d9 | [
"Apache-2.0"
] | null | null | null | samples/snippets/natality_tutorial_test.py | skondla/python-bigquery | 8360487582f245d20893acbe8cbf92d0fc4cd9d9 | [
"Apache-2.0"
] | 1 | 2020-10-04T11:46:17.000Z | 2020-10-04T11:46:17.000Z | # Copyright 2018 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 28.27451 | 86 | 0.728849 |
e91a5908dfc4624249339664c0238a226ead9146 | 11,269 | py | Python | nipy/modalities/fmri/tests/test_utils.py | mr-c/nipy | 0832c7f2e019e7261bd0c0be6cd5a7075958e627 | [
"BSD-3-Clause"
] | 236 | 2015-01-09T21:28:37.000Z | 2022-03-27T11:51:58.000Z | nipy/modalities/fmri/tests/test_utils.py | mr-c/nipy | 0832c7f2e019e7261bd0c0be6cd5a7075958e627 | [
"BSD-3-Clause"
] | 171 | 2015-03-23T00:31:43.000Z | 2021-11-22T12:43:00.000Z | nipy/modalities/fmri/tests/test_utils.py | mr-c/nipy | 0832c7f2e019e7261bd0c0be6cd5a7075958e627 | [
"BSD-3-Clause"
] | 94 | 2015-02-01T12:39:47.000Z | 2022-01-27T06:38:19.000Z | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
""" Testing fmri utils
"""
from __future__ import absolute_import, division, print_function
import re
import numpy as np
import sympy
from sympy import Symbol, Dummy, Function, DiracDelta
from sympy.uti... | 37.688963 | 80 | 0.58976 |
c31b07f7d7b23219b7c4745dbd06d638a1cc135c | 1,535 | py | Python | codesignal/arcade/sandbox.py | stephanosterburg/coding_challenges | 601cf1360a7fdf068487106ba995955407365983 | [
"MIT"
] | null | null | null | codesignal/arcade/sandbox.py | stephanosterburg/coding_challenges | 601cf1360a7fdf068487106ba995955407365983 | [
"MIT"
] | null | null | null | codesignal/arcade/sandbox.py | stephanosterburg/coding_challenges | 601cf1360a7fdf068487106ba995955407365983 | [
"MIT"
] | 1 | 2019-11-08T00:49:14.000Z | 2019-11-08T00:49:14.000Z | # def binary_tree(r):
# return [r, [], []]
# def insert_left(root, new_branch):
# t = root.pop(1)
# if len(t) > 1:
# root.insert(1, [new_branch, t, []])
# else:
# root.insert(1, [new_branch, [], []])
# return root
#
# def insert_right(root, new_branch):
# t = root.pop(2)
# if... | 21.027397 | 60 | 0.575244 |
7d99cf6128fd51b8e6d1c13736ed0d12ca9ca60b | 3,560 | py | Python | drf_social_oauth2/oauth2_endpoints.py | denizdogan/drf-social-oauth2 | d600ae01cb2e174be23e2652a956b27b47bb6072 | [
"MIT"
] | 130 | 2020-07-04T18:04:29.000Z | 2022-03-25T11:15:13.000Z | drf_social_oauth2/oauth2_endpoints.py | denizdogan/drf-social-oauth2 | d600ae01cb2e174be23e2652a956b27b47bb6072 | [
"MIT"
] | 90 | 2020-07-04T18:10:32.000Z | 2022-03-25T14:02:35.000Z | drf_social_oauth2/oauth2_endpoints.py | denizdogan/drf-social-oauth2 | d600ae01cb2e174be23e2652a956b27b47bb6072 | [
"MIT"
] | 21 | 2020-07-23T12:23:04.000Z | 2022-03-11T17:50:57.000Z | import logging
from django.http import HttpRequest
from oauthlib.common import Request
from oauthlib.oauth2.rfc6749.endpoints.token import TokenEndpoint
from oauthlib.oauth2.rfc6749.tokens import BearerToken
from oauthlib.oauth2.rfc6749.endpoints.base import catch_errors_and_unavailability
from drf_social_oauth2.oau... | 37.87234 | 87 | 0.655899 |
1a503306298ab9173f6f77ddac5a26858e843ca7 | 10,186 | py | Python | parsers/semantic/graphs/builders.py | afel-project/pySemanticComplexity | 8d64ca6835e58602b836aea14b1b5bd12bc0ff82 | [
"Apache-2.0"
] | 4 | 2020-10-01T07:08:12.000Z | 2022-01-12T12:05:08.000Z | parsers/semantic/graphs/builders.py | afel-project/pySemanticComplexity | 8d64ca6835e58602b836aea14b1b5bd12bc0ff82 | [
"Apache-2.0"
] | 3 | 2019-03-15T14:57:42.000Z | 2021-06-01T22:20:43.000Z | parsers/semantic/graphs/builders.py | afel-project/pySemanticComplexity | 8d64ca6835e58602b836aea14b1b5bd12bc0ff82 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Concept graph manipulation package. Provides classes to manage concepts RDF ontologies, concepts graphs and
to operate on graphs."""
import logging
import ujson as json
from abc import abstractmethod, ABCMeta
from collections import Counter
from itertools import chain
from typing import Dict
... | 42.26556 | 118 | 0.674161 |
5df14e4263576bc46434c7fabe9a9a2e29f6cdc3 | 1,348 | py | Python | app/core/tests/test_admin.py | ryanGigabyte/bon-appetit-app-api | eac889751f16c9e2344a1f80c0f4737cf91f4001 | [
"MIT"
] | null | null | null | app/core/tests/test_admin.py | ryanGigabyte/bon-appetit-app-api | eac889751f16c9e2344a1f80c0f4737cf91f4001 | [
"MIT"
] | null | null | null | app/core/tests/test_admin.py | ryanGigabyte/bon-appetit-app-api | eac889751f16c9e2344a1f80c0f4737cf91f4001 | [
"MIT"
] | null | null | null | from django.test import TestCase, Client
from django.contrib.auth import get_user_model
from django.urls import reverse
class AdminSiteTests(TestCase):
def setUp(self):
self.client = Client()
self.admin_user = get_user_model().objects.create_superuser(
email='admin@gmail.com',
... | 30.636364 | 68 | 0.62908 |
df3c6cc5e985446b3c7ba7682011d6a019eed65a | 918,139 | py | Python | venv/lib/python3.6/site-packages/phonenumbers/geodata/data15.py | MubongwoNdasi/pms | 0cc5dcbc25b31e13631672e1a03c88e2ad46bc92 | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/phonenumbers/geodata/data15.py | MubongwoNdasi/pms | 0cc5dcbc25b31e13631672e1a03c88e2ad46bc92 | [
"MIT"
] | 8 | 2021-03-18T22:27:44.000Z | 2022-02-10T09:18:50.000Z | venv/lib/python3.6/site-packages/phonenumbers/geodata/data15.py | MubongwoNdasi/pms | 0cc5dcbc25b31e13631672e1a03c88e2ad46bc92 | [
"MIT"
] | 1 | 2021-09-20T06:37:41.000Z | 2021-09-20T06:37:41.000Z | """Per-prefix data, mapping each prefix to a dict of locale:name.
Auto-generated file, do not edit by hand.
"""
from ..util import u
# Copyright (C) 2011-2019 The Libphonenumber Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licens... | 91.603213 | 139 | 0.64758 |
27f1e346d913a716bb5e30c7afb53537fdf11baa | 369 | py | Python | portfolio/migrations/0006_auto_20200529_1749.py | Jokotoye18/my-portfolio | 774559f7f142ee2605b9fe1edf508468a3fad6d9 | [
"MIT"
] | null | null | null | portfolio/migrations/0006_auto_20200529_1749.py | Jokotoye18/my-portfolio | 774559f7f142ee2605b9fe1edf508468a3fad6d9 | [
"MIT"
] | 8 | 2021-04-08T19:39:49.000Z | 2022-03-12T00:47:10.000Z | portfolio/migrations/0006_auto_20200529_1749.py | Jokotoye18/my-portfolio | 774559f7f142ee2605b9fe1edf508468a3fad6d9 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.6 on 2020-05-29 16:49
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('portfolio', '0005_portfolio_url'),
]
operations = [
migrations.AlterField(
model_name='portfolio',
name='url',
... | 19.421053 | 47 | 0.582656 |
43651da04dda42eb1461e52269743622c17e03d9 | 32,309 | py | Python | papers/PACMOO/main.py | mindspore-ai/contrib | 85dccac7a2ba6e962092ecd51aefd962d7f2aeac | [
"Apache-2.0"
] | 2 | 2021-11-10T06:16:55.000Z | 2022-02-22T11:30:04.000Z | papers/PACMOO/main.py | mindspore-ai/contrib | 85dccac7a2ba6e962092ecd51aefd962d7f2aeac | [
"Apache-2.0"
] | null | null | null | papers/PACMOO/main.py | mindspore-ai/contrib | 85dccac7a2ba6e962092ecd51aefd962d7f2aeac | [
"Apache-2.0"
] | 1 | 2022-03-22T06:03:15.000Z | 2022-03-22T06:03:15.000Z | """
This data implement paper's algorithm
:paper author: hxq
:code author: hxq
:code convert: shy
"""
import random
import os
import sys
import numpy as np
from tqdm import tqdm
from scipy import sparse
import mindspore.nn.probability.distribution as msd
import mindspore.numpy as mnp
from mindspore import dtype as ms... | 35.543454 | 99 | 0.5942 |
2db3adf7b24d9bd22b48918651b94f05f9d0929b | 35,136 | py | Python | mythril/laser/ethereum/instructions.py | dhagell/mythril-search | 00b1bf728cb87d900a93c5430aff6b990c01bdcd | [
"MIT"
] | null | null | null | mythril/laser/ethereum/instructions.py | dhagell/mythril-search | 00b1bf728cb87d900a93c5430aff6b990c01bdcd | [
"MIT"
] | null | null | null | mythril/laser/ethereum/instructions.py | dhagell/mythril-search | 00b1bf728cb87d900a93c5430aff6b990c01bdcd | [
"MIT"
] | null | null | null | import binascii
import logging
from copy import copy, deepcopy
import ethereum.opcodes as opcodes
from ethereum import utils
from z3 import BitVec, Extract, UDiv, simplify, Concat, ULT, UGT, BitVecNumRef, Not, \
is_false, is_expr, ExprRef
from z3 import BitVecVal, If, BoolRef
import mythril.laser.ethereum.util as... | 34.891758 | 180 | 0.607696 |
ec30f5c9dd48e77af0f2dbd5f8c3a8568d925a6b | 19,544 | py | Python | bentoml/yatai/client/deployment_api.py | co42/BentoML | b14c748c9a2841731c6b7694ccd61125324661ec | [
"Apache-2.0"
] | 2 | 2020-12-15T08:58:59.000Z | 2021-09-27T06:12:38.000Z | bentoml/yatai/client/deployment_api.py | co42/BentoML | b14c748c9a2841731c6b7694ccd61125324661ec | [
"Apache-2.0"
] | 1 | 2020-11-11T02:33:36.000Z | 2020-11-11T02:33:36.000Z | bentoml/yatai/client/deployment_api.py | co42/BentoML | b14c748c9a2841731c6b7694ccd61125324661ec | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Atalaya Tech, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, ... | 34.775801 | 110 | 0.631652 |
faf4c4d37e5ddcc035362a5b553d2c1a001638db | 19,322 | py | Python | data/loader.py | jeffrobots/gatech_ml | 2f98e56da1cc6b0b846d34111a37c0735abaa5a3 | [
"MIT"
] | null | null | null | data/loader.py | jeffrobots/gatech_ml | 2f98e56da1cc6b0b846d34111a37c0735abaa5a3 | [
"MIT"
] | null | null | null | data/loader.py | jeffrobots/gatech_ml | 2f98e56da1cc6b0b846d34111a37c0735abaa5a3 | [
"MIT"
] | 3 | 2020-10-01T03:59:24.000Z | 2021-02-26T22:25:41.000Z | import copy
import logging
import pandas as pd
import numpy as np
from collections import Counter
from sklearn import preprocessing, utils
import sklearn.model_selection as ms
from scipy.sparse import isspmatrix
from sklearn.pipeline import Pipeline
from sklearn.preprocessing import StandardScaler
import os
import s... | 34.19823 | 127 | 0.63332 |
baa4d01e33a70ba9f6f74850dfffac2e810e618e | 1,826 | py | Python | designate/api/admin/views/extensions/quotas.py | cneill/designate-testing | 7bf320062d85a12bff2aee8d26c133941a289fc4 | [
"Apache-2.0"
] | null | null | null | designate/api/admin/views/extensions/quotas.py | cneill/designate-testing | 7bf320062d85a12bff2aee8d26c133941a289fc4 | [
"Apache-2.0"
] | null | null | null | designate/api/admin/views/extensions/quotas.py | cneill/designate-testing | 7bf320062d85a12bff2aee8d26c133941a289fc4 | [
"Apache-2.0"
] | null | null | null | # COPYRIGHT 2014 Rackspace
#
# Author: Tim Simmons <tim.simmons@rackspace.com>
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | 33.814815 | 77 | 0.662103 |
99181f4a145932179e8d85f10ac4e4456eeb52a1 | 1,616 | py | Python | tests/test_esn.py | blindedjoy/Reservoir | ee5b2a37df9ac69c8f6632f520b7f0ebcf43e707 | [
"MIT"
] | 3 | 2017-04-05T18:37:03.000Z | 2020-08-03T23:09:41.000Z | tests/test_esn.py | blindedjoy/Reservoir | ee5b2a37df9ac69c8f6632f520b7f0ebcf43e707 | [
"MIT"
] | null | null | null | tests/test_esn.py | blindedjoy/Reservoir | ee5b2a37df9ac69c8f6632f520b7f0ebcf43e707 | [
"MIT"
] | 4 | 2020-04-18T17:10:14.000Z | 2020-12-15T09:16:19.000Z | import numpy as np
import matplotlib.pyplot as plt
from reservoir import *
def test_esn():
# Load data
data = np.loadtxt('example_data/MackeyGlass_t17.txt')
train = data[:4000].reshape(-1, 1)
test = data[4000:4100].reshape(-1, 1)
# Set optimization bounds
bounds = {'input_scaling': (0, 1),
... | 32.32 | 102 | 0.534653 |
a8f3bf42d0efcf966aba13327902929c973fc004 | 1,475 | py | Python | sdk/python/pulumi_azure_native/machinelearningservices/v20191101/_enums.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 31 | 2020-09-21T09:41:01.000Z | 2021-02-26T13:21:59.000Z | sdk/python/pulumi_azure_native/machinelearningservices/v20191101/_enums.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 231 | 2020-09-21T09:38:45.000Z | 2021-03-01T11:16:03.000Z | sdk/python/pulumi_azure_native/machinelearningservices/v20191101/_enums.py | pulumi-bot/pulumi-azure-native | f7b9490b5211544318e455e5cceafe47b628e12c | [
"Apache-2.0"
] | 4 | 2020-09-29T14:14:59.000Z | 2021-02-10T20:38:16.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
from enum import Enum
__all__ = [
'ComputeType',
'RemoteLoginPortPublicAccess',
'ResourceIdentityType',
'VmPriority',
]
class Comput... | 29.5 | 467 | 0.694237 |
ca9bb4af1cbc25246930bde5f5bcf313510c52bf | 209 | py | Python | BeautifulSoup/index.py | shravakushwaha/beautifulsoup | d915b772a075729949972d1585d7cc7391e9565d | [
"Apache-2.0"
] | null | null | null | BeautifulSoup/index.py | shravakushwaha/beautifulsoup | d915b772a075729949972d1585d7cc7391e9565d | [
"Apache-2.0"
] | null | null | null | BeautifulSoup/index.py | shravakushwaha/beautifulsoup | d915b772a075729949972d1585d7cc7391e9565d | [
"Apache-2.0"
] | null | null | null | import bs4
from bs4 import BeautifulStoneSoup
import requests
url=requests.get('https://gstserver.com/tools/distance-between-pin-codes/')
soap=bs4.BeautifulSoup(url.text, 'html.parser')
print(soap.get_text()) | 29.857143 | 75 | 0.799043 |
11d48de486a765913f4b5c6c5c87198071e65cd6 | 911 | py | Python | fluentcms_file/tests.py | bashu/fluentcms-file | cf62eb5b5073642c53473eab740f61e51762d26a | [
"Apache-2.0"
] | 1 | 2021-11-19T10:39:47.000Z | 2021-11-19T10:39:47.000Z | fluentcms_file/tests.py | bashu/fluentcms-file | cf62eb5b5073642c53473eab740f61e51762d26a | [
"Apache-2.0"
] | null | null | null | fluentcms_file/tests.py | bashu/fluentcms-file | cf62eb5b5073642c53473eab740f61e51762d26a | [
"Apache-2.0"
] | null | null | null | from django.test import TestCase
from django.core.files.uploadedfile import SimpleUploadedFile
from fluent_contents.tests.factories import create_content_item
from fluent_contents.tests.utils import render_content_items
from fluentcms_file.models import FileItem
class FileTests(TestCase):
"""
Testing file pl... | 29.387097 | 142 | 0.600439 |
0a7993a4c0fd800810bb5d118acb9c7a6be06149 | 1,502 | py | Python | tests/compiler/test_caps.py | pretl/ALIGN-public | 4b03042d9e96fa669740427842b0bf268b0c9a86 | [
"BSD-3-Clause"
] | null | null | null | tests/compiler/test_caps.py | pretl/ALIGN-public | 4b03042d9e96fa669740427842b0bf268b0c9a86 | [
"BSD-3-Clause"
] | null | null | null | tests/compiler/test_caps.py | pretl/ALIGN-public | 4b03042d9e96fa669740427842b0bf268b0c9a86 | [
"BSD-3-Clause"
] | null | null | null | import pathlib
import json
from align.compiler.compiler import compiler_input, call_primitive_generator, constraint_generator, compiler_output
def test_cap():
mydir = pathlib.Path(__file__).resolve()
pdk_path = mydir.parent.parent.parent / "pdks" / "FinFET14nm_Mock_PDK"
config_path = mydir.parent.parent ... | 37.55 | 115 | 0.689081 |
b1ca59cb4a489c58baa80e89b0438546d575d168 | 2,266 | py | Python | VideoNet/C3D_model.py | ihoung/video_classification | 93a7029d190d863081864be9c065f50212d06646 | [
"MIT"
] | null | null | null | VideoNet/C3D_model.py | ihoung/video_classification | 93a7029d190d863081864be9c065f50212d06646 | [
"MIT"
] | null | null | null | VideoNet/C3D_model.py | ihoung/video_classification | 93a7029d190d863081864be9c065f50212d06646 | [
"MIT"
] | null | null | null | import tensorflow as tf
import tensorflow.contrib.slim as slim
def C3D(input, num_classes, keep_pro=0.5):
with tf.variable_scope('C3D'):
with slim.arg_scope([slim.conv3d, slim.fully_connected],
weights_regularizer=slim.l2_regularizer(0.0005),
weights... | 58.102564 | 118 | 0.536187 |
baa681cd06d4805012f9b6d8bf2546eb4cea9dda | 17,196 | py | Python | grr/server/grr_response_server/gui/api_labels_restricted_call_router_test.py | JiYonG-Lee/grr | 57fef67080ac6b8fd3de3ba0adfca064d34b7689 | [
"Apache-2.0"
] | 1 | 2020-06-25T14:25:51.000Z | 2020-06-25T14:25:51.000Z | grr/server/grr_response_server/gui/api_labels_restricted_call_router_test.py | JiYonG-Lee/grr | 57fef67080ac6b8fd3de3ba0adfca064d34b7689 | [
"Apache-2.0"
] | 3 | 2021-05-11T20:18:38.000Z | 2022-03-02T09:33:56.000Z | grr/server/grr_response_server/gui/api_labels_restricted_call_router_test.py | JiYonG-Lee/grr | 57fef67080ac6b8fd3de3ba0adfca064d34b7689 | [
"Apache-2.0"
] | 1 | 2020-06-25T14:25:54.000Z | 2020-06-25T14:25:54.000Z | #!/usr/bin/env python
# Lint as: python3
"""Tests for an ApiLabelsRestrictedCallRouter."""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
from absl import app
from grr_response_server import access_control
from grr_response_server import data_store
from... | 36.980645 | 83 | 0.732031 |
a64b4e53b6001deb3a77a1c185ec54234bb0fea9 | 546 | py | Python | runtime/ipython/profile_default/startup/00-pyspark-setup.py | kfoss/ipython-spark-docker | ebe05d5bd6dfab95d923840f3e93929ebdea301e | [
"Apache-2.0"
] | null | null | null | runtime/ipython/profile_default/startup/00-pyspark-setup.py | kfoss/ipython-spark-docker | ebe05d5bd6dfab95d923840f3e93929ebdea301e | [
"Apache-2.0"
] | null | null | null | runtime/ipython/profile_default/startup/00-pyspark-setup.py | kfoss/ipython-spark-docker | ebe05d5bd6dfab95d923840f3e93929ebdea301e | [
"Apache-2.0"
] | null | null | null | # Configure the necessary Spark environment
import os
import sys
spark_home = os.environ.get('SPARK_HOME', None)
if not spark_home:
raise ValueError('SPARK_HOME environment variable is not set')
sys.path.insert(0, spark_home + "/python")
# Add the py4j to the path.
# You may need to change the version number to m... | 34.125 | 79 | 0.761905 |
35c7b402a70a77db9d37c32fc6ecdb75ecc15722 | 735 | py | Python | django_africa_site/videos/forms.py | Uncensored-Developer/django_africa_site | 15d7d2b88b2307d2a7515acd52bfbd965c0b87ec | [
"MIT"
] | null | null | null | django_africa_site/videos/forms.py | Uncensored-Developer/django_africa_site | 15d7d2b88b2307d2a7515acd52bfbd965c0b87ec | [
"MIT"
] | 3 | 2021-03-19T00:16:47.000Z | 2021-09-22T18:37:42.000Z | django_africa_site/videos/forms.py | Uncensored-Developer/django_africa_site | 15d7d2b88b2307d2a7515acd52bfbd965c0b87ec | [
"MIT"
] | null | null | null | from django import forms
from .models import Video, VideoCategory
class AddVideoForm(forms.ModelForm):
class Meta:
model = Video
choices = [
('test', 'Test'),
('test', 'Test'),
('test', 'Test'),
('test', 'Test'),
]
exclude = ['create... | 28.269231 | 72 | 0.478912 |
ce78c2ecb806a23b001c12204b750fa52b1a16e8 | 1,269 | py | Python | app/core/tests/test_models.py | FaridQattali/recipe-app-api | 985f4929c9ecef1f36a8e8b6b95d2319563c7916 | [
"MIT"
] | null | null | null | app/core/tests/test_models.py | FaridQattali/recipe-app-api | 985f4929c9ecef1f36a8e8b6b95d2319563c7916 | [
"MIT"
] | null | null | null | app/core/tests/test_models.py | FaridQattali/recipe-app-api | 985f4929c9ecef1f36a8e8b6b95d2319563c7916 | [
"MIT"
] | null | null | null | from django.test import TestCase
from django.contrib.auth import get_user_model
class ModelTest(TestCase):
def test_create_user_with_email_successfully(self):
"""Test that a user is created with email successfully!"""
email = 'faridqattali@gmail.com'
password = 'farid123'
user = g... | 30.95122 | 69 | 0.655634 |
902c58131f339f10ae9b062e34feb387b274fcd6 | 1,956 | py | Python | tests/test_build_manpage.py | hatchermarie2/sphinx | 204564549cae0d2fc88ea270df8dde0535277a70 | [
"BSD-2-Clause"
] | 1 | 2021-02-11T11:44:51.000Z | 2021-02-11T11:44:51.000Z | tests/test_build_manpage.py | hatchermarie2/sphinx | 204564549cae0d2fc88ea270df8dde0535277a70 | [
"BSD-2-Clause"
] | null | null | null | tests/test_build_manpage.py | hatchermarie2/sphinx | 204564549cae0d2fc88ea270df8dde0535277a70 | [
"BSD-2-Clause"
] | null | null | null | """
test_build_manpage
~~~~~~~~~~~~~~~~~~
Test the build process with manpage builder with the test root.
:copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import pytest
from sphinx.builders.manpage import default_man_pages
from sphinx.c... | 28.347826 | 68 | 0.592536 |
8192b8f514be9fef1a2a76e062c3beb3e96862d1 | 11,783 | py | Python | applications/RANSApplication/python_scripts/formulations/utilities.py | Rodrigo-Flo/Kratos | f718cae5d1618e9c0e7ed1da9e95b7a853e62b1b | [
"BSD-4-Clause"
] | null | null | null | applications/RANSApplication/python_scripts/formulations/utilities.py | Rodrigo-Flo/Kratos | f718cae5d1618e9c0e7ed1da9e95b7a853e62b1b | [
"BSD-4-Clause"
] | null | null | null | applications/RANSApplication/python_scripts/formulations/utilities.py | Rodrigo-Flo/Kratos | f718cae5d1618e9c0e7ed1da9e95b7a853e62b1b | [
"BSD-4-Clause"
] | null | null | null | from importlib import import_module
import KratosMultiphysics as Kratos
import KratosMultiphysics.FluidDynamicsApplication as KratosCFD
import KratosMultiphysics.RANSApplication as KratosRANS
from KratosMultiphysics import IsDistributedRun
from KratosMultiphysics import VariableUtils
from KratosMultiphysics.kratos_ut... | 45.319231 | 142 | 0.718832 |
578a1e38a5c4b5a00b6115ae72f4d543006317ef | 6,076 | py | Python | TransitTimeEstimator.py | VoxleJ/AorticPulseWaveVelocity | 65461403040809864bb832a74919a847af3e2323 | [
"MIT"
] | 1 | 2020-01-09T07:33:20.000Z | 2020-01-09T07:33:20.000Z | TransitTimeEstimator.py | VoxleJ/AorticPulseWaveVelocity | 65461403040809864bb832a74919a847af3e2323 | [
"MIT"
] | null | null | null | TransitTimeEstimator.py | VoxleJ/AorticPulseWaveVelocity | 65461403040809864bb832a74919a847af3e2323 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Sep 4 10:44:25 2019
@author: vjha1
"""
import matplotlib.pyplot as plt
import numpy as np
from scipy.interpolate import interp1d
import math
from scipy.signal import find_peaks
import time
import sys
#===============Defining Functions========================... | 24.59919 | 80 | 0.58871 |
936a76398f072d32fae08e5cd8c5b6eb4b84c06b | 22,822 | py | Python | tests/generic_inline_admin/tests.py | geelweb/django | 59afe61a970dd60df388e7cda9041ef3c0e770cb | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2017-07-17T02:33:21.000Z | 2017-07-17T02:33:21.000Z | tests/generic_inline_admin/tests.py | geelweb/django | 59afe61a970dd60df388e7cda9041ef3c0e770cb | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2020-07-02T21:10:44.000Z | 2020-07-02T21:11:21.000Z | tests/generic_inline_admin/tests.py | geelweb/django | 59afe61a970dd60df388e7cda9041ef3c0e770cb | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2020-08-11T18:46:32.000Z | 2020-08-11T18:46:32.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from django.contrib.admin.sites import AdminSite
from django.contrib.auth.models import User
from django.contrib.contenttypes.admin import GenericTabularInline
from django.contrib.contenttypes.forms import generic_inlinefo... | 42.184843 | 117 | 0.650031 |
46d9db39a522c6d670b2355f523b0e98bc1dbc71 | 1,484 | py | Python | ch05/ch05.py | yummybian/python-practice-book | 1efbea8a7f42396b978153683e1e649e3e74dd16 | [
"MIT"
] | 5 | 2015-04-03T10:15:21.000Z | 2020-06-09T08:21:39.000Z | ch05/ch05.py | yummybian/python-practice-book | 1efbea8a7f42396b978153683e1e649e3e74dd16 | [
"MIT"
] | null | null | null | ch05/ch05.py | yummybian/python-practice-book | 1efbea8a7f42396b978153683e1e649e3e74dd16 | [
"MIT"
] | null | null | null | # Problem 1.
def reverse_iter(lst):
"""
>>> it = reverse_iter([1, 2, 3, 4])
>>> it.next()
4
>>> it.next()
3
>>> it.next()
2
>>> it.next()
1
>>> it.next()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
StopIteration
"""
for x in... | 15.787234 | 56 | 0.489218 |
3b263bdbc446bfa8327b304d78aefc23caedb228 | 2,044 | py | Python | xplaneDataToPilotsTcp.py | paulsaswata/xplaneTopilots | 9eb46f6c138d5f8e4e120e3246c219902ddda2aa | [
"Unlicense"
] | null | null | null | xplaneDataToPilotsTcp.py | paulsaswata/xplaneTopilots | 9eb46f6c138d5f8e4e120e3246c219902ddda2aa | [
"Unlicense"
] | null | null | null | xplaneDataToPilotsTcp.py | paulsaswata/xplaneTopilots | 9eb46f6c138d5f8e4e120e3246c219902ddda2aa | [
"Unlicense"
] | null | null | null | import socket
import matplotlib as mpl
from mpl_toolkits.mplot3d import Axes3D
import numpy as np
import matplotlib.pyplot as plt
import csv
import pandas as pd
import time
import os
from itertools import islice
from datetime import datetime
import pytz
import threading
import random
''' variables and their Xplane co... | 25.55 | 158 | 0.665851 |
c08ada953c2119076a31607c1651cc87dafb0beb | 27,807 | py | Python | PEPit/pep.py | bgoujaud/PEPit | 7352607069f5e90fb1919fc689ec5e9d745c3bac | [
"MIT"
] | 44 | 2021-11-18T16:41:20.000Z | 2022-02-14T09:59:13.000Z | PEPit/pep.py | bgoujaud/PEPit | 7352607069f5e90fb1919fc689ec5e9d745c3bac | [
"MIT"
] | 2 | 2021-10-05T09:20:25.000Z | 2022-02-19T13:58:01.000Z | PEPit/pep.py | bgoujaud/PEPit | 7352607069f5e90fb1919fc689ec5e9d745c3bac | [
"MIT"
] | 1 | 2022-02-08T12:03:29.000Z | 2022-02-08T12:03:29.000Z | import numpy as np
import cvxpy as cp
from PEPit.point import Point
from PEPit.expression import Expression
from PEPit.constraint import Constraint
from PEPit.function import Function
class PEP(object):
"""
The class :class:`PEP` is the main class of this framework.
A :class:`PEP` object encodes a comple... | 48.025907 | 127 | 0.578451 |
986e91621bc53bbc52947ed4f643125493df1eff | 10,201 | py | Python | holoviews/ipython/display_hooks.py | zazbot5000/holoviews | 65136173014124b41cee00f5a0fee82acdc78f7f | [
"BSD-3-Clause"
] | null | null | null | holoviews/ipython/display_hooks.py | zazbot5000/holoviews | 65136173014124b41cee00f5a0fee82acdc78f7f | [
"BSD-3-Clause"
] | null | null | null | holoviews/ipython/display_hooks.py | zazbot5000/holoviews | 65136173014124b41cee00f5a0fee82acdc78f7f | [
"BSD-3-Clause"
] | null | null | null | """
Definition and registration of display hooks for the IPython Notebook.
"""
from functools import wraps
from contextlib import contextmanager
import sys, traceback
import IPython
from IPython import get_ipython
from IPython.display import HTML
import holoviews
from ..core.options import (Store, StoreOptions, Skip... | 30.725904 | 95 | 0.65572 |
8fbb920ab12d39ffb0109b5a95fa37d6e08aed08 | 447 | py | Python | nz_crawl_demo/day2/requests/auth.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | null | null | null | nz_crawl_demo/day2/requests/auth.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 27 | 2020-02-12T07:55:58.000Z | 2022-03-12T00:19:09.000Z | nz_crawl_demo/day2/requests/auth.py | gaohj/nzflask_bbs | 36a94c380b78241ed5d1e07edab9618c3e8d477b | [
"Apache-2.0"
] | 2 | 2020-02-18T01:54:55.000Z | 2020-02-21T11:36:28.000Z | import requests
auth = ('test','123456')
headers = {
'User-Agent':"Mozilla/5.0 (Windows NT 6.1; WOW64; rv:64.0) Gecko/20100101 Firefox/64.0"
}
res = requests.get("https://api.github.com/user",headers=headers,verify=False,auth=auth)
print(res.text)
#encoding: utf-8
import requests
resp = requests.get('http://www.... | 29.8 | 91 | 0.697987 |
15d0aacd2c2efc834c112ca911355a8640874741 | 2,437 | py | Python | src/rust/iced-x86-py/tests/memory_operand_test.py | woodruffw-forks/iced | cf23473cf26cd7215dee7510093fad140c696cc7 | [
"MIT"
] | 1 | 2021-06-10T15:26:22.000Z | 2021-06-10T15:26:22.000Z | src/rust/iced-x86-py/tests/memory_operand_test.py | paulfariello/iced | 08f663ae9626b05ab08ad36dd5143f94aed365b6 | [
"MIT"
] | null | null | null | src/rust/iced-x86-py/tests/memory_operand_test.py | paulfariello/iced | 08f663ae9626b05ab08ad36dd5143f94aed365b6 | [
"MIT"
] | null | null | null | # SPDX-License-Identifier: MIT
# Copyright (C) 2018-present iced project and contributors
import copy
import pytest
from iced_x86 import *
def test_ctor_signed_and_unsigned_displ():
m1 = MemoryOperand(displ=-1)
m2 = MemoryOperand.ctor_u64(displ=0xFFFF_FFFF_FFFF_FFFF)
assert m1 == m2
MemoryOperand.ctor_u64(displ=0... | 28.011494 | 141 | 0.719327 |
fbbaa931c9d9431d44b8e08cb441a164cd715493 | 4,497 | py | Python | src/gt4sd/algorithms/conditional_generation/tests/test_paccmann_rl.py | hhhsu0825/gt4sd-core | 4a1fe9da58d2f33bba2fba64604427e037ad7a46 | [
"MIT"
] | 1 | 2022-02-22T02:06:10.000Z | 2022-02-22T02:06:10.000Z | src/gt4sd/algorithms/conditional_generation/tests/test_paccmann_rl.py | hhhsu0825/gt4sd-core | 4a1fe9da58d2f33bba2fba64604427e037ad7a46 | [
"MIT"
] | 12 | 2022-02-21T12:59:24.000Z | 2022-02-22T12:25:49.000Z | src/gt4sd/algorithms/conditional_generation/tests/test_paccmann_rl.py | hhhsu0825/gt4sd-core | 4a1fe9da58d2f33bba2fba64604427e037ad7a46 | [
"MIT"
] | null | null | null | """PaccMannRL tests."""
import pickle
from typing import ClassVar, Type
import numpy as np
import pytest
from gt4sd.algorithms.conditional_generation.paccmann_rl import (
PaccMannRL,
PaccMannRLOmicBasedGenerator,
PaccMannRLProteinBasedGenerator,
)
from gt4sd.algorithms.core import AlgorithmConfiguration
... | 27.588957 | 76 | 0.679342 |
862fa197261c9dfefed053d819e7597eb0446514 | 542 | py | Python | escher/tests/test_urls.py | jlerman44/escher | 93b1ec351349d7c71eee6cf9a39ebdb1a4c3c8e8 | [
"MIT"
] | 1 | 2015-03-16T11:00:44.000Z | 2015-03-16T11:00:44.000Z | escher/tests/test_urls.py | jlerman44/escher | 93b1ec351349d7c71eee6cf9a39ebdb1a4c3c8e8 | [
"MIT"
] | null | null | null | escher/tests/test_urls.py | jlerman44/escher | 93b1ec351349d7c71eee6cf9a39ebdb1a4c3c8e8 | [
"MIT"
] | null | null | null | from escher import urls
from escher.server import directory
from urllib2 import urlopen
from os.path import join, exists
def test_urls():
def make_http(url):
if url.startswith('//'):
url = 'http:' + url
return url
# online
for u in [urls.builder_embed_css, urls.builder_css, url... | 25.809524 | 64 | 0.630996 |
14837556fb5c42865af41e8677c1a34ea8322f78 | 1,654 | py | Python | elstruct/elstruct/reader/_cfour2/version.py | sjklipp/autoio | e2b471e9c9dec933319c98a30d4d519ca5d47645 | [
"Apache-2.0"
] | null | null | null | elstruct/elstruct/reader/_cfour2/version.py | sjklipp/autoio | e2b471e9c9dec933319c98a30d4d519ca5d47645 | [
"Apache-2.0"
] | 1 | 2022-02-15T19:35:14.000Z | 2022-02-15T19:35:14.000Z | elstruct/elstruct/reader/_cfour2/version.py | sjklipp/autoio | e2b471e9c9dec933319c98a30d4d519ca5d47645 | [
"Apache-2.0"
] | 13 | 2020-06-24T05:21:11.000Z | 2021-05-05T19:58:30.000Z | """ Reads the program name and version number from the output file
"""
import autoparse.pattern as app
import autoparse.find as apf
def program_name(output_str):
""" Reads the program name from the output file string.
:param output_str: string of the program's output file
:type output_str: str
... | 25.84375 | 69 | 0.669287 |
a153324ee62c85a5e2d0770b2783e3fc0f2978e4 | 484 | py | Python | tests/test_read_data.py | trabdlkarim/rsioscillator | 2c245a3d78eda2570232769655b809ac7d3d4a6a | [
"MIT"
] | null | null | null | tests/test_read_data.py | trabdlkarim/rsioscillator | 2c245a3d78eda2570232769655b809ac7d3d4a6a | [
"MIT"
] | null | null | null | tests/test_read_data.py | trabdlkarim/rsioscillator | 2c245a3d78eda2570232769655b809ac7d3d4a6a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#-*- coding: utf-8 -*-
import pathlib
import pytest
from rsioscillator.datasource import read_excel, fetch_alphavantage_data
@pytest.fixture
def path():
root = pathlib.Path('__FILE__').parent.resolve()
return str(root / 'data/X30YVADE.xlsx')
def test_read_excel(path):
df = read_exce... | 25.473684 | 72 | 0.698347 |
45bdd7bceccf027ad96897d9ce6defcdfa27f715 | 369 | py | Python | molecule/default/tests/test_default.py | sbesson/ansible-role-omero-web-django-prometheus | abeb805caf12524cb2f8d5b014868b54ac64f7ab | [
"BSD-2-Clause"
] | 4 | 2020-06-25T05:57:39.000Z | 2021-06-26T04:58:16.000Z | backend/tools/playbooks/roles/ome.omero_web_django_prometheus/molecule/default/tests/test_default.py | renmcc/SA2 | a524124c140ae0b291b10dafc11d38744dd93bd9 | [
"MIT"
] | 3 | 2019-11-13T14:55:41.000Z | 2020-09-22T07:31:06.000Z | molecule/default/tests/test_default.py | openmicroscopy/ansible-role-omero-web-django-prometheus | abeb805caf12524cb2f8d5b014868b54ac64f7ab | [
"BSD-2-Clause"
] | 3 | 2018-06-12T15:44:31.000Z | 2018-09-12T19:36:46.000Z | import os
import testinfra.utils.ansible_runner
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
def test_django_exporter_metrics(host):
out = host.check_output(
'curl http://localhost/django_prometheus/metrics')
assert "djan... | 28.384615 | 64 | 0.791328 |
12222b5d85ba3f72d57adf2de3280495f828904b | 20,875 | py | Python | src/app.py | andres-moya/topology | 2eb79d5a93c862d59a96fc830af1564009b54890 | [
"Apache-2.0"
] | null | null | null | src/app.py | andres-moya/topology | 2eb79d5a93c862d59a96fc830af1564009b54890 | [
"Apache-2.0"
] | null | null | null | src/app.py | andres-moya/topology | 2eb79d5a93c862d59a96fc830af1564009b54890 | [
"Apache-2.0"
] | null | null | null | """
Application File
"""
import csv
import flask
import flask.logging
from flask import Flask, Response, make_response, request, render_template
from io import StringIO
import logging
import os
import re
import sys
import traceback
import urllib.parse
from webapp import default_config
from webapp.common import readfil... | 40.22158 | 125 | 0.63382 |
6e464bcb3f1f3788dfe78d6f304e0c898d382490 | 170 | py | Python | ecpy/rings/__init__.py | andynuma/time-release-encryption-py3 | a5c48d07fae8121b59100d4cd79d3e38402d928c | [
"MIT"
] | 48 | 2016-03-30T07:20:49.000Z | 2022-01-27T10:48:43.000Z | ecpy/rings/__init__.py | andynuma/time-release-encryption-py3 | a5c48d07fae8121b59100d4cd79d3e38402d928c | [
"MIT"
] | 11 | 2017-03-26T11:03:20.000Z | 2021-06-01T15:54:03.000Z | ecpy/rings/__init__.py | andynuma/time-release-encryption-py3 | a5c48d07fae8121b59100d4cd79d3e38402d928c | [
"MIT"
] | 12 | 2016-06-05T19:09:26.000Z | 2021-04-18T04:23:20.000Z | from .Integer import ZZ
from .QuotientRing import QuotientRing
from .polynomial_uni import UnivariatePolynomialRing
from .polynomial_multi import BivariatePolynomialRing
| 34 | 53 | 0.882353 |
e8e36b3c563a0df114a0dfa98035afd3ade914a0 | 11,363 | py | Python | venv/lib/python3.6/site-packages/ansible_collections/community/general/plugins/modules/pear.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 22 | 2021-07-16T08:11:22.000Z | 2022-03-31T07:15:34.000Z | venv/lib/python3.6/site-packages/ansible_collections/community/general/plugins/modules/pear.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | venv/lib/python3.6/site-packages/ansible_collections/community/general/plugins/modules/pear.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 39 | 2021-07-05T02:31:42.000Z | 2022-03-31T02:46:03.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2012, Afterburn <https://github.com/afterburn>
# (c) 2013, Aaron Bull Schaefer <aaron@elasticdog.com>
# (c) 2015, Jonathan Lestrelin <jonathan.lestrelin@gmail.com>
#
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __futu... | 35.509375 | 160 | 0.630907 |
0f28e93424858823a37bff53f25a1d91885314fd | 773 | py | Python | LexisNexis_Labeler/file_splitter.py | taufiqhusada/nyt-news-labeler | a77c45feb53c662f2cad6be4e45e3935b6e8f1b7 | [
"Apache-2.0"
] | null | null | null | LexisNexis_Labeler/file_splitter.py | taufiqhusada/nyt-news-labeler | a77c45feb53c662f2cad6be4e45e3935b6e8f1b7 | [
"Apache-2.0"
] | null | null | null | LexisNexis_Labeler/file_splitter.py | taufiqhusada/nyt-news-labeler | a77c45feb53c662f2cad6be4e45e3935b6e8f1b7 | [
"Apache-2.0"
] | null | null | null | import os
from tqdm import tqdm
names_extraction_file = '/projectnb/multilm/yusuf/racial_bias/LexisNexis/extracted_final.csv'
target_folder = '/projectnb/multilm/thdaryan/racial_bias/names_extraction_splitted'
chunk_size = 10000000
with open(names_extraction_file, encoding='utf8') as infile:
i = 0
split =... | 27.607143 | 118 | 0.595084 |
dc4c31aee1b9503e2410ffc8c1d9d310de9140a6 | 1,505 | py | Python | rlkit/data_management/env_replay_buffer.py | JieRen98/rlkit-pmoe | 5ef4e056764d2c4a8d6e4c6da89295304b1fec3f | [
"MIT"
] | 3 | 2021-06-15T03:03:52.000Z | 2021-12-20T03:08:03.000Z | rlkit/data_management/env_replay_buffer.py | JieRen98/rlkit-pmoe | 5ef4e056764d2c4a8d6e4c6da89295304b1fec3f | [
"MIT"
] | null | null | null | rlkit/data_management/env_replay_buffer.py | JieRen98/rlkit-pmoe | 5ef4e056764d2c4a8d6e4c6da89295304b1fec3f | [
"MIT"
] | null | null | null | import numpy as np
from gym.spaces import Discrete
from rlkit.data_management.simple_replay_buffer import SimpleReplayBuffer
from rlkit.envs.env_utils import get_dim
class EnvReplayBuffer(SimpleReplayBuffer):
def __init__(
self,
max_replay_buffer_size,
env,
env_inf... | 29.509804 | 73 | 0.597342 |
a4a49e8aebfcb08bb8849d0e5ee2aa239351fc4e | 6,972 | py | Python | text_tree/text_tree.py | zengbin93/TextTree | bb29343e2a6f27bd3fa2d8312c21280fdaa60f69 | [
"MIT"
] | null | null | null | text_tree/text_tree.py | zengbin93/TextTree | bb29343e2a6f27bd3fa2d8312c21280fdaa60f69 | [
"MIT"
] | null | null | null | text_tree/text_tree.py | zengbin93/TextTree | bb29343e2a6f27bd3fa2d8312c21280fdaa60f69 | [
"MIT"
] | 2 | 2020-02-21T09:18:13.000Z | 2021-11-18T09:48:52.000Z | # coding: utf-8
from tqdm import tqdm
from functools import lru_cache
from collections import Counter
import math
from .tree import Tree
def char_tokenizer(text):
return list(text)
def space_tokenizer(text):
return text.split(" ")
@lru_cache(maxsize=65536 * 2, typed=False)
def ngram(text, n=4, tokenizer=c... | 34.176471 | 112 | 0.538296 |
a1632b0c49b54a979899b9b91a7ce5d3b3bf80d6 | 1,289 | py | Python | release.py | gowins/moha | 0fbd5ef34eb6dfd8c6f689f3a94c4982656cafc2 | [
"Apache-2.0"
] | 123 | 2018-11-27T09:30:27.000Z | 2022-02-22T11:35:32.000Z | release.py | gowins/moha | 0fbd5ef34eb6dfd8c6f689f3a94c4982656cafc2 | [
"Apache-2.0"
] | 14 | 2019-01-07T07:21:47.000Z | 2022-03-25T13:37:14.000Z | release.py | gowins/moha | 0fbd5ef34eb6dfd8c6f689f3a94c4982656cafc2 | [
"Apache-2.0"
] | 40 | 2018-11-27T09:35:01.000Z | 2022-03-25T12:34:13.000Z | import sys
import os
import subprocess
if __name__ == '__main__':
# pre-check
current_branch = subprocess.check_output(["git", "rev-parse", "--abbrev-ref", "HEAD"])
current_branch = current_branch.replace("\n", "")
if current_branch != "master":
print("current branch is ", current_branch, " not... | 32.225 | 90 | 0.594259 |
a586b65332c933d67343331c090b8aeb856273bd | 44,194 | py | Python | aries_cloudagent/ledger/indy.py | adamsc64/aries-cloudagent-python | d09f6085b248a68c95822ae6b2aa06bb0053675b | [
"Apache-2.0"
] | null | null | null | aries_cloudagent/ledger/indy.py | adamsc64/aries-cloudagent-python | d09f6085b248a68c95822ae6b2aa06bb0053675b | [
"Apache-2.0"
] | 1 | 2020-03-06T12:11:29.000Z | 2020-03-06T12:11:29.000Z | aries_cloudagent/ledger/indy.py | adamsc64/aries-cloudagent-python | d09f6085b248a68c95822ae6b2aa06bb0053675b | [
"Apache-2.0"
] | null | null | null | """Indy ledger implementation."""
import asyncio
import json
import logging
import tempfile
from datetime import datetime, date
from enum import Enum
from hashlib import sha256
from os import path
from time import time
from typing import Sequence, Tuple, Union
import indy.ledger
import indy.pool
from indy.error impo... | 37.869751 | 88 | 0.592773 |
3499d2ea08a21fd34c4370162a223bd54d4a6e40 | 2,591 | py | Python | opentelemetry-api/src/opentelemetry/propagators/composite.py | TimPansino/opentelemetry-python | 51ed4576c611316bd3f74d213501f5ffa3e2a5ca | [
"Apache-2.0"
] | 1 | 2020-10-05T05:25:14.000Z | 2020-10-05T05:25:14.000Z | opentelemetry-api/src/opentelemetry/propagators/composite.py | TimPansino/opentelemetry-python | 51ed4576c611316bd3f74d213501f5ffa3e2a5ca | [
"Apache-2.0"
] | 1 | 2020-01-22T23:40:28.000Z | 2020-01-22T23:40:28.000Z | opentelemetry-api/src/opentelemetry/propagators/composite.py | TimPansino/opentelemetry-python | 51ed4576c611316bd3f74d213501f5ffa3e2a5ca | [
"Apache-2.0"
] | null | null | null | # Copyright The OpenTelemetry Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 38.102941 | 86 | 0.71787 |
1be870e30334d0366cd90001e907cbf4f0d82123 | 1,863 | py | Python | aura/AI Engineer/course1_20191110/algorithm/Linear_plot_ols.py | linksdl/futuretec-project-coursera_cerficates | 278a533501b702abd90ac3124739d3d85935e1f8 | [
"Apache-2.0"
] | null | null | null | aura/AI Engineer/course1_20191110/algorithm/Linear_plot_ols.py | linksdl/futuretec-project-coursera_cerficates | 278a533501b702abd90ac3124739d3d85935e1f8 | [
"Apache-2.0"
] | null | null | null | aura/AI Engineer/course1_20191110/algorithm/Linear_plot_ols.py | linksdl/futuretec-project-coursera_cerficates | 278a533501b702abd90ac3124739d3d85935e1f8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Linear Regression Example
=========================================================
This example uses the only the first feature of the `diabetes` dataset, in
order to illustrate a two-dimensional plot of this regre... | 27.80597 | 77 | 0.732689 |
8d8120c66eff5f79a2e71d7bf94fea6ba1f92675 | 6,283 | py | Python | learned_optimization/tasks/base.py | Sohl-Dickstein/learned_optimization | cd929359a51d09444665021387c058aac11b63ba | [
"Apache-2.0"
] | null | null | null | learned_optimization/tasks/base.py | Sohl-Dickstein/learned_optimization | cd929359a51d09444665021387c058aac11b63ba | [
"Apache-2.0"
] | null | null | null | learned_optimization/tasks/base.py | Sohl-Dickstein/learned_optimization | cd929359a51d09444665021387c058aac11b63ba | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2021 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed ... | 30.79902 | 80 | 0.68948 |
ba2a73b6545a994030b67169a5fbeaab971a3ed0 | 6,531 | py | Python | temporal/temporal_raster_algebra.py | karttur/geoimagine02-grass | 09c207707ddd0dae04a871e006e184409aa87d99 | [
"BSD-3-Clause"
] | null | null | null | temporal/temporal_raster_algebra.py | karttur/geoimagine02-grass | 09c207707ddd0dae04a871e006e184409aa87d99 | [
"BSD-3-Clause"
] | null | null | null | temporal/temporal_raster_algebra.py | karttur/geoimagine02-grass | 09c207707ddd0dae04a871e006e184409aa87d99 | [
"BSD-3-Clause"
] | null | null | null | """!@package grass.temporal
Temporal raster algebra
(C) 2013 by the GRASS Development Team
This program is free software under the GNU General Public
License (>=v2). Read the file COPYING that comes with GRASS
for details.
:authors: Thomas Leppelt and Soeren Gebbert
.. code-block:: python
>>> p = TemporalRaste... | 35.302703 | 95 | 0.552595 |
a354215c3a428fa579822876ed6e644bc92074ef | 6,926 | py | Python | samples/rainbow/lib/common.py | ChengUVa/ptan | f9b3ef2680ff64fad52e600d73ff2bf42eee310d | [
"MIT"
] | 492 | 2017-10-08T13:01:25.000Z | 2022-03-29T15:44:44.000Z | samples/rainbow/lib/common.py | ChengUVa/ptan | f9b3ef2680ff64fad52e600d73ff2bf42eee310d | [
"MIT"
] | 41 | 2018-04-15T13:25:56.000Z | 2021-09-18T10:57:28.000Z | samples/rainbow/lib/common.py | ChengUVa/ptan | f9b3ef2680ff64fad52e600d73ff2bf42eee310d | [
"MIT"
] | 164 | 2017-11-26T00:14:12.000Z | 2022-03-28T16:21:17.000Z | import sys
import time
import numpy as np
import torch
import torch.nn as nn
from torch.autograd import Variable
HYPERPARAMS = {
'pong': {
'env_name': "PongNoFrameskip-v4",
'stop_reward': 18.0,
'run_name': 'pong',
'replay_size': 100000,
'replay_ini... | 35.701031 | 98 | 0.590962 |
be4c965ebc5e90f129669cfacc0e8b57213640f4 | 8,432 | py | Python | skyportal/tests/api/test_annotations.py | Hallflower20/skyportal | e6e6f288f91aa81c4c34e160940d8f54402f6365 | [
"BSD-3-Clause"
] | null | null | null | skyportal/tests/api/test_annotations.py | Hallflower20/skyportal | e6e6f288f91aa81c4c34e160940d8f54402f6365 | [
"BSD-3-Clause"
] | null | null | null | skyportal/tests/api/test_annotations.py | Hallflower20/skyportal | e6e6f288f91aa81c4c34e160940d8f54402f6365 | [
"BSD-3-Clause"
] | null | null | null | from skyportal.tests import api
def test_post_without_origin_fails(annotation_token, public_source, public_group):
# this should not work, since no "origin" is given
status, data = api(
'POST',
'annotation',
data={
'obj_id': public_source.id,
'data': {'offset_f... | 30.440433 | 87 | 0.607566 |
d920e18b06b4828b81efa9306d1d151e78cb7375 | 463 | py | Python | tkinter/basic/checkbutton.py | sdyz5210/python | 78f9999f94d92d9ca7fde6f18acec7d3abd422ef | [
"BSD-3-Clause"
] | null | null | null | tkinter/basic/checkbutton.py | sdyz5210/python | 78f9999f94d92d9ca7fde6f18acec7d3abd422ef | [
"BSD-3-Clause"
] | null | null | null | tkinter/basic/checkbutton.py | sdyz5210/python | 78f9999f94d92d9ca7fde6f18acec7d3abd422ef | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/evn python
# -*- coding: utf-8 -*-
# python version 2.7.6
from Tkinter import *
import tkMessageBox
top = Tk()
#显示选中与否的值
def show():
print cv1.get()
cv1 = IntVar()
cv2 = IntVar()
cb1 = Checkbutton(top,text = "Music", variable = cv1, onvalue = 1, offvalue = 0, height=5, width = 20,command=show)
cb2 = Che... | 23.15 | 115 | 0.665227 |
45623f182144b59b5b88be554787e5bec1bdda49 | 88,251 | py | Python | pandas/core/arrays/categorical.py | satrio-hw/pandas | 8df0218a4bfae50a7191ff0869e63c28884fb733 | [
"BSD-3-Clause"
] | 1 | 2020-09-15T01:39:01.000Z | 2020-09-15T01:39:01.000Z | pandas/core/arrays/categorical.py | ligne/pandas | 8df0218a4bfae50a7191ff0869e63c28884fb733 | [
"BSD-3-Clause"
] | null | null | null | pandas/core/arrays/categorical.py | ligne/pandas | 8df0218a4bfae50a7191ff0869e63c28884fb733 | [
"BSD-3-Clause"
] | null | null | null | from csv import QUOTE_NONNUMERIC
from functools import partial
import operator
from shutil import get_terminal_size
from typing import Dict, Hashable, List, Type, Union, cast
from warnings import warn
import numpy as np
from pandas._config import get_option
from pandas._libs import NaT, algos as libalgos, hashtable ... | 33.365217 | 88 | 0.579937 |
e13db2b1aa481ddd3269f6055491b4b4f52361e5 | 409 | py | Python | packages/python/plotly/plotly/validators/barpolar/_showlegend.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/barpolar/_showlegend.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/barpolar/_showlegend.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class ShowlegendValidator(_plotly_utils.basevalidators.BooleanValidator):
def __init__(self, plotly_name="showlegend", parent_name="barpolar", **kwargs):
super(ShowlegendValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,... | 34.083333 | 83 | 0.682152 |
dd179eead83be388fe687a8a50ae1977442fd62d | 8,972 | py | Python | vision/nn/vgg.py | idenc/SSD-translate | 6cf8c83b42d6d47282d98822b90491264288d6f1 | [
"MIT"
] | 2 | 2020-03-17T02:49:26.000Z | 2020-05-21T04:10:12.000Z | vision/nn/vgg.py | idenc/SSD-translate | 6cf8c83b42d6d47282d98822b90491264288d6f1 | [
"MIT"
] | 2 | 2021-08-25T15:47:57.000Z | 2022-02-10T00:31:17.000Z | vision/nn/vgg.py | idenc/SSD-translate | 6cf8c83b42d6d47282d98822b90491264288d6f1 | [
"MIT"
] | 1 | 2020-05-21T04:10:13.000Z | 2020-05-21T04:10:13.000Z | """VGG16 model for Keras.
# Reference
- [Very Deep Convolutional Networks for Large-Scale Image Recognition](
https://arxiv.org/abs/1409.1556) (ICLR 2015)
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
from keras_applications import ge... | 39.699115 | 92 | 0.563642 |
9585b38a1adf56275b724dca193e1ed8000b3bf8 | 3,291 | py | Python | code/lib/modules/account_tools.py | 1dustindavis/IT-CPE | bf7c097cb0c3749a533799e1ceeb60eebc658f10 | [
"BSD-3-Clause"
] | null | null | null | code/lib/modules/account_tools.py | 1dustindavis/IT-CPE | bf7c097cb0c3749a533799e1ceeb60eebc658f10 | [
"BSD-3-Clause"
] | null | null | null | code/lib/modules/account_tools.py | 1dustindavis/IT-CPE | bf7c097cb0c3749a533799e1ceeb60eebc658f10 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2015-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.
"""Functions for in... | 26.756098 | 78 | 0.667882 |
e2247876736b81c735b1855ad0c26779d96e7ae1 | 796 | py | Python | testflo/benchmark.py | felixonmars/testflo | bbaba8b6736e5df398d9013437ea1e4be6e6350e | [
"Apache-2.0"
] | 8 | 2015-03-12T19:20:12.000Z | 2019-04-29T20:18:35.000Z | testflo/benchmark.py | felixonmars/testflo | bbaba8b6736e5df398d9013437ea1e4be6e6350e | [
"Apache-2.0"
] | 3 | 2015-05-15T12:12:55.000Z | 2021-12-08T17:27:17.000Z | testflo/benchmark.py | felixonmars/testflo | bbaba8b6736e5df398d9013437ea1e4be6e6350e | [
"Apache-2.0"
] | 7 | 2015-10-14T18:27:47.000Z | 2020-06-09T19:32:58.000Z | import sys
import time
class BenchmarkWriter(object):
"""Writes benchmark data to a file for postprocessing.
Data is written as comma separated values (CSV)
"""
def __init__(self, stream=sys.stdout):
self.timestamp = time.time()
self.stream = stream
def get_iter(self, input_ite... | 25.677419 | 58 | 0.559045 |
83e58fec64e274f29ab42ab630bc16a4a9c7633d | 23,290 | py | Python | xmlschema/tests/test_schemas.py | jhermann/xmlschema | 4251afc21b9ce254edcb75d0b11fe936b206a7d0 | [
"MIT"
] | null | null | null | xmlschema/tests/test_schemas.py | jhermann/xmlschema | 4251afc21b9ce254edcb75d0b11fe936b206a7d0 | [
"MIT"
] | null | null | null | xmlschema/tests/test_schemas.py | jhermann/xmlschema | 4251afc21b9ce254edcb75d0b11fe936b206a7d0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c), 2016-2018, SISSA (International School for Advanced Studies).
# All rights reserved.
# This file is distributed under the terms of the MIT License.
# See the file 'LICENSE' in the root directory of the present
# distribution, or http://opensource.org/lice... | 40.574913 | 109 | 0.580163 |
5906fa673982e8fda1ee033e877299e8d1acad3f | 1,266 | py | Python | mydays/07-09/07.py | josephrewald/100daysofcode-with-python-course | b51dfbf786c1a89694c4661805ef930516683439 | [
"MIT"
] | null | null | null | mydays/07-09/07.py | josephrewald/100daysofcode-with-python-course | b51dfbf786c1a89694c4661805ef930516683439 | [
"MIT"
] | null | null | null | mydays/07-09/07.py | josephrewald/100daysofcode-with-python-course | b51dfbf786c1a89694c4661805ef930516683439 | [
"MIT"
] | null | null | null | NAMES = ['arnold schwarzenegger', 'alec baldwin', 'bob belderbos',
'julian sequeira', 'sandra bullock', 'keanu reeves',
'julbob pybites', 'bob belderbos', 'julian sequeira',
'al pacino', 'brad pitt', 'matt damon', 'brad pitt']
def dedup_and_title_case_names(names):
"""Should return a li... | 30.878049 | 78 | 0.669826 |
8596c14266c20cb3cc56cd60a8ce74cfa565fb66 | 84 | py | Python | python/12_python_functionals/3_reducefunction.py | jaimiles23/hacker_rank | 0580eac82e5d0989afabb5c2e66faf09713f891b | [
"Apache-2.0"
] | null | null | null | python/12_python_functionals/3_reducefunction.py | jaimiles23/hacker_rank | 0580eac82e5d0989afabb5c2e66faf09713f891b | [
"Apache-2.0"
] | null | null | null | python/12_python_functionals/3_reducefunction.py | jaimiles23/hacker_rank | 0580eac82e5d0989afabb5c2e66faf09713f891b | [
"Apache-2.0"
] | 3 | 2021-09-22T11:06:58.000Z | 2022-01-25T09:29:24.000Z | Solution to [Reduce Function](https://www.hackerrank.com/challenges/reduce-function) | 84 | 84 | 0.821429 |
c490e523d8ab6fe11ec00381a1d3fa62175a7741 | 244 | py | Python | vvsa/products/inc/eod_series.py | goncalovf/security-analysis | 72b80ea7c0c5c93b6fd80a4e347ecdb401b7667e | [
"MIT"
] | 1 | 2021-09-16T13:36:13.000Z | 2021-09-16T13:36:13.000Z | vvsa/products/inc/eod_series.py | goncalovf/security-analysis | 72b80ea7c0c5c93b6fd80a4e347ecdb401b7667e | [
"MIT"
] | null | null | null | vvsa/products/inc/eod_series.py | goncalovf/security-analysis | 72b80ea7c0c5c93b6fd80a4e347ecdb401b7667e | [
"MIT"
] | null | null | null | from vvsa.abstracts.time_series import Time_Series
class EOD_Series(Time_Series):
def __init__(self, name, series, source, **alter_series_params):
super().__init__(name, series, **alter_series_params)
self.source = source
| 30.5 | 68 | 0.733607 |
2ed334141828effaf7d3016d68e6aa1ee2e5d47e | 1,274 | py | Python | windows/delete_connection_window.py | galabl/terminalist | cfade8e0e6811927fd8d9b78cb1ed5c0a46eaff9 | [
"MIT"
] | 1 | 2021-04-09T15:50:23.000Z | 2021-04-09T15:50:23.000Z | windows/delete_connection_window.py | galabl/terminalist | cfade8e0e6811927fd8d9b78cb1ed5c0a46eaff9 | [
"MIT"
] | null | null | null | windows/delete_connection_window.py | galabl/terminalist | cfade8e0e6811927fd8d9b78cb1ed5c0a46eaff9 | [
"MIT"
] | null | null | null | from events.delete_connection_window_events import DeleteConnectionWindowEvents
from gi.repository import Gtk
class DeleteConnectionWindow:
glade_file = "layouts/delete_connection_window.glade"
main_object = None
handler_class = None
builder = None
window = None
id_connection = None
refres... | 28.311111 | 80 | 0.689168 |
6a2879527a9bdbce57a7921646f7fce39604d0f9 | 428 | py | Python | algorithms/python/leetcode/tests/test_SubarraySumEqualsK.py | ytjia/coding-pratice | 6ddba1f3b86c40639a8203cbc3373d52301c1b1f | [
"MIT"
] | null | null | null | algorithms/python/leetcode/tests/test_SubarraySumEqualsK.py | ytjia/coding-pratice | 6ddba1f3b86c40639a8203cbc3373d52301c1b1f | [
"MIT"
] | null | null | null | algorithms/python/leetcode/tests/test_SubarraySumEqualsK.py | ytjia/coding-pratice | 6ddba1f3b86c40639a8203cbc3373d52301c1b1f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Authors: Y. Jia <ytjia.zju@gmail.com>
import unittest
from .. import SubarraySumEqualsK
class test_SubarraySumEqualsK(unittest.TestCase):
solution = SubarraySumEqualsK.Solution()
def test_subarraySum(self):
self.assertEqual(self.solution.subarraySum([1, 2, 3], 3), 2)
... | 21.4 | 68 | 0.686916 |
72abfd63d9f42e301b9dc383f667534af4dea8a7 | 2,620 | py | Python | utils/plot_tiff.py | louisemaubant/TSdecomp | 261209b7876395f91b75f3ea9b9c02f317e90f70 | [
"MIT"
] | null | null | null | utils/plot_tiff.py | louisemaubant/TSdecomp | 261209b7876395f91b75f3ea9b9c02f317e90f70 | [
"MIT"
] | null | null | null | utils/plot_tiff.py | louisemaubant/TSdecomp | 261209b7876395f91b75f3ea9b9c02f317e90f70 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2.7
# -*- coding: utf-8 -*-
################################################################################
#
# NSBAS - New Small Baseline Chain
#
################################################################################
# Author : Simon DAOUT (ISTerre)
############################... | 26.464646 | 106 | 0.608015 |
2a2dba62c6a3ca65c46129de70637181ae7e1fe9 | 1,006 | py | Python | ecsctl/config.py | cxmcc/ecsctl | 305170d6517dd7a9ed1dfaae4b0934984c7b8fae | [
"MIT"
] | 114 | 2017-05-26T22:42:00.000Z | 2022-03-22T16:23:18.000Z | ecsctl/config.py | cxmcc/ecsctl | 305170d6517dd7a9ed1dfaae4b0934984c7b8fae | [
"MIT"
] | 7 | 2017-08-09T20:36:14.000Z | 2021-01-25T18:11:47.000Z | ecsctl/config.py | cxmcc/ecsctl | 305170d6517dd7a9ed1dfaae4b0934984c7b8fae | [
"MIT"
] | 18 | 2017-06-27T23:29:02.000Z | 2021-11-22T13:54:38.000Z |
import os
import click
from configparser import RawConfigParser
__all__ = ['read_config', 'update_config', 'default_config']
APP_NAME = SECTION = 'ecsctl'
APP_DIR = click.get_app_dir(APP_NAME)
CONFIG_FILE = os.path.join(APP_DIR, 'config')
default_config = {
'cluster': 'default',
'docker_port': 2375,
'd... | 21.869565 | 60 | 0.656064 |
214bd3e12f252054a72abf17b7c73b4ae194416e | 226 | py | Python | upload/urls.py | devmahmud/Django_file_upload | 8be621658172b895894101c5db351c68faf6c088 | [
"MIT"
] | 2 | 2019-11-28T05:21:40.000Z | 2021-04-21T15:00:29.000Z | upload/urls.py | devmahmud/Django_file_upload | 8be621658172b895894101c5db351c68faf6c088 | [
"MIT"
] | null | null | null | upload/urls.py | devmahmud/Django_file_upload | 8be621658172b895894101c5db351c68faf6c088 | [
"MIT"
] | null | null | null | from django.urls import path
from .import views
urlpatterns = [
path('', views.home, name='home'),
path('add/', views.add_book, name='add_book'),
path('delete/<int:pk>/', views.delete_book, name='delete_book'),
]
| 25.111111 | 68 | 0.659292 |
779fe564df04be5e42886d60e7ca6255a9ce3a54 | 1,688 | py | Python | tests/general_tests.py | PabloEmidio/mldictionary | 6c8df93acccc5690ac328092ffe8abd7faa7389a | [
"MIT"
] | 7 | 2021-06-23T20:16:41.000Z | 2022-01-27T13:22:09.000Z | tests/general_tests.py | PabloEmidio/mldictionary | 6c8df93acccc5690ac328092ffe8abd7faa7389a | [
"MIT"
] | 2 | 2021-08-30T18:39:46.000Z | 2021-09-01T11:03:56.000Z | tests/general_tests.py | PabloEmidio/mldictionary | 6c8df93acccc5690ac328092ffe8abd7faa7389a | [
"MIT"
] | null | null | null | from typing import Union
from mldictionary import English, Portuguese, Spanish
class GeneralTests:
word: str
invalid_word: str = 'djsfhkhjshdgdkhskdd'
def setUp(self, language_class: Union[English, Portuguese, Spanish]):
self.dictionary = language_class()
def test_attribute_URL_type(self):
... | 35.914894 | 77 | 0.741706 |
a39466a5a327da80c02cc84057e2365dda4250be | 1,196 | py | Python | openstack/block_store/v2/type.py | teresa-ho/stx-openstacksdk | 7d723da3ffe9861e6e9abcaeadc1991689f782c5 | [
"Apache-2.0"
] | null | null | null | openstack/block_store/v2/type.py | teresa-ho/stx-openstacksdk | 7d723da3ffe9861e6e9abcaeadc1991689f782c5 | [
"Apache-2.0"
] | null | null | null | openstack/block_store/v2/type.py | teresa-ho/stx-openstacksdk | 7d723da3ffe9861e6e9abcaeadc1991689f782c5 | [
"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
# distributed under t... | 33.222222 | 75 | 0.728261 |
37b5ad7a297f8792a8b2a4dde3136a43c0a0ca4d | 16,830 | py | Python | tests/test_config.py | jsenecal/async-fastapi-jwt-auth | dd825f51a2e93192d4128c85b0d4a73df1a9c418 | [
"MIT"
] | 4 | 2022-02-04T08:06:32.000Z | 2022-03-25T23:22:07.000Z | tests/test_config.py | jsenecal/async-fastapi-jwt-auth | dd825f51a2e93192d4128c85b0d4a73df1a9c418 | [
"MIT"
] | null | null | null | tests/test_config.py | jsenecal/async-fastapi-jwt-auth | dd825f51a2e93192d4128c85b0d4a73df1a9c418 | [
"MIT"
] | 1 | 2022-02-16T16:26:27.000Z | 2022-02-16T16:26:27.000Z | import pytest
import os
import jwt
from async_fastapi_jwt_auth import AuthJWT
from fastapi import FastAPI, Depends
from fastapi.testclient import TestClient
from pydantic import BaseSettings, ValidationError
from typing import Sequence, Optional
from datetime import timedelta
@pytest.fixture(scope='function')
def cli... | 40.750605 | 89 | 0.711646 |
158fabb1f2a5ee33fbc664fc3ddeecd2d176bd65 | 7,710 | py | Python | docs/conf.py | rnonkl/FirstTry | 9a9ccfe0eae85a72ef1c2466c8a774bb2595554f | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | rnonkl/FirstTry | 9a9ccfe0eae85a72ef1c2466c8a774bb2595554f | [
"BSD-3-Clause"
] | null | null | null | docs/conf.py | rnonkl/FirstTry | 9a9ccfe0eae85a72ef1c2466c8a774bb2595554f | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Gizmokaka documentation build configuration file, created by
# sphinx-quickstart.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have... | 31.469388 | 80 | 0.705447 |
a57a972286b89e1b378431d33de71bfc0ca336c4 | 13,065 | py | Python | tests/tests.py | shantanu-gupta/gem5 | 94af1a6531c5a14da0d67c0c1f5abd8e22e6e514 | [
"BSD-3-Clause"
] | 30 | 2019-07-12T02:35:33.000Z | 2022-02-22T03:34:35.000Z | tests/tests.py | shantanu-gupta/gem5 | 94af1a6531c5a14da0d67c0c1f5abd8e22e6e514 | [
"BSD-3-Clause"
] | 2 | 2016-07-15T08:15:34.000Z | 2017-05-05T15:35:40.000Z | tests/tests.py | shantanu-gupta/gem5 | 94af1a6531c5a14da0d67c0c1f5abd8e22e6e514 | [
"BSD-3-Clause"
] | 12 | 2019-10-16T02:23:23.000Z | 2022-03-30T09:21:10.000Z | #!/usr/bin/env python2
#
# Copyright (c) 2016 ARM Limited
# All rights reserved
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementati... | 37.43553 | 78 | 0.65044 |
6313b8799468b767ecc87a78db23812848991d57 | 9,431 | py | Python | tinycards/networking/json_converter.py | Irishsmurf/tinycards-python-api | b5ef263cc498119ce04a735dbfb40ff46d332d8c | [
"MIT"
] | null | null | null | tinycards/networking/json_converter.py | Irishsmurf/tinycards-python-api | b5ef263cc498119ce04a735dbfb40ff46d332d8c | [
"MIT"
] | null | null | null | tinycards/networking/json_converter.py | Irishsmurf/tinycards-python-api | b5ef263cc498119ce04a735dbfb40ff46d332d8c | [
"MIT"
] | null | null | null | """Several helper functions to convert between data objects and JSON."""
from tinycards.model import Card, Concept, Deck, Fact, Favorite
from tinycards.model import SearchableData, Side, Trendable, TrendableData
from tinycards.model import User
# --- User conversion
def json_to_user(json_data):
"""Convert a JSON... | 29.844937 | 78 | 0.634715 |
df639ce2c3d60ef68b48503f9afbdd7e37e62626 | 320 | py | Python | python/example1.py | lu1and10/fmm2d | a7450e271a794760676d8d9ea692562ce329e2de | [
"Apache-2.0"
] | 14 | 2020-12-22T16:01:05.000Z | 2021-12-01T05:47:18.000Z | python/example1.py | lu1and10/fmm2d | a7450e271a794760676d8d9ea692562ce329e2de | [
"Apache-2.0"
] | 2 | 2021-12-15T16:25:06.000Z | 2022-01-21T21:03:32.000Z | python/example1.py | lu1and10/fmm2d | a7450e271a794760676d8d9ea692562ce329e2de | [
"Apache-2.0"
] | 7 | 2020-12-23T04:45:28.000Z | 2021-12-15T18:09:44.000Z | import fmm2d as fmm
import numpy as np
n = 2000
sources = np.random.uniform(0,1,(2,n))
m = 1000
targets = np.random.uniform(0,1,(2,m))
zk = 1.1+ 1j*0
charges = np.random.uniform(0,1,n) + 1j*np.random.uniform(0,1,n)
eps = 10**(-5)
pottarg,ier = fmm.hfmm2d_t_c_p(eps,zk,sources,charges,targets)
print(pottarg[1:3])
| 16.842105 | 64 | 0.675 |
5f322f31825c7a2874e790f3870ea845726fcd04 | 4,230 | py | Python | Steady_state_EMA.py | PollyJeffrey/Competition-modelling-paper | 6edeb28c7954c74669fa845a8b4d9b7dcd5017d0 | [
"MIT"
] | 1 | 2021-12-10T17:38:14.000Z | 2021-12-10T17:38:14.000Z | Steady_state_EMA.py | PollyJeffrey/Competition-modelling-paper | 6edeb28c7954c74669fa845a8b4d9b7dcd5017d0 | [
"MIT"
] | null | null | null | Steady_state_EMA.py | PollyJeffrey/Competition-modelling-paper | 6edeb28c7954c74669fa845a8b4d9b7dcd5017d0 | [
"MIT"
] | null | null | null | import numpy as np
#Define number of molecules and parameter values for the model
nl = 500
nr1 = 30
nr2 = 50
kr1 = pow(10,-3)
kr2 = pow(10,-3)
kd1 = 100
kd2 = 100
kf1 = kr1/kd1
kf2 = kr1/kd2
N1 = min(nr1,nl)
N2 = min(nr2,nl)
#Define the form of the block diagonal matrices used in the algorithm
de... | 30.652174 | 104 | 0.552719 |
7e406fb833eaef923216e06bf00709d6b9da4763 | 1,693 | py | Python | pgawedge/dml.py | portfoliome/pgawedge | eac03b53b21420525a9cef49c549d19d2a3c1cd6 | [
"MIT"
] | 6 | 2016-12-27T21:24:23.000Z | 2018-10-26T18:09:49.000Z | pgawedge/dml.py | portfoliome/pgawedge | eac03b53b21420525a9cef49c549d19d2a3c1cd6 | [
"MIT"
] | 9 | 2017-02-01T06:56:05.000Z | 2018-10-26T04:29:10.000Z | pgawedge/dml.py | portfoliome/pgawedge | eac03b53b21420525a9cef49c549d19d2a3c1cd6 | [
"MIT"
] | 1 | 2017-11-03T07:31:55.000Z | 2017-11-03T07:31:55.000Z | """Helpers for creating and modifying dml statements."""
from sqlalchemy import exists, literal_column, select, Table
from sqlalchemy.dialects.postgresql import insert
from pgawedge.postgres import PG_DIALECT
from pgawedge.sql import primary_key_join
from pgawedge.helpers import filter_server_default_columns
def d... | 28.694915 | 78 | 0.703485 |
f6c95a03e487649cc138a6ec2cbce8d943e2d591 | 1,019 | py | Python | ros/src/airsim_ros_pkgs/src/plot_step_response.py | ut-amrl/AirSim | ab8b6a4954664f9126daca2ad22759b8a0e44ebc | [
"MIT"
] | null | null | null | ros/src/airsim_ros_pkgs/src/plot_step_response.py | ut-amrl/AirSim | ab8b6a4954664f9126daca2ad22759b8a0e44ebc | [
"MIT"
] | null | null | null | ros/src/airsim_ros_pkgs/src/plot_step_response.py | ut-amrl/AirSim | ab8b6a4954664f9126daca2ad22759b8a0e44ebc | [
"MIT"
] | null | null | null | import rosbag
import argparse
import numpy as np
parser = argparse.ArgumentParser()
parser.add_argument('--bag_file', type=str)
opt = parser.parse_args()
ODOM_TOPIC = '/airsim_node/PhysXCar/odom_local_ned'
CMD_TOPIC = '/airsim_node/PhysXCar/cmd_vel'
bag = rosbag.Bag(opt.bag_file)
active_cmd = None
cmd_start_time = ... | 26.128205 | 106 | 0.718351 |
1ba559950cd100ed0393e570e51ea684254e1279 | 2,168 | py | Python | yeti/web/api/indicator.py | yeti-platform/TibetanBrownBear | 8ab520bd199a63e404b3a6a5b49a29f277384e8e | [
"Apache-2.0"
] | 9 | 2018-01-15T22:44:24.000Z | 2021-05-28T11:13:03.000Z | yeti/web/api/indicator.py | yeti-platform/TibetanBrownBear | 8ab520bd199a63e404b3a6a5b49a29f277384e8e | [
"Apache-2.0"
] | 140 | 2018-01-12T10:07:47.000Z | 2021-08-02T23:03:49.000Z | yeti/web/api/indicator.py | yeti-platform/TibetanBrownBear | 8ab520bd199a63e404b3a6a5b49a29f277384e8e | [
"Apache-2.0"
] | 11 | 2018-01-16T19:49:35.000Z | 2022-01-18T16:30:34.000Z | """API resources for interacting with Entities."""
from marshmallow import fields
from flask_classful import route
from flask import request
from yeti.core.indicators.indicator import Indicator
from yeti.core.errors import YetiSTIXError, ValidationError
from .generic import GenericResource
from ..helpers import as_jso... | 32.848485 | 78 | 0.633303 |
154ae08388dc80ff89736f13ed3ab7227b5f1243 | 3,283 | py | Python | GTSRB/MCDropout/FastSample/sample.py | matthewwicker/StatisticalGuarenteesForBNNs | 1f585636c152b8489e331641c743ff628c2b7cc7 | [
"BSD-3-Clause"
] | 13 | 2019-03-09T21:31:10.000Z | 2022-03-14T13:51:09.000Z | GTSRB/MCDropout/FastSample/sample.py | matthewwicker/StatisticalGuarenteesForBNNs | 1f585636c152b8489e331641c743ff628c2b7cc7 | [
"BSD-3-Clause"
] | null | null | null | GTSRB/MCDropout/FastSample/sample.py | matthewwicker/StatisticalGuarenteesForBNNs | 1f585636c152b8489e331641c743ff628c2b7cc7 | [
"BSD-3-Clause"
] | null | null | null | import keras
from keras.datasets import mnist
from keras.models import Sequential
from keras.layers import Dense, Dropout, Flatten
from keras.layers import Conv2D, MaxPooling2D
from keras import backend as K
from keras.models import model_from_json
import numpy as np
from tqdm import trange
from os import listdir
from ... | 43.197368 | 127 | 0.616205 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.