hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3774ba19f157b344cd70d5ac85ec575d59405bb7 | 2,833 | py | Python | examples/dfp/v201702/report_service/run_inventory_report.py | agencia-watermelons/googleads-python-lib | d2e55863ecf7e5090c225d74b3f4c1f948cd5a21 | [
"Apache-2.0"
] | null | null | null | examples/dfp/v201702/report_service/run_inventory_report.py | agencia-watermelons/googleads-python-lib | d2e55863ecf7e5090c225d74b3f4c1f948cd5a21 | [
"Apache-2.0"
] | null | null | null | examples/dfp/v201702/report_service/run_inventory_report.py | agencia-watermelons/googleads-python-lib | d2e55863ecf7e5090c225d74b3f4c1f948cd5a21 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 32.563218 | 78 | 0.692199 |
4725aa57633875516732762251a5fe4ae760ba93 | 1,106 | py | Python | core-python/Core_Python/datatstructure/Assessment_4_7.py | theumang100/tutorials-1 | 497f54c2adb022c316530319a168fca1c007d4b1 | [
"MIT"
] | 9 | 2020-04-23T05:24:19.000Z | 2022-02-17T16:37:51.000Z | core-python/Core_Python/datatstructure/Assessment_4_7.py | theumang100/tutorials-1 | 497f54c2adb022c316530319a168fca1c007d4b1 | [
"MIT"
] | 5 | 2020-10-01T05:08:37.000Z | 2020-10-12T03:18:10.000Z | core-python/Core_Python/datatstructure/Assessment_4_7.py | theumang100/tutorials-1 | 497f54c2adb022c316530319a168fca1c007d4b1 | [
"MIT"
] | 9 | 2020-04-28T14:06:41.000Z | 2021-10-19T18:32:28.000Z | ''' Use a dictionary to count the frequency of letters in the input string.
Only letters should be counted, not blank spaces, numbers, or
punctuation. Upper case should be considered the same as lower case.
For example, count_letters("This is a sentence.") should return
{'t': 2, 'h': 1, 'i': 2, 's': 3, ... | 39.5 | 84 | 0.564195 |
ddfce00c8a091c05a8aa9e492cb1a68fba16b364 | 4,240 | py | Python | strativ/strativ/settings.py | AR-Ashraf/Django-REST-API-Website | 1907fd30ebb66accb1c102e5a10ba506bff0b4d4 | [
"MIT"
] | null | null | null | strativ/strativ/settings.py | AR-Ashraf/Django-REST-API-Website | 1907fd30ebb66accb1c102e5a10ba506bff0b4d4 | [
"MIT"
] | null | null | null | strativ/strativ/settings.py | AR-Ashraf/Django-REST-API-Website | 1907fd30ebb66accb1c102e5a10ba506bff0b4d4 | [
"MIT"
] | null | null | null | """
Django settings for strativ project.
Generated by 'django-admin startproject' using Django 3.2.6.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
import os
fro... | 27.532468 | 91 | 0.701651 |
ce0228f45b083ed0f9251a80940f7ca7f203c118 | 808 | py | Python | manage.py | George-Stephen/Enrollment_api | a7030e9988da68107b434a1ecf810eab4a4fceca | [
"Apache-2.0"
] | null | null | null | manage.py | George-Stephen/Enrollment_api | a7030e9988da68107b434a1ecf810eab4a4fceca | [
"Apache-2.0"
] | null | null | null | manage.py | George-Stephen/Enrollment_api | a7030e9988da68107b434a1ecf810eab4a4fceca | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "enrollment.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that t... | 35.130435 | 77 | 0.643564 |
2e4239bc7ceef910bfd7a5967214f81f1dfd5d09 | 4,172 | py | Python | mmocr/models/textdet/necks/fpn_cat.py | yefangok/mmocr | ee185c17d6097c4a9ffeaec41f9cb1d271568074 | [
"Apache-2.0"
] | null | null | null | mmocr/models/textdet/necks/fpn_cat.py | yefangok/mmocr | ee185c17d6097c4a9ffeaec41f9cb1d271568074 | [
"Apache-2.0"
] | null | null | null | mmocr/models/textdet/necks/fpn_cat.py | yefangok/mmocr | ee185c17d6097c4a9ffeaec41f9cb1d271568074 | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
import torch.nn.functional as F
from mmcv.cnn import ConvModule
from mmcv.runner import auto_fp16
from mmdet.models.builder import NECKS
@NECKS.register_module()
class FPNC(nn.Module):
"""FPN-like fusion module in Real-time Scene Text Detection with
Differentiable Binarizat... | 32.59375 | 68 | 0.551534 |
7ea0666b12b0c1a0364e08da9dc54e7b02b7d7a8 | 985 | py | Python | var/spack/repos/builtin/packages/biobloom/package.py | FJ-NaokiMatsumura/spack | 7cfe626e21795f0a4bfe61f36ca1b48ffd2fc961 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 11 | 2015-10-04T02:17:46.000Z | 2018-02-07T18:23:00.000Z | var/spack/repos/builtin/packages/biobloom/package.py | FJ-NaokiMatsumura/spack | 7cfe626e21795f0a4bfe61f36ca1b48ffd2fc961 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 22 | 2017-08-01T22:45:10.000Z | 2022-03-10T07:46:31.000Z | var/spack/repos/builtin/packages/biobloom/package.py | FJ-NaokiMatsumura/spack | 7cfe626e21795f0a4bfe61f36ca1b48ffd2fc961 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 4 | 2016-06-10T17:57:39.000Z | 2018-09-11T04:59:38.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class Biobloom(AutotoolsPackage):
"""BioBloom Tools (BBT) provides the means to create filters f... | 35.178571 | 101 | 0.723858 |
97c0714e4f8a7a6e18384b1c252853a7e912642f | 531 | py | Python | src/models/__init__.py | sameasy/hgcal_ldrd | 7775f2346b9f6764ca30b134c1aeceb2e8ce4848 | [
"BSD-3-Clause"
] | 9 | 2019-03-13T15:37:07.000Z | 2021-07-22T01:55:30.000Z | src/models/__init__.py | sameasy/hgcal_ldrd | 7775f2346b9f6764ca30b134c1aeceb2e8ce4848 | [
"BSD-3-Clause"
] | null | null | null | src/models/__init__.py | sameasy/hgcal_ldrd | 7775f2346b9f6764ca30b134c1aeceb2e8ce4848 | [
"BSD-3-Clause"
] | 9 | 2019-02-25T19:35:48.000Z | 2020-02-24T22:53:04.000Z | """
Python module for holding our PyTorch models.
"""
from .EdgeNet import EdgeNet
from .gnn_geometric import GNNSegmentClassifier
from .PointNet import PointNet
_models = {'EdgeNet': EdgeNet,
'heptrkx_segment_classifier': GNNSegmentClassifier,
'PointNet': PointNet}
def get_model(name, **mo... | 25.285714 | 62 | 0.677966 |
95edda7547b0c88148f63e91cfaeb36685561e61 | 3,562 | py | Python | Imaging/Core/Testing/Python/ResliceBSpline.py | txwhhny/vtk | 854d9aa87b944bc9079510515996406b98b86f7c | [
"BSD-3-Clause"
] | 1,755 | 2015-01-03T06:55:00.000Z | 2022-03-29T05:23:26.000Z | Imaging/Core/Testing/Python/ResliceBSpline.py | txwhhny/vtk | 854d9aa87b944bc9079510515996406b98b86f7c | [
"BSD-3-Clause"
] | 29 | 2015-04-23T20:58:30.000Z | 2022-03-02T16:16:42.000Z | Imaging/Core/Testing/Python/ResliceBSpline.py | txwhhny/vtk | 854d9aa87b944bc9079510515996406b98b86f7c | [
"BSD-3-Clause"
] | 1,044 | 2015-01-05T22:48:27.000Z | 2022-03-31T02:38:26.000Z | #!/usr/bin/env python
import vtk
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# this script tests vtkImageReslice with different interpolation modes,
# with the wrap-pad feature turned on and with a rotation
# Image pipeline
reader = vtk.vtkImageReader()
reader.ReleaseDataFlagOff()
reader.... | 33.92381 | 71 | 0.8105 |
f08b275d957d08491fe35f6e62b31331c764ee59 | 485 | py | Python | data/sr_utils.py | crisbodnar/cwn | 31e40d839d9996ef1c1d46931702ca5a69dbe2ce | [
"MIT"
] | 74 | 2021-07-30T08:36:58.000Z | 2022-03-27T19:50:49.000Z | data/sr_utils.py | crisbodnar/cwn | 31e40d839d9996ef1c1d46931702ca5a69dbe2ce | [
"MIT"
] | 14 | 2022-01-02T11:22:00.000Z | 2022-01-06T19:32:34.000Z | data/sr_utils.py | crisbodnar/cwn | 31e40d839d9996ef1c1d46931702ca5a69dbe2ce | [
"MIT"
] | 13 | 2021-08-05T15:26:06.000Z | 2022-02-19T06:59:15.000Z | import networkx as nx
import torch
from torch_geometric.utils import to_undirected
def load_sr_dataset(path):
"""Load the Strongly Regular Graph Dataset from the supplied path."""
nx_graphs = nx.read_graph6(path)
graphs = list()
for nx_graph in nx_graphs:
n = nx_graph.number_of_nodes()
... | 30.3125 | 105 | 0.701031 |
7ea5b07daa5045952657982398c624000e09f98d | 2,966 | py | Python | NEMbox/cmd_parser.py | wangjianyuan10/musicbox | f182053b07badc5d34190aeea85ff38d364a164e | [
"MIT"
] | 2 | 2020-03-21T15:20:28.000Z | 2020-04-16T07:22:46.000Z | NEMbox/cmd_parser.py | e71828/musicbox | f182053b07badc5d34190aeea85ff38d364a164e | [
"MIT"
] | null | null | null | NEMbox/cmd_parser.py | e71828/musicbox | f182053b07badc5d34190aeea85ff38d364a164e | [
"MIT"
] | 1 | 2020-06-10T09:22:38.000Z | 2020-06-10T09:22:38.000Z | #!/usr/bin/env python
# coding=utf-8
# __author__='walker'
"""
捕获类似curses键盘输入流,生成指令流
"""
from copy import deepcopy
from functools import wraps
import os
ERASE_SPEED = 5 # 屏幕5秒刷新一次 去除错误的显示
__all__ = ['cmd_parser', 'parse_keylist', 'coroutine', 'erase_coroutine']
def coroutine(func):
@wraps(func)
def prime... | 22.641221 | 80 | 0.564734 |
4ce96b38c283059864453f2586fb8b929ca48b14 | 493 | py | Python | src/requirementslib/__init__.py | stewartmiles/requirementslib | 644198471362e5e7be7a32d2a9fdadd538391aef | [
"MIT"
] | 72 | 2018-06-20T07:39:24.000Z | 2022-02-23T16:10:51.000Z | src/requirementslib/__init__.py | stewartmiles/requirementslib | 644198471362e5e7be7a32d2a9fdadd538391aef | [
"MIT"
] | 234 | 2018-06-03T06:27:28.000Z | 2022-03-31T11:37:59.000Z | src/requirementslib/__init__.py | stewartmiles/requirementslib | 644198471362e5e7be7a32d2a9fdadd538391aef | [
"MIT"
] | 25 | 2018-06-03T06:12:32.000Z | 2022-03-09T12:15:23.000Z | # -*- coding=utf-8 -*-
from __future__ import absolute_import, print_function
import logging
import warnings
from vistir.compat import ResourceWarning
from .models.lockfile import Lockfile
from .models.pipfile import Pipfile
from .models.requirements import Requirement
__version__ = "1.5.17.dev0"
logger = logging... | 22.409091 | 59 | 0.793103 |
6e284bdf86b25337c24f9964135cb17c9a0ddf6f | 284 | py | Python | allLongestStrings.py | pclumson1/Python3_Algorithms | 7b8106af1641aeb09b6bb1ac1881b8beecde1184 | [
"MIT"
] | null | null | null | allLongestStrings.py | pclumson1/Python3_Algorithms | 7b8106af1641aeb09b6bb1ac1881b8beecde1184 | [
"MIT"
] | null | null | null | allLongestStrings.py | pclumson1/Python3_Algorithms | 7b8106af1641aeb09b6bb1ac1881b8beecde1184 | [
"MIT"
] | null | null | null | #allLongestStrings
def allLongestStrings(inputArray):
arr_len = [len(i) for i in inputArray]
long = max(arr_len)
strings = []
for i in inputArray[0:]:
if len(i) == long:
strings.append(i) # or else strings = strings + [i]
return strings | 31.555556 | 64 | 0.598592 |
f9c4f3c0d5afe7d5be83b6223d1371fb726c524f | 13,413 | py | Python | WP3/Task3.1/notebooks/Q6_Distribution_References.py | on-merrit/ON-MERRIT | a21324a54a6365f2f769b5952b0cf5347a97d480 | [
"MIT"
] | 2 | 2019-12-10T13:10:58.000Z | 2019-12-13T10:11:41.000Z | WP3/Task3.1/notebooks/Q6_Distribution_References.py | on-merrit/ON-MERRIT | a21324a54a6365f2f769b5952b0cf5347a97d480 | [
"MIT"
] | 4 | 2020-03-31T12:13:45.000Z | 2020-04-15T15:59:17.000Z | WP3/Task3.1/notebooks/Q6_Distribution_References.py | on-merrit/ON-MERRIT | a21324a54a6365f2f769b5952b0cf5347a97d480 | [
"MIT"
] | 1 | 2020-02-26T08:52:39.000Z | 2020-02-26T08:52:39.000Z | #!/usr/bin/env python
# coding: utf-8
# # This will create plots for institutions of universities in THE WUR univs only and for the period of 2007-2017. The input dataset contains info of THE WUR univs only but for any period of time.
# #### The unpaywall dump used was from (April or June) 2018; hence analysis until ... | 30.623288 | 285 | 0.702677 |
8ba5db3f50b6fcb4bb1b5d7c89960b976b01764f | 5,176 | py | Python | vertex/test/test_standalone.py | twisted/vertex | feb591aa1b9a3b2b8fdcf53e4962dad2a0bc38ca | [
"MIT"
] | 56 | 2015-01-09T03:52:07.000Z | 2021-09-26T22:17:06.000Z | vertex/test/test_standalone.py | DalavanCloud/vertex | feb591aa1b9a3b2b8fdcf53e4962dad2a0bc38ca | [
"MIT"
] | 34 | 2015-03-05T02:57:48.000Z | 2017-05-23T22:34:13.000Z | vertex/test/test_standalone.py | DalavanCloud/vertex | feb591aa1b9a3b2b8fdcf53e4962dad2a0bc38ca | [
"MIT"
] | 17 | 2015-04-17T02:03:16.000Z | 2021-11-12T03:31:07.000Z | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{vertex.q2qstandalone}
"""
from pretend import call_recorder, call, stub
from twisted.internet import defer
from twisted.python.filepath import FilePath
from twisted.protocols.amp import AMP
from twisted.test.iosim import connect, ... | 29.747126 | 78 | 0.627512 |
bda16a828f3c4c702a9aa5748d4ca2d41b285036 | 167,967 | py | Python | python-package/lightgbm/basic.py | TremaMiguel/LightGBM | da9072fde2b5cd7160866e7e9e49a14e7fba8bf3 | [
"MIT"
] | null | null | null | python-package/lightgbm/basic.py | TremaMiguel/LightGBM | da9072fde2b5cd7160866e7e9e49a14e7fba8bf3 | [
"MIT"
] | null | null | null | python-package/lightgbm/basic.py | TremaMiguel/LightGBM | da9072fde2b5cd7160866e7e9e49a14e7fba8bf3 | [
"MIT"
] | null | null | null | # coding: utf-8
"""Wrapper for C API of LightGBM."""
import abc
import ctypes
import json
import warnings
from collections import OrderedDict
from copy import deepcopy
from functools import wraps
from os import SEEK_END
from os.path import getsize
from pathlib import Path
from tempfile import NamedTemporaryFile
from ty... | 42.107546 | 166 | 0.593319 |
33dc77f501bf541544a266a888e94938694fac54 | 1,979 | py | Python | setup.py | MeliorAI/meliorTransformers | b2936e1aac23e63e0b737d03975124c31a960812 | [
"Apache-2.0"
] | 1 | 2020-08-06T10:48:49.000Z | 2020-08-06T10:48:49.000Z | setup.py | MeliorAI/meliorTransformers | b2936e1aac23e63e0b737d03975124c31a960812 | [
"Apache-2.0"
] | 2 | 2020-02-13T12:45:57.000Z | 2020-04-14T11:30:33.000Z | setup.py | MeliorAI/meliorTransformers | b2936e1aac23e63e0b737d03975124c31a960812 | [
"Apache-2.0"
] | 2 | 2020-07-21T12:43:51.000Z | 2021-08-13T15:21:22.000Z | import os
from setuptools import find_packages, setup
here = os.path.abspath(os.path.dirname(__file__))
# Avoids IDE errors, but actual version is read from version.py
__version__ = None
with open("melior_transformers/version.py") as f:
exec(f.read())
# Get the long description from the README file
with open(os... | 25.050633 | 79 | 0.641738 |
767ec74a98cb96a68f6952b1b6157f3c72b44c15 | 4,064 | py | Python | alipay/aop/api/request/AlipayInsScenePetprofilePlatformprofileQueryRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AlipayInsScenePetprofilePlatformprofileQueryRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/request/AlipayInsScenePetprofilePlatformprofileQueryRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.FileItem import FileItem
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.AlipayInsScenePetprofilePlatformprofileQueryModel import AlipayInsScenePetprofilePlatformprofileQueryModel
class AlipayInsScenePetpr... | 28.027586 | 148 | 0.652559 |
c594403c878d4e3f17961340ba05bfa94d6a1a6f | 2,186 | py | Python | rllib/models/tests/test_convtranspose2d_stack.py | 77loopin/ray | 9322f6aab53f4ca5baf5a3573e1ffde12feae519 | [
"Apache-2.0"
] | 21,382 | 2016-09-26T23:12:52.000Z | 2022-03-31T21:47:45.000Z | rllib/models/tests/test_convtranspose2d_stack.py | 77loopin/ray | 9322f6aab53f4ca5baf5a3573e1ffde12feae519 | [
"Apache-2.0"
] | 19,689 | 2016-09-17T08:21:25.000Z | 2022-03-31T23:59:30.000Z | rllib/models/tests/test_convtranspose2d_stack.py | gramhagen/ray | c18caa4db36d466718bdbcb2229aa0b2dc03da1f | [
"Apache-2.0"
] | 4,114 | 2016-09-23T18:54:01.000Z | 2022-03-31T15:07:32.000Z | import gym
import numpy as np
import os
from pathlib import Path
import unittest
from ray.rllib.models.preprocessors import GenericPixelPreprocessor
from ray.rllib.models.torch.modules.convtranspose2d_stack import \
ConvTranspose2DStack
from ray.rllib.utils.framework import try_import_torch, try_import_tf
from ray... | 33.630769 | 79 | 0.622598 |
b539ca8103a79a87d207ff4fc990e433815cc961 | 1,657 | py | Python | triton/dns/dnssec/digest/base.py | jayvdb/triton | b64424c193b131721f172f94963d8d79b21804db | [
"MIT"
] | null | null | null | triton/dns/dnssec/digest/base.py | jayvdb/triton | b64424c193b131721f172f94963d8d79b21804db | [
"MIT"
] | 1 | 2020-10-16T00:57:07.000Z | 2020-10-27T13:02:24.000Z | triton/dns/dnssec/digest/base.py | jayvdb/triton | b64424c193b131721f172f94963d8d79b21804db | [
"MIT"
] | 1 | 2020-08-27T13:59:08.000Z | 2020-08-27T13:59:08.000Z | from bitstring import BitArray
class Digest:
id: int
@classmethod
def hash_key(cls, key_resource_record):
"""
Hashes DNSKEY resource record (name + rdata)
:param key_resource_record:
:return:
"""
from triton.dns.message.domains.domain import Domain
... | 31.264151 | 116 | 0.609535 |
bdcdf07e86ea51c53e5c2aca0f04ba96f07c07b8 | 4,416 | py | Python | oneflow/compatible_single_client_python/test/ops/test_sparse_cross_entropy_ms.py | xcnick/oneflow | 7b786b27069dec35d2493256011e773988c91f56 | [
"Apache-2.0"
] | null | null | null | oneflow/compatible_single_client_python/test/ops/test_sparse_cross_entropy_ms.py | xcnick/oneflow | 7b786b27069dec35d2493256011e773988c91f56 | [
"Apache-2.0"
] | null | null | null | oneflow/compatible_single_client_python/test/ops/test_sparse_cross_entropy_ms.py | xcnick/oneflow | 7b786b27069dec35d2493256011e773988c91f56 | [
"Apache-2.0"
] | null | null | null | """
Copyright 2020 The OneFlow 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 law or agr... | 37.109244 | 84 | 0.688179 |
a413a247c967a7f9df28f97ce107f7eb8a144751 | 1,835 | py | Python | route/recent_discuss.py | lsh23/openNAMU | 18f780afe5e81ef1f347fe556b6fd98bb4914a53 | [
"BSD-3-Clause"
] | null | null | null | route/recent_discuss.py | lsh23/openNAMU | 18f780afe5e81ef1f347fe556b6fd98bb4914a53 | [
"BSD-3-Clause"
] | null | null | null | route/recent_discuss.py | lsh23/openNAMU | 18f780afe5e81ef1f347fe556b6fd98bb4914a53 | [
"BSD-3-Clause"
] | null | null | null | from .tool.func import *
def recent_discuss_2(conn):
curs = conn.cursor()
div = ''
if flask.request.args.get('what', 'normal') == 'normal':
div += '<a href="/recent_discuss?what=close">(' + load_lang('close_discussion') + ')</a>'
m_sub = 0
else:
div += '<a href="/r... | 35.980392 | 125 | 0.497548 |
50b518b937d6f8f3a1c2b92b1e72bf5af31f2c21 | 31,575 | py | Python | model_zoo/research/cv/tinynet/src/tinynet.py | xu-weizhen/mindspore | e55642e40b8ce9abafa8e50865b490f0317b4703 | [
"Apache-2.0"
] | 55 | 2020-12-17T10:26:06.000Z | 2022-03-28T07:18:26.000Z | model_zoo/research/cv/tinynet/src/tinynet.py | forwhat461/mindspore | 59a277756eb4faad9ac9afcc7fd526e8277d4994 | [
"Apache-2.0"
] | null | null | null | model_zoo/research/cv/tinynet/src/tinynet.py | forwhat461/mindspore | 59a277756eb4faad9ac9afcc7fd526e8277d4994 | [
"Apache-2.0"
] | 14 | 2021-01-29T02:39:47.000Z | 2022-03-23T05:00:26.000Z | # Copyright 2020 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... | 38.742331 | 125 | 0.619066 |
f2b26eff0b47da5638bbb1783944ed1f1207db2e | 4,551 | py | Python | hypergan/trainers/needs_pytorch/depth_trainer.py | limberc/HyperGAN | b074e74abf0ed9b81bd52084706e3707a47e0fe2 | [
"MIT"
] | 889 | 2016-08-27T01:37:35.000Z | 2018-10-07T19:47:56.000Z | hypergan/trainers/needs_pytorch/depth_trainer.py | limberc/HyperGAN | b074e74abf0ed9b81bd52084706e3707a47e0fe2 | [
"MIT"
] | 101 | 2016-11-30T03:34:02.000Z | 2018-10-02T13:50:52.000Z | hypergan/trainers/needs_pytorch/depth_trainer.py | limberc/HyperGAN | b074e74abf0ed9b81bd52084706e3707a47e0fe2 | [
"MIT"
] | 145 | 2016-09-27T06:56:24.000Z | 2018-09-25T16:09:28.000Z | import numpy as np
import hyperchamber as hc
import inspect
from hypergan.trainers.base_trainer import BaseTrainer
TINY = 1e-12
class DepthTrainer(BaseTrainer):
""" Runs an optimizer multiple times and combines the output into a mixture. """
def _create(self):
self.hist = [0 for i in range(2)]
... | 42.53271 | 156 | 0.568227 |
40f87669808daec092acc21c5cf4cc814146a2ba | 7,724 | py | Python | wetterdienst/additionals/geo_location.py | e-dism/wetterdienst | 158e92b093536dc65d0d4450da3965f079c7d45b | [
"MIT"
] | 1 | 2022-01-31T14:35:46.000Z | 2022-01-31T14:35:46.000Z | wetterdienst/additionals/geo_location.py | e-dism/wetterdienst | 158e92b093536dc65d0d4450da3965f079c7d45b | [
"MIT"
] | null | null | null | wetterdienst/additionals/geo_location.py | e-dism/wetterdienst | 158e92b093536dc65d0d4450da3965f079c7d45b | [
"MIT"
] | null | null | null | """ calculates the nearest weather station to a requested location"""
from _datetime import datetime
from typing import Union, Tuple, Optional
import numpy as np
import pandas as pd
import logging
from scipy.spatial import cKDTree
from wetterdienst.additionals.functions import (
check_parameters,
parse_enumer... | 36.433962 | 88 | 0.685137 |
c3e13cd3b18aa52acc9751e639b9d9ebd93c897d | 809 | py | Python | src/manage.py | nihn/restaurant | 3fe3c44719c299ff17b84eef2a648589035e7d0e | [
"MIT"
] | null | null | null | src/manage.py | nihn/restaurant | 3fe3c44719c299ff17b84eef2a648589035e7d0e | [
"MIT"
] | null | null | null | src/manage.py | nihn/restaurant | 3fe3c44719c299ff17b84eef2a648589035e7d0e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "restaurant.settings")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure that ... | 35.173913 | 77 | 0.644005 |
238df20e4c2ea807d51a3c5a888c728247f3b92f | 1,309 | py | Python | scripts/cond_num_run.py | polyfem/Decoupling-Simulation-Accuracy-from-Mesh-Quality | 955d4aabb6272c8be93728c2a91f70542506a503 | [
"MIT"
] | 2 | 2019-09-20T12:29:08.000Z | 2019-10-01T18:26:05.000Z | scripts/cond_num_run.py | polyfem/Decoupling-Simulation-Accuracy-from-Mesh-Quality | 955d4aabb6272c8be93728c2a91f70542506a503 | [
"MIT"
] | null | null | null | scripts/cond_num_run.py | polyfem/Decoupling-Simulation-Accuracy-from-Mesh-Quality | 955d4aabb6272c8be93728c2a91f70542506a503 | [
"MIT"
] | null | null | null | import os
import json
import subprocess
import tempfile
if __name__ == '__main__':
polyfem_exe = "./PolyFEM_bin"
out_folder = "cond_num"
n_refs = [0, 1, 2, 3]
p_refs = [False, True]
current_folder = cwd = os.getcwd()
with open("test.json", 'r') as f:
json_data = json.load(f)
fo... | 33.564103 | 144 | 0.54851 |
e1d4f9fe285e7402090e9fdb7dc043268ff1499e | 29,811 | py | Python | mypy/checkpattern.py | DiddiLeija/mypy | 40bbfb5f2539f6fc3ea8c9b4de6b62d167bb003f | [
"PSF-2.0"
] | null | null | null | mypy/checkpattern.py | DiddiLeija/mypy | 40bbfb5f2539f6fc3ea8c9b4de6b62d167bb003f | [
"PSF-2.0"
] | null | null | null | mypy/checkpattern.py | DiddiLeija/mypy | 40bbfb5f2539f6fc3ea8c9b4de6b62d167bb003f | [
"PSF-2.0"
] | null | null | null | """Pattern checker. This file is conceptually part of TypeChecker."""
from collections import defaultdict
from typing import List, Optional, Tuple, Dict, NamedTuple, Set, Union
from typing_extensions import Final
import mypy.checker
from mypy.checkmember import analyze_member_access
from mypy.expandtype import expand... | 42.225212 | 99 | 0.577874 |
b8a0a5e628e447031646e37e0535690b73487545 | 36,993 | py | Python | scipy/optimize/tests/test_optimize.py | mandli/scipy | ce90df2874c39595ef69a586a3e7fdd9cb9b6f48 | [
"BSD-3-Clause"
] | 1 | 2016-02-20T13:49:40.000Z | 2016-02-20T13:49:40.000Z | scipy/optimize/tests/test_optimize.py | mandli/scipy | ce90df2874c39595ef69a586a3e7fdd9cb9b6f48 | [
"BSD-3-Clause"
] | null | null | null | scipy/optimize/tests/test_optimize.py | mandli/scipy | ce90df2874c39595ef69a586a3e7fdd9cb9b6f48 | [
"BSD-3-Clause"
] | null | null | null | """
Unit tests for optimization routines from optimize.py and tnc.py
Authors:
Ed Schofield, Nov 2005
Andrew Straw, April 2008
To run it in its simplest form::
nosetests test_optimize.py
"""
from numpy.testing import assert_raises, assert_allclose, \
assert_equal, assert_, TestCase, run_module_suite
... | 39.564706 | 84 | 0.497608 |
400d66a9a4b434f74b1ee895fe636957e1778c97 | 1,357 | py | Python | models/StereoCNN/resnet.py | daili0015/ModelFeast | 0689ced4d0f37be438d3a91908e5e4cc5b7d54b8 | [
"MIT"
] | 247 | 2019-03-05T07:12:29.000Z | 2022-03-29T01:51:17.000Z | models/StereoCNN/resnet.py | jungerschwarz/ModelFeast | 03afca0b129532135910ee2ac72a3b85be795289 | [
"MIT"
] | 8 | 2019-05-21T03:05:27.000Z | 2021-12-09T03:22:51.000Z | models/StereoCNN/resnet.py | jungerschwarz/ModelFeast | 03afca0b129532135910ee2ac72a3b85be795289 | [
"MIT"
] | 47 | 2019-03-05T07:14:13.000Z | 2021-11-11T01:04:28.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: zcy
# @Date: 2019-02-15 15:00:10
# @Last Modified by: zcy
# @Last Modified time: 2019-02-15 15:07:57
from models.StereoCNN.Resnet_module import *
__all__ = [
'resnet10_3d', 'resnet18_3d', 'resnet34_3d',
'resnet101_3d', 'resnet152_3d', 'resnet200... | 21.203125 | 56 | 0.607959 |
e1c80101baf71d2902e63ac8019e46c65e22f2c4 | 5,604 | py | Python | pandasgui/widgets/json_viewer.py | felipeescallon/pandas-GUI | 40327cd2763d830e761475df00d62b8cb29c3438 | [
"MIT"
] | 1 | 2021-04-14T03:06:14.000Z | 2021-04-14T03:06:14.000Z | pandasgui/widgets/json_viewer.py | felipeescallon/pandas-GUI | 40327cd2763d830e761475df00d62b8cb29c3438 | [
"MIT"
] | null | null | null | pandasgui/widgets/json_viewer.py | felipeescallon/pandas-GUI | 40327cd2763d830e761475df00d62b8cb29c3438 | [
"MIT"
] | null | null | null | import collections
import json
import sys
from typing import Union
from PyQt5 import QtCore, QtGui, QtWidgets
from pandasgui.utility import summarize_json
class JsonViewer(QtWidgets.QWidget):
def __init__(self, jdata: Union[list, dict], parent=None):
super().__init__(parent)
self.find_box = QtWi... | 35.694268 | 98 | 0.560849 |
dd979129517e92efc183561c72a38acca4b943e4 | 9,068 | py | Python | rl_coach/architectures/mxnet_components/heads/head.py | jl45621/coach | 9a895a1ac73aff44b2e6eb8e4d01e8ec35ceb084 | [
"Apache-2.0"
] | 1,960 | 2017-10-19T10:31:24.000Z | 2020-11-07T18:19:23.000Z | rl_coach/architectures/mxnet_components/heads/head.py | jl45621/coach | 9a895a1ac73aff44b2e6eb8e4d01e8ec35ceb084 | [
"Apache-2.0"
] | 349 | 2017-10-21T17:17:18.000Z | 2020-10-17T13:39:56.000Z | rl_coach/architectures/mxnet_components/heads/head.py | jl45621/coach | 9a895a1ac73aff44b2e6eb8e4d01e8ec35ceb084 | [
"Apache-2.0"
] | 428 | 2017-10-21T01:32:58.000Z | 2020-11-07T13:49:49.000Z | #
# Copyright (c) 2017 Intel Corporation
#
# 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... | 41.031674 | 119 | 0.672364 |
5b0484683b83109b3d359ba25e33c7cd0ac8296a | 16,079 | py | Python | log_mito/model_633.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_mito/model_633.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | log_mito/model_633.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | # exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', 'BaxA'])
M... | 87.863388 | 710 | 0.80347 |
1b7f823746f28cc5a29e5681813c41480bbf6eb6 | 37,533 | py | Python | Cartwheel/lib/Python26/Lib/site-packages/wx-2.8-msw-unicode/wx/tools/Editra/src/Editra.py | MontyThibault/centre-of-mass-awareness | 58778f148e65749e1dfc443043e9fc054ca3ff4d | [
"MIT"
] | null | null | null | Cartwheel/lib/Python26/Lib/site-packages/wx-2.8-msw-unicode/wx/tools/Editra/src/Editra.py | MontyThibault/centre-of-mass-awareness | 58778f148e65749e1dfc443043e9fc054ca3ff4d | [
"MIT"
] | null | null | null | Cartwheel/lib/Python26/Lib/site-packages/wx-2.8-msw-unicode/wx/tools/Editra/src/Editra.py | MontyThibault/centre-of-mass-awareness | 58778f148e65749e1dfc443043e9fc054ca3ff4d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
###############################################################################
# Name: Editra.py #
# Purpose: Implements Editras App object and the Main method #
# Author: Cody Precord <cprecord@editra.org> ... | 36.020154 | 96 | 0.562945 |
b75373d07fd75c9cd90e27b982cd9dcba100cbc5 | 2,902 | py | Python | dump.py | TimSC/osm2pgcopy | 9276427d4042673fa35d626c80224203148c7c7d | [
"MIT"
] | null | null | null | dump.py | TimSC/osm2pgcopy | 9276427d4042673fa35d626c80224203148c7c7d | [
"MIT"
] | null | null | null | dump.py | TimSC/osm2pgcopy | 9276427d4042673fa35d626c80224203148c7c7d | [
"MIT"
] | null | null | null | from pyo5m import o5m
import gzip, json, config, datetime, time
import psycopg2, psycopg2.extras, psycopg2.extensions #apt install python-psycopg2
if __name__=="__main__":
conn = psycopg2.connect("dbname='{0}' user='{1}' host='{2}' password='{3}'".format(config.dbname, config.dbuser, config.dbhost, config.dbpass))
#... | 30.87234 | 144 | 0.688491 |
3d962f18ecb0de664d1a6d7a82d13509d6db88a3 | 781 | py | Python | machine-learning/image-transformation/scaling.py | gizzmo25/pythoncode-tutorials | 39a413fc1da232ad6de7e5f1e8955564dc65448e | [
"MIT"
] | null | null | null | machine-learning/image-transformation/scaling.py | gizzmo25/pythoncode-tutorials | 39a413fc1da232ad6de7e5f1e8955564dc65448e | [
"MIT"
] | null | null | null | machine-learning/image-transformation/scaling.py | gizzmo25/pythoncode-tutorials | 39a413fc1da232ad6de7e5f1e8955564dc65448e | [
"MIT"
] | null | null | null | import numpy as np
import cv2
import matplotlib.pyplot as plt
# read the input image
img = cv2.imread("city.jpg")
# convert from BGR to RGB so we can plot using matplotlib
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
# disable x & y axis
plt.axis('off')
# show the image
plt.imshow(img)
plt.show()
# get th... | 26.033333 | 58 | 0.663252 |
35250cbff80fd33585a50103fdfb62f992281fd0 | 26,269 | py | Python | salt/fileclient.py | d--j/salt | 579f900be67a80e1a77674bc6aa21fec836c1c4c | [
"Apache-2.0"
] | null | null | null | salt/fileclient.py | d--j/salt | 579f900be67a80e1a77674bc6aa21fec836c1c4c | [
"Apache-2.0"
] | null | null | null | salt/fileclient.py | d--j/salt | 579f900be67a80e1a77674bc6aa21fec836c1c4c | [
"Apache-2.0"
] | null | null | null | '''
Classes that manage file clients
'''
# Import python libs
import contextlib
import logging
import hashlib
import os
import shutil
import string
import subprocess
# Import third party libs
import yaml
# Import salt libs
from salt.exceptions import MinionError, SaltReqTimeoutError
import salt.client
import salt.cr... | 33.42112 | 79 | 0.487609 |
2c6d0ead433a33ba5f421dfec165b692a6b664da | 316 | py | Python | Core/urls.py | FranckyCastell/Clip_365 | 72c49da854ed974ea47c51720eca2e82cf6f73e1 | [
"Apache-2.0"
] | null | null | null | Core/urls.py | FranckyCastell/Clip_365 | 72c49da854ed974ea47c51720eca2e82cf6f73e1 | [
"Apache-2.0"
] | null | null | null | Core/urls.py | FranckyCastell/Clip_365 | 72c49da854ed974ea47c51720eca2e82cf6f73e1 | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from django.urls import path, include
from django.conf import settings
from django.conf.urls.static import static
urlpatterns = [
path('admin/', admin.site.urls),
path('', include('Home.urls')),
]
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) | 28.727273 | 76 | 0.759494 |
751ec55d0ec3fb772407fb26cb40477217d57065 | 22,287 | py | Python | train/train.py | paranoidai/Fairface-Recognition-Solution | 7f12bc4462cc765fe8d7a7fa820c63bfe2cc9121 | [
"MIT"
] | 7 | 2020-07-20T10:16:13.000Z | 2021-07-29T21:00:55.000Z | train/train.py | paranoidai/Fairface-Recognition-Solution | 7f12bc4462cc765fe8d7a7fa820c63bfe2cc9121 | [
"MIT"
] | null | null | null | train/train.py | paranoidai/Fairface-Recognition-Solution | 7f12bc4462cc765fe8d7a7fa820c63bfe2cc9121 | [
"MIT"
] | 3 | 2020-08-03T03:11:04.000Z | 2021-05-15T15:56:58.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import sys
import math
import random
import logging
import sklearn
import pickle
import numpy as np
import mxnet as mx
from mxnet import ndarray as nd
import argparse
import mxnet.optimizer as optimiz... | 42.370722 | 176 | 0.618522 |
64596992f3c829e471bbcb00e22cc63dbcd789e7 | 890 | py | Python | tests/test_tigge.py | eengl/grib2io | 6a3acf8f399faf1c07183919cf8dbcb34f7bec50 | [
"MIT"
] | 10 | 2020-11-03T01:13:14.000Z | 2022-02-04T00:24:23.000Z | tests/test_tigge.py | eengl/grib2io | 6a3acf8f399faf1c07183919cf8dbcb34f7bec50 | [
"MIT"
] | 15 | 2021-02-11T02:33:38.000Z | 2022-03-21T14:34:07.000Z | tests/test_tigge.py | eengl/grib2io | 6a3acf8f399faf1c07183919cf8dbcb34f7bec50 | [
"MIT"
] | 2 | 2021-10-04T23:41:41.000Z | 2022-03-10T17:38:28.000Z | import numpy as np
from mpl_toolkits.basemap import Basemap
from numpy import ma
import pygrib, sys
import matplotlib.pyplot as plt
for grb in pygrib.open('../sampledata/tigge.grb'):
fld = 0.01*grb['values'] # convert to hPa
lats,lons = grb.latlons()
sys.stdout.write('%s %s %s %s' % \
(grb['cen... | 35.6 | 65 | 0.64382 |
1b64ae6d8b439c117729c3881d499cbb8596daf8 | 2,281 | py | Python | examples/muscle_driven_ocp/static_arm.py | Kilperic13/BiorbdOptim | 00668bd1ad00366f16a576f3855a6d207c08b30c | [
"Apache-2.0"
] | null | null | null | examples/muscle_driven_ocp/static_arm.py | Kilperic13/BiorbdOptim | 00668bd1ad00366f16a576f3855a6d207c08b30c | [
"Apache-2.0"
] | null | null | null | examples/muscle_driven_ocp/static_arm.py | Kilperic13/BiorbdOptim | 00668bd1ad00366f16a576f3855a6d207c08b30c | [
"Apache-2.0"
] | null | null | null | import biorbd
from biorbd_optim import (
OptimalControlProgram,
Objective,
ProblemType,
Bounds,
QAndQDotBounds,
InitialConditions,
ShowResult,
)
def prepare_ocp(biorbd_model_path, final_time, number_shooting_points, show_online_optim=False):
# --- Options --- #
# Model path
bi... | 28.5125 | 120 | 0.659798 |
f2346a31fecf1b02f3d77578ee63f676353be7a7 | 4,124 | py | Python | simulation/src/simulation_groundtruth/src/label_camera/label_speaker.py | KITcar-Team/kitcar-gazebo-simulation | 8a9438b5a24c288721ae0302889fe55e26046310 | [
"MIT"
] | 13 | 2020-06-30T17:18:28.000Z | 2021-07-20T16:55:35.000Z | simulation/src/simulation_groundtruth/src/label_camera/label_speaker.py | KITcar-Team/kitcar-gazebo-simulation | 8a9438b5a24c288721ae0302889fe55e26046310 | [
"MIT"
] | 1 | 2020-11-10T20:15:42.000Z | 2020-12-25T18:27:56.000Z | simulation/src/simulation_groundtruth/src/label_camera/label_speaker.py | KITcar-Team/kitcar-gazebo-simulation | 8a9438b5a24c288721ae0302889fe55e26046310 | [
"MIT"
] | 3 | 2020-07-20T09:09:08.000Z | 2021-07-20T17:00:37.000Z | import functools
import math
from typing import List, Tuple
import numpy as np
from gazebo_simulation.msg import CarState as CarStateMsg
from simulation_groundtruth.msg import Section as SectionMsg
from simulation.src.simulation_evaluation.src.speaker.speakers.speaker import Speaker
from simulation.utils.geometry imp... | 34.949153 | 89 | 0.598691 |
fec22cf38c2fe4c7eb28fe82441a7da7c796e2ad | 5,005 | py | Python | ddsc/sdk/azure.py | Duke-GCB/DukeDSClient | 7f119a5ee2e674e8deaff1f080caed1953c5cc61 | [
"MIT"
] | 4 | 2020-06-18T12:30:13.000Z | 2020-10-12T21:25:54.000Z | ddsc/sdk/azure.py | Duke-GCB/DukeDSClient | 7f119a5ee2e674e8deaff1f080caed1953c5cc61 | [
"MIT"
] | 239 | 2016-02-18T14:44:08.000Z | 2022-03-11T14:38:56.000Z | ddsc/sdk/azure.py | Duke-GCB/DukeDSClient | 7f119a5ee2e674e8deaff1f080caed1953c5cc61 | [
"MIT"
] | 10 | 2016-02-22T15:01:28.000Z | 2022-02-21T22:46:26.000Z | from ddsc.exceptions import DDSUserException
class Azure(object):
def __init__(self, config):
# placeholder data until Azure backend is live
self._placeholder_projects = [
AzureProject(self, name="user1/Mouse", auth_role="file_downloader"),
AzureProject(self, name="user1/rn... | 35 | 105 | 0.622178 |
e0ec66a3af65bb2d18207915fabb55eb806a3352 | 577 | py | Python | explosig_data/__init__.py | lrgr/explosig-data | 9fd11e5252e3fb112dc7a3e55cb7b40d8b8d5efb | [
"MIT"
] | 1 | 2020-01-30T17:55:03.000Z | 2020-01-30T17:55:03.000Z | explosig_data/__init__.py | keller-mark/explosig-data | 9fd11e5252e3fb112dc7a3e55cb7b40d8b8d5efb | [
"MIT"
] | 1 | 2020-02-20T15:03:54.000Z | 2020-02-20T23:44:14.000Z | explosig_data/__init__.py | keller-mark/explosig-data | 9fd11e5252e3fb112dc7a3e55cb7b40d8b8d5efb | [
"MIT"
] | 1 | 2020-01-12T14:17:20.000Z | 2020-01-12T14:17:20.000Z | import os
import logging
from .constants import *
from .utils import clean_ssm_df
from .ssm_extended import extend_ssm_df
from .ssm_counts import counts_from_extended_ssm_df
from .ssm_container import SimpleSomaticMutationContainer
from .data_source_ICGC import standardize_ICGC_ssm_file
from .data_source_TCGA import s... | 25.086957 | 74 | 0.811092 |
1fcdaa1ce75e66ddf47b3e2831b96e0fb83e8cab | 19,249 | py | Python | p099.py | arpit0891/Project-euler | ab36b33c578578595bb518508fa2fe5862f4a044 | [
"MIT"
] | 1 | 2020-05-14T09:22:32.000Z | 2020-05-14T09:22:32.000Z | p099.py | prve17/Project-Euler | 1ff72404ca9ebe7de2eab83d43960d86bc487515 | [
"MIT"
] | 1 | 2020-03-13T12:42:28.000Z | 2020-05-13T13:26:32.000Z | p099.py | prve17/Project-Euler | 1ff72404ca9ebe7de2eab83d43960d86bc487515 | [
"MIT"
] | 3 | 2020-05-13T13:39:46.000Z | 2020-06-26T10:44:53.000Z |
def compute():
ans = None
maxval = None
for (i, val) in enumerate(DATA):
if maxval is None or compare_powers(val, maxval) > 0:
ans = i + 1
maxval = val
return str(ans)
def compare_powers(pairx, pairy):
# First try fast low-precision computations, retrying with increasing precision
precision = 16
while... | 97.71066 | 170 | 0.694166 |
fcfada9396e0996a819c830f8371a6649b9d01f4 | 6,039 | py | Python | crafts/bin/craft_mac_app.py | gwk/glossy | 6976ca4fd1efc09d9cd670b1fe37817c05b4b529 | [
"CC0-1.0"
] | 7 | 2019-05-04T00:51:38.000Z | 2021-12-10T15:36:31.000Z | crafts/bin/craft_mac_app.py | gwk/glossy | 6976ca4fd1efc09d9cd670b1fe37817c05b4b529 | [
"CC0-1.0"
] | null | null | null | crafts/bin/craft_mac_app.py | gwk/glossy | 6976ca4fd1efc09d9cd670b1fe37817c05b4b529 | [
"CC0-1.0"
] | 1 | 2016-07-30T22:38:08.000Z | 2016-07-30T22:38:08.000Z | # Dedicated to the public domain under CC0: https://creativecommons.org/publicdomain/zero/1.0/.
'''
`craft-mac-app` is an experimental build tool that builds a complete mac app without using Xcode.
The steps to build a functioning app were discovered by looking at the raw build logs in an Xcode application.
This is no... | 36.823171 | 132 | 0.714522 |
f2357a4e4a34a2c4d4652e17052f3088c074b4a6 | 20,278 | py | Python | src/python/grpcio_tests/tests/channelz/_channelz_servicer_test.py | timgates42/grpc | f78966eb522fe37bff65e609a7847cf473483291 | [
"Apache-2.0"
] | 2 | 2019-08-16T08:14:27.000Z | 2020-02-08T02:16:15.000Z | src/python/grpcio_tests/tests/channelz/_channelz_servicer_test.py | timgates42/grpc | f78966eb522fe37bff65e609a7847cf473483291 | [
"Apache-2.0"
] | null | null | null | src/python/grpcio_tests/tests/channelz/_channelz_servicer_test.py | timgates42/grpc | f78966eb522fe37bff65e609a7847cf473483291 | [
"Apache-2.0"
] | 2 | 2019-08-16T07:52:52.000Z | 2020-08-14T13:39:16.000Z | # Copyright 2018 The gRPC Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 42.60084 | 86 | 0.677532 |
5ffd64db0a180273e0e2fce56f5468babe83a663 | 956 | py | Python | tests/constraints/test_traversal.py | bartfrenk/constraints | ef5f865307cc58e416f464882f74153614775c2f | [
"BSD-3-Clause"
] | null | null | null | tests/constraints/test_traversal.py | bartfrenk/constraints | ef5f865307cc58e416f464882f74153614775c2f | [
"BSD-3-Clause"
] | null | null | null | tests/constraints/test_traversal.py | bartfrenk/constraints | ef5f865307cc58e416f464882f74153614775c2f | [
"BSD-3-Clause"
] | null | null | null | import constraints.traversal as sut
def _adj_fn(graph):
def fn(i):
return graph[i]
return fn
gamma = {0: [1, 2, 6], 1: [], 2: [1, 4], 3: [], 4: [3], 5: [1, 3], 6: [2]}
cycle = {0: [1], 1: [2], 2: [3], 3: [0]}
class TestMultiPaths(object):
# pylint: disable=no-self-use
def test_correct_r... | 25.157895 | 74 | 0.549163 |
ab314767d64f2899bd20cf0d4e2c4e1c850ebe4b | 2,480 | py | Python | scikit-learn-weighted_kde/examples/linear_model/plot_logistic_multinomial.py | RTHMaK/git-squash-master | 76c4c8437dd18114968e69a698f4581927fcdabf | [
"BSD-2-Clause"
] | null | null | null | scikit-learn-weighted_kde/examples/linear_model/plot_logistic_multinomial.py | RTHMaK/git-squash-master | 76c4c8437dd18114968e69a698f4581927fcdabf | [
"BSD-2-Clause"
] | null | null | null | scikit-learn-weighted_kde/examples/linear_model/plot_logistic_multinomial.py | RTHMaK/git-squash-master | 76c4c8437dd18114968e69a698f4581927fcdabf | [
"BSD-2-Clause"
] | null | null | null | """
====================================================
Plot multinomial and One-vs-Rest Logistic Regression
====================================================
Plot decision surface of multinomial and One-vs-Rest Logistic Regression.
The hyperplanes corresponding to the three One-vs-Rest (OVR) classifiers
are repre... | 34.929577 | 74 | 0.603226 |
2458ab55fecb56acc09174d42196b5882fbb94c3 | 1,593 | py | Python | staging/versions/f1f0b96dd139_.py | farbodab/flatteningthecurve | 692fd9c8d78355e1208ff85a2cd1038da11c392f | [
"MIT"
] | 1 | 2020-03-24T23:46:29.000Z | 2020-03-24T23:46:29.000Z | staging/versions/f1f0b96dd139_.py | farbodab/flatteningthecurve | 692fd9c8d78355e1208ff85a2cd1038da11c392f | [
"MIT"
] | 13 | 2021-02-08T20:51:14.000Z | 2022-03-12T00:43:30.000Z | staging/versions/f1f0b96dd139_.py | farbodab/flatteningthecurve | 692fd9c8d78355e1208ff85a2cd1038da11c392f | [
"MIT"
] | 3 | 2020-06-09T20:24:29.000Z | 2020-06-09T20:26:16.000Z | """empty message
Revision ID: f1f0b96dd139
Revises: 110a27b89211
Create Date: 2020-05-25 00:24:47.226707
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'f1f0b96dd139'
down_revision = '110a27b89211'
branch_labels = None
depends_on = None
def upgrade():
# ... | 34.630435 | 91 | 0.684871 |
bd6b5501f653b268cb4065656bea66968103f4e7 | 160 | py | Python | project4/network/forms.py | VincVader/Social-Network | 91751e199c904a38e03470c1ea0386b2d04851d8 | [
"MIT"
] | null | null | null | project4/network/forms.py | VincVader/Social-Network | 91751e199c904a38e03470c1ea0386b2d04851d8 | [
"MIT"
] | null | null | null | project4/network/forms.py | VincVader/Social-Network | 91751e199c904a38e03470c1ea0386b2d04851d8 | [
"MIT"
] | null | null | null | from django import forms
from .models import Like, Post, User
class NewPost(forms.ModelForm):
class Meta:
model = Post
fields = {'content'} | 22.857143 | 36 | 0.6625 |
067c7fd4f34782debfe0ce32825863b037f4f73f | 7,052 | py | Python | ard/util.py | ms860309/AutomaticReactionDiscovery | ea009e1066058afd8a6a5d317d28d79016d8c93e | [
"MIT"
] | 1 | 2020-07-12T11:42:49.000Z | 2020-07-12T11:42:49.000Z | ard/util.py | ms860309/AutomaticReactionDiscovery | ea009e1066058afd8a6a5d317d28d79016d8c93e | [
"MIT"
] | null | null | null | ard/util.py | ms860309/AutomaticReactionDiscovery | ea009e1066058afd8a6a5d317d28d79016d8c93e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Provides utility functions and classes.
"""
from __future__ import division
import bisect
from functools import wraps
import logging
import os
import shutil
import time
import numpy as np
from quantum import Gaussian, QChem, NWChem
################################... | 33.107981 | 103 | 0.574022 |
ce5154ca3447395dd05119db64d53732e998c017 | 1,539 | py | Python | domain_adaptation/models/M64/VAE_64.py | DexiongYung/robustnav_AE | f2b1b5bb8780e4e6ae5f81c127b7589cfc949801 | [
"MIT"
] | null | null | null | domain_adaptation/models/M64/VAE_64.py | DexiongYung/robustnav_AE | f2b1b5bb8780e4e6ae5f81c127b7589cfc949801 | [
"MIT"
] | null | null | null | domain_adaptation/models/M64/VAE_64.py | DexiongYung/robustnav_AE | f2b1b5bb8780e4e6ae5f81c127b7589cfc949801 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
from domain_adaptation.models.common import *
from domain_adaptation.models.M64.M64 import M64
class Encoder(nn.Module):
def __init__(self, content_latent_size = 32, input_channel = 3, flatten_size = 1024):
super(Encoder, self).__init__()
self.encoder = carracing_... | 38.475 | 99 | 0.684211 |
66e90807248e6b36d66e2c2d16d9b38671ad2c15 | 3,494 | py | Python | monai/utils/state_cacher.py | RobinCamarasa/MONAI | 8207e1e2a3555ddc3fe938e058552651900dc951 | [
"Apache-2.0"
] | 1 | 2022-01-04T21:38:23.000Z | 2022-01-04T21:38:23.000Z | monai/utils/state_cacher.py | RobinCamarasa/MONAI | 8207e1e2a3555ddc3fe938e058552651900dc951 | [
"Apache-2.0"
] | null | null | null | monai/utils/state_cacher.py | RobinCamarasa/MONAI | 8207e1e2a3555ddc3fe938e058552651900dc951 | [
"Apache-2.0"
] | null | null | null | import copy
import os
import tempfile
from typing import Dict, Optional
import torch
__all__ = ["StateCacher"]
class StateCacher:
"""Class to cache and retrieve the state of an object.
Objects can either be stored in memory or on disk. If stored on disk, they can be
stored in a given directory, or alte... | 37.569892 | 92 | 0.615341 |
e834925a275182f5ce1ef3fa06763e60def0f36f | 67,256 | py | Python | src/opserver/test/utils/analytics_fixture.py | safchain/contrail-controller | ccf736b96e4372132cb27a37d47f43373e56b320 | [
"Apache-2.0"
] | null | null | null | src/opserver/test/utils/analytics_fixture.py | safchain/contrail-controller | ccf736b96e4372132cb27a37d47f43373e56b320 | [
"Apache-2.0"
] | null | null | null | src/opserver/test/utils/analytics_fixture.py | safchain/contrail-controller | ccf736b96e4372132cb27a37d47f43373e56b320 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2013 Juniper Networks, Inc. All rights reserved.
#
import resource
import socket
import fixtures
import subprocess
from util import retry
from mockredis import mockredis
import redis
import urllib2
import copy
import os
import json
from operator import itemgetter
from opserver_introspect_utils import... | 43.085202 | 126 | 0.556501 |
a59463c45ea3400c9a94d95dc3bc86834963ed9a | 14,100 | py | Python | FASHION/run.py | sbuschjaeger/gncl | b76664c9d585964f9dcede00265263cb7a545654 | [
"MIT"
] | 3 | 2021-06-21T12:57:46.000Z | 2021-12-25T08:31:37.000Z | FASHION/run.py | sbuschjaeger/gncl | b76664c9d585964f9dcede00265263cb7a545654 | [
"MIT"
] | null | null | null | FASHION/run.py | sbuschjaeger/gncl | b76664c9d585964f9dcede00265263cb7a545654 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import sys
import pickle
import tarfile
from datetime import datetime
from functools import partial
import argparse
import glob
import numpy as np
import pandas as pd
import torch
import scipy
import torch
from torch import nn
from torch.autograd import Variable
import torchvision
im... | 38.419619 | 161 | 0.57227 |
6464f9c5c882d6bc2fa7f2b1cac364997f4cb200 | 28,894 | py | Python | scripts/dts/extract_dts_includes.py | gaoxiang89/zephyr | 5925112ee602e55bd62c92d6506f94f96cbc8c21 | [
"Apache-2.0"
] | 1 | 2021-01-22T15:32:40.000Z | 2021-01-22T15:32:40.000Z | scripts/dts/extract_dts_includes.py | cpeniche/zephyr | 1e91447b99eb8ee93fbc8a3e4a5247ff7e092a12 | [
"Apache-2.0"
] | null | null | null | scripts/dts/extract_dts_includes.py | cpeniche/zephyr | 1e91447b99eb8ee93fbc8a3e4a5247ff7e092a12 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# vim: ai:ts=4:sw=4
import sys
from os import listdir
import os, fnmatch
import re
import yaml
import argparse
import collections
from devicetree import parse_file
# globals
compatibles = {}
phandles = {}
aliases = {}
chosen = {}
reduced = {}
def convert_string_to_label(s):
# Transmute ... | 31.440696 | 80 | 0.551741 |
6e25eb9849a2464bbd0b335e4a4b7d31cdea73e4 | 4,433 | py | Python | denguefever_tw/dengue_linebot/models.py | NCKU-CCS/line_bot_server | 954ac77640466f625cc52c2ca8bacd37e87517a3 | [
"MIT"
] | 3 | 2016-12-31T15:06:44.000Z | 2017-10-14T16:25:02.000Z | denguefever_tw/dengue_linebot/models.py | NCKU-CCS/line_bot_server | 954ac77640466f625cc52c2ca8bacd37e87517a3 | [
"MIT"
] | 8 | 2017-06-02T14:21:59.000Z | 2021-06-09T17:41:54.000Z | denguefever_tw/dengue_linebot/models.py | NCKU-CCS/line_bot_server | 954ac77640466f625cc52c2ca8bacd37e87517a3 | [
"MIT"
] | 3 | 2017-05-26T06:32:59.000Z | 2017-07-18T01:27:03.000Z | from django.contrib.gis.db import models
from django.contrib.gis.geos import Point
import logging
logger = logging.getLogger(__name__)
class LineUser(models.Model):
user_id = models.TextField(primary_key=True)
name = models.TextField()
picture_url = models.TextField(blank=True)
status_message = mod... | 33.08209 | 114 | 0.671329 |
1d4fa33816e8567379cf4e4af4c2df73d215d590 | 113 | py | Python | play/backupFirebaseDB.py | WorldViews/FlowerGarden | af274812bd4de1b0bb1e1f17898cc2f7853c65a1 | [
"CC0-1.0"
] | 2 | 2020-06-05T07:50:29.000Z | 2020-06-05T20:53:55.000Z | play/backupFirebaseDB.py | WorldViews/FlowerGarden | af274812bd4de1b0bb1e1f17898cc2f7853c65a1 | [
"CC0-1.0"
] | 4 | 2020-07-07T16:51:39.000Z | 2021-03-08T03:11:50.000Z | play/backupFirebaseDB.py | WorldViews/FlowerGarden | af274812bd4de1b0bb1e1f17898cc2f7853c65a1 | [
"CC0-1.0"
] | 1 | 2020-07-27T08:29:19.000Z | 2020-07-27T08:29:19.000Z |
from FireTopics import FireDB
fdb = FireDB()
#fdb.dump("firebase.db.json")
fdb.saveDB("./firebaseDB.bak.json")
| 16.142857 | 35 | 0.725664 |
7ecee44cce0a1b39c5897bfd60ca5c413207a46d | 996 | py | Python | Back-End/Python/External Libraries/Flask/Flask_Fast-Food/Simple-Form/wtf_form.py | ASHISHKUMAR2411/Programming-CookBook | 9c60655d64d21985ccb4196360858d98344701f9 | [
"MIT"
] | 25 | 2021-04-28T02:51:26.000Z | 2022-03-24T13:58:04.000Z | Back-End/Python/External Libraries/Flask/Flask_Fast-Food/Simple-Form/wtf_form.py | ASHISHKUMAR2411/Programming-CookBook | 9c60655d64d21985ccb4196360858d98344701f9 | [
"MIT"
] | 1 | 2022-03-03T23:33:41.000Z | 2022-03-03T23:35:41.000Z | Back-End/Python/External Libraries/Flask/Flask_Fast-Food/Simple-Form/wtf_form.py | ASHISHKUMAR2411/Programming-CookBook | 9c60655d64d21985ccb4196360858d98344701f9 | [
"MIT"
] | 15 | 2021-05-30T01:35:20.000Z | 2022-03-25T12:38:25.000Z |
from wtforms import Form, BooleanField, StringField, PasswordField, validators
class RegistrationForm(Form):
username = StringField('Username', [validators.Length(min=4, max=25)])
email = StringField('Email Address', [validators.Length(min=6, max=35)])
password = PasswordField('New Password', [
v... | 38.307692 | 78 | 0.678715 |
afc1e4bd5aec36d7dc5d7aa304eec1627c61f5d8 | 77,215 | py | Python | python/ray/worker.py | amitsadaphule/ray | 0b9fbc1c0f767e14b80e5bbf92b898ed6c9e1cff | [
"Apache-2.0"
] | null | null | null | python/ray/worker.py | amitsadaphule/ray | 0b9fbc1c0f767e14b80e5bbf92b898ed6c9e1cff | [
"Apache-2.0"
] | null | null | null | python/ray/worker.py | amitsadaphule/ray | 0b9fbc1c0f767e14b80e5bbf92b898ed6c9e1cff | [
"Apache-2.0"
] | null | null | null | from contextlib import contextmanager
import colorama
import atexit
import faulthandler
import hashlib
import inspect
import io
import json
import logging
import os
import redis
import signal
from six.moves import queue
import sys
import threading
import time
import traceback
import random
# Ray modules
import ray.clo... | 41.225307 | 82 | 0.64753 |
a3d8871f95f40846374d0ae5e93e2afa9506c8e1 | 934 | py | Python | solutions/Count Submatrices With All Ones/solution.py | nilax97/leetcode-solutions | d3c12f2b289662d199510e0431e177bbf3cda121 | [
"MIT"
] | 3 | 2021-06-06T22:03:15.000Z | 2021-06-08T08:49:04.000Z | solutions/Count Submatrices With All Ones/solution.py | nilax97/leetcode-solutions | d3c12f2b289662d199510e0431e177bbf3cda121 | [
"MIT"
] | null | null | null | solutions/Count Submatrices With All Ones/solution.py | nilax97/leetcode-solutions | d3c12f2b289662d199510e0431e177bbf3cda121 | [
"MIT"
] | null | null | null | class Solution:
def numSubmat(self, mat: List[List[int]]) -> int:
m, n = len(mat), len(mat[0])
#precipitate mat to histogram
for i in range(m):
for j in range(n):
if mat[i][j] and i > 0:
mat[i][j] += mat[i-1][j] #histogram
... | 35.923077 | 93 | 0.421842 |
01f00b261e337f01f29d2e77a2788add9814d4f3 | 169,330 | py | Python | tests/test__mongomock.py | andriyor/mongomock | 64cccf51bfb3e15eb65f380bbc65a59d218cf6d3 | [
"BSD-3-Clause"
] | null | null | null | tests/test__mongomock.py | andriyor/mongomock | 64cccf51bfb3e15eb65f380bbc65a59d218cf6d3 | [
"BSD-3-Clause"
] | null | null | null | tests/test__mongomock.py | andriyor/mongomock | 64cccf51bfb3e15eb65f380bbc65a59d218cf6d3 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from collections import OrderedDict
import copy
import datetime
import os
from packaging import version
import re
import sys
import time
from unittest import TestCase, skipIf, skipUnless
import uuid
import mongomock
from mongomock import ConfigurationError
from mongomock import Database
from mo... | 38.757153 | 99 | 0.494968 |
226d489cafe507067cd1d3e7718b9f5cdd849a04 | 3,985 | py | Python | code/DeepDG/utils/util.py | HXWAndCL/transferlearning | 362326cc3d375320a480f89527d14878f7224392 | [
"MIT"
] | 3 | 2021-11-04T01:20:32.000Z | 2022-03-22T01:50:29.000Z | code/DeepDG/utils/util.py | FuSiry/transferlearning | 04133d73df12ad1ae771f8c12d07b50531437131 | [
"MIT"
] | null | null | null | code/DeepDG/utils/util.py | FuSiry/transferlearning | 04133d73df12ad1ae771f8c12d07b50531437131 | [
"MIT"
] | null | null | null | # coding=utf-8
import random
import numpy as np
import torch
import sys
import os
import torchvision
import PIL
def set_random_seed(seed=0):
# seed setting
random.seed(seed)
np.random.seed(seed)
torch.manual_seed(seed)
torch.cuda.manual_seed(seed)
torch.backends.cudnn.deterministic = True
... | 30.419847 | 67 | 0.555834 |
7e422fdc11f80189c7041a45555c07cc87bede1d | 12,279 | py | Python | official/nlp/keras_nlp/layers/transformer_encoder_block_test.py | lorynebissuel/models | 7f597cf851c793ce1b8db7a93a94894b04424d4c | [
"Apache-2.0"
] | 2 | 2021-04-02T12:21:35.000Z | 2021-12-14T07:29:38.000Z | official/nlp/keras_nlp/layers/transformer_encoder_block_test.py | lorynebissuel/models | 7f597cf851c793ce1b8db7a93a94894b04424d4c | [
"Apache-2.0"
] | null | null | null | official/nlp/keras_nlp/layers/transformer_encoder_block_test.py | lorynebissuel/models | 7f597cf851c793ce1b8db7a93a94894b04424d4c | [
"Apache-2.0"
] | 3 | 2019-11-12T11:18:11.000Z | 2021-12-29T09:14:37.000Z | # Copyright 2019 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... | 40.65894 | 101 | 0.714879 |
4ae168c50b0f1ef04a141fbbe3fb4dcf751dcd19 | 1,873 | py | Python | babel/sierra_adapters/webpac_scraper.py | BookOps-CAT/babel | 47c8102bfbad8466185cd0e70501a931dd79ef29 | [
"CC0-1.0",
"CC-BY-4.0"
] | null | null | null | babel/sierra_adapters/webpac_scraper.py | BookOps-CAT/babel | 47c8102bfbad8466185cd0e70501a931dd79ef29 | [
"CC0-1.0",
"CC-BY-4.0"
] | 125 | 2017-10-12T12:14:23.000Z | 2022-03-11T23:50:19.000Z | babel/sierra_adapters/webpac_scraper.py | BookOps-CAT/babel | 47c8102bfbad8466185cd0e70501a931dd79ef29 | [
"CC0-1.0",
"CC-BY-4.0"
] | null | null | null | # adapter for web scraping classic III WebPac
import logging
import re
from bs4 import BeautifulSoup
import requests
from requests.exceptions import RequestException, Timeout
from errors import BabelError
BPL_SEARCH_URL = 'https://iii.brooklynpubliclibrary.org/search/i'
NYPL_SEARCH_URL = 'https://catalog.nypl.org... | 24.644737 | 75 | 0.616658 |
fb31c2a13e98ace5ef855a9c04cec3f3bd134758 | 1,949 | py | Python | test/test_workflow_control_task_ref.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 21 | 2018-03-29T14:20:35.000Z | 2021-10-13T05:11:41.000Z | test/test_workflow_control_task_ref.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 14 | 2018-01-30T15:45:46.000Z | 2022-02-23T14:23:21.000Z | test/test_workflow_control_task_ref.py | sdnit-se/intersight-python | 551f7685c0f76bb8af60ec83ffb6f9672d49a4ae | [
"Apache-2.0"
] | 18 | 2018-01-03T15:09:56.000Z | 2021-07-16T02:21:54.000Z | # coding: utf-8
"""
Cisco Intersight
Cisco Intersight is a management platform delivered as a service with embedded analytics for your Cisco and 3rd party IT infrastructure. This platform offers an intelligent level of management that enables IT organizations to analyze, simplify, and automate their environmen... | 51.289474 | 1,052 | 0.783992 |
a274d887c9ff946384b6b61c07c37581b1a78e1e | 1,430 | py | Python | aliyun-python-sdk-ocr/aliyunsdkocr/request/v20191230/RecognizePoiNameRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 1,001 | 2015-07-24T01:32:41.000Z | 2022-03-25T01:28:18.000Z | aliyun-python-sdk-ocr/aliyunsdkocr/request/v20191230/RecognizePoiNameRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 363 | 2015-10-20T03:15:00.000Z | 2022-03-08T12:26:19.000Z | aliyun-python-sdk-ocr/aliyunsdkocr/request/v20191230/RecognizePoiNameRequest.py | yndu13/aliyun-openapi-python-sdk | 12ace4fb39fe2fb0e3927a4b1b43ee4872da43f5 | [
"Apache-2.0"
] | 682 | 2015-09-22T07:19:02.000Z | 2022-03-22T09:51:46.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 u... | 37.631579 | 75 | 0.765734 |
fcb3f55531b4a530783ee0acc22ad9e9bf1afbfb | 6,695 | py | Python | bindings/python/ensmallen_graph/datasets/string/cyanobiumspcaciam14.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/cyanobiumspcaciam14.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/cyanobiumspcaciam14.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | """
This file offers the methods to automatically retrieve the graph Cyanobium sp. CACIAM14.
The graph is automatically retrieved from the STRING repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime: 2021... | 35.42328 | 223 | 0.702614 |
f87943a1caa87568b4208e7d195dbf43476741ef | 208 | py | Python | maro/data_lib/__init__.py | VinayaSathyanarayana/maro | 0ba55f36d89c235ef3af04efbac78b3885d8695d | [
"MIT"
] | 1 | 2020-09-30T09:31:05.000Z | 2020-09-30T09:31:05.000Z | maro/data_lib/__init__.py | VinayaSathyanarayana/maro | 0ba55f36d89c235ef3af04efbac78b3885d8695d | [
"MIT"
] | null | null | null | maro/data_lib/__init__.py | VinayaSathyanarayana/maro | 0ba55f36d89c235ef3af04efbac78b3885d8695d | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
from .binary_reader import BinaryReader
from .binary_converter import BinaryConverter
__all__ = ["BinaryReader", "BinaryConverter"]
| 23.111111 | 45 | 0.798077 |
2622046c0bd2c5364a5fb7364a94f68a6cc03293 | 1,152 | py | Python | Python/simple_pyramid_blending.py | avishayzanbar/EDR | 104d6deec7a15726b1e79f1fb3f16034f6b09af1 | [
"Apache-2.0"
] | 4 | 2017-11-16T10:31:55.000Z | 2020-11-08T16:05:09.000Z | Python/simple_pyramid_blending.py | avishayzanbar/EDR | 104d6deec7a15726b1e79f1fb3f16034f6b09af1 | [
"Apache-2.0"
] | null | null | null | Python/simple_pyramid_blending.py | avishayzanbar/EDR | 104d6deec7a15726b1e79f1fb3f16034f6b09af1 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from reflect_image import reflect_image
from gaussian_pyramid import gaussian_pyramid
from laplacian_pyramid import laplacian_pyramid
from pyramid_blend import expand_level
def simple_pyramid_blending(A, B, R, N):
[rows, cols, _] = A.shape
reflected_A = reflect_image(A, rows, cols)
re... | 34.909091 | 107 | 0.716146 |
99e75e112373299a3e8becc077374b5bbb6e0b78 | 5,149 | py | Python | tests/test_getRTMSDataSvcSHTrade.py | nhlsm/PyDataGoKr | 93521ee648da4727b98279db9ed4b1d9ed928972 | [
"Apache-2.0"
] | 2 | 2021-04-26T05:20:56.000Z | 2021-05-30T03:30:41.000Z | tests/test_getRTMSDataSvcSHTrade.py | nhlsm/PyDataGoKr | 93521ee648da4727b98279db9ed4b1d9ed928972 | [
"Apache-2.0"
] | null | null | null | tests/test_getRTMSDataSvcSHTrade.py | nhlsm/PyDataGoKr | 93521ee648da4727b98279db9ed4b1d9ed928972 | [
"Apache-2.0"
] | null | null | null | import logging
import sys
import pprint
import enum
import typing
import unittest
from collections import OrderedDict
import requests
import xmltodict
import pandas as pd
import data_go_kr
from data_go_kr import getRTMSDataSvcSHTrade as svc
from data_go_kr.utils.dong_code import *
class Test0(unittest.TestCase):
... | 39.007576 | 94 | 0.630608 |
701a0c2770c94977e1b55709cc0697eb36641e25 | 7,060 | py | Python | service/monitoringnode.py | gabriellsesam/statuspage | bd3f381bda18c2f7e45554ba05a859a812ee17ab | [
"Apache-2.0"
] | null | null | null | service/monitoringnode.py | gabriellsesam/statuspage | bd3f381bda18c2f7e45554ba05a859a812ee17ab | [
"Apache-2.0"
] | null | null | null | service/monitoringnode.py | gabriellsesam/statuspage | bd3f381bda18c2f7e45554ba05a859a812ee17ab | [
"Apache-2.0"
] | 1 | 2020-05-19T08:44:16.000Z | 2020-05-19T08:44:16.000Z | #!/usr/bin/env python3
import datetime
import json
import logging
import os
import sys
from emailsender import Emailsender
from vault_client import VaultClient
import requests
__author__ = "Ravish Ranjan"
required_env_vars = ["SESAM_API_URL", "PAGE_ID", "COMPONENT_ID"]
optional_env_vars = ["GROUP_ID"]
email_env_var... | 35.477387 | 135 | 0.643343 |
814af10c0d6d65c98ab3f92ae2e4e8a7130f73f0 | 3,114 | py | Python | exercises/fit_gaussian_estimators.py | baruchis123/IML.HUJI | a88be10dbb83072233913082b54df849983f500a | [
"MIT"
] | null | null | null | exercises/fit_gaussian_estimators.py | baruchis123/IML.HUJI | a88be10dbb83072233913082b54df849983f500a | [
"MIT"
] | null | null | null | exercises/fit_gaussian_estimators.py | baruchis123/IML.HUJI | a88be10dbb83072233913082b54df849983f500a | [
"MIT"
] | null | null | null | from IMLearn.learners import UnivariateGaussian, MultivariateGaussian
import numpy as np
import plotly.graph_objects as go
import plotly.io as pio
import plotly.express as px
pio.templates.default = "simple_white"
def test_univariate_gaussian():
# Question 1 - Draw samples and print fitted model
batch = np.ra... | 40.441558 | 118 | 0.641618 |
4e9855f14b5657edbd9c26b911ca946e2389f81f | 6,909 | py | Python | Botnets/App/App Web/PDG-env/lib/python3.6/site-packages/pip/req/req_uninstall.py | i2tResearch/Ciberseguridad_web | ac3dd934a60628532e3538369cb145d9a8f33e4f | [
"MIT"
] | 9 | 2021-10-01T22:02:58.000Z | 2021-11-09T17:48:45.000Z | Botnets/App/App Web/PDG-env/lib/python3.6/site-packages/pip/req/req_uninstall.py | i2tResearch/Ciberseguridad_web | ac3dd934a60628532e3538369cb145d9a8f33e4f | [
"MIT"
] | null | null | null | Botnets/App/App Web/PDG-env/lib/python3.6/site-packages/pip/req/req_uninstall.py | i2tResearch/Ciberseguridad_web | ac3dd934a60628532e3538369cb145d9a8f33e4f | [
"MIT"
] | null | null | null | from __future__ import absolute_import
import logging
import os
import tempfile
from pip.compat import uses_pycache, WINDOWS, cache_from_source
from pip.exceptions import UninstallationError
from pip.utils import rmtree, ask, is_local, renames, normalize_path
from pip.utils.logging import indent_log
logger = loggin... | 35.25 | 79 | 0.558402 |
c130487451ae0ac400ad51279bc26a92b1abfe69 | 490 | py | Python | recipes/libnl/all/test_package/conanfile.py | rockandsalt/conan-center-index | d739adcec3e4dd4c250eff559ceb738e420673dd | [
"MIT"
] | 562 | 2019-09-04T12:23:43.000Z | 2022-03-29T16:41:43.000Z | recipes/libnl/all/test_package/conanfile.py | rockandsalt/conan-center-index | d739adcec3e4dd4c250eff559ceb738e420673dd | [
"MIT"
] | 9,799 | 2019-09-04T12:02:11.000Z | 2022-03-31T23:55:45.000Z | recipes/libnl/all/test_package/conanfile.py | rockandsalt/conan-center-index | d739adcec3e4dd4c250eff559ceb738e420673dd | [
"MIT"
] | 1,126 | 2019-09-04T11:57:46.000Z | 2022-03-31T16:43:38.000Z | import os.path
from conans import ConanFile, CMake, tools
class NetlinkTestConan(ConanFile):
settings = "os", "compiler", "build_type", "arch"
generators = "cmake"
def build(self):
cmake = CMake(self)
cmake.configure()
cmake.build()
def test(self):
if not tools.cross... | 25.789474 | 76 | 0.640816 |
ee91c4195335014b61e3f949ceb66013360a80db | 698 | py | Python | tests/unit/notice_fetcher/test_fake_ted_api.py | meaningfy-ws/ted-xml-2-rdf | ac26a19f3761b7cf79d79a46be6323b658f067eb | [
"Apache-2.0"
] | 1 | 2022-03-21T12:32:52.000Z | 2022-03-21T12:32:52.000Z | tests/unit/notice_fetcher/test_fake_ted_api.py | meaningfy-ws/ted-xml-2-rdf | ac26a19f3761b7cf79d79a46be6323b658f067eb | [
"Apache-2.0"
] | 24 | 2022-02-10T10:43:56.000Z | 2022-03-29T12:36:21.000Z | tests/unit/notice_fetcher/test_fake_ted_api.py | meaningfy-ws/ted-sws | d1e351eacb2900f84ec7edc457e49d8202fbaff5 | [
"Apache-2.0"
] | null | null | null | import datetime
from tests.fakes.fake_ted_api import FakeTedApiAdapter
def test_fake_ted_api():
fake_document_search = FakeTedApiAdapter()
get_by_date = fake_document_search.get_by_range_date(start_date=datetime.date(2020, 1, 1),
end_date=datetime.dat... | 38.777778 | 94 | 0.702006 |
51831978d8d6b549a7dc1d2900745118dc39faec | 11,024 | py | Python | core/domain/search_services.py | bching/oppia | 9e9b6d756859b8bc1e46f88a1be8736f8398a8d8 | [
"Apache-2.0"
] | 1 | 2017-11-30T02:16:01.000Z | 2017-11-30T02:16:01.000Z | core/domain/search_services.py | bching/oppia | 9e9b6d756859b8bc1e46f88a1be8736f8398a8d8 | [
"Apache-2.0"
] | null | null | null | core/domain/search_services.py | bching/oppia | 9e9b6d756859b8bc1e46f88a1be8736f8398a8d8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2017 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 requi... | 36.503311 | 80 | 0.706005 |
ba13b7033d1f16869f1b1de451a5f06cf1e2db5f | 13,342 | py | Python | optimization.py | h4ste/pronto | 5815aefc2a1fb0e909631b719193acaa09d58457 | [
"MIT"
] | 2 | 2020-03-03T20:51:09.000Z | 2020-07-21T03:47:11.000Z | optimization.py | h4ste/pronto | 5815aefc2a1fb0e909631b719193acaa09d58457 | [
"MIT"
] | 1 | 2020-07-22T10:05:41.000Z | 2020-07-23T02:40:08.000Z | optimization.py | h4ste/pronto | 5815aefc2a1fb0e909631b719193acaa09d58457 | [
"MIT"
] | null | null | null | import re
from typing import Union
import tensorflow as tf
from tensorflow.python.framework import ops
from tensorflow.python.ops import math_ops, control_flow_ops
import modeling
class PRONTOOptimizer(object):
def __init__(self, model, sparse, learning_rate):
"""
Creates a new PRONTOOptimizer ... | 43.318182 | 113 | 0.621646 |
03e33703ddb5f9e10063a736833010407e6f494c | 9,755 | py | Python | minesweeper.py | RAMESSESII2/Minesweepwer_AI | 762563a9fb28ae1bbc489cf62882d9cae431387b | [
"MIT"
] | null | null | null | minesweeper.py | RAMESSESII2/Minesweepwer_AI | 762563a9fb28ae1bbc489cf62882d9cae431387b | [
"MIT"
] | null | null | null | minesweeper.py | RAMESSESII2/Minesweepwer_AI | 762563a9fb28ae1bbc489cf62882d9cae431387b | [
"MIT"
] | null | null | null | import itertools
import random
class Minesweeper:
"""
Minesweeper game representation
"""
def __init__(self, height=8, width=8, mines=8):
# Set initial width, height, and number of mines
self.height = height
self.width = width
self.mines = set()
# Initialize ... | 30.201238 | 96 | 0.522194 |
c074b5bc38991ece2b9f1bf9e062fc9690bc0393 | 8,056 | py | Python | backend-tests/tests/test_create_org.py | drewmoseley/integration | 37f6374eb5faa710d14861cf5ed82e8f9cf0b149 | [
"Apache-2.0"
] | null | null | null | backend-tests/tests/test_create_org.py | drewmoseley/integration | 37f6374eb5faa710d14861cf5ed82e8f9cf0b149 | [
"Apache-2.0"
] | 98 | 2020-09-21T06:00:11.000Z | 2022-03-28T01:17:19.000Z | backend-tests/tests/test_create_org.py | drewmoseley/integration | 37f6374eb5faa710d14861cf5ed82e8f9cf0b149 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Northern.tech AS
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 34.42735 | 97 | 0.605263 |
8f196ad18a1bda1f19622f260ce8a3095f82ac4f | 16,415 | py | Python | research/object_detection/builders/preprocessor_builder.py | KSomi/models | cc6c45ca6b701426d35bbbab104ad32a2e80a3cf | [
"Apache-2.0"
] | 25 | 2018-11-02T14:14:36.000Z | 2022-01-31T09:00:12.000Z | research/object_detection/builders/preprocessor_builder.py | KSomi/models | cc6c45ca6b701426d35bbbab104ad32a2e80a3cf | [
"Apache-2.0"
] | 12 | 2020-03-24T17:53:50.000Z | 2022-03-12T00:05:19.000Z | research/object_detection/builders/preprocessor_builder.py | KSomi/models | cc6c45ca6b701426d35bbbab104ad32a2e80a3cf | [
"Apache-2.0"
] | 13 | 2019-11-06T17:23:29.000Z | 2019-11-29T13:03:07.000Z | # Copyright 2017 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.243719 | 80 | 0.687968 |
40b191ca527d2d3382e60f5c7ccde79f85951d0d | 17,917 | py | Python | tests/slack_sdk/web/classes/test_objects.py | timgates42/python-slack-sdk | 6339fbe81031c9aec3f95927ac03706fd31f3544 | [
"MIT"
] | null | null | null | tests/slack_sdk/web/classes/test_objects.py | timgates42/python-slack-sdk | 6339fbe81031c9aec3f95927ac03706fd31f3544 | [
"MIT"
] | null | null | null | tests/slack_sdk/web/classes/test_objects.py | timgates42/python-slack-sdk | 6339fbe81031c9aec3f95927ac03706fd31f3544 | [
"MIT"
] | null | null | null | import copy
import unittest
from typing import Optional, List, Union
from slack_sdk.errors import SlackObjectFormationError
from slack_sdk.models import JsonObject, JsonValidator
from slack_sdk.models.blocks import (
ConfirmObject,
MarkdownTextObject,
Option,
OptionGroup,
PlainTextObject,
)
from sl... | 34.522158 | 88 | 0.569459 |
1587a3b711d1b23e2e9cb5334033a6c8a9eb7c69 | 1,082 | py | Python | quadpy/_scipy_compat.py | whzup/quadpy | ca8bd2f9c5a4ae30dc85d8fb79217602bd42525e | [
"MIT"
] | null | null | null | quadpy/_scipy_compat.py | whzup/quadpy | ca8bd2f9c5a4ae30dc85d8fb79217602bd42525e | [
"MIT"
] | null | null | null | quadpy/_scipy_compat.py | whzup/quadpy | ca8bd2f9c5a4ae30dc85d8fb79217602bd42525e | [
"MIT"
] | null | null | null | import numpy
from .line_segment import integrate_adaptive
# compatibility for scipy.quad
# https://docs.scipy.org/doc/scipy/reference/generated/scipy.integrate.quad.html
def quad(f, a, b, args=(), epsabs=1.49e-08, epsrel=1.49e-08, limit=50):
assert a <= b
# See <https://www.gnu.org/software/gsl/doc/html/int... | 23.521739 | 80 | 0.501848 |
6d6ba84e24388e112e37f481f00954187052bf59 | 20,647 | py | Python | tests/components/homematicip_cloud/test_binary_sensor.py | erogleva/core | 994ae09f69afe772150a698953c0d7386a745de2 | [
"Apache-2.0"
] | 3 | 2017-09-16T23:34:59.000Z | 2021-12-20T11:11:27.000Z | tests/components/homematicip_cloud/test_binary_sensor.py | erogleva/core | 994ae09f69afe772150a698953c0d7386a745de2 | [
"Apache-2.0"
] | 52 | 2020-07-14T14:12:26.000Z | 2022-03-31T06:24:02.000Z | tests/components/homematicip_cloud/test_binary_sensor.py | erogleva/core | 994ae09f69afe772150a698953c0d7386a745de2 | [
"Apache-2.0"
] | 2 | 2021-03-17T11:01:07.000Z | 2021-08-19T15:21:32.000Z | """Tests for HomematicIP Cloud binary sensor."""
from homematicip.base.enums import SmokeDetectorAlarmType, WindowState
from homeassistant.components.binary_sensor import DOMAIN as BINARY_SENSOR_DOMAIN
from homeassistant.components.homematicip_cloud import DOMAIN as HMIPC_DOMAIN
from homeassistant.components.homematic... | 38.023941 | 88 | 0.756623 |
ba1782cc1b4cd7f5781a85a82006c6381210e9e4 | 1,966 | py | Python | face_detection/test.py | TOBEACODER7/AI_Chatbot_of_BIT | 6c1e13b79031c56af0116f553aa2a39a31e512e9 | [
"MIT"
] | 1 | 2022-01-11T02:56:13.000Z | 2022-01-11T02:56:13.000Z | face_detection/test.py | TOBEACODER7/AI_Chatbot_of_BIT | 6c1e13b79031c56af0116f553aa2a39a31e512e9 | [
"MIT"
] | null | null | null | face_detection/test.py | TOBEACODER7/AI_Chatbot_of_BIT | 6c1e13b79031c56af0116f553aa2a39a31e512e9 | [
"MIT"
] | null | null | null | import face_recognition
import cv2
import numpy as np
def face():
video_capture = cv2.VideoCapture(0)
# Initialize some variables
face_locations = []
process_this_frame = True
while True:
# Grab a single frame of video
ret, frame = video_capture.read... | 33.322034 | 106 | 0.57528 |
0be514e967d92434508145875842b30694abe0fb | 4,103 | py | Python | nmt/serving/inference_service.py | whiskyboy/CVAE_GNMT | 12d01df4b36cb5c44eb719c79cae71d782e1aacd | [
"Apache-2.0"
] | null | null | null | nmt/serving/inference_service.py | whiskyboy/CVAE_GNMT | 12d01df4b36cb5c44eb719c79cae71d782e1aacd | [
"Apache-2.0"
] | null | null | null | nmt/serving/inference_service.py | whiskyboy/CVAE_GNMT | 12d01df4b36cb5c44eb719c79cae71d782e1aacd | [
"Apache-2.0"
] | null | null | null | #coding:utf8
from __future__ import print_function
import os
import time
import argparse
from itertools import groupby
import numpy as np
import tensorflow as tf
from .. import cvae_model
from .. import model_helper
from .. import nmt
from ..utils import nmt_utils
from ..utils import misc_utils as utils
utils.check_... | 41.03 | 117 | 0.612479 |
9adf15b14622b6a080ec1fed08f40cd7a431dbb8 | 2,653 | py | Python | src/codexdb/catalog.py | itrummer/CodexDB | 15ab6268c95e8a283b69e17d5fa4cb7589580a27 | [
"MIT"
] | null | null | null | src/codexdb/catalog.py | itrummer/CodexDB | 15ab6268c95e8a283b69e17d5fa4cb7589580a27 | [
"MIT"
] | null | null | null | src/codexdb/catalog.py | itrummer/CodexDB | 15ab6268c95e8a283b69e17d5fa4cb7589580a27 | [
"MIT"
] | null | null | null | '''
Created on Oct 5, 2021
@author: immanueltrummer
'''
import json
class DbCatalog():
""" Information over all databases in database directory. """
def __init__(self, data_dir):
""" Initialize for given database directory.
Args:
data_dir: contains databases and sche... | 28.526882 | 65 | 0.557105 |
a84f71feb2731d57f629437c925c74153afb2ce0 | 790 | py | Python | colour/examples/colorimetry/examples_blackbody.py | tjdcs/colour | 09413da71b5da57408eb812797c5db1300d4791a | [
"BSD-3-Clause"
] | null | null | null | colour/examples/colorimetry/examples_blackbody.py | tjdcs/colour | 09413da71b5da57408eb812797c5db1300d4791a | [
"BSD-3-Clause"
] | null | null | null | colour/examples/colorimetry/examples_blackbody.py | tjdcs/colour | 09413da71b5da57408eb812797c5db1300d4791a | [
"BSD-3-Clause"
] | null | null | null | """Showcases blackbody / planckian radiator computations."""
import colour
from colour.utilities import message_box
message_box("Blackbody / Planckian Radiator Computations")
message_box(
"Computing the spectral distribution of a blackbody at temperature 5000K"
'degrees and converting to "CIE XYZ" tristimulu... | 30.384615 | 77 | 0.777215 |
9a290e35d256e60c76d84eba700a7e6d8ee4612a | 3,767 | py | Python | spikeinterface/extractors/spykingcircusextractors.py | vncntprvst/spikeinterface | dd5ae94f85fe5d9082b45321d2c96ba316eb4b77 | [
"MIT"
] | null | null | null | spikeinterface/extractors/spykingcircusextractors.py | vncntprvst/spikeinterface | dd5ae94f85fe5d9082b45321d2c96ba316eb4b77 | [
"MIT"
] | null | null | null | spikeinterface/extractors/spykingcircusextractors.py | vncntprvst/spikeinterface | dd5ae94f85fe5d9082b45321d2c96ba316eb4b77 | [
"MIT"
] | null | null | null | import numpy as np
from pathlib import Path
from spikeinterface.core import (BaseSorting, BaseSortingSegment)
from spikeinterface.core.core_tools import define_function_from_class
try:
import h5py
HAVE_H5PY = True
except ImportError:
HAVE_H5PY = False
class SpykingCircusSortingExtractor(BaseSorting):
... | 35.537736 | 119 | 0.631272 |
3852a2770067521a91119a6cf1e0e5bbff0d80dd | 4,397 | py | Python | trakt/core/configuration.py | omaralvarez/trakt.py | 93a6beb73cdd37ffb354d2e9c1892dc39d9c4baf | [
"MIT"
] | 11 | 2015-02-01T22:22:48.000Z | 2019-01-24T12:18:07.000Z | trakt/core/configuration.py | omaralvarez/trakt.py | 93a6beb73cdd37ffb354d2e9c1892dc39d9c4baf | [
"MIT"
] | 3 | 2015-03-26T12:18:02.000Z | 2019-02-21T08:12:04.000Z | trakt/core/configuration.py | omaralvarez/trakt.py | 93a6beb73cdd37ffb354d2e9c1892dc39d9c4baf | [
"MIT"
] | 2 | 2016-07-19T22:55:16.000Z | 2019-01-24T12:19:08.000Z | from trakt.core.context_collection import ContextCollection
DEFAULT_HTTP_RETRY = False
DEFAULT_HTTP_MAX_RETRIES = 3
DEFAULT_HTTP_RETRY_SLEEP = 5
DEFAULT_HTTP_TIMEOUT = (6.05, 24)
class ConfigurationManager(object):
def __init__(self):
self.defaults = Configuration(self)
self.stack = ContextCollec... | 29.510067 | 120 | 0.629065 |
0bb69994ecb0862ac470df7c6de4d02935c2e2a9 | 27,262 | py | Python | specs/glxapi.py | erich666/apitrace | a314508e397c8f1814228d36259ea8708034444e | [
"MIT"
] | 1 | 2015-04-28T04:55:47.000Z | 2015-04-28T04:55:47.000Z | specs/glxapi.py | erich666/apitrace | a314508e397c8f1814228d36259ea8708034444e | [
"MIT"
] | null | null | null | specs/glxapi.py | erich666/apitrace | a314508e397c8f1814228d36259ea8708034444e | [
"MIT"
] | null | null | null | ##########################################################################
#
# Copyright 2008-2009 VMware, Inc.
# All Rights Reserved.
#
# 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 withou... | 53.350294 | 405 | 0.642066 |
80d2b4bb55c85addc2b081273aab1b59feb75d85 | 1,595 | py | Python | nodejs/setup.py | oberhamsi/FrameworkBenchmarks | 660a66d51a9aad10b43c0660208fb13c098121af | [
"BSD-3-Clause"
] | 4 | 2015-01-22T02:13:03.000Z | 2018-06-13T12:02:46.000Z | frameworks/JavaScript/nodejs/setup.py | ratpack/FrameworkBenchmarks | 81604309e46e382fe2ffb7970a87d728f20c8be6 | [
"BSD-3-Clause"
] | null | null | null | frameworks/JavaScript/nodejs/setup.py | ratpack/FrameworkBenchmarks | 81604309e46e382fe2ffb7970a87d728f20c8be6 | [
"BSD-3-Clause"
] | null | null | null |
import subprocess
import sys
import setup_util
import os
def start(args, logfile, errfile):
setup_util.replace_text("nodejs/hello.js", "mongodb:\/\/.*\/hello_world", "mongodb://" + args.database_host + "/hello_world")
setup_util.replace_text("nodejs/hello.js", "localhost", args.database_host)
try:
npm(logf... | 34.673913 | 131 | 0.67837 |
60ec469db3b10c7ff88303b487b437e48e57ddf3 | 411 | py | Python | hackerrank/gridland-metro/solution.py | SamProkopchuk/coding-problems | fa0ca2c05ac90e41945de1a5751e5545a8459ac4 | [
"MIT"
] | null | null | null | hackerrank/gridland-metro/solution.py | SamProkopchuk/coding-problems | fa0ca2c05ac90e41945de1a5751e5545a8459ac4 | [
"MIT"
] | null | null | null | hackerrank/gridland-metro/solution.py | SamProkopchuk/coding-problems | fa0ca2c05ac90e41945de1a5751e5545a8459ac4 | [
"MIT"
] | null | null | null | from collections import defaultdict
d = defaultdict(list)
n, m, k = map(int, input().split())
res = n * m
for _ in range(k):
r, c1, c2 = map(int, input().split())
d[r].append((c1, c2))
for r in d:
d[r].sort()
s, e = d[r][0]
for (c1, c2) in d[r]:
if c1 > e:
res -= ... | 19.571429 | 42 | 0.440389 |
55a8d83ee4d91e4f6be0c285a92752099b25807c | 7,005 | py | Python | tests/test_perspective_n_points.py | 3D-Data-Processing/pytorch3d | 20ef9195f0721bc77f10f5af77d44fc1d4ede4ff | [
"BSD-3-Clause"
] | 1 | 2020-07-18T19:03:11.000Z | 2020-07-18T19:03:11.000Z | tests/test_perspective_n_points.py | 3D-Data-Processing/pytorch3d | 20ef9195f0721bc77f10f5af77d44fc1d4ede4ff | [
"BSD-3-Clause"
] | null | null | null | tests/test_perspective_n_points.py | 3D-Data-Processing/pytorch3d | 20ef9195f0721bc77f10f5af77d44fc1d4ede4ff | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All rights reserved.
import unittest
import torch
from common_testing import TestCaseMixin
from pytorch3d.ops import perspective_n_points
from pytorch3d.transforms import rotation_conversions
def reproj_error(x_world, y, R, T, weight=None):
# applies the affine... | 37.66129 | 88 | 0.570021 |
021f7eb949236e09c177c7cdea7d98aa2700bf88 | 1,835 | py | Python | tests/acceptance/test_project_overview.py | boblail/sentry | 71127331e58791d4651e480b65dd66f06cadc1c8 | [
"BSD-3-Clause"
] | 1 | 2019-08-28T11:03:13.000Z | 2019-08-28T11:03:13.000Z | tests/acceptance/test_project_overview.py | boblail/sentry | 71127331e58791d4651e480b65dd66f06cadc1c8 | [
"BSD-3-Clause"
] | 1 | 2022-01-15T02:36:18.000Z | 2022-01-15T02:36:18.000Z | tests/acceptance/test_project_overview.py | gaybro8777/sentry | 4594f479db9a079d7f1ed41a9e07d8f36953319f | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
import pytz
from datetime import datetime
from django.utils import timezone
from mock import patch
from sentry.testutils import AcceptanceTestCase, SnubaTestCase
class ProjectOverviewTest(AcceptanceTestCase, SnubaTestCase):
def setUp(self):
super(ProjectOverviewTe... | 33.981481 | 74 | 0.633243 |
fe29faea2b770c7f06ca60abc9c6f06413625579 | 4,615 | py | Python | sadpanda/structs/processor.py | sebanski/sadpanda | 2561877bfd43cff28b575844a22fe06ab5f1f2f7 | [
"Apache-2.0",
"MIT"
] | null | null | null | sadpanda/structs/processor.py | sebanski/sadpanda | 2561877bfd43cff28b575844a22fe06ab5f1f2f7 | [
"Apache-2.0",
"MIT"
] | null | null | null | sadpanda/structs/processor.py | sebanski/sadpanda | 2561877bfd43cff28b575844a22fe06ab5f1f2f7 | [
"Apache-2.0",
"MIT"
] | null | null | null | '''
the processor object that handles forward encryption and reverse decryption
__ __
/ \ ^ / \
\ / | \ /
| . | . |
\__A__/
\|. / | \ .|/
\+<| | |>+/
\ /|\ /
V===V
| |
___/ \___
sadpanda
by: alex balzer
'''
import pickle
import os
impor... | 32.964286 | 146 | 0.71961 |
e75f3b21aed70117be794556da48812a3de9f0b9 | 2,097 | py | Python | lstm_rl/parameters.py | liusida/lstm_rl | 641f94989e8669c97b03e41d003d0061b374ca79 | [
"MIT"
] | null | null | null | lstm_rl/parameters.py | liusida/lstm_rl | 641f94989e8669c97b03e41d003d0061b374ca79 | [
"MIT"
] | null | null | null | lstm_rl/parameters.py | liusida/lstm_rl | 641f94989e8669c97b03e41d003d0061b374ca79 | [
"MIT"
] | null | null | null | import argparse
from dataclasses import dataclass
from yamldataclassconfig.config import YamlDataClassConfig
@dataclass
class HyperParameters(YamlDataClassConfig):
"""
Treatment: how many different features_extractors do you want to use in parallel?
"""
num_lstm: int = 1
num_... | 36.155172 | 132 | 0.58083 |
b7e9a0e24d334c9016387b5ff4bbecba32d71dbe | 339 | py | Python | templatetags/churchmanager_extras.py | bm424/churchmanager | 474e96af0c5257de3bf4c4faf4438b0292f879ab | [
"MIT"
] | null | null | null | templatetags/churchmanager_extras.py | bm424/churchmanager | 474e96af0c5257de3bf4c4faf4438b0292f879ab | [
"MIT"
] | 9 | 2016-12-10T22:33:14.000Z | 2017-01-29T16:26:57.000Z | templatetags/churchmanager_extras.py | bm424/churchmanager | 474e96af0c5257de3bf4c4faf4438b0292f879ab | [
"MIT"
] | null | null | null | import re
from django import template
from django.core.urlresolvers import reverse
register = template.Library()
@register.simple_tag(takes_context=True)
def town_or_village(context, urlname):
pattern = "^" + reverse(urlname)
path = context['request'].path
if re.search(pattern, path):
return 'act... | 22.6 | 44 | 0.716814 |
f59807a971a083aa1a1297e4afa6dc3e6d566d6c | 4,752 | py | Python | examples/mixture/plot_gmm_covariances.py | talahajeer/scikit-learn | d66b42708a5912039740cd08f747229433e579b5 | [
"BSD-3-Clause"
] | 27 | 2015-01-22T22:30:09.000Z | 2022-02-15T07:33:06.000Z | examples/mixture/plot_gmm_covariances.py | talahajeer/scikit-learn | d66b42708a5912039740cd08f747229433e579b5 | [
"BSD-3-Clause"
] | 26 | 2019-11-11T18:17:02.000Z | 2020-05-14T02:57:37.000Z | examples/mixture/plot_gmm_covariances.py | talahajeer/scikit-learn | d66b42708a5912039740cd08f747229433e579b5 | [
"BSD-3-Clause"
] | 25 | 2015-07-30T13:47:25.000Z | 2021-08-03T07:48:38.000Z | """
===============
GMM covariances
===============
Demonstration of several covariances types for Gaussian mixture models.
See :ref:`gmm` for more information on the estimator.
Although GMM are often used for clustering, we can compare the obtained
clusters with the actual classes from the dataset. We initialize th... | 34.686131 | 76 | 0.671928 |
edf9286afb6daab59c9d3e4ed9abfc874ff41b0f | 3,708 | py | Python | mysodexo/api.py | AndreMiras/mysodexo | 3d0836c38e10d579a8758b998744d1a38ff77260 | [
"MIT"
] | 9 | 2019-11-13T08:15:51.000Z | 2022-03-07T18:48:28.000Z | mysodexo/api.py | AndreMiras/mysodexo | 3d0836c38e10d579a8758b998744d1a38ff77260 | [
"MIT"
] | 3 | 2019-11-13T16:45:33.000Z | 2021-10-21T10:47:54.000Z | mysodexo/api.py | AndreMiras/mysodexo | 3d0836c38e10d579a8758b998744d1a38ff77260 | [
"MIT"
] | 1 | 2020-10-10T10:22:37.000Z | 2020-10-10T10:22:37.000Z | #!/usr/bin/env python3
import os
from pprint import pprint
from typing import Any, Dict, Tuple
import requests
from mysodexo.constants import (
BASE_URL,
DEFAULT_DEVICE_UID,
DEFAULT_LANG,
DEFAULT_OS,
GET_CARDS_ENDPOINT,
GET_CLEAR_PIN_ENDPOINT,
GET_DETAIL_CARD_ENDPOINT,
JSON_RESPONSE_OK... | 28.090909 | 79 | 0.685545 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.