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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6a7923fe09f0cbd3612c0b00250e0afba288bb79 | 13,134 | py | Python | fgerrit/fgerrit.py | pandemicsyn/fgerrit | 012f027c0fc4786895d82145a1d0ef0eed5afcca | [
"Apache-2.0"
] | 1 | 2018-07-30T08:06:11.000Z | 2018-07-30T08:06:11.000Z | fgerrit/fgerrit.py | pandemicsyn/fgerrit | 012f027c0fc4786895d82145a1d0ef0eed5afcca | [
"Apache-2.0"
] | null | null | null | fgerrit/fgerrit.py | pandemicsyn/fgerrit | 012f027c0fc4786895d82145a1d0ef0eed5afcca | [
"Apache-2.0"
] | 1 | 2018-07-03T17:46:00.000Z | 2018-07-03T17:46:00.000Z | #!/usr/bin/env python
# http://gerrit-documentation.googlecode.com/svn/Documentation/2.2.2/cmd-
# query.html
VALID_SCORES = ['-2', '-1', '-0', '0', '+0', '+1', '+2']
| 38.291545 | 79 | 0.523603 | #!/usr/bin/env python
# http://gerrit-documentation.googlecode.com/svn/Documentation/2.2.2/cmd-
# query.html
import pkg_resources
import subprocess
from datetime import datetime
import simplejson as json
import time
import tempfile
import textwrap
import pydoc
import os
VALID_SCORES = ['-2', '-1', '-0', '0', '+0', ... | 0 | 0 | 0 | 11,521 | 0 | 1,185 | 0 | -36 | 291 |
b9d313e24391adc72291ba5c376eef1d9108a704 | 3,572 | py | Python | src/phoenics/DatabaseHandler/PandasWriters/db_writer.py | taotao720/experiment_planners | 811e331d4a5cff39882ada32d5f068d858000276 | [
"Apache-2.0"
] | 5 | 2019-11-26T02:23:38.000Z | 2020-07-20T15:17:46.000Z | src/phoenics/DatabaseHandler/PandasWriters/db_writer.py | taotao720/experiment_planners | 811e331d4a5cff39882ada32d5f068d858000276 | [
"Apache-2.0"
] | 4 | 2021-11-11T13:28:08.000Z | 2022-01-17T16:32:58.000Z | src/phoenics/DatabaseHandler/PandasWriters/db_writer.py | taotao720/experiment_planners | 811e331d4a5cff39882ada32d5f068d858000276 | [
"Apache-2.0"
] | 2 | 2019-11-25T17:46:07.000Z | 2020-06-28T23:20:32.000Z | #!/usr/bin/env python
'''
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with this
work for additional information regarding copyright ownership. The ASF
licenses this file to you under the Apache License, Version 2.0 (the
"License... | 29.04065 | 110 | 0.673572 | #!/usr/bin/env python
'''
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with this
work for additional information regarding copyright ownership. The ASF
licenses this file to you under the Apache License, Version 2.0 (the
"License... | 0 | 0 | 0 | 2,266 | 0 | 0 | 0 | 13 | 159 |
f36dcb9c0ed46d720c47378c6340d3627751cae5 | 1,287 | py | Python | setup.py | rscottbailey/stick | 6e3c31bec393b78d53d44144e9a0c03c82971b8f | [
"Apache-2.0"
] | 1 | 2020-01-22T23:36:11.000Z | 2020-01-22T23:36:11.000Z | setup.py | rscottbailey/stick | 6e3c31bec393b78d53d44144e9a0c03c82971b8f | [
"Apache-2.0"
] | 4 | 2019-12-10T21:59:47.000Z | 2019-12-12T20:39:29.000Z | setup.py | rscottbailey/stick | 6e3c31bec393b78d53d44144e9a0c03c82971b8f | [
"Apache-2.0"
] | 1 | 2019-12-10T17:17:55.000Z | 2019-12-10T17:17:55.000Z | # -*- coding: utf-8 -*-
from os import chdir
from os.path import abspath, dirname
from setuptools import find_packages, setup
chdir(dirname(abspath(__file__)))
version = {}
with open('README.rst') as f:
readme = f.read()
with open('requirements.txt') as f:
requirements = f.read().splitlines()
setup(
a... | 28.6 | 114 | 0.634033 | # -*- coding: utf-8 -*-
from os import chdir
from os.path import abspath, dirname
from setuptools import find_packages, setup
chdir(dirname(abspath(__file__)))
version = {}
with open('README.rst') as f:
readme = f.read()
with open('requirements.txt') as f:
requirements = f.read().splitlines()
setup(
a... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0c0b95f008867fee1feca5a87ebf8f7b5dec8a81 | 235 | py | Python | nnutil/display.py | ichiyonnana/nntools_maya | 6a0aa39194cac00aac35e9eca6fcf2b12a70f373 | [
"MIT"
] | 1 | 2022-01-09T06:02:55.000Z | 2022-01-09T06:02:55.000Z | nnutil/display.py | ichiyonnana/nntools_maya | 6a0aa39194cac00aac35e9eca6fcf2b12a70f373 | [
"MIT"
] | null | null | null | nnutil/display.py | ichiyonnana/nntools_maya | 6a0aa39194cac00aac35e9eca6fcf2b12a70f373 | [
"MIT"
] | null | null | null | # coding:utf-8
"""
"""
import maya.cmds as cmds
def message(s, do_print=True):
""" inVewMessage """
cmds.inViewMessage(smg=s, pos="topCenter", bkc="0x00000000", fade=True)
if do_print:
print(s) | 19.583333 | 76 | 0.6 | # coding:utf-8
""" 表示関連
"""
import maya.cmds as cmds
def message(s, do_print=True):
""" 簡易 inVewMessage """
cmds.inViewMessage(smg=s, pos="topCenter", bkc="0x00000000", fade=True)
if do_print:
print(s) | 18 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
40346a343dcc52088f57a8a250ae962724c505e4 | 6,129 | py | Python | diseaseSimulation/pygame_template.py | puszka123/DiseaseSimulation | 0165fcc8095a54ba901c273b8ed69ef7dce9279e | [
"MIT"
] | null | null | null | diseaseSimulation/pygame_template.py | puszka123/DiseaseSimulation | 0165fcc8095a54ba901c273b8ed69ef7dce9279e | [
"MIT"
] | null | null | null | diseaseSimulation/pygame_template.py | puszka123/DiseaseSimulation | 0165fcc8095a54ba901c273b8ed69ef7dce9279e | [
"MIT"
] | null | null | null | import os
os.environ['SDL_VIDEO_WINDOW_POS'] = "%d,%d" % (50,50)
| 35.633721 | 119 | 0.573666 | import pygame
import world
from settings import *
import settings
import map
import os
import simulation
from monitor import *
os.environ['SDL_VIDEO_WINDOW_POS'] = "%d,%d" % (50,50)
class Cameraman(pygame.sprite.Sprite):
def __init__(self):
pygame.sprite.Sprite.__init__(self)
self.image = pygame.S... | 0 | 0 | 0 | 5,852 | 0 | 0 | 0 | -37 | 246 |
5edb11e5f422fbaf9ea350143dc7017e990b8616 | 5,019 | py | Python | propertyfinder.py | rajawajahat/propertyfinder_crawler | 30ec0dc76dbe4dc3128e90a213885d64617d7ee3 | [
"MIT"
] | null | null | null | propertyfinder.py | rajawajahat/propertyfinder_crawler | 30ec0dc76dbe4dc3128e90a213885d64617d7ee3 | [
"MIT"
] | null | null | null | propertyfinder.py | rajawajahat/propertyfinder_crawler | 30ec0dc76dbe4dc3128e90a213885d64617d7ee3 | [
"MIT"
] | null | null | null | import requests
from bs4 import BeautifulSoup
import random
import sqlite3
import time
# Headers.
headers = {
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',
'referrer': 'https://google.com',
'Accept': 't... | 30.791411 | 145 | 0.631998 | import requests
from bs4 import BeautifulSoup
from selenium import webdriver
import random
import sqlite3
import time
# Headers.
headers = {
'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/56.0.2924.87 Safari/537.36',
'referrer': 'https://go... | 0 | 0 | 0 | 0 | 0 | 961 | 0 | 9 | 53 |
9e77dc20d5240a04c7e3aaf84622d2b43419e9bf | 2,710 | py | Python | upydev/helpinfo.py | Carglglz/upydev | 6f852e145be63705c9c8306931ffc2adac5cec12 | [
"MIT"
] | 36 | 2019-08-14T15:59:44.000Z | 2022-01-17T17:33:47.000Z | upydev/helpinfo.py | Carglglz/upydev | 6f852e145be63705c9c8306931ffc2adac5cec12 | [
"MIT"
] | 21 | 2019-08-15T06:11:38.000Z | 2021-01-30T22:05:24.000Z | upydev/helpinfo.py | Carglglz/upydev | 6f852e145be63705c9c8306931ffc2adac5cec12 | [
"MIT"
] | 3 | 2020-05-01T22:32:34.000Z | 2021-01-30T20:16:19.000Z | import upydev
UPYDEV_PATH = upydev.__path__[0]
HELP_INFO_ARG = '''Mode/Tools:
> DEVICE MANAGEMENT: '$ upydev dm' to see help on device management.
ACTIONS : config, check, set, make_group, mg_group, see, gg
> FILEIO: '$ upydev fio' to see help on file input/ouput operations.
ACTIONS: put, get, fget, dsync, ... | 32.650602 | 105 | 0.651661 | import upydev
import json
import os
import textwrap
import webbrowser
UPYDEV_PATH = upydev.__path__[0]
HELP_INFO_ARG = '''Mode/Tools:
> DEVICE MANAGEMENT: '$ upydev dm' to see help on device management.
ACTIONS : config, check, set, make_group, mg_group, see, gg
> FILEIO: '$ upydev fio' to see help on file inpu... | 0 | 0 | 0 | 0 | 0 | 879 | 0 | -32 | 134 |
4008a2562243496ad5d1f1c3eb651ddbfa44fc03 | 2,052 | py | Python | weather.py | lkesteloot/thermostat | 2af49d731c9fc32d30aaa5b890b601c85a95f689 | [
"MIT"
] | null | null | null | weather.py | lkesteloot/thermostat | 2af49d731c9fc32d30aaa5b890b601c85a95f689 | [
"MIT"
] | 8 | 2020-03-06T05:59:08.000Z | 2020-03-15T22:33:47.000Z | weather.py | lkesteloot/thermostat | 2af49d731c9fc32d30aaa5b890b601c85a95f689 | [
"MIT"
] | null | null | null | # Code to get the current weather information.
import secrets
# Downtown San Francisco:
URL = 'https://forecast.weather.gov/MapClick.php?lat=37.775&lon=-122.418&unit=0&lg=english&FcstType=json'
# Get just current status.
DARK_SKY_URL = "https://api.darksky.net/forecast/" + secrets.DARK_SKY_SECRET_KEY + \
"/" ... | 30.176471 | 105 | 0.701754 | # Code to get the current weather information.
import urllib.request
import json
import secrets
import time
# Downtown San Francisco:
URL = 'https://forecast.weather.gov/MapClick.php?lat=37.775&lon=-122.418&unit=0&lg=english&FcstType=json'
# Get just current status.
DARK_SKY_URL = "https://api.darksky.net/forecast/"... | 0 | 0 | 0 | 0 | 0 | 1,330 | 0 | -20 | 158 |
b10bc9cb489364acb12be77807963ec797e3cff6 | 5,502 | py | Python | ninopianino/generator.py | NinoDoko/nino_pianino | 2a459695932abea720103c85f486daa1145af3b2 | [
"MIT"
] | 2 | 2016-10-20T10:53:00.000Z | 2020-11-16T03:18:08.000Z | ninopianino/generator.py | NinoDoko/nino_pianino | 2a459695932abea720103c85f486daa1145af3b2 | [
"MIT"
] | null | null | null | ninopianino/generator.py | NinoDoko/nino_pianino | 2a459695932abea720103c85f486daa1145af3b2 | [
"MIT"
] | null | null | null |
#If this value is supplied, the Key class will write down all notes it generates in the file specified.
dir_write_note = ''
if __name__ == '__main__' :
main()
| 44.016 | 421 | 0.653944 | from midiutil.MidiFile import MIDIFile
import music_models, argparse, random, note_timing, copy, json, subprocess
#If this value is supplied, the Key class will write down all notes it generates in the file specified.
dir_write_note = ''
def set_dir_write_note(new_dir):
global dir_write_note
dir_write_note =... | 0 | 0 | 0 | 0 | 0 | 4,940 | 0 | 70 | 312 |
35be2f0373fbcbf9bc48920badefd425cec2b02c | 197 | py | Python | MotunrayoKoyejo/Phase 1/Python Basic 1/Day4/Q26.py | CodedLadiesInnovateTech/-python-challenge-solutions | 430cd3eb84a2905a286819eef384ee484d8eb9e7 | [
"MIT"
] | 6 | 2020-05-23T19:53:25.000Z | 2021-05-08T20:21:30.000Z | MotunrayoKoyejo/Phase 1/Python Basic 1/Day4/Q26.py | CodedLadiesInnovateTech/-python-challenge-solutions | 430cd3eb84a2905a286819eef384ee484d8eb9e7 | [
"MIT"
] | 8 | 2020-05-14T18:53:12.000Z | 2020-07-03T00:06:20.000Z | MotunrayoKoyejo/Phase 1/Python Basic 1/Day4/Q26.py | CodedLadiesInnovateTech/-python-challenge-solutions | 430cd3eb84a2905a286819eef384ee484d8eb9e7 | [
"MIT"
] | 39 | 2020-05-10T20:55:02.000Z | 2020-09-12T17:40:59.000Z |
hist([1,2,3,4]) | 19.7 | 25 | 0.42132 | def hist(items):
for item in items:
result = ''
times = item
while(times >0):
result += '#'
times -= 1
print(result)
hist([1,2,3,4]) | 0 | 0 | 0 | 0 | 0 | 159 | 0 | 0 | 22 |
5c82354460f7f529a4dff820d16a2e947d932531 | 1,430 | py | Python | tests.py | ematysek/Riot-API-Webapp | fae505ce7487d983231de98ccb4e7c89f99e3ba1 | [
"MIT"
] | null | null | null | tests.py | ematysek/Riot-API-Webapp | fae505ce7487d983231de98ccb4e7c89f99e3ba1 | [
"MIT"
] | 2 | 2021-06-02T04:27:55.000Z | 2021-06-02T04:27:56.000Z | tests.py | ematysek/Riot-API-Webapp | fae505ce7487d983231de98ccb4e7c89f99e3ba1 | [
"MIT"
] | null | null | null | import unittest
if __name__ == '__main__':
if __name__ == '__main__':
unittest.main(verbosity=2)
| 24.237288 | 62 | 0.661538 | import os
import unittest
from app import create_app, db
from app.default_conf import Config
class TestConfig(Config):
TESTING = True
SQLALCHEMY_DATABASE_URI = 'sqlite://'
DEBUG = False
FLASK_ENV = 'testing'
class BaseCase(unittest.TestCase):
def setUp(self):
self.app = create_app(TestC... | 0 | 0 | 0 | 1,144 | 0 | 0 | 0 | 11 | 159 |
d12df8dca851637d363ddc0972594641528054df | 3,019 | py | Python | capture_frame_from_webcam.py | Michael07220823/new_face | 0a888ef9e21992d6f7ffcae28c908804ecf47207 | [
"MIT"
] | 1 | 2021-11-16T23:34:30.000Z | 2021-11-16T23:34:30.000Z | capture_frame_from_webcam.py | Michael07220823/new_face | 0a888ef9e21992d6f7ffcae28c908804ecf47207 | [
"MIT"
] | null | null | null | capture_frame_from_webcam.py | Michael07220823/new_face | 0a888ef9e21992d6f7ffcae28c908804ecf47207 | [
"MIT"
] | 1 | 2022-01-17T05:59:33.000Z | 2022-01-17T05:59:33.000Z | import os
import logging
import cv2
from new_tools.media import check_image, FPS
from new_timer import get_now_time, AutoTimer
# Set logging config.
FORMAT = '%(asctime)s [%(levelname)s] %(message)s'
DATE_FORMAT = '%Y-%m-%d %H:%M:%S'
logging.basicConfig(level=logging.INFO, format=FORMAT, datefmt=DATE_FORMAT)
... | 41.356164 | 151 | 0.59523 | import os
import logging
import cv2
from new_tools.media import check_image, FPS
from new_timer import get_now_time, AutoTimer
# Set logging config.
FORMAT = '%(asctime)s [%(levelname)s] %(message)s'
DATE_FORMAT = '%Y-%m-%d %H:%M:%S'
logging.basicConfig(level=logging.INFO, format=FORMAT, datefmt=DATE_FORMAT)
... | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f542099e96a6295b3c564bd295e23d4d7faf7a50 | 4,572 | py | Python | attemps.py | KadinTucker/Temporary-NUMA01 | be7ff381d8016b7028e79c19c5aebf59ffeff644 | [
"MIT"
] | 1 | 2019-12-26T03:48:40.000Z | 2019-12-26T03:48:40.000Z | attemps.py | KadinTucker/Basket-Ball | be7ff381d8016b7028e79c19c5aebf59ffeff644 | [
"MIT"
] | 1 | 2019-12-24T14:22:32.000Z | 2019-12-24T14:49:52.000Z | attemps.py | KadinTucker/Basket-Ball | be7ff381d8016b7028e79c19c5aebf59ffeff644 | [
"MIT"
] | null | null | null | import constants
import math
import numpy as np
#Defining the 'air resistance constant', compiling all of the constants that affect the force of drag on our basketball
AIR_RES_CONSTANT = constants.AIR_DENSITY * constants.AIR_RES_C * math.pi * constants.DIAMETER * constants.DIAMETER / 8.0
def get_euler_solution(deriva... | 39.076923 | 164 | 0.697507 | import constants
import math
import matplotlib.pyplot as plt
import numpy as np
#Defining the 'air resistance constant', compiling all of the constants that affect the force of drag on our basketball
AIR_RES_CONSTANT = constants.AIR_DENSITY * constants.AIR_RES_C * math.pi * constants.DIAMETER * constants.DIAMETER / 8.... | 0 | 0 | 0 | 0 | 0 | 439 | 0 | 10 | 97 |
34e996cb7b6dca8bc6ed408d1b2c89adb5def370 | 3,082 | py | Python | src/Image.py | PengJiaqiao/Video2Ascii | 24d268bc6c241ad59276e81d6140b853077ba515 | [
"MIT"
] | 6 | 2018-08-16T13:15:31.000Z | 2021-08-30T13:10:56.000Z | src/Image.py | PengJiaqiao/Video2Ascii | 24d268bc6c241ad59276e81d6140b853077ba515 | [
"MIT"
] | null | null | null | src/Image.py | PengJiaqiao/Video2Ascii | 24d268bc6c241ad59276e81d6140b853077ba515 | [
"MIT"
] | null | null | null |
# Cut grey scale image into several small block and different character for different scale
# referencehttp://paulbourke.net/dataformats/asciiart/
# 10 levels
gscale = '@%#+=:. '
# 70 levels (works worse than less levels)
# gscale_more = "$@B%8&WM#*oahkbdpqwmZO0QLCJUYXzcvunxrjft/\|()1{}[]?-_+~<>i!lI;:,\"^`'. "
| 35.022727 | 91 | 0.448086 | import numpy as np
import math
import os
from PIL import Image as Img
# Cut grey scale image into several small block and different character for different scale
# reference:http://paulbourke.net/dataformats/asciiart/
# 10 levels
gscale = '@%#+=:. '
# 70 levels (works worse than less levels)
# gscale_more = "$@B%8&WM... | 30 | 0 | 0 | 2,665 | 0 | 0 | 0 | -18 | 111 |
226993b1c263f14f88b100ae2c2fe2974bebfc39 | 16,539 | py | Python | investing/data.py | addisonklinke/investing | 975051d5ab0af4527fc89402859ce16f8f55f91b | [
"MIT"
] | 4 | 2019-05-17T16:53:18.000Z | 2021-04-30T18:25:54.000Z | investing/data.py | addisonklinke/investing | 975051d5ab0af4527fc89402859ce16f8f55f91b | [
"MIT"
] | 4 | 2020-08-26T01:29:40.000Z | 2021-02-17T04:45:10.000Z | investing/data.py | addisonklinke/investing | 975051d5ab0af4527fc89402859ce16f8f55f91b | [
"MIT"
] | 1 | 2021-07-18T13:00:00.000Z | 2021-07-18T13:00:00.000Z | """
Ticker data is stored on disk at the location specified by
``config['paths']['save']`` with two columns (price and date). Data can be
loaded into Python and accessed via the `Ticker` class. This class has methods
to calculate descriptive statistics such as trailing and rolling returns of
differing time periods. Mul... | 39.285036 | 113 | 0.619687 | """
Ticker data is stored on disk at the location specified by
``config['paths']['save']`` with two columns (price and date). Data can be
loaded into Python and accessed via the `Ticker` class. This class has methods
to calculate descriptive statistics such as trailing and rolling returns of
differing time periods. Mul... | 0 | 1,050 | 0 | 10,934 | 0 | 0 | 0 | 60 | 222 |
b8b97c8a48e6f9543a83759739b73e2f521a65f5 | 798 | py | Python | app/extensions/api_docs/cms/dict_type.py | Allen7D/mini-shop-server | 5f3ddd5a4e5e99a1e005f11abc620cefff2493fc | [
"MIT"
] | 533 | 2019-01-19T07:12:00.000Z | 2022-03-30T09:08:46.000Z | app/extensions/api_docs/cms/dict_type.py | Alimazing/mini-shop-server | 5f3ddd5a4e5e99a1e005f11abc620cefff2493fc | [
"MIT"
] | 8 | 2019-06-10T03:58:54.000Z | 2021-06-10T08:21:19.000Z | app/extensions/api_docs/cms/dict_type.py | Allen7D/mini-shop-server | 5f3ddd5a4e5e99a1e005f11abc620cefff2493fc | [
"MIT"
] | 161 | 2019-01-24T04:06:21.000Z | 2022-03-14T06:05:16.000Z | # _*_ coding: utf-8 _*_
"""
Created by Allen7D on 2020/6/15.
"""
from app.core.swagger_filed import StringPathFiled, StringQueryFiled, BodyField
__author__ = 'Allen7D'
type_id_in_path = StringPathFiled(
name='id', description='ID', enum=[1, 2, 3, 4, 5, 10, 100], default=1)
type_id_in_query = StringQueryFiled(
... | 44.333333 | 118 | 0.694236 | # _*_ coding: utf-8 _*_
"""
Created by Allen7D on 2020/6/15.
"""
from app.core.swagger_filed import StringPathFiled, StringQueryFiled, BodyField
__author__ = 'Allen7D'
type_id_in_path = StringPathFiled(
name='id', description='字典类型ID', enum=[1, 2, 3, 4, 5, 10, 100], default=1)
type_id_in_query = StringQueryFile... | 96 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4468d6cee4882b1aa3bcfbd50e2d13f2dc4c1bd8 | 3,124 | py | Python | tools/tuning.py | brmson/sts-data | e1d3375f5b3bc24f21aa4e46f96eb379e9fc1081 | [
"CC-BY-4.0"
] | 690 | 2016-01-22T23:26:35.000Z | 2022-03-25T08:37:54.000Z | tools/tuning.py | brmson/sts-data | e1d3375f5b3bc24f21aa4e46f96eb379e9fc1081 | [
"CC-BY-4.0"
] | 44 | 2016-01-31T16:01:02.000Z | 2019-03-25T21:33:28.000Z | tools/tuning.py | brmson/sts-data | e1d3375f5b3bc24f21aa4e46f96eb379e9fc1081 | [
"CC-BY-4.0"
] | 230 | 2016-01-26T03:04:25.000Z | 2022-02-21T04:10:27.000Z | #!/usr/bin/python3
"""
Tune hyperparameters of a KeraSTS model on the given task, that is
train + evaluate the model with many different randomly samples config
settings.
Usage: tools/tuning.py MODEL TASK TRAINDATA VALDATA PARAM=VALUESET...
Example:
tools/tuning.py cnn anssel data/anssel/wang/train-all.csv data/a... | 33.234043 | 112 | 0.650128 | #!/usr/bin/python3
"""
Tune hyperparameters of a KeraSTS model on the given task, that is
train + evaluate the model with many different randomly samples config
settings.
Usage: tools/tuning.py MODEL TASK TRAINDATA VALDATA PARAM=VALUESET...
Example:
tools/tuning.py cnn anssel data/anssel/wang/train-all.csv data/a... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 72 | 180 |
f3e4e037174e7a3e5f3e1fdf652580805a21e1e4 | 339 | py | Python | python/__init__.py | hhhaiai/IuKey | 9a2266f7d000b83b62c66fb7a2e6afcc323226a8 | [
"Apache-2.0"
] | null | null | null | python/__init__.py | hhhaiai/IuKey | 9a2266f7d000b83b62c66fb7a2e6afcc323226a8 | [
"Apache-2.0"
] | null | null | null | python/__init__.py | hhhaiai/IuKey | 9a2266f7d000b83b62c66fb7a2e6afcc323226a8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@Copyright 2021 sanbo Inc. All rights reserved.
@Description:
@Version: 1.0
@Create: 2021-01-15 12:32:54
@author: sanbo
'''
from run_core import LanZouCloud
version = '1.2.0'
__all__ = ['utils', 't_variable', 'models', 'LanZouCloud', 'version', 'upload_2_github',... | 21.1875 | 105 | 0.675516 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
'''
@Copyright © 2021 sanbo Inc. All rights reserved.
@Description:
@Version: 1.0
@Create: 2021-01-15 12:32:54
@author: sanbo
'''
from run_core import LanZouCloud
version = '1.2.0'
__all__ = ['utils', 't_variable', 'models', 'LanZouCloud', 'version', 'upload_2_github'... | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1bc9fd71c506084af3fa0a71bd6930571a39a451 | 733 | py | Python | day7/puzzle1.py | yenh-cs/adventofcode2021 | 55d425483a4b24140083cfd7b17df05a7a90e130 | [
"MIT"
] | 1 | 2021-12-01T15:14:43.000Z | 2021-12-01T15:14:43.000Z | day7/puzzle1.py | yenh-cs/adventofcode2021 | 55d425483a4b24140083cfd7b17df05a7a90e130 | [
"MIT"
] | null | null | null | day7/puzzle1.py | yenh-cs/adventofcode2021 | 55d425483a4b24140083cfd7b17df05a7a90e130 | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
main()
| 21.558824 | 64 | 0.567531 | import math
def findMedian(nums):
nums.sort()
size = len(nums)
if size%2 == 0:
middle = int(size/2)
median = math.floor((nums[middle] + nums[middle - 1])/2)
else:
middle = int(size/2 - 0.5)
median = nums[middle]
return median
def findMinFuel(nums, median):
sum... | 0 | 0 | 0 | 0 | 0 | 610 | 0 | -10 | 91 |
eb7ef5445f1a5d58b4c0f5b89cc5e9fb7afb81ec | 978 | py | Python | lpbio/__init__.py | widdowquinn/lpbio | 8b95642396d05a56c1c54389e3de6d88d7cbffb5 | [
"MIT"
] | null | null | null | lpbio/__init__.py | widdowquinn/lpbio | 8b95642396d05a56c1c54389e3de6d88d7cbffb5 | [
"MIT"
] | null | null | null | lpbio/__init__.py | widdowquinn/lpbio | 8b95642396d05a56c1c54389e3de6d88d7cbffb5 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Module with main code for pyani application/package.
Python package version should match:
r"^__version__ = '(?P<version>[^']+)'$" for setup.py
"""
__version__ = "0.1.0-alpha"
name = "lpbio"
import os
import shlex
import shutil
from subprocess import CalledProcessError
def is_exe(filen... | 24.45 | 80 | 0.678937 | # -*- coding: utf-8 -*-
"""Module with main code for pyani application/package.
Python package version should match:
r"^__version__ = '(?P<version>[^']+)'$" for setup.py
"""
__version__ = "0.1.0-alpha"
name = "lpbio"
import os
import shlex
import shutil
from subprocess import check_output, CalledProcessError
cla... | 0 | 0 | 0 | 147 | 0 | 0 | 0 | 14 | 23 |
b9ba931a5e45cbcf3654bbd3b17c65e846489216 | 259 | py | Python | gates/Two.py | DrugoLebowski/nram-executor | 3abb49b3f28cc1457f246b158167f664eaf37a8e | [
"MIT"
] | 2 | 2018-03-13T19:55:25.000Z | 2020-10-24T10:02:52.000Z | gates/Two.py | DrugoLebowski/nram-executor | 3abb49b3f28cc1457f246b158167f664eaf37a8e | [
"MIT"
] | null | null | null | gates/Two.py | DrugoLebowski/nram-executor | 3abb49b3f28cc1457f246b158167f664eaf37a8e | [
"MIT"
] | null | null | null | # Vendor
# Project
| 21.583333 | 100 | 0.667954 | # Vendor
import numpy as np
# Project
from util import to_one_hot
from gates.Gate import Gate
class Two(Gate):
def __call__(self, M: np.array, A: np.array = None, B: np.array = None) -> (np.array, np.array):
return M, to_one_hot(2, M.shape[1])
| 0 | 0 | 0 | 141 | 0 | 0 | 0 | 9 | 89 |
8ce6b8f379e9373d5b5513d42591b2b00a105519 | 533 | py | Python | adminmgr/media/code/python/map2/BD_1123_1539_1561_1584_mapper.py | IamMayankThakur/test-bigdata | cef633eb394419b955bdce479699d0115d8f99c3 | [
"Apache-2.0"
] | 9 | 2019-11-08T02:05:27.000Z | 2021-12-13T12:06:35.000Z | adminmgr/media/code/python/map2/BD_1123_1539_1561_1584_mapper.py | IamMayankThakur/test-bigdata | cef633eb394419b955bdce479699d0115d8f99c3 | [
"Apache-2.0"
] | 6 | 2019-11-27T03:23:16.000Z | 2021-06-10T19:15:13.000Z | adminmgr/media/code/python/map2/BD_1123_1539_1561_1584_mapper.py | IamMayankThakur/test-bigdata | cef633eb394419b955bdce479699d0115d8f99c3 | [
"Apache-2.0"
] | 4 | 2019-11-26T17:04:27.000Z | 2021-12-13T11:57:03.000Z | #!/usr/bin/python3
import sys
infile = sys.stdin
#next(infile)
#fuel column index 8
for line in infile:
line = line.strip()
l = line.split(',')
if(l[0]=='ball'):
#if(l[9]=='lbw' or l[9]=='bowled' or l[9]=='caught' or l[9]=='caught and bowled' or l[9]=='stumped' or l[9]=='hit wicket' or l[9]=='obstr... | 26.65 | 164 | 0.500938 | #!/usr/bin/python3
import sys
import csv
infile = sys.stdin
#next(infile)
#fuel column index 8
for line in infile:
line = line.strip()
l = line.split(',')
if(l[0]=='ball'):
#if(l[9]=='lbw' or l[9]=='bowled' or l[9]=='caught' or l[9]=='caught and bowled' or l[9]=='stumped' or l[9]=='hit wicket' or l... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -11 | 22 |
2d66ac5ac74bee9bf526b61471559c2b83e75f28 | 1,634 | py | Python | website/backend/api/utils.py | dojutsu-user/GSoC-Data-Analyser | 51e1a4beffa4bb489562be07172ed55463a8f62f | [
"MIT"
] | 29 | 2018-12-03T18:21:00.000Z | 2021-02-26T16:36:52.000Z | website/backend/api/utils.py | dojutsu-user/GSoC-Data-Analyser | 51e1a4beffa4bb489562be07172ed55463a8f62f | [
"MIT"
] | null | null | null | website/backend/api/utils.py | dojutsu-user/GSoC-Data-Analyser | 51e1a4beffa4bb489562be07172ed55463a8f62f | [
"MIT"
] | 5 | 2018-12-18T17:52:55.000Z | 2020-11-04T13:25:10.000Z | from django.utils.text import slugify
def total_orgs_participated_year(data):
"""
Returns the total number of organisations participated
in the specified year. The year data is passed as parameter
to the function.
"""
return len(data.keys())
def total_projects_done_year(data):
"""
Re... | 27.694915 | 63 | 0.649327 | from django.utils.text import slugify
def total_orgs_participated_year(data):
"""
Returns the total number of organisations participated
in the specified year. The year data is passed as parameter
to the function.
"""
return len(data.keys())
def total_projects_done_year(data):
"""
Re... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7cb195036eab6c03a56b691f2d674f7f3c9057d9 | 654 | py | Python | web_api/routers/tasks.py | Wason1797/FastAPI-Celery-example | 4b49893de880bf9bb4d8e1eb7f61497facd8798a | [
"MIT"
] | 3 | 2022-02-25T18:51:14.000Z | 2022-03-21T18:55:32.000Z | web_api/routers/tasks.py | Wason1797/FastAPI-Celery-example | 4b49893de880bf9bb4d8e1eb7f61497facd8798a | [
"MIT"
] | null | null | null | web_api/routers/tasks.py | Wason1797/FastAPI-Celery-example | 4b49893de880bf9bb4d8e1eb7f61497facd8798a | [
"MIT"
] | null | null | null | from fastapi import APIRouter
router = APIRouter()
| 24.222222 | 133 | 0.629969 | import json
from fastapi import APIRouter
from ..worker import celery
router = APIRouter()
@router.get("/check-task/{id}")
def check_task(id: str):
task = celery.AsyncResult(id)
error = json.loads(task.backend.get(task.backend.get_key_for_task(task.id)).decode('utf-8')) if task.state == 'FAILURE' else None... | 0 | 537 | 0 | 0 | 0 | 0 | 0 | -4 | 67 |
cd3dd844c2c832e7bb20253d101acf3db2dfe2c6 | 1,815 | py | Python | tcai_AtBSwPython/Phone_and_email_scrapper.py | CailleauThierry/tcai_AtBSwPython | e576c5c4e274db3f46ed0c4d559084b5c9b199bf | [
"Apache-2.0"
] | null | null | null | tcai_AtBSwPython/Phone_and_email_scrapper.py | CailleauThierry/tcai_AtBSwPython | e576c5c4e274db3f46ed0c4d559084b5c9b199bf | [
"Apache-2.0"
] | null | null | null | tcai_AtBSwPython/Phone_and_email_scrapper.py | CailleauThierry/tcai_AtBSwPython | e576c5c4e274db3f46ed0c4d559084b5c9b199bf | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED! DO NOT EDIT! File to edit: 10_1_Python_Phone_and_email_scrapper.ipynb (unless otherwise specified).
__all__ = ['phoneRegEx', 'emailRegEx', 'text', 'listOfAllPhoneNumbers', 'allPhoneNumbers', 'allEmailAddresses',
'results']
# Cell
#! python3
import re, pyperclip
#Create a Regex object for ... | 36.3 | 116 | 0.657851 | # AUTOGENERATED! DO NOT EDIT! File to edit: 10_1_Python_Phone_and_email_scrapper.ipynb (unless otherwise specified).
__all__ = ['phoneRegEx', 'emailRegEx', 'text', 'listOfAllPhoneNumbers', 'allPhoneNumbers', 'allEmailAddresses',
'results']
# Cell
#! python3
import re, pyperclip
#Create a Regex object for ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
59b7adf5a803482275f374fe90a8000f7cbba272 | 1,338 | py | Python | Project-2/IEEE lead project Riya Singh/shine-com.py | Mercury1508/IEEE-LEAD-2.0 | 91d24ccf2f24c62f92f0d23bcfcb3988e6d5acd8 | [
"MIT"
] | 1 | 2021-06-03T16:08:33.000Z | 2021-06-03T16:08:33.000Z | Project-2/IEEE lead project Riya Singh/shine-com.py | Mercury1508/IEEE-LEAD-2.0 | 91d24ccf2f24c62f92f0d23bcfcb3988e6d5acd8 | [
"MIT"
] | 16 | 2021-04-27T12:58:03.000Z | 2021-05-28T14:02:14.000Z | Project-2/IEEE lead project Riya Singh/shine-com.py | Mercury1508/IEEE-LEAD-2.0 | 91d24ccf2f24c62f92f0d23bcfcb3988e6d5acd8 | [
"MIT"
] | 70 | 2021-04-26T13:48:35.000Z | 2021-05-28T21:04:34.000Z | from PIL import ImageTk, Image
root=Tk()
root.geometry('700x700')
root.config(bg="light green")
root.title('site scrapped')
job=StringVar()
city=StringVar()
img = ImageTk.PhotoImage(Image.open("shine.png"))
img_label=Label(image=img,padx=150 , pady=20)
img_label.pack()
L1 = Label(root, text="Enter Job/Skill",font=('Hel... | 33.45 | 91 | 0.744395 | import requests
from bs4 import BeautifulSoup
import webbrowser
from tkinter import *
from PIL import ImageTk,Image
import re
root=Tk()
root.geometry('700x700')
root.config(bg="light green")
root.title('site scrapped')
job=StringVar()
city=StringVar()
def click():
url="https://www.shine.com/job-search/"+E1.get()+"-job... | 0 | 0 | 0 | 0 | 0 | 572 | 0 | -15 | 132 |
d085eba2bd352d27aced2ab224558b468b348bb5 | 2,899 | py | Python | setup/Iluminotecnica.py | SricardoSdSouza/Curso-da-USP | 6198c509c52bf6132f904cded2e12ae941f2b973 | [
"MIT"
] | null | null | null | setup/Iluminotecnica.py | SricardoSdSouza/Curso-da-USP | 6198c509c52bf6132f904cded2e12ae941f2b973 | [
"MIT"
] | null | null | null | setup/Iluminotecnica.py | SricardoSdSouza/Curso-da-USP | 6198c509c52bf6132f904cded2e12ae941f2b973 | [
"MIT"
] | null | null | null | 'Calculando a Iluminao'
print("ESTE PROGRAMA VISA CALCULAR A ILUMINAO NECESSRIA PARA SEU COMODO")
comprimento = float(input("Digite o valor do comprimento = "))
altura = float(input("Digite o valor para a altura = "))
largura = float(input("Digite o valor da largura = "))
k=round(float((comprimento*largura)/((comprimen... | 34.105882 | 111 | 0.656433 | 'Calculando a Iluminação'
print("ESTE PROGRAMA VISA CALCULAR A ILUMINAÇÃO NECESSÁRIA PARA SEU COMODO")
import math
comprimento = float(input("Digite o valor do comprimento = "))
altura = float(input("Digite o valor para a altura = "))
largura = float(input("Digite o valor da largura = "))
k=round(float((comprimento*lar... | 96 | 0 | 0 | 0 | 0 | 0 | 0 | -10 | 22 |
41745802e77a3a809242bf58a0cbbaaea6ebe4e1 | 5,502 | py | Python | COVID19.py | albejawe/1 | b37f7ba9ad0a3bd6983404cc9a27037c9a3fb486 | [
"MIT"
] | null | null | null | COVID19.py | albejawe/1 | b37f7ba9ad0a3bd6983404cc9a27037c9a3fb486 | [
"MIT"
] | null | null | null | COVID19.py | albejawe/1 | b37f7ba9ad0a3bd6983404cc9a27037c9a3fb486 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
from bs4 import BeautifulSoup
import requests
import pandas as pd
import sys
import re
banner_text = '''
... | 45.471074 | 288 | 0.466376 | #!/usr/bin/python3
from bs4 import BeautifulSoup
import requests
import pandas as pd
import sys
import re
banner_text = '''
██████╗ ██████╗ ██╗ ██╗██╗██████╗ ██╗ █████╗ ██╗ ██╗██╗ ██╗███████╗ ███████╗████████╗ █████╗ ████████╗██╗ ██████╗███████╗
██╔════╝██╔═══██╗██║ ██║██║██╔══██╗ ███║█... | 1,896 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6abc88cb7ad877a47099a11efb98100c75f1c342 | 1,056 | py | Python | train.py | therne/logue | 4526a1812b2a859ed9746d95830515861c4a96fd | [
"MIT"
] | null | null | null | train.py | therne/logue | 4526a1812b2a859ed9746d95830515861c4a96fd | [
"MIT"
] | null | null | null | train.py | therne/logue | 4526a1812b2a859ed9746d95830515861c4a96fd | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import tensorflow as tf
flags = tf.app.flags
flags.DEFINE_float('lr', 0.01, 'Learning rate.')
flags.DEFINE_integer('embed_size', 384, 'Word embedding size.')
flags.DEFINE_bool('no_josa', True, 'Filter Josa in korean sentence?')
flags.DEFINE_string('log_dir', 'run/logs/', 'Logging directory.')
... | 34.064516 | 78 | 0.701705 | #!/usr/bin/env python3
import tensorflow as tf
from models.model import LogueModel
flags = tf.app.flags
flags.DEFINE_float('lr', 0.01, 'Learning rate.')
flags.DEFINE_integer('embed_size', 384, 'Word embedding size.')
flags.DEFINE_bool('no_josa', True, 'Filter Josa in korean sentence?')
flags.DEFINE_string('log_dir',... | 0 | 0 | 0 | 0 | 0 | 375 | 0 | 14 | 45 |
3dc5ed024802fd029033308f49ad4e1c8485060e | 6,948 | py | Python | ForensicsTool/ForensicsTool/module2.py | deepak7mahto/ForensicsTool | 17ae45a5a12093f38eaeb309745588464b694fa4 | [
"MIT"
] | null | null | null | ForensicsTool/ForensicsTool/module2.py | deepak7mahto/ForensicsTool | 17ae45a5a12093f38eaeb309745588464b694fa4 | [
"MIT"
] | null | null | null | ForensicsTool/ForensicsTool/module2.py | deepak7mahto/ForensicsTool | 17ae45a5a12093f38eaeb309745588464b694fa4 | [
"MIT"
] | null | null | null |
#module2 - event manager module
| 42.625767 | 121 | 0.48388 | import shutil, os, Evtx, mmap, contextlib, sys, xml, random_functions, colorama, Forensics_tool_redesigned_using_oops
from Evtx.Evtx import FileHeader
from Evtx.Views import evtx_file_xml_view
from xml.dom import minidom
#module2 - event manager module
class event_manager_module( random_functions.random_functi... | 0 | 0 | 0 | 6,665 | 0 | 0 | 0 | 133 | 116 |
3229876555fc5e542011422673d7c204bc5b7eb4 | 4,234 | py | Python | app/logic/bluesteel/tests/tests_BluesteelProjectModel.py | imvu/bluesteel | ab52133249a693b3cd2d8593c5d47408a3b0fce6 | [
"MIT"
] | 10 | 2017-01-13T06:28:04.000Z | 2020-11-18T13:00:26.000Z | app/logic/bluesteel/tests/tests_BluesteelProjectModel.py | imvu/bluesteel | ab52133249a693b3cd2d8593c5d47408a3b0fce6 | [
"MIT"
] | null | null | null | app/logic/bluesteel/tests/tests_BluesteelProjectModel.py | imvu/bluesteel | ab52133249a693b3cd2d8593c5d47408a3b0fce6 | [
"MIT"
] | 2 | 2018-03-29T14:10:53.000Z | 2019-11-20T08:21:57.000Z | """ Bluesteel Project tests """
| 40.711538 | 242 | 0.699339 | """ Bluesteel Project tests """
from django.test import TestCase
from django.utils import timezone
from app.logic.bluesteel.models.BluesteelLayoutModel import BluesteelLayoutEntry
from app.logic.bluesteel.models.BluesteelProjectModel import BluesteelProjectEntry
from app.logic.gitrepo.models.GitProjectModel import Git... | 0 | 0 | 0 | 3,531 | 0 | 0 | 0 | 427 | 244 |
4ab5a23010d02dfb1ae7bf3e51ca699e3ee07928 | 550 | py | Python | classwork/12_02_2020.py | Katsute/Baruch-CIS-2300-Assignments | ea374ed1cb229f5e598863ba1777be5f47eaab9d | [
"CC0-1.0"
] | null | null | null | classwork/12_02_2020.py | Katsute/Baruch-CIS-2300-Assignments | ea374ed1cb229f5e598863ba1777be5f47eaab9d | [
"CC0-1.0"
] | null | null | null | classwork/12_02_2020.py | Katsute/Baruch-CIS-2300-Assignments | ea374ed1cb229f5e598863ba1777be5f47eaab9d | [
"CC0-1.0"
] | 1 | 2022-01-12T18:17:52.000Z | 2022-01-12T18:17:52.000Z | # dictionaries (aka Java Maps)
d = {'k':'v'}
print(d['k'])
d = dict(key = 'v')
print(d['key'])
# check contains key
print('key' in d)
print('v' not in d)
# any immutable type of key (no arrays)
d = {
(1, 2, 3): "tuple",
"abc": "string",
999: "num"
}
# update/new dict value
d['k'] = 'v'
# remove key... | 14.102564 | 39 | 0.549091 | # dictionaries (aka Java Maps)
d = {'k':'v'}
print(d['k'])
d = dict(key = 'v')
print(d['key'])
# check contains key
print('key' in d)
print('v' not in d)
# any immutable type of key (no arrays)
d = {
(1, 2, 3): "tuple",
"abc": "string",
999: "num"
}
# update/new dict value
d['k'] = 'v'
# remove key... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7903b5d9d0dabfd8434bcbad2f0fc8d602ebdb81 | 179 | py | Python | h2o-docs/src/booklets/v2_2015/source/Python_Vignette_code_examples/python_select_column_name.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 6,098 | 2015-05-22T02:46:12.000Z | 2022-03-31T16:54:51.000Z | h2o-docs/src/booklets/v2_2015/source/Python_Vignette_code_examples/python_select_column_name.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 2,517 | 2015-05-23T02:10:54.000Z | 2022-03-30T17:03:39.000Z | h2o-docs/src/booklets/v2_2015/source/Python_Vignette_code_examples/python_select_column_name.py | ahmedengu/h2o-3 | ac2c0a6fbe7f8e18078278bf8a7d3483d41aca11 | [
"Apache-2.0"
] | 2,199 | 2015-05-22T04:09:55.000Z | 2022-03-28T22:20:45.000Z | df['A']
# A
# ---------
# -0.613035
# -1.265520
# 0.763851
# -1.248425
# 2.105805
# 1.763502
# -0.781973
# 1.400853
# -0.746025
# -1.120648
#
# [100 rows x 1 column] | 11.1875 | 23 | 0.497207 | df['A']
# A
# ---------
# -0.613035
# -1.265520
# 0.763851
# -1.248425
# 2.105805
# 1.763502
# -0.781973
# 1.400853
# -0.746025
# -1.120648
#
# [100 rows x 1 column] | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2e0ac53bd8f47556bffc84a4c7819497601c9e6a | 1,742 | py | Python | GUI/ParaItem.py | IronSublimate/PyQt-multifunctional-uart-helper | f9fb3f927395f7fb83697e84bc5c5502249204f3 | [
"MIT"
] | 13 | 2019-08-23T09:17:15.000Z | 2022-01-10T11:20:13.000Z | GUI/ParaItem.py | IronSublimate/PyQt-multifunctional-uart-helper | f9fb3f927395f7fb83697e84bc5c5502249204f3 | [
"MIT"
] | null | null | null | GUI/ParaItem.py | IronSublimate/PyQt-multifunctional-uart-helper | f9fb3f927395f7fb83697e84bc5c5502249204f3 | [
"MIT"
] | 3 | 2020-09-01T11:43:28.000Z | 2021-09-02T15:02:54.000Z | # from parameter import Parameter
| 39.590909 | 120 | 0.618255 | from PyQt5.QtWidgets import QWidget, QMessageBox
from GUI.Ui_PataList import Ui_PataList
# from parameter import Parameter
from PyQt5.QtSerialPort import QSerialPort
from src.uart import Uart
class Widget_ParaItem(QWidget, Ui_PataList):
def __init__(self, para_name: str, pos: str, para_value: str, _com: Uart, par... | 24 | 0 | 0 | 1,518 | 0 | 0 | 0 | 70 | 111 |
4058890b3397ad4a37f7e44a78efe97b1d01f9c8 | 4,676 | py | Python | google/cloud/dns/client.py | Ofekmeister/google-cloud-python | 07dd51bc447beca67b8da1c66f1dfb944ef70418 | [
"Apache-2.0"
] | null | null | null | google/cloud/dns/client.py | Ofekmeister/google-cloud-python | 07dd51bc447beca67b8da1c66f1dfb944ef70418 | [
"Apache-2.0"
] | null | null | null | google/cloud/dns/client.py | Ofekmeister/google-cloud-python | 07dd51bc447beca67b8da1c66f1dfb944ef70418 | [
"Apache-2.0"
] | null | null | null | # Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 39.965812 | 79 | 0.617836 | # Copyright 2015 Google Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 0 | 0 | 0 | 3,853 | 0 | 0 | 0 | 74 | 90 |
28f0fe5c4b7799201e7446a0928f03387c67309d | 2,642 | py | Python | tests/test_ridgepaths.py | vishalbelsare/torch-gel | 43ca3c96254aa3f2eead83ab139c2457787a2a63 | [
"MIT"
] | 37 | 2017-06-28T20:55:40.000Z | 2021-08-09T15:38:56.000Z | tests/test_ridgepaths.py | vishalbelsare/torch-gel | 43ca3c96254aa3f2eead83ab139c2457787a2a63 | [
"MIT"
] | 2 | 2019-03-08T03:03:14.000Z | 2020-01-13T19:05:56.000Z | tests/test_ridgepaths.py | vishalbelsare/torch-gel | 43ca3c96254aa3f2eead83ab139c2457787a2a63 | [
"MIT"
] | 10 | 2017-07-19T01:15:11.000Z | 2021-08-09T15:38:59.000Z | """test_ridgepaths.py: tests for ridge_paths function."""
import itertools
import torch
for _device_name, _dtype, _m, _p in itertools.product(
["cpu", "cuda"], [torch.float32, torch.float64], [1, 10], [1, 5, 10, 20]
):
create_ridgepaths_test(_device_name, _dtype, _m, _p)
| 31.831325 | 84 | 0.617335 | """test_ridgepaths.py: tests for ridge_paths function."""
import itertools
import unittest
import torch
from scipy.spatial.distance import cosine
from gel.ridgepaths import ridge_paths
class TestRidgePathsEmptySupport(unittest.TestCase):
"""Test ridge_paths with empty support."""
def test_ridge_paths_emp... | 0 | 0 | 0 | 1,640 | 0 | 548 | 0 | 31 | 136 |
6a9134be681a20017786ba1568ace8b858b50ff7 | 8,242 | py | Python | hsaf_event_week_2022/ex_time_series/library/era5/interface.py | c-hydro-labs/hsaf | 92479d4fad185b6f88224e61930b3a78b711f0a7 | [
"MIT"
] | null | null | null | hsaf_event_week_2022/ex_time_series/library/era5/interface.py | c-hydro-labs/hsaf | 92479d4fad185b6f88224e61930b3a78b711f0a7 | [
"MIT"
] | null | null | null | hsaf_event_week_2022/ex_time_series/library/era5/interface.py | c-hydro-labs/hsaf | 92479d4fad185b6f88224e61930b3a78b711f0a7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import warnings
try:
except ImportError:
warnings.warn("pygrib has not been imported")
| 35.679654 | 102 | 0.513468 | # -*- coding: utf-8 -*-
import warnings
import numpy as np
import os
try:
import pygrib
except ImportError:
warnings.warn("pygrib has not been imported")
from pygeobase.io_base import ImageBase, MultiTemporalImageBase
from pygeobase.object_base import Image
import pygeogrids
from pygeogrids import netcdf
fr... | 5 | 0 | 0 | 7,660 | 0 | 0 | 0 | 121 | 341 |
2a0dc67bade2117bf57ad1386621e32344ab2ab8 | 15,919 | py | Python | atomate/vasp/database.py | Zhuoying/atomate | 067023f0f740d3abac47b7ae7743c1c31eff8a06 | [
"BSD-3-Clause-LBNL"
] | null | null | null | atomate/vasp/database.py | Zhuoying/atomate | 067023f0f740d3abac47b7ae7743c1c31eff8a06 | [
"BSD-3-Clause-LBNL"
] | null | null | null | atomate/vasp/database.py | Zhuoying/atomate | 067023f0f740d3abac47b7ae7743c1c31eff8a06 | [
"BSD-3-Clause-LBNL"
] | null | null | null | """
This module defines the database classes.
"""
import zlib
import gridfs
from atomate.utils.utils import get_logger
__author__ = "Kiran Mathew"
__credits__ = "Anubhav Jain"
__email__ = "kmathew@lbl.gov"
logger = get_logger(__name__)
# If we use Maggmastores we will have to initialize a magmma store for each obje... | 36.179545 | 116 | 0.597839 | """
This module defines the database classes.
"""
import json
import zlib
from typing import Any
import gridfs
from bson import ObjectId
from maggma.stores.aws import S3Store
from monty.dev import deprecated
from monty.json import MontyEncoder
from pymatgen.electronic_structure.bandstructure import (
BandStructur... | 0 | 92 | 0 | 13,706 | 0 | 0 | 0 | 210 | 267 |
7a62dc4b21932234b27eb65e5f821f1d389003fe | 6,174 | py | Python | chaos_genius/core/rca/rca_utils/time_range.py | eltociear/chaos_genius | eb3bc27181c8af4144b95e685386814109173164 | [
"MIT"
] | 320 | 2022-02-18T18:18:42.000Z | 2022-03-31T16:42:38.000Z | chaos_genius/core/rca/rca_utils/time_range.py | eltociear/chaos_genius | eb3bc27181c8af4144b95e685386814109173164 | [
"MIT"
] | 115 | 2022-02-18T16:39:01.000Z | 2022-03-31T15:23:52.000Z | chaos_genius/core/rca/rca_utils/time_range.py | eltociear/chaos_genius | eb3bc27181c8af4144b95e685386814109173164 | [
"MIT"
] | 18 | 2022-02-18T18:44:01.000Z | 2022-03-10T08:33:34.000Z | """Functions to get dates for various time ranges in RCA."""
import calendar
from datetime import date, timedelta
from typing import Tuple
from dateutil.relativedelta import relativedelta
def get_dates_for_last_30_days(
end_date: date,
) -> Tuple[Tuple[date, date], Tuple[date, date]]:
"""Returns dates for r... | 33.016043 | 88 | 0.695173 | """Functions to get dates for various time ranges in RCA."""
import calendar
from datetime import date, timedelta
from typing import Tuple
from dateutil.relativedelta import relativedelta
def get_dates_for_last_30_days(
end_date: date,
) -> Tuple[Tuple[date, date], Tuple[date, date]]:
"""Returns dates for r... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
137f7b3a06a32d11afcd18e3f7e940cea5cb39a0 | 4,369 | py | Python | tests/errors/test_errors.py | albertovillarreal-keys/snappi-ixnetwork | c72673580f5a2c530f033469f542cbea36a49c2c | [
"MIT"
] | 4 | 2020-11-03T06:03:48.000Z | 2021-06-29T03:49:44.000Z | tests/errors/test_errors.py | albertovillarreal-keys/snappi-ixnetwork | c72673580f5a2c530f033469f542cbea36a49c2c | [
"MIT"
] | 275 | 2020-09-23T15:19:09.000Z | 2021-06-29T10:53:56.000Z | tests/errors/test_errors.py | albertovillarreal-keys/snappi-ixnetwork | c72673580f5a2c530f033469f542cbea36a49c2c | [
"MIT"
] | 1 | 2020-10-12T19:33:46.000Z | 2020-10-12T19:33:46.000Z | from snappi_ixnetwork.exceptions import SnappiIxnException
def test_Bad_Request_server_side(api, b2b_raw_config, utils):
"""
Configure a raw ethernet flow with,
- counter pattern for src and dst MAC address and ether type
Validate,
- Fetch the ethernet header config via restpy and validate
ag... | 30.767606 | 71 | 0.621195 | from snappi_ixnetwork.exceptions import SnappiIxnException
def test_Bad_Request_server_side(api, b2b_raw_config, utils):
"""
Configure a raw ethernet flow with,
- counter pattern for src and dst MAC address and ether type
Validate,
- Fetch the ethernet header config via restpy and validate
ag... | 0 | 0 | 0 | 0 | 0 | 3,166 | 0 | 0 | 46 |
f57ef9ad466e8cca1f685cdc2abb26c111157ef0 | 571 | py | Python | Exercises/Exercises_02/05_exercise.py | Szymon-Budziak/ASD_exercises_solutions | 36ccbdae03a6c7e4ad141a2b7b01bef9353574ee | [
"MIT"
] | 7 | 2021-12-28T23:38:42.000Z | 2022-03-29T16:36:16.000Z | Exercises/Exercises_02/05_exercise.py | Szymon-Budziak/ASD_exercises_solutions | 36ccbdae03a6c7e4ad141a2b7b01bef9353574ee | [
"MIT"
] | null | null | null | Exercises/Exercises_02/05_exercise.py | Szymon-Budziak/ASD_exercises_solutions | 36ccbdae03a6c7e4ad141a2b7b01bef9353574ee | [
"MIT"
] | 4 | 2021-06-29T20:21:52.000Z | 2022-03-12T10:04:17.000Z | # Mamy dan tablic A z n liczbami. Prosz zaproponowa algorytm o zoonoci O(n), ktry stwierdza,
# czy istnieje liczba x (tzw. lider A), ktra wystpuje w A na ponad poowie pozycji.
A = [12, 3, 5, 7, 7, 12, 7, 4, 10, 2, 7, 7, 7, 7, 7]
print(leader(A))
| 30.052632 | 100 | 0.577933 | # Mamy daną tablicę A z n liczbami. Proszę zaproponować algorytm o złożoności O(n), który stwierdza,
# czy istnieje liczba x (tzw. lider A), która występuje w A na ponad połowie pozycji.
def leader(A):
maximum = max(A)
buckets = [[0] for _ in range(len(A) + 1)]
for i in range(len(A)):
index = int(... | 22 | 0 | 0 | 0 | 0 | 288 | 0 | 0 | 23 |
b1472ccdc7589f197bd8417383b1005cacddd133 | 1,754 | py | Python | python/tvm/script/meta_unparser.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 4,640 | 2017-08-17T19:22:15.000Z | 2019-11-04T15:29:46.000Z | python/tvm/script/meta_unparser.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 3,022 | 2020-11-24T14:02:31.000Z | 2022-03-31T23:55:31.000Z | python/tvm/script/meta_unparser.py | XiaoSong9905/tvm | 48940f697e15d5b50fa1f032003e6c700ae1e423 | [
"Apache-2.0"
] | 1,352 | 2017-08-17T19:30:38.000Z | 2019-11-04T16:09:29.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 38.130435 | 97 | 0.717788 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 0 | 0 | 0 | 844 | 0 | 0 | 0 | 7 | 46 |
7e5d1439db0d88f5a8a60191868e9f308a46cfe6 | 625 | py | Python | setup.py | nebeker/svart | 2eb80ca4c72e2a83412e43d3c31a04c25b91259c | [
"MIT"
] | 165 | 2021-04-08T16:09:11.000Z | 2022-02-09T23:10:28.000Z | setup.py | nebeker/svart | 2eb80ca4c72e2a83412e43d3c31a04c25b91259c | [
"MIT"
] | 2 | 2021-04-09T07:26:26.000Z | 2021-04-13T14:01:42.000Z | setup.py | nebeker/svart | 2eb80ca4c72e2a83412e43d3c31a04c25b91259c | [
"MIT"
] | 9 | 2021-04-09T07:54:46.000Z | 2021-12-21T19:46:00.000Z | import setuptools
with open("README.md", "r", encoding="utf-8") as f:
long_description = f.read()
setuptools.setup(
name="svart",
version="1.0.0",
author="Siddharth Dushantha",
author_email="siddharth.dushantha@gmail.com",
description="Change between dark/light mode depending on the ambient li... | 31.25 | 90 | 0.7152 | import setuptools
with open("README.md", "r", encoding="utf-8") as f:
long_description = f.read()
setuptools.setup(
name="svart",
version="1.0.0",
author="Siddharth Dushantha",
author_email="siddharth.dushantha@gmail.com",
description="Change between dark/light mode depending on the ambient li... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
be6ac26f397106292ddd9d99c10e4199ce72de0c | 1,062 | py | Python | exercises/todo2.py | rooshilp/CMPUT410Lab4 | 61878d7b3b20def6c76909932085fc192ab7f1f9 | [
"Apache-2.0"
] | null | null | null | exercises/todo2.py | rooshilp/CMPUT410Lab4 | 61878d7b3b20def6c76909932085fc192ab7f1f9 | [
"Apache-2.0"
] | null | null | null | exercises/todo2.py | rooshilp/CMPUT410Lab4 | 61878d7b3b20def6c76909932085fc192ab7f1f9 | [
"Apache-2.0"
] | null | null | null |
dbFile = 'task.db'
conn = None
if __name__ == '__main__':
query_db('delete from task')
print_tasks()
add_task('CMPUT410')
add_task('abs')
add_task('C10')
print_tasks() | 23.6 | 82 | 0.622411 | from flask import Flask, request, url_for, redirect
import sqlite3
dbFile = 'task.db'
conn = None
def get_conn():
global conn
if conn is None:
conn = sqlite3.connect(dbFile)
conn.row_factory = sqlite3.Row
return conn
def close_connection():
global conn
if conn is not None:
... | 0 | 0 | 0 | 0 | 0 | 674 | 0 | 23 | 171 |
56d206ba505cc33de6134a7a8732bbf7195c4d83 | 9,038 | py | Python | scripts/preprocess.py | uiucsn/phast | 1872f63408554914cff18613f92c502ca43c7b6b | [
"MIT"
] | null | null | null | scripts/preprocess.py | uiucsn/phast | 1872f63408554914cff18613f92c502ca43c7b6b | [
"MIT"
] | null | null | null | scripts/preprocess.py | uiucsn/phast | 1872f63408554914cff18613f92c502ca43c7b6b | [
"MIT"
] | null | null | null | import numpy as np
import extinction
from astropy.cosmology import Planck13 as cosmo
#The limiting magnitude of your survey
MAG_LIM = 33.0
ZPT = 30.0
wvs = np.asarray([3600, 4760, 6215, 7545, 8700, 10150])
bands = 'ugrizY'
def shift_lc(df):
"""A code to compute the phase of transient data relative to
the time... | 29.249191 | 154 | 0.557535 | import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
import glob
import extinction
from astropy.cosmology import Planck13 as cosmo
#The limiting magnitude of your survey
MAG_LIM = 33.0
ZPT = 30.0
wvs = np.asarray([3600, 4760, 6215, 7545, 8700, 10150])
bands = 'ugrizY'
def shift... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -2 | 88 |
3bbc584a3e5b3c29fcf636a43f1b7f92517677e3 | 250 | py | Python | gesund_projekt/weights/admin.py | asis2016/gesund-projekt | cb3828b69cd6a86deeab16943e38b6ebffd86abb | [
"MIT"
] | null | null | null | gesund_projekt/weights/admin.py | asis2016/gesund-projekt | cb3828b69cd6a86deeab16943e38b6ebffd86abb | [
"MIT"
] | null | null | null | gesund_projekt/weights/admin.py | asis2016/gesund-projekt | cb3828b69cd6a86deeab16943e38b6ebffd86abb | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import Weight
admin.site.register(Weight, WeightAdmin)
| 20.833333 | 58 | 0.7 | from django.contrib import admin
from .models import Weight
class WeightAdmin(admin.ModelAdmin):
""" Admin for weight. """
model = Weight
list_display = ['id', 'datestamp', 'weight', 'author']
admin.site.register(Weight, WeightAdmin)
| 0 | 0 | 0 | 123 | 0 | 0 | 0 | 0 | 23 |
3b0cb6fccc054671805437b1b3a51a0983cc87d2 | 382 | py | Python | tools/get_uusimaa_stations.py | SimoKorkolainen/TrafficDataScienceProject | 81c961e68c29c770ecd859096fb4d89af87969dc | [
"CC-BY-4.0"
] | null | null | null | tools/get_uusimaa_stations.py | SimoKorkolainen/TrafficDataScienceProject | 81c961e68c29c770ecd859096fb4d89af87969dc | [
"CC-BY-4.0"
] | null | null | null | tools/get_uusimaa_stations.py | SimoKorkolainen/TrafficDataScienceProject | 81c961e68c29c770ecd859096fb4d89af87969dc | [
"CC-BY-4.0"
] | null | null | null | #!/usr/bin/env python3
import json
with open("tms-stations.json", "r") as read_file:
data = json.load(read_file)
features = []
for sta in data["features"]:
if sta["properties"]["province"] == "Uusimaa":
features.append( sta )
data["features"] = features
with open('tms-stations-uusimaa.js... | 23.875 | 57 | 0.638743 | #!/usr/bin/env python3
import json
with open("tms-stations.json", "r") as read_file:
data = json.load(read_file)
features = []
for sta in data["features"]:
if sta["properties"]["province"] == "Uusimaa":
features.append( sta )
data["features"] = features
with open('tms-stations-uusimaa.js... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5b98d7240becaf978e2921da9c499d0927e35c53 | 120 | py | Python | tests/components/script/conftest.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 30,023 | 2016-04-13T10:17:53.000Z | 2020-03-02T12:56:31.000Z | tests/components/script/conftest.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 31,101 | 2020-03-02T13:00:16.000Z | 2022-03-31T23:57:36.000Z | tests/components/script/conftest.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 11,956 | 2016-04-13T18:42:31.000Z | 2020-03-02T09:32:12.000Z | """Conftest for script tests."""
| 30 | 85 | 0.791667 | """Conftest for script tests."""
from tests.components.blueprint.conftest import stub_blueprint_populate # noqa: F401
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 50 | 37 |
59eb77dc4cf2124e7c66878768a70d4c1bb59835 | 11,807 | py | Python | rcsb/utils/io/StashableBase.py | rcsb/py-rcsb_utils_io | a7fac41d3c08de7edaa9a25bb40e5e16b56be647 | [
"Apache-2.0"
] | null | null | null | rcsb/utils/io/StashableBase.py | rcsb/py-rcsb_utils_io | a7fac41d3c08de7edaa9a25bb40e5e16b56be647 | [
"Apache-2.0"
] | 2 | 2018-10-25T18:14:53.000Z | 2021-09-16T23:52:54.000Z | rcsb/utils/io/StashableBase.py | rcsb/py-rcsb_utils_io | a7fac41d3c08de7edaa9a25bb40e5e16b56be647 | [
"Apache-2.0"
] | 5 | 2020-12-03T17:29:20.000Z | 2022-03-27T17:59:59.000Z | ##
# File: StashableBase.py
#
# Base class template that implements a common pattern for to backup and restore
# cache directories to stash storage.
#
# Updates:
# 19-Jul-2021 jdw add git push support
##
__docformat__ = "google en"
__author__ = "John Westbrook"
__email__ = "jwest@rcsb.rutgers.edu"
__license__ = "Apach... | 45.586873 | 164 | 0.636317 | ##
# File: StashableBase.py
#
# Base class template that implements a common pattern for to backup and restore
# cache directories to stash storage.
#
# Updates:
# 19-Jul-2021 jdw add git push support
##
__docformat__ = "google en"
__author__ = "John Westbrook"
__email__ = "jwest@rcsb.rutgers.edu"
__license__ = "Apach... | 0 | 0 | 0 | 11,333 | 0 | 0 | 0 | 2 | 90 |
a06ea6faa27777822eba5db06ea2f81d96998767 | 14,449 | py | Python | mingpt/model.py | crizCraig/minGPT | 140df73ae53c1e2796c4cd43917c370467ba18a9 | [
"MIT"
] | null | null | null | mingpt/model.py | crizCraig/minGPT | 140df73ae53c1e2796c4cd43917c370467ba18a9 | [
"MIT"
] | null | null | null | mingpt/model.py | crizCraig/minGPT | 140df73ae53c1e2796c4cd43917c370467ba18a9 | [
"MIT"
] | null | null | null | """
GPT model:
- the initial stem consists of a combination of token encoding and a positional encoding
- the meat of it is a uniform sequence of Transformer blocks
- each Transformer is a sequential combination of a 1-hidden-layer MLP block and a self-attention block
- all blocks feed into a central residual p... | 49.313993 | 150 | 0.636307 | """
GPT model:
- the initial stem consists of a combination of token encoding and a positional encoding
- the meat of it is a uniform sequence of Transformer blocks
- each Transformer is a sequential combination of a 1-hidden-layer MLP block and a self-attention block
- all blocks feed into a central residual p... | 7 | 0 | 0 | 13,411 | 0 | 0 | 0 | 55 | 275 |
03f7a111dc53e2e9412c1d8f79915394d6cf2910 | 26,112 | py | Python | other/memomix_lite.py | TimotheAlbouy/MemoMix | 4bf3f28eaf7daab649105f3f4ccbe6bcddb9ab35 | [
"MIT"
] | null | null | null | other/memomix_lite.py | TimotheAlbouy/MemoMix | 4bf3f28eaf7daab649105f3f4ccbe6bcddb9ab35 | [
"MIT"
] | null | null | null | other/memomix_lite.py | TimotheAlbouy/MemoMix | 4bf3f28eaf7daab649105f3f4ccbe6bcddb9ab35 | [
"MIT"
] | null | null | null |
# IDEAS:
# - attribute to prioritize new person-group pairings instead of new person-person pairings
# - check that each 'personId' of 'apart' constraints contains at least one element
# Note: It is important to lift the ambiguation when 2 different persons share the same ID in history and person_ids.
# For example, ... | 46.545455 | 117 | 0.619562 | import random
import json
# IDEAS:
# - attribute to prioritize new person-group pairings instead of new person-person pairings
# - check that each 'personId' of 'apart' constraints contains at least one element
# Note: It is important to lift the ambiguation when 2 different persons share the same ID in history and p... | 0 | 0 | 0 | 25,668 | 0 | 0 | 0 | -18 | 67 |
ebb981495c983a75c231bf6dff3cfd14abb34e73 | 1,015 | py | Python | cloudy/sys/swap.py | un33k/python-cloudy | 597e55fe308521c0df25ce5ed6c859949bd5dd17 | [
"MIT"
] | 1 | 2015-04-29T13:43:36.000Z | 2015-04-29T13:43:36.000Z | cloudy/sys/swap.py | un33k/python-cloudy | 597e55fe308521c0df25ce5ed6c859949bd5dd17 | [
"MIT"
] | null | null | null | cloudy/sys/swap.py | un33k/python-cloudy | 597e55fe308521c0df25ce5ed6c859949bd5dd17 | [
"MIT"
] | 2 | 2015-06-20T16:39:11.000Z | 2016-11-18T13:58:58.000Z | import sys
from fabric.api import sudo
from fabric.contrib import files
from cloudy.sys.etc import sys_etc_git_commit
def sys_swap_configure(size='512'):
""" Ceates and install a swap file, given file size in MB - Ex (cmd:[Size-MB]) """
swap_file = '/swap/{}MiB.swap'.format(size)
sudo('mkdir -p /swap')
... | 33.833333 | 94 | 0.681773 | import os
import re
import sys
from fabric.api import run
from fabric.api import task
from fabric.api import sudo
from fabric.api import put
from fabric.api import env
from fabric.api import settings
from fabric.api import hide
from fabric.contrib import files
from fabric.utils import abort
from cloudy.sys.etc import... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 22 | 199 |
3c390523001d6c5a3b56f2240f2dea531fb75135 | 1,140 | py | Python | app/libs/restful.py | sillyCod/eggdemo | a57eace6ae48cd17b9c9a3a19406dc1cc26fba65 | [
"MIT"
] | null | null | null | app/libs/restful.py | sillyCod/eggdemo | a57eace6ae48cd17b9c9a3a19406dc1cc26fba65 | [
"MIT"
] | 3 | 2020-06-16T07:31:03.000Z | 2020-06-16T09:54:44.000Z | app/libs/restful.py | sillyCod/eggdemo | a57eace6ae48cd17b9c9a3a19406dc1cc26fba65 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# time: 2019/4/22 4:33
from flask import g
from flask import jsonify
from app.libs.status_code import status_codes
def error_response(code: int, msg: str = None):
"""
:param code:
:param msg:
:return:
"""
if msg is None:
lan = g.get('lan', "zh")
... | 24.255319 | 88 | 0.615789 | # -*- coding: utf-8 -*-
# time: 2019/4/22 下午4:33
from typing import Union
from flask import g
from flask import jsonify
from app.libs.status_code import status_codes
def json_response(code: int, data: Union[str, list, dict] = None, msg: str = ""):
if code not in status_codes:
raise KeyError("{}未声明".form... | 48 | 0 | 0 | 0 | 0 | 583 | 0 | 3 | 68 |
79b6e418112fafe3db96ced7dc3a4fd434e091fb | 17,648 | py | Python | my_utils.py | alefefreire/MLtraining | 8465cad0121898454b05c80d5ab4b0a48b3e85f6 | [
"MIT"
] | null | null | null | my_utils.py | alefefreire/MLtraining | 8465cad0121898454b05c80d5ab4b0a48b3e85f6 | [
"MIT"
] | null | null | null | my_utils.py | alefefreire/MLtraining | 8465cad0121898454b05c80d5ab4b0a48b3e85f6 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from sklearn.metrics import mean_squared_error as mse
from sklearn.metrics import mean_absolute_error as mae
from sklearn.model_selection import KFold
import matplotlib.pyplot as plt
import seaborn as sns
sns.set_context("paper", font_scale=2)
def cross_valid(model... | 35.296 | 114 | 0.56029 | import pandas as pd
import numpy as np
from scipy.stats import mode, gaussian_kde
from scipy.optimize import minimize, shgo
from sklearn.metrics import mean_squared_error as mse
from sklearn.metrics import mean_absolute_error as mae
from sklearn.model_selection import KFold,StratifiedKFold
from sklearn.metrics i... | 2 | 0 | 0 | 7,375 | 0 | 3,444 | 0 | 155 | 312 |
59e21cda5cbdfc5f6a3f3c3bb8c3832a47836409 | 321 | py | Python | opencv-test.py | domnantas/landing-system | 408f352ce56d83ec63882e0aee370df5f5d683ad | [
"MIT"
] | 1 | 2021-09-15T08:06:03.000Z | 2021-09-15T08:06:03.000Z | opencv-test.py | domnantas/landing-system | 408f352ce56d83ec63882e0aee370df5f5d683ad | [
"MIT"
] | null | null | null | opencv-test.py | domnantas/landing-system | 408f352ce56d83ec63882e0aee370df5f5d683ad | [
"MIT"
] | null | null | null | import time
import cv2
cap = cv2.VideoCapture(0)
cap.set(cv2.CAP_PROP_FRAME_WIDTH, 640)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 480)
cap.set(cv2.CAP_PROP_FPS, 40)
start = time.time()
frames = 400
for i in range(frames):
ret, img = cap.read()
print("Time for {0} frames: {1} seconds".format(frames, time.time() - start))... | 22.928571 | 77 | 0.716511 | import time
import cv2
cap = cv2.VideoCapture(0)
cap.set(cv2.CAP_PROP_FRAME_WIDTH, 640)
cap.set(cv2.CAP_PROP_FRAME_HEIGHT, 480)
cap.set(cv2.CAP_PROP_FPS, 40)
start = time.time()
frames = 400
for i in range(frames):
ret, img = cap.read()
print("Time for {0} frames: {1} seconds".format(frames, time.time() - start))... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4aec38c3d76f8b1ce6c26284dacdf0c61e6ce58c | 4,237 | py | Python | slot/w/sword.py | Happytogepi/dl | 6d67d255c75b30ed328cb4f839f241996bd641e6 | [
"Apache-2.0"
] | null | null | null | slot/w/sword.py | Happytogepi/dl | 6d67d255c75b30ed328cb4f839f241996bd641e6 | [
"Apache-2.0"
] | null | null | null | slot/w/sword.py | Happytogepi/dl | 6d67d255c75b30ed328cb4f839f241996bd641e6 | [
"Apache-2.0"
] | null | null | null |
flame = Agito_Nothung
water = HDT2_Absolute_Aqua
wind = HDT2_Absolute_Tempest
light = HDT2_Absolute_Lightning
shadow = Agito_Yitian_Jian | 23.153005 | 55 | 0.454331 | from slot import WeaponBase
from slot.w import agito_buffs
class HDT1_Crimson(WeaponBase):
ele = ['flame']
wt = 'sword'
att = 765
s3 = {
"dmg" : 5*1.65 ,
"sp" : 6847 ,
"startup" : 0.1 ,
"recovery" : 3.1 ,
"hit" : 5 ,
} ... | 0 | 0 | 0 | 3,558 | 0 | 0 | 0 | 15 | 527 |
ec090eb0324582c6d8a3b32c11c83f49887395f1 | 4,232 | py | Python | packages/core/minos-microservice-aggregate/minos/aggregate/snapshots/abc.py | sorasful/minos-python | 1189330eebf6444627a2af6b29f347670f95a4dd | [
"MIT"
] | null | null | null | packages/core/minos-microservice-aggregate/minos/aggregate/snapshots/abc.py | sorasful/minos-python | 1189330eebf6444627a2af6b29f347670f95a4dd | [
"MIT"
] | null | null | null | packages/core/minos-microservice-aggregate/minos/aggregate/snapshots/abc.py | sorasful/minos-python | 1189330eebf6444627a2af6b29f347670f95a4dd | [
"MIT"
] | null | null | null | from __future__ import (
annotations,
)
from typing import (TYPE_CHECKING)
if TYPE_CHECKING:
| 33.587302 | 120 | 0.657136 | from __future__ import (
annotations,
)
from abc import (
ABC,
abstractmethod,
)
from typing import (
TYPE_CHECKING,
AsyncIterator,
Awaitable,
Optional,
)
from uuid import (
UUID,
)
from minos.common import (
MinosSetup,
)
from ..queries import (
_Condition,
_Ordering,
)
f... | 0 | 260 | 2,864 | 609 | 0 | 0 | 0 | 238 | 162 |
106a652e22c059f91b8804d800976bc68aa951f0 | 1,677 | py | Python | util/tsne.py | obodroid/openface | 39866481103fd405fa59bd47488f4a56070b0eac | [
"Apache-2.0"
] | null | null | null | util/tsne.py | obodroid/openface | 39866481103fd405fa59bd47488f4a56070b0eac | [
"Apache-2.0"
] | null | null | null | util/tsne.py | obodroid/openface | 39866481103fd405fa59bd47488f4a56070b0eac | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python2
# Allow other computers to attach to ptvsd at this IP address and port, using the secret
# ptvsd.enable_attach("my_secret", address = ('0.0.0.0', 3000))
# Pause the program until a remote debugger is attached
# ptvsd.wait_for_attach()
import numpy as np
import pandas as pd
from sklearn.decompo... | 28.913793 | 88 | 0.665474 | #!/usr/bin/env python2
import ptvsd
# Allow other computers to attach to ptvsd at this IP address and port, using the secret
# ptvsd.enable_attach("my_secret", address = ('0.0.0.0', 3000))
# Pause the program until a remote debugger is attached
# ptvsd.wait_for_attach()
import numpy as np
import pandas as pd
from sk... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -9 | 22 |
68722181e957ee1738d1d5273316c8373bbeccb1 | 491 | py | Python | 02_Arrays_in_Numpy/5.5_Arrays_mit_Nullen_und_Einsen.py | felixdittrich92/numerisches_python | 0f895ee19b4fa3cf7ad38cd3dfe3cd7020ee34a7 | [
"MIT"
] | null | null | null | 02_Arrays_in_Numpy/5.5_Arrays_mit_Nullen_und_Einsen.py | felixdittrich92/numerisches_python | 0f895ee19b4fa3cf7ad38cd3dfe3cd7020ee34a7 | [
"MIT"
] | null | null | null | 02_Arrays_in_Numpy/5.5_Arrays_mit_Nullen_und_Einsen.py | felixdittrich92/numerisches_python | 0f895ee19b4fa3cf7ad38cd3dfe3cd7020ee34a7 | [
"MIT"
] | null | null | null | import numpy as np
# Einsen
# float
E = np.ones((2, 3))
print(E)
print("---------------------------")
# int
F = np.ones((3, 4), dtype=int)
print(F)
print("---------------------------")
# Nullen
# float
Z = np.zeros((2, 4))
print(Z)
print("---------------------------")
# int
Z = np.zeros((3, 4), dtype=int)
print(... | 13.638889 | 36 | 0.407332 | import numpy as np
# Einsen
# float
E = np.ones((2, 3))
print(E)
print("---------------------------")
# int
F = np.ones((3, 4), dtype=int)
print(F)
print("---------------------------")
# Nullen
# float
Z = np.zeros((2, 4))
print(Z)
print("---------------------------")
# int
Z = np.zeros((3, 4), dtype=int)
print(... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8fa825c09275deee793e384b0889b54b7514093f | 31,017 | py | Python | drizzlepac/hlautils/cell_utils.py | srodney/drizzlepac | c554523331a6204ce113d4317b7286ad39094f74 | [
"BSD-3-Clause"
] | 2 | 2020-02-10T16:15:58.000Z | 2021-03-24T20:08:03.000Z | drizzlepac/hlautils/cell_utils.py | srodney/drizzlepac | c554523331a6204ce113d4317b7286ad39094f74 | [
"BSD-3-Clause"
] | null | null | null | drizzlepac/hlautils/cell_utils.py | srodney/drizzlepac | c554523331a6204ce113d4317b7286ad39094f74 | [
"BSD-3-Clause"
] | 1 | 2020-09-02T18:08:39.000Z | 2020-09-02T18:08:39.000Z | import os
import shutil
from scipy import ndimage
import numpy as np
from astropy import units as u
from astropy.io import fits
from astropy.table import Table
from astropy.coordinates import SkyCoord
from .. import wcs_functions
# Default grid definition file
_fpath = os.path.abspath(os.path.dirname(__file__))
PCEL... | 37.146108 | 106 | 0.600445 | import os
import shutil
import sys
from matplotlib import pyplot as plt
from scipy import ndimage
from scipy.ndimage import morphology
import numpy as np
import astropy
from astropy import units as u
from astropy.io import fits
from astropy.table import Table
from astropy.coordinates import SkyCoord
from spherical_geo... | 9 | 0 | 0 | 17,785 | 0 | 4,820 | 0 | 88 | 475 |
cd0b8e380b05dcb1df5a97722575fe163063d62e | 161 | py | Python | if_condition1.py | pavaniuriti2000/python_files | 89e3c6bd95af6756b49bc8ee1fa74f900ea6c681 | [
"MIT"
] | null | null | null | if_condition1.py | pavaniuriti2000/python_files | 89e3c6bd95af6756b49bc8ee1fa74f900ea6c681 | [
"MIT"
] | null | null | null | if_condition1.py | pavaniuriti2000/python_files | 89e3c6bd95af6756b49bc8ee1fa74f900ea6c681 | [
"MIT"
] | null | null | null | #if
answer=input("Do you need express shipping?(yes/no) :")
if answer.lower()==("yes" or "y"):
print("That will be an extra $50")
print("Have a nice day")
| 23 | 55 | 0.63354 | #if
answer=input("Do you need express shipping?(yes/no) :")
if answer.lower()==("yes" or "y"):
print("That will be an extra $50")
print("Have a nice day")
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0cf5579bff50ae31a9c43f137a290d0ec9ab128c | 1,173 | py | Python | assi1/client.py | geetesh-gupta/computer_networks_demystified | bc9eced6d7bdd544c7e2fae554d03036161d9756 | [
"MIT"
] | null | null | null | assi1/client.py | geetesh-gupta/computer_networks_demystified | bc9eced6d7bdd544c7e2fae554d03036161d9756 | [
"MIT"
] | null | null | null | assi1/client.py | geetesh-gupta/computer_networks_demystified | bc9eced6d7bdd544c7e2fae554d03036161d9756 | [
"MIT"
] | null | null | null |
if __name__ == "__main__":
# host = input("Enter the host of server: ")
# port = input("Enter the port of server: ")
client = Client('localhost', 1234)
| 30.868421 | 68 | 0.589088 | from constants import *
class Client:
def __init__(self, my_friends_host, my_friends_port, request):
# print("Client started...")
self.host = my_friends_host
self.port = my_friends_port
self.request = request
self.response = "DEFAULT"
self.s = socket.socket(socket.... | 0 | 0 | 0 | 959 | 0 | 0 | 0 | 2 | 45 |
13b58715e6bdc8978ba8e0084e485b70fa3428a5 | 9,936 | py | Python | monasca/tests/microservice/test_thresholding_processor.py | TeamZenith/python-monasca | badc86fbe2c4424deb15b84eabd3248e899ef4ee | [
"Apache-2.0"
] | null | null | null | monasca/tests/microservice/test_thresholding_processor.py | TeamZenith/python-monasca | badc86fbe2c4424deb15b84eabd3248e899ef4ee | [
"Apache-2.0"
] | null | null | null | monasca/tests/microservice/test_thresholding_processor.py | TeamZenith/python-monasca | badc86fbe2c4424deb15b84eabd3248e899ef4ee | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2015 CMU
# Author: Yihan Wang <wangff9@gmail.com>
#
# 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
#
# U... | 36.664207 | 75 | 0.494062 | # -*- coding: utf-8 -*-
# Copyright 2015 CMU
# Author: Yihan Wang <wangff9@gmail.com>
#
# 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
#
# U... | 270 | 0 | 0 | 8,995 | 0 | 0 | 0 | 31 | 112 |
2363436ca1a736b2075adf865948a664960c3ec6 | 2,066 | py | Python | lotoes/secciones/consignaciones/controller_consignaciones.py | vidddd/lotoes | caf5fe71006e00e590549f921052f110c4bbb75f | [
"MIT"
] | null | null | null | lotoes/secciones/consignaciones/controller_consignaciones.py | vidddd/lotoes | caf5fe71006e00e590549f921052f110c4bbb75f | [
"MIT"
] | null | null | null | lotoes/secciones/consignaciones/controller_consignaciones.py | vidddd/lotoes | caf5fe71006e00e590549f921052f110c4bbb75f | [
"MIT"
] | null | null | null | from flask import Blueprint
BP_NM = 'consignaciones'
consignaciones = Blueprint(BP_NM, __name__, template_folder='templates')
'''
@consignaciones.route('/consignacion/<int:consignacion_id>')
@login_required
def Consignacion(consignacion_id):
Consignacion = Consignacion.get_by_id(Consignacion_id)
if consignac... | 38.981132 | 106 | 0.763795 | from flask import url_for, redirect, Blueprint, render_template, request, current_app
from .model_consignacion import Consignacion
from .form_Consignacion import ConsignacionForm
from flask_login import login_required, login_user, logout_user, current_user
from werkzeug.exceptions import NotFound
BP_NM = 'consignacion... | 0 | 650 | 0 | 0 | 0 | 0 | 0 | 182 | 134 |
1ffa5e6006543b76e24a4265eb1e234f2ad27994 | 717 | py | Python | python/matplotlib/plot3d/parametric_sphere.py | jeremiedecock/snippets | 4bd4e7f459eee610d5cf19f845299ca942ff4b64 | [
"MIT"
] | 23 | 2015-06-08T13:01:00.000Z | 2021-12-30T08:20:04.000Z | python/matplotlib/plot3d/parametric_sphere.py | jeremiedecock/snippets | 4bd4e7f459eee610d5cf19f845299ca942ff4b64 | [
"MIT"
] | 1 | 2020-10-22T02:36:10.000Z | 2020-10-22T02:36:10.000Z | python/matplotlib/plot3d/parametric_sphere.py | jeremiedecock/snippets | 4bd4e7f459eee610d5cf19f845299ca942ff4b64 | [
"MIT"
] | 7 | 2017-10-31T09:48:14.000Z | 2022-01-04T15:59:45.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Parametric sphere
See http://matplotlib.org/examples/mplot3d/surface3d_demo2.html
"""
import matplotlib.pyplot as plt
import numpy as np
# Build datas ###############
u = np.linspace(0, 2.*np.pi, 100)
v = np.linspace(0, np.pi, 100)
x = 10 * np.outer(np.cos(u), np.... | 19.378378 | 63 | 0.638773 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Parametric sphere
See http://matplotlib.org/examples/mplot3d/surface3d_demo2.html
"""
from mpl_toolkits.mplot3d import axes3d
import matplotlib.pyplot as plt
import numpy as np
# Build datas ###############
u = np.linspace(0, 2.*np.pi, 100)
v = np.linspace(0, np.p... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 18 | 23 |
ec9cb1f004df7d7fb732a64c72a6a35fcca3d176 | 9,234 | py | Python | cryptoconditions/types/prefix.py | Chuseuiti/cryptoconditions | 9cee492d4a792205b29824399224861841a785b0 | [
"MIT"
] | null | null | null | cryptoconditions/types/prefix.py | Chuseuiti/cryptoconditions | 9cee492d4a792205b29824399224861841a785b0 | [
"MIT"
] | null | null | null | cryptoconditions/types/prefix.py | Chuseuiti/cryptoconditions | 9cee492d4a792205b29824399224861841a785b0 | [
"MIT"
] | null | null | null |
CONDITION = 'condition'
FULFILLMENT = 'fulfillment'
| 34.073801 | 79 | 0.654429 | from base64 import urlsafe_b64decode
from itertools import chain
from pyasn1.codec.der.encoder import encode as der_encode
from pyasn1.codec.native.decoder import decode as nat_decode
from cryptoconditions.condition import Condition
from cryptoconditions.crypto import base64_add_padding
from cryptoconditions.fulfillm... | 0 | 3,935 | 0 | 4,689 | 0 | 0 | 0 | 311 | 245 |
b527dfd8edd1579de928fc0dfbd2854ba5193726 | 3,039 | py | Python | text_recog.py | look4pritam/deep-text-recognition-benchmark | d8c6632d0d2dab237613bae13edefa458d6d683f | [
"Apache-2.0"
] | 27 | 2020-08-09T21:07:33.000Z | 2022-01-25T22:34:52.000Z | text_recog.py | look4pritam/deep-text-recognition-benchmark | d8c6632d0d2dab237613bae13edefa458d6d683f | [
"Apache-2.0"
] | 3 | 2021-01-27T04:41:08.000Z | 2022-02-15T05:17:29.000Z | text_recog.py | look4pritam/deep-text-recognition-benchmark | d8c6632d0d2dab237613bae13edefa458d6d683f | [
"Apache-2.0"
] | 9 | 2020-08-18T09:32:40.000Z | 2021-12-13T14:13:57.000Z | # Import required modules
import argparse
############ Add argument parser for command line arguments ############
parser = argparse.ArgumentParser(
description = "The OCR model can be obtained from converting the pretrained CRNN model to .onnx format from the github repository https://github.com/meijieru/crnn.pyt... | 31.989474 | 176 | 0.632774 | # Import required modules
import numpy as np
import cv2 as cv
import math
import argparse
############ Add argument parser for command line arguments ############
parser = argparse.ArgumentParser(
description = "The OCR model can be obtained from converting the pretrained CRNN model to .onnx format from the github... | 0 | 0 | 0 | 0 | 0 | 1,871 | 0 | -18 | 135 |
2180018c87f5f9cd39e51f5f21c62785677c08ee | 900 | py | Python | posts/urls.py | erkin98/news | 6990a51e2b961573011c793c1ad84622d55fa6a1 | [
"MIT"
] | null | null | null | posts/urls.py | erkin98/news | 6990a51e2b961573011c793c1ad84622d55fa6a1 | [
"MIT"
] | null | null | null | posts/urls.py | erkin98/news | 6990a51e2b961573011c793c1ad84622d55fa6a1 | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path("posts/", views.ListCreatePostAPIView.as_view(), name="get_posts"),
path(
"posts/<int:pk>/",
views.RetrieveUpdateDestroyPostAPIView.as_view(),
name="get_delete_update_post",
),
path(
"posts/<int:pk>/u... | 27.272727 | 76 | 0.625556 | from django.urls import path
from . import views
urlpatterns = [
path("posts/", views.ListCreatePostAPIView.as_view(), name="get_posts"),
path(
"posts/<int:pk>/",
views.RetrieveUpdateDestroyPostAPIView.as_view(),
name="get_delete_update_post",
),
path(
"posts/<int:pk>/u... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c6355568c7b986f756387c8210ff27abea98f1d5 | 425 | py | Python | setup.py | Phylliade/vinci0 | c4e4283ccdeca8261e6ead199fb2af3e4ef4742d | [
"MIT"
] | 1 | 2017-09-14T07:06:19.000Z | 2017-09-14T07:06:19.000Z | setup.py | Phylliade/keras-rl | c4e4283ccdeca8261e6ead199fb2af3e4ef4742d | [
"MIT"
] | null | null | null | setup.py | Phylliade/keras-rl | c4e4283ccdeca8261e6ead199fb2af3e4ef4742d | [
"MIT"
] | null | null | null | from setuptools import setup
from setuptools import find_packages
setup(name='vinci',
version='1.0.0~dev',
description='Deep Reinforcement Learning for Keras',
author='Matthias Plappert, Pierre Manceron',
url='https://github.com/phylliade/vinci',
license='MIT',
install_requires=['k... | 26.5625 | 58 | 0.637647 | from setuptools import setup
from setuptools import find_packages
setup(name='vinci',
version='1.0.0~dev',
description='Deep Reinforcement Learning for Keras',
author='Matthias Plappert, Pierre Manceron',
url='https://github.com/phylliade/vinci',
license='MIT',
install_requires=['k... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
49b8167c389fd315050c5fa4504ea4e22031eb7d | 1,427 | py | Python | tests/test_eaichecker.py | imarg3/idn-eai | 19a865c284523a4ee8b11318e3c1c462d5cecea4 | [
"MIT"
] | null | null | null | tests/test_eaichecker.py | imarg3/idn-eai | 19a865c284523a4ee8b11318e3c1c462d5cecea4 | [
"MIT"
] | null | null | null | tests/test_eaichecker.py | imarg3/idn-eai | 19a865c284523a4ee8b11318e3c1c462d5cecea4 | [
"MIT"
] | null | null | null |
# 'mocker' fixture provided by pytest-mock
| 43.242424 | 97 | 0.677645 | import pytest
from eai import eaichecker
class TestEAIChecker:
# 'mocker' fixture provided by pytest-mock
@pytest.mark.parametrize("test_input, expected", [
("gmail.com", "TRUE"), ("gistmail.in", "TRUE"), ("जिस्टमेल.भारत", "TRUE"),
("डाटामेल.भारत", "TRUE")
])
def test_check_smtputf8_... | 69 | 1,210 | 0 | 0 | 0 | 0 | 0 | -3 | 148 |
48fb33411f2b9fa1aba64918545cc26ac5d94343 | 7,538 | py | Python | 3 - priority_purge.py | tsitokely/ETL-Analysis | 45f88c4f8f453fc0c8a9612778a9c0110b067ddb | [
"MIT"
] | null | null | null | 3 - priority_purge.py | tsitokely/ETL-Analysis | 45f88c4f8f453fc0c8a9612778a9c0110b067ddb | [
"MIT"
] | null | null | null | 3 - priority_purge.py | tsitokely/ETL-Analysis | 45f88c4f8f453fc0c8a9612778a9c0110b067ddb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import sqlite3 as lite
import sys
import datetime
import csv
now = datetime.datetime.now()
currdate = now.strftime("%Y%m%d")
orig_stdout = sys.stdout
dbcon = lite.connect(r"WORK_PATH\\Purge\\suivi_purge.db")
#Analysis of current day turnover
cur = dbcon.cursor()
cur.execute(... | 25.043189 | 191 | 0.645662 | # -*- coding: utf-8 -*-
import sqlite3 as lite
import sys
import datetime
import csv
now = datetime.datetime.now()
currdate = now.strftime("%Y%m%d")
orig_stdout = sys.stdout
dbcon = lite.connect(r"WORK_PATH\\Purge\\suivi_purge.db")
#Analysis of current day turnover
cur = dbcon.cursor()
cur.execute(... | 16 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
170fceedcf4b01473e051ef32cbb64b1e2bbcb19 | 5,469 | py | Python | super_resolution/VDSR_PyTorch/main.py | kumayu0108/model-zoo | 4285779f6ff51fa1efb0625d67b428e90c343c0c | [
"MIT"
] | 43 | 2020-05-16T21:05:34.000Z | 2022-02-08T11:33:29.000Z | super_resolution/VDSR_PyTorch/main.py | kumayu0108/model-zoo | 4285779f6ff51fa1efb0625d67b428e90c343c0c | [
"MIT"
] | 52 | 2020-05-14T16:18:08.000Z | 2021-11-02T19:13:47.000Z | super_resolution/VDSR_PyTorch/main.py | kumayu0108/model-zoo | 4285779f6ff51fa1efb0625d67b428e90c343c0c | [
"MIT"
] | 69 | 2020-05-14T13:39:23.000Z | 2021-07-30T00:51:27.000Z | import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.optim as optim
if __name__ == '__main__':
main() | 39.064286 | 122 | 0.653684 | import argparse
import torch
import random
import torch.backends.cudnn as cudnn
import torch.nn as nn
import torch.optim as optim
from torch.autograd import Variable
from torch.utils.data import DataLoader
from PIL import Image
import numpy as np
import time
import matplotlib.pyplot as plt
from model import VDSR
from u... | 0 | 0 | 0 | 0 | 0 | 5,028 | 0 | 4 | 311 |
3c75f3ddeb5e7c8f4c260422405d50d543dbb3af | 2,656 | py | Python | ann_benchmarks/algorithms/pynndescent.py | lebensterben/ann-benchmarks | 48f90eade66964befb985fab3f2cb79d82e48870 | [
"MIT"
] | null | null | null | ann_benchmarks/algorithms/pynndescent.py | lebensterben/ann-benchmarks | 48f90eade66964befb985fab3f2cb79d82e48870 | [
"MIT"
] | null | null | null | ann_benchmarks/algorithms/pynndescent.py | lebensterben/ann-benchmarks | 48f90eade66964befb985fab3f2cb79d82e48870 | [
"MIT"
] | null | null | null | from __future__ import absolute_import
| 39.058824 | 115 | 0.564759 | from __future__ import absolute_import
import pynndescent
from ann_benchmarks.algorithms.base import BaseANN
import numpy as np
class PyNNDescent(BaseANN):
def __init__(self, metric, index_param_dict, n_search_trees=1, n_jobs=1):
if "n_neighbors" in index_param_dict:
self._n_neighbors = int(i... | 0 | 0 | 0 | 2,503 | 0 | 0 | 0 | 23 | 89 |
8aab47106a5e29fe78cbd9ecc480d186d911ba81 | 10,405 | py | Python | ci/tests/test_ephys_np2.py | int-brain-lab/iblscripts | db65fb48e44a168d7ed5e08bc854a82e83a44cd0 | [
"MIT"
] | 3 | 2019-09-16T11:31:09.000Z | 2021-04-17T10:12:36.000Z | ci/tests/test_ephys_np2.py | int-brain-lab/iblscripts | db65fb48e44a168d7ed5e08bc854a82e83a44cd0 | [
"MIT"
] | 19 | 2019-07-09T17:57:44.000Z | 2021-04-22T09:24:25.000Z | ci/tests/test_ephys_np2.py | int-brain-lab/iblscripts | db65fb48e44a168d7ed5e08bc854a82e83a44cd0 | [
"MIT"
] | 7 | 2019-07-25T18:46:58.000Z | 2021-04-20T10:32:07.000Z |
if __name__ == "__main__":
import unittest
unittest.main(exit=False)
| 43.354167 | 100 | 0.618837 | import numpy as np
import random
import shutil
from ibllib.ephys.np2_converter import NP2Converter
from ibllib.io import spikeglx
from ci.tests import base
class TestNeuropixel2ConverterNP24(base.IntegrationTest):
"""
Check NP2 converter with NP2.4 type probes
"""
def setUp(self) -> No... | 0 | 0 | 0 | 10,074 | 0 | 0 | 0 | 24 | 217 |
b270a70a9dbc51ac2bb7661c96321da307e98efc | 1,213 | py | Python | datasets/qa/bAbI/utils.py | chetanchougle/chatbot2 | 489d63c2f91b095728ab50f3708b6cf6279f6a20 | [
"MIT"
] | 2 | 2020-12-12T14:21:05.000Z | 2020-12-14T03:08:05.000Z | conciencia/datasets/qa/bAbI/utils.py | dsapandora/nao_ros_api | 99aece058e43b57e535146a0ee7b917b3eab7a2d | [
"MIT"
] | 1 | 2021-03-19T22:49:56.000Z | 2021-03-19T22:49:56.000Z | conciencia/datasets/qa/bAbI/utils.py | dsapandora/nao_ros_api | 99aece058e43b57e535146a0ee7b917b3eab7a2d | [
"MIT"
] | null | null | null |
'''
split data into train (70%), test (15%) and valid(15%)
return tuple( (trainX, trainY), (testX,testY), (validX,validY) )
'''
'''
generate batches, by random sampling a bunch of items
yield (x_gen, y_gen)
'''
'''
a generic decode function
inputs : sequence, lookup
'''
| 28.209302 | 81 | 0.610058 | import numpy as np
from random import sample
'''
split data into train (70%), test (15%) and valid(15%)
return tuple( (trainX, trainY), (testX,testY), (validX,validY) )
'''
def split_dataset(s, q, a, ratio = [0.7, 0.15, 0.15] ):
# number of examples
data_len = len(a)
lens = [ int(data_len*item) for i... | 0 | 0 | 0 | 0 | 158 | 649 | 0 | 1 | 110 |
749efbd668fdc7bc190e6d42f8a186a1de57f998 | 69 | py | Python | wagtail_localize_rws_languagecloud/signals.py | zerolab/wagtail-localize-rws-languagecloud | 35c67c014c195e4e77896c7449643ea78a6aae68 | [
"BSD-3-Clause"
] | null | null | null | wagtail_localize_rws_languagecloud/signals.py | zerolab/wagtail-localize-rws-languagecloud | 35c67c014c195e4e77896c7449643ea78a6aae68 | [
"BSD-3-Clause"
] | 6 | 2022-01-29T14:59:50.000Z | 2022-03-31T12:09:06.000Z | wagtail_localize_rws_languagecloud/signals.py | zerolab/wagtail-localize-rws-languagecloud | 35c67c014c195e4e77896c7449643ea78a6aae68 | [
"BSD-3-Clause"
] | null | null | null | from django.dispatch import Signal
translation_imported = Signal()
| 13.8 | 34 | 0.811594 | from django.dispatch import Signal
translation_imported = Signal()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d8534a5b0613e98ed9b22106de13e14ac02cfe02 | 88 | py | Python | pyfix/FIX44/__init__.py | pkdcryptos/wannabegeek_PyFIX | b903e70ce79cefc2525200f84ee4f90c5bf4c686 | [
"CC0-1.0"
] | 100 | 2016-01-22T07:38:47.000Z | 2022-02-25T20:00:46.000Z | pyfix/FIX44/__init__.py | pkdcryptos/wannabegeek_PyFIX | b903e70ce79cefc2525200f84ee4f90c5bf4c686 | [
"CC0-1.0"
] | 1 | 2017-04-13T16:27:25.000Z | 2019-03-26T12:35:38.000Z | pyfix/FIX44/__init__.py | pkdcryptos/wannabegeek_PyFIX | b903e70ce79cefc2525200f84ee4f90c5bf4c686 | [
"CC0-1.0"
] | 53 | 2016-01-22T07:38:49.000Z | 2022-02-22T07:08:52.000Z |
__author__ = 'tom'
beginstring = 'FIX.4.4'
| 12.571429 | 41 | 0.727273 | from pyfix.FIX44 import msgtype, messages
__author__ = 'tom'
beginstring = 'FIX.4.4'
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 20 | 22 |
852ecdd78588ecc85c831e37906a0a3c87576141 | 2,119 | py | Python | hwtLib/amba/axiLite_comp/buff_test.py | optical-o/hwtLib | edad621f5ad4cdbea20a5751ff4468979afe2f77 | [
"MIT"
] | 24 | 2017-02-23T10:00:50.000Z | 2022-01-28T12:20:21.000Z | hwtLib/amba/axiLite_comp/buff_test.py | optical-o/hwtLib | edad621f5ad4cdbea20a5751ff4468979afe2f77 | [
"MIT"
] | 32 | 2017-04-28T10:29:34.000Z | 2021-04-27T09:16:43.000Z | hwtLib/amba/axiLite_comp/buff_test.py | optical-o/hwtLib | edad621f5ad4cdbea20a5751ff4468979afe2f77 | [
"MIT"
] | 8 | 2019-09-19T03:34:36.000Z | 2022-01-21T06:56:58.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
if __name__ == "__main__":
import unittest
suite = unittest.TestSuite()
# suite.addTest(Axi4_wDatapumpTC('test_singleLong'))
suite.addTest(unittest.makeSuite(AxiRegTC))
runner = unittest.TextTestRunner(verbosity=3)
runner.run(suite)
| 32.6 | 83 | 0.715904 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from hwt.hdl.types.struct import HStructField
from hwt.interfaces.structIntf import StructIntf
from hwt.interfaces.utils import propagateClkRstn
from hwt.synthesizer.unit import Unit
from hwtLib.abstract.busEndpoint import BusEndpoint
from hwtLib.amba.axi4Lite import Axi4... | 0 | 108 | 0 | 1,196 | 0 | 0 | 0 | 262 | 245 |
a7dc9c448f804cf6300e7169f8ea7065ea7d9132 | 5,471 | py | Python | tomcat_crack.py | galletitaoreo/PythonPentest | abd46cc251abfc3fba02d7f03ddd049803dc6047 | [
"MIT"
] | 5 | 2019-08-07T08:59:53.000Z | 2021-05-14T19:35:57.000Z | tomcat_crack.py | Harusenpai/PythonPentest | abd46cc251abfc3fba02d7f03ddd049803dc6047 | [
"MIT"
] | null | null | null | tomcat_crack.py | Harusenpai/PythonPentest | abd46cc251abfc3fba02d7f03ddd049803dc6047 | [
"MIT"
] | 2 | 2021-03-31T21:20:19.000Z | 2021-08-28T04:21:12.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Functions: Idenfy tomcat password
# Code By BlAck.Eagle
import threading, time, random, sys, urllib2, httplib, base64
from copy import copy
import re
from collections import defaultdict, deque
if __name__ == '__main__':
if len(sys.argv) !=5:
... | 39.644928 | 112 | 0.451289 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Functions: Idenfy tomcat password
# Code By BlAck.Eagle
import threading, time, random, sys, urllib2, httplib, base64
from copy import copy
import re
from collections import defaultdict, deque
class Tomcatbrute(threading.Thread):
def __init__(self,server,po... | 6 | 0 | 0 | 3,117 | 0 | 58 | 0 | 0 | 45 |
9cb26e3f05d8a27dd377c4ee3c81c30a8b15f602 | 2,219 | py | Python | brutemethehorizon/sprayer.py | leitosama/BruteMeTheHorizon | fe792f464897e28f9b770f0949e12d714b3ecff0 | [
"MIT"
] | 2 | 2021-05-31T07:05:55.000Z | 2021-10-16T19:43:43.000Z | brutemethehorizon/sprayer.py | leitosama/BruteMeTheHorizon | fe792f464897e28f9b770f0949e12d714b3ecff0 | [
"MIT"
] | null | null | null | brutemethehorizon/sprayer.py | leitosama/BruteMeTheHorizon | fe792f464897e28f9b770f0949e12d714b3ecff0 | [
"MIT"
] | null | null | null | import logging
logger = logging.getLogger('horizon')
| 38.258621 | 124 | 0.573231 | import logging
import sys
from typing import Optional
from brutemethehorizon import helper
from brutemethehorizon.config import Colors, Config
logger = logging.getLogger('horizon')
def run(url: str, userlist: list, passlist: list, domain: str) -> Optional[dict]:
d = {}
for password in passlist:
for ... | 0 | 0 | 0 | 0 | 0 | 1,988 | 0 | 40 | 135 |
bee21190f1cdb932d9e7fe8337d5272b2fdc7884 | 37,229 | py | Python | cloudbaseinit/tests/metadata/services/test_azureservice.py | andia10240/cloudbase-init | 3c290194c139990f2a0e5747aa2f6c9554d26659 | [
"Apache-2.0"
] | 160 | 2015-01-09T14:45:59.000Z | 2022-03-15T09:15:12.000Z | cloudbaseinit/tests/metadata/services/test_azureservice.py | andia10240/cloudbase-init | 3c290194c139990f2a0e5747aa2f6c9554d26659 | [
"Apache-2.0"
] | 95 | 2015-01-25T15:22:05.000Z | 2022-03-16T10:40:27.000Z | cloudbaseinit/tests/metadata/services/test_azureservice.py | andia10240/cloudbase-init | 3c290194c139990f2a0e5747aa2f6c9554d26659 | [
"Apache-2.0"
] | 86 | 2015-01-19T17:19:35.000Z | 2022-03-24T09:21:55.000Z | # Copyright 2017 Cloudbase Solutions Srl
#
# 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 l... | 47.185044 | 79 | 0.677509 | # Copyright 2017 Cloudbase Solutions Srl
#
# 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 l... | 0 | 30,338 | 0 | 5,859 | 0 | 0 | 0 | 20 | 182 |
9d92a8d9c337b80728fa26e79cecee80128545f8 | 992 | py | Python | tests/audio/test_audioset_vgg.py | fossabot/Video-to-Online-Platform | 46019562f072a5dc2a92684986411d7f88758882 | [
"Apache-2.0"
] | 82 | 2019-10-04T05:40:45.000Z | 2020-03-14T06:40:02.000Z | tests/audio/test_audioset_vgg.py | wangyongjie-ntu/Video-to-Online-Platform | b1230c8f702487225566b5be13947bd6f7904556 | [
"Apache-2.0"
] | 9 | 2020-06-04T19:31:59.000Z | 2021-01-10T02:32:02.000Z | tests/audio/test_audioset_vgg.py | wangyongjie-ntu/Video-to-Online-Platform | b1230c8f702487225566b5be13947bd6f7904556 | [
"Apache-2.0"
] | 24 | 2019-10-04T05:46:46.000Z | 2020-05-30T05:22:32.000Z | import tensorflow as tf
from models.object.audioset_feature_extractor import AudiosetFeatureExtractor
if __name__ == '__main__':
# Load text module graph
PATH_TO_TEST_AUDIO = 'test_DB/audios/BBT0624.wav'
PATH_TO_VGG_GRAPH = '../weights/audioset/vggish_fr.pb'
PATH_TO_PCA_PARAMS = '../weights/audioset/vg... | 36.740741 | 89 | 0.732863 | import tensorflow as tf
import _init_paths
from models.object.audioset_feature_extractor import AudiosetFeatureExtractor
if __name__ == '__main__':
# Load text module graph
PATH_TO_TEST_AUDIO = 'test_DB/audios/BBT0624.wav'
PATH_TO_VGG_GRAPH = '../weights/audioset/vggish_fr.pb'
PATH_TO_PCA_PARAMS = '../... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 22 |
3b05936a951949a8b8910d696c69021f4464ba45 | 2,382 | py | Python | sqlacodegen/main.py | rflynn/sqlacodegen | 04938734de8e1c2c1e56dc4e0a8bd6202c70907f | [
"MIT"
] | 2 | 2016-08-02T09:52:27.000Z | 2016-11-24T11:31:58.000Z | sqlacodegen/main.py | rflynn/sqlacodegen | 04938734de8e1c2c1e56dc4e0a8bd6202c70907f | [
"MIT"
] | 3 | 2016-06-20T21:32:03.000Z | 2020-05-09T20:02:37.000Z | sqlacodegen/main.py | rflynn/sqlacodegen | 04938734de8e1c2c1e56dc4e0a8bd6202c70907f | [
"MIT"
] | 1 | 2021-09-29T02:25:55.000Z | 2021-09-29T02:25:55.000Z | """ """
from __future__ import unicode_literals, division, print_function, absolute_import
| 50.680851 | 118 | 0.725441 | """ """
from __future__ import unicode_literals, division, print_function, absolute_import
import argparse
import codecs
import sys
from sqlalchemy.engine import create_engine
from sqlalchemy.schema import MetaData
from sqlacodegen.codegen import CodeGenerator
import sqlacodegen
def main():
parser = argparse.Ar... | 0 | 0 | 0 | 0 | 0 | 2,076 | 0 | 35 | 179 |
10329688c93a5312fdb9d5587efd23380281c207 | 611 | py | Python | tests/test_all.py | xdl/soothing-sounds | e8361170e60c1d72768fabfe2fb263f21ea54ca8 | [
"Apache-2.0"
] | null | null | null | tests/test_all.py | xdl/soothing-sounds | e8361170e60c1d72768fabfe2fb263f21ea54ca8 | [
"Apache-2.0"
] | null | null | null | tests/test_all.py | xdl/soothing-sounds | e8361170e60c1d72768fabfe2fb263f21ea54ca8 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import pytest
nsec = 1
nbitfile = 16
nbitfloat = 32 # from generator.py
Noises = ['white', 'pink', 'blue', 'brown', 'violet']
if __name__ == '__main__':
pytest.main([__file__])
| 19.709677 | 82 | 0.644845 | #!/usr/bin/env python
import pytest
import soothingsounds as ss
nsec = 1
nbitfile = 16
nbitfloat = 32 # from generator.py
Noises = ['white', 'pink', 'blue', 'brown', 'violet']
def noise():
for noise in Noises:
samps = ss.computenoise(noise, 16000, nsec, nbitfloat, nbitfile)
assert samps.itemsi... | 0 | 0 | 0 | 0 | 0 | 327 | 0 | 6 | 68 |
c38bc350015797802c6312866894f20915d7265f | 15,921 | py | Python | onpolicy/envs/highway/highway_env/envs/highway_env.py | LUMO666/Highway | 05e1ad318bd14d405bd78d612e5706f7db2b3266 | [
"MIT"
] | 5 | 2021-06-15T05:06:10.000Z | 2021-12-01T05:11:49.000Z | onpolicy/envs/highway/highway_env/envs/highway_env.py | LUMO666/Highway | 05e1ad318bd14d405bd78d612e5706f7db2b3266 | [
"MIT"
] | null | null | null | onpolicy/envs/highway/highway_env/envs/highway_env.py | LUMO666/Highway | 05e1ad318bd14d405bd78d612e5706f7db2b3266 | [
"MIT"
] | null | null | null | from gym.envs.registration import register
register(
id='highway-v0',
entry_point='onpolicy.envs.highway.highway_env.envs:HighwayEnv',
)
| 46.826471 | 149 | 0.60907 | import numpy as np
from typing import Tuple
from gym.envs.registration import register
from onpolicy.envs.highway.highway_env import utils
from onpolicy.envs.highway.highway_env.envs.common.abstract import AbstractEnv
from onpolicy.envs.highway.highway_env.envs.common.action import Action
from onpolicy.envs.highway.hi... | 0 | 0 | 0 | 15,332 | 0 | 0 | 0 | 242 | 201 |
32d45c311bf1b0f0ca159d9ee7044ad1584ea92c | 1,486 | py | Python | scripts/depth_estimate.py | tdfuller54/Themis-ASM | 7f53c7667b2dcf17ae580af3a30382c94c06ec0e | [
"MIT"
] | 2 | 2021-05-29T16:15:45.000Z | 2021-12-14T18:36:22.000Z | scripts/depth_estimate.py | tdfuller54/Themis-ASM | 7f53c7667b2dcf17ae580af3a30382c94c06ec0e | [
"MIT"
] | null | null | null | scripts/depth_estimate.py | tdfuller54/Themis-ASM | 7f53c7667b2dcf17ae580af3a30382c94c06ec0e | [
"MIT"
] | 1 | 2021-12-06T21:19:24.000Z | 2021-12-06T21:19:24.000Z | import pysam
def count_depth(chr_name, size, threshold, input):
"""
Count the depth of the read. For each genomic coordinate return the
number of reads
-----
Parameters :
chr : (str) name of the chromosome
threshold : (int) minimum value to count pileup
-----
Returns :
... | 27.018182 | 73 | 0.672948 | import os
import sys
import pysam
import time
def get_chromosomes_names(input):
# opening the bam file with pysam
bamfile = pysam.AlignmentFile(input, 'rb')
# query all the names of the chromosomes in a list
list_chromosomes = bamfile.references
list_length = bamfile.lengths
bamfile.close()
... | 0 | 0 | 0 | 0 | 0 | 291 | 0 | -33 | 89 |
5313b03178c4e568f938e703ac6157d5de4b4197 | 94 | py | Python | server.py | World-of-Cryptopups/pug-tracker | e2b47e259eb4524dc1d5fa3748a470cd745d758b | [
"MIT"
] | null | null | null | server.py | World-of-Cryptopups/pug-tracker | e2b47e259eb4524dc1d5fa3748a470cd745d758b | [
"MIT"
] | null | null | null | server.py | World-of-Cryptopups/pug-tracker | e2b47e259eb4524dc1d5fa3748a470cd745d758b | [
"MIT"
] | null | null | null | from main import BotClient
import os
# run bot
bot = BotClient()
bot.run(os.getenv("TOKEN"))
| 13.428571 | 27 | 0.723404 | from main import BotClient
import os
# run bot
bot = BotClient()
bot.run(os.getenv("TOKEN"))
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
826028a73b1b2292efa32dd3dae414fbde49bf78 | 892 | py | Python | __init__.py | OOXXXXOO/WSNet | b64aa7d80fe0a7aa8a440f2bb6df1f1e497a7620 | [
"Apache-2.0"
] | 12 | 2019-08-20T06:27:15.000Z | 2022-02-15T05:26:58.000Z | __init__.py | OOXXXXOO/WSNet | b64aa7d80fe0a7aa8a440f2bb6df1f1e497a7620 | [
"Apache-2.0"
] | null | null | null | __init__.py | OOXXXXOO/WSNet | b64aa7d80fe0a7aa8a440f2bb6df1f1e497a7620 | [
"Apache-2.0"
] | 7 | 2019-08-26T03:31:26.000Z | 2022-03-19T06:17:39.000Z | # **************************************************************************** #
# #
# ::: :::::::: #
# __init__.py :+: :+: :+: ... | 68.615385 | 80 | 0.113229 | # **************************************************************************** #
# #
# ::: :::::::: #
# __init__.py :+: :+: :+: ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7e699eb31870c59293217483d1abb964e481d53c | 166 | py | Python | WetterKassel/__init__.py | jakobbbb/wetterkassel | 751edca4db03cb9ca3d43be6e53eea0abddba60d | [
"MIT"
] | null | null | null | WetterKassel/__init__.py | jakobbbb/wetterkassel | 751edca4db03cb9ca3d43be6e53eea0abddba60d | [
"MIT"
] | null | null | null | WetterKassel/__init__.py | jakobbbb/wetterkassel | 751edca4db03cb9ca3d43be6e53eea0abddba60d | [
"MIT"
] | null | null | null | # WetterKassel module
| 27.666667 | 47 | 0.855422 | # WetterKassel module
from config import config
from weatherapi import weatherapi, weathericons
from twitterapi import twitterapi
from tweetbuild import tweetbuild
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 54 | 89 |
2581fb196d3a3b09e62a569521f9a661ee7b3f48 | 100 | py | Python | sample-var.py | skasberger/twitter | 15ab7f6c0482baf77c2d39c5e8bde59e9169548f | [
"MIT"
] | 1 | 2015-02-09T04:55:43.000Z | 2015-02-09T04:55:43.000Z | sample-var.py | skasberger/twitter | 15ab7f6c0482baf77c2d39c5e8bde59e9169548f | [
"MIT"
] | null | null | null | sample-var.py | skasberger/twitter | 15ab7f6c0482baf77c2d39c5e8bde59e9169548f | [
"MIT"
] | null | null | null | CONSUMER_KEY = ''
CONSUMER_SECRET = ''
OAUTH_TOKEN = ''
OAUTH_TOKEN_SECRET = ''
ACCOUNTS = ['', '']
| 16.666667 | 23 | 0.64 | CONSUMER_KEY = ''
CONSUMER_SECRET = ''
OAUTH_TOKEN = ''
OAUTH_TOKEN_SECRET = ''
ACCOUNTS = ['', '']
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
64c49a57b7780df14e1a2c97ab645a51c7b5c13e | 4,440 | py | Python | GUI/WifiMonitor/IMU/constants.py | gchinellato/XD | f6c0134030c5e229a7b9c2621311c5204aed77af | [
"MIT"
] | 1 | 2019-10-15T20:31:39.000Z | 2019-10-15T20:31:39.000Z | GUI/WifiMonitor/IMU/constants.py | gchinellato/XD | f6c0134030c5e229a7b9c2621311c5204aed77af | [
"MIT"
] | null | null | null | GUI/WifiMonitor/IMU/constants.py | gchinellato/XD | f6c0134030c5e229a7b9c2621311c5204aed77af | [
"MIT"
] | null | null | null | """
*************************************************
* @Project: Self Balance
* @Platform: Raspberry PI 2 B+
* @Description: GY80 Header - Orientation sensor via I2C bus
* HMC5883L (3-Axis Digital Compass)
* ADXL345 (3-Axis Digital Accelerometer)
* L3... | 36.393443 | 70 | 0.675901 | """
*************************************************
* @Project: Self Balance
* @Platform: Raspberry PI 2 B+
* @Description: GY80 Header - Orientation sensor via I2C bus
* HMC5883L (3-Axis Digital Compass)
* ADXL345 (3-Axis Digital Accelerometer)
* L3... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d109b15d66f86c23ecef1d14b9920c84bfc5c062 | 11,936 | py | Python | age_prediction_by_input_source.py | dengemann/engemann-2020-multimodal-brain-age | ceffb1e01658e31d19dfc4dc0be7aff1d6d21af5 | [
"BSD-3-Clause"
] | 6 | 2020-11-11T21:26:20.000Z | 2022-01-18T17:18:45.000Z | age_prediction_by_input_source.py | dengemann/engemann-2020-multimodal-brain-age | ceffb1e01658e31d19dfc4dc0be7aff1d6d21af5 | [
"BSD-3-Clause"
] | 1 | 2022-03-14T07:56:17.000Z | 2022-03-14T07:56:17.000Z | age_prediction_by_input_source.py | dengemann/engemann-2020-multimodal-brain-age | ceffb1e01658e31d19dfc4dc0be7aff1d6d21af5 | [
"BSD-3-Clause"
] | 3 | 2020-06-10T08:34:04.000Z | 2022-03-14T01:37:08.000Z | """Age prediction using MRI, fMRI and MEG data."""
# Author: Denis A. Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
import pickle
import numpy as np
import pandas as pd
from joblib import Memory, Parallel, delayed
##############################################################################
# Paths... | 35.105882 | 80 | 0.62056 | """Age prediction using MRI, fMRI and MEG data."""
# Author: Denis A. Engemann <denis.engemann@gmail.com>
#
# License: BSD (3-clause)
import os.path as op
import pickle
import numpy as np
import pandas as pd
from sklearn.model_selection import KFold
from joblib import Memory, Parallel, delayed
from camcan.utils impo... | 0 | 2,573 | 0 | 0 | 0 | 2,118 | 0 | 74 | 181 |
558259f9f6ece573344535032cb4216af836c02c | 7,644 | py | Python | appenlight_client/timing/__init__.py | atomekk/appenlight-client-python | e5fd8a39b983343f23c0aa8ceaea0892a77d38c0 | [
"BSD-3-Clause"
] | 22 | 2015-03-09T15:00:56.000Z | 2018-09-27T06:57:39.000Z | appenlight_client/timing/__init__.py | atomekk/appenlight-client-python | e5fd8a39b983343f23c0aa8ceaea0892a77d38c0 | [
"BSD-3-Clause"
] | 31 | 2015-02-13T08:45:35.000Z | 2019-06-22T21:56:58.000Z | appenlight_client/timing/__init__.py | atomekk/appenlight-client-python | e5fd8a39b983343f23c0aa8ceaea0892a77d38c0 | [
"BSD-3-Clause"
] | 17 | 2015-02-12T20:40:36.000Z | 2020-04-22T02:43:57.000Z | from __future__ import absolute_import
import logging
import time
import threading
default_timer = time.time
TIMING_REGISTERED = False
local_timing = threading.local()
appenlight_storage = AppenlightLocalStorage()
log = logging.getLogger(__name__)
def _e_trace(info_gatherer, min_duration, e_callable, *args, *... | 34.278027 | 82 | 0.581109 | from __future__ import absolute_import
import logging
import six
import time
import threading
from appenlight_client.utils import import_from_module
from datetime import datetime, timedelta
from functools import wraps
from operator import itemgetter
default_timer = time.time
class AppenlightLocalStorage(object):
... | 0 | 1,411 | 0 | 2,883 | 0 | 2,322 | 0 | 57 | 203 |
cce20eebcba4d8dc99855577b74009b927f77881 | 5,496 | py | Python | tests/test_generators.py | mananam/pelican-prajna | a71dfdad094757514a342342415977297f8dae33 | [
"MIT"
] | null | null | null | tests/test_generators.py | mananam/pelican-prajna | a71dfdad094757514a342342415977297f8dae33 | [
"MIT"
] | null | null | null | tests/test_generators.py | mananam/pelican-prajna | a71dfdad094757514a342342415977297f8dae33 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import unittest
| 36.64 | 77 | 0.627365 | # -*- coding: utf-8 -*-
import os.path
import unittest
import unittest.mock
from prajna.generators import Sloka, SlokaGenerator
import pelican.settings
from pelican.writers import Writer
from pyfakefs import fake_filesystem
from sure import expect
class SlokaTests(unittest.TestCase):
def test_sloka_converts_ma... | 0 | 0 | 0 | 5,197 | 0 | 0 | 0 | 54 | 203 |
b50ad89a1e7c84657f50a13a883fd2e9b17951c8 | 2,292 | py | Python | lighthouse.py | pedrorijo91/lighthouse-keeper | a35b339b7765cb9a90cf1be5c59594dedc283382 | [
"MIT"
] | null | null | null | lighthouse.py | pedrorijo91/lighthouse-keeper | a35b339b7765cb9a90cf1be5c59594dedc283382 | [
"MIT"
] | null | null | null | lighthouse.py | pedrorijo91/lighthouse-keeper | a35b339b7765cb9a90cf1be5c59594dedc283382 | [
"MIT"
] | null | null | null | import httplib
import logging
import sys
sys.path.append("YoPy")
import configReader
config = configReader.ConfigReader()
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
def ping():
'''
if you want to simulate some errors you may try returning one of the follo... | 21.828571 | 102 | 0.691099 | import httplib
import time
import socket
import logging
import smtplib
import sys
sys.path.append("YoPy")
import yopy
import configReader
config = configReader.ConfigReader()
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(name)s - %(levelname)s - %(message)s')
def ping():
'''
if you want to simula... | 0 | 0 | 0 | 0 | 0 | 1,537 | 0 | -35 | 226 |
2acfa819a643d842c6102cde44dc04ec98c995aa | 138 | py | Python | hashcode/9896.py | noritersand/python-lab | 9238d62cb2d8b574a8d3697ac7d8b51f1251bc4b | [
"Unlicense"
] | null | null | null | hashcode/9896.py | noritersand/python-lab | 9238d62cb2d8b574a8d3697ac7d8b51f1251bc4b | [
"Unlicense"
] | null | null | null | hashcode/9896.py | noritersand/python-lab | 9238d62cb2d8b574a8d3697ac7d8b51f1251bc4b | [
"Unlicense"
] | null | null | null | import requests
url = 'https://finance.naver.com/item/board.nhn?code=000020&page=1'
req = requests.get(url)
html = req.text
print(html)
| 19.714286 | 67 | 0.731884 | import requests
url = 'https://finance.naver.com/item/board.nhn?code=000020&page=1'
req = requests.get(url)
html = req.text
print(html)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fa98edf72a717aa59a656800dd896763438dec1f | 3,104 | py | Python | pipeline_optimisation/train.py | golark/azuremlops | 685c8d11396ecc59df161460aff053d6aa782266 | [
"MIT"
] | null | null | null | pipeline_optimisation/train.py | golark/azuremlops | 685c8d11396ecc59df161460aff053d6aa782266 | [
"MIT"
] | null | null | null | pipeline_optimisation/train.py | golark/azuremlops | 685c8d11396ecc59df161460aff053d6aa782266 | [
"MIT"
] | null | null | null | from azureml.core.run import Run
# TODO: Create TabularDataset using TabularDatasetFactory
# Data is located at:
# "https://automlsamplenotebookdata.blob.core.windows.net/automl-sample-notebook-data/bankmarketing_train.csv"
### YOUR CODE HERE ###
run = Run.get_context()
if __name__ == '__main__':
main() | 36.517647 | 161 | 0.698131 | from sklearn.linear_model import LogisticRegression
import argparse
import os
import numpy as np
from sklearn.metrics import mean_squared_error
import joblib
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import OneHotEncoder
import pandas as pd
from azureml.core.run import Run
from azu... | 0 | 0 | 0 | 0 | 0 | 2,373 | 0 | 122 | 289 |
d3902814224ea9974a27a24377c734a9becded14 | 1,250 | py | Python | promgen/validators.py | kackey0-1/promgen | 8fb7b65c8a814429a0b5f484bfec931df76c5d83 | [
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | 913 | 2016-08-02T03:06:09.000Z | 2022-03-29T17:35:26.000Z | promgen/validators.py | kackey0-1/promgen | 8fb7b65c8a814429a0b5f484bfec931df76c5d83 | [
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | 299 | 2016-08-08T02:48:02.000Z | 2022-03-31T01:01:15.000Z | promgen/validators.py | kackey0-1/promgen | 8fb7b65c8a814429a0b5f484bfec931df76c5d83 | [
"MIT",
"Apache-2.0",
"BSD-3-Clause"
] | 152 | 2016-08-06T08:23:15.000Z | 2022-02-28T09:17:12.000Z | # Copyright (c) 2017 LINE Corporation
# These sources are released under the terms of the MIT license: see LICENSE
from django.core.validators import RegexValidator
# See definition of duration field
# https://prometheus.io/docs/prometheus/latest/configuration/configuration/#configuration-file
duration = RegexValidat... | 32.894737 | 94 | 0.7328 | # Copyright (c) 2017 LINE Corporation
# These sources are released under the terms of the MIT license: see LICENSE
from dateutil import parser
from django.core.exceptions import ValidationError
from django.core.validators import RegexValidator
# See definition of duration field
# https://prometheus.io/docs/prometheu... | 0 | 0 | 0 | 0 | 0 | 110 | 0 | 35 | 69 |
ccb50945495ae8f33f035e2cb496c3336e60de7c | 3,082 | py | Python | app/rest_api/Ideas/settings.py | MarcosAIM/Ideas | fd53fd03bf99fcd96a5f6719f8864f98f93f142e | [
"MIT"
] | null | null | null | app/rest_api/Ideas/settings.py | MarcosAIM/Ideas | fd53fd03bf99fcd96a5f6719f8864f98f93f142e | [
"MIT"
] | null | null | null | app/rest_api/Ideas/settings.py | MarcosAIM/Ideas | fd53fd03bf99fcd96a5f6719f8864f98f93f142e | [
"MIT"
] | null | null | null | import os
from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = "0ug+9=vnaebyh$s*i05w!m5@(0(w!p#13(pj(048+e+j4d*fq1"
# SECURITY WARNING: don't run with... | 25.262295 | 91 | 0.674562 | import os
from pathlib import Path
# Build paths inside the project like this: BASE_DIR / 'subdir'.
BASE_DIR = Path(__file__).resolve().parent.parent
# SECURITY WARNING: keep the secret key used in production secret!
SECRET_KEY = "0ug+9=vnaebyh$s*i05w!m5@(0(w!p#13(pj(048+e+j4d*fq1"
# SECURITY WARNING: don't run with... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
56e8ee79dd9285bd675cedfe17eecf8ad525108a | 2,083 | py | Python | autoio/polyrate_io/_util.py | sjklipp/autoio | e2b471e9c9dec933319c98a30d4d519ca5d47645 | [
"Apache-2.0"
] | null | null | null | autoio/polyrate_io/_util.py | sjklipp/autoio | e2b471e9c9dec933319c98a30d4d519ca5d47645 | [
"Apache-2.0"
] | 1 | 2022-02-15T19:35:14.000Z | 2022-02-15T19:35:14.000Z | autoio/polyrate_io/_util.py | sjklipp/autoio | e2b471e9c9dec933319c98a30d4d519ca5d47645 | [
"Apache-2.0"
] | 13 | 2020-06-24T05:21:11.000Z | 2021-05-05T19:58:30.000Z | """
utility functions
"""
from itertools import chain
import automol
from ioformat import indent
def pt_format(header, hess, vlabel, vval,
slabel=None, sval=None, geo=None, grad=None):
""" write a point string
"""
# Intialize with header
pt_str = '*{}'.format(header)
pt_str += '\n\... | 21.040404 | 68 | 0.592895 | """
utility functions
"""
from itertools import chain
import automol
from ioformat import indent
def pt_format(header, hess, vlabel, vval,
slabel=None, sval=None, geo=None, grad=None):
""" write a point string
"""
# Intialize with header
pt_str = '*{}'.format(header)
pt_str += '\n\... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |