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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
5b32e78243c7c2051a92ab047a90c7532e5fb7f5 | 156,466 | py | Python | tensorflow/python/data/ops/dataset_ops.py | MaverickMeerkat/tensorflow | 51c7df0cfc45d31c2ce2cd61e5c66969d890de2a | [
"Apache-2.0"
] | 2 | 2018-06-04T09:14:10.000Z | 2019-02-10T10:39:44.000Z | tensorflow/python/data/ops/dataset_ops.py | Kiku-git/tensorflow | a8b7b52f9fe90f428c5b8f3c220bde342ab2a54b | [
"Apache-2.0"
] | null | null | null | tensorflow/python/data/ops/dataset_ops.py | Kiku-git/tensorflow | a8b7b52f9fe90f428c5b8f3c220bde342ab2a54b | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 39.491671 | 116 | 0.691716 |
59a74e4aa51be938b4e534e27299d8552f823e87 | 2,681 | py | Python | dimod/roof_duality/fix_variables.py | hsadeghidw/dimod | c6b4adc18c22f39fd5a79e6775bbcab84b1a5489 | [
"Apache-2.0"
] | 101 | 2017-08-30T20:08:46.000Z | 2022-03-23T23:40:32.000Z | dimod/roof_duality/fix_variables.py | hsadeghidw/dimod | c6b4adc18c22f39fd5a79e6775bbcab84b1a5489 | [
"Apache-2.0"
] | 862 | 2017-09-27T19:56:43.000Z | 2022-03-30T18:00:43.000Z | dimod/roof_duality/fix_variables.py | hsadeghidw/dimod | c6b4adc18c22f39fd5a79e6775bbcab84b1a5489 | [
"Apache-2.0"
] | 78 | 2017-09-13T23:01:10.000Z | 2022-02-22T02:40:40.000Z | # Copyright 2018 D-Wave Systems Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or... | 43.95082 | 98 | 0.718762 |
f8b49333eb7c846d37b8fa11e9204154d89ac18e | 1,942 | py | Python | pkg/get_face.py | 610yilingliu/FakeDonaldTrump | d5550cc9a7c649f0bcf6a4a1b4c26a5b389a4959 | [
"MIT"
] | 1 | 2021-03-10T05:05:45.000Z | 2021-03-10T05:05:45.000Z | pkg/get_face.py | 610yilingliu/FakeDonaldTrump | d5550cc9a7c649f0bcf6a4a1b4c26a5b389a4959 | [
"MIT"
] | null | null | null | pkg/get_face.py | 610yilingliu/FakeDonaldTrump | d5550cc9a7c649f0bcf6a4a1b4c26a5b389a4959 | [
"MIT"
] | null | null | null | import os
import dlib
import cv2
import face_recognition
import numpy as np
def cut_image(path):
"""
:type path: string, path of a specific image
:ytype cutted image (numpy)
"""
if not os.path.exists(path):
print(path + ' not exists')
return
detector = dlib.get_frontal_face_dete... | 31.322581 | 86 | 0.593203 |
88e58565986111474acc5c4d679b96cc85dd4d63 | 672 | py | Python | SimpleBlog/posts/migrations/0001_initial.py | Ashish94720/Blog | d84a0395098bcf33faec4cfbdc012b0b88627925 | [
"bzip2-1.0.6"
] | 2 | 2019-07-08T22:51:25.000Z | 2019-07-08T22:51:51.000Z | SimpleBlog/posts/migrations/0001_initial.py | Ashish94720/Blog | d84a0395098bcf33faec4cfbdc012b0b88627925 | [
"bzip2-1.0.6"
] | null | null | null | SimpleBlog/posts/migrations/0001_initial.py | Ashish94720/Blog | d84a0395098bcf33faec4cfbdc012b0b88627925 | [
"bzip2-1.0.6"
] | null | null | null | # Generated by Django 2.2.2 on 2019-06-20 17:58
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Post',
fields=[
('id', models.AutoField(aut... | 26.88 | 114 | 0.568452 |
8a7b131a2c2ab883f68d2616ffcd0d8f2ace48bb | 12,044 | py | Python | models/Unet_2D/U_net_Sample_Generator.py | LongxiZhou/DLPE-method | ed20abc91e27423c7ff677a009cfd99314730217 | [
"BSD-3-Clause"
] | null | null | null | models/Unet_2D/U_net_Sample_Generator.py | LongxiZhou/DLPE-method | ed20abc91e27423c7ff677a009cfd99314730217 | [
"BSD-3-Clause"
] | null | null | null | models/Unet_2D/U_net_Sample_Generator.py | LongxiZhou/DLPE-method | ed20abc91e27423c7ff677a009cfd99314730217 | [
"BSD-3-Clause"
] | 1 | 2021-08-22T14:29:58.000Z | 2021-08-22T14:29:58.000Z | import Functions
import numpy as np
import os
def slicing(raw_array, patient_id, time_point, direction, single=True):
# raw_array has shape [512, 512, 512, 2] for [x, y, z, -],
data = raw_array[:, :, :, 0]
mask = raw_array[:, :, :, 1]
# patient_id looks like "xgfy-A000012", time_point looks like "2012... | 48.369478 | 149 | 0.47642 |
ceab0f53d728c9b6377cf4f3f79875773e146a57 | 5,694 | py | Python | encoder/model.py | iclementine/Real-Time-Voice-Cloning | 658d31c241d615e58dbaca283fff36f7013e372e | [
"MIT"
] | null | null | null | encoder/model.py | iclementine/Real-Time-Voice-Cloning | 658d31c241d615e58dbaca283fff36f7013e372e | [
"MIT"
] | null | null | null | encoder/model.py | iclementine/Real-Time-Voice-Cloning | 658d31c241d615e58dbaca283fff36f7013e372e | [
"MIT"
] | null | null | null | from encoder.params_model import *
from encoder.params_data import *
# 通过这种方式去除了层次性,其实也是不错的
from scipy.interpolate import interp1d
from sklearn.metrics import roc_curve
from torch.nn.utils import clip_grad_norm_
from scipy.optimize import brentq
from torch import nn
import numpy as np
import torch
class SpeakerEncode... | 44.834646 | 131 | 0.646294 |
a5b11ed662a2fa702fee96dc580ffbda0cb81025 | 98 | py | Python | sample/WRS2018/script/T3-DoubleArmV7S.py | roto5296/choreonoid | ffe12df8db71e32aea18833afb80dffc42c373d0 | [
"MIT"
] | 91 | 2015-01-29T11:03:42.000Z | 2022-02-13T07:34:04.000Z | sample/WRS2018/script/T3-DoubleArmV7S.py | roto5296/choreonoid | ffe12df8db71e32aea18833afb80dffc42c373d0 | [
"MIT"
] | 213 | 2015-01-26T06:21:15.000Z | 2020-07-23T05:51:30.000Z | sample/WRS2018/script/T3-DoubleArmV7S.py | roto5296/choreonoid | ffe12df8db71e32aea18833afb80dffc42c373d0 | [
"MIT"
] | 71 | 2015-01-06T02:32:05.000Z | 2020-12-01T03:42:25.000Z | import WRSUtil
WRSUtil.loadProject(
"MultiSceneViews", "T3", "AISTSimulator", "DoubleArmV7S")
| 24.5 | 61 | 0.744898 |
0c2a394fb37c98984b46faf3674c76c106788f6c | 514 | py | Python | test/python/compiler/__init__.py | Roshan-Thomas/qiskit-terra | 77219b5c7b7146b1545c5e5190739b36f4064b2f | [
"Apache-2.0"
] | 1,599 | 2018-07-10T10:59:12.000Z | 2022-03-31T23:56:25.000Z | test/python/compiler/__init__.py | Roshan-Thomas/qiskit-terra | 77219b5c7b7146b1545c5e5190739b36f4064b2f | [
"Apache-2.0"
] | 5,244 | 2018-07-10T06:20:13.000Z | 2022-03-31T22:18:48.000Z | test/python/compiler/__init__.py | Roshan-Thomas/qiskit-terra | 77219b5c7b7146b1545c5e5190739b36f4064b2f | [
"Apache-2.0"
] | 1,409 | 2018-07-10T02:16:12.000Z | 2022-03-31T09:01:32.000Z | # This code is part of Qiskit.
#
# (C) Copyright IBM 2017, 2019.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the root directory
# of this source tree or at http://www.apache.org/licenses/LICENSE-2.0.
#
# Any modifications or derivat... | 36.714286 | 77 | 0.749027 |
303068ef39701851493fcc01180d4d177d554523 | 3,679 | py | Python | slack_invite/slack_invite/settings/base.py | sanchagrins/umuc-cs-slack | 648e709905b153ad17a3df8bd826a784edd5c11b | [
"MIT"
] | null | null | null | slack_invite/slack_invite/settings/base.py | sanchagrins/umuc-cs-slack | 648e709905b153ad17a3df8bd826a784edd5c11b | [
"MIT"
] | 13 | 2017-08-18T01:19:49.000Z | 2017-11-16T02:24:07.000Z | slack_invite/slack_invite/settings/base.py | umuc-cs/umuc-cs-slack | 648e709905b153ad17a3df8bd826a784edd5c11b | [
"MIT"
] | null | null | null | """
Django settings for slack_invite project.
Generated by 'django-admin startproject' using Django 1.11.3.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
impo... | 26.467626 | 127 | 0.698559 |
31227badc44624f1c834598c8fa2639b7c404186 | 29,081 | py | Python | SSAH.py | SincereJoy/SSAH_CVPR2018 | 82ada6db1048e51e14cd1c98469b837c78b7584e | [
"MIT"
] | null | null | null | SSAH.py | SincereJoy/SSAH_CVPR2018 | 82ada6db1048e51e14cd1c98469b837c78b7584e | [
"MIT"
] | null | null | null | SSAH.py | SincereJoy/SSAH_CVPR2018 | 82ada6db1048e51e14cd1c98469b837c78b7584e | [
"MIT"
] | null | null | null | from setting import *
from tnet import *
import tensorflow as tf
from ops import *
from utils.calc_hammingranking import calc_map
import os
import scipy.io as sio
from tqdm import tqdm
class SSAH(object):
def __init__(self, sess):
self.train_L = train_L
self.train_X = train_x
self.train_Y ... | 53.457721 | 159 | 0.523606 |
a98479cfc3073d382f4b4ad2d78f6a71972d070c | 785 | py | Python | sensors/watchExtensionsV1beta1HorizontalPodAutoscalerListForAllNamespaces.py | blinkops/stackstorm-kubernetes | 3b4a15d42f603f3e700efaf534169e2ec361f5d2 | [
"Apache-2.0"
] | 20 | 2016-12-24T01:35:41.000Z | 2022-03-06T08:32:16.000Z | sensors/watchExtensionsV1beta1HorizontalPodAutoscalerListForAllNamespaces.py | blinkops/stackstorm-kubernetes | 3b4a15d42f603f3e700efaf534169e2ec361f5d2 | [
"Apache-2.0"
] | 16 | 2017-05-02T19:38:57.000Z | 2021-06-17T08:31:17.000Z | sensors/watchExtensionsV1beta1HorizontalPodAutoscalerListForAllNamespaces.py | blinkops/stackstorm-kubernetes | 3b4a15d42f603f3e700efaf534169e2ec361f5d2 | [
"Apache-2.0"
] | 18 | 2017-06-20T00:44:12.000Z | 2022-03-30T08:41:42.000Z | from os import sys, path
if __name__ == '__main__' and __package__ is None:
sys.path.append(path.dirname(path.dirname(path.abspath(__file__))))
from sensor_base import SensorBase
class watchExtensionsV1beta1HorizontalPodAutoscalerListForAllNamespaces(SensorBase):
def __init__(
self,
... | 34.130435 | 84 | 0.66879 |
2f7d0998a0435b80b8c05dba70ee22b8de2ce185 | 29,502 | py | Python | tests/test_modeling_gpt2.py | TiffanyHsuuuu/adapter | 9352bc33af5c7aea0ea4675c05ea5c3b049aa95c | [
"Apache-2.0"
] | null | null | null | tests/test_modeling_gpt2.py | TiffanyHsuuuu/adapter | 9352bc33af5c7aea0ea4675c05ea5c3b049aa95c | [
"Apache-2.0"
] | null | null | null | tests/test_modeling_gpt2.py | TiffanyHsuuuu/adapter | 9352bc33af5c7aea0ea4675c05ea5c3b049aa95c | [
"Apache-2.0"
] | 1 | 2022-02-13T14:33:41.000Z | 2022-02-13T14:33:41.000Z | # coding=utf-8
# Copyright 2020 The HuggingFace Team. 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 requir... | 42.448921 | 118 | 0.679649 |
302f2c50f87c0b7ba6d3a744e385f0cf1aa755bf | 4,255 | py | Python | fare/tests/test_metrics.py | caitlinkuhlman/fare | e29a8360c7de12d4efb8de083c046d962157d95c | [
"BSD-3-Clause"
] | 4 | 2019-05-15T21:03:22.000Z | 2021-03-22T20:24:53.000Z | fare/tests/test_metrics.py | caitlinkuhlman/fare | e29a8360c7de12d4efb8de083c046d962157d95c | [
"BSD-3-Clause"
] | null | null | null | fare/tests/test_metrics.py | caitlinkuhlman/fare | e29a8360c7de12d4efb8de083c046d962157d95c | [
"BSD-3-Clause"
] | null | null | null | """Testing for metrics module"""
import pytest
import numpy as np
import matplotlib.pyplot as plt
import itertools
from sklearn import manifold, datasets
#from sklearn.utils.testing import assert_equal, assert_almost_equal
# TODO should these functions go in a base file?
from fare.metrics import _pairs
from fare.m... | 31.286765 | 72 | 0.687897 |
a33966a465608dab11bd17d380af09429f3f50b5 | 141 | py | Python | CaseConfigParser.py | redoules/Ivory | c464902f02936db2b4e63c543ad064443e34b0eb | [
"MIT"
] | null | null | null | CaseConfigParser.py | redoules/Ivory | c464902f02936db2b4e63c543ad064443e34b0eb | [
"MIT"
] | null | null | null | CaseConfigParser.py | redoules/Ivory | c464902f02936db2b4e63c543ad064443e34b0eb | [
"MIT"
] | null | null | null | from configparser import ConfigParser
class CaseConfigParser(ConfigParser):
def optionxform(self, optionstr):
return optionstr
| 20.142857 | 37 | 0.77305 |
badaa68da426f71a64ff04922638607ac245d659 | 4,547 | py | Python | catalyst_rl/contrib/dl/callbacks/telegram_logger.py | rhololkeolke/catalyst-rl | ec18ff4a58b6d00652f772231db8de86debb4b3d | [
"Apache-2.0"
] | 46 | 2020-03-27T20:12:32.000Z | 2021-11-21T19:08:51.000Z | catalyst_rl/contrib/dl/callbacks/telegram_logger.py | rhololkeolke/catalyst-rl | ec18ff4a58b6d00652f772231db8de86debb4b3d | [
"Apache-2.0"
] | 2 | 2020-04-06T10:43:04.000Z | 2020-07-01T18:26:10.000Z | catalyst_rl/contrib/dl/callbacks/telegram_logger.py | rhololkeolke/catalyst-rl | ec18ff4a58b6d00652f772231db8de86debb4b3d | [
"Apache-2.0"
] | 5 | 2020-04-17T14:09:53.000Z | 2021-05-10T08:58:29.000Z | from typing import List # isort:skip
import logging
import os
from urllib.parse import quote_plus
from urllib.request import Request, urlopen
from catalyst_rl import utils
from catalyst_rl.core import _State, Callback, CallbackNode, CallbackOrder
class TelegramLogger(Callback):
"""
Logger callback, translat... | 34.976923 | 84 | 0.598417 |
bdb00537691b0182389f586de8cf73f7902135da | 10,218 | py | Python | setup_scripts/group_stream_vectors.py | dankovacek/hysets_validation | debbd410ed12fa043091c0c60cc217b688ea941b | [
"MIT"
] | null | null | null | setup_scripts/group_stream_vectors.py | dankovacek/hysets_validation | debbd410ed12fa043091c0c60cc217b688ea941b | [
"MIT"
] | null | null | null | setup_scripts/group_stream_vectors.py | dankovacek/hysets_validation | debbd410ed12fa043091c0c60cc217b688ea941b | [
"MIT"
] | null | null | null |
import os
from multiprocessing import Pool
import pandas as pd
# import rioxarray as rxr
import geopandas as gpd
import fiona
from shapely.geometry import Polygon
from shapely.ops import linemerge
import zipfile
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
processed_data_dir = os.path.... | 41.036145 | 128 | 0.613819 |
62c6b8309bc232ee86e1510ba1108c7590bf3da3 | 6,314 | py | Python | mysite_env/Lib/site-packages/pip/_internal/locations.py | Hongyil1/Django-learning-project | 13d4a5731f81a538e91d8fc7fad0587245056aea | [
"Apache-2.0"
] | null | null | null | mysite_env/Lib/site-packages/pip/_internal/locations.py | Hongyil1/Django-learning-project | 13d4a5731f81a538e91d8fc7fad0587245056aea | [
"Apache-2.0"
] | null | null | null | mysite_env/Lib/site-packages/pip/_internal/locations.py | Hongyil1/Django-learning-project | 13d4a5731f81a538e91d8fc7fad0587245056aea | [
"Apache-2.0"
] | null | null | null | """Locations where we look for configs, install stuff, etc"""
from __future__ import absolute_import
import os
import os.path
import platform
import site
import sys
import sysconfig
from distutils import sysconfig as distutils_sysconfig
from distutils.command.install import SCHEME_KEYS, install # type: ignore
from p... | 32.379487 | 79 | 0.680868 |
9b5e9abcbf445aaaff1fd9aea7db8931a121d4c7 | 2,917 | py | Python | batchcreate.py | grecoe/amlsdummy | f83ade8f75bf972f574834eae2535cfda6e2711b | [
"MIT"
] | 1 | 2020-03-20T16:38:39.000Z | 2020-03-20T16:38:39.000Z | batchcreate.py | grecoe/amlsdummy | f83ade8f75bf972f574834eae2535cfda6e2711b | [
"MIT"
] | 1 | 2020-02-28T18:03:42.000Z | 2020-02-28T18:03:42.000Z | batchcreate.py | grecoe/amlsdummy | f83ade8f75bf972f574834eae2535cfda6e2711b | [
"MIT"
] | 2 | 2020-02-12T03:30:20.000Z | 2020-02-28T00:20:06.000Z | '''
Program Code: Create Azure Machine Learning BATCH Scoring Service
NOTE: THIS PATH IS INCOMPLETE
'''
import os
import sys
import json
from scripts.azure_utils import get_auth
from contexts.btchcontext import BatchScoringContext
from scripts.argument_utils import ExperimentType, loadConfiguration
from... | 31.706522 | 95 | 0.704148 |
c117880dcd45ef147bf2e915661ba2bfed4127b0 | 788 | py | Python | PyMOTW/source/urllib.robotparser/urllib_robotparser_longlived.py | axetang/AxePython | 3b517fa3123ce2e939680ad1ae14f7e602d446a6 | [
"Apache-2.0"
] | 1 | 2019-01-04T05:47:50.000Z | 2019-01-04T05:47:50.000Z | PyMOTW/source/urllib.robotparser/urllib_robotparser_longlived.py | axetang/AxePython | 3b517fa3123ce2e939680ad1ae14f7e602d446a6 | [
"Apache-2.0"
] | 1 | 2020-07-18T03:52:03.000Z | 2020-07-18T04:18:01.000Z | PyMOTW/source/urllib.robotparser/urllib_robotparser_longlived.py | axetang/AxePython | 3b517fa3123ce2e939680ad1ae14f7e602d446a6 | [
"Apache-2.0"
] | 2 | 2021-03-06T04:28:32.000Z | 2021-03-06T04:59:17.000Z | #!/usr/bin/env python3
# encoding: utf-8
#
# Copyright (c) 2009 Doug Hellmann All rights reserved.
#
"""
"""
#end_pymotw_header
from urllib import robotparser
import time
AGENT_NAME = 'PyMOTW'
parser = robotparser.RobotFileParser()
# Using the local copy
parser.set_url('file:robots.txt')
parser.read()
parser.modified... | 19.219512 | 55 | 0.610406 |
68c29f393a8e116254b6aed9acb9c05df3283a79 | 13,155 | py | Python | HillClimbing_FieldScanning.py | ayshahilal/Hill-Climbing-on-Field-Scanning | 55e07b3700e9521cdc50ec42fcd8adb5eb1c8c51 | [
"Apache-2.0"
] | null | null | null | HillClimbing_FieldScanning.py | ayshahilal/Hill-Climbing-on-Field-Scanning | 55e07b3700e9521cdc50ec42fcd8adb5eb1c8c51 | [
"Apache-2.0"
] | null | null | null | HillClimbing_FieldScanning.py | ayshahilal/Hill-Climbing-on-Field-Scanning | 55e07b3700e9521cdc50ec42fcd8adb5eb1c8c51 | [
"Apache-2.0"
] | null | null | null | import numpy as np
import random
import pygame
import matplotlib.pyplot as plt
x_start1 = 8
y_start1 = 0
x_start2 = 4
y_start2 = 8
x_start3 = 4
y_start3 = 4
P = 200 # popülasyon büyüklügü
G = 500 # jenerasyon sayısı
u = 81 # N*N
# Drone'larin yolunu ekrana cizen fonksiyon
def plotting(drone_path, x_start, y_star... | 33.052764 | 133 | 0.589206 |
72801e9b73bc75367190ab6f85d583bde96fd0a8 | 3,650 | py | Python | testing/testing_module.py | ajbradberry96/SeniorDesignAntiNN | c88cbdf699e68102cb705d8a7000616922cb73ee | [
"MIT"
] | null | null | null | testing/testing_module.py | ajbradberry96/SeniorDesignAntiNN | c88cbdf699e68102cb705d8a7000616922cb73ee | [
"MIT"
] | 12 | 2019-12-16T21:30:53.000Z | 2022-03-11T23:40:28.000Z | testing/testing_module.py | ajbradberry96/SeniorDesignAntiNN | c88cbdf699e68102cb705d8a7000616922cb73ee | [
"MIT"
] | null | null | null | import tensorflow as tf
import pandas as pd
from testing import forward_model
from testing import detect_adversarial
from testing import image_processing
import matplotlib
import seaborn
from matplotlib import pyplot as plt
from urllib.request import urlretrieve
import PIL
import os
tf.logging.set_verbosity(tf.logg... | 24.333333 | 89 | 0.715616 |
b88b864188d20f952e3f59fdea617b91e22e7535 | 896 | py | Python | src/util/openpose.py | peabody124/hmr | 8a1c4bf81340b1489077ed3f9057fcf54e4b63ae | [
"MIT"
] | null | null | null | src/util/openpose.py | peabody124/hmr | 8a1c4bf81340b1489077ed3f9057fcf54e4b63ae | [
"MIT"
] | null | null | null | src/util/openpose.py | peabody124/hmr | 8a1c4bf81340b1489077ed3f9057fcf54e4b63ae | [
"MIT"
] | null | null | null | """
Script to convert openpose output into bbox
"""
import json
import numpy as np
def read_json(json_path):
with open(json_path) as f:
data = json.load(f)
kps = []
for people in data['people']:
kp = np.array(people['pose_keypoints_2d']).reshape(-1, 3)
kps.append(kp)
return kps... | 24.888889 | 65 | 0.607143 |
6f14df7c8690cb3d31340b7852ef65f620cd0211 | 1,992 | py | Python | labgraph/graphs/tests/test_config.py | Yunusbcr/labgraph | a00ae7098b7b0e0eda8ce2e7e62dae86854616fb | [
"MIT"
] | 124 | 2021-07-14T21:25:59.000Z | 2022-03-08T20:40:16.000Z | labgraph/graphs/tests/test_config.py | Yunusbcr/labgraph | a00ae7098b7b0e0eda8ce2e7e62dae86854616fb | [
"MIT"
] | 46 | 2021-07-16T18:41:11.000Z | 2022-03-31T20:53:00.000Z | labgraph/graphs/tests/test_config.py | Yunusbcr/labgraph | a00ae7098b7b0e0eda8ce2e7e62dae86854616fb | [
"MIT"
] | 22 | 2021-07-16T18:34:56.000Z | 2022-03-31T15:12:06.000Z | #!/usr/bin/env python3
# Copyright 2004-present Facebook. All Rights Reserved.
from enum import Enum, IntEnum
import pytest
from ...util import LabgraphError
from ..config import Config
from ..node import Node
class MyIntEnum(IntEnum):
A = 0
B = 1
class MyStrEnum(str, Enum):
A = "0"
B = "1"
cla... | 20.121212 | 86 | 0.576305 |
96777e5a44dcc75daf26d338b0f9e0ea3ecd2241 | 1,847 | py | Python | selfdrive/car/nissan/values.py | wocsor-com/openpilot | d1372c4890fd45d785789d94d5ed39bc9c8b80b7 | [
"MIT"
] | 3 | 2020-07-20T10:42:55.000Z | 2021-03-25T21:24:38.000Z | selfdrive/car/nissan/values.py | wocsor-com/openpilot | d1372c4890fd45d785789d94d5ed39bc9c8b80b7 | [
"MIT"
] | 4 | 2020-04-12T21:34:03.000Z | 2020-04-15T22:22:15.000Z | selfdrive/car/nissan/values.py | wocsor-com/openpilot | d1372c4890fd45d785789d94d5ed39bc9c8b80b7 | [
"MIT"
] | 3 | 2019-03-06T20:58:50.000Z | 2019-05-21T01:01:37.000Z | from selfdrive.car import dbc_dict
STEER_THRESHOLD = 1.0
class CAR:
XTRAIL = "NISSAN X-TRAIL 2017"
LEAF = "NISSAN LEAF 2018"
FINGERPRINTS = {
CAR.XTRAIL: [
{
2: 5, 42: 6, 346: 6, 347: 5, 348: 8, 349: 7, 361: 8, 386: 8, 389: 8, 397: 8, 398: 8, 403: 8, 520: 2, 523: 6, 548: 8, 645: 8, 658: 8, 665: 8, 6... | 61.566667 | 553 | 0.532756 |
3468713eb8cb8e07ec297d2f18c3f83a44c410ad | 15,037 | py | Python | foundation/office.py | futursolo/furtherland | 33ead7d4e651ed3154c8047e3bdc4bb2871e4468 | [
"Apache-2.0"
] | null | null | null | foundation/office.py | futursolo/furtherland | 33ead7d4e651ed3154c8047e3bdc4bb2871e4468 | [
"Apache-2.0"
] | null | null | null | foundation/office.py | futursolo/furtherland | 33ead7d4e651ed3154c8047e3bdc4bb2871e4468 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# Copyright 2015 Futur Solo
#
# 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
#
# ... | 36.059952 | 79 | 0.566004 |
32971a4d8f7c8d3007e29f91b5752dc9afb9d82a | 17,292 | py | Python | Python/empire/betsiamites/python/lexer/tokenizer/specialize_token.py | Tombmyst/Empire | f28782787c5fa9127e353549b73ec90d3c82c003 | [
"Apache-2.0"
] | null | null | null | Python/empire/betsiamites/python/lexer/tokenizer/specialize_token.py | Tombmyst/Empire | f28782787c5fa9127e353549b73ec90d3c82c003 | [
"Apache-2.0"
] | null | null | null | Python/empire/betsiamites/python/lexer/tokenizer/specialize_token.py | Tombmyst/Empire | f28782787c5fa9127e353549b73ec90d3c82c003 | [
"Apache-2.0"
] | null | null | null | from __future__ import annotations
from empire.python.typings import *
from keyword import kwlist
from empire.betsiamites.python.lexer.tokenizer.code_token import CodeToken
from empire.betsiamites.python.lexer.token_types import *
from empire.betsiamites.python.lexer.tokenizer.operators import OPERATORS_MAPPING
from e... | 54.895238 | 323 | 0.672797 |
6b83eeaa96fd3504e570d0f48d3e035fcc7cb8d6 | 684 | py | Python | footy/engine/PredictionEngine.py | dallinb/footy | d6879481a85b4a84023805bf29bd7dff32afa67f | [
"BSD-3-Clause"
] | 2 | 2020-08-27T17:59:13.000Z | 2021-10-10T02:26:20.000Z | footy/engine/PredictionEngine.py | FootyStats/footy | d6879481a85b4a84023805bf29bd7dff32afa67f | [
"BSD-3-Clause"
] | 32 | 2020-08-24T15:01:57.000Z | 2022-03-12T00:47:02.000Z | footy/engine/PredictionEngine.py | dallinb/footy | d6879481a85b4a84023805bf29bd7dff32afa67f | [
"BSD-3-Clause"
] | null | null | null | """Prediction Engine - Engine to predict the result of future fixtures."""
# calculate the results for fixtures
from footy.domain import Competition
class PredictionEngine:
"""Prediction Engine - Engine to predict the result of future fixtures."""
def __init__(self, competition):
"""Construct a compe... | 28.5 | 78 | 0.656433 |
a5be6fede88d1a5abafa62bc000bf45b8f3128da | 738 | py | Python | setup.py | franciszhangkk/VSR-master | bfa5262ae2b3e1c4e50e97a47cc80550c1607f02 | [
"MIT"
] | null | null | null | setup.py | franciszhangkk/VSR-master | bfa5262ae2b3e1c4e50e97a47cc80550c1607f02 | [
"MIT"
] | null | null | null | setup.py | franciszhangkk/VSR-master | bfa5262ae2b3e1c4e50e97a47cc80550c1607f02 | [
"MIT"
] | null | null | null | from setuptools import find_packages
from setuptools import setup
REQUIRED_PACKAGES = [
"absl-py==0.2.2",
"astor==0.6.2",
"bleach==1.5.0",
"gast==0.2.0",
"grpcio==1.12.1",
"h5py==2.8.0",
"html5lib==0.9999999",
"Keras==2.2.0",
"Keras-Applications==1.0.2",
"Keras-Preprocessing==1.... | 22.363636 | 55 | 0.590786 |
6866219807b65f8b8e19fe0b32726cd88041b368 | 11,997 | py | Python | salt/modules/boto3_sns.py | springborland/salt | bee85e477d57e9a171884e54fefb9a59d0835ed0 | [
"Apache-2.0"
] | 1 | 2020-04-09T03:25:10.000Z | 2020-04-09T03:25:10.000Z | salt/modules/boto3_sns.py | springborland/salt | bee85e477d57e9a171884e54fefb9a59d0835ed0 | [
"Apache-2.0"
] | null | null | null | salt/modules/boto3_sns.py | springborland/salt | bee85e477d57e9a171884e54fefb9a59d0835ed0 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Connection module for Amazon SNS
:configuration: This module accepts explicit sns credentials but can also
utilize IAM roles assigned to the instance through Instance Profiles. Dynamic
credentials are then automatically obtained from AWS API and no further
configuration is neces... | 30.067669 | 111 | 0.650663 |
7d899aa026577bad9dffcc0cf3a7c4b4a11d1aec | 10,981 | py | Python | netcam_aioeos/topology/eos_check_ipaddrs.py | jeremyschulman/netcam-aioeos | ae8b46bcef1bbd86441342a9a282e404d597d662 | [
"Apache-2.0"
] | null | null | null | netcam_aioeos/topology/eos_check_ipaddrs.py | jeremyschulman/netcam-aioeos | ae8b46bcef1bbd86441342a9a282e404d597d662 | [
"Apache-2.0"
] | null | null | null | netcam_aioeos/topology/eos_check_ipaddrs.py | jeremyschulman/netcam-aioeos | ae8b46bcef1bbd86441342a9a282e404d597d662 | [
"Apache-2.0"
] | 1 | 2022-01-04T19:55:12.000Z | 2022-01-04T19:55:12.000Z | # Copyright 2021 Jeremy Schulman
#
# 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 ... | 32.58457 | 105 | 0.556416 |
5ed7184e105cf171c3b238567e871221f4f2dcd0 | 3,032 | py | Python | tests/test_upgrade.py | riddopic/opta | 25fa6435fdc7e2ea9c7963ed74100fffb0743063 | [
"Apache-2.0"
] | null | null | null | tests/test_upgrade.py | riddopic/opta | 25fa6435fdc7e2ea9c7963ed74100fffb0743063 | [
"Apache-2.0"
] | null | null | null | tests/test_upgrade.py | riddopic/opta | 25fa6435fdc7e2ea9c7963ed74100fffb0743063 | [
"Apache-2.0"
] | null | null | null | import pytest
import requests
import requests_mock
from pytest_mock import MockFixture
from opta.upgrade import (
LATEST_VERSION_FILE_URL,
_get_latest_version,
check_version_upgrade,
)
TEST_LATEST_VERSION = "1.11.1"
TEST_OLD_VERSION = "1.9.6"
class TestGetLatestVersion:
def test_returns_version_numb... | 38.871795 | 90 | 0.692282 |
bbb48a071c1fbc2e2975dac4fefd85533ad9c757 | 1,287 | py | Python | test/dataset/test_speech_synthesis_dataset.py | csukuangfj/lhotse | 9b12055ca75718914c5457b33e498d1c8e8b86d8 | [
"Apache-2.0"
] | 1 | 2020-10-02T02:42:25.000Z | 2020-10-02T02:42:25.000Z | test/dataset/test_speech_synthesis_dataset.py | csukuangfj/lhotse | 9b12055ca75718914c5457b33e498d1c8e8b86d8 | [
"Apache-2.0"
] | 2 | 2020-11-05T11:44:17.000Z | 2021-04-08T11:38:48.000Z | test/dataset/test_speech_synthesis_dataset.py | csukuangfj/lhotse | 9b12055ca75718914c5457b33e498d1c8e8b86d8 | [
"Apache-2.0"
] | null | null | null | import pytest
import torch
from lhotse import CutSet
from lhotse.dataset.signal_transforms import GlobalMVN
from lhotse.dataset.speech_synthesis import SpeechSynthesisDataset
@pytest.fixture
def cut_set():
return CutSet.from_json('test/fixtures/ljspeech/cuts.json')
@pytest.mark.parametrize('transform', [None, ... | 31.390244 | 75 | 0.722611 |
a6c8fd85c43b35ec024ad4065053a7685a6bf9ee | 666 | py | Python | src/oci/osub_organization_subscription/models/__init__.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/osub_organization_subscription/models/__init__.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/osub_organization_subscription/models/__init__.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 44.4 | 245 | 0.795796 |
b71c4f1dd28d50bf22557a50bdf6bdf616f918ea | 34,861 | py | Python | src/python/pants/backend/jvm/tasks/coursier_resolve.py | revl/pants | 8ad83e4ca80c095d44efceafd8b41e575da39c65 | [
"Apache-2.0"
] | 1 | 2021-05-05T18:58:28.000Z | 2021-05-05T18:58:28.000Z | src/python/pants/backend/jvm/tasks/coursier_resolve.py | revl/pants | 8ad83e4ca80c095d44efceafd8b41e575da39c65 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/jvm/tasks/coursier_resolve.py | revl/pants | 8ad83e4ca80c095d44efceafd8b41e575da39c65 | [
"Apache-2.0"
] | 3 | 2020-06-30T08:28:13.000Z | 2021-07-28T09:35:57.000Z | # Copyright 2017 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import hashlib
import itertools
import json
import os
from collections import defaultdict
from urllib import parse
from pants.backend.jvm.ivy_utils import IvyUtils
from pants.backend.jvm.... | 39.257883 | 129 | 0.596856 |
8069146a6f993fabd8ba7f3f5047135357ea2464 | 3,188 | py | Python | kino/skills/samhangsi/generator.py | DongjunLee/kino-bot | 226aa009008e30d76e9253fe47fbe862766bdc83 | [
"MIT"
] | 109 | 2017-04-28T05:42:05.000Z | 2020-06-23T03:27:54.000Z | kino/skills/samhangsi/generator.py | DongjunLee/kino-bot | 226aa009008e30d76e9253fe47fbe862766bdc83 | [
"MIT"
] | 32 | 2016-09-18T16:35:04.000Z | 2019-05-04T16:16:21.000Z | kino/skills/samhangsi/generator.py | DongjunLee/stalker-bot | 226aa009008e30d76e9253fe47fbe862766bdc83 | [
"MIT"
] | 17 | 2017-05-15T14:19:24.000Z | 2020-05-13T15:35:11.000Z | # -- coding: utf-8 -*-
import argparse
from hbconfig import Config
import numpy as np
import tensorflow as tf
from .data_loader import TextLoader
from .model import CharRNN
class SamhangSiGenerator:
SENTENCE_LENGTH = 20
def __init__(self):
self._set_data()
self._make_estimator()
def ... | 28.212389 | 88 | 0.611669 |
6e92eabcf1dd675414052aca95fb15b3313eb44a | 384 | py | Python | 0232.implement_queue_using_stacks/solution.py | WZMJ/Algorithms | 07f648541d38e24df38bda469665c12df6a50637 | [
"MIT"
] | 5 | 2020-05-23T02:18:26.000Z | 2021-07-05T05:36:01.000Z | 0232.implement_queue_using_stacks/solution.py | WZMJ/Algorithms | 07f648541d38e24df38bda469665c12df6a50637 | [
"MIT"
] | 1 | 2020-06-10T07:17:24.000Z | 2020-07-20T02:21:24.000Z | 0232.implement_queue_using_stacks/solution.py | WZMJ/Algorithms | 07f648541d38e24df38bda469665c12df6a50637 | [
"MIT"
] | 1 | 2019-04-23T13:01:50.000Z | 2019-04-23T13:01:50.000Z | class MyQueue:
def __init__(self):
self.queue = []
def push(self, x):
self.queue.append(x)
def pop(self):
if not self.empty():
return self.queue.pop(0)
return -1
def peek(self):
if not self.empty():
return self.queue[0]
return -1... | 19.2 | 40 | 0.518229 |
dbd19b89b40e55a67b09ee61067ce0abddaeb8a0 | 9,035 | py | Python | tests/svd_test.py | mariogeiger/jax | 7098088f4eb15cf750398889e4341dbc15cda1b3 | [
"Apache-2.0"
] | null | null | null | tests/svd_test.py | mariogeiger/jax | 7098088f4eb15cf750398889e4341dbc15cda1b3 | [
"Apache-2.0"
] | 6 | 2022-01-03T23:12:33.000Z | 2022-02-14T23:13:52.000Z | tests/svd_test.py | mariogeiger/jax | 7098088f4eb15cf750398889e4341dbc15cda1b3 | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 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/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 38.776824 | 115 | 0.651467 |
01604b6339719cd95e51c95e01a3907fedc3d41b | 13,569 | py | Python | testing/test_pdb.py | emabdeen/pytest | e71a71b1fe8fe6fb341b5d273e77052bd9490da9 | [
"MIT"
] | 1 | 2018-02-26T09:45:53.000Z | 2018-02-26T09:45:53.000Z | testing/test_pdb.py | emabdeen/pytest | e71a71b1fe8fe6fb341b5d273e77052bd9490da9 | [
"MIT"
] | null | null | null | testing/test_pdb.py | emabdeen/pytest | e71a71b1fe8fe6fb341b5d273e77052bd9490da9 | [
"MIT"
] | null | null | null | from __future__ import absolute_import, division, print_function
import sys
import platform
import _pytest._code
import pytest
def runpdb_and_get_report(testdir, source):
p = testdir.makepyfile(source)
result = testdir.runpytest_inprocess("--pdb", p)
reports = result.reprec.getreports("pytest_runtest_log... | 31.050343 | 82 | 0.539096 |
020ee12201b9c9cd9f39693d121fef8cd1264c61 | 1,260 | py | Python | tests/test_hw1.py | vcu-aldaniels/root_homework1 | a6271280376b0f9aae6f4e6341f89cae703ab0cb | [
"Apache-2.0"
] | null | null | null | tests/test_hw1.py | vcu-aldaniels/root_homework1 | a6271280376b0f9aae6f4e6341f89cae703ab0cb | [
"Apache-2.0"
] | null | null | null | tests/test_hw1.py | vcu-aldaniels/root_homework1 | a6271280376b0f9aae6f4e6341f89cae703ab0cb | [
"Apache-2.0"
] | null | null | null | """Test cases are important."""
from homework1 import hw1
def test_return_number_3():
"""Make sure the return of the function is 3, integer"""
assert hw1.return_number_3() == 3
def test_return_string_vcu():
"""Make sure the return of the function is the string vcu"""
assert hw1.return_string_vcu
... | 30.731707 | 90 | 0.692063 |
a169a142c2813569f87dc5eb11dfcca7dc2f9361 | 539 | py | Python | sdk/SpellCheck/spell_check_client/__init__.py | WMRamadan/bing-search-sdk-for-python | 276d9cd6963c939081b3dec91bdd9aded42b3b35 | [
"MIT"
] | 12 | 2021-03-11T20:24:12.000Z | 2022-02-10T22:55:03.000Z | sdk/SpellCheck/spell_check_client/__init__.py | WMRamadan/bing-search-sdk-for-python | 276d9cd6963c939081b3dec91bdd9aded42b3b35 | [
"MIT"
] | null | null | null | sdk/SpellCheck/spell_check_client/__init__.py | WMRamadan/bing-search-sdk-for-python | 276d9cd6963c939081b3dec91bdd9aded42b3b35 | [
"MIT"
] | 10 | 2021-03-09T17:02:48.000Z | 2022-02-12T18:40:01.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Code generated by Microsoft (R) AutoRest Code Generator (autorest: 3.0.6320, generator: {generator})
# Changes may cause incorrect behavior and will be lost if the code is regenerated.
# ---------------------------------------... | 35.933333 | 102 | 0.539889 |
574ede8c2d7b6644979c0387e7212e2b4b08bb47 | 2,403 | py | Python | node_server/__init__.py | sommersoft/RosiePi_Node_Server | 2cb46ee8e7e9f1a42f76adc83ea9d17dc4f61335 | [
"MIT"
] | null | null | null | node_server/__init__.py | sommersoft/RosiePi_Node_Server | 2cb46ee8e7e9f1a42f76adc83ea9d17dc4f61335 | [
"MIT"
] | 1 | 2020-06-06T16:03:37.000Z | 2020-06-06T16:03:37.000Z | node_server/__init__.py | sommersoft/RosiePi_Node_Server | 2cb46ee8e7e9f1a42f76adc83ea9d17dc4f61335 | [
"MIT"
] | 1 | 2020-06-06T15:50:58.000Z | 2020-06-06T15:50:58.000Z | # The MIT License (MIT)
#
# Copyright (c) 2019 Michael Schroeder
#
# 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,... | 36.409091 | 79 | 0.708697 |
303b1b497be89beee20b296f5e5f046d483e102f | 906 | py | Python | Base_Awesome_Collect/save_local.py | Anant/awesome-transform | a11daa9a821da8d0add74a205b1af370b38d6799 | [
"Apache-2.0"
] | 1 | 2018-08-28T10:09:16.000Z | 2018-08-28T10:09:16.000Z | Base_Awesome_Collect/save_local.py | Anant/awesome-transform | a11daa9a821da8d0add74a205b1af370b38d6799 | [
"Apache-2.0"
] | 2 | 2018-03-20T22:27:55.000Z | 2018-03-20T23:00:01.000Z | Base_Awesome_Collect/save_local.py | Anant/awesome-transform | a11daa9a821da8d0add74a205b1af370b38d6799 | [
"Apache-2.0"
] | null | null | null | from app import db
from app.model import Document
from sqlalchemy.orm import Session
import createDb
# Create a db session
sess = Session(db)
def pr_insert_document(docId, url):
# Store processing state in sql
sqldoc = Document(docId, url)
if documentProcessed(url) == 0:
sess.add(sqldoc)
s... | 25.885714 | 73 | 0.629139 |
648e548465530a01b746313eeb666f815eed931c | 11,166 | py | Python | examples/Ni__eam__born_exp_rose/01_preconditioning_3.5NN/data/Ni__eam__born_exp_rose.py | eragasa/pypospack | 21cdecaf3b05c87acc532d992be2c04d85bfbc22 | [
"MIT"
] | 4 | 2018-01-18T19:59:56.000Z | 2020-08-25T11:56:52.000Z | examples/Ni__eam__born_exp_rose/01_preconditioning_3.5NN/data/Ni__eam__born_exp_rose.py | eragasa/pypospack | 21cdecaf3b05c87acc532d992be2c04d85bfbc22 | [
"MIT"
] | 1 | 2018-04-22T23:02:13.000Z | 2018-04-22T23:02:13.000Z | examples/Ni__eam__born_exp_rose/01_preconditioning_3.5NN/data/Ni__eam__born_exp_rose.py | eragasa/pypospack | 21cdecaf3b05c87acc532d992be2c04d85bfbc22 | [
"MIT"
] | 1 | 2019-09-14T07:04:42.000Z | 2019-09-14T07:04:42.000Z | import os
from collections import OrderedDict
from pypospack.qoi import QoiDatabase
import pypospack.utils
#------------------------------------------------------------------------------
# CONFIGURATION SECTION FOR PYPOSMAT PARETO FITTING
#------------------------------------------------------------------------------
#... | 40.456522 | 114 | 0.591617 |
144dbc378cec0957df521a475d4b8eef8b528c65 | 1,159 | py | Python | day9.py | mayitbeegh/advent-of-code-2020 | 1b35bdad595db3ce72712e5e81163ae7f48c344c | [
"MIT"
] | 3 | 2020-12-07T22:20:32.000Z | 2020-12-07T22:21:56.000Z | day9.py | mayitbeegh/advent-of-code-2020 | 1b35bdad595db3ce72712e5e81163ae7f48c344c | [
"MIT"
] | null | null | null | day9.py | mayitbeegh/advent-of-code-2020 | 1b35bdad595db3ce72712e5e81163ae7f48c344c | [
"MIT"
] | null | null | null | from collections import deque
def part_one(inputs, length):
numbers = list(map(int, inputs))
preamble = deque(numbers[:length], maxlen=length)
for number in numbers[length:]:
if check_valid(preamble, number):
preamble.append(number)
else:
return number
def ch... | 21.072727 | 64 | 0.612597 |
60afc46e189d02665921594ec4519ed356d9db71 | 191 | py | Python | mowgli_etl/pipeline/swow/swow_constants.py | tetherless-world/mowgli | 28c19eba41e03e053ae4addff56a313d926e18d7 | [
"MIT"
] | 4 | 2021-01-15T15:36:23.000Z | 2021-09-01T06:52:05.000Z | mowgli_etl/pipeline/swow/swow_constants.py | tetherless-world/mowgli | 28c19eba41e03e053ae4addff56a313d926e18d7 | [
"MIT"
] | 63 | 2020-05-04T13:48:04.000Z | 2020-06-06T02:32:58.000Z | mowgli_etl/pipeline/swow/swow_constants.py | tetherless-world/mowgli-etl | 28c19eba41e03e053ae4addff56a313d926e18d7 | [
"MIT"
] | null | null | null | from mowgli_etl.paths import DATA_DIR
SWOW_NAMESPACE = 'swow'
SWOW_DATASOURCE_ID = 'swow'
SWOW_ARCHIVE_PATH = DATA_DIR / 'swow' / 'SWOW-EN.R100.csv.bz2'
SWOW_CSV_FILE_KEY = 'swow_csv_file'
| 23.875 | 62 | 0.774869 |
a4503a33be696fb2c8b9e8fe5cd946ff7b2f1d88 | 1,184 | py | Python | bionir_pipeline/common/clausie/clausiewrapper.py | neo2100/BioNIR_Pipeline | ba1995e18b14956053bf43d76b1702f8ff5d18bf | [
"BSD-2-Clause"
] | null | null | null | bionir_pipeline/common/clausie/clausiewrapper.py | neo2100/BioNIR_Pipeline | ba1995e18b14956053bf43d76b1702f8ff5d18bf | [
"BSD-2-Clause"
] | null | null | null | bionir_pipeline/common/clausie/clausiewrapper.py | neo2100/BioNIR_Pipeline | ba1995e18b14956053bf43d76b1702f8ff5d18bf | [
"BSD-2-Clause"
] | null | null | null | import os
from subprocess import Popen
from sys import stderr
class ClausIEWrapper:
@staticmethod
def run_clausie(input_filename, output_filename, verbose=False):
source_dir = os.path.dirname(os.path.abspath(__file__))
jars = '{0}/clausie:{0}/clausie/build:{0}/clausie/clausie_lib/stanford-pa... | 34.823529 | 210 | 0.652872 |
da3d5e31746e52f61af5cdc2f788fdb6940aeea9 | 123 | py | Python | apps/projects/admin.py | ExpoAshique/ProveBanking__s | f0b45fffea74d00d14014be27aa50fe5f42f6903 | [
"MIT"
] | null | null | null | apps/projects/admin.py | ExpoAshique/ProveBanking__s | f0b45fffea74d00d14014be27aa50fe5f42f6903 | [
"MIT"
] | null | null | null | apps/projects/admin.py | ExpoAshique/ProveBanking__s | f0b45fffea74d00d14014be27aa50fe5f42f6903 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import ProposedResourceStatus
admin.site.register(ProposedResourceStatus)
| 17.571429 | 43 | 0.853659 |
921b0b9abe44981d8d6ba390f014684a33b8f278 | 3,293 | py | Python | train_joint_morph_id.py | iwbn/age-joint-loss-tensorflow | 0968acd48ae8e87577e7b64e56a25b960589a759 | [
"BSD-2-Clause"
] | 17 | 2018-11-25T21:02:17.000Z | 2021-05-03T11:39:16.000Z | train_joint_morph_id.py | iwbn/age-joint-loss-tensorflow | 0968acd48ae8e87577e7b64e56a25b960589a759 | [
"BSD-2-Clause"
] | 1 | 2019-01-22T10:47:24.000Z | 2019-01-23T07:12:19.000Z | train_joint_morph_id.py | iwbn/age-joint-loss-tensorflow | 0968acd48ae8e87577e7b64e56a25b960589a759 | [
"BSD-2-Clause"
] | 1 | 2019-12-25T02:03:05.000Z | 2019-12-25T02:03:05.000Z | from model.joint import AgeModelMorph
import tensorflow as tf
import sys, os
flags = tf.app.flags
FLAGS = flags.FLAGS
flags.DEFINE_integer('fold_number', 0, 'Morph fold number.')
flags.DEFINE_string('log_dir', "path-to-log", 'Log is saved to this directory.')
flags.DEFINE_string('loss_weights', "1.0,0.01", 'triplet,xe... | 42.217949 | 103 | 0.668995 |
c0c49d2390ef5ecc80379373c0b5bcc9178956cd | 36,733 | py | Python | helper_functions.py | goldsmdn/SteaneCode | dc9a2a2f54b93d44d1249c7ff1acbb0188e46c2e | [
"Apache-2.0"
] | 1 | 2021-12-21T14:52:12.000Z | 2021-12-21T14:52:12.000Z | helper_functions.py | goldsmdn/SteaneCode | dc9a2a2f54b93d44d1249c7ff1acbb0188e46c2e | [
"Apache-2.0"
] | 62 | 2021-04-02T15:33:02.000Z | 2021-09-01T08:47:29.000Z | helper_functions.py | goldsmdn/SteaneCode | dc9a2a2f54b93d44d1249c7ff1acbb0188e46c2e | [
"Apache-2.0"
] | 1 | 2022-02-11T15:32:55.000Z | 2022-02-11T15:32:55.000Z | #helper_functions.py
from qiskit.providers.aer.noise import NoiseModel
from qiskit.providers.aer.noise.errors import (
pauli_error,
depolarizing_error,
)
from statistics import stdev
from math import sqrt
from datetime import datetime
SPACE = ' '
def string_reverse(input_string):
"""Reverses a strin... | 36.261599 | 137 | 0.596276 |
cf44c411bebc7cddfb123d9d1492d7bfc758f934 | 3,957 | py | Python | src/utils/sensor_listener.py | WhiteHyun/smart-locker | a5b87309741cf9ae4134dda8936edcb258068301 | [
"MIT"
] | null | null | null | src/utils/sensor_listener.py | WhiteHyun/smart-locker | a5b87309741cf9ae4134dda8936edcb258068301 | [
"MIT"
] | 27 | 2021-02-12T15:40:24.000Z | 2021-05-24T07:32:54.000Z | src/utils/sensor_listener.py | WhiteHyun/smart-locker | a5b87309741cf9ae4134dda8936edcb258068301 | [
"MIT"
] | 1 | 2021-10-05T13:45:36.000Z | 2021-10-05T13:45:36.000Z | import serial
from multiprocessing import *
if __name__ == "__main__" or __name__ == "sensor_listener":
from util import dict2Query, connect_arduino
from sql import SQL
else:
from .util import dict2Query, connect_arduino
from .sql import SQL
class SensorListener:
"""아두이노(여러 함)로 부터 센싱값을 듣는(Listenin... | 32.975 | 120 | 0.488501 |
31332732bbdc48abc071aabf79f399dcd51ecadf | 10,087 | bzl | Python | research/seq_flow_lite/tf_ops/repo.bzl | NasTul/models | 4fabd84c5c5e2b34a1b95431788f7801de036421 | [
"Apache-2.0"
] | 82,518 | 2016-02-05T12:07:23.000Z | 2022-03-31T23:09:47.000Z | research/seq_flow_lite/tf_ops/repo.bzl | NasTul/models | 4fabd84c5c5e2b34a1b95431788f7801de036421 | [
"Apache-2.0"
] | 9,021 | 2016-03-08T01:02:05.000Z | 2022-03-31T08:06:35.000Z | research/seq_flow_lite/tf_ops/repo.bzl | NasTul/models | 4fabd84c5c5e2b34a1b95431788f7801de036421 | [
"Apache-2.0"
] | 54,341 | 2016-02-06T17:19:55.000Z | 2022-03-31T10:27:44.000Z | """Reverb custom external dependencies."""
# Sanitize a dependency so that it works correctly from code that includes
# reverb as a submodule.
def clean_dep(dep):
return str(Label(dep))
def get_python_path(ctx):
path = ctx.os.environ.get("PYTHON_BIN_PATH")
if not path:
fail(
"Could not... | 30.020833 | 124 | 0.628234 |
e4d30d50c157e9f6875a2690c69f79d1e83ff1c3 | 2,799 | py | Python | tests/integration/sugar/test_reliable_submission.py | mDuo13/xrpl-py | 70f927dcd2dbb8644b3e210b0a8de2a214e71e3d | [
"0BSD"
] | null | null | null | tests/integration/sugar/test_reliable_submission.py | mDuo13/xrpl-py | 70f927dcd2dbb8644b3e210b0a8de2a214e71e3d | [
"0BSD"
] | null | null | null | tests/integration/sugar/test_reliable_submission.py | mDuo13/xrpl-py | 70f927dcd2dbb8644b3e210b0a8de2a214e71e3d | [
"0BSD"
] | null | null | null | from unittest import TestCase
from tests.integration.it_utils import JSON_RPC_CLIENT
from tests.integration.reusable_values import DESTINATION as DESTINATION_WALLET
from tests.integration.reusable_values import FEE, WALLET
from xrpl.account import get_next_valid_seq_number
from xrpl.models.transactions import AccountS... | 39.422535 | 86 | 0.709182 |
476ff451ee1083b3aca8ffc87f863b3c931ece50 | 1,250 | py | Python | 1_1.py | tanny2015/Code_189 | 3cbd57ed7e3d7da69800696be6481620362dce76 | [
"MIT"
] | null | null | null | 1_1.py | tanny2015/Code_189 | 3cbd57ed7e3d7da69800696be6481620362dce76 | [
"MIT"
] | null | null | null | 1_1.py | tanny2015/Code_189 | 3cbd57ed7e3d7da69800696be6481620362dce76 | [
"MIT"
] | null | null | null |
#Solution 1
def add_and_check(key, hmap): # key is char
if key in hmap:
hmap[key] += 1
else:
hmap[key] = 1
if hmap[key] > 1:
return False # has duplicate
else:
return True # unique
def check_duplicate(str):
hmap = dict()
for ch in str:
... | 17.361111 | 55 | 0.4616 |
22c0a5476b98c5b62f5242cd1e07000f787e03b2 | 1,826 | py | Python | py/scripts/pointing_offsets.py | ameisner/ci_reduce | 17d1e339c72ab115bceaf67e3d73b399e527b49c | [
"BSD-3-Clause"
] | null | null | null | py/scripts/pointing_offsets.py | ameisner/ci_reduce | 17d1e339c72ab115bceaf67e3d73b399e527b49c | [
"BSD-3-Clause"
] | 13 | 2019-02-08T02:11:01.000Z | 2019-09-10T02:11:28.000Z | py/scripts/pointing_offsets.py | ameisner/ci_reduce | 17d1e339c72ab115bceaf67e3d73b399e527b49c | [
"BSD-3-Clause"
] | 2 | 2019-12-23T15:25:32.000Z | 2020-12-22T13:43:52.000Z | #!/usr/bin/env python
import argparse
import gfa_reduce.gfa_red as gfa_red
import astropy.io.fits as fits
import numpy as np
import os
basedir = '/exposures/desi'
def pointing_offsets(fm, fname_in):
if fm is None:
print('did not obtain a good FieldModel???')
h = fits.getheader(fname_in, extname='GFA... | 28.984127 | 86 | 0.662103 |
a0ba6658f36d285887c34a73705d73c6178607d1 | 2,191 | py | Python | functions/heroku.py | Zslez/AttentiAlBot | 2c2ea5c8bfefe5f38a5f98ab2f13e59de748f355 | [
"MIT"
] | 5 | 2021-08-13T02:03:06.000Z | 2022-03-09T01:00:16.000Z | functions/heroku.py | Zslez/AttentiAlBot | 2c2ea5c8bfefe5f38a5f98ab2f13e59de748f355 | [
"MIT"
] | null | null | null | functions/heroku.py | Zslez/AttentiAlBot | 2c2ea5c8bfefe5f38a5f98ab2f13e59de748f355 | [
"MIT"
] | null | null | null | # letteralmente io che aggiro i limiti del server che mi hosta il Bot, così da tenerlo attivo 24/7 per sempre
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.support.ui import WebDriverWait
from selenium import webdriver
from s... | 33.707692 | 109 | 0.680968 |
4ff9b453191e9ec651fd1b4c1161e2675fb0f8a8 | 636 | py | Python | src/odontology/register/migrations/0013_auto_20160221_2224.py | nanomolina/JP | 248a47bced4dac850f85d28968ddf279cd123400 | [
"Apache-2.0"
] | 2 | 2016-06-23T15:35:29.000Z | 2022-01-11T00:55:21.000Z | src/odontology/register/migrations/0013_auto_20160221_2224.py | nanomolina/JP | 248a47bced4dac850f85d28968ddf279cd123400 | [
"Apache-2.0"
] | 27 | 2016-06-24T12:28:01.000Z | 2022-01-13T00:37:25.000Z | src/odontology/register/migrations/0013_auto_20160221_2224.py | nanomolina/JP | 248a47bced4dac850f85d28968ddf279cd123400 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.9.2 on 2016-02-22 01:24
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('register', '0012_benefit_detailbenefit'),
]
operations = [
migrations.Rename... | 24.461538 | 74 | 0.603774 |
f6223e14293dc84baace4fd48863dae2158880e2 | 8,069 | py | Python | src/sqlfluff/rules/L010.py | tinder-albertyue/sqlfluff | 992bd8d02465c9a57f29d58d5c328e8f548f6cc9 | [
"MIT"
] | 1 | 2021-12-29T18:34:20.000Z | 2021-12-29T18:34:20.000Z | src/sqlfluff/rules/L010.py | tinder-albertyue/sqlfluff | 992bd8d02465c9a57f29d58d5c328e8f548f6cc9 | [
"MIT"
] | null | null | null | src/sqlfluff/rules/L010.py | tinder-albertyue/sqlfluff | 992bd8d02465c9a57f29d58d5c328e8f548f6cc9 | [
"MIT"
] | null | null | null | """Implementation of Rule L010."""
import regex
from typing import Tuple, List
from sqlfluff.core.rules.base import BaseRule, LintResult, LintFix, RuleContext
from sqlfluff.core.rules.config_info import get_config_info
from sqlfluff.core.rules.doc_decorators import (
document_fix_compatible,
document_configura... | 38.42381 | 93 | 0.588921 |
3d78c8c7fd96e551792f553b5408e534347a298f | 1,238 | py | Python | geoq/accounts/utils.py | kaydoh/geoq | 6f10818d0cc3cef4ba8113e8b047d27e79b2f8b0 | [
"MIT"
] | 471 | 2015-01-05T15:16:26.000Z | 2022-03-28T05:06:11.000Z | geoq/accounts/utils.py | kaydoh/geoq | 6f10818d0cc3cef4ba8113e8b047d27e79b2f8b0 | [
"MIT"
] | 109 | 2015-01-06T20:00:58.000Z | 2022-03-11T23:17:53.000Z | geoq/accounts/utils.py | kaydoh/geoq | 6f10818d0cc3cef4ba8113e8b047d27e79b2f8b0 | [
"MIT"
] | 100 | 2015-01-05T15:16:39.000Z | 2021-12-01T12:13:13.000Z | # -*- coding: utf-8 -*-
# This technical data was produced for the U. S. Government under Contract No. W15P7T-13-C-F600, and
# is subject to the Rights in Technical Data-Noncommercial Items clause at DFARS 252.227-7013 (FEB 2012)
from django.conf import settings
import requests
import collections
def get_openbadges_... | 28.790698 | 104 | 0.61874 |
864664decd50a36a55223c676e2cef1671a8abe0 | 663 | py | Python | mamotif/cli/intergrate.py | shao-lab/MAmotif | eae1bfefc74934f49565371b06971a9781d00528 | [
"BSD-3-Clause"
] | 3 | 2019-02-09T02:15:38.000Z | 2020-11-14T07:35:42.000Z | mamotif/cli/intergrate.py | shao-lab/MAmotif | eae1bfefc74934f49565371b06971a9781d00528 | [
"BSD-3-Clause"
] | null | null | null | mamotif/cli/intergrate.py | shao-lab/MAmotif | eae1bfefc74934f49565371b06971a9781d00528 | [
"BSD-3-Clause"
] | null | null | null | """
mamotif.cli.integrate
---------------------
Integrate MAnorm and MotifScan results to run MAmoitf.
"""
from manorm.logging import setup_logger as setup_manorm_logger
from motifscan.logging import setup_logger as setup_motifscan_logger
from mamotif.integration import run_integration
def run(args):
setup_man... | 30.136364 | 69 | 0.757164 |
bd30628f941e974fb6d3ca704d16c7fde928a187 | 19,430 | py | Python | mkt/webapps/indexers.py | eviljeff/zamboni | c446a9fc75513c9eef3ff7b1f0e23bbab29f0e68 | [
"BSD-3-Clause"
] | null | null | null | mkt/webapps/indexers.py | eviljeff/zamboni | c446a9fc75513c9eef3ff7b1f0e23bbab29f0e68 | [
"BSD-3-Clause"
] | null | null | null | mkt/webapps/indexers.py | eviljeff/zamboni | c446a9fc75513c9eef3ff7b1f0e23bbab29f0e68 | [
"BSD-3-Clause"
] | null | null | null | from operator import attrgetter
from django.core.urlresolvers import reverse
from django.db.models import Min
import commonware.log
from elasticsearch_dsl import F
from elasticsearch_dsl.filter import Bool
import mkt
from mkt.constants import APP_FEATURES
from mkt.constants.applications import DEVICE_GAIA
from mkt.p... | 41.875 | 79 | 0.506125 |
72ce6419993ed6fd2a5a602017ffcb245eb6b11c | 1,472 | py | Python | convert.py | fogleman/Punchcard | 9ca59fb696beb6b6f19767bc429e9cef49eb30ff | [
"MIT"
] | 98 | 2015-01-05T19:21:38.000Z | 2022-03-08T20:26:01.000Z | convert.py | fogleman/Punchcard | 9ca59fb696beb6b6f19767bc429e9cef49eb30ff | [
"MIT"
] | 2 | 2016-11-17T15:06:13.000Z | 2018-06-19T18:55:02.000Z | convert.py | fogleman/Punchcard | 9ca59fb696beb6b6f19767bc429e9cef49eb30ff | [
"MIT"
] | 9 | 2015-01-06T01:25:47.000Z | 2021-05-22T19:43:03.000Z | '''
This utility script converts (row, col, value) records like this:
2,6,9
2,7,23
2,8,74
...
6,20,76
6,21,27
6,22,0
Into a tabular format like this:
,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22
2,9,23,74,225,351,434,513,666,710,890,776,610,435,166,100,46,1
3,12,29,53,166,250,369,370,4... | 26.285714 | 65 | 0.589674 |
c9a55f81a0386ea9802fbfbaf46dcaa582f9ea21 | 136 | py | Python | Python3/1020.py | Di-Ca-N/URI-Online-Judge | 160797b534fe8c70e719b1ea41690157dbdbb52e | [
"MIT"
] | null | null | null | Python3/1020.py | Di-Ca-N/URI-Online-Judge | 160797b534fe8c70e719b1ea41690157dbdbb52e | [
"MIT"
] | null | null | null | Python3/1020.py | Di-Ca-N/URI-Online-Judge | 160797b534fe8c70e719b1ea41690157dbdbb52e | [
"MIT"
] | null | null | null | n = int(input())
anos = n//365
meses = n%365//30
dias = n%365%30
print('''{} ano(s)
{} mes(es)
{} dia(s)'''.format(anos, meses, dias))
| 15.111111 | 39 | 0.551471 |
ca3aba4c1388d7f175b57cb35d4ede65f9aafa14 | 535 | py | Python | adventofcode/2020/13/2.py | jan25/code_sorted | f405fd0898f72eb3d5428f9e10aefb4a009d5089 | [
"Unlicense"
] | 2 | 2018-01-18T11:01:36.000Z | 2021-12-20T18:14:48.000Z | adventofcode/2020/13/2.py | jan25/code_sorted | f405fd0898f72eb3d5428f9e10aefb4a009d5089 | [
"Unlicense"
] | null | null | null | adventofcode/2020/13/2.py | jan25/code_sorted | f405fd0898f72eb3d5428f9e10aefb4a009d5089 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python3
import fileinput
lines = [l.strip() for l in fileinput.input()]
ids = list(filter(lambda p: p[1] != 'x', enumerate(lines[1].split(','))))
ids = [(int(p[1]), p[0]) for p in ids]
def inv(a, m):
prod = 1
for _ in range(m - 2): prod *= a
return prod % m
M = 1
for i in ids: M *= i[0]
#... | 19.107143 | 73 | 0.521495 |
cef76faded51740bfa2c72130d73a780e09e7784 | 17,485 | py | Python | pybind/nos/v7_1_0/interface/port_channel/ipv6/ipv6_config/address/ipv6_address/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/nos/v7_1_0/interface/port_channel/ipv6/ipv6_config/address/ipv6_address/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/nos/v7_1_0/interface/port_channel/ipv6/ipv6_config/address/ipv6_address/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | 1 | 2021-11-05T22:15:42.000Z | 2021-11-05T22:15:42.000Z |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | 74.722222 | 1,071 | 0.689677 |
d0dda897eb68c789b1e40fbcdd5c8bed246c3935 | 26,745 | py | Python | localstack/utils/bootstrap.py | kubawach/localstack | 641b890e9328ad3d010570766109c646d1f10a3a | [
"Apache-2.0"
] | 1 | 2021-06-08T12:59:41.000Z | 2021-06-08T12:59:41.000Z | localstack/utils/bootstrap.py | kubawach/localstack | 641b890e9328ad3d010570766109c646d1f10a3a | [
"Apache-2.0"
] | 1 | 2021-03-01T13:55:42.000Z | 2021-03-01T13:55:42.000Z | localstack/utils/bootstrap.py | kubawach/localstack | 641b890e9328ad3d010570766109c646d1f10a3a | [
"Apache-2.0"
] | null | null | null | import os
import re
import sys
import json
import time
import select
import pkgutil
import logging
import warnings
import threading
import traceback
import subprocess
import six
import shutil
import pip as pip_mod
from datetime import datetime
from concurrent.futures._base import Future
from localstack import constants... | 35.899329 | 117 | 0.631744 |
f3e0fef01b18881c0ff76fe35ae244f16c41ace6 | 6,334 | py | Python | mail.py | hidenorly/mailpy | 1e8d574d4df39178e5dc9593dfecc26810524116 | [
"Apache-2.0"
] | null | null | null | mail.py | hidenorly/mailpy | 1e8d574d4df39178e5dc9593dfecc26810524116 | [
"Apache-2.0"
] | null | null | null | mail.py | hidenorly/mailpy | 1e8d574d4df39178e5dc9593dfecc26810524116 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
#
# Copyright (C) 2016 hidenorly
#
# 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 ... | 31.989899 | 180 | 0.696085 |
e44bbdef0e31d2a9e9daf422e2e00a2846f4b454 | 56,113 | py | Python | doc/conf.py | john-veillette/mne-python | 2b68c6ecb7cb735c00fa393898a8c0996b4cd0b5 | [
"BSD-3-Clause"
] | 1 | 2021-12-21T16:16:40.000Z | 2021-12-21T16:16:40.000Z | doc/conf.py | john-veillette/mne-python | 2b68c6ecb7cb735c00fa393898a8c0996b4cd0b5 | [
"BSD-3-Clause"
] | null | null | null | doc/conf.py | john-veillette/mne-python | 2b68c6ecb7cb735c00fa393898a8c0996b4cd0b5 | [
"BSD-3-Clause"
] | 1 | 2021-07-22T17:57:33.000Z | 2021-07-22T17:57:33.000Z | # -*- coding: utf-8 -*-
#
# Configuration file for the Sphinx documentation builder.
#
# This file only contains a selection of the most common options. For a full
# list see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html
import gc
import os
import subprocess
import sys
import time
... | 47.634126 | 300 | 0.637588 |
4c697a25893d5c5e940ceaf6bf5d418ca5da5178 | 14,412 | py | Python | sdk/python/pulumi_azure_nextgen/datalakestore/v20161101/get_account.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/datalakestore/v20161101/get_account.py | test-wiz-sec/pulumi-azure-nextgen | 20a695af0d020b34b0f1c336e1b69702755174cc | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_nextgen/datalakestore/v20161101/get_account.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... | 40.943182 | 501 | 0.672981 |
5b0b8c1d2901c6d121df3ce1be9e57eeb0c76faf | 338 | py | Python | examples/docs_snippets/docs_snippets/concepts/assets/multi_component_asset_key.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | examples/docs_snippets/docs_snippets/concepts/assets/multi_component_asset_key.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | examples/docs_snippets/docs_snippets/concepts/assets/multi_component_asset_key.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | 1 | 2019-09-11T03:02:27.000Z | 2019-09-11T03:02:27.000Z | # pylint: disable=redefined-outer-name
# start_marker
from dagster import AssetIn, asset
@asset(namespace=["one", "two", "three"])
def upstream_asset():
return [1, 2, 3]
@asset(ins={"upstream_asset": AssetIn(namespace=["one", "two", "three"])})
def downstream_asset(upstream_asset):
return upstream_asset + [... | 19.882353 | 74 | 0.698225 |
a76154bde212337880ee06fe58ef61c6ad1979ff | 3,502 | py | Python | utils.py | zyan97/Bert-Chinese-Text-Classification-Pytorch | c5d67c15e29eda33db561cb76d9eee73dfc2caa2 | [
"MIT"
] | null | null | null | utils.py | zyan97/Bert-Chinese-Text-Classification-Pytorch | c5d67c15e29eda33db561cb76d9eee73dfc2caa2 | [
"MIT"
] | null | null | null | utils.py | zyan97/Bert-Chinese-Text-Classification-Pytorch | c5d67c15e29eda33db561cb76d9eee73dfc2caa2 | [
"MIT"
] | null | null | null | # coding: UTF-8
import torch
from tqdm import tqdm
import time
from datetime import timedelta
PAD, CLS = '[PAD]', '[CLS]' # padding符号, bert中综合信息符号
def load_dataset(config, path, pad_size=32):
sample_list = {}
sentences = []
contents = []
with open(path, 'r', encoding='UTF-8') as f:
for line ... | 32.12844 | 100 | 0.589377 |
c620286f7f15e6524b8259a1093b0d409b4559fa | 1,395 | py | Python | airflow/migrations/versions/c8ffec048a3b_add_fields_to_dag.py | emilioego/airflow | 3457c7847cd24413ff5b622e65c27d8370f94502 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 79 | 2021-10-15T07:32:27.000Z | 2022-03-28T04:10:19.000Z | airflow/migrations/versions/c8ffec048a3b_add_fields_to_dag.py | emilioego/airflow | 3457c7847cd24413ff5b622e65c27d8370f94502 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 210 | 2021-07-17T00:25:52.000Z | 2021-12-29T00:44:48.000Z | airflow/migrations/versions/c8ffec048a3b_add_fields_to_dag.py | emilioego/airflow | 3457c7847cd24413ff5b622e65c27d8370f94502 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 23 | 2021-10-15T02:36:37.000Z | 2022-03-17T02:59:27.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 31 | 81 | 0.746237 |
07957484b18fee08a9cf6f4a595a3caf31b2996b | 9,714 | py | Python | malaya_speech/train/loss.py | dtx525942103/malaya-speech | 212c4e890d0cbcbbca0037c89a698b68b05db393 | [
"MIT"
] | null | null | null | malaya_speech/train/loss.py | dtx525942103/malaya-speech | 212c4e890d0cbcbbca0037c89a698b68b05db393 | [
"MIT"
] | null | null | null | malaya_speech/train/loss.py | dtx525942103/malaya-speech | 212c4e890d0cbcbbca0037c89a698b68b05db393 | [
"MIT"
] | 1 | 2021-08-19T02:34:41.000Z | 2021-08-19T02:34:41.000Z | import tensorflow as tf
from .utils import check_params
def calculate_3d_loss(y_gt, y_pred, loss_fn):
"""Calculate 3d loss, normally it's mel-spectrogram loss."""
y_gt_T = tf.shape(y_gt)[1]
y_pred_T = tf.shape(y_pred)[1]
def f1():
return tf.slice(y_gt, [0, 0, 0], [-1, y_pred_T, -1])
def ... | 33.612457 | 105 | 0.574635 |
07ebf9a52eb74250204d6e5118a4569dd1867c76 | 22,978 | py | Python | test/functional/test_framework/util.py | donPabloNow/digiwage | 87491caf8563779b1bb69866e102cb8a1439b427 | [
"MIT"
] | 14 | 2018-03-19T23:28:42.000Z | 2022-03-11T08:58:01.000Z | test/functional/test_framework/util.py | donPabloNow/digiwage | 87491caf8563779b1bb69866e102cb8a1439b427 | [
"MIT"
] | 4 | 2018-03-30T13:55:22.000Z | 2022-01-30T21:17:25.000Z | test/functional/test_framework/util.py | donPabloNow/digiwage | 87491caf8563779b1bb69866e102cb8a1439b427 | [
"MIT"
] | 22 | 2018-04-08T07:41:41.000Z | 2022-03-11T03:29:25.000Z | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Helpful routines for regression testing."""
from base64 import b64encode
from binascii import hexlify,... | 38.043046 | 142 | 0.6501 |
853352959a7a13afe97c9dde1ff7127d059db19e | 4,365 | py | Python | test/global_test/test_global_version_match.py | gfer151/efs-utils | 1a374d7f60b1f48df22e6ae1dd218fabb2f80538 | [
"MIT"
] | null | null | null | test/global_test/test_global_version_match.py | gfer151/efs-utils | 1a374d7f60b1f48df22e6ae1dd218fabb2f80538 | [
"MIT"
] | null | null | null | test/global_test/test_global_version_match.py | gfer151/efs-utils | 1a374d7f60b1f48df22e6ae1dd218fabb2f80538 | [
"MIT"
] | null | null | null | #
# Copyright 2017-2018 Amazon.com, Inc. and its affiliates. All Rights Reserved.
#
# Licensed under the MIT License. See the LICENSE accompanying this file
# for the specific language governing permissions and limitations under
# the License.
#
import os
try:
import ConfigParser
except ImportError:
from conf... | 36.375 | 130 | 0.707446 |
8cf575f3bfe1f448e5f1ee27e878312239c14078 | 2,854 | py | Python | topdown/topdown_classifier.py | microsoft/NTT | e23a63791c3abd95cc21df60b705f3e1417acf23 | [
"MIT"
] | 4 | 2021-07-19T15:24:37.000Z | 2022-02-28T01:28:11.000Z | topdown/topdown_classifier.py | microsoft/NTT | e23a63791c3abd95cc21df60b705f3e1417acf23 | [
"MIT"
] | null | null | null | topdown/topdown_classifier.py | microsoft/NTT | e23a63791c3abd95cc21df60b705f3e1417acf23 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------------
# Copyright (c) 2021 Microsoft Corporation
#
# 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 Softw... | 43.907692 | 100 | 0.649965 |
ef9928f1e5b8339ff86f2983e8949fa7568653e6 | 179 | py | Python | Resume_Project/custom_storage.py | kannuprieya/resume-builder | a53f9286233e90c9d749db51abe2ac7c0ad99fb2 | [
"MIT"
] | 2 | 2020-09-03T17:37:37.000Z | 2021-03-19T09:27:01.000Z | Resume_Project/custom_storage.py | kannuprieya/resume-builder | a53f9286233e90c9d749db51abe2ac7c0ad99fb2 | [
"MIT"
] | null | null | null | Resume_Project/custom_storage.py | kannuprieya/resume-builder | a53f9286233e90c9d749db51abe2ac7c0ad99fb2 | [
"MIT"
] | 1 | 2021-11-25T16:24:22.000Z | 2021-11-25T16:24:22.000Z | from storages.backends.s3boto3 import S3Boto3Storage
class PublicMediaStorage(S3Boto3Storage):
location = 'media'
default_acl = 'public-read'
file_overwrite = False | 22.375 | 52 | 0.765363 |
0e9b27f54ab1d8d830c3f33f199ca61919fe7109 | 3,328 | py | Python | wltoys-v202-micropython/server.py | nobotro/mkimax | 557f5e570e2fb373f88f5f0f7254c48e90106de0 | [
"MIT"
] | 2 | 2020-10-15T18:12:08.000Z | 2021-11-12T08:57:56.000Z | wltoys-v202-micropython/server.py | nobotro/mkimax | 557f5e570e2fb373f88f5f0f7254c48e90106de0 | [
"MIT"
] | null | null | null | wltoys-v202-micropython/server.py | nobotro/mkimax | 557f5e570e2fb373f88f5f0f7254c48e90106de0 | [
"MIT"
] | 1 | 2020-04-10T08:43:04.000Z | 2020-04-10T08:43:04.000Z | import machine
import socket
import utime
import network
import rc
import time
machine.freq(160000000)
steer_key=None
gear=1
do_steer=False
#steer_directio ,[0-127] steer right, [128-255] steer left
#speed_direction ,[0-127] going forward, [128-255] going backward
steering_step=30
steering_trim=124
always_exec_keys=['... | 22.039735 | 102 | 0.570012 |
56810de10dce0f582e67f12cc50ad10eac2c82d2 | 2,814 | py | Python | userbot/modules/salam.py | dadkuy/Man-Userbot | 89720af8cacf40443a4a18106bcb2bf7a646acd3 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/salam.py | dadkuy/Man-Userbot | 89720af8cacf40443a4a18106bcb2bf7a646acd3 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/salam.py | dadkuy/Man-Userbot | 89720af8cacf40443a4a18106bcb2bf7a646acd3 | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | from time import sleep
from userbot import CMD_HANDLER as cmd
from userbot import CMD_HELP
from userbot.utils import edit_or_reply, man_cmd
@man_cmd(pattern="p(?: |$)(.*)")
async def _(event):
await event.client.send_message(
event.chat_id,
"**Assalamualaikum Om Tante**",
reply_to=event.r... | 28.714286 | 78 | 0.556148 |
c2511f59edbcb7d41a2664baf6ff455ca5672ccb | 2,015 | py | Python | data_input.py | iwtw/tf_tools | 22185cbac7e365f5cbd8ab021159de77893fb0a7 | [
"MIT"
] | null | null | null | data_input.py | iwtw/tf_tools | 22185cbac7e365f5cbd8ab021159de77893fb0a7 | [
"MIT"
] | null | null | null | data_input.py | iwtw/tf_tools | 22185cbac7e365f5cbd8ab021159de77893fb0a7 | [
"MIT"
] | null | null | null | import tensorflow as tf
FLAGS = tf.app.flags.FLAGS
def parse_single_data(file_queue):
reader = tf.TFRecordReader()
key, value = reader.read(file_queue)
features = {
'label': tf.FixedLenFeature([], tf.int64),
#'img_raw': tf.FixedLenFeature([], tf.string)
'img_raw': tf.Fi... | 34.152542 | 95 | 0.648139 |
85b6c0e584286986885c0a50f7b19d458d93dd7c | 3,711 | py | Python | ansible_mitogen/loaders.py | Rosa-Luxemburgstiftung-Berlin/mitogen | a564d8a268afe89ab73423f23fb9191c786f511f | [
"BSD-3-Clause"
] | null | null | null | ansible_mitogen/loaders.py | Rosa-Luxemburgstiftung-Berlin/mitogen | a564d8a268afe89ab73423f23fb9191c786f511f | [
"BSD-3-Clause"
] | null | null | null | ansible_mitogen/loaders.py | Rosa-Luxemburgstiftung-Berlin/mitogen | a564d8a268afe89ab73423f23fb9191c786f511f | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2019, David Wilson
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the following disclaimer.
#
# 2.... | 37.484848 | 90 | 0.759634 |
cd62ef24e0c5729d3a29d8725f5b101e032c1c93 | 1,398 | py | Python | validation_utils/convert_ground_truth_labels/convert_ground_truth_labels.py | codestorm04/keras-inceptionV4 | c97a549508ff6bf863d3506263618d056e62edf4 | [
"Apache-2.0"
] | 495 | 2017-01-26T10:42:46.000Z | 2022-03-18T13:45:44.000Z | validation_utils/convert_ground_truth_labels/convert_ground_truth_labels.py | codestorm04/keras-inceptionV4 | c97a549508ff6bf863d3506263618d056e62edf4 | [
"Apache-2.0"
] | 28 | 2017-01-26T10:04:46.000Z | 2021-04-28T02:40:19.000Z | validation_utils/convert_ground_truth_labels/convert_ground_truth_labels.py | codestorm04/keras-inceptionV4 | c97a549508ff6bf863d3506263618d056e62edf4 | [
"Apache-2.0"
] | 213 | 2017-01-26T16:58:30.000Z | 2022-02-28T23:20:06.000Z | '''
Copyright 2017 Kent Sommer
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
dis... | 26.884615 | 72 | 0.719599 |
f79192db1b2cf94bc217c9833bc401bb525e9034 | 2,260 | py | Python | test/python/WMCore_t/Cache_t/GenericDataCache_t.py | khurtado/WMCore | f74e252412e49189a92962945a94f93bec81cd1e | [
"Apache-2.0"
] | 1 | 2015-02-05T13:43:46.000Z | 2015-02-05T13:43:46.000Z | test/python/WMCore_t/Cache_t/GenericDataCache_t.py | khurtado/WMCore | f74e252412e49189a92962945a94f93bec81cd1e | [
"Apache-2.0"
] | 1 | 2016-10-13T14:57:35.000Z | 2016-10-13T14:57:35.000Z | test/python/WMCore_t/Cache_t/GenericDataCache_t.py | khurtado/WMCore | f74e252412e49189a92962945a94f93bec81cd1e | [
"Apache-2.0"
] | null | null | null | """
_WMConfigCache_t_
Test class for the WMConfigCache
"""
from __future__ import print_function, division
import unittest
import time
from WMCore.Cache.GenericDataCache import GenericDataCache, CacheExistException, \
CacheWithWrongStructException, MemoryCacheStruct
class Foo(object):
... | 28.974359 | 85 | 0.623009 |
aa23dc39b552850b14e360de12b1c8df193e0c13 | 913 | py | Python | day-3-crossed-wires/one.py | dylannakahodo/advent-of-code-2019 | fe5939c656b9b6a93acfb638bace069c1bf60da8 | [
"MIT"
] | null | null | null | day-3-crossed-wires/one.py | dylannakahodo/advent-of-code-2019 | fe5939c656b9b6a93acfb638bace069c1bf60da8 | [
"MIT"
] | null | null | null | day-3-crossed-wires/one.py | dylannakahodo/advent-of-code-2019 | fe5939c656b9b6a93acfb638bace069c1bf60da8 | [
"MIT"
] | null | null | null | def manhattan_distance(point):
return abs(point[0]) + abs(point[1])
def parse_wire_positions(wire_path):
x,y = 0,0
wire_positions = set()
directions = {"R": (1,0), "L": (-1,0), "U": (0,1), "D": (0,-1)}
for vector in wire_path:
for _ in range(int(vector[1:])):
direction = vector... | 29.451613 | 67 | 0.607886 |
bb1e293722135570e046cf8380a29e352207ed24 | 2,700 | py | Python | utils/test.py | moshe-kabala/BRemesher | b0ad8282cd3fa0f94aa6f862a25cb3c78b4b0cdd | [
"MIT"
] | 1 | 2019-11-15T09:11:03.000Z | 2019-11-15T09:11:03.000Z | utils/test.py | moshe-kabala/BRemesher | b0ad8282cd3fa0f94aa6f862a25cb3c78b4b0cdd | [
"MIT"
] | null | null | null | utils/test.py | moshe-kabala/BRemesher | b0ad8282cd3fa0f94aa6f862a25cb3c78b4b0cdd | [
"MIT"
] | 1 | 2019-11-25T13:59:26.000Z | 2019-11-25T13:59:26.000Z | import bpy
import bmesh
from .. utils.applay_map import applay_map
from .. algorithms.map_vertex import map_vertex_by_face
# task
# show the vertex color
VERTEX_COLOR_MAT_NAME = "VERTEX_COLOR_MAT_NAME"
def clear_all():
bpy.ops.object.select_all(action="DESELECT")
bpy.ops.object.select_all()
bpy.ops.ob... | 24.770642 | 66 | 0.669259 |
2f34194bfc45474fd58fa7235552cb574062b17d | 3,987 | py | Python | salt/states/selinux.py | jkur/salt | 3e62675550f9869d550d7787800270e632955d2f | [
"Apache-2.0"
] | 3 | 2016-09-03T06:26:42.000Z | 2019-06-30T13:04:53.000Z | salt/states/selinux.py | jkur/salt | 3e62675550f9869d550d7787800270e632955d2f | [
"Apache-2.0"
] | 16 | 2015-11-18T00:44:03.000Z | 2018-10-29T20:48:27.000Z | salt/states/selinux.py | jkur/salt | 3e62675550f9869d550d7787800270e632955d2f | [
"Apache-2.0"
] | 3 | 2021-02-23T08:12:48.000Z | 2021-02-23T08:13:13.000Z | # -*- coding: utf-8 -*-
'''
Management of SELinux rules
===========================
If SELinux is available for the running system, the mode can be managed and
booleans can be set.
.. code-block:: yaml
enforcing:
selinux.mode
samba_create_home_dirs:
selinux.boolean:
- value: True
... | 27.122449 | 80 | 0.556057 |
ffef35b7acc2769495a91e412fa2373552a2f71e | 10,771 | py | Python | python/paddle/fluid/trainer_desc.py | laipaang/Paddle | d7f35434b761707a8479b75636546a624399369a | [
"Apache-2.0"
] | 1 | 2020-06-24T14:53:24.000Z | 2020-06-24T14:53:24.000Z | python/paddle/fluid/trainer_desc.py | MaJun-cn/Paddle | 0ec3a42e9740a5f5066053bb49a923d538eba24a | [
"Apache-2.0"
] | null | null | null | python/paddle/fluid/trainer_desc.py | MaJun-cn/Paddle | 0ec3a42e9740a5f5066053bb49a923d538eba24a | [
"Apache-2.0"
] | 4 | 2020-07-27T13:24:03.000Z | 2020-08-06T08:20:32.000Z | # Copyright (c) 2019 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.511864 | 80 | 0.665119 |
4d65b0f527c13ef24db4017fabe075ec894385e1 | 2,778 | py | Python | boa/code/ast_preprocess.py | skyinglyh1/neo-boa | 90fcd8edf627f1e18191b30f6ec10609b4d1d330 | [
"MIT"
] | null | null | null | boa/code/ast_preprocess.py | skyinglyh1/neo-boa | 90fcd8edf627f1e18191b30f6ec10609b4d1d330 | [
"MIT"
] | null | null | null | boa/code/ast_preprocess.py | skyinglyh1/neo-boa | 90fcd8edf627f1e18191b30f6ec10609b4d1d330 | [
"MIT"
] | null | null | null | from bytecode import Bytecode
import ast
from ast import NodeTransformer, NodeVisitor
import inspect
import pdb
import dis
class RewriteDicts(NodeTransformer):
last_store_name = None
updated_dicts = []
def visit_Dict(self, node):
if len(node.keys):
if self.last_store_name and self.... | 31.568182 | 253 | 0.62671 |
153f4f4a292d532c3c8d80b51dda90d9c65d4052 | 16,526 | py | Python | ak8s/client.py | maternity/ak8s | 142fcb0049ed1a84508826bf0b231e9acd9841aa | [
"Apache-2.0"
] | null | null | null | ak8s/client.py | maternity/ak8s | 142fcb0049ed1a84508826bf0b231e9acd9841aa | [
"Apache-2.0"
] | null | null | null | ak8s/client.py | maternity/ak8s | 142fcb0049ed1a84508826bf0b231e9acd9841aa | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Kai Groner
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 37.30474 | 123 | 0.577333 |
ffa04e565b0d937b80158062b38f6c5b4ef60d0e | 573 | py | Python | app/log_setup.py | immortel32/Sword_Sorcery_Story_Generator | 7978dfc335813362b2d94c455b970f58421123c8 | [
"MIT"
] | 2 | 2021-04-01T00:50:22.000Z | 2021-04-01T02:18:45.000Z | app/log_setup.py | immortel32/Sword_Sorcery_Story_Generator | 7978dfc335813362b2d94c455b970f58421123c8 | [
"MIT"
] | 1 | 2021-04-01T21:39:44.000Z | 2021-04-01T21:39:44.000Z | app/log_setup.py | immortel32/Sword_Sorcery_Story_Generator | 7978dfc335813362b2d94c455b970f58421123c8 | [
"MIT"
] | 1 | 2021-04-01T01:03:33.000Z | 2021-04-01T01:03:33.000Z | import logging
from logging.handlers import TimedRotatingFileHandler
log = logging.getLogger()
handler = TimedRotatingFileHandler("logs/ss_story_generator.log", "midnight", 1, 7)
fmt = "%(asctime)s %(filename)s[line:%(lineno)d] %(levelname)s %(message)s"
formatter = logging.Formatter(fmt=fmt, datefmt="%m/%d/%Y %H:%M:%... | 31.833333 | 83 | 0.769634 |
349cf7eae9d540ca3fc86866a35386a5c7c47611 | 10,088 | py | Python | exporters/writers/s3_writer.py | scrapinghub/exporters | b14f70530826bbbd6163d9e56e74345e762a9189 | [
"BSD-3-Clause"
] | 41 | 2016-06-16T15:29:39.000Z | 2021-08-06T03:29:13.000Z | exporters/writers/s3_writer.py | bbotella/fluxo | c9fb01db1771ada4672bbffd67cb46e1f7802ab9 | [
"BSD-3-Clause"
] | 52 | 2016-06-20T12:46:57.000Z | 2018-02-08T12:22:03.000Z | exporters/writers/s3_writer.py | bbotella/fluxo | c9fb01db1771ada4672bbffd67cb46e1f7802ab9 | [
"BSD-3-Clause"
] | 10 | 2016-06-23T08:49:36.000Z | 2018-01-13T10:12:10.000Z | import os
from collections import Counter
from contextlib import closing, contextmanager
import six
from exporters.default_retries import retry_long
from exporters.progress_callback import BotoDownloadProgress
from exporters.utils import CHUNK_SIZE, split_file, calculate_multipart_etag, get_bucket_name, \
... | 41.344262 | 97 | 0.625595 |
172db0b45da2a9f20403a7fba1a9b23762a3ff48 | 2,099 | py | Python | ade25/widgets/browser/view.py | ade25/ade25.widgets | 272cf1c74a3b97f4e25161c50f178ebe3c1a70d1 | [
"MIT"
] | null | null | null | ade25/widgets/browser/view.py | ade25/ade25.widgets | 272cf1c74a3b97f4e25161c50f178ebe3c1a70d1 | [
"MIT"
] | null | null | null | ade25/widgets/browser/view.py | ade25/ade25.widgets | 272cf1c74a3b97f4e25161c50f178ebe3c1a70d1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Module providing views for the folderish content page type"""
import uuid as uuid_tool
from Acquisition import aq_inner
from Products.Five.browser import BrowserView
class ContentWidgetView(BrowserView):
""" Default widget view
Renders the provided template and view by the widget i... | 30.867647 | 72 | 0.558838 |
99bfae0752f83419bb6938894647e2ff2e83597e | 3,486 | py | Python | tests/intr/models/ci/base/test_system.py | rhos-infra/cibyl | 842a993ddf3552d1b4f2e85025dcf928f76fe7fb | [
"Apache-2.0"
] | 3 | 2022-02-17T18:07:07.000Z | 2022-03-19T10:22:38.000Z | tests/intr/models/ci/base/test_system.py | rhos-infra/cibyl | 842a993ddf3552d1b4f2e85025dcf928f76fe7fb | [
"Apache-2.0"
] | 58 | 2022-02-14T14:41:22.000Z | 2022-03-31T10:54:28.000Z | tests/intr/models/ci/base/test_system.py | rhos-infra/cibyl | 842a993ddf3552d1b4f2e85025dcf928f76fe7fb | [
"Apache-2.0"
] | 6 | 2022-02-14T19:21:26.000Z | 2022-03-29T09:31:31.000Z | """
# Copyright 2022 Red Hat
#
# 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 agr... | 37.891304 | 78 | 0.572289 |
3bcb6fe4c99310496b3914d6156441fe240855c2 | 1,628 | py | Python | idao/dataloader.py | bu4er88/IDAO_2021 | 687f7caa666ab8f9189e1728f3bc74f2985bfdb8 | [
"Apache-2.0"
] | 7 | 2021-03-11T15:25:01.000Z | 2021-03-16T23:31:37.000Z | idao/dataloader.py | bu4er88/IDAO_2021 | 687f7caa666ab8f9189e1728f3bc74f2985bfdb8 | [
"Apache-2.0"
] | 4 | 2021-03-15T10:39:21.000Z | 2021-03-16T22:03:32.000Z | idao/dataloader.py | bu4er88/IDAO_2021 | 687f7caa666ab8f9189e1728f3bc74f2985bfdb8 | [
"Apache-2.0"
] | 11 | 2021-03-12T08:17:02.000Z | 2021-07-19T13:56:34.000Z | import numpy as np
import torch
import os
import pathlib as path
from PIL import Image
from torchvision.datasets import DatasetFolder
from torch.utils.data import Dataset
class IDAODataset(DatasetFolder):
def name_to_energy(self, name):
try:
names = os.path.split(name)[-1].split("_")
... | 29.6 | 82 | 0.641278 |
52a9d36ca6e9c2571f134b7be552631e181816d3 | 5,214 | py | Python | test/test_issue084.py | MarkHuisjes/RDFOWLtyping | c5849501bd76ee60e3ea02632990e3b8eaee6365 | [
"BSD-3-Clause"
] | 1 | 2017-04-05T16:11:54.000Z | 2017-04-05T16:11:54.000Z | test/test_issue084.py | MarkHuisjes/RDFOWLtyping | c5849501bd76ee60e3ea02632990e3b8eaee6365 | [
"BSD-3-Clause"
] | null | null | null | test/test_issue084.py | MarkHuisjes/RDFOWLtyping | c5849501bd76ee60e3ea02632990e3b8eaee6365 | [
"BSD-3-Clause"
] | null | null | null | from codecs import getreader
try:
from io import BytesIO, StringIO
except ImportError:
from StringIO import StringIO
BytesIO = StringIO
from rdflib import URIRef, Literal
from rdflib.graph import Graph
rdf = u"""@prefix skos:
<http://www.w3.org/2004/02/skos/core#> .
@prefix rdf: <http://www.w3.org/1999/02... | 37.782609 | 127 | 0.662064 |
bf0830cf74113cda7b93f32dba91ae83b8e09e25 | 965 | py | Python | tests/test_echo.py | pbst/angr | a67010c8ef20166b32a14feb4611fdbbfb1f9ab3 | [
"BSD-2-Clause"
] | 2 | 2019-12-20T13:42:57.000Z | 2021-07-07T09:34:46.000Z | tests/test_echo.py | pbst/angr | a67010c8ef20166b32a14feb4611fdbbfb1f9ab3 | [
"BSD-2-Clause"
] | 2 | 2018-11-13T16:19:16.000Z | 2018-12-10T15:45:53.000Z | tests/test_echo.py | pbst/angr | a67010c8ef20166b32a14feb4611fdbbfb1f9ab3 | [
"BSD-2-Clause"
] | null | null | null | import angr
import logging
l = logging.getLogger("angr.tests")
import os
test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../binaries/tests'))
target_arches = {
#'i386',
'x86_64',
#'ppc',
#'armel',
#'mips',
}
def run_echo_haha(arch):
p = angr.Project(os.path.... | 27.571429 | 134 | 0.66943 |
0f8f74b68c8a0b624bce25aac5565a54b5d07692 | 653 | py | Python | pentest-scripts/python-web-penetration-testing-cookbook/Chapter_01_Code/6_screenshot_by_port.py | paulveillard/cybersecurity-penetration-testing | a5afff13ec25afd0cf16ef966d35bddb91518af4 | [
"Apache-2.0"
] | 6 | 2021-12-07T21:02:12.000Z | 2022-03-03T12:08:14.000Z | pentest-scripts/python-web-penetration-testing-cookbook/Chapter_01_Code/6_screenshot_by_port.py | paulveillard/cybersecurity-penetration-testing | a5afff13ec25afd0cf16ef966d35bddb91518af4 | [
"Apache-2.0"
] | null | null | null | pentest-scripts/python-web-penetration-testing-cookbook/Chapter_01_Code/6_screenshot_by_port.py | paulveillard/cybersecurity-penetration-testing | a5afff13ec25afd0cf16ef966d35bddb91518af4 | [
"Apache-2.0"
] | 1 | 2022-01-15T23:57:36.000Z | 2022-01-15T23:57:36.000Z | import screenshot
import requests
portList = [80,443,2082,2083,2086,2087,2095,2096,8080,8880,8443,9998,4643,9001,4489]
IP = '127.0.0.1'
http = 'http://'
https = 'https://'
def testAndSave(protocol, portNumber):
url = protocol + IP + ':' + str(portNumber)
try:
r = requests.get(url,timeou... | 24.185185 | 85 | 0.568147 |
8693b20679fcdf377cabf8f33c452d3086f6b573 | 17,841 | py | Python | piccolo/columns/base.py | cheesycod/piccolo | 254750cdd2f40f118a200074f97e93c7dae4461c | [
"MIT"
] | null | null | null | piccolo/columns/base.py | cheesycod/piccolo | 254750cdd2f40f118a200074f97e93c7dae4461c | [
"MIT"
] | null | null | null | piccolo/columns/base.py | cheesycod/piccolo | 254750cdd2f40f118a200074f97e93c7dae4461c | [
"MIT"
] | null | null | null | from __future__ import annotations
from abc import ABCMeta, abstractmethod
import copy
from dataclasses import dataclass, field
import datetime
import decimal
from enum import Enum
import inspect
import typing as t
from piccolo.columns.operators.comparison import (
ComparisonOperator,
Equal,
GreaterEqualTh... | 31.027826 | 126 | 0.588644 |
0f14aef0a25b4e124c35a7cf6ad42b11e06be9f0 | 996 | py | Python | python/hk/util.py | tskisner/so3g | 75c1d8dea84f862bdd2c9fa2c2f9d1c5b8da5eec | [
"MIT"
] | 5 | 2019-09-02T14:17:31.000Z | 2022-01-21T16:43:14.000Z | python/hk/util.py | tskisner/so3g | 75c1d8dea84f862bdd2c9fa2c2f9d1c5b8da5eec | [
"MIT"
] | 70 | 2019-05-16T23:42:40.000Z | 2022-03-23T14:35:35.000Z | python/hk/util.py | tskisner/so3g | 75c1d8dea84f862bdd2c9fa2c2f9d1c5b8da5eec | [
"MIT"
] | 2 | 2020-05-17T18:20:33.000Z | 2020-10-22T20:35:44.000Z | import numpy as np
from spt3g import core
def get_unix_time(g3_time):
"""Convert a G3Time or G3VectorTime time object to a unix timestamp or
numpy vector (double) of unix timestamps."""
if isinstance(g3_time, core.G3Time):
return g3_time.time / core.G3Units.seconds
if isinstance(g3_time, core... | 35.571429 | 74 | 0.685743 |
80fec4fd4580e7f1c2d0be61b3f54a29791a724e | 9,111 | py | Python | cli/tests/test_polypod/test_resolvers/test_core_resolver.py | polyaxon/cli | 3543c0220a8a7c06fc9573cd2a740f8ae4930641 | [
"Apache-2.0"
] | null | null | null | cli/tests/test_polypod/test_resolvers/test_core_resolver.py | polyaxon/cli | 3543c0220a8a7c06fc9573cd2a740f8ae4930641 | [
"Apache-2.0"
] | 1 | 2022-01-24T11:26:47.000Z | 2022-03-18T23:17:58.000Z | cli/tests/test_polypod/test_resolvers/test_core_resolver.py | polyaxon/cli | 3543c0220a8a7c06fc9573cd2a740f8ae4930641 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
#
# Copyright 2018-2022 Polyaxon, 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 ... | 35.313953 | 87 | 0.570409 |
1ba7cc0ce3dd09943696f8b0f4d71c9bbcbfd049 | 23,954 | py | Python | stable_baselines3/common/base_class.py | SonsOfRL/stable-baselines3 | 3253ee11e7a941946c3a252e63d981d6735df401 | [
"MIT"
] | null | null | null | stable_baselines3/common/base_class.py | SonsOfRL/stable-baselines3 | 3253ee11e7a941946c3a252e63d981d6735df401 | [
"MIT"
] | null | null | null | stable_baselines3/common/base_class.py | SonsOfRL/stable-baselines3 | 3253ee11e7a941946c3a252e63d981d6735df401 | [
"MIT"
] | 1 | 2022-03-15T03:07:41.000Z | 2022-03-15T03:07:41.000Z | """Abstract base classes for RL algorithms."""
import io
import pathlib
import time
from abc import ABC, abstractmethod
from collections import deque
from typing import Any, Callable, Dict, Iterable, List, Optional, Tuple, Type, Union
import gym
import numpy as np
import torch as th
from stable_baselines3.common imp... | 41.804538 | 121 | 0.647199 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.