hexsha stringlengths 40 40 | size int64 1 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 239 | max_stars_repo_name stringlengths 5 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 239 | max_issues_repo_name stringlengths 5 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 239 | max_forks_repo_name stringlengths 5 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 1 1.03M | avg_line_length float64 1 958k | max_line_length int64 1 1.03M | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
797f455eb2f157992c7979300a2460045605f58d | 541 | py | Python | lstm_data_structure.py | pserel/stock_price_forecasting | 6b20608378e26b9ad6d0c98f18695bb24cbfd17c | [
"MIT"
] | null | null | null | lstm_data_structure.py | pserel/stock_price_forecasting | 6b20608378e26b9ad6d0c98f18695bb24cbfd17c | [
"MIT"
] | 5 | 2019-10-12T22:33:49.000Z | 2019-10-26T22:10:56.000Z | lstm_data_structure.py | pserel/stock_price_forecasting | 6b20608378e26b9ad6d0c98f18695bb24cbfd17c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Thu Oct 3 22:19:27 2019
@author: SERELPA1
"""
# Creating a data structure with n_past timesteps and n_future outputs
import numpy as np
def lstm_data_structure(ds, n_past = 25, n_future = 25, n_features = 1):
X_train = []
y_train = []
for i in range(n_past, ... | 24.590909 | 72 | 0.63586 |
797f459f5cb695e422669538a932d4d5332ff481 | 14,129 | py | Python | torchvision/models/resnet.py | hartb/vision | f2f085bf099c4c31bc6f09c21844b2d57dabcb87 | [
"BSD-3-Clause"
] | 22 | 2020-07-21T13:50:35.000Z | 2022-03-17T02:39:45.000Z | torchvision/models/resnet.py | hartb/vision | f2f085bf099c4c31bc6f09c21844b2d57dabcb87 | [
"BSD-3-Clause"
] | 3 | 2021-11-20T09:20:18.000Z | 2021-12-13T09:19:25.000Z | torchvision/models/resnet.py | hartb/vision | f2f085bf099c4c31bc6f09c21844b2d57dabcb87 | [
"BSD-3-Clause"
] | 5 | 2020-08-02T08:26:43.000Z | 2021-08-15T01:41:27.000Z | import torch
import torch.nn as nn
from .utils import load_state_dict_from_url
__all__ = ['ResNet', 'resnet18', 'resnet34', 'resnet50', 'resnet101',
'resnet152', 'resnext50_32x4d', 'resnext101_32x8d',
'wide_resnet50_2', 'wide_resnet101_2']
model_urls = {
'resnet18': 'https://download.pytor... | 39.912429 | 107 | 0.635855 |
797f45c9ec0e7fb0cd4b33ca7fd3a1f22d7f97bb | 1,524 | py | Python | sinterp/sinterp.py | ndrwpvlv/sinterp | 5c4606e9b82bf703650d320c74005fa16c98cb23 | [
"MIT"
] | null | null | null | sinterp/sinterp.py | ndrwpvlv/sinterp | 5c4606e9b82bf703650d320c74005fa16c98cb23 | [
"MIT"
] | null | null | null | sinterp/sinterp.py | ndrwpvlv/sinterp | 5c4606e9b82bf703650d320c74005fa16c98cb23 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from .config import ITERATION_SOLVER_SIZE_LIMIT, CHECK_INPUT
from .helpers import check_input1d, check_input2d, bisec_find_range
def interp1d(x: float, xp: list, yp: list, make_checks: bool = CHECK_INPUT) -> float:
if make_checks:
check_input1d(x, xp, yp)
return interp1d_bisec... | 41.189189 | 114 | 0.589239 |
797f465cc7d552668591713bec1aa84f1338e849 | 1,986 | py | Python | accounts/serializers.py | mzntaka0pdt/saasinit | ed18bc39e12140a94331df4602a9c9e7bc8bf0a8 | [
"Apache-2.0"
] | 6 | 2020-05-26T11:41:18.000Z | 2021-05-18T22:01:32.000Z | accounts/serializers.py | mzntaka0pdt/saasinit | ed18bc39e12140a94331df4602a9c9e7bc8bf0a8 | [
"Apache-2.0"
] | 8 | 2020-06-06T02:05:10.000Z | 2022-02-10T11:18:23.000Z | accounts/serializers.py | mzntaka0pdt/saasinit | ed18bc39e12140a94331df4602a9c9e7bc8bf0a8 | [
"Apache-2.0"
] | 6 | 2020-05-01T07:23:21.000Z | 2022-03-18T08:18:35.000Z | from django.contrib.auth import get_user_model
from rest_framework import serializers
from .models import Tenant
User = get_user_model()
class UserSerializer(serializers.HyperlinkedModelSerializer):
class Meta:
model = User
fields = (
'url',
'id',
'username',... | 28.371429 | 97 | 0.627895 |
797f4728420e5ea996e71d31f7b339c579ffd0ab | 4,167 | py | Python | app.py | mdjoh/FIFA-data-app | bb836aaa2807dc1cca365debf081010e6fab25aa | [
"MIT"
] | null | null | null | app.py | mdjoh/FIFA-data-app | bb836aaa2807dc1cca365debf081010e6fab25aa | [
"MIT"
] | null | null | null | app.py | mdjoh/FIFA-data-app | bb836aaa2807dc1cca365debf081010e6fab25aa | [
"MIT"
] | null | null | null | from flask import Flask, render_template, request
from sklearn.externals import joblib
import os
import pandas as pd
import numpy as np
app = Flask(__name__, static_url_path='/static/')
@app.route('/')
def form():
return render_template('index.html')
@app.route('/future_rate_prediction')
def firstForm():
retur... | 33.071429 | 259 | 0.712023 |
797f48efec27e51234376b69e1bc8ddb59e4c309 | 4,968 | py | Python | numba/runtime/nrtopt.py | anton-malakhov/numba | 2e6c224c88774d03a99ad9c1ec4dacf1d4dd7ac7 | [
"BSD-2-Clause"
] | null | null | null | numba/runtime/nrtopt.py | anton-malakhov/numba | 2e6c224c88774d03a99ad9c1ec4dacf1d4dd7ac7 | [
"BSD-2-Clause"
] | 1 | 2018-04-03T22:37:40.000Z | 2018-04-03T23:53:43.000Z | numba/runtime/nrtopt.py | anton-malakhov/numba | 2e6c224c88774d03a99ad9c1ec4dacf1d4dd7ac7 | [
"BSD-2-Clause"
] | null | null | null | """
NRT specific optimizations
"""
import re
from collections import defaultdict, deque
import numba.llvmthreadsafe as llvmts
_regex_incref = re.compile(r'\s*call void @NRT_incref\((.*)\)')
_regex_decref = re.compile(r'\s*call void @NRT_decref\((.*)\)')
_regex_bb = re.compile(r'([-a-zA-Z$._][-a-zA-Z$._0-9]*:)|^defin... | 31.643312 | 78 | 0.579911 |
797f496ad724b055540190ebd4cac203380afdb2 | 55 | py | Python | src/pipeline/__init__.py | CRafa97/cool-compiler-2020 | e581d7b9e7755a9e241a97fa38b6e62364647574 | [
"MIT"
] | null | null | null | src/pipeline/__init__.py | CRafa97/cool-compiler-2020 | e581d7b9e7755a9e241a97fa38b6e62364647574 | [
"MIT"
] | null | null | null | src/pipeline/__init__.py | CRafa97/cool-compiler-2020 | e581d7b9e7755a9e241a97fa38b6e62364647574 | [
"MIT"
] | null | null | null | from .state import State
from .pipeline import Pipeline | 27.5 | 30 | 0.836364 |
797f4ab998c6c821cdceb8d4098d3abc2c656acb | 1,529 | py | Python | tests/validators/test_genomic_delins.py | GenomicMedLab/varlex | 9e53906a5f4e41afb4480487a4d03b0c218a1d57 | [
"MIT"
] | null | null | null | tests/validators/test_genomic_delins.py | GenomicMedLab/varlex | 9e53906a5f4e41afb4480487a4d03b0c218a1d57 | [
"MIT"
] | 3 | 2020-06-26T15:19:31.000Z | 2021-02-04T21:14:37.000Z | tests/validators/test_genomic_delins.py | GenomicMedLab/varlex | 9e53906a5f4e41afb4480487a4d03b0c218a1d57 | [
"MIT"
] | null | null | null | """Module for testing Genomic DelIns Validator."""
import unittest
from variation.validators import GenomicDelIns
from variation.classifiers import GenomicDelInsClassifier
from .validator_base import ValidatorBase
from variation.tokenizers import GeneSymbol
from variation.data_sources import TranscriptMappings, SeqRepo... | 38.225 | 71 | 0.727927 |
797f4ae6b065e1d9fc164551113e1e6ac6f77b74 | 1,964 | py | Python | python/oskar/utils.py | happyseayou/OSKAR | 3fb995ed39deb6b11da12524e8e30f0ca8f9c39b | [
"BSD-3-Clause"
] | 46 | 2015-12-15T14:24:16.000Z | 2022-01-24T16:54:49.000Z | python/oskar/utils.py | happyseayou/OSKAR | 3fb995ed39deb6b11da12524e8e30f0ca8f9c39b | [
"BSD-3-Clause"
] | 37 | 2016-08-04T17:53:03.000Z | 2022-03-10T10:22:01.000Z | python/oskar/utils.py | happyseayou/OSKAR | 3fb995ed39deb6b11da12524e8e30f0ca8f9c39b | [
"BSD-3-Clause"
] | 32 | 2016-05-09T10:30:11.000Z | 2022-01-26T07:55:27.000Z | # -*- coding: utf-8 -*-
#
# Copyright (c) 2016, The University of Oxford
# All rights reserved.
#
# 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 noti... | 44.636364 | 79 | 0.757637 |
797f4c2efbffe676d827185ae837b112f68f1702 | 441 | py | Python | Experience/Shift_zero_to_end.py | shua2018ti/Google | 3a9847e0c60d887d15eb4b0d4d8ebf51e464df1b | [
"MIT"
] | 87 | 2015-07-15T20:41:09.000Z | 2022-03-08T13:55:38.000Z | Experience/Shift_zero_to_end.py | shua2018ti/Google | 3a9847e0c60d887d15eb4b0d4d8ebf51e464df1b | [
"MIT"
] | 59 | 2015-03-19T22:26:41.000Z | 2015-07-25T17:58:08.000Z | Experience/Shift_zero_to_end.py | shua2018ti/Google | 3a9847e0c60d887d15eb4b0d4d8ebf51e464df1b | [
"MIT"
] | 45 | 2015-07-15T20:41:12.000Z | 2022-02-01T20:18:07.000Z | # http://www.geeksforgeeks.org/move-zeroes-end-array/
def pushZerosToEnd(arr):
if not arr: return []
count = -1
n = len(arr)
for i in xrange(n):
if arr[i] != 0:
count += 1
arr[count] = arr[i]
while count + 1 < n:
count += 1
arr[count] = 0... | 21 | 53 | 0.455782 |
797f4d0ba49215b9ddd4d8bb7a362a9608ef83bb | 4,083 | py | Python | setup.py | nowcastsystem/QUANTAXIS | a96dcabad927e0de64685a5fc11d20eac51da435 | [
"MIT"
] | 14 | 2021-01-11T02:19:26.000Z | 2022-02-02T04:16:08.000Z | setup.py | fqyshelly/QUANTAXIS | 66b5d002adf69642241a1bdb5edd90dc4111e690 | [
"MIT"
] | 1 | 2019-06-19T16:33:09.000Z | 2019-06-19T16:33:09.000Z | setup.py | fqyshelly/QUANTAXIS | 66b5d002adf69642241a1bdb5edd90dc4111e690 | [
"MIT"
] | 8 | 2021-01-16T09:43:30.000Z | 2022-02-02T04:16:12.000Z | # coding=utf-8
#
# The MIT License (MIT)
#
# Copyright (c) 2016-2017 yutiansut/QUANTAXIS
#
# 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 th... | 31.167939 | 154 | 0.67083 |
797f4df5545a2d74d1f706d79d4009c6209fd201 | 2,164 | py | Python | thrift/test/py/constants_test.py | fakeNetflix/facebook-repo-fbthrift | 24f2357142d1da8c89f4cabc6cb144d83749b3c6 | [
"Apache-2.0"
] | 2 | 2021-06-29T13:42:22.000Z | 2021-09-06T10:57:34.000Z | thrift/test/py/constants_test.py | fakeNetflix/facebook-repo-fbthrift | 24f2357142d1da8c89f4cabc6cb144d83749b3c6 | [
"Apache-2.0"
] | null | null | null | thrift/test/py/constants_test.py | fakeNetflix/facebook-repo-fbthrift | 24f2357142d1da8c89f4cabc6cb144d83749b3c6 | [
"Apache-2.0"
] | 5 | 2021-06-29T13:42:26.000Z | 2022-02-08T02:41:34.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 use... | 40.830189 | 74 | 0.723198 |
797f4e702201be96f3b029917bc4de03e5741258 | 1,110 | py | Python | day-2/aoc-day2.py | rluetzner/advent-of-code-2021 | 1d5eca5cf98f03c71cbcdd838304e570fec64029 | [
"MIT"
] | null | null | null | day-2/aoc-day2.py | rluetzner/advent-of-code-2021 | 1d5eca5cf98f03c71cbcdd838304e570fec64029 | [
"MIT"
] | null | null | null | day-2/aoc-day2.py | rluetzner/advent-of-code-2021 | 1d5eca5cf98f03c71cbcdd838304e570fec64029 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
sys.path.append('..')
from libs.helpers import get_input
def evaluate_line(line):
split = line.split()
command = split[0]
value = int(split[1])
if command == 'forward':
return value, 0
if command == 'up':
return 0, -value
if command == 'down':
... | 20.181818 | 59 | 0.547748 |
797f4eb1a9495d249066bf57263ab429a82046a7 | 3,440 | py | Python | test/test_exception.py | myzhang1029/zcbe | 79f1c922b9f65cc4005c728fe77ef99e665667e8 | [
"Apache-2.0"
] | null | null | null | test/test_exception.py | myzhang1029/zcbe | 79f1c922b9f65cc4005c728fe77ef99e665667e8 | [
"Apache-2.0"
] | 5 | 2020-04-22T13:49:20.000Z | 2020-11-08T00:05:48.000Z | test/test_exception.py | myzhang1029/zcbe | 79f1c922b9f65cc4005c728fe77ef99e665667e8 | [
"Apache-2.0"
] | null | null | null | """Test for various error behaviors.
All build-wide exceptions should result in a quit,
project-wide exceptions should be trapped by asyncio.Task, and
show as an error message to prevent orphaning other build processes.
"""
from copy import deepcopy
import zcbe
from .test_zcbe import BS_BASE, base_test_invocator
# ... | 30.442478 | 78 | 0.674419 |
797f5011c042964c950eea28e47f209c790dd826 | 9,186 | py | Python | unit_tests/expressions/Expression.py | jaredlunde/cargo-orm | 1d5524d359bd52a991edc738982b7df2149d9c69 | [
"MIT"
] | 3 | 2017-02-10T08:03:21.000Z | 2017-02-25T04:55:48.000Z | unit_tests/expressions/Expression.py | jaredlunde/cargo-orm | 1d5524d359bd52a991edc738982b7df2149d9c69 | [
"MIT"
] | null | null | null | unit_tests/expressions/Expression.py | jaredlunde/cargo-orm | 1d5524d359bd52a991edc738982b7df2149d9c69 | [
"MIT"
] | null | null | null | #!/usr/bin/python3 -S
# -*- coding: utf-8 -*-
"""
`Unit tests for cargo.expressions.Expression`
--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--
2016 Jared Lunde © The MIT License (MIT)
http://github.com/jaredlunde
"""
from types import GeneratorType
import unittest
import psycop... | 40.46696 | 80 | 0.542782 |
797f50c503ccba1948a0b6f4880540bba1138f58 | 891 | py | Python | 8_vk_friends_online/vk_friends_online.py | assassinen/devman | b9a672a48ec5941a4eedea62a2f7c72908a74b98 | [
"Apache-2.0"
] | null | null | null | 8_vk_friends_online/vk_friends_online.py | assassinen/devman | b9a672a48ec5941a4eedea62a2f7c72908a74b98 | [
"Apache-2.0"
] | null | null | null | 8_vk_friends_online/vk_friends_online.py | assassinen/devman | b9a672a48ec5941a4eedea62a2f7c72908a74b98 | [
"Apache-2.0"
] | null | null | null | import vk
from getpass import getpass
APP_ID = '5825013'
def get_user_login():
return input('Введите ваш логин: \n')
def get_user_password():
return getpass('Введите ваш пароль: \n')
def get_online_friends(login, password):
session = vk.AuthSession(
app_id=APP_ID,
user_login=login,
... | 21.731707 | 56 | 0.694725 |
797f5127400728ffa578d5294316b61c71b62c8d | 681 | py | Python | var/spack/repos/builtin/packages/py-flask-compress/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2,360 | 2017-11-06T08:47:01.000Z | 2022-03-31T14:45:33.000Z | var/spack/repos/builtin/packages/py-flask-compress/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 13,838 | 2017-11-04T07:49:45.000Z | 2022-03-31T23:38:39.000Z | var/spack/repos/builtin/packages/py-flask-compress/package.py | kkauder/spack | 6ae8d5c380c1f42094b05d38be26b03650aafb39 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 1,793 | 2017-11-04T07:45:50.000Z | 2022-03-30T14:31:53.000Z | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyFlaskCompress(PythonPackage):
"""Flask-Compress allows you to easily compress your Flask... | 34.05 | 95 | 0.73862 |
797f51c6f36601ae16da7b6cfb2d45b0ee499c84 | 8,949 | py | Python | k_means_clustering.py | abhishek-kumar41/K-means-Clustering | c8f41c204e4b41c54afbefcf3fb34120eff95c4a | [
"MIT"
] | 1 | 2021-11-26T06:50:11.000Z | 2021-11-26T06:50:11.000Z | k_means_clustering.py | abhishek-kumar41/K-means-Clustering | c8f41c204e4b41c54afbefcf3fb34120eff95c4a | [
"MIT"
] | null | null | null | k_means_clustering.py | abhishek-kumar41/K-means-Clustering | c8f41c204e4b41c54afbefcf3fb34120eff95c4a | [
"MIT"
] | null | null | null | import glob
import librosa
import numpy as np
from sklearn.cluster import KMeans
p_data_wav_train=[]
t_data_wav_train=[]
k_data_wav_train=[]
b_data_wav_train=[]
d_data_wav_train=[]
g_data_wav_train=[]
for i in range(1,4):
p_data_path_wav_train = 'PTKBDG/*/*p*' + str(i) + '.wav'
p_data_wav_train = p_data_wav_t... | 35.511905 | 92 | 0.702984 |
797f5283ee30d759ca899d0c8e4eb4693123b107 | 19,892 | py | Python | test/AttributeMapping_server_test.py | n1mus/GenericsAPI | d974c08ca25eaa3bff12a7d256878bec7e902634 | [
"MIT"
] | null | null | null | test/AttributeMapping_server_test.py | n1mus/GenericsAPI | d974c08ca25eaa3bff12a7d256878bec7e902634 | [
"MIT"
] | null | null | null | test/AttributeMapping_server_test.py | n1mus/GenericsAPI | d974c08ca25eaa3bff12a7d256878bec7e902634 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import json
import os
import shutil
import time
import unittest
import uuid
from configparser import ConfigParser
from mock import patch
import pandas as pd
from GenericsAPI.Utils.AttributeUtils import AttributesUtil
from installed_clients.DataFileUtilClient import DataFileUtil
from GenericsAP... | 47.026005 | 102 | 0.58893 |
797f52bd382dfb4151070be507525d0a1e3cfb08 | 831 | py | Python | clients/python-experimental/generated/test/test_pokemon_form_api.py | cliffano/pokeapi-clients | 92af296c68c3e94afac52642ae22057faaf071ee | [
"MIT"
] | null | null | null | clients/python-experimental/generated/test/test_pokemon_form_api.py | cliffano/pokeapi-clients | 92af296c68c3e94afac52642ae22057faaf071ee | [
"MIT"
] | null | null | null | clients/python-experimental/generated/test/test_pokemon_form_api.py | cliffano/pokeapi-clients | 92af296c68c3e94afac52642ae22057faaf071ee | [
"MIT"
] | null | null | null | # coding: utf-8
"""
No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) # noqa: E501
The version of the OpenAPI document: 20220523
Generated by: https://openapi-generator.tech
"""
import unittest
import openapi_client
from openapi_client.api.pokem... | 20.268293 | 124 | 0.672684 |
797f5382533d001753fb70132abca7828d93354d | 88 | py | Python | catalogue/admin.py | johnbugler/django_equipment_site | e6f5e2ca1c75c4bcd6cf14a958a89cd51682c56a | [
"MIT"
] | null | null | null | catalogue/admin.py | johnbugler/django_equipment_site | e6f5e2ca1c75c4bcd6cf14a958a89cd51682c56a | [
"MIT"
] | null | null | null | catalogue/admin.py | johnbugler/django_equipment_site | e6f5e2ca1c75c4bcd6cf14a958a89cd51682c56a | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Device
admin.site.register(Device) | 22 | 32 | 0.829545 |
797f542e4dd38d1122ae2b7ac6b14fff9ae78d9a | 35,206 | py | Python | projects/DensePose/visualize_rect_segm.py | tintinrevient/detectron2 | 59069d9a20104ca2eb87773ba39280d522f2e345 | [
"Apache-2.0"
] | null | null | null | projects/DensePose/visualize_rect_segm.py | tintinrevient/detectron2 | 59069d9a20104ca2eb87773ba39280d522f2e345 | [
"Apache-2.0"
] | null | null | null | projects/DensePose/visualize_rect_segm.py | tintinrevient/detectron2 | 59069d9a20104ca2eb87773ba39280d522f2e345 | [
"Apache-2.0"
] | null | null | null | from detectron2.utils.logger import setup_logger
setup_logger()
import cv2, os, re
import numpy as np
from detectron2.engine import DefaultPredictor
from detectron2.config import get_cfg
from densepose.config import add_densepose_config
from densepose.vis.extractor import DensePoseResultExtractor
import torch
import a... | 38.434498 | 170 | 0.668153 |
797f5620ea8ea7252ecc57497d4fe766cb3dd8f8 | 960 | py | Python | Part4/python/foo.py | mahoyen/Exercise1 | 0abc317a9d32d76bf5cb8ae7e15aaaed79714af2 | [
"Unlicense"
] | null | null | null | Part4/python/foo.py | mahoyen/Exercise1 | 0abc317a9d32d76bf5cb8ae7e15aaaed79714af2 | [
"Unlicense"
] | null | null | null | Part4/python/foo.py | mahoyen/Exercise1 | 0abc317a9d32d76bf5cb8ae7e15aaaed79714af2 | [
"Unlicense"
] | null | null | null | # Python 3.3.3 and 2.7.6
# python fo.py
from threading import Thread
# Potentially useful thing:
# In Python you "import" a global variable, instead of "export"ing it when you declare it
# (This is probably an effort to make you feel bad about typing the word "global")
i = 0
def incrementingFunction():
glob... | 22.325581 | 91 | 0.657292 |
797f5624a0f618c8dab8bf72266662b82eee44af | 1,446 | py | Python | asyntest.py | lorcap/upy-peterhinch-msgpack | 740f4b8fcfb12e32a9f90db30fa578e1843ff572 | [
"MIT"
] | 7 | 2021-07-26T19:20:29.000Z | 2021-12-28T16:08:14.000Z | asyntest.py | lorcap/upy-peterhinch-msgpack | 740f4b8fcfb12e32a9f90db30fa578e1843ff572 | [
"MIT"
] | 3 | 2021-10-31T06:12:52.000Z | 2022-01-26T10:27:52.000Z | asyntest.py | lorcap/upy-peterhinch-msgpack | 740f4b8fcfb12e32a9f90db30fa578e1843ff572 | [
"MIT"
] | 2 | 2021-08-01T10:27:14.000Z | 2021-10-31T05:45:36.000Z | # asyntest.py Test/demo of asychronous use of MessagePack
# Configured for a Pyboard. Link pins X1 and X2.
# Copyright (c) 2021 Peter Hinch Released under the MIT License see LICENSE
# Free RAM after reset 101504 bytes. Free RAM while running 82944 bytes
# Usage 18560 bytes i.e. ~18.1KiB
# This compares with 5312 by... | 26.290909 | 75 | 0.639696 |
797f56a5b39fef1bd79ba55853bb617510b4d3c7 | 14,027 | py | Python | docs/source/buildscripts/sdc_doc_utils.py | samir-nasibli/sdc | b9144c8799d6454dec3e5c550e305963b24c1570 | [
"BSD-2-Clause"
] | null | null | null | docs/source/buildscripts/sdc_doc_utils.py | samir-nasibli/sdc | b9144c8799d6454dec3e5c550e305963b24c1570 | [
"BSD-2-Clause"
] | null | null | null | docs/source/buildscripts/sdc_doc_utils.py | samir-nasibli/sdc | b9144c8799d6454dec3e5c550e305963b24c1570 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# *****************************************************************************
# Copyright (c) 2019, Intel Corporation All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# ... | 35.511392 | 117 | 0.653383 |
797f579644e1720d5b73f8f1bcf746ba1955d3c1 | 3,324 | py | Python | vacuna/__init__.py | frndmg/vacuna | 2354729f5fa77644d6632aaec83b509bdf654776 | [
"MIT"
] | 16 | 2021-09-01T14:28:56.000Z | 2021-09-15T01:18:26.000Z | vacuna/__init__.py | frndmg/vacuna | 2354729f5fa77644d6632aaec83b509bdf654776 | [
"MIT"
] | 4 | 2021-09-01T22:43:47.000Z | 2021-09-02T09:54:03.000Z | vacuna/__init__.py | frndmg/vacuna | 2354729f5fa77644d6632aaec83b509bdf654776 | [
"MIT"
] | null | null | null | """Small library to work with dependencies in Python"""
import inspect
from typing import Callable, Dict, Optional, Tuple
from typing_extensions import Literal
from .__version__ import __version__
from .lazy import Lazy, lazy, make_lazy, once
Kind = Literal['factory', 'singleton', 'resource']
FACTORY = 'factory' ... | 28.169492 | 80 | 0.629061 |
797f5831759d3bd1ac0c31fbec22eed8848037e2 | 7,630 | py | Python | exp.city/city8.res50v3+.CPS+CutMix/network.py | Yongjin-colin-choi/TorchSemiSeg | 8e2bacfd76ee8ab7c7e5c8e37ce4a4fcb0ef6371 | [
"MIT"
] | null | null | null | exp.city/city8.res50v3+.CPS+CutMix/network.py | Yongjin-colin-choi/TorchSemiSeg | 8e2bacfd76ee8ab7c7e5c8e37ce4a4fcb0ef6371 | [
"MIT"
] | null | null | null | exp.city/city8.res50v3+.CPS+CutMix/network.py | Yongjin-colin-choi/TorchSemiSeg | 8e2bacfd76ee8ab7c7e5c8e37ce4a4fcb0ef6371 | [
"MIT"
] | null | null | null | # encoding: utf-8
import torch
import torch.nn as nn
import torch.nn.functional as F
from functools import partial
from collections import OrderedDict
from config import config
from base_model import resnet50
class Network(nn.Module):
def __init__(self, num_classes, criterion, norm_layer, pretrained_... | 38.535354 | 108 | 0.554915 |
797f595656bd215bebb1b14357c0efd7e365530d | 265 | py | Python | test.py | ninest/craftpainting | b57896c4a3cedb8e18ae671497f7db5c029a9685 | [
"MIT"
] | 10 | 2020-06-21T09:33:52.000Z | 2022-02-25T18:40:29.000Z | test.py | ninest/craftpainting | b57896c4a3cedb8e18ae671497f7db5c029a9685 | [
"MIT"
] | 5 | 2021-06-08T21:55:44.000Z | 2022-01-13T03:00:15.000Z | test.py | ninest/craftpainting | b57896c4a3cedb8e18ae671497f7db5c029a9685 | [
"MIT"
] | 1 | 2020-06-21T19:07:45.000Z | 2020-06-21T19:07:45.000Z | from craftpainting import create_painting, enlarge_image
from PIL import Image
image = Image.open('images/sunset_dense.jpg')
p = create_painting(image) # create the (super tiny) image
p = enlarge_image(p, repetitions=15) # enlarge it so it looks better
p.show()
| 33.125 | 69 | 0.773585 |
797f59cd7602a8226233294a957be9f825dcc920 | 19,362 | py | Python | detectron/modeling/backbone/bp_resnet.py | guowenhao787938711/EFPN-detectron2 | 58caabcf5edd5615f17d844618cf42367e567ee3 | [
"Apache-2.0"
] | 1 | 2021-07-16T06:05:56.000Z | 2021-07-16T06:05:56.000Z | detectron2/modeling/backbone/bp_resnet.py | Kg6815311/pipe_EFPN_detectron2 | 1a381027cc19845afb88461bd5c96fa0fd75f449 | [
"Apache-2.0"
] | null | null | null | detectron2/modeling/backbone/bp_resnet.py | Kg6815311/pipe_EFPN_detectron2 | 1a381027cc19845afb88461bd5c96fa0fd75f449 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
import logging
import numpy as np
import fvcore.nn.weight_init as weight_init
import torch
import torch.nn.functional as F
from torch import nn
from detectron2.layers import (
CNNBlockBase,
Conv2d,
DeformConv,
ModulatedDeformConv,
ShapeSpec,
ge... | 35.789279 | 149 | 0.588989 |
797f59dfbe70b77f0d412934bf0cdf052e884f10 | 403 | py | Python | Projects/frank_website/frank_website/wsgi.py | franklinokech/telusko | e240c77427e5cb8520e64e1e50a61fb7b965b1a9 | [
"MIT"
] | null | null | null | Projects/frank_website/frank_website/wsgi.py | franklinokech/telusko | e240c77427e5cb8520e64e1e50a61fb7b965b1a9 | [
"MIT"
] | null | null | null | Projects/frank_website/frank_website/wsgi.py | franklinokech/telusko | e240c77427e5cb8520e64e1e50a61fb7b965b1a9 | [
"MIT"
] | null | null | null | """
WSGI config for frank_website 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/2.0/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault("DJANGO... | 23.705882 | 78 | 0.791563 |
797f5a21abc88b86a9a398b75ecaa6361d1ae812 | 895 | py | Python | day4/napalmx/collateral/juniper/test_junos.py | austind/pyplus-ons | f0fcd6b2a980f75968ab54cd2ae39b42c1f68302 | [
"Apache-2.0"
] | null | null | null | day4/napalmx/collateral/juniper/test_junos.py | austind/pyplus-ons | f0fcd6b2a980f75968ab54cd2ae39b42c1f68302 | [
"Apache-2.0"
] | null | null | null | day4/napalmx/collateral/juniper/test_junos.py | austind/pyplus-ons | f0fcd6b2a980f75968ab54cd2ae39b42c1f68302 | [
"Apache-2.0"
] | 5 | 2019-11-19T18:41:41.000Z | 2020-06-18T14:58:09.000Z | #!/usr/bin/env python
from getpass import getpass
from pprint import pprint as pp
from napalm import get_network_driver
host = "184.105.247.76"
username = "pyclass"
password = getpass()
optional_args = {}
driver = get_network_driver("junos")
device = driver(host, username, password, optional_args=optional_args)
pri... | 21.309524 | 70 | 0.743017 |
797f5c6cfea8f19892667bf724ef60a1a81738b5 | 1,477 | py | Python | robots/robot.py | Sarrasor/KinematicsCalculation | 4e05acfe0052b90da43e3074bbecb4bb89104301 | [
"MIT"
] | 25 | 2021-01-09T09:40:26.000Z | 2022-03-27T12:35:37.000Z | robots/robot.py | Sarrasor/KinematicsCalculation | 4e05acfe0052b90da43e3074bbecb4bb89104301 | [
"MIT"
] | 1 | 2021-07-15T15:52:05.000Z | 2021-07-16T08:47:56.000Z | robots/robot.py | Sarrasor/KinematicsCalculation | 4e05acfe0052b90da43e3074bbecb4bb89104301 | [
"MIT"
] | 10 | 2021-02-26T05:21:23.000Z | 2021-12-23T16:54:51.000Z | """
Abstact Robot class definition
"""
import sympy as sp
from abc import ABC, abstractmethod
class Robot(ABC):
"""
Robot base class
Attributes:
epsilon (float): Minimum difference to treat floats equal
"""
epsilon = 1e-5
@abstractmethod
def forward_kinematics(self, q_values):
... | 23.078125 | 73 | 0.562627 |
797f5c97d0fafd7f1294e15c56c1dc9fb2f3587e | 1,285 | py | Python | generate_mellor_like_bursts.py | vjaltare/er_and_plasticity_in_ca1_spine | 318a467ae1a7b09d868746709a55da953cf2330e | [
"MIT"
] | null | null | null | generate_mellor_like_bursts.py | vjaltare/er_and_plasticity_in_ca1_spine | 318a467ae1a7b09d868746709a55da953cf2330e | [
"MIT"
] | null | null | null | generate_mellor_like_bursts.py | vjaltare/er_and_plasticity_in_ca1_spine | 318a467ae1a7b09d868746709a55da953cf2330e | [
"MIT"
] | null | null | null | import numpy as np
from numpy.random import *
def get_tBurst(beta):
"""returns a Poison spike train with parameter beta = 1/lambda"""
seed(100)
t_max = 20 #s
tBurst = exponential(beta, 1000)
tBurst = np.cumsum(tBurst)
tBurst2 = []
for i in range(tBurst.shape[0]):
if tBurst[i] < t_ma... | 34.72973 | 93 | 0.621012 |
797f5d6f970ac2429882669838f353eb5819d3d1 | 420 | py | Python | epsilon/__init__.py | palfrey/epsilon | e85fa985a41983ef06e1d3bb26639181e1f78b24 | [
"MIT"
] | 1 | 2018-12-03T17:21:10.000Z | 2018-12-03T17:21:10.000Z | epsilon/__init__.py | palfrey/epsilon | e85fa985a41983ef06e1d3bb26639181e1f78b24 | [
"MIT"
] | null | null | null | epsilon/__init__.py | palfrey/epsilon | e85fa985a41983ef06e1d3bb26639181e1f78b24 | [
"MIT"
] | null | null | null | # -*- test-case-name: epsilon.test -*-
from epsilon._version import get_versions
__version__ = get_versions()['version']
del get_versions
from twisted.python import versions
def asTwistedVersion(packageName, versionString):
return versions.Version(
packageName, *map(int, versionString.split('+', 1)[0].spl... | 28 | 74 | 0.733333 |
797f5e785c819e8224d33e709d963bba751be400 | 14,692 | py | Python | tabular/src/autogluon/tabular/trainer/model_presets/presets.py | jrzaurin/autogluon | b7dbed302c4181f9160b2f8f88f73c1fa37941cd | [
"Apache-2.0"
] | null | null | null | tabular/src/autogluon/tabular/trainer/model_presets/presets.py | jrzaurin/autogluon | b7dbed302c4181f9160b2f8f88f73c1fa37941cd | [
"Apache-2.0"
] | null | null | null | tabular/src/autogluon/tabular/trainer/model_presets/presets.py | jrzaurin/autogluon | b7dbed302c4181f9160b2f8f88f73c1fa37941cd | [
"Apache-2.0"
] | null | null | null | import copy
import inspect
import logging
import warnings
from collections import defaultdict
from sklearn.linear_model import LogisticRegression, LinearRegression
from autogluon.core.metrics import soft_log_loss, mean_squared_error
from autogluon.core.constants import AG_ARGS, AG_ARGS_FIT, AG_ARGS_ENSEMBLE, BINARY, ... | 51.191638 | 213 | 0.704125 |
797f609b840b56ea0cd4877868e19278ddb24ab2 | 2,913 | py | Python | kymatio/scattering2d/backend/tensorflow_backend.py | GReguig/kymatio | e0fc10057f5f8bb947068bc40afff8d3d3729052 | [
"BSD-3-Clause"
] | 3 | 2021-07-13T00:00:47.000Z | 2022-02-15T01:10:26.000Z | kymatio/scattering2d/backend/tensorflow_backend.py | GReguig/kymatio | e0fc10057f5f8bb947068bc40afff8d3d3729052 | [
"BSD-3-Clause"
] | 9 | 2021-11-08T21:15:14.000Z | 2021-11-26T20:20:11.000Z | kymatio/scattering2d/backend/tensorflow_backend.py | GReguig/kymatio | e0fc10057f5f8bb947068bc40afff8d3d3729052 | [
"BSD-3-Clause"
] | 2 | 2021-09-02T14:03:30.000Z | 2021-11-10T10:31:42.000Z | # Authors: Edouard Oyallon, Sergey Zagoruyko, Muawiz Chaudhary
import tensorflow as tf
from collections import namedtuple
BACKEND_NAME = 'tensorflow'
from ...backend.tensorflow_backend import Modulus, cdgmm, concatenate
from ...backend.base_backend import FFT
class Pad(object):
def __init__(self, pad_size, inp... | 31.663043 | 120 | 0.579815 |
797f62a97316ed323a0d950527481bb51b2e8d1a | 640 | py | Python | 14/14.1.py | Ingomancer/AoC2020 | 3c74da26769f188bacfc8e1bef56f9957cab4cb6 | [
"MIT"
] | null | null | null | 14/14.1.py | Ingomancer/AoC2020 | 3c74da26769f188bacfc8e1bef56f9957cab4cb6 | [
"MIT"
] | null | null | null | 14/14.1.py | Ingomancer/AoC2020 | 3c74da26769f188bacfc8e1bef56f9957cab4cb6 | [
"MIT"
] | null | null | null | from collections import defaultdict
def do_the_needful(input):
mem = defaultdict(int)
mask = ""
for line in input:
action, value = line.split(" = ")
if action == "mask":
mask = value
else:
index = action[4:-1]
value = bin(int(value))[2:]
... | 30.47619 | 54 | 0.5 |
797f62cb3e37abc4cf8924a99da633434fd7d95f | 5,887 | py | Python | docs/conf.py | volpatto/sloth | 7f622c5afe74a9be198024b8554519f5759b25ac | [
"MIT"
] | 2 | 2019-06-03T13:18:16.000Z | 2019-07-08T11:38:02.000Z | docs/conf.py | volpatto/sloth | 7f622c5afe74a9be198024b8554519f5759b25ac | [
"MIT"
] | 4 | 2018-10-19T12:14:28.000Z | 2018-10-19T12:29:43.000Z | docs/conf.py | volpatto/sloth | 7f622c5afe74a9be198024b8554519f5759b25ac | [
"MIT"
] | 2 | 2018-10-24T18:19:39.000Z | 2021-12-17T18:54:06.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# pyDE documentation build configuration file, created by
# sphinx-quickstart on Sun Sep 23 14:08:57 2018.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autog... | 29.883249 | 100 | 0.684559 |
797f6360d77af844dd493ca0d6ac8d9cf54810c3 | 6,357 | py | Python | gamutrf/sdr_recorder.py | cglewis/gamutRF | d95b36f5893f165ff02701636c82662727d6e275 | [
"Apache-2.0"
] | null | null | null | gamutrf/sdr_recorder.py | cglewis/gamutRF | d95b36f5893f165ff02701636c82662727d6e275 | [
"Apache-2.0"
] | null | null | null | gamutrf/sdr_recorder.py | cglewis/gamutRF | d95b36f5893f165ff02701636c82662727d6e275 | [
"Apache-2.0"
] | null | null | null |
import datetime
import logging
import os
import subprocess
import tempfile
import time
import sigmf
from gamutrf.utils import ETTUS_ARGS, ETTUS_ANT
from gamutrf.sigwindows import parse_freq_excluded, freq_excluded
SAMPLE_TYPE = 's16'
MIN_SAMPLE_RATE = int(1e6)
MAX_SAMPLE_RATE = int(30 * 1e6)
class SDRRecorder:
... | 38.065868 | 140 | 0.61271 |
797f639548e01dd4d69529994fbff21fdf9eead1 | 1,673 | py | Python | firebot/modules/toonify.py | vikas04599/Fire-X | 527d57c29785f36e1b07aa739f3ac7c969cc916c | [
"MIT"
] | 20 | 2021-08-16T18:49:49.000Z | 2022-02-23T08:35:57.000Z | firebot/modules/toonify.py | elizamusic/Fire-X | 1ec6ba73b3033ad03e7859fcf6917fc6aff89efc | [
"MIT"
] | null | null | null | firebot/modules/toonify.py | elizamusic/Fire-X | 1ec6ba73b3033ad03e7859fcf6917fc6aff89efc | [
"MIT"
] | 93 | 2021-08-16T19:16:20.000Z | 2022-03-31T02:02:06.000Z | import os
import requests
from firebot import CMD_HELP
from ..utils import admin_cmd
DARKCOBRA = Config.DEEP_AI if Config.DEEP_AI else "quickstart-QUdJIGlzIGNvbWluZy4uLi4K"
@borg.on(admin_cmd(pattern="toonify$", outgoing=True))
async def _(event):
reply = await event.get_reply_message()
if not reply: # ... | 30.418182 | 129 | 0.629408 |
797f640b0610f18310e40370a34f30a07780ba7c | 468 | py | Python | geoinfo/migrations/0016_gislayermaster_extra_info.py | stewardshiptools/stewardshiptools | ee5d27e7b0d5d4947f34ad02bdf63a06ad0a5c3e | [
"MIT"
] | null | null | null | geoinfo/migrations/0016_gislayermaster_extra_info.py | stewardshiptools/stewardshiptools | ee5d27e7b0d5d4947f34ad02bdf63a06ad0a5c3e | [
"MIT"
] | 11 | 2020-03-24T15:29:46.000Z | 2022-03-11T23:14:48.000Z | geoinfo/migrations/0016_gislayermaster_extra_info.py | stewardshiptools/stewardshiptools | ee5d27e7b0d5d4947f34ad02bdf63a06ad0a5c3e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django_hstore.fields
class Migration(migrations.Migration):
dependencies = [
('geoinfo', '0015_auto_20160901_0023'),
]
operations = [
migrations.AddField(
model_na... | 22.285714 | 78 | 0.645299 |
797f645ef16011797443423402d9465e7c26c644 | 19,105 | py | Python | Stock/Trade/Broker/DyTrader.py | Leonardo-YXH/DevilYuan | aca5e3cbfa38257335da16ae40968626bc853dc3 | [
"MIT"
] | 5 | 2019-10-13T19:03:45.000Z | 2021-11-22T00:30:39.000Z | Stock/Trade/Broker/DyTrader.py | Leonardo-YXH/DevilYuan | aca5e3cbfa38257335da16ae40968626bc853dc3 | [
"MIT"
] | null | null | null | Stock/Trade/Broker/DyTrader.py | Leonardo-YXH/DevilYuan | aca5e3cbfa38257335da16ae40968626bc853dc3 | [
"MIT"
] | 5 | 2019-09-16T05:19:08.000Z | 2020-07-28T04:45:26.000Z | import os
from time import sleep
import copy
import subprocess
import json
from DyCommon.DyCommon import *
from ..DyStockTradeCommon import *
class DyTrader(object):
"""
券商交易接口基类
"""
name = None
heartBeatTimer = 60
pollingCurEntrustTimer = 1
maxRetryNbr = 3 # 最大重试次数
curEntrustHe... | 32.770154 | 151 | 0.616174 |
797f646b0b928a427dfb64b17bb1230126d6b975 | 1,696 | py | Python | discodo/extractor/spotify.py | AkiaCode/discodo | 0a76afb196a7945f525896f56f431e82aaf83f44 | [
"MIT"
] | null | null | null | discodo/extractor/spotify.py | AkiaCode/discodo | 0a76afb196a7945f525896f56f431e82aaf83f44 | [
"MIT"
] | null | null | null | discodo/extractor/spotify.py | AkiaCode/discodo | 0a76afb196a7945f525896f56f431e82aaf83f44 | [
"MIT"
] | null | null | null | import re
from typing import Union
from asyncspotify import Client, ClientCredentialsFlow
from ..config import Config
URL_REGEX = re.compile(
r"(?:http(?:s):\/\/open\.spotify\.com\/|spotify:)(playlist|track|album)(?:\/|:)([a-z|A-Z|0-9]+)"
)
spotify = None
async def create_client():
global spotify
if ... | 23.555556 | 100 | 0.65566 |
797f658bb30cdd57928c61dbd020c63ac6f03065 | 914 | py | Python | test/units/meta/test_sorted.py | bronxc/refinery | 9448facf48a0008f27861dd1a5ee8f5218e6bb86 | [
"BSD-3-Clause"
] | 1 | 2022-02-13T20:57:15.000Z | 2022-02-13T20:57:15.000Z | test/units/meta/test_sorted.py | bronxc/refinery | 9448facf48a0008f27861dd1a5ee8f5218e6bb86 | [
"BSD-3-Clause"
] | null | null | null | test/units/meta/test_sorted.py | bronxc/refinery | 9448facf48a0008f27861dd1a5ee8f5218e6bb86 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import io
from . import TestMetaBase
from refinery.lib.loader import load_detached as L
class TestSorting(TestMetaBase):
def test_with_scoping(self):
with io.BytesIO() as result:
L('emit F2 F3 S4 S6 S5 F1 S2 S3 S1')[
... | 36.56 | 90 | 0.574398 |
797f65973bff467a65cae193cfbeb8f05f7c1f04 | 1,547 | py | Python | python/ideep4py/tests/mm/test_mdarray_set_mm.py | cis-ncbj/ideep | b57539e4608e75f80dbc5c2784643d5f2f242003 | [
"MIT"
] | 133 | 2017-10-20T06:45:25.000Z | 2022-03-22T08:27:10.000Z | python/ideep4py/tests/mm/test_mdarray_set_mm.py | cis-ncbj/ideep | b57539e4608e75f80dbc5c2784643d5f2f242003 | [
"MIT"
] | 46 | 2018-03-05T06:44:16.000Z | 2021-12-01T03:50:19.000Z | python/ideep4py/tests/mm/test_mdarray_set_mm.py | cis-ncbj/ideep | b57539e4608e75f80dbc5c2784643d5f2f242003 | [
"MIT"
] | 78 | 2017-11-05T11:46:31.000Z | 2022-03-28T08:14:52.000Z | import ideep4py # NOQA
import numpy
import testing
from ideep4py import mdarray
import unittest
class TestMdarraySet(unittest.TestCase):
def setUp(self):
self.check_options = {'atol': 1e-5, 'rtol': 1e-4}
def test_set1(self):
x = numpy.array([1, 1, 1], dtype=numpy.float32)
mx = mdarra... | 28.127273 | 58 | 0.577893 |
797f65c29c3584801c0a6f36a98d42f81d0f9e72 | 13,215 | py | Python | tests/classification/test_inputs.py | BeyondTheProof/metrics | 8af688daff819a95f4cb3d757ffc919c86072ee9 | [
"Apache-2.0"
] | null | null | null | tests/classification/test_inputs.py | BeyondTheProof/metrics | 8af688daff819a95f4cb3d757ffc919c86072ee9 | [
"Apache-2.0"
] | null | null | null | tests/classification/test_inputs.py | BeyondTheProof/metrics | 8af688daff819a95f4cb3d757ffc919c86072ee9 | [
"Apache-2.0"
] | null | null | null | # Copyright The PyTorch Lightning team.
#
# 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... | 42.085987 | 109 | 0.647673 |
797f663e8aac80e343b03c2e62f3c6e6f89155ca | 5,806 | py | Python | mastermind/mastermind.py | spkane/open-mastermind | 78aaaf409fa536b12beb20cff8ceac658b26cc95 | [
"MIT"
] | null | null | null | mastermind/mastermind.py | spkane/open-mastermind | 78aaaf409fa536b12beb20cff8ceac658b26cc95 | [
"MIT"
] | null | null | null | mastermind/mastermind.py | spkane/open-mastermind | 78aaaf409fa536b12beb20cff8ceac658b26cc95 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
''' play mastermind '''
# python2 compatability
from __future__ import print_function
try:
import __builtin__; input = getattr(__builtin__, 'raw_input', input)
except ImportError:
pass
# internal parameters
#from . import params
import params
import os, sys
import random
impo... | 25.577093 | 123 | 0.701343 |
797f67eb5e15864dcbf0b4ff88ff17bb12538bc8 | 6,637 | py | Python | python_modules/libraries/dagster-aws/dagster_aws_tests/redshift_tests/test_resources.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagster-aws/dagster_aws_tests/redshift_tests/test_resources.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | python_modules/libraries/dagster-aws/dagster_aws_tests/redshift_tests/test_resources.py | kstennettlull/dagster | dd6f57e170ff03bf145f1dd1417e0b2c3156b1d6 | [
"Apache-2.0"
] | null | null | null | import os
import uuid
from unittest import mock
import boto3
import psycopg2
import pytest
from dagster_aws.redshift import FakeRedshiftResource, fake_redshift_resource, redshift_resource
from dagster import ModeDefinition, execute_solid, solid
REDSHIFT_ENV = {
"resources": {
"redshift": {
"c... | 30.869767 | 104 | 0.644116 |
797f68a25f98b19ec45bf0037b4c817e173ef607 | 725 | py | Python | src/datasets/root_paths.py | ChenweWu/viewmaker | 65cd8e9ba9a2e691f57965750b168c2f6767362b | [
"MIT"
] | null | null | null | src/datasets/root_paths.py | ChenweWu/viewmaker | 65cd8e9ba9a2e691f57965750b168c2f6767362b | [
"MIT"
] | null | null | null | src/datasets/root_paths.py | ChenweWu/viewmaker | 65cd8e9ba9a2e691f57965750b168c2f6767362b | [
"MIT"
] | 1 | 2021-12-16T15:43:37.000Z | 2021-12-16T15:43:37.000Z | DATA_ROOTS = {
'cifar10': 'data/cifar10',
'meta_aircraft': 'data/aircraft/fgvc-aircraft-2013b',
'meta_cu_birds': 'data/cu_birds/CUB_200_2011',
'meta_dtd': 'data/dtd/dtd',
'meta_fashionmnist': 'data/fashionmnist',
'meta_fungi': 'data/fungi',
'meta_mnist': 'data/mnist',
'meta_mscoco': 'dat... | 38.157895 | 57 | 0.673103 |
797f68bfbaab37e5911062a95babeb1eda1aa914 | 960 | py | Python | data_analysis/data_analysis.py | seismicshaker/2018_agu_workshop | c4b5ff0d21e5cc3b86fabf8b4e331ce2b5c264a1 | [
"MIT"
] | null | null | null | data_analysis/data_analysis.py | seismicshaker/2018_agu_workshop | c4b5ff0d21e5cc3b86fabf8b4e331ce2b5c264a1 | [
"MIT"
] | null | null | null | data_analysis/data_analysis.py | seismicshaker/2018_agu_workshop | c4b5ff0d21e5cc3b86fabf8b4e331ce2b5c264a1 | [
"MIT"
] | null | null | null | """
These are data anaysis functions to download and process temperature series from Berkeley Earth.
"""
#Import Libraries
import numpy as np
import requests
#Define loading functions
def generate_URL(place):
"""
This function will generate the string of the URL to access the temperature data
:param plac... | 25.263158 | 96 | 0.7 |
797f69dc0b08f68ab44fb6dc29d14dc9c853d88f | 275 | py | Python | gsm/truc.py | BobcatSMS/Bobcat | 044c390de949966810f2c74167b4d79b8431a886 | [
"WTFPL"
] | null | null | null | gsm/truc.py | BobcatSMS/Bobcat | 044c390de949966810f2c74167b4d79b8431a886 | [
"WTFPL"
] | null | null | null | gsm/truc.py | BobcatSMS/Bobcat | 044c390de949966810f2c74167b4d79b8431a886 | [
"WTFPL"
] | 1 | 2016-04-19T13:34:45.000Z | 2016-04-19T13:34:45.000Z | text = "zeub"
hexa = ""
for i in text:
hexa += str(hex(ord(i)))[2:].zfill(4)
print(hexa)
hexa = "002B00330033003600380039003000300034003000300030" #YOLOO
hexa = [hexa[i:i+4] for i in range(0, len(hexa), 4)]
text=""
for i in hexa:
text+=chr(int(i, 16))
print(text) | 19.642857 | 64 | 0.64 |
797f6cfcea9f73348669e1f9da41cf998f83b68b | 487 | py | Python | app/recipe/serializers.py | tricelex/recipe-app-api | bc9990aff8666feedd4f0922c03973279ea06444 | [
"MIT"
] | null | null | null | app/recipe/serializers.py | tricelex/recipe-app-api | bc9990aff8666feedd4f0922c03973279ea06444 | [
"MIT"
] | null | null | null | app/recipe/serializers.py | tricelex/recipe-app-api | bc9990aff8666feedd4f0922c03973279ea06444 | [
"MIT"
] | null | null | null | from core.models import Tag, Ingredient
from rest_framework import serializers
class TagSerializer(serializers.ModelSerializer):
"""Serializer for Tag objects"""
class Meta:
model = Tag
fields = ('id', 'name')
read_only_field = ('id',)
class IngredientSerializer(serializers.ModelS... | 22.136364 | 56 | 0.646817 |
797f6dc6c56bbf95d2d3d32f25cb45cbc818886a | 3,016 | py | Python | test/jsontypes_test.py | categulario/cacahuate | 830b1656c8b5d183af637a47f9f3bcd04287f6b4 | [
"MIT"
] | 3 | 2018-05-18T01:49:13.000Z | 2019-02-22T22:03:18.000Z | test/jsontypes_test.py | categulario/cacahuate | 830b1656c8b5d183af637a47f9f3bcd04287f6b4 | [
"MIT"
] | 23 | 2018-04-05T22:44:53.000Z | 2021-09-14T20:33:34.000Z | test/jsontypes_test.py | tracsa/pvm | 14cb799695a4a49ca13d8037a1e15a398f5e70da | [
"MIT"
] | 5 | 2018-07-06T14:07:41.000Z | 2022-02-28T12:26:00.000Z | import pytest
from cacahuate.jsontypes import SortedMap, Map, MultiFormDict
def test_sorted_map():
sm = SortedMap([
{
'id': '1',
'name': 'la',
},
{
'id': '2',
'name': 'le',
},
], key='id')
assert sm.to_json() == {
'_... | 17.952381 | 61 | 0.274536 |
797f6f05bdfd418278c1404f2506e2dc91601fc3 | 341 | py | Python | docs/sample_config.py | pepimartinez/handbowl | 628eb4e92f9abe778646e818681de27146894eee | [
"Apache-2.0"
] | 3 | 2018-09-26T15:39:08.000Z | 2021-06-19T18:15:12.000Z | docs/sample_config.py | pepimartinez/handbowl | 628eb4e92f9abe778646e818681de27146894eee | [
"Apache-2.0"
] | null | null | null | docs/sample_config.py | pepimartinez/handbowl | 628eb4e92f9abe778646e818681de27146894eee | [
"Apache-2.0"
] | null | null | null | handshake = {
'key': 'API_KEY_HERE'
},
fishbowl = {
'host': 'HOST_ADDRESS_OF_FISHBOWL_SERVER',
'user': 'USER_NAME_OF_FISHBOWL_ADMIN',
'password': 'PASSWORD_FOR_FISHBOWL_ADMIN'
},
# handbowl_settings = {
# 'sync_products': True,
# 'sync_inventory': False,
# 'sync_customers': True,
# 'sy... | 20.058824 | 46 | 0.642229 |
797f6f82ef5cab0f223fb6eb0140ab3b6ed1fd2c | 158 | py | Python | python3-tutorial/02 Advanced/1203 CreateCollection.py | CoderDream/python-best-practice | 40e6b5315daefb37c59daa1a1990ac1ae10f8cca | [
"MIT"
] | null | null | null | python3-tutorial/02 Advanced/1203 CreateCollection.py | CoderDream/python-best-practice | 40e6b5315daefb37c59daa1a1990ac1ae10f8cca | [
"MIT"
] | null | null | null | python3-tutorial/02 Advanced/1203 CreateCollection.py | CoderDream/python-best-practice | 40e6b5315daefb37c59daa1a1990ac1ae10f8cca | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import pymongo
myclient = pymongo.MongoClient('mongodb://chenqingwh.uicp.net:37017/')
mydb = myclient["quant_01"]
mycol = mydb["sites"]
| 17.555556 | 70 | 0.727848 |
797f7087eb5e4828978e44ac9c8ce7cd95309c92 | 956 | py | Python | sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/gremlin_database_paged.py | vchske/azure-sdk-for-python | 6383ed3676b7355af7be394562b126209961ec13 | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | sdk/cosmos/azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/gremlin_database_paged.py | vchske/azure-sdk-for-python | 6383ed3676b7355af7be394562b126209961ec13 | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-cosmosdb/azure/mgmt/cosmosdb/models/gremlin_database_paged.py | xiafu-msft/azure-sdk-for-python | 4d9560cfd519ee60667f3cc2f5295a58c18625db | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 34.142857 | 128 | 0.583682 |
797f71392132843a800be11f88d1ecf1b6599b03 | 4,034 | py | Python | ArcGIS/ArcGIS/spiders/arcgis.py | houzw/knowledge-base-data | 60771e8bf300227e1a26c9e77f56b09d23acd64a | [
"MIT"
] | null | null | null | ArcGIS/ArcGIS/spiders/arcgis.py | houzw/knowledge-base-data | 60771e8bf300227e1a26c9e77f56b09d23acd64a | [
"MIT"
] | 3 | 2021-03-10T00:52:48.000Z | 2021-03-10T01:05:28.000Z | spiders/ArcGIS/ArcGIS/spiders/arcgis.py | lreis2415/geovalidator | dd64b0577aa458b39022afa503e890e966eb56d8 | [
"MIT"
] | 1 | 2018-12-17T06:40:53.000Z | 2018-12-17T06:40:53.000Z | # -*- coding: utf-8 -*-
import scrapy
from ..items import ArcgisItem
import glob
import re
# arcinfo chm
class ArcgisSpider(scrapy.Spider):
name = 'arcgis'
# allowed_domains = ['esri.com']
# start_urls = ['http://www.esri.com/']
htmls = glob.glob('H:/OntoBase/egc-materials/arcgis_help/arcinfo_all/*.htm')
local =... | 37.351852 | 126 | 0.653446 |
797f7184d5f655da0987bb04252985c82fd82894 | 3,045 | py | Python | pyatv/mrp/protobuf/RemoveEndpointsMessage_pb2.py | postlund/pyatv_playground | e17ab551b9b69043e163a212aee6ceb4bd63ee63 | [
"MIT"
] | null | null | null | pyatv/mrp/protobuf/RemoveEndpointsMessage_pb2.py | postlund/pyatv_playground | e17ab551b9b69043e163a212aee6ceb4bd63ee63 | [
"MIT"
] | 128 | 2020-04-24T06:42:29.000Z | 2021-02-19T11:34:20.000Z | pyatv/mrp/protobuf/RemoveEndpointsMessage_pb2.py | postlund/pyatv_playground | e17ab551b9b69043e163a212aee6ceb4bd63ee63 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: pyatv/mrp/protobuf/RemoveEndpointsMessage.proto
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf i... | 37.134146 | 290 | 0.807553 |
797f720f9d7997deb8d1eeb5bf3ed323675120a8 | 21,653 | py | Python | sphinx_toolbox/installation.py | sphinx-toolbox/sphinx-toolbox | cee88c6bceac20a9ae0e381ada2fb2453ca3fc0b | [
"MIT"
] | 30 | 2021-03-01T00:15:55.000Z | 2022-03-01T13:23:59.000Z | sphinx_toolbox/installation.py | sphinx-toolbox/sphinx-toolbox | cee88c6bceac20a9ae0e381ada2fb2453ca3fc0b | [
"MIT"
] | 56 | 2020-12-17T12:39:04.000Z | 2022-03-21T19:00:55.000Z | sphinx_toolbox/installation.py | sphinx-toolbox/sphinx-toolbox | cee88c6bceac20a9ae0e381ada2fb2453ca3fc0b | [
"MIT"
] | 4 | 2021-07-04T16:57:52.000Z | 2022-03-21T19:35:31.000Z | #!/usr/bin/env python3
#
# installation.py
r"""
.. extensions:: sphinx_toolbox.installation
Configuration
--------------
.. confval:: conda_channels
:type: :class:`~typing.List`\[:class:`str`\]
:required: False
:default: ``[]``
The conda channels required to install the library from Anaconda.
An alternative ... | 29.221323 | 111 | 0.710987 |
797f72557b08bb70805e8411459349fdc41e1e63 | 1,681 | py | Python | CZ3004/Raspberry PI/piBlueTooth.py | samueljz/NTU-Assignment | cf58fd1f42e57644f16dd84888f54613f859f2a7 | [
"MIT"
] | null | null | null | CZ3004/Raspberry PI/piBlueTooth.py | samueljz/NTU-Assignment | cf58fd1f42e57644f16dd84888f54613f859f2a7 | [
"MIT"
] | null | null | null | CZ3004/Raspberry PI/piBlueTooth.py | samueljz/NTU-Assignment | cf58fd1f42e57644f16dd84888f54613f859f2a7 | [
"MIT"
] | null | null | null | from bluetooth import *
import serial
class piBlueTooth:
uuid = "00001101-0000-1000-8000-00805F9B34FB"
server_sock = None
port = None
client_sock = None
client_info = None
def __init__(self):
self.server_sock = BluetoothSocket( RFCOMM )
self.server_sock.bind(("",4))
self... | 34.306122 | 71 | 0.532421 |
797f72fcc03d81586bf763d434438b86a02da0c8 | 847 | py | Python | otp/level/VisibilityBlocker.py | TheFamiliarScoot/open-toontown | 678313033174ea7d08e5c2823bd7b473701ff547 | [
"BSD-3-Clause"
] | 99 | 2019-11-02T22:25:00.000Z | 2022-02-03T03:48:00.000Z | otp/level/VisibilityBlocker.py | TheFamiliarScoot/open-toontown | 678313033174ea7d08e5c2823bd7b473701ff547 | [
"BSD-3-Clause"
] | 42 | 2019-11-03T05:31:08.000Z | 2022-03-16T22:50:32.000Z | otp/level/VisibilityBlocker.py | TheFamiliarScoot/open-toontown | 678313033174ea7d08e5c2823bd7b473701ff547 | [
"BSD-3-Clause"
] | 57 | 2019-11-03T07:47:37.000Z | 2022-03-22T00:41:49.000Z | from . import Entity
class VisibilityBlocker:
def __init__(self):
self.__nextSetZoneDoneEvent = None
return
def destroy(self):
self.cancelUnblockVis()
def requestUnblockVis(self):
if self.__nextSetZoneDoneEvent is None:
self.__nextSetZoneDoneEvent = self.level... | 28.233333 | 81 | 0.682409 |
797f7313a858f8c6f072bd9790736d1492474e92 | 38,024 | gyp | Python | chrome_frame/chrome_frame.gyp | GnorTech/chromium | e1c7731d5bd099ca5544fcf8eda3867d4ce5bab5 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2018-03-10T13:08:49.000Z | 2018-03-10T13:08:49.000Z | chrome_frame/chrome_frame.gyp | GnorTech/chromium | e1c7731d5bd099ca5544fcf8eda3867d4ce5bab5 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | null | null | null | chrome_frame/chrome_frame.gyp | GnorTech/chromium | e1c7731d5bd099ca5544fcf8eda3867d4ce5bab5 | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 1 | 2020-11-04T07:19:31.000Z | 2020-11-04T07:19:31.000Z | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
{
'variables': {
'chromium_code': 1,
# Keep the archive builder happy.
'chrome_personalization%': 1,
'use_syncapi_stub%': 0,
'con... | 34.916437 | 107 | 0.541737 |
797f7418782ab156b238e3e081a82f155977d6f1 | 7,506 | py | Python | Incident-Response/Tools/dfirtrack/dfirtrack_config/tests/system/test_system_exporter_spreadsheet_xls_config_forms.py | sn0b4ll/Incident-Playbook | cf519f58fcd4255674662b3620ea97c1091c1efb | [
"MIT"
] | 1 | 2021-07-24T17:22:50.000Z | 2021-07-24T17:22:50.000Z | Incident-Response/Tools/dfirtrack/dfirtrack_config/tests/system/test_system_exporter_spreadsheet_xls_config_forms.py | sn0b4ll/Incident-Playbook | cf519f58fcd4255674662b3620ea97c1091c1efb | [
"MIT"
] | 2 | 2022-02-28T03:40:31.000Z | 2022-02-28T03:40:52.000Z | Incident-Response/Tools/dfirtrack/dfirtrack_config/tests/system/test_system_exporter_spreadsheet_xls_config_forms.py | sn0b4ll/Incident-Playbook | cf519f58fcd4255674662b3620ea97c1091c1efb | [
"MIT"
] | 2 | 2022-02-25T08:34:51.000Z | 2022-03-16T17:29:44.000Z | from django.test import TestCase
from dfirtrack_config.forms import SystemExporterSpreadsheetXlsConfigForm
class SystemExporterSpreadsheetXlsConfigFormTestCase(TestCase):
""" system exporter spreadsheet XLS config form tests """
def test_system_exporter_spreadsheet_xls_config_spread_xls_system_id_form_label(s... | 39.505263 | 128 | 0.716627 |
797f767a9728448011ee00892f6e923ba6d8f112 | 11,927 | py | Python | django/db/models/lookups.py | simone/django-gb | 5233b366935dcc81e47546921ab4eb5007c83719 | [
"BSD-3-Clause"
] | 1 | 2015-01-07T10:29:03.000Z | 2015-01-07T10:29:03.000Z | django/db/models/lookups.py | pchiquet/django | 45ef4baf5cb018acba16c269e3d470ee1de146e0 | [
"BSD-3-Clause"
] | null | null | null | django/db/models/lookups.py | pchiquet/django | 45ef4baf5cb018acba16c269e3d470ee1de146e0 | [
"BSD-3-Clause"
] | null | null | null | from copy import copy
from itertools import repeat
import inspect
from django.conf import settings
from django.utils import timezone
from django.utils.functional import cached_property
from django.utils.six.moves import xrange
class RegisterLookupMixin(object):
def _get_lookup(self, lookup_name):
try:
... | 31.304462 | 96 | 0.652721 |
797f79c4924d1cbabe444707c74a65a79aae3245 | 2,490 | py | Python | markov_chains.py | AyanamiSan/python2-practice | 30721351f8137f0b99f2b343cb32b477a04af65c | [
"BSD-3-Clause"
] | 1 | 2020-01-31T21:34:43.000Z | 2020-01-31T21:34:43.000Z | markov_chains.py | AyanamiSan/python2-practice | 30721351f8137f0b99f2b343cb32b477a04af65c | [
"BSD-3-Clause"
] | null | null | null | markov_chains.py | AyanamiSan/python2-practice | 30721351f8137f0b99f2b343cb32b477a04af65c | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
from __future__ import print_function
import io, sys, sqlite3
import codecs
import argparse
import markov
def analyze(args):
custom=False
if(args.instream):
in_stream = io.open(args.instream)
custom=True
else:
in_stream = codecs.getreader('utf8')(sys.stdin)
analyzer = markov.... | 27.977528 | 67 | 0.634538 |
797f79e3f82ae5a0db7c518a995a77377e1b9556 | 1,056 | py | Python | app/Model/Price.py | ansabkhaliq/backend | 14bad9b44bfec6ea4ba27d1571ddcf614ff762c6 | [
"MIT"
] | null | null | null | app/Model/Price.py | ansabkhaliq/backend | 14bad9b44bfec6ea4ba27d1571ddcf614ff762c6 | [
"MIT"
] | 11 | 2020-09-22T11:15:09.000Z | 2020-11-03T21:45:18.000Z | app/Model/Price.py | ansabkhaliq/backend | 14bad9b44bfec6ea4ba27d1571ddcf614ff762c6 | [
"MIT"
] | 2 | 2020-09-21T19:20:44.000Z | 2021-03-21T04:46:19.000Z | from app.Model.Model import Model
class Price(Model):
def __init__(self, json):
# primary key
self.id = 0
self.keyProductID = None
self.keySellUnitID = None
self.price = 0
# Contract Reference ID (not all customers will have it)
self.referenceID = None
... | 28.540541 | 66 | 0.5625 |
797f7a2894413a6b45891e8c4bbb28b3e9d5900d | 21,307 | py | Python | py/legacyhalos/io.py | Christopher-Bradshaw/legacyhalos | 8a7644425dedc85849dc532d8252f280fa6d1f56 | [
"MIT"
] | null | null | null | py/legacyhalos/io.py | Christopher-Bradshaw/legacyhalos | 8a7644425dedc85849dc532d8252f280fa6d1f56 | [
"MIT"
] | null | null | null | py/legacyhalos/io.py | Christopher-Bradshaw/legacyhalos | 8a7644425dedc85849dc532d8252f280fa6d1f56 | [
"MIT"
] | null | null | null | """
legacyhalos.io
==============
Code to read and write the various legacyhalos files.
"""
import os, pdb
import numpy as np
import numpy.ma as ma
import fitsio
import astropy.units as u
from astropy.table import Table, Column
from astrometry.util.fits import fits_table
def legacyhalos_dir():
if 'LEGACYHALOS_D... | 36.174873 | 115 | 0.580795 |
797f7c271ce22f7a48755751f2f974c27bc32299 | 11,662 | py | Python | sdk/keyvault/azure-keyvault-keys/tests/test_crypto_client_async.py | kushan2018/azure-sdk-for-python | 08a9296207281f4e90e23cf7a30173863accc867 | [
"MIT"
] | null | null | null | sdk/keyvault/azure-keyvault-keys/tests/test_crypto_client_async.py | kushan2018/azure-sdk-for-python | 08a9296207281f4e90e23cf7a30173863accc867 | [
"MIT"
] | null | null | null | sdk/keyvault/azure-keyvault-keys/tests/test_crypto_client_async.py | kushan2018/azure-sdk-for-python | 08a9296207281f4e90e23cf7a30173863accc867 | [
"MIT"
] | null | null | null | # ------------------------------------
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
# ------------------------------------
import codecs
import hashlib
from azure.keyvault.keys import KeyCurveName
from azure.keyvault.keys.crypto import CryptographyClient, EncryptionAlgorithm, KeyWrapAlgorit... | 53.990741 | 532 | 0.741125 |
797f7c758f493b5b85d89337191bcb5e52b78bac | 7,754 | py | Python | sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_metrics_operations.py | xolve/azure-sdk-for-python | 9f5baa19c392f77f811d936ee43450e4ea524002 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_metrics_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/monitor/azure-mgmt-monitor/azure/mgmt/monitor/v2017_05_01_preview/operations/_metrics_operations.py | v-xuto/azure-sdk-for-python | 9c6296d22094c5ede410bc83749e8df8694ccacc | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 49.705128 | 133 | 0.651664 |
797f7c92dc7ffd820a43f8f324edee36489bed29 | 4,576 | py | Python | tests/st/ops/cpu/test_l2loss_op.py | PowerOlive/mindspore | bda20724a94113cedd12c3ed9083141012da1f15 | [
"Apache-2.0"
] | 3,200 | 2020-02-17T12:45:41.000Z | 2022-03-31T20:21:16.000Z | tests/st/ops/cpu/test_l2loss_op.py | zimo-geek/mindspore | 665ec683d4af85c71b2a1f0d6829356f2bc0e1ff | [
"Apache-2.0"
] | 176 | 2020-02-12T02:52:11.000Z | 2022-03-28T22:15:55.000Z | tests/st/ops/cpu/test_l2loss_op.py | zimo-geek/mindspore | 665ec683d4af85c71b2a1f0d6829356f2bc0e1ff | [
"Apache-2.0"
] | 621 | 2020-03-09T01:31:41.000Z | 2022-03-30T03:43:19.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 31.777778 | 78 | 0.68007 |
797f7ca565c8c8f8eeb935a096b5dcfd2f8a353d | 514 | py | Python | src/finmag/tests/comparison/demag/run_nmag.py | davidcortesortuno/finmag | 9ac0268d2c0e45faf1284cee52a73525aa589e2b | [
"BSL-1.0"
] | 10 | 2018-03-24T07:43:17.000Z | 2022-03-26T10:42:27.000Z | src/finmag/tests/comparison/demag/run_nmag.py | davidcortesortuno/finmag | 9ac0268d2c0e45faf1284cee52a73525aa589e2b | [
"BSL-1.0"
] | 21 | 2018-03-26T15:08:53.000Z | 2021-07-10T16:11:14.000Z | src/finmag/tests/comparison/demag/run_nmag.py | davidcortesortuno/finmag | 9ac0268d2c0e45faf1284cee52a73525aa589e2b | [
"BSL-1.0"
] | 7 | 2018-04-09T11:50:48.000Z | 2021-06-10T09:23:25.000Z | import os
import numpy as np
import nmag
from nmag import SI
MODULE_DIR = os.path.dirname(os.path.abspath(__file__))
# create simulation object
sim = nmag.Simulation()
# define magnetic material
Py = nmag.MagMaterial(name='Py', Ms=SI(1.0, 'A/m'))
# load mesh
sim.load_mesh("sphere.nmesh.h5", [('main', Py)], unit_len... | 20.56 | 75 | 0.696498 |
797f7cfb7cebb18c19e817595caca9db8272f59b | 1,963 | py | Python | python/merge_tral_results.py | maverbiest/SP_CRC_Pathway_TRs | 9c48da8f2ef67c7a9b8fd0ed46ffadd116ee5450 | [
"MIT"
] | null | null | null | python/merge_tral_results.py | maverbiest/SP_CRC_Pathway_TRs | 9c48da8f2ef67c7a9b8fd0ed46ffadd116ee5450 | [
"MIT"
] | null | null | null | python/merge_tral_results.py | maverbiest/SP_CRC_Pathway_TRs | 9c48da8f2ef67c7a9b8fd0ed46ffadd116ee5450 | [
"MIT"
] | 1 | 2021-03-24T09:26:11.000Z | 2021-03-24T09:26:11.000Z | #!/usr/bin/env python3
"""
Concatenate all TRAL output files (generated by run_tral.py) from a directory into one file.
Author: Max Verbiest
Contact: max.verbiest@zhaw.ch
"""
import argparse
import os
def concatenate_files(file_list, output_file):
"""Concatenates all files from file_list into one big file: outp... | 30.671875 | 104 | 0.602649 |
797f7e8620bda32ff3181c86dbb7c008d3736324 | 4,878 | py | Python | ansible/scripts/generate.py | BertRaeymaekers/scrapbook | 3c8483d4594356fbc84deb8d6496db3d856492c1 | [
"MIT"
] | null | null | null | ansible/scripts/generate.py | BertRaeymaekers/scrapbook | 3c8483d4594356fbc84deb8d6496db3d856492c1 | [
"MIT"
] | null | null | null | ansible/scripts/generate.py | BertRaeymaekers/scrapbook | 3c8483d4594356fbc84deb8d6496db3d856492c1 | [
"MIT"
] | null | null | null | #! /usr/bin/env python3
import copy
import errno
import os.path
import yaml
SCRIPT_DIR = os.path.dirname(os.path.realpath(__file__))
DEFAULT_HOSTS_YML_FILENAME = SCRIPT_DIR + '/../conf/hosts.yml'
def load_config(filename):
with open(filename, 'r') as yml:
return yaml.load(yml)
config = load_config(S... | 34.111888 | 152 | 0.628741 |
797f7ee42a20d2ebc0e10c91a207155686d36515 | 1,110 | py | Python | fsspec/tests/test_generic.py | fsspec/filesystem_spec | 7a0e4f91d9972ea8ee325479346d090c090ffdfa | [
"BSD-3-Clause"
] | 61 | 2021-11-06T19:55:06.000Z | 2022-03-31T17:49:43.000Z | fsspec/tests/test_generic.py | fsspec/filesystem_spec | 7a0e4f91d9972ea8ee325479346d090c090ffdfa | [
"BSD-3-Clause"
] | 108 | 2021-11-05T16:41:13.000Z | 2022-03-31T21:09:53.000Z | fsspec/tests/test_generic.py | fsspec/filesystem_spec | 7a0e4f91d9972ea8ee325479346d090c090ffdfa | [
"BSD-3-Clause"
] | 29 | 2021-11-08T22:35:01.000Z | 2022-03-31T20:22:59.000Z | import fsspec
from fsspec.tests.conftest import data, server # noqa: F401
def test_remote_async_ops(server):
fsspec.filesystem("http", headers={"give_length": "true", "head_ok": "true"})
fs = fsspec.filesystem("generic", default_method="current")
out = fs.info(server + "/index/realfile")
assert out["... | 31.714286 | 81 | 0.661261 |
797f7f8e0f30df420db4bd660d56773ad811f3bd | 28,375 | py | Python | Lib/site-packages/streamlit/delta_generator.py | hirorin-demon/hirorin-streamlit | 03fbb6f03ec94f909d451e708a3b30b177607695 | [
"0BSD"
] | 1 | 2021-07-21T02:59:55.000Z | 2021-07-21T02:59:55.000Z | Lib/site-packages/streamlit/delta_generator.py | hirorin-demon/hirorin-streamlit | 03fbb6f03ec94f909d451e708a3b30b177607695 | [
"0BSD"
] | null | null | null | Lib/site-packages/streamlit/delta_generator.py | hirorin-demon/hirorin-streamlit | 03fbb6f03ec94f909d451e708a3b30b177607695 | [
"0BSD"
] | null | null | null | # Copyright 2018-2021 Streamlit 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 wr... | 37.483487 | 94 | 0.6437 |
797f8007dc1500d771fa23654500f983ad5e1b8a | 2,775 | py | Python | homeassistant/components/sensor/mqtt.py | loraxx753/skynet | 86a1b0a6c6a3f81bc92d4f61de6a9a6b9f964543 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/sensor/mqtt.py | loraxx753/skynet | 86a1b0a6c6a3f81bc92d4f61de6a9a6b9f964543 | [
"Apache-2.0"
] | null | null | null | homeassistant/components/sensor/mqtt.py | loraxx753/skynet | 86a1b0a6c6a3f81bc92d4f61de6a9a6b9f964543 | [
"Apache-2.0"
] | 1 | 2019-08-04T19:25:10.000Z | 2019-08-04T19:25:10.000Z | """
Support for MQTT sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.mqtt/
"""
import logging
import voluptuous as vol
from homeassistant.core import callback
from homeassistant.components.mqtt import CONF_STATE_TOPIC, CONF_QOS
from home... | 30.163043 | 79 | 0.686847 |
797f81bef51a7bf0b4797ad2578b59c75f94b731 | 5,529 | py | Python | taobao/spiders/tmallproduct.py | nosun/taobao | 7b53fa5f7f9ca4508ccd6236ef9dcccea702b197 | [
"Apache-2.0"
] | 3 | 2017-10-26T11:41:17.000Z | 2018-05-11T12:43:53.000Z | taobao/spiders/tmallproduct.py | nosun/taobao | 7b53fa5f7f9ca4508ccd6236ef9dcccea702b197 | [
"Apache-2.0"
] | 1 | 2019-07-02T11:02:47.000Z | 2019-07-02T11:02:47.000Z | taobao/spiders/tmallproduct.py | nosun/taobao | 7b53fa5f7f9ca4508ccd6236ef9dcccea702b197 | [
"Apache-2.0"
] | 3 | 2018-05-11T05:56:03.000Z | 2019-10-17T11:33:05.000Z | # -*- coding: utf-8 -*-
import os
import scrapy
from lxml import etree
import json
import re
import time
import random
from furl import furl
if __name__ == '__main__' and __package__ is None:
from os import sys, path
sys.path.append(path.dirname(path.dirname(path.dirname(path.abspath(__file__)))))
from taoba... | 34.993671 | 474 | 0.567191 |
797f822d4df76a64df19623d6978fe61d1d3ca72 | 2,361 | py | Python | onnx/backend/test/case/node/slice.py | HeliWang/onnx-fixed | 266ec0a6a302d99710921f9bc8047d5fe3558328 | [
"MIT"
] | null | null | null | onnx/backend/test/case/node/slice.py | HeliWang/onnx-fixed | 266ec0a6a302d99710921f9bc8047d5fe3558328 | [
"MIT"
] | null | null | null | onnx/backend/test/case/node/slice.py | HeliWang/onnx-fixed | 266ec0a6a302d99710921f9bc8047d5fe3558328 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import numpy as np
import onnx
from ..base import Base
from . import expect
class Slice(Base):
@staticmethod
def export_slice():
node = onnx.helper.ma... | 24.091837 | 57 | 0.492164 |
797f82d0dcbe61c0e2ec651e3607404ccb98218a | 757 | py | Python | src/dynamo_db/create_data.py | usdot-jpo-sdc-projects/sdc-dot-ecs-migration | 0f70846371126dafb3b2ae8980fbbce728d0868f | [
"MIT"
] | null | null | null | src/dynamo_db/create_data.py | usdot-jpo-sdc-projects/sdc-dot-ecs-migration | 0f70846371126dafb3b2ae8980fbbce728d0868f | [
"MIT"
] | null | null | null | src/dynamo_db/create_data.py | usdot-jpo-sdc-projects/sdc-dot-ecs-migration | 0f70846371126dafb3b2ae8980fbbce728d0868f | [
"MIT"
] | null | null | null | import pprint
import boto3
import json
from botocore.exceptions import ClientError
from src.utils import awsutils
def main():
vars = awsutils.read_vars()
dynamodb = boto3.resource('dynamodb')
table = dynamodb.Table(vars['DynamoDBDestinationStacks'])
with open('input/dest-user-stacks.txt... | 22.939394 | 62 | 0.623514 |
797f83ac6fa16b078452b965cb164707fd66c0d8 | 5,260 | py | Python | make_mozilla/events/migrations/0012_separate_source_and_id.py | Mozilla-GitHub-Standards/54c69db06ef83bda60e995a6c34ecfd168ca028994e40ce817295415bb409f0c | f80e7c0cff97a1e9b301aa04015db983c7645778 | [
"BSD-3-Clause"
] | 4 | 2015-05-08T16:58:53.000Z | 2019-09-06T05:30:59.000Z | make_mozilla/events/migrations/0012_separate_source_and_id.py | Mozilla-GitHub-Standards/54c69db06ef83bda60e995a6c34ecfd168ca028994e40ce817295415bb409f0c | f80e7c0cff97a1e9b301aa04015db983c7645778 | [
"BSD-3-Clause"
] | 2 | 2019-02-17T17:44:53.000Z | 2019-03-28T03:54:39.000Z | make_mozilla/events/migrations/0012_separate_source_and_id.py | Mozilla-GitHub-Standards/54c69db06ef83bda60e995a6c34ecfd168ca028994e40ce817295415bb409f0c | f80e7c0cff97a1e9b301aa04015db983c7645778 | [
"BSD-3-Clause"
] | 7 | 2015-05-21T15:38:29.000Z | 2019-10-28T23:39:06.000Z | # -*- coding: 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 field 'Event.source'
db.add_column('events_event', 'source',
self.gf('django.... | 58.444444 | 142 | 0.535361 |
797f84a2bb3d41b0c2491be0cd605c63952f3caa | 331 | py | Python | _solutions/intermediate/builtin/builtin_function_a.py | sages-pl/2022-01-pythonsqlalchemy-aptiv | 1d6d856608e9dbe25b139e8968c48b7f46753b84 | [
"MIT"
] | null | null | null | _solutions/intermediate/builtin/builtin_function_a.py | sages-pl/2022-01-pythonsqlalchemy-aptiv | 1d6d856608e9dbe25b139e8968c48b7f46753b84 | [
"MIT"
] | null | null | null | _solutions/intermediate/builtin/builtin_function_a.py | sages-pl/2022-01-pythonsqlalchemy-aptiv | 1d6d856608e9dbe25b139e8968c48b7f46753b84 | [
"MIT"
] | null | null | null |
def average(args):
if all(isinstance(x, float) for x in args):
return sum(args) / len(args)
header, *data = DATA
result = {x:list() for x in header}
for row in data:
for i, head in enumerate(header):
result[head].append(row[i])
result = {key: average(value)
for key, value in resul... | 20.6875 | 47 | 0.616314 |
797f853db94821ecfc7866f686dcafa1d81fc897 | 440 | py | Python | authentik/sources/ldap/apps.py | BeryJu/passbook | 350f0d836580f4411524614f361a76c4f27b8a2d | [
"MIT"
] | 15 | 2020-01-05T09:09:57.000Z | 2020-11-28T05:27:39.000Z | authentik/sources/ldap/apps.py | BeryJu/passbook | 350f0d836580f4411524614f361a76c4f27b8a2d | [
"MIT"
] | 302 | 2020-01-21T08:03:59.000Z | 2020-12-04T05:04:57.000Z | authentik/sources/ldap/apps.py | BeryJu/passbook | 350f0d836580f4411524614f361a76c4f27b8a2d | [
"MIT"
] | 3 | 2020-03-04T08:21:59.000Z | 2020-08-01T20:37:18.000Z | """authentik ldap source config"""
from importlib import import_module
from django.apps import AppConfig
class AuthentikSourceLDAPConfig(AppConfig):
"""Authentik ldap app config"""
name = "authentik.sources.ldap"
label = "authentik_sources_ldap"
verbose_name = "authentik Sources.LDAP"
def ready... | 25.882353 | 55 | 0.731818 |
797f85568846e0a0bc007fc1edc04f83b41ff26f | 2,040 | py | Python | sympy/physics/pring.py | shivangdubey/sympy | bd3ddd4c71d439c8b623f69a02274dd8a8a82198 | [
"BSD-3-Clause"
] | 2 | 2021-01-09T23:11:25.000Z | 2021-01-11T15:04:22.000Z | sympy/physics/pring.py | shivangdubey/sympy | bd3ddd4c71d439c8b623f69a02274dd8a8a82198 | [
"BSD-3-Clause"
] | 2 | 2020-08-18T15:21:59.000Z | 2020-08-18T19:35:29.000Z | sympy/physics/pring.py | shivangdubey/sympy | bd3ddd4c71d439c8b623f69a02274dd8a8a82198 | [
"BSD-3-Clause"
] | 2 | 2021-01-08T23:03:23.000Z | 2021-01-13T18:57:02.000Z | from __future__ import print_function, division
from sympy import sqrt, exp, S, pi, I
from sympy.physics.quantum.constants import hbar
def wavefunction(n, x):
"""
Returns the wavefunction for particle on ring.
n is the quantum number, x is the angle,
here n can be positive as well as negative
whi... | 25.5 | 71 | 0.566667 |
797f8649c7040880010f071b4f8a80e03e1ccdeb | 1,094 | py | Python | languages/python/trie.py | RohitAthithya/learntosolveit | fe1df98534d3af2fb3ba87c6540d9d8fa883c244 | [
"BSD-3-Clause"
] | 136 | 2015-03-06T18:11:21.000Z | 2022-03-10T22:31:40.000Z | languages/python/trie.py | RohitAthithya/learntosolveit | fe1df98534d3af2fb3ba87c6540d9d8fa883c244 | [
"BSD-3-Clause"
] | 27 | 2015-01-07T01:38:03.000Z | 2021-12-22T19:20:15.000Z | languages/python/trie.py | RohitAthithya/learntosolveit | fe1df98534d3af2fb3ba87c6540d9d8fa883c244 | [
"BSD-3-Clause"
] | 1,582 | 2015-01-01T20:37:06.000Z | 2022-03-30T12:29:24.000Z | """
Simple Trie Implementation
"""
import json
_end_marker = "*"
def add_word(trie, word):
word_trie = trie
for ch in word:
if ch in word_trie:
word_trie = word_trie[ch]
else:
word_trie[ch] = {}
word_trie = word_trie[ch]
word_trie[_end_marker]... | 18.542373 | 53 | 0.58958 |
797f86e34cf5e199ca13f39c19b4587968418811 | 5,265 | py | Python | cloud_scanner_azure/services/azure_resource_service.py | Microsoft/cloud-scanner-azure | 34a5e7055dcd3c5881b3840fdc10b91eb56b035e | [
"MIT"
] | 7 | 2019-07-15T13:19:02.000Z | 2021-12-23T14:18:58.000Z | cloud_scanner_azure/services/azure_resource_service.py | Microsoft/cloud-scanner-azure | 34a5e7055dcd3c5881b3840fdc10b91eb56b035e | [
"MIT"
] | null | null | null | cloud_scanner_azure/services/azure_resource_service.py | Microsoft/cloud-scanner-azure | 34a5e7055dcd3c5881b3840fdc10b91eb56b035e | [
"MIT"
] | 4 | 2019-11-03T22:53:52.000Z | 2020-08-05T14:39:03.000Z | from azure.mgmt.resource import ResourceManagementClient
from cloud_scanner.contracts import (
ResourceService, ResourceFilter, register_resource_service
)
from cloud_scanner_azure.config import AzureConfig, AzureResourceServiceConfig
from cloud_scanner_azure.services.azure_resource import AzureResource
class No... | 35.1 | 78 | 0.655461 |
797f88f8526d8530a1c4694020df888cf3252014 | 1,488 | py | Python | tests/basics/class_store_class.py | learnforpractice/micropython-cpp | 004bc8382f74899e7b876cc29bfa6a9cc976ba10 | [
"MIT"
] | 13,648 | 2015-01-01T01:34:51.000Z | 2022-03-31T16:19:53.000Z | tests/basics/class_store_class.py | learnforpractice/micropython-cpp | 004bc8382f74899e7b876cc29bfa6a9cc976ba10 | [
"MIT"
] | 7,092 | 2015-01-01T07:59:11.000Z | 2022-03-31T23:52:18.000Z | tests/basics/class_store_class.py | learnforpractice/micropython-cpp | 004bc8382f74899e7b876cc29bfa6a9cc976ba10 | [
"MIT"
] | 4,942 | 2015-01-02T11:48:50.000Z | 2022-03-31T19:57:10.000Z | # Inspired by urlparse.py from CPython 3.3 stdlib
# There was a bug in MicroPython that under some conditions class stored
# in instance attribute later was returned "bound" as if it was a method,
# which caused class constructor to receive extra argument.
try:
from collections import namedtuple
except ImportError:... | 28.615385 | 73 | 0.747312 |
797f89b0e018abff908a15718fb0064daa2e17ed | 10,644 | py | Python | artificial_neural_networks/architectures/feedforward_neural_networks/convolutional_neural_networks/cnn_dense_mnist.py | kourouklides/artificial_neural_networks | c22f80c092481dda4bb219d981e27295d06222b0 | [
"Apache-2.0"
] | 39 | 2018-08-25T08:04:09.000Z | 2022-02-23T16:35:42.000Z | artificial_neural_networks/architectures/feedforward_neural_networks/convolutional_neural_networks/cnn_dense_mnist.py | kourouklides/bayesian_nn | c22f80c092481dda4bb219d981e27295d06222b0 | [
"Apache-2.0"
] | 4 | 2020-04-12T16:07:41.000Z | 2022-02-10T00:26:37.000Z | artificial_neural_networks/architectures/feedforward_neural_networks/convolutional_neural_networks/cnn_dense_mnist.py | kourouklides/bayesian_nn | c22f80c092481dda4bb219d981e27295d06222b0 | [
"Apache-2.0"
] | 10 | 2018-08-28T07:04:03.000Z | 2022-03-28T10:29:01.000Z | """
Model: Convolutional Neural Network (CNN) with dense (i.e. fully connected) layers
Method: Backpropagation
Architecture: Feedforward Neural Network
Dataset: MNIST
Task: Handwritten Digit Recognition (Multi-class Classification)
Author: Ioannis Kourouklides, www.kourouklides.com
License:
... | 31.305882 | 101 | 0.646561 |
797f8a680c0b12a873cb5a415c7cd6118a28a8a8 | 1,911 | py | Python | firstlanguage_python/models/input_9.py | FirstLanguage/fl-python | 1db77bbf41a78159451abb91e4e0cf3fd519ec54 | [
"MIT"
] | null | null | null | firstlanguage_python/models/input_9.py | FirstLanguage/fl-python | 1db77bbf41a78159451abb91e4e0cf3fd519ec54 | [
"MIT"
] | null | null | null | firstlanguage_python/models/input_9.py | FirstLanguage/fl-python | 1db77bbf41a78159451abb91e4e0cf3fd519ec54 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
firstlanguage_python
This file was automatically generated by APIMATIC v3.0 (
https://www.apimatic.io ).
"""
import os
from firstlanguage_python.utilities.schema_validator_wrapper import SchemaValidatorWrapper
from jsonschema import ValidationError
from firstlanguage_python.api... | 26.178082 | 119 | 0.612768 |
797f8b1147f2101665b42a9b1920de020d17e322 | 6,522 | py | Python | pynn/trainer/adam_seq2seq_v2.py | quanpn90/SpeechGAN | b2aa923ac40474bd7a6fa2acfd290eb2770e0972 | [
"MIT"
] | 13 | 2019-10-31T01:33:04.000Z | 2022-02-18T11:18:27.000Z | pynn/trainer/adam_seq2seq_v2.py | quanpn90/SpeechGAN | b2aa923ac40474bd7a6fa2acfd290eb2770e0972 | [
"MIT"
] | 3 | 2019-11-12T01:42:47.000Z | 2021-05-04T07:46:03.000Z | pynn/trainer/adam_seq2seq_v2.py | quanpn90/SpeechGAN | b2aa923ac40474bd7a6fa2acfd290eb2770e0972 | [
"MIT"
] | 10 | 2019-10-31T06:03:14.000Z | 2022-02-03T11:08:45.000Z | # Copyright 2019 Thai-Son Nguyen
# Licensed under the Apache License, Version 2.0 (the "License")
import time
import math
import os
import copy
import random
import numpy as np
import torch
import torch.nn as nn
import torch.optim as optim
import torch.nn.functional as F
from . import EpochPool, load_last_chkpt, sav... | 33.27551 | 106 | 0.57099 |
797f8b2d5a642e1e5f5c998073f100d028ddbcd3 | 3,097 | py | Python | data/olympics_generator/count_by_year.py | Caleydo/taco_server | be2d4786fbc8ad62ecb5b599572fe09f8c2ea05e | [
"BSD-3-Clause"
] | 2 | 2017-03-30T05:12:54.000Z | 2019-07-11T09:42:06.000Z | data/olympics_generator/count_by_year.py | Caleydo/taco_server | be2d4786fbc8ad62ecb5b599572fe09f8c2ea05e | [
"BSD-3-Clause"
] | 11 | 2016-11-18T17:13:37.000Z | 2021-03-26T11:35:43.000Z | data/olympics_generator/count_by_year.py | Caleydo/taco_server | be2d4786fbc8ad62ecb5b599572fe09f8c2ea05e | [
"BSD-3-Clause"
] | 2 | 2018-01-26T09:56:41.000Z | 2019-10-26T04:41:31.000Z | import csv
import json
created_cvs_list = []
def write_index_json():
with open('../index.json', 'w') as outfile:
json.dump(created_cvs_list, outfile)
def write_csv(year, medal_type, fieldnames, medals_per_country):
if year is None:
print('Invalid year -> file not written')
return
name = 'Olympic... | 30.067961 | 169 | 0.645463 |
797f8b9455a121a1f34782fcf6ec4ce27fbeb9dd | 11,022 | py | Python | ocw/lib/db.py | b10n1k/pcw | 13c33393882e898089daa6ed678e29033c8f07a6 | [
"Apache-2.0"
] | null | null | null | ocw/lib/db.py | b10n1k/pcw | 13c33393882e898089daa6ed678e29033c8f07a6 | [
"Apache-2.0"
] | null | null | null | ocw/lib/db.py | b10n1k/pcw | 13c33393882e898089daa6ed678e29033c8f07a6 | [
"Apache-2.0"
] | null | null | null | from webui.settings import ConfigFile
from ..models import Instance
from ..models import StateChoice
from ..models import ProviderChoice
from django.db import transaction
from django.db.models import F
from django.utils import timezone
import time
import json
import dateutil.parser
from .emailnotify import send_mail, s... | 37.362712 | 119 | 0.641898 |
797f8bdce696f791899b885dcb4bef0273ef82b0 | 2,652 | py | Python | venv/lib/python3.8/site-packages/vsts/notification/v4_0/models/notification_subscription_create_parameters.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/vsts/notification/v4_0/models/notification_subscription_create_parameters.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | null | null | null | venv/lib/python3.8/site-packages/vsts/notification/v4_0/models/notification_subscription_create_parameters.py | amcclead7336/Enterprise_Data_Science_Final | ccdc0aa08d4726bf82d71c11a1cc0c63eb301a28 | [
"Unlicense",
"MIT"
] | 2 | 2021-05-23T16:46:31.000Z | 2021-05-26T23:51:09.000Z | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# -----------------------------------------------------------------... | 63.142857 | 328 | 0.650075 |
797f8bf09d2e3e8419ff8d91d22b0db86b6e50ef | 947 | py | Python | solum-6.0.0/solum/api/controllers/v1/datamodel/execution.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 39 | 2015-09-26T01:30:52.000Z | 2021-05-20T23:37:43.000Z | solum-6.0.0/solum/api/controllers/v1/datamodel/execution.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | solum-6.0.0/solum/api/controllers/v1/datamodel/execution.py | scottwedge/OpenStack-Stein | 7077d1f602031dace92916f14e36b124f474de15 | [
"Apache-2.0"
] | 30 | 2015-10-25T18:06:39.000Z | 2020-01-14T12:14:06.000Z | # Copyright 2014 - Rackspace Hosting.
#
# 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... | 35.074074 | 75 | 0.711721 |
797f8c025dcd518c817d2fdab599f25d71030c5e | 23,256 | py | Python | tests/python/frontend/mxnet/test_forward.py | mostafaelhoushi/tvm | ae21eddf5f13ffa82d514e8311c87f38bcac559a | [
"Apache-2.0"
] | null | null | null | tests/python/frontend/mxnet/test_forward.py | mostafaelhoushi/tvm | ae21eddf5f13ffa82d514e8311c87f38bcac559a | [
"Apache-2.0"
] | null | null | null | tests/python/frontend/mxnet/test_forward.py | mostafaelhoushi/tvm | ae21eddf5f13ffa82d514e8311c87f38bcac559a | [
"Apache-2.0"
] | null | null | null | import numpy as np
import operator
import tvm
from tvm.contrib import graph_runtime
from tvm.relay.testing.config import ctx_list
from tvm import relay
import mxnet as mx
from mxnet import gluon
from mxnet.gluon.model_zoo import vision
import model_zoo
def verify_mxnet_frontend_impl(mx_symbol,
... | 42.593407 | 134 | 0.599458 |
797f8c7406413878333573d089f5d5e56614571a | 648 | py | Python | label_util.py | PeterHedley94/viz_eda | b4a80fc1382ed75bef80b675b9cca1cf86fe2b7f | [
"MIT"
] | 5 | 2020-12-02T12:24:45.000Z | 2021-10-02T18:58:30.000Z | label_util.py | PeterHedley94/viz_eda | b4a80fc1382ed75bef80b675b9cca1cf86fe2b7f | [
"MIT"
] | 7 | 2021-02-01T11:17:32.000Z | 2022-03-12T00:58:30.000Z | label_util.py | Recycleye/viz_eda | b4a80fc1382ed75bef80b675b9cca1cf86fe2b7f | [
"MIT"
] | 3 | 2021-12-17T12:56:09.000Z | 2022-01-27T08:36:57.000Z | from nltk.corpus import wordnet
import ssl
ssl._create_default_https_context = ssl._create_unverified_context
def word_distance(w1: str, w2: str) -> float:
w1 = w1.replace(' ', '_')
w2 = w2.replace(' ', '_')
w1_syns = wordnet.synsets(w1)
w2_syns = wordnet.synsets(w2)
score = 0
try:
s... | 24.923077 | 66 | 0.648148 |
797f8cb7e5bb5854d06fe48ae8f29e56c89406ca | 24,088 | py | Python | python-impl/curve_ops.py | Byeongjee/bls_sigs_ref-fork | ae912b8f701fa93d26886eadef02d5d9c76e99ed | [
"Apache-2.0"
] | 2 | 2020-09-14T20:52:56.000Z | 2021-07-11T14:58:14.000Z | python-impl/curve_ops.py | Byeongjee/bls_sigs_ref-fork | ae912b8f701fa93d26886eadef02d5d9c76e99ed | [
"Apache-2.0"
] | 1 | 2019-10-23T15:06:57.000Z | 2019-10-23T15:06:57.000Z | python-impl/curve_ops.py | Byeongjee/bls_sigs_ref-fork | ae912b8f701fa93d26886eadef02d5d9c76e99ed | [
"Apache-2.0"
] | 1 | 2020-02-10T01:00:33.000Z | 2020-02-10T01:00:33.000Z | #!/usr/bin/python
#
# (C) 2019 Riad S. Wahby <rsw@cs.stanford.edu>
#
# pure Python implementation of curve ops for Ell2 on BLS12-381
import sys
from consts import p, q
from fields import Fq, Fq2
if sys.version_info[0] < 3:
sys.exit("This script requires Python3 or PyPy3")
###
## generators for BLS signatures
##... | 38.851613 | 116 | 0.645799 |
797f8cd8cf49897c22b7ec472fd6150b6548ec35 | 7,333 | py | Python | tests/chainermn_tests/extensions_tests/test_checkpoint.py | zjzh/chainer | e9da1423255c58c37be9733f51b158aa9b39dc93 | [
"MIT"
] | 3,705 | 2017-06-01T07:36:12.000Z | 2022-03-30T10:46:15.000Z | tests/chainermn_tests/extensions_tests/test_checkpoint.py | zjzh/chainer | e9da1423255c58c37be9733f51b158aa9b39dc93 | [
"MIT"
] | 5,998 | 2017-06-01T06:40:17.000Z | 2022-03-08T01:42:44.000Z | tests/chainermn_tests/extensions_tests/test_checkpoint.py | zjzh/chainer | e9da1423255c58c37be9733f51b158aa9b39dc93 | [
"MIT"
] | 1,150 | 2017-06-02T03:39:46.000Z | 2022-03-29T02:29:32.000Z | import os
import tempfile
import unittest
import warnings
import numpy as np
import chainer
from chainer.dataset import convert
import chainer.functions as F
import chainer.links as L
import chainer.testing
from chainer import training
import chainermn
from chainermn.extensions.checkpoint import _CheckpointStats
fro... | 35.086124 | 77 | 0.601391 |
797f8cfe04ad8c80533825faa9385076b821220e | 2,745 | py | Python | Reminderzapchan.py | LulutasoAI/Reminderchan | 3e48c8e73d329390391cc713d1a1b27dfcf7150b | [
"MIT"
] | null | null | null | Reminderzapchan.py | LulutasoAI/Reminderchan | 3e48c8e73d329390391cc713d1a1b27dfcf7150b | [
"MIT"
] | null | null | null | Reminderzapchan.py | LulutasoAI/Reminderchan | 3e48c8e73d329390391cc713d1a1b27dfcf7150b | [
"MIT"
] | null | null | null | from win10toast import ToastNotifier
import time
import schedule
import random
import configparser
toaster = ToastNotifier()
def remind(msg):
config_ini = configparser.ConfigParser()
config_ini.read("config.ini", encoding="utf-8")
iconpath = config_ini["DEFAULT"]["icon_path"]
toaster... | 38.661972 | 137 | 0.571585 |
797f8f92c84b7c3f09db9490fd56a6a61cd96fb0 | 811 | py | Python | Python_Use/day09/meke_dirs.py | ATTO-DT/Python_learn | da731943eadc91f14f174456d9687e2b313e5f21 | [
"Apache-2.0"
] | null | null | null | Python_Use/day09/meke_dirs.py | ATTO-DT/Python_learn | da731943eadc91f14f174456d9687e2b313e5f21 | [
"Apache-2.0"
] | null | null | null | Python_Use/day09/meke_dirs.py | ATTO-DT/Python_learn | da731943eadc91f14f174456d9687e2b313e5f21 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
os模块的相关使用-创建多级目录
author: gxcuizy
date: 2018-10-23
"""
import os
def make_dir(path):
"""逐个创建三级目录"""
path_list = path.split('/')
for path_value in path_list:
# 目录不存在,则创建
exists = os.path.exists(path_value)
if not exists:
... | 20.794872 | 59 | 0.583231 |
797f907ea7b42dbd94a81251f659071724ad449f | 685 | py | Python | gwlfe/MultiUse_Fxns/Runoff/AvCNRur.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | null | null | null | gwlfe/MultiUse_Fxns/Runoff/AvCNRur.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | 6 | 2018-07-24T22:46:28.000Z | 2018-07-29T19:13:09.000Z | gwlfe/MultiUse_Fxns/Runoff/AvCNRur.py | mudkipmaster/gwlf-e | 9e058445537dd32d1916f76c4b73ca64261771cd | [
"Apache-2.0"
] | 1 | 2018-07-24T18:22:01.000Z | 2018-07-24T18:22:01.000Z | from numpy import sum
from gwlfe.Input.LandUse.RurAreaTotal import RurAreaTotal
from gwlfe.Input.LandUse.RurAreaTotal import RurAreaTotal_f
from gwlfe.Memoization import memoize
@memoize
def AvCNRur(NRur, Area, CN):
result = 0
rurareatotal = RurAreaTotal(NRur, Area)
# Get the area weighted average CN for... | 27.4 | 77 | 0.69781 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.