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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b935f042bd8e2f0c715ab9c85da37dd8b7d47c59 | 1,358 | py | Python | queries.py | shan-x/wp2pelican | 9a843fcaeb065ddafba40695584e34188938db84 | [
"Apache-2.0"
] | null | null | null | queries.py | shan-x/wp2pelican | 9a843fcaeb065ddafba40695584e34188938db84 | [
"Apache-2.0"
] | null | null | null | queries.py | shan-x/wp2pelican | 9a843fcaeb065ddafba40695584e34188938db84 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3
# coding: utf-8
get_posts = """
query GET_POSTS($first: Int, $after: String) {
posts(first: $first, after: $after) {
pageInfo {
hasNextPage
endCursor
}
edges {
node {
title
date
modified
... | 16.166667 | 46 | 0.318115 |
234d7a31dd4a5b6a1a6e727a6d5b552ddab0756d | 2,896 | py | Python | tests/extmod/utimeq1.py | sebastien-riou/micropython | 116c15842fd48ddb77b0bc016341d936a0756573 | [
"MIT"
] | 13,648 | 2015-01-01T01:34:51.000Z | 2022-03-31T16:19:53.000Z | tests/extmod/utimeq1.py | sebastien-riou/micropython | 116c15842fd48ddb77b0bc016341d936a0756573 | [
"MIT"
] | 7,092 | 2015-01-01T07:59:11.000Z | 2022-03-31T23:52:18.000Z | tests/extmod/utimeq1.py | sebastien-riou/micropython | 116c15842fd48ddb77b0bc016341d936a0756573 | [
"MIT"
] | 4,942 | 2015-01-02T11:48:50.000Z | 2022-03-31T19:57:10.000Z | # Test for utimeq module which implements task queue with support for
# wraparound time (utime.ticks_ms() style).
try:
from utime import ticks_add, ticks_diff
from utimeq import utimeq
except ImportError:
print("SKIP")
raise SystemExit
DEBUG = 0
MAX = ticks_add(0, -1)
MODULO_HALF = MAX // 2 + 1
if DE... | 19.567568 | 91 | 0.642956 |
b0143f54e3b68a1fccd5d707258f8aca97d8446a | 3,924 | py | Python | main.py | ZhangPHEngr/Kalman-in-MOT | d915645cdba32c42957bcf5bc0357273435a880c | [
"Apache-2.0"
] | 54 | 2021-09-21T09:04:42.000Z | 2022-03-31T06:08:22.000Z | main.py | ZhangPHEngr/Kalman-in-MOT | d915645cdba32c42957bcf5bc0357273435a880c | [
"Apache-2.0"
] | 2 | 2021-11-14T19:05:42.000Z | 2021-12-20T11:20:10.000Z | main.py | ZhangPHEngr/Kalman-in-MOT | d915645cdba32c42957bcf5bc0357273435a880c | [
"Apache-2.0"
] | 23 | 2021-09-27T06:50:19.000Z | 2022-03-17T07:59:46.000Z | # -*- coding: utf-8 -*-
"""
@Project: kalman-filter-in-single-object-tracking
@File : main.py
@Author : Zhang P.H
@Date : 2021/9/20
@Desc :
"""
import cv2
import numpy as np
import const
import utils
import measure
from kalman import Kalman
# --------------------------------Kalman参数------------------------------... | 35.351351 | 118 | 0.522681 |
9a0ec4fae2558f2c73543fb6d90c69955bfefbf3 | 4,540 | py | Python | starthinker_ui/recipe/views.py | dvandra/starthinker | 07a8c1f8bf3c7493b1833d54ca0acc9305a04bc9 | [
"Apache-2.0"
] | 1 | 2019-07-02T18:25:25.000Z | 2019-07-02T18:25:25.000Z | starthinker_ui/recipe/views.py | dvandra/starthinker | 07a8c1f8bf3c7493b1833d54ca0acc9305a04bc9 | [
"Apache-2.0"
] | null | null | null | starthinker_ui/recipe/views.py | dvandra/starthinker | 07a8c1f8bf3c7493b1833d54ca0acc9305a04bc9 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
###########################################################################
#
# Copyright 2019 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# ... | 33.880597 | 95 | 0.705727 |
d216986abff147689f2114ccee44377092381792 | 11,275 | py | Python | analyze.py | jang-chinseok/Visualizing-voice-data | f246cd2ab97dc1114b8c16d37761bc2e7657b45f | [
"Apache-2.0"
] | null | null | null | analyze.py | jang-chinseok/Visualizing-voice-data | f246cd2ab97dc1114b8c16d37761bc2e7657b45f | [
"Apache-2.0"
] | null | null | null | analyze.py | jang-chinseok/Visualizing-voice-data | f246cd2ab97dc1114b8c16d37761bc2e7657b45f | [
"Apache-2.0"
] | null | null | null | # visualisation tools for mimic2
import matplotlib.pyplot as plt
from statistics import stdev, mode, mean, median
from statistics import StatisticsError
import argparse
import glob
import os
import csv
import copy
import seaborn as sns
import random
from text.cmudict import CMUDict
from jamo import h2j, j2hcj
from te... | 29.671053 | 145 | 0.519557 |
7ea5d0f7e5e3b1959ee822ecfab0a3b216efcbb2 | 10,357 | py | Python | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/tunnelheadtrafficendpoint_399e6e14fa13954b413c4572ebd3725e.py | Vibaswan/ixnetwork_restpy | 239fedc7050890746cbabd71ea1e91c68d9e5cad | [
"MIT"
] | null | null | null | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/tunnelheadtrafficendpoint_399e6e14fa13954b413c4572ebd3725e.py | Vibaswan/ixnetwork_restpy | 239fedc7050890746cbabd71ea1e91c68d9e5cad | [
"MIT"
] | null | null | null | ixnetwork_restpy/testplatform/sessions/ixnetwork/vport/protocols/tunnelheadtrafficendpoint_399e6e14fa13954b413c4572ebd3725e.py | Vibaswan/ixnetwork_restpy | 239fedc7050890746cbabd71ea1e91c68d9e5cad | [
"MIT"
] | null | null | null | # MIT LICENSE
#
# Copyright 1997 - 2020 by IXIA Keysight
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify,... | 52.841837 | 324 | 0.709182 |
8d52e6fbfa93bf559238b1af7e46e36743f36310 | 6,194 | py | Python | blackmamba/lib/rope/base/oi/type_hinting/providers/docstrings.py | oz90210/blackmamba | 65c82c8e99028d6fbb57098ce82d0a394df215a0 | [
"MIT"
] | 463 | 2015-01-15T08:17:42.000Z | 2022-03-28T15:10:20.000Z | blackmamba/lib/rope/base/oi/type_hinting/providers/docstrings.py | oz90210/blackmamba | 65c82c8e99028d6fbb57098ce82d0a394df215a0 | [
"MIT"
] | 52 | 2015-01-06T02:43:59.000Z | 2022-03-14T11:15:21.000Z | blackmamba/lib/rope/base/oi/type_hinting/providers/docstrings.py | oz90210/blackmamba | 65c82c8e99028d6fbb57098ce82d0a394df215a0 | [
"MIT"
] | 249 | 2015-01-07T22:49:49.000Z | 2022-03-18T02:32:06.000Z | """
Hinting the type using docstring of class/function.
It's an irreplaceable thing if you are using Dependency Injection with passive class:
http://www.martinfowler.com/articles/injection.html
Some code extracted (or based on code) from:
https://github.com/davidhalter/jedi/blob/b489019f5bd5750051122b94cc767df47751ec... | 31.927835 | 109 | 0.633193 |
d951d27415fa7fb0a19cb64d651ff1c8f6d9d13c | 223 | py | Python | buildbot/osuosl/master/config/__init__.py | antiagainst/llvm-zorg | a5b58cdd800d0d45b1bdd1f7fe058db6acbfd918 | [
"Apache-2.0"
] | 2 | 2021-12-06T10:53:27.000Z | 2021-12-06T11:01:09.000Z | buildbot/osuosl/master/config/__init__.py | antiagainst/llvm-zorg | a5b58cdd800d0d45b1bdd1f7fe058db6acbfd918 | [
"Apache-2.0"
] | null | null | null | buildbot/osuosl/master/config/__init__.py | antiagainst/llvm-zorg | a5b58cdd800d0d45b1bdd1f7fe058db6acbfd918 | [
"Apache-2.0"
] | null | null | null | # Load local options.
import os
import ConfigParser
options = ConfigParser.RawConfigParser()
options.read(os.path.join(os.path.dirname(__file__), 'local.cfg'))
import builders
import schedulers
import slaves
import status
| 20.272727 | 66 | 0.807175 |
f14dd5e97932e63e82b61d3cdefaf863983a11e2 | 3,070 | py | Python | scripts/tar2db.py | c0mix/firmadyne | 137f25e02ecc47f5b3c4dd512e0194658dbab929 | [
"MIT"
] | 1 | 2019-03-19T06:30:58.000Z | 2019-03-19T06:30:58.000Z | scripts/tar2db.py | c0mix/firmadyne | 137f25e02ecc47f5b3c4dd512e0194658dbab929 | [
"MIT"
] | null | null | null | scripts/tar2db.py | c0mix/firmadyne | 137f25e02ecc47f5b3c4dd512e0194658dbab929 | [
"MIT"
] | 1 | 2020-05-18T08:32:24.000Z | 2020-05-18T08:32:24.000Z | #!/usr/bin/env python
import tarfile
import getopt
import sys
import re
import hashlib
import psycopg2
def getFileHashes(infile):
t = tarfile.open(infile)
files = list()
links = list()
for f in t.getmembers():
if f.isfile():
# we use f.name[1:] to get rid of the . at the beginning ... | 30.39604 | 189 | 0.537459 |
d57298a3c86957435ec1afa28686f1ac72e3aae0 | 391 | py | Python | wizards-django-rest/wizards/wizards/wsgi.py | tomyy4/wizards-project | be70ee3321427a6ea6991ebda7dafc638b4cfbab | [
"MIT"
] | null | null | null | wizards-django-rest/wizards/wizards/wsgi.py | tomyy4/wizards-project | be70ee3321427a6ea6991ebda7dafc638b4cfbab | [
"MIT"
] | null | null | null | wizards-django-rest/wizards/wizards/wsgi.py | tomyy4/wizards-project | be70ee3321427a6ea6991ebda7dafc638b4cfbab | [
"MIT"
] | null | null | null | """
WSGI config for wizards 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.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTI... | 23 | 78 | 0.785166 |
0979bffe1112b0856c2bb778b672c70e0ffd62bc | 466 | py | Python | hc/api/migrations/0030_check_last_ping_body.py | opsct/healthchecks | 069bc9b735c0473aed9946104ab85238d065bea1 | [
"BSD-3-Clause"
] | null | null | null | hc/api/migrations/0030_check_last_ping_body.py | opsct/healthchecks | 069bc9b735c0473aed9946104ab85238d065bea1 | [
"BSD-3-Clause"
] | 5 | 2021-04-08T21:56:59.000Z | 2022-02-10T12:51:07.000Z | hc/api/migrations/0030_check_last_ping_body.py | fictional-tribble/healthchecks | 3a8056f0e22a685ec2223c7d2363c0c131fb80d3 | [
"BSD-3-Clause"
] | 1 | 2021-05-21T19:50:52.000Z | 2021-05-21T19:50:52.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-05-08 18:31
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0029_auto_20170507_1251'),
]
operations = [
migrations.AddField(
... | 22.190476 | 64 | 0.622318 |
dc08694c686320ff8514efca28d0bafb6bdbbb88 | 7,781 | py | Python | tests/test_acid.py | sdjespersen/hszinc | 975a37360518925c9532046c4464d79e49830c37 | [
"BSD-2-Clause"
] | null | null | null | tests/test_acid.py | sdjespersen/hszinc | 975a37360518925c9532046c4464d79e49830c37 | [
"BSD-2-Clause"
] | null | null | null | tests/test_acid.py | sdjespersen/hszinc | 975a37360518925c9532046c4464d79e49830c37 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Zinc dumping and parsing module
# (C) 2016 VRT Systems
#
# vim: set ts=4 sts=4 et tw=78 sw=4 si:
import hszinc
from .pint_enable import to_pint
import datetime
import pytz
import random
import string
import six
STR_CHARSET = string.ascii_letters + string.digits + '\n\r\t\f\b'
def gen_rando... | 30.633858 | 75 | 0.600565 |
04a0cd2c6a105845feac3b9ccccd17cc8882d3df | 5,925 | py | Python | PoseDet/keypoints_nms.py | IIGROUP/PoseDet-Fast-Multi-Person-Pose-Estimation-Using-Pose-Embedding | edb1b50cb697e7eea576cd1d69d5c3c097234e58 | [
"MIT"
] | 10 | 2021-07-31T06:25:06.000Z | 2022-02-10T07:49:59.000Z | PoseDet/keypoints_nms.py | IIGROUP/PoseDet-Fast-Multi-Person-Pose-Estimation-Using-Pose-Embedding | edb1b50cb697e7eea576cd1d69d5c3c097234e58 | [
"MIT"
] | null | null | null | PoseDet/keypoints_nms.py | IIGROUP/PoseDet-Fast-Multi-Person-Pose-Estimation-Using-Pose-Embedding | edb1b50cb697e7eea576cd1d69d5c3c097234e58 | [
"MIT"
] | 1 | 2021-11-11T07:02:34.000Z | 2021-11-11T07:02:34.000Z | import torch
# from mmdet.ops.nms import batched_nms
# from mmdet.ops.nms import nms_ext
import time
def keypoints_nms(multi_scores,
score_thr,
nms_cfg,
max_num=-1,
score_factors=None,
multi_poses=None,
nu... | 34.447674 | 142 | 0.566414 |
75b8c0d85ddf99c515c96fcc7a1bd13c32a99b6d | 5,663 | py | Python | echopype/convert/set_groups_base.py | imranmaj/echopype | b2b51334fad78086f0ccb52cd4ddba4ab4ecf40c | [
"Apache-2.0"
] | null | null | null | echopype/convert/set_groups_base.py | imranmaj/echopype | b2b51334fad78086f0ccb52cd4ddba4ab4ecf40c | [
"Apache-2.0"
] | null | null | null | echopype/convert/set_groups_base.py | imranmaj/echopype | b2b51334fad78086f0ccb52cd4ddba4ab4ecf40c | [
"Apache-2.0"
] | null | null | null | import pynmea2
from datetime import datetime as dt
import xarray as xr
import numpy as np
import zarr
from _echopype_version import version as ECHOPYPE_VERSION
COMPRESSION_SETTINGS = {
'netcdf4': {'zlib': True, 'complevel': 4},
'zarr': {'compressor': zarr.Blosc(cname='zstd', clevel=3, shuffle=2)}
}
DEFAULT_CH... | 39.880282 | 113 | 0.562246 |
8d03b354b2b75149947d322255d7e6efa648ca13 | 139 | py | Python | ders2/ders2.py | mustafacavusoglu/Python-openCV | 5d7c9ef883b427ba60e3d83671ddea9f16b01ac9 | [
"MIT"
] | null | null | null | ders2/ders2.py | mustafacavusoglu/Python-openCV | 5d7c9ef883b427ba60e3d83671ddea9f16b01ac9 | [
"MIT"
] | null | null | null | ders2/ders2.py | mustafacavusoglu/Python-openCV | 5d7c9ef883b427ba60e3d83671ddea9f16b01ac9 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
resim = cv2.imread("ati.JPG")
cv2.imshow("resim",resim)
cv2.waitKey(0)
cv2.destroyAllWindows()
| 12.636364 | 30 | 0.676259 |
94b29f2f664176dc085b1d485dbf0c68b0b1763e | 14,890 | py | Python | apps/data_cube_manager/tasks.py | SANSA-DESA/data_cube_ui | 478a9bcce376a1bb347426df9e6520ddbafe907c | [
"Apache-2.0"
] | null | null | null | apps/data_cube_manager/tasks.py | SANSA-DESA/data_cube_ui | 478a9bcce376a1bb347426df9e6520ddbafe907c | [
"Apache-2.0"
] | null | null | null | apps/data_cube_manager/tasks.py | SANSA-DESA/data_cube_ui | 478a9bcce376a1bb347426df9e6520ddbafe907c | [
"Apache-2.0"
] | null | null | null | from django.conf import settings
from django.db import connections
from django.forms.models import model_to_dict
from django.db.models import Q
import celery
from celery.task import task
from celery import chain, group, chord
from celery.utils.log import get_task_logger
from celery.decorators import periodic_task
from... | 41.943662 | 162 | 0.72908 |
f8dd786f51eb0a70196617958958a7d5dc29b8c5 | 1,804 | py | Python | src/senor_octopus/sinks/tuya.py | betodealmeida/senor-octopus | 362d4cb8d5ac7fea620c2b4d46e807bb614a59bd | [
"MIT"
] | 7 | 2021-03-24T18:29:21.000Z | 2021-11-15T21:13:25.000Z | src/senor_octopus/sinks/tuya.py | betodealmeida/senor-octopus | 362d4cb8d5ac7fea620c2b4d46e807bb614a59bd | [
"MIT"
] | null | null | null | src/senor_octopus/sinks/tuya.py | betodealmeida/senor-octopus | 362d4cb8d5ac7fea620c2b4d46e807bb614a59bd | [
"MIT"
] | null | null | null | import logging
from functools import lru_cache
from senor_octopus.types import Stream
from tuyapy import TuyaApi
from typing_extensions import Literal
_logger = logging.getLogger(__name__)
@lru_cache(maxsize=None)
def authenticate(email: str, password: str, country: str, application: str) -> TuyaApi:
_logger.de... | 28.1875 | 87 | 0.641353 |
4c9a4cdb13935e71ddf10bf2cb9785bf9c5e89dd | 20,614 | py | Python | research/object_detection/python-tkinter-gui-master/GUITools/GraphicsWidgets/CoordinateSpace.py | r08in279/Traffic-Management-Using-Drones | 15fdba219cef04b3cb59a68901a8064c3795d8e3 | [
"Apache-2.0"
] | null | null | null | research/object_detection/python-tkinter-gui-master/GUITools/GraphicsWidgets/CoordinateSpace.py | r08in279/Traffic-Management-Using-Drones | 15fdba219cef04b3cb59a68901a8064c3795d8e3 | [
"Apache-2.0"
] | null | null | null | research/object_detection/python-tkinter-gui-master/GUITools/GraphicsWidgets/CoordinateSpace.py | r08in279/Traffic-Management-Using-Drones | 15fdba219cef04b3cb59a68901a8064c3795d8e3 | [
"Apache-2.0"
] | null | null | null | from .Shared import *
from .Canvas3D import Canvas3D as Canvas3D
from .ActionBuffer import ActionBuffer as ActionBuffer
#$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$
class CoordinateSpace(Canvas3D):
shapeFlattener=LinAlg.Flattener(endtype='gen',dontExpand=(Shape,str))
addFlatte... | 37.008977 | 111 | 0.438391 |
3106a027add2c1389e00ac568ef70311d60697c5 | 26,378 | py | Python | tests/mobly/controllers/android_device_lib/services/logcat_test.py | northwhisper/mobly | 2af367e486d8aa0e0a587d87367ea101df3030ab | [
"Apache-2.0"
] | null | null | null | tests/mobly/controllers/android_device_lib/services/logcat_test.py | northwhisper/mobly | 2af367e486d8aa0e0a587d87367ea101df3030ab | [
"Apache-2.0"
] | null | null | null | tests/mobly/controllers/android_device_lib/services/logcat_test.py | northwhisper/mobly | 2af367e486d8aa0e0a587d87367ea101df3030ab | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 47.872958 | 84 | 0.656797 |
7fa9d500226dd0bafe2837075d705ecfe3c22fe5 | 4,770 | py | Python | src/dxtbx/format/FormatHDF5Lambda.py | toastisme/dxtbx | fc24e215a8052e7e17be4ad4b41f9dbb474d852a | [
"BSD-3-Clause"
] | null | null | null | src/dxtbx/format/FormatHDF5Lambda.py | toastisme/dxtbx | fc24e215a8052e7e17be4ad4b41f9dbb474d852a | [
"BSD-3-Clause"
] | null | null | null | src/dxtbx/format/FormatHDF5Lambda.py | toastisme/dxtbx | fc24e215a8052e7e17be4ad4b41f9dbb474d852a | [
"BSD-3-Clause"
] | null | null | null | """
Experimental format for the X-Spectrum LAMBDA detector
http://www.x-spectrum.de/
"""
import sys
import h5py
from cctbx.eltbx import attenuation_coefficient
from scitbx import matrix
from scitbx.array_family import flex
from dxtbx.format.Format import Format
from dxtbx.format.FormatHDF5 import FormatHDF5
from d... | 29.444444 | 82 | 0.60608 |
00f527388f7a6ee2f39ab62c0aacff3b8d31dc60 | 552 | py | Python | DjangoSignUP/MySignUpApp/migrations/0001_initial.py | RATHINAMOORTHY/Django_SignUp_Project | 294661ac5809bbd37d5bd02dae6305976e202d93 | [
"MIT"
] | null | null | null | DjangoSignUP/MySignUpApp/migrations/0001_initial.py | RATHINAMOORTHY/Django_SignUp_Project | 294661ac5809bbd37d5bd02dae6305976e202d93 | [
"MIT"
] | null | null | null | DjangoSignUP/MySignUpApp/migrations/0001_initial.py | RATHINAMOORTHY/Django_SignUp_Project | 294661ac5809bbd37d5bd02dae6305976e202d93 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.1 on 2019-06-29 19:02
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='UsersModel',
fields=[
('id', models.AutoFie... | 24 | 114 | 0.574275 |
44b97173ddbd57a0714e402c942529880955945c | 1,621 | py | Python | userbot/modules/covid.py | NaomiFutaba01/One4uBot | 3a390d31170ffa368b6e4b3e7a2256ae9ead9291 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/covid.py | NaomiFutaba01/One4uBot | 3a390d31170ffa368b6e4b3e7a2256ae9ead9291 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/covid.py | NaomiFutaba01/One4uBot | 3a390d31170ffa368b6e4b3e7a2256ae9ead9291 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | 2 | 2020-03-18T06:04:39.000Z | 2020-04-08T13:14:46.000Z | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
# Port to UserBot by @MoveAngel
from datetime import datetime
from covid import Covid
from userbot import CMD_HELP
fro... | 42.657895 | 117 | 0.664405 |
edccc69a9917b0607e75af22f25182fae2b91bd0 | 525 | py | Python | reader/migrations/0016_auto_20180312_1423.py | Kadantte/comicake | 205f327b920cbfdec86e57034d98a42f335d64ee | [
"ISC"
] | 18 | 2018-05-01T04:56:37.000Z | 2022-03-27T16:11:57.000Z | reader/migrations/0016_auto_20180312_1423.py | Kadantte/comicake | 205f327b920cbfdec86e57034d98a42f335d64ee | [
"ISC"
] | 32 | 2018-06-08T06:29:35.000Z | 2022-03-11T23:32:21.000Z | reader/migrations/0016_auto_20180312_1423.py | Kadantte/comicake | 205f327b920cbfdec86e57034d98a42f335d64ee | [
"ISC"
] | 13 | 2018-04-25T20:14:01.000Z | 2021-12-12T10:02:05.000Z | # Generated by Django 2.0.2 on 2018-03-12 21:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('reader', '0015_auto_20180312_1418'),
]
operations = [
migrations.RemoveField(
model_name='chapter',
name='slug',
... | 22.826087 | 91 | 0.580952 |
03a37cee0c04c89b65fcd8ee86583889a4914747 | 1,788 | py | Python | galaxy/main/migrations/0133_collection_tasks.py | bmclaughlin/galaxy | 3f57e3684c27cb88d45881eaec16dc3095ac4e6d | [
"Apache-2.0"
] | 904 | 2016-10-11T13:35:19.000Z | 2022-03-25T09:29:09.000Z | galaxy/main/migrations/0133_collection_tasks.py | bmclaughlin/galaxy | 3f57e3684c27cb88d45881eaec16dc3095ac4e6d | [
"Apache-2.0"
] | 1,866 | 2016-10-15T21:28:09.000Z | 2022-03-29T18:09:20.000Z | galaxy/main/migrations/0133_collection_tasks.py | bmclaughlin/galaxy | 3f57e3684c27cb88d45881eaec16dc3095ac4e6d | [
"Apache-2.0"
] | 368 | 2016-10-11T13:44:08.000Z | 2022-03-30T02:23:12.000Z | from django.contrib.postgres import fields as psql_fields
from django.db import migrations
from django.db import models
class Migration(migrations.Migration):
dependencies = [
('pulp_app', '0002_task_name'),
('main', '0132_update_collecion_scores'),
]
operations = [
migrations.Cre... | 34.384615 | 70 | 0.506711 |
122cd7f483a80960c9a23fc31e89de467e20a4ed | 3,969 | py | Python | tensorflow/python/saved_model/function_serialization.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/saved_model/function_serialization.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | tensorflow/python/saved_model/function_serialization.py | uve/tensorflow | e08079463bf43e5963acc41da1f57e95603f8080 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 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... | 45.102273 | 100 | 0.761401 |
c78d22d99bd240f72adde91eba6de9755771dab0 | 655 | py | Python | users/permissions.py | LucasSRocha/CashBack_GB | 184f124bfcbd0c18472980a88bd95c0652a86e2f | [
"MIT"
] | null | null | null | users/permissions.py | LucasSRocha/CashBack_GB | 184f124bfcbd0c18472980a88bd95c0652a86e2f | [
"MIT"
] | 1 | 2020-06-30T07:44:53.000Z | 2020-06-30T07:44:53.000Z | users/permissions.py | LucasSRocha/CashBack_GB | 184f124bfcbd0c18472980a88bd95c0652a86e2f | [
"MIT"
] | null | null | null | from rest_framework.permissions import BasePermission
class IsAdminOrSelf(BasePermission):
"""
Allow access to admin users or the user himself.
"""
def has_object_permission(self, request, view, obj):
if request.user and request.user.is_staff or request.user.is_superuser:
return T... | 29.772727 | 86 | 0.676336 |
fa15f4707b92e2a18f65cb988016b110d1325537 | 4,736 | py | Python | scripts/viralrecall_qc.py | Achuan-2/ncldv_recover | c975a93c8781ef54414c6f06f3647b7b53b0b6f2 | [
"MIT"
] | 1 | 2022-03-29T14:09:19.000Z | 2022-03-29T14:09:19.000Z | scripts/viralrecall_qc.py | Achuan-2/ncldv_recover | c975a93c8781ef54414c6f06f3647b7b53b0b6f2 | [
"MIT"
] | null | null | null | scripts/viralrecall_qc.py | Achuan-2/ncldv_recover | c975a93c8781ef54414c6f06f3647b7b53b0b6f2 | [
"MIT"
] | null | null | null |
#!/usr/bin/env python3
"""
viralrecall 质检标准
* 剔除污染的contig:只保留score > 0 & num_viralhits >3 & contig_length > 5000 过滤 bin.fa 文件中的contig
* 剔除污染contig后,只保留总大小超过 100 kb & mean score >1 & marker gene hit有3个及以上或要有mcp基因的bin
"""
import pandas as pd
import os.path
import argparse
def main(project, output):
infer_NCLDV_nu... | 34.318841 | 153 | 0.600929 |
ee63b91cf836019ec4abb6e6d7214d27c2db4ec1 | 2,086 | py | Python | api/base/urls.py | DanielSBrown/osf.io | 98dda2ac237377197acacce78274bc0a4ce8f303 | [
"Apache-2.0"
] | null | null | null | api/base/urls.py | DanielSBrown/osf.io | 98dda2ac237377197acacce78274bc0a4ce8f303 | [
"Apache-2.0"
] | null | null | null | api/base/urls.py | DanielSBrown/osf.io | 98dda2ac237377197acacce78274bc0a4ce8f303 | [
"Apache-2.0"
] | null | null | null | from django.conf import settings
from django.conf.urls import include, url
from django.conf.urls.static import static
from django.views.generic.base import RedirectView
from settings import API_BASE
from . import views
base_pattern = '^{}'.format(API_BASE)
urlpatterns = [
url(base_pattern,
include(
... | 48.511628 | 102 | 0.603068 |
8c5a3c0bc6e668510a5bfdc237733505091f31f9 | 1,542 | py | Python | pychron/dvc/tasks/__init__.py | WiscAr/pychron | 8d335d53ba7a5fc70760d9a7cb60540ad169ae84 | [
"Apache-2.0"
] | 1 | 2019-02-27T21:57:44.000Z | 2019-02-27T21:57:44.000Z | pychron/dvc/tasks/__init__.py | WiscAr/pychron | 8d335d53ba7a5fc70760d9a7cb60540ad169ae84 | [
"Apache-2.0"
] | 80 | 2018-07-17T20:10:20.000Z | 2021-08-17T15:38:24.000Z | pychron/dvc/tasks/__init__.py | AGESLDEO/pychron | 1a81e05d9fba43b797f335ceff6837c016633bcf | [
"Apache-2.0"
] | null | null | null | # ===============================================================================
# Copyright 2015 Jake Ross
#
# 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... | 32.125 | 81 | 0.533722 |
5f80e255ef2cd9511e9341aa620d4d715a8dec11 | 8,248 | py | Python | shap/datasets.py | llja0112/shap | 00631d3f2bf8eb045ca3f3bf0f972b2c796adab6 | [
"MIT"
] | 2 | 2019-01-18T14:59:11.000Z | 2020-01-02T21:09:31.000Z | shap/datasets.py | Pacmed/shap | cc90a0b17f62a5a446a7b631cbc123a04d143e15 | [
"MIT"
] | null | null | null | shap/datasets.py | Pacmed/shap | cc90a0b17f62a5a446a7b631cbc123a04d143e15 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import sklearn.datasets
import os
try:
from urllib.request import urlretrieve
except ImportError:
from urllib import urlretrieve
github_data_url = "https://github.com/slundberg/shap/raw/master/data/"
def imagenet50(display=False, resolution=224):
""" This is a set o... | 33.803279 | 123 | 0.647066 |
6cad0041a4b3c9444b7d4259871485d4608aea64 | 13,363 | py | Python | examples/moleculardynamics/freenrg/freenrg.py | radical-cybertools/BigJobAsync | 190540c61dd00dc538ece189ba858ce9bbc0d5ae | [
"MIT"
] | null | null | null | examples/moleculardynamics/freenrg/freenrg.py | radical-cybertools/BigJobAsync | 190540c61dd00dc538ece189ba858ce9bbc0d5ae | [
"MIT"
] | null | null | null | examples/moleculardynamics/freenrg/freenrg.py | radical-cybertools/BigJobAsync | 190540c61dd00dc538ece189ba858ce9bbc0d5ae | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""This example illustrates how to run free energy calculations with Amber
MMPBSA.py for N replicas.
"""
__author__ = "Ole Weidner"
__email__ = "ole.weidner@rutgers.edu"
__copyright__ = "Copyright 2013-2014, The RADICAL Project at Rutgers"
__license__ = "MIT"
import os, sys, uuid
impo... | 33.916244 | 126 | 0.493826 |
a3d0951ead94f48cac70dc2278c36104561bd701 | 13,194 | py | Python | src/systems/coref_system.py | norikinishida/CoreferenceResolution | 5334cc4953d76ed6358bf8124df54803569f09ac | [
"Apache-2.0"
] | null | null | null | src/systems/coref_system.py | norikinishida/CoreferenceResolution | 5334cc4953d76ed6358bf8124df54803569f09ac | [
"Apache-2.0"
] | null | null | null | src/systems/coref_system.py | norikinishida/CoreferenceResolution | 5334cc4953d76ed6358bf8124df54803569f09ac | [
"Apache-2.0"
] | null | null | null | import random
import numpy as np
import torch
import utils
import models
class CorefSystem:
def __init__(self, device, config):
"""
Parameters
----------
device: str
config: utils.Config
"""
self.device = device
self.config = config
# In... | 43.117647 | 138 | 0.585797 |
dd4d1cf2a47e3ca66f99e6881664cabc51487712 | 3,008 | py | Python | python/tests/test_convert.py | rommelDB/custrings | 7fd21afb7af300d06aeb21553ea49508fd79b828 | [
"Apache-2.0"
] | null | null | null | python/tests/test_convert.py | rommelDB/custrings | 7fd21afb7af300d06aeb21553ea49508fd79b828 | [
"Apache-2.0"
] | null | null | null | python/tests/test_convert.py | rommelDB/custrings | 7fd21afb7af300d06aeb21553ea49508fd79b828 | [
"Apache-2.0"
] | null | null | null | #
import nvstrings
import numpy as np
#
from librmm_cffi import librmm as rmm
from librmm_cffi import librmm_config as rmm_cfg
rmm_cfg.use_pool_allocator = True
rmm.initialize()
#
s = nvstrings.to_device(["1234","5678","90",None,"-876","543.2","-0.12",".55","-.002","","de","abc123","123abc"])
print(s)
#
print(".stoi(... | 29.490196 | 113 | 0.705785 |
4384fe9174f31515876ad5ee91f09d87cac9b5dd | 1,333 | py | Python | src/advertisingapp/forms.py | robertsmoto/sodavault | 200e843be7abe6cc447647bba55c7c1309092e5e | [
"BSD-3-Clause"
] | null | null | null | src/advertisingapp/forms.py | robertsmoto/sodavault | 200e843be7abe6cc447647bba55c7c1309092e5e | [
"BSD-3-Clause"
] | null | null | null | src/advertisingapp/forms.py | robertsmoto/sodavault | 200e843be7abe6cc447647bba55c7c1309092e5e | [
"BSD-3-Clause"
] | null | null | null | from dal import autocomplete
from django import forms
from .models import Campaign, Banner
class CampaignForm(forms.ModelForm):
class Meta:
model = Campaign
fields = ('__all__')
# class AssettForm(forms.ModelForm):
# campaign = forms.ModelChoiceField(
# queryset=Assett.objects.all(),... | 28.361702 | 82 | 0.549137 |
7bd858bfafab19e41d73a903ffea26c9c2c1d48e | 3,330 | py | Python | subcmds/cherry_pick.py | kimi98-2020/git-repo | 63df80ccefe364c6794e049f98e2db5ce61bb623 | [
"Apache-2.0"
] | 168 | 2017-07-05T04:26:54.000Z | 2022-03-27T06:34:29.000Z | subcmds/cherry_pick.py | kimi98-2020/git-repo | 63df80ccefe364c6794e049f98e2db5ce61bb623 | [
"Apache-2.0"
] | 2 | 2020-09-06T17:25:29.000Z | 2021-04-16T09:55:20.000Z | subcmds/cherry_pick.py | kimi98-2020/git-repo | 63df80ccefe364c6794e049f98e2db5ce61bb623 | [
"Apache-2.0"
] | 107 | 2020-02-02T14:54:37.000Z | 2022-03-22T07:40:47.000Z | # Copyright (C) 2010 The Android Open Source Project
#
# 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 ... | 30 | 78 | 0.633033 |
c67f21576460156119984b01313da4e5236a5478 | 384 | py | Python | src/tools/PdfTools.py | Potato-DiGua/Tools | 1e0dc6c115f665560cf4e254f35a9b8e1d4e0d02 | [
"MIT"
] | null | null | null | src/tools/PdfTools.py | Potato-DiGua/Tools | 1e0dc6c115f665560cf4e254f35a9b8e1d4e0d02 | [
"MIT"
] | null | null | null | src/tools/PdfTools.py | Potato-DiGua/Tools | 1e0dc6c115f665560cf4e254f35a9b8e1d4e0d02 | [
"MIT"
] | null | null | null | from typing import List
from PyPDF2 import PdfFileMerger
def merge_pdf(pdf_path: List[str], output_path: str):
files = [item for item in pdf_path if str(item).endswith(".pdf")]
file_merger = PdfFileMerger()
for pdf in files:
file_merger.append(pdf) # 合并pdf文件
file_merger.write(output_path)... | 24 | 69 | 0.664063 |
ec7373cbc58562d98818bb149e6302c820b3c181 | 2,345 | py | Python | starthinker_airflow/dags/sheets_copy_dag.py | RMStanford/starthinker | 0a2df38bebb9d089bf91b6df01598d11a354eed3 | [
"Apache-2.0"
] | null | null | null | starthinker_airflow/dags/sheets_copy_dag.py | RMStanford/starthinker | 0a2df38bebb9d089bf91b6df01598d11a354eed3 | [
"Apache-2.0"
] | null | null | null | starthinker_airflow/dags/sheets_copy_dag.py | RMStanford/starthinker | 0a2df38bebb9d089bf91b6df01598d11a354eed3 | [
"Apache-2.0"
] | null | null | null | ###########################################################################
#
# Copyright 2019 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org... | 10.330396 | 86 | 0.495096 |
65a7e2d26539ac65bff28008bed6eb5d7ded799f | 6,039 | py | Python | micron/extraFunctions.py | zhengyang-c/photonLauncher | 76215f47ccd1178f1826834533f5702c4b8f2c35 | [
"Apache-2.0"
] | 6 | 2015-11-26T15:03:38.000Z | 2020-10-05T14:08:54.000Z | micron/extraFunctions.py | zhengyang-c/photonLauncher | 76215f47ccd1178f1826834533f5702c4b8f2c35 | [
"Apache-2.0"
] | 7 | 2015-12-09T06:44:34.000Z | 2021-12-14T15:51:28.000Z | micron/extraFunctions.py | zhengyang-c/photonLauncher | 76215f47ccd1178f1826834533f5702c4b8f2c35 | [
"Apache-2.0"
] | 3 | 2016-07-25T10:43:21.000Z | 2021-12-07T14:12:47.000Z | #!/usr/bin/env python3
import sys
def query_yes_no(question, default="yes"):
"""Ask a yes/no question via raw_input() and return their answer.
"question" is a string that is presented to the user.
"default" is the presumed answer if the user just hits <Enter>.
It must be "yes" (the default), "no"... | 32.643243 | 103 | 0.60871 |
a041bc558de06f3da834984e9cc22b002b5a2c8e | 2,749 | py | Python | python2.7/site-packages/twisted/words/test/test_jabberjid.py | 84KaliPleXon3/sslstrip-hsts-openwrt | f875ded48078a3ed84bffef1e69dcbeaf2e77ae3 | [
"MIT"
] | 4 | 2020-10-31T19:52:05.000Z | 2021-09-22T11:39:27.000Z | python2.7/site-packages/twisted/words/test/test_jabberjid.py | 84KaliPleXon3/sslstrip-hsts-openwrt | f875ded48078a3ed84bffef1e69dcbeaf2e77ae3 | [
"MIT"
] | null | null | null | python2.7/site-packages/twisted/words/test/test_jabberjid.py | 84KaliPleXon3/sslstrip-hsts-openwrt | f875ded48078a3ed84bffef1e69dcbeaf2e77ae3 | [
"MIT"
] | 2 | 2020-02-27T08:28:35.000Z | 2020-09-13T12:39:26.000Z | # Copyright (c) 2001-2005 Twisted Matrix Laboratories.
# See LICENSE for details.
from twisted.trial import unittest
from twisted.words.protocols.jabber import jid
class JIDParsingTest(unittest.TestCase):
def testParse(self):
# Basic forms
self.assertEquals(jid.parse("user@host/resource"),
... | 33.52439 | 66 | 0.504547 |
b0dd2218187a5459d1e744274981259433bfa75c | 1,522 | py | Python | ch2/plotmap.py | gili-Katagiri/ep-PML2nd | e32ac199a87b10d63d510860ef5f687254b3e0c5 | [
"MIT"
] | null | null | null | ch2/plotmap.py | gili-Katagiri/ep-PML2nd | e32ac199a87b10d63d510860ef5f687254b3e0c5 | [
"MIT"
] | null | null | null | ch2/plotmap.py | gili-Katagiri/ep-PML2nd | e32ac199a87b10d63d510860ef5f687254b3e0c5 | [
"MIT"
] | null | null | null | import numpy as np
from matplotlib.colors import ListedColormap
def plot_decision_regions(X, y, classifier, ax, resolution=0.02):
markers = ('s','x','o','^','v')
colors = ('red','blue','lightgreen','gray','cyan')
cmap = ListedColormap( colors[:len(np.unique(y))] )
x1_min, x1_max = X[:,0].min()-1, X[:... | 29.843137 | 106 | 0.581472 |
f1a380e7e75e569a0c60e09a52694223ae2b5da8 | 2,742 | py | Python | keystone/routers.py | ioram7/keystone | 81b5ad22cc8b85d622a332e62e5c4cb63155b654 | [
"Apache-2.0"
] | 6 | 2016-08-06T09:00:17.000Z | 2021-10-21T23:12:47.000Z | keystone/routers.py | ioram7/keystone | 81b5ad22cc8b85d622a332e62e5c4cb63155b654 | [
"Apache-2.0"
] | 1 | 2021-02-23T10:29:49.000Z | 2021-02-23T10:29:49.000Z | keystone/routers.py | ioram7/keystone | 81b5ad22cc8b85d622a332e62e5c4cb63155b654 | [
"Apache-2.0"
] | 10 | 2016-04-25T20:10:06.000Z | 2021-06-10T15:14:19.000Z | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2012 OpenStack LLC
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requ... | 33.851852 | 78 | 0.66229 |
9367c0382549c7a02f49b4a0cc5b2d4e93cdf2e3 | 13,084 | py | Python | tv-script-generation/problem_unittests.py | sunsided/DLND | cf2f449e262dadba798bb35cb3d717d1d8a18d59 | [
"MIT"
] | null | null | null | tv-script-generation/problem_unittests.py | sunsided/DLND | cf2f449e262dadba798bb35cb3d717d1d8a18d59 | [
"MIT"
] | null | null | null | tv-script-generation/problem_unittests.py | sunsided/DLND | cf2f449e262dadba798bb35cb3d717d1d8a18d59 | [
"MIT"
] | null | null | null | import numpy as np
import tensorflow as tf
from tensorflow.contrib import rnn
def _print_success_message():
print('Tests Passed')
def test_create_lookup_tables(create_lookup_tables):
with tf.Graph().as_default():
test_text = '''
Moe_Szyslak Moe's Tavern Where the elite meet to drink
... | 41.801917 | 153 | 0.648731 |
a83245f90aea384ca5e6853be54bd8442f565da4 | 1,973 | py | Python | ros2_control_demo_robot/launch/test_rrbot_description.launch.py | nuclearsandwich/ros2_control_demos | ecb96f53fef4b2185383207311cd3162be1ccd5b | [
"Apache-2.0"
] | null | null | null | ros2_control_demo_robot/launch/test_rrbot_description.launch.py | nuclearsandwich/ros2_control_demos | ecb96f53fef4b2185383207311cd3162be1ccd5b | [
"Apache-2.0"
] | null | null | null | ros2_control_demo_robot/launch/test_rrbot_description.launch.py | nuclearsandwich/ros2_control_demos | ecb96f53fef4b2185383207311cd3162be1ccd5b | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Stogl Robotics Consulting UG (haftungsbeschränkt)
#
# 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 ap... | 30.353846 | 84 | 0.708059 |
ff543d1bb7eed8a3689e9febf67760b97d77e162 | 4,866 | py | Python | sdk/python/pulumi_azure_nextgen/network/latest/get_virtual_appliance_site.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/network/latest/get_virtual_appliance_site.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/network/latest/get_virtual_appliance_site.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union
from ... import _utilities, _tables
from... | 36.313433 | 153 | 0.660912 |
5839ffafa4d2911e3f30bffe975b40a341b3a353 | 4,422 | py | Python | weibo_api/weibo/article.py | ludawei/weibo_api | d64589d707181b002128f035b1e24e433dcb79e7 | [
"MIT"
] | null | null | null | weibo_api/weibo/article.py | ludawei/weibo_api | d64589d707181b002128f035b1e24e433dcb79e7 | [
"MIT"
] | null | null | null | weibo_api/weibo/article.py | ludawei/weibo_api | d64589d707181b002128f035b1e24e433dcb79e7 | [
"MIT"
] | null | null | null | # coding=utf-8
from __future__ import absolute_import
from __future__ import unicode_literals
import math
from ..utils.normal import normal_attr
from ..utils.streaming import streaming
from .base import Base
from ..config.urls import (
ARTICLE_DETAIL_URL,
ARTICLE_LIST_URL)
class Article(Base):
"""
头条文... | 22.676923 | 91 | 0.550204 |
5c7e873ce454aaee5367592647adef76bdd196ad | 8,721 | py | Python | app/MgrListener/MgrListener.py | rgrr/smartmeshsdk | a95f3e4d9e2254d59d326428fef8c77319cd4373 | [
"BSD-3-Clause"
] | 29 | 2015-02-17T14:22:14.000Z | 2021-02-19T06:01:10.000Z | app/MgrListener/MgrListener.py | rgrr/smartmeshsdk | a95f3e4d9e2254d59d326428fef8c77319cd4373 | [
"BSD-3-Clause"
] | 17 | 2017-02-10T09:43:13.000Z | 2017-09-09T05:46:49.000Z | app/MgrListener/MgrListener.py | rgrr/smartmeshsdk | a95f3e4d9e2254d59d326428fef8c77319cd4373 | [
"BSD-3-Clause"
] | 35 | 2015-07-10T18:58:15.000Z | 2022-03-20T08:56:25.000Z | #!/usr/bin/python
#============================ adjust path =====================================
import sys
import os
if __name__ == "__main__":
here = sys.path[0]
sys.path.insert(0, os.path.join(here, '..', '..','libs'))
sys.path.insert(0, os.path.join(here, '..', '..','external_libs'))
#===... | 32.785714 | 81 | 0.469212 |
7125f29a5ac916ff8405e45ce77f524e31bf2fbb | 5,655 | py | Python | main_ann_ae.py | cmranieri/FullySpikingVAE | c59e7e704f55246dd2e9891964259d2e611917fa | [
"MIT"
] | 14 | 2021-10-05T06:28:06.000Z | 2022-03-29T08:41:50.000Z | main_ann_ae.py | cmranieri/FullySpikingVAE | c59e7e704f55246dd2e9891964259d2e611917fa | [
"MIT"
] | null | null | null | main_ann_ae.py | cmranieri/FullySpikingVAE | c59e7e704f55246dd2e9891964259d2e611917fa | [
"MIT"
] | 4 | 2021-10-05T08:57:45.000Z | 2022-03-27T21:36:56.000Z | import os
import os.path
import numpy as np
import logging
import argparse
import pycuda.driver as cuda
import torch
import torchvision
from torch.nn.utils import clip_grad_norm_
from torch.nn.utils import clip_grad_value_
from torch.utils.tensorboard import SummaryWriter
from utils import AverageMeter
from utils imp... | 36.483871 | 123 | 0.662069 |
a71f702db5ae949deaecd3a7e99b5f37c48944c2 | 22,805 | py | Python | scripts/tvm_cli/tvm_cli.py | Interplai/modelzoo | 45829048b708b9fb9c6d8d13912ae44f184710de | [
"Apache-2.0"
] | null | null | null | scripts/tvm_cli/tvm_cli.py | Interplai/modelzoo | 45829048b708b9fb9c6d8d13912ae44f184710de | [
"Apache-2.0"
] | null | null | null | scripts/tvm_cli/tvm_cli.py | Interplai/modelzoo | 45829048b708b9fb9c6d8d13912ae44f184710de | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python3
#
# Copyright (c) 2020-2021, Arm Limited and Contributors. All rights reserved.
#
# SPDX-License-Identifier: Apache-2.0
#
import os
import sys
from os import path
import importlib
import onnx
import yaml
import tvm
import tvm.relay.testing.tf as tf_testing
import tvm.contrib.graph_runtime as ru... | 41.998158 | 84 | 0.562114 |
ef8a00fa155a261fcb3abb7f68a1244711abed6e | 10,340 | py | Python | experiments/gps-position-precision/main.py | aerospaceresearch/thebeacon | b5ce284633696563eea9ce6d9e52a119a0261a09 | [
"MIT"
] | null | null | null | experiments/gps-position-precision/main.py | aerospaceresearch/thebeacon | b5ce284633696563eea9ce6d9e52a119a0261a09 | [
"MIT"
] | null | null | null | experiments/gps-position-precision/main.py | aerospaceresearch/thebeacon | b5ce284633696563eea9ce6d9e52a119a0261a09 | [
"MIT"
] | null | null | null | import time
import datetime
import numpy as np
import matplotlib.pylab as plt
def transform_coordinate_geo2earthcentered(long, lat, altitude):
radius = altitude + 6371000.0
x = radius * np.cos(lat * np.pi/180) * np.sin(long * np.pi/180)
y = radius * np.cos(lat * np.pi/180) * np.cos(long * np.pi/180)
z... | 32.618297 | 143 | 0.511992 |
fd4cae1f49f088edf395ca54bed1f1a8695bcde8 | 11,190 | py | Python | bitmovin_api_sdk/models/prewarmed_encoder_pool.py | bitmovin/bitmovin-api-sdk-python | 5a85147669c84b8ca411cf2d4dbdddc92d85bbe7 | [
"MIT"
] | 11 | 2019-07-03T10:41:16.000Z | 2022-02-25T21:48:06.000Z | bitmovin_api_sdk/models/prewarmed_encoder_pool.py | bitmovin/bitmovin-api-sdk-python | 5a85147669c84b8ca411cf2d4dbdddc92d85bbe7 | [
"MIT"
] | 8 | 2019-11-23T00:01:25.000Z | 2021-04-29T12:30:31.000Z | bitmovin_api_sdk/models/prewarmed_encoder_pool.py | bitmovin/bitmovin-api-sdk-python | 5a85147669c84b8ca411cf2d4dbdddc92d85bbe7 | [
"MIT"
] | 13 | 2020-01-02T14:58:18.000Z | 2022-03-26T12:10:30.000Z | # coding: utf-8
from enum import Enum
from six import string_types, iteritems
from bitmovin_api_sdk.common.poscheck import poscheck_model
from bitmovin_api_sdk.models.bitmovin_resource import BitmovinResource
from bitmovin_api_sdk.models.cloud_region import CloudRegion
from bitmovin_api_sdk.models.prewarmed_encoder_di... | 36.449511 | 192 | 0.644325 |
04f72bb46c5e989433037e9b7c2e33359066e43f | 8,499 | py | Python | starthinker_ui/recipe/views.py | wunderkennd/starthinker | ec66e02d26e5636a55ecb56803a7cec638629ace | [
"Apache-2.0"
] | null | null | null | starthinker_ui/recipe/views.py | wunderkennd/starthinker | ec66e02d26e5636a55ecb56803a7cec638629ace | [
"Apache-2.0"
] | 1 | 2021-06-18T14:54:19.000Z | 2021-06-18T14:54:19.000Z | starthinker_ui/recipe/views.py | isabella232/starthinker | d6bbecce5ef4a543fa2a19ce981c3381061e003a | [
"Apache-2.0"
] | null | null | null | ###########################################################################
#
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/l... | 31.594796 | 94 | 0.66902 |
d61bf370917c8dd0c1de1413977977bd1c67fbb2 | 3,747 | py | Python | lib/galaxy/webapps/galaxy/api/roles.py | ramezrawas/galaxy-1 | c03748dd49c060a68d07bce56eae33e0ba154414 | [
"CC-BY-3.0"
] | 6 | 2018-11-03T22:43:35.000Z | 2022-02-15T17:51:33.000Z | lib/galaxy/webapps/galaxy/api/roles.py | igorhollaender/OBSOLETE_sirv_dashboard | 85aec60b80ef6f561d89398e3da5963d3d0f2aa4 | [
"CC-BY-3.0"
] | 7 | 2016-12-07T22:19:37.000Z | 2019-01-30T15:04:26.000Z | lib/galaxy/webapps/galaxy/api/roles.py | igorhollaender/OBSOLETE_sirv_dashboard | 85aec60b80ef6f561d89398e3da5963d3d0f2aa4 | [
"CC-BY-3.0"
] | 10 | 2017-04-10T21:40:22.000Z | 2022-02-21T16:50:10.000Z | """
API operations on Role objects.
"""
import logging
from sqlalchemy import false
from galaxy import web
from galaxy.web.base.controller import BaseAPIController, url_for
log = logging.getLogger( __name__ )
class RoleAPIController( BaseAPIController ):
@web.expose_api
def index( self, trans, **kwd ):
... | 39.861702 | 125 | 0.611156 |
e8208e300a13a11bd6201515d77e60fcaf4eb0cb | 10,551 | py | Python | src/sentry/web/frontend/admin.py | E-LLP/sentry | 83d97a0ca45cdaac1d5f3026058131a3aeae0068 | [
"BSD-3-Clause"
] | 4 | 2016-03-16T07:21:36.000Z | 2017-09-04T07:29:56.000Z | src/sentry/web/frontend/admin.py | mitsuhiko/sentry | cddc3b643a13b52ac6d07ff22e4bd5d69ecbad90 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/web/frontend/admin.py | mitsuhiko/sentry | cddc3b643a13b52ac6d07ff22e4bd5d69ecbad90 | [
"BSD-3-Clause"
] | null | null | null | """
sentry.web.frontend.admin
~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import functools
import logging
import sys
import uuid
from collections import def... | 28.439353 | 102 | 0.633968 |
f11a04e343309920e0f53ea619f31b5d7dba063b | 5,281 | py | Python | api/core/geo_coordinate_service.py | arunrapolu4491/court-interpreter-scheduling | 17efcdf3a7fdd470c1991452a696a7bc640fd220 | [
"Apache-2.0"
] | null | null | null | api/core/geo_coordinate_service.py | arunrapolu4491/court-interpreter-scheduling | 17efcdf3a7fdd470c1991452a696a7bc640fd220 | [
"Apache-2.0"
] | null | null | null | api/core/geo_coordinate_service.py | arunrapolu4491/court-interpreter-scheduling | 17efcdf3a7fdd470c1991452a696a7bc640fd220 | [
"Apache-2.0"
] | null | null | null | import requests
import re
from fastapi import status, HTTPException
from core.config import settings
def get_geo(address, google_map):
if google_map == True:
url = settings.GOOGLE_MAP_URL.format(address)
else:
url = settings.OPENROAD_MAP_URL.format(address)
response = requests.get(... | 34.292208 | 130 | 0.603295 |
a2eb0946e7158ea57991509fec24df56300fa0bf | 1,051 | py | Python | cogs/jams.py | TDillman/wow_info_bot | 85ee0f0604bfce3968b3401ecac30e6cacd1086b | [
"Apache-2.0"
] | null | null | null | cogs/jams.py | TDillman/wow_info_bot | 85ee0f0604bfce3968b3401ecac30e6cacd1086b | [
"Apache-2.0"
] | null | null | null | cogs/jams.py | TDillman/wow_info_bot | 85ee0f0604bfce3968b3401ecac30e6cacd1086b | [
"Apache-2.0"
] | null | null | null | import os
import sys
import yaml
from youtube_api import YouTubeDataAPI
from discord.ext import commands
if not os.path.isfile("config.yaml"):
sys.exit("'config.yaml' not found! Please add it and try again.")
else:
with open("config.yaml") as file:
config = yaml.load(file, Loader=yaml.FullLoader)
yt ... | 27.657895 | 91 | 0.637488 |
bdd983761f955cdaafee9b59091ca36621b68934 | 27,633 | py | Python | sdk/python/pulumi_digitalocean/certificate.py | yitsushi/pulumi-digitalocean | 9d408e7e4a3bed2d9e7aa91a32e2f154706a3400 | [
"ECL-2.0",
"Apache-2.0"
] | 53 | 2019-04-25T14:43:12.000Z | 2022-03-14T15:51:44.000Z | sdk/python/pulumi_digitalocean/certificate.py | yitsushi/pulumi-digitalocean | 9d408e7e4a3bed2d9e7aa91a32e2f154706a3400 | [
"ECL-2.0",
"Apache-2.0"
] | 158 | 2019-04-15T21:47:18.000Z | 2022-03-29T21:21:57.000Z | sdk/python/pulumi_digitalocean/certificate.py | yitsushi/pulumi-digitalocean | 9d408e7e4a3bed2d9e7aa91a32e2f154706a3400 | [
"ECL-2.0",
"Apache-2.0"
] | 10 | 2019-04-15T20:16:11.000Z | 2021-05-28T19:08:32.000Z | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import ... | 41.931715 | 134 | 0.63388 |
58ad020800e4785ae1a23f7c1b192b77244aa272 | 62,315 | py | Python | pysnmp-with-texts/DGS-3620-28SC-DC-L2MGMT-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 8 | 2019-05-09T17:04:00.000Z | 2021-06-09T06:50:51.000Z | pysnmp-with-texts/DGS-3620-28SC-DC-L2MGMT-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 4 | 2019-05-31T16:42:59.000Z | 2020-01-31T21:57:17.000Z | pysnmp-with-texts/DGS-3620-28SC-DC-L2MGMT-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module DGS-3620-28SC-DC-L2MGMT-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/DGS-3620-28SC-DC-L2MGMT-MIB
# Produced by pysmi-0.3.4 at Wed May 1 12:44:27 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python versio... | 150.883777 | 6,495 | 0.779186 |
de2c7228ca227f2e7c68dc59fd9e80f020d5efba | 2,421 | py | Python | script.module.streamlink.base/resources/lib/streamlink/plugins/vrtbe.py | bobbybark/tantrumrepo | 1451c481254d3fedec9f430139d18db7312a9b1a | [
"Beerware"
] | 3 | 2020-03-03T13:21:44.000Z | 2021-07-21T09:53:31.000Z | script.module.streamlink.base/resources/lib/streamlink/plugins/vrtbe.py | eggman19/tantrumrepo | 1451c481254d3fedec9f430139d18db7312a9b1a | [
"Beerware"
] | null | null | null | script.module.streamlink.base/resources/lib/streamlink/plugins/vrtbe.py | eggman19/tantrumrepo | 1451c481254d3fedec9f430139d18db7312a9b1a | [
"Beerware"
] | 1 | 2018-08-30T20:04:34.000Z | 2018-08-30T20:04:34.000Z | import re
from streamlink.plugin import Plugin
from streamlink.plugin.api import http
from streamlink.plugin.api import validate
from streamlink.stream import HDSStream
from streamlink.stream import HLSStream
from streamlink.utils import parse_json
_url_re = re.compile(r'''https?://www\.vrt\.be/vrtnu/(?:kanalen/(?P<c... | 28.482353 | 91 | 0.584469 |
765d36958e18d120f3ab780bb837229d94d39b1a | 18,871 | py | Python | glumpy/app/viewport.py | Frekby/glumpy | 7a71151ac208766d9697737cb7978bb9d12aa243 | [
"BSD-3-Clause"
] | 1,074 | 2015-01-02T07:52:35.000Z | 2022-03-28T08:58:55.000Z | glumpy/app/viewport.py | Frekby/glumpy | 7a71151ac208766d9697737cb7978bb9d12aa243 | [
"BSD-3-Clause"
] | 273 | 2015-01-02T19:49:30.000Z | 2021-12-15T11:02:53.000Z | glumpy/app/viewport.py | Frekby/glumpy | 7a71151ac208766d9697737cb7978bb9d12aa243 | [
"BSD-3-Clause"
] | 206 | 2015-01-01T10:51:53.000Z | 2022-03-07T13:52:13.000Z | # -*- coding: utf-8 -*-
# -----------------------------------------------------------------------------
# Copyright (c) 2009-2016 Nicolas P. Rougier. All rights reserved.
# Distributed under the (new) BSD License.
# -----------------------------------------------------------------------------
"""
"""
from . window impo... | 30.986864 | 86 | 0.56971 |
a7cde93e6663ea44b5b62ed751b892ba7bd195e2 | 1,716 | py | Python | libs/python/config/boost.py | ZCube/boost-cmake | f1eca5534ab6c9bc89cf7ee4670f056503b7ba86 | [
"BSL-1.0"
] | 918 | 2016-12-22T02:53:08.000Z | 2022-03-22T06:21:35.000Z | libs/python/config/boost.py | ZCube/boost-cmake | f1eca5534ab6c9bc89cf7ee4670f056503b7ba86 | [
"BSL-1.0"
] | 203 | 2016-12-27T12:09:03.000Z | 2022-03-30T20:46:55.000Z | libs/python/config/boost.py | ZCube/boost-cmake | f1eca5534ab6c9bc89cf7ee4670f056503b7ba86 | [
"BSL-1.0"
] | 122 | 2016-12-22T17:38:09.000Z | 2022-02-22T14:25:49.000Z | #
# Copyright (c) 2016 Stefan Seefeld
# All rights reserved.
#
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or copy at
# http://www.boost.org/LICENSE_1_0.txt)
from . import ui
import os
def add_options(vars):
ui.add_option("--boost-prefix", dest="boost... | 37.304348 | 152 | 0.670163 |
e4f0fc47f6662bc1fb55741363ab0fa10b127821 | 5,407 | py | Python | src/pycture/dialogs/segments_input.py | miguel-martinr/Pycture | f174699f620244dd188cb1650e3455f553cb5090 | [
"MIT"
] | null | null | null | src/pycture/dialogs/segments_input.py | miguel-martinr/Pycture | f174699f620244dd188cb1650e3455f553cb5090 | [
"MIT"
] | 51 | 2021-10-06T02:40:17.000Z | 2022-01-13T12:45:43.000Z | src/pycture/dialogs/segments_input.py | miguel-martinr/Pycture | f174699f620244dd188cb1650e3455f553cb5090 | [
"MIT"
] | 1 | 2022-01-17T16:10:25.000Z | 2022-01-17T16:10:25.000Z | from typing import List
from PyQt5.QtWidgets import (QDialog, QLabel, QLineEdit, QMainWindow,
QPushButton, QVBoxLayout, QHBoxLayout,
QLayout, QSizePolicy, QWidget)
from PyQt5.QtCore import Qt, Signal
from matplotlib import pyplot as plt
from matplotlib.backends... | 38.347518 | 94 | 0.6597 |
2317286cc5fcbdb7def17604f904887594ccdcb4 | 132 | py | Python | 041-selfpower.py | johnsonZhaoxin/ProjectEuler | 74f3755d5f0e305897556b46515babe55429a834 | [
"MIT"
] | null | null | null | 041-selfpower.py | johnsonZhaoxin/ProjectEuler | 74f3755d5f0e305897556b46515babe55429a834 | [
"MIT"
] | null | null | null | 041-selfpower.py | johnsonZhaoxin/ProjectEuler | 74f3755d5f0e305897556b46515babe55429a834 | [
"MIT"
] | null | null | null | import math
def selfpower(x):
return pow(x,x)
sum = 0
for i in range(1,1001):
sum += selfpower(i) #为什么这样的数值类运算就很快
print(sum) | 18.857143 | 39 | 0.674242 |
3b0bf00303c04c8aed3d4b0d35a51a06b01905c1 | 3,424 | py | Python | tests/system/reliability/local_capacity/test_aggregate_local_capacity_contribution.py | souissim/gridpath | 4eeca2be24b485edc56026e38cfda83f4a6b27ea | [
"Apache-2.0"
] | null | null | null | tests/system/reliability/local_capacity/test_aggregate_local_capacity_contribution.py | souissim/gridpath | 4eeca2be24b485edc56026e38cfda83f4a6b27ea | [
"Apache-2.0"
] | null | null | null | tests/system/reliability/local_capacity/test_aggregate_local_capacity_contribution.py | souissim/gridpath | 4eeca2be24b485edc56026e38cfda83f4a6b27ea | [
"Apache-2.0"
] | 1 | 2021-12-21T20:44:21.000Z | 2021-12-21T20:44:21.000Z | # Copyright 2016-2020 Blue Marble Analytics LLC.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | 31.412844 | 87 | 0.690421 |
83421737e8131f411a5187bcc0308c61cd0afc90 | 3,746 | py | Python | doc/lib/attributes.py | jkrayl/cc-utils | f006650b6093e6cddc08906905e642d86962cb39 | [
"Apache-2.0"
] | null | null | null | doc/lib/attributes.py | jkrayl/cc-utils | f006650b6093e6cddc08906905e642d86962cb39 | [
"Apache-2.0"
] | null | null | null | doc/lib/attributes.py | jkrayl/cc-utils | f006650b6093e6cddc08906905e642d86962cb39 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2019 SAP SE or an SAP affiliate company. All rights reserved. This file is licensed
# under the Apache Software License, v. 2 except as noted otherwise in the LICENSE file
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the Licens... | 34.685185 | 99 | 0.626535 |
9d3da3159e9d12baef58966aaff0ff66b60bf0c7 | 10,392 | py | Python | scripts/check_code_format.py | mark-lunarg/Vulkan-ValidationLayers | fa0402e0556537045864e8784d86b3c14576081f | [
"Apache-2.0"
] | null | null | null | scripts/check_code_format.py | mark-lunarg/Vulkan-ValidationLayers | fa0402e0556537045864e8784d86b3c14576081f | [
"Apache-2.0"
] | null | null | null | scripts/check_code_format.py | mark-lunarg/Vulkan-ValidationLayers | fa0402e0556537045864e8784d86b3c14576081f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2020 Valve Corporation
# Copyright (c) 2020 LunarG, Inc.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.... | 47.022624 | 174 | 0.637895 |
1757b0a33948f3751ba222e0173f6b0281c93b99 | 6,974 | py | Python | tfx/orchestration/portable/mlmd/execution_lib_test.py | Jeffwan/tfx | efb3c78ac32f4c7c5979136aa0a11bffc287f236 | [
"Apache-2.0"
] | null | null | null | tfx/orchestration/portable/mlmd/execution_lib_test.py | Jeffwan/tfx | efb3c78ac32f4c7c5979136aa0a11bffc287f236 | [
"Apache-2.0"
] | null | null | null | tfx/orchestration/portable/mlmd/execution_lib_test.py | Jeffwan/tfx | efb3c78ac32f4c7c5979136aa0a11bffc287f236 | [
"Apache-2.0"
] | null | null | null | # Lint as: python3
# Copyright 2020 Google LLC. 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 ... | 33.690821 | 79 | 0.638084 |
bb110e03416be0f3d4df56493139d785b80b30b1 | 2,388 | py | Python | telebot.py | pun1sh3r/tele_bot | 7f4ac8651c5f3396294c467e83ea89497f9e9f05 | [
"MIT"
] | null | null | null | telebot.py | pun1sh3r/tele_bot | 7f4ac8651c5f3396294c467e83ea89497f9e9f05 | [
"MIT"
] | null | null | null | telebot.py | pun1sh3r/tele_bot | 7f4ac8651c5f3396294c467e83ea89497f9e9f05 | [
"MIT"
] | null | null | null |
import telepot as tp
import requests as rq
from telepot.loop import MessageLoop
import time
import logging
import sys
from config import suprnova_api, telegram_api, suprnova_url, suprnova_id,coinmkcap_url
log = logging.getLogger(__name__)
log.setLevel(logging.DEBUG)
formatter = logging.Formatter(fmt='%(asctime)s: %... | 27.767442 | 98 | 0.586683 |
2043d31a5eb695685b716b37e4c769b3a2cc202b | 188 | py | Python | blobcity/utils/__init__.py | naresh1205/autoai | 395249b9c40bcd6accb39e4e4b6c94810a2a68b3 | [
"Apache-2.0"
] | null | null | null | blobcity/utils/__init__.py | naresh1205/autoai | 395249b9c40bcd6accb39e4e4b6c94810a2a68b3 | [
"Apache-2.0"
] | null | null | null | blobcity/utils/__init__.py | naresh1205/autoai | 395249b9c40bcd6accb39e4e4b6c94810a2a68b3 | [
"Apache-2.0"
] | null | null | null | from .FileType import getDataFrameType
from .AutoFeatureSelection import *
from .ProblemType import *
from .Cleaner import *
from .YamlGenerator import writeYml
from .progress_bar import * | 31.333333 | 38 | 0.824468 |
8928488c9257b68e6a1268a08c6443f871e52903 | 1,397 | py | Python | cardinal/random.py | dataiku-research/cardinal | 052ea2273e1e6a389e257e3775873620378fe908 | [
"Apache-2.0"
] | 17 | 2021-02-13T16:29:16.000Z | 2022-03-08T03:16:12.000Z | cardinal/random.py | SoftwareImpacts/SIMPAC-2021-174 | 052ea2273e1e6a389e257e3775873620378fe908 | [
"Apache-2.0"
] | 5 | 2021-02-15T14:09:41.000Z | 2021-03-23T23:31:25.000Z | cardinal/random.py | SoftwareImpacts/SIMPAC-2021-174 | 052ea2273e1e6a389e257e3775873620378fe908 | [
"Apache-2.0"
] | 1 | 2021-12-24T17:41:09.000Z | 2021-12-24T17:41:09.000Z | import numpy as np
from .base import ScoredQuerySampler
from .typeutils import RandomStateType, check_random_state
class RandomSampler(ScoredQuerySampler):
"""Randomly select samples
Args:
batch_size : Number of samples to select.
random_state : The seed of the pseudo random number generator... | 34.073171 | 78 | 0.654975 |
ef227e2706ac990ac03558617c6b1b3064fad4ca | 178 | py | Python | platzi/Conversor.py | diegosish/Introduction-Python | b40dde602c0b5ca4ec4f6b13303ad6d3831fab73 | [
"MIT"
] | null | null | null | platzi/Conversor.py | diegosish/Introduction-Python | b40dde602c0b5ca4ec4f6b13303ad6d3831fab73 | [
"MIT"
] | null | null | null | platzi/Conversor.py | diegosish/Introduction-Python | b40dde602c0b5ca4ec4f6b13303ad6d3831fab73 | [
"MIT"
] | null | null | null | Pesos = input("¿Cuántos Pesos Colombianos tiene?: ")
Pesos = float(Pesos)
v_Dolar = 4033
Dolares = Pesos / v_Dolar
Dolares = str(Dolares)
print("Tienes $" + Dolares + " Dolares") | 29.666667 | 52 | 0.702247 |
7789f063700bf46fd36a7939a4e0d61ba0112349 | 1,247 | py | Python | Question_61_70/answers/answer_62.py | nishidayoshikatsu/Gasyori100knock | f7fe35bca772eda2961a0790274c4934119b3fc2 | [
"MIT"
] | 1 | 2019-06-15T00:09:27.000Z | 2019-06-15T00:09:27.000Z | Question_61_70/answers/answer_62.py | nishidayoshikatsu/Gasyori100knock | f7fe35bca772eda2961a0790274c4934119b3fc2 | [
"MIT"
] | 1 | 2020-10-13T19:22:07.000Z | 2020-10-13T19:22:07.000Z | Question_61_70/answers/answer_62.py | nishidayoshikatsu/Gasyori100knock | f7fe35bca772eda2961a0790274c4934119b3fc2 | [
"MIT"
] | 1 | 2020-01-30T15:38:48.000Z | 2020-01-30T15:38:48.000Z | import cv2
import numpy as np
import matplotlib.pyplot as plt
# Read image
img = cv2.imread("renketsu.png").astype(np.float32)
H, W, C = img.shape
_tmp = np.zeros((H, W), dtype=np.int)
_tmp[img[..., 0]>0] = 1
tmp = 1 - _tmp
out = np.zeros((H, W, 3), dtype=np.uint8)
for y in range(H):
for x in range(W):
... | 27.711111 | 111 | 0.473937 |
83363cca1ee1a100aa367c5e04416bf4d42aae7d | 534 | py | Python | systemtest/quality/views/history.py | IBM-Power-SystemTest/systemtest | a29e6d54500ca13f554073cc66a4a2d403ea5b14 | [
"BSD-3-Clause"
] | 1 | 2022-03-09T18:07:11.000Z | 2022-03-09T18:07:11.000Z | systemtest/quality/views/history.py | IBM-Power-SystemTest/systemtest | a29e6d54500ca13f554073cc66a4a2d403ea5b14 | [
"BSD-3-Clause"
] | null | null | null | systemtest/quality/views/history.py | IBM-Power-SystemTest/systemtest | a29e6d54500ca13f554073cc66a4a2d403ea5b14 | [
"BSD-3-Clause"
] | null | null | null | # Django filters
from systemtest.utils.views import AbstractFilteView
# APPs
from systemtest.quality import forms
class QualityHistory(AbstractFilteView):
"""
Django ListView for history of systems
References:
https://docs.djangoproject.com/en/3.1/ref/class-based-views/generic-display/#lis... | 31.411765 | 104 | 0.737828 |
80a10dac68f27ab0b809206598a779b337eaf1ab | 1,969 | py | Python | examples/nbuild_spaceship_project.py | Jeffrey-P-McAteer/ntest | 04eada57e8590a5e5b1fd6c50cadd72cdc18b640 | [
"MIT"
] | null | null | null | examples/nbuild_spaceship_project.py | Jeffrey-P-McAteer/ntest | 04eada57e8590a5e5b1fd6c50cadd72cdc18b640 | [
"MIT"
] | 1 | 2020-11-18T14:15:06.000Z | 2020-11-18T14:15:06.000Z | examples/nbuild_spaceship_project.py | Jeffrey-P-McAteer/nbuild | 04eada57e8590a5e5b1fd6c50cadd72cdc18b640 | [
"MIT"
] | null | null | null |
import os
# python -m pip install --user nbuild
import nbuild as nb
this_dir = os.path.dirname(os.path.abspath(__file__))
p = nb.Project(
name='Spaceship Project',
poc='Jeffrey McAteer <nobody@example.org>',
description='''
The spaceship project aims to build a real-life replica of the starship from Star ... | 31.253968 | 132 | 0.684611 |
7be022d3b80cf4d2a7bd661c529f1f258a137277 | 2,220 | py | Python | composer/models/vit_small_patch16/hparams.py | ravi-mosaicml/ravi-composer | d100053198524672f628c3959a8c4e51a9302e2d | [
"Apache-2.0"
] | null | null | null | composer/models/vit_small_patch16/hparams.py | ravi-mosaicml/ravi-composer | d100053198524672f628c3959a8c4e51a9302e2d | [
"Apache-2.0"
] | null | null | null | composer/models/vit_small_patch16/hparams.py | ravi-mosaicml/ravi-composer | d100053198524672f628c3959a8c4e51a9302e2d | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 MosaicML. All Rights Reserved.
"""`YAHP <https://docs.mosaicml.com/projects/yahp/en/stable/README.html>`_ interface for :class:`.ViTSmallPatch16`."""
from dataclasses import dataclass
import yahp as hp
from composer.models.model_hparams import ModelHparams
from composer.utils.import_helpers import ... | 46.25 | 125 | 0.677027 |
27c03129f346f8b963466b938a80dba5a070863c | 1,318 | py | Python | app/core/tests/test_admin.py | dkrooshof/recipe-app-api | 7cb4e13d21fbb99691074da077d481c428c602bb | [
"MIT"
] | null | null | null | app/core/tests/test_admin.py | dkrooshof/recipe-app-api | 7cb4e13d21fbb99691074da077d481c428c602bb | [
"MIT"
] | null | null | null | app/core/tests/test_admin.py | dkrooshof/recipe-app-api | 7cb4e13d21fbb99691074da077d481c428c602bb | [
"MIT"
] | null | null | null | from django.test import TestCase, Client
from django.contrib.auth import get_user_model
from django.urls import reverse
class AdminSiteTests(TestCase):
def setUp(self):
self.client = Client()
self.admin_user = get_user_model().objects.create_superuser(
email='admin@douwe.com',
... | 31.380952 | 68 | 0.639605 |
b4dca55daf24e10f1fd034222c4898b51e3d6d09 | 9,609 | py | Python | src/logo_update_png.py | shounen51/poe_AutoFlaskByAttack | ce6628583d0f0c6076d2f522a340689b722732f2 | [
"MIT"
] | 3 | 2021-01-08T05:42:50.000Z | 2021-07-09T14:15:57.000Z | src/logo_update_png.py | shounen51/poe_AutoFlaskByAttack | ce6628583d0f0c6076d2f522a340689b722732f2 | [
"MIT"
] | null | null | null | src/logo_update_png.py | shounen51/poe_AutoFlaskByAttack | ce6628583d0f0c6076d2f522a340689b722732f2 | [
"MIT"
] | null | null | null | logo_update_png = b'iVBORw0KGgoAAAANSUhEUgAAADwAAAA8CAYAAAA6/NlyAAAb3klEQVRoQ61bCXRb5ZX+tO+ydsmLvG+Js9lOQpwdEghhTegCtFOmy3RaSttpB9qmKynQ6bRlzrQM7cy0M5SlnLaUCRRoQhMCoZDEIQshi2MT77ZkS5Zsy7b2bc69T5Il21nKzDvHB3Isv/ffd+/97ne/eyWqra1N4//rEgHI3E0klkCsUEKi0UGsUEFucUCi1kCqN0JmskIEMUQSCRRGCyQSSeYEaaRSQDKZQHTcg8SEHxF3P2JjI4iNe5GK... | 9,609 | 9,609 | 0.970757 |
a32370273ba6035361417f8642b36faa650b7148 | 18,974 | py | Python | google/ads/googleads/v5/services/services/dynamic_search_ads_search_term_view_service/client.py | batardo/google-ads-python | a39748521847e85138fca593f3be2681352ad024 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v5/services/services/dynamic_search_ads_search_term_view_service/client.py | batardo/google-ads-python | a39748521847e85138fca593f3be2681352ad024 | [
"Apache-2.0"
] | null | null | null | google/ads/googleads/v5/services/services/dynamic_search_ads_search_term_view_service/client.py | batardo/google-ads-python | a39748521847e85138fca593f3be2681352ad024 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 40.980562 | 196 | 0.649099 |
670ed4e62914081b1b3937d35a3b7ced55f36866 | 3,193 | py | Python | ezyrb/gpr.py | peaceiris/EZyRB | 4036d56c58e21232d309f4589efc82aba7146de6 | [
"MIT"
] | null | null | null | ezyrb/gpr.py | peaceiris/EZyRB | 4036d56c58e21232d309f4589efc82aba7146de6 | [
"MIT"
] | 1 | 2020-06-05T14:00:51.000Z | 2020-06-05T14:00:51.000Z | ezyrb/gpr.py | peaceiris/EZyRB | 4036d56c58e21232d309f4589efc82aba7146de6 | [
"MIT"
] | null | null | null | """
Module wrapper exploiting `GPy` for Gaussian Process Regression
"""
import GPy
import numpy as np
from scipy.optimize import minimize
from .approximation import Approximation
class GPR(Approximation):
"""
Multidimensional regression using Gaussian process.
:cvar numpy.ndarray X_sample: the array cont... | 32.581633 | 79 | 0.616035 |
40061211ece24cf7911daf49b86a641fad6a6007 | 15,593 | py | Python | academic/apps/projects/migrations/0001_initial.py | phretor/django-academic | 864452238056e07056990479396e8446a1bad086 | [
"BSD-3-Clause"
] | 2 | 2015-10-16T17:07:03.000Z | 2016-06-23T09:54:51.000Z | academic/apps/projects/migrations/0001_initial.py | phretor/django-academic | 864452238056e07056990479396e8446a1bad086 | [
"BSD-3-Clause"
] | null | null | null | academic/apps/projects/migrations/0001_initial.py | phretor/django-academic | 864452238056e07056990479396e8446a1bad086 | [
"BSD-3-Clause"
] | null | null | null | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Topic'
db.create_table('projects_topic', (
('id', self.gf('django.db.models.fi... | 72.189815 | 245 | 0.596935 |
4f076b98c4c26c36f5b504235743709c31f5cdf3 | 495 | py | Python | MDM_Server/log_util2.py | AstonZ/iOS_MDM_Guide | b3da4fb959485e964802ff18ab5f44abf3d4a4da | [
"MIT"
] | 9 | 2019-01-30T08:54:17.000Z | 2022-02-02T05:38:28.000Z | MDM_Server/log_util2.py | AstonZ/iOS_MDM_Guide | b3da4fb959485e964802ff18ab5f44abf3d4a4da | [
"MIT"
] | null | null | null | MDM_Server/log_util2.py | AstonZ/iOS_MDM_Guide | b3da4fb959485e964802ff18ab5f44abf3d4a4da | [
"MIT"
] | null | null | null | # coding=utf-8
import logging
import os
from datetime import datetime
from pprint import pprint
def dlog(msg):
logging.debug(msg)
pprint(msg)
def start_logging(title):
today = datetime.now().strftime('%Y-%m-%d')
LOG_FORMAT = "%(asctime)s - %(levelname)s - %(message)s"
DATE_FORMAT = "%m/%d/%Y %H:%M... | 30.9375 | 108 | 0.678788 |
5006a7f2c77e671e09f94d757455bdecc566265d | 666 | py | Python | manage.py | Coding-Dojo-ACC/django-upload | 54b9e0f8cde00c058c9f5f2dd2bf23dafab59a8b | [
"MIT"
] | null | null | null | manage.py | Coding-Dojo-ACC/django-upload | 54b9e0f8cde00c058c9f5f2dd2bf23dafab59a8b | [
"MIT"
] | null | null | null | manage.py | Coding-Dojo-ACC/django-upload | 54b9e0f8cde00c058c9f5f2dd2bf23dafab59a8b | [
"MIT"
] | 1 | 2021-06-11T03:26:48.000Z | 2021-06-11T03:26:48.000Z | #!/usr/bin/env python
"""Django's command-line utility for administrative tasks."""
import os
import sys
def main():
"""Run administrative tasks."""
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'uploadProj.settings')
try:
from django.core.management import execute_from_command_line
except I... | 28.956522 | 74 | 0.68018 |
f1f7e98f323901ecaba441dc8b7bcc02a3d5349d | 2,397 | py | Python | venv/Lib/site-packages/pyrogram/raw/types/update_read_channel_outbox.py | iamgeorgiy/heroku-userbot | 5a92417d16f8ead949d88cb38da213fc2da5d3a4 | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/pyrogram/raw/types/update_read_channel_outbox.py | iamgeorgiy/heroku-userbot | 5a92417d16f8ead949d88cb38da213fc2da5d3a4 | [
"Apache-2.0"
] | null | null | null | venv/Lib/site-packages/pyrogram/raw/types/update_read_channel_outbox.py | iamgeorgiy/heroku-userbot | 5a92417d16f8ead949d88cb38da213fc2da5d3a4 | [
"Apache-2.0"
] | null | null | null | # Pyrogram - Telegram MTProto API Client Library for Python
# Copyright (C) 2017-2020 Dan <https://github.com/delivrance>
#
# This file is part of Pyrogram.
#
# Pyrogram is free software: you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License as published
# by the Free... | 31.96 | 103 | 0.620776 |
bc279eb4b59c9a83f3d8d105d000ddd002bc6c47 | 276 | py | Python | src/bo4e/enum/energierichtung.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 1 | 2022-03-02T12:49:44.000Z | 2022-03-02T12:49:44.000Z | src/bo4e/enum/energierichtung.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | 21 | 2022-02-04T07:38:46.000Z | 2022-03-28T14:01:53.000Z | src/bo4e/enum/energierichtung.py | bo4e/BO4E-python | 28b12f853c8a496d14b133759b7aa2d6661f79a0 | [
"MIT"
] | null | null | null | # pylint:disable=missing-module-docstring
from bo4e.enum.strenum import StrEnum
class Energierichtung(StrEnum):
"""
Spezifiziert die Energierichtung einer Markt- und/oder Messlokation
"""
AUSSP = "AUSSP" #: Ausspeisung
EINSP = "EINSP" #: Einspeisung
| 21.230769 | 71 | 0.706522 |
84e72178372d76f6ac7518a8e064bcb778be1ca3 | 1,701 | py | Python | app/core/migrations/0001_initial.py | somi38/recipe-app-api | ccd736dbf6286aa463201c10336001080c013554 | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | somi38/recipe-app-api | ccd736dbf6286aa463201c10336001080c013554 | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | somi38/recipe-app-api | ccd736dbf6286aa463201c10336001080c013554 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.6 on 2019-10-11 10:01
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0011_update_proxy_permissions'),
]
operations = [
migrations.CreateModel(
name='User',
f... | 50.029412 | 266 | 0.637272 |
c84646eddb5cbbec371c20bfd7e6df90b86156a2 | 2,009 | py | Python | SeleniumProject_BrandTest/business/brand_business.py | SuperVivian/SeleniumProject_BrandTest | 8c36854bcbb9bebd0ac4a0a68fc8884f17c108ac | [
"MIT"
] | null | null | null | SeleniumProject_BrandTest/business/brand_business.py | SuperVivian/SeleniumProject_BrandTest | 8c36854bcbb9bebd0ac4a0a68fc8884f17c108ac | [
"MIT"
] | null | null | null | SeleniumProject_BrandTest/business/brand_business.py | SuperVivian/SeleniumProject_BrandTest | 8c36854bcbb9bebd0ac4a0a68fc8884f17c108ac | [
"MIT"
] | null | null | null | # coding=utf-8
from selenium import webdriver
from util.find_element import my_get_element
class BrandBusiness:
def __init__(self,driver):
self.driver = driver
def click_one(self,key):
element = my_get_element(self.driver, key) # 点击品牌团
element.click()
return element
def g... | 34.050847 | 76 | 0.671478 |
edf9cfe351d579e3066e3ef563f02b467dae7f66 | 12,302 | py | Python | eval/common.py | kikefdezl/RadEfficientDet | b72a090ee4302a618cf7580a860530690ab53a8c | [
"Apache-2.0"
] | null | null | null | eval/common.py | kikefdezl/RadEfficientDet | b72a090ee4302a618cf7580a860530690ab53a8c | [
"Apache-2.0"
] | null | null | null | eval/common.py | kikefdezl/RadEfficientDet | b72a090ee4302a618cf7580a860530690ab53a8c | [
"Apache-2.0"
] | null | null | null | """
Copyright 2017-2018 Fizyr (https://fizyr.com)
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... | 38.564263 | 118 | 0.636075 |
92bedbbb0fa29480abb1f954e50d5ff57f1e67d7 | 29,201 | py | Python | VirtualBox-5.0.0/src/VBox/ValidationKit/testmanager/core/testgroup.py | egraba/vbox_openbsd | 6cb82f2eed1fa697d088cecc91722b55b19713c2 | [
"MIT"
] | 1 | 2015-04-30T14:18:45.000Z | 2015-04-30T14:18:45.000Z | VirtualBox-5.0.0/src/VBox/ValidationKit/testmanager/core/testgroup.py | egraba/vbox_openbsd | 6cb82f2eed1fa697d088cecc91722b55b19713c2 | [
"MIT"
] | null | null | null | VirtualBox-5.0.0/src/VBox/ValidationKit/testmanager/core/testgroup.py | egraba/vbox_openbsd | 6cb82f2eed1fa697d088cecc91722b55b19713c2 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# $Id: testgroup.py $
"""
Test Manager - Test groups management.
"""
__copyright__ = \
"""
Copyright (C) 2012-2015 Oracle Corporation
This file is part of VirtualBox Open Source Edition (OSE), as
available from http://www.virtualbox.org. This file is free software;
you can redistribute it and... | 40.613352 | 128 | 0.5457 |
f5021ea500e0de7ae12ef39785e771c2b3b97139 | 569 | py | Python | desktop/core/ext-py/Babel-2.5.1/tests/test_lists.py | kokosing/hue | 2307f5379a35aae9be871e836432e6f45138b3d9 | [
"Apache-2.0"
] | 5,079 | 2015-01-01T03:39:46.000Z | 2022-03-31T07:38:22.000Z | desktop/core/ext-py/Babel-2.5.1/tests/test_lists.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 1,623 | 2015-01-01T08:06:24.000Z | 2022-03-30T19:48:52.000Z | desktop/core/ext-py/Babel-2.5.1/tests/test_lists.py | zks888/hue | 93a8c370713e70b216c428caa2f75185ef809deb | [
"Apache-2.0"
] | 2,033 | 2015-01-04T07:18:02.000Z | 2022-03-28T19:55:47.000Z | # coding=utf-8
from babel import lists
def test_format_list():
for list, locale, expected in [
([], 'en', ''),
([u'string'], 'en', u'string'),
(['string1', 'string2'], 'en', u'string1 and string2'),
(['string1', 'string2', 'string3'], 'en', u'string1, string2, and string3'),
... | 37.933333 | 102 | 0.571178 |
b56a3ef0abb67564b748f07b2887b28f6df357f9 | 7,977 | py | Python | tests/unit/drivers/test_recursive_traversal_tree.py | jancijen/jina | def98c9656e1fabdcd0622e79fe9e7cb660e2116 | [
"Apache-2.0"
] | 1 | 2020-10-23T03:01:56.000Z | 2020-10-23T03:01:56.000Z | tests/unit/drivers/test_recursive_traversal_tree.py | normalcereal/jina | d95e4e72e7c8acb0278ea049aa56905ba97271d3 | [
"Apache-2.0"
] | null | null | null | tests/unit/drivers/test_recursive_traversal_tree.py | normalcereal/jina | d95e4e72e7c8acb0278ea049aa56905ba97271d3 | [
"Apache-2.0"
] | null | null | null | import os
from jina.proto import jina_pb2
from jina.drivers import BaseRecursiveDriver
cur_dir = os.path.dirname(os.path.abspath(__file__))
DOCUMENTS_PER_LEVEL = 1
class AppendOneChunkTwoMatchesCrafter(BaseRecursiveDriver):
def __init__(self, *args, **kwargs):
super().__init__(*args, **kwargs)
... | 34.682609 | 105 | 0.638586 |
6c8439f3c58f52a15d04d152bdedcd8579553da3 | 6,936 | py | Python | symjax/data/imagenet.py | RandallBalestriero/TheanoXLA | d8778c2eb3254b478cef4f45d934bf921e695619 | [
"Apache-2.0"
] | 67 | 2020-02-21T21:26:46.000Z | 2020-06-14T14:25:42.000Z | symjax/data/imagenet.py | RandallBalestriero/TheanoXLA | d8778c2eb3254b478cef4f45d934bf921e695619 | [
"Apache-2.0"
] | 8 | 2020-02-22T14:45:56.000Z | 2020-06-07T16:56:47.000Z | symjax/data/imagenet.py | RandallBalestriero/TheanoXLA | d8778c2eb3254b478cef4f45d934bf921e695619 | [
"Apache-2.0"
] | 4 | 2020-02-21T17:34:46.000Z | 2020-05-30T08:30:14.000Z | # Based on a script by Seiya Tokui. With the following copyright
# Copyright (c) 2014 Seiya Tokui
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limi... | 29.76824 | 87 | 0.638408 |
ca46e40fd9b4b2fb8c818ac03d324a8c7124e64c | 1,425 | py | Python | app/auth/views.py | Tracymbone/my_personal_blog | 07d00b8540aa22e7f12b09614874c0fa908ee4b4 | [
"MIT"
] | null | null | null | app/auth/views.py | Tracymbone/my_personal_blog | 07d00b8540aa22e7f12b09614874c0fa908ee4b4 | [
"MIT"
] | null | null | null | app/auth/views.py | Tracymbone/my_personal_blog | 07d00b8540aa22e7f12b09614874c0fa908ee4b4 | [
"MIT"
] | null | null | null |
from . import auth
from flask import render_template,redirect,url_for,request,flash
from .forms import RegisterForm, LoginForm
from ..models import User
from .. import db
from flask_login import login_user,logout_user,login_required
@auth.route('/register',methods = ["GET","POST"])
def register():
reg_form = Reg... | 30.978261 | 108 | 0.707368 |
de28466dbdcaef9746395aabc8b10f83c1d52b32 | 8,541 | py | Python | cirtorch/utils/download.py | Attila94/cnnimageretrieval-pytorch | ea6ac81e26e46fa2f58e6ca376607bf6f12350a4 | [
"MIT"
] | null | null | null | cirtorch/utils/download.py | Attila94/cnnimageretrieval-pytorch | ea6ac81e26e46fa2f58e6ca376607bf6f12350a4 | [
"MIT"
] | null | null | null | cirtorch/utils/download.py | Attila94/cnnimageretrieval-pytorch | ea6ac81e26e46fa2f58e6ca376607bf6f12350a4 | [
"MIT"
] | null | null | null | import os
def download_test(data_dir,datasets):
"""
DOWNLOAD_TEST Checks, and, if required, downloads the necessary datasets for the testing.
download_test(DATA_ROOT) checks if the data necessary for running the example script exist.
If not it downloads it in the folder structure:
D... | 50.241176 | 105 | 0.596534 |
bbfcd43faf17d36c1bacc353ce10290e2a31950b | 165 | py | Python | skyscape/skyscape_apidefinition.py | skyscape-cloud-services/skyscape_python | 4f5608dd6272c4370adf04a0317842b8ea5083e2 | [
"Apache-2.0"
] | 1 | 2015-12-04T14:14:25.000Z | 2015-12-04T14:14:25.000Z | skyscape/skyscape_apidefinition.py | UKCloud/skyscape_python | 4f5608dd6272c4370adf04a0317842b8ea5083e2 | [
"Apache-2.0"
] | 1 | 2016-01-06T15:46:22.000Z | 2016-01-06T15:46:22.000Z | skyscape/skyscape_apidefinition.py | UKCloud/skyscape_python | 4f5608dd6272c4370adf04a0317842b8ea5083e2 | [
"Apache-2.0"
] | 1 | 2015-12-02T17:22:20.000Z | 2015-12-02T17:22:20.000Z | __author__ = 'prossi'
class APIDEFINITION:
def __init__(self, obj, connection):
self.__dict__ = dict(obj.attrib)
self.connection = connection
| 18.333333 | 40 | 0.672727 |
e07c8ab265ead95f7480592c12ace50290eba068 | 4,630 | py | Python | src/knn_classifier.py | mtambos/character_identification | c72c417351afccb830ab731eb9622f966bd5a2e8 | [
"MIT"
] | null | null | null | src/knn_classifier.py | mtambos/character_identification | c72c417351afccb830ab731eb9622f966bd5a2e8 | [
"MIT"
] | null | null | null | src/knn_classifier.py | mtambos/character_identification | c72c417351afccb830ab731eb9622f966bd5a2e8 | [
"MIT"
] | null | null | null | __author__ = 'mtambos'
from __future__ import division, print_function
import os
import pandas as pd
from PIL import Image
import numpy as np
def to_gray_scale(img):
img_array = np.asarray(img)
luminosity = lambda x: 0.21*x[0] + 0.72*x[1] + 0.07*x[2]
return np.apply_along_axis(func1d=luminosity, axis=2... | 37.95082 | 103 | 0.647732 |
025ff6e1c9dee565f2b190501e90711bce864d54 | 1,970 | py | Python | src/app/voltdb/voltdb_src/lib/python/voltcli/voltdb.d/mask.py | OpenMPDK/SMDK | 8f19d32d999731242cb1ab116a4cb445d9993b15 | [
"BSD-3-Clause"
] | 44 | 2022-03-16T08:32:31.000Z | 2022-03-31T16:02:35.000Z | src/app/voltdb/voltdb_src/lib/python/voltcli/voltdb.d/mask.py | H2O0Lee/SMDK | eff49bc17a55a83ea968112feb2e2f2ea18c4ff5 | [
"BSD-3-Clause"
] | 1 | 2022-03-29T02:30:28.000Z | 2022-03-30T03:40:46.000Z | src/app/voltdb/voltdb_src/lib/python/voltcli/voltdb.d/mask.py | H2O0Lee/SMDK | eff49bc17a55a83ea968112feb2e2f2ea18c4ff5 | [
"BSD-3-Clause"
] | 18 | 2022-03-19T04:41:04.000Z | 2022-03-31T03:32:12.000Z | # This file is part of VoltDB.
# Copyright (C) 2008-2020 VoltDB Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later ver... | 35.818182 | 87 | 0.711675 |
ea175bbff7356e410ffafad610d1f930b58872be | 960 | py | Python | tests/test_cli_validation.py | radon-h2020/radon-defect-prediction-cli | 4b2c9c49491b1f1f5d5e748609f8f77a878791e1 | [
"Apache-2.0"
] | null | null | null | tests/test_cli_validation.py | radon-h2020/radon-defect-prediction-cli | 4b2c9c49491b1f1f5d5e748609f8f77a878791e1 | [
"Apache-2.0"
] | 5 | 2020-10-23T11:46:21.000Z | 2020-12-14T11:53:51.000Z | tests/test_cli_validation.py | radon-h2020/radon-defect-prediction-cli | 4b2c9c49491b1f1f5d5e748609f8f77a878791e1 | [
"Apache-2.0"
] | null | null | null | import unittest
from argparse import ArgumentTypeError
from radondp.cli import valid_dir, valid_file, valid_balancers, valid_normalizers, valid_classifiers
class CLIValidationTestCase(unittest.TestCase):
def test_valid_dir(self):
with self.assertRaises(ArgumentTypeError):
valid_dir('this/is/... | 30 | 100 | 0.716667 |
bb5d6dc8a9a26843bfa5e503f7a4e7d4ba1b0879 | 838 | py | Python | ooobuild/dyn/form/control/time_field.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/form/control/time_field.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | ooobuild/dyn/form/control/time_field.py | Amourspirit/ooo_uno_tmpl | 64e0c86fd68f24794acc22d63d8d32ae05dd12b8 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
#
# Copyright 2022 :Barry-Thomas-Paul: Moss
#
# 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 applicab... | 32.230769 | 74 | 0.752983 |
7c946f09e691f3ffdd20ee6aaa16a4fb99bc128c | 3,344 | py | Python | ai_dataset/types/keras.py | aron-kvvon/ai-dataset-python | d10feb0f2e301456995a99227e82a4f294e0ecb7 | [
"MIT"
] | null | null | null | ai_dataset/types/keras.py | aron-kvvon/ai-dataset-python | d10feb0f2e301456995a99227e82a4f294e0ecb7 | [
"MIT"
] | null | null | null | ai_dataset/types/keras.py | aron-kvvon/ai-dataset-python | d10feb0f2e301456995a99227e82a4f294e0ecb7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
import tensorflow as tf
from tensorflow.keras.utils import to_categorical
from ai_dataset.types.abstract_data import AbstractData
keras_dataset_list = {
'mnist': tf.keras.datasets.mnist,
'cifar10': tf.keras.datasets.cifar10
}
class KerasData(A... | 35.574468 | 112 | 0.63128 |
c7a25cd3d292442bb18f764b15e47f734b058bc7 | 5,657 | py | Python | myven/lib/python3.8/site-packages/ansible/plugins/action/eos.py | baltham/dne-dna-code | 4a13309a790a670d2f07e635c9264a0c29976c6a | [
"MIT"
] | 1 | 2021-04-02T08:08:39.000Z | 2021-04-02T08:08:39.000Z | myven/lib/python3.8/site-packages/ansible/plugins/action/eos.py | baltham/dne-dna-code | 4a13309a790a670d2f07e635c9264a0c29976c6a | [
"MIT"
] | null | null | null | myven/lib/python3.8/site-packages/ansible/plugins/action/eos.py | baltham/dne-dna-code | 4a13309a790a670d2f07e635c9264a0c29976c6a | [
"MIT"
] | 1 | 2020-05-03T01:13:16.000Z | 2020-05-03T01:13:16.000Z | #
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | 42.856061 | 127 | 0.64734 |
7e7b3412fc4da24e9b18aa994f71ba4b36ace5ab | 9,416 | py | Python | tools/gentools/MMAnsibleDeployAll.py | cedardeployer/cedar | dbf26d198c44422fffb6fba59f8fa6576c0300fb | [
"MIT"
] | null | null | null | tools/gentools/MMAnsibleDeployAll.py | cedardeployer/cedar | dbf26d198c44422fffb6fba59f8fa6576c0300fb | [
"MIT"
] | null | null | null | tools/gentools/MMAnsibleDeployAll.py | cedardeployer/cedar | dbf26d198c44422fffb6fba59f8fa6576c0300fb | [
"MIT"
] | null | null | null | # This code is used to create Ansible files for deploying Lambda's
# all that is needed is a target Lambda, tests, and it will do the rest.
# finds associate roles and policies
# creates Ansible modules based on those policies and roles
# defines the Lambdas and creates them with tests
# finds api-gateways or other eve... | 41.298246 | 173 | 0.5976 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.