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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0fc10223f9d12604662ff90ed790a5eacc831f5d | 1,111 | py | Python | pi_monitor/actions/twilio.py | arlenk/pivpn-monitor | 295d99b5fa57e28d8691096e9b0f54354206072e | [
"MIT"
] | 3 | 2020-04-27T15:10:17.000Z | 2020-09-22T06:21:02.000Z | pi_monitor/actions/twilio.py | arlenk/pi-monitor | 295d99b5fa57e28d8691096e9b0f54354206072e | [
"MIT"
] | null | null | null | pi_monitor/actions/twilio.py | arlenk/pi-monitor | 295d99b5fa57e28d8691096e9b0f54354206072e | [
"MIT"
] | null | null | null | import twilio.rest as tr
from pi_monitor.core import Event
class Twilio():
def __init__(self, config):
config = _process_config(config)
self.account_sid = config['account_sid']
self.auth_token = config['auth_token']
self.from_phone = config['from_phone']
self.to_phone = con... | 22.22 | 88 | 0.585959 |
c1ca36d028da9084cf8d88b39677d6f0d5d03d9d | 91 | py | Python | app/main/__init__.py | jerushaotieno/news_api | af9dc19c9c871fa9a379d6e392f10129234b3840 | [
"MIT"
] | null | null | null | app/main/__init__.py | jerushaotieno/news_api | af9dc19c9c871fa9a379d6e392f10129234b3840 | [
"MIT"
] | null | null | null | app/main/__init__.py | jerushaotieno/news_api | af9dc19c9c871fa9a379d6e392f10129234b3840 | [
"MIT"
] | 1 | 2022-02-28T22:33:33.000Z | 2022-02-28T22:33:33.000Z | from flask import Blueprint
main = Blueprint('main', __name__)
from . import views, errors | 30.333333 | 34 | 0.769231 |
33d103892bb7cd2106a365f4b5a63ef6ca549f5e | 1,017 | py | Python | src/reviews/management/commands/send_review_reminders.py | PhaseDMS/phase | 4f776d0b1b5e7916a3e26aee890b3c2b9454ef0e | [
"MIT"
] | 2 | 2021-09-10T19:40:30.000Z | 2022-01-31T07:15:51.000Z | src/reviews/management/commands/send_review_reminders.py | PhaseDMS/phase | 4f776d0b1b5e7916a3e26aee890b3c2b9454ef0e | [
"MIT"
] | null | null | null | src/reviews/management/commands/send_review_reminders.py | PhaseDMS/phase | 4f776d0b1b5e7916a3e26aee890b3c2b9454ef0e | [
"MIT"
] | 1 | 2021-09-10T19:40:42.000Z | 2021-09-10T19:40:42.000Z | #!/usr/bin/python
from itertools import groupby
from notifications.management.commands.base import EmailCommand
from reviews.models import Review
class Command(EmailCommand):
help = "Send an email reminder to all users with pending reviews"
text_template = "reviews/pending_reviews_reminder_email.txt"
ht... | 32.806452 | 69 | 0.675516 |
ab99805983d9fc913ab96e0d7d87c5fd9e9d91ff | 1,190 | py | Python | migrations/versions/7aa239b7f153_initial_migration.py | lorderonnie/ronniesblog | 11bb3ebf96e49a52c5fbc36f098e262e03334872 | [
"MIT"
] | null | null | null | migrations/versions/7aa239b7f153_initial_migration.py | lorderonnie/ronniesblog | 11bb3ebf96e49a52c5fbc36f098e262e03334872 | [
"MIT"
] | null | null | null | migrations/versions/7aa239b7f153_initial_migration.py | lorderonnie/ronniesblog | 11bb3ebf96e49a52c5fbc36f098e262e03334872 | [
"MIT"
] | null | null | null | """Initial Migration
Revision ID: 7aa239b7f153
Revises: e005ff8d58d1
Create Date: 2019-12-02 16:11:34.911810
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '7aa239b7f153'
down_revision = 'e005ff8d58d1'
branch_labels = None
depends_on = None
def upgrade():
... | 32.162162 | 101 | 0.686555 |
db6868cb02cc003a79d62d40ee90b6232ae7d566 | 337 | py | Python | crazyflie_mrac_waypoint_generator/scripts/jutils/calculus.py | fjctp/crazyflie_mrac_ros | d43df1832860addd0ff7fbad391c7871cb3c6577 | [
"MIT"
] | 5 | 2019-10-09T03:17:39.000Z | 2021-04-24T06:00:12.000Z | crazyflie_mrac_waypoint_generator/scripts/jutils/calculus.py | fjctp/crazyflie_mrac_ros | d43df1832860addd0ff7fbad391c7871cb3c6577 | [
"MIT"
] | null | null | null | crazyflie_mrac_waypoint_generator/scripts/jutils/calculus.py | fjctp/crazyflie_mrac_ros | d43df1832860addd0ff7fbad391c7871cb3c6577 | [
"MIT"
] | 1 | 2019-05-24T22:48:29.000Z | 2019-05-24T22:48:29.000Z | from collections import deque
import geometry_msgs.msg as geo_msgs
class Differentiation:
def __init__(self):
maxlen = 3
self.poseList = deque([None, None, None], maxlen);
def __calc_vel__(self, dt, p0, p1):
return (p1-p0)/dt
def __calc_acc__(self, p0, p1, p2):
return PLACEHOLDER/dt/dt
def calculate(sel... | 19.823529 | 52 | 0.718101 |
5d6b5dc0cc14d7815e7db8100b250ba6d6cf4fb8 | 48,668 | py | Python | transformers/modeling_tf_xlnet.py | c0derm4n/transformers | c8f392094f72de56711a1ae671873142fbc0ea5f | [
"Apache-2.0"
] | null | null | null | transformers/modeling_tf_xlnet.py | c0derm4n/transformers | c8f392094f72de56711a1ae671873142fbc0ea5f | [
"Apache-2.0"
] | null | null | null | transformers/modeling_tf_xlnet.py | c0derm4n/transformers | c8f392094f72de56711a1ae671873142fbc0ea5f | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 Google AI, Google Brain and Carnegie Mellon University Authors and the HuggingFace Inc. team.
# Copyright (c) 2018, NVIDIA CORPORATION. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Lice... | 49.813715 | 193 | 0.635078 |
ec2646a588f096655ade713d93f701bafbcf7350 | 8,153 | py | Python | dotenv/main.py | DrFormat/python-dotenv | e179bfe912692431848944f7e53919c3eff21500 | [
"BSD-3-Clause"
] | null | null | null | dotenv/main.py | DrFormat/python-dotenv | e179bfe912692431848944f7e53919c3eff21500 | [
"BSD-3-Clause"
] | null | null | null | dotenv/main.py | DrFormat/python-dotenv | e179bfe912692431848944f7e53919c3eff21500 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import absolute_import, print_function, unicode_literals
import codecs
import fileinput
import io
import os
import re
import sys
from subprocess import Popen, PIPE, STDOUT
import warnings
from collections import OrderedDict
from .compat import StringIO
__escape_decoder = codec... | 26.907591 | 102 | 0.614498 |
3f5afb643c7051dbe290aafe46a731a156185a2b | 4,460 | py | Python | catboost/python-package/ut/medium/canondata/test.test_export_to_python_with_cat_features_from_pandas_CPU_/model.py | karina-usmanova/catboost | 7eff3b7e2e9e8793ab27ea21b2d39a9238f1ba02 | [
"Apache-2.0"
] | 1 | 2019-07-08T09:14:39.000Z | 2019-07-08T09:14:39.000Z | catboost/python-package/ut/medium/canondata/test.test_export_to_python_with_cat_features_from_pandas_CPU_/model.py | karina-usmanova/catboost | 7eff3b7e2e9e8793ab27ea21b2d39a9238f1ba02 | [
"Apache-2.0"
] | null | null | null | catboost/python-package/ut/medium/canondata/test.test_export_to_python_with_cat_features_from_pandas_CPU_/model.py | karina-usmanova/catboost | 7eff3b7e2e9e8793ab27ea21b2d39a9238f1ba02 | [
"Apache-2.0"
] | null | null | null | ### Model data
class catboost_model(object):
float_features_index = [
0,
]
float_feature_count = 1
cat_feature_count = 1
binary_feature_count = 2
tree_count = 5
float_feature_borders = [
[2]
]
tree_depth = [1, 1, 1, 1, 1]
tree_split_border = [1, 1, 255, 1, 1]
... | 36.260163 | 160 | 0.680045 |
44b157ecb4da8453fbf89286a3364121089cd667 | 585 | py | Python | tests/addons/pytest_blender_basic.py | didierbroska/pytest-blender | 9fd85567cae6595b032363ad4f6f50219e467477 | [
"BSD-3-Clause"
] | null | null | null | tests/addons/pytest_blender_basic.py | didierbroska/pytest-blender | 9fd85567cae6595b032363ad4f6f50219e467477 | [
"BSD-3-Clause"
] | null | null | null | tests/addons/pytest_blender_basic.py | didierbroska/pytest-blender | 9fd85567cae6595b032363ad4f6f50219e467477 | [
"BSD-3-Clause"
] | null | null | null | import bpy
bl_info = {
"name": "Move X Axis",
"category": "Object",
}
class ObjectMoveX(bpy.types.Operator):
"""My Object Moving Script"""
bl_idname = "object.move_x"
bl_label = "Move X by One"
bl_options = {"REGISTER", "UNDO"}
def execute(self, context):
scene = context.scene
... | 16.714286 | 43 | 0.615385 |
b4bc26ce12f3e7d758ff3473535486bef207d8b1 | 567 | py | Python | licensegenerator/licgen/migrations/0002_auto_20210223_1002.py | martbhell/insecure-django | 3fca0a75a61e776b339c7c59212d956cf07fe729 | [
"MIT"
] | null | null | null | licensegenerator/licgen/migrations/0002_auto_20210223_1002.py | martbhell/insecure-django | 3fca0a75a61e776b339c7c59212d956cf07fe729 | [
"MIT"
] | null | null | null | licensegenerator/licgen/migrations/0002_auto_20210223_1002.py | martbhell/insecure-django | 3fca0a75a61e776b339c7c59212d956cf07fe729 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.7 on 2021-02-23 10:02
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('licgen', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='license',
name='licenseid',
... | 23.625 | 63 | 0.583774 |
e5041bd0d80feafc0134d1a5aef4d67543e99084 | 3,406 | py | Python | examples/hsbench.py | shenfe/python-hyperscan | 5c4f4bd9f1ab77ae9f879bf98bad6e62f9288a4a | [
"MIT"
] | 8 | 2018-11-02T08:06:55.000Z | 2020-07-25T16:42:57.000Z | examples/hsbench.py | shenfe/python-hyperscan | 5c4f4bd9f1ab77ae9f879bf98bad6e62f9288a4a | [
"MIT"
] | null | null | null | examples/hsbench.py | shenfe/python-hyperscan | 5c4f4bd9f1ab77ae9f879bf98bad6e62f9288a4a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from __future__ import print_function
import argparse
import io
import sqlite3
import sys
import timeit
import hpsc as hyperscan
flagchars = {
'i': hyperscan.HS_FLAG_CASELESS,
's': hyperscan.HS_FLAG_DOTALL,
'm': hyperscan.HS_FLAG_MULTILINE,
'H': hyperscan.HS_FLAG_SINGLEMATCH,
... | 29.111111 | 78 | 0.620669 |
0e25fb5f4c01f996596d2c0377c24b907b82ee3b | 27,177 | py | Python | pandas/tests/plotting/frame/test_frame_subplots.py | oricou/pandas | 9405e58d9268041f5416711c051cf5429a19bf49 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2 | 2021-05-07T04:58:36.000Z | 2021-05-07T04:58:59.000Z | pandas/tests/plotting/frame/test_frame_subplots.py | oricou/pandas | 9405e58d9268041f5416711c051cf5429a19bf49 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | pandas/tests/plotting/frame/test_frame_subplots.py | oricou/pandas | 9405e58d9268041f5416711c051cf5429a19bf49 | [
"PSF-2.0",
"Apache-2.0",
"BSD-3-Clause-No-Nuclear-License-2014",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2 | 2021-06-16T07:19:12.000Z | 2021-12-16T10:24:44.000Z | """ Test cases for DataFrame.plot """
import string
import warnings
import numpy as np
import pytest
import pandas.util._test_decorators as td
import pandas as pd
from pandas import (
DataFrame,
Series,
date_range,
)
import pandas._testing as tm
from pandas.tests.plotting.common import TestPlotBase
fro... | 39.501453 | 88 | 0.559628 |
443ed369b6e11415c35f9821617d9a14e8cc3134 | 1,963 | py | Python | dizoo/d4rl/config/hopper_expert_cql_default_config.py | puyuan1996/DI-engine | da99c01e06589033b7412829dc2f2c339083f219 | [
"Apache-2.0"
] | 1 | 2022-01-12T02:29:17.000Z | 2022-01-12T02:29:17.000Z | dizoo/d4rl/config/hopper_expert_cql_default_config.py | puyuan1996/DI-engine | da99c01e06589033b7412829dc2f2c339083f219 | [
"Apache-2.0"
] | null | null | null | dizoo/d4rl/config/hopper_expert_cql_default_config.py | puyuan1996/DI-engine | da99c01e06589033b7412829dc2f2c339083f219 | [
"Apache-2.0"
] | null | null | null | from easydict import EasyDict
hopper_expert_cql_default_config = dict(
env=dict(
env_id='hopper-expert-v0',
norm_obs=dict(use_norm=False, ),
norm_reward=dict(use_norm=False, ),
collector_env_num=1,
evaluator_env_num=8,
use_act_scale=True,
n_evaluator_episode=... | 28.867647 | 91 | 0.605706 |
50a77a77b7989156a8e56af1b714a553374eef5a | 759 | py | Python | lib/models/dictionary.py | andreYoo/CTAM-CTACL-VVReID | 766964d245798644f93640aef01211c1438a7ba6 | [
"MIT"
] | 4 | 2021-09-15T13:41:43.000Z | 2021-12-30T12:08:45.000Z | lib/models/dictionary.py | andreYoo/CTAM-CTACL-VVReID | 766964d245798644f93640aef01211c1438a7ba6 | [
"MIT"
] | null | null | null | lib/models/dictionary.py | andreYoo/CTAM-CTACL-VVReID | 766964d245798644f93640aef01211c1438a7ba6 | [
"MIT"
] | 2 | 2021-09-15T13:42:12.000Z | 2021-11-25T17:48:33.000Z | import torch
import numpy as np
class Dictionary():
def __init__(self, num_features, num_classes, alpha=0.01):
super(Dictionary, self).__init__()
self.num_features = num_features
self.num_classes = num_classes
self.alpha = alpha
self.mem = torch.zeros(num_classes, num_featur... | 29.192308 | 76 | 0.623188 |
32054e48c93f331383bf2bfc0992f03e913cf7b5 | 4,285 | py | Python | advent_of_code/2019/04_secure_container/aoc_2019_04.py | thanosa/coding-challenges | a10b0de51da076a4bcc798b4a3d5a08e29c5af01 | [
"MIT"
] | null | null | null | advent_of_code/2019/04_secure_container/aoc_2019_04.py | thanosa/coding-challenges | a10b0de51da076a4bcc798b4a3d5a08e29c5af01 | [
"MIT"
] | null | null | null | advent_of_code/2019/04_secure_container/aoc_2019_04.py | thanosa/coding-challenges | a10b0de51da076a4bcc798b4a3d5a08e29c5af01 | [
"MIT"
] | null | null | null | ''' Advent of code 2019 Day 4: Secure Container'''
import math
INPUT_FILE=__file__.replace('.py', '.dat')
# returns -1 if the digits are fine (not decreasing)
# otherwise returns the index of the right-most digit that is not ok
def find_issue_digit(digits: list, length: int) -> int:
pos = length - 1
... | 31.507353 | 125 | 0.576429 |
6b3090049804fadc11e69793485e34a2757c43fa | 1,359 | py | Python | src/constants.py | evberrypi/clara-pipeline-operator-sizing-tool | ceb25c5e41c436f4ad773334842a13a0b554247e | [
"Apache-2.0"
] | 4 | 2021-08-12T21:07:22.000Z | 2021-08-13T14:00:17.000Z | src/constants.py | evberrypi/clara-pipeline-operator-sizing-tool | ceb25c5e41c436f4ad773334842a13a0b554247e | [
"Apache-2.0"
] | 2 | 2021-08-12T19:08:37.000Z | 2021-08-12T23:00:11.000Z | src/constants.py | evberrypi/clara-pipeline-operator-sizing-tool | ceb25c5e41c436f4ad773334842a13a0b554247e | [
"Apache-2.0"
] | 2 | 2021-08-12T21:07:31.000Z | 2021-08-20T06:35:01.000Z | # Copyright 2021 NVIDIA 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 in writi... | 30.886364 | 74 | 0.798381 |
f30bb4ace5e722b58669046bd174fa79404fb8d2 | 3,619 | py | Python | python/paddle/distributed/fleet/meta_optimizers/meta_optimizer_base.py | dingsiyu/paddle_adamw | 868c0e44d7d43d83fd062bfe4536f13b8bf4517f | [
"Apache-2.0"
] | null | null | null | python/paddle/distributed/fleet/meta_optimizers/meta_optimizer_base.py | dingsiyu/paddle_adamw | 868c0e44d7d43d83fd062bfe4536f13b8bf4517f | [
"Apache-2.0"
] | null | null | null | python/paddle/distributed/fleet/meta_optimizers/meta_optimizer_base.py | dingsiyu/paddle_adamw | 868c0e44d7d43d83fd062bfe4536f13b8bf4517f | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 PaddlePaddle 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 app... | 36.928571 | 80 | 0.654324 |
a39cc16e088a7847e017effde78c74635874889c | 58 | py | Python | api_crud/view.py | jukisz/django-rest | 2dd062ce2e70ec595809168f9ea2e623bf5e4dfc | [
"MIT"
] | null | null | null | api_crud/view.py | jukisz/django-rest | 2dd062ce2e70ec595809168f9ea2e623bf5e4dfc | [
"MIT"
] | null | null | null | api_crud/view.py | jukisz/django-rest | 2dd062ce2e70ec595809168f9ea2e623bf5e4dfc | [
"MIT"
] | null | null | null | Fri Apr 17 2020 13:50:00 GMT-0700 (Pacific Daylight Time)
| 29 | 57 | 0.758621 |
813a6f69b4194d2742e9b1c6a18e61888e1d7b3e | 17,807 | py | Python | kinbot/mesmer.py | zadorlab/KinBot | 6589d5b67c0adeab52d0e07d0e4194d3f0f891d5 | [
"BSD-3-Clause"
] | 30 | 2018-09-28T04:10:10.000Z | 2022-02-27T13:13:52.000Z | kinbot/mesmer.py | zadorlab/KinBot | 6589d5b67c0adeab52d0e07d0e4194d3f0f891d5 | [
"BSD-3-Clause"
] | 19 | 2019-06-28T23:23:09.000Z | 2022-03-16T08:01:42.000Z | kinbot/mesmer.py | zadorlab/KinBot | 6589d5b67c0adeab52d0e07d0e4194d3f0f891d5 | [
"BSD-3-Clause"
] | 10 | 2018-09-27T18:13:13.000Z | 2021-07-07T01:19:45.000Z | from __future__ import division
import sys
import os
import numpy as np
import re
import subprocess
import time
import copy
import xml.etree.cElementTree as ET
import xml.dom.minidom as minidom
import pkg_resources
from kinbot import constants
from kinbot import frequencies
from kinbot import cheminfo
class MESMER:... | 47.739946 | 170 | 0.543326 |
11bf94b222e0b5e8ab216be7d3b663a1c78ca72a | 6,519 | py | Python | visualize.py | endrol/cflow-ad | fb28c15079b6d4b0156192238998f5bce92ea2fd | [
"BSD-3-Clause"
] | null | null | null | visualize.py | endrol/cflow-ad | fb28c15079b6d4b0156192238998f5bce92ea2fd | [
"BSD-3-Clause"
] | null | null | null | visualize.py | endrol/cflow-ad | fb28c15079b6d4b0156192238998f5bce92ea2fd | [
"BSD-3-Clause"
] | null | null | null | import os
import datetime
import numpy as np
from skimage import morphology
from skimage.segmentation import mark_boundaries
import matplotlib.pyplot as plt
import matplotlib
from utils import *
OUT_DIR = './viz/'
norm = matplotlib.colors.Normalize(vmin=0.0, vmax=255.0)
cm = 1/2.54
dpi = 300
def denormalization(x, n... | 44.047297 | 138 | 0.583372 |
94910d6d2535107c4d80d5838f0dea9cf6b7715a | 42,611 | py | Python | evennia/contrib/building_menu.py | Jaykingamez/evennia | cf7cab1fea99ede3efecb70a65c3eb0fba1d3745 | [
"BSD-3-Clause"
] | 1,544 | 2015-01-01T22:16:31.000Z | 2022-03-31T19:17:45.000Z | evennia/contrib/building_menu.py | Jaykingamez/evennia | cf7cab1fea99ede3efecb70a65c3eb0fba1d3745 | [
"BSD-3-Clause"
] | 1,686 | 2015-01-02T18:26:31.000Z | 2022-03-31T20:12:03.000Z | evennia/contrib/building_menu.py | Jaykingamez/evennia | cf7cab1fea99ede3efecb70a65c3eb0fba1d3745 | [
"BSD-3-Clause"
] | 867 | 2015-01-02T21:01:54.000Z | 2022-03-29T00:28:27.000Z | """
Module containing the building menu system.
Evennia contributor: vincent-lg 2018
Building menus are in-game menus, not unlike `EvMenu` though using a
different approach. Building menus have been specifically designed to edit
information as a builder. Creating a building menu in a command allows
builders quick-e... | 33.60489 | 108 | 0.573819 |
b29125281dd58a87b623fd1029b65056f9e0d429 | 8,216 | py | Python | globalserver/client_interface_clone/client_interface_controller.py | MTC-ETH/Federated-Learning-source | cdfd69c39a5d5e2a3fb89e724259c3a80570197e | [
"Apache-2.0"
] | 5 | 2021-03-15T09:22:49.000Z | 2021-12-20T06:53:00.000Z | globalserver/client_interface_clone/client_interface_controller.py | MTC-ETH/Federated-Learning-source | cdfd69c39a5d5e2a3fb89e724259c3a80570197e | [
"Apache-2.0"
] | 13 | 2020-09-25T22:23:37.000Z | 2022-02-10T02:34:50.000Z | globalserver/client_interface_clone/client_interface_controller.py | MTC-ETH/Federated-Learning-source | cdfd69c39a5d5e2a3fb89e724259c3a80570197e | [
"Apache-2.0"
] | 1 | 2021-03-18T08:03:08.000Z | 2021-03-18T08:03:08.000Z | # Copyright 2019-2020 Media Technology Center (MTC) ETH Zürich
#
# This file is part of Federated Learning Project at MTC.
#
# Federated Learning is a free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser Public License as published by
# the Free Software Foundation, either version... | 45.644444 | 159 | 0.651899 |
a3641f779785ba2514a2849ccbf4a1cd15a0d219 | 3,380 | py | Python | openprocurement/contracting/core/validation.py | oleksiyVeretiuk/openprocurement.contracting.core | 4f04ef136ac2e819ddc21ee810838e3c78fc11ce | [
"Apache-2.0"
] | null | null | null | openprocurement/contracting/core/validation.py | oleksiyVeretiuk/openprocurement.contracting.core | 4f04ef136ac2e819ddc21ee810838e3c78fc11ce | [
"Apache-2.0"
] | 28 | 2018-03-28T05:36:08.000Z | 2019-02-28T13:44:15.000Z | openprocurement/contracting/core/validation.py | oleksiyVeretiuk/openprocurement.contracting.core | 4f04ef136ac2e819ddc21ee810838e3c78fc11ce | [
"Apache-2.0"
] | 5 | 2018-03-28T08:17:04.000Z | 2019-02-07T17:22:17.000Z | # -*- coding: utf-8 -*-
from openprocurement.api.utils import update_logging_context, raise_operation_error
from openprocurement.api.validation import validate_json_data, validate_data, OPERATIONS
from openprocurement.contracting.core.models import Change
def validate_patch_contract_data(request):
model = type(re... | 42.25 | 123 | 0.733136 |
d39e269eb2743e79c17b427aa5560d5bf27c15f3 | 9,280 | py | Python | lib/load_graph_mask_v1.py | chuanglaipv/realtime_object_detection_xavier | 694c91db953a2e18440fcdcf5f38df90ba063bfc | [
"MIT"
] | 102 | 2018-04-11T09:32:16.000Z | 2021-11-04T16:52:09.000Z | lib/load_graph_mask_v1.py | chuanglaipv/realtime_object_detection_xavier | 694c91db953a2e18440fcdcf5f38df90ba063bfc | [
"MIT"
] | 24 | 2018-08-08T11:42:27.000Z | 2021-01-15T16:09:34.000Z | lib/load_graph_mask_v1.py | chuanglaipv/realtime_object_detection_xavier | 694c91db953a2e18440fcdcf5f38df90ba063bfc | [
"MIT"
] | 39 | 2018-05-23T08:34:00.000Z | 2020-04-07T12:01:57.000Z | import tensorflow as tf
from tensorflow.core.framework import graph_pb2
import copy
class LoadFrozenGraph():
"""
LOAD FROZEN GRAPH
"""
def __init__(self, cfg):
self.cfg = cfg
return
def load_graph(self):
print('Building Graph')
if not self.cfg['split_model']:
... | 38.1893 | 191 | 0.564871 |
4db81d8e35bec53a6e68a071825a87736ba1007f | 6,964 | py | Python | datasette/publish/heroku.py | cldellow/datasette | 07e208cc6d9e901b87552c1be2854c220b3f9b6d | [
"Apache-2.0"
] | 1 | 2020-06-11T05:35:15.000Z | 2020-06-11T05:35:15.000Z | datasette/publish/heroku.py | cldellow/datasette | 07e208cc6d9e901b87552c1be2854c220b3f9b6d | [
"Apache-2.0"
] | null | null | null | datasette/publish/heroku.py | cldellow/datasette | 07e208cc6d9e901b87552c1be2854c220b3f9b6d | [
"Apache-2.0"
] | 1 | 2020-06-11T05:35:16.000Z | 2020-06-11T05:35:16.000Z | from contextlib import contextmanager
from datasette import hookimpl
import click
import json
import os
import shlex
from subprocess import call, check_output
import tempfile
from .common import (
add_common_publish_arguments_and_options,
fail_if_publish_binary_not_installed,
)
from datasette.utils import link... | 30.678414 | 145 | 0.539202 |
05d90cba45e7bfd6b77471d32e00b50ed17cd078 | 1,107 | py | Python | tests/acceptance/test_victorops.py | Mattlk13/sentry | 0d94c56cfb7d8ffb6ce946fd090bfa7bde362eb2 | [
"Apache-2.0"
] | null | null | null | tests/acceptance/test_victorops.py | Mattlk13/sentry | 0d94c56cfb7d8ffb6ce946fd090bfa7bde362eb2 | [
"Apache-2.0"
] | null | null | null | tests/acceptance/test_victorops.py | Mattlk13/sentry | 0d94c56cfb7d8ffb6ce946fd090bfa7bde362eb2 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from sentry.testutils import AcceptanceTestCase
class VictorOpsTest(AcceptanceTestCase):
def setUp(self):
super(VictorOpsTest, self).setUp()
self.user = self.create_user('foo@example.com')
self.org = self.create_organization(
name='Rowdy ... | 29.131579 | 64 | 0.579042 |
5d190f6bb3bae04120aaea1ba1a2c27272834b96 | 342 | py | Python | app/libs/antdpagebuilder.py | ModifiedClass/flaskapipermission | f42cdd1c0dd33219aec1572bb063b6c418a5a67d | [
"BSD-3-Clause"
] | null | null | null | app/libs/antdpagebuilder.py | ModifiedClass/flaskapipermission | f42cdd1c0dd33219aec1572bb063b6c418a5a67d | [
"BSD-3-Clause"
] | null | null | null | app/libs/antdpagebuilder.py | ModifiedClass/flaskapipermission | f42cdd1c0dd33219aec1572bb063b6c418a5a67d | [
"BSD-3-Clause"
] | null | null | null | class RootPage:
success=False
message=''
data={}
class RespList(RootPage):
dataSource=[]
field={}
layout={}
tableColumn=[]
column={}
tableToolBar=[]
batchToolBar=[]
meta={}
page={}
class RespPage(RootPage):
page={}
layout={}
tabs=[]
tab={}
action... | 12.666667 | 25 | 0.532164 |
527549db8866ead43f3cc5157cfab078c57fe0f3 | 2,013 | py | Python | cross3d/migrate/__init__.py | vedantirb/cross3d | e27c2dc80bf607ef7ccf3970b713bfea8211228b | [
"MIT"
] | 129 | 2016-07-26T16:00:56.000Z | 2021-08-07T03:44:41.000Z | cross3d/migrate/__init__.py | vedantirb/cross3d | e27c2dc80bf607ef7ccf3970b713bfea8211228b | [
"MIT"
] | 3 | 2016-08-26T01:37:03.000Z | 2019-08-13T01:46:01.000Z | cross3d/migrate/__init__.py | vedantirb/cross3d | e27c2dc80bf607ef7ccf3970b713bfea8211228b | [
"MIT"
] | 33 | 2016-07-30T00:26:00.000Z | 2022-03-09T07:10:54.000Z | # cross3d.migrate is being used to centeralize any modules and code that will
# be removed from cross3d, but will take more time to refactor ourt of cross3d.
# All of the python modules in this folder are likely to be removed once the
# code that is dependent on it is refactored
# TODO: Find and remove these blurde... | 31.952381 | 89 | 0.753602 |
3d0caabdaa710840bf165f27b57e0cbd9f049f07 | 2,938 | py | Python | mgn/models/encoder.py | DhruvaBansal00/MultimodalGNN-VQA | 658da6f7f18883fb1302cd13c0b5603de836e199 | [
"MIT"
] | 13 | 2020-11-20T06:32:41.000Z | 2021-12-11T14:01:57.000Z | mgn/models/encoder.py | DhruvaBansal00/MultimodalGNN-VQA | 658da6f7f18883fb1302cd13c0b5603de836e199 | [
"MIT"
] | 2 | 2021-01-06T02:04:18.000Z | 2021-01-09T08:16:38.000Z | mgn/models/encoder.py | DhruvaBansal00/MultimodalGNN-VQA | 658da6f7f18883fb1302cd13c0b5603de836e199 | [
"MIT"
] | 2 | 2021-04-11T01:50:06.000Z | 2021-12-08T14:53:39.000Z | import torch
import torch.nn as nn
from .base_rnn import BaseRNN
class Encoder(BaseRNN):
"""Encoder RNN module"""
def __init__(self, vocab_size, max_len, word_vec_dim, hidden_size, n_layers,
input_dropout_p=0, dropout_p=0, bidirectional=False, rnn_cell='lstm',
variable_l... | 45.2 | 119 | 0.647039 |
182e1bf04fb6e1a6d1cff443ee635aff5793eb83 | 1,582 | py | Python | assignment4/gan/utils.py | yutong-xie/CS498-DL-Assignment | a0c93422c31a19ece7abbd2a7bb19f7feb8ea5ef | [
"MIT"
] | null | null | null | assignment4/gan/utils.py | yutong-xie/CS498-DL-Assignment | a0c93422c31a19ece7abbd2a7bb19f7feb8ea5ef | [
"MIT"
] | null | null | null | assignment4/gan/utils.py | yutong-xie/CS498-DL-Assignment | a0c93422c31a19ece7abbd2a7bb19f7feb8ea5ef | [
"MIT"
] | null | null | null | import torch
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
def show_images(images, color=False):
if color:
sqrtimg = int(np.ceil(np.sqrt(images.shape[2]*images.shape[3])))
else:
images = np.reshape(images, [images.shape[0], -1]) # images reshape to... | 28.25 | 95 | 0.630215 |
b75578afa0e76a7b2d3e84abfdc73d9dd411f44d | 543 | py | Python | savingUtilities/changingMovesToBoards.py | Connor205/Tetrimax | 25c5f62dcf986a35773d456505a44cd8cfbd8593 | [
"MIT"
] | null | null | null | savingUtilities/changingMovesToBoards.py | Connor205/Tetrimax | 25c5f62dcf986a35773d456505a44cd8cfbd8593 | [
"MIT"
] | null | null | null | savingUtilities/changingMovesToBoards.py | Connor205/Tetrimax | 25c5f62dcf986a35773d456505a44cd8cfbd8593 | [
"MIT"
] | null | null | null | import pickle
import tqdm
from tetris import Board
SAVED_MOVES_NAME = "savedMoves.dat"
SAVED_BOARDS_NAME = "savedBoards.dat"
with open(SAVED_MOVES_NAME, "rb") as savedMovesFile:
d = pickle.load(savedMovesFile)
boardDict = {}
with open(SAVED_BOARDS_NAME, "rb") as savedBoardsFile:
for k, v in tqdm(d.items()):
... | 27.15 | 67 | 0.655617 |
756b4da692dba251828d20aa2bf96ffa48fcf718 | 3,415 | py | Python | applied_data_science/DiskDictionary.py | rlowrance/python_lib | 222fb89308201ffe5fb77f60be1cce79aad7d055 | [
"Apache-2.0"
] | null | null | null | applied_data_science/DiskDictionary.py | rlowrance/python_lib | 222fb89308201ffe5fb77f60be1cce79aad7d055 | [
"Apache-2.0"
] | null | null | null | applied_data_science/DiskDictionary.py | rlowrance/python_lib | 222fb89308201ffe5fb77f60be1cce79aad7d055 | [
"Apache-2.0"
] | null | null | null | '''
Copyright 2017 Roy E. Lowrance
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
d... | 29.188034 | 72 | 0.587408 |
9d5c42a280033fbe5ecfac81c748be2737794f49 | 387 | py | Python | quero/asgi.py | felipewove/quero-listar | 36ba93eb45528a83d8cf72f588e4d0829da9fb60 | [
"CC0-1.0"
] | null | null | null | quero/asgi.py | felipewove/quero-listar | 36ba93eb45528a83d8cf72f588e4d0829da9fb60 | [
"CC0-1.0"
] | null | null | null | quero/asgi.py | felipewove/quero-listar | 36ba93eb45528a83d8cf72f588e4d0829da9fb60 | [
"CC0-1.0"
] | null | null | null | """
ASGI config for quero project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTING... | 22.764706 | 78 | 0.782946 |
dece3975665b41c7409e6952b239eda32167bb5d | 2,795 | py | Python | backend/core/migrations/0012_auto_20200123_1644.py | velidan/car-bucks | 774f508ce0ee87c68d47f1261889a0041ee15ddd | [
"Apache-2.0"
] | null | null | null | backend/core/migrations/0012_auto_20200123_1644.py | velidan/car-bucks | 774f508ce0ee87c68d47f1261889a0041ee15ddd | [
"Apache-2.0"
] | 6 | 2021-03-18T22:57:38.000Z | 2021-09-22T18:27:37.000Z | backend/core/migrations/0012_auto_20200123_1644.py | velidan/car-bucks | 774f508ce0ee87c68d47f1261889a0041ee15ddd | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.0.2 on 2020-01-23 16:44
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('core', '0011_auto_20200123_1635'),
]
operations = [
migrations.AlterField(
model_name='car',
... | 43 | 189 | 0.621109 |
650bbb71bae3e3bcd6077d9da87e4b79c3617e60 | 438 | py | Python | chip/error.py | fifth-postulate/nand-optimizer | 936d278411a073b8a7b860a47c9032e310736ba2 | [
"MIT"
] | null | null | null | chip/error.py | fifth-postulate/nand-optimizer | 936d278411a073b8a7b860a47c9032e310736ba2 | [
"MIT"
] | null | null | null | chip/error.py | fifth-postulate/nand-optimizer | 936d278411a073b8a7b860a47c9032e310736ba2 | [
"MIT"
] | null | null | null | class ChipError(Exception):
pass
class NonExistingChip(ChipError):
pass
class CouldNotParseChip(ChipError):
pass
class NotAnInput(ChipError):
def __init__(self, input_name, chip_name):
super().__init__(f'"{input_name}" is not an input in "{chip_name}"')
class NotAnOutput(ChipError):
def ... | 27.375 | 78 | 0.705479 |
a04ad9d70f9bc692103f0d4226129b88fb0b6073 | 410 | py | Python | Catkin_PKG_Car/build/controller/catkin_generated/pkg.develspace.context.pc.py | jessecha/OPCAS | 2b51543b4ad1ee37dba2e45a0c7d0b872309d418 | [
"MIT"
] | 1 | 2021-02-28T05:58:50.000Z | 2021-02-28T05:58:50.000Z | Catkin_PKG_Car/build/controller/catkin_generated/pkg.develspace.context.pc.py | jessecha/OPCAS | 2b51543b4ad1ee37dba2e45a0c7d0b872309d418 | [
"MIT"
] | null | null | null | Catkin_PKG_Car/build/controller/catkin_generated/pkg.develspace.context.pc.py | jessecha/OPCAS | 2b51543b4ad1ee37dba2e45a0c7d0b872309d418 | [
"MIT"
] | null | null | null | # generated from catkin/cmake/template/pkg.context.pc.in
CATKIN_PACKAGE_PREFIX = ""
PROJECT_PKG_CONFIG_INCLUDE_DIRS = "".split(';') if "" != "" else []
PROJECT_CATKIN_DEPENDS = "roscpp;diagnostic_updater;sensor_msgs".replace(';', ' ')
PKG_CONFIG_LIBRARIES_WITH_PREFIX = "".split(';') if "" != "" else []
PROJECT_NAME = "... | 45.555556 | 82 | 0.726829 |
da4499687632545bfe46c9d458da7214302ec1db | 18,913 | py | Python | nova/tests/unit/virt/libvirt/test_fakelibvirt.py | bbc/nova | 655cd30c9fd1753323f725f45581a56f1d17c075 | [
"Apache-2.0"
] | 1 | 2021-06-10T17:08:15.000Z | 2021-06-10T17:08:15.000Z | nova/tests/unit/virt/libvirt/test_fakelibvirt.py | bbc/nova | 655cd30c9fd1753323f725f45581a56f1d17c075 | [
"Apache-2.0"
] | null | null | null | nova/tests/unit/virt/libvirt/test_fakelibvirt.py | bbc/nova | 655cd30c9fd1753323f725f45581a56f1d17c075 | [
"Apache-2.0"
] | null | null | null | # Copyright 2010 OpenStack Foundation
#
# 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... | 39.402083 | 78 | 0.601914 |
fc07d8de36ef5bafe531316c50e74d178c524eb6 | 189 | py | Python | django_test/users/models.py | MachineLearningIsEasy/python_lesson_23 | d64599d668453ae4928d1609e22a83d0e07d252a | [
"MIT"
] | null | null | null | django_test/users/models.py | MachineLearningIsEasy/python_lesson_23 | d64599d668453ae4928d1609e22a83d0e07d252a | [
"MIT"
] | null | null | null | django_test/users/models.py | MachineLearningIsEasy/python_lesson_23 | d64599d668453ae4928d1609e22a83d0e07d252a | [
"MIT"
] | null | null | null | from django.db import models
from django.contrib.auth.models import AbstractUser
# Create your models here.
class ArticlesUser(AbstractUser):
email = models.EmailField(unique = True)
| 23.625 | 51 | 0.78836 |
41895345617611710a388adac6480bb39df101dd | 2,152 | py | Python | tests/test_bbcode.py | vishnevskiy/bbcodepy | f88fa0ec9afc664cffa4b64f8273f0bea48e1de7 | [
"MIT"
] | 4 | 2016-04-21T14:09:51.000Z | 2017-03-03T07:40:59.000Z | tests/test_bbcode.py | fataqui/bbcodepy | f88fa0ec9afc664cffa4b64f8273f0bea48e1de7 | [
"MIT"
] | null | null | null | tests/test_bbcode.py | fataqui/bbcodepy | f88fa0ec9afc664cffa4b64f8273f0bea48e1de7 | [
"MIT"
] | 2 | 2015-10-03T19:47:59.000Z | 2022-01-05T16:00:05.000Z | import inspect
import os
import unittest
import bbcodepy
class TestBBCodeParser(unittest.TestCase):
def _to_html(self, bbcode, prettify=True):
return bbcodepy.Parser().to_html(bbcode, prettify)
def _read_file(self, name):
with open(os.path.join(os.path.dirname(inspect.getfile(self.__class__)),... | 34.15873 | 161 | 0.597119 |
7d82dda726080fb646070d95b2fdce6d8864391b | 3,477 | py | Python | app_utils.py | TianKai92/Colorizer | 05cfac1b67b78ac7d171e28c455cb5d66fde306e | [
"MIT"
] | 1 | 2021-09-07T21:42:02.000Z | 2021-09-07T21:42:02.000Z | app_utils.py | TianKai92/Colorizer | 05cfac1b67b78ac7d171e28c455cb5d66fde306e | [
"MIT"
] | null | null | null | app_utils.py | TianKai92/Colorizer | 05cfac1b67b78ac7d171e28c455cb5d66fde306e | [
"MIT"
] | null | null | null | import os
import requests
import random
import _thread as thread
from uuid import uuid4
import numpy as np
import skimage
from skimage.filters import gaussian
from PIL import Image
def compress_image(image, path_original):
size = 1920, 1080
width = 1920
height = 1080
name = os.path.basename(path_orig... | 27.816 | 81 | 0.635605 |
ce2691aff26c1e169090bb5a12df7e0fa3d1c6b4 | 14,914 | py | Python | django/contrib/staticfiles/management/commands/collectstatic.py | marload/django | 0ce8c15033c95931e5abd36cf071b76a0b19771a | [
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] | 2 | 2016-07-16T23:12:49.000Z | 2017-11-14T21:43:10.000Z | django/contrib/staticfiles/management/commands/collectstatic.py | marload/django | 0ce8c15033c95931e5abd36cf071b76a0b19771a | [
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] | 3 | 2016-05-15T22:05:14.000Z | 2019-11-02T15:58:14.000Z | django/contrib/staticfiles/management/commands/collectstatic.py | marload/django | 0ce8c15033c95931e5abd36cf071b76a0b19771a | [
"CNRI-Python-GPL-Compatible",
"BSD-3-Clause"
] | 2 | 2016-01-19T18:29:21.000Z | 2021-12-23T18:17:39.000Z | import os
from django.apps import apps
from django.contrib.staticfiles.finders import get_finders
from django.contrib.staticfiles.storage import staticfiles_storage
from django.core.files.storage import FileSystemStorage
from django.core.management.base import BaseCommand, CommandError
from django.core.management.colo... | 42.611429 | 107 | 0.557262 |
28686fda5889b2c12d2369305feab5492e3b15e7 | 634 | py | Python | backend/manage.py | crowdbotics-apps/stroomop-28719 | 9c3be813a8b8d25e69219e0eca30aad4d0c8dd69 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/manage.py | crowdbotics-apps/stroomop-28719 | 9c3be813a8b8d25e69219e0eca30aad4d0c8dd69 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | backend/manage.py | crowdbotics-apps/stroomop-28719 | 9c3be813a8b8d25e69219e0eca30aad4d0c8dd69 | [
"FTL",
"AML",
"RSA-MD"
] | null | null | null | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'stroomop_28719.settings')
try:
from django.core.management import execute_from_command_line
except ImportError as exc:
raise... | 28.818182 | 78 | 0.68612 |
1881c0791f26e5cf262df207845f9d51b6bbd43d | 48,746 | py | Python | tcex/playbooks/playbooks.py | brikardtc/tcex | 78680f055f4259e31f0b4989a5695604108d9fdd | [
"Apache-2.0"
] | null | null | null | tcex/playbooks/playbooks.py | brikardtc/tcex | 78680f055f4259e31f0b4989a5695604108d9fdd | [
"Apache-2.0"
] | null | null | null | tcex/playbooks/playbooks.py | brikardtc/tcex | 78680f055f4259e31f0b4989a5695604108d9fdd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""TcEx Framework Playbook module"""
import base64
import json
import re
from collections import OrderedDict
class Playbooks(object):
"""Playbook methods for accessing key value store."""
def __init__(self, tcex):
"""Initialize the Class properties.
Args:
... | 37.905132 | 100 | 0.543019 |
7ac4b7a818415ec16cde6bb8ffa11207628a5985 | 2,272 | py | Python | tests/test.py | LaudateCorpus1/MAX-Review-Text-Generator | 5afc74bd80d687497cae9ac10b11d8e581a114b0 | [
"Apache-2.0"
] | 22 | 2018-04-28T13:50:52.000Z | 2021-07-28T02:32:52.000Z | tests/test.py | LaudateCorpus1/MAX-Review-Text-Generator | 5afc74bd80d687497cae9ac10b11d8e581a114b0 | [
"Apache-2.0"
] | 12 | 2018-07-27T23:04:14.000Z | 2022-02-09T23:58:05.000Z | tests/test.py | LaudateCorpus1/MAX-Review-Text-Generator | 5afc74bd80d687497cae9ac10b11d8e581a114b0 | [
"Apache-2.0"
] | 18 | 2018-04-06T09:05:23.000Z | 2021-12-02T11:06:09.000Z | #
# Copyright 2018-2019 IBM Corp. 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 applicable law... | 31.555556 | 117 | 0.703345 |
3ee93b6b44a851217faae2d73ad6296ee55ad5ab | 751 | py | Python | scripts/split_stereo_pgm/split_images.py | bartn8/stereo-vision | 1180045fe560478e5c441e75202cc899fe90ec3d | [
"BSD-3-Clause"
] | 52 | 2016-04-02T18:18:48.000Z | 2022-02-14T11:47:58.000Z | scripts/split_stereo_pgm/split_images.py | bartn8/stereo-vision | 1180045fe560478e5c441e75202cc899fe90ec3d | [
"BSD-3-Clause"
] | 3 | 2016-08-01T14:36:44.000Z | 2021-02-14T08:15:50.000Z | scripts/split_stereo_pgm/split_images.py | bartn8/stereo-vision | 1180045fe560478e5c441e75202cc899fe90ec3d | [
"BSD-3-Clause"
] | 26 | 2016-08-25T11:28:05.000Z | 2022-02-18T12:17:47.000Z | #!/usr/bin/python
import os, sys, re
import subprocess
if len(sys.argv) != 3:
print("Usage:\n\t\t" + sys.argv[0] + " src_dir/ dst_dir/\n")
sys.exit(1)
# create output dir
if not os.path.exists(sys.argv[2]):
os.makedirs(sys.argv[2])
# get file list of input dir
imglst = os.listdir(sys.argv[1])
# filter o... | 27.814815 | 101 | 0.627164 |
317689b01b2383f4ea00c8e8672d28fecef4c688 | 3,972 | py | Python | api.py | MooseV2/image-forensic-analysis | 5453d23b636fbc78f60be43d078633beffbfb6b7 | [
"MIT"
] | null | null | null | api.py | MooseV2/image-forensic-analysis | 5453d23b636fbc78f60be43d078633beffbfb6b7 | [
"MIT"
] | null | null | null | api.py | MooseV2/image-forensic-analysis | 5453d23b636fbc78f60be43d078633beffbfb6b7 | [
"MIT"
] | null | null | null | import requests
import pyrebase
import cloudinary
import cloudinary.uploader as uploader
import sendgrid
from sendgrid.helpers.mail import *
import PIL, PIL.Image, PIL.ExifTags
class ImageClassifier:
"""
ImageClassifier
Uses the Clarifai "General" image classifier to classify images
"""
def __init_... | 30.553846 | 138 | 0.659114 |
d2c2e856a6b66828c9c919ee1e937270fee2ed7c | 4,842 | py | Python | scripts/eurostat_nuts.py | njanakiev/osm-predict-economic-measurements | 4756acb50f13cfece2d67d3f90d70050755aac18 | [
"MIT"
] | 26 | 2018-06-23T17:18:58.000Z | 2021-03-27T05:29:13.000Z | scripts/eurostat_nuts.py | njanakiev/osm-predict-economic-measurements | 4756acb50f13cfece2d67d3f90d70050755aac18 | [
"MIT"
] | null | null | null | scripts/eurostat_nuts.py | njanakiev/osm-predict-economic-measurements | 4756acb50f13cfece2d67d3f90d70050755aac18 | [
"MIT"
] | 8 | 2018-05-30T08:15:53.000Z | 2020-08-18T23:25:59.000Z | import io
import requests
import argparse
import numpy as np
import pandas as pd
import shapely.geometry
import geopandas as gpd
import matplotlib.pyplot as plt
from zipfile import ZipFile
from shapely.geometry.polygon import Polygon
from shapely.geometry.multipolygon import MultiPolygon
EUROSTAT_BASE_URL = "https://... | 34.098592 | 98 | 0.626601 |
3ea9a56baf1bca0aa5f57bd1d96cc2a121dce542 | 7,111 | py | Python | requirements/docutils-0.18/test/test_writers/test_odt.py | QuentinTournier40/AnimationFreeCAD | 8eaff8356ec68b948a721b83a6888b652278db8a | [
"Apache-2.0"
] | null | null | null | requirements/docutils-0.18/test/test_writers/test_odt.py | QuentinTournier40/AnimationFreeCAD | 8eaff8356ec68b948a721b83a6888b652278db8a | [
"Apache-2.0"
] | null | null | null | requirements/docutils-0.18/test/test_writers/test_odt.py | QuentinTournier40/AnimationFreeCAD | 8eaff8356ec68b948a721b83a6888b652278db8a | [
"Apache-2.0"
] | 1 | 2022-02-03T08:03:30.000Z | 2022-02-03T08:03:30.000Z | #!/usr/bin/env python
# $Id: test_odt.py 8481 2020-01-31 08:17:24Z milde $
# Author: Dave Kuhlman <dkuhlman@rexx.com>
# Copyright: This module has been placed in the public domain.
"""
Tests for docutils odtwriter.
Instructions for adding a new test:
1. Add a new method to class DocutilsOdtTestCase (below) named
... | 34.352657 | 84 | 0.621853 |
498dd8666c6ef6ae153cc19b9d72e5937daf23cf | 804 | py | Python | built-in/PyTorch/Official/cv/image_object_detection/YoloV3_ID1790_for_PyTorch/configs/dcn/mask_rcnn_r101_fpn_dconv_c3-c5_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/dcn/mask_rcnn_r101_fpn_dconv_c3-c5_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/dcn/mask_rcnn_r101_fpn_dconv_c3-c5_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... | 40.2 | 74 | 0.743781 |
0ef03f5408363437dd628cc6dfe8dcbb822053c4 | 7,898 | py | Python | homeassistant/components/wink.py | loraxx753/skynet | 86a1b0a6c6a3f81bc92d4f61de6a9a6b9f964543 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/wink.py | loraxx753/skynet | 86a1b0a6c6a3f81bc92d4f61de6a9a6b9f964543 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/wink.py | loraxx753/skynet | 86a1b0a6c6a3f81bc92d4f61de6a9a6b9f964543 | [
"Apache-2.0"
] | null | null | null | """
Support for Wink hubs.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/wink/
"""
import logging
import voluptuous as vol
from homeassistant.helpers import discovery
from homeassistant.const import (
CONF_ACCESS_TOKEN, ATTR_BATTERY_LEVEL, CONF_E... | 35.258929 | 79 | 0.65257 |
4da177ba70ad84dfe80a16239e4a6769cb75fafc | 6,388 | py | Python | nncf/torch/dynamic_graph/graph_tracer.py | dkurt/nncf | 1329d9b13cab84e45064a064e59b8f2c7e52d140 | [
"Apache-2.0"
] | null | null | null | nncf/torch/dynamic_graph/graph_tracer.py | dkurt/nncf | 1329d9b13cab84e45064a064e59b8f2c7e52d140 | [
"Apache-2.0"
] | null | null | null | nncf/torch/dynamic_graph/graph_tracer.py | dkurt/nncf | 1329d9b13cab84e45064a064e59b8f2c7e52d140 | [
"Apache-2.0"
] | null | null | null | """
Copyright (c) 2019-2022 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 in w... | 40.687898 | 106 | 0.661083 |
6ced59f632b5bf40bd66aaeacf491e32620e51fd | 14,342 | py | Python | src/overlapNt2aa.py | ngannguyen/immunoseq | dfaac691e7b8ab93337f6d1619b6d67533ff9394 | [
"MIT"
] | 2 | 2020-03-15T12:18:48.000Z | 2021-12-13T03:31:23.000Z | src/overlapNt2aa.py | ngannguyen/immunoseq | dfaac691e7b8ab93337f6d1619b6d67533ff9394 | [
"MIT"
] | null | null | null | src/overlapNt2aa.py | ngannguyen/immunoseq | dfaac691e7b8ab93337f6d1619b6d67533ff9394 | [
"MIT"
] | null | null | null | #!/usr/bin/env python2.6
'''
05/09/2012 nknguyen soe ucsc edu
Comparing number of uniq nucleotide sequences each
Input: input directory of fasta files
Output:
'''
import os, sys, re, copy, gzip
import matplotlib.pyplot as pyplot
import immunoseq.lib.immunoseqLib as iseqlib
from jobTree.scriptTree.target import Tar... | 35.765586 | 283 | 0.576907 |
d2e667dee4f90cd8a2fade7129d820d54341eeec | 5,619 | py | Python | floppyforms/tests/forms.py | bigmlcom/django-floppyforms | 29ee55e4226817b711ecbfbc00101adef0fcf872 | [
"BSD-3-Clause"
] | null | null | null | floppyforms/tests/forms.py | bigmlcom/django-floppyforms | 29ee55e4226817b711ecbfbc00101adef0fcf872 | [
"BSD-3-Clause"
] | null | null | null | floppyforms/tests/forms.py | bigmlcom/django-floppyforms | 29ee55e4226817b711ecbfbc00101adef0fcf872 | [
"BSD-3-Clause"
] | 1 | 2022-01-12T07:24:17.000Z | 2022-01-12T07:24:17.000Z | from decimal import Decimal
import django
from django.core.exceptions import ValidationError
from django.test import TestCase
from django.utils import six
from django.utils import translation
from django.utils.translation import ugettext_lazy as _
from django.utils.unittest import expectedFailure, skipIf
import floppy... | 39.020833 | 88 | 0.656167 |
d82fb0ed3e42a680ff75e28f98aa0c96eb564a84 | 12,121 | py | Python | src/weatherlink_live_local/conditions.py | yannj-fr/weatherlink-live-local-python | 7578e18b5130c3749d38b676963d43cc37e10b62 | [
"MIT"
] | null | null | null | src/weatherlink_live_local/conditions.py | yannj-fr/weatherlink-live-local-python | 7578e18b5130c3749d38b676963d43cc37e10b62 | [
"MIT"
] | 1 | 2021-02-04T09:26:10.000Z | 2021-02-04T09:26:10.000Z | src/weatherlink_live_local/conditions.py | yannj-fr/weatherlink-live-local-python | 7578e18b5130c3749d38b676963d43cc37e10b62 | [
"MIT"
] | 1 | 2021-02-03T19:03:50.000Z | 2021-02-03T19:03:50.000Z | """Datatypes to gather device-specific sensor data / conditions."""
from dataclasses import asdict, dataclass
from datetime import datetime
from enum import IntEnum
from typing import Any, Dict, List, Optional
from .units import convert_pressure, convert_rain, convert_temperature, convert_wind_speed
# fmt: off
# pyl... | 46.087452 | 132 | 0.699282 |
0d6913d0957bd576115cfa9a6408ba120b062423 | 4,858 | py | Python | kyper/nbconvert/filters/ansi.py | wusung/ipython-notebook-tabs | ee7b3922c7d01cf6182bce63ef69e8a20f7229f9 | [
"Apache-2.0"
] | 1 | 2017-12-30T20:43:28.000Z | 2017-12-30T20:43:28.000Z | kyper/nbconvert/filters/ansi.py | wusung/ipython-notebook-tabs | ee7b3922c7d01cf6182bce63ef69e8a20f7229f9 | [
"Apache-2.0"
] | 7 | 2021-02-08T20:22:15.000Z | 2022-03-11T23:19:41.000Z | kyper/nbconvert/filters/ansi.py | wusung/ipython-notebook-tabs | ee7b3922c7d01cf6182bce63ef69e8a20f7229f9 | [
"Apache-2.0"
] | null | null | null | """Filters for processing ANSI colors within Jinja templates.
"""
#-----------------------------------------------------------------------------
# Copyright (c) 2013, the IPython Development Team.
#
# Distributed under the terms of the Modified BSD License.
#
# The full license is in the file COPYING.txt, distributed w... | 29.08982 | 86 | 0.514409 |
864915557b23924aee51c5ccbc8c59c3c48ceaa8 | 11,286 | py | Python | src/sentry/db/models/manager.py | learninto/sentry | 4f9f564841498b3af49c1677d6b61f3e47b01923 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/db/models/manager.py | learninto/sentry | 4f9f564841498b3af49c1677d6b61f3e47b01923 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/db/models/manager.py | learninto/sentry | 4f9f564841498b3af49c1677d6b61f3e47b01923 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, print_function
import logging
import six
import threading
import weakref
from django.conf import settings
from django.db import router
from django.db.models import Model
from django.db.models.manager import Manager, QuerySet
from django.db.models.signals import post_save, post_... | 34.303951 | 99 | 0.614478 |
8f568dbcd56c9bd0ffabdb3dacf09e690b74bf38 | 783 | py | Python | pillow_jpls/jpls_image_decoder.py | planetmarshall/pillow-jpls | b93f53cd080f261f1b33021140ae523fcf45678f | [
"BSD-3-Clause"
] | 6 | 2021-03-18T07:58:53.000Z | 2022-01-26T14:50:23.000Z | pillow_jpls/jpls_image_decoder.py | planetmarshall/pillow-jpls | b93f53cd080f261f1b33021140ae523fcf45678f | [
"BSD-3-Clause"
] | 2 | 2021-04-26T14:49:21.000Z | 2022-02-14T23:40:16.000Z | pillow_jpls/jpls_image_decoder.py | planetmarshall/pillow-jpls | b93f53cd080f261f1b33021140ae523fcf45678f | [
"BSD-3-Clause"
] | null | null | null | from PIL.ImageFile import PyDecoder
from . import _pycharls
from ._pycharls import SpiffColorSpace
class JplsImageDecoder(PyDecoder):
def __init__(self, mode, *args):
super().__init__(mode, *args)
self._pulls_fd = True # we decode the entire image in one shot
self.color_space = args[0].g... | 30.115385 | 96 | 0.625798 |
89d0b75de7cdcf96dd8aaa2bd0125a5a8d09c757 | 466 | py | Python | ANN_realgas_toolbox/mainANN_2.py | uqyge/combustionML | b0052fce732f38af478b26b5b2c0d9c94310c89e | [
"MIT"
] | 21 | 2018-03-01T12:39:15.000Z | 2021-12-01T15:59:03.000Z | ANN_realgas_toolbox/mainANN_2.py | uqyge/combustionML | b0052fce732f38af478b26b5b2c0d9c94310c89e | [
"MIT"
] | 1 | 2018-06-01T16:31:46.000Z | 2018-06-12T09:07:59.000Z | ANN_realgas_toolbox/mainANN_2.py | uqyge/combustionML | b0052fce732f38af478b26b5b2c0d9c94310c89e | [
"MIT"
] | 6 | 2017-09-07T18:57:16.000Z | 2021-08-07T07:46:33.000Z | # to play with the ANN toolbox
import matplotlib.pyplot as plt
import datetime
from ANN_realgas_toolbox import ANN_realgas_toolbox
ANN = ANN_realgas_toolbox()
ANN.import_data()
ANN.scale_split_data()
#ANN.scale_split_data(targets = ['Cp'])
#ANN.setSequential(hiddenLayer=1,n_neurons=100)
#ANN.fitModel()
#ANN.predict... | 20.26087 | 51 | 0.785408 |
acb0aa54b4b7397865914466255f213c20f346f1 | 399 | py | Python | ope-backend/src/domain/dto/item_dto.py | mthora/ope-talos | 84b9a10e98dffb9dd654ce81b5419e3eb610961a | [
"CC0-1.0"
] | null | null | null | ope-backend/src/domain/dto/item_dto.py | mthora/ope-talos | 84b9a10e98dffb9dd654ce81b5419e3eb610961a | [
"CC0-1.0"
] | null | null | null | ope-backend/src/domain/dto/item_dto.py | mthora/ope-talos | 84b9a10e98dffb9dd654ce81b5419e3eb610961a | [
"CC0-1.0"
] | null | null | null | from flask_restx import fields
Item = {
'id': fields.Integer(readonly=True),
'name': fields.String(required=True, max_length=40),
'description': fields.String(required=True, max_length=200),
'price': fields.Float(required=True),
'amount': fields.Integer(required=True),
'promotion': fields.Boole... | 30.692308 | 64 | 0.701754 |
1884775d809be7359d8926cc66a34e83ad73b29b | 1,318 | py | Python | tests/test_cache_yamls.py | urbalazs/osm-gimmisn | 68bd9077dd7e7c7e152c5a41679428b52c1c019c | [
"MIT"
] | null | null | null | tests/test_cache_yamls.py | urbalazs/osm-gimmisn | 68bd9077dd7e7c7e152c5a41679428b52c1c019c | [
"MIT"
] | null | null | null | tests/test_cache_yamls.py | urbalazs/osm-gimmisn | 68bd9077dd7e7c7e152c5a41679428b52c1c019c | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright (c) 2020 Miklos Vajna and contributors.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""The test_cache_yamls module covers the cache_yamls module."""
import json
import os
import unittest
import test_context
import areas
i... | 29.954545 | 108 | 0.670713 |
08c03d1956c632b13b1b05a2b088443587e68876 | 22,096 | py | Python | tests/unit/test_finder.py | patricklaw/pip | 01eb41cfba062d4a7802ad9dcfe6eee4f11194b6 | [
"MIT"
] | null | null | null | tests/unit/test_finder.py | patricklaw/pip | 01eb41cfba062d4a7802ad9dcfe6eee4f11194b6 | [
"MIT"
] | 1 | 2021-08-07T12:15:25.000Z | 2021-08-07T12:15:25.000Z | tests/unit/test_finder.py | patricklaw/pip | 01eb41cfba062d4a7802ad9dcfe6eee4f11194b6 | [
"MIT"
] | null | null | null | import pytest
import pip.wheel
import pip.pep425tags
from pkg_resources import parse_version, Distribution
from pip.req import InstallRequirement
from pip.index import PackageFinder, Link
from pip.exceptions import (
BestVersionAlreadyInstalled, DistributionNotFound, InstallationError,
)
from pip.utils import Inf... | 31.386364 | 99 | 0.634504 |
5bafda9d4d4911d5ae34ab02094cd18d58d9c377 | 430 | py | Python | puppycompanyblog/blog_posts/forms.py | mayankrajcu/Social_Blog_Project | a94464f30578191eeafeb8e8d60846dd779de0b0 | [
"MIT"
] | 1 | 2019-08-07T08:05:32.000Z | 2019-08-07T08:05:32.000Z | Flask/08-Social-Blog-Project/Final_Project/puppycompanyblog/blog_posts/forms.py | Sandy1811/demandforecasting | fdb6878d93502773ba8da809c2de1b33c96fb9a0 | [
"Apache-2.0"
] | 8 | 2021-02-08T20:32:03.000Z | 2022-03-11T23:56:31.000Z | Flask/08-Social-Blog-Project/Final_Project/puppycompanyblog/blog_posts/forms.py | Sandy1811/demandforecasting | fdb6878d93502773ba8da809c2de1b33c96fb9a0 | [
"Apache-2.0"
] | 1 | 2022-01-29T21:39:03.000Z | 2022-01-29T21:39:03.000Z | from flask_wtf import FlaskForm
from wtforms import StringField, SubmitField, TextAreaField
from wtforms.validators import DataRequired
class BlogPostForm(FlaskForm):
# no empty titles or text possible
# we'll grab the date automatically from the Model later
title = StringField('Title', validators=[DataRe... | 35.833333 | 61 | 0.762791 |
c413940b4b4b4bf39caaeb34a30575a8d2110b9d | 924 | py | Python | test/integration/ggrc/models/test_control.py | kripsy/Project | 5ff892513ea74621ea5031a7d5bc7a6a614debc8 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | test/integration/ggrc/models/test_control.py | kripsy/Project | 5ff892513ea74621ea5031a7d5bc7a6a614debc8 | [
"ECL-2.0",
"Apache-2.0"
] | 1 | 2021-11-15T17:52:29.000Z | 2021-11-15T17:52:29.000Z | test/integration/ggrc/models/test_control.py | gaurav46/ggrc-core | 5f4ea7173ec1da7763bd5b4fef39858c8be07df2 | [
"ECL-2.0",
"Apache-2.0"
] | null | null | null | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Tests for control model."""
from ggrc import db
from ggrc.models import Control
from integration.ggrc import TestCase
from integration.ggrc.models import factories
class TestControl(TestCase):
def t... | 33 | 78 | 0.756494 |
434ea35dd9a3c90e7a5e64d86873116ec681ef9e | 6,543 | py | Python | bootstrap/bootstrap.py | ideonate/the-littlest-jupyterhub | 551c3f3ac6c182165ddf590b6193549b53daa786 | [
"BSD-3-Clause"
] | null | null | null | bootstrap/bootstrap.py | ideonate/the-littlest-jupyterhub | 551c3f3ac6c182165ddf590b6193549b53daa786 | [
"BSD-3-Clause"
] | null | null | null | bootstrap/bootstrap.py | ideonate/the-littlest-jupyterhub | 551c3f3ac6c182165ddf590b6193549b53daa786 | [
"BSD-3-Clause"
] | null | null | null | """
Bootstrap an installation of TLJH.
Sets up just enough TLJH environments to invoke tljh.installer.
This script is run as:
curl <script-url> | sudo python3 -
Constraints:
- Entire script should be compatible with Python 3.6 (We run on Ubuntu 18.04+)
- Script should parse in Python 3.4 (since we exit with... | 35.559783 | 109 | 0.650313 |
47cbd55178c85b00bac818eec0c860ad8b1ac9ff | 1,004 | py | Python | appyratus/cli/subparser.py | gigaquads/appyratus | 09d88c000e0f3d254f5e1875388ccf87cec4be7c | [
"MIT"
] | 1 | 2021-02-26T15:31:01.000Z | 2021-02-26T15:31:01.000Z | appyratus/cli/subparser.py | gigaquads/appyratus | 09d88c000e0f3d254f5e1875388ccf87cec4be7c | [
"MIT"
] | null | null | null | appyratus/cli/subparser.py | gigaquads/appyratus | 09d88c000e0f3d254f5e1875388ccf87cec4be7c | [
"MIT"
] | null | null | null | from .arg import Arg
from .parser import Parser
class Subparser(Parser):
"""
# Subparser
"""
def __init__(self, usage=None, defaults=None, *args, **kwargs):
super().__init__(*args, **kwargs)
#if not self.name:
# self.name = self.__class__
self.usage = usage or ''
... | 28.685714 | 78 | 0.587649 |
28fe4f45470532dc9b128fce07797aa16b7d46b7 | 41,112 | py | Python | tensorflow/python/ops/nn_grad.py | socal-ucr/tensorflow-upstream | 7e8f960bb398526aea7e045884101029fd21bddd | [
"Apache-2.0"
] | null | null | null | tensorflow/python/ops/nn_grad.py | socal-ucr/tensorflow-upstream | 7e8f960bb398526aea7e045884101029fd21bddd | [
"Apache-2.0"
] | null | null | null | tensorflow/python/ops/nn_grad.py | socal-ucr/tensorflow-upstream | 7e8f960bb398526aea7e045884101029fd21bddd | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 33.97686 | 114 | 0.665013 |
d4c005710b81f64adc8ecafd18f31f149efcc79e | 3,355 | py | Python | app/lib/database/_tables.py | kuco23/PokerThing | a401bb9e59b02e2dd211d1776d68cc3e8966a7ed | [
"MIT"
] | null | null | null | app/lib/database/_tables.py | kuco23/PokerThing | a401bb9e59b02e2dd211d1776d68cc3e8966a7ed | [
"MIT"
] | 1 | 2020-04-17T21:27:12.000Z | 2020-04-29T16:14:47.000Z | app/lib/database/_tables.py | kuco23/PokerThing | a401bb9e59b02e2dd211d1776d68cc3e8966a7ed | [
"MIT"
] | null | null | null | from collections import namedtuple
from ._enums import DbTable
make_accounts_table = f"""
CREATE TABLE IF NOT EXISTS {DbTable.ACCOUNTS.value} (
id INTEGER PRIMARY KEY AUTOINCREMENT,
username TEXT NOT NULL UNIQUE,
password_hash TEXT NOT NULL CHECK(length(password_hash) = 64),
email TEXT NOT NULL,
mo... | 29.955357 | 66 | 0.657526 |
f9c66397a5c38fcca8ad352530f4838b4e316c49 | 238 | py | Python | backend/tests.py | velencie/common-data-app | 83cb6002b83d7544955c3b7d152877cc7be62c55 | [
"MIT"
] | 1 | 2020-10-25T09:51:37.000Z | 2020-10-25T09:51:37.000Z | backend/tests.py | 154King154/common-data-app | 83cb6002b83d7544955c3b7d152877cc7be62c55 | [
"MIT"
] | null | null | null | backend/tests.py | 154King154/common-data-app | 83cb6002b83d7544955c3b7d152877cc7be62c55 | [
"MIT"
] | null | null | null | from fastapi.testclient import TestClient
from httpx import request, Auth, Client
from logic.tools import random_string
# from app import app
# def test_create_user():
# with Client(app=app) as client:
# print(response.json())
| 21.636364 | 41 | 0.747899 |
8429551765740e7db0eda82ce0b17cff129359b0 | 4,562 | py | Python | python/paddle/fluid/tests/book/high-level-api/image_classification/test_image_classification_vgg.py | skylarch/Paddle | d58d8df6f5f7aa6fd2f0780f87475055db57a80d | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/book/high-level-api/image_classification/test_image_classification_vgg.py | skylarch/Paddle | d58d8df6f5f7aa6fd2f0780f87475055db57a80d | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/tests/book/high-level-api/image_classification/test_image_classification_vgg.py | skylarch/Paddle | d58d8df6f5f7aa6fd2f0780f87475055db57a80d | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2018 PaddlePaddle 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 app... | 33.544118 | 79 | 0.671635 |
fa6f372728c57b4b81e6e6d401f00915a44cf2c1 | 588 | py | Python | packages/python/m/cli/commands/message/close.py | LaudateCorpus1/m | 57e258ddb1347f8e29673410e12575d203bb19c8 | [
"MIT"
] | null | null | null | packages/python/m/cli/commands/message/close.py | LaudateCorpus1/m | 57e258ddb1347f8e29673410e12575d203bb19c8 | [
"MIT"
] | null | null | null | packages/python/m/cli/commands/message/close.py | LaudateCorpus1/m | 57e258ddb1347f8e29673410e12575d203bb19c8 | [
"MIT"
] | 1 | 2021-12-31T13:25:33.000Z | 2021-12-31T13:25:33.000Z | import inspect
def add_parser(sub_parser, raw):
desc = """
close a block. When a block is closed, all its inner blocks are
closed automatically. Note: Not all CI Tools support nesting.
"""
parser = sub_parser.add_parser(
'close',
help='close block',
formatter_class=... | 25.565217 | 71 | 0.646259 |
7670e828f3f7d7c432d4137faf89abf25eb84f75 | 1,248 | py | Python | setup.py | loanchip/fast_ner | 2debcc5f4cd4bd31de5d96f21c702395729bccee | [
"MIT"
] | 2 | 2021-03-11T17:46:01.000Z | 2021-05-09T08:35:56.000Z | setup.py | loanchip/fast_ner | 2debcc5f4cd4bd31de5d96f21c702395729bccee | [
"MIT"
] | null | null | null | setup.py | loanchip/fast_ner | 2debcc5f4cd4bd31de5d96f21c702395729bccee | [
"MIT"
] | null | null | null | from setuptools import setup
import pathlib
here = pathlib.Path(__file__).parent.resolve()
long_description = (here / 'README.md').read_text(encoding='utf-8')
setup(
name='fast_ner',
version='1.0.0',
description='A Fast Named-Entity Recognition module',
long_description=long_description,
long_des... | 34.666667 | 78 | 0.649038 |
b115ea488c34d1d6a243833c902cfd7d2baa6746 | 1,979 | py | Python | Python/Project.Euler/Crawler.Python/old/PageMerger.py | jinlibao/toolkits | 529589832c130e2a33f96bb8fc3dcba952d3ecad | [
"MIT"
] | 1 | 2015-08-26T14:18:32.000Z | 2015-08-26T14:18:32.000Z | Python/Project.Euler/Crawler.Python/old/PageMerger.py | imthomasking/MATLAB-files | 529589832c130e2a33f96bb8fc3dcba952d3ecad | [
"MIT"
] | null | null | null | Python/Project.Euler/Crawler.Python/old/PageMerger.py | imthomasking/MATLAB-files | 529589832c130e2a33f96bb8fc3dcba952d3ecad | [
"MIT"
] | 1 | 2021-05-03T09:22:27.000Z | 2021-05-03T09:22:27.000Z | # Project Euler Page Merger
import re
__author__ = 'Libao Jin'
__date__ = 'June 17, 2015'
def ExtractContent(number, path, ext):
n = range(1,number)
# store problem content in pages (dict)
pages = {}
# store abnormal content in abnormal (dict, which cannot be
# matched, mainly in order to find bugs)
abnormal = ... | 28.681159 | 75 | 0.635169 |
d32a063163b982c17dd43143b054a9c1bf7d76c1 | 421 | py | Python | isenw_app/migrations/0016_auto_20210626_1336.py | thedivyanshuyadav/ISENW | ab424db8d12e6d7f8ad5e97aeb92fbbfde31831a | [
"MIT"
] | 7 | 2020-12-28T23:03:11.000Z | 2020-12-30T09:29:47.000Z | isenw_app/migrations/0016_auto_20210626_1336.py | thedivyanshuyadav/ISENW | ab424db8d12e6d7f8ad5e97aeb92fbbfde31831a | [
"MIT"
] | null | null | null | isenw_app/migrations/0016_auto_20210626_1336.py | thedivyanshuyadav/ISENW | ab424db8d12e6d7f8ad5e97aeb92fbbfde31831a | [
"MIT"
] | 2 | 2020-12-28T23:15:28.000Z | 2020-12-29T07:56:37.000Z | # Generated by Django 2.2.24 on 2021-06-26 13:36
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('isenw_app', '0015_auto_20210626_1330'),
]
operations = [
migrations.AlterField(
model_name='content',
name='id',
... | 22.157895 | 85 | 0.617577 |
fb90f1013ceea56ceef12c16e7c941f1a97a99fd | 1,380 | py | Python | api/src/services/document_service.py | equinor/data-modelling-tool | 0c0acc446866ed266711848929e91b316d8a93e5 | [
"MIT"
] | null | null | null | api/src/services/document_service.py | equinor/data-modelling-tool | 0c0acc446866ed266711848929e91b316d8a93e5 | [
"MIT"
] | 33 | 2022-02-28T07:52:28.000Z | 2022-03-31T06:51:15.000Z | api/src/services/document_service.py | equinor/data-modelling-tool | 0c0acc446866ed266711848929e91b316d8a93e5 | [
"MIT"
] | null | null | null | from functools import lru_cache
from config import Config
from domain_classes.blueprint import Blueprint
from domain_classes.tree_node import Node
from services.dmss import get_blueprint, get_document, get_document_by_uid
class DocumentService:
def __init__(
self,
blueprint_provider=get_blueprint... | 40.588235 | 96 | 0.753623 |
b352cf4acb54a1f3b5ade06edb1752802216407c | 901 | py | Python | opnsense_cli/parser/opnsense_form.py | jan-win1993/opn-cli | 83c4792571dacbe6483722a95276954c7a2d0b3c | [
"BSD-2-Clause"
] | 13 | 2021-05-17T10:42:25.000Z | 2022-02-21T02:10:41.000Z | opnsense_cli/parser/opnsense_form.py | jan-win1993/opn-cli | 83c4792571dacbe6483722a95276954c7a2d0b3c | [
"BSD-2-Clause"
] | 14 | 2021-05-17T13:53:27.000Z | 2021-12-16T12:45:44.000Z | opnsense_cli/parser/opnsense_form.py | jan-win1993/opn-cli | 83c4792571dacbe6483722a95276954c7a2d0b3c | [
"BSD-2-Clause"
] | 2 | 2021-04-28T08:41:07.000Z | 2022-03-28T10:20:51.000Z | from opnsense_cli.parser.xml import XmlParser
class OpnsenseFormParser(XmlParser):
def _parse_content(self):
base_tag = super()._parse_content()
return self.get_help_messages_with_id(base_tag)
def get_help_messages_with_id(self, base_tag):
messages = {}
for field in base_tag.f... | 25.742857 | 62 | 0.582686 |
3ecede250a4fd20fd33c3fbaad37f47261514e79 | 1,954 | py | Python | model/group.py | potolock/proverca | 3dd9720dd7733905c2441329d26d02fd1a72beea | [
"Apache-2.0"
] | null | null | null | model/group.py | potolock/proverca | 3dd9720dd7733905c2441329d26d02fd1a72beea | [
"Apache-2.0"
] | null | null | null | model/group.py | potolock/proverca | 3dd9720dd7733905c2441329d26d02fd1a72beea | [
"Apache-2.0"
] | null | null | null |
from sys import maxsize
class Group:
def __init__(self, name=None, header=None, footer=None, id=None):
self.name = name
self.header = header
self.footer = footer
self.id = id
def __repr__(self):
return "%s:%s%s:%s" % (self.id, self.name, self.header, self.footer)
... | 32.566667 | 123 | 0.60696 |
72b6a4c600b4dd905bbf14ba7265ae265d38215e | 511 | py | Python | core/object_depth.py | yasminfarza/python-code-test | 71d79e2c61e1297e5e629d3363207035098306e2 | [
"MIT"
] | null | null | null | core/object_depth.py | yasminfarza/python-code-test | 71d79e2c61e1297e5e629d3363207035098306e2 | [
"MIT"
] | null | null | null | core/object_depth.py | yasminfarza/python-code-test | 71d79e2c61e1297e5e629d3363207035098306e2 | [
"MIT"
] | null | null | null | # Print nested dictionary keys with their depth and handle a python object also
def print_depth(data, i=0):
key_items = []
for key, value in data.items():
temp = key + " " + str(i+1)
key_items.append(temp)
# check the value object or not
if hasattr(value, '__dict__'):
... | 26.894737 | 79 | 0.600783 |
5aa1f8e3e65a28737eb4caaea92dd3cb61242442 | 146 | py | Python | setup.py | beckstev/What2Eat | f98cca2d5e4541a8918da89b9a58a040428e2946 | [
"Apache-2.0"
] | null | null | null | setup.py | beckstev/What2Eat | f98cca2d5e4541a8918da89b9a58a040428e2946 | [
"Apache-2.0"
] | null | null | null | setup.py | beckstev/What2Eat | f98cca2d5e4541a8918da89b9a58a040428e2946 | [
"Apache-2.0"
] | null | null | null | from setuptools import setup
setup(name='What2Eat',
version='1.0',
author="Sebastian Pape, Steven Becker",
packages=['w2e'])
| 16.222222 | 45 | 0.636986 |
4409b8263d8ba560f125934be950c9c37908389e | 1,409 | py | Python | bluebottle/time_based/migrations/0006_auto_20201021_1315.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 10 | 2015-05-28T18:26:40.000Z | 2021-09-06T10:07:03.000Z | bluebottle/time_based/migrations/0006_auto_20201021_1315.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 762 | 2015-01-15T10:00:59.000Z | 2022-03-31T15:35:14.000Z | bluebottle/time_based/migrations/0006_auto_20201021_1315.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 9 | 2015-02-20T13:19:30.000Z | 2022-03-08T14:09:17.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2019-05-24 09:59
from __future__ import unicode_literals
from django.db import migrations, connection
from bluebottle.utils.utils import update_group_permissions
from bluebottle.clients import properties
from bluebottle.clients.models import Client
from bluebo... | 28.755102 | 126 | 0.605394 |
a3e1efc924bdd7252f32577a92bccd4ad467e232 | 124,778 | py | Python | tests/migrations/test_commands.py | skidipap/django | 8f04473af1da1ed4e8a07e89205da4e70d69b586 | [
"BSD-3-Clause",
"0BSD"
] | 2 | 2021-12-17T07:27:44.000Z | 2021-12-17T19:16:52.000Z | tests/migrations/test_commands.py | skidipap/django | 8f04473af1da1ed4e8a07e89205da4e70d69b586 | [
"BSD-3-Clause",
"0BSD"
] | 6 | 2022-01-13T17:38:02.000Z | 2022-03-15T15:24:12.000Z | tests/migrations/test_commands.py | skidipap/django | 8f04473af1da1ed4e8a07e89205da4e70d69b586 | [
"BSD-3-Clause",
"0BSD"
] | 2 | 2020-01-01T18:36:17.000Z | 2022-02-21T14:00:56.000Z | import datetime
import importlib
import io
import os
import shutil
import sys
from unittest import mock
from django.apps import apps
from django.core.management import CommandError, call_command
from django.db import (
ConnectionHandler,
DatabaseError,
OperationalError,
connection,
connections,
... | 40.817141 | 88 | 0.591643 |
6de9c841b9c986d86121c59c9d859f58cdde538f | 1,994 | py | Python | notario/tests/test_exceptions.py | alfredodeza/notario | 036bdc8435778c6f20f059d3789c8eb8242cff92 | [
"MIT"
] | 4 | 2015-08-20T20:14:55.000Z | 2018-06-01T14:39:29.000Z | notario/tests/test_exceptions.py | alfredodeza/notario | 036bdc8435778c6f20f059d3789c8eb8242cff92 | [
"MIT"
] | 9 | 2016-02-04T21:46:12.000Z | 2018-11-14T04:43:10.000Z | notario/tests/test_exceptions.py | alfredodeza/notario | 036bdc8435778c6f20f059d3789c8eb8242cff92 | [
"MIT"
] | 4 | 2015-04-29T20:40:12.000Z | 2018-11-14T04:08:20.000Z | from notario import exceptions
def foo(): return True
class Object(object): pass
class TestInvalid(object):
def test_include_the_key(self):
error = exceptions.Invalid('key', ['foo', 'bar', 'key'])
assert 'key' in error._format_path()
def test_include_the_path_in_str(self):
error =... | 33.79661 | 97 | 0.614343 |
f70c8e189b6fa80ed3959d3b92567217e2bb43d0 | 692 | py | Python | test_example.py | kaapitoshka/AntonStudy | d42a643e2f0a78e5257d3d2b876258e1e765db04 | [
"Apache-2.0"
] | null | null | null | test_example.py | kaapitoshka/AntonStudy | d42a643e2f0a78e5257d3d2b876258e1e765db04 | [
"Apache-2.0"
] | null | null | null | test_example.py | kaapitoshka/AntonStudy | d42a643e2f0a78e5257d3d2b876258e1e765db04 | [
"Apache-2.0"
] | null | null | null | import pytest
from selenium import webdriver
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import time
@pytest.fixture(scope="session")
def driver(request):
wd=webdriver.Chrome()
request.addfinalizer(wd.quit)
return wd
def test_admin_log... | 32.952381 | 73 | 0.799133 |
b8940f4cdd6af8345dd3b96360aa6a0236ec0bc9 | 1,027 | py | Python | tests/test_server.py | PASTAplus/soh | e6c27bfd17f5d625e692fdc1b578ebaedd9e411b | [
"Apache-2.0"
] | null | null | null | tests/test_server.py | PASTAplus/soh | e6c27bfd17f5d625e692fdc1b578ebaedd9e411b | [
"Apache-2.0"
] | 6 | 2019-01-05T16:03:31.000Z | 2022-03-14T02:56:55.000Z | tests/test_server.py | PASTAplus/soh | e6c27bfd17f5d625e692fdc1b578ebaedd9e411b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""":Mod: check_server
:Synopsis:
:Author:
servilla
:Created:
3/16/18
"""
import os
import sys
import unittest
import daiquiri
from soh.asserts import server
from soh.config import Config
from soh.server.server import Server
logger = daiquiri.getLogger('tes... | 18.017544 | 71 | 0.642648 |
c82c15d61adec4633721bb2eeb848ad4822e3bfa | 903 | py | Python | core/entityes/__init__.py | Cyxapic/arcade | 1fd912e2d3f8a39fa4428b77e2a78d2877463e29 | [
"MIT"
] | null | null | null | core/entityes/__init__.py | Cyxapic/arcade | 1fd912e2d3f8a39fa4428b77e2a78d2877463e29 | [
"MIT"
] | null | null | null | core/entityes/__init__.py | Cyxapic/arcade | 1fd912e2d3f8a39fa4428b77e2a78d2877463e29 | [
"MIT"
] | null | null | null | from pygame import sprite
from .enemy import Enemy
from .good_staff import GoodStaff
ENTITYES = {
'enemy': Enemy,
'goodstaff': GoodStaff,
}
def create_entity(cls: str, file: str, size: tuple, quantity=None):
"""Fabric method for Entity create
Arguments:
cls -... | 28.21875 | 67 | 0.619048 |
3f7eeb847fe7cbb78f1554409660672308cfef3f | 1,643 | py | Python | precise/skaters/portfoliostatic/unitportfactory.py | MarcoGorelli/precise | 227d017d45f1c4b39887a85133f3d62950a1e341 | [
"MIT"
] | 40 | 2022-01-13T00:40:59.000Z | 2022-03-31T20:33:19.000Z | precise/skaters/portfoliostatic/unitportfactory.py | MarcoGorelli/precise | 227d017d45f1c4b39887a85133f3d62950a1e341 | [
"MIT"
] | 14 | 2022-01-08T16:00:12.000Z | 2022-03-16T00:12:04.000Z | precise/skaters/portfoliostatic/unitportfactory.py | MarcoGorelli/precise | 227d017d45f1c4b39887a85133f3d62950a1e341 | [
"MIT"
] | 9 | 2022-01-26T21:14:43.000Z | 2022-03-21T17:32:02.000Z | import numpy as np
from precise.skaters.covarianceutil.covfunctions import try_invert
from precise.skaters.portfolioutil.portfunctions import portfolio_variance
from typing import List
from itertools import zip_longest
from precise.skaters.locationutil.vectorfunctions import normalize
# Long-short min-var portfolios ... | 30.425926 | 128 | 0.720024 |
78b433e486bd86513f9402a8cea68c86f75c47ca | 387 | py | Python | tools/wsgi.py | kum83/network-tool-django | 963898456165f70b0a550cb51ee099c81188f248 | [
"Apache-2.0"
] | 1 | 2021-09-04T01:54:08.000Z | 2021-09-04T01:54:08.000Z | tools/wsgi.py | yinm8315/network-tool-django | 963898456165f70b0a550cb51ee099c81188f248 | [
"Apache-2.0"
] | null | null | null | tools/wsgi.py | yinm8315/network-tool-django | 963898456165f70b0a550cb51ee099c81188f248 | [
"Apache-2.0"
] | null | null | null | """
WSGI config for tools project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTING... | 22.764706 | 78 | 0.782946 |
192fdc5da2bad8a696a5858cb63f83ccd93e083b | 2,185 | py | Python | videos-master/_2018/eop/chapter1/all_sequences.py | samsmusa/My-manim-master | a79266ea21fbb7e84d0133030146549f381c31cb | [
"MIT"
] | 5 | 2021-03-18T02:28:07.000Z | 2021-04-10T03:40:24.000Z | videos-master/_2018/eop/chapter1/all_sequences.py | samsmusa/My-manim-master | a79266ea21fbb7e84d0133030146549f381c31cb | [
"MIT"
] | null | null | null | videos-master/_2018/eop/chapter1/all_sequences.py | samsmusa/My-manim-master | a79266ea21fbb7e84d0133030146549f381c31cb | [
"MIT"
] | 1 | 2022-02-16T03:22:47.000Z | 2022-02-16T03:22:47.000Z |
from manim_imports_ext import *
from _2018.eop.reusable_imports import *
class ShuffleThroughAllSequences(Scene):
CONFIG = {
"nb_coins" : 20,
"run_time" : 5,
"fps" : int(1.0/PRODUCTION_QUALITY_FRAME_DURATION),
"coin_size" : 0.5,
"coin_spacing" : 0.65
}
def constru... | 33.615385 | 93 | 0.590389 |
1c170322ec90639308d4d98ec4363a8e12e56336 | 12,063 | py | Python | grizzly_extras/async_message/mq.py | boffman/grizzly | eabe7b8f6cd7098914a1473928135c1e05758af7 | [
"MIT"
] | null | null | null | grizzly_extras/async_message/mq.py | boffman/grizzly | eabe7b8f6cd7098914a1473928135c1e05758af7 | [
"MIT"
] | null | null | null | grizzly_extras/async_message/mq.py | boffman/grizzly | eabe7b8f6cd7098914a1473928135c1e05758af7 | [
"MIT"
] | null | null | null | from typing import Optional, Generator, Dict, cast
from time import monotonic as time, sleep
from contextlib import contextmanager
from ..transformer import transformer, TransformerError, TransformerContentType
from ..arguments import parse_arguments, get_unsupported_arguments
from . import (
AsyncMessageRequest... | 40.21 | 152 | 0.578214 |
39c5c6d8654eb34caf826b596a5ed2e87c2d30ce | 20,526 | py | Python | unbalanced_dataset/over_sampling.py | dmylnikov/UnbalancedDataset_df | 2eebf5872b13d9218e3af3b5671b73be7432630b | [
"MIT"
] | null | null | null | unbalanced_dataset/over_sampling.py | dmylnikov/UnbalancedDataset_df | 2eebf5872b13d9218e3af3b5671b73be7432630b | [
"MIT"
] | null | null | null | unbalanced_dataset/over_sampling.py | dmylnikov/UnbalancedDataset_df | 2eebf5872b13d9218e3af3b5671b73be7432630b | [
"MIT"
] | null | null | null | from __future__ import print_function
from __future__ import division
import numpy as np
from numpy.random import seed, randint
# from numpy import concatenate, asarray
from numpy import asarray
from pandas import concat as concatenate
from random import betavariate
from collections import Counter
from .unbalanced_data... | 41.299799 | 108 | 0.505895 |
0f52a8a5475ac79de7d3e1442b02d0ec27dc26cb | 7,181 | py | Python | chillapi/swagger/utils.py | andrescevp/chillapi | 1c5f07600748eb65f413ad19f5e67653cce8b787 | [
"Apache-2.0"
] | 2 | 2021-05-05T10:54:34.000Z | 2021-05-05T12:45:18.000Z | chillapi/swagger/utils.py | andrescevp/chillapi | 1c5f07600748eb65f413ad19f5e67653cce8b787 | [
"Apache-2.0"
] | null | null | null | chillapi/swagger/utils.py | andrescevp/chillapi | 1c5f07600748eb65f413ad19f5e67653cce8b787 | [
"Apache-2.0"
] | null | null | null | from ..app.swagger_schema import Schema
from ..database.query_builder import sql_operators
class ColumnSwaggerDefinition:
""" """
column_swagger_properties = {}
def __init__(self, name: str, column_swagger_properties: dict):
self.name = name
self.column_swagger_properties = column_swagge... | 25.285211 | 145 | 0.614399 |
c72ad72e968f353354d2d0f83bb5eeb87825075b | 4,669 | py | Python | ponyexpress/tests/test_server.py | TelekomCloud/pony-express | a825b518687719be5dfe95692008c2129db115cd | [
"Apache-2.0"
] | null | null | null | ponyexpress/tests/test_server.py | TelekomCloud/pony-express | a825b518687719be5dfe95692008c2129db115cd | [
"Apache-2.0"
] | null | null | null | ponyexpress/tests/test_server.py | TelekomCloud/pony-express | a825b518687719be5dfe95692008c2129db115cd | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import unittest
import json
from ponyexpress import create_app
from ponyexpress.database import db
from ponyexpress.api.lib.package_import import PackageImport
from ponyexpress.api.lib.repositories import Repositories
from ponyexpress.models import Repository
#================================... | 28.644172 | 97 | 0.524523 |
2c471e81789139823c00c23d03248b5282cde940 | 1,396 | py | Python | python_scripts/old_unsorted/misc_rel_0.1/error_rate_mapping_sbatches.py | jfnavarro/st_misc | bb8c1f2c4f05343f6dd5cc8b8cd8f405d825bd31 | [
"MIT"
] | null | null | null | python_scripts/old_unsorted/misc_rel_0.1/error_rate_mapping_sbatches.py | jfnavarro/st_misc | bb8c1f2c4f05343f6dd5cc8b8cd8f405d825bd31 | [
"MIT"
] | null | null | null | python_scripts/old_unsorted/misc_rel_0.1/error_rate_mapping_sbatches.py | jfnavarro/st_misc | bb8c1f2c4f05343f6dd5cc8b8cd8f405d825bd31 | [
"MIT"
] | null | null | null | """ Generate sbatch files for running mapping at different error rates,
for different settings of findIndexesWpairEnd.
"""
import argparse
sbatch_string = \
"""#!/bin/bash
#SBATCH -A b2011007
#SBATCH -p node
#SBATCH -N 1
#SBATCH -n 8
#SBATCH -t 14:00:00
#SBATCH -J "err_rate_mapping_m{m}k{k}l{l}"
#SBATCH -D {out_direct... | 34.04878 | 102 | 0.651862 |
f0931c2693566281c0495f6c6fbd78e6880591c1 | 1,697 | py | Python | python/PostProcessing/SingleGraph.py | k323r/pcatse | d762c10a72dc6b6afcc3c5e0c87d66391fc51639 | [
"MIT"
] | 3 | 2021-12-20T20:53:35.000Z | 2022-03-07T12:41:54.000Z | python/PostProcessing/SingleGraph.py | k323r/wigglelab | 2de1e8389dee0d05f574ddef8a71875738d8331b | [
"MIT"
] | 1 | 2022-02-27T14:03:31.000Z | 2022-02-27T14:03:31.000Z | python/PostProcessing/SingleGraph.py | k323r/wigglelab | 2de1e8389dee0d05f574ddef8a71875738d8331b | [
"MIT"
] | 3 | 2018-01-22T22:39:23.000Z | 2021-06-29T23:36:25.000Z | import numpy as np
import glob, re
from os.path import isdir, isfile
from math import sqrt
from PostProcessingIO import readFile
from PostProcessingIO import getTimeDirs
from PostProcessingIO import isNumber, fftAnalysis, filterData, toCoefficient
class SingleGraph():
'''
Simple class to post process single gr... | 26.515625 | 134 | 0.559222 |
b27db24ea26f7e2e9ad3faf20de9e34e2d3caacd | 122 | py | Python | pipelines_source/lambda/handler.py | jvargh/cdk-pipeline-lambda-deploy | 95493d9c2e2e465e1b558c1632b0aef5c81fa0eb | [
"MIT-0"
] | null | null | null | pipelines_source/lambda/handler.py | jvargh/cdk-pipeline-lambda-deploy | 95493d9c2e2e465e1b558c1632b0aef5c81fa0eb | [
"MIT-0"
] | null | null | null | pipelines_source/lambda/handler.py | jvargh/cdk-pipeline-lambda-deploy | 95493d9c2e2e465e1b558c1632b0aef5c81fa0eb | [
"MIT-0"
] | null | null | null | def handler(event, context):
return {
'body': 'Hello from gfs-finspace-challenge-teamb',
'statusCode': '200'
} | 24.4 | 54 | 0.647541 |
32b49db83c10e8cb4e16e234afc468d9a2352c29 | 3,748 | py | Python | flow_io.py | zsameem/realtime-mdmod | 25631b749f2752bd96b2e787d4d0ba68321b29f5 | [
"MIT"
] | 3 | 2018-07-23T11:54:42.000Z | 2019-06-06T18:48:36.000Z | flow_io.py | zsameem/realtime-mdmod | 25631b749f2752bd96b2e787d4d0ba68321b29f5 | [
"MIT"
] | null | null | null | flow_io.py | zsameem/realtime-mdmod | 25631b749f2752bd96b2e787d4d0ba68321b29f5 | [
"MIT"
] | null | null | null | """
Some helper functions to read, write and visualize optical flow
Author: Samim Zahoor Taray
"""
def readFlow(name):
import numpy as np
if name.endswith('.pfm') or name.endswith('.PFM'):
return readPFM(name)[0][:,:,0:2]
f = open(name, 'rb')
header = f.read(4)
if header.decode("u... | 35.028037 | 85 | 0.618463 |
9c34b55686872ab674896b534938c3a4c15ea0d9 | 20,086 | py | Python | Lib/site-packages/sphinx/builders/latex/__init__.py | nemarugommula/ecommerce | 60185e79655fbaf0fcad9e877a886fe9eb3c4451 | [
"bzip2-1.0.6"
] | 1 | 2021-12-05T02:48:02.000Z | 2021-12-05T02:48:02.000Z | Lib/site-packages/sphinx/builders/latex/__init__.py | nemarugommula/ecommerce | 60185e79655fbaf0fcad9e877a886fe9eb3c4451 | [
"bzip2-1.0.6"
] | 4 | 2019-11-05T16:18:23.000Z | 2022-03-02T11:13:20.000Z | Lib/site-packages/sphinx/builders/latex/__init__.py | nemarugommula/ecommerce | 60185e79655fbaf0fcad9e877a886fe9eb3c4451 | [
"bzip2-1.0.6"
] | 1 | 2019-11-05T15:21:55.000Z | 2019-11-05T15:21:55.000Z | """
sphinx.builders.latex
~~~~~~~~~~~~~~~~~~~~~
LaTeX builder.
:copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
import os
import warnings
from os import path
from typing import Any, Dict, Iterable, List, Tuple, Union
from docutils.front... | 42.020921 | 116 | 0.608782 |
1fe4d14559454f9788a0cd63d3a1bc7de5542949 | 215 | py | Python | vote/serializers/electoral_votes.py | The-Politico/politico-civic-vote | 49348f6c8137c07e4602da184aa500cbcc09affc | [
"MIT"
] | null | null | null | vote/serializers/electoral_votes.py | The-Politico/politico-civic-vote | 49348f6c8137c07e4602da184aa500cbcc09affc | [
"MIT"
] | 4 | 2018-06-27T16:56:29.000Z | 2021-06-10T20:41:56.000Z | vote/serializers/electoral_votes.py | The-Politico/politico-civic-vote | 49348f6c8137c07e4602da184aa500cbcc09affc | [
"MIT"
] | null | null | null | from rest_framework import serializers
from vote.models import ElectoralVotes
class ElectoralVotesSerializer(serializers.ModelSerializer):
class Meta:
model = ElectoralVotes
fields = '__all__'
| 23.888889 | 60 | 0.767442 |
fee8242143981bb872bd55669c1e940cf173eb80 | 5,925 | py | Python | opentimelineio/core/json_serializer.py | alatdneg/OpenTimelineIO | 1abf971baadf42ec78d513f6b3c5910124668764 | [
"Apache-2.0"
] | 87 | 2021-05-07T08:40:46.000Z | 2022-03-19T00:36:25.000Z | opentimelineio/core/json_serializer.py | alatdneg/OpenTimelineIO | 1abf971baadf42ec78d513f6b3c5910124668764 | [
"Apache-2.0"
] | 1,019 | 2021-04-26T06:22:56.000Z | 2022-03-31T16:30:43.000Z | opentimelineio/core/json_serializer.py | alatdneg/OpenTimelineIO | 1abf971baadf42ec78d513f6b3c5910124668764 | [
"Apache-2.0"
] | 33 | 2021-04-29T12:35:54.000Z | 2022-03-25T14:48:42.000Z | #
# Copyright 2017 Pixar Animation Studios
#
# Licensed under the Apache License, Version 2.0 (the "Apache License")
# with the following modification; you may not use this file except in
# compliance with the Apache License and the following modification to it:
# Section 6. Trademarks. is deleted and replaced with:
#
... | 27.054795 | 79 | 0.706835 |
d6f279454d4ae442326ee64f2828c1aa23d0d54c | 3,454 | py | Python | experiment_3_pool_run.py | marjanin/tendon_stiffness | b1dc379b09bbf9c044410a6bc51afbee0cba2e05 | [
"MIT"
] | 1 | 2020-07-20T02:04:46.000Z | 2020-07-20T02:04:46.000Z | experiment_3_pool_run.py | marjanin/tendon_stiffness | b1dc379b09bbf9c044410a6bc51afbee0cba2e05 | [
"MIT"
] | null | null | null | experiment_3_pool_run.py | marjanin/tendon_stiffness | b1dc379b09bbf9c044410a6bc51afbee0cba2e05 | [
"MIT"
] | 1 | 2020-05-11T11:41:39.000Z | 2020-05-11T11:41:39.000Z |
# next is to add accel and see the difference
# add stiffness too
import tensorflow as tf
import numpy as np
from matplotlib import pyplot as plt
from all_functions import *
import pickle
from warnings import simplefilter
import multiprocessing as mp
def lern_to_walk_stiffness_pool(stiffness_version_A):
experiment_... | 34.888889 | 129 | 0.793283 |
4d83e5825584a3c04263787d0dba2d366c3c9e33 | 1,101 | py | Python | read.PRISM.py | rjbombardi/Input-PRISM-precipitation-NumPy-Python | 308242a5a9ba52ded6739c457fddb6223da1a594 | [
"MIT"
] | null | null | null | read.PRISM.py | rjbombardi/Input-PRISM-precipitation-NumPy-Python | 308242a5a9ba52ded6739c457fddb6223da1a594 | [
"MIT"
] | null | null | null | read.PRISM.py | rjbombardi/Input-PRISM-precipitation-NumPy-Python | 308242a5a9ba52ded6739c457fddb6223da1a594 | [
"MIT"
] | null | null | null | #!/usr/bin/python
#========================================================================
# How to read PRISM precipitation file as a grid using NumPy
#========================================================================
import numpy as np
# Edit the file names
# LatLon mesh .csv file
filein='PRISM_4kmesh_LatLon... | 26.853659 | 73 | 0.595822 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.