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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
75f53dea6883d685922e7e60cea9826573fc0b88 | 421 | py | Python | clientes/models.py | maldonadopereira/djangoice | c577abd3aed4a1ffd7de6ea4c5a5c6f53f9987fc | [
"MIT"
] | 2 | 2022-03-13T16:18:43.000Z | 2022-03-13T16:18:46.000Z | clientes/models.py | maldonadopereira/djangoice | c577abd3aed4a1ffd7de6ea4c5a5c6f53f9987fc | [
"MIT"
] | null | null | null | clientes/models.py | maldonadopereira/djangoice | c577abd3aed4a1ffd7de6ea4c5a5c6f53f9987fc | [
"MIT"
] | null | null | null | from django.db import models
from localflavor.br.models import *
| 30.071429 | 67 | 0.738717 | from django.db import models
from localflavor.br.models import *
class Cliente(models.Model):
nome_cliente = models.CharField(max_length=100, null=False)
telefone_cliente = models.CharField(max_length=15, default='')
cep_cliente = BRPostalCodeField()
endereco_cliente = models.CharField(max_length=150,... | 30 | 302 | 23 |
1e1dc46d2220fad993619e19fec951a80a2c5b34 | 1,453 | py | Python | python_scripts/date_countdown.py | elsingaa/Home-Assistant-Config | d20a2dabf5deeef8f087fa6d34a371617da9c4cd | [
"MIT"
] | 1 | 2019-12-22T12:59:01.000Z | 2019-12-22T12:59:01.000Z | python_scripts/date_countdown.py | elsingaa/Home-Assistant-Config | d20a2dabf5deeef8f087fa6d34a371617da9c4cd | [
"MIT"
] | 28 | 2019-12-22T10:33:13.000Z | 2020-08-09T04:46:46.000Z | python_scripts/date_countdown.py | elsingaa/Home-Assistant-Config | d20a2dabf5deeef8f087fa6d34a371617da9c4cd | [
"MIT"
] | null | null | null | today = datetime.datetime.now().date()
name = data.get('name')
eventType = data.get('type')
sensorName = "sensor.{}_{}".format(eventType , name.replace(" " , "_"))
dateStr = data.get('date')
dateSplit = dateStr.split("/")
dateDay = int(dateSplit[0])
dateMonth = int(dateSplit[1])
dateYear = int(dateSplit[2])
date = ... | 27.415094 | 87 | 0.692361 | today = datetime.datetime.now().date()
name = data.get('name')
eventType = data.get('type')
sensorName = "sensor.{}_{}".format(eventType , name.replace(" " , "_"))
dateStr = data.get('date')
dateSplit = dateStr.split("/")
dateDay = int(dateSplit[0])
dateMonth = int(dateSplit[1])
dateYear = int(dateSplit[2])
date = ... | 0 | 0 | 0 |
4e42bfb584b1b42ea765266b576f1792a9d005b0 | 5,027 | py | Python | modules/shared/graphBehaviours.py | MatthewDaggitt/PathVision | 93880bb21bc3b52ce7a7ecc0e5bd7bc1289718cd | [
"MIT"
] | 1 | 2021-06-14T11:12:36.000Z | 2021-06-14T11:12:36.000Z | modules/shared/graphBehaviours.py | Ballemons/PathVision | 93880bb21bc3b52ce7a7ecc0e5bd7bc1289718cd | [
"MIT"
] | null | null | null | modules/shared/graphBehaviours.py | Ballemons/PathVision | 93880bb21bc3b52ce7a7ecc0e5bd7bc1289718cd | [
"MIT"
] | 1 | 2021-06-14T11:12:37.000Z | 2021-06-14T11:12:37.000Z | import abc
from modules.shared.graphInteraction import Interaction, DrawData
from modules.shared.dialogs.edge import EdgeDialog
################
## Base class ##
################
############################
## Some common behaviours ##
############################
# Highlights nodes when mouse passes over
# Priv... | 25.912371 | 107 | 0.7408 | import abc
from modules.shared.graphInteraction import Interaction, DrawData
from modules.shared.dialogs.edge import EdgeDialog
################
## Base class ##
################
class Behaviour():
def _init_(self):
pass
@abc.abstractmethod
def getTriggers():
pass
@abc.abstractmethod
def processDrawData()... | 3,527 | 202 | 680 |
741daec93c26e5097bf7057aa8f1a2e043075911 | 581 | py | Python | riemann/sampling_errors.py | bentran225/riemann | 85c1ec9b7509e91a1de13013f57e9f47e1b3712c | [
"MIT"
] | 2 | 2021-09-28T23:30:27.000Z | 2022-03-28T22:11:26.000Z | riemann/sampling_errors.py | bentran225/riemann | 85c1ec9b7509e91a1de13013f57e9f47e1b3712c | [
"MIT"
] | 7 | 2019-07-22T04:13:43.000Z | 2019-08-08T00:46:08.000Z | riemann/sampling_errors.py | bentran225/riemann | 85c1ec9b7509e91a1de13013f57e9f47e1b3712c | [
"MIT"
] | 5 | 2019-07-22T02:23:18.000Z | 2021-09-29T00:21:29.000Z | #!/usr/bin/env python
"""
RS 2018/03/11: Riemann -- a geometric MCMC sampler
This package supports CTDS's investigations into geometric MCMC, as in
"information geometry", using a connection associated with the Fisher metric.
"""
class RiemannBaseError(Exception):
"""
Simple base class for Riemann exceptio... | 19.366667 | 77 | 0.671256 | #!/usr/bin/env python
"""
RS 2018/03/11: Riemann -- a geometric MCMC sampler
This package supports CTDS's investigations into geometric MCMC, as in
"information geometry", using a connection associated with the Fisher metric.
"""
class RiemannBaseError(Exception):
"""
Simple base class for Riemann exceptio... | 89 | 0 | 54 |
efd0f016c4d97207277e7c9c594d775ea3ad34e7 | 26,652 | py | Python | gui/operations/computer_vision.py | hawwestin/MSR.APO | 5e150a8058b0789996f702e03936037ce3da9e73 | [
"Apache-2.0"
] | 1 | 2020-11-21T19:53:58.000Z | 2020-11-21T19:53:58.000Z | gui/operations/computer_vision.py | hawwestin/MSR.APO | 5e150a8058b0789996f702e03936037ce3da9e73 | [
"Apache-2.0"
] | 64 | 2017-09-02T16:51:48.000Z | 2018-02-23T13:56:24.000Z | gui/operations/computer_vision.py | hawwestin/MSR.APO | 5e150a8058b0789996f702e03936037ce3da9e73 | [
"Apache-2.0"
] | 1 | 2019-10-12T20:09:12.000Z | 2019-10-12T20:09:12.000Z | import copy
from tkinter import filedialog
import cv2
import numpy as np
from PIL import Image
from PIL import ImageTk
from cv2 import *
from matplotlib import pyplot as plt
from gui.operations.repeater import Repeater
colors = {"COLOR": 1,
"GREY": 0}
supported_ext = [
".jpg",
".png"
]
"""
https:... | 37.911807 | 120 | 0.562134 | import copy
from tkinter import filedialog
import cv2
import numpy as np
from PIL import Image
from PIL import ImageTk
from cv2 import *
from matplotlib import pyplot as plt
from gui.operations.repeater import Repeater
colors = {"COLOR": 1,
"GREY": 0}
supported_ext = [
".jpg",
".png"
]
"""
https:... | 13,211 | 795 | 909 |
38a4d9a71af2efe2b36b08f980fb251369ed6c73 | 1,696 | py | Python | AllInOneInstagramBot/plugins/data_analytics.py | AllInOneInstagramBot/bot | b4415fff23c581650c0063a773b10bc3383ff2fe | [
"MIT"
] | null | null | null | AllInOneInstagramBot/plugins/data_analytics.py | AllInOneInstagramBot/bot | b4415fff23c581650c0063a773b10bc3383ff2fe | [
"MIT"
] | null | null | null | AllInOneInstagramBot/plugins/data_analytics.py | AllInOneInstagramBot/bot | b4415fff23c581650c0063a773b10bc3383ff2fe | [
"MIT"
] | null | null | null | import logging
import sys
from AllInOneInstagramBot.core.plugin_loader import Plugin
logger = logging.getLogger(__name__)
class DataAnalytics(Plugin):
"""Generates a PDF analytics report of current username session data"""
| 41.365854 | 150 | 0.599057 | import logging
import sys
from AllInOneInstagramBot.core.plugin_loader import Plugin
logger = logging.getLogger(__name__)
class DataAnalytics(Plugin):
"""Generates a PDF analytics report of current username session data"""
def __init__(self):
super().__init__()
self.description = (
... | 1,411 | 0 | 54 |
d255f3fb58a02d97c9c8851fbcac1756b13912cb | 537 | py | Python | client/commands/__init__.py | 0xedward/pyre-check | dcfe8f45e40f235b49b5d04ed826433e0808f168 | [
"MIT"
] | 5,975 | 2018-05-11T15:54:32.000Z | 2022-03-31T14:38:00.000Z | client/commands/__init__.py | 0xedward/pyre-check | dcfe8f45e40f235b49b5d04ed826433e0808f168 | [
"MIT"
] | 524 | 2018-05-11T16:47:20.000Z | 2022-03-22T17:43:06.000Z | client/commands/__init__.py | 0xedward/pyre-check | dcfe8f45e40f235b49b5d04ed826433e0808f168 | [
"MIT"
] | 501 | 2018-05-11T16:46:29.000Z | 2022-03-19T04:41:57.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import List, Type
from .analyze import Analyze as Analyze
from .command import ( # noqa; noqa; noqa
ClientException as Clien... | 25.571429 | 65 | 0.741155 | # Copyright (c) Facebook, Inc. and its affiliates.
#
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
from typing import List, Type
from .analyze import Analyze as Analyze
from .command import ( # noqa; noqa; noqa
ClientException as Clien... | 0 | 0 | 0 |
0af92050e3e3baf476b72c7562b0a1d6d2fb28ae | 3,032 | py | Python | examples/src/main/python/ml/decision_tree_classification_example.py | christopherbozeman/spark | 14cf753704ea60f358cb870b018cbcf73654f198 | [
"BSD-3-Clause-Open-MPI",
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"MIT-0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | null | null | null | examples/src/main/python/ml/decision_tree_classification_example.py | christopherbozeman/spark | 14cf753704ea60f358cb870b018cbcf73654f198 | [
"BSD-3-Clause-Open-MPI",
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"MIT-0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | null | null | null | examples/src/main/python/ml/decision_tree_classification_example.py | christopherbozeman/spark | 14cf753704ea60f358cb870b018cbcf73654f198 | [
"BSD-3-Clause-Open-MPI",
"PSF-2.0",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"MIT-0",
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause-Clear",
"BSD-3-Clause"
] | null | null | null | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 38.871795 | 98 | 0.747032 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | 0 | 0 | 0 |
9be89039226499a03dce86fa39785ae4b22c0855 | 2,745 | py | Python | blatann/examples/peripheral_battery_service.py | dkkeller/blatann | 2b72df4812f68fb718ab96d16c82343ee35969a5 | [
"BSD-3-Clause"
] | null | null | null | blatann/examples/peripheral_battery_service.py | dkkeller/blatann | 2b72df4812f68fb718ab96d16c82343ee35969a5 | [
"BSD-3-Clause"
] | null | null | null | blatann/examples/peripheral_battery_service.py | dkkeller/blatann | 2b72df4812f68fb718ab96d16c82343ee35969a5 | [
"BSD-3-Clause"
] | null | null | null | """
This example demonstrates using Bluetooth SIG's Battery service as a peripheral.
The peripheral adds the service, then updates the battery level percentage periodically.
This can be used in conjunction with the nRF Connect apps to explore the functionality demonstrated
"""
import time
from blatann import Bl... | 33.072289 | 100 | 0.71184 | """
This example demonstrates using Bluetooth SIG's Battery service as a peripheral.
The peripheral adds the service, then updates the battery level percentage periodically.
This can be used in conjunction with the nRF Connect apps to explore the functionality demonstrated
"""
import time
from blatann import Bl... | 1,405 | 0 | 25 |
a9b58717de2d6152a196872f3894d67c30a04809 | 880 | py | Python | OOP_formy/src/pages/modal_page.py | AntonioIonica/Automation_testing | 6f7c94c55677b0958e6fada24058f1a00d2c0d0e | [
"MIT"
] | null | null | null | OOP_formy/src/pages/modal_page.py | AntonioIonica/Automation_testing | 6f7c94c55677b0958e6fada24058f1a00d2c0d0e | [
"MIT"
] | null | null | null | OOP_formy/src/pages/modal_page.py | AntonioIonica/Automation_testing | 6f7c94c55677b0958e6fada24058f1a00d2c0d0e | [
"MIT"
] | null | null | null | """
Modal page
Where click on given buttons
"""
from pages.base_page import BasePage
import time
from selenium.webdriver.common.by import By
| 25.882353 | 61 | 0.654545 | """
Modal page
Where click on given buttons
"""
from pages.base_page import BasePage
import time
from selenium.webdriver.common.by import By
class ModalPage(BasePage):
MODAL_BTN = (By.ID, 'modal-button')
CLOSE_BTN = (By.ID, 'close-button')
OK_BTN = (By.ID, 'ok-button')
def click_on_ok(self):
... | 514 | 200 | 23 |
0836633f1fdb041422499f605943875a1547cdf2 | 303 | py | Python | setup.py | jrasero/mdmr | 74868089db39f8fb92910a1f702e45256b98ff8e | [
"MIT"
] | null | null | null | setup.py | jrasero/mdmr | 74868089db39f8fb92910a1f702e45256b98ff8e | [
"MIT"
] | 1 | 2021-07-14T21:22:28.000Z | 2021-07-14T21:22:28.000Z | setup.py | jrasero/mdmr | 74868089db39f8fb92910a1f702e45256b98ff8e | [
"MIT"
] | null | null | null | #!/usr/bin/env python
from distutils.core import setup
setup(name='mdmr',
version='1.0',
description='Multivariate distance matrix regression',
author='Javier Rasero',
author_email='jrasero.daparte@gmail.com',
url='',
license='MIT',
packages=['mdmr'],
)
| 21.642857 | 60 | 0.623762 | #!/usr/bin/env python
from distutils.core import setup
setup(name='mdmr',
version='1.0',
description='Multivariate distance matrix regression',
author='Javier Rasero',
author_email='jrasero.daparte@gmail.com',
url='',
license='MIT',
packages=['mdmr'],
)
| 0 | 0 | 0 |
962ef75b9f5ef8a98abd359a07776335b7ce7f09 | 859 | py | Python | cgi-bin/writefiles.py | raspibo/ThermoRed | 55f93e49e3fac6cc919c64d5246d6fdf77e641ee | [
"MIT"
] | null | null | null | cgi-bin/writefiles.py | raspibo/ThermoRed | 55f93e49e3fac6cc919c64d5246d6fdf77e641ee | [
"MIT"
] | 1 | 2015-02-03T18:30:29.000Z | 2015-02-03T18:30:29.000Z | cgi-bin/writefiles.py | raspibo/ThermoRed | 55f93e49e3fac6cc919c64d5246d6fdf77e641ee | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copia files nel .bak
import shutil
# Serve per la parte di gestione html in python
import cgi
import cgitb
import time
# Abilita gli errori al server web/http
cgitb.enable()
# Intestazione HTML
print("<!DOCTYPE html>")
print("""
<html>
<head>
<title>ThermoRed</title>
<meta name="GEN... | 18.276596 | 79 | 0.703143 | #!/usr/bin/env python3
# Copia files nel .bak
import shutil
# Serve per la parte di gestione html in python
import cgi
import cgitb
import time
# Abilita gli errori al server web/http
cgitb.enable()
# Intestazione HTML
print("<!DOCTYPE html>")
print("""
<html>
<head>
<title>ThermoRed</title>
<meta name="GEN... | 0 | 0 | 0 |
ab3209de2fa70f66670005d33fc4f1a7b6a7de8a | 2,463 | py | Python | networkx/algorithms/assortativity/tests/test_neighbor_degree.py | jmmcd/networkx | 207ff7d1e9bfaff013ac77c8d6bb79619892c994 | [
"BSD-3-Clause"
] | 3 | 2020-08-04T20:29:41.000Z | 2020-11-09T09:28:19.000Z | networkx/algorithms/assortativity/tests/test_neighbor_degree.py | jmmcd/networkx | 207ff7d1e9bfaff013ac77c8d6bb79619892c994 | [
"BSD-3-Clause"
] | 30 | 2020-04-15T19:37:40.000Z | 2020-04-22T21:19:35.000Z | networkx/algorithms/assortativity/tests/test_neighbor_degree.py | jmmcd/networkx | 207ff7d1e9bfaff013ac77c8d6bb79619892c994 | [
"BSD-3-Clause"
] | 2 | 2020-03-12T23:20:22.000Z | 2021-02-15T21:54:02.000Z | #!/usr/bin/env python
import networkx as nx
from networkx.testing import almost_equal
| 30.407407 | 70 | 0.550142 | #!/usr/bin/env python
import networkx as nx
from networkx.testing import almost_equal
class TestAverageNeighbor(object):
def test_degree_p4(self):
G = nx.path_graph(4)
answer = {0: 2, 1: 1.5, 2: 1.5, 3: 2}
nd = nx.average_neighbor_degree(G)
assert nd == answer
D = G.to_di... | 2,205 | 13 | 158 |
47d409c1fedf524d43057743731aef1cde8a2406 | 46,702 | py | Python | bright/apigen/typesystem.py | bright-dev/bright | af3ff83d37880787443b1a8e785f375142d42882 | [
"WTFPL"
] | 3 | 2016-05-08T06:13:10.000Z | 2019-02-14T10:01:22.000Z | bright/apigen/typesystem.py | bright-dev/bright | af3ff83d37880787443b1a8e785f375142d42882 | [
"WTFPL"
] | null | null | null | bright/apigen/typesystem.py | bright-dev/bright | af3ff83d37880787443b1a8e785f375142d42882 | [
"WTFPL"
] | null | null | null | """Implements a simple, dynamic type system for API generation.
:author: Anthony Scopatz <scopatz@gmail.com>
Introduction
============
This module provides a suite of tools for denoting, describing, and converting
between various data types and the types coming from various systems. This is
achieved by providing ca... | 37.572003 | 111 | 0.602672 | """Implements a simple, dynamic type system for API generation.
:author: Anthony Scopatz <scopatz@gmail.com>
Introduction
============
This module provides a suite of tools for denoting, describing, and converting
between various data types and the types coming from various systems. This is
achieved by providing ca... | 2,107 | 0 | 114 |
f7b38074e23cdb4c561a986c04702beda05cbe13 | 54,525 | py | Python | pymod/util.py | philpot/wat | e3a654c5169a0de44cf706bcd1d7e854bf9dae41 | [
"Apache-2.0"
] | null | null | null | pymod/util.py | philpot/wat | e3a654c5169a0de44cf706bcd1d7e854bf9dae41 | [
"Apache-2.0"
] | null | null | null | pymod/util.py | philpot/wat | e3a654c5169a0de44cf706bcd1d7e854bf9dae41 | [
"Apache-2.0"
] | 2 | 2016-01-09T13:52:20.000Z | 2018-08-05T13:40:07.000Z | #!/usr/bin/env python
# Filename: util.py
'''
util
@author: Andrew Philpot
@version 0.79
collection of misc utils
Usage: python util.py
Options:
\t-h, --help:\tprint help to STDOUT and quit
\t-v, --verbose:\tverbose output
'''
import sys
import inspect
import types
import getopt
import fileinput
import tempfile
impo... | 33.206456 | 204 | 0.579331 | #!/usr/bin/env python
# Filename: util.py
'''
util
@author: Andrew Philpot
@version 0.79
collection of misc utils
Usage: python util.py
Options:
\t-h, --help:\tprint help to STDOUT and quit
\t-v, --verbose:\tverbose output
'''
import sys
import inspect
import types
import getopt
import fileinput
import tempfile
impo... | 22,805 | 132 | 2,204 |
4f55a5d461268818b8d5225f4c35658531556c78 | 2,507 | py | Python | query_categorizer/models/embedding_model.py | rcourivaud/query_categorizer | d7956b3c5cd76dfaac6760a1dcbab8c28dc9a98f | [
"MIT"
] | null | null | null | query_categorizer/models/embedding_model.py | rcourivaud/query_categorizer | d7956b3c5cd76dfaac6760a1dcbab8c28dc9a98f | [
"MIT"
] | null | null | null | query_categorizer/models/embedding_model.py | rcourivaud/query_categorizer | d7956b3c5cd76dfaac6760a1dcbab8c28dc9a98f | [
"MIT"
] | 2 | 2018-02-09T19:11:15.000Z | 2021-03-27T10:27:45.000Z | from query_categorizer.errors import NotAllResultsException
from query_categorizer.utils import clean_results
import fastText
import numpy as np
| 28.816092 | 115 | 0.5716 | from query_categorizer.errors import NotAllResultsException
from query_categorizer.utils import clean_results
import fastText
import numpy as np
class EmbeddingModel(object):
def __init__(self, path_to_model, label_prefix="__label__"):
"""
:param path_to_model:
:param label_prefix:
... | 0 | 2,338 | 23 |
9c6d652ed944dfdf2a250332d65b50dc1ee4c792 | 1,681 | py | Python | setup.py | Zegocover/python-dataclasses-serialization | 71f98341d7c19b495e967f14022d8aaccaa3643f | [
"MIT"
] | null | null | null | setup.py | Zegocover/python-dataclasses-serialization | 71f98341d7c19b495e967f14022d8aaccaa3643f | [
"MIT"
] | null | null | null | setup.py | Zegocover/python-dataclasses-serialization | 71f98341d7c19b495e967f14022d8aaccaa3643f | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
from os import path
import re
project_root = path.join(path.abspath(path.dirname(__file__)))
setup(
name='dataclasses_serialization',
version=get_version(),
packages=find_packages(include=('dataclasses_serialization', 'dataclasses_serialization.*')),
... | 32.326923 | 114 | 0.690065 | from setuptools import setup, find_packages
from os import path
import re
project_root = path.join(path.abspath(path.dirname(__file__)))
def get_version():
with open(path.join(project_root, 'dataclasses_serialization', '__init__.py'), encoding='utf-8') as init_file:
return re.search(r"^__version__ = ['\... | 509 | 0 | 69 |
6e14fb00b23e91a1caf55da4041be57069a6b0fb | 6,725 | py | Python | owl/owl/scanner.py | badmonkey/owlbear-lang | df4e4501017b7d10bb5bc61ee6c5d98f9c897135 | [
"Apache-2.0"
] | null | null | null | owl/owl/scanner.py | badmonkey/owlbear-lang | df4e4501017b7d10bb5bc61ee6c5d98f9c897135 | [
"Apache-2.0"
] | null | null | null | owl/owl/scanner.py | badmonkey/owlbear-lang | df4e4501017b7d10bb5bc61ee6c5d98f9c897135 | [
"Apache-2.0"
] | null | null | null | import re
from spark_parser.scanner import GenericScanner
from owl.token import OwlbearToken
RESERVED_WORDS = re.split(
r"\s+",
"""
is as or
not and let try end bor bsl bsr div rem pow
type with self case cond bnot band true bxor
error catch begin false
import memory
primitive receive finally undefined other... | 26.581028 | 99 | 0.505428 | import re
from spark_parser.scanner import GenericScanner
from owl.token import OwlbearToken
RESERVED_WORDS = re.split(
r"\s+",
"""
is as or
not and let try end bor bsl bsr div rem pow
type with self case cond bnot band true bxor
error catch begin false
import memory
primitive receive finally undefined other... | 1,259 | 0 | 161 |
4c4d41cc7f1397bc4327cf3635643b0ae58dc824 | 35,844 | py | Python | yahoo_panoptes/plugins/polling/generic/snmp/plugin_polling_generic_snmp.py | varunvarma/panoptes | 733e1b17e01d47fe0a399e2fe635f614cc5a0b88 | [
"Apache-2.0"
] | null | null | null | yahoo_panoptes/plugins/polling/generic/snmp/plugin_polling_generic_snmp.py | varunvarma/panoptes | 733e1b17e01d47fe0a399e2fe635f614cc5a0b88 | [
"Apache-2.0"
] | null | null | null | yahoo_panoptes/plugins/polling/generic/snmp/plugin_polling_generic_snmp.py | varunvarma/panoptes | 733e1b17e01d47fe0a399e2fe635f614cc5a0b88 | [
"Apache-2.0"
] | null | null | null | """
This module implements a generic SNMP Panoptes plugin that can consume enrichments for a range of device types in order
to poll those same devices.
"""
import json
import re
import time
from yahoo_panoptes.framework import metrics
from yahoo_panoptes.framework import exceptions
from yahoo_panoptes.framework import... | 47.412698 | 120 | 0.575354 | """
This module implements a generic SNMP Panoptes plugin that can consume enrichments for a range of device types in order
to poll those same devices.
"""
import json
import re
import time
from yahoo_panoptes.framework import metrics
from yahoo_panoptes.framework import exceptions
from yahoo_panoptes.framework import... | 634 | 33,661 | 92 |
d3eba687e813c8a24053dabb9857a302f2967953 | 2,519 | py | Python | DailyProgrammer/DP20160115C.py | DayGitH/Python-Challenges | bc32f1332a92fcc2dfa6f5ea4d95f8a8d64c3edf | [
"MIT"
] | 2 | 2020-12-23T18:59:22.000Z | 2021-04-14T13:16:09.000Z | DailyProgrammer/DP20160115C.py | DayGitH/Python-Challenges | bc32f1332a92fcc2dfa6f5ea4d95f8a8d64c3edf | [
"MIT"
] | null | null | null | DailyProgrammer/DP20160115C.py | DayGitH/Python-Challenges | bc32f1332a92fcc2dfa6f5ea4d95f8a8d64c3edf | [
"MIT"
] | null | null | null | """
[2016-01-15] Challenge #249 [Hard] Museum Cameras
https://www.reddit.com/r/dailyprogrammer/comments/41346z/20160115_challenge_249_hard_museum_cameras/
# Description
You run a museum, and you have a small budget - but you have to protect the museum with cameras. Given some
descriptions of rooms, can you organize t... | 43.431034 | 119 | 0.621675 | """
[2016-01-15] Challenge #249 [Hard] Museum Cameras
https://www.reddit.com/r/dailyprogrammer/comments/41346z/20160115_challenge_249_hard_museum_cameras/
# Description
You run a museum, and you have a small budget - but you have to protect the museum with cameras. Given some
descriptions of rooms, can you organize t... | -1 | 0 | 23 |
9cbcb84be9cbaa461b0fba8d57cd4a495b8236b0 | 72 | py | Python | clean/request/filters/fields/__init__.py | bahnlink/pyclean | 558d75341082472606788e088809831f6ea543c0 | [
"MIT"
] | null | null | null | clean/request/filters/fields/__init__.py | bahnlink/pyclean | 558d75341082472606788e088809831f6ea543c0 | [
"MIT"
] | 2 | 2021-03-25T21:49:39.000Z | 2021-06-01T22:12:00.000Z | clean/request/filters/fields/__init__.py | bahnlink/pyclean | 558d75341082472606788e088809831f6ea543c0 | [
"MIT"
] | 1 | 2018-06-07T17:31:56.000Z | 2018-06-07T17:31:56.000Z | from .string import StringFilter
from .datetime_range import DateFilter
| 24 | 38 | 0.861111 | from .string import StringFilter
from .datetime_range import DateFilter
| 0 | 0 | 0 |
1ca1c673486030f27aaf7ed4bccf8eba33675722 | 11,088 | py | Python | env3.10/lib/python3.10/site-packages/pyramid_tm/__init__.py | slmaankhaan/todo_app | 4e5a81a789e02be84525682f3ec5d0bfc3d91e8d | [
"MIT"
] | null | null | null | env3.10/lib/python3.10/site-packages/pyramid_tm/__init__.py | slmaankhaan/todo_app | 4e5a81a789e02be84525682f3ec5d0bfc3d91e8d | [
"MIT"
] | null | null | null | env3.10/lib/python3.10/site-packages/pyramid_tm/__init__.py | slmaankhaan/todo_app | 4e5a81a789e02be84525682f3ec5d0bfc3d91e8d | [
"MIT"
] | null | null | null | import sys
from pyramid.exceptions import ConfigurationError
from pyramid.exceptions import NotFound
from pyramid.settings import asbool
from pyramid.tweens import EXCVIEW
from pyramid.util import DottedNameResolver
import transaction
import warnings
import zope.interface
try:
from pyramid_retry import IRetryableE... | 36.117264 | 79 | 0.650523 | import sys
from pyramid.exceptions import ConfigurationError
from pyramid.exceptions import NotFound
from pyramid.settings import asbool
from pyramid.tweens import EXCVIEW
from pyramid.util import DottedNameResolver
import transaction
import warnings
import zope.interface
try:
from pyramid_retry import IRetryableE... | 6,665 | 0 | 202 |
983e9800f41de82213b3f7285b95f08cae900d7a | 691 | py | Python | servio-backend-app/servio/service/migrations/0007_remove_service_feedbackgiven_service_feedbacklist.py | emreerkaslan/SWE573 | 086f44bfbf6feb9629148de820d76aef1088c909 | [
"MIT"
] | null | null | null | servio-backend-app/servio/service/migrations/0007_remove_service_feedbackgiven_service_feedbacklist.py | emreerkaslan/SWE573 | 086f44bfbf6feb9629148de820d76aef1088c909 | [
"MIT"
] | 19 | 2021-10-21T12:43:36.000Z | 2021-12-05T14:21:55.000Z | servio-backend-app/servio/service/migrations/0007_remove_service_feedbackgiven_service_feedbacklist.py | emreerkaslan/Servio | 086f44bfbf6feb9629148de820d76aef1088c909 | [
"MIT"
] | null | null | null | # Generated by Django 4.0 on 2022-01-07 16:26
from django.db import migrations, models
import django.db.models.deletion
| 27.64 | 157 | 0.632417 | # Generated by Django 4.0 on 2022-01-07 16:26
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('feedback', '0004_alter_feedback_taker'),
('service', '0006_alter_service_date'),
]
operations = [
mig... | 0 | 546 | 23 |
c7585fac919bf9e8b7d4076ae5255a0091325824 | 12,676 | py | Python | RunAndPlot.py | kachourim/MieScatteringPEC | df6f4ffaa72d75ddd4488cb8f7f507e18155fa1e | [
"MIT"
] | null | null | null | RunAndPlot.py | kachourim/MieScatteringPEC | df6f4ffaa72d75ddd4488cb8f7f507e18155fa1e | [
"MIT"
] | null | null | null | RunAndPlot.py | kachourim/MieScatteringPEC | df6f4ffaa72d75ddd4488cb8f7f507e18155fa1e | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
from numpy import *
from matplotlib.pyplot import *
from matplotlib.ticker import StrMethodFormatter
from mpl_toolkits import mplot3d
from os import system, path, remove
import sys
import re
# ----------------------------------------------------------------
# Running this... | 25.250996 | 206 | 0.524692 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
from numpy import *
from matplotlib.pyplot import *
from matplotlib.ticker import StrMethodFormatter
from mpl_toolkits import mplot3d
from os import system, path, remove
import sys
import re
# ----------------------------------------------------------------
# Running this... | 0 | 0 | 0 |
0bf431d2785411629685e804d55562f39393e330 | 3,442 | py | Python | pingdom/pingdom.py | srinivas-kandula/integrations | 7c9857fadacc845b3261ba5c1244faccd6511c80 | [
"Apache-2.0"
] | 10 | 2016-09-23T21:09:55.000Z | 2022-02-05T08:12:43.000Z | pingdom/pingdom.py | srinivas-kandula/integrations | 7c9857fadacc845b3261ba5c1244faccd6511c80 | [
"Apache-2.0"
] | 20 | 2017-06-29T00:20:56.000Z | 2022-03-24T07:32:15.000Z | pingdom/pingdom.py | srinivas-kandula/integrations | 7c9857fadacc845b3261ba5c1244faccd6511c80 | [
"Apache-2.0"
] | 39 | 2016-11-22T17:19:44.000Z | 2022-03-24T07:09:42.000Z | import sys
import requests
import json
import argparse
import time
parser = argparse.ArgumentParser(description='Collects monitoring data from Pingdom.')
parser.add_argument('-u', '--pingdom-user-name', help='The Pingdom User Name', required=True)
parser.add_argument('-p', '--pingdom-password', help='The Pingdom Passw... | 35.484536 | 129 | 0.597908 | import sys
import requests
import json
import argparse
import time
parser = argparse.ArgumentParser(description='Collects monitoring data from Pingdom.')
parser.add_argument('-u', '--pingdom-user-name', help='The Pingdom User Name', required=True)
parser.add_argument('-p', '--pingdom-password', help='The Pingdom Passw... | 2,462 | -7 | 184 |
ff25d1ad17d2628edda77fd7b702158c89f51d8d | 9,816 | py | Python | ipa/browser.py | liepa-project/liepa_ipa | f53e6895df97e8965f59b0a4e0e62704189f1993 | [
"BSD-2-Clause"
] | null | null | null | ipa/browser.py | liepa-project/liepa_ipa | f53e6895df97e8965f59b0a4e0e62704189f1993 | [
"BSD-2-Clause"
] | null | null | null | ipa/browser.py | liepa-project/liepa_ipa | f53e6895df97e8965f59b0a4e0e62704189f1993 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# vim: set fileencoding=utf-8
import time
import logger
import subprocess
import pythoncom
from utils import GetAssocExe, GetWindowPID, SetForegroundWindow, COMDispatch
import pywinauto.application
SUPPORTED_BROWSERS = ('iexplore', 'firefox', 'chrome', 'opera', 'seamonkey')
lo... | 37.323194 | 101 | 0.597596 | # -*- coding: utf-8 -*-
# vim: set fileencoding=utf-8
import time
import logger
import subprocess
import pythoncom
from utils import GetAssocExe, GetWindowPID, SetForegroundWindow, COMDispatch
import pywinauto.application
SUPPORTED_BROWSERS = ('iexplore', 'firefox', 'chrome', 'opera', 'seamonkey')
lo... | 4,202 | 4,548 | 192 |
b90bf06a55b9105c9d71b0afdea3f1e5af63492e | 14,704 | py | Python | csvimport_connector.py | splunk-soar-connectors/csvimport | cb1bbf5e3d137e5568a6475ab0da44f42ad94cff | [
"Apache-2.0"
] | 1 | 2022-02-13T18:56:52.000Z | 2022-02-13T18:56:52.000Z | csvimport_connector.py | splunk-soar-connectors/csvimport | cb1bbf5e3d137e5568a6475ab0da44f42ad94cff | [
"Apache-2.0"
] | 2 | 2021-12-22T12:32:17.000Z | 2022-01-21T17:40:38.000Z | csvimport_connector.py | splunk-soar-connectors/csvimport | cb1bbf5e3d137e5568a6475ab0da44f42ad94cff | [
"Apache-2.0"
] | null | null | null | # File: csvimport_connector.py
# Copyright (c) 2022 Splunk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 40.065395 | 130 | 0.623096 | # File: csvimport_connector.py
# Copyright (c) 2022 Splunk Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 12,056 | 1,045 | 72 |
4b72d6611feb8783c6b64b2665a776971c7c531f | 5,898 | py | Python | nbs/30_drug_disease_associations/100-lincs/py/039-save_full_predictions.py | greenelab/phenoplier | 95f04b17f0b5227560fcf32ac0a85b2c5aa9001f | [
"BSD-2-Clause-Patent"
] | 3 | 2021-08-17T21:59:19.000Z | 2022-03-08T15:46:24.000Z | nbs/30_drug_disease_associations/100-lincs/py/039-save_full_predictions.py | greenelab/phenoplier | 95f04b17f0b5227560fcf32ac0a85b2c5aa9001f | [
"BSD-2-Clause-Patent"
] | 4 | 2021-08-04T13:57:24.000Z | 2021-10-11T14:57:15.000Z | nbs/30_drug_disease_associations/100-lincs/py/039-save_full_predictions.py | greenelab/phenoplier | 95f04b17f0b5227560fcf32ac0a85b2c5aa9001f | [
"BSD-2-Clause-Patent"
] | null | null | null | # ---
# jupyter:
# jupytext:
# cell_metadata_filter: all,-execution,-papermill,-trusted
# formats: ipynb,py//py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.7.1
# kernelspec:
# display_name: Python 3
# ... | 25.205128 | 205 | 0.656663 | # ---
# jupyter:
# jupytext:
# cell_metadata_filter: all,-execution,-papermill,-trusted
# formats: ipynb,py//py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.3'
# jupytext_version: 1.7.1
# kernelspec:
# display_name: Python 3
# ... | 0 | 0 | 0 |
6d439c13d528ed75dc486e893454eb955a854f40 | 3,604 | py | Python | ginga/util/io_asdf.py | chyan26/ginga | e00c887d8660e0a4178f9681ca7ea7784b7ca129 | [
"BSD-3-Clause"
] | null | null | null | ginga/util/io_asdf.py | chyan26/ginga | e00c887d8660e0a4178f9681ca7ea7784b7ca129 | [
"BSD-3-Clause"
] | null | null | null | ginga/util/io_asdf.py | chyan26/ginga | e00c887d8660e0a4178f9681ca7ea7784b7ca129 | [
"BSD-3-Clause"
] | null | null | null | # This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
"""
Module wrapper for loading ASDF files.
.. note:: The API for this module is currently unstable
and may change in a future release.
"""
import numpy as np
try:
import asdf # noqa
have_asd... | 25.380282 | 75 | 0.63263 | # This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
"""
Module wrapper for loading ASDF files.
.. note:: The API for this module is currently unstable
and may change in a future release.
"""
import numpy as np
try:
import asdf # noqa
have_asd... | 1,067 | 9 | 239 |
c3f28201177662d5d9c4b934600c44b953d37bdf | 2,129 | py | Python | codegen/filters.py | lrbsunday/autointerface | 02fcae974b292831856cd9cd9f98b1fd5ae4875a | [
"MIT"
] | 1 | 2018-10-01T02:47:37.000Z | 2018-10-01T02:47:37.000Z | codegen/filters.py | lrbsunday/autointerface | 02fcae974b292831856cd9cd9f98b1fd5ae4875a | [
"MIT"
] | null | null | null | codegen/filters.py | lrbsunday/autointerface | 02fcae974b292831856cd9cd9f98b1fd5ae4875a | [
"MIT"
] | null | null | null | import logging
| 22.410526 | 65 | 0.584312 | import logging
def format_value(value):
if value is None:
return 'None'
elif isinstance(value, int):
return repr(value)
elif isinstance(value, float):
return repr(round(value, 4))
elif isinstance(value, bool):
return repr(value)
elif isinstance(value, str):
... | 1,934 | 0 | 230 |
b83743466f4ff07f8a6ee4dd24ca96c47f60cf3f | 15,121 | py | Python | latex_suite/latex.py | jbuerman/latexsuite | 699af5caf6e95e89864f9c8debe94f1a73b40aec | [
"MIT"
] | null | null | null | latex_suite/latex.py | jbuerman/latexsuite | 699af5caf6e95e89864f9c8debe94f1a73b40aec | [
"MIT"
] | 4 | 2022-03-03T12:56:43.000Z | 2022-03-21T15:59:40.000Z | latex_suite/latex.py | jbuerman/latexsuite | 699af5caf6e95e89864f9c8debe94f1a73b40aec | [
"MIT"
] | null | null | null | """
Compiling tex files and processing bibliography (bib) files.
"""
import subprocess
import sys
import threading
import time
import latex_suite.util
class Outcome:
"""
The outcome of compiling or processing latex and related files.
"""
UNKNOWN = -1
SUCCESS = 0
FAILURE = 1
ABORTED = 2
... | 33.45354 | 118 | 0.633556 | """
Compiling tex files and processing bibliography (bib) files.
"""
import subprocess
import sys
import threading
import time
import latex_suite.util
class Outcome:
"""
The outcome of compiling or processing latex and related files.
"""
UNKNOWN = -1
SUCCESS = 0
FAILURE = 1
ABORTED = 2
... | 1,269 | 0 | 216 |
6c9d791660dbb5343519e0da1ee9f93cb0a18126 | 29,493 | py | Python | xarray/tests/test_conventions.py | metocean/xarray | f87bb0beadd937e3e9657e6d686a20b2bb288d2b | [
"Apache-2.0"
] | null | null | null | xarray/tests/test_conventions.py | metocean/xarray | f87bb0beadd937e3e9657e6d686a20b2bb288d2b | [
"Apache-2.0"
] | null | null | null | xarray/tests/test_conventions.py | metocean/xarray | f87bb0beadd937e3e9657e6d686a20b2bb288d2b | [
"Apache-2.0"
] | 1 | 2018-08-24T00:08:21.000Z | 2018-08-24T00:08:21.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import contextlib
import numpy as np
import pandas as pd
import warnings
from xarray import conventions, Variable, Dataset, open_dataset
from xarray.core import utils, indexing
from . import TestCase, requires_... | 45.234663 | 89 | 0.563897 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import contextlib
import numpy as np
import pandas as pd
import warnings
from xarray import conventions, Variable, Dataset, open_dataset
from xarray.core import utils, indexing
from . import TestCase, requires_... | 26,397 | 1,223 | 705 |
3981ecaa83bb29cba8bdcb7dba55ef8054904492 | 4,472 | py | Python | api2/Task2_groupbased.py | shyam-patel-kira/LA-CO-SS | 76ace6159b5fcf60063e52809b7dac76ccf4952d | [
"BSD-2-Clause"
] | null | null | null | api2/Task2_groupbased.py | shyam-patel-kira/LA-CO-SS | 76ace6159b5fcf60063e52809b7dac76ccf4952d | [
"BSD-2-Clause"
] | null | null | null | api2/Task2_groupbased.py | shyam-patel-kira/LA-CO-SS | 76ace6159b5fcf60063e52809b7dac76ccf4952d | [
"BSD-2-Clause"
] | null | null | null | import numpy as np
import networkx as nx
from src import get_img_data_for_2 as gi
import configparser as cp
import Visualize as vis
import Helper as hp
import LocationMapping as LM
import os
image_ids,imgs,cos_img,sorted_k = gi.get_data()
k = input("Enter the number of nearest neighbours ")
k = int(k)
fname = 'IdxI... | 32.405797 | 117 | 0.617174 | import numpy as np
import networkx as nx
from src import get_img_data_for_2 as gi
import configparser as cp
import Visualize as vis
import Helper as hp
import LocationMapping as LM
import os
image_ids,imgs,cos_img,sorted_k = gi.get_data()
k = input("Enter the number of nearest neighbours ")
k = int(k)
fname = 'IdxI... | 0 | 0 | 0 |
cbd53d43569d9ed50e4b0d34c6628d8bbf07b6e5 | 2,584 | py | Python | src/ID_presentations.py | faycalki/medieval-conquests | 113e13e2b166b79517c14f2c13f7561307a89f75 | [
"MIT"
] | 7 | 2019-08-11T14:20:20.000Z | 2021-11-21T06:48:24.000Z | src/ID_presentations.py | faycalki/medieval-conquests | 113e13e2b166b79517c14f2c13f7561307a89f75 | [
"MIT"
] | null | null | null | src/ID_presentations.py | faycalki/medieval-conquests | 113e13e2b166b79517c14f2c13f7561307a89f75 | [
"MIT"
] | null | null | null | prsnt_game_start = 0
prsnt_game_credits = 1
prsnt_game_profile_banner_selection = 2
prsnt_game_custom_battle_designer = 3
prsnt_game_multiplayer_admin_panel = 4
prsnt_multiplayer_welcome_message = 5
prsnt_multiplayer_team_select = 6
prsnt_multiplayer_troop_select = 7
prsnt_multiplayer_item_select = 8
prsnt_multiplayer_... | 31.512195 | 51 | 0.874613 | prsnt_game_start = 0
prsnt_game_credits = 1
prsnt_game_profile_banner_selection = 2
prsnt_game_custom_battle_designer = 3
prsnt_game_multiplayer_admin_panel = 4
prsnt_multiplayer_welcome_message = 5
prsnt_multiplayer_team_select = 6
prsnt_multiplayer_troop_select = 7
prsnt_multiplayer_item_select = 8
prsnt_multiplayer_... | 0 | 0 | 0 |
929c4b982c2231ed813c23c08fd0230e0cc9d625 | 2,750 | py | Python | gameowfication/verlet.py | Gato-X/NotYourData | 98bd79480795aa6b8ad480aa5c1779b3e8203624 | [
"MIT"
] | null | null | null | gameowfication/verlet.py | Gato-X/NotYourData | 98bd79480795aa6b8ad480aa5c1779b3e8203624 | [
"MIT"
] | null | null | null | gameowfication/verlet.py | Gato-X/NotYourData | 98bd79480795aa6b8ad480aa5c1779b3e8203624 | [
"MIT"
] | null | null | null | """
The MIT License (MIT)
Copyright (c) 2015 Guillermo Romero Franco (AKA Gato)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use... | 29.569892 | 100 | 0.664727 | """
The MIT License (MIT)
Copyright (c) 2015 Guillermo Romero Franco (AKA Gato)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use... | 1,260 | 0 | 291 |
50883d337dbb2a5c8c42ee48ff9460aa52c1b14a | 1,755 | py | Python | djforms/admissions/admitted/models.py | carthagecollege/django-djforms | 6d05a13223646f47062f827c6d90c88bcbdcb470 | [
"Unlicense"
] | null | null | null | djforms/admissions/admitted/models.py | carthagecollege/django-djforms | 6d05a13223646f47062f827c6d90c88bcbdcb470 | [
"Unlicense"
] | null | null | null | djforms/admissions/admitted/models.py | carthagecollege/django-djforms | 6d05a13223646f47062f827c6d90c88bcbdcb470 | [
"Unlicense"
] | null | null | null | from django.db import models
from djtools.fields.validators import credit_gpa_validator
STATUS = (
("Freshman","Freshman"),
("Transfer","Transfer"),
)
GPA_SCALE = (
("4.0","4.0"),
("5.0","5.0"),
("6.0","6.0"),
("7.0","7.0"),
("8.0","8.0"),
("9.0","9.0"),
("10.0","1... | 24.71831 | 63 | 0.556125 | from django.db import models
from djtools.fields.validators import credit_gpa_validator
STATUS = (
("Freshman","Freshman"),
("Transfer","Transfer"),
)
GPA_SCALE = (
("4.0","4.0"),
("5.0","5.0"),
("6.0","6.0"),
("7.0","7.0"),
("8.0","8.0"),
("9.0","9.0"),
("10.0","1... | 61 | 1,275 | 24 |
934cca0d958009c16662cb83330fd444d68a3594 | 288 | py | Python | db/model/rating.py | egemenzeytinci/recommovie | fbbef77855c66ad37606b7813a7a3cefb38c4e88 | [
"MIT"
] | 14 | 2018-10-10T16:53:38.000Z | 2021-08-09T14:15:44.000Z | db/model/rating.py | egemenzeytinci/recommovie | fbbef77855c66ad37606b7813a7a3cefb38c4e88 | [
"MIT"
] | null | null | null | db/model/rating.py | egemenzeytinci/recommovie | fbbef77855c66ad37606b7813a7a3cefb38c4e88 | [
"MIT"
] | 2 | 2019-05-28T08:50:03.000Z | 2020-11-19T09:13:40.000Z | from db import Base
from sqlalchemy import Column, Float, Integer, String
| 26.181818 | 62 | 0.725694 | from db import Base
from sqlalchemy import Column, Float, Integer, String
class Rating(Base):
__tablename__ = 'ratings'
title_id = Column('title_id', String(9), primary_key=True)
average_rating = Column('average_rating', Float)
num_votes = Column('num_votes', Integer)
| 0 | 190 | 23 |
e788d9a3481f3ecd5da85820ea946f41c5285369 | 3,686 | py | Python | integratingmachinelearning/cfn/lambda_functions/create_thing.py | racheliurui/aws-iot-events-accelerators | 2905825720d9dd252d8d1878f5b363a60b87d054 | [
"MIT-0"
] | 9 | 2019-10-17T06:22:07.000Z | 2021-10-20T17:41:12.000Z | integratingmachinelearning/cfn/lambda_functions/create_thing.py | racheliurui/aws-iot-events-accelerators | 2905825720d9dd252d8d1878f5b363a60b87d054 | [
"MIT-0"
] | 2 | 2019-12-26T10:40:07.000Z | 2019-12-28T07:23:06.000Z | integratingmachinelearning/cfn/lambda_functions/create_thing.py | racheliurui/aws-iot-events-accelerators | 2905825720d9dd252d8d1878f5b363a60b87d054 | [
"MIT-0"
] | 4 | 2019-12-26T09:22:15.000Z | 2021-10-30T20:16:51.000Z | import sys
import json
import logging
import cfnresponse
import boto3
from botocore.exceptions import ClientError
logger = logging.getLogger()
logger.setLevel(logging.INFO)
policyDocument = {
"Version": "2012-10-17",
"Statement": [
{"Effect": "Allow", "Action": "iot:*", "Resource": "*"},
],
}
con... | 36.49505 | 87 | 0.574607 | import sys
import json
import logging
import cfnresponse
import boto3
from botocore.exceptions import ClientError
logger = logging.getLogger()
logger.setLevel(logging.INFO)
policyDocument = {
"Version": "2012-10-17",
"Statement": [
{"Effect": "Allow", "Action": "iot:*", "Resource": "*"},
],
}
con... | 2,748 | 0 | 23 |
f3e764a5139f9986d23ea10a9f37247f37f1351c | 659 | py | Python | app/museolib/widgets/tutorials/7.py | urbanlab/museotouch-educatouch | 9ad8f4329a84ba69147ffef57dc564082153bf02 | [
"MIT"
] | 1 | 2018-02-09T12:56:01.000Z | 2018-02-09T12:56:01.000Z | app/museolib/widgets/tutorials/7.py | urbanlab/museotouch-educatouch | 9ad8f4329a84ba69147ffef57dc564082153bf02 | [
"MIT"
] | null | null | null | app/museolib/widgets/tutorials/7.py | urbanlab/museotouch-educatouch | 9ad8f4329a84ba69147ffef57dc564082153bf02 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from kivy.uix.widget import Widget
from kivy.graphics import Color, Rectangle
from kivy.uix.label import Label
from museolib.widgets.tutorials.tutoitem import TutoItem
| 36.611111 | 102 | 0.728376 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from kivy.uix.widget import Widget
from kivy.graphics import Color, Rectangle
from kivy.uix.label import Label
from museolib.widgets.tutorials.tutoitem import TutoItem
class TutoWidget(Widget):
def __init__(self,img_path):
super(TutoWidget,self).__init__()
s... | 388 | 4 | 48 |
129eb24a9c880ecaa6bb8f1b05380469e5a65ab5 | 1,244 | py | Python | tests/test_webdriver_remote.py | Sankhe-LLC/splinter | 62297148a6a95211e73fa1b747afb4dd8da8e764 | [
"BSD-3-Clause"
] | 1 | 2022-03-25T20:49:52.000Z | 2022-03-25T20:49:52.000Z | tests/test_webdriver_remote.py | Sankhe-LLC/splinter | 62297148a6a95211e73fa1b747afb4dd8da8e764 | [
"BSD-3-Clause"
] | null | null | null | tests/test_webdriver_remote.py | Sankhe-LLC/splinter | 62297148a6a95211e73fa1b747afb4dd8da8e764 | [
"BSD-3-Clause"
] | 1 | 2020-07-28T17:00:58.000Z | 2020-07-28T17:00:58.000Z | # -*- coding: utf-8 -*-
# Copyright 2013 splinter authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
try:
from urllib import urlopen
except ImportError:
from urllib.request import urlopen
import unittest
from splinter import Bro... | 26.468085 | 62 | 0.71865 | # -*- coding: utf-8 -*-
# Copyright 2013 splinter authors. All rights reserved.
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file.
try:
from urllib import urlopen
except ImportError:
from urllib.request import urlopen
import unittest
from splinter import Bro... | 382 | 404 | 46 |
eaa3b152e77db9545a20877a2eb2ba8391232770 | 47 | py | Python | grortir/main/model/processes/factories/__init__.py | wojtekPi/grortir | 0ef8b495527a4f3861e5df5db756d0ee3ed4aa6f | [
"MIT"
] | null | null | null | grortir/main/model/processes/factories/__init__.py | wojtekPi/grortir | 0ef8b495527a4f3861e5df5db756d0ee3ed4aa6f | [
"MIT"
] | null | null | null | grortir/main/model/processes/factories/__init__.py | wojtekPi/grortir | 0ef8b495527a4f3861e5df5db756d0ee3ed4aa6f | [
"MIT"
] | null | null | null | """Contains factories related to processes."""
| 23.5 | 46 | 0.744681 | """Contains factories related to processes."""
| 0 | 0 | 0 |
13b01d77ebd0680db5e98329aa2028f50af5c14e | 935 | py | Python | gdsfactory/samples/17_ports.py | jorgepadilla19/gdsfactory | 68e1c18257a75d4418279851baea417c8899a165 | [
"MIT"
] | 42 | 2020-05-25T09:33:45.000Z | 2022-03-29T03:41:19.000Z | gdsfactory/samples/17_ports.py | jorgepadilla19/gdsfactory | 68e1c18257a75d4418279851baea417c8899a165 | [
"MIT"
] | 133 | 2020-05-28T18:29:04.000Z | 2022-03-31T22:21:42.000Z | gdsfactory/samples/17_ports.py | jorgepadilla19/gdsfactory | 68e1c18257a75d4418279851baea417c8899a165 | [
"MIT"
] | 17 | 2020-06-30T07:07:50.000Z | 2022-03-17T15:45:27.000Z | """
Ports define where each port has:
- name
- midpoint: (x, y)
- width:
- orientation: (deg) 0, 90, 180, 270.
where 0 faces east, 90 (north), 180 (west), 270 (south)
"""
from typing import Tuple
import gdsfactory as gf
from gdsfactory.component import Component
@gf.cell
def test_component_with_port(
leng... | 19.081633 | 84 | 0.586096 | """
Ports define where each port has:
- name
- midpoint: (x, y)
- width:
- orientation: (deg) 0, 90, 180, 270.
where 0 faces east, 90 (north), 180 (west), 270 (south)
"""
from typing import Tuple
import gdsfactory as gf
from gdsfactory.component import Component
@gf.cell
def test_component_with_port(
leng... | 0 | 0 | 0 |
60ddd7eaf7552c1eb0c29845fef56fde3ae8c0ac | 1,769 | py | Python | wot/commands/optimal_transport.py | faro1219/wot | fbe5b63e64a54857d3aebd55d6313d06b39f74de | [
"BSD-3-Clause"
] | null | null | null | wot/commands/optimal_transport.py | faro1219/wot | fbe5b63e64a54857d3aebd55d6313d06b39f74de | [
"BSD-3-Clause"
] | null | null | null | wot/commands/optimal_transport.py | faro1219/wot | fbe5b63e64a54857d3aebd55d6313d06b39f74de | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import wot.io
import wot.ot
| 35.38 | 119 | 0.578293 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import wot.io
import wot.ot
def main(argv):
parser = wot.ot.OptimalTransportHelper.create_base_parser('Compute transport maps between pairs of time points')
parser.add_argument('--format', help=wot.commands.FORMAT_HELP, default='loom', choices=wot.commands.FORMA... | 1,669 | 0 | 23 |
b95e1af1a9c0c7f99faa2906e927682ebe54725b | 6,811 | py | Python | src/asr/asr_utils.py | arendu/espnet | c98079008b064f3d297ff1b1f6f5d3817f6fb967 | [
"Apache-2.0"
] | null | null | null | src/asr/asr_utils.py | arendu/espnet | c98079008b064f3d297ff1b1f6f5d3817f6fb967 | [
"Apache-2.0"
] | null | null | null | src/asr/asr_utils.py | arendu/espnet | c98079008b064f3d297ff1b1f6f5d3817f6fb967 | [
"Apache-2.0"
] | 1 | 2021-12-16T08:24:31.000Z | 2021-12-16T08:24:31.000Z | #!/usr/bin/env python
# Copyright 2017 Johns Hopkins University (Shinji Watanabe)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import logging
# chainer related
import chainer
from chainer import training
import numpy as np
# * -------------------- agumenting data prep -------------------- *
# * ... | 33.885572 | 110 | 0.615328 | #!/usr/bin/env python
# Copyright 2017 Johns Hopkins University (Shinji Watanabe)
# Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0)
import logging
# chainer related
import chainer
from chainer import training
import numpy as np
# * -------------------- agumenting data prep -------------------- *
def mak... | 5,278 | 0 | 291 |
2e169f327a9ef609b7fbe52c8c056361c9403d22 | 4,338 | py | Python | src/scs_philips_hue/client/rest_client.py | south-coast-science/scs_philips_hue | 80f4e7f0e7b3b7a11af2326b4c7e18871c5a7040 | [
"MIT"
] | null | null | null | src/scs_philips_hue/client/rest_client.py | south-coast-science/scs_philips_hue | 80f4e7f0e7b3b7a11af2326b4c7e18871c5a7040 | [
"MIT"
] | null | null | null | src/scs_philips_hue/client/rest_client.py | south-coast-science/scs_philips_hue | 80f4e7f0e7b3b7a11af2326b4c7e18871c5a7040 | [
"MIT"
] | null | null | null | """
Created on 27 Oct 2017
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
header:
CURLOPT_HTTPHEADER => array('Accept: application/json'),
"""
import json
from scs_core.data.json import JSONify
from scs_core.client.http_client import HTTPClient
from scs_core.sys.http_exception import HTTPException
fro... | 27.630573 | 118 | 0.520055 | """
Created on 27 Oct 2017
@author: Bruno Beloff (bruno.beloff@southcoastscience.com)
header:
CURLOPT_HTTPHEADER => array('Accept: application/json'),
"""
import json
from scs_core.data.json import JSONify
from scs_core.client.http_client import HTTPClient
from scs_core.sys.http_exception import HTTPException
fro... | 2,676 | 0 | 242 |
459e6b902da7ea32220ceaa4c91f33095d0a8cbe | 2,886 | py | Python | utils.py | joaootavio93/3DFaceTracking | 39471c87f6d9d6a79615212d68bef80b710aaf15 | [
"MIT"
] | null | null | null | utils.py | joaootavio93/3DFaceTracking | 39471c87f6d9d6a79615212d68bef80b710aaf15 | [
"MIT"
] | null | null | null | utils.py | joaootavio93/3DFaceTracking | 39471c87f6d9d6a79615212d68bef80b710aaf15 | [
"MIT"
] | null | null | null | """
Contains common functions.
"""
import cv2
import numpy as np
def add_alpha_channel(img):
""" Adds alpha channel to an image.
Parameters:
img (mat): The image which will be received the alpha channel.
Returns:
mat: The image with alpha channel.
"""
gray_img = cv2.c... | 31.032258 | 108 | 0.590783 | """
Contains common functions.
"""
import cv2
import numpy as np
def add_alpha_channel(img):
""" Adds alpha channel to an image.
Parameters:
img (mat): The image which will be received the alpha channel.
Returns:
mat: The image with alpha channel.
"""
gray_img = cv2.c... | 427 | 0 | 23 |
b86d03a8a256eb247660faa35dbe0439b589ee27 | 101 | py | Python | xml2json/exceptions.py | dimagi/xml2json | 041b1ef1b98ed28bb6e3bd1c9d626b88e3f45c92 | [
"BSD-3-Clause"
] | 3 | 2017-04-17T23:15:20.000Z | 2019-04-16T18:40:30.000Z | xml2json/exceptions.py | dimagi/xml2json | 041b1ef1b98ed28bb6e3bd1c9d626b88e3f45c92 | [
"BSD-3-Clause"
] | 6 | 2015-05-13T20:08:26.000Z | 2021-05-12T21:32:09.000Z | xml2json/exceptions.py | dimagi/xml2json | 041b1ef1b98ed28bb6e3bd1c9d626b88e3f45c92 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import absolute_import
from lxml import etree
XMLSyntaxError = etree.XMLSyntaxError
| 20.2 | 38 | 0.861386 | from __future__ import absolute_import
from lxml import etree
XMLSyntaxError = etree.XMLSyntaxError
| 0 | 0 | 0 |
1393e109398078e6fcf73d68d3a31d5f1cc057e6 | 127 | py | Python | blank/__init__.py | minhng-info/python-blank | 046effcc0fbf8c6b8694b86ec32469f9cfd699ed | [
"MIT"
] | 1 | 2021-04-16T16:55:47.000Z | 2021-04-16T16:55:47.000Z | thaipackage/__init__.py | nhithai4620/create_lib_demo1 | 602d3a8340b658ad8dfd34d4332da4b83d687907 | [
"MIT"
] | null | null | null | thaipackage/__init__.py | nhithai4620/create_lib_demo1 | 602d3a8340b658ad8dfd34d4332da4b83d687907 | [
"MIT"
] | 1 | 2021-09-07T08:00:10.000Z | 2021-09-07T08:00:10.000Z | # -*- coding: utf-8 -*-
from .blank_func import reverse
from . import main
__version__ = "0.1.0"
__all__ = [
"reverse",
]
| 14.111111 | 31 | 0.622047 | # -*- coding: utf-8 -*-
from .blank_func import reverse
from . import main
__version__ = "0.1.0"
__all__ = [
"reverse",
]
| 0 | 0 | 0 |
b6d4b3f021f5618f62537b86c0828dfd5e17b079 | 485 | py | Python | zerver/migrations/0135_scheduledmessage_delivery_type.py | TylerPham2000/zulip | 2e7aaba0dde5517b4a55cb0bd782f009be45e3ba | [
"Apache-2.0"
] | 17,004 | 2015-09-25T18:27:24.000Z | 2022-03-31T22:02:32.000Z | zerver/migrations/0135_scheduledmessage_delivery_type.py | TylerPham2000/zulip | 2e7aaba0dde5517b4a55cb0bd782f009be45e3ba | [
"Apache-2.0"
] | 20,344 | 2015-09-25T19:02:42.000Z | 2022-03-31T23:54:40.000Z | zerver/migrations/0135_scheduledmessage_delivery_type.py | TylerPham2000/zulip | 2e7aaba0dde5517b4a55cb0bd782f009be45e3ba | [
"Apache-2.0"
] | 7,271 | 2015-09-25T18:48:39.000Z | 2022-03-31T21:06:11.000Z | # Generated by Django 1.11.6 on 2018-01-12 10:37
from django.db import migrations, models
| 23.095238 | 69 | 0.579381 | # Generated by Django 1.11.6 on 2018-01-12 10:37
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
("zerver", "0134_scheduledmessage"),
]
operations = [
migrations.AddField(
model_name="scheduledmessage",
name="deliv... | 0 | 370 | 23 |
035d45eb041a8f2b950bda66bdc5693e0f66963a | 1,725 | py | Python | devel/simulate_mcmc_memory_leak_lightcone.py | debanjan-cosmo/21cmFAST | b9f396ea5605440be419b7cf005fc4286ef1fd00 | [
"MIT"
] | 1 | 2022-03-29T20:07:30.000Z | 2022-03-29T20:07:30.000Z | devel/simulate_mcmc_memory_leak_lightcone.py | debanjan-cosmo/21cmFAST | b9f396ea5605440be419b7cf005fc4286ef1fd00 | [
"MIT"
] | null | null | null | devel/simulate_mcmc_memory_leak_lightcone.py | debanjan-cosmo/21cmFAST | b9f396ea5605440be419b7cf005fc4286ef1fd00 | [
"MIT"
] | null | null | null | """Simple script to simulate an MCMC-like routine to check for memory leaks."""
import numpy as np
import os
import psutil
import tracemalloc
from py21cmfast import initial_conditions, perturb_field, run_lightcone
tracemalloc.start()
snapshot = tracemalloc.take_snapshot()
PROCESS = psutil.Process(os.getpid())
oldmem ... | 26.136364 | 96 | 0.586667 | """Simple script to simulate an MCMC-like routine to check for memory leaks."""
import numpy as np
import os
import psutil
import tracemalloc
from py21cmfast import initial_conditions, perturb_field, run_lightcone
tracemalloc.start()
snapshot = tracemalloc.take_snapshot()
PROCESS = psutil.Process(os.getpid())
oldmem ... | 0 | 0 | 0 |
ad72fa5c56092c85b61b042a9e69520b634d6a38 | 2,563 | py | Python | src/gamesbyexample/alphabetizequiz.py | spp2/PythonStdioGames | 7edc6a07ef816a44579800e773f30217541971fa | [
"MIT"
] | 736 | 2018-09-24T10:29:27.000Z | 2022-03-20T21:28:20.000Z | src/gamesbyexample/alphabetizequiz.py | spp2/PythonStdioGames | 7edc6a07ef816a44579800e773f30217541971fa | [
"MIT"
] | 11 | 2019-03-26T06:55:47.000Z | 2021-03-23T03:00:35.000Z | src/gamesbyexample/alphabetizequiz.py | spp2/PythonStdioGames | 7edc6a07ef816a44579800e773f30217541971fa | [
"MIT"
] | 205 | 2018-12-07T11:58:13.000Z | 2022-03-26T02:06:58.000Z | """Alphabetize Quiz, by Al Sweigart al@inventwithpython.com
A time-based quiz game to see how fast you can alphabetize letters.
This and other games are available at https://nostarch.com/XX
Tags: short, game, word"""
__version__ = 0
import random, time
# Set up the constants:
# (!) Try changing these constants:
QUESTI... | 34.635135 | 72 | 0.65158 | """Alphabetize Quiz, by Al Sweigart al@inventwithpython.com
A time-based quiz game to see how fast you can alphabetize letters.
This and other games are available at https://nostarch.com/XX
Tags: short, game, word"""
__version__ = 0
import random, time
# Set up the constants:
# (!) Try changing these constants:
QUESTI... | 1,546 | 0 | 23 |
e7f99b88e0bfc786bf830a28d11f541f62c5cbbb | 6,053 | py | Python | recordlinkage/datasets/external.py | LuciaBaldassini/recordlinkage | 8892d917caf82131ddce3ad2559570b2a0caca02 | [
"BSD-3-Clause"
] | 641 | 2016-05-03T14:44:55.000Z | 2022-03-29T19:59:42.000Z | recordlinkage/datasets/external.py | LuciaBaldassini/recordlinkage | 8892d917caf82131ddce3ad2559570b2a0caca02 | [
"BSD-3-Clause"
] | 143 | 2015-11-23T10:58:41.000Z | 2022-03-24T00:18:00.000Z | recordlinkage/datasets/external.py | LuciaBaldassini/recordlinkage | 8892d917caf82131ddce3ad2559570b2a0caca02 | [
"BSD-3-Clause"
] | 126 | 2016-09-29T20:04:25.000Z | 2022-03-25T12:52:25.000Z |
# The function get_data_home() and clear_data_home() are based on
# SciKit-Learn https://git.io/fjT70. See the 3-clause BSD license.
from io import BytesIO
from os import environ
import shutil
from pathlib import Path
from urllib.request import urlopen
import zipfile
import pandas
def get_data_home(data_home=No... | 31.041026 | 77 | 0.663803 |
# The function get_data_home() and clear_data_home() are based on
# SciKit-Learn https://git.io/fjT70. See the 3-clause BSD license.
from io import BytesIO
from os import environ
import shutil
from pathlib import Path
from urllib.request import urlopen
import zipfile
import pandas
def get_data_home(data_home=No... | 1,284 | 0 | 46 |
da441d0efdd1706e89b0da9e8f9ea0f6b020d8ad | 1,210 | py | Python | validation/cross_validation_predict.py | CS3244-Project/DrQA | b989d146b574208ae5b510070a210dcfc68e2300 | [
"BSD-3-Clause"
] | null | null | null | validation/cross_validation_predict.py | CS3244-Project/DrQA | b989d146b574208ae5b510070a210dcfc68e2300 | [
"BSD-3-Clause"
] | null | null | null | validation/cross_validation_predict.py | CS3244-Project/DrQA | b989d146b574208ae5b510070a210dcfc68e2300 | [
"BSD-3-Clause"
] | null | null | null | import sys
import subprocess
import os
if __name__ == "__main__":
args = sys.argv
cmd = " ".join(args[1:-2])
dataset, model_dir = args[-2], args[-1]
for fold_dir in os.listdir(model_dir):
data_fold_dir = os.path.join(data_dir, fold_dir)
model_fold_dir = os.path.join(model_dir, fold_dir)
try:
predict(mod... | 33.611111 | 87 | 0.7 | import sys
import subprocess
import os
def predict(model_fold_dir, data_fold_dir, cmd, verbose=True):
for model_data in os.listdir(model_fold_dir):
m_model = re.match(r".*\.mdl$", model_data)
if m_model:
for data in data_fold_dir:
m_dev = re.match(r".*_dev\.json", data)
if m_dev:
model_path = os.p... | 736 | 0 | 23 |
6197b073e1f10c341e776a87ce5a24c94074d175 | 9,939 | py | Python | src/amuse/ext/evrard_test.py | rknop/amuse | 85d5bdcc29cfc87dc69d91c264101fafd6658aec | [
"Apache-2.0"
] | 131 | 2015-06-04T09:06:57.000Z | 2022-02-01T12:11:29.000Z | src/amuse/ext/evrard_test.py | rknop/amuse | 85d5bdcc29cfc87dc69d91c264101fafd6658aec | [
"Apache-2.0"
] | 690 | 2015-10-17T12:18:08.000Z | 2022-03-31T16:15:58.000Z | src/amuse/ext/evrard_test.py | rieder/amuse | 3ac3b6b8f922643657279ddee5c8ab3fc0440d5e | [
"Apache-2.0"
] | 102 | 2015-01-22T10:00:29.000Z | 2022-02-09T13:29:43.000Z | """
initial conditions for the SPH evrard collapse test
"""
import numpy
from math import *
from amuse.units import nbody_system
from amuse.units import units
from amuse.datamodel import Particles
from amuse.datamodel import ParticlesWithUnitsConverted
from amuse.ext.sobol import i4_sobol_generate
"""
Cr... | 36.141818 | 110 | 0.621089 | """
initial conditions for the SPH evrard collapse test
"""
import numpy
from math import *
from amuse.units import nbody_system
from amuse.units import units
from amuse.datamodel import Particles
from amuse.datamodel import ParticlesWithUnitsConverted
from amuse.ext.sobol import i4_sobol_generate
class uniform_ra... | 7,825 | 215 | 669 |
6ab6e58ce94c881b144a45f0b7080de6207ea2cb | 1,207 | py | Python | packaging/ansible-runner-service-project/project/roles/ovirt-ova-external-data/callback_plugins/ovaqueryplugin.py | hbraha/ovirt-engine | a6c17bd73d510d6b44ac72000c0ff686b484746c | [
"Apache-2.0"
] | 347 | 2015-01-20T14:13:21.000Z | 2022-03-31T17:53:11.000Z | packaging/ansible-runner-service-project/project/roles/ovirt-ova-external-data/callback_plugins/ovaqueryplugin.py | hbraha/ovirt-engine | a6c17bd73d510d6b44ac72000c0ff686b484746c | [
"Apache-2.0"
] | 128 | 2015-05-22T19:14:32.000Z | 2022-03-31T08:11:18.000Z | packaging/ansible-runner-service-project/project/roles/ovirt-ova-external-data/callback_plugins/ovaqueryplugin.py | hbraha/ovirt-engine | a6c17bd73d510d6b44ac72000c0ff686b484746c | [
"Apache-2.0"
] | 202 | 2015-01-04T06:20:49.000Z | 2022-03-08T15:30:08.000Z | #
# Copyright oVirt Authors
# SPDX-License-Identifier: Apache-2.0
#
from __future__ import absolute_import
from ansible.plugins.callback import CallbackBase
__metaclass__ = type
class CallbackModule(CallbackBase):
"""
This callback module prints the output of the single task of the
ovirt-ova-external-... | 28.069767 | 75 | 0.695112 | #
# Copyright oVirt Authors
# SPDX-License-Identifier: Apache-2.0
#
from __future__ import absolute_import
from ansible.plugins.callback import CallbackBase
__metaclass__ = type
class CallbackModule(CallbackBase):
"""
This callback module prints the output of the single task of the
ovirt-ova-external-... | 509 | 0 | 108 |
ce3b962b941f24c00176910342cfc1d9e701a1ca | 221 | py | Python | toolbox/geohash/lib/util.py | nziehn/toolbox-geohash | d397a02cbf0932d3a6463dcc47dfc177c8e35033 | [
"MIT"
] | 1 | 2021-11-21T12:31:38.000Z | 2021-11-21T12:31:38.000Z | toolbox/geohash/lib/util.py | nziehn/toolbox-geohash | d397a02cbf0932d3a6463dcc47dfc177c8e35033 | [
"MIT"
] | null | null | null | toolbox/geohash/lib/util.py | nziehn/toolbox-geohash | d397a02cbf0932d3a6463dcc47dfc177c8e35033 | [
"MIT"
] | null | null | null | import math as _math
EARTH_RADIUS = 6371
| 13.8125 | 53 | 0.61086 | import math as _math
EARTH_RADIUS = 6371
def rad2deg(x):
return x * 360 / (2 * _math.pi)
def deg2rad(x):
return x * 2 * _math.pi / 360
def angle(a, b):
return _math.acos(a.dot(b) / a.length / b.length) | 107 | 0 | 69 |
bd0cdc70c79b9659e73b75d7705d797c5df11c74 | 807 | py | Python | osrm/utils.py | ecotner/osrm-api | 1607a0ccdac0b507b2b892ced78f6af8a7b33a5d | [
"MIT"
] | null | null | null | osrm/utils.py | ecotner/osrm-api | 1607a0ccdac0b507b2b892ced78f6af8a7b33a5d | [
"MIT"
] | null | null | null | osrm/utils.py | ecotner/osrm-api | 1607a0ccdac0b507b2b892ced78f6af8a7b33a5d | [
"MIT"
] | null | null | null | # conversions from other unit to meters
DIST_CONVERSIONS = {
"m": 1.0,
"meter": 1.0,
"km": 1000.0,
"kilometer": 1000.0,
"mi": 1609.34,
"mile": 1609.34,
"foot": 0.3048,
"ft": 0.3048,
}
# conversions from other unit to seconds
TIME_CONVERSIONS = {
"s": 1.0,
"sec": 1.0,
"second... | 20.692308 | 63 | 0.570012 | # conversions from other unit to meters
DIST_CONVERSIONS = {
"m": 1.0,
"meter": 1.0,
"km": 1000.0,
"kilometer": 1000.0,
"mi": 1609.34,
"mile": 1609.34,
"foot": 0.3048,
"ft": 0.3048,
}
# conversions from other unit to seconds
TIME_CONVERSIONS = {
"s": 1.0,
"sec": 1.0,
"second... | 217 | 0 | 46 |
0f9e9c30dbded943ec80a0ca694a28794c032fa0 | 466 | py | Python | expression/forms.py | SACGF/variantgrid | 515195e2f03a0da3a3e5f2919d8e0431babfd9c9 | [
"RSA-MD"
] | 5 | 2021-01-14T03:34:42.000Z | 2022-03-07T15:34:18.000Z | expression/forms.py | SACGF/variantgrid | 515195e2f03a0da3a3e5f2919d8e0431babfd9c9 | [
"RSA-MD"
] | 551 | 2020-10-19T00:02:38.000Z | 2022-03-30T02:18:22.000Z | expression/forms.py | SACGF/variantgrid | 515195e2f03a0da3a3e5f2919d8e0431babfd9c9 | [
"RSA-MD"
] | null | null | null | from django import forms
from django.forms.models import modelform_factory, ALL_FIELDS
from library.forms import ROFormMixin
from .models import CuffDiffFile
EXPRESSION_WIDGETS = {'name': forms.TextInput(),
'sample_1': forms.TextInput(),
'sample_2': forms.TextInput()}
cdf_... | 33.285714 | 90 | 0.733906 | from django import forms
from django.forms.models import modelform_factory, ALL_FIELDS
from library.forms import ROFormMixin
from .models import CuffDiffFile
EXPRESSION_WIDGETS = {'name': forms.TextInput(),
'sample_1': forms.TextInput(),
'sample_2': forms.TextInput()}
cdf_... | 0 | 37 | 22 |
719138893722c81f6ce6e738654f05e0542a64bc | 3,019 | py | Python | kisee/identity_provider.py | FGuillet/kisee | 74660c36ed08277639eac5cd904b2e1b188fd148 | [
"MIT"
] | 8 | 2019-03-25T09:26:07.000Z | 2021-12-04T07:05:56.000Z | kisee/identity_provider.py | FGuillet/kisee | 74660c36ed08277639eac5cd904b2e1b188fd148 | [
"MIT"
] | 8 | 2019-07-17T12:24:17.000Z | 2021-07-05T13:16:45.000Z | kisee/identity_provider.py | FGuillet/kisee | 74660c36ed08277639eac5cd904b2e1b188fd148 | [
"MIT"
] | 2 | 2019-07-16T13:45:33.000Z | 2021-04-07T14:22:01.000Z | """Abstract class representing an identity provider
"""
from abc import ABC, abstractmethod
from importlib import import_module
from typing import AsyncContextManager, Optional, Type
class ProviderError(Exception):
"""Any error raised by an IdentityProvider, like:
"Username too short", "Password too weak", ..... | 32.815217 | 86 | 0.675389 | """Abstract class representing an identity provider
"""
from abc import ABC, abstractmethod
from importlib import import_module
from typing import AsyncContextManager, Optional, Type
class ProviderError(Exception):
"""Any error raised by an IdentityProvider, like:
"Username too short", "Password too weak", ..... | 349 | 0 | 54 |
66eda84772c7b4c5b37a35ad2efb3aee806a5d6d | 2,280 | py | Python | Gem/DelayedFileOutput.py | AmitGreen/Gem.Unsquashed | c51a82b4a3ed35e516126f406488923a86ef26e5 | [
"MIT"
] | null | null | null | Gem/DelayedFileOutput.py | AmitGreen/Gem.Unsquashed | c51a82b4a3ed35e516126f406488923a86ef26e5 | [
"MIT"
] | null | null | null | Gem/DelayedFileOutput.py | AmitGreen/Gem.Unsquashed | c51a82b4a3ed35e516126f406488923a86ef26e5 | [
"MIT"
] | null | null | null | #
# Copyright (c) 2017 Amit Green. All rights reserved.
#
@gem('Gem.DelayedFileOutput')
| 24.255319 | 94 | 0.448246 | #
# Copyright (c) 2017 Amit Green. All rights reserved.
#
@gem('Gem.DelayedFileOutput')
def gem():
require_gem('Gem.Path')
require_gem('Gem.StringOutput')
from Gem import create_StringOutput
class DelayedFileOutput(Object):
__slots__ = ((
'path', # String... | 2,167 | 0 | 22 |
a648489f66c6b63ffb0384451b74fd78e27641a7 | 19,894 | py | Python | FunctionalFeatures.py | DonCammne/OpenSeesPyAssistant | f380f0f2a2f3d1336320bd8d26fa5efe00a12134 | [
"MIT"
] | null | null | null | FunctionalFeatures.py | DonCammne/OpenSeesPyAssistant | f380f0f2a2f3d1336320bd8d26fa5efe00a12134 | [
"MIT"
] | null | null | null | FunctionalFeatures.py | DonCammne/OpenSeesPyAssistant | f380f0f2a2f3d1336320bd8d26fa5efe00a12134 | [
"MIT"
] | null | null | null | """Module with useful functions (discretise curves, ID conventions, etc) \n
Carmine Schipani, 2021
"""
import math
import numpy as np
import matplotlib.pyplot as plt
from openseespy.opensees import *
from OpenSeesPyAssistant.ErrorHandling import *
from OpenSeesPyAssistant.Units import *
def ProgressingPercentage(max... | 41.359667 | 167 | 0.71896 | """Module with useful functions (discretise curves, ID conventions, etc) \n
Carmine Schipani, 2021
"""
import math
import numpy as np
import matplotlib.pyplot as plt
from openseespy.opensees import *
from OpenSeesPyAssistant.ErrorHandling import *
from OpenSeesPyAssistant.Units import *
def ProgressingPercentage(max... | 899 | 0 | 23 |
f11dc9bcc2bb08967f6443f0da5ccf5bf353bd99 | 228 | py | Python | fcc/ast/statements/__init__.py | za-creature/fcc | 8d395e1573b8c797a7175ce6efd8037bb5ab785e | [
"Unlicense"
] | 1 | 2015-02-19T16:28:17.000Z | 2015-02-19T16:28:17.000Z | fcc/ast/statements/__init__.py | za-creature/fcc | 8d395e1573b8c797a7175ce6efd8037bb5ab785e | [
"Unlicense"
] | null | null | null | fcc/ast/statements/__init__.py | za-creature/fcc | 8d395e1573b8c797a7175ce6efd8037bb5ab785e | [
"Unlicense"
] | null | null | null | # coding=utf-8
from __future__ import absolute_import, unicode_literals, division
from fcc.ast.statements.conditional import * # noqa
from fcc.ast.statements.base import * # noqa
from fcc.ast.statements.loop import * # noqa
| 32.571429 | 66 | 0.780702 | # coding=utf-8
from __future__ import absolute_import, unicode_literals, division
from fcc.ast.statements.conditional import * # noqa
from fcc.ast.statements.base import * # noqa
from fcc.ast.statements.loop import * # noqa
| 0 | 0 | 0 |
a7bbb0d226467976fc6d1bb7498ad20821383938 | 1,391 | py | Python | tests/integration/test_service_init.py | foobug/suzieq | c5927616a0e1a1fd9283f2a3eeb120d24ff0f2b5 | [
"Apache-2.0"
] | 487 | 2020-04-29T13:34:34.000Z | 2022-03-31T06:13:41.000Z | tests/integration/test_service_init.py | foobug/suzieq | c5927616a0e1a1fd9283f2a3eeb120d24ff0f2b5 | [
"Apache-2.0"
] | 410 | 2020-04-24T20:57:52.000Z | 2022-03-31T18:07:48.000Z | tests/integration/test_service_init.py | foobug/suzieq | c5927616a0e1a1fd9283f2a3eeb120d24ff0f2b5 | [
"Apache-2.0"
] | 75 | 2020-04-29T22:13:34.000Z | 2022-03-31T17:00:17.000Z | import json
import os
import pytest
import yaml
@pytest.mark.service
@pytest.mark.service
def _test_produce_current_json(tmp_path, init_services_default):
"""used strictly to produce the output that needs to be checked. this should only be necessary
if you have on purpose changed configs and need to produce... | 35.666667 | 104 | 0.703091 | import json
import os
import pytest
import yaml
@pytest.mark.service
def _test_init_with_default_config(init_services_default):
with open(os.path.abspath(os.curdir) + '/tests/integration/services/samples/init.yml', 'r') as file:
prev_results = yaml.load(file)
assert isinstance(init_services_default, ... | 444 | 0 | 22 |
0a8a81126913cb572c5dbe107d60d3fd2f125526 | 6,044 | py | Python | metropolis/utils/geo.py | mapillary/metropolis_sdk | 4d25e0687d192e1f64707a9474a4b0896e430c01 | [
"Apache-2.0"
] | 8 | 2021-10-20T04:38:14.000Z | 2022-01-31T16:46:48.000Z | metropolis/utils/geo.py | mapillary/metropolis_sdk | 4d25e0687d192e1f64707a9474a4b0896e430c01 | [
"Apache-2.0"
] | 2 | 2021-12-22T01:52:06.000Z | 2022-01-22T08:46:48.000Z | metropolis/utils/geo.py | mapillary/metropolis_sdk | 4d25e0687d192e1f64707a9474a4b0896e430c01 | [
"Apache-2.0"
] | 2 | 2021-10-30T12:51:12.000Z | 2022-02-12T16:00:45.000Z | # Copyright (c) Facebook, Inc. and its affiliates.
# This code originally from https://github.com/mapillary/OpenSfM/blob/main/opensfm/geo.py
import numpy as np
WGS84_a = 6378137.0
WGS84_b = 6356752.314245
def ecef_from_lla(lat, lon, alt):
"""
Compute ECEF XYZ from latitude, longitude and altitude.
All ... | 30.525253 | 89 | 0.544838 | # Copyright (c) Facebook, Inc. and its affiliates.
# This code originally from https://github.com/mapillary/OpenSfM/blob/main/opensfm/geo.py
import numpy as np
WGS84_a = 6378137.0
WGS84_b = 6356752.314245
def ecef_from_lla(lat, lon, alt):
"""
Compute ECEF XYZ from latitude, longitude and altitude.
All ... | 81 | 0 | 27 |
4d05592f9528b23541cbc5057dede1cb764f4ad1 | 138 | py | Python | experiments/galileo2/led.py | rbanffy/pingo | b448d5eecae17b82aafd708c2594dae6d4194d84 | [
"MIT"
] | null | null | null | experiments/galileo2/led.py | rbanffy/pingo | b448d5eecae17b82aafd708c2594dae6d4194d84 | [
"MIT"
] | 1 | 2021-03-20T05:17:03.000Z | 2021-03-20T05:17:03.000Z | experiments/galileo2/led.py | rbanffy/pingo | b448d5eecae17b82aafd708c2594dae6d4194d84 | [
"MIT"
] | null | null | null | import pyupm_grove as grove
import time
led = grove.GroveLed(2)
for x in range(0, 5):
led.on()
time.sleep(1)
led.off()
time.sleep(1)
| 13.8 | 27 | 0.688406 | import pyupm_grove as grove
import time
led = grove.GroveLed(2)
for x in range(0, 5):
led.on()
time.sleep(1)
led.off()
time.sleep(1)
| 0 | 0 | 0 |
03872dca5b00d2c711e5a2558a46f9029ea25443 | 1,258 | py | Python | dnaSequence/test_returnFirstString.py | ankitsumitg/python-projects | 34a3df6fcd8544bf83aa9f3d47ec160e3838b1d1 | [
"MIT"
] | 1 | 2021-03-22T20:45:06.000Z | 2021-03-22T20:45:06.000Z | dnaSequence/test_returnFirstString.py | ankitsumitg/python-projects | 34a3df6fcd8544bf83aa9f3d47ec160e3838b1d1 | [
"MIT"
] | null | null | null | dnaSequence/test_returnFirstString.py | ankitsumitg/python-projects | 34a3df6fcd8544bf83aa9f3d47ec160e3838b1d1 | [
"MIT"
] | null | null | null | """
Do Not Edit this file. You may and are encouraged to look at it for reference.
"""
import unittest
import dnaSequencing
if __name__ == '__main__':
unittest.main()
| 39.3125 | 117 | 0.710652 | """
Do Not Edit this file. You may and are encouraged to look at it for reference.
"""
import unittest
import dnaSequencing
class TestReturnFirstString(unittest.TestCase):
def test001_returnFirstStringExists(self):
self.assertTrue('returnFirstString' in dir(dnaSequencing),
'Functi... | 901 | 26 | 158 |
26a1a3ffb5966b12241a3c8fea99206ae82722e1 | 638 | py | Python | backend/api/services/adminActions.py | CMPUT404-wi21-project/CMPUT404-project-socialdistribution | b88ca3608e16a1bae72cd7c8cfc212db74d1b2c0 | [
"W3C-20150513"
] | 1 | 2021-04-08T22:02:44.000Z | 2021-04-08T22:02:44.000Z | backend/api/services/adminActions.py | CMPUT404-wi21-project/CMPUT404-project-socialdistribution | b88ca3608e16a1bae72cd7c8cfc212db74d1b2c0 | [
"W3C-20150513"
] | 79 | 2021-02-06T22:55:52.000Z | 2021-04-15T20:24:56.000Z | backend/api/services/adminActions.py | CMPUT404-wi21-project/CMPUT404-project-socialdistribution | b88ca3608e16a1bae72cd7c8cfc212db74d1b2c0 | [
"W3C-20150513"
] | 4 | 2021-02-14T15:13:15.000Z | 2021-04-17T06:21:11.000Z | from django.contrib.auth.hashers import make_password
# models
from ..models.author import Author
# move request info to Author table with generated url
# args
# ModelAdmin
# request
# queryset (selected requests)
# return
# None
accept_signup_request.short_description = "allow them to be on... | 30.380952 | 144 | 0.710031 | from django.contrib.auth.hashers import make_password
# models
from ..models.author import Author
# move request info to Author table with generated url
# args
# ModelAdmin
# request
# queryset (selected requests)
# return
# None
def accept_signup_request(ModelAdmin, request, queryset):
f... | 288 | 0 | 22 |
fae213509880025593ebe56bdae7f1fb69c9cecd | 1,544 | py | Python | Adabas/demo/stck1.py | flavio-casacurta/Nat2Py | fdbff807e436628b49710f65d12cc108fb824b7f | [
"MIT"
] | 1 | 2021-05-09T11:43:20.000Z | 2021-05-09T11:43:20.000Z | Adabas/demo/stck1.py | flavio-casacurta/Nat2Py | fdbff807e436628b49710f65d12cc108fb824b7f | [
"MIT"
] | 1 | 2021-09-14T07:27:08.000Z | 2021-09-15T16:50:17.000Z | Adabas/demo/stck1.py | flavio-casacurta/Nat2Py | fdbff807e436628b49710f65d12cc108fb824b7f | [
"MIT"
] | 2 | 2019-11-04T18:36:34.000Z | 2021-04-25T12:45:52.000Z | """stck1.py - Demo of stck module
stck.py does IBM/390 and other timestamp conversions
$Date: 2008-09-01 14:51:03 +0200 (Mon, 01 Sep 2008) $
$Rev: 81 $
"""
# Copyright 2004-2008 Software AG
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with... | 25.311475 | 75 | 0.73057 | """stck1.py - Demo of stck module
stck.py does IBM/390 and other timestamp conversions
$Date: 2008-09-01 14:51:03 +0200 (Mon, 01 Sep 2008) $
$Rev: 81 $
"""
# Copyright 2004-2008 Software AG
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with... | 0 | 0 | 0 |
c86c46b7117a14fa94dfd05918ae65b5ea5e2cab | 9,508 | py | Python | q_learning_algorithm/snake.py | anzemur/smart-snake | 67c1e3708f18d0d59c4f1a1385b32de4f9adfa0e | [
"MIT"
] | 7 | 2019-01-08T18:33:49.000Z | 2021-11-10T19:42:50.000Z | q_learning_algorithm/snake.py | anzemur/smart-snake | 67c1e3708f18d0d59c4f1a1385b32de4f9adfa0e | [
"MIT"
] | null | null | null | q_learning_algorithm/snake.py | anzemur/smart-snake | 67c1e3708f18d0d59c4f1a1385b32de4f9adfa0e | [
"MIT"
] | 2 | 2019-01-08T18:34:23.000Z | 2022-03-22T12:18:57.000Z | # The base game is written with the help of Python Tutorials: https://pythonspot.com/snake-with-pygame/
from pygame.locals import *
from random import randint
from snake_agent import snakeAgent
import pygame
import time
WINDOW_W = 880
WINDOW_H = 880
HUMAN = 0
AGENT_Q = 1
NEURAL_NETWORK = 2
if __name__ == "__m... | 29.076453 | 170 | 0.511885 | # The base game is written with the help of Python Tutorials: https://pythonspot.com/snake-with-pygame/
from pygame.locals import *
from random import randint
from snake_agent import snakeAgent
import pygame
import time
WINDOW_W = 880
WINDOW_H = 880
HUMAN = 0
AGENT_Q = 1
NEURAL_NETWORK = 2
class Apple:
x = 0
... | 8,169 | 821 | 121 |
833aef2e110d64785ab59e5a8044de396fbc1bf6 | 456 | py | Python | writeups/2020/utctf/nittaku-3-star-premium/solve.py | welchbj/ctf | fd4e2cea692b134163cc9bd66c2b4796bdefed8c | [
"MIT"
] | 65 | 2019-10-07T01:29:16.000Z | 2022-03-18T14:20:40.000Z | writeups/2020/utctf/nittaku-3-star-premium/solve.py | welchbj/ctf | fd4e2cea692b134163cc9bd66c2b4796bdefed8c | [
"MIT"
] | null | null | null | writeups/2020/utctf/nittaku-3-star-premium/solve.py | welchbj/ctf | fd4e2cea692b134163cc9bd66c2b4796bdefed8c | [
"MIT"
] | 12 | 2020-05-04T01:16:53.000Z | 2022-01-02T14:33:41.000Z | #!/usr/bin/env python3
from scapy.all import *
TARGET = '3.88.183.122'
NULL_DATA = b'\x00' * 48
data = b''
i = 1
while True:
pkt = IP(
dst=TARGET
) / ICMP(
type='echo-request',
id=0x1337,
seq=i
) / NULL_DATA
resp = sr1(pkt)
resp_data = resp[Raw].load.rstrip(b'\n\x... | 15.2 | 48 | 0.532895 | #!/usr/bin/env python3
from scapy.all import *
TARGET = '3.88.183.122'
NULL_DATA = b'\x00' * 48
data = b''
i = 1
while True:
pkt = IP(
dst=TARGET
) / ICMP(
type='echo-request',
id=0x1337,
seq=i
) / NULL_DATA
resp = sr1(pkt)
resp_data = resp[Raw].load.rstrip(b'\n\x... | 0 | 0 | 0 |
09ecde831e2c87e8caf9daf0e5b2cf3babfdc3ce | 190 | py | Python | unileaks/task6.py | zahessi/unileaks | 3ed2462e11f8e3decc64ed8faceee42438ec06ff | [
"MIT"
] | null | null | null | unileaks/task6.py | zahessi/unileaks | 3ed2462e11f8e3decc64ed8faceee42438ec06ff | [
"MIT"
] | null | null | null | unileaks/task6.py | zahessi/unileaks | 3ed2462e11f8e3decc64ed8faceee42438ec06ff | [
"MIT"
] | null | null | null | # Определить является ли одна строка перестановкой другой
assert mutated_string('asd', 'dsa') == True | 31.666667 | 58 | 0.757895 | # Определить является ли одна строка перестановкой другой
def mutated_string(original, mutated):
return sorted(original) == sorted(mutated)
assert mutated_string('asd', 'dsa') == True | 64 | 0 | 23 |
dbfb2565f073ee8c0d15dff0fb86d5ab4cbfb200 | 14,746 | py | Python | generative_try/Fractal/fractal_utils.py | pascal-winter/generative-try | c65aa7a9a67c7c86743023cc894e3b139a984ce0 | [
"MIT"
] | null | null | null | generative_try/Fractal/fractal_utils.py | pascal-winter/generative-try | c65aa7a9a67c7c86743023cc894e3b139a984ce0 | [
"MIT"
] | null | null | null | generative_try/Fractal/fractal_utils.py | pascal-winter/generative-try | c65aa7a9a67c7c86743023cc894e3b139a984ce0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@author: d0t451
@date: 2019/4/17
@desc: fractal utils
"""
import math
import os
import time
from functools import wraps
import cv2 as cv
import numpy as np
# 用时装饰器
def screen_coordinate_to_fx_coordinate(screen_x, screen_y, screen_width, screen_height, fx_short_axis_length=4)... | 32.988814 | 136 | 0.625186 | # -*- coding: utf-8 -*-
"""
@author: d0t451
@date: 2019/4/17
@desc: fractal utils
"""
import math
import os
import time
from functools import wraps
import cv2 as cv
import numpy as np
# 用时装饰器
def decorator_used_time(f):
@wraps(f)
def wrapped_function(*args, **kwargs):
start = time.perf_co... | 1,582 | 0 | 132 |
4e00da40917cc3a3440b435dfc1049347e2d5942 | 265 | py | Python | tbot/twitch_bot/functions/uptime.py | thomaserlang/tbot | 99cfa204d86ef35cf2cc9482ae5a44abb35b443a | [
"MIT"
] | null | null | null | tbot/twitch_bot/functions/uptime.py | thomaserlang/tbot | 99cfa204d86ef35cf2cc9482ae5a44abb35b443a | [
"MIT"
] | 10 | 2022-02-14T11:40:20.000Z | 2022-03-09T22:44:03.000Z | tbot/twitch_bot/functions/uptime.py | thomaserlang/tbot | 99cfa204d86ef35cf2cc9482ae5a44abb35b443a | [
"MIT"
] | 1 | 2020-09-19T16:38:24.000Z | 2020-09-19T16:38:24.000Z | from tbot.twitch_bot.var_filler import fills_vars
from tbot import utils
@fills_vars('uptime') | 26.5 | 52 | 0.675472 | from tbot.twitch_bot.var_filler import fills_vars
from tbot import utils
@fills_vars('uptime')
async def uptime(bot, channel_id, **kwargs):
return {
'uptime': utils.seconds_to_pretty(
bot.channels_check[channel_id]['uptime']
)
} | 148 | 0 | 22 |
1eab70c6747da20c54cc740c68da0f94b4bb992f | 3,974 | py | Python | yardstick/vTC/apexlake/experimental_framework/benchmarks/instantiation_validation_noisy_neighbors_benchmark.py | FedericoRessi/yardstick | 8f30859f699f3476512b1184ac343d20c50a138b | [
"Apache-2.0"
] | null | null | null | yardstick/vTC/apexlake/experimental_framework/benchmarks/instantiation_validation_noisy_neighbors_benchmark.py | FedericoRessi/yardstick | 8f30859f699f3476512b1184ac343d20c50a138b | [
"Apache-2.0"
] | null | null | null | yardstick/vTC/apexlake/experimental_framework/benchmarks/instantiation_validation_noisy_neighbors_benchmark.py | FedericoRessi/yardstick | 8f30859f699f3476512b1184ac343d20c50a138b | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2015 Intel Research and Development Ireland Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 43.195652 | 75 | 0.621792 | # Copyright (c) 2015 Intel Research and Development Ireland Ltd.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 2,899 | 80 | 131 |
f88220fbf29facfbdcb649059126d6f156360fb7 | 10,255 | py | Python | airflow/utils.py | isabella232/Airflow-1 | c926783bcad5ab1470d95e5ab392c6f3e71765b9 | [
"Apache-2.0"
] | 1 | 2019-05-29T02:41:42.000Z | 2019-05-29T02:41:42.000Z | airflow/utils.py | lyft/Airflow | c926783bcad5ab1470d95e5ab392c6f3e71765b9 | [
"Apache-2.0"
] | 1 | 2021-02-23T23:00:39.000Z | 2021-02-23T23:00:39.000Z | airflow/utils.py | isabella232/Airflow-1 | c926783bcad5ab1470d95e5ab392c6f3e71765b9 | [
"Apache-2.0"
] | 2 | 2018-08-31T06:39:31.000Z | 2020-12-19T10:28:17.000Z | from copy import copy
from datetime import datetime, timedelta
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from functools import wraps
import imp
import inspect
import logging
import os
import re
import smtplib
from sqlalchemy import event, exc
from sqlalchemy.pool import Pool
... | 30.703593 | 79 | 0.618918 | from copy import copy
from datetime import datetime, timedelta
from email.mime.text import MIMEText
from email.mime.multipart import MIMEMultipart
from functools import wraps
import imp
import inspect
import logging
import os
import re
import smtplib
from sqlalchemy import event, exc
from sqlalchemy.pool import Pool
... | 6,699 | 0 | 262 |
0cfce688dff5b06a1c78794999189df0424d4a84 | 1,948 | py | Python | main.py | fourjr/random-paragraph-generator | a3c5281eaa95ea860ad8ad4561928ada0c1d40ec | [
"Unlicense"
] | 1 | 2020-08-11T16:33:00.000Z | 2020-08-11T16:33:00.000Z | main.py | fourjr/random-paragraph-generator | a3c5281eaa95ea860ad8ad4561928ada0c1d40ec | [
"Unlicense"
] | null | null | null | main.py | fourjr/random-paragraph-generator | a3c5281eaa95ea860ad8ad4561928ada0c1d40ec | [
"Unlicense"
] | null | null | null | import math
import random
import string
import sys
try:
LIMIT = int(sys.argv[1])
except IndexError:
LIMIT = 200
except ValueError as e:
raise RuntimeError('invalid number') from e
with open('wordlist.txt', encoding='utf8') as f:
words = f.read().splitlines()
for i in words:
if any(j in i for j i... | 26.324324 | 94 | 0.549281 | import math
import random
import string
import sys
try:
LIMIT = int(sys.argv[1])
except IndexError:
LIMIT = 200
except ValueError as e:
raise RuntimeError('invalid number') from e
with open('wordlist.txt', encoding='utf8') as f:
words = f.read().splitlines()
for i in words:
if any(j in i for j i... | 0 | 0 | 0 |
8ac0a5cd9048c852c44e9a1507c14330310989e3 | 1,161 | py | Python | config.example.py | Fy-/FyPress | be357134969797f92b94db77c9e3aa863c0094fe | [
"MIT"
] | 70 | 2016-06-07T10:17:02.000Z | 2021-06-23T05:36:03.000Z | config.example.py | Fy-/FyPress | be357134969797f92b94db77c9e3aa863c0094fe | [
"MIT"
] | 10 | 2016-06-24T08:17:54.000Z | 2020-07-24T07:34:39.000Z | config.example.py | Fy-/FyPress | be357134969797f92b94db77c9e3aa863c0094fe | [
"MIT"
] | 15 | 2016-06-16T20:40:55.000Z | 2019-08-06T02:45:52.000Z | # -*- coding: UTF-8 -*-
import os
del os
| 21.109091 | 61 | 0.524548 | # -*- coding: UTF-8 -*-
import os
class Config(object):
### BASE ###
BASE_DIR = os.path.dirname(__file__)
### KEYS ###
CSRF_SESSION_KEY = "secretkeylol"
### CSRF ###
CSRF_ENABLED = True
SECRET_KEY = "secretkeygglol"
### Folders ###
THEME_FOLDER = os.path.join(BAS... | 0 | 1,061 | 50 |
7d7f826c0ca971d2d8b4447aad3281b83bd8fc7c | 443 | py | Python | classes/team.py | kalyons11/march-madness | 3171813785fb5915aa5240d4c507210e816d22f4 | [
"MIT"
] | null | null | null | classes/team.py | kalyons11/march-madness | 3171813785fb5915aa5240d4c507210e816d22f4 | [
"MIT"
] | null | null | null | classes/team.py | kalyons11/march-madness | 3171813785fb5915aa5240d4c507210e816d22f4 | [
"MIT"
] | null | null | null | class Team:
"""Immutable notion of a team."""
def __init__(self, team_id, dm):
"""
team_id: id of this team from teams.csv file
dm: DataManager from which this team comes from
"""
self.team_id = team_id
self.dm = dm
@property
| 21.095238 | 55 | 0.571106 | class Team:
"""Immutable notion of a team."""
def __init__(self, team_id, dm):
"""
team_id: id of this team from teams.csv file
dm: DataManager from which this team comes from
"""
self.team_id = team_id
self.dm = dm
@property
def name(self):
retu... | 75 | 0 | 80 |
f151dc1d4ee023d5c7a3ba4aea49797c17203466 | 313 | py | Python | android_file_bridge/error.py | valknight/Android-File-Bridge | 61c957ae719a6c5c2c776562a994ef58ddad472a | [
"CC-BY-3.0"
] | 2 | 2020-01-09T15:06:49.000Z | 2022-01-31T16:53:34.000Z | android_file_bridge/error.py | valknight/Android-File-Bridge | 61c957ae719a6c5c2c776562a994ef58ddad472a | [
"CC-BY-3.0"
] | null | null | null | android_file_bridge/error.py | valknight/Android-File-Bridge | 61c957ae719a6c5c2c776562a994ef58ddad472a | [
"CC-BY-3.0"
] | null | null | null | class Error(Exception):
"""Base class"""
pass
class AdbConnectionError(Exception):
"""Raised when ADB can't connect"""
pass
class AdbPushError(Exception):
"""Raised when a file can't be pushed"""
pass
class AdbPullError(Exception):
"""Raised when a file can't be pulled"""
pass
| 19.5625 | 44 | 0.658147 | class Error(Exception):
"""Base class"""
pass
class AdbConnectionError(Exception):
"""Raised when ADB can't connect"""
pass
class AdbPushError(Exception):
"""Raised when a file can't be pushed"""
pass
class AdbPullError(Exception):
"""Raised when a file can't be pulled"""
pass
| 0 | 0 | 0 |
1a3df2ec4e2d8b6f416e186b6f9358b31cb5e725 | 26,044 | py | Python | Fusion/VGmesh/VGmesh.py | hueyke/VGmesh | f92ac7aabecb4e81e4be1b1eb13a49153de8f857 | [
"MIT"
] | null | null | null | Fusion/VGmesh/VGmesh.py | hueyke/VGmesh | f92ac7aabecb4e81e4be1b1eb13a49153de8f857 | [
"MIT"
] | null | null | null | Fusion/VGmesh/VGmesh.py | hueyke/VGmesh | f92ac7aabecb4e81e4be1b1eb13a49153de8f857 | [
"MIT"
] | null | null | null | #Author-Chun-Yu Ke
#Description-Creates a VGmesh component.
import adsk.core, adsk.fusion, adsk.cam, traceback
import math
import time
# Globals
_app = adsk.core.Application.cast(None)
_ui = adsk.core.UserInterface.cast(None)
_units = 'mm'
# Command inputs
_deltaAngle = adsk.core.DropDownCommandInput.cast(None)
_out... | 45.611208 | 177 | 0.623637 | #Author-Chun-Yu Ke
#Description-Creates a VGmesh component.
import adsk.core, adsk.fusion, adsk.cam, traceback
import math
import time
# Globals
_app = adsk.core.Application.cast(None)
_ui = adsk.core.UserInterface.cast(None)
_units = 'mm'
# Command inputs
_deltaAngle = adsk.core.DropDownCommandInput.cast(None)
_out... | 23,808 | 251 | 483 |
b90ce3285a6af7ccfc0a59fb4f682b60b14708a2 | 2,493 | py | Python | update-toolchain.py | henrique-morbin-ifood/swift-syntax | edb79cf1e98919263e1011c1619d2283767ef2c6 | [
"Apache-2.0"
] | null | null | null | update-toolchain.py | henrique-morbin-ifood/swift-syntax | edb79cf1e98919263e1011c1619d2283767ef2c6 | [
"Apache-2.0"
] | 1 | 2019-08-07T20:57:33.000Z | 2019-08-07T20:57:33.000Z | update-toolchain.py | akkyie/swift-syntax | edb79cf1e98919263e1011c1619d2283767ef2c6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from __future__ import print_function
import argparse
import os
import subprocess
import sys
import tempfile
import errno
import platform
import shutil
BUILD_SCRIPT = os.path.dirname(os.path.abspath(__file__)) + '/build-script.py'
if __name__ == '__main__':
main()
| 31.556962 | 79 | 0.683915 | #!/usr/bin/env python
from __future__ import print_function
import argparse
import os
import subprocess
import sys
import tempfile
import errno
import platform
import shutil
BUILD_SCRIPT = os.path.dirname(os.path.abspath(__file__)) + '/build-script.py'
def printerr(message):
print(message, file=sys.stderr)
def ... | 2,015 | 0 | 184 |
dda50aa63d70264e3cdcaaa7ed141fbfef027c2b | 1,926 | py | Python | youtube_api/youtube_api_utils.py | richardARPANET/youtube-data-api | 73ff31ab6f7819debb8b8bf8259db1d8ae00b13a | [
"MIT"
] | null | null | null | youtube_api/youtube_api_utils.py | richardARPANET/youtube-data-api | 73ff31ab6f7819debb8b8bf8259db1d8ae00b13a | [
"MIT"
] | null | null | null | youtube_api/youtube_api_utils.py | richardARPANET/youtube-data-api | 73ff31ab6f7819debb8b8bf8259db1d8ae00b13a | [
"MIT"
] | 1 | 2021-06-23T02:20:38.000Z | 2021-06-23T02:20:38.000Z | import sys
import json
import datetime
import requests
import re
import signal
from urllib.parse import urlparse
from urllib.parse import parse_qs
'''
This contains utilities used by other functions in the YoutubeDataApi class, as well as a few convenience functions for data analysis.
'''
__all__ = [
'_chunker',... | 25.342105 | 134 | 0.681724 | import sys
import json
import datetime
import requests
import re
import signal
from urllib.parse import urlparse
from urllib.parse import parse_qs
'''
This contains utilities used by other functions in the YoutubeDataApi class, as well as a few convenience functions for data analysis.
'''
__all__ = [
'_chunker',... | 313 | 11 | 150 |
ae2c41222fde5b863f43cd18486672d8240f77ae | 1,795 | py | Python | hashbrowns/_random/__init__.py | dezmondgoff/hashbrowns | 271ca022b2e0aa230fa4bf1d98437599cdbe4c83 | [
"MIT"
] | null | null | null | hashbrowns/_random/__init__.py | dezmondgoff/hashbrowns | 271ca022b2e0aa230fa4bf1d98437599cdbe4c83 | [
"MIT"
] | 1 | 2020-02-12T18:56:03.000Z | 2020-02-12T18:56:03.000Z | hashbrowns/_random/__init__.py | dezmondgoff/hashbrowns | 271ca022b2e0aa230fa4bf1d98437599cdbe4c83 | [
"MIT"
] | 1 | 2020-02-12T18:35:50.000Z | 2020-02-12T18:35:50.000Z | """
================================
Random Number Generators for LSH
================================
==============================================================================
Utility functions
==============================================================================
sample_indices Sets of uniformly d... | 38.191489 | 99 | 0.533148 | """
================================
Random Number Generators for LSH
================================
==============================================================================
Utility functions
==============================================================================
sample_indices Sets of uniformly d... | 0 | 0 | 0 |
114d87c699ab9d607f2bd907abc8d32a5a0e6885 | 186 | py | Python | turret-soft/turret_soft/modes/__init__.py | regananalytics/turret-soft | bacc13d9a8f6c08728dc6d6a6bae1239e2c7c485 | [
"MIT"
] | null | null | null | turret-soft/turret_soft/modes/__init__.py | regananalytics/turret-soft | bacc13d9a8f6c08728dc6d6a6bae1239e2c7c485 | [
"MIT"
] | null | null | null | turret-soft/turret_soft/modes/__init__.py | regananalytics/turret-soft | bacc13d9a8f6c08728dc6d6a6bae1239e2c7c485 | [
"MIT"
] | null | null | null | from .startup import STARTUP
from .search import SEARCH
from .track import TRACK
from .engage import ENGAGE
from .idle import IDLE
from .error import ERROR
from .shutdown import SHUTDOWN | 26.571429 | 30 | 0.817204 | from .startup import STARTUP
from .search import SEARCH
from .track import TRACK
from .engage import ENGAGE
from .idle import IDLE
from .error import ERROR
from .shutdown import SHUTDOWN | 0 | 0 | 0 |
c60b45285bfdf270eb460c301176277bedf7144d | 10,577 | py | Python | models/lobby.py | celowsky/lfd2-bot | 63137b3c7c0fb76ec8595dd0e0676c173421230b | [
"MIT"
] | null | null | null | models/lobby.py | celowsky/lfd2-bot | 63137b3c7c0fb76ec8595dd0e0676c173421230b | [
"MIT"
] | null | null | null | models/lobby.py | celowsky/lfd2-bot | 63137b3c7c0fb76ec8595dd0e0676c173421230b | [
"MIT"
] | null | null | null | from functools import reduce
import asyncio
import re
from typing import Callable, List, Dict, Optional, Tuple
from asyncio.locks import Lock
from discord import Message, File, Embed, Colour
from discord import Member, Status
from discord import VoiceChannel, TextChannel
from discord.ext.commands import Bot
from mode... | 34.229773 | 79 | 0.597428 | from functools import reduce
import asyncio
import re
from typing import Callable, List, Dict, Optional, Tuple
from asyncio.locks import Lock
from discord import Message, File, Embed, Colour
from discord import Member, Status
from discord import VoiceChannel, TextChannel
from discord.ext.commands import Bot
from mode... | 9,418 | -9 | 589 |
92cf5679a1bdc3db3666fb0c49ba81116f127992 | 731 | py | Python | src/python/Problem078.py | mchrzanowski/ProjectEuler | 06a24cadbd2c38fb42c3935779fc7ffb6de4e1b5 | [
"MIT"
] | null | null | null | src/python/Problem078.py | mchrzanowski/ProjectEuler | 06a24cadbd2c38fb42c3935779fc7ffb6de4e1b5 | [
"MIT"
] | null | null | null | src/python/Problem078.py | mchrzanowski/ProjectEuler | 06a24cadbd2c38fb42c3935779fc7ffb6de4e1b5 | [
"MIT"
] | null | null | null | '''
Created on Feb 24, 2012
@author: mchrzanowski
'''
from time import time
SUM_LIMIT = 10 ** 6
LIMIT = 6 * 10 ** 4 # found through trial and error
if __name__ == '__main__':
start = time()
main()
end = time()
print "Runtime:", end - start, "seconds." | 21.5 | 91 | 0.521204 | '''
Created on Feb 24, 2012
@author: mchrzanowski
'''
from time import time
SUM_LIMIT = 10 ** 6
LIMIT = 6 * 10 ** 4 # found through trial and error
def main():
numberOfWays = [0 for i in xrange(LIMIT + 1)]
numberOfWays[0] = 1 # start it off
solution = 0
for i in xrange(1, LIMI... | 433 | 0 | 23 |
bcbc7c6ac9820a6f4f7ce5a285951215e6b5f234 | 14,394 | py | Python | Ssense.py | McGuire00/Ssense | b7a6cf639d78c7683caf8635a5fd935146d61eb7 | [
"MIT"
] | 7 | 2021-03-21T09:12:33.000Z | 2022-01-08T02:06:13.000Z | Ssense.py | McGuire00/Ssense | b7a6cf639d78c7683caf8635a5fd935146d61eb7 | [
"MIT"
] | 6 | 2021-03-18T21:16:05.000Z | 2021-09-04T02:49:23.000Z | Ssense.py | McGuire00/Ssense | b7a6cf639d78c7683caf8635a5fd935146d61eb7 | [
"MIT"
] | 1 | 2021-03-18T13:46:11.000Z | 2021-03-18T13:46:11.000Z | import requests
from bs4 import BeautifulSoup as bs
from datetime import datetime
import json
import sys
import time
import random
# Hard code checkout details at the bottom
# must have Ssense account
# clear cart before running bot otherwise you will get an error
# account may get flagged if ran too many times
# onl... | 47.820598 | 235 | 0.541476 | import requests
from bs4 import BeautifulSoup as bs
from datetime import datetime
import json
import sys
import time
import random
# Hard code checkout details at the bottom
# must have Ssense account
# clear cart before running bot otherwise you will get an error
# account may get flagged if ran too many times
# onl... | 12,997 | -8 | 284 |
c9eb9e164b0e8513600209a32259083aea6175ff | 8,192 | py | Python | cloudpassage/scan.py | joshuaguite/cloudpassage-halo-python-sdk | ab8775377c9e99ed89d335ee44a92553fce49eb7 | [
"BSD-3-Clause"
] | null | null | null | cloudpassage/scan.py | joshuaguite/cloudpassage-halo-python-sdk | ab8775377c9e99ed89d335ee44a92553fce49eb7 | [
"BSD-3-Clause"
] | null | null | null | cloudpassage/scan.py | joshuaguite/cloudpassage-halo-python-sdk | ab8775377c9e99ed89d335ee44a92553fce49eb7 | [
"BSD-3-Clause"
] | null | null | null | """Scan and CveException classes"""
import cloudpassage.sanity as sanity
from .utility import Utility as utility
from .exceptions import CloudPassageValidation
from .http_helper import HttpHelper
class Scan(object):
"""Initializing the Scan class:
Args:
session (:class:`cloudpassage.HaloSession`): T... | 35.008547 | 79 | 0.58252 | """Scan and CveException classes"""
import cloudpassage.sanity as sanity
from .utility import Utility as utility
from .exceptions import CloudPassageValidation
from .http_helper import HttpHelper
class Scan(object):
"""Initializing the Scan class:
Args:
session (:class:`cloudpassage.HaloSession`): T... | 830 | 0 | 27 |
c96abfa4dab42d4fd05a8ab73bf4a0fb7e2e2d68 | 949 | py | Python | emp_ide/ide.py | EasyMicroPython/EMP-IDE-OFFLINE | 65a3592ce21a54ff0145e3177d692d0baae7c2c5 | [
"MIT"
] | 6 | 2019-02-12T07:17:09.000Z | 2021-06-28T13:41:51.000Z | emp_ide/ide.py | EasyMicroPython/EMP-IDE-OFFLINE | 65a3592ce21a54ff0145e3177d692d0baae7c2c5 | [
"MIT"
] | 4 | 2019-04-09T14:20:19.000Z | 2021-05-27T13:51:56.000Z | emp_ide/ide.py | EasyMicroPython/EMP-IDE-OFFLINE | 65a3592ce21a54ff0145e3177d692d0baae7c2c5 | [
"MIT"
] | 2 | 2020-01-09T10:45:19.000Z | 2021-01-13T07:41:47.000Z | from flask import Flask
from flask import render_template
from flask import url_for
import threading
import sys
import os
import webbrowser
import time
import fire
app = Flask(__name__, static_folder='static')
@app.route('/')
if __name__ == '__main__':
main()
| 21.568182 | 100 | 0.651212 | from flask import Flask
from flask import render_template
from flask import url_for
import threading
import sys
import os
import webbrowser
import time
import fire
app = Flask(__name__, static_folder='static')
@app.route('/')
def index():
return render_template('index.html')
def wsb(device, port):
time.sle... | 586 | 0 | 91 |
a625e750c62ffcc0ac5619572d404058a14e3316 | 447 | py | Python | src/pyplayer/sleepmanager.py | jaquielajoie/pyplayer | 6e8c2f4450ca671f6c6a19a9eb234756603e351f | [
"Apache-2.0"
] | 1 | 2021-07-19T01:28:37.000Z | 2021-07-19T01:28:37.000Z | src/pyplayer/sleepmanager.py | jaquielajoie/pyplayer | 6e8c2f4450ca671f6c6a19a9eb234756603e351f | [
"Apache-2.0"
] | null | null | null | src/pyplayer/sleepmanager.py | jaquielajoie/pyplayer | 6e8c2f4450ca671f6c6a19a9eb234756603e351f | [
"Apache-2.0"
] | null | null | null | """
==========================================
Title: PyPlayer SleepManager
Author: @jaquielajoie
Date: 17 July 2021
Liscence: Apache 2.0
==========================================
"""
import time
"""
SleepManager is a child of MarkovPlayer
This class quantizes sleep times according to BPM
"""
| 18.625 | 52 | 0.543624 | """
==========================================
Title: PyPlayer SleepManager
Author: @jaquielajoie
Date: 17 July 2021
Liscence: Apache 2.0
==========================================
"""
import time
"""
SleepManager is a child of MarkovPlayer
This class quantizes sleep times according to BPM
"""
class SleepM... | 65 | -2 | 77 |
703bec93b889cccbec86b4c869833afa5b2fadc6 | 2,834 | py | Python | videocapture.py | colanicy/opencvforpython-example | e61e499f5bdb0c406acecc8e4eb4ea9864ff06ff | [
"MIT"
] | 1 | 2017-09-25T03:02:50.000Z | 2017-09-25T03:02:50.000Z | videocapture.py | colanicy/opencvforpython-example | e61e499f5bdb0c406acecc8e4eb4ea9864ff06ff | [
"MIT"
] | null | null | null | videocapture.py | colanicy/opencvforpython-example | e61e499f5bdb0c406acecc8e4eb4ea9864ff06ff | [
"MIT"
] | null | null | null | #-*-coding:utf-8-*-
import cv2
import matplotlib.pyplot as plt
import sys
import copy
camID = 0
capture = cv2.VideoCapture(camID)
cv2.namedWindow("camera",1)
#set FRAME_WIDTH,FRAME_HEIGHT
'''
设置摄像机分辨率的问题。
最小分辨率,宽度为4,高度为3。
以此类推应该为4的倍数或3的倍数。
你可以通过videocapture成员函数set来设置,摄像机的分辨率。
videocapture默认的情况下为64... | 35.873418 | 130 | 0.761468 | #-*-coding:utf-8-*-
import cv2
import matplotlib.pyplot as plt
import sys
import copy
camID = 0
capture = cv2.VideoCapture(camID)
cv2.namedWindow("camera",1)
#set FRAME_WIDTH,FRAME_HEIGHT
'''
设置摄像机分辨率的问题。
最小分辨率,宽度为4,高度为3。
以此类推应该为4的倍数或3的倍数。
你可以通过videocapture成员函数set来设置,摄像机的分辨率。
videocapture默认的情况下为64... | 0 | 0 | 0 |
02067fb90b31e75634b574bc25725b26b585b4a4 | 1,946 | py | Python | lollipop/type_registry.py | maximkulkin/zephyr | 7ee5a4f88ef24314912b5a03136b0bf9772713bb | [
"MIT"
] | 36 | 2016-07-31T16:23:55.000Z | 2021-11-28T01:36:19.000Z | lollipop/type_registry.py | maximkulkin/lollipop | 7ee5a4f88ef24314912b5a03136b0bf9772713bb | [
"MIT"
] | 17 | 2016-07-28T23:58:31.000Z | 2022-01-15T06:26:18.000Z | lollipop/type_registry.py | maximkulkin/zephyr | 7ee5a4f88ef24314912b5a03136b0bf9772713bb | [
"MIT"
] | 11 | 2016-08-01T20:21:30.000Z | 2022-01-15T06:14:52.000Z | from lollipop.types import Type
__all__ = [
'TypeRegistry',
]
class TypeRegistry(object):
"""Storage for type instances with ability to get type instance proxy with
delayed type resolution for implementing mutual cross-references.
Example: ::
TYPES = TypeRegistry()
PersonType = T... | 27.027778 | 80 | 0.605858 | from lollipop.types import Type
__all__ = [
'TypeRegistry',
]
class TypeRef(Type):
def __init__(self, get_type):
super(TypeRef, self).__init__()
self._get_type = get_type
self._inner_type = None
@property
def inner_type(self):
if self._inner_type is None:
... | 936 | 174 | 157 |
b72234f61a6254bb6e6b5052bfc8780bde2305e1 | 9,543 | py | Python | Lib/site-packages/pandas_ml/skaccessors/metrics.py | jsturtz/env | d523b0be3345f883a727679d58ff29efb4389d16 | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/pandas_ml/skaccessors/metrics.py | jsturtz/env | d523b0be3345f883a727679d58ff29efb4389d16 | [
"bzip2-1.0.6"
] | null | null | null | Lib/site-packages/pandas_ml/skaccessors/metrics.py | jsturtz/env | d523b0be3345f883a727679d58ff29efb4389d16 | [
"bzip2-1.0.6"
] | null | null | null | #!/usr/bin/env python
from pandas_ml.core.accessor import (_AccessorMethods, _attach_methods,
_wrap_target_pred_func,
_wrap_target_pred_noargs)
import pandas_ml.util as util
class MetricsMethods(_AccessorMethods):
"""
Accessor to ``skl... | 35.608209 | 99 | 0.580949 | #!/usr/bin/env python
from pandas_ml.core.accessor import (_AccessorMethods, _attach_methods,
_wrap_target_pred_func,
_wrap_target_pred_noargs)
import pandas_ml.util as util
class MetricsMethods(_AccessorMethods):
"""
Accessor to ``skl... | 1,239 | 0 | 54 |
f5053be275f2ce24d1b032ed805dfc1d65977dcc | 1,118 | py | Python | src/compapp/tests/test_parametric.py | tkf/compapp | d34d75553f4c5ecd8fc3112072ff58a28cdc8c87 | [
"BSD-2-Clause"
] | null | null | null | src/compapp/tests/test_parametric.py | tkf/compapp | d34d75553f4c5ecd8fc3112072ff58a28cdc8c87 | [
"BSD-2-Clause"
] | null | null | null | src/compapp/tests/test_parametric.py | tkf/compapp | d34d75553f4c5ecd8fc3112072ff58a28cdc8c87 | [
"BSD-2-Clause"
] | null | null | null | import unittest
from ..core import Parametric
| 23.787234 | 60 | 0.637746 | import unittest
from ..core import Parametric
class MyParametric(Parametric):
i = 1
x = 2.0
class nested(Parametric):
a = 100
b = 200
class TestMixObject(unittest.TestCase):
class AutoMixed(MyParametric):
class nested(object):
a = -1
def test_default_value... | 630 | 345 | 92 |
b1a339f8400ac697518a00f35007bbc8a31e6b4f | 958 | py | Python | tests/test_video_api.py | GlobalRadio/youtube-api-wrapper | 6c2ff41ef7a0aa565771c5cf69fe91aa6cc8a102 | [
"Apache-2.0"
] | 4 | 2017-10-22T04:39:59.000Z | 2020-12-08T00:06:57.000Z | tests/test_video_api.py | TomoriBot/youtube-api-wrapper | b32fd02a286ef8d7b4f946bb06d86e5c141e58dc | [
"Apache-2.0"
] | 1 | 2015-04-11T12:18:19.000Z | 2015-04-11T12:18:19.000Z | tests/test_video_api.py | TomoriBot/youtube-api-wrapper | b32fd02a286ef8d7b4f946bb06d86e5c141e58dc | [
"Apache-2.0"
] | 3 | 2015-04-11T12:04:16.000Z | 2019-08-14T10:13:47.000Z | import pytest
from youtube_api.client import VideoAPI
from youtube_api.exceptions import *
@pytest.mark.parametrize(('resource_filter', 'parts', 'optional_params', 'expected_exception'), [
({'id': 1}, ('test',), {}, PartNotAllowed),
({'test': 1}, ('snippet',), {}, ... | 41.652174 | 98 | 0.635699 | import pytest
from youtube_api.client import VideoAPI
from youtube_api.exceptions import *
@pytest.mark.parametrize(('resource_filter', 'parts', 'optional_params', 'expected_exception'), [
({'id': 1}, ('test',), {}, PartNotAllowed),
({'test': 1}, ('snippet',), {}, ... | 405 | 0 | 45 |
30edfb09bf859886d5b7492a09c3555a9ff3f322 | 1,744 | py | Python | evaluation/fid/fid_example.py | pedroryzewski/TCC | ba5167928d5a14dc0c6e144d0927c050090950a6 | [
"MIT"
] | null | null | null | evaluation/fid/fid_example.py | pedroryzewski/TCC | ba5167928d5a14dc0c6e144d0927c050090950a6 | [
"MIT"
] | null | null | null | evaluation/fid/fid_example.py | pedroryzewski/TCC | ba5167928d5a14dc0c6e144d0927c050090950a6 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
from __future__ import absolute_import, division, print_function
import os
import glob
# os.environ['CUDA_VISIBLE_DEVICES'] = '0'
import numpy as np
import fid
from scipy.misc import imread
import tensorflow as tf
import h5py
import json
tf.app.flags.DEFINE_string('image_folder','',"""Path where... | 37.913043 | 143 | 0.756881 | #!/usr/bin/env python3
from __future__ import absolute_import, division, print_function
import os
import glob
# os.environ['CUDA_VISIBLE_DEVICES'] = '0'
import numpy as np
import fid
from scipy.misc import imread
import tensorflow as tf
import h5py
import json
tf.app.flags.DEFINE_string('image_folder','',"""Path where... | 0 | 0 | 0 |
6cf006ed74e035d8d00158c75a607dd20f9489ab | 828 | py | Python | HackerRank/surfaceArea.py | shobhitmishra/CodingProblems | 0fc8c5037eef95b3ec9826b3a6e48885fc86659e | [
"MIT"
] | null | null | null | HackerRank/surfaceArea.py | shobhitmishra/CodingProblems | 0fc8c5037eef95b3ec9826b3a6e48885fc86659e | [
"MIT"
] | null | null | null | HackerRank/surfaceArea.py | shobhitmishra/CodingProblems | 0fc8c5037eef95b3ec9826b3a6e48885fc86659e | [
"MIT"
] | null | null | null |
grid = [[1,3,4], [2,2,3], [1,2,4]]
print(surfaceArea(grid))
| 33.12 | 91 | 0.595411 | def surfaceArea(A):
totalSurfaceArea = 0
for i in range(0, len(A)):
for j in range(0, len(A[0])):
totalSurfaceArea += 2
totalSurfaceArea += getSurroundingSurfaceArea(i, j, A)
return totalSurfaceArea
def getSurroundingSurfaceArea(i, j, A):
surroundingarea = 0
curr... | 721 | 0 | 45 |
2accee33aa379745ea1d0d32ff48cc9cd5834dd6 | 218 | py | Python | pin_passcode/urls.py | mbi/django-pin-passcode | d4ed4d95dd53906b2d95c789f7acbf2eb8f3c95f | [
"MIT"
] | 1 | 2015-02-17T22:40:36.000Z | 2015-02-17T22:40:36.000Z | pin_passcode/urls.py | mbi/django-pin-passcode | d4ed4d95dd53906b2d95c789f7acbf2eb8f3c95f | [
"MIT"
] | null | null | null | pin_passcode/urls.py | mbi/django-pin-passcode | d4ed4d95dd53906b2d95c789f7acbf2eb8f3c95f | [
"MIT"
] | null | null | null | from django.conf.urls import patterns, include, url
urlpatterns = patterns(
'',
url(r'pin/$', 'pin_passcode.views.form', name='pin_form'),
url(r'pin/auth$', 'pin_passcode.views.auth', name='pin_auth'),
)
| 24.222222 | 66 | 0.665138 | from django.conf.urls import patterns, include, url
urlpatterns = patterns(
'',
url(r'pin/$', 'pin_passcode.views.form', name='pin_form'),
url(r'pin/auth$', 'pin_passcode.views.auth', name='pin_auth'),
)
| 0 | 0 | 0 |
afd606faed38ebbbfad17f65a6cf299fd5616dcd | 1,097 | py | Python | tests/fahrenheit_from_test.py | deepspaceghost/deme | 324741ee8e6ef30de5116f6018966829302796ed | [
"MIT"
] | null | null | null | tests/fahrenheit_from_test.py | deepspaceghost/deme | 324741ee8e6ef30de5116f6018966829302796ed | [
"MIT"
] | 6 | 2021-07-09T16:56:28.000Z | 2022-03-12T00:58:06.000Z | tests/fahrenheit_from_test.py | deepspaceghost/demeter.py | 324741ee8e6ef30de5116f6018966829302796ed | [
"MIT"
] | 1 | 2021-06-01T23:49:44.000Z | 2021-06-01T23:49:44.000Z | def fahrenheit_from(celsius: int):
"""
This function takes the celsius, multiplies, divides, and adds to
convert it to fahrenheit, rounds the number to digits, and sends the
final number as a string.
"""
fahrenheit = float(celsius) * 9 / 5 + 32
fahrenheit = round(fahrenheit, 3)
... | 26.756098 | 73 | 0.642662 | def fahrenheit_from(celsius: int):
"""
This function takes the celsius, multiplies, divides, and adds to
convert it to fahrenheit, rounds the number to digits, and sends the
final number as a string.
"""
fahrenheit = float(celsius) * 9 / 5 + 32
fahrenheit = round(fahrenheit, 3)
... | 0 | 0 | 0 |
d69c453688a51698afd9a329ee8124658561dbcd | 6,405 | py | Python | tsticle/tst.py | burtgulash/TSTicle | ec722ba5e904fa32e05def0a6002d9c3bbedf900 | [
"MIT"
] | 2 | 2016-01-19T11:30:41.000Z | 2018-05-15T05:28:42.000Z | tsticle/tst.py | burtgulash/TSTicle | ec722ba5e904fa32e05def0a6002d9c3bbedf900 | [
"MIT"
] | null | null | null | tsticle/tst.py | burtgulash/TSTicle | ec722ba5e904fa32e05def0a6002d9c3bbedf900 | [
"MIT"
] | null | null | null | from tsticle.node import TNode
| 30.5 | 105 | 0.383138 | from tsticle.node import TNode
class TST:
def __init__(self):
self.size = 0
self.root = None
def __len__(self):
return self.size
def remove(self, word):
word += '\0'
last_fork = prev = cur = self.root
i = 0
LEFT = 1
MID = 2
RIGHT =... | 6,118 | -11 | 266 |