hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
67d2df752b7aa39827c0d7ecf8e8fdf9654cbe97 | 4,789 | py | Python | acct_mgr/tests/functional/testenv.py | scanterog/acct_mgr-0.4.4 | efe1a248b0b2cb935daa6142a5488d3ed2d6fa66 | [
"Beerware"
] | 1 | 2017-06-17T13:02:52.000Z | 2017-06-17T13:02:52.000Z | acct_mgr/tests/functional/testenv.py | scanterog/acct_mgr-0.4.4 | efe1a248b0b2cb935daa6142a5488d3ed2d6fa66 | [
"Beerware"
] | null | null | null | acct_mgr/tests/functional/testenv.py | scanterog/acct_mgr-0.4.4 | efe1a248b0b2cb935daa6142a5488d3ed2d6fa66 | [
"Beerware"
] | 1 | 2018-11-02T01:09:58.000Z | 2018-11-02T01:09:58.000Z | # -*- coding: utf-8 -*-
#
# Copyright (C) 2008 Matthew Good <trac@matt-good.net>
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
#
# Author: Pedro Algarvio <ufs@ufsoft.org>
import os
import sys
import time
from subpr... | 38.312 | 82 | 0.60284 |
5b222a2e84a2d0716fa7560f7c90ccf3c93b3393 | 813 | py | Python | recsim/environments/__init__.py | MontrealAI/recsim | 9098a8fac9aad62a880011ee575a3db4e7d80ee2 | [
"Apache-2.0"
] | 625 | 2019-09-25T00:45:42.000Z | 2022-03-31T10:27:30.000Z | recsim/environments/__init__.py | MontrealAI/recsim | 9098a8fac9aad62a880011ee575a3db4e7d80ee2 | [
"Apache-2.0"
] | 22 | 2019-10-21T13:40:41.000Z | 2022-03-29T18:29:56.000Z | recsim/environments/__init__.py | isabella232/recsim | 55e50e4be736d222ffe8c2477ed1981b40f91605 | [
"Apache-2.0"
] | 108 | 2019-09-27T18:58:58.000Z | 2022-03-30T09:39:05.000Z | # coding=utf-8
# coding=utf-8
# Copyright 2019 The RecSim 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 ap... | 40.65 | 74 | 0.785978 |
45674c08b083cc85a2b92ad6e781178523911aa1 | 2,154 | py | Python | alg_kruskal_minimum_spanning_tree.py | bowen0701/python-algorithms-data-structures | e625f59a9fc59e4728825078d4434a7968a724e5 | [
"BSD-2-Clause"
] | 8 | 2019-03-18T06:37:24.000Z | 2022-01-30T07:50:58.000Z | alg_kruskal_minimum_spanning_tree.py | bowen0701/python-algorithms-data-structures | e625f59a9fc59e4728825078d4434a7968a724e5 | [
"BSD-2-Clause"
] | null | null | null | alg_kruskal_minimum_spanning_tree.py | bowen0701/python-algorithms-data-structures | e625f59a9fc59e4728825078d4434a7968a724e5 | [
"BSD-2-Clause"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
def sort_edges_by_weight(w_graph_d):
pass
def make_set(v, previous_d, rank_d):
previous_d[v] = v
rank_d[v] = 0
return previous_d, rank_d
def link(v, u, previous_d, rank_d):
"""Link method.
Changes t... | 22.206186 | 61 | 0.616527 |
a48b96f61501d3a0c0c9e59be24866333a84eb27 | 1,312 | py | Python | h2o-py/tests/testdir_algos/glrm/pyunit_cancar_glrm.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 6,098 | 2015-05-22T02:46:12.000Z | 2022-03-31T16:54:51.000Z | h2o-py/tests/testdir_algos/glrm/pyunit_cancar_glrm.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 2,517 | 2015-05-23T02:10:54.000Z | 2022-03-30T17:03:39.000Z | h2o-py/tests/testdir_algos/glrm/pyunit_cancar_glrm.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 2,199 | 2015-05-22T04:09:55.000Z | 2022-03-28T22:20:45.000Z | from __future__ import print_function
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
from h2o.estimators.glrm import H2OGeneralizedLowRankEstimator
def glrm_cancar():
print("Importing cancar.csv data...")
cancarH2O = h2o.upload_file(pyunit_utils.locate("smalldata/glrm_test/can... | 37.485714 | 167 | 0.617378 |
d5c82fb5f57e67368ef0fe0f560c4899614083f6 | 1,177 | py | Python | examples/remote_send.py | Perlence/EmbedPython.ahk | 17ecfbc41757e5ba5008dcd157d1528d7b57decd | [
"BSD-3-Clause"
] | 34 | 2020-10-29T10:09:56.000Z | 2022-03-25T02:04:20.000Z | examples/remote_send.py | Perlence/EmbedPython.ahk | 17ecfbc41757e5ba5008dcd157d1528d7b57decd | [
"BSD-3-Clause"
] | 9 | 2021-02-16T05:59:31.000Z | 2022-02-16T08:13:14.000Z | examples/remote_send.py | Perlence/EmbedPython.ahk | 17ecfbc41757e5ba5008dcd157d1528d7b57decd | [
"BSD-3-Clause"
] | 6 | 2021-02-15T14:40:00.000Z | 2022-01-02T17:07:53.000Z | """Receive keys over TCP and replay them.
Example::
$ ahkpy remote_send.py &
Listening on localhost 3033
$ printf "#r" | nc localhost 3033
"""
import argparse
import asyncio
import sys
import ahkpy as ahk
def main():
parser = argparse.ArgumentParser()
parser.add_argument("HOST", nargs="?", defaul... | 20.293103 | 71 | 0.656754 |
269daeec5ed95e40af7896d178ed7c2ae9c2d763 | 30,532 | py | Python | neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_tunnel.py | ilay09/neutron | b7f9803c88b17a6ebd40fd44d15d4336bea7b394 | [
"Apache-2.0"
] | null | null | null | neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_tunnel.py | ilay09/neutron | b7f9803c88b17a6ebd40fd44d15d4336bea7b394 | [
"Apache-2.0"
] | null | null | null | neutron/tests/unit/plugins/ml2/drivers/openvswitch/agent/test_ovs_tunnel.py | ilay09/neutron | b7f9803c88b17a6ebd40fd44d15d4336bea7b394 | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 VMware, 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 ... | 40.068241 | 79 | 0.602974 |
3776b9afb675f9988813c44f404acf4939b7d3c7 | 267 | py | Python | chapters/06_recurrent_neural_networks_and_natural_language_processing/04_arxiv/helpers/attribute_dictionary.py | Asurada2015/TF-_for_MI | 5fafdb78286b122036fa9aecf2a4be72ea4673e1 | [
"Apache-2.0"
] | 8 | 2018-01-09T05:29:01.000Z | 2019-03-03T13:40:51.000Z | chapters/06_recurrent_neural_networks_and_natural_language_processing/03_ocr/helpers/attribute_dictionary.py | Asurada2015/TF-_for_MI | 5fafdb78286b122036fa9aecf2a4be72ea4673e1 | [
"Apache-2.0"
] | null | null | null | chapters/06_recurrent_neural_networks_and_natural_language_processing/03_ocr/helpers/attribute_dictionary.py | Asurada2015/TF-_for_MI | 5fafdb78286b122036fa9aecf2a4be72ea4673e1 | [
"Apache-2.0"
] | 6 | 2017-10-25T02:17:59.000Z | 2018-11-08T01:58:32.000Z | class AttrDict(dict):
def __getattr__(self, key):
if key not in self:
raise AttributeError
return self[key]
def __setattr__(self, key, value):
if key not in self:
raise AttributeError
self[key] = value | 24.272727 | 38 | 0.580524 |
1a31cb5eeda4736094255147ec14dd4714968cbe | 258 | py | Python | codility.com/stack_and_queues/stack.py | Jagrmi-C/jagrmitest | 7c6cf61317972e5d7ddc4fdced0b4e5e6dd52e96 | [
"MIT"
] | null | null | null | codility.com/stack_and_queues/stack.py | Jagrmi-C/jagrmitest | 7c6cf61317972e5d7ddc4fdced0b4e5e6dd52e96 | [
"MIT"
] | null | null | null | codility.com/stack_and_queues/stack.py | Jagrmi-C/jagrmitest | 7c6cf61317972e5d7ddc4fdced0b4e5e6dd52e96 | [
"MIT"
] | null | null | null |
stack = [9, 2, 3, 1, 4]
size = 0
def push(x):
global size
stack[size] = x
size += 1
def pop():
global size
size -= 1
return stack[size]
push(5)
push(6)
push(1)
print(stack)
print(pop())
print(stack)
print(pop())
print(stack)
| 9.214286 | 23 | 0.562016 |
17f5f313a8cc3ae0c0addd94fcdcc97f6554f8f4 | 1,116 | py | Python | src/fairtest/examples/error_profiling.py | columbia/fairtest | 8696051c9276f127ab8b2f437850f845ff0ca786 | [
"Apache-2.0"
] | 42 | 2017-01-12T13:59:23.000Z | 2022-03-01T01:44:12.000Z | src/fairtest/examples/error_profiling.py | columbia/fairtest | 8696051c9276f127ab8b2f437850f845ff0ca786 | [
"Apache-2.0"
] | 3 | 2019-05-24T21:02:51.000Z | 2019-11-15T15:36:17.000Z | src/fairtest/examples/error_profiling.py | columbia/fairtest | 8696051c9276f127ab8b2f437850f845ff0ca786 | [
"Apache-2.0"
] | 20 | 2017-01-12T23:07:10.000Z | 2021-08-11T09:13:50.000Z | """
Run FairTest Error Profiling Investigations on Movie Recommender Dataset
Usage: python error_profiling.py
"""
import fairtest.utils.prepare_data as prepare
from fairtest import Testing, train, test, report, DataSource
import sys
def main(argv=sys.argv):
if len(argv) != 1:
usage(argv)
FILENAME ... | 23.744681 | 72 | 0.590502 |
e2e86b5b7d4c1e3d9155672271eb53a9cecb9176 | 21,917 | py | Python | argostranslate/translate.py | argosopentechnologies/Argos-Translate | c834ef224418a830abe8ca4ed4e942f4ea07cbca | [
"MIT"
] | 1 | 2020-04-30T13:12:47.000Z | 2020-04-30T13:12:47.000Z | argostranslate/translate.py | argosopentechnologies/Argos-Translate | c834ef224418a830abe8ca4ed4e942f4ea07cbca | [
"MIT"
] | null | null | null | argostranslate/translate.py | argosopentechnologies/Argos-Translate | c834ef224418a830abe8ca4ed4e942f4ea07cbca | [
"MIT"
] | null | null | null | import logging
import ctranslate2
import sentencepiece as spm
import stanza
from argostranslate import package, settings, models, sbd, apis, fewshot
from argostranslate.utils import info, error
class Hypothesis:
"""Represents a translation hypothesis
Attributes:
value (str): The hypothetical transl... | 35.929508 | 104 | 0.635306 |
f01a43283c521c92123cc32d4cf9a2539384f1e0 | 2,812 | py | Python | src/spifi/skeleton.py | carolinearndt/spifi | f4e36ad1c4661872a46dd21fd22715fcb9fb305d | [
"MIT"
] | null | null | null | src/spifi/skeleton.py | carolinearndt/spifi | f4e36ad1c4661872a46dd21fd22715fcb9fb305d | [
"MIT"
] | null | null | null | src/spifi/skeleton.py | carolinearndt/spifi | f4e36ad1c4661872a46dd21fd22715fcb9fb305d | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This is a skeleton file that can serve as a starting point for a Python
console script. To run this script uncomment the following lines in the
[options.entry_points] section in setup.cfg:
console_scripts =
fibonacci = spifi.skeleton:run
Then run `python ... | 24.034188 | 77 | 0.634424 |
ee98623e0e624b19ba4936bb08af98ebe4adc079 | 604 | py | Python | tests/beta_tests/test_how_many_times_does_it_contain.py | the-zebulan/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | 40 | 2016-03-09T12:26:20.000Z | 2022-03-23T08:44:51.000Z | tests/beta_tests/test_how_many_times_does_it_contain.py | akalynych/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | null | null | null | tests/beta_tests/test_how_many_times_does_it_contain.py | akalynych/CodeWars | 1eafd1247d60955a5dfb63e4882e8ce86019f43a | [
"MIT"
] | 36 | 2016-11-07T19:59:58.000Z | 2022-03-31T11:18:27.000Z | import unittest
from katas.beta.how_many_times_does_it_contain import string_counter
class StringCounterTestCase(unittest.TestCase):
def test_equal_1(self):
self.assertEqual(string_counter('Hello world', 'o'), 2)
def test_equal_2(self):
self.assertEqual(string_counter(
"Wait isn'... | 30.2 | 77 | 0.678808 |
59267cb880bb8c0b26f340c7c40832c8bd6045bf | 1,406 | py | Python | clients/kratos/python/test/test_submit_self_service_settings_flow_with_profile_method_body.py | russelg/sdk | 2515b35981784319bd7d58fcf0b5ab85b501b62f | [
"Apache-2.0"
] | 77 | 2020-02-14T17:27:36.000Z | 2022-03-25T08:44:52.000Z | clients/kratos/python/test/test_submit_self_service_settings_flow_with_profile_method_body.py | russelg/sdk | 2515b35981784319bd7d58fcf0b5ab85b501b62f | [
"Apache-2.0"
] | 125 | 2020-02-07T21:45:52.000Z | 2022-03-31T12:54:24.000Z | clients/kratos/python/test/test_submit_self_service_settings_flow_with_profile_method_body.py | russelg/sdk | 2515b35981784319bd7d58fcf0b5ab85b501b62f | [
"Apache-2.0"
] | 44 | 2020-01-31T22:05:47.000Z | 2022-03-09T14:41:22.000Z | """
Ory Kratos API
Documentation for all public and administrative Ory Kratos APIs. Public and administrative APIs are exposed on different ports. Public APIs can face the public internet without any protection while administrative APIs should never be exposed without prior authorization. To protect the admini... | 38 | 446 | 0.783784 |
1ac9445618f54d86864a2fcd151419766c8802b2 | 22 | py | Python | psfsubtraction/prepare/__init__.py | hamogu/psfsubtraction | 719f3f4da86abf1c4ba48b1b98d57d191f73188f | [
"MIT"
] | 2 | 2017-04-04T18:50:31.000Z | 2019-01-23T00:41:39.000Z | psfsubtraction/prepare/__init__.py | hamogu/psfsubtraction | 719f3f4da86abf1c4ba48b1b98d57d191f73188f | [
"MIT"
] | 8 | 2016-06-19T23:40:25.000Z | 2019-01-11T15:56:39.000Z | psfsubtraction/prepare/__init__.py | hamogu/psfsubtraction | 719f3f4da86abf1c4ba48b1b98d57d191f73188f | [
"MIT"
] | 3 | 2016-06-19T23:34:00.000Z | 2016-07-08T17:43:13.000Z | from .center import *
| 11 | 21 | 0.727273 |
6230a70610b27414aeac8500a10345c97265a053 | 624 | py | Python | release/src/router/wget/testenv/conf/hook_sample.py | zhoutao0712/rtn11pb1 | 09e6b6c7ef4b91be0a9374daeacc3ac9f2fa3a05 | [
"Apache-2.0"
] | null | null | null | release/src/router/wget/testenv/conf/hook_sample.py | zhoutao0712/rtn11pb1 | 09e6b6c7ef4b91be0a9374daeacc3ac9f2fa3a05 | [
"Apache-2.0"
] | null | null | null | release/src/router/wget/testenv/conf/hook_sample.py | zhoutao0712/rtn11pb1 | 09e6b6c7ef4b91be0a9374daeacc3ac9f2fa3a05 | [
"Apache-2.0"
] | null | null | null | from exc.test_failed import TestFailed
from conf import hook
""" Hook: SampleHook
This a sample file for how a new hook should be defined.
Any errors should always be reported by raising a TestFailed exception instead
of returning a true or false value.
"""
@hook(alias='SampleHookAlias')
class SampleHook:
def __... | 27.130435 | 78 | 0.697115 |
249231239cfdbe7d146e7727b2c94443cca8d35c | 74,369 | py | Python | tests/test_arrow_dataset.py | jbragg/datasets | 8992869fecea434764f5639d1b0ef7660aeb04cd | [
"Apache-2.0"
] | null | null | null | tests/test_arrow_dataset.py | jbragg/datasets | 8992869fecea434764f5639d1b0ef7660aeb04cd | [
"Apache-2.0"
] | null | null | null | tests/test_arrow_dataset.py | jbragg/datasets | 8992869fecea434764f5639d1b0ef7660aeb04cd | [
"Apache-2.0"
] | null | null | null | import os
import pickle
import tempfile
from functools import partial
from unittest import TestCase
import numpy as np
import pandas as pd
import pyarrow as pa
from absl.testing import parameterized
import datasets.arrow_dataset
from datasets import concatenate_datasets, load_from_disk, temp_seed
from datasets.arrow_... | 49.979167 | 118 | 0.607753 |
2f58cc83cf2c05e08fc62da37866aebc40ef8860 | 2,894 | py | Python | monk/pip_unit_tests/keras/test_initializer_he_uniform.py | take2rohit/monk_v1 | 9c567bf2c8b571021b120d879ba9edf7751b9f92 | [
"Apache-2.0"
] | 542 | 2019-11-10T12:09:31.000Z | 2022-03-28T11:39:07.000Z | monk/pip_unit_tests/keras/test_initializer_he_uniform.py | take2rohit/monk_v1 | 9c567bf2c8b571021b120d879ba9edf7751b9f92 | [
"Apache-2.0"
] | 117 | 2019-11-12T09:39:24.000Z | 2022-03-12T00:20:41.000Z | monk/pip_unit_tests/keras/test_initializer_he_uniform.py | take2rohit/monk_v1 | 9c567bf2c8b571021b120d879ba9edf7751b9f92 | [
"Apache-2.0"
] | 246 | 2019-11-09T21:53:24.000Z | 2022-03-29T00:57:07.000Z | import os
import sys
import psutil
from monk.keras_prototype import prototype
from monk.compare_prototype import compare
from monk.pip_unit_tests.keras.common import print_start
from monk.pip_unit_tests.keras.common import print_status
import tensorflow as tf
if(tf.__version__[0] == '2'):
import tensorflow.compa... | 34.452381 | 99 | 0.636144 |
d5be12b63e44413ab4d31ff16823026c22b9c953 | 4,445 | py | Python | app.py | newlancealot/BellyButtons | d465f50e30c18ff6d7c2da6444561469599e06de | [
"ADSL"
] | null | null | null | app.py | newlancealot/BellyButtons | d465f50e30c18ff6d7c2da6444561469599e06de | [
"ADSL"
] | null | null | null | app.py | newlancealot/BellyButtons | d465f50e30c18ff6d7c2da6444561469599e06de | [
"ADSL"
] | null | null | null | #################################################
# import dependencies
#################################################
import datetime as dt
import numpy as np
import pandas as pd
import sqlalchemy
from sqlalchemy.ext.automap import automap_base
from sqlalchemy.orm import Session
from sqlalchemy import create_eng... | 29.437086 | 88 | 0.622497 |
7259a07b6c7e9324030759af310508fd5480db8f | 5,301 | py | Python | run_usd.py | ousttrue/usd_cpp_samples | b35af2d26c0708d8977ce1ba2bb85a1a90bf7dcb | [
"MIT"
] | 5 | 2020-10-06T05:18:53.000Z | 2022-03-15T02:18:02.000Z | run_usd.py | ousttrue/usd_cpp_samples | b35af2d26c0708d8977ce1ba2bb85a1a90bf7dcb | [
"MIT"
] | null | null | null | run_usd.py | ousttrue/usd_cpp_samples | b35af2d26c0708d8977ce1ba2bb85a1a90bf7dcb | [
"MIT"
] | null | null | null | import pathlib
import os
import sys
import types
import importlib
from typing import Iterable, Dict, Optional, List
import logging
import pathlib
import ctypes
#
import glglue.glfw
from glglue.gl3.pydearcontroller import PydearController
from glglue.gl3.renderview import RenderView
from glglue.windowconfig... | 33.13125 | 104 | 0.632334 |
54b0bf8f0c23b3831fab3791c972fc5f44f16f62 | 1,628 | py | Python | setup.py | pjaos/rpi_stepper_motor | 173e51c45d55b0c9125b1936a4709746973dafac | [
"MIT"
] | null | null | null | setup.py | pjaos/rpi_stepper_motor | 173e51c45d55b0c9125b1936a4709746973dafac | [
"MIT"
] | null | null | null | setup.py | pjaos/rpi_stepper_motor | 173e51c45d55b0c9125b1936a4709746973dafac | [
"MIT"
] | null | null | null | import setuptools
MODULE_NAME = "smotor" # The python module name
VERSION = "1.0" # The version of the application
AUTHOR = "Paul Austen" # T... | 49.333333 | 154 | 0.530713 |
ba7021aff648f249b8b11ea136867b122be6a0ef | 51 | py | Python | fixtures/W0702/valid.py | dopustim/pylint-config | 24e62f1d478e2d151c6aec64e732142e844569d0 | [
"0BSD"
] | 1 | 2022-01-07T18:01:11.000Z | 2022-01-07T18:01:11.000Z | fixtures/W0702/valid.py | dopustim/pylint-config | 24e62f1d478e2d151c6aec64e732142e844569d0 | [
"0BSD"
] | null | null | null | fixtures/W0702/valid.py | dopustim/pylint-config | 24e62f1d478e2d151c6aec64e732142e844569d0 | [
"0BSD"
] | null | null | null |
try:
1 / 0
except ZeroDivisionError:
pass
| 8.5 | 25 | 0.627451 |
f8b2f06c5688075a78cbb23f5c99b4b00a9573ff | 270 | py | Python | curso-python/estruturas_controle_projetos/fibonacci_v5.py | gui-hub/Estudos-Python | 0219da2430526c4c3705248e86e65b8c847175b8 | [
"Apache-2.0"
] | null | null | null | curso-python/estruturas_controle_projetos/fibonacci_v5.py | gui-hub/Estudos-Python | 0219da2430526c4c3705248e86e65b8c847175b8 | [
"Apache-2.0"
] | null | null | null | curso-python/estruturas_controle_projetos/fibonacci_v5.py | gui-hub/Estudos-Python | 0219da2430526c4c3705248e86e65b8c847175b8 | [
"Apache-2.0"
] | null | null | null | # 0, 1, 1, 2, 3, 5, 8, 13, 21...
def fibonacci(limite):
resultado = [0, 1]
while resultado[-1] < limite:
resultado.append(sum(resultado[-2:]))
return resultado
if __name__ == '__main__':
for fib in fibonacci(10000):
print(fib, end=',')
| 22.5 | 45 | 0.574074 |
917a806cdbd036c29c31a35e8312cf7acb9660cf | 2,862 | py | Python | lib/train_pg.py | samsafadi/PointRCNN | 761d4cadb3e634dc0994f2e95318240c37fbb485 | [
"MIT"
] | 1 | 2020-11-16T20:11:26.000Z | 2020-11-16T20:11:26.000Z | lib/train_pg.py | samsafadi/PointRCNN | 761d4cadb3e634dc0994f2e95318240c37fbb485 | [
"MIT"
] | null | null | null | lib/train_pg.py | samsafadi/PointRCNN | 761d4cadb3e634dc0994f2e95318240c37fbb485 | [
"MIT"
] | null | null | null | import _init_path
import torch
import tqdm
import json
import sys
import os
sys.path.append('../')
import argparse
from lib.env import PointRCNNEnv
from lib.pg_agent import PG
HOME_DIR = os.path.join(os.getcwd(), '..')
def train(agent, env, config, device):
"""
train pg model
"""
# For logging
b... | 28.336634 | 114 | 0.604123 |
12a0f71f5d438e0d5303f11712c61b919f58567d | 67,236 | py | Python | Lib/test/test_zipfile.py | deadsnakes/python3.3 | 4faaf44cd5478410ac3b977351c1965fa054b5e9 | [
"PSF-2.0"
] | 652 | 2015-07-26T00:00:17.000Z | 2022-02-24T18:30:04.000Z | Lib/test/test_zipfile.py | deadsnakes/python3.3 | 4faaf44cd5478410ac3b977351c1965fa054b5e9 | [
"PSF-2.0"
] | 8 | 2015-09-07T03:38:19.000Z | 2021-05-23T03:18:51.000Z | check-python33-manual/samples/standard_library_337/Lib/test/test_zipfile.py | DaveKaretnyk/parsing-utils2 | 40085bbd399fa605f2f2a4708d385a64ffc907de | [
"MIT"
] | 40 | 2015-07-24T19:45:08.000Z | 2021-11-01T14:54:56.000Z | import io
import os
import sys
import imp
import time
import shutil
import struct
import zipfile
import unittest
from tempfile import TemporaryFile
from random import randint, random, getrandbits
from test.support import (TESTFN, findfile, unlink,
requires_zlib, requires_bz2, requires_lzma,... | 39.36534 | 84 | 0.59016 |
a837c3aca2060a2d91a4a4b5fc84cb69ecf44c08 | 7,299 | py | Python | saleor/checkout/models.py | saurabh1e/saleor | adf8f17cb7629f177af9f941dd3090376d986f13 | [
"BSD-3-Clause"
] | 1 | 2022-02-28T02:24:34.000Z | 2022-02-28T02:24:34.000Z | saleor/checkout/models.py | saurabh1e/saleor | adf8f17cb7629f177af9f941dd3090376d986f13 | [
"BSD-3-Clause"
] | null | null | null | saleor/checkout/models.py | saurabh1e/saleor | adf8f17cb7629f177af9f941dd3090376d986f13 | [
"BSD-3-Clause"
] | null | null | null | """Checkout-related ORM models."""
from decimal import Decimal
from operator import attrgetter
from uuid import uuid4
from django.conf import settings
from django.contrib.postgres.fields import JSONField
from django.core.validators import MinValueValidator
from django.db import models
from django.utils.encoding import... | 33.948837 | 109 | 0.688176 |
4ddcdf92c59ee3155948b54e565cfa77ecf05b85 | 4,047 | py | Python | backend/src/models/Inventory.py | ahmedsalahacc/Inventory-Management-System | 192160548bc538a334f7a35041c77013d759e473 | [
"MIT"
] | null | null | null | backend/src/models/Inventory.py | ahmedsalahacc/Inventory-Management-System | 192160548bc538a334f7a35041c77013d759e473 | [
"MIT"
] | null | null | null | backend/src/models/Inventory.py | ahmedsalahacc/Inventory-Management-System | 192160548bc538a334f7a35041c77013d759e473 | [
"MIT"
] | null | null | null | from models import BaseModel, gen_id
class InventoryModel(BaseModel):
'''
ORM for Inventory table with the following structure
inventory(
id CHARACTER(10) NOT NULL PRIMARY KEY,
name TEXT NOT NULL,
desc TEXT NULL,
warehouse_id CHARACTER(10) NULL,
)
'''
def __ini... | 22.994318 | 58 | 0.522856 |
a87ebd4a14c927451fd7a199531afdcc23370c25 | 1,150 | py | Python | test/rpc/test_run_sql.py | jankytara2/dbt | 3f4069ab6d4d5b3fc34f8fe785761b5617357b0f | [
"Apache-2.0"
] | 1 | 2020-11-18T21:25:53.000Z | 2020-11-18T21:25:53.000Z | test/rpc/test_run_sql.py | jankytara2/dbt | 3f4069ab6d4d5b3fc34f8fe785761b5617357b0f | [
"Apache-2.0"
] | 50 | 2021-11-02T06:20:50.000Z | 2022-03-31T06:23:16.000Z | test/rpc/test_run_sql.py | jankytara2/dbt | 3f4069ab6d4d5b3fc34f8fe785761b5617357b0f | [
"Apache-2.0"
] | 1 | 2021-02-01T17:54:24.000Z | 2021-02-01T17:54:24.000Z | import pytest
from .util import (
get_querier,
ProjectDefinition,
)
@pytest.mark.supported('any')
def test_rpc_run_sql_nohang(
project_root, profiles_root, dbt_profile, unique_schema
):
project = ProjectDefinition(
models={'my_model.sql': 'select 1 as id'}
)
querier_ctx = get_querier(... | 26.136364 | 72 | 0.681739 |
53f5e7b4ee8d2145966b14c0eddc6b62bf6546c1 | 495 | py | Python | 0433 Minimum Distance of Two Words in a Sentence.py | ansabgillani/binarysearchcomproblems | 12fe8632f8cbb5058c91a55bae53afa813a3247e | [
"MIT"
] | 1 | 2020-12-29T21:17:26.000Z | 2020-12-29T21:17:26.000Z | 0433 Minimum Distance of Two Words in a Sentence.py | ansabgillani/binarysearchcomproblems | 12fe8632f8cbb5058c91a55bae53afa813a3247e | [
"MIT"
] | null | null | null | 0433 Minimum Distance of Two Words in a Sentence.py | ansabgillani/binarysearchcomproblems | 12fe8632f8cbb5058c91a55bae53afa813a3247e | [
"MIT"
] | 4 | 2021-09-09T17:42:43.000Z | 2022-03-18T04:54:03.000Z | class Solution:
def solve(self, text, word0, word1):
words = text.split()
if word0 not in words or word1 not in words: return -1
last0, last1 = -inf,-inf
ans = inf
for i in range(len(words)):
word = words[i]
if word == word0:
... | 24.75 | 62 | 0.444444 |
be9a84fe5e8c7ce1fe44cb757265bae1f88ab899 | 2,237 | py | Python | mod_archive.py | nugycal/SomethingAwesome | cadfef61545df48b08061d5a4d3236c436a44feb | [
"MIT"
] | 1 | 2020-04-13T05:30:20.000Z | 2020-04-13T05:30:20.000Z | mod_archive.py | nugycal/SomethingAwesome | cadfef61545df48b08061d5a4d3236c436a44feb | [
"MIT"
] | 2 | 2021-06-08T21:17:26.000Z | 2022-01-13T02:33:04.000Z | mod_archive.py | nugycal/SomethingAwesome | cadfef61545df48b08061d5a4d3236c436a44feb | [
"MIT"
] | null | null | null | from Module import Module
from zipfile import ZipFile
import tempfile
from os import access, R_OK
modules = []
def zip_files(files):
temp, filename = tempfile.mkstemp()
filename += ".zip"
zip = ZipFile(filename, "w")
file_list = files.split("|")
file_list = [f.strip() for f in file_list]
fo... | 30.643836 | 167 | 0.6616 |
fee0038bcad7bec639ce857ac310e519e48bb958 | 7,102 | py | Python | src/archive/train_model.py | leocnj/call2018 | dc815eff13bd8d601098ae26eefbb073b0e9466a | [
"Apache-2.0"
] | null | null | null | src/archive/train_model.py | leocnj/call2018 | dc815eff13bd8d601098ae26eefbb073b0e9466a | [
"Apache-2.0"
] | null | null | null | src/archive/train_model.py | leocnj/call2018 | dc815eff13bd8d601098ae26eefbb073b0e9466a | [
"Apache-2.0"
] | null | null | null | import pickle
import numpy as np
from hyperopt import fmin, tpe, Trials
from hyperopt import hp
from hyperopt import space_eval
from sklearn.ensemble import RandomForestClassifier
from sklearn.linear_model import LogisticRegression
from sklearn.svm import SVC
from sklearn.metrics import accuracy_score
from xgboost.skl... | 34.643902 | 94 | 0.634469 |
f891466cf01eb1c1e897887f5af166069d783104 | 3,493 | py | Python | taotao-cloud-python/taotao-cloud-oldboy/day30-python-tcp-udp/socket_server_tcp.py | shuigedeng/taotao-cloud-paren | 3d281b919490f7cbee4520211e2eee5da7387564 | [
"Apache-2.0"
] | 47 | 2021-04-13T10:32:13.000Z | 2022-03-31T10:30:30.000Z | taotao-cloud-python/taotao-cloud-oldboy/day30-python-tcp-udp/socket_server_tcp.py | shuigedeng/taotao-cloud-paren | 3d281b919490f7cbee4520211e2eee5da7387564 | [
"Apache-2.0"
] | 1 | 2021-11-01T07:41:04.000Z | 2021-11-01T07:41:10.000Z | taotao-cloud-python/taotao-cloud-oldboy/day30-python-tcp-udp/socket_server_tcp.py | shuigedeng/taotao-cloud-paren | 3d281b919490f7cbee4520211e2eee5da7387564 | [
"Apache-2.0"
] | 21 | 2021-04-13T10:32:17.000Z | 2022-03-26T07:43:22.000Z | # from socket import *
# import subprocess
# ip_port=('127.0.0.1',8080)
# back_log=5
# buffer_size=1024
#
# tcp_server=socket(AF_INET,SOCK_STREAM)
# tcp_server.bind(ip_port)
# tcp_server.listen(back_log)
#
# while True:
# conn,addr=tcp_server.accept()
# print('新的客户端链接',addr)
# while True:
# #收
# ... | 26.462121 | 66 | 0.494417 |
645b1de574dc89525a904e9d2a1fd66244145362 | 12,123 | py | Python | app/Complaint.py | nlohmann/bahn_auftragsnummer | 88f4ac0a0993e6b709909023131eb68738b67db2 | [
"MIT"
] | 2 | 2017-12-20T22:24:20.000Z | 2021-07-07T13:49:15.000Z | app/Complaint.py | nlohmann/bahn_auftragsnummer | 88f4ac0a0993e6b709909023131eb68738b67db2 | [
"MIT"
] | 1 | 2019-07-19T18:33:43.000Z | 2019-07-19T18:33:43.000Z | app/Complaint.py | nlohmann/bahn_auftragsnummer | 88f4ac0a0993e6b709909023131eb68738b67db2 | [
"MIT"
] | 2 | 2017-12-20T22:24:24.000Z | 2020-06-18T15:26:17.000Z | # coding=utf-8
########################################################################
# Licensed under the MIT License <http://opensource.org/licenses/MIT>. #
# Copyright (c) 2017 Niels Lohmann <http://nlohmann.me>. #
########################################################################
from fdfgen... | 46.448276 | 104 | 0.591438 |
ca9fe22880418011914846d5c2650015c17bea4b | 4,668 | py | Python | tensorflow/modules/utils.py | nicolasrosa/Sparse-to-Continuous | 8664de17d6b6c6cc39bf8fcebfcb829249367f2f | [
"BSD-2-Clause"
] | 19 | 2018-09-25T01:58:13.000Z | 2021-07-27T09:54:36.000Z | tensorflow/modules/utils.py | nicolasrosa/Sparse-to-Continuous | 8664de17d6b6c6cc39bf8fcebfcb829249367f2f | [
"BSD-2-Clause"
] | 18 | 2020-03-24T18:18:56.000Z | 2022-02-10T00:35:13.000Z | tensorflow/modules/utils.py | nicolasrosa/Sparse-to-Continuous | 8664de17d6b6c6cc39bf8fcebfcb829249367f2f | [
"BSD-2-Clause"
] | 4 | 2019-11-14T02:35:34.000Z | 2020-08-27T11:36:02.000Z | # ===========
# Libraries
# ===========
import glob
import os
import time
from collections import deque
from itertools import chain
from sys import getsizeof, stderr
import imageio
from skimage import exposure, img_as_uint
from modules.args import args
# ========= #
# Classes #
# ========= #
class Settings:
... | 32.193103 | 137 | 0.612468 |
4eeabc62920c222feb714f88e1acdda2c60506f9 | 2,790 | py | Python | dephell/commands/package_purge.py | eli-schwartz/dephell | f3e07b497e3ad7998e563b1a4c5ad9f023834d36 | [
"MIT"
] | null | null | null | dephell/commands/package_purge.py | eli-schwartz/dephell | f3e07b497e3ad7998e563b1a4c5ad9f023834d36 | [
"MIT"
] | null | null | null | dephell/commands/package_purge.py | eli-schwartz/dephell | f3e07b497e3ad7998e563b1a4c5ad9f023834d36 | [
"MIT"
] | null | null | null | # built-in
from argparse import ArgumentParser
from packaging.utils import canonicalize_name
# app
from ..actions import get_python_env
from ..config import builders
from ..controllers import analyze_conflict, Resolver, Mutator, Graph
from ..converters import InstalledConverter
from ..models import Requirement
from .... | 33.614458 | 96 | 0.628674 |
88a72a1627fdc2e3f7df5e0e51761544e82fd472 | 1,365 | py | Python | tests/unit/molior/test_configuration.py | randombenj/molior | 5f22935a1860c9ab206acfa52ba6206ae1755594 | [
"Apache-2.0"
] | null | null | null | tests/unit/molior/test_configuration.py | randombenj/molior | 5f22935a1860c9ab206acfa52ba6206ae1755594 | [
"Apache-2.0"
] | null | null | null | tests/unit/molior/test_configuration.py | randombenj/molior | 5f22935a1860c9ab206acfa52ba6206ae1755594 | [
"Apache-2.0"
] | null | null | null | """
Provides test molior configuration class.
"""
from pathlib import Path
from mock import patch, mock_open
from molior.molior.configuration import Configuration
def test_config():
"""
Test configuration get config
"""
cfg = Configuration()
with patch("molior.molior.configuration.Configuration.... | 22.75 | 85 | 0.635165 |
cc2024bdd06ac460ceb18cfb552fde9bcf83d336 | 69 | py | Python | bootstrap.py | seko24/cmpdirs | 04f1b886a27674dc96a4ca39b84a24c2d65b48fb | [
"MIT"
] | null | null | null | bootstrap.py | seko24/cmpdirs | 04f1b886a27674dc96a4ca39b84a24c2d65b48fb | [
"MIT"
] | null | null | null | bootstrap.py | seko24/cmpdirs | 04f1b886a27674dc96a4ca39b84a24c2d65b48fb | [
"MIT"
] | null | null | null | import sys
import cmpdirs.cmpdirs
cmpdirs.cmpdirs.cli(sys.argv[1:]) | 17.25 | 33 | 0.782609 |
6aa3862dc33f23a22bbf8126a4685074edf7a8c9 | 1,203 | py | Python | src/python_eulerian_video_magnification/magnifymotion_riesz.py | shei-pi/PyEVM | 52a44c84f88c27f1ed032e94b426f854faa4198f | [
"BSD-2-Clause"
] | null | null | null | src/python_eulerian_video_magnification/magnifymotion_riesz.py | shei-pi/PyEVM | 52a44c84f88c27f1ed032e94b426f854faa4198f | [
"BSD-2-Clause"
] | null | null | null | src/python_eulerian_video_magnification/magnifymotion_riesz.py | shei-pi/PyEVM | 52a44c84f88c27f1ed032e94b426f854faa4198f | [
"BSD-2-Clause"
] | null | null | null | import cv2
import numpy as np
from python_eulerian_video_magnification.filter import butter_bandpass_filter
from python_eulerian_video_magnification.magnify import Magnify
from python_eulerian_video_magnification.pyramid import laplacian_video
from python_eulerian_video_magnification.riesz_pyramid import riesz_video
... | 44.555556 | 90 | 0.680798 |
e1bf6af0d18e2317672d403dd29ec692a9fdee70 | 703 | py | Python | covid_act_now/setup.py | sgsmob/covidcast-indicators | 424ef5fd5361c4ed7b3ed88cf31813349d35240e | [
"MIT"
] | null | null | null | covid_act_now/setup.py | sgsmob/covidcast-indicators | 424ef5fd5361c4ed7b3ed88cf31813349d35240e | [
"MIT"
] | null | null | null | covid_act_now/setup.py | sgsmob/covidcast-indicators | 424ef5fd5361c4ed7b3ed88cf31813349d35240e | [
"MIT"
] | null | null | null | from setuptools import setup
from setuptools import find_packages
required = [
"numpy",
"pandas",
"pydocstyle",
"pytest",
"pytest-cov",
"pylint",
"delphi-utils",
"covidcast",
"pyarrow",
]
setup(
name="delphi_covid_act_now",
version="0.1.0",
description="Indicators from ... | 22.677419 | 61 | 0.633001 |
93c87edfb64de72d0bc4cf9c683e800d9cddeae8 | 635 | py | Python | tests/test_shops.py | deekshag175/shopping-centre-sim | bc558a1e423ca21afa638d7323b36aeba16e7923 | [
"Apache-2.0"
] | null | null | null | tests/test_shops.py | deekshag175/shopping-centre-sim | bc558a1e423ca21afa638d7323b36aeba16e7923 | [
"Apache-2.0"
] | 8 | 2020-10-25T16:21:10.000Z | 2020-12-11T14:24:17.000Z | tests/test_shops.py | deekshag175/shopping-centre-sim | bc558a1e423ca21afa638d7323b36aeba16e7923 | [
"Apache-2.0"
] | null | null | null | import pytest
from power.shops import shops
def test_get_shopum_firstrow():
s = shops(shops_pygame_fake(None, '1_image'))
s.draw_to_screen()
assert s.shopnum == 1
assert s.posx == 140
assert s.posy == 50
def test_get_shopum_secondrow():
s = shops(shops_pygame_fake(None, '5_image'))
s.draw_... | 24.423077 | 49 | 0.659843 |
2687d5db4a3b3054ae00cbcc1b814fee8763bacb | 1,248 | py | Python | car-controller/src/mainController/Workflows/HomepageServerThread.py | iisys-hof/autonomous-driving | 9f2ab64713b6dbec38f4ca6dcb953729f39a2746 | [
"Apache-2.0"
] | null | null | null | car-controller/src/mainController/Workflows/HomepageServerThread.py | iisys-hof/autonomous-driving | 9f2ab64713b6dbec38f4ca6dcb953729f39a2746 | [
"Apache-2.0"
] | null | null | null | car-controller/src/mainController/Workflows/HomepageServerThread.py | iisys-hof/autonomous-driving | 9f2ab64713b6dbec38f4ca6dcb953729f39a2746 | [
"Apache-2.0"
] | null | null | null | # @PascalPuchtler
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# dis... | 40.258065 | 137 | 0.741987 |
67539dbc44560398ae58b659f3249ff4028074c5 | 2,272 | py | Python | app/core/impulse.py | Matexer/BSPR | a503a8795cb0f4cebe2eedd148aa00aea75b570e | [
"MIT"
] | null | null | null | app/core/impulse.py | Matexer/BSPR | a503a8795cb0f4cebe2eedd148aa00aea75b570e | [
"MIT"
] | null | null | null | app/core/impulse.py | Matexer/BSPR | a503a8795cb0f4cebe2eedd148aa00aea75b570e | [
"MIT"
] | null | null | null | from typing import Optional, Type, NamedTuple, Tuple
import math
from .template import DesignationTemplate, Data, Config
from ..head.objects import Survey, Fuel
class ImpulseOutput(NamedTuple):
total_impulse: float
unit_impulse: float
smp_time: float #ms
jet_d: float # mm
jet_field: float # mm
... | 32 | 86 | 0.598592 |
65861bd26bb781b4ed0cb661ef97babb601d2efb | 6,073 | py | Python | pywhale/lib/detector.py | stefan2200/pywhale | 7e0ffce7eeaf426236381db75fa83915e716fc17 | [
"Apache-2.0"
] | 1 | 2020-11-27T16:21:01.000Z | 2020-11-27T16:21:01.000Z | pywhale/lib/detector.py | stefan2200/pywhale | 7e0ffce7eeaf426236381db75fa83915e716fc17 | [
"Apache-2.0"
] | null | null | null | pywhale/lib/detector.py | stefan2200/pywhale | 7e0ffce7eeaf426236381db75fa83915e716fc17 | [
"Apache-2.0"
] | null | null | null | import re
import base64
import validators
import tldextract
class HeaderChecker:
header = None
headers = {
}
reports = [
]
opts = {
}
#report = {"header": "From", "indicator": "danger", "data": "From name contains uncommon HTML symbols"}
def __init__(self, headers={}):
... | 33.738889 | 121 | 0.483945 |
423b866b85fcc9f3f13795c7cabfe61e0ec8e30d | 1,844 | py | Python | tests/utils/test_uploaders.py | KaitoRyouga/CTFd | 827a22e8ce9bdfd43ae0689e6cbcf2a6e253e920 | [
"Apache-2.0"
] | null | null | null | tests/utils/test_uploaders.py | KaitoRyouga/CTFd | 827a22e8ce9bdfd43ae0689e6cbcf2a6e253e920 | [
"Apache-2.0"
] | null | null | null | tests/utils/test_uploaders.py | KaitoRyouga/CTFd | 827a22e8ce9bdfd43ae0689e6cbcf2a6e253e920 | [
"Apache-2.0"
] | null | null | null | import os
from io import BytesIO
import boto3
from moto import mock_s3
from CTFd.utils.uploads import S3Uploader, rmdir
from tests.helpers import create_ctfd, destroy_ctfd
@mock_s3
def test_s3_uploader():
conn = boto3.resource("s3", region_name="us-east-1")
conn.create_bucket(Bucket="bucket")
... | 30.229508 | 89 | 0.632863 |
5e2a0ac2db74b1a38ab5912ae934c682f260a1e6 | 1,218 | py | Python | serialization/test/scenario_set_serializer_test.py | cirrostratus1/benchmark-database | 8f8d956408749a4c2932a68bd425407fe26d4a53 | [
"MIT"
] | null | null | null | serialization/test/scenario_set_serializer_test.py | cirrostratus1/benchmark-database | 8f8d956408749a4c2932a68bd425407fe26d4a53 | [
"MIT"
] | null | null | null | serialization/test/scenario_set_serializer_test.py | cirrostratus1/benchmark-database | 8f8d956408749a4c2932a68bd425407fe26d4a53 | [
"MIT"
] | null | null | null | # Copyright (c) 2019 fortiss GmbH
#
# This software is released under the MIT License.
# https://opensource.org/licenses/MIT
import unittest
import os
import matplotlib
from serialization.scenario_set_serializer import ScenarioSetSerializer
from modules.runtime.commons.parameters import ParameterServer
class Scenario... | 45.111111 | 105 | 0.766831 |
9f25bf2c8cbcbab2967bbc9b750fbd47e6df9ffe | 2,200 | py | Python | robosuite/demos/demo_random_action.py | spatric5/robosuite | 9e6b9691eb949fbf33a23fbe8a8c6faea61c50b6 | [
"MIT"
] | 397 | 2020-09-28T02:49:58.000Z | 2022-03-30T18:08:19.000Z | robosuite/demos/demo_random_action.py | spatric5/robosuite | 9e6b9691eb949fbf33a23fbe8a8c6faea61c50b6 | [
"MIT"
] | 169 | 2020-09-28T02:17:59.000Z | 2022-03-29T13:32:43.000Z | robosuite/demos/demo_random_action.py | spatric5/robosuite | 9e6b9691eb949fbf33a23fbe8a8c6faea61c50b6 | [
"MIT"
] | 131 | 2020-09-28T14:50:35.000Z | 2022-03-31T02:27:33.000Z | from robosuite.controllers import load_controller_config
from robosuite.utils.input_utils import *
if __name__ == "__main__":
# Create dict to hold options that will be passed to env creation call
options = {}
# print welcome info
print("Welcome to robosuite v{}!".format(suite.__version__))
prin... | 31.884058 | 117 | 0.655455 |
56d9130b6cfcc674fe4099f00b0d1f6a8b292df4 | 76 | py | Python | stoxapp/__main__.py | RolfBly/stoxsnschulz | 39b33665216401bdaa0c9650de0f7c5352f2a115 | [
"Apache-2.0"
] | null | null | null | stoxapp/__main__.py | RolfBly/stoxsnschulz | 39b33665216401bdaa0c9650de0f7c5352f2a115 | [
"Apache-2.0"
] | null | null | null | stoxapp/__main__.py | RolfBly/stoxsnschulz | 39b33665216401bdaa0c9650de0f7c5352f2a115 | [
"Apache-2.0"
] | null | null | null | from __init__ import *
if __name__ == "__main__":
app.run(debug=True)
| 12.666667 | 26 | 0.671053 |
b9b3cfe03a5fc0852fc2a012cf67618eaa334502 | 732 | py | Python | content-security-policy/unsafe-eval/support/echo-eval-with-policy.py | qanat/wpt | 7c61a4594a95682531367b6956d1c37f8b8fd486 | [
"BSD-3-Clause"
] | 1 | 2021-12-12T18:13:24.000Z | 2021-12-12T18:13:24.000Z | content-security-policy/unsafe-eval/support/echo-eval-with-policy.py | qanat/wpt | 7c61a4594a95682531367b6956d1c37f8b8fd486 | [
"BSD-3-Clause"
] | 112 | 2021-09-27T14:39:02.000Z | 2022-03-30T14:26:35.000Z | content-security-policy/unsafe-eval/support/echo-eval-with-policy.py | qanat/wpt | 7c61a4594a95682531367b6956d1c37f8b8fd486 | [
"BSD-3-Clause"
] | null | null | null | def main(request, response):
policy = request.GET.first(b"policy")
return [(b"Content-Type", b"text/html"), (b"Content-Security-Policy", policy)], b"""
<!DOCTYPE html>
<html>
<script>
function check_eval(context) {
context.eval_check_variable = 0;
try {
id = context.eval("eval_check_variable + 1");
} ... | 23.612903 | 88 | 0.642077 |
29ccedbd8a42f5633f1f04e35c42cc2555b1c09d | 509 | py | Python | setup.py | ibleaman/yiddish_text_tools | cfd6f482542627471e943bceb10566ef4dc7c836 | [
"MIT"
] | 3 | 2022-02-03T15:15:45.000Z | 2022-03-29T20:47:29.000Z | setup.py | ibleaman/yiddish | cfd6f482542627471e943bceb10566ef4dc7c836 | [
"MIT"
] | null | null | null | setup.py | ibleaman/yiddish | cfd6f482542627471e943bceb10566ef4dc7c836 | [
"MIT"
] | null | null | null | from setuptools import setup
with open('README.md', 'r', encoding='utf-8') as fh:
long_description = fh.read()
setup(
name='yiddish',
version='0.0.3',
author='Isaac L. Bleaman',
author_email='bleaman@berkeley.edu',
description='A Python library for processing Yiddish text',
long_descriptio... | 26.789474 | 63 | 0.685658 |
f800dd045d79557009d442df4c82f194f1c6977d | 392 | py | Python | virtcol/virtcol/wsgi.py | filipgorczynski/django-virtual-column-sort | 02092288d308e0747b1f84163de1896df2135000 | [
"MIT"
] | null | null | null | virtcol/virtcol/wsgi.py | filipgorczynski/django-virtual-column-sort | 02092288d308e0747b1f84163de1896df2135000 | [
"MIT"
] | null | null | null | virtcol/virtcol/wsgi.py | filipgorczynski/django-virtual-column-sort | 02092288d308e0747b1f84163de1896df2135000 | [
"MIT"
] | null | null | null | """
WSGI config for virtcol project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO_SETT... | 23.058824 | 78 | 0.785714 |
beb6689f520a003417b7583812c0511a38319b9a | 16,549 | py | Python | model_compiler/openvino_2021.2/downloader.py | roboflow-ai/blobconverter | 243555c8da59bfd94509f407c13cdee6b95e7afc | [
"MIT"
] | 3 | 2021-03-19T23:08:39.000Z | 2022-01-14T21:24:24.000Z | model_compiler/openvino_2021.2/downloader.py | roboflow-ai/blobconverter | 243555c8da59bfd94509f407c13cdee6b95e7afc | [
"MIT"
] | 19 | 2021-03-24T20:36:32.000Z | 2022-03-18T17:39:17.000Z | model_compiler/openvino_2021.2/downloader.py | roboflow-ai/blobconverter | 243555c8da59bfd94509f407c13cdee6b95e7afc | [
"MIT"
] | 2 | 2021-07-06T05:17:51.000Z | 2022-03-29T06:41:16.000Z | #!/usr/bin/env python3
"""
Copyright (c) 2018 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... | 38.131336 | 118 | 0.648075 |
cb6031ec14794d13c158d841f9c40f4978cbcc85 | 27,017 | py | Python | recipes/opencv/3.x/conanfile.py | rockandsalt/conan-center-index | d739adcec3e4dd4c250eff559ceb738e420673dd | [
"MIT"
] | 562 | 2019-09-04T12:23:43.000Z | 2022-03-29T16:41:43.000Z | recipes/opencv/3.x/conanfile.py | rockandsalt/conan-center-index | d739adcec3e4dd4c250eff559ceb738e420673dd | [
"MIT"
] | 9,799 | 2019-09-04T12:02:11.000Z | 2022-03-31T23:55:45.000Z | recipes/opencv/3.x/conanfile.py | rockandsalt/conan-center-index | d739adcec3e4dd4c250eff559ceb738e420673dd | [
"MIT"
] | 1,126 | 2019-09-04T11:57:46.000Z | 2022-03-31T16:43:38.000Z | from conans import ConanFile, CMake, tools
from conans.errors import ConanInvalidConfiguration
import os
import textwrap
required_conan_version = ">=1.33.0"
class OpenCVConan(ConanFile):
name = "opencv"
license = "BSD-3-Clause"
homepage = "https://opencv.org"
description = "OpenCV (Open Source Comput... | 62.108046 | 354 | 0.617574 |
2e216ae7a07c05717a368bf005e35e1c0e415167 | 1,086 | py | Python | Exercises/Exercise4AbstractClass.py | davidavg/OOP_Python | ca4e8376a50b9c81b5ac18c466bd8d147bdbe679 | [
"MIT"
] | null | null | null | Exercises/Exercise4AbstractClass.py | davidavg/OOP_Python | ca4e8376a50b9c81b5ac18c466bd8d147bdbe679 | [
"MIT"
] | null | null | null | Exercises/Exercise4AbstractClass.py | davidavg/OOP_Python | ca4e8376a50b9c81b5ac18c466bd8d147bdbe679 | [
"MIT"
] | null | null | null | '''
Created on Aug 13, 2018
@author: david avalos
'''
#import abstract library
from abc import abstractmethod, ABC
class Person(ABC):
def __init__(self, name):
self.name = name
def talk(self, words):
print(self.name, "says:", words)
@abstractmethod
def hobby(self):
... | 18.40678 | 59 | 0.608656 |
fb2c5a43464bc9b4e33b5d74f5d9d78e97aa319a | 95,081 | py | Python | theano/tensor/nnet/conv.py | joschu/Theano | a53650487647b25f4258deef9d91ec950902c610 | [
"BSD-3-Clause"
] | 1 | 2020-12-08T02:23:42.000Z | 2020-12-08T02:23:42.000Z | theano/tensor/nnet/conv.py | joschu/Theano | a53650487647b25f4258deef9d91ec950902c610 | [
"BSD-3-Clause"
] | null | null | null | theano/tensor/nnet/conv.py | joschu/Theano | a53650487647b25f4258deef9d91ec950902c610 | [
"BSD-3-Clause"
] | null | null | null | """
Contains an Op for convolving input images with a set of filters. This was
developed especially for Convolutional Neural Networks.
For related ops, including downsampling and subsampling, see
tensor.signal and tensor.signal.downsample.
See especially conv2d().
"""
__docformat__ = "restructuredtext en"
import lo... | 41.000862 | 170 | 0.559912 |
826d57dfdd439877d0fbcbb0d1e9b962553f1c1d | 30,705 | py | Python | src/itemsapp/models.py | robertsmoto/sodavault | 200e843be7abe6cc447647bba55c7c1309092e5e | [
"BSD-3-Clause"
] | null | null | null | src/itemsapp/models.py | robertsmoto/sodavault | 200e843be7abe6cc447647bba55c7c1309092e5e | [
"BSD-3-Clause"
] | null | null | null | src/itemsapp/models.py | robertsmoto/sodavault | 200e843be7abe6cc447647bba55c7c1309092e5e | [
"BSD-3-Clause"
] | null | null | null | from django.db import models
from imagekit.models import ProcessedImageField
from imagekit.processors import ResizeToFill
from ckeditor.fields import RichTextField
from configapp.models import Price
from django.db.models import Sum
from django.db.models import Prefetch
import math
from sodavault.utils_logging import sv... | 30.890342 | 88 | 0.585703 |
0f6b684fa8726abd4734d5aa3ee861d6c842a376 | 7,632 | py | Python | examples/pwr_run/checkpointing/throughput/final2_inverse/job21.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | examples/pwr_run/checkpointing/throughput/final2_inverse/job21.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | examples/pwr_run/checkpointing/throughput/final2_inverse/job21.py | boringlee24/keras_old | 1e1176c45c4952ba1b9b9e58e9cc4df027ab111d | [
"MIT"
] | null | null | null | """
#Trains a ResNet on the CIFAR10 dataset.
"""
from __future__ import print_function
import keras
from keras.layers import Dense, Conv2D, BatchNormalization, Activation
from keras.layers import AveragePooling2D, Input, Flatten
from keras.optimizers import Adam
from keras.callbacks import ModelCheckpoint, LearningRa... | 32.755365 | 118 | 0.693658 |
765c5ea1f49a0a359498736525ce6afea0867e55 | 437 | py | Python | SumOfDigits.py | pcdoyle/Python-Challenges | 91eb3fcd4a197a1e96e00e8a0cb110251f2ab335 | [
"Unlicense"
] | null | null | null | SumOfDigits.py | pcdoyle/Python-Challenges | 91eb3fcd4a197a1e96e00e8a0cb110251f2ab335 | [
"Unlicense"
] | null | null | null | SumOfDigits.py | pcdoyle/Python-Challenges | 91eb3fcd4a197a1e96e00e8a0cb110251f2ab335 | [
"Unlicense"
] | null | null | null | """
__author__ = "Patrick Doyle"
__license__ = "The Unlicense"
__email__ = "me@pcdoyle.com"
Calculating the sum of the digits of a integer.
"""
def sumOfDigits(number):
'''
Will get a sum of all digits in an int.
'''
numberSum = 0
while number > 0:
numberSum += number % 10
number -... | 19 | 47 | 0.615561 |
aaf5cab3daa5e2b4f203edfa02effe9aa7e494a3 | 19,101 | py | Python | dp/cloud/python/magma/test_runner/tests/test_dp_with_orc8r.py | sreedharkumartn/magma | 648289fb336ffbca0fceededb6eb33c263a48703 | [
"BSD-3-Clause"
] | null | null | null | dp/cloud/python/magma/test_runner/tests/test_dp_with_orc8r.py | sreedharkumartn/magma | 648289fb336ffbca0fceededb6eb33c263a48703 | [
"BSD-3-Clause"
] | null | null | null | dp/cloud/python/magma/test_runner/tests/test_dp_with_orc8r.py | sreedharkumartn/magma | 648289fb336ffbca0fceededb6eb33c263a48703 | [
"BSD-3-Clause"
] | null | null | null | """
Copyright 2022 The Magma Authors.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES O... | 36.244782 | 117 | 0.670384 |
cf2646683fa5e67f8aee98227fe4cfbfdc70da35 | 2,904 | py | Python | examples/pybullet/gym/pybullet_envs/bullet/minitaur_env_randomizer.py | felipeek/bullet3 | 6a59241074720e9df119f2f86bc01765917feb1e | [
"Zlib"
] | 9,136 | 2015-01-02T00:41:45.000Z | 2022-03-31T15:30:02.000Z | examples/pybullet/gym/pybullet_envs/bullet/minitaur_env_randomizer.py | felipeek/bullet3 | 6a59241074720e9df119f2f86bc01765917feb1e | [
"Zlib"
] | 2,424 | 2015-01-05T08:55:58.000Z | 2022-03-30T19:34:55.000Z | examples/pybullet/gym/pybullet_envs/bullet/minitaur_env_randomizer.py | felipeek/bullet3 | 6a59241074720e9df119f2f86bc01765917feb1e | [
"Zlib"
] | 2,921 | 2015-01-02T10:19:30.000Z | 2022-03-31T02:48:42.000Z | """Randomize the minitaur_gym_env when reset() is called."""
import random
import numpy as np
from . import env_randomizer_base
# Relative range.
MINITAUR_BASE_MASS_ERROR_RANGE = (-0.2, 0.2) # 0.2 means 20%
MINITAUR_LEG_MASS_ERROR_RANGE = (-0.2, 0.2) # 0.2 means 20%
# Absolute range.
BATTERY_VOLTAGE_RANGE = (14.8, 1... | 44.676923 | 99 | 0.755854 |
f7e0f830a9f5f2091aab43d4ad34a4ecd86885a4 | 187 | py | Python | jammy_app.py | ContinuumBridge/jammy_app | 51d0b5290b135dbf3aa03d60f4d12343fb7de83f | [
"MIT"
] | null | null | null | jammy_app.py | ContinuumBridge/jammy_app | 51d0b5290b135dbf3aa03d60f4d12343fb7de83f | [
"MIT"
] | null | null | null | jammy_app.py | ContinuumBridge/jammy_app | 51d0b5290b135dbf3aa03d60f4d12343fb7de83f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# jammy_app.py
# Copyright (C) ContinuumBridge Limited, 2015 - All Rights Reserved
# Written by Peter Claydon
#
import sys
from jammy_app_a import App
App(sys.argv)
| 20.777778 | 67 | 0.764706 |
83a109999d15b1d164525e6825ac6dc06b73446b | 4,724 | py | Python | huaweicloud-sdk-iotda/huaweicloudsdkiotda/v5/model/show_product_request.py | NQLoong/huaweicloud-sdk-python-v3 | 677944a0b722147c6e105c53df9110724d64152a | [
"Apache-2.0"
] | 1 | 2021-11-03T07:54:50.000Z | 2021-11-03T07:54:50.000Z | huaweicloud-sdk-iotda/huaweicloudsdkiotda/v5/model/show_product_request.py | mawenbo-huawei/huaweicloud-sdk-python-v3 | 677944a0b722147c6e105c53df9110724d64152a | [
"Apache-2.0"
] | null | null | null | huaweicloud-sdk-iotda/huaweicloudsdkiotda/v5/model/show_product_request.py | mawenbo-huawei/huaweicloud-sdk-python-v3 | 677944a0b722147c6e105c53df9110724d64152a | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
import pprint
import re
import six
class ShowProductRequest:
"""
Attributes:
openapi_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute name
and the value... | 28.804878 | 177 | 0.587003 |
32a00b28e3b38edeb4b04c5b369de2247487de93 | 1,196 | py | Python | scripts/servo.py | EqualExperts/eesa | 7efe5e086ae2e3593ebf215929d91984761327ca | [
"Apache-2.0"
] | 8 | 2017-10-18T12:55:27.000Z | 2019-12-03T22:59:41.000Z | scripts/servo.py | EqualExperts/eesa | 7efe5e086ae2e3593ebf215929d91984761327ca | [
"Apache-2.0"
] | 3 | 2018-12-12T08:51:00.000Z | 2018-12-14T15:30:26.000Z | scripts/servo.py | EqualExperts/eesa | 7efe5e086ae2e3593ebf215929d91984761327ca | [
"Apache-2.0"
] | 3 | 2019-11-22T11:29:27.000Z | 2019-12-03T22:59:55.000Z | from __future__ import print_function
from threading import Timer
import sys
sys.path.append("/home/apsync/dronekit-python/")
print(sys.path)
import time
from dronekit import connect, VehicleMode, mavutil
connection_string = '0.0.0.0:9000'
pwm = sys.argv[1]
def set_servo(vehicle, servo_number, pwm_value):
pwm_va... | 24.916667 | 57 | 0.731605 |
204cfcf799a7d3d0e35bfac8225dd0307ba0851f | 10,018 | py | Python | CMC/AchillesEncoder_train.py | wtwt5237/Benisse | 2c7e569ff7f1d15d883576dd9487612e5ed1077f | [
"MIT"
] | null | null | null | CMC/AchillesEncoder_train.py | wtwt5237/Benisse | 2c7e569ff7f1d15d883576dd9487612e5ed1077f | [
"MIT"
] | null | null | null | CMC/AchillesEncoder_train.py | wtwt5237/Benisse | 2c7e569ff7f1d15d883576dd9487612e5ed1077f | [
"MIT"
] | null | null | null | #!usr/bin/env python3 in conda env torch_scBCR
#Adapted from CMC: https://github.com/HobbitLong/CMC
#Example code:
#python3 AchillesEncoder.py --input_data cleaned_BCRmltrain \
#--atchley_factors Atchley_factors.csv \
#--resume model_BCRmltrain \
#--break_point model_BCRmltrain/epoch_25.pt \
#--encode_dim 40 --pad_leng... | 35.90681 | 130 | 0.650829 |
293de98ecdf9ba806d2744cb15b551ed1b28b368 | 14,458 | py | Python | test/functional/feature_dbcrash.py | blakelapierre/bitcoin-cash-node | a61fc457449817bef5e280ba25bd9bcb6c921421 | [
"MIT"
] | 61 | 2020-02-23T01:19:16.000Z | 2022-03-04T15:22:00.000Z | test/functional/feature_dbcrash.py | blakelapierre/bitcoin-cash-node | a61fc457449817bef5e280ba25bd9bcb6c921421 | [
"MIT"
] | null | null | null | test/functional/feature_dbcrash.py | blakelapierre/bitcoin-cash-node | a61fc457449817bef5e280ba25bd9bcb6c921421 | [
"MIT"
] | 20 | 2020-03-01T02:35:17.000Z | 2021-12-28T12:04:34.000Z | #!/usr/bin/env python3
# Copyright (c) 2017-2019 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test recovery from a crash during chainstate writing.
- 4 nodes
* node0, node1, and node2 will have ... | 44.349693 | 116 | 0.617374 |
7914ebcff5d164616703d216cb64c4c47ddcd627 | 4,547 | py | Python | omnium/run_control/mpi_control.py | markmuetz/omnium | 183acd1729e1234aa103ed53a41429c9d4c1d341 | [
"Apache-2.0"
] | 3 | 2016-08-29T20:31:55.000Z | 2019-05-15T09:32:53.000Z | omnium/run_control/mpi_control.py | markmuetz/omnium | 183acd1729e1234aa103ed53a41429c9d4c1d341 | [
"Apache-2.0"
] | 71 | 2016-08-29T20:49:00.000Z | 2019-01-11T14:30:49.000Z | omnium/run_control/mpi_control.py | markmuetz/omnium | 183acd1729e1234aa103ed53a41429c9d4c1d341 | [
"Apache-2.0"
] | null | null | null | from logging import getLogger
from mpi4py import MPI
logger = getLogger('om.mpi_ctrl')
WORKTAG = 0
DIETAG = 1
class MpiMaster(object):
def __init__(self, run_control, comm, rank, size):
self.run_control = run_control
self.comm = comm
self.rank = rank
self.size = size
log... | 39.53913 | 93 | 0.548933 |
f5224e2ffba5c5043cbccaf0a15854e7fc128fed | 5,362 | py | Python | tests/benchmark/milvus_benchmark/runners/chaos.py | CyberFlameGO/milvus | c6ebae89598c4198fa44ea02f8a60219b21fbffd | [
"Apache-2.0"
] | 10,504 | 2019-09-16T12:20:11.000Z | 2022-03-31T15:07:56.000Z | tests/benchmark/milvus_benchmark/runners/chaos.py | CyberFlameGO/milvus | c6ebae89598c4198fa44ea02f8a60219b21fbffd | [
"Apache-2.0"
] | 13,389 | 2019-09-16T06:49:53.000Z | 2022-03-31T18:01:24.000Z | tests/benchmark/milvus_benchmark/runners/chaos.py | CyberFlameGO/milvus | c6ebae89598c4198fa44ea02f8a60219b21fbffd | [
"Apache-2.0"
] | 1,792 | 2019-09-18T04:27:42.000Z | 2022-03-31T14:37:20.000Z | import copy
import logging
import pdb
import time
from operator import methodcaller
from yaml import full_load, dump
import threading
from milvus_benchmark import utils
from milvus_benchmark.runners import utils as runner_utils
from milvus_benchmark.chaos import utils as chaos_utils
from milvus_benchmark.runners.base i... | 41.890625 | 140 | 0.669526 |
ef53170811203b5275316968782b196dfd7ab11d | 291 | py | Python | torchx/__init__.py | aivanou/torchx-1 | aaeee71b20d6c6feca48395cd1496a4b6ad1fca1 | [
"BSD-3-Clause"
] | null | null | null | torchx/__init__.py | aivanou/torchx-1 | aaeee71b20d6c6feca48395cd1496a4b6ad1fca1 | [
"BSD-3-Clause"
] | null | null | null | torchx/__init__.py | aivanou/torchx-1 | aaeee71b20d6c6feca48395cd1496a4b6ad1fca1 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
from .version import __version__ as __version__ # noqa F401
| 32.333333 | 71 | 0.75945 |
43fa8347ae693404d4c176f691009ac18f242dc5 | 2,008 | py | Python | src/cirrus/core/components/files/readmes.py | sjwoodr/cirrus-geo | 8f1190325ba6f6c7fc82e5d3ddb16d34c1b8478d | [
"Apache-2.0"
] | 26 | 2020-08-18T14:34:47.000Z | 2021-07-29T14:41:14.000Z | src/cirrus/core/components/files/readmes.py | sjwoodr/cirrus-geo | 8f1190325ba6f6c7fc82e5d3ddb16d34c1b8478d | [
"Apache-2.0"
] | 47 | 2020-08-26T04:56:48.000Z | 2021-10-04T16:37:38.000Z | src/cirrus/core/components/files/readmes.py | sjwoodr/cirrus-geo | 8f1190325ba6f6c7fc82e5d3ddb16d34c1b8478d | [
"Apache-2.0"
] | 6 | 2020-08-18T14:37:32.000Z | 2021-07-15T21:59:06.000Z | import logging
from rich.markdown import Markdown
from .base import ComponentFile
logger = logging.getLogger(__name__)
default_readme = '''#{name}
Fill in this README with details for this {type}
## Description
It is often best to tell people what this {type}
does. And perhaps why they might choose to use it.
... | 20.916667 | 86 | 0.62251 |
be426056c24c81265e2f07d90334c4944a353541 | 1,158 | py | Python | examples/classification_demo.py | Fuminides/deep-belief-network | 969797fa5c091f343f25980440ddeef127e6e1f5 | [
"MIT"
] | 451 | 2015-12-18T01:54:16.000Z | 2022-03-28T13:34:57.000Z | examples/classification_demo.py | Fuminides/deep-belief-network | 969797fa5c091f343f25980440ddeef127e6e1f5 | [
"MIT"
] | 55 | 2016-09-01T17:11:14.000Z | 2022-03-19T14:24:10.000Z | examples/classification_demo.py | Fuminides/deep-belief-network | 969797fa5c091f343f25980440ddeef127e6e1f5 | [
"MIT"
] | 224 | 2015-12-18T14:16:20.000Z | 2022-03-26T13:19:15.000Z | import numpy as np
np.random.seed(1337) # for reproducibility
from sklearn.datasets import load_digits
from sklearn.model_selection import train_test_split
from sklearn.metrics.classification import accuracy_score
from dbn.tensorflow import SupervisedDBNClassification
# Loading dataset
digits = load_digits()
X, Y ... | 33.085714 | 88 | 0.598446 |
7a58c88f675ac72e611971f5cffccd86ce164afe | 877 | py | Python | src/nodes/rgb_ros.py | ericchen321/ros_x_habitat | f256b62fe8dda059baaf9bad87cf53f7d769f2f9 | [
"CC-BY-4.0"
] | 24 | 2021-09-10T23:35:53.000Z | 2022-03-31T18:12:20.000Z | src/nodes/rgb_ros.py | ericchen321/ros_x_habitat | f256b62fe8dda059baaf9bad87cf53f7d769f2f9 | [
"CC-BY-4.0"
] | 4 | 2021-12-11T06:56:58.000Z | 2022-02-23T03:05:00.000Z | src/nodes/rgb_ros.py | ericchen321/ros_x_habitat | f256b62fe8dda059baaf9bad87cf53f7d769f2f9 | [
"CC-BY-4.0"
] | 7 | 2021-12-17T14:13:27.000Z | 2022-03-31T16:39:28.000Z | #!/usr/bin/env python
# note need to run viewer with python2!!!
import numpy as np
import rospy
import std_msgs.msg
from cv_bridge import CvBridge
from rospy.numpy_msg import numpy_msg
from rospy_tutorials.msg import Floats
from sensor_msgs.msg import Image
rospy.init_node("nprgb2ros_rgb", anonymous=False)
pub = ros... | 24.361111 | 83 | 0.717218 |
3fa5c12316ac26fd84f82cad6a47a6329cef47d9 | 7,604 | py | Python | src/onegov/election_day/layouts/vote.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/layouts/vote.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | src/onegov/election_day/layouts/vote.py | politbuero-kampagnen/onegov-cloud | 20148bf321b71f617b64376fe7249b2b9b9c4aa9 | [
"MIT"
] | null | null | null | from cached_property import cached_property
from onegov.core.utils import normalize_for_url
from onegov.election_day import _
from onegov.election_day.layouts.detail import DetailLayout
from onegov.election_day.utils import pdf_filename
from onegov.election_day.utils import svg_filename
class VoteLayout(DetailLayout)... | 29.703125 | 79 | 0.537875 |
5bd4df83f53628b1fa05a6ff7d22c7df75231da0 | 8,955 | py | Python | pyalgotrade/eventprofiler.py | berlm/pyalgotrade | 3b04efec563d7fa47b482b15347b0fa1aa4e11ec | [
"Apache-2.0"
] | null | null | null | pyalgotrade/eventprofiler.py | berlm/pyalgotrade | 3b04efec563d7fa47b482b15347b0fa1aa4e11ec | [
"Apache-2.0"
] | null | null | null | pyalgotrade/eventprofiler.py | berlm/pyalgotrade | 3b04efec563d7fa47b482b15347b0fa1aa4e11ec | [
"Apache-2.0"
] | 1 | 2019-10-20T15:34:34.000Z | 2019-10-20T15:34:34.000Z | # PyAlgoTrade
#
# Copyright 2011-2015 Gabriel Martin Becedillas Ruiz
#
# 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 ap... | 35.255906 | 123 | 0.626912 |
20470990ac60e392f50c42ca9fb2ed83485ea9ca | 4,844 | py | Python | models/utils/resource_util.py | kolbytn/alfred | ef6fd8d61ecc59e1b4c805fce1b1c595af8e1049 | [
"MIT"
] | null | null | null | models/utils/resource_util.py | kolbytn/alfred | ef6fd8d61ecc59e1b4c805fce1b1c595af8e1049 | [
"MIT"
] | null | null | null | models/utils/resource_util.py | kolbytn/alfred | ef6fd8d61ecc59e1b4c805fce1b1c595af8e1049 | [
"MIT"
] | null | null | null | import os
import psutil
import nvsmi
import nvidia_smi
import time
import datetime
import inspect
import multiprocessing as mp
import threading
def resource_util(pid, interval):
'''
arg:
pid: process id (int)
example return:
{
'pid': 24832,
... | 32.293333 | 140 | 0.573699 |
8e2193567c8a43259157de61c905f4e79ddf5045 | 515 | py | Python | desafiosCursoEmVideo/ex055.py | gomesGabriel/Pythonicos | b491cefbb0479dd83fee267304d0fa30b99786a5 | [
"MIT"
] | 1 | 2019-09-02T12:14:58.000Z | 2019-09-02T12:14:58.000Z | desafiosCursoEmVideo/ex055.py | gomesGabriel/Pythonicos | b491cefbb0479dd83fee267304d0fa30b99786a5 | [
"MIT"
] | null | null | null | desafiosCursoEmVideo/ex055.py | gomesGabriel/Pythonicos | b491cefbb0479dd83fee267304d0fa30b99786a5 | [
"MIT"
] | null | null | null | print('\033[33m-=-\033[m' * 20)
print('\033[33m************* Maior e menor da sequência *************\033[m')
print('\033[33m-=-\033[m' * 20)
maior = 0
menor = 0
for c in range(1, 6):
p = float(input('Insira o peso da {}ª pessoa: ' .format(c)))
if c == 1:
maior = p
menor = p
else:
if... | 30.294118 | 77 | 0.504854 |
c79323d341e851b1ae53b4758a208d572b16af1d | 1,976 | py | Python | service/serving/cls_model.py | hasty-ai/docker-inference-example | f5e8bcccff8011b783c25c9795771be1fd4f732d | [
"MIT"
] | 1 | 2021-11-04T06:50:30.000Z | 2021-11-04T06:50:30.000Z | service/serving/cls_model.py | hasty-ai/docker-inference-example | f5e8bcccff8011b783c25c9795771be1fd4f732d | [
"MIT"
] | null | null | null | service/serving/cls_model.py | hasty-ai/docker-inference-example | f5e8bcccff8011b783c25c9795771be1fd4f732d | [
"MIT"
] | null | null | null | from typing import List, Union
import json
import logging
import os
from torch.utils.data import DataLoader, TensorDataset
import albumentations as A
import numpy as np
import torch
import torchvision
class CLSModel:
def __init__(self, model_path):
self.model_path = model_path
self.transforms = ... | 38.745098 | 91 | 0.623482 |
aefd18b8938b254129db4ccc2f7f0c8b6167b4f1 | 28,307 | py | Python | lib/rucio/web/ui/flask/common/utils.py | nimishbongale/rucio | 21c93bd7d02dbc70bc3127ad77fb1a1981b83058 | [
"Apache-2.0"
] | null | null | null | lib/rucio/web/ui/flask/common/utils.py | nimishbongale/rucio | 21c93bd7d02dbc70bc3127ad77fb1a1981b83058 | [
"Apache-2.0"
] | null | null | null | lib/rucio/web/ui/flask/common/utils.py | nimishbongale/rucio | 21c93bd7d02dbc70bc3127ad77fb1a1981b83058 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright European Organization for Nuclear Research (CERN) since 2012
#
# 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... | 45.436597 | 258 | 0.652771 |
730f4a033ffc7d49982903670dab0f13f31321be | 2,011 | py | Python | test/test_paradigms.py | sanskrit/padmini | 8e7e8946a7d2df9c941f689ea4bc7b6ebb7ca1d0 | [
"MIT"
] | 1 | 2022-03-01T05:05:04.000Z | 2022-03-01T05:05:04.000Z | test/test_paradigms.py | sanskrit/padmini | 8e7e8946a7d2df9c941f689ea4bc7b6ebb7ca1d0 | [
"MIT"
] | null | null | null | test/test_paradigms.py | sanskrit/padmini | 8e7e8946a7d2df9c941f689ea4bc7b6ebb7ca1d0 | [
"MIT"
] | null | null | null | import itertools
import json
import pytest
from padmini.dhatupatha import load_dhatus
from padmini.prakarana import tin_pratyaya as tin
from .utils import run_all_permutations
dhatus = {f"{x.gana}.{x.number}": x for x in load_dhatus()}
def iter_paradigm_tests(filename):
with open(filename) as f:
test_d... | 27.547945 | 77 | 0.642466 |
70a55be3a95f49c8b2ddfe940e6d5f5e745f61d7 | 10,964 | py | Python | certbot-nginx/certbot_nginx/_internal/nginxparser.py | infinite-skx/certbot | b751112eec8c355163ab80d1091e1ce6f5b3c352 | [
"Apache-2.0"
] | null | null | null | certbot-nginx/certbot_nginx/_internal/nginxparser.py | infinite-skx/certbot | b751112eec8c355163ab80d1091e1ce6f5b3c352 | [
"Apache-2.0"
] | 1 | 2022-01-24T20:51:52.000Z | 2022-01-24T20:51:52.000Z | certbot-nginx/certbot_nginx/_internal/nginxparser.py | infinite-skx/certbot | b751112eec8c355163ab80d1091e1ce6f5b3c352 | [
"Apache-2.0"
] | null | null | null | """Very low-level nginx config parser based on pyparsing."""
# Forked from https://github.com/fatiherikli/nginxparser (MIT Licensed)
import copy
import logging
import typing
from typing import Any
from typing import IO
from typing import Iterable
from typing import Iterator
from typing import List
from typing import ov... | 35.141026 | 99 | 0.630974 |
78cbb66f1f6a3658a39425ba99f10827b6517ed3 | 1,326 | py | Python | authentik/providers/oauth2/migrations/0009_oauth2provider_verification_keys_and_more.py | BeryJu/passbook | 350f0d836580f4411524614f361a76c4f27b8a2d | [
"MIT"
] | 15 | 2020-01-05T09:09:57.000Z | 2020-11-28T05:27:39.000Z | authentik/providers/oauth2/migrations/0009_oauth2provider_verification_keys_and_more.py | BeryJu/passbook | 350f0d836580f4411524614f361a76c4f27b8a2d | [
"MIT"
] | 302 | 2020-01-21T08:03:59.000Z | 2020-12-04T05:04:57.000Z | authentik/providers/oauth2/migrations/0009_oauth2provider_verification_keys_and_more.py | BeryJu/passbook | 350f0d836580f4411524614f361a76c4f27b8a2d | [
"MIT"
] | 3 | 2020-03-04T08:21:59.000Z | 2020-08-01T20:37:18.000Z | # Generated by Django 4.0.3 on 2022-03-29 19:37
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("authentik_crypto", "0003_certificatekeypair_managed"),
("authentik_providers_oauth2", "0008_rename_rsa_key_oauth2pro... | 35.837838 | 123 | 0.61991 |
a86cb3825a08ee1a45872adc3c64fb55e6e653a8 | 1,390 | py | Python | datasets/multiview_dataset.py | marcbadger/avian-mesh | 71a884153e8970de6ee1d934949914790e40e80e | [
"MIT"
] | 39 | 2020-08-17T04:09:17.000Z | 2022-01-11T06:21:20.000Z | datasets/multiview_dataset.py | marcbadger/avian-mesh | 71a884153e8970de6ee1d934949914790e40e80e | [
"MIT"
] | 5 | 2020-08-06T11:16:43.000Z | 2022-02-07T01:48:46.000Z | datasets/multiview_dataset.py | marcbadger/avian-mesh | 71a884153e8970de6ee1d934949914790e40e80e | [
"MIT"
] | 7 | 2020-08-04T23:03:35.000Z | 2021-11-04T15:16:56.000Z | import os
import torch
class Multiview_Dataset(torch.utils.data.Dataset):
"""
Dataset class to read bird instances that have multiview matches.
Each index outputs one instance and its multiview annotations
"""
def __init__(self, root='data/cowbird/images',
annfile='data/cowbird/an... | 33.095238 | 89 | 0.568345 |
a5387c797eeb6800d2303d048e2f44ad769b68ee | 5,692 | py | Python | pyVers/neuralnet.py | m0baxter/tic-tac-toe-AI | 3529f1e1dcbb2c4edba6ffaabe6f7db3178b7de5 | [
"MIT"
] | null | null | null | pyVers/neuralnet.py | m0baxter/tic-tac-toe-AI | 3529f1e1dcbb2c4edba6ffaabe6f7db3178b7de5 | [
"MIT"
] | null | null | null | pyVers/neuralnet.py | m0baxter/tic-tac-toe-AI | 3529f1e1dcbb2c4edba6ffaabe6f7db3178b7de5 | [
"MIT"
] | null | null | null |
import numpy as np
import scipy.io as sio
from scipy.optimize import minimize
class NeuralNet(object):
def __init__(self, inputs, outputs, *hiddens):
self.shape = [inputs] + list(hiddens) + [outputs]
self.layers = len(self.shape)
self.weights = self.__randInitialize()
def t... | 26.976303 | 104 | 0.518271 |
b7e040aa2726b281254e66b145ab5d78fecb09d4 | 11,560 | py | Python | tests/test_pdf_fftconv.py | nsahoo/zfit | fcad2578f31138f5383f7fa5de6c0f8c6b1dbaa4 | [
"BSD-3-Clause"
] | 129 | 2018-03-24T22:27:55.000Z | 2022-03-19T21:04:07.000Z | tests/test_pdf_fftconv.py | nsahoo/zfit | fcad2578f31138f5383f7fa5de6c0f8c6b1dbaa4 | [
"BSD-3-Clause"
] | 195 | 2018-03-22T11:31:47.000Z | 2022-03-29T17:01:45.000Z | tests/test_pdf_fftconv.py | nsahoo/zfit | fcad2578f31138f5383f7fa5de6c0f8c6b1dbaa4 | [
"BSD-3-Clause"
] | 45 | 2018-03-22T10:12:31.000Z | 2022-02-01T10:45:27.000Z | """Example test for a pdf or function."""
# Copyright (c) 2021 zfit
import matplotlib.pyplot as plt
import numpy as np
import pytest
import scipy.signal
import scipy.stats
import tensorflow as tf
import zfit
from zfit import z
from zfit.util.exception import WorkInProgressError
param1_true = 0.3
param2_true = 1.2
... | 34.610778 | 103 | 0.669637 |
bb4e66ab04db9a5cd5f7cda6456adfaef3a0349a | 13,972 | py | Python | union_find_drawing_demo/union_find_drawing_demo.py | LPRowe/miscellaneous | 98c6c57a88627b90e87c553d9235e0349feb971d | [
"MIT"
] | null | null | null | union_find_drawing_demo/union_find_drawing_demo.py | LPRowe/miscellaneous | 98c6c57a88627b90e87c553d9235e0349feb971d | [
"MIT"
] | null | null | null | union_find_drawing_demo/union_find_drawing_demo.py | LPRowe/miscellaneous | 98c6c57a88627b90e87c553d9235e0349feb971d | [
"MIT"
] | null | null | null | import pygame
import time
import math
import matplotlib.pyplot as plt
import numpy as np
# Add removal (erase and mark all groups affected by erase)
# Delete all nodes in those groups, and re-add them back in one by one
# TODO:
# 1. add mouse tracking, 1 click and 2 click -> create vertices
# 2. add shape selection b... | 37.762162 | 107 | 0.530561 |
97f54c30d652166133bc8137c162e92d2cd4dcbe | 32 | py | Python | src/__init__.py | zuniverse/python-starter-kit | e699481dcfe339ff26a0768c7ce26991d81365bf | [
"MIT"
] | null | null | null | src/__init__.py | zuniverse/python-starter-kit | e699481dcfe339ff26a0768c7ce26991d81365bf | [
"MIT"
] | null | null | null | src/__init__.py | zuniverse/python-starter-kit | e699481dcfe339ff26a0768c7ce26991d81365bf | [
"MIT"
] | null | null | null | '''
__init__.py for package.
''' | 10.666667 | 24 | 0.625 |
e8a47787be33aec7b622437e2035c5445202ef1d | 9,060 | py | Python | imutils/ml/aug/image/images.py | JacobARose/image-utils | aa0e005c0b4df5198d188b074f4e21f8d8f97962 | [
"MIT"
] | null | null | null | imutils/ml/aug/image/images.py | JacobARose/image-utils | aa0e005c0b4df5198d188b074f4e21f8d8f97962 | [
"MIT"
] | null | null | null | imutils/ml/aug/image/images.py | JacobARose/image-utils | aa0e005c0b4df5198d188b074f4e21f8d8f97962 | [
"MIT"
] | null | null | null | """
imutils/ml/aug/image/images.py
Created on: Wednesday March 16th, 2022
Created by: Jacob Alexander Rose
"""
import argparse
import cv2
from rich import print as pp
import numpy as np
from omegaconf import OmegaConf, DictConfig, ListConfig
import os
from torch import nn
import torch
from typing import *
fro... | 25.521127 | 97 | 0.702318 |
fef60d6e866379c10fbec50fbdc98c07f5f48311 | 9,565 | py | Python | database/compiled_templates/display_common.mako.py | bopopescu/galaxy-pipelines | 109059d32a0a176a42f9d8949e72802677b8133d | [
"CC-BY-3.0"
] | null | null | null | database/compiled_templates/display_common.mako.py | bopopescu/galaxy-pipelines | 109059d32a0a176a42f9d8949e72802677b8133d | [
"CC-BY-3.0"
] | null | null | null | database/compiled_templates/display_common.mako.py | bopopescu/galaxy-pipelines | 109059d32a0a176a42f9d8949e72802677b8133d | [
"CC-BY-3.0"
] | 1 | 2020-07-25T21:10:26.000Z | 2020-07-25T21:10:26.000Z | # -*- encoding:ascii -*-
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 6
_modified_time = 1382462618.14644
_template_filename=u'templates/display_common.mako'
_template_uri=u'/display_common.mako'
_template_cache=cache.Cache(__... | 29.984326 | 221 | 0.586618 |
c13c337f36b0125035a1ae3601c62c6bd5f602a5 | 2,182 | py | Python | PSet2/P6/modules/graphics.py | alpha-leo/ComputationalPhysics-Fall2020 | 737769d4a046b4ecea885cafeaf26e26075f7320 | [
"MIT"
] | 1 | 2021-08-10T14:33:35.000Z | 2021-08-10T14:33:35.000Z | PSet2/P6/modules/graphics.py | alpha-leo/ComputationalPhysics-Fall2020 | 737769d4a046b4ecea885cafeaf26e26075f7320 | [
"MIT"
] | null | null | null | PSet2/P6/modules/graphics.py | alpha-leo/ComputationalPhysics-Fall2020 | 737769d4a046b4ecea885cafeaf26e26075f7320 | [
"MIT"
] | null | null | null | """
Here lie methods for ouputing as images--aka Graphics. R.I.P
"""
import matplotlib.pyplot as plt
import numpy as np
from scipy.optimize import curve_fit
from .generate import error
def draw_canvas(canvas, max_height):
"""
Draw the given table
"""
fig, ax = plt.subplots(1, 1)
ax.pcolor(canvas,... | 32.567164 | 77 | 0.617324 |
c3d7eeb5781aff3ea273ecae991d9c559b6a0794 | 3,631 | py | Python | setup.py | mzwiessele/cellSLAM | c94c52885ed5e78a7b5d659c9510033647633076 | [
"BSD-3-Clause"
] | 15 | 2016-06-01T00:47:19.000Z | 2022-02-02T10:34:23.000Z | setup.py | mzwiessele/cellSLAM | c94c52885ed5e78a7b5d659c9510033647633076 | [
"BSD-3-Clause"
] | 1 | 2019-09-24T05:08:43.000Z | 2019-09-24T05:08:43.000Z | setup.py | mzwiessele/cellSLAM | c94c52885ed5e78a7b5d659c9510033647633076 | [
"BSD-3-Clause"
] | 5 | 2016-10-19T08:18:39.000Z | 2020-03-01T15:50:43.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#===============================================================================
# Copyright (c) 2015, Max Zwiessele
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following co... | 41.261364 | 93 | 0.646103 |
3cb5f334625151e9a796918ee61c665d1a4c1673 | 6,685 | py | Python | src/config_web.py | biothings/mygene.info | 907f87b4c3dc5f3a59bd3cfc31ecd81a2c3f5136 | [
"Apache-2.0"
] | 78 | 2017-05-26T08:38:25.000Z | 2022-02-25T08:55:31.000Z | src/config_web.py | biothings/mygene.info | 907f87b4c3dc5f3a59bd3cfc31ecd81a2c3f5136 | [
"Apache-2.0"
] | 105 | 2017-05-18T21:57:13.000Z | 2022-03-18T21:41:47.000Z | src/config_web.py | biothings/mygene.info | 907f87b4c3dc5f3a59bd3cfc31ecd81a2c3f5136 | [
"Apache-2.0"
] | 19 | 2017-06-12T18:31:54.000Z | 2021-11-10T00:04:43.000Z | """
Mygene.info API v3
https://mygene.info/v3/
"""
import re
import copy
from biothings.web.settings.default import APP_LIST, ANNOTATION_KWARGS, QUERY_KWARGS
# *****************************************************************************
# Elasticsearch Settings
# ********************************************... | 38.641618 | 242 | 0.567091 |
77ec48c543562ca1ea278c5c12ad722b4ba695c2 | 7,897 | py | Python | homeassistant/components/notify/__init__.py | paoloantinori/core | 4bbc737954325e84e42572e8ce7e40116d1a271e | [
"Apache-2.0"
] | 1 | 2020-09-07T17:15:34.000Z | 2020-09-07T17:15:34.000Z | homeassistant/components/notify/__init__.py | paoloantinori/core | 4bbc737954325e84e42572e8ce7e40116d1a271e | [
"Apache-2.0"
] | 45 | 2020-07-23T07:13:34.000Z | 2022-03-31T06:01:55.000Z | homeassistant/components/notify/__init__.py | ajschmidt8/home-assistant | 75153dd4a3061f27674f4adbd9283e6c46534e66 | [
"Apache-2.0"
] | null | null | null | """Provides functionality to notify people."""
import asyncio
from functools import partial
import logging
from typing import Optional
import voluptuous as vol
from homeassistant.const import CONF_NAME, CONF_PLATFORM
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import config_per_... | 30.968627 | 88 | 0.662783 |
c0331dd7361403b63a82b75969238b33d2726b62 | 69,293 | py | Python | tensorflow/python/ops/variable_scope.py | conqer/tensorflow | 100552f943c78cbf90aad521f9981df9b5e3c738 | [
"Apache-2.0"
] | 1 | 2018-01-19T10:51:11.000Z | 2018-01-19T10:51:11.000Z | tensorflow/python/ops/variable_scope.py | conqer/tensorflow | 100552f943c78cbf90aad521f9981df9b5e3c738 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/ops/variable_scope.py | conqer/tensorflow | 100552f943c78cbf90aad521f9981df9b5e3c738 | [
"Apache-2.0"
] | 1 | 2019-04-21T16:12:56.000Z | 2019-04-21T16:12:56.000Z | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 42.329261 | 97 | 0.661005 |
cda2e0abba92851a397f7667e9f705874637347f | 15,462 | py | Python | perceptual/plotting_tools.py | LIMUNIMI/PerceptualEvaluation | 6e1fcdf65ae5cb86997443607bb2050163b64720 | [
"MIT"
] | null | null | null | perceptual/plotting_tools.py | LIMUNIMI/PerceptualEvaluation | 6e1fcdf65ae5cb86997443607bb2050163b64720 | [
"MIT"
] | null | null | null | perceptual/plotting_tools.py | LIMUNIMI/PerceptualEvaluation | 6e1fcdf65ae5cb86997443607bb2050163b64720 | [
"MIT"
] | null | null | null | import os
from collections import OrderedDict
import pandas as pd
import streamlit as st
import numpy as np
import plotly.express as px
import plotly.graph_objects as go
from joblib import Parallel, delayed
import scipy
from scipy.stats import (f_oneway, kendalltau, kruskal, pearsonr, spearmanr,
... | 37.804401 | 118 | 0.546307 |
b00fcc6a45ec5362d4e2d154badfdf7399b3ed4d | 27 | py | Python | exercises/isbn-verifier/isbn_verifier.py | wonhyeongseo/python | ccd399510a58ad42d03420e43de67893f55dd411 | [
"MIT"
] | 2 | 2019-07-25T04:40:24.000Z | 2020-12-18T21:29:02.000Z | exercises/isbn-verifier/isbn_verifier.py | toroad/python | ce085c81a82ae5fb460fe166323dbbaa5a2588c5 | [
"MIT"
] | null | null | null | exercises/isbn-verifier/isbn_verifier.py | toroad/python | ce085c81a82ae5fb460fe166323dbbaa5a2588c5 | [
"MIT"
] | null | null | null | def verify(isbn):
pass
| 9 | 17 | 0.62963 |
45f0c273c71e8c0355aa5cf5cc661438b953419a | 974 | py | Python | src/sst/elements/simpleElementExample/tests/subcomponent_tests/test_sc_ua.py | feldergast/sst-elements | a7abc015aed709feb05821d269d233110569fd72 | [
"BSD-3-Clause"
] | 2 | 2019-06-10T15:32:03.000Z | 2019-06-11T14:17:32.000Z | src/sst/elements/simpleElementExample/tests/subcomponent_tests/test_sc_ua.py | feldergast/sst-elements | a7abc015aed709feb05821d269d233110569fd72 | [
"BSD-3-Clause"
] | 39 | 2016-01-06T15:08:15.000Z | 2020-06-03T18:12:31.000Z | src/sst/elements/simpleElementExample/tests/subcomponent_tests/test_sc_ua.py | feldergast/sst-elements | a7abc015aed709feb05821d269d233110569fd72 | [
"BSD-3-Clause"
] | 1 | 2017-06-13T13:50:58.000Z | 2017-06-13T13:50:58.000Z | import sst
# Define SST core options
sst.setProgramOption("stopAtCycle", "10us")
# Set up sender using slot and anonymous subcomponent
loader0 = sst.Component("Loader0", "simpleElementExample.SubComponentLoader")
loader0.addParam("clock", "1.5GHz")
sub0 = loader0.setSubComponent("mySubComp", "simpleElementExample.S... | 30.4375 | 81 | 0.784394 |
f7d3d15035f74ba6045d2da33f1be72acf85714e | 1,581 | py | Python | tests/test_random_signal.py | CNES/swot_simulator | 92d0bb4a274ec9923265567968beea3be4283e61 | [
"BSD-3-Clause"
] | 17 | 2020-05-28T08:20:11.000Z | 2022-03-25T07:40:48.000Z | tests/test_random_signal.py | CNES/swot_simulator | 92d0bb4a274ec9923265567968beea3be4283e61 | [
"BSD-3-Clause"
] | 7 | 2021-07-21T02:15:52.000Z | 2021-11-14T10:46:41.000Z | tests/test_random_signal.py | CNES/swot_simulator | 92d0bb4a274ec9923265567968beea3be4283e61 | [
"BSD-3-Clause"
] | 8 | 2020-05-17T13:53:43.000Z | 2022-03-25T07:40:58.000Z | import os
import pickle
import numpy as np
import xarray as xr
import swot_simulator
import swot_simulator.random_signal as random_signal
ROOT = os.path.dirname(os.path.abspath(__file__))
def test_gen_signal_1d():
with open(os.path.join(ROOT, "data", "gen_signal_1d.bin"), "rb") as stream:
(fi, psi, x, n... | 34.369565 | 79 | 0.645161 |
d5c1febad0e8a33005bcd01789d255680d079190 | 385 | py | Python | pyfcm/__meta__.py | smart-learning/PyFCM | 85370b578daafc463812be09d385cf50e5fd3b29 | [
"MIT",
"Unlicense"
] | 2 | 2018-10-24T05:00:11.000Z | 2018-11-19T04:12:56.000Z | pyfcm/__meta__.py | smart-learning/PyFCM | 85370b578daafc463812be09d385cf50e5fd3b29 | [
"MIT",
"Unlicense"
] | null | null | null | pyfcm/__meta__.py | smart-learning/PyFCM | 85370b578daafc463812be09d385cf50e5fd3b29 | [
"MIT",
"Unlicense"
] | 2 | 2019-01-22T03:00:27.000Z | 2019-06-24T12:35:39.000Z | # -*- coding: utf-8 -*-
"""Define project metadata
"""
__title__ = 'pyfcm'
__summary__ = 'Python client for FCM - Firebase Cloud Messaging (Android & iOS)..'
__url__ = 'https://github.com/olucurious/pyfcm'
__version__ = '1.4.5'
__install_requires__ = ['requests', 'requests-toolbelt']
__author__ = 'Emmanuel Adegbite'... | 24.0625 | 82 | 0.711688 |
e652e890f53d4a152c68e0552c8548318ce89b50 | 7,897 | py | Python | Tests/Methods/Slot/test_SlotW27_meth.py | IrakozeFD/pyleecan | 5a93bd98755d880176c1ce8ac90f36ca1b907055 | [
"Apache-2.0"
] | null | null | null | Tests/Methods/Slot/test_SlotW27_meth.py | IrakozeFD/pyleecan | 5a93bd98755d880176c1ce8ac90f36ca1b907055 | [
"Apache-2.0"
] | null | null | null | Tests/Methods/Slot/test_SlotW27_meth.py | IrakozeFD/pyleecan | 5a93bd98755d880176c1ce8ac90f36ca1b907055 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import pytest
from pyleecan.Classes.SlotW27 import SlotW27
from numpy import ndarray, arcsin, exp
from pyleecan.Classes.LamSlot import LamSlot
from pyleecan.Classes.Segment import Segment
from pyleecan.Classes.Slot import Slot
from pyleecan.Methods.Slot.SlotW27 import S27_W03CheckError
# For A... | 33.892704 | 87 | 0.561479 |
8207f83f660c4b7e05a59b5ce7de8fea71946c60 | 16,490 | py | Python | test/run_device_tests.py | coreboot/chrome-ec | 61044db105bc854167efe83815acb3fcb55deb85 | [
"BSD-3-Clause"
] | 46 | 2017-02-12T20:48:45.000Z | 2022-03-01T15:53:39.000Z | test/run_device_tests.py | coreboot/chrome-ec | 61044db105bc854167efe83815acb3fcb55deb85 | [
"BSD-3-Clause"
] | 1 | 2022-01-08T23:28:01.000Z | 2022-01-09T00:43:16.000Z | test/run_device_tests.py | coreboot/chrome-ec | 61044db105bc854167efe83815acb3fcb55deb85 | [
"BSD-3-Clause"
] | 46 | 2016-02-07T18:43:27.000Z | 2022-01-03T02:30:51.000Z | #!/usr/bin/env python3
# Copyright 2020 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Runs unit tests on device and displays the results.
This script assumes you have a ~/.servodrc config file with a line that
co... | 31.711538 | 99 | 0.60091 |
504dcb4305d800a670c0dc22d9243d9cb7b24a4b | 87 | py | Python | tests/unit/test_clutch.py | wyleung/clutch | 2564735245a97a4fc0a1bb923c2a515dc2ae61a1 | [
"MIT"
] | null | null | null | tests/unit/test_clutch.py | wyleung/clutch | 2564735245a97a4fc0a1bb923c2a515dc2ae61a1 | [
"MIT"
] | null | null | null | tests/unit/test_clutch.py | wyleung/clutch | 2564735245a97a4fc0a1bb923c2a515dc2ae61a1 | [
"MIT"
] | null | null | null | from clutch import __version__
def test_version():
assert __version__ == "2.0.0"
| 14.5 | 33 | 0.712644 |
a95e44df603596d90027a9b5fd64b7f0d130c450 | 1,460 | py | Python | recipes/Python/577119_3d_Surface_fitting_N_random/recipe-577119.py | tdiprima/code | 61a74f5f93da087d27c70b2efe779ac6bd2a3b4f | [
"MIT"
] | 2,023 | 2017-07-29T09:34:46.000Z | 2022-03-24T08:00:45.000Z | recipes/Python/577119_3d_Surface_fitting_N_random/recipe-577119.py | unhacker/code | 73b09edc1b9850c557a79296655f140ce5e853db | [
"MIT"
] | 32 | 2017-09-02T17:20:08.000Z | 2022-02-11T17:49:37.000Z | recipes/Python/577119_3d_Surface_fitting_N_random/recipe-577119.py | unhacker/code | 73b09edc1b9850c557a79296655f140ce5e853db | [
"MIT"
] | 780 | 2017-07-28T19:23:28.000Z | 2022-03-25T20:39:41.000Z | # 3D surface fitting to N random points
# using inverse distance weighted averages.
# FB - 201003162
from PIL import Image
import random
import math
# image size
imgx = 512
imgy = 512
image = Image.new("RGB", (imgx, imgy))
# random color palette coefficients
kr = random.randint(1, 7)
kg = random.randint(1, 7)
kb = ra... | 22.8125 | 72 | 0.516438 |
8fbfad2df712e30b5b231cb7e2186aca7c8eb08f | 405 | py | Python | astr-119-session-4/using_numpy_continued.py | Aukau/Astr-119 | da56326c84ad6755aee0182d87c607b4c321c45d | [
"MIT"
] | null | null | null | astr-119-session-4/using_numpy_continued.py | Aukau/Astr-119 | da56326c84ad6755aee0182d87c607b4c321c45d | [
"MIT"
] | 12 | 2021-09-27T18:42:44.000Z | 2021-12-09T18:01:31.000Z | astr-119-session-4/using_numpy_continued.py | Aukau/Astr-119 | da56326c84ad6755aee0182d87c607b4c321c45d | [
"MIT"
] | null | null | null | import numpy as np
x = 1.0
y = 2.0
#exponenets and logarithms
print(np.exp(x))
print(np.log(x))
print(np.log10(x))
print(np.log2(x))
#min.max.misc
print(np.fabs(x))
print(np.fmin(x, y))
print(np.fmax(x, y))
#populate arrays
n = 1200
z = np.arange(n, dtype = float)
z *= 2.0*np.pi / float(n-1)
sin... | 16.2 | 33 | 0.614815 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.