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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f0cd12e7a4a4c91af43ff9a3d26f2f3cb4847aba | 500 | py | Python | chatbot_env/Lib/site-packages/sklearn/manifold/locally_linear.py | rakmakan/Chatbot | d04bc1526b56961a16c25148d9ef18c4f157e9c4 | [
"MIT"
] | 6,989 | 2017-07-18T06:23:18.000Z | 2022-03-31T15:58:36.000Z | chatbot_env/Lib/site-packages/sklearn/manifold/locally_linear.py | rakmakan/Chatbot | d04bc1526b56961a16c25148d9ef18c4f157e9c4 | [
"MIT"
] | 1,978 | 2017-07-18T09:17:58.000Z | 2022-03-31T14:28:43.000Z | chatbot_env/Lib/site-packages/sklearn/manifold/locally_linear.py | rakmakan/Chatbot | d04bc1526b56961a16c25148d9ef18c4f157e9c4 | [
"MIT"
] | 1,228 | 2017-07-18T09:03:13.000Z | 2022-03-29T05:57:40.000Z |
# THIS FILE WAS AUTOMATICALLY GENERATED BY deprecated_modules.py
import sys
from . import _locally_linear
from ..externals._pep562 import Pep562
from ..utils.deprecation import _raise_dep_warning_if_not_pytest
deprecated_path = 'sklearn.manifold.locally_linear'
correct_import_path = 'sklearn.manifold'
_raise_dep_war... | 27.777778 | 70 | 0.818 |
# THIS FILE WAS AUTOMATICALLY GENERATED BY deprecated_modules.py
import sys
from . import _locally_linear
from ..externals._pep562 import Pep562
from ..utils.deprecation import _raise_dep_warning_if_not_pytest
deprecated_path = 'sklearn.manifold.locally_linear'
correct_import_path = 'sklearn.manifold'
_raise_dep_war... | 43 | 0 | 23 |
03d321f947cf791089e968138c005803b178ef5c | 1,833 | py | Python | tests/test_path_finder.py | MichalKacprzak99/pathfinding-pygame | 0f46d2b4ed53aebceb5591abc290cdd5c63d1584 | [
"MIT"
] | null | null | null | tests/test_path_finder.py | MichalKacprzak99/pathfinding-pygame | 0f46d2b4ed53aebceb5591abc290cdd5c63d1584 | [
"MIT"
] | null | null | null | tests/test_path_finder.py | MichalKacprzak99/pathfinding-pygame | 0f46d2b4ed53aebceb5591abc290cdd5c63d1584 | [
"MIT"
] | null | null | null | import unittest
import pygame as pg
import numpy as np
from square import Square
from pathfinder import PathFinder
from utils import Dimension
if __name__ == "__main__":
unittest.main() | 30.04918 | 74 | 0.707038 | import unittest
import pygame as pg
import numpy as np
from square import Square
from pathfinder import PathFinder
from utils import Dimension
class PathFinderTest(unittest.TestCase):
def setUp(self) -> None:
self.path_finder = PathFinder(pg.display.set_mode((0, 0)))
def test_set_point_both_points_... | 1,463 | 19 | 158 |
03f5739a7714d5d69790cfd3fb40df297484e110 | 754 | py | Python | exchange/ex_vtk.py | orbingol/NURBS-Python_Examples | c99d8cd3d20e7523694ce62f72760b260582fa11 | [
"MIT"
] | 48 | 2017-12-14T09:54:48.000Z | 2020-03-30T13:34:44.000Z | exchange/ex_vtk.py | GabrielJie/NURBS-Python_Examples | c99d8cd3d20e7523694ce62f72760b260582fa11 | [
"MIT"
] | 7 | 2020-05-27T04:27:24.000Z | 2021-05-25T16:11:39.000Z | exchange/ex_vtk.py | GabrielJie/NURBS-Python_Examples | c99d8cd3d20e7523694ce62f72760b260582fa11 | [
"MIT"
] | 37 | 2017-10-14T08:11:11.000Z | 2020-05-04T02:51:58.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Examples for the NURBS-Python Package
Released under MIT License
Developed by Onur Rauf Bingol (c) 2019
Exporting a NURBS surface in VTK Polydata format
"""
from geomdl.shapes import surface
from geomdl import exchange_vtk
# Create a cylindrical surf... | 29 | 113 | 0.769231 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Examples for the NURBS-Python Package
Released under MIT License
Developed by Onur Rauf Bingol (c) 2019
Exporting a NURBS surface in VTK Polydata format
"""
from geomdl.shapes import surface
from geomdl import exchange_vtk
# Create a cylindrical surf... | 0 | 0 | 0 |
d7761cceaa309e4e7895f224f7f0cbbb3a400fac | 331 | py | Python | posts/migrations/0014_remove_post_likes.py | tcharts-boop/quiktap | ff915cd507cfd804e8258b09db07ae8c1e81cc50 | [
"MIT"
] | null | null | null | posts/migrations/0014_remove_post_likes.py | tcharts-boop/quiktap | ff915cd507cfd804e8258b09db07ae8c1e81cc50 | [
"MIT"
] | null | null | null | posts/migrations/0014_remove_post_likes.py | tcharts-boop/quiktap | ff915cd507cfd804e8258b09db07ae8c1e81cc50 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.10 on 2020-09-23 00:28
from django.db import migrations
| 18.388889 | 52 | 0.595166 | # Generated by Django 3.0.10 on 2020-09-23 00:28
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('posts', '0013_remove_post_image_content'),
]
operations = [
migrations.RemoveField(
model_name='post',
name='likes',
... | 0 | 224 | 23 |
53fdcddc8404bf342e7757fdfee38b5bba88d8dc | 20,664 | py | Python | ml_library/dataset_util.py | alexshellabear/Still-Simple-Region-Proposal-Network | 21f5be00a5ecc47dd99a51b22fe1d38a9e94f00c | [
"MIT"
] | null | null | null | ml_library/dataset_util.py | alexshellabear/Still-Simple-Region-Proposal-Network | 21f5be00a5ecc47dd99a51b22fe1d38a9e94f00c | [
"MIT"
] | null | null | null | ml_library/dataset_util.py | alexshellabear/Still-Simple-Region-Proposal-Network | 21f5be00a5ecc47dd99a51b22fe1d38a9e94f00c | [
"MIT"
] | 1 | 2021-08-31T17:49:37.000Z | 2021-08-31T17:49:37.000Z | import os
import random
import cv2
import numpy as np
import pickle
try:
from .utility_functions import pre_process_image_for_vgg
from .utility_functions import get_conversions_between_input_and_feature
from .utility_functions import get_input_coordinates_of_anchor_points
from .utility_functions import ... | 52.580153 | 179 | 0.678523 | import os
import random
import cv2
import numpy as np
import pickle
try:
from .utility_functions import pre_process_image_for_vgg
from .utility_functions import get_conversions_between_input_and_feature
from .utility_functions import get_input_coordinates_of_anchor_points
from .utility_functions import ... | 0 | 0 | 0 |
b3d834327dddfe19edc81b833228c508d7cebfbc | 2,759 | py | Python | models/link_prediction/dist_mult.py | Minys233/GCN-BMP | 21b64a3c8cc9bc33718ae09c65aa917e575132eb | [
"MIT"
] | null | null | null | models/link_prediction/dist_mult.py | Minys233/GCN-BMP | 21b64a3c8cc9bc33718ae09c65aa917e575132eb | [
"MIT"
] | null | null | null | models/link_prediction/dist_mult.py | Minys233/GCN-BMP | 21b64a3c8cc9bc33718ae09c65aa917e575132eb | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 3/14/2019 4:04 PM
# @Author : chinshin
# @FileName: dist_mult.py
import numpy
import chainer
from chainer import link
from chainer import links
from chainer import variable
from chainer import initializers
from chainer.functions import relu
from ch... | 33.240964 | 105 | 0.623052 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time : 3/14/2019 4:04 PM
# @Author : chinshin
# @FileName: dist_mult.py
import numpy
import chainer
from chainer import link
from chainer import links
from chainer import variable
from chainer import initializers
from chainer.functions import relu
from ch... | 1,732 | 513 | 107 |
2f43c92c12f5ab873540e21a69cf9e70fad4bf29 | 619 | py | Python | myapp/views.py | danwild/react-django-client | 51b806b7336588aac2f9a973cc5f0fb4934a4680 | [
"MIT"
] | 32 | 2017-10-24T20:57:14.000Z | 2021-12-19T20:48:27.000Z | myapp/views.py | danwild/react-django-client | 51b806b7336588aac2f9a973cc5f0fb4934a4680 | [
"MIT"
] | null | null | null | myapp/views.py | danwild/react-django-client | 51b806b7336588aac2f9a973cc5f0fb4934a4680 | [
"MIT"
] | 10 | 2018-03-07T13:01:18.000Z | 2021-12-20T00:56:55.000Z | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render
# Create your views here.
from django.http import HttpResponse
from django.template import loader
| 25.791667 | 62 | 0.688207 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.shortcuts import render
# Create your views here.
from django.http import HttpResponse
from django.template import loader
def index(request):
template = loader.get_template('myapp/index.html')
context = {
'foo': 'bar',
}... | 373 | 0 | 46 |
6f2d5be7289c9694248483fd4f5c4ac712e17b3f | 21 | py | Python | src/controllers/errors/__init__.py | taonguyen740/flask_based_3tier_framework | f02e492eff0206e661925dddcf0ba978ead38b5e | [
"MIT"
] | null | null | null | src/controllers/errors/__init__.py | taonguyen740/flask_based_3tier_framework | f02e492eff0206e661925dddcf0ba978ead38b5e | [
"MIT"
] | null | null | null | src/controllers/errors/__init__.py | taonguyen740/flask_based_3tier_framework | f02e492eff0206e661925dddcf0ba978ead38b5e | [
"MIT"
] | null | null | null | from . import errors
| 10.5 | 20 | 0.761905 | from . import errors
| 0 | 0 | 0 |
7ca062989af3eeed9bb69f315ea197bcad4c1df0 | 10,106 | py | Python | asl-workflow-engine/py/test/step_by_step.py | fadams/local-step-functions | 2307fa3fc2b2ecede063fde99771105eb7b7f27c | [
"Apache-2.0"
] | 7 | 2019-09-19T14:53:15.000Z | 2021-01-05T12:36:32.000Z | asl-workflow-engine/py/test/step_by_step.py | fadams/local-step-functions | 2307fa3fc2b2ecede063fde99771105eb7b7f27c | [
"Apache-2.0"
] | null | null | null | asl-workflow-engine/py/test/step_by_step.py | fadams/local-step-functions | 2307fa3fc2b2ecede063fde99771105eb7b7f27c | [
"Apache-2.0"
] | 1 | 2020-04-08T23:16:23.000Z | 2020-04-08T23:16:23.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 37.992481 | 118 | 0.610429 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 1,057 | 0 | 27 |
5fc370bd66ece9ba14f3be8dc654a5152b8ec973 | 1,974 | py | Python | tests/test_stl.py | jcrotinger/pyloess | c313d78ce8c42ef9fa75774bca0feeeaae6c7445 | [
"MIT"
] | 3 | 2017-11-29T15:35:31.000Z | 2021-06-08T06:13:19.000Z | tests/test_stl.py | GT-Master/pyloess-py3 | ee214071b70f1cccee9d25e20d248b40b0c3fafd | [
"MIT"
] | 1 | 2018-05-23T15:30:45.000Z | 2018-05-23T15:30:45.000Z | tests/test_stl.py | GT-Master/pyloess-py3 | ee214071b70f1cccee9d25e20d248b40b0c3fafd | [
"MIT"
] | 5 | 2017-03-29T15:43:34.000Z | 2019-09-13T19:53:09.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pickle
import numpy
from scipy.stats.mstats import kendalltau_seasonal
# set up input parameters
filename_ts = "/home2/hilboll/data/pickle/20100920_trends_levelshift_cityzen/Pearl River Delta_seas-const.pkl"
with open(filename_ts, 'rb') as _fd:
ts = pickle.lo... | 32.9 | 159 | 0.670213 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import pickle
import numpy
from scipy.stats.mstats import kendalltau_seasonal
# set up input parameters
filename_ts = "/home2/hilboll/data/pickle/20100920_trends_levelshift_cityzen/Pearl River Delta_seas-const.pkl"
with open(filename_ts, 'rb') as _fd:
ts = pickle.lo... | 638 | 0 | 46 |
61e8a25d2dc816c47bc9ec3d4da67a290d8a5b49 | 8,632 | py | Python | junitxml_parse.py | dhandy2013/dh-dev-scripts | ed6777a906b063b6cbb9ff3f254dd501b2439e38 | [
"Apache-2.0"
] | 1 | 2020-08-19T15:43:04.000Z | 2020-08-19T15:43:04.000Z | junitxml_parse.py | dhandy2013/dh-dev-scripts | ed6777a906b063b6cbb9ff3f254dd501b2439e38 | [
"Apache-2.0"
] | null | null | null | junitxml_parse.py | dhandy2013/dh-dev-scripts | ed6777a906b063b6cbb9ff3f254dd501b2439e38 | [
"Apache-2.0"
] | 1 | 2020-08-19T15:43:22.000Z | 2020-08-19T15:43:22.000Z | #!/usr/bin/env python3
"""
Parse a JUnit XML format test output file and print useful info
"""
import argparse
from collections import defaultdict
import os
import sys
import xml.sax
import xml.sax.handler
if __name__ == "__main__":
sys.exit(main())
| 38.364444 | 86 | 0.608897 | #!/usr/bin/env python3
"""
Parse a JUnit XML format test output file and print useful info
"""
import argparse
from collections import defaultdict
import os
import sys
import xml.sax
import xml.sax.handler
class JUnitXMLHandler(xml.sax.handler.ContentHandler):
def __init__(self, args):
self._args = args
... | 7,864 | 33 | 477 |
8ee9fc3102ab535c935b505d85412a7b172fe792 | 1,004 | py | Python | deepdow/layers/__init__.py | sourcery-ai-bot/deepdow | 532fe1bca2240b2c3fb20dfbe3ab04ae5e132d5d | [
"Apache-2.0"
] | 2 | 2021-12-15T21:39:05.000Z | 2022-03-02T17:37:36.000Z | deepdow/layers/__init__.py | sourcery-ai-bot/deepdow | 532fe1bca2240b2c3fb20dfbe3ab04ae5e132d5d | [
"Apache-2.0"
] | null | null | null | deepdow/layers/__init__.py | sourcery-ai-bot/deepdow | 532fe1bca2240b2c3fb20dfbe3ab04ae5e132d5d | [
"Apache-2.0"
] | 1 | 2021-09-25T03:57:55.000Z | 2021-09-25T03:57:55.000Z | """Collection of layers."""
from .collapse import (AttentionCollapse, AverageCollapse, ElementCollapse, ExponentialCollapse,
MaxCollapse, SumCollapse)
from .allocate import (AnalyticalMarkowitz, NCO, NumericalMarkowitz, Resample, SoftmaxAllocator,
SparsemaxAllocator, Weigh... | 32.387097 | 96 | 0.577689 | """Collection of layers."""
from .collapse import (AttentionCollapse, AverageCollapse, ElementCollapse, ExponentialCollapse,
MaxCollapse, SumCollapse)
from .allocate import (AnalyticalMarkowitz, NCO, NumericalMarkowitz, Resample, SoftmaxAllocator,
SparsemaxAllocator, Weigh... | 0 | 0 | 0 |
4abfa550ea6be61425ef0c15b64ba1243ecbfa12 | 1,157 | py | Python | lux/core/commands/serve.py | quantmind/lux | 7318fcd86c77616aada41d8182a04339680a554c | [
"BSD-3-Clause"
] | 21 | 2015-03-28T23:27:43.000Z | 2020-11-23T13:24:10.000Z | lux/core/commands/serve.py | quantmind/lux | 7318fcd86c77616aada41d8182a04339680a554c | [
"BSD-3-Clause"
] | 195 | 2015-02-18T17:22:28.000Z | 2017-12-01T23:01:16.000Z | lux/core/commands/serve.py | quantmind/lux | 7318fcd86c77616aada41d8182a04339680a554c | [
"BSD-3-Clause"
] | 16 | 2015-03-31T23:15:38.000Z | 2017-04-18T11:59:43.000Z | from pulsar.api import get_actor, arbiter
from pulsar.apps import wsgi
from pulsar.utils.log import clear_logger
from lux.core import LuxCommand, Setting
nominify = Setting('nominify',
['--nominify'],
action="store_true",
default=False,
desc... | 31.27027 | 75 | 0.591184 | from pulsar.api import get_actor, arbiter
from pulsar.apps import wsgi
from pulsar.utils.log import clear_logger
from lux.core import LuxCommand, Setting
nominify = Setting('nominify',
['--nominify'],
action="store_true",
default=False,
desc... | 623 | 155 | 23 |
fe68639c68e5d4e45306e8d3888209534ff64add | 21,397 | py | Python | impl/datacite_xml.py | HEG-INCIPIT/Incipit | 5079a6535add0912784e9a70bc5bcccae84205ec | [
"MIT"
] | null | null | null | impl/datacite_xml.py | HEG-INCIPIT/Incipit | 5079a6535add0912784e9a70bc5bcccae84205ec | [
"MIT"
] | null | null | null | impl/datacite_xml.py | HEG-INCIPIT/Incipit | 5079a6535add0912784e9a70bc5bcccae84205ec | [
"MIT"
] | null | null | null | # =============================================================================
#
# EZID :: datacite_xml.py
#
# Allows processing a form with form elements named with simple XPATH
# expressions
# 1) Generates form fields for use with Django form model.
# 2) Creates an XML document for attaching Datacite XML metadata.
#... | 46.718341 | 2,574 | 0.643642 | # =============================================================================
#
# EZID :: datacite_xml.py
#
# Allows processing a form with form elements named with simple XPATH
# expressions
# 1) Generates form fields for use with Django form model.
# 2) Creates an XML document for attaching Datacite XML metadata.
#... | 12,790 | 0 | 335 |
d5b397ee3619fc1a34942ab12d0fe0bc44e014b2 | 2,363 | py | Python | scripts/generate-images.py | getwarped/s2i-jupyter-stacks | 5dd5250583101cd13551c4a5f82bd257e5247fc2 | [
"BSD-2-Clause"
] | 11 | 2016-11-22T04:11:58.000Z | 2019-05-21T17:23:45.000Z | scripts/generate-images.py | getwarped/s2i-jupyter-stacks | 5dd5250583101cd13551c4a5f82bd257e5247fc2 | [
"BSD-2-Clause"
] | 2 | 2016-11-01T04:07:49.000Z | 2016-12-14T23:48:01.000Z | scripts/generate-images.py | getwarped/s2i-jupyter-stacks | 5dd5250583101cd13551c4a5f82bd257e5247fc2 | [
"BSD-2-Clause"
] | 3 | 2016-11-24T08:02:19.000Z | 2018-01-01T21:16:39.000Z | '''
Generates the image stream resource definitions.
'''
import powershift.resources as resources
image_stream = resources.v1_ImageStream(
metadata = resources.v1_ObjectMeta(
name = 'jupyter-notebook',
annotations = {
'openshift.io/display-name': 'Jupyter Notebook'
}
),
... | 31.506667 | 91 | 0.59543 | '''
Generates the image stream resource definitions.
'''
import powershift.resources as resources
image_stream = resources.v1_ImageStream(
metadata = resources.v1_ObjectMeta(
name = 'jupyter-notebook',
annotations = {
'openshift.io/display-name': 'Jupyter Notebook'
}
),
... | 0 | 0 | 0 |
aa9423c064b3060cee79a27138249d0fc2b0e994 | 9,719 | py | Python | ShapeFlow/latent_optimization.py | vikasTmz/SP-GAN | bf152f60f287a728cc782aa53f2930154f18b2a3 | [
"MIT"
] | null | null | null | ShapeFlow/latent_optimization.py | vikasTmz/SP-GAN | bf152f60f287a728cc782aa53f2930154f18b2a3 | [
"MIT"
] | null | null | null | ShapeFlow/latent_optimization.py | vikasTmz/SP-GAN | bf152f60f287a728cc782aa53f2930154f18b2a3 | [
"MIT"
] | null | null | null | # load libraries
import trimesh
import torch
import json
import os
from tqdm import tqdm as tqdm
import matplotlib.pyplot as plt
import numpy as np
from types import SimpleNamespace
from utils import render
from shapenet_dataloader import ShapeNetMesh, FixedPointsCachedDataset
from shapeflow.layers.deforma... | 40.665272 | 154 | 0.646054 | # load libraries
import trimesh
import torch
import json
import os
from tqdm import tqdm as tqdm
import matplotlib.pyplot as plt
import numpy as np
from types import SimpleNamespace
from utils import render
from shapenet_dataloader import ShapeNetMesh, FixedPointsCachedDataset
from shapeflow.layers.deforma... | 512 | 0 | 25 |
9a095fa70c6ad73e7e67cb40766bf8b7fd494a67 | 179 | py | Python | vseros/2014-15/okr/road.py | dluschan/olymp | dfbf4352dbc7f6fd7563e7bd19aff6fd67fb50b7 | [
"MIT"
] | null | null | null | vseros/2014-15/okr/road.py | dluschan/olymp | dfbf4352dbc7f6fd7563e7bd19aff6fd67fb50b7 | [
"MIT"
] | null | null | null | vseros/2014-15/okr/road.py | dluschan/olymp | dfbf4352dbc7f6fd7563e7bd19aff6fd67fb50b7 | [
"MIT"
] | 1 | 2018-09-14T18:50:48.000Z | 2018-09-14T18:50:48.000Z | l = int(input())
n = int(input())
q = 0
c = 0
for i in range(n):
r = int(input())
if r == 1 and q == 0:
c += 1
q = l
if q > 0:
q -= 1
print(c)
| 13.769231 | 25 | 0.379888 | l = int(input())
n = int(input())
q = 0
c = 0
for i in range(n):
r = int(input())
if r == 1 and q == 0:
c += 1
q = l
if q > 0:
q -= 1
print(c)
| 0 | 0 | 0 |
9da0ec070f949eb4b97484730f10d45faad473ce | 400 | py | Python | vyapp/plugins/cplusplus_mode.py | AndreasDavour/vy | 49b9f1249525f35467755a2a6faff709a38f78eb | [
"MIT"
] | 927 | 2015-02-22T17:34:21.000Z | 2018-03-23T07:26:17.000Z | vyapp/plugins/cplusplus_mode.py | AndreasDavour/vy | 49b9f1249525f35467755a2a6faff709a38f78eb | [
"MIT"
] | 22 | 2015-09-02T19:20:22.000Z | 2018-02-13T16:41:02.000Z | vyapp/plugins/cplusplus_mode.py | AndreasDavour/vy | 49b9f1249525f35467755a2a6faff709a38f78eb | [
"MIT"
] | 53 | 2015-09-02T12:26:32.000Z | 2018-01-18T09:11:30.000Z | """
Overview
========
Extra mode for cplusplus programming language.
Key-Commands
============
Namespace: cplusplus-mode
Mode: NORMAL
Event: <Key-exclam>
Description: Switch to C++ mode.
"""
| 14.814815 | 65 | 0.6475 | """
Overview
========
Extra mode for cplusplus programming language.
Key-Commands
============
Namespace: cplusplus-mode
Mode: NORMAL
Event: <Key-exclam>
Description: Switch to C++ mode.
"""
def cplusplus_mode(area):
area.chmode('C++')
def install(area):
area.add_mode('C++')
area.install('cplusplus-mo... | 156 | 0 | 46 |
0a61d2bc9a30a523fc28bc617e15fb34497678c5 | 2,873 | py | Python | gmprocess/subcommands/generate_station_maps.py | usgs/groundmotion-processing- | ed188e2bb1dcd9b17433ef4677874eac654fdd16 | [
"Unlicense"
] | null | null | null | gmprocess/subcommands/generate_station_maps.py | usgs/groundmotion-processing- | ed188e2bb1dcd9b17433ef4677874eac654fdd16 | [
"Unlicense"
] | null | null | null | gmprocess/subcommands/generate_station_maps.py | usgs/groundmotion-processing- | ed188e2bb1dcd9b17433ef4677874eac654fdd16 | [
"Unlicense"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import logging
from gmprocess.subcommands.lazy_loader import LazyLoader
arg_dicts = LazyLoader("arg_dicts", globals(), "gmprocess.subcommands.arg_dicts")
base = LazyLoader("base", globals(), "gmprocess.subcommands.base")
ws = LazyLoader("ws", globals(), "gmproc... | 34.202381 | 86 | 0.589976 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import logging
from gmprocess.subcommands.lazy_loader import LazyLoader
arg_dicts = LazyLoader("arg_dicts", globals(), "gmprocess.subcommands.arg_dicts")
base = LazyLoader("base", globals(), "gmprocess.subcommands.base")
ws = LazyLoader("ws", globals(), "gmproc... | 0 | 0 | 0 |
5d2c8736f77e90c48ff56c0822bfd348de0ee4a8 | 988 | py | Python | backend/users/migrations/0001_initial.py | Dambre/mixas-su-jalapenais | d75a91e189cfbb9009956724b5ec63a87224d587 | [
"MIT"
] | null | null | null | backend/users/migrations/0001_initial.py | Dambre/mixas-su-jalapenais | d75a91e189cfbb9009956724b5ec63a87224d587 | [
"MIT"
] | null | null | null | backend/users/migrations/0001_initial.py | Dambre/mixas-su-jalapenais | d75a91e189cfbb9009956724b5ec63a87224d587 | [
"MIT"
] | null | null | null | # Generated by Django 2.1.2 on 2018-10-20 13:08
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
| 30.875 | 121 | 0.61336 | # Generated by Django 2.1.2 on 2018-10-20 13:08
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... | 0 | 796 | 23 |
dc5051e65a254e69892b3aa608794151ea614c29 | 4,446 | py | Python | src/python3/dsv/commands/rssac_daemon.py | MikeAT/visualizer | 946b98d82eaf7ec508861115585afd683fc49e5c | [
"MIT"
] | 6 | 2021-03-03T17:52:24.000Z | 2022-02-10T11:45:22.000Z | src/python3/dsv/commands/rssac_daemon.py | Acidburn0zzz/visualizer | 20fba91f0d26b98531f97f643c8329640d1c0d11 | [
"MIT"
] | 1 | 2021-04-29T12:34:04.000Z | 2021-04-29T14:50:17.000Z | src/python3/dsv/commands/rssac_daemon.py | Acidburn0zzz/visualizer | 20fba91f0d26b98531f97f643c8329640d1c0d11 | [
"MIT"
] | 2 | 2021-04-27T14:02:03.000Z | 2021-11-12T10:34:32.000Z | #!/usr/bin/env python3
#
# Copyright 2019-2020 Internet Corporation for Assigned Names and Numbers.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# Developed by S... | 37.361345 | 98 | 0.62798 | #!/usr/bin/env python3
#
# Copyright 2019-2020 Internet Corporation for Assigned Names and Numbers.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, you can obtain one at https://mozilla.org/MPL/2.0/.
#
# Developed by S... | 3,205 | 56 | 198 |
8a682866f7f53ac300ae1695ab2caaba0a8dbd04 | 5,785 | py | Python | tests/integration/test_notebook.py | adrianliaw/pybatfish | f9587a8598e8359949b982c30917a1e4c2bb3cc1 | [
"Apache-2.0"
] | null | null | null | tests/integration/test_notebook.py | adrianliaw/pybatfish | f9587a8598e8359949b982c30917a1e4c2bb3cc1 | [
"Apache-2.0"
] | null | null | null | tests/integration/test_notebook.py | adrianliaw/pybatfish | f9587a8598e8359949b982c30917a1e4c2bb3cc1 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2018 The Batfish Open Source Project
#
# 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 requi... | 36.847134 | 127 | 0.651858 | # coding=utf-8
# Copyright 2018 The Batfish Open Source Project
#
# 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 requi... | 3,396 | 0 | 159 |
869c036c623f29ea00d0e54c6e00b11a9d0a29d0 | 3,788 | py | Python | tests/test_app.py | rmoe/aiohttp_retry | 0f33dbed14fb239eea82001aee6416ac64441101 | [
"MIT"
] | null | null | null | tests/test_app.py | rmoe/aiohttp_retry | 0f33dbed14fb239eea82001aee6416ac64441101 | [
"MIT"
] | null | null | null | tests/test_app.py | rmoe/aiohttp_retry | 0f33dbed14fb239eea82001aee6416ac64441101 | [
"MIT"
] | null | null | null | from aiohttp import ClientResponseError
from aiohttp_retry import RetryClient, RetryOptions
from tests.app import App
| 27.449275 | 79 | 0.682418 | from aiohttp import ClientResponseError
from aiohttp_retry import RetryClient, RetryOptions
from tests.app import App
async def test_hello(aiohttp_client, loop):
test_app = App()
app = test_app.get_app()
client = await aiohttp_client(app)
retry_client = RetryClient()
retry_client._client = clien... | 3,501 | 0 | 161 |
d9efa806413f663599dc71ddc9c37974872101b5 | 413 | py | Python | build/bdist.macosx-10.10-intel/python2.7-standalone/app/temp/Quartz/CoreGraphics/_sortandmap.py | zhaorz/Touch-Calculator | a4ea33e3b1c741466ac0ddd00218ad8c0f34fa37 | [
"MIT"
] | 8 | 2016-06-23T19:26:05.000Z | 2018-11-08T21:32:10.000Z | build/bdist.macosx-10.10-intel/python2.7-standalone/app/temp/Quartz/CoreGraphics/_sortandmap.py | zhaorz/Touch-Calculator | a4ea33e3b1c741466ac0ddd00218ad8c0f34fa37 | [
"MIT"
] | null | null | null | build/bdist.macosx-10.10-intel/python2.7-standalone/app/temp/Quartz/CoreGraphics/_sortandmap.py | zhaorz/Touch-Calculator | a4ea33e3b1c741466ac0ddd00218ad8c0f34fa37 | [
"MIT"
] | null | null | null | __load()
del __load
| 25.8125 | 54 | 0.590799 |
def __load():
import imp, os, sys
ext = 'Quartz/CoreGraphics/_sortandmap.so'
for path in sys.path:
if not path.endswith('lib-dynload'):
continue
ext_path = os.path.join(path, ext)
if os.path.exists(ext_path):
mod = imp.load_dynamic(__name__, ext_path)
... | 370 | 0 | 23 |
438c364b57df95a2d5018cb87d920de25263515a | 4,565 | py | Python | skytap/models/Environment.py | mapledyne/skytap | c7fb43e7d2b3e97c619948a9e5b3f03472b5cd45 | [
"MIT"
] | 3 | 2019-04-17T13:07:30.000Z | 2021-09-09T22:01:14.000Z | skytap/models/Environment.py | FulcrumIT/skytap | c7fb43e7d2b3e97c619948a9e5b3f03472b5cd45 | [
"MIT"
] | 10 | 2016-11-02T20:48:38.000Z | 2021-09-15T15:29:34.000Z | skytap/models/Environment.py | FulcrumIT/skytap | c7fb43e7d2b3e97c619948a9e5b3f03472b5cd45 | [
"MIT"
] | 3 | 2016-03-03T07:25:13.000Z | 2016-08-30T15:33:03.000Z | """Support for an Environment resource in Skytap.
In nearly every case, you'll access an Environment via the
:class:`~skytap.Environments` object::
envs = skytap.Environments()
for environment in envs:
print (environment.name)
You can access anything from an environment that Skytap includes in their
... | 34.847328 | 79 | 0.663308 | """Support for an Environment resource in Skytap.
In nearly every case, you'll access an Environment via the
:class:`~skytap.Environments` object::
envs = skytap.Environments()
for environment in envs:
print (environment.name)
You can access anything from an environment that Skytap includes in their
... | 0 | 0 | 0 |
4cc8630446303f723567a2dabc3fafbe9ff37456 | 67 | py | Python | hello.py | Lyreguin/cs3240-labdemo | cdb81dcee5fc04350ab505e92fcc323a28d15dae | [
"MIT"
] | null | null | null | hello.py | Lyreguin/cs3240-labdemo | cdb81dcee5fc04350ab505e92fcc323a28d15dae | [
"MIT"
] | null | null | null | hello.py | Lyreguin/cs3240-labdemo | cdb81dcee5fc04350ab505e92fcc323a28d15dae | [
"MIT"
] | null | null | null | import helper
import blargh
helper.greeting("Hello")
blargh.nein() | 13.4 | 24 | 0.791045 | import helper
import blargh
helper.greeting("Hello")
blargh.nein() | 0 | 0 | 0 |
b9cc3738ac2de51376d0c69f1cbdf0df94ef8866 | 7,620 | py | Python | src/modules/ppt_gen.py | swagkarna/macro_pack | 8f92419bd1db513bf4d093119406093e0ead252f | [
"Apache-2.0"
] | 1 | 2020-06-08T18:03:16.000Z | 2020-06-08T18:03:16.000Z | src/modules/ppt_gen.py | keyunlocker12/macro_pack | b78ab82eceef02ae0c5d0c72ca78c58349cf697f | [
"Apache-2.0"
] | null | null | null | src/modules/ppt_gen.py | keyunlocker12/macro_pack | b78ab82eceef02ae0c5d0c72ca78c58349cf697f | [
"Apache-2.0"
] | 1 | 2022-03-03T22:54:00.000Z | 2022-03-03T22:54:00.000Z | #!/usr/bin/env python
# encoding: utf-8
# Only enabled on windows
import sys
import os
import shutil
from zipfile import ZipFile
from common.utils import MSTypes
if sys.platform == "win32":
# Download and install pywin32 from https://sourceforge.net/projects/pywin32/files/pywin32/
import win32com.client # @Unr... | 46.463415 | 852 | 0.623491 | #!/usr/bin/env python
# encoding: utf-8
# Only enabled on windows
import sys
import os
import shutil
from zipfile import ZipFile
from common.utils import MSTypes
if sys.platform == "win32":
# Download and install pywin32 from https://sourceforge.net/projects/pywin32/files/pywin32/
import win32com.client # @Unr... | 6,771 | 0 | 217 |
073d1efdc23d098f8ab201f08413747e8e81c2f5 | 4,248 | py | Python | tests/security/test_kerberos.py | c-nuro/airflow | d491afb7868331f6e5de603f51caca4527ccfa71 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 2 | 2021-07-30T16:25:53.000Z | 2021-08-03T13:52:45.000Z | tests/security/test_kerberos.py | c-nuro/airflow | d491afb7868331f6e5de603f51caca4527ccfa71 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | null | null | null | tests/security/test_kerberos.py | c-nuro/airflow | d491afb7868331f6e5de603f51caca4527ccfa71 | [
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0",
"BSD-3-Clause"
] | 1 | 2020-10-01T08:48:37.000Z | 2020-10-01T08:48:37.000Z | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 39.700935 | 110 | 0.67467 | #
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | 147 | 2,939 | 22 |
4146fc6fe339f1ae87371e0ae6b1ba1174c19c7c | 2,603 | py | Python | synth/devices/bulb.py | pervasivesolutions/synth | 7b00f14dffc2630acd2743d0d5cf9f7c1627b067 | [
"MIT"
] | 2 | 2021-03-15T18:02:46.000Z | 2021-12-09T20:54:25.000Z | synth/devices/bulb.py | pervasivesolutions/synth | 7b00f14dffc2630acd2743d0d5cf9f7c1627b067 | [
"MIT"
] | 2 | 2017-04-18T08:41:49.000Z | 2017-10-04T15:13:06.000Z | synth/devices/bulb.py | pervasivesolutions/synth | 7b00f14dffc2630acd2743d0d5cf9f7c1627b067 | [
"MIT"
] | 3 | 2018-02-06T17:07:06.000Z | 2020-01-27T17:05:11.000Z | """
bulb
=====
Simulates a light switch, given a device which has a longitude and latitude (therefore a time of day and therefore an external light level)
Reacts appropriately to location on Earth, time-of-day and season-of-year.
Configurable parameters::
{
"power" : (optional) number (or list to pick ... | 36.661972 | 139 | 0.634268 | """
bulb
=====
Simulates a light switch, given a device which has a longitude and latitude (therefore a time of day and therefore an external light level)
Reacts appropriately to location on Earth, time-of-day and season-of-year.
Configurable parameters::
{
"power" : (optional) number (or list to pick ... | 1,759 | -2 | 156 |
daddebc8cb70194d7dff4164d8725f252254afc8 | 674 | py | Python | app/app/models/migrations/versions/9d05939446cd_.py | czr1803/kryptos | 2e8e20b81c7486283ab39df053146048f5496474 | [
"MIT"
] | 45 | 2019-01-27T13:47:51.000Z | 2022-03-13T00:25:21.000Z | app/app/models/migrations/versions/9d05939446cd_.py | czr1803/kryptos | 2e8e20b81c7486283ab39df053146048f5496474 | [
"MIT"
] | 64 | 2019-01-24T06:43:13.000Z | 2020-03-09T17:14:52.000Z | app/app/models/migrations/versions/9d05939446cd_.py | produvia/kryptos | 2e8e20b81c7486283ab39df053146048f5496474 | [
"MIT"
] | 4 | 2019-11-21T10:49:17.000Z | 2021-09-30T03:33:00.000Z | """empty message
Revision ID: 9d05939446cd
Revises: 1d39fb6ab24a
Create Date: 2018-07-24 20:12:53.214761
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '9d05939446cd'
down_revision = '1d39fb6ab24a'
branch_labels = None
depends_on = None
| 23.241379 | 88 | 0.700297 | """empty message
Revision ID: 9d05939446cd
Revises: 1d39fb6ab24a
Create Date: 2018-07-24 20:12:53.214761
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '9d05939446cd'
down_revision = '1d39fb6ab24a'
branch_labels = None
depends_on = None
def upgrade():
# ... | 329 | 0 | 46 |
6cd19528c24cd33bd6e0ca992420330a4d470fd8 | 325 | py | Python | standup/manage/tests/test_views.py | mozilla/standup | 7b5a581d784cc7fce4851886e5528f6ab4752658 | [
"BSD-3-Clause"
] | 58 | 2015-02-04T15:55:30.000Z | 2020-07-21T16:10:35.000Z | standup/manage/tests/test_views.py | mozilla/standup | 7b5a581d784cc7fce4851886e5528f6ab4752658 | [
"BSD-3-Clause"
] | 302 | 2015-01-20T16:22:37.000Z | 2018-10-25T20:44:51.000Z | standup/manage/tests/test_views.py | mozilla/standup | 7b5a581d784cc7fce4851886e5528f6ab4752658 | [
"BSD-3-Clause"
] | 17 | 2015-01-31T11:43:17.000Z | 2020-08-03T02:04:01.000Z | from django.core.urlresolvers import reverse
from django.test import TestCase
# FIXME(willkg): add test for authenticated and staff
| 29.545455 | 60 | 0.753846 | from django.core.urlresolvers import reverse
from django.test import TestCase
class StatisticsViewTestCase(TestCase):
def test_unauthenticated_redirects(self):
resp = self.client.get(reverse('manage.statistics'))
assert resp.status_code == 302
# FIXME(willkg): add test for authenticated and s... | 120 | 18 | 49 |
96533d1c18280ee61ea041f731ad3995921ee237 | 1,149 | py | Python | src/sbml_model_checkup.py | subkar/rasmodel | 20d339f2910bcf52e36afc4a1225e1e325d696bb | [
"MIT"
] | null | null | null | src/sbml_model_checkup.py | subkar/rasmodel | 20d339f2910bcf52e36afc4a1225e1e325d696bb | [
"MIT"
] | null | null | null | src/sbml_model_checkup.py | subkar/rasmodel | 20d339f2910bcf52e36afc4a1225e1e325d696bb | [
"MIT"
] | null | null | null | """Debugging/cleanup checks."""
import itertools
import chen_2009_original_sbml
model = chen_2009_original_sbml.load_model()
# determine redundant species (same name)
sa = sorted(model.species, key=lambda s: (s.label, s.compartment))
rs = [x
for x in ((n, map(lambda s: s.compartment, it))
for n, it i... | 31.054054 | 73 | 0.630983 | """Debugging/cleanup checks."""
import itertools
import chen_2009_original_sbml
model = chen_2009_original_sbml.load_model()
# determine redundant species (same name)
sa = sorted(model.species, key=lambda s: (s.label, s.compartment))
rs = [x
for x in ((n, map(lambda s: s.compartment, it))
for n, it i... | 140 | 0 | 44 |
3615d853a55dd0576fff4435f50c117dc12531de | 200 | py | Python | rtstock/error.py | condereis/realtime-stock | a00836a7cd55313866ab26eb1aaa7d5fb14af94a | [
"MIT"
] | 27 | 2016-07-12T02:52:03.000Z | 2021-07-22T21:15:50.000Z | rtstock/error.py | condereis/realtime-stock | a00836a7cd55313866ab26eb1aaa7d5fb14af94a | [
"MIT"
] | 399 | 2016-07-26T00:55:07.000Z | 2022-03-27T20:02:18.000Z | rtstock/error.py | condereis/realtime-stock | a00836a7cd55313866ab26eb1aaa7d5fb14af94a | [
"MIT"
] | 14 | 2018-03-23T20:57:10.000Z | 2021-12-19T19:21:54.000Z | """Exceptions module.
Custom exceptions used by Realtime Stock package.
"""
from __future__ import unicode_literals
class RequestError(Exception):
"""Class for request exception."""
pass
| 15.384615 | 49 | 0.74 | """Exceptions module.
Custom exceptions used by Realtime Stock package.
"""
from __future__ import unicode_literals
class RequestError(Exception):
"""Class for request exception."""
pass
| 0 | 0 | 0 |
2c6aedecd27e138b8c47db2b7fd2870f6ab02468 | 16,281 | py | Python | src/python/python-personality/pymcas/api.py | omriarad/mcas | f47aab12754c91ebd75b0e1881c8a7cc7aa81278 | [
"Apache-2.0"
] | 60 | 2020-04-28T08:15:07.000Z | 2022-03-08T10:35:15.000Z | src/python/python-personality/pymcas/api.py | omriarad/mcas | f47aab12754c91ebd75b0e1881c8a7cc7aa81278 | [
"Apache-2.0"
] | 66 | 2020-09-03T23:40:48.000Z | 2022-03-07T20:34:52.000Z | src/python/python-personality/pymcas/api.py | omriarad/mcas | f47aab12754c91ebd75b0e1881c8a7cc7aa81278 | [
"Apache-2.0"
] | 13 | 2019-11-02T06:30:36.000Z | 2022-01-26T01:56:42.000Z | # Copyright [2017-2021] [IBM Corporation]
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writ... | 32.824597 | 115 | 0.609545 | # Copyright [2017-2021] [IBM Corporation]
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writ... | 3,643 | 0 | 575 |
ae9fad333cd96835fa1650d19848c61d10e0eaf5 | 2,057 | py | Python | src/commands/config.py | vicobits/sawi-cli | 0e3717e0e3d853599b87f8ea147a3f1e9566344b | [
"MIT"
] | 1 | 2019-05-02T05:16:07.000Z | 2019-05-02T05:16:07.000Z | src/commands/config.py | vicobits/wise-cli | 0e3717e0e3d853599b87f8ea147a3f1e9566344b | [
"MIT"
] | null | null | null | src/commands/config.py | vicobits/wise-cli | 0e3717e0e3d853599b87f8ea147a3f1e9566344b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import json
from dataclasses import dataclass
from contextlib import contextmanager
from typing import Optional
from src.commands.enums import WebServer, Database, Deployment
from src.constants import CONFIG_FILE_NAME, SHARED_GROUP, HOME_BASE_PATH
@dataclass
@contextmanager
| 29.811594 | 79 | 0.655809 | # -*- coding: utf-8 -*-
import json
from dataclasses import dataclass
from contextlib import contextmanager
from typing import Optional
from src.commands.enums import WebServer, Database, Deployment
from src.constants import CONFIG_FILE_NAME, SHARED_GROUP, HOME_BASE_PATH
@dataclass
class ProjectConfig(object):
... | 1,138 | 543 | 67 |
96399b801d481686dc3b268c73f1cde0bb87e4fc | 2,010 | py | Python | morse4pico.py | slouchd/morse4pico | 3273fc8852d6cac36e8248c37a1272b2d3269d04 | [
"MIT"
] | 1 | 2021-01-31T17:15:59.000Z | 2021-01-31T17:15:59.000Z | morse4pico.py | slouchd/morse4pico | 3273fc8852d6cac36e8248c37a1272b2d3269d04 | [
"MIT"
] | null | null | null | morse4pico.py | slouchd/morse4pico | 3273fc8852d6cac36e8248c37a1272b2d3269d04 | [
"MIT"
] | 1 | 2021-01-26T08:40:29.000Z | 2021-01-26T08:40:29.000Z | MORSE = {'A': '.-', 'B': '-...', 'C': '-.-.',
'D': '-..', 'E': '.', 'F': '..-.',
'G': '--.', 'H': '....', 'I': '..',
'J': '.---', 'K': '-.-', 'L': '.-..',
'M': '--', 'N': '-.', 'O': '---',
'P': '.--.', 'Q': '--.-', 'R': '.-.',
'S': '...... | 35.263158 | 71 | 0.369652 | MORSE = {'A': '.-', 'B': '-...', 'C': '-.-.',
'D': '-..', 'E': '.', 'F': '..-.',
'G': '--.', 'H': '....', 'I': '..',
'J': '.---', 'K': '-.-', 'L': '.-..',
'M': '--', 'N': '-.', 'O': '---',
'P': '.--.', 'Q': '--.-', 'R': '.-.',
'S': '...... | 608 | 0 | 69 |
01ed16759af8870904a3d915941923c50f1d90e9 | 1,787 | py | Python | comgames/play/main.py | houluy/comgames | aa2bcb6ef0d16807bab0eebcfe9a4818aebc0c3b | [
"MIT"
] | 2 | 2018-02-21T16:00:20.000Z | 2018-06-18T10:22:21.000Z | comgames/play/main.py | houluy/comgames | aa2bcb6ef0d16807bab0eebcfe9a4818aebc0c3b | [
"MIT"
] | null | null | null | comgames/play/main.py | houluy/comgames | aa2bcb6ef0d16807bab0eebcfe9a4818aebc0c3b | [
"MIT"
] | null | null | null | import sys
import socket
from comgames.play.game import Game
from comgames.AI.env import Env
from comgames.AI.agent import agent_list
from comgames.AI.train import Trainer
from comgames.utils import *
| 29.783333 | 78 | 0.530498 | import sys
import socket
from comgames.play.game import Game
from comgames.AI.env import Env
from comgames.AI.agent import agent_list
from comgames.AI.train import Trainer
from comgames.utils import *
def main(args):
if args.connect or args.host:
# Play online
s = socket.socket(socket.AF_INET, so... | 1,558 | 0 | 23 |
2864cdf645860e2645a096b6ff9b8148f0782cf9 | 3,830 | py | Python | SNCPython/SensorDrivers/RT_TMP102.py | rt-ispace/SNC | 890acbbe336bb0429f47fa7bed499a46215aac64 | [
"MIT"
] | 1 | 2021-08-08T05:40:52.000Z | 2021-08-08T05:40:52.000Z | SNCPython/SensorDrivers/RT_TMP102.py | rt-ispace/SNC | 890acbbe336bb0429f47fa7bed499a46215aac64 | [
"MIT"
] | null | null | null | SNCPython/SensorDrivers/RT_TMP102.py | rt-ispace/SNC | 890acbbe336bb0429f47fa7bed499a46215aac64 | [
"MIT"
] | 1 | 2021-08-08T05:40:56.000Z | 2021-08-08T05:40:56.000Z | #!/usr/bin/python
'''
This file is part of SNC
Copyright (c) 2014-2021, Richard Barnett
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 limitati... | 40.744681 | 95 | 0.622977 | #!/usr/bin/python
'''
This file is part of SNC
Copyright (c) 2014-2021, Richard Barnett
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 limitati... | 845 | 0 | 121 |
0c732685374ab86ee80f9ccf8136defd2f0473e4 | 3,144 | py | Python | kopt/model_data.py | matuseviciute/kopt | 9b9e6926077d559f5f546025ec5b8120c36ba14e | [
"MIT"
] | 34 | 2018-04-09T21:35:40.000Z | 2021-10-05T19:55:07.000Z | kopt/model_data.py | matuseviciute/kopt | 9b9e6926077d559f5f546025ec5b8120c36ba14e | [
"MIT"
] | 5 | 2018-03-11T22:51:46.000Z | 2021-03-21T20:57:31.000Z | kopt/model_data.py | matuseviciute/kopt | 9b9e6926077d559f5f546025ec5b8120c36ba14e | [
"MIT"
] | 10 | 2018-03-12T10:14:52.000Z | 2021-03-20T15:24:33.000Z | """Functions for working with model data from keras
"""
from __future__ import absolute_import
from __future__ import print_function
from sklearn import model_selection
import numpy as np
def test_len(train):
"""Test if all the elements in `train=(x,y)` the same `shape[0]`
"""
l = train[1].shape[0]
if... | 34.549451 | 153 | 0.617366 | """Functions for working with model data from keras
"""
from __future__ import absolute_import
from __future__ import print_function
from sklearn import model_selection
import numpy as np
def test_len(train):
"""Test if all the elements in `train=(x,y)` the same `shape[0]`
"""
l = train[1].shape[0]
if... | 0 | 0 | 0 |
aa96f8c8c605f4d99c711147bb723b41f4965cb4 | 16,273 | py | Python | operators_modal.py | leegoonz/Abnormal | 893120f86b1ef5f179f343c09ee073ba538261c1 | [
"MIT"
] | 1 | 2020-04-30T08:28:05.000Z | 2020-04-30T08:28:05.000Z | operators_modal.py | leegoonz/Abnormal | 893120f86b1ef5f179f343c09ee073ba538261c1 | [
"MIT"
] | null | null | null | operators_modal.py | leegoonz/Abnormal | 893120f86b1ef5f179f343c09ee073ba538261c1 | [
"MIT"
] | null | null | null | import bpy
import math
import mathutils
import bmesh
import time
from bpy.props import *
from bpy.types import Operator
from bpy_extras import view3d_utils
from .properties import *
from .functions_general import *
from .functions_drawing import *
from .functions_modal import *
from .functions_keymaps impor... | 37.932401 | 134 | 0.559393 | import bpy
import math
import mathutils
import bmesh
import time
from bpy.props import *
from bpy.types import Operator
from bpy_extras import view3d_utils
from .properties import *
from .functions_general import *
from .functions_drawing import *
from .functions_modal import *
from .functions_keymaps impor... | 15,595 | 234 | 24 |
4e42b112abd5ae9a27ae0a5aa353e8bf030a0c05 | 1,314 | py | Python | Tree/BinaryTree/Top_View.py | Amanjakhetiya/Data_Structures_Algorithms_In_Python | fb4487b3ec9e4485df44d24a887e5c92ea7afaee | [
"MIT"
] | 195 | 2019-06-06T16:28:59.000Z | 2022-03-20T10:55:12.000Z | Tree/BinaryTree/Top_View.py | Amanjakhetiya/Data_Structures_Algorithms_In_Python | fb4487b3ec9e4485df44d24a887e5c92ea7afaee | [
"MIT"
] | null | null | null | Tree/BinaryTree/Top_View.py | Amanjakhetiya/Data_Structures_Algorithms_In_Python | fb4487b3ec9e4485df44d24a887e5c92ea7afaee | [
"MIT"
] | 90 | 2019-06-06T07:28:23.000Z | 2022-03-09T10:03:51.000Z | # Print Nodes in Top View of Binary Tree
from collections import deque
if __name__ == '__main__':
root = Node(1)
root.left = Node(2)
root.right = Node(3)
root.left.right = Node(4)
root.left.right.right = Node(5)
root.left.right.right.right = Node(6)
for i in top_view(root):
prin... | 23.052632 | 70 | 0.576104 | # Print Nodes in Top View of Binary Tree
from collections import deque
class Node:
def __init__(self, data):
self.data = data
self.left = None
self.right = None
def top_view(root):
if root is None:
return
# make an empty queue for BFS
q = deque()
# empty set
... | 915 | -10 | 72 |
a773865beda67f2c2bcc5e21c4efe1498d0f34ff | 1,994 | py | Python | Test_TwoS_Net_ST4Vid.py | zhangkao/IIP_TwoS_Saliency | 4d72cd6c21c98f8d52427dafb30329fdd19132f8 | [
"MIT"
] | 10 | 2019-03-18T03:12:13.000Z | 2021-12-28T08:11:17.000Z | Test_TwoS_Net_ST4Vid.py | zhangkao/IIP_TwoS_Saliency | 4d72cd6c21c98f8d52427dafb30329fdd19132f8 | [
"MIT"
] | 3 | 2020-11-26T12:40:43.000Z | 2022-01-07T08:57:36.000Z | Test_TwoS_Net_ST4Vid.py | zhangkao/IIP_TwoS_Saliency | 4d72cd6c21c98f8d52427dafb30329fdd19132f8 | [
"MIT"
] | 2 | 2021-09-06T05:14:10.000Z | 2021-12-28T08:10:59.000Z | from __future__ import division
import os, cv2, sys, math,random
import numpy as np
import hdf5storage as h5io
import keras.backend as K
from zk_config import *
from zk_utilities import *
from zk_models import *
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
if __name__ == '__main__':
camera_number = 0
cap = cv2.... | 28.898551 | 105 | 0.634403 | from __future__ import division
import os, cv2, sys, math,random
import numpy as np
import hdf5storage as h5io
import keras.backend as K
from zk_config import *
from zk_utilities import *
from zk_models import *
os.environ["CUDA_VISIBLE_DEVICES"] = "0"
if __name__ == '__main__':
camera_number = 0
cap = cv2.... | 0 | 0 | 0 |
f91fce26db963b07d246dc47fe28ea1d07616a43 | 2,147 | py | Python | stat_arb_tools/sigma.py | devnull-capital/stat_arb_tools | 927b3de6ba82e444eac05b2ac39ce25e78c94b0c | [
"MIT"
] | 6 | 2019-01-05T03:32:19.000Z | 2022-03-08T19:45:04.000Z | stat_arb_tools/sigma.py | devnull-capital/stat_arb_tools | 927b3de6ba82e444eac05b2ac39ce25e78c94b0c | [
"MIT"
] | 1 | 2021-06-01T23:14:18.000Z | 2021-06-01T23:14:18.000Z | stat_arb_tools/sigma.py | devnull-capital/stat_arb_tools | 927b3de6ba82e444eac05b2ac39ce25e78c94b0c | [
"MIT"
] | 1 | 2022-02-19T17:30:35.000Z | 2022-02-19T17:30:35.000Z | from math import log, sqrt
from typing import List
from .exceptions import NilListException, MissMatchedLengthException, ZeroHedgeRatioException
L2ZeroValException = Exception("a zero value in l2")
BetaHatLTEZeroException = Exception("beta hat is negative")
def calcSigmaHat(l1: List[float], l2: List[float], betaHat: ... | 23.855556 | 96 | 0.619935 | from math import log, sqrt
from typing import List
from .exceptions import NilListException, MissMatchedLengthException, ZeroHedgeRatioException
L2ZeroValException = Exception("a zero value in l2")
BetaHatLTEZeroException = Exception("beta hat is negative")
def calcSigmaHat(l1: List[float], l2: List[float], betaHat: ... | 0 | 0 | 0 |
1833023bfa3b80183f805036f3de62bd45c1ea3e | 5,745 | py | Python | sbpack/lib.py | mr-c/sbpack | cda5131f01256cf339896eccfe55288d3cfc6d6e | [
"Apache-2.0"
] | 1 | 2021-11-01T13:06:31.000Z | 2021-11-01T13:06:31.000Z | sbpack/lib.py | mr-c/sbpack | cda5131f01256cf339896eccfe55288d3cfc6d6e | [
"Apache-2.0"
] | null | null | null | sbpack/lib.py | mr-c/sbpack | cda5131f01256cf339896eccfe55288d3cfc6d6e | [
"Apache-2.0"
] | null | null | null | from typing import Union
from copy import deepcopy
import urllib.parse
import urllib.request
import pathlib
import sys
import sevenbridges as sbg
from .version import __version__
from ruamel.yaml.parser import ParserError
from ruamel.yaml.scanner import ScannerError
from ruamel.yaml import YAML
fast_yaml = YAML(typ=... | 29.921875 | 129 | 0.621584 | from typing import Union
from copy import deepcopy
import urllib.parse
import urllib.request
import pathlib
import sys
import sevenbridges as sbg
from .version import __version__
from ruamel.yaml.parser import ParserError
from ruamel.yaml.scanner import ScannerError
from ruamel.yaml import YAML
fast_yaml = YAML(typ=... | 2,997 | 130 | 229 |
4a5e358a69961fd2c29cca3c3b0279ac1a2e0c1d | 2,190 | py | Python | eeg_modelling/eeg_viewer/utils_test.py | nilu33032/google-research | bb8f5457fd9dba56018b23a038249c539c1b7491 | [
"Apache-2.0"
] | 1 | 2019-04-18T15:03:39.000Z | 2019-04-18T15:03:39.000Z | eeg_modelling/eeg_viewer/utils_test.py | nilu33032/google-research | bb8f5457fd9dba56018b23a038249c539c1b7491 | [
"Apache-2.0"
] | null | null | null | eeg_modelling/eeg_viewer/utils_test.py | nilu33032/google-research | bb8f5457fd9dba56018b23a038249c539c1b7491 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# Copyright 2019 The Google Research 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 applicab... | 38.421053 | 79 | 0.583105 | # coding=utf-8
# Copyright 2019 The Google Research 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 applicab... | 1,307 | 14 | 123 |
0628b603d2e45a1f23708c911f7bd94498fc12af | 3,515 | py | Python | models/sampling.py | sunbelbd/PaddleEBM | 218fabea1a43ebcc208729397aa2d69044ab323b | [
"Apache-2.0"
] | null | null | null | models/sampling.py | sunbelbd/PaddleEBM | 218fabea1a43ebcc208729397aa2d69044ab323b | [
"Apache-2.0"
] | null | null | null | models/sampling.py | sunbelbd/PaddleEBM | 218fabea1a43ebcc208729397aa2d69044ab323b | [
"Apache-2.0"
] | null | null | null | import paddle
from .builder import SAMPLINGS
@SAMPLINGS.register()
class SamplingLangevin(SamplingBase):
""" This class implements the Langevin Dynamic.
Gradient clipping and noise decay is supported.
TODO: logger, warm start etc.
""" | 41.845238 | 146 | 0.588336 | import paddle
from .builder import SAMPLINGS
class SamplingBase(object):
def __init__(self, net, num_steps, step_size, refsig, noise_ratio=1,
noise_decay=False, langevin_clip=-1, activate_eval=False, **kwargs):
super().__init__()
self.energy_function = net
self.num_ste... | 3,144 | 6 | 105 |
7d47b097a56d9498c18e143be2927e2e9ddaea9d | 31,419 | py | Python | Post-process/postproc_spreadsheet.py | michgz/vibration-record | 854a21a135cc86e1ce6b1ed28caadb6a770fa2c6 | [
"MIT"
] | null | null | null | Post-process/postproc_spreadsheet.py | michgz/vibration-record | 854a21a135cc86e1ce6b1ed28caadb6a770fa2c6 | [
"MIT"
] | null | null | null | Post-process/postproc_spreadsheet.py | michgz/vibration-record | 854a21a135cc86e1ce6b1ed28caadb6a770fa2c6 | [
"MIT"
] | null | null | null | # Run with Python 2.7
##
import zipfile
import shutil
import numpy
import os
import sys
import datetime
import getopt
#### Set this variable to True if only a tabulated summary output is *NOT* required #####
bIsShort = True
currentTriggerVal = 0
## Calculate square of a number
####################... | 45.468886 | 572 | 0.571915 | # Run with Python 2.7
##
import zipfile
import shutil
import numpy
import os
import sys
import datetime
import getopt
#### Set this variable to True if only a tabulated summary output is *NOT* required #####
bIsShort = True
currentTriggerVal = 0
def bIncludeTraces():
return not bIsShort
def bAddHeartbeatsTable... | 30,356 | 143 | 276 |
ed19d95df3f9ef8820a44e088664a4abe9f32288 | 10,709 | py | Python | mindspore/python/mindspore/nn/probability/distribution/poisson.py | httpsgithu/mindspore | c29d6bb764e233b427319cb89ba79e420f1e2c64 | [
"Apache-2.0"
] | 1 | 2022-02-23T09:13:43.000Z | 2022-02-23T09:13:43.000Z | mindspore/python/mindspore/nn/probability/distribution/poisson.py | 949144093/mindspore | c29d6bb764e233b427319cb89ba79e420f1e2c64 | [
"Apache-2.0"
] | null | null | null | mindspore/python/mindspore/nn/probability/distribution/poisson.py | 949144093/mindspore | c29d6bb764e233b427319cb89ba79e420f1e2c64 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | 36.179054 | 117 | 0.575591 | # Copyright 2020 Huawei Technologies Co., Ltd
#
# 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... | 182 | 0 | 54 |
5bff96be895f9852ef74d811f667f9e722758f24 | 6,538 | py | Python | greykite/common/features/normalize.py | CaduceusInc/greykite | 7d49c7a13d28f743e0a4b4c27696547f5e2c10c9 | [
"BSD-2-Clause"
] | 1,503 | 2021-05-13T02:43:42.000Z | 2022-03-28T22:48:34.000Z | greykite/common/features/normalize.py | CaduceusInc/greykite | 7d49c7a13d28f743e0a4b4c27696547f5e2c10c9 | [
"BSD-2-Clause"
] | 59 | 2021-05-15T07:23:18.000Z | 2022-03-31T18:52:00.000Z | greykite/common/features/normalize.py | CaduceusInc/greykite | 7d49c7a13d28f743e0a4b4c27696547f5e2c10c9 | [
"BSD-2-Clause"
] | 67 | 2021-05-13T02:44:04.000Z | 2022-03-25T04:08:12.000Z | # BSD 2-CLAUSE LICENSE
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# Redistributions i... | 44.47619 | 89 | 0.677118 | # BSD 2-CLAUSE LICENSE
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# Redistributions i... | 0 | 0 | 0 |
98b9d27723f96760eb0ede28fec67292e0fcc498 | 2,405 | py | Python | scripts/compensated_insufficient.py | dhermes/k-compensated-de-casteljau | 8511f0c2c525ac24215f6307e80032329f97301d | [
"Apache-2.0"
] | 2 | 2020-02-22T15:45:20.000Z | 2020-12-03T07:56:01.000Z | scripts/compensated_insufficient.py | dhermes/k-compensated-de-casteljau | 8511f0c2c525ac24215f6307e80032329f97301d | [
"Apache-2.0"
] | null | null | null | scripts/compensated_insufficient.py | dhermes/k-compensated-de-casteljau | 8511f0c2c525ac24215f6307e80032329f97301d | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 27.643678 | 74 | 0.619958 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | 1,400 | 0 | 23 |
582264c2afe821473151ce1a5b0dc57c29b067f3 | 200 | py | Python | sqla_flow/utils.py | nico525/sqla-flow | cd4d2469885c9e46f5abd0fee701364fd7d78d6b | [
"MIT"
] | null | null | null | sqla_flow/utils.py | nico525/sqla-flow | cd4d2469885c9e46f5abd0fee701364fd7d78d6b | [
"MIT"
] | null | null | null | sqla_flow/utils.py | nico525/sqla-flow | cd4d2469885c9e46f5abd0fee701364fd7d78d6b | [
"MIT"
] | null | null | null | from slugify import slugify as _slugify
| 25 | 68 | 0.78 | from slugify import slugify as _slugify
def slugify(column_name):
def default_function(context):
return _slugify(context.current_parameters.get(column_name))
return default_function
| 136 | 0 | 23 |
08d30a61b297ba3332ec5269122886eb61fe9693 | 52,800 | py | Python | evaluation.py | nahmad16/sptrsv_framework | 723b4859c3c9c2f53a5468e97b5924708b3c91f3 | [
"BSD-3-Clause"
] | 6 | 2020-09-05T10:02:34.000Z | 2022-03-14T00:12:48.000Z | evaluation.py | nahmad16/sptrsv_framework | 723b4859c3c9c2f53a5468e97b5924708b3c91f3 | [
"BSD-3-Clause"
] | null | null | null | evaluation.py | nahmad16/sptrsv_framework | 723b4859c3c9c2f53a5468e97b5924708b3c91f3 | [
"BSD-3-Clause"
] | 1 | 2020-08-25T13:20:47.000Z | 2020-08-25T13:20:47.000Z | import pandas as pd
import seaborn as sns
import json
import matplotlib.pyplot as plt
import sys
from sklearn.feature_selection import SelectKBest
from sklearn.feature_selection import chi2
from sklearn.preprocessing import StandardScaler, LabelEncoder
from sklearn.model_selection import train_test_split
from sklearn.e... | 61.682243 | 232 | 0.688201 | import pandas as pd
import seaborn as sns
import json
import matplotlib.pyplot as plt
import sys
from sklearn.feature_selection import SelectKBest
from sklearn.feature_selection import chi2
from sklearn.preprocessing import StandardScaler, LabelEncoder
from sklearn.model_selection import train_test_split
from sklearn.e... | 49,232 | 5 | 375 |
d514b0d6069589ada336602d2dd8db926bc7f4ef | 49 | py | Python | turbines/__init__.py | Norvell-git/SteamSystems | 5dad5303f654ab76be6ee3cbb41c9ab866473bdb | [
"MIT"
] | null | null | null | turbines/__init__.py | Norvell-git/SteamSystems | 5dad5303f654ab76be6ee3cbb41c9ab866473bdb | [
"MIT"
] | 1 | 2020-05-04T22:11:45.000Z | 2020-05-04T22:28:51.000Z | turbines/__init__.py | Norvell-git/SteamTurbine | 5dad5303f654ab76be6ee3cbb41c9ab866473bdb | [
"MIT"
] | null | null | null | """
init file
"""
from .turbine import Turbine
| 8.166667 | 28 | 0.653061 | """
init file
"""
from .turbine import Turbine
| 0 | 0 | 0 |
e4a6d822bb5f10a3943fa88e8a3f78eb420caf02 | 5,749 | py | Python | lrgwd/models/baseline.py | zacespinosa/Learning-GWD-with-MIMA | b4bcc035850a546bea6282c2693595201929630c | [
"MIT"
] | null | null | null | lrgwd/models/baseline.py | zacespinosa/Learning-GWD-with-MIMA | b4bcc035850a546bea6282c2693595201929630c | [
"MIT"
] | null | null | null | lrgwd/models/baseline.py | zacespinosa/Learning-GWD-with-MIMA | b4bcc035850a546bea6282c2693595201929630c | [
"MIT"
] | 1 | 2021-06-14T20:20:37.000Z | 2021-06-14T20:20:37.000Z | from typing import List, Tuple
import numpy as np
import tensorflow as tf
from lrgwd.config import NON_ZERO_GWD_PLEVELS
from lrgwd.models.config import BLOCK_PARAMS, LOSS_ARRAY
from tensorflow.keras import regularizers
from tensorflow.keras.layers import Dense, BatchNormalization
tf.autograph.set_verbosity(3, True)
#... | 38.844595 | 117 | 0.628109 | from typing import List, Tuple
import numpy as np
import tensorflow as tf
from lrgwd.config import NON_ZERO_GWD_PLEVELS
from lrgwd.models.config import BLOCK_PARAMS, LOSS_ARRAY
from tensorflow.keras import regularizers
from tensorflow.keras.layers import Dense, BatchNormalization
tf.autograph.set_verbosity(3, True)
#... | 5,128 | -4 | 261 |
829db428bc9efdb6d9240554d379567d5e49985a | 1,838 | py | Python | tornadoredis/tests/redistest.py | MyCollege/tornado-redis | 83ceefb9d2b84f64b1056504acee357c9272bf1f | [
"Apache-2.0"
] | 4 | 2019-06-24T02:13:28.000Z | 2019-06-24T14:11:46.000Z | tornadoredis/tests/redistest.py | cokeboy/tornado-redis | 9e6be10af0e592eb80e796853e68afb492bf7946 | [
"Apache-2.0"
] | null | null | null | tornadoredis/tests/redistest.py | cokeboy/tornado-redis | 9e6be10af0e592eb80e796853e68afb492bf7946 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import time
from tornado.testing import AsyncTestCase
import tornadoredis
| 25.178082 | 62 | 0.579978 | #!/usr/bin/env python
import time
from tornado.testing import AsyncTestCase
import tornadoredis
def get_callable(obj):
return hasattr(obj, '__call__')
def async_test_ex(timeout=5):
def _inner(func):
def _runner(self, *args, **kwargs):
try:
func(self, *args, **kwargs)
... | 1,385 | 181 | 169 |
a978839dc58c60e5120b35f1c1eee4f43d458eaf | 4,682 | py | Python | Peach.Core.OS.Linux/gdb/exploitable/lib/tools.py | JoeyJiao/peach | 661cb39034583a8cf1b02b56e6b409f2c7498e07 | [
"MIT"
] | 10 | 2017-06-18T19:40:23.000Z | 2022-03-09T08:09:44.000Z | Peach.Core.OS.Linux/gdb/exploitable/lib/tools.py | JoeyJiao/peach | 661cb39034583a8cf1b02b56e6b409f2c7498e07 | [
"MIT"
] | 2 | 2019-07-01T12:39:41.000Z | 2020-11-09T11:40:54.000Z | Peach.Core.OS.Linux/gdb/exploitable/lib/tools.py | JoeyJiao/peach | 661cb39034583a8cf1b02b56e6b409f2c7498e07 | [
"MIT"
] | 11 | 2016-07-01T02:21:06.000Z | 2020-11-23T08:29:22.000Z | ### BEGIN LICENSE ###
### Use of the triage tools and related source code is subject to the terms
### of the license below.
###
### ------------------------------------------------------------------------
### Copyright (C) 2011 Carnegie Mellon University. All Rights Reserved.
### ---------------------------------------... | 39.677966 | 76 | 0.636267 | ### BEGIN LICENSE ###
### Use of the triage tools and related source code is subject to the terms
### of the license below.
###
### ------------------------------------------------------------------------
### Copyright (C) 2011 Carnegie Mellon University. All Rights Reserved.
### ---------------------------------------... | 1,287 | 0 | 312 |
0c5854427610aa4229f76d0b814726c12336a619 | 998 | py | Python | search_engines.py | eat-or-eat/tf-idf-calc | c7ff5da853cbf091a4884d5da1226e75ae48f43e | [
"MIT"
] | null | null | null | search_engines.py | eat-or-eat/tf-idf-calc | c7ff5da853cbf091a4884d5da1226e75ae48f43e | [
"MIT"
] | null | null | null | search_engines.py | eat-or-eat/tf-idf-calc | c7ff5da853cbf091a4884d5da1226e75ae48f43e | [
"MIT"
] | null | null | null | import os
import jieba
from tfidf_calc import calc_tfidf
if __name__ == "__main__":
main()
| 24.95 | 61 | 0.572144 | import os
import jieba
from tfidf_calc import calc_tfidf
def search_query(tfidf, query, texts):
query_words = jieba.lcut(query)
res = []
for index, words in tfidf.items():
score = 0
for word in query_words:
score += words.get(word, 0)
res.append([index, score])
res ... | 867 | 0 | 46 |
336dfd9914a8429a27d0af9fa7dbfa4f1e22b80a | 7,597 | py | Python | nested_cv_significance.py | chriskjou/opennmt-inspection | c70e1f3665ed29b20abcf464e4c73aa7e228a046 | [
"MIT"
] | 2 | 2019-03-18T15:54:32.000Z | 2019-03-22T02:21:38.000Z | nested_cv_significance.py | chriskjou/opennmt-inspection | c70e1f3665ed29b20abcf464e4c73aa7e228a046 | [
"MIT"
] | 6 | 2020-01-28T22:48:37.000Z | 2020-08-17T16:09:03.000Z | nested_cv_significance.py | chriskjou/opennmt-inspection | c70e1f3665ed29b20abcf464e4c73aa7e228a046 | [
"MIT"
] | 1 | 2019-08-04T17:36:22.000Z | 2019-08-04T17:36:22.000Z | import pickle
import argparse
import pandas as pd
from tqdm import tqdm
import numpy as np
import helper
import scipy.io
from scipy.stats import linregress, ttest_1samp, ttest_ind
from statsmodels.stats.anova import AnovaRM
import matplotlib.pyplot as plt
import seaborn as sns
import helper
plt.switch_backend('agg')... | 36.17619 | 146 | 0.711597 | import pickle
import argparse
import pandas as pd
from tqdm import tqdm
import numpy as np
import helper
import scipy.io
from scipy.stats import linregress, ttest_1samp, ttest_ind
from statsmodels.stats.anova import AnovaRM
import matplotlib.pyplot as plt
import seaborn as sns
import helper
plt.switch_backend('agg')... | 6,802 | 0 | 230 |
729e7f3fdf197bad51696e4dd8d3a80ea35378ad | 12 | py | Python | src/cleaning.py | qhjqhj00/SIGIR2021-Pchatbot | a04ad1a8ed073d0548f0dbed53909fb5c5478db3 | [
"Apache-2.0"
] | 26 | 2021-05-26T09:19:54.000Z | 2022-03-29T07:20:34.000Z | src/cleaning.py | qhjqhj00/SIGIR2021-Pchatbot | a04ad1a8ed073d0548f0dbed53909fb5c5478db3 | [
"Apache-2.0"
] | 2 | 2021-06-19T14:54:49.000Z | 2022-01-14T05:37:16.000Z | src/cleaning.py | qhjqhj00/SIGIR2021-Pchatbot | a04ad1a8ed073d0548f0dbed53909fb5c5478db3 | [
"Apache-2.0"
] | 4 | 2021-06-24T06:38:40.000Z | 2022-03-07T07:26:54.000Z | # add codes
| 6 | 11 | 0.666667 | # add codes
| 0 | 0 | 0 |
87a9519e1a805ba2c253013edffbc2cad7e7ff2b | 28 | py | Python | step_1.py | Programmist3000/lesson_201129 | c100c016d0caae2d4baae7fc405ad75c484eef3b | [
"Apache-2.0"
] | null | null | null | step_1.py | Programmist3000/lesson_201129 | c100c016d0caae2d4baae7fc405ad75c484eef3b | [
"Apache-2.0"
] | null | null | null | step_1.py | Programmist3000/lesson_201129 | c100c016d0caae2d4baae7fc405ad75c484eef3b | [
"Apache-2.0"
] | null | null | null | print('Работа на 20_11_29')
| 14 | 27 | 0.75 | print('Работа на 20_11_29')
| 0 | 0 | 0 |
92918d64b9e747d583114654cc6d631a88a3fa9d | 59 | py | Python | monotonic_binning/__init__.py | RoshanTanisha/Monotonic-WOE-Binning-Algorithm | 64c913ef612270e4f630d8484906b067ee36e4d3 | [
"MIT"
] | 102 | 2018-06-04T01:54:43.000Z | 2022-03-21T08:58:39.000Z | monotonic_binning/__init__.py | mindis/Monotonic-WOE-Binning-Algorithm | 64c913ef612270e4f630d8484906b067ee36e4d3 | [
"MIT"
] | 7 | 2018-07-19T06:42:10.000Z | 2020-08-27T02:45:34.000Z | monotonic_binning/__init__.py | mindis/Monotonic-WOE-Binning-Algorithm | 64c913ef612270e4f630d8484906b067ee36e4d3 | [
"MIT"
] | 40 | 2018-06-01T05:40:41.000Z | 2022-01-09T09:04:35.000Z | from monotonic_binning.monotonic_woe_binning import Binning | 59 | 59 | 0.932203 | from monotonic_binning.monotonic_woe_binning import Binning | 0 | 0 | 0 |
ee5a9df73d0e9caa869b0d9dc0541e73936b1dcb | 443 | py | Python | p482_license_key_formatting.py | feigaochn/leetcode | abf0877fae02aa9c2549051f0b68df0ace952512 | [
"MIT"
] | null | null | null | p482_license_key_formatting.py | feigaochn/leetcode | abf0877fae02aa9c2549051f0b68df0ace952512 | [
"MIT"
] | null | null | null | p482_license_key_formatting.py | feigaochn/leetcode | abf0877fae02aa9c2549051f0b68df0ace952512 | [
"MIT"
] | null | null | null |
fn = Solution().licenseKeyFormatting
print(fn("5F3Z-2e-9-w", K=4))
print(fn("2-5g-3-J", K=2))
| 23.315789 | 69 | 0.44921 | class Solution:
def licenseKeyFormatting(self, S, K):
"""
:type S: str
:type K: int
:rtype: str
"""
S = S.replace('-', '').upper()
S = S.rjust(((len(S) - 1) // K + 1) * K)
# print(S)
return '-'.join(
S[i * K:(i + 1) * K] for i in ra... | 0 | 324 | 22 |
3b4a2c5c9c0939273357c0149834991e9b43d944 | 287 | py | Python | problem-solving/No Idea!.py | PreethiPrakashA/hackerrank | edb22065a5753c533654f7c57a51237d735808fb | [
"MIT"
] | 4 | 2019-09-20T14:40:09.000Z | 2019-09-26T09:04:16.000Z | problem-solving/No Idea!.py | PreethiPrakashA/hackerrank | edb22065a5753c533654f7c57a51237d735808fb | [
"MIT"
] | null | null | null | problem-solving/No Idea!.py | PreethiPrakashA/hackerrank | edb22065a5753c533654f7c57a51237d735808fb | [
"MIT"
] | 2 | 2019-09-17T17:34:20.000Z | 2020-05-04T18:23:35.000Z | list1 = map(int,input().split())
int_arr_list = map(int,input().split())
set_A = set(map(int,input().split()))
set_B = set(map(int,input().split()))
happiness = 0
for i in int_arr_list:
if i in set_A:
happiness+=1
elif i in set_B:
happiness-=1
print(happiness)
| 20.5 | 39 | 0.630662 | list1 = map(int,input().split())
int_arr_list = map(int,input().split())
set_A = set(map(int,input().split()))
set_B = set(map(int,input().split()))
happiness = 0
for i in int_arr_list:
if i in set_A:
happiness+=1
elif i in set_B:
happiness-=1
print(happiness)
| 0 | 0 | 0 |
91a84bbe0e8dde6efaca4fb7fa2bb23960a32f1e | 3,511 | py | Python | local_demo.py | kau-masa/Komi_SmartAlarmClock | 2d97a16253861a075f34d015227b2c835623bc52 | [
"BSD-3-Clause"
] | 1 | 2017-03-29T16:01:14.000Z | 2017-03-29T16:01:14.000Z | local_demo.py | kau-masa/Komi_SmartAlarmClock | 2d97a16253861a075f34d015227b2c835623bc52 | [
"BSD-3-Clause"
] | 2 | 2021-02-08T20:17:39.000Z | 2021-06-01T21:44:57.000Z | local_demo.py | kau-masa/Komi_SmartAlarmClock | 2d97a16253861a075f34d015227b2c835623bc52 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/python
import os
import requests
import json
import subprocess
import time
config_file = open('config.json', 'r')
config = json.load(config_file)
invalid_properties = [k for k, v in config.items() if v == ""]
print "current configuration:", json.dumps(config, indent=2)
if len(invalid_properties) > 0:
... | 47.445946 | 174 | 0.722586 | #!/usr/bin/python
import os
import requests
import json
import subprocess
import time
def userInput(config):
def defaultValue(config, key):
return config[key] if key in config else ""
res = {}
invalid = {}
res['user_name'] = raw_input("your GitHub username (default = " + defaultValue(config, 'user_name') + "): ... | 1,379 | 0 | 23 |
090cb2eee70f50effff41edcadb4fac292e804b7 | 3,658 | py | Python | EARLIEST PRIORITY SELECTOR.py | nitmateriais/Earliest-Priority-Selector | 9bd6d2c184e1eca17e35e3b67b2fa85c7f18c097 | [
"MIT"
] | 3 | 2017-11-08T05:55:43.000Z | 2019-08-31T12:19:49.000Z | EARLIEST PRIORITY SELECTOR.py | nitmateriais/Earliest-Priority-Selector | 9bd6d2c184e1eca17e35e3b67b2fa85c7f18c097 | [
"MIT"
] | null | null | null | EARLIEST PRIORITY SELECTOR.py | nitmateriais/Earliest-Priority-Selector | 9bd6d2c184e1eca17e35e3b67b2fa85c7f18c097 | [
"MIT"
] | 2 | 2019-08-21T21:06:12.000Z | 2021-07-12T13:21:18.000Z | import re
import time
import sys
DATE_TIME_FORMAT = '%d %b %Y'
FIELD_TAG_PATTERN = 'PO %s %s\n'
FIELD_ERROR = 'XXXXX'
PATTERN_ERROR = '== Error in line %d (%s,%s) =='
STORE_PI_ENABLE = 1
STORE_PI_DISABLE = 0
count_wo = 0
def makePPList(lstPP, count):
'''
Funtio to organize the array acc... | 24.065789 | 90 | 0.586659 | import re
import time
import sys
DATE_TIME_FORMAT = '%d %b %Y'
FIELD_TAG_PATTERN = 'PO %s %s\n'
FIELD_ERROR = 'XXXXX'
PATTERN_ERROR = '== Error in line %d (%s,%s) =='
STORE_PI_ENABLE = 1
STORE_PI_DISABLE = 0
count_wo = 0
def makePPList(lstPP, count):
'''
Funtio to organize the array acc... | 1,888 | 0 | 25 |
4de1acd3ecbbd06386ada3f87c6e57110aa8fc04 | 1,353 | py | Python | {{cookiecutter.package_name}}/setup.py | uc-cdis/template-repo | ebcf2e612c7ac092ffb58a64bf304ed800642bcd | [
"Apache-2.0"
] | 1 | 2019-03-11T16:53:33.000Z | 2019-03-11T16:53:33.000Z | {{cookiecutter.package_name}}/setup.py | uc-cdis/template-repo | ebcf2e612c7ac092ffb58a64bf304ed800642bcd | [
"Apache-2.0"
] | 2 | 2019-02-20T17:06:20.000Z | 2020-07-07T22:54:58.000Z | {{cookiecutter.package_name}}/setup.py | uc-cdis/template-repo | ebcf2e612c7ac092ffb58a64bf304ed800642bcd | [
"Apache-2.0"
] | 2 | 2018-10-30T21:38:57.000Z | 2020-09-08T19:01:30.000Z | """
This is a file to describe the Python module distribution and
helps with installation.
More info on various arguments here:
https://setuptools.readthedocs.io/en/latest/setuptools.html
"""
from setuptools import setup, find_packages
{%- if cookiecutter.package_type == 'Library' %}
from subprocess import check_outpu... | 30.75 | 86 | 0.651885 | """
This is a file to describe the Python module distribution and
helps with installation.
More info on various arguments here:
https://setuptools.readthedocs.io/en/latest/setuptools.html
"""
from setuptools import setup, find_packages
{%- if cookiecutter.package_type == 'Library' %}
from subprocess import check_outpu... | 544 | 0 | 23 |
a4350b679b5c62c7d01bcf5a2aa6fe9f0c722a03 | 7,718 | py | Python | Project/si_animator.py | Yanko96/CS-E5740-Complex-Networks | 708af24230218b77f1196c1a0ec5885165491a85 | [
"MIT"
] | null | null | null | Project/si_animator.py | Yanko96/CS-E5740-Complex-Networks | 708af24230218b77f1196c1a0ec5885165491a85 | [
"MIT"
] | null | null | null | Project/si_animator.py | Yanko96/CS-E5740-Complex-Networks | 708af24230218b77f1196c1a0ec5885165491a85 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import networkx as nx
from matplotlib.animation import FuncAnimation
import numpy as np
import time
import os
__author__ = 'Rainer.Kujala@aalto.fi'
def visualize_si(infection_times,
viz_start_time=1229231100,
viz_end_time=1230128400,
... | 33.411255 | 80 | 0.613501 | import matplotlib.pyplot as plt
import networkx as nx
from matplotlib.animation import FuncAnimation
import numpy as np
import time
import os
__author__ = 'Rainer.Kujala@aalto.fi'
class SI_AnimHelper(object):
def __init__(self, infection_times):
event_fname = "events_US_air_traffic_GMT.txt"
if no... | 1,964 | 1,566 | 23 |
9ecfe3c48441fdf99929459441116dde1d69544f | 24,609 | py | Python | digital_land_airflow/dags/base.py | digital-land/digital-land-airflow | ec0d47a8658e1363a8ff4e62902ff98b65273369 | [
"MIT"
] | null | null | null | digital_land_airflow/dags/base.py | digital-land/digital-land-airflow | ec0d47a8658e1363a8ff4e62902ff98b65273369 | [
"MIT"
] | 2 | 2022-02-15T12:06:35.000Z | 2022-03-14T17:20:14.000Z | digital_land_airflow/dags/base.py | digital-land/digital-land-airflow | ec0d47a8658e1363a8ff4e62902ff98b65273369 | [
"MIT"
] | null | null | null | from csv import DictReader
import logging
import os
from datetime import datetime
from pathlib import Path
from shutil import rmtree
from airflow import DAG
from airflow.exceptions import AirflowSkipException
from airflow.operators.python import PythonOperator
from airflow.models import Param, Variable
from airflow.ti... | 38.391576 | 128 | 0.657767 | from csv import DictReader
import logging
import os
from datetime import datetime
from pathlib import Path
from shutil import rmtree
from airflow import DAG
from airflow.exceptions import AirflowSkipException
from airflow.operators.python import PythonOperator
from airflow.models import Param, Variable
from airflow.ti... | 17,900 | 0 | 644 |
2a5866ddf224ff842db2756808c2b2774b1dd9f0 | 516 | py | Python | mfgp/task1_new/utils/desc_pp_notest.py | kunalghosh/Multi_Fidelity_Prediction_GP | c858554f5c1f0c4aafa12cf7c441bd2d56b115f5 | [
"BSD-3-Clause"
] | null | null | null | mfgp/task1_new/utils/desc_pp_notest.py | kunalghosh/Multi_Fidelity_Prediction_GP | c858554f5c1f0c4aafa12cf7c441bd2d56b115f5 | [
"BSD-3-Clause"
] | 3 | 2021-08-31T08:53:49.000Z | 2021-10-05T15:10:42.000Z | mfgp/task1_new/utils/desc_pp_notest.py | kunalghosh/Multi_Fidelity_Prediction_GP | c858554f5c1f0c4aafa12cf7c441bd2d56b115f5 | [
"BSD-3-Clause"
] | null | null | null | import time
from sklearn import preprocessing
from io_utils import append_write, out_time
| 27.157895 | 63 | 0.684109 | import time
from sklearn import preprocessing
from io_utils import append_write, out_time
def desc_pp_notest(preprocess, X_train):
#-- normalization
#start = time.time()
#f.write("starting preprocess " + "\n"),f.flush()
if preprocess == "none":
X_train_pp = X_train.toarray()
elif preproces... | 403 | 0 | 23 |
edc074fdbdb5e37bac16a5d52fb453b9f0bae9bc | 68 | py | Python | models/__init__.py | jaganadhg/aimleng | cd874a85287d222d77ad567fb44a22c40aa9c452 | [
"Apache-2.0"
] | null | null | null | models/__init__.py | jaganadhg/aimleng | cd874a85287d222d77ad567fb44a22c40aa9c452 | [
"Apache-2.0"
] | null | null | null | models/__init__.py | jaganadhg/aimleng | cd874a85287d222d77ad567fb44a22c40aa9c452 | [
"Apache-2.0"
] | null | null | null | from .modes import (ElectricityData,
RetailData) | 34 | 36 | 0.588235 | from .modes import (ElectricityData,
RetailData) | 0 | 0 | 0 |
12ec3030e413c495d2b961d1d559930d38ed5178 | 3,046 | py | Python | src/api/urls.py | jhernandez18p/mobyapp | 4add7bd3b3f1e933bbb6941674bf84f4c4462685 | [
"MIT"
] | null | null | null | src/api/urls.py | jhernandez18p/mobyapp | 4add7bd3b3f1e933bbb6941674bf84f4c4462685 | [
"MIT"
] | 7 | 2020-06-05T17:31:06.000Z | 2022-03-11T23:16:34.000Z | src/api/urls.py | jhernandez18p/mobyapp | 4add7bd3b3f1e933bbb6941674bf84f4c4462685 | [
"MIT"
] | null | null | null | from django.conf import settings
from django.conf.urls import handler404,handler500,handler403,handler400
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.flatpages import views as flats
from django.contrib.flatpages.sitemaps import FlatPageSitemap
from django.contrib.site... | 48.349206 | 101 | 0.797111 | from django.conf import settings
from django.conf.urls import handler404,handler500,handler403,handler400
from django.conf.urls.static import static
from django.contrib import admin
from django.contrib.flatpages import views as flats
from django.contrib.flatpages.sitemaps import FlatPageSitemap
from django.contrib.site... | 0 | 0 | 0 |
5c2d3bd001fd7edf1ed7505f89c60de02860bccd | 1,563 | py | Python | MohammedHamada.py | mohammedhamada475/IUG_NLP | e7bcfed7d3fde015fa26f888a617b81e69de2b1b | [
"Apache-2.0"
] | null | null | null | MohammedHamada.py | mohammedhamada475/IUG_NLP | e7bcfed7d3fde015fa26f888a617b81e69de2b1b | [
"Apache-2.0"
] | null | null | null | MohammedHamada.py | mohammedhamada475/IUG_NLP | e7bcfed7d3fde015fa26f888a617b81e69de2b1b | [
"Apache-2.0"
] | null | null | null | import re
# Done By Mohammed Hamada , student ID : 120201362 , to be deliverd to Dr.Ayman Abu samra
# Original Text
originalText = 'The emergence of COVID-19 we have seen instances of public stigmatization among specific populations, and the rise of harmful stereotypes. Stigmatization could potentially contribu... | 53.896552 | 663 | 0.754958 | import re
# Done By Mohammed Hamada , student ID : 120201362 , to be deliverd to Dr.Ayman Abu samra
# Original Text
originalText = 'The emergence of COVID-19 we have seen instances of public stigmatization among specific populations, and the rise of harmful stereotypes. Stigmatization could potentially contribu... | 0 | 0 | 0 |
4fe0964dadd1fb09ae031f0a9ff1ae20f2242085 | 2,255 | py | Python | software/speller/data_collection_platform/backend/dcp/signals/predict.py | NTX-McGill/NeuroTechX-McGill-2021 | 5c7797fadc2595ef8a0ee4e0ab5bed505c25af20 | [
"MIT"
] | 2 | 2021-12-23T00:12:38.000Z | 2022-01-14T03:47:46.000Z | software/speller/data_collection_platform/backend/dcp/signals/predict.py | NTX-McGill/NeuroTechX-McGill-2021 | 5c7797fadc2595ef8a0ee4e0ab5bed505c25af20 | [
"MIT"
] | 34 | 2021-11-24T00:33:12.000Z | 2022-03-30T04:03:26.000Z | software/speller/data_collection_platform/backend/dcp/signals/predict.py | NTX-McGill/NeuroTechX-McGill-2021 | 5c7797fadc2595ef8a0ee4e0ab5bed505c25af20 | [
"MIT"
] | 4 | 2021-11-23T22:27:06.000Z | 2022-03-09T22:16:08.000Z | from FBCCA_IT import filter_bank_cca_it
import numpy as np
import json
from scipy.signal import filtfilt, cheby1
if __name__ == '__main__':
predict_letter(np.random.rand(1000, 8))
| 40.267857 | 117 | 0.682927 | from FBCCA_IT import filter_bank_cca_it
import numpy as np
import json
from scipy.signal import filtfilt, cheby1
def predict_letter(bci_data, subject_id='S08'):
prediction = None
# bci_data # 8 channels of x seconds data, sampling rate = 250Hz, then shape = (250x, 8)
# parameters
corr = []
samplin... | 2,045 | 0 | 23 |
2e423622993f358c25d194c0d5ea747bff527004 | 12,913 | py | Python | demo_eval_BVQA_feats_one_dataset.py | JoshuaEbenezer/VIDEVAL_release | 0d35d6db21d4a21a536af17f3f5902ce8bc67b29 | [
"MIT"
] | 1 | 2021-05-13T19:48:37.000Z | 2021-05-13T19:48:37.000Z | demo_eval_BVQA_feats_one_dataset.py | JoshuaEbenezer/VIDEVAL_release | 0d35d6db21d4a21a536af17f3f5902ce8bc67b29 | [
"MIT"
] | null | null | null | demo_eval_BVQA_feats_one_dataset.py | JoshuaEbenezer/VIDEVAL_release | 0d35d6db21d4a21a536af17f3f5902ce8bc67b29 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Evaluate a BVQA model/features on a given dataset trained with support
vector machine trained for 100 iterations of train-test (80%-20%) split.
SVR hyperparameters were selected by a grid-search tuning on a random 20%
of the training set.
Input:
- feature matrix:
eg, features/KONVI... | 44.222603 | 116 | 0.648958 | # -*- coding: utf-8 -*-
"""
Evaluate a BVQA model/features on a given dataset trained with support
vector machine trained for 100 iterations of train-test (80%-20%) split.
SVR hyperparameters were selected by a grid-search tuning on a random 20%
of the training set.
Input:
- feature matrix:
eg, features/KONVI... | 227 | 0 | 34 |
c3dfc69c64b9b9551b48f60b1f1cb31a06b96399 | 10,150 | py | Python | dndCharCom/combat/models.py | hugharehugh/DndCharCom | 08b39602d94f090e2a8e2a85152d2262404b0652 | [
"MIT"
] | null | null | null | dndCharCom/combat/models.py | hugharehugh/DndCharCom | 08b39602d94f090e2a8e2a85152d2262404b0652 | [
"MIT"
] | null | null | null | dndCharCom/combat/models.py | hugharehugh/DndCharCom | 08b39602d94f090e2a8e2a85152d2262404b0652 | [
"MIT"
] | null | null | null | from os import O_TRUNC
import random
from random import randint
from django.db import models
from dndusers.models import DnDUser
from django.db.models.enums import IntegerChoices
from django.db.models.fields import DecimalField, IntegerField
# Create your models here.
from django.db import models
#dndCharCom is meant t... | 43.562232 | 209 | 0.663744 | from os import O_TRUNC
import random
from random import randint
from django.db import models
from dndusers.models import DnDUser
from django.db.models.enums import IntegerChoices
from django.db.models.fields import DecimalField, IntegerField
# Create your models here.
from django.db import models
class MyModel(models.... | 349 | 4,667 | 69 |
c44bdb4db1cb407f7efddff12ab9387ae92f1702 | 2,877 | py | Python | pygate_grpc/client.py | pygate/gRPC-client | 257f996c476f5fef3e8d9f73586ffff76a09986e | [
"MIT"
] | 23 | 2020-07-07T05:44:00.000Z | 2022-01-29T18:16:57.000Z | pygate_grpc/client.py | pygate/gRPC-client | 257f996c476f5fef3e8d9f73586ffff76a09986e | [
"MIT"
] | 28 | 2020-07-07T08:29:15.000Z | 2021-02-25T00:25:20.000Z | pygate_grpc/client.py | pygate/gRPC-client | 257f996c476f5fef3e8d9f73586ffff76a09986e | [
"MIT"
] | 2 | 2020-09-30T16:30:07.000Z | 2020-12-01T15:35:03.000Z | from typing import Tuple
import grpc
from powergate.user.v1 import user_pb2, user_pb2_grpc
from pygate_grpc.admin import AdminClient
from pygate_grpc.config import ConfigClient
from pygate_grpc.data import DataClient
from pygate_grpc.deals import DealsClient
from pygate_grpc.decorators import unmarshal_with
from pyga... | 38.36 | 118 | 0.719152 | from typing import Tuple
import grpc
from powergate.user.v1 import user_pb2, user_pb2_grpc
from pygate_grpc.admin import AdminClient
from pygate_grpc.config import ConfigClient
from pygate_grpc.data import DataClient
from pygate_grpc.deals import DealsClient
from pygate_grpc.decorators import unmarshal_with
from pyga... | 1,662 | 573 | 23 |
ee07652f8338566a705d7d1c32ecb7ee94a229b9 | 215 | py | Python | Les1/banana.py | ThiboVanderkam/Scripting-code | 2fe42f44db87a5287225d304e15d3985b20013d3 | [
"Apache-2.0"
] | null | null | null | Les1/banana.py | ThiboVanderkam/Scripting-code | 2fe42f44db87a5287225d304e15d3985b20013d3 | [
"Apache-2.0"
] | null | null | null | Les1/banana.py | ThiboVanderkam/Scripting-code | 2fe42f44db87a5287225d304e15d3985b20013d3 | [
"Apache-2.0"
] | null | null | null | word = input("Give me a word: ")
wrong = True
while wrong:
if word == "banana":
wrong = False
print("END GAME")
else:
print("WRONG")
word = input("Give me a word: ") | 21.5 | 40 | 0.497674 | word = input("Give me a word: ")
wrong = True
while wrong:
if word == "banana":
wrong = False
print("END GAME")
else:
print("WRONG")
word = input("Give me a word: ") | 0 | 0 | 0 |
c009204eb558f1738c123127ccfa1c1e5989bbef | 1,272 | py | Python | TP2/ej4/ej4a_mpi_producto_matricial.py | exegonzalez/Computacion-Avanzada | 04e9ba311e8be4fe1e2bbded933d5c8e3ae1a2e0 | [
"MIT"
] | null | null | null | TP2/ej4/ej4a_mpi_producto_matricial.py | exegonzalez/Computacion-Avanzada | 04e9ba311e8be4fe1e2bbded933d5c8e3ae1a2e0 | [
"MIT"
] | null | null | null | TP2/ej4/ej4a_mpi_producto_matricial.py | exegonzalez/Computacion-Avanzada | 04e9ba311e8be4fe1e2bbded933d5c8e3ae1a2e0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import numpy as np
from mpi4py import MPI
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
size = comm.Get_size()
root = 0
matrix = None # matriz n*n vacía
bufferReceptor = np.zeros((1, size), dtype=np.int) # vector columna vacío
vectorResultOfProduct = np.zeros((size, 1), dtype=np.int) # vector r... | 33.473684 | 99 | 0.735849 | #!/usr/bin/env python3
import numpy as np
from mpi4py import MPI
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
size = comm.Get_size()
root = 0
matrix = None # matriz n*n vacía
bufferReceptor = np.zeros((1, size), dtype=np.int) # vector columna vacío
vectorResultOfProduct = np.zeros((size, 1), dtype=np.int) # vector r... | 0 | 0 | 0 |
b766fcc5811888e9309d21a699e075f85243b5f7 | 5,412 | py | Python | adaboost/AdaBoost.py | FelixOpolka/Statistical-Learning-Algorithms | 16152d54bc5610b1f0268d2335eb578e4f6d2982 | [
"MIT"
] | null | null | null | adaboost/AdaBoost.py | FelixOpolka/Statistical-Learning-Algorithms | 16152d54bc5610b1f0268d2335eb578e4f6d2982 | [
"MIT"
] | null | null | null | adaboost/AdaBoost.py | FelixOpolka/Statistical-Learning-Algorithms | 16152d54bc5610b1f0268d2335eb578e4f6d2982 | [
"MIT"
] | null | null | null | """Implementation of an ensemble of classification predictors trained
using the AdaBoost.M1 algorithm."""
import math
import operator
import random
def increment_counter(dictionary, key, value=1):
"""Increments the counter for a given key in the given dictionary or
sets the counter to 1 if it does not yet ex... | 43.645161 | 78 | 0.650961 | """Implementation of an ensemble of classification predictors trained
using the AdaBoost.M1 algorithm."""
import math
import operator
import random
def increment_counter(dictionary, key, value=1):
"""Increments the counter for a given key in the given dictionary or
sets the counter to 1 if it does not yet ex... | 90 | 0 | 27 |
06f22e1d94fc4f893226c6063dc30fb8c3589f8c | 14,068 | py | Python | tests/swim_aim/xml/test_mapper_fields.py | eurocontrol-swim/swim-aim | d1dd3ce9d4abd84a5d16a877a86b6daaed5e6b49 | [
"BSD-3-Clause"
] | null | null | null | tests/swim_aim/xml/test_mapper_fields.py | eurocontrol-swim/swim-aim | d1dd3ce9d4abd84a5d16a877a86b6daaed5e6b49 | [
"BSD-3-Clause"
] | null | null | null | tests/swim_aim/xml/test_mapper_fields.py | eurocontrol-swim/swim-aim | d1dd3ce9d4abd84a5d16a877a86b6daaed5e6b49 | [
"BSD-3-Clause"
] | null | null | null | """
Copyright 2019 EUROCONTROL
==========================================
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions an... | 51.156364 | 206 | 0.644655 | """
Copyright 2019 EUROCONTROL
==========================================
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the
following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions an... | 2,235 | 0 | 198 |
15482e96560786fd582cf31cf0ff351e114cf26e | 7,758 | py | Python | train.py | rnbwdsh/VisRNN_ICLR_2016_Text | d87290cd4a71dda5ab68574b68fedbec9b6314ff | [
"MIT"
] | null | null | null | train.py | rnbwdsh/VisRNN_ICLR_2016_Text | d87290cd4a71dda5ab68574b68fedbec9b6314ff | [
"MIT"
] | null | null | null | train.py | rnbwdsh/VisRNN_ICLR_2016_Text | d87290cd4a71dda5ab68574b68fedbec9b6314ff | [
"MIT"
] | null | null | null | import torch.optim as optim
from tqdm import tqdm
import numpy as np
from model import *
from utils import *
from config import *
'''
'''
def train(train_data, val_data, vocab, config, clip=5):
''' Training a network
Arguments
---------
:param clip:
:param config:
:para... | 39.181818 | 148 | 0.579144 | import torch.optim as optim
from tqdm import tqdm
import numpy as np
from model import *
from utils import *
from config import *
'''
'''
def train(train_data, val_data, vocab, config, clip=5):
''' Training a network
Arguments
---------
:param clip:
:param config:
:para... | 2,473 | 0 | 23 |
0a4709b2df197fcd2cc084b945d4d67fbbb7ca49 | 2,208 | py | Python | simplipy/device/sensor/v3.py | epenet/simplisafe-python | 1ac074788e3560ca2ba568e12b411537c23275d4 | [
"MIT"
] | 3 | 2017-05-21T16:49:38.000Z | 2018-07-05T16:16:45.000Z | simplipy/device/sensor/v3.py | epenet/simplisafe-python | 1ac074788e3560ca2ba568e12b411537c23275d4 | [
"MIT"
] | 2 | 2017-07-20T11:57:23.000Z | 2018-09-24T03:03:19.000Z | simplipy/device/sensor/v3.py | epenet/simplisafe-python | 1ac074788e3560ca2ba568e12b411537c23275d4 | [
"MIT"
] | 7 | 2017-04-15T05:52:09.000Z | 2018-08-19T01:49:54.000Z | """Define a v3 (new) SimpliSafe sensor."""
from __future__ import annotations
from typing import Any, cast
from simplipy.device import DeviceTypes, DeviceV3
class SensorV3(DeviceV3):
"""A V3 (new) sensor.
Note that this class shouldn't be instantiated directly; it will be
instantiated as appropriate vi... | 27.6 | 87 | 0.567482 | """Define a v3 (new) SimpliSafe sensor."""
from __future__ import annotations
from typing import Any, cast
from simplipy.device import DeviceTypes, DeviceV3
class SensorV3(DeviceV3):
"""A V3 (new) sensor.
Note that this class shouldn't be instantiated directly; it will be
instantiated as appropriate vi... | 0 | 0 | 0 |
328315cc5bccbe9bfd886047c5d1f90c2580ac69 | 2,829 | py | Python | cliTools/avdcli_redis_tools/venv/lib/python3.6/site-packages/avdcli/AVDApp.py | emile-bernard/Dockerized_ELK_Stack | 74f7956b6fb5a4dbee25953b2a23c61383ea6fc8 | [
"MIT"
] | 1 | 2020-07-22T19:50:08.000Z | 2020-07-22T19:50:08.000Z | cliTools/avdcli_redis_tools/venv/lib/python3.6/site-packages/avdcli/AVDApp.py | emile-bernard/Dockerized_ELK_Stack | 74f7956b6fb5a4dbee25953b2a23c61383ea6fc8 | [
"MIT"
] | null | null | null | cliTools/avdcli_redis_tools/venv/lib/python3.6/site-packages/avdcli/AVDApp.py | emile-bernard/Dockerized_ELK_Stack | 74f7956b6fb5a4dbee25953b2a23c61383ea6fc8 | [
"MIT"
] | null | null | null | import json
import os
from getpass import getpass as gp
from plumbum import cli, colors
from avdlogger import lpl
if __name__ == "__main__":
AVDApp.run()
| 36.269231 | 132 | 0.621421 | import json
import os
from getpass import getpass as gp
from plumbum import cli, colors
from avdlogger import lpl
class AVDApp(cli.Application):
COLOR_MANDATORY = colors.bold & colors.yellow
def __init__(self, *args):
super().__init__(*args)
self.username = ""
self.password = ""
... | 1,323 | 1,322 | 23 |
6916513601290d8742f31275479aebc5931c7597 | 18,476 | py | Python | tests.py | 0scarB/tail-recursive | 458f4559bb7b0afe738e54fa79941e49775d9525 | [
"MIT"
] | 3 | 2020-09-03T03:25:50.000Z | 2021-06-15T14:40:07.000Z | tests.py | 0scarB/tail-recursive | 458f4559bb7b0afe738e54fa79941e49775d9525 | [
"MIT"
] | 2 | 2021-12-31T11:16:20.000Z | 2022-01-10T01:49:23.000Z | tests.py | 0scarB/tail-recursive | 458f4559bb7b0afe738e54fa79941e49775d9525 | [
"MIT"
] | null | null | null | from contextlib import contextmanager
import concurrent.futures
import sys
import time
import pytest
from tail_recursive import tail_recursive, FeatureSet
ALL_FEATURE_SETS = [
FeatureSet.BASE,
FeatureSet.NESTED_CALLS,
FeatureSet.FULL
]
@pytest.mark.parametrize("feature_set_str", [feature_set.name.... | 32.132174 | 143 | 0.653388 | from contextlib import contextmanager
import concurrent.futures
import sys
import time
import pytest
from tail_recursive import tail_recursive, FeatureSet
ALL_FEATURE_SETS = [
FeatureSet.BASE,
FeatureSet.NESTED_CALLS,
FeatureSet.FULL
]
def non_recursive_factorial(n):
result = 1
for coefficient... | 15,630 | 0 | 618 |
b932e6db40c65596b74df8c06d9a7c3a5d759ba2 | 1,322 | py | Python | examples/plot_graph.py | imankulov/gevent-websocket | fbea40aff8e65c5e775ba580fd741cc7f20cbc2b | [
"BSD-3-Clause"
] | 1 | 2015-08-13T05:26:44.000Z | 2015-08-13T05:26:44.000Z | examples/plot_graph.py | imankulov/gevent-websocket | fbea40aff8e65c5e775ba580fd741cc7f20cbc2b | [
"BSD-3-Clause"
] | null | null | null | examples/plot_graph.py | imankulov/gevent-websocket | fbea40aff8e65c5e775ba580fd741cc7f20cbc2b | [
"BSD-3-Clause"
] | null | null | null | """
This example generates random data and plots a graph in the browser.
Run it using Gevent directly using:
$ python plot_grapg.py
Or with an Gunicorn wrapper:
$ gunicorn -k "geventwebsocket.gunicorn.workers.GeventWebSocketWorker" \
plot_graph:app
"""
import gevent
import os
import random
from geve... | 24.481481 | 78 | 0.610439 | """
This example generates random data and plots a graph in the browser.
Run it using Gevent directly using:
$ python plot_grapg.py
Or with an Gunicorn wrapper:
$ gunicorn -k "geventwebsocket.gunicorn.workers.GeventWebSocketWorker" \
plot_graph:app
"""
import gevent
import os
import random
from geve... | 332 | 0 | 23 |
74ed69e15ef56a87800a1ceb2348219d60cca106 | 3,096 | py | Python | main.py | Grennwolf/Snake-RL- | 320cab8b92c5aae645bd319c416ed59fe5354738 | [
"MIT"
] | null | null | null | main.py | Grennwolf/Snake-RL- | 320cab8b92c5aae645bd319c416ed59fe5354738 | [
"MIT"
] | null | null | null | main.py | Grennwolf/Snake-RL- | 320cab8b92c5aae645bd319c416ed59fe5354738 | [
"MIT"
] | null | null | null | import numpy as np
import game, time
from nn import NN
env = game.Game(500, 500)
n_state = len(env.reset())
n_actions = env.n_actions
agent = NN(n_state, n_actions)
import matplotlib.pyplot as plt
n_sessions = 100
percentile = 50
log = []
for i in range(50):
#generate new sessions
print(i... | 32.589474 | 106 | 0.638566 | import numpy as np
import game, time
from nn import NN
env = game.Game(500, 500)
n_state = len(env.reset())
n_actions = env.n_actions
agent = NN(n_state, n_actions)
def generate_session(t_max = 1000):
states, actions = [], []
total_reward = 0
s = env.reset()
for t in range(t_max):
... | 1,694 | 0 | 74 |
8a17bdffa3bbe4e05a0da1c6b18a68f2e5c30b2e | 13,800 | py | Python | myhpom/tests/test_upload_view.py | ResearchSoftwareInstitute/MyHPOM | 2d48fe5ac8d21173b1685eb33059bb391fe24414 | [
"BSD-3-Clause"
] | 1 | 2018-09-17T13:07:29.000Z | 2018-09-17T13:07:29.000Z | myhpom/tests/test_upload_view.py | ResearchSoftwareInstitute/MyHPOM | 2d48fe5ac8d21173b1685eb33059bb391fe24414 | [
"BSD-3-Clause"
] | 100 | 2017-08-01T23:48:04.000Z | 2018-04-03T13:17:27.000Z | myhpom/tests/test_upload_view.py | ResearchSoftwareInstitute/MyHPOM | 2d48fe5ac8d21173b1685eb33059bb391fe24414 | [
"BSD-3-Clause"
] | 1 | 2018-06-28T13:19:58.000Z | 2018-06-28T13:19:58.000Z | from mock import patch
import os
from django.contrib.auth.models import User
from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.urlresolvers import reverse
from django.test import TestCase, override_settings
from django.utils.timezone import now
from myhpom.models import AdvanceDirective
fr... | 45.544554 | 94 | 0.700217 | from mock import patch
import os
from django.contrib.auth.models import User
from django.core.files.uploadedfile import SimpleUploadedFile
from django.core.urlresolvers import reverse
from django.test import TestCase, override_settings
from django.utils.timezone import now
from myhpom.models import AdvanceDirective
fr... | 10,151 | 2,743 | 453 |
638d1e73d1856f261fec68a5a9e24d845e1161d1 | 3,528 | py | Python | lang-sample/proclang/observer.py | vtheno/Vtools | 5a03891d0c2365602aaae68541f31ba89a6476e5 | [
"MIT"
] | 2 | 2018-04-25T08:59:55.000Z | 2018-04-25T09:53:35.000Z | lang-sample/proclang/observer.py | vtheno/Vtools | 5a03891d0c2365602aaae68541f31ba89a6476e5 | [
"MIT"
] | null | null | null | lang-sample/proclang/observer.py | vtheno/Vtools | 5a03891d0c2365602aaae68541f31ba89a6476e5 | [
"MIT"
] | null | null | null | #coding=utf-8
from util.Match import *
from datatype import *
from env import *
from parse import *
print( dir() )
# eopl page 80
# value_of : Exp * Env -> ExpVal
@matcher(Const_exp,False)
@matcher(Var_exp,False)
@matcher(Diff_exp,False)
@matcher(Zerop_exp,False)
@matcher(If_exp,False)
@matcher(Let_exp,False)
@matcher(... | 30.678261 | 74 | 0.582483 | #coding=utf-8
from util.Match import *
from datatype import *
from env import *
from parse import *
print( dir() )
# eopl page 80
# value_of : Exp * Env -> ExpVal
@matcher(Const_exp,False)
def value_of(self,env):
return Num_val(self.num)
@matcher(Var_exp,False)
def value_of(self,env):
return apply_env(env,self.... | 2,830 | 23 | 265 |
dda360e4314501f8a677c72630bd3e219c348f46 | 1,181 | py | Python | rolling/server/document/corpse.py | buxx/rolling | ef1268fe6ddabe768a125c3ce8b37e0b9cbad4a5 | [
"MIT"
] | 14 | 2019-11-16T18:51:51.000Z | 2022-01-15T17:50:34.000Z | rolling/server/document/corpse.py | buxx/rolling | ef1268fe6ddabe768a125c3ce8b37e0b9cbad4a5 | [
"MIT"
] | 148 | 2018-12-10T09:07:45.000Z | 2022-03-08T10:51:04.000Z | rolling/server/document/corpse.py | buxx/rolling | ef1268fe6ddabe768a125c3ce8b37e0b9cbad4a5 | [
"MIT"
] | 1 | 2020-08-05T14:25:48.000Z | 2020-08-05T14:25:48.000Z | # coding: utf-8
import enum
from sqlalchemy import Boolean
from sqlalchemy import Column
from sqlalchemy import Enum
from sqlalchemy import Integer
from sqlalchemy.ext.declarative import declared_attr
from rolling.server.extension import ServerSideDocument as Document
| 27.465116 | 84 | 0.723963 | # coding: utf-8
import enum
from sqlalchemy import Boolean
from sqlalchemy import Column
from sqlalchemy import Enum
from sqlalchemy import Integer
from sqlalchemy.ext.declarative import declared_attr
from rolling.server.extension import ServerSideDocument as Document
class AnimatedCorpseType(enum.Enum):
CHARACT... | 38 | 801 | 69 |
1f12be287db7fc7382f094dd4fbc0400f1ab0705 | 851 | py | Python | code/rpi/sample_message.py | SAREC-Lab/birdcall | a597cb361ff5c97467b4b374b1a8cd210b551cf7 | [
"MIT"
] | null | null | null | code/rpi/sample_message.py | SAREC-Lab/birdcall | a597cb361ff5c97467b4b374b1a8cd210b551cf7 | [
"MIT"
] | null | null | null | code/rpi/sample_message.py | SAREC-Lab/birdcall | a597cb361ff5c97467b4b374b1a8cd210b551cf7 | [
"MIT"
] | null | null | null |
import requests
import json
import time
'''
r = requests.post("http://127.0.0.1:5000/commands",
json={'message':'arm'})
print(r.json())
print(r.status_code, r.reason)
'''
while True:
r = requests.get("http://127.0.0.1:5000/status")
print(r.json())
print(r.status_code, r.reason)
tim... | 25.029412 | 99 | 0.558167 |
import requests
import json
import time
'''
r = requests.post("http://127.0.0.1:5000/commands",
json={'message':'arm'})
print(r.json())
print(r.status_code, r.reason)
'''
while True:
r = requests.get("http://127.0.0.1:5000/status")
print(r.json())
print(r.status_code, r.reason)
tim... | 0 | 0 | 0 |
7197c87f66af380e5e98dd30c64711ce25f12d71 | 607 | py | Python | items/models.py | roberthtamayose/digitalmenu | 19c6633844934fd95f861674946da386411a19c9 | [
"MIT"
] | null | null | null | items/models.py | roberthtamayose/digitalmenu | 19c6633844934fd95f861674946da386411a19c9 | [
"MIT"
] | null | null | null | items/models.py | roberthtamayose/digitalmenu | 19c6633844934fd95f861674946da386411a19c9 | [
"MIT"
] | null | null | null | from django.db import models
from django.utils import timezone
| 27.590909 | 73 | 0.726524 | from django.db import models
from django.utils import timezone
class Categoria(models.Model):
nome = models.CharField(max_length=255)
def __str__(self):
return self.nome
class Item(models.Model):
nome = models.CharField(max_length=255)
data_criacao = models.DateTimeField(default=timezone.no... | 44 | 452 | 46 |
0b3006d0883d626f388b32ea2e832e3ba597d0a5 | 2,937 | py | Python | spec_util.py | LucasMolander/WoW-APL-Search | 03aa20e18509e9dc4c921e0b47cf58c92ac0f02c | [
"MIT"
] | null | null | null | spec_util.py | LucasMolander/WoW-APL-Search | 03aa20e18509e9dc4c921e0b47cf58c92ac0f02c | [
"MIT"
] | null | null | null | spec_util.py | LucasMolander/WoW-APL-Search | 03aa20e18509e9dc4c921e0b47cf58c92ac0f02c | [
"MIT"
] | null | null | null | from enum import Enum
from typing import Dict, Set
CLASS_TO_SPECS: Dict[APLClass, Set[APLSpec]] = {
APLClass.WARRIOR: {
APLSpec.WARRIOR_ARMS,
APLSpec.WARRIOR_FURY,
APLSpec.WARRIOR_PROTECTION,
},
APLClass.PALADIN: {
APLSpec.PALADIN_HOLY,
APLSpec.PALADIN_PROTECTION,
APLSpec.PALADIN_RETRIBU... | 24.680672 | 48 | 0.721144 | from enum import Enum
from typing import Dict, Set
class APLClass(Enum):
WARRIOR = "warrior"
PALADIN = "paladin"
HUNTER = "hunter"
ROGUE = "rogue"
PRIEST = "priest"
SHAMAN = "shaman"
MAGE = "mage"
WARLOCK = "warlock"
MONK = "monk"
DRUID = "druid"
DEMON_HUNTER = "demon_hunter"
DEATH_KNIGHT = "de... | 0 | 1,399 | 46 |
e6b6b92f8c1a172c27884a8c6754bf7899f73355 | 447 | py | Python | backend/others/large_json_read.py | delone-lora/Shakespeare | c62092bc7307314407ebff4b990116d0583eb8b4 | [
"MIT"
] | null | null | null | backend/others/large_json_read.py | delone-lora/Shakespeare | c62092bc7307314407ebff4b990116d0583eb8b4 | [
"MIT"
] | null | null | null | backend/others/large_json_read.py | delone-lora/Shakespeare | c62092bc7307314407ebff4b990116d0583eb8b4 | [
"MIT"
] | null | null | null | import json
d = []
with open('truncated.json') as json_file:
data = json.load(json_file)
for row in data:
d.append([row["text"], row["user"]["followers_count"]])
print(d[109])
assert False
print(data[0]["user"]["friends_count"])
print(data[3]["user"]["followers_count"])
print(data[1]["user"]["favou... | 26.294118 | 63 | 0.662192 | import json
d = []
with open('truncated.json') as json_file:
data = json.load(json_file)
for row in data:
d.append([row["text"], row["user"]["followers_count"]])
print(d[109])
assert False
print(data[0]["user"]["friends_count"])
print(data[3]["user"]["followers_count"])
print(data[1]["user"]["favou... | 0 | 0 | 0 |
533947edff5bb38f2096fc219acfe72b0d01175a | 4,407 | py | Python | tests/zquantum/core/circuits/_circuit_test.py | alexjuda2/z-quantum-core | c258100dbd091f0b22495b77b36399426ae9abac | [
"Apache-2.0"
] | null | null | null | tests/zquantum/core/circuits/_circuit_test.py | alexjuda2/z-quantum-core | c258100dbd091f0b22495b77b36399426ae9abac | [
"Apache-2.0"
] | null | null | null | tests/zquantum/core/circuits/_circuit_test.py | alexjuda2/z-quantum-core | c258100dbd091f0b22495b77b36399426ae9abac | [
"Apache-2.0"
] | null | null | null | import numpy as np
import pytest
import sympy
from zquantum.core.circuits._builtin_gates import (
CNOT,
CPHASE,
CZ,
ISWAP,
PHASE,
RX,
RY,
RZ,
SWAP,
XX,
YY,
ZZ,
H,
I,
T,
X,
Y,
Z,
)
from zquantum.core.circuits._circuit import Circuit
RNG = np.random... | 26.709091 | 85 | 0.526208 | import numpy as np
import pytest
import sympy
from zquantum.core.circuits._builtin_gates import (
CNOT,
CPHASE,
CZ,
ISWAP,
PHASE,
RX,
RY,
RZ,
SWAP,
XX,
YY,
ZZ,
H,
I,
T,
X,
Y,
Z,
)
from zquantum.core.circuits._circuit import Circuit
RNG = np.random... | 2,866 | 6 | 251 |
9f7b7888b3f9b6267d86ed87b37a4a236b6d4b63 | 1,961 | py | Python | program05/program05b_kwj_csci160_spr22.py | smallpythoncode/csci160 | 06de335aad28d635995fcf3dc9851ca285e632a1 | [
"MIT"
] | null | null | null | program05/program05b_kwj_csci160_spr22.py | smallpythoncode/csci160 | 06de335aad28d635995fcf3dc9851ca285e632a1 | [
"MIT"
] | null | null | null | program05/program05b_kwj_csci160_spr22.py | smallpythoncode/csci160 | 06de335aad28d635995fcf3dc9851ca285e632a1 | [
"MIT"
] | null | null | null | """
Jahnke
kenny.jahnke@ndus.edu / greensaber77@gmail.com
CSCI 160 - Spring 2022
Program 05, Part B
Use SimpleGraphics to draw your initials. To ensure practice of loops,
only the point command can be used to draw.
"""
from simple_graphics.SimpleGraphics import *
setSize(400, 150)
setBackground("black")
setLineWidt... | 22.54023 | 70 | 0.676186 | """
Jahnke
kenny.jahnke@ndus.edu / greensaber77@gmail.com
CSCI 160 - Spring 2022
Program 05, Part B
Use SimpleGraphics to draw your initials. To ensure practice of loops,
only the point command can be used to draw.
"""
from simple_graphics.SimpleGraphics import *
setSize(400, 150)
setBackground("black")
setLineWidt... | 0 | 0 | 0 |
60630db64fc6e6369cad59e59022a710af433345 | 4,213 | py | Python | VGG16_keras/VGG16_keras.py | yooookan/yooookan_cnn_practice | 03899d594b254eeb4f960ecd4455399f152bea1b | [
"MIT"
] | null | null | null | VGG16_keras/VGG16_keras.py | yooookan/yooookan_cnn_practice | 03899d594b254eeb4f960ecd4455399f152bea1b | [
"MIT"
] | 15 | 2019-07-23T14:52:25.000Z | 2022-02-10T00:17:10.000Z | VGG16_keras/VGG16_keras.py | yooookan/yooookan_cnn_practice | 03899d594b254eeb4f960ecd4455399f152bea1b | [
"MIT"
] | null | null | null | import keras
from keras.layers import Conv2D, MaxPooling2D, Lambda, Input, Dense, Flatten, BatchNormalization
from keras.models import Model
from keras.layers.core import Dropout
from keras import optimizers
import tensorflow as tf
from keras.callbacks import ReduceLROnPlateau,TensorBoard
from sklearn.metrics ... | 40.902913 | 97 | 0.651317 | import keras
from keras.layers import Conv2D, MaxPooling2D, Lambda, Input, Dense, Flatten, BatchNormalization
from keras.models import Model
from keras.layers.core import Dropout
from keras import optimizers
import tensorflow as tf
from keras.callbacks import ReduceLROnPlateau,TensorBoard
from sklearn.metrics ... | 0 | 0 | 0 |
2266f09a88c36f45aa19a71245e37eb94baed079 | 17,332 | py | Python | Code/slate.py | AspenH/CSC-450-Project | 8f55fda797e13af412a4d70f6f455ad0a1058b69 | [
"MIT"
] | null | null | null | Code/slate.py | AspenH/CSC-450-Project | 8f55fda797e13af412a4d70f6f455ad0a1058b69 | [
"MIT"
] | null | null | null | Code/slate.py | AspenH/CSC-450-Project | 8f55fda797e13af412a4d70f6f455ad0a1058b69 | [
"MIT"
] | null | null | null | """
Project: Project FandRec
Programmed by: David Williams
Last Modified: 11/21/2017
Description: Takes in a frame and finds faces in the picture. If the frame contains a face that has been registered,
it will also check next to the face for fingers held up. If the number of fingers is mapped to action to be
t... | 32.95057 | 815 | 0.678398 | """
Project: Project FandRec
Programmed by: David Williams
Last Modified: 11/21/2017
Description: Takes in a frame and finds faces in the picture. If the frame contains a face that has been registered,
it will also check next to the face for fingers held up. If the number of fingers is mapped to action to be
t... | 456 | 0 | 95 |
13dbeff99b9c2ec00df905345823aadbbf822f93 | 496 | py | Python | db.py | stjordanis/owid-importer | 4341713d7fa88b41327ea48419ed5785b5cb9faf | [
"MIT"
] | 15 | 2018-12-07T06:11:49.000Z | 2022-01-24T03:38:05.000Z | db.py | stjordanis/owid-importer | 4341713d7fa88b41327ea48419ed5785b5cb9faf | [
"MIT"
] | 10 | 2020-04-05T01:08:27.000Z | 2022-02-17T23:54:13.000Z | db.py | stjordanis/owid-importer | 4341713d7fa88b41327ea48419ed5785b5cb9faf | [
"MIT"
] | 6 | 2018-11-03T09:14:58.000Z | 2021-05-17T21:59:59.000Z | import os
import pymysql
from dotenv import load_dotenv
load_dotenv()
# Connect to the database
connection = pymysql.connect(db=os.getenv('DB_NAME'),
host=os.getenv('DB_HOST'),
port=int(os.getenv('DB_PORT')),
user=os.getenv('DB_USE... | 35.428571 | 110 | 0.540323 | import os
import pymysql
from dotenv import load_dotenv
load_dotenv()
# Connect to the database
connection = pymysql.connect(db=os.getenv('DB_NAME'),
host=os.getenv('DB_HOST'),
port=int(os.getenv('DB_PORT')),
user=os.getenv('DB_USE... | 0 | 0 | 0 |
aef2700579282b0037f3cfe0e3d864fc97b361ad | 6,360 | py | Python | pyngs/scripts/vcf/allele_filter.py | erasmus-center-for-biomics/pyngs | 3489f91c9c56097a561ae1ff05225f784074228a | [
"MIT"
] | null | null | null | pyngs/scripts/vcf/allele_filter.py | erasmus-center-for-biomics/pyngs | 3489f91c9c56097a561ae1ff05225f784074228a | [
"MIT"
] | null | null | null | pyngs/scripts/vcf/allele_filter.py | erasmus-center-for-biomics/pyngs | 3489f91c9c56097a561ae1ff05225f784074228a | [
"MIT"
] | null | null | null | import sys
import gzip
import argparse
import logging
from typing import Dict, List, Union, TextIO, Generator
import pyngs.vcf as vcf
from pyngs import open_stream
from pyngs.vcf.tools import FilterAlt
def allele_filter(args):
"""Run the script."""
fltalleles = FilterAlleles(
samples=ar... | 37.411765 | 115 | 0.543868 | import sys
import gzip
import argparse
import logging
from typing import Dict, List, Union, TextIO, Generator
import pyngs.vcf as vcf
from pyngs import open_stream
from pyngs.vcf.tools import FilterAlt
class FilterAlleles:
def __init__(self, samples: List[str], alt:int = 0, freq: float=0.0, digits: i... | 296 | 4,023 | 25 |
c47c6fe3d9583375ad87bd533dcc56d5a32c9bae | 596 | py | Python | GT/GT_app/views.py | 10K-Linesofcode/Glowing-Tribble | be0e17ce5391b589792e4ae6b02156d7ee4ce145 | [
"MIT"
] | null | null | null | GT/GT_app/views.py | 10K-Linesofcode/Glowing-Tribble | be0e17ce5391b589792e4ae6b02156d7ee4ce145 | [
"MIT"
] | null | null | null | GT/GT_app/views.py | 10K-Linesofcode/Glowing-Tribble | be0e17ce5391b589792e4ae6b02156d7ee4ce145 | [
"MIT"
] | null | null | null | from django.shortcuts import render
# Create your views here.
from django.http import HttpResponse
from GT_app.models import Topic,Webpage,AccessRecord
# Create your views here.
#def index(request):
# return HttpResponse(' Hello World')
# pass
#def index_withTemplate(request):
# insert_dict= {'insert_m... | 27.090909 | 65 | 0.746644 | from django.shortcuts import render
# Create your views here.
from django.http import HttpResponse
from GT_app.models import Topic,Webpage,AccessRecord
# Create your views here.
#def index(request):
# return HttpResponse(' Hello World')
# pass
def index(request):
webpages_list = AccessRecord.objects.or... | 163 | 0 | 22 |