hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | 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 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | 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 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2d1355f22c40bc6971d7409c1acdb6d7deb3c0bd | 480 | py | Python | examples/example.py | peterdhansen/nexradaws | 0658efc5ec95d113a9d87fed3feb71b35293bec4 | [
"MIT"
] | 28 | 2018-04-28T19:18:06.000Z | 2021-12-01T00:19:30.000Z | examples/example.py | peterdhansen/nexradaws | 0658efc5ec95d113a9d87fed3feb71b35293bec4 | [
"MIT"
] | 10 | 2017-06-30T19:33:20.000Z | 2021-07-27T22:39:52.000Z | examples/example.py | peterdhansen/nexradaws | 0658efc5ec95d113a9d87fed3feb71b35293bec4 | [
"MIT"
] | 7 | 2018-10-21T17:39:55.000Z | 2021-02-14T01:55:18.000Z | import six
import nexradaws
conn = nexradaws.NexradAwsInterface()
six.print_(conn.get_avail_years())
six.print_(conn.get_avail_months('2013'))
six.print_(conn.get_avail_days('2013', '05'))
six.print_(conn.get_avail_radars('2013', '05', '31'))
six.print_(conn.get_avail_scans('2013', '05', '31', 'KTLX'))
from datetime i... | 34.285714 | 62 | 0.752083 |
2d136164427cadcf79b1c673ec20d9b7a4013de1 | 29 | py | Python | btd6_memory_info/generated/Assets/Scripts/Unity/UI_New/Main/Home/CoopButtonChecker/coop_button_checker.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/Assets/Scripts/Unity/UI_New/Main/Home/CoopButtonChecker/coop_button_checker.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/Assets/Scripts/Unity/UI_New/Main/Home/CoopButtonChecker/coop_button_checker.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | class CoopButtonChecker: pass | 29 | 29 | 0.896552 |
2d136a54b47a9caf115bbca78c2fc9c18690908d | 300 | py | Python | catkin_ws/devel/lib/python3/dist-packages/fundamentals/msg/__init__.py | a-yildiz/ROS-Simple-Sample-Packages | eb6b18adcd1fe26e2b5e644c42922e8102867cd9 | [
"MIT"
] | 1 | 2021-09-19T07:51:23.000Z | 2021-09-19T07:51:23.000Z | catkin_ws/install/lib/python3/dist-packages/fundamentals/msg/__init__.py | a-yildiz/ROS-Simple-Sample-Packages | eb6b18adcd1fe26e2b5e644c42922e8102867cd9 | [
"MIT"
] | null | null | null | catkin_ws/install/lib/python3/dist-packages/fundamentals/msg/__init__.py | a-yildiz/ROS-Simple-Sample-Packages | eb6b18adcd1fe26e2b5e644c42922e8102867cd9 | [
"MIT"
] | null | null | null | from ._BatteryStatus import *
from ._MissionStatusAction import *
from ._MissionStatusActionFeedback import *
from ._MissionStatusActionGoal import *
from ._MissionStatusActionResult import *
from ._MissionStatusFeedback import *
from ._MissionStatusGoal import *
from ._MissionStatusResult import *
| 33.333333 | 43 | 0.84 |
2d137ba572aa333eeaf0015f5378adbb37108630 | 2,738 | py | Python | kaldi/base/math.py | fgvbrt/pykaldi | c4e867de96b5ff5ef66a79f611d19251a857d2ab | [
"Apache-2.0"
] | 2 | 2020-02-27T13:42:10.000Z | 2020-08-27T10:28:02.000Z | kaldi/base/math.py | yongxuUSTC/pykaldi | b7a54d91fa07cf86838172afffaf158c7a058498 | [
"Apache-2.0"
] | null | null | null | kaldi/base/math.py | yongxuUSTC/pykaldi | b7a54d91fa07cf86838172afffaf158c7a058498 | [
"Apache-2.0"
] | 1 | 2018-08-31T17:51:19.000Z | 2018-08-31T17:51:19.000Z | from ._kaldi_math import *
from ._kaldi_math_ext import *
# Must be imported explicitly
from ._kaldi_math import _lcm, _factorize,\
_with_prob, _round_up_to_nearest_power_of_two,\
_rand_int
DBL_EPSILON = 2.2204460492503131e-16
FLT_EPSILON = 1.19209290e-7
M_PI = 3.14... | 25.119266 | 80 | 0.633674 |
2d137e711bd958b6bf77fe166f6864f66173335a | 1,869 | py | Python | apps/advection_1d_variable/setplot.py | arashb/pyclaw | dbe0bc28ed801b16c501bdff58012c30f7a90b9f | [
"BSD-3-Clause"
] | 1 | 2018-03-26T11:51:17.000Z | 2018-03-26T11:51:17.000Z | apps/advection_1d_variable/setplot.py | arashb/pyclaw | dbe0bc28ed801b16c501bdff58012c30f7a90b9f | [
"BSD-3-Clause"
] | null | null | null | apps/advection_1d_variable/setplot.py | arashb/pyclaw | dbe0bc28ed801b16c501bdff58012c30f7a90b9f | [
"BSD-3-Clause"
] | null | null | null |
"""
Set up the plot figures, axes, and items to be done for each frame.
This module is imported by the plotting routines and then the
function setplot is called to set the plot parameters.
"""
#--------------------------
def setplot(plotdata):
#--------------------------
"""
Specify what is to b... | 31.15 | 74 | 0.614232 |
2d1392ab308c7e6fb38d397258726cb77042c358 | 8,481 | py | Python | docs/conf.py | tech-teach/marshmallow-json | 444be169acb0318c4b576b1773d90089d7a0fab6 | [
"MIT"
] | 1 | 2018-04-10T15:39:14.000Z | 2018-04-10T15:39:14.000Z | docs/conf.py | tech-teach/marshmallow-json | 444be169acb0318c4b576b1773d90089d7a0fab6 | [
"MIT"
] | 299 | 2018-01-28T22:27:20.000Z | 2022-03-28T09:15:18.000Z | docs/conf.py | tech-teach/marshmallow-json | 444be169acb0318c4b576b1773d90089d7a0fab6 | [
"MIT"
] | 1 | 2019-09-20T01:36:52.000Z | 2019-09-20T01:36:52.000Z | #
# marshmallowjson documentation build configuration file, created by
# sphinx-quickstart on Tue Jul 9 22:26:36 2013.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration... | 30.952555 | 76 | 0.719726 |
2d13a34a0f63957caae1897c41c75cf5229c4cd6 | 8,741 | py | Python | alipay/aop/api/domain/AlipayBossProdAntlegalchainMultipartyApplyModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/AlipayBossProdAntlegalchainMultipartyApplyModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/AlipayBossProdAntlegalchainMultipartyApplyModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
from alipay.aop.api.domain.CorpEntity import CorpEntity
from alipay.aop.api.domain.CorpEntity import CorpEntity
from alipay.aop.api.domain.NotaryFileVO import NotaryFileVO
class AlipayBossProdAntlegalchainM... | 37.354701 | 95 | 0.626702 |
2d13ac90034bf14e11a4bf0cd444833993403b24 | 2,922 | py | Python | tests/test_build_tools.py | practicalci/practci | 47d0600918762373992da0ba067dbb84a3e4d633 | [
"BSD-3-Clause"
] | null | null | null | tests/test_build_tools.py | practicalci/practci | 47d0600918762373992da0ba067dbb84a3e4d633 | [
"BSD-3-Clause"
] | null | null | null | tests/test_build_tools.py | practicalci/practci | 47d0600918762373992da0ba067dbb84a3e4d633 | [
"BSD-3-Clause"
] | null | null | null |
import os
import shutil
import unittest
from practci import build_tools
from practci.build_tools import BuildToolType, BuildTarget, BuildType
from practci import toolchains
from tests.project_templates import cmake as cmake_template
class TestBuildTool(unittest.TestCase):
def test_get_build_tool(self):
... | 35.634146 | 117 | 0.749829 |
2d13dadb0af97e916c1919372fd7dc8e4f8f4359 | 4,653 | py | Python | demisto_sdk/commands/common/tests/content_entity_validator_test.py | yalonso7/demisto-sdk | 4b832078cdadb0b604a064532975e8be68ac726a | [
"MIT"
] | null | null | null | demisto_sdk/commands/common/tests/content_entity_validator_test.py | yalonso7/demisto-sdk | 4b832078cdadb0b604a064532975e8be68ac726a | [
"MIT"
] | null | null | null | demisto_sdk/commands/common/tests/content_entity_validator_test.py | yalonso7/demisto-sdk | 4b832078cdadb0b604a064532975e8be68ac726a | [
"MIT"
] | null | null | null | import pytest
from demisto_sdk.commands.common.hook_validations.content_entity_validator import \
ContentEntityValidator
from demisto_sdk.commands.common.hook_validations.structure import \
StructureValidator
from demisto_sdk.commands.common.tools import (get_not_registered_tests,
... | 31.439189 | 117 | 0.647969 |
2d13ee7c3ebe4e17a8cd2857e2160a3bfa98f24a | 1,994 | py | Python | setup.py | Autoplectic/legit | 0eb31efec1e17190097043ea49451477a5a60b2e | [
"BSD-3-Clause"
] | null | null | null | setup.py | Autoplectic/legit | 0eb31efec1e17190097043ea49451477a5a60b2e | [
"BSD-3-Clause"
] | null | null | null | setup.py | Autoplectic/legit | 0eb31efec1e17190097043ea49451477a5a60b2e | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
from setuptools import setup, find_packages # Always prefer setuptools over distutils
from codecs import open # To use a consistent encoding
APP_NAME = 'legit'
APP_SCRIPT = './legit_r'
VERSION = '0.2.0'
# Grab requirements.
with open('reqs.txt')... | 23.458824 | 86 | 0.590772 |
2d143dcca2a2638c2c9a83948e3e9dcb7f0c12d1 | 1,975 | py | Python | playground/step3/jhML/core.py | jhson989/jhML | eb8b76d3b47df858e82cd971bb32794e12de4747 | [
"Apache-2.0"
] | null | null | null | playground/step3/jhML/core.py | jhson989/jhML | eb8b76d3b47df858e82cd971bb32794e12de4747 | [
"Apache-2.0"
] | null | null | null | playground/step3/jhML/core.py | jhson989/jhML | eb8b76d3b47df858e82cd971bb32794e12de4747 | [
"Apache-2.0"
] | null | null | null |
import numpy as np
import contextlib
class Config:
enable_backprop = True
#contextlib.contextmanager
def using_config(name, value):
old_value = getattr(Config, name)
setattr(Config, name, value)
try:
yield
finally:
setattr(Config, name, old_value)
class Variable:
__array_... | 21.467391 | 77 | 0.558481 |
2d14622ea893c9d6a61c3367e9b8c6b75def1096 | 13,198 | py | Python | superset/views/base.py | franksam007/incubator-superset | a0f572eb3ea4b89cb435a8af20436f8e1d34814e | [
"Apache-2.0"
] | 1 | 2018-08-25T02:48:53.000Z | 2018-08-25T02:48:53.000Z | superset/views/base.py | franksam007/incubator-superset | a0f572eb3ea4b89cb435a8af20436f8e1d34814e | [
"Apache-2.0"
] | 1 | 2019-06-24T07:11:47.000Z | 2019-06-24T07:11:47.000Z | superset/views/base.py | franksam007/incubator-superset | a0f572eb3ea4b89cb435a8af20436f8e1d34814e | [
"Apache-2.0"
] | 3 | 2019-10-28T02:28:58.000Z | 2020-05-21T10:00:32.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... | 33.160804 | 89 | 0.653281 |
2d1463f4ad45bc0b59f85201796ac3cccabb67fc | 2,171 | py | Python | pytorch-semseg/u_net_demo/unet.py | riciche/SimpleCVReproduction | 4075de39f9c61f1359668a413f6a5d98903fcf97 | [
"Apache-2.0"
] | 923 | 2020-01-11T06:36:53.000Z | 2022-03-31T00:26:57.000Z | pytorch-semseg/u_net_demo/unet.py | riciche/SimpleCVReproduction | 4075de39f9c61f1359668a413f6a5d98903fcf97 | [
"Apache-2.0"
] | 25 | 2020-02-27T08:35:46.000Z | 2022-01-25T08:54:19.000Z | pytorch-semseg/u_net_demo/unet.py | riciche/SimpleCVReproduction | 4075de39f9c61f1359668a413f6a5d98903fcf97 | [
"Apache-2.0"
] | 262 | 2020-01-02T02:19:40.000Z | 2022-03-23T04:56:16.000Z | import torch
from torch import nn
class DoubleConv(nn.Module):
def __init__(self, in_ch, out_ch):
super(DoubleConv, self).__init__()
self.conv = nn.Sequential(
nn.Conv2d(in_ch, out_ch, 3, padding=1),
nn.BatchNorm2d(out_ch),
nn.ReLU(inplace=True),
nn.C... | 27.833333 | 61 | 0.566559 |
2d146c6720274e28d55268f8e0d61df813a10586 | 284 | py | Python | Python-code-snippets-101-200/149-Convert KMH to MPH.py | abartoha/python-snippets-ref | 04e4feada96077f0e849b277204c012194e8fbcd | [
"Unlicense"
] | null | null | null | Python-code-snippets-101-200/149-Convert KMH to MPH.py | abartoha/python-snippets-ref | 04e4feada96077f0e849b277204c012194e8fbcd | [
"Unlicense"
] | null | null | null | Python-code-snippets-101-200/149-Convert KMH to MPH.py | abartoha/python-snippets-ref | 04e4feada96077f0e849b277204c012194e8fbcd | [
"Unlicense"
] | null | null | null | '''
Python Code Snippets - stevepython.wordpress.com
149-Convert KMH to MPH
Source:
https://www.pythonforbeginners.com/code-snippets-source-code/
python-code-convert-kmh-to-mph/
'''
kmh = int(input("Enter km/h: "))
mph = 0.6214 * kmh
print ("Speed:", kmh, "KM/H = ", mph, "MPH")
| 18.933333 | 61 | 0.679577 |
2d146db44b64ec07248d5ac9c0dc06e4dc34b72f | 3,241 | py | Python | ta/settings.py | rukeba/text-analyzer | 56bd4501ba86ea568d8ebdc6ad6857a26c97b290 | [
"MIT"
] | null | null | null | ta/settings.py | rukeba/text-analyzer | 56bd4501ba86ea568d8ebdc6ad6857a26c97b290 | [
"MIT"
] | 7 | 2021-03-19T03:14:33.000Z | 2022-02-27T04:42:55.000Z | ta/settings.py | rukeba/text-analyzer | 56bd4501ba86ea568d8ebdc6ad6857a26c97b290 | [
"MIT"
] | null | null | null | """
Django settings for ta project.
Generated by 'django-admin startproject' using Django 3.0.5.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.0/ref/settings/
"""
import os
# Buil... | 25.320313 | 91 | 0.68374 |
2d147491acee029ba8fe41e1701c25b00641e1fb | 2,255 | py | Python | test/benchmarks/grover_bench2.py | Qr4cl3/Iqb_n_p | 0c99088461bd1443cb633063f408e86216e004ef | [
"Apache-2.0"
] | null | null | null | test/benchmarks/grover_bench2.py | Qr4cl3/Iqb_n_p | 0c99088461bd1443cb633063f408e86216e004ef | [
"Apache-2.0"
] | null | null | null | test/benchmarks/grover_bench2.py | Qr4cl3/Iqb_n_p | 0c99088461bd1443cb633063f408e86216e004ef | [
"Apache-2.0"
] | 1 | 2019-11-19T07:32:20.000Z | 2019-11-19T07:32:20.000Z | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modif... | 30.066667 | 77 | 0.663415 |
2d149513744306a5c710fa6f36ed8f16342f6f65 | 2,046 | py | Python | tests/test_cyclonedx.py | c0d3nh4ck/cyclonedx-python | 287d0bc518f1c18f00659466c7d116109061cd48 | [
"Apache-2.0"
] | null | null | null | tests/test_cyclonedx.py | c0d3nh4ck/cyclonedx-python | 287d0bc518f1c18f00659466c7d116109061cd48 | [
"Apache-2.0"
] | 1 | 2020-09-08T14:22:22.000Z | 2020-09-08T14:22:22.000Z | tests/test_cyclonedx.py | c0d3nh4ck/cyclonedx-python | 287d0bc518f1c18f00659466c7d116109061cd48 | [
"Apache-2.0"
] | null | null | null | # This file is part of CycloneDX Python module.
#
# 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... | 31.96875 | 81 | 0.634409 |
2d149d075110458511692f45c1db8e7747af6543 | 817 | py | Python | enhancer/enhancer.py | NCBI-Hackathons/HaploCravat | f43751e795b06190036b28e0ea5df2c715f11f2b | [
"MIT"
] | null | null | null | enhancer/enhancer.py | NCBI-Hackathons/HaploCravat | f43751e795b06190036b28e0ea5df2c715f11f2b | [
"MIT"
] | 1 | 2019-02-06T22:43:44.000Z | 2019-02-06T22:43:44.000Z | enhancer/enhancer.py | NCBI-Hackathons/Ultrafast_Variant_Ranking | f43751e795b06190036b28e0ea5df2c715f11f2b | [
"MIT"
] | null | null | null | import sys
import os
import sqlite3
from cravat import BaseAnnotator
from cravat import InvalidData
from cravat.util import get_ucsc_bins
class CravatAnnotator (BaseAnnotator):
def annotate(self, input_data):
out = {}
chrom = input_data['chrom']
pos = input_data['pos'... | 27.233333 | 102 | 0.570379 |
2d14a0162aece67872862aa2f9e6980536cc950f | 2,815 | py | Python | src/tat/utils.py | ShinoYasx/tat | 12ccf9cde02d25fc071153cbf48d9f4675733f3a | [
"Apache-2.0"
] | null | null | null | src/tat/utils.py | ShinoYasx/tat | 12ccf9cde02d25fc071153cbf48d9f4675733f3a | [
"Apache-2.0"
] | null | null | null | src/tat/utils.py | ShinoYasx/tat | 12ccf9cde02d25fc071153cbf48d9f4675733f3a | [
"Apache-2.0"
] | 1 | 2021-06-28T15:41:09.000Z | 2021-06-28T15:41:09.000Z | from PySide6.QtGui import QPixmap, QImage
from PySide6.QtCore import QSize
import numpy as np
import cv2 as cv
from typing import Optional, List
def fit_to_frame(pixmap: QPixmap, frame: QSize) -> QPixmap:
"""
:param pixmap: The QPixmap to resize.
:param frame: The frame within which the image should fit... | 35.1875 | 110 | 0.700533 |
2d14ba108b997f26bdd27ada087517e3b35dc841 | 483 | py | Python | src/rolca/core/migrations/0005_auto_20200515_1923.py | dblenkus/rolca | 033492d9b573b1dc65cb836579dff27c6e06c7a7 | [
"Apache-2.0"
] | null | null | null | src/rolca/core/migrations/0005_auto_20200515_1923.py | dblenkus/rolca | 033492d9b573b1dc65cb836579dff27c6e06c7a7 | [
"Apache-2.0"
] | 12 | 2016-11-27T18:38:23.000Z | 2017-09-09T16:18:17.000Z | src/rolca/core/migrations/0005_auto_20200515_1923.py | dblenkus/rolca | 033492d9b573b1dc65cb836579dff27c6e06c7a7 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.0rc1 on 2020-05-15 19:23
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0004_submission_file'),
]
operations = [
migrations.AlterField(
model_name='file',
... | 24.15 | 117 | 0.643892 |
2d14ca7aa05f11a1d6de9c412302b0b15e3607f4 | 7,149 | py | Python | eth2deposit/credentials.py | vapory-testing/vap2.0-deposit-cli | f4d878fe5bf1e36dea67f1c94c035a7533d83d86 | [
"CC0-1.0"
] | 3 | 2021-01-20T17:39:20.000Z | 2022-01-26T15:48:42.000Z | eth2deposit/credentials.py | vapory-testing/vap2.0-deposit-cli | f4d878fe5bf1e36dea67f1c94c035a7533d83d86 | [
"CC0-1.0"
] | 29 | 2021-04-20T16:42:20.000Z | 2021-07-05T22:18:29.000Z | eth2deposit/credentials.py | vapory-testing/vap2.0-deposit-cli | f4d878fe5bf1e36dea67f1c94c035a7533d83d86 | [
"CC0-1.0"
] | 3 | 2021-12-23T22:08:53.000Z | 2022-03-20T16:36:55.000Z | import os
import click
import time
import json
from typing import Dict, List
from py_ecc.bls import G2ProofOfPossession as bls
from eth2deposit.exceptions import ValidationError
from eth2deposit.key_handling.key_derivation.path import mnemonic_and_path_to_key
from eth2deposit.key_handling.keystore import (
Keystor... | 43.858896 | 119 | 0.675899 |
2d14d85171ca48898272973eb7557b425205ccf4 | 1,546 | py | Python | handcam/scratch/handcam_validation_split.py | luketaverne/handcam | e294ebf2be8b5512c8607d3c8ba3f6946f3b8e30 | [
"MIT"
] | 1 | 2022-02-10T13:19:20.000Z | 2022-02-10T13:19:20.000Z | handcam/scratch/handcam_validation_split.py | luketaverne/handcam | e294ebf2be8b5512c8607d3c8ba3f6946f3b8e30 | [
"MIT"
] | null | null | null | handcam/scratch/handcam_validation_split.py | luketaverne/handcam | e294ebf2be8b5512c8607d3c8ba3f6946f3b8e30 | [
"MIT"
] | null | null | null | import glob
import os
import random
import pickle
random.seed(0)
split_percentage = 0.1
grasp_labels = ['grasp_1','grasp_2','grasp_3','grasp_4','grasp_5','grasp_6','grasp_7']
dataset_root = '/local/home/luke/datasets/handcam/'
dataset_samples = os.path.join(dataset_root, 'samples')
for split_id in range(0,10):
... | 31.55102 | 90 | 0.689521 |
2d14e7581897bad8a4a9efc5fd094f852592d6df | 706 | py | Python | public_data/migrations/0023_auto_20211027_1241.py | MTES-MCT/sparte | 3b8ae6d21da81ca761d64ae9dfe2c8f54487211c | [
"MIT"
] | null | null | null | public_data/migrations/0023_auto_20211027_1241.py | MTES-MCT/sparte | 3b8ae6d21da81ca761d64ae9dfe2c8f54487211c | [
"MIT"
] | 3 | 2022-02-10T11:47:58.000Z | 2022-02-23T18:50:24.000Z | public_data/migrations/0023_auto_20211027_1241.py | MTES-MCT/sparte | 3b8ae6d21da81ca761d64ae9dfe2c8f54487211c | [
"MIT"
] | null | null | null | # Generated by Django 3.2.5 on 2021-10-27 12:41
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("public_data", "0022_auto_20211025_2135"),
]
operations = [
migrations.AddField(
model_name="couverturesol",
name="ma... | 25.214286 | 75 | 0.558074 |
2d14fec5c482cab3cc334368cecf205ddf1f653b | 462 | py | Python | nicos_mlz/labs/battery/setups/battery02.py | mlz-ictrl/nicos | a6de0bc194ba42e3dc04a033713b41b5499ba8e1 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 12 | 2019-11-06T15:40:36.000Z | 2022-01-01T16:23:00.000Z | nicos_mlz/labs/battery/setups/battery03.py | ess-dmsc/nicos | 755d61d403ff7123f804c45fc80c7ff4d762993b | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 91 | 2020-08-18T09:20:26.000Z | 2022-02-01T11:07:14.000Z | nicos_mlz/labs/battery/setups/battery01.py | mlz-ictrl/nicos | a6de0bc194ba42e3dc04a033713b41b5499ba8e1 | [
"CC-BY-3.0",
"Apache-2.0",
"CC-BY-4.0"
] | 6 | 2020-01-11T10:52:30.000Z | 2022-02-25T12:35:23.000Z | description = 'Battery temperature sensors'
# Devices run on a raspberry as entangle devices
tangobase = 'tango://%s:10000/box/sensor/' % setupname
group = 'plugplay'
devices = dict(
)
for i in range(1, 9):
devices['T_%s_%d' % (setupname, i)] = device('nicos.devices.tango.Sensor',
description = '%s tem... | 24.315789 | 78 | 0.625541 |
2d15220f236aabf60f413e31e0f3477a0a9ce740 | 6,618 | py | Python | src/pynwb/retinotopy.py | q0j0p/pynwb | 6c3a864662f2cce63b542f9f614cc632903f9bc1 | [
"BSD-3-Clause-LBNL"
] | null | null | null | src/pynwb/retinotopy.py | q0j0p/pynwb | 6c3a864662f2cce63b542f9f614cc632903f9bc1 | [
"BSD-3-Clause-LBNL"
] | 1 | 2021-06-01T22:25:36.000Z | 2021-06-01T22:25:36.000Z | src/pynwb/retinotopy.py | q0j0p/pynwb | 6c3a864662f2cce63b542f9f614cc632903f9bc1 | [
"BSD-3-Clause-LBNL"
] | null | null | null | from collections import Iterable
from .form.utils import docval, popargs, fmt_docval_args
from . import register_class, CORE_NAMESPACE
from .core import NWBContainer
class AImage(NWBContainer):
"""
"""
__nwbfields__ = ('data',
'bits_per_pixel',
'dimension',
... | 52.944 | 115 | 0.609096 |
2d1528bed2a3365734a2e066c2745ff990a838c7 | 18,310 | py | Python | cinder/tests/unit/utils.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/utils.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/utils.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | null | null | null | # Copyright 2011 OpenStack Foundation
#
# 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 l... | 33.720074 | 79 | 0.615347 |
2d1547ad70c9373538ca16cedeaaa4d0df9801aa | 828 | py | Python | page_object_models/services_page_model.py | ikostan/ParaBankSeleniumAutomation | e28a886adba89b82a60831ad96a3a8f00f863116 | [
"Unlicense"
] | 4 | 2019-08-12T19:36:58.000Z | 2021-09-14T18:48:27.000Z | page_object_models/services_page_model.py | ikostan/ParaBankSeleniumAutomation | e28a886adba89b82a60831ad96a3a8f00f863116 | [
"Unlicense"
] | 1 | 2021-06-02T00:01:00.000Z | 2021-06-02T00:01:00.000Z | page_object_models/services_page_model.py | ikostan/ParaBankSeleniumAutomation | e28a886adba89b82a60831ad96a3a8f00f863116 | [
"Unlicense"
] | 2 | 2019-08-12T10:06:00.000Z | 2020-12-25T05:52:40.000Z | # Created by Egor Kostan.
# GitHub: https://github.com/ikostan
# LinkedIn: https://www.linkedin.com/in/egor-kostan/
from tests.config import Config
from utils.driver import Driver
from page_object_models.base_page_model import BasePageModel
from expected_results.page_content.services_page_content import ServicesPa... | 34.5 | 113 | 0.804348 |
2d1558f4c8b76000722b00476f4b7a64869532ec | 1,010 | py | Python | manage.py | Jeromeschmidt/Guru | 3128a539e55b46afceb33b59c0bafaec7e9f630a | [
"MIT"
] | null | null | null | manage.py | Jeromeschmidt/Guru | 3128a539e55b46afceb33b59c0bafaec7e9f630a | [
"MIT"
] | 1 | 2021-02-26T02:49:34.000Z | 2021-02-26T02:49:34.000Z | manage.py | Jeromeschmidt/Guru | 3128a539e55b46afceb33b59c0bafaec7e9f630a | [
"MIT"
] | 1 | 2020-02-24T18:09:00.000Z | 2020-02-24T18:09:00.000Z | #!/usr/bin/env python
import os
import sys
if __name__ == "__main__":
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "config.settings.local")
try:
from django.core.management import execute_from_command_line
except ImportError:
# The above import may fail for some other reason. Ensure tha... | 33.666667 | 77 | 0.662376 |
2d15882f7417e4413394ebe7718aecd7bb86b060 | 18,502 | py | Python | resolwe_bio/processes/reads_processing/trimgalore.py | MiaZganjar/resolwe-bio | 1559435796cb40905d81c8fd14872f7ac66e66e8 | [
"Apache-2.0"
] | null | null | null | resolwe_bio/processes/reads_processing/trimgalore.py | MiaZganjar/resolwe-bio | 1559435796cb40905d81c8fd14872f7ac66e66e8 | [
"Apache-2.0"
] | null | null | null | resolwe_bio/processes/reads_processing/trimgalore.py | MiaZganjar/resolwe-bio | 1559435796cb40905d81c8fd14872f7ac66e66e8 | [
"Apache-2.0"
] | null | null | null | """Run Trim Galore tool on paired-end sequencing data."""
import os
from plumbum import TEE
from resolwe.process import (
BooleanField,
Cmd,
DataField,
FileField,
FileHtmlField,
FloatField,
GroupField,
IntegerField,
ListField,
Process,
SchedulingClass,
StringField,
)
... | 40.39738 | 104 | 0.555021 |
2d1602d5f305604c785b61ceb382179402f4eaec | 3,054 | py | Python | tests/test_component.py | LauWien/smooth | 3d2ee96e3c2b2f9d5d805da1a920748f2dbbd538 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 5 | 2019-10-15T15:56:35.000Z | 2021-02-04T10:11:31.000Z | tests/test_component.py | LauWien/smooth | 3d2ee96e3c2b2f9d5d805da1a920748f2dbbd538 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 121 | 2020-01-06T14:32:30.000Z | 2021-09-23T11:26:11.000Z | tests/test_component.py | LauWien/smooth | 3d2ee96e3c2b2f9d5d805da1a920748f2dbbd538 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 6 | 2019-10-21T08:36:05.000Z | 2021-03-26T10:37:17.000Z | import smooth.components.component as com
import smooth.framework.simulation_parameters as sim_params
import pytest
class TestBasic:
def test_init(self):
component = com.Component()
assert component is not None
assert hasattr(component, "component")
assert hasattr(component, "nam... | 33.56044 | 75 | 0.660773 |
2d167c74f6c67998d0791608c1e406c16b715f4f | 5,116 | py | Python | Other/setDimensions.py | protimient/Glyphs-Scripts | 0481ea01153844667cff8cfa3fad97c33af09956 | [
"Apache-2.0"
] | 2 | 2021-02-12T20:36:29.000Z | 2021-11-03T08:04:01.000Z | Other/setDimensions.py | protimient/Glyphs-Scripts | 0481ea01153844667cff8cfa3fad97c33af09956 | [
"Apache-2.0"
] | null | null | null | Other/setDimensions.py | protimient/Glyphs-Scripts | 0481ea01153844667cff8cfa3fad97c33af09956 | [
"Apache-2.0"
] | null | null | null | # MenuTitle: Set Dimensions
# -*- coding: utf-8 -*-
__doc__ = """
Sets the Latin values for each master in the Dimesions pallette in the top right.
"""
Glyphs.clearLog()
# Glyphs.showMacroWindow()
class getMeasurements:
def __init__(self, m):
self.m = m
if Glyphs.font.userData["GSDimensionPlugin.... | 42.991597 | 113 | 0.617279 |
2d16b5a2d2efa74e2a529fa3bdaf7c431436ada3 | 1,807 | py | Python | gibson2/scenes/stadium_scene.py | i-m-vivek/iGibson | c9009a3da4bfe05e8a3c058d83e0a5d3be0cd648 | [
"MIT"
] | 3 | 2021-02-07T14:00:38.000Z | 2021-07-03T19:40:59.000Z | gibson2/scenes/stadium_scene.py | i-m-vivek/iGibson | c9009a3da4bfe05e8a3c058d83e0a5d3be0cd648 | [
"MIT"
] | null | null | null | gibson2/scenes/stadium_scene.py | i-m-vivek/iGibson | c9009a3da4bfe05e8a3c058d83e0a5d3be0cd648 | [
"MIT"
] | 2 | 2021-04-01T12:14:59.000Z | 2021-06-18T13:04:39.000Z | import logging
import numpy as np
from gibson2.utils.utils import l2_distance
import pybullet_data
import pybullet as p
import os
from gibson2.scenes.scene_base import Scene
class StadiumScene(Scene):
"""
A simple stadium scene for debugging
"""
def __init__(self):
super(StadiumScene, self)._... | 33.462963 | 98 | 0.62922 |
2d16b5f82288ac0049502277d9672dfc68a0fab1 | 2,807 | py | Python | fri/model/base_type.py | timothycrosley/fri | 94c6b74bfb4ceee405df41834e2e3f8b0a617b38 | [
"MIT"
] | 8 | 2017-04-26T13:47:51.000Z | 2020-10-22T00:25:09.000Z | fri/model/base_type.py | timothycrosley/fri | 94c6b74bfb4ceee405df41834e2e3f8b0a617b38 | [
"MIT"
] | 77 | 2018-02-26T23:18:58.000Z | 2022-03-01T13:10:09.000Z | fri/model/base_type.py | timothycrosley/fri | 94c6b74bfb4ceee405df41834e2e3f8b0a617b38 | [
"MIT"
] | 3 | 2019-04-26T10:17:10.000Z | 2020-04-03T08:51:39.000Z | from abc import ABC, abstractmethod
import scipy.stats
class ProblemType(ABC):
def __init__(self, **kwargs):
self.chosen_parameters_ = {}
for p in self.parameters():
if p in kwargs:
if kwargs[p] is not None:
self.chosen_parameters_[p] = kwargs[p]
... | 29.861702 | 82 | 0.573566 |
2d17015556561411e9855be9f5a17170cac72c0b | 3,397 | py | Python | common/_shell_qa_api/subprocess_command.py | albalabkin/PyCats | b3fa09e116f38cebbb66faef16785e2795d80aa9 | [
"Apache-2.0"
] | 7 | 2020-06-12T15:16:10.000Z | 2020-06-20T18:42:07.000Z | common/_shell_qa_api/subprocess_command.py | albalabkin/PyCats | b3fa09e116f38cebbb66faef16785e2795d80aa9 | [
"Apache-2.0"
] | 4 | 2020-06-15T20:08:32.000Z | 2020-06-29T16:51:57.000Z | common/_shell_qa_api/subprocess_command.py | Softeq/SCAF | c71d54ca7fa958c22ca8c78ba9889c6a32b827be | [
"Apache-2.0"
] | 3 | 2020-07-27T10:45:36.000Z | 2021-01-13T12:10:46.000Z | import logging
import subprocess
logger = logging.getLogger(__name__)
def _post_send_command_actions(command, exp_rc, out, err, rc):
"""Process command result output.
Args:
command (str): Shell or bash command
exp_rc (list): Expected result
out (byte): Console output
err (byt... | 28.788136 | 91 | 0.620548 |
2d172ec101c1de2ebda798e7b07afe05bbb0a19d | 1,066 | py | Python | py/0520.detect-capital.py | ck2w/leetcode | 2d411530b690a2e51b0ae518bf3efaad2edc1083 | [
"MIT"
] | null | null | null | py/0520.detect-capital.py | ck2w/leetcode | 2d411530b690a2e51b0ae518bf3efaad2edc1083 | [
"MIT"
] | null | null | null | py/0520.detect-capital.py | ck2w/leetcode | 2d411530b690a2e51b0ae518bf3efaad2edc1083 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=520 lang=python3
#
# [520] Detect Capital
#
# https://leetcode.com/problems/detect-capital/description/
#
# algorithms
# Easy (54.29%)
# Likes: 1185
# Dislikes: 336
# Total Accepted: 225K
# Total Submissions: 409.7K
# Testcase Example: '"USA"'
#
# We define the usage of capitals in a word... | 20.901961 | 94 | 0.661351 |
2d175b75e65c49be5cc6cd88e795ebfa5d0135b2 | 1,436 | py | Python | fluo/db/backends/sqlite3.py | rsalmaso/django-fluo | 340e3b4f9c1b4b09feccefb9b3ab2d26d59fac2b | [
"MIT"
] | 1 | 2020-08-05T09:29:08.000Z | 2020-08-05T09:29:08.000Z | fluo/db/backends/sqlite3.py | rsalmaso/django-fluo | 340e3b4f9c1b4b09feccefb9b3ab2d26d59fac2b | [
"MIT"
] | 1 | 2020-08-05T09:28:58.000Z | 2020-09-19T09:02:48.000Z | fluo/db/backends/sqlite3.py | rsalmaso/django-fluo | 340e3b4f9c1b4b09feccefb9b3ab2d26d59fac2b | [
"MIT"
] | null | null | null | # Copyright (C) 2007-2020, Raffaele Salmaso <raffaele@salmaso.org>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, cop... | 33.395349 | 79 | 0.727019 |
2d1781e3ea4b08927c9cfb008aa565a9b15c39ce | 12,272 | py | Python | tests/unit/unit_test_Cache.py | zimingd/synapsePythonClient | 6bddd4d9de2f06f6f79d8ce814ac57970d6bebee | [
"Apache-2.0"
] | null | null | null | tests/unit/unit_test_Cache.py | zimingd/synapsePythonClient | 6bddd4d9de2f06f6f79d8ce814ac57970d6bebee | [
"Apache-2.0"
] | null | null | null | tests/unit/unit_test_Cache.py | zimingd/synapsePythonClient | 6bddd4d9de2f06f6f79d8ce814ac57970d6bebee | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import six
import re, os, tempfile, json
import time, datetime, random
from mock import MagicMock, patch
from nose.tools import assert_raises, assert_equal, assert_is_non... | 40.770764 | 124 | 0.744703 |
2d17847361b4d78aaf0cc05cc0343b7357835a1f | 279 | py | Python | Console/Console2/output_test.py | JamesGKent/python-snippets | 665b4cf1878cce338bb1c3d5dcdbfa9a827ae6a9 | [
"MIT"
] | null | null | null | Console/Console2/output_test.py | JamesGKent/python-snippets | 665b4cf1878cce338bb1c3d5dcdbfa9a827ae6a9 | [
"MIT"
] | null | null | null | Console/Console2/output_test.py | JamesGKent/python-snippets | 665b4cf1878cce338bb1c3d5dcdbfa9a827ae6a9 | [
"MIT"
] | null | null | null | from Console import Console
import sys, threading
if (__name__ == '__main__'):
p = Console(False)
try:
while True:
data = input('Tx:')
if data:
data = '%s\n' % data
p.write(data.encode('utf8'))
else:
break
except KeyboardInterrupt:
pass | 18.6 | 33 | 0.602151 |
2d1795da2638d976477827802b11b942933709f3 | 4,384 | py | Python | example/settings.py | christianbertschy/django-cms-2.0 | a98d035b47346b7f6924a807338be3af6566537f | [
"BSD-3-Clause"
] | 1 | 2015-09-24T00:36:34.000Z | 2015-09-24T00:36:34.000Z | example/settings.py | christianbertschy/django-cms-2.0 | a98d035b47346b7f6924a807338be3af6566537f | [
"BSD-3-Clause"
] | null | null | null | example/settings.py | christianbertschy/django-cms-2.0 | a98d035b47346b7f6924a807338be3af6566537f | [
"BSD-3-Clause"
] | null | null | null | # Django settings for cms project.
import os
PROJECT_DIR = os.path.dirname(__file__)
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
# ('Your Name', 'your_email@domain.com'),
)
CACHE_BACKEND = 'locmem:///'
MANAGERS = ADMINS
DATABASE_ENGINE = 'mysql' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sql... | 29.621622 | 106 | 0.705976 |
2d17a0e9429ea9782490ca325decd11e322be116 | 272 | py | Python | cart/templatetags/currency_tags.py | Wings30306/callingmrschristmas | 2957e4fd3e61e0df4f3135113d52a518eae6270e | [
"PostgreSQL"
] | 4 | 2020-01-31T13:49:43.000Z | 2020-02-05T22:47:51.000Z | cart/templatetags/currency_tags.py | Wings30306/callingmrschristmas | 2957e4fd3e61e0df4f3135113d52a518eae6270e | [
"PostgreSQL"
] | 13 | 2019-12-07T12:16:27.000Z | 2022-03-12T00:06:22.000Z | cart/templatetags/currency_tags.py | Wings30306/callingmrschristmas | 2957e4fd3e61e0df4f3135113d52a518eae6270e | [
"PostgreSQL"
] | 1 | 2020-02-01T00:23:19.000Z | 2020-02-01T00:23:19.000Z | from django import template
register = template.Library()
@register.simple_tag
def currency(value):
"""Custom template tag for displaying currency"""
value_decimal = value / 100
currency_string = "£\u00A0" + f'{value_decimal:.2f}'
return currency_string
| 24.727273 | 56 | 0.724265 |
2d17b5481cb15d76a62e0b2d1ea154628d2cc9f6 | 2,087 | py | Python | syncmanagerapi/syncmanagerapi/database.py | Frie-man/syncmanager | f76e36f85ea68ab177a9ffd50dfff033ae0fc8f6 | [
"MIT"
] | null | null | null | syncmanagerapi/syncmanagerapi/database.py | Frie-man/syncmanager | f76e36f85ea68ab177a9ffd50dfff033ae0fc8f6 | [
"MIT"
] | null | null | null | syncmanagerapi/syncmanagerapi/database.py | Frie-man/syncmanager | f76e36f85ea68ab177a9ffd50dfff033ae0fc8f6 | [
"MIT"
] | null | null | null | import os.path as osp
from flask import current_app, g
from flask_sqlalchemy import SQLAlchemy
from flask_marshmallow import Marshmallow
from .settings import properties_dir
def init_schema():
# import all the models
from .git import model
db.create_all()
def get_sqlite_path(conf):
if not conf.get... | 28.202703 | 98 | 0.671778 |
2d17b91f4dc4f14a9c1dad1541616874d29c2316 | 5,718 | py | Python | src/pyoffers/models/core.py | Stranger6667/py-offers | 73ef00e7b02ddfa5adc6df282009aea7670e465f | [
"MIT"
] | 17 | 2016-08-26T10:50:44.000Z | 2021-07-08T17:39:34.000Z | src/pyoffers/models/core.py | Stranger6667/py-offers | 73ef00e7b02ddfa5adc6df282009aea7670e465f | [
"MIT"
] | 80 | 2016-08-26T08:45:20.000Z | 2020-08-31T15:47:10.000Z | src/pyoffers/models/core.py | Stranger6667/py-offers | 73ef00e7b02ddfa5adc6df282009aea7670e465f | [
"MIT"
] | 7 | 2017-04-03T08:19:06.000Z | 2020-10-16T19:02:21.000Z | from collections import defaultdict
from ..utils import Filter, Sort
class SelectiveInheritanceMeta(type):
"""Allows to inherit only methods from `generic_methods` attribute."""
generic_methods = defaultdict(dict)
def __new__(cls, name, bases, members):
if not bases:
for key, value ... | 31.766667 | 117 | 0.658797 |
2d17e5b714cba14ab4eaa13221768f922315cf46 | 80 | py | Python | website/client/__init__.py | cangkevin/asain-show-rss-website-wrapper | ca7953e2b764705d1a78c691e1920b2f632e6bc9 | [
"MIT"
] | null | null | null | website/client/__init__.py | cangkevin/asain-show-rss-website-wrapper | ca7953e2b764705d1a78c691e1920b2f632e6bc9 | [
"MIT"
] | 46 | 2018-12-16T02:38:34.000Z | 2021-06-01T22:44:45.000Z | website/client/__init__.py | cangkevin/asain-show-rss-website-wrapper | ca7953e2b764705d1a78c691e1920b2f632e6bc9 | [
"MIT"
] | 1 | 2019-01-06T04:13:51.000Z | 2019-01-06T04:13:51.000Z | from website.client.api import get_movies, get_shows, get_episodes, get_sources
| 40 | 79 | 0.85 |
2d17fb9d28482fb2a85b796f51c0dc5f8fdc0670 | 1,441 | py | Python | classifier_3D/feature_extraction/extractor.py | theovincent/3DPointCloudClassification | cd3ed8d824e9cf671c0a46b352eae26074624019 | [
"MIT"
] | null | null | null | classifier_3D/feature_extraction/extractor.py | theovincent/3DPointCloudClassification | cd3ed8d824e9cf671c0a46b352eae26074624019 | [
"MIT"
] | null | null | null | classifier_3D/feature_extraction/extractor.py | theovincent/3DPointCloudClassification | cd3ed8d824e9cf671c0a46b352eae26074624019 | [
"MIT"
] | null | null | null | import numpy as np
from classifier_3D.feature_extraction.PCA import compute_local_PCA
def get_features(
query_points, cloud_points, radius_or_k_neighbors, use_radius=True, **kwargs
):
# !! Warning !! eigenvalues are given in ascending order
all_eigenvalues, all_eigenvectors = compute_local_PCA(
q... | 32.022222 | 80 | 0.615545 |
2d17fcfb31bc04167480d0eb1b4c61f343f042c8 | 7,670 | py | Python | mapproxy/test/test_http_helper.py | kaiCu/mapproxy | 9b28f9ca1286e686b8f2188dd52ce56b607427a7 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | mapproxy/test/test_http_helper.py | kaiCu/mapproxy | 9b28f9ca1286e686b8f2188dd52ce56b607427a7 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | mapproxy/test/test_http_helper.py | kaiCu/mapproxy | 9b28f9ca1286e686b8f2188dd52ce56b607427a7 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # This file is part of the MapProxy project.
# Copyright (C) 2013 Omniscale <http://omniscale.de>
#
# 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... | 36.52381 | 101 | 0.578879 |
2d18143bd9f8a875b5d3a0720463a36160a1f13f | 421 | py | Python | week5_policy_based/parallel.py | syuntoku14/PracticalRL_coursera_pytorch | aabdb087b0387f2a20866ca5bfe3b57b57a0419e | [
"MIT"
] | null | null | null | week5_policy_based/parallel.py | syuntoku14/PracticalRL_coursera_pytorch | aabdb087b0387f2a20866ca5bfe3b57b57a0419e | [
"MIT"
] | null | null | null | week5_policy_based/parallel.py | syuntoku14/PracticalRL_coursera_pytorch | aabdb087b0387f2a20866ca5bfe3b57b57a0419e | [
"MIT"
] | null | null | null | def evaluateMP(p, agent, env):
"""Plays an a game from start till done, returns per-game rewards """
state = env.reset()
total_reward = 0
while True:
state = torch.tensor(state).unsqueeze(0)
action = agent.sample_actions(agent(state))[0]
state, reward, done, info = env.step(act... | 26.3125 | 73 | 0.629454 |
2d182735faf006c02ec593ea23e5446c9d0abca8 | 1,510 | py | Python | supriya/commands/BufferGetRequest.py | deeuu/supriya | 14fcb5316eccb4dafbe498932ceff56e1abb9d27 | [
"MIT"
] | null | null | null | supriya/commands/BufferGetRequest.py | deeuu/supriya | 14fcb5316eccb4dafbe498932ceff56e1abb9d27 | [
"MIT"
] | null | null | null | supriya/commands/BufferGetRequest.py | deeuu/supriya | 14fcb5316eccb4dafbe498932ceff56e1abb9d27 | [
"MIT"
] | null | null | null | import supriya.osc
from supriya.commands.Request import Request
from supriya.enums import RequestId
class BufferGetRequest(Request):
"""
A /b_get request.
::
>>> import supriya.commands
>>> request = supriya.commands.BufferGetRequest(
... buffer_id=23,
... indices... | 22.878788 | 62 | 0.570861 |
2d1834039e2709b744eedfddc5503b32ca502292 | 489 | py | Python | reveries/common/usd/pipeline/lay_json_export.py | davidlatwe/reveries-config | 4a282dd64a32a9b87bd1a070759b6425ff785d68 | [
"MIT"
] | 3 | 2020-04-01T10:51:17.000Z | 2021-08-05T18:35:23.000Z | reveries/common/usd/pipeline/lay_json_export.py | davidlatwe/reveries-config | 4a282dd64a32a9b87bd1a070759b6425ff785d68 | [
"MIT"
] | null | null | null | reveries/common/usd/pipeline/lay_json_export.py | davidlatwe/reveries-config | 4a282dd64a32a9b87bd1a070759b6425ff785d68 | [
"MIT"
] | 1 | 2020-07-05T12:06:30.000Z | 2020-07-05T12:06:30.000Z | import json
from avalon import api
def export(usd_path, json_path, host="maya"):
from reveries.common.usd.get_asset_info import GetAssetInfo
asset_obj = GetAssetInfo(usd_file=usd_path)
asset_info_data = asset_obj.asset_info
asset_info_data["extra"] = {
"host": host,
"dept": api.Sess... | 24.45 | 67 | 0.672802 |
2d18494ae06749d24a124e89ced7e8d58111d34f | 115,917 | py | Python | dnacentersdk/api/v1_3_0/network_discovery.py | nonstdout/dnacentersdk | dbbbc4baa5300aa9e5c9193f2ea71438018095f5 | [
"MIT"
] | null | null | null | dnacentersdk/api/v1_3_0/network_discovery.py | nonstdout/dnacentersdk | dbbbc4baa5300aa9e5c9193f2ea71438018095f5 | [
"MIT"
] | null | null | null | dnacentersdk/api/v1_3_0/network_discovery.py | nonstdout/dnacentersdk | dbbbc4baa5300aa9e5c9193f2ea71438018095f5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""DNA Center Network Discovery API wrapper.
Copyright (c) 2019-2020 Cisco and/or its affiliates.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, incl... | 39.481267 | 78 | 0.543535 |
2d1852de90c4a5eb95295890d792fad576c8bccf | 2,947 | py | Python | tests/unit/utils/warnings_test.py | epoelke/salt | 80ae64e54f9f336d3cdb6e03e42f2a50469ec8f2 | [
"Apache-2.0"
] | 1 | 2016-12-20T20:11:21.000Z | 2016-12-20T20:11:21.000Z | tests/unit/utils/warnings_test.py | epoelke/salt | 80ae64e54f9f336d3cdb6e03e42f2a50469ec8f2 | [
"Apache-2.0"
] | null | null | null | tests/unit/utils/warnings_test.py | epoelke/salt | 80ae64e54f9f336d3cdb6e03e42f2a50469ec8f2 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
'''
tests.unit.utils.warnings_test
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Test ``salt.utils.warn_until``
:codeauthor: :email:`Pedro Algarvio (pedro@algarvio.me)`
:copyright: © 2013 by the SaltStack Team, see AUTHORS for more details.
:license: Apache 2.0, see LICENSE for more d... | 35.939024 | 81 | 0.617577 |
2d186a8b7c00dccac1a151934224d1063fd29786 | 14,773 | py | Python | mrestimator/utility.py | balajisriram/mrestimator | 62a17ed8b101362862364850bb93991dd7e3893a | [
"BSD-3-Clause"
] | 6 | 2018-11-27T10:14:56.000Z | 2021-03-09T14:53:10.000Z | mrestimator/utility.py | balajisriram/mrestimator | 62a17ed8b101362862364850bb93991dd7e3893a | [
"BSD-3-Clause"
] | 1 | 2021-05-15T21:35:29.000Z | 2021-05-15T21:35:29.000Z | mrestimator/utility.py | balajisriram/mrestimator | 62a17ed8b101362862364850bb93991dd7e3893a | [
"BSD-3-Clause"
] | 3 | 2019-08-19T21:44:17.000Z | 2021-05-18T20:32:59.000Z | import os
import logging
import logging.handlers
import stat
import tempfile
import platform
import getpass
import math
import numpy as np
import scipy
import scipy.stats
__version__ = "unknown"
from ._version import __version__
log = logging.getLogger(__name__)
_targetdir = None
_logfilehandler = None
_logstreamhan... | 32.975446 | 87 | 0.59338 |
2d187a1ee3440021dec0fd73234e6fd0f1247fe1 | 14,442 | py | Python | EfficientDet/train.py | zhzxdev/sjtuaicamp2020r1 | ac418a910ad227789cbe76d255aa74ea44cfc299 | [
"MIT"
] | null | null | null | EfficientDet/train.py | zhzxdev/sjtuaicamp2020r1 | ac418a910ad227789cbe76d255aa74ea44cfc299 | [
"MIT"
] | null | null | null | EfficientDet/train.py | zhzxdev/sjtuaicamp2020r1 | ac418a910ad227789cbe76d255aa74ea44cfc299 | [
"MIT"
] | null | null | null | # original author: signatrix
# adapted from https://github.com/signatrix/efficientdet/blob/master/train.py
# modified by Zylo117
import argparse
import datetime
import os
import traceback
import numpy as np
import torch
import yaml
from tensorboardX import SummaryWriter
from torch import nn
from torch.utils.data impo... | 44.165138 | 194 | 0.58773 |
2d18890c4e8f02bb601d8b2e2a0bb35c76854eed | 2,740 | py | Python | cogs/hardware_utils.py | etcadinfinitum/CSSBot_Py | 553d2110240e7d643fcaa9f202532ce2bfd77187 | [
"MIT"
] | 6 | 2018-01-31T01:26:55.000Z | 2021-07-05T06:38:38.000Z | cogs/hardware_utils.py | etcadinfinitum/CSSBot_Py | 553d2110240e7d643fcaa9f202532ce2bfd77187 | [
"MIT"
] | 18 | 2018-01-11T22:11:36.000Z | 2021-10-01T20:47:57.000Z | cogs/hardware_utils.py | etcadinfinitum/CSSBot_Py | 553d2110240e7d643fcaa9f202532ce2bfd77187 | [
"MIT"
] | 6 | 2018-01-11T21:31:59.000Z | 2021-03-16T17:15:49.000Z | '''
discord bot cog that is used for automating tedious work in CSS422
'''
from discord.ext import commands
from submodules.hardware_scripts.src.boolean_expr_parser import BooleanExpr
from submodules.hardware_scripts.src.page_address_calc import AddressParser
class HardwareUtilsCog(commands.Cog):
'''
Collectio... | 38.591549 | 79 | 0.65365 |
2d18de667f8ce270d8dd28fffe794970e82bffe8 | 778 | py | Python | examples/example_config_auditing_paraNQE.py | Jack-Shen/fwd_python_api | d9fd0dfb0dfb6eb8755058028ebe2a09e4835442 | [
"MIT"
] | null | null | null | examples/example_config_auditing_paraNQE.py | Jack-Shen/fwd_python_api | d9fd0dfb0dfb6eb8755058028ebe2a09e4835442 | [
"MIT"
] | null | null | null | examples/example_config_auditing_paraNQE.py | Jack-Shen/fwd_python_api | d9fd0dfb0dfb6eb8755058028ebe2a09e4835442 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# ### 1 - SET UP THE API
# In[1]:
import requests
import sys
import json
sys.path.append("..")
import fwd_json
from fwd_json import fwdApi
import setup
username = setup.username
token = setup.token
network = setup.network
fwd = setup.fwd
nqeUrl = setup.nqeUrl
#get the latest s... | 21.611111 | 59 | 0.750643 |
2d18e9fbfc1194d67c1ff024bf89aaf8f7f5dc1e | 1,172 | py | Python | data_structure/232_queue_using_stacks.py | shawlu95/Algorithm-Toolbox | b6c7b2228d8e70e0842e0bad607533a2c8322cf0 | [
"MIT"
] | null | null | null | data_structure/232_queue_using_stacks.py | shawlu95/Algorithm-Toolbox | b6c7b2228d8e70e0842e0bad607533a2c8322cf0 | [
"MIT"
] | null | null | null | data_structure/232_queue_using_stacks.py | shawlu95/Algorithm-Toolbox | b6c7b2228d8e70e0842e0bad607533a2c8322cf0 | [
"MIT"
] | 2 | 2020-02-07T20:49:02.000Z | 2020-02-11T06:01:55.000Z | class MyQueue:
def __init__(self):
"""
Initialize your data structure here.
"""
self.s1 = []
self.s2 = []
def push(self, x: 'int') -> 'None':
"""
Push element x to the back of queue.
"""
self.s1.append(x)
def pop(self) -> 'int':
... | 23.44 | 76 | 0.500853 |
2d19089fa2e4747ed0128f39ade4b5b7e01709cb | 2,471 | py | Python | nozama-cloudsearch-client/nozama/cloudsearch/client/admintool/admincmds.py | iGamesInc/nozama-cloudsearch | 2f3637a98d4ef594cec0273a9c9c4cd8a8aac375 | [
"BSD-3-Clause"
] | null | null | null | nozama-cloudsearch-client/nozama/cloudsearch/client/admintool/admincmds.py | iGamesInc/nozama-cloudsearch | 2f3637a98d4ef594cec0273a9c9c4cd8a8aac375 | [
"BSD-3-Clause"
] | null | null | null | nozama-cloudsearch-client/nozama/cloudsearch/client/admintool/admincmds.py | iGamesInc/nozama-cloudsearch | 2f3637a98d4ef594cec0273a9c9c4cd8a8aac375 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
"""
import os
#import codecs
import logging
import ConfigParser
import cmdln
import requests
from nozama.cloudsearch.client.rest import CloudsearchService
class AdminCmds(cmdln.Cmdln):
"""Usage:
{name}-admin -c / --config <admin.ini> SUBCOMMAND [ARGS...]
{name}-admin ... | 25.739583 | 77 | 0.585998 |
2d1921cd8c737ad6c28eb88a1361eb746cecbe36 | 3,364 | py | Python | modernize/utils.py | superjkl/python-modernize-division-warnings | 7095261ec661fbf33db59c87c501f0f84ecc4f4a | [
"BSD-3-Clause"
] | 220 | 2015-03-25T11:06:13.000Z | 2020-08-19T13:33:57.000Z | modernize/utils.py | superjkl/python-modernize-division-warnings | 7095261ec661fbf33db59c87c501f0f84ecc4f4a | [
"BSD-3-Clause"
] | 113 | 2015-01-03T18:05:27.000Z | 2020-08-18T21:42:23.000Z | modernize/utils.py | superjkl/python-modernize-division-warnings | 7095261ec661fbf33db59c87c501f0f84ecc4f4a | [
"BSD-3-Clause"
] | 39 | 2015-01-18T10:08:52.000Z | 2020-07-12T18:44:40.000Z | from __future__ import generator_stop
from fissix import fixer_util
from fissix.pgen2 import token
from fissix.pygram import python_symbols as syms
from fissix.pytree import Leaf, Node
def _check_future_import(node):
"""If this is a future import, return set of symbols that are imported,
else return None."""... | 30.035714 | 78 | 0.58918 |
2d193422b7ae4c1f8bdbadbed293d6dbf4905a5c | 1,122 | py | Python | alipay/aop/api/response/AlipayInsSceneInspetprodShielduserQueryResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/AlipayInsSceneInspetprodShielduserQueryResponse.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/response/AlipayInsSceneInspetprodShielduserQueryResponse.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.response.AlipayResponse import AlipayResponse
class AlipayInsSceneInspetprodShielduserQueryResponse(AlipayResponse):
def __init__(self):
super(AlipayInsSceneInspetprodShielduserQueryResponse, self).__init__()
self._shi... | 31.166667 | 120 | 0.722816 |
2d195b32f2e76e2062440cdfcabe1550a4a8f958 | 2,417 | py | Python | src/CryptoPlus/SelfTest/Cipher/__init__.py | koujiandou-mhfg/python-cryptoplus | a5a1f8aecce4ddf476b2d80b586822d9e91eeb7d | [
"MIT"
] | 64 | 2015-01-15T10:41:41.000Z | 2022-01-10T23:51:42.000Z | src/CryptoPlus/SelfTest/Cipher/__init__.py | koujiandou-mhfg/python-cryptoplus | a5a1f8aecce4ddf476b2d80b586822d9e91eeb7d | [
"MIT"
] | 5 | 2016-01-05T17:48:22.000Z | 2018-02-22T04:32:17.000Z | src/CryptoPlus/SelfTest/Cipher/__init__.py | koujiandou-mhfg/python-cryptoplus | a5a1f8aecce4ddf476b2d80b586822d9e91eeb7d | [
"MIT"
] | 53 | 2015-04-14T00:17:02.000Z | 2022-03-12T05:32:05.000Z | # -*- coding: utf-8 -*-
#
# SelfTest/Cipher/__init__.py: Self-test for cipher modules
#
# =======================================================================
# Copyright (C) 2008 Dwayne C. Litzenberger <dlitz@dlitz.net>
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this sof... | 44.759259 | 73 | 0.683492 |
2d196f906d964babc21df98953dfcdd23f0e5b7c | 1,887 | py | Python | imbi/endpoints/integrations/oauth2.py | nvllsvm/imbi-api | 1a5bd8894ac14c1026f33297994aa10782b0eea0 | [
"BSD-3-Clause"
] | 1 | 2021-06-23T18:34:47.000Z | 2021-06-23T18:34:47.000Z | imbi/endpoints/integrations/oauth2.py | nvllsvm/imbi-api | 1a5bd8894ac14c1026f33297994aa10782b0eea0 | [
"BSD-3-Clause"
] | null | null | null | imbi/endpoints/integrations/oauth2.py | nvllsvm/imbi-api | 1a5bd8894ac14c1026f33297994aa10782b0eea0 | [
"BSD-3-Clause"
] | 2 | 2022-02-11T22:06:18.000Z | 2022-02-21T19:35:06.000Z | import re
from imbi.endpoints import base
class CollectionRequestHandler(base.CollectionRequestHandler):
NAME = 'integrations'
ITEM_NAME = 'integration'
ID_KEY = 'name'
FIELDS = ['name', 'api_endpoint', 'callback_url', 'authirization_endpoint',
'token_endpoint', 'revoke_endpoint', 'cli... | 36.288462 | 79 | 0.605193 |
2d19836c1577f7ada1fa3c5494e2481af025983d | 970 | py | Python | lib/utils/hansard.py | thaum-io/language-of-leadership | e3b313a6af7a688c94eb415efd6c345fe4cd27f2 | [
"MIT"
] | null | null | null | lib/utils/hansard.py | thaum-io/language-of-leadership | e3b313a6af7a688c94eb415efd6c345fe4cd27f2 | [
"MIT"
] | null | null | null | lib/utils/hansard.py | thaum-io/language-of-leadership | e3b313a6af7a688c94eb415efd6c345fe4cd27f2 | [
"MIT"
] | null | null | null | import glob, json
import pandas as pd
# Add repo
git_dir = os.path.abspath('../')
data_path = os.path.join("", 'data', 'hansard-parsed')
def hansard_senate_paths(year : int):
senate_paths = glob.glob("{}/senate/{}/*.json".format(data_path, year))
return senate_paths
def hansard_hofreps_paths(year : int):
... | 27.714286 | 77 | 0.687629 |
2d1986da2cea12cb9a85db2230eb7b565938e4b2 | 36,250 | py | Python | airflow/jobs/backfill_job.py | joshowen/airflow | d0cf232919839d0e338dcc38a5c7a1841077eaae | [
"Apache-2.0"
] | 3 | 2015-08-25T13:56:44.000Z | 2020-03-21T10:26:58.000Z | airflow/jobs/backfill_job.py | joshowen/airflow | d0cf232919839d0e338dcc38a5c7a1841077eaae | [
"Apache-2.0"
] | 4 | 2016-04-15T12:31:24.000Z | 2020-03-03T12:56:08.000Z | airflow/jobs/backfill_job.py | santecapital/airflow | 7f02e56c9cb8b548624d13e9c2c2b89d753f996b | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2 | 2018-07-24T08:54:45.000Z | 2018-08-31T13:41:50.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... | 43.780193 | 109 | 0.572993 |
2d198f824d14a2c2671f05cbd8a885873977245e | 211 | py | Python | abstar/version.py | gfinak/abstar | dde92f8cd8ddda84e98b53062fc39a7d103d9fba | [
"MIT"
] | 1 | 2020-03-04T10:06:36.000Z | 2020-03-04T10:06:36.000Z | abstar/version.py | shulp2211/abstar | 9641ccfb792f72cc8cdd8a59ae2d43bc3620d38a | [
"MIT"
] | 1 | 2019-02-28T21:15:10.000Z | 2019-02-28T21:15:10.000Z | abstar/version.py | shulp2211/abstar | 9641ccfb792f72cc8cdd8a59ae2d43bc3620d38a | [
"MIT"
] | 1 | 2019-02-28T18:56:57.000Z | 2019-02-28T18:56:57.000Z | # Store the version here so:
# 1) we don't load dependencies by storing it in __init__.py
# 2) we can import it in setup.py for the same reason
# 3) we can import it into your module module
__version__ = '0.3.5' | 42.2 | 60 | 0.729858 |
2d1993ff8a3e725c74590adcdd02c05e4c990d1d | 767 | py | Python | bin/predict_snapshot.py | top-on/pest-pi | fe9544db5fc83e0d342844daebca3c1bf94bf99b | [
"MIT"
] | 1 | 2020-09-20T20:55:40.000Z | 2020-09-20T20:55:40.000Z | bin/predict_snapshot.py | top-on/pest-pi | fe9544db5fc83e0d342844daebca3c1bf94bf99b | [
"MIT"
] | 1 | 2019-12-24T09:52:13.000Z | 2019-12-24T11:06:40.000Z | bin/predict_snapshot.py | top-on/pest-pi | fe9544db5fc83e0d342844daebca3c1bf94bf99b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Take a snapshot from the webcam and classify it.
Log both the snapshot and the prediction.
"""
import imageio
import json
import time
from pest_pi.camera import take_picture
from pest_pi.image import get_classifier, predict_classes, preprocess_array
# load model
model = get_classifier()
# ... | 25.566667 | 75 | 0.760104 |
2d19ab61fa5a0cb6a048511eff51edd906b3bf38 | 10,432 | py | Python | babycam/core/loader.py | Mschikay/FCIS-babycam | 603dab002fb0e665435acd119b02cf3f18c4eb02 | [
"Apache-2.0"
] | 1 | 2020-08-20T15:25:36.000Z | 2020-08-20T15:25:36.000Z | babycam/core/loader.py | Mschikay/FCIS-babycam | 603dab002fb0e665435acd119b02cf3f18c4eb02 | [
"Apache-2.0"
] | null | null | null | babycam/core/loader.py | Mschikay/FCIS-babycam | 603dab002fb0e665435acd119b02cf3f18c4eb02 | [
"Apache-2.0"
] | 1 | 2020-08-20T15:25:41.000Z | 2020-08-20T15:25:41.000Z | # --------------------------------------------------------
# Fully Convolutional Instance-aware Semantic Segmentation
# Copyright (c) 2016 by Contributors
# Copyright (c) 2017 Microsoft
# Licensed under The Apache-2.0 License [see LICENSE for details]
# Modified by Haozhi Qi
# ------------------------------------------... | 36.603509 | 114 | 0.589628 |
2d19b6cbffe7f79c3c597009d43b13262cbe8a3c | 1,078 | py | Python | zerver/lib/avatar_hash.py | dehnert/zulip | f5935e81c7cf2f11ff4ccfcd31d2a1061b8d7ff5 | [
"Apache-2.0"
] | null | null | null | zerver/lib/avatar_hash.py | dehnert/zulip | f5935e81c7cf2f11ff4ccfcd31d2a1061b8d7ff5 | [
"Apache-2.0"
] | null | null | null | zerver/lib/avatar_hash.py | dehnert/zulip | f5935e81c7cf2f11ff4ccfcd31d2a1061b8d7ff5 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from django.conf import settings
from six import text_type
from zerver.lib.utils import make_safe_digest
import hashlib
def gravatar_hash(email):
# type: (text_type) -> text_type
"""Compute the Gravatar hash for an email address."""
# Non-ASCII characters aren't pe... | 37.172414 | 80 | 0.743043 |
2d19ddceedaeb2a34e4a061736c180fd573a5b45 | 318 | py | Python | tests/conftest.py | jmaldon1/Musher | 58f4c8bde4c314821f15bce27555896a00935c1c | [
"MIT"
] | 4 | 2019-11-11T22:57:33.000Z | 2020-11-30T03:12:44.000Z | tests/conftest.py | jmaldon1/Musher | 58f4c8bde4c314821f15bce27555896a00935c1c | [
"MIT"
] | null | null | null | tests/conftest.py | jmaldon1/Musher | 58f4c8bde4c314821f15bce27555896a00935c1c | [
"MIT"
] | 1 | 2019-11-13T16:45:30.000Z | 2019-11-13T16:45:30.000Z | import os
import pytest
@pytest.fixture()
def test_data_dir() -> str:
"""Test data directory that stores some files for testing purposes.
Returns:
str: Test data directory.
"""
tests_dir_path = os.path.abspath(os.path.dirname(__file__))
return os.path.join(tests_dir_path, "..", "data")
| 22.714286 | 71 | 0.676101 |
2d19dfd507561bb4796d8be1f51c2ca90b97b7b3 | 102 | py | Python | aio/web/__init__.py | eigenphi/gcommon | bce1ee422874fa904d90afee03fd703a06dc7a4d | [
"MIT"
] | 3 | 2021-11-09T09:43:21.000Z | 2021-12-16T18:15:43.000Z | aio/web/__init__.py | eigenphi/gcommon | bce1ee422874fa904d90afee03fd703a06dc7a4d | [
"MIT"
] | null | null | null | aio/web/__init__.py | eigenphi/gcommon | bce1ee422874fa904d90afee03fd703a06dc7a4d | [
"MIT"
] | 2 | 2022-03-10T11:24:46.000Z | 2022-03-25T06:39:17.000Z | # -*- coding: utf-8 -*-
# created: 2021-08-21
# creator: liguopeng@liguopeng.net
"""通用工具类 web 接口"""
| 17 | 34 | 0.617647 |
2d19f2516669e4306dc4ed8aad2912f3d6882ed3 | 13,602 | py | Python | src/preprocessing/spatial.py | kjhall01/xcast | 17edfd8c79c5163b004800170bbcf21302e8c792 | [
"MIT"
] | 11 | 2021-11-01T21:38:17.000Z | 2022-03-30T11:46:32.000Z | src/preprocessing/spatial.py | kjhall01/xcast | 17edfd8c79c5163b004800170bbcf21302e8c792 | [
"MIT"
] | 7 | 2021-10-30T16:55:47.000Z | 2021-12-04T18:51:50.000Z | src/preprocessing/spatial.py | kjhall01/xcast | 17edfd8c79c5163b004800170bbcf21302e8c792 | [
"MIT"
] | 1 | 2021-11-18T10:35:29.000Z | 2021-11-18T10:35:29.000Z | import cv2
import numpy as np
from scipy.interpolate import interp2d
from sklearn.decomposition import PCA, IncrementalPCA
import xarray as xr
import numpy as np
import uuid
from pathlib import Path
from ..core.utilities import *
from ..core.progressbar import *
from .missing_values import *
def regrid(X, lons, lats,... | 44.891089 | 244 | 0.725555 |
2d1a8a01bf8c89cb94293603d0564a0515d00022 | 2,511 | py | Python | docs-src/conf.py | rogueresistor/GLaDOS | 7246377a93e278cd5982d8a4c49b5381c2977f5f | [
"Apache-2.0"
] | null | null | null | docs-src/conf.py | rogueresistor/GLaDOS | 7246377a93e278cd5982d8a4c49b5381c2977f5f | [
"Apache-2.0"
] | null | null | null | docs-src/conf.py | rogueresistor/GLaDOS | 7246377a93e278cd5982d8a4c49b5381c2977f5f | [
"Apache-2.0"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 32.192308 | 79 | 0.692553 |
2d1a933def6d613b038e940d61bb307483fd6c4a | 9,028 | py | Python | imagestore/views.py | nerdfiles/jahjah_works | 5d7f26dc8001b5dcb0c20b85e6ed247c4c7a00da | [
"WTFPL"
] | null | null | null | imagestore/views.py | nerdfiles/jahjah_works | 5d7f26dc8001b5dcb0c20b85e6ed247c4c7a00da | [
"WTFPL"
] | null | null | null | imagestore/views.py | nerdfiles/jahjah_works | 5d7f26dc8001b5dcb0c20b85e6ed247c4c7a00da | [
"WTFPL"
] | null | null | null | from django.core.exceptions import PermissionDenied
from django.core.urlresolvers import reverse
from django.utils.decorators import method_decorator
from imagestore.models import Album, Image
from imagestore.models import image_applabel, image_classname
from imagestore.models import album_applabel, album_classname
fro... | 35.265625 | 96 | 0.686752 |
2d1aa2f3e87e7e3d66ad40037efa56582109a4f0 | 1,279 | py | Python | swimpy/resources/browser/models.py | mwort/swimpy | 2bfe83372f62d19072aee3be096549e7edf3cf3b | [
"MIT"
] | null | null | null | swimpy/resources/browser/models.py | mwort/swimpy | 2bfe83372f62d19072aee3be096549e7edf3cf3b | [
"MIT"
] | null | null | null | swimpy/resources/browser/models.py | mwort/swimpy | 2bfe83372f62d19072aee3be096549e7edf3cf3b | [
"MIT"
] | null | null | null | """
Your project-specific database tables (django calls them 'models').
The modelmanager.plugins.browser.models module already defines several
'abstract models' that can be used as extensible templates as has been done
below.
Here is an example:
```
from django.db import models
from modelmanager.plugins import browse... | 25.58 | 76 | 0.752932 |
2d1ab410bbdce7acf23247a2b3dc227c71682b11 | 15,952 | py | Python | lluv/lluv.py | jmp1617/L.L.U.V. | ee910346d56fb1e8d570775ddd1398b6f503ad3e | [
"MIT"
] | 1 | 2017-01-19T17:33:53.000Z | 2017-01-19T17:33:53.000Z | lluv/lluv.py | jmp1617/L.L.U.V. | ee910346d56fb1e8d570775ddd1398b6f503ad3e | [
"MIT"
] | null | null | null | lluv/lluv.py | jmp1617/L.L.U.V. | ee910346d56fb1e8d570775ddd1398b6f503ad3e | [
"MIT"
] | null | null | null | """
LLUV backend
author: Jacob Potter CSH:(jpotter)
"""
import subprocess
import configparser
import shlex
import math
import sys
import threading
import os
from time import sleep
import lluv.lluv_classes as lc
def check_config() -> bool:
"""
function to check for lluvrc in the users home dir
if its not ... | 33.512605 | 122 | 0.59328 |
2d1abdd8215b0550c832bc5f5cad7c1d07204045 | 2,000 | py | Python | options/infer_options.py | bolianchen/pytorch_depth_from_videos_in_the_wild | 6f013154ba9f3a8de944c788a9370980e4c2b7c8 | [
"MIT"
] | 5 | 2022-02-25T04:38:16.000Z | 2022-03-28T17:38:03.000Z | options/infer_options.py | bolianchen/pytorch_depth_from_videos_in_the_wild | 6f013154ba9f3a8de944c788a9370980e4c2b7c8 | [
"MIT"
] | 5 | 2022-02-25T07:26:39.000Z | 2022-03-02T06:04:32.000Z | options/infer_options.py | bolianchen/pytorch_depth_from_videos_in_the_wild | 6f013154ba9f3a8de944c788a9370980e4c2b7c8 | [
"MIT"
] | null | null | null | from __future__ import absolute_import, division, print_function
import os
import argparse
from datetime import datetime
project_dir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
class InferOptions:
"""Options to initialize models and image preprocessor
"""
def __init__(self):
sel... | 44.444444 | 89 | 0.503 |
2d1accb7e4347558c81f03b2dc72c018c7324b3a | 14,051 | py | Python | appengine/predator/analysis/linear/changelist_features/test/min_distance_test.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 2 | 2021-04-13T21:22:18.000Z | 2021-09-07T02:11:57.000Z | appengine/predator/analysis/linear/changelist_features/test/min_distance_test.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | 21 | 2020-09-06T02:41:05.000Z | 2022-03-02T04:40:01.000Z | appengine/predator/analysis/linear/changelist_features/test/min_distance_test.py | allaparthi/monorail | e18645fc1b952a5a6ff5f06e0c740d75f1904473 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import mock
from analysis.analysis_testcase import AnalysisTestCase
from analysis.crash_match import CrashMatch
from analysis.crash_match import FrameInfo
f... | 43.367284 | 80 | 0.642588 |
2d1ace2c62b23d7e7f0808c3104e2193c9b6b290 | 4,693 | py | Python | pkg_3/emergency.py | giuseppemas/3gruppo_4_TDP | d85c5e232cbaa0a9a3512fdce906ea9fab7b1334 | [
"MIT"
] | null | null | null | pkg_3/emergency.py | giuseppemas/3gruppo_4_TDP | d85c5e232cbaa0a9a3512fdce906ea9fab7b1334 | [
"MIT"
] | null | null | null | pkg_3/emergency.py | giuseppemas/3gruppo_4_TDP | d85c5e232cbaa0a9a3512fdce906ea9fab7b1334 | [
"MIT"
] | null | null | null | from TdP_collections.graphs.graph import Graph
from TdP_collections.graphs.shortest_paths import *
import random as rand
"""Il servizio di volanti della polizia prevede che una serie di pattuglie siano continuamente
in giro sul territorio per poter intervenire in casi di emergenza. Quando giunge una
richiesta di inte... | 38.467213 | 136 | 0.653313 |
2d1af09ad321d5979c11b7335daa971474adc4fe | 2,399 | py | Python | misc/rewards_CSR.py | WuJie1010/Fine-Grained-Image-Captioning | 340bc1868634f3bf0fdd62d439fec32ee1b45407 | [
"MIT"
] | 9 | 2019-10-31T05:39:39.000Z | 2021-08-18T02:30:17.000Z | misc/rewards_CSR.py | WuJie1010/Concrete-Image-Captioning.Pytorch | 340bc1868634f3bf0fdd62d439fec32ee1b45407 | [
"MIT"
] | null | null | null | misc/rewards_CSR.py | WuJie1010/Concrete-Image-Captioning.Pytorch | 340bc1868634f3bf0fdd62d439fec32ee1b45407 | [
"MIT"
] | 5 | 2018-10-08T07:55:01.000Z | 2019-09-09T12:32:52.000Z | """
Local Discriminative Reward
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import time
import misc.utils as utils
from collections import OrderedDict
import torch
from torch.autograd import Variable
import sys
sys.path.append("c... | 31.986667 | 91 | 0.682784 |
2d1af7d0dfb19a34aac1e5a21a726fb65eee0a26 | 3,985 | py | Python | alipay/aop/api/request/ZhimaCreditEpCertificationApplyRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/request/ZhimaCreditEpCertificationApplyRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/request/ZhimaCreditEpCertificationApplyRequest.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/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.ZhimaCreditEpCertificationApplyModel import ZhimaCreditEpCertificationApplyModel
class ZhimaCreditEpCertificationApplyRequest(object... | 27.482759 | 148 | 0.645922 |
2d1b188ce617ac793bd9dc2b0ef97c028805f228 | 5,665 | py | Python | models/ModelEvaluator.py | Easonyesheng/StereoCameraToolk | 660e43019d0687e96e6da3aca48c1c423ae5abff | [
"MIT"
] | 27 | 2020-10-16T07:21:35.000Z | 2022-03-11T02:56:13.000Z | models/ModelEvaluator.py | Easonyesheng/StereoCamera | 9319b7f4e5ce36833de722a15e1074e82b8b4f84 | [
"MIT"
] | null | null | null | models/ModelEvaluator.py | Easonyesheng/StereoCamera | 9319b7f4e5ce36833de722a15e1074e82b8b4f84 | [
"MIT"
] | 6 | 2021-02-01T09:54:40.000Z | 2022-03-11T03:16:39.000Z | """The class of evaluation """
# function comment template
"""name
description
Args:
Returns:
"""
# class comment template
"""The class of
description
Attributes:
"""
import cv2
import numpy as np
import sys
from tqdm import tqdm
from ModelUtil.util import *
from ModelSet.setti... | 32.557471 | 144 | 0.537158 |
2d1b1aa2fc54f238d18f793efef9c8715a9f23dd | 147 | py | Python | xcessiv/tests/extractmaindataset.py | KhaledTo/xcessiv | a48dff7d370c84eb5c243bde87164c1f5fd096d5 | [
"Apache-2.0"
] | 1,362 | 2017-05-23T15:02:18.000Z | 2022-03-28T22:42:21.000Z | xcessiv/tests/extractmaindataset.py | KhaledTo/xcessiv | a48dff7d370c84eb5c243bde87164c1f5fd096d5 | [
"Apache-2.0"
] | 40 | 2017-05-23T17:59:05.000Z | 2019-07-03T13:08:14.000Z | xcessiv/tests/extractmaindataset.py | KhaledTo/xcessiv | a48dff7d370c84eb5c243bde87164c1f5fd096d5 | [
"Apache-2.0"
] | 123 | 2017-05-24T05:49:34.000Z | 2022-02-06T17:54:32.000Z | from sklearn.datasets import load_digits
def extract_main_dataset():
X, y = load_digits(return_X_y=True)
return X, y
dummy_variable = 2
| 16.333333 | 40 | 0.741497 |
2d1b1ba3fd7e9b006fd9a676026de61b755cac8d | 1,590 | py | Python | phase1a/case1a/case1a_analysis.py | pep8speaks/fhr-benchmark-1 | 531d518844de20ca70bd90522c573ead7aa459ce | [
"BSD-3-Clause"
] | 1 | 2020-11-24T09:56:12.000Z | 2020-11-24T09:56:12.000Z | phase1a/case1a/case1a_analysis.py | pep8speaks/fhr-benchmark-1 | 531d518844de20ca70bd90522c573ead7aa459ce | [
"BSD-3-Clause"
] | null | null | null | phase1a/case1a/case1a_analysis.py | pep8speaks/fhr-benchmark-1 | 531d518844de20ca70bd90522c573ead7aa459ce | [
"BSD-3-Clause"
] | null | null | null | """
PHASE 1A CASE 1A
This python script builds analyzes the tallies from openmc statepoint file
and uses functions in scripts/openmc_analysis.py to analyze and manipulate
the data into what is required for the FHR benchmark.
"""
###############################################################################
# ... | 28.909091 | 79 | 0.537736 |
2d1b1dc4e670a186d596168c69671b1a1f8a681c | 912 | py | Python | beep/conversion_schemas/__init__.py | BruisVanVlijmen2020/beep | f695e474db8b114ecf360f363ab6691b2a2d8e07 | [
"Apache-2.0"
] | 17 | 2020-06-23T17:39:29.000Z | 2022-02-20T07:39:34.000Z | beep/conversion_schemas/__init__.py | BruisVanVlijmen2020/beep | f695e474db8b114ecf360f363ab6691b2a2d8e07 | [
"Apache-2.0"
] | null | null | null | beep/conversion_schemas/__init__.py | BruisVanVlijmen2020/beep | f695e474db8b114ecf360f363ab6691b2a2d8e07 | [
"Apache-2.0"
] | 5 | 2020-07-24T13:12:06.000Z | 2022-03-07T05:53:29.000Z | # Copyright (c) 2019 Toyota Research Institute
import os
from beep import CONVERSION_SCHEMA_DIR
from monty.serialization import loadfn
ARBIN_CONFIG = loadfn(os.path.join(CONVERSION_SCHEMA_DIR, "arbin_conversion.yaml"))
MACCOR_CONFIG = loadfn(os.path.join(CONVERSION_SCHEMA_DIR, "maccor_conversion.yaml"))
FastCharge... | 48 | 103 | 0.830044 |
2d1b2159854db876431a16d12ec5ddd51960eeab | 631 | py | Python | regparser/web/jobs/migrations/0009_auto_20160824_2347.py | pkfec/regulations-parser | ff6b29dcce0449a133e7b93dd462ab3110f80a5d | [
"CC0-1.0"
] | 26 | 2016-06-04T20:48:09.000Z | 2021-07-28T18:13:30.000Z | regparser/web/jobs/migrations/0009_auto_20160824_2347.py | pkfec/regulations-parser | ff6b29dcce0449a133e7b93dd462ab3110f80a5d | [
"CC0-1.0"
] | 146 | 2016-04-06T19:07:54.000Z | 2022-01-02T20:09:53.000Z | regparser/web/jobs/migrations/0009_auto_20160824_2347.py | pkfec/regulations-parser | ff6b29dcce0449a133e7b93dd462ab3110f80a5d | [
"CC0-1.0"
] | 28 | 2016-04-09T20:40:48.000Z | 2021-05-08T17:52:59.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.7 on 2016-08-24 23:47
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('jobs', '0008_proposalpipelinejob'),
]
operations = [
migrations.AlterField(
... | 24.269231 | 51 | 0.606973 |
2d1b3eaa4ea7513bb9fb4c966378333d40692aa5 | 8,524 | py | Python | txdav/common/datastore/podding/request.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | 1 | 2017-02-18T19:22:19.000Z | 2017-02-18T19:22:19.000Z | txdav/common/datastore/podding/request.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | null | null | null | txdav/common/datastore/podding/request.py | eventable/CalendarServer | 384444edb1966b530bc391789afbe3fb9cd6fd3e | [
"Apache-2.0"
] | null | null | null | ##
# Copyright (c) 2013-2015 Apple Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 39.646512 | 109 | 0.621774 |
2d1b4d9b5cde8b22f6f399f57f4fab7a321ce679 | 7,242 | py | Python | tests/core/pony/test_webdev.py | HubBucket-Team/tibanna | ef90a0217243071791d50e35fbdfe67ceef5a219 | [
"MIT"
] | 1 | 2019-05-01T03:44:01.000Z | 2019-05-01T03:44:01.000Z | tests/core/pony/test_webdev.py | VonRosenchild/tibanna | ef90a0217243071791d50e35fbdfe67ceef5a219 | [
"MIT"
] | null | null | null | tests/core/pony/test_webdev.py | VonRosenchild/tibanna | ef90a0217243071791d50e35fbdfe67ceef5a219 | [
"MIT"
] | 1 | 2019-05-01T03:44:02.000Z | 2019-05-01T03:44:02.000Z | from dcicutils.ff_utils import (
get_authentication_with_server,
get_metadata,
patch_metadata
)
from core.utils import run_workflow
from core.pony_utils import get_wfr_uuid, post_random_file
import time
def testrun_md5(env='webdev'):
"""Creates a random file object with no md5sum/content_md5sum and ru... | 37.329897 | 90 | 0.6066 |
2d1b511fb87b2809ecb083af9c9b10e758497d82 | 515 | py | Python | client/verta/verta/_swagger/_public/modeldb/model/ModeldbDeleteDatasetVersion.py | CaptEmulation/modeldb | 78b10aca553e386554f9740db63466b1cf013a1a | [
"Apache-2.0"
] | 835 | 2017-02-08T20:14:24.000Z | 2020-03-12T17:37:49.000Z | client/verta/verta/_swagger/_public/modeldb/model/ModeldbDeleteDatasetVersion.py | CaptEmulation/modeldb | 78b10aca553e386554f9740db63466b1cf013a1a | [
"Apache-2.0"
] | 651 | 2019-04-18T12:55:07.000Z | 2022-03-31T23:45:09.000Z | client/verta/verta/_swagger/_public/modeldb/model/ModeldbDeleteDatasetVersion.py | CaptEmulation/modeldb | 78b10aca553e386554f9740db63466b1cf013a1a | [
"Apache-2.0"
] | 170 | 2017-02-13T14:49:22.000Z | 2020-02-19T17:59:12.000Z | # THIS FILE IS AUTO-GENERATED. DO NOT EDIT
from verta._swagger.base_type import BaseType
class ModeldbDeleteDatasetVersion(BaseType):
def __init__(self, id=None):
required = {
"id": False,
}
self.id = id
for k, v in required.items():
if self[k] is None and v:
raise ValueError('at... | 21.458333 | 62 | 0.63301 |
2d1b5c992c0488a6292ba9d2a968bfcb7f6af9aa | 10,428 | py | Python | pay-api/config.py | mengdong19/sbc-pay | a5a1d81ae3500457178371fb004fd09194bbb6b7 | [
"Apache-2.0"
] | null | null | null | pay-api/config.py | mengdong19/sbc-pay | a5a1d81ae3500457178371fb004fd09194bbb6b7 | [
"Apache-2.0"
] | null | null | null | pay-api/config.py | mengdong19/sbc-pay | a5a1d81ae3500457178371fb004fd09194bbb6b7 | [
"Apache-2.0"
] | null | null | null | # Copyright © 2019 Province of British Columbia
#
# 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... | 42.218623 | 327 | 0.732259 |
2d1b89389281eda2774c9224162cd8bb447c3896 | 734 | py | Python | src/modeci_mdf/interfaces/pytorch/mod_torch_builtins.py | singular-value/MDF | 227216ffb2c9beea8539829b0b891196787d33ee | [
"Apache-2.0"
] | null | null | null | src/modeci_mdf/interfaces/pytorch/mod_torch_builtins.py | singular-value/MDF | 227216ffb2c9beea8539829b0b891196787d33ee | [
"Apache-2.0"
] | null | null | null | src/modeci_mdf/interfaces/pytorch/mod_torch_builtins.py | singular-value/MDF | 227216ffb2c9beea8539829b0b891196787d33ee | [
"Apache-2.0"
] | null | null | null | """
Wrap commonly-used torch builtins in nn.Module subclass
for easier automatic construction of script
"""
import torch.nn
class argmax(torch.nn.Module):
def __init__(self):
super(argmax, self).__init__()
def forward(self, A):
return torch.argmax(A)
class matmul(torch.... | 25.310345 | 55 | 0.583106 |
2d1b9ed03641cef8d8559cc11dc1521da04a2c50 | 4,340 | py | Python | src/demo_character_reader/demo_features.py | fcr/Haifa_Tech_Meetup_Talk | d33a74dac894d2c5cd6aa49e1a60a7df284c0f8f | [
"MIT"
] | 3 | 2018-02-06T08:06:39.000Z | 2018-03-20T13:17:47.000Z | src/demo_character_reader/demo_features.py | fcr/python_meetup_htm_slides | ef261cd2ec0bb81ecdd829420ae273baff3892cf | [
"MIT"
] | null | null | null | src/demo_character_reader/demo_features.py | fcr/python_meetup_htm_slides | ef261cd2ec0bb81ecdd829420ae273baff3892cf | [
"MIT"
] | null | null | null | #! /usr/bin/env python
# ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2015, Numenta, Inc. Unless you have purchased from
# Numenta, Inc. a separate commercial license for this software code, the
# following terms and conditi... | 38.070175 | 82 | 0.724424 |
2d1bb2417ea87e08428f42d8d24e29cf2df7739d | 1,215 | py | Python | backend/config.py | bcbecker/Datta-Dashboard | 14f77ce166500996888ebdc0e8d3f977fe060547 | [
"FTL"
] | null | null | null | backend/config.py | bcbecker/Datta-Dashboard | 14f77ce166500996888ebdc0e8d3f977fe060547 | [
"FTL"
] | null | null | null | backend/config.py | bcbecker/Datta-Dashboard | 14f77ce166500996888ebdc0e8d3f977fe060547 | [
"FTL"
] | null | null | null | import os
from datetime import timedelta
class Config:
SECRET_KEY = os.environ.get('SECRET_KEY')
FLASK_APP = os.environ.get('FLASK_APP')
DEBUG = True
TESTING = False
SQLALCHEMY_DATABASE_URI = os.environ.get('SQLALCHEMY_DATABASE_URI')
SQLALCHEMY_TRACK_MODIFICATIONS = False
JWT_SECRET_KEY ... | 24.795918 | 71 | 0.688889 |
2d1bbdf52ab3e204fd5ff0a4b5392fc721e2c847 | 5,182 | py | Python | tests/grab_api.py | dimichxp/grab | 5fedee3009c18c8a1139b0f82736ebe473021b46 | [
"MIT"
] | 2,266 | 2015-01-01T08:47:33.000Z | 2022-03-21T05:02:55.000Z | tests/grab_api.py | dimichxp/grab | 5fedee3009c18c8a1139b0f82736ebe473021b46 | [
"MIT"
] | 221 | 2015-01-13T01:55:57.000Z | 2022-02-25T23:23:35.000Z | tests/grab_api.py | dimichxp/grab | 5fedee3009c18c8a1139b0f82736ebe473021b46 | [
"MIT"
] | 315 | 2015-01-23T06:38:55.000Z | 2022-03-27T08:33:33.000Z | # coding: utf-8
from copy import deepcopy
import six
from tests.util import build_grab, temp_file
from tests.util import BaseGrabTestCase
from tests.util import reset_request_counter
from grab import GrabMisuseError, GrabError
class GrabApiTestCase(BaseGrabTestCase):
def setUp(self):
self.server.reset()... | 32.3875 | 79 | 0.61347 |
2d1bedc92bd8cb57c5ff67e1b9818734622e7e3d | 995 | py | Python | sf6/lammpslib_simple.py | marshallmcdonnell/ase-scripts | 2de692304fed32b7132275b5a51c307b5797fc55 | [
"MIT"
] | null | null | null | sf6/lammpslib_simple.py | marshallmcdonnell/ase-scripts | 2de692304fed32b7132275b5a51c307b5797fc55 | [
"MIT"
] | null | null | null | sf6/lammpslib_simple.py | marshallmcdonnell/ase-scripts | 2de692304fed32b7132275b5a51c307b5797fc55 | [
"MIT"
] | null | null | null | """Get energy from a LAMMPS calculation"""
from __future__ import print_function
from ase import Atom
from ase.build import bulk
from ase.calculators.lammpslib import LAMMPSlib
from ase.visualize import view
from mpi4py import MPI
me = MPI.COMM_WORLD.Get_rank()
cmds = ["pair_style eam/alloy", "pair_coeff * * NiAlH_... | 25.512821 | 74 | 0.619095 |
2d1c188102b0afc08b09ae135b4f564a0eaf9526 | 1,947 | py | Python | src/export_devel.py | jakub-vesely/hugo | 604e7824c39f6da43ede9064001292917c1ee4ae | [
"MIT"
] | null | null | null | src/export_devel.py | jakub-vesely/hugo | 604e7824c39f6da43ede9064001292917c1ee4ae | [
"MIT"
] | null | null | null | src/export_devel.py | jakub-vesely/hugo | 604e7824c39f6da43ede9064001292917c1ee4ae | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2022 Jakub Vesely
# This software is published under MIT license. Full text of the license is available at https://opensource.org/licenses/MIT
import os
import shutil
class ExportDevel:
devel_prefix = "___"
devel_folder_path = "devel"
firmware_folder_path = "../micropyth... | 36.055556 | 125 | 0.708783 |
2d1c7423120cfe9c07c2db8abd4780c79b035dc2 | 3,432 | py | Python | wlmetrics/filter/kalman/kalman.py | hbldh/wlmetrics | 3c1580412783c758844a1089da478ed0479af02e | [
"MIT"
] | null | null | null | wlmetrics/filter/kalman/kalman.py | hbldh/wlmetrics | 3c1580412783c758844a1089da478ed0479af02e | [
"MIT"
] | null | null | null | wlmetrics/filter/kalman/kalman.py | hbldh/wlmetrics | 3c1580412783c758844a1089da478ed0479af02e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:mod:`kalman`
==================
.. module:: kalman
:platform: Unix, Windows
:synopsis:
.. moduleauthor:: hbldh <henrik.blidh@nedomkull.com>
Created on 2015-05-30, 16:24
"""
from __future__ import division
from __future__ import print_function
from __future__... | 31.486239 | 85 | 0.576632 |
2d1ca38beb11b1be02b1b051d1b94af2ba1513e3 | 870 | py | Python | wk_client/tests/test_auth.py | TuxedoFish/GFBHack-IWOCA | e3197c1f3c100f830e3d2b08b214f9b1a99260c0 | [
"MIT"
] | null | null | null | wk_client/tests/test_auth.py | TuxedoFish/GFBHack-IWOCA | e3197c1f3c100f830e3d2b08b214f9b1a99260c0 | [
"MIT"
] | null | null | null | wk_client/tests/test_auth.py | TuxedoFish/GFBHack-IWOCA | e3197c1f3c100f830e3d2b08b214f9b1a99260c0 | [
"MIT"
] | null | null | null | from wk_client.auth_utils import create_user, hash_pw
from wk_client.models import User
from wk_client.tests.conftest import AppTestCase
class TestAuth(AppTestCase):
def test_create_user_returns(self):
user = create_user('foo', 'bar', 'baz')
self.assertEqual(user.username, 'foo')
self.asse... | 34.8 | 69 | 0.678161 |
2d1ca7a5e9e82803fdf6dac2ce57ca3ef1e447d9 | 3,671 | py | Python | tools/test_PoseEstimation.py | chaowu2009/stereo-vo | 56ce2295c80935016d015f72ebc7f81c5ee8d898 | [
"MIT"
] | 4 | 2017-06-03T02:01:46.000Z | 2020-02-22T14:57:15.000Z | tools/test_PoseEstimation.py | chaowu2009/stereo-vo | 56ce2295c80935016d015f72ebc7f81c5ee8d898 | [
"MIT"
] | null | null | null | tools/test_PoseEstimation.py | chaowu2009/stereo-vo | 56ce2295c80935016d015f72ebc7f81c5ee8d898 | [
"MIT"
] | 1 | 2019-09-29T13:33:14.000Z | 2019-09-29T13:33:14.000Z | import numpy as np
import cv2
from loadYamlData import *
data = loadYamlData("cam_left_1.yml")
K = data["K"]
D = data["D"]
"""
data = loadYamlData("cam_stereo_1.yml")
K1 = data["K1"]
D1 = data["D1"]
K2 = data["K2"]
D2 = data["D2"]
R = data["R"]
T = data["T"]
E = data["E"]
"""
focal = 837.69
pp = (332.9648, 220.3798)
... | 26.992647 | 96 | 0.657586 |
2d1cb2a9384162362206491e9a63df0f2f6e20f7 | 350 | py | Python | tests/curve_dags/test_do_vacuum.py | kevin0120/airflow | fa263cbf0ac002bdb26239ce36d5dc2a1b6251fd | [
"Apache-2.0"
] | 1 | 2021-03-03T07:00:02.000Z | 2021-03-03T07:00:02.000Z | tests/curve_dags/test_do_vacuum.py | kevin0120/airflow | fa263cbf0ac002bdb26239ce36d5dc2a1b6251fd | [
"Apache-2.0"
] | 36 | 2021-11-26T00:08:49.000Z | 2021-11-26T00:09:33.000Z | tests/curve_dags/test_do_vacuum.py | kevin0120/airflow | fa263cbf0ac002bdb26239ce36d5dc2a1b6251fd | [
"Apache-2.0"
] | 3 | 2020-06-30T02:38:17.000Z | 2022-01-19T06:14:08.000Z | # -*- coding:utf-8 -*-
import requests
body = {
"replace_microseconds": 'false',
"conf": {
"delta_time": '1'
}
}
import json
if __name__ == '__main__':
data = json.dumps(body)
result = requests.post('http://localhost:8080/api/experimental/dags/data_retention_policy/dag_runs', data=data)
... | 19.444444 | 115 | 0.645714 |
2d1cdc8774d6962bfae507b4424c4b999e87bb8d | 935 | py | Python | google-cloud-sdk/lib/surface/resource_manager/operations/__init__.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2017-11-29T18:52:27.000Z | 2017-11-29T18:52:27.000Z | google-cloud-sdk/.install/.backup/lib/surface/resource_manager/operations/__init__.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/.install/.backup/lib/surface/resource_manager/operations/__init__.py | KaranToor/MA450 | c98b58aeb0994e011df960163541e9379ae7ea06 | [
"Apache-2.0"
] | 1 | 2020-07-25T12:09:01.000Z | 2020-07-25T12:09:01.000Z | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 35.961538 | 78 | 0.771123 |
2d1ce0903a6875c0f3449d22324774ba3cc4d483 | 10,954 | py | Python | datastorage/optionmetrics.py | khrapovs/datastorage | 264736343b6a461a07cdbcdf7ef7653add682f78 | [
"MIT"
] | null | null | null | datastorage/optionmetrics.py | khrapovs/datastorage | 264736343b6a461a07cdbcdf7ef7653add682f78 | [
"MIT"
] | null | null | null | datastorage/optionmetrics.py | khrapovs/datastorage | 264736343b6a461a07cdbcdf7ef7653add682f78 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Import OptionMetrics data.
"""
from __future__ import print_function, division
import os
import zipfile
import numpy as np
import pandas as pd
import datetime as dt
from scipy.interpolate import interp1d
from impvol import lfmoneyness, delta, vega
from datastorage.q... | 30.856338 | 78 | 0.605715 |
2d1cef220218d91205124d9b03b051d8510ceed2 | 528 | py | Python | chapter_two/test_suite.py | vyahello/unittest | af24c5c00032ab7265a0c00da5955a26d25dff33 | [
"MIT"
] | 1 | 2020-10-19T21:58:16.000Z | 2020-10-19T21:58:16.000Z | chapter_two/test_suite.py | vyahello/unittest | af24c5c00032ab7265a0c00da5955a26d25dff33 | [
"MIT"
] | null | null | null | chapter_two/test_suite.py | vyahello/unittest | af24c5c00032ab7265a0c00da5955a26d25dff33 | [
"MIT"
] | null | null | null | from unittest import TestSuite, TestLoader, TextTestRunner
from chapter_one.test_list import TestListMethods # use test_list.py module from `Basic test case example` section in `chapter_one` puzzle
def _test_suite() -> TestSuite:
test_suite: TestSuite = TestSuite()
tests :TestLoader = TestLoader().loadTestsF... | 35.2 | 139 | 0.774621 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.