hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | 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 125 | 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 125 | 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.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
383255aadb0a4f30a2dc93b8d3cdf2942c4e0940 | 888 | py | Python | routes/huc.py | ua-snap/data-api | a4d34858b70b90a1dc70bd65a0fc95e45a82fbdf | [
"MIT"
] | null | null | null | routes/huc.py | ua-snap/data-api | a4d34858b70b90a1dc70bd65a0fc95e45a82fbdf | [
"MIT"
] | 109 | 2021-07-30T01:29:16.000Z | 2022-03-30T17:49:00.000Z | routes/huc.py | ua-snap/data-api | a4d34858b70b90a1dc70bd65a0fc95e45a82fbdf | [
"MIT"
] | null | null | null | import asyncio
from flask import (
abort,
Blueprint,
Response,
render_template,
request,
current_app as app,
)
# local imports
from . import routes
from luts import huc8_gdf
huc_api = Blueprint("huc_api", __name__)
@routes.route("/huc/")
@routes.route("/huc/abstract/")
@routes.route("/huc... | 18.5 | 64 | 0.670045 | import asyncio
from flask import (
abort,
Blueprint,
Response,
render_template,
request,
current_app as app,
)
# local imports
from . import routes
from luts import huc8_gdf
huc_api = Blueprint("huc_api", __name__)
@routes.route("/huc/")
@routes.route("/huc/abstract/")
def huc_about():
... | 83 | 0 | 44 |
196be76e941f8559099b1eec1c19e1897f52498b | 4,936 | py | Python | python/snapy/netsnmp/unittests/test_netsnmp.py | marineam/nagcat | 445d0efe1fb2ec93c31d1f9d8fa0c0563189ffaf | [
"Apache-2.0"
] | null | null | null | python/snapy/netsnmp/unittests/test_netsnmp.py | marineam/nagcat | 445d0efe1fb2ec93c31d1f9d8fa0c0563189ffaf | [
"Apache-2.0"
] | null | null | null | python/snapy/netsnmp/unittests/test_netsnmp.py | marineam/nagcat | 445d0efe1fb2ec93c31d1f9d8fa0c0563189ffaf | [
"Apache-2.0"
] | null | null | null | # snapy - a python snmp library
#
# Copyright (C) 2009 ITA Software, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 2 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be ... | 29.915152 | 77 | 0.601904 | # snapy - a python snmp library
#
# Copyright (C) 2009 ITA Software, Inc.
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# version 2 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be ... | 3,214 | 793 | 188 |
77065ca8eeb28083cb6ab38da2d7882ed69c641e | 49 | py | Python | tests/__init__.py | UltiRequiem/python-playground | cb17138df7ce5a21f107ded5a97019491d37c8b2 | [
"MIT"
] | 4 | 2021-08-15T03:20:04.000Z | 2021-09-24T03:26:23.000Z | tests/__init__.py | UltiRequiem/python-playground | cb17138df7ce5a21f107ded5a97019491d37c8b2 | [
"MIT"
] | null | null | null | tests/__init__.py | UltiRequiem/python-playground | cb17138df7ce5a21f107ded5a97019491d37c8b2 | [
"MIT"
] | 3 | 2021-08-15T03:20:05.000Z | 2021-08-18T13:26:51.000Z | """
This tells Python that this is a module.
"""
| 12.25 | 40 | 0.653061 | """
This tells Python that this is a module.
"""
| 0 | 0 | 0 |
285e5badd7bc28f47f98206c35e143077e5c010b | 6,966 | py | Python | python_redux/create_store.py | ebrakke/python-redux | 744fbdafe2a546a000285256ffd492add9adeeeb | [
"MIT"
] | 32 | 2016-07-08T17:17:31.000Z | 2021-07-07T02:06:57.000Z | python_redux/create_store.py | ebrakke/python-redux | 744fbdafe2a546a000285256ffd492add9adeeeb | [
"MIT"
] | 2 | 2016-08-09T15:18:18.000Z | 2016-10-26T12:17:52.000Z | python_redux/create_store.py | ebrakke/python-redux | 744fbdafe2a546a000285256ffd492add9adeeeb | [
"MIT"
] | 4 | 2017-04-14T12:07:12.000Z | 2018-11-06T15:16:57.000Z | ACTION_TYPES = {
'INIT': '@@redux/INIT'
}
"""
* Creates a Redux store that holds the state tree.
* The only way to change the data in the store is to call `dispatch()` on it.
*
* There should only be a single store in your app. To specify how different
* parts of the state tree respond to actions, you may combin... | 38.7 | 107 | 0.737439 | ACTION_TYPES = {
'INIT': '@@redux/INIT'
}
"""
* Creates a Redux store that holds the state tree.
* The only way to change the data in the store is to call `dispatch()` on it.
*
* There should only be a single store in your app. To specify how different
* parts of the state tree respond to actions, you may combin... | 5,686 | 0 | 22 |
e8e6bd70369d9b4d22fc312ee9111d08452ada88 | 4,377 | py | Python | anicon.py | NevGi-cpu/anicon | a9092a9bdf5524dd3f4ed8da760637bc7764134f | [
"MIT"
] | null | null | null | anicon.py | NevGi-cpu/anicon | a9092a9bdf5524dd3f4ed8da760637bc7764134f | [
"MIT"
] | null | null | null | anicon.py | NevGi-cpu/anicon | a9092a9bdf5524dd3f4ed8da760637bc7764134f | [
"MIT"
] | null | null | null | from warnings import filterwarnings
from PIL import Image, ImageOps
from jikanpy import Jikan
from requests import get
from time import sleep
import re
import os
print('''Run this in your anime folder
For help, info and memes, check out
https://github.com/notdedsec/anicon
''')
sleep(1)
jikan = Jikan()
filterwarnings(... | 33.159091 | 148 | 0.587846 | from warnings import filterwarnings
from PIL import Image, ImageOps
from jikanpy import Jikan
from requests import get
from time import sleep
import re
import os
print('''Run this in your anime folder
For help, info and memes, check out
https://github.com/notdedsec/anicon
''')
sleep(1)
jikan = Jikan()
filterwarnings(... | 1,848 | 0 | 69 |
2d7c8c3e7f12b4918d898b8410558a4f529cb1b7 | 495 | py | Python | cafeteria/images/migrations/0005_auto_20190608_2217.py | devGW/PostApp | fda99fbc838ee809b1ff28445d66cbd48e2b5016 | [
"MIT"
] | null | null | null | cafeteria/images/migrations/0005_auto_20190608_2217.py | devGW/PostApp | fda99fbc838ee809b1ff28445d66cbd48e2b5016 | [
"MIT"
] | 1 | 2019-08-31T01:07:46.000Z | 2019-09-01T15:10:42.000Z | cafeteria/images/migrations/0005_auto_20190608_2217.py | devGW/PostApp | fda99fbc838ee809b1ff28445d66cbd48e2b5016 | [
"MIT"
] | null | null | null | # Generated by Django 2.2.1 on 2019-06-08 13:17
from django.db import migrations
| 20.625 | 47 | 0.547475 | # Generated by Django 2.2.1 on 2019-06-08 13:17
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('images', '0004_auto_20190607_2340'),
]
operations = [
migrations.RenameField(
model_name='comment',
old_name='Image',
... | 0 | 389 | 23 |
93368abbf091c6ddf0ece731e948fa5ed0e5673d | 2,741 | py | Python | pylith/meshio/DataWriterHDF5Ext.py | cehanagan/pylith | cf5c1c34040460a82f79b6eb54df894ed1b1ee93 | [
"MIT"
] | 93 | 2015-01-08T16:41:22.000Z | 2022-02-25T13:40:02.000Z | pylith/meshio/DataWriterHDF5Ext.py | sloppyjuicy/pylith | ac2c1587f87e45c948638b19560813d4d5b6a9e3 | [
"MIT"
] | 277 | 2015-02-20T16:27:35.000Z | 2022-03-30T21:13:09.000Z | pylith/meshio/DataWriterHDF5Ext.py | sloppyjuicy/pylith | ac2c1587f87e45c948638b19560813d4d5b6a9e3 | [
"MIT"
] | 71 | 2015-03-24T12:11:08.000Z | 2022-03-03T04:26:02.000Z | # ----------------------------------------------------------------------
#
# Brad T. Aagaard, U.S. Geological Survey
# Charles A. Williams, GNS Science
# Matthew G. Knepley, University at Buffalo
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://geodynamics.org).
#
# Copy... | 29.473118 | 102 | 0.59066 | # ----------------------------------------------------------------------
#
# Brad T. Aagaard, U.S. Geological Survey
# Charles A. Williams, GNS Science
# Matthew G. Knepley, University at Buffalo
#
# This code was developed as part of the Computational Infrastructure
# for Geodynamics (http://geodynamics.org).
#
# Copy... | 0 | 0 | 0 |
63cbb36cd3f5d7cfecfe9d1002837f0045e786ca | 1,844 | py | Python | src/neopixel_timer_chaser.py | tobiasbp/micropython | d1c3108f1ab81c70e048eb21b57f3b2f43571b90 | [
"MIT"
] | null | null | null | src/neopixel_timer_chaser.py | tobiasbp/micropython | d1c3108f1ab81c70e048eb21b57f3b2f43571b90 | [
"MIT"
] | null | null | null | src/neopixel_timer_chaser.py | tobiasbp/micropython | d1c3108f1ab81c70e048eb21b57f3b2f43571b90 | [
"MIT"
] | null | null | null | # A timer based LED chaser using adressable LEDs of type WS2812/NeoPixel
# Tested on a an ESP32 running MicroPython
import machine, neopixel
from machine import Timer
# Pin to use for controlling LEDs
LED_STRIP_PIN = 14
# Number of LEDs on LED strip
LED_STRIP_LENGTH = 42
# How many times a second (HZ) to advance the L... | 24.263158 | 84 | 0.699566 | # A timer based LED chaser using adressable LEDs of type WS2812/NeoPixel
# Tested on a an ESP32 running MicroPython
import machine, neopixel
from machine import Timer
# Pin to use for controlling LEDs
LED_STRIP_PIN = 14
# Number of LEDs on LED strip
LED_STRIP_LENGTH = 42
# How many times a second (HZ) to advance the L... | 0 | 0 | 0 |
26208baa0b4c094c9044ed8a1870a25f4fc0b1cf | 36,599 | py | Python | robot-resources/libraries/pybot_jrouter.py | Juniper/nita-robot | 4c7e2514b10f22619532e4368a80b6ebd0545f85 | [
"Apache-2.0"
] | 8 | 2020-12-09T18:37:56.000Z | 2022-01-17T00:50:40.000Z | robot-resources/libraries/pybot_jrouter.py | Juniper/nita-robot | 4c7e2514b10f22619532e4368a80b6ebd0545f85 | [
"Apache-2.0"
] | null | null | null | robot-resources/libraries/pybot_jrouter.py | Juniper/nita-robot | 4c7e2514b10f22619532e4368a80b6ebd0545f85 | [
"Apache-2.0"
] | 2 | 2021-01-04T10:58:55.000Z | 2021-06-09T17:43:22.000Z | #!/usr/bin/env python3
# ******************************************************** # # Project: ... | 44.095181 | 442 | 0.564606 | #!/usr/bin/env python3
# ******************************************************** # # Project: ... | 7,432 | 26,123 | 69 |
5cd7c5f922a241072fc7a9059182d39d3ad7a58d | 1,610 | py | Python | SemanticCube.py | AndresGalaviz/Riper | 70c78259f98ba8f25d4ad6a365a6b494b3ee22f2 | [
"MIT"
] | 1 | 2021-06-22T07:38:39.000Z | 2021-06-22T07:38:39.000Z | SemanticCube.py | AndresGalaviz/Riper | 70c78259f98ba8f25d4ad6a365a6b494b3ee22f2 | [
"MIT"
] | 2 | 2016-11-14T21:09:07.000Z | 2018-02-08T21:01:07.000Z | SemanticCube.py | AndresGalaviz/Riper | 70c78259f98ba8f25d4ad6a365a6b494b3ee22f2 | [
"MIT"
] | null | null | null | from collections import defaultdict
operMap = {
'+' : 0,
'-' : 1,
'*' : 2,
'/' : 3,
'%' : 4,
'=' : 5,
'<' : 6,
'>' : 7,
'<=' : 8,
... | 22.676056 | 67 | 0.471429 | from collections import defaultdict
operMap = {
'+' : 0,
'-' : 1,
'*' : 2,
'/' : 3,
'%' : 4,
'=' : 5,
'<' : 6,
'>' : 7,
'<=' : 8,
... | 104 | 0 | 23 |
4c0522a7d8ac663b9787c83c087c0a0943adba83 | 24,624 | py | Python | pyspark/bigdl/util/common.py | qiuxin2012/BigDL | e3cd7499c0f850eb003163df8f090e7e92841ad0 | [
"Apache-2.0"
] | null | null | null | pyspark/bigdl/util/common.py | qiuxin2012/BigDL | e3cd7499c0f850eb003163df8f090e7e92841ad0 | [
"Apache-2.0"
] | 1 | 2017-09-19T06:18:17.000Z | 2017-09-19T06:18:17.000Z | pyspark/bigdl/util/common.py | qiuxin2012/BigDL | e3cd7499c0f850eb003163df8f090e7e92841ad0 | [
"Apache-2.0"
] | 1 | 2022-02-23T07:56:23.000Z | 2022-02-23T07:56:23.000Z | #
# Copyright 2016 The BigDL Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 34.977273 | 136 | 0.625487 | #
# Copyright 2016 The BigDL Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 6,514 | 5,140 | 759 |
f7cb9be055f18ca194ecae99d1870fe80ea55f5b | 1,109 | py | Python | tests/functional_tests/run_functional_tests.py | EuroPOND/deformetrica | 29cb3a4ecd40d6a19b3ee2a1c5827c4ebab54062 | [
"BSD-3-Clause"
] | 1 | 2020-10-27T07:30:56.000Z | 2020-10-27T07:30:56.000Z | tests/functional_tests/run_functional_tests.py | EuroPOND/deformetrica | 29cb3a4ecd40d6a19b3ee2a1c5827c4ebab54062 | [
"BSD-3-Clause"
] | null | null | null | tests/functional_tests/run_functional_tests.py | EuroPOND/deformetrica | 29cb3a4ecd40d6a19b3ee2a1c5827c4ebab54062 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
import os
import unittest
from functional_tests.data.atlas.skulls.run import AtlasSkulls
from functional_tests.data.atlas.brain_structures.run import AtlasBrainStructures
from functional_tests.data.atlas.digits.run import AtlasDigits
from functional_tests.data.regressio... | 28.435897 | 96 | 0.717764 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
import os
import unittest
from functional_tests.data.atlas.skulls.run import AtlasSkulls
from functional_tests.data.atlas.brain_structures.run import AtlasBrainStructures
from functional_tests.data.atlas.digits.run import AtlasDigits
from functional_tests.data.regressio... | 580 | 0 | 46 |
f58acb41a8e89d1fd42a86732c8baea2aaa858cd | 1,538 | py | Python | py/decorator_ex.py | armundle/scratch | a4c0ecdc2661e59ef8f378644324edb7a9680b37 | [
"MIT"
] | null | null | null | py/decorator_ex.py | armundle/scratch | a4c0ecdc2661e59ef8f378644324edb7a9680b37 | [
"MIT"
] | null | null | null | py/decorator_ex.py | armundle/scratch | a4c0ecdc2661e59ef8f378644324edb7a9680b37 | [
"MIT"
] | null | null | null |
class decoratorWithoutArguments(object):
'''
If there are no decorator arguments, the function to be decorated is passed
to the constructor.
'''
'''
Note:
1. The major constraint on the result of a decorator is that it be callable.
The __call__ method here achieves that.
2. __call... | 23.30303 | 80 | 0.640442 | def decoratorFunction(f):
def newFunc():
print "inside decorator function"
print "entering", f.__name__
f()
print "exited", f.__name__
return newFunc
class decoratorWithoutArguments(object):
'''
If there are no decorator arguments, the function to be decorated is pass... | 531 | 0 | 140 |
ac5abfce774cc29f2045d6524242cc65405f6117 | 1,163 | py | Python | aitextgen/cli.py | artificial-podcast/aitextgen | 6e07361a2f15de7925a3cdefc91d32390b7489c9 | [
"MIT"
] | 1,416 | 2020-05-18T15:41:34.000Z | 2022-03-31T09:39:55.000Z | aitextgen/cli.py | artificial-podcast/aitextgen | 6e07361a2f15de7925a3cdefc91d32390b7489c9 | [
"MIT"
] | 165 | 2020-05-19T00:14:32.000Z | 2022-03-30T16:56:36.000Z | aitextgen/cli.py | artificial-podcast/aitextgen | 6e07361a2f15de7925a3cdefc91d32390b7489c9 | [
"MIT"
] | 156 | 2020-05-18T16:28:17.000Z | 2022-03-24T14:50:31.000Z | from .aitextgen import aitextgen
from .TokenDataset import TokenDataset
from .tokenizers import train_tokenizer
import fire
def aitextgen_cli(**kwargs):
"""Entrypoint for the CLI"""
fire.Fire(
{
"encode": encode_cli,
"train": train_cli,
"generate": generate_cli,
... | 24.744681 | 72 | 0.648323 | from .aitextgen import aitextgen
from .TokenDataset import TokenDataset
from .tokenizers import train_tokenizer
import fire
def aitextgen_cli(**kwargs):
"""Entrypoint for the CLI"""
fire.Fire(
{
"encode": encode_cli,
"train": train_cli,
"generate": generate_cli,
... | 0 | 0 | 0 |
da24f88b5348683a100e8fcf34be0d76768dd8e8 | 66 | py | Python | LRL-main-arena/LRL_main_arena/envs/__init__.py | Robotics-Club-IIT-BHU/LaRoboLiga_PS2Arena | 8fddadb7b7078368ec2e8d6c99d7a5c4a60e8f44 | [
"MIT"
] | 1 | 2022-02-14T11:01:48.000Z | 2022-02-14T11:01:48.000Z | LRL-main-arena/LRL_main_arena/envs/__init__.py | Robotics-Club-IIT-BHU/LaRoboLiga_PS2Arena | 8fddadb7b7078368ec2e8d6c99d7a5c4a60e8f44 | [
"MIT"
] | null | null | null | LRL-main-arena/LRL_main_arena/envs/__init__.py | Robotics-Club-IIT-BHU/LaRoboLiga_PS2Arena | 8fddadb7b7078368ec2e8d6c99d7a5c4a60e8f44 | [
"MIT"
] | 13 | 2022-02-14T12:57:06.000Z | 2022-03-02T11:57:23.000Z | from LRL_main_arena.envs.LaRoboLiga_main import LaRoboLigaPs2Arena | 66 | 66 | 0.924242 | from LRL_main_arena.envs.LaRoboLiga_main import LaRoboLigaPs2Arena | 0 | 0 | 0 |
4feb1591835f34dd864a6548fe3da65c2fa4cd1b | 977 | py | Python | tests/test_0088-read-with-http.py | eic/uproot4 | deb8d88c2643521f372bf5005c51af8926016c7e | [
"BSD-3-Clause"
] | 133 | 2020-05-08T21:34:11.000Z | 2022-03-07T18:12:58.000Z | tests/test_0088-read-with-http.py | eic/uproot4 | deb8d88c2643521f372bf5005c51af8926016c7e | [
"BSD-3-Clause"
] | 269 | 2020-05-13T02:42:24.000Z | 2022-03-24T20:24:16.000Z | tests/test_0088-read-with-http.py | eic/uproot4 | deb8d88c2643521f372bf5005c51af8926016c7e | [
"BSD-3-Clause"
] | 45 | 2020-05-15T17:48:04.000Z | 2022-03-18T19:23:07.000Z | # BSD 3-Clause License; see https://github.com/scikit-hep/uproot4/blob/main/LICENSE
from __future__ import absolute_import
import pytest
import uproot
@pytest.mark.network
@pytest.mark.network
@pytest.mark.network
| 27.138889 | 93 | 0.657114 | # BSD 3-Clause License; see https://github.com/scikit-hep/uproot4/blob/main/LICENSE
from __future__ import absolute_import
import pytest
import uproot
@pytest.mark.network
def test_issue176():
with uproot.open(
"https://starterkit.web.cern.ch/starterkit/data/advanced-python-2019/dalitzdata.root"
) ... | 688 | 0 | 66 |
cd9ff6717c93c6515ce432df8655c8e7c488c943 | 476 | py | Python | 2019/day1/day1.py | st--/advent-of-code | b01ca4502820c972015e940024dbd482f7bc69c2 | [
"MIT"
] | null | null | null | 2019/day1/day1.py | st--/advent-of-code | b01ca4502820c972015e940024dbd482f7bc69c2 | [
"MIT"
] | null | null | null | 2019/day1/day1.py | st--/advent-of-code | b01ca4502820c972015e940024dbd482f7bc69c2 | [
"MIT"
] | null | null | null | import numpy as np
module_masses = load_inputs("input.txt")
module_fuels = map(get_fuel_v2, module_masses)
total = sum(module_fuels)
print("Total: ", total)
| 22.666667 | 48 | 0.653361 | import numpy as np
def get_fuel_v1(mass):
return int(np.floor(mass / 3) - 2)
def get_fuel_v2(mass):
fuel = int(np.floor(mass / 3) - 2)
if fuel <= 0:
return 0
else:
return fuel + get_fuel_v2(fuel)
def load_inputs(filename):
with open(filename) as f:
return [int(line.strip()... | 249 | 0 | 69 |
c24f80e8efcacbe920de67d48e1906505b7cea23 | 11,190 | py | Python | src/prog_track.py | sungheeyun/WikiConverter | 1f1d6f9f5e03a4f30770859c07f2af3adba64f32 | [
"Unlicense"
] | null | null | null | src/prog_track.py | sungheeyun/WikiConverter | 1f1d6f9f5e03a4f30770859c07f2af3adba64f32 | [
"Unlicense"
] | null | null | null | src/prog_track.py | sungheeyun/WikiConverter | 1f1d6f9f5e03a4f30770859c07f2af3adba64f32 | [
"Unlicense"
] | null | null | null | #!/Users/sunyun/anaconda3/bin/python
import sys
import time
import utils
sys.path.append("/Users/sunyun/software/python")
if __name__ == "__main__":
team = Team("MRE")
team.add_member("Caroline", "McQuatt")
team.add_member("Dmitry", "Serpakov")
team.add_member("James", "Roland")
team.add_mem... | 37.17608 | 106 | 0.603843 | #!/Users/sunyun/anaconda3/bin/python
import sys
import time
import utils
sys.path.append("/Users/sunyun/software/python")
class Member(object):
DateFormat = "%m/%d/%y"
# CONSTRUCTOR
def __init__(self, firstName, lastName):
assert isinstance(firstName, str), firstName.__class__
assert ... | 5,081 | 535 | 46 |
a824eb435244e6a72f7ebcfdeca66c141db54231 | 790 | py | Python | src/emutils/geometry/utils.py | emanuele-albini/emutils | d5e3939da8a14b629879f06d87d4bd371e7117ab | [
"MIT"
] | null | null | null | src/emutils/geometry/utils.py | emanuele-albini/emutils | d5e3939da8a14b629879f06d87d4bd371e7117ab | [
"MIT"
] | null | null | null | src/emutils/geometry/utils.py | emanuele-albini/emutils | d5e3939da8a14b629879f06d87d4bd371e7117ab | [
"MIT"
] | null | null | null | import numpy as np
from sklearn.base import BaseEstimator
def scaled_linspace(x: np.ndarray, y: np.ndarray, num: int, scaler: BaseEstimator) -> np.ndarray:
"""Generate a linspace, evenly spaced according to the normalization
Args:
x (np.ndarray): First point
y (np.ndarray): Sencon... | 28.214286 | 97 | 0.629114 | import numpy as np
from sklearn.base import BaseEstimator
def scaled_linspace(x: np.ndarray, y: np.ndarray, num: int, scaler: BaseEstimator) -> np.ndarray:
"""Generate a linspace, evenly spaced according to the normalization
Args:
x (np.ndarray): First point
y (np.ndarray): Sencon... | 0 | 0 | 0 |
3f5153f104031ac88200f645c7d7c5298dd2a17f | 516 | py | Python | train_eval_all.py | jake-g/urban-sound-classification | 9d505732e7ba66d3a9e67ed97d956a7c67814503 | [
"MIT"
] | null | null | null | train_eval_all.py | jake-g/urban-sound-classification | 9d505732e7ba66d3a9e67ed97d956a7c67814503 | [
"MIT"
] | null | null | null | train_eval_all.py | jake-g/urban-sound-classification | 9d505732e7ba66d3a9e67ed97d956a7c67814503 | [
"MIT"
] | 1 | 2018-10-11T07:13:59.000Z | 2018-10-11T07:13:59.000Z | from keras_classifiers import ffn1, ffn2, cnn1, cnn2, train_and_evaluate
from sklearn_classifiers import train_and_evaluate_all
import utils as u
print('\n\nEvaluating DNN Classifiers')
# train_and_evaluate(cnn1, u.FEATURE_SET_SPECS)
# train_and_evaluate(cnn2, u.FEATURE_SET_SPECS)
# train_and_evaluate(ffn1, u.FEATURE... | 36.857143 | 72 | 0.843023 | from keras_classifiers import ffn1, ffn2, cnn1, cnn2, train_and_evaluate
from sklearn_classifiers import train_and_evaluate_all
import utils as u
print('\n\nEvaluating DNN Classifiers')
# train_and_evaluate(cnn1, u.FEATURE_SET_SPECS)
# train_and_evaluate(cnn2, u.FEATURE_SET_SPECS)
# train_and_evaluate(ffn1, u.FEATURE... | 0 | 0 | 0 |
aec74b45141ca131949f6cb261503fcacbc2a87e | 449 | py | Python | userhandling/migrations/0002_auto_20180301_2333.py | staxx6/helloworldsite | f27916828276d1b963a908065b95b33d46971855 | [
"MIT"
] | null | null | null | userhandling/migrations/0002_auto_20180301_2333.py | staxx6/helloworldsite | f27916828276d1b963a908065b95b33d46971855 | [
"MIT"
] | null | null | null | userhandling/migrations/0002_auto_20180301_2333.py | staxx6/helloworldsite | f27916828276d1b963a908065b95b33d46971855 | [
"MIT"
] | null | null | null | # Generated by Django 2.0.2 on 2018-03-01 22:33
from django.db import migrations, models
import django.utils.timezone
| 22.45 | 86 | 0.632517 | # Generated by Django 2.0.2 on 2018-03-01 22:33
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('userhandling', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='profile',
... | 0 | 306 | 23 |
f42f6c353bd59dc76888c331de8dd573115ec720 | 36,175 | py | Python | tfx/extensions/google_cloud_ai_platform/runner_test.py | BACtaki/tfx | 29db845200beccbb0ffa1e1e1a091e314a3a470f | [
"Apache-2.0"
] | 1,813 | 2019-02-04T17:17:30.000Z | 2022-03-29T13:39:30.000Z | tfx/extensions/google_cloud_ai_platform/runner_test.py | BACtaki/tfx | 29db845200beccbb0ffa1e1e1a091e314a3a470f | [
"Apache-2.0"
] | 2,710 | 2019-02-14T00:41:00.000Z | 2022-03-31T07:23:00.000Z | tfx/extensions/google_cloud_ai_platform/runner_test.py | BACtaki/tfx | 29db845200beccbb0ffa1e1e1a091e314a3a470f | [
"Apache-2.0"
] | 731 | 2019-02-04T17:59:18.000Z | 2022-03-31T06:45:51.000Z | # Copyright 2019 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 38.320975 | 89 | 0.666731 | # Copyright 2019 Google LLC. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | 32,738 | 1,786 | 23 |
dbb151e47ad33560056932ad894d00c51fab46ec | 20,997 | py | Python | tests/test_decision_maker/test_default.py | bryanchriswhite/agents-aea | d3f177a963eb855d9528555167255bf2b478f4ba | [
"Apache-2.0"
] | 1 | 2022-01-23T22:28:43.000Z | 2022-01-23T22:28:43.000Z | tests/test_decision_maker/test_default.py | salman6049/agents-aea | d3f177a963eb855d9528555167255bf2b478f4ba | [
"Apache-2.0"
] | null | null | null | tests/test_decision_maker/test_default.py | salman6049/agents-aea | d3f177a963eb855d9528555167255bf2b478f4ba | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the ... | 42.676829 | 100 | 0.655665 | # -*- coding: utf-8 -*-
# ------------------------------------------------------------------------------
#
# Copyright 2018-2019 Fetch.AI Limited
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the ... | 0 | 0 | 0 |
ef1d58f9d80944f576f527aa5ef04b18763b93eb | 4,114 | py | Python | testing/test.py | kyclark/configcode | ca060d5a6a00d64a277165302f90691067a9925e | [
"MIT"
] | null | null | null | testing/test.py | kyclark/configcode | ca060d5a6a00d64a277165302f90691067a9925e | [
"MIT"
] | null | null | null | testing/test.py | kyclark/configcode | ca060d5a6a00d64a277165302f90691067a9925e | [
"MIT"
] | null | null | null | import algorithm_rgb as al
import os
import osgeo.gdal as gdal
import numpy as np
import json
input1 = './test_input/rgb_1_2_E.tif'
input2 = './test_input/rgb_40_11_W.tif'
meta = './meta.json'
# --------------------------------------------------
def test_input_files():
"""Test input files exist"""
assert os... | 27.610738 | 79 | 0.533301 | import algorithm_rgb as al
import os
import osgeo.gdal as gdal
import numpy as np
import json
input1 = './test_input/rgb_1_2_E.tif'
input2 = './test_input/rgb_40_11_W.tif'
meta = './meta.json'
# --------------------------------------------------
def test_input_files():
"""Test input files exist"""
assert os... | 0 | 0 | 0 |
4755e69551d857b4544c2dc764a00bf169bb73b8 | 1,675 | py | Python | cnn_classifier_stepwise/networks/classifier_cnn_feature_extractor_df.py | fgitmichael/SelfSupevisedSkillDiscovery | 60eee11cfd67046190dd2784bf40e97bdbed9d40 | [
"MIT"
] | null | null | null | cnn_classifier_stepwise/networks/classifier_cnn_feature_extractor_df.py | fgitmichael/SelfSupevisedSkillDiscovery | 60eee11cfd67046190dd2784bf40e97bdbed9d40 | [
"MIT"
] | 6 | 2021-02-02T23:00:02.000Z | 2022-01-13T03:13:51.000Z | cnn_classifier_stepwise/networks/classifier_cnn_feature_extractor_df.py | fgitmichael/SelfSupevisedSkillDiscovery | 60eee11cfd67046190dd2784bf40e97bdbed9d40 | [
"MIT"
] | null | null | null | from cnn_classifier_stepwise.base.cnn_classifier_stepwise_base import \
CnnStepwiseClassifierBaseDf
from self_supervised.network.flatten_mlp import FlattenMlpDropout
| 31.603774 | 73 | 0.518806 | from cnn_classifier_stepwise.base.cnn_classifier_stepwise_base import \
CnnStepwiseClassifierBaseDf
from self_supervised.network.flatten_mlp import FlattenMlpDropout
class CnnStepwiseClassifierDiscreteDf(CnnStepwiseClassifierBaseDf):
def create_stepwise_classifier(self,
fea... | 477 | 1,004 | 23 |
63ca05b5723b47440172f0ab0ee76d26a865837b | 5,161 | py | Python | fasta2db.py | tzom/yHydra | 094714069302d0f5ce1913346d8cde8e24c7a59c | [
"MIT"
] | null | null | null | fasta2db.py | tzom/yHydra | 094714069302d0f5ce1913346d8cde8e24c7a59c | [
"MIT"
] | null | null | null | fasta2db.py | tzom/yHydra | 094714069302d0f5ce1913346d8cde8e24c7a59c | [
"MIT"
] | 1 | 2022-01-11T11:30:00.000Z | 2022-01-11T11:30:00.000Z | import Bio,gzip
from Bio import SeqIO
import pyteomics
from pyteomics import mass,fasta
import pyteomics.parser as pyt_parser
import pandas as pd
import numpy as np
import json,os
from tqdm import tqdm
from load_config import CONFIG
MAX_DATABASE_SIZE=100000000
DB_PEPTIDE_MINIMUM_LENGTH=CONFIG['DB_PEPTIDE_MINIMUM_LENG... | 34.871622 | 184 | 0.668863 | import Bio,gzip
from Bio import SeqIO
import pyteomics
from pyteomics import mass,fasta
import pyteomics.parser as pyt_parser
import pandas as pd
import numpy as np
import json,os
from tqdm import tqdm
from load_config import CONFIG
MAX_DATABASE_SIZE=100000000
DB_PEPTIDE_MINIMUM_LENGTH=CONFIG['DB_PEPTIDE_MINIMUM_LENG... | 4,267 | 0 | 95 |
966ac5c04b9427719a495ab99943f542cbdf6e3b | 1,329 | py | Python | w2e2_telnet.py | ibyt32/pynet_test | 3b05d907fa0077d793b47dae36466a56d4ee3ef0 | [
"Apache-2.0"
] | null | null | null | w2e2_telnet.py | ibyt32/pynet_test | 3b05d907fa0077d793b47dae36466a56d4ee3ef0 | [
"Apache-2.0"
] | null | null | null | w2e2_telnet.py | ibyt32/pynet_test | 3b05d907fa0077d793b47dae36466a56d4ee3ef0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
'''
Python and Ansible for Network Engineers
Week 2, Exercise 2
Write a script that connects using telnet to the pynet-rtr1 router. Execute
the 'show ip int brief' command on the router and return the output.
'''
import telnetlib
import time
import sys
TELNET_PORT = 23
TELNET_TIMEOUT = 6
... | 21.786885 | 77 | 0.68924 | #!/usr/bin/env python
'''
Python and Ansible for Network Engineers
Week 2, Exercise 2
Write a script that connects using telnet to the pynet-rtr1 router. Execute
the 'show ip int brief' command on the router and return the output.
'''
import telnetlib
import time
import sys
TELNET_PORT = 23
TELNET_TIMEOUT = 6
def... | 343 | 0 | 77 |
82f12b6e70d344705bdf183ca639845ee55f0e9f | 59,067 | py | Python | src/main.py | simonenicf/Escape-from-Narlilia | cd512860e74d5df81504cccbcb667fdf794c8dda | [
"MIT"
] | null | null | null | src/main.py | simonenicf/Escape-from-Narlilia | cd512860e74d5df81504cccbcb667fdf794c8dda | [
"MIT"
] | 1 | 2020-11-03T13:41:49.000Z | 2020-11-03T14:05:22.000Z | src/main.py | simonenicf/Escape-from-Narlilia | cd512860e74d5df81504cccbcb667fdf794c8dda | [
"MIT"
] | null | null | null | import sys
import time
import random
from menu import Menu
from game_engine import Console, Player
console = Console()
player = Player()
start = True
basement_suprise = ["demon", "open", "closed", "bear"]
sus_building = ["enemy_trap", "human_traffic", "smuggler"]
boat_stuff = ["tip over", "fight", "safe"]
truck_surviv... | 37.502857 | 176 | 0.593089 | import sys
import time
import random
from menu import Menu
from game_engine import Console, Player
console = Console()
player = Player()
start = True
basement_suprise = ["demon", "open", "closed", "bear"]
sus_building = ["enemy_trap", "human_traffic", "smuggler"]
boat_stuff = ["tip over", "fight", "safe"]
truck_surviv... | 55,896 | 0 | 731 |
b5446fa1a409f1ddfa87ca3a6582e45a0ba26a81 | 958 | py | Python | src/sms_gateway/send_message_service.py | RBEGamer/SMSGateway | d2fbba78a8103c338bf6ec0cdc49ee2e42f92b49 | [
"MIT"
] | null | null | null | src/sms_gateway/send_message_service.py | RBEGamer/SMSGateway | d2fbba78a8103c338bf6ec0cdc49ee2e42f92b49 | [
"MIT"
] | null | null | null | src/sms_gateway/send_message_service.py | RBEGamer/SMSGateway | d2fbba78a8103c338bf6ec0cdc49ee2e42f92b49 | [
"MIT"
] | null | null | null | #!/usr/bin/python
import MySQLdb
import serial
import time
try:
con = _mysql.connect('localhost', 'sms_gat', 'sms_gat', 'sms_gateway')
con.query("SELECT VERSION()")
result = con.use_result()
print "MySQL version: %s" % \
result.fetch_row()[0]
except _mysql.Error, e:
... | 17.107143 | 74 | 0.632568 | #!/usr/bin/python
import MySQLdb
import serial
import time
try:
con = _mysql.connect('localhost', 'sms_gat', 'sms_gat', 'sms_gateway')
con.query("SELECT VERSION()")
result = con.use_result()
print "MySQL version: %s" % \
result.fetch_row()[0]
except _mysql.Error, e:
... | 0 | 0 | 0 |
c35cc9241de308bf4411c4f47a3dcfe2d577eb0f | 39,542 | py | Python | domains/wartime/freedonia.py | richardyang/psychsim | 191497d72077fe95cde94a2004a8be6e926c121f | [
"MIT"
] | 23 | 2016-04-08T08:21:12.000Z | 2022-03-15T02:49:12.000Z | domains/wartime/freedonia.py | richardyang/psychsim | 191497d72077fe95cde94a2004a8be6e926c121f | [
"MIT"
] | 3 | 2019-07-22T16:29:07.000Z | 2020-11-06T07:00:16.000Z | domains/wartime/freedonia.py | richardyang/psychsim | 191497d72077fe95cde94a2004a8be6e926c121f | [
"MIT"
] | 12 | 2015-06-07T00:41:31.000Z | 2020-01-10T15:04:43.000Z | """
Example scenario for wartime negotiation.
Provides use cases for both modeling and simulating scenarios.
"""
import sys
from ConfigParser import SafeConfigParser
from argparse import ArgumentParser
import StringIO
from psychsim.pwl import *
from psychsim.reward import *
from psychsim.action import *
from psychsim.... | 49.120497 | 143 | 0.583987 | """
Example scenario for wartime negotiation.
Provides use cases for both modeling and simulating scenarios.
"""
import sys
from ConfigParser import SafeConfigParser
from argparse import ArgumentParser
import StringIO
from psychsim.pwl import *
from psychsim.reward import *
from psychsim.action import *
from psychsim.... | 311 | 0 | 23 |
eb985f55700f2a265775dd46a40eb883b614da8d | 9,835 | py | Python | dysart/messages/messages.py | mcncm/Dysart | 35af07816be7910d6d178d8aa53a291bfbc8d5f6 | [
"MIT"
] | null | null | null | dysart/messages/messages.py | mcncm/Dysart | 35af07816be7910d6d178d8aa53a291bfbc8d5f6 | [
"MIT"
] | 8 | 2018-11-29T18:53:20.000Z | 2019-04-27T18:09:09.000Z | dysart/messages/messages.py | mcncm/Dysart | 35af07816be7910d6d178d8aa53a291bfbc8d5f6 | [
"MIT"
] | 1 | 2019-07-01T17:06:10.000Z | 2019-07-01T17:06:10.000Z | """
Author: mcncm, 2019
Standard output messages for displaying hierarchically-organized data such as
recursively-called status lines.
"""
import os
import sys
import datetime as dt
from functools import wraps
import getpass
import inspect
from io import StringIO
import logging
import platform
import textwrap
import ... | 31.321656 | 80 | 0.597458 | """
Author: mcncm, 2019
Standard output messages for displaying hierarchically-organized data such as
recursively-called status lines.
"""
import os
import sys
import datetime as dt
from functools import wraps
import getpass
import inspect
from io import StringIO
import logging
import platform
import textwrap
import ... | 2,029 | 0 | 155 |
866be4f8d7b5d8776a303296eb74a792deda64dc | 2,208 | py | Python | udiskie/depend.py | fbriere/udiskie | d7b95ae94cdce5d175e8a49fab1c94f7c8d75961 | [
"MIT"
] | null | null | null | udiskie/depend.py | fbriere/udiskie | d7b95ae94cdce5d175e8a49fab1c94f7c8d75961 | [
"MIT"
] | 1 | 2020-11-16T10:31:57.000Z | 2020-11-16T10:31:57.000Z | udiskie/depend.py | dxcSithLord/udiskie | 286700e9eb50ffd5e1a8f2c93bdf66e99901f672 | [
"MIT"
] | null | null | null | """
Make sure that the correct versions of gobject introspection dependencies
are installed.
"""
import os
import logging
from gi import require_version
from .locale import _
require_version('Gio', '2.0')
require_version('GLib', '2.0')
_in_X = bool(os.environ.get('DISPLAY'))
_has_Gtk = (3 if check_version('Gtk... | 25.976471 | 76 | 0.695652 | """
Make sure that the correct versions of gobject introspection dependencies
are installed.
"""
import os
import logging
from gi import require_version
from .locale import _
require_version('Gio', '2.0')
require_version('GLib', '2.0')
def check_call(exc_type, func, *args):
try:
func(*args)
re... | 747 | 0 | 161 |
1bf710d88ae1cd28b88adf24c063c44a5aa069d0 | 280 | py | Python | backend/config/settings/local.py | naaligai/naaligai | 8e3e7bf7f049401701a690cda8cb5cafdc99030a | [
"MIT"
] | null | null | null | backend/config/settings/local.py | naaligai/naaligai | 8e3e7bf7f049401701a690cda8cb5cafdc99030a | [
"MIT"
] | null | null | null | backend/config/settings/local.py | naaligai/naaligai | 8e3e7bf7f049401701a690cda8cb5cafdc99030a | [
"MIT"
] | null | null | null | import dj_database_url
from decouple import config
from .base import * # noqa
SECRET_KEY = 'django-insecure-ibi@xb(j2k@r&%*(*&(^%$%^$%^^&)))5_niq9erpkv%*!&!m9hp'
DEBUG = True
ALLOWED_HOSTS = []
DATABASES = {
'default': dj_database_url.config(default=config('SQLITE_DB'))
}
| 23.333333 | 83 | 0.685714 | import dj_database_url
from decouple import config
from .base import * # noqa
SECRET_KEY = 'django-insecure-ibi@xb(j2k@r&%*(*&(^%$%^$%^^&)))5_niq9erpkv%*!&!m9hp'
DEBUG = True
ALLOWED_HOSTS = []
DATABASES = {
'default': dj_database_url.config(default=config('SQLITE_DB'))
}
| 0 | 0 | 0 |
c264e283773c2df0a3f863fee30309a907451cc6 | 884 | py | Python | AoC_2020_Python/day15.py | nlantau/Codewars_2020_2021 | 055fbf8785ddd52b9f8e8c2b59294ead01852467 | [
"MIT"
] | null | null | null | AoC_2020_Python/day15.py | nlantau/Codewars_2020_2021 | 055fbf8785ddd52b9f8e8c2b59294ead01852467 | [
"MIT"
] | null | null | null | AoC_2020_Python/day15.py | nlantau/Codewars_2020_2021 | 055fbf8785ddd52b9f8e8c2b59294ead01852467 | [
"MIT"
] | null | null | null | # nlantau, 2020-12-15
import copy
import os
# STARTING_NUMBERS = [2, 0, 6, 12, 1, 3]
STARTING_NUMBERS = [0, 3, 6]
if __name__ == "__main__":
main()
| 22.666667 | 49 | 0.524887 | # nlantau, 2020-12-15
import copy
import os
# STARTING_NUMBERS = [2, 0, 6, 12, 1, 3]
STARTING_NUMBERS = [0, 3, 6]
def memory_builder():
mem_list = copy.deepcopy(STARTING_NUMBERS)
for i in range(len(mem_list) - 1, 8, 1):
num = 0
prev_index = i + 1
index = 0
spoken = mem_list[i... | 681 | 0 | 46 |
485844402d69c2a5e93616ff5c7fdbfc6e48fae6 | 918 | py | Python | item_probability/weapon_chances_values/polearm_chances.py | averytorres/WazHack-Clone | e53e9b1b64f3828b20e45d4eeaafcdedf9bc6fda | [
"Unlicense"
] | 1 | 2019-06-21T17:13:35.000Z | 2019-06-21T17:13:35.000Z | item_probability/weapon_chances_values/polearm_chances.py | averytorres/WazHack-Clone | e53e9b1b64f3828b20e45d4eeaafcdedf9bc6fda | [
"Unlicense"
] | 18 | 2019-06-25T00:48:11.000Z | 2019-07-11T17:52:24.000Z | item_probability/weapon_chances_values/polearm_chances.py | averytorres/WazHack-Clone | e53e9b1b64f3828b20e45d4eeaafcdedf9bc6fda | [
"Unlicense"
] | 1 | 2019-06-21T17:08:23.000Z | 2019-06-21T17:08:23.000Z | from random_utils import from_dungeon_level
| 48.315789 | 95 | 0.595861 | from random_utils import from_dungeon_level
def get_polearm_chances(game_map):
wp_en = '-weapon'
chances = {
'Staff'+wp_en : from_dungeon_level([[1, 1]], game_map.dungeon_level),
'Staff of Light'+wp_en : from_dungeon_level([[2, 2]], game_map.dungeon_level),
... | 850 | 0 | 23 |
efe7d8868b0e3081326fc3777f919fed2a1331e2 | 504 | py | Python | Python/Warmup_2/last2.py | RCoon/CodingBat | c5004c03e668c62751dc7f13154c79e25ea34339 | [
"MIT"
] | 1 | 2015-11-06T02:26:50.000Z | 2015-11-06T02:26:50.000Z | Python/Warmup_2/last2.py | RCoon/CodingBat | c5004c03e668c62751dc7f13154c79e25ea34339 | [
"MIT"
] | null | null | null | Python/Warmup_2/last2.py | RCoon/CodingBat | c5004c03e668c62751dc7f13154c79e25ea34339 | [
"MIT"
] | null | null | null | # Given a string, return the count of the number of times that a substring
# length 2 appears in the string and also as the last 2 chars of the string,
# so "hixxxhi" yields 1 (we won't count the end substring).
# last2('hixxhi') --> 1
# last2('xaxxaxaxx') --> 1
# last2('axxxaaxx') --> 2
print(last2('hixxhi'))
print... | 25.2 | 76 | 0.642857 | # Given a string, return the count of the number of times that a substring
# length 2 appears in the string and also as the last 2 chars of the string,
# so "hixxxhi" yields 1 (we won't count the end substring).
# last2('hixxhi') --> 1
# last2('xaxxaxaxx') --> 1
# last2('axxxaaxx') --> 2
def last2(str):
last = str... | 115 | 0 | 23 |
4b639d10e09c20f70524740017f7d90f82be23d6 | 257 | py | Python | bot.py | lcarotenuto/XPensesBot | 49545da41a6f70b9fc686b406ced40ba47815b43 | [
"MIT"
] | null | null | null | bot.py | lcarotenuto/XPensesBot | 49545da41a6f70b9fc686b406ced40ba47815b43 | [
"MIT"
] | null | null | null | bot.py | lcarotenuto/XPensesBot | 49545da41a6f70b9fc686b406ced40ba47815b43 | [
"MIT"
] | null | null | null | from config import *
from gdocument import GDocument
if __name__ == '__main__':
main()
| 18.357143 | 71 | 0.712062 | from config import *
from gdocument import GDocument
def main():
spreadsheet = GDocument(spreadsheet_id=CONSTANTS['SPREADSHEET_ID'])
result = spreadsheet.write_expense("Nuovo Test", 15.5)
print(result)
if __name__ == '__main__':
main()
| 140 | 0 | 23 |
f095b15e36d512ee4a9c390ed703961526864b88 | 132 | py | Python | PyTrinamic/ic/TMC2225/TMC2225_register_variant.py | trinamic-AA/PyTrinamic | b054f4baae8eb6d3f5d2574cf69c232f66abb4ee | [
"MIT"
] | 37 | 2019-01-13T11:08:45.000Z | 2022-03-25T07:18:15.000Z | PyTrinamic/ic/TMC2225/TMC2225_register_variant.py | trinamic-AA/PyTrinamic | b054f4baae8eb6d3f5d2574cf69c232f66abb4ee | [
"MIT"
] | 56 | 2019-02-25T02:48:27.000Z | 2022-03-31T08:45:34.000Z | PyTrinamic/ic/TMC2225/TMC2225_register_variant.py | trinamic-AA/PyTrinamic | b054f4baae8eb6d3f5d2574cf69c232f66abb4ee | [
"MIT"
] | 26 | 2019-01-14T05:20:16.000Z | 2022-03-08T13:27:35.000Z | '''
Created on 17.10.2019
@author: JM
'''
class TMC2225_register_variant:
" ===== TMC2225 register variants ===== "
"..." | 13.2 | 45 | 0.583333 | '''
Created on 17.10.2019
@author: JM
'''
class TMC2225_register_variant:
" ===== TMC2225 register variants ===== "
"..." | 0 | 0 | 0 |
f175dcd7e596b45282c790e9ec431fa77345c357 | 903 | py | Python | tests/test_integration.py | EMCain/python-demo-dates | d4d198cd916bd395ea89744af2057610eef64cb0 | [
"MIT"
] | null | null | null | tests/test_integration.py | EMCain/python-demo-dates | d4d198cd916bd395ea89744af2057610eef64cb0 | [
"MIT"
] | null | null | null | tests/test_integration.py | EMCain/python-demo-dates | d4d198cd916bd395ea89744af2057610eef64cb0 | [
"MIT"
] | null | null | null | import datetime
import unittest
import pytest
from src.info_string import this_year_info_string
| 25.8 | 79 | 0.688815 | import datetime
import unittest
import pytest
from src.info_string import this_year_info_string
class TestThisYearInfoString:
def test_this_year_info_string(self, mock_today):
info = this_year_info_string()
assert info == """Today is Tuesday, May 20, 2014
The first Sundays for 2014 are:
Sunday,... | 701 | 81 | 23 |
b366016944742e959dd7b14ac6a1c3948d1b0fd6 | 2,242 | py | Python | pyqt/qt_main.py | dldldlfma/py_tutorial | efb3ddb4d2fcd26e7086198fe42144d896623ed7 | [
"MIT"
] | null | null | null | pyqt/qt_main.py | dldldlfma/py_tutorial | efb3ddb4d2fcd26e7086198fe42144d896623ed7 | [
"MIT"
] | null | null | null | pyqt/qt_main.py | dldldlfma/py_tutorial | efb3ddb4d2fcd26e7086198fe42144d896623ed7 | [
"MIT"
] | 1 | 2019-10-08T09:07:38.000Z | 2019-10-08T09:07:38.000Z | import sys
import PyQt5
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5 import uic
from pprint import pprint
import cv2 as cv
Calui ='./ui.ui'
if __name__ =='__main__':
app = QApplication(sys.argv)
main_dialog=MainDialog()
main_dialog.show()
app.exec_... | 27.012048 | 104 | 0.620874 | import sys
import PyQt5
from PyQt5.QtGui import *
from PyQt5.QtCore import *
from PyQt5.QtWidgets import *
from PyQt5 import uic
from pprint import pprint
import cv2 as cv
Calui ='./ui.ui'
class MainDialog(QDialog):
def __init__(self):
QDialog.__init__(self, None)
uic.loadUi(Calui,self)
... | 1,765 | 5 | 134 |
663e939a163b47bb7b77a1520c94016e8865a334 | 3,135 | py | Python | libfaceid/classifier.py | anhlbt/faceidsys | 630efe78830360565958621c80d247a6055c7cb4 | [
"MIT"
] | null | null | null | libfaceid/classifier.py | anhlbt/faceidsys | 630efe78830360565958621c80d247a6055c7cb4 | [
"MIT"
] | null | null | null | libfaceid/classifier.py | anhlbt/faceidsys | 630efe78830360565958621c80d247a6055c7cb4 | [
"MIT"
] | null | null | null | from enum import Enum
from sklearn.svm import SVC
from sklearn.tree import DecisionTreeClassifier
from sklearn.naive_bayes import GaussianNB
from sklearn.neighbors import KNeighborsClassifier
from sklearn.ensemble import RandomForestClassifier, AdaBoostClassifier
from sklearn.discriminant_analysis import Quadrati... | 44.15493 | 150 | 0.674003 | from enum import Enum
from sklearn.svm import SVC
from sklearn.tree import DecisionTreeClassifier
from sklearn.naive_bayes import GaussianNB
from sklearn.neighbors import KNeighborsClassifier
from sklearn.ensemble import RandomForestClassifier, AdaBoostClassifier
from sklearn.discriminant_analysis import Quadrati... | 2,089 | 303 | 170 |
1d2d252f14fe73a5873b331a3679030bf116e041 | 538 | py | Python | backend/recommends/api.py | Ladder-Climbers/mayne-code | d355cc56013db4ac2db50fddde3e9d203d965ab6 | [
"MIT"
] | null | null | null | backend/recommends/api.py | Ladder-Climbers/mayne-code | d355cc56013db4ac2db50fddde3e9d203d965ab6 | [
"MIT"
] | null | null | null | backend/recommends/api.py | Ladder-Climbers/mayne-code | d355cc56013db4ac2db50fddde3e9d203d965ab6 | [
"MIT"
] | null | null | null | from utils.api_tools import *
from recommends.douban_top250 import DoubanTop
class DoubanTopAPI(Resource):
"""
获取豆瓣读书 Top250 数据
"""
args_get = reqparse.RequestParser() \
.add_argument("page", help="分页", type=int, required=False, location=["args", ])
@args_required_method(args_get)
| 29.888889 | 87 | 0.659851 | from utils.api_tools import *
from recommends.douban_top250 import DoubanTop
class DoubanTopAPI(Resource):
"""
获取豆瓣读书 Top250 数据
"""
args_get = reqparse.RequestParser() \
.add_argument("page", help="分页", type=int, required=False, location=["args", ])
@args_required_method(args_get)
def... | 199 | 0 | 26 |
82beae2102ce4d483ab3149453053290c8cd4268 | 463 | py | Python | otx_epub/migrations/0005_auto_20161103_0228.py | NYULibraries/dlts-enm-tct-backend | 07455a660fb2cb8bc91a54f7f12d150923678157 | [
"Apache-2.0"
] | null | null | null | otx_epub/migrations/0005_auto_20161103_0228.py | NYULibraries/dlts-enm-tct-backend | 07455a660fb2cb8bc91a54f7f12d150923678157 | [
"Apache-2.0"
] | 2 | 2017-10-30T21:19:07.000Z | 2017-10-31T18:06:30.000Z | otx_epub/migrations/0005_auto_20161103_0228.py | NYULibraries/dlts-enm-tct-backend | 07455a660fb2cb8bc91a54f7f12d150923678157 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-11-03 06:28
from __future__ import unicode_literals
from django.db import migrations, models
| 22.047619 | 63 | 0.62203 | # -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-11-03 06:28
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('otx_epub', '0004_auto_20161102_1547'),
]
operations = [
migrations.AlterField... | 0 | 286 | 23 |
b991c836cd1efdb1cd46d20df8cd246babb4832d | 5,090 | py | Python | src/sv-pipeline/04_variant_resolution/scripts/merge_vcfs.py | talkowski-lab/gnomad-sv-v3-qc | db23760af7bc21a776e14f6ca1fbc213ff0ff9a1 | [
"BSD-3-Clause"
] | null | null | null | src/sv-pipeline/04_variant_resolution/scripts/merge_vcfs.py | talkowski-lab/gnomad-sv-v3-qc | db23760af7bc21a776e14f6ca1fbc213ff0ff9a1 | [
"BSD-3-Clause"
] | null | null | null | src/sv-pipeline/04_variant_resolution/scripts/merge_vcfs.py | talkowski-lab/gnomad-sv-v3-qc | db23760af7bc21a776e14f6ca1fbc213ff0ff9a1 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2018 Matthew Stone <mstone5@mgh.harvard.edu>
# Distributed under terms of the MIT license.
"""
"""
import argparse
import heapq
from collections import deque
import pysam
import svtk.utils as svu
def records_match(record, other):
"""
Test if two ... | 38.270677 | 172 | 0.65501 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright © 2018 Matthew Stone <mstone5@mgh.harvard.edu>
# Distributed under terms of the MIT license.
"""
"""
import argparse
import heapq
from collections import deque
import pysam
import svtk.utils as svu
def records_match(record, other):
"""
Test if two ... | 1,109 | 9 | 99 |
ec0b5a658527f89982886e3eb9289615a64a45ea | 3,783 | py | Python | ngs_utils/jsontemplate/formatters.py | pdiakumis/NGS_Utils | 9eae9f8d5f0e408118d429fde90e297dbac9ae15 | [
"MIT"
] | 3 | 2018-06-06T01:41:51.000Z | 2020-08-20T11:36:06.000Z | ngs_utils/jsontemplate/formatters.py | pdiakumis/NGS_Utils | 9eae9f8d5f0e408118d429fde90e297dbac9ae15 | [
"MIT"
] | 4 | 2019-11-28T03:34:54.000Z | 2021-06-24T23:04:55.000Z | ngs_utils/jsontemplate/formatters.py | pdiakumis/NGS_Utils | 9eae9f8d5f0e408118d429fde90e297dbac9ae15 | [
"MIT"
] | 5 | 2018-03-15T12:43:38.000Z | 2021-06-24T23:12:48.000Z | #!/usr/bin/python -S
"""
formatters.py
This module should implement the standard list of formatters.
It also provides a method LookupChain for *composing lookup chains* for
formatters.
Formatter lookup chaining is not to be confused with plain formatter chaining,
e.g.:
{variable|html|json}
If anyone has any bett... | 25.389262 | 80 | 0.706846 | #!/usr/bin/python -S
"""
formatters.py
This module should implement the standard list of formatters.
It also provides a method LookupChain for *composing lookup chains* for
formatters.
Formatter lookup chaining is not to be confused with plain formatter chaining,
e.g.:
{variable|html|json}
If anyone has any bett... | 499 | 0 | 101 |
2ac2f2c7138d46cab1a9b43042ce9e5dad55ab02 | 3,667 | py | Python | tests/test_script.py | mr-rodgers/ohoh | 239a5c471bd25dd12461c6cb38036841d922fbde | [
"MIT"
] | 2 | 2018-08-27T09:54:52.000Z | 2020-05-14T02:36:04.000Z | tests/test_script.py | te-je/ohoh | 239a5c471bd25dd12461c6cb38036841d922fbde | [
"MIT"
] | null | null | null | tests/test_script.py | te-je/ohoh | 239a5c471bd25dd12461c6cb38036841d922fbde | [
"MIT"
] | null | null | null | from codecs import open
from ohoh import build_parser, DEFAULT_HOST, DEFAULT_PORT
from os import path
import os
import pytest
import sys
import time
@pytest.fixture
@pytest.fixture
@pytest.fixture
@pytest.mark.parametrize("address,expected", [
(None, (DEFAULT_HOST, DEFAULT_PORT)),
("localhost", ("localhost"... | 30.815126 | 81 | 0.671394 | from codecs import open
from ohoh import build_parser, DEFAULT_HOST, DEFAULT_PORT
from os import path
import os
import pytest
import sys
import time
@pytest.fixture
def parser():
return build_parser()
@pytest.fixture
def modfile(request, tmpdir):
def uninstall():
sys.path.remove(tmpdir.strpath)
s... | 2,893 | 0 | 272 |
4881335b5b741dd2fe1f7c57986a2b6d9449df2b | 1,127 | py | Python | src/root_object/progress_circle.py | junhg0211/Kreylin | aae5e1e5ba5cfaadfab6708cb0bf26a75c6dcb7a | [
"Apache-2.0"
] | 1 | 2019-09-11T12:02:53.000Z | 2019-09-11T12:02:53.000Z | src/root_object/progress_circle.py | junhg0211/Kreylin | aae5e1e5ba5cfaadfab6708cb0bf26a75c6dcb7a | [
"Apache-2.0"
] | 8 | 2019-09-11T12:06:54.000Z | 2020-02-09T04:42:13.000Z | src/root_object/progress_circle.py | junhg0211/Kreylin | aae5e1e5ba5cfaadfab6708cb0bf26a75c6dcb7a | [
"Apache-2.0"
] | 1 | 2021-05-24T12:43:07.000Z | 2021-05-24T12:43:07.000Z | from pygame.surface import Surface
import constants
from font import Font
from root_object.circle import Circle
from root_object.text import Text
| 34.151515 | 91 | 0.703638 | from pygame.surface import Surface
import constants
from font import Font
from root_object.circle import Circle
from root_object.text import Text
class ProgressCircle(Circle):
def __init__(self, center_x, center_y, max_radius, width, color, initial_progress=0.0):
super().__init__(center_x, center_y, max_... | 814 | 8 | 157 |
898870cd57396bf911538e521bea5d76091a3465 | 3,104 | py | Python | dbmuxev/__init__.py | prototux/PSA-RE | 7b5e7b9e87ba2bb14fbfc3c4f4ff79985afcd4c8 | [
"Apache-2.0"
] | 30 | 2020-11-27T08:53:37.000Z | 2022-03-24T21:20:48.000Z | dbmuxev/__init__.py | UcefMountacer/PSA-RE | a25dcf2deadc8f9ce2f1d5809f3c2f6818304fc9 | [
"Apache-2.0"
] | 7 | 2021-01-23T20:44:13.000Z | 2022-03-23T04:18:11.000Z | dbmuxev/__init__.py | UcefMountacer/PSA-RE | a25dcf2deadc8f9ce2f1d5809f3c2f6818304fc9 | [
"Apache-2.0"
] | 12 | 2021-01-23T18:01:39.000Z | 2022-03-04T12:08:44.000Z | import os
import glob
import yaml
| 36.952381 | 101 | 0.490335 | import os
import glob
import yaml
class dbmuxev:
def __init__(self, rootdir='.', lang='en'):
self.rootdir = rootdir
self.lang = lang
# Define objects we're going to have
self.archs = None
self.cars = None
def load_all(self):
self.load_archs()
self.load_... | 2,866 | -7 | 211 |
9420f75a4f51fd3a07373d2089ce37f6fd2bcf7f | 1,519 | py | Python | src/adobe/pdfservices/operation/internal/api/dto/request/extract_pdf_outputs.py | hvntravel/pdfservices-python-sdk | af2511604dc2558e43c6be44692fb9faa0e3e8d8 | [
"Apache-2.0"
] | 2 | 2021-11-19T10:00:53.000Z | 2022-01-30T21:19:50.000Z | src/adobe/pdfservices/operation/internal/api/dto/request/extract_pdf_outputs.py | hvntravel/pdfservices-python-sdk | af2511604dc2558e43c6be44692fb9faa0e3e8d8 | [
"Apache-2.0"
] | 1 | 2021-06-26T15:17:21.000Z | 2021-06-26T15:17:21.000Z | src/adobe/pdfservices/operation/internal/api/dto/request/extract_pdf_outputs.py | hvntravel/pdfservices-python-sdk | af2511604dc2558e43c6be44692fb9faa0e3e8d8 | [
"Apache-2.0"
] | 2 | 2022-01-02T16:01:02.000Z | 2022-03-24T01:23:14.000Z | # Copyright 2021 Adobe. All rights reserved.
# This file is licensed to you 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 la... | 44.676471 | 98 | 0.761027 | # Copyright 2021 Adobe. All rights reserved.
# This file is licensed to you 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 la... | 213 | 359 | 22 |
70e8006c645a188c493a251606a2b7455927ab7a | 324 | py | Python | scripts/gen_small.py | jaistark/sp | 911933c65f950e6bc51451840068ca9249554846 | [
"BSD-2-Clause"
] | 28 | 2015-03-04T08:34:40.000Z | 2022-02-13T05:59:11.000Z | scripts/gen_small.py | jaistark/sp | 911933c65f950e6bc51451840068ca9249554846 | [
"BSD-2-Clause"
] | null | null | null | scripts/gen_small.py | jaistark/sp | 911933c65f950e6bc51451840068ca9249554846 | [
"BSD-2-Clause"
] | 14 | 2015-03-04T08:34:42.000Z | 2020-12-08T16:13:37.000Z | import snap
import numpy as np
G = snap.PNGraph.New()
for i in range(6):
G.AddNode(i)
G.AddEdge(0, 1)
G.AddEdge(1, 2)
G.AddEdge(2, 0)
G.AddEdge(3, 4)
G.AddEdge(4, 5)
G.AddEdge(5, 3)
G.AddEdge(4, 3)
G.AddEdge(5, 4)
G.AddEdge(3, 5)
out_file = '../data/small.txt'
print 'data:', out_file
snap.SaveEdgeList(G, out_fi... | 14.727273 | 30 | 0.657407 | import snap
import numpy as np
G = snap.PNGraph.New()
for i in range(6):
G.AddNode(i)
G.AddEdge(0, 1)
G.AddEdge(1, 2)
G.AddEdge(2, 0)
G.AddEdge(3, 4)
G.AddEdge(4, 5)
G.AddEdge(5, 3)
G.AddEdge(4, 3)
G.AddEdge(5, 4)
G.AddEdge(3, 5)
out_file = '../data/small.txt'
print 'data:', out_file
snap.SaveEdgeList(G, out_fi... | 0 | 0 | 0 |
2800eb1fa749d4331920a1ff2abd56ea0c5117a5 | 3,186 | py | Python | web/web/config.py | wellcometrust/reach | 1aa42c7d8aaf0a91d033af8448a33f37563b0365 | [
"MIT"
] | 11 | 2019-11-04T08:24:00.000Z | 2021-12-16T23:11:47.000Z | web/web/config.py | wellcometrust/reach | 1aa42c7d8aaf0a91d033af8448a33f37563b0365 | [
"MIT"
] | 274 | 2019-10-30T15:37:17.000Z | 2021-03-25T16:13:36.000Z | web/web/config.py | wellcometrust/reference-parser | 1aa42c7d8aaf0a91d033af8448a33f37563b0365 | [
"MIT"
] | 3 | 2019-11-12T13:38:14.000Z | 2020-04-16T07:49:04.000Z | import os
import toml
def _or(val_a, val_b, default=None):
""" Used to allow specifying config values through
os.environ
Args:
val_a:
val_b:
"""
if val_a is not None:
return val_a
elif val_b is not None:
return val_b
else:
return default
| 26.114754 | 93 | 0.514124 | import os
import toml
def _or(val_a, val_b, default=None):
""" Used to allow specifying config values through
os.environ
Args:
val_a:
val_b:
"""
if val_a is not None:
return val_a
elif val_b is not None:
return val_b
else:
return default
class Con... | 2,803 | 0 | 72 |
cf4d1dc06ca23c5c3bf5591504594cccc40ce07c | 327 | py | Python | backend/src/crawling/models/script_model.py | nokia-wroclaw/innovativeproject-noticrawl | 2569dfe39492695cc33d0bbcbc675465b14756c0 | [
"MIT"
] | 5 | 2020-03-08T14:38:47.000Z | 2021-02-24T12:17:57.000Z | backend/src/crawling/models/script_model.py | nokia-wroclaw/innovativeproject-noticrawl | 2569dfe39492695cc33d0bbcbc675465b14756c0 | [
"MIT"
] | 35 | 2020-03-13T14:18:00.000Z | 2020-06-16T22:17:39.000Z | backend/src/crawling/models/script_model.py | nokia-wroclaw/innovativeproject-noticrawl | 2569dfe39492695cc33d0bbcbc675465b14756c0 | [
"MIT"
] | 2 | 2020-03-03T20:56:19.000Z | 2020-03-08T14:38:53.000Z | from pydantic import BaseModel
from typing import List
from .notification_model import Notification
| 19.235294 | 44 | 0.730887 | from pydantic import BaseModel
from typing import List
from .notification_model import Notification
class ScriptCreate(BaseModel):
script_name: str
instructions: str
link_id: int
class Script(ScriptCreate):
script_id: int
notifications: List[Notification] = []
class Config:
orm_mode ... | 0 | 180 | 46 |
23af53260bd3539d33274ebeb87ea1d255057d8b | 2,235 | py | Python | tests/test_pages.py | morden35/spatula | cdbcc3231696890af236064a6082232af9d4d407 | [
"MIT"
] | 209 | 2017-02-22T16:38:23.000Z | 2022-03-26T02:07:39.000Z | tests/test_pages.py | morden35/spatula | cdbcc3231696890af236064a6082232af9d4d407 | [
"MIT"
] | 23 | 2017-02-24T06:13:02.000Z | 2022-02-10T21:25:35.000Z | tests/test_pages.py | morden35/spatula | cdbcc3231696890af236064a6082232af9d4d407 | [
"MIT"
] | 7 | 2017-02-24T02:54:23.000Z | 2021-08-05T18:37:14.000Z | import json
from dataclasses import dataclass
from spatula import (
HtmlPage,
XmlPage,
JsonPage,
CsvListPage,
HtmlListPage,
XmlListPage,
JsonListPage,
XPath,
URL,
)
SOURCE = "https://example.com"
@dataclass
| 24.56044 | 76 | 0.620134 | import json
from dataclasses import dataclass
from spatula import (
HtmlPage,
XmlPage,
JsonPage,
CsvListPage,
HtmlListPage,
XmlListPage,
JsonListPage,
XPath,
URL,
)
SOURCE = "https://example.com"
@dataclass
class Response:
content: bytes
@property
def text(self):
... | 1,718 | 81 | 183 |
248892a38a80ac161701d0cdcd65f5d39a6a5009 | 18,274 | py | Python | src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_queue_commands.py | zjpjack/azure-cli | 818a0aa958203131d1fc9a43ecda75bbf5adf8f3 | [
"MIT"
] | null | null | null | src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_queue_commands.py | zjpjack/azure-cli | 818a0aa958203131d1fc9a43ecda75bbf5adf8f3 | [
"MIT"
] | null | null | null | src/azure-cli/azure/cli/command_modules/servicebus/tests/latest/test_servicebus_queue_commands.py | zjpjack/azure-cli | 818a0aa958203131d1fc9a43ecda75bbf5adf8f3 | [
"MIT"
] | null | null | null | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 51.914773 | 181 | 0.656123 | # --------------------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# --------------------------------------------------------------------... | 17,439 | 228 | 23 |
02ac88ad6695c765e9cecca611e77607225378d0 | 1,197 | py | Python | scripts/contributor_counts.py | navgurukul-shivani18/kitsune | a7cf49ab1bfcf4e770938116968824b2b0fa5bb1 | [
"BSD-3-Clause"
] | 4 | 2021-05-17T11:38:08.000Z | 2021-08-19T06:42:39.000Z | scripts/contributor_counts.py | navgurukul-shivani18/kitsune | a7cf49ab1bfcf4e770938116968824b2b0fa5bb1 | [
"BSD-3-Clause"
] | 32 | 2021-04-15T22:35:58.000Z | 2022-01-04T21:30:05.000Z | scripts/contributor_counts.py | navgurukul-shivani18/kitsune | a7cf49ab1bfcf4e770938116968824b2b0fa5bb1 | [
"BSD-3-Clause"
] | 3 | 2020-06-14T06:59:46.000Z | 2020-06-15T14:45:56.000Z | # Shows top posters and percentage of posts from top posters for the
# last 14 days. You need recent data to run this.
#
# Run this with ./manage.py runscript run_contributor_counts.py
from collections import defaultdict
from datetime import datetime, timedelta
from kitsune.forums.models import Post
if __name__ =... | 25.468085 | 78 | 0.692565 | # Shows top posters and percentage of posts from top posters for the
# last 14 days. You need recent data to run this.
#
# Run this with ./manage.py runscript run_contributor_counts.py
from collections import defaultdict
from datetime import datetime, timedelta
from kitsune.forums.models import Post
def run():
... | 776 | 0 | 23 |
8f71d0b7f1f5f348b6bc0d3d81216b11dc4a07f6 | 1,337 | py | Python | fast_reconcile_app/lib/query_parser.py | birkin/fast_reconcile_project | de086e312aae9cd4d2eb847c3a5a5ba94cd68de7 | [
"BSD-3-Clause"
] | null | null | null | fast_reconcile_app/lib/query_parser.py | birkin/fast_reconcile_project | de086e312aae9cd4d2eb847c3a5a5ba94cd68de7 | [
"BSD-3-Clause"
] | null | null | null | fast_reconcile_app/lib/query_parser.py | birkin/fast_reconcile_project | de086e312aae9cd4d2eb847c3a5a5ba94cd68de7 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
import json, logging
log = logging.getLogger(__name__)
def parse_query( request ):
""" Preps and returns three data-elements.
Called by views.reconcile_v2() """
( query, query_type, callback ) = ( request.POST.get('query', None), request.POST.get('query_type', None), request... | 35.184211 | 147 | 0.585639 | # -*- coding: utf-8 -*-
import json, logging
log = logging.getLogger(__name__)
def parse_query( request ):
""" Preps and returns three data-elements.
Called by views.reconcile_v2() """
( query, query_type, callback ) = ( request.POST.get('query', None), request.POST.get('query_type', None), request... | 0 | 0 | 0 |
d3c1f453a11937d08cbe712f78cc03cc5dfc1fc8 | 646 | py | Python | setup.py | Imperial-CMTH/koala | cd05b11be402295468be709db13a957530f66578 | [
"MIT"
] | null | null | null | setup.py | Imperial-CMTH/koala | cd05b11be402295468be709db13a957530f66578 | [
"MIT"
] | 9 | 2021-12-13T10:16:03.000Z | 2022-03-28T10:39:16.000Z | setup.py | Imperial-CMTH/koala | cd05b11be402295468be709db13a957530f66578 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
setup(
name="koala",
version='0.0',
description='Topological Amorphous quantum system simulations',
long_description='',
author="Peru D'Ornellas, Gino Cassella, Tom Hodson",
author_email='',
license='Apache Software License',
home_page='',
... | 23.925926 | 67 | 0.586687 | from setuptools import setup, find_packages
setup(
name="koala",
version='0.0',
description='Topological Amorphous quantum system simulations',
long_description='',
author="Peru D'Ornellas, Gino Cassella, Tom Hodson",
author_email='',
license='Apache Software License',
home_page='',
... | 0 | 0 | 0 |
cb55e13908319613727041b94480632b89fff554 | 2,335 | py | Python | code/behavior_test_coupling_common.py | cedricfoucault/networks_for_sequence_prediction | f2983a9738ec43e03a430f2f194f0359d2bb5bf7 | [
"MIT"
] | 1 | 2021-12-08T01:44:34.000Z | 2021-12-08T01:44:34.000Z | code/behavior_test_coupling_common.py | cedricfoucault/networks_for_sequence_prediction | f2983a9738ec43e03a430f2f194f0359d2bb5bf7 | [
"MIT"
] | null | null | null | code/behavior_test_coupling_common.py | cedricfoucault/networks_for_sequence_prediction | f2983a9738ec43e03a430f2f194f0359d2bb5bf7 | [
"MIT"
] | null | null | null | import numpy as np
| 47.653061 | 83 | 0.617987 | import numpy as np
def get_changes_in_prediction_by_coupled(df):
pre_rep_pgen = df["pre_rep_pgen"].iloc[0]
pre_other_pgen_values = df["pre_other_pgen"].unique()
rep_lengths = df["rep_length"].unique()
n_rep_lengths = len(rep_lengths)
# get number of models per condition
pre_other_pgen = pre_oth... | 2,293 | 0 | 23 |
6eab78bbc612df07c843ed5785bdecb5c317b639 | 1,119 | py | Python | test/testPhiGradx.py | EmoryMLIP/OT-Flow | c1851a4da3aa131df1df6132b83d5186c154087e | [
"MIT"
] | 31 | 2020-06-18T10:51:03.000Z | 2022-03-10T19:58:36.000Z | test/testPhiGradx.py | EmoryMLIP/OT-Flow | c1851a4da3aa131df1df6132b83d5186c154087e | [
"MIT"
] | null | null | null | test/testPhiGradx.py | EmoryMLIP/OT-Flow | c1851a4da3aa131df1df6132b83d5186c154087e | [
"MIT"
] | 8 | 2020-09-09T23:52:50.000Z | 2022-03-11T21:19:20.000Z | # testPhiGradx.py
# test the grad wrt x returned by trHess when nTh > 2
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
from src.Phi import *
import torch.nn.utils
doPlots = True
d = 2
m = 5
nTh = 4
net = Phi(nTh=nTh, m=m, d=d)
net.double()
# vecParams = nn.utils.convert_parameters.parame... | 18.65 | 86 | 0.580876 | # testPhiGradx.py
# test the grad wrt x returned by trHess when nTh > 2
import matplotlib
matplotlib.use('TkAgg')
import matplotlib.pyplot as plt
from src.Phi import *
import torch.nn.utils
doPlots = True
d = 2
m = 5
nTh = 4
net = Phi(nTh=nTh, m=m, d=d)
net.double()
# vecParams = nn.utils.convert_parameters.parame... | 0 | 0 | 0 |
a660a6550f4dfbea6c622a3907992cd131a52dfb | 608 | py | Python | CubeNet/__init__.py | Billy-Chen0327/CubeNet | 7df1758b12f0e561d57f1367d9279ea1b0bcc358 | [
"MIT"
] | null | null | null | CubeNet/__init__.py | Billy-Chen0327/CubeNet | 7df1758b12f0e561d57f1367d9279ea1b0bcc358 | [
"MIT"
] | null | null | null | CubeNet/__init__.py | Billy-Chen0327/CubeNet | 7df1758b12f0e561d57f1367d9279ea1b0bcc358 | [
"MIT"
] | null | null | null | import os
import torch
import CubeNet.net
import CubeNet.Picker
import CubeNet.config
network = CubeNet.net.UNet(); network.load_state_dict(torch.load(os.path.join(os.path.split(CubeNet.__file__)[0],'Para.pt')));
picker = CubeNet.Picker.IrrPicker(arr_info=CubeNet.config.arr_info,
para... | 46.769231 | 126 | 0.605263 | import os
import torch
import CubeNet.net
import CubeNet.Picker
import CubeNet.config
network = CubeNet.net.UNet(); network.load_state_dict(torch.load(os.path.join(os.path.split(CubeNet.__file__)[0],'Para.pt')));
picker = CubeNet.Picker.IrrPicker(arr_info=CubeNet.config.arr_info,
para... | 0 | 0 | 0 |
5e6b2448983c0f9de7f4ca47156c2801fef30890 | 12,703 | py | Python | async_pokepy/types/move.py | PendragonLore/async_pokepy | 9982505fbc360eae349086bfa8f6faad0133f5fa | [
"MIT"
] | 5 | 2019-05-30T21:45:24.000Z | 2021-11-07T20:35:40.000Z | async_pokepy/types/move.py | PendragonLore/async_pokepy | 9982505fbc360eae349086bfa8f6faad0133f5fa | [
"MIT"
] | null | null | null | async_pokepy/types/move.py | PendragonLore/async_pokepy | 9982505fbc360eae349086bfa8f6faad0133f5fa | [
"MIT"
] | 1 | 2019-05-10T19:21:51.000Z | 2019-05-10T19:21:51.000Z | # -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2019 Lorenzo
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, ... | 38.847095 | 120 | 0.666929 | # -*- coding: utf-8 -*-
"""
The MIT License (MIT)
Copyright (c) 2019 Lorenzo
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction, including without limitation
the rights to use, ... | 3,344 | 0 | 351 |
39a1a8cc5e43dabfe72f249a0919d5b4a9544d01 | 305 | py | Python | Chapter 09/Chap9_2.py | bpbpublications/Building-Machine-Learning-Systems-Using-Python | 42df3c10b92fceba49d89afe7610ee075a79f0c3 | [
"MIT"
] | null | null | null | Chapter 09/Chap9_2.py | bpbpublications/Building-Machine-Learning-Systems-Using-Python | 42df3c10b92fceba49d89afe7610ee075a79f0c3 | [
"MIT"
] | null | null | null | Chapter 09/Chap9_2.py | bpbpublications/Building-Machine-Learning-Systems-Using-Python | 42df3c10b92fceba49d89afe7610ee075a79f0c3 | [
"MIT"
] | 1 | 2021-11-30T03:55:51.000Z | 2021-11-30T03:55:51.000Z | #!/usr/bin/env python
# coding: utf-8
# In[8]:
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns; sns.set()
ranstat = np.random.RandomState(1)
P = np.dot(ranstat.rand(2, 2), ranstat.randn(2, 600)).T
plt.scatter(P[:, 0], P[:, 1])
plt.axis('equal');
# In[ ]:
# In[ ]:
| 11.296296 | 55 | 0.613115 | #!/usr/bin/env python
# coding: utf-8
# In[8]:
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns; sns.set()
ranstat = np.random.RandomState(1)
P = np.dot(ranstat.rand(2, 2), ranstat.randn(2, 600)).T
plt.scatter(P[:, 0], P[:, 1])
plt.axis('equal');
# In[ ]:
# In[ ]:
| 0 | 0 | 0 |
58e7fe168632890239c09de539821e02be580e50 | 4,024 | py | Python | firepy/vm.py | gamgi/firepy | fea859de4a8eaff78d4cf1ee7c3fe1b0467a77c6 | [
"MIT"
] | null | null | null | firepy/vm.py | gamgi/firepy | fea859de4a8eaff78d4cf1ee7c3fe1b0467a77c6 | [
"MIT"
] | null | null | null | firepy/vm.py | gamgi/firepy | fea859de4a8eaff78d4cf1ee7c3fe1b0467a77c6 | [
"MIT"
] | null | null | null | from typing import Optional
from functools import wraps
from io import StringIO
from sh import RunningCommand
from requests.exceptions import ConnectionError, HTTPError
from firepy.connection import Connection
from firepy.exceptions import err_from_stderr, FirecrackerApiError
from firepy.utils.network_utils import netw... | 30.717557 | 106 | 0.605616 | from typing import Optional
from functools import wraps
from io import StringIO
from sh import RunningCommand
from requests.exceptions import ConnectionError, HTTPError
from firepy.connection import Connection
from firepy.exceptions import err_from_stderr, FirecrackerApiError
from firepy.utils.network_utils import netw... | 2,727 | 584 | 49 |
7f76cdc498d8ee42a21ab0dd328e6c52f1a68666 | 3,115 | py | Python | guacamol/assess_goal_directed_generation.py | jcheminform/guacamol | dd7f7b12e1ab59151394aba5f4a95ee204fd0203 | [
"MIT"
] | 242 | 2018-11-29T13:34:13.000Z | 2022-03-26T19:35:17.000Z | guacamol/assess_goal_directed_generation.py | jcheminform/guacamol | dd7f7b12e1ab59151394aba5f4a95ee204fd0203 | [
"MIT"
] | 13 | 2019-01-31T03:33:36.000Z | 2022-01-03T07:03:19.000Z | guacamol/assess_goal_directed_generation.py | jcheminform/guacamol | dd7f7b12e1ab59151394aba5f4a95ee204fd0203 | [
"MIT"
] | 68 | 2018-11-26T10:03:41.000Z | 2022-03-28T20:58:20.000Z | import datetime
import json
import logging
from collections import OrderedDict
from typing import List, Any, Dict
import guacamol
from guacamol.goal_directed_benchmark import GoalDirectedBenchmark, GoalDirectedBenchmarkResult
from guacamol.goal_directed_generator import GoalDirectedGenerator
from guacamol.benchmark_su... | 42.094595 | 103 | 0.727127 | import datetime
import json
import logging
from collections import OrderedDict
from typing import List, Any, Dict
import guacamol
from guacamol.goal_directed_benchmark import GoalDirectedBenchmark, GoalDirectedBenchmarkResult
from guacamol.goal_directed_generator import GoalDirectedGenerator
from guacamol.benchmark_su... | 0 | 0 | 0 |
facca4b14c67e4e1d8ac316092e1291cd1b25954 | 41,540 | py | Python | icebox/icebox_asc2hlc.py | sandeepmistry/icestorm | 8f61acd0556c8afee83ec2e77dedb03e700333d9 | [
"0BSD"
] | 6 | 2017-11-11T18:05:30.000Z | 2020-02-24T11:21:03.000Z | icebox/icebox_asc2hlc.py | sandeepmistry/icestorm | 8f61acd0556c8afee83ec2e77dedb03e700333d9 | [
"0BSD"
] | null | null | null | icebox/icebox_asc2hlc.py | sandeepmistry/icestorm | 8f61acd0556c8afee83ec2e77dedb03e700333d9 | [
"0BSD"
] | null | null | null | #!/usr/bin/env python3
# Copyright (C) 2017 Roland Lutz
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE ... | 36.599119 | 80 | 0.489769 | #!/usr/bin/env python3
# Copyright (C) 2017 Roland Lutz
#
# Permission to use, copy, modify, and/or distribute this software for any
# purpose with or without fee is hereby granted, provided that the above
# copyright notice and this permission notice appear in all copies.
#
# THE SOFTWARE IS PROVIDED "AS IS" AND THE ... | 36,520 | -37 | 945 |
05d92b04d413dacbb9211204082fc281df9cc64b | 753 | py | Python | tests/streamer/test_encoder.py | Hikki12/remio | 17942bffe3c0619d3435b1a12399b116d4c800e3 | [
"Apache-2.0"
] | null | null | null | tests/streamer/test_encoder.py | Hikki12/remio | 17942bffe3c0619d3435b1a12399b116d4c800e3 | [
"Apache-2.0"
] | null | null | null | tests/streamer/test_encoder.py | Hikki12/remio | 17942bffe3c0619d3435b1a12399b116d4c800e3 | [
"Apache-2.0"
] | null | null | null | import time
import numpy as np
from remio import MJPEGEncoder
encoderParams = {
"quality": 60,
"colorspace": "bgr",
"colorsubsampling": "422",
"fastdct": True,
}
def test_encoder():
"""Test socket encoder class."""
max_encoding_time = 0.02 # seconds
encoder = MJPEGEncoder(**encoderPara... | 24.290323 | 77 | 0.641434 | import time
import numpy as np
from remio import MJPEGEncoder
encoderParams = {
"quality": 60,
"colorspace": "bgr",
"colorsubsampling": "422",
"fastdct": True,
}
def read_frame():
return np.random.randint(255, size=(1024, 720, 3), dtype=np.uint8)
def test_encoder():
"""Test socket encoder ... | 67 | 0 | 23 |
ae128645d44c35a30a1735da1aacecba7280f741 | 5,833 | py | Python | minesweeper.py | snow-apple/AoPS-games | ff6f922e77e64c8a3f83e2191c8435b2d28660b3 | [
"Apache-2.0"
] | null | null | null | minesweeper.py | snow-apple/AoPS-games | ff6f922e77e64c8a3f83e2191c8435b2d28660b3 | [
"Apache-2.0"
] | null | null | null | minesweeper.py | snow-apple/AoPS-games | ff6f922e77e64c8a3f83e2191c8435b2d28660b3 | [
"Apache-2.0"
] | 1 | 2020-09-16T19:37:37.000Z | 2020-09-16T19:37:37.000Z | # Python Class 2344
# Lesson 10 Problem 1
# Author: snowapple (471208)
import random
from tkinter import *
import tkinter.messagebox as messagebox
play_minesweeper(12, 10, 15)
| 32.405556 | 101 | 0.547917 | # Python Class 2344
# Lesson 10 Problem 1
# Author: snowapple (471208)
import random
from tkinter import *
import tkinter.messagebox as messagebox
class MinesweeperCell(Label):
def __init__(self, master, coord):
Label.__init__(
self, master, height=1, width=2, text="", bg="white", font=("Aria... | 5,247 | 12 | 391 |
4e515cc5b2a6e9d930b1ae6c2b6836567c9b41c6 | 1,231 | py | Python | casepro/msg_board/migrations/0004_alter_messageboardcomment_content_type_and_more.py | rapidpro/ureport-partners | 16e5b95eae36ecbbe8ab2a59f34a2f5fd32ceacd | [
"BSD-3-Clause"
] | null | null | null | casepro/msg_board/migrations/0004_alter_messageboardcomment_content_type_and_more.py | rapidpro/ureport-partners | 16e5b95eae36ecbbe8ab2a59f34a2f5fd32ceacd | [
"BSD-3-Clause"
] | null | null | null | casepro/msg_board/migrations/0004_alter_messageboardcomment_content_type_and_more.py | rapidpro/ureport-partners | 16e5b95eae36ecbbe8ab2a59f34a2f5fd32ceacd | [
"BSD-3-Clause"
] | null | null | null | # Generated by Django 4.0.1 on 2022-01-12 15:28
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
| 30.775 | 66 | 0.583266 | # Generated by Django 4.0.1 on 2022-01-12 15:28
import django.db.models.deletion
from django.conf import settings
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("contenttypes", "0002_remove_content_type_name"),
migrations.swappable_dependency(se... | 0 | 1,051 | 23 |
49b502f6bf9afc0b6f3a4c3df18f489fc992d0f8 | 4,153 | py | Python | Video_to_Image.py | Neutrino3316/First-Impression | 00b7cebe8391c7c30b36de9c4ce5d9732daaf34d | [
"MIT"
] | 24 | 2018-12-07T13:53:37.000Z | 2022-01-11T11:54:34.000Z | Video_to_Image.py | Neutrino3316/First-Impression | 00b7cebe8391c7c30b36de9c4ce5d9732daaf34d | [
"MIT"
] | 6 | 2018-02-27T09:28:57.000Z | 2020-09-08T15:37:56.000Z | Video_to_Image.py | Neutrino3316/First-Impression | 00b7cebe8391c7c30b36de9c4ce5d9732daaf34d | [
"MIT"
] | 21 | 2018-05-25T10:56:44.000Z | 2022-02-24T08:06:24.000Z | '''
Extract all the 6 training zipped files and 2 validation zipped files into data folder and then run this script
'''
import cv2
import numpy as np
import os
import zipfile
## Runnin a loop throught all the zipped training file to extract all video and then extract 100 frames from each.
for i in range(1,76):
if ... | 38.453704 | 114 | 0.603419 | '''
Extract all the 6 training zipped files and 2 validation zipped files into data folder and then run this script
'''
import cv2
import numpy as np
import os
import zipfile
## Runnin a loop throught all the zipped training file to extract all video and then extract 100 frames from each.
for i in range(1,76):
if ... | 0 | 0 | 0 |
d9209983fe3230c55c6541ed80c5107adddb2a90 | 393 | py | Python | aos_vs_soa/plot.py | christopher-besch/cpp_go_fast | 1f9090a70e4e15882334aa92ba021c5103ae7a33 | [
"MIT"
] | 3 | 2021-08-03T12:33:04.000Z | 2021-10-29T18:58:13.000Z | aos_vs_soa/plot.py | christopher-besch/cpp_go_fast | 1f9090a70e4e15882334aa92ba021c5103ae7a33 | [
"MIT"
] | null | null | null | aos_vs_soa/plot.py | christopher-besch/cpp_go_fast | 1f9090a70e4e15882334aa92ba021c5103ae7a33 | [
"MIT"
] | null | null | null | import pandas as pd
import matplotlib.pyplot as plt
import glob, os
aos_data = pd.read_csv("aos.csv")
soa_data = pd.read_csv("soa.csv")
plt.loglog(aos_data["n"],aos_data["time"],"o",markersize=1,label="aos")
plt.loglog(soa_data["n"],soa_data["time"],"o",markersize=1,label="soa")
plt.title("aos vs soa")
plt.legend()
plt... | 28.071429 | 71 | 0.715013 | import pandas as pd
import matplotlib.pyplot as plt
import glob, os
aos_data = pd.read_csv("aos.csv")
soa_data = pd.read_csv("soa.csv")
plt.loglog(aos_data["n"],aos_data["time"],"o",markersize=1,label="aos")
plt.loglog(soa_data["n"],soa_data["time"],"o",markersize=1,label="soa")
plt.title("aos vs soa")
plt.legend()
plt... | 0 | 0 | 0 |
50c3be7c7f58a98919788b196f8130825769342b | 3,472 | py | Python | setup.py | isislovecruft/txtorcon | 9523319cecbc1d0aa8fdb4d6874f0debc22d0432 | [
"MIT"
] | null | null | null | setup.py | isislovecruft/txtorcon | 9523319cecbc1d0aa8fdb4d6874f0debc22d0432 | [
"MIT"
] | null | null | null | setup.py | isislovecruft/txtorcon | 9523319cecbc1d0aa8fdb4d6874f0debc22d0432 | [
"MIT"
] | null | null | null | try:
import pypissh
except:
print "WARNING: not using PyPi over SSH!"
import sys
import os
import shutil
import re
from setuptools import setup
## can't just naively import these from txtorcon, as that will only
## work if you already installed the dependencies :(
__version__ = '0.13.0'
__author__ = 'meejah'
_... | 42.864198 | 277 | 0.575461 | try:
import pypissh
except:
print "WARNING: not using PyPi over SSH!"
import sys
import os
import shutil
import re
from setuptools import setup
## can't just naively import these from txtorcon, as that will only
## work if you already installed the dependencies :(
__version__ = '0.13.0'
__author__ = 'meejah'
_... | 0 | 0 | 0 |
df6b1c0fb9ac1a4e25419b4ad34f691009e681fb | 420 | py | Python | packages/pyright-internal/src/tests/samples/unusedVariable1.py | martindemello/pyright | 4fe3f1f7c08f139715701fdf746183062b5165ff | [
"MIT"
] | 4,391 | 2019-05-07T01:18:57.000Z | 2022-03-31T20:45:44.000Z | packages/pyright-internal/src/tests/samples/unusedVariable1.py | martindemello/pyright | 4fe3f1f7c08f139715701fdf746183062b5165ff | [
"MIT"
] | 2,740 | 2019-05-07T03:29:30.000Z | 2022-03-31T12:57:46.000Z | packages/pyright-internal/src/tests/samples/unusedVariable1.py | martindemello/pyright | 4fe3f1f7c08f139715701fdf746183062b5165ff | [
"MIT"
] | 455 | 2019-05-07T12:55:14.000Z | 2022-03-31T17:09:15.000Z | # This sample tests the reportUnusedVariable diagnostic check.
| 19.090909 | 75 | 0.619048 | # This sample tests the reportUnusedVariable diagnostic check.
def func1(a: int):
x = 4
# This should generate an error if reportUnusedVariable is enabled.
y = x
_z = 4
_ = 2
__z__ = 5
if x + 1:
# This should generate an error if reportUnusedVariable is enabled.
z = 3
... | 333 | 0 | 23 |
b3d857944d0e5a13fa7cbc6cbf18f73987689aa2 | 6,200 | py | Python | utils.py | Julienbeaulieu/Deeplearing-Image-Classifier-with-Pytorch | 0c7274ce3d864800f083ba884039771b96d020e0 | [
"MIT"
] | null | null | null | utils.py | Julienbeaulieu/Deeplearing-Image-Classifier-with-Pytorch | 0c7274ce3d864800f083ba884039771b96d020e0 | [
"MIT"
] | null | null | null | utils.py | Julienbeaulieu/Deeplearing-Image-Classifier-with-Pytorch | 0c7274ce3d864800f083ba884039771b96d020e0 | [
"MIT"
] | null | null | null | # Imports
import matplotlib.pyplot as plt
import seaborn as sns
import torch
from torch import nn
from torch import optim
import torch.nn.functional as F
from torchvision import datasets, transforms, models
from PIL import Image
import numpy as np
import json
import pandas as pd
# Import for keeping our session aliv... | 28.054299 | 89 | 0.61871 | # Imports
import matplotlib.pyplot as plt
import seaborn as sns
import torch
from torch import nn
from torch import optim
import torch.nn.functional as F
from torchvision import datasets, transforms, models
from PIL import Image
import numpy as np
import json
import pandas as pd
# Import for keeping our session aliv... | 2,623 | 7 | 181 |
5e418feda0e0beca1b1898921200f56ed7648535 | 483 | py | Python | user/urls.py | fobiero/InstagramClone_DJ_02 | e99c65699997e20f98442159b01bc9d382f90b82 | [
"MIT"
] | null | null | null | user/urls.py | fobiero/InstagramClone_DJ_02 | e99c65699997e20f98442159b01bc9d382f90b82 | [
"MIT"
] | null | null | null | user/urls.py | fobiero/InstagramClone_DJ_02 | e99c65699997e20f98442159b01bc9d382f90b82 | [
"MIT"
] | null | null | null | from django.urls import path
from user.views import ProfileView,ProfileEditView,AllProfilesView
from django.contrib.auth.decorators import login_required
urlpatterns = [
# dynamic URL
path('in/<str:username>/',login_required(ProfileView.as_view()),name='profile_view'),
path('in/<str:username>/edit/',login_... | 37.153846 | 103 | 0.761905 | from django.urls import path
from user.views import ProfileView,ProfileEditView,AllProfilesView
from django.contrib.auth.decorators import login_required
urlpatterns = [
# dynamic URL
path('in/<str:username>/',login_required(ProfileView.as_view()),name='profile_view'),
path('in/<str:username>/edit/',login_... | 0 | 0 | 0 |
f326b9679284bce6470da5c2ec0ec289c29e0ed3 | 5,798 | py | Python | piso/docstrings/interval.py | venaturum/piso | 54fd20443efb84d7a9982c92caf492b12206eaef | [
"MIT"
] | 5 | 2021-10-10T04:17:17.000Z | 2022-03-01T06:23:25.000Z | piso/docstrings/interval.py | venaturum/piso | 54fd20443efb84d7a9982c92caf492b12206eaef | [
"MIT"
] | 35 | 2021-10-09T13:22:04.000Z | 2022-01-29T08:38:15.000Z | piso/docstrings/interval.py | staircase-dev/piso | 2e6ac861f7166195e2fe67e2665c29e36b4ff12e | [
"MIT"
] | null | null | null | union_examples = """
Examples
-----------
>>> import pandas as pd
>>> import piso.interval
>>> piso.interval.union(
... pd.Interval(0, 3),
... pd.Interval(2, 4),
... )
Interval(0.0, 4.0, closed='right')
>>> piso.interval.union(
... pd.Interval(0, 3),
... pd.Interval(2, 4),
... squeeze=False,
... )
<In... | 20.560284 | 89 | 0.624181 | union_examples = """
Examples
-----------
>>> import pandas as pd
>>> import piso.interval
>>> piso.interval.union(
... pd.Interval(0, 3),
... pd.Interval(2, 4),
... )
Interval(0.0, 4.0, closed='right')
>>> piso.interval.union(
... pd.Interval(0, 3),
... pd.Interval(2, 4),
... squeeze=False,
... )
<In... | 0 | 0 | 0 |
0e77dececbe73353a54fdfea2a502e9ede998856 | 285 | py | Python | content/tampers/urlencodeall.py | officialhocc/WhatWaf | 0ca5c7f1ffc6dfba05e2d0a29799c023c4c6337f | [
"MIT"
] | null | null | null | content/tampers/urlencodeall.py | officialhocc/WhatWaf | 0ca5c7f1ffc6dfba05e2d0a29799c023c4c6337f | [
"MIT"
] | null | null | null | content/tampers/urlencodeall.py | officialhocc/WhatWaf | 0ca5c7f1ffc6dfba05e2d0a29799c023c4c6337f | [
"MIT"
] | 1 | 2018-12-27T23:18:44.000Z | 2018-12-27T23:18:44.000Z | __example_payload__ = "SELECT * FROM information_schema.tables"
__type__ = "encoding all characters in the payload into their URL encoding equivalent"
| 28.5 | 86 | 0.698246 | __example_payload__ = "SELECT * FROM information_schema.tables"
__type__ = "encoding all characters in the payload into their URL encoding equivalent"
def tamper(payload, **kwargs):
retval = ""
for char in payload:
retval += "%{}".format(ord(char))
return retval
| 110 | 0 | 23 |
2ccf9cae31016b266b5a8a656b3aea0c3e571fc9 | 361 | py | Python | uvloop/includes/__init__.py | Psycojoker/uvloop | 03487c80a508ea92e66f976fa196e64514894205 | [
"Apache-2.0",
"MIT"
] | 9,084 | 2016-04-04T10:42:42.000Z | 2022-03-30T22:53:22.000Z | uvloop/includes/__init__.py | Psycojoker/uvloop | 03487c80a508ea92e66f976fa196e64514894205 | [
"Apache-2.0",
"MIT"
] | 382 | 2016-04-02T19:19:09.000Z | 2022-03-22T08:39:18.000Z | uvloop/includes/__init__.py | Psycojoker/uvloop | 03487c80a508ea92e66f976fa196e64514894205 | [
"Apache-2.0",
"MIT"
] | 562 | 2016-04-01T19:42:12.000Z | 2022-03-30T22:40:40.000Z | # flake8: noqa
# These have to be synced with the stdlib.pxi
import asyncio
import collections
import concurrent.futures
import errno
import functools
import gc
import inspect
import itertools
import os
import signal
import socket
import subprocess
import ssl
import stat
import sys
import threading
import traceback
im... | 15.041667 | 45 | 0.839335 | # flake8: noqa
# These have to be synced with the stdlib.pxi
import asyncio
import collections
import concurrent.futures
import errno
import functools
import gc
import inspect
import itertools
import os
import signal
import socket
import subprocess
import ssl
import stat
import sys
import threading
import traceback
im... | 0 | 0 | 0 |
1c8ec33bd6590fc7464361b859e4510f1751e325 | 1,638 | py | Python | program/google/protobuf/internal/import_test_package/import_public_pb2.py | Addision/ProtoExcelTool | 17eaa08c08312e59c5a8f6114a121177ca65508a | [
"MIT"
] | null | null | null | program/google/protobuf/internal/import_test_package/import_public_pb2.py | Addision/ProtoExcelTool | 17eaa08c08312e59c5a8f6114a121177ca65508a | [
"MIT"
] | null | null | null | program/google/protobuf/internal/import_test_package/import_public_pb2.py | Addision/ProtoExcelTool | 17eaa08c08312e59c5a8f6114a121177ca65508a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/internal/import_test_package/import_public.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf i... | 45.5 | 236 | 0.856532 | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: google/protobuf/internal/import_test_package/import_public.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import message as _message
from google.protobuf i... | 0 | 0 | 0 |
fef38ca47668163b162c207f959688da2177c198 | 776 | py | Python | pomdpy/util/console.py | wecacuee/POMDPy | c23ebf90f5815db4326564110487779961736b60 | [
"MIT"
] | 210 | 2015-04-23T17:05:50.000Z | 2022-03-14T08:00:00.000Z | pomdpy/util/console.py | wecacuee/POMDPy | c23ebf90f5815db4326564110487779961736b60 | [
"MIT"
] | 15 | 2015-04-13T05:36:14.000Z | 2019-05-06T19:14:50.000Z | pomdpy/util/console.py | wecacuee/POMDPy | c23ebf90f5815db4326564110487779961736b60 | [
"MIT"
] | 76 | 2016-08-18T03:54:08.000Z | 2022-01-26T09:08:23.000Z | """
CONSOLE LOGGING VERBOSITY LEVELS
---------------------------------
0 - FATAL
1 - CRITICAL
2 - INFO
3 - LOUD
4 - DEBUG
"""
from __future__ import print_function
VERBOSITY = 3
# Pass a function that handles printing
| 20.421053 | 87 | 0.489691 | """
CONSOLE LOGGING VERBOSITY LEVELS
---------------------------------
0 - FATAL
1 - CRITICAL
2 - INFO
3 - LOUD
4 - DEBUG
"""
from __future__ import print_function
VERBOSITY = 3
def print_divider(size):
if size == "large":
print("======================================================================")
... | 485 | 0 | 68 |
44ed70cbfc3304e7e67ef97dda862a36beaab64b | 6,182 | py | Python | scripts/download_objectron_shards.py | yycho0108/ai604-video-object-pose | 7067f36281038272b0e39166d8f9718076bb6e75 | [
"MIT"
] | null | null | null | scripts/download_objectron_shards.py | yycho0108/ai604-video-object-pose | 7067f36281038272b0e39166d8f9718076bb6e75 | [
"MIT"
] | 13 | 2021-04-13T04:58:38.000Z | 2021-06-17T04:58:07.000Z | scripts/download_objectron_shards.py | yycho0108/ai604-video-object-pose | 7067f36281038272b0e39166d8f9718076bb6e75 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import multiprocessing as mp
import functools
import logging
import time
from typing import List
from tqdm.auto import tqdm
from dataclasses import dataclass
from simple_parsing import Serializable
from pathlib import Path
from google.cloud import storage
from top.data.objectron_detection impo... | 34.926554 | 103 | 0.573924 | #!/usr/bin/env python3
import multiprocessing as mp
import functools
import logging
import time
from typing import List
from tqdm.auto import tqdm
from dataclasses import dataclass
from simple_parsing import Serializable
from pathlib import Path
from google.cloud import storage
from top.data.objectron_detection impo... | 4,012 | 244 | 68 |
24275aed84864bf05f1c599575bbe3d0f445671d | 1,486 | py | Python | tests/documentation/library/test_lib_mechanism_docs.py | bdsinger/PsyNeuLink | 71d8a0bb1691ff85061d4ad3de866d9930a69a73 | [
"Apache-2.0"
] | null | null | null | tests/documentation/library/test_lib_mechanism_docs.py | bdsinger/PsyNeuLink | 71d8a0bb1691ff85061d4ad3de866d9930a69a73 | [
"Apache-2.0"
] | null | null | null | tests/documentation/library/test_lib_mechanism_docs.py | bdsinger/PsyNeuLink | 71d8a0bb1691ff85061d4ad3de866d9930a69a73 | [
"Apache-2.0"
] | null | null | null | import doctest
import os
import pytest
import psyneulink as pnl
| 28.037736 | 83 | 0.650067 | import doctest
import os
import pytest
import psyneulink as pnl
def test_ddm_docs():
# FIXME: Does this run outside of the test directory?
# os.chdir('../../Matlab/DDMFunctions')
# print("current dir = {}".format(os.getcwd()))
# ALSO FIXME: ValueError cannot convert float NaN integer
fail, total... | 1,324 | 0 | 92 |
0893a71e0f5da806a8a314e41845ca5a36b8b9a3 | 1,231 | py | Python | scripts/text_analysis.py | Lukas-Justen/Airbnb-Price-Evaluator | 8759e32e94510520984223d18f0f9b09396aa448 | [
"MIT"
] | null | null | null | scripts/text_analysis.py | Lukas-Justen/Airbnb-Price-Evaluator | 8759e32e94510520984223d18f0f9b09396aa448 | [
"MIT"
] | null | null | null | scripts/text_analysis.py | Lukas-Justen/Airbnb-Price-Evaluator | 8759e32e94510520984223d18f0f9b09396aa448 | [
"MIT"
] | 3 | 2019-02-05T03:09:38.000Z | 2020-01-30T02:55:37.000Z | import pandas as pd
import re
from keras.models import Sequential
from keras.layers import Dense
from keras.wrappers.scikit_learn import KerasRegressor
from sklearn.preprocessing import StandardScaler
from nltk.corpus import stopwords
import nltk
from sklearn.feature_extraction.text import TfidfVectorizer
data = pd.r... | 31.564103 | 109 | 0.718115 | import pandas as pd
import re
from keras.models import Sequential
from keras.layers import Dense
from keras.wrappers.scikit_learn import KerasRegressor
from sklearn.preprocessing import StandardScaler
from nltk.corpus import stopwords
import nltk
from sklearn.feature_extraction.text import TfidfVectorizer
data = pd.r... | 0 | 0 | 0 |
af623b00cd842370a410852427b7895cb98e73bd | 1,591 | py | Python | data/plot_produced_events_frequency.py | lpraat/scep2019 | f120ee20397648e708cce41a7949c70b523b6e56 | [
"MIT"
] | 1 | 2021-11-02T20:34:22.000Z | 2021-11-02T20:34:22.000Z | data/plot_produced_events_frequency.py | lpraat/scep2019 | f120ee20397648e708cce41a7949c70b523b6e56 | [
"MIT"
] | null | null | null | data/plot_produced_events_frequency.py | lpraat/scep2019 | f120ee20397648e708cce41a7949c70b523b6e56 | [
"MIT"
] | 1 | 2021-11-02T20:34:29.000Z | 2021-11-02T20:34:29.000Z | import time
import matplotlib.pyplot as plt
from confluent_kafka import Producer
if __name__ == '__main__':
plot_events_produced_frequency('first_half.txt')
| 25.253968 | 103 | 0.540541 | import time
import matplotlib.pyplot as plt
from confluent_kafka import Producer
def delivery_report(err, msg):
if err is not None:
print('Message delivery failed: {}'.format(err))
def plot_events_produced_frequency(data):
second = 0
seconds = []
num_events = []
producer = Producer({'bo... | 1,379 | 0 | 46 |
c441282bcbc825edec262db51bb98fc861239dc2 | 10,372 | py | Python | postcipes/unstructured_channel_flow.py | Mopolino8/postcipes | 5d67b383aa3e314b581b5262ba95f734ecb6369f | [
"MIT"
] | null | null | null | postcipes/unstructured_channel_flow.py | Mopolino8/postcipes | 5d67b383aa3e314b581b5262ba95f734ecb6369f | [
"MIT"
] | null | null | null | postcipes/unstructured_channel_flow.py | Mopolino8/postcipes | 5d67b383aa3e314b581b5262ba95f734ecb6369f | [
"MIT"
] | 1 | 2019-11-24T17:11:16.000Z | 2019-11-24T17:11:16.000Z | # This file is part of postcipes
# (c) Timofey Mukha
# The code is released under the MIT Licence.
# See LICENCE.txt and the Legal section in the README for more information
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from .postcipe import Postcipe
impor... | 40.515625 | 100 | 0.558427 | # This file is part of postcipes
# (c) Timofey Mukha
# The code is released under the MIT Licence.
# See LICENCE.txt and the Legal section in the README for more information
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from .postcipe import Postcipe
impor... | 9,601 | 19 | 158 |
d92f467975214762a809181706879ef56dad667e | 290 | py | Python | web/impact/impact/v1/views/judging_round_detail_view.py | masschallenge/impact-api | 81075ced8fcc95de9390dd83c15e523e67fc48c0 | [
"MIT"
] | 5 | 2017-10-19T15:11:52.000Z | 2020-03-08T07:16:21.000Z | web/impact/impact/v1/views/judging_round_detail_view.py | masschallenge/impact-api | 81075ced8fcc95de9390dd83c15e523e67fc48c0 | [
"MIT"
] | 182 | 2017-06-21T19:32:13.000Z | 2021-03-22T13:38:16.000Z | web/impact/impact/v1/views/judging_round_detail_view.py | masschallenge/impact-api | 81075ced8fcc95de9390dd83c15e523e67fc48c0 | [
"MIT"
] | 1 | 2018-06-23T11:53:18.000Z | 2018-06-23T11:53:18.000Z | # MIT License
# Copyright (c) 2017 MassChallenge, Inc.
from impact.v1.helpers import JudgingRoundHelper
from impact.v1.views.base_detail_view import BaseDetailView
| 26.363636 | 59 | 0.813793 | # MIT License
# Copyright (c) 2017 MassChallenge, Inc.
from impact.v1.helpers import JudgingRoundHelper
from impact.v1.views.base_detail_view import BaseDetailView
class JudgingRoundDetailView(BaseDetailView):
view_name = "judging_round_detail"
helper_class = JudgingRoundHelper
| 0 | 101 | 23 |
9ccb8028ad0763b4db88db48c471d0ce6a4d0c23 | 443 | py | Python | ecr_list.py | willfong/aws-helper | 21708044fbf95b76393e9b5f0e86c5e74ff11c77 | [
"MIT"
] | null | null | null | ecr_list.py | willfong/aws-helper | 21708044fbf95b76393e9b5f0e86c5e74ff11c77 | [
"MIT"
] | null | null | null | ecr_list.py | willfong/aws-helper | 21708044fbf95b76393e9b5f0e86c5e74ff11c77 | [
"MIT"
] | null | null | null | import boto3
import base64
aws_ecr_client = boto3.client('ecr')
response = aws_ecr_client.describe_repositories()
for repo in response['repositories']:
response = aws_ecr_client.get_authorization_token(registryIds=[repo['registryId']])
print(f"{repo['repositoryName']}\t{repo['repositoryArn']}")
#print(f"... | 34.076923 | 87 | 0.742664 | import boto3
import base64
aws_ecr_client = boto3.client('ecr')
response = aws_ecr_client.describe_repositories()
for repo in response['repositories']:
response = aws_ecr_client.get_authorization_token(registryIds=[repo['registryId']])
print(f"{repo['repositoryName']}\t{repo['repositoryArn']}")
#print(f"... | 0 | 0 | 0 |
941d365262555a8c34051404c843d63f740f4d10 | 3,915 | py | Python | tests/constants.py | acutaia/goeasy-ublox_reader | f4662389667c9087ca73dd33e5122891bd05db8a | [
"Apache-2.0"
] | null | null | null | tests/constants.py | acutaia/goeasy-ublox_reader | f4662389667c9087ca73dd33e5122891bd05db8a | [
"Apache-2.0"
] | null | null | null | tests/constants.py | acutaia/goeasy-ublox_reader | f4662389667c9087ca73dd33e5122891bd05db8a | [
"Apache-2.0"
] | null | null | null | """
Test constants
:author: Angelo Cutaia
:copyright: Copyright 2021, LINKS Foundation
:version: 1.0.0
..
Copyright 2021 LINKS Foundation
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 Lice... | 18.294393 | 88 | 0.516731 | """
Test constants
:author: Angelo Cutaia
:copyright: Copyright 2021, LINKS Foundation
:version: 1.0.0
..
Copyright 2021 LINKS Foundation
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 Lice... | 0 | 0 | 0 |
d827fc4c0960176a711a9d9d10c251e11d8975fa | 239 | py | Python | tests/test_base.py | FlorianLudwig/datamodel-code-generator | 052882f7c5bd883fac0f42916a5a8fc9623f37ce | [
"MIT"
] | null | null | null | tests/test_base.py | FlorianLudwig/datamodel-code-generator | 052882f7c5bd883fac0f42916a5a8fc9623f37ce | [
"MIT"
] | null | null | null | tests/test_base.py | FlorianLudwig/datamodel-code-generator | 052882f7c5bd883fac0f42916a5a8fc9623f37ce | [
"MIT"
] | null | null | null | from datamodel_code_generator.parser.base import snake_to_upper_camel
def test_snake_to_upper_camel_underscore():
"""In case a name starts with a underline, we should keep it."""
assert snake_to_upper_camel('_hello') == '_Hello'
| 34.142857 | 69 | 0.778243 | from datamodel_code_generator.parser.base import snake_to_upper_camel
def test_snake_to_upper_camel_underscore():
"""In case a name starts with a underline, we should keep it."""
assert snake_to_upper_camel('_hello') == '_Hello'
| 0 | 0 | 0 |
05407402a2ccd8b744694eeb09b18264ced17222 | 5,580 | py | Python | Lay_dataset.py | sixduck/Sorting-robot-using-Opencv-Tensorflow-Arduino | 54f58d8899b3c29dcb12eb4843f3418d36824c8a | [
"MIT"
] | null | null | null | Lay_dataset.py | sixduck/Sorting-robot-using-Opencv-Tensorflow-Arduino | 54f58d8899b3c29dcb12eb4843f3418d36824c8a | [
"MIT"
] | null | null | null | Lay_dataset.py | sixduck/Sorting-robot-using-Opencv-Tensorflow-Arduino | 54f58d8899b3c29dcb12eb4843f3418d36824c8a | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import dk_ardruino
import serial
cam_mtx=np.load('utils/cam_mtx.npy')
dist=np.load('utils/dist.npy')
newcam_mtx=np.load('utils/newcam_mtx.npy')
roi=np.load('utils/roi.npy')
matrix = np.load('utils/abc.npy')
area1 = int(open('utils/Resolution.txt').read().split('\n')[2])
width = i... | 36.953642 | 123 | 0.507706 | import cv2
import numpy as np
import dk_ardruino
import serial
cam_mtx=np.load('utils/cam_mtx.npy')
dist=np.load('utils/dist.npy')
newcam_mtx=np.load('utils/newcam_mtx.npy')
roi=np.load('utils/roi.npy')
matrix = np.load('utils/abc.npy')
area1 = int(open('utils/Resolution.txt').read().split('\n')[2])
width = i... | 650 | 0 | 48 |
0be1ea82fa002a548d8dd7062260cae15d0d9942 | 2,791 | py | Python | backend/tournesol/urls.py | sigmike/tournesol | 9d92ff9c552c3b2923b3222f5f32d6b7e558de29 | [
"CC0-1.0"
] | null | null | null | backend/tournesol/urls.py | sigmike/tournesol | 9d92ff9c552c3b2923b3222f5f32d6b7e558de29 | [
"CC0-1.0"
] | null | null | null | backend/tournesol/urls.py | sigmike/tournesol | 9d92ff9c552c3b2923b3222f5f32d6b7e558de29 | [
"CC0-1.0"
] | null | null | null | # coding: utf-8
"""
Defines Tournesol's backend API routes
"""
from django.urls import include, path
from rest_framework import routers
from .views import ComparisonDetailApi, ComparisonListApi, ComparisonListFilteredApi
from .views.email_domains import EmailDomainsList
from .views.exports import ExportAllView, Expo... | 26.580952 | 92 | 0.654246 | # coding: utf-8
"""
Defines Tournesol's backend API routes
"""
from django.urls import include, path
from rest_framework import routers
from .views import ComparisonDetailApi, ComparisonListApi, ComparisonListFilteredApi
from .views.email_domains import EmailDomainsList
from .views.exports import ExportAllView, Expo... | 0 | 0 | 0 |
5b8a078ff34f1d035aa62e9f50a56a993be2958b | 1,678 | py | Python | src/utils/live-view/WindowCapture.py | soyuka/botty | cc1670ea1db72c5e0ac91685897bf63c89b18896 | [
"MIT"
] | 1 | 2021-11-13T23:23:25.000Z | 2021-11-13T23:23:25.000Z | src/utils/live-view/WindowCapture.py | soyuka/botty | cc1670ea1db72c5e0ac91685897bf63c89b18896 | [
"MIT"
] | null | null | null | src/utils/live-view/WindowCapture.py | soyuka/botty | cc1670ea1db72c5e0ac91685897bf63c89b18896 | [
"MIT"
] | null | null | null | import numpy as np
import win32gui, win32api
import ctypes
import mss
sct = mss.mss() | 41.95 | 135 | 0.681764 | import numpy as np
import win32gui, win32api
import ctypes
import mss
sct = mss.mss()
class WindowCapture:
w = 0
h = 0
hwnd = None
cropped_x = 0
cropped_y = 0
offset_x = 0
offset_y = 0
def __init__(self):
window_handle = win32gui.FindWindow('OsWindow', 'Diablo II: Resurrected')
... | 1,358 | 213 | 22 |
e8635a64531764fac2692b44d3e7d7ab7842efa8 | 1,594 | py | Python | pyohio/schedule.py | tylerdave/pyohio | f4d5c4a06f02afdf2f7a326b6072f2e95a9fdcb8 | [
"MIT"
] | null | null | null | pyohio/schedule.py | tylerdave/pyohio | f4d5c4a06f02afdf2f7a326b6072f2e95a9fdcb8 | [
"MIT"
] | null | null | null | pyohio/schedule.py | tylerdave/pyohio | f4d5c4a06f02afdf2f7a326b6072f2e95a9fdcb8 | [
"MIT"
] | null | null | null | import requests
import requests_cache
from collections import OrderedDict
from datetime import datetime
from dateutil import parser
from operator import itemgetter
from tabulate import tabulate
SCHEDULE_URL = "http://pyohio.org/schedule/json/"
def get_schedule(cache_ttl=3600):
""" Get the schedule from the confer... | 41.947368 | 95 | 0.707026 | import requests
import requests_cache
from collections import OrderedDict
from datetime import datetime
from dateutil import parser
from operator import itemgetter
from tabulate import tabulate
SCHEDULE_URL = "http://pyohio.org/schedule/json/"
def get_schedule(cache_ttl=3600):
""" Get the schedule from the confer... | 0 | 0 | 0 |
748eb425947874e2951b767772a82a62dcdbf127 | 1,348 | py | Python | apps/core/serializers.py | jjorgewill/security | 6db561def4a753892611c7e0033b3ab0afad9a31 | [
"MIT"
] | 1 | 2018-10-23T22:03:23.000Z | 2018-10-23T22:03:23.000Z | apps/core/serializers.py | jjorgewill/security-micro-service | 6db561def4a753892611c7e0033b3ab0afad9a31 | [
"MIT"
] | null | null | null | apps/core/serializers.py | jjorgewill/security-micro-service | 6db561def4a753892611c7e0033b3ab0afad9a31 | [
"MIT"
] | null | null | null | from django.contrib.auth.models import User
from rest_framework import serializers
from django.contrib.auth import authenticate
from django.core import exceptions
from rest_framework.serializers import ModelSerializer
from django.utils.translation import ugettext_lazy as _
| 33.7 | 78 | 0.658754 | from django.contrib.auth.models import User
from rest_framework import serializers
from django.contrib.auth import authenticate
from django.core import exceptions
from rest_framework.serializers import ModelSerializer
from django.utils.translation import ugettext_lazy as _
class UserSerializer(ModelSerializer):
c... | 773 | 254 | 46 |
7995d4c1e1bb63d1840f0a19cb868618116f6f6c | 575 | py | Python | app/app/migrations/0003_auto_20210109_0016.py | maszaa/remote-desktop-software-controller | 270176b46ce23620e3811a24498f7425df98f396 | [
"MIT"
] | 1 | 2022-01-29T13:44:47.000Z | 2022-01-29T13:44:47.000Z | app/app/migrations/0003_auto_20210109_0016.py | maszaa/remote-desktop-software-controller | 270176b46ce23620e3811a24498f7425df98f396 | [
"MIT"
] | 5 | 2021-01-16T16:19:16.000Z | 2021-01-29T12:59:29.000Z | app/app/migrations/0003_auto_20210109_0016.py | maszaa/remote-desktop-software-controller | 270176b46ce23620e3811a24498f7425df98f396 | [
"MIT"
] | 1 | 2021-01-10T14:45:38.000Z | 2021-01-10T14:45:38.000Z | # Generated by Django 3.1.5 on 2021-01-08 22:16
from django.db import migrations, models
| 25 | 99 | 0.598261 | # Generated by Django 3.1.5 on 2021-01-08 22:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('app', '0002_auto_20210108_2129'),
]
operations = [
migrations.AlterModelOptions(
name='command',
options={'ordering'... | 0 | 461 | 23 |
1ef431b4957d4a5e8c47ddae3802f8694f92521e | 2,684 | py | Python | haystack/utils/app_loading.py | atn9/django-haystack | bd60745ce82318b1819768c9a31db0579228654d | [
"BSD-3-Clause"
] | null | null | null | haystack/utils/app_loading.py | atn9/django-haystack | bd60745ce82318b1819768c9a31db0579228654d | [
"BSD-3-Clause"
] | null | null | null | haystack/utils/app_loading.py | atn9/django-haystack | bd60745ce82318b1819768c9a31db0579228654d | [
"BSD-3-Clause"
] | null | null | null | # encoding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
from django import VERSION as DJANGO_VERSION
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.models.loading import get_app, get_model, get_models
from django.util... | 31.209302 | 132 | 0.632265 | # encoding: utf-8
from __future__ import absolute_import, division, print_function, unicode_literals
from django import VERSION as DJANGO_VERSION
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.models.loading import get_app, get_model, get_models
from django.util... | 1,533 | 0 | 107 |
474b914f97e6aa9059538049c5d4fc6346792ce1 | 859 | py | Python | recipe_modules/futures/examples/background_helper.resources/helper.py | engeg/recipes-py | 9dac536b55887262b4ce846f3db7a7f596542e5e | [
"Apache-2.0"
] | null | null | null | recipe_modules/futures/examples/background_helper.resources/helper.py | engeg/recipes-py | 9dac536b55887262b4ce846f3db7a7f596542e5e | [
"Apache-2.0"
] | null | null | null | recipe_modules/futures/examples/background_helper.resources/helper.py | engeg/recipes-py | 9dac536b55887262b4ce846f3db7a7f596542e5e | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
import json
import os
import sys
import time
import signal
signal.signal(
(
signal.SIGBREAK # pylint: disable=no-member
if sys.p... | 23.216216 | 76 | 0.663562 | # Copyright 2019 The LUCI Authors. All rights reserved.
# Use of this source code is governed under the Apache License, Version 2.0
# that can be found in the LICENSE file.
import json
import os
import sys
import time
import signal
signal.signal(
(
signal.SIGBREAK # pylint: disable=no-member
if sys.p... | 0 | 0 | 0 |
8d81e53036950dba7774071b6973aff11f1ed3ef | 1,752 | py | Python | core_dev/animations/progress.py | alexzanderr/_core-dev | 831f69dad524e450c4243b1dd88f26de80e1d444 | [
"MIT"
] | null | null | null | core_dev/animations/progress.py | alexzanderr/_core-dev | 831f69dad524e450c4243b1dd88f26de80e1d444 | [
"MIT"
] | null | null | null | core_dev/animations/progress.py | alexzanderr/_core-dev | 831f69dad524e450c4243b1dd88f26de80e1d444 | [
"MIT"
] | null | null | null |
from time import sleep
import os
from animations import progress_bar
from threading import Thread
import sys
import time
# for i in range(100):
# time.sleep(0.1)
# sys.stdout.write(f'salutare-{i}\n')
# sys.stdout.write(f'andrew-{i}\n')
# sys.stdout.write("\x1b[1A") # cursor up one line
# sys.s... | 21.9 | 85 | 0.638699 |
from time import sleep
import os
from animations import progress_bar
from threading import Thread
import sys
import time
# for i in range(100):
# time.sleep(0.1)
# sys.stdout.write(f'salutare-{i}\n')
# sys.stdout.write(f'andrew-{i}\n')
# sys.stdout.write("\x1b[1A") # cursor up one line
# sys.s... | 403 | 0 | 69 |
9a1a255f27c75706814744325288ae364429e8ba | 782 | py | Python | attributes/unit_test/discoverer/python.py | Lufedi/reaper | bdf56b499e5b704c27b9f6c053d798c2a10fa4cf | [
"Apache-2.0"
] | 106 | 2015-07-21T16:18:26.000Z | 2022-03-31T06:45:34.000Z | attributes/unit_test/discoverer/python.py | Kowndinya2000/enhanced_repo_reaper | 744f794ba53bde5667b3b0f99b07273d0e32a495 | [
"Apache-2.0"
] | 21 | 2015-07-11T03:48:28.000Z | 2022-01-18T12:57:30.000Z | attributes/unit_test/discoverer/python.py | Kowndinya2000/enhanced_repo_reaper | 744f794ba53bde5667b3b0f99b07273d0e32a495 | [
"Apache-2.0"
] | 26 | 2015-07-22T22:38:21.000Z | 2022-03-14T10:11:56.000Z | from attributes.unit_test.discoverer import TestDiscoverer
| 30.076923 | 58 | 0.604859 | from attributes.unit_test.discoverer import TestDiscoverer
class PythonTestDiscoverer(TestDiscoverer):
def __init__(self):
self.language = 'Python'
self.languages = ['Python']
self.extensions = ['*.py']
self.frameworks = [
self.__django_test__,
self.__nose__... | 570 | 22 | 130 |
093cc965f02f52c91f22af862a09e4f2efc576ab | 3,743 | py | Python | GarbleExecutable.py | greshje-nachc/data-owner-tools | 771a6fbcd24af8b9d3861e337f4dbd213ead9dc8 | [
"Apache-2.0"
] | null | null | null | GarbleExecutable.py | greshje-nachc/data-owner-tools | 771a6fbcd24af8b9d3861e337f4dbd213ead9dc8 | [
"Apache-2.0"
] | null | null | null | GarbleExecutable.py | greshje-nachc/data-owner-tools | 771a6fbcd24af8b9d3861e337f4dbd213ead9dc8 | [
"Apache-2.0"
] | 1 | 2021-09-28T16:58:36.000Z | 2021-09-28T16:58:36.000Z | import garble
import wx
from multiprocessing import freeze_support
import sys
import os
from pathlib import Path
# pyinstaller GarbleExecutable.py --onefile -w --add-data ./venv/Lib/site-packages/clkhash/data;clkhash/data --add-data ./venv/Lib/site-packages/clkhash/schemas;clkhash/schemas --add-data ./example-schema;... | 33.419643 | 220 | 0.635052 | import garble
import wx
from multiprocessing import freeze_support
import sys
import os
from pathlib import Path
# pyinstaller GarbleExecutable.py --onefile -w --add-data ./venv/Lib/site-packages/clkhash/data;clkhash/data --add-data ./venv/Lib/site-packages/clkhash/schemas;clkhash/schemas --add-data ./example-schema;... | 3,065 | 8 | 180 |
d5aa27298b18cea6f7b3bd1d6baded26a49d8045 | 3,807 | py | Python | main.py | ashtedroid/Test-Cases-Prioritization-and-Analysis | 70a6997f3764ea39c51fdc8cd6806e430088f8a7 | [
"MIT"
] | 1 | 2020-04-24T08:08:49.000Z | 2020-04-24T08:08:49.000Z | main.py | ashtedroid/Test-Cases-Prioritization-and-Analysis | 70a6997f3764ea39c51fdc8cd6806e430088f8a7 | [
"MIT"
] | null | null | null | main.py | ashtedroid/Test-Cases-Prioritization-and-Analysis | 70a6997f3764ea39c51fdc8cd6806e430088f8a7 | [
"MIT"
] | null | null | null | '''
=================================================================
@version 2.0
@author Ashwin Ramadevanahalli
@title Testing.
Main module.
=================================================================
'''
import os
import sys
import subprocess
import testset_parse
import gcov_parse
import rand_pr... | 25.897959 | 141 | 0.67192 | '''
=================================================================
@version 2.0
@author Ashwin Ramadevanahalli
@title Testing.
Main module.
=================================================================
'''
import os
import sys
import subprocess
import testset_parse
import gcov_parse
import rand_pr... | 0 | 0 | 0 |