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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2e2932f0cf6a4ecc325d1164487077f622c521d4 | 11,505 | py | Python | src/django-nonrel/tests/regressiontests/httpwrappers/tests.py | adamjmcgrath/glancydesign | 826ede7c639879d5b79ee730eb5e91422768cb02 | [
"BSD-3-Clause"
] | 790 | 2015-01-03T02:13:39.000Z | 2020-05-10T19:53:57.000Z | tests/regressiontests/httpwrappers/tests.py | mradziej/django | 5d38965743a369981c9a738a298f467f854a2919 | [
"BSD-3-Clause"
] | 1,361 | 2015-01-08T23:09:40.000Z | 2020-04-14T00:03:04.000Z | tests/regressiontests/httpwrappers/tests.py | mradziej/django | 5d38965743a369981c9a738a298f467f854a2919 | [
"BSD-3-Clause"
] | 155 | 2015-01-08T22:59:31.000Z | 2020-04-08T08:01:53.000Z | import copy
import pickle
from django.http import (QueryDict, HttpResponse, SimpleCookie, BadHeaderError,
parse_cookie)
from django.utils import unittest
class QueryDictTests(unittest.TestCase):
def test_missing_key(self):
q = QueryDict('')
self.assertRaises(KeyError, q.__getitem__, 'foo')... | 40.510563 | 99 | 0.597132 |
3c81713102c4fc8e77eff69b1c1ce15706a59405 | 2,315 | py | Python | test/functional/feature_config_args.py | YEPCOIN/YEPCOIN | 5df02cce9bb76caee82cf832e1c35e37de799e81 | [
"MIT"
] | null | null | null | test/functional/feature_config_args.py | YEPCOIN/YEPCOIN | 5df02cce9bb76caee82cf832e1c35e37de799e81 | [
"MIT"
] | 1 | 2020-10-16T20:08:05.000Z | 2020-10-17T03:56:34.000Z | test/functional/feature_config_args.py | YEPCOIN/YEPCOIN | 5df02cce9bb76caee82cf832e1c35e37de799e81 | [
"MIT"
] | 1 | 2020-04-30T07:52:02.000Z | 2020-04-30T07:52:02.000Z | #!/usr/bin/env python3
# Copyright (c) 2017 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 various command line arguments and configuration file parameters."""
import os
from test_framework.te... | 46.3 | 169 | 0.692441 |
d5fd94645d4e01afd7375d97695a60a4b70de3c0 | 8,476 | py | Python | patroni/__init__.py | pmarcinkiewicz1/patroni | 16d1ffdde775a12c43d9b9365a169ad9fb20bc95 | [
"MIT"
] | null | null | null | patroni/__init__.py | pmarcinkiewicz1/patroni | 16d1ffdde775a12c43d9b9365a169ad9fb20bc95 | [
"MIT"
] | 7 | 2021-04-09T01:17:52.000Z | 2021-04-09T01:18:02.000Z | patroni/__init__.py | rammatzkvosky/patroni | cf007d61a0220bc08535af3a5b3c12565a899b48 | [
"MIT"
] | null | null | null | import logging
import os
import signal
import sys
import time
from patroni.version import __version__
logger = logging.getLogger(__name__)
PATRONI_ENV_PREFIX = 'PATRONI_'
class Patroni(object):
def __init__(self, conf):
from patroni.api import RestApiServer
from patroni.dcs import get_dcs
... | 32.980545 | 109 | 0.611609 |
feb22d45da9d4bf56ed1a994f302c799788dfbf3 | 58,313 | py | Python | jax/interpreters/xla.py | sunilkpai/jax | 5bbb449ae5849c508194c8eb5b10c101f1fa22ae | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-06-18T08:19:12.000Z | 2021-06-18T08:19:12.000Z | jax/interpreters/xla.py | yang-song/jax | a6b2c371d28f49a972814ffec03addb6773621b7 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | jax/interpreters/xla.py | yang-song/jax | a6b2c371d28f49a972814ffec03addb6773621b7 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 39.268013 | 151 | 0.715484 |
e080c229040c8e1a35883b8be7b4ebaa878ade47 | 12,821 | py | Python | codes/models/loss.py | zhouhuanxiang/mmsr | 4d3f0d2cbfc4f259a2998655413330b4448c1056 | [
"Apache-2.0"
] | null | null | null | codes/models/loss.py | zhouhuanxiang/mmsr | 4d3f0d2cbfc4f259a2998655413330b4448c1056 | [
"Apache-2.0"
] | null | null | null | codes/models/loss.py | zhouhuanxiang/mmsr | 4d3f0d2cbfc4f259a2998655413330b4448c1056 | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
import numpy as np
class TensorAxis:
N = 0
H = 1
W = 2
C = 3
class CSFlow:
def __init__(self, sigma=float(0.1), b=float(1.0)):
self.b = b
self.sigma = sigma
def __calculate_CS(self, scaled_distances, axis_for_normalization=TensorAxis.C):
... | 39.693498 | 117 | 0.616879 |
4a0122409dae530dac8fe1b1ac5d2bb914a01cb8 | 3,500 | py | Python | maipc/RNN/processing.py | nPironio/maipc | 776e1d53063005d89ce463883c20ea5519a8b8d0 | [
"BSD-3-Clause"
] | null | null | null | maipc/RNN/processing.py | nPironio/maipc | 776e1d53063005d89ce463883c20ea5519a8b8d0 | [
"BSD-3-Clause"
] | null | null | null | maipc/RNN/processing.py | nPironio/maipc | 776e1d53063005d89ce463883c20ea5519a8b8d0 | [
"BSD-3-Clause"
] | null | null | null | from typing import List, Dict
import madmom as md
import numpy as np
NN_DTYPE = np.float32
def get_blstms(RNN: str) -> List[md.ml.nn.layers.BidirectionalLayer]:
"""
Get the input and bidirectional LSTM layers of a trained model
Args:
RNN: path to madmom trained NN
Returns: list of layers
"""
rnn = md.ml.nn.... | 33.653846 | 113 | 0.742 |
7af5264245ac98ac815eb77ed77b99e4f5725333 | 3,072 | py | Python | tests/common/test_run/apply_rms_prop_mixed_precision_run.py | laekov/akg | 5316b8cb2340bbf71bdc724dc9d81513a67b3104 | [
"Apache-2.0"
] | 1 | 2020-08-31T02:43:43.000Z | 2020-08-31T02:43:43.000Z | tests/common/test_run/apply_rms_prop_mixed_precision_run.py | laekov/akg | 5316b8cb2340bbf71bdc724dc9d81513a67b3104 | [
"Apache-2.0"
] | null | null | null | tests/common/test_run/apply_rms_prop_mixed_precision_run.py | laekov/akg | 5316b8cb2340bbf71bdc724dc9d81513a67b3104 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 39.384615 | 112 | 0.687826 |
a24269102d87b3908b73b6d7c7cfaa042bd6a825 | 4,982 | py | Python | tesp/envs/reset_wrapper.py | hyyh28/tesp | 8109b39011e05545453950c918b14da07e70fad3 | [
"MIT"
] | 29 | 2019-05-18T12:18:34.000Z | 2022-03-30T01:46:48.000Z | tesp/envs/reset_wrapper.py | kivo360/tesp | a77d9c228a6891b304e789ba2758a4cbfdb75ec0 | [
"MIT"
] | 8 | 2019-08-15T05:42:10.000Z | 2021-05-21T09:41:15.000Z | tesp/envs/reset_wrapper.py | kivo360/tesp | a77d9c228a6891b304e789ba2758a4cbfdb75ec0 | [
"MIT"
] | 8 | 2019-07-15T22:36:20.000Z | 2020-08-09T07:03:26.000Z | # -*- coding: utf-8 -*-
# @Author : Lin Lan (ryan.linlan@gmail.com)
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import gym
import ray
# from ray.experimental import named_actors
class ResetWrapper(gym.Wrapper):
def __init__(sel... | 37.179104 | 77 | 0.600763 |
5820bdd356cd4a38c3ebb8fba54d07b88eee2fad | 2,668 | py | Python | examples/dfp/v201505/custom_targeting_service/delete_custom_targeting_keys.py | wbrp/googleads-python-lib | c0f8ce6c4acfe88ce8f913a4f0e0e92b548e1022 | [
"Apache-2.0"
] | 1 | 2020-05-23T11:32:32.000Z | 2020-05-23T11:32:32.000Z | examples/dfp/v201505/custom_targeting_service/delete_custom_targeting_keys.py | cmm08/googleads-python-lib | 97743df32eff92cf00cb8beaddcda42dfa0a37f4 | [
"Apache-2.0"
] | null | null | null | examples/dfp/v201505/custom_targeting_service/delete_custom_targeting_keys.py | cmm08/googleads-python-lib | 97743df32eff92cf00cb8beaddcda42dfa0a37f4 | [
"Apache-2.0"
] | 2 | 2018-04-20T02:16:33.000Z | 2020-11-12T20:58:54.000Z | #!/usr/bin/python
#
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | 32.144578 | 77 | 0.723013 |
a083656cb77b94d3f10df276780161dce582fd98 | 3,306 | py | Python | src/weconnect/settings/production.py | SriSatyaLokesh/weconnect | 5c97ee9d1207a1a65021b2ea43bb445b01f64af0 | [
"MIT"
] | null | null | null | src/weconnect/settings/production.py | SriSatyaLokesh/weconnect | 5c97ee9d1207a1a65021b2ea43bb445b01f64af0 | [
"MIT"
] | 8 | 2020-06-06T00:38:48.000Z | 2021-11-15T17:50:37.000Z | src/weconnect/settings/production.py | SriSatyaLokesh/weconnect | 5c97ee9d1207a1a65021b2ea43bb445b01f64af0 | [
"MIT"
] | null | null | null | """
Django settings for weconnect project.
Generated by 'django-admin startproject' using Django 1.10.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.10/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.10/ref/settings/
"""
import ... | 25.236641 | 91 | 0.69389 |
5ea1e603f2a170a01b53a0e1cd6329a6fc138c67 | 1,267 | py | Python | test.py | idozahavy/NeuralNetwork | 4a3d66a7fa92afad0dbe4d4fc4ef2dc76b844c3f | [
"MIT"
] | 1 | 2020-07-05T13:42:55.000Z | 2020-07-05T13:42:55.000Z | test.py | idozahavy/NeuralNetwork | 4a3d66a7fa92afad0dbe4d4fc4ef2dc76b844c3f | [
"MIT"
] | null | null | null | test.py | idozahavy/NeuralNetwork | 4a3d66a7fa92afad0dbe4d4fc4ef2dc76b844c3f | [
"MIT"
] | null | null | null | from sympy import Symbol
from AILostCause.BetterNode import Node
x = Symbol("x")
y = x ** 2 + 5 * (x+4)
result = y.subs(x, 5)
print(type(result))
print(result)
print(type(y))
print(y)
print(y.diff("x"))
start_node = Node()
second_node = Node()
third_node = Node()
output_node = Node()
output_node.AddInputNode(th... | 24.843137 | 79 | 0.749803 |
5b1a011cce8aa83d478e7ca5e90fddf8b32278b0 | 9,254 | py | Python | agent.py | fabiocorreacordeiro/Train-a-Smartcab-to-Drive | b83ed543141ab9da95cb4c13ed30eedd99ba5674 | [
"MIT"
] | null | null | null | agent.py | fabiocorreacordeiro/Train-a-Smartcab-to-Drive | b83ed543141ab9da95cb4c13ed30eedd99ba5674 | [
"MIT"
] | null | null | null | agent.py | fabiocorreacordeiro/Train-a-Smartcab-to-Drive | b83ed543141ab9da95cb4c13ed30eedd99ba5674 | [
"MIT"
] | null | null | null | import random
import math
import numpy as np
from environment import Agent, Environment
from planner import RoutePlanner
from simulator import Simulator
class LearningAgent(Agent):
""" An agent that learns to drive in the Smartcab world.
This is the object you will be modifying. """
def __init__(self... | 36.722222 | 151 | 0.587962 |
95f16a8a12935d0bdf1a11f5b55a59ca9ed3b7bb | 984 | py | Python | site_guitare/urls.py | Sieltek/site_guitare | 36a2d0b10f77d093ad2f210f1d7f5d1442966189 | [
"MIT"
] | null | null | null | site_guitare/urls.py | Sieltek/site_guitare | 36a2d0b10f77d093ad2f210f1d7f5d1442966189 | [
"MIT"
] | 2 | 2021-03-19T08:25:54.000Z | 2021-03-19T08:30:09.000Z | site_guitare/urls.py | Sieltek/site_guitare | 36a2d0b10f77d093ad2f210f1d7f5d1442966189 | [
"MIT"
] | null | null | null | """site_guitare URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-... | 36.444444 | 80 | 0.726626 |
7a9e74000e6ff939dcf50bffcfcb0c9017016bfd | 18,979 | py | Python | scripts/wk/os/win.py | 2Shirt/WizardK | 82a2e7f85c80a52f892c1553e7a45ec0174e7bc6 | [
"MIT"
] | null | null | null | scripts/wk/os/win.py | 2Shirt/WizardK | 82a2e7f85c80a52f892c1553e7a45ec0174e7bc6 | [
"MIT"
] | 178 | 2017-11-17T19:14:31.000Z | 2021-12-15T07:43:29.000Z | scripts/wk/os/win.py | 2Shirt/WizardK | 82a2e7f85c80a52f892c1553e7a45ec0174e7bc6 | [
"MIT"
] | 1 | 2017-11-17T19:32:36.000Z | 2017-11-17T19:32:36.000Z | """WizardKit: Windows Functions"""
# vim: sts=2 sw=2 ts=2
import ctypes
import logging
import os
import pathlib
import platform
from contextlib import suppress
import psutil
try:
import winreg
except ImportError as err:
if platform.system() == 'Windows':
raise err
from wk.borrowed import acpi
from wk.cfg.ma... | 27.465991 | 83 | 0.678592 |
5f53e188c48749de05414dbf8bf2a24e37a1553d | 108 | py | Python | python_exercises/27Local_Library/library/catalog/urls.py | Matheus-IT/lang-python-related | dd2e5d9b9f16d3838ba1670fdfcba1fa3fe305e9 | [
"MIT"
] | null | null | null | python_exercises/27Local_Library/library/catalog/urls.py | Matheus-IT/lang-python-related | dd2e5d9b9f16d3838ba1670fdfcba1fa3fe305e9 | [
"MIT"
] | null | null | null | python_exercises/27Local_Library/library/catalog/urls.py | Matheus-IT/lang-python-related | dd2e5d9b9f16d3838ba1670fdfcba1fa3fe305e9 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('', views.home, name='home'),
]
| 13.5 | 38 | 0.657407 |
7f54cc5591bcfe88f86178327f5745a208117ea7 | 479 | py | Python | example/example/migrations/0001_initial.py | ebanalyse/django-nested-form-field | 5872f2a60676948d4d54332e30e01b46536af323 | [
"MIT"
] | 1 | 2021-05-25T20:41:38.000Z | 2021-05-25T20:41:38.000Z | example/example/migrations/0001_initial.py | ebanalyse/django-nested-form-field | 5872f2a60676948d4d54332e30e01b46536af323 | [
"MIT"
] | 1 | 2021-05-25T21:00:09.000Z | 2021-05-25T21:00:09.000Z | example/example/migrations/0001_initial.py | nielslerches/django-nested-form-field | 5872f2a60676948d4d54332e30e01b46536af323 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-03-22 16:39
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Record',
fields=[
('id', models.AutoField(a... | 21.772727 | 114 | 0.569937 |
0a90ebe6373572111d488cc103024c637cf0733a | 2,432 | py | Python | docs/src/headers_example.py | Kludex/di | dc8b3ad3f6b0004a439a17208872ddbd24b62fbf | [
"MIT"
] | null | null | null | docs/src/headers_example.py | Kludex/di | dc8b3ad3f6b0004a439a17208872ddbd24b62fbf | [
"MIT"
] | null | null | null | docs/src/headers_example.py | Kludex/di | dc8b3ad3f6b0004a439a17208872ddbd24b62fbf | [
"MIT"
] | null | null | null | from __future__ import annotations
import inspect
from typing import Any, Mapping, Optional
from di import Container, Dependant, Depends
class Request:
def __init__(self, headers: Mapping[str, str]) -> None:
self.headers = {k.lower(): v for k, v in headers.items()}
class HeaderDependant(Dependant[Any]... | 33.777778 | 88 | 0.634457 |
d59507466611ef36fc541b5b883820fd7d545d69 | 1,283 | py | Python | tensorflow_manopt/manifolds/__init__.py | nagachika/tensorflow-manopt | 736e300686624b14a1697fd6ed06d4344f94fe90 | [
"MIT"
] | null | null | null | tensorflow_manopt/manifolds/__init__.py | nagachika/tensorflow-manopt | 736e300686624b14a1697fd6ed06d4344f94fe90 | [
"MIT"
] | null | null | null | tensorflow_manopt/manifolds/__init__.py | nagachika/tensorflow-manopt | 736e300686624b14a1697fd6ed06d4344f94fe90 | [
"MIT"
] | null | null | null | from tensorflow_manopt.manifolds.cholesky import Cholesky
from tensorflow_manopt.manifolds.euclidean import Euclidean
from tensorflow_manopt.manifolds.grassmannian import Grassmannian
from tensorflow_manopt.manifolds.hyperboloid import Hyperboloid
from tensorflow_manopt.manifolds.manifold import Manifold
from tensorflo... | 37.735294 | 77 | 0.830086 |
aef4b325cc0df7478a6378296be4c00f847f1872 | 2,749 | py | Python | src/nodemgr/vrouter_nodemgr/haproxy_stats.py | sagarc-contrail/contrail-controller | 834302367f3ff81f1ce93f4036b6b3788dfd6994 | [
"Apache-2.0"
] | 1 | 2019-01-11T06:16:10.000Z | 2019-01-11T06:16:10.000Z | src/nodemgr/vrouter_nodemgr/haproxy_stats.py | sagarc-contrail/contrail-controller | 834302367f3ff81f1ce93f4036b6b3788dfd6994 | [
"Apache-2.0"
] | null | null | null | src/nodemgr/vrouter_nodemgr/haproxy_stats.py | sagarc-contrail/contrail-controller | 834302367f3ff81f1ce93f4036b6b3788dfd6994 | [
"Apache-2.0"
] | 18 | 2017-01-12T09:28:44.000Z | 2019-04-18T20:47:42.000Z | import os
import socket
import sys
import csv
HAPROXY_DIR = '/var/lib/contrail/loadbalancer/haproxy/'
STATS_MAP = {
'active_connections': 'qcur',
'max_connections': 'qmax',
'current_sessions': 'scur',
'max_sessions': 'smax',
'total_sessions': 'stot',
'bytes_in': 'bin',
'bytes_out': 'bout',... | 31.597701 | 80 | 0.568934 |
9cea9ff70578c958a89fea1bec192e644e5ec0af | 50,445 | py | Python | src/python/tests/core/bot/fuzzers/libFuzzer/engine_test.py | Montana/clusterfuzz | fd2b0be7d680d238e5a426aa061a8669dd63f7cc | [
"Apache-2.0"
] | 1 | 2021-02-03T18:12:57.000Z | 2021-02-03T18:12:57.000Z | src/python/tests/core/bot/fuzzers/libFuzzer/engine_test.py | Montana/clusterfuzz | fd2b0be7d680d238e5a426aa061a8669dd63f7cc | [
"Apache-2.0"
] | null | null | null | src/python/tests/core/bot/fuzzers/libFuzzer/engine_test.py | Montana/clusterfuzz | fd2b0be7d680d238e5a426aa061a8669dd63f7cc | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Google LLC
#
# 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, ... | 38.923611 | 100 | 0.678501 |
98496c291367b0c394559725a8e8a5ccdf3cc8aa | 3,652 | py | Python | src/transactors/file_transactor.py | alliance-genome/agr_loader | 79f87f16ccfc1260f57ec651dce6e32b4b926866 | [
"MIT"
] | 1 | 2018-10-05T15:35:54.000Z | 2018-10-05T15:35:54.000Z | src/transactors/file_transactor.py | alliance-genome/agr_loader | 79f87f16ccfc1260f57ec651dce6e32b4b926866 | [
"MIT"
] | 176 | 2017-09-05T23:01:59.000Z | 2021-11-16T13:14:45.000Z | src/transactors/file_transactor.py | alliance-genome/agr_loader | 79f87f16ccfc1260f57ec651dce6e32b4b926866 | [
"MIT"
] | 5 | 2020-08-19T11:50:59.000Z | 2020-12-19T08:54:01.000Z | """File Trnasactor"""
import logging
import multiprocessing
from time import sleep
from etl import ETL
class FileTransactor():
"""File Transactor"""
logger = logging.getLogger(__name__)
count = 0
queue = None
def __init__(self):
manager = multiprocessing.Manager()
FileTransact... | 35.803922 | 155 | 0.65471 |
d526243e9b58d2e6e06828534465d66de0db33fb | 1,730 | py | Python | telemaster/mobile_phone_mast_repository.py | seanjohnno/TeleMaster | 40f2d1c37dab4c26503ae3813fcf8f6f9d52dada | [
"MIT"
] | null | null | null | telemaster/mobile_phone_mast_repository.py | seanjohnno/TeleMaster | 40f2d1c37dab4c26503ae3813fcf8f6f9d52dada | [
"MIT"
] | null | null | null | telemaster/mobile_phone_mast_repository.py | seanjohnno/TeleMaster | 40f2d1c37dab4c26503ae3813fcf8f6f9d52dada | [
"MIT"
] | null | null | null | import csv
import datetime
import time
from typing import List
class MobilePhoneMastInfo:
def __init__(self, csv_row):
self.__csv_row = csv_row
def property_name(self):
return self.__csv_row['Property Name']
def rent(self):
return float(self.__csv_row['Current Rent'])
def lea... | 30.350877 | 97 | 0.682659 |
060c4dc93b4b130e7efb9b4ece567e2b39065ecf | 1,056 | py | Python | hw_14/diacritization_eval.py | coinflip112/ml_101 | 9e56ffdb99ac241ed396e25d7f7818a58ee5c4de | [
"MIT"
] | null | null | null | hw_14/diacritization_eval.py | coinflip112/ml_101 | 9e56ffdb99ac241ed396e25d7f7818a58ee5c4de | [
"MIT"
] | null | null | null | hw_14/diacritization_eval.py | coinflip112/ml_101 | 9e56ffdb99ac241ed396e25d7f7818a58ee5c4de | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("gold", type=str, help="Gold data")
parser.add_argument("system", type=str, help="System data")
args = parser.parse_args()
with open(args.gold, "r", encoding="utf-8") as gold_fi... | 36.413793 | 98 | 0.608902 |
144f2d32fe9c2f4b96613e64bcaef83aee6592c3 | 1,896 | py | Python | testing/test_notebooks.py | N1m6/alibi-detect | 46576a3c85b240a576ebd8d6d8203a74efce45eb | [
"Apache-2.0"
] | 1,227 | 2019-11-19T15:38:40.000Z | 2022-03-31T11:18:32.000Z | testing/test_notebooks.py | N1m6/alibi-detect | 46576a3c85b240a576ebd8d6d8203a74efce45eb | [
"Apache-2.0"
] | 323 | 2019-11-21T18:41:00.000Z | 2022-03-31T21:08:56.000Z | testing/test_notebooks.py | N1m6/alibi-detect | 46576a3c85b240a576ebd8d6d8203a74efce45eb | [
"Apache-2.0"
] | 133 | 2019-11-19T14:23:23.000Z | 2022-03-31T07:55:43.000Z | """
This script is an example of using `jupytext` to execute notebooks for testing instead of relying on `nbmake`
plugin. This approach may be more flexible if our requirements change in the future.
"""
import glob
from pathlib import Path
import pytest
from jupytext.cli import jupytext
# Set of all example notebooks... | 39.5 | 109 | 0.758439 |
1a5cc4d46774bebec3d082dec8d26a261b7d91a4 | 1,292 | py | Python | shrinky/glsl_terminator.py | xyproto/shrinky | 8f318d2f62f8ef3cffae6bd5db1b36c95067aac6 | [
"BSD-3-Clause"
] | 11 | 2019-03-16T11:03:50.000Z | 2021-12-26T12:41:57.000Z | shrinky/glsl_terminator.py | xyproto/shrinky | 8f318d2f62f8ef3cffae6bd5db1b36c95067aac6 | [
"BSD-3-Clause"
] | 1 | 2022-02-12T16:22:37.000Z | 2022-02-12T16:22:37.000Z | shrinky/glsl_terminator.py | xyproto/shrinky | 8f318d2f62f8ef3cffae6bd5db1b36c95067aac6 | [
"BSD-3-Clause"
] | null | null | null | ########################################
# GlslTerminator #######################
########################################
class GlslTerminator:
"""Terminator class."""
def __init__(self, source):
"""Constructor."""
self.__terminator = source
def format(self, force):
"""Return fo... | 25.84 | 61 | 0.513158 |
82271689e64fe42f9973a693e6f86e25319fa0f4 | 432 | py | Python | models/neck/__init__.py | law930001/panpp | b1da417cb47df94e3aa9fd039bd94b06ab8df9bd | [
"Apache-2.0"
] | 1 | 2021-12-28T06:56:10.000Z | 2021-12-28T06:56:10.000Z | models/neck/__init__.py | law930001/panpp | b1da417cb47df94e3aa9fd039bd94b06ab8df9bd | [
"Apache-2.0"
] | null | null | null | models/neck/__init__.py | law930001/panpp | b1da417cb47df94e3aa9fd039bd94b06ab8df9bd | [
"Apache-2.0"
] | null | null | null | from .builder import build_neck
from .fpem_v1 import FPEM_v1
from .fpem_v2 import FPEM_v2 # for PAN++
from .fpn import FPN
from .fpnv2_1 import FPN_v2_1
from .fpnv2_2 import FPN_v2_2
from .fpnv2_3 import FPN_v2_3
from .fpnv3_1 import FPN_v3_1
from .fpnv3_2 import FPN_v3_2
from .fpnv3_3 import FPN_v3_3
__all__ = ['FP... | 30.857143 | 125 | 0.761574 |
9faafa9140c20391dea209fafeaf7c9024a7924d | 2,402 | py | Python | src.py | SiddharthanSingaravel/Identifying-Sentiments-in-HealthTwitter | a743fa1c7bf113b0e69a31ebc234a2a3690f6c70 | [
"MIT"
] | null | null | null | src.py | SiddharthanSingaravel/Identifying-Sentiments-in-HealthTwitter | a743fa1c7bf113b0e69a31ebc234a2a3690f6c70 | [
"MIT"
] | null | null | null | src.py | SiddharthanSingaravel/Identifying-Sentiments-in-HealthTwitter | a743fa1c7bf113b0e69a31ebc234a2a3690f6c70 | [
"MIT"
] | null | null | null | import keras
from keras.models import load_model
from keras.preprocessing.text import Tokenizer
from keras.models import Sequential
from keras.layers import Activation, Dense, Dropout, Embedding, Flatten, Conv1D, MaxPooling1D, LSTM
from keras.preprocessing.sequence import pad_sequences
import re
import pandas as pd
imp... | 28.595238 | 99 | 0.735637 |
891b6bccb1ce126140a5452120c7d8b97d680ce6 | 1,274 | py | Python | beaconator/config.py | mfdeux/beaconator | 81372cd32457b2d76669354ae20968b678f45d04 | [
"MIT"
] | null | null | null | beaconator/config.py | mfdeux/beaconator | 81372cd32457b2d76669354ae20968b678f45d04 | [
"MIT"
] | null | null | null | beaconator/config.py | mfdeux/beaconator | 81372cd32457b2d76669354ae20968b678f45d04 | [
"MIT"
] | null | null | null | import os
import typing
import pydantic
import yaml
from .backend.utils.secrets import make_jwt_secret, make_temporary_password
class Config(pydantic.BaseModel):
database_uri: str = "sqlite:///data.db"
docs_url: typing.Optional[str] = None
redoc_url: typing.Optional[str] = None
serve_admin: bool = T... | 27.695652 | 75 | 0.696232 |
209543e6158635ab1051295945cb27956aacbbc3 | 13,589 | py | Python | pal/parser/pal_model_parser.py | jasa/pal | 2a5b0b3ed4698a077d9c707a1e6c692eebfb362a | [
"MIT"
] | 26 | 2020-01-06T23:53:17.000Z | 2022-02-01T08:58:21.000Z | pal/parser/pal_model_parser.py | jasa/pal | 2a5b0b3ed4698a077d9c707a1e6c692eebfb362a | [
"MIT"
] | 30 | 2019-11-13T00:55:22.000Z | 2022-01-06T08:09:35.000Z | pal/parser/pal_model_parser.py | jasa/pal | 2a5b0b3ed4698a077d9c707a1e6c692eebfb362a | [
"MIT"
] | 14 | 2019-11-15T16:56:22.000Z | 2021-12-22T10:14:17.000Z | from pal.parser.abstract_parser import AbstractParser
from pal.logger import logger
from pal.exception import PalParserException
import pal.model
import pal.model.generic
import pal.model.generic.access_mechanism
import pal.model.armv8a
import pal.model.armv8a.access_mechanism
import pal.model.intel
import pal.model.in... | 41.303951 | 102 | 0.528221 |
5ea5d3e51cad7032b5d5bd793d2341e55a274cd8 | 2,169 | py | Python | cs/compress.py | satabios/ressurect | 4da1f0d59af69fce6c9f70a0ac8e989ae2f75cdb | [
"MIT"
] | null | null | null | cs/compress.py | satabios/ressurect | 4da1f0d59af69fce6c9f70a0ac8e989ae2f75cdb | [
"MIT"
] | null | null | null | cs/compress.py | satabios/ressurect | 4da1f0d59af69fce6c9f70a0ac8e989ae2f75cdb | [
"MIT"
] | null | null | null | import numpy as np
import cv2
import glob
w,h=28,28
cmp_rate=6
def genBump(bumpSize, RowSize, ColSize, FrameNum):
BumpTime = np.zeros((RowSize, ColSize), dtype=np.int)
Mask = np.random.rand(RowSize, ColSize)
for i in range(FrameNum-bumpSize+1):
BumpTime[np.logical_and((i / (FrameNum-bumpSize+1)) < M... | 34.983871 | 113 | 0.65468 |
5e4faf9b779e306cbcbd689a82767a28fe5ab7cf | 1,613 | py | Python | cin/visualizer.py | phv2312/CenterNet | 8b2a633e5951527ac0f72dfb3dab940f202b747c | [
"MIT"
] | null | null | null | cin/visualizer.py | phv2312/CenterNet | 8b2a633e5951527ac0f72dfb3dab940f202b747c | [
"MIT"
] | null | null | null | cin/visualizer.py | phv2312/CenterNet | 8b2a633e5951527ac0f72dfb3dab940f202b747c | [
"MIT"
] | null | null | null | import json
from pycocotools.coco import COCO
import numpy as np
import skimage.io as io
import matplotlib.pyplot as plt
import pylab
import cv2
image_directory = "/home/kan/Desktop/cinnamon/zalo/CenterNet/data/coco_zalo/images/"
lbl_path = "/home/kan/Desktop/cinnamon/zalo/CenterNet/data/coco_zalo/train.json"
json_... | 31.627451 | 103 | 0.720397 |
8f84d7330034f84613ecafb3254ab2822c11ebc6 | 1,168 | py | Python | tests/run.py | seattleopendata/scrubadub | 00522458640d1ba6eddf5b2772ebd0bbf62cb4e2 | [
"MIT"
] | 3 | 2019-04-14T04:13:40.000Z | 2020-04-22T05:10:28.000Z | tests/run.py | seattleopendata/scrubadub | 00522458640d1ba6eddf5b2772ebd0bbf62cb4e2 | [
"MIT"
] | null | null | null | tests/run.py | seattleopendata/scrubadub | 00522458640d1ba6eddf5b2772ebd0bbf62cb4e2 | [
"MIT"
] | 3 | 2020-04-18T15:25:33.000Z | 2021-06-12T02:58:01.000Z | #!/usr/bin/env python
"""Run the test suite that is specified in the .travis.yml file
"""
import os
import subprocess
import yaml
from colors import green, red
try:
unicode
except NameError:
basestring = str # Compatibility for Python 2 and 3
root_dir = os.path.dirname(os.path.dirname(os.pat... | 22.901961 | 70 | 0.668664 |
c97cb08bc3ba5f715c5f1e5ab28b61678f24298a | 10,636 | py | Python | test/frontend/TopTenStudentsTest.py | drbobdugan/smoss | 3232ddfbb89450143a0fbca54c9be75730e3b3ec | [
"MIT"
] | null | null | null | test/frontend/TopTenStudentsTest.py | drbobdugan/smoss | 3232ddfbb89450143a0fbca54c9be75730e3b3ec | [
"MIT"
] | 3 | 2018-04-15T16:34:00.000Z | 2018-04-15T16:48:43.000Z | test/frontend/TopTenStudentsTest.py | CSC400-S18/smoss | 3232ddfbb89450143a0fbca54c9be75730e3b3ec | [
"MIT"
] | 1 | 2019-02-21T02:27:40.000Z | 2019-02-21T02:27:40.000Z | #!/usr/bin/env python3.6
#
# FILE: TopTenStudentsTest.py
# AUTHOR: wgreelish
# DATE: 9 APR 2018
#
# DESCRIPTION:
# This suite runs all of the UAT's from Story #154706475.
#
import test.frontend.FrontEndConfig as FrontEndConfig
import Config
class TopTenStudentsTest (FrontE... | 54.54359 | 109 | 0.658236 |
b016a927306ec9de84174d86515e4241f11f5204 | 2,056 | py | Python | Controller/storage/models/LinearRegressor/LinearRegressor.py | th-nuernberg/ml-cloud | 6d7527cbf6cceb7062e74dbc43d51998381aa6c8 | [
"MIT"
] | null | null | null | Controller/storage/models/LinearRegressor/LinearRegressor.py | th-nuernberg/ml-cloud | 6d7527cbf6cceb7062e74dbc43d51998381aa6c8 | [
"MIT"
] | 7 | 2020-07-19T03:29:21.000Z | 2022-03-02T06:46:12.000Z | Controller/storage/models/LinearRegressor/LinearRegressor.py | th-nuernberg/ml-cloud | 6d7527cbf6cceb7062e74dbc43d51998381aa6c8 | [
"MIT"
] | null | null | null | from tensorflow.python.keras.layers import Dense
from tensorflow.python.keras.models import Sequential, load_model
from tensorflow.python.keras.optimizers import Adam
from Algorithm import Algorithm
from KerasCallback import StatusCallback
class LinearRegressor(Algorithm):
def __init__(self, data, labels, confi... | 31.151515 | 91 | 0.608463 |
d10117e72d76c93138dcb83f50e31acc23720837 | 1,754 | py | Python | server/HonorificsConvert.py | YoshiharuSenna-ucl/C_2002 | 676a137ae30804001b8119a08ba554471c765d3d | [
"MIT"
] | null | null | null | server/HonorificsConvert.py | YoshiharuSenna-ucl/C_2002 | 676a137ae30804001b8119a08ba554471c765d3d | [
"MIT"
] | null | null | null | server/HonorificsConvert.py | YoshiharuSenna-ucl/C_2002 | 676a137ae30804001b8119a08ba554471c765d3d | [
"MIT"
] | null | null | null | from goolabs import GoolabsAPI
import json
# api取得
app_id = "9707a9ca41154956524fe5ef01ba774b4305ccc701adfb6be574a87ba4a5687b"
api = GoolabsAPI(app_id)
# 元のテキストデータ
f = open('before.txt', 'r', encoding='UTF-8')
data = f.read()
OriginalText = data
# 単語探索関数
def SearchForWords(sentence):
for start in range(len(se... | 28.290323 | 84 | 0.624287 |
04d39a13cf7fd288423ed6cb0f96c4a6b88155f0 | 210 | py | Python | atest/testdata/standard_libraries/remote/timeouts.py | rdagum/robotframework | b7069d505374e9f09a140ed5a9727d2a40716446 | [
"ECL-2.0",
"Apache-2.0"
] | 7,073 | 2015-01-01T17:19:16.000Z | 2022-03-31T22:01:29.000Z | atest/testdata/standard_libraries/remote/timeouts.py | imust6226/robotframework | 08c56fef2ebc64d682c7f99acd77c480d8d0e028 | [
"ECL-2.0",
"Apache-2.0"
] | 2,412 | 2015-01-02T09:29:05.000Z | 2022-03-31T13:10:46.000Z | atest/testdata/standard_libraries/remote/timeouts.py | 3mdeb/robotframework | 6006ce0b3d5fc6b45c5eb040dc859acd64bfa846 | [
"ECL-2.0",
"Apache-2.0"
] | 2,298 | 2015-01-03T02:47:15.000Z | 2022-03-31T02:00:16.000Z | import sys
import time
from remoteserver import RemoteServer
class Timeouts:
def sleep(self, secs):
time.sleep(int(secs))
if __name__ == '__main__':
RemoteServer(Timeouts(), *sys.argv[1:])
| 15 | 43 | 0.685714 |
b98de44e0912033e1dc635ac311c679e3a903daa | 7,922 | py | Python | src/main_regression.py | Jiangtong-Li/ZHSIR | fd2c0a7e79f22cbf565ccd5e13342f1b317ac9b7 | [
"Apache-2.0"
] | 8 | 2019-09-29T02:29:16.000Z | 2020-12-01T13:48:01.000Z | src/main_regression.py | Jiangtong-Li/ZHSIR | fd2c0a7e79f22cbf565ccd5e13342f1b317ac9b7 | [
"Apache-2.0"
] | null | null | null | src/main_regression.py | Jiangtong-Li/ZHSIR | fd2c0a7e79f22cbf565ccd5e13342f1b317ac9b7 | [
"Apache-2.0"
] | 1 | 2021-02-13T09:27:05.000Z | 2021-02-13T09:27:05.000Z | import os
import random
import time
import numpy as np
from scipy.spatial.distance import cdist
import cv2
import torch
import torch.distributed as dist
import torch.nn as nn
import torch.nn.functional as F
import torch.multiprocessing as mp
from torch.utils.data import DataLoader
from torch.optim import Adam, SGD
fr... | 43.054348 | 120 | 0.603888 |
bbe071b26b1869a44f3ea342ed537d69dfa78cb0 | 423 | py | Python | New_Home_Django/asgi.py | Ymirrp/Home-page | 6ac9b5b76cc2b08298086c7e784685dad802c9d6 | [
"MIT"
] | null | null | null | New_Home_Django/asgi.py | Ymirrp/Home-page | 6ac9b5b76cc2b08298086c7e784685dad802c9d6 | [
"MIT"
] | 7 | 2020-04-18T04:54:05.000Z | 2020-04-29T14:49:46.000Z | New_Home_Django/asgi.py | Ymirrp/Home-page | 6ac9b5b76cc2b08298086c7e784685dad802c9d6 | [
"MIT"
] | null | null | null | """
ASGI config for New_Home_Django project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.set... | 24.882353 | 79 | 0.763593 |
d6fd6bdde757e08f6ca80aa15925b0a6c6015195 | 2,033 | py | Python | Inheritance.py | ShreyashSalian/Python-Multiple-Inheritance | d152d12829ea438ce1725fd0feddcb5ae8343ca7 | [
"MIT"
] | null | null | null | Inheritance.py | ShreyashSalian/Python-Multiple-Inheritance | d152d12829ea438ce1725fd0feddcb5ae8343ca7 | [
"MIT"
] | null | null | null | Inheritance.py | ShreyashSalian/Python-Multiple-Inheritance | d152d12829ea438ce1725fd0feddcb5ae8343ca7 | [
"MIT"
] | null | null | null | class Student:
StudentCount = 0
def __init__(self,StudentId = 0,StudentName = "",StudentPhone =""):
self.StudentId = StudentId
self.StudentName = StudentName
self.StudentPhone = StudentPhone
Student.StudentCount += 1
def showCount(self):
print("Total instances of St... | 33.883333 | 102 | 0.65273 |
34f5e09c69ab414686add2d5468af4495a9732ee | 10,622 | py | Python | configs/scene_graph/VG_SgDet_transformer_mask_X_rcnn_x101_64x4d_fpn_1x.py | yizhe-ang/MMSceneGraph | d4daec3d7930d6fe1efe75b9c0a265c8be0b70ba | [
"MIT"
] | 24 | 2021-10-14T03:28:28.000Z | 2022-03-29T09:30:04.000Z | configs/scene_graph/VG_SgDet_transformer_mask_X_rcnn_x101_64x4d_fpn_1x.py | yizhe-ang/MMSceneGraph | d4daec3d7930d6fe1efe75b9c0a265c8be0b70ba | [
"MIT"
] | 4 | 2021-12-14T15:04:49.000Z | 2022-02-19T09:54:42.000Z | configs/scene_graph/VG_SgDet_transformer_mask_X_rcnn_x101_64x4d_fpn_1x.py | yizhe-ang/MMSceneGraph | d4daec3d7930d6fe1efe75b9c0a265c8be0b70ba | [
"MIT"
] | 4 | 2021-10-31T11:23:06.000Z | 2021-12-17T06:38:50.000Z | # dataset settings
dataset_type = 'VisualGenomeDataset'
data_root = 'data/visualgenome/'
img_norm_cfg = dict(
mean=[123.675, 116.28, 103.53], std=[58.395, 57.12, 57.375], to_rgb=True)
train_pipeline = [
dict(type='LoadImageFromFile'),
dict(type='LoadAnnotations', with_bbox=True, with_rel=True),
... | 36.627586 | 115 | 0.58473 |
1a217fa9fcfc7179fcc26505ada1bb22f8574827 | 1,677 | py | Python | python/y_2015/day12.py | AJSKirk/aoc | 68a66f0f37b532db6d0752bf04ed7698b7cd8a5a | [
"MIT"
] | 4 | 2020-12-21T03:12:01.000Z | 2021-12-20T06:23:13.000Z | python/y_2015/day12.py | AJSKirk/aoc | 68a66f0f37b532db6d0752bf04ed7698b7cd8a5a | [
"MIT"
] | null | null | null | python/y_2015/day12.py | AJSKirk/aoc | 68a66f0f37b532db6d0752bf04ed7698b7cd8a5a | [
"MIT"
] | 2 | 2021-12-12T15:28:55.000Z | 2021-12-20T06:23:19.000Z | import sys
import re
import operator
from functools import reduce
import math
EXTRACT_REGEXP = r'(\[)|(\])|(\{)|(\})|(-*\d+)|(red)'
def neg_safe_cast(token):
"""Needed because an .isnumeric() check fails to pick up negatives"""
try:
return int(token)
except ValueError:
return 0
def tota... | 23.619718 | 105 | 0.53548 |
034a6c37d2c5885f8fcd8b4c6d0b8f3d855bd70a | 475 | py | Python | classification/migrations/0045_clinvarexport_release_status.py | SACGF/variantgrid | 515195e2f03a0da3a3e5f2919d8e0431babfd9c9 | [
"RSA-MD"
] | 5 | 2021-01-14T03:34:42.000Z | 2022-03-07T15:34:18.000Z | classification/migrations/0045_clinvarexport_release_status.py | SACGF/variantgrid | 515195e2f03a0da3a3e5f2919d8e0431babfd9c9 | [
"RSA-MD"
] | 551 | 2020-10-19T00:02:38.000Z | 2022-03-30T02:18:22.000Z | classification/migrations/0045_clinvarexport_release_status.py | SACGF/variantgrid | 515195e2f03a0da3a3e5f2919d8e0431babfd9c9 | [
"RSA-MD"
] | null | null | null | # Generated by Django 3.1.6 on 2021-08-02 07:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('classification', '0044_auto_20210730_1252'),
]
operations = [
migrations.AddField(
model_name='clinvarexport',
name=... | 25 | 119 | 0.608421 |
45c5f081c090a86f0ff0ab30b362afc5d48d66b8 | 1,298 | py | Python | HotelManagement/FoodService/views.py | sriram012/Hotel-Management | 94a838895a69843ba0112e9a5ea5674362eb66a3 | [
"Unlicense"
] | null | null | null | HotelManagement/FoodService/views.py | sriram012/Hotel-Management | 94a838895a69843ba0112e9a5ea5674362eb66a3 | [
"Unlicense"
] | null | null | null | HotelManagement/FoodService/views.py | sriram012/Hotel-Management | 94a838895a69843ba0112e9a5ea5674362eb66a3 | [
"Unlicense"
] | 1 | 2019-01-05T12:53:57.000Z | 2019-01-05T12:53:57.000Z | from django.http import HttpResponse
from django.shortcuts import render, redirect
from RoomsManagement.models import *
from .models import *
from django.contrib.auth.models import User
from django.contrib.auth import authenticate, login, logout
from django.urls import reverse
from django.contrib import messages
from .... | 32.45 | 65 | 0.664869 |
376442b97e87eea1bf724515b2dc881cc0cfecbf | 1,262 | py | Python | apps/i3wm/i3wm.py | ma-anwar/knausj_talon | c4cf4659ffba1abf76e99f99ec376cca04bb6291 | [
"MIT"
] | null | null | null | apps/i3wm/i3wm.py | ma-anwar/knausj_talon | c4cf4659ffba1abf76e99f99ec376cca04bb6291 | [
"MIT"
] | null | null | null | apps/i3wm/i3wm.py | ma-anwar/knausj_talon | c4cf4659ffba1abf76e99f99ec376cca04bb6291 | [
"MIT"
] | null | null | null | from talon import Context, Module, actions, settings, ui
mod = Module()
mod.tag("i3wm", desc="tag for loading i3wm related files")
mod.setting(
"i3_config_path",
type=str,
default="~/.i3/config",
desc="Where to find the configuration path",
)
mod.setting(
"i3_mod_key",
type=str,
default="s... | 22.945455 | 58 | 0.617274 |
aaa65b3ab6117c31bf474703c34b559bb6978e81 | 23,480 | py | Python | src/modelSuite/exampleSanity.py | mirofedurco/PyAstronomy | b0e5806a18bde647654e6c9de323327803722864 | [
"MIT"
] | 98 | 2015-01-01T12:46:05.000Z | 2022-02-13T14:17:36.000Z | src/modelSuite/exampleSanity.py | mirofedurco/PyAstronomy | b0e5806a18bde647654e6c9de323327803722864 | [
"MIT"
] | 46 | 2015-02-10T19:53:38.000Z | 2022-01-11T17:26:05.000Z | src/modelSuite/exampleSanity.py | mirofedurco/PyAstronomy | b0e5806a18bde647654e6c9de323327803722864 | [
"MIT"
] | 38 | 2015-01-08T17:00:34.000Z | 2022-03-04T05:15:22.000Z | from __future__ import print_function, division
import unittest
import os
class ModSuiteSanity(unittest.TestCase):
def setUp(self):
pass
def tearDown(self):
# Clean up example output from KeplerEllipseModel example
if os.path.isfile("kemExample.tmp"):
os.remove("kemExampl... | 33.542857 | 146 | 0.504685 |
a472281a82c1649d6149bfd1b15761cc70ac650d | 376 | py | Python | apps/general/urls.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | null | null | null | apps/general/urls.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | null | null | null | apps/general/urls.py | LvanArkel/sbzwebsite | a26efbb050585312c53010f14f86c23616a8071f | [
"BSD-3-Clause"
] | null | null | null | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', view=views.index, name='index'),
url(r'^construction/', view=views.construction, name='construction'),
url(r'^contact/', view=views.contact, name='contact'),
url(r'^login$', view=views.login, name='login'),
... | 28.923077 | 74 | 0.632979 |
2239b3cd12e697c73f5aaf5dcc5e2c8017275b41 | 58 | py | Python | sqstaskmaster/__init__.py | upserve/sqstaskmaster | 284e67f080411731f9642717ff28908e81988cba | [
"MIT"
] | null | null | null | sqstaskmaster/__init__.py | upserve/sqstaskmaster | 284e67f080411731f9642717ff28908e81988cba | [
"MIT"
] | 1 | 2019-10-16T18:27:58.000Z | 2019-10-16T18:27:58.000Z | sqstaskmaster/__init__.py | upserve/sqstaskmaster | 284e67f080411731f9642717ff28908e81988cba | [
"MIT"
] | null | null | null | # Do not import dependencies here or setup.py will break.
| 29 | 57 | 0.775862 |
409d5309a09d1e8d198dd24fecd39c551bef374d | 1,087 | py | Python | pyspedas/mms/particles/mms_pgs_make_phi_spec.py | pulupa/pyspedas | 7228199cf16eca2a27d130f1e4985ef1e69462ea | [
"MIT"
] | 75 | 2019-02-22T12:59:33.000Z | 2022-02-26T15:33:20.000Z | pyspedas/mms/particles/mms_pgs_make_phi_spec.py | pulupa/pyspedas | 7228199cf16eca2a27d130f1e4985ef1e69462ea | [
"MIT"
] | 40 | 2019-07-02T07:46:34.000Z | 2022-02-23T21:48:50.000Z | pyspedas/mms/particles/mms_pgs_make_phi_spec.py | pulupa/pyspedas | 7228199cf16eca2a27d130f1e4985ef1e69462ea | [
"MIT"
] | 43 | 2019-02-22T13:03:41.000Z | 2022-01-24T19:26:59.000Z |
import numpy as np
# use nansum from bottleneck if it's installed, otherwise use the numpy one
try:
import bottleneck as bn
nansum = bn.nansum
except ImportError:
nansum = np.nansum
def mms_pgs_make_phi_spec(data_in, resolution=32):
data = data_in.copy()
n_phi = resolution
# zero inactive b... | 28.605263 | 96 | 0.638454 |
68a870178712676a1c7a9dce92b035a665d339dc | 619 | py | Python | unknowntags/forms.py | rickvanderzwet/makerspaceleiden-crm | a36d5073d4c49bbf46580ca9bbda5d80593d2d84 | [
"Apache-2.0"
] | null | null | null | unknowntags/forms.py | rickvanderzwet/makerspaceleiden-crm | a36d5073d4c49bbf46580ca9bbda5d80593d2d84 | [
"Apache-2.0"
] | null | null | null | unknowntags/forms.py | rickvanderzwet/makerspaceleiden-crm | a36d5073d4c49bbf46580ca9bbda5d80593d2d84 | [
"Apache-2.0"
] | null | null | null | from django import forms
from django.forms import ModelForm
from django.conf import settings
from members.models import User
from .models import Unknowntag
class SelectUserForm(forms.Form):
user = forms.ModelChoiceField(queryset=User.objects.all())
activate_doors = forms.BooleanField(initial = True, help_text... | 41.266667 | 130 | 0.781906 |
92f46091790564c2d855b876970e36c1e5908414 | 6,315 | py | Python | src/main.py | paradiseHIT/text-embeddings | 97c522110ae1a095a2f294a2a484d7bb51567e0e | [
"Apache-2.0"
] | null | null | null | src/main.py | paradiseHIT/text-embeddings | 97c522110ae1a095a2f294a2a484d7bb51567e0e | [
"Apache-2.0"
] | null | null | null | src/main.py | paradiseHIT/text-embeddings | 97c522110ae1a095a2f294a2a484d7bb51567e0e | [
"Apache-2.0"
] | null | null | null | import json
import time
import ssl
import sys, getopt
from elasticsearch import Elasticsearch
from elasticsearch.helpers import bulk
from flask import Flask, redirect, url_for
app = Flask(__name__)
# Use tensorflow 1 behavior to match the Universal Sentence Encoder
# examples (https://tfhub.dev/google/universal-senten... | 28.574661 | 88 | 0.589865 |
e438eddc7c439fdfba2af32b310eecbb6a27fad5 | 576 | py | Python | module3/RC 2.py | aspadm/labworks | 8b04a40656f0791b191e7e6a980c10afc77cd041 | [
"MIT"
] | null | null | null | module3/RC 2.py | aspadm/labworks | 8b04a40656f0791b191e7e6a980c10afc77cd041 | [
"MIT"
] | null | null | null | module3/RC 2.py | aspadm/labworks | 8b04a40656f0791b191e7e6a980c10afc77cd041 | [
"MIT"
] | null | null | null | # Кириллов, ИУ7-12, вариант
# В целочисленном одномерном массиве A(N) (N<=100) переставить нечётные
# элементы в начало, сохраняя порядок.
# Вывести исходный и полученный массивы, дополнительных не использовать.
print('Задайте целочисленный массив в строку:')
A = list(map(int,input().split()))
N = len(A)
... | 23.04 | 73 | 0.605903 |
9e5f29727795824f0ab387b3186faf282afe622e | 204 | py | Python | video/core/admin.py | eltonjncorreia/youtube-deeper | 2348345a19154968a25dcd81b9780a400923419d | [
"MIT"
] | null | null | null | video/core/admin.py | eltonjncorreia/youtube-deeper | 2348345a19154968a25dcd81b9780a400923419d | [
"MIT"
] | null | null | null | video/core/admin.py | eltonjncorreia/youtube-deeper | 2348345a19154968a25dcd81b9780a400923419d | [
"MIT"
] | null | null | null | from django.contrib import admin
from video.core.models import Video, Thumb, Theme, Comment
admin.site.register(Video)
admin.site.register(Thumb)
admin.site.register(Theme)
admin.site.register(Comment)
| 22.666667 | 58 | 0.808824 |
46abbbaa422a491a2d8c67288b6cbba45531bc64 | 2,724 | py | Python | 592_fractionAddSubtract.py | stuti-rastogi/leetcode-python-solutions | 73593fe642a06a83cde974ba5e6de3a7b396ec84 | [
"MIT"
] | 4 | 2018-07-24T08:36:42.000Z | 2019-08-25T17:48:47.000Z | 592_fractionAddSubtract.py | stuti-rastogi/leetcodesolutions | 73593fe642a06a83cde974ba5e6de3a7b396ec84 | [
"MIT"
] | null | null | null | 592_fractionAddSubtract.py | stuti-rastogi/leetcodesolutions | 73593fe642a06a83cde974ba5e6de3a7b396ec84 | [
"MIT"
] | null | null | null | class Fraction:
def __init__(self, num, denom, isNegative):
self.numerator = num
self.denominator = denom
self.negative = isNegative
def convertToString(self):
'''
Convert a fraction object to string format like -1/3 or 3/1
'''
result = []
if ... | 34.481013 | 101 | 0.564611 |
7d082876fd320b7c237ae49ad6a891806323e559 | 3,241 | py | Python | ci/cleanup-geoserver-layers.py | venicegeo/dg-pz-access | 314cf2461899ac0aae82d1eabbbc191c07c2d326 | [
"Apache-2.0"
] | null | null | null | ci/cleanup-geoserver-layers.py | venicegeo/dg-pz-access | 314cf2461899ac0aae82d1eabbbc191c07c2d326 | [
"Apache-2.0"
] | 4 | 2016-02-24T18:36:00.000Z | 2017-11-30T16:48:00.000Z | scripts/cleanup-geoserver-layers.py | venicegeo/piazza | fff367677b389ce0d4e62a2414cc991e8796a397 | [
"Apache-2.0"
] | 1 | 2020-10-01T14:25:47.000Z | 2020-10-01T14:25:47.000Z | #!/usr/bin/env python2
# Copyright 2016, RadiantBlue Technologies, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | 39.048193 | 99 | 0.712743 |
b39fef0fee3372e229be27802fe92bd850e75dae | 6,725 | py | Python | ckan/views/__init__.py | smartcolumbus-ide/scc_ide_ckan | f607d0a2f3110fe0d5e2627b2d414112d4cb3863 | [
"Apache-2.0"
] | 3 | 2020-03-07T02:47:04.000Z | 2020-09-11T05:40:41.000Z | ckan/views/__init__.py | smartcolumbus-ide/scc_ide_ckan | f607d0a2f3110fe0d5e2627b2d414112d4cb3863 | [
"Apache-2.0"
] | 4 | 2018-07-25T07:09:35.000Z | 2019-01-23T07:21:23.000Z | ckan/views/__init__.py | Pilchards/ckan | 729480f82345df1e2d753c94c5e0541a2aff9bd8 | [
"Apache-2.0"
] | 1 | 2017-11-03T14:55:25.000Z | 2017-11-03T14:55:25.000Z | # encoding: utf-8
from paste.deploy.converters import asbool
import ckan.model as model
from ckan.common import g, request, config, session
from ckan.lib.helpers import redirect_to as redirect
import ckan.plugins as p
import logging
log = logging.getLogger(__name__)
APIKEY_HEADER_NAME_KEY = u'apikey_header_name'
AP... | 37.154696 | 78 | 0.624833 |
4f4dbd201c0115cb165d78bcf485d57eada95b90 | 691 | py | Python | Unit test/test_detect_img_TF.py | khaledsabry97/Argus | c794f6e46ec529a836db127dfdb33b3161cf79ee | [
"MIT"
] | 9 | 2021-01-09T17:04:18.000Z | 2022-03-24T11:26:00.000Z | Unit test/test_detect_img_TF.py | khaledsabry97/Argus | c794f6e46ec529a836db127dfdb33b3161cf79ee | [
"MIT"
] | 4 | 2021-03-21T21:40:06.000Z | 2022-03-12T00:53:55.000Z | Unit test/test_detect_img_TF.py | khaledsabry97/Argus | c794f6e46ec529a836db127dfdb33b3161cf79ee | [
"MIT"
] | 3 | 2021-03-13T07:39:19.000Z | 2022-01-28T23:00:51.000Z | from Car_Detection_TF.yolo import YOLO
from PIL import Image
import cv2
"""
Unit test for detect_img using TF.
args: cv image
return: list of boxes bounding detected vehicles
"""
def test_detect_img_invalid_input():
"""
Verify type consistency of the function
"""
yolo = YOLO()
img,... | 20.939394 | 52 | 0.658466 |
49f583e7f501629aef667a9cbd9c10496acbdfc5 | 4,372 | py | Python | tests/test_candle_service.py | laughingwithu/jesse | c21adf59074ad62e4aa775261b4ad86c542ec4d5 | [
"MIT"
] | 10 | 2020-05-24T17:31:11.000Z | 2022-03-18T00:31:14.000Z | tests/test_candle_service.py | laughingwithu/jesse | c21adf59074ad62e4aa775261b4ad86c542ec4d5 | [
"MIT"
] | null | null | null | tests/test_candle_service.py | laughingwithu/jesse | c21adf59074ad62e4aa775261b4ad86c542ec4d5 | [
"MIT"
] | 4 | 2020-07-08T19:24:45.000Z | 2022-01-26T12:53:04.000Z | import numpy as np
from jesse.factories import fake_range_candle
from jesse.services.candle import *
def test_is_bullish():
c = np.array([1543387200000, 190, 200, 220, 180, 195])
assert is_bullish(c)
def test_is_bearish():
c = np.array([1543387200000, 200, 190, 220, 180, 195])
assert is_bearish(c)
... | 27.325 | 116 | 0.54323 |
5f4db5a2429a8ca9910e31b182931ed7ab592060 | 2,730 | py | Python | app/map_settings.py | jsolodev/nettemp | e1e9605b853689822f3e9c2a8ae9bf02e266359c | [
"MIT"
] | null | null | null | app/map_settings.py | jsolodev/nettemp | e1e9605b853689822f3e9c2a8ae9bf02e266359c | [
"MIT"
] | null | null | null | app/map_settings.py | jsolodev/nettemp | e1e9605b853689822f3e9c2a8ae9bf02e266359c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from app import app
from flask import Flask, request, jsonify, render_template
import sqlite3
from flask_login import login_required
from app.nettemp import nt_settings
from flask_mysqldb import MySQL
mysql = MySQL()
def queryselectsensors():
m = mysql.connection.cursor()
m.execute("SELECT... | 39.565217 | 261 | 0.660073 |
1684393222dfb6170cd4181197c9f83080c2f84c | 19,432 | py | Python | scripts/generate_readme_files.py | imhuay/studies-gitbook | 69a31c20c91d131d0fafce0622f4035b9b95e93a | [
"MIT"
] | 100 | 2021-10-13T01:22:27.000Z | 2022-03-31T09:52:49.000Z | scripts/generate_readme_files.py | imhuay/studies-gitbook | 69a31c20c91d131d0fafce0622f4035b9b95e93a | [
"MIT"
] | null | null | null | scripts/generate_readme_files.py | imhuay/studies-gitbook | 69a31c20c91d131d0fafce0622f4035b9b95e93a | [
"MIT"
] | 27 | 2021-11-01T01:05:09.000Z | 2022-03-31T03:32:01.000Z | #!/usr/bin/env python
# -*- coding:utf-8 -*-
"""
Time: 2021-10-01 11:13 下午
Author: huayang
Subject:
"""
import os
import re
import sys
import json
import inspect
from types import *
from typing import *
from collections import defaultdict, OrderedDict
from dataclasses import dataclass
from pathlib import Path
os.e... | 34.886894 | 118 | 0.566025 |
f21de0a60f2f7425efa6a92d30c440a09ceb9763 | 1,524 | py | Python | ProgettoLube/WebInspector/venv/Lib/site-packages/tensorflow/python/keras/api/_v1/keras/experimental/__init__.py | Lube-Project/ProgettoLube | cbf33971e2c2e865783ec1a2302625539186a338 | [
"MIT"
] | null | null | null | ProgettoLube/WebInspector/venv/Lib/site-packages/tensorflow/python/keras/api/_v1/keras/experimental/__init__.py | Lube-Project/ProgettoLube | cbf33971e2c2e865783ec1a2302625539186a338 | [
"MIT"
] | null | null | null | ProgettoLube/WebInspector/venv/Lib/site-packages/tensorflow/python/keras/api/_v1/keras/experimental/__init__.py | Lube-Project/ProgettoLube | cbf33971e2c2e865783ec1a2302625539186a338 | [
"MIT"
] | 1 | 2021-01-28T01:57:41.000Z | 2021-01-28T01:57:41.000Z | # This file is MACHINE GENERATED! Do not edit.
# Generated by: tensorflow/python/tools/api/generator/create_python_api.py script.
"""Public API for tf.keras.experimental namespace.
"""
from __future__ import print_function as _print_function
import sys as _sys
from tensorflow.python.keras.feature_column.sequence_fea... | 50.8 | 94 | 0.862861 |
ceedc1d8f4069c705bf35f92a35c4b7ac41a2e63 | 6,945 | py | Python | neutron/tests/unit/db/test_ipam_backend_mixin.py | ISCAS-VDI/neutron-base | 687f03d7131839ae8bc324d5823194d1245bb050 | [
"Apache-2.0"
] | null | null | null | neutron/tests/unit/db/test_ipam_backend_mixin.py | ISCAS-VDI/neutron-base | 687f03d7131839ae8bc324d5823194d1245bb050 | [
"Apache-2.0"
] | 3 | 2015-02-27T00:48:55.000Z | 2015-04-21T05:29:37.000Z | neutron/tests/unit/db/test_ipam_backend_mixin.py | ISCAS-VDI/neutron-base | 687f03d7131839ae8bc324d5823194d1245bb050 | [
"Apache-2.0"
] | 3 | 2015-02-26T00:55:17.000Z | 2020-03-01T17:05:40.000Z | # Copyright (c) 2015 Infoblox 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 require... | 43.679245 | 78 | 0.60216 |
d0fc0ddc218975c2f834a46846e57cd8693af066 | 384 | py | Python | learn/control/random.py | wuyou33/dynamicslearn | 93589c7a39a5e6afb7f4d8a6ef6d4e35c6f436c5 | [
"MIT"
] | 1 | 2019-11-30T02:11:24.000Z | 2019-11-30T02:11:24.000Z | learn/control/random.py | wuyou33/dynamicslearn | 93589c7a39a5e6afb7f4d8a6ef6d4e35c6f436c5 | [
"MIT"
] | null | null | null | learn/control/random.py | wuyou33/dynamicslearn | 93589c7a39a5e6afb7f4d8a6ef6d4e35c6f436c5 | [
"MIT"
] | null | null | null | from .controller import Controller
class RandomController(Controller):
def __init__(self, env, controller_cfg):
self.env = env
self.cfg = controller_cfg
def reset(self):
print("Resetting Random Controller Not Needed, but passed")
return
def get_action(self, state):
... | 24 | 67 | 0.664063 |
466cbd7a2c0e2137a3fde3b6b349e2924084acf6 | 151 | py | Python | Facebooker/urls.py | gpwork4u/Facebooker | 4a78c9575d5f36a402d7e489b69058d4e1692ce4 | [
"MIT"
] | 26 | 2020-05-29T02:41:05.000Z | 2022-03-25T17:27:32.000Z | Facebooker/urls.py | gpwork4u/Facebooker | 4a78c9575d5f36a402d7e489b69058d4e1692ce4 | [
"MIT"
] | 7 | 2020-05-28T06:09:22.000Z | 2021-10-02T05:22:38.000Z | Facebooker/urls.py | gpwork4u/Facebooker | 4a78c9575d5f36a402d7e489b69058d4e1692ce4 | [
"MIT"
] | 9 | 2020-05-28T05:40:25.000Z | 2022-02-13T21:48:01.000Z | MBASIC_FACEBOOK = 'https://mbasic.facebook.com/'
M_FACEBOOK = 'https://m.facebook.com/'
def join(*args):
slash = '/'
return slash.join(args)
| 18.875 | 48 | 0.655629 |
ddf290b7c9cf12f63ec2e85b56e9eeff913f9d5a | 16,071 | py | Python | opennem/pipelines/nem/mms.py | paulculmsee/opennem | 9ebe4ab6d3b97bdeebc352e075bbd5c22a8ddea1 | [
"MIT"
] | 22 | 2020-06-30T05:27:21.000Z | 2022-02-21T12:13:51.000Z | opennem/pipelines/nem/mms.py | paulculmsee/opennem | 9ebe4ab6d3b97bdeebc352e075bbd5c22a8ddea1 | [
"MIT"
] | 71 | 2020-08-07T13:06:30.000Z | 2022-03-15T06:44:49.000Z | opennem/pipelines/nem/mms.py | paulculmsee/opennem | 9ebe4ab6d3b97bdeebc352e075bbd5c22a8ddea1 | [
"MIT"
] | 13 | 2020-06-30T03:28:32.000Z | 2021-12-30T08:17:16.000Z | import json
import logging
from datetime import datetime
from typing import Optional
from scrapy.exceptions import DropItem
from sqlalchemy.exc import IntegrityError
from sqlalchemy.orm.exc import MultipleResultsFound
from sqlalchemy.sql import text
from opennem.core.dispatch_type import DispatchType, parse_dispatch_... | 29.7061 | 90 | 0.508058 |
f295011e2afc04f4a3e8aac8b25c5de976d3a3bd | 19,837 | py | Python | src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_custom_vm_commands.py | psignoret/azure-cli | 1a4a043750315f9a7f2894b4287126089978b615 | [
"MIT"
] | 1 | 2019-12-12T19:55:26.000Z | 2019-12-12T19:55:26.000Z | src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_custom_vm_commands.py | psignoret/azure-cli | 1a4a043750315f9a7f2894b4287126089978b615 | [
"MIT"
] | 2 | 2021-01-15T09:24:07.000Z | 2021-01-15T09:30:10.000Z | src/azure-cli/azure/cli/command_modules/vm/tests/latest/test_custom_vm_commands.py | psignoret/azure-cli | 1a4a043750315f9a7f2894b4287126089978b615 | [
"MIT"
] | 1 | 2019-12-11T06:00:10.000Z | 2019-12-11T06:00:10.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 46.785377 | 136 | 0.662701 |
ae6ced6732bc1f6208c5feb296196b57f7960839 | 7,777 | py | Python | Ros2_Project2_DWA_Pathplanner/dwa_pathplanning_turtlesim/dwa_pathplanning_turtlesim/dynamic_window_approach.py | Gonnnnn/Ros_Project | b9463855cee1df6673ca721a8792447f1230e978 | [
"Apache-2.0"
] | 2 | 2022-01-09T19:54:08.000Z | 2022-01-09T19:54:10.000Z | Ros2_Project2_DWA_Pathplanner/dwa_pathplanning_turtlesim/dwa_pathplanning_turtlesim/dynamic_window_approach.py | Gonnnnn/Ros_Project | b9463855cee1df6673ca721a8792447f1230e978 | [
"Apache-2.0"
] | null | null | null | Ros2_Project2_DWA_Pathplanner/dwa_pathplanning_turtlesim/dwa_pathplanning_turtlesim/dynamic_window_approach.py | Gonnnnn/Ros_Project | b9463855cee1df6673ca721a8792447f1230e978 | [
"Apache-2.0"
] | null | null | null | """
Mobile robot motion planning sample with Dynamic Window Approach
author: Atsushi Sakai (@Atsushi_twi), Göktuğ Karakaşlı
"""
import math
from enum import Enum
import numpy as np
def dwa_control(x, config, goal, ob):
"""
Dynamic Window Approach control
"""
dw = calc_dynamic_window(x, config)
u... | 31.108 | 92 | 0.551241 |
5f885471af17e26bfdbe7b43019854475fdf85a7 | 16,499 | py | Python | python/tvm/relay/qnn/op/legalizations.py | cli99/tvm | 6c6e873a1325a32418108daad6e38f3df8c37660 | [
"Apache-2.0"
] | 1 | 2022-02-20T11:35:19.000Z | 2022-02-20T11:35:19.000Z | python/tvm/relay/qnn/op/legalizations.py | cli99/tvm | 6c6e873a1325a32418108daad6e38f3df8c37660 | [
"Apache-2.0"
] | null | null | null | python/tvm/relay/qnn/op/legalizations.py | cli99/tvm | 6c6e873a1325a32418108daad6e38f3df8c37660 | [
"Apache-2.0"
] | null | null | null | # 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... | 36.261538 | 100 | 0.68683 |
4dce8df74a2e4b3dc7f5a33bdbd794cee7d8007e | 2,710 | py | Python | clinica/pipelines/pet_linear/pet_linear_cli.py | NicolasGensollen/clinica | a17e1a05d7f8daf97f70de883ed8acc8714290c3 | [
"MIT"
] | null | null | null | clinica/pipelines/pet_linear/pet_linear_cli.py | NicolasGensollen/clinica | a17e1a05d7f8daf97f70de883ed8acc8714290c3 | [
"MIT"
] | null | null | null | clinica/pipelines/pet_linear/pet_linear_cli.py | NicolasGensollen/clinica | a17e1a05d7f8daf97f70de883ed8acc8714290c3 | [
"MIT"
] | null | null | null | from typing import Optional
import click
from clinica.pipelines import cli_param
pipeline_name = "pet-linear"
@click.command(name=pipeline_name)
@cli_param.argument.bids_directory
@cli_param.argument.caps_directory
@cli_param.argument.acq_label
@cli_param.argument.suvr_reference_region
@cli_param.option_group.pipe... | 30.111111 | 102 | 0.726199 |
600d79bfc5cd16a9ce1040e58ffb9263d7332ecd | 1,313 | py | Python | catalog/migrations/0004_auto_20191218_1421.py | konmacie/cookbook | 3adaf1e4570190c8fbc3414542d80b398976cc92 | [
"MIT"
] | null | null | null | catalog/migrations/0004_auto_20191218_1421.py | konmacie/cookbook | 3adaf1e4570190c8fbc3414542d80b398976cc92 | [
"MIT"
] | null | null | null | catalog/migrations/0004_auto_20191218_1421.py | konmacie/cookbook | 3adaf1e4570190c8fbc3414542d80b398976cc92 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.7 on 2019-12-18 14:21
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('catalog', '0003_favourit... | 35.486486 | 137 | 0.596344 |
b438f52029eb039b447b7e4c7b09b8887c0c3599 | 3,219 | py | Python | tempest/stress/actions/volume_attach_delete.py | rcbops-qe/tempest | 88960aa32c473b64072671541a136dbae41b1d4c | [
"Apache-2.0"
] | null | null | null | tempest/stress/actions/volume_attach_delete.py | rcbops-qe/tempest | 88960aa32c473b64072671541a136dbae41b1d4c | [
"Apache-2.0"
] | null | null | null | tempest/stress/actions/volume_attach_delete.py | rcbops-qe/tempest | 88960aa32c473b64072671541a136dbae41b1d4c | [
"Apache-2.0"
] | null | null | null | # (c) 2013 Deutsche Telekom AG
# 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 ... | 43.5 | 79 | 0.607021 |
6b98c3584725afdcabd80df7d7a4b8662261ea6b | 6,288 | py | Python | suites/API/DatabaseApi/BlocksTransactions/GetRecentTransactionById.py | echoprotocol/pytests | 5dce698558c2ba703aea03aab79906af1437da5d | [
"MIT"
] | 1 | 2021-03-12T05:17:02.000Z | 2021-03-12T05:17:02.000Z | suites/API/DatabaseApi/BlocksTransactions/GetRecentTransactionById.py | echoprotocol/pytests | 5dce698558c2ba703aea03aab79906af1437da5d | [
"MIT"
] | 1 | 2019-11-19T12:10:59.000Z | 2019-11-19T12:10:59.000Z | suites/API/DatabaseApi/BlocksTransactions/GetRecentTransactionById.py | echoprotocol/pytests | 5dce698558c2ba703aea03aab79906af1437da5d | [
"MIT"
] | 2 | 2019-04-29T10:46:48.000Z | 2019-10-29T10:01:03.000Z | # -*- coding: utf-8 -*-
from time import strptime
from common.base_test import BaseTest
import lemoncheesecake.api as lcc
from lemoncheesecake.matching import check_that, equal_to, has_length, is_none, is_true, require_that
SUITE = {
"description": "Method 'get_recent_transaction_by_id'"
}
# todo: work only fo... | 45.565217 | 116 | 0.676527 |
63524766f1d6a4930702354a5bfa45bcbd11d5ae | 7,729 | py | Python | qiskit/extensions/quantum_initializer/ucrot.py | tareqdandachi/qiskit-terra | 5221fe330adba5529bfa22dc25262ac8e6291aaf | [
"Apache-2.0"
] | 3 | 2019-05-19T17:39:38.000Z | 2020-01-28T19:59:18.000Z | qiskit/extensions/quantum_initializer/ucrot.py | tareqdandachi/qiskit-terra | 5221fe330adba5529bfa22dc25262ac8e6291aaf | [
"Apache-2.0"
] | 4 | 2019-05-13T15:28:46.000Z | 2019-12-19T20:47:02.000Z | qiskit/extensions/quantum_initializer/ucrot.py | tareqdandachi/qiskit-terra | 5221fe330adba5529bfa22dc25262ac8e6291aaf | [
"Apache-2.0"
] | 1 | 2021-07-07T16:55:41.000Z | 2021-07-07T16:55:41.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... | 45.733728 | 100 | 0.614569 |
5983838a7484d098dcbc95680a5015628fbd744a | 11,847 | py | Python | nonebot/adapters/_base.py | notnotype/nonebot2 | 4661adc564c854b88fdcd4db5e30762ad5c1051d | [
"MIT"
] | 2 | 2020-11-20T02:56:04.000Z | 2020-12-30T12:40:47.000Z | nonebot/adapters/_base.py | anlen123/nonebot2 | 36d0628e4f6b4a3a81858600006aed16f647d94d | [
"MIT"
] | null | null | null | nonebot/adapters/_base.py | anlen123/nonebot2 | 36d0628e4f6b4a3a81858600006aed16f647d94d | [
"MIT"
] | 1 | 2020-11-24T09:15:51.000Z | 2020-11-24T09:15:51.000Z | """
协议适配基类
============
各协议请继承以下基类,并使用 ``driver.register_adapter`` 注册适配器
"""
import abc
from copy import copy
from typing_extensions import Literal
from functools import reduce, partial
from dataclasses import dataclass, field
from typing import Any, Dict, Union, TypeVar, Mapping, Optional, Callable, Iterable, Iterat... | 23.885081 | 119 | 0.534228 |
a6bd1e8d4c3c8eca63f00b4f95c807d2487834f7 | 587 | py | Python | lego/apps/ical/constants.py | ollfkaih/lego | b15aacaf09efe90e7f984d25b0e7bddbe12647e8 | [
"MIT"
] | 45 | 2017-10-24T12:09:06.000Z | 2021-11-03T21:21:03.000Z | lego/apps/ical/constants.py | ollfkaih/lego | b15aacaf09efe90e7f984d25b0e7bddbe12647e8 | [
"MIT"
] | 980 | 2017-10-24T12:29:07.000Z | 2022-03-31T04:04:31.000Z | lego/apps/ical/constants.py | wahello/lego | a0b02f3abc997fe96326e9c9c05b49847170041b | [
"MIT"
] | 23 | 2018-04-11T16:34:22.000Z | 2021-11-23T12:28:30.000Z | HISTORY_BACKWARDS_IN_DAYS = 10
REGISTRATION_EVENT_LENGTH_IN_MINUTES = 30
TYPE_PERSONAL = "Personal"
TYPE_EVENTS = "Events"
TYPE_REGISTRATIONS = "Registrations"
TITLES = {
TYPE_PERSONAL: "Møter og Favorittarrangementer",
TYPE_EVENTS: "Arrangementer",
TYPE_REGISTRATIONS: "Registreringstidspunkt",
}
DESCRIP... | 30.894737 | 98 | 0.785349 |
30c57203c80de33e20d367415e5f0e7bc2729bb4 | 2,448 | py | Python | code/args.py | DongjaeJang/Deep-Knowledge-Tracing | aab72939a6cbdfc8b7f11bf074040b48771cbf3f | [
"Unlicense"
] | null | null | null | code/args.py | DongjaeJang/Deep-Knowledge-Tracing | aab72939a6cbdfc8b7f11bf074040b48771cbf3f | [
"Unlicense"
] | null | null | null | code/args.py | DongjaeJang/Deep-Knowledge-Tracing | aab72939a6cbdfc8b7f11bf074040b48771cbf3f | [
"Unlicense"
] | null | null | null | import os
import argparse
def parse_args(mode='train'):
parser = argparse.ArgumentParser()
parser.add_argument('--seed', default=42, type=int, help='seed')
parser.add_argument('--device', default='cpu', type=str, help='cpu or gpu')
parser.add_argument('--data_dir', default='/opt/ml/input/d... | 47.076923 | 114 | 0.6875 |
955122e9aa5881db5759f81e9ceed867abfe3070 | 62,975 | py | Python | src/sage/categories/primer.py | rekhabiswal/sage | e8633b09919542a65e7e990c8369fee30c7edefd | [
"BSL-1.0"
] | null | null | null | src/sage/categories/primer.py | rekhabiswal/sage | e8633b09919542a65e7e990c8369fee30c7edefd | [
"BSL-1.0"
] | null | null | null | src/sage/categories/primer.py | rekhabiswal/sage | e8633b09919542a65e7e990c8369fee30c7edefd | [
"BSL-1.0"
] | null | null | null | r"""
Elements, parents, and categories in Sage: a (draft of) primer
.. contents::
:depth: 2
Abstract
========
The purpose of categories in Sage is to translate the mathematical
concept of categories (category of groups, of vector spaces, ...)
into a concrete software engineering design pattern for:
... | 37.485119 | 117 | 0.718206 |
e5b8ecc37319f155f9c85a552de48887b2042461 | 1,849 | py | Python | self_ade/incremental_eval.py | Anonymous4604/Self-ADE_SSD | eb4107e17721e17f2dedbdae654a43fc5d291f8c | [
"MIT"
] | null | null | null | self_ade/incremental_eval.py | Anonymous4604/Self-ADE_SSD | eb4107e17721e17f2dedbdae654a43fc5d291f8c | [
"MIT"
] | 8 | 2020-01-28T23:08:26.000Z | 2022-03-12T00:05:38.000Z | self_ade/incremental_eval.py | Anonymous4604/Self-ADE_SSD | eb4107e17721e17f2dedbdae654a43fc5d291f8c | [
"MIT"
] | null | null | null | import torch
import os
from ssd.data.datasets.evaluation import evaluate
from ssd.modeling.predictor import Predictor
class IncrementalEval(object):
"""
Necessary to compute the mAP of a model on a certain dataset when the predictions are not executed all together
"""
def __init__(self, cfg, test_da... | 42.022727 | 148 | 0.682531 |
9d62d41ff0212e3b6264eee845a7db093333827c | 4,302 | py | Python | src/GrafoMap.py | Ruframapi/Diversified-Semantic-Query-Reformulation | 659c60393102209b3984d4d91120ecdfb32580c4 | [
"MIT"
] | 2 | 2017-10-31T21:08:55.000Z | 2019-11-20T05:17:09.000Z | src/GrafoMap.py | Ruframapi/Diversified-Semantic-Query-Reformulation | 659c60393102209b3984d4d91120ecdfb32580c4 | [
"MIT"
] | null | null | null | src/GrafoMap.py | Ruframapi/Diversified-Semantic-Query-Reformulation | 659c60393102209b3984d4d91120ecdfb32580c4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Jan 13 10:38:25 2016
@author: proyecto
"""
import networkx as nx
import json
class GrafoMap:
G = nx.DiGraph()
alpha=0.85 #Parametro del Pagerank
FileName = "Filename";
FileOutput = "FileOut";
PathGuadarGrafo = "Grafos/";
... | 34.416 | 186 | 0.579498 |
83c6226625096ff2ed5f3792af501ecd8752fda6 | 259 | py | Python | docker-rm/controllers/resource/VolumeInstance.py | Bhaskers-Blu-Org1/osslm-docker-adaptor | 2fcccf939da14068b53eee332d8aa05bf1396a9f | [
"Apache-2.0"
] | 2 | 2017-11-08T09:32:44.000Z | 2018-01-17T16:56:05.000Z | docker-rm/controllers/resource/VolumeInstance.py | Bhaskers-Blu-Org1/osslm-docker-adaptor | 2fcccf939da14068b53eee332d8aa05bf1396a9f | [
"Apache-2.0"
] | 3 | 2018-01-30T09:02:32.000Z | 2018-10-09T08:34:49.000Z | docker-rm/controllers/resource/VolumeInstance.py | IBM/osslm-docker-adaptor | 2fcccf939da14068b53eee332d8aa05bf1396a9f | [
"Apache-2.0"
] | 8 | 2017-12-14T11:15:52.000Z | 2020-06-29T13:54:29.000Z | import logging
from controllers.resource.ResourceInstance import ResourceInstance
class VolumeInstance(ResourceInstance):
""" Reponsible for running resource instance lifecycles"""
def __init__(self, network):
self.logger = logging.getLogger(__name__)
| 28.777778 | 66 | 0.814672 |
412dd76825471723ddc5519398e4bb4d475553b9 | 1,063 | py | Python | aves2_client/logger.py | jd-aig/aves2_client | a27ada4696a28c5d9b5cffe7af7e9811a4a4e20f | [
"Apache-2.0"
] | null | null | null | aves2_client/logger.py | jd-aig/aves2_client | a27ada4696a28c5d9b5cffe7af7e9811a4a4e20f | [
"Apache-2.0"
] | null | null | null | aves2_client/logger.py | jd-aig/aves2_client | a27ada4696a28c5d9b5cffe7af7e9811a4a4e20f | [
"Apache-2.0"
] | 1 | 2020-12-08T05:14:44.000Z | 2020-12-08T05:14:44.000Z | # -*- coding:utf-8 -*-
import sys
import logging
def add_handler(stream, lvl, formatter):
logger = logging.getLogger("")
handler = logging.StreamHandler(stream)
handler.setFormatter(formatter)
logger.addHandler(handler)
logger.setLevel(lvl)
return handler
def log2console(lvl=logging.INFO):
... | 28.72973 | 71 | 0.662277 |
669e7c631df964f4d3d54a7d5334f5cd4c4d527f | 385 | py | Python | libweasyl/libweasyl/alembic/versions/652d9ba475f0_remove_thumbnail_legacy_links.py | akash143143/weasyl | be42a2313e657e97c4a48432379e37b6a3d4a4af | [
"Apache-2.0"
] | 111 | 2016-05-18T04:18:18.000Z | 2021-11-03T02:05:19.000Z | libweasyl/libweasyl/alembic/versions/652d9ba475f0_remove_thumbnail_legacy_links.py | akash143143/weasyl | be42a2313e657e97c4a48432379e37b6a3d4a4af | [
"Apache-2.0"
] | 1,103 | 2016-05-29T05:17:53.000Z | 2022-03-31T18:12:40.000Z | libweasyl/libweasyl/alembic/versions/652d9ba475f0_remove_thumbnail_legacy_links.py | TheWug/weasyl | a568a542cc58c11e30621fb672c701531d4306a8 | [
"Apache-2.0"
] | 47 | 2016-05-29T20:48:37.000Z | 2021-11-12T09:40:40.000Z | """Remove thumbnail-legacy links
Revision ID: 652d9ba475f0
Revises: cc2f96b0ba35
Create Date: 2020-03-01 23:17:41.685935
"""
# revision identifiers, used by Alembic.
revision = '652d9ba475f0'
down_revision = 'cc2f96b0ba35'
from alembic import op
def upgrade():
op.execute("DELETE FROM submission_media_links WH... | 17.5 | 89 | 0.750649 |
fe91d09054278fc9604b1565855dd622211d30f9 | 24,435 | py | Python | delfin/tests/unit/drivers/hitachi/hnas/constants.py | guankc/delfin | 85c2ac90dba7042a9159f1d4e927020ea166f139 | [
"Apache-2.0"
] | 4 | 2020-05-07T07:43:43.000Z | 2020-06-21T15:25:42.000Z | delfin/tests/unit/drivers/hitachi/hnas/constants.py | guankc/delfin | 85c2ac90dba7042a9159f1d4e927020ea166f139 | [
"Apache-2.0"
] | 355 | 2021-03-03T03:50:00.000Z | 2022-03-14T11:43:18.000Z | delfin/tests/unit/drivers/hitachi/hnas/constants.py | guankc/delfin | 85c2ac90dba7042a9159f1d4e927020ea166f139 | [
"Apache-2.0"
] | 153 | 2021-03-10T09:32:08.000Z | 2022-02-22T01:32:32.000Z | # Copyright 2021 The SODA 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 require... | 29.054697 | 78 | 0.589482 |
96bc3b352b941f8a4e03e24f7866e3e9af0e1bb6 | 15,927 | py | Python | docs/conf_common.py | Grilla-Grills/esp-idf | c77c4ccf6c43ab09fd89e7c907bf5cf2a3499e3b | [
"Apache-2.0"
] | 1 | 2020-08-05T09:24:17.000Z | 2020-08-05T09:24:17.000Z | docs/conf_common.py | Grilla-Grills/esp-idf | c77c4ccf6c43ab09fd89e7c907bf5cf2a3499e3b | [
"Apache-2.0"
] | null | null | null | docs/conf_common.py | Grilla-Grills/esp-idf | c77c4ccf6c43ab09fd89e7c907bf5cf2a3499e3b | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Common (non-language-specific) configuration for Read The Docs & Sphinx
#
# Based on a Read the Docs Template documentation build configuration file,
# created by sphinx-quickstart on Tue Aug 26 14:19:49 2014.
#
# This file is imported from a language-specific conf.py (ie en/conf.py or
# zh_... | 34.775109 | 122 | 0.686444 |
c725c4dc6909653d7c53f22470af8578e2bc747e | 37,559 | py | Python | adafruit_rfm9x.py | lgnashold/Adafruit_CircuitPython_RFM9x | 9350b5d151444499ff022969d9299c8a202d8b7f | [
"MIT"
] | null | null | null | adafruit_rfm9x.py | lgnashold/Adafruit_CircuitPython_RFM9x | 9350b5d151444499ff022969d9299c8a202d8b7f | [
"MIT"
] | null | null | null | adafruit_rfm9x.py | lgnashold/Adafruit_CircuitPython_RFM9x | 9350b5d151444499ff022969d9299c8a202d8b7f | [
"MIT"
] | null | null | null | # The MIT License (MIT)
#
# Copyright (c) 2017 Tony DiCola for Adafruit Industries
#
# 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 righ... | 41.918527 | 100 | 0.637371 |
27058b21a545945730e445f15035cd0a4b75aefd | 8,262 | py | Python | redis_cache/rediscache.py | fjsj/redis-simple-cache | 95e2db870bb26121476c2a3dc2714b1ebad12152 | [
"BSD-3-Clause"
] | null | null | null | redis_cache/rediscache.py | fjsj/redis-simple-cache | 95e2db870bb26121476c2a3dc2714b1ebad12152 | [
"BSD-3-Clause"
] | 1 | 2016-02-22T07:39:12.000Z | 2016-02-22T07:45:54.000Z | redis_cache/rediscache.py | fjsj/redis-simple-cache | 95e2db870bb26121476c2a3dc2714b1ebad12152 | [
"BSD-3-Clause"
] | null | null | null | """
A simple redis-cache interface for storing python objects.
"""
from functools import wraps
import pickle
import json
import base64
import hashlib
import redis
import logging
class RedisConnect(object):
'''
A simple object to store and pass database connection information.
This makes the Simple Cache cl... | 34.282158 | 110 | 0.600944 |
545b3f6bac890fe4888f50c316e75ae22889e257 | 3,354 | py | Python | main.py | feicccccccc/DQN_Pytorch | 524b1870698873c4c1e72cfa37ba0d341551ffdb | [
"MIT"
] | null | null | null | main.py | feicccccccc/DQN_Pytorch | 524b1870698873c4c1e72cfa37ba0d341551ffdb | [
"MIT"
] | null | null | null | main.py | feicccccccc/DQN_Pytorch | 524b1870698873c4c1e72cfa37ba0d341551ffdb | [
"MIT"
] | null | null | null | """
Reference and credit:
https://www.youtube.com/watch?v=UlJzzLYgYoE
Main loop
Slightly change to the network layer structure and parameter naming
Change gym wrapper and observation
Add a lot of comment for reference
"""
import gym
import numpy as np
from agent import DQNAgent
from utils import plot_learning_curve, ... | 34.57732 | 100 | 0.607335 |
d80354a9400ef8db18141157402d858b7336aaa8 | 9,565 | py | Python | package_managers/security_check.py | mikekamornikov/base-images-docker | 10df42be69f0c4afc87f0df9a0b35fcfb43b5854 | [
"Apache-2.0"
] | null | null | null | package_managers/security_check.py | mikekamornikov/base-images-docker | 10df42be69f0c4afc87f0df9a0b35fcfb43b5854 | [
"Apache-2.0"
] | null | null | null | package_managers/security_check.py | mikekamornikov/base-images-docker | 10df42be69f0c4afc87f0df9a0b35fcfb43b5854 | [
"Apache-2.0"
] | null | null | null | """Checks the specified image for security vulnerabilities."""
import argparse
import json
import subprocess
import sys
import logging
import yaml
import distutils.version as ver
# Severities
_LOW = 'LOW'
_MEDIUM = 'MEDIUM'
_HIGH = 'HIGH'
_CRITICAL = 'CRITICAL'
_SEV_MAP = {
_LOW: 0,
_MEDIUM: 1,
_HIGH: ... | 28.897281 | 84 | 0.670988 |
c930346c1f32441029007a6292a2b92c85ec9bfd | 2,875 | py | Python | mdsimulator/obsolete_code/mcmc.py | Marsll/md-simulator | 8c1853420a8dd94da0c440ea359c251dd10413bb | [
"Apache-2.0"
] | 1 | 2021-12-29T22:20:57.000Z | 2021-12-29T22:20:57.000Z | mdsimulator/obsolete_code/mcmc.py | Marsll/md-simulator | 8c1853420a8dd94da0c440ea359c251dd10413bb | [
"Apache-2.0"
] | null | null | null | mdsimulator/obsolete_code/mcmc.py | Marsll/md-simulator | 8c1853420a8dd94da0c440ea359c251dd10413bb | [
"Apache-2.0"
] | 4 | 2017-12-11T10:58:11.000Z | 2021-12-29T22:21:03.000Z | import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import axes3d
from neighbor_list import NeighborList
import scipy.spatial.distance as dist
from lennard_jones import all_lennard_jones_potential
from cell_order import create_cell_order
def mcmc_step(ppos, dims, r_cut, nbs=None, nl=None, a... | 27.644231 | 86 | 0.609043 |
231ed0b23b4e5453bc5767206d0d220c15a92963 | 397 | py | Python | test/test_configwidget.py | hueyjj/Cherry | e81de5e04380a036f15f875101e724b583cc2312 | [
"MIT"
] | null | null | null | test/test_configwidget.py | hueyjj/Cherry | e81de5e04380a036f15f875101e724b583cc2312 | [
"MIT"
] | null | null | null | test/test_configwidget.py | hueyjj/Cherry | e81de5e04380a036f15f875101e724b583cc2312 | [
"MIT"
] | null | null | null | from PyQt5 import (
QtWidgets,
)
from PyQt5.QtWidgets import (
QApplication,
)
import sys
import os
sys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from cherry_dl.gui.config import Config
if __name__ == '__main__':
import sys
app = QApplication(sys.a... | 17.26087 | 80 | 0.649874 |
984c6e3f6f89eb4fe200e7474324ea131da1c8f0 | 620 | py | Python | users/rules.py | gafderks/dbase | 4089cf220740afd7fcc0ae68fcd6185829a60eae | [
"Apache-2.0"
] | null | null | null | users/rules.py | gafderks/dbase | 4089cf220740afd7fcc0ae68fcd6185829a60eae | [
"Apache-2.0"
] | 281 | 2020-04-03T15:22:46.000Z | 2022-03-31T20:53:28.000Z | users/rules.py | gafderks/dbase | 4089cf220740afd7fcc0ae68fcd6185829a60eae | [
"Apache-2.0"
] | null | null | null | import rules
@rules.predicate
def is_own_group(user, group):
"""
Check whether a user belongs to a specified group.
:param User user:
:param Group group: use None for all groups
:return: bool
"""
if group is None:
return False
return user.group == group
@rules.predicate
def v... | 22.142857 | 79 | 0.659677 |
34a7e88b91436ee9c5eb75759c08d9cce8f5c3dd | 798 | py | Python | tests/programs/absolute_import/foobar/__init__.py | augustand/Nuitka | b7b9dd50b60505a309f430ce17cad36fb7d75048 | [
"Apache-2.0"
] | null | null | null | tests/programs/absolute_import/foobar/__init__.py | augustand/Nuitka | b7b9dd50b60505a309f430ce17cad36fb7d75048 | [
"Apache-2.0"
] | null | null | null | tests/programs/absolute_import/foobar/__init__.py | augustand/Nuitka | b7b9dd50b60505a309f430ce17cad36fb7d75048 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Python tests originally created or extracted from other peoples work. The
# parts were too small to be protected.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the ... | 38 | 79 | 0.718045 |
510ad169e2726470de245ea37bc81319fbd265d2 | 3,869 | py | Python | TechnicalAnalysis/lstm_technical.py | ShobhitLamba/Stocker | a0d97e58faa7a04df500cc3aa11498b839991fcf | [
"MIT"
] | null | null | null | TechnicalAnalysis/lstm_technical.py | ShobhitLamba/Stocker | a0d97e58faa7a04df500cc3aa11498b839991fcf | [
"MIT"
] | null | null | null | TechnicalAnalysis/lstm_technical.py | ShobhitLamba/Stocker | a0d97e58faa7a04df500cc3aa11498b839991fcf | [
"MIT"
] | null | null | null | #Part 1 - Data Preprocessing
#Importing the libraries
import numpy as np
import pandas as pd
#from keras.utils import to_categorical
#Importing the training set
dataset_train = pd.read_csv('Datasets/BRK_fin_train.csv')
fin_data = dataset_train.iloc[:, 7:13].values
training_set = dataset_train.iloc[:, 4:5].values
#Fe... | 28.659259 | 90 | 0.704575 |
06482367abb1ed7c90c9462f63556a19409f0b22 | 3,981 | py | Python | sites/root/pysvr/svr.py | justletterh/hreqdotxyz | 6f56bb3c6f9e1a0475b5ac3995ec02c083db17e9 | [
"CC0-1.0"
] | null | null | null | sites/root/pysvr/svr.py | justletterh/hreqdotxyz | 6f56bb3c6f9e1a0475b5ac3995ec02c083db17e9 | [
"CC0-1.0"
] | null | null | null | sites/root/pysvr/svr.py | justletterh/hreqdotxyz | 6f56bb3c6f9e1a0475b5ac3995ec02c083db17e9 | [
"CC0-1.0"
] | null | null | null | from aiohttp import web
import psutil
import platform
from datetime import datetime
import sys
import subprocess
import asyncio
def get_size(bytes, suffix="B"):
"""
Scale bytes to its proper format
e.g:
1253656 => '1.20MB'
1253656678 => '1.17GB'
"""
factor = 1024
for unit in ["",... | 41.041237 | 144 | 0.583522 |
d0899428ddae7ec7cbacbcba6df1643c51b7e918 | 4,270 | py | Python | datasets/ms_terms/ms_terms.py | zidingz/datasets | 02edd9ebc79f715adb1c718d1439fda83dc356f1 | [
"Apache-2.0"
] | 2 | 2021-11-14T09:11:43.000Z | 2021-11-14T10:07:49.000Z | datasets/ms_terms/ms_terms.py | zidingz/datasets | 02edd9ebc79f715adb1c718d1439fda83dc356f1 | [
"Apache-2.0"
] | 8 | 2021-10-01T12:00:18.000Z | 2021-10-08T18:50:05.000Z | datasets/ms_terms/ms_terms.py | zidingz/datasets | 02edd9ebc79f715adb1c718d1439fda83dc356f1 | [
"Apache-2.0"
] | 4 | 2021-07-25T17:09:39.000Z | 2022-02-12T03:30:08.000Z | # coding=utf-8
# Copyright 2020 The HuggingFace Datasets Authors and the current dataset script contributor.
#
# 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/lice... | 41.862745 | 196 | 0.689461 |
25d8a6f61e742af12eba152f009869f2e1f9fe11 | 1,208 | py | Python | job_trigger.py | ppiorunski/p4python | 1047fdb1b45cf1129f8271f75ded3669d6e74607 | [
"BSD-3-Clause"
] | null | null | null | job_trigger.py | ppiorunski/p4python | 1047fdb1b45cf1129f8271f75ded3669d6e74607 | [
"BSD-3-Clause"
] | null | null | null | job_trigger.py | ppiorunski/p4python | 1047fdb1b45cf1129f8271f75ded3669d6e74607 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import print_function
import glob, sys, os
pathToBuild = glob.glob('../build/lib*')
if len(pathToBuild) > 0:
versionString = "%d.%d" % (sys.version_info[0], sys.version_info[1])
for i in pathToBuild:
if versionString in i:
sys.path.insert(0, os.p... | 24.16 | 76 | 0.594371 |
a07199b4cb51ce0cd901d442b6f8c7a7ed3134fd | 3,704 | py | Python | zhihu_img_spaider/zhihu_spider.py | saberbin/small_spider | d3c14681a5bb2b068fe5afb23d637d21b8fa76aa | [
"Apache-2.0"
] | null | null | null | zhihu_img_spaider/zhihu_spider.py | saberbin/small_spider | d3c14681a5bb2b068fe5afb23d637d21b8fa76aa | [
"Apache-2.0"
] | null | null | null | zhihu_img_spaider/zhihu_spider.py | saberbin/small_spider | d3c14681a5bb2b068fe5afb23d637d21b8fa76aa | [
"Apache-2.0"
] | null | null | null | import random
import time
import requests
from bs4 import BeautifulSoup
import os
# 请求头
HEADERS = (
'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 Safari/537.36',
'Opera/9.80 (Windows NT 6.0) Presto/2.12.388 Version/12.14',
'Mozilla/5.0 (Windows NT 6... | 26.457143 | 131 | 0.6277 |
89eafa1f83ca26b0d61763b8ce49a8a9c482e95e | 3,278 | py | Python | pebble_tool/commands/transcription_server.py | tulth/pebble-tool | 8b4771bbd7f8dacc8cbe776aaaf0aa704e152f9f | [
"MIT"
] | 24 | 2015-07-25T07:36:23.000Z | 2020-11-05T13:55:06.000Z | pebble_tool/commands/transcription_server.py | tulth/pebble-tool | 8b4771bbd7f8dacc8cbe776aaaf0aa704e152f9f | [
"MIT"
] | 21 | 2015-08-11T19:55:57.000Z | 2020-05-01T14:07:45.000Z | pebble_tool/commands/transcription_server.py | tulth/pebble-tool | 8b4771bbd7f8dacc8cbe776aaaf0aa704e152f9f | [
"MIT"
] | 39 | 2015-10-04T06:21:52.000Z | 2021-12-22T00:36:34.000Z | __author__ = 'andrews'
from enum import IntEnum
from time import sleep
import threading
import re
import logging
from libpebble2.services.voice import *
from .base import PebbleCommand
logger = logging.getLogger("pebble_tool.commands.transcription_server")
mapping = {
'connectivity': TranscriptionResult.FailNo... | 35.630435 | 114 | 0.655278 |
7000222fba9b15c2ea27806d7fca6f997528819e | 2,049 | py | Python | src/main/devrepo/register.py | random-python/devrepo | 4917c2d55e16d4942c6d8f4b2c57138822e3cfcc | [
"Apache-2.0"
] | 1 | 2020-06-20T15:18:17.000Z | 2020-06-20T15:18:17.000Z | src/main/devrepo/register.py | random-python/devrepo | 4917c2d55e16d4942c6d8f4b2c57138822e3cfcc | [
"Apache-2.0"
] | null | null | null | src/main/devrepo/register.py | random-python/devrepo | 4917c2d55e16d4942c6d8f4b2c57138822e3cfcc | [
"Apache-2.0"
] | null | null | null | """
Repository manager
"""
import os
import sys
import inspect
import logging
from devrepo.config import CONFIG
logger = logging.getLogger(__name__)
def env_get(name: str) -> str:
return os.environ.get(name, None)
def env_set(name: str, value: str) -> None:
os.environ[name] = value
class PythonPath():
... | 26.269231 | 71 | 0.681308 |
b01881e33decb15009d588ee6f02bba8c6149366 | 1,705 | py | Python | src/cfnlint/rules/functions/Base64.py | joenye/cfn-python-lint | 837aac504c58fca4a8ca0211bc57ec920c772bb4 | [
"MIT-0"
] | 1 | 2020-05-08T20:12:31.000Z | 2020-05-08T20:12:31.000Z | src/cfnlint/rules/functions/Base64.py | joenye/cfn-python-lint | 837aac504c58fca4a8ca0211bc57ec920c772bb4 | [
"MIT-0"
] | null | null | null | src/cfnlint/rules/functions/Base64.py | joenye/cfn-python-lint | 837aac504c58fca4a8ca0211bc57ec920c772bb4 | [
"MIT-0"
] | null | null | null | """
Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
SPDX-License-Identifier: MIT-0
"""
import six
from cfnlint.rules import CloudFormationLintRule
from cfnlint.rules import RuleMatch
class Base64(CloudFormationLintRule):
"""Check if Base64 values are correct"""
id = 'E1021'
shortdesc = ... | 38.75 | 122 | 0.565396 |
98023b70c231af05199ed6e8d86a27b1b2f45883 | 1,898 | py | Python | test/test_AliasParser.py | rg911/catbuffer | a5eeb103d55fede452d8f1f4bb65a447a4c373e8 | [
"MIT"
] | 1 | 2019-08-18T15:12:29.000Z | 2019-08-18T15:12:29.000Z | test/test_AliasParser.py | rg911/catbuffer | a5eeb103d55fede452d8f1f4bb65a447a4c373e8 | [
"MIT"
] | 1 | 2019-08-06T23:06:02.000Z | 2019-08-06T23:06:02.000Z | test/test_AliasParser.py | rg911/catbuffer | a5eeb103d55fede452d8f1f4bb65a447a4c373e8 | [
"MIT"
] | null | null | null | # pylint: disable=invalid-name
import unittest
from test.constants import BUILTIN_TYPE_TUPLES, VALID_USER_TYPE_NAMES, INVALID_USER_TYPE_NAMES
from test.ParserTestUtils import SingleLineParserTestUtils, ParserFactoryTestUtils
from catparser.AliasParser import AliasParserFactory
class AliasParserFactoryTest(unittest.Te... | 42.177778 | 108 | 0.674921 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.