hexsha stringlengths 40 40 | size int64 2 1.05M | ext stringclasses 9
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 193 | max_stars_repo_name stringlengths 6 109 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 36.6k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 193 | max_issues_repo_name stringlengths 6 109 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 29.8k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 193 | max_forks_repo_name stringlengths 6 109 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 11.2k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 2 1.05M | avg_line_length float64 1 404k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9e2ed47308ceb5e8df0540100002ffe4c7587c1a | 5,534 | py | Python | test_agents/Karpathy/agent.py | jesuscopado/RL-pong-project | 2607a1d8cdfa3d5dc9d089f343d2a6811719c1ab | [
"MIT"
] | 1 | 2020-11-17T22:17:56.000Z | 2020-11-17T22:17:56.000Z | test_agents/Karpathy/agent.py | jesuscopado/RL-pong-project | 2607a1d8cdfa3d5dc9d089f343d2a6811719c1ab | [
"MIT"
] | null | null | null | test_agents/Karpathy/agent.py | jesuscopado/RL-pong-project | 2607a1d8cdfa3d5dc9d089f343d2a6811719c1ab | [
"MIT"
] | null | null | null | import numpy as np
import pickle
def sigmoid(x):
return 1.0 / (1.0 + np.exp(-x)) # sigmoid "squashing" function to interval [0,1]
def prepro(I):
""" prepro 210x160x3 uint8 frame into 6400 (80x80) 1D float vector """
I = I[::2, ::2, 0] # downsample by factor of 2
I[I == 43] = 0 # erase background ... | 41.298507 | 112 | 0.614565 |
9e2f104fc108c7ddc4b9898e631ca1045d9bbd91 | 31,431 | py | Python | src/microengine/__init__.py | polyswarm/microengine | 3e8a2263ef7320e7c603177ddb9ef64fd659c324 | [
"MIT"
] | 3 | 2018-08-20T19:33:30.000Z | 2018-09-15T00:13:56.000Z | src/microengine/__init__.py | polyswarm/microengine | 3e8a2263ef7320e7c603177ddb9ef64fd659c324 | [
"MIT"
] | 10 | 2018-08-27T23:39:21.000Z | 2018-09-24T21:12:19.000Z | src/microengine/__init__.py | polyswarm/microengine | 3e8a2263ef7320e7c603177ddb9ef64fd659c324 | [
"MIT"
] | null | null | null | import aiohttp
import asyncio
import base58
import functools
import json
import logging
import sys
import websockets
from eth_account.messages import defunct_hash_message
from queue import PriorityQueue
from web3.auto import w3 as web3
from pprint import pprint, pformat
# These values come from the BountyRegistry cont... | 38.237226 | 246 | 0.624384 |
9e2f7b0cc4a497f01a4c6a0fab6eeec4ecf3fd13 | 1,808 | py | Python | homeassistant/components/ads/binary_sensor.py | marioedani/homeassistant-core | 2bc5db857ec6aa605ea7ff363654db2109f7cec4 | [
"Apache-2.0"
] | 7 | 2019-02-07T14:14:12.000Z | 2019-07-28T06:56:10.000Z | homeassistant/components/ads/binary_sensor.py | tomachristian/core | 71c8fcee20c55536b33c3ee774c76c1795f37cd2 | [
"Apache-2.0"
] | 6 | 2021-02-08T20:54:31.000Z | 2022-03-12T00:50:43.000Z | homeassistant/components/ads/binary_sensor.py | tomachristian/core | 71c8fcee20c55536b33c3ee774c76c1795f37cd2 | [
"Apache-2.0"
] | 2 | 2020-04-19T13:35:24.000Z | 2020-04-19T13:35:51.000Z | """Support for ADS binary sensors."""
import logging
import voluptuous as vol
from homeassistant.components.binary_sensor import (
DEVICE_CLASSES_SCHEMA,
PLATFORM_SCHEMA,
BinarySensorDevice,
)
from homeassistant.const import CONF_DEVICE_CLASS, CONF_NAME
import homeassistant.helpers.config_validation as cv... | 29.639344 | 85 | 0.721792 |
9e2fd446291031f96b9b5eb66d1598fe4888eda9 | 608 | py | Python | tests/test_dict.py | lgwillmore/typemock | cbde9e8f1388785998b72ee8d0420f083eaeea7c | [
"MIT"
] | 8 | 2019-06-11T12:16:06.000Z | 2022-03-22T12:58:30.000Z | tests/test_dict.py | lgwillmore/type-mock | cbde9e8f1388785998b72ee8d0420f083eaeea7c | [
"MIT"
] | 7 | 2019-06-16T19:16:46.000Z | 2020-12-08T20:44:02.000Z | tests/test_dict.py | lgwillmore/type-mock | cbde9e8f1388785998b72ee8d0420f083eaeea7c | [
"MIT"
] | 1 | 2022-03-22T13:00:03.000Z | 2022-03-22T13:00:03.000Z | from unittest import TestCase
from typemock._utils import InefficientUnHashableKeyDict
class TestInefficientHashableKeyDict(TestCase):
def test__put__get(self):
my_dict = InefficientUnHashableKeyDict()
list_key1 = [1, 2]
value1 = 1
list_key2 = [1, 3]
value2 = 2
... | 25.333333 | 62 | 0.672697 |
9e2fda3ed8949daf53715be4b369a353211188a4 | 11,659 | py | Python | core/core_model.py | YifanQie/Deep_Learning_for_Manufacturing | 9ba19e41f69c561b04b8573ab9c52c0969f45bfd | [
"MIT"
] | 27 | 2019-10-31T15:16:13.000Z | 2022-03-29T03:56:57.000Z | core/core_model.py | YifanQie/Deep_Learning_for_Manufacturing | 9ba19e41f69c561b04b8573ab9c52c0969f45bfd | [
"MIT"
] | 4 | 2020-03-25T14:18:04.000Z | 2022-02-10T00:34:58.000Z | core/core_model.py | YifanQie/Deep_Learning_for_Manufacturing | 9ba19e41f69c561b04b8573ab9c52c0969f45bfd | [
"MIT"
] | 7 | 2020-02-23T22:12:37.000Z | 2021-12-08T20:14:41.000Z | """ Contains core classes and methods for initializing the deep learning 3D CNN model with different variants of the loss function, inputs are provided from the modelconfig_train.py file"""
class DLModel:
""" Deep Learning Model Class
:param model_type: Type of model to be used for training 3D CNN with MSE loss, ... | 47.202429 | 251 | 0.748778 |
9e3012da1601e53605b75aa2db370cbdd0d3a0de | 3,740 | py | Python | montydb/engine/helpers.py | gitter-badger/MontyDB | 849d03dc2cfed35739481e9acb1ff0bd8095c91b | [
"BSD-3-Clause"
] | null | null | null | montydb/engine/helpers.py | gitter-badger/MontyDB | 849d03dc2cfed35739481e9acb1ff0bd8095c91b | [
"BSD-3-Clause"
] | null | null | null | montydb/engine/helpers.py | gitter-badger/MontyDB | 849d03dc2cfed35739481e9acb1ff0bd8095c91b | [
"BSD-3-Clause"
] | null | null | null |
import sys
import platform
import re
from bson.py3compat import integer_types
from bson.int64 import Int64
from bson.decimal128 import Decimal128
FS_ENCODE = sys.getfilesystemencoding()
PY3 = sys.version_info[0] == 3
if PY3:
from itertools import zip_longest
else:
from itertools import izip_longest as zip_... | 25.100671 | 78 | 0.645187 |
9e304ca39f125d59bca54bf54a9735e50dcb1cb3 | 2,671 | py | Python | budget-rnn/src/layers/cells/standard_rnn_cells.py | tejaskannan/ml-models | ad5acad2c0ce75773062ffcdff088a6fbe5ffc17 | [
"Apache-2.0"
] | 1 | 2021-06-28T15:40:41.000Z | 2021-06-28T15:40:41.000Z | budget-rnn/src/layers/cells/standard_rnn_cells.py | tejaskannan/ml-models | ad5acad2c0ce75773062ffcdff088a6fbe5ffc17 | [
"Apache-2.0"
] | 5 | 2021-03-04T19:42:15.000Z | 2022-02-10T05:46:15.000Z | budget-rnn/src/layers/cells/standard_rnn_cells.py | tejaskannan/budget-rnn | ad5acad2c0ce75773062ffcdff088a6fbe5ffc17 | [
"Apache-2.0"
] | null | null | null | """
This file contains a collection of standard RNN cells.
"""
import tensorflow as tf
from typing import Optional, Tuple, Any
from utils.tfutils import get_activation, apply_noise
from .cell_utils import ugrnn
class UGRNNCell(tf.compat.v1.nn.rnn_cell.RNNCell):
def __init__(self, units: int, activation: str, na... | 43.786885 | 113 | 0.534257 |
9e305d51a5c08a7075eba5d39488db8988dd93ad | 22,372 | py | Python | jina/peapods/pods/__init__.py | Rohitpandit021/jina | f3db4d5e480375d8dc3bceda814ac1963dee76d7 | [
"Apache-2.0"
] | null | null | null | jina/peapods/pods/__init__.py | Rohitpandit021/jina | f3db4d5e480375d8dc3bceda814ac1963dee76d7 | [
"Apache-2.0"
] | null | null | null | jina/peapods/pods/__init__.py | Rohitpandit021/jina | f3db4d5e480375d8dc3bceda814ac1963dee76d7 | [
"Apache-2.0"
] | null | null | null | import copy
import sys
from abc import abstractmethod
from argparse import Namespace
from contextlib import ExitStack
from itertools import cycle
from typing import Dict, Union, Set
from typing import List, Optional
from ..peas import BasePea
from ... import __default_host__, __default_executor__
from ... import helpe... | 32.612245 | 119 | 0.580324 |
9e306bdb2e77eebf7262593da70a24d43f21ada1 | 337 | py | Python | KSFD/ksfddebug.py | leonavery/KSFD | 090e388df13a2674676cbaa53171f2a87291ba9b | [
"MIT"
] | null | null | null | KSFD/ksfddebug.py | leonavery/KSFD | 090e388df13a2674676cbaa53171f2a87291ba9b | [
"MIT"
] | null | null | null | KSFD/ksfddebug.py | leonavery/KSFD | 090e388df13a2674676cbaa53171f2a87291ba9b | [
"MIT"
] | null | null | null | import os
from mpi4py import MPI
def log(*args, system = 'KSFD', **kwargs):
comm = MPI.COMM_WORLD
rank = comm.rank
systems = set(os.getenv('KSFDDEBUG', default='').split(':'))
if system in systems or 'ALL' in systems:
print('{system}, rank={rank}:'.format(system=system, rank=rank), *args, flush... | 33.7 | 101 | 0.64095 |
9e3093a83391390c4c4d29826d87e60082ff7b49 | 962 | py | Python | rpc/rdguard_client.py | glstr/python_learning | 243908d6f358764386f2e58dfbfde10a406d803c | [
"Apache-2.0"
] | 2 | 2018-09-20T06:08:00.000Z | 2018-09-26T13:57:20.000Z | rpc/rdguard_client.py | glstr/python_learning | 243908d6f358764386f2e58dfbfde10a406d803c | [
"Apache-2.0"
] | null | null | null | rpc/rdguard_client.py | glstr/python_learning | 243908d6f358764386f2e58dfbfde10a406d803c | [
"Apache-2.0"
] | 1 | 2019-03-25T05:53:32.000Z | 2019-03-25T05:53:32.000Z | #! /bin/python
# encoding=utf-8
import grpc
import rdguard_pb2
import rdguard_pb2_grpc
from pprint import pprint
addr = "10.100.57.125:8765"
def hello():
with grpc.insecure_channel(addr) as channel:
stub = rdguard_pb2_grpc.GuarderStub(channel)
res = stub.SayHello(rdguard_pb2.HelloRequest(nam... | 21.863636 | 65 | 0.607069 |
9e309841d92b9cae2f0431af2409e0f750002a92 | 2,845 | py | Python | ml/preprocessing/sampling.py | refactoring-ai/Machine-Learning | 908d35322a06a7b1709d83f731033a939a864c6b | [
"MIT"
] | 5 | 2020-09-02T19:46:37.000Z | 2021-04-21T15:41:11.000Z | ml/preprocessing/sampling.py | refactoring-ai/Machine-Learning | 908d35322a06a7b1709d83f731033a939a864c6b | [
"MIT"
] | 16 | 2020-08-04T08:07:50.000Z | 2021-03-23T08:15:30.000Z | ml/preprocessing/sampling.py | refactoring-ai/Machine-Learning | 908d35322a06a7b1709d83f731033a939a864c6b | [
"MIT"
] | 1 | 2021-04-17T18:34:47.000Z | 2021-04-17T18:34:47.000Z | import pandas as pd
from imblearn.over_sampling import RandomOverSampler
from imblearn.under_sampling import RandomUnderSampler,\
ClusterCentroids, NearMiss
from configs import BALANCE_DATASET_STRATEGY, CORE_COUNT, SEED
from utils.log import log
def sample_reduction(positive_samples, negative_samples, ratio: floa... | 38.445946 | 79 | 0.68471 |
9e309bbf91b5933add5466c785198ab3c16b20c9 | 12,585 | py | Python | collections/ansible_collections/community/general/plugins/modules/source_control/gitlab/gitlab_group.py | escalate/my-smart-home | a9579c845761b980515ff34d2a95568c6e7c2b6c | [
"MIT"
] | null | null | null | collections/ansible_collections/community/general/plugins/modules/source_control/gitlab/gitlab_group.py | escalate/my-smart-home | a9579c845761b980515ff34d2a95568c6e7c2b6c | [
"MIT"
] | null | null | null | collections/ansible_collections/community/general/plugins/modules/source_control/gitlab/gitlab_group.py | escalate/my-smart-home | a9579c845761b980515ff34d2a95568c6e7c2b6c | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2019, Guillaume Martinez (lunik@tiwabbit.fr)
# Copyright: (c) 2015, Werner Dijkerman (ikben@werner-dijkerman.nl)
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, pri... | 32.773438 | 147 | 0.659436 |
9e309e8ff591840c5fc94450a02458f53852aa01 | 923 | py | Python | removeTradeYears.py | 1wheel/nbadraft | 28d5cfa39e23e2d2f60cfaf417a42a18cfe1a453 | [
"MIT"
] | 2 | 2015-04-03T15:19:05.000Z | 2017-06-18T10:13:33.000Z | removeTradeYears.py | 1wheel/nbadraft | 28d5cfa39e23e2d2f60cfaf417a42a18cfe1a453 | [
"MIT"
] | null | null | null | removeTradeYears.py | 1wheel/nbadraft | 28d5cfa39e23e2d2f60cfaf417a42a18cfe1a453 | [
"MIT"
] | null | null | null | import json
with open('webpage/drafts.json') as data_file:
drafts = json.load(data_file)
for draft in drafts:
for player in draft['players']:
if 'stats' in player:
s = player['stats'];
for i in range(0, len(s)):
for j in range(0, len(s)):
if i != j:
if s[i]['year'] == s[j]['year'] and int... | 26.371429 | 145 | 0.487541 |
9e30a7a26f911d2a1cf12a2affc109daf7dc88e9 | 6,990 | py | Python | devel/lib/python2.7/dist-packages/ros_sharp/msg/_DefaultWandState.py | FProgrammerLIU/caster_man_ros | a75b503fad3a470f985072a2b3953e89074f3223 | [
"MIT"
] | null | null | null | devel/lib/python2.7/dist-packages/ros_sharp/msg/_DefaultWandState.py | FProgrammerLIU/caster_man_ros | a75b503fad3a470f985072a2b3953e89074f3223 | [
"MIT"
] | null | null | null | devel/lib/python2.7/dist-packages/ros_sharp/msg/_DefaultWandState.py | FProgrammerLIU/caster_man_ros | a75b503fad3a470f985072a2b3953e89074f3223 | [
"MIT"
] | null | null | null | # This Python file uses the following encoding: utf-8
"""autogenerated by genpy from ros_sharp/DefaultWandState.msg. Do not edit."""
import sys
python3 = True if sys.hexversion > 0x03000000 else False
import genpy
import struct
import std_msgs.msg
class DefaultWandState(genpy.Message):
_md5sum = "bf1f2c253811164620... | 35.125628 | 145 | 0.650358 |
9e30b66ff7c14b4da021909056df38a021fa41e9 | 2,478 | py | Python | setup.py | shawwn/tpunicorn | 455ff07598e6698d08ec7eff1711874a0b9c6c6f | [
"BSD-2-Clause"
] | 53 | 2020-06-28T08:38:37.000Z | 2022-03-30T16:37:15.000Z | setup.py | shawwn/tpudiepie | 455ff07598e6698d08ec7eff1711874a0b9c6c6f | [
"BSD-2-Clause"
] | 3 | 2020-09-02T00:51:04.000Z | 2021-08-06T19:15:17.000Z | setup.py | shawwn/tpudiepie | 455ff07598e6698d08ec7eff1711874a0b9c6c6f | [
"BSD-2-Clause"
] | 5 | 2020-08-04T17:56:04.000Z | 2022-02-11T19:29:51.000Z | #!/usr/bin/env python3
import setuptools
import os
package_name = "tpunicorn"
packages = setuptools.find_packages(
include=[package_name, "{}.*".format(package_name)]
)
# Version info -- read without importing
_locals = {}
with open(os.path.join(package_name, "_version.py")) as fp:
exec(fp.read(), None, _loc... | 30.592593 | 73 | 0.613398 |
9e30bcb03d861ca177f1c965f3f142dd0bb78a54 | 523 | py | Python | aizythfinder/setup.py | reymond-group/CASP-and-dataset-performance | ee335a955a42318da24f2a18d7a5709b5fa03c5c | [
"MIT"
] | 18 | 2019-11-13T10:05:30.000Z | 2022-03-22T09:58:43.000Z | aizythfinder/setup.py | reymond-group/CASP-and-dataset-performance | ee335a955a42318da24f2a18d7a5709b5fa03c5c | [
"MIT"
] | 2 | 2020-02-24T10:54:45.000Z | 2021-03-02T09:59:28.000Z | aizythfinder/setup.py | reymond-group/CASP-and-dataset-performance | ee335a955a42318da24f2a18d7a5709b5fa03c5c | [
"MIT"
] | 11 | 2020-02-25T09:37:23.000Z | 2021-05-24T08:27:14.000Z | from setuptools import setup, find_packages
setup(name='aizynthfinder',
version='0.1',
description="""Retrosynthetic route finding using neural network guided Monte-Carlo tree search.""",
author='Esben Jannik Bjerrum',
author_email='esben.bjerrum@astrazeneca.com',
license='proprietary',
... | 32.6875 | 106 | 0.642447 |
9e30c5c16c18b86425a2ac9e3d9066f16c6cc060 | 568 | py | Python | swarm_ws/build/swarm_robot/catkin_generated/pkg.installspace.context.pc.py | Wei-Fan/SJTU-swarm | 95b93fa020a5168f150c6430cbc25884e03c22db | [
"MIT"
] | 2 | 2019-03-23T03:03:13.000Z | 2019-10-07T08:21:46.000Z | swarm_ws/build/swarm_robot/catkin_generated/pkg.installspace.context.pc.py | Wei-Fan/SJTU-swarm | 95b93fa020a5168f150c6430cbc25884e03c22db | [
"MIT"
] | null | null | null | swarm_ws/build/swarm_robot/catkin_generated/pkg.installspace.context.pc.py | Wei-Fan/SJTU-swarm | 95b93fa020a5168f150c6430cbc25884e03c22db | [
"MIT"
] | null | null | null | # generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "/home/wade/SJTU-swarm/swarm_ws/install/include".split(';') if "/home/wade/SJTU-swarm/swarm_ws/install/include" != "" else []
PROJECT_CATKIN_DEPENDS = "geometry_msgs;roscpp;rospy;std_msgs;message_runtim... | 63.111111 | 159 | 0.765845 |
9e30cc295f0a4ae5b5e4502994e5509fc786f8f9 | 3,851 | py | Python | openstack_dashboard/dashboards/admin/users/tables.py | e/horizon | abbce256b68178ebf42816eb87303292212c1dfe | [
"Apache-2.0"
] | 2 | 2018-10-21T22:30:29.000Z | 2020-11-21T08:58:31.000Z | openstack_dashboard/dashboards/admin/users/tables.py | e/horizon | abbce256b68178ebf42816eb87303292212c1dfe | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/dashboards/admin/users/tables.py | e/horizon | abbce256b68178ebf42816eb87303292212c1dfe | [
"Apache-2.0"
] | null | null | null | import logging
from django.template import defaultfilters
from django.utils.translation import ugettext_lazy as _
from horizon import messages
from horizon import tables
from openstack_dashboard import api
LOG = logging.getLogger(__name__)
ENABLE = 0
DISABLE = 1
class CreateUserLink(tables.LinkAction):
name... | 31.308943 | 77 | 0.621397 |
9e30d2fbeedc137f42b663c3aca6f8022fbf0a82 | 100 | py | Python | cli/app.py | laith43d/juju-survey | 3c23203fda6042b2316f1cf06bd18e16e4ddde5d | [
"MIT"
] | null | null | null | cli/app.py | laith43d/juju-survey | 3c23203fda6042b2316f1cf06bd18e16e4ddde5d | [
"MIT"
] | null | null | null | cli/app.py | laith43d/juju-survey | 3c23203fda6042b2316f1cf06bd18e16e4ddde5d | [
"MIT"
] | null | null | null | from config.settings import app
def main():
app.run()
if __name__ == '__main__':
main()
| 10 | 31 | 0.62 |
9e30f6110eb799a5bd289e0c686b5974d2c215ca | 13,156 | py | Python | cinder/tests/unit/volume/test_init_host.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/volume/test_init_host.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | null | null | null | cinder/tests/unit/volume/test_init_host.py | mail2nsrajesh/cinder | a688b872bec6d1abd4dcd852bdb8e8a921369d2e | [
"Apache-2.0"
] | null | null | null | # Copyright 2010 United States Government as represented by the
# Administrator of the National Aeronautics and Space Administration.
# 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 ... | 49.089552 | 79 | 0.648981 |
9e314b9446ee253eb5c8d89af46c1445349e79ef | 735 | py | Python | bridger/serializers/fields/other.py | intellineers/django-bridger | ed097984a99df7da40a4d01bd00c56e3c6083056 | [
"BSD-3-Clause"
] | 2 | 2020-03-17T00:53:23.000Z | 2020-07-16T07:00:33.000Z | bridger/serializers/fields/other.py | intellineers/django-bridger | ed097984a99df7da40a4d01bd00c56e3c6083056 | [
"BSD-3-Clause"
] | 76 | 2019-12-05T01:15:57.000Z | 2021-09-07T16:47:27.000Z | bridger/serializers/fields/other.py | intellineers/django-bridger | ed097984a99df7da40a4d01bd00c56e3c6083056 | [
"BSD-3-Clause"
] | 1 | 2020-02-05T15:09:47.000Z | 2020-02-05T15:09:47.000Z | # TODO: Most likely to be removed
from rest_framework import serializers
from .mixins import BridgerSerializerFieldMixin
from .number import IntegerField
from .types import BridgerType, ReturnContentType
class StarRatingField(IntegerField):
field_type = "starrating"
class RangeSelectField(BridgerSerializerFiel... | 30.625 | 76 | 0.738776 |
9e315d4117caa1aa4eb8bd5e29fc17e5d795dafd | 11,354 | py | Python | leetcode_python/Tree/boundary-of-binary-tree.py | yennanliu/CS_basics | 3c50c819897a572ff38179bfb0083a19b2325fde | [
"Unlicense"
] | 18 | 2019-08-01T07:45:02.000Z | 2022-03-31T18:05:44.000Z | leetcode_python/Tree/boundary-of-binary-tree.py | yennanliu/CS_basics | 3c50c819897a572ff38179bfb0083a19b2325fde | [
"Unlicense"
] | null | null | null | leetcode_python/Tree/boundary-of-binary-tree.py | yennanliu/CS_basics | 3c50c819897a572ff38179bfb0083a19b2325fde | [
"Unlicense"
] | 15 | 2019-12-29T08:46:20.000Z | 2022-03-08T14:14:05.000Z | """
545. Boundary of Binary Tree (Medium)
https://xiaoguan.gitbooks.io/leetcode/content/LeetCode/545-boundary-of-binary-tree-medium.html
Given a binary tree, return the values of its boundary in anti-clockwise direction starting from root. Boundary includes left boundary, leaves, and right boundary in order without ... | 31.715084 | 347 | 0.569579 |
9e3161b188d947634d443c054fb617da81fc7bda | 718 | py | Python | timerdeco.py | spencerpomme/coconuts-on-fire | 407d61b3583c472707a4e7b077a9a3ab12743996 | [
"Apache-2.0"
] | 1 | 2015-04-23T11:43:26.000Z | 2015-04-23T11:43:26.000Z | timerdeco.py | spencerpomme/coconuts-on-fire | 407d61b3583c472707a4e7b077a9a3ab12743996 | [
"Apache-2.0"
] | null | null | null | timerdeco.py | spencerpomme/coconuts-on-fire | 407d61b3583c472707a4e7b077a9a3ab12743996 | [
"Apache-2.0"
] | null | null | null | import time
import random
def timer(calls=1):
def decorator(func):
def wrapper(*args):
t1 = time.time()
for i in range(calls):
func(*args)
t2 = time.time()
print(t2 - t1)
return wrapper
return decorator
# demos:
if __name__ == "__... | 19.405405 | 78 | 0.509749 |
9e31634e9ac56ac572fa7ef149a9e87c8d03b1c9 | 6,462 | py | Python | request.py | armiantos/CMPUT404-assignment-webserver | 7a70a56ed7b3d0ac7e2a34d072bfb432c6aae732 | [
"Apache-2.0"
] | null | null | null | request.py | armiantos/CMPUT404-assignment-webserver | 7a70a56ed7b3d0ac7e2a34d072bfb432c6aae732 | [
"Apache-2.0"
] | null | null | null | request.py | armiantos/CMPUT404-assignment-webserver | 7a70a56ed7b3d0ac7e2a34d072bfb432c6aae732 | [
"Apache-2.0"
] | null | null | null | import json
from socket import SHUT_WR, SocketType
from constants import DEFAULT_ENCODING, HTTP_METHODS, STATUS_CODES, TEXT_CONTENT_TYPES
from helpers import to_bytearray
BUFFER_SIZE = 1024
class Request:
"""
Wrapper class for HTTP requests that can be used to read and reply to requests
"""
def __in... | 35.9 | 134 | 0.612504 |
9e31850acf30629b3a5bc9832bce1304ca3f68cb | 872 | py | Python | setup.py | 3lnc/elasticsearch-adsl | c5b33f880f9075a60704f49ee1868243e12ee2a2 | [
"MIT"
] | null | null | null | setup.py | 3lnc/elasticsearch-adsl | c5b33f880f9075a60704f49ee1868243e12ee2a2 | [
"MIT"
] | null | null | null | setup.py | 3lnc/elasticsearch-adsl | c5b33f880f9075a60704f49ee1868243e12ee2a2 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
with open('README.md') as readme:
long_description = readme.read()
setup(
name='elasticsearch-adsl',
version="6.3.1.dev1",
author='Slam',
author_email='3lnc.slam@gmail.com',
description='Async interface for elasticsearch dsl',
long_description=l... | 25.647059 | 56 | 0.629587 |
9e318583a12227b6d911a4578e0b36ab892017c2 | 12,318 | py | Python | train.py | jindavid/OpenMatch | a40b9f72735ecfe439b4c0851861a86410331a5b | [
"MIT"
] | null | null | null | train.py | jindavid/OpenMatch | a40b9f72735ecfe439b4c0851861a86410331a5b | [
"MIT"
] | null | null | null | train.py | jindavid/OpenMatch | a40b9f72735ecfe439b4c0851861a86410331a5b | [
"MIT"
] | null | null | null | import argparse
import datetime
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.distributions import Categorical
from transformers import AutoTokenizer, get_linear_schedule_with_warmup
import OpenMatch as om
from transformers import AdamW
import torch.distributed as dist
from torch.utils... | 39.993506 | 175 | 0.630865 |
9e31a41d65f50722f91a86fb6baa22f59ee54a62 | 17,041 | py | Python | codes/3 title match/title_match_749/title_match_freshmovietrailer.py | QiyuanMa/trailer_research | 5276e0f422aeb9ef6bccb4ffd348a600dacc2f75 | [
"MIT"
] | null | null | null | codes/3 title match/title_match_749/title_match_freshmovietrailer.py | QiyuanMa/trailer_research | 5276e0f422aeb9ef6bccb4ffd348a600dacc2f75 | [
"MIT"
] | null | null | null | codes/3 title match/title_match_749/title_match_freshmovietrailer.py | QiyuanMa/trailer_research | 5276e0f422aeb9ef6bccb4ffd348a600dacc2f75 | [
"MIT"
] | 1 | 2020-12-14T04:56:43.000Z | 2020-12-14T04:56:43.000Z | import json
import re
from title_match_749.datamanage_freshmovietrailer import DataManager
db = DataManager()
def load_trailer():
with open(r'C:\Users\student\Desktop\freshmovietrailer_movie_trailer_merged_info.json', 'r', encoding='utf8') as trailer:
trailer_data = json.load(trailer)
r... | 52.273006 | 141 | 0.601021 |
9e31be00b45783e1d84ea4cfae70eeddbd2bebb2 | 3,783 | py | Python | chroma_core/services/plugin_runner/__init__.py | AlexTalker/integrated-manager-for-lustre | 251099e5c776f3c1898af50bb7cc77924c7cf7c7 | [
"MIT"
] | 1 | 2021-02-08T16:59:14.000Z | 2021-02-08T16:59:14.000Z | chroma_core/services/plugin_runner/__init__.py | AlexTalker/integrated-manager-for-lustre | 251099e5c776f3c1898af50bb7cc77924c7cf7c7 | [
"MIT"
] | null | null | null | chroma_core/services/plugin_runner/__init__.py | AlexTalker/integrated-manager-for-lustre | 251099e5c776f3c1898af50bb7cc77924c7cf7c7 | [
"MIT"
] | null | null | null | # Copyright (c) 2018 DDN. All rights reserved.
# Use of this source code is governed by a MIT-style
# license that can be found in the LICENSE file.
import threading
from django.db import transaction
from chroma_core.services import ChromaService, ServiceThread
from chroma_core.services.plugin_runner.resource_manager... | 39.40625 | 101 | 0.713719 |
9e31e2fa378b84a084e7841700ac97dff2ceffaf | 2,539 | py | Python | sphinx.py | nemec/Automaton | eea2f89dc10031fba45c80eb63053480dfc3543f | [
"MIT"
] | 6 | 2016-01-05T09:14:57.000Z | 2021-05-17T20:46:46.000Z | sphinx.py | nemec/Automaton | eea2f89dc10031fba45c80eb63053480dfc3543f | [
"MIT"
] | null | null | null | sphinx.py | nemec/Automaton | eea2f89dc10031fba45c80eb63053480dfc3543f | [
"MIT"
] | 1 | 2018-12-18T02:37:24.000Z | 2018-12-18T02:37:24.000Z | #!/usr/bin/env/python
#
# Original script by: Yu-Jie Lin
# http://sites.google.com/site/livibetter/
import os
import time
import audioop
import subprocess
import alsaaudio as alsa
import pocketsphinx as ps
import automaton.client.pyro as thrift_client
import automaton.lib.exceptions as exceptions
filename = 'audio... | 27.010638 | 72 | 0.691611 |
9e31f315cc872ce481b1a183384f0fcfea436c58 | 2,197 | py | Python | pystashlog/secure_connection.py | wuriyanto48/pystashlog | 1ab30c79fdf8ae780c9c564321a5dfe1758815ae | [
"MIT"
] | 1 | 2020-11-05T07:14:21.000Z | 2020-11-05T07:14:21.000Z | pystashlog/secure_connection.py | wuriyanto48/pystashlog | 1ab30c79fdf8ae780c9c564321a5dfe1758815ae | [
"MIT"
] | null | null | null | pystashlog/secure_connection.py | wuriyanto48/pystashlog | 1ab30c79fdf8ae780c9c564321a5dfe1758815ae | [
"MIT"
] | null | null | null |
from pystashlog.exceptions import (
StashError,
ConnectionError,
TimeoutError,
)
from pystashlog.connection import Connection
from pystashlog.logger import logger as log
# check ssl support
try:
import ssl
ssl_available = True
except ImportError:
ssl_available = False
STATUS_CONNECTING_TO_... | 33.287879 | 108 | 0.646791 |
9e31fc45991405b6d2a79b0338dfb1f98cd5bdff | 19,862 | py | Python | msl/qt/equipment/configuration_viewer.py | rebeccahawke/msl-qt | 753ea28aa385a39a33827de2c229e9944a3b1cf3 | [
"MIT"
] | null | null | null | msl/qt/equipment/configuration_viewer.py | rebeccahawke/msl-qt | 753ea28aa385a39a33827de2c229e9944a3b1cf3 | [
"MIT"
] | null | null | null | msl/qt/equipment/configuration_viewer.py | rebeccahawke/msl-qt | 753ea28aa385a39a33827de2c229e9944a3b1cf3 | [
"MIT"
] | null | null | null | """
A :class:`~QtWidgets.QWidget` to view the information within a
`Configuration File <http://msl-equipment.readthedocs.io/en/latest/config.html#configuration>`_.
"""
import re
try:
from msl.equipment import Config, EquipmentRecord, ConnectionRecord
has_msl_equipment = True
except ImportError:
has_msl_equ... | 40.125253 | 114 | 0.595408 |
9e31ff5324749a1296989cc9859137ab50b7d29a | 2,298 | py | Python | alipay/aop/api/domain/AlipayOpenMiniResourceQueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/AlipayOpenMiniResourceQueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/AlipayOpenMiniResourceQueryModel.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class AlipayOpenMiniResourceQueryModel(object):
def __init__(self):
self._name = None
self._page_num = None
self._page_size = None
self._resource_id = None
@propert... | 26.72093 | 73 | 0.570931 |
9e3208a91451c9e5a15fd1efd30f4b47121ecfcd | 29,461 | py | Python | components/kv_lang_area.py | SrGambiarra/KivyStudioDesigner | 7f617b60aef3d5e99865cb559b9b5ee93a1988f5 | [
"MIT"
] | 3 | 2022-03-05T21:54:34.000Z | 2022-03-15T12:55:45.000Z | components/kv_lang_area.py | SrGambiarra/KivyStudioDesigner | 7f617b60aef3d5e99865cb559b9b5ee93a1988f5 | [
"MIT"
] | 2 | 2022-03-13T04:15:47.000Z | 2022-03-30T11:51:41.000Z | components/kv_lang_area.py | SrGambiarra/KivyStudioDesigner | 7f617b60aef3d5e99865cb559b9b5ee93a1988f5 | [
"MIT"
] | null | null | null | __all__ = ['KVLangAreaScroll', 'KVLangArea', ]
from uix.code_input import DesignerCodeInput
from utils.utils import (
get_current_project, get_indent_str,
get_indentation, get_line_end_pos,
get_line_start_pos)
from kivy.clock import Clock
from kivy.lang.builder import Builder
from kivy.uix.carousel import... | 36.104167 | 96 | 0.548216 |
9e321589fc50e000acbb96e6a4b3936db2d30fb2 | 2,800 | py | Python | alipay/aop/api/domain/KbGoodsInfo.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 213 | 2018-08-27T16:49:32.000Z | 2021-12-29T04:34:12.000Z | alipay/aop/api/domain/KbGoodsInfo.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 29 | 2018-09-29T06:43:00.000Z | 2021-09-02T03:27:32.000Z | alipay/aop/api/domain/KbGoodsInfo.py | antopen/alipay-sdk-python-all | 8e51c54409b9452f8d46c7bb10eea7c8f7e8d30c | [
"Apache-2.0"
] | 59 | 2018-08-27T16:59:26.000Z | 2022-03-25T10:08:15.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from alipay.aop.api.constant.ParamConstants import *
class KbGoodsInfo(object):
def __init__(self):
self._goods_category = None
self._goods_id = None
self._goods_name = None
self._price = None
self._quantity = None... | 27.722772 | 79 | 0.573571 |
9e321afea9e8602436b1d494de628ec2e5e219d4 | 1,158 | py | Python | egs/librimix/ConvTasNet/local/create_local_metadata.py | hushell/asteroid | 73d93c8af734b0d985c67013e9f4a8462d1a924f | [
"MIT"
] | null | null | null | egs/librimix/ConvTasNet/local/create_local_metadata.py | hushell/asteroid | 73d93c8af734b0d985c67013e9f4a8462d1a924f | [
"MIT"
] | null | null | null | egs/librimix/ConvTasNet/local/create_local_metadata.py | hushell/asteroid | 73d93c8af734b0d985c67013e9f4a8462d1a924f | [
"MIT"
] | null | null | null | import os
import shutil
import argparse
from glob import glob
# Command line arguments
parser = argparse.ArgumentParser()
parser.add_argument(
"--librimix_dir", type=str, default=None, help="Path to librispeech root directory"
)
parser.add_argument(
"--local_dir", type=str, default=None, help="Path to librispe... | 29.692308 | 94 | 0.671848 |
9e32338b0af98ac961df00dadd85f15f9155df39 | 7,490 | py | Python | py/desimeter/test/test_pos2ptl.py | julienguy/desimeter | 9dd40251b0c483b525a952051a73587ac9180e8a | [
"BSD-3-Clause"
] | 1 | 2022-01-25T00:18:55.000Z | 2022-01-25T00:18:55.000Z | py/desimeter/test/test_pos2ptl.py | desihub/desimeter | e575f22c8820d4f98a6715ad7574130a6d11b09b | [
"BSD-3-Clause"
] | 124 | 2019-12-30T20:46:43.000Z | 2021-12-09T21:33:57.000Z | py/desimeter/test/test_pos2ptl.py | julienguy/desimeter | 9dd40251b0c483b525a952051a73587ac9180e8a | [
"BSD-3-Clause"
] | 5 | 2020-01-17T16:51:11.000Z | 2020-07-27T09:34:46.000Z | import unittest
import json
from pkg_resources import resource_filename
import os
import numpy as np
import desimeter.transform.pos2ptl as pos2ptl
import desimeter.transform.xy2tp as xy2tp
class TestPos2Ptl(unittest.TestCase):
'''Tests below compare results from this module to a presumed canonical
set ... | 59.92 | 164 | 0.505207 |
9e32425c1b9d213d2f548370fc7c7c929c85c41c | 2,916 | py | Python | python/graph/graph/stack_and_queue.py | RoaaMustafa/data-structures-and-algorithms | 3a756dd5b3feae338eaac28e9229bc37ad6013e2 | [
"MIT"
] | null | null | null | python/graph/graph/stack_and_queue.py | RoaaMustafa/data-structures-and-algorithms | 3a756dd5b3feae338eaac28e9229bc37ad6013e2 | [
"MIT"
] | 2 | 2021-08-06T13:44:01.000Z | 2021-08-07T10:18:07.000Z | python/graph/graph/stack_and_queue.py | RoaaMustafa/data-structures-and-algorithms | 3a756dd5b3feae338eaac28e9229bc37ad6013e2 | [
"MIT"
] | 1 | 2021-12-06T22:12:31.000Z | 2021-12-06T22:12:31.000Z | class Node():
def __init__(self,value=None) -> None:
"""This Function Creates Nodes """
self.value=value
self.next=None
class Stack():
def __init__(self,node=None) -> None:
self.top=node
def push(self,value=None):
""" Adding New value by assign it to head """
... | 22.78125 | 66 | 0.544239 |
9e3242a5a3da54dd4d14ed47c9b30448de44657d | 2,824 | py | Python | ramp-frontend/ramp_frontend/tests/test_general.py | tomMoral/ramp-board | 9e3aa335a90701e2ae4c6295eb2b77f3555f54de | [
"BSD-3-Clause"
] | null | null | null | ramp-frontend/ramp_frontend/tests/test_general.py | tomMoral/ramp-board | 9e3aa335a90701e2ae4c6295eb2b77f3555f54de | [
"BSD-3-Clause"
] | null | null | null | ramp-frontend/ramp_frontend/tests/test_general.py | tomMoral/ramp-board | 9e3aa335a90701e2ae4c6295eb2b77f3555f54de | [
"BSD-3-Clause"
] | null | null | null | import shutil
import pytest
from ramp_utils import generate_flask_config
from ramp_utils import read_config
from ramp_utils.testing import database_config_template
from ramp_utils.testing import ramp_config_template
from ramp_database.model import Model
from ramp_database.testing import create_toy_db
from ramp_datab... | 31.730337 | 77 | 0.719547 |
9e32ba8e6e4b595e357fd835cd50c1bb50b25c38 | 280 | py | Python | tests/depopwatch_tests.py | WilliamWCYoung/depopwatch | d4e7b5a267a3587396e58e3fb6a7d08eb76e6905 | [
"MIT"
] | 11 | 2016-08-16T15:41:32.000Z | 2022-03-19T01:34:20.000Z | tests/depopwatch_tests.py | WilliamWCYoung/depopwatch | d4e7b5a267a3587396e58e3fb6a7d08eb76e6905 | [
"MIT"
] | null | null | null | tests/depopwatch_tests.py | WilliamWCYoung/depopwatch | d4e7b5a267a3587396e58e3fb6a7d08eb76e6905 | [
"MIT"
] | 3 | 2016-08-16T15:41:33.000Z | 2016-08-16T15:44:43.000Z | from nose.tools import *
import depopwatch
@raises(AssertionError)
def test_no_username():
depopwatch.Listener(None)
@raises(AssertionError)
def test_nonexistent_username():
#This account seems to be reserved and in a state of non-existance
depopwatch.Listener("a")
| 23.333333 | 70 | 0.771429 |
9e32c79e1941a0747768612db2c644c47ffdbfdb | 1,862 | py | Python | src/inworldz/util/filesystem.py | IslandzVW/maestro | ae3965d61c79985adb03c72be2a744c70a677bf5 | [
"Apache-2.0"
] | 3 | 2016-02-20T00:47:52.000Z | 2018-07-27T22:57:36.000Z | src/inworldz/util/filesystem.py | IslandzVW/maestro | ae3965d61c79985adb03c72be2a744c70a677bf5 | [
"Apache-2.0"
] | 1 | 2016-07-29T07:19:01.000Z | 2016-07-29T07:19:01.000Z | src/inworldz/util/filesystem.py | InWorldz/maestro | ae3965d61c79985adb03c72be2a744c70a677bf5 | [
"Apache-2.0"
] | 2 | 2018-04-09T18:15:18.000Z | 2018-05-20T16:14:28.000Z | import os.path
import pywintypes
from win32net import NetUseAdd, NetUseDel
from win32com.shell import shell, shellcon
def strip_suffix(text, suffix):
if not text.endswith(suffix):
return text
return text[:-len(suffix)]
def getCurrentUsersDesktopPath():
""" Return the path to the users desktop. U... | 29.555556 | 96 | 0.643394 |
9e32eec799132cf36f686cba938b8a77a195a169 | 170 | py | Python | models/depthnet.py | tranduytrung/rgbd-classification | 156d829200c4592867af5ade85e8642afbe8580e | [
"Apache-2.0"
] | null | null | null | models/depthnet.py | tranduytrung/rgbd-classification | 156d829200c4592867af5ade85e8642afbe8580e | [
"Apache-2.0"
] | null | null | null | models/depthnet.py | tranduytrung/rgbd-classification | 156d829200c4592867af5ade85e8642afbe8580e | [
"Apache-2.0"
] | 1 | 2021-09-28T02:36:17.000Z | 2021-09-28T02:36:17.000Z | from .mobilenetv2 import MobileNetV2
class DepthNet(MobileNetV2):
def __init__(self, cfg):
cfg['in_channels'] = 3
super(DepthNet, self).__init__(cfg) | 28.333333 | 43 | 0.688235 |
9e32f5e0dd06d51a38db4f17cf0bb3eb8179f2ef | 1,031 | py | Python | example_project/urls.py | bosonogi/celery_pantry | dbe81651e39e5a0aefc3b4e8f9c5808d40228ff3 | [
"MIT"
] | 2 | 2018-09-30T03:36:10.000Z | 2019-01-29T01:40:44.000Z | example_project/urls.py | bosonogi/celery_pantry | dbe81651e39e5a0aefc3b4e8f9c5808d40228ff3 | [
"MIT"
] | null | null | null | example_project/urls.py | bosonogi/celery_pantry | dbe81651e39e5a0aefc3b4e8f9c5808d40228ff3 | [
"MIT"
] | null | null | null | """example_project URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.1/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')
Cla... | 32.21875 | 77 | 0.732299 |
9e3302e8c5e6af96d98365b8732c46befd9e59dd | 4,415 | py | Python | experiments/ashvin/icra2021/data_utils/compile_offpolicy_augment1.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/icra2021/data_utils/compile_offpolicy_augment1.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | experiments/ashvin/icra2021/data_utils/compile_offpolicy_augment1.py | Asap7772/railrl_evalsawyer | baba8ce634d32a48c7dfe4dc03b123e18e96e0a3 | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
import time
import glob
from rlkit.misc.asset_loader import load_local_or_remote_file
from copy import deepcopy
from PIL import Image
from skimage import data, color
from skimage.transform import rescale, resize, downscale_local_mean
from torchvision.transforms impor... | 40.87963 | 114 | 0.64077 |
9e3327607a2f25d232b966f63016f1d7556c1185 | 266 | py | Python | pni_customization/pni_customization/doctype/ppl_flower_plate/ppl_flower_plate.py | DaizyModi/pni_customization | 577946e91c8fe956ca64c089327ce18174002ec4 | [
"MIT"
] | null | null | null | pni_customization/pni_customization/doctype/ppl_flower_plate/ppl_flower_plate.py | DaizyModi/pni_customization | 577946e91c8fe956ca64c089327ce18174002ec4 | [
"MIT"
] | null | null | null | pni_customization/pni_customization/doctype/ppl_flower_plate/ppl_flower_plate.py | DaizyModi/pni_customization | 577946e91c8fe956ca64c089327ce18174002ec4 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2021, Jigar Tarpara and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
# import frappe
from frappe.model.document import Document
class PPLFlowerPlate(Document):
pass
| 24.181818 | 52 | 0.778195 |
9e332d0ce4926f951a626807d7379f2f50cad716 | 7,400 | py | Python | eduid_msg/tests/test_tasks.py | SUNET/eduid_msg | a844133f26bd616dc6f0db8a298722def03135ba | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | eduid_msg/tests/test_tasks.py | SUNET/eduid_msg | a844133f26bd616dc6f0db8a298722def03135ba | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | eduid_msg/tests/test_tasks.py | SUNET/eduid_msg | a844133f26bd616dc6f0db8a298722def03135ba | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2016-11-21T11:41:34.000Z | 2016-11-21T11:41:34.000Z | import json
import pytest
from celery.exceptions import Retry
from mock import MagicMock, call, patch
from eduid_msg.testing import MsgMongoTestCase
from eduid_msg.utils import load_template
class TestTasks(MsgMongoTestCase):
def setUp(self, init_msg=True):
super(TestTasks, self).setUp(init_msg=init_msg... | 39.361702 | 111 | 0.627703 |
9e3333444ab79e75951c19b25e4dbf8634b75641 | 739 | py | Python | apps/blog/urls.py | Profeel/django_blog | 6c86c0e4c3b3b122317bbb24a43ded4cb32724d9 | [
"Apache-2.0"
] | 1 | 2016-03-07T00:38:52.000Z | 2016-03-07T00:38:52.000Z | apps/blog/urls.py | Profeel/django_blog | 6c86c0e4c3b3b122317bbb24a43ded4cb32724d9 | [
"Apache-2.0"
] | null | null | null | apps/blog/urls.py | Profeel/django_blog | 6c86c0e4c3b3b122317bbb24a43ded4cb32724d9 | [
"Apache-2.0"
] | null | null | null | from django.conf.urls import patterns, url
#import views
#
#urlpatterns = patterns(views,
# # Examples:
# # url(r'^$', 'django_blog.views.home', name='home'),
# url(r'^hello/', views.hello),
# url(r'^index$', views.index),
# url(r'^$', views.index),
# url(r'^(?P<blog_id>\d+)/(?P<blog_link>\w*)$', view... | 33.590909 | 89 | 0.579161 |
9e333faf401888f0131f2e96c87f62287a487e09 | 2,554 | py | Python | dalec/settings.py | webu/dalec | ddc4f3c4627c84c5a70e9052d28f77d6ff8755a7 | [
"BSD-3-Clause"
] | null | null | null | dalec/settings.py | webu/dalec | ddc4f3c4627c84c5a70e9052d28f77d6ff8755a7 | [
"BSD-3-Clause"
] | null | null | null | dalec/settings.py | webu/dalec | ddc4f3c4627c84c5a70e9052d28f77d6ff8755a7 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from typing import Any, Optional
import sys
from django.conf import settings
def get_setting(
setting: str, default: Optional[Any] = None, raise_if_not_set: bool = False
) -> Any:
"""
Return a DALEC_<setting> or it... | 31.925 | 83 | 0.649178 |
9e3361278ce58c9bd6ae24908b1db98e516faa59 | 1,273 | py | Python | tests/integration/api/utils.py | charettes/datadogpy | 48edfc24f2f8fa3ca113fb145fa89ec5003e5061 | [
"BSD-3-Clause"
] | null | null | null | tests/integration/api/utils.py | charettes/datadogpy | 48edfc24f2f8fa3ca113fb145fa89ec5003e5061 | [
"BSD-3-Clause"
] | null | null | null | tests/integration/api/utils.py | charettes/datadogpy | 48edfc24f2f8fa3ca113fb145fa89ec5003e5061 | [
"BSD-3-Clause"
] | null | null | null | # Unless explicitly stated otherwise all files in this repository are licensed under the BSD-3-Clause License.
# This product includes software developed at Datadog (https://www.datadoghq.com/).
# Copyright 2015-Present Datadog, Inc
import time
# datadog
from datadog import api as dog
WAIT_TIME = 10
def get_with_retr... | 36.371429 | 117 | 0.674784 |
9e336b340aa7578b1328e41e125d7863ea226ba4 | 5,915 | py | Python | tools/train_net.py | Oneflow-Inc/of-maskrcnn-benchmark | 2d198c98771b3e68c5474b6a8afa1c4543dd2399 | [
"MIT"
] | null | null | null | tools/train_net.py | Oneflow-Inc/of-maskrcnn-benchmark | 2d198c98771b3e68c5474b6a8afa1c4543dd2399 | [
"MIT"
] | 1 | 2020-01-02T09:15:24.000Z | 2020-01-02T09:15:24.000Z | tools/train_net.py | Oneflow-Inc/of-maskrcnn-benchmark | 2d198c98771b3e68c5474b6a8afa1c4543dd2399 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
r"""
Basic training script for PyTorch
"""
# Set up custom environment before nearly anything else is imported
# NOTE: this should be the first import (no not reorder)
from maskrcnn_benchmark.utils.env import setup_environment # noqa F401 isort:s... | 32.5 | 128 | 0.689603 |
9e337cbfab1cbd80cf1244f7eb02c60153c60731 | 1,182 | py | Python | server/routes/api/protein.py | chejennifer/website | b7589f1fa288e0e4e12cd97a6bbbcb9f3fd3d833 | [
"Apache-2.0"
] | 11 | 2020-07-18T17:04:26.000Z | 2022-03-23T08:44:09.000Z | server/routes/api/protein.py | chejennifer/website | b7589f1fa288e0e4e12cd97a6bbbcb9f3fd3d833 | [
"Apache-2.0"
] | 747 | 2020-06-22T16:56:45.000Z | 2022-03-31T19:04:55.000Z | server/routes/api/protein.py | chejennifer/website | b7589f1fa288e0e4e12cd97a6bbbcb9f3fd3d833 | [
"Apache-2.0"
] | 33 | 2019-09-25T21:26:12.000Z | 2022-03-23T08:27:33.000Z | # Copyright 2021 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, ... | 33.771429 | 74 | 0.664129 |
9e33abea57942889c38e455dc0b8ccf2841b5dd5 | 4,350 | py | Python | cleverhans/future/torch/utils.py | iamgroot42/cleverhans | 53da9cd6daf9d7457800831c3eaa75f729a39145 | [
"MIT"
] | 2 | 2021-06-02T03:08:14.000Z | 2021-07-02T03:32:17.000Z | cleverhans/future/torch/utils.py | iamgroot42/cleverhans | 53da9cd6daf9d7457800831c3eaa75f729a39145 | [
"MIT"
] | 1 | 2021-03-01T15:06:09.000Z | 2021-03-01T15:06:09.000Z | cleverhans/future/torch/utils.py | iamgroot42/cleverhans | 53da9cd6daf9d7457800831c3eaa75f729a39145 | [
"MIT"
] | 1 | 2020-10-29T14:13:21.000Z | 2020-10-29T14:13:21.000Z | """Utils for PyTorch"""
import numpy as np
import torch
def clip_eta(eta, norm, eps):
"""
PyTorch implementation of the clip_eta in utils_tf.
:param eta: Tensor
:param norm: np.inf, 1, or 2
:param eps: float
"""
if norm not in [np.inf, 1, 2]:
raise ValueError('norm must be np.inf, 1, or 2.')
a... | 34.8 | 85 | 0.665977 |
9e33b10419e46c9a3f94f08a6f207c1c5e2f7e9d | 634 | py | Python | src/rauto/service.py | zhichul/pi-bob | b9ed7cb3614f50c51c6273665d8cd2b62dcab886 | [
"MIT"
] | null | null | null | src/rauto/service.py | zhichul/pi-bob | b9ed7cb3614f50c51c6273665d8cd2b62dcab886 | [
"MIT"
] | null | null | null | src/rauto/service.py | zhichul/pi-bob | b9ed7cb3614f50c51c6273665d8cd2b62dcab886 | [
"MIT"
] | null | null | null | class Service(object):
"""
A abstract superclass for a service.
"""
running = False
registry = None
def name(self):
"""
To be overriden by subclass
:return: the name of service
"""
return "Unimplemented"
def update(self, data):
if self.reg... | 19.212121 | 54 | 0.520505 |
9e33c525af66e379500cd91804bea29605277b46 | 4,550 | py | Python | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_08_01/aio/_web_site_management_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2021-09-07T18:39:05.000Z | 2021-09-07T18:39:05.000Z | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_08_01/aio/_web_site_management_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/appservice/azure-mgmt-web/azure/mgmt/web/v2015_08_01/aio/_web_site_management_client.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-03-04T06:21:56.000Z | 2022-03-04T06:21:56.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 46.907216 | 154 | 0.719121 |
9e33df5bde880f7e659fd2a527448446259d3abe | 289 | py | Python | thumber/admin.py | uktrade/dit-thumber | e97d0c759d39bf330477e24b307c70233ac25f09 | [
"MIT"
] | 3 | 2017-02-17T23:43:59.000Z | 2021-05-25T23:53:11.000Z | thumber/admin.py | uktrade/dit-thumber | e97d0c759d39bf330477e24b307c70233ac25f09 | [
"MIT"
] | null | null | null | thumber/admin.py | uktrade/dit-thumber | e97d0c759d39bf330477e24b307c70233ac25f09 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Feedback
class FeedbackAdmin(admin.ModelAdmin):
list_display = ['created', 'satisfied', 'view_name', 'comment']
ordering = ['created']
if not admin.site.is_registered(Feedback):
admin.site.register(Feedback, FeedbackAdmin)
| 24.083333 | 67 | 0.750865 |
9e34318106623f464036992cb2519c585af02561 | 309 | py | Python | src/trydifflib.py | ashish-code/gps-denied-geospatial-positioning | 5006b963e0b8fe50b0cabd5e3a9deb6aeb2416f2 | [
"MIT"
] | 2 | 2021-09-07T14:15:50.000Z | 2021-12-27T06:04:54.000Z | src/trydifflib.py | ashish-code/gps-denied-geospatial-positioning | 5006b963e0b8fe50b0cabd5e3a9deb6aeb2416f2 | [
"MIT"
] | null | null | null | src/trydifflib.py | ashish-code/gps-denied-geospatial-positioning | 5006b963e0b8fe50b0cabd5e3a9deb6aeb2416f2 | [
"MIT"
] | null | null | null | '''
Created on Sep 10, 2015
@author: ash
'''
import difflib
def mydiffing():
a = 'abcdefg'
b = 'abc'
seq = difflib.SequenceMatcher(None, a, b)
r = seq.ratio()
m = r * (len(a) + len(b)) / 2
r2 = m / len(b)
print r, r2
pass
if __name__ == '__main__':
mydiffing()
pass | 15.45 | 45 | 0.533981 |
9e345970be1cbae8f90acffa74a8fe220ab63cb6 | 4,867 | py | Python | geosoft/gxpy/geometry_utility.py | fearaschiarrai/gxpy | 4c5e7594b24e530a8cd94df1eef562c5c6ce3e92 | [
"BSD-2-Clause"
] | 25 | 2017-07-14T06:39:37.000Z | 2022-03-09T21:39:51.000Z | geosoft/gxpy/geometry_utility.py | fearaschiarrai/gxpy | 4c5e7594b24e530a8cd94df1eef562c5c6ce3e92 | [
"BSD-2-Clause"
] | 100 | 2016-12-13T17:30:41.000Z | 2021-08-01T20:21:13.000Z | geosoft/gxpy/geometry_utility.py | fearaschiarrai/gxpy | 4c5e7594b24e530a8cd94df1eef562c5c6ce3e92 | [
"BSD-2-Clause"
] | 28 | 2016-12-12T17:34:40.000Z | 2022-03-16T15:39:39.000Z | """
Geometry utilities.
:Constants:
:SPLINE_LINEAR: `geosoft.gxapi.VVU_SPL_LINEAR`
:SPLINE_CUBIC: `geosoft.gxapi.VVU_SPL_CUBIC`
:SPLINE_AKIMA: `geosoft.gxapi.VVU_SPL_AKIMA`
:SPLINE_NEAREST: `geosoft.gxapi.VVU_SPL_NEAREST`
.. seealso:: `geosoft.gxpy.geometry`
.. note::
Regression tests provide us... | 29.858896 | 111 | 0.580234 |
9e346fc236fb234979503c224b5b1d1fed9c7d6d | 4,132 | py | Python | pymath/roman_numeral/__init__.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 3 | 2017-05-02T10:28:13.000Z | 2019-02-06T09:10:11.000Z | pymath/roman_numeral/__init__.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 2 | 2017-06-21T20:39:14.000Z | 2020-02-25T10:28:57.000Z | pymath/roman_numeral/__init__.py | JASTYN/pythonmaster | 46638ab09d28b65ce5431cd0759fe6df272fb85d | [
"Apache-2.0",
"MIT"
] | 2 | 2016-07-29T04:35:22.000Z | 2017-01-18T17:05:36.000Z | ROMAN_MAP = ((1000, 'M'), (900, 'CM'), (500, 'D'), (400, 'CD'), (100, 'C'), (90, 'XC'), (50, 'L'),
(40, 'XL'), (10, 'X'), (9, 'IX'), (5, 'V'), (4, 'IV'), (1, 'I'))
def numeral(arabic):
roman_number = ""
for number, roman in ROMAN_MAP:
while arabic >= number:
roman_number += ro... | 37.563636 | 99 | 0.504356 |
9e34773e80750e5134a567930296424963fc4b62 | 2,908 | py | Python | f5_manager/models.py | vegitron/f5_manager | 84c4dc387b0bb6ebfe02c21eeef229f7cf5fe915 | [
"Apache-2.0"
] | null | null | null | f5_manager/models.py | vegitron/f5_manager | 84c4dc387b0bb6ebfe02c21eeef229f7cf5fe915 | [
"Apache-2.0"
] | null | null | null | f5_manager/models.py | vegitron/f5_manager | 84c4dc387b0bb6ebfe02c21eeef229f7cf5fe915 | [
"Apache-2.0"
] | null | null | null | from django.db import models
from django.conf import settings
from django_fields.fields import EncryptedCharField
from django.core.urlresolvers import reverse
from f5_manager.rule_views import *
from f5_manager.big_ip import BigIP
import re
# Create your models here.
class VirtualHost(models.Model):
hostname = mo... | 42.144928 | 605 | 0.65784 |
9e34a79b0ec80989059b242b7c57eac00626982e | 374 | py | Python | tests/base.py | Privex/python-exchange | 858d5d2499bba0169fd58763aa3214b3d4e8dc80 | [
"X11"
] | null | null | null | tests/base.py | Privex/python-exchange | 858d5d2499bba0169fd58763aa3214b3d4e8dc80 | [
"X11"
] | 5 | 2020-08-15T17:40:52.000Z | 2021-09-22T19:05:52.000Z | tests/base.py | Privex/python-exchange | 858d5d2499bba0169fd58763aa3214b3d4e8dc80 | [
"X11"
] | 1 | 2021-02-28T18:02:04.000Z | 2021-02-28T18:02:04.000Z | from decimal import Decimal
from typing import Union
Number = Union[Decimal, int, float]
def assert_almost(orig: Number, compare: Number, tolerance=Decimal('0.01')):
orig, compare = Decimal(orig), Decimal(compare)
assert (compare - tolerance) < orig < (compare + tolerance)
assert_approx = assert_almos... | 20.777778 | 76 | 0.71123 |
9e34c903cfc7623ceaa3f7b97212428fc9c971b4 | 6,934 | py | Python | troposphere/ssm.py | jpvowen/troposphere | 6a9efa7717db75905b846a9f3aafd092f55c7925 | [
"BSD-2-Clause"
] | 1 | 2021-01-11T22:01:37.000Z | 2021-01-11T22:01:37.000Z | troposphere/ssm.py | jpvowen/troposphere | 6a9efa7717db75905b846a9f3aafd092f55c7925 | [
"BSD-2-Clause"
] | null | null | null | troposphere/ssm.py | jpvowen/troposphere | 6a9efa7717db75905b846a9f3aafd092f55c7925 | [
"BSD-2-Clause"
] | 1 | 2019-08-06T13:39:57.000Z | 2019-08-06T13:39:57.000Z | # Copyright (c) 2015, Mark Peek <mark@peek.org>
# All rights reserved.
#
# See LICENSE file for full license.
from . import AWSObject, AWSProperty, Tags
from .validators import (integer, boolean, s3_bucket_name, notification_type,
notification_event, json_checker, task_type,
... | 28.072874 | 77 | 0.620277 |
9e34d87deadadf97c996b1af1fb0614f910474f5 | 724 | py | Python | structs/test/structs/trie/test_trie.py | tmck-code/structs-py | 779eca9a8c749196986a7b5b330a6c6fb568f8ae | [
"BSD-3-Clause"
] | null | null | null | structs/test/structs/trie/test_trie.py | tmck-code/structs-py | 779eca9a8c749196986a7b5b330a6c6fb568f8ae | [
"BSD-3-Clause"
] | null | null | null | structs/test/structs/trie/test_trie.py | tmck-code/structs-py | 779eca9a8c749196986a7b5b330a6c6fb568f8ae | [
"BSD-3-Clause"
] | null | null | null | from structs.trie.trie import Trie
class TestTrie:
def test_insert(self):
t = Trie()
t.insert('cat')
assert 'cat' in t
assert 'car' not in t
assert t['cat'].final
def test_insert_with_data(self):
t = Trie()
t.insert('cat', 'feline')
assert 'cat'... | 25.857143 | 102 | 0.472376 |
9e34ebcf0909548812a9fa69db4eb676dbcd475e | 37 | py | Python | tests/test_mitmproxy.py | sangoma/pytest-mitmproxy | 5d657ac0b58b67fc063091b26fe180a5fe2e1a7a | [
"MIT"
] | 2 | 2020-04-22T01:14:17.000Z | 2021-07-25T07:12:50.000Z | tests/test_mitmproxy.py | sangoma/pytest-mitmproxy | 5d657ac0b58b67fc063091b26fe180a5fe2e1a7a | [
"MIT"
] | 1 | 2017-01-11T16:02:14.000Z | 2017-01-11T16:49:07.000Z | tests/test_mitmproxy.py | sangoma/pytest-mitmproxy | 5d657ac0b58b67fc063091b26fe180a5fe2e1a7a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# TODO: this
| 12.333333 | 23 | 0.486486 |
9e34ed496e6c5d9700e7829c845511616d8e775d | 13,775 | py | Python | u_base/u_file.py | youyouzh/u_base | f2f81f837258df6f57cdfc3f3f579049935f5a22 | [
"Apache-2.0"
] | null | null | null | u_base/u_file.py | youyouzh/u_base | f2f81f837258df6f57cdfc3f3f579049935f5a22 | [
"Apache-2.0"
] | null | null | null | u_base/u_file.py | youyouzh/u_base | f2f81f837258df6f57cdfc3f3f579049935f5a22 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*
# file function
import os
import time
import json
import re
import urllib.parse
import requests
from PIL import Image
from concurrent.futures import ThreadPoolExecutor, wait, ALL_COMPLETED
import u_base.u_log as log
__all__ = [
'convert_windows_path',
'get_file_name... | 29.122622 | 110 | 0.639201 |
9e3504e1c3ddd0c5eb8b6fa2323285a25f680706 | 3,025 | py | Python | leetcode_python/Depth-First-Search/find-leaves-of-binary-tree.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | 18 | 2019-08-01T07:45:02.000Z | 2022-03-31T18:05:44.000Z | leetcode_python/Depth-First-Search/find-leaves-of-binary-tree.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Depth-First-Search/find-leaves-of-binary-tree.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | 15 | 2019-12-29T08:46:20.000Z | 2022-03-08T14:14:05.000Z | # V0
# V1
# https://blog.csdn.net/danspace1/article/details/87738403
# Definition for a binary tree node.
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
def findLeaves(self, root: 'TreeNode') -> 'List[List[int]]':
... | 28.009259 | 89 | 0.532893 |
9e3509109cc08556960bf6125e45beeff4568c0c | 5,446 | py | Python | opsbro/misc/internalyaml/ruamel/_test/test_indentation.py | naparuba/opsbro | 98618a002cd47250d21e7b877a24448fc95fec80 | [
"MIT"
] | 32 | 2017-08-29T08:57:16.000Z | 2021-04-21T08:53:04.000Z | opsbro/misc/internalyaml/ruamel/_test/test_indentation.py | naparuba/opsbro | 98618a002cd47250d21e7b877a24448fc95fec80 | [
"MIT"
] | 108 | 2017-09-04T19:59:28.000Z | 2022-03-31T08:12:07.000Z | opsbro/misc/internalyaml/ruamel/_test/test_indentation.py | naparuba/kunai | 98618a002cd47250d21e7b877a24448fc95fec80 | [
"MIT"
] | 8 | 2015-02-03T12:30:53.000Z | 2017-07-29T19:43:54.000Z | # coding: utf-8
from __future__ import absolute_import
from __future__ import print_function
from __future__ import unicode_literals
from textwrap import dedent
import pytest # NOQA
import ruamel.yaml
from ruamel.yaml.util import load_yaml_guess_indent
from roundtrip import round_trip
def rt(s):
return rua... | 24.097345 | 95 | 0.507345 |
9e35287b0f16fcc6a9f7f7ff8e82338691505f72 | 231 | py | Python | rename.py | Jorewang/LeetCode_Solutions | 0c483a915e2a8b3bfc4bcb4b5a35df3dd0dbe8ba | [
"Apache-2.0"
] | 2 | 2020-06-13T06:37:50.000Z | 2020-06-13T06:37:52.000Z | rename.py | Jorewang/LeetCode_Solutions | 0c483a915e2a8b3bfc4bcb4b5a35df3dd0dbe8ba | [
"Apache-2.0"
] | null | null | null | rename.py | Jorewang/LeetCode_Solutions | 0c483a915e2a8b3bfc4bcb4b5a35df3dd0dbe8ba | [
"Apache-2.0"
] | null | null | null | import os
path = "F:\download\大咖读书会"
f = os.listdir(path)
for i in f:
oldname = path + '\\' + i
print(oldname)
newname = path + '\\' + i.split('.')[0]
print(newname)
os.rename(oldname, newname)
print("Done")
| 16.5 | 43 | 0.571429 |
9e35374462040f342870e09859f665a625fbe303 | 293 | py | Python | prot/__init__.py | gchure/quantitative_proteome | 90d15dd208647332aeb06cf7e16ab71a6b210820 | [
"MIT"
] | 2 | 2020-05-18T23:03:10.000Z | 2020-10-27T19:31:51.000Z | prot/__init__.py | gchure/quantitative_proteome | 90d15dd208647332aeb06cf7e16ab71a6b210820 | [
"MIT"
] | 1 | 2020-02-14T23:03:21.000Z | 2020-02-14T23:03:21.000Z | prot/__init__.py | RPGroup-PBoC/quantitative_proteome | 90d15dd208647332aeb06cf7e16ab71a6b210820 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Top level package for the prot module for interacting with proteome measurements"""
# from . import mcmc
from . import stats
from . import estimate
from . import viz
__author__ = """Griffin Chure"""
__email__ = """griffinchure@gmail.com"""
__version__ = "0.0.1"
| 20.928571 | 86 | 0.696246 |
9e354db44a0ec581a1c125a14752e1a7e3086b5e | 1,903 | py | Python | tests/_jslib/test_jslib_util.py | ynsnf/apysc | b10ffaf76ec6beb187477d0a744fca00e3efc3fb | [
"MIT"
] | 16 | 2021-04-16T02:01:29.000Z | 2022-01-01T08:53:49.000Z | tests/_jslib/test_jslib_util.py | ynsnf/apysc | b10ffaf76ec6beb187477d0a744fca00e3efc3fb | [
"MIT"
] | 613 | 2021-03-24T03:37:38.000Z | 2022-03-26T10:58:37.000Z | tests/_jslib/test_jslib_util.py | simon-ritchie/apyscript | c319f8ab2f1f5f7fad8d2a8b4fc06e7195476279 | [
"MIT"
] | 2 | 2021-06-20T07:32:58.000Z | 2021-12-26T08:22:11.000Z | import os
import shutil
from random import randint
from typing import Any
from typing import Dict
from typing import List
from retrying import retry
from apysc._jslib import jslib_util
from tests import testing_helper
@retry(stop_max_attempt_number=15, wait_fixed=randint(10, 3000))
def test_get_jslib_... | 33.385965 | 68 | 0.730426 |
9e355e792a495caa727bb2f24ca88a4f09584efd | 11,005 | py | Python | datasets/regrad.py | ZhangHanbo/Visual-Manipulation-Relationship-Network-Pytorch | 9dd24947db318f6e404918d4758f1d824eea3748 | [
"MIT"
] | 26 | 2019-10-31T08:21:46.000Z | 2022-03-11T13:58:43.000Z | build/lib.linux-x86_64-3.5/datasets/regrad.py | moli1026/regrad | f66c38c00405b22cb746cc3f5c38d2b49f77d854 | [
"MIT"
] | 12 | 2019-11-07T09:12:50.000Z | 2022-03-12T02:58:18.000Z | build/lib.linux-x86_64-3.5/datasets/regrad.py | moli1026/regrad | f66c38c00405b22cb746cc3f5c38d2b49f77d854 | [
"MIT"
] | 11 | 2019-10-30T08:44:47.000Z | 2022-03-11T13:58:48.000Z | # --------------------------------------------------------
# Visual Detection: State-of-the-Art
# Copyright: Hanbo Zhang
# Licensed under The MIT License [see LICENSE for details]
# Written by Hanbo Zhang
# --------------------------------------------------------
from __future__ import print_function
from __future__ i... | 38.479021 | 114 | 0.556111 |
9e3568fff376b2c9e78265b2e39d898aaf51ccf8 | 2,756 | py | Python | plain_fdm/lfz_controlFDM/pid_regler_c172.py | lauritowal/plainFDM_public | 3d47352e5aad15b0c632488b048b470d0528c652 | [
"MIT"
] | null | null | null | plain_fdm/lfz_controlFDM/pid_regler_c172.py | lauritowal/plainFDM_public | 3d47352e5aad15b0c632488b048b470d0528c652 | [
"MIT"
] | null | null | null | plain_fdm/lfz_controlFDM/pid_regler_c172.py | lauritowal/plainFDM_public | 3d47352e5aad15b0c632488b048b470d0528c652 | [
"MIT"
] | 1 | 2021-01-12T19:47:41.000Z | 2021-01-12T19:47:41.000Z | import numpy as np
# siehe auch Drohne-Code Unity
class PidRegler(object):
def __init__(self):
self.kpaElevator = .1
self.kdaElevator = 5
self.kpaAileron = .1
self.kdaAileron = 6
# Headline: Aileron
def getAileronCommand(self, heading_Reference, heading_Current, heading_r... | 44.451613 | 118 | 0.698839 |
9e356dd96562c28adec7fc28fe144394e1c2ed38 | 11,621 | py | Python | tensorflow/contrib/framework/python/framework/checkpoint_utils.py | tianyapiaozi/tensorflow | fb3ce0467766a8e91f1da0ad7ada7c24fde7a73a | [
"Apache-2.0"
] | 522 | 2016-06-08T02:15:50.000Z | 2022-03-02T05:30:36.000Z | tensorflow/contrib/framework/python/framework/checkpoint_utils.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 133 | 2017-04-26T16:49:49.000Z | 2019-10-15T11:39:26.000Z | tensorflow/contrib/framework/python/framework/checkpoint_utils.py | shrikunjsarda/tensorflow | 7e8927e7af0c51ac20a63bd4eab6ff83df1a39ae | [
"Apache-2.0"
] | 108 | 2016-06-16T15:34:05.000Z | 2022-03-12T13:23:11.000Z | # Copyright 2016 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... | 38.480132 | 80 | 0.692281 |
9e357f3a56753a7fe280febf27fbf6e621ad12ce | 41,431 | py | Python | openpype/tools/publisher/widgets/create_dialog.py | zafrs/OpenPype | 4b8e7e1ed002fc55b31307efdea70b0feaed474f | [
"MIT"
] | 1 | 2022-02-08T15:40:41.000Z | 2022-02-08T15:40:41.000Z | openpype/tools/publisher/widgets/create_dialog.py | zafrs/OpenPype | 4b8e7e1ed002fc55b31307efdea70b0feaed474f | [
"MIT"
] | null | null | null | openpype/tools/publisher/widgets/create_dialog.py | zafrs/OpenPype | 4b8e7e1ed002fc55b31307efdea70b0feaed474f | [
"MIT"
] | null | null | null | import sys
import re
import traceback
import copy
import qtawesome
try:
import commonmark
except Exception:
commonmark = None
from Qt import QtWidgets, QtCore, QtGui
from openpype.lib import TaskNotSetError
from openpype.pipeline.create import (
CreatorError,
SUBSET_NAME_ALLOWED_SYMBOLS
)
from openpype... | 34.69933 | 79 | 0.649562 |
9e359381fceefefe747fb4fc96e8f1c1e952be33 | 678 | py | Python | tests/test_data/test_processing/test_labels.py | mritv/edflow | 9bef77e32a74d9ee4108182d8cab177b5dd36731 | [
"MIT"
] | 1 | 2020-04-01T07:41:21.000Z | 2020-04-01T07:41:21.000Z | tests/test_data/test_processing/test_labels.py | mritv/edflow | 9bef77e32a74d9ee4108182d8cab177b5dd36731 | [
"MIT"
] | null | null | null | tests/test_data/test_processing/test_labels.py | mritv/edflow | 9bef77e32a74d9ee4108182d8cab177b5dd36731 | [
"MIT"
] | null | null | null | import pytest
import numpy as np
from edflow.debug import DebugDataset
from edflow.data.processing.labels import LabelDataset, ExtraLabelsDataset
def test_label_dset():
D = DebugDataset(size=10)
L = LabelDataset(D)
assert L[0] == {"label1": 0, "label2": 0, "index_": 0, "base_index_": 0}
assert len(... | 21.1875 | 76 | 0.637168 |
9e35aae44f4cc13db881bb500b7d19b11f48d174 | 203,732 | py | Python | oscar/lib/python2.7/site-packages/phonenumbers/geodata/data23.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/phonenumbers/geodata/data23.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | oscar/lib/python2.7/site-packages/phonenumbers/geodata/data23.py | sainjusajan/django-oscar | 466e8edc807be689b0a28c9e525c8323cc48b8e1 | [
"BSD-3-Clause"
] | null | null | null | """Per-prefix data, mapping each prefix to a dict of locale:name.
Auto-generated file, do not edit by hand.
"""
from ..util import u
# Copyright (C) 2011-2017 The Libphonenumber Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with t... | 48.186377 | 261 | 0.599567 |
9e35bb6e79f3afdaac3c578d025593df41303ec6 | 2,734 | py | Python | atom/enum.py | enthought/atom | 1f194e3550d62c4ca1d79521dff97531ffe3f0ac | [
"BSD-3-Clause"
] | null | null | null | atom/enum.py | enthought/atom | 1f194e3550d62c4ca1d79521dff97531ffe3f0ac | [
"BSD-3-Clause"
] | 1 | 2020-12-04T10:11:07.000Z | 2020-12-04T10:13:46.000Z | atom/enum.py | enthought/atom | 1f194e3550d62c4ca1d79521dff97531ffe3f0ac | [
"BSD-3-Clause"
] | 1 | 2020-12-04T10:05:32.000Z | 2020-12-04T10:05:32.000Z | #------------------------------------------------------------------------------
# Copyright (c) 2013, Enthought, Inc.
# All rights reserved.
#------------------------------------------------------------------------------
from .catom import Member, DEFAULT_VALUE, VALIDATE_ENUM
class Enum(Member):
""" A member wh... | 28.185567 | 79 | 0.534748 |
9e35d73dae9ed9b13986b573fee8447eaa0c69b0 | 4,342 | py | Python | connaisseur/workload_object.py | funkypenguin/connaisseur | 37d85332e519454a017b02ecb1cd77913f51f70a | [
"Apache-2.0"
] | null | null | null | connaisseur/workload_object.py | funkypenguin/connaisseur | 37d85332e519454a017b02ecb1cd77913f51f70a | [
"Apache-2.0"
] | null | null | null | connaisseur/workload_object.py | funkypenguin/connaisseur | 37d85332e519454a017b02ecb1cd77913f51f70a | [
"Apache-2.0"
] | null | null | null | import connaisseur.kube_api as k_api
from connaisseur.exceptions import ParentNotFoundError, UnknownAPIVersionError
from connaisseur.image import Image
SUPPORTED_API_VERSIONS = {
"Pod": ["v1"],
"Deployment": ["apps/v1", "apps/v1beta1", "apps/v1beta2"],
"ReplicationController": ["v1"],
"ReplicaSet": ["... | 34.188976 | 88 | 0.582911 |
9e3628a98004fd6b5860bbf0218bb48264a02eb7 | 3,383 | py | Python | src/ome_types/util.py | tlambert03/pyOMElite | 10de4c9800469f5dc31b51a0850a5718d3d2af0e | [
"MIT"
] | null | null | null | src/ome_types/util.py | tlambert03/pyOMElite | 10de4c9800469f5dc31b51a0850a5718d3d2af0e | [
"MIT"
] | null | null | null | src/ome_types/util.py | tlambert03/pyOMElite | 10de4c9800469f5dc31b51a0850a5718d3d2af0e | [
"MIT"
] | null | null | null | from __future__ import annotations
import re
from functools import lru_cache
from pathlib import Path
from typing import TYPE_CHECKING, Any, Dict, List, Union
from . import model
from ._base_type import OMEType
from .model.reference import Reference
if TYPE_CHECKING:
from .model.simple_types import LSID
def ca... | 31.915094 | 87 | 0.658291 |
9e3640498efe5c016bf8f9c846cc60df457386d0 | 1,851 | py | Python | aslprep/workflows/asl/__init__.py | lawlessrd/aslprep | 22ec61f482cc3561f4fd35d769af0fe8bc2e80cb | [
"BSD-3-Clause"
] | 2 | 2022-03-18T18:31:12.000Z | 2022-03-18T18:31:26.000Z | aslprep/workflows/asl/__init__.py | kha-dija1/aslprep | ce1ed4a8fa23f64aaa7d6bb0977582586e6a7039 | [
"BSD-3-Clause"
] | null | null | null | aslprep/workflows/asl/__init__.py | kha-dija1/aslprep | ce1ed4a8fa23f64aaa7d6bb0977582586e6a7039 | [
"BSD-3-Clause"
] | 1 | 2020-04-13T20:04:21.000Z | 2020-04-13T20:04:21.000Z | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""
Pre-processing ASL - ASL signal workflows
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. automodule:: aslprep.workflows.asl.base
.. automodule:: aslprep.workflows.asl.hmc
.. automodule:: aslprep.workf... | 25.708333 | 73 | 0.715289 |
9e36715a733b8daa43f333326e91d28c31fdfc5c | 4,460 | py | Python | Intellux/control_module/Automode.py | abdul-gendy/Intellux | dab49ee872de2038a2afea9677f5d41dffb2a240 | [
"MIT"
] | null | null | null | Intellux/control_module/Automode.py | abdul-gendy/Intellux | dab49ee872de2038a2afea9677f5d41dffb2a240 | [
"MIT"
] | null | null | null | Intellux/control_module/Automode.py | abdul-gendy/Intellux | dab49ee872de2038a2afea9677f5d41dffb2a240 | [
"MIT"
] | null | null | null | import os
import numpy as np
from pathlib import Path
class Auto_Mode_Controller:
'''controller class for intellux auto mode. This controller will mainly be composed of a
Hysteresis controller which will be tuned to try and meet the timing and performance requirements
set in the requirements specifications... | 62.816901 | 185 | 0.726906 |
9e36795200b1bbe8dee8dae1f5c8a758f139455b | 500 | py | Python | src/utils.py | TimPasquini/BladesInTheDarkGenerators | 30f0acaac8555b6bdb12fad1494bdbfdadee13e5 | [
"MIT"
] | 8 | 2021-08-01T19:11:30.000Z | 2021-11-02T19:16:58.000Z | src/utils.py | TimPasquini/BladesInTheDarkGenerators | 30f0acaac8555b6bdb12fad1494bdbfdadee13e5 | [
"MIT"
] | 1 | 2021-11-05T15:26:38.000Z | 2021-11-05T15:26:38.000Z | src/utils.py | TimPasquini/BladesInTheDarkGenerators | 30f0acaac8555b6bdb12fad1494bdbfdadee13e5 | [
"MIT"
] | 2 | 2021-08-02T10:31:53.000Z | 2022-03-28T15:20:12.000Z | import json
import random
def json_retreiver(json_filename):
"""Call this from a variable with a filename string to populate
with json content"""
filename = json_filename
with open(filename) as f:
return json.load(f)
def history_log(output):
"""Writes each generator call to an text file ... | 25 | 71 | 0.664 |
9e36880cc42f5c260a4e1cb821405e91d00055e4 | 10,582 | py | Python | discord/commands/context.py | phantomwaves/pycord | e50c239666c97480eac587ed04376031aa7c8003 | [
"MIT"
] | null | null | null | discord/commands/context.py | phantomwaves/pycord | e50c239666c97480eac587ed04376031aa7c8003 | [
"MIT"
] | null | null | null | discord/commands/context.py | phantomwaves/pycord | e50c239666c97480eac587ed04376031aa7c8003 | [
"MIT"
] | null | null | null | """
The MIT License (MIT)
Copyright (c) 2015-2021 Rapptz
Copyright (c) 2021-present Pycord Development
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 limit... | 34.581699 | 136 | 0.66547 |
9e368fee1624e0c2823964330b530a2cc1c328df | 9,462 | py | Python | cleverhans_tutorials/mnist_tutorial_picklable.py | iamgroot42/cleverhans | 53da9cd6daf9d7457800831c3eaa75f729a39145 | [
"MIT"
] | 21 | 2019-06-07T17:05:30.000Z | 2022-02-07T03:25:15.000Z | cleverhans_tutorials/mnist_tutorial_picklable.py | iamgroot42/cleverhans | 53da9cd6daf9d7457800831c3eaa75f729a39145 | [
"MIT"
] | 1 | 2021-03-01T15:06:09.000Z | 2021-03-01T15:06:09.000Z | cleverhans_tutorials/mnist_tutorial_picklable.py | iamgroot42/cleverhans | 53da9cd6daf9d7457800831c3eaa75f729a39145 | [
"MIT"
] | 8 | 2019-06-11T03:06:29.000Z | 2022-01-18T04:18:27.000Z | """
This tutorial shows how to use cleverhans.picklable_model
to create models that can be saved for evaluation later.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import logging
import numpy as np
import tensor... | 36.960938 | 78 | 0.704502 |
9e36b9de6b349c821f67d5c1737a77d60d4b7a2e | 75,354 | py | Python | Lib/subprocess.py | masamitsu-murase/stackless | 677b36ffe5cb5a0f4b8d3abfa20982c8d82ffb92 | [
"CNRI-Python-GPL-Compatible"
] | 854 | 2017-09-11T16:42:28.000Z | 2022-03-27T14:17:09.000Z | Lib/subprocess.py | masamitsu-murase/stackless | 677b36ffe5cb5a0f4b8d3abfa20982c8d82ffb92 | [
"CNRI-Python-GPL-Compatible"
] | 164 | 2017-09-24T20:40:32.000Z | 2021-10-30T01:35:05.000Z | Lib/subprocess.py | masamitsu-murase/stackless | 677b36ffe5cb5a0f4b8d3abfa20982c8d82ffb92 | [
"CNRI-Python-GPL-Compatible"
] | 73 | 2017-09-13T18:07:48.000Z | 2022-03-17T13:02:29.000Z | # subprocess - Subprocesses with accessible I/O streams
#
# For more information about this module, see PEP 324.
#
# Copyright (c) 2003-2005 by Peter Astrand <astrand@lysator.liu.se>
#
# Licensed to PSF under a Contributor Agreement.
# See http://www.python.org/2.4/license for licensing details.
r"""Subprocesses with ... | 39.639137 | 87 | 0.549831 |
9e36d23b22d52ebf40213d094b9198aff8088992 | 5,324 | py | Python | envs/flatland/observations/tree_obs.py | HaiDangDang/2020-flatland | abbf2f7f62fabf6da0937f80c2181f1c457ce24a | [
"MIT"
] | null | null | null | envs/flatland/observations/tree_obs.py | HaiDangDang/2020-flatland | abbf2f7f62fabf6da0937f80c2181f1c457ce24a | [
"MIT"
] | null | null | null | envs/flatland/observations/tree_obs.py | HaiDangDang/2020-flatland | abbf2f7f62fabf6da0937f80c2181f1c457ce24a | [
"MIT"
] | null | null | null | import gym
import numpy as np
from flatland.core.env_observation_builder import ObservationBuilder
from flatland.envs.observations import TreeObsForRailEnv
from flatland.envs.predictions import ShortestPathPredictorForRailEnv
from typing import Optional, List
from envs.flatland.observations import Observation, registe... | 39.437037 | 155 | 0.725958 |
9e36ede7557e685a13b26da7305ae6dfb53a8af8 | 1,326 | py | Python | tests/test_filter/test_callback.py | Eastwu5788/pre-request | 6e51076ef9260d5fcf56dc513ad0240f04ce4938 | [
"MIT"
] | 86 | 2017-08-17T12:41:52.000Z | 2022-02-24T12:17:47.000Z | tests/test_filter/test_callback.py | Eastwu5788/pre-request | 6e51076ef9260d5fcf56dc513ad0240f04ce4938 | [
"MIT"
] | 10 | 2020-03-30T03:24:46.000Z | 2022-02-23T01:34:53.000Z | tests/test_filter/test_callback.py | Eastwu5788/pre-request | 6e51076ef9260d5fcf56dc513ad0240f04ce4938 | [
"MIT"
] | 7 | 2017-08-18T03:40:35.000Z | 2020-05-19T04:09:10.000Z | # !/usr/local/python/bin/python
# -*- coding: utf-8 -*-
# (C) Wu Dong, 2020
# All rights reserved
# @Author: 'Wu Dong <wudong@eastwu.cn>'
# @Time: '2020-03-18 13:25'
# sys
import json
# 3p
from flask import Flask, make_response
# project
from pre_request import pre, Rule
app = Flask(__name__)
app.config["TESTING"] = ... | 19.791045 | 56 | 0.594268 |
9e37148ec00dfd527a4ee4de13e5a8161e86384b | 852 | py | Python | suspicious_urls_ips/feeds/360tofsee.py | asafben/Suspicious_URLs_and_IPs_List | d6ef745ae7a935d9b945efd6ed48bc19cfb1208c | [
"MIT"
] | null | null | null | suspicious_urls_ips/feeds/360tofsee.py | asafben/Suspicious_URLs_and_IPs_List | d6ef745ae7a935d9b945efd6ed48bc19cfb1208c | [
"MIT"
] | null | null | null | suspicious_urls_ips/feeds/360tofsee.py | asafben/Suspicious_URLs_and_IPs_List | d6ef745ae7a935d9b945efd6ed48bc19cfb1208c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
Copyright (c) 2014-2019 Maltrail developers (https://github.com/stamparm/maltrail/)
See the file 'LICENSE' for copying permission
"""
import re
from antivirus.lists_based_engine.update import retrieve_content
from antivirus.lists_based_engine.settings import DOMAIN_TYPE
from antivirus.lists... | 27.483871 | 92 | 0.735915 |
9e371ca96f91ccecb879ca62e80979790e6818f2 | 16,011 | py | Python | Thesis_test_affnet_match_features_isprsimageblocks.py | Childhoo/Chen_Matcher | ca89a4774a083d10177186020c35f60c3e8b7b37 | [
"MIT"
] | null | null | null | Thesis_test_affnet_match_features_isprsimageblocks.py | Childhoo/Chen_Matcher | ca89a4774a083d10177186020c35f60c3e8b7b37 | [
"MIT"
] | null | null | null | Thesis_test_affnet_match_features_isprsimageblocks.py | Childhoo/Chen_Matcher | ca89a4774a083d10177186020c35f60c3e8b7b37 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Wed Sep 30 10:44:35 2020
@author: Lin Chen
match the features generated from learned aff modules
including:
1 aff+ori+desc
2 fullaff+desc
for the first one, the orientation module can be switched off.
aff/ori can be AffNet/OriNet or MGNet/MoNet
"""
import matplotlib... | 42.357143 | 219 | 0.654987 |
9e373c866623926f51b31048e5228d1aa3e6df45 | 2,818 | py | Python | setup.py | RDFLib/rdflib-rdfstar | c2ff299e624f40576a2f38e1a946e06c9fca766c | [
"BSD-3-Clause"
] | 1 | 2022-03-02T10:25:44.000Z | 2022-03-02T10:25:44.000Z | setup.py | RDFLib/rdflib-rdfstar | c2ff299e624f40576a2f38e1a946e06c9fca766c | [
"BSD-3-Clause"
] | 3 | 2022-03-02T05:43:12.000Z | 2022-03-29T23:29:26.000Z | setup.py | RDFLib/rdflib-rdfstar | c2ff299e624f40576a2f38e1a946e06c9fca766c | [
"BSD-3-Clause"
] | 1 | 2022-03-15T22:05:24.000Z | 2022-03-15T22:05:24.000Z | #!/usr/bin/env python
import codecs
import os
import re
from setuptools import find_packages, setup
kwargs = {}
kwargs["install_requires"] = [
"isodate",
"pyparsing",
"setuptools",
"importlib-metadata; python_version < '3.8.0'",
]
kwargs["tests_require"] = [
"berkeleydb",
"html5lib",
"net... | 28.18 | 75 | 0.62846 |
9e3789006727121b6159307994cdde75a92a5140 | 8,384 | py | Python | v1_simple_cell/all_ori_lif_sim.py | ghadj/Cat-V1-Simple-Cell | 04d16b93f9ed48053c843ed756310382a158c5e3 | [
"MIT"
] | null | null | null | v1_simple_cell/all_ori_lif_sim.py | ghadj/Cat-V1-Simple-Cell | 04d16b93f9ed48053c843ed756310382a158c5e3 | [
"MIT"
] | null | null | null | v1_simple_cell/all_ori_lif_sim.py | ghadj/Cat-V1-Simple-Cell | 04d16b93f9ed48053c843ed756310382a158c5e3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
import math
import numpy as np
from matplotlib import pyplot as plt
import stimuli
import plots
import utils as local_utils
def get_active_rfc(xs_on, ys_on, xs_off, ys_off, time, total_rfc):
# Returns the number of the active RF centers, i.e. ON on light and
# O... | 40.502415 | 112 | 0.617247 |
9e378b1d332991c4ed240ebc5f1abc010c6ed38f | 1,202 | py | Python | gibson2/robots/ant_robot.py | i-m-vivek/iGibson | c9009a3da4bfe05e8a3c058d83e0a5d3be0cd648 | [
"MIT"
] | 3 | 2021-02-07T14:00:38.000Z | 2021-07-03T19:40:59.000Z | gibson2/robots/ant_robot.py | i-m-vivek/iGibson | c9009a3da4bfe05e8a3c058d83e0a5d3be0cd648 | [
"MIT"
] | null | null | null | gibson2/robots/ant_robot.py | i-m-vivek/iGibson | c9009a3da4bfe05e8a3c058d83e0a5d3be0cd648 | [
"MIT"
] | 2 | 2021-04-01T12:14:59.000Z | 2021-06-18T13:04:39.000Z | import gym
import numpy as np
from gibson2.robots.robot_locomotor import LocomotorRobot
class Ant(LocomotorRobot):
"""
OpenAI Ant Robot
Uses joint torque control
"""
def __init__(self, config):
self.config = config
self.torque = config.get("torque", 1.0)
LocomotorRobot.__... | 28.619048 | 68 | 0.535774 |
9e379c64d33657e03913f74cbc748fa760f4ae12 | 1,316 | py | Python | leetcode_python/Math/elimination-game.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | 18 | 2019-08-01T07:45:02.000Z | 2022-03-31T18:05:44.000Z | leetcode_python/Math/elimination-game.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | null | null | null | leetcode_python/Math/elimination-game.py | yennanliu/Python_basics | 6a597442d39468295946cefbfb11d08f61424dc3 | [
"Unlicense"
] | 15 | 2019-12-29T08:46:20.000Z | 2022-03-08T14:14:05.000Z | # V1
# class Solution(object):
# def lastRemaining(self, n):
# mylist = [ i for i in range(1,n+1)]
# for i in range(n):
# print ('i :', i)
# print ('mylist :', mylist)
# if len(mylist) <= 2:
# if len(mylist) <= 1:
# return mylist[0]
# if i%2==0:
# return mylist[1]
# else:
# ret... | 21.57377 | 68 | 0.421733 |
9e37bb1d9fbc46a93e5c110de2e1356b1d7a8a37 | 2,572 | py | Python | twisted-client-2/get-poetry-simple.py | TinaTong-avi/twisted-intro | 5e694d173126c30a2c28c2457d6a5a2fd2d5e5db | [
"MIT"
] | 430 | 2015-01-04T05:38:08.000Z | 2022-02-23T04:12:46.000Z | twisted-client-2/get-poetry-simple.py | TinaTong-avi/twisted-intro | 5e694d173126c30a2c28c2457d6a5a2fd2d5e5db | [
"MIT"
] | 4 | 2016-02-15T03:53:15.000Z | 2020-06-20T20:16:28.000Z | twisted-client-2/get-poetry-simple.py | TinaTong-avi/twisted-intro | 5e694d173126c30a2c28c2457d6a5a2fd2d5e5db | [
"MIT"
] | 284 | 2015-01-11T18:41:58.000Z | 2022-02-23T04:12:53.000Z | # This is the Twisted Get Poetry Now! client, version 2.1.
# NOTE: This should not be used as the basis for production code.
import optparse
from twisted.internet.protocol import Protocol, ClientFactory
def parse_args():
usage = """usage: %prog [options] [hostname]:port ...
This is the Get Poetry Now! client,... | 23.381818 | 67 | 0.648911 |
9e37bd1c962c9683b40a73f6f50ae500eaf93b9e | 24 | py | Python | btd6_memory_info/generated/Assets/Scripts/Simulation/Bloons/BloonManager/bloon_manager.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/Assets/Scripts/Simulation/Bloons/BloonManager/bloon_manager.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | btd6_memory_info/generated/Assets/Scripts/Simulation/Bloons/BloonManager/bloon_manager.py | 56kyle/bloons_auto | 419d55b51d1cddc49099593970adf1c67985b389 | [
"MIT"
] | null | null | null | class BloonManager: pass | 24 | 24 | 0.875 |
9e37cb35420e72f1c71bf865bcea7dd2d190638c | 6,675 | py | Python | toscatranslator/configuration_tools/common/configuration_tool.py | sadimer/clouni | 589d23cb537b88077adcc1235e429fc17fabdb90 | [
"Apache-2.0"
] | null | null | null | toscatranslator/configuration_tools/common/configuration_tool.py | sadimer/clouni | 589d23cb537b88077adcc1235e429fc17fabdb90 | [
"Apache-2.0"
] | null | null | null | toscatranslator/configuration_tools/common/configuration_tool.py | sadimer/clouni | 589d23cb537b88077adcc1235e429fc17fabdb90 | [
"Apache-2.0"
] | null | null | null | import six
import copy
from toscatranslator.common import utils
from toscatranslator.common.tosca_reserved_keys import NODES, RELATIONSHIPS, INTERFACES, GET_OPERATION_OUTPUT, SELF, \
IMPLEMENTATION
from toscaparser.common.exception import ExceptionCollector
from toscatranslator.common.exception import TemplateDep... | 36.081081 | 118 | 0.618577 |
9e381b44ea3d03da11cf7f21a46eae165fbf1bc5 | 15,500 | py | Python | tests/test_thread.py | eggplants/pybsddb-mirror | 692635036ffa70e2562da94ea0a447d15ae57025 | [
"BSD-3-Clause"
] | null | null | null | tests/test_thread.py | eggplants/pybsddb-mirror | 692635036ffa70e2562da94ea0a447d15ae57025 | [
"BSD-3-Clause"
] | null | null | null | tests/test_thread.py | eggplants/pybsddb-mirror | 692635036ffa70e2562da94ea0a447d15ae57025 | [
"BSD-3-Clause"
] | null | null | null | """
Copyright (c) 2008-2022, Jesus Cea Avion <jcea@jcea.es>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of... | 31.25 | 80 | 0.548258 |
9e382f0f008454df48f8b79052ce549b0d8d0445 | 4,885 | py | Python | _old/MakeGNNDatasets.py | Bogeluno/GNN_Thesis | b1a3e60d9b9a189b1c97ea7479d6606e45d32538 | [
"MIT"
] | null | null | null | _old/MakeGNNDatasets.py | Bogeluno/GNN_Thesis | b1a3e60d9b9a189b1c97ea7479d6606e45d32538 | [
"MIT"
] | null | null | null | _old/MakeGNNDatasets.py | Bogeluno/GNN_Thesis | b1a3e60d9b9a189b1c97ea7479d6606e45d32538 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from tqdm import tqdm
import pickle
import glob
from scipy import sparse
import torch
import gc
import subprocess
from torch_geometric import utils, data
pd.set_option('mode.chained_assignment',None)
# Get zones
zones = [int(z[3:]) for z in pd.read_csv('SimpleNNData.csv', index_c... | 35.143885 | 228 | 0.709314 |
9e38413b8853e0104c61db1c589ec811b29da878 | 5,126 | py | Python | src/test_only_plugins/heroku/plugin.py | FelixSchwarz/sentry | 7c92c4fa2b6b9f214764f48c82594acae1549e52 | [
"BSD-3-Clause"
] | null | null | null | src/test_only_plugins/heroku/plugin.py | FelixSchwarz/sentry | 7c92c4fa2b6b9f214764f48c82594acae1549e52 | [
"BSD-3-Clause"
] | null | null | null | src/test_only_plugins/heroku/plugin.py | FelixSchwarz/sentry | 7c92c4fa2b6b9f214764f48c82594acae1549e52 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
import logging
from sentry.api import client
from sentry.models import ApiKey, User, ProjectOption, Repository
from sentry.plugins.interfaces.releasehook import ReleaseHook
from test_only_plugins.base import CorePluginMixin
from sentry.plugins.base.configuration import react_pl... | 37.144928 | 100 | 0.571011 |
9e384ae0c5fa9b7ce4dba1290316f24e7ccb3333 | 6,377 | py | Python | youchoose/data/example_datasets/instacart_dataset.py | csmithchicago/analyze_instacart_data | c2040ad1f0ceba468667ea952e2a617fd7355473 | [
"MIT"
] | 1 | 2021-03-19T22:13:43.000Z | 2021-03-19T22:13:43.000Z | youchoose/data/example_datasets/instacart_dataset.py | csmithchicago/YouChoose | c2040ad1f0ceba468667ea952e2a617fd7355473 | [
"MIT"
] | 218 | 2019-07-03T03:14:35.000Z | 2022-03-31T14:48:06.000Z | youchoose/data/example_datasets/instacart_dataset.py | csmithchicago/analyze_instacart_data | c2040ad1f0ceba468667ea952e2a617fd7355473 | [
"MIT"
] | 1 | 2022-02-28T02:51:42.000Z | 2022-02-28T02:51:42.000Z | # Copyright (c) 2019, Corey Smith
# Distributed under the MIT License.
# See LICENCE file in root directory for full terms.
"""
Download and unzip instacart data.
"""
import os
import shutil
from datetime import datetime
import wget
import requests
from bs4 import BeautifulSoup
def create_adjancency_matrix(db, save... | 30.511962 | 99 | 0.574251 |
9e386d750c4c2ddd2776e5499098d053f784ed09 | 132 | py | Python | dcss_stats_cli/__init__.py | oschwab/dcss_stats | 33bd337277ab01289a541864032350d46acca885 | [
"Unlicense"
] | 3 | 2017-10-02T21:45:49.000Z | 2021-12-24T02:11:50.000Z | dcss_stats_cli/__init__.py | oschwab/dcss_stats | 33bd337277ab01289a541864032350d46acca885 | [
"Unlicense"
] | 2 | 2017-10-04T18:44:50.000Z | 2017-10-05T11:11:36.000Z | dcss_stats_cli/__init__.py | oschwab/dcss_stats | 33bd337277ab01289a541864032350d46acca885 | [
"Unlicense"
] | null | null | null | """dcss_stats_cli - Command line interface for Statistics tool """
__author__ = 'OSchwab <olivier.schwab72@gmail.com>'
__all__ = [] | 33 | 66 | 0.742424 |
9e38a14f2a1a23c9d688d95c8f4095ab711a4321 | 1,952 | py | Python | jinjamator/daemon/api/parsers.py | jinjamator/jinjamator-core | 928a6db56a20f57d6f7dc66fb46de71de945817e | [
"Apache-2.0"
] | 7 | 2020-05-06T07:48:14.000Z | 2021-12-11T15:57:26.000Z | jinjamator/daemon/api/parsers.py | jinjamator/jinjamator-core | 928a6db56a20f57d6f7dc66fb46de71de945817e | [
"Apache-2.0"
] | 1 | 2020-04-11T15:13:07.000Z | 2020-04-27T20:01:34.000Z | jinjamator/daemon/api/parsers.py | jinjamator/jinjamator-core | 928a6db56a20f57d6f7dc66fb46de71de945817e | [
"Apache-2.0"
] | 1 | 2020-05-29T08:53:08.000Z | 2020-05-29T08:53:08.000Z | # Copyright 2019 Wilhelm Putz
# 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, s... | 29.575758 | 86 | 0.743852 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.