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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
b436de1d92ef68f8af58562559d0540f445df9bd | 3,337 | py | Python | lib/translator.py | OliverDeBrisbane/Text-Translator | 9380d1bf7036098ff2e3e9a407408a3e4803c1e6 | [
"MIT"
] | null | null | null | lib/translator.py | OliverDeBrisbane/Text-Translator | 9380d1bf7036098ff2e3e9a407408a3e4803c1e6 | [
"MIT"
] | null | null | null | lib/translator.py | OliverDeBrisbane/Text-Translator | 9380d1bf7036098ff2e3e9a407408a3e4803c1e6 | [
"MIT"
] | 1 | 2021-12-13T04:57:13.000Z | 2021-12-13T04:57:13.000Z |
# Need to split up to avoid duplication
# The below function would be used to find occurrences where the source word is in the translation text.
'''
def search_single_word(self, language, word):
# Translate single word
found_words = ""
if language == '-en':
for dict_word in se... | 41.7125 | 147 | 0.564879 | class Translator():
def __init__(self, dictionary):
self.dictionary = dictionary
self.wordlist = dictionary.wordlist
def translate_single_word(self, language, word):
# Translate single word
# Returning an array of words for when there are multiple
# interpretations, we c... | 2,211 | -2 | 102 |
83915da98c5b6804a0bcbe5edfb1c53e2828f8cb | 479 | py | Python | get_dataset.py | bilkosem/Easy-Heatmap | 0d0f0cb83591366a9d7d5bd6c90ffaca7e6392b8 | [
"Apache-2.0"
] | 1 | 2020-10-18T22:21:47.000Z | 2020-10-18T22:21:47.000Z | get_dataset.py | bilkosem/Easy-Heatmap | 0d0f0cb83591366a9d7d5bd6c90ffaca7e6392b8 | [
"Apache-2.0"
] | null | null | null | get_dataset.py | bilkosem/Easy-Heatmap | 0d0f0cb83591366a9d7d5bd6c90ffaca7e6392b8 | [
"Apache-2.0"
] | null | null | null | import pandas as pd
csv_file = pd.read_csv('http://archive.ics.uci.edu/ml/machine-learning-databases/communities/communities.data',header=None)
df = csv_file[[0,len(csv_file.columns)-1]]
df.columns = ['label', 'value']
grouped_by_state = df.groupby('label')
aa = grouped_by_state['value'].sum()/grouped_by_state['valu... | 36.846154 | 124 | 0.74739 | import pandas as pd
csv_file = pd.read_csv('http://archive.ics.uci.edu/ml/machine-learning-databases/communities/communities.data',header=None)
df = csv_file[[0,len(csv_file.columns)-1]]
df.columns = ['label', 'value']
grouped_by_state = df.groupby('label')
aa = grouped_by_state['value'].sum()/grouped_by_state['valu... | 0 | 0 | 0 |
2ce115e53c2ca372aca3cdcf9e5e961eb1ca609e | 1,173 | py | Python | vetiver/tests/test_add_endpoint.py | isabelizimm/vetiver-python | c050d495aae1d89123f711ee6a1e4427f80a816a | [
"MIT"
] | null | null | null | vetiver/tests/test_add_endpoint.py | isabelizimm/vetiver-python | c050d495aae1d89123f711ee6a1e4427f80a816a | [
"MIT"
] | 4 | 2022-01-28T17:30:40.000Z | 2022-03-21T21:50:16.000Z | vetiver/tests/test_add_endpoint.py | isabelizimm/vetiver-python | c050d495aae1d89123f711ee6a1e4427f80a816a | [
"MIT"
] | null | null | null | import pytest
from vetiver import mock, VetiverModel, VetiverAPI
from fastapi.testclient import TestClient
| 25.5 | 62 | 0.660699 | import pytest
from vetiver import mock, VetiverModel, VetiverAPI
from fastapi.testclient import TestClient
def _start_application(check_ptype):
X, y = mock.get_mock_data()
model = mock.get_mock_model().fit(X, y)
v = VetiverModel(
model=model,
ptype_data=X,
model_name="my_model",
... | 993 | 0 | 69 |
5d68ca558c6e449163725893f151469f915829df | 658 | py | Python | client/tracebin/utils.py | alex/tracebin | cd9717e750718dcb94140f60957c3f543915317f | [
"BSD-3-Clause"
] | 3 | 2015-11-08T12:45:45.000Z | 2019-05-09T20:03:57.000Z | client/tracebin/utils.py | alex/tracebin | cd9717e750718dcb94140f60957c3f543915317f | [
"BSD-3-Clause"
] | null | null | null | client/tracebin/utils.py | alex/tracebin | cd9717e750718dcb94140f60957c3f543915317f | [
"BSD-3-Clause"
] | null | null | null | import os
import struct
import sys
from __pypy__ import time
if sys.platform.startswith("linux"):
| 25.307692 | 71 | 0.665653 | import os
import struct
import sys
from __pypy__ import time
def read_unpack(fmt, file):
# This is different from struct.unpack_from because it advances the
# position in the file
size = struct.calcsize(fmt)
return struct.unpack(fmt, file.read(size))
def dict_merge(*dicts):
result = {}
for d ... | 459 | 0 | 99 |
b65e8f5102b0510c92b8c0ec4c461f676d5eb9a1 | 5,482 | py | Python | OriginalRetroZoom/asteroidgame.py | letmaik/InnovationChallenge2021 | 4c32b450bcdd941ac32354bf20d426736b3bcbda | [
"MIT"
] | null | null | null | OriginalRetroZoom/asteroidgame.py | letmaik/InnovationChallenge2021 | 4c32b450bcdd941ac32354bf20d426736b3bcbda | [
"MIT"
] | null | null | null | OriginalRetroZoom/asteroidgame.py | letmaik/InnovationChallenge2021 | 4c32b450bcdd941ac32354bf20d426736b3bcbda | [
"MIT"
] | 1 | 2021-03-07T12:30:34.000Z | 2021-03-07T12:30:34.000Z | # asteroid game
from PIL import ImageFont, ImageDraw, Image
import cv2
import random
import numpy as np
import pathlib
from playsound import playsound
| 34.917197 | 106 | 0.569865 | # asteroid game
from PIL import ImageFont, ImageDraw, Image
import cv2
import random
import numpy as np
import pathlib
from playsound import playsound
class AsteroidGame:
def __init__(self, width, height):
self.asteroid_image = cv2.imread('assets/asteroid.png', cv2.IMREAD_UNCHANGED)
self.astero... | 4,986 | -11 | 306 |
1d8cdeed1edf7b0c8801f03bf8ccdc2d766b9eac | 168 | py | Python | g.py | otricadziziusz/roguelike-tutorial | 7fa3f583ed50831ca89e0d900e5803dd50ea35ec | [
"MIT"
] | 17 | 2019-06-21T03:53:31.000Z | 2021-06-24T09:58:58.000Z | g.py | otricadziziusz/roguelike-tutorial | 7fa3f583ed50831ca89e0d900e5803dd50ea35ec | [
"MIT"
] | 5 | 2020-02-24T22:43:15.000Z | 2021-01-02T16:03:52.000Z | g.py | otricadziziusz/roguelike-tutorial | 7fa3f583ed50831ca89e0d900e5803dd50ea35ec | [
"MIT"
] | 3 | 2019-06-20T22:12:19.000Z | 2020-09-05T17:13:47.000Z | """Python module to define and hold global variables."""
import tcod
context: tcod.context.Context # Active context.
console: tcod.console.Console # Active console.
| 28 | 56 | 0.761905 | """Python module to define and hold global variables."""
import tcod
context: tcod.context.Context # Active context.
console: tcod.console.Console # Active console.
| 0 | 0 | 0 |
35e7db34863a9b9eb03878e8c456fb38371b7f28 | 3,574 | py | Python | bluebottle/wallposts/migrations/0013_auto_20170822_1105.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 10 | 2015-05-28T18:26:40.000Z | 2021-09-06T10:07:03.000Z | bluebottle/wallposts/migrations/0013_auto_20170822_1105.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 762 | 2015-01-15T10:00:59.000Z | 2022-03-31T15:35:14.000Z | bluebottle/wallposts/migrations/0013_auto_20170822_1105.py | terrameijar/bluebottle | b4f5ba9c4f03e678fdd36091b29240307ea69ffd | [
"BSD-3-Clause"
] | 9 | 2015-02-20T13:19:30.000Z | 2022-03-08T14:09:17.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-08-22 09:05
from __future__ import unicode_literals
from django.db import migrations
| 127.642857 | 1,723 | 0.743984 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.7 on 2017-08-22 09:05
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('wallposts', '0012_auto_20170821_2018'),
]
operations = [
migrations.AlterModelOptio... | 0 | 3,403 | 23 |
ab66cfa7bee2f1894ebdb37a4d6be0f431161820 | 1,843 | py | Python | tests/test_impute_age.py | Tommo565/titanic-mlflow | 5bdaad5b90313db212fb2547eb5476a41ff22ccc | [
"MIT"
] | 1 | 2022-02-06T19:57:54.000Z | 2022-02-06T19:57:54.000Z | tests/test_impute_age.py | Tommo565/titanic-mlflow | 5bdaad5b90313db212fb2547eb5476a41ff22ccc | [
"MIT"
] | null | null | null | tests/test_impute_age.py | Tommo565/titanic-mlflow | 5bdaad5b90313db212fb2547eb5476a41ff22ccc | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from src.utils import (
load_config,
load_parameters,
)
from src.preprocessing_pipeline import impute_age
def test_impute_age():
"""Test the impute_age function"""
# Load in the test configuration & parameters
config = load_config(".env-test")
parameters... | 30.716667 | 75 | 0.604449 | import pandas as pd
import numpy as np
from src.utils import (
load_config,
load_parameters,
)
from src.preprocessing_pipeline import impute_age
def test_impute_age():
"""Test the impute_age function"""
# Load in the test configuration & parameters
config = load_config(".env-test")
parameters... | 0 | 0 | 0 |
91ed56678214b8bb433fb4e47c8aad36ba3e19c4 | 3,984 | py | Python | BookSrc/learnOpenCV/EigenFace/EigenFace.py | xiaohaijin/OpenCV | 0b909cd2a3321d5ceaa00cd912a1ca44ed4fade1 | [
"MIT"
] | 1 | 2018-12-24T19:37:02.000Z | 2018-12-24T19:37:02.000Z | BookSrc/learnOpenCV/EigenFace/EigenFace.py | xiaohaijin/OpenCV | 0b909cd2a3321d5ceaa00cd912a1ca44ed4fade1 | [
"MIT"
] | null | null | null | BookSrc/learnOpenCV/EigenFace/EigenFace.py | xiaohaijin/OpenCV | 0b909cd2a3321d5ceaa00cd912a1ca44ed4fade1 | [
"MIT"
] | null | null | null | # Import necessary packages
from __future__ import print_function
import os
import sys
import cv2
import numpy as np
# Create data matrix from a list of images
# Read images from the directory
# Add the weighted eigen faces to the mean face
if __name__ == '__main__':
# Number of EigenFaces
NUM_EIGEN_FACES = 10
... | 26.039216 | 106 | 0.688002 | # Import necessary packages
from __future__ import print_function
import os
import sys
import cv2
import numpy as np
# Create data matrix from a list of images
def createDataMatrix(images):
print("Creating data matrix",end=" ... ")
'''
Allocate space for all images in one data matrix.
The size of the data matrix... | 2,159 | 0 | 89 |
589dc4755e472ce7cb4dcc74c467f83713141471 | 589 | py | Python | src/urls.py | tys-hiroshi/bnodeapi | 51aa214a60eb31acee8be2c9d67a1d8edccd267b | [
"MIT"
] | null | null | null | src/urls.py | tys-hiroshi/bnodeapi | 51aa214a60eb31acee8be2c9d67a1d8edccd267b | [
"MIT"
] | 2 | 2021-05-21T09:36:42.000Z | 2021-05-28T03:55:44.000Z | src/urls.py | tys-hiroshi/bnodeapi | 51aa214a60eb31acee8be2c9d67a1d8edccd267b | [
"MIT"
] | null | null | null | from controllers._base_controller import app
from controllers.index_controller import *
from controllers.admin_controller import *
from controllers.user_controller import *
from controllers.api_controller import *
# FastAPIのルーティング用関数
app.add_api_route('/', index)
app.add_api_route('/admin', admin) # management view f... | 49.083333 | 92 | 0.809847 | from controllers._base_controller import app
from controllers.index_controller import *
from controllers.admin_controller import *
from controllers.user_controller import *
from controllers.api_controller import *
# FastAPIのルーティング用関数
app.add_api_route('/', index)
app.add_api_route('/admin', admin) # management view f... | 0 | 0 | 0 |
5806d30fd2b6d03c8ac3171dca9e6d05c41861b2 | 18,037 | py | Python | t5x/contrib/moe/partitioning.py | google-research/t5x | dba95aee8ab7b9e3dba8be80e0e6a11beb9284f5 | [
"Apache-2.0"
] | 278 | 2021-11-03T20:24:32.000Z | 2022-03-29T23:44:06.000Z | t5x/contrib/moe/partitioning.py | google-research/t5x | dba95aee8ab7b9e3dba8be80e0e6a11beb9284f5 | [
"Apache-2.0"
] | 31 | 2021-11-04T02:10:31.000Z | 2022-03-29T19:03:49.000Z | t5x/contrib/moe/partitioning.py | google-research/t5x | dba95aee8ab7b9e3dba8be80e0e6a11beb9284f5 | [
"Apache-2.0"
] | 26 | 2021-11-03T23:26:19.000Z | 2022-03-29T00:18:51.000Z | # Copyright 2022 The T5X Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 41.2746 | 80 | 0.71625 | # Copyright 2022 The T5X Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | 0 | 0 | 0 |
5f263ea0d8ba1ce17d66473241a2b2c0e954a1c9 | 2,132 | py | Python | main.py | Catherinesjkim/fullstack-app | 263bacd8b17255e86e132131e4ffacf9faea3a2a | [
"MIT"
] | null | null | null | main.py | Catherinesjkim/fullstack-app | 263bacd8b17255e86e132131e4ffacf9faea3a2a | [
"MIT"
] | null | null | null | main.py | Catherinesjkim/fullstack-app | 263bacd8b17255e86e132131e4ffacf9faea3a2a | [
"MIT"
] | null | null | null | # Web app UI
import sqlite3, config
from fastapi import FastAPI, Request
from fastapi.templating import Jinja2Templates
from datetime import date
app = FastAPI()
templates = Jinja2Templates(directory="templates") # configuring HTML templates dirctory - display logic
@app.get("/") # all get request will be routed to t... | 37.403509 | 117 | 0.67167 | # Web app UI
import sqlite3, config
from fastapi import FastAPI, Request
from fastapi.templating import Jinja2Templates
from datetime import date
app = FastAPI()
templates = Jinja2Templates(directory="templates") # configuring HTML templates dirctory - display logic
@app.get("/") # all get request will be routed to t... | 1,679 | 0 | 44 |
42351bd0f0c5e45f0f986eb7942722982355a200 | 14,985 | py | Python | deepposekit/io/utils.py | rwarren2163/DeepPoseKit | e85c99254e58ff56aa8624d377b7911254d9a09e | [
"Apache-2.0"
] | null | null | null | deepposekit/io/utils.py | rwarren2163/DeepPoseKit | e85c99254e58ff56aa8624d377b7911254d9a09e | [
"Apache-2.0"
] | null | null | null | deepposekit/io/utils.py | rwarren2163/DeepPoseKit | e85c99254e58ff56aa8624d377b7911254d9a09e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright 2018-2019 Jacob M. Graving <jgraving@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless ... | 36.283293 | 107 | 0.602536 | # -*- coding: utf-8 -*-
# Copyright 2018-2019 Jacob M. Graving <jgraving@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless ... | 0 | 0 | 0 |
a4872f8e00fd8b82e89d6c769ba4239846e48e30 | 11,826 | py | Python | brick_data/sparql/brick_endpoint.py | jbkoh/brick_data | bab392b8b0b83c7a0c5427c08f3d9f2b22a8ab06 | [
"Apache-2.0"
] | 3 | 2020-09-24T18:53:55.000Z | 2021-02-22T07:30:04.000Z | brick_data/sparql/brick_endpoint.py | jbkoh/brick-federation | bab392b8b0b83c7a0c5427c08f3d9f2b22a8ab06 | [
"Apache-2.0"
] | 2 | 2019-03-31T01:22:13.000Z | 2019-05-28T00:49:36.000Z | brick_data/sparql/brick_endpoint.py | jbkoh/brick-federation | bab392b8b0b83c7a0c5427c08f3d9f2b22a8ab06 | [
"Apache-2.0"
] | 1 | 2019-05-28T18:58:51.000Z | 2019-05-28T18:58:51.000Z | from shutil import copyfile
import pdb
from copy import deepcopy
import os
import arrow
from io import StringIO
import re
import semver
import rdflib
from rdflib import RDFS, RDF, OWL, Namespace
from rdflib.namespace import FOAF
from SPARQLWrapper import SPARQLWrapper
from SPARQLWrapper import JSON, SELECT, INSERT, DI... | 33.596591 | 97 | 0.568831 | from shutil import copyfile
import pdb
from copy import deepcopy
import os
import arrow
from io import StringIO
import re
import semver
import rdflib
from rdflib import RDFS, RDF, OWL, Namespace
from rdflib.namespace import FOAF
from SPARQLWrapper import SPARQLWrapper
from SPARQLWrapper import JSON, SELECT, INSERT, DI... | 10,286 | 5 | 775 |
1cad09bab6b9c12bf5368062bff420e86dc6fd75 | 1,240 | py | Python | src/sashimi/__init__.py | solstag/isgc-congress | c1ea92cec81f14d8cdc355730d3d85cd248b75b6 | [
"CC0-1.0"
] | null | null | null | src/sashimi/__init__.py | solstag/isgc-congress | c1ea92cec81f14d8cdc355730d3d85cd248b75b6 | [
"CC0-1.0"
] | null | null | null | src/sashimi/__init__.py | solstag/isgc-congress | c1ea92cec81f14d8cdc355730d3d85cd248b75b6 | [
"CC0-1.0"
] | null | null | null | #! /usr/bin/env python
import pandas as pd
from .clean import clean_text
""" NOTES
- Data columns:
['abstract_text',
'abstract_title',
'bibliography',
'cancelled',
'code',
'figure_legend_1',
'figure_legend_2',
'figure_title_1',
'figure_title_2',
'final_status',
'... | 20.327869 | 61 | 0.558871 | #! /usr/bin/env python
import pandas as pd
from .clean import clean_text
""" NOTES
- Data columns:
['abstract_text',
'abstract_title',
'bibliography',
'cancelled',
'code',
'figure_legend_1',
'figure_legend_2',
'figure_title_1',
'figure_title_2',
'final_status',
'... | 536 | 0 | 23 |
7d2740aae8cc8b4266784cb1cd531579a7c76266 | 337 | py | Python | src/masonite/orm/commands/MigrateRollbackCommand.py | Marlysson/orm | ec2f3e3c107135c95ecddc5034c809114344c880 | [
"MIT"
] | null | null | null | src/masonite/orm/commands/MigrateRollbackCommand.py | Marlysson/orm | ec2f3e3c107135c95ecddc5034c809114344c880 | [
"MIT"
] | null | null | null | src/masonite/orm/commands/MigrateRollbackCommand.py | Marlysson/orm | ec2f3e3c107135c95ecddc5034c809114344c880 | [
"MIT"
] | null | null | null | from cleo import Command
from src.masonite.orm.migrations.Migration import Migration
class MigrateRollbackCommand(Command):
"""
Run migrations.
migrate:rollback
{--c|connection=default : The connection you want to run migrations on}
"""
| 21.0625 | 79 | 0.703264 | from cleo import Command
from src.masonite.orm.migrations.Migration import Migration
class MigrateRollbackCommand(Command):
"""
Run migrations.
migrate:rollback
{--c|connection=default : The connection you want to run migrations on}
"""
def handle(self):
Migration(command_class=... | 45 | 0 | 27 |
392f7023698f021b1f8b4ef2767a8e2105050867 | 6,974 | py | Python | portfoliotool/herolab/models/pathfinder.py | cniemira/portfoliotool | 5a8d33c108a8816e21b89076b9342a93f7595317 | [
"BSD-3-Clause"
] | null | null | null | portfoliotool/herolab/models/pathfinder.py | cniemira/portfoliotool | 5a8d33c108a8816e21b89076b9342a93f7595317 | [
"BSD-3-Clause"
] | null | null | null | portfoliotool/herolab/models/pathfinder.py | cniemira/portfoliotool | 5a8d33c108a8816e21b89076b9342a93f7595317 | [
"BSD-3-Clause"
] | null | null | null | import importlib
import logging
from collections import OrderedDict, defaultdict
from portfoliotool.utils.xmlutils import (
get_attribute, get_attributes, get_subnode, get_subnode_subnodes,
get_textnode
)
log = logging.getLogger(__name__)
| 37.494624 | 80 | 0.569257 | import importlib
import logging
from collections import OrderedDict, defaultdict
from portfoliotool.utils.xmlutils import (
get_attribute, get_attributes, get_subnode, get_subnode_subnodes,
get_textnode
)
log = logging.getLogger(__name__)
class HeroLabPathfinderCharacter(object):
_writers = {
... | 6,374 | 321 | 23 |
8fedcb9d74e82ae88ebbe9d6e9671fab199490cf | 7,953 | py | Python | test_server/app.py | faryabimm/webelopers-2018-tests | ef22ada2cf104f41566f84e558ad7a56387b933b | [
"MIT"
] | 1 | 2019-01-19T16:05:36.000Z | 2019-01-19T16:05:36.000Z | test_server/app.py | faryabimm/webelopers-2018-tests | ef22ada2cf104f41566f84e558ad7a56387b933b | [
"MIT"
] | null | null | null | test_server/app.py | faryabimm/webelopers-2018-tests | ef22ada2cf104f41566f84e558ad7a56387b933b | [
"MIT"
] | null | null | null | import pickle as pk
import sys
from ast import literal_eval
from datetime import datetime, timedelta
from threading import Thread
from urllib.error import URLError
from urllib.request import urlopen
import configuration as config
import logger
import requests
import tests
import utils
from flask import Flask, request
... | 36.15 | 120 | 0.641519 | import pickle as pk
import sys
from ast import literal_eval
from datetime import datetime, timedelta
from threading import Thread
from urllib.error import URLError
from urllib.request import urlopen
import configuration as config
import logger
import requests
import tests
import utils
from flask import Flask, request
... | 6,324 | 0 | 250 |
9117575a31f8b2bf616ecfb41f4c63d436081496 | 310 | py | Python | src/models/__init__.py | laurosn/flask-api-starter-kit | 09a5b67bf48abeb427beae9bccae323aea16d9ae | [
"MIT"
] | null | null | null | src/models/__init__.py | laurosn/flask-api-starter-kit | 09a5b67bf48abeb427beae9bccae323aea16d9ae | [
"MIT"
] | null | null | null | src/models/__init__.py | laurosn/flask-api-starter-kit | 09a5b67bf48abeb427beae9bccae323aea16d9ae | [
"MIT"
] | null | null | null | from flask_sqlalchemy import SQLAlchemy
from flask_marshmallow import Marshmallow
db = SQLAlchemy()
ma = Marshmallow()
from .user import User, UserSchema
from .sistema import Sistema, SistemaSchema
from .comando import Comando, ComandoSchema
from .blacklist_token import BlacklistToken, BlacklistTokenSchema | 28.181818 | 65 | 0.83871 | from flask_sqlalchemy import SQLAlchemy
from flask_marshmallow import Marshmallow
db = SQLAlchemy()
ma = Marshmallow()
from .user import User, UserSchema
from .sistema import Sistema, SistemaSchema
from .comando import Comando, ComandoSchema
from .blacklist_token import BlacklistToken, BlacklistTokenSchema | 0 | 0 | 0 |
4a17e99cf3c67b0f93d5b18058cd3ddb05e35423 | 14,427 | py | Python | query_clu.py | tahumada/kowalski-searches | 824cd0e8cfb5b21441903fc18bdbd4e83b729b91 | [
"MIT"
] | null | null | null | query_clu.py | tahumada/kowalski-searches | 824cd0e8cfb5b21441903fc18bdbd4e83b729b91 | [
"MIT"
] | null | null | null | query_clu.py | tahumada/kowalski-searches | 824cd0e8cfb5b21441903fc18bdbd4e83b729b91 | [
"MIT"
] | 1 | 2020-11-30T19:02:24.000Z | 2020-11-30T19:02:24.000Z | '''
Query Kowalski with cone searches centred
on CLU galaxies, searching for transients
given a set of constraints.
'''
def print_query_params(args):
'''Print a summary of the query parameters'''
print("#-----")
print("Cone search parameters:")
print(f"Search radius {args.radius} arcmin")
print(f... | 38.065963 | 186 | 0.56117 | '''
Query Kowalski with cone searches centred
on CLU galaxies, searching for transients
given a set of constraints.
'''
def print_query_params(args):
'''Print a summary of the query parameters'''
print("#-----")
print("Cone search parameters:")
print(f"Search radius {args.radius} arcmin")
print(f... | 0 | 0 | 0 |
71091d71a3ed35da9847a67d991f4be5369c4fbf | 16,425 | py | Python | src/datasets.py | mondrasovic/context_rcnn | b3f6b4fdd63fc76f33becae0fba1363f9e873f50 | [
"MIT"
] | null | null | null | src/datasets.py | mondrasovic/context_rcnn | b3f6b4fdd63fc76f33becae0fba1363f9e873f50 | [
"MIT"
] | null | null | null | src/datasets.py | mondrasovic/context_rcnn | b3f6b4fdd63fc76f33becae0fba1363f9e873f50 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2021 Milan Ondrašovič <milan.ondrasovic@gmail.com>
#
# MIT License
#
# 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 w... | 34.147609 | 81 | 0.605297 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2021 Milan Ondrašovič <milan.ondrasovic@gmail.com>
#
# MIT License
#
# 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 w... | 4,823 | 375 | 486 |
bff960ff949edbafc108252ba5f7729074658b58 | 9,792 | py | Python | appengine/findit/model/flake/test/master_flake_analysis_test.py | mcgreevy/chromium-infra | 09064105713603f7bf75c772e8354800a1bfa256 | [
"BSD-3-Clause"
] | 1 | 2018-01-02T05:47:07.000Z | 2018-01-02T05:47:07.000Z | appengine/findit/model/flake/test/master_flake_analysis_test.py | mcgreevy/chromium-infra | 09064105713603f7bf75c772e8354800a1bfa256 | [
"BSD-3-Clause"
] | null | null | null | appengine/findit/model/flake/test/master_flake_analysis_test.py | mcgreevy/chromium-infra | 09064105713603f7bf75c772e8354800a1bfa256 | [
"BSD-3-Clause"
] | null | null | null | # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from datetime import datetime
from gae_libs.testcase import TestCase
from libs import analysis_status
from model import result_status
from model import tri... | 40.970711 | 78 | 0.735805 | # Copyright 2016 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
from datetime import datetime
from gae_libs.testcase import TestCase
from libs import analysis_status
from model import result_status
from model import tri... | 8,570 | 19 | 698 |
b4a25eec553e5d5151950859e0fc76b512f73c7e | 604 | py | Python | src/image_builder/tests/01_unit/test_build.py | SODALITE-EU/image-builder | 0716e249e459bc0b05c717d17dfcf9df4214bfd0 | [
"Apache-2.0"
] | 4 | 2020-07-30T00:34:50.000Z | 2021-12-20T08:07:47.000Z | src/image_builder/tests/01_unit/test_build.py | SODALITE-EU/image-builder | 0716e249e459bc0b05c717d17dfcf9df4214bfd0 | [
"Apache-2.0"
] | 11 | 2020-07-04T15:32:48.000Z | 2022-01-27T10:54:09.000Z | src/image_builder/tests/01_unit/test_build.py | SODALITE-EU/image-builder | 0716e249e459bc0b05c717d17dfcf9df4214bfd0 | [
"Apache-2.0"
] | 2 | 2020-07-04T18:23:40.000Z | 2021-03-12T08:16:41.000Z | from image_builder.api.service.image_builder_service import build_image
| 37.75 | 109 | 0.758278 | from image_builder.api.service.image_builder_service import build_image
class TestBuildImage:
def test_success(self, mocker, generic_invocation):
mock_opera_outputs = mocker.MagicMock(name='opera', return_value={})
mocker.patch('image_builder.api.service.image_builder_service.opera_outputs', ... | 475 | 0 | 54 |
3a651fc05ea482da6cba4a5c01077ead57dd754c | 4,866 | py | Python | forge/ethyr/io/action.py | shwang/neural-mmo | c5b9a0f4317ec863110b24487312db0afc335fff | [
"MIT"
] | 1 | 2019-08-11T03:14:56.000Z | 2019-08-11T03:14:56.000Z | forge/ethyr/io/action.py | shouhu666/neural-mmo | f02dc86f63489dc80c8ce70eefc6fa94ac1f1dc0 | [
"MIT"
] | null | null | null | forge/ethyr/io/action.py | shouhu666/neural-mmo | f02dc86f63489dc80c8ce70eefc6fa94ac1f1dc0 | [
"MIT"
] | null | null | null | from pdb import set_trace as T
import numpy as np
from forge.blade.io import Action as Static
from forge.blade.io.action.node import NodeType
from forge.ethyr.io import utils
class ActionArgs:
'''An action argument pair'''
class Action:
'''IO class used for interacting with game actions
Used via .next to t... | 27.805714 | 72 | 0.593095 | from pdb import set_trace as T
import numpy as np
from forge.blade.io import Action as Static
from forge.blade.io.action.node import NodeType
from forge.ethyr.io import utils
class ActionArgs:
'''An action argument pair'''
def __init__(self, action=None, args=None):
self.action = action
self.args = ... | 263 | 0 | 50 |
8789075af8bb924a26507e7aab7918315c76489c | 2,602 | py | Python | ansible-devel/test/support/network-integration/collections/ansible_collections/ansible/netcommon/plugins/doc_fragments/netconf.py | satishcarya/ansible | ed091e174c26316f621ac16344a95c99f56bdc43 | [
"MIT"
] | null | null | null | ansible-devel/test/support/network-integration/collections/ansible_collections/ansible/netcommon/plugins/doc_fragments/netconf.py | satishcarya/ansible | ed091e174c26316f621ac16344a95c99f56bdc43 | [
"MIT"
] | null | null | null | ansible-devel/test/support/network-integration/collections/ansible_collections/ansible/netcommon/plugins/doc_fragments/netconf.py | satishcarya/ansible | ed091e174c26316f621ac16344a95c99f56bdc43 | [
"MIT"
] | 2 | 2021-03-30T14:26:02.000Z | 2021-04-01T18:17:29.000Z | # -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
| 38.835821 | 120 | 0.715219 | # -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
# Standard files documentation fragment
DOCUMENTATION = r"""options:
host:
description:
- Specifies the DNS host name or address for connecting to t... | 0 | 2,460 | 23 |
6643bef84c48660f45936daaf6e56d42d071a292 | 2,973 | py | Python | python/source/classical/AveragedPeriodogram.py | e71828/spectral-estimation | 9e4c3f4ed867e97ec764f85d577a7fcaac6a8a7c | [
"MIT"
] | 6 | 2020-02-10T01:07:22.000Z | 2021-06-18T23:44:40.000Z | python/source/classical/AveragedPeriodogram.py | e71828/spectral-estimation | 9e4c3f4ed867e97ec764f85d577a7fcaac6a8a7c | [
"MIT"
] | null | null | null | python/source/classical/AveragedPeriodogram.py | e71828/spectral-estimation | 9e4c3f4ed867e97ec764f85d577a7fcaac6a8a7c | [
"MIT"
] | 2 | 2020-12-08T14:00:01.000Z | 2021-11-28T06:06:49.000Z | import cmath
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import scipy.signal as signal
import csv
from .Periodogram import Periodogram
sns.set() | 29.147059 | 109 | 0.52405 | import cmath
import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
import scipy.signal as signal
import csv
from .Periodogram import Periodogram
sns.set()
class AveragedPeriodogram():
def __init__(self):
self.f = None
self.default_f = np.linspace(0, 0.5, 500)
self.x = N... | 191 | 2,585 | 23 |
2cc5824dc0357e9119f881c43dd51522893f2aff | 2,405 | py | Python | api/posts/migrations/0001_initial.py | ankkamies/mfwgallery-api | c03d20b24fd4ef5d3e9be173b917eea493a5c3d6 | [
"MIT"
] | null | null | null | api/posts/migrations/0001_initial.py | ankkamies/mfwgallery-api | c03d20b24fd4ef5d3e9be173b917eea493a5c3d6 | [
"MIT"
] | null | null | null | api/posts/migrations/0001_initial.py | ankkamies/mfwgallery-api | c03d20b24fd4ef5d3e9be173b917eea493a5c3d6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
| 35.895522 | 114 | 0.562578 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Create... | 0 | 2,242 | 23 |
81a126d504fcb6720c8a0e7657cb6b43edfdcfe9 | 368 | py | Python | lec3.py | Sbenso2002/ia-241-github | 7d030be8c1b05d98c101cfe8b1d713197cefe4d1 | [
"MIT"
] | null | null | null | lec3.py | Sbenso2002/ia-241-github | 7d030be8c1b05d98c101cfe8b1d713197cefe4d1 | [
"MIT"
] | null | null | null | lec3.py | Sbenso2002/ia-241-github | 7d030be8c1b05d98c101cfe8b1d713197cefe4d1 | [
"MIT"
] | null | null | null | print('hello\tworld')
print('hello\nworld')
print( len('hello world' ) )
print('hello world' [2])
my_letter_list = ['a', 'a', 'b','b', 'c']
print(my_letter_list)
print( set(my_letter_list) )
my_unique_letters = set(my_letter_list)
print(my_unique_letters)
print( len(my_unique_letters ) )
print('d' in my_uniq... | 17.52381 | 41 | 0.703804 | print('hello\tworld')
print('hello\nworld')
print( len('hello world' ) )
print('hello world' [2])
my_letter_list = ['a', 'a', 'b','b', 'c']
print(my_letter_list)
print( set(my_letter_list) )
my_unique_letters = set(my_letter_list)
print(my_unique_letters)
print( len(my_unique_letters ) )
print('d' in my_uniq... | 0 | 0 | 0 |
6a250710393d6cc1a5bc9494270d35c03b7609bd | 73,047 | py | Python | pypy/objspace/std/listobject.py | Qointum/pypy | c0ed88efbc135a75a535f4534ca1f3baf0bf39d8 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | pypy/objspace/std/listobject.py | Qointum/pypy | c0ed88efbc135a75a535f4534ca1f3baf0bf39d8 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | pypy/objspace/std/listobject.py | Qointum/pypy | c0ed88efbc135a75a535f4534ca1f3baf0bf39d8 | [
"Apache-2.0",
"OpenSSL"
] | null | null | null | """The builtin list implementation
Lists optimize their storage by holding certain primitive datatypes in
unwrapped form. For more information:
http://morepypy.blogspot.com/2011/10/more-compact-lists-with-list-strategies.html
"""
import operator
import sys
from rpython.rlib import debug, jit, rerased
from rpython.... | 34.570279 | 81 | 0.626213 | """The builtin list implementation
Lists optimize their storage by holding certain primitive datatypes in
unwrapped form. For more information:
http://morepypy.blogspot.com/2011/10/more-compact-lists-with-list-strategies.html
"""
import operator
import sys
from rpython.rlib import debug, jit, rerased
from rpython.... | 44,308 | 19,724 | 1,988 |
4ff600c42d9b7eb1d1f9517a64eec9e6bc522aa7 | 950 | py | Python | pypoptools/pypoptesting/node_rpc.py | Skemba/alt-integration-cpp | d9871d56746aabee2f7678af7004cfbc1e17213b | [
"MIT"
] | null | null | null | pypoptools/pypoptesting/node_rpc.py | Skemba/alt-integration-cpp | d9871d56746aabee2f7678af7004cfbc1e17213b | [
"MIT"
] | null | null | null | pypoptools/pypoptesting/node_rpc.py | Skemba/alt-integration-cpp | d9871d56746aabee2f7678af7004cfbc1e17213b | [
"MIT"
] | null | null | null | from requests import post
from requests.auth import HTTPBasicAuth
| 28.787879 | 71 | 0.517895 | from requests import post
from requests.auth import HTTPBasicAuth
class NodeRpc:
def __init__(self, url, user, password):
self.url = url
self.auth = HTTPBasicAuth(user, password)
self.nonce = 0
def generate(self, *args, **kwargs):
address = self.getnewaddress()
return ... | 787 | -7 | 103 |
9af5d1ce7149896e681c0e989bd4b1e49ea6e52e | 4,130 | py | Python | mithril/controls/textfield.py | martimdev/mithril | 9b8388b1f297ae4b92a436897aa539320fbc3bf7 | [
"MIT"
] | 2 | 2018-12-21T23:08:32.000Z | 2018-12-22T23:39:01.000Z | mithril/controls/textfield.py | martimdev/mithril | 9b8388b1f297ae4b92a436897aa539320fbc3bf7 | [
"MIT"
] | null | null | null | mithril/controls/textfield.py | martimdev/mithril | 9b8388b1f297ae4b92a436897aa539320fbc3bf7 | [
"MIT"
] | 1 | 2018-12-21T22:46:20.000Z | 2018-12-21T22:46:20.000Z | import datetime
import pygame
from mithril.controls.label import Label
from mithril.graphics.base_shapes import VerticalLine
from mithril.graphics.util_shapes import RoundedRectangle
DEFAULT_COLOR = (255, 255, 255)
DEFAULT_BORDER_COLOR = (181, 181, 181)
DEFAULT_HOVER_BORDER_COLOR = (3, 158, 211)
| 40.097087 | 110 | 0.617676 | import datetime
import pygame
from mithril.controls.label import Label
from mithril.graphics.base_shapes import VerticalLine
from mithril.graphics.util_shapes import RoundedRectangle
DEFAULT_COLOR = (255, 255, 255)
DEFAULT_BORDER_COLOR = (181, 181, 181)
DEFAULT_HOVER_BORDER_COLOR = (3, 158, 211)
class TextField(Ro... | 3,551 | 13 | 265 |
bd7b5f324dcc309bfac02e6551c8f770ab994ea9 | 3,231 | py | Python | python/ParseAndSerializeSpotbugs.py | GunpreetAhuja/StaticBugCheckers | 7d0e05afa28682c11a54ea022fd6bfabd64c5dc8 | [
"MIT"
] | 12 | 2018-09-06T08:04:06.000Z | 2021-12-14T02:56:02.000Z | python/ParseAndSerializeSpotbugs.py | GunpreetAhuja/StaticBugCheckers | 7d0e05afa28682c11a54ea022fd6bfabd64c5dc8 | [
"MIT"
] | 1 | 2018-11-06T20:37:33.000Z | 2018-11-14T08:29:35.000Z | python/ParseAndSerializeSpotbugs.py | GunpreetAhuja/StaticBugCheckers | 7d0e05afa28682c11a54ea022fd6bfabd64c5dc8 | [
"MIT"
] | 3 | 2018-11-11T22:15:07.000Z | 2020-03-29T04:08:06.000Z | '''
Created on Nov. 23, 2017
@author Andrew Habib
'''
'''
Currently, the spotbugs output files may contain
analysis results of more than one .java file.
This happens in cases where analyzed bug involves
more than one .java file.
'''
import json
import os
import sys
from xml.etree import cElementTree as ET
from... | 31.676471 | 144 | 0.535747 | '''
Created on Nov. 23, 2017
@author Andrew Habib
'''
'''
Currently, the spotbugs output files may contain
analysis results of more than one .java file.
This happens in cases where analyzed bug involves
more than one .java file.
'''
import json
import os
import sys
from xml.etree import cElementTree as ET
from... | 2,079 | 0 | 23 |
d4918253d25ec090bb8b5b37533c239211caa864 | 1,055 | py | Python | yig/plugins/charahistory.py | Curosiz/CoCNonKP | 644e9441691299f977cc98aa32f6c4b8d2df33d6 | [
"MIT"
] | 1 | 2019-09-25T11:22:39.000Z | 2019-09-25T11:22:39.000Z | yig/plugins/charahistory.py | Curosiz/CoCNonKP | 644e9441691299f977cc98aa32f6c4b8d2df33d6 | [
"MIT"
] | 28 | 2019-12-18T04:34:00.000Z | 2020-08-04T03:05:14.000Z | yig/plugins/charahistory.py | Curosiz/CoCNonKP | 644e9441691299f977cc98aa32f6c4b8d2df33d6 | [
"MIT"
] | 2 | 2020-01-04T16:27:03.000Z | 2020-02-02T09:06:53.000Z | import boto3
import json
import re
import requests
from yig.bot import listener, RE_MATCH_FLAG
import yig.config
@listener(r"history.<(https.*)>", RE_MATCH_FLAG)
def show_history(bot):
""":bookmark_tabs: *history chara session*
`/cc history YOUR_CHARACTER_SHEET_URL`
"""
matcher = re.match(r".*<(https.*)>"... | 27.763158 | 75 | 0.696682 | import boto3
import json
import re
import requests
from yig.bot import listener, RE_MATCH_FLAG
import yig.config
@listener(r"history.<(https.*)>", RE_MATCH_FLAG)
def show_history(bot):
""":bookmark_tabs: *history chara session*
`/cc history YOUR_CHARACTER_SHEET_URL`
"""
matcher = re.match(r".*<(https.*)>"... | 592 | 0 | 23 |
7a6411f585212855ef4c0ee91263023bab1e7ab0 | 307 | py | Python | Python/Arquivos/Victor_Brabo_Hugo.py | lucsap/APC | 344011552dccdf8210d65cee0531460a1a2d6fae | [
"MIT"
] | null | null | null | Python/Arquivos/Victor_Brabo_Hugo.py | lucsap/APC | 344011552dccdf8210d65cee0531460a1a2d6fae | [
"MIT"
] | null | null | null | Python/Arquivos/Victor_Brabo_Hugo.py | lucsap/APC | 344011552dccdf8210d65cee0531460a1a2d6fae | [
"MIT"
] | null | null | null | import os
nome_arq = input()
arq = open(nome_arq, 'r')
for i in arq.readlines():
file_name = i.strip('\n').split(' ')
for j in file_name:
if os.path.exists(j):
print(j)
arq.close()
# print(file_name)
# file = open(file, 'r')
# if
# print(arq.readlines()) | 18.058824 | 40 | 0.540717 | import os
nome_arq = input()
arq = open(nome_arq, 'r')
for i in arq.readlines():
file_name = i.strip('\n').split(' ')
for j in file_name:
if os.path.exists(j):
print(j)
arq.close()
# print(file_name)
# file = open(file, 'r')
# if
# print(arq.readlines()) | 0 | 0 | 0 |
d60053e6c50ddc627ff257933e88b581cd111003 | 1,295 | py | Python | divulga.py | colaboradados/colabora_bot | 513cece3cc3cb87d16a568274212c4428ca83332 | [
"MIT"
] | 75 | 2019-04-28T13:14:18.000Z | 2021-06-04T06:03:48.000Z | divulga.py | colaboradados/Colaboradabot | 513cece3cc3cb87d16a568274212c4428ca83332 | [
"MIT"
] | 26 | 2019-05-06T16:32:59.000Z | 2020-11-28T23:28:46.000Z | divulga.py | colaboradados/Colaboradabot | 513cece3cc3cb87d16a568274212c4428ca83332 | [
"MIT"
] | 34 | 2019-05-15T03:51:46.000Z | 2022-03-17T02:26:18.000Z | import tweepy
from autenticadores import google_api_auth
from random import choice
import gspread
# TODO remover (?)
def google_sshet():
"""
Função simples para retornar um objeto capaz de manipular as planilhas do Google Sheets.
"""
session = google_api_auth()
ggle_cred = gspread.Client(None, sess... | 33.205128 | 114 | 0.694208 | import tweepy
from autenticadores import google_api_auth
from random import choice
import gspread
# TODO remover (?)
def google_sshet():
"""
Função simples para retornar um objeto capaz de manipular as planilhas do Google Sheets.
"""
session = google_api_auth()
ggle_cred = gspread.Client(None, sess... | 0 | 0 | 0 |
77488903c64b01339ed21c0a9394e2e5da5e6e4b | 919 | py | Python | server/models.py | seevee/deltakaggle | 27be22242ce4c0271cf512211d0843f3cfedc79b | [
"MIT"
] | null | null | null | server/models.py | seevee/deltakaggle | 27be22242ce4c0271cf512211d0843f3cfedc79b | [
"MIT"
] | null | null | null | server/models.py | seevee/deltakaggle | 27be22242ce4c0271cf512211d0843f3cfedc79b | [
"MIT"
] | null | null | null | from sql_alchemy_db_instance import db
import pandas as pd
import sqlite3
from sqlalchemy import Column, Integer, Float
import pandas as pd
import numpy as np
from pandas import DataFrame
from flask_sqlalchemy import SQLAlchemy
| 29.645161 | 65 | 0.768226 | from sql_alchemy_db_instance import db
import pandas as pd
import sqlite3
from sqlalchemy import Column, Integer, Float
import pandas as pd
import numpy as np
from pandas import DataFrame
from flask_sqlalchemy import SQLAlchemy
class Variables(db.Model):
__tablename__ = 'APPLICANTS'
id = db.Column(db.Intege... | 0 | 655 | 23 |
d71e028c8847e86bb0af784e5a8b72ba7c9b15ef | 2,376 | py | Python | docs/conf.py | wangenau/eminus | 57b6876093e52a14fc044cac94d1963b94b4ce8a | [
"Apache-2.0"
] | null | null | null | docs/conf.py | wangenau/eminus | 57b6876093e52a14fc044cac94d1963b94b4ce8a | [
"Apache-2.0"
] | null | null | null | docs/conf.py | wangenau/eminus | 57b6876093e52a14fc044cac94d1963b94b4ce8a | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
'''Sphinx documentation builder configuration file.
For a full list of options see the documentation:
https://www.sphinx-doc.org/en/master/usage/configuration.html
'''
import eminus
project = 'eminus'
author = 'Wanja Timm Schulze'
copyright = '2021-2022, Wanja Timm Schulze'
version = eminus.__v... | 32.547945 | 578 | 0.660354 | #!/usr/bin/env python3
'''Sphinx documentation builder configuration file.
For a full list of options see the documentation:
https://www.sphinx-doc.org/en/master/usage/configuration.html
'''
import eminus
project = 'eminus'
author = 'Wanja Timm Schulze'
copyright = '2021-2022, Wanja Timm Schulze'
version = eminus.__v... | 0 | 0 | 0 |
17384b5419699cea78015d11a85a1ad1bce6df12 | 130 | py | Python | salario.py | biatomie/python | 433d6e0d8a3306ff8ff3dbd298dbe6cd23d15fe4 | [
"MIT"
] | null | null | null | salario.py | biatomie/python | 433d6e0d8a3306ff8ff3dbd298dbe6cd23d15fe4 | [
"MIT"
] | null | null | null | salario.py | biatomie/python | 433d6e0d8a3306ff8ff3dbd298dbe6cd23d15fe4 | [
"MIT"
] | null | null | null | n = int(input())
nh = int(input())
vh = float(input())
sal = nh * vh
print(f'NUMBER = {n}')
print(f'SALARY = U$ {sal:.2f}')
| 18.571429 | 32 | 0.530769 | n = int(input())
nh = int(input())
vh = float(input())
sal = nh * vh
print(f'NUMBER = {n}')
print(f'SALARY = U$ {sal:.2f}')
| 0 | 0 | 0 |
348132196a23a7d32cbaa6b8c13a947a825da456 | 261 | py | Python | packages/server/invites/src/adapters/providers/jwt.py | gbartoczevicz/moosic | 003ff5cff628505093cc08ad0fbd273272172a51 | [
"MIT"
] | 3 | 2021-09-30T00:41:31.000Z | 2022-03-15T00:14:23.000Z | packages/server/invites/src/adapters/providers/jwt.py | gbartoczevicz/moosic | 003ff5cff628505093cc08ad0fbd273272172a51 | [
"MIT"
] | 13 | 2021-09-20T22:29:52.000Z | 2021-12-05T01:59:34.000Z | packages/server/invites/src/adapters/providers/jwt.py | gabrielbartoczevicz/moosic | 003ff5cff628505093cc08ad0fbd273272172a51 | [
"MIT"
] | 1 | 2021-11-10T22:11:55.000Z | 2021-11-10T22:11:55.000Z | import jwt
from ...ports.providers import JwtProvider
| 23.727273 | 65 | 0.724138 | import jwt
from ...ports.providers import JwtProvider
class JwtProviderImpl(JwtProvider):
def __init__(self, secret: str) -> None:
self._secret_ = secret
def verify(self, token: str):
return jwt.decode(token, self._secret_, algorithms=["HS256"])
| 120 | 14 | 72 |
8330581118005799c400681a1d7df919de0b94fe | 1,252 | py | Python | tasks/uk8s.py | faasm/experiments | 5f3c3dfc45b23a666ae4a06e1be9159e13e19080 | [
"Apache-2.0"
] | 1 | 2022-03-19T10:27:42.000Z | 2022-03-19T10:27:42.000Z | tasks/uk8s.py | faasm/experiments | 5f3c3dfc45b23a666ae4a06e1be9159e13e19080 | [
"Apache-2.0"
] | 12 | 2021-01-05T07:05:25.000Z | 2022-02-14T14:51:06.000Z | tasks/uk8s.py | faasm/experiment-base | 55fb4dc85f646140ecddc8b26616d219217729fb | [
"Apache-2.0"
] | null | null | null | from invoke import task
from subprocess import run
from tasks.util.env import (
KUBECTL_BIN,
PROJ_ROOT,
)
@task
def uninstall(ctx):
"""
Uninstall uk8s
"""
rm_cmd = "sudo snap remove microk8s"
print(rm_cmd)
run(rm_cmd, shell=True, check=True)
@task
def reset(ctx):
"""
Reset t... | 20.52459 | 59 | 0.649361 | from invoke import task
from subprocess import run
from tasks.util.env import (
KUBECTL_BIN,
PROJ_ROOT,
)
@task
def uninstall(ctx):
"""
Uninstall uk8s
"""
rm_cmd = "sudo snap remove microk8s"
print(rm_cmd)
run(rm_cmd, shell=True, check=True)
@task
def reset(ctx):
"""
Reset t... | 0 | 0 | 0 |
2fb0a7fb516dc7a1ac9d3759ec35d949c33e0833 | 1,297 | py | Python | _main_decision/_mcmc/_helper_functions/Posterior.py | oxquantum/CVAE | 0352ddc51fbfd8d57b155e6de66b4c34e010beac | [
"MIT"
] | null | null | null | _main_decision/_mcmc/_helper_functions/Posterior.py | oxquantum/CVAE | 0352ddc51fbfd8d57b155e6de66b4c34e010beac | [
"MIT"
] | null | null | null | _main_decision/_mcmc/_helper_functions/Posterior.py | oxquantum/CVAE | 0352ddc51fbfd8d57b155e6de66b4c34e010beac | [
"MIT"
] | null | null | null | import numpy as np
from _main_decision._helper_functions.log_sum_exp import log_sum_exp
| 30.880952 | 104 | 0.630686 | import numpy as np
from _main_decision._helper_functions.log_sum_exp import log_sum_exp
class Posterior():
def __init__(self, net, sess, y0, obs_data_mask, likelihood):
self.net = net
self.sess = sess
self.y0 = y0
self.observed = obs_data_mask[np.newaxis, ..., :1]
self.mas... | 1,105 | -3 | 103 |
165289d1624e0a1fe55b8d1e2aca93f5666eaeff | 978 | py | Python | eclcli/storage/storageclient/v2/volume_types.py | hanasuke/eclcli | a72191799986a02596d0d467253fd9f5ee03c5c8 | [
"Apache-2.0"
] | 32 | 2016-08-31T04:12:40.000Z | 2020-12-11T04:49:57.000Z | eclcli/storage/storageclient/v2/volume_types.py | hanasuke/eclcli | a72191799986a02596d0d467253fd9f5ee03c5c8 | [
"Apache-2.0"
] | 27 | 2016-09-06T07:50:36.000Z | 2021-09-14T09:46:03.000Z | eclcli/storage/storageclient/v2/volume_types.py | hanasuke/eclcli | a72191799986a02596d0d467253fd9f5ee03c5c8 | [
"Apache-2.0"
] | 24 | 2016-09-02T01:09:09.000Z | 2021-01-19T09:14:16.000Z | from .. import base
class VolumeType(base.Resource):
"""A Volume Type is the type of volume to be created."""
class VolumeTypeManager(base.ManagerWithFind):
"""Manage :class:`VolumeType` resources."""
resource_class = VolumeType
def list(self, search_opts=None, is_public=True):
"""Lists all... | 28.764706 | 85 | 0.618609 | from .. import base
class VolumeType(base.Resource):
"""A Volume Type is the type of volume to be created."""
def __repr__(self):
return "<VolumeType: %s>" % self.name
class VolumeTypeManager(base.ManagerWithFind):
"""Manage :class:`VolumeType` resources."""
resource_class = VolumeType
... | 44 | 0 | 26 |
0b74c7a2fa53705be660c273e74d96c72b0c5c7b | 3,291 | py | Python | Designing_RESTful_APIs/Exercices/L3/Quiz4/endpoints2_tester.py | NaPiZip/Online-course-notes | 36f01fd9cbdaa0ec5030d4f34203d8980ed66c22 | [
"MIT"
] | null | null | null | Designing_RESTful_APIs/Exercices/L3/Quiz4/endpoints2_tester.py | NaPiZip/Online-course-notes | 36f01fd9cbdaa0ec5030d4f34203d8980ed66c22 | [
"MIT"
] | null | null | null | Designing_RESTful_APIs/Exercices/L3/Quiz4/endpoints2_tester.py | NaPiZip/Online-course-notes | 36f01fd9cbdaa0ec5030d4f34203d8980ed66c22 | [
"MIT"
] | null | null | null | import httplib2
import json
import sys
if __name__== '__main__':
print("Running Endpoint Tester....\n")
address = input("Please enter the address of the server ou want to access!")
if address == '':
address = 'http://localhost:5000'
print("Making the GET Request for /puppies...")... | 35.010638 | 98 | 0.553327 | import httplib2
import json
import sys
if __name__== '__main__':
print("Running Endpoint Tester....\n")
address = input("Please enter the address of the server ou want to access!")
if address == '':
address = 'http://localhost:5000'
print("Making the GET Request for /puppies...")... | 0 | 0 | 0 |
aaa09a5d9324326e5c53a603b03d1b40f28c33f6 | 2,528 | py | Python | rplugin/python3/todoist_import.py | wbthomason/todoist-import.nvim | 558942fbba6fb2840a52586350dff167cca58a44 | [
"MIT"
] | 3 | 2020-06-20T00:13:45.000Z | 2021-05-30T01:23:24.000Z | rplugin/python3/todoist_import.py | wbthomason/import-todoist.nvim | 558942fbba6fb2840a52586350dff167cca58a44 | [
"MIT"
] | null | null | null | rplugin/python3/todoist_import.py | wbthomason/import-todoist.nvim | 558942fbba6fb2840a52586350dff167cca58a44 | [
"MIT"
] | null | null | null | import pynvim
import todoist
from dateutil.parser import parse
from datetime import datetime, time, timezone
from dateutil.tz import tzlocal
@pynvim.plugin
| 32.831169 | 76 | 0.686709 | import pynvim
import todoist
from dateutil.parser import parse
from datetime import datetime, time, timezone
from dateutil.tz import tzlocal
@pynvim.plugin
class TodoistImport:
def __init__(self, nvim):
self.nvim = nvim
token = self.nvim.api.get_var('todoist_token')
self.api = todoist.TodoistAPI(token)... | 2,162 | 186 | 22 |
2909030c7b2994a557cd975ef36150d55885690c | 10,235 | py | Python | trustai/interpretation/example_level/method/representer_point.py | PaddlePaddle/trustAI | 4ca7cf81b044156b011f5b8972ca7a5f5680917b | [
"Apache-2.0"
] | 2 | 2022-03-14T02:21:05.000Z | 2022-03-14T02:42:59.000Z | trustai/interpretation/example_level/method/representer_point.py | PaddlePaddle/trustAI | 4ca7cf81b044156b011f5b8972ca7a5f5680917b | [
"Apache-2.0"
] | null | null | null | trustai/interpretation/example_level/method/representer_point.py | PaddlePaddle/trustAI | 4ca7cf81b044156b011f5b8972ca7a5f5680917b | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 41.104418 | 207 | 0.63957 | # Copyright (c) 2022 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 521 | 0 | 26 |
02408ba08ec83af7c146dd081e9c790fd47cad07 | 432 | py | Python | python/numpy/min_and_max.py | kcc3/hackerrank-solutions | f862b44b840bd447d99dc148f6bb5e2f5bfb8a86 | [
"MIT"
] | null | null | null | python/numpy/min_and_max.py | kcc3/hackerrank-solutions | f862b44b840bd447d99dc148f6bb5e2f5bfb8a86 | [
"MIT"
] | null | null | null | python/numpy/min_and_max.py | kcc3/hackerrank-solutions | f862b44b840bd447d99dc148f6bb5e2f5bfb8a86 | [
"MIT"
] | 1 | 2020-06-04T09:23:19.000Z | 2020-06-04T09:23:19.000Z | """Hackerrank Problem: https://www.hackerrank.com/challenges/np-min-and-max/problem
Task
You are given a 2-D array with dimensions N x M.
Your task is to perform the min function over axis 1 and then find the max of that.
"""
import numpy
n, m = map(int, input().split(' '))
array = []
for _ in range(n):
a = lis... | 22.736842 | 83 | 0.680556 | """Hackerrank Problem: https://www.hackerrank.com/challenges/np-min-and-max/problem
Task
You are given a 2-D array with dimensions N x M.
Your task is to perform the min function over axis 1 and then find the max of that.
"""
import numpy
n, m = map(int, input().split(' '))
array = []
for _ in range(n):
a = lis... | 0 | 0 | 0 |
a2301441254cde8f549a8e5d06123c37d9a85436 | 454 | py | Python | core/migrations/0011_auto_20181002_2016.py | CobwebOrg/cobweb-django | 14241326860620dbaa64f7eefc6d4b393f80d23c | [
"MIT"
] | 7 | 2017-09-14T18:52:58.000Z | 2020-05-18T21:01:20.000Z | core/migrations/0011_auto_20181002_2016.py | CobwebOrg/cobweb-django | 14241326860620dbaa64f7eefc6d4b393f80d23c | [
"MIT"
] | 151 | 2017-09-14T18:46:02.000Z | 2022-02-10T09:18:44.000Z | core/migrations/0011_auto_20181002_2016.py | CobwebOrg/cobweb-django | 14241326860620dbaa64f7eefc6d4b393f80d23c | [
"MIT"
] | 1 | 2017-10-29T19:37:29.000Z | 2017-10-29T19:37:29.000Z | # Generated by Django 2.1.1 on 2018-10-03 03:16
from django.db import migrations, models
| 23.894737 | 117 | 0.625551 | # Generated by Django 2.1.1 on 2018-10-03 03:16
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0010_auto_20180928_1104'),
]
operations = [
migrations.AlterField(
model_name='organization',
name='slug',
... | 0 | 340 | 23 |
7495b075f9462cdfe87635b8d749b252948bb697 | 151 | py | Python | django_app/tables_app/apps.py | iarmourgarb/project-SIM | f63aaf846e0fb0c948314265601b2d35c760b26e | [
"MIT"
] | null | null | null | django_app/tables_app/apps.py | iarmourgarb/project-SIM | f63aaf846e0fb0c948314265601b2d35c760b26e | [
"MIT"
] | null | null | null | django_app/tables_app/apps.py | iarmourgarb/project-SIM | f63aaf846e0fb0c948314265601b2d35c760b26e | [
"MIT"
] | 1 | 2022-02-23T21:58:25.000Z | 2022-02-23T21:58:25.000Z | from django.apps import AppConfig
| 21.571429 | 56 | 0.768212 | from django.apps import AppConfig
class TablesAppConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'tables_app'
| 0 | 93 | 23 |
b583af1303995b97989eef8cda5b0b7f48f90fd2 | 1,800 | py | Python | aixplot/plotter.py | lukas-koschmieder/aixplot | 7d1faf4e3578898f603661d9a67646acee0338dc | [
"MIT"
] | 1 | 2019-08-16T10:58:01.000Z | 2019-08-16T10:58:01.000Z | aixplot/plotter.py | lukas-koschmieder/aixplot | 7d1faf4e3578898f603661d9a67646acee0338dc | [
"MIT"
] | null | null | null | aixplot/plotter.py | lukas-koschmieder/aixplot | 7d1faf4e3578898f603661d9a67646acee0338dc | [
"MIT"
] | null | null | null | # Copyright (c) 2019 Lukas Koschmieder
import asyncio
from bqplot import Axis, Figure, LinearScale, Lines, Toolbar
from ipywidgets import Label, HBox, VBox
import logging
module_logger = logging.getLogger(__name__)
module_logger.setLevel(logging.INFO)
module_logger.addHandler(logging.StreamHandler())
| 33.962264 | 73 | 0.557778 | # Copyright (c) 2019 Lukas Koschmieder
import asyncio
from bqplot import Axis, Figure, LinearScale, Lines, Toolbar
from ipywidgets import Label, HBox, VBox
import logging
module_logger = logging.getLogger(__name__)
module_logger.setLevel(logging.INFO)
module_logger.addHandler(logging.StreamHandler())
class Plot(VBox... | 1,321 | -3 | 178 |
98f88c0ad40b660b7f7ef48c3c686ac01ea7645c | 1,093 | py | Python | nodes/H.3.1c/challenge_code.py | ankit27kh/Xanadu-Quantum-Codebook | 9ba7bbf86c04d53e80c9a2cf5a412f534a3d5756 | [
"Apache-2.0"
] | 31 | 2021-11-16T15:03:18.000Z | 2022-03-04T14:18:25.000Z | nodes/H.3.1c/challenge_code.py | ankit27kh/Xanadu-Quantum-Codebook | 9ba7bbf86c04d53e80c9a2cf5a412f534a3d5756 | [
"Apache-2.0"
] | 26 | 2021-11-16T02:20:17.000Z | 2022-03-07T15:44:28.000Z | nodes/H.3.1c/challenge_code.py | ankit27kh/Xanadu-Quantum-Codebook | 9ba7bbf86c04d53e80c9a2cf5a412f534a3d5756 | [
"Apache-2.0"
] | 17 | 2021-11-17T02:13:58.000Z | 2022-02-20T21:42:48.000Z | """The code template to supply to the front end. This is what the user will
be asked to complete and submit for grading.
Do not include any imports.
This is not a REPL environment so include explicit 'print' statements
for any outputs you want to be displayed back to the user.
Use triple single q... | 28.763158 | 82 | 0.630375 | """The code template to supply to the front end. This is what the user will
be asked to complete and submit for grading.
Do not include any imports.
This is not a REPL environment so include explicit 'print' statements
for any outputs you want to be displayed back to the user.
Use triple single q... | 0 | 0 | 0 |
83f9b6225f9a9bdaff17fe1a7a9a3b0dc3292653 | 172 | py | Python | python/GtBurst/aplpy/__init__.py | fermi-lat/pyBurstAnalysisGUI | add53fe77ef71cb64a27751f024fb914f7cc0863 | [
"BSD-3-Clause"
] | 2 | 2019-03-06T15:48:20.000Z | 2020-05-02T15:02:57.000Z | python/GtBurst/aplpy/__init__.py | fermi-lat/pyBurstAnalysisGUI | add53fe77ef71cb64a27751f024fb914f7cc0863 | [
"BSD-3-Clause"
] | 5 | 2019-01-23T11:35:41.000Z | 2019-03-29T17:36:19.000Z | python/GtBurst/aplpy/__init__.py | fermi-lat/pyBurstAnalysisGUI | add53fe77ef71cb64a27751f024fb914f7cc0863 | [
"BSD-3-Clause"
] | null | null | null | try:
# Use internal aplpy
from .my_aplpy import *
except ImportError:
# Try and load the aplpy from the environment
from aplpy import *
| 15.636364 | 49 | 0.610465 | try:
# Use internal aplpy
from .my_aplpy import *
except ImportError:
# Try and load the aplpy from the environment
from aplpy import *
| 0 | 0 | 0 |
13346126f72929640103965ec24f2f3547882ab9 | 981 | py | Python | solutions/200.py | pacokwon/leetcode | 37c943d371c106d1e6f24e065700e5edd1c3f9f9 | [
"MIT"
] | 2 | 2022-01-18T08:57:13.000Z | 2022-01-18T15:49:06.000Z | solutions/200.py | pacokwon/leetcode | 37c943d371c106d1e6f24e065700e5edd1c3f9f9 | [
"MIT"
] | null | null | null | solutions/200.py | pacokwon/leetcode | 37c943d371c106d1e6f24e065700e5edd1c3f9f9 | [
"MIT"
] | null | null | null | # Number Of Islands
if __name__ == "__main__":
sol = Solution()
grid = [
["1","1","0","0","0"],
["1","1","0","0","0"],
["0","0","1","0","0"],
["0","0","0","1","1"]
]
print(sol.numIslands(grid))
| 21.8 | 63 | 0.343527 | # Number Of Islands
class Solution:
def numIslands(self, grid):
dx = [0, 1, 0, -1]
dy = [1, 0, -1, 0]
rows = len(grid)
cols = len(grid[0])
def dfs(x, y):
grid[x][y] = '0'
for _dx, _dy in zip(dx, dy):
newX = x + _dx
n... | 670 | -6 | 49 |
5e241b19b7a44b4055e346b949a90739d547c87e | 7,158 | py | Python | FIVE/Code/module_evt.py | sk-yaho/carpe | 077ef7ba1582b3de9f5c08d63431e744b77a9e09 | [
"Apache-2.0"
] | 2 | 2020-07-09T02:01:50.000Z | 2020-11-21T15:19:32.000Z | FIVE/Code/module_evt.py | sk-yaho/carpe | 077ef7ba1582b3de9f5c08d63431e744b77a9e09 | [
"Apache-2.0"
] | null | null | null | FIVE/Code/module_evt.py | sk-yaho/carpe | 077ef7ba1582b3de9f5c08d63431e744b77a9e09 | [
"Apache-2.0"
] | null | null | null | #-*- coding: utf-8 -*-
#!/usr/bin/python3
#!/Author : Gibartes
from moduleInterface.defines import *
from moduleInterface.interface import ModuleComponentInterface
#from defines import *
#from interface import ModuleComponentInterface
from structureReader import structureReader as sr
#from structure... | 37.47644 | 117 | 0.601146 | #-*- coding: utf-8 -*-
#!/usr/bin/python3
#!/Author : Gibartes
from moduleInterface.defines import *
from moduleInterface.interface import ModuleComponentInterface
#from defines import *
#from interface import ModuleComponentInterface
from structureReader import structureReader as sr
#from structure... | 5,459 | 510 | 22 |
50a618537910e6824f529152413123581d9a2a80 | 554 | py | Python | sentinelScripts/rm_unCompleted_task.py | XingyuXu-cuhk/Landuse_DL | a993988727387be22e7a88f6f5790de8a88dccd6 | [
"Apache-2.0"
] | null | null | null | sentinelScripts/rm_unCompleted_task.py | XingyuXu-cuhk/Landuse_DL | a993988727387be22e7a88f6f5790de8a88dccd6 | [
"Apache-2.0"
] | null | null | null | sentinelScripts/rm_unCompleted_task.py | XingyuXu-cuhk/Landuse_DL | a993988727387be22e7a88f6f5790de8a88dccd6 | [
"Apache-2.0"
] | 1 | 2020-06-22T08:52:58.000Z | 2020-06-22T08:52:58.000Z | #!/usr/bin/env python
# Filename: rm_unCompleted_task
"""
introduction:
authors: Huang Lingcao
email:huanglingcao@gmail.com
add time: 16 October, 2019
"""
import os
dir = 'multi_inf_results'
for i in range(0,78):
if os.path.isfile(os.path.join(dir,str(i)+'.txt')):
if os.path.isfile(os.path.join(dir,str(i... | 25.181818 | 68 | 0.611913 | #!/usr/bin/env python
# Filename: rm_unCompleted_task
"""
introduction:
authors: Huang Lingcao
email:huanglingcao@gmail.com
add time: 16 October, 2019
"""
import os
dir = 'multi_inf_results'
for i in range(0,78):
if os.path.isfile(os.path.join(dir,str(i)+'.txt')):
if os.path.isfile(os.path.join(dir,str(i... | 0 | 0 | 0 |
974183d1b5d034ae7aafa99f6173efe7f1d13ec9 | 3,741 | py | Python | seedorf/users/adapters.py | SportySpots/seedorf | 3f09c720ea8df0d1171022b68b494c2758f75d44 | [
"MIT"
] | 3 | 2018-04-22T10:11:01.000Z | 2018-11-16T22:00:34.000Z | seedorf/users/adapters.py | SportySpots/seedorf | 3f09c720ea8df0d1171022b68b494c2758f75d44 | [
"MIT"
] | 87 | 2018-03-14T13:42:55.000Z | 2022-03-21T21:15:16.000Z | seedorf/users/adapters.py | SportySpots/seedorf | 3f09c720ea8df0d1171022b68b494c2758f75d44 | [
"MIT"
] | null | null | null | from allauth.account.adapter import DefaultAccountAdapter
from allauth.exceptions import ImmediateHttpResponse
from allauth.socialaccount import signals
from allauth.socialaccount.adapter import DefaultSocialAccountAdapter
from allauth.socialaccount.models import SocialLogin
from django.conf import settings
from django... | 40.225806 | 119 | 0.690457 | from allauth.account.adapter import DefaultAccountAdapter
from allauth.exceptions import ImmediateHttpResponse
from allauth.socialaccount import signals
from allauth.socialaccount.adapter import DefaultSocialAccountAdapter
from allauth.socialaccount.models import SocialLogin
from django.conf import settings
from django... | 1,887 | 1,105 | 126 |
afe433f5ee3f32462791a595512468da25469cbc | 2,524 | py | Python | pastebin_crawler/services/paste_bin_post_service.py | mikeler216/pastebin_crawler | 9a5712fc139cf4f02b8f81398b458f75fe0f8e86 | [
"Apache-2.0"
] | null | null | null | pastebin_crawler/services/paste_bin_post_service.py | mikeler216/pastebin_crawler | 9a5712fc139cf4f02b8f81398b458f75fe0f8e86 | [
"Apache-2.0"
] | 3 | 2021-01-30T17:57:37.000Z | 2021-01-31T17:59:08.000Z | pastebin_crawler/services/paste_bin_post_service.py | mikeler216/pastebin_crawler | 9a5712fc139cf4f02b8f81398b458f75fe0f8e86 | [
"Apache-2.0"
] | null | null | null | """
"""
from datetime import datetime
from typing import Optional
from bs4 import BeautifulSoup
import dateutil.parser
from pastebin_crawler.helpers import remove_beginning_slash_from_str
from pastebin_crawler.helpers.constants import Urls, PostDivName
from pastebin_crawler.services import BaseCrawlerService
| 29.348837 | 68 | 0.581616 | """
"""
from datetime import datetime
from typing import Optional
from bs4 import BeautifulSoup
import dateutil.parser
from pastebin_crawler.helpers import remove_beginning_slash_from_str
from pastebin_crawler.helpers.constants import Urls, PostDivName
from pastebin_crawler.services import BaseCrawlerService
class... | 1,773 | 414 | 23 |
98bf3fdf49a4b16c92b743818f5f6011e8553005 | 1,963 | py | Python | Library/Python/Capture/libs/libSimCom.py | BleuLlama/LlamaLlaser | 0784635fc6209755462c44972990d8f8deec2cec | [
"MIT"
] | null | null | null | Library/Python/Capture/libs/libSimCom.py | BleuLlama/LlamaLlaser | 0784635fc6209755462c44972990d8f8deec2cec | [
"MIT"
] | null | null | null | Library/Python/Capture/libs/libSimCom.py | BleuLlama/LlamaLlaser | 0784635fc6209755462c44972990d8f8deec2cec | [
"MIT"
] | null | null | null | #!/usr/bin/python
import sys
import glob
################################################################################
# Fake Comport + Arduino simulation
| 18.345794 | 80 | 0.558329 | #!/usr/bin/python
import sys
import glob
################################################################################
# Fake Comport + Arduino simulation
class SimCom:
SimDevice = "/fake/SIMUDUINO"
device = SimDevice
description = "Arduino Serial Simulation"
isConnected = False
accumulator = ""
def __ini... | 1,139 | 641 | 22 |
3343a177dd550e97960c5184101c45e46564aa9b | 875 | bzl | Python | deps.bzl | gramic/bazel_esp32 | fd4c6aa44d626489b6663216c3f978d28b603de6 | [
"MIT"
] | 6 | 2021-06-16T13:07:22.000Z | 2022-03-23T17:53:24.000Z | deps.bzl | gramic/bazel_esp32 | fd4c6aa44d626489b6663216c3f978d28b603de6 | [
"MIT"
] | 2 | 2021-08-22T05:11:55.000Z | 2021-10-12T06:47:46.000Z | deps.bzl | gramic/bazel_esp32 | fd4c6aa44d626489b6663216c3f978d28b603de6 | [
"MIT"
] | 1 | 2021-12-20T13:40:19.000Z | 2021-12-20T13:40:19.000Z | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
| 41.666667 | 104 | 0.682286 | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def bazel_esp32_dependencies():
# The cross compiler, tools and headers.
http_archive(
name = "xtensa_esp32_elf_linux64",
build_file = "@bazel_esp32//:BUILD.esp32toolchain",
sha256 = "96f5f6e7611a0ed1dc47048c54c3113fc5... | 783 | 0 | 23 |
b376e178412710571f54e60309c38ae1445eacb9 | 1,282 | py | Python | curso-em-video/ex089.1.py | joseluizbrits/sobre-python | 316143c341e5a44070a3b13877419082774bd730 | [
"MIT"
] | null | null | null | curso-em-video/ex089.1.py | joseluizbrits/sobre-python | 316143c341e5a44070a3b13877419082774bd730 | [
"MIT"
] | null | null | null | curso-em-video/ex089.1.py | joseluizbrits/sobre-python | 316143c341e5a44070a3b13877419082774bd730 | [
"MIT"
] | null | null | null | # Boletim com listas compostas
'''Crie um programa que leia NOME e DUAS
NOTAS de vários alunos e guarde tudo em
uma LISTA COMPOSTA. No final, mostre um
BOLETIM contendo a MÉDIA de cada um e
permita que o usuário possa mostrar as
NOTAS de cada aluno individualmente'''
lista = []
while True:
alunos = []
notas = ... | 32.05 | 91 | 0.587363 | # Boletim com listas compostas
'''Crie um programa que leia NOME e DUAS
NOTAS de vários alunos e guarde tudo em
uma LISTA COMPOSTA. No final, mostre um
BOLETIM contendo a MÉDIA de cada um e
permita que o usuário possa mostrar as
NOTAS de cada aluno individualmente'''
lista = []
while True:
alunos = []
notas = ... | 0 | 0 | 0 |
7d562a5fad27debabe476c59268f7e28857a599b | 3,923 | py | Python | salt/utils/json.py | amaclean199/salt | 8aaac011b4616e3c9e74a1daafb4a2146a5a430f | [
"Apache-2.0"
] | null | null | null | salt/utils/json.py | amaclean199/salt | 8aaac011b4616e3c9e74a1daafb4a2146a5a430f | [
"Apache-2.0"
] | null | null | null | salt/utils/json.py | amaclean199/salt | 8aaac011b4616e3c9e74a1daafb4a2146a5a430f | [
"Apache-2.0"
] | 1 | 2019-06-10T17:42:31.000Z | 2019-06-10T17:42:31.000Z | # -*- coding: utf-8 -*-
'''
Functions to work with JSON
'''
from __future__ import absolute_import, unicode_literals
# Import Python libs
import json # future lint: blacklisted-module
import logging
# Import Salt libs
import salt.utils.data
import salt.utils.stringutils
# Import 3rd-party libs
from salt.ext import... | 29.719697 | 115 | 0.663523 | # -*- coding: utf-8 -*-
'''
Functions to work with JSON
'''
from __future__ import absolute_import, unicode_literals
# Import Python libs
import json # future lint: blacklisted-module
import logging
# Import Salt libs
import salt.utils.data
import salt.utils.stringutils
# Import 3rd-party libs
from salt.ext import... | 0 | 0 | 0 |
e1888a1e90e3d5dc86489919123ff8078d127bcc | 784 | py | Python | src/models/users/decorators.py | ibininja/takaramOS | 801ed4479cd64a97b92bf118927c7d72f3f89f11 | [
"MIT"
] | 1 | 2016-02-20T16:31:23.000Z | 2016-02-20T16:31:23.000Z | src/models/users/decorators.py | ibininja/takaramOS | 801ed4479cd64a97b92bf118927c7d72f3f89f11 | [
"MIT"
] | 1 | 2016-02-24T16:54:47.000Z | 2016-02-25T06:25:07.000Z | src/models/users/decorators.py | ibininja/takaramOS | 801ed4479cd64a97b92bf118927c7d72f3f89f11 | [
"MIT"
] | null | null | null | from functools import wraps
from flask import session, url_for, redirect, request
__author__ = 'ibininja'
| 35.636364 | 108 | 0.683673 | from functools import wraps
from flask import session, url_for, redirect, request
__author__ = 'ibininja'
def requires_login(func):
@wraps(func)
def decorated_function(*args, **kwargs):
if 'email' not in session.keys() or session['email'] is None:
return redirect(url_for('login', next=req... | 630 | 0 | 46 |
53806c09db3baefa06b4b6b784956d5071dda36a | 6,991 | py | Python | project_files/robot_drivers/posedata_leg.py | aronjschwartz/Angel_Devil | 921436aba7db260564c7926385417b2e7a17ea6d | [
"MIT"
] | null | null | null | project_files/robot_drivers/posedata_leg.py | aronjschwartz/Angel_Devil | 921436aba7db260564c7926385417b2e7a17ea6d | [
"MIT"
] | null | null | null | project_files/robot_drivers/posedata_leg.py | aronjschwartz/Angel_Devil | 921436aba7db260564c7926385417b2e7a17ea6d | [
"MIT"
] | null | null | null | import copy
from hex_walker_constants import TIP_SERVO, MID_SERVO, ROT_SERVO, WAIST_SERVO
# NOTE: these values are ANGLES not raw pwms
# thing.rot_servo and thing.list[ROT_SERVO] are synonymous/aliases that point to the same underlying data, for both read/write
# TODO: remove normal/crouch version and make them deri... | 30.797357 | 126 | 0.680303 | import copy
from hex_walker_constants import TIP_SERVO, MID_SERVO, ROT_SERVO, WAIST_SERVO
# NOTE: these values are ANGLES not raw pwms
# thing.rot_servo and thing.list[ROT_SERVO] are synonymous/aliases that point to the same underlying data, for both read/write
class Leg_Position(object):
def __init__(self, rot_servo... | 598 | 429 | 22 |
69b15336a36ab1cd11ff4f86180f53d9e1a8eda4 | 556 | py | Python | examples/simple/script.py | gijswobben/pyfiguration | e33f3a8f20bbf7ca05a9d928f68895c8c727120c | [
"MIT"
] | 1 | 2020-06-28T20:58:39.000Z | 2020-06-28T20:58:39.000Z | examples/simple/script.py | gijswobben/pyfiguration | e33f3a8f20bbf7ca05a9d928f68895c8c727120c | [
"MIT"
] | null | null | null | examples/simple/script.py | gijswobben/pyfiguration | e33f3a8f20bbf7ca05a9d928f68895c8c727120c | [
"MIT"
] | null | null | null | """ script.py
"""
import http.server
import socketserver
from pyfiguration import conf
# Create a request handler
Handler = http.server.SimpleHTTPRequestHandler
@conf.addIntField(
field="server.port",
description="The port on which the server will start",
default=8000,
minValue=80,
maxValue=999... | 19.172414 | 62 | 0.68705 | """ script.py
"""
import http.server
import socketserver
from pyfiguration import conf
# Create a request handler
Handler = http.server.SimpleHTTPRequestHandler
@conf.addIntField(
field="server.port",
description="The port on which the server will start",
default=8000,
minValue=80,
maxValue=999... | 162 | 0 | 22 |
0fbf4a1e6db8cff693a3ecacf178ca4e3446f1fb | 887 | py | Python | chap03/author-manager/src/api/models/books.py | matadorchw/rest_flask | b5b643d72e63e654f2d893621158e2e5db870b15 | [
"MIT"
] | 2 | 2020-10-21T14:04:42.000Z | 2020-10-21T14:05:01.000Z | chap03/author-manager/src/api/models/books.py | matadorchw/rest_flask | b5b643d72e63e654f2d893621158e2e5db870b15 | [
"MIT"
] | null | null | null | chap03/author-manager/src/api/models/books.py | matadorchw/rest_flask | b5b643d72e63e654f2d893621158e2e5db870b15 | [
"MIT"
] | null | null | null | from ..utils.database import db
from marshmallow_sqlalchemy import ModelSchema
from marshmallow import fields
| 26.878788 | 68 | 0.674183 | from ..utils.database import db
from marshmallow_sqlalchemy import ModelSchema
from marshmallow import fields
class Book(db.Model):
__tablename__ = 'books'
id = db.Column(db.Integer, primary_key=True, autoincrement=True)
title = db.Column(db.String(50))
year = db.Column(db.Integer)
author_id = db.... | 187 | 542 | 46 |
da3b0352550e6f00d7379c2785c7a2eb68ee89dd | 987 | py | Python | freight/tests/test_templatetags.py | buahaha/aa-freight | 69eb85188988d7cfaffc7c485d22ddb442a4a2b3 | [
"MIT"
] | null | null | null | freight/tests/test_templatetags.py | buahaha/aa-freight | 69eb85188988d7cfaffc7c485d22ddb442a4a2b3 | [
"MIT"
] | null | null | null | freight/tests/test_templatetags.py | buahaha/aa-freight | 69eb85188988d7cfaffc7c485d22ddb442a4a2b3 | [
"MIT"
] | null | null | null | from django.test import TestCase
from ..templatetags.freight_filters import formatnumber, power10
| 37.961538 | 64 | 0.655522 | from django.test import TestCase
from ..templatetags.freight_filters import formatnumber, power10
class TestFilters(TestCase):
def test_power10(self):
self.assertEqual(power10(1), 1)
self.assertEqual(power10(1000, 3), 1)
self.assertEqual(power10(-1000, 3), -1)
self.assertEqual(pow... | 804 | 7 | 76 |
3d1e731caa34aa90f4e6cb2d35057d7b60cc453f | 3,032 | py | Python | app/request.py | mercy-shii/News-atricles | b7d589a2c418ae588f446009c95d13ebb3fc74fc | [
"Unlicense"
] | null | null | null | app/request.py | mercy-shii/News-atricles | b7d589a2c418ae588f446009c95d13ebb3fc74fc | [
"Unlicense"
] | 5 | 2020-04-28T15:22:42.000Z | 2020-04-28T15:22:47.000Z | app/request.py | mercy-shii/News-atricles | b7d589a2c418ae588f446009c95d13ebb3fc74fc | [
"Unlicense"
] | null | null | null | import urllib.request
import json
from .models import Source,Article
#getting api key
api_key = None
#getting news base url
base_url = None
articles_url = None
def get_source(category):
'''
Function that gets json response to our url request
'''
get_source_url = base_url.format(category,api_key)
... | 28.603774 | 92 | 0.684697 | import urllib.request
import json
from .models import Source,Article
#getting api key
api_key = None
#getting news base url
base_url = None
articles_url = None
def configure_request(app):
global api_key,base_url,articles_url
api_key=app.config['NEWS_API_KEY']
base_url=app.config['SOURCE_API_BASE_URL... | 838 | 0 | 46 |
205e2899ecf3255623bb4f84573a657b29b50370 | 957 | py | Python | 32xcoverage.py | Jan-Wignall/Homework | 48ec6bc58bd1facf7199ed8b66bcf8fbe67315eb | [
"MIT"
] | null | null | null | 32xcoverage.py | Jan-Wignall/Homework | 48ec6bc58bd1facf7199ed8b66bcf8fbe67315eb | [
"MIT"
] | null | null | null | 32xcoverage.py | Jan-Wignall/Homework | 48ec6bc58bd1facf7199ed8b66bcf8fbe67315eb | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Write a program that simulates random read coverage over a chromosome
# Report min, max, and average coverage
# Make variables for genome size, read number, read length
# Input values from the command line
# Note that you will not sample the ends of a chromosome very well
# So don't count the ... | 22.785714 | 71 | 0.698015 | #!/usr/bin/env python3
# Write a program that simulates random read coverage over a chromosome
# Report min, max, and average coverage
# Make variables for genome size, read number, read length
# Input values from the command line
# Note that you will not sample the ends of a chromosome very well
# So don't count the ... | 0 | 0 | 0 |
c1b97c053a296bf8b81269c452ce67ef00e0944c | 542 | py | Python | src/notification/SmsNotification.py | FlorianBergeron/security-camera_computer-vision | eff4ae2bbbd385bb4900feaf1896a592080f6d06 | [
"MIT"
] | null | null | null | src/notification/SmsNotification.py | FlorianBergeron/security-camera_computer-vision | eff4ae2bbbd385bb4900feaf1896a592080f6d06 | [
"MIT"
] | null | null | null | src/notification/SmsNotification.py | FlorianBergeron/security-camera_computer-vision | eff4ae2bbbd385bb4900feaf1896a592080f6d06 | [
"MIT"
] | null | null | null |
from twilio.rest import Client
from src.variables.config import *
| 31.882353 | 63 | 0.656827 |
from twilio.rest import Client
from src.variables.config import *
class SmsNotification:
def __init__(self, account_sid, auth_token, auth_phone):
if account_sid is not None and auth_token is not None :
self.client = Client(account_sid, auth_token)
self.auth_phone = auth_phone
def ... | 398 | 1 | 76 |
f09c31dafea5b18da11a2131cf977bcb2e1fc027 | 1,686 | py | Python | 450/Nagendra/greedy/Job Sequencing Problem .py | Nagendracse1/Competitive-Programming | 325e151b9259dbc31d331c8932def42e3ab09913 | [
"MIT"
] | 3 | 2020-12-20T10:23:11.000Z | 2021-06-16T10:34:18.000Z | 450/Nagendra/greedy/Job Sequencing Problem .py | Spring-dot/Competitive-Programming | 98add277a8b029710c749d1082de25c524e12408 | [
"MIT"
] | null | null | null | 450/Nagendra/greedy/Job Sequencing Problem .py | Spring-dot/Competitive-Programming | 98add277a8b029710c749d1082de25c524e12408 | [
"MIT"
] | null | null | null | #link https://practice.geeksforgeeks.org/problems/job-sequencing-problem-1587115620/1#
def JobScheduling(Jobs,n):
'''
:param Jobs: list of "Job" class defined in driver code, with "profit" and "deadline".
:param n: total number of jobs
:return: A list of size 2 having list[0] = count of jobs and list[1... | 25.938462 | 90 | 0.543298 | #link https://practice.geeksforgeeks.org/problems/job-sequencing-problem-1587115620/1#
def JobScheduling(Jobs,n):
'''
:param Jobs: list of "Job" class defined in driver code, with "profit" and "deadline".
:param n: total number of jobs
:return: A list of size 2 having list[0] = count of jobs and list[1... | 100 | 0 | 26 |
81c5dd89afcb9bd4d36f1eb3321094952f9089ac | 452 | py | Python | code/make_net.py | statisticszhang/Image-classification-caffe-model | 33084ca0841e768dae84db582e15bb29ffeeaaec | [
"MIT"
] | 1 | 2020-06-03T12:53:43.000Z | 2020-06-03T12:53:43.000Z | code/make_net.py | statisticszhang/Image-classification-caffe-model | 33084ca0841e768dae84db582e15bb29ffeeaaec | [
"MIT"
] | null | null | null | code/make_net.py | statisticszhang/Image-classification-caffe-model | 33084ca0841e768dae84db582e15bb29ffeeaaec | [
"MIT"
] | null | null | null | import inception_v3
if __name__ == '__main__':
model = inception_v3.InceptionV3('imagenet_test_lmdb', 'imagenet_train_lmdb', 1000)
train_proto = model.inception_v3_proto(64)
test_proto = model.inception_v3_proto(64, phase='TEST')
save_proto(train_proto, 'imagenet_train.prototxt')
save_proto(tes... | 26.588235 | 87 | 0.727876 | import inception_v3
def save_proto(proto, prototxt):
with open(prototxt, 'w') as f:
f.write(str(proto))
if __name__ == '__main__':
model = inception_v3.InceptionV3('imagenet_test_lmdb', 'imagenet_train_lmdb', 1000)
train_proto = model.inception_v3_proto(64)
test_proto = model.inception_v3_p... | 74 | 0 | 23 |
9b8f07e157c6588a775d6619b9a559fea0c384f1 | 1,750 | py | Python | src/nn/train.py | bahorn/BrumHack7 | cffa2484f63728e73d6dd2bbe6b24fbd12e1cd93 | [
"Unlicense"
] | null | null | null | src/nn/train.py | bahorn/BrumHack7 | cffa2484f63728e73d6dd2bbe6b24fbd12e1cd93 | [
"Unlicense"
] | null | null | null | src/nn/train.py | bahorn/BrumHack7 | cffa2484f63728e73d6dd2bbe6b24fbd12e1cd93 | [
"Unlicense"
] | null | null | null |
# based on the keras documentation
#
import numpy as np
from keras.models import Sequential
from keras.layers import Dense, Conv1D,Activation
from keras import losses, optimizers
import keras.utils as keras_utils
import json
f = open('data_for_everything')
j = json.load(f)
# our parameters
nn_input_size = len(j[0][... | 26.923077 | 69 | 0.726857 |
# based on the keras documentation
#
import numpy as np
from keras.models import Sequential
from keras.layers import Dense, Conv1D,Activation
from keras import losses, optimizers
import keras.utils as keras_utils
import json
f = open('data_for_everything')
j = json.load(f)
# our parameters
nn_input_size = len(j[0][... | 0 | 0 | 0 |
5f4d3ac4d5f1f55e81a6e2d8f4472443466c8220 | 2,430 | py | Python | models/fault/optimization/fseg_keras2tf.py | vkb1/openseismic | 51f91e658a74e2c38910b686b2e96b73e77f5eb5 | [
"Apache-2.0"
] | 7 | 2021-05-13T05:53:09.000Z | 2022-03-03T21:44:10.000Z | models/fault/optimization/fseg_keras2tf.py | manaspathak89/openseismic | 034de2abf00feddab6ae8151b46abc2fa7153091 | [
"Apache-2.0"
] | null | null | null | models/fault/optimization/fseg_keras2tf.py | manaspathak89/openseismic | 034de2abf00feddab6ae8151b46abc2fa7153091 | [
"Apache-2.0"
] | 4 | 2021-04-23T20:45:12.000Z | 2021-07-03T23:58:08.000Z | #
# Copyright (C) 2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
#
import argparse
from unet3 import cross_entropy_balanced
import tensorflow.keras.backend as K
from keras.models import load_model
from keras.layers import *
from tensorflow.python.framework import graph_io
from tensorflow.python.framewor... | 32.4 | 91 | 0.671605 | #
# Copyright (C) 2021 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
#
#
import argparse
from unet3 import cross_entropy_balanced
import tensorflow.keras.backend as K
from keras.models import load_model
from keras.layers import *
from tensorflow.python.framework import graph_io
from tensorflow.python.framewor... | 898 | 0 | 23 |
33193c2a64207c1183330c27a42bd80b4a8def1f | 35,027 | py | Python | crosshair/condition_parser.py | Rik-de-Kort/CrossHair | e0a06969d571aebcc582359afdedf25f38630c0d | [
"MIT"
] | null | null | null | crosshair/condition_parser.py | Rik-de-Kort/CrossHair | e0a06969d571aebcc582359afdedf25f38630c0d | [
"MIT"
] | null | null | null | crosshair/condition_parser.py | Rik-de-Kort/CrossHair | e0a06969d571aebcc582359afdedf25f38630c0d | [
"MIT"
] | null | null | null | import ast
import collections
import contextlib
import enum
from functools import partial
from functools import wraps
import inspect
from inspect import BoundArguments
import re
import sys
import textwrap
import traceback
import types
from dataclasses import dataclass
from dataclasses import replace
from typing import ... | 34.006796 | 101 | 0.589374 | import ast
import collections
import contextlib
import enum
from functools import partial
from functools import wraps
import inspect
from inspect import BoundArguments
import re
import sys
import textwrap
import traceback
import types
from dataclasses import dataclass
from dataclasses import replace
from typing import ... | 26,427 | 2,113 | 1,294 |
7728396fa6ae2ee6bce161c0ee02704806a006c0 | 427 | py | Python | garambubot.py | MaelC001/SPI2022 | ddcbb0b1e480fe0ba43e1dc90826a157a5f58828 | [
"MIT"
] | null | null | null | garambubot.py | MaelC001/SPI2022 | ddcbb0b1e480fe0ba43e1dc90826a157a5f58828 | [
"MIT"
] | null | null | null | garambubot.py | MaelC001/SPI2022 | ddcbb0b1e480fe0ba43e1dc90826a157a5f58828 | [
"MIT"
] | 1 | 2022-03-22T17:21:05.000Z | 2022-03-22T17:21:05.000Z | import botutils
import intutils
import sbotutils
if __name__=="__main__":
pass | 21.35 | 42 | 0.709602 | import botutils
import intutils
import sbotutils
def Ask(string,doublecheck=False):
final=""
l1=botutils.processTweet(string)
l2=[] #Recuperador Zeltzyn y Darío
l3=[]
if doublecheck:
l2=sbotutils.processTweet2(string)
final=botutils.Interact(l1,l2,l3)
#print(final)
return final
... | 299 | 0 | 46 |
39f36ae4936152662e344884ef131faba41464cd | 197 | py | Python | config.py | prstrive/CondConv-tensorflow | 1a626e454d341eb892f428ac0ac9a549aff35cbf | [
"MIT"
] | 16 | 2020-09-25T08:55:37.000Z | 2022-03-31T05:10:44.000Z | config.py | prstrive/CondConv-tensorflow | 1a626e454d341eb892f428ac0ac9a549aff35cbf | [
"MIT"
] | 2 | 2021-01-14T01:37:58.000Z | 2021-06-16T02:43:05.000Z | config.py | prstrive/CondConv-tensorflow | 1a626e454d341eb892f428ac0ac9a549aff35cbf | [
"MIT"
] | 4 | 2021-10-15T23:47:35.000Z | 2022-02-18T08:33:44.000Z | MEAN = {"imagenet": [0.485, 0.456, 0.406], "cifar": [0.4914, 0.4822, 0.4465]}
STD = {"imagenet": [0.229, 0.224, 0.225], "cifar": [0.2023, 0.1994, 0.2010]}
WEIGHT_DECAY = 2e-4
LABEL_SMOOTH = 2e-1
| 28.142857 | 77 | 0.593909 | MEAN = {"imagenet": [0.485, 0.456, 0.406], "cifar": [0.4914, 0.4822, 0.4465]}
STD = {"imagenet": [0.229, 0.224, 0.225], "cifar": [0.2023, 0.1994, 0.2010]}
WEIGHT_DECAY = 2e-4
LABEL_SMOOTH = 2e-1
| 0 | 0 | 0 |
5747a135c1bfbbad1bae931235988bfd3c43c4f5 | 2,318 | py | Python | apprest/views/quota.py | dsanchez-cells/calipsoplus-backend | 7eaa6904ec59d88052644b31041b92ee20e54354 | [
"MIT"
] | 4 | 2018-12-04T15:08:27.000Z | 2019-04-11T09:49:41.000Z | apprest/views/quota.py | dsanchez-cells/calipsoplus-backend | 7eaa6904ec59d88052644b31041b92ee20e54354 | [
"MIT"
] | 63 | 2018-11-22T13:07:56.000Z | 2021-06-10T20:55:58.000Z | apprest/views/quota.py | dsanchez-cells/calipsoplus-backend | 7eaa6904ec59d88052644b31041b92ee20e54354 | [
"MIT"
] | 10 | 2018-11-23T08:17:28.000Z | 2022-01-15T23:41:59.000Z | from rest_framework.authentication import SessionAuthentication, BasicAuthentication
from rest_framework.exceptions import PermissionDenied
from rest_framework.response import Response
from rest_framework.permissions import IsAuthenticated
from rest_framework.views import APIView
from rest_framework import status
impor... | 37.387097 | 94 | 0.722174 | from rest_framework.authentication import SessionAuthentication, BasicAuthentication
from rest_framework.exceptions import PermissionDenied
from rest_framework.response import Response
from rest_framework.permissions import IsAuthenticated
from rest_framework.views import APIView
from rest_framework import status
impor... | 1,289 | 204 | 50 |
28c896444d8782bdea5304d4d960c923e548df5f | 2,739 | py | Python | energy_py/common/experiments/runner.py | liudaizong/energy_py | 7b6a3f52d3ea067061e95b931a7b864d1247e123 | [
"MIT"
] | 1 | 2020-12-03T01:22:27.000Z | 2020-12-03T01:22:27.000Z | energy_py/common/experiments/runner.py | liudaizong/energy_py | 7b6a3f52d3ea067061e95b931a7b864d1247e123 | [
"MIT"
] | null | null | null | energy_py/common/experiments/runner.py | liudaizong/energy_py | 7b6a3f52d3ea067061e95b931a7b864d1247e123 | [
"MIT"
] | null | null | null | """
the Runner class has two main functions
1 - keeping track of episode rewards
2 - logging reward info to tensorboard
3 - saving reward history to csv
"""
import csv
import logging
import numpy as np
import tensorflow as tf
logger = logging.getLogger(__name__)
class Runner(object):
"""
Giving the runner... | 27.94898 | 77 | 0.585615 | """
the Runner class has two main functions
1 - keeping track of episode rewards
2 - logging reward info to tensorboard
3 - saving reward history to csv
"""
import csv
import logging
import numpy as np
import tensorflow as tf
logger = logging.getLogger(__name__)
class Runner(object):
"""
Giving the runner... | 2,207 | 0 | 108 |
8bf8a5393e09fa30ffc4b560da197be08af0b397 | 333 | py | Python | 10_python_qa_pageobject-master/page_objects/common/Alert.py | turovod/Otus | 57433c6944bca155177b07ff361139ff30f7f692 | [
"MIT"
] | 1 | 2019-09-18T11:39:07.000Z | 2019-09-18T11:39:07.000Z | 10_python_qa_pageobject-master/page_objects/common/Alert.py | turovod/Otus | 57433c6944bca155177b07ff361139ff30f7f692 | [
"MIT"
] | null | null | null | 10_python_qa_pageobject-master/page_objects/common/Alert.py | turovod/Otus | 57433c6944bca155177b07ff361139ff30f7f692 | [
"MIT"
] | null | null | null | from locators import Alert as AL
| 25.615385 | 83 | 0.702703 | from locators import Alert as AL
class Alert:
def __init__(self, driver):
self.driver = driver
def click_login(self):
self.driver.find_element_by_css_selector(AL.success.login['css']).click()
def click_to_cart(self):
self.driver.find_element_by_css_selector(AL.success.to_cart['cs... | 205 | -9 | 104 |
86c2b8cb820ced4796bf2591fa44dd00ca8adfe6 | 4,608 | py | Python | lottery.v2.py | lybing/LotteryAnalysis | 285228de2247fa361ead46590ef9ed4b65c25b4f | [
"MIT"
] | null | null | null | lottery.v2.py | lybing/LotteryAnalysis | 285228de2247fa361ead46590ef9ed4b65c25b4f | [
"MIT"
] | null | null | null | lottery.v2.py | lybing/LotteryAnalysis | 285228de2247fa361ead46590ef9ed4b65c25b4f | [
"MIT"
] | null | null | null | import requests
import re
import pymysql
from pyecharts import Bar, Pie, Bar3D
from lotterymodel import PeriodModel,WinningNumberModel,SalesInfoModel
# 解析开奖信息Html
# parsePage()
# 以Pie的方式展示每个数字的频率
analysisFrequency_Pie3D() | 43.065421 | 333 | 0.603733 | import requests
import re
import pymysql
from pyecharts import Bar, Pie, Bar3D
from lotterymodel import PeriodModel,WinningNumberModel,SalesInfoModel
def getContent():
url = 'https://datachart.500.com/ssq/history/newinc/outball.php?start=01001&end=18100'
return requests.get(url).text
def parsePage():
try... | 4,344 | 0 | 140 |
8b872fea8e90d06ddd003885d709ef5bfd933682 | 853 | py | Python | backbone/drn/from_drn.py | lartpang/OpticalFlowBasedVOS | cd4856644b77dd963133797c543aeafb4f402217 | [
"MIT"
] | 6 | 2020-11-19T04:20:52.000Z | 2021-09-24T02:40:11.000Z | backbone/drn/from_drn.py | lartpang/OpticalFlowBasedVOS | cd4856644b77dd963133797c543aeafb4f402217 | [
"MIT"
] | null | null | null | backbone/drn/from_drn.py | lartpang/OpticalFlowBasedVOS | cd4856644b77dd963133797c543aeafb4f402217 | [
"MIT"
] | 2 | 2020-11-22T02:02:18.000Z | 2021-11-14T08:56:15.000Z | import torch
from torch import nn
from backbone.drn.drn import drn_a_50
if __name__ == "__main__":
conv_list = Backbone_DRNA50_in3(in_C=3)
x = torch.randn((1, 3, 320, 320))
# torch.Size([1, 3, 320, 320])
# torch.Size([1, 64, 160, 160])
# torch.Size([1, 256, 80, 80])
# torch.Size([1, 512, 40,... | 26.65625 | 87 | 0.610785 | import torch
from torch import nn
from backbone.drn.drn import drn_a_50
def Backbone_DRNA50_in3(in_C):
net = drn_a_50(pretrained=True)
if in_C != 3:
net.conv1 = nn.Conv2d(in_C, 64, kernel_size=7, stride=2, padding=3, bias=False)
div_2 = nn.Sequential(*list(net.children())[:3])
div_4 = nn.Sequ... | 377 | 0 | 23 |
8458fc2b8d2c148c95857922a9e779177e7f48f4 | 2,188 | py | Python | src/tests/codebuild_test.py | alexlykasov/codebuild-notifications-github | f0cad0c3e3b00e7201d79bcec83e1ec40fe8f267 | [
"Apache-2.0"
] | null | null | null | src/tests/codebuild_test.py | alexlykasov/codebuild-notifications-github | f0cad0c3e3b00e7201d79bcec83e1ec40fe8f267 | [
"Apache-2.0"
] | null | null | null | src/tests/codebuild_test.py | alexlykasov/codebuild-notifications-github | f0cad0c3e3b00e7201d79bcec83e1ec40fe8f267 | [
"Apache-2.0"
] | null | null | null | import unittest
from unittest.mock import patch
from common.codebuild import CodeBuild
from common.exceptions import CodeBuildProjectNotFound
| 31.257143 | 84 | 0.574954 | import unittest
from unittest.mock import patch
from common.codebuild import CodeBuild
from common.exceptions import CodeBuildProjectNotFound
class CodebuildTest(unittest.TestCase):
@patch('common.codebuild.client')
def test_project_fetched(self, codebuild_client):
project_id = '1234-34556-1223-1234... | 1,752 | 269 | 23 |
37b8ba02ae29570de854afb8165999971707912e | 243 | py | Python | platform/core/polyaxon/api/build_jobs/queries.py | hackerwins/polyaxon | ff56a098283ca872abfbaae6ba8abba479ffa394 | [
"Apache-2.0"
] | null | null | null | platform/core/polyaxon/api/build_jobs/queries.py | hackerwins/polyaxon | ff56a098283ca872abfbaae6ba8abba479ffa394 | [
"Apache-2.0"
] | null | null | null | platform/core/polyaxon/api/build_jobs/queries.py | hackerwins/polyaxon | ff56a098283ca872abfbaae6ba8abba479ffa394 | [
"Apache-2.0"
] | null | null | null | from db.models.build_jobs import BuildJob
builds = BuildJob.objects.select_related(
'status',
)
builds = builds.prefetch_related(
'user',
'project',
'project__user',
)
builds_details = builds.select_related('code_reference')
| 18.692308 | 56 | 0.728395 | from db.models.build_jobs import BuildJob
builds = BuildJob.objects.select_related(
'status',
)
builds = builds.prefetch_related(
'user',
'project',
'project__user',
)
builds_details = builds.select_related('code_reference')
| 0 | 0 | 0 |
88dfdfa427cfd5fd1939a962c6595eda307b4052 | 9,106 | py | Python | ceph_cfg/service.py | x22x22/python-ceph-cfg | eb23a70056dd8ef8bebe3b29882e24fe519d44a4 | [
"Apache-2.0"
] | 9 | 2016-04-20T12:34:41.000Z | 2018-04-13T03:09:55.000Z | ceph_cfg/service.py | x22x22/python-ceph-cfg | eb23a70056dd8ef8bebe3b29882e24fe519d44a4 | [
"Apache-2.0"
] | 31 | 2016-04-25T13:51:16.000Z | 2016-11-11T22:09:07.000Z | ceph_cfg/service.py | x22x22/python-ceph-cfg | eb23a70056dd8ef8bebe3b29882e24fe519d44a4 | [
"Apache-2.0"
] | 12 | 2016-04-20T12:34:49.000Z | 2018-10-16T10:46:17.000Z | # Import Python Libs
from __future__ import absolute_import
import logging
# Local imports
from . import utils
from . import util_which
log = logging.getLogger(__name__)
init_types_available = set([ "systemd" , "sysV"])
class init_exception(Exception):
"""Base class for exceptions in this module."""
pass... | 30.557047 | 111 | 0.552273 | # Import Python Libs
from __future__ import absolute_import
import logging
# Local imports
from . import utils
from . import util_which
log = logging.getLogger(__name__)
init_types_available = set([ "systemd" , "sysV"])
def Property(func):
return property(**func())
class init_exception(Exception):
"""Ba... | 7,196 | 679 | 522 |
5eecc24d45e96b3ed3e415fb8a09112716b03f53 | 3,879 | py | Python | homeassistant/components/hangouts/config_flow.py | shanbs/home-assistant | 818776d2b4f11e4f51992dc88bc0a6f9055833b2 | [
"Apache-2.0"
] | 2 | 2017-10-26T19:43:55.000Z | 2017-12-30T23:29:00.000Z | homeassistant/components/hangouts/config_flow.py | shanbs/home-assistant | 818776d2b4f11e4f51992dc88bc0a6f9055833b2 | [
"Apache-2.0"
] | 3 | 2021-09-08T03:34:57.000Z | 2022-03-12T00:59:48.000Z | homeassistant/components/hangouts/config_flow.py | shanbs/home-assistant | 818776d2b4f11e4f51992dc88bc0a6f9055833b2 | [
"Apache-2.0"
] | 1 | 2019-09-28T07:06:08.000Z | 2019-09-28T07:06:08.000Z | """Config flow to configure Google Hangouts."""
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_EMAIL, CONF_PASSWORD
from homeassistant.core import callback
from .const import CONF_2FA, CONF_REFRESH_TOKEN, DOMAIN as HANGOUTS_DOMAIN
@callback
def configured_hang... | 35.916667 | 78 | 0.572055 | """Config flow to configure Google Hangouts."""
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.const import CONF_EMAIL, CONF_PASSWORD
from homeassistant.core import callback
from .const import CONF_2FA, CONF_REFRESH_TOKEN, DOMAIN as HANGOUTS_DOMAIN
@callback
def configured_hang... | 0 | 0 | 0 |
5ab759d518cc1a610f90476530247b11e46d422f | 1,584 | py | Python | applications/_ah/controllers/xmpp.py | murray3/augmi-a | 9f8cff457fa3966d67d3752ccd86876b08bb19b1 | [
"BSD-3-Clause"
] | 1 | 2017-03-28T21:31:51.000Z | 2017-03-28T21:31:51.000Z | applications/_ah/controllers/xmpp.py | murray3/augmi-a | 9f8cff457fa3966d67d3752ccd86876b08bb19b1 | [
"BSD-3-Clause"
] | null | null | null | applications/_ah/controllers/xmpp.py | murray3/augmi-a | 9f8cff457fa3966d67d3752ccd86876b08bb19b1 | [
"BSD-3-Clause"
] | null | null | null | from google.appengine.api import xmpp
from google.appengine.api import users
PONDER_MSG = "Hmm. Let me think on that a bit."
TELLME_MSG = "While I'm thinking, perhaps you can answer me this: %s"
SOMEONE_ANSWERED_MSG = ("We seek those who are wise and fast. One out of two "
"is not enough. Anoth... | 44 | 80 | 0.640783 | from google.appengine.api import xmpp
from google.appengine.api import users
PONDER_MSG = "Hmm. Let me think on that a bit."
TELLME_MSG = "While I'm thinking, perhaps you can answer me this: %s"
SOMEONE_ANSWERED_MSG = ("We seek those who are wise and fast. One out of two "
"is not enough. Anoth... | 534 | 0 | 23 |
7d68a712fe6f09d27e17f30e9d12789853fe22e5 | 2,381 | py | Python | predict.py | CMACH508/RecSleepNet | 08571e85a8330e41b4f124baad5a33fbd3207e32 | [
"Apache-1.1"
] | 5 | 2022-02-08T23:58:32.000Z | 2022-03-01T14:46:04.000Z | predict.py | CMACH508/RecSleepNet | 08571e85a8330e41b4f124baad5a33fbd3207e32 | [
"Apache-1.1"
] | null | null | null | predict.py | CMACH508/RecSleepNet | 08571e85a8330e41b4f124baad5a33fbd3207e32 | [
"Apache-1.1"
] | null | null | null | import argparse
import os
import numpy as np
import tensorflow as tf
from data import get_split
from model import TinySleepNet
from minibatching import batch_generator
from config import config
def compute_performance(cm):
"""Computer performance metrics from confusion matrix.
It computers performance metrics ... | 30.922078 | 92 | 0.627467 | import argparse
import os
import numpy as np
import tensorflow as tf
from data import get_split
from model import TinySleepNet
from minibatching import batch_generator
from config import config
def compute_performance(cm):
"""Computer performance metrics from confusion matrix.
It computers performance metrics ... | 969 | 0 | 23 |
4d92ac253b11674a4612a08d918fca82b3689206 | 267 | py | Python | mantraml/templates/data/tabular/data.py | cclauss/mantra | 19e2f72960da8314f11768d9acfe7836629b817c | [
"Apache-2.0"
] | 330 | 2018-09-04T19:07:51.000Z | 2021-09-14T11:21:05.000Z | mantraml/templates/data/tabular/data.py | cclauss/mantra | 19e2f72960da8314f11768d9acfe7836629b817c | [
"Apache-2.0"
] | 13 | 2018-09-06T06:08:16.000Z | 2018-12-01T17:04:38.000Z | mantraml/templates/data/tabular/data.py | cclauss/mantra | 19e2f72960da8314f11768d9acfe7836629b817c | [
"Apache-2.0"
] | 20 | 2018-09-06T11:56:07.000Z | 2021-12-03T19:48:21.000Z | import numpy as np
from mantraml.data import TabularDataset
| 22.25 | 40 | 0.722846 | import numpy as np
from mantraml.data import TabularDataset
class MyTabularDataset(TabularDataset):
data_name = 'Example Table Data'
files = ['example_dataset.tar.gz']
data_file = 'example_dataset.csv'
data_tags = ['tabular']
has_labels = True | 0 | 183 | 23 |
9a1a04d6c5a43933025680e6c35cf944cab4dfa2 | 11,426 | py | Python | SimModel_Python_API/simmodel_swig/Release/SimFlowEnergyTransfer_ConvectiveHeater_Radiant_Water.py | EnEff-BIM/EnEffBIM-Framework | 6328d39b498dc4065a60b5cc9370b8c2a9a1cddf | [
"MIT"
] | 3 | 2016-05-30T15:12:16.000Z | 2022-03-22T08:11:13.000Z | SimModel_Python_API/simmodel_swig/Release/SimFlowEnergyTransfer_ConvectiveHeater_Radiant_Water.py | EnEff-BIM/EnEffBIM-Framework | 6328d39b498dc4065a60b5cc9370b8c2a9a1cddf | [
"MIT"
] | 21 | 2016-06-13T11:33:45.000Z | 2017-05-23T09:46:52.000Z | SimModel_Python_API/simmodel_swig/Release/SimFlowEnergyTransfer_ConvectiveHeater_Radiant_Water.py | EnEff-BIM/EnEffBIM-Framework | 6328d39b498dc4065a60b5cc9370b8c2a9a1cddf | [
"MIT"
] | null | null | null | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.7
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2, 6, 0):
_SimFlowEnergyTransfer_ConvectiveHeater_Radiant_Wa... | 49.678261 | 205 | 0.801505 | # This file was automatically generated by SWIG (http://www.swig.org).
# Version 3.0.7
#
# Do not make changes to this file unless you know what you are doing--modify
# the SWIG interface file instead.
from sys import version_info
if version_info >= (2, 6, 0):
def swig_import_helper():
from os.path imp... | 7,083 | 2,588 | 212 |
9c47e070e4e9b838255fab89f25b0c3ff2c542ca | 212 | py | Python | {{cookiecutter.project_folder}}/code/{{cookiecutter.python_libname}}/data/__init__.py | gaulinmp/cookiecutter-research-project-template | 7d5feff90d2303d8bfd8a2916c8dac9fa1ba185c | [
"MIT"
] | null | null | null | {{cookiecutter.project_folder}}/code/{{cookiecutter.python_libname}}/data/__init__.py | gaulinmp/cookiecutter-research-project-template | 7d5feff90d2303d8bfd8a2916c8dac9fa1ba185c | [
"MIT"
] | null | null | null | {{cookiecutter.project_folder}}/code/{{cookiecutter.python_libname}}/data/__init__.py | gaulinmp/cookiecutter-research-project-template | 7d5feff90d2303d8bfd8a2916c8dac9fa1ba185c | [
"MIT"
] | 2 | 2021-07-01T14:44:06.000Z | 2022-02-05T22:57:39.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Data module for importing and cleaning data sets.
Import / download / cache datasets in `download` module.
Get and filter sample in `sample` module.
"""
| 23.555556 | 57 | 0.665094 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Data module for importing and cleaning data sets.
Import / download / cache datasets in `download` module.
Get and filter sample in `sample` module.
"""
| 0 | 0 | 0 |
423b4a78a6fc89f01fe25f2a4e27bb8b262709f4 | 3,042 | py | Python | libraries/scripts/updater/update_vendor_deps.py | pjreiniger/GirlsOfSteelFRC | 03ab0fb699dfc14985ce3c95b1eacb145288fc7e | [
"BSD-3-Clause"
] | null | null | null | libraries/scripts/updater/update_vendor_deps.py | pjreiniger/GirlsOfSteelFRC | 03ab0fb699dfc14985ce3c95b1eacb145288fc7e | [
"BSD-3-Clause"
] | 44 | 2021-11-09T23:23:48.000Z | 2022-03-22T23:44:15.000Z | libraries/scripts/updater/update_vendor_deps.py | pjreiniger/GirlsOfSteelFRC | 03ab0fb699dfc14985ce3c95b1eacb145288fc7e | [
"BSD-3-Clause"
] | 1 | 2021-11-19T03:45:21.000Z | 2021-11-19T03:45:21.000Z | """
Downloads the latest version of the vendor dependences, and replaces all copies of them in the repository
"""
import os
import shutil
import tempfile
from urllib.request import urlopen, Request
from libraries.scripts.updater.utils import walk_with_blacklist
from libraries.scripts.git.git_python_wrappers import comm... | 35.372093 | 129 | 0.667324 | """
Downloads the latest version of the vendor dependences, and replaces all copies of them in the repository
"""
import os
import shutil
import tempfile
from urllib.request import urlopen, Request
from libraries.scripts.updater.utils import walk_with_blacklist
from libraries.scripts.git.git_python_wrappers import comm... | 2,520 | 0 | 69 |
48994d838b36c0a4b7a0dce2031a68774d2ae381 | 3,545 | py | Python | async/001_async_threads_processes/03_multiprocessing/03_unsync/1_examples.py | AleksNeStu/projects | 1a4c68dfbdcb77228f0f3617e58fd18fcb1f5dbb | [
"Apache-2.0"
] | 2 | 2022-01-19T18:01:35.000Z | 2022-02-06T06:54:38.000Z | async/001_async_threads_processes/03_multiprocessing/03_unsync/1_examples.py | AleksNeStu/projects | 1a4c68dfbdcb77228f0f3617e58fd18fcb1f5dbb | [
"Apache-2.0"
] | null | null | null | async/001_async_threads_processes/03_multiprocessing/03_unsync/1_examples.py | AleksNeStu/projects | 1a4c68dfbdcb77228f0f3617e58fd18fcb1f5dbb | [
"Apache-2.0"
] | null | null | null | import asyncio
from unsync import unsync
from codetiming import Timer
import time
# unsync
# Unsynchronize asyncio by using an ambient event loop, or executing in separate threads or processes.
#
# Quick Overview
# Functions marked with the @unsync decorator will behave in one of the following ways:
#
# async functio... | 31.936937 | 177 | 0.736812 | import asyncio
from unsync import unsync
from codetiming import Timer
import time
# unsync
# Unsynchronize asyncio by using an ambient event loop, or executing in separate threads or processes.
#
# Quick Overview
# Functions marked with the @unsync decorator will behave in one of the following ways:
#
# async functio... | 573 | 0 | 177 |
2432cd8c8e059ae2f2a89ffe68c1cc3e49ea87aa | 607 | py | Python | game/Player.py | thisHermit/chain-reaction-ai | f8f597afee813452b6fed4d6a090b21682aee4eb | [
"Apache-2.0"
] | 1 | 2019-02-08T18:39:22.000Z | 2019-02-08T18:39:22.000Z | game/Player.py | thisHermit/chain-reaction-ai | f8f597afee813452b6fed4d6a090b21682aee4eb | [
"Apache-2.0"
] | null | null | null | game/Player.py | thisHermit/chain-reaction-ai | f8f597afee813452b6fed4d6a090b21682aee4eb | [
"Apache-2.0"
] | null | null | null | """The Player class stores all the functions and data related to the Player."""
from pygame import Rect
| 22.481481 | 79 | 0.497529 | """The Player class stores all the functions and data related to the Player."""
from pygame import Rect
class Player:
COLORS = [
(255, 0, 0), # Tomato
(0, 0, 255), # Blue
(60, 179, 113), # Green
(238, 130, 238), # Pink
(255, 165, 0), # Orange
... | 175 | 253 | 72 |
224074df75f78dcfca0040ed97f1e411c08ad25e | 23,710 | py | Python | cornflow-dags/DAG/rostering/core/instance.py | ggsdc/corn | 4c17c46a70f95b8882bcb6a55ef7daa1f69e0456 | [
"MIT"
] | 2 | 2020-07-09T20:58:47.000Z | 2020-07-20T20:40:46.000Z | cornflow-dags/DAG/rostering/core/instance.py | baobabsoluciones/cornflow | bd7cae22107e5fe148704d5f41d4f58f9c410b40 | [
"Apache-2.0"
] | 2 | 2022-03-31T08:42:10.000Z | 2022-03-31T12:05:23.000Z | cornflow-dags/DAG/rostering/core/instance.py | ggsdc/corn | 4c17c46a70f95b8882bcb6a55ef7daa1f69e0456 | [
"MIT"
] | null | null | null | """
"""
# Imports from libraries
from datetime import datetime
import os
import pickle
from pytups import SuperDict, TupList
from typing import Dict, Tuple
# Imports from cornflow libraries
from cornflow_client import InstanceCore
from cornflow_client.core.tools import load_json
# Imports from internal modules
from ... | 38.932677 | 114 | 0.59186 | """
"""
# Imports from libraries
from datetime import datetime
import os
import pickle
from pytups import SuperDict, TupList
from typing import Dict, Tuple
# Imports from cornflow libraries
from cornflow_client import InstanceCore
from cornflow_client.core.tools import load_json
# Imports from internal modules
from ... | 2,279 | 20,896 | 23 |
93adcce6dad3adb52f0381fed1a175f1c5ef1f73 | 1,455 | py | Python | Python/login.py | zSucrilhos/programming | aa0076a4a7084a6064e1e5df258ba0c90cf8ceeb | [
"MIT"
] | null | null | null | Python/login.py | zSucrilhos/programming | aa0076a4a7084a6064e1e5df258ba0c90cf8ceeb | [
"MIT"
] | 4 | 2020-07-18T03:27:03.000Z | 2020-07-18T03:28:37.000Z | Python/login.py | zSucrilhos/programming | aa0076a4a7084a6064e1e5df258ba0c90cf8ceeb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
a = 'Formulário de Login, "LogForm v0.3"'
print(f'{a:^59}')
print('#'*59)
usuarios = []
senhas = []
while True:
if not usuarios:
print('Não há usuários registrados anteriormente.\nRegistre um novo usuário!\n')
print('Registrar novo usuário?\n\t1 - SIM\n\t2 - NÃO\n\t')
se = str(input('>... | 26.454545 | 82 | 0.67354 | # -*- coding: utf-8 -*-
a = 'Formulário de Login, "LogForm v0.3"'
print(f'{a:^59}')
print('#'*59)
usuarios = []
senhas = []
def new_usr():
usr_name = str(input('Novo nome de usuário: '))
usuarios.append(usr_name)
usr_psw = str(input('Nova senha: '))
senhas.append(usr_psw)
def login():
print('Digite o seu nome... | 816 | 0 | 46 |
ca6b1ee760dac02315106bd155a233ac24b165b6 | 115,936 | py | Python | ghostdr/ghost/primitives_ghost_spect.py | GeminiDRSoftware/GHOSTDR | 79cd1ac81a7458e06668d6dac51fc6f9c9c61b31 | [
"BSD-3-Clause"
] | 1 | 2019-09-05T15:29:25.000Z | 2019-09-05T15:29:25.000Z | ghostdr/ghost/primitives_ghost_spect.py | GeminiDRSoftware/GHOSTDR | 79cd1ac81a7458e06668d6dac51fc6f9c9c61b31 | [
"BSD-3-Clause"
] | null | null | null | ghostdr/ghost/primitives_ghost_spect.py | GeminiDRSoftware/GHOSTDR | 79cd1ac81a7458e06668d6dac51fc6f9c9c61b31 | [
"BSD-3-Clause"
] | 2 | 2017-10-10T23:23:53.000Z | 2022-02-15T23:28:22.000Z | #
# gemini_python
#
# primitives_ghost_spect.py
# ------------------------------------------------------------------------------
import os
import numpy as np
import math
from copy import deepcopy
import... | 46.152866 | 97 | 0.534002 | #
# gemini_python
#
# primitives_ghost_spect.py
# ------------------------------------------------------------------------------
import os
import numpy as np
import math
from copy import deepcopy
import... | 443 | 0 | 54 |
d576252de412a2afd8fc308136087e909b325fd1 | 6,368 | py | Python | test/functional/bsv-p2sh-wallet.py | Trackerming/bitcoin-sv | fb50a64e3ea0334a86b2c80daf5147c5bc2693c4 | [
"MIT"
] | 8 | 2019-08-02T02:49:42.000Z | 2022-01-17T15:51:48.000Z | test/functional/bsv-p2sh-wallet.py | Trackerming/bitcoin-sv | fb50a64e3ea0334a86b2c80daf5147c5bc2693c4 | [
"MIT"
] | null | null | null | test/functional/bsv-p2sh-wallet.py | Trackerming/bitcoin-sv | fb50a64e3ea0334a86b2c80daf5147c5bc2693c4 | [
"MIT"
] | 4 | 2019-08-02T02:50:44.000Z | 2021-05-28T03:21:38.000Z | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin developers
# Copyright (c) 2019 Bitcoin Association
# Distributed under the Open BSV software license, see the accompanying file LICENSE.
"""
This test checks the behaviour of P2SH before and after genesis.
"""
from test_framework.test_framework import Compariso... | 40.820513 | 153 | 0.681062 | #!/usr/bin/env python3
# Copyright (c) 2017 The Bitcoin developers
# Copyright (c) 2019 Bitcoin Association
# Distributed under the Open BSV software license, see the accompanying file LICENSE.
"""
This test checks the behaviour of P2SH before and after genesis.
"""
from test_framework.test_framework import Compariso... | 4,916 | 15 | 199 |
499cd9a76cac4a60772cf71947ac166d58747cce | 14,982 | py | Python | poor_trader/indicators.py | johndpope/poor-trader-py | 097fbb10c217abe0db5a2cd55d73e0ad2990acd9 | [
"MIT"
] | 1 | 2020-03-30T19:04:39.000Z | 2020-03-30T19:04:39.000Z | poor_trader/indicators.py | johndpope/poor-trader-py | 097fbb10c217abe0db5a2cd55d73e0ad2990acd9 | [
"MIT"
] | null | null | null | poor_trader/indicators.py | johndpope/poor-trader-py | 097fbb10c217abe0db5a2cd55d73e0ad2990acd9 | [
"MIT"
] | null | null | null | import os
from os import listdir
from os.path import isfile, join
import re
from path import Path
import numpy as np
import pandas as pd
from poor_trader import utils
from poor_trader.utils import quotes_range
from poor_trader.config import INDICATORS_OUTPUT_PATH
def SMMA(series, window=14):
""... | 35.41844 | 154 | 0.630023 | import os
from os import listdir
from os.path import isfile, join
import re
from path import Path
import numpy as np
import pandas as pd
from poor_trader import utils
from poor_trader.utils import quotes_range
from poor_trader.config import INDICATORS_OUTPUT_PATH
def _true_range(df_quotes, indices):
cur = df_qu... | 13,226 | 0 | 437 |
2e1638de5d06c7e67de2514d2d21c01650ab39f6 | 3,629 | py | Python | versions.py | flrt/ref-ameli | e8e6bb82b8cec999f19355ccf8b6adb15c080ec2 | [
"MIT"
] | 6 | 2018-05-25T09:54:03.000Z | 2020-01-28T10:49:28.000Z | versions.py | flrt/ref-ameli | e8e6bb82b8cec999f19355ccf8b6adb15c080ec2 | [
"MIT"
] | null | null | null | versions.py | flrt/ref-ameli | e8e6bb82b8cec999f19355ccf8b6adb15c080ec2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Programme de vérification des référentiels AMELi
"""
__author__ = 'Frederic Laurent'
__version__ = "1.1"
__copyright__ = 'Copyright 2017, Frederic Laurent'
__license__ = "MIT"
import json
import logging
import os.path
from easy_atom import helpers
class Versio... | 34.235849 | 111 | 0.638468 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Programme de vérification des référentiels AMELi
"""
__author__ = 'Frederic Laurent'
__version__ = "1.1"
__copyright__ = 'Copyright 2017, Frederic Laurent'
__license__ = "MIT"
import json
import logging
import os.path
from easy_atom import helpers
class Versio... | 472 | 0 | 108 |
bda00df42abd5cd82b0e37df557e2e08b492d4c8 | 7,600 | py | Python | pytiff/test/test_write.py | ch-schiffer/pytiff | 99f8a7eb6e41e974fab1d49b2979670c8346d0ae | [
"BSD-3-Clause"
] | 9 | 2017-01-04T12:43:42.000Z | 2022-03-21T11:38:14.000Z | pytiff/test/test_write.py | ch-schiffer/pytiff | 99f8a7eb6e41e974fab1d49b2979670c8346d0ae | [
"BSD-3-Clause"
] | 19 | 2016-06-06T07:49:33.000Z | 2020-11-27T13:25:51.000Z | pytiff/test/test_write.py | ch-schiffer/pytiff | 99f8a7eb6e41e974fab1d49b2979670c8346d0ae | [
"BSD-3-Clause"
] | 19 | 2017-02-21T12:49:39.000Z | 2022-03-21T11:39:21.000Z | from hypothesis import HealthCheck
from hypothesis import given, settings
from hypothesis.extra import numpy as hnp
from pytiff import *
import hypothesis.strategies as st
import numpy as np
import pytest
import subprocess
import tifffile
from skimage.data import coffee
# scanline integer tests
@settings(buffer_size=... | 40.860215 | 120 | 0.67 | from hypothesis import HealthCheck
from hypothesis import given, settings
from hypothesis.extra import numpy as hnp
from pytiff import *
import hypothesis.strategies as st
import numpy as np
import pytest
import subprocess
import tifffile
from skimage.data import coffee
def test_write_rgb(tmpdir_factory):
img = co... | 5,484 | 0 | 223 |
852607e278475163f99ced2f37995abec5023153 | 16,330 | py | Python | src/grafimo/motif.py | pinellolab/GRAFIMO | 4fe13421ab4200e624276ea39fb37e307c311cbf | [
"MIT"
] | 21 | 2019-11-19T12:49:12.000Z | 2022-01-28T09:25:05.000Z | src/grafimo/motif.py | pinellolab/GRAFIMO | 4fe13421ab4200e624276ea39fb37e307c311cbf | [
"MIT"
] | 2 | 2021-09-21T10:24:15.000Z | 2022-02-07T15:58:15.000Z | src/grafimo/motif.py | InfOmics/GRAFIMO | 5f7684ef0b5c804cffbb7335e74f319230d7b3c1 | [
"MIT"
] | 3 | 2020-01-30T15:47:20.000Z | 2021-01-07T17:04:07.000Z | """Motif object definition.
A single Motif object stores important values, used during the following steps of
GRAFIMO's analysis, such as motif PSSM, p-value matrix, scaling factor, offset,
motif information, etc.
"""
from grafimo.GRAFIMOException import NotValidMotifMatrixException, \
NoDataFrameException, Wro... | 32.145669 | 83 | 0.607532 | """Motif object definition.
A single Motif object stores important values, used during the following steps of
GRAFIMO's analysis, such as motif PSSM, p-value matrix, scaling factor, offset,
motif information, etc.
"""
from grafimo.GRAFIMOException import NotValidMotifMatrixException, \
NoDataFrameException, Wro... | 10,130 | 0 | 1,173 |