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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f766e4596509da0d3219da0e404d0b0ef34bf56a | 4,621 | py | Python | tests/unit/test_partition.py | ganik/DeepSpeed | 788e1c40e83beacfc4901e7daa1e097d2efb82bb | [
"MIT"
] | 1 | 2022-02-12T06:27:26.000Z | 2022-02-12T06:27:26.000Z | tests/unit/test_partition.py | ganik/DeepSpeed | 788e1c40e83beacfc4901e7daa1e097d2efb82bb | [
"MIT"
] | null | null | null | tests/unit/test_partition.py | ganik/DeepSpeed | 788e1c40e83beacfc4901e7daa1e097d2efb82bb | [
"MIT"
] | null | null | null | import pytest
import torch
import torch.distributed as dist
from deepspeed.runtime.utils import partition_uniform
from deepspeed.runtime.utils import partition_balanced
from deepspeed.runtime.utils import prefix_sum_inc
from deepspeed.runtime.utils import PartitionedTensor
from .common import distributed_test
@dis... | 24.193717 | 91 | 0.637524 |
e497c1941ade6a069527180fb574fcdb41fcc079 | 8,135 | py | Python | jc/parsers/ls.py | lyterk/jc | 681176e4c958157ef1f2151b3e57963a6ba48e09 | [
"MIT"
] | null | null | null | jc/parsers/ls.py | lyterk/jc | 681176e4c958157ef1f2151b3e57963a6ba48e09 | [
"MIT"
] | null | null | null | jc/parsers/ls.py | lyterk/jc | 681176e4c958157ef1f2151b3e57963a6ba48e09 | [
"MIT"
] | null | null | null | """jc - JSON CLI output utility `ls` and `vdir` command output parser
Options supported:
- `lbaR1`
- `--time-style=full-iso`
Note: The `-1`, `-l`, or `-b` option of `ls` should be used to correctly
parse filenames that include newline characters. Since `ls` does not encode
newlines in filenames when outputting to a p... | 28.54386 | 133 | 0.506085 |
644cdf1b590530f42cc03f56add383668ef1c186 | 12,007 | py | Python | YOLO/YOLOv3/Utils/utils.py | rahulchamoli916/RDD2020 | 86da9ada662fa0c055f44a6f88595e792c576eea | [
"MIT"
] | null | null | null | YOLO/YOLOv3/Utils/utils.py | rahulchamoli916/RDD2020 | 86da9ada662fa0c055f44a6f88595e792c576eea | [
"MIT"
] | null | null | null | YOLO/YOLOv3/Utils/utils.py | rahulchamoli916/RDD2020 | 86da9ada662fa0c055f44a6f88595e792c576eea | [
"MIT"
] | 1 | 2021-06-18T06:33:01.000Z | 2021-06-18T06:33:01.000Z | import colorsys
import cv2
import h5py
from keras import Model
import numpy as np
import os
from matplotlib.colors import rgb_to_hsv, hsv_to_rgb
from PIL import Image, ImageFont, ImageDraw
from timeit import default_timer as timer
# import readline
# readline.parse_and_bind("tab: complete")
min_logo_size... | 35.108187 | 93 | 0.605314 |
d6eeaaaabf5b3f72e80bcf5f87b100be8cd2f38a | 17,432 | py | Python | examples/language_model/bert/run_pretrain.py | chenyu-2020/PaddleNLP | 805c7894b735e73de5d15cc4bd06ab26d2149e9f | [
"Apache-2.0"
] | 6 | 2021-06-08T13:19:35.000Z | 2021-06-24T15:08:54.000Z | examples/language_model/bert/run_pretrain.py | xihuanafeng/PaddleNLP | 14c3209118b2cadcce9a8f66b760c9cddb3a02ad | [
"Apache-2.0"
] | null | null | null | examples/language_model/bert/run_pretrain.py | xihuanafeng/PaddleNLP | 14c3209118b2cadcce9a8f66b760c9cddb3a02ad | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle 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 appli... | 38.566372 | 125 | 0.60584 |
d7c6bb2753042bc511de1f269e69c01f3c04c3a8 | 3,934 | py | Python | research/PromptKGC/models/albert/__init__.py | zjunlp/PromptKG | 791bf82390eeadc30876d9f95e8dd26cd05de3dc | [
"MIT"
] | 11 | 2022-02-04T12:32:37.000Z | 2022-03-25T11:49:48.000Z | research/PromptKGC/models/albert/__init__.py | zjunlp/PromptKG | 791bf82390eeadc30876d9f95e8dd26cd05de3dc | [
"MIT"
] | null | null | null | research/PromptKGC/models/albert/__init__.py | zjunlp/PromptKG | 791bf82390eeadc30876d9f95e8dd26cd05de3dc | [
"MIT"
] | 4 | 2022-02-04T05:08:23.000Z | 2022-03-16T02:07:52.000Z | # flake8: noqa
# There's no way to ignore "F401 '...' imported but unused" warnings in this
# module, but to preserve other warnings. So, don't check this module at all.
# Copyright 2020 The HuggingFace Team. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use thi... | 31.98374 | 115 | 0.699288 |
4257ee0e79813b9e8a18b59195f5eec44f2343e8 | 2,363 | py | Python | sympy/stats/__init__.py | shipci/sympy | 4b59927bed992b980c9b3faac01becb36feef26b | [
"BSD-3-Clause"
] | 1 | 2015-01-14T22:55:45.000Z | 2015-01-14T22:55:45.000Z | sympy/stats/__init__.py | curzel-it/KiPyCalc | 909c783d5e6967ea58ca93f875106d8a8e3ca5db | [
"MIT"
] | null | null | null | sympy/stats/__init__.py | curzel-it/KiPyCalc | 909c783d5e6967ea58ca93f875106d8a8e3ca5db | [
"MIT"
] | null | null | null | """
SymPy statistics module
Introduces a random variable type into the SymPy language.
Random variables may be declared using prebuilt functions such as
Normal, Exponential, Coin, Die, etc... or built with functions like FiniteRV.
Queries on random expressions can be made using the functions
======================... | 33.28169 | 79 | 0.66441 |
755f9e6f94d2babd94d80b4e70efab8a0f2bbe8d | 761 | py | Python | mobetta/icu/migrations/0001_initial.py | maykinmedia/mobetta | 7c6ce4d9ccb41371e9a6171f35002730b841cc5c | [
"BSD-3-Clause"
] | 5 | 2017-10-26T18:40:48.000Z | 2019-04-09T21:06:33.000Z | mobetta/icu/migrations/0001_initial.py | maykinmedia/mobetta | 7c6ce4d9ccb41371e9a6171f35002730b841cc5c | [
"BSD-3-Clause"
] | 23 | 2017-02-10T16:23:35.000Z | 2019-05-02T11:54:28.000Z | mobetta/icu/migrations/0001_initial.py | maykinmedia/mobetta | 7c6ce4d9ccb41371e9a6171f35002730b841cc5c | [
"BSD-3-Clause"
] | 1 | 2017-03-10T15:05:24.000Z | 2017-03-10T15:05:24.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11 on 2017-04-11 09:02
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='ICUTrans... | 28.185185 | 114 | 0.595269 |
3f0440a332e725d1be2b9f4d8bf41ca99082b5e6 | 5,580 | py | Python | parse_doc.py | nprapps/idp-georgia | 316eba6195b7f410567a7e11eb4811ff7cba54cc | [
"Unlicense"
] | 1 | 2017-04-15T01:48:27.000Z | 2017-04-15T01:48:27.000Z | parse_doc.py | nprapps/idp-georgia | 316eba6195b7f410567a7e11eb4811ff7cba54cc | [
"Unlicense"
] | 153 | 2017-04-14T18:06:26.000Z | 2017-06-02T13:08:09.000Z | parse_doc.py | nprapps/idp-georgia | 316eba6195b7f410567a7e11eb4811ff7cba54cc | [
"Unlicense"
] | 1 | 2021-02-18T11:15:52.000Z | 2021-02-18T11:15:52.000Z | # _*_ coding:utf-8 _*_
import logging
import re
import app_config
from bs4 import BeautifulSoup
from shortcode import process_shortcode
logging.basicConfig(format=app_config.LOG_FORMAT)
logger = logging.getLogger(__name__)
logger.setLevel(app_config.LOG_LEVEL)
end_doc_regex = re.compile(ur'^\s*[Ee][Nn][Dd]\s*$',
... | 28.040201 | 78 | 0.58405 |
385072a57b53a2ec7c0f28ec1c5c4e2accc2985d | 386 | py | Python | work/wsgi.py | lestrato/badgepack | 7432c0ead1d5f63dd509620a0bb06bd76828b590 | [
"MS-PL"
] | 3 | 2016-10-21T01:35:46.000Z | 2020-11-07T01:20:05.000Z | work/wsgi.py | lestrato/badgepack | 7432c0ead1d5f63dd509620a0bb06bd76828b590 | [
"MS-PL"
] | 31 | 2016-10-31T19:28:53.000Z | 2017-01-19T16:55:49.000Z | work/wsgi.py | lestrato/badgepack | 7432c0ead1d5f63dd509620a0bb06bd76828b590 | [
"MS-PL"
] | 1 | 2020-11-07T01:20:07.000Z | 2020-11-07T01:20:07.000Z | """
WSGI config for work project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETTING... | 22.705882 | 78 | 0.782383 |
4bdf158d1c0c65daa9ba753b0ee4626b4ee7fbb0 | 403 | py | Python | add_windows/AddRule.py | rahulchaurasiya1/cautious-waddle | 8906aa99a30c0261622680f4b9668bb880fbdd93 | [
"MIT"
] | 2 | 2020-06-19T19:33:06.000Z | 2020-12-09T17:49:32.000Z | add_windows/AddRule.py | rahulchaurasiya1/cautious-waddle | 8906aa99a30c0261622680f4b9668bb880fbdd93 | [
"MIT"
] | null | null | null | add_windows/AddRule.py | rahulchaurasiya1/cautious-waddle | 8906aa99a30c0261622680f4b9668bb880fbdd93 | [
"MIT"
] | null | null | null | from Database import Database
from add_windows.AddMainWindow import AddMainWindow
class AddRule(AddMainWindow):
def __init__(self, parent=None):
super().__init__(parent, "UI/AddRule.ui")
def addToDatabase(self):
rule = str(self.rule.text())
fine = str(self.fine.text())
... | 28.785714 | 62 | 0.662531 |
12673ce925985e23b2de80d40142781f2f51bd5b | 144 | py | Python | torchglyph/pipe/__init__.py | speedcell4/torchglyph | 8abc8a35cc0b7a3512c069489c59e4cc1b2588df | [
"MIT"
] | 11 | 2020-03-12T05:58:18.000Z | 2021-12-22T11:46:43.000Z | torchglyph/pipe/__init__.py | speedcell4/torchglyph | 8abc8a35cc0b7a3512c069489c59e4cc1b2588df | [
"MIT"
] | 6 | 2020-08-18T18:56:33.000Z | 2021-11-06T04:22:23.000Z | torchglyph/pipe/__init__.py | speedcell4/torchglyph | 8abc8a35cc0b7a3512c069489c59e4cc1b2588df | [
"MIT"
] | null | null | null | from torchglyph.pipe.abc import *
from torchglyph.pipe.ctx import *
from torchglyph.pipe.packing import *
from torchglyph.pipe.padding import *
| 28.8 | 37 | 0.805556 |
a9e5d5f64bec1a1c1b128d2e69a3509570857e82 | 1,560 | py | Python | plastid_genes/match_clusters.py | maxemil/picozoa-scripts | 89a4e961e9a9bdc298a7d73cc3f03122c4df4229 | [
"MIT"
] | null | null | null | plastid_genes/match_clusters.py | maxemil/picozoa-scripts | 89a4e961e9a9bdc298a7d73cc3f03122c4df4229 | [
"MIT"
] | null | null | null | plastid_genes/match_clusters.py | maxemil/picozoa-scripts | 89a4e961e9a9bdc298a7d73cc3f03122c4df4229 | [
"MIT"
] | null | null | null | from Bio import SeqIO
import glob
import os
import shutil
rec2genome = {}
for rec in SeqIO.parse('Rhodelphis_plastid.faa', 'fasta'):
rec2genome[rec.id] = []
for line in open('Rlimneticus_vs_Rhodelphis_plastid.out'):
line = line.strip('\n').split('\t')
if float(line[2]) > 99:
rec2genome[line[... | 34.666667 | 157 | 0.673077 |
6c7490b792d76d5492b0c25fc41215ac0c6a768f | 5,980 | py | Python | modules/rats/jrat.py | nidsche/viper | d4e3b572fe772efc06e6879f7403b1c49e37f46f | [
"BSD-3-Clause"
] | 97 | 2017-12-18T15:19:28.000Z | 2022-03-25T07:10:00.000Z | modules/reversing/viper/rats/jrat.py | robertdigital/CIRTKit | 58b8793ada69320ffdbdd4ecdc04a3bb2fa83c37 | [
"MIT"
] | 1 | 2019-01-29T16:29:27.000Z | 2019-01-29T16:29:27.000Z | modules/reversing/viper/rats/jrat.py | robertdigital/CIRTKit | 58b8793ada69320ffdbdd4ecdc04a3bb2fa83c37 | [
"MIT"
] | 21 | 2018-04-04T18:12:13.000Z | 2021-06-12T09:40:58.000Z | # Originally written by Kevin Breen (@KevTheHermit):
# https://github.com/kevthehermit/RATDecoders/blob/master/ClientMesh.py
#Standard Imports Go Here
import os
import sys
from base64 import b64decode
import string
from zipfile import ZipFile
from cStringIO import StringIO
from Crypto.Cipher import AES, DES3
#Helper... | 33.038674 | 115 | 0.579599 |
ab0318eb07992d87053496a7262d0a0db7ecaf91 | 3,983 | py | Python | Tests/test_dis.py | amaeckelberghe/Pyjion | cdf8fbd3f3808d398a71fca085420f71c7dff106 | [
"MIT"
] | null | null | null | Tests/test_dis.py | amaeckelberghe/Pyjion | cdf8fbd3f3808d398a71fca085420f71c7dff106 | [
"MIT"
] | null | null | null | Tests/test_dis.py | amaeckelberghe/Pyjion | cdf8fbd3f3808d398a71fca085420f71c7dff106 | [
"MIT"
] | null | null | null | from pyjion.dis import print_il, dis
import pyjion
import unittest
import io
import contextlib
class DisassemblerModuleTestCase(unittest.TestCase):
def setUp(self) -> None:
pyjion.enable()
def tearDown(self) -> None:
pyjion.disable()
def test_fat(self):
def test_f():
... | 68.672414 | 1,866 | 0.611599 |
39547dee2a532c091ff4c9aa1c72df1aaa93faec | 1,893 | py | Python | CodeStomp/AmyCare/fit/migrations/0012_auto_20201124_1637.py | mayank712jindal/Code-Innovation-Series-ChitkaraUniversity | 43adf0b75a076d3d6821b20c103c8c079655b77e | [
"MIT"
] | null | null | null | CodeStomp/AmyCare/fit/migrations/0012_auto_20201124_1637.py | mayank712jindal/Code-Innovation-Series-ChitkaraUniversity | 43adf0b75a076d3d6821b20c103c8c079655b77e | [
"MIT"
] | null | null | null | CodeStomp/AmyCare/fit/migrations/0012_auto_20201124_1637.py | mayank712jindal/Code-Innovation-Series-ChitkaraUniversity | 43adf0b75a076d3d6821b20c103c8c079655b77e | [
"MIT"
] | null | null | null | # Generated by Django 3.1.3 on 2020-11-24 11:07
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('fit', '0011_auto_20201124_1629'),
]
operations = [
migrations.AlterField(
model_name='pharmacy',
name='phar_StoreIma... | 32.084746 | 85 | 0.564184 |
81d6133e341d5b84e5270fc356e06f82a8f037bb | 639 | py | Python | src/figcli/test/cli/data/login.py | figtools/figgy-cli | 88f4ccb8221ef9734f95b2637acfacc6e00983e7 | [
"Apache-2.0"
] | 36 | 2020-07-21T21:22:02.000Z | 2021-10-20T06:55:47.000Z | src/figcli/test/cli/data/login.py | figtools/figgy-cli | 88f4ccb8221ef9734f95b2637acfacc6e00983e7 | [
"Apache-2.0"
] | 2 | 2020-10-29T12:49:15.000Z | 2021-04-29T01:12:05.000Z | src/figcli/test/cli/data/login.py | figtools/figgy-cli | 88f4ccb8221ef9734f95b2637acfacc6e00983e7 | [
"Apache-2.0"
] | null | null | null | import pexpect
from figcli.test.cli.config import *
from figcli.test.cli.figgy import FiggyTest
from figcli.config import *
from figcli.utils.utils import *
import os
class DataLogin(FiggyTest):
def __init__(self, extra_args=""):
super().__init__(pexpect.spawn(f'{CLI_NAME} login sandbox', timeout=20, enc... | 29.045455 | 121 | 0.658842 |
1ca976884177fe67326e99d0d378a567a9d051a2 | 2,842 | py | Python | Pacman-ish_v1.0/vector.py | Naxaes/Pacman | 907ca82b981ff5d750d59c6f5cf8f748a38daded | [
"MIT"
] | null | null | null | Pacman-ish_v1.0/vector.py | Naxaes/Pacman | 907ca82b981ff5d750d59c6f5cf8f748a38daded | [
"MIT"
] | null | null | null | Pacman-ish_v1.0/vector.py | Naxaes/Pacman | 907ca82b981ff5d750d59c6f5cf8f748a38daded | [
"MIT"
] | null | null | null | import math
class Vector2D(tuple):
"""A 2 dimensional vector class"""
def __new__(cls, x, y):
return tuple.__new__(cls, (x, y))
def __init__(self, x, y):
super(Vector2D, self).__init__()
def __add__(self, other):
return Vector2D(self[0] + other[0], self[1] + other[1])
_... | 31.577778 | 106 | 0.561928 |
16458841f44885df8f6cc2fd9537bc420eaa32d2 | 6,069 | py | Python | python/paddle/fluid/tests/custom_op/test_custom_relu_op_jit.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 2 | 2021-11-12T11:31:12.000Z | 2021-12-05T10:30:28.000Z | python/paddle/fluid/tests/custom_op/test_custom_relu_op_jit.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/custom_op/test_custom_relu_op_jit.py | zmxdream/Paddle | 04f042a5d507ad98f7f2cfc3cbc44b06d7a7f45c | [
"Apache-2.0"
] | 1 | 2021-08-21T06:57:20.000Z | 2021-08-21T06:57:20.000Z | # Copyright (c) 2021 PaddlePaddle 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 appli... | 41.006757 | 96 | 0.593508 |
9063d7d1535e8aa8047be814aaf0db850185d48e | 729 | py | Python | chainer/functions/math/logarithm_1p.py | takeratta/chainer | 02686e98cd6dc8f20979a1f3a79130f076cbfc6c | [
"MIT"
] | 7 | 2017-05-08T07:02:40.000Z | 2018-12-02T18:35:39.000Z | chainer/functions/math/logarithm_1p.py | takeratta/chainer | 02686e98cd6dc8f20979a1f3a79130f076cbfc6c | [
"MIT"
] | null | null | null | chainer/functions/math/logarithm_1p.py | takeratta/chainer | 02686e98cd6dc8f20979a1f3a79130f076cbfc6c | [
"MIT"
] | 1 | 2021-05-27T16:52:11.000Z | 2021-05-27T16:52:11.000Z | import numpy
from chainer import cuda
from chainer import function
from chainer import utils
from chainer.utils import type_check
class Log1p(function.Function):
@property
def label(self):
return 'log1p'
def check_type_forward(self, in_types):
type_check.expect(in_types.size() == 1)
... | 22.78125 | 72 | 0.657064 |
c841d6d52bc03c9e2ed88b6d1f535867d24398d4 | 3,092 | py | Python | demo.py | krrish94/commExplore | 6f30129e6fb5bcdcd86e7faaf25183e44e018f51 | [
"MIT"
] | null | null | null | demo.py | krrish94/commExplore | 6f30129e6fb5bcdcd86e7faaf25183e44e018f51 | [
"MIT"
] | null | null | null | demo.py | krrish94/commExplore | 6f30129e6fb5bcdcd86e7faaf25183e44e018f51 | [
"MIT"
] | 1 | 2021-12-08T11:59:24.000Z | 2021-12-08T11:59:24.000Z | # The MIT License (MIT)
# Copyright (c) 2014 INSPIRE Lab, BITS Pilani
# 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, ... | 26.42735 | 95 | 0.721539 |
09e020a26251c57d6bd2b4dcf78cf282b9a5074f | 853 | py | Python | desktop/core/ext-py/cryptography-1.3.1/src/_cffi_src/build_commoncrypto.py | vinaymundada27/Hue | 7bffb33bbe7cfa34d340241c4ba3b19476211b2a | [
"Apache-2.0"
] | 2 | 2020-02-05T04:57:55.000Z | 2021-03-03T23:29:30.000Z | desktop/core/ext-py/cryptography-1.3.1/src/_cffi_src/build_commoncrypto.py | vinaymundada27/Hue | 7bffb33bbe7cfa34d340241c4ba3b19476211b2a | [
"Apache-2.0"
] | null | null | null | desktop/core/ext-py/cryptography-1.3.1/src/_cffi_src/build_commoncrypto.py | vinaymundada27/Hue | 7bffb33bbe7cfa34d340241c4ba3b19476211b2a | [
"Apache-2.0"
] | 2 | 2019-06-17T11:51:56.000Z | 2020-07-25T08:29:56.000Z | # This file is dual licensed under the terms of the Apache License, Version
# 2.0, and the BSD License. See the LICENSE file in the root of this repository
# for complete details.
from __future__ import absolute_import, division, print_function
from _cffi_src.utils import build_ffi_for_binding
ffi = build_ffi_for_b... | 25.848485 | 79 | 0.640094 |
46385d7dd6c50bf5f36dc3bcd08d23a0e5f69b5e | 348 | py | Python | lcdblib/__init__.py | acgtcoder/lcdblib | a3e5c81b841f0a06e63641f1cbcc24fc207f40f0 | [
"MIT"
] | 1 | 2018-08-27T11:42:33.000Z | 2018-08-27T11:42:33.000Z | lcdblib/__init__.py | acgtcoder/lcdblib | a3e5c81b841f0a06e63641f1cbcc24fc207f40f0 | [
"MIT"
] | 15 | 2016-11-23T18:50:33.000Z | 2018-04-10T20:07:16.000Z | lcdblib/__init__.py | acgtcoder/lcdblib | a3e5c81b841f0a06e63641f1cbcc24fc207f40f0 | [
"MIT"
] | 1 | 2019-04-08T19:01:17.000Z | 2019-04-08T19:01:17.000Z | from ._version import get_versions
__version__ = get_versions()['version']
del get_versions
# The following assumes versioneer was configured with the "pep440-pre" style
# in setup.cfg
toks = __version__.split('.dev')
if len(toks) == 2:
__conda_version__, __conda_build__ = toks
else:
__conda_build__ = '0'
... | 26.769231 | 77 | 0.744253 |
7504108485f7853a2bf93bc27ae9b89ef9b54c8d | 1,057 | py | Python | zospy/functions/nce.py | MREYE-LUMC/ZOSPy | 0c9d3c0ecd63b8c6999ee7a5ee6f742adc43e465 | [
"CC0-1.0"
] | 1 | 2022-02-11T11:52:04.000Z | 2022-02-11T11:52:04.000Z | zospy/functions/nce.py | MREYE-LUMC/ZOSPy | 0c9d3c0ecd63b8c6999ee7a5ee6f742adc43e465 | [
"CC0-1.0"
] | null | null | null | zospy/functions/nce.py | MREYE-LUMC/ZOSPy | 0c9d3c0ecd63b8c6999ee7a5ee6f742adc43e465 | [
"CC0-1.0"
] | 1 | 2022-03-13T14:36:58.000Z | 2022-03-13T14:36:58.000Z | from zospy.api import constants
from zospy.utils.zputils import proc_constant
def object_change_type(obj, newtype):
"""Simple function to change the type of an object in the NCE
Parameters
----------
obj: INCERow
The Row/Object for which the change is to be made.
newtype: str or int
... | 28.567568 | 120 | 0.667928 |
bd2947bd3daf6ba253a4438ab06b8acb14a66119 | 13,009 | py | Python | src/dependency_tracking.py | hw-sw-contracts/revizor | 6aa7694d55d62c554917fc539b1775949508ed4b | [
"MIT"
] | 29 | 2021-05-24T12:45:19.000Z | 2022-03-16T16:53:10.000Z | src/dependency_tracking.py | hw-sw-contracts/revizor | 6aa7694d55d62c554917fc539b1775949508ed4b | [
"MIT"
] | 3 | 2021-11-23T15:37:25.000Z | 2022-01-24T12:01:44.000Z | src/dependency_tracking.py | hw-sw-contracts/revizor | 6aa7694d55d62c554917fc539b1775949508ed4b | [
"MIT"
] | 3 | 2021-06-17T09:00:27.000Z | 2022-03-28T03:42:01.000Z | from iced_x86 import *
from typing import Dict, Sequence
from types import ModuleType
import copy
def create_enum_dict(module: ModuleType) -> Dict[int, str]:
return {
module.__dict__[key]: key
for key in module.__dict__
if isinstance(module.__dict__[key], int)
}
REGISTER_TO_STRING: D... | 36.036011 | 97 | 0.580906 |
9e6361b14c7c2e1b38c152891bc19775f6db2631 | 7,719 | py | Python | DeepLearning/PyTorch/book_repo/p2ch13/model.py | dSalazar10/Course-Exploring_Deep_Learning | e79cbc7c4802c9b2d62d7fc419eb77b4d2fed355 | [
"MIT"
] | null | null | null | DeepLearning/PyTorch/book_repo/p2ch13/model.py | dSalazar10/Course-Exploring_Deep_Learning | e79cbc7c4802c9b2d62d7fc419eb77b4d2fed355 | [
"MIT"
] | null | null | null | DeepLearning/PyTorch/book_repo/p2ch13/model.py | dSalazar10/Course-Exploring_Deep_Learning | e79cbc7c4802c9b2d62d7fc419eb77b4d2fed355 | [
"MIT"
] | null | null | null | import math
import random
from collections import namedtuple
import torch
from torch import nn as nn
import torch.nn.functional as F
from util.logconf import logging
from util.unet import UNet
log = logging.getLogger(__name__)
# log.setLevel(logging.WARN)
# log.setLevel(logging.INFO)
log.setLevel(logging.DEBUG)
cla... | 32.987179 | 155 | 0.563026 |
d8fd4a97c25487cc14c941ca84499676a12093f9 | 11,809 | py | Python | objetto/_changes.py | brunonicko/objetto | 50540bc14c5767e3f8fa09bf59ba322cb043a353 | [
"MIT"
] | 8 | 2020-12-10T21:04:06.000Z | 2022-01-22T07:43:07.000Z | objetto/_changes.py | brunonicko/objetto | 50540bc14c5767e3f8fa09bf59ba322cb043a353 | [
"MIT"
] | null | null | null | objetto/_changes.py | brunonicko/objetto | 50540bc14c5767e3f8fa09bf59ba322cb043a353 | [
"MIT"
] | 1 | 2022-01-20T21:39:48.000Z | 2022-01-20T21:39:48.000Z | # -*- coding: utf-8 -*-
"""Object changes."""
from typing import TYPE_CHECKING
from ._bases import final
from ._constants import INTEGER_TYPES, STRING_TYPES
from ._states import BaseState
from .data import (
Data,
data_attribute,
data_constant_attribute,
data_protected_dict_attribute,
data_protect... | 20.82716 | 84 | 0.621983 |
888d0f6b6960d945a32761a12a5cf8772c533f9b | 511 | py | Python | deploys/setup-infra/install_dashboard.py | kimcu-on-thenet/coolstore-microservices | d2524bf56fc0219496fd1e499a663f3e63b42818 | [
"MIT"
] | 1 | 2019-08-03T17:42:39.000Z | 2019-08-03T17:42:39.000Z | deploys/setup-infra/install_dashboard.py | kimcu-on-thenet/coolstore-microservices | d2524bf56fc0219496fd1e499a663f3e63b42818 | [
"MIT"
] | null | null | null | deploys/setup-infra/install_dashboard.py | kimcu-on-thenet/coolstore-microservices | d2524bf56fc0219496fd1e499a663f3e63b42818 | [
"MIT"
] | null | null | null | import os, subprocess
import json
with open("configs/config.json") as config_file:
config_data = json.load(config_file)
def run():
subprocess.call(['kubectl', 'config', 'use-context', config_data["aks"]["name"]])
subprocess.call(['kubectl', 'create',
'clusterrolebinding',
'kubernetes... | 30.058824 | 85 | 0.624266 |
2e1a5b478fae8c0e6082ea56f4aadaa0f47ad061 | 6,987 | py | Python | tests/differentiation/test_generate_steps.py | PaulBehler/estimagic | c14f743986262d508e55738c90737cb504fe987b | [
"MIT"
] | 83 | 2019-09-26T04:44:03.000Z | 2022-03-17T20:24:02.000Z | tests/differentiation/test_generate_steps.py | PaulBehler/estimagic | c14f743986262d508e55738c90737cb504fe987b | [
"MIT"
] | 243 | 2019-06-25T18:15:53.000Z | 2022-03-26T09:17:44.000Z | tests/differentiation/test_generate_steps.py | PaulBehler/estimagic | c14f743986262d508e55738c90737cb504fe987b | [
"MIT"
] | 23 | 2019-07-03T11:16:55.000Z | 2022-03-07T00:57:38.000Z | import numpy as np
import pytest
from estimagic.differentiation.generate_steps import _calculate_or_validate_base_steps
from estimagic.differentiation.generate_steps import _fillna
from estimagic.differentiation.generate_steps import _rescale_to_accomodate_bounds
from estimagic.differentiation.generate_steps import _se... | 32.649533 | 86 | 0.661514 |
3f4e85a80935ec021f5d4e6ee704cb915848facd | 11,194 | py | Python | asterisk/ami/client.py | nchizhov/python-ami | d1953f4129452cbc015d7cb3d1e2f360dcaee45c | [
"BSD-3-Clause"
] | null | null | null | asterisk/ami/client.py | nchizhov/python-ami | d1953f4129452cbc015d7cb3d1e2f360dcaee45c | [
"BSD-3-Clause"
] | null | null | null | asterisk/ami/client.py | nchizhov/python-ami | d1953f4129452cbc015d7cb3d1e2f360dcaee45c | [
"BSD-3-Clause"
] | null | null | null | import re
import socket
import errno
import threading
from functools import partial
from .action import Action, LoginAction, LogoffAction, SimpleAction
from .event import Event, EventListener
from .response import Response, FutureResponse
from .utils import str, unicode
NOOP = lambda *args, **kwargs: None
NOOP_LISTE... | 33.414925 | 111 | 0.614168 |
094ed60c477af4df05ae8996c0dcc09df1ea5251 | 2,475 | py | Python | tests/gold_tests/runroot/runroot_init.test.py | dio/trafficserver | 20e83321f5120c71c7ec220ec54567b160bca43a | [
"Apache-2.0"
] | null | null | null | tests/gold_tests/runroot/runroot_init.test.py | dio/trafficserver | 20e83321f5120c71c7ec220ec54567b160bca43a | [
"Apache-2.0"
] | 2 | 2017-03-14T02:29:31.000Z | 2017-09-22T22:11:35.000Z | tests/gold_tests/runroot/runroot_init.test.py | persiaAziz/trafficserver | 0b323a6aac08469d6a6fbfcf93e4d7c2b2602682 | [
"Apache-2.0"
] | 1 | 2021-02-15T08:09:17.000Z | 2021-02-15T08:09:17.000Z | '''
'''
# 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");... | 38.671875 | 130 | 0.737374 |
894135269d5a69613108ec5ceb32cd4bb48b18d9 | 2,150 | py | Python | screenpy_requests/abilities/make_api_requests.py | ScreenPyHQ/screenpy_requests | 8f34b52b149ff2000992d1207765ff7855e219cd | [
"MIT"
] | 39 | 2019-03-22T15:18:23.000Z | 2022-02-23T17:32:03.000Z | screenpy_requests/abilities/make_api_requests.py | ScreenPyHQ/screenpy_requests | 8f34b52b149ff2000992d1207765ff7855e219cd | [
"MIT"
] | 63 | 2019-07-17T06:25:19.000Z | 2022-01-13T07:03:53.000Z | screenpy_requests/abilities/make_api_requests.py | ScreenPyHQ/screenpy_requests | 8f34b52b149ff2000992d1207765ff7855e219cd | [
"MIT"
] | 15 | 2019-07-09T11:02:56.000Z | 2021-12-24T07:43:56.000Z | """
Enable the Actor to make API requests and store the responses.
"""
from typing import Any, Callable, Dict, List, Optional
from requests import Response, Session
from ..exceptions import RequestError
class MakeAPIRequests:
"""Use Requests to enable sending API requests.
Examples::
Perry = AnAc... | 29.861111 | 78 | 0.610698 |
5adedc94e6dc1e1ed95a312b644cc258e6bf9ec7 | 10,628 | py | Python | evennia/utils/picklefield.py | dineshsonachalam/evennia | 24c5ddecabb84d8a7f62fb65a11c8bbcc879c49e | [
"BSD-3-Clause"
] | 9 | 2017-07-10T04:27:31.000Z | 2020-07-31T08:54:08.000Z | evennia/utils/picklefield.py | dineshsonachalam/evennia | 24c5ddecabb84d8a7f62fb65a11c8bbcc879c49e | [
"BSD-3-Clause"
] | null | null | null | evennia/utils/picklefield.py | dineshsonachalam/evennia | 24c5ddecabb84d8a7f62fb65a11c8bbcc879c49e | [
"BSD-3-Clause"
] | 4 | 2017-09-11T02:26:21.000Z | 2021-12-31T05:20:34.000Z | #
# Copyright (c) 2009-2010 Gintautas Miliauskas
#
# 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, mo... | 38.507246 | 90 | 0.682819 |
e8855b4422c6b0a55ad51b7200dc726b8910ad3e | 5,073 | py | Python | Minesweeper.py | MonotonicCode/Minesweeper | d5a849d5ec0bc12dc2da421997d3ff2971a82e7d | [
"MIT"
] | null | null | null | Minesweeper.py | MonotonicCode/Minesweeper | d5a849d5ec0bc12dc2da421997d3ff2971a82e7d | [
"MIT"
] | null | null | null | Minesweeper.py | MonotonicCode/Minesweeper | d5a849d5ec0bc12dc2da421997d3ff2971a82e7d | [
"MIT"
] | null | null | null | import random
import pygame
pygame.init()
screenSize = 400 # Size of the Window
cellSize = 20 # Size of individual Cell
mines = 50 # Number of Mines in the Game
grid = [] # A 2D Array to Store all the Cells
over = False # Is the Game Over
firstclick = True ... | 35.725352 | 133 | 0.48216 |
5d0e15940df0848bb3ee7e5495d34a47b69ca378 | 6,816 | py | Python | GadgetBox.py | CrazyRobMiles/FreeCADSimulator | b9654c1442525d6ea21045e691062bf3e121b15e | [
"Apache-2.0"
] | 63 | 2020-11-15T10:17:19.000Z | 2021-09-17T16:36:25.000Z | GadgetBox.py | CrazyRobMiles/FreeCADSimulator | b9654c1442525d6ea21045e691062bf3e121b15e | [
"Apache-2.0"
] | null | null | null | GadgetBox.py | CrazyRobMiles/FreeCADSimulator | b9654c1442525d6ea21045e691062bf3e121b15e | [
"Apache-2.0"
] | 3 | 2020-11-16T09:37:06.000Z | 2021-05-15T05:58:59.000Z | from tkinter import *
class TKDisplay(object):
def __init__(self, width, height):
self.message = ""
self.drawObjects = []
self.root = Tk()
self.root.title("FakeFreeCAD - Rob Miles")
self.xOffset = 20
self.yOffset = 20
self.width = width
self.he... | 28.049383 | 195 | 0.612676 |
4bb3ad6d17652d916bbaa0d6463dbf5a40796067 | 1,748 | py | Python | digi/utils.py | HotStew/digihel | 3a53f6542b41c64c818fa34cc0709cdbfb8055db | [
"MIT"
] | 21 | 2016-08-22T10:15:24.000Z | 2022-03-23T08:10:48.000Z | digi/utils.py | HotStew/digihel | 3a53f6542b41c64c818fa34cc0709cdbfb8055db | [
"MIT"
] | 101 | 2016-08-08T07:52:44.000Z | 2021-06-17T20:18:59.000Z | digi/utils.py | HotStew/digihel | 3a53f6542b41c64c818fa34cc0709cdbfb8055db | [
"MIT"
] | 16 | 2016-08-02T11:45:26.000Z | 2021-02-18T11:27:34.000Z | import logging
import time
from django.conf import settings
from django.core.cache import cache
log = logging.getLogger(__name__)
def get_cached_with_mtime(cache_key, getter, max_mtime=60, default=None, expiry=86400):
"""
Get something with a maximum modification time.
I.e. if the data stored in the ca... | 34.96 | 97 | 0.639588 |
2fda57353abac7baba062d0a6eda19604ccbf9e7 | 11,961 | py | Python | calliope/cli.py | guidogz/Calliope_guido | 148ee39c3671e55ad3a1a2da216ee23112d16abf | [
"Apache-2.0"
] | null | null | null | calliope/cli.py | guidogz/Calliope_guido | 148ee39c3671e55ad3a1a2da216ee23112d16abf | [
"Apache-2.0"
] | null | null | null | calliope/cli.py | guidogz/Calliope_guido | 148ee39c3671e55ad3a1a2da216ee23112d16abf | [
"Apache-2.0"
] | null | null | null | """
Copyright (C) 2013-2019 Calliope contributors listed in AUTHORS.
Licensed under the Apache 2.0 License (see LICENSE file).
cli.py
~~~~~~
Command-line interface.
"""
import contextlib
import datetime
import itertools
import logging
import os
import pstats
import shutil
import sys
import traceback
import click
... | 31.311518 | 99 | 0.627707 |
3d047414c272df91991c962e24b252721561a852 | 2,780 | py | Python | tests/system/action/personal_note/test_delete.py | OpenSlides/openslides-backend | 57f58a4ca0e5ca113ff104efa9db3e2c66e3aeab | [
"MIT"
] | 5 | 2020-01-20T13:57:15.000Z | 2021-03-27T14:14:44.000Z | tests/system/action/personal_note/test_delete.py | OpenSlides/openslides-backend | 57f58a4ca0e5ca113ff104efa9db3e2c66e3aeab | [
"MIT"
] | 859 | 2020-01-11T22:58:37.000Z | 2022-03-30T14:54:06.000Z | tests/system/action/personal_note/test_delete.py | OpenSlides/openslides-backend | 57f58a4ca0e5ca113ff104efa9db3e2c66e3aeab | [
"MIT"
] | 16 | 2020-01-04T20:28:57.000Z | 2022-02-10T12:06:54.000Z | from typing import Any, Dict
from tests.system.action.base import BaseActionTestCase
class PersonalNoteDeleteActionTest(BaseActionTestCase):
def setUp(self) -> None:
super().setUp()
self.test_models: Dict[str, Dict[str, Any]] = {
"meeting/111": {"personal_note_ids": [1]},
... | 35.641026 | 78 | 0.53705 |
0d1c945b85f15cf1300ebfe5a825c04962f78977 | 1,749 | py | Python | single_table.py | baluyotraf/mysql-sample-generator | 348734c5b711280af72aef5207ced0834df2cee1 | [
"MIT"
] | null | null | null | single_table.py | baluyotraf/mysql-sample-generator | 348734c5b711280af72aef5207ced0834df2cee1 | [
"MIT"
] | null | null | null | single_table.py | baluyotraf/mysql-sample-generator | 348734c5b711280af72aef5207ced0834df2cee1 | [
"MIT"
] | null | null | null | from mysql import *
from generators import *
import os
import random
import string
DIR_NAME = os.path.dirname(os.path.abspath(__file__))
TABLE_NAME = 'employees'
TABLE_COLUMNS = [
Column('id', Column.INT, Column.AUTO_INCREMENT, Column.PRIMARY_KEY),
Column('first_name', Column.STRING(), Column.NOT_NULL),
C... | 26.907692 | 83 | 0.652945 |
65b49db63e83751c3ae4c66f7dccc6f97720d063 | 2,459 | py | Python | research/cv/dcgan/preprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 77 | 2021-10-15T08:32:37.000Z | 2022-03-30T13:09:11.000Z | research/cv/dcgan/preprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 3 | 2021-10-30T14:44:57.000Z | 2022-02-14T06:57:57.000Z | research/cv/dcgan/preprocess.py | leelige/mindspore | 5199e05ba3888963473f2b07da3f7bca5b9ef6dc | [
"Apache-2.0"
] | 24 | 2021-10-15T08:32:45.000Z | 2022-03-24T18:45:20.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 48.215686 | 97 | 0.701911 |
f8c8bb3d306b3bf61fdd76c5c33e08c1f2e2e565 | 4,904 | py | Python | decap/train/keras_ctc_cm.py | jkmiao/captcha | 902dfd960a43ad5036544c8b299b3472f01004ec | [
"MIT"
] | 2 | 2018-11-01T06:19:00.000Z | 2021-04-02T10:11:29.000Z | decap/train/keras_ctc_cm.py | jkmiao/captcha | 902dfd960a43ad5036544c8b299b3472f01004ec | [
"MIT"
] | null | null | null | decap/train/keras_ctc_cm.py | jkmiao/captcha | 902dfd960a43ad5036544c8b299b3472f01004ec | [
"MIT"
] | 3 | 2017-10-23T04:50:23.000Z | 2018-09-22T15:10:52.000Z | #!/usr/bin/env python
# coding: utf-8
from keras.models import Model, Input, load_model
from keras.layers import *
from keras import backend as K
import numpy as np
from PIL import Image
import random
import os
# 基本参数配置
charsets = '0123456789abcs'
rnn_size = 128
height, width, max_len, n_class = 30, 200, 5, len(cha... | 34.055556 | 109 | 0.64947 |
f7678123ea5340826c6562c5fba3502068a8ddd4 | 3,676 | py | Python | tests/test_dataset/test_ocr_seg_dataset.py | hongxuenong/mmocr | e8e3a059f8f2e4fca96af37751c33563fc48e2ba | [
"Apache-2.0"
] | 2,261 | 2021-04-08T03:45:41.000Z | 2022-03-31T23:37:46.000Z | tests/test_dataset/test_ocr_seg_dataset.py | hongxuenong/mmocr | e8e3a059f8f2e4fca96af37751c33563fc48e2ba | [
"Apache-2.0"
] | 789 | 2021-04-08T05:40:13.000Z | 2022-03-31T09:42:39.000Z | tests/test_dataset/test_ocr_seg_dataset.py | hongxuenong/mmocr | e8e3a059f8f2e4fca96af37751c33563fc48e2ba | [
"Apache-2.0"
] | 432 | 2021-04-08T03:56:16.000Z | 2022-03-30T18:44:43.000Z | # Copyright (c) OpenMMLab. All rights reserved.
import json
import math
import os.path as osp
import tempfile
import pytest
from mmocr.datasets.ocr_seg_dataset import OCRSegDataset
def _create_dummy_ann_file(ann_file):
ann_info1 = {
'file_name':
'sample1.png',
'annotations': [{
... | 28.496124 | 78 | 0.547062 |
2ee539c5d6aaf99437f45cc30824a45a37a8e689 | 993 | py | Python | edi_835_parser/segments/outpatient_adjudication.py | shalini1017/edi-835-parser | 5c7c9549621a71cea893b37998e4bdea94822c5c | [
"MIT"
] | null | null | null | edi_835_parser/segments/outpatient_adjudication.py | shalini1017/edi-835-parser | 5c7c9549621a71cea893b37998e4bdea94822c5c | [
"MIT"
] | null | null | null | edi_835_parser/segments/outpatient_adjudication.py | shalini1017/edi-835-parser | 5c7c9549621a71cea893b37998e4bdea94822c5c | [
"MIT"
] | null | null | null | from edi_835_parser.elements.identifier import Identifier
from edi_835_parser.segments.utilities import split_segment, get_element
class OutpatientAdjudication:
identification = 'MOA'
identifier = Identifier()
def __init__(self, segment: str):
self.index = segment.split(':', 1)[0]
segment = segment.split(':'... | 29.205882 | 74 | 0.758308 |
339bbd51d145912f21a5856d770f573e2081d6fe | 4,007 | py | Python | src/azure-cli-core/tests/test_arm.py | henrypan/azure-cli | 8de0ab5216ed3dc700546ae9a3c485710322376b | [
"MIT"
] | null | null | null | src/azure-cli-core/tests/test_arm.py | henrypan/azure-cli | 8de0ab5216ed3dc700546ae9a3c485710322376b | [
"MIT"
] | 2 | 2021-03-25T21:38:56.000Z | 2021-11-15T17:46:45.000Z | src/azure-cli-core/tests/test_arm.py | Visual-Studio-China/azure-cli-int | 48c7c7f371a0ecc4ebfd4dcfdc72764beddf5c31 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 40.474747 | 94 | 0.465935 |
f8b44bad857597cb7ad7087ffa81f85df7f473a7 | 1,350 | py | Python | examples/shouldi/tests/test_cli_use.py | Yash-Varshney/dffml | 70a76e45c3120b1a984fdfaa5638c594ef386da7 | [
"MIT"
] | 2 | 2020-02-21T00:03:54.000Z | 2020-04-08T17:38:47.000Z | examples/shouldi/tests/test_cli_use.py | Yash-Varshney/dffml | 70a76e45c3120b1a984fdfaa5638c594ef386da7 | [
"MIT"
] | null | null | null | examples/shouldi/tests/test_cli_use.py | Yash-Varshney/dffml | 70a76e45c3120b1a984fdfaa5638c594ef386da7 | [
"MIT"
] | null | null | null | import io
import pathlib
from unittest.mock import patch
from dffml import prepend_to_path, AsyncTestCase
from shouldi.cli import ShouldI
from .binaries import cached_node, cached_target_javascript_algorithms
class TestCLIUse(AsyncTestCase):
async def test_use_python(self):
# Issue is B322, use of inpu... | 36.486486 | 90 | 0.626667 |
7e0826648cd7686cdb179d4a70e767367001cd8e | 3,474 | py | Python | great_expectations/data_context/store/store.py | joshuataylor/great_expectations | 19dcead43aef9a833b3aa894a1226714a80ab840 | [
"Apache-2.0"
] | 1 | 2021-05-04T17:26:22.000Z | 2021-05-04T17:26:22.000Z | great_expectations/data_context/store/store.py | joshuataylor/great_expectations | 19dcead43aef9a833b3aa894a1226714a80ab840 | [
"Apache-2.0"
] | 47 | 2020-07-15T06:32:50.000Z | 2022-03-29T12:03:23.000Z | great_expectations/data_context/store/store.py | joshuataylor/great_expectations | 19dcead43aef9a833b3aa894a1226714a80ab840 | [
"Apache-2.0"
] | null | null | null | import logging
from great_expectations.core.data_context_key import DataContextKey
from great_expectations.data_context.store.store_backend import StoreBackend
from great_expectations.data_context.util import instantiate_class_from_config
from great_expectations.exceptions import ClassInstantiationError, DataContextEr... | 36.1875 | 89 | 0.688256 |
a099e17fd221ca779326356ff8d0fef405c1981c | 7,122 | py | Python | fastclass/fc_download.py | mpoisot/fastclass | 1aedf1d862a4d96e7c9a175a7abc680028602e7f | [
"Apache-2.0"
] | null | null | null | fastclass/fc_download.py | mpoisot/fastclass | 1aedf1d862a4d96e7c9a175a7abc680028602e7f | [
"Apache-2.0"
] | null | null | null | fastclass/fc_download.py | mpoisot/fastclass | 1aedf1d862a4d96e7c9a175a7abc680028602e7f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#
# fastclass - fc_download.py
#
# Christian Werner, 2018-10-23
#
# TODO:
# - print report (images per class etc)
# - check if we need grace periods to avoid blocking
import click
import glob
from icrawler import ImageDownloader
from icrawler.builtin import (
GoogleImageCrawler,
BingIma... | 28.95122 | 201 | 0.600674 |
fb24e9bf671324730a051f50fd0670b5dd473435 | 5,858 | py | Python | code/train.py | alaakh42/Taxi-driver-Arrival-Time-prediction | 19e45c745d032fd76eea794b12337422053310c8 | [
"MIT"
] | 1 | 2018-09-17T19:42:41.000Z | 2018-09-17T19:42:41.000Z | code/train.py | alaakh42/Taxi-driver-Arrival-Time-prediction | 19e45c745d032fd76eea794b12337422053310c8 | [
"MIT"
] | null | null | null | code/train.py | alaakh42/Taxi-driver-Arrival-Time-prediction | 19e45c745d032fd76eea794b12337422053310c8 | [
"MIT"
] | null | null | null | """
Original Data fields
id - a unique identifier for each trip
vendor_id - a code indicating the provider associated with the trip record
pickup_datetime - date and time when the meter was engaged
dropoff_datetime - date and time when the meter was disengaged
passenger_count - the number of passengers in the vehicle ... | 48.413223 | 234 | 0.738819 |
3050574f11ea5ef3c6dcf6ab70d20d6aba0b32e6 | 24,463 | py | Python | imagecodecs/_imagecodecs.py | sparkingdark/imagecodecs | 4ea4e82abbcdee650ddb3327df6a449e4898193f | [
"BSD-3-Clause"
] | null | null | null | imagecodecs/_imagecodecs.py | sparkingdark/imagecodecs | 4ea4e82abbcdee650ddb3327df6a449e4898193f | [
"BSD-3-Clause"
] | null | null | null | imagecodecs/_imagecodecs.py | sparkingdark/imagecodecs | 4ea4e82abbcdee650ddb3327df6a449e4898193f | [
"BSD-3-Clause"
] | 2 | 2021-05-26T04:10:19.000Z | 2022-01-27T12:48:18.000Z | # _imagecodecs.py
# Copyright (c) 2008-2020, Christoph Gohlke
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# th... | 28.881936 | 79 | 0.622859 |
02f5cb070439d68925f7a47908e1770d1a8b3816 | 79 | py | Python | examples/pluggable/subcomponents/site/__init__.py | pauleveritt/viewdom_wired | 40d8f2f190a12bbd07ff957654626001a9f3a778 | [
"MIT"
] | null | null | null | examples/pluggable/subcomponents/site/__init__.py | pauleveritt/viewdom_wired | 40d8f2f190a12bbd07ff957654626001a9f3a778 | [
"MIT"
] | null | null | null | examples/pluggable/subcomponents/site/__init__.py | pauleveritt/viewdom_wired | 40d8f2f190a12bbd07ff957654626001a9f3a778 | [
"MIT"
] | null | null | null | from ..plugins import greeting, punctuation
plugins = (greeting, punctuation)
| 19.75 | 43 | 0.78481 |
5088b540af306f1c663dcaddb613937c553961da | 92,869 | py | Python | Lib/test/test_itertools.py | Taywee/isolated-python | cb6aab1248c4aec4dd578bea717854505a6fb55d | [
"PSF-2.0"
] | 4 | 2016-04-02T00:01:50.000Z | 2017-07-13T02:11:04.000Z | Lib/test/test_itertools.py | vic/pysano | bcfd0522711efaaacf68821b831674b0ff48b6a1 | [
"PSF-2.0"
] | null | null | null | Lib/test/test_itertools.py | vic/pysano | bcfd0522711efaaacf68821b831674b0ff48b6a1 | [
"PSF-2.0"
] | null | null | null | import unittest
from test import support
from itertools import *
import weakref
from decimal import Decimal
from fractions import Fraction
import sys
import operator
import random
import copy
import pickle
from functools import reduce
import sys
import struct
maxsize = support.MAX_Py_ssize_t
minsize = -maxsize-1
def l... | 40.803603 | 124 | 0.545769 |
ecfa518e599a266ce843bd03ca710315d6bc0d24 | 1,805 | py | Python | example-project/find_duplicate_items.py | alexdevmotion/scrapy-elastic-web-crawling | ad09698bf597ed67a56a0c9e6b0dfad0f7798653 | [
"BSD-3-Clause"
] | null | null | null | example-project/find_duplicate_items.py | alexdevmotion/scrapy-elastic-web-crawling | ad09698bf597ed67a56a0c9e6b0dfad0f7798653 | [
"BSD-3-Clause"
] | null | null | null | example-project/find_duplicate_items.py | alexdevmotion/scrapy-elastic-web-crawling | ad09698bf597ed67a56a0c9e6b0dfad0f7798653 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import redis
import sys
import time
start_time = time.time()
def main(id, no_processes):
r = redis.Redis(host='54.201.225.114')
no_items = r.llen("dmoz:items");
main_interval = getMainInterval(no_items, no_processes, id)
all_items = r.lrange("d... | 34.711538 | 113 | 0.651524 |
d0ca05fd3771f129f591032df0b9cf0943a23bab | 7,407 | py | Python | plot_metrics.py | crepuscularlight/arcnet | 6c05eb0dcd7445f6efd59311bc81dd9a39db0506 | [
"MIT"
] | 1 | 2021-09-03T06:57:46.000Z | 2021-09-03T06:57:46.000Z | plot_metrics.py | crepuscularlight/arcnet | 6c05eb0dcd7445f6efd59311bc81dd9a39db0506 | [
"MIT"
] | null | null | null | plot_metrics.py | crepuscularlight/arcnet | 6c05eb0dcd7445f6efd59311bc81dd9a39db0506 | [
"MIT"
] | null | null | null | import json
import matplotlib.pyplot as plt
import numpy as np
import argparse
def load_json_arr(json_path):
lines = []
with open(json_path, 'r') as f:
for line in f:
lines.append(json.loads(line))
return lines
# Parsing global arguments
parser = argparse.ArgumentParser(description='C... | 40.697802 | 167 | 0.699203 |
e6ea4dbc080cae69ae5783031f3f24ffd424d231 | 2,058 | py | Python | pincer/objects/intents.py | WhyDoWeLiveWithoutMeaning/Pincer | d130d8e92eba259fa662a77e3b23549c5d0ef0ff | [
"MIT"
] | null | null | null | pincer/objects/intents.py | WhyDoWeLiveWithoutMeaning/Pincer | d130d8e92eba259fa662a77e3b23549c5d0ef0ff | [
"MIT"
] | null | null | null | pincer/objects/intents.py | WhyDoWeLiveWithoutMeaning/Pincer | d130d8e92eba259fa662a77e3b23549c5d0ef0ff | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# MIT License
#
# Copyright (c) 2021 Pincer
#
# 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, co... | 32.666667 | 72 | 0.700194 |
5dae7237b8d494822df2a02eae0d6130538f391a | 762 | py | Python | heat/db/sqlalchemy/migrate_repo/versions/070_placeholder.py | grebennikov/heat1 | 6a11bd0b5984c8f880d1a24ed324620020032b5a | [
"Apache-2.0"
] | 1 | 2015-12-18T21:46:55.000Z | 2015-12-18T21:46:55.000Z | heat/db/sqlalchemy/migrate_repo/versions/070_placeholder.py | grebennikov/heat1 | 6a11bd0b5984c8f880d1a24ed324620020032b5a | [
"Apache-2.0"
] | null | null | null | heat/db/sqlalchemy/migrate_repo/versions/070_placeholder.py | grebennikov/heat1 | 6a11bd0b5984c8f880d1a24ed324620020032b5a | [
"Apache-2.0"
] | 1 | 2021-03-21T11:37:03.000Z | 2021-03-21T11:37:03.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
# ... | 36.285714 | 78 | 0.730971 |
abd453051bf4fd964dce2154a3116370e0157839 | 13,822 | py | Python | modules/data/RandAugment.py | bomtorazek/SupContrast | 943d1157d38136f9df55418e0b44fbc60744b142 | [
"BSD-2-Clause"
] | null | null | null | modules/data/RandAugment.py | bomtorazek/SupContrast | 943d1157d38136f9df55418e0b44fbc60744b142 | [
"BSD-2-Clause"
] | null | null | null | modules/data/RandAugment.py | bomtorazek/SupContrast | 943d1157d38136f9df55418e0b44fbc60744b142 | [
"BSD-2-Clause"
] | 1 | 2021-06-18T14:50:23.000Z | 2021-06-18T14:50:23.000Z | """ AutoAugment and RandAugment
Implementation adapted from:
https://github.com/tensorflow/tpu/blob/master/models/official/efficientnet/autoaugment.py
Papers: https://arxiv.org/abs/1805.09501, https://arxiv.org/abs/1906.11172, and https://arxiv.org/abs/1909.13719
Hacked together by Ross Wightman
"""
import random
i... | 30.852679 | 119 | 0.660469 |
63b56df93aaf94718f3657a0a02219277964686a | 439 | py | Python | studybuddyfinder/migrations/0021_auto_20201110_0042.py | SindhuMente/CS3240-StudyBuddyFinder | c3c2f2b80b8351df9255e44194bce6503f984183 | [
"MIT"
] | 2 | 2020-12-10T02:39:00.000Z | 2021-03-16T23:32:46.000Z | studybuddyfinder/migrations/0021_auto_20201110_0042.py | SindhuMente/CS3240-StudyBuddyFinder | c3c2f2b80b8351df9255e44194bce6503f984183 | [
"MIT"
] | null | null | null | studybuddyfinder/migrations/0021_auto_20201110_0042.py | SindhuMente/CS3240-StudyBuddyFinder | c3c2f2b80b8351df9255e44194bce6503f984183 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.1 on 2020-11-10 05:42
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('studybuddyfinder', '0020_auto_20201110_0039'),
]
operations = [
migrations.AlterField(
model_name='announcement',
na... | 23.105263 | 90 | 0.628702 |
9343495a05a45f42e67686c4466293fd00721be3 | 74,096 | py | Python | Tests/feaLib/parser_test.py | twardoch/fonttools-py27 | 75b852d3f59fc0d03c6e78581530597d4c6368a1 | [
"MIT",
"BSD-3-Clause"
] | 240 | 2021-01-11T14:49:24.000Z | 2022-03-29T22:33:49.000Z | Tests/feaLib/parser_test.py | twardoch/fonttools-py27 | 75b852d3f59fc0d03c6e78581530597d4c6368a1 | [
"MIT",
"BSD-3-Clause"
] | 77 | 2021-01-12T20:23:30.000Z | 2022-03-28T12:14:34.000Z | Tests/feaLib/parser_test.py | twardoch/fonttools-py27 | 75b852d3f59fc0d03c6e78581530597d4c6368a1 | [
"MIT",
"BSD-3-Clause"
] | 28 | 2021-01-17T05:44:11.000Z | 2022-01-11T19:58:46.000Z | # -*- coding: utf-8 -*-
from __future__ import print_function, division, absolute_import
from __future__ import unicode_literals
from fontTools.feaLib.error import FeatureLibError
from fontTools.feaLib.parser import Parser, SymbolTable
from fontTools.misc.py23 import *
import warnings
import fontTools.feaLib.ast as ast... | 43.585882 | 82 | 0.598899 |
89d31863ac78a56f2b97d384efc6835af761feaf | 1,415 | py | Python | python/az/aro/azext_aro/_rbac.py | jim-minter/rp | e78a02c9c89036f1c82080b4b8c2166a32ccedf0 | [
"Apache-2.0"
] | 1 | 2019-11-05T17:12:50.000Z | 2019-11-05T17:12:50.000Z | python/az/aro/azext_aro/_rbac.py | jim-minter/rp | e78a02c9c89036f1c82080b4b8c2166a32ccedf0 | [
"Apache-2.0"
] | 41 | 2019-11-19T18:38:52.000Z | 2019-12-24T15:13:15.000Z | python/az/aro/azext_aro/_rbac.py | jim-minter/rp | e78a02c9c89036f1c82080b4b8c2166a32ccedf0 | [
"Apache-2.0"
] | 4 | 2019-11-08T15:40:56.000Z | 2019-11-27T05:07:08.000Z | import uuid
from azure.cli.core.commands.client_factory import get_mgmt_service_client
from azure.cli.core.commands.client_factory import get_subscription_id
from azure.cli.core.profiles import get_sdk
from azure.cli.core.profiles import ResourceType
from msrestazure.tools import resource_id
CONTRIBUTOR = "b24988ac-... | 38.243243 | 92 | 0.717314 |
7d45b76000a84877e068154cc8f74844fe270c16 | 6,214 | py | Python | Supervised/video_classification/utils/videos_to_frame_folders.py | Kebniss/AutoDetect | 44ca4d6930ef5fbf044ebeed5c9fd925f04bc1a8 | [
"MIT"
] | 1 | 2019-07-25T02:16:32.000Z | 2019-07-25T02:16:32.000Z | Supervised/video_classification/utils/videos_to_frame_folders.py | Kebniss/AutoDetect | 44ca4d6930ef5fbf044ebeed5c9fd925f04bc1a8 | [
"MIT"
] | null | null | null | Supervised/video_classification/utils/videos_to_frame_folders.py | Kebniss/AutoDetect | 44ca4d6930ef5fbf044ebeed5c9fd925f04bc1a8 | [
"MIT"
] | null | null | null | """
Given a folder of mp4, saves each of them in the FrameFolder format.
If this video's name was "abcde", this would be the structure:
root/abcde/data.csv
root/abcde/images/1.png
root/abcde/images/2.png
where data.csv contains all the columns beyond image (ie the label).
"""
import cv2
import PIL
from PIL import Im... | 30.165049 | 90 | 0.607016 |
ce57980cf0331dc9c6de18f9bcc0778359be4de7 | 5,399 | py | Python | Python/biopsy/gapped_pssms/hmm.py | JohnReid/biopsy | 1eeb714ba5b53f2ecf776d865d32e2078cbc0338 | [
"MIT"
] | null | null | null | Python/biopsy/gapped_pssms/hmm.py | JohnReid/biopsy | 1eeb714ba5b53f2ecf776d865d32e2078cbc0338 | [
"MIT"
] | null | null | null | Python/biopsy/gapped_pssms/hmm.py | JohnReid/biopsy | 1eeb714ba5b53f2ecf776d865d32e2078cbc0338 | [
"MIT"
] | null | null | null | #
# Copyright John Reid 2007
#
import _gapped_pssms_hmm as hmm
def weblogo_data_from_dist( dist ):
"""Data for weblogo from pssm distribution"""
import weblogolib, corebio.seq
return weblogolib.LogoData.from_counts(
corebio.seq.unambiguous_dna_alphabet,
dist * 100
)
def weblog... | 32.920732 | 82 | 0.543064 |
95b577500e44f28d5875895108619d3d2a40b31e | 916 | py | Python | prism/cmds/image/pfp.py | ii-Python/Prism-v3 | 15a43161b41117529c915726e6270259f05d187d | [
"MIT"
] | 3 | 2021-11-26T22:08:11.000Z | 2021-12-23T21:42:22.000Z | prism/cmds/image/pfp.py | wannurhadi/Prism-v3 | 514f8d17072bf208c42e68391bce471c7d608269 | [
"MIT"
] | 1 | 2021-07-07T22:37:10.000Z | 2021-07-07T22:40:11.000Z | prism/cmds/image/pfp.py | wannurhadi/Prism-v3 | 514f8d17072bf208c42e68391bce471c7d608269 | [
"MIT"
] | 1 | 2021-12-23T21:42:24.000Z | 2021-12-23T21:42:24.000Z | # Copyright 2021-xx iiPython
# Modules
import discord
from discord.ext import commands
from discord.commands import Option
# Command class
class Avatar(commands.Cog):
def __init__(self, bot) -> None:
self.bot = bot
self.core = bot.core
@commands.slash_command(description = "Shows you somebodi... | 30.533333 | 125 | 0.64083 |
99bf5fb6da914cabf0b1c48d6e7449aee24fc517 | 3,080 | py | Python | app/app/settings.py | manishnymble19/recipe-app-api | 5461442ca114fc29356dc68c7fd8dc030190be51 | [
"MIT"
] | null | null | null | app/app/settings.py | manishnymble19/recipe-app-api | 5461442ca114fc29356dc68c7fd8dc030190be51 | [
"MIT"
] | null | null | null | app/app/settings.py | manishnymble19/recipe-app-api | 5461442ca114fc29356dc68c7fd8dc030190be51 | [
"MIT"
] | null | null | null | """
Django settings for app project.
Generated by 'django-admin startproject' using Django 2.1.15.
For more information on this file, see
https://docs.djangoproject.com/en/2.1/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.1/ref/settings/
"""
import os
# Bu... | 25.454545 | 91 | 0.696429 |
a058b31493ed3189d6d7092a39940517a7171b5f | 8,682 | py | Python | yandex/cloud/vpc/v1/network_service_pb2_grpc.py | kbespalov/python-sdk | e86563ee850e46a35b4c84053ecd4affdf66a963 | [
"MIT"
] | null | null | null | yandex/cloud/vpc/v1/network_service_pb2_grpc.py | kbespalov/python-sdk | e86563ee850e46a35b4c84053ecd4affdf66a963 | [
"MIT"
] | null | null | null | yandex/cloud/vpc/v1/network_service_pb2_grpc.py | kbespalov/python-sdk | e86563ee850e46a35b4c84053ecd4affdf66a963 | [
"MIT"
] | null | null | null | # Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
import grpc
from yandex.cloud.operation import operation_pb2 as yandex_dot_cloud_dot_operation_dot_operation__pb2
from yandex.cloud.vpc.v1 import network_pb2 as yandex_dot_cloud_dot_vpc_dot_v1_dot_network__pb2
from yandex.cloud.vpc.v1 import network... | 50.476744 | 136 | 0.785648 |
8c5ff9aae97d611cdd357635b334ed8a5699602f | 3,374 | py | Python | Networks/EfficientNet_yy.py | XLPRUtils/XLPR_Classification | c8a3a574013858e23d4722dd03c1d9fa59a41c0e | [
"MIT"
] | 2 | 2020-11-17T08:57:01.000Z | 2021-06-30T00:42:53.000Z | Networks/EfficientNet_yy.py | XLPRUtils/XLPR_Classification | c8a3a574013858e23d4722dd03c1d9fa59a41c0e | [
"MIT"
] | null | null | null | Networks/EfficientNet_yy.py | XLPRUtils/XLPR_Classification | c8a3a574013858e23d4722dd03c1d9fa59a41c0e | [
"MIT"
] | null | null | null | '''EfficientNet in PyTorch.
Paper: "EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks".
'''
import torch
import torch.nn as nn
import torch.nn.functional as F
class Block(nn.Module):
'''expand + depthwise + pointwise + squeeze-excitation'''
def __init__(self, in_planes, ou... | 33.74 | 84 | 0.557795 |
e33f698fc3fafa2d384ca68126b54a912601fb22 | 2,740 | py | Python | modules/generate_thumbnails.py | zamanianlab/wrmXpress | a40b3e7d66c3ca4e319ad268fd5c0bf0de036d16 | [
"MIT"
] | null | null | null | modules/generate_thumbnails.py | zamanianlab/wrmXpress | a40b3e7d66c3ca4e319ad268fd5c0bf0de036d16 | [
"MIT"
] | 1 | 2022-01-24T17:31:03.000Z | 2022-01-24T17:31:03.000Z | modules/generate_thumbnails.py | zamanianlab/wrmXpress | a40b3e7d66c3ca4e319ad268fd5c0bf0de036d16 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
from skimage.transform import rescale
from PIL import Image, ImageDraw
from matplotlib import cm
def generate_thumbnails(g, type):
thumb_dict = {}
for well in g.wells:
if type == '':
path = g.work.joinpath(g.plate, well, 'img', g.plate + '_' + well + '.png')
... | 37.027027 | 100 | 0.569708 |
f6c291967e236ec2765f842c43fa3e0d83729f92 | 67,302 | py | Python | core/domain/skill_services_test.py | Tim810306/oppia | 6f90044d12dbe0979c999265cbe46f267c4c592d | [
"Apache-2.0"
] | 2 | 2021-05-24T10:23:32.000Z | 2021-08-22T18:50:14.000Z | core/domain/skill_services_test.py | Tim810306/oppia | 6f90044d12dbe0979c999265cbe46f267c4c592d | [
"Apache-2.0"
] | 11 | 2021-03-03T07:21:27.000Z | 2022-03-12T01:03:44.000Z | core/domain/skill_services_test.py | Tim810306/oppia | 6f90044d12dbe0979c999265cbe46f267c4c592d | [
"Apache-2.0"
] | 1 | 2020-12-09T21:33:49.000Z | 2020-12-09T21:33:49.000Z | # Copyright 2018 The Oppia 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 applicable ... | 41.854478 | 80 | 0.61646 |
aae725245c5cc511d7adbf0e9f052d3db18994e3 | 9,277 | py | Python | shade/tests/unit/test_rebuild_server.py | noironetworks/shade | e46878bae44e7daebf32c0aeaeffea0011542525 | [
"Apache-2.0"
] | 96 | 2015-01-29T20:12:08.000Z | 2019-01-28T22:17:13.000Z | shade/tests/unit/test_rebuild_server.py | noironetworks/shade | e46878bae44e7daebf32c0aeaeffea0011542525 | [
"Apache-2.0"
] | 7 | 2015-08-14T18:47:28.000Z | 2019-02-18T16:32:36.000Z | shade/tests/unit/test_rebuild_server.py | noironetworks/shade | e46878bae44e7daebf32c0aeaeffea0011542525 | [
"Apache-2.0"
] | 88 | 2015-05-11T17:20:52.000Z | 2019-04-04T03:23:30.000Z | # -*- coding: utf-8 -*-
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, softw... | 36.667984 | 78 | 0.499407 |
c09eaf5936de0391f9d4a4bfcfebc737244638e6 | 3,166 | py | Python | PhysicsTools/HeppyCore/python/framework/analyzer.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | PhysicsTools/HeppyCore/python/framework/analyzer.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | PhysicsTools/HeppyCore/python/framework/analyzer.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | from __future__ import print_function
# Copyright (C) 2014 Colin Bernet
# https://github.com/cbernet/heppy/blob/master/LICENSE
import os
import logging
from PhysicsTools.HeppyCore.statistics.counter import Counters
from PhysicsTools.HeppyCore.statistics.average import Averages
class Analyzer(object):
"""Base Ana... | 37.247059 | 86 | 0.646241 |
a41f5288c0490cb0e2d0ab30950ec449f315447e | 294 | py | Python | django_tex/response.py | bhaettasch/django-tex | 66cc6567acde4db2ac971b7707652067e664392c | [
"MIT"
] | null | null | null | django_tex/response.py | bhaettasch/django-tex | 66cc6567acde4db2ac971b7707652067e664392c | [
"MIT"
] | null | null | null | django_tex/response.py | bhaettasch/django-tex | 66cc6567acde4db2ac971b7707652067e664392c | [
"MIT"
] | 1 | 2021-05-08T16:29:06.000Z | 2021-05-08T16:29:06.000Z | from django.http import HttpResponse
class PDFResponse(HttpResponse):
def __init__(self, content, filename=None):
super(PDFResponse, self).__init__(content_type='application/pdf')
self['Content-Disposition'] = 'filename="{}"'.format(filename)
self.write(content)
| 29.4 | 73 | 0.707483 |
66fe53de1c5faeef357590aadb172a260c6a210b | 14,772 | py | Python | tensor2tensor/models/research/moe_experiments.py | arturbeg/tensor2tensor | 43b70752311d3b8dc5f11f63d0dea3efdf8ee25b | [
"Apache-2.0"
] | null | null | null | tensor2tensor/models/research/moe_experiments.py | arturbeg/tensor2tensor | 43b70752311d3b8dc5f11f63d0dea3efdf8ee25b | [
"Apache-2.0"
] | null | null | null | tensor2tensor/models/research/moe_experiments.py | arturbeg/tensor2tensor | 43b70752311d3b8dc5f11f63d0dea3efdf8ee25b | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2019 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... | 26.66426 | 77 | 0.712429 |
6f93641122a51039c615a8f2cd677f98fcc2bc48 | 337 | py | Python | photos/views.py | newtonkiragu/mars-rover | 722355a6435571ec509cbf4f5cbfddb1a0f6c235 | [
"MIT"
] | null | null | null | photos/views.py | newtonkiragu/mars-rover | 722355a6435571ec509cbf4f5cbfddb1a0f6c235 | [
"MIT"
] | null | null | null | photos/views.py | newtonkiragu/mars-rover | 722355a6435571ec509cbf4f5cbfddb1a0f6c235 | [
"MIT"
] | null | null | null | from django.shortcuts import render
# Create your views here.
from django.views.generic import TemplateView
# Create your views here.
class ClassView(TemplateView):
"""Home page template."""
template_name = 'photos/index.html'
class RoverView(TemplateView):
"""About view."""
template_name = 'ph... | 16.85 | 45 | 0.718101 |
8d35058a070198e0bcd39e9e12cfd4aadbd33f6d | 10,512 | py | Python | stix2arango/postgresql.py | 1lca/stix2arango | 8bbd8db42710179ba5bebfcc4abe27d993588a0b | [
"MIT"
] | null | null | null | stix2arango/postgresql.py | 1lca/stix2arango | 8bbd8db42710179ba5bebfcc4abe27d993588a0b | [
"MIT"
] | null | null | null | stix2arango/postgresql.py | 1lca/stix2arango | 8bbd8db42710179ba5bebfcc4abe27d993588a0b | [
"MIT"
] | null | null | null | import ipaddress
import copy
from nis import match
from typing import Dict
from stix2arango.exceptions import InvalidObjectForOptimizer
from stix2arango.utils import deep_dict_update
import psycopg2
from psycopg2.errors import DuplicateTable
import uuid
type_map = {
'str' : 'TEXT',
'int' : 'INT'
}
operator_... | 35.04 | 126 | 0.560027 |
80e51ec84b4c9e436a2fd25c63608640e10f3c20 | 241,531 | py | Python | tensorflow/python/framework/ops.py | kmh4321/tensorflow | 2c5df0c3a4a9c5aa7be26098aba0020dfdfac38e | [
"Apache-2.0"
] | null | null | null | tensorflow/python/framework/ops.py | kmh4321/tensorflow | 2c5df0c3a4a9c5aa7be26098aba0020dfdfac38e | [
"Apache-2.0"
] | null | null | null | tensorflow/python/framework/ops.py | kmh4321/tensorflow | 2c5df0c3a4a9c5aa7be26098aba0020dfdfac38e | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 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.441008 | 115 | 0.692027 |
3b9e6e24f8e4ab98d540fb5e1788f68716019b33 | 11,450 | py | Python | accuracy.py | gpmarques/unsup_action_seg_st_pe_embed | b6d6c95099399b667ad41339ac1259c631c9ec54 | [
"MIT"
] | null | null | null | accuracy.py | gpmarques/unsup_action_seg_st_pe_embed | b6d6c95099399b667ad41339ac1259c631c9ec54 | [
"MIT"
] | null | null | null | accuracy.py | gpmarques/unsup_action_seg_st_pe_embed | b6d6c95099399b667ad41339ac1259c631c9ec54 | [
"MIT"
] | null | null | null | """Module for computing evaluation metrics"""
__author__ = 'Anna Kukleva'
__date__ = 'August 2018'
import numpy as np
from collections import defaultdict, Counter
from scipy.optimize import linear_sum_assignment
class Accuracy(object):
""" Implementation of evaluation metrics for unsupervised learning.
Sin... | 39.756944 | 127 | 0.61083 |
ba4b226aff30e92ad6c3d7261ff4946066a0b4f3 | 13,315 | py | Python | app/books/serializers.py | MateuszZalewski/STX_Next | 8ee14761bd064799629f652d82f687fbbd7953ee | [
"MIT"
] | null | null | null | app/books/serializers.py | MateuszZalewski/STX_Next | 8ee14761bd064799629f652d82f687fbbd7953ee | [
"MIT"
] | null | null | null | app/books/serializers.py | MateuszZalewski/STX_Next | 8ee14761bd064799629f652d82f687fbbd7953ee | [
"MIT"
] | null | null | null | from collections import OrderedDict
from rest_framework import serializers
from .models import Book, SearchInfo
from .models.access_info import AccessInfo, Epub, Pdf, DownloadAccess
from .models.volume_info import VolumeInfo, Author, Category, IndustryIdentifier, Dimensions, \
ReadingModes, PanelizationSummary, Ima... | 38.594203 | 108 | 0.696583 |
24bd42737fc70e26da0686014b66d2095fc8f8e3 | 1,232 | py | Python | fhirtordf/rdfsupport/uriutils.py | janik-martin/fhirtordf | 05b23ba1df9f322c148b7f20ebbd6d58cb92cefc | [
"CC0-1.0"
] | 10 | 2017-11-20T07:18:36.000Z | 2022-02-03T12:59:26.000Z | fhirtordf/rdfsupport/uriutils.py | janik-martin/fhirtordf | 05b23ba1df9f322c148b7f20ebbd6d58cb92cefc | [
"CC0-1.0"
] | 22 | 2017-09-12T22:15:11.000Z | 2021-05-14T13:48:48.000Z | fhirtordf/rdfsupport/uriutils.py | janik-martin/fhirtordf | 05b23ba1df9f322c148b7f20ebbd6d58cb92cefc | [
"CC0-1.0"
] | 9 | 2018-05-09T07:51:51.000Z | 2022-03-09T16:03:19.000Z | from typing import Tuple, NamedTuple, Union, Optional
from rdflib import URIRef
from fhirtordf.rdfsupport.fhirresourcere import FHIR_RESOURCE_RE, FHIR_RE_ID, FHIR_RE_BASE, FHIR_RE_RESOURCE
from fhirtordf.rdfsupport.namespaces import FHIR
class FHIR_RESOURCE(NamedTuple):
namespace: Optional[URIRef]
resource_... | 36.235294 | 113 | 0.702922 |
8de60812630f043b5be192bf4b9bf18272c064bc | 4,454 | py | Python | service_pro/service_pro/report/ar_salesman_summary/ar_salesman_summary.py | teambackoffice/service-pro | fa07dee3b0e349df5ee906112aee02d3eb0ea7a5 | [
"MIT"
] | 1 | 2021-08-18T06:56:15.000Z | 2021-08-18T06:56:15.000Z | service_pro/service_pro/report/ar_salesman_summary/ar_salesman_summary.py | teambackoffice/service-pro | fa07dee3b0e349df5ee906112aee02d3eb0ea7a5 | [
"MIT"
] | null | null | null | service_pro/service_pro/report/ar_salesman_summary/ar_salesman_summary.py | teambackoffice/service-pro | fa07dee3b0e349df5ee906112aee02d3eb0ea7a5 | [
"MIT"
] | 3 | 2020-12-01T14:17:37.000Z | 2022-02-02T17:12:29.000Z | # Copyright (c) 2013, jan and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _, scrub
from frappe.utils import flt, cint
from erpnext.accounts.party import get_partywise_advanced_payment_amount
from erpnext.accounts.report.account... | 34.261538 | 102 | 0.715537 |
6759334fe7a4bfa2dbc5f670694978ff79fa732d | 386 | py | Python | proxypool/setting.py | nicajonh/ProxyPool | 565432ff269928e4bce31c3712fc3c1700b9236f | [
"Apache-2.0"
] | null | null | null | proxypool/setting.py | nicajonh/ProxyPool | 565432ff269928e4bce31c3712fc3c1700b9236f | [
"Apache-2.0"
] | null | null | null | proxypool/setting.py | nicajonh/ProxyPool | 565432ff269928e4bce31c3712fc3c1700b9236f | [
"Apache-2.0"
] | 1 | 2019-06-19T08:06:44.000Z | 2019-06-19T08:06:44.000Z | """
-------------------------------------------------
File Name: setting.py
Description: 设置模块,包含了一些常量。
Author: Liu
Date: 2016/12/9
-------------------------------------------------
"""
# Redis Host
HOST = 'localhost'
# Redis PORT
PORT = 6379
POOL_LOWER_THRESHOLD = 10
POOL_UPPER_... | 18.380952 | 49 | 0.476684 |
9b1efab9f94a6e759b10f4a31dc0c322db3c3929 | 3,646 | py | Python | cogs/error.py | Tarikazana/Verifier | 59a7f8e3012b8a39c33db918fe5bb83d66c36b47 | [
"MIT"
] | 2 | 2021-11-18T03:32:34.000Z | 2022-02-13T13:19:46.000Z | cogs/error.py | Tarikazana/Verifier | 59a7f8e3012b8a39c33db918fe5bb83d66c36b47 | [
"MIT"
] | null | null | null | cogs/error.py | Tarikazana/Verifier | 59a7f8e3012b8a39c33db918fe5bb83d66c36b47 | [
"MIT"
] | 1 | 2021-11-18T03:30:07.000Z | 2021-11-18T03:30:07.000Z | """
> error.py
> Author: Tari Kazana
> cooldown and stuff
"""
import discord
import traceback
import sys
import math
import asyncio
from discord.ext import commands
class err(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.Cog.listener()
async def on_com... | 35.745098 | 228 | 0.518651 |
4c969c981b2fbf3a541e205d497a1c0d87a9e36d | 18,752 | py | Python | koku/masu/test/util/test_common.py | rubik-ai/koku | 3255d1c217b7b6685cb2e130bf4e025946e76fac | [
"Apache-2.0"
] | 157 | 2018-04-30T16:27:53.000Z | 2022-03-31T08:17:21.000Z | koku/masu/test/util/test_common.py | rubik-ai/koku | 3255d1c217b7b6685cb2e130bf4e025946e76fac | [
"Apache-2.0"
] | 3,250 | 2018-04-26T14:14:25.000Z | 2022-03-31T23:49:15.000Z | koku/masu/test/util/test_common.py | rubik-ai/koku | 3255d1c217b7b6685cb2e130bf4e025946e76fac | [
"Apache-2.0"
] | 65 | 2018-05-10T14:11:50.000Z | 2022-03-18T19:22:58.000Z | #
# Copyright 2021 Red Hat Inc.
# SPDX-License-Identifier: Apache-2.0
#
"""Test the common util functions."""
import gzip
import json
import types
from datetime import date
from datetime import datetime
from datetime import timedelta
from decimal import Decimal
from os.path import exists
from dateutil import parser
fr... | 40.854031 | 118 | 0.664782 |
6715fb73480288f8b6ca2b2acbe0595ff5784679 | 48,813 | py | Python | core/domain/user_jobs_one_off.py | TheoLipeles/oppia | cd0bb873e08fa716014f3d1480fbbfee95b89121 | [
"Apache-2.0"
] | 2 | 2021-03-07T18:39:15.000Z | 2021-03-29T20:09:11.000Z | core/domain/user_jobs_one_off.py | TheoLipeles/oppia | cd0bb873e08fa716014f3d1480fbbfee95b89121 | [
"Apache-2.0"
] | null | null | null | core/domain/user_jobs_one_off.py | TheoLipeles/oppia | cd0bb873e08fa716014f3d1480fbbfee95b89121 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 The Oppia 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 applicable ... | 37.404598 | 111 | 0.614426 |
a9a34e3c015b355aa136be674f165f8ccc7aa52e | 1,172 | py | Python | study_sample/Animal.py | dantefung/Python-Codebase | 7e154100a1016ad79ec5d6adc7c11f096ec1966b | [
"MIT"
] | null | null | null | study_sample/Animal.py | dantefung/Python-Codebase | 7e154100a1016ad79ec5d6adc7c11f096ec1966b | [
"MIT"
] | 5 | 2021-04-30T21:18:36.000Z | 2022-03-12T00:55:18.000Z | study_sample/Animal.py | dantefung/Python-Codebase | 7e154100a1016ad79ec5d6adc7c11f096ec1966b | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding:UTF-8 -*-
'super class animal'
# 全局变量
__Author__ = 'DANTE FUNG'
# 类定义
class Animal(object):
def run(self):
print('Animal is running ...')
class Dog(Animal):
def run(self):
print('Dog is running ...')
def eat(self):
print('Dog is Eating meat...')... | 18.603175 | 72 | 0.676621 |
61313860cd0f75bfbfe233c8405ccb82a259a3e1 | 6,323 | py | Python | twbot/twtrbot/twtrbot.py | EmilyBarbour/twbot | 549818229553b18b6ac8371a096eeeade489f0e5 | [
"MIT"
] | null | null | null | twbot/twtrbot/twtrbot.py | EmilyBarbour/twbot | 549818229553b18b6ac8371a096eeeade489f0e5 | [
"MIT"
] | null | null | null | twbot/twtrbot/twtrbot.py | EmilyBarbour/twbot | 549818229553b18b6ac8371a096eeeade489f0e5 | [
"MIT"
] | null | null | null | # coding: utf-8
import ast
import contextlib
from datetime import datetime, timedelta
import json
import logging
import logging.handlers
import requests
from requests_oauthlib import OAuth1
import twitter_funcs
import time
BOT_NUM=20
#logging.addLevelName(BOT_NUM, "BOTLOG")
# Add the log message handler to the logger
... | 39.030864 | 151 | 0.599083 |
c98c3a08ebea71275d73b74242c2023e822ad7d2 | 598 | py | Python | CorelationCovariance.py | samuelmaina/Data_Science | c9377565ae4ba60bf2d17b592122df2056b6ba96 | [
"MIT"
] | null | null | null | CorelationCovariance.py | samuelmaina/Data_Science | c9377565ae4ba60bf2d17b592122df2056b6ba96 | [
"MIT"
] | null | null | null | CorelationCovariance.py | samuelmaina/Data_Science | c9377565ae4ba60bf2d17b592122df2056b6ba96 | [
"MIT"
] | null | null | null | from numpy import mean,dot
import matplotlib.pyplot as plt
import numpy as np
def de_mean(x):
xmean= np.mean(x)
return [x1 - xmean for x1 in x]
def coveriance(x, y):
n= len(x)
return np.dot(de_mean(x),de_mean(y))/(n-1)
pageSpeeds=np.random.normal(3.0, 1.0, 1000)
purchaseAmount= np.random.normal(50... | 16.611111 | 50 | 0.697324 |
d2c2674fe38e427addfa01e8f998b5afae60f66a | 958 | py | Python | masonite/commands/MakeMigrationCommand.py | w3x10e8/core | d8f0ca29c2bd5e86d199391fa916ce2f5c9b0f49 | [
"MIT"
] | null | null | null | masonite/commands/MakeMigrationCommand.py | w3x10e8/core | d8f0ca29c2bd5e86d199391fa916ce2f5c9b0f49 | [
"MIT"
] | null | null | null | masonite/commands/MakeMigrationCommand.py | w3x10e8/core | d8f0ca29c2bd5e86d199391fa916ce2f5c9b0f49 | [
"MIT"
] | null | null | null | """ New Migration Command """
import subprocess
from cleo import Command
class MakeMigrationCommand(Command):
"""
Makes a new migration
migration
{name : Name of your migration}
{--t|--table=False : Table you are migrating for}
{--c|--create=False : Table you want to create with ... | 33.034483 | 105 | 0.545929 |
be83fb416646912490d10c10afc5c7f45b410545 | 5,378 | py | Python | benchmarks/f3_wrong_hints_permutations/scaling_software_termination/8-2Nested_false-termination_4.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 3 | 2021-04-23T23:29:26.000Z | 2022-03-23T10:00:30.000Z | benchmarks/f3_wrong_hints_permutations/scaling_software_termination/8-2Nested_false-termination_4.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | null | null | null | benchmarks/f3_wrong_hints_permutations/scaling_software_termination/8-2Nested_false-termination_4.py | EnricoMagnago/F3 | c863215c318d7d5f258eb9be38c6962cf6863b52 | [
"MIT"
] | 1 | 2021-11-17T22:02:56.000Z | 2021-11-17T22:02:56.000Z | from typing import Tuple, FrozenSet
from pysmt.environment import Environment as PysmtEnv
from pysmt.fnode import FNode
import pysmt.typing as types
from utils import symb_to_next
from hint import Hint, Location
def transition_system(env: PysmtEnv) -> Tuple[FrozenSet[FNode], FNode, FNode,
... | 30.213483 | 77 | 0.576237 |
58cc1fa3fc63108e0d898a9479824cef2857b0b4 | 2,497 | py | Python | Scripts/pdf_geneator.py | yogeshwaran01/Mini-Projects | c1a8790079d904405d49c71d6903ca4daaa77b38 | [
"MIT"
] | 4 | 2020-09-30T17:18:13.000Z | 2021-06-11T21:02:10.000Z | Scripts/pdf_geneator.py | yogeshwaran01/Mini-Projects | c1a8790079d904405d49c71d6903ca4daaa77b38 | [
"MIT"
] | null | null | null | Scripts/pdf_geneator.py | yogeshwaran01/Mini-Projects | c1a8790079d904405d49c71d6903ca4daaa77b38 | [
"MIT"
] | 1 | 2021-04-02T14:51:00.000Z | 2021-04-02T14:51:00.000Z | from reportlab.platypus import SimpleDocTemplate
from reportlab.platypus import Paragraph, Table, Image, ListItem
from reportlab.lib.styles import getSampleStyleSheet
from reportlab.lib import colors
class PdfGenerator:
"""
Class help to generate pdf
"""
def __init__(self, filename: str):
sel... | 29.034884 | 75 | 0.592311 |
7b21699334c6eb15b1eebafe871f5b4b538d91da | 2,301 | py | Python | metrics/state.py | sspbft/BFTList | d73aee5bd0ab05995509f0fcfaf3c0a5944e617a | [
"MIT"
] | 6 | 2019-11-12T01:45:55.000Z | 2022-03-18T10:57:21.000Z | metrics/state.py | practicalbft/BFTList | d73aee5bd0ab05995509f0fcfaf3c0a5944e617a | [
"MIT"
] | 4 | 2019-02-14T10:57:09.000Z | 2019-03-21T15:22:08.000Z | metrics/state.py | sspbft/BFTList | d73aee5bd0ab05995509f0fcfaf3c0a5944e617a | [
"MIT"
] | 1 | 2019-04-04T15:09:33.000Z | 2019-04-04T15:09:33.000Z | """Metrics related to state and requests."""
# standard
import logging
import time
from prometheus_client import Counter, Gauge
# local
from modules.replication.models.client_request import ClientRequest
logger = logging.getLogger(__name__)
PEND = "pend"
START_TIME = "start_time"
# metrics
state_length = Counter("... | 32.871429 | 76 | 0.669709 |
1b893bdcbad6d934ebd79101f2b06bdf36aba8fb | 138 | py | Python | kafka_consumer/datadog_checks/kafka_consumer/__about__.py | vbarbaresi/integrations-core | ab26ab1cd6c28a97c1ad1177093a93659658c7aa | [
"BSD-3-Clause"
] | null | null | null | kafka_consumer/datadog_checks/kafka_consumer/__about__.py | vbarbaresi/integrations-core | ab26ab1cd6c28a97c1ad1177093a93659658c7aa | [
"BSD-3-Clause"
] | null | null | null | kafka_consumer/datadog_checks/kafka_consumer/__about__.py | vbarbaresi/integrations-core | ab26ab1cd6c28a97c1ad1177093a93659658c7aa | [
"BSD-3-Clause"
] | null | null | null | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
__version__ = "2.8.6"
| 23 | 59 | 0.717391 |
06bca580dbca157ceb25a4dd8baf3b64682d1f46 | 3,707 | py | Python | test/generic/test_id_provider.py | Rishav1/PySyft | f620ee12727b52b19a317f263789830b57ee2539 | [
"Apache-2.0"
] | 3 | 2020-09-23T14:09:09.000Z | 2020-09-23T19:26:28.000Z | test/generic/test_id_provider.py | mukira/PySyft | 94595008e8326d3111406ae143099b311fc3f2e6 | [
"Apache-2.0"
] | 3 | 2019-05-24T01:16:56.000Z | 2019-09-18T13:02:30.000Z | test/generic/test_id_provider.py | mukira/PySyft | 94595008e8326d3111406ae143099b311fc3f2e6 | [
"Apache-2.0"
] | 1 | 2022-03-12T08:04:34.000Z | 2022-03-12T08:04:34.000Z | import unittest.mock as mock
import pytest
from syft import exceptions
from syft.generic import id_provider
def test_pop_no_given_ids(hook):
provider = id_provider.IdProvider()
values = [10, 4, 15, 4, 2, 0]
orig_func = id_provider.create_random_id
mocked_random_numbers = mock.Mock()
mocked_rando... | 24.879195 | 73 | 0.6744 |
e2a596c3cfb6154545012a293ee87efffec577d5 | 2,020 | py | Python | caeproject/simulation_result/13/project3.py | cosailer/trivial_code | 80167dd669c22ceb5139bda9379cca5a55bb3680 | [
"MIT"
] | null | null | null | caeproject/simulation_result/13/project3.py | cosailer/trivial_code | 80167dd669c22ceb5139bda9379cca5a55bb3680 | [
"MIT"
] | null | null | null | caeproject/simulation_result/13/project3.py | cosailer/trivial_code | 80167dd669c22ceb5139bda9379cca5a55bb3680 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
-------------------------------------
N A C S P Y T H O N S C R I P T
-------------------------------------
NACS version: 2.0.2745 - pre3
NACS architecture: CENTOS 5.11 (X86_64)
File generated at Tue Jan 20 16:55:05 2015
On host 'lse86' by 'cae42'
"""
from __future__ import division ... | 28.857143 | 174 | 0.661386 |
1e603769c91973e195e593fe76cd31c3727bb542 | 3,565 | py | Python | vgif/main.py | 0xflotus/video2gif | fb7d4be2aa0da24e6dc87ca71e88220782564915 | [
"MIT"
] | 19 | 2021-01-05T02:38:40.000Z | 2021-09-01T06:47:10.000Z | vgif/main.py | 0xflotus/video2gif | fb7d4be2aa0da24e6dc87ca71e88220782564915 | [
"MIT"
] | null | null | null | vgif/main.py | 0xflotus/video2gif | fb7d4be2aa0da24e6dc87ca71e88220782564915 | [
"MIT"
] | 4 | 2021-01-05T12:37:29.000Z | 2022-01-13T06:51:49.000Z | #!/usr/bin/env python
import PySimpleGUI as sg
from PIL import Image
import cv2
import io
import imageio
def loadVideo():
filename = sg.popup_get_file('Filename to gif')
return filename
def main():
# ---===--- Get the filename --- #
skipRate=3
gifFps=10
videoFile=loadVideo()
# scale=0.5
try:
outFile=videoFi... | 28.98374 | 95 | 0.649369 |
367ec6406ceec3174ed6af56c447e96b04fd2fe2 | 45,109 | py | Python | pysnmp-with-texts/EQLDISK-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/EQLDISK-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/EQLDISK-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module EQLDISK-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/EQLDISK-MIB
# Produced by pysmi-0.3.4 at Wed May 1 13:05:18 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27 2019, 0... | 127.067606 | 6,358 | 0.806979 |
227119ff41ac91db8af42efffd832717fa0c2cef | 2,260 | py | Python | src/clusto/test/drivers/DatacenterTests.py | rongoro/clusto | d6425433e5132e8778feeb9db4b8dd80b933b030 | [
"BSD-3-Clause"
] | 5 | 2015-07-19T08:28:01.000Z | 2021-07-08T14:49:27.000Z | src/clusto/test/drivers/DatacenterTests.py | wt/clusto | c114ce7c42dcfa33c1e79f4d3b49313115fea06b | [
"BSD-3-Clause"
] | null | null | null | src/clusto/test/drivers/DatacenterTests.py | wt/clusto | c114ce7c42dcfa33c1e79f4d3b49313115fea06b | [
"BSD-3-Clause"
] | 5 | 2015-01-06T07:57:07.000Z | 2021-11-10T18:01:33.000Z |
import clusto
from clusto.test import testbase
from clusto.drivers.Base import Thing
from clusto.drivers.Servers import Server
from clusto.drivers.Datacenter import Rack, RackU, Datacenter, Colo, Cage
from clusto.exceptions import *
class RackTests(testbase.ClustoTestBase):
def testAddToRack(self):
rac... | 21.121495 | 73 | 0.579646 |
39fea51c829189bda7905fd934c816a76d2bc8be | 106,984 | py | Python | test/onnx/test_pytorch_onnx_caffe2.py | meganhumhrey/pytorch | 41054f2ab5bb39d28a3eb8497f1a65b42385a996 | [
"Intel"
] | 7 | 2021-05-29T16:31:51.000Z | 2022-02-21T18:52:25.000Z | test/onnx/test_pytorch_onnx_caffe2.py | meganhumhrey/pytorch | 41054f2ab5bb39d28a3eb8497f1a65b42385a996 | [
"Intel"
] | 1 | 2021-05-31T02:20:29.000Z | 2021-05-31T02:20:29.000Z | test/onnx/test_pytorch_onnx_caffe2.py | meganhumhrey/pytorch | 41054f2ab5bb39d28a3eb8497f1a65b42385a996 | [
"Intel"
] | null | null | null | from typing import Tuple
import io
import itertools
import sys
import unittest
import numpy as np
from debug_embed_params import run_embed_params
from torch import nn
from torch.autograd import Variable, function
from torch.nn.utils import rnn as rnn_utils
from torch.onnx import ExportTypes
import torch.onnx
import t... | 41.806956 | 132 | 0.604137 |
09433fc9ac977e9473af682a2d1e6de18ea98cdb | 359 | py | Python | PyWavelet/WaveletPeaks.py | mattkjames7/PyWavelet | 542c608da1477894c7454396d1e29627bf8eb038 | [
"MIT"
] | null | null | null | PyWavelet/WaveletPeaks.py | mattkjames7/PyWavelet | 542c608da1477894c7454396d1e29627bf8eb038 | [
"MIT"
] | null | null | null | PyWavelet/WaveletPeaks.py | mattkjames7/PyWavelet | 542c608da1477894c7454396d1e29627bf8eb038 | [
"MIT"
] | null | null | null | import numpy as np
def WaveletPeaks(Pow,Threshold=0.0):
grid = ((Pow[1:-1,1:-1] >= Pow[0:-2,1:-1]) & (Pow[1:-1,1:-1] >= Pow[2:,1:-1])) & ((Pow[1:-1,1:-1] >= Pow[1:-1,0:-2]) & (Pow[1:-1,1:-1] >= Pow[1:-1,2:])) & (Pow[1:-1,1:-1] >= Threshold)
pgrid = np.zeros(Pow.shape,dtype='bool')
pgrid[1:-1,1:-1] = grid
si,ti =... | 32.636364 | 185 | 0.532033 |
9e1f83395baf61c5ea5677f705d97e9a10aa676d | 18,140 | py | Python | tensorflow/python/kernel_tests/transpose_op_test.py | zo7/tensorflow-loomai | 3b77c1f018f6a671a0753f4f2ab2cea16349bb1b | [
"Apache-2.0"
] | 1 | 2017-10-09T08:33:36.000Z | 2017-10-09T08:33:36.000Z | tensorflow/python/kernel_tests/transpose_op_test.py | zo7/tensorflow-loomai | 3b77c1f018f6a671a0753f4f2ab2cea16349bb1b | [
"Apache-2.0"
] | 1 | 2018-05-04T23:17:25.000Z | 2018-05-04T23:17:25.000Z | tensorflow/python/kernel_tests/transpose_op_test.py | zo7/tensorflow-loomai | 3b77c1f018f6a671a0753f4f2ab2cea16349bb1b | [
"Apache-2.0"
] | 1 | 2020-04-29T20:49:13.000Z | 2020-04-29T20:49:13.000Z | # Copyright 2015 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... | 39.693654 | 80 | 0.590353 |
2b8af182245fadadec0475e0a3fdc285d8470f24 | 1,019 | py | Python | dcgan/discriminator.py | amjack100/DCGAN-Implementation | c25411093dd3e8609e7aac573dc05521cdd664b5 | [
"MIT"
] | null | null | null | dcgan/discriminator.py | amjack100/DCGAN-Implementation | c25411093dd3e8609e7aac573dc05521cdd664b5 | [
"MIT"
] | null | null | null | dcgan/discriminator.py | amjack100/DCGAN-Implementation | c25411093dd3e8609e7aac573dc05521cdd664b5 | [
"MIT"
] | null | null | null | import tensorflow as tf
from tensorflow.keras import layers
def make_discriminator_model(img_size, channel_count: int):
model = tf.keras.Sequential()
model.add(
layers.Conv2D(
64,
(5, 5),
strides=(2, 2),
padding="same",
input_shape=[img_size,... | 28.305556 | 73 | 0.658489 |
440e29c82ae24020b31e1dae00c1f15ef14c2f82 | 9,165 | py | Python | nova/tests/functional/compute/test_live_migration.py | wangyc666666/ussuri_nova | 0706b514f288216c41d64e98524ef7e517efb8d8 | [
"Apache-2.0"
] | null | null | null | nova/tests/functional/compute/test_live_migration.py | wangyc666666/ussuri_nova | 0706b514f288216c41d64e98524ef7e517efb8d8 | [
"Apache-2.0"
] | null | null | null | nova/tests/functional/compute/test_live_migration.py | wangyc666666/ussuri_nova | 0706b514f288216c41d64e98524ef7e517efb8d8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Red Hat, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 41.283784 | 79 | 0.646263 |
5314df3f63297cc6e206474c5b996c98b4ac1dbb | 1,445 | py | Python | axcell/models/linking/utils.py | Kabongosalomon/axcell | f9c74910561f6064a04a10118824c99e871f8a38 | [
"Apache-2.0"
] | 335 | 2020-05-07T19:57:36.000Z | 2022-03-16T07:05:51.000Z | axcell/models/linking/utils.py | doc22940/axcell | b41c1623377d89c3c45a61907f0a47ea029269de | [
"Apache-2.0"
] | 16 | 2020-06-12T16:43:29.000Z | 2021-11-24T11:19:09.000Z | axcell/models/linking/utils.py | doc22940/axcell | b41c1623377d89c3c45a61907f0a47ea029269de | [
"Apache-2.0"
] | 50 | 2020-05-07T20:35:18.000Z | 2022-02-16T06:37:31.000Z | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
from unidecode import unidecode
import re
# cleaning & normalization
parens_re = re.compile(r"\([^)]*?\)|\[[^]]*?\]")
strip_nonalnum_re = re.compile(r"^\W*(\w.*\b)\W*$")
def strip_nonalnum(s):
m = strip_nonalnum_re.match(s)
if m:
... | 25.350877 | 75 | 0.651211 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.