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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7ebda6c3eb3ba2e6b4feae34ffc9e247ff699693 | 1,930 | py | Python | kaggle/machine-learning/underfitting_and_overfitting.py | matteougolotti/ML | 759eff5f5bcaa41e9ff19a2d78869bd4b968324d | [
"MIT"
] | null | null | null | kaggle/machine-learning/underfitting_and_overfitting.py | matteougolotti/ML | 759eff5f5bcaa41e9ff19a2d78869bd4b968324d | [
"MIT"
] | null | null | null | kaggle/machine-learning/underfitting_and_overfitting.py | matteougolotti/ML | 759eff5f5bcaa41e9ff19a2d78869bd4b968324d | [
"MIT"
] | null | null | null | import pandas as pd
from sklearn.metrics import mean_absolute_error
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeRegressor
iowa_file_path = 'rain.csv'
home_data = pd.read_csv(iowa_file_path)
# Create target object and call it y
y = home_data.SalePrice
# Create X
features =... | 33.275862 | 103 | 0.765285 | import pandas as pd
from sklearn.metrics import mean_absolute_error
from sklearn.model_selection import train_test_split
from sklearn.tree import DecisionTreeRegressor
def get_mae(max_leaf_nodes, train_X, val_X, train_y, val_y):
model = DecisionTreeRegressor(max_leaf_nodes=max_leaf_nodes, random_state=0)
model... | 0 | 0 | 0 | 0 | 0 | 253 | 0 | 0 | 23 |
b7c8dadccc4c73a9db593b8f6745709e72ed05ab | 790 | py | Python | fractal.py | nayanshah/python | 250d5dfe7d48a15d53288d7a9f371ff7c66de57c | [
"MIT"
] | null | null | null | fractal.py | nayanshah/python | 250d5dfe7d48a15d53288d7a9f371ff7c66de57c | [
"MIT"
] | null | null | null | fractal.py | nayanshah/python | 250d5dfe7d48a15d53288d7a9f371ff7c66de57c | [
"MIT"
] | 1 | 2020-05-21T15:13:36.000Z | 2020-05-21T15:13:36.000Z |
# Fractals
if __name__ == '__main__':
draw_fractal(5, 90, 10, 'FX', 'X', 'X+YF+', 'Y', '-FX-Y')
| 25.483871 | 98 | 0.517722 | from turtle import *
# Fractals
def draw_fractal(length, angle, level, initial_state, target, replacement, target2, replacement2):
state = initial_state
for counter in range(level):
state2 = ''
for character in state:
if character == target:
state2 += replacemen... | 0 | 0 | 0 | 0 | 0 | 637 | 0 | -1 | 44 |
76b48b0af6e5bf545ed6ea33494e598053b496cb | 1,989 | py | Python | Doc2Vector/data/datamake.py | sladesha/algorithm | 3ade2e7fd4a7b3acb6eb4f99ef81227ba51569e4 | [
"MIT"
] | 520 | 2018-02-07T05:48:49.000Z | 2022-03-07T02:03:06.000Z | Doc2Vector/data/datamake.py | WADRHAW/deep_learning | 3ade2e7fd4a7b3acb6eb4f99ef81227ba51569e4 | [
"MIT"
] | 15 | 2019-02-20T15:11:11.000Z | 2022-02-10T00:39:57.000Z | Doc2Vector/data/datamake.py | WADRHAW/deep_learning | 3ade2e7fd4a7b3acb6eb4f99ef81227ba51569e4 | [
"MIT"
] | 251 | 2017-12-28T09:46:13.000Z | 2022-03-20T13:39:09.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2020/1/10 3:23 PM
# @Author : Slade
# @File : datamake.py
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
flags = tf.app.flags
flags.DEFINE_string("input_dir", "./data/"... | 32.080645 | 114 | 0.604827 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 2020/1/10 3:23 PM
# @Author : Slade
# @File : datamake.py
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import tensorflow as tf
import numpy as np
flags = tf.app.flags
flags.DEFINE... | 48 | 0 | 0 | 0 | 0 | 1,347 | 0 | -15 | 90 |
c777c78c953cfbfd3c1f69bdc31089c5cd84467c | 3,743 | py | Python | tests/fixtures.py | WilmerLab/mofun | ec95f2c4455a37ff73d0f595b56f4a246924c2dd | [
"MIT"
] | null | null | null | tests/fixtures.py | WilmerLab/mofun | ec95f2c4455a37ff73d0f595b56f4a246924c2dd | [
"MIT"
] | null | null | null | tests/fixtures.py | WilmerLab/mofun | ec95f2c4455a37ff73d0f595b56f4a246924c2dd | [
"MIT"
] | null | null | null |
from math import sqrt
sqrt2_2 = sqrt(2) / 2
sqrt3_2 = sqrt(3) / 2
| 34.027273 | 118 | 0.674058 |
from math import sqrt
from pathlib import Path
import ase.io
import numpy as np
from numpy.linalg import norm
from numpy.testing import assert_equal as np_assert_equal
import pytest
from pytest import approx
import tests
from mofun import Atoms
from mofun.helpers import typekey
sqrt2_2 = sqrt(2) / 2
sqrt3_2 = sqrt(... | 0 | 1,951 | 0 | 0 | 0 | 1,165 | 0 | 37 | 521 |
9588a3d4cd7e7a5db5bcec909837d679078f7fb9 | 2,535 | py | Python | src/scs_core/position/nmea/nmea_report.py | seoss/scs_core | 0d4323c5697a39eb44a887f179ba5dca3716c1d2 | [
"MIT"
] | 3 | 2019-03-12T01:59:58.000Z | 2020-09-12T07:27:42.000Z | src/scs_core/position/nmea/nmea_report.py | seoss/scs_core | 0d4323c5697a39eb44a887f179ba5dca3716c1d2 | [
"MIT"
] | 1 | 2018-04-20T07:58:38.000Z | 2021-03-27T08:52:45.000Z | src/scs_core/position/nmea/nmea_report.py | seoss/scs_core | 0d4323c5697a39eb44a887f179ba5dca3716c1d2 | [
"MIT"
] | 4 | 2017-09-29T13:08:43.000Z | 2019-10-09T09:13:58.000Z | """
Created on 31 Dec 2016
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
A helper class for validating and preparing GPS module output strings.
https://www.nmea.org
https://en.wikipedia.org/wiki/NMEA_0183
"""
# -------------------------------------------------------------------------------------------... | 26.40625 | 118 | 0.390138 | """
Created on 31 Dec 2016
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
A helper class for validating and preparing GPS module output strings.
https://www.nmea.org
https://en.wikipedia.org/wiki/NMEA_0183
"""
# -------------------------------------------------------------------------------------------... | 0 | 568 | 0 | 1,598 | 0 | 0 | 0 | 0 | 23 |
8376ebe3fb4d0496496aef10e2331b23800d0f80 | 2,280 | py | Python | dojo/db_migrations/0063_jira_refactor.py | mtcolman/django-DefectDojo | 76175aca446e077884bdb5e1d8e2a671a0840775 | [
"BSD-3-Clause"
] | 1,772 | 2018-01-22T23:32:15.000Z | 2022-03-31T14:49:33.000Z | dojo/db_migrations/0063_jira_refactor.py | mtcolman/django-DefectDojo | 76175aca446e077884bdb5e1d8e2a671a0840775 | [
"BSD-3-Clause"
] | 3,461 | 2018-01-20T19:12:28.000Z | 2022-03-31T17:14:39.000Z | dojo/db_migrations/0063_jira_refactor.py | mtcolman/django-DefectDojo | 76175aca446e077884bdb5e1d8e2a671a0840775 | [
"BSD-3-Clause"
] | 1,173 | 2018-01-23T07:10:23.000Z | 2022-03-31T14:40:43.000Z | # Generated by Django 2.2.16 on 2020-11-07 11:31
| 35.076923 | 159 | 0.60307 | # Generated by Django 2.2.16 on 2020-11-07 11:31
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('dojo', '0062_add_vuln_id_from_tool'),
]
operations = [
migrations.DeleteModel(
name='JIRA_Clon... | 0 | 0 | 0 | 2,132 | 0 | 0 | 0 | 30 | 68 |
f2e3923b50c3ce6f9c16b2637347a6d6f8f1281d | 584 | py | Python | chaoshi/chaoshi/items.py | basicworld/scrapy.com.jd | 414a1827909c514dddedb552b8732d5b07a5d441 | [
"MIT"
] | null | null | null | chaoshi/chaoshi/items.py | basicworld/scrapy.com.jd | 414a1827909c514dddedb552b8732d5b07a5d441 | [
"MIT"
] | null | null | null | chaoshi/chaoshi/items.py | basicworld/scrapy.com.jd | 414a1827909c514dddedb552b8732d5b07a5d441 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
| 24.333333 | 51 | 0.690068 | # -*- coding: utf-8 -*-
# Define here the models for your scraped items
#
# See documentation in:
# http://doc.scrapy.org/en/latest/topics/items.html
import scrapy
class ChaoshiCategoryItem(scrapy.Item):
# define the fields for your item here like:
cateUrl = scrapy.Field() # 分类的url
cateName = scrapy.Fi... | 39 | 0 | 0 | 357 | 0 | 0 | 0 | -8 | 69 |
be1e37cc8ea7da820395a7b6bd5ced6c48fb173b | 1,366 | py | Python | migrations/versions/8fde055f9d29_add_driver_switch_activity_status.py | MTES-MCT/mobilic-api | b3754de2282262fd60a27dc90e40777df9c1e230 | [
"MIT"
] | null | null | null | migrations/versions/8fde055f9d29_add_driver_switch_activity_status.py | MTES-MCT/mobilic-api | b3754de2282262fd60a27dc90e40777df9c1e230 | [
"MIT"
] | 8 | 2021-04-19T17:47:55.000Z | 2022-02-16T17:40:18.000Z | migrations/versions/8fde055f9d29_add_driver_switch_activity_status.py | MTES-MCT/mobilic-api | b3754de2282262fd60a27dc90e40777df9c1e230 | [
"MIT"
] | null | null | null | """Add driver switch activity status
Revision ID: 8fde055f9d29
Revises: 8fe63e4276dc
Create Date: 2020-02-15 16:46:48.890628
"""
# revision identifiers, used by Alembic.
revision = "8fde055f9d29"
down_revision = "8fe63e4276dc"
branch_labels = None
depends_on = None
| 23.551724 | 62 | 0.590044 | """Add driver switch activity status
Revision ID: 8fde055f9d29
Revises: 8fe63e4276dc
Create Date: 2020-02-15 16:46:48.890628
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "8fde055f9d29"
down_revision = "8fe63e4276dc"
branch_labels = None
depends_on = None
d... | 0 | 0 | 0 | 0 | 0 | 1,001 | 0 | 3 | 90 |
a5ae2c8bc00df24165fd508fc5d03ce301c458c9 | 11,501 | py | Python | uweclang/corpus/manager.py | SkySchermer/uweclang | c4404b550c8c1e6d22eff0a5ddeb8127080b2ad3 | [
"MIT"
] | null | null | null | uweclang/corpus/manager.py | SkySchermer/uweclang | c4404b550c8c1e6d22eff0a5ddeb8127080b2ad3 | [
"MIT"
] | null | null | null | uweclang/corpus/manager.py | SkySchermer/uweclang | c4404b550c8c1e6d22eff0a5ddeb8127080b2ad3 | [
"MIT"
] | null | null | null | """UWEC Language Tools manager module
Provides functions for defining and managing a corpus.
"""
# Python 3 forward compatability imports.
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from __future__ import unicode_literals
import os
import hashlib
im... | 33.144092 | 85 | 0.589949 | """UWEC Language Tools manager module
Provides functions for defining and managing a corpus.
"""
# Python 3 forward compatability imports.
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from __future__ import unicode_literals
import sys
import os
impor... | 0 | 258 | 0 | 8,957 | 0 | 0 | 0 | 4 | 112 |
75dfa67ec64313cca39da2e97c93a3e2e3458650 | 4,731 | py | Python | galaxy/python/GalaxySpectrumVVDS.py | AndresSixtos/pyeBOSS | 4750908c8bc409633bef8f790133e3a1f3f0c9e4 | [
"CC0-1.0"
] | 1 | 2017-05-23T13:03:27.000Z | 2017-05-23T13:03:27.000Z | galaxy/python/GalaxySpectrumVVDS.py | AndresSixtos/pyeBOSS | 4750908c8bc409633bef8f790133e3a1f3f0c9e4 | [
"CC0-1.0"
] | null | null | null | galaxy/python/GalaxySpectrumVVDS.py | AndresSixtos/pyeBOSS | 4750908c8bc409633bef8f790133e3a1f3f0c9e4 | [
"CC0-1.0"
] | 2 | 2017-09-26T11:17:30.000Z | 2021-09-14T06:09:18.000Z | """
.. class:: GalaxySpectrumVVDS
.. moduleauthor:: Johan Comparat <johan.comparat__at__gmail.com>
The class GalaxySpectrumVVDS is dedicated to handling VVDS spectra
"""
import astropy.io.fits as fits
import matplotlib
matplotlib.use('pdf')
lfl = LineFittingLibrary()
| 39.756303 | 166 | 0.695413 | """
.. class:: GalaxySpectrumVVDS
.. moduleauthor:: Johan Comparat <johan.comparat__at__gmail.com>
The class GalaxySpectrumVVDS is dedicated to handling VVDS spectra
"""
from os.path import join
import os
import numpy as n
import astropy.io.fits as fits
import glob
import matplotlib
matplotlib.use('pdf')
import matp... | 0 | 0 | 0 | 4,256 | 0 | 0 | 0 | 3 | 199 |
4d85537526d1f1be42b55ee7c3665cfaba14c3d0 | 460 | py | Python | setup.py | EBjerrum/RAscore | d7430abeeb4246bcd9d2314e5ca9e00963dfb7ba | [
"MIT"
] | null | null | null | setup.py | EBjerrum/RAscore | d7430abeeb4246bcd9d2314e5ca9e00963dfb7ba | [
"MIT"
] | null | null | null | setup.py | EBjerrum/RAscore | d7430abeeb4246bcd9d2314e5ca9e00963dfb7ba | [
"MIT"
] | null | null | null | import setuptools
setuptools.setup(
name="RAscore", # Replace with your own username
version="2020.9",
author="Reymond Group/Molecular AI AstraZeneca",
author_email="amol.thakkar@dcb.unibe.ch",
license="MIT",
description="Computation of retrosynthetic accessibility from machine learening of CAS... | 32.857143 | 105 | 0.728261 | import setuptools
setuptools.setup(
name="RAscore", # Replace with your own username
version="2020.9",
author="Reymond Group/Molecular AI AstraZeneca",
author_email="amol.thakkar@dcb.unibe.ch",
license="MIT",
description="Computation of retrosynthetic accessibility from machine learening of CAS... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8ad32c038b411b3dc200c3cd070929e827a76ab5 | 3,559 | py | Python | tests/epyccel/test_epyccel_complex_func.py | dina-fouad/pyccel | f4d919e673b400442b9c7b81212b6fbef749c7b7 | [
"MIT"
] | 206 | 2018-06-28T00:28:47.000Z | 2022-03-29T05:17:03.000Z | tests/epyccel/test_epyccel_complex_func.py | dina-fouad/pyccel | f4d919e673b400442b9c7b81212b6fbef749c7b7 | [
"MIT"
] | 670 | 2018-07-23T11:02:24.000Z | 2022-03-30T07:28:05.000Z | tests/epyccel/test_epyccel_complex_func.py | dina-fouad/pyccel | f4d919e673b400442b9c7b81212b6fbef749c7b7 | [
"MIT"
] | 19 | 2019-09-19T06:01:00.000Z | 2022-03-29T05:17:06.000Z | # pylint: disable=missing-function-docstring, missing-module-docstring/
| 31.776786 | 71 | 0.676595 | # pylint: disable=missing-function-docstring, missing-module-docstring/
import numpy as np
import pytest
from numpy.random import rand, randint
import modules.complex_func as mod
from pyccel.epyccel import epyccel
@pytest.mark.parametrize("f", [ mod.create_complex_literal__int_int,
mod.cre... | 0 | 768 | 0 | 0 | 0 | 2,276 | 0 | 32 | 411 |
edbc7186a89a966ff7d588e9b0e0a99d5c18903d | 1,180 | py | Python | setup.py | glanyx/segachan | b7694cc44e7ac0a261d8f3412347c50b8026fd6f | [
"MIT"
] | null | null | null | setup.py | glanyx/segachan | b7694cc44e7ac0a261d8f3412347c50b8026fd6f | [
"MIT"
] | null | null | null | setup.py | glanyx/segachan | b7694cc44e7ac0a261d8f3412347c50b8026fd6f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup
from sweeperbot._version import __version__
with open("README.rst") as readme_file:
readme = readme_file.read()
with open("HISTORY.rst") as history_file:
history = history_file.read()
setup(
name="sweeperbot",
version=__versi... | 27.44186 | 76 | 0.622881 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from sweeperbot._version import __version__
with open("README.rst") as readme_file:
readme = readme_file.read()
with open("HISTORY.rst") as history_file:
history = history_file.read()
setup(
name="sweeperbot",
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 15 | 0 |
7f9cb787068686be642ce592396f41b89b8d5767 | 545 | py | Python | app/test/test1.py | saint816/fishbook | 80a4b563a05086c85eb347286d28bb0e6258ff1c | [
"MIT"
] | null | null | null | app/test/test1.py | saint816/fishbook | 80a4b563a05086c85eb347286d28bb0e6258ff1c | [
"MIT"
] | null | null | null | app/test/test1.py | saint816/fishbook | 80a4b563a05086c85eb347286d28bb0e6258ff1c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name test1
Description :
Author : pengsheng
date 2019-04-20
-------------------------------------------------
"""
import threading
new_thread = threading.Thread(target=worker, name='new_thread')
new_thr... | 21.8 | 63 | 0.53578 | # -*- coding: utf-8 -*-
"""
-------------------------------------------------
File Name: test1
Description : 多线程实现
Author : pengsheng
date: 2019-04-20
-------------------------------------------------
"""
import threading
def worker():
print('i am thread')
t = threading.current... | 156 | 0 | 0 | 0 | 0 | 75 | 0 | 0 | 23 |
535a5f8a51e655f145cc0b06696fd8a683da4409 | 221 | py | Python | __init__.py | klonuo/SublimeJEDI | ee58759cbbfbd052bd0a972b85b1666e0e1cb6e9 | [
"MIT"
] | 1 | 2016-09-20T20:50:53.000Z | 2016-09-20T20:50:53.000Z | __init__.py | klonuo/SublimeJEDI | ee58759cbbfbd052bd0a972b85b1666e0e1cb6e9 | [
"MIT"
] | null | null | null | __init__.py | klonuo/SublimeJEDI | ee58759cbbfbd052bd0a972b85b1666e0e1cb6e9 | [
"MIT"
] | null | null | null | # fix absolute imports on ST3
# TODO: remove
#import sys
#import os
#sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
try:
except ImportError:
| 20.090909 | 63 | 0.733032 | # fix absolute imports on ST3
# TODO: remove
#import sys
#import os
#sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
try:
from sublime_jedi import *
except ImportError:
from .sublime_jedi import *
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 11 | 52 |
667544762c302b9391cb48414210868246d7d11a | 9,969 | py | Python | oras/content/file.py | vsoch/oras-python | 45374c6187b98f171f85dffd75a31877b6ec12ce | [
"MIT"
] | 1 | 2021-12-06T08:54:51.000Z | 2021-12-06T08:54:51.000Z | oras/content/file.py | vsoch/oras-python | 45374c6187b98f171f85dffd75a31877b6ec12ce | [
"MIT"
] | 1 | 2021-11-28T18:59:21.000Z | 2021-11-28T18:59:21.000Z | oras/content/file.py | vsoch/oras-python | 45374c6187b98f171f85dffd75a31877b6ec12ce | [
"MIT"
] | null | null | null | __author__ = "Vanessa Sochat"
__copyright__ = "Copyright 2021, Vanessa Sochat"
__license__ = "MPL 2.0"
import os
import time
import tarfile
import tempfile
import time
from oras.logger import logger
import oras.utils as utils
import oras.defaults as defaults
from .const import TempFilePattern, AnnotationUnpack, Anno... | 28.812139 | 117 | 0.611395 | __author__ = "Vanessa Sochat"
__copyright__ = "Copyright 2021, Vanessa Sochat"
__license__ = "MPL 2.0"
import os
import time
import tarfile
import tempfile
import time
from oras.logger import logger
import oras.utils as utils
import oras.defaults as defaults
from .const import TempFilePattern, AnnotationUnpack, Anno... | 0 | 0 | 0 | 785 | 0 | 65 | 0 | 0 | 68 |
0f501a353e1da1c5ed4afdd4c955cf72bd3a1124 | 5,069 | py | Python | cail/utils.py | Stanford-ILIAD/Confidence-Aware-Imitation-Learning | 1d8af0e4ab87a025885133a2384d5a937329b2f5 | [
"MIT"
] | 16 | 2021-10-30T15:19:37.000Z | 2022-03-23T12:57:49.000Z | cail/utils.py | syzhang092218-source/Confidence-Aware-Imitation-Learning | 1d8af0e4ab87a025885133a2384d5a937329b2f5 | [
"MIT"
] | null | null | null | cail/utils.py | syzhang092218-source/Confidence-Aware-Imitation-Learning | 1d8af0e4ab87a025885133a2384d5a937329b2f5 | [
"MIT"
] | 2 | 2021-11-29T11:28:16.000Z | 2022-03-06T14:12:47.000Z | import numpy as np
import torch
import torch.nn as nn
import time
from tqdm import tqdm
from .buffer import Buffer
from .algo.base import Expert
from .env import NormalizedEnv
def soft_update(target, source, tau):
"""Soft update for SAC"""
for t, s in zip(target.parameters(), source.parameters()... | 25.994872 | 85 | 0.583547 | import numpy as np
import torch
import torch.nn as nn
import time
from tqdm import tqdm
from .buffer import Buffer
from .algo.base import Expert
from .env import NormalizedEnv
def soft_update(target, source, tau):
"""Soft update for SAC"""
for t, s in zip(target.parameters(), source.parameters()... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
83cf34bf170321319bfa3699b032ea060d189625 | 4,204 | py | Python | tf_quant_finance/experimental/pricing_platform/framework/rate_instruments/forward_rate_agreement/forward_rate_agreement_test.py | DevarakondaV/tf-quant-finance | 4502b843ca138c2ae8ad77978a2cf52fa38dbbe5 | [
"Apache-2.0"
] | 1 | 2021-04-22T15:48:38.000Z | 2021-04-22T15:48:38.000Z | tf_quant_finance/experimental/pricing_platform/framework/rate_instruments/forward_rate_agreement/forward_rate_agreement_test.py | dsdinter/tf-quant-finance | b2b27e682cc091d251a53515fef96b14812acb1c | [
"Apache-2.0"
] | null | null | null | tf_quant_finance/experimental/pricing_platform/framework/rate_instruments/forward_rate_agreement/forward_rate_agreement_test.py | dsdinter/tf-quant-finance | b2b27e682cc091d251a53515fef96b14812acb1c | [
"Apache-2.0"
] | 1 | 2021-01-30T09:32:16.000Z | 2021-01-30T09:32:16.000Z | # Lint as: python3
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 41.623762 | 95 | 0.74215 | # Lint as: python3
# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agr... | 0 | 2,399 | 0 | 0 | 0 | 0 | 0 | 25 | 114 |
24437d77fe7c0ec9561b24914a72b35bfd70e5ea | 7,035 | py | Python | .template_simulation/collect_charges.py | lukaselflein/sarah_folderstructure | a725271db3d8b5b28b24918b3daf0942fa04dcd8 | [
"MIT"
] | null | null | null | .template_simulation/collect_charges.py | lukaselflein/sarah_folderstructure | a725271db3d8b5b28b24918b3daf0942fa04dcd8 | [
"MIT"
] | 28 | 2019-03-29T13:34:57.000Z | 2019-07-04T09:27:07.000Z | .template_simulation/collect_charges.py | lukaselflein/sarah_folderstructure | a725271db3d8b5b28b24918b3daf0942fa04dcd8 | [
"MIT"
] | null | null | null | """ Extract charges obtained via HORTON and Bader.
Copyright 2019 Simulation Lab
University of Freiburg
Author: Lukas Elflein <elfleinl@cs.uni-freiburg.de>
"""
import os
import pandas as pd
def create_dir(path='./plotting'):
"""Create new folder for pictures if it does not exist yet."""
if os.path.isdir(path):... | 39.971591 | 102 | 0.585785 | """ Extract charges obtained via HORTON and Bader.
Copyright 2019 Simulation Lab
University of Freiburg
Author: Lukas Elflein <elfleinl@cs.uni-freiburg.de>
"""
import os
import pandas as pd
def create_dir(path='./plotting'):
"""Create new folder for pictures if it does not exist yet."""
if os.path.isdir(path):... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
453864fe3cdf4c08c938afaf223db5f6a52e6a03 | 8,391 | py | Python | main.py | foorschtbar/speedtest_ookla-to-influxdb | 901b69fe57f314150a8383e2db2814f3dc7a5674 | [
"MIT"
] | null | null | null | main.py | foorschtbar/speedtest_ookla-to-influxdb | 901b69fe57f314150a8383e2db2814f3dc7a5674 | [
"MIT"
] | null | null | null | main.py | foorschtbar/speedtest_ookla-to-influxdb | 901b69fe57f314150a8383e2db2814f3dc7a5674 | [
"MIT"
] | null | null | null | import os
from influxdb_client import InfluxDBClient
from influxdb_client.client.write_api import SYNCHRONOUS
# InfluxDB Settings
NAMESPACE = os.getenv('NAMESPACE', 'None')
DB_URL = os.getenv('INFLUX_DB_URL', 'http://localhost')
DB_TOKEN = os.getenv('INFLUX_DB_TOKEN', 'my-token')
DB_ORG = os.getenv('INFLUX_DB_... | 36.324675 | 474 | 0.546538 | import os
import time
import json
import datetime
import subprocess
from pythonping import ping
from influxdb_client import InfluxDBClient
from influxdb_client.client.write_api import SYNCHRONOUS
from multiprocessing import Process
# InfluxDB Settings
NAMESPACE = os.getenv('NAMESPACE', 'None')
DB_URL = os.... | 0 | 0 | 0 | 0 | 0 | 6,815 | 0 | -10 | 313 |
0fd7d1fa2baad176d6e5962f6138008014fa633a | 2,444 | py | Python | Cnc-Calculators-V.2/Moduler/ra.py | UniQueKakarot/Redesigned_Cnc-Calculators | 0ec83234444ecb5765b14bf77782f99e432b5473 | [
"MIT"
] | null | null | null | Cnc-Calculators-V.2/Moduler/ra.py | UniQueKakarot/Redesigned_Cnc-Calculators | 0ec83234444ecb5765b14bf77782f99e432b5473 | [
"MIT"
] | 1 | 2021-06-02T00:32:00.000Z | 2021-06-02T00:32:00.000Z | Cnc-Calculators-V.2/Moduler/ra.py | UniQueKakarot/Redesigned_Cnc-Calculators | 0ec83234444ecb5765b14bf77782f99e432b5473 | [
"MIT"
] | null | null | null | """ This module contains the RA calculator """
from kivy.lang import Builder
Builder.load_string(
"""
<BoxLayout>:
orientation: 'horizontal'
<MyTextInput>:
<Ra>:
feed: feed
nr: nr
cols: 1
padding: 10
spacing: 10
BoxLayout:
size_hint_y: None
height: "40dp"
L... | 21.068966 | 63 | 0.51473 | """ This module contains the RA calculator """
from kivy.uix.gridlayout import GridLayout
from kivy.lang import Builder
from kivy.properties import StringProperty
from Moduler.customwidgets import MyLabel
from Moduler.customwidgets import MyTextInput
from Moduler.datasaving import SurfaceRaData
Builder.load_string(
... | 0 | 0 | 0 | 915 | 0 | 0 | 0 | 109 | 135 |
babbc8cc7067faba7f4cecd9fb2dba005c06f6f1 | 209 | py | Python | nhdpy/__init__.py | jsta/nhdpy | 38f52a68907e4d838715c77b18e61450eb775c72 | [
"MIT"
] | null | null | null | nhdpy/__init__.py | jsta/nhdpy | 38f52a68907e4d838715c77b18e61450eb775c72 | [
"MIT"
] | 8 | 2020-11-12T16:42:23.000Z | 2021-03-04T19:00:09.000Z | nhdpy/__init__.py | jsta/nhdpy | 38f52a68907e4d838715c77b18e61450eb775c72 | [
"MIT"
] | null | null | null | """Top-level package for nhdpy."""
__author__ = """Jemma Stachelek"""
__email__ = 'stachel2@msu.edu'
__version__ = '0.1.0'
| 19 | 34 | 0.727273 | """Top-level package for nhdpy."""
__author__ = """Jemma Stachelek"""
__email__ = 'stachel2@msu.edu'
__version__ = '0.1.0'
from .nhdpy import nhd_get
from .nhdpy import nhd_list
from .nhdpy import nhd_load
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 17 | 67 |
df287b191ac5a2dd737815fd551244686d241923 | 25,180 | py | Python | mmdet/core/loss/losses.py | ShegnkaiWu/IoU-aware-single-stage-object-detector-for-accurate-localization | 67b8955eb59137590dbadc6aac45529ae9459e4a | [
"Apache-2.0"
] | 62 | 2020-04-15T09:01:23.000Z | 2022-02-24T04:27:52.000Z | mmdet/core/loss/losses.py | ShegnkaiWu/IoU-aware-single-stage-object-detector-for-accurate-localization | 67b8955eb59137590dbadc6aac45529ae9459e4a | [
"Apache-2.0"
] | 10 | 2020-04-15T09:05:19.000Z | 2022-01-04T08:05:59.000Z | mmdet/core/loss/losses.py | ShegnkaiWu/IoU-aware-single-stage-object-detector-for-accurate-localization | 67b8955eb59137590dbadc6aac45529ae9459e4a | [
"Apache-2.0"
] | 10 | 2020-04-28T06:58:09.000Z | 2021-11-18T00:57:34.000Z | # TODO merge naive and weighted loss.
import torch
import torch.nn.functional as F
# added by Shengkai Wu
# implement iou_balanced cross entropy loss.
def iou_balanced_cross_entropy(pred, label, weight, iou, eta = 1.5, avg_factor=None, reduce=True):
"""
iou_balanced cross entropy loss to make the training p... | 38.918083 | 127 | 0.61668 | # TODO merge naive and weighted loss.
import numpy as np
import torch
import torch.nn.functional as F
from ..bbox import bbox_overlaps
from ...ops import sigmoid_focal_loss
from ..bbox.transforms import delta2bbox
def weighted_nll_loss(pred, label, weight, avg_factor=None):
if avg_factor is None:
avg_fa... | 0 | 0 | 0 | 0 | 0 | 6,879 | 0 | 43 | 385 |
9afbe23daffa1d6b64b319da9bb5fb508db62891 | 673 | py | Python | 2021/day6.py | astonshane/AdventOfCode | 25c7380e73eede3f79287de6a9dedc8314ab7965 | [
"MIT"
] | null | null | null | 2021/day6.py | astonshane/AdventOfCode | 25c7380e73eede3f79287de6a9dedc8314ab7965 | [
"MIT"
] | null | null | null | 2021/day6.py | astonshane/AdventOfCode | 25c7380e73eede3f79287de6a9dedc8314ab7965 | [
"MIT"
] | null | null | null |
print("part1:", iterate(80))
print("part2:", iterate(256))
| 29.26087 | 66 | 0.456166 | def iterate(days):
with open("inputs/day6.txt") as f:
input = [int(x) for x in f.readline().strip().split(",")]
fish = {}
for f in input:
fish[f] = fish.get(f, 0) + 1
for day in range(1, days+1):
new_fish = {}
for x in fish:
if x =... | 0 | 0 | 0 | 0 | 0 | 591 | 0 | 0 | 22 |
cfe8552d61b7b191dc8c08bf956d94364e70490c | 7,322 | py | Python | vivarium/core/repository.py | U8NWXD/vivarium | 19c6a4096fe94e3342e40ce03e6708c24dd38fa3 | [
"MIT"
] | null | null | null | vivarium/core/repository.py | U8NWXD/vivarium | 19c6a4096fe94e3342e40ce03e6708c24dd38fa3 | [
"MIT"
] | null | null | null | vivarium/core/repository.py | U8NWXD/vivarium | 19c6a4096fe94e3342e40ce03e6708c24dd38fa3 | [
"MIT"
] | null | null | null | """
==============================================
Repository of Updaters, Dividers, and Derivers
==============================================
You should interpret words and phrases that appear fully capitalized in
this document as described in :rfc:`2119`. Here is a brief summary of
the RFC:
* "MUST" indicates abs... | 29.643725 | 88 | 0.680688 | """
==============================================
Repository of Updaters, Dividers, and Derivers
==============================================
You should interpret words and phrases that appear fully capitalized in
this document as described in :rfc:`2119`. Here is a brief summary of
the RFC:
* "MUST" indicates abs... | 0 | 0 | 0 | 246 | 0 | 38 | 0 | -13 | 114 |
c489189444952f919e3577efb4fb2967757abb02 | 591 | py | Python | utils.py | doiken23/mccformers.pytorch | 678bd9448e3a2f35bd408e8c8e510e0ea1f9a19f | [
"MIT"
] | 1 | 2021-11-26T12:08:41.000Z | 2021-11-26T12:08:41.000Z | utils.py | doiken23/mccformers.pytorch | 678bd9448e3a2f35bd408e8c8e510e0ea1f9a19f | [
"MIT"
] | null | null | null | utils.py | doiken23/mccformers.pytorch | 678bd9448e3a2f35bd408e8c8e510e0ea1f9a19f | [
"MIT"
] | null | null | null | import torch
from torch import Tensor
def compute_accuracy(pred: Tensor, gt: Tensor, ignore: int = 0):
"""
pred (torch.Tensor): predicted words shape of [L, N]
gt (torch.Tensor): GT words shape of [L, N]
ignore (int): ignored label
"""
mask = gt != ignore
tp = torch.logical_and(pred == gt,... | 22.730769 | 64 | 0.563452 | import torch
from torch import Tensor
def compute_accuracy(pred: Tensor, gt: Tensor, ignore: int = 0):
"""
pred (torch.Tensor): predicted words shape of [L, N]
gt (torch.Tensor): GT words shape of [L, N]
ignore (int): ignored label
"""
mask = gt != ignore
tp = torch.logical_and(pred == gt,... | 0 | 0 | 0 | 0 | 0 | 206 | 0 | 0 | 23 |
5749762850ea7ecd0b18114c1bb163d34428e1e5 | 6,295 | py | Python | python-ref/python-make/cxx_sources_deps_rules.py | bogen/makeshells | a61ca2f9d35417d081a5c07c6c973d6039d39c38 | [
"MIT"
] | 1 | 2019-10-16T12:15:53.000Z | 2019-10-16T12:15:53.000Z | python-ref/python-make/cxx_sources_deps_rules.py | bogen/makeshells | a61ca2f9d35417d081a5c07c6c973d6039d39c38 | [
"MIT"
] | null | null | null | python-ref/python-make/cxx_sources_deps_rules.py | bogen/makeshells | a61ca2f9d35417d081a5c07c6c973d6039d39c38 | [
"MIT"
] | null | null | null | # this is a make/python hybrid file
# Normal make files are a make/sh hybrid.
# This makefile uses python instead of sh (or bash)
test_cxx_sources ?=
checkcxxsources $(cxxsources):$(out_init)
$(origin)
if (this == "checkcxxsources") and (not os.path.exists(env.cxxsources)):
leave()
caption()
if (this ==... | 34.211957 | 82 | 0.58189 | # this is a make/python hybrid file
# Normal make files are a make/sh hybrid.
# This makefile uses python instead of sh (or bash)
test_cxx_sources ?=
checkcxxsources $(cxxsources):$(out_init)
$(origin)
if (this == "checkcxxsources") and (not os.path.exists(env.cxxsources)):
leave()
caption()
if (this ==... | 0 | 0 | 0 | 0 | 0 | 609 | 0 | 0 | 74 |
6d18fbcf0c4128657606560451cbb6b3b8077b66 | 20,036 | py | Python | binance/delivery/market.py | AlfonsoAgAr/binance-futures-connector-python | f0bd2c7b0576503bf526ce6be329ca2dae90fefe | [
"MIT"
] | 1 | 2022-01-29T14:37:47.000Z | 2022-01-29T14:37:47.000Z | binance/delivery/market.py | sanjeevan121/binance-futures-connector-python | d820b73a15e9f64c80891a13694ca0c5d1693b90 | [
"MIT"
] | null | null | null | binance/delivery/market.py | sanjeevan121/binance-futures-connector-python | d820b73a15e9f64c80891a13694ca0c5d1693b90 | [
"MIT"
] | 1 | 2022-02-25T16:23:41.000Z | 2022-02-25T16:23:41.000Z | from binance.lib.utils import (check_required_parameter)
from binance.lib.utils import check_required_parameters
def ping(self):
"""
|
| **Test Connectivity**
| *Test connectivity to the Rest API.*
:API endpoint: ``GET /dapi/v1/ping``
:API doc: https://binance-docs.github.io/apidocs/delivery/... | 38.679537 | 204 | 0.674636 | from binance.lib.utils import (
check_required_parameter,
)
from binance.lib.utils import check_required_parameters
def ping(self):
"""
|
| **Test Connectivity**
| *Test connectivity to the Rest API.*
:API endpoint: ``GET /dapi/v1/ping``
:API doc: https://binance-docs.github.io/apidocs/de... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 7 | 0 |
d7905df33f83738c4064bc686d449bb022aa90b4 | 1,281 | py | Python | census/code.py | Balaji-Pa/greyatom-python-for-data-science | 801905c377cbd0a573a9d5d8cc0b66972bffc4af | [
"MIT"
] | null | null | null | census/code.py | Balaji-Pa/greyatom-python-for-data-science | 801905c377cbd0a573a9d5d8cc0b66972bffc4af | [
"MIT"
] | null | null | null | census/code.py | Balaji-Pa/greyatom-python-for-data-science | 801905c377cbd0a573a9d5d8cc0b66972bffc4af | [
"MIT"
] | null | null | null | # --------------
# Importing header files
import numpy as np
import warnings
warnings.filterwarnings('ignore')
#New record
new_record=[[50, 9, 4, 1, 0, 0, 40, 0]]
#Reading file
# data = np.genfromtxt(path, delimiter=",", skip_header=1)
#Code starts here
data = np.genfromtxt(path, delimiter = ",",... | 22.875 | 61 | 0.664325 | # --------------
# Importing header files
import numpy as np
import warnings
warnings.filterwarnings('ignore')
#New record
new_record=[[50, 9, 4, 1, 0, 0, 40, 0]]
#Reading file
# data = np.genfromtxt(path, delimiter=",", skip_header=1)
#Code starts here
data = np.genfromtxt(path, delimiter = ",",... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4165bf5b7d8a9d455b4c62503f72f9ecebf7e6ba | 509 | py | Python | CHAPTER 06 (stacks_queues_deques)/reverse_file_using_stack.py | ahammadshawki8/Data-Structures-Algorithms-in-Python- | fc18b54128cd5bc7639a14999d8f990190b524eb | [
"MIT"
] | null | null | null | CHAPTER 06 (stacks_queues_deques)/reverse_file_using_stack.py | ahammadshawki8/Data-Structures-Algorithms-in-Python- | fc18b54128cd5bc7639a14999d8f990190b524eb | [
"MIT"
] | null | null | null | CHAPTER 06 (stacks_queues_deques)/reverse_file_using_stack.py | ahammadshawki8/Data-Structures-Algorithms-in-Python- | fc18b54128cd5bc7639a14999d8f990190b524eb | [
"MIT"
] | null | null | null | def reverse_file(path):
"""Overwrite given file using its context line-by-line reversed"""
s=ArrayStack()
with open(path,"r") as original:
for line in original:
s.push(line.rstrip("\n")) # removing newline characters
# overwrite the contents in LIFO order
with open(path,"w") as ... | 29.941176 | 70 | 0.642436 | from stack_class import *
def reverse_file(path):
"""Overwrite given file using its context line-by-line reversed"""
s=ArrayStack()
with open(path,"r") as original:
for line in original:
s.push(line.rstrip("\n")) # removing newline characters
# overwrite the contents in LIFO order
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 22 |
6500eec5e3f781f090b684bdb20725e228725ab7 | 816 | py | Python | simulaqron/tests/performance/ring_teleport/configure_ring.py | Doomsk/SimulaQron | 09bd81730e31c7642a0fece8ae7d518820fe57eb | [
"BSD-3-Clause"
] | 69 | 2018-10-14T10:32:34.000Z | 2022-03-08T10:28:15.000Z | simulaqron/tests/performance/ring_teleport/configure_ring.py | Doomsk/SimulaQron | 09bd81730e31c7642a0fece8ae7d518820fe57eb | [
"BSD-3-Clause"
] | 121 | 2018-10-03T13:57:44.000Z | 2021-12-17T17:36:39.000Z | simulaqron/tests/performance/ring_teleport/configure_ring.py | Doomsk/SimulaQron | 09bd81730e31c7642a0fece8ae7d518820fe57eb | [
"BSD-3-Clause"
] | 43 | 2018-10-10T15:53:28.000Z | 2022-03-31T16:52:55.000Z | import sys
import os
from simulaqron.toolbox import get_simulaqron_path
# Get path to SimulaQron folder
simulaqron_path = get_simulaqron_path.main()
tot_nr = int(sys.argv[1])
# configure run files for nodes
with open("run.sh", "w") as f:
f.write("#!/bin/sh\n\n")
for i in range(tot_nr - 1):
f.write(... | 27.2 | 68 | 0.627451 | import sys
import os
from simulaqron.toolbox import get_simulaqron_path
# Get path to SimulaQron folder
simulaqron_path = get_simulaqron_path.main()
tot_nr = int(sys.argv[1])
# configure run files for nodes
with open("run.sh", "w") as f:
f.write("#!/bin/sh\n\n")
for i in range(tot_nr - 1):
f.write(... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3455b79313232342209d06b8958b01bacb4d6b24 | 181 | py | Python | popupdict/util/__init__.py | hantaotaohan/popup-dict | 9eb05fd9797a14323c9b1166f916778b32e933bc | [
"MIT"
] | 85 | 2018-02-23T07:16:27.000Z | 2022-03-26T19:53:48.000Z | popupdict/util/__init__.py | glMa7/popup-dict | dbf9121aa63d65095bd848a582595e1b03327418 | [
"MIT"
] | 12 | 2018-02-23T07:45:34.000Z | 2020-03-10T03:20:03.000Z | popupdict/util/__init__.py | glMa7/popup-dict | dbf9121aa63d65095bd848a582595e1b03327418 | [
"MIT"
] | 16 | 2018-01-02T02:07:50.000Z | 2021-12-17T08:01:00.000Z | from .selection import Selection
from .logging import logger
from .dir import config_dir, cache_dir
__all__ = [
'Selection',
'logger',
'config_dir',
'cache_dir',
]
| 16.454545 | 38 | 0.685083 | from .selection import Selection
from .logging import logger
from .dir import config_dir, cache_dir
__all__ = [
'Selection',
'logger',
'config_dir',
'cache_dir',
]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
33fc243f69957eb951b7bee3d0b96740c540016f | 13,978 | py | Python | classification/CIFAR/gram_matrics.py | warner-benjamin/vos | 1f6844caeb2985f875b446f284bcfcfb8f9bba0e | [
"Apache-2.0"
] | 174 | 2022-02-03T04:45:23.000Z | 2022-03-31T06:04:23.000Z | classification/CIFAR/gram_matrics.py | warner-benjamin/vos | 1f6844caeb2985f875b446f284bcfcfb8f9bba0e | [
"Apache-2.0"
] | 19 | 2022-02-08T14:48:43.000Z | 2022-03-31T08:48:05.000Z | classification/CIFAR/gram_matrics.py | warner-benjamin/vos | 1f6844caeb2985f875b446f284bcfcfb8f9bba0e | [
"Apache-2.0"
] | 24 | 2022-02-04T14:16:29.000Z | 2022-03-26T12:13:06.000Z | from __future__ import division,print_function
#matplotlib inline
#load_ext autoreload
#autoreload 2
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
import torch.nn.init as init
from torchvision import datasets, transforms
import calculate_log as cal... | 33.440191 | 136 | 0.609744 | from __future__ import division,print_function
#matplotlib inline
#load_ext autoreload
#autoreload 2
import sys
from tqdm import tqdm_notebook as tqdm
import random
import matplotlib.pyplot as plt
import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim a... | 0 | 0 | 0 | 8,270 | 0 | 1,677 | 0 | 46 | 363 |
668413f0ce3cd197c88e2f927c1dbf7519e7a5cb | 1,597 | py | Python | LinkMeBot/utils.py | mdlss/PlayStoreLinks_Bot | 3c4bec4594c9670c7a3b88848cdc59c988c7f454 | [
"MIT"
] | null | null | null | LinkMeBot/utils.py | mdlss/PlayStoreLinks_Bot | 3c4bec4594c9670c7a3b88848cdc59c988c7f454 | [
"MIT"
] | null | null | null | LinkMeBot/utils.py | mdlss/PlayStoreLinks_Bot | 3c4bec4594c9670c7a3b88848cdc59c988c7f454 | [
"MIT"
] | null | null | null |
# https://stackoverflow.com/a/3155023
millnames = ['',' thousand',' million',' billion',' trillion'] | 33.270833 | 121 | 0.72511 | import logging
import math
from misaka import Markdown, HtmlRenderer
from lxml.html import fromstring
def make_logger(logger_name, logfile, loggin_level=logging.DEBUG):
logger = logging.getLogger(logger_name)
logger.setLevel(loggin_level)
formatter = logging.Formatter('%(levelname)s - %(name)s - %(asctime)s - %(... | 0 | 0 | 0 | 0 | 0 | 1,325 | 0 | 14 | 157 |
3e1ac6e8a54a6c16c3f79943e80cd2d3572d84bc | 1,671 | py | Python | temp/models.py | oteejay/lms | be351c8ec7aee1f81dede6fcf4292c1ecad31c60 | [
"MIT"
] | null | null | null | temp/models.py | oteejay/lms | be351c8ec7aee1f81dede6fcf4292c1ecad31c60 | [
"MIT"
] | 11 | 2020-06-05T22:33:23.000Z | 2022-03-11T23:56:46.000Z | temp/models.py | oteejay/lms | be351c8ec7aee1f81dede6fcf4292c1ecad31c60 | [
"MIT"
] | null | null | null |
# Create your models here.
| 33.42 | 105 | 0.618791 | from django.db import models
from django.contrib.auth.models import User
# Create your models here.
def upload_location(instance, filename):
return "%s/%s/%s" %('jtgreen', 'temp', filename)
class TempUser(models.Model):
user = models.ForeignKey(User, on_delete=models.CASCADE, related_name='tempusers')
... | 0 | 0 | 0 | 1,391 | 0 | 72 | 0 | 29 | 136 |
0d89603cb6143b26a131f84180a888c6ee7dfc8b | 279 | py | Python | Early/copyField_offices.py | adambreznicky/smudge_python | af7ba221890253ac6fe7f38691b351861f8b3d96 | [
"MIT"
] | 1 | 2017-05-24T02:05:20.000Z | 2017-05-24T02:05:20.000Z | historic/copyField_offices.py | adambreznicky/smudge_python | af7ba221890253ac6fe7f38691b351861f8b3d96 | [
"MIT"
] | null | null | null | historic/copyField_offices.py | adambreznicky/smudge_python | af7ba221890253ac6fe7f38691b351861f8b3d96 | [
"MIT"
] | null | null | null | source = "C:\\TxDOT\\Shapefiles\\District_Offices.shp"
outputcopy = "T:\\DATAMGT\\MAPPING\\Personal Folders\\Adam\\District_Offices.shp"
copyPhone()
| 34.875 | 81 | 0.752688 | import arcpy
source = "C:\\TxDOT\\Shapefiles\\District_Offices.shp"
outputcopy = "T:\\DATAMGT\\MAPPING\\Personal Folders\\Adam\\District_Offices.shp"
def copyPhone():
arcpy.JoinField_management(outputcopy, "Address", source, "Address", ["Phone"])
return "complete"
copyPhone()
| 0 | 0 | 0 | 0 | 0 | 95 | 0 | -9 | 44 |
2de0437e5ff66c828b518801f8dc21a58fbed809 | 952 | py | Python | src/smach_tutorial/Introspection/Introspection.py | vishnuPra/state_machine_tutorial | e27ee3b91feba8da3389df921f1c4346bf8d4bc2 | [
"Apache-2.0"
] | null | null | null | src/smach_tutorial/Introspection/Introspection.py | vishnuPra/state_machine_tutorial | e27ee3b91feba8da3389df921f1c4346bf8d4bc2 | [
"Apache-2.0"
] | null | null | null | src/smach_tutorial/Introspection/Introspection.py | vishnuPra/state_machine_tutorial | e27ee3b91feba8da3389df921f1c4346bf8d4bc2 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import rospy
##-----------------------------------------------------------------------------------
# Example
##-----------------------------------------------------------------------------------
if __name__ == '__main__':
rospy.init_node('tutorial_node')
main() #Change to main1 to call ... | 30.709677 | 85 | 0.548319 | #!/usr/bin/env python
import rospy
import smach_ros
from smach_tutorial.BasicStateMachine import BasicStateMachine_0,\
BasicStateMachine_1,\
BasicStateMachine_2
##-----------------------------------------------------------------... | 0 | 0 | 0 | 0 | 0 | 356 | 0 | 172 | 90 |
922e212a09a16f5831aaa45b2164778b91ffe10a | 8,448 | py | Python | vendor/packages/translate-toolkit/translate/convert/test_xliff2po.py | jgmize/kitsune | 8f23727a9c7fcdd05afc86886f0134fb08d9a2f0 | [
"BSD-3-Clause"
] | 2 | 2019-08-19T17:08:47.000Z | 2019-10-05T11:37:02.000Z | vendor/packages/translate-toolkit/translate/convert/test_xliff2po.py | jgmize/kitsune | 8f23727a9c7fcdd05afc86886f0134fb08d9a2f0 | [
"BSD-3-Clause"
] | null | null | null | vendor/packages/translate-toolkit/translate/convert/test_xliff2po.py | jgmize/kitsune | 8f23727a9c7fcdd05afc86886f0134fb08d9a2f0 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
| 38.054054 | 131 | 0.623816 | #!/usr/bin/env python
from translate.convert import xliff2po
from translate.misc import wStringIO
from translate.storage.test_base import headerless_len, first_translatable
class TestXLIFF2PO:
xliffskeleton = '''<?xml version="1.0" ?>
<xliff version="1.1" xmlns="urn:oasis:names:tc:xliff:document:1.1">
<file ori... | 0 | 0 | 0 | 8,227 | 0 | 0 | 0 | 85 | 113 |
d8082c1ca4107fc4e8b66d4b8f63834432cb57a8 | 1,419 | py | Python | Python/the_office_outed.py | ielvisd/CodeWar_Katas | 3d95dd72332a81cc2bff1c7fd3b782d1f4658ca8 | [
"MIT"
] | null | null | null | Python/the_office_outed.py | ielvisd/CodeWar_Katas | 3d95dd72332a81cc2bff1c7fd3b782d1f4658ca8 | [
"MIT"
] | null | null | null | Python/the_office_outed.py | ielvisd/CodeWar_Katas | 3d95dd72332a81cc2bff1c7fd3b782d1f4658ca8 | [
"MIT"
] | null | null | null | """ Your colleagues have been looking over you shoulder. When you should have been doing your boring real job, you've been using the work computers to smash in endless hours of codewars.
In a team meeting, a terrible, awful person declares to the group that you aren't working. You're in trouble. You quickly have to ga... | 61.695652 | 237 | 0.680761 | """ Your colleagues have been looking over you shoulder. When you should have been doing your boring real job, you've been using the work computers to smash in endless hours of codewars.
In a team meeting, a terrible, awful person declares to the group that you aren't working. You're in trouble. You quickly have to ga... | 0 | 0 | 0 | 0 | 0 | 34 | 0 | 0 | 23 |
383a19a0b2431ee34819fe0766e2d6b83c59586f | 4,740 | py | Python | Rake.py | beenotung/Rake_For_Chinese | 07e8e570f7d35ec0b93f18d6a124eeb8529d7780 | [
"MIT"
] | null | null | null | Rake.py | beenotung/Rake_For_Chinese | 07e8e570f7d35ec0b93f18d6a124eeb8529d7780 | [
"MIT"
] | null | null | null | Rake.py | beenotung/Rake_For_Chinese | 07e8e570f7d35ec0b93f18d6a124eeb8529d7780 | [
"MIT"
] | null | null | null | '''
Implementation of Rapid Automatic Keyword Extraction (RAKE) algorithm for Chinese
Original algorithm described in: Rose, S., Engel, D., Cramer, N., & Cowley, W. (2010).
Automatic Keyword Extraction from Individual Documents. In M. W. Berry & J. Kogan
(Eds.), Text Mining: Theory and Applications: John Wiley & Sons. ... | 30.779221 | 126 | 0.587553 | '''
Implementation of Rapid Automatic Keyword Extraction (RAKE) algorithm for Chinese
Original algorithm described in: Rose, S., Engel, D., Cramer, N., & Cowley, W. (2010).
Automatic Keyword Extraction from Individual Documents. In M. W. Berry & J. Kogan
(Eds.), Text Mining: Theory and Applications: John Wiley & Sons. ... | 48 | 0 | 0 | 422 | 0 | 3,521 | 0 | -9 | 200 |
808fad95e5fb38e2f8830d881ee74dc3281332bf | 249 | py | Python | 20211217_PartialExam/SaveTheWorld/solution.py | augustozanellato/Cybersec2021 | 466fd9db0e7c359a8afd5115eacb3fca2b439c28 | [
"BSD-3-Clause"
] | 15 | 2021-10-01T16:10:48.000Z | 2022-02-19T20:45:35.000Z | 20211217_PartialExam/SaveTheWorld/solution.py | augustozanellato/Cybersec2021 | 466fd9db0e7c359a8afd5115eacb3fca2b439c28 | [
"BSD-3-Clause"
] | null | null | null | 20211217_PartialExam/SaveTheWorld/solution.py | augustozanellato/Cybersec2021 | 466fd9db0e7c359a8afd5115eacb3fca2b439c28 | [
"BSD-3-Clause"
] | 2 | 2021-11-06T08:32:41.000Z | 2021-12-11T16:18:54.000Z |
context.binary = "./SaveTheWorld"
p = process()
p.sendline(b"A" * 72 + b"Jotaro!!" + b"Star Platinum!!!" + b"HORA" + b"9999")
p.recvuntil(b"Congratulation, you won!!!")
os.system("grep .*{.*}.* victory_recap.txt")
| 31.125 | 77 | 0.634538 | from pwn import * # type: ignore
context.binary = "./SaveTheWorld"
p = process()
p.sendline(b"A" * 72 + b"Jotaro!!" + b"Star Platinum!!!" + b"HORA" + b"9999")
p.recvuntil(b"Congratulation, you won!!!")
os.system("grep .*{.*}.* victory_recap.txt")
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | -4 | 38 |
e2a1f52aba416ba05637ca92a6566a1e403ae81d | 654 | py | Python | synlib/descriptions/CMPR32X1.py | vhnatyk/vlsistuff | 0981097bd19a0c482728dcc5048a3615ac9a9a90 | [
"MIT"
] | 26 | 2018-03-17T18:14:22.000Z | 2022-03-14T07:23:13.000Z | synlib/descriptions/CMPR32X1.py | psumesh/vlsistuff | 1fe64b093d0581d99c7d826b74c31b8655fa0b31 | [
"MIT"
] | 1 | 2019-10-16T10:31:11.000Z | 2019-10-17T04:14:53.000Z | synlib/descriptions/CMPR32X1.py | psumesh/vlsistuff | 1fe64b093d0581d99c7d826b74c31b8655fa0b31 | [
"MIT"
] | 7 | 2018-07-16T07:51:25.000Z | 2022-02-15T14:22:54.000Z | Desc = cellDescClass("CMPR32X1")
Desc.properties["cell_leakage_power"] = "3632.359140"
Desc.properties["cell_footprint"] = "add32"
Desc.properties["area"] = "69.854400"
Desc.pinOrder = ['A', 'B', 'C', 'CO', 'S']
Desc.add_arc("A","S","combi")
Desc.add_arc("B","S","combi")
Desc.add_arc("C","S","combi")
Desc.add_arc("A","... | 31.142857 | 53 | 0.666667 | Desc = cellDescClass("CMPR32X1")
Desc.properties["cell_leakage_power"] = "3632.359140"
Desc.properties["cell_footprint"] = "add32"
Desc.properties["area"] = "69.854400"
Desc.pinOrder = ['A', 'B', 'C', 'CO', 'S']
Desc.add_arc("A","S","combi")
Desc.add_arc("B","S","combi")
Desc.add_arc("C","S","combi")
Desc.add_arc("A","... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fb949f558985982b6af7d2af1255dbe8dc314222 | 868 | py | Python | 965.py | OmangRawat/Leetcode | 6fa696367ef9c5e6b08940b11e2202382d1afc07 | [
"MIT"
] | null | null | null | 965.py | OmangRawat/Leetcode | 6fa696367ef9c5e6b08940b11e2202382d1afc07 | [
"MIT"
] | null | null | null | 965.py | OmangRawat/Leetcode | 6fa696367ef9c5e6b08940b11e2202382d1afc07 | [
"MIT"
] | null | null | null | """
---> Univalued Binary Tree
---> Easy
"""
in_array = [1, 1, 1, 1, 1, None, 1]
in_root = to_binary_tree(in_array)
pretty_print(in_root)
a = Solution()
print("Answer -", a.isUnivalTree(in_root))
# print("Answer -", a.isUnivalTree(in_root))
"""
Check if node is none or node.value should be equal to root value f... | 26.30303 | 133 | 0.673963 | """
---> Univalued Binary Tree
---> Easy
"""
from tree_func import *
class Solution:
def isUnivalTree(self, root) -> bool:
def dfs(node):
# pretty_print(node)
# print(node is None or node.value == root.value and dfs(node.left) and dfs(node.right))
return node is Non... | 0 | 0 | 0 | 317 | 0 | 0 | 0 | 2 | 46 |
13702b905917360de903277c86d31a8e4bc8103e | 947 | py | Python | BPNetWork/NeuralNetwork/mnist_data.py | Keneyr/MachineLearningMethods | 9b15cce18c476f8b827ca5082ff119b6cba41198 | [
"MIT"
] | 1 | 2021-07-02T15:01:30.000Z | 2021-07-02T15:01:30.000Z | BPNetWork/NeuralNetwork/mnist_data.py | Keneyr/MachineLearningMethods | 9b15cce18c476f8b827ca5082ff119b6cba41198 | [
"MIT"
] | null | null | null | BPNetWork/NeuralNetwork/mnist_data.py | Keneyr/MachineLearningMethods | 9b15cce18c476f8b827ca5082ff119b6cba41198 | [
"MIT"
] | 1 | 2021-07-02T15:01:30.000Z | 2021-07-02T15:01:30.000Z | import os
import struct
import numpy as np
def load_mnist(path, kind='train'):
"""Load MNIST data from `path`"""
labels_path = os.path.join(path,
'%s-labels.idx1-ubyte'
% kind)
images_path = os.path.join(path,
'%s-... | 36.423077 | 70 | 0.469905 | import os
import struct
import numpy as np
def load_mnist(path, kind='train'):
"""Load MNIST data from `path`"""
labels_path = os.path.join(path,
'%s-labels.idx1-ubyte'
% kind)
images_path = os.path.join(path,
'%s-... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ab920960470b013ad4fbe77a3508e1b418275b48 | 295 | py | Python | src/concepts/mode.py | Valeeswaran/tutorials | 71b43cad46f4d7d2d67d3ff4be61bdaaade2a36a | [
"MIT"
] | null | null | null | src/concepts/mode.py | Valeeswaran/tutorials | 71b43cad46f4d7d2d67d3ff4be61bdaaade2a36a | [
"MIT"
] | null | null | null | src/concepts/mode.py | Valeeswaran/tutorials | 71b43cad46f4d7d2d67d3ff4be61bdaaade2a36a | [
"MIT"
] | null | null | null | arr = [1, 2, 3, 4, 4, 4, 5, 6, 6, 7, 8, 9]
arr.sort()
my_dict = {i:arr.count(i) for i in arr}
# sorting the dictionary based on value
my_dict = {k: v for k, v in sorted(my_dict.items(), key=lambda item: item[1])}
print(len(my_dict))
print(my_dict)
list = list(my_dict.keys())
print(list[-1])
| 22.692308 | 78 | 0.637288 | arr = [1, 2, 3, 4, 4, 4, 5, 6, 6, 7, 8, 9]
arr.sort()
my_dict = {i:arr.count(i) for i in arr}
# sorting the dictionary based on value
my_dict = {k: v for k, v in sorted(my_dict.items(), key=lambda item: item[1])}
print(len(my_dict))
print(my_dict)
list = list(my_dict.keys())
print(list[-1])
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
635dfca37db44428a5f283624c1effff583c2d39 | 1,125 | py | Python | teamcat_service/doraemon/doraemon/auth_extend/user/templatetags/auth_required.py | zhangyin2088/Teamcat | be9be8d7c1e58c8d2d22ab78d25783d9aee4de71 | [
"Apache-2.0"
] | 6 | 2018-11-26T08:42:52.000Z | 2020-06-01T08:33:48.000Z | teamcat_service/doraemon/doraemon/auth_extend/user/templatetags/auth_required.py | zhangyin2088/Teamcat | be9be8d7c1e58c8d2d22ab78d25783d9aee4de71 | [
"Apache-2.0"
] | null | null | null | teamcat_service/doraemon/doraemon/auth_extend/user/templatetags/auth_required.py | zhangyin2088/Teamcat | be9be8d7c1e58c8d2d22ab78d25783d9aee4de71 | [
"Apache-2.0"
] | 1 | 2019-01-22T06:45:36.000Z | 2019-01-22T06:45:36.000Z | #coding=utf-8
'''
Created on 2016-1-18
@author: Devuser
'''
from django import template
register = template.Library()
| 26.162791 | 161 | 0.757333 | #coding=utf-8
'''
Created on 2016-1-18
@author: Devuser
'''
from django import template
from doraemon.auth_extend.user.templatetags.auth_required_node import LogoutRequiredNode,LoginRequiredNode,UserRequiredNode,ManagerRequiredNode,AdminRequiredNode
register = template.Library()
@register.tag()
def admin_required... | 0 | 726 | 0 | 0 | 0 | 0 | 0 | 140 | 137 |
526c50830e718621f212e4da83405610854941d1 | 2,326 | py | Python | schoolovy.py | N-l1/schoolovy | 74ea456e04af6029b77cb8310915184a8467849e | [
"MIT"
] | null | null | null | schoolovy.py | N-l1/schoolovy | 74ea456e04af6029b77cb8310915184a8467849e | [
"MIT"
] | null | null | null | schoolovy.py | N-l1/schoolovy | 74ea456e04af6029b77cb8310915184a8467849e | [
"MIT"
] | null | null | null | import yaml
import schoolopy
import sys
def err(msg):
"""
Prints out error message and exits with error.
"""
print(f"Error: {msg}")
exit(1)
def main(limit):
"""
Likes all the posts & comments
in your most recent feed (20 posts).
Args:
limit: How many posts to like.
... | 26.735632 | 74 | 0.552021 | import yaml
import schoolopy
import sys
def err(msg):
"""
Prints out error message and exits with error.
"""
print(f"Error: {msg}")
exit(1)
def main(limit):
"""
Likes all the posts & comments
in your most recent feed (20 posts).
Args:
limit: How many posts to like.
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a057e34d83d549a6400f01ec669293543215e6ee | 1,535 | py | Python | examples/session2-fi/loops.py | futurice/PythonInBrowser | 066ab28ffad265efc7968b87f33dab2c68216d9d | [
"MIT"
] | 4 | 2015-12-08T19:34:49.000Z | 2019-09-08T22:11:05.000Z | examples/session2-fi/loops.py | futurice/PythonInBrowser | 066ab28ffad265efc7968b87f33dab2c68216d9d | [
"MIT"
] | 18 | 2016-10-14T13:48:39.000Z | 2019-10-11T12:14:21.000Z | examples/session2-fi/loops.py | futurice/PythonInBrowser | 066ab28ffad265efc7968b87f33dab2c68216d9d | [
"MIT"
] | 4 | 2015-11-18T15:18:43.000Z | 2018-03-02T09:36:23.000Z | # Loopit eli silmukat
##### INFO #####
#
# Joskus monimutkaisen kuvion piirtminen vaatii samojen
# komentojen toistamista moneen kertaan. Loopilla eli silmukalla
# voit toistaa koodipalikoita eli ptki koodia
import turtle
t = turtle.Turtle()
# Seuraava on esimerkki silmukasta.
#
# "for" kertoo tietokoneelle ett sen ... | 29.519231 | 78 | 0.755049 | # Loopit eli silmukat
##### INFO #####
#
# Joskus monimutkaisen kuvion piirtäminen vaatii samojen
# komentojen toistamista moneen kertaan. Loopilla eli silmukalla
# voit toistaa koodipalikoita eli pätkiä koodia
import turtle
t = turtle.Turtle()
# Seuraava on esimerkki silmukasta.
#
# "for" kertoo tietokoneelle että ... | 94 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7fc3e32ddb3a3537ba996d42f205b2e6ae14bd96 | 2,098 | py | Python | bot_commands_test/exception.py | SimoneABNto/My-Code-Py | 47276c1d69a92aa284685c9f148c1bd960147f7f | [
"MIT"
] | null | null | null | bot_commands_test/exception.py | SimoneABNto/My-Code-Py | 47276c1d69a92aa284685c9f148c1bd960147f7f | [
"MIT"
] | null | null | null | bot_commands_test/exception.py | SimoneABNto/My-Code-Py | 47276c1d69a92aa284685c9f148c1bd960147f7f | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
main()
| 28.739726 | 85 | 0.560534 | from queue import Queue, Empty
from time import sleep
from threading import Timer
class CommandoLoader(object):
def __init__(self):
self.__bot = None
self.__error_callback_function = None
self.thread = None
self.error_queue_function = None
def start_demon(self, bot... | 0 | 0 | 0 | 1,285 | 0 | 630 | 0 | 16 | 119 |
77c55afce086a01fa8acafddadc82f59d1e34666 | 1,843 | py | Python | core/common.py | MogooStudio/mogoopy | 81d1bfc35fca46dd028f141fb59eb6d87d8396bc | [
"MIT"
] | null | null | null | core/common.py | MogooStudio/mogoopy | 81d1bfc35fca46dd028f141fb59eb6d87d8396bc | [
"MIT"
] | null | null | null | core/common.py | MogooStudio/mogoopy | 81d1bfc35fca46dd028f141fb59eb6d87d8396bc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
G_ZIP_SPLIT_LINE = 500
G_ZIP_SPLIT_UNIT = 100
| 23.628205 | 90 | 0.58166 | # -*- coding: utf-8 -*-
import hashlib
import subprocess
import sys
import os
G_ZIP_SPLIT_LINE = 500
G_ZIP_SPLIT_UNIT = 100
def os_system(cmd, use_secure = False):
print("cmd", cmd)
os.system(cmd)
def os_popen(cmd):
print("cmd", cmd)
np = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE)
... | 0 | 0 | 0 | 0 | 0 | 1,526 | 0 | -34 | 272 |
077095c547b884a222278093dfab78cec8fd69fa | 3,839 | py | Python | sonnet/src/parallel_linear.py | ScriptBox99/deepmind-sonnet | 5cbfdc356962d9b6198d5b63f0826a80acfdf35b | [
"Apache-2.0"
] | 10,287 | 2017-04-07T12:33:37.000Z | 2022-03-30T03:32:16.000Z | sonnet/src/parallel_linear.py | ScriptBox99/deepmind-sonnet | 5cbfdc356962d9b6198d5b63f0826a80acfdf35b | [
"Apache-2.0"
] | 209 | 2017-04-07T15:57:11.000Z | 2022-03-27T10:43:03.000Z | sonnet/src/parallel_linear.py | ScriptBox99/deepmind-sonnet | 5cbfdc356962d9b6198d5b63f0826a80acfdf35b | [
"Apache-2.0"
] | 1,563 | 2017-04-07T13:15:06.000Z | 2022-03-29T15:26:04.000Z | # Copyright 2019 The Sonnet Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 37.637255 | 80 | 0.68273 | # Copyright 2019 The Sonnet Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 0 | 987 | 0 | 1,928 | 0 | 0 | 0 | 31 | 179 |
c4035174e5609822f5176b25618ba665b6bcb7bd | 1,431 | py | Python | tests/spot/futures/test_futures_loan_borrow.py | fossabot/binance-connector-python | bab18df22ba57b407b15dd0a9147cd75e6389b9e | [
"MIT"
] | 1 | 2021-08-05T03:36:24.000Z | 2021-08-05T03:36:24.000Z | tests/spot/futures/test_futures_loan_borrow.py | fossabot/binance-connector-python | bab18df22ba57b407b15dd0a9147cd75e6389b9e | [
"MIT"
] | 2 | 2021-07-12T11:18:55.000Z | 2021-07-12T11:28:19.000Z | tests/spot/futures/test_futures_loan_borrow.py | fossabot/binance-connector-python | bab18df22ba57b407b15dd0a9147cd75e6389b9e | [
"MIT"
] | 1 | 2021-07-10T20:50:04.000Z | 2021-07-10T20:50:04.000Z | from tests.util import random_str
from binance.spot import Spot as Client
from binance.error import ParameterRequiredError
mock_item = {"key_1": "value_1", "key_2": "value_2"}
mock_exception = {"code": -1105, "msg": "error message."}
key = random_str()
secret = random_str()
params = {"coin": "USDT", "collateralCoin"... | 27.519231 | 77 | 0.712788 | import responses
from urllib.parse import urlencode
from tests.util import random_str
from tests.util import mock_http_response
from binance.spot import Spot as Client
from binance.error import ParameterRequiredError, ClientError
mock_item = {"key_1": "value_1", "key_2": "value_2"}
mock_exception = {"code": -1105, "m... | 0 | 314 | 0 | 0 | 0 | 0 | 0 | 41 | 90 |
e531ec686052a49b40461d2d3da353e84817d346 | 24,729 | py | Python | conary_test/cvctest/buildtest/expansiontest.py | sassoftware/conary | d418968acd5e11ee17ed6d91ca395ea10a040222 | [
"Apache-2.0"
] | 43 | 2015-03-31T01:37:10.000Z | 2021-11-14T16:26:48.000Z | conary_test/cvctest/buildtest/expansiontest.py | sassoftware/conary | d418968acd5e11ee17ed6d91ca395ea10a040222 | [
"Apache-2.0"
] | 9 | 2015-06-10T16:39:41.000Z | 2020-01-27T16:35:01.000Z | conary_test/cvctest/buildtest/expansiontest.py | sassoftware/conary | d418968acd5e11ee17ed6d91ca395ea10a040222 | [
"Apache-2.0"
] | 9 | 2015-04-07T08:12:37.000Z | 2020-01-26T09:54:18.000Z | #
# Copyright (c) SAS Institute Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 42.709845 | 89 | 0.597921 | #
# Copyright (c) SAS Institute Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in w... | 0 | 17,595 | 0 | 6,198 | 0 | 0 | 0 | 99 | 249 |
be31d4bb7630a7fc2c1993bb09d802aee8af78d3 | 6,647 | py | Python | Project/RE4017_proj1.py | Ciaran-Carroll/college | 46052aa177280f7900e04e0e828247d7097eb07b | [
"MIT"
] | null | null | null | Project/RE4017_proj1.py | Ciaran-Carroll/college | 46052aa177280f7900e04e0e828247d7097eb07b | [
"MIT"
] | null | null | null | Project/RE4017_proj1.py | Ciaran-Carroll/college | 46052aa177280f7900e04e0e828247d7097eb07b | [
"MIT"
] | null | null | null | '''
#Students Name's: Ciaran Carroll
# Student Id Number's: 13113259
#
# Project 1:
# Implement image reconstruction from parallel-projection sinograms using Python.
#
# CAT Scanners (or CT scan) - Computer Axial Tomography
# CT scan: is a special X-ray tests that produce cross-sectional images of the body using X-ra... | 38.871345 | 101 | 0.70844 | '''
#Students Name's: Ciaran Carroll
# Student Id Number's: 13113259
#
# Project 1:
# Implement image reconstruction from parallel-projection sinograms using Python.
#
# CAT Scanners (or CT scan) - Computer Axial Tomography
# CT scan: is a special X-ray tests that produce cross-sectional images of the body using X-ra... | 3 | 0 | 0 | 0 | 0 | 0 | 0 | 28 | 22 |
16ed837df429a96c0cdbd562240040a729a666ee | 7,343 | py | Python | messyger.py | raxod502/messyger | fbfe286d2448bc8ec112e7f3063f71dfe3bf2c27 | [
"MIT"
] | 4 | 2021-12-06T17:06:20.000Z | 2022-02-24T21:10:02.000Z | messyger.py | raxod502/messyger | fbfe286d2448bc8ec112e7f3063f71dfe3bf2c27 | [
"MIT"
] | null | null | null | messyger.py | raxod502/messyger | fbfe286d2448bc8ec112e7f3063f71dfe3bf2c27 | [
"MIT"
] | null | null | null | import argparse
import collections
import datetime
import json
import random
import re
import esprima
import requests
## Get the email and password
parser = argparse.ArgumentParser("messyger")
parser.add_argument("-u", "--email", required=True)
parser.add_argument("-p", "--password", required=True)
parser.add_argume... | 32.635556 | 87 | 0.493395 | import argparse
import collections
import datetime
import json
import random
import re
import esprima
import requests
## Get the email and password
parser = argparse.ArgumentParser("messyger")
parser.add_argument("-u", "--email", required=True)
parser.add_argument("-p", "--password", required=True)
parser.add_argume... | 0 | 0 | 0 | 0 | 0 | 959 | 0 | 0 | 81 |
1711dbc6d5f8418cbf2d6ff20883e3525a9a462a | 1,540 | py | Python | .github/actions/update-version/update-version.py | nihaals/visual-studio-code-insiders-arch | bbd4c26f4766ccab1b9a15608bd84cccaae51341 | [
"MIT"
] | 3 | 2020-09-19T19:26:11.000Z | 2021-08-18T18:30:45.000Z | .github/actions/update-version/update-version.py | nihaals/visual-studio-code-insiders-arch | bbd4c26f4766ccab1b9a15608bd84cccaae51341 | [
"MIT"
] | null | null | null | .github/actions/update-version/update-version.py | nihaals/visual-studio-code-insiders-arch | bbd4c26f4766ccab1b9a15608bd84cccaae51341 | [
"MIT"
] | 2 | 2020-08-17T02:29:14.000Z | 2020-08-18T01:28:49.000Z | import os
import re
with open('PKGBUILD') as fp:
for line in fp.readlines():
line = line.strip()
current_build_number = re.search(r"^_pkgbuildnumber=(.+)$", line)
if current_build_number is None:
continue
current_build_number = current_build_number.group(1)
brea... | 34.222222 | 114 | 0.707143 | import os
import re
with open('PKGBUILD') as fp:
for line in fp.readlines():
line = line.strip()
current_build_number = re.search(r"^_pkgbuildnumber=(.+)$", line)
if current_build_number is None:
continue
current_build_number = current_build_number.group(1)
brea... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
cbd4baa2dbcce74135081efb545a3df0f0b369a9 | 10,085 | py | Python | hottbox/utils/generation/tests/test_basic.py | adamurban98/hottbox | 26580018ec6d38a1b08266c04ce4408c9e276130 | [
"Apache-2.0"
] | 167 | 2018-05-07T10:31:00.000Z | 2022-02-24T19:20:31.000Z | hottbox/utils/generation/tests/test_basic.py | adamurban98/hottbox | 26580018ec6d38a1b08266c04ce4408c9e276130 | [
"Apache-2.0"
] | 19 | 2018-05-10T13:26:39.000Z | 2020-01-31T12:49:27.000Z | hottbox/utils/generation/tests/test_basic.py | adamurban98/hottbox | 26580018ec6d38a1b08266c04ce4408c9e276130 | [
"Apache-2.0"
] | 24 | 2018-04-02T17:16:50.000Z | 2021-12-07T06:21:40.000Z | import pytest
import numpy as np
from functools import reduce
from hottbox.core.structures import Tensor, TensorCPD, TensorTKD, TensorTT
from ..basic import super_diag_tensor, residual_tensor
def test_super_diag_tensor():
""" Tests for creating super-diagonal tensor"""
order = 3
rank = 2
correct_sh... | 41.846473 | 110 | 0.578681 | import pytest
import numpy as np
from functools import reduce
from hottbox.core.structures import Tensor,TensorCPD, TensorTKD, TensorTT
from hottbox.utils.validation.checks import is_super_symmetric
from ..basic import dense_tensor, sparse_tensor, super_diagonal_tensor, \
super_diag_tensor, super_symmetric_tensor, ... | 0 | 0 | 0 | 0 | 0 | 1,236 | 0 | 122 | 114 |
3157151c02d05ab116eb33bad54d5906f6b8d1d5 | 2,045 | py | Python | src/appengine/model.py | tomwilkie/awesomation | 708a0ff2ffd431f24ed3f942cafd24882dc89620 | [
"MIT"
] | 28 | 2015-01-12T15:34:37.000Z | 2021-06-17T14:27:49.000Z | src/appengine/model.py | tomwilkie/awesomation | 708a0ff2ffd431f24ed3f942cafd24882dc89620 | [
"MIT"
] | 16 | 2015-01-11T21:46:08.000Z | 2015-02-06T17:01:50.000Z | src/appengine/model.py | tomwilkie/awesomation | 708a0ff2ffd431f24ed3f942cafd24882dc89620 | [
"MIT"
] | 2 | 2015-01-10T17:34:23.000Z | 2015-01-10T18:38:01.000Z | """Base classes for my data model."""
# From http://stackoverflow.com/questions/10035133/ndb-decimal-property
| 30.984848 | 76 | 0.672372 | """Base classes for my data model."""
import decimal
from google.appengine.ext import ndb
from google.appengine.ext.ndb import polymodel
from appengine import history, rest, user
# From http://stackoverflow.com/questions/10035133/ndb-decimal-property
class DecimalProperty(ndb.IntegerProperty):
"""Decimal property... | 0 | 194 | 0 | 1,550 | 0 | 0 | 0 | 53 | 135 |
cedbd4d63dbf752123f11e31471ca8fd234d5f07 | 1,909 | py | Python | Blender 2.91/2.91/scripts/addons/power_sequencer/operators/scene_cycle.py | calculusrobotics/RNNs-for-Bayesian-State-Estimation | 2aacf86d2e447e10c840b4926d4de7bc5e46d9bc | [
"MIT"
] | 1 | 2021-06-30T00:39:40.000Z | 2021-06-30T00:39:40.000Z | release/scripts/addons/power_sequencer/operators/scene_cycle.py | ringsce/Rings3D | 8059d1e2460fc8d6f101eff8e695f68a99f6671d | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | release/scripts/addons/power_sequencer/operators/scene_cycle.py | ringsce/Rings3D | 8059d1e2460fc8d6f101eff8e695f68a99f6671d | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | #
# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors
#
# This file is part of Power Sequencer.
#
# Power Sequencer is free software: you can redistribute it and/or modify it under the terms of the
# GNU General Public License as published by the Free Software Foundation, either... | 34.709091 | 99 | 0.675746 | #
# Copyright (C) 2016-2020 by Nathan Lovato, Daniel Oakey, Razvan Radulescu, and contributors
#
# This file is part of Power Sequencer.
#
# Power Sequencer is free software: you can redistribute it and/or modify it under the terms of the
# GNU General Public License as published by the Free Software Foundation, either... | 0 | 50 | 0 | 972 | 0 | 0 | 0 | 39 | 68 |
df341bd8c114208ae94cc128e9c72342d72f8af5 | 8,094 | py | Python | demo/demo_guess_count_file.py | UChicagoSUPERgroup/analytic-password-cracking | 1c30153e852af36ffdc0566c949f63d9736105f8 | [
"MIT"
] | 22 | 2019-05-20T16:43:16.000Z | 2021-04-23T09:32:11.000Z | demo/demo_guess_count_file.py | UChicagoSUPERgroup/analytic-password-cracking | 1c30153e852af36ffdc0566c949f63d9736105f8 | [
"MIT"
] | null | null | null | demo/demo_guess_count_file.py | UChicagoSUPERgroup/analytic-password-cracking | 1c30153e852af36ffdc0566c949f63d9736105f8 | [
"MIT"
] | 6 | 2019-05-20T18:01:05.000Z | 2020-11-12T07:54:33.000Z | from sys import path as sys_path
from os import path as os_path
from subprocess import Popen, PIPE
import time
import logging
import numpy as np
sys_path.append(os_path.abspath('../src'))
from config import RUNTIME_CONFIG
from guess_count import GuessCount
from tokenstr import TokenString
from utility import read_pas... | 47.611765 | 205 | 0.627255 | from sys import path as sys_path
from os import path as os_path
from subprocess import Popen, PIPE
import time
import logging
import warnings
import numpy as np
sys_path.append(os_path.abspath('../src'))
from config import RUNTIME_CONFIG
from config import john_nick_names, hc_nick_names
from common import PasswordPol... | 0 | 0 | 0 | 0 | 0 | 220 | 0 | 82 | 111 |
333a2f2f140534cc1d6698425fb54de5fcbfec93 | 642 | py | Python | utils/env.py | Omarzintan/bumblebee-ai | 0b8c5cecf032730e23b1b710a88538f5e4ea70c9 | [
"MIT"
] | 3 | 2021-05-06T16:29:26.000Z | 2022-01-09T03:32:40.000Z | utils/env.py | Omarzintan/bumblebee-ai | 0b8c5cecf032730e23b1b710a88538f5e4ea70c9 | [
"MIT"
] | 1 | 2021-05-20T17:59:12.000Z | 2021-05-20T17:59:12.000Z | utils/env.py | Omarzintan/bumblebee-ai | 0b8c5cecf032730e23b1b710a88538f5e4ea70c9 | [
"MIT"
] | null | null | null | '''
This file is for retrieving system environment variables and helper
variables directly derived from them.
In decreasing order of precedence, environment variables can be set by:
1. adding them to .env file at root of this project
2. exporting and then running bumblebee in then same terminal.
E.g. export BUMBLEB... | 33.789474 | 77 | 0.78972 | '''
This file is for retrieving system environment variables and helper
variables directly derived from them.
In decreasing order of precedence, environment variables can be set by:
1. adding them to .env file at root of this project
2. exporting and then running bumblebee in then same terminal.
E.g. export BUMBLEB... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
248e74a35b18bd30f4803c6ed6fcc98efb31c3af | 1,701 | py | Python | pagination.py | billaanil3/Paginization | 4556634517841bc1104fd1a015beda04c16d5322 | [
"MIT"
] | 11 | 2017-11-28T22:26:55.000Z | 2022-03-21T15:42:41.000Z | pagination.py | billaanil3/Paginization | 4556634517841bc1104fd1a015beda04c16d5322 | [
"MIT"
] | 3 | 2017-11-28T21:05:48.000Z | 2019-04-02T22:38:48.000Z | pagination.py | billaanil3/Paginization | 4556634517841bc1104fd1a015beda04c16d5322 | [
"MIT"
] | 8 | 2017-11-28T17:23:39.000Z | 2021-11-19T15:41:18.000Z | """Pagination sample for Microsoft Graph."""
# Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
# See LICENSE in the project root for license information.
import bottle
import graphrest
import config
MSGRAPH = graphrest.GraphSession(client_id=config.CLIENT_ID,
... | 29.327586 | 81 | 0.681952 | """Pagination sample for Microsoft Graph."""
# Copyright (c) Microsoft. All rights reserved. Licensed under the MIT license.
# See LICENSE in the project root for license information.
import os
import bottle
import graphrest
import config
MSGRAPH = graphrest.GraphSession(client_id=config.CLIENT_ID,
... | 0 | 917 | 0 | 0 | 0 | 0 | 0 | -12 | 137 |
d7ba520906466c429eb7e964cc54b23a09f4bd0c | 27,726 | py | Python | numbas_lti/models.py | pbh4/numbas_leicester | bac5c66c0c7809ee9588a69b3bced4244cee08e5 | [
"Apache-2.0"
] | null | null | null | numbas_lti/models.py | pbh4/numbas_leicester | bac5c66c0c7809ee9588a69b3bced4244cee08e5 | [
"Apache-2.0"
] | null | null | null | numbas_lti/models.py | pbh4/numbas_leicester | bac5c66c0c7809ee9588a69b3bced4244cee08e5 | [
"Apache-2.0"
] | null | null | null | from django.db import models
from django.utils.translation import ugettext_lazy as _
# Create your models here.
GRADING_METHODS = [
('highest',_('Highest score')),
('last',_('Last attempt')),
]
REPORT_TIMES = [
('immediately',_('Immediately')),
('oncompletion',_('On completion')),
('manually',_... | 40.773529 | 197 | 0.68351 | from django.conf import settings
from django.db import models
from django.dispatch import receiver
from django.contrib.auth.models import User
import requests
from django.utils.text import slugify
from django.utils.translation import ugettext_lazy as _, ugettext
from django.core import validators
from channels import G... | 0 | 4,720 | 0 | 19,664 | 0 | 820 | 0 | 233 | 1,086 |
c2dec3dcd5aba4c26930d56a78814b05201b9fd5 | 2,763 | py | Python | nb_compress.py | tanakatsu/nb_compress | a1fe923c4b271ce399e1550e51e6bfa354681c06 | [
"MIT"
] | null | null | null | nb_compress.py | tanakatsu/nb_compress | a1fe923c4b271ce399e1550e51e6bfa354681c06 | [
"MIT"
] | null | null | null | nb_compress.py | tanakatsu/nb_compress | a1fe923c4b271ce399e1550e51e6bfa354681c06 | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
main()
| 30.7 | 106 | 0.579081 | import json
import re
import argparse
import sys
def eprint(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
def compress_output(output, mode):
if "text" in output and mode['first_last_epoch']:
text = output["text"]
mask = False
_text = []
for line in text:
... | 0 | 0 | 0 | 0 | 0 | 2,603 | 0 | -39 | 157 |
70deaa73a8457f76f76ea1cbe027b3e157405f0d | 4,002 | py | Python | python/h5/_h5py_desc.py | phdum/h5 | d5f1b02354fd93da55cd09dc6a83218d98adab76 | [
"Apache-2.0"
] | null | null | null | python/h5/_h5py_desc.py | phdum/h5 | d5f1b02354fd93da55cd09dc6a83218d98adab76 | [
"Apache-2.0"
] | null | null | null | python/h5/_h5py_desc.py | phdum/h5 | d5f1b02354fd93da55cd09dc6a83218d98adab76 | [
"Apache-2.0"
] | null | null | null | # Generated automatically using the command :
# c++2py h5py_io.hpp --members_read_only -N h5 -a _h5py -m _h5py -o _h5py --moduledoc="A lightweight hdf5 python interface" --cxxflags="-std=c++20" --includes=./../../c++ --only="object file group h5_read_bare h5_write_bare"
# The module
module = module_(full_name = "_h5py... | 33.915254 | 224 | 0.643428 | # Generated automatically using the command :
# c++2py h5py_io.hpp --members_read_only -N h5 -a _h5py -m _h5py -o _h5py --moduledoc="A lightweight hdf5 python interface" --cxxflags="-std=c++20" --includes=./../../c++ --only="object file group h5_read_bare h5_write_bare"
from cpp2py.wrap_generator import *
# The module... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 14 | 22 |
467ad5dbc7ae14468d001e76f9f66437da261324 | 13,803 | py | Python | internals/detect_intent_test.py | www-business-com/chromium-dashboard | f7b9c5136f4cfee4adbfca872335eb9c455b071b | [
"Apache-2.0"
] | 1 | 2022-03-25T14:40:37.000Z | 2022-03-25T14:40:37.000Z | internals/detect_intent_test.py | BossNetworking/chromium-dashboard | 9f0d76e70ef5e6169552407e728b3d3205517da8 | [
"Apache-2.0"
] | null | null | null | internals/detect_intent_test.py | BossNetworking/chromium-dashboard | 9f0d76e70ef5e6169552407e728b3d3205517da8 | [
"Apache-2.0"
] | 1 | 2021-11-15T06:49:12.000Z | 2021-11-15T06:49:12.000Z | # Copyright 2021 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 40.716814 | 80 | 0.701152 | # Copyright 2021 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | 0 | 2,721 | 0 | 10,219 | 0 | 0 | 0 | 33 | 206 |
1c741e6bc69fc8671df5a15c26f40ce7a3bf09f3 | 2,839 | py | Python | paranuara/citizens/models/citizens.py | SPLAYER-HD/Paranuara | 5a42f23d761e16e3b486ba04d9185551614f06a5 | [
"MIT"
] | null | null | null | paranuara/citizens/models/citizens.py | SPLAYER-HD/Paranuara | 5a42f23d761e16e3b486ba04d9185551614f06a5 | [
"MIT"
] | 4 | 2021-06-08T20:53:43.000Z | 2022-03-12T00:13:51.000Z | paranuara/citizens/models/citizens.py | SPLAYER-HD/RestServiceDjango | 5a42f23d761e16e3b486ba04d9185551614f06a5 | [
"MIT"
] | null | null | null | """Citizens model."""
# Django
# models
# PostgreSQL fields
# Utilities
| 22.007752 | 98 | 0.62205 | """Citizens model."""
# Django
from django.db import models
from django.contrib.auth.models import AbstractUser
from django.core.validators import RegexValidator
# models
from paranuara.companies.models import Company
# PostgreSQL fields
from django.contrib.postgres.fields import JSONField
# Utilities
from paranuar... | 0 | 0 | 0 | 2,434 | 0 | 0 | 0 | 149 | 178 |
e340c1025aff6d53bab2a99990b56f88b3b6f369 | 1,001 | py | Python | aocpo_backend/aocpo_api/urls.py | CoderChen01/aocpo | 279bfae910a30be762e1954df1a53a6217a6e300 | [
"Apache-2.0"
] | 7 | 2020-02-17T12:20:26.000Z | 2021-03-15T01:02:34.000Z | aocpo_backend/aocpo_api/urls.py | CoderChen01/aocpo | 279bfae910a30be762e1954df1a53a6217a6e300 | [
"Apache-2.0"
] | 3 | 2020-04-19T03:01:41.000Z | 2020-04-19T03:02:09.000Z | aocpo_backend/aocpo_api/urls.py | CoderChen01/aocpo | 279bfae910a30be762e1954df1a53a6217a6e300 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.urls import path
from .views import login_register, task_manage, analysis_page
urlpatterns = [
path('login/', login_register.Login.as_view()),
path('register/', login_register.SignIn.as_view()),
path('register/check_username', login_register.SignIn.a... | 52.684211 | 91 | 0.751249 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from django.urls import path
from .views import login_register, task_manage, analysis_page
urlpatterns = [
path('login/', login_register.Login.as_view()),
path('register/', login_register.SignIn.as_view()),
path('register/check_username', login_register.SignIn.a... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
45719d34a81e10187b4b4005d07f676e2396fd1d | 905 | py | Python | example_project/urls.py | amarandon/django-audiotracks | e2480ebe555b07cc3c3c60b075a7caed462ed96d | [
"MIT"
] | 30 | 2015-04-16T04:56:30.000Z | 2021-02-26T05:28:54.000Z | example_project/urls.py | amarandon/django-audiotracks | e2480ebe555b07cc3c3c60b075a7caed462ed96d | [
"MIT"
] | 2 | 2016-05-29T09:41:40.000Z | 2016-07-12T17:47:06.000Z | example_project/urls.py | amarandon/django-audiotracks | e2480ebe555b07cc3c3c60b075a7caed462ed96d | [
"MIT"
] | 10 | 2015-07-16T12:57:41.000Z | 2021-12-05T22:06:22.000Z | from django.conf import settings
from django.conf.urls import url, include
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from main import views
from django.contrib.auth import views as auth_views
from django.views.static import serve
# Uncomment the next two lines to enable the admin:
from django... | 32.321429 | 72 | 0.685083 | from django.conf import settings
from django.conf.urls import url, include
from django.contrib.staticfiles.urls import staticfiles_urlpatterns
from main import views
from django.contrib.auth import views as auth_views
from django.views.static import serve
# Uncomment the next two lines to enable the admin:
from django... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
85ec8b6d8d12f7b35f2c1f28a6864da735f40a62 | 864 | py | Python | mathbox/app/signal/outlier.py | freedeaths/mathbox-py | e294dc1b916bb634807378883b1ba941a924bec5 | [
"MIT"
] | 7 | 2021-12-23T07:03:12.000Z | 2021-12-31T06:35:34.000Z | mathbox/app/signal/outlier.py | freedeaths/mathbox-py | e294dc1b916bb634807378883b1ba941a924bec5 | [
"MIT"
] | 8 | 2021-12-23T06:12:19.000Z | 2022-01-07T15:01:47.000Z | mathbox/app/signal/outlier.py | freedeaths/mathbox-py | e294dc1b916bb634807378883b1ba941a924bec5 | [
"MIT"
] | null | null | null |
# Generalized ESD Test for Outliers
# https://www.itl.nist.gov/div898/handbook/eda/section3/eda35h3.htm | 39.272727 | 89 | 0.675926 | from mathbox.statistics.estimator import mean, std
def noise_outlier(noise, bias=3):
noise_mean = mean(noise)
noise_std = std(noise)
outlier_lo = [(i,x) for i,x in enumerate(noise) if x < noise_mean - bias * noise_std]
outlier_hi = [(i,x) for i,x in enumerate(noise) if x > noise_mean + bias * noise_std... | 0 | 0 | 0 | 0 | 0 | 641 | 0 | 29 | 90 |
9070ee332d8938903159cc96d4620a2bd3b5401c | 397 | py | Python | OS/Syncronization/main.py | prtx/What-I-learned-in-college | 914f6e69beafdf66f53410bc7cd2e5344bf43308 | [
"MIT"
] | null | null | null | OS/Syncronization/main.py | prtx/What-I-learned-in-college | 914f6e69beafdf66f53410bc7cd2e5344bf43308 | [
"MIT"
] | null | null | null | OS/Syncronization/main.py | prtx/What-I-learned-in-college | 914f6e69beafdf66f53410bc7cd2e5344bf43308 | [
"MIT"
] | null | null | null | #!/usr/bin/python
from producer import producer
from scheduler import fcfs
from teller import teller
txt = open('result/processes','w')
txt.write('Processes\n\n')
#Thread(target = producer).start()
producer()
for process in processes:
txt.write(str(process)+'\n')
for i in range(teller_count):
tellers.append( tel... | 16.541667 | 34 | 0.730479 | #!/usr/bin/python
from requirement import *
from producer import producer
from scheduler import fcfs
from teller import teller
txt = open('result/processes','w')
txt.write('Processes\n\n')
#Thread(target = producer).start()
producer()
for process in processes:
txt.write(str(process)+'\n')
for i in range(teller_c... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 23 |
33ee54f7c6793f6de7032a70a6e0460c0d4a6957 | 1,674 | py | Python | floem/programs/queue_custom.py | mangpo/floem | 2ff53dc601237597b299ebf93607d51b82cb8f4c | [
"BSD-2-Clause"
] | 21 | 2018-10-10T18:52:32.000Z | 2022-02-16T12:23:51.000Z | floem/programs/queue_custom.py | mangpo/floem | 2ff53dc601237597b299ebf93607d51b82cb8f4c | [
"BSD-2-Clause"
] | null | null | null | floem/programs/queue_custom.py | mangpo/floem | 2ff53dc601237597b299ebf93607d51b82cb8f4c | [
"BSD-2-Clause"
] | 3 | 2020-04-22T23:09:26.000Z | 2021-09-30T01:35:34.000Z |
n_cores = 2
Enq, Deq, Release = queue.queue_custom('queue', Tuple, 4, n_cores, Tuple.task, enq_output=True)
RxWrite('mysend')
RxPrint('process')
c = Compiler()
c.testing = r'''
Tuple tuples[5];
for(int i=0; i<5;i++) {
tuples[i].task = 10;
tuples[i].val = i;
}
for(int i=0; i<5;i++) {
mysend(&tuples[i]... | 20.666667 | 95 | 0.549582 | from floem import *
n_cores = 2
class Tuple(State):
val = Field(Int)
task = Field(Uint(8))
layout = [val, task]
class Display(Element):
def configure(self):
self.inp = Input(queue.q_buffer)
self.out = Output(queue.q_buffer)
def impl(self):
self.run_c(r'''
q_buffe... | 0 | 0 | 0 | 950 | 0 | 0 | 0 | -2 | 137 |
539ef8f7d8675478ff779ecc18fb39f706cede98 | 14,871 | py | Python | electrum/auxpow.py | ZenyattaAbosom/AbosomElectrum | 02748b0b14e37385d6e77591d122e592740222bf | [
"MIT"
] | 4 | 2020-06-27T22:43:34.000Z | 2021-04-12T02:29:30.000Z | electrum/auxpow.py | ZenyattaAbosom/AbosomElectrum | 02748b0b14e37385d6e77591d122e592740222bf | [
"MIT"
] | 21 | 2020-06-20T15:02:50.000Z | 2021-04-07T10:14:59.000Z | electrum/auxpow.py | ZenyattaAbosom/AbosomElectrum | 02748b0b14e37385d6e77591d122e592740222bf | [
"MIT"
] | 13 | 2020-06-28T08:13:28.000Z | 2021-12-28T00:11:56.000Z | # -*- coding: utf-8 -*-
#
# Electrum-NMC - lightweight Namecoin client
# Copyright (C) 2018 The Namecoin developers
#
# License for all components not part of Electrum-DOGE:
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Sof... | 39.134211 | 161 | 0.721404 | # -*- coding: utf-8 -*-
#
# Electrum-NMC - lightweight Namecoin client
# Copyright (C) 2018 The Namecoin developers
#
# License for all components not part of Electrum-DOGE:
#
# Permission is hereby granted, free of charge, to any person
# obtaining a copy of this software and associated documentation files
# (the "Sof... | 0 | 0 | 0 | 399 | 0 | 8,649 | 0 | 80 | 498 |
2d8bed25eba5b2d701f79d132f9bbf690b6b08da | 545 | py | Python | src/readset.py | Neko250/readset | 22edf00320244be77455e3937e01dd405e478dea | [
"MIT"
] | null | null | null | src/readset.py | Neko250/readset | 22edf00320244be77455e3937e01dd405e478dea | [
"MIT"
] | null | null | null | src/readset.py | Neko250/readset | 22edf00320244be77455e3937e01dd405e478dea | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
def extract(file=None, path=None):
"""
Extract all of the YouTube links within a Headset user-made list.
:param file: headset json export file path
:param path: json path to extract, you can use [JSON Columns](http://json-columns.com) to get it
:return: `list`... | 21.8 | 98 | 0.67156 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import sys
def extract(file=None, path=None):
"""
Extract all of the YouTube links within a Headset user-made list.
:param file: headset json export file path
:param path: json path to extract, you can use [JSON Columns](http://json-columns.com) to get it
:re... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -11 | 23 |
f8ed8a42efb7fd5e2ac5ef6c2ba9004eee3a0b6f | 6,180 | py | Python | svision/viewer/views.py | artkulak/ads-eye-tracking | 693a87600362417361dc2725c3577dcbebf3925e | [
"Unlicense"
] | null | null | null | svision/viewer/views.py | artkulak/ads-eye-tracking | 693a87600362417361dc2725c3577dcbebf3925e | [
"Unlicense"
] | null | null | null | svision/viewer/views.py | artkulak/ads-eye-tracking | 693a87600362417361dc2725c3577dcbebf3925e | [
"Unlicense"
] | 1 | 2022-02-10T11:19:04.000Z | 2022-02-10T11:19:04.000Z | from django.shortcuts import render
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth import authenticate
from django.http import JsonResponse
####################
# IMPORT OTHER LIBS
####################
import os
import numpy as np
from heatmappy import Heatmapper
from heatmappy.video ... | 27.713004 | 184 | 0.625405 | from django.shortcuts import render
from django.http import HttpResponse
from django.contrib.auth.forms import UserCreationForm
from django.contrib.auth import login, authenticate
from django.contrib.auth.models import User
from django.http import JsonResponse
####################
# IMPORT OTHER LIBS
################... | 0 | 0 | 0 | 0 | 0 | 49 | 0 | 39 | 155 |
4c2dfc45b6d9a010d7e553bb3578d11ead92b7c0 | 3,079 | py | Python | py_module_complete.py | Saevon/sublime_pymodule_complete | 92d32dbe341c8278a5665bfa6311d3d4439b8537 | [
"MIT"
] | null | null | null | py_module_complete.py | Saevon/sublime_pymodule_complete | 92d32dbe341c8278a5665bfa6311d3d4439b8537 | [
"MIT"
] | null | null | null | py_module_complete.py | Saevon/sublime_pymodule_complete | 92d32dbe341c8278a5665bfa6311d3d4439b8537 | [
"MIT"
] | null | null | null | import re
SCOPE_RE = re.compile(r'\bsource\.python\b')
LIB_MODULE_RE = re.compile(r'\bsupport\.module\.python\b')
def grab_module(view, cursor):
''' Grabs the entire module path under the cursor '''
word_sel = view.word(cursor)
pos = None
# Are we on a dot right now?
if view.substr(cursor.beg... | 24.830645 | 93 | 0.602793 | import re
from importlib import import_module
import inspect
import sublime_plugin
import sublime
SCOPE_RE = re.compile(r'\bsource\.python\b')
LIB_MODULE_RE = re.compile(r'\bsupport\.module\.python\b')
def format_attr(attr, module):
module_name = module.__name__
pretty_attr = attr
snippet_attr = attr
... | 0 | 0 | 0 | 1,661 | 0 | 426 | 0 | 0 | 135 |
e586b33c1f0991a69d385f1562e8356586b2257e | 13,430 | py | Python | layeredGraphLayouter/crossing/abstractBarycenterPortDistributor.py | Nic30/layeredGraphLayouter | fa792fa8f4b3a781adfbd7756015fbf4b067315b | [
"MIT"
] | 1 | 2020-02-07T15:07:15.000Z | 2020-02-07T15:07:15.000Z | layeredGraphLayouter/crossing/abstractBarycenterPortDistributor.py | Nic30/layeredGraphLayouter | fa792fa8f4b3a781adfbd7756015fbf4b067315b | [
"MIT"
] | null | null | null | layeredGraphLayouter/crossing/abstractBarycenterPortDistributor.py | Nic30/layeredGraphLayouter | fa792fa8f4b3a781adfbd7756015fbf4b067315b | [
"MIT"
] | null | null | null |
"""
Calculates port ranks and distributes ports.
The rank of a port is a floating point number that represents its position
inside the containing layer. This depends on the node order of that layer and on the
port constraints of the nodes. Port ranks are used by {@link ICrossingMinimizationHeuristics
for calculating b... | 42.365931 | 108 | 0.606925 |
"""
Calculates port ranks and distributes ports.
The rank of a port is a floating point number that represents its position
inside the containing layer. This depends on the node order of that layer and on the
port constraints of the nodes. Port ranks are used by {@link ICrossingMinimizationHeuristics
for calculating b... | 0 | 0 | 0 | 12,154 | 0 | 259 | 0 | 134 | 225 |
b9bd1928a2c1d5f03cdbd0cf4d58af342f9134b6 | 592 | py | Python | setup.py | villarrealas/deltasigma | b1c2e9f307d37064ed4163a2682be825b3a44bf2 | [
"BSD-3-Clause"
] | null | null | null | setup.py | villarrealas/deltasigma | b1c2e9f307d37064ed4163a2682be825b3a44bf2 | [
"BSD-3-Clause"
] | null | null | null | setup.py | villarrealas/deltasigma | b1c2e9f307d37064ed4163a2682be825b3a44bf2 | [
"BSD-3-Clause"
] | null | null | null | from setuptools import setup, find_packages
PACKAGENAME = "deltasigma"
VERSION = "0.0.dev"
setup(
name=PACKAGENAME,
version=VERSION,
author="Antonio Villarreal",
author_email="avillarreal@anl.gov",
description="Source code for chopper / halotools implementation to calculate delta sigma.",
lo... | 31.157895 | 100 | 0.724662 | from setuptools import setup, find_packages
PACKAGENAME = "deltasigma"
VERSION = "0.0.dev"
setup(
name=PACKAGENAME,
version=VERSION,
author="Antonio Villarreal",
author_email="avillarreal@anl.gov",
description="Source code for chopper / halotools implementation to calculate delta sigma.",
lo... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
83ed5ef1449300aba87baa249f1d49549d0f1227 | 318 | py | Python | Python/CopyPasta/animation.py | escharf72/Engineering_4_Notebook | bcfd7edf74791cedc2519be66ac79246670116f3 | [
"BSD-Source-Code"
] | 1 | 2020-11-04T15:27:34.000Z | 2020-11-04T15:27:34.000Z | Python/CopyPasta/animation.py | escharf72/Engineering_4_Notebook | bcfd7edf74791cedc2519be66ac79246670116f3 | [
"BSD-Source-Code"
] | null | null | null | Python/CopyPasta/animation.py | escharf72/Engineering_4_Notebook | bcfd7edf74791cedc2519be66ac79246670116f3 | [
"BSD-Source-Code"
] | null | null | null | from picamera import PiCamera
from time import sleep
import keyboard
button = keyboard.is_pressed('h')
camera = PiCamera()
while True:
camera.start_preview()
button.wait_for_press()
print("Button has been pressed!")
sleep(3)
camera.capture('animateImage.jpg')
camera.stop_preview()
| 19.875 | 35 | 0.77673 | from picamera import PiCamera
from time import sleep
from gpiozero import Button
import keyboard
button = keyboard.is_pressed('h')
camera = PiCamera()
while True:
camera.start_preview()
button.wait_for_press()
print("Button has been pressed!")
sleep(3)
camera.capture('animateImage.jpg')
camera.stop_preview()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 22 |
bcead883cb43a65442ccf599bda0b4064946fb5a | 4,716 | py | Python | bin/train-model.py | giuscri/thesis | d7aa0a8476f53ad304495b437841af1a8d6c87d4 | [
"MIT"
] | null | null | null | bin/train-model.py | giuscri/thesis | d7aa0a8476f53ad304495b437841af1a8d6c87d4 | [
"MIT"
] | 10 | 2018-05-11T08:40:48.000Z | 2018-06-29T16:14:27.000Z | bin/train-model.py | giuscri/thesis | d7aa0a8476f53ad304495b437841af1a8d6c87d4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os, sys
import keras.backend as K
import tensorflow as tf
import numpy as np
from argparse import ArgumentParser
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from datasets import mnist
from models import (train, save_to_file, fc_100_100_10, pca_filter... | 41.734513 | 85 | 0.632103 | #!/usr/bin/env python
import os, sys, pickle
import keras.backend as K
import tensorflow as tf
import numpy as np
from argparse import ArgumentParser
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from datasets import mnist
from models import (train, accuracy, save_to_file, fc_100_... | 0 | 0 | 0 | 0 | 0 | 155 | 0 | 78 | 23 |
7ae50bdf807009d9b67b7cff99403c699f653f93 | 3,048 | py | Python | plugin/vimtern.py | shivaghose/vimtern | 2f74ee41cd34106d14362d373ef279501f9b1b5b | [
"MIT"
] | null | null | null | plugin/vimtern.py | shivaghose/vimtern | 2f74ee41cd34106d14362d373ef279501f9b1b5b | [
"MIT"
] | null | null | null | plugin/vimtern.py | shivaghose/vimtern | 2f74ee41cd34106d14362d373ef279501f9b1b5b | [
"MIT"
] | null | null | null | #!/usr/bin/env python
'''
VIMTern.py dispatch work to your intern via Slack from the command line.
'''
from random import randint
from sys import exit, argv
import argparse
import json
import yaml # To load the intrn file
VERBOSE = False
try:
import requests
except ImportError:
print "Unable to import reques... | 27.963303 | 72 | 0.562992 | #!/usr/bin/env python
'''
VIMTern.py dispatch work to your intern via Slack from the command line.
'''
from random import randint
from sys import exit, argv
import argparse
import json
import yaml # To load the intrn file
VERBOSE = False
try:
import requests
except ImportError:
print "Unable to import reques... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9470da2d0635021627dca44b44a547d259bd8a63 | 1,783 | py | Python | src/scs_dfe/display/led_state.py | open-seneca/alphasense_aq_sensor | 12f37f19b4e2fe6f159b127261130d8d3bc48196 | [
"MIT"
] | 1 | 2021-05-10T09:12:13.000Z | 2021-05-10T09:12:13.000Z | src/scs_dfe/display/led_state.py | open-seneca/alphasense_aq_sensor | 12f37f19b4e2fe6f159b127261130d8d3bc48196 | [
"MIT"
] | null | null | null | src/scs_dfe/display/led_state.py | open-seneca/alphasense_aq_sensor | 12f37f19b4e2fe6f159b127261130d8d3bc48196 | [
"MIT"
] | 2 | 2019-03-07T00:25:11.000Z | 2020-02-28T13:45:55.000Z | """
Created on 10 Nov 2018
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
a dummy LED state, to maintain compatibility with the DFE Eng package
"""
# --------------------------------------------------------------------------------------------------------------------
| 24.763889 | 118 | 0.325294 | """
Created on 10 Nov 2018
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
a dummy LED state, to maintain compatibility with the DFE Eng package
"""
from collections import OrderedDict
from scs_core.data.json import JSONable
# ----------------------------------------------------------------------------... | 0 | 161 | 0 | 1,238 | 0 | 0 | 0 | 32 | 69 |
90fdb9009ee72b8b1db38f9c34195a42d71de57f | 2,344 | py | Python | Scripts/001_le_tutoriel_python/s004_les_instructions_de_controle.py | OrangePeelFX/Python-Tutorial | 0d47f194553666304765f5bbc928374b7aec8a48 | [
"MIT"
] | null | null | null | Scripts/001_le_tutoriel_python/s004_les_instructions_de_controle.py | OrangePeelFX/Python-Tutorial | 0d47f194553666304765f5bbc928374b7aec8a48 | [
"MIT"
] | 1 | 2021-06-02T00:28:17.000Z | 2021-06-02T00:28:17.000Z | Scripts/001_le_tutoriel_python/s004_les_instructions_de_controle.py | florianwns/python-scripts | 0d47f194553666304765f5bbc928374b7aec8a48 | [
"MIT"
] | 1 | 2020-01-13T11:08:18.000Z | 2020-01-13T11:08:18.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Les boucles et les instruction de contrle
Quelques exemples de manipulations des boucles et des instructions
"""
# la suite de fibonnaci
a, b = 0, 1
while a < 20:
print(a, end=",") # on idente de 4 espace l'instruction suivante
a, b = b, a+b
print()
if... | 30.051282 | 88 | 0.433447 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Les boucles et les instruction de contrôle
Quelques exemples de manipulations des boucles et des instructions
"""
# la suite de fibonnaci
a, b = 0, 1
while a < 20:
print(a, end=",") # on idente de 4 espace l'instruction suivante
a, b = b, a+b
print()
i... | 22 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e1e1c9c9b3b1d2f9ea5e172e14b36b3bf582c0be | 652 | py | Python | lambda/setup.py | ingalls/ml-enabler | efda973cb3fa9954cbe24cd0963a7b8f5be5ad6f | [
"BSD-2-Clause"
] | null | null | null | lambda/setup.py | ingalls/ml-enabler | efda973cb3fa9954cbe24cd0963a7b8f5be5ad6f | [
"BSD-2-Clause"
] | 6 | 2021-06-08T22:14:52.000Z | 2022-03-12T00:45:58.000Z | lambda/setup.py | ingalls/ml-enabler | efda973cb3fa9954cbe24cd0963a7b8f5be5ad6f | [
"BSD-2-Clause"
] | null | null | null | """Setup."""
from setuptools import setup, find_packages
inst_reqs = [
"mercantile == 1.1.5",
"requests",
"geojson",
"pillow",
"gdal == 2.4.2",
"shapely == 1.6.4",
"affine == 2.3.0",
"numpy == 1.19.0",
"rasterio == 1.1.5"
]
extra_reqs = {"test": ["pytest", "pytest-cov"]}
setup(
... | 21.733333 | 70 | 0.602761 | """Setup."""
from setuptools import setup, find_packages
inst_reqs = [
"mercantile == 1.1.5",
"requests",
"geojson",
"pillow",
"gdal == 2.4.2",
"shapely == 1.6.4",
"affine == 2.3.0",
"numpy == 1.19.0",
"rasterio == 1.1.5"
]
extra_reqs = {"test": ["pytest", "pytest-cov"]}
setup(
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a51f153c8663eebe0dd7b69da625b02703f7e870 | 950 | py | Python | cumm/tensorview/gemm.py | FindDefinition/cumm | 3d58e85b660afa05c20514afe65b8aa3a4995953 | [
"Apache-2.0"
] | 20 | 2021-10-13T03:41:59.000Z | 2022-03-31T07:23:14.000Z | cumm/tensorview/gemm.py | FindDefinition/cumm | 3d58e85b660afa05c20514afe65b8aa3a4995953 | [
"Apache-2.0"
] | 3 | 2021-11-21T11:25:55.000Z | 2022-03-08T06:12:35.000Z | cumm/tensorview/gemm.py | FindDefinition/cumm | 3d58e85b660afa05c20514afe65b8aa3a4995953 | [
"Apache-2.0"
] | 4 | 2021-10-13T03:42:01.000Z | 2022-03-21T13:07:56.000Z | # Copyright 2022 Yan Yan
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | 47.5 | 79 | 0.649474 | # Copyright 2022 Yan Yan
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, soft... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 356 | 23 |
0a6eebd1d93127e3126b0ebdfd4693d4c9e4d3a9 | 2,036 | py | Python | src/cihpc/www/rest/__init__.py | janhybs/ci-hpi | 293740c7af62ecada5744ff663266de2e3d37445 | [
"MIT"
] | 1 | 2020-01-09T13:00:18.000Z | 2020-01-09T13:00:18.000Z | src/cihpc/www/rest/__init__.py | janhybs/ci-hpi | 293740c7af62ecada5744ff663266de2e3d37445 | [
"MIT"
] | null | null | null | src/cihpc/www/rest/__init__.py | janhybs/ci-hpi | 293740c7af62ecada5744ff663266de2e3d37445 | [
"MIT"
] | 2 | 2018-08-12T01:13:28.000Z | 2018-08-13T14:37:28.000Z | #!/bin/python3
# author: Jan Hybs
| 29.507246 | 118 | 0.543222 | #!/bin/python3
# author: Jan Hybs
from loguru import logger
from flask_restful import Resource
from cihpc.common.utils import strings
from cihpc.common.utils import datautils as du
class ConfigurableView(Resource):
def __init__(self):
super(ConfigurableView, self).__init__()
@classmethod
def _... | 0 | 1,635 | 0 | 193 | 0 | 0 | 0 | 59 | 113 |
28bc94dd5ea00429c9ff3030fa52184e52e1be49 | 3,624 | py | Python | src/spinnaker_ros_lsm/venv/lib/python2.7/site-packages/spinn_front_end_common/interface/interface_functions/front_end_common_partitionable_graph_data_specification_writer.py | Roboy/LSM_SpiNNaker_MyoArm | 04fa1eaf78778edea3ba3afa4c527d20c491718e | [
"BSD-3-Clause"
] | 2 | 2020-11-01T13:22:11.000Z | 2020-11-01T13:22:20.000Z | src/spinnaker_ros_lsm/venv/lib/python2.7/site-packages/spinn_front_end_common/interface/interface_functions/front_end_common_partitionable_graph_data_specification_writer.py | Roboy/LSM_SpiNNaker_MyoArm | 04fa1eaf78778edea3ba3afa4c527d20c491718e | [
"BSD-3-Clause"
] | null | null | null | src/spinnaker_ros_lsm/venv/lib/python2.7/site-packages/spinn_front_end_common/interface/interface_functions/front_end_common_partitionable_graph_data_specification_writer.py | Roboy/LSM_SpiNNaker_MyoArm | 04fa1eaf78778edea3ba3afa4c527d20c491718e | [
"BSD-3-Clause"
] | null | null | null |
from spinn_front_end_common.abstract_models.\
abstract_data_specable_vertex import AbstractDataSpecableVertex
| 41.655172 | 78 | 0.678532 | from spinn_machine.utilities.progress_bar import ProgressBar
from spinn_front_end_common.abstract_models.\
abstract_data_specable_vertex import AbstractDataSpecableVertex
from spinn_front_end_common.utilities.utility_objs.executable_targets import \
ExecutableTargets
from spinn_front_end_common.utilities impor... | 0 | 0 | 0 | 3,267 | 0 | 0 | 0 | 152 | 89 |
9d9964d264e68dcb80b3c95e97441214bc9d5263 | 1,719 | py | Python | sveetoy_cli/colors/registry.py | sveetch/sveetoy-cli | b73159e657b9d23e2cffc70869b82c2024439ae1 | [
"MIT"
] | null | null | null | sveetoy_cli/colors/registry.py | sveetch/sveetoy-cli | b73159e657b9d23e2cffc70869b82c2024439ae1 | [
"MIT"
] | 3 | 2017-11-16T00:35:13.000Z | 2017-11-24T23:59:29.000Z | sveetoy_cli/colors/registry.py | sveetch/sveetoy-cli | b73159e657b9d23e2cffc70869b82c2024439ae1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
| 26.446154 | 78 | 0.585224 | # -*- coding: utf-8 -*-
import io, json
from pathlib import Path
class ColorRegistry:
"""
Open, read and store color names maps
Default shipped color registry is used on loading if no specific path is
given to ``load`` method.
"""
def __init__(self):
datas_dirpath = Path(__file__).pa... | 0 | 0 | 0 | 1,629 | 0 | 0 | 0 | -3 | 68 |
19ec1ada2edcd3626071d17e705fddd15c6842f3 | 705 | py | Python | futuquant/testcase/person/eva/quote/test_get_multiple_history_kline.py | hxhxhx88/futuquant | a1b4a875604f1de451ddde4bfa3e713452482b0a | [
"Apache-2.0"
] | null | null | null | futuquant/testcase/person/eva/quote/test_get_multiple_history_kline.py | hxhxhx88/futuquant | a1b4a875604f1de451ddde4bfa3e713452482b0a | [
"Apache-2.0"
] | null | null | null | futuquant/testcase/person/eva/quote/test_get_multiple_history_kline.py | hxhxhx88/futuquant | a1b4a875604f1de451ddde4bfa3e713452482b0a | [
"Apache-2.0"
] | null | null | null | #-*-coding:utf-8-*-
if __name__ == '__main__':
GetMulHtryKl().test1() | 27.115385 | 140 | 0.62695 | #-*-coding:utf-8-*-
from futuquant import *
import pandas
class GetMulHtryKl(object):
def test1(self):
pandas.set_option('display.width',1000)
pandas.set_option('max_columns',1000)
quote_ctx = OpenQuoteContext(host='127.0.0.1',port=11111)
codelist = ['HK.999011']
start = ... | 0 | 0 | 0 | 567 | 0 | 0 | 0 | -6 | 68 |
9473573f60bf4ff2c4fdba5a8b551bc8fd0d7cd6 | 308 | py | Python | _archive/ren2tan/ren2tan.py | oatsu-gh/utau-plugins | c742ed09f6dae3b52d2d1679890194add56f0fd9 | [
"Beerware"
] | 1 | 2021-08-31T00:51:48.000Z | 2021-08-31T00:51:48.000Z | _archive/ren2tan/ren2tan.py | oatsu-gh/utau_plugins | 82f2145fc044a6028f7f7a88a74689797a4b83df | [
"Beerware"
] | null | null | null | _archive/ren2tan/ren2tan.py | oatsu-gh/utau_plugins | 82f2145fc044a6028f7f7a88a74689797a4b83df | [
"Beerware"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2021 oatsu
"""
UTAU
"""
import utaupy
def ren2tan(plugin):
"""
"""
for note in plugin.notes:
note.lyric = note.lyric.split()[-1]
if __name__ == '__main__':
utaupy.utauplugin.run(ren2tan)
| 14.666667 | 43 | 0.649351 | #!/usr/bin/env python3
# Copyright (c) 2021 oatsu
"""
連続音歌詞を空白で区切って単独音にするUTAUプラグイン
"""
import utaupy
def ren2tan(plugin):
"""
歌詞を空白で区切って、空白より後ろ側だけ残す。
"""
for note in plugin.notes:
note.lyric = note.lyric.split()[-1]
if __name__ == '__main__':
utaupy.utauplugin.run(ren2tan)
| 141 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8a58b436d68c59696458a2751cff5fe08edd9a40 | 5,422 | py | Python | cupy/creation/basic.py | fukuta0614/Chainer | 337fe78e1c27924c1195b8b677a9b2cd3ea68828 | [
"MIT"
] | null | null | null | cupy/creation/basic.py | fukuta0614/Chainer | 337fe78e1c27924c1195b8b677a9b2cd3ea68828 | [
"MIT"
] | 1 | 2016-11-09T06:32:32.000Z | 2016-11-09T10:20:04.000Z | cupy/creation/basic.py | fukuta0614/Chainer | 337fe78e1c27924c1195b8b677a9b2cd3ea68828 | [
"MIT"
] | 1 | 2021-05-27T16:52:11.000Z | 2021-05-27T16:52:11.000Z | import cupy
def empty(shape, dtype=float):
"""Returns an array without initializing the elements.
This function currently does not support ``order`` option.
Args:
shape (tuple of ints): Dimensionalities of the array.
dtype: Data type specifier.
Returns:
cupy.ndarray: A new a... | 25.575472 | 79 | 0.629288 | import cupy
def empty(shape, dtype=float):
"""Returns an array without initializing the elements.
This function currently does not support ``order`` option.
Args:
shape (tuple of ints): Dimensionalities of the array.
dtype: Data type specifier.
Returns:
cupy.ndarray: A new a... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
606ef29647dfca7025dc7a7bcba6b2c14ce348cc | 24,399 | py | Python | sciencebeam_gym/trainer/models/pix2pix/pix2pix_model.py | elifesciences/sciencebeam-gym | 3ad654e08775e0c0cdd256753e14093bb5a42d44 | [
"MIT"
] | 25 | 2017-07-25T12:44:55.000Z | 2020-09-30T22:16:50.000Z | sciencebeam_gym/trainer/models/pix2pix/pix2pix_model.py | elifesciences/sciencebeam-gym | 3ad654e08775e0c0cdd256753e14093bb5a42d44 | [
"MIT"
] | 192 | 2017-11-29T08:57:03.000Z | 2022-03-29T18:44:41.000Z | sciencebeam_gym/trainer/models/pix2pix/pix2pix_model.py | elifesciences/sciencebeam-gym | 3ad654e08775e0c0cdd256753e14093bb5a42d44 | [
"MIT"
] | 6 | 2019-02-01T18:49:33.000Z | 2020-07-26T08:18:46.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
UNKNOWN_COLOR = (255, 255, 255)
UNKNOWN_LABEL = 'unknown'
DEFAULT_UNKNOWN_CLASS_WEIGHT = 0.1
def create_model(argv=None):
"""Factory method that creates model to be used by gene... | 33.653793 | 100 | 0.612115 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import logging
import argparse
import json
from functools import reduce
import tensorflow as tf
from tensorflow.python.lib.io.file_io import FileIO # pylint: disable=E0611
from sciencebeam_gym.trainer.data... | 0 | 0 | 0 | 12,276 | 0 | 10,077 | 0 | 695 | 896 |
a59878ebd625530edf2818a79e847570d7a43bc3 | 3,985 | py | Python | dashboard/modules/job/job_head.py | sungho-joo/ray | 7a18d90a2527ba603f3e0444346389c3136bf50e | [
"Apache-2.0"
] | null | null | null | dashboard/modules/job/job_head.py | sungho-joo/ray | 7a18d90a2527ba603f3e0444346389c3136bf50e | [
"Apache-2.0"
] | 30 | 2021-11-05T06:54:54.000Z | 2022-03-19T07:10:33.000Z | dashboard/modules/job/job_head.py | RuofanKong/ray | 60e9737679d93e7e8902dcea0720addb506ddf0a | [
"Apache-2.0"
] | null | null | null | import logging
import ray.dashboard.utils as dashboard_utils
logger = logging.getLogger(__name__)
routes = dashboard_utils.ClassMethodRouteTable
RAY_INTERNAL_JOBS_NAMESPACE = "_ray_internal_jobs_"
JOBS_API_PREFIX = "/api/jobs/"
JOBS_API_ROUTE_LOGS = JOBS_API_PREFIX + "logs"
JOBS_API_ROUTE_SUBMIT = JOBS_API_PREFIX + ... | 36.898148 | 77 | 0.697867 | import aiohttp.web
from functools import wraps
import logging
from typing import Callable
import json
import dataclasses
import ray
import ray.dashboard.utils as dashboard_utils
from ray._private.job_manager import JobManager
from ray._private.runtime_env.packaging import (package_exists,
... | 0 | 2,571 | 86 | 307 | 0 | 76 | 0 | 265 | 245 |
c24074ac9a3cdf8728bde947483d6f521b704136 | 7,589 | py | Python | minispider/__main__.py | leepxrk/scrapy_learn | 7c0aea1c1e312aa16d11926f2421ed00aa92d97f | [
"MIT"
] | null | null | null | minispider/__main__.py | leepxrk/scrapy_learn | 7c0aea1c1e312aa16d11926f2421ed00aa92d97f | [
"MIT"
] | null | null | null | minispider/__main__.py | leepxrk/scrapy_learn | 7c0aea1c1e312aa16d11926f2421ed00aa92d97f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
__version__ = '0.0.3'
if __name__ == '__main__':
main()
| 35.966825 | 112 | 0.58598 | #!/usr/bin/env python
import argparse
from .sql import MiniSpiderSQL
from .scheduler import MiniSpider
from .extractor import Extractor
from .downloader import MiniSpiderDownloader
__version__ = '0.0.3'
def main():
# Make parser for terminal.
description = 'MiniSpider makes it easy to create user-friendly s... | 6 | 0 | 0 | 0 | 0 | 7,318 | 0 | 49 | 134 |
cecda11e8240a03768dc24d5ae13e7860657aad1 | 1,345 | py | Python | invenio_app_ils/ill/mail/tasks.py | masonproffitt/invenio-app-ils | 81dd12aa774d7d70096de77cc526d9b4ca614437 | [
"MIT"
] | null | null | null | invenio_app_ils/ill/mail/tasks.py | masonproffitt/invenio-app-ils | 81dd12aa774d7d70096de77cc526d9b4ca614437 | [
"MIT"
] | null | null | null | invenio_app_ils/ill/mail/tasks.py | masonproffitt/invenio-app-ils | 81dd12aa774d7d70096de77cc526d9b4ca614437 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CERN.
#
# invenio-app-ils is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""ILL mail tasks."""
from invenio_app_ils.ill.errors import ILLError
from invenio_app_ils.ill.mail.factory impor... | 30.568182 | 77 | 0.700372 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2020 CERN.
#
# invenio-app-ils is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""ILL mail tasks."""
from invenio_app_ils.ill.errors import ILLError
from invenio_app_ils.ill.mail.factory impor... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6fec7946842257e2587af351dffd6c086fd072c2 | 413 | py | Python | publications/migrations/0025_publication_is_from_systematic_search.py | gormshackelford/metadataset | ab8a1c0c70a508da37b3a64906ba85c69dd74b6b | [
"MIT"
] | 2 | 2019-12-18T12:00:02.000Z | 2020-03-11T01:15:45.000Z | publications/migrations/0025_publication_is_from_systematic_search.py | gormshackelford/metadataset | ab8a1c0c70a508da37b3a64906ba85c69dd74b6b | [
"MIT"
] | 2 | 2020-06-06T00:01:13.000Z | 2021-06-10T22:09:30.000Z | publications/migrations/0025_publication_is_from_systematic_search.py | gormshackelford/metadataset | ab8a1c0c70a508da37b3a64906ba85c69dd74b6b | [
"MIT"
] | 1 | 2020-01-07T12:28:43.000Z | 2020-01-07T12:28:43.000Z | # Generated by Django 2.0 on 2019-04-02 09:57
| 21.736842 | 52 | 0.627119 | # Generated by Django 2.0 on 2019-04-02 09:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('publications', '0024_auto_20190401_1522'),
]
operations = [
migrations.AddField(
model_name='publication',
name='is_fr... | 0 | 0 | 0 | 301 | 0 | 0 | 0 | 19 | 46 |
8c62f4298524bab607b4dbc094a650eb75802544 | 2,046 | py | Python | spider_package/config.py | hjjia/spider | ae52414b608487523e235d69b6404d9d0c06a931 | [
"MIT"
] | null | null | null | spider_package/config.py | hjjia/spider | ae52414b608487523e235d69b6404d9d0c06a931 | [
"MIT"
] | null | null | null | spider_package/config.py | hjjia/spider | ae52414b608487523e235d69b6404d9d0c06a931 | [
"MIT"
] | null | null | null | # coding:utf8
options = {
'root_url': 'http://www.juooo.com',
'max_count': 1000,
'urlReg': {
'urlRegType': 1,
'urlFull': '',
'urlStr': 'http://(\w+).juooo.com/\w+'
},
'urlData': []
}
| 26.230769 | 75 | 0.529326 | # coding:utf8
import re
options = {
'root_url': 'http://www.juooo.com',
'max_count': 1000,
'urlReg': {
'urlRegType': 1,
'urlFull': '',
'urlStr': 'http://(\w+).juooo.com/\w+'
},
'urlData': []
}
def initOptions():
print '请输入入口url:'
root_url = raw_input('入口url:')
i... | 408 | 0 | 0 | 0 | 0 | 1,647 | 0 | -12 | 45 |
033ec08de916e40e952cee70655dddeca4bcde74 | 31,594 | py | Python | code/src/features.py | bsm8734/BC_stage2_Tabular_data_Classification | e421360f3f6f9016c58bfff2dd20485206e4a365 | [
"MIT"
] | null | null | null | code/src/features.py | bsm8734/BC_stage2_Tabular_data_Classification | e421360f3f6f9016c58bfff2dd20485206e4a365 | [
"MIT"
] | null | null | null | code/src/features.py | bsm8734/BC_stage2_Tabular_data_Classification | e421360f3f6f9016c58bfff2dd20485206e4a365 | [
"MIT"
] | null | null | null |
# Machine learning
# Custom library
from utils import seed_everything
TOTAL_THRES = 300 #
SEED = 42 #
seed_everything(SEED) #
data_dir = '../input/train.csv' # os.environ['SM_CHANNEL_TRAIN']
model_dir = '../model' # os.environ['SM_MODEL_DIR']
'''
year_month ID
binary label
'''
# def ge... | 40.298469 | 161 | 0.620877 | import pandas as pd
import numpy as np
import os, sys, gc, random
import datetime
import dateutil.relativedelta
# Machine learning
from sklearn.preprocessing import LabelEncoder
from sklearn.impute import SimpleImputer
from sklearn.model_selection import StratifiedKFold
from sklearn.metrics import roc_auc_score
# Cus... | 2,760 | 0 | 0 | 0 | 0 | 29,030 | 0 | 109 | 404 |
6987eae1d20eb0280e52f15424abd63287a36aae | 1,576 | py | Python | nlp.py | ktrnka/helpers | b52102d81007301ed576c908c8f9fa5df386abbb | [
"MIT"
] | null | null | null | nlp.py | ktrnka/helpers | b52102d81007301ed576c908c8f9fa5df386abbb | [
"MIT"
] | null | null | null | nlp.py | ktrnka/helpers | b52102d81007301ed576c908c8f9fa5df386abbb | [
"MIT"
] | null | null | null | from __future__ import unicode_literals
from __future__ import print_function
import unicodedata
"""
Very simple assorted helpers for natural language processing that I've used a few times.
"""
_CHAR_TRANSLATIONS = {
# chars to remove
"\u00ae": None,
"\u2122": None,
# chars to normalize that aren't ... | 25.419355 | 117 | 0.616117 | from __future__ import unicode_literals
from __future__ import print_function
import unicodedata
import unittest
"""
Very simple assorted helpers for natural language processing that I've used a few times.
"""
_CHAR_TRANSLATIONS = {
# chars to remove
"\u00ae": None,
"\u2122": None,
# chars to normal... | 0 | 0 | 0 | 235 | 209 | 166 | 0 | -6 | 91 |
f730ed7aa9f9349f15c6cbfc5165fbc8a60781f3 | 1,755 | py | Python | MGSIM/Commands/Genome_download.py | nick-youngblut/MGSIM | 9edae3c170cf5100b3408a853a87e1205e70dd1b | [
"MIT"
] | 3 | 2019-09-02T11:03:40.000Z | 2021-12-13T15:59:06.000Z | MGSIM/Commands/Genome_download.py | nick-youngblut/MGSIM | 9edae3c170cf5100b3408a853a87e1205e70dd1b | [
"MIT"
] | 2 | 2020-11-13T13:04:47.000Z | 2022-02-03T14:58:13.000Z | MGSIM/Commands/Genome_download.py | nick-youngblut/MGSIM | 9edae3c170cf5100b3408a853a87e1205e70dd1b | [
"MIT"
] | 1 | 2020-08-13T12:40:39.000Z | 2020-08-13T12:40:39.000Z | #!/usr/bin/env python
"""
genome_download: downloading genomes
Usage:
genome_download [options] <accession_table>
genome_download -h | --help
genome_download --version
Options:
<accessin_table> Taxon-accession table (see Description).
Use '-' if from STDIN.
-d=<d> Output dir... | 28.770492 | 85 | 0.631339 | #!/usr/bin/env python
"""
genome_download: downloading genomes
Usage:
genome_download [options] <accession_table>
genome_download -h | --help
genome_download --version
Options:
<accessin_table> Taxon-accession table (see Description).
Use '-' if from STDIN.
-d=<d> Output dir... | 0 | 0 | 0 | 0 | 0 | 177 | 0 | 8 | 88 |