hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 209 | max_forks_repo_name stringlengths 5 121 | max_forks_repo_head_hexsha stringlengths 40 40 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0d26c0d88b76cd2a5fc195797cedcbaa0026ed13 | 16,171 | py | Python | reports/models.py | nprapps/carebot | fc9b87869137144c11ef021e9889b3d55c837ae3 | [
"FSFAP"
] | 16 | 2015-06-26T13:07:04.000Z | 2016-06-09T08:01:25.000Z | reports/models.py | nprapps/carebot | fc9b87869137144c11ef021e9889b3d55c837ae3 | [
"FSFAP"
] | 56 | 2015-01-02T06:05:09.000Z | 2015-07-08T19:16:15.000Z | reports/models.py | nprapps/carebot | fc9b87869137144c11ef021e9889b3d55c837ae3 | [
"FSFAP"
] | 4 | 2016-02-11T18:46:12.000Z | 2021-02-23T11:06:50.000Z | #!/usr/bin/env python
from collections import OrderedDict
from copy import copy
from datetime import date, datetime, timedelta
from itertools import izip
import json
import subprocess
from clan import utils as clan_utils
from django.core.urlresolvers import reverse
from django.db import models
from django.dispatch im... | 30.396617 | 124 | 0.615917 |
d8646e96253976a9d96d8570eedb6e41a72b19a3 | 6,028 | py | Python | nltk/corpus/reader/lin.py | SamuraiT/nltk3-alpha | 18a1a0ff8697eaeeb5d3c0bc6dad251d5b8fe931 | [
"Apache-2.0"
] | 3 | 2019-04-09T22:59:33.000Z | 2019-06-14T09:23:24.000Z | nltk/corpus/reader/lin.py | guker/nltk | 085399ea9d53318ae6e8568909fa55f0d905ad5a | [
"Apache-2.0"
] | null | null | null | nltk/corpus/reader/lin.py | guker/nltk | 085399ea9d53318ae6e8568909fa55f0d905ad5a | [
"Apache-2.0"
] | 2 | 2019-10-28T01:33:22.000Z | 2019-10-30T06:43:43.000Z | # Natural Language Toolkit: Lin's Thesaurus
#
# Copyright (C) 2001-2014 NLTK Project
# Author: Dan Blanchard <dblanchard@ets.org>
# URL: <http://nltk.org/>
# For license information, see LICENSE.txt
from __future__ import print_function
import re
from collections import defaultdict
from functools import reduce
from n... | 38.394904 | 127 | 0.591573 |
2e1b51b158c7df234a4e37a7cf709a8e017b6979 | 1,206 | py | Python | hall_of_fame/10_46_59/parameters.py | Magssch/IT3105-mcts-hex | 10e6c1e4a61561a0ddcb241e2dba4ac000fe4d8e | [
"MIT"
] | null | null | null | hall_of_fame/10_46_59/parameters.py | Magssch/IT3105-mcts-hex | 10e6c1e4a61561a0ddcb241e2dba4ac000fe4d8e | [
"MIT"
] | null | null | null | hall_of_fame/10_46_59/parameters.py | Magssch/IT3105-mcts-hex | 10e6c1e4a61561a0ddcb241e2dba4ac000fe4d8e | [
"MIT"
] | 1 | 2022-03-28T11:14:07.000Z | 2022-03-28T11:14:07.000Z | from keras.activations import linear, relu, sigmoid, tanh # noqa
from keras.losses import kl_divergence # noqa
from keras.optimizers import SGD, Adagrad, Adam, RMSprop # noqa
from game import Game
VISUALIZE_GAMES = False
FRAME_DELAY = 0.5
RUN_TRAINING = True
# RL parameters
EPISODES = 300
REPLAY_BUFFER_SIZE = 102... | 30.923077 | 117 | 0.710614 |
0f117053ccca04c3ec1b573ec7dd249295df4964 | 1,967 | py | Python | analyzers/unique_ssh_grandparent/main.py | insanitybit/grapl-analyzers | 9c49d784539ff7a2dd1381442fbd83141e92b632 | [
"Apache-2.0"
] | 8 | 2019-11-15T01:09:05.000Z | 2020-04-21T19:41:13.000Z | analyzers/unique_ssh_grandparent/main.py | grapl-security/grapl-analyzers | 9c49d784539ff7a2dd1381442fbd83141e92b632 | [
"Apache-2.0"
] | null | null | null | analyzers/unique_ssh_grandparent/main.py | grapl-security/grapl-analyzers | 9c49d784539ff7a2dd1381442fbd83141e92b632 | [
"Apache-2.0"
] | 2 | 2020-01-31T03:20:33.000Z | 2020-03-28T23:22:00.000Z | import os
import redis
from grapl_analyzerlib.analyzer import Analyzer, OneOrMany, A
from grapl_analyzerlib.counters import GrandParentGrandChildCounter
from grapl_analyzerlib.prelude import ProcessQuery, ProcessView
from grapl_analyzerlib.execution import ExecutionHit
COUNTCACHE_ADDR = os.environ['COUNTCACHE_ADDR']
... | 32.245902 | 93 | 0.651246 |
f190f7d803401df29522a9445176036ec74af38e | 1,528 | py | Python | aliyun-python-sdk-emr/aliyunsdkemr/request/v20160408/DescribeETLJobStageOutputSchemaRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-emr/aliyunsdkemr/request/v20160408/DescribeETLJobStageOutputSchemaRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | null | null | null | aliyun-python-sdk-emr/aliyunsdkemr/request/v20160408/DescribeETLJobStageOutputSchemaRequest.py | sdk-team/aliyun-openapi-python-sdk | 384730d707e6720d1676ccb8f552e6a7b330ec86 | [
"Apache-2.0"
] | null | null | null | # 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 u... | 36.380952 | 84 | 0.772906 |
513961b9a7528a7d0e5007319786882fea5ca950 | 143 | py | Python | py/cidoc_crm_types/properties/p69i_is_associated_with.py | minorg/cidoc-crm-types | 9018bdbf0658e4d28a87bc94543e467be45d8aa5 | [
"Apache-2.0"
] | null | null | null | py/cidoc_crm_types/properties/p69i_is_associated_with.py | minorg/cidoc-crm-types | 9018bdbf0658e4d28a87bc94543e467be45d8aa5 | [
"Apache-2.0"
] | null | null | null | py/cidoc_crm_types/properties/p69i_is_associated_with.py | minorg/cidoc-crm-types | 9018bdbf0658e4d28a87bc94543e467be45d8aa5 | [
"Apache-2.0"
] | null | null | null | from dataclasses import dataclass
@dataclass
class P69iIsAssociatedWith:
URI = "http://erlangen-crm.org/current/P69i_is_associated_with"
| 20.428571 | 67 | 0.804196 |
85ab5e0c7a8bf87e7dd0bfdef3367e6d0d62ff3e | 2,195 | py | Python | Python/StandardLibrary/spec.py | jessicaleete/numerical_computing | cc71f51f35ca74d00e617af3d1a0223e19fb9a68 | [
"CC-BY-3.0"
] | null | null | null | Python/StandardLibrary/spec.py | jessicaleete/numerical_computing | cc71f51f35ca74d00e617af3d1a0223e19fb9a68 | [
"CC-BY-3.0"
] | null | null | null | Python/StandardLibrary/spec.py | jessicaleete/numerical_computing | cc71f51f35ca74d00e617af3d1a0223e19fb9a68 | [
"CC-BY-3.0"
] | null | null | null | # name this file 'solutions.py'
"""Volume II Lab 1: The Standard Library
<Name>
<Class>
<Date>
"""
# Add import statements here.
# In future labs, do not modify any PROVIDED import statements.
# You may always add others as needed.
# Problem 1: Implement this function.
def prob1(l):
"""Accept a list 'l' of numbe... | 32.761194 | 80 | 0.676082 |
12d768b796469fc421af99677be7547aea2caf01 | 154 | py | Python | python_docs/05Functions/05FunctionsAsArguments.py | Matheus-IT/lang-python-related | dd2e5d9b9f16d3838ba1670fdfcba1fa3fe305e9 | [
"MIT"
] | null | null | null | python_docs/05Functions/05FunctionsAsArguments.py | Matheus-IT/lang-python-related | dd2e5d9b9f16d3838ba1670fdfcba1fa3fe305e9 | [
"MIT"
] | null | null | null | python_docs/05Functions/05FunctionsAsArguments.py | Matheus-IT/lang-python-related | dd2e5d9b9f16d3838ba1670fdfcba1fa3fe305e9 | [
"MIT"
] | null | null | null | def add(x, y):
return x + y
def times(func, x, y):
return func(x, y)
a = 2
b = 4
r = times(add, a, b)
print(' - Resultado = ', r)
| 11.846154 | 28 | 0.467532 |
c4dae4dda319795d45d68582a332ccf50d882145 | 1,586 | py | Python | sport24/sport24/urls.py | sebix354/Portal-Sportowy | 96c63e7e34e1770b071f3f99301aa0624852a091 | [
"MIT"
] | null | null | null | sport24/sport24/urls.py | sebix354/Portal-Sportowy | 96c63e7e34e1770b071f3f99301aa0624852a091 | [
"MIT"
] | null | null | null | sport24/sport24/urls.py | sebix354/Portal-Sportowy | 96c63e7e34e1770b071f3f99301aa0624852a091 | [
"MIT"
] | null | null | null | """sport24 URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-based... | 40.666667 | 82 | 0.735183 |
1fe36a661aa5e5840b4daddeb910af8a03f4fa60 | 6,602 | py | Python | scripts/bacnet/proxy_grab_bacnet_config.py | gnmerritt/volttron | ebfbf62bab77d46fd3e8d6aaca1fc4f33932ccf3 | [
"Apache-2.0"
] | 1 | 2020-05-26T01:29:50.000Z | 2020-05-26T01:29:50.000Z | scripts/bacnet/proxy_grab_bacnet_config.py | gnmerritt/volttron | ebfbf62bab77d46fd3e8d6aaca1fc4f33932ccf3 | [
"Apache-2.0"
] | null | null | null | scripts/bacnet/proxy_grab_bacnet_config.py | gnmerritt/volttron | ebfbf62bab77d46fd3e8d6aaca1fc4f33932ccf3 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*- {{{
# vim: set fenc=utf-8 ft=python sw=4 ts=4 sts=4 et:
#
# Copyright 2019, Battelle Memorial Institute.
#
# 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... | 37.511364 | 116 | 0.654802 |
415904a6809529391400d50eb640bd3caf9659e1 | 1,095 | py | Python | layered.py | ground0state/ConvLSTM_PyTorch | 5465aabe8f3192d022201b9e17a3f43071a823bd | [
"MIT"
] | 1 | 2021-12-11T15:27:41.000Z | 2021-12-11T15:27:41.000Z | layered.py | TripleEss/ConvLSTM_PyTorch | 5465aabe8f3192d022201b9e17a3f43071a823bd | [
"MIT"
] | null | null | null | layered.py | TripleEss/ConvLSTM_PyTorch | 5465aabe8f3192d022201b9e17a3f43071a823bd | [
"MIT"
] | 1 | 2021-12-10T22:33:49.000Z | 2021-12-10T22:33:49.000Z | import torch
import torch.nn as nn
from conv_lstm import ConvLSTM
class ConvLSTMLayered(nn.Module):
def __init__(self, image_size):
"""Multi layeres ConvLSTM.
Parameters
----------
image_size: (int, int)
Shape of image.
"""
super().__init__()
... | 28.815789 | 95 | 0.589954 |
2973f78237c9edbc6ef569091af209c60cb7eb59 | 1,138 | py | Python | main-figures/OH-comparison.py | tommibergman/gmdd-tm5-soa | 20168c86caeb14aed72af72b14c3b8185700ddd8 | [
"MIT"
] | null | null | null | main-figures/OH-comparison.py | tommibergman/gmdd-tm5-soa | 20168c86caeb14aed72af72b14c3b8185700ddd8 | [
"MIT"
] | null | null | null | main-figures/OH-comparison.py | tommibergman/gmdd-tm5-soa | 20168c86caeb14aed72af72b14c3b8185700ddd8 | [
"MIT"
] | null | null | null | from scipy.special import erf
from settings import *
import matplotlib.pyplot as plt
import datetime
import glob
import netCDF4 as nc
import re
from mpl_toolkits.basemap import Basemap
from general_toolbox import get_gridboxarea,lonlat,write_netcdf_file,NMB
import os
from scipy.stats import pearsonr
import numpy as np... | 33.470588 | 105 | 0.723199 |
d18dab35222ecb6564a408891eb6ad7fe46a6f01 | 14,408 | py | Python | tests/test_scvi.py | adamgayoso/scVI | e79fccbfdc9dc9c4d790a8fb686f21b2b2889c50 | [
"MIT"
] | null | null | null | tests/test_scvi.py | adamgayoso/scVI | e79fccbfdc9dc9c4d790a8fb686f21b2b2889c50 | [
"MIT"
] | null | null | null | tests/test_scvi.py | adamgayoso/scVI | e79fccbfdc9dc9c4d790a8fb686f21b2b2889c50 | [
"MIT"
] | null | null | null | import numpy as np
from scvi.dataset import CortexDataset, SyntheticDataset, GeneExpressionDataset
from scvi.inference import (
JointSemiSupervisedTrainer,
AlternateSemiSupervisedTrainer,
ClassifierTrainer,
UnsupervisedTrainer,
AdapterTrainer,
TotalTrainer,
)
from scvi.inference.posterior impor... | 34.718072 | 88 | 0.71731 |
b5569a8efddf40e28a45fbdd20707b80e06c956e | 3,474 | py | Python | knapsack_benchmark/knapsack.py | vladium/study_julia_with_me | 8c7a0b614098091ef284ebee1250c69f222fa126 | [
"MIT"
] | 2 | 2019-10-16T00:46:15.000Z | 2021-07-02T17:08:46.000Z | knapsack_benchmark/knapsack.py | vladium/study_julia_with_me | 8c7a0b614098091ef284ebee1250c69f222fa126 | [
"MIT"
] | null | null | null | knapsack_benchmark/knapsack.py | vladium/study_julia_with_me | 8c7a0b614098091ef284ebee1250c69f222fa126 | [
"MIT"
] | null | null | null |
import sys
if sys.hexversion < 0x3000000: raise RuntimeError("expecting python v3+ instead of %x" % sys.hexversion)
import array
import numpy as np
import time
# ----------------------------------------------------------------------------
'''
this is an almost one-for-one translation of the Julia version, see kn... | 27.792 | 104 | 0.451641 |
3fe24f969858f73982f24586d89154e611426fe5 | 6,793 | py | Python | train/login/Login.py | 1131041715/12306lmqc | e2049fd5393bacb08401737fa314ef5e7ab962e6 | [
"MIT"
] | 1 | 2020-10-22T03:36:46.000Z | 2020-10-22T03:36:46.000Z | train/login/Login.py | Any1131041715/12306lmqc | e2049fd5393bacb08401737fa314ef5e7ab962e6 | [
"MIT"
] | 5 | 2021-03-31T19:41:44.000Z | 2021-12-13T20:39:28.000Z | train/login/Login.py | 1131041715/12306lmqc | e2049fd5393bacb08401737fa314ef5e7ab962e6 | [
"MIT"
] | null | null | null | import sys
sys.path.append("./")
import copy
import json
import time
from collections import OrderedDict
import requests
from conf.urls_conf import loginUrls
from conf.constant import CAPTCHA_CHECK_METHOD_HAND, CAPTCHA_CHECK_METHOD_THREE
from train.login.Capthca import Captcha
from utils import Utils
from utils.Log... | 34.658163 | 115 | 0.624466 |
41bc793e2e4ff657f9ad1b30cb9a832a5a1e23f3 | 74 | py | Python | sparts/gen/sparts_examples/__init__.py | facebook/sparts | c03df928677444ad638d10fa96f4144ca4d644e1 | [
"BSD-3-Clause"
] | 220 | 2015-01-04T07:17:31.000Z | 2018-10-10T09:06:45.000Z | sparts/gen/sparts_examples/__init__.py | martina6hall/sparts | c03df928677444ad638d10fa96f4144ca4d644e1 | [
"BSD-3-Clause"
] | 49 | 2015-02-02T22:25:08.000Z | 2017-07-26T05:46:10.000Z | sparts/gen/sparts_examples/__init__.py | martina6hall/sparts | c03df928677444ad638d10fa96f4144ca4d644e1 | [
"BSD-3-Clause"
] | 39 | 2015-03-11T03:12:41.000Z | 2018-10-10T09:07:11.000Z | __all__ = ['ttypes', 'constants', 'SpartsFooService', 'SpartsBarService']
| 37 | 73 | 0.72973 |
5767c1e00965127197d5a4f539824ca26d261e64 | 260 | py | Python | Python/projecteuler/10.py | caa06d9c/Python-examples | 9d90b9a9adfc343f9fdfab814cfc2b05219d6920 | [
"MIT"
] | 5 | 2019-10-28T09:56:26.000Z | 2021-09-03T04:51:18.000Z | Python/projecteuler/10.py | caa06d9c/Python-examples | 9d90b9a9adfc343f9fdfab814cfc2b05219d6920 | [
"MIT"
] | null | null | null | Python/projecteuler/10.py | caa06d9c/Python-examples | 9d90b9a9adfc343f9fdfab814cfc2b05219d6920 | [
"MIT"
] | 4 | 2019-10-28T09:56:30.000Z | 2021-09-03T04:51:23.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# https://projecteuler.info/problem=10
# 142913828922
from lib import get_primes
if __name__ == '__main__':
primes = get_primes(2000000)
res = 0
for el in primes:
res += el
print(res)
| 15.294118 | 38 | 0.623077 |
a12efed5a2649f29868abdcbe0ce89ffea8ef4ac | 1,395 | py | Python | setup.py | sikattin/py_mysql_backup | 6324d3e467d2265c6cba6c1fdc54f2d15cf3a687 | [
"BSD-2-Clause"
] | null | null | null | setup.py | sikattin/py_mysql_backup | 6324d3e467d2265c6cba6c1fdc54f2d15cf3a687 | [
"BSD-2-Clause"
] | null | null | null | setup.py | sikattin/py_mysql_backup | 6324d3e467d2265c6cba6c1fdc54f2d15cf3a687 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
import os
requirement = ['py_mysql',
'datetime_skt',
'osfile',
'mylogger',
'iomod',
'connection',
'datatransfer',
's3_transfer']
description = 'M... | 30.326087 | 94 | 0.565591 |
eef8f2a82605f04b477a726305e09e5a74007b53 | 4,016 | py | Python | tests/test_units.py | florczakraf/pytest-logger | c69c1f8252493661a5f89867a8b35eb6e3b20bb1 | [
"MIT"
] | null | null | null | tests/test_units.py | florczakraf/pytest-logger | c69c1f8252493661a5f89867a8b35eb6e3b20bb1 | [
"MIT"
] | null | null | null | tests/test_units.py | florczakraf/pytest-logger | c69c1f8252493661a5f89867a8b35eb6e3b20bb1 | [
"MIT"
] | null | null | null | import logging
import argparse
import pytest
import pytest_logger.plugin as plugin
def test_sanitize_nodeid():
assert plugin._sanitize_nodeid('test_p.py::test_echo') == 'test_p.py/test_echo'
assert plugin._sanitize_nodeid('classtests/test_y.py::TestClass::()::test_class') == \
'classtests/test_y.py/Te... | 40.565657 | 109 | 0.673556 |
3a5ff9f188951e25bf56486884a1d2d73d8684df | 37,257 | py | Python | .history/src/_fighter_20190422092829.py | vidalmatheus/MK-Project | 6646020c59367ba0424d73a5861e13bbc0daac1f | [
"MIT"
] | 1 | 2019-12-25T10:25:30.000Z | 2019-12-25T10:25:30.000Z | .history/src/_fighter_20190422092829.py | vidalmatheus/MK-Project | 6646020c59367ba0424d73a5861e13bbc0daac1f | [
"MIT"
] | 1 | 2019-12-25T10:27:15.000Z | 2019-12-25T10:27:15.000Z | .history/src/_fighter_20190422092829.py | vidalmatheus/MK-Project | 6646020c59367ba0424d73a5861e13bbc0daac1f | [
"MIT"
] | 1 | 2019-12-25T10:50:05.000Z | 2019-12-25T10:50:05.000Z |
from pygame_functions import *
import fightScene
import engine
import menu
class Fighter:
fighterNames = ["Sub-Zero", "Scorpion"]
fightMoves = [["w", "s", "a", "d"], ["up", "down", "left", "right"]]
combatMoves = [["j","n","k","m","l","u","f"],["1","4","2","5","3","0","6"]]
danceLimit = 7
walkLi... | 46.923174 | 197 | 0.513461 |
8bd9055b193ece6499cc3b6dd2810792a2afb781 | 42,621 | py | Python | grr/worker/worker_test.py | nickamon/grr | ad1936c74728de00db90f6fafa47892b54cfc92d | [
"Apache-2.0"
] | null | null | null | grr/worker/worker_test.py | nickamon/grr | ad1936c74728de00db90f6fafa47892b54cfc92d | [
"Apache-2.0"
] | 1 | 2018-05-08T21:15:51.000Z | 2018-05-08T21:15:51.000Z | grr/worker/worker_test.py | nickamon/grr | ad1936c74728de00db90f6fafa47892b54cfc92d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""Tests for the worker."""
import threading
import time
import mock
from grr import config
from grr.lib import flags
from grr.lib import queues
from grr.lib import rdfvalue
from grr.lib import utils
from grr.lib.rdfvalues import client as rdf_client
from grr.lib.rdfvalues import flows as rdf_f... | 37.952805 | 80 | 0.711762 |
b056e659b103013658d1ef0ca4f62337b523b920 | 84,754 | py | Python | AC_tools/obsolete/plotting_REDUNDANT.py | LukeFakes/AC_tools | 31eb4786f1266d4b932eef238b249044e2e5d419 | [
"MIT"
] | null | null | null | AC_tools/obsolete/plotting_REDUNDANT.py | LukeFakes/AC_tools | 31eb4786f1266d4b932eef238b249044e2e5d419 | [
"MIT"
] | null | null | null | AC_tools/obsolete/plotting_REDUNDANT.py | LukeFakes/AC_tools | 31eb4786f1266d4b932eef238b249044e2e5d419 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Redundant plotting functions to be removed from AC_tools
Notes
-------
- These functions are a mixture fo those made redundant by shift from matplotlib's basemap to cartopy and those that are now longer in use/years old/not useful/not pythonic
"""
import sys
# - Require... | 37.584922 | 173 | 0.538759 |
c1f044e55f4aea100484fb50028a17cd82ff80e2 | 4,720 | py | Python | lib/config/default.py | jie311/YOLOP | 75a281c86f6f24a82f15c4aa6a8c27219e924848 | [
"MIT"
] | 811 | 2021-08-25T07:38:30.000Z | 2022-03-31T10:30:26.000Z | lib/config/default.py | jie311/YOLOP | 75a281c86f6f24a82f15c4aa6a8c27219e924848 | [
"MIT"
] | 99 | 2021-08-28T05:57:12.000Z | 2022-03-31T09:27:06.000Z | lib/config/default.py | jie311/YOLOP | 75a281c86f6f24a82f15c4aa6a8c27219e924848 | [
"MIT"
] | 189 | 2021-08-28T01:15:44.000Z | 2022-03-30T17:40:13.000Z | import os
from yacs.config import CfgNode as CN
_C = CN()
_C.LOG_DIR = 'runs/'
_C.GPUS = (0,1)
_C.WORKERS = 8
_C.PIN_MEMORY = False
_C.PRINT_FREQ = 20
_C.AUTO_RESUME =False # Resume from the last training interrupt
_C.NEED_AUTOANCHOR = False # Re-select the prior anchor(k-means) When training from... | 29.873418 | 129 | 0.70678 |
d78d57336c4aee2ab077bfa01971cb295374c891 | 6,986 | py | Python | backend/db.py | VrtanoskiAndrej/quack-hacks2020 | 235e402e8c43d8f04e0b3b116c6b0e924c843f69 | [
"Apache-2.0"
] | null | null | null | backend/db.py | VrtanoskiAndrej/quack-hacks2020 | 235e402e8c43d8f04e0b3b116c6b0e924c843f69 | [
"Apache-2.0"
] | null | null | null | backend/db.py | VrtanoskiAndrej/quack-hacks2020 | 235e402e8c43d8f04e0b3b116c6b0e924c843f69 | [
"Apache-2.0"
] | null | null | null | from flask import Flask, abort, jsonify, request
from flask_sqlalchemy import SQLAlchemy
import numpy as np
app = Flask(__name__)
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:///users.db'
app.config["SQLALCHEMY_TRACK_MODIFICATIONS"] = False
db = SQLAlchemy(app)
courses = db.Table(
'courses',
db.Column('co... | 33.912621 | 160 | 0.667764 |
798ad9f2710dcb47a192414e8ff15e3afeff3f2f | 811 | py | Python | haminfo/db/alembic_helpers.py | hemna/haminfo | 86db93536075999afa086fda84f10c1911af0375 | [
"Apache-2.0"
] | null | null | null | haminfo/db/alembic_helpers.py | hemna/haminfo | 86db93536075999afa086fda84f10c1911af0375 | [
"Apache-2.0"
] | null | null | null | haminfo/db/alembic_helpers.py | hemna/haminfo | 86db93536075999afa086fda84f10c1911af0375 | [
"Apache-2.0"
] | null | null | null | from alembic import op
from sqlalchemy import engine_from_config
from sqlalchemy.engine import reflection
def table_does_not_exist(table, schema=None):
config = op.get_context().config
engine = engine_from_config(
config.get_section(config.config_ini_section), prefix='sqlalchemy.')
insp = reflecti... | 32.44 | 76 | 0.72873 |
a7cc9908ff406b9b31fb55c690cc626ef19d69b5 | 32,283 | py | Python | test/functional/fundrawtransaction.py | peraktechnology/perakcoin | 502fb07b9d11ff1528577c7d2afe0943f5f20be0 | [
"MIT"
] | 3 | 2018-09-27T04:01:02.000Z | 2021-04-20T07:51:37.000Z | test/functional/fundrawtransaction.py | peraktechnology/perakcoin | 502fb07b9d11ff1528577c7d2afe0943f5f20be0 | [
"MIT"
] | null | null | null | test/functional/fundrawtransaction.py | peraktechnology/perakcoin | 502fb07b9d11ff1528577c7d2afe0943f5f20be0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the fundrawtransaction RPC."""
from test_framework.test_framework import BitcoinTestFramework, BI... | 44.528276 | 223 | 0.570424 |
f6a8ae663e3df289f236496e09e3ee18acf8a078 | 6,758 | py | Python | terra_notebook_utils/workflows.py | mitchac/terra-notebook-utils | 4d3bd83f589b2219d028ce2b16027dd8da1b8749 | [
"MIT"
] | null | null | null | terra_notebook_utils/workflows.py | mitchac/terra-notebook-utils | 4d3bd83f589b2219d028ce2b16027dd8da1b8749 | [
"MIT"
] | null | null | null | terra_notebook_utils/workflows.py | mitchac/terra-notebook-utils | 4d3bd83f589b2219d028ce2b16027dd8da1b8749 | [
"MIT"
] | null | null | null | """
Workflow information
"""
import json
import logging
from datetime import datetime
from functools import lru_cache
from typing import Dict, Generator, Optional, Tuple
from firecloud import fiss
from terra_notebook_utils import WORKSPACE_NAME, WORKSPACE_GOOGLE_PROJECT, costs
from terra_notebook_utils.utils import c... | 49.691176 | 164 | 0.627701 |
ca0a5f94547bcf5fdce72fa4c967c2175b862d8c | 2,898 | py | Python | tests/test_repeat_plugin.py | jeroen-dhollander/python-paginator | 8c60ae6dd64a7440feda4561440117d9bebc3ae7 | [
"CC0-1.0"
] | 3 | 2018-09-26T20:07:51.000Z | 2021-07-10T11:59:44.000Z | tests/test_repeat_plugin.py | jeroen-dhollander/python-paginator | 8c60ae6dd64a7440feda4561440117d9bebc3ae7 | [
"CC0-1.0"
] | 1 | 2020-02-19T10:15:38.000Z | 2020-03-14T21:48:55.000Z | tests/test_repeat_plugin.py | jeroen-dhollander/python-more-or-less | 8c60ae6dd64a7440feda4561440117d9bebc3ae7 | [
"CC0-1.0"
] | null | null | null | from more_or_less import more_plugins
from more_or_less.input import Input
from more_or_less.more_plugin import MorePlugin
from more_or_less.output import Output
from more_or_less.page import Page
from more_or_less.search_plugin import SearchPage
from tests.test_more_page_builder import TestUtil
from unittest.mock impo... | 28.98 | 75 | 0.676329 |
33ab4f42fe0fc6aab55c05e4e991f56fbbc9753c | 3,574 | py | Python | JavaExtractor/extract.py | jjhenkel/code2seq | dd80fff02aa8cd9d05f6781a8309f8397e69f669 | [
"MIT"
] | null | null | null | JavaExtractor/extract.py | jjhenkel/code2seq | dd80fff02aa8cd9d05f6781a8309f8397e69f669 | [
"MIT"
] | null | null | null | JavaExtractor/extract.py | jjhenkel/code2seq | dd80fff02aa8cd9d05f6781a8309f8397e69f669 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import itertools
import multiprocessing
import os
import shutil
import subprocess
import sys
from argparse import ArgumentParser
from threading import Timer
def get_immediate_subdirectories(a_dir):
return [(os.path.join(a_dir, name)) for name in os.listdir(a_dir)
if os.path.isdir(os... | 36.469388 | 118 | 0.62563 |
d0a4ad5c765853b97ec6d3f2739414919a4f3aa7 | 5,819 | py | Python | bayes_opt/bayesian_optimization.py | heartfelt-tech/BayesianOptimization | fb94a0239090e4d8de34c04d445b151ed9cb5dd4 | [
"MIT"
] | null | null | null | bayes_opt/bayesian_optimization.py | heartfelt-tech/BayesianOptimization | fb94a0239090e4d8de34c04d445b151ed9cb5dd4 | [
"MIT"
] | null | null | null | bayes_opt/bayesian_optimization.py | heartfelt-tech/BayesianOptimization | fb94a0239090e4d8de34c04d445b151ed9cb5dd4 | [
"MIT"
] | null | null | null | import warnings
import numpy as np
from .target_space import TargetSpace
from .event import Events, DEFAULT_EVENTS
from .logger import _get_default_logger
from .util import UtilityFunction, acq_max, ensure_rng
from sklearn.gaussian_process.kernels import Matern
from sklearn.gaussian_process import GaussianProcessRegr... | 30.307292 | 79 | 0.616085 |
fc2de1737f3c4598d0df7a96e2a609a95442911f | 10,078 | py | Python | other_experiments/spatial_sne_all_with_skip_connections(Copy over effect)/few_shot_segmentor_sne_position_all_type_spatial_skipconn_conditioner_baseline.py | a-parida12/few-shot-segmentation | 0f678845cec598e635b41ec6d8c2db1585c6ea55 | [
"MIT"
] | 1 | 2021-12-29T07:30:21.000Z | 2021-12-29T07:30:21.000Z | other_experiments/spatial_sne_all_with_skip_connections(Copy over effect)/few_shot_segmentor_sne_position_all_type_spatial_skipconn_conditioner_baseline.py | a-parida12/few-shot-segmentation | 0f678845cec598e635b41ec6d8c2db1585c6ea55 | [
"MIT"
] | null | null | null | other_experiments/spatial_sne_all_with_skip_connections(Copy over effect)/few_shot_segmentor_sne_position_all_type_spatial_skipconn_conditioner_baseline.py | a-parida12/few-shot-segmentation | 0f678845cec598e635b41ec6d8c2db1585c6ea55 | [
"MIT"
] | null | null | null | """Few-Shot_learning Segmentation"""
import numpy as np
import torch
import torch.nn as nn
from nn_common_modules import modules as sm
from data_utils import split_batch
# import torch.nn.functional as F
from squeeze_and_excitation import squeeze_and_excitation as se
class SDnetConditioner(nn.Module):
"""
A ... | 37.604478 | 119 | 0.552788 |
c9bd9725db7eb31d548677647e4e1f137c6cfdfe | 6,031 | py | Python | venv/Lib/site-packages/pygments/style.py | star10919/drf | 77c005794087484d72ffc0d76612a6ac9845821e | [
"BSD-3-Clause"
] | 9 | 2019-05-29T23:50:28.000Z | 2021-01-29T20:51:05.000Z | venv/Lib/site-packages/pygments/style.py | star10919/drf | 77c005794087484d72ffc0d76612a6ac9845821e | [
"BSD-3-Clause"
] | 5 | 2021-02-27T21:31:47.000Z | 2021-04-05T21:49:38.000Z | marlinkpy/venv/Lib/site-packages/pygments/style.py | amilinovic/Test | 4cfdc12a0efeebd636c4982ef90dad65a63b842b | [
"MIT"
] | 3 | 2020-05-25T02:38:08.000Z | 2021-01-20T06:23:06.000Z | # -*- coding: utf-8 -*-
"""
pygments.style
~~~~~~~~~~~~~~
Basic style object.
:copyright: Copyright 2006-2021 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.token import Token, STANDARD_TYPES
# Default mapping of ansixxx to RGB colors.
_ansimap = {
... | 31.248705 | 70 | 0.502902 |
715ce7b6160505789022f038fc0e9bb813ab5218 | 1,434 | py | Python | test/test_pacman.py | yuan-feng/pygmsh | 74671ed9f1dbf1762397504aae33fa27fdebe9e7 | [
"MIT"
] | 1 | 2022-03-13T04:39:03.000Z | 2022-03-13T04:39:03.000Z | test/test_pacman.py | kurtsansom/pygmsh | 9c2cfe1c6c7f80943f61f3e695a453e343544619 | [
"MIT"
] | null | null | null | test/test_pacman.py | kurtsansom/pygmsh | 9c2cfe1c6c7f80943f61f3e695a453e343544619 | [
"MIT"
] | null | null | null | from numpy import cos, pi, sin
import pygmsh
from helpers import compute_volume
def test(lcar=0.3):
geom = pygmsh.built_in.Geometry()
r = 1.25 * 3.4
p1 = geom.add_point([0.0, 0.0, 0.0], lcar)
# p2 = geom.add_point([+r, 0.0, 0.0], lcar)
p3 = geom.add_point([-r, 0.0, 0.0], lcar)
p4 = geom.add_... | 28.68 | 78 | 0.605997 |
83f2b2b7d475e946942413ccf5da8dad416f868e | 4,969 | py | Python | cnn_architectures/mixup/resnet_cifar/eval_model_c100_leila.py | leilayasmeen/MSc_Thesis | ee5e1782ab4a1d86c5dc0f5dc4111b4432ae204d | [
"MIT"
] | 2 | 2019-10-29T03:26:20.000Z | 2021-03-07T10:02:39.000Z | cnn_architectures/mixup/resnet_cifar/eval_model_c100_leila.py | leilayasmeen/MSc_Thesis | ee5e1782ab4a1d86c5dc0f5dc4111b4432ae204d | [
"MIT"
] | null | null | null | cnn_architectures/mixup/resnet_cifar/eval_model_c100_leila.py | leilayasmeen/MSc_Thesis | ee5e1782ab4a1d86c5dc0f5dc4111b4432ae204d | [
"MIT"
] | null | null | null | # Load in model weights and evaluate its goodness (ECE, MCE, error) also saves logits.
# ResNet model from https://github.com/BIGBALLON/cifar-10-cnn/blob/master/4_Residual_Network/ResNet_keras.py
import keras
import numpy as np
from keras.datasets import cifar10, cifar100
from keras.preprocessing.image import ImageDat... | 37.08209 | 132 | 0.638559 |
ccdce40462ccc1ff361031bf2de2f1263dbc3916 | 322 | py | Python | setup.py | garrett-m-smith/sosp_simple | 15b9f7db089009566f7b571c7a4cf8d56ad7ce97 | [
"MIT"
] | null | null | null | setup.py | garrett-m-smith/sosp_simple | 15b9f7db089009566f7b571c7a4cf8d56ad7ce97 | [
"MIT"
] | null | null | null | setup.py | garrett-m-smith/sosp_simple | 15b9f7db089009566f7b571c7a4cf8d56ad7ce97 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(name='sosp_simple', version='1.1',
description='A package for simple SOSP models',
url='https://github.com/garrett-m-smith/sosp',
author='Garrett Smith',
author_email='garrett.smith@uconn.edu',
license='MIT',
packages=find_packages(),
zip_safe=Fals... | 32.2 | 50 | 0.723602 |
295f9fe4dde33915a9b8147bce525639c4f01596 | 1,443 | py | Python | source/timeseries/multi_step/dense.py | supercoder3000/py_tensorflow_experiments | 01aebf681df25286cf4503661148203a03309b04 | [
"MIT"
] | null | null | null | source/timeseries/multi_step/dense.py | supercoder3000/py_tensorflow_experiments | 01aebf681df25286cf4503661148203a03309b04 | [
"MIT"
] | null | null | null | source/timeseries/multi_step/dense.py | supercoder3000/py_tensorflow_experiments | 01aebf681df25286cf4503661148203a03309b04 | [
"MIT"
] | null | null | null | import tensorflow as tf
from data_types.training_result import TrainingResult
from data_types.training_set import TrainingSet
from timeseries.build import compile_and_fit
from timeseries.constants import CONV_WIDTH
from timeseries.window_generator import WindowGenerator
def evaluate_multi_step_dense(
trainin... | 34.357143 | 88 | 0.711712 |
dee86b8ff68a8aa9642bf5930ec16467e51f55c7 | 775 | py | Python | standardsettings/environments/local.py | divio/django-standardsettings | 26f20b069c053692671e344e975e1e8b71e48692 | [
"BSD-3-Clause"
] | null | null | null | standardsettings/environments/local.py | divio/django-standardsettings | 26f20b069c053692671e344e975e1e8b71e48692 | [
"BSD-3-Clause"
] | null | null | null | standardsettings/environments/local.py | divio/django-standardsettings | 26f20b069c053692671e344e975e1e8b71e48692 | [
"BSD-3-Clause"
] | 1 | 2018-11-18T01:19:18.000Z | 2018-11-18T01:19:18.000Z | # -*- coding: utf-8 -*-
from getenv import env
import os
def apply_settings(settings):
s = settings
s.DATA_ROOT = os.path.abspath(env("DATA_ROOT", os.path.join(s.PROJECT_ROOT, 'tmp')))
s.MEDIA_ROOT = env("MEDIA_ROOT", os.path.join(s.DATA_ROOT, 'media'))
s.STATIC_ROOT = env("STATIC_ROOT", os.path.join(s... | 51.666667 | 119 | 0.682581 |
feb8cfc278b63aaedd753bed42a5574a80aa1782 | 27,042 | py | Python | dask_cudf/core.py | shwina/dask-cudf | c0991ce0b0e0a7154c7d80f70eb20790779e9e66 | [
"Apache-2.0"
] | 95 | 2018-11-09T13:01:30.000Z | 2021-08-23T09:09:54.000Z | dask_cudf/core.py | shwina/dask-cudf | c0991ce0b0e0a7154c7d80f70eb20790779e9e66 | [
"Apache-2.0"
] | 217 | 2018-11-07T00:14:03.000Z | 2019-07-11T21:36:15.000Z | dask_cudf/core.py | shwina/dask-cudf | c0991ce0b0e0a7154c7d80f70eb20790779e9e66 | [
"Apache-2.0"
] | 38 | 2018-11-28T08:44:59.000Z | 2021-11-25T08:47:41.000Z | # Copyright (c) 2018, NVIDIA CORPORATION.
import warnings
from collections import OrderedDict
import pandas as pd
import dask
import dask.dataframe as dd
import numpy as np
from dask import compute
from dask.base import normalize_token, tokenize
from dask.compatibility import apply
from dask.context import _globals
f... | 32.738499 | 91 | 0.577805 |
58d44bdb35e0f517d5f2e37d7a97b500fdc1c9ec | 2,331 | py | Python | tests/test_mail.py | h4ck3rm1k3/scrapy | 59dcdbe84769c9d204f552a2b545b1e096a2d42c | [
"BSD-3-Clause"
] | 26 | 2015-02-07T17:35:26.000Z | 2020-04-27T21:11:00.000Z | tests/test_mail.py | h4ck3rm1k3/scrapy | 59dcdbe84769c9d204f552a2b545b1e096a2d42c | [
"BSD-3-Clause"
] | 2 | 2021-09-20T19:54:29.000Z | 2022-03-22T21:47:39.000Z | tests/test_mail.py | h4ck3rm1k3/scrapy | 59dcdbe84769c9d204f552a2b545b1e096a2d42c | [
"BSD-3-Clause"
] | 9 | 2015-09-21T08:17:20.000Z | 2021-02-07T02:31:36.000Z | import unittest
from io import BytesIO
from scrapy.mail import MailSender
class MailSenderTest(unittest.TestCase):
def test_send(self):
mailsender = MailSender(debug=True)
mailsender.send(to=['test@scrapy.org'], subject='subject', body='body', _callback=self._catch_mail_sent)
assert self... | 35.861538 | 141 | 0.642643 |
19ac70210983b3fc4810a8cecffadd0e0b77ad80 | 2,189 | py | Python | examples/naive_bayes_spmd.py | agorshk/daal4py | 58a9b2301c47cd2d5144a403a59c210e10b75f8f | [
"Apache-2.0"
] | null | null | null | examples/naive_bayes_spmd.py | agorshk/daal4py | 58a9b2301c47cd2d5144a403a59c210e10b75f8f | [
"Apache-2.0"
] | null | null | null | examples/naive_bayes_spmd.py | agorshk/daal4py | 58a9b2301c47cd2d5144a403a59c210e10b75f8f | [
"Apache-2.0"
] | null | null | null | #*******************************************************************************
# Copyright 2014-2020 Intel Corporation
# All Rights Reserved.
#
# This software is licensed under the Apache License, Version 2.0 (the
# "License"), the following terms apply:
#
# You may not use this file except in compliance with the Li... | 37.741379 | 99 | 0.656921 |
fe677d5af4fc41f2107ead5333669c9ef5605c6a | 442 | py | Python | linepy/__init__.py | Kaneki711/line-py | e8a008d800b041952846b0055f8a67c981e99256 | [
"BSD-3-Clause"
] | null | null | null | linepy/__init__.py | Kaneki711/line-py | e8a008d800b041952846b0055f8a67c981e99256 | [
"BSD-3-Clause"
] | null | null | null | linepy/__init__.py | Kaneki711/line-py | e8a008d800b041952846b0055f8a67c981e99256 | [
"BSD-3-Clause"
] | null | null | null | from .client import LINE
from .channel import Channel
from .oepoll import OEPoll
from akad.ttypes import OpType
__copyright__ = 'Copyright 2018 by Fadhiil Rachman'
__version__ = '3.0.6'
__license__ = 'BSD-3-Clause'
__author__ = 'Fadhiil Rachman'
__author_email__ = 'fadhiilrachman@gmai... | 34 | 64 | 0.680995 |
9e81ab194c61be14cb52b0a28e7f4925ef090dec | 2,560 | py | Python | app/tests/integration/test_create_roa.py | 18F/aocourt-api | 0fd8aab0c993b6e704e1e57fe696bf120c68af3d | [
"CC0-1.0"
] | null | null | null | app/tests/integration/test_create_roa.py | 18F/aocourt-api | 0fd8aab0c993b6e704e1e57fe696bf120c68af3d | [
"CC0-1.0"
] | 5 | 2021-07-23T00:20:40.000Z | 2021-08-03T21:11:15.000Z | app/tests/integration/test_create_roa.py | 18F/aocourts-api | 0fd8aab0c993b6e704e1e57fe696bf120c68af3d | [
"CC0-1.0"
] | null | null | null | import json
from fastapi.testclient import TestClient
from sqlalchemy.orm import Session
headers = {"Content-Type": "application/json"}
def test_create_roa_mutation(client: TestClient, db_session: Session, simple_case) -> None:
'''It should return a createRecordOnAppeal object with only the requested fields'''
... | 36.056338 | 106 | 0.624609 |
be3bb3e3fc193179f58315c0cc22ca9f3f1be25d | 1,096 | py | Python | dongers/dongers.py | WreckRox/FlapJack-Cogs | e2950f5dc7916127c3b9519ba8bfea1f71fead40 | [
"MIT"
] | 42 | 2017-04-15T17:29:40.000Z | 2022-02-16T18:15:52.000Z | dongers/dongers.py | WreckRox/FlapJack-Cogs | e2950f5dc7916127c3b9519ba8bfea1f71fead40 | [
"MIT"
] | 89 | 2017-03-22T03:21:42.000Z | 2022-03-15T18:14:49.000Z | dongers/dongers.py | WreckRox/FlapJack-Cogs | e2950f5dc7916127c3b9519ba8bfea1f71fead40 | [
"MIT"
] | 72 | 2017-03-23T01:03:29.000Z | 2022-01-25T22:47:15.000Z | import random
import aiohttp
from redbot.core import commands
from bs4 import BeautifulSoup
class Dongers(commands.Cog):
"""Cog that does dongers"""
def __init__(self, bot):
self.bot = bot
self.donger_pages = 40
self.session = aiohttp.ClientSession()
async def... | 27.4 | 88 | 0.60219 |
adc31560449b9a4552c03d7cca78ab9a93fc071e | 1,498 | py | Python | deployment/tfserving/demo.py | jundeli/Scaled-YOLOv4-tensorflow2 | dd2ce523258f9a5b851bd6f391a6c07a4999662e | [
"Apache-2.0"
] | 30 | 2021-01-29T13:57:47.000Z | 2022-02-09T13:17:57.000Z | deployment/tfserving/demo.py | jundeli/Scaled-YOLOv4-tensorflow2 | dd2ce523258f9a5b851bd6f391a6c07a4999662e | [
"Apache-2.0"
] | 13 | 2021-04-16T06:30:27.000Z | 2022-03-16T18:42:23.000Z | deployment/tfserving/demo.py | jundeli/Scaled-YOLOv4-tensorflow2 | dd2ce523258f9a5b851bd6f391a6c07a4999662e | [
"Apache-2.0"
] | 16 | 2021-04-28T06:51:58.000Z | 2022-03-23T23:47:52.000Z |
import os
import argparse
import sys
import cv2
import numpy as np
import time
from tfservingclient.client import Client
def parse_args(args):
parser = argparse.ArgumentParser("test model")
parser.add_argument('--pic-dir',default="../../images/pothole_pictures")
parser.add_argument('--class-names',default=... | 39.421053 | 108 | 0.638852 |
90285c597141c7a1d2dce871659ee8c9303ddcd3 | 2,960 | py | Python | setup.py | tomchop/google-api-python-client | 2d076b87cff4029a243357dad19564767bbf8751 | [
"Apache-2.0"
] | null | null | null | setup.py | tomchop/google-api-python-client | 2d076b87cff4029a243357dad19564767bbf8751 | [
"Apache-2.0"
] | null | null | null | setup.py | tomchop/google-api-python-client | 2d076b87cff4029a243357dad19564767bbf8751 | [
"Apache-2.0"
] | null | null | null | # Copyright 2014 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ... | 34.418605 | 87 | 0.685473 |
d8c30324f94663660b991f00a69032d120d22798 | 46,514 | py | Python | google/cloud/forseti/services/inventory/storage.py | BrunoReboul/forseti-security | 9d4a61b3e5a5d22a4330d15ddf61063fc9079071 | [
"Apache-2.0"
] | null | null | null | google/cloud/forseti/services/inventory/storage.py | BrunoReboul/forseti-security | 9d4a61b3e5a5d22a4330d15ddf61063fc9079071 | [
"Apache-2.0"
] | null | null | null | google/cloud/forseti/services/inventory/storage.py | BrunoReboul/forseti-security | 9d4a61b3e5a5d22a4330d15ddf61063fc9079071 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017 The Forseti Security 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 ap... | 33.200571 | 87 | 0.586598 |
c94a586a0a1a5c22feaba4d7725ba86d6a419a28 | 53 | py | Python | Python/print_without_newline.py | PushpneetSingh/Hello-world | def0f44737e02fb40063cd347e93e456658e2532 | [
"MIT"
] | 1,428 | 2018-10-03T15:15:17.000Z | 2019-03-31T18:38:36.000Z | Python/print_without_newline.py | PushpneetSingh/Hello-world | def0f44737e02fb40063cd347e93e456658e2532 | [
"MIT"
] | 1,162 | 2018-10-03T15:05:49.000Z | 2018-10-18T14:17:52.000Z | Python/print_without_newline.py | PushpneetSingh/Hello-world | def0f44737e02fb40063cd347e93e456658e2532 | [
"MIT"
] | 3,909 | 2018-10-03T15:07:19.000Z | 2019-03-31T18:39:08.000Z | mylist = ['10','12','14']
print(*mylist,sep='\n')
| 17.666667 | 28 | 0.509434 |
4c11c44a75a6de80933c21f81d2d335cf1051714 | 1,415 | py | Python | env/ant/ant.py | clvrai/coordination | 2b1bc8a6817b477f49c0cf6bdacd9c2f2e56f692 | [
"MIT"
] | 33 | 2020-02-15T07:52:05.000Z | 2021-12-27T04:19:45.000Z | env/ant/ant.py | clvrai/coordination | 2b1bc8a6817b477f49c0cf6bdacd9c2f2e56f692 | [
"MIT"
] | null | null | null | env/ant/ant.py | clvrai/coordination | 2b1bc8a6817b477f49c0cf6bdacd9c2f2e56f692 | [
"MIT"
] | 6 | 2020-10-12T01:37:02.000Z | 2022-02-21T12:49:49.000Z | from collections import OrderedDict
import numpy as np
from env.base import BaseEnv
class AntEnv(BaseEnv):
def __init__(self, xml_path, **kwargs):
super().__init__(xml_path, **kwargs)
self._env_config.update({
"init_randomness": 0.1,
"init_random_rot": 0,
})
... | 30.106383 | 112 | 0.614134 |
b7b48cb30c7efd52d267169b386ac41ec7749012 | 11,860 | py | Python | hiplot/fetchers_demo.py | mathematicalmichael/hiplot | 84980f63d2ac7b34995d8f2ed144a1e786c02b38 | [
"MIT"
] | null | null | null | hiplot/fetchers_demo.py | mathematicalmichael/hiplot | 84980f63d2ac7b34995d8f2ed144a1e786c02b38 | [
"MIT"
] | null | null | null | hiplot/fetchers_demo.py | mathematicalmichael/hiplot | 84980f63d2ac7b34995d8f2ed144a1e786c02b38 | [
"MIT"
] | null | null | null | # Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import uuid
import random
import math
import time
import typing as t
from . import experiment as hip
# Demos from the README. If one of those ... | 35.192878 | 140 | 0.593676 |
e721f0901f2d08071e776319958b6968acbec51b | 438 | py | Python | configs/Experiment.py | jbr-ai-labs/mamba | bd05023bd0d66f89ffbe42c315c4c4a6612b8fb4 | [
"MIT"
] | 3 | 2022-02-08T20:23:18.000Z | 2022-02-11T13:49:14.000Z | configs/Experiment.py | jbr-ai-labs/mamba | bd05023bd0d66f89ffbe42c315c4c4a6612b8fb4 | [
"MIT"
] | null | null | null | configs/Experiment.py | jbr-ai-labs/mamba | bd05023bd0d66f89ffbe42c315c4c4a6612b8fb4 | [
"MIT"
] | null | null | null | from configs.Config import Config
class Experiment(Config):
def __init__(self, steps, episodes, random_seed, env_config, controller_config, learner_config):
super(Experiment, self).__init__()
self.steps = steps
self.episodes = episodes
self.random_seed = random_seed
self.en... | 33.692308 | 100 | 0.710046 |
caaebb54ba031a14523c8f92eb4ce87041befdd3 | 219 | py | Python | src/lesson_data_persistence_and_exchange/shelve_readonly.py | jasonwee/asus-rt-n14uhp-mrtg | 4fa96c3406e32ea6631ce447db6d19d70b2cd061 | [
"Apache-2.0"
] | 3 | 2018-08-14T09:33:52.000Z | 2022-03-21T12:31:58.000Z | src/lesson_data_persistence_and_exchange/shelve_readonly.py | jasonwee/asus-rt-n14uhp-mrtg | 4fa96c3406e32ea6631ce447db6d19d70b2cd061 | [
"Apache-2.0"
] | null | null | null | src/lesson_data_persistence_and_exchange/shelve_readonly.py | jasonwee/asus-rt-n14uhp-mrtg | 4fa96c3406e32ea6631ce447db6d19d70b2cd061 | [
"Apache-2.0"
] | null | null | null | import dbm
import shelve
with shelve.open('test_shelf.db', flag='r') as s:
print('Existing:', s['key1'])
try:
s['key1'] = 'new value'
except dbm.error as err:
print('ERROR: {}'.format(err))
| 21.9 | 49 | 0.579909 |
4f8fbd2aab2c179ca8104cf2deb16d40fa8cc8bf | 921 | py | Python | python/edl/tests/unittests/del_from_etcd.py | WEARE0/edl | f065ec02bb27a67c80466103e298bd6f37494048 | [
"Apache-2.0"
] | 90 | 2020-04-21T01:46:10.000Z | 2022-02-10T09:09:34.000Z | python/edl/tests/unittests/del_from_etcd.py | WEARE0/edl | f065ec02bb27a67c80466103e298bd6f37494048 | [
"Apache-2.0"
] | 37 | 2018-03-02T22:41:15.000Z | 2020-04-22T16:48:36.000Z | python/edl/tests/unittests/del_from_etcd.py | WEARE0/edl | f065ec02bb27a67c80466103e298bd6f37494048 | [
"Apache-2.0"
] | 34 | 2018-03-02T23:28:25.000Z | 2020-03-25T08:50:29.000Z | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 35.423077 | 74 | 0.775244 |
e5dab578f1b0eba8f062481661ab78fee39694fb | 12,221 | py | Python | DQM/Integration/python/clients/beampixel_dqm_sourceclient-live_cfg.py | malbouis/cmssw | 16173a30d3f0c9ecc5419c474bb4d272c58b65c8 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | DQM/Integration/python/clients/beampixel_dqm_sourceclient-live_cfg.py | malbouis/cmssw | 16173a30d3f0c9ecc5419c474bb4d272c58b65c8 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | DQM/Integration/python/clients/beampixel_dqm_sourceclient-live_cfg.py | malbouis/cmssw | 16173a30d3f0c9ecc5419c474bb4d272c58b65c8 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | from __future__ import print_function
import FWCore.ParameterSet.Config as cms
import sys
from Configuration.Eras.Era_Run2_2018_cff import Run2_2018
process = cms.Process("BeamPixel", Run2_2018)
unitTest = False
if 'unitTest=True' in sys.argv:
unitTest = True
#----------------------------
# Common for PP and HI... | 50.920833 | 135 | 0.551346 |
3abe9fc362d8b6fc53737508881bd5adfce968b5 | 18,774 | py | Python | Tests/scripts/validate_files.py | vibhuabharadwaj/content | 30d639dbea0015536a3040ec18f93e50322bded0 | [
"MIT"
] | null | null | null | Tests/scripts/validate_files.py | vibhuabharadwaj/content | 30d639dbea0015536a3040ec18f93e50322bded0 | [
"MIT"
] | null | null | null | Tests/scripts/validate_files.py | vibhuabharadwaj/content | 30d639dbea0015536a3040ec18f93e50322bded0 | [
"MIT"
] | null | null | null | """
This script is used to validate the files in Content repository. Specifically for each file:
1) Proper prefix
2) Proper suffix
3) Valid yml/json schema
4) Having ReleaseNotes if applicable.
It can be run to check only committed changes (if the first argument is 'true') or all the files in the repo.
Note - if it is... | 46.127764 | 120 | 0.647651 |
aae65772c998f1e05e3bdd213168429b2fd08415 | 2,512 | py | Python | resilient/resilient/resilient_rest_mock.py | carlosotgz/resilient-python-api | 647a629c296602e8541b72155eab26d7fdc6b67f | [
"MIT"
] | 28 | 2017-12-22T00:26:59.000Z | 2022-01-22T14:51:33.000Z | resilient/resilient/resilient_rest_mock.py | carlosotgz/resilient-python-api | 647a629c296602e8541b72155eab26d7fdc6b67f | [
"MIT"
] | 18 | 2018-03-06T19:04:20.000Z | 2022-03-21T15:06:30.000Z | resilient/resilient/resilient_rest_mock.py | carlosotgz/resilient-python-api | 647a629c296602e8541b72155eab26d7fdc6b67f | [
"MIT"
] | 28 | 2018-05-01T17:53:22.000Z | 2022-03-28T09:56:59.000Z | # (c) Copyright IBM Corp. 2010, 2017. All Rights Reserved.
""" Requests mock for Resilient REST API """
import logging
from collections import namedtuple
import json
import re
import requests_mock
from six import add_metaclass
LOG = logging.getLogger(__name__)
LOG.addHandler(logging.StreamHandler())
LOG.setLevel(loggi... | 38.646154 | 107 | 0.589968 |
e12d5ae4a744195027e13bbe5be2de2f8ea925ac | 382 | py | Python | packages/optitype/optitype.1.0.0/files/hook-numpy.py | solvuu/opam-repo-bio | 0f33dad92113195693d876b5a04182eea08eeea8 | [
"CC0-1.0"
] | 7 | 2015-10-12T20:23:43.000Z | 2016-05-11T21:07:43.000Z | packages/optitype/optitype.1.0.0/files/hook-numpy.py | solvuu/opam-repo-bio | 0f33dad92113195693d876b5a04182eea08eeea8 | [
"CC0-1.0"
] | 20 | 2015-12-31T20:31:23.000Z | 2016-05-16T20:37:06.000Z | packages/optitype/optitype.1.0.0/files/hook-numpy.py | solvuu/opam-repo-bio | 0f33dad92113195693d876b5a04182eea08eeea8 | [
"CC0-1.0"
] | 3 | 2016-01-21T23:52:14.000Z | 2016-05-11T21:07:47.000Z | from PyInstaller import log as logging
from PyInstaller import compat
from os import listdir
libdir = compat.base_prefix + "/lib"
mkllib = filter(lambda x : x.startswith('libmkl_'), listdir(libdir))
if mkllib <> []:
logger = logging.getLogger(__name__)
logger.info("MKL installed as part of numpy, importing that!... | 34.727273 | 68 | 0.712042 |
7cbe9302c95e473a1947b80183ee75182bf66b23 | 5,139 | py | Python | proj/fpga/zcu106/Vitis-AI-DPU_TRD-for-ZCU106/zcu106_dpu/Vitis-AI/VART/samples/inception_v1_mt_py/inception_v1.py | timebe00/Mercenary | 7762bad28e4f49b2ad84fb8abbd8056bd01f61d4 | [
"MIT"
] | 3 | 2020-10-29T15:00:30.000Z | 2021-10-21T08:09:34.000Z | proj/fpga/zcu106/Vitis-AI-DPU_TRD-for-ZCU106/zcu106_dpu/Vitis-AI/VART/samples/inception_v1_mt_py/inception_v1.py | timebe00/Mercenary | 7762bad28e4f49b2ad84fb8abbd8056bd01f61d4 | [
"MIT"
] | 20 | 2020-10-31T03:19:03.000Z | 2020-11-02T18:59:49.000Z | proj/fpga/zcu106/Vitis-AI-DPU_TRD-for-ZCU106/zcu106_dpu/Vitis-AI/VART/samples/inception_v1_mt_py/inception_v1.py | timebe00/Mercenary | 7762bad28e4f49b2ad84fb8abbd8056bd01f61d4 | [
"MIT"
] | 9 | 2020-10-14T02:04:10.000Z | 2020-12-01T08:23:02.000Z | '''
Copyright 2019 Xilinx Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
di... | 27.778378 | 123 | 0.643316 |
0b80a5ad054a041ff8f08e3bacd69f57fd4f25ba | 585 | py | Python | tools/mime-type-check.py | aydinnemati/web-server | a3b60e93bf9fd1bd30f58eb2caeaf948ffd31311 | [
"MIT"
] | null | null | null | tools/mime-type-check.py | aydinnemati/web-server | a3b60e93bf9fd1bd30f58eb2caeaf948ffd31311 | [
"MIT"
] | null | null | null | tools/mime-type-check.py | aydinnemati/web-server | a3b60e93bf9fd1bd30f58eb2caeaf948ffd31311 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import re, json
found_extensions = {}
with open("./config/defaults/mime.types") as file_in:
lines = []
for line in file_in:
m = re.search('([^\s]+)[\s]+([^"]+);', line)
if m:
mimetype = m.group(1)
extensions = m.group(2).split(' ')
for extension in exten... | 26.590909 | 61 | 0.591453 |
6b04a8c43037d1b4d37e93b29b7ce7bc95bd563c | 673 | py | Python | publishconf.py | julianespinel/website | a16394cf878fdfd8e1fa86ed23779d31ec4f1316 | [
"MIT"
] | null | null | null | publishconf.py | julianespinel/website | a16394cf878fdfd8e1fa86ed23779d31ec4f1316 | [
"MIT"
] | 9 | 2020-08-30T19:52:19.000Z | 2021-10-03T16:55:45.000Z | publishconf.py | julianespinel/website | a16394cf878fdfd8e1fa86ed23779d31ec4f1316 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*- #
# This file is only used if you use `make publish` or
# explicitly specify it as your config file.
import toml
import os
import sys
sys.path.append(os.curdir)
from pelicanconf import *
# Load non-secrets from file
public = toml.load('public.toml')
# If your site is a... | 22.433333 | 77 | 0.734027 |
ab9e8d26d372c26c715b75a9d8e7c5feabee12ad | 2,980 | py | Python | src/ska_mid_cbf_mcs/vcc/vcc_band_3.py | jamesjiang52/mid-cbf-mcs | 072f8fdb91d77010e875f441e536fab842bf8319 | [
"BSD-3-Clause"
] | null | null | null | src/ska_mid_cbf_mcs/vcc/vcc_band_3.py | jamesjiang52/mid-cbf-mcs | 072f8fdb91d77010e875f441e536fab842bf8319 | [
"BSD-3-Clause"
] | 4 | 2021-05-20T05:19:23.000Z | 2021-05-20T05:19:26.000Z | src/ska_mid_cbf_mcs/vcc/vcc_band_3.py | ska-telescope/mid-cbf-mcs | 072f8fdb91d77010e875f441e536fab842bf8319 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
#
# This file is part of the Vcc project
#
#
#
# Distributed under the terms of the GPL license.
# See LICENSE.txt for more info.
# """
# Author: James Jiang James.Jiang@nrc-cnrc.gc.ca,
# Herzberg Astronomy and Astrophysics, National Research Council of Canada
# Copyright (c) 2019 National Rese... | 24.833333 | 76 | 0.615101 |
b38ce6d293709fe5117a12a3f76334da7bc331c7 | 208 | py | Python | apluslms_roman/schemas/__init__.py | ppessi/roman | 19aafde41f307c2b51163f36e4ed71d28f95ee50 | [
"MIT"
] | null | null | null | apluslms_roman/schemas/__init__.py | ppessi/roman | 19aafde41f307c2b51163f36e4ed71d28f95ee50 | [
"MIT"
] | 14 | 2018-02-17T04:04:16.000Z | 2020-01-13T18:40:57.000Z | apluslms_roman/schemas/__init__.py | ppessi/roman | 19aafde41f307c2b51163f36e4ed71d28f95ee50 | [
"MIT"
] | 6 | 2018-06-12T06:48:50.000Z | 2021-05-18T16:36:04.000Z | from os.path import join
from apluslms_yamlidator.schemas import schema_registry
from .. import CACHE_DIR
schema_registry.register_module(__name__)
schema_registry.register_cache(join(CACHE_DIR, 'schemas'))
| 29.714286 | 58 | 0.850962 |
3bd82199aee0c758e2afeedb214d39152011b185 | 5,206 | py | Python | kws_streaming/layers/lstm_test.py | deepneuralmachine/google-research | d2ce2cf0f5c004f8d78bfeddf6e88e88f4840231 | [
"Apache-2.0"
] | 23,901 | 2018-10-04T19:48:53.000Z | 2022-03-31T21:27:42.000Z | kws_streaming/layers/lstm_test.py | deepneuralmachine/google-research | d2ce2cf0f5c004f8d78bfeddf6e88e88f4840231 | [
"Apache-2.0"
] | 891 | 2018-11-10T06:16:13.000Z | 2022-03-31T10:42:34.000Z | kws_streaming/layers/lstm_test.py | deepneuralmachine/google-research | d2ce2cf0f5c004f8d78bfeddf6e88e88f4840231 | [
"Apache-2.0"
] | 6,047 | 2018-10-12T06:31:02.000Z | 2022-03-31T13:59:28.000Z | # coding=utf-8
# Copyright 2021 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 37.453237 | 76 | 0.708029 |
7106b9be18f8718f4df730e3b3881117558040ca | 3,587 | py | Python | girder/cli/build.py | manthey/girder | 1ae1068b02b3dc775df957f3a3c79a6aa9798043 | [
"Apache-2.0"
] | null | null | null | girder/cli/build.py | manthey/girder | 1ae1068b02b3dc775df957f3a3c79a6aa9798043 | [
"Apache-2.0"
] | null | null | null | girder/cli/build.py | manthey/girder | 1ae1068b02b3dc775df957f3a3c79a6aa9798043 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright Kitware 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 ... | 36.232323 | 99 | 0.647895 |
cbe2f3d79c5534a10e59fae092f7ddd707bcd2cc | 9,799 | py | Python | tr/session_test.py | DentonGentry/gfiber-catawampus | b01e4444f3c7f12b1af7837203b37060fd443bb7 | [
"Apache-2.0"
] | 2 | 2017-10-03T16:06:29.000Z | 2020-09-08T13:03:13.000Z | tr/session_test.py | DentonGentry/gfiber-catawampus | b01e4444f3c7f12b1af7837203b37060fd443bb7 | [
"Apache-2.0"
] | null | null | null | tr/session_test.py | DentonGentry/gfiber-catawampus | b01e4444f3c7f12b1af7837203b37060fd443bb7 | [
"Apache-2.0"
] | 1 | 2017-05-07T17:39:02.000Z | 2017-05-07T17:39:02.000Z | #!/usr/bin/python
# Copyright 2012 Google Inc. 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 appli... | 30.058282 | 74 | 0.72589 |
4a937665b8a485320fffe37f4e7ab50f855f6e58 | 451 | py | Python | forms/urls.py | ditttu/gymkhana-Nominations | 2a0e993c1b8362c456a9369b0b549d1c809a21df | [
"MIT"
] | 3 | 2018-02-27T13:48:28.000Z | 2018-03-03T21:57:50.000Z | forms/urls.py | ditttu/gymkhana-Nominations | 2a0e993c1b8362c456a9369b0b549d1c809a21df | [
"MIT"
] | 6 | 2020-02-12T00:07:46.000Z | 2022-03-11T23:25:59.000Z | forms/urls.py | ditttu/gymkhana-Nominations | 2a0e993c1b8362c456a9369b0b549d1c809a21df | [
"MIT"
] | 1 | 2019-03-26T20:19:57.000Z | 2019-03-26T20:19:57.000Z | from django.conf.urls import url
from . import views
app_name = 'forms'
urlpatterns = [
#forms/creator/12 ----in great use
url(r'^creator/(?P<pk>\d+)/$', views.creator_form, name='creator_form'),
# forms/create/ques/2 ---in use
url(r'^create/ques/(?P<pk>\d+)/$', views.add_ques, name='add_ques'),
... | 22.55 | 86 | 0.614191 |
0ebbb888a38a477da3c319627eb6276b2e54df5e | 1,785 | py | Python | main.py | alexander24032003/Flask-Repo | 547d4f99766b411aa757580c7dbbd485ef0888ec | [
"MIT"
] | null | null | null | main.py | alexander24032003/Flask-Repo | 547d4f99766b411aa757580c7dbbd485ef0888ec | [
"MIT"
] | null | null | null | main.py | alexander24032003/Flask-Repo | 547d4f99766b411aa757580c7dbbd485ef0888ec | [
"MIT"
] | null | null | null | from flask import Flask
from flask import render_template, request, redirect, url_for
from post import Post
from comment import Comment
app = Flask(__name__)
@app.route('/')
def hello_world():
return redirect(url_for('list_posts'))
@app.route('/posts')
def list_posts():
return render_template('posts.html', ... | 27.461538 | 94 | 0.653782 |
b079c810fffe883cdb584df215590859d5197d33 | 2,908 | py | Python | bin/create_students.py | phdfbk/phdfbk.github.io | a111369d358e473bebc158e088d6af9adf04ae82 | [
"Apache-2.0"
] | null | null | null | bin/create_students.py | phdfbk/phdfbk.github.io | a111369d358e473bebc158e088d6af9adf04ae82 | [
"Apache-2.0"
] | 36 | 2016-08-13T11:30:34.000Z | 2019-01-28T16:03:41.000Z | bin/create_students.py | phdfbk/phdfbk.github.io | a111369d358e473bebc158e088d6af9adf04ae82 | [
"Apache-2.0"
] | 1 | 2019-05-23T13:41:52.000Z | 2019-05-23T13:41:52.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
import unicodecsv
import requests
import cgi
from cStringIO import StringIO
from datetime import datetime
url_students ="https://docs.google.com/spreadsheets/d/1UJ8eHwcBsdKRjwc6uu2KVhNIn_FSEpLMh6xqMNQ5sUY/pub?gid=191666891&single=true&output=csv"
r = requests.get(url_students)
... | 44.060606 | 140 | 0.516162 |
b9deb3b3b8b578f4176a40753e4de1a49f6e2fc9 | 752 | py | Python | tests/http/test_tls.py | PyCN/pulsar | fee44e871954aa6ca36d00bb5a3739abfdb89b26 | [
"BSD-3-Clause"
] | 1,410 | 2015-01-02T14:55:07.000Z | 2022-03-28T17:22:06.000Z | tests/http/test_tls.py | PyCN/pulsar | fee44e871954aa6ca36d00bb5a3739abfdb89b26 | [
"BSD-3-Clause"
] | 194 | 2015-01-22T06:18:24.000Z | 2020-10-20T21:21:58.000Z | tests/http/test_tls.py | PyCN/pulsar | fee44e871954aa6ca36d00bb5a3739abfdb89b26 | [
"BSD-3-Clause"
] | 168 | 2015-01-31T10:29:55.000Z | 2022-03-14T10:22:24.000Z | import os
from pulsar.apps.http import SSLError, HttpClient
from pulsar.utils.system import platform
from tests.http import base
crt = os.path.join(os.path.dirname(__file__), 'ca_bundle')
if platform.type != 'win':
class TestTlsHttpClient(base.TestHttpClient):
with_tls = True
async def test_... | 28.923077 | 64 | 0.652926 |
0248f2599780b5c0b6cdafc74d877f83dc796a55 | 25,383 | py | Python | Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/conda/activate.py | mikiec84/PTVS | 6cbeadd70a4438d6e6ea4d22a465d678eacf5eb2 | [
"Apache-2.0"
] | null | null | null | Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/conda/activate.py | mikiec84/PTVS | 6cbeadd70a4438d6e6ea4d22a465d678eacf5eb2 | [
"Apache-2.0"
] | 1 | 2019-04-02T23:35:13.000Z | 2019-04-02T23:35:13.000Z | Python/Product/Miniconda/Miniconda3-x64/Lib/site-packages/conda/activate.py | mikiec84/PTVS | 6cbeadd70a4438d6e6ea4d22a465d678eacf5eb2 | [
"Apache-2.0"
] | 2 | 2018-03-02T19:55:14.000Z | 2019-02-14T22:37:28.000Z | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from errno import ENOENT
from glob import glob
import os
from os.path import (abspath, basename, dirname, expanduser, expandvars, isdir, join, normcase,
normpath)
import re
import sys
from te... | 39.353488 | 218 | 0.599653 |
dbf0db4db74b463c78ff2a7f2fe17f3d69fa44c2 | 6,737 | py | Python | src/ProcessingT.py | 94CD94/FaciesClassification | 23d56378a8d68d036fee4cc945a8f03b18a07043 | [
"MIT"
] | null | null | null | src/ProcessingT.py | 94CD94/FaciesClassification | 23d56378a8d68d036fee4cc945a8f03b18a07043 | [
"MIT"
] | null | null | null | src/ProcessingT.py | 94CD94/FaciesClassification | 23d56378a8d68d036fee4cc945a8f03b18a07043 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sklearn.linear_model import LogisticRegression
from sklearn.ensemble import RandomForestClassifier
from sklearn.svm import SVC
import seaborn as sns
from ROC import multiclass_ROC
from Learning_curve import plot_learning_curve
from skl... | 32.23445 | 181 | 0.703132 |
e0eb0c4b0a6718d7ee33fbe61a933be37dd4f0bd | 1,177 | py | Python | gcloud/storage/demo/demo.py | rakyll/gcloud-python | ad1f0f735963dbc138d6d8e20ed0dbf5e6fea0d3 | [
"Apache-2.0"
] | 1 | 2019-04-16T11:09:50.000Z | 2019-04-16T11:09:50.000Z | gcloud/storage/demo/demo.py | rakyll/gcloud-python | ad1f0f735963dbc138d6d8e20ed0dbf5e6fea0d3 | [
"Apache-2.0"
] | null | null | null | gcloud/storage/demo/demo.py | rakyll/gcloud-python | ad1f0f735963dbc138d6d8e20ed0dbf5e6fea0d3 | [
"Apache-2.0"
] | null | null | null | # Welcome to the gCloud Storage Demo! (hit enter)
# We're going to walk through some of the basics...,
# Don't worry though. You don't need to do anything, just keep hitting enter...
# Let's start by importing the demo module and getting a connection:
from gcloud.storage import demo
connection = demo.get_connection()... | 29.425 | 79 | 0.726423 |
917a4daa5f3085ab6cce9aa0b5885667705dd1de | 336 | py | Python | app/rest_api/admin.py | 21vcloud/Controller | 63169d220f412330a22e3a2fe9964c73893d4e0f | [
"Apache-2.0"
] | null | null | null | app/rest_api/admin.py | 21vcloud/Controller | 63169d220f412330a22e3a2fe9964c73893d4e0f | [
"Apache-2.0"
] | null | null | null | app/rest_api/admin.py | 21vcloud/Controller | 63169d220f412330a22e3a2fe9964c73893d4e0f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.contrib import admin
from rest_api.models import AccessKey
class AccessKeyForm(admin.ModelAdmin):
list_display = ('id', 'access_key', 'secret_key')
search_fields = ('id', 'access_key', 'secret_key')
# admin.site.register(AccessKey... | 24 | 54 | 0.738095 |
09c90f4e546ee2eda6e635deb3857b53383d2701 | 974 | py | Python | logic/utilities.py | rdelacrz/connect-four | 7123d6e649aadcb76f429c61dde405527211c5b2 | [
"MIT"
] | null | null | null | logic/utilities.py | rdelacrz/connect-four | 7123d6e649aadcb76f429c61dde405527211c5b2 | [
"MIT"
] | null | null | null | logic/utilities.py | rdelacrz/connect-four | 7123d6e649aadcb76f429c61dde405527211c5b2 | [
"MIT"
] | null | null | null | """
Defines utility functions used by both the AI and the core logic.
"""
# Third-party modules
from cefpython3 import cefpython as cef
def js_callback(func):
"""
Takes the return value of the function being wrapped and passes it through the callback function (if any).
It is meant for JavaScript callback ... | 32.466667 | 115 | 0.663244 |
520eae1acab1968bb364674a4c3f24ccffa5012d | 6,884 | py | Python | praw/models/util.py | Theonefoster/praw | 3d79b43a5193387974455f3d3ccdfff644714d09 | [
"BSD-2-Clause"
] | 4 | 2018-09-28T01:47:53.000Z | 2021-02-13T20:21:14.000Z | praw/models/util.py | Theonefoster/praw | 3d79b43a5193387974455f3d3ccdfff644714d09 | [
"BSD-2-Clause"
] | 4 | 2018-09-19T06:27:24.000Z | 2018-09-22T00:44:41.000Z | praw/models/util.py | Theonefoster/praw | 3d79b43a5193387974455f3d3ccdfff644714d09 | [
"BSD-2-Clause"
] | null | null | null | """Provide helper classes used by other models."""
import random
import time
class BoundedSet(object):
"""A set with a maximum size that evicts the oldest items when necessary.
This class does not implement the complete set interface.
"""
def __init__(self, max_items):
"""Construct an instan... | 36.041885 | 79 | 0.644102 |
a68e8a9dc72fa2189832f09062e8996dd4d65a98 | 6,754 | py | Python | storm_control/hal4000/miscControl/zStage.py | shiwei23/STORM6 | 669067503ebd164b575ce529fcc4a9a3f576b3d7 | [
"MIT"
] | 47 | 2015-02-11T16:05:54.000Z | 2022-03-26T14:13:12.000Z | storm_control/hal4000/miscControl/zStage.py | shiwei23/STORM6 | 669067503ebd164b575ce529fcc4a9a3f576b3d7 | [
"MIT"
] | 110 | 2015-01-30T03:53:41.000Z | 2021-11-03T15:58:44.000Z | storm_control/hal4000/miscControl/zStage.py | shiwei23/STORM6 | 669067503ebd164b575ce529fcc4a9a3f576b3d7 | [
"MIT"
] | 61 | 2015-01-09T18:31:27.000Z | 2021-12-21T13:07:51.000Z | #!/usr/bin/env python
"""
The z stage UI.
Hazen Babcock 05/18
"""
import os
from PyQt5 import QtCore, QtGui, QtWidgets
import storm_control.sc_library.parameters as params
import storm_control.hal4000.halLib.halDialog as halDialog
import storm_control.hal4000.halLib.halMessage as halMessage
import storm_control.hal... | 41.950311 | 124 | 0.599349 |
b35ff9d7da0da0d6f0e30738d48d3f73a591fa31 | 4,712 | py | Python | getpricepaid.py | spencer84/Chester-Data-Analytics | f64fe2a131ce6dc39c017476812435ef2b874733 | [
"MIT"
] | null | null | null | getpricepaid.py | spencer84/Chester-Data-Analytics | f64fe2a131ce6dc39c017476812435ef2b874733 | [
"MIT"
] | null | null | null | getpricepaid.py | spencer84/Chester-Data-Analytics | f64fe2a131ce6dc39c017476812435ef2b874733 | [
"MIT"
] | null | null | null | import requests
import datetime
import sqlite3
import queue
def get_postcode_district(postcode):
""" Returns the postcode district/area from a given postcode
"""
if ' ' in postcode:
return postcode.split(' ')[0]
elif len(postcode) == 6:
return postcode[:3]
else:
return postc... | 40.273504 | 120 | 0.598684 |
af52d7bf0ab048723e44f33dd9014740f0b6092e | 8,001 | py | Python | tests/test_cli/test_remove/test_skill.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | null | null | null | tests/test_cli/test_remove/test_skill.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | null | null | null | tests/test_cli/test_remove/test_skill.py | valory-xyz/agents-aea | 8f38efa96041b0156ed1ae328178e395dbabf2fc | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2021-2022 Valory AG
# Copyright 2018-2019 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.... | 33.061983 | 111 | 0.599675 |
4c54f4c17a5c394a043e09dee3b224346ae284e7 | 12,508 | py | Python | refitt/web/api/endpoint/facility.py | refitt/ref | 3ccc398e7b95f77549ab77884b87f40abdd3effb | [
"Apache-2.0"
] | 4 | 2020-09-11T01:15:11.000Z | 2021-05-12T16:46:48.000Z | refitt/web/api/endpoint/facility.py | refitt/ref | 3ccc398e7b95f77549ab77884b87f40abdd3effb | [
"Apache-2.0"
] | 12 | 2021-03-20T03:24:53.000Z | 2022-02-19T03:20:43.000Z | refitt/web/api/endpoint/facility.py | refitt/ref | 3ccc398e7b95f77549ab77884b87f40abdd3effb | [
"Apache-2.0"
] | 2 | 2021-02-01T23:49:39.000Z | 2021-12-11T19:01:23.000Z | # SPDX-FileCopyrightText: 2019-2021 REFITT Team
# SPDX-License-Identifier: Apache-2.0
"""Facility profile endpoints."""
# type annotations
from typing import Union
# external libs
from flask import request
# internal libs
from ....database.model import Client, Facility, IntegrityError, NotFound
from ..app import a... | 32.829396 | 115 | 0.575951 |
f7de8378bc55ab8464334c04827021106729ea13 | 1,067 | py | Python | pywebhooks/__init__.py | chadlung/pywebhooks | 4b5f41be7c3c498a31cb0225cbde8e63c48ce999 | [
"Apache-2.0"
] | 94 | 2015-04-03T12:10:54.000Z | 2021-08-30T13:50:48.000Z | pywebhooks/__init__.py | chadlung/pywebhooks | 4b5f41be7c3c498a31cb0225cbde8e63c48ce999 | [
"Apache-2.0"
] | 10 | 2016-06-07T17:34:39.000Z | 2019-11-23T00:00:09.000Z | pywebhooks/__init__.py | chadlung/pywebhooks | 4b5f41be7c3c498a31cb0225cbde8e63c48ce999 | [
"Apache-2.0"
] | 10 | 2015-04-14T18:03:08.000Z | 2021-08-30T13:50:49.000Z | DEFAULT_DB_NAME = 'pywebhooks'
DEFAULT_ACCOUNTS_TABLE = 'accounts'
DEFAULT_REGISTRATIONS_TABLE = 'registrations'
DEFAULT_TRIGGERED_TABLE = 'triggered_webhooks'
DEFAULT_SUBSCRIPTIONS_TABLE = 'subscriptions'
DEFAULT_TABLE_NAMES = [
DEFAULT_ACCOUNTS_TABLE,
DEFAULT_REGISTRATIONS_TABLE,
DEFAULT_TRIGGERED_TABLE,... | 32.333333 | 79 | 0.788191 |
4d9730f5aef0bd8d322583a08360223da84a5f3c | 2,388 | py | Python | tests/natural_bm/test_callbacks.py | alexhunterlang/natural_bm | b2a1cb15694f4f3a80a3a1cc6f8423892563806d | [
"MIT"
] | 1 | 2018-06-07T00:54:17.000Z | 2018-06-07T00:54:17.000Z | tests/natural_bm/test_callbacks.py | alexhunterlang/natural_bm | b2a1cb15694f4f3a80a3a1cc6f8423892563806d | [
"MIT"
] | null | null | null | tests/natural_bm/test_callbacks.py | alexhunterlang/natural_bm | b2a1cb15694f4f3a80a3a1cc6f8423892563806d | [
"MIT"
] | null | null | null | #%%
import pytest
import os
from csv import Sniffer
from natural_bm import callbacks
from natural_bm import optimizers
from natural_bm import training
from natural_bm.models import Model
from natural_bm.datasets import random
from natural_bm.utils_testing import nnet_for_testing
#%%
@pytest.mark.parametrize('sep', [... | 27.767442 | 79 | 0.602178 |
3eccd9e4b7ade8d1a77e4b3af717b0fccf6cf790 | 997 | py | Python | src/homework/d_repetition/main.py | acc-cosc-1336-spring-2022/acc-cosc-1336-spring-2022-marshall0603181 | 8660a72234f212833bf27b68f37b9e0cc7911769 | [
"MIT"
] | null | null | null | src/homework/d_repetition/main.py | acc-cosc-1336-spring-2022/acc-cosc-1336-spring-2022-marshall0603181 | 8660a72234f212833bf27b68f37b9e0cc7911769 | [
"MIT"
] | null | null | null | src/homework/d_repetition/main.py | acc-cosc-1336-spring-2022/acc-cosc-1336-spring-2022-marshall0603181 | 8660a72234f212833bf27b68f37b9e0cc7911769 | [
"MIT"
] | null | null | null | import repetition
# choice has to do with 'Homework 3 menu'.
choice2 = 'y'
while choice2 == 'y':
print('Homework 3 Menu')
choice = int(input('\n(1) Factorial \n(2) Sum odd numbers \n(3) Exit \n\n '))
if choice == 1:
num = int(input('enter number greater than 0 and less than 10: '))
if num > ... | 36.925926 | 81 | 0.570712 |
81e574e9b4f45083143bc61f715e8f59470368c8 | 6,473 | py | Python | pylib/pc/PointHierarchy.py | schellmi42/tensorflow_graphics_point_clouds | c8e2dc2963c3eecfb27542449603f81d78494783 | [
"Apache-2.0"
] | 3 | 2020-07-10T12:07:02.000Z | 2022-03-21T09:28:55.000Z | pylib/pc/PointHierarchy.py | schellmi42/tensorflow_graphics_point_clouds | c8e2dc2963c3eecfb27542449603f81d78494783 | [
"Apache-2.0"
] | null | null | null | pylib/pc/PointHierarchy.py | schellmi42/tensorflow_graphics_point_clouds | c8e2dc2963c3eecfb27542449603f81d78494783 | [
"Apache-2.0"
] | 1 | 2021-10-11T08:27:44.000Z | 2021-10-11T08:27:44.000Z | # Copyright 2020 The TensorFlow Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 34.248677 | 79 | 0.626294 |
1e736673206162a194cdb6860dca00ee90a2d88c | 165 | py | Python | tests/model_control/detailed/transf_Fisher/model_control_one_enabled_Fisher_PolyTrend_Seasonal_DayOfMonth_LSTM.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | tests/model_control/detailed/transf_Fisher/model_control_one_enabled_Fisher_PolyTrend_Seasonal_DayOfMonth_LSTM.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | 1 | 2019-11-30T23:39:38.000Z | 2019-12-01T04:34:35.000Z | tests/model_control/detailed/transf_Fisher/model_control_one_enabled_Fisher_PolyTrend_Seasonal_DayOfMonth_LSTM.py | jmabry/pyaf | afbc15a851a2445a7824bf255af612dc429265af | [
"BSD-3-Clause"
] | null | null | null | import pyaf.tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Fisher'] , ['PolyTrend'] , ['Seasonal_DayOfMonth'] , ['LSTM'] ); | 41.25 | 87 | 0.757576 |
79c9cd94871bef0c6d46c1a7e6af0177dd5e4945 | 5,387 | py | Python | homeassistant/components/ssdp/__init__.py | alindeman/home-assistant | b274b10f3874c196f0db8f9cfa5f47eb756d1f8e | [
"Apache-2.0"
] | 4 | 2019-07-03T22:36:57.000Z | 2019-08-10T15:33:25.000Z | homeassistant/components/ssdp/__init__.py | alindeman/home-assistant | b274b10f3874c196f0db8f9cfa5f47eb756d1f8e | [
"Apache-2.0"
] | 7 | 2019-08-23T05:26:02.000Z | 2022-03-11T23:57:18.000Z | homeassistant/components/ssdp/__init__.py | alindeman/home-assistant | b274b10f3874c196f0db8f9cfa5f47eb756d1f8e | [
"Apache-2.0"
] | 2 | 2018-08-15T03:59:35.000Z | 2018-10-18T12:20:05.000Z | """The SSDP integration."""
import asyncio
from datetime import timedelta
import logging
from urllib.parse import urlparse
from xml.etree import ElementTree
import aiohttp
from netdisco import ssdp, util
from homeassistant.helpers.event import async_track_time_interval
from homeassistant.generated.ssdp import SSDP
D... | 30.607955 | 78 | 0.629107 |
12b806a28ed2197f6f296e7aa25dbf73bcc7d67c | 131 | py | Python | association/apps.py | bpprc/database | 6e8302729793ddf840630840bd08c96ddd35a52e | [
"BSD-3-Clause"
] | 1 | 2021-04-14T16:54:57.000Z | 2021-04-14T16:54:57.000Z | association/apps.py | bpprc/database | 6e8302729793ddf840630840bd08c96ddd35a52e | [
"BSD-3-Clause"
] | null | null | null | association/apps.py | bpprc/database | 6e8302729793ddf840630840bd08c96ddd35a52e | [
"BSD-3-Clause"
] | null | null | null | from django.apps import AppConfig
class AssociationConfig(AppConfig):
name = "association"
verbose_name = "Metadatabase"
| 18.714286 | 35 | 0.755725 |
1f195ec6962c01598d686ac5a5b75b95ebb06598 | 4,382 | py | Python | DirToCatalog.py | mcfoi/arcpy-toolbox | 348ef55c7235b7c1eeece06aa4a0a244674f893e | [
"Apache-2.0"
] | 3 | 2015-04-24T15:36:33.000Z | 2020-08-06T16:53:56.000Z | DirToCatalog.py | mcfoi/arcpy-toolbox | 348ef55c7235b7c1eeece06aa4a0a244674f893e | [
"Apache-2.0"
] | null | null | null | DirToCatalog.py | mcfoi/arcpy-toolbox | 348ef55c7235b7c1eeece06aa4a0a244674f893e | [
"Apache-2.0"
] | 1 | 2020-07-21T00:11:51.000Z | 2020-07-21T00:11:51.000Z | ##""********************************************************************************************************************
##TOOL NAME: DirToCatalog
##SOURCE NAME: DirToCatalog.py
##VERSION: ArcGIS 9.0
##AUTHOR: Environmental Systems Research Institute Inc.
##REQUIRED ARGUMENTS: Input workspace
## Outp... | 40.953271 | 122 | 0.651073 |
cdc9f0315718713e493e7853983f0c208dd0be2b | 8,752 | py | Python | test_code/grid_cluster_analysis.py | eufmike/storm_image_processing | 076335519be0be3b66d289a180421d36770ab820 | [
"CC-BY-4.0"
] | null | null | null | test_code/grid_cluster_analysis.py | eufmike/storm_image_processing | 076335519be0be3b66d289a180421d36770ab820 | [
"CC-BY-4.0"
] | null | null | null | test_code/grid_cluster_analysis.py | eufmike/storm_image_processing | 076335519be0be3b66d289a180421d36770ab820 | [
"CC-BY-4.0"
] | null | null | null | # %%
import os, sys
import re
import cv2
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
# %matplotlib inline
from numpy import linspace, meshgrid
from scipy.interpolate import griddata
import matplotlib.image as mpimg
import matplotlib.style
import matplotlib as mpl
mpl.style.use('default')
fro... | 33.40458 | 111 | 0.616659 |
8f3b1a7ecf4a768e0d41fd4ef0f7519710eee52f | 5,465 | py | Python | stRT/preprocess/cluster/utils/integration.py | Yao-14/stAnalysis | d08483ce581f5b03cfcad8be500aaa64b0293f74 | [
"BSD-3-Clause"
] | null | null | null | stRT/preprocess/cluster/utils/integration.py | Yao-14/stAnalysis | d08483ce581f5b03cfcad8be500aaa64b0293f74 | [
"BSD-3-Clause"
] | null | null | null | stRT/preprocess/cluster/utils/integration.py | Yao-14/stAnalysis | d08483ce581f5b03cfcad8be500aaa64b0293f74 | [
"BSD-3-Clause"
] | null | null | null | from typing import List, Optional
import numpy as np
import pandas as pd
from anndata import AnnData
from pandas import DataFrame
from scipy.sparse import csr_matrix, isspmatrix
# Convert sparse matrix to dense matrix.
to_dense_matrix = lambda X: np.array(X.todense()) if isspmatrix(X) else np.asarray(X)
def integra... | 36.925676 | 128 | 0.63989 |
7a1ca12e811d67b018eb6636c122ee3ceceb93a9 | 9,889 | py | Python | service/core.py | lojoja/service | 27295a25c514119cf9975c76c9c3b784243977f1 | [
"MIT"
] | null | null | null | service/core.py | lojoja/service | 27295a25c514119cf9975c76c9c3b784243977f1 | [
"MIT"
] | null | null | null | service/core.py | lojoja/service | 27295a25c514119cf9975c76c9c3b784243977f1 | [
"MIT"
] | null | null | null | import logging
import os
import pathlib
import platform
import re
import click
from service import __version__, launchctl # noqa
from service.log import change_logger_level, setup_logger
__all__ = ['cli']
PROGRAM_NAME = 'service'
MIN_MACOS_VERSION = 12.0
CONFIG_FILE = '{}.conf'.format(PROGRAM_NAME)
logger = logg... | 32.963333 | 120 | 0.637274 |
2816cfdb94591f897dba7c94e443b5767495c94c | 1,919 | py | Python | claims_to_quality/analyzer/models/measures/measure_definition.py | CMSgov/qpp-claims-to-quality-public | 1e2da9494faf9e316a17cbe899284db9e61d0902 | [
"CC0-1.0"
] | 13 | 2018-09-28T14:02:59.000Z | 2021-12-07T21:31:54.000Z | claims_to_quality/analyzer/models/measures/measure_definition.py | CMSgov/qpp-claims-to-quality-public | 1e2da9494faf9e316a17cbe899284db9e61d0902 | [
"CC0-1.0"
] | 1 | 2018-10-01T17:49:05.000Z | 2018-10-09T01:10:56.000Z | claims_to_quality/analyzer/models/measures/measure_definition.py | CMSgov/qpp-claims-to-quality-public | 1e2da9494faf9e316a17cbe899284db9e61d0902 | [
"CC0-1.0"
] | 1 | 2021-02-08T18:32:16.000Z | 2021-02-08T18:32:16.000Z | """Models for measure definition."""
from claims_to_quality.analyzer.models.measures.eligibility_option import EligibilityOption
from claims_to_quality.analyzer.models.measures.performance_option import PerformanceOption
from claims_to_quality.analyzer.models.measures.stratum import Stratum
from claims_to_quality.lib.h... | 42.644444 | 91 | 0.745701 |
27978f83500214065097e0524dd4eaf65ad3f305 | 2,441 | py | Python | lookup.py | raywong702/lookup | 0950b8a8279606499d3a5a7280c29996f7da1a53 | [
"BSD-3-Clause"
] | null | null | null | lookup.py | raywong702/lookup | 0950b8a8279606499d3a5a7280c29996f7da1a53 | [
"BSD-3-Clause"
] | null | null | null | lookup.py | raywong702/lookup | 0950b8a8279606499d3a5a7280c29996f7da1a53 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
import ipaddress
import socket
import asyncio
import sys
import os.path
async def lookup(loop, addresses, max_length=None):
''' loop: asyncio event loop
addresses: list of ip address or hostnames
max_length: spacer width of first print column
prints address and its corresponding... | 28.057471 | 77 | 0.597296 |
db4a1579416d6847733669769a9d3482623bcd72 | 2,664 | py | Python | jina/types/score/map.py | arijitdas123student/jina | 54d916e362bde0391b0af0f12241d531b8453247 | [
"Apache-2.0"
] | 15,179 | 2020-04-28T10:23:56.000Z | 2022-03-31T14:35:25.000Z | jina/types/score/map.py | manavshah123/jina | f18b04eb82d18a3c554e2892bbae4b95fc0cb13e | [
"Apache-2.0"
] | 3,912 | 2020-04-28T13:01:29.000Z | 2022-03-31T14:36:46.000Z | jina/types/score/map.py | manavshah123/jina | f18b04eb82d18a3c554e2892bbae4b95fc0cb13e | [
"Apache-2.0"
] | 1,955 | 2020-04-28T10:50:49.000Z | 2022-03-31T12:28:34.000Z | from collections.abc import MutableMapping
from typing import Optional, Union
import numpy as np
from ..score import NamedScore
from ...helper import typename
from ...proto import jina_pb2
__all__ = ['NamedScoreMapping']
if False:
from google.protobuf.pyext._message import MessageMapContainer
class NamedScore... | 29.932584 | 121 | 0.653529 |
4468a838ea5916f8931adec6bd118bc4304fb038 | 13,334 | py | Python | certbot-apache/tests/augeasnode_test.py | ravikumarmotukuri/certbot | f8c43aa9fe8c1917ad4bc2620134837db3cd7d70 | [
"Apache-2.0"
] | null | null | null | certbot-apache/tests/augeasnode_test.py | ravikumarmotukuri/certbot | f8c43aa9fe8c1917ad4bc2620134837db3cd7d70 | [
"Apache-2.0"
] | 1 | 2020-04-03T12:57:27.000Z | 2020-04-03T12:57:27.000Z | certbot-apache/tests/augeasnode_test.py | Tomoyuki-GH/certbot | 41ee5be4b5e01f4a0616fe5e014a38f59a931f60 | [
"Apache-2.0"
] | null | null | null | """Tests for AugeasParserNode classes"""
import mock
import os
import unittest
import util
from certbot import errors
from certbot_apache._internal import assertions
from certbot_apache._internal import augeasparser
def _get_augeasnode_mock(filepath):
""" Helper function for mocking out DualNode instance with ... | 39.922156 | 123 | 0.636118 |
9407b0965d5f640b88dae5eb1c60ad57ba44eb75 | 954 | py | Python | python/httpclient/http1.py | erisky/my_practices | 10af209a163fb3e527b9c22c946365f1f317c07b | [
"MIT"
] | null | null | null | python/httpclient/http1.py | erisky/my_practices | 10af209a163fb3e527b9c22c946365f1f317c07b | [
"MIT"
] | null | null | null | python/httpclient/http1.py | erisky/my_practices | 10af209a163fb3e527b9c22c946365f1f317c07b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import httplib
import sys
import os
def GetStockPriceFromYahoo(stockid):
yahoo = httplib.HTTPConnection('tw.stock.yahoo.com')
req = "/q/q?s=" + str(stockid)
# print req
yahoo.request("GET", req)
resp1 = yahoo.getresponse()
#print resp1.status, resp1.reason
data1 = resp1... | 22.186047 | 56 | 0.658281 |
5d68ac42ee3f5fd17fc05cef3632173b9396681c | 1,240 | py | Python | tests/test_dataset/test_test_time_aug.py | yuexy/mmocr | 82488024db159266e66ea6b0d6f84a5a18e87362 | [
"Apache-2.0"
] | 2,261 | 2021-04-08T03:45:41.000Z | 2022-03-31T23:37:46.000Z | tests/test_dataset/test_test_time_aug.py | yuexy/mmocr | 82488024db159266e66ea6b0d6f84a5a18e87362 | [
"Apache-2.0"
] | 789 | 2021-04-08T05:40:13.000Z | 2022-03-31T09:42:39.000Z | tests/test_dataset/test_test_time_aug.py | yuexy/mmocr | 82488024db159266e66ea6b0d6f84a5a18e87362 | [
"Apache-2.0"
] | 432 | 2021-04-08T03:56:16.000Z | 2022-03-30T18:44:43.000Z | # Copyright (c) OpenMMLab. All rights reserved.
import numpy as np
import pytest
from mmocr.datasets.pipelines.test_time_aug import MultiRotateAugOCR
def test_resize_ocr():
input_img1 = np.ones((64, 256, 3), dtype=np.uint8)
input_img2 = np.ones((64, 32, 3), dtype=np.uint8)
rci = MultiRotateAugOCR(transf... | 35.428571 | 71 | 0.675 |
a317cb22f9e39dcd573ec56403f476a50335775d | 1,652 | py | Python | app/stopwatch/forms.py | zigellsn/JWConfStage | 684060562a971b2dc33fe44b7f223babd4094786 | [
"Apache-2.0"
] | null | null | null | app/stopwatch/forms.py | zigellsn/JWConfStage | 684060562a971b2dc33fe44b7f223babd4094786 | [
"Apache-2.0"
] | 1 | 2019-02-20T21:15:08.000Z | 2019-02-20T21:15:08.000Z | app/stopwatch/forms.py | zigellsn/JWConfStage | 684060562a971b2dc33fe44b7f223babd4094786 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019-2022 Simon Zigelli
#
# 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... | 44.648649 | 109 | 0.706416 |
a992d8cf9bd02c6031be3cc54ffc939d1247e2f2 | 2,835 | py | Python | sdk/appplatform/azure-mgmt-appplatform/setup.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | 1 | 2021-06-02T08:01:35.000Z | 2021-06-02T08:01:35.000Z | sdk/appplatform/azure-mgmt-appplatform/setup.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | null | null | null | sdk/appplatform/azure-mgmt-appplatform/setup.py | tzhanl/azure-sdk-for-python | 18cd03f4ab8fd76cc0498f03e80fbc99f217c96e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#----------------------------------------------------------------... | 32.215909 | 91 | 0.603175 |
35b5e045a549908bda6489419c13c5906288f20b | 8,332 | py | Python | tests/python/pants_test/engine/legacy/test_address_mapper.py | copumpkin/pants | e8367cf62279eab98f4e9e4575b9a059eeb83d2f | [
"Apache-2.0"
] | 1 | 2021-11-11T14:04:24.000Z | 2021-11-11T14:04:24.000Z | tests/python/pants_test/engine/legacy/test_address_mapper.py | copumpkin/pants | e8367cf62279eab98f4e9e4575b9a059eeb83d2f | [
"Apache-2.0"
] | null | null | null | tests/python/pants_test/engine/legacy/test_address_mapper.py | copumpkin/pants | e8367cf62279eab98f4e9e4575b9a059eeb83d2f | [
"Apache-2.0"
] | 1 | 2021-11-11T14:04:12.000Z | 2021-11-11T14:04:12.000Z | # coding=utf-8
# Copyright 2016 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import uni... | 41.044335 | 101 | 0.695151 |
833ddf8678643f8debeff3ea82eac15166922863 | 416 | py | Python | data/data.py | NonStopEagle137/image2latex | 6e5ace9357a6a059a0fe9ac853a579c15fd808ff | [
"MIT"
] | null | null | null | data/data.py | NonStopEagle137/image2latex | 6e5ace9357a6a059a0fe9ac853a579c15fd808ff | [
"MIT"
] | null | null | null | data/data.py | NonStopEagle137/image2latex | 6e5ace9357a6a059a0fe9ac853a579c15fd808ff | [
"MIT"
] | null | null | null | import tarfile
#simple function to extract the train data
#tar_file : the path to the .tar file
#path : the path where it will be extracted
def extract(tar_file, path):
opened_tar = tarfile.open(tar_file)
if tarfile.is_tarfile(tar_file):
opened_tar.extractall(path)
else:
print("The ta... | 29.714286 | 59 | 0.709135 |
2269531fac8e07d5951561bda4f9e7b862855817 | 2,081 | py | Python | FNN_skills/scripts/generate_data.py | SMZCC/TF-deep-learn | 7517685d8b4fb51f1823d4595165538305739fc7 | [
"MIT"
] | null | null | null | FNN_skills/scripts/generate_data.py | SMZCC/TF-deep-learn | 7517685d8b4fb51f1823d4595165538305739fc7 | [
"MIT"
] | null | null | null | FNN_skills/scripts/generate_data.py | SMZCC/TF-deep-learn | 7517685d8b4fb51f1823d4595165538305739fc7 | [
"MIT"
] | null | null | null | # coding=utf-8
# date: 2019/1/14, 16:08
# name: smz
import numpy as np
from FNN_skills.utils.data import gen_data
from FNN_skills.utils.data import gen_one_class_data
def generate_data():
num_classes = 4
num_fields = 2
num_samples = 320
means = np.random.rand(num_fields)
covs = np.eye(num_fields,... | 34.114754 | 108 | 0.632869 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.