hexsha stringlengths 40 40 | size int64 3 1.03M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 3 972 | max_stars_repo_name stringlengths 6 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 3 972 | max_issues_repo_name stringlengths 6 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 3 972 | max_forks_repo_name stringlengths 6 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 3 1.03M | avg_line_length float64 1.13 941k | max_line_length int64 2 941k | alphanum_fraction float64 0 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aa37134ef47073b2dedc4aa1d0534abbd7e59f38 | 1,054 | py | Python | umd/products/ooi.py | egi-qc/umd-verification | 328e875f9633c9e602e9eea61d2590def373098e | [
"Apache-2.0"
] | 1 | 2019-10-31T10:41:37.000Z | 2019-10-31T10:41:37.000Z | umd/products/ooi.py | egi-qc/umd-verification | 328e875f9633c9e602e9eea61d2590def373098e | [
"Apache-2.0"
] | 12 | 2015-06-04T12:08:18.000Z | 2018-06-05T09:54:58.000Z | umd/products/ooi.py | egi-qc/umd-verification | 328e875f9633c9e602e9eea61d2590def373098e | [
"Apache-2.0"
] | 3 | 2015-09-15T13:15:50.000Z | 2018-04-26T15:10:24.000Z | # 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
# distributed under t... | 31.939394 | 75 | 0.717268 |
f3f3cbf03d1c4d37cf25849591f826dfbfe4e91a | 230 | py | Python | pacote-download/d021 - tocar um MP3.py | Carlos-DOliveira/cursoemvideo-python3 | 4546c8a7360155243e2f7ecbbb80c57868f770a2 | [
"MIT"
] | null | null | null | pacote-download/d021 - tocar um MP3.py | Carlos-DOliveira/cursoemvideo-python3 | 4546c8a7360155243e2f7ecbbb80c57868f770a2 | [
"MIT"
] | null | null | null | pacote-download/d021 - tocar um MP3.py | Carlos-DOliveira/cursoemvideo-python3 | 4546c8a7360155243e2f7ecbbb80c57868f770a2 | [
"MIT"
] | null | null | null | ''' 021 Faça um programa em Python que abra e reproduza o áudio de um arq MP3'''
import pygame
pygame.init()
pygame.mixer.music.load('ex021.mp3')
pygame.mixer.music.play()
pygame.event.wait()
# não deu, pq o pygame não instalou | 23 | 80 | 0.734783 |
b04559e1b287a6936e513a3fe23f7ead72ce6604 | 6,739 | py | Python | srunner/scenarios/signalized_junction_left_turn.py | ll7/scenario_runner | 277c570b0bc046ef1f9936d3b633d665d4a79197 | [
"MIT"
] | null | null | null | srunner/scenarios/signalized_junction_left_turn.py | ll7/scenario_runner | 277c570b0bc046ef1f9936d3b633d665d4a79197 | [
"MIT"
] | null | null | null | srunner/scenarios/signalized_junction_left_turn.py | ll7/scenario_runner | 277c570b0bc046ef1f9936d3b633d665d4a79197 | [
"MIT"
] | 1 | 2020-05-28T11:41:29.000Z | 2020-05-28T11:41:29.000Z | #!/usr/bin/env python
#
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""
Collection of traffic scenarios where the ego vehicle (hero)
is making a left turn
"""
from six.moves.queue import Queue # pylint: disable=relative-import
import py_trees... | 43.75974 | 118 | 0.648316 |
0e0b6a171029ca1525374b7136351dd271e11725 | 28,691 | py | Python | tests/workflow/test_time_series_extractor.py | MuttData/soam | 65612a02552668c6721dc20e675654883391c3e9 | [
"Apache-2.0"
] | 1 | 2021-09-17T01:14:57.000Z | 2021-09-17T01:14:57.000Z | tests/workflow/test_time_series_extractor.py | MuttData/soam | 65612a02552668c6721dc20e675654883391c3e9 | [
"Apache-2.0"
] | null | null | null | tests/workflow/test_time_series_extractor.py | MuttData/soam | 65612a02552668c6721dc20e675654883391c3e9 | [
"Apache-2.0"
] | 1 | 2021-08-09T14:22:50.000Z | 2021-08-09T14:22:50.000Z | """Tests for TimeSeriesExtractor.
"""
import os
import unittest
from unittest import main
import pandas as pd
from sqlalchemy import Column
from sqlalchemy.types import Float, Integer, String
from soam.constants import TIMESTAMP_COL
from soam.data_models import AbstractIDBase, AbstractTimeSeriesTable
from soam.workfl... | 31.152009 | 213 | 0.504827 |
af6da0056de4d9007832d2d961f0f4a6770ac8f2 | 1,668 | py | Python | examples/sync/fanout/server.py | westover/tchannel-python | d9c16291f49b3b9dd1353c01179d4f4c3168c53a | [
"MIT"
] | null | null | null | examples/sync/fanout/server.py | westover/tchannel-python | d9c16291f49b3b9dd1353c01179d4f4c3168c53a | [
"MIT"
] | null | null | null | examples/sync/fanout/server.py | westover/tchannel-python | d9c16291f49b3b9dd1353c01179d4f4c3168c53a | [
"MIT"
] | null | null | null | # Copyright (c) 2016 Uber Technologies, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publ... | 37.066667 | 79 | 0.767986 |
c8ea28859b109e06bfa39bae196bc98d39584db0 | 22,137 | py | Python | cloudcafe/networking/networks/common/proxy_mgr/ssh_util.py | melissa-kam/cloudcafe | 124c0923f7e7628267038cafe64339030bdaefda | [
"Apache-2.0"
] | null | null | null | cloudcafe/networking/networks/common/proxy_mgr/ssh_util.py | melissa-kam/cloudcafe | 124c0923f7e7628267038cafe64339030bdaefda | [
"Apache-2.0"
] | null | null | null | cloudcafe/networking/networks/common/proxy_mgr/ssh_util.py | melissa-kam/cloudcafe | 124c0923f7e7628267038cafe64339030bdaefda | [
"Apache-2.0"
] | null | null | null | from collections import OrderedDict
import pexpect
class SshUnableToConnect(Exception):
MSG = 'Unable to connect to: {ip} (Type: {t_type})'
def __init__(self, target_ip=None, target_type=None):
target_type = target_type or 'Not Specified'
args = {'ip': target_ip, 't_type': target_type}
... | 39.672043 | 79 | 0.582283 |
9a6a046c39abe53763000dd70f454b9d78f40e59 | 10,055 | py | Python | glue/viewers/table/qt/viewer_widget.py | Jerry-Ma/glue | 96b9bd3d8c8c9ed3f48f0e91a8829c5f24a04a46 | [
"BSD-3-Clause"
] | 3 | 2015-09-10T22:23:55.000Z | 2019-04-04T18:47:33.000Z | glue/viewers/table/qt/viewer_widget.py | astrofrog/glue | 4aa8c64a6f65629207e40df9963232473a24c9f6 | [
"BSD-3-Clause"
] | null | null | null | glue/viewers/table/qt/viewer_widget.py | astrofrog/glue | 4aa8c64a6f65629207e40df9963232473a24c9f6 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import, division, print_function
import os
import numpy as np
from qtpy.QtCore import Qt
from qtpy import QtCore, QtGui, QtWidgets
from qtpy import PYQT5
from matplotlib.colors import ColorConverter
from glue.utils.qt import get_qapp
from glue.config import viewer_tool
from glue.core.... | 33.294702 | 92 | 0.632223 |
bacbd035dd458fb976315f01756fc291d622c7ac | 2,807 | py | Python | app/core/test/test_models.py | veerpratik/receipe-app-api | a4eda089d71c2d2e953ed5bc9dbb356ee36f4098 | [
"MIT"
] | null | null | null | app/core/test/test_models.py | veerpratik/receipe-app-api | a4eda089d71c2d2e953ed5bc9dbb356ee36f4098 | [
"MIT"
] | null | null | null | app/core/test/test_models.py | veerpratik/receipe-app-api | a4eda089d71c2d2e953ed5bc9dbb356ee36f4098 | [
"MIT"
] | null | null | null | from unittest.mock import patch
from django.test import TestCase
from django.contrib.auth import get_user_model
from core import models
def sample_user(email='test@demo.com', password='testpass'):
"""Create a sample user"""
return get_user_model().objects.create_user(email, password)
class ModelTest(TestCas... | 33.023529 | 77 | 0.631635 |
bb7eace41dfe9e1d4840dc454209efa9cfbdaaef | 21,174 | py | Python | ce_bbx.py | krzysztoffiok/c_elegans_fitness | d16270f882890aa42df55739d9bb0efc2e2168e6 | [
"MIT"
] | 1 | 2022-01-31T15:49:01.000Z | 2022-01-31T15:49:01.000Z | ce_bbx.py | krzysztoffiok/c_elegans_fitness | d16270f882890aa42df55739d9bb0efc2e2168e6 | [
"MIT"
] | null | null | null | ce_bbx.py | krzysztoffiok/c_elegans_fitness | d16270f882890aa42df55739d9bb0efc2e2168e6 | [
"MIT"
] | null | null | null | """
Mask R-CNN Copyright (c) 2017 Matterport, Inc.
Licensed under the MIT License (see LICENSE for details)
Written by Waleed Abdulla
Modified for CElegans fitness assessment by Krzysztof Fiok
------------------------------------------------------------
Example use:
To analyze images:
python3 ce_bbx.py infe... | 38.568306 | 124 | 0.561349 |
70217a2ce52db7b03219d1fde795b4a7d5c8d948 | 119,676 | py | Python | pyboto3/devicefarm.py | thecraftman/pyboto3 | 653a0db2b00b06708334431da8f169d1f7c7734f | [
"MIT"
] | null | null | null | pyboto3/devicefarm.py | thecraftman/pyboto3 | 653a0db2b00b06708334431da8f169d1f7c7734f | [
"MIT"
] | null | null | null | pyboto3/devicefarm.py | thecraftman/pyboto3 | 653a0db2b00b06708334431da8f169d1f7c7734f | [
"MIT"
] | null | null | null | '''
The MIT License (MIT)
Copyright (c) 2016 WavyCloud
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, p... | 35.788278 | 510 | 0.565828 |
31183521bb99403915e6e554582d84246561310d | 2,447 | py | Python | doc/source/conf.py | kumulustech/browbeat | deb3bfc26481ff0bc3ac2633dbf38a26ef9aa6fc | [
"Apache-2.0"
] | null | null | null | doc/source/conf.py | kumulustech/browbeat | deb3bfc26481ff0bc3ac2633dbf38a26ef9aa6fc | [
"Apache-2.0"
] | null | null | null | doc/source/conf.py | kumulustech/browbeat | deb3bfc26481ff0bc3ac2633dbf38a26ef9aa6fc | [
"Apache-2.0"
] | 1 | 2022-01-19T14:00:08.000Z | 2022-01-19T14:00:08.000Z | # 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
# distributed ... | 33.067568 | 79 | 0.695137 |
1fff9e15128d9eb23e99b4fcc48ced167499afc9 | 2,097 | py | Python | test/functional/rpc_estimatefee.py | azsxcv11060/bitcoin | 086dae9878680608e189b9aac2a605254d3b4395 | [
"MIT"
] | 13 | 2019-03-21T03:55:52.000Z | 2022-01-06T17:49:16.000Z | test/functional/rpc_estimatefee.py | azsxcv11060/bitcoin | 086dae9878680608e189b9aac2a605254d3b4395 | [
"MIT"
] | 18 | 2020-10-31T01:04:18.000Z | 2020-11-03T19:25:27.000Z | test/functional/rpc_estimatefee.py | azsxcv11060/bitcoin | 086dae9878680608e189b9aac2a605254d3b4395 | [
"MIT"
] | 5 | 2019-12-17T23:52:00.000Z | 2021-06-13T20:39:56.000Z | #!/usr/bin/env python3
# Copyright (c) 2018-2020 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the estimatefee RPCs.
Test the following RPCs:
- estimatesmartfee
- estimaterawfee
"""
fro... | 40.326923 | 112 | 0.709585 |
f1af1dc27b7c003b938479501b6fa7b936a43b35 | 936 | py | Python | src/python/example.py | barrettotte/IBMi-Book | 911e7389ff80eae72e88cacc4a19dc2b7ede0126 | [
"MIT"
] | 24 | 2019-08-19T23:31:52.000Z | 2022-03-25T12:37:13.000Z | src/python/example.py | barrettotte/IBMi-Book | 911e7389ff80eae72e88cacc4a19dc2b7ede0126 | [
"MIT"
] | 1 | 2019-11-04T14:38:03.000Z | 2019-11-11T14:06:18.000Z | src/python/example.py | barrettotte/IBMi-Book | 911e7389ff80eae72e88cacc4a19dc2b7ede0126 | [
"MIT"
] | 9 | 2019-12-09T14:35:21.000Z | 2021-12-25T10:02:29.000Z | import os, json, getpass, pyodbc
# Get credentials
with open(os.path.abspath('config.json'), 'r') as f:
config = json.load(f)
host = config['host'] if 'host' in config else input("Enter host: ")
user = config['user'] if 'user' in config else input("Enter user: ")
pwd = getpass.getpass('Enter password:... | 31.2 | 90 | 0.653846 |
1a20018810aca71e231531dd6b4c27f07d98ddd0 | 289 | py | Python | gadget/reboot.py | vaginessa/RaspberryPiZero_HID_MultiTool | c6227c7263cb1321a5655f938462392eb014a352 | [
"Apache-2.0"
] | 54 | 2017-01-06T21:43:40.000Z | 2022-02-14T02:57:57.000Z | gadget/reboot.py | vaginessa/RaspberryPiZero_HID_MultiTool | c6227c7263cb1321a5655f938462392eb014a352 | [
"Apache-2.0"
] | null | null | null | gadget/reboot.py | vaginessa/RaspberryPiZero_HID_MultiTool | c6227c7263cb1321a5655f938462392eb014a352 | [
"Apache-2.0"
] | 13 | 2017-01-31T23:35:21.000Z | 2021-12-22T12:48:59.000Z | #!/usr/bin/python
import RPi.GPIO as GPIO
import os
gpio_pin_number=21
GPIO.setmode(GPIO.BCM)
GPIO.setup(gpio_pin_number, GPIO.IN, pull_up_down=GPIO.PUD_UP)
try:
GPIO.wait_for_edge(gpio_pin_number, GPIO.FALLING)
os.system("sudo shutdown -h now")
except:
pass
GPIO.cleanup()
| 18.0625 | 62 | 0.750865 |
3846012a8288d097b318f7c4f1e2572ac5b6d32e | 367 | py | Python | pyFTracks/ressources/__init__.py | underworldcode/pyFTracks | 6050a4327616ebca7ab932b609b25c7c4e6a62f8 | [
"MIT"
] | 4 | 2020-11-02T03:54:52.000Z | 2022-03-04T11:48:26.000Z | pyFTracks/ressources/__init__.py | rbeucher/pyFTracks | 6050a4327616ebca7ab932b609b25c7c4e6a62f8 | [
"MIT"
] | 12 | 2020-03-05T04:04:46.000Z | 2020-03-05T23:27:57.000Z | pyFTracks/ressources/__init__.py | ryanstoner1/pyFTracks | 6050a4327616ebca7ab932b609b25c7c4e6a62f8 | [
"MIT"
] | 2 | 2020-12-29T01:59:07.000Z | 2021-10-15T11:22:57.000Z | import pandas as pd
from pathlib import Path
#Miller1995 = pd.read_hdf((Path(__file__).parent / "Miller1995.h5"), "data")
#Gleadow = pd.read_hdf((Path(__file__).parent / "Gleadow.h5"), "data")
from pyFTracks import Sample
Miller = Sample().read_from_hdf5(Path(__file__).parent / "Miller.h5")
Gleadow = Sample().read_f... | 33.363636 | 76 | 0.735695 |
9b128afd12ce9834be20a300379f8918f86a1510 | 1,624 | py | Python | utils/ds_select_random_pc.py | Weafre/VoxelDNN_v2 | 9fa14eeb5a72ac982f020fa983e2eb9f8a09775d | [
"MIT"
] | 5 | 2021-08-09T08:45:24.000Z | 2022-03-27T02:41:03.000Z | utils/ds_select_random_pc.py | Weafre/VoxelDNN_v2 | 9fa14eeb5a72ac982f020fa983e2eb9f8a09775d | [
"MIT"
] | 1 | 2021-09-14T09:54:29.000Z | 2021-09-14T09:54:29.000Z | utils/ds_select_random_pc.py | Weafre/VoxelDNN_v2 | 9fa14eeb5a72ac982f020fa983e2eb9f8a09775d | [
"MIT"
] | 1 | 2021-08-13T09:43:48.000Z | 2021-08-13T09:43:48.000Z | import logging
logging.basicConfig(
level=logging.INFO,
format='%(asctime)s.%(msecs)03d %(levelname)s %(module)s - %(funcName)s: %(message)s',
datefmt="%Y-%m-%d %H:%M:%S")
logger = logging.getLogger(__name__)
import os
import argparse
import shutil
from os import makedirs
from glob import glob
from tqdm i... | 31.843137 | 90 | 0.682266 |
06d0f289cb914aa6b9f89eb9427f99ae4875d117 | 8,997 | py | Python | NLP_Flask/app/nlp/preprocess/vector_models.py | Gxy-2001/NLPPlat | f339c1a7452b979b413919cf4bc128bf45af52ef | [
"MIT"
] | null | null | null | NLP_Flask/app/nlp/preprocess/vector_models.py | Gxy-2001/NLPPlat | f339c1a7452b979b413919cf4bc128bf45af52ef | [
"MIT"
] | null | null | null | NLP_Flask/app/nlp/preprocess/vector_models.py | Gxy-2001/NLPPlat | f339c1a7452b979b413919cf4bc128bf45af52ef | [
"MIT"
] | null | null | null | from gensim.models import word2vec as wc
from gensim.models import doc2vec as dc
from manage import app
from app.utils.file_utils import getFileURL
def Word2vec(data, params, type):
sentences = []
for vector in data['vectors']:
if 'text1' in type:
sentences.append(vector['text1'])
... | 37.177686 | 118 | 0.644437 |
4a62edf8e2577e075a6af328b336d3e5a0ff5afd | 937 | py | Python | extensions/.stubs/clrclasses/System/Text/RegularExpressions/__init__.py | vicwjb/Pycad | 7391cd694b7a91ad9f9964ec95833c1081bc1f84 | [
"MIT"
] | 1 | 2020-03-25T03:27:24.000Z | 2020-03-25T03:27:24.000Z | extensions/.stubs/clrclasses/System/Text/RegularExpressions/__init__.py | vicwjb/Pycad | 7391cd694b7a91ad9f9964ec95833c1081bc1f84 | [
"MIT"
] | null | null | null | extensions/.stubs/clrclasses/System/Text/RegularExpressions/__init__.py | vicwjb/Pycad | 7391cd694b7a91ad9f9964ec95833c1081bc1f84 | [
"MIT"
] | null | null | null | from __clrclasses__.System.Text.RegularExpressions import Capture
from __clrclasses__.System.Text.RegularExpressions import CaptureCollection
from __clrclasses__.System.Text.RegularExpressions import Group
from __clrclasses__.System.Text.RegularExpressions import GroupCollection
from __clrclasses__.System.Text.RegularE... | 66.928571 | 84 | 0.902882 |
fe145e55b8857c41a49c43c60bb3f12e4fb3179f | 20,545 | py | Python | flux_mito/model_294.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | flux_mito/model_294.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | flux_mito/model_294.py | LoLab-VU/Bayesian_Inference_of_Network_Dynamics | 54a5ef7e868be34289836bbbb024a2963c0c9c86 | [
"MIT"
] | null | null | null | # exported from PySB model 'model'
from pysb import Model, Monomer, Parameter, Expression, Compartment, Rule, Observable, Initial, MatchOnce, Annotation, ANY, WILD
Model()
Monomer('Ligand', ['Receptor'])
Monomer('ParpU', ['C3A'])
Monomer('C8A', ['BidU', 'C3pro'])
Monomer('SmacM', ['BaxA'])
Monomer('BaxM', ['BidM', '... | 95.115741 | 798 | 0.804089 |
81a2463c34012bb603afc99993d37e17a1ea00cb | 1,123 | py | Python | player_amp/api_functions/Logout.py | R0b95/player_amp | f5683ceb3a014bf474bbadc37352c3869abfccf9 | [
"MIT"
] | null | null | null | player_amp/api_functions/Logout.py | R0b95/player_amp | f5683ceb3a014bf474bbadc37352c3869abfccf9 | [
"MIT"
] | null | null | null | player_amp/api_functions/Logout.py | R0b95/player_amp | f5683ceb3a014bf474bbadc37352c3869abfccf9 | [
"MIT"
] | null | null | null | # player_amp
### written in Phyton 3.8.1 by Strolch
import json
import requests
class Logout:
# logout mainpage
def main(server, port, header, sessionid):
mainendpoint = "/API/Core/Logout"
data = {'SESSIONID': sessionid}
Rückgabe = requests.post(url=('http://' + serv... | 31.194444 | 116 | 0.557435 |
7226166cf6652a50e308926e996d0052c35bd170 | 655 | py | Python | scripts/dbsessions2trash.py | spiffytech/MobileBlur | f9d2469caa05f0fe5c05c2ec83d1480cf6b770d8 | [
"BSD-3-Clause"
] | 6 | 2018-01-25T01:07:55.000Z | 2019-04-26T23:58:29.000Z | scripts/dbsessions2trash.py | spiffytech/MobileBlur | f9d2469caa05f0fe5c05c2ec83d1480cf6b770d8 | [
"BSD-3-Clause"
] | null | null | null | scripts/dbsessions2trash.py | spiffytech/MobileBlur | f9d2469caa05f0fe5c05c2ec83d1480cf6b770d8 | [
"BSD-3-Clause"
] | 2 | 2018-02-03T02:55:56.000Z | 2018-02-06T19:55:10.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from datetime import datetime
from time import mktime
from time import sleep
from time import time
DB_URI = 'sqlite://sessions.sqlite'
EXPIRATION_MINUTES = 60
SLEEP_MINUTES = 5
while 1: # Infinite loop
now = time() # get current Unix timestamp
for row in db().se... | 24.259259 | 58 | 0.676336 |
fe8b5da814fdd220b8c1c95bb0b19fa1d6da446b | 3,732 | py | Python | tensorflow_probability/python/math/minimize_test.py | nbro/probability | 07a6378155f0ed720b5aaccf5387e3f9a432bd10 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/math/minimize_test.py | nbro/probability | 07a6378155f0ed720b5aaccf5387e3f9a432bd10 | [
"Apache-2.0"
] | null | null | null | tensorflow_probability/python/math/minimize_test.py | nbro/probability | 07a6378155f0ed720b5aaccf5387e3f9a432bd10 | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 The TensorFlow Probability Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 36.950495 | 80 | 0.678189 |
bf57294052f29e4e6cee21d0eae064d864e8d149 | 7,967 | py | Python | data_process/crys_data.py | GCaptainNemo/materials-ML | 0cbc2097a31968bdd167e25d4bdb0750e57ee9fb | [
"MIT"
] | null | null | null | data_process/crys_data.py | GCaptainNemo/materials-ML | 0cbc2097a31968bdd167e25d4bdb0750e57ee9fb | [
"MIT"
] | null | null | null | data_process/crys_data.py | GCaptainNemo/materials-ML | 0cbc2097a31968bdd167e25d4bdb0750e57ee9fb | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# author: 11360
# datetime: 2021/5/25 16:35
import numpy as np
from numpy import nan
import torch
import ase
class ElementData:
# given formula return atomic number, e.g., element_dict["H"] = 1
element_dict = ase.data.atomic_numbers
# given atomic number, re... | 48.877301 | 238 | 0.404293 |
5f98b31f3f4b2f6cf16f875c6fc5bac4bb6358d4 | 3,950 | py | Python | tensor2tensor/trax/rl/space_serializer_test.py | evalphobia/tensor2tensor | 8a95e96f31d1beccb8efbb2290f6a271600eb3f3 | [
"Apache-2.0"
] | null | null | null | tensor2tensor/trax/rl/space_serializer_test.py | evalphobia/tensor2tensor | 8a95e96f31d1beccb8efbb2290f6a271600eb3f3 | [
"Apache-2.0"
] | null | null | null | tensor2tensor/trax/rl/space_serializer_test.py | evalphobia/tensor2tensor | 8a95e96f31d1beccb8efbb2290f6a271600eb3f3 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2019 The Tensor2Tensor Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 36.238532 | 78 | 0.746582 |
8de8ed8120fe3536b6e68dd355ea11c910ed0714 | 1,282 | py | Python | bubbleSort.py | binnev/what-can-be-computed | 58d01ef09096bda2d0a1876575b992d47fcd0470 | [
"CC-BY-4.0"
] | null | null | null | bubbleSort.py | binnev/what-can-be-computed | 58d01ef09096bda2d0a1876575b992d47fcd0470 | [
"CC-BY-4.0"
] | null | null | null | bubbleSort.py | binnev/what-can-be-computed | 58d01ef09096bda2d0a1876575b992d47fcd0470 | [
"CC-BY-4.0"
] | null | null | null | # SISO program bubbleSort.py
# Sorts the words in an ASCII string into lexicographical
# order, using the well-known bubble sort algorithm.
# inString: Represents a list of words separated by whitespace.
# returns: A string consisting of the input words sorted into
# lexicographical order and separated by space char... | 27.276596 | 77 | 0.617005 |
d2876b52f41747466519fbc70fe5663e9b76171e | 10,945 | py | Python | find_orf.py | Lacona/python-translation-project | 085da4d37f4a0b1817d2b0fb51c5345615b77e7d | [
"CC-BY-4.0"
] | null | null | null | find_orf.py | Lacona/python-translation-project | 085da4d37f4a0b1817d2b0fb51c5345615b77e7d | [
"CC-BY-4.0"
] | null | null | null | find_orf.py | Lacona/python-translation-project | 085da4d37f4a0b1817d2b0fb51c5345615b77e7d | [
"CC-BY-4.0"
] | null | null | null | #! /usr/bin/env python3
import sys
import re
def vet_nucleotide_sequence(sequence):
"""
Return None if `sequence` is a valid RNA or DNA sequence, else raise exception.
Parameters
----------
sequence : str
A string representing a DNA or RNA sequence (upper or lower-case)
Returns
... | 34.968051 | 85 | 0.59534 |
12f77716d99eb40b78741bfd4a4e1c57c70cb03f | 2,283 | py | Python | tests/riscv/paging/paging_memory_attributes_basic_force.py | Wlgen/force-riscv | 9f09b86c5a21ca00f8e5ade8e5186d65bc3e26f8 | [
"Apache-2.0"
] | null | null | null | tests/riscv/paging/paging_memory_attributes_basic_force.py | Wlgen/force-riscv | 9f09b86c5a21ca00f8e5ade8e5186d65bc3e26f8 | [
"Apache-2.0"
] | null | null | null | tests/riscv/paging/paging_memory_attributes_basic_force.py | Wlgen/force-riscv | 9f09b86c5a21ca00f8e5ade8e5186d65bc3e26f8 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (C) [2020] Futurewei Technologies, Inc.
#
# FORCE-RISCV is 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
#
# THIS SOFTWARE IS PR... | 38.05 | 94 | 0.638633 |
2939f189207a1f367a5d3fe4de12c42b9730289b | 2,530 | py | Python | tests/integration/setup/test_egg.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | 1 | 2019-09-17T17:48:55.000Z | 2019-09-17T17:48:55.000Z | tests/integration/setup/test_egg.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | null | null | null | tests/integration/setup/test_egg.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
tests.integration.setup.test_egg
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
'''
# Import python libs
from __future__ import absolute_import, print_function, unicode_literals
import os
import re
import shutil
# Import Salt Testing libs
from tests.support.runtests import RUNTIME_VARS
from tests.suppor... | 36.142857 | 108 | 0.582213 |
a423cf9a62eee4d5708d306a9b3a67e45d08a1a9 | 1,449 | py | Python | sample_generator/sample_generator/wsgi.py | BL-Labs/sample_generator_datatools | 0815454987dfd6ddfae1b0525685eae6b2bda8c2 | [
"MIT"
] | 1 | 2020-02-26T17:01:46.000Z | 2020-02-26T17:01:46.000Z | sample_generator/sample_generator/wsgi.py | BL-Labs/sample_generator_datatools | 0815454987dfd6ddfae1b0525685eae6b2bda8c2 | [
"MIT"
] | null | null | null | sample_generator/sample_generator/wsgi.py | BL-Labs/sample_generator_datatools | 0815454987dfd6ddfae1b0525685eae6b2bda8c2 | [
"MIT"
] | null | null | null | """
WSGI config for sample_generator project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLI... | 43.909091 | 79 | 0.806763 |
4fcdabf72bb23df3361358d89811a2f4714cc1bd | 626 | py | Python | kirberichuk/wsgi.py | kirberich/kirberich.uk | cad723408946afc749dd45ffa8adc2b7197aa815 | [
"Apache-2.0"
] | null | null | null | kirberichuk/wsgi.py | kirberich/kirberich.uk | cad723408946afc749dd45ffa8adc2b7197aa815 | [
"Apache-2.0"
] | null | null | null | kirberichuk/wsgi.py | kirberich/kirberich.uk | cad723408946afc749dd45ffa8adc2b7197aa815 | [
"Apache-2.0"
] | null | null | null | """
WSGI config for kirberichuk project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
from kirberichuk.boot import fix_path
fix_path()
import os
from django.core.wsgi import get_... | 26.083333 | 85 | 0.809904 |
adb50da013c8d4679214bf962f7267584d17d821 | 5,533 | py | Python | merlin/models/tf/prediction_tasks/retrieval.py | rhdong/models | 4b3a1288bff9cc48778e7830d1942f3441bc6c18 | [
"Apache-2.0"
] | null | null | null | merlin/models/tf/prediction_tasks/retrieval.py | rhdong/models | 4b3a1288bff9cc48778e7830d1942f3441bc6c18 | [
"Apache-2.0"
] | null | null | null | merlin/models/tf/prediction_tasks/retrieval.py | rhdong/models | 4b3a1288bff9cc48778e7830d1942f3441bc6c18 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2021, NVIDIA CORPORATION.
#
# 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 ... | 35.696774 | 98 | 0.665462 |
af1e5e6a4ccc6ba8c9b6b9bba8665fdd167f3a8e | 13,342 | py | Python | source/rttov_test/profile-datasets-py/div83/015.py | bucricket/projectMAScorrection | 89489026c8e247ec7c364e537798e766331fe569 | [
"BSD-3-Clause"
] | null | null | null | source/rttov_test/profile-datasets-py/div83/015.py | bucricket/projectMAScorrection | 89489026c8e247ec7c364e537798e766331fe569 | [
"BSD-3-Clause"
] | 1 | 2022-03-12T12:19:59.000Z | 2022-03-12T12:19:59.000Z | source/rttov_test/profile-datasets-py/div83/015.py | bucricket/projectMAScorrection | 89489026c8e247ec7c364e537798e766331fe569 | [
"BSD-3-Clause"
] | null | null | null | """
Profile ../profile-datasets-py/div83/015.py
file automaticaly created by prof_gen.py script
"""
self["ID"] = "../profile-datasets-py/div83/015.py"
self["Q"] = numpy.array([ 2.60257300e+00, 3.31323900e+00, 4.59202900e+00,
5.85201600e+00, 6.37033900e+00, 6.39497900e+00,
6.3408... | 57.508621 | 92 | 0.566931 |
10cfed9c17f9a02f08ea05b9683fb782ace42a0a | 617 | py | Python | release.py | RolandMQuiros/DeBroglie | 6e9d94d844f4a24ae919ab61f042c65ef5834e97 | [
"MIT"
] | null | null | null | release.py | RolandMQuiros/DeBroglie | 6e9d94d844f4a24ae919ab61f042c65ef5834e97 | [
"MIT"
] | null | null | null | release.py | RolandMQuiros/DeBroglie | 6e9d94d844f4a24ae919ab61f042c65ef5834e97 | [
"MIT"
] | null | null | null | import subprocess
import os
import shutil
# Build the project
subprocess.check_call(["dotnet","build","DeBroglie.Console/DeBroglie.Console.csproj","-c","Release"])
# Build the docs
subprocess.check_call(["docfx","docs/docfx.json"])
# Move everything to a fresh folder
shutil.rmtree("release", ignore_errors=True)
shutil.... | 34.277778 | 101 | 0.756888 |
52e46394cea62f5b9639c425462b482b5b8adbfa | 2,734 | py | Python | youtuatools/extractor/wakanim.py | Pagasis/YouTua | edb44b2065a7224f8b26aaf76166bf7287901567 | [
"MIT"
] | 47 | 2021-01-02T07:44:50.000Z | 2022-02-28T22:02:13.000Z | youtuatools/extractor/wakanim.py | Pagasis/YouTua | edb44b2065a7224f8b26aaf76166bf7287901567 | [
"MIT"
] | 4 | 2021-02-07T03:35:13.000Z | 2021-10-31T19:23:53.000Z | youtuatools/extractor/wakanim.py | Pagasis/YouTua | edb44b2065a7224f8b26aaf76166bf7287901567 | [
"MIT"
] | 8 | 2021-01-03T05:44:39.000Z | 2021-11-01T05:46:32.000Z | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
ExtractorError,
merge_dicts,
urljoin,
)
class WakanimIE(InfoExtractor):
_VALID_URL = r"https://(?:www\.)?wakanim\.tv/[^/]+/v2/catalogue/episode/(?P<id>\d+)"
_TESTS = [
{
... | 31.068182 | 130 | 0.483906 |
8491062904216fe5a471c5cdb0afd4a6ff5c9518 | 338 | py | Python | pdb2pqr/pdb2pqr.py | Electrostatics/apbs-etl | 66b6a34e3ebf4ffae921a85344c07e83cc2ad1a9 | [
"BSD-3-Clause"
] | 1 | 2021-09-30T20:46:06.000Z | 2021-09-30T20:46:06.000Z | pdb2pqr/pdb2pqr.py | Electrostatics/apbs-etl | 66b6a34e3ebf4ffae921a85344c07e83cc2ad1a9 | [
"BSD-3-Clause"
] | 23 | 2021-09-30T18:56:53.000Z | 2022-01-04T00:34:41.000Z | pdb2pqr/pdb2pqr.py | Electrostatics/apbs-etl | 66b6a34e3ebf4ffae921a85344c07e83cc2ad1a9 | [
"BSD-3-Clause"
] | null | null | null | """TODO """
from typing import List
from pdbx.containers import DataContainer
from .io import read_input
from .process_cli import process_cli
def main():
"""Hook for command-line usage."""
args = process_cli()
data_containers: List[DataContainer] = read_input(args.input_file)
# transform_data()
... | 19.882353 | 70 | 0.715976 |
fc8ace54483a754bf1a41b20fb89da27ffd60ac8 | 85 | py | Python | tests/context.py | threatlead/amazonscraper | f8b520cfcadf661c0ce587dcbbd3581e8b094b4a | [
"MIT"
] | null | null | null | tests/context.py | threatlead/amazonscraper | f8b520cfcadf661c0ce587dcbbd3581e8b094b4a | [
"MIT"
] | null | null | null | tests/context.py | threatlead/amazonscraper | f8b520cfcadf661c0ce587dcbbd3581e8b094b4a | [
"MIT"
] | null | null | null | import sys
import os
sys.path.insert(0, os.path.abspath('..'))
import amazonscraper
| 14.166667 | 41 | 0.741176 |
90becd6d00bbb48d0c3cccc3a56026653effa77a | 9,598 | py | Python | tensorboard/plugins/graph/graphs_plugin_test.py | SongzzZ/tensorboard | 4ee9ae8a31524131eb56f7a1dc4aa09d7d186f10 | [
"Apache-2.0"
] | 1 | 2020-02-20T05:37:55.000Z | 2020-02-20T05:37:55.000Z | tensorboard/plugins/graph/graphs_plugin_test.py | SongzzZ/tensorboard | 4ee9ae8a31524131eb56f7a1dc4aa09d7d186f10 | [
"Apache-2.0"
] | null | null | null | tensorboard/plugins/graph/graphs_plugin_test.py | SongzzZ/tensorboard | 4ee9ae8a31524131eb56f7a1dc4aa09d7d186f10 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Un... | 36.356061 | 127 | 0.698583 |
e132c4c4161daf831aaf2b929b760b62ade255f1 | 865 | py | Python | test_master.py | markkorput/pyOmxSync | 790c9c96767b19377e89753fc2095e34847d62bf | [
"MIT"
] | 3 | 2018-03-16T12:08:56.000Z | 2021-02-12T16:03:01.000Z | test_master.py | markkorput/pyOmxSync | 790c9c96767b19377e89753fc2095e34847d62bf | [
"MIT"
] | 8 | 2016-09-04T19:10:33.000Z | 2016-09-07T05:52:03.000Z | test_master.py | markkorput/pyOmxSync | 790c9c96767b19377e89753fc2095e34847d62bf | [
"MIT"
] | 6 | 2017-06-07T10:22:14.000Z | 2019-09-21T02:33:05.000Z | #!/usr/bin/env python2
try:
from omxplayer import OMXPlayer
except ImportError:
print("\n!! Could not import OMXPlayer, see https://github.com/willprice/python-omxplayer-wrapper for install instructions !!\n")
from omxsync import Broadcaster
import sys
if len(sys.argv) < 2:
print('No video specified\nUsag... | 23.378378 | 133 | 0.682081 |
ccb0f4f458e57bdeadc14906e9ffd130eee1c0fa | 12,529 | py | Python | Tony/clviz_web_tony_edits/densitygraph.py | NeuroDataDesign/seelviz-archive | cb9bcf7c0f32f0256f71be59dd7d7a9086d0f3b3 | [
"Apache-2.0"
] | null | null | null | Tony/clviz_web_tony_edits/densitygraph.py | NeuroDataDesign/seelviz-archive | cb9bcf7c0f32f0256f71be59dd7d7a9086d0f3b3 | [
"Apache-2.0"
] | 2 | 2017-04-18T02:50:14.000Z | 2017-04-18T18:04:20.000Z | Tony/clviz_web_tony_edits/densitygraph.py | NeuroDataDesign/seelviz-archive | cb9bcf7c0f32f0256f71be59dd7d7a9086d0f3b3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
#-*- coding:utf-8 -*-
from __future__ import print_function
__author__ = 'seelviz'
# import matplotlib as mpl
# mpl.use('Agg')
from skimage import data, img_as_float
from skimage import exposure
import plotly
from plotly.graph_objs import *
import cv2
import collections as col
import math, o... | 35.59375 | 186 | 0.466757 |
0d5e62452e2177ecf590d9c51b26e791defaa506 | 33,069 | py | Python | protectwise_connector.py | splunk-soar-connectors/protectwise | 9c72074bfd33a26754034d7c0b94fe3009d99d2e | [
"Apache-2.0"
] | null | null | null | protectwise_connector.py | splunk-soar-connectors/protectwise | 9c72074bfd33a26754034d7c0b94fe3009d99d2e | [
"Apache-2.0"
] | null | null | null | protectwise_connector.py | splunk-soar-connectors/protectwise | 9c72074bfd33a26754034d7c0b94fe3009d99d2e | [
"Apache-2.0"
] | null | null | null | # File: protectwise_connector.py
#
# Copyright (c) 2016-2022 Splunk 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... | 37.923165 | 143 | 0.628958 |
429503bd083c0b237ec9f247ac58c45386c3d048 | 37,252 | py | Python | gcloudoem/datastore/_generated/datastore_pb2.py | Kapiche/gcloud-datastore-oem | 826acf328359b463a9f1e8761442b3a2d549c13e | [
"Apache-2.0"
] | 1 | 2015-07-08T17:55:18.000Z | 2015-07-08T17:55:18.000Z | gcloudoem/datastore/_generated/datastore_pb2.py | Kapiche/gcloud-datastore-oem | 826acf328359b463a9f1e8761442b3a2d549c13e | [
"Apache-2.0"
] | 8 | 2015-04-30T05:35:50.000Z | 2015-12-14T11:22:01.000Z | gcloudoem/datastore/_generated/datastore_pb2.py | Kapiche/gcloud-datastore-oem | 826acf328359b463a9f1e8761442b3a2d549c13e | [
"Apache-2.0"
] | 2 | 2019-01-05T13:33:53.000Z | 2019-01-06T08:08:51.000Z | # Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/datastore/v1/datastore.proto
import sys
_b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1'))
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf impor... | 41.762332 | 4,517 | 0.763315 |
9d5b506a97e4adbda7f90767b101a9c549d3aaf0 | 1,782 | py | Python | qingstor/qsctl/commands/rb.py | frostyplanet/qsctl | 6f151638e802d6059db2e9b3fb6a519e92804e4f | [
"Apache-2.0"
] | null | null | null | qingstor/qsctl/commands/rb.py | frostyplanet/qsctl | 6f151638e802d6059db2e9b3fb6a519e92804e4f | [
"Apache-2.0"
] | null | null | null | qingstor/qsctl/commands/rb.py | frostyplanet/qsctl | 6f151638e802d6059db2e9b3fb6a519e92804e4f | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# =========================================================================
# Copyright (C) 2016 Yunify, Inc.
# -------------------------------------------------------------------------
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this work except in compli... | 33.622642 | 78 | 0.587542 |
4d57d00d91d8be422770e5a6444277d069836f3d | 1,405 | py | Python | setup.py | kells4real/date_literal | 55960780a30e63cf837263e11a7ab9226f7aadc0 | [
"MIT"
] | 2 | 2021-08-06T10:56:32.000Z | 2022-03-01T11:28:13.000Z | setup.py | kells4real/date_literal | 55960780a30e63cf837263e11a7ab9226f7aadc0 | [
"MIT"
] | null | null | null | setup.py | kells4real/date_literal | 55960780a30e63cf837263e11a7ab9226f7aadc0 | [
"MIT"
] | null | null | null | from setuptools import setup
from os import path
this_directory = path.abspath(path.dirname(__file__))
with open(path.join(this_directory, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
setup(
setup_requires=['wheel'],
name='date_time_literal',
packages=['date_time_literal'],
ver... | 45.322581 | 120 | 0.669039 |
6ac225cb58504719de2d29286ccd7f58efc11302 | 1,934 | py | Python | lagom/envs/vec_env/dummy_vec_env.py | lkylych/lagom | 64777be7f09136072a671c444b5b3fbbcb1b2f18 | [
"MIT"
] | null | null | null | lagom/envs/vec_env/dummy_vec_env.py | lkylych/lagom | 64777be7f09136072a671c444b5b3fbbcb1b2f18 | [
"MIT"
] | null | null | null | lagom/envs/vec_env/dummy_vec_env.py | lkylych/lagom | 64777be7f09136072a671c444b5b3fbbcb1b2f18 | [
"MIT"
] | null | null | null | import numpy as np
from collections import OrderedDict
from lagom.envs.spaces import Box, Dict
from .base import VecEnv
class DummyVecEnv(VecEnv):
def __init__(self, list_make_env):
self.envs = [make_env() for make_env in list_make_env]
observation_space = self.envs[0].observation_space... | 35.814815 | 110 | 0.628232 |
c41b6ba7516caf378753ca85046c066ce5dee6b6 | 158 | py | Python | zhengfang/bdu/model.py | Ethan-Xie/python_study | 0e251709de37d38e3ea9af2202d8f94766d3a64f | [
"MIT"
] | null | null | null | zhengfang/bdu/model.py | Ethan-Xie/python_study | 0e251709de37d38e3ea9af2202d8f94766d3a64f | [
"MIT"
] | null | null | null | zhengfang/bdu/model.py | Ethan-Xie/python_study | 0e251709de37d38e3ea9af2202d8f94766d3a64f | [
"MIT"
] | null | null | null | # author: HuYong
# coding=utf-8
class BDU_Student:
def __init__(self , number , password):
self.number = number
self.password = password
| 19.75 | 43 | 0.651899 |
85fc275976970e367cfa077f58c2298a00417d58 | 6,856 | py | Python | src/stk/serialization/json/serializers/constructed_molecule/constructed_molecule.py | stevenbennett96/stk | 6e5af87625b83e0bfc7243bc42d8c7a860cbeb76 | [
"MIT"
] | null | null | null | src/stk/serialization/json/serializers/constructed_molecule/constructed_molecule.py | stevenbennett96/stk | 6e5af87625b83e0bfc7243bc42d8c7a860cbeb76 | [
"MIT"
] | null | null | null | src/stk/serialization/json/serializers/constructed_molecule/constructed_molecule.py | stevenbennett96/stk | 6e5af87625b83e0bfc7243bc42d8c7a860cbeb76 | [
"MIT"
] | null | null | null | """
Constructed Molecule JSONizer
=============================
"""
from stk.molecular import InchiKey, MoleculeKeyMaker
from ..molecule import MoleculeJsonizer
class ConstructedMoleculeJsonizer:
"""
Abstract base class for creating JSONs of constructed molecules.
See Also
--------
:class:`.Mo... | 29.424893 | 71 | 0.563448 |
71eb8eac1a3f9989eb0bbea7144f9cb5960dd376 | 2,781 | py | Python | tests/service/test_onedocker.py | zhuang-93/FBPCS | 20dbb69fe92bd7d6c2b1b106ea2bdf2909dfcfa2 | [
"MIT"
] | null | null | null | tests/service/test_onedocker.py | zhuang-93/FBPCS | 20dbb69fe92bd7d6c2b1b106ea2bdf2909dfcfa2 | [
"MIT"
] | null | null | null | tests/service/test_onedocker.py | zhuang-93/FBPCS | 20dbb69fe92bd7d6c2b1b106ea2bdf2909dfcfa2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
import unittest
from unittest.mock import patch
from libfb.py.asyncio.mock import AsyncMock
from fbpcs.entity.containe... | 42.136364 | 161 | 0.68968 |
90aafeb92b40a806e730f93fa691df4cd0f15b28 | 1,715 | py | Python | data/p3BR/R2/benchmark/startPyquil184.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R2/benchmark/startPyquil184.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R2/benchmark/startPyquil184.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=2
# total number=34
import pyquil
from pyquil.api import local_forest_runtime, QVMConnection
from pyquil import Program, get_qc
from pyquil.gates import *
import numpy as np
conn = QVMConnection()
def make_circuit()-> Program:
prog = Program() # circuit begin
prog += H(0) # number=1
pr... | 24.5 | 64 | 0.570845 |
185f26b1a2dec43334c8610807983f45792119ee | 413 | py | Python | courses/backend/Learn Django by Creating Projects/projects/helloworld/helloworld_project/asgi.py | Nahid-Hassan/fullstack-software-development | 892ffb33e46795061ea63378279a6469de317b1a | [
"CC0-1.0"
] | null | null | null | courses/backend/Learn Django by Creating Projects/projects/helloworld/helloworld_project/asgi.py | Nahid-Hassan/fullstack-software-development | 892ffb33e46795061ea63378279a6469de317b1a | [
"CC0-1.0"
] | null | null | null | courses/backend/Learn Django by Creating Projects/projects/helloworld/helloworld_project/asgi.py | Nahid-Hassan/fullstack-software-development | 892ffb33e46795061ea63378279a6469de317b1a | [
"CC0-1.0"
] | null | null | null | """
ASGI config for helloworld_project project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('D... | 24.294118 | 78 | 0.79661 |
d288e767d5cc5ac93ce3b8a6ae18992931f800f9 | 15,175 | py | Python | src/tools/dev/masonry/src/core.py | spetruzza/visit | 3041e007790a5fd0716f5c1041004f1b1223093b | [
"BSD-3-Clause"
] | null | null | null | src/tools/dev/masonry/src/core.py | spetruzza/visit | 3041e007790a5fd0716f5c1041004f1b1223093b | [
"BSD-3-Clause"
] | null | null | null | src/tools/dev/masonry/src/core.py | spetruzza/visit | 3041e007790a5fd0716f5c1041004f1b1223093b | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# file: core.py
# author: Cyrus Harrison <cyrush@llnl.gov>
#
#
import os
import subprocess
import datetime
import json
import errno
import webbrowser
from os.path import join as pjoin
__all__ = ["Context",
"shell",
"svn",
"cmake",
"make",
... | 35.455607 | 111 | 0.505766 |
90d4417c0ec7526b6462c4fe1fc28bef54ee46f5 | 2,906 | py | Python | src/sentry/web/frontend/help_platform_base.py | arsh-co/sentry | 7a83a7e8a13047a9471756d679e2deb596cc2ca1 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/web/frontend/help_platform_base.py | arsh-co/sentry | 7a83a7e8a13047a9471756d679e2deb596cc2ca1 | [
"BSD-3-Clause"
] | null | null | null | src/sentry/web/frontend/help_platform_base.py | arsh-co/sentry | 7a83a7e8a13047a9471756d679e2deb596cc2ca1 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from django.db.models import Q
from itertools import groupby
from sentry.models import Project, ProjectKey
from sentry.web.frontend.base import BaseView
class HelpPlatformBaseView(BaseView):
auth_required = False
def get_project_list(self, user):
return list(P... | 31.934066 | 100 | 0.607364 |
2b57721295576b58ec55546ba65a10b5fb906569 | 8,094 | py | Python | src/wordleclone/app.py | jmesparteroup/CS150_ExtraLab_1 | 9a2e26e098d40cf0571e14459c96c42d97b21aa8 | [
"BSD-3-Clause"
] | null | null | null | src/wordleclone/app.py | jmesparteroup/CS150_ExtraLab_1 | 9a2e26e098d40cf0571e14459c96c42d97b21aa8 | [
"BSD-3-Clause"
] | null | null | null | src/wordleclone/app.py | jmesparteroup/CS150_ExtraLab_1 | 9a2e26e098d40cf0571e14459c96c42d97b21aa8 | [
"BSD-3-Clause"
] | null | null | null | """
Wordle Clone
"""
import toga
from toga.style import Pack
from toga.style.pack import COLUMN, ROW
from random import randint
class Vault():
def __init__(self,path) -> None:
self.resources_folder = f"{path}/resources/"
self.guess_list, self.allowed_guesses = self.getGuessData()
self.set... | 35.191304 | 214 | 0.608723 |
bf5563fb92aa6548cbffc74edd86ffc3c536e1f9 | 4,895 | py | Python | extras/ams_wrapper/tests/unit/test_detection_model.py | gnomonsis/model_server | bdd7eccde5dfa4f518f6964c103b4389cd00caaf | [
"Apache-2.0"
] | null | null | null | extras/ams_wrapper/tests/unit/test_detection_model.py | gnomonsis/model_server | bdd7eccde5dfa4f518f6964c103b4389cd00caaf | [
"Apache-2.0"
] | null | null | null | extras/ams_wrapper/tests/unit/test_detection_model.py | gnomonsis/model_server | bdd7eccde5dfa4f518f6964c103b4389cd00caaf | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 44.5 | 112 | 0.501328 |
ffd4ba596e861816800cb7ed67990ba259f5936b | 127,280 | py | Python | designer_family/tests/functional/db/test_allocation_candidates.py | guishaowu/designer_family | c89e16c6649c181f3262aa65fa97a457abdc2eb2 | [
"Apache-2.0"
] | null | null | null | designer_family/tests/functional/db/test_allocation_candidates.py | guishaowu/designer_family | c89e16c6649c181f3262aa65fa97a457abdc2eb2 | [
"Apache-2.0"
] | null | null | null | designer_family/tests/functional/db/test_allocation_candidates.py | guishaowu/designer_family | c89e16c6649c181f3262aa65fa97a457abdc2eb2 | [
"Apache-2.0"
] | null | null | null | # 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
# d... | 40.496341 | 79 | 0.5647 |
07d3a4a000cfe87a42cb705aa06f32d4bef5678d | 13,417 | py | Python | dashlib/dash_tx.py | Ecrypty/florijncoinmnb | ad51ddcf19fde140a19dddd2691b2c5e248a4197 | [
"MIT"
] | null | null | null | dashlib/dash_tx.py | Ecrypty/florijncoinmnb | ad51ddcf19fde140a19dddd2691b2c5e248a4197 | [
"MIT"
] | null | null | null | dashlib/dash_tx.py | Ecrypty/florijncoinmnb | ad51ddcf19fde140a19dddd2691b2c5e248a4197 | [
"MIT"
] | null | null | null | import sys
import os
sys.path.append(os.path.join(os.path.dirname(__file__), '.'))
import re
import binascii
import hashlib
import simplejson as json
from florijncoin_hashs import *
from florijncoin_script import *
def deserialize_script(script):
if isinstance(script, str) and re.match('^[0-9a-fA-F]*$', script)... | 55.904167 | 2,837 | 0.735857 |
ded36e0ba3734df57a2c50dcdb89af160bf3d371 | 7,575 | py | Python | tests/test_routing.py | oondeo/doodba-copier-template | 172cbbfbbb8df405c23a1faf35b2b0b296dab60c | [
"BSL-1.0",
"Apache-2.0"
] | null | null | null | tests/test_routing.py | oondeo/doodba-copier-template | 172cbbfbbb8df405c23a1faf35b2b0b296dab60c | [
"BSL-1.0",
"Apache-2.0"
] | 1 | 2021-05-05T03:47:28.000Z | 2021-05-05T03:47:28.000Z | tests/test_routing.py | oondeo/doodba-copier-template | 172cbbfbbb8df405c23a1faf35b2b0b296dab60c | [
"BSL-1.0",
"Apache-2.0"
] | null | null | null | import time
import uuid
from pathlib import Path
import pytest
import requests
from copier import copy
from packaging import version
from plumbum import local
from plumbum.cmd import docker_compose
@pytest.mark.parametrize("environment", ("test", "prod"))
def test_multiple_domains(
cloned_template: Path,
sup... | 42.79661 | 89 | 0.528317 |
8d8c7b1946bfd64b7d7ee91b613e1ea1f66ac0ce | 832 | py | Python | smbl/prog/plugins/bcftools.py | karel-brinda/snakemake-lib | 5922fa2fc4060d86172e991361a1cceb0af51af8 | [
"MIT"
] | 26 | 2015-03-16T03:37:02.000Z | 2021-01-18T17:34:16.000Z | smbl/prog/plugins/bcftools.py | karel-brinda/smbl | 5922fa2fc4060d86172e991361a1cceb0af51af8 | [
"MIT"
] | 12 | 2015-02-05T10:57:16.000Z | 2016-06-07T18:09:57.000Z | smbl/prog/plugins/bcftools.py | karel-brinda/snakemake-lib | 5922fa2fc4060d86172e991361a1cceb0af51af8 | [
"MIT"
] | 6 | 2015-06-03T20:06:49.000Z | 2020-12-13T09:48:03.000Z | #
# TODO:
# - fix linking error in CygWin
#
import smbl
import snakemake
import os
from ._program import *
BCFTOOLS = get_bin_file_path("bcftools")
VCFUTILS = get_bin_file_path("vcfutils.pl")
##########################################
##########################################
class BcfTools(... | 21.333333 | 82 | 0.627404 |
7f5342c76cb7767039db7c82d5a059cadc828aa6 | 3,273 | py | Python | contracts/type_converter/type_converter.py | ICONationDevTeam/ICONSafe-SCORE | a02640f3bbbf71c633773a87b99d354e2466c26d | [
"Apache-2.0"
] | null | null | null | contracts/type_converter/type_converter.py | ICONationDevTeam/ICONSafe-SCORE | a02640f3bbbf71c633773a87b99d354e2466c26d | [
"Apache-2.0"
] | null | null | null | contracts/type_converter/type_converter.py | ICONationDevTeam/ICONSafe-SCORE | a02640f3bbbf71c633773a87b99d354e2466c26d | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2021 ICONation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 34.452632 | 117 | 0.650474 |
ca7f3ff54d9135507a34926c790bb4bed0d5f195 | 102 | py | Python | optunapi/utils/__init__.py | mbarbetti/optunapi | 48ec23f0b25c9459910e0cc01daa057acd8643e1 | [
"MIT"
] | null | null | null | optunapi/utils/__init__.py | mbarbetti/optunapi | 48ec23f0b25c9459910e0cc01daa057acd8643e1 | [
"MIT"
] | 2 | 2021-05-24T17:18:02.000Z | 2021-05-25T16:00:29.000Z | optunapi/utils/__init__.py | mbarbetti/optunapi | 48ec23f0b25c9459910e0cc01daa057acd8643e1 | [
"MIT"
] | null | null | null | from .suggest_from_config import suggest_from_config
from .create_log_file import create_log_file
| 34 | 52 | 0.862745 |
d45e733688b546436be1e557d0bc0302405acc08 | 284 | py | Python | src/app/admin.py | aminul91/linktutor_restapi | 2077119f9771b31e2aa49f914ebd76451fe3b53c | [
"MIT"
] | null | null | null | src/app/admin.py | aminul91/linktutor_restapi | 2077119f9771b31e2aa49f914ebd76451fe3b53c | [
"MIT"
] | null | null | null | src/app/admin.py | aminul91/linktutor_restapi | 2077119f9771b31e2aa49f914ebd76451fe3b53c | [
"MIT"
] | null | null | null | from django.contrib import admin
from app.models import *
# Register your models here.
from .models import *
admin.site.register(user_infos)
admin.site.register(tutorial_types)
admin.site.register(language_types)
admin.site.register(tutorials_paths)
admin.site.register(suggestions)
| 25.818182 | 36 | 0.823944 |
39f42adf0ba618338c976383685cd2290ad7bbb7 | 4,369 | py | Python | doc/source/examples/plot_mbe_maxcut.py | orodrigoaraizabravo/quantum | aa1edea0ed8bf15c0f0a6547d765eda8e5a3afd7 | [
"BSD-3-Clause"
] | 70 | 2021-07-20T22:42:46.000Z | 2022-03-25T10:17:39.000Z | doc/source/examples/plot_mbe_maxcut.py | orodrigoaraizabravo/quantum | aa1edea0ed8bf15c0f0a6547d765eda8e5a3afd7 | [
"BSD-3-Clause"
] | 2 | 2021-11-07T16:29:18.000Z | 2021-11-15T11:55:23.000Z | doc/source/examples/plot_mbe_maxcut.py | orodrigoaraizabravo/quantum | aa1edea0ed8bf15c0f0a6547d765eda8e5a3afd7 | [
"BSD-3-Clause"
] | 10 | 2021-11-07T14:13:50.000Z | 2022-03-25T10:17:40.000Z | """
Multi-Basis Encoding
--------------------
Multi-Basis Encoding ([1]_) (MBE) quantum optimization algorithm for MaxCut using TensorLy-Quantum.
TensorLy-Quantum provides a Python interface
to build TT-tensor network circuit simulator
for large-scale simulation of variational quantum circuits
with full Autograd sup... | 42.417476 | 174 | 0.731289 |
88028214874bd5b75637115813f1474468015e88 | 4,484 | py | Python | src/check_binkp_node/check_binkp_node.py | buanzo/check_binkp_node | 507bf760dc8daaff69a31ee16e451739a0cafc0a | [
"MIT"
] | 1 | 2021-09-23T14:51:55.000Z | 2021-09-23T14:51:55.000Z | src/check_binkp_node/check_binkp_node.py | buanzo/check_binkp_node | 507bf760dc8daaff69a31ee16e451739a0cafc0a | [
"MIT"
] | null | null | null | src/check_binkp_node/check_binkp_node.py | buanzo/check_binkp_node | 507bf760dc8daaff69a31ee16e451739a0cafc0a | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
import nagiosplugin
from datetime import datetime, timezone
from pprint import pprint
from construct import Int8ub, Struct, this, Bytes, GreedyRange
import time
import socket
import dateparser
__version__ = '0.1'
CONN_TIMEOUT = 10
READ_TIMEOUT = 3
# The v1.0 BINK Protocol spec:... | 35.872 | 130 | 0.600803 |
c6fd0abe25dae2645c2e288141ba61bd26e90787 | 2,747 | py | Python | gcf_demo_excel_report.py | hadi-muhammad/functions-demo | 39185a58d8182f3dc0c00a05e40cc131fc8f54a8 | [
"MIT"
] | null | null | null | gcf_demo_excel_report.py | hadi-muhammad/functions-demo | 39185a58d8182f3dc0c00a05e40cc131fc8f54a8 | [
"MIT"
] | null | null | null | gcf_demo_excel_report.py | hadi-muhammad/functions-demo | 39185a58d8182f3dc0c00a05e40cc131fc8f54a8 | [
"MIT"
] | null | null | null | from pyplatform.datawarehouse import *
from google.cloud import bigquery
import io
from flask import send_file
import datetime
import pytz
def main(request):
_doc_string = """Return excel file in response to POST request. Return function doc_string for GET request.
Keyword Arguments for request body:
... | 36.626667 | 193 | 0.659265 |
c56879d51a27bd0e41030c0efe058f73b056392e | 11,145 | py | Python | theano/misc/pkl_utils.py | michaelosthege/aesara | 55c88832ba71f87c9612d573ede74a4c042ef570 | [
"BSD-3-Clause"
] | 1 | 2020-12-30T19:12:52.000Z | 2020-12-30T19:12:52.000Z | theano/misc/pkl_utils.py | michaelosthege/aesara | 55c88832ba71f87c9612d573ede74a4c042ef570 | [
"BSD-3-Clause"
] | null | null | null | theano/misc/pkl_utils.py | michaelosthege/aesara | 55c88832ba71f87c9612d573ede74a4c042ef570 | [
"BSD-3-Clause"
] | null | null | null | """
Utility classes and methods to pickle parts of symbolic graph.
These pickled graphs can be used, for instance, as cases for
unit tests or regression tests.
"""
import os
import pickle
import sys
import tempfile
import warnings
import zipfile
from collections import defaultdict
from contextlib import closing
from ... | 32.304348 | 81 | 0.628264 |
6a85dbfd365b831c268163a891f6fb284edaf426 | 9,937 | py | Python | fairseq/tasks/fairseq_task.py | jiahaosuda/fairseq | 94fedf0026ee0bdc652bc7c5706568ae27b78375 | [
"BSD-3-Clause"
] | 1 | 2019-03-30T11:24:15.000Z | 2019-03-30T11:24:15.000Z | fairseq/tasks/fairseq_task.py | jiahaosuda/fairseq | 94fedf0026ee0bdc652bc7c5706568ae27b78375 | [
"BSD-3-Clause"
] | null | null | null | fairseq/tasks/fairseq_task.py | jiahaosuda/fairseq | 94fedf0026ee0bdc652bc7c5706568ae27b78375 | [
"BSD-3-Clause"
] | null | null | null | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the LICENSE file in
# the root directory of this source tree. An additional grant of patent rights
# can be found in the PATENTS file in the same directory.
import torch
from fairseq import ... | 37.217228 | 95 | 0.626749 |
fbcac021fd113c214e4ebe1de69cd0c4407e0bd3 | 1,334 | py | Python | test/functional/resendwallettransactions.py | ofichain/ofic | a320b15f1a0bc8d44fa81346b3ad385c35b39852 | [
"MIT"
] | null | null | null | test/functional/resendwallettransactions.py | ofichain/ofic | a320b15f1a0bc8d44fa81346b3ad385c35b39852 | [
"MIT"
] | null | null | null | test/functional/resendwallettransactions.py | ofichain/ofic | a320b15f1a0bc8d44fa81346b3ad385c35b39852 | [
"MIT"
] | 1 | 2018-02-28T02:15:20.000Z | 2018-02-28T02:15:20.000Z | #!/usr/bin/env python3
# Copyright (c) 2017 The Crowncoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test resendwallettransactions RPC."""
from test_framework.test_framework import CrowncoinTestFramework
fr... | 44.466667 | 151 | 0.742129 |
0e34cd79961e3500302924651449e87117ab5baf | 12,064 | py | Python | numpy/typing/_callable.py | AngelGris/numpy | 32b564ade7ef22439b5f2b9c11aa4c63f0ecd6fd | [
"BSD-3-Clause"
] | 4 | 2021-02-19T19:10:50.000Z | 2021-02-23T13:27:44.000Z | numpy/typing/_callable.py | jamiebarker0310/numpy | 3e2406a51845dbefd696d596fd2e0961b92ed09a | [
"BSD-3-Clause"
] | null | null | null | numpy/typing/_callable.py | jamiebarker0310/numpy | 3e2406a51845dbefd696d596fd2e0961b92ed09a | [
"BSD-3-Clause"
] | null | null | null | """
A module with various ``typing.Protocol`` subclasses that implement
the ``__call__`` magic method.
See the `Mypy documentation`_ on protocols for more details.
.. _`Mypy documentation`: https://mypy.readthedocs.io/en/stable/protocols.html#callback-protocols
"""
from __future__ import annotations
import sys
fro... | 34.079096 | 114 | 0.604609 |
766a3f6169114c51451d04e5edfeec6645698993 | 1,199 | py | Python | raw_data/get_raw_data.py | preversewharf45/game_recommendation_system | 6922d8d8099473057b3c0676092b567b2715ed88 | [
"MIT"
] | null | null | null | raw_data/get_raw_data.py | preversewharf45/game_recommendation_system | 6922d8d8099473057b3c0676092b567b2715ed88 | [
"MIT"
] | null | null | null | raw_data/get_raw_data.py | preversewharf45/game_recommendation_system | 6922d8d8099473057b3c0676092b567b2715ed88 | [
"MIT"
] | 1 | 2021-06-08T16:55:41.000Z | 2021-06-08T16:55:41.000Z |
import pandas as pd
import glob
import os.path
def get_raw_data( name, script_rel_path = "" ):
file_path = ""
# Releative path of `get_raw_data.py` script.
if ( script_rel_path != "" ):
file_path = script_rel_path + "/"
# `user_reviews_raw` is handled separately because
# it's splitted into multiple parts.
... | 29.975 | 83 | 0.676397 |
3483897e42d3e15b3613bf0635e0724d0616faba | 36,694 | py | Python | rpython/rlib/rmmap.py | m4sterchain/mesapy | ed546d59a21b36feb93e2309d5c6b75aa0ad95c9 | [
"Apache-2.0",
"OpenSSL"
] | 381 | 2018-08-18T03:37:22.000Z | 2022-02-06T23:57:36.000Z | rpython/rlib/rmmap.py | m4sterchain/mesapy | ed546d59a21b36feb93e2309d5c6b75aa0ad95c9 | [
"Apache-2.0",
"OpenSSL"
] | 16 | 2018-09-22T18:12:47.000Z | 2022-02-22T20:03:59.000Z | rpython/rlib/rmmap.py | m4sterchain/mesapy | ed546d59a21b36feb93e2309d5c6b75aa0ad95c9 | [
"Apache-2.0",
"OpenSSL"
] | 30 | 2018-08-20T03:16:34.000Z | 2022-01-12T17:39:22.000Z | """Interp-level mmap-like object.
Note that all the methods assume that the mmap is valid (or writable, for
writing methods). You have to call check_valid() from the higher-level API,
as well as maybe check_writeable(). In the case of PyPy, this is done from
pypy/module/mmap/.
"""
from rpython.rtyper.tool import rf... | 37.867905 | 90 | 0.551017 |
4ea093c247066f0a43c2990302bdb26c81a6c721 | 3,505 | py | Python | unet/train.py | dylanv/unet | 31f0deac92c89fff9a86573439235efc09fb1b37 | [
"MIT"
] | null | null | null | unet/train.py | dylanv/unet | 31f0deac92c89fff9a86573439235efc09fb1b37 | [
"MIT"
] | null | null | null | unet/train.py | dylanv/unet | 31f0deac92c89fff9a86573439235efc09fb1b37 | [
"MIT"
] | null | null | null | import os
from pathlib import Path
import albumentations as A
import cv2
import matplotlib.pyplot as plt
import torch
from albumentations.pytorch import ToTensorV2
from ignite.contrib.handlers import ProgressBar
from ignite.contrib.metrics import GpuInfo
from ignite.engine import Events, create_supervised_evaluator, c... | 34.362745 | 120 | 0.701569 |
a03e154ecd6d6f397f2e95cc2c55d3f3a48cfdbe | 1,733 | py | Python | src/test/dir_stats_test.py | ferzerkerx/git-greenseer | 5e5a054a366ac6295a0d7b977bc44f7923da7291 | [
"MIT"
] | 3 | 2015-10-02T19:37:44.000Z | 2016-11-01T19:06:13.000Z | src/test/dir_stats_test.py | ferzerkerx/git-greenseer | 5e5a054a366ac6295a0d7b977bc44f7923da7291 | [
"MIT"
] | null | null | null | src/test/dir_stats_test.py | ferzerkerx/git-greenseer | 5e5a054a366ac6295a0d7b977bc44f7923da7291 | [
"MIT"
] | null | null | null | __author__ = 'fmontes'
import unittest
from main.contribution_stats import ContributionStats
from main.dir_stats import DirStats
class DirStatsTest(unittest.TestCase):
def test_add_file_contributions(self):
dir_name = '/someDir'
dir_stats = DirStats(dir_name)
dir_stats.add_file_contribu... | 39.386364 | 94 | 0.729371 |
c370fd8730be8a57bf73a3c93883bf0055a37580 | 6,630 | py | Python | cogs_hidden/logs.py | Saizuo/EpicBot | 45cebe79b7bf90c0a067162fb3646a176cb6394a | [
"BSD-3-Clause"
] | 3 | 2021-09-13T11:28:49.000Z | 2022-02-21T15:16:35.000Z | cogs_hidden/logs.py | Saizuo/EpicBot | 45cebe79b7bf90c0a067162fb3646a176cb6394a | [
"BSD-3-Clause"
] | 1 | 2021-09-27T07:45:29.000Z | 2021-09-27T07:45:29.000Z | cogs_hidden/logs.py | Saizuo/EpicBot | 45cebe79b7bf90c0a067162fb3646a176cb6394a | [
"BSD-3-Clause"
] | null | null | null | """
Copyright 2021 Nirlep_5252_
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
d... | 40.674847 | 183 | 0.633635 |
917a3acde58cbb601e3fe33318443144feb9ed4d | 7,998 | py | Python | cryptoapis/model/uri_not_found.py | xan187/Crypto_APIs_2.0_SDK_Python | a56c75df54ef037b39be1315ed6e54de35bed55b | [
"MIT"
] | null | null | null | cryptoapis/model/uri_not_found.py | xan187/Crypto_APIs_2.0_SDK_Python | a56c75df54ef037b39be1315ed6e54de35bed55b | [
"MIT"
] | null | null | null | cryptoapis/model/uri_not_found.py | xan187/Crypto_APIs_2.0_SDK_Python | a56c75df54ef037b39be1315ed6e54de35bed55b | [
"MIT"
] | 1 | 2021-07-21T03:35:18.000Z | 2021-07-21T03:35:18.000Z | """
CryptoAPIs
Crypto APIs 2.0 is a complex and innovative infrastructure layer that radically simplifies the development of any Blockchain and Crypto related applications. Organized around REST, Crypto APIs 2.0 can assist both novice Bitcoin/Ethereum enthusiasts and crypto experts with the development of thei... | 42.770053 | 484 | 0.606902 |
b24b28731c61f272f73e2bd079ce13afff17bb1e | 132,649 | py | Python | Lib/test/pickletester.py | diogommartins/cinder | 79103e9119cbecef3b085ccf2878f00c26e1d175 | [
"CNRI-Python-GPL-Compatible"
] | 1,886 | 2021-05-03T23:58:43.000Z | 2022-03-31T19:15:58.000Z | Lib/test/pickletester.py | diogommartins/cinder | 79103e9119cbecef3b085ccf2878f00c26e1d175 | [
"CNRI-Python-GPL-Compatible"
] | 70 | 2021-05-04T23:25:35.000Z | 2022-03-31T18:42:08.000Z | Lib/test/pickletester.py | diogommartins/cinder | 79103e9119cbecef3b085ccf2878f00c26e1d175 | [
"CNRI-Python-GPL-Compatible"
] | 52 | 2021-05-04T21:26:03.000Z | 2022-03-08T18:02:56.000Z | import collections
import copyreg
import dbm
import io
import functools
import os
import math
import pickle
import pickletools
import shutil
import struct
import sys
import threading
import unittest
import weakref
from textwrap import dedent
from http.cookies import SimpleCookie
try:
import _testbuffer
except Impo... | 35.928765 | 89 | 0.535737 |
491ee4a702cd033e771b2ef59f19c85a19e80d1f | 1,139 | py | Python | openwisp_utils/admin_theme/email.py | totallynotvaishnav/openwisp-utils | e8902a1bf5adea30167ce319be52927427cdbd5e | [
"BSD-3-Clause"
] | null | null | null | openwisp_utils/admin_theme/email.py | totallynotvaishnav/openwisp-utils | e8902a1bf5adea30167ce319be52927427cdbd5e | [
"BSD-3-Clause"
] | 1 | 2022-01-25T17:46:52.000Z | 2022-01-25T17:46:52.000Z | openwisp_utils/admin_theme/email.py | Aryamanz29/openwisp-utils | c5558fc14a22316e49e9144d39216de348e19b05 | [
"BSD-3-Clause"
] | null | null | null | import logging
from smtplib import SMTPRecipientsRefused
from django.conf import settings
from django.core.mail import EmailMultiAlternatives
from django.template.loader import render_to_string
from django.utils.html import strip_tags
from . import settings as app_settings
logger = logging.getLogger(__name__)
def ... | 28.475 | 76 | 0.703248 |
944f8a5196086da000f1b5a9686251b886d4a831 | 1,442 | py | Python | bootstrapvz/base/fs/partitionmaps/none.py | wrigri/bootstrap-vz | 52b5846cb5acd5551fd818b9e84f42683455a3e5 | [
"Apache-2.0"
] | null | null | null | bootstrapvz/base/fs/partitionmaps/none.py | wrigri/bootstrap-vz | 52b5846cb5acd5551fd818b9e84f42683455a3e5 | [
"Apache-2.0"
] | null | null | null | bootstrapvz/base/fs/partitionmaps/none.py | wrigri/bootstrap-vz | 52b5846cb5acd5551fd818b9e84f42683455a3e5 | [
"Apache-2.0"
] | null | null | null | from ..partitions.single import SinglePartition
class NoPartitions(object):
"""Represents a virtual 'NoPartitions' partitionmap.
This virtual partition map exists because it is easier for tasks to
simply always deal with partition maps and then let the base abstract that away.
"""
def __init__(self, data, secto... | 31.347826 | 99 | 0.71914 |
e0b4d28958563f1cccfa618a0903713af58a1abe | 3,412 | py | Python | python/cuml/test/test_incremental_pca.py | ptartan21/cuml | 4ce9b4181d47996a39406322d0e2009bd83db211 | [
"Apache-2.0"
] | null | null | null | python/cuml/test/test_incremental_pca.py | ptartan21/cuml | 4ce9b4181d47996a39406322d0e2009bd83db211 | [
"Apache-2.0"
] | null | null | null | python/cuml/test/test_incremental_pca.py | ptartan21/cuml | 4ce9b4181d47996a39406322d0e2009bd83db211 | [
"Apache-2.0"
] | null | null | null | #
# Copyright (c) 2020, NVIDIA CORPORATION.
#
# 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 ... | 31.592593 | 77 | 0.656506 |
d6c7d96356b39542086e801a542fa98187043e4d | 5,530 | py | Python | tungsten_tempest_plugin/tests/api/contrail/test_database.py | hemcreddy/tungstenfabric-tungsten-tempest | ce646a563c291dfdd0e57a7f0f11d5ca818e3143 | [
"Apache-2.0"
] | null | null | null | tungsten_tempest_plugin/tests/api/contrail/test_database.py | hemcreddy/tungstenfabric-tungsten-tempest | ce646a563c291dfdd0e57a7f0f11d5ca818e3143 | [
"Apache-2.0"
] | null | null | null | tungsten_tempest_plugin/tests/api/contrail/test_database.py | hemcreddy/tungstenfabric-tungsten-tempest | ce646a563c291dfdd0e57a7f0f11d5ca818e3143 | [
"Apache-2.0"
] | null | null | null | # Copyright 2016 AT&T Corp
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 43.203125 | 78 | 0.68264 |
72fa261f69b79322b3c73fcb199f203549225812 | 72,506 | py | Python | state_moves.py | Orangeplumber/Chess-AI | d5baff14a1df6c01b2ca71970cf5775a0723392f | [
"MIT"
] | 1 | 2021-07-24T18:35:19.000Z | 2021-07-24T18:35:19.000Z | training/state_moves.py | Orangeplumber/Chess-AI | d5baff14a1df6c01b2ca71970cf5775a0723392f | [
"MIT"
] | null | null | null | training/state_moves.py | Orangeplumber/Chess-AI | d5baff14a1df6c01b2ca71970cf5775a0723392f | [
"MIT"
] | null | null | null | MOVES={'p7': [[], [], [], [], [], [], [], [], [[16, 24], [17]], [[16], [17, 25], [18]], [[17], [18, 26], [19]], [[18], [19, 27], [20]], [[19], [20, 28], [21]], [[20], [21, 29], [22]], [[21], [22, 30], [23]], [[22], [23, 31]], [[24], [25]], [[24], [25], [26]], [[25], [26], [27]], [[26], [27], [28]], [[27], [28], [29]], ... | 671.351852 | 69,434 | 0.358398 |
76bb16faba426c0f0276db7ab0fece03fbab9473 | 2,459 | py | Python | tf-2-workflow/train_model/train.py | scott2b/amazon-sagemaker-script-mode | ccb7edf0cd9d1e77bd951bfaa48d14dc95ce2aca | [
"Apache-2.0"
] | 144 | 2019-02-05T21:03:30.000Z | 2022-03-24T15:24:32.000Z | tf-2-workflow/train_model/train.py | kirit93/amazon-sagemaker-script-mode | 095af07488889bb2655b741749d8740d3e11a49e | [
"Apache-2.0"
] | 22 | 2019-03-04T04:18:02.000Z | 2022-03-09T00:21:36.000Z | tf-2-workflow/train_model/train.py | kirit93/amazon-sagemaker-script-mode | 095af07488889bb2655b741749d8740d3e11a49e | [
"Apache-2.0"
] | 94 | 2019-02-05T21:03:33.000Z | 2022-01-16T07:29:15.000Z | import argparse
import numpy as np
import os
import tensorflow as tf
from model_def import get_model
os.environ['TF_CPP_MIN_LOG_LEVEL'] = '3'
def parse_args():
parser = argparse.ArgumentParser()
# hyperparameters sent by the client are passed as command-line arguments to the script
parser.add_arg... | 31.126582 | 103 | 0.661651 |
bc32d65b9d98033ae3edb3bc37c04408370910dd | 3,136 | py | Python | test/test_elements.py | sigvaldm/symfem | 5b51748a49015bb37839d1ca39bb26348b33936a | [
"MIT"
] | null | null | null | test/test_elements.py | sigvaldm/symfem | 5b51748a49015bb37839d1ca39bb26348b33936a | [
"MIT"
] | null | null | null | test/test_elements.py | sigvaldm/symfem | 5b51748a49015bb37839d1ca39bb26348b33936a | [
"MIT"
] | null | null | null | import pytest
import symfem
from symfem import create_element
from symfem.symbolic import subs, x, all_symequal
from .utils import test_elements
def test_all_tested():
for e in symfem.create._elementlist:
for r in e.references:
if r == "dual polygon":
continue
for n... | 35.235955 | 89 | 0.648916 |
1024b27ee6d88e721c501207317fa21837ff99f9 | 17,628 | py | Python | 4_validate_model/2_validation_plots.py | opentargets/genetics-l2g-scoring | 79a660ddb86adb20453de8d5589262e429c13d09 | [
"Apache-2.0"
] | 4 | 2020-05-04T20:03:13.000Z | 2020-08-12T16:22:54.000Z | 4_validate_model/2_validation_plots.py | opentargets/genetics-l2g-scoring | 79a660ddb86adb20453de8d5589262e429c13d09 | [
"Apache-2.0"
] | null | null | null | 4_validate_model/2_validation_plots.py | opentargets/genetics-l2g-scoring | 79a660ddb86adb20453de8d5589262e429c13d09 | [
"Apache-2.0"
] | 3 | 2020-05-07T20:31:52.000Z | 2021-11-04T11:09:13.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Ed Mountjoy
#
'''
Analyses predictions
'''
import sys
import os
import pandas as pd
from pprint import pprint
import json
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.gridspec as gridspec
import sklearn.metrics as skmet
from sklearn.metrics impo... | 34.769231 | 129 | 0.554005 |
78540cdf82a79ce5df2a465910fb029815d8c1e5 | 1,071 | py | Python | _assignments/basics/function/function_parameters_c.py | sages-pl/2022-01-pythonsqlalchemy-aptiv | 1d6d856608e9dbe25b139e8968c48b7f46753b84 | [
"MIT"
] | null | null | null | _assignments/basics/function/function_parameters_c.py | sages-pl/2022-01-pythonsqlalchemy-aptiv | 1d6d856608e9dbe25b139e8968c48b7f46753b84 | [
"MIT"
] | null | null | null | _assignments/basics/function/function_parameters_c.py | sages-pl/2022-01-pythonsqlalchemy-aptiv | 1d6d856608e9dbe25b139e8968c48b7f46753b84 | [
"MIT"
] | null | null | null | """
* Assignment: Function Parameters Default
* Required: yes
* Complexity: easy
* Lines of code: 4 lines
* Time: 3 min
English:
1. Define function `default` with two parameters
2. Parameter `a` is required
3. Parameter `b` is optional and has default value `None`
4. If only one argument was passed, co... | 27.461538 | 78 | 0.628385 |
c1fd6b71c4780e71e95cf64f65e3d9ba55cfcde9 | 12,744 | py | Python | 6-0001-fall-2016/ps3/ps3.py | mekilis/MIT-Edx-Ocw | cd78a28c64c98fb8abf0ab147bc8db4cf880e980 | [
"MIT"
] | null | null | null | 6-0001-fall-2016/ps3/ps3.py | mekilis/MIT-Edx-Ocw | cd78a28c64c98fb8abf0ab147bc8db4cf880e980 | [
"MIT"
] | null | null | null | 6-0001-fall-2016/ps3/ps3.py | mekilis/MIT-Edx-Ocw | cd78a28c64c98fb8abf0ab147bc8db4cf880e980 | [
"MIT"
] | null | null | null | # 6.0001 Problem Set 3
#
# The 6.0001 Word Game
# Created by: Kevin Luu <luuk> and Jenna Wiens <jwiens>
#
# Name : <your name>
# Collaborators : <your collaborators>
# Time spent : <total time>
import math
import random
import string
VOWELS = 'aeiou*'
CONSONANTS = 'bcdfghjklmnpqrstvwxyz'
HA... | 31.544554 | 213 | 0.591886 |
370924cdfa199c3b19fd232e3a91e25a0272ce05 | 4,252 | py | Python | scripts/sync_flake8_versions.py | umangino/pandas | c492672699110fe711b7f76ded5828ff24bce5ab | [
"BSD-3-Clause"
] | 3 | 2018-04-24T13:31:51.000Z | 2019-07-09T07:31:43.000Z | scripts/sync_flake8_versions.py | umangino/pandas | c492672699110fe711b7f76ded5828ff24bce5ab | [
"BSD-3-Clause"
] | 354 | 2018-05-26T13:28:49.000Z | 2022-03-31T01:11:46.000Z | scripts/sync_flake8_versions.py | umangino/pandas | c492672699110fe711b7f76ded5828ff24bce5ab | [
"BSD-3-Clause"
] | 5 | 2018-04-24T13:31:56.000Z | 2021-10-21T05:06:23.000Z | """
Check that the flake8 (and pandas-dev-flaker) pins are the same in:
- environment.yml
- .pre-commit-config.yaml, in the flake8 hook
- .pre-commit-config.yaml, in the additional dependencies of the yesqa hook
The flake8 hook revision in .pre-commit-config.yaml is taken as the reference revision.
Usage: either
- ... | 29.123288 | 88 | 0.662512 |
5126ba215b52f9a4f5ee29aa91f6c9819cb8872b | 3,428 | py | Python | mineapy/tutorials/e_coli_gem_tutorials.py | vpandey-om/mineapy | a533196244d17aa69a5846eb6e197bd4899797b0 | [
"Apache-2.0"
] | null | null | null | mineapy/tutorials/e_coli_gem_tutorials.py | vpandey-om/mineapy | a533196244d17aa69a5846eb6e197bd4899797b0 | [
"Apache-2.0"
] | null | null | null | mineapy/tutorials/e_coli_gem_tutorials.py | vpandey-om/mineapy | a533196244d17aa69a5846eb6e197bd4899797b0 | [
"Apache-2.0"
] | null | null | null | import mineapy
from cobra.io import load_matlab_model,load_json_model
import pandas as pd
from mineapy.core.taskEnrich import TaskEnrichment
from mineapy.core.thermo_model import ThermoModel_WithoutInfo
from mineapy.core.rxnExp import ReactionExp
import pytfa
from pytfa.io import read_compartment_data, apply_compartme... | 27.869919 | 149 | 0.789673 |
aaa7e40efe58e1d453a2e4c137c3436fb3327c8d | 42,676 | py | Python | django/views/debug.py | blaze33/django | 2f6d887bd0a110e3a662ac1d056d6cdabf38632b | [
"BSD-3-Clause"
] | null | null | null | django/views/debug.py | blaze33/django | 2f6d887bd0a110e3a662ac1d056d6cdabf38632b | [
"BSD-3-Clause"
] | null | null | null | django/views/debug.py | blaze33/django | 2f6d887bd0a110e3a662ac1d056d6cdabf38632b | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
import datetime
import os
import re
import sys
import types
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.http import (HttpResponse, HttpResponseServerError,
HttpResponseNotFound, HttpRequest, build_request_repr)
from d... | 38.343217 | 251 | 0.594784 |
2c487bd5efd19f9918ffc7db43580efe51e6a283 | 845 | py | Python | bluebottle/projects/migrations/0039_add_project_image_group_permissions.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 10 | 2015-05-28T18:26:40.000Z | 2021-09-06T10:07:03.000Z | bluebottle/projects/migrations/0039_add_project_image_group_permissions.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 762 | 2015-01-15T10:00:59.000Z | 2022-03-31T15:35:14.000Z | bluebottle/projects/migrations/0039_add_project_image_group_permissions.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 9 | 2015-02-20T13:19:30.000Z | 2022-03-08T14:09:17.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2017-09-15 11:58
from __future__ import unicode_literals
from django.db import migrations
from bluebottle.utils.utils import update_group_permissions
def add_group_permissions(apps, schema_editor):
group_perms = {
'Anonymous': {
'perms... | 23.472222 | 77 | 0.639053 |
f38a9550ad41fe79e75d1e72c47974f90854d360 | 10,469 | py | Python | src/livestreamer/stream/hls_playlist.py | jaccarmac/livestreamer | ab80dbd6560f6f9835865b2fc9f9c6015aee5658 | [
"BSD-2-Clause",
"MIT"
] | 3,614 | 2015-01-01T08:07:27.000Z | 2022-03-20T00:31:07.000Z | src/livestreamer/stream/hls_playlist.py | kviktor/livestreamer | ab80dbd6560f6f9835865b2fc9f9c6015aee5658 | [
"BSD-2-Clause",
"MIT"
] | 1,028 | 2015-01-02T03:38:38.000Z | 2021-08-06T16:17:48.000Z | src/livestreamer/stream/hls_playlist.py | kviktor/livestreamer | ab80dbd6560f6f9835865b2fc9f9c6015aee5658 | [
"BSD-2-Clause",
"MIT"
] | 795 | 2015-01-02T06:12:04.000Z | 2022-03-27T23:41:53.000Z | import re
from binascii import unhexlify
from collections import namedtuple
from itertools import starmap
try:
from urlparse import urljoin
except ImportError:
from urllib.parse import urljoin
__all__ = ["load", "M3U8Parser"]
# EXT-X-BYTERANGE
ByteRange = namedtuple("ByteRange", "range offset")
# EXT-X-KE... | 37.389286 | 81 | 0.568918 |
0b383b28a1c709e0258f40b6e8d78a74eac39eea | 2,852 | py | Python | models/exercise/plot_two_strain_ts.py | tethig/sismid | 6104195619ae2ddbd91921872ffde2b7c83b01ac | [
"CC-BY-4.0",
"MIT"
] | null | null | null | models/exercise/plot_two_strain_ts.py | tethig/sismid | 6104195619ae2ddbd91921872ffde2b7c83b01ac | [
"CC-BY-4.0",
"MIT"
] | null | null | null | models/exercise/plot_two_strain_ts.py | tethig/sismid | 6104195619ae2ddbd91921872ffde2b7c83b01ac | [
"CC-BY-4.0",
"MIT"
] | 1 | 2022-02-21T09:05:32.000Z | 2022-02-21T09:05:32.000Z | ################################################################### #
# Basic plot for two-strain SIR model:
# Time series given some initial conditions
####################################################################
import sys
import csv
import numpy as np
import matplotlib as mpl
mpl.use('TkAg... | 31.688889 | 87 | 0.613955 |
5bcabe4cef7c793bd6dcd6a32bdc96ec647b7f5e | 11,147 | py | Python | torchknickknacks/modelutils.py | AlGoulas/torchknickknacks | d7c70b7af9845ab24bd0f8d4d0e230918bac7144 | [
"MIT"
] | 4 | 2021-11-23T15:15:07.000Z | 2022-01-31T14:37:16.000Z | torchknickknacks/modelutils.py | AlGoulas/torchknickknacks | d7c70b7af9845ab24bd0f8d4d0e230918bac7144 | [
"MIT"
] | null | null | null | torchknickknacks/modelutils.py | AlGoulas/torchknickknacks | d7c70b7af9845ab24bd0f8d4d0e230918bac7144 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from collections import OrderedDict
from functools import partial
from pathlib import Path
import pickle
import torch
def get_model_params(model, params_to_get = None, detach = True):
'''Extracts the parameters, names, and 'requires gradient' status from a
mod... | 35.613419 | 107 | 0.592805 |
e67522cbe4a624d8b939ea0fcff67b2bce6b424a | 100 | py | Python | run4it/api/user/__init__.py | andraune/Run4IT_BackEnd | a481427a0d1189a1f08c42e7ac1b452af6bbfc8d | [
"MIT"
] | 1 | 2022-03-29T06:11:20.000Z | 2022-03-29T06:11:20.000Z | run4it/api/user/__init__.py | andraune/run4it_backend | a481427a0d1189a1f08c42e7ac1b452af6bbfc8d | [
"MIT"
] | null | null | null | run4it/api/user/__init__.py | andraune/run4it_backend | a481427a0d1189a1f08c42e7ac1b452af6bbfc8d | [
"MIT"
] | null | null | null | # add this to force db migrate to detect models
from .model import User, UserConfirmation # noqa
| 33.333333 | 50 | 0.76 |
1ab20f8f07f603c9b01d3f21024cb55b03532396 | 4,776 | py | Python | lib/game/bot.py | Pavivenkatesan/kivy-tictactoe | bca0a9753017402ddd49a1c3552f1a97a820a653 | [
"MIT"
] | null | null | null | lib/game/bot.py | Pavivenkatesan/kivy-tictactoe | bca0a9753017402ddd49a1c3552f1a97a820a653 | [
"MIT"
] | null | null | null | lib/game/bot.py | Pavivenkatesan/kivy-tictactoe | bca0a9753017402ddd49a1c3552f1a97a820a653 | [
"MIT"
] | null | null | null | import random
import numpy as np
from lib.game.player import Player
from itertools import product
class Bot(Player):
state_space = [[' ', ' ', ' '], [' ', ' ', ' '], [' ', ' ', ' ']]
# Initializing state values
each_player = ['X', 'O', ' ']
states_dictionary = {}
# listing all possible states
... | 37.606299 | 114 | 0.54062 |
b6373fd0b2398b1af4945c8a787113cc4ab4cd35 | 9,175 | py | Python | cartography/intel/aws/ec2/tgw.py | sckevmit/cartography | fefb63b5ec97986dcc29038331d0e5b027b95d5f | [
"Apache-2.0"
] | 2,322 | 2019-03-02T01:07:20.000Z | 2022-03-31T20:39:12.000Z | cartography/intel/aws/ec2/tgw.py | sckevmit/cartography | fefb63b5ec97986dcc29038331d0e5b027b95d5f | [
"Apache-2.0"
] | 462 | 2019-03-07T18:38:11.000Z | 2022-03-31T14:55:20.000Z | cartography/intel/aws/ec2/tgw.py | sckevmit/cartography | fefb63b5ec97986dcc29038331d0e5b027b95d5f | [
"Apache-2.0"
] | 246 | 2019-03-03T02:39:23.000Z | 2022-02-24T09:46:38.000Z | import logging
from typing import Dict
from typing import List
import boto3
import botocore.exceptions
import neo4j
from .util import get_botocore_config
from cartography.util import aws_handle_regions
from cartography.util import run_cleanup_job
from cartography.util import timeit
logger = logging.getLogger(__name_... | 35.288462 | 157 | 0.680981 |
e33ca7fc699ca6cc1f3e064db2ddb7b2fe8db069 | 2,119 | py | Python | purdue/models/dining.py | ScriptedButton/BoilerBot | 80419d075cc51f5d90652070b851334bd9382eaa | [
"Apache-2.0"
] | 2 | 2021-08-05T04:25:45.000Z | 2021-08-05T05:55:24.000Z | purdue/models/dining.py | ScriptedButton/BoilerBot | 80419d075cc51f5d90652070b851334bd9382eaa | [
"Apache-2.0"
] | null | null | null | purdue/models/dining.py | ScriptedButton/BoilerBot | 80419d075cc51f5d90652070b851334bd9382eaa | [
"Apache-2.0"
] | null | null | null | import aiohttp
class Dining:
def __init__(self):
import purdue.models
self._LOCATION_URL = "https://api.hfs.purdue.edu/menus/v2/locations"
self._locations: list[purdue.models.Location] = list()
def get_location(self, name):
for location in self.locations:
if locatio... | 45.085106 | 87 | 0.515809 |
9de4c90e5df54335c98bdebe28bfc1ceb315924c | 5,296 | py | Python | app/auth/authorisation.py | dudikbender/geocoder-api | 3879f7729fcc7658f6ae75e65e187af4667cc393 | [
"MIT"
] | null | null | null | app/auth/authorisation.py | dudikbender/geocoder-api | 3879f7729fcc7658f6ae75e65e187af4667cc393 | [
"MIT"
] | null | null | null | app/auth/authorisation.py | dudikbender/geocoder-api | 3879f7729fcc7658f6ae75e65e187af4667cc393 | [
"MIT"
] | null | null | null | from fastapi import Depends, APIRouter, HTTPException, Security, status
from fastapi.security.http import HTTPAuthorizationCredentials, HTTPBearer, HTTPBasic, HTTPBasicCredentials
from fastapi.security import OAuth2PasswordBearer, OAuth2PasswordRequestForm
import os
from dotenv import find_dotenv, load_dotenv
import pa... | 37.560284 | 107 | 0.723943 |
dfd4401bce065b834531e06ceb2b277c34c88178 | 983 | py | Python | Algorithms_easy/1271. Hexspeak.py | VinceW0/Leetcode_Python_solutions | 09e9720afce21632372431606ebec4129eb79734 | [
"Xnet",
"X11"
] | 4 | 2020-08-11T20:45:15.000Z | 2021-03-12T00:33:34.000Z | Algorithms_easy/1271. Hexspeak.py | VinceW0/Leetcode_Python_solutions | 09e9720afce21632372431606ebec4129eb79734 | [
"Xnet",
"X11"
] | null | null | null | Algorithms_easy/1271. Hexspeak.py | VinceW0/Leetcode_Python_solutions | 09e9720afce21632372431606ebec4129eb79734 | [
"Xnet",
"X11"
] | null | null | null | """
1271. Hexspeak
Easy
A decimal number can be converted to its Hexspeak representation by first converting it to an uppercase hexadecimal string, then replacing all occurrences of the digit 0 with the letter O, and the digit 1 with the letter I. Such a representation is valid if and only if it consists only of the ... | 28.911765 | 355 | 0.682604 |
79521fcbfb967e650cb7e2059d63cc45c8045a9e | 1,202 | py | Python | config.py | marcdjulien/govindex | 18740206e54aecfb4193e910e5076ee504229779 | [
"MIT"
] | null | null | null | config.py | marcdjulien/govindex | 18740206e54aecfb4193e910e5076ee504229779 | [
"MIT"
] | null | null | null | config.py | marcdjulien/govindex | 18740206e54aecfb4193e910e5076ee504229779 | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
"""
Copyright (c) 2019 - present AppSeed.us
"""
import os
from decouple import config
class Config(object):
basedir = os.path.abspath(os.path.dirname(__file__))
SECRET_KEY = config('SECRET_KEY', default='sdnfogui3wn')
SQLALCHEMY_DATABASE_URI = config('SQLALCHEMY_DATABASE_URI',... | 28.619048 | 94 | 0.633943 |
16c07bd40b0480b995a6c42232cd9d87a3c15660 | 442 | py | Python | explorer/notes/migrations/0013_auto_20191126_1408.py | UPstartDeveloper/explorer_buddy | 467fa77307a588645e7a9fd269ae13b6b24d4efc | [
"MIT"
] | null | null | null | explorer/notes/migrations/0013_auto_20191126_1408.py | UPstartDeveloper/explorer_buddy | 467fa77307a588645e7a9fd269ae13b6b24d4efc | [
"MIT"
] | 22 | 2019-12-05T01:10:16.000Z | 2022-03-12T00:06:51.000Z | explorer/notes/migrations/0013_auto_20191126_1408.py | UPstartDeveloper/explorer_buddy | 467fa77307a588645e7a9fd269ae13b6b24d4efc | [
"MIT"
] | null | null | null | # Generated by Django 2.2.5 on 2019-11-26 22:08
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('notes', '0012_auto_20191126_1142'),
]
operations = [
migrations.AlterField(
model_name='note',
name='media',
... | 23.263158 | 111 | 0.61086 |
5971161ca781f643c9d23acb275b3795886ab8a3 | 8,952 | py | Python | reaction_completer/completer.py | CederGroupHub/ReactionCompleter | 6b20a9a4ffdf19e0d51c99901d104d8f737ce762 | [
"MIT"
] | null | null | null | reaction_completer/completer.py | CederGroupHub/ReactionCompleter | 6b20a9a4ffdf19e0d51c99901d104d8f737ce762 | [
"MIT"
] | null | null | null | reaction_completer/completer.py | CederGroupHub/ReactionCompleter | 6b20a9a4ffdf19e0d51c99901d104d8f737ce762 | [
"MIT"
] | null | null | null | import logging
from functools import reduce
from operator import or_
import sympy
from sympy import Matrix, symbols
from reaction_completer.errors import (
StupidRecipe, TooManyPrecursors, TooFewPrecursors)
from reaction_completer.formatting import simplify_print
from reaction_completer.material import MaterialIn... | 37.3 | 100 | 0.607797 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.