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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b4e7b46ffcd23585b3bbbc18f55ec72d8a164224 | 7,050 | py | Python | tests/python/kaolin/io/test_materials.py | mlej8/kaolin | 19fd610fff68c4d9ad9035386b76e6fd51b0b67c | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-08-28T23:26:19.000Z | 2021-08-28T23:26:19.000Z | tests/python/kaolin/io/test_materials.py | mlej8/kaolin | 19fd610fff68c4d9ad9035386b76e6fd51b0b67c | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | tests/python/kaolin/io/test_materials.py | mlej8/kaolin | 19fd610fff68c4d9ad9035386b76e6fd51b0b67c | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019-2020, NVIDIA CORPORATION. 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 a... | 44.620253 | 109 | 0.653901 |
c9fc627d31be3ef3ae78534099b183a9aab0452d | 3,021 | py | Python | plugins/python/container/fn/execute/main.py | proglang/servercodetest | f0acd5940a22be9a72a95494afb308bb3017ea64 | [
"MIT"
] | null | null | null | plugins/python/container/fn/execute/main.py | proglang/servercodetest | f0acd5940a22be9a72a95494afb308bb3017ea64 | [
"MIT"
] | 2 | 2020-06-05T16:24:37.000Z | 2020-11-15T09:02:48.000Z | plugins/python/container/fn/execute/main.py | proglang/servercodetest | f0acd5940a22be9a72a95494afb308bb3017ea64 | [
"MIT"
] | 1 | 2020-10-22T05:46:52.000Z | 2020-10-22T05:46:52.000Z | import util
import util.random
import os
import json
from .struct import Output, Text, Mark
import logging
class Main:
def __init__(
self, _dir: str, globalSettings: "GlobalSettings",
):
from plugin import GlobalSettings
self.dir = _dir
self.delimiter = "DATA_" + util.random.str... | 33.566667 | 85 | 0.553128 |
a6ae555dd7aef7d67207803294aec6f50f031d62 | 63 | py | Python | quickfix_doc/datadictionary/__init__.py | connamara/QuickFIX-doc | fa75e27dfada2da12148e9ea67d0ceb6a31f1d46 | [
"DOC"
] | 3 | 2018-12-25T19:49:56.000Z | 2021-07-17T01:41:08.000Z | quickfix_doc/datadictionary/__init__.py | connamara/QuickFIX-doc | fa75e27dfada2da12148e9ea67d0ceb6a31f1d46 | [
"DOC"
] | 1 | 2018-12-07T20:53:31.000Z | 2018-12-07T20:53:31.000Z | quickfix_doc/datadictionary/__init__.py | connamara/QuickFIX-doc | fa75e27dfada2da12148e9ea67d0ceb6a31f1d46 | [
"DOC"
] | 3 | 2020-05-21T03:07:19.000Z | 2021-07-18T03:07:06.000Z | from . import util
from . import fields
from . import messages
| 15.75 | 22 | 0.761905 |
cc6df68f970a3d2bf908e82bda259f22db16094d | 1,315 | py | Python | setup.py | jgstew/file_meta_data | 184a3785560c4c18b8c04094481d456466eeba51 | [
"Apache-2.0"
] | null | null | null | setup.py | jgstew/file_meta_data | 184a3785560c4c18b8c04094481d456466eeba51 | [
"Apache-2.0"
] | null | null | null | setup.py | jgstew/file_meta_data | 184a3785560c4c18b8c04094481d456466eeba51 | [
"Apache-2.0"
] | null | null | null | """
py2app/py2exe build script for MyApplication.
Will automatically ensure that all build prerequisites are available
via ez_setup
Usage (Mac OS X):
python setup.py py2app
Usage (Windows):
python setup.py py2exe
"""
# https://pythonhosted.org/py2app/examples.html#cross-platform
import os
import urllib
... | 25.288462 | 90 | 0.681369 |
2d9d9c421365c1c9bbaa499e2cdd4cfbe9f1b3fc | 342 | py | Python | trakt/core/decorators.py | jmolinski/traktpy | e6ff22acaf273b7b45070a4f8938c210fe4d63d7 | [
"MIT"
] | null | null | null | trakt/core/decorators.py | jmolinski/traktpy | e6ff22acaf273b7b45070a4f8938c210fe4d63d7 | [
"MIT"
] | 1 | 2019-04-13T10:15:48.000Z | 2019-04-13T10:15:48.000Z | trakt/core/decorators.py | jmolinski/traktpy | e6ff22acaf273b7b45070a4f8938c210fe4d63d7 | [
"MIT"
] | null | null | null | from typing import Any, Callable
from trakt.core.exceptions import NotAuthenticated
def auth_required(f: Callable[..., Any]) -> Callable[..., Any]:
def wrapper(self: Any, *args: Any, **kwargs: Any) -> Any:
if not self.client.user:
raise NotAuthenticated
return f(self, *args, **kwargs... | 24.428571 | 63 | 0.646199 |
0f553fbf39b7fe7f088e0ea6cbd4f21167ba9da8 | 14,112 | py | Python | supervisor/supervisord.py | sfriesel/supervisor | aa7d40e2949043ece15f972a23b28055c687f6fa | [
"ZPL-2.1"
] | 2 | 2017-09-17T21:24:44.000Z | 2019-08-26T03:02:43.000Z | supervisor/supervisord.py | sfriesel/supervisor | aa7d40e2949043ece15f972a23b28055c687f6fa | [
"ZPL-2.1"
] | null | null | null | supervisor/supervisord.py | sfriesel/supervisor | aa7d40e2949043ece15f972a23b28055c687f6fa | [
"ZPL-2.1"
] | 3 | 2021-02-23T08:36:03.000Z | 2021-02-23T08:36:54.000Z | #!/usr/bin/env python
"""supervisord -- run a set of applications as daemons.
Usage: %s [options]
Options:
-c/--configuration FILENAME -- configuration file
-n/--nodaemon -- run in the foreground (same as 'nodaemon true' in config file)
-h/--help -- print this usage message and exit
-v/--version -- print supervisord... | 37.531915 | 79 | 0.581633 |
29fb03591fc5cf4903893860eb21b0af3b10b561 | 363 | py | Python | test/acceptance/squad_test/squad_test.py | guillaume-chevalier/ReuBERT | 86f115f651e0613047a7e319fdb0a5d9ec6f9292 | [
"MIT"
] | 48 | 2019-04-27T01:26:18.000Z | 2022-03-21T08:01:06.000Z | test/acceptance/squad_test/squad_test.py | h2k/ReuBERT | 86f115f651e0613047a7e319fdb0a5d9ec6f9292 | [
"MIT"
] | 4 | 2019-04-27T01:05:31.000Z | 2020-03-06T00:25:37.000Z | test/acceptance/squad_test/squad_test.py | h2k/ReuBERT | 86f115f651e0613047a7e319fdb0a5d9ec6f9292 | [
"MIT"
] | 12 | 2019-04-21T04:53:49.000Z | 2020-08-13T08:02:16.000Z | import json
import os
def load_json_file_test(json_name):
with open(os.path.join(os.path.dirname(os.path.realpath(__file__)), json_name), encoding="utf8") as json_data:
return json.load(json_data)
SQUAD_DATA_SET = load_json_file_test('squad_questions_beautified.json')
class TestSquad():
@classmet... | 20.166667 | 114 | 0.732782 |
df9fb98db1faef9ced0dd7ef2d1900e6fb4f23fc | 641 | py | Python | tests/Exscript/servers/TelnetdTest.py | saveshodhan/exscript | 72718eee3e87b345d5a5255be9824e867e42927b | [
"MIT"
] | 226 | 2015-01-20T19:59:06.000Z | 2022-01-02T11:13:01.000Z | tests/Exscript/servers/TelnetdTest.py | saveshodhan/exscript | 72718eee3e87b345d5a5255be9824e867e42927b | [
"MIT"
] | 155 | 2015-01-02T07:56:27.000Z | 2022-01-09T20:56:19.000Z | tests/Exscript/servers/TelnetdTest.py | saveshodhan/exscript | 72718eee3e87b345d5a5255be9824e867e42927b | [
"MIT"
] | 114 | 2015-01-03T11:48:17.000Z | 2022-01-26T02:50:43.000Z | from __future__ import absolute_import
import sys
import unittest
import re
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..'))
from .ServerTest import ServerTest
from Exscript.servers import Telnetd
from Exscript.protocols import Telnet
class TelnetdTest(ServerTest):
CORRELATE = Te... | 23.740741 | 71 | 0.74103 |
9dc319f96ecbdc44d9fa5f4ecce47d159904af36 | 1,497 | py | Python | tests/test_summary_via_file.py | svven/summary | 1cd7cb9ab89782c729bfd768df0c6d1483131dc3 | [
"MIT"
] | 12 | 2015-10-15T13:27:27.000Z | 2020-02-22T05:38:33.000Z | tests/test_summary_via_file.py | svven/summary | 1cd7cb9ab89782c729bfd768df0c6d1483131dc3 | [
"MIT"
] | 10 | 2015-01-09T13:37:06.000Z | 2021-12-13T19:45:35.000Z | tests/test_summary_via_file.py | svven/summary | 1cd7cb9ab89782c729bfd768df0c6d1483131dc3 | [
"MIT"
] | 3 | 2015-12-19T07:42:21.000Z | 2020-04-03T14:44:38.000Z | import ssl
from summary import Summary
import os
def test_summary():
testdata = get_test_data()
passed = 0
failed = 0
errors = ""
print ssl.OPENSSL_VERSION
for line in testdata:
if line.startswith('url') or line.strip().startswith('#') or not line.strip():
continue
... | 28.245283 | 86 | 0.540414 |
a4d233e12d4f006ce1fb63091523ee887f14970b | 527 | py | Python | dynet_modules/call_mlp.py | saikrishnarallabandi/clustergen_steroids | b05adb2a5570d5372c6197e045ba3d0bce1a094f | [
"Apache-2.0"
] | null | null | null | dynet_modules/call_mlp.py | saikrishnarallabandi/clustergen_steroids | b05adb2a5570d5372c6197e045ba3d0bce1a094f | [
"Apache-2.0"
] | null | null | null | dynet_modules/call_mlp.py | saikrishnarallabandi/clustergen_steroids | b05adb2a5570d5372c6197e045ba3d0bce1a094f | [
"Apache-2.0"
] | null | null | null | from MLP import OneLayerMLP
import dynet as dy
m = dy.ParameterCollection()
# create an embedding table.
E = m.add_lookup_parameters((1000,10))
# create an MLP from 10 to 4 with a hidden layer of 20.
mlp = OneLayerMLP(m, 10, 20, 4, dy.rectify)
# use them together.
output = mlp(E[3])
# now save the model:
dy.save("ba... | 22.913043 | 62 | 0.711575 |
1026589e0b0904883b1244fea3be1b932f6c4886 | 40,984 | py | Python | srdense/proj_utils/local_utils.py | ypxie/SuperRes | 1dded37fc24d99ca32cef88e8ccc3f2f0a3738c1 | [
"MIT"
] | 5 | 2019-01-04T06:50:18.000Z | 2019-02-13T12:02:24.000Z | srdense/proj_utils/local_utils.py | ypxie/SuperRes | 1dded37fc24d99ca32cef88e8ccc3f2f0a3738c1 | [
"MIT"
] | null | null | null | srdense/proj_utils/local_utils.py | ypxie/SuperRes | 1dded37fc24d99ca32cef88e8ccc3f2f0a3738c1 | [
"MIT"
] | 1 | 2019-08-24T20:56:53.000Z | 2019-08-24T20:56:53.000Z | # -*- coding: utf-8 -*-
import numpy as np
import os, math
from PIL import Image
from sklearn.neighbors import NearestNeighbors
import scipy
import matplotlib.pyplot as plt
from sklearn.utils import shuffle
import skimage, skimage.morphology
from PIL import Image, ImageDraw
from scipy.ndimage.interpolation import rot... | 39.294343 | 126 | 0.604821 |
be7193418e82fd004543a486f68be4da0a2b55fe | 49,106 | py | Python | pandas/tseries/index.py | ContinuumIO/pandas | 1fb318d605c4587c68d7dcb3ab9f673a8ad7bbca | [
"BSD-2-Clause"
] | 10 | 2015-07-21T06:35:13.000Z | 2021-10-30T00:15:05.000Z | pandas/tseries/index.py | aflaxman/pandas | cbe91d73dacf46a36cadd2a7901c4d97a566c080 | [
"BSD-2-Clause"
] | null | null | null | pandas/tseries/index.py | aflaxman/pandas | cbe91d73dacf46a36cadd2a7901c4d97a566c080 | [
"BSD-2-Clause"
] | 5 | 2017-05-28T05:31:12.000Z | 2020-09-01T03:08:01.000Z | # pylint: disable=E1101
import operator
from datetime import time, datetime
from datetime import timedelta
import numpy as np
from pandas.core.common import isnull
from pandas.core.index import Index, Int64Index
from pandas.tseries.frequencies import infer_freq, to_offset, get_period_alias
from pandas.tseries.offset... | 31.397698 | 87 | 0.562884 |
79a42e8160e6fe029ad55fac737fdd52c1abded1 | 686 | py | Python | dpsniper/probability/binomial_cdf.py | barryZZJ/dp-sniper | 71a3fc06f3fc319b023bde9aad8f05b8c5a47a80 | [
"MIT"
] | 13 | 2021-03-30T15:39:35.000Z | 2022-02-21T08:30:45.000Z | dpsniper/probability/binomial_cdf.py | barryZZJ/dp-sniper | 71a3fc06f3fc319b023bde9aad8f05b8c5a47a80 | [
"MIT"
] | null | null | null | dpsniper/probability/binomial_cdf.py | barryZZJ/dp-sniper | 71a3fc06f3fc319b023bde9aad8f05b8c5a47a80 | [
"MIT"
] | 4 | 2021-06-30T08:37:45.000Z | 2022-03-05T03:21:14.000Z | from scipy.stats import beta
def lcb(n: int, k: int, alpha: float):
"""
Computes a lower confidence bound on the probability parameter p of a binomial CDF.
Returns:
The largest p such that Pr[Binom[n,p] >= k] <= alpha
"""
if k == 0:
return 0
else:
# Inspired by https://en.wikipedia.org/wiki/Binomial_prop... | 23.655172 | 118 | 0.685131 |
273fb3e4ee46174a184464b9476d61666d7c3d9a | 1,655 | py | Python | package/spack-r-rvcheck/package.py | ctuning/ck-spack | 307934efce1be2d4f104251275c82fbc70127105 | [
"BSD-3-Clause"
] | 1 | 2018-07-17T07:45:09.000Z | 2018-07-17T07:45:09.000Z | package/spack-r-rvcheck/package.py | ctuning/ck-spack | 307934efce1be2d4f104251275c82fbc70127105 | [
"BSD-3-Clause"
] | null | null | null | package/spack-r-rvcheck/package.py | ctuning/ck-spack | 307934efce1be2d4f104251275c82fbc70127105 | [
"BSD-3-Clause"
] | null | null | null | ##############################################################################
# Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | 44.72973 | 78 | 0.675529 |
21c61a38dbf58850ca84e32846842f4730ad5c1b | 9,436 | py | Python | tests/test_sign_config.py | Luci2015/user-sync.py | e0d08e5170fb66d054182bded2219e30c33b9d46 | [
"MIT"
] | 82 | 2017-02-25T00:41:37.000Z | 2022-02-21T04:30:23.000Z | tests/test_sign_config.py | Luci2015/user-sync.py | e0d08e5170fb66d054182bded2219e30c33b9d46 | [
"MIT"
] | 562 | 2017-01-20T20:50:31.000Z | 2022-03-29T21:07:59.000Z | tests/test_sign_config.py | Luci2015/user-sync.py | e0d08e5170fb66d054182bded2219e30c33b9d46 | [
"MIT"
] | 81 | 2017-02-06T13:16:38.000Z | 2022-03-15T16:46:20.000Z | import logging
import pytest
from user_sync.config.sign_sync import SignConfigLoader
from user_sync.config.user_sync import DictConfig
from user_sync.engine.common import AdobeGroup
from user_sync.engine.sign import SignSyncEngine
from user_sync.error import AssertionException
@pytest.fixture
def modify_sign_config(... | 47.898477 | 158 | 0.719055 |
a9189a83593a5271523b2653606726c8c6d2789e | 2,604 | py | Python | fonts/FreeSansBold11pt7b.py | cnobile2012/Python-TFT | 812a87e6f694eae338c3d9579ea98eae636f8f99 | [
"MIT"
] | null | null | null | fonts/FreeSansBold11pt7b.py | cnobile2012/Python-TFT | 812a87e6f694eae338c3d9579ea98eae636f8f99 | [
"MIT"
] | null | null | null | fonts/FreeSansBold11pt7b.py | cnobile2012/Python-TFT | 812a87e6f694eae338c3d9579ea98eae636f8f99 | [
"MIT"
] | null | null | null | FreeSansBold11pt7bBitmaps = [
0x30, 0x63, 0xFF, 0xE3, 0x8D, 0x12, 0x00, 0x0E, 0x01, 0xC0, 0x38, 0x07,
0x0F, 0xFF, 0xFF, 0xC3, 0x80, 0x70, 0x0E, 0x01, 0xC0, 0xFF, 0xF3, 0x36,
0xC0, 0xFF, 0xFF, 0xC0, 0xFF, 0xF0, 0x04, 0x30, 0x82, 0x18, 0x61, 0x04,
0x30, 0x82, 0x18, 0x61, 0x04, 0x30, 0x1E, 0x1F, 0xE7, 0xFB... | 54.25 | 75 | 0.515745 |
9e7240d0b6bf129de743871d1507a3f3807c2898 | 449 | py | Python | apps/Utils/logger.py | vikkyB2/UserMaintenance | 0ae9db17d694ae67ac82145524cae4a1f69d54c6 | [
"MIT"
] | null | null | null | apps/Utils/logger.py | vikkyB2/UserMaintenance | 0ae9db17d694ae67ac82145524cae4a1f69d54c6 | [
"MIT"
] | null | null | null | apps/Utils/logger.py | vikkyB2/UserMaintenance | 0ae9db17d694ae67ac82145524cae4a1f69d54c6 | [
"MIT"
] | null | null | null | import logging
c_handler = logging.StreamHandler()
f_handler = logging.FileHandler("logFile.log")
c_format = logging.Formatter('%(name)s - %(levelname)s - %(message)s')
f_format = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s')
c_handler.setFormatter(c_format)
f_handler.setFormatte... | 29.933333 | 85 | 0.717149 |
f220086232d46bec2d0f3b6df1b0f12793dbd1b8 | 6,687 | py | Python | wagtail/wagtailimages/south_migrations/0004_auto__chg_field_rendition_focal_point_key.py | edrex/wagtail | dc1b51a5be1a57f6cb1b90507eea6ab7f2e1affe | [
"BSD-3-Clause"
] | null | null | null | wagtail/wagtailimages/south_migrations/0004_auto__chg_field_rendition_focal_point_key.py | edrex/wagtail | dc1b51a5be1a57f6cb1b90507eea6ab7f2e1affe | [
"BSD-3-Clause"
] | null | null | null | wagtail/wagtailimages/south_migrations/0004_auto__chg_field_rendition_focal_point_key.py | edrex/wagtail | dc1b51a5be1a57f6cb1b90507eea6ab7f2e1affe | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# remove duplicate renditions
db... | 69.65625 | 193 | 0.581576 |
eaba76e7dd89e9368b352b58dc28b89fa7d247e2 | 9,845 | py | Python | pybind/nos/v7_1_0/interface/hundredgigabitethernet/ip/interface_fo_ospf_conf/ospf_interface_config/authentication_key/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/nos/v7_1_0/interface/hundredgigabitethernet/ip/interface_fo_ospf_conf/ospf_interface_config/authentication_key/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/nos/v7_1_0/interface/hundredgigabitethernet/ip/interface_fo_ospf_conf/ospf_interface_config/authentication_key/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | 1 | 2021-11-05T22:15:42.000Z | 2021-11-05T22:15:42.000Z |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | 61.53125 | 501 | 0.74901 |
fc65b553689f2e2174a314db45a2cf75637aa60a | 84 | py | Python | threeML/utils/data_builders/__init__.py | Husky22/threeML | 2ef3401e3edf82ceffd85ad0a9ea9e8b2bba3520 | [
"BSD-3-Clause"
] | null | null | null | threeML/utils/data_builders/__init__.py | Husky22/threeML | 2ef3401e3edf82ceffd85ad0a9ea9e8b2bba3520 | [
"BSD-3-Clause"
] | null | null | null | threeML/utils/data_builders/__init__.py | Husky22/threeML | 2ef3401e3edf82ceffd85ad0a9ea9e8b2bba3520 | [
"BSD-3-Clause"
] | null | null | null | from .time_series_builder import TimeSeriesBuilder
__all__ = ['TimeSeriesBuilder']
| 21 | 50 | 0.833333 |
5cbd9dcbfc4d66f47e630ee364bd7c4f91a2359a | 1,370 | py | Python | gwinc/squeeze.py | Jonjocarts/LION-Public | e6c8d7475e4f883dbb268bf6f028bbc378540ab3 | [
"Unlicense"
] | null | null | null | gwinc/squeeze.py | Jonjocarts/LION-Public | e6c8d7475e4f883dbb268bf6f028bbc378540ab3 | [
"Unlicense"
] | null | null | null | gwinc/squeeze.py | Jonjocarts/LION-Public | e6c8d7475e4f883dbb268bf6f028bbc378540ab3 | [
"Unlicense"
] | 1 | 2021-06-23T04:51:20.000Z | 2021-06-23T04:51:20.000Z | from numpy import pi, sqrt
from . import const
def sql(ifo):
"""Computer standard quantum limit (SQL) for IFO"""
c = const.c
Parm = ifo.gwinc.parm
w0 = 2 * pi * c / ifo.Laser.Wavelength
m = ifo.Materials.MirrorMass
Titm = ifo.Optics.ITM.Transmittance
Tsrm = ifo.Optics.SRM.Transmittance
... | 26.346154 | 93 | 0.611679 |
fd468616ea41593bae85d00a0073df5d117c439d | 100 | py | Python | src/download.py | gitter-badger/video-dl | 50270766390d4ddc57a872492c76adf0e1d64324 | [
"Apache-2.0"
] | null | null | null | src/download.py | gitter-badger/video-dl | 50270766390d4ddc57a872492c76adf0e1d64324 | [
"Apache-2.0"
] | null | null | null | src/download.py | gitter-badger/video-dl | 50270766390d4ddc57a872492c76adf0e1d64324 | [
"Apache-2.0"
] | null | null | null | """Used for test scripts."""
from video_dl.entry import main
if __name__ == '__main__':
main()
| 16.666667 | 31 | 0.67 |
aff74b03bb9af494930f0a46f6a1457db02719f7 | 591 | py | Python | post/views.py | Mansouroopi/nested-objects | 55c7984e1eefd9030119197feb2f52238ed212a5 | [
"MIT"
] | null | null | null | post/views.py | Mansouroopi/nested-objects | 55c7984e1eefd9030119197feb2f52238ed212a5 | [
"MIT"
] | null | null | null | post/views.py | Mansouroopi/nested-objects | 55c7984e1eefd9030119197feb2f52238ed212a5 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from rest_framework import generics
from post.models import BlogPost as Post, Tag
from post.serializers import PostSerializer
class PostListCreateAPIView(generics.ListCreateAPIView):
queryset = Post.objects.all()
serializer_class = PostSerializer
def perform_create(se... | 23.64 | 64 | 0.76819 |
dcf47b732401f1cb962212a9ee406d900cc91d83 | 3,640 | py | Python | substringMappingStructures.py | jcavalieri8619/OCRerror_correct | bd7b96139a2b90cda5957eff75f516a31b052b3a | [
"MIT"
] | 3 | 2018-03-12T07:31:12.000Z | 2018-09-12T02:14:56.000Z | substringMappingStructures.py | jcavalieri8619/OCRerror_correct | bd7b96139a2b90cda5957eff75f516a31b052b3a | [
"MIT"
] | null | null | null | substringMappingStructures.py | jcavalieri8619/OCRerror_correct | bd7b96139a2b90cda5957eff75f516a31b052b3a | [
"MIT"
] | null | null | null | __author__ = 'jcavalie'
def subgroups( my_list ):
for each_tuple in (lambda p, f = lambda n, g:
{ (x,) + y for x in range( 1, n ) for y in g( n - x, g ) } | { (n,) }:
f( p, f ))( len( my_list ) ):
yield list( my_list[ sum( each_tuple[ :index ] ):sum( each_tuple[ :index ] ) +... | 33.090909 | 116 | 0.586813 |
14b8358b7e45d4dca1901581f4631775f6db6370 | 4,932 | py | Python | get_positions.py | smoe/mCaller | e83333e03dea2df2844a9d9c7bfc3f475cd3c863 | [
"MIT"
] | 37 | 2017-04-25T20:29:02.000Z | 2022-02-21T11:33:04.000Z | get_positions.py | smoe/mCaller | e83333e03dea2df2844a9d9c7bfc3f475cd3c863 | [
"MIT"
] | 33 | 2017-07-31T04:16:01.000Z | 2022-02-19T16:22:58.000Z | get_positions.py | smoe/mCaller | e83333e03dea2df2844a9d9c7bfc3f475cd3c863 | [
"MIT"
] | 17 | 2017-08-23T00:28:08.000Z | 2021-09-08T13:33:05.000Z | #!/usr/bin/env python
import sys
import numpy as np
from Bio import SeqIO
from scipy import stats
from scipy.cluster.hierarchy import fcluster,linkage
import scipy.spatial.distance as ssd
from extract_contexts import revcomp
from plotlib import plot_w_labels
import os
import pandas as pd
def make_pos_set(pos_list):
... | 52.468085 | 189 | 0.694039 |
a300ee9b4cd90b679d016b72390c6fdad3013950 | 462 | py | Python | src/Server/util/MulticastAddressGenerator.py | Jictyvoo/TEC502-2018.1--English-Dictionary-Game | a775e5ca7853f87466dd478b9dbc4762c3d111c4 | [
"MIT"
] | null | null | null | src/Server/util/MulticastAddressGenerator.py | Jictyvoo/TEC502-2018.1--English-Dictionary-Game | a775e5ca7853f87466dd478b9dbc4762c3d111c4 | [
"MIT"
] | null | null | null | src/Server/util/MulticastAddressGenerator.py | Jictyvoo/TEC502-2018.1--English-Dictionary-Game | a775e5ca7853f87466dd478b9dbc4762c3d111c4 | [
"MIT"
] | null | null | null | class MulticastAddressGenerator:
def __init__(self):
self.__group_ip = "224.0.0."
self.__current_last_ip = 0
def __end_last_ip(self):
return self.__current_last_ip >= 255
def get_next_group(self):
if self.__end_last_ip():
self.__current_last_ip = 0
retur... | 30.8 | 67 | 0.664502 |
29be2f07b7e9e208480355ee1e57324fe5a1d1a0 | 11,080 | py | Python | examples/MoorPy_Example.py | marcellyteixeira/projeto | 1acb1a60413e4ebb5aa3a88d32eccb5ecc926480 | [
"BSD-3-Clause"
] | 6 | 2021-02-19T00:03:34.000Z | 2022-03-10T07:49:25.000Z | examples/MoorPy_Example.py | marcellyteixeira/projeto | 1acb1a60413e4ebb5aa3a88d32eccb5ecc926480 | [
"BSD-3-Clause"
] | 1 | 2021-04-29T20:00:22.000Z | 2021-04-29T20:00:22.000Z | examples/MoorPy_Example.py | marcellyteixeira/projeto | 1acb1a60413e4ebb5aa3a88d32eccb5ecc926480 | [
"BSD-3-Clause"
] | 7 | 2021-02-19T00:04:00.000Z | 2022-03-25T07:58:21.000Z | # --------------------------------------------------------------------------------------------
# MoorPy
#
# A mooring system visualizer and quasi-static modeler in Python.
# Matt Hall and Stein Housner
#
# ---------------------------------------------------... | 34.625 | 197 | 0.666065 |
9f9a0fa84698c2fd4bddbfc8238fad4c9fd03ec4 | 999 | py | Python | load_plugins.py | personGithubAccount/WitheredBot | 2b25a1da7796e94ff8e54f58adbf2e07e46e8bd4 | [
"MIT"
] | 2 | 2021-11-10T21:39:34.000Z | 2021-11-11T13:43:40.000Z | load_plugins.py | personGithubAccount/WitheredBot | 2b25a1da7796e94ff8e54f58adbf2e07e46e8bd4 | [
"MIT"
] | null | null | null | load_plugins.py | personGithubAccount/WitheredBot | 2b25a1da7796e94ff8e54f58adbf2e07e46e8bd4 | [
"MIT"
] | null | null | null | # [loads plugins if any]
from importlib import import_module
from os import listdir
import time
from libs.extras import print
class LoadPlugin:
def __init__(self, bot):
self.bot = bot
def load_plugin(self):
load_time = 0
loaded = []
for file in listdir("./plugins"):
... | 33.3 | 84 | 0.517518 |
a36623e51c4241dc0d43cc8e63b7c6e1e6f2b906 | 1,020 | py | Python | setup.py | cedadev/abcunit-backend | 2cc519c290e990b2db1e3f7666b7f429532f271b | [
"BSD-2-Clause"
] | null | null | null | setup.py | cedadev/abcunit-backend | 2cc519c290e990b2db1e3f7666b7f429532f271b | [
"BSD-2-Clause"
] | 11 | 2020-10-28T14:54:25.000Z | 2021-06-22T14:56:14.000Z | setup.py | cedadev/abcunit-backend | 2cc519c290e990b2db1e3f7666b7f429532f271b | [
"BSD-2-Clause"
] | 1 | 2020-10-29T10:11:04.000Z | 2020-10-29T10:11:04.000Z | import os
from setuptools import setup
current_dir = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(current_dir, 'README.rst')).read()
REQUIRES_PYTHON = ">=3.5.0"
VERSION = open(os.path.join(current_dir, 'abcunit_backend', '__init__.py')).readline().split('"')[1]
reqs = [line.strip() for line i... | 29.142857 | 100 | 0.695098 |
7c82d8dcb558f4f2d50161df866039daba883efb | 69 | py | Python | main.py | princesinghtomar/Classic-Brick-Breaker | acf339a1e242342f04ff27d5b0b508a87cf88014 | [
"MIT"
] | null | null | null | main.py | princesinghtomar/Classic-Brick-Breaker | acf339a1e242342f04ff27d5b0b508a87cf88014 | [
"MIT"
] | null | null | null | main.py | princesinghtomar/Classic-Brick-Breaker | acf339a1e242342f04ff27d5b0b508a87cf88014 | [
"MIT"
] | null | null | null | from mainrunning import *
if __name__ == "__main__":
Run().Go() | 17.25 | 26 | 0.637681 |
4f73d62f1f21c9be5a651aab19f0775458f14a03 | 303 | py | Python | Python/pipes/client.py | Suraj-Rajesh/code | 3d554c4d1d5cf4bd9d084b8034641c1f6c2a47c9 | [
"MIT"
] | null | null | null | Python/pipes/client.py | Suraj-Rajesh/code | 3d554c4d1d5cf4bd9d084b8034641c1f6c2a47c9 | [
"MIT"
] | null | null | null | Python/pipes/client.py | Suraj-Rajesh/code | 3d554c4d1d5cf4bd9d084b8034641c1f6c2a47c9 | [
"MIT"
] | null | null | null | import os, time, sys
pipe = '/var/tmp/simple_pipe'
def client():
no = 1
pipeout = open(pipe, 'w')
pipeout.write('Number %03d\n' % no)
####### Alternate ########
# pipeout = os.open(pipe, os.O_WRONLY)
# os.write(pipeout, 'Number %03d\n' % no)
if __name__ == '__main__':
client()
| 17.823529 | 43 | 0.574257 |
bb8fcbdf4b84c6b9e92bdee97ec1f1533a52ef4e | 1,621 | py | Python | profiles_api/models.py | NikhilNB24/PROFILES-REST-API | c37c3666f46b8a8d8444ee08be30aa2620a118f1 | [
"MIT"
] | null | null | null | profiles_api/models.py | NikhilNB24/PROFILES-REST-API | c37c3666f46b8a8d8444ee08be30aa2620a118f1 | [
"MIT"
] | null | null | null | profiles_api/models.py | NikhilNB24/PROFILES-REST-API | c37c3666f46b8a8d8444ee08be30aa2620a118f1 | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import AbstractBaseUser
from django.contrib.auth.models import PermissionsMixin
from django.contrib.auth.models import BaseUserManager
class UserProfileManager(BaseUserManager):
"""Manager foruser profiles"""
def create_user(self, email, name, pass... | 29.472727 | 63 | 0.676743 |
b5c96ee11ad69d35ed92de6d7006205d96804a78 | 3,325 | py | Python | pyfr/solvers/euler/elements.py | nathan-blanc/PyFR | 8b77eec80707760b529fac2a081abfb5ab8bc916 | [
"BSD-3-Clause"
] | 1 | 2020-02-28T11:40:22.000Z | 2020-02-28T11:40:22.000Z | pyfr/solvers/euler/elements.py | nathan-blanc/PyFR | 8b77eec80707760b529fac2a081abfb5ab8bc916 | [
"BSD-3-Clause"
] | 1 | 2022-02-16T20:44:34.000Z | 2022-02-16T20:44:34.000Z | pyfr/solvers/euler/elements.py | nathan-blanc/PyFR | 8b77eec80707760b529fac2a081abfb5ab8bc916 | [
"BSD-3-Clause"
] | 1 | 2020-04-15T12:38:41.000Z | 2020-04-15T12:38:41.000Z | # -*- coding: utf-8 -*-
from pyfr.solvers.baseadvec import BaseAdvectionElements
class BaseFluidElements(object):
formulations = ['std', 'dual']
privarmap = {2: ['rho', 'u', 'v', 'p'],
3: ['rho', 'u', 'v', 'w', 'p']}
convarmap = {2: ['rho', 'rhou', 'rhov', 'E'],
3: ['r... | 33.585859 | 74 | 0.519398 |
72f60209fd6fc64489d2b3338679ca46a0fa9f50 | 8,290 | py | Python | test/service/test_cart_export_service.py | jessebrennan/azul | 65970a0947f38fae439a3bf8fd960d351787b7a3 | [
"Apache-2.0"
] | null | null | null | test/service/test_cart_export_service.py | jessebrennan/azul | 65970a0947f38fae439a3bf8fd960d351787b7a3 | [
"Apache-2.0"
] | null | null | null | test/service/test_cart_export_service.py | jessebrennan/azul | 65970a0947f38fae439a3bf8fd960d351787b7a3 | [
"Apache-2.0"
] | null | null | null | from unittest import (
TestCase,
skipIf,
)
from unittest.mock import (
patch,
)
import responses
from azul import (
config,
)
from azul.service.cart_export_service import (
CartExportService,
ExpiredAccessTokenError,
)
from azul.service.collection_data_access import (
CollectionDataAccess,... | 51.490683 | 117 | 0.592642 |
699d21cbe7b1ca942f9c17d807afbc8c1f34115d | 436,469 | py | Python | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_subscriber_infra_tmplmgr_cfg.py | CiscoDevNet/ydk-py | 073731fea50694d0bc6cd8ebf10fec308dcc0aa9 | [
"ECL-2.0",
"Apache-2.0"
] | 177 | 2016-03-15T17:03:51.000Z | 2022-03-18T16:48:44.000Z | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_subscriber_infra_tmplmgr_cfg.py | CiscoDevNet/ydk-py | 073731fea50694d0bc6cd8ebf10fec308dcc0aa9 | [
"ECL-2.0",
"Apache-2.0"
] | 18 | 2016-03-30T10:45:22.000Z | 2020-07-14T16:28:13.000Z | cisco-ios-xr/ydk/models/cisco_ios_xr/Cisco_IOS_XR_subscriber_infra_tmplmgr_cfg.py | CiscoDevNet/ydk-py | 073731fea50694d0bc6cd8ebf10fec308dcc0aa9 | [
"ECL-2.0",
"Apache-2.0"
] | 85 | 2016-03-16T20:38:57.000Z | 2022-02-22T04:26:02.000Z | """ Cisco_IOS_XR_subscriber_infra_tmplmgr_cfg
This module contains a collection of YANG definitions
for Cisco IOS\-XR subscriber\-infra\-tmplmgr package configuration.
This module contains definitions
for the following management objects\:
dynamic\-template\: All dynamic template configurations
Copyright (c) 2013... | 48.555902 | 1,548 | 0.482114 |
09b376c0cfab7c53bd66e0801340dd810e6ddf84 | 8,163 | py | Python | Server/src/virtualenv/Lib/site-packages/pip/baseparser.py | ppyordanov/HCI_4_Future_Cities | 4dc7dc59acccf30357bde66524c2d64c29908de8 | [
"MIT"
] | null | null | null | Server/src/virtualenv/Lib/site-packages/pip/baseparser.py | ppyordanov/HCI_4_Future_Cities | 4dc7dc59acccf30357bde66524c2d64c29908de8 | [
"MIT"
] | null | null | null | Server/src/virtualenv/Lib/site-packages/pip/baseparser.py | ppyordanov/HCI_4_Future_Cities | 4dc7dc59acccf30357bde66524c2d64c29908de8 | [
"MIT"
] | null | null | null | """Base option parser setup"""
import sys
import optparse
import os
import textwrap
from distutils.util import strtobool
from pip.backwardcompat import ConfigParser, string_types
from pip.locations import default_config_file
from pip.util import get_terminal_size, get_prog
from pip._vendor import pkg_resources
clas... | 36.28 | 80 | 0.613377 |
05d0ec892eb7d88735b0b0a53269d21b0b13d08f | 451 | py | Python | Program_Python_code/19.py | skyhigh8591/Learning_Test_Program | 5f3c0f11874618919002126863772e0dd06a1072 | [
"MIT"
] | null | null | null | Program_Python_code/19.py | skyhigh8591/Learning_Test_Program | 5f3c0f11874618919002126863772e0dd06a1072 | [
"MIT"
] | null | null | null | Program_Python_code/19.py | skyhigh8591/Learning_Test_Program | 5f3c0f11874618919002126863772e0dd06a1072 | [
"MIT"
] | null | null | null | #! /usr/bin/python
#coding=utf-8
for letter in "python":
print "current letter",letter
fruits = ["banana","apple","mango"]
for fruit in fruits:
print "current letter",fruit
for index in range(len(fruits)):
print index
print "current letter",fruit[index]
#########################
for num in range(1,5):
pr... | 15.033333 | 36 | 0.640798 |
ab6785b57f8bd8c38eac5bd9e3cadde88ca87dec | 4,163 | py | Python | functions/tf_utils/ConvLSTMCell.py | hsokooti/RegNet | 28a8b6132677bb58e9fc811c0dd15d78913c7e86 | [
"Apache-2.0"
] | 187 | 2018-01-08T11:37:12.000Z | 2022-03-03T06:26:43.000Z | functions/tf_utils/ConvLSTMCell.py | hsokooti/RegNet | 28a8b6132677bb58e9fc811c0dd15d78913c7e86 | [
"Apache-2.0"
] | 15 | 2018-01-27T07:12:41.000Z | 2021-08-22T12:37:30.000Z | functions/tf_utils/ConvLSTMCell.py | hsokooti/RegNet | 28a8b6132677bb58e9fc811c0dd15d78913c7e86 | [
"Apache-2.0"
] | 60 | 2018-01-09T13:00:32.000Z | 2021-06-15T03:02:36.000Z | import tensorflow as tf
from tensorflow.python.ops import array_ops
from tensorflow.python.ops import variable_scope as vs
from tensorflow.python.ops.math_ops import sigmoid
from tensorflow.python.ops.math_ops import tanh
from tensorflow.python.ops import init_ops
from tensorflow.python.util import nest
import collec... | 42.479592 | 121 | 0.630074 |
0e5b0c452a781a8a628b4658f26c599909825f52 | 16,282 | py | Python | tests/python/kaolin/ops/spc/test_conv.py | priyasundaresan/kaolin | ddae34ba5f09bffc4368c29bc50491c5ece797d4 | [
"ECL-2.0",
"Apache-2.0"
] | 3,747 | 2019-11-13T02:18:16.000Z | 2022-03-31T21:12:31.000Z | tests/python/kaolin/ops/spc/test_conv.py | priyasundaresan/kaolin | ddae34ba5f09bffc4368c29bc50491c5ece797d4 | [
"ECL-2.0",
"Apache-2.0"
] | 371 | 2019-11-13T14:50:59.000Z | 2022-03-22T19:40:06.000Z | tests/python/kaolin/ops/spc/test_conv.py | priyasundaresan/kaolin | ddae34ba5f09bffc4368c29bc50491c5ece797d4 | [
"ECL-2.0",
"Apache-2.0"
] | 482 | 2019-11-13T05:04:38.000Z | 2022-03-31T10:20:26.000Z | # Copyright (c) 2021 NVIDIA CORPORATION & AFFILIATES.
# All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 47.608187 | 111 | 0.622774 |
56e204768555680b36be83c2e67205a958fcfff9 | 21,930 | py | Python | electrum_ltc/tests/test_blockchain.py | Alcofribas4/electrum-ltc-satochip | e78eba47654d96b3d445c1ecad04de6a74bce153 | [
"MIT"
] | null | null | null | electrum_ltc/tests/test_blockchain.py | Alcofribas4/electrum-ltc-satochip | e78eba47654d96b3d445c1ecad04de6a74bce153 | [
"MIT"
] | 1 | 2021-06-02T00:17:09.000Z | 2021-06-02T00:17:09.000Z | electrum_ltc/tests/test_blockchain.py | geekfil/electrum-ltc | 054347e6d6c03d823d361469772726a68ff459be | [
"MIT"
] | null | null | null | import shutil
import tempfile
import os
from electrum_ltc import constants, blockchain
from electrum_ltc.simple_config import SimpleConfig
from electrum_ltc.blockchain import Blockchain, deserialize_header, hash_header
from electrum_ltc.util import bh2u, bfh, make_dir
from . import SequentialTestCase
class TestBloc... | 64.122807 | 219 | 0.732558 |
7b6479e3edfa67adc171566d59eaba83b33216ed | 7,355 | py | Python | tern/__main__.py | aditi137/tern | 2c216e52bb6fc45842fb664881ae3a049be1fd1a | [
"BSD-2-Clause"
] | null | null | null | tern/__main__.py | aditi137/tern | 2c216e52bb6fc45842fb664881ae3a049be1fd1a | [
"BSD-2-Clause"
] | null | null | null | tern/__main__.py | aditi137/tern | 2c216e52bb6fc45842fb664881ae3a049be1fd1a | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017-2019 VMware, Inc. All Rights Reserved.
# SPDX-License-Identifier: BSD-2-Clause
"""
Tern executable
"""
import argparse
import logging
import os
import sys
from tern.analyze.docker import run
from tern.utils import cache
from tern.utils import con... | 39.331551 | 79 | 0.579062 |
9989b2fd1e776780d8659980cea098db18295dbb | 12,967 | py | Python | insights/parsers/tests/test_modinfo.py | zerodayz/insights-core | fedecee56762282404415d94d492e3c4ef0bc731 | [
"Apache-2.0"
] | null | null | null | insights/parsers/tests/test_modinfo.py | zerodayz/insights-core | fedecee56762282404415d94d492e3c4ef0bc731 | [
"Apache-2.0"
] | null | null | null | insights/parsers/tests/test_modinfo.py | zerodayz/insights-core | fedecee56762282404415d94d492e3c4ef0bc731 | [
"Apache-2.0"
] | null | null | null | import doctest
import pytest
from insights.parsers import modinfo, ParseException, SkipException
from insights.parsers.modinfo import ModInfoI40e, ModInfoVmxnet3, ModInfoIgb, ModInfoIxgbe, ModInfoVeth
from insights.tests import context_wrap
MODINFO_I40E = """
filename: /lib/modules/3.10.0-993.el7.x86_64/kernel/d... | 47.672794 | 150 | 0.689905 |
40d45c54d29486baf750658213d59481b1331d77 | 3,023 | py | Python | projects/plots/line_plot_2D.py | nirdslab/streaminghub | a0d9f5f8be0ee6f090bd2b48b9f596695497c2bf | [
"MIT"
] | null | null | null | projects/plots/line_plot_2D.py | nirdslab/streaminghub | a0d9f5f8be0ee6f090bd2b48b9f596695497c2bf | [
"MIT"
] | null | null | null | projects/plots/line_plot_2D.py | nirdslab/streaminghub | a0d9f5f8be0ee6f090bd2b48b9f596695497c2bf | [
"MIT"
] | 1 | 2020-01-22T15:35:29.000Z | 2020-01-22T15:35:29.000Z | #!/usr/bin/env python3
"""
This command-line executable program accepts a
data-stream name as an input, and generates a
plot for each stream in the data-stream.
It can be used for testing whether a meta-stream
has been correctly used to generate a compliant
data-stream, and also to visualize how different
streams arr... | 27.234234 | 108 | 0.648363 |
130434229e96a96dfacf1fc8b90dc98ef80d9bec | 2,038 | py | Python | Lib/secrets.py | gerph/cpython | 98813cb03c2371789669c3d8debf8fca2a344de9 | [
"CNRI-Python-GPL-Compatible"
] | 11,058 | 2018-05-29T07:40:06.000Z | 2022-03-31T11:38:42.000Z | Lib/secrets.py | gerph/cpython | 98813cb03c2371789669c3d8debf8fca2a344de9 | [
"CNRI-Python-GPL-Compatible"
] | 2,105 | 2018-06-01T10:07:16.000Z | 2022-03-31T14:56:42.000Z | Lib/secrets.py | gerph/cpython | 98813cb03c2371789669c3d8debf8fca2a344de9 | [
"CNRI-Python-GPL-Compatible"
] | 1,933 | 2018-01-15T13:08:40.000Z | 2022-03-31T11:28:59.000Z | """Generate cryptographically strong pseudo-random numbers suitable for
managing secrets such as account authentication, tokens, and similar.
See PEP 506 for more information.
https://www.python.org/dev/peps/pep-0506/
"""
__all__ = ['choice', 'randbelow', 'randbits', 'SystemRandom',
'token_bytes', 'token_... | 27.540541 | 71 | 0.693327 |
b0ca5fdeca78599e75642e122657edfb78cebfe2 | 4,137 | py | Python | agents/n_step_q.py | bluepc2013/deep-rl-tensorflow-master | f25f2529839b0ae0d76439f01131654329bfafd8 | [
"MIT"
] | 29 | 2017-03-30T08:17:01.000Z | 2021-03-15T17:11:51.000Z | agents/n_step_q.py | binderwang/deep-rl-tensorflow | b646c65de0e5e76036c03ea7a4cf71f5b714c34c | [
"MIT"
] | null | null | null | agents/n_step_q.py | binderwang/deep-rl-tensorflow | b646c65de0e5e76036c03ea7a4cf71f5b714c34c | [
"MIT"
] | 11 | 2016-12-17T11:50:12.000Z | 2021-08-23T18:09:30.000Z | import os
import time
import numpy as np
import tensorflow as tf
from logging import getLogger
from .agent import Agent
from .history import History
from .experience import Experience
logger = getLogger(__name__)
class NStepQ(Agent):
def __init__(self, sess, pred_network, env, stat, conf, target_network=None):
... | 35.358974 | 116 | 0.673193 |
71b98f59428322523fe15276f1dd95e05126903b | 1,330 | py | Python | social_auth_ragtag_id/backends.py | RagtagOpen/python-social-auth-ragtag-id | 8d8e005231c09535098136213347934e9da7b3f2 | [
"MIT"
] | null | null | null | social_auth_ragtag_id/backends.py | RagtagOpen/python-social-auth-ragtag-id | 8d8e005231c09535098136213347934e9da7b3f2 | [
"MIT"
] | 3 | 2020-03-24T16:26:22.000Z | 2021-02-02T21:55:45.000Z | social_auth_ragtag_id/backends.py | RagtagOpen/python-social-auth-ragtag-id | 8d8e005231c09535098136213347934e9da7b3f2 | [
"MIT"
] | null | null | null | from social_core.backends.oauth import BaseOAuth2
class RagtagOAuth2(BaseOAuth2):
"""Ragtag ID OAuth authentication backend"""
name = "ragtag"
AUTHORIZATION_URL = "https://id.ragtag.org/oauth/authorize/"
ACCESS_TOKEN_URL = "https://id.ragtag.org/oauth/token/"
ACCESS_TOKEN_METHOD = "POST"
REVO... | 35.945946 | 75 | 0.627068 |
8e85c1b93291aa581c6b6f90d4fc551c1f713881 | 4,279 | py | Python | trajectory/BadaAircraftPerformance/BadaAeroDynamicsFile.py | RobertPastor/flight-profile | bdc3bb9defeb347db26f96f7accd4d06cad1e33b | [
"MIT"
] | null | null | null | trajectory/BadaAircraftPerformance/BadaAeroDynamicsFile.py | RobertPastor/flight-profile | bdc3bb9defeb347db26f96f7accd4d06cad1e33b | [
"MIT"
] | null | null | null | trajectory/BadaAircraftPerformance/BadaAeroDynamicsFile.py | RobertPastor/flight-profile | bdc3bb9defeb347db26f96f7accd4d06cad1e33b | [
"MIT"
] | null | null | null | '''
Created on 6 mars 2015
@author: PASTOR Robert
Written By:
Robert PASTOR
Email: < robert [--DOT--] pastor0691 (--AT--) orange [--DOT--] fr >
http://trajectoire-predict.monsite-orange.fr/
Copyright 2015 Robert PASTOR
This program is free software;... | 39.62037 | 116 | 0.629353 |
0057978c97842ccfd25f2f3dba877544a56eeb29 | 1,023 | py | Python | tests/io/test_read_write.py | awaelchli/torch-optical-flow | 1f48d95b8f3412052f7c35eb2ec1fa7cb739efe1 | [
"MIT"
] | null | null | null | tests/io/test_read_write.py | awaelchli/torch-optical-flow | 1f48d95b8f3412052f7c35eb2ec1fa7cb739efe1 | [
"MIT"
] | null | null | null | tests/io/test_read_write.py | awaelchli/torch-optical-flow | 1f48d95b8f3412052f7c35eb2ec1fa7cb739efe1 | [
"MIT"
] | 1 | 2021-11-14T09:13:03.000Z | 2021-11-14T09:13:03.000Z | from pathlib import Path
import pytest
import torch
from optical_flow.io.read_write import FORMATS, read, write
@pytest.mark.parametrize("fmt", FORMATS)
@pytest.mark.parametrize(
"device",
[
pytest.param(torch.device("cpu")),
pytest.param(
torch.device("cuda", 0),
mar... | 29.228571 | 68 | 0.638319 |
4a9a5485458f40114490dea9660c0f91644822c5 | 90 | py | Python | dist/book/codes/109.py | EManualResource/book-python-basic | a6f9e985b8765f9e8dbc7a0bea82243545d3fa06 | [
"Apache-2.0"
] | null | null | null | dist/book/codes/109.py | EManualResource/book-python-basic | a6f9e985b8765f9e8dbc7a0bea82243545d3fa06 | [
"Apache-2.0"
] | null | null | null | dist/book/codes/109.py | EManualResource/book-python-basic | a6f9e985b8765f9e8dbc7a0bea82243545d3fa06 | [
"Apache-2.0"
] | null | null | null | #coding:utf-8
print "please write your name:"
name=raw_input()
print "Hello,%s"%name
| 9 | 31 | 0.688889 |
f413689eeb720cf93ef02961641a5ffee7dfb333 | 2,216 | py | Python | corehq/apps/users/signals.py | kkrampa/commcare-hq | d64d7cad98b240325ad669ccc7effb07721b4d44 | [
"BSD-3-Clause"
] | 1 | 2020-05-05T13:10:01.000Z | 2020-05-05T13:10:01.000Z | corehq/apps/users/signals.py | kkrampa/commcare-hq | d64d7cad98b240325ad669ccc7effb07721b4d44 | [
"BSD-3-Clause"
] | 1 | 2019-12-09T14:00:14.000Z | 2019-12-09T14:00:14.000Z | corehq/apps/users/signals.py | MaciejChoromanski/commcare-hq | fd7f65362d56d73b75a2c20d2afeabbc70876867 | [
"BSD-3-Clause"
] | 5 | 2015-11-30T13:12:45.000Z | 2019-07-01T19:27:07.000Z | from __future__ import absolute_import
from __future__ import unicode_literals
from django.db.models.signals import post_save
from django.dispatch import receiver, Signal
from django.contrib.auth.signals import user_logged_in
from corehq.elastic import send_to_elasticsearch
commcare_user_post_save = Signal(providing_... | 39.571429 | 97 | 0.774368 |
ab6716921591df6a3c818f7972d4a4de504a6f4d | 8,435 | py | Python | ugali/pipeline/run_05.0_followup.py | SidneyMau/ugali | 2c9d7a8d0aec48f867b868d2663492e08b428f4e | [
"MIT"
] | null | null | null | ugali/pipeline/run_05.0_followup.py | SidneyMau/ugali | 2c9d7a8d0aec48f867b868d2663492e08b428f4e | [
"MIT"
] | null | null | null | ugali/pipeline/run_05.0_followup.py | SidneyMau/ugali | 2c9d7a8d0aec48f867b868d2663492e08b428f4e | [
"MIT"
] | 1 | 2019-07-18T16:42:27.000Z | 2019-07-18T16:42:27.000Z | #!/usr/bin/env python
"""Perform MCMC follow-up fitting."""
import os
from os.path import join,exists,basename,splitext
import shutil
from collections import OrderedDict as odict
from multiprocessing import Pool
import matplotlib
try: os.environ['DISPLAY']
except KeyError: matplotlib.use('Agg')
import nu... | 34.855372 | 150 | 0.620865 |
abad3b5d2c624201bd1f358d40fc91312bf8eb24 | 18,903 | py | Python | jina/peapods/runtimes/zmq/zed.py | soumik2012/jina | 990a51d6a69a40146e6705eb0b8e6caf841a6fcc | [
"Apache-2.0"
] | 2 | 2021-11-01T10:16:45.000Z | 2021-11-08T08:35:44.000Z | jina/peapods/runtimes/zmq/zed.py | soumik2012/jina | 990a51d6a69a40146e6705eb0b8e6caf841a6fcc | [
"Apache-2.0"
] | null | null | null | jina/peapods/runtimes/zmq/zed.py | soumik2012/jina | 990a51d6a69a40146e6705eb0b8e6caf841a6fcc | [
"Apache-2.0"
] | null | null | null | import argparse
import re
import time
from collections import defaultdict
from typing import Dict, List
import zmq
from .base import ZMQRuntime
from ...zmq import ZmqStreamlet
from .... import __default_endpoint__
from ....enums import OnErrorStrategy, SocketType
from ....excepts import (
NoExplicitMessage,
E... | 37.655378 | 140 | 0.621965 |
d3662a53ca9685860f63799a3b38785ac480cf40 | 36,976 | py | Python | tensorflow/python/ops/ragged/row_partition_test.py | joshz123/tensorflow | 7841ca029060ab78e221e757d4b1ee6e3e0ffaa4 | [
"Apache-2.0"
] | 78 | 2020-08-04T12:36:25.000Z | 2022-03-25T04:23:40.000Z | tensorflow/python/ops/ragged/row_partition_test.py | joshz123/tensorflow | 7841ca029060ab78e221e757d4b1ee6e3e0ffaa4 | [
"Apache-2.0"
] | 203 | 2019-06-14T23:53:10.000Z | 2022-02-10T02:27:23.000Z | tensorflow/python/ops/ragged/row_partition_test.py | joshz123/tensorflow | 7841ca029060ab78e221e757d4b1ee6e3e0ffaa4 | [
"Apache-2.0"
] | 28 | 2017-03-25T13:48:09.000Z | 2021-10-14T00:10:50.000Z | # Copyright 2020 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... | 41.221851 | 80 | 0.653262 |
b1474f8c6853107470c7a1ad601a11241665af0d | 1,369 | py | Python | openprocurement/tender/openua/adapters.py | raccoongang/openprocurement.tender.openua | dd2dbddf317bdb4bb38443240faf126765ef48c4 | [
"Apache-2.0"
] | 8 | 2016-01-28T11:37:09.000Z | 2019-03-17T07:18:09.000Z | openprocurement/tender/openua/adapters.py | raccoongang/openprocurement.tender.openua | dd2dbddf317bdb4bb38443240faf126765ef48c4 | [
"Apache-2.0"
] | 70 | 2016-02-11T16:46:22.000Z | 2018-03-19T15:42:16.000Z | openprocurement/tender/openua/adapters.py | raccoongang/openprocurement.tender.openua | dd2dbddf317bdb4bb38443240faf126765ef48c4 | [
"Apache-2.0"
] | 30 | 2016-01-27T10:51:00.000Z | 2019-03-31T15:56:52.000Z | # -*- coding: utf-8 -*-
from openprocurement.tender.core.adapters import TenderConfigurator
from openprocurement.tender.openua.models import Tender
from openprocurement.tender.openua.constants import (
TENDER_PERIOD, TENDERING_EXTRA_PERIOD, STATUS4ROLE,
CLAIM_SUBMIT_TIME, COMPLAINT_SUBMIT_TIME
)
class TenderA... | 41.484848 | 136 | 0.812272 |
7ed92e6c5eaba0cc403cf2ed11fc2f01ca926024 | 1,841 | py | Python | 0121.best-time-to-buy-and-sell-stock/best-time-to-buy-and-sell-stock.py | yangreal1991/my_leetcode_solutions | 18c223d43e204a156f865d813957c5c1b3f2193a | [
"MIT"
] | 1 | 2020-05-24T02:21:46.000Z | 2020-05-24T02:21:46.000Z | 0121.best-time-to-buy-and-sell-stock/best-time-to-buy-and-sell-stock.py | yangreal1991/my_leetcode_solutions | 18c223d43e204a156f865d813957c5c1b3f2193a | [
"MIT"
] | null | null | null | 0121.best-time-to-buy-and-sell-stock/best-time-to-buy-and-sell-stock.py | yangreal1991/my_leetcode_solutions | 18c223d43e204a156f865d813957c5c1b3f2193a | [
"MIT"
] | null | null | null | class Solution:
def __init__(self):
pass
def maxProfit_BF(self, prices):
"""Say you have an array for which the ith element is the price of a given stock on day i.
Find the maximum profit under the constraint that only one transaction is permitted.
Args:
prices: Li... | 24.878378 | 98 | 0.554047 |
71ae23daba79b717a6113918458a7d08ce0a5222 | 628 | py | Python | manage.py | MakingL/CuberBackendApp | 3faebbe2a96fdcc625b5d7f2363ffd8f405f9fd8 | [
"BSD-2-Clause"
] | null | null | null | manage.py | MakingL/CuberBackendApp | 3faebbe2a96fdcc625b5d7f2363ffd8f405f9fd8 | [
"BSD-2-Clause"
] | null | null | null | manage.py | MakingL/CuberBackendApp | 3faebbe2a96fdcc625b5d7f2363ffd8f405f9fd8 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'CuberApp.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise Impor... | 28.545455 | 73 | 0.683121 |
5d4fd0a1b30b390dd788963e84f5a6e05326e59a | 37,248 | py | Python | src/reportlab/graphics/renderPS.py | Gsllchb/reportlab | d1e65947d8b00104004886958ae460a0777e9313 | [
"BSD-3-Clause"
] | null | null | null | src/reportlab/graphics/renderPS.py | Gsllchb/reportlab | d1e65947d8b00104004886958ae460a0777e9313 | [
"BSD-3-Clause"
] | null | null | null | src/reportlab/graphics/renderPS.py | Gsllchb/reportlab | d1e65947d8b00104004886958ae460a0777e9313 | [
"BSD-3-Clause"
] | null | null | null | #Copyright ReportLab Europe Ltd. 2000-2017
#see license.txt for license details
#history https://bitbucket.org/rptlab/reportlab/history-node/tip/src/reportlab/graphics/renderPS.py
__version__='3.3.0'
__doc__="""Render drawing objects in Postscript"""
from reportlab.pdfbase.pdfmetrics import getFont, stringWidth, unico... | 38.92163 | 118 | 0.581159 |
5de6cdcd03211bc02b6a6bc9dc03a85fad99918e | 801 | py | Python | tests/test_cli_opts.py | yxliang01/mythril-classic | 2348c75a5816cb4201ba680b3e0a062d4e467dbc | [
"MIT"
] | 6 | 2021-02-13T05:03:32.000Z | 2021-09-19T14:57:58.000Z | tests/test_cli_opts.py | yxliang01/mythril-classic | 2348c75a5816cb4201ba680b3e0a062d4e467dbc | [
"MIT"
] | 21 | 2019-04-12T17:54:51.000Z | 2021-11-04T18:47:45.000Z | tests/test_cli_opts.py | yxliang01/mythril-classic | 2348c75a5816cb4201ba680b3e0a062d4e467dbc | [
"MIT"
] | 2 | 2020-05-26T15:03:20.000Z | 2021-07-29T09:09:05.000Z | from mythril.interfaces.cli import main
import pytest
import json
import sys
def test_version_opt(capsys):
# Check that "myth --version" returns a string with the word
# "version" in it
sys.argv = ["mythril", "--version"]
with pytest.raises(SystemExit) as pytest_wrapped_e:
main()
assert p... | 29.666667 | 64 | 0.675406 |
dfc5c8a448b306d051d1988df75316b4dda21069 | 1,164 | py | Python | ding/utils/tests/test_log_writer_helper.py | puyuan1996/DI-engine | da99c01e06589033b7412829dc2f2c339083f219 | [
"Apache-2.0"
] | 464 | 2021-07-08T07:26:33.000Z | 2022-03-31T12:35:16.000Z | ding/utils/tests/test_log_writer_helper.py | puyuan1996/DI-engine | da99c01e06589033b7412829dc2f2c339083f219 | [
"Apache-2.0"
] | 177 | 2021-07-09T08:22:55.000Z | 2022-03-31T07:35:22.000Z | ding/utils/tests/test_log_writer_helper.py | puyuan1996/DI-engine | da99c01e06589033b7412829dc2f2c339083f219 | [
"Apache-2.0"
] | 92 | 2021-07-08T12:16:37.000Z | 2022-03-31T09:24:41.000Z | import pytest
import time
import tempfile
import shutil
import os
from os import path
from ding.framework import Parallel
from ding.framework.task import Task
from ding.utils import DistributedWriter
def main_distributed_writer(tempdir):
with Task() as task:
time.sleep(task.router.node_id * 1) # Sleep 0 ... | 29.1 | 106 | 0.670103 |
208ecc61049627b8a82e64ba58dd80711cff1cc5 | 1,195 | py | Python | deepchem/trans/__init__.py | kshen3778/deepchem | 43a79ec9d8ad867211cbf2d5ad079238e4324208 | [
"MIT"
] | null | null | null | deepchem/trans/__init__.py | kshen3778/deepchem | 43a79ec9d8ad867211cbf2d5ad079238e4324208 | [
"MIT"
] | null | null | null | deepchem/trans/__init__.py | kshen3778/deepchem | 43a79ec9d8ad867211cbf2d5ad079238e4324208 | [
"MIT"
] | null | null | null | """
Gathers all transformers in one place for convenient imports
"""
# flake8: noqa
from deepchem.trans.transformers import undo_transforms
from deepchem.trans.transformers import undo_grad_transforms
from deepchem.trans.transformers import Transformer
from deepchem.trans.transformers import LogTransformer
from deepch... | 47.8 | 66 | 0.885356 |
96ecf3b884eb14913dbccf107b3ce240e278ec9c | 2,379 | py | Python | src/ai_harness/inspector.py | aicanhelp/ai-harness | 112303b6d41ba023052863bb716bfa870ede6eee | [
"MIT"
] | null | null | null | src/ai_harness/inspector.py | aicanhelp/ai-harness | 112303b6d41ba023052863bb716bfa870ede6eee | [
"MIT"
] | null | null | null | src/ai_harness/inspector.py | aicanhelp/ai-harness | 112303b6d41ba023052863bb716bfa870ede6eee | [
"MIT"
] | null | null | null | class NoneAttr:
pass
class Inspector:
@staticmethod
def parse_attribute(instance, name, with_type=False, parse=False):
parent = instance
if parse:
attributes = name.split('.')
name = attributes[-1]
for attr in attributes[:-1]:
parent = g... | 32.148649 | 84 | 0.617486 |
fb05819e7412475f029021ebd6612d999aeaf5c3 | 4,729 | py | Python | python/pyspark/__init__.py | rahij/spark | 82721ce00b6cf535abd3d9cd66445e452554d15d | [
"BSD-2-Clause",
"Apache-2.0",
"CC0-1.0",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 4 | 2020-01-17T06:23:43.000Z | 2022-02-05T18:01:45.000Z | python/pyspark/__init__.py | rahij/spark | 82721ce00b6cf535abd3d9cd66445e452554d15d | [
"BSD-2-Clause",
"Apache-2.0",
"CC0-1.0",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 6 | 2020-10-21T13:44:10.000Z | 2022-03-31T05:04:46.000Z | python/pyspark/__init__.py | rahij/spark | 82721ce00b6cf535abd3d9cd66445e452554d15d | [
"BSD-2-Clause",
"Apache-2.0",
"CC0-1.0",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 2 | 2021-10-30T17:13:49.000Z | 2022-03-13T22:26:29.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"); you may not us... | 37.531746 | 98 | 0.716008 |
56a7dcbd6683ac2fdffa04221d062212c043d6c7 | 468 | py | Python | src/storfox_framework/grpc.py | storfox/storfox-framework | ffe8a89cb9abb203d696c6b24467f97834bd92a0 | [
"Apache-2.0"
] | null | null | null | src/storfox_framework/grpc.py | storfox/storfox-framework | ffe8a89cb9abb203d696c6b24467f97834bd92a0 | [
"Apache-2.0"
] | null | null | null | src/storfox_framework/grpc.py | storfox/storfox-framework | ffe8a89cb9abb203d696c6b24467f97834bd92a0 | [
"Apache-2.0"
] | null | null | null | import typing
import asyncio
from grpclib.utils import graceful_exit
from grpclib.server import Server
def run_forever(handlers: typing.List[typing.Any], host, port):
async def start():
server = Server(handlers)
with graceful_exit([server]):
await server.start(host, port)
... | 26 | 63 | 0.673077 |
0f7ba84ffc147b75a5dbc29988263e3ff31b2d4c | 5,543 | py | Python | python/paddle/fluid/tests/custom_op/test_custom_relu_op_jit.py | TochkaAI/Paddle | 481ee79fc92304f33165f7ed0679f16c36862cea | [
"Apache-2.0"
] | 3 | 2021-06-08T14:24:36.000Z | 2021-06-08T14:24:38.000Z | python/paddle/fluid/tests/custom_op/test_custom_relu_op_jit.py | chenyanlei1/Paddle | f249a5f05f0f5832279244d88c8cb4eaaad1fbd4 | [
"Apache-2.0"
] | 1 | 2021-03-17T07:53:43.000Z | 2021-03-17T07:53:43.000Z | python/paddle/fluid/tests/custom_op/test_custom_relu_op_jit.py | chenyanlei1/Paddle | f249a5f05f0f5832279244d88c8cb4eaaad1fbd4 | [
"Apache-2.0"
] | 2 | 2021-02-19T06:42:29.000Z | 2021-02-26T12:16:05.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... | 40.757353 | 98 | 0.587588 |
4a854e4abccacb3f58018fb682c621c44f6ead44 | 1,708 | py | Python | lrp_saturation_test.py | yidinghao/whitebox-lstm | dcdeaf11c8c374d200801791b59c007094f70baf | [
"MIT"
] | 2 | 2020-11-17T21:57:24.000Z | 2021-01-23T13:16:24.000Z | lrp_saturation_test.py | yidinghao/whitebox-lstm | dcdeaf11c8c374d200801791b59c007094f70baf | [
"MIT"
] | null | null | null | lrp_saturation_test.py | yidinghao/whitebox-lstm | dcdeaf11c8c374d200801791b59c007094f70baf | [
"MIT"
] | null | null | null | """
This is the script for running the LRP saturation test. It tries to
determine whether prefixes of counter task inputs with equal numbers of
as and bs receive LRP scores of 0. This test is run with varying levels
of model saturation.
"""
import csv
import numpy as np
from attribution import LRPAttribution
from mod... | 27.548387 | 71 | 0.584309 |
c50a3790e2cc6ed9e1a3fbfb59ca29ea60cf12a7 | 560 | py | Python | test_case_prioritazation/utils/test_data.py | mandriv/test-case-prioritazation | 29bdbe92482e14247042ffc2f619254955fc2bec | [
"MIT"
] | null | null | null | test_case_prioritazation/utils/test_data.py | mandriv/test-case-prioritazation | 29bdbe92482e14247042ffc2f619254955fc2bec | [
"MIT"
] | null | null | null | test_case_prioritazation/utils/test_data.py | mandriv/test-case-prioritazation | 29bdbe92482e14247042ffc2f619254955fc2bec | [
"MIT"
] | null | null | null | def read(filename):
file = open(filename, 'r')
lines = file.readlines()
data = []
for line in lines:
# csv
bits = line.split(',')
# first thing in csv is an identifier
id = bits.pop(0)
# rest are tests
for i in range(len(bits)):
# format each b... | 26.666667 | 63 | 0.5 |
246cf214b8ae7322289bbfa0cbd083beb7817511 | 69,740 | py | Python | test/orm/inheritance/test_relationship.py | gujun4990/sqlalchemy | 057bae2295feb86529a04f09cd2f3d4c2c6d88a8 | [
"MIT"
] | 1 | 2018-04-02T18:41:52.000Z | 2018-04-02T18:41:52.000Z | test/orm/inheritance/test_relationship.py | gujun4990/sqlalchemy | 057bae2295feb86529a04f09cd2f3d4c2c6d88a8 | [
"MIT"
] | null | null | null | test/orm/inheritance/test_relationship.py | gujun4990/sqlalchemy | 057bae2295feb86529a04f09cd2f3d4c2c6d88a8 | [
"MIT"
] | 3 | 2017-09-26T13:59:24.000Z | 2020-12-04T17:51:54.000Z | from sqlalchemy.orm import create_session, relationship, mapper, \
contains_eager, joinedload, subqueryload, subqueryload_all,\
Session, aliased, with_polymorphic, joinedload_all, backref
from sqlalchemy import Integer, String, ForeignKey, select, func
from sqlalchemy.engine import default
from sqlalchemy.tes... | 33.30468 | 81 | 0.550545 |
606f15f45f5209b5298440efecef97d0e3aec73c | 2,000 | py | Python | source/callback/infer_display_style_transfer.py | douglasresende/lambda-deep-learning-demo | ebbbd63c0abf87a1a4155b17cef145039b7a1ef7 | [
"Apache-2.0"
] | 80 | 2018-10-27T15:18:03.000Z | 2022-01-29T16:49:36.000Z | source/callback/infer_display_style_transfer.py | douglasresende/lambda-deep-learning-demo | ebbbd63c0abf87a1a4155b17cef145039b7a1ef7 | [
"Apache-2.0"
] | 4 | 2019-02-11T20:28:35.000Z | 2019-10-03T22:58:10.000Z | source/callback/infer_display_style_transfer.py | douglasresende/lambda-deep-learning-demo | ebbbd63c0abf87a1a4155b17cef145039b7a1ef7 | [
"Apache-2.0"
] | 25 | 2018-11-15T23:34:31.000Z | 2020-09-22T16:21:20.000Z | """
Copyright 2018 Lambda Labs. All Rights Reserved.
Licensed under
==========================================================================
"""
import numpy as np
import matplotlib.pyplot as plt
import tensorflow as tf
from .callback import Callback
class InferDisplayStyleTransfer(Callback):
def __init__(self... | 30.30303 | 77 | 0.633 |
d803890d100279e567be001d6e6d6ea40c28ac30 | 11,979 | py | Python | fastai/basic_data.py | falschparker82/fastai | 371fdbf1f2cb6ffa276237735c205d66c078503a | [
"Apache-2.0"
] | null | null | null | fastai/basic_data.py | falschparker82/fastai | 371fdbf1f2cb6ffa276237735c205d66c078503a | [
"Apache-2.0"
] | null | null | null | fastai/basic_data.py | falschparker82/fastai | 371fdbf1f2cb6ffa276237735c205d66c078503a | [
"Apache-2.0"
] | null | null | null | "`fastai.data` loads and manages datasets with `DataBunch`"
from .torch_core import *
from torch.utils.data.dataloader import default_collate
DatasetType = Enum('DatasetType', 'Train Valid Test Single Fix')
__all__ = ['DataBunch', 'DeviceDataLoader', 'DatasetType']
old_dl_init = torch.utils.data.DataLoader.__init__
... | 48.695122 | 134 | 0.66074 |
348bb2c90274179b057b379fe4dc229eb7c46a9f | 112,938 | py | Python | salt/modules/yumpkg.py | StackKorora/salt | 7bff39ed0ef4bded310b535286cf87a3492f23a2 | [
"Apache-2.0"
] | null | null | null | salt/modules/yumpkg.py | StackKorora/salt | 7bff39ed0ef4bded310b535286cf87a3492f23a2 | [
"Apache-2.0"
] | null | null | null | salt/modules/yumpkg.py | StackKorora/salt | 7bff39ed0ef4bded310b535286cf87a3492f23a2 | [
"Apache-2.0"
] | null | null | null | """
Support for YUM/DNF
.. important::
If you feel that Salt should be using this module to manage packages on a
minion, and it is using a different module (or gives an error similar to
*'pkg.install' is not available*), see :ref:`here
<module-provider-override>`.
.. note::
DNF is fully supported ... | 33.492883 | 97 | 0.577246 |
21148a008c45016485efc8d5814dc743e78223c1 | 1,064 | py | Python | setup.py | dabarrell/flask-microservice-chassis | 435879b0f57a89d7d24ada7755fc9166381f93b9 | [
"MIT"
] | 2 | 2019-04-26T06:30:24.000Z | 2020-04-22T02:31:39.000Z | setup.py | dabarrell/flask-microservice-chassis | 435879b0f57a89d7d24ada7755fc9166381f93b9 | [
"MIT"
] | null | null | null | setup.py | dabarrell/flask-microservice-chassis | 435879b0f57a89d7d24ada7755fc9166381f93b9 | [
"MIT"
] | null | null | null | """
Flask-Chassis
-------------
Microservice chassis
"""
import io
import re
from setuptools import setup
with io.open('flask_chassis/__init__.py', encoding='utf-8') as f:
version = re.search(r"__version__ = '(.+)'", f.read()).group(1)
setup(
name='Flask-Chassis',
version=version,
url='https://github.... | 28 | 70 | 0.637218 |
30efe6fac3d3fd75326662d5deff29774ffed6b9 | 10,003 | py | Python | model/backbone_model/tsm/ops/dataset.py | AssistiveRoboticsUNH/temporal_feature_lfd | dfcbccad8ddcd26861e09f6e6bfa3c85446f9e64 | [
"MIT"
] | null | null | null | model/backbone_model/tsm/ops/dataset.py | AssistiveRoboticsUNH/temporal_feature_lfd | dfcbccad8ddcd26861e09f6e6bfa3c85446f9e64 | [
"MIT"
] | null | null | null | model/backbone_model/tsm/ops/dataset.py | AssistiveRoboticsUNH/temporal_feature_lfd | dfcbccad8ddcd26861e09f6e6bfa3c85446f9e64 | [
"MIT"
] | null | null | null | # Code for "TSM: Temporal Shift Module for Efficient Video Understanding"
# arXiv:1811.08383
# Ji Lin*, Chuang Gan, Song Han
# {jilin, songhan}@mit.edu, ganchuang@csail.mit.edu
import torch.utils.data as data
from PIL import Image
import os
import numpy as np
from numpy.random import randint
class VideoRecord(objec... | 45.262443 | 121 | 0.574628 |
72d02c5451c32c1b04afd2ea4c9a9b1fa372e46f | 3,793 | py | Python | metadata_gather/tests/metadata_extractor/test_json_extractor.py | d-montenegro/MetadataGatherer | c7388ce026c4b66b164eaf933cc65f109f83f368 | [
"MIT"
] | null | null | null | metadata_gather/tests/metadata_extractor/test_json_extractor.py | d-montenegro/MetadataGatherer | c7388ce026c4b66b164eaf933cc65f109f83f368 | [
"MIT"
] | null | null | null | metadata_gather/tests/metadata_extractor/test_json_extractor.py | d-montenegro/MetadataGatherer | c7388ce026c4b66b164eaf933cc65f109f83f368 | [
"MIT"
] | null | null | null | import pytest
from common import MetadataRecord
from metadata_extractor.json_extractor import extract_data_from_json, ExtractionError
from tests.utils import write_json
def test_json_with_single_int_field(temp_json_file):
write_json(temp_json_file, [{'field': 50}])
records = list(extract_data_from_json(temp... | 37.186275 | 92 | 0.719483 |
86644527f0e2261a79b74c607155d79f0108a597 | 84 | py | Python | suji/__init__.py | jikyo/suji4p | 00b7f6f0ac088810cbb379f6a1687db7d329a996 | [
"Apache-2.0"
] | 3 | 2021-02-16T10:53:33.000Z | 2021-09-21T07:55:09.000Z | suji/__init__.py | jikyo/suji4p | 00b7f6f0ac088810cbb379f6a1687db7d329a996 | [
"Apache-2.0"
] | 1 | 2021-02-15T11:19:43.000Z | 2021-02-24T07:29:03.000Z | suji/__init__.py | jikyo/suji4p | 00b7f6f0ac088810cbb379f6a1687db7d329a996 | [
"Apache-2.0"
] | null | null | null | from suji.converter import values, value
from suji.kansuji import kansujis, kansuji
| 28 | 42 | 0.833333 |
036e214c8cdfc6066e147dfc0dfc26c081ea9dad | 1,004 | py | Python | modules/entities.py | pilgun/app-run-and-log | 8dcef79676ba4f0ede237fdd624981121b98b6d7 | [
"Apache-2.0"
] | 1 | 2019-09-18T22:08:54.000Z | 2019-09-18T22:08:54.000Z | modules/entities.py | pilgun/app-run-and-log | 8dcef79676ba4f0ede237fdd624981121b98b6d7 | [
"Apache-2.0"
] | null | null | null | modules/entities.py | pilgun/app-run-and-log | 8dcef79676ba4f0ede237fdd624981121b98b6d7 | [
"Apache-2.0"
] | 3 | 2018-01-16T17:40:23.000Z | 2020-12-14T07:50:06.000Z | import csv
import glob
import os
import re
import subprocess
from pyaxmlparser import APK
class Csv(object):
def __init__(self, csv_path):
self.csvfile = open(csv_path, 'a+', newline='')
self.writer = csv.writer(self.csvfile)
self.writer.writerow(['Package', 'Status'])
def write_row(s... | 25.1 | 73 | 0.623506 |
081774e1699d7f0afc518e37b834be38c0f0d175 | 1,505 | py | Python | solver/sampler.py | microsoft/DualOctreeGNN | 29eed84653d4f0c1681c8227714cf84e76c31abe | [
"MIT"
] | 2 | 2022-03-29T09:08:15.000Z | 2022-03-29T18:45:45.000Z | solver/sampler.py | microsoft/DualOctreeGNN | 29eed84653d4f0c1681c8227714cf84e76c31abe | [
"MIT"
] | null | null | null | solver/sampler.py | microsoft/DualOctreeGNN | 29eed84653d4f0c1681c8227714cf84e76c31abe | [
"MIT"
] | null | null | null | # --------------------------------------------------------
# Dual Octree Graph Networks
# Copyright (c) 2022 Microsoft
# Licensed under The MIT License [see LICENSE for details]
# Written by Peng-Shuai Wang
# --------------------------------------------------------
import torch
from torch.utils.data import Sampler, Di... | 25.948276 | 72 | 0.643189 |
91dd1c0e6149d3d60b57690dee1cfe15098f87ab | 2,026 | py | Python | part7/app/frameworks_and_drivers/db/postgres.py | y-tomimoto/CleanArchitecture | dd7cc8966c29ad24bf39a8b0672eae6341004037 | [
"MIT"
] | 4 | 2021-09-03T04:03:38.000Z | 2021-12-26T14:59:50.000Z | part7/app/frameworks_and_drivers/db/postgres.py | y-tomimoto/CleanArchitecture | dd7cc8966c29ad24bf39a8b0672eae6341004037 | [
"MIT"
] | null | null | null | part7/app/frameworks_and_drivers/db/postgres.py | y-tomimoto/CleanArchitecture | dd7cc8966c29ad24bf39a8b0672eae6341004037 | [
"MIT"
] | null | null | null | # sqlクライアント用のconfig
from enterprise_business_rules.memo_data import MemoData
from interface_adapters.gataways.memo_repository_gateway import MemoRepositoryGateway
from werkzeug.exceptions import Conflict, NotFound
class PostgreSQL(MemoRepositoryGateway):
def __init__(self, connection):
self.conn = connec... | 27.378378 | 89 | 0.628825 |
d1074d6c346cc83133d0c48e872c59418ff43b9c | 3,633 | py | Python | python/GafferImageUI/DisplayTransformUI.py | pier-robot/gaffer | 9267f2ba3822b14430d8a283c745261110b0f570 | [
"BSD-3-Clause"
] | null | null | null | python/GafferImageUI/DisplayTransformUI.py | pier-robot/gaffer | 9267f2ba3822b14430d8a283c745261110b0f570 | [
"BSD-3-Clause"
] | null | null | null | python/GafferImageUI/DisplayTransformUI.py | pier-robot/gaffer | 9267f2ba3822b14430d8a283c745261110b0f570 | [
"BSD-3-Clause"
] | null | null | null | ##########################################################################
#
# Copyright (c) 2015, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistrib... | 28.162791 | 82 | 0.695568 |
f2541362ebdf20a9e13bd5da95c94232d5b08a33 | 5,014 | py | Python | server/function/modules/dense_motion.py | wisehackermonkey/deepfakes-openfaas-function | f5190f120ed3ed0208e4cd902e27f4c3f6b14174 | [
"MIT"
] | 1 | 2022-01-21T19:17:37.000Z | 2022-01-21T19:17:37.000Z | server/function/modules/dense_motion.py | wisehackermonkey/deepfakes-openfaas-function | f5190f120ed3ed0208e4cd902e27f4c3f6b14174 | [
"MIT"
] | null | null | null | server/function/modules/dense_motion.py | wisehackermonkey/deepfakes-openfaas-function | f5190f120ed3ed0208e4cd902e27f4c3f6b14174 | [
"MIT"
] | 1 | 2021-05-29T04:09:03.000Z | 2021-05-29T04:09:03.000Z | from torch import nn
import torch.nn.functional as F
import torch
from function.modules.util import Hourglass, AntiAliasInterpolation2d, make_coordinate_grid, kp2gaussian
class DenseMotionNetwork(nn.Module):
"""
Module that predicting a dense motion from sparse motion representation given by kp_source and kp_... | 43.982456 | 117 | 0.658357 |
02c3310f2073aec37fc9a29d9339af95d7b54a39 | 758 | py | Python | two_sum.py | jaebradley/leetcode.py | 64634cc7d0e975ddd163f35acb18cc92960b8eb5 | [
"MIT"
] | null | null | null | two_sum.py | jaebradley/leetcode.py | 64634cc7d0e975ddd163f35acb18cc92960b8eb5 | [
"MIT"
] | 2 | 2019-11-13T19:55:49.000Z | 2019-11-13T19:55:57.000Z | two_sum.py | jaebradley/leetcode.py | 64634cc7d0e975ddd163f35acb18cc92960b8eb5 | [
"MIT"
] | null | null | null | """
https://leetcode.com/problems/two-sum/
Given an array of integers, return indices of the two numbers such that they add up to a specific target.
You may assume that each input would have exactly one solution, and you may not use the same element twice.
Example:
Given nums = [2, 7, 11, 15], target = 9,
Because ... | 25.266667 | 107 | 0.591029 |
61f2d3d1c24fc21497207b21c5916f8e879a2302 | 13,669 | py | Python | microdot/microdot.py | jonathanfoster/microdot | b810346aa48784ad00d70f160f2542222895f30a | [
"MIT"
] | null | null | null | microdot/microdot.py | jonathanfoster/microdot | b810346aa48784ad00d70f160f2542222895f30a | [
"MIT"
] | null | null | null | microdot/microdot.py | jonathanfoster/microdot | b810346aa48784ad00d70f160f2542222895f30a | [
"MIT"
] | null | null | null | try:
from sys import print_exception
except ImportError: # pragma: no cover
import traceback
def print_exception(exc):
traceback.print_exc()
concurrency_mode = 'threaded'
try: # pragma: no cover
import threading
def create_thread(f, *args, **kwargs):
"""Use the threading module... | 32.779376 | 78 | 0.519058 |
9bb70456b756eeba58d148e223915d4d5e9a92b7 | 3,564 | py | Python | scripts/performance/perf_load/perf_gen_req_parser.py | rantwijk/indy-node | 3cb77dab5482c8b721535020fec41506de819d2e | [
"Apache-2.0"
] | 1 | 2019-03-19T23:44:54.000Z | 2019-03-19T23:44:54.000Z | scripts/performance/perf_load/perf_gen_req_parser.py | rantwijk/indy-node | 3cb77dab5482c8b721535020fec41506de819d2e | [
"Apache-2.0"
] | null | null | null | scripts/performance/perf_load/perf_gen_req_parser.py | rantwijk/indy-node | 3cb77dab5482c8b721535020fec41506de819d2e | [
"Apache-2.0"
] | null | null | null | import json
from perf_load.perf_req_gen_seq import RGSeqReqs
from perf_load.perf_req_gen_nym import RGNym, RGGetNym
from perf_load.perf_req_gen_schema import RGSchema, RGGetSchema
from perf_load.perf_req_gen_attrib import RGAttrib, RGGetAttrib
from perf_load.perf_req_gen_definition import RGGetDefinition, RGDefinition
... | 45.692308 | 117 | 0.68266 |
da42251acdc75f61b20c74dadd97db7a8fd325b0 | 3,284 | py | Python | scripts/BI/pyro_model/testing/ExplanationEvaluation/models/model_selector.py | shalinkpatel/GCN_Integration | 253fa4321606acf0ee0a98667bf6e5eb8ec96cf1 | [
"MIT"
] | null | null | null | scripts/BI/pyro_model/testing/ExplanationEvaluation/models/model_selector.py | shalinkpatel/GCN_Integration | 253fa4321606acf0ee0a98667bf6e5eb8ec96cf1 | [
"MIT"
] | 1 | 2022-02-10T06:32:42.000Z | 2022-02-10T06:32:42.000Z | scripts/BI/pyro_model/testing/ExplanationEvaluation/models/model_selector.py | shalinkpatel/GCN_Integration | 253fa4321606acf0ee0a98667bf6e5eb8ec96cf1 | [
"MIT"
] | null | null | null | import torch
import os
from ExplanationEvaluation.models.GNN_paper import NodeGCN as GNN_NodeGCN
from ExplanationEvaluation.models.GNN_paper import GraphGCN as GNN_GraphGCN
from ExplanationEvaluation.models.PG_paper import NodeGCN as PG_NodeGCN
from ExplanationEvaluation.models.PG_paper import GraphGCN as PG_GraphGCN
... | 41.56962 | 158 | 0.665043 |
afcc47a014b32316965f03986fbd6589c5ff7866 | 202 | py | Python | orijang/urls.py | naxvinci/Font_Finder | b4fec9265edf125440f57baf141377684be1b0d3 | [
"MIT"
] | 1 | 2020-08-25T06:28:14.000Z | 2020-08-25T06:28:14.000Z | orijang/urls.py | naxvinci/Font_Finder | b4fec9265edf125440f57baf141377684be1b0d3 | [
"MIT"
] | 13 | 2020-09-25T22:26:51.000Z | 2022-02-10T02:05:39.000Z | orijang/urls.py | naxvinci/Font_Finder | b4fec9265edf125440f57baf141377684be1b0d3 | [
"MIT"
] | null | null | null | from django.contrib import admin
from django.urls import path
from django.conf.urls import url,include
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('font_detect.urls')),
]
| 22.444444 | 42 | 0.717822 |
392ff311a288b223d7bea77455ce2e62739bd940 | 2,023 | py | Python | populate_rango.py | apenchev/tangowithdjango | 7678137224df6948b0333841eeb2c54dc5668437 | [
"MIT"
] | null | null | null | populate_rango.py | apenchev/tangowithdjango | 7678137224df6948b0333841eeb2c54dc5668437 | [
"MIT"
] | null | null | null | populate_rango.py | apenchev/tangowithdjango | 7678137224df6948b0333841eeb2c54dc5668437 | [
"MIT"
] | null | null | null | import os
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'tango_with_django_project.settings')
import django
django.setup()
from rango.models import Category, Page
def populate():
python_cat = add_cat('Python', views=128, likes=64)
add_page(cat=python_cat,
title="Official Python Tutorial",
url="http://docs.... | 26.618421 | 85 | 0.695007 |
b1b0c26ef5acabcf56413ee1f047413962bd0a18 | 6,876 | py | Python | kubernetes/client/models/v1_config_map_list.py | lp67/python | 33c5ea9835356410ce4a9fa54a02c6a2a22143c6 | [
"Apache-2.0"
] | null | null | null | kubernetes/client/models/v1_config_map_list.py | lp67/python | 33c5ea9835356410ce4a9fa54a02c6a2a22143c6 | [
"Apache-2.0"
] | 4 | 2019-11-19T10:33:47.000Z | 2022-03-01T03:33:52.000Z | kubernetes/client/models/v1_config_map_list.py | mohramadan911/PythonClientAPI | 5d111812c81b7a573ac8661d1aec60bb97072412 | [
"Apache-2.0"
] | 2 | 2021-08-10T16:35:31.000Z | 2021-09-14T04:53:06.000Z | # coding: utf-8
"""
Kubernetes
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: release-1.20
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import si... | 33.378641 | 312 | 0.622746 |
2e0fe8e6cce095b6da77fae7ce266525bd335697 | 665 | py | Python | sims/s304/plot-total-energy.py | ammarhakim/ammar-simjournal | 85b64ddc9556f01a4fab37977864a7d878eac637 | [
"MIT",
"Unlicense"
] | 1 | 2019-12-19T16:21:13.000Z | 2019-12-19T16:21:13.000Z | sims/s304/plot-total-energy.py | ammarhakim/ammar-simjournal | 85b64ddc9556f01a4fab37977864a7d878eac637 | [
"MIT",
"Unlicense"
] | null | null | null | sims/s304/plot-total-energy.py | ammarhakim/ammar-simjournal | 85b64ddc9556f01a4fab37977864a7d878eac637 | [
"MIT",
"Unlicense"
] | 2 | 2020-01-08T06:23:33.000Z | 2020-01-08T07:06:50.000Z | from pylab import *
import numpy
import tables
Lx = 8*pi
Ly = 4*pi
nFrame = 40
elcEnergy = numpy.zeros((nFrame+1,), numpy.float)
ionEnergy = numpy.zeros((nFrame+1,), numpy.float)
emEnergy = numpy.zeros((nFrame+1,), numpy.float)
Tm = linspace(0, nFrame, nFrame+1)
for i in range(0,nFrame+1):
print "Working on %d .... | 20.151515 | 75 | 0.622556 |
f2a32c3ab20b24a0969d757779736867daf0f493 | 1,139 | py | Python | python/lbann/modules/graph/utils.py | LLNL/LBANN | 8bcc5d461e52de70e329d73081ca7eee3e5c580a | [
"Apache-2.0"
] | null | null | null | python/lbann/modules/graph/utils.py | LLNL/LBANN | 8bcc5d461e52de70e329d73081ca7eee3e5c580a | [
"Apache-2.0"
] | null | null | null | python/lbann/modules/graph/utils.py | LLNL/LBANN | 8bcc5d461e52de70e329d73081ca7eee3e5c580a | [
"Apache-2.0"
] | null | null | null | import lbann
def GraphExpand(features, indices, name=None):
"""Places the features according the indices to an expanded matrix
output[i] = features[indices[i]]
Args:
features (Layer) : 2D matrix with shape (N, F)
indices (Layer): 1D matrix with shape (E)
returnL (Laye... | 32.542857 | 73 | 0.626866 |
a282309a8df5e9a49af8c9769389d2665c1f8313 | 538 | py | Python | backend/home/migrations/0001_load_initial_data.py | crowdbotics-apps/damp-brook-31516 | 0c2cb3efc3699a1a7e9a162895b80a265b241d3a | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/home/migrations/0001_load_initial_data.py | crowdbotics-apps/damp-brook-31516 | 0c2cb3efc3699a1a7e9a162895b80a265b241d3a | [
"FTL",
"AML",
"RSA-MD"
] | 1 | 2021-10-18T16:33:23.000Z | 2021-10-18T16:33:23.000Z | backend/home/migrations/0001_load_initial_data.py | crowdbotics-apps/damp-brook-31516 | 0c2cb3efc3699a1a7e9a162895b80a265b241d3a | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | from django.db import migrations
def create_site(apps, schema_editor):
Site = apps.get_model("sites", "Site")
custom_domain = "damp-brook-31516.botics.co"
site_params = {
"name": "Damp Brook",
}
if custom_domain:
site_params["domain"] = custom_domain
Site.objects.update_or_cr... | 20.692308 | 61 | 0.654275 |
de51a9c64a47f794736746a4bd9e127289a9fcea | 210 | py | Python | pycalc/model.py | lbreede/pyqt-cheatsheet | ca094108ed60f2f0c3ae3ba5c7b4b5e7a5c73861 | [
"MIT"
] | null | null | null | pycalc/model.py | lbreede/pyqt-cheatsheet | ca094108ed60f2f0c3ae3ba5c7b4b5e7a5c73861 | [
"MIT"
] | null | null | null | pycalc/model.py | lbreede/pyqt-cheatsheet | ca094108ed60f2f0c3ae3ba5c7b4b5e7a5c73861 | [
"MIT"
] | null | null | null | __version__ = "0.1"
__author__ = "Lennart Breede"
ERROR_MSG = "ERROR"
def evaluateExpression(expression):
try:
result = str(eval(expression, {}, {}))
except Exception:
result = ERROR_MSG
return result | 17.5 | 40 | 0.709524 |
47912551f5238c109333dc28d7b7d5adcde6e231 | 2,240 | py | Python | tests/unit/raptiformica/cli/test_parse_join_arguments.py | vdloo/raptiformica | e2807e5e913312034161efcbd74525a4b15b37e7 | [
"MIT"
] | 21 | 2016-09-04T11:27:31.000Z | 2019-10-30T08:23:14.000Z | tests/unit/raptiformica/cli/test_parse_join_arguments.py | vdloo/raptiformica | e2807e5e913312034161efcbd74525a4b15b37e7 | [
"MIT"
] | 5 | 2017-09-17T15:59:37.000Z | 2018-02-03T14:53:32.000Z | tests/unit/raptiformica/cli/test_parse_join_arguments.py | vdloo/raptiformica | e2807e5e913312034161efcbd74525a4b15b37e7 | [
"MIT"
] | 2 | 2017-11-21T18:14:51.000Z | 2017-11-22T01:20:45.000Z | from mock import call
from raptiformica.cli import parse_join_arguments
from tests.testcase import TestCase
class TestParseJoinArguments(TestCase):
def setUp(self):
self.argument_parser = self.set_up_patch('raptiformica.cli.ArgumentParser')
self.parse_arguments = self.set_up_patch('raptiformica.c... | 36.721311 | 110 | 0.665625 |
91e52e4567e1b173da6d0900479f8fd7fae2e498 | 529 | py | Python | learnmodels/migrations/0001_initial.py | fanandactuaility/mysite | fe8c19b2eb9f91f8a86752b232eaf32e418f67eb | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | learnmodels/migrations/0001_initial.py | fanandactuaility/mysite | fe8c19b2eb9f91f8a86752b232eaf32e418f67eb | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | learnmodels/migrations/0001_initial.py | fanandactuaility/mysite | fe8c19b2eb9f91f8a86752b232eaf32e418f67eb | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
]
operations = [
migrations.CreateModel(
name='Blog',
fields=[
('id', models.AutoField(verbose... | 24.045455 | 114 | 0.567108 |
8a7be636a469ec5d8e4589595dd8e18a59ab10dc | 34,290 | py | Python | app/main/views.py | Cpapa97/pipecontrol | 8178db7c5e48d607b0a63df45671928df75e6a42 | [
"MIT"
] | null | null | null | app/main/views.py | Cpapa97/pipecontrol | 8178db7c5e48d607b0a63df45671928df75e6a42 | [
"MIT"
] | 3 | 2019-04-13T07:47:21.000Z | 2019-09-09T19:12:00.000Z | app/main/views.py | Cpapa97/pipecontrol | 8178db7c5e48d607b0a63df45671928df75e6a42 | [
"MIT"
] | 6 | 2017-06-28T22:26:47.000Z | 2018-05-26T15:51:52.000Z | from collections import OrderedDict
from inspect import isclass
from slacker import Slacker
from datetime import datetime, timedelta
import pandas as pd
import datajoint as dj
import uuid
import numpy as np
import matplotlib.pyplot as plt
import mpld3
import graphviz
import json
import http
from flask import render_tem... | 51.026786 | 132 | 0.614115 |
f4462fa53edb378c98ed0c2de5dcfc0e60665ce5 | 414 | py | Python | stdplugins/ping1.py | ppppspsljdhdd/Pepe | 1e57825ddb0ab3ba15a19cad0ecfbf2622f6b851 | [
"Apache-2.0"
] | null | null | null | stdplugins/ping1.py | ppppspsljdhdd/Pepe | 1e57825ddb0ab3ba15a19cad0ecfbf2622f6b851 | [
"Apache-2.0"
] | null | null | null | stdplugins/ping1.py | ppppspsljdhdd/Pepe | 1e57825ddb0ab3ba15a19cad0ecfbf2622f6b851 | [
"Apache-2.0"
] | null | null | null | from datetime import datetime
from uniborg.util import admin_cmd, edit_or_reply
@borg.on(admin_cmd(pattern="ping", allow_sudo=True))
async def _(event):
if event.fwd_from:
return
e = await edit_or_reply(event, "Poooong!")
start = datetime.now()
await e.edit("Pong!")
end = datetime.now()
... | 25.875 | 52 | 0.652174 |
4a4bd36b1caa94127b5a789de77f9e023e1e913b | 1,863 | py | Python | lib/stacks/pocket_to_kindle/lambdas/create_doc.py | shaftoe/api-l3x-in | 06426f62708051b570e8839398562982d770903f | [
"Apache-2.0"
] | 11 | 2020-03-01T15:24:09.000Z | 2022-01-06T08:31:31.000Z | lib/stacks/pocket_to_kindle/lambdas/create_doc.py | shaftoe/api-l3x-in | 06426f62708051b570e8839398562982d770903f | [
"Apache-2.0"
] | 1 | 2020-08-28T15:25:39.000Z | 2020-08-30T07:35:59.000Z | lib/stacks/pocket_to_kindle/lambdas/create_doc.py | shaftoe/api-l3x-in | 06426f62708051b570e8839398562982d770903f | [
"Apache-2.0"
] | 5 | 2020-10-15T03:06:37.000Z | 2021-09-29T07:07:18.000Z | """Lambda pocket-to-kindle create_doc."""
from datetime import datetime
from os import environ as env
from uuid import uuid4
import utils
import utils.aws as aws
import utils.handlers as handlers
import utils.helpers as helpers
def create_doc(event: utils.LambdaEvent) -> str:
"""Build clean HTML file from URL so... | 35.150943 | 93 | 0.66613 |
645f50bf2d9e8b2ea20480e5abb594e74fe986e4 | 977 | py | Python | userbot/plugins/eye.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | userbot/plugins/eye.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | userbot/plugins/eye.py | justteen/BUZZ-USERBOT | 55651cce150e1d04d2c61efb2565ef9f46b42933 | [
"BSL-1.0"
] | null | null | null | """COMMAND : .eye"""
import asyncio
from userbot.utils import lightning_cmd
@borg.on(lightning_cmd(pattern="eye"))
async def _(event):
if event.fwd_from:
return
animation_interval = 3
animation_ttl = range(0, 103)
# input_str = event.pattern_match.group(1)
# if input_str == "eye":... | 22.204545 | 54 | 0.497441 |
b3eb933882c136a120872b49c3f79c05b1bae414 | 502 | py | Python | readthedocs/projects/migrations/0008_add_subproject_alias_prefix.py | kennethlarsen/readthedocs.org | 735d630d83f79ae24772d10e66fd35b8f5675a30 | [
"MIT"
] | 2 | 2018-01-14T14:04:00.000Z | 2021-02-07T19:25:45.000Z | readthedocs/projects/migrations/0008_add_subproject_alias_prefix.py | Alig1493/readthedocs.org | c37b00995c1bbc5ee51d3552ef176546373bb912 | [
"MIT"
] | 4 | 2021-03-31T20:17:21.000Z | 2021-12-13T20:49:19.000Z | readthedocs/projects/migrations/0008_add_subproject_alias_prefix.py | Alig1493/readthedocs.org | c37b00995c1bbc5ee51d3552ef176546373bb912 | [
"MIT"
] | 6 | 2019-02-13T16:08:41.000Z | 2020-03-12T14:17:14.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from __future__ import absolute_import
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('projects', '0007_migrate_canonical_data'),
]
operations = [
migrations.AddField(
... | 23.904762 | 96 | 0.653386 |
961f6fdd6614152922cf65826ca5a843c601bbd2 | 5,028 | py | Python | test/functional/mempool_persist.py | cryptomiles/cryptomiles | d3815eaf7716fbca9459f4162ae7ba4714298d27 | [
"MIT"
] | null | null | null | test/functional/mempool_persist.py | cryptomiles/cryptomiles | d3815eaf7716fbca9459f4162ae7ba4714298d27 | [
"MIT"
] | null | null | null | test/functional/mempool_persist.py | cryptomiles/cryptomiles | d3815eaf7716fbca9459f4162ae7ba4714298d27 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Copyright (c) 2017-2018 The Cryptomiles Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test mempool persistence.
By default, crypto... | 44.892857 | 127 | 0.697295 |
3719593c5188d20abf8cb97151530faada455fdb | 40 | py | Python | olea/packages/pypat/__init__.py | Pix-00/olea | 98bee1fd8866a3929f685a139255afb7b6813f31 | [
"Apache-2.0"
] | 2 | 2020-06-18T03:25:52.000Z | 2020-06-18T07:33:45.000Z | olea/packages/pypat/__init__.py | Pix-00/olea | 98bee1fd8866a3929f685a139255afb7b6813f31 | [
"Apache-2.0"
] | 15 | 2021-01-28T07:11:04.000Z | 2021-05-24T07:11:37.000Z | olea/packages/pypat/__init__.py | Pix-00/olea | 98bee1fd8866a3929f685a139255afb7b6813f31 | [
"Apache-2.0"
] | null | null | null | __all__ = ['Pat']
from .pat import Pat
| 10 | 20 | 0.65 |
a8ecb1ff45fa1a3d0943246ae09c3edf85c3292e | 369 | py | Python | ntc_rosetta/translators/openconfig/ios/openconfig_if_ethernet/ethernet.py | steinzi/ntc-rosetta | fac7086c460a2c68c769879930b74c05ed89b1f4 | [
"Apache-2.0"
] | 95 | 2019-05-29T13:04:12.000Z | 2022-03-11T20:38:13.000Z | ntc_rosetta/translators/openconfig/ios/openconfig_if_ethernet/ethernet.py | tbotnz/ntc-rosetta | fac7086c460a2c68c769879930b74c05ed89b1f4 | [
"Apache-2.0"
] | 35 | 2019-05-30T03:58:34.000Z | 2021-03-03T15:30:05.000Z | ntc_rosetta/translators/openconfig/ios/openconfig_if_ethernet/ethernet.py | tbotnz/ntc-rosetta | fac7086c460a2c68c769879930b74c05ed89b1f4 | [
"Apache-2.0"
] | 28 | 2019-05-29T19:32:26.000Z | 2021-04-05T09:49:30.000Z | from ntc_rosetta.translators.openconfig.ios.openconfig_vlan import switched_vlan
from yangify.translator import Translator, TranslatorData
class Ethernet(Translator):
class Yangify(TranslatorData):
path = (
"openconfig-interfaces:interfaces/interface/openconfig-if-ethernet:ethernet"
)... | 28.384615 | 88 | 0.764228 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.