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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
890656390da4bde3ea0b6bfbd39c38f05f5f6d9b | 3,608 | py | Python | python/find_min_height_trees.py | yakuza8/competitive-programming | 24e41d735ca1edd60cb9565f14322da05a93c33e | [
"MIT"
] | 1 | 2021-05-15T11:34:03.000Z | 2021-05-15T11:34:03.000Z | python/find_min_height_trees.py | yakuza8/competitive-programming | 24e41d735ca1edd60cb9565f14322da05a93c33e | [
"MIT"
] | null | null | null | python/find_min_height_trees.py | yakuza8/competitive-programming | 24e41d735ca1edd60cb9565f14322da05a93c33e | [
"MIT"
] | null | null | null | import unittest
from typing import List
| 34.361905 | 120 | 0.546286 | import unittest
from typing import List
class Solution:
@staticmethod
def findMinHeightTrees(n: int, edges: List[List[int]]) -> List[int]:
"""
For an undirected graph with tree characteristics, we can choose any node as the root. The result graph is then
a rooted tree. Among all possi... | 369 | 3,101 | 100 |
97fc0f62160c1278a8c16eeac628f0ca5d1b29c3 | 294 | py | Python | app/main/views.py | techouse/nordend | 9129c5dc75f338ba0b4fc6c6a8b6bfdc334264d4 | [
"MIT"
] | null | null | null | app/main/views.py | techouse/nordend | 9129c5dc75f338ba0b4fc6c6a8b6bfdc334264d4 | [
"MIT"
] | 1 | 2020-03-03T07:58:56.000Z | 2020-03-03T07:58:56.000Z | app/main/views.py | techouse/nordend | 9129c5dc75f338ba0b4fc6c6a8b6bfdc334264d4 | [
"MIT"
] | null | null | null | from flask import render_template, g
from flask_babel import _, get_locale
from . import main
@main.before_app_request
@main.route("/")
@main.route("/index")
| 18.375 | 62 | 0.717687 | from flask import render_template, g
from flask_babel import _, get_locale
from . import main
@main.before_app_request
def before_request():
g.locale = str(get_locale())
@main.route("/")
@main.route("/index")
def index():
return render_template("index.html", title=_("Home Page"))
| 87 | 0 | 44 |
a3ff0088ad82581d42a865e0981058964af9eb09 | 17,886 | py | Python | 0000_huri/locatorfixed.py | Photon26/wrs-main-210414 | 71efab6f8680af48ba269244136acf69c36cb730 | [
"MIT"
] | null | null | null | 0000_huri/locatorfixed.py | Photon26/wrs-main-210414 | 71efab6f8680af48ba269244136acf69c36cb730 | [
"MIT"
] | null | null | null | 0000_huri/locatorfixed.py | Photon26/wrs-main-210414 | 71efab6f8680af48ba269244136acf69c36cb730 | [
"MIT"
] | null | null | null | import pickle
import copy
import numpy as np
import environment.collisionmodel as cm
import utiltools.thirdparty.o3dhelper as o3dh
import utiltools.robotmath as rm
import utiltools.thirdparty.p3dhelper as p3dh
if __name__ == '__main__':
import robothelper
import numpy as np
import environment.collisionmod... | 45.861538 | 127 | 0.534608 | import pickle
import copy
import numpy as np
import environment.collisionmodel as cm
import utiltools.thirdparty.o3dhelper as o3dh
import utiltools.robotmath as rm
import utiltools.thirdparty.p3dhelper as p3dh
class LocatorFixed(object):
def __init__(self, directory=None, homomatfilename="rightfixture_homomat2"):... | 2,152 | 10,554 | 23 |
4989d5f25cbf7b8959c697eb092589fbeed6ec24 | 825 | py | Python | tests/test_primes_nth.py | jaredks/pyprimesieve | 53de18a89332f9843d0dc7b46df0e281850f3ef9 | [
"BSD-3-Clause"
] | 34 | 2015-04-27T09:33:45.000Z | 2022-03-17T09:33:12.000Z | tests/test_primes_nth.py | jaredks/pyprimesieve | 53de18a89332f9843d0dc7b46df0e281850f3ef9 | [
"BSD-3-Clause"
] | 4 | 2015-07-03T21:20:03.000Z | 2020-05-05T09:42:48.000Z | tests/test_primes_nth.py | jaredks/pyprimesieve | 53de18a89332f9843d0dc7b46df0e281850f3ef9 | [
"BSD-3-Clause"
] | 11 | 2015-08-13T16:47:09.000Z | 2021-05-20T22:22:27.000Z | #!/usr/bin/env python
import unittest
import pyprimesieve
if __name__ == "__main__":
unittest.main()
| 25.78125 | 71 | 0.723636 | #!/usr/bin/env python
import unittest
import pyprimesieve
class TestNthPrimes(unittest.TestCase):
def test_smallnums_1(self):
self.assertEqual(pyprimesieve.primes_nth(1), 2)
def test_smallnums_2(self):
self.assertEqual(pyprimesieve.primes_nth(4), 7)
def test_bignums_1(self):
sel... | 487 | 18 | 211 |
c303ac3704ab90f11358e5ca57076448def7c12e | 10,411 | py | Python | src/wealth/balance.py | langenhagen/wealth | 273887568aa0c6281751647effcf84cf5422ba37 | [
"MIT"
] | null | null | null | src/wealth/balance.py | langenhagen/wealth | 273887568aa0c6281751647effcf84cf5422ba37 | [
"MIT"
] | null | null | null | src/wealth/balance.py | langenhagen/wealth | 273887568aa0c6281751647effcf84cf5422ba37 | [
"MIT"
] | null | null | null | """Balance-related functionality of `Wealth`."""
import datetime as dt
import functools
from typing import Generator, List
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy.stats
from IPython.core.display import display
from IPython.display import Markdown
fro... | 30.44152 | 88 | 0.581885 | """Balance-related functionality of `Wealth`."""
import datetime as dt
import functools
from typing import Generator, List
import matplotlib as mpl
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import scipy.stats
from IPython.core.display import display
from IPython.display import Markdown
fro... | 0 | 0 | 0 |
bc2c2d1628ef553227433cbb95d0022d2bb67e78 | 2,474 | py | Python | motionDetectMoveMouse.py | BenBarker/Helpers | 146dfd3fe75768b7d6c75a7c79c8b69c9baa4646 | [
"MIT"
] | null | null | null | motionDetectMoveMouse.py | BenBarker/Helpers | 146dfd3fe75768b7d6c75a7c79c8b69c9baa4646 | [
"MIT"
] | null | null | null | motionDetectMoveMouse.py | BenBarker/Helpers | 146dfd3fe75768b7d6c75a7c79c8b69c9baa4646 | [
"MIT"
] | null | null | null | '''Move the mouse based on input from webcam. If motion is detected the mouse is moved.
This is to switch scenes in OBS (screen recording and streaming software) based on camera activity.
OBS supports automatic switching based on mouse activity, but not camera activity. This hacks around that.
Requires opencv-python, ... | 34.84507 | 106 | 0.700081 | '''Move the mouse based on input from webcam. If motion is detected the mouse is moved.
This is to switch scenes in OBS (screen recording and streaming software) based on camera activity.
OBS supports automatic switching based on mouse activity, but not camera activity. This hacks around that.
Requires opencv-python, ... | 0 | 0 | 0 |
b2da4a02e39808fe7681700bd93f1875af94fb0c | 16,100 | py | Python | 5 in 1 Game/GAMES/Hangman.py | GarvBatra123/5_in_1_game | db921901bbeb03f932e8005899957ea227655a64 | [
"MIT"
] | null | null | null | 5 in 1 Game/GAMES/Hangman.py | GarvBatra123/5_in_1_game | db921901bbeb03f932e8005899957ea227655a64 | [
"MIT"
] | null | null | null | 5 in 1 Game/GAMES/Hangman.py | GarvBatra123/5_in_1_game | db921901bbeb03f932e8005899957ea227655a64 | [
"MIT"
] | null | null | null | import random
import time
import sys
def retrieving_word(topic):
"""
This function is used to randomly return a word from a list based on what topic the player wants.
Paramaters
----------
topic: str
This is to store the topic the user wants to obtain the word from
R... | 62.645914 | 657 | 0.621429 | import random
import time
import sys
def retrieving_word(topic):
"""
This function is used to randomly return a word from a list based on what topic the player wants.
Paramaters
----------
topic: str
This is to store the topic the user wants to obtain the word from
R... | 10,078 | 0 | 23 |
ad95c34bfefe78796bb29dc41106edd6ba5ef405 | 1,740 | py | Python | students/models.py | Cent-Luc/University_Portal | 82bf40a1c0d98111ffe8a184d16b543a3feec072 | [
"MIT"
] | null | null | null | students/models.py | Cent-Luc/University_Portal | 82bf40a1c0d98111ffe8a184d16b543a3feec072 | [
"MIT"
] | 1 | 2020-02-11T22:01:10.000Z | 2020-02-11T22:01:10.000Z | students/models.py | c3n7/university-portal | 82bf40a1c0d98111ffe8a184d16b543a3feec072 | [
"MIT"
] | 3 | 2019-11-14T08:50:15.000Z | 2019-11-15T15:36:45.000Z | from datetime import datetime
from django.db import models
from django.contrib.auth import get_user_model
from django.urls import reverse
| 27.1875 | 71 | 0.620115 | from datetime import datetime
from django.db import models
from django.contrib.auth import get_user_model
from django.urls import reverse
class Student(models.Model):
LEVEL_OF_STUDY_CHOICES = [
("Certificate", "Certificate"),
("Diploma", "Diploma"),
("Degree", "Degree"),
("Master", ... | 75 | 1,504 | 23 |
4384fb976fb7a5346cb1bcfdfad5c6c4e3e4195b | 16,913 | py | Python | bittensor/_dataset/dataset_impl.py | zeineb/testzz | 6fc475f846b72be8bf57b4951fd77a00a8158901 | [
"MIT"
] | null | null | null | bittensor/_dataset/dataset_impl.py | zeineb/testzz | 6fc475f846b72be8bf57b4951fd77a00a8158901 | [
"MIT"
] | null | null | null | bittensor/_dataset/dataset_impl.py | zeineb/testzz | 6fc475f846b72be8bf57b4951fd77a00a8158901 | [
"MIT"
] | null | null | null | """ Implementation for the dataset and GenesisTextDataset class, which handles dataloading from ipfs
"""
# The MIT License (MIT)
# Copyright © 2021 Yuma Rao
# 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 ... | 41.760494 | 155 | 0.603973 | """ Implementation for the dataset and GenesisTextDataset class, which handles dataloading from ipfs
"""
# The MIT License (MIT)
# Copyright © 2021 Yuma Rao
# 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 ... | 1,246 | 0 | 52 |
0fa2d201656a7c7e8109899b92abbd8fbf8d2ee2 | 1,086 | py | Python | morepath_reactredux/fakedb.py | morepath/morepath_reactredux | a5f02040cb5e9bfba7ea78a6bfa073d1ee1a326f | [
"BSD-3-Clause"
] | 2 | 2015-12-14T14:34:51.000Z | 2019-06-23T10:42:53.000Z | morepath_reactredux/fakedb.py | morepath/morepath_reactredux | a5f02040cb5e9bfba7ea78a6bfa073d1ee1a326f | [
"BSD-3-Clause"
] | 7 | 2016-04-11T00:21:46.000Z | 2021-04-18T14:33:04.000Z | morepath_reactredux/fakedb.py | morepath/morepath_reactredux | a5f02040cb5e9bfba7ea78a6bfa073d1ee1a326f | [
"BSD-3-Clause"
] | 1 | 2017-10-28T10:08:30.000Z | 2017-10-28T10:08:30.000Z |
zoo = Zoo()
reset_zoo()
| 19.745455 | 47 | 0.548803 | class Zoo:
def __init__(self):
self.clear()
def add(self, animal):
id = self._id_count
animal.id = id
self._id_count += 1
self._animals[id] = animal
def remove(self, id):
del self._animals[id]
def clear(self):
self._animals = {}
self._id... | 766 | -19 | 309 |
1010d79aa99ef913ce67fa83d078366220ff3fc1 | 8,309 | py | Python | backend/Gifts/getRecommendations/RS/Recommendations.py | exarus/GiftRecommenderSystem | a1f0bb44f365c917cf4d870bc93cf172e4d2af52 | [
"Apache-2.0"
] | null | null | null | backend/Gifts/getRecommendations/RS/Recommendations.py | exarus/GiftRecommenderSystem | a1f0bb44f365c917cf4d870bc93cf172e4d2af52 | [
"Apache-2.0"
] | null | null | null | backend/Gifts/getRecommendations/RS/Recommendations.py | exarus/GiftRecommenderSystem | a1f0bb44f365c917cf4d870bc93cf172e4d2af52 | [
"Apache-2.0"
] | 1 | 2018-10-30T22:04:53.000Z | 2018-10-30T22:04:53.000Z | from bson.objectid import ObjectId
import math
from Gifts.getRecommendations.Requests import findingApi
from Gifts.getRecommendations.TextClasterisation import nlp
from Gifts.getRecommendations.DB import DB
from random import shuffle
page_size = 100 # todo in constant file
def remove_similar(items, n):
"""
... | 31.473485 | 116 | 0.591046 | from bson.objectid import ObjectId
import math
from Gifts.getRecommendations.Requests import findingApi
from Gifts.getRecommendations.TextClasterisation import nlp
from Gifts.getRecommendations.DB import DB
from random import shuffle
page_size = 100 # todo in constant file
def remove_similar(items, n):
"""
... | 751 | 0 | 46 |
d6f8afcd6aafef7b2671e3e24dd3c65eb202bcfe | 8,143 | py | Python | pygogo/handlers.py | vault-the/pygogo | 910fa6ef73a172c4b02c1c9e942ba9f57d30914e | [
"MIT"
] | null | null | null | pygogo/handlers.py | vault-the/pygogo | 910fa6ef73a172c4b02c1c9e942ba9f57d30914e | [
"MIT"
] | null | null | null | pygogo/handlers.py | vault-the/pygogo | 910fa6ef73a172c4b02c1c9e942ba9f57d30914e | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
pygogo.handlers
~~~~~~~~~~~~~~~
Log handlers
Examples:
Add a stdout handler::
>>> logger = logging.getLogger()
>>> logger.addHandler(stdout_hdlr())
>>> logger.info('hello world')
hello world
Attributes:
ENCODING (str): T... | 28.274306 | 79 | 0.641287 | # -*- coding: utf-8 -*-
# vim: sw=4:ts=4:expandtab
"""
pygogo.handlers
~~~~~~~~~~~~~~~
Log handlers
Examples:
Add a stdout handler::
>>> logger = logging.getLogger()
>>> logger.addHandler(stdout_hdlr())
>>> logger.info('hello world')
hello world
Attributes:
ENCODING (str): T... | 0 | 0 | 0 |
ac86f5a07f1b799c9570d1358527e40103f552d1 | 2,796 | py | Python | interface.py | nickheyer/CrypticConvert | c4d7bdec6c5a33acdfa2007221ef74fa84c88570 | [
"MIT"
] | 1 | 2021-07-30T05:57:54.000Z | 2021-07-30T05:57:54.000Z | interface.py | nickheyer/CrypticConvert | c4d7bdec6c5a33acdfa2007221ef74fa84c88570 | [
"MIT"
] | null | null | null | interface.py | nickheyer/CrypticConvert | c4d7bdec6c5a33acdfa2007221ef74fa84c88570 | [
"MIT"
] | null | null | null | import json
from PySimpleGUI.PySimpleGUI import Titlebar
from cryptography.fernet import Fernet
from time import sleep
import PySimpleGUI as sg
import os
| 51.777778 | 174 | 0.551502 | import json
from PySimpleGUI.PySimpleGUI import Titlebar
from cryptography.fernet import Fernet
from time import sleep
import PySimpleGUI as sg
import os
def pysimp_interface():
sg.theme('Reddit')
icon_path = os.path.join(os.path.dirname(__file__), 'cc_small_png.png')
layout = [[Titlebar(ti... | 2,611 | 0 | 24 |
af3b4133d79e47382bd6b6eb9fd4acbf271d89b9 | 1,206 | py | Python | Lecture Material/09_Object_Oriented_Programming/examples/lifecycle.py | knherrera/pcc-cis-012-intro-to-programming-python | f2fb8ec5b242fc6deb5c0e2abda60bb91171aad4 | [
"MIT"
] | 23 | 2020-02-19T22:07:17.000Z | 2021-08-19T20:43:21.000Z | Lecture Material/09_Object_Oriented_Programming/examples/lifecycle.py | knherrera/pcc-cis-012-intro-to-programming-python | f2fb8ec5b242fc6deb5c0e2abda60bb91171aad4 | [
"MIT"
] | 12 | 2020-03-04T04:34:38.000Z | 2021-02-23T04:28:31.000Z | Lecture Material/09_Object_Oriented_Programming/examples/lifecycle.py | knherrera/pcc-cis-012-intro-to-programming-python | f2fb8ec5b242fc6deb5c0e2abda60bb91171aad4 | [
"MIT"
] | 18 | 2020-03-05T05:21:11.000Z | 2022-03-05T05:57:12.000Z | """
This script is a basic look at the lifecycle of a Python class. A python class
has 4 main stages:
1. Definition
2. Initialization
3. Access and Manipulation
4. Destruction
"""
print('script start')
print('class access and manipulation start')
print(basic.prop1)
print(basic.cls_method())
print('class access and m... | 21.157895 | 79 | 0.684909 | """
This script is a basic look at the lifecycle of a Python class. A python class
has 4 main stages:
1. Definition
2. Initialization
3. Access and Manipulation
4. Destruction
"""
print('script start')
class basic():
print('Stage 1: class definition start')
prop1 = 1
def __init__(self):
print('... | 235 | 222 | 23 |
bce6f049ceed43f57d4d206b9ea22947da87890f | 55,719 | py | Python | cave/com.raytheon.viz.gfe/python/autotest/VTEC_CrossingYear_TestScript.py | srcarter3/awips2 | 37f31f5e88516b9fd576eaa49d43bfb762e1d174 | [
"Apache-2.0"
] | null | null | null | cave/com.raytheon.viz.gfe/python/autotest/VTEC_CrossingYear_TestScript.py | srcarter3/awips2 | 37f31f5e88516b9fd576eaa49d43bfb762e1d174 | [
"Apache-2.0"
] | null | null | null | cave/com.raytheon.viz.gfe/python/autotest/VTEC_CrossingYear_TestScript.py | srcarter3/awips2 | 37f31f5e88516b9fd576eaa49d43bfb762e1d174 | [
"Apache-2.0"
] | 1 | 2021-10-30T00:03:05.000Z | 2021-10-30T00:03:05.000Z | ##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination
# to non... | 44.081487 | 356 | 0.581417 | ##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.S. law. Dissemination
# to non... | 379 | 0 | 22 |
faea5d527c17372aee749f548d268f1f2983bece | 3,222 | py | Python | pirates/piratesgui/CannonDefenseTimeRemainingUI.py | Willy5s/Pirates-Online-Rewritten | 7434cf98d9b7c837d57c181e5dabd02ddf98acb7 | [
"BSD-3-Clause"
] | 81 | 2018-04-08T18:14:24.000Z | 2022-01-11T07:22:15.000Z | pirates/piratesgui/CannonDefenseTimeRemainingUI.py | Willy5s/Pirates-Online-Rewritten | 7434cf98d9b7c837d57c181e5dabd02ddf98acb7 | [
"BSD-3-Clause"
] | 4 | 2018-09-13T20:41:22.000Z | 2022-01-08T06:57:00.000Z | pirates/piratesgui/CannonDefenseTimeRemainingUI.py | Willy5s/Pirates-Online-Rewritten | 7434cf98d9b7c837d57c181e5dabd02ddf98acb7 | [
"BSD-3-Clause"
] | 26 | 2018-05-26T12:49:27.000Z | 2021-09-11T09:11:59.000Z | from pandac.PandaModules import *
from pirates.piratesbase import PiratesGlobals
from pirates.piratesbase import PLocalizer
from pirates.piratesgui.DialMeter import DialMeter
from pirates.piratesgui import PiratesGuiGlobals | 37.465116 | 170 | 0.647424 | from pandac.PandaModules import *
from pirates.piratesbase import PiratesGlobals
from pirates.piratesbase import PLocalizer
from pirates.piratesgui.DialMeter import DialMeter
from pirates.piratesgui import PiratesGuiGlobals
class CannonDefenseTimeRemainingUI():
def __init__(self):
self.timeRemaining = Non... | 2,717 | 16 | 266 |
2ba44bbf9b415efb57748ceabceca551446f02ba | 571 | py | Python | src/heat_map.py | cameliapatilea/EDA-BeerProfileRating | cebc21b1e494aa8e603a6ef904799f7ce1680d25 | [
"MIT"
] | 1 | 2022-01-30T11:52:33.000Z | 2022-01-30T11:52:33.000Z | src/heat_map.py | cameliapatilea/EDA-BeerProfileRating | cebc21b1e494aa8e603a6ef904799f7ce1680d25 | [
"MIT"
] | null | null | null | src/heat_map.py | cameliapatilea/EDA-BeerProfileRating | cebc21b1e494aa8e603a6ef904799f7ce1680d25 | [
"MIT"
] | null | null | null | import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.metrics import confusion_matrix | 38.066667 | 118 | 0.728546 | import numpy as np
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.metrics import confusion_matrix
def plot_heatmap(y_pred, y_test):
cf_matrix = confusion_matrix (y_pred, y_test)
vmin = np.min(cf_matrix)
vmax = np.max(cf_matrix)
off_diag_mask = np.eye(*cf_matrix.shape, dtype=bool)
... | 431 | 0 | 23 |
b702f1733cb18cea2a5dc4bf2553dff777e32b3e | 4,738 | py | Python | f5sdk/bigiq/mgmt_client.py | herringfromblr/f5-sdk-ternovskiy | adc8434be0c79176db6480bd6842d7a214ba9284 | [
"Apache-2.0"
] | null | null | null | f5sdk/bigiq/mgmt_client.py | herringfromblr/f5-sdk-ternovskiy | adc8434be0c79176db6480bd6842d7a214ba9284 | [
"Apache-2.0"
] | null | null | null | f5sdk/bigiq/mgmt_client.py | herringfromblr/f5-sdk-ternovskiy | adc8434be0c79176db6480bd6842d7a214ba9284 | [
"Apache-2.0"
] | null | null | null | """BIG-IQ management client
"""
from datetime import datetime, timedelta
from retry import retry
from f5sdk.logger import Logger
from f5sdk import constants
from f5sdk.utils import http_utils
from f5sdk.decorators import check_auth, add_auth_header
class ManagementClient(object):
"""A class used as a managemen... | 24.42268 | 100 | 0.527227 | """BIG-IQ management client
"""
from datetime import datetime, timedelta
from retry import retry
from f5sdk.logger import Logger
from f5sdk import constants
from f5sdk.utils import http_utils
from f5sdk.decorators import check_auth, add_auth_header
class ManagementClient(object):
"""A class used as a managemen... | 0 | 0 | 0 |
c76d547fbdc8614920b7bc1980b23fe075bfcf43 | 2,153 | py | Python | src/app/main.py | giuliannocappellari/Rest-API2 | d1bf4b13333b9d24f79fd7485100adc2b4b15deb | [
"FTL",
"CNRI-Python"
] | null | null | null | src/app/main.py | giuliannocappellari/Rest-API2 | d1bf4b13333b9d24f79fd7485100adc2b4b15deb | [
"FTL",
"CNRI-Python"
] | null | null | null | src/app/main.py | giuliannocappellari/Rest-API2 | d1bf4b13333b9d24f79fd7485100adc2b4b15deb | [
"FTL",
"CNRI-Python"
] | null | null | null | from flask import Flask, request, jsonify
from flask_basicauth import BasicAuth
from textblob import TextBlob
#import pandas as pd
#from sklearn.model_selection import train_test_split
import pickle
from sklearn.linear_model import LinearRegression
import os
#esta comentado pois o modelo já foi testado e salvo em mode... | 28.706667 | 89 | 0.72968 | from flask import Flask, request, jsonify
from flask_basicauth import BasicAuth
from textblob import TextBlob
#import pandas as pd
#from sklearn.model_selection import train_test_split
import pickle
from sklearn.linear_model import LinearRegression
import os
#esta comentado pois o modelo já foi testado e salvo em mode... | 319 | 0 | 66 |
ece1aaf047df4c8fe1e72df4ba63b04228d643b0 | 1,111 | py | Python | exasol_integration_test_docker_environment/lib/logging/abstract_log_handler.py | exasol/integration-test-docker-environment | 35850f67cd4cde010f03dd556d1a0f74b3291eb8 | [
"MIT"
] | 4 | 2020-06-25T20:47:31.000Z | 2021-09-10T15:22:51.000Z | exasol_integration_test_docker_environment/lib/logging/abstract_log_handler.py | exasol/integration-test-docker-environment | 35850f67cd4cde010f03dd556d1a0f74b3291eb8 | [
"MIT"
] | 113 | 2020-06-02T08:51:08.000Z | 2022-03-31T08:47:41.000Z | exasol_integration_test_docker_environment/lib/logging/abstract_log_handler.py | exasol/integration-test-docker-environment | 35850f67cd4cde010f03dd556d1a0f74b3291eb8 | [
"MIT"
] | 2 | 2020-05-19T10:57:47.000Z | 2020-06-22T13:32:20.000Z | from exasol_integration_test_docker_environment.lib.config.log_config import log_config
| 30.027027 | 87 | 0.637264 | from exasol_integration_test_docker_environment.lib.config.log_config import log_config
class AbstractLogHandler:
def __init__(self, log_file_path, logger):
self._log_file_path = log_file_path
self._logger = logger
self._complete_log = []
self._error_message = None
self._l... | 833 | 4 | 185 |
d4b5a6c55aa6a0ae351b3d24f7e091cf9b0ee7e8 | 3,006 | py | Python | conf/__init__.py | ConjurTech/hummingbot | 96c90d482080a4e7cee6403dbc91956abb0687cd | [
"Apache-2.0"
] | 2 | 2020-04-21T00:28:52.000Z | 2020-05-12T13:41:35.000Z | conf/__init__.py | GlobalAlpha/HummingBot_EL_Fork | 44e1a924b00044bea9b9f5a1d41a03b850b8c22a | [
"Apache-2.0"
] | 1 | 2019-06-05T23:13:35.000Z | 2019-06-05T23:13:35.000Z | conf/__init__.py | GlobalAlpha/HummingBot_EL_Fork | 44e1a924b00044bea9b9f5a1d41a03b850b8c22a | [
"Apache-2.0"
] | 2 | 2020-08-02T17:59:03.000Z | 2021-09-05T22:19:28.000Z | #!/usr/bin/env python
import os
import logging as _logging
_logger = _logging.getLogger(__name__)
master_host = "***REMOVED***"
master_user = "***REMOVED***"
master_password = "***REMOVED***"
master_db = "***REMOVED***"
slave_host = "127.0.0.1"
slave_user = "reader"
slave_password = "falcon"
slave_db = "falcon"
my... | 26.13913 | 64 | 0.73686 | #!/usr/bin/env python
import os
import logging as _logging
_logger = _logging.getLogger(__name__)
master_host = "***REMOVED***"
master_user = "***REMOVED***"
master_password = "***REMOVED***"
master_db = "***REMOVED***"
slave_host = "127.0.0.1"
slave_user = "reader"
slave_password = "falcon"
slave_db = "falcon"
my... | 0 | 0 | 0 |
6c8d1b3254e48afd9c114873c6455ba5c15e82ba | 4,220 | py | Python | models/a3c.py | oliverdelacruz/reinforcement-learning | 964c19fd7587f44d47e04393108d311ae3b52635 | [
"MIT"
] | 1 | 2020-01-18T13:41:35.000Z | 2020-01-18T13:41:35.000Z | models/a3c.py | oliverdelacruz/reinforcement-learning | 964c19fd7587f44d47e04393108d311ae3b52635 | [
"MIT"
] | null | null | null | models/a3c.py | oliverdelacruz/reinforcement-learning | 964c19fd7587f44d47e04393108d311ae3b52635 | [
"MIT"
] | null | null | null | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 39.439252 | 99 | 0.709242 | # Copyright 2018 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | 2,906 | 0 | 149 |
2d9f9ef5b56084b815c00db007f78dcf6cf05a28 | 8,947 | py | Python | chunkflow/flow/neuroglancer.py | seung-lab/chunkflow | 0e032cdf4f2ba104af4f7809ac11df17352384ed | [
"Apache-2.0"
] | 36 | 2019-03-20T21:58:15.000Z | 2022-03-28T08:40:59.000Z | chunkflow/flow/neuroglancer.py | seung-lab/chunkflow | 0e032cdf4f2ba104af4f7809ac11df17352384ed | [
"Apache-2.0"
] | 96 | 2019-01-23T14:49:18.000Z | 2022-03-21T19:54:20.000Z | chunkflow/flow/neuroglancer.py | seung-lab/chunkflow | 0e032cdf4f2ba104af4f7809ac11df17352384ed | [
"Apache-2.0"
] | 7 | 2019-03-25T19:32:19.000Z | 2021-07-20T19:39:03.000Z | """
TO-DO:
add probability map layer for T-bar or cleft detection and other semantic prediction
"""
import neuroglancer as ng
import numpy as np
from chunkflow.chunk import Chunk
from chunkflow.lib.synapses import Synapses
from .base import OperatorBase
| 35.503968 | 121 | 0.529116 | """
TO-DO:
add probability map layer for T-bar or cleft detection and other semantic prediction
"""
import neuroglancer as ng
import numpy as np
from chunkflow.chunk import Chunk
from chunkflow.lib.synapses import Synapses
from .base import OperatorBase
class NeuroglancerOperator(OperatorBase):
def __init__(se... | 6,614 | 2,052 | 23 |
70e1a5af6d40bdc29f7254bd80b4720e3fb4fe89 | 308 | py | Python | binance_f/model/positionmode.py | molibdenium/autostopmarket | deb63c83ea480b417affd29d360e12befaae8dad | [
"MIT"
] | 4 | 2020-09-07T15:04:43.000Z | 2022-01-19T04:52:06.000Z | binance_f/model/positionmode.py | molibdenium/autostopmarket | deb63c83ea480b417affd29d360e12befaae8dad | [
"MIT"
] | null | null | null | binance_f/model/positionmode.py | molibdenium/autostopmarket | deb63c83ea480b417affd29d360e12befaae8dad | [
"MIT"
] | 1 | 2021-05-15T13:22:12.000Z | 2021-05-15T13:22:12.000Z | #createdbyme
| 22 | 45 | 0.681818 | #createdbyme
class PositionMode:
def __init__(self):
self.code = ""
self.msg = ""
@staticmethod
def json_parse(json_data):
print("parsing position data")
result = PositionMode()
result.code = json_data.get_string("code")
result.msg = json_data.get_string("msg")
return result | 208 | 65 | 22 |
3077d0b2b6c4dc7425d60cb05b484e9c238ff4e3 | 1,616 | py | Python | seq2seq/select_influence_score.py | GT-SALT/CODA | 7d3ae5d79288813c66f49701a1f019e8f61d18d6 | [
"Apache-2.0"
] | 11 | 2022-02-28T10:07:04.000Z | 2022-03-28T06:45:44.000Z | seq2seq/.ipynb_checkpoints/select_influence_score-checkpoint.py | GT-SALT/CODA | 7d3ae5d79288813c66f49701a1f019e8f61d18d6 | [
"Apache-2.0"
] | 3 | 2022-03-28T12:49:24.000Z | 2022-03-30T02:17:52.000Z | seq2seq/.ipynb_checkpoints/select_influence_score-checkpoint.py | GT-SALT/CODA | 7d3ae5d79288813c66f49701a1f019e8f61d18d6 | [
"Apache-2.0"
] | 1 | 2022-02-28T10:07:10.000Z | 2022-02-28T10:07:10.000Z | import pandas as pd
import argparse
import pickle
import numpy as np
from bert_score import BERTScorer
parser = argparse.ArgumentParser(description='Unlabeled')
parser.add_argument('--data_path', type=str, default='./tmp/tst-summarization-baseline-predict/test_generations.txt',
help='path to data... | 27.862069 | 117 | 0.64047 | import pandas as pd
import argparse
import pickle
import numpy as np
from bert_score import BERTScorer
parser = argparse.ArgumentParser(description='Unlabeled')
parser.add_argument('--data_path', type=str, default='./tmp/tst-summarization-baseline-predict/test_generations.txt',
help='path to data... | 956 | 0 | 23 |
d9719701296d49b8008d6d90c05c1882975c627d | 283 | py | Python | bcf-announcements/urls.py | BioComputing/django-bcf-announcements | 693e3cd9f58d497832ccd458a80eaa94fd45823f | [
"BSD-3-Clause"
] | null | null | null | bcf-announcements/urls.py | BioComputing/django-bcf-announcements | 693e3cd9f58d497832ccd458a80eaa94fd45823f | [
"BSD-3-Clause"
] | null | null | null | bcf-announcements/urls.py | BioComputing/django-bcf-announcements | 693e3cd9f58d497832ccd458a80eaa94fd45823f | [
"BSD-3-Clause"
] | null | null | null | from django.conf.urls import url, patterns
from django.contrib import admin
from .api import *
admin.autodiscover()
urlpatterns = patterns(
(r'^api/announcement/(?P<pk>\d+)/dismiss$', AnnouncementDismiss.as_view()),
(r'^api/announcements$', AnnouncementList.as_view()),
)
| 23.583333 | 79 | 0.724382 | from django.conf.urls import url, patterns
from django.contrib import admin
from .api import *
admin.autodiscover()
urlpatterns = patterns(
(r'^api/announcement/(?P<pk>\d+)/dismiss$', AnnouncementDismiss.as_view()),
(r'^api/announcements$', AnnouncementList.as_view()),
)
| 0 | 0 | 0 |
3ac5dc8054ab1ad788fff41588e746ddd4a6b1bc | 5,373 | py | Python | main.py | tfreundo/TensorFlow_BasicImageClassification | c0526134bbaf9fd50f95a7ee69c3eecd434ae3af | [
"MIT"
] | null | null | null | main.py | tfreundo/TensorFlow_BasicImageClassification | c0526134bbaf9fd50f95a7ee69c3eecd434ae3af | [
"MIT"
] | null | null | null | main.py | tfreundo/TensorFlow_BasicImageClassification | c0526134bbaf9fd50f95a7ee69c3eecd434ae3af | [
"MIT"
] | null | null | null | # Implementation of the TensforFlow Tutorial for Basic Classification: https://www.tensorflow.org/tutorials/keras/basic_classification
# author: tfreundo
import tensorflow as tf
# High Level TF-API
from tensorflow import keras
import numpy as np
import matplotlib.pyplot as plot
# Parameters for Debugging and tweaking... | 38.934783 | 221 | 0.687512 | # Implementation of the TensforFlow Tutorial for Basic Classification: https://www.tensorflow.org/tutorials/keras/basic_classification
# author: tfreundo
import tensorflow as tf
# High Level TF-API
from tensorflow import keras
import numpy as np
import matplotlib.pyplot as plot
# Parameters for Debugging and tweaking... | 1,212 | 0 | 91 |
39a4ad7ac65bfb5b8a327c7d390102a859ca8556 | 31,179 | py | Python | CTFd/panSky.py | RealityAbb/panSky | fadf7063094f809f679d0bcaafbd161054b6b63b | [
"Apache-2.0"
] | null | null | null | CTFd/panSky.py | RealityAbb/panSky | fadf7063094f809f679d0bcaafbd161054b6b63b | [
"Apache-2.0"
] | null | null | null | CTFd/panSky.py | RealityAbb/panSky | fadf7063094f809f679d0bcaafbd161054b6b63b | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
import csv
from flask import render_template, request, redirect, abort, jsonify, url_for, session, flash, send_from_directory
from CTFd.utils import authed, judge_result, allowed_file, get_file_suffix
from CTFd.models import db, GoodBaseInfo, GoodSkuInfo, SkuProxyInfo, get_id, DisplayGoodInfo, getPlatfo... | 50.046549 | 166 | 0.596972 | # coding=utf-8
import csv
from flask import render_template, request, redirect, abort, jsonify, url_for, session, flash, send_from_directory
from CTFd.utils import authed, judge_result, allowed_file, get_file_suffix
from CTFd.models import db, GoodBaseInfo, GoodSkuInfo, SkuProxyInfo, get_id, DisplayGoodInfo, getPlatfo... | 30,268 | 0 | 138 |
0b4a57552c45af163e7d3c26f3f4f9242ef6ae01 | 1,686 | py | Python | jdcloud_sdk/services/asset/models/OperatingStatement.py | Tanc009/jdcloud-sdk-python | 8b045c99bc5b73ca7348e950b6f01e03a27982f5 | [
"Apache-2.0"
] | 14 | 2018-04-19T09:53:56.000Z | 2022-01-27T06:05:48.000Z | jdcloud_sdk/services/asset/models/OperatingStatement.py | Tanc009/jdcloud-sdk-python | 8b045c99bc5b73ca7348e950b6f01e03a27982f5 | [
"Apache-2.0"
] | 15 | 2018-09-11T05:39:54.000Z | 2021-07-02T12:38:02.000Z | jdcloud_sdk/services/asset/models/OperatingStatement.py | Tanc009/jdcloud-sdk-python | 8b045c99bc5b73ca7348e950b6f01e03a27982f5 | [
"Apache-2.0"
] | 33 | 2018-04-20T05:29:16.000Z | 2022-02-17T09:10:05.000Z | # coding=utf8
# Copyright 2018 JDCLOUD.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 required by applicable law or agreed ... | 40.142857 | 159 | 0.705813 | # coding=utf8
# Copyright 2018 JDCLOUD.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 required by applicable law or agreed ... | 0 | 1,232 | 23 |
b43840c4a6881b7a59cc381c4a30820b94ba3c43 | 287 | py | Python | ACME/visdom/create_session.py | mauriziokovacic/ACME | 2615b66dd4addfd5c03d9d91a24c7da414294308 | [
"MIT"
] | 3 | 2019-10-23T23:10:55.000Z | 2021-09-01T07:30:14.000Z | ACME/visdom/create_session.py | mauriziokovacic/ACME-Python | 2615b66dd4addfd5c03d9d91a24c7da414294308 | [
"MIT"
] | null | null | null | ACME/visdom/create_session.py | mauriziokovacic/ACME-Python | 2615b66dd4addfd5c03d9d91a24c7da414294308 | [
"MIT"
] | 1 | 2020-07-11T11:35:43.000Z | 2020-07-11T11:35:43.000Z | from visdom import Visdom
def create_session(**kwargs):
"""
Creates a visdom session
Parameters
----------
kwargs : ...
Returns
-------
object
a visdom session
"""
session = Visdom(**kwargs)
session.close(None)
return session
| 13.666667 | 30 | 0.547038 | from visdom import Visdom
def create_session(**kwargs):
"""
Creates a visdom session
Parameters
----------
kwargs : ...
Returns
-------
object
a visdom session
"""
session = Visdom(**kwargs)
session.close(None)
return session
| 0 | 0 | 0 |
add9bcd2370ae2572ca4ce5d88a51d08eee165cf | 15,626 | py | Python | geomloss/examples/sinkhorn_multiscale/plot_kernel_truncation.py | KingaS03/geomloss | 0f6dfa2ddde306337c85167543304bc3fe3e298d | [
"MIT"
] | null | null | null | geomloss/examples/sinkhorn_multiscale/plot_kernel_truncation.py | KingaS03/geomloss | 0f6dfa2ddde306337c85167543304bc3fe3e298d | [
"MIT"
] | 1 | 2021-07-15T12:43:21.000Z | 2021-07-15T12:43:21.000Z | geomloss/examples/sinkhorn_multiscale/plot_kernel_truncation.py | KingaS03/geomloss | 0f6dfa2ddde306337c85167543304bc3fe3e298d | [
"MIT"
] | null | null | null | """
2) Kernel truncation, log-linear runtimes
=====================================================
In the previous notebook, we've seen that **simulated annealing**
could be used to define efficient coarse-to-fine solvers
of the entropic :math:`\\text{OT}_\\varepsilon` problem.
Adapting ideas from `(Schmitzer, 2016) ... | 41.892761 | 131 | 0.656022 | """
2) Kernel truncation, log-linear runtimes
=====================================================
In the previous notebook, we've seen that **simulated annealing**
could be used to define efficient coarse-to-fine solvers
of the entropic :math:`\\text{OT}_\\varepsilon` problem.
Adapting ideas from `(Schmitzer, 2016) ... | 1,492 | 0 | 92 |
139ed1381680f6361644b12685a16d1038452c58 | 13,216 | py | Python | Impansible/Impansible3.py | AdamPrzybyla/Impansible | f34f190abce71de01a36a21dae0914cbd20ff51a | [
"MIT"
] | 2 | 2020-05-15T23:09:05.000Z | 2021-01-24T14:39:28.000Z | Impansible/Impansible3.py | AdamPrzybyla/Impansible | f34f190abce71de01a36a21dae0914cbd20ff51a | [
"MIT"
] | null | null | null | Impansible/Impansible3.py | AdamPrzybyla/Impansible | f34f190abce71de01a36a21dae0914cbd20ff51a | [
"MIT"
] | null | null | null | #!/usr/bin/python
from __future__ import absolute_import, division, print_function
import importlib,os,re,sys
from robot.libraries.BuiltIn import BuiltIn,RobotNotRunningError
from robot.api import logger
from ansible import modules
from .picker2 import picker2
from ansible.cli.adhoc import AdHocCLI as mycli
from ansibl... | 34.327273 | 139 | 0.617206 | #!/usr/bin/python
from __future__ import absolute_import, division, print_function
import importlib,os,re,sys
from robot.libraries.BuiltIn import BuiltIn,RobotNotRunningError
from robot.api import logger
from ansible import modules
from .picker2 import picker2
from ansible.cli.adhoc import AdHocCLI as mycli
from ansibl... | 2,253 | 19 | 306 |
b218eea9952ead221d9e4f1db7c0b0e4151c09e3 | 728 | py | Python | squad_client/utils.py | roxell/squad-client | e889f1adccce2be0eddfdee4b318672a82a53538 | [
"MIT"
] | null | null | null | squad_client/utils.py | roxell/squad-client | e889f1adccce2be0eddfdee4b318672a82a53538 | [
"MIT"
] | null | null | null | squad_client/utils.py | roxell/squad-client | e889f1adccce2be0eddfdee4b318672a82a53538 | [
"MIT"
] | null | null | null | import json
| 20.8 | 70 | 0.722527 | import json
def first(_dict):
if _dict is None or len(_dict) == 0:
return None
return next(iter(_dict.values()))
def parse_test_name(name):
suite_name, test_name = name.split('/', 1)
return (suite_name, test_name)
def parse_metric_name(name):
return parse_test_name(name)
def split_gr... | 548 | 0 | 161 |
c646aa1ca48a5bb4215bc89581b1b1a6564c1162 | 165 | py | Python | narcy/nlp/tenses.py | sztal/narcy | 18bfdcfb691c3505384f452479dee5fb6c93321e | [
"MIT"
] | 13 | 2019-04-17T13:44:33.000Z | 2021-03-17T23:23:15.000Z | narcy/nlp/tenses.py | sztal/narcy | 18bfdcfb691c3505384f452479dee5fb6c93321e | [
"MIT"
] | 1 | 2019-03-17T16:29:14.000Z | 2019-03-17T16:29:14.000Z | narcy/nlp/tenses.py | sztal/narcy | 18bfdcfb691c3505384f452479dee5fb6c93321e | [
"MIT"
] | 1 | 2020-01-08T11:35:03.000Z | 2020-01-08T11:35:03.000Z | """Tense analysis and detection related utilities."""
# pylint: disable=E0611
PRESENT = 'PRESENT'
PAST = 'PAST'
FUTURE = 'FUTURE'
MODAL = 'MODAL'
NORMAL = 'NORMAL'
| 18.333333 | 53 | 0.69697 | """Tense analysis and detection related utilities."""
# pylint: disable=E0611
PRESENT = 'PRESENT'
PAST = 'PAST'
FUTURE = 'FUTURE'
MODAL = 'MODAL'
NORMAL = 'NORMAL'
| 0 | 0 | 0 |
1b9b165b3e3e389ac1422f7563d7f4725c48318d | 36 | py | Python | services/backend/thiamsu/settings/dev.py | LKKTGB/thiamsu | f08d453c6b35c801c57f2501e42565da56900814 | [
"MIT"
] | 10 | 2020-08-25T08:57:36.000Z | 2021-12-31T01:04:18.000Z | services/backend/thiamsu/settings/dev.py | LKKTGB/thiamsu | f08d453c6b35c801c57f2501e42565da56900814 | [
"MIT"
] | 13 | 2020-04-26T08:41:30.000Z | 2021-06-10T17:34:25.000Z | services/backend/thiamsu/settings/dev.py | LKKTGB/thiamsu | f08d453c6b35c801c57f2501e42565da56900814 | [
"MIT"
] | 1 | 2020-09-06T17:54:13.000Z | 2020-09-06T17:54:13.000Z | from thiamsu.settings.base import *
| 18 | 35 | 0.805556 | from thiamsu.settings.base import *
| 0 | 0 | 0 |
616ba45a89e198aa88a7dfdeabbeb7d806c09f29 | 839 | py | Python | finrl/exchange/__init__.py | JuohmaruSanshiro/FinRL-Library | d62fd577a0be37e1daffdc5ba10862e42b38e04b | [
"MIT"
] | 2 | 2021-03-16T02:33:57.000Z | 2021-04-01T02:09:49.000Z | finrl/exchange/__init__.py | JuohmaruSanshiro/FinRL-Library | d62fd577a0be37e1daffdc5ba10862e42b38e04b | [
"MIT"
] | null | null | null | finrl/exchange/__init__.py | JuohmaruSanshiro/FinRL-Library | d62fd577a0be37e1daffdc5ba10862e42b38e04b | [
"MIT"
] | 2 | 2021-03-16T07:04:33.000Z | 2021-12-19T09:12:10.000Z | # flake8: noqa: F401
# isort: off
from finrl.exchange.common import MAP_EXCHANGE_CHILDCLASS
from finrl.exchange.exchange import Exchange
# isort: on
from finrl.exchange.bibox import Bibox
from finrl.exchange.binance import Binance
from finrl.exchange.bittrex import Bittrex
from finrl.exchange.exchange import (available... | 49.352941 | 96 | 0.673421 | # flake8: noqa: F401
# isort: off
from finrl.exchange.common import MAP_EXCHANGE_CHILDCLASS
from finrl.exchange.exchange import Exchange
# isort: on
from finrl.exchange.bibox import Bibox
from finrl.exchange.binance import Binance
from finrl.exchange.bittrex import Bittrex
from finrl.exchange.exchange import (available... | 0 | 0 | 0 |
536b4d6a4a6666359b90e191a3d593250b44e863 | 1,253 | py | Python | data_utils/augmentor/impulse_response.py | limpidezza/DeepSpeech | b3c728d46ff4eee68c45f20b0abb76e968008bcb | [
"Apache-2.0"
] | 45 | 2020-02-24T14:34:44.000Z | 2022-03-08T08:33:56.000Z | data_utils/augmentor/impulse_response.py | limpidezza/DeepSpeech | b3c728d46ff4eee68c45f20b0abb76e968008bcb | [
"Apache-2.0"
] | 2 | 2019-03-20T07:17:27.000Z | 2020-11-27T08:33:30.000Z | data_utils/augmentor/impulse_response.py | limpidezza/DeepSpeech | b3c728d46ff4eee68c45f20b0abb76e968008bcb | [
"Apache-2.0"
] | 12 | 2020-03-09T13:23:47.000Z | 2022-01-24T05:45:25.000Z | """Contains the impulse response augmentation model."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from data_utils.augmentor.base import AugmentorBase
from data_utils.utility import read_manifest
from data_utils.audio import AudioSegment
class Impulse... | 35.8 | 80 | 0.75419 | """Contains the impulse response augmentation model."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from data_utils.augmentor.base import AugmentorBase
from data_utils.utility import read_manifest
from data_utils.audio import AudioSegment
class Impulse... | 120 | 0 | 27 |
fe96e0e1fcc166d5bddd8fd1c46d81292e038d07 | 1,471 | py | Python | knnimpute/common.py | DeoLeung/knnimpute | 0c5ba220cb0e21940a22d903987334e4022661de | [
"Apache-2.0"
] | null | null | null | knnimpute/common.py | DeoLeung/knnimpute | 0c5ba220cb0e21940a22d903987334e4022661de | [
"Apache-2.0"
] | null | null | null | knnimpute/common.py | DeoLeung/knnimpute | 0c5ba220cb0e21940a22d903987334e4022661de | [
"Apache-2.0"
] | null | null | null | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | 39.756757 | 76 | 0.74915 | # Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under th... | 0 | 0 | 0 |
bc5fd5d2e487f436fa4382e8db5f72232b9d6c7b | 371 | py | Python | helpers/command_methods.py | pgmikhael/GeneticVariant | 90db9ac7593ba300713bf21b2c56e6a517ef93d2 | [
"MIT"
] | null | null | null | helpers/command_methods.py | pgmikhael/GeneticVariant | 90db9ac7593ba300713bf21b2c56e6a517ef93d2 | [
"MIT"
] | null | null | null | helpers/command_methods.py | pgmikhael/GeneticVariant | 90db9ac7593ba300713bf21b2c56e6a517ef93d2 | [
"MIT"
] | null | null | null | import torch
import os.path
from datasets.dataset_factory import get_dataset
from torch.utils.data import DataLoader
import copy
from tqdm import tqdm
| 24.733333 | 58 | 0.752022 | import torch
import os.path
from datasets.dataset_factory import get_dataset
from torch.utils.data import DataLoader
import copy
from tqdm import tqdm
def get_dataset_stats(args):
args = copy.deepcopy(args)
args.computing_stats = True
train = get_dataset(args, 'train')
string_lens = [len(row['x']) for ... | 196 | 0 | 23 |
78b15bfa61c9f0a0ac60ea17100b87dc3a38c869 | 2,641 | py | Python | object_database/web/cells_demo/sized.py | APrioriInvestments/object_database | d44b8432490b36b1ace67de0e23fb59f7ce9b529 | [
"Apache-2.0"
] | 2 | 2021-02-23T18:28:40.000Z | 2021-04-18T03:00:53.000Z | object_database/web/cells_demo/sized.py | APrioriInvestments/object_database | d44b8432490b36b1ace67de0e23fb59f7ce9b529 | [
"Apache-2.0"
] | 115 | 2019-10-08T18:32:58.000Z | 2021-02-12T20:16:14.000Z | object_database/web/cells_demo/sized.py | APrioriInvestments/object_database | d44b8432490b36b1ace67de0e23fb59f7ce9b529 | [
"Apache-2.0"
] | null | null | null | # Copyright 2017-2020 object_database 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 ... | 34.75 | 93 | 0.664142 | # Copyright 2017-2020 object_database 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 ... | 1,441 | 95 | 380 |
61fe9e6e1b690bbecc7f6cef0de9cc43d76cfcaf | 1,079 | py | Python | signin.py | panzihan/signin | e0014207c12890230df69730498ad83128d22617 | [
"Apache-2.0"
] | null | null | null | signin.py | panzihan/signin | e0014207c12890230df69730498ad83128d22617 | [
"Apache-2.0"
] | null | null | null | signin.py | panzihan/signin | e0014207c12890230df69730498ad83128d22617 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# coding=utf-8
from urllib import request
import json
| 29.162162 | 75 | 0.508804 | #!/usr/bin/python
# coding=utf-8
from urllib import request
import json
def signin(dict, cookie):
host = dict["host"]
if host:
print(host)
url = "http://" + dict["host"] + dict["url"]
print(url)
req = request.Request(url, method="POST")
headers = dict["headers"]
... | 959 | 0 | 46 |
4185180f87bd862a3f91bec6052890ae83da020e | 2,398 | py | Python | spectre/utils.py | Bit03/django-spectre | 5f64cc82415458ca62cb86060f2476061b853639 | [
"MIT"
] | null | null | null | spectre/utils.py | Bit03/django-spectre | 5f64cc82415458ca62cb86060f2476061b853639 | [
"MIT"
] | null | null | null | spectre/utils.py | Bit03/django-spectre | 5f64cc82415458ca62cb86060f2476061b853639 | [
"MIT"
] | null | null | null | from django.forms.utils import flatatt
from django.utils import six
from django.utils.encoding import force_text, force_str
from django.utils.html import format_html
from django.utils.http import urlencode
from django.utils.safestring import mark_safe
try:
from urlparse import urlparse, parse_qs, urlunparse
except... | 28.211765 | 89 | 0.649291 | from django.forms.utils import flatatt
from django.utils import six
from django.utils.encoding import force_text, force_str
from django.utils.html import format_html
from django.utils.http import urlencode
from django.utils.safestring import mark_safe
try:
from urlparse import urlparse, parse_qs, urlunparse
except... | 0 | 0 | 0 |
a2b9821d4307e2037bcd7b3dc9aea06b6aaf7265 | 1,392 | py | Python | RQ3/ncs_baseline/test.py | BuiltOntheRock/FSE22_BuiltOntheRock | 84e1ccefa01e5de610924ca8619999f93bcf80c2 | [
"BSD-Source-Code"
] | null | null | null | RQ3/ncs_baseline/test.py | BuiltOntheRock/FSE22_BuiltOntheRock | 84e1ccefa01e5de610924ca8619999f93bcf80c2 | [
"BSD-Source-Code"
] | null | null | null | RQ3/ncs_baseline/test.py | BuiltOntheRock/FSE22_BuiltOntheRock | 84e1ccefa01e5de610924ca8619999f93bcf80c2 | [
"BSD-Source-Code"
] | null | null | null | import javalang
import json
from tqdm import tqdm
import re
# def concatParentheses(code_list):
# temp_code = ''
# new_code_list = []
# for code in code_list:
# code = code.strip()
# if temp_code == '' and code != '{' and code != '}':
with open(f'./../../../../Downloads/code2comment_dat... | 29 | 110 | 0.586925 | import javalang
import json
from tqdm import tqdm
import re
# def concatParentheses(code_list):
# temp_code = ''
# new_code_list = []
# for code in code_list:
# code = code.strip()
# if temp_code == '' and code != '{' and code != '}':
def tokenize_with_camel_case(token):
matches = re.... | 189 | 0 | 46 |
4e641f13cbc9f066fc0946b737e6b0dc8cf79344 | 4,984 | py | Python | src/lib/Bcfg2/Server/Hostbase/settings.py | amplify-education/bcfg2 | 02d7f574babfeb2da99e2aad3a92b4e8d6494f07 | [
"mpich2"
] | null | null | null | src/lib/Bcfg2/Server/Hostbase/settings.py | amplify-education/bcfg2 | 02d7f574babfeb2da99e2aad3a92b4e8d6494f07 | [
"mpich2"
] | null | null | null | src/lib/Bcfg2/Server/Hostbase/settings.py | amplify-education/bcfg2 | 02d7f574babfeb2da99e2aad3a92b4e8d6494f07 | [
"mpich2"
] | null | null | null | import os.path
# Compatibility import
from Bcfg2.Bcfg2Py3k import ConfigParser
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
c = ConfigParser.ConfigParser()
#This needs to be configurable one day somehow
c.read(['./bcfg2.conf'])
defaults = {'database_engine':'sqlite3',
'database_name':'./dev.... | 34.611111 | 83 | 0.7189 | import os.path
# Compatibility import
from Bcfg2.Bcfg2Py3k import ConfigParser
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
c = ConfigParser.ConfigParser()
#This needs to be configurable one day somehow
c.read(['./bcfg2.conf'])
defaults = {'database_engine':'sqlite3',
'database_name':'./dev.... | 0 | 0 | 0 |
6a04b1894020002b5955cd936f00948a5c560f3b | 2,894 | py | Python | server/tests/tests_login.py | franchais3226/coral | 82ff6290658741fc77464b7641b482075a78a925 | [
"MIT"
] | 2 | 2016-04-16T23:57:50.000Z | 2016-12-14T21:55:32.000Z | server/tests/tests_login.py | franchais3226/coral | 82ff6290658741fc77464b7641b482075a78a925 | [
"MIT"
] | 1 | 2016-03-31T23:44:05.000Z | 2016-03-31T23:44:05.000Z | server/tests/tests_login.py | franchais3226/coral | 82ff6290658741fc77464b7641b482075a78a925 | [
"MIT"
] | 9 | 2016-02-01T23:00:24.000Z | 2020-07-30T14:39:01.000Z | """This script handles test cases for the login module"""
import unittest
from flask import request, session
from app.views import create_app
class LoginTestCase(unittest.TestCase):
"""Login Feature specific Test Cases will go here"""
def setUp(self):
"""Setup test app"""
self.app = create_a... | 37.584416 | 74 | 0.577402 | """This script handles test cases for the login module"""
import unittest
from flask import request, session
from app.views import create_app
class LoginTestCase(unittest.TestCase):
"""Login Feature specific Test Cases will go here"""
def setUp(self):
"""Setup test app"""
self.app = create_a... | 0 | 0 | 0 |
055179ce006c04c78590d60ba0fc939fa3401518 | 286 | py | Python | pages/urls.py | mp5maker/heroku-django | 533cc6a7378e60b082d73f91b5c76780736a21b1 | [
"MIT"
] | null | null | null | pages/urls.py | mp5maker/heroku-django | 533cc6a7378e60b082d73f91b5c76780736a21b1 | [
"MIT"
] | 13 | 2020-02-12T00:14:20.000Z | 2022-02-10T08:46:42.000Z | simpleapp/pages/urls.py | mp5maker/django | a2d38e2e9973e755afce1bd0ccb17e58f3db7e33 | [
"MIT"
] | null | null | null | from django.urls import path
from .views import (testPageView, HomePageView, AboutPageView)
app_name = "pages"
urlpatterns = [
path('', HomePageView.as_view(), name="home"),
path('about/', AboutPageView.as_view(), name="about"),
path('test/', testPageView, name="test")
] | 26 | 62 | 0.688811 | from django.urls import path
from .views import (testPageView, HomePageView, AboutPageView)
app_name = "pages"
urlpatterns = [
path('', HomePageView.as_view(), name="home"),
path('about/', AboutPageView.as_view(), name="about"),
path('test/', testPageView, name="test")
] | 0 | 0 | 0 |
530963ad389edbdbf2ad6639468262c976a8bf0d | 344 | py | Python | airflow/plugins/operators/__init__.py | abelkartwii/warehouse | 0ca37b49cea2ae9dfd5c65afa77ac187f9dc01e5 | [
"MIT"
] | null | null | null | airflow/plugins/operators/__init__.py | abelkartwii/warehouse | 0ca37b49cea2ae9dfd5c65afa77ac187f9dc01e5 | [
"MIT"
] | null | null | null | airflow/plugins/operators/__init__.py | abelkartwii/warehouse | 0ca37b49cea2ae9dfd5c65afa77ac187f9dc01e5 | [
"MIT"
] | null | null | null | from operators.sourcetoredshift import SourceToRedshiftOperator
from operators.createtables import CreateTablesOperator
from operators.loadfact import FactOperator
from operators.loaddimension import DimensionOperator
__all__ = [
'SourceToRedshiftOperator',
'CreateTablesOperator'
'LoadFactOperator',
'L... | 31.272727 | 63 | 0.831395 | from operators.sourcetoredshift import SourceToRedshiftOperator
from operators.createtables import CreateTablesOperator
from operators.loadfact import FactOperator
from operators.loaddimension import DimensionOperator
__all__ = [
'SourceToRedshiftOperator',
'CreateTablesOperator'
'LoadFactOperator',
'L... | 0 | 0 | 0 |
436e7f357b002f725491263a49a0e8103f9752d9 | 538 | py | Python | 2019/06/1/process.py | andrewelkins/advent-of-code | 2c04f53f86a919b1dee0d95971f6502a03d25d74 | [
"MIT"
] | null | null | null | 2019/06/1/process.py | andrewelkins/advent-of-code | 2c04f53f86a919b1dee0d95971f6502a03d25d74 | [
"MIT"
] | null | null | null | 2019/06/1/process.py | andrewelkins/advent-of-code | 2c04f53f86a919b1dee0d95971f6502a03d25d74 | [
"MIT"
] | null | null | null | # https://adventofcode.com/2019/day/6
import os
orbit_data = {}
with open(os.path.join(os.path.dirname(__file__), "../data.txt"), "r") as f:
for line in f:
# child > parent
relation = line.strip().split(")")
orbit_data[relation[1]] = relation[0]
print(process(orbit_data))
| 20.692308 | 76 | 0.581784 | # https://adventofcode.com/2019/day/6
import os
def process(data):
count = 0
for planet in data.keys():
num_orbits = 1
while data[planet] in data:
num_orbits += 1
planet = data[planet]
count += num_orbits
return count
orbit_data = {}
with open(os.path.joi... | 208 | 0 | 23 |
96a8cc8ff06cd4fb2028dfb0c9831e3e3a456176 | 5,895 | py | Python | tests/unit/test_config.py | oglok/CPU-Manager-for-Kubernetes | 503f37dcb20452699ce789b6628fa3ebeb9ffb54 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_config.py | oglok/CPU-Manager-for-Kubernetes | 503f37dcb20452699ce789b6628fa3ebeb9ffb54 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_config.py | oglok/CPU-Manager-for-Kubernetes | 503f37dcb20452699ce789b6628fa3ebeb9ffb54 | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 29.183168 | 74 | 0.546904 | # Copyright (c) 2017 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to i... | 4,920 | 0 | 276 |
5ab36515e6bca44c0b06c9c083f6fc7d38fa3ff3 | 6,471 | py | Python | stereo3d/stereo3d/stereocapture/pyloncapture.py | bknight-i3drobotics/Stereo3D | 3f7fa5902590397d5ff67f2ab1efdcced08f8501 | [
"MIT"
] | 3 | 2020-11-29T21:48:52.000Z | 2021-04-17T02:59:58.000Z | stereo3d/stereo3d/stereocapture/pyloncapture.py | bknight-i3drobotics/Stereo3D | 3f7fa5902590397d5ff67f2ab1efdcced08f8501 | [
"MIT"
] | 6 | 2020-02-07T09:52:00.000Z | 2020-04-29T14:51:03.000Z | stereo3d/stereo3d/stereocapture/pyloncapture.py | bknight-i3drobotics/Stereo3D | 3f7fa5902590397d5ff67f2ab1efdcced08f8501 | [
"MIT"
] | 2 | 2020-06-24T05:52:31.000Z | 2020-10-29T05:16:25.000Z | import cv2
import numpy as np
from pypylon import pylon
from threading import Lock
# Image event handler.
if __name__ == '__main__':
CAMERA_SERIAL = "23517286"
cam = PylonCapture(CAMERA_SERIAL)
cam.connect()
while True:
res, image = cam.grab()
if res:
image_resized = cv2.r... | 38.748503 | 124 | 0.620306 | import cv2
import numpy as np
from pypylon import pylon
from threading import Lock
# Image event handler.
class PylonImageEventHandler(pylon.ImageEventHandler):
def __init__(self):
super().__init__()
self.image_mutex = Lock()
with self.image_mutex:
self.image = np.array([])
... | 401 | 5,455 | 125 |
ac3a67f89fca54b0db033102b8bddf46933e98bc | 1,589 | py | Python | P1-test02/gaussianBlur.py | 1924zjy0835/OpenCV | 15d0407b12e825949a7e0fa2a1c775aa24edb943 | [
"bzip2-1.0.6"
] | null | null | null | P1-test02/gaussianBlur.py | 1924zjy0835/OpenCV | 15d0407b12e825949a7e0fa2a1c775aa24edb943 | [
"bzip2-1.0.6"
] | null | null | null | P1-test02/gaussianBlur.py | 1924zjy0835/OpenCV | 15d0407b12e825949a7e0fa2a1c775aa24edb943 | [
"bzip2-1.0.6"
] | null | null | null | # @Description: gaussianBlur.py
# @Author: 孤烟逐云zjy
# @Date: 2020/4/23 9:21
# @SoftWare: PyCharm
# @CSDN: https://blog.csdn.net/zjy123078_zjy
# @博客园: https://www.cnblogs.com/guyan-2020/
import cv2 as cv
import numpy as np
src = cv.imread("./images/raindropGirl.jpg")
# 统计时间
# getTickCount()函数返回操作系统启动到当前所经过的计时周期数
... | 24.828125 | 80 | 0.631844 | # @Description: gaussianBlur.py
# @Author: 孤烟逐云zjy
# @Date: 2020/4/23 9:21
# @SoftWare: PyCharm
# @CSDN: https://blog.csdn.net/zjy123078_zjy
# @博客园: https://www.cnblogs.com/guyan-2020/
import cv2 as cv
import numpy as np
def Gaussian_demo(image):
dst = cv.GaussianBlur(image, (0, 0), 3)
cv.imshow("Gaussian im... | 899 | 0 | 69 |
b928ad824c590f5b8f3b04c8ca60bc99681e0e7f | 8,614 | py | Python | venv/lib/python3.6/site-packages/ansible_collections/community/general/tests/unit/plugins/modules/web_infrastructure/test_jenkins_plugin.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 22 | 2021-07-16T08:11:22.000Z | 2022-03-31T07:15:34.000Z | venv/lib/python3.6/site-packages/ansible_collections/community/general/tests/unit/plugins/modules/web_infrastructure/test_jenkins_plugin.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | venv/lib/python3.6/site-packages/ansible_collections/community/general/tests/unit/plugins/modules/web_infrastructure/test_jenkins_plugin.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 39 | 2021-07-05T02:31:42.000Z | 2022-03-31T02:46:03.000Z | # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from io import BytesIO
from ansible_collections.community.general.plugins.modules.web_infrastructure.jenkins_plugin import JenkinsPlugin... | 45.099476 | 131 | 0.702461 | # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
from io import BytesIO
from ansible_collections.community.general.plugins.modules.web_infrastructure.jenkins_plugin import JenkinsPlugin... | 146 | 0 | 46 |
5680a8a2bbadc0d1d81ff0c91c94c9f6abdd131c | 15,845 | py | Python | keystone-moon/keystone/identity/backends/sql.py | hashnfv/hashnfv-moon | daaba34fa2ed4426bc0fde359e54a5e1b872208c | [
"Apache-2.0"
] | null | null | null | keystone-moon/keystone/identity/backends/sql.py | hashnfv/hashnfv-moon | daaba34fa2ed4426bc0fde359e54a5e1b872208c | [
"Apache-2.0"
] | null | null | null | keystone-moon/keystone/identity/backends/sql.py | hashnfv/hashnfv-moon | daaba34fa2ed4426bc0fde359e54a5e1b872208c | [
"Apache-2.0"
] | null | null | null | # Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 39.317618 | 78 | 0.607195 | # Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 8,946 | 5,459 | 138 |
7115e70e58becc7427f1eb25d9e80689128d74b6 | 1,348 | py | Python | kernel_tuner/strategies/brute_force.py | mfkiwl/kernel_tuner | 7f2bdc85a9c355d38b04dba1ce518fba1d65ffb7 | [
"Apache-2.0"
] | null | null | null | kernel_tuner/strategies/brute_force.py | mfkiwl/kernel_tuner | 7f2bdc85a9c355d38b04dba1ce518fba1d65ffb7 | [
"Apache-2.0"
] | null | null | null | kernel_tuner/strategies/brute_force.py | mfkiwl/kernel_tuner | 7f2bdc85a9c355d38b04dba1ce518fba1d65ffb7 | [
"Apache-2.0"
] | null | null | null | """ The default strategy that iterates through the whole parameter space """
from __future__ import print_function
from kernel_tuner.searchspace import Searchspace
def tune(runner, kernel_options, device_options, tuning_options):
""" Tune all instances in the parameter space
:params runner: A runner from ke... | 35.473684 | 81 | 0.751484 | """ The default strategy that iterates through the whole parameter space """
from __future__ import print_function
from kernel_tuner.searchspace import Searchspace
def tune(runner, kernel_options, device_options, tuning_options):
""" Tune all instances in the parameter space
:params runner: A runner from ke... | 0 | 0 | 0 |
e0e831709862b42cb5206e8e6dec527ea59fa850 | 2,065 | py | Python | Insert a node at the head of a linked list.py | ganeshbs17/PythonAndCPP-Programs | 7a00c3fad84dc2e721e29732f998e151bd122213 | [
"MIT"
] | null | null | null | Insert a node at the head of a linked list.py | ganeshbs17/PythonAndCPP-Programs | 7a00c3fad84dc2e721e29732f998e151bd122213 | [
"MIT"
] | null | null | null | Insert a node at the head of a linked list.py | ganeshbs17/PythonAndCPP-Programs | 7a00c3fad84dc2e721e29732f998e151bd122213 | [
"MIT"
] | 3 | 2019-10-23T05:23:20.000Z | 2020-10-04T16:47:45.000Z | #include <bits/stdc++.h>
using namespace std;
};
class SinglyLinkedList {
public:
SinglyLinkedListNode *head;
SinglyLinkedListNode *tail;
SinglyLinkedList() {
this->head = nullptr;
this->tail = nullptr;
}
};
void print_singly_linked_list(SinglyLinkedListN... | 19.481132 | 91 | 0.605327 | #include <bits/stdc++.h>
using namespace std;
class SinglyLinkedListNode {
public:
int data;
SinglyLinkedListNode *next;
SinglyLinkedListNode(int node_data) {
this->data = node_data;
this->next = nullptr;
}
};
class SinglyLinkedList {
public:
S... | 0 | 200 | 23 |
4f73efb041d7c76dd96a6426250a9aef186f29ce | 7,513 | py | Python | compss/programming_model/bindings/python/src/pycompss/util/logger/helpers.py | alexbarcelo/compss | d619faa70ac5a933543c6f8ef65e8acd18ae37a0 | [
"Apache-2.0"
] | 31 | 2018-03-06T09:30:03.000Z | 2022-03-23T09:51:05.000Z | compss/programming_model/bindings/python/src/pycompss/util/logger/helpers.py | alexbarcelo/compss | d619faa70ac5a933543c6f8ef65e8acd18ae37a0 | [
"Apache-2.0"
] | 3 | 2020-08-28T17:16:50.000Z | 2021-11-11T21:58:02.000Z | compss/programming_model/bindings/python/src/pycompss/util/logger/helpers.py | alexbarcelo/compss | d619faa70ac5a933543c6f8ef65e8acd18ae37a0 | [
"Apache-2.0"
] | 15 | 2018-06-07T10:03:27.000Z | 2022-02-23T14:59:42.000Z | #!/usr/bin/python
#
# Copyright 2002-2021 Barcelona Supercomputing Center (www.bsc.es)
#
# 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
... | 33.842342 | 86 | 0.639957 | #!/usr/bin/python
#
# Copyright 2002-2021 Barcelona Supercomputing Center (www.bsc.es)
#
# 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
... | 0 | 0 | 0 |
4608bc73b70fb733f1ae3c3c23c3493edaa536d9 | 336 | py | Python | algorithms/recursion/double.py | Nyior/algorithms-and-datastructures-python | f970e9955e6305cf92c317e60acfbf391af04a96 | [
"MIT"
] | 1 | 2022-01-07T18:04:26.000Z | 2022-01-07T18:04:26.000Z | algorithms/recursion/double.py | Nyior/algorithms-and-datastructures-python | f970e9955e6305cf92c317e60acfbf391af04a96 | [
"MIT"
] | null | null | null | algorithms/recursion/double.py | Nyior/algorithms-and-datastructures-python | f970e9955e6305cf92c317e60acfbf391af04a96 | [
"MIT"
] | null | null | null | """
double each entry in a given array recursively
E.g [1, 2, 3, 4, 5]
"""
if __name__ == '__main__':
a = [1,2,3,4,5]
print(double_entries(a))
| 17.684211 | 50 | 0.559524 | """
double each entry in a given array recursively
E.g [1, 2, 3, 4, 5]
"""
def double_entries(arr, index=0):
if index >= len(arr):
return arr
else:
arr[index] = arr[index]*2
return(double_entries(arr, index+1))
if __name__ == '__main__':
a = [1,2,3,4,5]
print(double_... | 147 | 0 | 23 |
6edb38a0c548bba69e006641892021a624d7a0c7 | 4,747 | py | Python | src/rlext/record.py | kngwyu/rlext | b7e74ba4b440d2c6f98ea79dcd0aab15053fa96a | [
"Apache-2.0"
] | null | null | null | src/rlext/record.py | kngwyu/rlext | b7e74ba4b440d2c6f98ea79dcd0aab15053fa96a | [
"Apache-2.0"
] | null | null | null | src/rlext/record.py | kngwyu/rlext | b7e74ba4b440d2c6f98ea79dcd0aab15053fa96a | [
"Apache-2.0"
] | null | null | null | """ Record class that stores {Key: List[Value]} dict
"""
import atexit
import typing as t
from collections import defaultdict
from pathlib import Path
import click
import pandas as pd
_SAVE_FN = t.Callable[[pd.DataFrame, Path], None]
class Record:
"""Available colors: black, red, green, yellow, blue, magent... | 31.646667 | 85 | 0.579524 | """ Record class that stores {Key: List[Value]} dict
"""
import atexit
import typing as t
from collections import defaultdict
from pathlib import Path
import click
import pandas as pd
_SAVE_FN = t.Callable[[pd.DataFrame, Path], None]
class _StdoutConfig(t.NamedTuple):
interval: int
indices: t.List[str]
... | 3,892 | 88 | 308 |
c094ef08a8e704d75e9565ff5d971f9bc5c63dd1 | 129 | py | Python | aioxmpp/__init__.py | pyos/libstuff | 17e8bf676b7c99c33022e44db99ad82b2efd4989 | [
"MIT"
] | null | null | null | aioxmpp/__init__.py | pyos/libstuff | 17e8bf676b7c99c33022e44db99ad82b2efd4989 | [
"MIT"
] | null | null | null | aioxmpp/__init__.py | pyos/libstuff | 17e8bf676b7c99c33022e44db99ad82b2efd4989 | [
"MIT"
] | null | null | null | import dg
from .xmlio import XMLProtocol, Node
from .xmpp import client, Client, JabberID, XMPPError, XMPPMessage, XMPPPresence
| 32.25 | 81 | 0.806202 | import dg
from .xmlio import XMLProtocol, Node
from .xmpp import client, Client, JabberID, XMPPError, XMPPMessage, XMPPPresence
| 0 | 0 | 0 |
7110f56604c978bbb9d0ce3e1ac9f0e064c6b0f2 | 880 | py | Python | cadee/dyn/mpi.py | kamerlinlab/cadee | 8fa34fc4f7fc496c8843e9380075ae11fca7aaa7 | [
"MIT"
] | 10 | 2017-01-11T09:21:27.000Z | 2021-06-27T03:56:15.000Z | cadee/dyn/mpi.py | kamerlinlab/cadee | 8fa34fc4f7fc496c8843e9380075ae11fca7aaa7 | [
"MIT"
] | 2 | 2017-07-18T06:54:17.000Z | 2020-08-25T14:03:14.000Z | cadee/dyn/mpi.py | kamerlinlab/cadee | 8fa34fc4f7fc496c8843e9380075ae11fca7aaa7 | [
"MIT"
] | 3 | 2017-03-15T12:18:13.000Z | 2021-02-28T05:09:36.000Z | #!/usr/bin/env python
"""
Module for coordinating mpi
Author: {0} ({1})
This program is part of CADEE, the framework for
Computer-Aided Directed Evolution of Enzymes.
"""
__author__ = "Beat Amrein"
__email__ = "beat.amrein@gmail.com"
try:
from mpi4py import MPI
except ImportError:
print('mpi4py not found'... | 16.296296 | 48 | 0.585227 | #!/usr/bin/env python
"""
Module for coordinating mpi
Author: {0} ({1})
This program is part of CADEE, the framework for
Computer-Aided Directed Evolution of Enzymes.
"""
__author__ = "Beat Amrein"
__email__ = "beat.amrein@gmail.com"
try:
from mpi4py import MPI
except ImportError:
print('mpi4py not found'... | 135 | 0 | 23 |
c5d3fa903abb0c65b709cbe5d59268fb4a50a6b8 | 1,992 | py | Python | demo_autolog.py | arjunKumbakkara/AiOPs_MLFlow_02 | 617bbcf2fa6089f8b32b7d55eacd3a699d83b7c5 | [
"MIT"
] | null | null | null | demo_autolog.py | arjunKumbakkara/AiOPs_MLFlow_02 | 617bbcf2fa6089f8b32b7d55eacd3a699d83b7c5 | [
"MIT"
] | null | null | null | demo_autolog.py | arjunKumbakkara/AiOPs_MLFlow_02 | 617bbcf2fa6089f8b32b7d55eacd3a699d83b7c5 | [
"MIT"
] | null | null | null | from email.policy import default
from email.utils import parsedate
import os
import mlflow
import mlflow.sklearn
import argparse
import time
import numpy as np
import pandas as pd
from sklearn.metrics import mean_absolute_percentage_error, mean_squared_error, mean_absolute_error,r2_score
from sklearn.model_selection i... | 31.619048 | 108 | 0.697289 | from email.policy import default
from email.utils import parsedate
import os
import mlflow
import mlflow.sklearn
import argparse
import time
import numpy as np
import pandas as pd
from sklearn.metrics import mean_absolute_percentage_error, mean_squared_error, mean_absolute_error,r2_score
from sklearn.model_selection i... | 1,216 | 0 | 69 |
dbe977caaa121b5054f9b31918994075c6e0496e | 1,328 | py | Python | cis385_week8_testing/test/test_calendar.py | bendalgaard/cis385_2021Winter | db80e65ad26899daaeddb3c262f881ed1f967f58 | [
"Apache-2.0"
] | null | null | null | cis385_week8_testing/test/test_calendar.py | bendalgaard/cis385_2021Winter | db80e65ad26899daaeddb3c262f881ed1f967f58 | [
"Apache-2.0"
] | null | null | null | cis385_week8_testing/test/test_calendar.py | bendalgaard/cis385_2021Winter | db80e65ad26899daaeddb3c262f881ed1f967f58 | [
"Apache-2.0"
] | null | null | null | import unittest
from datetime import datetime
from unittest.mock import MagicMock
from app.main import calendar
from app.main.holiday import Holiday
if __name__ == '__main__':
unittest.main()
| 34.051282 | 123 | 0.731928 | import unittest
from datetime import datetime
from unittest.mock import MagicMock
from app.main import calendar
from app.main.holiday import Holiday
class TestCalendar(unittest.TestCase):
def setUp(self):
holiday = Holiday()
holiday.is_new_year_observed = MagicMock(return_value=False)
def t... | 953 | 17 | 158 |
bc29b8cf03567460e6712946090a077ce1db7618 | 73,609 | py | Python | zeitcoinamp.py | mmgrant73/zeitcoin | ae04d37e66c2f278c9c83525eb0d0d1c6ecf9fe0 | [
"MIT"
] | 1 | 2017-07-03T17:00:16.000Z | 2017-07-03T17:00:16.000Z | zeitcoinamp.py | mmgrant73/zeitcoin | ae04d37e66c2f278c9c83525eb0d0d1c6ecf9fe0 | [
"MIT"
] | null | null | null | zeitcoinamp.py | mmgrant73/zeitcoin | ae04d37e66c2f278c9c83525eb0d0d1c6ecf9fe0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#########################################
# Zeitcoin AMP Class
#########################################
import sys, os, time, threading, hashlib, random
from zeitcoindb import hashtable
from zeitcoinutility import utility,encyption
from zeitcointrans import transactions
from twisted.protocols im... | 36.458148 | 223 | 0.712318 | #!/usr/bin/env python
#########################################
# Zeitcoin AMP Class
#########################################
import sys, os, time, threading, hashlib, random
from zeitcoindb import hashtable
from zeitcoinutility import utility,encyption
from zeitcointrans import transactions
from twisted.protocols im... | 60,937 | 8,905 | 1,622 |
6cd330f60a8b08f48db45ee75488aa436167703b | 763 | py | Python | tests/test_loader.py | zenaix/ICSuit | 792b498df7f0e700b77f147e4f888b950f3ba296 | [
"Apache-2.0"
] | 1 | 2021-02-21T11:19:23.000Z | 2021-02-21T11:19:23.000Z | tests/test_loader.py | zenaix/ICSuit | 792b498df7f0e700b77f147e4f888b950f3ba296 | [
"Apache-2.0"
] | null | null | null | tests/test_loader.py | zenaix/ICSuit | 792b498df7f0e700b77f147e4f888b950f3ba296 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
import os
import unittest
from context import icsuit
from icsuit.cli.loader import findmod, importmod, listmod
class TestLoader(unittest.TestCase):
"""Unit test cases for cli.loader."""
if __name__ == '__main__':
unittest.main()
| 21.8 | 57 | 0.598952 | # -*- coding: utf-8 -*-
import os
import unittest
from context import icsuit
from icsuit.cli.loader import findmod, importmod, listmod
class TestLoader(unittest.TestCase):
"""Unit test cases for cli.loader."""
def test_listmod(self):
os.chdir('..')
print
print listmod()
os.c... | 415 | 0 | 82 |
f1c89bb107cfdbfe54a9f367c07f9fa5398a374c | 240 | py | Python | day_03/test_solution.py | jamsidedown/adventofcode2020 | 2ff6ab6fd10470523e869fe6346cdfebc291d5a4 | [
"MIT"
] | null | null | null | day_03/test_solution.py | jamsidedown/adventofcode2020 | 2ff6ab6fd10470523e869fe6346cdfebc291d5a4 | [
"MIT"
] | null | null | null | day_03/test_solution.py | jamsidedown/adventofcode2020 | 2ff6ab6fd10470523e869fe6346cdfebc291d5a4 | [
"MIT"
] | null | null | null | from day_03.solution import parse, part_1, part_2
| 20 | 49 | 0.6875 | from day_03.solution import parse, part_1, part_2
def test_part_1():
trees = parse('day_03/test_input.txt')
assert part_1(trees) == 7
def test_part_2():
trees = parse('day_03/test_input.txt')
assert part_2(trees) == 336
| 142 | 0 | 46 |
ee7591a7a27b660226c1d87c48390f3c8a0aca56 | 7,299 | py | Python | backend/eth_app/views/api.py | CUBigDataClass/eth_track | a3475e61fdc6f519ab6c670dc005f9e96939c947 | [
"MIT"
] | null | null | null | backend/eth_app/views/api.py | CUBigDataClass/eth_track | a3475e61fdc6f519ab6c670dc005f9e96939c947 | [
"MIT"
] | null | null | null | backend/eth_app/views/api.py | CUBigDataClass/eth_track | a3475e61fdc6f519ab6c670dc005f9e96939c947 | [
"MIT"
] | null | null | null | from flask import Blueprint
from flask import current_app
from flask import jsonify
from flask import g
from flask import request
from eth_app.db import get_connection, get_data, add_data
from eth_app.API import Api
import os
import pandas as pd
import numpy as np
API_KEY = os.getenv("API_KEY")
bp = Blueprint('api'... | 37.050761 | 121 | 0.598849 | from flask import Blueprint
from flask import current_app
from flask import jsonify
from flask import g
from flask import request
from eth_app.db import get_connection, get_data, add_data
from eth_app.API import Api
import os
import pandas as pd
import numpy as np
API_KEY = os.getenv("API_KEY")
bp = Blueprint('api'... | 6,707 | 0 | 135 |
eadf108001a65bab32722477eba41bfa9ef4d893 | 79 | py | Python | confab/helper.py | confab-services/confab | 4f90cee9c8a7f07f3cfffbe05a015c1119c3a654 | [
"MIT"
] | null | null | null | confab/helper.py | confab-services/confab | 4f90cee9c8a7f07f3cfffbe05a015c1119c3a654 | [
"MIT"
] | null | null | null | confab/helper.py | confab-services/confab | 4f90cee9c8a7f07f3cfffbe05a015c1119c3a654 | [
"MIT"
] | null | null | null | """Helper module"""
| 13.166667 | 43 | 0.658228 | """Helper module"""
def username_exists(username: str) -> bool:
return 0
| 35 | 0 | 23 |
3eb951528d5603a01aae0bcccb9aba52446f0135 | 684 | py | Python | mltk/cli/commander_mltk_cli.py | SiliconLabs/mltk | 56b19518187e9d1c8a0d275de137fc9058984a1f | [
"Zlib"
] | null | null | null | mltk/cli/commander_mltk_cli.py | SiliconLabs/mltk | 56b19518187e9d1c8a0d275de137fc9058984a1f | [
"Zlib"
] | 1 | 2021-11-19T20:10:09.000Z | 2021-11-19T20:10:09.000Z | mltk/cli/commander_mltk_cli.py | sldriedler/mltk | d82a60359cf875f542a2257f1bc7d8eb4bdaa204 | [
"Zlib"
] | null | null | null |
import typer
from mltk import cli
@cli.root_cli.command("commander", cls=cli.VariableArgumentParsingCommand)
def silabs_commander_command(ctx: typer.Context):
"""Silab's Commander Utility
This utility allows for accessing a Silab's embedded device via JLink.
For more details issue command: mltk c... | 26.307692 | 74 | 0.711988 |
import typer
from mltk import cli
@cli.root_cli.command("commander", cls=cli.VariableArgumentParsingCommand)
def silabs_commander_command(ctx: typer.Context):
"""Silab's Commander Utility
This utility allows for accessing a Silab's embedded device via JLink.
For more details issue command: mltk c... | 0 | 0 | 0 |
ce3e5e8bde3e8e1224f5664f65d80ab12dec646c | 3,295 | py | Python | pypugjs/ext/tornado/__init__.py | Dryja/pypugjs | 11cb230f632ffa9ba07e16c5bfcc17ca924d46dc | [
"MIT"
] | null | null | null | pypugjs/ext/tornado/__init__.py | Dryja/pypugjs | 11cb230f632ffa9ba07e16c5bfcc17ca924d46dc | [
"MIT"
] | null | null | null | pypugjs/ext/tornado/__init__.py | Dryja/pypugjs | 11cb230f632ffa9ba07e16c5bfcc17ca924d46dc | [
"MIT"
] | null | null | null | import tornado.template
from pypugjs import Compiler as _Compiler
from pypugjs.exceptions import CurrentlyNotSupported
from pypugjs.runtime import attrs, escape, iteration
from pypugjs.utils import process
ATTRS_FUNC = '__pypugjs_attrs'
ESCAPE_FUNC = '__pypugjs_escape'
ITER_FUNC = '__pypugjs_iter'
# Patch tornado... | 34.322917 | 115 | 0.564795 | import tornado.template
from pypugjs import Compiler as _Compiler
from pypugjs.exceptions import CurrentlyNotSupported
from pypugjs.runtime import attrs, escape, iteration
from pypugjs.utils import process
ATTRS_FUNC = '__pypugjs_attrs'
ESCAPE_FUNC = '__pypugjs_escape'
ITER_FUNC = '__pypugjs_iter'
class Compiler(_C... | 2,591 | 26 | 310 |
a712ee3c3c6bf51b9b642ed0a4ec873c99ad333b | 368 | py | Python | sdk/apis/packs_service.py | CLG0125/elemesdk | 344466398bad7cf026e082e47c77d3ca98621ef3 | [
"MIT"
] | 1 | 2021-04-03T05:11:29.000Z | 2021-04-03T05:11:29.000Z | sdk/apis/packs_service.py | CLG0125/elemesdk | 344466398bad7cf026e082e47c77d3ca98621ef3 | [
"MIT"
] | null | null | null | sdk/apis/packs_service.py | CLG0125/elemesdk | 344466398bad7cf026e082e47c77d3ca98621ef3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# 签约服务
| 19.368421 | 98 | 0.619565 | # -*- coding: utf-8 -*-
# 签约服务
class PacksService:
__client = None
def __init__(self, client):
self.__client = client
def get_effect_service_pack_contract(self, shop_id):
"""
查询店铺当前生效合同类型
:param shopId:店铺id
"""
return self.__client.call("eleme.packs.getEf... | 37 | 303 | 22 |
6f6fd09ea6eb2d2cb4c683cec5fc4e9b35909eda | 1,219 | py | Python | parsl/tests/test_python_apps/test_worker_fail.py | khurtado/parsl | 6ea461ccd7be83b51bf5384bf50b522e56fc46f1 | [
"Apache-2.0"
] | null | null | null | parsl/tests/test_python_apps/test_worker_fail.py | khurtado/parsl | 6ea461ccd7be83b51bf5384bf50b522e56fc46f1 | [
"Apache-2.0"
] | null | null | null | parsl/tests/test_python_apps/test_worker_fail.py | khurtado/parsl | 6ea461ccd7be83b51bf5384bf50b522e56fc46f1 | [
"Apache-2.0"
] | null | null | null | import argparse
import time
import parsl
from parsl.app.app import App
from parsl.tests.configs.local_threads import config
parsl.clear()
parsl.load(config)
@App('python')
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("-c", "--count", default="10",
... | 23 | 76 | 0.603774 | import argparse
import time
import parsl
from parsl.app.app import App
from parsl.tests.configs.local_threads import config
parsl.clear()
parsl.load(config)
@App('python')
def import_echo(x, string, sleep=0, stdout=None):
import time
time.sleep(sleep)
print(string)
return x * 5
def test_parallel_f... | 494 | 0 | 45 |
f5671bcd389e5d84b88c8b8d43a2893798e4bfb5 | 6,276 | py | Python | Attendance Marker 0.0.0/Attendance Marker.py | VallishaM/Google-Meet-Attendance | 9210d91173378a73b48879c9a36770a4cc4a8f24 | [
"RSA-MD"
] | null | null | null | Attendance Marker 0.0.0/Attendance Marker.py | VallishaM/Google-Meet-Attendance | 9210d91173378a73b48879c9a36770a4cc4a8f24 | [
"RSA-MD"
] | null | null | null | Attendance Marker 0.0.0/Attendance Marker.py | VallishaM/Google-Meet-Attendance | 9210d91173378a73b48879c9a36770a4cc4a8f24 | [
"RSA-MD"
] | null | null | null | #attendance_file is the source file and list_file is the destination file
__author__ = "Vallisha M"
__version__ = '0.0.0'
from os import listdir
from os.path import isfile, join
import tkinter as tk
import pandas as pd
import re
from tkinter import *
from tkinter import filedialog
from tkinter.filedialog ... | 45.478261 | 169 | 0.637986 | #attendance_file is the source file and list_file is the destination file
__author__ = "Vallisha M"
__version__ = '0.0.0'
from os import listdir
from os.path import isfile, join
import tkinter as tk
import pandas as pd
import re
from tkinter import *
from tkinter import filedialog
from tkinter.filedialog ... | 4,622 | 0 | 75 |
a2d483c1e9b75dc55073e8b235cad453d5fdc0b0 | 2,267 | py | Python | mab/tests/test_algs.py | rsoaresp/mabalgs | 82de4148269c3838256600d5e85d849244b14de1 | [
"Apache-2.0"
] | 95 | 2019-01-25T14:54:09.000Z | 2022-02-27T11:48:49.000Z | mab/tests/test_algs.py | rsoaresp/mabalgs | 82de4148269c3838256600d5e85d849244b14de1 | [
"Apache-2.0"
] | 6 | 2019-01-28T12:36:38.000Z | 2019-12-11T22:26:40.000Z | mab/tests/test_algs.py | rsoaresp/mabalgs | 82de4148269c3838256600d5e85d849244b14de1 | [
"Apache-2.0"
] | 20 | 2019-02-10T01:17:54.000Z | 2022-02-01T02:14:20.000Z | from mab import algs
import numpy as np
| 28.696203 | 66 | 0.743714 | from mab import algs
import numpy as np
def test_ucb_init_return_first_arm():
ucb_with_two_arms = algs.UCB1(2)
assert ucb_with_two_arms.select()[0] == 0
def test_ucb_use_all_arm_dont_usage():
ucb_with_two_arms = algs.UCB1(2)
assert ucb_with_two_arms.select()[0] == 0
assert ucb_with_two_arms.sele... | 2,035 | 0 | 184 |
d1a3c2589f4cc63b9fb4392973cf7bc466b883bc | 886 | py | Python | antioch/test/__init__.py | philchristensen/antioch | 7fe27c961ae81b7655c6428038c85eefad27e980 | [
"MIT"
] | 15 | 2015-10-07T06:30:22.000Z | 2022-03-07T19:44:55.000Z | antioch/test/__init__.py | philchristensen/antioch | 7fe27c961ae81b7655c6428038c85eefad27e980 | [
"MIT"
] | 2 | 2016-10-17T05:04:58.000Z | 2018-09-10T02:36:15.000Z | antioch/test/__init__.py | philchristensen/antioch | 7fe27c961ae81b7655c6428038c85eefad27e980 | [
"MIT"
] | 2 | 2018-07-30T12:58:33.000Z | 2018-11-26T03:17:34.000Z | # antioch
# Copyright (c) 1999-2019 Phil Christensen
#
# See LICENSE for details
"""
Provide testing for the codebase
"""
import pkg_resources as pkg
from antioch.core import bootstrap
from django.conf import settings
from django.db import connection | 23.945946 | 87 | 0.700903 | # antioch
# Copyright (c) 1999-2019 Phil Christensen
#
# See LICENSE for details
"""
Provide testing for the codebase
"""
import pkg_resources as pkg
from antioch.core import bootstrap
from django.conf import settings
from django.db import connection
def init_database(dbid, dataset='minimal', autocommit=False):
... | 474 | 2 | 157 |
cce7e125523d7008c2959b1d34ee3b20907e6caf | 3,112 | py | Python | ceilometer/storage/sqlalchemy/alembic/versions/b6ae66d05e3_remove_extra_indexes.py | rackerlabs/instrumented-ceilometer | 6ac5215ac0476120d9c99adcabc9cad0d32963da | [
"Apache-2.0"
] | 3 | 2021-04-18T00:37:48.000Z | 2021-07-21T10:20:11.000Z | ceilometer/storage/sqlalchemy/alembic/versions/b6ae66d05e3_remove_extra_indexes.py | lexxito/monitoring | bec8dfb8d3610331c7ae5ec543e0b8da0948c164 | [
"Apache-2.0"
] | null | null | null | ceilometer/storage/sqlalchemy/alembic/versions/b6ae66d05e3_remove_extra_indexes.py | lexxito/monitoring | bec8dfb8d3610331c7ae5ec543e0b8da0948c164 | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
#
# Copyright 2010-2011 OpenStack Foundation
# Copyright 2012-2013 IBM Corp. #
#
# Authors: Svetlana Shturm <sshturm@mirantis.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 t... | 32.757895 | 75 | 0.595758 | # -*- encoding: utf-8 -*-
#
# Copyright 2010-2011 OpenStack Foundation
# Copyright 2012-2013 IBM Corp. #
#
# Authors: Svetlana Shturm <sshturm@mirantis.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 t... | 1,755 | 0 | 69 |
f9078f3d7cc023c72737c4a6fbf03f3686054dcb | 3,878 | py | Python | declry/templatetags/sorting_tag.py | jAlpedrinha/DeclRY | f6f1f18a0cc38d0b502945a6f8baec64c3b9a6fa | [
"BSD-3-Clause"
] | 1 | 2015-08-12T12:02:54.000Z | 2015-08-12T12:02:54.000Z | declry/templatetags/sorting_tag.py | jAlpedrinha/DeclRY | f6f1f18a0cc38d0b502945a6f8baec64c3b9a6fa | [
"BSD-3-Clause"
] | null | null | null | declry/templatetags/sorting_tag.py | jAlpedrinha/DeclRY | f6f1f18a0cc38d0b502945a6f8baec64c3b9a6fa | [
"BSD-3-Clause"
] | null | null | null | from django import template
from django.http import Http404
from django.conf import settings
from copy import copy
register = template.Library()
REMOVE_ORDER = '<a href="{}"><i class="icon-remove"></i></a>'
sort_directions = {
'asc': {'icon':'icon-arrow-up', 'inverse': 'desc'},
'desc': {'icon':'icon-arrow-do... | 32.588235 | 122 | 0.546158 | from django import template
from django.http import Http404
from django.conf import settings
from copy import copy
register = template.Library()
REMOVE_ORDER = '<a href="{}"><i class="icon-remove"></i></a>'
sort_directions = {
'asc': {'icon':'icon-arrow-up', 'inverse': 'desc'},
'desc': {'icon':'icon-arrow-do... | 2,476 | 0 | 99 |
9c211c6729326ede5ee80e3259d9678112140ecc | 2,144 | py | Python | parser_logic.py | avizmarlon/eml_email_parsing | 4ddbe0614f08ac857c46e4d56509e63eada91726 | [
"MIT"
] | null | null | null | parser_logic.py | avizmarlon/eml_email_parsing | 4ddbe0614f08ac857c46e4d56509e63eada91726 | [
"MIT"
] | null | null | null | parser_logic.py | avizmarlon/eml_email_parsing | 4ddbe0614f08ac857c46e4d56509e63eada91726 | [
"MIT"
] | null | null | null | import re
import os
from tkinter import *
from tkinter import Tk
from tkinter.filedialog import askdirectory
import time
# todo:
# make renaming temporary, file names go back to their original after the parsing computation is done
# or find a way to parse without needing to rename (probably using regex).
rootWindow =... | 28.586667 | 101 | 0.702425 | import re
import os
from tkinter import *
from tkinter import Tk
from tkinter.filedialog import askdirectory
import time
# todo:
# make renaming temporary, file names go back to their original after the parsing computation is done
# or find a way to parse without needing to rename (probably using regex).
rootWindow =... | 0 | 0 | 0 |
7a6c5469b216ea20136d38d73bd509c00a600e0f | 2,603 | py | Python | rotv_apps/urls.py | ivellios/django-rotv-apps | 95aad945debd0e60d210057c0605928483e213a8 | [
"MIT"
] | 1 | 2017-12-05T13:24:23.000Z | 2017-12-05T13:24:23.000Z | rotv_apps/urls.py | ivellios/django-rotv-apps | 95aad945debd0e60d210057c0605928483e213a8 | [
"MIT"
] | 9 | 2017-11-22T23:29:48.000Z | 2022-03-11T23:11:34.000Z | rotv_apps/urls.py | ivellios/django-rotv-apps | 95aad945debd0e60d210057c0605928483e213a8 | [
"MIT"
] | null | null | null | from django.conf.urls import url, include
from .program.views import (EpisodeView, EpisodeProgramView, EpisodePlaylistView,
ProgramListView, IndexView, EpisodesByTagView,
SearchEpisodeByTagsView, EpisodesBySearchedTagsView,
ProgramDeta... | 60.534884 | 119 | 0.659239 | from django.conf.urls import url, include
from .program.views import (EpisodeView, EpisodeProgramView, EpisodePlaylistView,
ProgramListView, IndexView, EpisodesByTagView,
SearchEpisodeByTagsView, EpisodesBySearchedTagsView,
ProgramDeta... | 0 | 0 | 0 |
d0451a234a954e085464f45b92baca32dd294c02 | 536 | py | Python | transformers/data/__init__.py | DaDaMrX/ReaLiSe | 25843e0c2c32b3a364cee857b2e4f5ba8b2764e9 | [
"MIT"
] | 72 | 2021-05-27T06:32:20.000Z | 2022-03-31T03:04:58.000Z | transformers/data/__init__.py | DaDaMrX/ReaLiSe | 25843e0c2c32b3a364cee857b2e4f5ba8b2764e9 | [
"MIT"
] | 10 | 2021-05-27T05:13:50.000Z | 2022-03-27T09:10:47.000Z | transformers/data/__init__.py | DaDaMrX/ReaLiSe | 25843e0c2c32b3a364cee857b2e4f5ba8b2764e9 | [
"MIT"
] | 13 | 2021-06-24T04:44:14.000Z | 2022-03-03T12:57:23.000Z | from .processors import InputExample, InputFeatures, DataProcessor, SquadFeatures
from .processors import glue_output_modes, glue_processors, glue_tasks_num_labels, glue_convert_examples_to_features
from .processors import squad_convert_examples_to_features, SquadExample, SquadV1Processor, SquadV2Processor
from .pro... | 59.555556 | 117 | 0.865672 | from .processors import InputExample, InputFeatures, DataProcessor, SquadFeatures
from .processors import glue_output_modes, glue_processors, glue_tasks_num_labels, glue_convert_examples_to_features
from .processors import squad_convert_examples_to_features, SquadExample, SquadV1Processor, SquadV2Processor
from .pro... | 0 | 0 | 0 |
bfe42630b4533801c2cdd39124dc7ed463196739 | 1,202 | py | Python | tekis/flatpages/migrations/0002_auto_20160221_0006.py | TKOaly/tkoaly-new-service | 5a6ab1e44ea842923b3d7c6a86f07a0e155d4cef | [
"BSD-3-Clause"
] | null | null | null | tekis/flatpages/migrations/0002_auto_20160221_0006.py | TKOaly/tkoaly-new-service | 5a6ab1e44ea842923b3d7c6a86f07a0e155d4cef | [
"BSD-3-Clause"
] | 8 | 2017-11-27T11:41:57.000Z | 2021-09-07T23:51:11.000Z | tekis/flatpages/migrations/0002_auto_20160221_0006.py | hylje/tekis | 5dfb965dd6f199b37abf759248bc7d3e730ce241 | [
"BSD-3-Clause"
] | 1 | 2020-02-15T10:51:55.000Z | 2020-02-15T10:51:55.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-02-20 22:06
from __future__ import unicode_literals
from django.db import migrations, models
| 33.388889 | 174 | 0.587354 | # -*- coding: utf-8 -*-
# Generated by Django 1.9.1 on 2016-02-20 22:06
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('flatpages', '0001_initial'),
]
operations = [
migrations.AlterField(
... | 0 | 1,024 | 23 |
ef8d0e14231dadb0fe3e9cc24e64fd5456f99c21 | 109 | py | Python | scanner/settings/__init__.py | samber/celery_demonstration | 8e0bcc2bf02af6af40955bf2e58d7222dc759df5 | [
"Beerware"
] | 2 | 2016-09-17T05:44:24.000Z | 2017-05-27T17:34:30.000Z | scanner/settings/__init__.py | samber/celery_demonstration | 8e0bcc2bf02af6af40955bf2e58d7222dc759df5 | [
"Beerware"
] | null | null | null | scanner/settings/__init__.py | samber/celery_demonstration | 8e0bcc2bf02af6af40955bf2e58d7222dc759df5 | [
"Beerware"
] | null | null | null |
from __future__ import absolute_import
from .scanner import *
from .django import *
from .celery import *
| 13.625 | 38 | 0.770642 |
from __future__ import absolute_import
from .scanner import *
from .django import *
from .celery import *
| 0 | 0 | 0 |
f95c1278c793eb2bad8b2d8bfd0c394e47bee6b3 | 2,448 | py | Python | app/func/slack.py | JoonyoungYi/kaist-bus | 9db2cd7cc7d418533eccec54396e9d351f4ab5c2 | [
"Apache-2.0"
] | 2 | 2022-01-13T10:39:26.000Z | 2022-03-16T11:12:28.000Z | app/func/slack.py | JoonyoungYi/kaist-bus | 9db2cd7cc7d418533eccec54396e9d351f4ab5c2 | [
"Apache-2.0"
] | null | null | null | app/func/slack.py | JoonyoungYi/kaist-bus | 9db2cd7cc7d418533eccec54396e9d351f4ab5c2 | [
"Apache-2.0"
] | 1 | 2021-07-15T12:50:28.000Z | 2021-07-15T12:50:28.000Z | import requests
from flask import request, url_for
from ..core import server
URL_JOONYOUNG = 'https://hooks.slack.com/services/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'
# https://api.slack.com/docs/messages/builder
def _send_slack_message(url, text, attachments=[]):
"""
성공여부를 리턴합니다
"""
i... | 24.727273 | 95 | 0.524918 | import requests
from flask import request, url_for
from ..core import server
URL_JOONYOUNG = 'https://hooks.slack.com/services/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'
class Field():
title = ''
value = ''
short = False
def __init__(self, title='', value='', short=False):
self.title = ... | 1,503 | 237 | 68 |
8aba186cae8f1b7e9e7c08f6c019bee20682c24e | 10,916 | py | Python | playground/Non_DAG_with_Energy_rllib/launch_scripts.py | kangyifei/CloudSimPy | 45912e7ea35086b67941624102e400cb22e549ab | [
"MIT"
] | null | null | null | playground/Non_DAG_with_Energy_rllib/launch_scripts.py | kangyifei/CloudSimPy | 45912e7ea35086b67941624102e400cb22e549ab | [
"MIT"
] | null | null | null | playground/Non_DAG_with_Energy_rllib/launch_scripts.py | kangyifei/CloudSimPy | 45912e7ea35086b67941624102e400cb22e549ab | [
"MIT"
] | null | null | null | import os
import time
import numpy as np
import tensorflow as tf
from multiprocessing import Process, Manager,freeze_support
import sys
import matplotlib.pyplot as plt
import math
sys.path.append('..')
import torch
from core.config import MachineConfig
from playground.Non_DAG_with_Energy.algorithm.random_algorithm impo... | 42.310078 | 133 | 0.701081 | import os
import time
import numpy as np
import tensorflow as tf
from multiprocessing import Process, Manager,freeze_support
import sys
import matplotlib.pyplot as plt
import math
sys.path.append('..')
import torch
from core.config import MachineConfig
from playground.Non_DAG_with_Energy.algorithm.random_algorithm impo... | 0 | 0 | 0 |
9d06e340596312da18cfc25af5dc8753a72f0496 | 1,370 | py | Python | samples/inheritance.py | cor-kalis/Net2Scripting | 97938ccde154661c0c598ea82ad3a6b23e06d205 | [
"MIT"
] | 6 | 2018-06-21T15:17:34.000Z | 2021-12-19T16:31:53.000Z | samples/inheritance.py | marcelcorso/Net2Scripting | 65c4e77a7c88c3d4b88f901225b71710df415ba5 | [
"MIT"
] | null | null | null | samples/inheritance.py | marcelcorso/Net2Scripting | 65c4e77a7c88c3d4b88f901225b71710df415ba5 | [
"MIT"
] | 1 | 2019-12-13T08:56:33.000Z | 2019-12-13T08:56:33.000Z | """
Sample script to demonstrate inheritance
"""
from Net2Scripting import init_logging
from Net2Scripting.net2xs import Net2XS
# Operator id 0 is System Engineer
OPERATOR_ID = 0
# Default Net2 password
OPERATOR_PWD = "net2"
# When running on the machine where Net2 is installed
NET2_SERVER = "localhost"
class MyNet... | 26.346154 | 72 | 0.656934 | """
Sample script to demonstrate inheritance
"""
from Net2Scripting import init_logging
from Net2Scripting.net2xs import Net2XS
# Operator id 0 is System Engineer
OPERATOR_ID = 0
# Default Net2 password
OPERATOR_PWD = "net2"
# When running on the machine where Net2 is installed
NET2_SERVER = "localhost"
class MyNet... | 0 | 0 | 0 |
466fc2bf9a4a9ffcc6eb64afce73adcf04139f05 | 1,299 | py | Python | tests/migrations/0001_initial.py | alvaro-alonso/django-dumpdata-one | a33f2603c9b7253e60b5119cf5532fd99a7ad6bf | [
"BSD-3-Clause"
] | 8 | 2020-05-22T17:43:26.000Z | 2021-07-15T11:25:13.000Z | tests/migrations/0001_initial.py | alvaro-alonso/django-dumpdata-one | a33f2603c9b7253e60b5119cf5532fd99a7ad6bf | [
"BSD-3-Clause"
] | 4 | 2020-07-01T12:45:30.000Z | 2021-08-25T03:41:39.000Z | tests/migrations/0001_initial.py | alvaro-alonso/django-dumpdata-one | a33f2603c9b7253e60b5119cf5532fd99a7ad6bf | [
"BSD-3-Clause"
] | 2 | 2020-12-08T02:51:46.000Z | 2021-07-16T14:00:05.000Z | from django.db import migrations, models
import django.db.models.deletion
| 37.114286 | 114 | 0.575058 | from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='OneModel',
fields=[
('id', models.AutoField(auto_created=Tr... | 0 | 1,201 | 23 |
7589b449cd0bd544684955865ad8bd2ec54247c1 | 21,718 | py | Python | src/main.py | funkyk/CSLAIER | 341e2fe6c0b9a2e0d57eca4667125e99ddb2a3f8 | [
"BSD-3-Clause",
"MIT"
] | 41 | 2016-10-19T01:01:46.000Z | 2022-03-16T18:29:25.000Z | src/main.py | funkyk/CSLAIER | 341e2fe6c0b9a2e0d57eca4667125e99ddb2a3f8 | [
"BSD-3-Clause",
"MIT"
] | 3 | 2016-12-14T10:02:07.000Z | 2017-05-11T05:43:41.000Z | src/main.py | funkyk/CSLAIER | 341e2fe6c0b9a2e0d57eca4667125e99ddb2a3f8 | [
"BSD-3-Clause",
"MIT"
] | 9 | 2016-12-08T12:53:48.000Z | 2019-04-17T08:10:54.000Z | # -*- coding: utf-8 -*-
import json
import os
import re
import logging
from logging.handlers import RotatingFileHandler
from logging import getLogger
from time import sleep
from flask import Flask, url_for, render_template, request, redirect, \
jsonify, send_from_directory, send_file, Response
import gevent
from g... | 34.309637 | 101 | 0.636937 | # -*- coding: utf-8 -*-
import json
import os
import re
import logging
from logging.handlers import RotatingFileHandler
from logging import getLogger
from time import sleep
from flask import Flask, url_for, render_template, request, redirect, \
jsonify, send_from_directory, send_file, Response
import gevent
from g... | 15,718 | 9 | 935 |
7dd4c7c735b371b15711743d290a7c3b9dc5df38 | 5,023 | py | Python | gem/utils/plot_stats.py | vinnamkim/GEM-Benchmark | 8420c565531098b5b36abec340f1c5e330c4dbcc | [
"BSD-3-Clause"
] | 44 | 2019-08-20T02:37:12.000Z | 2022-03-16T14:09:08.000Z | gem/utils/plot_stats.py | vinnamkim/GEM-Benchmark | 8420c565531098b5b36abec340f1c5e330c4dbcc | [
"BSD-3-Clause"
] | 3 | 2019-09-29T05:34:38.000Z | 2020-12-07T20:45:44.000Z | gem/utils/plot_stats.py | vinnamkim/GEM-Benchmark | 8420c565531098b5b36abec340f1c5e330c4dbcc | [
"BSD-3-Clause"
] | 13 | 2019-08-20T05:59:04.000Z | 2021-05-10T14:51:06.000Z | try: import cPickle as pickle
except: import pickle
from os import environ
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import itertools
from matplotlib import rc
import numpy as np
import pandas as pd
import seaborn as sns
import pickle as pkl
import functools
font = {'family': 'serif', 'se... | 32.198718 | 144 | 0.570177 | try: import cPickle as pickle
except: import pickle
from os import environ
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import itertools
from matplotlib import rc
import numpy as np
import pandas as pd
import seaborn as sns
import pickle as pkl
import functools
font = {'family': 'serif', 'se... | 3,934 | 0 | 92 |
73828f4d2d724c1e73ed05a1a3e06733b5a06650 | 409 | py | Python | backend/js_error_logger/models.py | hens-virtuella-varld/django-js-error-logger | e600442bc74e04ac2f0e7deecb5d9642ea91156c | [
"MIT"
] | null | null | null | backend/js_error_logger/models.py | hens-virtuella-varld/django-js-error-logger | e600442bc74e04ac2f0e7deecb5d9642ea91156c | [
"MIT"
] | null | null | null | backend/js_error_logger/models.py | hens-virtuella-varld/django-js-error-logger | e600442bc74e04ac2f0e7deecb5d9642ea91156c | [
"MIT"
] | null | null | null | from django.db import models
| 29.214286 | 46 | 0.733496 | from django.db import models
class JSError(models.Model):
name = models.CharField(max_length=200)
app_id = models.CharField(max_length=20)
user = models.CharField(max_length=20)
time = models.DateTimeField()
url = models.CharField(max_length=200)
status = models.CharField(max_length=200)
m... | 0 | 355 | 23 |
48cd52d56a8d2a8c874d136a3855a2d94d2a3f80 | 1,555 | py | Python | tests/test_colours.py | jmacgrillen/mac_lib | 67c7e6f35fbe27809e60fbb88a10d841656969f0 | [
"Apache-2.0"
] | null | null | null | tests/test_colours.py | jmacgrillen/mac_lib | 67c7e6f35fbe27809e60fbb88a10d841656969f0 | [
"Apache-2.0"
] | null | null | null | tests/test_colours.py | jmacgrillen/mac_lib | 67c7e6f35fbe27809e60fbb88a10d841656969f0 | [
"Apache-2.0"
] | null | null | null | #! /usr/bin/env python -*- coding: utf-8 -*-
"""
Name:
test_colours.py
Desscription:
Unit tests for mac_colours.
Version:
1 - Inital release
Author:
J.MacGrillen <macgrillen@gmail.com>
Copyright:
Copyright (c) John MacGrillen. All rights reserved.
"""
import ... | 22.867647 | 74 | 0.653376 | #! /usr/bin/env python -*- coding: utf-8 -*-
"""
Name:
test_colours.py
Desscription:
Unit tests for mac_colours.
Version:
1 - Inital release
Author:
J.MacGrillen <macgrillen@gmail.com>
Copyright:
Copyright (c) John MacGrillen. All rights reserved.
"""
import ... | 0 | 0 | 0 |
4ec1258f875a8404b4f63907a8f3f945f70572e0 | 1,350 | py | Python | pandora_tests/tests.py | Apocalepse/django-pandora | 868526de9b91184d376b5418ed8636a23f21ed8f | [
"BSD-3-Clause"
] | null | null | null | pandora_tests/tests.py | Apocalepse/django-pandora | 868526de9b91184d376b5418ed8636a23f21ed8f | [
"BSD-3-Clause"
] | null | null | null | pandora_tests/tests.py | Apocalepse/django-pandora | 868526de9b91184d376b5418ed8636a23f21ed8f | [
"BSD-3-Clause"
] | 1 | 2020-12-08T20:35:34.000Z | 2020-12-08T20:35:34.000Z | from django.test import TestCase
from pandora import Box
class MultiThreadedTests(TestCase):
"""
Please contribute a patch if you know how to easily test the multithreaded
behaviour of pandora's box.
"""
| 24.107143 | 78 | 0.575556 | from django.test import TestCase
from pandora import Box
class BoxTests(TestCase):
def test_get_set_item(self):
box = Box()
box['foo'] = 1
self.assertEqual(box['foo'], 1)
def test_get_method(self):
box = Box()
self.assertEqual(box.get('foo', 0), 0)
box['foo'] =... | 912 | 4 | 211 |
6ffaf0a0c605ce373fd4c50ad6cf35852424e3a3 | 583 | py | Python | nornir_test/netmiko_examples/case1_netmiko_simple/netmiko_simple.py | ktbyers/nornir_test | 66244356c436bb47f51270bc6358336ad37976d4 | [
"Apache-2.0"
] | 4 | 2018-08-28T16:49:27.000Z | 2021-10-03T21:10:06.000Z | nornir_test/netmiko_examples/case1_netmiko_simple/netmiko_simple.py | ktbyers/nornir_test | 66244356c436bb47f51270bc6358336ad37976d4 | [
"Apache-2.0"
] | 1 | 2021-09-14T12:38:45.000Z | 2021-09-14T18:40:57.000Z | nornir_test/netmiko_examples/case1_netmiko_simple/netmiko_simple.py | ktbyers/nornir_test | 66244356c436bb47f51270bc6358336ad37976d4 | [
"Apache-2.0"
] | 6 | 2019-05-15T18:18:29.000Z | 2021-11-24T08:02:47.000Z | from nornir import InitNornir
from nornir.plugins.tasks.networking import netmiko_send_command
from nornir.plugins.functions.text import print_result
from nornir_test.nornir_utilities import nornir_set_creds
if __name__ == "__main__":
main()
| 23.32 | 64 | 0.725557 | from nornir import InitNornir
from nornir.plugins.tasks.networking import netmiko_send_command
from nornir.plugins.functions.text import print_result
from nornir_test.nornir_utilities import nornir_set_creds
def main():
# Initialize Nornir object using hosts.yaml and groups.yaml
norn = InitNornir(config_fil... | 310 | 0 | 23 |
b4e41eb5d6a741a344b7921964486e92ffc0926c | 1,664 | py | Python | scripts/libs/core.py | skodapetr/lbvs-environment | 0c468b9b87392ffe69e0e7726cf02cc6e2fec5e2 | [
"MIT"
] | null | null | null | scripts/libs/core.py | skodapetr/lbvs-environment | 0c468b9b87392ffe69e0e7726cf02cc6e2fec5e2 | [
"MIT"
] | null | null | null | scripts/libs/core.py | skodapetr/lbvs-environment | 0c468b9b87392ffe69e0e7726cf02cc6e2fec5e2 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import csv
import os
import logging
import gzip
__license__ = "X11"
def read_csv_as_object(path):
"""
Read CSV lines as objects.
"""
results = []
with open(path) as stream:
reader = csv.reader(stream, delimiter=",", quotecha... | 24.115942 | 75 | 0.611779 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import csv
import os
import logging
import gzip
__license__ = "X11"
def init_logging():
logging.basicConfig(
level=logging.DEBUG,
format='%(asctime)s [%(levelname)s] - %(message)s',
datefmt='%H:%M:%S')
def create_directory(path... | 884 | 0 | 115 |
6fcaa03949e98b757d446db2228a3cf91ca70346 | 7,294 | py | Python | Project_1/optimus.py | Chertushkin/AI_Projects | 9a7221094fb48773a2e0d77e2a1078d06236bce7 | [
"MIT"
] | null | null | null | Project_1/optimus.py | Chertushkin/AI_Projects | 9a7221094fb48773a2e0d77e2a1078d06236bce7 | [
"MIT"
] | null | null | null | Project_1/optimus.py | Chertushkin/AI_Projects | 9a7221094fb48773a2e0d77e2a1078d06236bce7 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Optimus.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1E2Wmkz43H4FgDefXwK8kyLjgGGC7y_4w
"""
import random
import numpy as np
import pandas as pd
from sklearn.linear_model import LogisticRegression
from sklearn.metrics... | 39.427027 | 177 | 0.649027 | # -*- coding: utf-8 -*-
"""Optimus.ipynb
Automatically generated by Colaboratory.
Original file is located at
https://colab.research.google.com/drive/1E2Wmkz43H4FgDefXwK8kyLjgGGC7y_4w
"""
import random
import numpy as np
import pandas as pd
from sklearn.linear_model import LogisticRegression
from sklearn.metrics... | 4,641 | -7 | 287 |
9699891f2e555e3eccb74844a70bd9ea64c39bab | 2,162 | py | Python | avanzapy/instrument_factory.py | alrevuelta/avanzapy | 5a723607a3e1b5028172239372bb51ad6ac9978e | [
"MIT"
] | 2 | 2021-04-15T13:34:52.000Z | 2021-08-24T17:32:26.000Z | avanzapy/instrument_factory.py | alrevuelta/avanzapy | 5a723607a3e1b5028172239372bb51ad6ac9978e | [
"MIT"
] | null | null | null | avanzapy/instrument_factory.py | alrevuelta/avanzapy | 5a723607a3e1b5028172239372bb51ad6ac9978e | [
"MIT"
] | 1 | 2022-02-03T08:30:44.000Z | 2022-02-03T08:30:44.000Z | from avanzapy.constants import InstrumentType
from avanzapy.stock import Stock
from avanzapy.fund import Fund
from avanzapy.bond import Bond
from avanzapy.option import Option
from avanzapy.futureforward import FutureForward
from avanzapy.certificate import Certificate
from avanzapy.warrant import Warrant
from avanzap... | 42.392157 | 70 | 0.785384 | from avanzapy.constants import InstrumentType
from avanzapy.stock import Stock
from avanzapy.fund import Fund
from avanzapy.bond import Bond
from avanzapy.option import Option
from avanzapy.futureforward import FutureForward
from avanzapy.certificate import Certificate
from avanzapy.warrant import Warrant
from avanzap... | 1,472 | 0 | 22 |
3a3880a7ef4ad4f1a3eb56ad71e039c017c5d7a3 | 1,837 | py | Python | util/blender/io_scene_qor/__init__.py | flipcoder/qor | 7a2ebf667be4c913fbc7daf5e0b07a4c1723389d | [
"MIT"
] | 84 | 2015-03-30T14:29:29.000Z | 2022-01-28T12:29:25.000Z | util/blender/io_scene_qor/__init__.py | flipcoder/qor | 7a2ebf667be4c913fbc7daf5e0b07a4c1723389d | [
"MIT"
] | 5 | 2016-01-22T18:54:35.000Z | 2021-07-24T10:21:12.000Z | util/blender/io_scene_qor/__init__.py | flipcoder/qor | 7a2ebf667be4c913fbc7daf5e0b07a4c1723389d | [
"MIT"
] | 22 | 2015-08-06T05:32:29.000Z | 2022-03-05T13:20:46.000Z | bl_info = {
"name": "Qor JSON Scene Export",
"author": "Grady O'Connell",
"blender": (2,7,6),
"version": (0,0,1),
"location": "File > Import-Export",
"description": "Import-Export Qor JSON data format (export only)",
"category": "Import-Export",
"wiki_url... | 31.135593 | 94 | 0.669026 | bl_info = {
"name": "Qor JSON Scene Export",
"author": "Grady O'Connell",
"blender": (2,7,6),
"version": (0,0,1),
"location": "File > Import-Export",
"description": "Import-Export Qor JSON data format (export only)",
"category": "Import-Export",
"wiki_url... | 844 | 230 | 92 |
fc8e278f41ccfd8e183393f7f6bebd6db7c1f9ab | 11,963 | py | Python | QueryDB.py | Nik0l/UTemPr | cc8c64dd01910194d1f18530a687595dceff30df | [
"MIT"
] | 2 | 2016-02-24T19:36:12.000Z | 2017-08-04T07:46:06.000Z | QueryDB.py | Nik0l/UTemPr | cc8c64dd01910194d1f18530a687595dceff30df | [
"MIT"
] | 1 | 2016-03-03T09:18:07.000Z | 2016-03-03T09:18:07.000Z | QueryDB.py | Nik0l/UTemPr | cc8c64dd01910194d1f18530a687595dceff30df | [
"MIT"
] | 2 | 2017-04-18T09:56:30.000Z | 2019-11-22T01:40:10.000Z | __author__ = 'nb254'
import sqlite3
import numpy
import csv
import sys
sys.path.append("/mnt/nb254_data/src/utils/")
#import pandas as pd
from once import once, oncecleardb, onceprintdb, onceinit
DIR = '/mnt/nb254_data/db/'
| 64.664865 | 458 | 0.718382 | __author__ = 'nb254'
import sqlite3
import numpy
import csv
import sys
sys.path.append("/mnt/nb254_data/src/utils/")
#import pandas as pd
from once import once, oncecleardb, onceprintdb, onceinit
DIR = '/mnt/nb254_data/db/'
def runquery(c,query,parameters=()):
c.execute(query,parameters)
return c.fetchall()
... | 10,979 | 0 | 759 |
2a92d9d63bfc8456150317545c815e97c7cd9b1e | 3,812 | py | Python | clitools/id3v1toid3v2.py | infothrill/python-clitools | f513c3d66bdfee926212ee8ee1c92d1555393d1e | [
"MIT"
] | 4 | 2017-12-18T16:33:50.000Z | 2022-03-24T09:48:24.000Z | clitools/id3v1toid3v2.py | infothrill/python-clitools | f513c3d66bdfee926212ee8ee1c92d1555393d1e | [
"MIT"
] | 1 | 2021-08-25T04:55:26.000Z | 2021-09-13T09:05:14.000Z | clitools/id3v1toid3v2.py | infothrill/python-clitools | f513c3d66bdfee926212ee8ee1c92d1555393d1e | [
"MIT"
] | 1 | 2018-06-02T00:27:06.000Z | 2018-06-02T00:27:06.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Script to convert id3 v1 tags in a mp3 file to id3 v2."""
import sys
import os
import subprocess # noqa: S404, B404 nosec
# requires tool "id3v2"
# id3v2 -l Prince/Unknown\ Album/When\ Doves\ Cry.mp3
# id3v1 tag info for Prince/Unknown Album/When Doves Cry.mp3:
# T... | 38.12 | 101 | 0.597849 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""Script to convert id3 v1 tags in a mp3 file to id3 v2."""
import sys
import os
import subprocess # noqa: S404, B404 nosec
# requires tool "id3v2"
# id3v2 -l Prince/Unknown\ Album/When\ Doves\ Cry.mp3
# id3v1 tag info for Prince/Unknown Album/When Doves Cry.mp3:
# T... | 0 | 0 | 0 |
37d942ac189d49342c914f2752c25fe9075c69a4 | 333 | py | Python | processor.py | jordanrmerrick/Hackathon2020 | 1ff31c80d2bf07dc49bb1a8db28452bea1bb3c02 | [
"MIT"
] | null | null | null | processor.py | jordanrmerrick/Hackathon2020 | 1ff31c80d2bf07dc49bb1a8db28452bea1bb3c02 | [
"MIT"
] | null | null | null | processor.py | jordanrmerrick/Hackathon2020 | 1ff31c80d2bf07dc49bb1a8db28452bea1bb3c02 | [
"MIT"
] | null | null | null | import usaddress
| 20.8125 | 49 | 0.651652 | import usaddress
def address_checker(address):
tagged = usaddress.tag(address)
if tagged[-1] == "Ambiguous":
return "Please enter a valid address!", 1
else:
return address, 0
def state(address):
tagged = usaddress.tag(address)
dtagged = dict(tagged[0])
return dtagged["StateNa... | 268 | 0 | 46 |
d7178d383817f71eafa70004b34da61f709bd9e9 | 20,284 | py | Python | experiments/federated.py | czlee/jadeite | dfd3f6ea22e14ad3e7961361b0f247752558ad00 | [
"MIT"
] | 2 | 2022-02-16T09:12:36.000Z | 2022-03-27T15:00:50.000Z | experiments/federated.py | czlee/jadeite | dfd3f6ea22e14ad3e7961361b0f247752558ad00 | [
"MIT"
] | null | null | null | experiments/federated.py | czlee/jadeite | dfd3f6ea22e14ad3e7961361b0f247752558ad00 | [
"MIT"
] | null | null | null | """Classes for federated experiments.
Experiment classes are supposed to be, as far as possible, agnostic to models,
loss functions and optimizers. They take care of training, testing and logging.
Note on parameter/`state_dict` distinction: Currently, this implementation
treats all members of the `state_dict` as para... | 44.678414 | 102 | 0.663725 | """Classes for federated experiments.
Experiment classes are supposed to be, as far as possible, agnostic to models,
loss functions and optimizers. They take care of training, testing and logging.
Note on parameter/`state_dict` distinction: Currently, this implementation
treats all members of the `state_dict` as para... | 3,185 | 0 | 80 |
a11b085fb3f5653bfb1692ee3573786274330690 | 241 | py | Python | tests/algorithms/sorting/test_selection_sort.py | evgenyvaleev/pygorithms | 52ccfb46cf32312e6b65815fb74d61d17690c6fc | [
"MIT"
] | null | null | null | tests/algorithms/sorting/test_selection_sort.py | evgenyvaleev/pygorithms | 52ccfb46cf32312e6b65815fb74d61d17690c6fc | [
"MIT"
] | null | null | null | tests/algorithms/sorting/test_selection_sort.py | evgenyvaleev/pygorithms | 52ccfb46cf32312e6b65815fb74d61d17690c6fc | [
"MIT"
] | null | null | null | from pygorithms.algorithms.sorting.selection_sort import selection_sort
| 21.909091 | 71 | 0.66805 | from pygorithms.algorithms.sorting.selection_sort import selection_sort
def test_selection_sort():
items = [3, 56, 34, 565, 0, 45]
selection_sort(items)
for i in range(len(items) - 1):
assert items[i] <= items[i + 1]
| 145 | 0 | 23 |