hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
edd4608729646a3f8c0088ab78261158e3b86563 | 9,270 | py | Python | src/sage/categories/finite_groups.py | Blues1998/sage | b5c9cf037cbce672101725f269470135b9b2c5c4 | [
"BSL-1.0"
] | null | null | null | src/sage/categories/finite_groups.py | Blues1998/sage | b5c9cf037cbce672101725f269470135b9b2c5c4 | [
"BSL-1.0"
] | null | null | null | src/sage/categories/finite_groups.py | Blues1998/sage | b5c9cf037cbce672101725f269470135b9b2c5c4 | [
"BSL-1.0"
] | null | null | null | r"""
FiniteGroups
"""
# ****************************************************************************
# Copyright (C) 2010-2013 Nicolas M. Thiery <nthiery at users.sf.net>
#
# Distributed under the terms of the GNU General Public License (GPL)
# https://www.gnu.org/licenses/
# ************************... | 36.070039 | 141 | 0.533873 |
b8d15799eef1d9a658da0f26a4ff98073f0999f0 | 2,006 | py | Python | alembic/versions/15d9409816f2_modify_injured_around_school_table.py | arielszabo/anyway | e9db403507a8bb42c26af5f691f250d4a1d08afd | [
"BSD-3-Clause"
] | null | null | null | alembic/versions/15d9409816f2_modify_injured_around_school_table.py | arielszabo/anyway | e9db403507a8bb42c26af5f691f250d4a1d08afd | [
"BSD-3-Clause"
] | null | null | null | alembic/versions/15d9409816f2_modify_injured_around_school_table.py | arielszabo/anyway | e9db403507a8bb42c26af5f691f250d4a1d08afd | [
"BSD-3-Clause"
] | null | null | null | """modify injured_around_school table
Revision ID: 15d9409816f2
Revises: faa6ec8d08c
Create Date: 2019-08-21 02:59:18.297851
"""
# revision identifiers, used by Alembic.
revision = '15d9409816f2'
down_revision = 'faa6ec8d08c'
branch_labels = None
depends_on = None
from alembic import op
import sqlalchemy as sa
de... | 46.651163 | 135 | 0.762213 |
65e87827d789e58ab6f833b67cb61880364fc26e | 11,279 | py | Python | venv/Lib/site-packages/werkzeug/middleware/shared_data.py | jodieritchie/MLHPortfolio | 66d23165c1c3277a6b7320af1cfc353a07385e7a | [
"MIT"
] | 1 | 2021-06-18T16:32:10.000Z | 2021-06-18T16:32:10.000Z | venv/Lib/site-packages/werkzeug/middleware/shared_data.py | jodieritchie/MLHPortfolio | 66d23165c1c3277a6b7320af1cfc353a07385e7a | [
"MIT"
] | null | null | null | venv/Lib/site-packages/werkzeug/middleware/shared_data.py | jodieritchie/MLHPortfolio | 66d23165c1c3277a6b7320af1cfc353a07385e7a | [
"MIT"
] | 1 | 2021-06-20T19:28:37.000Z | 2021-06-20T19:28:37.000Z | """
Serve Shared Static Files
=========================
.. autoclass:: SharedDataMiddleware
:members: is_allowed
:copyright: 2007 Pallets
:license: BSD-3-Clause
"""
import mimetypes
import os
import pkgutil
import posixpath
import typing as t
from datetime import datetime
from datetime import time... | 35.137072 | 89 | 0.568667 |
73f00e3f510378565b2538af0b7d7bfbbe4dfa58 | 11,528 | py | Python | tapas/experiments/prediction_utils_test.py | Martin36/tapas | c2578e8dfaa862ae0eaa3ae3ade6808c81200ddf | [
"Apache-2.0"
] | 816 | 2020-03-31T15:15:56.000Z | 2022-03-31T19:28:02.000Z | tapas/experiments/prediction_utils_test.py | Fgerald/tapas | 2987658c3b65c5ab6e698d6c57823dc30d3d0f96 | [
"Apache-2.0"
] | 155 | 2020-05-02T15:45:42.000Z | 2022-03-31T08:35:23.000Z | tapas/experiments/prediction_utils_test.py | Fgerald/tapas | 2987658c3b65c5ab6e698d6c57823dc30d3d0f96 | [
"Apache-2.0"
] | 173 | 2020-05-01T02:39:38.000Z | 2022-03-30T06:43:29.000Z | # coding=utf-8
# Copyright 2019 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | 34.309524 | 76 | 0.66525 |
ba73f08c0bae3a7008a58f57d77c0559770014a4 | 321 | py | Python | publications/views/__init__.py | paleocore/django-publications | 34f2d13ef2bdd62f2c36e6760caf6a4bb82229f8 | [
"MIT"
] | null | null | null | publications/views/__init__.py | paleocore/django-publications | 34f2d13ef2bdd62f2c36e6760caf6a4bb82229f8 | [
"MIT"
] | null | null | null | publications/views/__init__.py | paleocore/django-publications | 34f2d13ef2bdd62f2c36e6760caf6a4bb82229f8 | [
"MIT"
] | null | null | null | __license__ = 'MIT License <http://www.opensource.org/licenses/mit-license.php>'
__author__ = 'Lucas Theis <lucas@theis.io>'
__docformat__ = 'epytext'
from .year import year
from .author import author
from .id import id
from .keyword import keyword
from .list import list
from .unapi import unapi
from .cite import cite... | 26.75 | 80 | 0.772586 |
d145596d6928ddcbdd688831f75f9c18afbbe5ae | 5,287 | py | Python | test/functional/test_framework/blockstore.py | nimblenode/build-abc-bitcoin | 2d0157383eeb8337c0d06395ce022784fbb8c6fe | [
"MIT"
] | 35 | 2019-02-23T06:21:13.000Z | 2021-11-15T11:35:13.000Z | test/functional/test_framework/blockstore.py | nimblenode/build-abc-bitcoin | 2d0157383eeb8337c0d06395ce022784fbb8c6fe | [
"MIT"
] | 60 | 2019-02-25T18:17:03.000Z | 2021-07-13T00:14:00.000Z | test/functional/test_framework/blockstore.py | nimblenode/build-abc-bitcoin | 2d0157383eeb8337c0d06395ce022784fbb8c6fe | [
"MIT"
] | 24 | 2019-02-20T05:37:02.000Z | 2021-10-29T18:42:10.000Z | #!/usr/bin/env python3
# Copyright (c) 2015-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.
"""BlockStore and TxStore helper classes."""
import dbm.dumb as dbmd
from io import BytesIO
import loggin... | 30.918129 | 78 | 0.597692 |
bfff98b4e17b21bc575d2f1b5c886381b2e89f17 | 3,633 | py | Python | src/Utils/hparam.py | Cassiecry/TALE | 706697f68f4fe347829f2309f0b9380e92c3dddb | [
"MIT"
] | null | null | null | src/Utils/hparam.py | Cassiecry/TALE | 706697f68f4fe347829f2309f0b9380e92c3dddb | [
"MIT"
] | null | null | null | src/Utils/hparam.py | Cassiecry/TALE | 706697f68f4fe347829f2309f0b9380e92c3dddb | [
"MIT"
] | null | null | null | # created 1/11/2020
# author: Yue Cao
import tensorflow as tf
import pickle
import sys
def params(flags):
hparams={}
FLAGS = flags.FLAGS
hparams['MAXLEN'] = 1000
#--------------------------------------------------training HParams:
hparams['main_model'] = FLAGS.main_model
hparams['batch_size'] = FLAGS.batch_... | 29.064 | 105 | 0.625654 |
aa773976cf58ed537fd901d121fa6f8955a5e8bd | 5,070 | py | Python | homeschool/notifications/tests/test_admin.py | chriswedgwood/homeschool | d5267b13154aaa52c9c3edbf06b251f123583ae8 | [
"MIT"
] | 154 | 2019-12-24T17:45:44.000Z | 2022-03-30T23:03:06.000Z | homeschool/notifications/tests/test_admin.py | chriswedgwood/homeschool | d5267b13154aaa52c9c3edbf06b251f123583ae8 | [
"MIT"
] | 397 | 2019-11-05T03:23:45.000Z | 2022-03-31T04:51:55.000Z | homeschool/notifications/tests/test_admin.py | chriswedgwood/homeschool | d5267b13154aaa52c9c3edbf06b251f123583ae8 | [
"MIT"
] | 44 | 2020-02-24T13:08:52.000Z | 2022-02-24T05:03:13.000Z | import responses
from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME
from django.contrib.messages import get_messages
from django.contrib.sites.models import Site
from homeschool.accounts.models import Account
from homeschool.notifications.models import Announcement, Notification
from homeschool.notification... | 43.333333 | 85 | 0.69428 |
9039120ed823476f5b8e71cb295b3c259f35f137 | 4,748 | py | Python | mainWorker.py | 48d90782/Tensorflow-Object-Detector-with-website | d6f39b4a0bd80c6dcb51ed2b0420f26f1643e170 | [
"MIT"
] | 3 | 2018-03-06T16:50:29.000Z | 2018-07-20T20:53:11.000Z | mainWorker.py | 48d90782/Tensorflow-Object-Detector-with-website | d6f39b4a0bd80c6dcb51ed2b0420f26f1643e170 | [
"MIT"
] | null | null | null | mainWorker.py | 48d90782/Tensorflow-Object-Detector-with-website | d6f39b4a0bd80c6dcb51ed2b0420f26f1643e170 | [
"MIT"
] | 1 | 2019-11-18T15:28:31.000Z | 2019-11-18T15:28:31.000Z | import base64
import os
import re
import ssl
import tornado
import tornado.httpserver
from io import BytesIO
from multiprocessing import Process
from multiprocessing import Queue
from multiprocessing.pool import Pool
import numpy as np
import tensorflow as tf
from PIL import Image
from tornado import websocket, gen, ... | 33.43662 | 109 | 0.70198 |
1bcb26e950a58c24d51e54c31b56f34de7eadc8f | 12,242 | py | Python | bin/config.py | rheiland/pc4fury | 41ef56afcfdfc7931fd1b82450f36fd33dfc7697 | [
"BSD-3-Clause"
] | null | null | null | bin/config.py | rheiland/pc4fury | 41ef56afcfdfc7931fd1b82450f36fd33dfc7697 | [
"BSD-3-Clause"
] | 4 | 2021-01-13T19:21:11.000Z | 2021-01-19T20:32:03.000Z | bin/config.py | rheiland/pc4fury | 41ef56afcfdfc7931fd1b82450f36fd33dfc7697 | [
"BSD-3-Clause"
] | 2 | 2020-09-11T15:43:46.000Z | 2020-10-01T19:58:38.000Z | # Config Tab
import os
from ipywidgets import Layout, Label, Text, Checkbox, Button, HBox, VBox, \
FloatText, BoundedIntText, BoundedFloatText, HTMLMath, Dropdown
class ConfigTab(object):
def __init__(self):
# micron_units = HTMLMath(value=r"$\mu M$")
micron_units = Label('micron') ... | 38.618297 | 114 | 0.560529 |
f5d87ad9048e494f0c4d1ba8ca65cc9601e80548 | 103 | gyp | Python | examples/demo-addon/thread_safe_function_round_trip/binding.gyp | fossabot/FlyLab | 78b53f03c92d7360bca882aa41be2ca0862b51a3 | [
"MIT"
] | null | null | null | examples/demo-addon/thread_safe_function_round_trip/binding.gyp | fossabot/FlyLab | 78b53f03c92d7360bca882aa41be2ca0862b51a3 | [
"MIT"
] | null | null | null | examples/demo-addon/thread_safe_function_round_trip/binding.gyp | fossabot/FlyLab | 78b53f03c92d7360bca882aa41be2ca0862b51a3 | [
"MIT"
] | null | null | null | {
"targets": [
{
"target_name": "round_trip",
"sources": ["round_trip.c"]
}
]
} | 12.875 | 34 | 0.446602 |
d72411a84e027f03686f68874eb2e86c359f07c3 | 2,777 | py | Python | tools/perf/contrib/cluster_telemetry/skpicture_printer.py | zipated/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 2,151 | 2020-04-18T07:31:17.000Z | 2022-03-31T08:39:18.000Z | tools/perf/contrib/cluster_telemetry/skpicture_printer.py | cangulcan/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 395 | 2020-04-18T08:22:18.000Z | 2021-12-08T13:04:49.000Z | tools/perf/contrib/cluster_telemetry/skpicture_printer.py | cangulcan/src | 2b8388091c71e442910a21ada3d97ae8bc1845d3 | [
"BSD-3-Clause"
] | 338 | 2020-04-18T08:03:10.000Z | 2022-03-29T12:33:22.000Z | # Copyright 2014 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.
from core import perf_benchmark
from contrib.cluster_telemetry import ct_benchmarks_util
from contrib.cluster_telemetry import page_set
from contrib.cluster... | 32.670588 | 79 | 0.729564 |
a8904a78588b1b593c31976baa50adf8057fb27e | 904 | py | Python | cactus_backend_admin/urls.py | Krystian19/cactus-app-backend-admin-service | 64e322545a47133b1651641d5ba96142f0e2daeb | [
"MIT"
] | null | null | null | cactus_backend_admin/urls.py | Krystian19/cactus-app-backend-admin-service | 64e322545a47133b1651641d5ba96142f0e2daeb | [
"MIT"
] | 2 | 2020-02-11T23:32:20.000Z | 2021-06-10T20:59:20.000Z | cactus_backend_admin/urls.py | Krystian19/cactus-app-admin-service | 64e322545a47133b1651641d5ba96142f0e2daeb | [
"MIT"
] | null | null | null | """cactus_backend_admin URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/2.0/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'... | 37.666667 | 77 | 0.724558 |
77b76b996c034cb53db5f9ac3b938bcf589b8c9e | 14,006 | py | Python | backbone/resnet/resnet.py | Mhaiyang/CVPR2021_PFNet | 2c4cab0730e6a0619fad79092f0b34f71c3b56c4 | [
"BSD-3-Clause"
] | 24 | 2021-07-07T14:27:10.000Z | 2022-03-18T05:41:49.000Z | backbone/resnet/resnet.py | Mhaiyang/CVPR2021_PFNet | 2c4cab0730e6a0619fad79092f0b34f71c3b56c4 | [
"BSD-3-Clause"
] | 3 | 2021-12-20T12:38:32.000Z | 2022-03-23T02:52:13.000Z | backbone/resnet/resnet.py | Mhaiyang/CVPR2021_PFNet | 2c4cab0730e6a0619fad79092f0b34f71c3b56c4 | [
"BSD-3-Clause"
] | 10 | 2021-07-07T15:06:47.000Z | 2022-03-09T18:15:44.000Z | """
@Time : 2021/7/6 09:53
@Author : Haiyang Mei
@E-mail : mhy666@mail.dlut.edu.cn
@Project : CVPR2021_PFNet
@File : resnet.py
@Function: ResNet Model File
"""
import torch
import torch.nn as nn
try:
from torch.hub import load_state_dict_from_url
except ImportError:
from torch.utils.model_zoo... | 38.905556 | 107 | 0.635085 |
3b5f41228474266b4e6f24f8ca10039907ad250a | 514 | py | Python | tournament_manager/settings.py | school-of-ai-angers/rl-arena | 085578628af93f8b00d64255c88588f648e2d0d1 | [
"MIT"
] | null | null | null | tournament_manager/settings.py | school-of-ai-angers/rl-arena | 085578628af93f8b00d64255c88588f648e2d0d1 | [
"MIT"
] | null | null | null | tournament_manager/settings.py | school-of-ai-angers/rl-arena | 085578628af93f8b00d64255c88588f648e2d0d1 | [
"MIT"
] | null | null | null | """
Django settings for rl_arena project.
Generated by 'django-admin startproject' using Django 2.2.5.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/2.2/ref/settings/
"""
from core.s... | 23.363636 | 60 | 0.731518 |
4b01d42c3f9fa5bf9d7c9be43fc66f30d305498c | 1,839 | py | Python | docs/conf.py | maihao14/Template | a153a55a35700d34353155b0402815720c89bebd | [
"MIT"
] | null | null | null | docs/conf.py | maihao14/Template | a153a55a35700d34353155b0402815720c89bebd | [
"MIT"
] | null | null | null | docs/conf.py | maihao14/Template | a153a55a35700d34353155b0402815720c89bebd | [
"MIT"
] | null | null | null | # Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
# -- Path setup --------------------------------------------------------------
# If ex... | 35.365385 | 79 | 0.659054 |
abf9f7329d9eb6d33ed0452d844e53e65c605d2d | 362 | py | Python | boa3/model/builtin/classmethod/copylistmethod.py | OnBlockIO/neo3-boa | cb317292a67532a52ed26f2b0f0f7d0b10ac5f5f | [
"Apache-2.0"
] | 25 | 2020-07-22T19:37:43.000Z | 2022-03-08T03:23:55.000Z | boa3/model/builtin/classmethod/copylistmethod.py | OnBlockIO/neo3-boa | cb317292a67532a52ed26f2b0f0f7d0b10ac5f5f | [
"Apache-2.0"
] | 419 | 2020-04-23T17:48:14.000Z | 2022-03-31T13:17:45.000Z | boa3/model/builtin/classmethod/copylistmethod.py | OnBlockIO/neo3-boa | cb317292a67532a52ed26f2b0f0f7d0b10ac5f5f | [
"Apache-2.0"
] | 15 | 2020-05-21T21:54:24.000Z | 2021-11-18T06:17:24.000Z | from typing import Optional
from boa3.model.builtin.classmethod.copymethod import CopyMethod
from boa3.model.type.itype import IType
class CopyListMethod(CopyMethod):
def __init__(self, arg_value: Optional[IType] = None):
from boa3.model.type.type import Type
super().__init__(arg_value if Type.l... | 30.166667 | 85 | 0.767956 |
fe465620fbbdef99d990e1f4d76131b0d19cd142 | 40 | py | Python | seed/exceptions/__init__.py | h4wldev/seed | 2febcb39edb6086128022e40d8734b0e3f93ebb1 | [
"MIT"
] | 3 | 2020-12-24T12:01:13.000Z | 2021-06-01T06:23:41.000Z | seed/exceptions/__init__.py | h4wldev/seed | 2febcb39edb6086128022e40d8734b0e3f93ebb1 | [
"MIT"
] | null | null | null | seed/exceptions/__init__.py | h4wldev/seed | 2febcb39edb6086128022e40d8734b0e3f93ebb1 | [
"MIT"
] | null | null | null | from .exceptions import * # noqa: F401
| 20 | 39 | 0.7 |
0d02439e60ad06e47a6b835d740c9399bdb7aa74 | 5,855 | py | Python | main.py | xptree/analyst | 8263c84a6000316929c5347b2d331ccb79b86d4a | [
"MIT"
] | null | null | null | main.py | xptree/analyst | 8263c84a6000316929c5347b2d331ccb79b86d4a | [
"MIT"
] | null | null | null | main.py | xptree/analyst | 8263c84a6000316929c5347b2d331ccb79b86d4a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# encoding: utf-8
# File Name: main.py
# Author: Jiezhong Qiu
# Create Time: 2018/05/25 14:28
# TODO:
import pandas as pds
import igraph
import random
import itertools
from gensim.models import Word2Vec
import mysql.connector as conn
import argparse
import time
parser = argparse.ArgumentParser()... | 33.267045 | 111 | 0.636892 |
dc85c41afcf25b4652823ac92126958513766bb0 | 5,160 | py | Python | mobilenet_v2.py | iamzhaozheng/MobileNetV2 | 2fe43bbc49df31233981bf858a42a94435498460 | [
"MIT"
] | null | null | null | mobilenet_v2.py | iamzhaozheng/MobileNetV2 | 2fe43bbc49df31233981bf858a42a94435498460 | [
"MIT"
] | null | null | null | mobilenet_v2.py | iamzhaozheng/MobileNetV2 | 2fe43bbc49df31233981bf858a42a94435498460 | [
"MIT"
] | null | null | null | """MobileNet v2 models for Keras.
# Reference
- [Inverted Residuals and Linear Bottlenecks Mobile Networks for
Classification, Detection and Segmentation]
(https://arxiv.org/abs/1801.04381)
"""
from keras.models import Model
from keras.layers import Input, Conv2D, GlobalAveragePooling2D, Dropout
from keras.lay... | 34.630872 | 86 | 0.659496 |
f53082df8bd6ba62dcaffe8c3510dfcee26f4997 | 4,512 | py | Python | plotting.py | jvfe/wikicovid-explore | ab712a5a88d7f35494812804bf4b0f251082698a | [
"MIT"
] | 2 | 2020-08-09T09:44:02.000Z | 2020-11-19T13:47:38.000Z | plotting.py | jvfe/wikicovid-showcase | ab712a5a88d7f35494812804bf4b0f251082698a | [
"MIT"
] | null | null | null | plotting.py | jvfe/wikicovid-showcase | ab712a5a88d7f35494812804bf4b0f251082698a | [
"MIT"
] | null | null | null | from utils import wikidata_from_file
import altair as alt
import pandas as pd
def plot_interventions(min_mentions):
interv_query = wikidata_from_file("queries/clinicaltrialsByIntervention.rq")
interv_query["trials"] = interv_query["trials"].astype(int)
interv_query["Percent"] = interv_query["trials"] / ... | 30.486486 | 91 | 0.553856 |
ad3b65c14d201b82dd5b93c6687f22fcfdf41b98 | 1,963 | py | Python | src/validate_schema_section.py | pdellaert/nuage-metroae | af53799c51860fd80db67d68184a8a6e470815d8 | [
"Apache-2.0"
] | 8 | 2020-05-06T14:17:52.000Z | 2022-03-13T07:53:21.000Z | src/validate_schema_section.py | pdellaert/nuage-metroae | af53799c51860fd80db67d68184a8a6e470815d8 | [
"Apache-2.0"
] | 133 | 2020-04-24T20:05:12.000Z | 2022-03-31T15:59:16.000Z | src/validate_schema_section.py | pdellaert/nuage-metroae | af53799c51860fd80db67d68184a8a6e470815d8 | [
"Apache-2.0"
] | 16 | 2020-04-24T08:38:59.000Z | 2021-09-27T04:53:16.000Z | #!/usr/bin/env python
import os
import re
import sys
SECTION_BEGIN_FIELD = "sectionBegin"
SECTION_END_FIELD = "sectionEnd"
SCHEMA_DIRECTORY = "schemas"
def validate_sections(schema_contents, file_name):
pattern = re.compile(
'"' + '(' + SECTION_BEGIN_FIELD + '|' + SECTION_END_FIELD + ')' + '":\\s*"(.*)"... | 31.66129 | 89 | 0.50484 |
d0150228b29e228d79e0a81afb25b32e3fe6ebe1 | 1,895 | py | Python | test/test_news_sentiment.py | gavinjay/finnhub-python | b5c409dafeda390d14a2b0618ae6f25ab8d76c5b | [
"Apache-2.0"
] | null | null | null | test/test_news_sentiment.py | gavinjay/finnhub-python | b5c409dafeda390d14a2b0618ae6f25ab8d76c5b | [
"Apache-2.0"
] | null | null | null | test/test_news_sentiment.py | gavinjay/finnhub-python | b5c409dafeda390d14a2b0618ae6f25ab8d76c5b | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Finnhub API
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: 1.0.0
Generated by: https://openapi-generator.tech
"""
from __future__ import absolute_import
import unittes... | 30.079365 | 124 | 0.62533 |
b4a760a0feb89a6fdef0a46ff0b4cee977eb5c71 | 13,366 | py | Python | src/fomod_validator.py | GandaG/fomod-validator | ca85d007820f183702bad24fc048c2b197fa6cc9 | [
"Apache-2.0"
] | 9 | 2016-04-21T11:24:08.000Z | 2022-01-22T00:12:13.000Z | src/fomod_validator.py | GandaG/fomod-validator | ca85d007820f183702bad24fc048c2b197fa6cc9 | [
"Apache-2.0"
] | 10 | 2016-05-15T09:32:10.000Z | 2021-12-13T19:57:09.000Z | src/fomod_validator.py | GandaG/fomod-validator | ca85d007820f183702bad24fc048c2b197fa6cc9 | [
"Apache-2.0"
] | 3 | 2017-01-08T05:16:10.000Z | 2017-09-09T23:21:50.000Z | #!/usr/bin/env python
# Copyright 2017 Daniel Nunes
#
# 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... | 35.266491 | 87 | 0.624345 |
616dd52fa9d4bce2409ea1c5bd263bd81faea605 | 4,761 | py | Python | tribune/settings.py | suad7/galla | 387823dbd44c8e40d603d5f464badb9dfb7c70f5 | [
"Unlicense"
] | null | null | null | tribune/settings.py | suad7/galla | 387823dbd44c8e40d603d5f464badb9dfb7c70f5 | [
"Unlicense"
] | 6 | 2020-06-06T01:17:51.000Z | 2022-03-12T00:31:55.000Z | tribune/settings.py | suad7/galla | 387823dbd44c8e40d603d5f464badb9dfb7c70f5 | [
"Unlicense"
] | null | null | null | """
Django settings for tribune project.
Generated by 'django-admin startproject' using Django 1.11.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os
i... | 26.159341 | 91 | 0.668977 |
d22fac38ad89b27fec9909336755c4b464e47b3b | 1,139 | py | Python | database/dsstox/generic_substances.py | mshobair/invitro_cheminformatics | 17201496c73453accd440646a1ee81726119a59c | [
"MIT"
] | null | null | null | database/dsstox/generic_substances.py | mshobair/invitro_cheminformatics | 17201496c73453accd440646a1ee81726119a59c | [
"MIT"
] | null | null | null | database/dsstox/generic_substances.py | mshobair/invitro_cheminformatics | 17201496c73453accd440646a1ee81726119a59c | [
"MIT"
] | null | null | null | import datetime
from database.database_schemas import Schemas
from database.dsstox.qc_levels import QcLevels
from sqlalchemy import Column, ForeignKey, Integer, String, DateTime
from sqlalchemy.orm import relationship
from database.base import Base
class GenericSubstances(Base):
"""Maps to generic_substance tab... | 35.59375 | 80 | 0.753292 |
0b5d7b2fc907288a6221968bc9208a6ec4e50962 | 301 | py | Python | servicestack/fields.py | ServiceStack/servicestack-python | 57577d94e9c32334c9604e5881f9f96b93a0fddb | [
"BSD-3-Clause"
] | 3 | 2021-07-03T17:50:05.000Z | 2021-07-12T17:08:33.000Z | servicestack/fields.py | ServiceStack/servicestack-python | 57577d94e9c32334c9604e5881f9f96b93a0fddb | [
"BSD-3-Clause"
] | null | null | null | servicestack/fields.py | ServiceStack/servicestack-python | 57577d94e9c32334c9604e5881f9f96b93a0fddb | [
"BSD-3-Clause"
] | null | null | null | from servicestack.utils import to_bytearray, from_bytearray
import marshmallow.fields as mf
class Bytes(mf.Field):
def _serialize(self, value, attr, obj, **kwargs):
return to_bytearray(value)
def _deserialize(self, value, attr, data, **kwargs):
return from_bytearray(value)
| 27.363636 | 59 | 0.724252 |
47a4235aef876cf776622532e62a752c1f8f6dce | 1,203 | py | Python | zoo/cartpole/vpg.py | akshaykurmi/rl | 5575695c9af7f1981753fbb21855e5cde617d123 | [
"MIT"
] | null | null | null | zoo/cartpole/vpg.py | akshaykurmi/rl | 5575695c9af7f1981753fbb21855e5cde617d123 | [
"MIT"
] | null | null | null | zoo/cartpole/vpg.py | akshaykurmi/rl | 5575695c9af7f1981753fbb21855e5cde617d123 | [
"MIT"
] | null | null | null | import os
import gym
from rl.agents.vpg import VPG
from rl.loops import EpisodeTrainLoop
from rl.metrics import AverageReturn, AverageEpisodeLength
from zoo.cartpole.core import PolicyNetwork, ValueFunctionNetwork
from zoo.utils import parse_args, get_output_dirs, evaluate_policy
if __name__ == '__main__':
args ... | 29.341463 | 86 | 0.683292 |
86d17114c6b70f8e10c4c743636265ef702970d5 | 2,541 | py | Python | src/Python/Texture/TexturePlane.py | ajpmaclean/vtk-examples | 1a55fc8c6af67a3c07791807c7d1ec0ab97607a2 | [
"Apache-2.0"
] | 81 | 2020-08-10T01:44:30.000Z | 2022-03-23T06:46:36.000Z | src/Python/Texture/TexturePlane.py | ajpmaclean/vtk-examples | 1a55fc8c6af67a3c07791807c7d1ec0ab97607a2 | [
"Apache-2.0"
] | 2 | 2020-09-12T17:33:52.000Z | 2021-04-15T17:33:09.000Z | src/Python/Texture/TexturePlane.py | ajpmaclean/vtk-examples | 1a55fc8c6af67a3c07791807c7d1ec0ab97607a2 | [
"Apache-2.0"
] | 27 | 2020-08-17T07:09:30.000Z | 2022-02-15T03:44:58.000Z | #!/usr/bin/env python
# noinspection PyUnresolvedReferences
import vtkmodules.vtkInteractionStyle
# noinspection PyUnresolvedReferences
import vtkmodules.vtkRenderingOpenGL2
from vtkmodules.vtkCommonColor import vtkNamedColors
from vtkmodules.vtkFiltersSources import vtkPlaneSource
from vtkmodules.vtkIOImage import vt... | 28.875 | 90 | 0.731602 |
ee059e0ac0c233893b021413c7536cd947c37bb1 | 481 | py | Python | Day2/Tip Calculator/tip.py | viditvarshney/100DaysOfCode | eec82c98087093f1aec1cb21acab82368ae785a3 | [
"MIT"
] | null | null | null | Day2/Tip Calculator/tip.py | viditvarshney/100DaysOfCode | eec82c98087093f1aec1cb21acab82368ae785a3 | [
"MIT"
] | null | null | null | Day2/Tip Calculator/tip.py | viditvarshney/100DaysOfCode | eec82c98087093f1aec1cb21acab82368ae785a3 | [
"MIT"
] | null | null | null | print("Welcome to the Tip Calculator")
total = float(input("Enter Total bill amount: "))
tip = int(input("How much tip you want to pay: 10, 12 or 15? "))
totalPersons = int(input("Enter how many persons: "))
'''
Total amount with Tip = (Tip / 100 * total) + total
OR ( taking total as common)
Total amount with Tip = ... | 25.315789 | 72 | 0.671518 |
81d63a8fef801eaedb3dc823cf6cddd0ce57cf30 | 12,011 | py | Python | sockeye/loss.py | Izecson/saml-nmt | 4bafdb3b46d98d6a2cec9320397084f65120267a | [
"Apache-2.0"
] | 7 | 2019-04-10T03:06:12.000Z | 2021-11-29T09:37:11.000Z | sockeye/loss.py | Izecson/saml-nmt | 4bafdb3b46d98d6a2cec9320397084f65120267a | [
"Apache-2.0"
] | 1 | 2021-03-25T22:30:10.000Z | 2021-03-25T22:30:10.000Z | sockeye/loss.py | Izecson/saml-nmt | 4bafdb3b46d98d6a2cec9320397084f65120267a | [
"Apache-2.0"
] | 1 | 2020-05-05T15:55:45.000Z | 2020-05-05T15:55:45.000Z | # Copyright 2017, 2018 Amazon.com, Inc. or its affiliates. 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. A copy of the License
# is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" fi... | 38.996753 | 105 | 0.617934 |
bb48913c764a337561ce042be3439976a4b571cd | 9,232 | py | Python | nba_boxscore_scraper_v2.py | fjsackfield/NBAScraper | c37242261093ac2328732a989e1441b4fe4cbeb0 | [
"bzip2-1.0.6"
] | null | null | null | nba_boxscore_scraper_v2.py | fjsackfield/NBAScraper | c37242261093ac2328732a989e1441b4fe4cbeb0 | [
"bzip2-1.0.6"
] | null | null | null | nba_boxscore_scraper_v2.py | fjsackfield/NBAScraper | c37242261093ac2328732a989e1441b4fe4cbeb0 | [
"bzip2-1.0.6"
] | null | null | null | '''
NBA Boxscore Scraper - version 2. Now using basketball-reference.com as the
source. Functions will be defined and used to import PlayerGameStats.
'''
import urllib
import urllib.request as request
from bs4 import BeautifulSoup
import requests
import time
import datetime
def get_awayTeam(gameID):
... | 42.348624 | 148 | 0.595754 |
87622506798856752576925de43034e346f51b20 | 737 | py | Python | src/routes/jokes.py | MidouWebDev/api | f84e9e8d39c0ca285fbdcff6c43106dc93c9ce69 | [
"BSD-3-Clause"
] | 3 | 2021-08-10T19:37:53.000Z | 2021-09-28T18:54:57.000Z | src/routes/jokes.py | MidouWebDev/api | f84e9e8d39c0ca285fbdcff6c43106dc93c9ce69 | [
"BSD-3-Clause"
] | 26 | 2021-08-07T12:04:19.000Z | 2021-11-12T14:55:02.000Z | src/routes/jokes.py | Vyvy-vi/botish-api | 7b731f3d9f8bf2189540b2307227c9e30e9c4243 | [
"BSD-3-Clause"
] | 4 | 2021-08-08T20:33:38.000Z | 2021-11-13T14:47:02.000Z | import random
from fastapi import APIRouter, Path, Query
from ..dependencies import get_json
router = APIRouter()
jokes = get_json("jokes")
@router.get("/jokes/all")
async def all_jokes():
return {
"jokes": [
{"id": joke_id, "joke": jokes[joke_id]} for joke_id in range(len(jokes))
... | 23.03125 | 84 | 0.625509 |
b628a9d256e9ba83165e5303d6d6909226fe9e31 | 33 | py | Python | pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/plugins/nxos/tftp/__init__.py | jbronikowski/genielibs | 200a34e5fe4838a27b5a80d5973651b2e34ccafb | [
"Apache-2.0"
] | 94 | 2018-04-30T20:29:15.000Z | 2022-03-29T13:40:31.000Z | pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/plugins/nxos/tftp/__init__.py | jbronikowski/genielibs | 200a34e5fe4838a27b5a80d5973651b2e34ccafb | [
"Apache-2.0"
] | 67 | 2018-12-06T21:08:09.000Z | 2022-03-29T18:00:46.000Z | pkgs/filetransferutils-pkg/src/genie/libs/filetransferutils/plugins/nxos/tftp/__init__.py | jbronikowski/genielibs | 200a34e5fe4838a27b5a80d5973651b2e34ccafb | [
"Apache-2.0"
] | 49 | 2018-06-29T18:59:03.000Z | 2022-03-10T02:07:59.000Z | from .fileutils import FileUtils
| 16.5 | 32 | 0.848485 |
e15c3f9fdb410b7007677ac6378a6deb9ae50abe | 4,945 | py | Python | run.py | alessiamarcolini/image-labeller | 864a14e896839389d2dcfdce2d3027eb6b3fda8d | [
"MIT"
] | 2 | 2020-04-14T21:04:45.000Z | 2020-04-14T21:44:16.000Z | run.py | alessiamarcolini/image-labeller | 864a14e896839389d2dcfdce2d3027eb6b3fda8d | [
"MIT"
] | null | null | null | run.py | alessiamarcolini/image-labeller | 864a14e896839389d2dcfdce2d3027eb6b3fda8d | [
"MIT"
] | null | null | null | import argparse
import imghdr
import json
import os
from collections import OrderedDict
from dataclasses import dataclass
from typing import List
import matplotlib.image as mpimg
import matplotlib.pyplot as plt
import pandas as pd
ROOT = "labels" # JSON root
RED = "\033[31m"
GREEN = "\033[32m"
RESET = "\033[0m"
@... | 27.780899 | 88 | 0.610516 |
0e14ae9643ebcc940a464069f3075bfaae8603a5 | 2,777 | py | Python | src/radical/pilot/agent/executing/base.py | karahbit/radical.pilot | c611e1df781749deef899dcf5815728e1d8a962e | [
"MIT"
] | null | null | null | src/radical/pilot/agent/executing/base.py | karahbit/radical.pilot | c611e1df781749deef899dcf5815728e1d8a962e | [
"MIT"
] | null | null | null | src/radical/pilot/agent/executing/base.py | karahbit/radical.pilot | c611e1df781749deef899dcf5815728e1d8a962e | [
"MIT"
] | null | null | null |
__copyright__ = "Copyright 2013-2016, http://radical.rutgers.edu"
__license__ = "MIT"
import os
import radical.utils as ru
from ... import utils as rpu
# ------------------------------------------------------------------------------
# 'enum' for RP's spawner types
EXECUTING_NAME_POPEN = "POPEN"
EXECUTING_NAME... | 29.860215 | 80 | 0.515664 |
5e99011c980a21294aeac06b3730ea88b6d8ecfe | 213 | py | Python | ad-hoc/detectando_colisoes_2321.py | geraldofada/uri-solutions | a46a3bdcb06b2337d3221c22719be1c9d527312a | [
"MIT"
] | null | null | null | ad-hoc/detectando_colisoes_2321.py | geraldofada/uri-solutions | a46a3bdcb06b2337d3221c22719be1c9d527312a | [
"MIT"
] | null | null | null | ad-hoc/detectando_colisoes_2321.py | geraldofada/uri-solutions | a46a3bdcb06b2337d3221c22719be1c9d527312a | [
"MIT"
] | null | null | null | x_a1, y_a1, x_a2, y_a2 = map(int, input().split())
x_b1, y_b1, x_b2, y_b2 = map(int, input().split())
if(x_a2 < x_b1 or x_a1 > x_b2):
print(0)
elif(y_a2 < y_b1 or y_a1 > y_b2):
print(0)
else:
print(1) | 23.666667 | 50 | 0.600939 |
d945eabf8fb84a481e6ca1a5bce3ec6682229adc | 10,358 | py | Python | pw_env_setup/py/pw_env_setup/virtualenv_setup/install.py | ffzwadd/pigweed | 75e038f0d852b310d135b93061bc769cb8bf90c4 | [
"Apache-2.0"
] | null | null | null | pw_env_setup/py/pw_env_setup/virtualenv_setup/install.py | ffzwadd/pigweed | 75e038f0d852b310d135b93061bc769cb8bf90c4 | [
"Apache-2.0"
] | null | null | null | pw_env_setup/py/pw_env_setup/virtualenv_setup/install.py | ffzwadd/pigweed | 75e038f0d852b310d135b93061bc769cb8bf90c4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The Pigweed Authors
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may not
# use this file except in compliance with the License. You may obtain a copy of
# the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 36.34386 | 79 | 0.593841 |
24dee5070bb07079833b8bc0525978084955b9e5 | 6,338 | py | Python | tools/data/align_images.py | ricklentz/deep-object-reid | bf4d30d78e4a34847496d0efb50d98541f5274f9 | [
"MIT"
] | null | null | null | tools/data/align_images.py | ricklentz/deep-object-reid | bf4d30d78e4a34847496d0efb50d98541f5274f9 | [
"MIT"
] | null | null | null | tools/data/align_images.py | ricklentz/deep-object-reid | bf4d30d78e4a34847496d0efb50d98541f5274f9 | [
"MIT"
] | null | null | null | """
Copyright (c) 2020-2021 Intel Corporation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to i... | 33.183246 | 105 | 0.68113 |
b2967825f9fd6d3c5951876adfeb1e355d0e39c7 | 2,657 | py | Python | model_ops.py | giancds/attentive_lm | 0242c42773d5f35969614b3187956a3a30ea9f7e | [
"Apache-2.0"
] | 14 | 2018-03-03T09:54:46.000Z | 2021-03-10T13:30:00.000Z | model_ops.py | giancds/attentive_lm | 0242c42773d5f35969614b3187956a3a30ea9f7e | [
"Apache-2.0"
] | 1 | 2019-04-08T13:50:28.000Z | 2019-07-23T13:42:48.000Z | model_ops.py | giancds/attentive_lm | 0242c42773d5f35969614b3187956a3a30ea9f7e | [
"Apache-2.0"
] | 5 | 2016-06-28T17:31:17.000Z | 2019-11-20T03:08:25.000Z | # -*- coding: utf-8 -*-
"""
This module contains functions to run the main loop of the Attentive LM.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import attention
# pylint: disable=C0111,R0903
def get_config(name):
if name == "ptb_combined":
r... | 23.936937 | 72 | 0.676327 |
1fa59edef8d8045eac502c98df3cd28bf7886caa | 539 | py | Python | src/konvens2020_summarization/predictors/grammar_predictor.py | fraunhofer-iais/hybrid_summarization_eval | 399505ca2bc3485b7e88840a83a803b03f7779c8 | [
"Apache-2.0"
] | 1 | 2021-09-13T22:59:46.000Z | 2021-09-13T22:59:46.000Z | src/konvens2020_summarization/predictors/grammar_predictor.py | fraunhofer-iais/hybrid_summarization_eval | 399505ca2bc3485b7e88840a83a803b03f7779c8 | [
"Apache-2.0"
] | null | null | null | src/konvens2020_summarization/predictors/grammar_predictor.py | fraunhofer-iais/hybrid_summarization_eval | 399505ca2bc3485b7e88840a83a803b03f7779c8 | [
"Apache-2.0"
] | null | null | null | import numpy as np
from pylanguagetool import api
from tqdm import tqdm
from konvens2020_summarization.data_classes import Corpus
def predict_grammar_score(corpus: Corpus, name: str, grammar_penalty: float):
for d in tqdm(corpus.documents):
for s in d.gen_summaries:
n_issues = len(api.check(s.... | 38.5 | 111 | 0.705009 |
dc5061ebb97f038f2ba093a843e8ec39efef0bc4 | 5,181 | py | Python | lib_client/src/d1_client/baseclient_1_1.py | DataONEorg/d1_python | dfab267c3adea913ab0e0073ed9dc1ee50b5b8eb | [
"Apache-2.0"
] | 15 | 2016-10-28T13:56:52.000Z | 2022-01-31T19:07:49.000Z | lib_client/src/d1_client/baseclient_1_1.py | DataONEorg/d1_python | dfab267c3adea913ab0e0073ed9dc1ee50b5b8eb | [
"Apache-2.0"
] | 56 | 2017-03-16T03:52:32.000Z | 2022-03-12T01:05:28.000Z | lib_client/src/d1_client/baseclient_1_1.py | DataONEorg/d1_python | dfab267c3adea913ab0e0073ed9dc1ee50b5b8eb | [
"Apache-2.0"
] | 11 | 2016-05-31T16:22:02.000Z | 2020-10-05T14:37:10.000Z | #!/usr/bin/env python
# This work was created by participants in the DataONE project, and is
# jointly copyrighted by participating institutions in DataONE. For
# more information on DataONE, see our web site at http://dataone.org.
#
# Copyright 2009-2019 DataONE
#
# Licensed under the Apache License, Version 2.0 (t... | 35.006757 | 153 | 0.654121 |
64012a68d41037678bdda706c0204784a8e0dbf7 | 2,549 | py | Python | tests/support/payload_builder.py | dotmesh-io/meltano | 4616d44ded9dff4e9ad19a9004349e9baa16ddd5 | [
"MIT"
] | 4 | 2019-12-01T12:47:58.000Z | 2021-02-09T00:42:52.000Z | tests/support/payload_builder.py | dotmesh-io/meltano | 4616d44ded9dff4e9ad19a9004349e9baa16ddd5 | [
"MIT"
] | 38 | 2019-12-09T06:53:33.000Z | 2022-03-29T22:29:19.000Z | tests/support/payload_builder.py | dotmesh-io/meltano | 4616d44ded9dff4e9ad19a9004349e9baa16ddd5 | [
"MIT"
] | 1 | 2020-11-23T20:47:18.000Z | 2020-11-23T20:47:18.000Z | class PayloadBuilder:
def __init__(self, source_name: str, **kwargs):
self._name = source_name
self._columns = set()
self._aggregates = set()
self._joins = {}
self._column_filters = []
self._aggregate_filters = []
self._order_by_clauses = []
self._defa... | 27.706522 | 71 | 0.54335 |
b15c30d6ca33698b9960fd18f8034a7178e22f00 | 3,008 | py | Python | bspump/aggregation/hyperloglog.py | thatch/BitSwanPump | 98a5b8d09f9b59d5361611cee0bd45e7b4c69e3f | [
"BSD-3-Clause"
] | 17 | 2019-02-14T09:26:03.000Z | 2022-03-11T09:23:52.000Z | bspump/aggregation/hyperloglog.py | thatch/BitSwanPump | 98a5b8d09f9b59d5361611cee0bd45e7b4c69e3f | [
"BSD-3-Clause"
] | 91 | 2019-05-06T18:59:02.000Z | 2022-01-11T06:22:32.000Z | bspump/aggregation/hyperloglog.py | thatch/BitSwanPump | 98a5b8d09f9b59d5361611cee0bd45e7b4c69e3f | [
"BSD-3-Clause"
] | 10 | 2019-04-23T08:48:58.000Z | 2022-02-13T14:24:28.000Z | import numpy as np
import zlib
class HyperLogLog(object):
'''
This is the implementation of HyperLogLog++ algorithm,
which estimates cardinality of the set with average 2%,
described in http://algo.inria.fr/flajolet/Publications/FlFuGaMe07.pdf
and https://storage.googleapis.com/pub-tools-public-publication-d... | 22.117647 | 86 | 0.646609 |
b2c3f6d033e9e24adc9b9255e9ff3673a93c41dd | 1,780 | py | Python | bin/bin_SMHMr/MD10-write-clusterFiles.py | JohanComparat/nbody-npt-functions | a034db4e5a9b2f87dc42eeb6059c4dd280589e4a | [
"CC0-1.0"
] | 4 | 2017-11-07T02:15:46.000Z | 2022-03-03T01:35:53.000Z | bin/bin_SMHMr/MD10-write-clusterFiles.py | JohanComparat/nbody-npt-functions | a034db4e5a9b2f87dc42eeb6059c4dd280589e4a | [
"CC0-1.0"
] | null | null | null | bin/bin_SMHMr/MD10-write-clusterFiles.py | JohanComparat/nbody-npt-functions | a034db4e5a9b2f87dc42eeb6059c4dd280589e4a | [
"CC0-1.0"
] | 2 | 2020-08-12T14:26:38.000Z | 2021-09-14T06:08:58.000Z | from MultiDark import *
import sys
import glob
import os
import astropy.io.fits as fits
sf = fits.open(os.path.join(os.environ["MD10"], "output_MD_1.0Gpc.fits"))[1].data
snList= n.array([os.path.join(os.environ["MD10"], "snapshots", "out_"+name+".list") for name in sf['snap_name']])
box = MultiDarkSimulation(Lbox=10... | 63.571429 | 534 | 0.585955 |
ca1f496d1ecd91d47ce39497b03531c8b0196cd2 | 2,964 | py | Python | azure-mgmt-network/azure/mgmt/network/v2018_10_01/models/packet_capture_filter_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-network/azure/mgmt/network/v2018_10_01/models/packet_capture_filter_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-network/azure/mgmt/network/v2018_10_01/models/packet_capture_filter_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | null | null | null | # 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 ... | 48.590164 | 162 | 0.659244 |
66d9d9e88c73f27ec22c6379dedcf049f99f3ef5 | 544 | py | Python | tests/calculateFeatures.py | adbeda/cali-wfire | 4331e7c961efe0aa3ccddac0032d8e197e032c73 | [
"MIT"
] | 13 | 2018-12-14T01:35:46.000Z | 2022-03-17T21:29:46.000Z | tests/calculateFeatures.py | adbeda/cali-wfire | 4331e7c961efe0aa3ccddac0032d8e197e032c73 | [
"MIT"
] | null | null | null | tests/calculateFeatures.py | adbeda/cali-wfire | 4331e7c961efe0aa3ccddac0032d8e197e032c73 | [
"MIT"
] | 3 | 2019-04-06T04:15:23.000Z | 2021-02-02T17:24:46.000Z |
'''this test script produces a data-frame containing extracted features '''
from tsraster.calculate import calculateFeatures
#file directory
path = "../docs/img/temperature/"
parameters = {
"mean": None,
"maximum": None,
"median":None,
"minimum":None,
"mean_abs_change":None,
"mean_change":No... | 25.904762 | 94 | 0.667279 |
725d1beaf5b0ec0d8402086d1ffa26c1ba0a45f6 | 4,500 | py | Python | geneva/data/crim_dataset.py | HarmanDotpy/GeNeVA | b43f6608bc6f644a4634d737c6a057b274589387 | [
"MIT"
] | null | null | null | geneva/data/crim_dataset.py | HarmanDotpy/GeNeVA | b43f6608bc6f644a4634d737c6a057b274589387 | [
"MIT"
] | null | null | null | geneva/data/crim_dataset.py | HarmanDotpy/GeNeVA | b43f6608bc6f644a4634d737c6a057b274589387 | [
"MIT"
] | null | null | null | # Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
"""PyTorch Dataset implementation for Iterative CLEVR dataset"""
from collections import defaultdict
import json
import cv2
import h5py
import numpy as np
import torch
from torch.utils.data import Dataset
from glob import glo... | 33.333333 | 146 | 0.618889 |
3ba43391cfab7e38276b5ae543b9700bf1ae039f | 437 | py | Python | podcasts/migrations/0017_auto_20161025_1615.py | jrigden/podir | 1c6ef75d39996792702858df0b3d8e04a334c171 | [
"MIT"
] | null | null | null | podcasts/migrations/0017_auto_20161025_1615.py | jrigden/podir | 1c6ef75d39996792702858df0b3d8e04a334c171 | [
"MIT"
] | null | null | null | podcasts/migrations/0017_auto_20161025_1615.py | jrigden/podir | 1c6ef75d39996792702858df0b3d8e04a334c171 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.2 on 2016-10-25 16:15
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('podcasts', '0016_auto_20161025_1550'),
]
operations = [
migrations.RenameField(
... | 20.809524 | 48 | 0.613272 |
0384641cf7da259d9a7e687d0704e37a615832d1 | 3,622 | py | Python | bin/read_from_wav.py | FRidh/auraliser | f20f037ca131299d1a584ea640bb39d83b5ceb26 | [
"BSD-2-Clause"
] | 2 | 2018-03-25T01:36:32.000Z | 2018-12-05T11:43:26.000Z | bin/read_from_wav.py | FRidh/auraliser | f20f037ca131299d1a584ea640bb39d83b5ceb26 | [
"BSD-2-Clause"
] | 3 | 2016-11-01T16:54:40.000Z | 2021-02-25T14:13:18.000Z | bin/read_from_wav.py | FRidh/auraliser | f20f037ca131299d1a584ea640bb39d83b5ceb26 | [
"BSD-2-Clause"
] | null | null | null | """
Example that shows how to unapply the Doppler shift to an existing wav file.
"""
import sys
sys.path.append('..')
import numpy as np
#from auraliser import Signal
from auraliser.signal import Signal
from auraliser.model import Model, Source, Receiver
import matplotlib as mpl
mpl.rc('figure', figsize=(12,10))... | 31.224138 | 111 | 0.652678 |
1da6c2497156cd58fc4b35c6c90260b47daa47fa | 1,781 | py | Python | src/simulation/entity.py | rah/optimal-search | 96d46ae1491b105a1ee21dc75e9297337249d466 | [
"MIT"
] | null | null | null | src/simulation/entity.py | rah/optimal-search | 96d46ae1491b105a1ee21dc75e9297337249d466 | [
"MIT"
] | 4 | 2018-04-26T01:49:12.000Z | 2022-01-08T08:12:52.000Z | src/simulation/entity.py | rah/optimal-search | 96d46ae1491b105a1ee21dc75e9297337249d466 | [
"MIT"
] | null | null | null | class Entity(object):
'''
An entity has:
- energy
- position(x,y)
- size(length, width)
An entity may have a parent entity
An entity may have child entities
'''
def __init__(
self,
p,
parent=None,
children=None):
... | 25.442857 | 63 | 0.498596 |
85ad261653a0af7a485746c21d221fda392366ad | 7,961 | py | Python | src/extlib/core.py | jnsougata/extslash | 3e3450d6592b0b0ca48dd053f55cb0af4db6311f | [
"MIT"
] | 2 | 2022-01-31T02:43:59.000Z | 2022-02-06T12:32:06.000Z | src/extlib/core.py | jnsougata/ExtSlash | 3e3450d6592b0b0ca48dd053f55cb0af4db6311f | [
"MIT"
] | null | null | null | src/extlib/core.py | jnsougata/ExtSlash | 3e3450d6592b0b0ca48dd053f55cb0af4db6311f | [
"MIT"
] | null | null | null | from __future__ import annotations
import sys
import discord
from .errors import *
from .https import *
from discord.http import Route
from discord.ext import commands
from dataclasses import dataclass
from .origin import ApplicationCommandOrigin
from typing import List, Optional, Union, Any, Dict
from .enums import Op... | 33.44958 | 116 | 0.617008 |
910a846750543b489d8b4dc8884191b0fccc493d | 7,622 | py | Python | oss_scripts/model_server/save_models.py | hanneshapke/text | 8bebbbe28749de5509be474bc475cef83490f013 | [
"Apache-2.0"
] | null | null | null | oss_scripts/model_server/save_models.py | hanneshapke/text | 8bebbbe28749de5509be474bc475cef83490f013 | [
"Apache-2.0"
] | null | null | null | oss_scripts/model_server/save_models.py | hanneshapke/text | 8bebbbe28749de5509be474bc475cef83490f013 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2020 TF.Text Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 43.804598 | 80 | 0.575177 |
c48c4245e48e3663d0cf8dc773a49293e550a52f | 7,508 | py | Python | object/shortest_path_class1.py | ushita37/shortest_path | a04eea43480809f528fa4b8d5878b23f11e58c1b | [
"MIT"
] | null | null | null | object/shortest_path_class1.py | ushita37/shortest_path | a04eea43480809f528fa4b8d5878b23f11e58c1b | [
"MIT"
] | null | null | null | object/shortest_path_class1.py | ushita37/shortest_path | a04eea43480809f528fa4b8d5878b23f11e58c1b | [
"MIT"
] | null | null | null | # © 2021 ushita37
class Graph:
def __init__(self, vSet, eSet) -> None:
#アトリビュートを隠蔽
self.__vertexSet = vSet
self.__edgeSet = eSet
# vertexSetのゲッター
def getVertexSet(self):
return self.__vertexSet
# edgeSetのゲッター
def getEdgeSet(self):
return self.__edgeSet
... | 31.679325 | 114 | 0.611881 |
b43f52ae38589a5b147062dd35738ebdb07aec9a | 1,925 | py | Python | built-in/PyTorch/Official/cv/image_object_detection/YoloV3_ID1790_for_PyTorch/configs/mask_rcnn/mask_rcnn_r50_caffe_fpn_1x_coco.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 12 | 2020-12-13T08:34:24.000Z | 2022-03-20T15:17:17.000Z | built-in/PyTorch/Official/cv/image_object_detection/YoloV3_ID1790_for_PyTorch/configs/mask_rcnn/mask_rcnn_r50_caffe_fpn_1x_coco.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 1 | 2022-01-20T03:11:05.000Z | 2022-01-20T06:53:39.000Z | built-in/PyTorch/Official/cv/image_object_detection/YoloV3_ID1790_for_PyTorch/configs/mask_rcnn/mask_rcnn_r50_caffe_fpn_1x_coco.py | Ascend/modelzoo | f018cfed33dbb1cc2110b9ea2e233333f71cc509 | [
"Apache-2.0"
] | 2 | 2021-07-10T12:40:46.000Z | 2021-12-17T07:55:15.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agree... | 37.745098 | 77 | 0.674286 |
5344007a93d51dda68dca7bce0d83cecb8e449a4 | 4,310 | py | Python | Monotop/plotting/sf_tt.py | GuillelmoGomezCeballos/PandaAnalysis | 87a62effbe320d0d981e032f240c057e5ab2d3fc | [
"MIT"
] | null | null | null | Monotop/plotting/sf_tt.py | GuillelmoGomezCeballos/PandaAnalysis | 87a62effbe320d0d981e032f240c057e5ab2d3fc | [
"MIT"
] | 3 | 2017-12-09T06:50:57.000Z | 2018-02-22T08:58:12.000Z | Monotop/plotting/sf_tt.py | GuillelmoGomezCeballos/PandaAnalysis | 87a62effbe320d0d981e032f240c057e5ab2d3fc | [
"MIT"
] | 1 | 2017-09-24T18:29:16.000Z | 2017-09-24T18:29:16.000Z | #!/usr/bin/env python
from os import system,getenv
from sys import argv
import argparse
### SET GLOBAL VARIABLES ###
parser = argparse.ArgumentParser(description='plot stuff')
parser.add_argument('--outdir',metavar='outdir',type=str,default=None)
args = parser.parse_args()
args.outdir += '/'
lumi = 36560.
blind=True
... | 28.543046 | 80 | 0.742691 |
62bb28d18edf7f149903b82fe5c2a4c1dd6b1e50 | 13,752 | py | Python | spiders/utils/photo.py | jacobic/spiders | 287dcf041ba248dd369646236cdbf07ecf32d4e8 | [
"MIT"
] | null | null | null | spiders/utils/photo.py | jacobic/spiders | 287dcf041ba248dd369646236cdbf07ecf32d4e8 | [
"MIT"
] | null | null | null | spiders/utils/photo.py | jacobic/spiders | 287dcf041ba248dd369646236cdbf07ecf32d4e8 | [
"MIT"
] | null | null | null |
import os
import numpy as np
from sklearn.metrics import auc
def filter_conversion(names, directory):
areas = []
for n in names[:2]:
photo_filter = np.loadtxt(os.path.join(directory, n))
areas.append(auc(photo_filter[0], photo_filter[1]))
return -2.51 * np.log(areas[0] / areas[1])
def c... | 35.443299 | 87 | 0.397688 |
8b5ef4efdaad2b24c84e9d7e1408ffd41efb4338 | 4,272 | py | Python | nlptoolkit/datasets/elmodataset.py | jianzhnie/d2nlp | 94da74ec9be3aeee699b358f6bba9fde43bd80c0 | [
"Apache-2.0"
] | 3 | 2021-12-01T12:25:00.000Z | 2022-03-07T02:22:00.000Z | nlptoolkit/datasets/elmodataset.py | jianzhnie/nlp-toolkit | 94da74ec9be3aeee699b358f6bba9fde43bd80c0 | [
"Apache-2.0"
] | null | null | null | nlptoolkit/datasets/elmodataset.py | jianzhnie/nlp-toolkit | 94da74ec9be3aeee699b358f6bba9fde43bd80c0 | [
"Apache-2.0"
] | null | null | null | '''
Author: jianzhnie
Date: 2022-01-05 16:38:43
LastEditTime: 2022-01-20 09:47:52
LastEditors: jianzhnie
Description:
'''
import codecs
import torch
from torch.nn.utils.rnn import pad_sequence
from torch.utils.data import Dataset
from tqdm.auto import tqdm
from nlptoolkit.data.utils.utils import (BOS_TOKEN, BOW_TOK... | 35.016393 | 76 | 0.599953 |
f37674f8dbca5a45f617807e63c4f82b7f52a211 | 6,880 | py | Python | tensorflow/python/kernel_tests/linalg/matrix_logarithm_op_test.py | EricRemmerswaal/tensorflow | 141ff27877579c81a213fa113bd1b474c1749aca | [
"Apache-2.0"
] | 190,993 | 2015-11-09T13:17:30.000Z | 2022-03-31T23:05:27.000Z | tensorflow/python/kernel_tests/linalg/matrix_logarithm_op_test.py | EricRemmerswaal/tensorflow | 141ff27877579c81a213fa113bd1b474c1749aca | [
"Apache-2.0"
] | 48,461 | 2015-11-09T14:21:11.000Z | 2022-03-31T23:17:33.000Z | tensorflow/python/kernel_tests/linalg/matrix_logarithm_op_test.py | EricRemmerswaal/tensorflow | 141ff27877579c81a213fa113bd1b474c1749aca | [
"Apache-2.0"
] | 104,981 | 2015-11-09T13:40:17.000Z | 2022-03-31T19:51:54.000Z | # Copyright 2017 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... | 36.989247 | 80 | 0.688663 |
5cf418c203e974007031c4bb0dad64ecbd8a3867 | 396 | py | Python | features/det_uniform_sampling.py | aycatakmaz/compass | 82848db4eed41f1caaca644b7e2b0fa4a4038103 | [
"Apache-2.0"
] | 15 | 2020-10-24T13:06:48.000Z | 2022-02-20T09:15:28.000Z | features/det_uniform_sampling.py | aycatakmaz/compass | 82848db4eed41f1caaca644b7e2b0fa4a4038103 | [
"Apache-2.0"
] | 3 | 2021-04-28T15:38:51.000Z | 2021-11-12T04:03:25.000Z | features/det_uniform_sampling.py | QiangZiBro/compass | 30c3d89a69e496185488dd5f596de517f59624fc | [
"Apache-2.0"
] | 5 | 2021-07-07T06:17:26.000Z | 2022-03-24T04:21:54.000Z | from features import detector as det
import os
class UniformSamplingKeypointDetector(det.KeypointDetector):
"""
Class to detect features uniform sampled
"""
def __init__(self, *args, **kwargs):
super(UniformSamplingKeypointDetector, self).__init__(*args, **kwargs)
def detect_keypoints(s... | 24.75 | 78 | 0.727273 |
3668c803273c63ec778ba33a41e470e64136b10f | 10,551 | py | Python | vul/53-webLogic-CVE-2018-2893.py | zx273983653/vulscan | 787397e267c4e6469522ee0abe55b3e98f968d4a | [
"MIT"
] | 582 | 2019-02-23T09:23:33.000Z | 2022-03-31T04:42:08.000Z | vul/53-webLogic-CVE-2018-2893.py | git-wsf/vulscan | 112f8d6104daecfaaad579f73029a26d56aaa9b3 | [
"MIT"
] | 6 | 2019-03-20T10:37:48.000Z | 2020-03-10T06:20:07.000Z | vul/53-webLogic-CVE-2018-2893.py | git-wsf/vulscan | 112f8d6104daecfaaad579f73029a26d56aaa9b3 | [
"MIT"
] | 183 | 2019-02-23T06:00:18.000Z | 2022-03-20T02:17:57.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Copyright (c) 2014-2015 pocsuite developers (http://seebug.org)
See the file 'docs/COPYING' for copying permission
"""
# 命令行
from pocsuite import pocsuite_cli
# 验证模块
from pocsuite import pocsuite_verify
# 攻击模块
from pocsuite import pocsuite_attack
# 控制台模式
from pocsuite ... | 57.342391 | 2,062 | 0.819638 |
e6ecc920708f87af3f218b5291cfa64a7236bef8 | 8,153 | py | Python | seqan/util/py_lib/seqan/dox/pure.py | gulsumgudukbay/diBELLA.2D | 1148e2dfa4765e68e79778eabf28e2f9ed913730 | [
"BSD-3-Clause-LBNL"
] | 16 | 2020-10-26T07:38:56.000Z | 2022-03-25T22:33:07.000Z | seqan/util/py_lib/seqan/dox/pure.py | gulsumgudukbay/diBELLA.2D | 1148e2dfa4765e68e79778eabf28e2f9ed913730 | [
"BSD-3-Clause-LBNL"
] | 1 | 2021-02-11T01:18:22.000Z | 2021-02-11T23:46:37.000Z | seqan/util/py_lib/seqan/dox/pure.py | gulsumgudukbay/diBELLA.2D | 1148e2dfa4765e68e79778eabf28e2f9ed913730 | [
"BSD-3-Clause-LBNL"
] | 6 | 2020-10-23T18:05:58.000Z | 2021-12-09T17:32:57.000Z | #!/usr/bin/env python
"""Implementation of the SeqAn Doxygen dialect.
"""
import argparse
import configparser
import logging
import os
import re
import sys
from . import file_mgr
from . import lexer
from . import dox_tokens
from . import dox_parser
from . import proc_doc
from . import raw_doc
from . import write_html... | 38.63981 | 121 | 0.617809 |
525520e9bfd46c8a6b138ad05105ea4f32f96b90 | 2,426 | py | Python | PHOTOS/tests.py | JacqulineWangu/Photos | 8f77ccf7df8d7dcf1154cd1071ceefdfd57bd659 | [
"MIT"
] | null | null | null | PHOTOS/tests.py | JacqulineWangu/Photos | 8f77ccf7df8d7dcf1154cd1071ceefdfd57bd659 | [
"MIT"
] | 4 | 2020-06-05T21:39:00.000Z | 2021-09-08T01:04:12.000Z | PHOTOS/tests.py | JacqulineWangu/Photos | 8f77ccf7df8d7dcf1154cd1071ceefdfd57bd659 | [
"MIT"
] | null | null | null | from django.test import TestCase
# Create your tests here.
from django.test import TestCase
from .models import Location,Category,Image
class LocationTestClass(TestCase):
def setUp(self):
self.mombasa = Location(location='Mombasa')
def test_instance(self):
self.assertTrue(isinstance(... | 31.921053 | 149 | 0.67972 |
012fe573c4d51bee44be7ea58db7d5b90a3a6ea3 | 699 | py | Python | applications/myblog/urls_slug.py | YA-androidapp/Django-Blog-5minutes | 8d2df0120013ffacf6e6a44590825fe0987dae0b | [
"Apache-2.0"
] | null | null | null | applications/myblog/urls_slug.py | YA-androidapp/Django-Blog-5minutes | 8d2df0120013ffacf6e6a44590825fe0987dae0b | [
"Apache-2.0"
] | null | null | null | applications/myblog/urls_slug.py | YA-androidapp/Django-Blog-5minutes | 8d2df0120013ffacf6e6a44590825fe0987dae0b | [
"Apache-2.0"
] | null | null | null | from django.urls import path
from . import conf
urlpatterns = [
]
from .views import post
urlpatterns += [
# post
path(
'post/',
post.List.as_view(),
name=conf.POST_LIST_URL_NAME
),
path(
'post/create/',
post.Create.as_view(),
name=conf.POST_CREATE_UR... | 17.475 | 38 | 0.552217 |
bd184247a8f2e6c62b20e76fbc9bcfef5ba6f096 | 4,542 | py | Python | multiworld/envs/mujoco/pointMass/point.py | Neo-X/R_multiworld | 839513a48ddf2f5ae2eadc43435ac6981ddea1f4 | [
"MIT"
] | null | null | null | multiworld/envs/mujoco/pointMass/point.py | Neo-X/R_multiworld | 839513a48ddf2f5ae2eadc43435ac6981ddea1f4 | [
"MIT"
] | null | null | null | multiworld/envs/mujoco/pointMass/point.py | Neo-X/R_multiworld | 839513a48ddf2f5ae2eadc43435ac6981ddea1f4 | [
"MIT"
] | 2 | 2020-06-02T05:24:03.000Z | 2020-07-07T17:01:42.000Z |
from multiworld.envs.env_util import get_stat_in_paths, \
create_stats_ordered_dict, get_asset_full_path
from multiworld.core.serializable import Serializable
from multiworld.envs.mujoco.mujoco_env import MujocoEnv
import numpy as np
class PointEnv(MujocoEnv, Serializable):
def __init__(self, tasks = [{'go... | 28.929936 | 117 | 0.570454 |
ab8c087515e5f1b628a0fcd111d19b07c5814510 | 4,123 | py | Python | benchmark/startQiskit1353.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit1353.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | benchmark/startQiskit1353.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=5
# total number=44
import cirq
import qiskit
from qiskit import QuantumCircuit, QuantumRegister, ClassicalRegister
from qiskit import BasicAer, execute, transpile
from pprint import pprint
from qiskit.test.mock import FakeVigo
from math import log2,floor, sqrt, pi
import numpy as np
import networkx as ... | 31.96124 | 82 | 0.615571 |
add9a9722445352608dfc87907fe2da233b00da7 | 173 | py | Python | challenges/dict_comprehensions.py | UltiRequiem/Curso-Intermedio-de-Python-Platzi | dec6cf86d47fb9113f7ef6715f28d87471350537 | [
"BSD-3-Clause"
] | 3 | 2021-05-29T23:30:43.000Z | 2021-06-05T15:19:18.000Z | challenges/dict_comprehensions.py | UltiRequiem/Curso-Intermedio-de-Python-Platzi | dec6cf86d47fb9113f7ef6715f28d87471350537 | [
"BSD-3-Clause"
] | null | null | null | challenges/dict_comprehensions.py | UltiRequiem/Curso-Intermedio-de-Python-Platzi | dec6cf86d47fb9113f7ef6715f28d87471350537 | [
"BSD-3-Clause"
] | 2 | 2021-06-04T20:23:13.000Z | 2021-06-05T15:19:20.000Z | from math import sqrt
def dict_comprenhension():
my_dict = {i: sqrt(i) for i in range(1,1001)}
print(my_dict)
if __name__ == '__main__':
dict_comprenhension()
| 19.222222 | 49 | 0.682081 |
ae998706f3ff9ef3bda9b7183fb973806b70cb48 | 8,852 | py | Python | corescan_plotting/linescan.py | spmls/corescan-plotting | cef97d480bf1bc542caaa866115d22f7a242c909 | [
"MIT"
] | null | null | null | corescan_plotting/linescan.py | spmls/corescan-plotting | cef97d480bf1bc542caaa866115d22f7a242c909 | [
"MIT"
] | 2 | 2020-06-25T20:50:26.000Z | 2020-06-25T20:58:19.000Z | corescan_plotting/linescan.py | spmls/corescan_plotting | 6b2ec1a18d44d971f430cc74bc665a88f0199fe9 | [
"MIT"
] | null | null | null | """
Created on Friday March 15 16:22 2019
tools to work with tiffs from the GeoTek RXCT scanner
@author: SeanPaul La Selle
"""
import os
import sys
import glob
import tkinter
from tkinter import filedialog
import numpy as np
import xml.etree.ElementTree
import tifffile
from skimage.transform import downscale_local_m... | 33.915709 | 86 | 0.551853 |
68eca1b2619a93f2b794298e864a19d981388ea2 | 304 | py | Python | PythonExercicios/ex104.py | raulgranja/Python-Course | eaf776ab144923266a4784586f6bdf21911a5235 | [
"MIT"
] | null | null | null | PythonExercicios/ex104.py | raulgranja/Python-Course | eaf776ab144923266a4784586f6bdf21911a5235 | [
"MIT"
] | null | null | null | PythonExercicios/ex104.py | raulgranja/Python-Course | eaf776ab144923266a4784586f6bdf21911a5235 | [
"MIT"
] | null | null | null | def leiaint(num):
while True:
v = input(num)
if v.isnumeric():
v = int(v)
return v
else:
print('\033[31mERRO! Digite um número inteiro válido.\033[m')
# main
n = leiaint('Digite um número: ')
print(f'Você acabou de digitar o número {n}')
| 21.714286 | 73 | 0.539474 |
540b7cd906bf437a330424f876200e21f3fe1221 | 1,137 | py | Python | smsgateway/backends/smsextrapro.py | mvpoland/django-smsgateway | 84ffc9e6d9f83399694e4c3030cd4104d6e54005 | [
"BSD-3-Clause"
] | null | null | null | smsgateway/backends/smsextrapro.py | mvpoland/django-smsgateway | 84ffc9e6d9f83399694e4c3030cd4104d6e54005 | [
"BSD-3-Clause"
] | 4 | 2017-01-10T15:59:11.000Z | 2018-07-25T07:40:35.000Z | smsgateway/backends/smsextrapro.py | mvpoland/django-smsgateway | 84ffc9e6d9f83399694e4c3030cd4104d6e54005 | [
"BSD-3-Clause"
] | null | null | null | from django.http import HttpResponse
from django.utils.http import urlencode
from smsgateway.backends.base import SMSBackend
class SmsExtraProBackend(SMSBackend):
def get_send_url(self, sms_request, account_dict):
# Set signature
signature = sms_request.signature[:11]
signature = ''.join(... | 28.425 | 88 | 0.614776 |
31dfa50d7ef4443e0c07da4ded1da36cb2db7008 | 636 | py | Python | manage.py | debexpo/debexpo | 866b0e61726b14425f02e10977398444785337be | [
"MIT"
] | 3 | 2016-02-17T08:47:07.000Z | 2017-05-20T20:43:23.000Z | manage.py | debexpo/debexpo | 866b0e61726b14425f02e10977398444785337be | [
"MIT"
] | 44 | 2015-01-11T00:54:24.000Z | 2019-08-17T21:06:25.000Z | manage.py | debexpo/debexpo | 866b0e61726b14425f02e10977398444785337be | [
"MIT"
] | 8 | 2015-01-12T00:57:32.000Z | 2017-01-20T23:01:52.000Z | #!/usr/bin/env python3
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'debexpo.settings.debexpo')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
rai... | 28.909091 | 79 | 0.685535 |
2505b6c0ac577fbf6ce99e955110481e5d78db68 | 17,011 | py | Python | dojo/unittests/test_dependency_check_parser.py | krbalag/django-DefectDojo | f93e24ef97cd06e426e60e708602eb8fc797ec80 | [
"BSD-3-Clause"
] | 2 | 2019-06-26T14:11:17.000Z | 2020-10-12T23:14:52.000Z | dojo/unittests/test_dependency_check_parser.py | viral-sangani/django-DefectDojo | e0fa585ee770bd0b15ba4a73bd81e6cc043650fd | [
"BSD-3-Clause"
] | 73 | 2020-10-03T12:54:14.000Z | 2022-03-31T19:13:01.000Z | dojo/unittests/test_dependency_check_parser.py | viral-sangani/django-DefectDojo | e0fa585ee770bd0b15ba4a73bd81e6cc043650fd | [
"BSD-3-Clause"
] | 1 | 2021-09-10T12:53:30.000Z | 2021-09-10T12:53:30.000Z | from defusedxml import ElementTree
from django.test import TestCase
from dojo.models import Test
from dojo.tools.dependency_check.parser import DependencyCheckParser
class TestFile(object):
def read(self):
return self.content
def __init__(self, name, content):
self.name = name
self.... | 44.069948 | 124 | 0.551055 |
b9f41bba2f10e50c08079beba5979c99b6094257 | 1,890 | py | Python | experiments/tile_inference_speed/plot.py | cmusatyalab/dronesearch | 9849637555185efa0a484f49bef43ad734964e8a | [
"Apache-2.0"
] | 8 | 2019-11-19T10:57:09.000Z | 2021-10-08T23:19:12.000Z | experiments/tile_inference_speed/plot.py | cmusatyalab/dronesearch | 9849637555185efa0a484f49bef43ad734964e8a | [
"Apache-2.0"
] | 7 | 2020-01-28T22:18:13.000Z | 2022-01-13T01:36:22.000Z | experiments/tile_inference_speed/plot.py | cmusatyalab/dronesearch | 9849637555185efa0a484f49bef43ad734964e8a | [
"Apache-2.0"
] | null | null | null | """
===========================
Plots with different scales
===========================
Demonstrate how to do two plots on the same axes with different left and
right scales.
The trick is to use *two different axes* that share the same *x* axis.
You can use separate `matplotlib.ticker` formatters and locators as
desi... | 32.586207 | 83 | 0.683069 |
be838ab33a5dd102eca02da8d57769cbfa456be1 | 10,040 | py | Python | rl_modules/replay_buffer.py | vaibhav117/sim2real4real | b1f253ef359eda0c7e3b594f89c8a35f0cf925bf | [
"MIT"
] | null | null | null | rl_modules/replay_buffer.py | vaibhav117/sim2real4real | b1f253ef359eda0c7e3b594f89c8a35f0cf925bf | [
"MIT"
] | null | null | null | rl_modules/replay_buffer.py | vaibhav117/sim2real4real | b1f253ef359eda0c7e3b594f89c8a35f0cf925bf | [
"MIT"
] | 1 | 2021-09-17T09:17:37.000Z | 2021-09-17T09:17:37.000Z | import threading
import numpy as np
"""
the replay buffer here is basically from the openai baselines code
"""
class replay_buffer:
def __init__(self, env_params, buffer_size, sample_func, image_based, sym_image):
self.env_params = env_params
self.T = env_params['max_timesteps']
self.size ... | 41.147541 | 112 | 0.597809 |
66efbea56a393ffdf1ec391330be652bb8ca5f98 | 4,726 | py | Python | gripper_module/gripper_robotiq_3f.py | columbia-ai-robotics/adagrasp | 9b1bfbd0b639930949d44334bd2554c3c3f7f31f | [
"MIT"
] | 19 | 2021-04-15T01:48:58.000Z | 2022-02-11T10:25:37.000Z | gripper_module/gripper_robotiq_3f.py | columbia-robovision/adagrasp | 9b1bfbd0b639930949d44334bd2554c3c3f7f31f | [
"MIT"
] | null | null | null | gripper_module/gripper_robotiq_3f.py | columbia-robovision/adagrasp | 9b1bfbd0b639930949d44334bd2554c3c3f7f31f | [
"MIT"
] | 5 | 2021-04-09T00:46:09.000Z | 2021-11-16T11:32:24.000Z | import numpy as np
from gripper_module.gripper_base import GripperBase
import time
import threading
class GripperRobotiq3F(GripperBase):
def __init__(self, bullet_client, gripper_size):
r""" Initialization of robotiq-3f gripper
specific args for robotiq-3f:
- gripper_size: global scali... | 39.383333 | 169 | 0.652349 |
ae698ae04068efa7d6c2dbb1ea2378a880ab809a | 7,959 | py | Python | src/mop/azure/tests/test_policy_states.py | robertfischer3/python-mop | d81fe43e484f469d91992e471acf059ecfd57dd2 | [
"MIT"
] | 1 | 2020-01-14T21:38:10.000Z | 2020-01-14T21:38:10.000Z | src/mop/azure/tests/test_policy_states.py | robertfischer3/python-mop | d81fe43e484f469d91992e471acf059ecfd57dd2 | [
"MIT"
] | null | null | null | src/mop/azure/tests/test_policy_states.py | robertfischer3/python-mop | d81fe43e484f469d91992e471acf059ecfd57dd2 | [
"MIT"
] | 1 | 2020-01-30T03:12:59.000Z | 2020-01-30T03:12:59.000Z | import json
import os
import unittest
from configparser import ConfigParser
import pluggy
from dotenv import load_dotenv
from mop.azure.analysis.policy_analysis import EvaluatePolicies
from mop.azure.comprehension.operations.policy_states import PolicyStates
from mop.framework.azure_connections import AzureConnection... | 40.607143 | 174 | 0.676467 |
290b513b381a5604f711b79f800373acce0e9e4f | 549 | py | Python | cursoDePythonNaPratica/aula10funcoes.py | wemerson-henrique/kivy | 3cb6061a2d19b01e86c3738206f30c8a853763d4 | [
"MIT"
] | null | null | null | cursoDePythonNaPratica/aula10funcoes.py | wemerson-henrique/kivy | 3cb6061a2d19b01e86c3738206f30c8a853763d4 | [
"MIT"
] | null | null | null | cursoDePythonNaPratica/aula10funcoes.py | wemerson-henrique/kivy | 3cb6061a2d19b01e86c3738206f30c8a853763d4 | [
"MIT"
] | null | null | null | def resposta():
# Capturando a resposta do usuario e preprocessando-a
resp = input(">: ")
resp = resp.lower()
resp = resp.replace("é", "eh") # vai subistituir "é" por "eh"
return resp
def pegaNome(nome):
if "o meu nome eh " in nome:
nome = nome[14:]
nome = nome.title() # funções .... | 27.45 | 66 | 0.582878 |
147824afd00868df7f50949a3031b1d6988cb840 | 5,881 | py | Python | XGBoost/XGboostnew.py | Keerthic4/Imbalance_Class_Test | 8726ea0663dd403ebfdceadd7eef09b0f2a823e7 | [
"MIT"
] | 1 | 2021-08-09T19:55:15.000Z | 2021-08-09T19:55:15.000Z | XGBoost/XGboostnew.py | Keerthic4/Imbalance_Class_Test | 8726ea0663dd403ebfdceadd7eef09b0f2a823e7 | [
"MIT"
] | null | null | null | XGBoost/XGboostnew.py | Keerthic4/Imbalance_Class_Test | 8726ea0663dd403ebfdceadd7eef09b0f2a823e7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
"""
This script prompts a user to find best
hyperparameters values for Xgboost model by using hyperopt.
"""
import numpy as np
import pandas as pd
from sklearn.preprocessing import StandardScaler
from sklearn.metrics import log_loss
from hyperopt import hp, fmin, tp... | 38.94702 | 101 | 0.533923 |
2a46b581c6acbdbe8c73131f6e321a87eb42023c | 5,821 | py | Python | file/py/textrankkeyword.py | piscalpratama/KMSV2 | 7677d26c83236c25007f375a7157989e1322e9f9 | [
"MIT"
] | null | null | null | file/py/textrankkeyword.py | piscalpratama/KMSV2 | 7677d26c83236c25007f375a7157989e1322e9f9 | [
"MIT"
] | null | null | null | file/py/textrankkeyword.py | piscalpratama/KMSV2 | 7677d26c83236c25007f375a7157989e1322e9f9 | [
"MIT"
] | null | null | null | """Python implementation of the TextRank algoritm.
From this paper:
https://web.eecs.umich.edu/~mihalcea/papers/mihalcea.emnlp04.pdf
Based on:
https://gist.github.com/voidfiles/1646117
https://github.com/davidadamojr/TextRank
"""
import io
import itertools
import networkx as nx
import nltk
import os
from g... | 31.295699 | 91 | 0.662086 |
8c1596d3fb08b150780e10cfd94bd3cba81697f3 | 3,072 | py | Python | distributed/comm/utils.py | met-office-lab/distributed | 46e31cadd55456bbd0b85a01f040d1eb33ee587f | [
"BSD-3-Clause"
] | null | null | null | distributed/comm/utils.py | met-office-lab/distributed | 46e31cadd55456bbd0b85a01f040d1eb33ee587f | [
"BSD-3-Clause"
] | 1 | 2021-04-30T20:41:53.000Z | 2021-04-30T20:41:53.000Z | distributed/comm/utils.py | met-office-lab/distributed | 46e31cadd55456bbd0b85a01f040d1eb33ee587f | [
"BSD-3-Clause"
] | 1 | 2019-12-27T15:48:33.000Z | 2019-12-27T15:48:33.000Z | from __future__ import print_function, division, absolute_import
from concurrent.futures import ThreadPoolExecutor
import logging
import socket
from tornado import gen
from .. import protocol
from ..compatibility import finalize
from ..sizeof import sizeof
from ..utils import get_ip, get_ipv6, mp_context, nbytes
l... | 26.482759 | 82 | 0.644857 |
9176d757ebe3422f211a41a73efc214a580dbd64 | 2,072 | py | Python | aqua/tests/test_aqua.py | drakedevel/integrations-extras | 2eff6e2dd2b123214cd562b93a9b45753e27a959 | [
"BSD-3-Clause"
] | null | null | null | aqua/tests/test_aqua.py | drakedevel/integrations-extras | 2eff6e2dd2b123214cd562b93a9b45753e27a959 | [
"BSD-3-Clause"
] | null | null | null | aqua/tests/test_aqua.py | drakedevel/integrations-extras | 2eff6e2dd2b123214cd562b93a9b45753e27a959 | [
"BSD-3-Clause"
] | 2 | 2019-01-09T20:18:49.000Z | 2021-01-08T12:24:56.000Z | # (C) Datadog, Inc. 2018
# All rights reserved
# Licensed under Simplified BSD License (see LICENSE)
import os
import json
import pytest
from mock import MagicMock
from datadog_checks.aqua import AquaCheck
HERE = os.path.dirname(os.path.abspath(__file__))
@pytest.fixture
def instance():
return {
'url'... | 28.383562 | 88 | 0.638514 |
bbe4bb552e5645e90be382d86e321661d31d57f2 | 2,147 | py | Python | homework-1/micrograd/nn.py | Xrenya/DL_Catalyst | 017a33743ae768d0f8f2ff52091074b2b246ab66 | [
"MIT"
] | null | null | null | homework-1/micrograd/nn.py | Xrenya/DL_Catalyst | 017a33743ae768d0f8f2ff52091074b2b246ab66 | [
"MIT"
] | null | null | null | homework-1/micrograd/nn.py | Xrenya/DL_Catalyst | 017a33743ae768d0f8f2ff52091074b2b246ab66 | [
"MIT"
] | null | null | null | import numpy as np
from engine import Value, Tensor
class Module:
"""
Base class for every layer.
"""
def forward(self, *args, **kwargs):
"""Depends on functionality"""
pass
def __call__(self, *args, **kwargs):
"""For convenience we can use model(inp) to call forward pass... | 31.115942 | 103 | 0.632045 |
dcc73974c952ea399a559d92dc0d2251420d31b2 | 16,247 | py | Python | src/problem1.py | archulca/05b-Exam1Practice | daa6da4992114421ed70889d142a984c79269537 | [
"MIT"
] | null | null | null | src/problem1.py | archulca/05b-Exam1Practice | daa6da4992114421ed70889d142a984c79269537 | [
"MIT"
] | null | null | null | src/problem1.py | archulca/05b-Exam1Practice | daa6da4992114421ed70889d142a984c79269537 | [
"MIT"
] | null | null | null | """
PRACTICE Exam 1, problem 1.
Authors: David Mutchler, Vibha Alangar, Matt Boutell, Dave Fisher,
Valerie Galluzzi, Mark Hays, Amanda Stouder, Aaron Wilkin,
their colleagues, and Carla Archuleta.
""" # DONE: 1. PUT YOUR NAME IN THE ABOVE LINE.
######################################################... | 37.96028 | 79 | 0.503847 |
6116070b07ff2958f2c57703eced7c550995d9ef | 5,755 | py | Python | Algorithm-code/Text-Similarity/siamese_network.py | cclauss/Knowledge-Graph | 07a1794c20729d5e6bf85b90769266fdc27e3c1e | [
"MIT"
] | 1 | 2019-09-17T00:32:49.000Z | 2019-09-17T00:32:49.000Z | Algorithm-code/Text-Similarity/siamese_network.py | jiaolongxue/Knowledge-Graph | 4dcffad1090b902a269f9c85e9004b2014556e94 | [
"MIT"
] | null | null | null | Algorithm-code/Text-Similarity/siamese_network.py | jiaolongxue/Knowledge-Graph | 4dcffad1090b902a269f9c85e9004b2014556e94 | [
"MIT"
] | 1 | 2021-02-23T05:51:06.000Z | 2021-02-23T05:51:06.000Z | # coding=utf-8
import tensorflow as tf
import tensorflow.contrib.slim as slim
import numpy as np
class SiameseLSTMw2v(object):
"""
A LSTM based deep Siamese network for text similarity.
Uses an word embedding layer (looks up in pre-trained w2v), followed by a biLSTM and Energy Loss layer.
"""
def... | 46.04 | 118 | 0.570808 |
2f53377cbb2a385a1fb92d715e06325c0c54c2b4 | 1,405 | py | Python | research/object_detection/misc_scripts/xin_preprocess_test.py | xinli94/models | a98b67629c5099dbc7f07103def02d51302ed104 | [
"Apache-2.0"
] | null | null | null | research/object_detection/misc_scripts/xin_preprocess_test.py | xinli94/models | a98b67629c5099dbc7f07103def02d51302ed104 | [
"Apache-2.0"
] | null | null | null | research/object_detection/misc_scripts/xin_preprocess_test.py | xinli94/models | a98b67629c5099dbc7f07103def02d51302ed104 | [
"Apache-2.0"
] | null | null | null | import re
from PIL import Image
with open('/data5/xin/irv2_atrous/train.txt', 'wa+') as g:
with open('/data5/xin/irv2_atrous/all.txt', 'rb') as f:
for line in f.readlines():
path,width,height,left,top,right,bottom,label = line.rstrip().split(',')
path = path.replace('ryan', 'xin')
g.write(','.j... | 37.972973 | 89 | 0.639146 |
d0616613b45295ab90dad6afad65dd844376b126 | 7,717 | py | Python | test/functional/abandonconflict.py | FAB-Coin/fabcoin | 6515d8f84a6fa37605b4e6543ff98e907ddc8646 | [
"MIT"
] | null | null | null | test/functional/abandonconflict.py | FAB-Coin/fabcoin | 6515d8f84a6fa37605b4e6543ff98e907ddc8646 | [
"MIT"
] | null | null | null | test/functional/abandonconflict.py | FAB-Coin/fabcoin | 6515d8f84a6fa37605b4e6543ff98e907ddc8646 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-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.
"""Test the abandontransaction RPC.
The abandontransaction RPC marks a transaction and all its in-wallet... | 48.534591 | 137 | 0.661397 |
6da62816c96a45045619349a2917fa8d9c669b6c | 173 | py | Python | Twitter/keys.py | adamspanier/SocialComputation | 234677d7a27092c45eb5d6af3082fc7f7c6f2981 | [
"MIT"
] | null | null | null | Twitter/keys.py | adamspanier/SocialComputation | 234677d7a27092c45eb5d6af3082fc7f7c6f2981 | [
"MIT"
] | null | null | null | Twitter/keys.py | adamspanier/SocialComputation | 234677d7a27092c45eb5d6af3082fc7f7c6f2981 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
key = "Get From Twitter Account"
keySecret = "Get From Twitter Account"
token = "Get From Twitter Account"
tokenSecret = "Get From Twitter Account"
| 21.625 | 40 | 0.739884 |
7faaa405418e6a1342a719bcbe6be3bd56d3fb90 | 7,790 | py | Python | neutron_plugin_contrail/plugins/opencontrail/quota/driver.py | intr1nsic/contrail-neutron-plugin | 961b0011ee430d61ac30dadd0b72d93012120c69 | [
"Apache-2.0"
] | null | null | null | neutron_plugin_contrail/plugins/opencontrail/quota/driver.py | intr1nsic/contrail-neutron-plugin | 961b0011ee430d61ac30dadd0b72d93012120c69 | [
"Apache-2.0"
] | null | null | null | neutron_plugin_contrail/plugins/opencontrail/quota/driver.py | intr1nsic/contrail-neutron-plugin | 961b0011ee430d61ac30dadd0b72d93012120c69 | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
import ConfigParser
from pprint import pformat
try:
from neutron.openstack.common import log as logging
except ImportError:
from oslo_log import log as logging
try:
from oslo.config import cfg
except ImportError:
from oslo_config import cfg
from httplib2 i... | 36.232558 | 80 | 0.622593 |
134a11e5eae0950a88c9747636c5407e549b1734 | 2,536 | py | Python | t3f/regularizers.py | robol/t3f | d61037ba9c03c344e9fc31fce46648347b762b39 | [
"MIT"
] | null | null | null | t3f/regularizers.py | robol/t3f | d61037ba9c03c344e9fc31fce46648347b762b39 | [
"MIT"
] | null | null | null | t3f/regularizers.py | robol/t3f | d61037ba9c03c344e9fc31fce46648347b762b39 | [
"MIT"
] | null | null | null | import numbers
import tensorflow as tf
from t3f import ops
def l2_regularizer(scale, scope=None):
"""Returns a function that applies L2 regularization to TensorTrain weights.
Args:
scale: A scalar multiplier `Tensor`. 0.0 disables the regularizer.
scope: An optional scope name.
Returns:
A functi... | 33.368421 | 86 | 0.686909 |
2363eb47d37a27d544d0d1ea8d77b845b12680de | 1,446 | py | Python | bender/model_trainer/tests/test_regression_model.py | otovo/bender | b64f0656658287b932ce44d52e6035682652fe33 | [
"Apache-2.0"
] | 2 | 2021-12-17T15:45:40.000Z | 2021-12-18T14:15:43.000Z | bender/model_trainer/tests/test_regression_model.py | otovo/bender | b64f0656658287b932ce44d52e6035682652fe33 | [
"Apache-2.0"
] | 2 | 2022-03-30T14:31:12.000Z | 2022-03-31T14:25:25.000Z | bender/model_trainer/tests/test_regression_model.py | otovo/bender | b64f0656658287b932ce44d52e6035682652fe33 | [
"Apache-2.0"
] | 1 | 2021-12-19T17:16:38.000Z | 2021-12-19T17:16:38.000Z | import pytest
from bender.evaluator.difference_distribution import AbsolutePercentageError, DifferenceDistribution
from bender.explorer.histogram import HistogramConfig, HistogramMultiple
from bender.explorers import Explorers
from bender.exporter.exporter import Exporter
from bender.importers import DataImporters, Da... | 39.081081 | 111 | 0.710927 |
f0a9a936c1c7fb1500dcfb0eac4e98cf4485a866 | 30,109 | py | Python | snakemake/scheduler.py | HenningTimm/snakemake | 1e8eb2b676b5a35a04a2c5dae66851540bb4d2b9 | [
"MIT"
] | null | null | null | snakemake/scheduler.py | HenningTimm/snakemake | 1e8eb2b676b5a35a04a2c5dae66851540bb4d2b9 | [
"MIT"
] | null | null | null | snakemake/scheduler.py | HenningTimm/snakemake | 1e8eb2b676b5a35a04a2c5dae66851540bb4d2b9 | [
"MIT"
] | null | null | null | __author__ = "Johannes Köster"
__copyright__ = "Copyright 2015-2019, Johannes Köster"
__email__ = "koester@jimmy.harvard.edu"
__license__ = "MIT"
import os, signal, sys
import threading
import operator
import time
import math
from functools import partial
from collections import defaultdict
from itertools import chai... | 34.929234 | 103 | 0.527782 |
b4732248453b621ce5dd1dfee6330d34c214c129 | 2,969 | py | Python | projects/telosb/00std_xon_xoff/00std_xon_xoff.py | renfernand/openwsn-fw | 1d85821f455feae6f0bb4d72bdbd2c3f1a5379de | [
"BSD-3-Clause"
] | null | null | null | projects/telosb/00std_xon_xoff/00std_xon_xoff.py | renfernand/openwsn-fw | 1d85821f455feae6f0bb4d72bdbd2c3f1a5379de | [
"BSD-3-Clause"
] | null | null | null | projects/telosb/00std_xon_xoff/00std_xon_xoff.py | renfernand/openwsn-fw | 1d85821f455feae6f0bb4d72bdbd2c3f1a5379de | [
"BSD-3-Clause"
] | null | null | null | import serial
import threading
import time
#============================ defines =========================================
SERIALPORT = 'COM4'
BURSTSIZE = 200
#============================ classes =========================================
class SerialRxThread(threading.Thread):
XOFF = 0x13
XON = 0x11... | 28.548077 | 95 | 0.462782 |
a38490b48b8e42543ac5f3a28242bd2c97eca9ad | 1,888 | py | Python | eqbtest/functional/rpc_signmessage.py | cryptotechguru/tesseract | 9b64c61483710c94390404c3d920c1059cbfcda7 | [
"MIT"
] | null | null | null | eqbtest/functional/rpc_signmessage.py | cryptotechguru/tesseract | 9b64c61483710c94390404c3d920c1059cbfcda7 | [
"MIT"
] | 11 | 2019-04-23T20:37:03.000Z | 2021-08-11T11:03:13.000Z | eqbtest/functional/rpc_signmessage.py | cryptotechguru/tesseract | 9b64c61483710c94390404c3d920c1059cbfcda7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2016-2017 The Bitcoin Core developers
# Copyright (c) 2018 Equibit Group AG
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test RPC commands for signing and verifying messages."""
from te... | 46.04878 | 119 | 0.735699 |
d3f8e1f4c6792c4cded99d2aaad3dfeb47a57686 | 2,923 | py | Python | nni/compression/pytorch/quantization_speedup/trt_pycuda.py | dutxubo/nni | c16f4e1c89b54b8b80661ef0072433d255ad2d24 | [
"MIT"
] | 9,680 | 2019-05-07T01:42:30.000Z | 2022-03-31T16:48:33.000Z | nni/compression/pytorch/quantization_speedup/trt_pycuda.py | dutxubo/nni | c16f4e1c89b54b8b80661ef0072433d255ad2d24 | [
"MIT"
] | 1,957 | 2019-05-06T21:44:21.000Z | 2022-03-31T09:21:53.000Z | nni/compression/pytorch/quantization_speedup/trt_pycuda.py | dutxubo/nni | c16f4e1c89b54b8b80661ef0072433d255ad2d24 | [
"MIT"
] | 1,571 | 2019-05-07T06:42:55.000Z | 2022-03-31T03:19:24.000Z | # Copyright (c) Microsoft Corporation.
# Licensed under the MIT license.
import pycuda.driver as cuda
import pycuda.autoinit # pylint: disable=unused-import
import tensorrt as trt
EXPLICIT_BATCH = 1
def GiB(val):
return val * 1 << 30
# Simple helper data class that's a little nicer to use than a 2-tuple.... | 33.988372 | 108 | 0.672255 |
41f8e3408d1912c7314dcd94b33194e7b0af8ec5 | 3,799 | py | Python | pandas/tests/indexes/datetimelike.py | HQDragon/pandas | 8713f2d1237a471a4f42f3fb547887bc022a5b94 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/tests/indexes/datetimelike.py | HQDragon/pandas | 8713f2d1237a471a4f42f3fb547887bc022a5b94 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/tests/indexes/datetimelike.py | HQDragon/pandas | 8713f2d1237a471a4f42f3fb547887bc022a5b94 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"MIT-0",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2021-03-24T05:02:16.000Z | 2021-03-24T05:02:16.000Z | """ generic datetimelike tests """
import numpy as np
import pytest
import pandas as pd
import pandas._testing as tm
from pandas.tests.indexes.common import Base
class DatetimeLike(Base):
def test_argsort_matches_array(self):
rng = self.create_index()
rng = rng.insert(1, pd.NaT)
result ... | 30.150794 | 73 | 0.601737 |
12f68c4b8eca8b095a8d4678db7e8fc778475316 | 7,397 | py | Python | examples/eval_benchmarks.py | kwat0308/gtracr | c7a4967f8e127daa732fd6515b61f13a4fb2b900 | [
"BSD-3-Clause"
] | 3 | 2020-08-30T19:47:26.000Z | 2022-03-15T01:52:58.000Z | examples/eval_benchmarks.py | kwat0308/gtracr | c7a4967f8e127daa732fd6515b61f13a4fb2b900 | [
"BSD-3-Clause"
] | 3 | 2020-09-02T00:05:05.000Z | 2021-02-04T22:16:39.000Z | examples/eval_benchmarks.py | kwat0308/gtracr | c7a4967f8e127daa732fd6515b61f13a4fb2b900 | [
"BSD-3-Clause"
] | null | null | null | '''
Evaluates the benchmarks between different versions of the code
'''
import os, sys
import numpy as np
import matplotlib.pyplot as plt
from tqdm import tqdm
import pickle
from gtracr.trajectory import Trajectory
import time
CURRENT_DIR = os.path.dirname(os.path.realpath(__file__))
PARENT_DIR = os.path.dirname(CU... | 34.087558 | 148 | 0.589699 |
d836124637e37dc832bb41f34a8eb6128fd2951e | 10,456 | py | Python | experiments_with_ltcs/ctrnn_model.py | thomaszub/liquid_time_constant_networks | f6dce717278f06e6b9f85763f57c9df83accd62b | [
"Apache-2.0"
] | null | null | null | experiments_with_ltcs/ctrnn_model.py | thomaszub/liquid_time_constant_networks | f6dce717278f06e6b9f85763f57c9df83accd62b | [
"Apache-2.0"
] | null | null | null | experiments_with_ltcs/ctrnn_model.py | thomaszub/liquid_time_constant_networks | f6dce717278f06e6b9f85763f57c9df83accd62b | [
"Apache-2.0"
] | null | null | null | import tensorflow as tf
import numpy as np
import os
class CTRNN(tf.compat.v1.nn.rnn_cell.RNNCell):
def __init__(self, num_units,cell_clip=-1,global_feedback=False,fix_tau=True):
self._num_units = num_units
# Number of ODE solver steps
self._unfolds = 6
# Time of each ODE solver s... | 39.161049 | 127 | 0.609889 |
2046c8b45b6b04093386c7cb4951dd153b43420e | 1,044 | py | Python | app/models/product.py | achooan/boilerplate_flask_sqlalchemy | 9a6a89e359b446651dff5064e4b37b8bc70fdcc1 | [
"MIT"
] | 1 | 2019-01-11T00:39:51.000Z | 2019-01-11T00:39:51.000Z | app/models/product.py | achooan/flask_sqlalchemy_rest_sample_app | 9a6a89e359b446651dff5064e4b37b8bc70fdcc1 | [
"MIT"
] | 1 | 2019-01-21T10:05:37.000Z | 2019-01-21T10:05:37.000Z | app/models/product.py | achooan/boilerplate_flask_sqlalchemy | 9a6a89e359b446651dff5064e4b37b8bc70fdcc1 | [
"MIT"
] | null | null | null | from app.db import db, mw
__all__ = ['Product', 'product_schema', 'products_schema']
# Product Class/Model
class Product(db.Model):
"""Class represents a data model with primary id, unique name, description,
price and quantity.
"""
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db... | 26.1 | 79 | 0.662835 |
d0feab414daa7b33f2952b0dd098007cb6dddcd1 | 300 | py | Python | homeassistant/helpers/typing.py | EmitKiwi/home-assistant | 0999e2ddc476f4bddf710005168b082f03a7cdc0 | [
"Apache-2.0"
] | 4 | 2019-05-14T20:33:43.000Z | 2021-09-25T14:56:08.000Z | homeassistant/helpers/typing.py | EmitKiwi/home-assistant | 0999e2ddc476f4bddf710005168b082f03a7cdc0 | [
"Apache-2.0"
] | 5 | 2022-03-01T06:31:03.000Z | 2022-03-31T07:20:45.000Z | homeassistant/helpers/typing.py | EmitKiwi/home-assistant | 0999e2ddc476f4bddf710005168b082f03a7cdc0 | [
"Apache-2.0"
] | 3 | 2018-08-27T10:08:30.000Z | 2020-07-04T10:07:03.000Z | """Typing Helpers for Home Assistant."""
from typing import Dict, Any, Tuple
import homeassistant.core
# pylint: disable=invalid-name
GPSType = Tuple[float, float]
ConfigType = Dict[str, Any]
HomeAssistantType = homeassistant.core.HomeAssistant
# Custom type for recorder Queries
QueryType = Any
| 21.428571 | 52 | 0.776667 |
dc38c61da55ebaa4cc9d96e08bb4be036eef8446 | 872 | py | Python | LeetCode/LeetCode_Python-master/LeetCode_Python-master/Algorithm-Easy/559_Maximum_Depth_of_N-aray_Tree.py | Sycamore-City-passerby/ML | 605cfc70bdda2c99e5f1c16b25812b59c98a72ad | [
"MIT"
] | null | null | null | LeetCode/LeetCode_Python-master/LeetCode_Python-master/Algorithm-Easy/559_Maximum_Depth_of_N-aray_Tree.py | Sycamore-City-passerby/ML | 605cfc70bdda2c99e5f1c16b25812b59c98a72ad | [
"MIT"
] | null | null | null | LeetCode/LeetCode_Python-master/LeetCode_Python-master/Algorithm-Easy/559_Maximum_Depth_of_N-aray_Tree.py | Sycamore-City-passerby/ML | 605cfc70bdda2c99e5f1c16b25812b59c98a72ad | [
"MIT"
] | null | null | null | """
# Definition for a Node.
class Node(object):
def __init__(self, val, children):
self.val = val
self.children = children
"""
class Solution(object):
def maxDepth(self, root):
"""
:type root: Node
:rtype: int
"""
if not root:
return 0
... | 19.818182 | 102 | 0.550459 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.