hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k โ | 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 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k โ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 โ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 โ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 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.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0de0022864924ca6f24d5a7e886939a49195e1b5 | 454 | py | Python | atcoder/virtual3/b.py | sugitanishi/competitive-programming | 51af65fdce514ece12f8afbf142b809d63eefb5d | [
"MIT"
] | null | null | null | atcoder/virtual3/b.py | sugitanishi/competitive-programming | 51af65fdce514ece12f8afbf142b809d63eefb5d | [
"MIT"
] | null | null | null | atcoder/virtual3/b.py | sugitanishi/competitive-programming | 51af65fdce514ece12f8afbf142b809d63eefb5d | [
"MIT"
] | null | null | null | ##
import sys
inf=10**20
sys.setrecursionlimit(10000000)
input=lambda : sys.stdin.readline().rstrip()
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
a,b,c=map(int,input().split())
k=int(input())
count=0
while a>=b:
b*=2
count+=1
while b>=c:
c*=2
count+=1
print('Yes' if count<=k else 'N... | 19.73913 | 63 | 0.601322 | #โ๐๐๐๐๐๐๐๐โ#
import sys
import math
from math import ceil, floor
import itertools
from functools import lru_cache
from collections import deque
inf=10**20
sys.setrecursionlimit(10000000)
input=lambda : sys.stdin.readline().rstrip()
'''''โ'''''''''''''''''''''''''''''''''''''''''''''''''''''''''
a,b,c=map(int,i... | 41 | 0 | 0 | 0 | 0 | 0 | 0 | 10 | 110 |
2018ec5876e704606365c49965d342c5e5dd0ab5 | 1,648 | py | Python | Week_2/7.8-7.14_NER/NER_model.py | EricZhu-42/NJU_NLP_SummerCamp_2019 | 56571e96030162d844cf9e769b7a5a41d3e0a7bc | [
"MIT"
] | 1 | 2020-08-29T07:41:26.000Z | 2020-08-29T07:41:26.000Z | Week_2/7.8-7.14_NER/NER_model.py | EricZhu-42/NJU_NLP_SummerCamp_2019 | 56571e96030162d844cf9e769b7a5a41d3e0a7bc | [
"MIT"
] | null | null | null | Week_2/7.8-7.14_NER/NER_model.py | EricZhu-42/NJU_NLP_SummerCamp_2019 | 56571e96030162d844cf9e769b7a5a41d3e0a7bc | [
"MIT"
] | null | null | null |
BATCH_SIZE = 32
MODEL_PATH = "./model/crf.h5" | 36.622222 | 99 | 0.678398 | import pickle
import numpy as np
from keras.preprocessing.sequence import pad_sequences
from keras import Sequential
from keras_contrib.layers import CRF
from keras.layers import Embedding ,Bidirectional,LSTM
from keras.models import load_model
BATCH_SIZE = 32
MODEL_PATH = "./model/crf.h5"
class Ner:
def __init__... | 21 | 0 | 0 | 1,327 | 0 | 0 | 0 | 91 | 177 |
2d02b736665a0c38b08f9b37e0a5c8c4808e6171 | 2,676 | py | Python | seizmeia/health.py | seizmeia/seizmeia | 8bdb5f9be832c56237e5684110ce30d1c322fc70 | [
"MIT"
] | null | null | null | seizmeia/health.py | seizmeia/seizmeia | 8bdb5f9be832c56237e5684110ce30d1c322fc70 | [
"MIT"
] | 12 | 2022-02-14T00:03:28.000Z | 2022-03-29T18:08:35.000Z | seizmeia/health.py | seizmeia/seizmeia | 8bdb5f9be832c56237e5684110ce30d1c322fc70 | [
"MIT"
] | 1 | 2022-02-27T17:57:56.000Z | 2022-02-27T17:57:56.000Z | from __future__ import annotations
from fastapi import APIRouter
router = APIRouter(tags=["healthcheck"])
healthcheck: HealthCheckService = ConcurrentHealthCheck()
| 26.235294 | 79 | 0.641256 | from __future__ import annotations
import asyncio
from typing import Protocol
from fastapi import APIRouter, status
from fastapi.responses import JSONResponse, Response
class Healther(Protocol):
"""Any object implementing ^ can be checked for health status"""
async def ready(self) -> str | None:
..... | 0 | 748 | 737 | 799 | 0 | 0 | 0 | 38 | 182 |
7bb4e261db641319a2a64522deee911cbf21571d | 17,373 | py | Python | data_cleaning/2016/clarity_live.py | NewsappAJC/precinct-election-map | 8237244043cb48dcc8704a43e009711add0c6382 | [
"MIT"
] | 5 | 2017-01-21T00:18:35.000Z | 2018-01-17T23:27:16.000Z | data_cleaning/2016/clarity_live.py | NewsappAJC/precinct-election-map | 8237244043cb48dcc8704a43e009711add0c6382 | [
"MIT"
] | null | null | null | data_cleaning/2016/clarity_live.py | NewsappAJC/precinct-election-map | 8237244043cb48dcc8704a43e009711add0c6382 | [
"MIT"
] | null | null | null | # Standard lib imports
import os
import logging
# Third-party imports
# Constants
DIR = os.path.dirname(os.path.abspath(__file__))
BASE_DIR = os.path.dirname(os.path.dirname(DIR)) # Root directory of the project
# Alter for any given race on a clarityelection.com site
CONTEST_URL = 'http://results.enr.clarityelectio... | 38.952915 | 121 | 0.604098 | # Standard lib imports
from sys import argv
import os
from time import sleep
import re
import pdb
import logging
import datetime
import csv
import json
from collections import defaultdict
# Third-party imports
import pandas as pd
import requests
from selenium import webdriver
from selenium.webdriver.support.ui import ... | 0 | 0 | 0 | 15,367 | 0 | 0 | 0 | 98 | 376 |
b9d6057d2f32bba9641dd05cfd2cdaf046f67fcf | 6,736 | py | Python | code/preprocessing/p_e_m.py | kevinalexmathews/end2end_neural_el | e5fc0e7f884f9bcd9d7aaa9bd5724705cd5e3ca4 | [
"Apache-2.0"
] | 221 | 2018-09-11T07:51:09.000Z | 2022-03-30T01:37:07.000Z | code/preprocessing/p_e_m.py | kevinalexmathews/end2end_neural_el | e5fc0e7f884f9bcd9d7aaa9bd5724705cd5e3ca4 | [
"Apache-2.0"
] | 28 | 2018-09-18T16:42:21.000Z | 2022-02-22T09:48:35.000Z | code/preprocessing/p_e_m.py | kevinalexmathews/end2end_neural_el | e5fc0e7f884f9bcd9d7aaa9bd5724705cd5e3ca4 | [
"Apache-2.0"
] | 73 | 2018-09-12T10:02:23.000Z | 2022-02-24T21:27:57.000Z | from collections import defaultdict
from nltk.tokenize import word_tokenize
import preprocessing.config as config
import preprocessing.util as util
# TODO delete this one, no longer usefull since there is another one that also handles the conflicts
def tokenize_p_e_m():
'''
tokenizes the mention of the p(e|m... | 42.904459 | 100 | 0.582096 | import pickle
from collections import defaultdict
from nltk.tokenize import word_tokenize
import time
import sys
import os
import operator
import preprocessing.config as config
import preprocessing.util as util
# TODO delete this one, no longer usefull since there is another one that also handles the conflicts
def t... | 0 | 0 | 0 | 0 | 0 | 1,883 | 0 | -47 | 156 |
0ad7d27ad8f383f2b746a9d6365723541b71aef1 | 6,753 | py | Python | parsl/executors/ipp_controller.py | khurtado/parsl | 6ea461ccd7be83b51bf5384bf50b522e56fc46f1 | [
"Apache-2.0"
] | null | null | null | parsl/executors/ipp_controller.py | khurtado/parsl | 6ea461ccd7be83b51bf5384bf50b522e56fc46f1 | [
"Apache-2.0"
] | null | null | null | parsl/executors/ipp_controller.py | khurtado/parsl | 6ea461ccd7be83b51bf5384bf50b522e56fc46f1 | [
"Apache-2.0"
] | null | null | null | import logging
logger = logging.getLogger(__name__)
| 40.437126 | 123 | 0.590552 | import logging
import os
import random
import signal
import subprocess
import time
from parsl.executors.errors import *
from parsl.utils import RepresentationMixin
logger = logging.getLogger(__name__)
class Controller(RepresentationMixin):
"""Start and maintain a IPythonParallel controller.
Parameters
... | 0 | 794 | 0 | 5,732 | 0 | 0 | 0 | -5 | 178 |
576e9899bbf1c5f044901aecaba091c579a85a66 | 272 | py | Python | lexirumah/assets.py | lessersunda/lexibank | a5fe1d925e9b1005cf1c97cc2111a9053f321973 | [
"Apache-2.0"
] | 1 | 2019-05-17T08:01:23.000Z | 2019-05-17T08:01:23.000Z | lexirumah/assets.py | lessersunda/lexibank | a5fe1d925e9b1005cf1c97cc2111a9053f321973 | [
"Apache-2.0"
] | 32 | 2018-01-11T14:23:39.000Z | 2022-01-27T16:22:30.000Z | lexirumah/assets.py | lessersunda/lexirumah | a5fe1d925e9b1005cf1c97cc2111a9053f321973 | [
"Apache-2.0"
] | null | null | null | from clld.web.assets import environment
from clldutils.path import Path
import lexirumah
environment.append_path(
Path(lexirumah.__file__).parent.joinpath('static').as_posix(), url='/lexirumah:static/')
environment.load_path = list(reversed(environment.load_path))
| 27.2 | 92 | 0.797794 | from clld.web.assets import environment
from clldutils.path import Path
import lexirumah
environment.append_path(
Path(lexirumah.__file__).parent.joinpath('static').as_posix(), url='/lexirumah:static/')
environment.load_path = list(reversed(environment.load_path))
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
db50631d59eea954f674d0eedb2cb2dbbdc73bd3 | 13,111 | py | Python | sktime/classification/dictionary_based/_muse.py | FilipBronic/sktime | d613d704cdc7263ad28fb4519d2d301f2ebd0779 | [
"BSD-3-Clause"
] | null | null | null | sktime/classification/dictionary_based/_muse.py | FilipBronic/sktime | d613d704cdc7263ad28fb4519d2d301f2ebd0779 | [
"BSD-3-Clause"
] | 2 | 2021-04-19T17:38:33.000Z | 2021-07-25T18:44:10.000Z | sktime/classification/dictionary_based/_muse.py | FilipBronic/sktime | d613d704cdc7263ad28fb4519d2d301f2ebd0779 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""WEASEL+MUSE classifier.
multivariate dictionary based classifier based on SFA transform, dictionaries
and logistic regression.
"""
__author__ = ["patrickzib", "BINAYKUMAR943"]
__all__ = ["MUSE"]
| 35.627717 | 88 | 0.58981 | # -*- coding: utf-8 -*-
"""WEASEL+MUSE classifier.
multivariate dictionary based classifier based on SFA transform, dictionaries
and logistic regression.
"""
__author__ = ["patrickzib", "BINAYKUMAR943"]
__all__ = ["MUSE"]
import math
import warnings
import numpy as np
from numba import njit
from sklearn.feature_ext... | 2 | 172 | 0 | 12,195 | 0 | 0 | 0 | 228 | 290 |
3843368e971e8bc60258ee094193bd6ed9309f87 | 7,986 | py | Python | src/python/views/demo_01_fancy/__init__.py | graphistry/streamlit-graphkit | 4122b36fac23879d52dec4f691ab94b71245e054 | [
"BSD-3-Clause"
] | null | null | null | src/python/views/demo_01_fancy/__init__.py | graphistry/streamlit-graphkit | 4122b36fac23879d52dec4f691ab94b71245e054 | [
"BSD-3-Clause"
] | null | null | null | src/python/views/demo_01_fancy/__init__.py | graphistry/streamlit-graphkit | 4122b36fac23879d52dec4f691ab94b71245e054 | [
"BSD-3-Clause"
] | null | null | null | from components import URLParam
from util import getChild
############################################
#
# DASHBOARD SETTINGS
#
############################################
# Controls how entrypoint.py picks it up
app_id = 'app_01'
logger = getChild(app_id)
urlParams = URLParam(app_id)
#######################... | 31.690476 | 116 | 0.573003 | import graphistry, os, pandas as pd, streamlit as st
from components import GraphistrySt, URLParam
from graphistry import PyGraphistry
from css import all_css
from time import sleep
from util import getChild
############################################
#
# DASHBOARD SETTINGS
#
#######################################... | 0 | 1,211 | 0 | 0 | 0 | 5,155 | 0 | 62 | 271 |
30846cabd5dcb36987c9366eb4e4e4a199ed4f23 | 6,342 | py | Python | recipe_system/cal_service/__init__.py | DBerke/DRAGONS | cecf9a03970af95126bd17a227bd5214a5d6c64b | [
"BSD-3-Clause"
] | 19 | 2017-10-23T14:52:51.000Z | 2022-03-28T04:49:00.000Z | recipe_system/cal_service/__init__.py | DBerke/DRAGONS | cecf9a03970af95126bd17a227bd5214a5d6c64b | [
"BSD-3-Clause"
] | 194 | 2017-11-01T17:32:45.000Z | 2022-03-31T21:32:59.000Z | recipe_system/cal_service/__init__.py | DBerke/DRAGONS | cecf9a03970af95126bd17a227bd5214a5d6c64b | [
"BSD-3-Clause"
] | 16 | 2017-11-01T05:18:04.000Z | 2021-12-14T23:08:57.000Z | #
# DRAGONS
#
# cal_service
# ------------------------------------------------------------------------------
from os import path
import warnings
from importlib import import_module
... | 33.03125 | 80 | 0.574109 | #
# DRAGONS
#
# cal_service
# ------------------------------------------------------------------------------
from os import path
import warnings
from importlib import import_module
... | 0 | 0 | 0 | 0 | 0 | 232 | 0 | 0 | 23 |
403abd62f485778bb2109fd5776fc5011fbb8411 | 1,675 | py | Python | tests/basics/builtin_property.py | peterson79/pycom-micropython-sigfox | 3f93fc2c02567c96f18cff4af9125db8fd7a6fb4 | [
"MIT"
] | 37 | 2017-12-07T15:49:29.000Z | 2022-03-16T16:01:38.000Z | tests/basics/builtin_property.py | peterson79/pycom-micropython-sigfox | 3f93fc2c02567c96f18cff4af9125db8fd7a6fb4 | [
"MIT"
] | 27 | 2015-01-02T16:17:37.000Z | 2015-09-07T19:21:26.000Z | tests/basics/builtin_property.py | peterson79/pycom-micropython-sigfox | 3f93fc2c02567c96f18cff4af9125db8fd7a6fb4 | [
"MIT"
] | 22 | 2016-08-01T01:35:30.000Z | 2022-03-22T18:12:23.000Z | # test builtin property
# create a property object explicitly
property()
property(1, 2, 3)
# use its accessor methods
p = property()
p.getter(1)
p.setter(2)
p.deleter(3)
# basic use as a decorator
a = A(1)
print(a.x)
try:
a.x = 2
except AttributeError:
print("AttributeError")
# explicit use within a class... | 16.262136 | 73 | 0.59403 | # test builtin property
# create a property object explicitly
property()
property(1, 2, 3)
# use its accessor methods
p = property()
p.getter(1)
p.setter(2)
p.deleter(3)
# basic use as a decorator
class A:
def __init__(self, x):
self._x = x
@property
def x(self):
print("x get")
r... | 0 | 190 | 0 | 622 | 0 | 0 | 0 | 0 | 110 |
53666bb3429802efc730fbf035ba1d2908726f6b | 1,525 | py | Python | prescience_client/bean/model_metric/base.py | ovh/prescience-client | a447d19f11c6739c4a4828b6072e80b39dc4cf13 | [
"BSD-3-Clause"
] | 15 | 2019-01-16T14:16:00.000Z | 2021-12-08T09:09:24.000Z | prescience_client/bean/model_metric/base.py | ovh/prescience-client | a447d19f11c6739c4a4828b6072e80b39dc4cf13 | [
"BSD-3-Clause"
] | 4 | 2019-03-28T15:12:46.000Z | 2019-11-20T10:47:37.000Z | prescience_client/bean/model_metric/base.py | ovh/prescience-client | a447d19f11c6739c4a4828b6072e80b39dc4cf13 | [
"BSD-3-Clause"
] | 1 | 2019-01-25T07:22:12.000Z | 2019-01-25T07:22:12.000Z | # Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# Copyright 2019 The Prescience-Client Authors. All rights reserved.
| 31.122449 | 104 | 0.702295 | # Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
# Copyright 2019 The Prescience-Client Authors. All rights reserved.
import copy
from abc import ABC, abstractmethod
from prescience_client.utils.table_printable import TablePrintable, DictPrintable
from prescience_c... | 0 | 138 | 0 | 998 | 0 | 0 | 0 | 104 | 113 |
601b6896b9e2ecf5a68936a6996c6c9d69d835fe | 2,405 | py | Python | zcommon/classes.py | LamaAni/zcommon.py | 4d2df1d431638edc439fff09981a0458c3a8dea8 | [
"MIT"
] | null | null | null | zcommon/classes.py | LamaAni/zcommon.py | 4d2df1d431638edc439fff09981a0458c3a8dea8 | [
"MIT"
] | null | null | null | zcommon/classes.py | LamaAni/zcommon.py | 4d2df1d431638edc439fff09981a0458c3a8dea8 | [
"MIT"
] | null | null | null | # FROM: https://gist.github.com/Skinner927/413c0e9cc8433123f426832f9fe8d931
| 33.873239 | 111 | 0.648233 | # FROM: https://gist.github.com/Skinner927/413c0e9cc8433123f426832f9fe8d931
class ClassPropertyMeta(type):
def __setattr__(self, key, value):
obj = self.__dict__.get(key, None)
if type(obj) is classproperty:
return obj.__set__(self, value)
return super().__setattr__(key, value)... | 0 | 383 | 0 | 1,898 | 0 | 0 | 0 | 0 | 46 |
85ec61b3316086cf065d79bb886447aaa0b0f109 | 258 | py | Python | range.py | jiayoustone/high_performance_python | 63abb5e02bdbf086229b682b1768ed3afc63d8bb | [
"RSA-MD"
] | null | null | null | range.py | jiayoustone/high_performance_python | 63abb5e02bdbf086229b682b1768ed3afc63d8bb | [
"RSA-MD"
] | null | null | null | range.py | jiayoustone/high_performance_python | 63abb5e02bdbf086229b682b1768ed3afc63d8bb | [
"RSA-MD"
] | null | null | null |
if __name__ == "__main__":
call()
| 16.125 | 31 | 0.577519 | @profile
def range(start, stop, step=1):
numbers = []
while start < stop:
numbers.append(start)
start += step
return numbers
@profile
def call():
for i in range(1,1000000):
pass
if __name__ == "__main__":
call()
| 0 | 174 | 0 | 0 | 0 | 0 | 0 | 0 | 45 |
092afed4e5d9ecf2f3e8f3c071a55560443a932d | 442 | py | Python | start.py | jonathanwelton/Teams-Presence | d8192cde33079f4bf199455e2db58c7f7e2bb13e | [
"MIT"
] | 5 | 2021-01-31T11:50:32.000Z | 2022-01-07T15:34:27.000Z | start.py | jonathanwelton/Teams-Presence | d8192cde33079f4bf199455e2db58c7f7e2bb13e | [
"MIT"
] | null | null | null | start.py | jonathanwelton/Teams-Presence | d8192cde33079f4bf199455e2db58c7f7e2bb13e | [
"MIT"
] | 1 | 2022-02-01T01:52:05.000Z | 2022-02-01T01:52:05.000Z | print("Please select which presence indicator to wish to use...")
print("Press 1 to run the Teams Presence Indicator")
print("Press 2 to run the Zoom Presence Indicator")
choice = input("Indicator: ")
if choice == '1':
print("Starting the Teams Presence Indicator...")
import teamsPresence
teamsPresence.run... | 29.466667 | 65 | 0.705882 | print("Please select which presence indicator to wish to use...")
print("Press 1 to run the Teams Presence Indicator")
print("Press 2 to run the Zoom Presence Indicator")
choice = input("Indicator: ")
if choice == '1':
print("Starting the Teams Presence Indicator...")
import teamsPresence
teamsPresence.run... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
41d294ae7cae8813561e29ee9e8e19f04973da6c | 259 | py | Python | pair/__init__.py | tumluliu/air-analyzer | a9b81f05fb2e69ac6af10c8400bc2a6b800be889 | [
"MIT"
] | null | null | null | pair/__init__.py | tumluliu/air-analyzer | a9b81f05fb2e69ac6af10c8400bc2a6b800be889 | [
"MIT"
] | null | null | null | pair/__init__.py | tumluliu/air-analyzer | a9b81f05fb2e69ac6af10c8400bc2a6b800be889 | [
"MIT"
] | null | null | null | """ module init """
__title__ = 'pair'
__version__ = '0.1.0'
__author__ = 'LIU Lu'
__contact__ = 'nudtlliu@gmail.com'
__license__ = 'MIT'
__all__ = [
'base', 'servicefactory', 'mapbox', 'ors', 'google'
]
| 21.583333 | 55 | 0.687259 | """ module init """
__title__ = 'pair'
__version__ = '0.1.0'
__author__ = 'LIU Lu'
__contact__ = 'nudtlliu@gmail.com'
__license__ = 'MIT'
__all__ = [
'base', 'servicefactory', 'mapbox', 'ors', 'google'
]
from .servicefactory import RoutingServiceFactory
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 28 | 23 |
f84bce7307f7f6c776e3a902fc6513a873a7d89e | 2,462 | py | Python | cgtools/array_utils.py | tneumann/cgtools | 8f77b6a4642fe79ac85b8449ebd3f72ea0e56032 | [
"MIT"
] | 10 | 2019-05-02T14:08:32.000Z | 2021-03-15T16:07:19.000Z | cgtools/array_utils.py | tneumann/cgtools | 8f77b6a4642fe79ac85b8449ebd3f72ea0e56032 | [
"MIT"
] | null | null | null | cgtools/array_utils.py | tneumann/cgtools | 8f77b6a4642fe79ac85b8449ebd3f72ea0e56032 | [
"MIT"
] | 3 | 2019-05-02T14:08:33.000Z | 2021-02-10T03:47:29.000Z | import numpy as np
def concatenate_fill(arrays, axis=0, fill_value=None):
"""
Appends to all the arrays so that they can be concatenated along the given axis (kwargs axis=0 by default).
The fill_value will be automatically determined from the dtype of arrays. For floating point types of arrays
it will ... | 38.46875 | 147 | 0.610073 | import numpy as np
def concatenate_fill(arrays, axis=0, fill_value=None):
"""
Appends to all the arrays so that they can be concatenated along the given axis (kwargs axis=0 by default).
The fill_value will be automatically determined from the dtype of arrays. For floating point types of arrays
it will ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f7abc4036e6849052f1ad734c829603c8746cd22 | 237 | py | Python | data/ck/check_data.py | jorgimello/meta-learning-fer | 793610ae8471f794a6837930d8bb51866c1f7c02 | [
"MIT"
] | 4 | 2020-10-10T03:33:15.000Z | 2022-01-17T08:00:32.000Z | data/ck/check_data.py | jorgimello/meta-learning-facial-expression-recognition | 793610ae8471f794a6837930d8bb51866c1f7c02 | [
"MIT"
] | null | null | null | data/ck/check_data.py | jorgimello/meta-learning-facial-expression-recognition | 793610ae8471f794a6837930d8bb51866c1f7c02 | [
"MIT"
] | null | null | null | import numpy as np
import cv2
imgs = np.load('test_set_ck_extended_no_resize.npy')
lbls = np.load('test_labels_ck_extended_no_resize.npy')
for i in range(imgs.shape[0]):
print (lbls[i])
cv2.imshow('img', imgs[i])
cv2.waitKey(0)
| 21.545455 | 55 | 0.734177 | import numpy as np
import os, cv2
imgs = np.load('test_set_ck_extended_no_resize.npy')
lbls = np.load('test_labels_ck_extended_no_resize.npy')
for i in range(imgs.shape[0]):
print (lbls[i])
cv2.imshow('img', imgs[i])
cv2.waitKey(0)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 0 |
8bf24394c07c598dee798fcca291ed904ac4af54 | 359 | py | Python | hacker/arrays-left-rotation.py | jdc91/competitive-programming | c09c446681e707914438d6af8307ee9877396ceb | [
"MIT"
] | null | null | null | hacker/arrays-left-rotation.py | jdc91/competitive-programming | c09c446681e707914438d6af8307ee9877396ceb | [
"MIT"
] | null | null | null | hacker/arrays-left-rotation.py | jdc91/competitive-programming | c09c446681e707914438d6af8307ee9877396ceb | [
"MIT"
] | null | null | null |
n, k = map(int, raw_input().strip().split(' '))
a = map(int, raw_input().strip().split(' '))
array_left_rotation(a, n, k);
answer = array_left_rotation(a, n, k);
print ' '.join(map(str, answer))
| 23.933333 | 47 | 0.610028 | def array_left_rotation(a, n, k):
rotations = k % n
container = [0]*n
for i in range(n):
container[i-rotations] = a[i]
return container
n, k = map(int, raw_input().strip().split(' '))
a = map(int, raw_input().strip().split(' '))
array_left_rotation(a, n, k);
answer = array_left_rotation(a, n,... | 0 | 0 | 0 | 0 | 0 | 139 | 0 | 0 | 22 |
492d04b42c9c247a16f5dde5b663aa28b483f540 | 326 | py | Python | socialite/preprocess/verify_all_out.py | Wangqge/PowerLog_ae | 8546afbcb9a77d516e8c3f0dfbaf2041a4b888f9 | [
"Apache-2.0"
] | null | null | null | socialite/preprocess/verify_all_out.py | Wangqge/PowerLog_ae | 8546afbcb9a77d516e8c3f0dfbaf2041a4b888f9 | [
"Apache-2.0"
] | null | null | null | socialite/preprocess/verify_all_out.py | Wangqge/PowerLog_ae | 8546afbcb9a77d516e8c3f0dfbaf2041a4b888f9 | [
"Apache-2.0"
] | null | null | null | import sys
if len(sys.argv) != 2:
print 'usage: [input edge pair path]'
exit(1)
node_set = set()
with open(sys.argv[1], 'r') as fi:
for line in fi:
line = line.strip('\n').strip('\r')
tmp = line.split('\t')
src = int(tmp[0])
node_set.add(src)
print 'node size: %d' % len(node... | 23.285714 | 43 | 0.54908 | import sys
if len(sys.argv) != 2:
print 'usage: [input edge pair path]'
exit(1)
node_set = set()
with open(sys.argv[1], 'r') as fi:
for line in fi:
line = line.strip('\n').strip('\r')
tmp = line.split('\t')
src = int(tmp[0])
node_set.add(src)
print 'node size: %d' % len(node... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
40c32c97fffb2b758dc89882f8844f0e98182d7e | 8,950 | py | Python | integration-testing/casperlabs_local_net/docker_base.py | RitaatCasperLabs/CasperLabs | a81ce10078664d7ef68f4c55157b9afc5be45f3a | [
"Apache-2.0"
] | 1 | 2020-01-15T08:33:56.000Z | 2020-01-15T08:33:56.000Z | integration-testing/casperlabs_local_net/docker_base.py | mpapierski/CasperLabs | 1f8741f8ef28447f87f3844784b3c4291041df3b | [
"Apache-2.0"
] | 15 | 2019-05-03T17:41:49.000Z | 2020-03-17T16:54:45.000Z | integration-testing/casperlabs_local_net/docker_base.py | arcolife/CasperLabs | 91f839ff262dd7eae4d862a0501a05f1ab7c59f8 | [
"Apache-2.0"
] | null | null | null | import json
def humanify(line):
"""
Decode json dump of execution engine's structured log and render a human friendly line,
containing, together with prefix rendered by the Python test framework, all useful
information. The original dictionary in the EE structured log looks like follows:
{'ti... | 34.824903 | 443 | 0.652961 | import json
import logging
import os
import threading
from multiprocessing import Process, Queue
from queue import Empty
from typing import Tuple, Union
from docker import DockerClient
from docker.models.containers import Container
from casperlabs_local_net.errors import CommandTimeoutError, NonZeroExitCodeError
from ... | 0 | 1,746 | 0 | 5,756 | 0 | 0 | 0 | 142 | 290 |
13a93bffb50761b615a57531dd4e8f2370955a86 | 9,167 | py | Python | server/metrics/generate_docs.py | boost-entropy-golang/buildbuddy | 08f649f792b1bd5854fd0bb5eb1a12642330d678 | [
"MIT"
] | 315 | 2020-03-04T20:59:09.000Z | 2022-03-31T01:59:04.000Z | server/metrics/generate_docs.py | boost-entropy-golang/buildbuddy | 08f649f792b1bd5854fd0bb5eb1a12642330d678 | [
"MIT"
] | 338 | 2020-03-05T08:29:51.000Z | 2022-03-30T01:06:08.000Z | server/metrics/generate_docs.py | boost-entropy-golang/buildbuddy | 08f649f792b1bd5854fd0bb5eb1a12642330d678 | [
"MIT"
] | 50 | 2020-03-05T06:35:31.000Z | 2022-03-26T15:22:10.000Z | #!/usr/bin/env python3
GENERATED_FILE_NAME = "prometheus-metrics.md"
FILE_HEADER = """<!--
{
"name": "Prometheus Metrics",
"category": "5fcfd1ede5ded705a0bf5fd0",
"priority": 1000
}
-->
<!--
============================
GENERATED FILE - DO NOT EDIT
============================
Run `python3 server/metrics/gen... | 31.940767 | 119 | 0.498091 | #!/usr/bin/env python3
import os
import re
import shlex
import subprocess
import sys
GENERATED_FILE_NAME = "prometheus-metrics.md"
FILE_HEADER = """<!--
{
"name": "Prometheus Metrics",
"category": "5fcfd1ede5ded705a0bf5fd0",
"priority": 1000
}
-->
<!--
============================
GENERATED FILE - DO NOT EDI... | 0 | 0 | 0 | 7,298 | 0 | 935 | 0 | -48 | 203 |
f2ef46880085acd4b1a17813b497ed6b82cfe449 | 265 | py | Python | example/django/myapp/urls.py | Ax1an/uptrace | 40725435ac3cab751117413d5a9fd3dede6a2e3c | [
"Apache-2.0"
] | 627 | 2021-12-25T10:20:39.000Z | 2022-03-30T16:09:36.000Z | example/django/myapp/urls.py | Ax1an/uptrace | 40725435ac3cab751117413d5a9fd3dede6a2e3c | [
"Apache-2.0"
] | 13 | 2021-12-29T09:50:39.000Z | 2022-03-31T09:50:56.000Z | example/django/myapp/urls.py | Ax1an/uptrace | 40725435ac3cab751117413d5a9fd3dede6a2e3c | [
"Apache-2.0"
] | 35 | 2021-12-27T11:07:53.000Z | 2022-03-19T07:00:39.000Z | from django.urls import path
from . import views
urlpatterns = [
path("", views.IndexView.as_view(), name="index"),
path("hello/<str:username>", views.HelloView.as_view(), name="hello"),
path("failing", views.FailingView.as_view(), name="failing"),
]
| 26.5 | 74 | 0.675472 | from django.urls import path
from . import views
urlpatterns = [
path("", views.IndexView.as_view(), name="index"),
path("hello/<str:username>", views.HelloView.as_view(), name="hello"),
path("failing", views.FailingView.as_view(), name="failing"),
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1dc7d92b9906065a8ceb605e13977e49113ed25e | 3,158 | py | Python | src/data_interface/model.py | ericdaat/notflix | 0d8697e13f28d658d6777b7c854e4fd0b207ca11 | [
"MIT"
] | null | null | null | src/data_interface/model.py | ericdaat/notflix | 0d8697e13f28d658d6777b7c854e4fd0b207ca11 | [
"MIT"
] | 1 | 2022-01-20T16:48:50.000Z | 2022-01-20T16:48:50.000Z | src/data_interface/model.py | ericdaat/notflix | 0d8697e13f28d658d6777b7c854e4fd0b207ca11 | [
"MIT"
] | null | null | null | from flask_sqlalchemy import SQLAlchemy
db = SQLAlchemy()
| 29.792453 | 78 | 0.700127 | import os
import logging
from sqlalchemy_utils import database_exists, create_database
from datetime import datetime
from sqlalchemy.dialects import postgresql
from flask_sqlalchemy import SQLAlchemy
from config import SQLALCHEMY_DATABASE_URI
db = SQLAlchemy()
def init():
if not database_exists(SQLALCHEMY_DATAB... | 0 | 0 | 0 | 2,170 | 0 | 485 | 0 | 71 | 362 |
a9a9c487315ca7fd2bd769a72cb0090237b1e49b | 1,159 | py | Python | face_and_eye_detection.py | aquib-sh/opencv | 0793cfc9ce1b7acd58f983108978b358a911b1e6 | [
"CC0-1.0"
] | null | null | null | face_and_eye_detection.py | aquib-sh/opencv | 0793cfc9ce1b7acd58f983108978b358a911b1e6 | [
"CC0-1.0"
] | null | null | null | face_and_eye_detection.py | aquib-sh/opencv | 0793cfc9ce1b7acd58f983108978b358a911b1e6 | [
"CC0-1.0"
] | null | null | null | # Capture multi video from webcam
# Display the frame 4 times on canvas
import cv2
# 0 means 1st webcam
cap = cv2.VideoCapture(0)
face_cascade = cv2.CascadeClassifier(
cv2.data.haarcascades + "haarcascade_frontalface_default.xml")
eye_cascade = cv2.CascadeClassifier(
cv2.data.haarcascades + "haarcasc... | 23.18 | 71 | 0.529767 | # Capture multi video from webcam
# Display the frame 4 times on canvas
import numpy
import cv2
# 0 means 1st webcam
cap = cv2.VideoCapture(0)
face_cascade = cv2.CascadeClassifier(
cv2.data.haarcascades + "haarcascade_frontalface_default.xml")
eye_cascade = cv2.CascadeClassifier(
cv2.data.haarcascad... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -9 | 23 |
fcc44e3d996804365e318ea1ce859065b96ac86e | 1,115 | py | Python | src/test_items_setup.py | dciliberto/DarkSoulsItemRandomizer | 433ee7d1b0345e4ce9e3da1cff6e809ed7b22ece | [
"MIT"
] | null | null | null | src/test_items_setup.py | dciliberto/DarkSoulsItemRandomizer | 433ee7d1b0345e4ce9e3da1cff6e809ed7b22ece | [
"MIT"
] | null | null | null | src/test_items_setup.py | dciliberto/DarkSoulsItemRandomizer | 433ee7d1b0345e4ce9e3da1cff6e809ed7b22ece | [
"MIT"
] | null | null | null | import unittest
if __name__ == "__main__":
unittest.main()
| 33.787879 | 76 | 0.678027 | import items_setup
import unittest
class boss_weapon_list_helper_unit_tests(unittest.TestCase):
def setUp(self):
self.boss_weapon_list_instance = items_setup.boss_weapon_list_helper
def tearDown(self):
return super().tearDown()
class list_of_five(boss_weapon_list_helper_unit_tests):
def ru... | 0 | 0 | 0 | 917 | 0 | 0 | 0 | -3 | 137 |
b42125020b8ae14bf0f539310fc68868f1f3f8da | 1,390 | py | Python | Projects/Online Workouts/w3resource/Lambda/program-9.py | ivenpoker/Python-Projects | 2975e1bd687ec8dbcc7a4842c13466cb86292679 | [
"MIT"
] | 1 | 2019-09-23T15:51:45.000Z | 2019-09-23T15:51:45.000Z | Projects/Online Workouts/w3resource/Lambda/program-9.py | ivenpoker/Python-Projects | 2975e1bd687ec8dbcc7a4842c13466cb86292679 | [
"MIT"
] | 5 | 2021-02-08T20:47:19.000Z | 2022-03-12T00:35:44.000Z | Projects/Online Workouts/w3resource/Lambda/program-9.py | ivenpoker/Python-Projects | 2975e1bd687ec8dbcc7a4842c13466cb86292679 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
############################################################################################
# #
# Program purpose: Checks whether a given string is number or not using Lambda. #
# Program ... | 40.882353 | 92 | 0.425899 | #!/usr/bin/env python3
############################################################################################
# #
# Program purpose: Checks whether a given string is number or not using Lambda. #
# Program ... | 0 | 0 | 0 | 0 | 0 | 422 | 0 | 6 | 69 |
2c66a36d659ad8c767eeaa13a94c48b998f80676 | 671 | py | Python | heroku_api/commands.py | Nicholas-Chong/COVID-19-Twitter-Bot | 6ffda538e429250d6daf9585926385c379757a12 | [
"MIT"
] | 4 | 2020-07-22T04:03:00.000Z | 2021-01-04T16:00:40.000Z | heroku_api/commands.py | Nicholas-Chong/COVID-19-Twitter-Bot | 6ffda538e429250d6daf9585926385c379757a12 | [
"MIT"
] | 1 | 2020-08-01T14:30:50.000Z | 2020-08-01T17:53:56.000Z | heroku_api/commands.py | Nicholas-Chong/COVID-19-Twitter-Bot | 6ffda538e429250d6daf9585926385c379757a12 | [
"MIT"
] | 1 | 2020-08-13T21:20:37.000Z | 2020-08-13T21:20:37.000Z | '''----------------------------------------------------------------------------
Name: Heroku API Commands (commands.py)
Purpose: To setup a connection with the Heroku API and denote functions
that carry out various tasks.
Author: Nicholas Chong
Created: 2020-06-24 (YYYY/MM/DD)
-------... | 30.5 | 79 | 0.518629 | '''----------------------------------------------------------------------------
Name: Heroku API Commands (commands.py)
Purpose: To setup a connection with the Heroku API and denote functions
that carry out various tasks.
Author: Nicholas Chong
Created: 2020-06-24 (YYYY/MM/DD)
-------... | 0 | 0 | 0 | 0 | 0 | 170 | 0 | -26 | 91 |
d86d88f387457a805ced5a7869758e8ddbad9ff0 | 490 | py | Python | pyXcode/__init__.py | samdmarshall/pyXcode | 5898ec4ad7d02f2d92d80eac78b9fc0746da600d | [
"BSD-3-Clause"
] | 8 | 2015-10-31T23:05:35.000Z | 2016-05-16T16:16:02.000Z | pyXcode/__init__.py | samdmarshall/pyXcode | 5898ec4ad7d02f2d92d80eac78b9fc0746da600d | [
"BSD-3-Clause"
] | null | null | null | pyXcode/__init__.py | samdmarshall/pyXcode | 5898ec4ad7d02f2d92d80eac78b9fc0746da600d | [
"BSD-3-Clause"
] | null | null | null | from Helpers import Logger
from Helpers import xcrun
# This is initial setup that should be done so the xcrun helper module doesn't have to be used everywhere.
import os
DEVELOPER_DIR = os.environ.get('DEVELOPER_DIR')
if DEVELOPER_DIR:
Logger.write().info('DEVELOPER_DIR environment variable is already set, existin... | 32.666667 | 129 | 0.783673 | from Helpers import Logger
from Helpers import xcrun
# This is initial setup that should be done so the xcrun helper module doesn't have to be used everywhere.
import os
DEVELOPER_DIR = os.environ.get('DEVELOPER_DIR')
if DEVELOPER_DIR:
Logger.write().info('DEVELOPER_DIR environment variable is already set, existin... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -15 | 67 |
5067957a6efe04c700e833bf13298b47e397c6f1 | 1,571 | py | Python | Q/questionnaire/signals/signals_sites.py | ES-DOC/esdoc-questionnaire | 9301eda375c4046323265b37ba96d94c94bf8b11 | [
"MIT"
] | null | null | null | Q/questionnaire/signals/signals_sites.py | ES-DOC/esdoc-questionnaire | 9301eda375c4046323265b37ba96d94c94bf8b11 | [
"MIT"
] | 477 | 2015-01-07T18:22:27.000Z | 2017-07-17T15:05:48.000Z | Q/questionnaire/signals/signals_sites.py | ES-DOC/esdoc-questionnaire | 9301eda375c4046323265b37ba96d94c94bf8b11 | [
"MIT"
] | null | null | null | ####################
# ES-DOC CIM Questionnaire
# Copyright (c) 2017 ES-DOC. All rights reserved.
#
# University of Colorado, Boulder
# http://cires.colorado.edu/
#
# This project is distributed according to the terms of the MIT license [http://www.opensource.org/licenses/MIT].
####################
__author_... | 35.704545 | 117 | 0.681095 | ####################
# ES-DOC CIM Questionnaire
# Copyright (c) 2017 ES-DOC. All rights reserved.
#
# University of Colorado, Boulder
# http://cires.colorado.edu/
#
# This project is distributed according to the terms of the MIT license [http://www.opensource.org/licenses/MIT].
####################
__author_... | 0 | 803 | 0 | 0 | 0 | 0 | 0 | 124 | 112 |
5df9f80ef70a0cb558aede7f6ac4f02766074b5e | 3,181 | py | Python | infer_spleen.py | vanziaa/aHVPG | 886b4b0efee30f1beb079b0226f46e4dd1919594 | [
"MIT"
] | null | null | null | infer_spleen.py | vanziaa/aHVPG | 886b4b0efee30f1beb079b0226f46e4dd1919594 | [
"MIT"
] | null | null | null | infer_spleen.py | vanziaa/aHVPG | 886b4b0efee30f1beb079b0226f46e4dd1919594 | [
"MIT"
] | null | null | null | import os
from time import time
import torch
import torch.nn.functional as F
import numpy as np
import SimpleITK as sitk
import scipy.ndimage as ndimage
from net.ResUnet_dice import Net
os.environ['CUDA_VISIBLE_DEVICES'] = '1'
val_ct_dir = './Path of original images/'
#val_seg_dir = './Training/GT/'
organ_pred_di... | 24.851563 | 111 | 0.653568 | import os
from time import time
import torch
import torch.nn.functional as F
import numpy as np
import SimpleITK as sitk
import xlsxwriter as xw
import scipy.ndimage as ndimage
from net.ResUnet_dice import Net
os.environ['CUDA_VISIBLE_DEVICES'] = '1'
val_ct_dir = './Path of original images/'
#val_seg_dir = './Trai... | 33 | 0 | 0 | 0 | 0 | 0 | 0 | 2 | 22 |
1054fef9cea14c90edd5a63284f97ea508a33e73 | 4,161 | py | Python | tests/test_main.py | coreygirard/foldr | ac6894c02a8a5a3f40bdec2c5bd7895182b807ba | [
"MIT"
] | 1 | 2018-07-12T19:05:32.000Z | 2018-07-12T19:05:32.000Z | tests/test_main.py | coreygirard/foldr | ac6894c02a8a5a3f40bdec2c5bd7895182b807ba | [
"MIT"
] | null | null | null | tests/test_main.py | coreygirard/foldr | ac6894c02a8a5a3f40bdec2c5bd7895182b807ba | [
"MIT"
] | null | null | null | from hypothesis.strategies import (from_regex, just, recursive)
strat_codeline = from_regex(r"\A[a-z]{3}\Z")
strat_nochildren = just([])
strat_children = recursive(strat_nochildren, f)
| 23.24581 | 87 | 0.461908 | import doctest
import unittest
from hypothesis import given
from hypothesis.strategies import (builds, from_regex, integers, just, lists,
recursive, tuples)
from src.main import *
def test__from_list():
data = [(0, "aaa"), (1, "bbb"), (2, "ccc"), (1, "ddd"), (2, "eee"), (2, "f... | 0 | 323 | 0 | 102 | 0 | 3,130 | 0 | 63 | 343 |
9fac3347b412379b1b262cadfb11da00e80b26bc | 8,795 | py | Python | infirunner/watch.py | zh217/infirunner | ceb4b7b3a7ca9c080d537f2e601d1be197e27395 | [
"MIT"
] | 1 | 2020-01-15T02:52:04.000Z | 2020-01-15T02:52:04.000Z | infirunner/watch.py | zh217/infirunner | ceb4b7b3a7ca9c080d537f2e601d1be197e27395 | [
"MIT"
] | null | null | null | infirunner/watch.py | zh217/infirunner | ceb4b7b3a7ca9c080d537f2e601d1be197e27395 | [
"MIT"
] | null | null | null | import colorama
colorama.init()
if __name__ == '__main__':
run()
| 33.957529 | 112 | 0.549403 | import json
import math
import os
import sys
import time
import colorama
from colorama import Style, Fore, Back
colorama.init()
import click
def clear_screen():
print('\x1b[2J', file=sys.stderr)
class FastTSVTail:
def __init__(self, filepath, seek_length=128):
self.filepath = filepath
self... | 0 | 1,067 | 0 | 4,588 | 0 | 2,814 | 0 | -45 | 293 |
532cf843d6ff4cfff92c5cc88cc98f2b83c9cac9 | 2,696 | py | Python | taskflow/migrations/versions/6ef79b56ad4a_rename_status_retry.py | awm33/taskflow | 5c86b50c6d8bce43a04fba1b856b1d56f3c36b6a | [
"MIT"
] | 22 | 2017-07-02T08:13:48.000Z | 2021-03-16T16:55:41.000Z | taskflow/migrations/versions/6ef79b56ad4a_rename_status_retry.py | awm33/taskflow | 5c86b50c6d8bce43a04fba1b856b1d56f3c36b6a | [
"MIT"
] | 14 | 2017-06-27T19:43:45.000Z | 2017-12-22T16:16:11.000Z | taskflow/migrations/versions/6ef79b56ad4a_rename_status_retry.py | awm33/taskflow | 5c86b50c6d8bce43a04fba1b856b1d56f3c36b6a | [
"MIT"
] | 1 | 2020-03-31T10:05:26.000Z | 2020-03-31T10:05:26.000Z | """rename status retry
Revision ID: 6ef79b56ad4a
Revises: 94e7b91d83d5
Create Date: 2017-06-19 15:06:50.441524+00:00
"""
# revision identifiers, used by Alembic.
revision = '6ef79b56ad4a'
down_revision = '94e7b91d83d5'
branch_labels = None
depends_on = None
## ref http://blog.yo1.dog/updating-enum-values-in-postgr... | 47.298246 | 132 | 0.732196 | """rename status retry
Revision ID: 6ef79b56ad4a
Revises: 94e7b91d83d5
Create Date: 2017-06-19 15:06:50.441524+00:00
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '6ef79b56ad4a'
down_revision = '94e7b91d83d5'
branch_labels = None
depends_on = None
## ref htt... | 0 | 0 | 0 | 0 | 0 | 2,255 | 0 | 3 | 90 |
a55ab9d25fa4b976b2a3f85e81e6a6604f24d452 | 15,679 | py | Python | python/nbdb/store/sparse_series_writer_base.py | rubrikinc/nbdb2 | 359db63a39e016e3eb197b8ea511d6e8cffa1853 | [
"Apache-2.0"
] | 2 | 2022-03-21T15:48:33.000Z | 2022-03-27T00:43:12.000Z | python/nbdb/store/sparse_series_writer_base.py | rubrikinc/nbdb2 | 359db63a39e016e3eb197b8ea511d6e8cffa1853 | [
"Apache-2.0"
] | null | null | null | python/nbdb/store/sparse_series_writer_base.py | rubrikinc/nbdb2 | 359db63a39e016e3eb197b8ea511d6e8cffa1853 | [
"Apache-2.0"
] | 1 | 2022-03-27T00:43:31.000Z | 2022-03-27T00:43:31.000Z | """
SparseSeriesData
"""
from __future__ import annotations
import logging
# Its there not sure why pylint is unable to find it
# pylint: disable-msg=E0611 # No Name In Module
logger = logging.getLogger()
# pylint: disable=R0902
| 42.147849 | 83 | 0.615792 | """
SparseSeriesData
"""
from __future__ import annotations
import logging
import sys
import time
import copy
from typing import Dict
# Its there not sure why pylint is unable to find it
# pylint: disable-msg=E0611 # No Name In Module
from lru import LRU
from nbdb.common.context import Context
from nbdb.common.data... | 0 | 7,998 | 0 | 6,862 | 0 | 0 | 0 | 232 | 353 |
46014f286995e226ea6b45ac533f420fee094576 | 6,373 | py | Python | NodeCheck/check_nodes.py | abutala/water-tracking | 6affde9fdd94b0430c09e9e097153548096813c6 | [
"MIT"
] | 1 | 2019-01-15T18:10:22.000Z | 2019-01-15T18:10:22.000Z | NodeCheck/check_nodes.py | abutala/water-tracking | 6affde9fdd94b0430c09e9e097153548096813c6 | [
"MIT"
] | null | null | null | NodeCheck/check_nodes.py | abutala/water-tracking | 6affde9fdd94b0430c09e9e097153548096813c6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
import logging
import os
import sys
import time
import Constants
import Mailer
system_healthy = True
state = dict()
message = ""
#### Helper Functions ####
# Note: For windows nodes only
# Note: For Foscam nodes only
#### Main Routine ####
if __name__ == "__main__":
par... | 35.405556 | 102 | 0.647576 | #!/usr/bin/env python3
import argparse
import logging
import os
import re
import sys
import time
import traceback
import Constants
import FoscamImager
import Mailer
import NetHelpers
system_healthy = True
state = dict()
message = ""
#### Helper Functions ####
def reboot_foscam(nodeName):
node = Constants.FOSCAM_NO... | 0 | 0 | 0 | 0 | 0 | 2,372 | 0 | -23 | 224 |
1466f341b25298856e16f6aec6a1214271b6ebd7 | 4,593 | py | Python | autograph/lib/envs/connfourenv.py | bb912/MATS-DRS | 6e1ae9ba3b865e321d6a2d100d29693b776e1d36 | [
"MIT"
] | null | null | null | autograph/lib/envs/connfourenv.py | bb912/MATS-DRS | 6e1ae9ba3b865e321d6a2d100d29693b776e1d36 | [
"MIT"
] | null | null | null | autograph/lib/envs/connfourenv.py | bb912/MATS-DRS | 6e1ae9ba3b865e321d6a2d100d29693b776e1d36 | [
"MIT"
] | null | null | null |
import gym.spaces as spaces
PATTERNS = ((0, 1), (1, 0), (1, 1), (1, -1))
| 31.458904 | 117 | 0.613542 | from typing import Tuple, Union
import gym.spaces as spaces
import numpy as np
from gym.spaces import Box
from autograph.lib.envs.adversarialenv import AdversarialEnv, PlayerID
from autograph.lib.envs.saveloadenv import SaveLoadEnv
from autograph.lib.util import element_add, element_neg
PATTERNS = ((0, 1), (1, 0), (... | 0 | 0 | 0 | 4,233 | 0 | 0 | 0 | 128 | 156 |
f3e567b187d0bed07e9fbc2dfc963f5668d99ad4 | 661 | py | Python | offer/bubbleSort.py | ZymHedy/code_practice | add07e8c964004f95da3be5311e54283e2b87d36 | [
"MIT"
] | null | null | null | offer/bubbleSort.py | ZymHedy/code_practice | add07e8c964004f95da3be5311e54283e2b87d36 | [
"MIT"
] | null | null | null | offer/bubbleSort.py | ZymHedy/code_practice | add07e8c964004f95da3be5311e54283e2b87d36 | [
"MIT"
] | null | null | null |
arr = [64, 34, 25, 12, 22, 11, 90]
test_arr = [2, 1, 5, 3, 4, 7]
bubbleSort(test_arr)
print(":")
for i in range(len(test_arr)):
print("%d" % test_arr[i]),
print(bubble(test_arr)) | 18.885714 | 55 | 0.485628 | def bubble(arr):
for i in range(len(arr)):
j = i + 1
while j < len(arr) and arr[j] < arr[i]:
temp = arr[i]
arr[i] = arr[j]
arr[j] = temp
return arr
def bubbleSort(arr):
n = len(arr)
# ้ๅๆๆๆฐ็ปๅ
็ด
for i in range(n):
# Last i elements are a... | 42 | 0 | 0 | 0 | 0 | 413 | 0 | 0 | 45 |
97c88b6bb1a18926d3c0bb3c92805ed409e26108 | 203 | py | Python | exp2/tcp_n_messages_cli.py | sekharkaredla/cnlab | 8e1ef9a904dea5260f6b6cf968508a2847f9f15c | [
"MIT"
] | null | null | null | exp2/tcp_n_messages_cli.py | sekharkaredla/cnlab | 8e1ef9a904dea5260f6b6cf968508a2847f9f15c | [
"MIT"
] | null | null | null | exp2/tcp_n_messages_cli.py | sekharkaredla/cnlab | 8e1ef9a904dea5260f6b6cf968508a2847f9f15c | [
"MIT"
] | 2 | 2018-04-16T13:25:12.000Z | 2018-04-16T14:49:38.000Z | import socket
s=socket.socket()
n=int(raw_input("enter n:"))
s.connect(('127.0.0.1',2222))
for k in range(0,n):
input=raw_input()
#s.connect(('127.0.0.1',2222))
s.send(input)
k=s.recv(1024)
print k
| 18.454545 | 31 | 0.655172 | import socket
s=socket.socket()
n=int(raw_input("enter n:"))
s.connect(('127.0.0.1',2222))
for k in range(0,n):
input=raw_input()
#s.connect(('127.0.0.1',2222))
s.send(input)
k=s.recv(1024)
print k
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0748b242aa925303ec1e4cb9fad885f1af83592d | 2,556 | py | Python | tests/functional/gtcs/test_external_file_04_d.py | FirebirdSQL/firebird-qa | 96af2def7f905a06f178e2a80a2c8be4a4b44782 | [
"MIT"
] | 1 | 2022-02-05T11:37:13.000Z | 2022-02-05T11:37:13.000Z | tests/functional/gtcs/test_external_file_04_d.py | FirebirdSQL/firebird-qa | 96af2def7f905a06f178e2a80a2c8be4a4b44782 | [
"MIT"
] | 1 | 2021-09-03T11:47:00.000Z | 2021-09-03T12:42:10.000Z | tests/functional/gtcs/test_external_file_04_d.py | FirebirdSQL/firebird-qa | 96af2def7f905a06f178e2a80a2c8be4a4b44782 | [
"MIT"
] | 1 | 2021-06-30T14:14:16.000Z | 2021-06-30T14:14:16.000Z | #coding:utf-8
#
# id: functional.gtcs.external_file_04_d
# title: GTCS/tests/external-file-04-d. Test for external table with field of INTEGER datatype
# decription:
# Original test see in:
# https://github.com/FirebirdSQL/fbtcs/blob/master/GTCS/tests/EXT_REL_0_4... | 26.350515 | 104 | 0.636933 | #coding:utf-8
#
# id: functional.gtcs.external_file_04_d
# title: GTCS/tests/external-file-04-d. Test for external table with field of INTEGER datatype
# decription:
# Original test see in:
# https://github.com/FirebirdSQL/fbtcs/blob/master/GTCS/tests/EXT_REL_0_4... | 0 | 94 | 0 | 0 | 0 | 0 | 0 | 0 | 46 |
9880b0b72274a5f90c266dd9b36f5c33a844dce2 | 3,286 | py | Python | src/ekpmeasure/analysis/functions_on_data.py | marwahaha/ekpmeasure | 8a0e52f0393849b496d9df13d84fcef11b733f59 | [
"MIT"
] | null | null | null | src/ekpmeasure/analysis/functions_on_data.py | marwahaha/ekpmeasure | 8a0e52f0393849b496d9df13d84fcef11b733f59 | [
"MIT"
] | null | null | null | src/ekpmeasure/analysis/functions_on_data.py | marwahaha/ekpmeasure | 8a0e52f0393849b496d9df13d84fcef11b733f59 | [
"MIT"
] | null | null | null | import numpy as np
__all__ = ('_fod_dimensionality_fixer', 'iterable_data_array', 'data_array_builder')
def _fod_dimensionality_fixer(data_dict, check_key, keys_to_fix):
"""
Checks the dimensionality of data in data_dict for function on data and reshapes them if their shape is 1d.
args:
data_... | 27.157025 | 112 | 0.52252 | import numpy as np
__all__ = ('_fod_dimensionality_fixer', 'iterable_data_array', 'data_array_builder')
class iterable_data_array():
def __init__(self, data_dict, key):
"""
Iterable for usage building functions on data.
args:
data_dict (dict): data
key (str ... | 0 | 0 | 0 | 2,057 | 0 | 0 | 0 | 0 | 46 |
80ca7c85c7faa916625d19f08c5badd55b5933e9 | 463 | py | Python | 2renderers/app2.py | carlotamartin/Pr-ctica-4--Bases-de-Datos | b9a40f0acb0b6f2f7946c7c924c3c91a3af318b5 | [
"Apache-2.0"
] | null | null | null | 2renderers/app2.py | carlotamartin/Pr-ctica-4--Bases-de-Datos | b9a40f0acb0b6f2f7946c7c924c3c91a3af318b5 | [
"Apache-2.0"
] | null | null | null | 2renderers/app2.py | carlotamartin/Pr-ctica-4--Bases-de-Datos | b9a40f0acb0b6f2f7946c7c924c3c91a3af318b5 | [
"Apache-2.0"
] | null | null | null | from wsgiref.simple_server import make_server
from pyramid.config import Configurator
if __name__ == '__main__':
with Configurator() as config:
config.add_route('home', '/')
config.scan()
app = config.make_wsgi_app()
server = make_server('0.0.0.0', 6543, app)
server.serve_forever() | 25.722222 | 46 | 0.667387 | from wsgiref.simple_server import make_server
from pyramid.config import Configurator
from pyramid.view import view_config
@view_config(
route_name = 'home'
renderer = 'json')
def home(request):
return{'a':1, 'b':2}
if __name__ == '__main__':
with Configurator() as config:
config.add_route('h... | 0 | 84 | 0 | 0 | 0 | 0 | 0 | 15 | 45 |
ed7bed1862228a50bf020c414f5210633cef5499 | 2,033 | py | Python | src/core/api/record.py | ruoyi0531/Yearning | 50ff6b14477ff8d03e6b455d5014b99983518719 | [
"Apache-2.0"
] | 1 | 2018-02-27T03:23:54.000Z | 2018-02-27T03:23:54.000Z | src/core/api/record.py | ruoyi0531/Yearning | 50ff6b14477ff8d03e6b455d5014b99983518719 | [
"Apache-2.0"
] | null | null | null | src/core/api/record.py | ruoyi0531/Yearning | 50ff6b14477ff8d03e6b455d5014b99983518719 | [
"Apache-2.0"
] | null | null | null | import logging
CUSTOM_ERROR = logging.getLogger('Yearning.core.views')
| 39.096154 | 102 | 0.496803 | import logging
from libs import baseview
from rest_framework.response import Response
from django.http import HttpResponse
from core.models import (
SqlRecord,
SqlOrder
)
CUSTOM_ERROR = logging.getLogger('Yearning.core.views')
class recordorder(baseview.SuperUserpermissions):
'''
ๅฎกๆ ธ่ฎฐๅฝ็ธๅ
ณ
'''
... | 18 | 0 | 0 | 1,755 | 0 | 0 | 0 | 76 | 111 |
23568867a266b35e43389764b353ce6af41ea3d3 | 468 | py | Python | setup.py | FebruaryBreeze/mobile-block | 7d201417df4cd8f046f23d28548efd817a3ac053 | [
"MIT"
] | null | null | null | setup.py | FebruaryBreeze/mobile-block | 7d201417df4cd8f046f23d28548efd817a3ac053 | [
"MIT"
] | null | null | null | setup.py | FebruaryBreeze/mobile-block | 7d201417df4cd8f046f23d28548efd817a3ac053 | [
"MIT"
] | null | null | null | """
mobile-block
MobileNet-style blocks for PyTorch
Author: SF-Zhou
Date: 2019-01-15
"""
from setuptools import setup
name = 'mobile_block'
setup(
name=name,
version='0.0.6',
description='MobileNet-style blocks for PyTorch',
url=f'https://github.com/SF-Zhou/{name.replace("_", "-")}',
author='SF-Zh... | 21.272727 | 63 | 0.668803 | """
mobile-block
MobileNet-style blocks for PyTorch
Author: SF-Zhou
Date: 2019-01-15
"""
from setuptools import setup
name = 'mobile_block'
setup(
name=name,
version='0.0.6',
description='MobileNet-style blocks for PyTorch',
url=f'https://github.com/SF-Zhou/{name.replace("_", "-")}',
author='SF-Zh... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2970f80fc9528c0b1b13373f13a8346aaead3d12 | 793 | py | Python | json_checker/app.py | DKorytkin/JsonChecker | 1a803c3d873db5a1139a55b7efb3b40d9c1b6891 | [
"MIT"
] | 5 | 2017-08-17T11:24:13.000Z | 2017-08-21T09:45:29.000Z | json_checker/app.py | DKorytkin/JsonChecker | 1a803c3d873db5a1139a55b7efb3b40d9c1b6891 | [
"MIT"
] | 179 | 2017-09-05T09:18:41.000Z | 2022-03-31T17:20:03.000Z | json_checker/app.py | DKorytkin/json_checker | 1a803c3d873db5a1139a55b7efb3b40d9c1b6891 | [
"MIT"
] | null | null | null | import logging
log = logging.getLogger(__name__)
| 26.433333 | 61 | 0.662043 | import logging
from typing import Any
from json_checker.core.base import Base
from json_checker.core.exceptions import CheckerError
from json_checker.core.checkers import Validator
from json_checker.core.reports import Report
log = logging.getLogger(__name__)
class Checker(Base):
def validate(self, data: Any)... | 0 | 0 | 0 | 505 | 0 | 0 | 0 | 101 | 135 |
d9cb23a9ea3c6e08eefedd54102f29eec5a2ccc6 | 3,295 | py | Python | src/oci/core/models/udp_options.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/core/models/udp_options.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | src/oci/core/models/udp_options.py | LaudateCorpus1/oci-python-sdk | b0d3ce629d5113df4d8b83b7a6502b2c5bfa3015 | [
"Apache-2.0",
"BSD-3-Clause"
] | null | null | null | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 34.684211 | 245 | 0.687709 | # coding: utf-8
# Copyright (c) 2016, 2022, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 0 | 2,764 | 0 | 0 | 0 | 0 | 0 | 105 | 82 |
c48edc84dfe346a757d4e91b8fa61926c28cd8f6 | 2,852 | py | Python | examples/python/grib_set_keys.py | bbakernoaa/eccodes | 61eb6daac46f6f2b9959b506df5565fb9e763c40 | [
"Apache-2.0"
] | null | null | null | examples/python/grib_set_keys.py | bbakernoaa/eccodes | 61eb6daac46f6f2b9959b506df5565fb9e763c40 | [
"Apache-2.0"
] | null | null | null | examples/python/grib_set_keys.py | bbakernoaa/eccodes | 61eb6daac46f6f2b9959b506df5565fb9e763c40 | [
"Apache-2.0"
] | null | null | null | # (C) Copyright 2005- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernme... | 31 | 78 | 0.66094 | # (C) Copyright 2005- ECMWF.
#
# This software is licensed under the terms of the Apache Licence Version 2.0
# which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
#
# In applying this licence, ECMWF does not waive the privileges and immunities
# granted to it by virtue of its status as an intergovernme... | 0 | 0 | 0 | 0 | 0 | 2,001 | 0 | 13 | 135 |
39915cb08f5f39d81b07a8377bd503ab57482d06 | 1,283 | py | Python | config.py | SonyCSL/apis-tester | 330fb0a23081dc7d99c7e0af3c897ff1bd88e55c | [
"Apache-2.0"
] | null | null | null | config.py | SonyCSL/apis-tester | 330fb0a23081dc7d99c7e0af3c897ff1bd88e55c | [
"Apache-2.0"
] | null | null | null | config.py | SonyCSL/apis-tester | 330fb0a23081dc7d99c7e0af3c897ff1bd88e55c | [
"Apache-2.0"
] | null | null | null |
my_host = 'localhost'
my_port = 10000
is_emulation = False
emulator_host = '0.0.0.0'
emulator_port = 4390
apis_web_host = '0.0.0.0'
apis_web_budo_emulator_port = 43830
apis_web_api_server_port = 9999
#apis_log_group_address = 'FF02:0:0:0:0:0:0:1'
apis_log_group_address = '224.2.2.4'
apis_log_port = 8888
units = [... | 18.328571 | 46 | 0.679657 |
my_host = 'localhost'
my_port = 10000
is_emulation = False
emulator_host = '0.0.0.0'
emulator_port = 4390
apis_web_host = '0.0.0.0'
apis_web_budo_emulator_port = 43830
apis_web_api_server_port = 9999
#apis_log_group_address = 'FF02:0:0:0:0:0:0:1'
apis_log_group_address = '224.2.2.4'
apis_log_port = 8888
units = [... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
941cd9f54df141dff4f4ac42daeca5576f19db6d | 2,528 | py | Python | slides/snippets/slides_create_slide.py | himanshupr2627/python-samples | 4a04e3aee1068dc1f1402e9e9c90044ff101a6c8 | [
"Apache-2.0"
] | 479 | 2018-03-16T16:45:11.000Z | 2020-10-13T11:32:02.000Z | slides/snippets/slides_create_slide.py | himanshupr2627/python-samples | 4a04e3aee1068dc1f1402e9e9c90044ff101a6c8 | [
"Apache-2.0"
] | 159 | 2018-03-28T20:03:56.000Z | 2020-10-13T06:00:08.000Z | slides/snippets/slides_create_slide.py | himanshupr2627/python-samples | 4a04e3aee1068dc1f1402e9e9c90044ff101a6c8 | [
"Apache-2.0"
] | 493 | 2018-03-21T01:07:21.000Z | 2020-10-14T10:31:00.000Z | """
Copyright 2022 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dis... | 33.706667 | 77 | 0.655459 | """
Copyright 2022 Google LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
dis... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
188cf77aae4d2909d4b80bf6330603f178e101ec | 1,366 | py | Python | python_practices/rotation_of_array.py | hoanhan101/Algorithms-Playground | c9641d3f3b7c4c778c14179cbb2039dbc40ae71a | [
"MIT"
] | 2 | 2019-08-15T06:19:31.000Z | 2020-02-19T09:46:46.000Z | python_practices/rotation_of_array.py | hoanhan101/Algorithms-Playground | c9641d3f3b7c4c778c14179cbb2039dbc40ae71a | [
"MIT"
] | null | null | null | python_practices/rotation_of_array.py | hoanhan101/Algorithms-Playground | c9641d3f3b7c4c778c14179cbb2039dbc40ae71a | [
"MIT"
] | null | null | null | """
Is One Array a Rotation of Another? (Python)
Write a function that returns True if one array is a rotation of another.
Example: [1, 2, 3, 4, 5, 6, 7] is a rotation of [4, 5, 6, 7, 1, 2, 3].
NOTE: There are no duplicates in each of these arrays.
REMINDER: We're going to use lists instead of arr... | 25.296296 | 82 | 0.565154 | """
Is One Array a Rotation of Another? (Python)
Write a function that returns True if one array is a rotation of another.
Example: [1, 2, 3, 4, 5, 6, 7] is a rotation of [4, 5, 6, 7, 1, 2, 3].
NOTE: There are no duplicates in each of these arrays.
REMINDER: We're going to use lists instead of arr... | 0 | 0 | 0 | 0 | 0 | 519 | 0 | 0 | 23 |
8dcfc847dd83cf2aed7c285b81e77cdf0de08a3a | 6,194 | py | Python | scripts/maskAlignment.py | stylekilla/syncmrt | 816bb57d80d6595719b8b9d7f027f4f17d0a6c0a | [
"Apache-2.0"
] | null | null | null | scripts/maskAlignment.py | stylekilla/syncmrt | 816bb57d80d6595719b8b9d7f027f4f17d0a6c0a | [
"Apache-2.0"
] | 25 | 2019-03-05T05:56:35.000Z | 2019-07-24T13:11:57.000Z | scripts/maskAlignment.py | stylekilla/syncmrt | 816bb57d80d6595719b8b9d7f027f4f17d0a6c0a | [
"Apache-2.0"
] | 1 | 2019-11-27T05:10:47.000Z | 2019-11-27T05:10:47.000Z | import numpy as np
from scipy.ndimage import gaussian_filter
import epics
import logging, coloredlogs
coloredlogs.install(fmt='%(asctime)s,%(msecs)d %(levelname)-8s [%(filename)s:%(lineno)d] %(message)s',datefmt='%H:%M:%S',level=logging.INFO)
"""
Assumes:
- RUBY In beam
- Ball bearing is centred on dynmrt rotation ... | 34.032967 | 140 | 0.696642 | import numpy as np
from matplotlib import pyplot as plt
from scipy.ndimage import median_filter, gaussian_filter
import epics
import time
import imageio
import logging, coloredlogs
coloredlogs.install(fmt='%(asctime)s,%(msecs)d %(levelname)-8s [%(filename)s:%(lineno)d] %(message)s',datefmt='%H:%M:%S',level=logging.INF... | 0 | 0 | 0 | 0 | 0 | 767 | 0 | 13 | 135 |
b4c4c827cd21cee6fa1011f1e41cf754b6187c95 | 289 | py | Python | abc/104/B.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | 2 | 2022-01-22T07:56:58.000Z | 2022-01-24T00:29:37.000Z | abc/104/B.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | abc/104/B.py | tonko2/AtCoder | 5d617072517881d226d7c8af09cb88684d41af7e | [
"Xnet",
"X11",
"CECILL-B"
] | null | null | null | S = input()
flag1 = True
flag2 = True
flag3 = True
flag1 = S[0] == "A" and S.count("A") == 1
flag2 = S.count("C") == 1 and 2 <= S.index("C") <= len(S)-2
S = S.replace("A", "")
S = S.replace("C", "")
flag3 = S.islower()
if all([flag1, flag2, flag3]):
print("AC")
else:
print("WA") | 19.266667 | 59 | 0.525952 | S = input()
flag1 = True
flag2 = True
flag3 = True
flag1 = S[0] == "A" and S.count("A") == 1
flag2 = S.count("C") == 1 and 2 <= S.index("C") <= len(S)-2
S = S.replace("A", "")
S = S.replace("C", "")
flag3 = S.islower()
if all([flag1, flag2, flag3]):
print("AC")
else:
print("WA") | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6b3906da0682543babc55a99851c57b9dabb2fac | 2,386 | py | Python | setup.py | vinta/pangu.py | 89407cf08dedf9d895c13053dd518d11a20f6c95 | [
"MIT"
] | 188 | 2015-02-11T04:16:45.000Z | 2022-03-15T03:35:25.000Z | pangu_anki/pangu/setup.py | ayuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu/anki-pangu | a5026f6706a460c4582ce5c12406c817fc68e971 | [
"MIT"
] | 9 | 2015-05-04T06:12:50.000Z | 2022-01-06T02:11:59.000Z | pangu_anki/pangu/setup.py | ayuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu/anki-pangu | a5026f6706a460c4582ce5c12406c817fc68e971 | [
"MIT"
] | 29 | 2015-02-14T07:25:16.000Z | 2021-11-29T00:01:30.000Z | #!/usr/bin/env python
# coding: utf-8
import re
from setuptools import setup
_VERSION_RE = re.compile(r"__version__\s*?=\s*?'(.*?)'", flags=re.M)
setup(
name='pangu',
version=get_version(),
description='Paranoid text spacing for good readability, to automatically insert whitespace between CJK (Chinese,... | 36.707692 | 217 | 0.630763 | #!/usr/bin/env python
# coding: utf-8
import os
import re
from setuptools import setup
_VERSION_RE = re.compile(r"__version__\s*?=\s*?'(.*?)'", flags=re.M)
def get_version():
path = os.path.join(
os.path.dirname(os.path.abspath(__file__)), 'pangu.py')
with open(path) as f:
return _VERSION_R... | 0 | 0 | 0 | 0 | 0 | 161 | 0 | -12 | 46 |
469ab0b8ef70c397ba6a1d627a505281fb810a54 | 1,779 | py | Python | klanad/migrations/0006_auto_20190606_1220.py | lancea-development/product-showcase | 32bdafaa5aa474f08db1a41e4d54b215d43ca6e6 | [
"MIT"
] | 1 | 2021-08-02T12:50:04.000Z | 2021-08-02T12:50:04.000Z | klanad/migrations/0006_auto_20190606_1220.py | wlansu/product-showcase | a0589f7e79eacfc70b3b66ced08a0890c4cc39c5 | [
"MIT"
] | 11 | 2019-06-09T12:01:02.000Z | 2022-01-13T01:22:52.000Z | klanad/migrations/0006_auto_20190606_1220.py | wlansu/product-showcase | a0589f7e79eacfc70b3b66ced08a0890c4cc39c5 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.2 on 2019-06-06 12:20
import django.db.models.deletion
| 31.767857 | 70 | 0.442383 | # Generated by Django 2.2.2 on 2019-06-06 12:20
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import model_utils.fields
import uuid
class Migration(migrations.Migration):
dependencies = [("klanad", "0005_auto_20190606_1214")]
operations = [
m... | 0 | 0 | 0 | 1,565 | 0 | 0 | 0 | 20 | 112 |
96f1ecf86f3570e45942d406c783b37418afc6f3 | 2,429 | py | Python | post scripts/nzbget.py | 0x20Man/Watcher3 | 4656b42bc5879a3741bb95f534b7c6612a25264d | [
"Apache-2.0"
] | 320 | 2017-03-28T23:33:45.000Z | 2022-02-17T08:45:01.000Z | post scripts/nzbget.py | 0x20Man/Watcher3 | 4656b42bc5879a3741bb95f534b7c6612a25264d | [
"Apache-2.0"
] | 300 | 2017-03-28T19:22:54.000Z | 2021-12-01T01:11:55.000Z | post scripts/nzbget.py | 0x20Man/Watcher3 | 4656b42bc5879a3741bb95f534b7c6612a25264d | [
"Apache-2.0"
] | 90 | 2017-03-29T16:12:43.000Z | 2022-03-01T06:23:48.000Z | #!/usr/bin/env python3
##########################################
######## DO NOT MODIFY THIS FILE! ########
## CONFIGURE API INFO THROUGH NZBGET UI ##
##########################################
#####################################
### NZBGET POST-PROCESSING SCRIPT ###
# Script to send post-processing info
# to Wat... | 25.568421 | 88 | 0.638534 | #!/usr/bin/env python3
##########################################
######## DO NOT MODIFY THIS FILE! ########
## CONFIGURE API INFO THROUGH NZBGET UI ##
##########################################
#####################################
### NZBGET POST-PROCESSING SCRIPT ###
# Script to send post-processing info
# to Wat... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6ffe3f3c46e951741a2348efd1a296965723ad43 | 8,281 | py | Python | tests/server_commands_test.py | dmvass/aioredis | b4b823e4dc453256ba8173eb82568c321e712da5 | [
"MIT"
] | 1 | 2020-11-09T12:07:17.000Z | 2020-11-09T12:07:17.000Z | tests/server_commands_test.py | idfumg/aioredis | b4b823e4dc453256ba8173eb82568c321e712da5 | [
"MIT"
] | null | null | null | tests/server_commands_test.py | idfumg/aioredis | b4b823e4dc453256ba8173eb82568c321e712da5 | [
"MIT"
] | null | null | null |
# @pytest.mark.run_loop
# @pytest.mark.skip("Not implemented")
# def test_config_resetstat():
# pass
| 26.205696 | 76 | 0.626011 | import time
import pytest
import sys
from unittest import mock
from aioredis import ReplyError
from _testutils import redis_version
@pytest.mark.run_loop
async def test_client_list(redis, server, request):
name = request.node.callspec.id
assert (await redis.client_setname(name))
res = await redis.client... | 0 | 7,513 | 0 | 0 | 0 | 0 | 0 | 0 | 640 |
6021efd44d4f1064ae268a64d46e53ed55a07725 | 684 | py | Python | spacy/tests/regression/test_issue514.py | cmgreivel/spaCy | a31506e06060c559abfeda043503935691af2e98 | [
"MIT"
] | 88 | 2018-05-06T17:28:23.000Z | 2022-03-06T20:19:16.000Z | spacy/tests/regression/test_issue514.py | cmgreivel/spaCy | a31506e06060c559abfeda043503935691af2e98 | [
"MIT"
] | 12 | 2018-07-19T15:11:57.000Z | 2021-08-05T11:58:29.000Z | spacy/tests/regression/test_issue514.py | cmgreivel/spaCy | a31506e06060c559abfeda043503935691af2e98 | [
"MIT"
] | 10 | 2018-07-28T22:43:04.000Z | 2020-11-22T22:58:21.000Z | # coding: utf-8
from __future__ import unicode_literals
| 29.73913 | 79 | 0.641813 | # coding: utf-8
from __future__ import unicode_literals
from ..util import get_doc
import pytest
@pytest.mark.skip
@pytest.mark.models('en')
def test_issue514(EN):
"""Test serializing after adding entity"""
text = ["This", "is", "a", "sentence", "about", "pasta", "."]
vocab = EN.entity.vocab
doc = g... | 0 | 561 | 0 | 0 | 0 | 0 | 0 | -3 | 69 |
3c0f5517a82dd76fdd643790158a153c97622604 | 33,251 | py | Python | felapps/utils/datautils.py | archman/felapps | 89532a592070d2a0cf07f0f2b4c723cbf1c1bd33 | [
"MIT"
] | 2 | 2018-04-01T14:37:39.000Z | 2021-03-12T04:16:12.000Z | felapps/utils/datautils.py | Archman/felapps | 89532a592070d2a0cf07f0f2b4c723cbf1c1bd33 | [
"MIT"
] | null | null | null | felapps/utils/datautils.py | Archman/felapps | 89532a592070d2a0cf07f0f2b4c723cbf1c1bd33 | [
"MIT"
] | 2 | 2016-07-10T11:14:33.000Z | 2019-07-06T05:42:10.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
python modules for data processing utilities:
dataworkshop: main GUI framework for data post-processing
Author: Tong Zhang
Created: Sep. 23rd, 2015
"""
from __future__ import print_function
#class PlotPanel(pltutils.ImagePanelxy):
# def __init__(self, paren... | 36.700883 | 711 | 0.575682 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
python modules for data processing utilities:
dataworkshop: main GUI framework for data post-processing
Author: Tong Zhang
Created: Sep. 23rd, 2015
"""
from __future__ import print_function
import wx
import time
import threading
import numpy as np
import matplotli... | 0 | 0 | 0 | 32,395 | 0 | 0 | 0 | -44 | 380 |
0e3b46656c23599cd8a969f49b8a2012277079ed | 3,187 | py | Python | urls.py | smithdc1/djangopackages | 8762a787fe968cbf5f772c6199d1362743c85db9 | [
"MIT"
] | null | null | null | urls.py | smithdc1/djangopackages | 8762a787fe968cbf5f772c6199d1362743c85db9 | [
"MIT"
] | null | null | null | urls.py | smithdc1/djangopackages | 8762a787fe968cbf5f772c6199d1362743c85db9 | [
"MIT"
] | null | null | null | from django.conf import settings
from django.urls import include
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, re_path
from django.views.generic.base import TemplateView
from core import __version__
from core.apiv1 import apiv1_gone
from homepage.views import... | 39.345679 | 109 | 0.69407 | from django.conf import settings
from django.urls import include
from django.conf.urls.static import static
from django.contrib import admin
from django.urls import path, re_path
from django.views.generic.base import TemplateView
from core import __version__
from core.apiv1 import apiv1_gone
from homepage.views import... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ece45c88a28119865f49d467e7ba473afb8f4bd1 | 4,456 | py | Python | emol/emol/utility/testing.py | lrt512/emol | e1dd3462632a525c3b9701d4fd9a332d19c93b85 | [
"MIT"
] | null | null | null | emol/emol/utility/testing.py | lrt512/emol | e1dd3462632a525c3b9701d4fd9a332d19c93b85 | [
"MIT"
] | null | null | null | emol/emol/utility/testing.py | lrt512/emol | e1dd3462632a525c3b9701d4fd9a332d19c93b85 | [
"MIT"
] | null | null | null | """Utilities for unit testing."""
| 29.706667 | 76 | 0.611984 | """Utilities for unit testing."""
from importlib import __import__
import pytest
import sys
class Mocktoday(object):
"""A context manager for to fake out datetime.date.today.
Monkeypatches the given module to swap out today with our
own function so that we can say that "today" is any date we want.
... | 0 | 779 | 0 | 3,536 | 0 | 0 | 0 | -8 | 113 |
205c7319fc964e5283e50d0c679b1e59f8bfea0a | 3,558 | py | Python | functions/source/infrastructure/delete-resources-associated-with-lambda.py | jy-git/quickstart-mcafee-epo | 5e7c198c829ae65d47d3b2c7ca0c6fb2c164b42d | [
"Apache-2.0"
] | null | null | null | functions/source/infrastructure/delete-resources-associated-with-lambda.py | jy-git/quickstart-mcafee-epo | 5e7c198c829ae65d47d3b2c7ca0c6fb2c164b42d | [
"Apache-2.0"
] | null | null | null | functions/source/infrastructure/delete-resources-associated-with-lambda.py | jy-git/quickstart-mcafee-epo | 5e7c198c829ae65d47d3b2c7ca0c6fb2c164b42d | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# Invoked by: Cloudformation custom actions
# Returns: Error or status message
#
# deletes the resources assocated with lambda like eni
| 44.475 | 191 | 0.613828 | #!/usr/bin/env python3
# Invoked by: Cloudformation custom actions
# Returns: Error or status message
#
# deletes the resources assocated with lambda like eni
import boto3
import http.client
import urllib
import json
import uuid
import threading
from time import sleep
def handler(event, context):
print(event)
... | 0 | 0 | 0 | 0 | 0 | 3,243 | 0 | -44 | 200 |
4bbe4405e4e826a1c8c658fcb0e0dfb79a6e0ac3 | 35,474 | py | Python | meerk40t/core/planner.py | aniziorodrigues/meerk40t | ca1180b690a2f25748fe04cb7fdbf270520deab9 | [
"MIT"
] | null | null | null | meerk40t/core/planner.py | aniziorodrigues/meerk40t | ca1180b690a2f25748fe04cb7fdbf270520deab9 | [
"MIT"
] | null | null | null | meerk40t/core/planner.py | aniziorodrigues/meerk40t | ca1180b690a2f25748fe04cb7fdbf270520deab9 | [
"MIT"
] | null | null | null | from .cutcode import CutGroup
MILS_IN_MM = 39.3701
def reify_matrix(self):
"""Apply the matrix to the path and reset matrix."""
self.element = abs(self.element)
self.scene_bounds = None
def correct_empty(context: CutGroup):
"""
Iterate backwards deleting any entries that are empty.
... | 37.459345 | 139 | 0.490838 | from copy import copy
from ..device.lasercommandconstants import (
COMMAND_BEEP,
COMMAND_FUNCTION,
COMMAND_HOME,
COMMAND_MODE_RAPID,
COMMAND_MOVE,
COMMAND_SET_ABSOLUTE,
COMMAND_SET_POSITION,
COMMAND_UNLOCK,
COMMAND_WAIT,
COMMAND_WAIT_FINISH,
)
from ..kernel import Modifier
from ... | 0 | 18,383 | 0 | 2,589 | 13,092 | 83 | 0 | 301 | 386 |
3bcf36d95e381b2661b334770f16b6dd6e45f090 | 844 | py | Python | gradients/keras_gradients.py | Froskekongen/MA8701 | 53c206bff2896ec6c021325813b3cc27bf7a9cb3 | [
"MIT"
] | 1 | 2019-01-29T11:41:53.000Z | 2019-01-29T11:41:53.000Z | gradients/keras_gradients.py | Froskekongen/MA8701 | 53c206bff2896ec6c021325813b3cc27bf7a9cb3 | [
"MIT"
] | null | null | null | gradients/keras_gradients.py | Froskekongen/MA8701 | 53c206bff2896ec6c021325813b3cc27bf7a9cb3 | [
"MIT"
] | null | null | null | # Example taken from:
# https://stackoverflow.com/questions/39561560/getting-gradient-of-model-output-w-r-t-weights-using-keras
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
from tensorflow.keras import backend as K
import tensorflow as tf
import numpy as np
model = Sequen... | 33.76 | 105 | 0.799763 | # Example taken from:
# https://stackoverflow.com/questions/39561560/getting-gradient-of-model-output-w-r-t-weights-using-keras
from tensorflow.keras.models import Sequential
from tensorflow.keras.layers import Dense
from tensorflow.keras import backend as K
import tensorflow as tf
import numpy as np
model = Sequen... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2293f17a3cc49a7c9816f20c2e58e11f37eebe27 | 11,931 | py | Python | Venues/Base/ouch/ouchvenue.py | yurishd/VenueSimulator | 474f52093e70aefb23cdab16326011ad31b6b1ac | [
"Apache-2.0"
] | null | null | null | Venues/Base/ouch/ouchvenue.py | yurishd/VenueSimulator | 474f52093e70aefb23cdab16326011ad31b6b1ac | [
"Apache-2.0"
] | null | null | null | Venues/Base/ouch/ouchvenue.py | yurishd/VenueSimulator | 474f52093e70aefb23cdab16326011ad31b6b1ac | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import os
import sys
import inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0, parentdir)
#######################################################
# Currently there is no specific command back and... | 36.710769 | 154 | 0.588718 | #!/usr/bin/python
import os
import sys
import inspect
currentdir = os.path.dirname(os.path.abspath(inspect.getfile(inspect.currentframe())))
parentdir = os.path.dirname(currentdir)
sys.path.insert(0, parentdir)
from Engine.engine import VenueBaseCmdProcessor, ClientBaseCmdProcessor, ClientBaseCmdTraits, VenueBaseCmd... | 0 | 0 | 0 | 10,858 | 0 | 248 | 0 | 103 | 274 |
7517f9f00c5b4db031f327d457e57355f369f80f | 3,369 | py | Python | getStocksList.py | akashgiri/stocks-list | 3569fe250aadb271f1637b8f274b7a2f87924b28 | [
"MIT"
] | 11 | 2017-05-23T08:50:57.000Z | 2021-03-08T20:58:48.000Z | getStocksList.py | webclinic017/stocks-list | 3569fe250aadb271f1637b8f274b7a2f87924b28 | [
"MIT"
] | 1 | 2021-08-10T08:24:50.000Z | 2021-08-10T08:24:50.000Z | getStocksList.py | webclinic017/stocks-list | 3569fe250aadb271f1637b8f274b7a2f87924b28 | [
"MIT"
] | 7 | 2020-04-28T03:37:01.000Z | 2021-09-12T16:09:06.000Z | #!/usr/bin/python
import json
import re
import requests
try:
from BeautifulSoup import BeautifulSoup
except ImportError:
from bs4 import BeautifulSoup
try:
inputFile = open("input.json")
except Exception, e:
print e
exit()
try:
urls = json.load(inputFile)['urls']
except Exception, e:
prin... | 31.194444 | 84 | 0.62986 | #!/usr/bin/python
import json
import re
import requests
try:
from BeautifulSoup import BeautifulSoup
except ImportError:
from bs4 import BeautifulSoup
try:
inputFile = open("input.json")
except Exception, e:
print e
exit()
try:
urls = json.load(inputFile)['urls']
except Exception, e:
prin... | 0 | 0 | 0 | 0 | 0 | 1,011 | 0 | 0 | 22 |
3b8ff913708dfb19cda137eb69d74c6b5523de54 | 10,111 | py | Python | deepdish/image.py | raphaelquast/deepdish | 44b5259c629724fb95e97e75a4ac6d1bf6737e27 | [
"BSD-3-Clause"
] | 253 | 2015-01-14T01:20:16.000Z | 2022-02-23T09:10:26.000Z | deepdish/image.py | raphaelquast/deepdish | 44b5259c629724fb95e97e75a4ac6d1bf6737e27 | [
"BSD-3-Clause"
] | 46 | 2015-04-07T04:38:20.000Z | 2021-10-30T06:40:14.000Z | deepdish/image.py | raphaelquast/deepdish | 44b5259c629724fb95e97e75a4ac6d1bf6737e27 | [
"BSD-3-Clause"
] | 55 | 2015-02-12T04:16:59.000Z | 2022-03-25T01:17:24.000Z | """
Basic functions for working with images.
"""
from __future__ import division, print_function, absolute_import
import numpy as np
def _import_skimage():
"""Import scikit-image, with slightly modified `ImportError` message"""
try:
import skimage
except ImportError:
raise ImportError("scik... | 27.550409 | 79 | 0.606864 | """
Basic functions for working with images.
"""
from __future__ import division, print_function, absolute_import
import itertools as itr
import numpy as np
def _import_skimage():
"""Import scikit-image, with slightly modified `ImportError` message"""
try:
import skimage
except ImportError:
... | 0 | 0 | 0 | 0 | 2,081 | 510 | 0 | 2 | 68 |
d14ce38a38465f69d4216a97195ad16bd4b89b4c | 2,062 | py | Python | config_tempest/services/share.py | openstack/python-tempestconf | 505e20a4dd771536257a4c4db645da707f727668 | [
"Apache-2.0"
] | 7 | 2017-10-31T13:29:35.000Z | 2019-11-11T11:01:27.000Z | config_tempest/services/share.py | openstack/python-tempestconf | 505e20a4dd771536257a4c4db645da707f727668 | [
"Apache-2.0"
] | null | null | null | config_tempest/services/share.py | openstack/python-tempestconf | 505e20a4dd771536257a4c4db645da707f727668 | [
"Apache-2.0"
] | 2 | 2018-02-14T17:04:22.000Z | 2020-02-14T16:45:33.000Z | # Copyright 2018 Red Hat, 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... | 32.21875 | 79 | 0.652764 | # Copyright 2018 Red Hat, 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... | 0 | 96 | 0 | 1,191 | 0 | 0 | 0 | 59 | 114 |
dfdf3ca6161feecf2f1ab0729e0b1ba2d6863dc4 | 10,581 | py | Python | indig/migrations/0001_initial.py | Paulo-Lopes-Estevao/indicativos-globais | 7dc75f954ba03a38eb8f7529541b3cb84b40472a | [
"BSD-3-Clause"
] | 2 | 2021-10-02T23:10:25.000Z | 2021-10-03T00:59:45.000Z | indig/migrations/0001_initial.py | Paulo-Lopes-Estevao/indicativos-globais | 7dc75f954ba03a38eb8f7529541b3cb84b40472a | [
"BSD-3-Clause"
] | null | null | null | indig/migrations/0001_initial.py | Paulo-Lopes-Estevao/indicativos-globais | 7dc75f954ba03a38eb8f7529541b3cb84b40472a | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 3.2.5 on 2021-08-04 11:38
| 112.56383 | 172 | 0.480484 | # Generated by Django 3.2.5 on 2021-08-04 11:38
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Indicativos',
fields=[
('id', models.BigAuto... | 396 | 0 | 0 | 10,269 | 0 | 0 | 0 | 19 | 46 |
269b5b588e5c38f22883170f0d0bcc9a95f1fe56 | 752 | py | Python | src/run_thread.py | wu-clan/automated_api | 6c41ddc3b900608403855afb9e740ce31e24186f | [
"MulanPSL-1.0"
] | null | null | null | src/run_thread.py | wu-clan/automated_api | 6c41ddc3b900608403855afb9e740ce31e24186f | [
"MulanPSL-1.0"
] | null | null | null | src/run_thread.py | wu-clan/automated_api | 6c41ddc3b900608403855afb9e740ce31e24186f | [
"MulanPSL-1.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import unittest
from concurrent.futures.thread import ThreadPoolExecutor
from src.common.log import log
from src.core.path_settings import TEST_CASES
def run_thread(suits, thread_num: int = 8):
"""
:param suits:
:param thread_num:
:return:
""... | 23.5 | 80 | 0.658245 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import unittest
from concurrent.futures.thread import ThreadPoolExecutor
from src.common.log import log
from src.core.path_settings import TEST_CASES
def run_thread(suits, thread_num: int = 8):
"""
ๅค็บฟ็จ่ฟ่กๆๆ็จไพ
:param suits: ๆต่ฏ็จไพ
:param thread_num: ็บฟ็จๆฐ
... | 87 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
173442fd66bd382253d8052d338549cae5c43235 | 1,212 | py | Python | test/queue_test.py | merlinran/acorn-precision-farming-rover | 228bbeb537550df79ae57985c427975ffa828bcd | [
"Apache-2.0"
] | 143 | 2021-02-23T16:17:32.000Z | 2022-03-30T09:42:27.000Z | test/queue_test.py | Twisted-Fields/acorn-precision-farming-rover | 228bbeb537550df79ae57985c427975ffa828bcd | [
"Apache-2.0"
] | 19 | 2021-05-13T19:03:21.000Z | 2022-03-25T08:46:44.000Z | test/queue_test.py | merlinran/acorn-precision-farming-rover | 228bbeb537550df79ae57985c427975ffa828bcd | [
"Apache-2.0"
] | 17 | 2021-02-23T22:02:24.000Z | 2022-03-20T15:12:20.000Z | import multiprocessing as mp
import random
random.seed()
send_queue = mp.Queue()
receive_queue = mp.Queue()
proc = mp.Process(target=send_fast, args=(send_queue, receive_queue,))
proc.start()
send_slow(send_queue, receive_queue)
| 23.764706 | 70 | 0.585809 | import multiprocessing as mp
import time
import random
random.seed()
def AppendFIFO(list, value, max_values):
list.append(value)
while len(list) > max_values:
list.pop(0)
return list
def send_slow(queue1, queue2):
somelist = []
maxlen = 500
sequence = 0
while True:
queue... | 0 | 0 | 0 | 0 | 0 | 895 | 0 | -10 | 91 |
8396a9d9b2a4309161a07836228c77d7d56278cc | 1,644 | py | Python | benchmark/utils.py | rebryk/mcc-benchmark | 1f43f21c8a9d312822e0cc37d172d64a20df5203 | [
"MIT"
] | null | null | null | benchmark/utils.py | rebryk/mcc-benchmark | 1f43f21c8a9d312822e0cc37d172d64a20df5203 | [
"MIT"
] | null | null | null | benchmark/utils.py | rebryk/mcc-benchmark | 1f43f21c8a9d312822e0cc37d172d64a20df5203 | [
"MIT"
] | null | null | null | import json
from pathlib import Path
import requests
def download_file(url: str, path: Path):
"""Download file from the given url and store it to path."""
response = requests.get(url, stream=True)
with path.open('wb') as file:
for data in response.iter_content():
file.write(data)
de... | 26.095238 | 101 | 0.643552 | import json
from datetime import datetime
from pathlib import Path
import numpy as np
import requests
def download_file(url: str, path: Path):
"""Download file from the given url and store it to path."""
response = requests.get(url, stream=True)
with path.open('wb') as file:
for data in response.... | 0 | 0 | 0 | 648 | 0 | 106 | 0 | 5 | 118 |
901b8fa0d9651ecca60c3c94f1686c973c1c721e | 439 | py | Python | code/chapter6-1.py | justinchou/quant-python | e487287f9320e7ce70fb86720752790066675daf | [
"MIT"
] | 6 | 2019-01-13T04:16:23.000Z | 2021-05-27T11:22:20.000Z | code/chapter6-1.py | justinchou/quant-python | e487287f9320e7ce70fb86720752790066675daf | [
"MIT"
] | null | null | null | code/chapter6-1.py | justinchou/quant-python | e487287f9320e7ce70fb86720752790066675daf | [
"MIT"
] | 1 | 2020-05-06T09:47:53.000Z | 2020-05-06T09:47:53.000Z | # -*- coding: UTF-8 -*-
v = 14
if type(v) != int:
print("Error: Only Support Integer!")
elif v % 2 == 0:
print(0)
elif v % 2 == 1:
print(v)
v = 12
print(type(v))
v = 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000... | 18.291667 | 165 | 0.697039 | # -*- coding: UTF-8 -*-
v = 14
if type(v) != int:
print("Error: Only Support Integer!")
elif v % 2 == 0:
print(0)
elif v % 2 == 1:
print(v)
v = 12
print(type(v))
v = 10000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9a2d2988b8ce214d87f56664a561ef3db9eff341 | 3,428 | py | Python | src/law_evaluate.py | tridungduong16/counterfactual_fairness_game_theoretic | 794d5224f9c656c06e5eb197ebbe1875f1856e7e | [
"MIT"
] | null | null | null | src/law_evaluate.py | tridungduong16/counterfactual_fairness_game_theoretic | 794d5224f9c656c06e5eb197ebbe1875f1856e7e | [
"MIT"
] | null | null | null | src/law_evaluate.py | tridungduong16/counterfactual_fairness_game_theoretic | 794d5224f9c656c06e5eb197ebbe1875f1856e7e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed May 5 13:17:22 2021
@author: trduong
"""
# import os, sys;
# sys.path.append(os.path.dirname(os.path.realpath(__file__)))
import pandas as pd
import logging
import argparse
import sys
import pprint
import gc
from utils.helpers import load_config
i... | 31.449541 | 93 | 0.672695 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Wed May 5 13:17:22 2021
@author: trduong
"""
# import os, sys;
# sys.path.append(os.path.dirname(os.path.realpath(__file__)))
import pandas as pd
import numpy as np
import logging
import yaml
import pyro
import torch
import pyro.distributions as dist
im... | 0 | 0 | 0 | 0 | 0 | 451 | 0 | 46 | 157 |
adb016baa3e8625282dbf878a5baf0903e126cad | 2,220 | py | Python | DailyProgrammer/DP20150909B.py | DayGitH/Python-Challenges | bc32f1332a92fcc2dfa6f5ea4d95f8a8d64c3edf | [
"MIT"
] | 2 | 2020-12-23T18:59:22.000Z | 2021-04-14T13:16:09.000Z | DailyProgrammer/DP20150909B.py | DayGitH/Python-Challenges | bc32f1332a92fcc2dfa6f5ea4d95f8a8d64c3edf | [
"MIT"
] | null | null | null | DailyProgrammer/DP20150909B.py | DayGitH/Python-Challenges | bc32f1332a92fcc2dfa6f5ea4d95f8a8d64c3edf | [
"MIT"
] | null | null | null | """
[2015-09-09] Challenge #231 [Intermediate] Set Game Solver
https://www.reddit.com/r/dailyprogrammer/comments/3ke4l6/20150909_challenge_231_intermediate_set_game/
Our apologies for the delay in getting this posted, there was some technical difficulties behind the scenes.
# Description
Set is a card game where eac... | 30 | 119 | 0.705856 | """
[2015-09-09] Challenge #231 [Intermediate] Set Game Solver
https://www.reddit.com/r/dailyprogrammer/comments/3ke4l6/20150909_challenge_231_intermediate_set_game/
Our apologies for the delay in getting this posted, there was some technical difficulties behind the scenes.
# Description
Set is a card game where eac... | 0 | 0 | 0 | 0 | 0 | -1 | 0 | 0 | 23 |
b46dbd3f0d25354d42fc31a481918fd65590961c | 11,316 | py | Python | tests/test_paypal.py | devkral/web-payments-paypal | 779e7d0324be4da165d282d145cc8693718ba7e7 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | tests/test_paypal.py | devkral/web-payments-paypal | 779e7d0324be4da165d282d145cc8693718ba7e7 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | tests/test_paypal.py | devkral/web-payments-paypal | 779e7d0324be4da165d282d145cc8693718ba7e7 | [
"BSD-2-Clause",
"BSD-3-Clause"
] | null | null | null | import simplejson as json
import datetime
from web_payments.testcommon import create_test_payment
CLIENT_ID = 'abc123'
PAYMENT_TOKEN = '5a4dae68-2715-4b1e-8bb2-2c2dbe9255f6'
SECRET = '123abc'
VARIANT = 'paypal'
PROCESS_DATA = {
'name': 'John Doe',
'number': '371449635398431',
'expiration': (datetime.datet... | 40.414286 | 119 | 0.603835 | import simplejson as json
from decimal import Decimal
import datetime
from unittest import TestCase
from unittest.mock import patch, MagicMock
from requests import HTTPError
from web_payments_paypal import PaypalProvider, PaypalCardProvider
from web_payments import RedirectNeeded, PaymentError, PaymentStatus
from web_... | 0 | 4,300 | 0 | 5,997 | 0 | 0 | 0 | 136 | 179 |
1d1c4504c85e36ed7f7c31c53177fc83e9df60cf | 1,815 | py | Python | 04_Semantik_Stimmungsanalyse/nltk_stimmungsanalyse.py | felixdittrich92/NLP | 1097d43dd1c99762b6a909a876a765bc79245471 | [
"MIT"
] | null | null | null | 04_Semantik_Stimmungsanalyse/nltk_stimmungsanalyse.py | felixdittrich92/NLP | 1097d43dd1c99762b6a909a876a765bc79245471 | [
"MIT"
] | null | null | null | 04_Semantik_Stimmungsanalyse/nltk_stimmungsanalyse.py | felixdittrich92/NLP | 1097d43dd1c99762b6a909a876a765bc79245471 | [
"MIT"
] | null | null | null | import nltk
import pandas as pd
from nltk.sentiment.vader import SentimentIntensityAnalyzer
from sklearn.metrics import accuracy_score, classification_report, confusion_matrix
nltk.download('vader_lexicon')
sid = SentimentIntensityAnalyzer()
a = 'This was a good movie'
score = sid.polarity_scores(a)
print(score)
a ... | 28.359375 | 83 | 0.725069 | import nltk
import numpy as np
import pandas as pd
from nltk.sentiment.vader import SentimentIntensityAnalyzer
from sklearn.metrics import accuracy_score, classification_report, confusion_matrix
nltk.download('vader_lexicon')
sid = SentimentIntensityAnalyzer()
a = 'This was a good movie'
score = sid.polarity_scores(a... | 10 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 22 |
7feb6314836599c7766b552d9748f6c4cf81e70c | 1,288 | py | Python | spinup/algos/pytorch/dqn/core.py | liushunyu/stable-spinningup | 7ece777a564b05334c78005eda094ed729d31304 | [
"MIT"
] | null | null | null | spinup/algos/pytorch/dqn/core.py | liushunyu/stable-spinningup | 7ece777a564b05334c78005eda094ed729d31304 | [
"MIT"
] | null | null | null | spinup/algos/pytorch/dqn/core.py | liushunyu/stable-spinningup | 7ece777a564b05334c78005eda094ed729d31304 | [
"MIT"
] | null | null | null | import torch.nn as nn
| 26.833333 | 99 | 0.653727 | import numpy as np
import torch
import torch.nn as nn
def combined_shape(length, shape=None):
if shape is None:
return (length,)
return (length, shape) if np.isscalar(shape) else (length, *shape)
def mlp(sizes, activation, output_activation=nn.Identity):
layers = []
for j in range(len(sizes)... | 0 | 0 | 0 | 664 | 0 | 450 | 0 | -12 | 159 |
a01e4b886a698b66093a3f3ef7d101ef683869cc | 887 | py | Python | src/servo.py | dancj/pid_distance_control | f479660f59266d97cd8277d501af27c2dcf32b68 | [
"MIT"
] | null | null | null | src/servo.py | dancj/pid_distance_control | f479660f59266d97cd8277d501af27c2dcf32b68 | [
"MIT"
] | null | null | null | src/servo.py | dancj/pid_distance_control | f479660f59266d97cd8277d501af27c2dcf32b68 | [
"MIT"
] | null | null | null | # ref: https://tutorials-raspberrypi.com/raspberry-pi-servo-motor-control/
import RPi.GPIO as GPIO
servoPIN = 17
GPIO.setmode(GPIO.BCM)
GPIO.setup(servoPIN, GPIO.OUT)
| 25.342857 | 74 | 0.550169 | # ref: https://tutorials-raspberrypi.com/raspberry-pi-servo-motor-control/
import RPi.GPIO as GPIO
import time
servoPIN = 17
GPIO.setmode(GPIO.BCM)
GPIO.setup(servoPIN, GPIO.OUT)
def run():
p = GPIO.PWM(servoPIN, 50) # GPIO 17 for PWM with 50Hz
p.start(2.5) # Initialization
try:
while True:
... | 0 | 0 | 0 | 0 | 0 | 682 | 0 | -10 | 45 |
d0c70f2f56531a661dce48670b99058aa7fac45e | 219 | py | Python | setup.py | virtualmadden/Project.Euler | e68df9ad4c37759faee97f9a3ed1dbe46686f3b3 | [
"MIT"
] | 2 | 2015-12-17T20:00:14.000Z | 2015-12-18T21:03:08.000Z | setup.py | virtualmadden/Project.Euler | e68df9ad4c37759faee97f9a3ed1dbe46686f3b3 | [
"MIT"
] | 1 | 2018-02-15T19:01:58.000Z | 2018-02-15T19:01:58.000Z | setup.py | virtualmadden/Project.Euler | e68df9ad4c37759faee97f9a3ed1dbe46686f3b3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from distutils.core import setup
setup(name='Project.Euler',
version='0.0.1',
description='Python3 implementation of Project Euler problems.',
author='Jonathan Madden',
)
| 21.9 | 70 | 0.675799 | #!/usr/bin/env python
from distutils.core import setup
setup(name='Project.Euler',
version='0.0.1',
description='Python3 implementation of Project Euler problems.',
author='Jonathan Madden',
)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
166974adb32f7cb7c47952ee2fbe1317079fb489 | 8,104 | py | Python | csrc/asm_test/common/rv_instruction_table.py | hossein1387/pito_riscv | 94df6f2201798765984017c82d1fdf0355f68d45 | [
"MIT"
] | 3 | 2021-05-25T08:40:55.000Z | 2022-01-05T07:05:39.000Z | csrc/asm_test/common/rv_instruction_table.py | hossein1387/pito_riscv | 94df6f2201798765984017c82d1fdf0355f68d45 | [
"MIT"
] | 5 | 2021-07-25T01:12:16.000Z | 2022-02-17T20:30:38.000Z | csrc/asm_test/common/rv_instruction_table.py | hossein1387/pito_riscv | 94df6f2201798765984017c82d1fdf0355f68d45 | [
"MIT"
] | 3 | 2021-08-11T07:59:07.000Z | 2022-01-05T07:05:43.000Z | from collections import defaultdict
instruction_list = lambda:defaultdict(instruction_list)
instruction_table = instruction_list()
# RV32I
## Branch
instruction_table['0x18']['0'] = 'beq'
instruction_table['0x18']['1'] = 'bne'
instruction_table['0x18']['4'] = 'blt'
instruction_table['0x18']['5'] = 'bge'
instruction_t... | 40.723618 | 59 | 0.607725 | from collections import defaultdict
instruction_list = lambda:defaultdict(instruction_list)
instruction_table = instruction_list()
# RV32I
## Branch
instruction_table['0x18']['0'] = 'beq'
instruction_table['0x18']['1'] = 'bne'
instruction_table['0x18']['4'] = 'blt'
instruction_table['0x18']['5'] = 'bge'
instruction_t... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
893632e380fb8c6890ac1b8f7608b131fb23ec8a | 477 | py | Python | 002.6_formatandonum.py | thaistlsantos/Python-ByLearn | 472da86fd713be6e0faeecdb0c5b01c85f06cb32 | [
"MIT"
] | null | null | null | 002.6_formatandonum.py | thaistlsantos/Python-ByLearn | 472da86fd713be6e0faeecdb0c5b01c85f06cb32 | [
"MIT"
] | null | null | null | 002.6_formatandonum.py | thaistlsantos/Python-ByLearn | 472da86fd713be6e0faeecdb0c5b01c85f06cb32 | [
"MIT"
] | null | null | null | # Podemos modificar a sadas dos nmeros sem modificar os valores reais
# Ex: Nmero 2 => Valor 2. Sada => 2.00 => Valor ainda 2
# Nmero 2.5 => Valor 2.5 Sada => 2 => Valor ainda 2.5
numero = 1.61
print(numero)
# Para inteiros uso o 'd' e para floats uso o 'f'
# para numeros quebrados ele arredonda
print('{:.2f}'.f... | 26.5 | 71 | 0.658281 | # Podemos modificar a saรญdas dos nรบmeros sem modificar os valores reais
# Ex: Nรบmero 2 => Valor รฉ 2. Saรญda => 2.00 => Valor ainda รฉ 2
# Nรบmero 2.5 => Valor รฉ 2.5 Saรญda => 2 => Valor ainda รฉ 2.5
numero = 1.61
print(numero)
# Para inteiros uso o 'd' e para floats uso o 'f'
# para numeros quebrados ele arredonda
print(... | 20 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
59d4833c3402fbab0186555a8c74eb27efcc0439 | 947 | py | Python | entities/api_views.py | acdh-oeaw/gtrans | 6f56b1d09de0cad503273bf8a01cd81e25220524 | [
"MIT"
] | 1 | 2020-03-15T16:14:02.000Z | 2020-03-15T16:14:02.000Z | entities/api_views.py | acdh-oeaw/gtrans | 6f56b1d09de0cad503273bf8a01cd81e25220524 | [
"MIT"
] | 14 | 2018-11-09T08:34:23.000Z | 2022-02-10T08:15:53.000Z | entities/api_views.py | acdh-oeaw/gtrans | 6f56b1d09de0cad503273bf8a01cd81e25220524 | [
"MIT"
] | null | null | null | from . api_renderers import GeoJsonRenderer
| 27.057143 | 88 | 0.761352 | from rest_framework import viewsets
from rest_framework.response import Response
from . serializers import *
from . models import *
from . api_renderers import GeoJsonRenderer
from rest_framework.settings import api_settings
class PlaceViewSet(viewsets.ModelViewSet):
queryset = Place.objects.all()
serializer_... | 0 | 0 | 0 | 626 | 0 | 0 | 0 | 71 | 202 |
c58a067838dae447e1e943b788d5ca820ceb1c11 | 398 | py | Python | tornado-native/app.py | glasnt/cloudrun-python-examples | 7cd35932ce77f30900af4272be008f6485d5b13b | [
"Apache-2.0"
] | 2 | 2021-09-25T20:09:06.000Z | 2021-11-03T11:53:30.000Z | tornado-native/app.py | glasnt/cloudrun-python-examples | 7cd35932ce77f30900af4272be008f6485d5b13b | [
"Apache-2.0"
] | null | null | null | tornado-native/app.py | glasnt/cloudrun-python-examples | 7cd35932ce77f30900af4272be008f6485d5b13b | [
"Apache-2.0"
] | null | null | null | import os
import tornado.ioloop
import tornado.web
port = os.environ.get('PORT', 8080)
if __name__ == "__main__":
app = make_app()
app.listen(port)
tornado.ioloop.IOLoop.current().start()
| 18.952381 | 46 | 0.655779 | import os
import tornado.ioloop
import tornado.web
port = os.environ.get('PORT', 8080)
class MainHandler(tornado.web.RequestHandler):
def get(self):
self.write("๐ Hello tornado")
def make_app():
return tornado.web.Application([
(r"/", MainHandler),
])
if __name__ == "__main__":
app... | 4 | 0 | 0 | 81 | 0 | 67 | 0 | 0 | 46 |
74a478dfcd8560a0399203b0175dabf0e88b4a77 | 771 | py | Python | backend/urls.py | lakshbhasin/VoterValidation | 2249f387046b5039b650e3b5c63b9d3d3b7aea8f | [
"Apache-2.0"
] | 6 | 2018-11-02T14:10:54.000Z | 2020-07-14T02:38:03.000Z | backend/urls.py | lakshbhasin/VoterValidation | 2249f387046b5039b650e3b5c63b9d3d3b7aea8f | [
"Apache-2.0"
] | 2 | 2021-06-10T20:56:46.000Z | 2021-06-10T20:58:54.000Z | backend/urls.py | lakshbhasin/VoterValidation | 2249f387046b5039b650e3b5c63b9d3d3b7aea8f | [
"Apache-2.0"
] | null | null | null | """
backend URL Configuration
See the voter_validation folder for more details.
"""
import backend.settings as settings
from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic import RedirectView
urlpatterns = [
url(r'^private/admin/', include(admin.site.urls)),
url... | 26.586207 | 57 | 0.687419 | """
backend URL Configuration
See the voter_validation folder for more details.
"""
import backend.settings as settings
from django.conf.urls import include, url
from django.contrib import admin
from django.views.generic import RedirectView
urlpatterns = [
url(r'^private/admin/', include(admin.site.urls)),
url... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9722ca970a47cbaf0f78497e03f84149c31742f1 | 2,441 | py | Python | src/draw.py | delbio/maze | cbc58ebb2c54f300f6413b770b57b0cab0750672 | [
"MIT"
] | null | null | null | src/draw.py | delbio/maze | cbc58ebb2c54f300f6413b770b57b0cab0750672 | [
"MIT"
] | null | null | null | src/draw.py | delbio/maze | cbc58ebb2c54f300f6413b770b57b0cab0750672 | [
"MIT"
] | null | null | null | from .models import WALL, EMPTY
START = 100
GOAL = 200
HORIZONTAL_PATH = 300
VERTICAL_PATH = 400
CHAR_MAPPING = {
WALL: '#',
EMPTY: ' ',
GOAL: 'E',
HORIZONTAL_PATH: '-',
VERTICAL_PATH: '|',
START: 'S'
}
| 35.897059 | 132 | 0.652192 | from .models import WALL, EMPTY
from .a_star_search import reconstruct_path, end_reached
START = 100
GOAL = 200
HORIZONTAL_PATH = 300
VERTICAL_PATH = 400
CHAR_MAPPING = {
WALL: '#',
EMPTY: ' ',
GOAL: 'E',
HORIZONTAL_PATH: '-',
VERTICAL_PATH: '|',
... | 0 | 0 | 0 | 0 | 0 | 1,945 | 0 | 35 | 183 |
d87eb980fe0d49f89f076a89c36f3595711cb054 | 238 | py | Python | Chapter07/example9.py | arifmudi/Advanced-Python-Programming-Second-Edition | 55e8fb16127873b5285980301f9a0331d135253c | [
"MIT"
] | 19 | 2021-06-11T11:23:44.000Z | 2022-03-27T21:15:26.000Z | Chapter07/example9.py | arifmudi/Advanced-Python-Programming-Second-Edition | 55e8fb16127873b5285980301f9a0331d135253c | [
"MIT"
] | null | null | null | Chapter07/example9.py | arifmudi/Advanced-Python-Programming-Second-Edition | 55e8fb16127873b5285980301f9a0331d135253c | [
"MIT"
] | 16 | 2021-04-18T12:43:02.000Z | 2022-03-26T05:47:34.000Z |
if __name__ == "__main__":
generator = parrot()
generator.send(None)
generator.send("Hello")
generator.send("World")
| 19.833333 | 48 | 0.605042 | def parrot():
while True:
message = yield
print("Parrot says: {}".format(message))
if __name__ == "__main__":
generator = parrot()
generator.send(None)
generator.send("Hello")
generator.send("World")
| 0 | 0 | 0 | 0 | 81 | 0 | 0 | 0 | 22 |
72ae043e728048fcf22f2f33d47445dc1ad7ef25 | 6,549 | py | Python | cogdl/layers/deepergcn_layer.py | 1049451037/cogdl | 554f30e879e91b73a9160cabbd6b89a9a2555f49 | [
"MIT"
] | null | null | null | cogdl/layers/deepergcn_layer.py | 1049451037/cogdl | 554f30e879e91b73a9160cabbd6b89a9a2555f49 | [
"MIT"
] | null | null | null | cogdl/layers/deepergcn_layer.py | 1049451037/cogdl | 554f30e879e91b73a9160cabbd6b89a9a2555f49 | [
"MIT"
] | null | null | null | import torch.nn as nn
| 31.637681 | 124 | 0.561612 | from typing import Optional
import torch
import torch.nn as nn
import torch.nn.functional as F
from torch.utils.checkpoint import checkpoint
from .mlp_layer import MLP
from cogdl.utils import get_activation, mul_edge_softmax, get_norm_layer
class GENConv(nn.Module):
def __init__(
self,
in_feats:... | 0 | 0 | 0 | 6,210 | 0 | 0 | 0 | 87 | 226 |
d3779b70c96cb314b1329f747be6b60a284cbaef | 3,725 | py | Python | examples/acoustics/reverberation.py | AssembleSoftware/IoTPy | d4b7b516ef95a45cff69827003d5e2d205f2ba55 | [
"BSD-3-Clause"
] | 28 | 2017-12-19T20:21:44.000Z | 2022-02-04T09:44:03.000Z | examples/acoustics/reverberation.py | AssembleSoftware/IoTPy | d4b7b516ef95a45cff69827003d5e2d205f2ba55 | [
"BSD-3-Clause"
] | 4 | 2020-05-30T20:21:58.000Z | 2020-07-11T20:49:31.000Z | examples/acoustics/reverberation.py | sdeepaknarayanan/IoTPy | ba022c3d6696527b834a865b9cf403d90665145b | [
"BSD-3-Clause"
] | 11 | 2017-05-21T15:37:41.000Z | 2021-10-16T13:45:11.000Z | import sys
import os
sys.path.append(os.path.abspath("../../IoTPy/multiprocessing"))
sys.path.append(os.path.abspath("../../IoTPy/core"))
sys.path.append(os.path.abspath("../../IoTPy/agent_types"))
sys.path.append(os.path.abspath("../../IoTPy/helper_functions"))
sys.path.append(os.path.abspath("../signal_processing_exa... | 34.813084 | 79 | 0.662013 | import sys
import os
import threading
import matplotlib.pyplot as plt
sys.path.append(os.path.abspath("../../IoTPy/multiprocessing"))
sys.path.append(os.path.abspath("../../IoTPy/core"))
sys.path.append(os.path.abspath("../../IoTPy/agent_types"))
sys.path.append(os.path.abspath("../../IoTPy/helper_functions"))
sys.path... | 0 | 0 | 0 | 0 | 0 | 2,579 | 0 | 124 | 266 |
4a110c228cce4bf1775db65c76bb3e408071cc0d | 3,330 | py | Python | predict.py | vkso/FER | b7207341139ff451753a4c4640530e915673fc7c | [
"Apache-2.0"
] | null | null | null | predict.py | vkso/FER | b7207341139ff451753a4c4640530e915673fc7c | [
"Apache-2.0"
] | null | null | null | predict.py | vkso/FER | b7207341139ff451753a4c4640530e915673fc7c | [
"Apache-2.0"
] | null | null | null | import myMethod as myMethod
import numpy as np
import argparse
# use method:
# python predict.py --model myModel --type whole_history_epoch
# python predict.py --model myVGG --type whole --load_path /Users/wyc/Downloads/cp-0560.ckpt
# python predict.py --model myModel --type whole_history_epoch --train_name withoutFir... | 32.970297 | 108 | 0.653453 | import tensorflow as tf
from customParameters import *
import myMethod as myMethod
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sn
import argparse
# use method:
# python predict.py --model myModel --type whole_history_epoch
# python predict.py --model myVGG --type whole --lo... | 0 | 0 | 0 | 0 | 0 | 1,449 | 0 | 18 | 156 |
12799787f265bb70c9f6b67467052ec9d67b80a1 | 2,788 | py | Python | solar/core/tags_set_parser.py | Mirantis/solar | 7d12e56d403d70a923cd1caa9c7e3c8cf6fc57aa | [
"Apache-2.0"
] | 7 | 2015-09-07T22:52:32.000Z | 2016-01-14T09:27:09.000Z | solar/core/tags_set_parser.py | Mirantis/solar | 7d12e56d403d70a923cd1caa9c7e3c8cf6fc57aa | [
"Apache-2.0"
] | 117 | 2015-09-08T05:46:16.000Z | 2016-04-14T16:46:33.000Z | solar/core/tags_set_parser.py | Mirantis/solar | 7d12e56d403d70a923cd1caa9c7e3c8cf6fc57aa | [
"Apache-2.0"
] | 21 | 2015-09-08T06:34:50.000Z | 2015-12-09T09:14:24.000Z | # Copyright 2015 Mirantis, 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 ... | 21.952756 | 78 | 0.638451 | # Copyright 2015 Mirantis, 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 ... | 0 | 0 | 0 | 730 | 0 | 382 | 0 | 3 | 161 |
d6d15eb5e93e20bf074c366f1af36b930d073f22 | 4,235 | py | Python | detect_face.py | SuiMingYang/sales-message-classify | 1b9ce984e907b688096c2287ad80e495034b347c | [
"MIT"
] | 1 | 2020-09-01T10:37:51.000Z | 2020-09-01T10:37:51.000Z | detect_face.py | SuiMingYang/sales-message-classify | 1b9ce984e907b688096c2287ad80e495034b347c | [
"MIT"
] | null | null | null | detect_face.py | SuiMingYang/sales-message-classify | 1b9ce984e907b688096c2287ad80e495034b347c | [
"MIT"
] | null | null | null | #
| 35 | 103 | 0.621015 | import os
#ๅพๅๅ็ฑป
from cv2 import cv2
from PIL import Image,ImageDraw
from datetime import datetime
import time
from pytesseract import image_to_string
class Detect():
def __init__(self):
pass
#detectFaces()่ฟๅๅพๅไธญๆๆไบบ่ธ็็ฉๅฝขๅๆ ๏ผ็ฉๅฝขๅทฆไธใๅณไธ้กถ็น๏ผ
#ไฝฟ็จhaar็นๅพ็็บง่ๅ็ฑปๅจhaarcascade_frontalface_default.xml๏ผๅจhaarcascades็ฎๅฝไธ่ฟ... | 1,392 | 0 | 0 | 3,601 | 0 | 0 | 0 | 12 | 155 |
b53eb8e0919b384e408a28ab9f4a15b1a9246884 | 1,250 | py | Python | bot.py | RealCyGuy/Auto-Disconnect | a24002d682535bdf106781de9e6e10952f609aa1 | [
"MIT"
] | null | null | null | bot.py | RealCyGuy/Auto-Disconnect | a24002d682535bdf106781de9e6e10952f609aa1 | [
"MIT"
] | null | null | null | bot.py | RealCyGuy/Auto-Disconnect | a24002d682535bdf106781de9e6e10952f609aa1 | [
"MIT"
] | null | null | null | __version__ = "0.1.0"
import os
from dotenv import load_dotenv
load_dotenv()
bot = AutoDisconnect()
token = os.environ.get("TOKEN", None)
if token is None or len(token.strip()) == 0:
print("\nA bot token is necessary for the bot to function.\n")
raise RuntimeError
else:
bot.run(token)
| 26.595745 | 84 | 0.6072 | __version__ = "0.1.0"
import os
import discord
from dotenv import load_dotenv
load_dotenv()
class AutoDisconnect(discord.Client):
def __init__(self, *args, **kwargs):
super().__init__(activity=discord.Game("get disconnected"), *args, **kwargs)
self.channel_id = int(os.environ.get("CHANNEL_ID", ... | 0 | 0 | 490 | 417 | 0 | 0 | 0 | -7 | 46 |
1426c3a6dbcd345a9e8e10aaccd536cf07cace3f | 1,098 | py | Python | migrations/versions/2019_03_21_add_titles_to_charts_and_tables.py | AlexKouzy/ethnicity-facts-and-figures-publisher | 18ab2495a8633f585e18e607c7f75daa564a053d | [
"MIT"
] | 1 | 2021-10-06T13:48:36.000Z | 2021-10-06T13:48:36.000Z | migrations/versions/2019_03_21_add_titles_to_charts_and_tables.py | AlexKouzy/ethnicity-facts-and-figures-publisher | 18ab2495a8633f585e18e607c7f75daa564a053d | [
"MIT"
] | 116 | 2018-11-02T17:20:47.000Z | 2022-02-09T11:06:22.000Z | migrations/versions/2019_03_21_add_titles_to_charts_and_tables.py | racedisparityaudit/rd_cms | a12f0e3f5461cc41eed0077ed02e11efafc5dd76 | [
"MIT"
] | 2 | 2018-11-09T16:47:35.000Z | 2020-04-09T13:06:48.000Z | """Add titles to charts and tables
This is in preparation for storing the titles of charts and tables in
a separate database column, rather than as part of the JSON objects.
Revision ID: 2019_03_21_add_titles
Revises: 2019_03_20_tidy_up_dimension
Create Date: 2019-03-14 15:11:33.560576
"""
# revision identifiers, ... | 29.675676 | 113 | 0.743169 | """Add titles to charts and tables
This is in preparation for storing the titles of charts and tables in
a separate database column, rather than as part of the JSON objects.
Revision ID: 2019_03_21_add_titles
Revises: 2019_03_20_tidy_up_dimension
Create Date: 2019-03-14 15:11:33.560576
"""
from alembic import op
imp... | 0 | 0 | 0 | 0 | 0 | 545 | 0 | 3 | 90 |
b5204682d45506f2896e79ad6cf44a8f933dcf52 | 4,748 | py | Python | evolution_analysis/code/HGT_analysis/HGT_from_non_fungi/code/s3_get_taxonomy.py | SysBioChalmers/Multi_scale_evolution | b5f28ead733872519bc0758df034a076224c4253 | [
"MIT"
] | 1 | 2020-05-27T13:43:55.000Z | 2020-05-27T13:43:55.000Z | evolution_analysis/code/HGT_analysis/HGT_from_non_fungi/code/s3_get_taxonomy.py | SysBioChalmers/Multi_scale_evolution | b5f28ead733872519bc0758df034a076224c4253 | [
"MIT"
] | null | null | null | evolution_analysis/code/HGT_analysis/HGT_from_non_fungi/code/s3_get_taxonomy.py | SysBioChalmers/Multi_scale_evolution | b5f28ead733872519bc0758df034a076224c4253 | [
"MIT"
] | 1 | 2021-03-24T18:29:29.000Z | 2021-03-24T18:29:29.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Step2 : BLAST hits were parsed to retrieve associated taxonomic information
# using the NCBI's taxonomy database.
# Downloaded resource:
# wget ftp://ftp.ncbi.nih.gov/pub/taxonomy/taxdump.tar.gz
# tar -zxvf taxdump.tar.gz
# https://www.biostars.org/p/222183/
# ... | 28.261905 | 125 | 0.581929 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Step2 : BLAST hits were parsed to retrieve associated taxonomic information
# using the NCBI's taxonomy database.
# Downloaded resource:
# wget ftp://ftp.ncbi.nih.gov/pub/taxonomy/taxdump.tar.gz
# tar -zxvf taxdump.tar.gz
# https://www.biostars.org/p/222183/
# ... | 0 | 0 | 0 | 0 | 0 | 2,905 | 0 | -22 | 251 |
7ddf97b23204b21ac6a8aedc6aca4815be914f52 | 4,134 | py | Python | src/whylogs/tests/unit/core/statistics/test_schematracker.py | bernease/cli-demo-1 | 895d9eddc95ca3dd43b7ae8b33a8fbdedbc855f5 | [
"Apache-2.0"
] | null | null | null | src/whylogs/tests/unit/core/statistics/test_schematracker.py | bernease/cli-demo-1 | 895d9eddc95ca3dd43b7ae8b33a8fbdedbc855f5 | [
"Apache-2.0"
] | null | null | null | src/whylogs/tests/unit/core/statistics/test_schematracker.py | bernease/cli-demo-1 | 895d9eddc95ca3dd43b7ae8b33a8fbdedbc855f5 | [
"Apache-2.0"
] | null | null | null | from whylabs.logs.proto import InferredType
Type = InferredType.Type
| 27.197368 | 77 | 0.664973 | from whylabs.logs.proto import InferredType
from whylabs.logs.core.statistics import SchemaTracker
Type = InferredType.Type
def multiple_track(tracker, counts: dict):
for item, count in counts.items():
for i in range(count):
tracker.track(item)
def test_track_nothing_should_return_unknown():... | 0 | 0 | 0 | 0 | 0 | 3,746 | 0 | 33 | 275 |
d0af38c905bc7b420694fc9c8d72b18557033577 | 839 | py | Python | api.py | Reyvel/ref-final-project-backend | 33afa0548af3fdb967a6f9c149b480028821f8e1 | [
"MIT"
] | null | null | null | api.py | Reyvel/ref-final-project-backend | 33afa0548af3fdb967a6f9c149b480028821f8e1 | [
"MIT"
] | null | null | null | api.py | Reyvel/ref-final-project-backend | 33afa0548af3fdb967a6f9c149b480028821f8e1 | [
"MIT"
] | null | null | null | from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
app = FastAPI()
origins = [
'http://localhost:3000',
]
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=['*'],
allow_headers=['*']
) | 24.676471 | 56 | 0.573302 | import msgpack
from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
import settings
app = FastAPI()
origins = [
'http://localhost:3000',
]
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=['*'],
allow_headers=['*']
)
@... | 0 | 499 | 0 | 0 | 0 | 0 | 0 | -13 | 67 |
a4dd4a478ebea95668dc6ede87d349f094e71b61 | 5,552 | py | Python | data_prep_scripts/get_callsign_info.py | ctartist621/old-betsy | 58530fd91f0f87edbe92bf9885392ac6b4ce6cfc | [
"MIT"
] | null | null | null | data_prep_scripts/get_callsign_info.py | ctartist621/old-betsy | 58530fd91f0f87edbe92bf9885392ac6b4ce6cfc | [
"MIT"
] | null | null | null | data_prep_scripts/get_callsign_info.py | ctartist621/old-betsy | 58530fd91f0f87edbe92bf9885392ac6b4ce6cfc | [
"MIT"
] | null | null | null | import asyncio
import os
username = os.getenv("HAMQTH_USERNAME")
password = os.getenv("HAMQTH_PASSWORD")
api_root = "https://www.hamqth.com/xml.php"
auth_uri = f"{api_root}?u={username}&p={password}"
data_dir = "data/hamqth"
# Get HamQTH Session I
session_id = SessionToken()
dir = "data/reverse_beacon_netwo... | 33.648485 | 144 | 0.590058 | import asyncio
import os
from threading import Timer
import aiofiles
import aiohttp
import pandas as pd
import untangle
from aiohttp import ClientSession
from progress.bar import Bar
username = os.getenv("HAMQTH_USERNAME")
password = os.getenv("HAMQTH_PASSWORD")
api_root = "https://www.hamqth.com/xml.php"
auth_uri = ... | 0 | 76 | 3,919 | 646 | 0 | 200 | 0 | 4 | 292 |
74edcc21bfdfeef76fbef98079856e400eec28ad | 231 | py | Python | May/Day28-Missing Number.py | tayyrov/Daily_Coding_Challenge | 9e54a725082530dca1229dfcd973d04975374220 | [
"MIT"
] | 1 | 2022-01-01T21:54:45.000Z | 2022-01-01T21:54:45.000Z | May/Day28-Missing Number.py | tayyrov/Daily_Coding_Challenge | 9e54a725082530dca1229dfcd973d04975374220 | [
"MIT"
] | null | null | null | May/Day28-Missing Number.py | tayyrov/Daily_Coding_Challenge | 9e54a725082530dca1229dfcd973d04975374220 | [
"MIT"
] | null | null | null | """
Question Source:Leetcode
Level: Easy
Topic: Math
Solver: Tayyrov
Date: 28.05.2022
"""
| 17.769231 | 43 | 0.619048 | """
Question Source:Leetcode
Level: Easy
Topic: Math
Solver: Tayyrov
Date: 28.05.2022
"""
from typing import List
def missingNumber(nums: List[int]) -> int:
ln = len(nums)
return ln * (ln + 1) // 2 - sum(nums) | 0 | 0 | 0 | 0 | 0 | 86 | 0 | 2 | 47 |
6a52aa238a206943e0976594da88c1534f748d56 | 403 | py | Python | swiftwind/settings/urls.py | m-den-i/swiftwind | 3af9a1ec3327a992f1d3f2c11fefbb3c06cadbce | [
"MIT"
] | 11 | 2016-12-13T00:46:48.000Z | 2020-07-28T13:44:12.000Z | swiftwind/settings/urls.py | m-den-i/swiftwind | 3af9a1ec3327a992f1d3f2c11fefbb3c06cadbce | [
"MIT"
] | 15 | 2017-11-29T19:38:32.000Z | 2018-11-02T21:08:04.000Z | swiftwind/settings/urls.py | m-den-i/swiftwind | 3af9a1ec3327a992f1d3f2c11fefbb3c06cadbce | [
"MIT"
] | 4 | 2018-10-23T12:39:04.000Z | 2019-12-30T11:06:23.000Z | from django.conf.urls import url
from . import views
urlpatterns = [
url(r'^$', views.GeneralSettingsView.as_view(), name='general'),
url(r'^technical/$', views.TechnicalSettingsView.as_view(), name='technical'),
url(r'^teller/$', views.TellerSettingsView.as_view(), name='teller'),
url(r'^email/$', vi... | 33.583333 | 82 | 0.702233 | from django.conf.urls import url
from django.contrib import admin
from . import views
urlpatterns = [
url(r'^$', views.GeneralSettingsView.as_view(), name='general'),
url(r'^technical/$', views.TechnicalSettingsView.as_view(), name='technical'),
url(r'^teller/$', views.TellerSettingsView.as_view(), name='... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 22 |
788ba6d26d356f3d66960ecf81b290466f0a58b7 | 7,921 | py | Python | testify/test_result.py | timgates42/Testify | 50045dfc239e0118a88487b95b27a9c17732b4cf | [
"Apache-2.0"
] | null | null | null | testify/test_result.py | timgates42/Testify | 50045dfc239e0118a88487b95b27a9c17732b4cf | [
"Apache-2.0"
] | null | null | null | testify/test_result.py | timgates42/Testify | 50045dfc239e0118a88487b95b27a9c17732b4cf | [
"Apache-2.0"
] | null | null | null | # Copyright 2009 Yelp
#
# 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
... | 36.84186 | 127 | 0.620629 | # Copyright 2009 Yelp
#
# 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
... | 0 | 177 | 0 | 6,660 | 0 | 155 | 0 | -28 | 180 |