hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7519c4ab911ea14338546376a2c65e817f2a158d | 2,035 | py | Python | scripts/ann_architectures/imagenet/train_vgg16.py | embeddedlabsiu/snn_exploration_spinnaker | 5cde5f4c705719058bc0b913f2353eac3bd580b3 | [
"MIT"
] | 1 | 2020-06-05T13:04:29.000Z | 2020-06-05T13:04:29.000Z | scripts/ann_architectures/imagenet/train_vgg16.py | embeddedlabsiu/snn_exploration_spinnaker | 5cde5f4c705719058bc0b913f2353eac3bd580b3 | [
"MIT"
] | null | null | null | scripts/ann_architectures/imagenet/train_vgg16.py | embeddedlabsiu/snn_exploration_spinnaker | 5cde5f4c705719058bc0b913f2353eac3bd580b3 | [
"MIT"
] | null | null | null | import os
import json
from keras.preprocessing.image import ImageDataGenerator
from keras.applications.imagenet_utils import preprocess_input
from keras.applications.vgg16 import VGG16
from keras.callbacks import TensorBoard
from keras.metrics import top_k_categorical_accuracy
from keras.optimizers import SGD
data_pa... | 35.086207 | 77 | 0.770516 |
f667e94c9288e56eb047b3ef17233efafcaddfce | 917 | py | Python | main.py | kopeadri/BSI-Project | 28484314b52aaaf85351c9e24370db06be8bb67d | [
"BSD-2-Clause"
] | null | null | null | main.py | kopeadri/BSI-Project | 28484314b52aaaf85351c9e24370db06be8bb67d | [
"BSD-2-Clause"
] | null | null | null | main.py | kopeadri/BSI-Project | 28484314b52aaaf85351c9e24370db06be8bb67d | [
"BSD-2-Clause"
] | null | null | null | import os
import argparse
import sys
from Analyzer import Analyzer
from ArgParser import ArgParser
def main():
# arguments = sys.argv[1:] # omit program name
arguments = ['-f', 'Resources\Pcap2.pcap']
# arguments = ['-f', 'Resources\wireshark3.pcap']
# arguments = ['-c', '500']
# arguments = ['-... | 28.65625 | 118 | 0.649945 |
7efd2e8974664dfda568c0c18662764deb6917df | 912 | py | Python | apps/app_user/migrations/0002_userlogin.py | ocswor/clendar_backend | 810835941d371ee4ba13bee3dd0c1be130bee7d2 | [
"MIT"
] | null | null | null | apps/app_user/migrations/0002_userlogin.py | ocswor/clendar_backend | 810835941d371ee4ba13bee3dd0c1be130bee7d2 | [
"MIT"
] | null | null | null | apps/app_user/migrations/0002_userlogin.py | ocswor/clendar_backend | 810835941d371ee4ba13bee3dd0c1be130bee7d2 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.2 on 2019-12-29 12:16
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app_user', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='UserLogin',
... | 32.571429 | 120 | 0.569079 |
c3b63d6f836ae00b1b189fc6626a6a1356931c99 | 6,565 | py | Python | tests/bootstrap.py | hnakamur/trafficserver-deb | 60efe9253292f7a4fb8c37430a12ce9056190711 | [
"Apache-2.0"
] | null | null | null | tests/bootstrap.py | hnakamur/trafficserver-deb | 60efe9253292f7a4fb8c37430a12ce9056190711 | [
"Apache-2.0"
] | null | null | null | tests/bootstrap.py | hnakamur/trafficserver-deb | 60efe9253292f7a4fb8c37430a12ce9056190711 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# this script sets up the testing packages to allow the tests
# 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 ... | 26.051587 | 88 | 0.618126 |
dab60c7749f91caec80bbc52f08b0fddeeaadb80 | 4,562 | py | Python | pysnmp/H3C-EPON-FB-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/H3C-EPON-FB-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/H3C-EPON-FB-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module H3C-EPON-FB-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/H3C-EPON-FB-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 19:09:05 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python version 3.7.3 (default, Mar 27... | 120.052632 | 538 | 0.769838 |
870f9b029ceef184386229c3ae8362700d6d39a5 | 32,802 | py | Python | tests/rule_based_profiler/parameter_builder/test_mean_unexpected_map_metric_multi_batch_parameter_builder.py | chrisarnold91/great_expectations | 9ea7be63b1219a70f49114dee5c433fd8470ffd2 | [
"Apache-2.0"
] | null | null | null | tests/rule_based_profiler/parameter_builder/test_mean_unexpected_map_metric_multi_batch_parameter_builder.py | chrisarnold91/great_expectations | 9ea7be63b1219a70f49114dee5c433fd8470ffd2 | [
"Apache-2.0"
] | null | null | null | tests/rule_based_profiler/parameter_builder/test_mean_unexpected_map_metric_multi_batch_parameter_builder.py | chrisarnold91/great_expectations | 9ea7be63b1219a70f49114dee5c433fd8470ffd2 | [
"Apache-2.0"
] | null | null | null | from typing import Any, Dict, List, Optional
import numpy as np
import pytest
from great_expectations import DataContext
from great_expectations.execution_engine.execution_engine import MetricDomainTypes
from great_expectations.rule_based_profiler.config import ParameterBuilderConfig
from great_expectations.rule_base... | 39.236842 | 198 | 0.750869 |
52e3fb8fd7b2003933db1324a4cfb056ce2ca853 | 434 | py | Python | diffpads_plugin.py | Tuetuopay/diffpads | 91706199177ccaf3a19a832a524ba1ffce9761c5 | [
"Beerware"
] | 1 | 2021-10-15T05:41:26.000Z | 2021-10-15T05:41:26.000Z | diffpads_plugin.py | Tuetuopay/diffpads | 91706199177ccaf3a19a832a524ba1ffce9761c5 | [
"Beerware"
] | null | null | null | diffpads_plugin.py | Tuetuopay/diffpads | 91706199177ccaf3a19a832a524ba1ffce9761c5 | [
"Beerware"
] | null | null | null | #!/usr/bin/env python
# Diff Pads for pcbnew using bezier curves as an exit
from pcbnew import ActionPlugin, GetBoard
from .diffpads_dialog import init_diffpads_dialog
class DiffPadsPlugin(ActionPlugin):
def defaults(self):
self.name = "DiffPads"
self.category = "Modify PCB"
self.descript... | 27.125 | 73 | 0.721198 |
394ae8303457f915ea5e532379c76445f40d1961 | 1,164 | py | Python | setup.py | qwertypool/django-simple-menu | 7a1eff63e6d2d15b4265207cfa5cf79dedf4b9a4 | [
"BSD-2-Clause"
] | null | null | null | setup.py | qwertypool/django-simple-menu | 7a1eff63e6d2d15b4265207cfa5cf79dedf4b9a4 | [
"BSD-2-Clause"
] | null | null | null | setup.py | qwertypool/django-simple-menu | 7a1eff63e6d2d15b4265207cfa5cf79dedf4b9a4 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
import re
from setuptools import setup
# load our version from our init file
init_data = open('menu/__init__.py').read()
matches = re.search(r"__version__ = '([^']+)'", init_data, re.M)
if matches:
version = matches.group(1)
else:
raise RuntimeError("Unable to load version")
requiremen... | 29.846154 | 83 | 0.640034 |
958c0eda37fa32fda2940b5af7198bb60d3609f7 | 558 | py | Python | packages/python/plotly/plotly/validators/heatmapgl/colorbar/_tickmode.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/heatmapgl/colorbar/_tickmode.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/heatmapgl/colorbar/_tickmode.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class TickmodeValidator(_plotly_utils.basevalidators.EnumeratedValidator):
def __init__(
self, plotly_name="tickmode", parent_name="heatmapgl.colorbar", **kwargs
):
super(TickmodeValidator, self).__init__(
plotly_name=plotly_name,
par... | 34.875 | 80 | 0.636201 |
d839c481189cb3fa9644f6624d0a0ac2ab7924ed | 6,646 | py | Python | configs/sku110k_cascade_rcnn_x101_32x4d_fpn_anchor_1x_fold3_2s.py | tyomj/product_detection | 380cfdd7eb581971649857132080d19e7a7f698d | [
"Apache-2.0"
] | 49 | 2020-06-16T02:23:21.000Z | 2022-03-28T03:52:53.000Z | configs/sku110k_cascade_rcnn_x101_32x4d_fpn_anchor_1x_fold3_2s.py | tyomj/product_detection | 380cfdd7eb581971649857132080d19e7a7f698d | [
"Apache-2.0"
] | 5 | 2020-06-26T08:43:26.000Z | 2021-09-17T13:34:53.000Z | configs/sku110k_cascade_rcnn_x101_32x4d_fpn_anchor_1x_fold3_2s.py | tyomj/product_detection | 380cfdd7eb581971649857132080d19e7a7f698d | [
"Apache-2.0"
] | 7 | 2020-06-23T06:30:25.000Z | 2021-12-15T02:02:50.000Z | # model settings
model = dict(
type='CascadeRCNN',
num_stages=2,
#pretrained='torchvision://resnet50',
backbone=dict(
type='ResNeXt',
depth=101,
groups=32,
base_width=4,
num_stages=4,
out_indices=(0, 1, 2, 3),
frozen_stages=1,
norm_cfg=dict... | 31.647619 | 109 | 0.566205 |
76a5bf9c2fa3f2d04ef87ad980f7df644efd2946 | 7,419 | py | Python | Models/base_model.py | nguyenvo09/EACL2021 | 9d04d8954c1ded2110daac23117de11221f08cc6 | [
"MIT"
] | 27 | 2021-01-18T16:03:17.000Z | 2022-03-05T22:38:34.000Z | Models/base_model.py | Jason98Xu/GET | 6860c87425619954cacbf5a14ad20befd18ec818 | [
"MIT"
] | null | null | null | Models/base_model.py | Jason98Xu/GET | 6860c87425619954cacbf5a14ad20befd18ec818 | [
"MIT"
] | 2 | 2022-03-16T03:22:16.000Z | 2022-03-27T03:12:14.000Z | """
Base model for all matching model
"""
from torch import nn
from matchzoo.engine.param_table import ParamTable
from matchzoo.engine.param import Param
from matchzoo.engine import hyper_spaces
import typing
from matchzoo.utils import parse
import numpy as np
import torch
import torch_utils as my_utils
class BaseMo... | 36.367647 | 104 | 0.536056 |
7cb8b3ff68c149bf06c603d044e28bd4d09d6030 | 6,293 | py | Python | cnn_architectures/mixup/resnet_cifar/train_cifar10_leilaclip_mixup_largesample_baseline_5625.py | leilayasmeen/MSc_Thesis | ee5e1782ab4a1d86c5dc0f5dc4111b4432ae204d | [
"MIT"
] | 2 | 2019-10-29T03:26:20.000Z | 2021-03-07T10:02:39.000Z | cnn_architectures/mixup/resnet_cifar/train_cifar10_leilaclip_mixup_largesample_baseline_5625.py | leilayasmeen/MSc_Thesis | ee5e1782ab4a1d86c5dc0f5dc4111b4432ae204d | [
"MIT"
] | null | null | null | cnn_architectures/mixup/resnet_cifar/train_cifar10_leilaclip_mixup_largesample_baseline_5625.py | leilayasmeen/MSc_Thesis | ee5e1782ab4a1d86c5dc0f5dc4111b4432ae204d | [
"MIT"
] | null | null | null | # Training procedure for CIFAR-10 using ResNet 110.
# ResNet model from https://github.com/BIGBALLON/cifar-10-cnn/blob/master/4_Residual_Network/ResNet_keras.py
import keras
import numpy as np
from keras.datasets import cifar10
from keras.preprocessing.image import ImageDataGenerator
from keras.layers.normalization im... | 38.139394 | 132 | 0.646115 |
a39fa0eda38817c03cb5f5faa5ae3af5490e5fe0 | 3,082 | py | Python | datasets/sampler.py | ztmo520/NeuralRecon | 576c2573fc5028c5a6116d344a0774cb95737621 | [
"Apache-2.0"
] | 1,001 | 2021-04-02T01:28:39.000Z | 2022-03-31T21:43:39.000Z | datasets/sampler.py | ztmo520/NeuralRecon | 576c2573fc5028c5a6116d344a0774cb95737621 | [
"Apache-2.0"
] | 79 | 2021-05-07T17:37:46.000Z | 2022-03-30T10:37:27.000Z | datasets/sampler.py | ztmo520/NeuralRecon | 576c2573fc5028c5a6116d344a0774cb95737621 | [
"Apache-2.0"
] | 160 | 2021-04-02T12:20:18.000Z | 2022-03-31T17:15:48.000Z | import math
import torch
import torch.distributed as dist
from torch.utils.data.distributed import Sampler
class DistributedSampler(Sampler):
"""Sampler that restricts data loading to a subset of the dataset.
It is especially useful in conjunction with
:class:`torch.nn.parallel.DistributedDataParallel`. ... | 37.13253 | 86 | 0.652174 |
1b673900d60ea7e274b3c3a9b652e7ba2fe751b6 | 1,045 | py | Python | GestureAgents/System.py | chaosct/GestureAgents | 9ec0adb1e59bf995d5808431edd4cb8bf8907728 | [
"MIT"
] | 1 | 2015-01-22T10:42:09.000Z | 2015-01-22T10:42:09.000Z | GestureAgents/System.py | chaosct/GestureAgents | 9ec0adb1e59bf995d5808431edd4cb8bf8907728 | [
"MIT"
] | null | null | null | GestureAgents/System.py | chaosct/GestureAgents | 9ec0adb1e59bf995d5808431edd4cb8bf8907728 | [
"MIT"
] | null | null | null | from GestureAgents.Events import Event
import GestureAgents.Reactor as Reactor
class System(object):
"""
Reference implementation of a system holding a recognizer tree
"""
def __init__(self, sources=None):
self.new_agents = {}
self.recognizers = []
self.sources = sources or []
... | 26.794872 | 66 | 0.605742 |
2bf085515b46f7d3ae630838ce60d27825ec8b82 | 254 | py | Python | backend/note_api/urls.py | gorkemarslan/note-me | 6f622237184c513ecd6dd34d5b5912d6def5e238 | [
"MIT"
] | null | null | null | backend/note_api/urls.py | gorkemarslan/note-me | 6f622237184c513ecd6dd34d5b5912d6def5e238 | [
"MIT"
] | null | null | null | backend/note_api/urls.py | gorkemarslan/note-me | 6f622237184c513ecd6dd34d5b5912d6def5e238 | [
"MIT"
] | null | null | null | from django.urls import path
from note_api import views
urlpatterns = [
path('', views.get_routes, name='routes'),
path('notes/', views.get_note_list, name='note_list'),
path('notes/<int:pk>/', views.get_note_detail, name='note_detail'),
]
| 25.4 | 71 | 0.692913 |
78568d7abdc5bfdb8450276e6a86a51c0d6ab556 | 465 | py | Python | apps/stock/migrations/0006_auto_20210124_1236.py | kwanj-k/ctrim_api | e3ed4afcbcc138400f219f3637b51514e2696e5c | [
"MIT"
] | 1 | 2018-03-11T06:08:13.000Z | 2018-03-11T06:08:13.000Z | apps/stock/migrations/0006_auto_20210124_1236.py | kwanj-k/ctrim_api | e3ed4afcbcc138400f219f3637b51514e2696e5c | [
"MIT"
] | 4 | 2019-07-22T14:19:35.000Z | 2022-02-10T09:13:08.000Z | apps/stock/migrations/0006_auto_20210124_1236.py | kwanj-k/ctrim_api | e3ed4afcbcc138400f219f3637b51514e2696e5c | [
"MIT"
] | null | null | null | # Generated by Django 2.2.9 on 2021-01-24 12:36
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('stock', '0005_auto_20210124_1040'),
]
operations = [
migrations.AlterModelOptions(
name='stockproduct',
options={},
... | 21.136364 | 51 | 0.574194 |
14f5725b86c7dc73f566ba23c8b1cfdc5060ef12 | 15,043 | py | Python | test/functional/wallet_bumpfee.py | team247/woodcore | da770f4e5427ec73b1ad43846e889fc4ddb7e6c6 | [
"MIT"
] | 1 | 2021-06-15T08:48:42.000Z | 2021-06-15T08:48:42.000Z | test/functional/wallet_bumpfee.py | team247/woodcore | da770f4e5427ec73b1ad43846e889fc4ddb7e6c6 | [
"MIT"
] | null | null | null | test/functional/wallet_bumpfee.py | team247/woodcore | da770f4e5427ec73b1ad43846e889fc4ddb7e6c6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2016-2018 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 the bumpfee RPC.
Verifies that the bumpfee RPC creates replacement transactions successfully when... | 46.862928 | 159 | 0.729642 |
6223630d4a799a63971a92e17bac7a84de647c98 | 6,888 | py | Python | qiskit/aqua/components/variational_forms/ryrz.py | hushaohan/aqua | 8512bc6ce246a8b3cca1e5edb1703b6885aa7c5d | [
"Apache-2.0"
] | 1 | 2019-10-12T16:20:25.000Z | 2019-10-12T16:20:25.000Z | qiskit/aqua/components/variational_forms/ryrz.py | hushaohan/aqua | 8512bc6ce246a8b3cca1e5edb1703b6885aa7c5d | [
"Apache-2.0"
] | null | null | null | qiskit/aqua/components/variational_forms/ryrz.py | hushaohan/aqua | 8512bc6ce246a8b3cca1e5edb1703b6885aa7c5d | [
"Apache-2.0"
] | 1 | 2022-01-25T07:09:10.000Z | 2022-01-25T07:09:10.000Z | # -*- coding: utf-8 -*-
# This code is part of Qiskit.
#
# (C) Copyright IBM 2018, 2020.
#
# 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... | 46.857143 | 100 | 0.643438 |
6303628c577532ca0eb474a550f4dfc0015f35b7 | 680 | py | Python | Internetworking Distributed Project/cs558l_esha/lab5/leon_newfiles/server.py | supriyasingh01/github_basics | 8aa93f783cfe347368763ef31be5ab59fe8476a1 | [
"CC0-1.0"
] | null | null | null | Internetworking Distributed Project/cs558l_esha/lab5/leon_newfiles/server.py | supriyasingh01/github_basics | 8aa93f783cfe347368763ef31be5ab59fe8476a1 | [
"CC0-1.0"
] | null | null | null | Internetworking Distributed Project/cs558l_esha/lab5/leon_newfiles/server.py | supriyasingh01/github_basics | 8aa93f783cfe347368763ef31be5ab59fe8476a1 | [
"CC0-1.0"
] | null | null | null | #!/usr/bin/python
from socket import *
from sys import argv
from thread import start_new_thread
from threads import *
import os
sock = socket(AF_INET, SOCK_DGRAM)
sock.bind(('',int(argv[1])))
port_num= int(sys.argv[1])
num_of_servers=int(sys.argv[2])
index=0
def fork_server(port_num,index):
child_pid = os.fork()
... | 21.25 | 82 | 0.732353 |
e7af28de9c5e2f7ad8b2c109e12025c105d07104 | 1,149 | py | Python | test/functional/rpc_deprecated.py | ocvcoin/ocvcoin | e816ac4a7dc57b00a5e085052a6bb3c94bf4959b | [
"MIT"
] | 2 | 2021-10-30T04:29:45.000Z | 2021-12-11T16:49:57.000Z | test/functional/rpc_deprecated.py | ocvcoin/ocvcoin | e816ac4a7dc57b00a5e085052a6bb3c94bf4959b | [
"MIT"
] | 2 | 2021-09-13T22:46:42.000Z | 2021-09-14T08:47:00.000Z | test/functional/rpc_deprecated.py | ocvcoin/ocvcoin | e816ac4a7dc57b00a5e085052a6bb3c94bf4959b | [
"MIT"
] | 2 | 2021-11-18T09:48:59.000Z | 2021-12-23T04:33:02.000Z | #!/usr/bin/env python3
# Copyright (c) 2017-2020 The Ocvcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test deprecation of RPC calls."""
from test_framework.test_framework import OcvcoinTestFramework
class... | 38.3 | 117 | 0.681462 |
60f82a7a10ba10217e98674f77196aee5fc61533 | 916 | py | Python | solutions/257.binary-tree-paths.241426977.ac.py | satu0king/Leetcode-Solutions | 2edff60d76c2898d912197044f6284efeeb34119 | [
"MIT"
] | 78 | 2020-10-22T11:31:53.000Z | 2022-02-22T13:27:49.000Z | solutions/257.binary-tree-paths.241426977.ac.py | satu0king/Leetcode-Solutions | 2edff60d76c2898d912197044f6284efeeb34119 | [
"MIT"
] | null | null | null | solutions/257.binary-tree-paths.241426977.ac.py | satu0king/Leetcode-Solutions | 2edff60d76c2898d912197044f6284efeeb34119 | [
"MIT"
] | 26 | 2020-10-23T15:10:44.000Z | 2021-11-07T16:13:50.000Z | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def binaryTreePaths(self, root):
"""
:type root: TreeNode
:rtype: List[str]
"""
a... | 21.809524 | 56 | 0.387555 |
4abf0681894a39205994e0c2057243a87387221d | 482 | py | Python | 2020/15b.py | combatopera/advent2020 | 6fa54e91ef1a5443dff36c15e65892701293201f | [
"Unlicense"
] | 2 | 2021-12-04T00:02:12.000Z | 2021-12-11T05:38:45.000Z | 2020/15b.py | combatopera/advent2020 | 6fa54e91ef1a5443dff36c15e65892701293201f | [
"Unlicense"
] | null | null | null | 2020/15b.py | combatopera/advent2020 | 6fa54e91ef1a5443dff36c15e65892701293201f | [
"Unlicense"
] | 1 | 2020-12-20T18:50:54.000Z | 2020-12-20T18:50:54.000Z | #!/usr/bin/env python3
from pathlib import Path
totalturns = 30000000
def main():
t1 = {}
t2 = {}
turn = 1
with Path('input', '15').open() as f:
for n in map(int, f.read().split(',')):
t1[n] = t2.get(n)
t2[n] = turn
turn += 1
while turn <= totalturns:
... | 19.28 | 47 | 0.46473 |
0276705251539727eed8c4ca6f88d24d150d8360 | 4,576 | py | Python | omni_cv_rules/coconut/recursive.py | proboscis/omni-cv-rules | 0a3d4763c0c50bc32974a16531b3d0a1d396c05a | [
"MIT"
] | 2 | 2022-01-28T13:37:08.000Z | 2022-03-03T20:29:20.000Z | omni_cv_rules/coconut/recursive.py | proboscis/omni-cv-rules | 0a3d4763c0c50bc32974a16531b3d0a1d396c05a | [
"MIT"
] | null | null | null | omni_cv_rules/coconut/recursive.py | proboscis/omni-cv-rules | 0a3d4763c0c50bc32974a16531b3d0a1d396c05a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# __coconut_hash__ = 0x4bbe2f00
# Compiled with Coconut version 1.6.0 [Vocational Guidance Counsellor]
# Coconut Header: -------------------------------------------------------------
from __future__ import generator_stop
import sys as _coconut_sys, os as _coconut_os
_co... | 81.714286 | 834 | 0.73514 |
f0b79d423a8c240bd64dee60428cc489899956a0 | 1,669 | py | Python | calculation/sha_calc/sha_calc/verification/im_correlations.py | ucgmsim/gmhazard | d3d90b4c94b3d9605597a3efeccc8523a1e50c0e | [
"MIT"
] | null | null | null | calculation/sha_calc/sha_calc/verification/im_correlations.py | ucgmsim/gmhazard | d3d90b4c94b3d9605597a3efeccc8523a1e50c0e | [
"MIT"
] | 8 | 2021-10-13T02:33:23.000Z | 2022-03-29T21:01:08.000Z | calculation/sha_calc/sha_calc/verification/im_correlations.py | ucgmsim/gmhazard | d3d90b4c94b3d9605597a3efeccc8523a1e50c0e | [
"MIT"
] | null | null | null | """Produces a table of the correlations for non-pSA IM, and for
pSA produces period-based plots"""
import argparse
from typing import Sequence
from pathlib import Path
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sha_calc import gcim
DEFAULT_PERIODS = np.logspace(np.log(0.01000001), np... | 28.288136 | 83 | 0.672858 |
cb0d41622004cd107ae0b5920ce9b869b3606440 | 491 | py | Python | generators/repeater.py | CodyKochmann/generators | a637bf9cb5e48251aa800753ba0aa79b3ca18dcf | [
"MIT"
] | 6 | 2017-12-21T04:32:35.000Z | 2022-02-15T07:06:45.000Z | generators/repeater.py | CodyKochmann/generators | a637bf9cb5e48251aa800753ba0aa79b3ca18dcf | [
"MIT"
] | 21 | 2017-09-08T13:02:18.000Z | 2020-03-28T19:10:01.000Z | generators/repeater.py | CodyKochmann/generators | a637bf9cb5e48251aa800753ba0aa79b3ca18dcf | [
"MIT"
] | 2 | 2018-09-30T16:16:10.000Z | 2019-05-06T02:16:11.000Z | # -*- coding: utf-8 -*-
# @Author: Cody Kochmann
# @Date: 2018-02-17 14:26:22
# @Last Modified by: Cody Kochmann
# @Last Modified time: 2018-02-17 14:38:45
def repeater(pipe, how_many=2):
''' this function repeats each value in the pipeline however many times you need '''
r = range(how_many)
for i in p... | 25.842105 | 88 | 0.610998 |
6693d7b1cddffe6331a458ab63e364f654cbcb90 | 10,245 | py | Python | release/stubs.min/Rhino/Geometry/__init___parts/BoundingBox.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 182 | 2017-06-27T02:26:15.000Z | 2022-03-30T18:53:43.000Z | release/stubs.min/Rhino/Geometry/__init___parts/BoundingBox.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 28 | 2017-06-27T13:38:23.000Z | 2022-03-15T11:19:44.000Z | release/stubs.min/Rhino/Geometry/__init___parts/BoundingBox.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 67 | 2017-06-28T09:43:59.000Z | 2022-03-20T21:17:10.000Z | class BoundingBox(object):
"""
Represents the value of two points in a bounding box
defined by the two extreme corner points.
This box is therefore aligned to the world X,Y and Z axes.
BoundingBox(min: Point3d,max: Point3d)
BoundingBox(minX: float,minY: float,minZ: float,maxX: float,maxY... | 20.408367 | 108 | 0.659639 |
e58daf90b34601f9ca4eb28bbccd2f2d59bcc996 | 745 | py | Python | first_sublime3_plugin/awesome_plugin.py | lomignet/thisdataguy_snippets | f893bba7cc37b02328459de84c4afcad7350727c | [
"BSD-2-Clause"
] | 13 | 2015-10-15T18:27:48.000Z | 2022-01-31T13:14:50.000Z | first_sublime3_plugin/awesome_plugin.py | lomignet/thisdataguy_snippets | f893bba7cc37b02328459de84c4afcad7350727c | [
"BSD-2-Clause"
] | null | null | null | first_sublime3_plugin/awesome_plugin.py | lomignet/thisdataguy_snippets | f893bba7cc37b02328459de84c4afcad7350727c | [
"BSD-2-Clause"
] | 16 | 2015-08-05T14:37:00.000Z | 2021-07-15T11:52:51.000Z | # please always use shlex with subprocess
import shlex
import sublime
import sublime_plugin
import os
class UpdateOnSave(sublime_plugin.EventListener):
def on_post_save_async(self, view):
filename = view.file_name()
savedfile = os.path.basename(filename)
saveddir = os.path.dirname(filenam... | 27.592593 | 72 | 0.640268 |
ca2920a43632b8cbbe239baaac296fd98e832d87 | 2,000 | py | Python | src/neuron.py | drkostas/COSC525-Project1 | d92a2bc89a30b7377085dc13aea0934851931179 | [
"Apache-2.0"
] | null | null | null | src/neuron.py | drkostas/COSC525-Project1 | d92a2bc89a30b7377085dc13aea0934851931179 | [
"Apache-2.0"
] | 5 | 2022-02-04T00:37:42.000Z | 2022-02-18T18:56:37.000Z | src/neuron.py | drkostas/COSC525-Project1 | d92a2bc89a30b7377085dc13aea0934851931179 | [
"Apache-2.0"
] | null | null | null | import numpy as np
class Neuron:
# ACT_FUNCTION, NUM_INPUTS, LEARNING_RATE, [INIT_WEIGHTS]
def __init__(self, activation: str, num_inputs: int, lr: float, weights: np.ndarray):
# Initializes all input vars
self.activation = activation
self.num_inputs = num_inputs
self.lr = lr
... | 37.037037 | 95 | 0.6575 |
53d4558d45bf128aa61d612cc89922cd83824618 | 4,467 | py | Python | main.py | ppizarror/chansey-pygame-example | 49b42547c0a1c5d743f84c2b5a473708a79fdab3 | [
"MIT"
] | null | null | null | main.py | ppizarror/chansey-pygame-example | 49b42547c0a1c5d743f84c2b5a473708a79fdab3 | [
"MIT"
] | null | null | null | main.py | ppizarror/chansey-pygame-example | 49b42547c0a1c5d743f84c2b5a473708a79fdab3 | [
"MIT"
] | null | null | null | # importacion de librerias
import os
import random
import pygame
from pygame.locals import *
class Actor:
def __init__(self, dx, x, y, vida, size):
self.x = x
self.y = y
self.vida = vida
self.dx = dx
self.direccion = 0
self.initx = x
self.... | 27.404908 | 88 | 0.497873 |
39bf981b99889e03cd78e5517e9ad85b7eb90907 | 1,172 | py | Python | leetcode/0-250/249-509. Fibonacci Number.py | palash24/algorithms-and-data-structures | 164be7d1a501a21af808673888964bbab36243a1 | [
"MIT"
] | 23 | 2018-11-06T03:54:00.000Z | 2022-03-14T13:30:40.000Z | leetcode/0-250/249-509. Fibonacci Number.py | palash24/algorithms-and-data-structures | 164be7d1a501a21af808673888964bbab36243a1 | [
"MIT"
] | null | null | null | leetcode/0-250/249-509. Fibonacci Number.py | palash24/algorithms-and-data-structures | 164be7d1a501a21af808673888964bbab36243a1 | [
"MIT"
] | 5 | 2019-05-24T16:56:45.000Z | 2022-03-10T17:29:10.000Z | # 509. Fibonacci Number
class Solution:
def fib2(self, N: int) -> int:
F = [0, 1]
for i in range(2, N + 1):
F.append(F[i - 1] + F[i - 2])
return F[N]
def fib3(self, N: int) -> int:
if N < 2: return N
prev, cur = 0, 1
for i in range(2, N + 1):
... | 26.044444 | 63 | 0.43686 |
6bee6a9dd366a02faf0339f9aa1cb6023bed3f38 | 373 | py | Python | binance/__init__.py | tperalta82/python-binance | 860250d334f9616a89f53b3ca2adecba4ee2b0f2 | [
"MIT"
] | 1 | 2021-11-27T09:05:02.000Z | 2021-11-27T09:05:02.000Z | binance/__init__.py | tperalta82/python-binance | 860250d334f9616a89f53b3ca2adecba4ee2b0f2 | [
"MIT"
] | null | null | null | binance/__init__.py | tperalta82/python-binance | 860250d334f9616a89f53b3ca2adecba4ee2b0f2 | [
"MIT"
] | null | null | null | """An unofficial Python wrapper for the Binance exchange API v3
.. moduleauthor:: Sam McHardy
"""
__version__ = '1.0.10'
from binance.client import Client, AsyncClient # noqa
from binance.depthcache import DepthCacheManager, OptionsDepthCacheManager, ThreadedDepthCacheManager # noqa
from binance.streams import Bi... | 31.083333 | 109 | 0.806971 |
b72e21feb28b9f2a3734888fa4692bb3aac01244 | 9,666 | py | Python | mkdocs/nav.py | akutz/mkdocs | 0630c499081b69c8850e3b074cd6a05f15f27371 | [
"BSD-2-Clause"
] | 1 | 2015-12-14T02:20:13.000Z | 2015-12-14T02:20:13.000Z | mkdocs/nav.py | akutz/mkdocs | 0630c499081b69c8850e3b074cd6a05f15f27371 | [
"BSD-2-Clause"
] | null | null | null | mkdocs/nav.py | akutz/mkdocs | 0630c499081b69c8850e3b074cd6a05f15f27371 | [
"BSD-2-Clause"
] | 2 | 2020-03-22T06:22:45.000Z | 2021-10-02T08:41:18.000Z | # coding: utf-8
"""
Deals with generating the site-wide navigation.
This consists of building a set of interlinked page and header objects.
"""
from __future__ import unicode_literals
import datetime
import logging
import os
from mkdocs import utils, exceptions
log = logging.getLogger(__name__)
def filename_to_t... | 31.796053 | 100 | 0.641941 |
59e6389fac674a564948fc3579754d06af901886 | 43,927 | py | Python | astropy/visualization/wcsaxes/coordinate_helpers.py | MatiasRepetto/astropy | 689f9d3b063145150149e592a879ee40af1fac06 | [
"BSD-3-Clause"
] | null | null | null | astropy/visualization/wcsaxes/coordinate_helpers.py | MatiasRepetto/astropy | 689f9d3b063145150149e592a879ee40af1fac06 | [
"BSD-3-Clause"
] | null | null | null | astropy/visualization/wcsaxes/coordinate_helpers.py | MatiasRepetto/astropy | 689f9d3b063145150149e592a879ee40af1fac06 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
"""
This file defines the classes used to represent a 'coordinate', which includes
axes, ticks, tick labels, and grid lines.
"""
import warnings
import numpy as np
from matplotlib.ticker import Formatter
from matplotlib.transforms import Affine2D, Scal... | 39.969973 | 155 | 0.584629 |
58d3c8fce0a4bbaae8d926879f5196318a85d451 | 9,052 | py | Python | flaxlight/server/start_service.py | Flax-Network/flax-light-wallet | 1745850a28a47bbbc4b5f3d460f35b34b4ed4f25 | [
"Apache-2.0"
] | 1 | 2021-12-02T14:38:11.000Z | 2021-12-02T14:38:11.000Z | flaxlight/server/start_service.py | Flax-Network/flax-light-wallet | 1745850a28a47bbbc4b5f3d460f35b34b4ed4f25 | [
"Apache-2.0"
] | null | null | null | flaxlight/server/start_service.py | Flax-Network/flax-light-wallet | 1745850a28a47bbbc4b5f3d460f35b34b4ed4f25 | [
"Apache-2.0"
] | 6 | 2021-11-21T00:38:27.000Z | 2021-12-03T01:25:19.000Z | import asyncio
import os
import logging
import logging.config
import signal
from sys import platform
from typing import Any, Callable, List, Optional, Tuple
from flaxlight.daemon.server import singleton, service_launch_lock_path
from flaxlight.server.ssl_context import flaxlight_ssl_ca_paths, private_ssl_ca_paths
try... | 35.359375 | 115 | 0.638202 |
ed4e563536cbee8441a79dd705406095fe0941b7 | 373 | py | Python | allennlp_models/version.py | zhiyangxu-umass/allennlp-models | d922f7a8075387ebed1a3e38e588345f706d3f02 | [
"Apache-2.0"
] | null | null | null | allennlp_models/version.py | zhiyangxu-umass/allennlp-models | d922f7a8075387ebed1a3e38e588345f706d3f02 | [
"Apache-2.0"
] | 11 | 2021-11-29T13:23:10.000Z | 2022-03-28T13:24:20.000Z | allennlp_models/version.py | zhiyangxu-umass/allennlp-models | d922f7a8075387ebed1a3e38e588345f706d3f02 | [
"Apache-2.0"
] | null | null | null | import os
_MAJOR = "2"
_MINOR = "6"
_PATCH = "0"
# This is mainly for nightly builds which have the suffix ".dev$DATE". See
# https://semver.org/#is-v123-a-semantic-version for the semantics.
_SUFFIX = os.environ.get("ALLENNLP_MODELS_VERSION_SUFFIX", "")
VERSION_SHORT = "{0}.{1}".format(_MAJOR, _MINOR)
VERSION = "{0}... | 31.083333 | 74 | 0.697051 |
43a368050e10ced68bb3353ae020282f95a61f4f | 47,073 | py | Python | python35/Lib/site-packages/sklearn/decomposition/nmf.py | Matchoc/python_env | 859d84d1717a265a4085ad29706b12c19c62d36f | [
"Apache-2.0"
] | null | null | null | python35/Lib/site-packages/sklearn/decomposition/nmf.py | Matchoc/python_env | 859d84d1717a265a4085ad29706b12c19c62d36f | [
"Apache-2.0"
] | null | null | null | python35/Lib/site-packages/sklearn/decomposition/nmf.py | Matchoc/python_env | 859d84d1717a265a4085ad29706b12c19c62d36f | [
"Apache-2.0"
] | 1 | 2020-05-07T11:04:14.000Z | 2020-05-07T11:04:14.000Z | """ Non-negative matrix factorization
"""
# Author: Vlad Niculae
# Lars Buitinck
# Mathieu Blondel <mathieu@mblondel.org>
# Tom Dupre la Tour
# Author: Chih-Jen Lin, National Taiwan University (original projected gradient
# NMF implementation)
# ... | 35.906178 | 83 | 0.598538 |
44cad153bebb635da9c2efbc583cb4111be3a953 | 7,405 | py | Python | nssrc/com/citrix/netscaler/nitro/resource/config/vpn/vpnglobal_intranetip_binding.py | guardicore/nitro-python | 5346a5086134aead80968f15a41ff527adaa0ec1 | [
"Apache-2.0"
] | null | null | null | nssrc/com/citrix/netscaler/nitro/resource/config/vpn/vpnglobal_intranetip_binding.py | guardicore/nitro-python | 5346a5086134aead80968f15a41ff527adaa0ec1 | [
"Apache-2.0"
] | null | null | null | nssrc/com/citrix/netscaler/nitro/resource/config/vpn/vpnglobal_intranetip_binding.py | guardicore/nitro-python | 5346a5086134aead80968f15a41ff527adaa0ec1 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2021 Citrix Systems, 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 applicable law or... | 31.244726 | 195 | 0.739905 |
236a45dba11515bc6349a011fdaa098af792ca8e | 4,063 | py | Python | runtime/tests/automl_runtime/forecast/utils_test.py | wenfeiy-db/automl | f63e259b0db0a19ca87c3ea851ab749e3ab57c3b | [
"Apache-2.0"
] | null | null | null | runtime/tests/automl_runtime/forecast/utils_test.py | wenfeiy-db/automl | f63e259b0db0a19ca87c3ea851ab749e3ab57c3b | [
"Apache-2.0"
] | null | null | null | runtime/tests/automl_runtime/forecast/utils_test.py | wenfeiy-db/automl | f63e259b0db0a19ca87c3ea851ab749e3ab57c3b | [
"Apache-2.0"
] | null | null | null | #
# Copyright (C) 2022 Databricks, 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 applicable law or agreed to i... | 48.951807 | 109 | 0.61654 |
5d12e549c7600e4e25ac11cfddf83d7f92d7f6e7 | 5,941 | py | Python | venv/lib/python2.7/site-packages/flask_admin/form/fields.py | MarioAer/BubblesData | 849cc6428b5e8d64f5517f94a714e3f737bfc75d | [
"MIT"
] | null | null | null | venv/lib/python2.7/site-packages/flask_admin/form/fields.py | MarioAer/BubblesData | 849cc6428b5e8d64f5517f94a714e3f737bfc75d | [
"MIT"
] | null | null | null | venv/lib/python2.7/site-packages/flask_admin/form/fields.py | MarioAer/BubblesData | 849cc6428b5e8d64f5517f94a714e3f737bfc75d | [
"MIT"
] | null | null | null | import time
import datetime
from wtforms import fields, widgets
from flask_admin.babel import gettext
from flask_admin._compat import text_type, as_unicode
from . import widgets as admin_widgets
"""
An understanding of WTForms's Custom Widgets is helpful for understanding this code: http://wtforms.simplecodes.com/do... | 33.189944 | 154 | 0.565393 |
5919ff0cd55867e7bc034cdcab7d04cc95697592 | 39,381 | py | Python | RecoEgamma/ElectronIdentification/python/Identification/cutBasedElectronID_tools.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 1 | 2018-07-25T03:57:34.000Z | 2018-07-25T03:57:34.000Z | RecoEgamma/ElectronIdentification/python/Identification/cutBasedElectronID_tools.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 7 | 2016-07-17T02:34:54.000Z | 2019-08-13T07:58:37.000Z | RecoEgamma/ElectronIdentification/python/Identification/cutBasedElectronID_tools.py | NTrevisani/cmssw | a212a27526f34eb9507cf8b875c93896e6544781 | [
"Apache-2.0"
] | 2 | 2019-09-27T08:33:22.000Z | 2019-11-14T10:52:30.000Z |
import FWCore.ParameterSet.Config as cms
# Barrel/endcap division in eta
ebCutOff = 1.479
# ===============================================
# Define containers used by cut definitions
# ===============================================
class IsolationCutInputs_V2:
"""
A container class that holds the name of ... | 49.912548 | 138 | 0.578121 |
6f8a3926ef3a535b326347b99b45ba54376dff74 | 109 | py | Python | trobafeina/views.py | n0ss4/trobafeina | 4734a6459e423ddf051e98beb39072451ddb476f | [
"MIT"
] | null | null | null | trobafeina/views.py | n0ss4/trobafeina | 4734a6459e423ddf051e98beb39072451ddb476f | [
"MIT"
] | null | null | null | trobafeina/views.py | n0ss4/trobafeina | 4734a6459e423ddf051e98beb39072451ddb476f | [
"MIT"
] | null | null | null | from django.shortcuts import render
def index(request):
return render(request, 'JobOffer/index.html')
| 15.571429 | 49 | 0.752294 |
60bcc6eab0ef4252cd064e641268b21f839dda73 | 11,709 | py | Python | parser.py | PhilippThoelke/protein-folding | 322483c60119c963574232d5b14d898166a92a15 | [
"MIT"
] | 8 | 2020-05-20T14:33:08.000Z | 2022-02-16T20:09:26.000Z | parser.py | PhilippThoelke/protein-folding | 322483c60119c963574232d5b14d898166a92a15 | [
"MIT"
] | 1 | 2022-03-18T09:13:52.000Z | 2022-03-18T20:31:55.000Z | parser.py | PhilippThoelke/protein-folding | 322483c60119c963574232d5b14d898166a92a15 | [
"MIT"
] | 2 | 2021-05-23T19:15:42.000Z | 2022-03-18T09:26:47.000Z | import xml.etree.ElementTree as ElementTree
import tensorflow as tf
import numpy as np
class Force:
def get_weighting(self):
return 1
class HarmonicBondForce(Force):
def __init__(self, atom1, atom2, length, k):
self.atom1 = atom1
self.atom2 = atom2
self.length = tf.constant(length)
self.k = tf.constant(k)... | 35.268072 | 158 | 0.707405 |
202fdcd1dcf5f68f9e9064aa7006f456e6131ad9 | 160 | py | Python | virtual/bin/django-admin.py | BrilliantGrant/Transaction-application | 988fdbd6ed8a1fea9ca8366eeb2b30275b727836 | [
"MIT",
"Unlicense"
] | null | null | null | virtual/bin/django-admin.py | BrilliantGrant/Transaction-application | 988fdbd6ed8a1fea9ca8366eeb2b30275b727836 | [
"MIT",
"Unlicense"
] | null | null | null | virtual/bin/django-admin.py | BrilliantGrant/Transaction-application | 988fdbd6ed8a1fea9ca8366eeb2b30275b727836 | [
"MIT",
"Unlicense"
] | null | null | null | #!/home/bri/Desktop/Transaction/virtual/bin/python3.6
from django.core import management
if __name__ == "__main__":
management.execute_from_command_line()
| 26.666667 | 53 | 0.7875 |
dfc2cbe31675277049bb67fb563e754c40bed59c | 8,477 | py | Python | test/functional/test_framework/key.py | RPGCoin/RPG-Core | bf0efd6f3d4426e11d195efe5aee7b7acabd9a3d | [
"MIT"
] | 5 | 2019-02-19T10:27:59.000Z | 2021-03-22T03:59:19.000Z | test/functional/test_framework/key.py | Matthelonianxl/RPG-Core | bf0efd6f3d4426e11d195efe5aee7b7acabd9a3d | [
"MIT"
] | 2 | 2019-02-19T09:46:38.000Z | 2019-02-25T19:09:41.000Z | test/functional/test_framework/key.py | Matthelonianxl/RPG-Core | bf0efd6f3d4426e11d195efe5aee7b7acabd9a3d | [
"MIT"
] | 2 | 2019-08-03T11:43:48.000Z | 2020-04-29T07:19:13.000Z | # Copyright (c) 2011 Sam Rushing
"""ECC secp256k1 OpenSSL wrapper.
WARNING: This module does not mlock() secrets; your private keys may end up on
disk in swap! Use with caution!
This file is modified from python-rpglib.
"""
import ctypes
import ctypes.util
import hashlib
import sys
ssl = ctypes.cdll.LoadLibrary(cty... | 36.381974 | 130 | 0.687389 |
663c64b471cba32f2d75da3d7fc52c95bc2729eb | 647 | py | Python | Codefights/arcade/python-arcade/level-9/57.Correct-Lineup/Python/test.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | 7 | 2017-09-20T16:40:39.000Z | 2021-08-31T18:15:08.000Z | Codefights/arcade/python-arcade/level-9/57.Correct-Lineup/Python/test.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | null | null | null | Codefights/arcade/python-arcade/level-9/57.Correct-Lineup/Python/test.py | RevansChen/online-judge | ad1b07fee7bd3c49418becccda904e17505f3018 | [
"MIT"
] | null | null | null | # Python3
from solution1 import correctLineup as f
qa = [
([1, 2, 3, 4, 5, 6],
[2, 1, 4, 3, 6, 5]),
([13, 42],
[42, 13]),
([2, 3, 1, 100, 99, 45, 22, 28],
[3, 2, 100, 1, 45, 99, 28, 22]),
([85, 32, 45, 67, 32, 12, 45, 67],
[32, 85, 67, 45, 12, 32, 67, 45]),
([60, 2, 24, 40],
... | 21.566667 | 47 | 0.409583 |
c4aa585be474782594a907ab6ed76b4ebec08d4e | 18,553 | py | Python | src/robot/variables/variables.py | VegiS/robotframework | 32dddb38f9d812497f9a89436e19925e4dbec299 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/robot/variables/variables.py | VegiS/robotframework | 32dddb38f9d812497f9a89436e19925e4dbec299 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | src/robot/variables/variables.py | VegiS/robotframework | 32dddb38f9d812497f9a89436e19925e4dbec299 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2018-10-30T15:40:09.000Z | 2018-10-30T15:40:09.000Z | # Copyright 2008-2014 Nokia Solutions and Networks
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 38.732777 | 83 | 0.598879 |
eaf3909ef9e912fde1bc9d6fd955646cc8ea6bd9 | 4,327 | py | Python | ivy/functional/backends/jax/elementwise.py | stolensharingan/ivy | 57b79ca51bb8d7eb43e72a2e0e03345c5e5cb56e | [
"Apache-2.0"
] | null | null | null | ivy/functional/backends/jax/elementwise.py | stolensharingan/ivy | 57b79ca51bb8d7eb43e72a2e0e03345c5e5cb56e | [
"Apache-2.0"
] | 1 | 2022-03-08T13:29:20.000Z | 2022-03-08T13:29:20.000Z | ivy/functional/backends/jax/elementwise.py | stolensharingan/ivy | 57b79ca51bb8d7eb43e72a2e0e03345c5e5cb56e | [
"Apache-2.0"
] | null | null | null | # global
import jax
import jax.numpy as jnp
# local
from ivy.functional.backends.jax import JaxArray
def expm1(x: JaxArray)\
-> JaxArray:
return jnp.expm1(x)
def bitwise_invert(x: JaxArray)\
-> JaxArray:
return jnp.bitwise_not(x)
def bitwise_and(x1: JaxArray,
... | 17.733607 | 62 | 0.561821 |
44d60444290ea174d77f766dffcc07832ee153c7 | 3,565 | py | Python | python/tests/collection/test_set.py | tachyonsoftware/algorithms | 29149a55de173b42dfa461838877fa66d018629f | [
"MIT"
] | 17 | 2016-06-29T08:41:51.000Z | 2022-02-04T13:39:13.000Z | python/tests/collection/test_set.py | tachyonsoftware/algorithms | 29149a55de173b42dfa461838877fa66d018629f | [
"MIT"
] | null | null | null | python/tests/collection/test_set.py | tachyonsoftware/algorithms | 29149a55de173b42dfa461838877fa66d018629f | [
"MIT"
] | 4 | 2016-05-09T19:02:47.000Z | 2021-02-22T02:05:41.000Z | import unittest
import random
from collection.set import Set
class TestSet(unittest.TestCase):
def setUp(self):
self.set = Set()
def test_constructor(self):
self.assertTrue(self.set.is_empty())
self.assertEquals(0, len(self.set))
def test_one_add(self):
element = 'foo'
... | 26.804511 | 61 | 0.592146 |
23fe43459f2a1bcbad0bf001d7ec6bb9f373c4eb | 3,146 | py | Python | tests/test_sphinx/conftest.py | agaric/MyST-Parser | 8dda2f73364853cb572a50c53434c385db266d7c | [
"MIT"
] | null | null | null | tests/test_sphinx/conftest.py | agaric/MyST-Parser | 8dda2f73364853cb572a50c53434c385db266d7c | [
"MIT"
] | null | null | null | tests/test_sphinx/conftest.py | agaric/MyST-Parser | 8dda2f73364853cb572a50c53434c385db266d7c | [
"MIT"
] | null | null | null | """
Uses sphinx's pytest fixture to run builds
usage:
.. code-block:: python
@pytest.mark.sphinx(
buildername='html',
srcdir='path/to/source')
def test_basic(app, status, warning, get_sphinx_app_output):
app.build()
assert 'build succeeded' in status.getvalue() # Build succ... | 26.661017 | 86 | 0.646535 |
e660d8bf0b1a926db169702d5ff0bdc8525b49e1 | 10,949 | py | Python | setup_services.py | filipmadej/bookclub-foundry-filipnew | d20d7f415b8aea505c2dc9fd287ccc29c3b57813 | [
"MIT"
] | null | null | null | setup_services.py | filipmadej/bookclub-foundry-filipnew | d20d7f415b8aea505c2dc9fd287ccc29c3b57813 | [
"MIT"
] | null | null | null | setup_services.py | filipmadej/bookclub-foundry-filipnew | d20d7f415b8aea505c2dc9fd287ccc29c3b57813 | [
"MIT"
] | 1 | 2018-10-14T03:34:21.000Z | 2018-10-14T03:34:21.000Z | #!/usr/bin/python
#***************************************************************************
# Copyright 2015 IBM
#
# 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.a... | 36.375415 | 124 | 0.623984 |
af63ffaf362141f219d73543a798152a642a27e0 | 2,587 | py | Python | bookwyrm/tests/views/admin/test_ip_blocklist.py | mouse-reeve/fedireads | e3471fcc3500747a1b1deaaca662021aae5b08d4 | [
"CC0-1.0"
] | 270 | 2020-01-27T06:06:07.000Z | 2020-06-21T00:28:18.000Z | bookwyrm/tests/views/admin/test_ip_blocklist.py | mouse-reeve/fedireads | e3471fcc3500747a1b1deaaca662021aae5b08d4 | [
"CC0-1.0"
] | 158 | 2020-02-10T20:36:54.000Z | 2020-06-26T17:12:54.000Z | bookwyrm/tests/views/admin/test_ip_blocklist.py | mouse-reeve/fedireads | e3471fcc3500747a1b1deaaca662021aae5b08d4 | [
"CC0-1.0"
] | 15 | 2020-02-13T21:53:33.000Z | 2020-06-17T16:52:46.000Z | """ test for app action functionality """
from unittest.mock import patch
from django.template.response import TemplateResponse
from django.test import TestCase
from django.test.client import RequestFactory
from bookwyrm import forms, models, views
from bookwyrm.tests.validate_html import validate_html
class IPBlock... | 34.959459 | 84 | 0.654039 |
fafaa89707e8c9308d81a8b25204778c333f19af | 2,640 | py | Python | zilencer/management/commands/render_messages.py | DD2480-group7-2020/zulip | 9a1e18bcf383c38c35da168563a7345768c6d784 | [
"Apache-2.0"
] | 1 | 2020-03-17T14:58:50.000Z | 2020-03-17T14:58:50.000Z | zilencer/management/commands/render_messages.py | DD2480-group7-2020/zulip | 9a1e18bcf383c38c35da168563a7345768c6d784 | [
"Apache-2.0"
] | 2 | 2020-09-07T22:32:24.000Z | 2021-05-08T18:17:53.000Z | zilencer/management/commands/render_messages.py | DD2480-group7-2020/zulip | 9a1e18bcf383c38c35da168563a7345768c6d784 | [
"Apache-2.0"
] | 1 | 2020-07-16T06:00:10.000Z | 2020-07-16T06:00:10.000Z | import os
from typing import Any, Iterator
import ujson
from django.core.management.base import BaseCommand, CommandParser
from django.db.models import QuerySet
from zerver.lib.message import render_markdown
from zerver.models import Message
def queryset_iterator(queryset: QuerySet, chunksize: int=5000) -> Iterator... | 41.25 | 100 | 0.597348 |
abd147a4f754dbfea8b024cfa0c68b7e31194561 | 9,494 | py | Python | Lib/site-packages/plotly/validators/_scattermapbox.py | tytanya/my-first-blog | 2b40adb0816c3546e90ad6ca1e7fb50d924c1536 | [
"bzip2-1.0.6"
] | 4 | 2020-02-05T11:26:47.000Z | 2021-05-26T07:48:46.000Z | Lib/site-packages/plotly/validators/_scattermapbox.py | tytanya/my-first-blog | 2b40adb0816c3546e90ad6ca1e7fb50d924c1536 | [
"bzip2-1.0.6"
] | 6 | 2021-03-18T22:27:08.000Z | 2022-03-11T23:40:50.000Z | venv/lib/python3.7/site-packages/plotly/validators/_scattermapbox.py | kylenahas/180LoginV1 | 8f64be6e6016d47dff8febfcfa3bbd56e9042f89 | [
"MIT"
] | 1 | 2020-02-02T21:17:12.000Z | 2020-02-02T21:17:12.000Z | import _plotly_utils.basevalidators
class ScattermapboxValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name='scattermapbox', parent_name='', **kwargs):
super(ScattermapboxValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_na... | 47 | 78 | 0.550032 |
87279b15298ac664e31ae2317e97eccc01f0501b | 3,194 | py | Python | backslash/lazy_query.py | oren0e/backslash-python | 37f0fe37e21c384baa27b4f5b7210e79d02a65dc | [
"BSD-3-Clause"
] | null | null | null | backslash/lazy_query.py | oren0e/backslash-python | 37f0fe37e21c384baa27b4f5b7210e79d02a65dc | [
"BSD-3-Clause"
] | null | null | null | backslash/lazy_query.py | oren0e/backslash-python | 37f0fe37e21c384baa27b4f5b7210e79d02a65dc | [
"BSD-3-Clause"
] | null | null | null | import collections
import itertools
from sentinels import NOTHING
from ._compat import iteritems
from .utils import raise_for_status
class LazyQuery():
def __init__(self, client, path=None, url=None, query_params=None, page_size=100):
super().__init__()
self._client = client
if url is N... | 35.098901 | 106 | 0.623669 |
3f80e93fe57a879c6e3bfe0ff9a10ed78e948e87 | 480 | py | Python | pyBrematic/devices/intertechno/__init__.py | d-Rickyy-b/Brematic-Controller | 878ace569ff7df0617a35f595cb74244c21ebb9c | [
"MIT"
] | 11 | 2018-05-02T21:31:57.000Z | 2021-11-09T11:40:47.000Z | pyBrematic/devices/intertechno/__init__.py | d-Rickyy-b/Brematic-Controller | 878ace569ff7df0617a35f595cb74244c21ebb9c | [
"MIT"
] | 20 | 2018-05-01T14:32:59.000Z | 2022-02-14T21:53:58.000Z | pyBrematic/devices/intertechno/__init__.py | d-Rickyy-b/Brematic-Controller | 878ace569ff7df0617a35f595cb74244c21ebb9c | [
"MIT"
] | 5 | 2018-11-08T15:35:48.000Z | 2020-12-27T18:28:44.000Z | # -*- coding: utf-8 -*-
from .intertechnodevice import IntertechnoDevice
from .CMR1000 import CMR1000
from .CMR500 import CMR500
from .CMR300 import CMR300
from .ITL500 import ITL500
from .ITR3500 import ITR3500
from .PAR1500 import PAR1500
from .tools import calc_systemcode, calc_unitcode, calc_system_and_unit_code
... | 36.923077 | 159 | 0.783333 |
130d3b5030d8696e4d5acbf25ad2a87444dbc08d | 25,929 | py | Python | bayes_opt/transform_gp.py | AndRossi/OpenKE_BayesianOpt | 31db25eb8406c6cf803e2187402290e466c0e824 | [
"MIT"
] | 2 | 2020-08-01T03:00:24.000Z | 2020-08-18T02:08:21.000Z | bayes_opt/transform_gp.py | AndRossi/OpenKE_BayesianOpt | 31db25eb8406c6cf803e2187402290e466c0e824 | [
"MIT"
] | null | null | null | bayes_opt/transform_gp.py | AndRossi/OpenKE_BayesianOpt | 31db25eb8406c6cf803e2187402290e466c0e824 | [
"MIT"
] | 1 | 2020-08-18T02:08:23.000Z | 2020-08-18T02:08:23.000Z | # -*- coding: utf-8 -*-
"""
Created on Thu Mar 03 12:34:13 2016
@author: V
"""
# define Gaussian Process class
import numpy as np
from bayes_opt.acquisition_functions import AcquisitionFunction, unique_rows
from scipy.optimize import minimize
from sklearn.metrics.pairwise import euclidean_distances
... | 36.0125 | 145 | 0.557445 |
7125ba15ba75babbd38fb6a83f111a81f95f73c4 | 83 | py | Python | door/apps.py | Riphiphip/website | dc5bf64f24d5cf78661686af0281705f4d1d2576 | [
"MIT"
] | null | null | null | door/apps.py | Riphiphip/website | dc5bf64f24d5cf78661686af0281705f4d1d2576 | [
"MIT"
] | null | null | null | door/apps.py | Riphiphip/website | dc5bf64f24d5cf78661686af0281705f4d1d2576 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class DoorConfig(AppConfig):
name = 'door'
| 13.833333 | 33 | 0.73494 |
1ce42fd5e95385e39156ef0b6c104cdd842361eb | 4,123 | py | Python | harvesting/woodspinner.py | hoostus/prime-harvesting | 6606b94ea7859fbf217dbea4ace856e3fa4d154e | [
"BlueOak-1.0.0",
"Apache-2.0"
] | 23 | 2016-09-07T06:13:37.000Z | 2022-02-17T23:49:03.000Z | harvesting/woodspinner.py | hoostus/prime-harvesting | 6606b94ea7859fbf217dbea4ace856e3fa4d154e | [
"BlueOak-1.0.0",
"Apache-2.0"
] | null | null | null | harvesting/woodspinner.py | hoostus/prime-harvesting | 6606b94ea7859fbf217dbea4ace856e3fa4d154e | [
"BlueOak-1.0.0",
"Apache-2.0"
] | 12 | 2016-06-30T17:27:39.000Z | 2021-12-12T07:54:27.000Z | from .abc import HarvestingStrategy
from decimal import Decimal
# https://www.bogleheads.org/forum/viewtopic.php?f=10&t=269091#p4309134
# https://www.bogleheads.org/forum/viewtopic.php?f=10&t=269091#p4310215
# Bucket-1, 2 years in cash/short-term treas
# Bucket-2, 8 year in intermediate treas
# Bucket-3, equities
# ... | 42.947917 | 162 | 0.640796 |
764d2955e67ad04964d3da924ae5d37c90b7e727 | 1,347 | py | Python | tools/scrape_ab.py | EricssonResearch/micro-bench | 91c2f7cbc5cec8bc4252b24cf4fd124b589bce05 | [
"Apache-2.0"
] | null | null | null | tools/scrape_ab.py | EricssonResearch/micro-bench | 91c2f7cbc5cec8bc4252b24cf4fd124b589bce05 | [
"Apache-2.0"
] | null | null | null | tools/scrape_ab.py | EricssonResearch/micro-bench | 91c2f7cbc5cec8bc4252b24cf4fd124b589bce05 | [
"Apache-2.0"
] | null | null | null | # concurrency level is not needed, timestamp is needed though, also a print out per test, not just the last one
import sys
concurrency = ""
completeRequests = ""
failedRequests = ""
keepAlive = ""
tps = ""
fileName = sys.argv[1]
with open(fileName, "r") as f:
print "concurrency\tcompletedRequests\tfailedRequests\t... | 29.282609 | 111 | 0.64588 |
a88b54b0b41ac78f67b64b2f80dfeb015a303edd | 3,314 | py | Python | grr/server/grr_response_server/output_plugins/yaml_plugin.py | dekoder/grr | 27ba38dc0f5ad4f3e0cdbfb146a0a789e3b0d27b | [
"Apache-2.0"
] | 3 | 2018-09-30T01:31:29.000Z | 2019-04-22T11:44:54.000Z | grr/server/grr_response_server/output_plugins/yaml_plugin.py | tomchop/grr | 27ba38dc0f5ad4f3e0cdbfb146a0a789e3b0d27b | [
"Apache-2.0"
] | 1 | 2022-03-02T09:58:05.000Z | 2022-03-02T09:58:05.000Z | grr/server/grr_response_server/output_plugins/yaml_plugin.py | tomchop/grr | 27ba38dc0f5ad4f3e0cdbfb146a0a789e3b0d27b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Plugins that produce results in YAML."""
from __future__ import unicode_literals
import io
import os
import zipfile
import yaml
from grr_response_core.lib import utils
from grr_response_core.lib.rdfvalues import structs as rdf_structs
from grr_response_server import instant_output_plugin
d... | 35.634409 | 80 | 0.726614 |
45e549146ed99eb3a2a458b2eb832385e5f9394a | 10,556 | py | Python | lib/x509.py | greenmo000/electrum-britcoin | ad0248eb552d29c41ecd06d8b0a1f7f8179d1ee8 | [
"MIT"
] | null | null | null | lib/x509.py | greenmo000/electrum-britcoin | ad0248eb552d29c41ecd06d8b0a1f7f8179d1ee8 | [
"MIT"
] | null | null | null | lib/x509.py | greenmo000/electrum-britcoin | ad0248eb552d29c41ecd06d8b0a1f7f8179d1ee8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Electrum - lightweight Britcoin client
# Copyright (C) 2014 Thomas Voegtlin
#
# 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 withou... | 31.510448 | 139 | 0.606101 |
7fc14913533160e0e5f63638aff45acdc4b6592c | 3,781 | py | Python | contrib/macdeploy/custom_dsstore.py | riancoin/yancoin | 7390c75a5ba56a0b9395dc38b947878c4d7ad9b8 | [
"MIT"
] | null | null | null | contrib/macdeploy/custom_dsstore.py | riancoin/yancoin | 7390c75a5ba56a0b9395dc38b947878c4d7ad9b8 | [
"MIT"
] | null | null | null | contrib/macdeploy/custom_dsstore.py | riancoin/yancoin | 7390c75a5ba56a0b9395dc38b947878c4d7ad9b8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2013-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from __future__ import division,print_function,unicode_literals
import biplist
from ds_store import DSStore... | 61.983607 | 1,817 | 0.72785 |
05a07f14964db79db40228c119b2cdbb0198a1dd | 5,933 | py | Python | package_control/bootstrap.py | William-Cao/Less- | b4cb03d2457bcac29ba3cfc13689098aee103971 | [
"Unlicense",
"MIT"
] | 3 | 2019-06-06T00:13:44.000Z | 2020-08-16T20:11:13.000Z | package_control/bootstrap.py | Allyn69/package_control | f78578ed67529e263fb1f4e4f90f92295830560f | [
"MIT",
"Unlicense"
] | null | null | null | package_control/bootstrap.py | Allyn69/package_control | f78578ed67529e263fb1f4e4f90f92295830560f | [
"MIT",
"Unlicense"
] | 1 | 2021-07-26T00:35:53.000Z | 2021-07-26T00:35:53.000Z | import zipfile
import os
import hashlib
import json
from os import path
try:
from urlparse import urlparse
str_cls = unicode # noqa
from cStringIO import StringIO as BytesIO
package_control_dir = os.getcwd()
except (ImportError) as e:
from urllib.parse import urlparse
str_cls = str
from io ... | 30.740933 | 105 | 0.623968 |
202f80dcfefe2f6154658f94fa84ae8317a3803d | 338 | py | Python | metoffice_ec2/timer.py | openclimatefix/metoffice_aws_ec2 | 6cda8f583f3ceb4fdc3920e1f13f657039404b8a | [
"MIT"
] | 8 | 2020-05-20T20:06:47.000Z | 2021-06-25T02:43:10.000Z | metoffice_ec2/timer.py | openclimatefix/metoffice_ec2 | 6cda8f583f3ceb4fdc3920e1f13f657039404b8a | [
"MIT"
] | 37 | 2020-05-15T12:20:25.000Z | 2021-02-12T17:01:33.000Z | metoffice_ec2/timer.py | openclimatefix/metoffice_aws_ec2 | 6cda8f583f3ceb4fdc3920e1f13f657039404b8a | [
"MIT"
] | 2 | 2020-05-21T13:21:00.000Z | 2020-05-24T09:35:29.000Z | import logging
import time
_LOG = logging.getLogger("metoffice_ec2")
class Timer:
def __init__(self):
self.t = time.time()
def tick(self, label=""):
now = time.time()
time_since_last_tick = now - self.t
self.t = now
_LOG.info("{} took {:.2f} secs.".format(label, time_... | 21.125 | 77 | 0.609467 |
01b6d6798a80161fc06aff546a39235e17298653 | 5,760 | py | Python | accounts/migrations/0001_initial.py | ZviBaratz/pylabber | 35337284f3d0615249f642743b993b7dad407390 | [
"Apache-2.0"
] | 3 | 2020-08-28T21:33:07.000Z | 2021-07-19T17:52:17.000Z | accounts/migrations/0001_initial.py | TheLabbingProject/pylabber | 27d6073e7bde871c16912a8ea5e0e389711bbd9f | [
"Apache-2.0"
] | 74 | 2019-09-04T11:40:16.000Z | 2022-01-03T19:43:04.000Z | accounts/migrations/0001_initial.py | ZviBaratz/pylabber | 35337284f3d0615249f642743b993b7dad407390 | [
"Apache-2.0"
] | 3 | 2019-05-07T07:09:05.000Z | 2019-08-30T15:40:47.000Z | # Generated by Django 3.0.8 on 2020-07-12 07:21
from django.conf import settings
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import django_extensions.db.fields
class Migration(migrations... | 64.719101 | 329 | 0.633854 |
ba4d5891155823906291b488e7ac86faa15a23d6 | 713 | py | Python | examples/Example.py | keshavm021/Chatbot | 2e52b2aeb4bfbf5295a557f5422cdfdddddf891c | [
"MIT"
] | null | null | null | examples/Example.py | keshavm021/Chatbot | 2e52b2aeb4bfbf5295a557f5422cdfdddddf891c | [
"MIT"
] | null | null | null | examples/Example.py | keshavm021/Chatbot | 2e52b2aeb4bfbf5295a557f5422cdfdddddf891c | [
"MIT"
] | null | null | null | from chatbot import Chat,reflections,multiFunctionCall
import wikipedia,os
import warnings
warnings.filterwarnings("ignore")
def whoIs(query,sessionID="general"):
try:
return wikipedia.summary(query)
except:
for newquery in wikipedia.search(query):
try:
return wikip... | 28.52 | 111 | 0.685835 |
1cb117609bd3855dc0128d887743c8b7e1a92b3f | 187 | py | Python | src/npi/dataset/__init__.py | NancyFulda/towards-neural-programming-interfaces | 21b467af56848c4fc8642fb0412f9f8d1b7718a2 | [
"Apache-2.0"
] | null | null | null | src/npi/dataset/__init__.py | NancyFulda/towards-neural-programming-interfaces | 21b467af56848c4fc8642fb0412f9f8d1b7718a2 | [
"Apache-2.0"
] | 1 | 2022-02-01T02:51:51.000Z | 2022-02-01T02:51:51.000Z | src/npi/dataset/__init__.py | NancyFulda/towards-neural-programming-interfaces | 21b467af56848c4fc8642fb0412f9f8d1b7718a2 | [
"Apache-2.0"
] | 2 | 2022-02-07T16:39:02.000Z | 2022-03-21T16:08:22.000Z | # This package defines the creation/handling/structure of the dataset used to train the NPI
from .construct_dataset import NPIDatasetConstructor
from .npi_dataset import NPIDatasetLoader
| 46.75 | 91 | 0.855615 |
61dc7071240a29407f88c3aeedcfcdbcde274aed | 6,244 | py | Python | extra_tests/snippets/builtin_complex.py | rng-dynamics/RustPython | 6165aadcc4e80e0f48f3e784e17b3c7f80d21a8a | [
"CC-BY-4.0",
"MIT"
] | null | null | null | extra_tests/snippets/builtin_complex.py | rng-dynamics/RustPython | 6165aadcc4e80e0f48f3e784e17b3c7f80d21a8a | [
"CC-BY-4.0",
"MIT"
] | null | null | null | extra_tests/snippets/builtin_complex.py | rng-dynamics/RustPython | 6165aadcc4e80e0f48f3e784e17b3c7f80d21a8a | [
"CC-BY-4.0",
"MIT"
] | null | null | null | import testutils
from testutils import assert_raises
# __abs__
assert abs(complex(3, 4)) == 5
assert abs(complex(3, -4)) == 5
assert abs(complex(1.5, 2.5)) == 2.9154759474226504
# __eq__
assert complex(1, -1) == complex(1, -1)
assert complex(1, 0) == 1
assert 1 == complex(1, 0)
assert complex(1, 1) != 1
assert 1 !=... | 27.385965 | 66 | 0.634369 |
0ffb1eb27677f679a3e4daafd6d648fa292394a9 | 521 | py | Python | kabzimal/models/invocies.py | arasumran/kabzimal | dbae35fdb940bdf0338bd43983b1894c87a35961 | [
"MIT"
] | null | null | null | kabzimal/models/invocies.py | arasumran/kabzimal | dbae35fdb940bdf0338bd43983b1894c87a35961 | [
"MIT"
] | 12 | 2020-06-05T23:02:28.000Z | 2022-03-11T23:59:56.000Z | kabzimal/models/invocies.py | arasumran/kabzimal | dbae35fdb940bdf0338bd43983b1894c87a35961 | [
"MIT"
] | null | null | null | from kabzimal.models.order import OrdersModel
__author__ = 'umran'
from django.db import models
class InvoicesModels(models.Model):
invoices_status_code = models.CharField(db_column='invocies_status_code',max_length=250)
order = models.ForeignKey(OrdersModel,on_delete=models.CASCADE,db_column='order_id')
... | 30.647059 | 92 | 0.783109 |
72834cfd9a4a647bba28651d32c4d8aaae8f0959 | 2,383 | py | Python | iupac-codes/iupac.py | LongNguyen1984/biofx_python | b8d45dc38d968674c6b641051b73f8ed1503b1e4 | [
"MIT"
] | 1 | 2021-04-21T07:15:27.000Z | 2021-04-21T07:15:27.000Z | iupac-codes/iupac.py | LongNguyen1984/biofx_python | b8d45dc38d968674c6b641051b73f8ed1503b1e4 | [
"MIT"
] | null | null | null | iupac-codes/iupac.py | LongNguyen1984/biofx_python | b8d45dc38d968674c6b641051b73f8ed1503b1e4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
""" Turn IUPAC DNA codes into regex """
import argparse
import sys
import re
from itertools import product
from typing import NamedTuple, List
class Args(NamedTuple):
pattern: str
# --------------------------------------------------
def get_args() -> Args:
""" Get command-line argume... | 25.902174 | 78 | 0.448175 |
e1860419811f10048fb371e70f9d17c03f6d65c9 | 5,421 | py | Python | utils/pose_estimation.py | pedrocg42/awesome-cv-projects | 928c48aa305d1cd0cd67412659a87ecc6fb6f8b0 | [
"MIT"
] | null | null | null | utils/pose_estimation.py | pedrocg42/awesome-cv-projects | 928c48aa305d1cd0cd67412659a87ecc6fb6f8b0 | [
"MIT"
] | null | null | null | utils/pose_estimation.py | pedrocg42/awesome-cv-projects | 928c48aa305d1cd0cd67412659a87ecc6fb6f8b0 | [
"MIT"
] | null | null | null | import cv2 as cv
import numpy as np
#########################################################
################## POSE ESTIMATION ######################
#########################################################
PART_NAMES = [
"nose",
"leftEye",
"rightEye",
"leftEar",
"rightEar",
"leftShoulder",... | 26.0625 | 86 | 0.604317 |
b58620490050d28e572f7a860894a765e5fb47ba | 10,615 | py | Python | aludel/database.py | praekelt/aludel | 039ae119056efd52be75015d3877ac2f51ebedfe | [
"BSD-3-Clause"
] | 2 | 2015-03-24T20:23:09.000Z | 2015-11-01T22:52:27.000Z | aludel/database.py | praekelt/aludel | 039ae119056efd52be75015d3877ac2f51ebedfe | [
"BSD-3-Clause"
] | 1 | 2015-01-16T08:12:22.000Z | 2015-01-16T08:12:22.000Z | aludel/database.py | praekelt/aludel | 039ae119056efd52be75015d3877ac2f51ebedfe | [
"BSD-3-Clause"
] | null | null | null | import json
from alchimia import TWISTED_STRATEGY
from sqlalchemy import MetaData, Table, Column, String, Text, create_engine
from sqlalchemy.schema import CreateTable
from twisted.internet.defer import succeed
def get_engine(conn_str, reactor):
return create_engine(conn_str, reactor=reactor, strategy=TWISTED_ST... | 32.762346 | 79 | 0.640415 |
59f3776d2a8aadddc96203240c1d8a34c91aaddf | 3,159 | py | Python | huaweicloud-sdk-dms/huaweicloudsdkdms/v2/model/show_queue_project_tags_response.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 64 | 2020-06-12T07:05:07.000Z | 2022-03-30T03:32:50.000Z | huaweicloud-sdk-dms/huaweicloudsdkdms/v2/model/show_queue_project_tags_response.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 11 | 2020-07-06T07:56:54.000Z | 2022-01-11T11:14:40.000Z | huaweicloud-sdk-dms/huaweicloudsdkdms/v2/model/show_queue_project_tags_response.py | huaweicloud/huaweicloud-sdk-python-v3 | 7a6270390fcbf192b3882bf763e7016e6026ef78 | [
"Apache-2.0"
] | 24 | 2020-06-08T11:42:13.000Z | 2022-03-04T06:44:08.000Z | # coding: utf-8
import re
import six
from huaweicloudsdkcore.sdk_response import SdkResponse
from huaweicloudsdkcore.utils.http_utils import sanitize_for_serialization
class ShowQueueProjectTagsResponse(SdkResponse):
"""
Attributes:
openapi_types (dict): The key is attribute name
... | 27.469565 | 79 | 0.563786 |
7a7ba285b86f80d9fd66c433384d12e7072296dc | 5,895 | py | Python | multiplayer_mode.py | kmranrg/ConnectFour | db882d80e3fa0fe9800b26301020b7a5d80545dd | [
"BSD-3-Clause"
] | null | null | null | multiplayer_mode.py | kmranrg/ConnectFour | db882d80e3fa0fe9800b26301020b7a5d80545dd | [
"BSD-3-Clause"
] | null | null | null | multiplayer_mode.py | kmranrg/ConnectFour | db882d80e3fa0fe9800b26301020b7a5d80545dd | [
"BSD-3-Clause"
] | null | null | null | # Multi-Player Mode
import numpy as np
import pygame
import sys
import math
BLUE = (0,0,255)
DARK_BLUE = (0,0,40)
RED = (255,0,0)
YELLOW = (255,255,0)
ROW_COUNT = 6
COLUMN_COUNT = 7
def create_board():
board = np.zeros((ROW_COUNT,COLUMN_COUNT))
return board
def drop_piece(board, row, col, piece):
... | 37.788462 | 147 | 0.461917 |
9353f2647c1b6d31d83ed6ed93e79e1277e24d26 | 21,121 | py | Python | Src/Clova/vendor/requests/adapters.py | NishiYusuke/Line-boot-award | d77f26b9109f3cba45be5906bcb6c9314974cd92 | [
"MIT"
] | null | null | null | Src/Clova/vendor/requests/adapters.py | NishiYusuke/Line-boot-award | d77f26b9109f3cba45be5906bcb6c9314974cd92 | [
"MIT"
] | null | null | null | Src/Clova/vendor/requests/adapters.py | NishiYusuke/Line-boot-award | d77f26b9109f3cba45be5906bcb6c9314974cd92 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
requests.adapters
~~~~~~~~~~~~~~~~~
This module contains the transport adapters that Requests uses to define
and maintain connections.
"""
import os.path
import socket
from urllib3.poolmanager import PoolManager, proxy_from_url
from urllib3.response import HTTPResponse
fro... | 40.539347 | 98 | 0.600682 |
1d2294901b97c3c836434b248c91f9d8610a0c55 | 3,889 | py | Python | Car_task_functions.py | AdoNunes/ASD_MNE_pipe | 8da711dbd96f8308d9fcd5403b46a2903f67f6bd | [
"MIT"
] | null | null | null | Car_task_functions.py | AdoNunes/ASD_MNE_pipe | 8da711dbd96f8308d9fcd5403b46a2903f67f6bd | [
"MIT"
] | 1 | 2019-11-18T15:36:43.000Z | 2019-11-18T15:36:43.000Z | Car_task_functions.py | AdoNunes/ASD_MNE_pipe | 8da711dbd96f8308d9fcd5403b46a2903f67f6bd | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Dec 10 18:42:32 2019
@author: an512
Car task functions
"""
def get_epoch_times(epoch, PD_chn='UADC015-3007', trig_chn='UPPT001',
plot=False):
"""Get time start, response, out, end """
import numpy as np
epoch.pick_ty... | 35.678899 | 76 | 0.568269 |
6b0410e62e5ca9324ffcd55bcd16256c85444c14 | 1,690 | py | Python | covidregister/register/migrations/0008_auto_20200525_1838.py | rattletat/covid-register.eu | fa9b5512e2a9d9ec4d1aafa577a84181085bb0ca | [
"MIT"
] | null | null | null | covidregister/register/migrations/0008_auto_20200525_1838.py | rattletat/covid-register.eu | fa9b5512e2a9d9ec4d1aafa577a84181085bb0ca | [
"MIT"
] | null | null | null | covidregister/register/migrations/0008_auto_20200525_1838.py | rattletat/covid-register.eu | fa9b5512e2a9d9ec4d1aafa577a84181085bb0ca | [
"MIT"
] | null | null | null | # Generated by Django 3.0.6 on 2020-05-25 18:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('register', '0007_auto_20200525_1810'),
]
operations = [
migrations.RemoveField(
model_name='covidillness',
name='mil... | 30.727273 | 96 | 0.577515 |
ac5fcdf8772d388e878d7e60ae3bbb5d40b83e83 | 1,524 | py | Python | data/biodati/download_biodati.py | COVID-19-Causal-Reasoning/bel4corona | 592da35133c4a6cc0e4605737fa5e6ea11586209 | [
"MIT"
] | 3 | 2020-05-06T18:18:30.000Z | 2020-05-19T04:56:48.000Z | data/biodati/download_biodati.py | COVID-19-Causal-Reasoning/bel4corona | 592da35133c4a6cc0e4605737fa5e6ea11586209 | [
"MIT"
] | null | null | null | data/biodati/download_biodati.py | COVID-19-Causal-Reasoning/bel4corona | 592da35133c4a6cc0e4605737fa5e6ea11586209 | [
"MIT"
] | 1 | 2020-05-21T00:46:44.000Z | 2020-05-21T00:46:44.000Z | # -*- coding: utf-8 -*-
"""Tools for acquiring and normalizing the content from BioDati's demo server."""
import json
import os
import click
import pybel.grounding
HERE = os.path.abspath(os.path.dirname(__file__))
NETWORK_ID = '01E46GDFQAGK5W8EFS9S9WMH12'
RAW_PATH = os.path.join(HERE, 'covid19-biodati-raw.bel.node... | 27.709091 | 81 | 0.639764 |
fc584972b18aeb98fbdee5ee44b35cb43d5f058c | 526 | py | Python | src/ui/__init__.py | zsnake1209/SeExpr | 5e09e1e84b5acb13c6402f2307d5375631f5f4c1 | [
"Apache-2.0"
] | 294 | 2015-01-24T00:33:55.000Z | 2022-03-12T14:29:28.000Z | src/SeExpr2/UI/__init__.py | cooljeanius/SeExpr | 42b695546689c61ae87c7747fc27ae50653f09f5 | [
"Apache-2.0"
] | 53 | 2015-07-07T06:07:35.000Z | 2021-05-27T19:06:31.000Z | src/SeExpr2/UI/__init__.py | cooljeanius/SeExpr | 42b695546689c61ae87c7747fc27ae50653f09f5 | [
"Apache-2.0"
] | 82 | 2015-02-27T10:26:17.000Z | 2022-03-27T19:28:25.000Z | ##
# @file __init__.py
# @brief Package definition for expreditor api.
#
# <b>CONFIDENTIAL INFORMATION: This software is the confidential and
# proprietary information of Walt Disney Animation Studios ("WDAS").
# This software may not be used, disclosed, reproduced or distributed
# for any purpose without prior written... | 35.066667 | 70 | 0.777567 |
bb384eec133d5e7aa9139e1dbe80c45cb0b15e8d | 3,781 | py | Python | research/object_detection/ts_space/scripts/test_tf2_model.py | ts-deep-learning/models | 8f837f6c57803338ce35494d7e84eb50e3a10111 | [
"Apache-2.0"
] | null | null | null | research/object_detection/ts_space/scripts/test_tf2_model.py | ts-deep-learning/models | 8f837f6c57803338ce35494d7e84eb50e3a10111 | [
"Apache-2.0"
] | null | null | null | research/object_detection/ts_space/scripts/test_tf2_model.py | ts-deep-learning/models | 8f837f6c57803338ce35494d7e84eb50e3a10111 | [
"Apache-2.0"
] | null | null | null | '''
works on branch r1.13.0
This script needs to be placed in <path_to_tensorflow/models>/research/object_detection.
With paths to label file, frozen model and test images it will save the detections in the results directory.
'''
import numpy as np
import os
import sys
from tqdm import tqdm
import tensorflow as tf
imp... | 33.166667 | 108 | 0.688442 |
3fd2a0e6a883369fafefbd422bbdf203027c0d15 | 60 | py | Python | tests/__init__.py | fosterrath-mila/deepgroove_user_exp | bec9ac7dc408d7bc24b1fde03e9723e7c13b5541 | [
"BSD-3-Clause"
] | 2 | 2020-03-19T19:23:47.000Z | 2020-03-20T08:45:23.000Z | tests/__init__.py | fosterrath-mila/deepgroove_user_exp | bec9ac7dc408d7bc24b1fde03e9723e7c13b5541 | [
"BSD-3-Clause"
] | 7 | 2020-04-01T22:40:40.000Z | 2020-05-01T15:53:00.000Z | tests/__init__.py | fosterrath-mila/deepgroove_user_exp | bec9ac7dc408d7bc24b1fde03e9723e7c13b5541 | [
"BSD-3-Clause"
] | 2 | 2020-03-19T20:03:48.000Z | 2020-04-24T02:36:20.000Z | """Unit test package for deepgroove_web_user_experiment."""
| 30 | 59 | 0.8 |
ad42b96f1c72120557886da4d0fb649a96f4924e | 2,151 | py | Python | fhir/resources/tests/test_devicedefinition.py | mmabey/fhir.resources | cc73718e9762c04726cd7de240c8f2dd5313cbe1 | [
"BSD-3-Clause"
] | null | null | null | fhir/resources/tests/test_devicedefinition.py | mmabey/fhir.resources | cc73718e9762c04726cd7de240c8f2dd5313cbe1 | [
"BSD-3-Clause"
] | null | null | null | fhir/resources/tests/test_devicedefinition.py | mmabey/fhir.resources | cc73718e9762c04726cd7de240c8f2dd5313cbe1 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Profile: http://hl7.org/fhir/StructureDefinition/DeviceDefinition
Release: R4
Version: 4.0.1
Build ID: 9346c8cc45
Last updated: 2019-11-01T09:29:23.356+11:00
"""
import io
import json
import os
import unittest
import pytest
from .. import devicedefinition
from ..fhirdate import FHIRDate
f... | 36.457627 | 164 | 0.670851 |
ef2a94f8adb3d4e4f1126410be588e0d6e9fae43 | 10,539 | py | Python | imgur.py | CrushAndRun/sopel-Bodhi-extras | f1a616713fd71cb6873081b88d693cce63138d52 | [
"EFL-1.0",
"EFL-2.0"
] | null | null | null | imgur.py | CrushAndRun/sopel-Bodhi-extras | f1a616713fd71cb6873081b88d693cce63138d52 | [
"EFL-1.0",
"EFL-2.0"
] | null | null | null | imgur.py | CrushAndRun/sopel-Bodhi-extras | f1a616713fd71cb6873081b88d693cce63138d52 | [
"EFL-1.0",
"EFL-2.0"
] | null | null | null | # -*- coding: utf8 -*-
"""
imgur.py - Sopel imgur Information Module
Copyright © 2014, iceTwy, <icetwy@icetwy.re>
Licensed under the Eiffel Forum License 2.
"""
import json
import re
import os.path
import sys
if sys.version_info.major < 3:
from urllib2 import HTTPError
from urlparse import urlparse
else:
f... | 43.016327 | 118 | 0.594554 |
46e5395e173a96d8eef21a5945430b8c6977ec04 | 48,916 | py | Python | test/test_locale_preferences.py | greenpau/py_insightvm_sdk | bd881f26e14cb9f0f9c47927469ec992de9de8e6 | [
"Apache-2.0"
] | 2 | 2019-03-15T16:05:54.000Z | 2020-07-19T18:37:50.000Z | test/test_locale_preferences.py | greenpau/py_insightvm_sdk | bd881f26e14cb9f0f9c47927469ec992de9de8e6 | [
"Apache-2.0"
] | 1 | 2021-03-26T04:46:12.000Z | 2021-03-26T04:51:23.000Z | test/test_locale_preferences.py | greenpau/py_insightvm_sdk | bd881f26e14cb9f0f9c47927469ec992de9de8e6 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
InsightVM API
# Overview This guide documents the InsightVM Application Programming Interface (API) Version 3. This API supports the Representation State Transfer (REST) design pattern. Unless noted otherwise this API accepts and produces the `application/json` media type. This API uses ... | 1,193.073171 | 48,045 | 0.490637 |
029a0f498091dfe3890b883304ccfde423c7f359 | 5,595 | py | Python | api/dialogflow_intents.py | damianomiotek/best_transport_Poland | 601c49402dc738dbdd63b811b4b313dbc5204791 | [
"MIT"
] | null | null | null | api/dialogflow_intents.py | damianomiotek/best_transport_Poland | 601c49402dc738dbdd63b811b4b313dbc5204791 | [
"MIT"
] | 2 | 2021-04-30T20:52:32.000Z | 2021-06-10T21:55:38.000Z | api/dialogflow_intents.py | damianomiotek/best_transport_Poland | 601c49402dc738dbdd63b811b4b313dbc5204791 | [
"MIT"
] | null | null | null | from api.others import *
from api.handling_pressing_item_of_dialogflow_list import *
intents = {
"Default Welcome Intent": default_welcome_intent,
"Others": others,
"Contact": contact,
"About us": about_us,
"Address": address,
"Car fleet": car_fleet,
"Account": account,
"Values of lists... | 47.820513 | 85 | 0.745308 |
c09c06cba2c409304cf8fc5cbac99d8a049fb545 | 18,143 | py | Python | recipes/recipe_modules/gclient/config.py | panadrota/haiku-depot_tools | 53075227f31e38bf875dad98ec57d53076316d6f | [
"BSD-3-Clause"
] | 1 | 2021-09-01T06:16:55.000Z | 2021-09-01T06:16:55.000Z | recipes/recipe_modules/gclient/config.py | panadrota/haiku-depot_tools | 53075227f31e38bf875dad98ec57d53076316d6f | [
"BSD-3-Clause"
] | null | null | null | recipes/recipe_modules/gclient/config.py | panadrota/haiku-depot_tools | 53075227f31e38bf875dad98ec57d53076316d6f | [
"BSD-3-Clause"
] | 4 | 2020-03-15T13:28:11.000Z | 2021-12-13T08:57:39.000Z | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
try:
_STRING_TYPE = basestring
except NameError: # pragma: no cover
_STRING_TYPE = str
from recipe_engine.config import config_item_context, ConfigGrou... | 34.361742 | 80 | 0.704128 |
6749c34011d9223212dcd57771e8a11c6b1316d2 | 3,115 | py | Python | astropy/io/misc/asdf/tags/transform/tabular.py | ycopin/astropy | 4c29ecd4239fc2e8f62780a9bbbeacec8e592461 | [
"BSD-3-Clause"
] | null | null | null | astropy/io/misc/asdf/tags/transform/tabular.py | ycopin/astropy | 4c29ecd4239fc2e8f62780a9bbbeacec8e592461 | [
"BSD-3-Clause"
] | 1 | 2018-11-14T14:18:55.000Z | 2020-01-21T10:36:05.000Z | astropy/io/misc/asdf/tags/transform/tabular.py | ycopin/astropy | 4c29ecd4239fc2e8f62780a9bbbeacec8e592461 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
# -*- coding: utf-8 -*-
import numpy as np
from numpy.testing import assert_array_equal
from asdf import yamlutil
from ...... import modeling
from ...... import units as u
from .basic import TransformType
from ......tests.helper import assert_quantity_a... | 38.9375 | 103 | 0.594543 |
beb2afce49762a656dd1e5c8a3cbf17a5130bb5f | 3,109 | py | Python | graph_ter_cls/transforms/global_rotate.py | RicardoLanJ/graph-ter | 3b9bda527a6a9559be835c5b84e6491ac8c5aa30 | [
"MIT"
] | 58 | 2020-03-24T16:06:21.000Z | 2022-03-26T07:04:28.000Z | graph_ter_cls/transforms/global_rotate.py | RicardoLanJ/graph-ter | 3b9bda527a6a9559be835c5b84e6491ac8c5aa30 | [
"MIT"
] | 6 | 2020-04-02T08:52:37.000Z | 2020-11-27T12:27:23.000Z | graph_ter_cls/transforms/global_rotate.py | RicardoLanJ/graph-ter | 3b9bda527a6a9559be835c5b84e6491ac8c5aa30 | [
"MIT"
] | 19 | 2020-03-29T18:23:55.000Z | 2021-12-25T04:10:00.000Z | import json
import random
import numpy as np
from graph_ter_cls.transforms import utils
from graph_ter_cls.transforms.transformer import Transformer
class GlobalRotate(Transformer):
def __init__(self,
num_samples=256,
mode='isotropic', # isotropic or anisotropic
... | 31.09 | 77 | 0.558701 |
75e5c37d11d1f76adf2f9925277e8340f54756be | 272 | py | Python | examples/datasets/__init__.py | RabbitWhite1/torchrec | 031bcca5300d52099eb7490ff06fe0301c1c02f2 | [
"BSD-3-Clause"
] | 814 | 2022-02-23T17:24:14.000Z | 2022-03-31T16:52:23.000Z | examples/datasets/__init__.py | RabbitWhite1/torchrec | 031bcca5300d52099eb7490ff06fe0301c1c02f2 | [
"BSD-3-Clause"
] | 89 | 2022-02-23T17:29:56.000Z | 2022-03-31T23:44:13.000Z | examples/datasets/__init__.py | RabbitWhite1/torchrec | 031bcca5300d52099eb7490ff06fe0301c1c02f2 | [
"BSD-3-Clause"
] | 68 | 2022-02-23T17:42:17.000Z | 2022-03-28T06:39:55.000Z | #!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
from . import criteo_dataframes # noqa
| 30.222222 | 71 | 0.753676 |
33879f20b7803525c1ca7b06a3f05d8145f6b246 | 2,281 | py | Python | ship/monit.py | universitatjaumei/ship | 469e35def23791131dbca2b2df64beac873b1149 | [
"MIT"
] | null | null | null | ship/monit.py | universitatjaumei/ship | 469e35def23791131dbca2b2df64beac873b1149 | [
"MIT"
] | 11 | 2015-09-01T07:26:43.000Z | 2015-12-14T09:48:07.000Z | ship/monit.py | universitatjaumei/ship | 469e35def23791131dbca2b2df64beac873b1149 | [
"MIT"
] | null | null | null | from logger import ShipLogger
from commands import *
from time import sleep
import os.path
import re
class Monit:
def __init__(self, home):
self.home = home
self.logger = ShipLogger()
def get_deploy_directory(self, service_name):
return os.path.join(self.home, service_name, service_n... | 34.560606 | 154 | 0.641824 |
8146ff86dd0440277fabc7f4221a19020f30e39e | 2,513 | py | Python | ivf/core/sfs/depth_from_gradient.py | tody411/ImageViewerFramework | 5c183c34e65494b6af1287e70152b995a868c6ac | [
"MIT"
] | null | null | null | ivf/core/sfs/depth_from_gradient.py | tody411/ImageViewerFramework | 5c183c34e65494b6af1287e70152b995a868c6ac | [
"MIT"
] | null | null | null | ivf/core/sfs/depth_from_gradient.py | tody411/ImageViewerFramework | 5c183c34e65494b6af1287e70152b995a868c6ac | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
## @package ivf.core.sfs.depth_from_gradient
#
# ivf.core.sfs.depth_from_gradient utility package.
# @author tody
# @date 2016/02/08
import numpy as np
import scipy.sparse
import cv2
from ivf.core.sfs.constraints import l2Regularization, laplacianMatrix
from ivf.core.solver impo... | 24.637255 | 70 | 0.598886 |
311bd4a24f8c95d8a9f4e9443ad5c65c34591e8d | 802 | py | Python | examples/connected-components-1.py | TiphaineV/streamfig | 4acd92625c34bde0089b7963ec076d902d8ebba1 | [
"MIT"
] | 5 | 2019-09-19T07:11:13.000Z | 2021-12-13T11:18:41.000Z | examples/connected-components-1.py | TiphaineV/streamfig | 4acd92625c34bde0089b7963ec076d902d8ebba1 | [
"MIT"
] | 3 | 2020-04-23T17:37:23.000Z | 2021-12-13T09:40:31.000Z | examples/connected-components-1.py | TiphaineV/streamfig | 4acd92625c34bde0089b7963ec076d902d8ebba1 | [
"MIT"
] | 5 | 2018-12-14T13:53:33.000Z | 2020-05-18T17:22:52.000Z | from streamfig import *
s = StreamFig()
s.addColor("tBlue", "#AEC7E8") # 174,199,232
s.addColor("tOrange", "#FFBB78") # 255,187,120
s.addColor("tGreen", "#98DF8A") # 152,223,138
s.addColor("tPink", "#FF9896") # 255, 152,150
s.addColor("tRed", "#DD0000") # 255, 152,150
s.addNode("a")
s.addNode("b")
s.addNode("c")
s.a... | 27.655172 | 82 | 0.61596 |
9961c7dff626bec5de642c64abf46025518b3c92 | 436 | py | Python | polyBlueClient.py | HenChao/PolyBlue | 9e22b81bf8fce38fcb2807dd3f25eae2de6c8bb0 | [
"Apache-2.0"
] | null | null | null | polyBlueClient.py | HenChao/PolyBlue | 9e22b81bf8fce38fcb2807dd3f25eae2de6c8bb0 | [
"Apache-2.0"
] | null | null | null | polyBlueClient.py | HenChao/PolyBlue | 9e22b81bf8fce38fcb2807dd3f25eae2de6c8bb0 | [
"Apache-2.0"
] | null | null | null | from websocket import create_connection
class PolyBlueClient(object):
def __init__(self, app_name):
self.client = create_connection('ws://' + app_name + '.mybluemix.net/socket?Id=2')
def sendOutput(self, message):
self.client.send(message)
def getInput(self, message):
self.sendOutput(message)
result = N... | 21.8 | 84 | 0.724771 |
9615748efdbee3e88af5e24004bee88d91146276 | 12,222 | py | Python | Tests/test_nonlocal.py | denim2x/ironpython3 | 45667291acb6e6d114ada31ced2a6bed7bc5b6a8 | [
"Apache-2.0"
] | null | null | null | Tests/test_nonlocal.py | denim2x/ironpython3 | 45667291acb6e6d114ada31ced2a6bed7bc5b6a8 | [
"Apache-2.0"
] | null | null | null | Tests/test_nonlocal.py | denim2x/ironpython3 | 45667291acb6e6d114ada31ced2a6bed7bc5b6a8 | [
"Apache-2.0"
] | null | null | null | # Licensed to the .NET Foundation under one or more agreements.
# The .NET Foundation licenses this file to you under the Apache 2.0 License.
# See the LICENSE file in the project root for more information.
import sys
import unittest
from iptest import IronPythonTestCase, run_test, is_cli, is_cpython
class SyntaxTe... | 39.553398 | 140 | 0.515218 |
67807db32690c16f62af77fbc55d2b9e7323b9a1 | 7,023 | py | Python | test/dos_test.py | JefferyWangSH/dos-solver | 4c1b8b1b5e94127e00edbb40bb0d5037c6f94ea9 | [
"MIT"
] | null | null | null | test/dos_test.py | JefferyWangSH/dos-solver | 4c1b8b1b5e94127e00edbb40bb0d5037c6f94ea9 | [
"MIT"
] | null | null | null | test/dos_test.py | JefferyWangSH/dos-solver | 4c1b8b1b5e94127e00edbb40bb0d5037c6f94ea9 | [
"MIT"
] | null | null | null | import numpy as np
from matplotlib import pyplot as plt
import sys
def calculate_dos_exact():
# generate grids for momentums of 2d
k_grids_1d = np.linspace(-k_cutoff, k_cutoff, k_num)
px_grids_2d = np.array([px for px in k_grids_1d for py in k_grids_1d])
py_grids_2d = np.array([py for px in k_grids_1d... | 41.070175 | 149 | 0.699843 |
d1aadc27af44697f5ac073202b5fb8282331ba76 | 4,655 | py | Python | pyctr/crypto/seeddb.py | Desterly/pyctr | 710e96217b64dd4bac302d94261e73b8b1fd3b89 | [
"MIT"
] | 18 | 2020-07-10T19:07:10.000Z | 2022-03-24T06:09:14.000Z | pyctr/crypto/seeddb.py | Desterly/pyctr | 710e96217b64dd4bac302d94261e73b8b1fd3b89 | [
"MIT"
] | 20 | 2020-07-10T13:13:30.000Z | 2022-02-19T21:04:23.000Z | pyctr/crypto/seeddb.py | Desterly/pyctr | 710e96217b64dd4bac302d94261e73b8b1fd3b89 | [
"MIT"
] | 7 | 2021-02-18T08:41:53.000Z | 2022-03-24T06:09:20.000Z | # This file is a part of pyctr.
#
# Copyright (c) 2017-2021 Ian Burgwin
# This file is licensed under The MIT License (MIT).
# You can find the full license text in LICENSE in the root of this project.
from os import PathLike, environ
from os.path import join
from types import MappingProxyType
from typing import TYPE_... | 29.462025 | 120 | 0.656713 |
7f534ed51b463c66f34f2c61c396c26cbb43ba0b | 8,227 | py | Python | server/src/oscarbluelight/tests/offer/test_benefit_fixed_price.py | MaximBrewer/sebe | 4b94b2c782d018b6fa3a130fa30173386cc9bfdd | [
"0BSD"
] | 8 | 2016-06-18T01:40:26.000Z | 2021-02-08T04:08:58.000Z | server/src/oscarbluelight/tests/offer/test_benefit_fixed_price.py | MaximBrewer/sebe | 4b94b2c782d018b6fa3a130fa30173386cc9bfdd | [
"0BSD"
] | 16 | 2018-05-04T13:00:07.000Z | 2021-05-27T14:54:09.000Z | server/src/oscarbluelight/tests/offer/test_benefit_fixed_price.py | MaximBrewer/sebe | 4b94b2c782d018b6fa3a130fa30173386cc9bfdd | [
"0BSD"
] | 3 | 2016-12-19T11:30:47.000Z | 2019-10-27T20:30:15.000Z | from decimal import Decimal as D
from django.test import TestCase
from oscar.test import factories
from oscar.test.basket import add_product, add_products
from django_redis import get_redis_connection
from oscarbluelight.offer.models import (
Condition,
ConditionalOffer,
Range,
Benefit,
CompoundCond... | 41.97449 | 93 | 0.6881 |
1086459b677f61d0e5ac370020226a2bbd402118 | 2,305 | py | Python | core/models/sql_traits/info_schema_sql.py | bopopescu/sdba | f1ecb71ebe627643fd296a07a3ca66b366cd37b9 | [
"MIT"
] | 2 | 2020-08-11T13:55:40.000Z | 2021-01-05T15:23:32.000Z | core/models/sql_traits/info_schema_sql.py | bopopescu/sdba | f1ecb71ebe627643fd296a07a3ca66b366cd37b9 | [
"MIT"
] | null | null | null | core/models/sql_traits/info_schema_sql.py | bopopescu/sdba | f1ecb71ebe627643fd296a07a3ca66b366cd37b9 | [
"MIT"
] | 1 | 2020-07-24T07:26:46.000Z | 2020-07-24T07:26:46.000Z | from abc import ABC
class InfoSchemaSql(ABC):
@property
def get_biggest_tables_sql(self) -> str:
"""
get_biggest_tables_sql
Returns:
str: plain SQL
"""
return "" \
"SELECT " \
"table_name AS `Table`, table_schema AS `Database`... | 32.464789 | 152 | 0.544035 |
77b317627693c98dfeee7b5562e0dd59b1c22868 | 16,632 | py | Python | evewspace/Map/utils.py | darkorb/eve-wspace | 687f3aeb6cd0a446a74108b2a5c03cb21c464497 | [
"Apache-2.0"
] | null | null | null | evewspace/Map/utils.py | darkorb/eve-wspace | 687f3aeb6cd0a446a74108b2a5c03cb21c464497 | [
"Apache-2.0"
] | null | null | null | evewspace/Map/utils.py | darkorb/eve-wspace | 687f3aeb6cd0a446a74108b2a5c03cb21c464497 | [
"Apache-2.0"
] | null | null | null | # Eve W-Space
# Copyright 2014 Andrew Austin and contributors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 35.387234 | 167 | 0.597042 |
29e72a55f24dd4f76a08265fffd37a8ab54eba6e | 21,121 | py | Python | driver27/tests/test_views.py | SRJ9/driver27 | 3fd32005a89112fe9f94281b33a497d4ab1ebb55 | [
"MIT"
] | 1 | 2016-10-12T22:49:09.000Z | 2016-10-12T22:49:09.000Z | driver27/tests/test_views.py | SRJ9/driver27 | 3fd32005a89112fe9f94281b33a497d4ab1ebb55 | [
"MIT"
] | 1 | 2016-10-12T22:47:08.000Z | 2016-10-12T22:47:08.000Z | driver27/tests/test_views.py | SRJ9/driver27 | 3fd32005a89112fe9f94281b33a497d4ab1ebb55 | [
"MIT"
] | null | null | null | from django.conf import settings
from django.contrib.admin.sites import AdminSite
from django.test import TestCase, Client, RequestFactory
try:
from django.urls import reverse
except ImportError:
from django.core.urlresolvers import reverse
from django.forms.models import inlineformset_factory
from django.cont... | 41.332681 | 105 | 0.674731 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.