hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | 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 130 | 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 130 | 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.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
85002a8f81bc914a0a8bf332961d866820ac2fc2 | 6,604 | py | Python | daemon_with_access_token.py | cBashTN/Kolibri-Cloud-API-daemon-example-with-access-token | d1aa2b550d57f17851c540ab5d953f66001b8c81 | [
"MIT"
] | null | null | null | daemon_with_access_token.py | cBashTN/Kolibri-Cloud-API-daemon-example-with-access-token | d1aa2b550d57f17851c540ab5d953f66001b8c81 | [
"MIT"
] | null | null | null | daemon_with_access_token.py | cBashTN/Kolibri-Cloud-API-daemon-example-with-access-token | d1aa2b550d57f17851c540ab5d953f66001b8c81 | [
"MIT"
] | null | null | null | # This Python file uses the following encoding: utf-8
# ##############################################################################
# KOLIBRI CLOUD API DAEMON EXAMPLE WITH ACCESS TOKEN #
# #
# Needs: ... | 43.163399 | 212 | 0.573137 | # This Python file uses the following encoding: utf-8
# ##############################################################################
# KOLIBRI CLOUD API DAEMON EXAMPLE WITH ACCESS TOKEN #
# #
# Needs: ... | 14 | 0 | 0 | 0 | 0 | 1,966 | 0 | 0 | 46 |
a6cacc7ea2347d3e08ff074df169e0ab58f5ec25 | 2,416 | py | Python | mysite/pynny/templatetags/pynny_extras.py | zach-king/Pynny | 3dac355092084385c673fd94ef9693f046a835a0 | [
"MIT"
] | null | null | null | mysite/pynny/templatetags/pynny_extras.py | zach-king/Pynny | 3dac355092084385c673fd94ef9693f046a835a0 | [
"MIT"
] | 42 | 2017-09-05T02:38:08.000Z | 2021-06-10T18:32:57.000Z | mysite/pynny/templatetags/pynny_extras.py | zcking/Pynny | 3dac355092084385c673fd94ef9693f046a835a0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
'''
File: template_filters.py
Author: Zachary King
Implements custom Django template filters to be used
in Django templates.
'''
| 23.686275 | 78 | 0.649834 | #!/usr/bin/env python3
'''
File: template_filters.py
Author: Zachary King
Implements custom Django template filters to be used
in Django templates.
'''
from django.template.defaultfilters import register
from datetime import date, datetime
from decimal import Decimal
@register.simple_tag
def saving_class(saving):
... | 0 | 1,911 | 0 | 0 | 0 | 0 | 0 | 50 | 298 |
8139cb12d7124b9102439c462cc50689661fc1f7 | 804 | py | Python | ML/50-mlps/04-keras-1000-epochs/create_validation_curve.py | PepSalehi/algorithms | 1c20f57185e6324aa840ccff98e69764b4213131 | [
"MIT"
] | null | null | null | ML/50-mlps/04-keras-1000-epochs/create_validation_curve.py | PepSalehi/algorithms | 1c20f57185e6324aa840ccff98e69764b4213131 | [
"MIT"
] | null | null | null | ML/50-mlps/04-keras-1000-epochs/create_validation_curve.py | PepSalehi/algorithms | 1c20f57185e6324aa840ccff98e69764b4213131 | [
"MIT"
] | 1 | 2019-12-09T21:40:46.000Z | 2019-12-09T21:40:46.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Visualize validation curve."""
import pandas as pd
import matplotlib.pyplot as plt
Y_SCALE_FACTOR = 100
# Prepare dataframe
df = pd.read_csv('log.csv', sep=';')
df = df[['epoch', 'acc', 'val_acc']]
df[['acc', 'val_acc']] = df[['acc', 'val_acc']] * Y_SCALE_FACTOR
df =... | 28.714286 | 77 | 0.619403 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Visualize validation curve."""
import pandas as pd
import matplotlib.pyplot as plt
Y_SCALE_FACTOR = 100
# Prepare dataframe
df = pd.read_csv('log.csv', sep=';')
df = df[['epoch', 'acc', 'val_acc']]
df[['acc', 'val_acc']] = df[['acc', 'val_acc']] * Y_SCALE_FACTOR
df =... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0eae3be1ede6942cfdb4f2d7482c3a67099fb9a2 | 2,633 | py | Python | tools/dockerize/webportal/usr/lib/python2.7/site-packages/oslo_messaging/_drivers/protocols/amqp/opts.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | 1 | 2019-09-11T11:56:19.000Z | 2019-09-11T11:56:19.000Z | tools/dockerize/webportal/usr/lib/python2.7/site-packages/oslo_messaging/_drivers/protocols/amqp/opts.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | null | null | null | tools/dockerize/webportal/usr/lib/python2.7/site-packages/oslo_messaging/_drivers/protocols/amqp/opts.py | foruy/openflow-multiopenstack | 74140b041ac25ed83898ff3998e8dcbed35572bb | [
"Apache-2.0"
] | null | null | null | # Copyright 2014, Red Hat, 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 applicable law or ... | 35.581081 | 79 | 0.600836 | # Copyright 2014, Red Hat, 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 applicable law or ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
714ab47942c46cc7c1af50657246bfe244f16999 | 10,858 | py | Python | labinform/datasafe/datasafe.py | tillbiskup/labinform | be483786e43abd579f7b3622e4a6be900d5823e2 | [
"BSD-2-Clause"
] | null | null | null | labinform/datasafe/datasafe.py | tillbiskup/labinform | be483786e43abd579f7b3622e4a6be900d5823e2 | [
"BSD-2-Clause"
] | null | null | null | labinform/datasafe/datasafe.py | tillbiskup/labinform | be483786e43abd579f7b3622e4a6be900d5823e2 | [
"BSD-2-Clause"
] | null | null | null | """Datasafe module for the labinform package.
The datasafe is a key feature of labinform which serves to safely store data.
Functionality includes directory generation and checksum creation.
"""
| 29.032086 | 79 | 0.586112 | """Datasafe module for the labinform package.
The datasafe is a key feature of labinform which serves to safely store data.
Functionality includes directory generation and checksum creation.
"""
import os
import hashlib
import shutil
class Error(Exception):
"""Base class for exceptions in this module."""
p... | 0 | 2,234 | 0 | 8,268 | 0 | 0 | 0 | -27 | 182 |
67982a1010d5c17191a807f093238593ff6f4487 | 691 | py | Python | IRIS Flower Classification Project/main.py | jrderek/Machine-Learning-projects | b98eaace9a8e14d448a5fc1940779a19fe74dd68 | [
"MIT"
] | 2 | 2020-12-05T08:38:57.000Z | 2020-12-22T11:44:38.000Z | main.py | itzanuragsinghania/IRIS-Flower-Classification | a66e5577a371f44b6993ad2c909ce5acc77534c9 | [
"MIT"
] | null | null | null | main.py | itzanuragsinghania/IRIS-Flower-Classification | a66e5577a371f44b6993ad2c909ce5acc77534c9 | [
"MIT"
] | null | null | null | from flask import Flask
from sklearn.externals import joblib
app = Flask(__name__)
filename = './data/model.sav'
model = joblib.load(filename)
| 27.64 | 59 | 0.7178 | from flask import Flask, render_template, url_for, request
import numpy as np
from sklearn.externals import joblib
app = Flask(__name__)
filename = './data/model.sav'
model = joblib.load(filename)
def find_species(a,b,c,d):
return model.predict(np.array([a,b,c,d]).reshape(1,-1))[0]
@app.route("/")
@app.route("/inde... | 0 | 359 | 0 | 0 | 0 | 65 | 0 | 32 | 91 |
0a9f6e6dcbf2c8da7b4de29c02434702347b60e4 | 4,670 | py | Python | xlsxwriter/test/worksheet/test_worksheet06.py | edparcell/XlsxWriter | d6a5df232ac0091017ae5c65f592bcc776d296ea | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2019-01-09T19:43:43.000Z | 2019-01-09T19:43:43.000Z | xlsxwriter/test/worksheet/test_worksheet06.py | edparcell/XlsxWriter | d6a5df232ac0091017ae5c65f592bcc776d296ea | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | xlsxwriter/test/worksheet/test_worksheet06.py | edparcell/XlsxWriter | d6a5df232ac0091017ae5c65f592bcc776d296ea | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2018, John McNamara, jmcnamara@cpan.org
#
| 33.597122 | 171 | 0.557173 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2018, John McNamara, jmcnamara@cpan.org
#
import unittest
from ...compatibility import StringIO
from ..helperfunctions import _xml_to_list
from ...worksheet import Worksheet
from ...shareds... | 0 | 0 | 0 | 4,294 | 0 | 0 | 0 | 69 | 134 |
d8567e47cb7ba08033e9c8cff59fab6971372385 | 1,372 | py | Python | allure-pytest/test/fixtures/module_scope/fixtures_simple_test.py | vdsbenoit/allure-python | 7b56b031c42369dd73844105382e9ceb9a88d6cd | [
"Apache-2.0"
] | 1 | 2021-02-19T21:00:11.000Z | 2021-02-19T21:00:11.000Z | allure-pytest/test/fixtures/module_scope/fixtures_simple_test.py | vdsbenoit/allure-python | 7b56b031c42369dd73844105382e9ceb9a88d6cd | [
"Apache-2.0"
] | null | null | null | allure-pytest/test/fixtures/module_scope/fixtures_simple_test.py | vdsbenoit/allure-python | 7b56b031c42369dd73844105382e9ceb9a88d6cd | [
"Apache-2.0"
] | 1 | 2020-08-05T05:40:44.000Z | 2020-08-05T05:40:44.000Z |
def test_module_scope_simple_fixture(module_scope_simple_fixture):
"""
>>> allure_report = getfixture('allure_report')
>>> assert_that(allure_report,
... has_test_case('test_module_scope_simple_fixture',
... has_container(allure_report,
... ... | 31.906977 | 89 | 0.509475 | import pytest
@pytest.fixture(scope='module')
def module_scope_simple_fixture():
pass
def test_module_scope_simple_fixture(module_scope_simple_fixture):
"""
>>> allure_report = getfixture('allure_report')
>>> assert_that(allure_report,
... has_test_case('test_module_scope_simple_fixt... | 0 | 54 | 0 | 0 | 0 | 0 | 0 | -8 | 45 |
a30dc0ac5d58b18237f87ea3dfc0cd5b019efc1f | 2,018 | py | Python | Code.py | vybhavjain/NLP_PROJECT | 42f6dcb6aaccd1dcb53e1d9a96e67152a9d49ca6 | [
"MIT"
] | null | null | null | Code.py | vybhavjain/NLP_PROJECT | 42f6dcb6aaccd1dcb53e1d9a96e67152a9d49ca6 | [
"MIT"
] | null | null | null | Code.py | vybhavjain/NLP_PROJECT | 42f6dcb6aaccd1dcb53e1d9a96e67152a9d49ca6 | [
"MIT"
] | null | null | null | import turtle
import speech_recognition as sr
import re
r = sr.Recognizer()
with sr.Microphone() as source:
print('Say Something')
audio=r.listen(source)
try:
print('Google thinks you said:\n' + r.recognize_google(audio))
except:
pass
n=r.recognize_google(audio)
patterns= [r'\d+']
radd... | 20.18 | 66 | 0.613479 | import turtle
import math
import speech_recognition as sr
import re
def circle(radius):
turtle.up()
# go to (0, radius)
turtle.goto(0,radius)
turtle.down()
turtle.color("red")
# number of times the y axis has been crossed
times_crossed_y = 0
x_sign = 1.0
while times_crossed_... | 0 | 0 | 0 | 0 | 0 | 1,145 | 0 | -10 | 116 |
e8fde1ba1597924021a71bac35d5b4f831e16789 | 2,286 | py | Python | assign4/src/lexer.py | rali20/cs335-project | 6115cf4592fff1f9ab5ed21896acf671b38ffcc3 | [
"MIT"
] | null | null | null | assign4/src/lexer.py | rali20/cs335-project | 6115cf4592fff1f9ab5ed21896acf671b38ffcc3 | [
"MIT"
] | null | null | null | assign4/src/lexer.py | rali20/cs335-project | 6115cf4592fff1f9ab5ed21896acf671b38ffcc3 | [
"MIT"
] | null | null | null | import ply.lex as lex
keywords = {
'BREAK', 'CONST', 'CONTINUE', 'ELIF',
'ELSE', 'FOR', 'FUNC', 'GOTO',
'IF', 'RETURN', 'STRUCT', 'TYPE',
'VAR' }
operators = {
'ADD', # +
'SUB', # -
'MUL', # *
'QUO', # /
'REM', # %
'AND', # &
'OR', # |
'SHL', # <<
'SHR', # ... | 17.584615 | 69 | 0.453631 | import ply.lex as lex
keywords = {
'BREAK', 'CONST', 'CONTINUE', 'ELIF',
'ELSE', 'FOR', 'FUNC', 'GOTO',
'IF', 'RETURN', 'STRUCT', 'TYPE',
'VAR' }
operators = {
'ADD', # +
'SUB', # -
'MUL', # *
'QUO', # /
'REM', # %
'AND', # &
'OR', # |
'SHL', # <<
'SHR', # ... | 0 | 261 | 0 | 0 | 0 | 159 | 0 | 0 | 115 |
9ab77af536f3ff9a485a1f1789860b577739c4a8 | 902 | py | Python | setup.py | Huelse/HEAAN-Python | 034ee757a7b7949d96b27d3228819dd9be6579ae | [
"MIT"
] | 17 | 2020-01-04T13:02:45.000Z | 2022-02-18T08:37:58.000Z | setup.py | Huelse/PYHEAAN | 034ee757a7b7949d96b27d3228819dd9be6579ae | [
"MIT"
] | 6 | 2020-07-03T09:43:01.000Z | 2021-11-02T08:30:56.000Z | setup.py | Huelse/PYHEAAN | 034ee757a7b7949d96b27d3228819dd9be6579ae | [
"MIT"
] | 4 | 2020-01-04T13:02:47.000Z | 2021-09-14T00:04:53.000Z | from distutils.core import setup, Extension
from distutils import sysconfig
cfg_vars = sysconfig.get_config_vars()
for key, value in cfg_vars.items():
if type(value) == str:
cfg_vars[key] = value.replace('-Wstrict-prototypes', '')
cpp_args = ['-std=c++11']
ext_modules = [
Extension(
'HEAAN',
... | 28.1875 | 111 | 0.641907 | from distutils.core import setup, Extension
from distutils import sysconfig
cfg_vars = sysconfig.get_config_vars()
for key, value in cfg_vars.items():
if type(value) == str:
cfg_vars[key] = value.replace('-Wstrict-prototypes', '')
cpp_args = ['-std=c++11']
ext_modules = [
Extension(
'HEAAN',
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fc13f414dd8d7f0600657287014d27609e190f10 | 21,848 | py | Python | grr/server/grr_response_server/check_lib/checks_test.py | khanhgithead/grr | 8ad8a4d2c5a93c92729206b7771af19d92d4f915 | [
"Apache-2.0"
] | 4,238 | 2015-01-01T15:34:50.000Z | 2022-03-31T08:18:05.000Z | grr/server/grr_response_server/check_lib/checks_test.py | khanhgithead/grr | 8ad8a4d2c5a93c92729206b7771af19d92d4f915 | [
"Apache-2.0"
] | 787 | 2015-01-02T21:34:24.000Z | 2022-03-02T13:26:38.000Z | grr/server/grr_response_server/check_lib/checks_test.py | khanhgithead/grr | 8ad8a4d2c5a93c92729206b7771af19d92d4f915 | [
"Apache-2.0"
] | 856 | 2015-01-02T02:50:11.000Z | 2022-03-31T11:11:53.000Z | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""Tests for checks."""
import os
from absl import app
from grr_response_core import config
CHECKS_DIR = os.path.join(config.CONFIG["Test.data_dir"], "checks")
TRIGGER_1 = ("DebianPackagesStatus", "Linux", None, None)
TRIGGER_2 = ("WMIInstalledSoftware", "Windows", No... | 36.596315 | 80 | 0.682992 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""Tests for checks."""
import os
from absl import app
from grr_response_core import config
from grr_response_core.lib.parsers import config_file as config_file_parsers
from grr_response_core.lib.parsers import linux_cmd_parser
from grr_response_core.lib.parsers import... | 0 | 0 | 0 | 19,529 | 0 | 925 | 0 | 343 | 565 |
f40433383c076322b093e44928670306096be641 | 738 | py | Python | code/exampleStrats/grimTrigger.py | robo-monk/PrisonersDilemmaTournament | 84f323f46233d3c6b4ce4380e04e981520912423 | [
"MIT"
] | null | null | null | code/exampleStrats/grimTrigger.py | robo-monk/PrisonersDilemmaTournament | 84f323f46233d3c6b4ce4380e04e981520912423 | [
"MIT"
] | null | null | null | code/exampleStrats/grimTrigger.py | robo-monk/PrisonersDilemmaTournament | 84f323f46233d3c6b4ce4380e04e981520912423 | [
"MIT"
] | null | null | null | # Strategy known as "Grim Trigger" or "Grudger".
# We will cooperate repeatedly until our opponent betrays us once.
# Then, we will get angry and defect for the rest of time.
#
# In this implementation, I used the memory variable to store Grim Trigger's state of mind.
# memory is true if Grim Trigger has been wronged, ... | 36.9 | 91 | 0.665312 | # Strategy known as "Grim Trigger" or "Grudger".
# We will cooperate repeatedly until our opponent betrays us once.
# Then, we will get angry and defect for the rest of time.
#
# In this implementation, I used the memory variable to store Grim Trigger's state of mind.
# memory is true if Grim Trigger has been wronged, ... | 0 | 0 | 0 | 0 | 0 | 366 | 0 | 0 | 22 |
834346e09dafd4d37d18d307f014b0104fd5d23a | 9,764 | py | Python | cbopensource/connectors/fortisandbox/api_fortisandbox.py | carbonblack/cb-fortisandbox-connector | 1c1f45c133e44a7498147f79e2c2e462e6e59022 | [
"MIT"
] | 3 | 2019-12-11T07:39:46.000Z | 2021-11-10T07:46:10.000Z | cbopensource/connectors/fortisandbox/api_fortisandbox.py | sierrezinal/cb-fortisandbox-connector | 1c1f45c133e44a7498147f79e2c2e462e6e59022 | [
"MIT"
] | null | null | null | cbopensource/connectors/fortisandbox/api_fortisandbox.py | sierrezinal/cb-fortisandbox-connector | 1c1f45c133e44a7498147f79e2c2e462e6e59022 | [
"MIT"
] | 2 | 2020-08-02T19:21:43.000Z | 2020-09-01T23:22:53.000Z | import os
import requests
import json
from base64 import b64encode, b64decode
# NOTE: For 'requests' to work with 'https' addrs, must use 'verify=False'
# to ignore invalid SSL certificates.
TEST_URL = 'https://10.210.39.16/jsonrpc'
# NOTE: List is used to control the order in which RPC requests are sent (order
# matte... | 28.138329 | 92 | 0.508193 | import os
import requests
import json
from base64 import b64encode, b64decode
# NOTE: For 'requests' to work with 'https' addrs, must use 'verify=False'
# to ignore invalid SSL certificates.
TEST_URL = 'https://10.210.39.16/jsonrpc'
# NOTE: List is used to control the order in which RPC requests are sent (order
# matte... | 0 | 0 | 0 | 0 | 0 | 473 | 0 | 0 | 23 |
43d199d30a03046712e04f52ced815d863208b1a | 1,152 | py | Python | calvin/calvinsys/media/mediaplayer.py | josrolgil/exjobbCalvin | 976459eaa50246586360c049b9880d753623d574 | [
"Apache-2.0"
] | 1 | 2016-05-10T22:36:31.000Z | 2016-05-10T22:36:31.000Z | calvin/calvinsys/media/mediaplayer.py | josrolgil/exjobbCalvin | 976459eaa50246586360c049b9880d753623d574 | [
"Apache-2.0"
] | null | null | null | calvin/calvinsys/media/mediaplayer.py | josrolgil/exjobbCalvin | 976459eaa50246586360c049b9880d753623d574 | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 24.510638 | 74 | 0.662326 | # -*- coding: utf-8 -*-
# Copyright (c) 2015 Ericsson AB
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 0 | 0 | 0 | 328 | 0 | 0 | 0 | 37 | 46 |
c3b978c2d664237823d69dbf887cee9555ab595b | 1,681 | py | Python | setup.py | WarmongeR1/vulyk-pythondigest-moderator | 57f06a151926c918b90dcea55b561800aa9ae7ad | [
"MIT"
] | null | null | null | setup.py | WarmongeR1/vulyk-pythondigest-moderator | 57f06a151926c918b90dcea55b561800aa9ae7ad | [
"MIT"
] | null | null | null | setup.py | WarmongeR1/vulyk-pythondigest-moderator | 57f06a151926c918b90dcea55b561800aa9ae7ad | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import uuid
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
from pip.req import parse_requirements
with open('README.rst') as readme_file:
readme = readme_file.read()
install_reqs = parse_requirements('requirements.txt'... | 30.563636 | 75 | 0.674004 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import uuid
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
from pip.req import parse_requirements
with open('README.rst') as readme_file:
readme = readme_file.read()
install_reqs = parse_requirements('requirements.txt'... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b05f0e8fc33f8ea67be7ec8884f5ada4b6bd909d | 1,342 | py | Python | cogs/food.py | dave-kramer/atlasboy | 7715e2a6e9385abc95a558b3a5bee885fbd584f9 | [
"MIT"
] | null | null | null | cogs/food.py | dave-kramer/atlasboy | 7715e2a6e9385abc95a558b3a5bee885fbd584f9 | [
"MIT"
] | null | null | null | cogs/food.py | dave-kramer/atlasboy | 7715e2a6e9385abc95a558b3a5bee885fbd584f9 | [
"MIT"
] | 1 | 2022-01-10T12:06:36.000Z | 2022-01-10T12:06:36.000Z |
# adding cog to bot setup | 34.410256 | 158 | 0.593145 | import discord
import datetime
from discord.ext import commands
from all import food_list
class Food(commands.Cog):
def __init__(self, client):
self.client = client
description = 'Get information about a certain animal.'
@commands.command(name='food')
async def food(self, ct... | 0 | 988 | 0 | 169 | 0 | 21 | 0 | 2 | 134 |
2fc00c26a120a51a29955dc0efcf39d03c6ca97b | 88 | py | Python | codes_auto/198.house-robber.py | smartmark-pro/leetcode_record | 6504b733d892a705571eb4eac836fb10e94e56db | [
"MIT"
] | null | null | null | codes_auto/198.house-robber.py | smartmark-pro/leetcode_record | 6504b733d892a705571eb4eac836fb10e94e56db | [
"MIT"
] | null | null | null | codes_auto/198.house-robber.py | smartmark-pro/leetcode_record | 6504b733d892a705571eb4eac836fb10e94e56db | [
"MIT"
] | null | null | null | #
# @lc app=leetcode.cn id=198 lang=python3
#
# [198] house-robber
#
None
# @lc code=end | 12.571429 | 41 | 0.659091 | #
# @lc app=leetcode.cn id=198 lang=python3
#
# [198] house-robber
#
None
# @lc code=end | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8acba6555ffdb28c6c615b0e3a53dc5e4cea65d7 | 1,142 | py | Python | Easy/1351.CountNegativeNumbersinaSortedMatrix(nestedForOptimized).py | YuriSpiridonov/LeetCode | 2dfcc9c71466ffa2ebc1c89e461ddfca92e2e781 | [
"MIT"
] | 39 | 2020-07-04T11:15:13.000Z | 2022-02-04T22:33:42.000Z | Easy/1351.CountNegativeNumbersinaSortedMatrix(nestedForOptimized).py | YuriSpiridonov/LeetCode | 2dfcc9c71466ffa2ebc1c89e461ddfca92e2e781 | [
"MIT"
] | 1 | 2020-07-15T11:53:37.000Z | 2020-07-15T11:53:37.000Z | Easy/1351.CountNegativeNumbersinaSortedMatrix(nestedForOptimized).py | YuriSpiridonov/LeetCode | 2dfcc9c71466ffa2ebc1c89e461ddfca92e2e781 | [
"MIT"
] | 20 | 2020-07-14T19:12:53.000Z | 2022-03-02T06:28:17.000Z | """
Given a m * n matrix grid which is sorted in non-increasing order both
row-wise and column-wise.
Return the number of negative numbers in grid.
Example:
Input: grid = [[4,3,2,-1],[3,2,1,-1],[1,1,-1,-2],[-1,-1,-2,-3]]
Output: 8
Explanation: There are 8 negatives number in the matri... | 31.722222 | 117 | 0.568301 | """
Given a m * n matrix grid which is sorted in non-increasing order both
row-wise and column-wise.
Return the number of negative numbers in grid.
Example:
Input: grid = [[4,3,2,-1],[3,2,1,-1],[1,1,-1,-2],[-1,-1,-2,-3]]
Output: 8
Explanation: There are 8 negatives number in the matri... | 0 | 0 | 0 | 319 | 0 | 0 | 0 | 0 | 27 |
bdcd1d8e762346186023b2e80b7d8c3e9f1b81ab | 19,254 | py | Python | contract_analysis.py | jasonrubenstein18/MLB_FA | 2221124f67ee52989ee23afea09bd03a5d741bfa | [
"MIT"
] | null | null | null | contract_analysis.py | jasonrubenstein18/MLB_FA | 2221124f67ee52989ee23afea09bd03a5d741bfa | [
"MIT"
] | null | null | null | contract_analysis.py | jasonrubenstein18/MLB_FA | 2221124f67ee52989ee23afea09bd03a5d741bfa | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
from statsmodels.formula.api import ols
import plotly_express
import plotly.graph_objs as go
from plotly.subplots import make_subplots
# Read in data
batter_data = pd.read_csv("~/Desktop/MLB_FA/Data/fg_bat_data.csv")
del batter_data['Age']
print(len(batter_data))
print(batter_dat... | 42.786667 | 120 | 0.617067 | import pandas as pd
import numpy as np
from statsmodels.formula.api import ols
import plotly_express
import plotly.graph_objs as go
from plotly.subplots import make_subplots
# Read in data
batter_data = pd.read_csv("~/Desktop/MLB_FA/Data/fg_bat_data.csv")
del batter_data['Age']
print(len(batter_data))
print(batter_dat... | 0 | 0 | 0 | 8,894 | 0 | 405 | 0 | 0 | 89 |
d954f7b42ca358b7dbc659d537a00af570ba25d9 | 5,010 | py | Python | make_smaller_labse.py | jeongukjae/smaller-laBSE | 104e4ff7f49a6c8490b3d55a4d32584fe356dcfb | [
"Apache-2.0"
] | 8 | 2021-09-16T05:20:25.000Z | 2022-01-27T14:31:12.000Z | make_smaller_labse.py | jeongukjae/smaller-laBSE | 104e4ff7f49a6c8490b3d55a4d32584fe356dcfb | [
"Apache-2.0"
] | 2 | 2021-11-29T03:37:13.000Z | 2022-01-16T02:22:02.000Z | make_smaller_labse.py | jeongukjae/smaller-laBSE | 104e4ff7f49a6c8490b3d55a4d32584fe356dcfb | [
"Apache-2.0"
] | null | null | null | from absl import app, flags
FLAGS = flags.FLAGS
flags.DEFINE_string("langs", "en,fr,es,de,zh,ar,zh_classical,it,ja,ko,nl,pl,pt,th,tr,ru", help='language to use')
flags.DEFINE_integer("seq_len", 128, "default seq len")
if __name__ == '__main__':
app.run(main)
| 45.135135 | 145 | 0.706986 | import json
import re
import tensorflow as tf
import tensorflow_text as text
import tensorflow_hub as hub
from official.nlp.modeling import networks
from official.nlp.tools import export_tfhub_lib
from absl import app, flags
from tqdm import tqdm
from save_as_weight_from_saved_model import create_model
FLAGS = flags.F... | 27 | 0 | 0 | 0 | 0 | 4,436 | 0 | 78 | 221 |
e0b8c946f3ae2399ece9d0b144b42ca4fcc70a79 | 1,418 | py | Python | udiskie/automount.py | LocutusOfBorg/udiskie | 8aa85bb99d44fedc19ec584389072c264877e767 | [
"MIT"
] | null | null | null | udiskie/automount.py | LocutusOfBorg/udiskie | 8aa85bb99d44fedc19ec584389072c264877e767 | [
"MIT"
] | null | null | null | udiskie/automount.py | LocutusOfBorg/udiskie | 8aa85bb99d44fedc19ec584389072c264877e767 | [
"MIT"
] | null | null | null | """
Automount utility.
"""
from __future__ import absolute_import
from __future__ import unicode_literals
__all__ = ['AutoMounter']
| 29.541667 | 78 | 0.67701 | """
Automount utility.
"""
from __future__ import absolute_import
from __future__ import unicode_literals
__all__ = ['AutoMounter']
class AutoMounter(object):
"""
Automount utility.
Being connected to the udiskie daemon, this component automatically
mounts newly discovered external devices. Insta... | 0 | 0 | 0 | 1,259 | 0 | 0 | 0 | 0 | 23 |
336f7119fef3ae8c7d6d862f56e69dfb371aa8cb | 3,529 | py | Python | beacon_api/conf/__init__.py | NBISweden/beacon-python | ba3499e3cedd4e38c105bb984f34d21098fe8a89 | [
"Apache-2.0"
] | null | null | null | beacon_api/conf/__init__.py | NBISweden/beacon-python | ba3499e3cedd4e38c105bb984f34d21098fe8a89 | [
"Apache-2.0"
] | 2 | 2020-03-16T09:15:43.000Z | 2020-03-18T10:19:57.000Z | beacon_api/conf/__init__.py | NBISweden/beacon-python | ba3499e3cedd4e38c105bb984f34d21098fe8a89 | [
"Apache-2.0"
] | null | null | null | """Beacon Python Application Configuration."""
import json
import os
from configparser import ConfigParser
from collections import namedtuple
from distutils.util import strtobool
def parse_drspaths(paths):
"""Parse handover configuration."""
return [p.strip().split(',', 2) for p in paths.split('\n') if p.spl... | 49.013889 | 126 | 0.68178 | """Beacon Python Application Configuration."""
import json
import os
from configparser import ConfigParser
from collections import namedtuple
from distutils.util import strtobool
def parse_drspaths(paths):
"""Parse handover configuration."""
return [p.strip().split(',', 2) for p in paths.split('\n') if p.spl... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a5c41d43da681d116b4f43ec9796fc9ce75927a5 | 1,284 | py | Python | features/eolearn/features/__init__.py | chorng/eo-learn | a1a3c6fa5568d398f5e43f5ad5aecdfeb05e8d3c | [
"MIT"
] | null | null | null | features/eolearn/features/__init__.py | chorng/eo-learn | a1a3c6fa5568d398f5e43f5ad5aecdfeb05e8d3c | [
"MIT"
] | null | null | null | features/eolearn/features/__init__.py | chorng/eo-learn | a1a3c6fa5568d398f5e43f5ad5aecdfeb05e8d3c | [
"MIT"
] | null | null | null | """
A collection of EOTasks for feature manipulation
"""
__version__ = "1.0.0"
| 26.75 | 78 | 0.804517 | """
A collection of EOTasks for feature manipulation
"""
from .temporal_features import (
AddSpatioTemporalFeaturesTask,
AddMaxMinTemporalIndicesTask,
AddMaxMinNDVISlopeIndicesTask,
)
from .interpolation import (
InterpolationTask,
ResamplingTask,
LinearInterpolationTask,
CubicInterpolation... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 960 | 243 |
5001577af8dc35e032efee53a918fe544b7fae4f | 1,213 | py | Python | tests/unit/test_app.py | openpermissions/identity-srv | 97696413accfea052f4037a4291d8d4eed560cfb | [
"Apache-2.0"
] | 2 | 2016-05-03T20:10:04.000Z | 2019-05-20T01:41:33.000Z | tests/unit/test_app.py | openpermissions/identity-srv | 97696413accfea052f4037a4291d8d4eed560cfb | [
"Apache-2.0"
] | 1 | 2016-05-05T11:04:39.000Z | 2016-05-05T11:04:39.000Z | tests/unit/test_app.py | openpermissions/identity-srv | 97696413accfea052f4037a4291d8d4eed560cfb | [
"Apache-2.0"
] | 1 | 2019-05-20T01:41:23.000Z | 2019-05-20T01:41:23.000Z | # -*- coding: utf-8 -*-
# Copyright 2016 Open Permissions Platform Coalition
# 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 appl... | 39.129032 | 107 | 0.736191 | # -*- coding: utf-8 -*-
# Copyright 2016 Open Permissions Platform Coalition
# 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 appl... | 0 | 490 | 0 | 0 | 0 | 0 | 0 | -1 | 68 |
0eae852bd2a693337e10c55e1d21fa970a3ffc88 | 1,441 | py | Python | code/ner/search_hyperparams.py | miquelcanalesteve/mtextos2122 | e400090575b9f23469cf5a071523b8dafec1c0cf | [
"CC-BY-4.0"
] | 2 | 2022-03-07T13:47:36.000Z | 2022-03-07T16:10:34.000Z | code/ner/search_hyperparams.py | gilbert98xD/mtextos2122 | 4811575134344c0bf255fa592c3b82efdb59d867 | [
"CC-BY-4.0"
] | null | null | null | code/ner/search_hyperparams.py | gilbert98xD/mtextos2122 | 4811575134344c0bf255fa592c3b82efdb59d867 | [
"CC-BY-4.0"
] | 5 | 2022-02-09T15:13:31.000Z | 2022-03-07T20:07:24.000Z |
import argparse
import os
import sys
import utils
PYTHON = sys.executable
parser = argparse.ArgumentParser()
parser.add_argument('--parent_dir', default='experiments/learning_rate',
help='Directory containing params.json')
parser.add_argument('--data_dir', default='data/small', help="Directory c... | 31.326087 | 118 | 0.678001 |
import argparse
import os
from subprocess import check_call
import sys
import utils
PYTHON = sys.executable
parser = argparse.ArgumentParser()
parser.add_argument('--parent_dir', default='experiments/learning_rate',
help='Directory containing params.json')
parser.add_argument('--data_dir', defau... | 0 | 0 | 0 | 0 | 0 | 516 | 0 | 12 | 45 |
d6fddf2db0bee3c289868a82ca8d61a986ba48f7 | 1,595 | py | Python | StarcorpServer/starcorp/data/enums.py | Jordan-Cottle/Game-Design-Capstone | 89d23148e31400ecdf445a52ec1ad361b55c8dfb | [
"MIT"
] | 1 | 2021-04-25T22:24:56.000Z | 2021-04-25T22:24:56.000Z | StarcorpServer/starcorp/data/enums.py | Jordan-Cottle/Game-Design-Capstone | 89d23148e31400ecdf445a52ec1ad361b55c8dfb | [
"MIT"
] | 29 | 2020-10-17T23:20:08.000Z | 2021-04-27T17:29:42.000Z | StarcorpServer/starcorp/data/enums.py | Jordan-Cottle/Game-Design-Capstone | 89d23148e31400ecdf445a52ec1ad361b55c8dfb | [
"MIT"
] | 1 | 2020-12-16T02:02:25.000Z | 2020-12-16T02:02:25.000Z | """ Module for enums and constants. """
| 21.554054 | 88 | 0.636991 | """ Module for enums and constants. """
from enum import Enum
class TileType(str, Enum):
"""Enum for types of tiles in the world.
These types represent types of planetary surfaces.
"""
SPACE = " "
LUSH = "L"
ARID = "D"
AQUATIC = "W"
SOLAR = "*"
def __str__(self) -> str:
... | 0 | 0 | 0 | 1,388 | 0 | 0 | 0 | 0 | 161 |
f5f9825d02f03902cb1bb9ded49a61a7434a47a1 | 4,451 | py | Python | scripts/typing-summary.py | AlexWaygood/typing | 4bdf0db49dda83a00dfb5f7e45c96e89bc0e0c8a | [
"PSF-2.0"
] | 1,145 | 2016-01-23T00:30:39.000Z | 2022-03-31T23:56:30.000Z | scripts/typing-summary.py | ConnectionMaster/typing | eeb29ad833f992ea9f2f29b32723c05586cd0aec | [
"PSF-2.0"
] | 753 | 2016-01-23T05:04:33.000Z | 2022-03-26T16:12:23.000Z | scripts/typing-summary.py | ConnectionMaster/typing | eeb29ad833f992ea9f2f29b32723c05586cd0aec | [
"PSF-2.0"
] | 212 | 2016-01-23T00:22:21.000Z | 2022-03-28T07:28:56.000Z | #!/usr/bin/env python3
"""
Generate a summary of last week's issues tagged with "topic: feature".
The summary will include a list of new and changed issues and is sent each
Monday at 0200 CE(S)T to the typing-sig mailing list. Due to limitation
with GitHub Actions, the mail is sent from a private server, currently
ma... | 30.696552 | 87 | 0.609077 | #!/usr/bin/env python3
"""
Generate a summary of last week's issues tagged with "topic: feature".
The summary will include a list of new and changed issues and is sent each
Monday at 0200 CE(S)T to the typing-sig mailing list. Due to limitation
with GitHub Actions, the mail is sent from a private server, currently
ma... | 0 | 122 | 0 | 0 | 0 | 2,856 | 0 | 33 | 228 |
e48bf20cf883731702d751263a82fffcb2392a41 | 360 | py | Python | ExamenDeFundamentosDeP/Examen3.py | Sharnol-Tec/Examen | fc859c5a56cf9e550e903296eecdb53b42ec9b2f | [
"Apache-2.0"
] | null | null | null | ExamenDeFundamentosDeP/Examen3.py | Sharnol-Tec/Examen | fc859c5a56cf9e550e903296eecdb53b42ec9b2f | [
"Apache-2.0"
] | null | null | null | ExamenDeFundamentosDeP/Examen3.py | Sharnol-Tec/Examen | fc859c5a56cf9e550e903296eecdb53b42ec9b2f | [
"Apache-2.0"
] | null | null | null | #Datosdeentrada
print("Ingrese el Sexo (H/M):")
sexo = input()
print("Ingrese la EdadSLLB:")
#proceso
edad = int(input())
if edad>=70:
print("la vacuna es de tipo C")
if sexo=="H":
edad>=16 and edad<=69
print("la vacuna es de tipo A")
if sexo=="M":
edad>=16 and edad<=69
print("la vacuna es de tipo B")
if edad... | 21.176471 | 33 | 0.644444 | #Datosdeentrada
print("Ingrese el Sexo (H/M):")
sexo = input()
print("Ingrese la EdadSLLB:")
#proceso
edad = int(input())
if edad>=70:
print("la vacuna es de tipo C")
if sexo=="H":
edad>=16 and edad<=69
print("la vacuna es de tipo A")
if sexo=="M":
edad>=16 and edad<=69
print("la vacuna es de tipo B")
if edad... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d9c93d9c834c1e96c514e0911c1435237b1ee758 | 210 | py | Python | records/12-24/asda2.py | AaronYang2333/CSCI_570 | 03e34ce5ff192fc94612bc3afb51dcab3e854462 | [
"Apache-2.0"
] | 36 | 2020-07-25T00:13:25.000Z | 2022-02-28T17:48:15.000Z | records/12-24/asda2.py | AaronYang2333/LeetCode | 03e34ce5ff192fc94612bc3afb51dcab3e854462 | [
"Apache-2.0"
] | 6 | 2020-06-06T04:39:37.000Z | 2021-04-03T01:45:39.000Z | records/12-24/asda2.py | AaronYang2333/LeetCode | 03e34ce5ff192fc94612bc3afb51dcab3e854462 | [
"Apache-2.0"
] | 16 | 2020-12-16T02:38:16.000Z | 2022-02-28T17:48:16.000Z | __author__ = 'Aaron Yang'
__email__ = 'byang971@usc.edu'
__date__ = '12/24/2020 10:01 PM'
func1() | 13.125 | 32 | 0.595238 | __author__ = 'Aaron Yang'
__email__ = 'byang971@usc.edu'
__date__ = '12/24/2020 10:01 PM'
def func1():
res = 0
def inner_func(num):
res = num * num
inner_func(2)
print(res)
func1() | 0 | 0 | 0 | 0 | 0 | 87 | 0 | 0 | 23 |
a602c1f9b589b4c4a1cf2da7812b6dcafe30b9a7 | 8,693 | py | Python | src/AST_CIL.py | ezielramos/cool-compiler-2021 | e5b2aa51e47296b21f8b1ea14d73b1c7e7ef0785 | [
"MIT"
] | null | null | null | src/AST_CIL.py | ezielramos/cool-compiler-2021 | e5b2aa51e47296b21f8b1ea14d73b1c7e7ef0785 | [
"MIT"
] | null | null | null | src/AST_CIL.py | ezielramos/cool-compiler-2021 | e5b2aa51e47296b21f8b1ea14d73b1c7e7ef0785 | [
"MIT"
] | null | null | null |
# class Array(Instruction):
# def __init__(self, dest, src):
# self.dest = dest
# self.src = src
| 28.132686 | 105 | 0.608075 | class Node:
pass
class Program(Node):
def __init__(self):
self.type_section = []
self.data_section = {} #data[string] = tag
self.code_section = []
class Type(Node):
def __init__(self, name):
self.name = name
self.attributes = []
self.methods = {}
def to_... | 0 | 0 | 0 | 7,572 | 0 | 0 | 0 | 0 | 996 |
7ff47fcb388c190dbb61a358ededdbdb2e74bd85 | 2,342 | py | Python | oscar/apps/analytics/reports.py | owad/django-oscar | cfa69e37dc9abc97a7aff5c8616da319e1771008 | [
"BSD-3-Clause"
] | 1 | 2022-03-17T19:26:13.000Z | 2022-03-17T19:26:13.000Z | oscar/apps/analytics/reports.py | aykut/django-oscar | ca3629e74ea1e0affc55d3de4e97f523e352d267 | [
"BSD-3-Clause"
] | null | null | null | oscar/apps/analytics/reports.py | aykut/django-oscar | ca3629e74ea1e0affc55d3de4e97f523e352d267 | [
"BSD-3-Clause"
] | 1 | 2019-03-23T10:26:02.000Z | 2019-03-23T10:26:02.000Z |
from oscar.core.loading import import_module
report_classes = import_module('reports.reports', ['ReportGenerator'])
analytics_models = import_module('analytics.models', ['ProductRecord', 'UserRecord'])
| 35.484848 | 110 | 0.592656 | import csv
from oscar.core.loading import import_module
report_classes = import_module('reports.reports', ['ReportGenerator'])
analytics_models = import_module('analytics.models', ['ProductRecord', 'UserRecord'])
class ProductReportGenerator(report_classes.ReportGenerator):
filename_template = 'product-anal... | 0 | 0 | 0 | 2,077 | 0 | 0 | 0 | -11 | 68 |
b232195f232cbfca4bc3c83f43eb190a4d6c0531 | 31 | py | Python | SeleniumPythonFramework/selenium_framework/page_objects/generic_helpers/error_strings.py | darrenudaiyan/SeleniumPythonFramework | e22b0ad17196e337018c397750035154c6404957 | [
"MIT"
] | null | null | null | SeleniumPythonFramework/selenium_framework/page_objects/generic_helpers/error_strings.py | darrenudaiyan/SeleniumPythonFramework | e22b0ad17196e337018c397750035154c6404957 | [
"MIT"
] | null | null | null | SeleniumPythonFramework/selenium_framework/page_objects/generic_helpers/error_strings.py | darrenudaiyan/SeleniumPythonFramework | e22b0ad17196e337018c397750035154c6404957 | [
"MIT"
] | null | null | null | URL_is_Null = "The URL is null" | 31 | 31 | 0.741935 | URL_is_Null = "The URL is null" | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0087d396d5fe0e8ad5d5787b6e02942ba873900f | 1,523 | py | Python | scripts/Pre_processing.py | Vancouver-Datajam/automated-fitness-tracker | 888444f39507f980b37a878519671e5e5c3598d1 | [
"MIT"
] | null | null | null | scripts/Pre_processing.py | Vancouver-Datajam/automated-fitness-tracker | 888444f39507f980b37a878519671e5e5c3598d1 | [
"MIT"
] | 1 | 2021-09-26T00:46:14.000Z | 2021-09-26T00:46:14.000Z | scripts/Pre_processing.py | Vancouver-Datajam/python-computer-vision | 888444f39507f980b37a878519671e5e5c3598d1 | [
"MIT"
] | 1 | 2021-09-29T20:37:14.000Z | 2021-09-29T20:37:14.000Z | import pandas as pd
# check and return missing values in each features in the dataframe
def missing_statistics(df):
"""
This function check and return missing values in each features for a dataframe
Parameters
----------
df: dataframe
Returns
-------
statitics (dataframe) con... | 28.735849 | 100 | 0.601445 | import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
def Pre_process(df):
df_c = df.copy()
df_c['y23_const'] = df_c['y23']
df_c['z23_const'] = df_c['z23']
df_c['y24_const'] = df_c['y24']
df_c['z24_const'] = df_c['z24']
#normalize the y and... | 0 | 0 | 0 | 0 | 0 | 771 | 0 | 7 | 89 |
c42aa82da114142a8ecb4d7031c1dab90cea485c | 1,719 | py | Python | yolo_v3/yolo-test.py | akshath/image_classification_kit_keras | c6c593d582e39c2c110326e4955e6c751be075a5 | [
"Apache-2.0"
] | null | null | null | yolo_v3/yolo-test.py | akshath/image_classification_kit_keras | c6c593d582e39c2c110326e4955e6c751be075a5 | [
"Apache-2.0"
] | null | null | null | yolo_v3/yolo-test.py | akshath/image_classification_kit_keras | c6c593d582e39c2c110326e4955e6c751be075a5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import cv2
import matplotlib.pyplot as plt
import YoloHelper
# In[2]:
yolo_net, yolo_output_layers, yolo_classes = YoloHelper.load_yolo('yolov3.weights','yolov3.cfg', 'coco.names')
# In[3]:
img = cv2.imread('test-image.jpg')
# In[4]:
img_rgb = cv2.cvtColor(... | 12.828358 | 110 | 0.70797 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import cv2
import numpy as np
from PIL import Image
import matplotlib.pyplot as plt
import YoloHelper
# In[2]:
yolo_net, yolo_output_layers, yolo_classes = YoloHelper.load_yolo('yolov3.weights','yolov3.cfg', 'coco.names')
# In[3]:
img = cv2.imread('test-image.... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -3 | 45 |
b51b76291e48833ac2802d1fe5e96e9e5ba66f50 | 1,190 | py | Python | fit-calculator/fitness.py | SilvaMatteus/IAsperathos-plugin | f295678044e0e67c932acf4596243a05f2cd48fe | [
"MIT"
] | null | null | null | fit-calculator/fitness.py | SilvaMatteus/IAsperathos-plugin | f295678044e0e67c932acf4596243a05f2cd48fe | [
"MIT"
] | 5 | 2018-08-02T22:13:45.000Z | 2018-08-03T20:11:56.000Z | fit-calculator/fitness.py | SilvaMatteus/IAsperathos-plugin | f295678044e0e67c932acf4596243a05f2cd48fe | [
"MIT"
] | null | null | null | from flask import Flask
image_path = '/home/ubuntu/image.jpg'
individual_path = '/home/ubuntu/individual'
app = Flask(__name__)
if __name__ == '__main__':
import sys
app.run(host='0.0.0.0', port=sys.argv[1], debug=True)
| 25.319149 | 70 | 0.706723 | from PIL import Image, ImageDraw
from skimage.measure import compare_ssim as ssim
from numpy import array
from pickle import loads
from flask import Flask, request
from os import path
import genetic.individual
import json
from base64 import b64decode
image_path = '/home/ubuntu/image.jpg'
individual_path = '/home/ubunt... | 0 | 140 | 0 | 0 | 0 | 527 | 0 | 51 | 245 |
460a0c9c97d29ab82d0d586bf68009e53a143e4f | 1,436 | py | Python | 12-managing-access/solution/my-site/my_site/deposit/views.py | mvidalgarcia/training | 56c7d62d0b66538d4bfb104eb651222d099436d5 | [
"MIT"
] | 34 | 2019-03-16T18:54:53.000Z | 2022-03-17T08:05:17.000Z | 12-managing-access/solution/my-site/my_site/deposit/views.py | mvidalgarcia/training | 56c7d62d0b66538d4bfb104eb651222d099436d5 | [
"MIT"
] | 59 | 2019-03-18T11:46:57.000Z | 2022-03-04T15:01:08.000Z | 12-managing-access/solution/my-site/my_site/deposit/views.py | mvidalgarcia/training | 56c7d62d0b66538d4bfb104eb651222d099436d5 | [
"MIT"
] | 42 | 2019-03-12T08:33:56.000Z | 2022-03-17T08:05:21.000Z | """Views for deposit of records."""
from __future__ import absolute_import, print_function
from flask import Blueprint
# define a new Flask Blueprint that is register under the url path /deposit
blueprint = Blueprint(
'deposit',
__name__,
url_prefix='/deposit',
template_folder='templates',
stati... | 28.156863 | 75 | 0.681058 | """Views for deposit of records."""
from __future__ import absolute_import, print_function
from flask import Blueprint, redirect, render_template, url_for
from flask_login import login_required
from flask_security import current_user
from .forms import RecordForm
from .api import create_record
# define a new Flask... | 0 | 871 | 0 | 0 | 0 | 0 | 0 | 88 | 135 |
a235ef57e8c2fabbd3cffd97687b74c965ffa5c3 | 2,036 | py | Python | skills_taxonomy/pipeline/name_clusters.py | Jack-0-0/skills_taxonomy | 067c5e9c94482fe6864809b5b653be76ce09c98b | [
"MIT"
] | null | null | null | skills_taxonomy/pipeline/name_clusters.py | Jack-0-0/skills_taxonomy | 067c5e9c94482fe6864809b5b653be76ce09c98b | [
"MIT"
] | 19 | 2021-05-11T09:22:32.000Z | 2021-07-08T13:40:23.000Z | skills_taxonomy/pipeline/name_clusters.py | Jack-0-0/skills_taxonomy | 067c5e9c94482fe6864809b5b653be76ce09c98b | [
"MIT"
] | null | null | null | from skills_taxonomy import PROJECT_DIR
from pprint import pprint
from skills_taxonomy.utils.json_management import load_json, save_json
def input_name(class_id, informative_words):
"""Print most informative words, and then ask for
user input to assign a suitable name.
Args:
class_id(str): id for... | 32.31746 | 91 | 0.684676 | from skills_taxonomy import PROJECT_DIR
from pprint import pprint
from skills_taxonomy.utils.json_management import load_json, save_json
def input_name(class_id, informative_words):
"""Print most informative words, and then ask for
user input to assign a suitable name.
Args:
class_id(str): id for... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1b706385f591e44f2d22dab5151c26b066ea0f56 | 2,090 | py | Python | madoka/dataflow/empty.py | korepwx/madoka | 56675bd8220935c6a9c1571a886a84bed235fd3b | [
"MIT"
] | null | null | null | madoka/dataflow/empty.py | korepwx/madoka | 56675bd8220935c6a9c1571a886a84bed235fd3b | [
"MIT"
] | null | null | null | madoka/dataflow/empty.py | korepwx/madoka | 56675bd8220935c6a9c1571a886a84bed235fd3b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
__all__ = []
# use a global shared empty data flow.
empty_flow = _EmptyDataFlow()
| 23.222222 | 76 | 0.635407 | # -*- coding: utf-8 -*-
import numpy as np
from .base import DataFlow
__all__ = []
class _EmptyDataFlow(DataFlow):
"""Empty data flow.
This class is useful when constructing a data flow by merging
sources from other data flows.
"""
@property
def input_flows(self):
return ()
@p... | 0 | 196 | 0 | 1,715 | 0 | 0 | 0 | 2 | 68 |
cc2c06a53250e13adccd181f1d76724efbe953aa | 3,231 | py | Python | eval_lfw.py | smarsu/mtcnn | 98c3839e250b18c310efa920bc6289a70379f07d | [
"MIT"
] | null | null | null | eval_lfw.py | smarsu/mtcnn | 98c3839e250b18c310efa920bc6289a70379f07d | [
"MIT"
] | null | null | null | eval_lfw.py | smarsu/mtcnn | 98c3839e250b18c310efa920bc6289a70379f07d | [
"MIT"
] | null | null | null | # --------------------------------------------------------
# MTCNN
# Licensed under The MIT License [see LICENSE for details]
# Copyright 2019 smarsu. All Rights Reserved.
# --------------------------------------------------------
import os.path as osp
import numpy as np
from mtcnn import PNet, RNet, ONet
from square... | 31.067308 | 85 | 0.614051 | # --------------------------------------------------------
# MTCNN
# Licensed under The MIT License [see LICENSE for details]
# Copyright 2019 smarsu. All Rights Reserved.
# --------------------------------------------------------
import os.path as osp
import cv2
import numpy as np
from mtcnn import PNet, RNet, ONet... | 0 | 0 | 0 | 0 | 0 | 733 | 0 | -11 | 46 |
7683f73bdce9ad4b92a4f2bedeacc9e5903b06ea | 10,290 | py | Python | prepare_phosphomatics_ct.py | mgleeming/phosphomatics_PD_node | c64dee62aea3d6c5f768f7590c3dd958a156fd62 | [
"BSD-3-Clause"
] | null | null | null | prepare_phosphomatics_ct.py | mgleeming/phosphomatics_PD_node | c64dee62aea3d6c5f768f7590c3dd958a156fd62 | [
"BSD-3-Clause"
] | null | null | null | prepare_phosphomatics_ct.py | mgleeming/phosphomatics_PD_node | c64dee62aea3d6c5f768f7590c3dd958a156fd62 | [
"BSD-3-Clause"
] | null | null | null | # -----------------------------------------------------------------------
# Use Case 2
# -----------------------------------------------------------------------
import sys
import traceback
if __name__ == "__main__":
try:
assert (len(sys.argv) == 2), \
"Script requires one and only one paramete... | 37.418182 | 137 | 0.570068 | # -----------------------------------------------------------------------
# Use Case 2
# -----------------------------------------------------------------------
import sys
import csv
import scriptutils
import traceback
class UC2(object):
# node_response.json template
nodeResponseTemplate = '''
{
... | 0 | 7,597 | 0 | 1,920 | 0 | 0 | 0 | -14 | 67 |
8a799bcc56743ba6d80209189e374812f55ff15b | 15,235 | py | Python | Lib/ssl.py | certik/python2.6 | 3b8ab0cdb83bea160b2c5e11c620ffd1bdf04a59 | [
"PSF-2.0"
] | 4 | 2015-12-07T13:37:48.000Z | 2021-03-24T16:27:52.000Z | Lib/ssl.py | certik/python2.6 | 3b8ab0cdb83bea160b2c5e11c620ffd1bdf04a59 | [
"PSF-2.0"
] | null | null | null | Lib/ssl.py | certik/python2.6 | 3b8ab0cdb83bea160b2c5e11c620ffd1bdf04a59 | [
"PSF-2.0"
] | null | null | null | # Wrapper module for _ssl, providing some additional facilities
# implemented in Python. Written by Bill Janssen.
"""\
This module provides some more Pythonic support for SSL.
Object types:
SSLSocket -- subtype of socket.socket which does SSL over the socket
Exceptions:
SSLError -- exception raised for I/O er... | 34.546485 | 118 | 0.594815 | # Wrapper module for _ssl, providing some additional facilities
# implemented in Python. Written by Bill Janssen.
"""\
This module provides some more Pythonic support for SSL.
Object types:
SSLSocket -- subtype of socket.socket which does SSL over the socket
Exceptions:
SSLError -- exception raised for I/O er... | 0 | 0 | 0 | 9,217 | 0 | 879 | 0 | 370 | 158 |
ac84e461846fdbe9e15ffb8a33ac7872b8a358f6 | 3,089 | py | Python | tfsnippet/preprocessing/samplers.py | 897615138/tfsnippet-jill | 2fc898a4def866c8d3c685168df1fa22083bb143 | [
"MIT"
] | null | null | null | tfsnippet/preprocessing/samplers.py | 897615138/tfsnippet-jill | 2fc898a4def866c8d3c685168df1fa22083bb143 | [
"MIT"
] | null | null | null | tfsnippet/preprocessing/samplers.py | 897615138/tfsnippet-jill | 2fc898a4def866c8d3c685168df1fa22083bb143 | [
"MIT"
] | null | null | null |
__all__ = ['BaseSampler', 'BernoulliSampler', 'UniformNoiseSampler']
| 30.584158 | 80 | 0.61541 | import numpy as np
from tfsnippet.dataflow import DataMapper
__all__ = ['BaseSampler', 'BernoulliSampler', 'UniformNoiseSampler']
class BaseSampler(DataMapper):
"""Base class for samplers."""
def sample(self, x):
"""
Sample array according to `x`.
Args:
x (np.ndarray): ... | 0 | 390 | 0 | 2,495 | 0 | 0 | 0 | 17 | 114 |
d9d78c44153758f05c078ed00a29da25c6100d10 | 1,592 | py | Python | checkov/terraform/checks/resource/gcp/GKENetworkPolicyEnabled.py | vangundy-jason-pfg/checkov | 2fb50908f62390c98dda665f1fa94fe24806b654 | [
"Apache-2.0"
] | 1 | 2021-02-13T15:24:42.000Z | 2021-02-13T15:24:42.000Z | checkov/terraform/checks/resource/gcp/GKENetworkPolicyEnabled.py | vangundy-jason-pfg/checkov | 2fb50908f62390c98dda665f1fa94fe24806b654 | [
"Apache-2.0"
] | 7 | 2021-04-12T06:54:07.000Z | 2022-03-21T14:04:14.000Z | checkov/terraform/checks/resource/gcp/GKENetworkPolicyEnabled.py | vangundy-jason-pfg/checkov | 2fb50908f62390c98dda665f1fa94fe24806b654 | [
"Apache-2.0"
] | 1 | 2021-12-16T03:09:55.000Z | 2021-12-16T03:09:55.000Z |
check = GKENetworkPolicyEnabled()
| 40.820513 | 106 | 0.686558 | from checkov.terraform.checks.resource.base_resource_value_check import BaseResourceValueCheck
from checkov.common.models.enums import CheckResult, CheckCategories
class GKENetworkPolicyEnabled(BaseResourceValueCheck):
def __init__(self):
name = "Ensure Network Policy is enabled on Kubernetes Engine Clust... | 0 | 0 | 0 | 1,368 | 0 | 0 | 0 | 120 | 67 |
cb52447aea68112909b65e9aeb941d96041e4d18 | 575 | py | Python | pastebin/users/viewsets.py | amirasaad/pastebin | dba0617337a61646cba3bed7f35f4afa1618a49e | [
"MIT"
] | null | null | null | pastebin/users/viewsets.py | amirasaad/pastebin | dba0617337a61646cba3bed7f35f4afa1618a49e | [
"MIT"
] | 192 | 2020-01-07T12:10:04.000Z | 2022-03-27T17:32:32.000Z | pastebin/users/viewsets.py | amirasaad/pastebin | dba0617337a61646cba3bed7f35f4afa1618a49e | [
"MIT"
] | null | null | null | from django.contrib.auth import get_user_model
User = get_user_model()
| 31.944444 | 62 | 0.786087 | from django.contrib.auth import get_user_model
from rest_framework import filters
from rest_framework.viewsets import ModelViewSet
from pastebin.users.permissions import IsAuthenticatedOrCreate
from pastebin.users.serializers import UserSerializer
User = get_user_model()
class UsersViewSet(ModelViewSet):
querys... | 0 | 0 | 0 | 277 | 0 | 0 | 0 | 113 | 112 |
dc49accfe2c0c6b668d4115b95e1fafba7659ad4 | 645 | py | Python | migrations/versions/fbfec56d097e_.py | VikTymZ/pegelinux | bd274aebf8606da5217e0ee7653cf0dd8db4c10a | [
"MIT"
] | 11 | 2018-06-29T01:48:05.000Z | 2021-01-13T19:56:02.000Z | migrations/versions/fbfec56d097e_.py | VikTymZ/pegelinux | bd274aebf8606da5217e0ee7653cf0dd8db4c10a | [
"MIT"
] | 237 | 2018-07-01T05:18:03.000Z | 2022-02-12T10:32:50.000Z | migrations/versions/fbfec56d097e_.py | VikTymZ/pegelinux | bd274aebf8606da5217e0ee7653cf0dd8db4c10a | [
"MIT"
] | 9 | 2018-06-30T12:10:28.000Z | 2019-10-22T10:42:43.000Z | """empty message
Revision ID: fbfec56d097e
Revises: 3b1f45ed96c7
Create Date: 2018-06-27 10:04:50.000959
"""
# revision identifiers, used by Alembic.
revision = "fbfec56d097e"
down_revision = "3b1f45ed96c7"
branch_labels = None
depends_on = None
| 22.241379 | 74 | 0.686822 | """empty message
Revision ID: fbfec56d097e
Revises: 3b1f45ed96c7
Create Date: 2018-06-27 10:04:50.000959
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = "fbfec56d097e"
down_revision = "3b1f45ed96c7"
branch_labels = None
depends_on = None
def upgrade():
# ... | 0 | 0 | 0 | 0 | 0 | 300 | 0 | 3 | 90 |
7efbf8047ae9e8b3f47852ce76fc2f1a09ab542c | 1,959 | py | Python | CIM16/CDPSM/Balanced/IEC61970/Wires/PhaseTapChangerSymetrical.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | null | null | null | CIM16/CDPSM/Balanced/IEC61970/Wires/PhaseTapChangerSymetrical.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | null | null | null | CIM16/CDPSM/Balanced/IEC61970/Wires/PhaseTapChangerSymetrical.py | MaximeBaudette/PyCIM | d68ee5ccfc1d32d44c5cd09fb173142fb5ff4f14 | [
"MIT"
] | 1 | 2021-04-02T18:04:49.000Z | 2021-04-02T18:04:49.000Z | # Copyright (C) 2010-2011 Richard Lincoln
#
# 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, copy, modify, merge, publish... | 48.975 | 386 | 0.757529 | # Copyright (C) 2010-2011 Richard Lincoln
#
# 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, copy, modify, merge, publish... | 0 | 0 | 0 | 737 | 0 | 0 | 0 | 76 | 46 |
4e1280a6687983484caf83bbb0ed9ee34b09a2e1 | 3,121 | py | Python | echem_FCVSsurfacearea.py | johnmgregoire/JCAPdatavis | 6d77a510e00acf31de9665828d27ea33aba6ab78 | [
"BSD-3-Clause"
] | null | null | null | echem_FCVSsurfacearea.py | johnmgregoire/JCAPdatavis | 6d77a510e00acf31de9665828d27ea33aba6ab78 | [
"BSD-3-Clause"
] | null | null | null | echem_FCVSsurfacearea.py | johnmgregoire/JCAPdatavis | 6d77a510e00acf31de9665828d27ea33aba6ab78 | [
"BSD-3-Clause"
] | null | null | null | import numpy, scipy
from matplotlib.ticker import FuncFormatter
import matplotlib.colors as colors
import time, pickle
p='C:/Users/Public/Documents/EchemDropAnalyzedData/FCVdata/20130523 NiFeCoCe_3V_FCV_4835/Sample4825_x60_y65_A33B23C3D40_FCVS7.txt'
p2='C:/Users/Public/Documents/EchemDropAnalyzedData/FCVdata/20130523... | 30.009615 | 131 | 0.687921 | import numpy, scipy
from matplotlib.ticker import FuncFormatter
import matplotlib.colors as colors
from echem_plate_math import *
import time, pickle
from echem_plate_fcns import *
p='C:/Users/Public/Documents/EchemDropAnalyzedData/FCVdata/20130523 NiFeCoCe_3V_FCV_4835/Sample4825_x60_y65_A33B23C3D40_FCVS7.txt'
p2='C:... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 18 | 44 |
25daaad0b9b9e4b4d6a8dcf63ee7b341525484e9 | 46 | py | Python | tests/basic/lambda2.py | Fryguy/py2rb | 0d2fbc5a86b82707a1d83241a21af6b2cc22c0b8 | [
"MIT"
] | 124 | 2017-08-19T05:37:16.000Z | 2022-03-08T18:24:18.000Z | tests/basic/lambda2.py | JeMaMokuma/py2rb | 0d2fbc5a86b82707a1d83241a21af6b2cc22c0b8 | [
"MIT"
] | 15 | 2017-12-16T05:59:31.000Z | 2022-02-08T02:51:17.000Z | tests/basic/lambda2.py | JeMaMokuma/py2rb | 0d2fbc5a86b82707a1d83241a21af6b2cc22c0b8 | [
"MIT"
] | 18 | 2017-09-25T11:57:04.000Z | 2022-02-19T17:33:48.000Z | l = lambda *x: print("%s %s %s" % x)
l(1,2,3)
| 15.333333 | 36 | 0.456522 | l = lambda *x: print("%s %s %s" % x)
l(1,2,3)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0c99b38a81039e06395d7643a6fcb817fd74313d | 595 | py | Python | products/models.py | BassamMismar/store-django | c614459c38c20d8caebf15fad9e054091c8e88ba | [
"MIT"
] | null | null | null | products/models.py | BassamMismar/store-django | c614459c38c20d8caebf15fad9e054091c8e88ba | [
"MIT"
] | 7 | 2021-03-30T13:50:45.000Z | 2022-01-13T03:04:12.000Z | products/models.py | bassamaljeed/store-django | c614459c38c20d8caebf15fad9e054091c8e88ba | [
"MIT"
] | null | null | null | # Create your models here.
| 29.75 | 63 | 0.719328 | from django.db import models
from django.urls import reverse
# Create your models here.
class Product(models.Model):
brand = models.CharField(max_length=100)
title = models.CharField(max_length=100)
description = models.TextField(max_length=500)
price = models.PositiveIntegerField()
created_at = m... | 0 | 0 | 0 | 483 | 0 | 0 | 0 | 17 | 67 |
33f70917e72e8b385328fb32e7b1257a7d657ba1 | 86,219 | py | Python | nova/api/openstack/wsgi.py | bopopescu/nova-token | ec98f69dea7b3e2b9013b27fd55a2c1a1ac6bfb2 | [
"Apache-2.0"
] | null | null | null | nova/api/openstack/wsgi.py | bopopescu/nova-token | ec98f69dea7b3e2b9013b27fd55a2c1a1ac6bfb2 | [
"Apache-2.0"
] | null | null | null | nova/api/openstack/wsgi.py | bopopescu/nova-token | ec98f69dea7b3e2b9013b27fd55a2c1a1ac6bfb2 | [
"Apache-2.0"
] | 2 | 2017-07-20T17:31:34.000Z | 2020-07-24T02:42:19.000Z | begin_unit
comment|'# Copyright 2013 IBM Corp.'
nl|'\n'
comment|'# Copyright 2011 OpenStack Foundation'
nl|'\n'
comment|'# All Rights Reserved.'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# Licensed under the Apache License, Version 2.0 (the "License"); you may'
nl|'\n'
comment|'# not use this file except in compliance... | 13.931007 | 727 | 0.603765 | begin_unit
comment|'# Copyright 2013 IBM Corp.'
nl|'\n'
comment|'# Copyright 2011 OpenStack Foundation'
nl|'\n'
comment|'# All Rights Reserved.'
nl|'\n'
comment|'#'
nl|'\n'
comment|'# Licensed under the Apache License, Version 2.0 (the "License"); you may'
nl|'\n'
comment|'# not use this file except in compliance... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5aa7fa3e1877693aeecf9e1ceccbfa29eb2b7901 | 3,627 | py | Python | Examples/Qmod_basic_features.py | Mv77/Q_Investment | 5d570940311ef5823f457e31d02122960b573d19 | [
"MIT"
] | 1 | 2019-11-23T21:03:49.000Z | 2019-11-23T21:03:49.000Z | Examples/Qmod_basic_features.py | Mv77/Q_Investment | 5d570940311ef5823f457e31d02122960b573d19 | [
"MIT"
] | 1 | 2019-10-22T17:32:27.000Z | 2019-10-25T13:14:44.000Z | Examples/Qmod_basic_features.py | Mv77/Q_Investment | 5d570940311ef5823f457e31d02122960b573d19 | [
"MIT"
] | 4 | 2020-08-06T00:04:40.000Z | 2020-11-27T20:29:43.000Z | # -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.2'
# jupytext_version: 1.2.3
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# --... | 29.975207 | 283 | 0.687896 | # -*- coding: utf-8 -*-
# ---
# jupyter:
# jupytext:
# formats: ipynb,py:percent
# text_representation:
# extension: .py
# format_name: percent
# format_version: '1.2'
# jupytext_version: 1.2.3
# kernelspec:
# display_name: Python 3
# language: python
# name: python3
# --... | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
edc0caf3e2e518ae87a7db5e31f0cdc915c8e8a0 | 2,514 | py | Python | roles/hello/files/hello_tools.py | alxgrtnstrngl/hellostats | 1a0b4f1659bb10ebf83fff5c3d2e85bf402cc1ad | [
"MIT"
] | null | null | null | roles/hello/files/hello_tools.py | alxgrtnstrngl/hellostats | 1a0b4f1659bb10ebf83fff5c3d2e85bf402cc1ad | [
"MIT"
] | null | null | null | roles/hello/files/hello_tools.py | alxgrtnstrngl/hellostats | 1a0b4f1659bb10ebf83fff5c3d2e85bf402cc1ad | [
"MIT"
] | null | null | null | """
hellostats sample API
author: Alex G.S.
Utils for use by the hello app such as html formatting
getting loadavg of the server and ipaddress
"""
import os, re
import requests
import json
# server tools and stats
def get_ip():
"""get the ip address for the server"""
aws_url="http://169.254.169.254/latest/... | 27.933333 | 94 | 0.581146 | """
hellostats sample API
author: Alex G.S.
Utils for use by the hello app such as html formatting
getting loadavg of the server and ipaddress
"""
import os, socket, re
import requests
import json
# server tools and stats
def get_ip():
"""get the ip address for the server"""
aws_url="http://169.254.169.254... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 0 |
6f074455bf527642751ad1872238a87b008036af | 11,279 | py | Python | mixemt/test/preprocess_test.py | svohr/mixemt | f854cf24d6e2b9486c67bbc5bd48eff4beed0b74 | [
"MIT"
] | 16 | 2017-04-06T03:30:46.000Z | 2022-02-10T00:49:11.000Z | mixemt/test/preprocess_test.py | svohr/mixemt | f854cf24d6e2b9486c67bbc5bd48eff4beed0b74 | [
"MIT"
] | 14 | 2017-01-27T22:34:36.000Z | 2021-02-11T01:17:53.000Z | mixemt/test/preprocess_test.py | svohr/mixemt | f854cf24d6e2b9486c67bbc5bd48eff4beed0b74 | [
"MIT"
] | 7 | 2017-09-29T19:13:50.000Z | 2022-02-15T06:03:16.000Z | """
Unit Tests for preprocess module.
"""
import unittest
# TODO: Stuff to test:
# def process_reads(samfile, var_pos, min_mq, min_bq):
# def build_em_input(samfile, refseq, phylo, args):
if __name__ == '__main__':
unittest.main()
| 37.848993 | 79 | 0.519372 | """
Unit Tests for preprocess module.
"""
import sys
import math
import unittest
import argparse
import numpy
import pysam
from mixemt import phylotree
from mixemt import preprocess
# TODO: Stuff to test:
# def process_reads(samfile, var_pos, min_mq, min_bq):
# def build_em_input(samfile, refseq, phylo, args):
cla... | 0 | 0 | 0 | 10,795 | 0 | 0 | 0 | -30 | 271 |
29eb414346f910ebc7fbbffc73d462e0187173b4 | 1,413 | py | Python | koku/api/common/permissions/test/test_settings_access.py | rubik-ai/koku | 3255d1c217b7b6685cb2e130bf4e025946e76fac | [
"Apache-2.0"
] | 157 | 2018-04-30T16:27:53.000Z | 2022-03-31T08:17:21.000Z | koku/api/common/permissions/test/test_settings_access.py | rubik-ai/koku | 3255d1c217b7b6685cb2e130bf4e025946e76fac | [
"Apache-2.0"
] | 3,250 | 2018-04-26T14:14:25.000Z | 2022-03-31T23:49:15.000Z | koku/api/common/permissions/test/test_settings_access.py | rubik-ai/koku | 3255d1c217b7b6685cb2e130bf4e025946e76fac | [
"Apache-2.0"
] | 65 | 2018-05-10T14:11:50.000Z | 2022-03-18T19:22:58.000Z | #
# Copyright 2021 Red Hat Inc.
# SPDX-License-Identifier: Apache-2.0
#
"""Tests for Settings Access Permissions."""
| 35.325 | 101 | 0.690729 | #
# Copyright 2021 Red Hat Inc.
# SPDX-License-Identifier: Apache-2.0
#
"""Tests for Settings Access Permissions."""
from unittest.mock import Mock
from django.test import TestCase
from api.common.permissions.settings_access import SettingsAccessPermission
from api.iam.models import User
class SettingsAccessPermiss... | 0 | 0 | 0 | 1,098 | 0 | 0 | 0 | 84 | 113 |
430811a35a0129ea51c881b624f64eaf064cdeec | 1,983 | py | Python | hannah/http/session.py | suganthsundar/hannah | e3e841850199f565bf2e19ebc9a0eb3d00a7a968 | [
"MIT"
] | null | null | null | hannah/http/session.py | suganthsundar/hannah | e3e841850199f565bf2e19ebc9a0eb3d00a7a968 | [
"MIT"
] | null | null | null | hannah/http/session.py | suganthsundar/hannah | e3e841850199f565bf2e19ebc9a0eb3d00a7a968 | [
"MIT"
] | null | null | null |
REQUEST_RATE_LIMIT = 50
| 30.984375 | 107 | 0.625819 | import uuid
import asyncio
import httpx
from hannah.http.mappings import HTTPTrafficMapper
REQUEST_RATE_LIMIT = 50
class HTTPSession:
def __init__(self, name: str, base_url: str = None,
auth: tuple = None,
headers: dict = None,
ssl_verify: bool = False,
... | 0 | 0 | 457 | 1,335 | 0 | 0 | 0 | 3 | 159 |
e768c605baf8b447887be28f44764ee00ebacd6e | 903 | py | Python | create_new_sdfield.py | Keeganfn/sdf-generator | 5bc0f306efad144f48780161f3942a7b7c2868c8 | [
"MIT"
] | 1 | 2021-05-24T23:36:19.000Z | 2021-05-24T23:36:19.000Z | create_new_sdfield.py | Keeganfn/sdf-generator | 5bc0f306efad144f48780161f3942a7b7c2868c8 | [
"MIT"
] | null | null | null | create_new_sdfield.py | Keeganfn/sdf-generator | 5bc0f306efad144f48780161f3942a7b7c2868c8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import sdfield_generator
import sys
if __name__ == "__main__":
if(len(sys.argv) == 5):
sdf = sdfield_generator.SDF_Generator(str(sys.argv[1]), resolution = int(sys.argv[2]), padding = float(sys.argv[3]))
distance_array, sdf_origin, sdf_spacing, sdf_resolution = sdf.calcu... | 32.25 | 136 | 0.692137 | #!/usr/bin/env python3
import sdfield_generator
import sys
if __name__ == "__main__":
if(len(sys.argv) == 5):
sdf = sdfield_generator.SDF_Generator(str(sys.argv[1]), resolution = int(sys.argv[2]), padding = float(sys.argv[3]))
distance_array, sdf_origin, sdf_spacing, sdf_resolution = sdf.calcu... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fbd646dfdc924969cdc957431c73ca82c465fa6b | 850 | py | Python | FusionIIIT/applications/academic_information/migrations/0002_auto_20191113_0231.py | sabhishekpratap5/sonarcubeTest2 | 9bd8105e457f6feb8c38fa94b335e54783fca99e | [
"bzip2-1.0.6"
] | 2 | 2020-01-24T16:34:54.000Z | 2020-08-01T05:09:24.000Z | FusionIIIT/applications/academic_information/migrations/0002_auto_20191113_0231.py | sabhishekpratap5/sonarcubeTest2 | 9bd8105e457f6feb8c38fa94b335e54783fca99e | [
"bzip2-1.0.6"
] | 19 | 2019-09-08T06:01:14.000Z | 2020-05-21T09:08:20.000Z | FusionIIIT/applications/academic_information/migrations/0002_auto_20191113_0231.py | sabhishekpratap5/sonarcubeTest2 | 9bd8105e457f6feb8c38fa94b335e54783fca99e | [
"bzip2-1.0.6"
] | 14 | 2019-08-31T12:25:42.000Z | 2022-01-12T08:05:33.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.25 on 2019-11-13 02:31
from __future__ import unicode_literals
| 40.47619 | 437 | 0.647059 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.25 on 2019-11-13 02:31
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('academic_information', '0001_initial'),
]
operations = [
migrations.AlterF... | 0 | 0 | 0 | 670 | 0 | 0 | 0 | 19 | 46 |
ce22890ef8550a13f3be158f44c6c59edefccc6a | 12,531 | py | Python | plot_miri_ramp.py | STScI-MIRI/miriramps_karl | 10882bb61bc63c9c2a0b6cfaf3c7c72e0696f6e0 | [
"BSD-3-Clause"
] | null | null | null | plot_miri_ramp.py | STScI-MIRI/miriramps_karl | 10882bb61bc63c9c2a0b6cfaf3c7c72e0696f6e0 | [
"BSD-3-Clause"
] | null | null | null | plot_miri_ramp.py | STScI-MIRI/miriramps_karl | 10882bb61bc63c9c2a0b6cfaf3c7c72e0696f6e0 | [
"BSD-3-Clause"
] | null | null | null | import argparse
import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
from astropy.io import fits
from astropy.modeling.models import Linear1D
from astropy.modeling.fitting import LinearLSQFitter
from miri_ramp_utils import get_ramp, get_good_ramp, fit_diffs, calc_lincor
if __name__ == "__main... | 34.425824 | 90 | 0.579523 | import argparse
import matplotlib.pyplot as plt
import matplotlib as mpl
import numpy as np
from astropy.io import fits
from astropy.modeling.models import Linear1D
from astropy.modeling.fitting import LinearLSQFitter
from miri_ramp_utils import get_ramp, get_good_ramp, fit_diffs, calc_lincor
if __name__ == "__main... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
1354c255a5e3e096c6f238e6d70c432f87dae4bf | 960 | py | Python | DQM/HLXMonitor/python/hlx_dqm_sourceclient_test_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 852 | 2015-01-11T21:03:51.000Z | 2022-03-25T21:14:00.000Z | DQM/HLXMonitor/python/hlx_dqm_sourceclient_test_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 30,371 | 2015-01-02T00:14:40.000Z | 2022-03-31T23:26:05.000Z | DQM/HLXMonitor/python/hlx_dqm_sourceclient_test_cfi.py | ckamtsikis/cmssw | ea19fe642bb7537cbf58451dcf73aa5fd1b66250 | [
"Apache-2.0"
] | 3,240 | 2015-01-02T05:53:18.000Z | 2022-03-31T17:24:21.000Z | import FWCore.ParameterSet.Config as cms
source = cms.Source("EmptySource")
# name of DQM Source program
from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
hlxdqmsource = DQMEDAnalyzer('HLXMonitor',
NBINS = cms.untracked.uint32(335), ## 10 bunch crossings per bin
Style = cms.untracked.string('BX'), ## ... | 32 | 79 | 0.708333 | import FWCore.ParameterSet.Config as cms
source = cms.Source("EmptySource")
# name of DQM Source program
from DQMServices.Core.DQMEDAnalyzer import DQMEDAnalyzer
hlxdqmsource = DQMEDAnalyzer('HLXMonitor',
NBINS = cms.untracked.uint32(335), ## 10 bunch crossings per bin
Style = cms.untracked.string('BX'), ## ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
efe7780f965657432aa35e82c457b9873730465e | 5,202 | py | Python | src/model/reentrancy.py | CVbluecat/TIPS | 823974f418bbd970b1f5be07f6ff5de4653f717e | [
"MIT"
] | null | null | null | src/model/reentrancy.py | CVbluecat/TIPS | 823974f418bbd970b1f5be07f6ff5de4653f717e | [
"MIT"
] | null | null | null | src/model/reentrancy.py | CVbluecat/TIPS | 823974f418bbd970b1f5be07f6ff5de4653f717e | [
"MIT"
] | null | null | null |
# tranverse the tree to find the defect node
# usually use the pattern call.value | 38.533333 | 128 | 0.538831 | from queue import Queue
from generateAST import TreeNode
# tranverse the tree to find the defect node
def BFSGetNode(ast, num):
nodeQ = Queue()
nodeQ.put(ast) # root
while(not nodeQ.empty()):
tmpNode = nodeQ.get()
if tmpNode.beginPoint == num:
return tmpNode
for childNod... | 0 | 0 | 0 | 0 | 0 | 4,960 | 0 | 13 | 146 |
a191c568d1a8ccd10ecfe34dbac8ceb6c183ead3 | 2,402 | py | Python | accounting/accounting/doctype/sales_invoice/sales_invoice.py | rutwikhdev/accounting | 1aca431f94e89a0c794dc14266f43f50ed0c71b1 | [
"MIT"
] | 2 | 2021-09-11T02:49:20.000Z | 2021-11-15T11:45:21.000Z | accounting/accounting/doctype/sales_invoice/sales_invoice.py | rutwikhdev/accounting | 1aca431f94e89a0c794dc14266f43f50ed0c71b1 | [
"MIT"
] | null | null | null | accounting/accounting/doctype/sales_invoice/sales_invoice.py | rutwikhdev/accounting | 1aca431f94e89a0c794dc14266f43f50ed0c71b1 | [
"MIT"
] | null | null | null | #Copyright (c) 2021, Rutwik and contributors
# For license information, please see license.txt
| 28.595238 | 89 | 0.566195 | #Copyright (c) 2021, Rutwik and contributors
# For license information, please see license.txt
import frappe, json, datetime
from frappe.utils import getdate
from frappe.model.document import Document
from accounting.accounting.doctype.gl_entry.gl_entry import make_gl_entries
class SalesInvoice(Document):
def val... | 0 | 695 | 0 | 1,383 | 0 | 0 | 0 | 94 | 135 |
0100d5c7903e157911608570abc99018593a31d6 | 1,315 | py | Python | pysaintcoinach/ex/sheet.py | icykoneko/saintcoinach-py | 66898385e1198203a7ec9da83787427bf6fe5c83 | [
"MIT"
] | 7 | 2019-11-20T17:24:49.000Z | 2022-03-29T04:17:53.000Z | pysaintcoinach/ex/sheet.py | icykoneko/saintcoinach-py | 66898385e1198203a7ec9da83787427bf6fe5c83 | [
"MIT"
] | 7 | 2019-04-08T07:36:46.000Z | 2022-01-17T22:51:54.000Z | pysaintcoinach/ex/sheet.py | icykoneko/saintcoinach-py | 66898385e1198203a7ec9da83787427bf6fe5c83 | [
"MIT"
] | 3 | 2019-04-08T08:24:22.000Z | 2021-06-27T22:19:15.000Z | from typing import TypeVar
from .. import ex
T = TypeVar('T', bound=IRow)
| 19.057971 | 92 | 0.60076 | from abc import ABC, abstractmethod
from typing import Union, Tuple, Iterable, TypeVar
from .. import ex
class IRow(ABC):
@property
@abstractmethod
def sheet(self) -> 'ISheet':
pass
@property
@abstractmethod
def key(self) -> int:
pass
@abstractmethod
def __getitem__(... | 0 | 808 | 0 | 0 | 0 | 0 | 0 | 38 | 390 |
8ad24e2b083bdbf415b2d171defb5c3e1c8216a8 | 1,432 | py | Python | setup.py | arthursoprana/barril | 87ebd247c3c3fa422f4ab3b5acdefbe9e85145c7 | [
"MIT"
] | 1 | 2020-06-09T16:45:29.000Z | 2020-06-09T16:45:29.000Z | setup.py | arthursoprana/barril | 87ebd247c3c3fa422f4ab3b5acdefbe9e85145c7 | [
"MIT"
] | null | null | null | setup.py | arthursoprana/barril | 87ebd247c3c3fa422f4ab3b5acdefbe9e85145c7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
import io
from setuptools import find_packages, setup
with io.open("README.rst", encoding="UTF-8") as readme_file:
readme = readme_file.read()
with io.open("CHANGELOG.rst", encoding="UTF-8") as changelog_file:
history = changelog_file.rea... | 30.468085 | 87 | 0.646648 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""The setup script."""
import io
from setuptools import find_packages, setup
with io.open("README.rst", encoding="UTF-8") as readme_file:
readme = readme_file.read()
with io.open("CHANGELOG.rst", encoding="UTF-8") as changelog_file:
history = changelog_file.rea... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a8187bb91daec99a367befa8aa6910b292a5ccc4 | 17,307 | py | Python | applications/SwimmingDEMApplication/python_scripts/Derivatives.py | clazaro/Kratos | b947b82c90dfcbf13d60511427f85990d36b90be | [
"BSD-4-Clause"
] | 778 | 2017-01-27T16:29:17.000Z | 2022-03-30T03:01:51.000Z | applications/SwimmingDEMApplication/python_scripts/Derivatives.py | clazaro/Kratos | b947b82c90dfcbf13d60511427f85990d36b90be | [
"BSD-4-Clause"
] | 6,634 | 2017-01-15T22:56:13.000Z | 2022-03-31T15:03:36.000Z | applications/SwimmingDEMApplication/python_scripts/Derivatives.py | clazaro/Kratos | b947b82c90dfcbf13d60511427f85990d36b90be | [
"BSD-4-Clause"
] | 224 | 2017-02-07T14:12:49.000Z | 2022-03-06T23:09:34.000Z |
HyperbolicTangentFluidFractionSolution().DerivativeCalculator() | 42.523342 | 152 | 0.544288 | import numpy as np
import sympy as sp
class TimeDependantFluidFractionSolution():
def __init__(self):
self.time = sp.Symbol('time')
self.x1 = sp.Symbol('x1')
self.x2 = sp.Symbol('x2')
self.L = sp.Symbol('L')
self.delta_alpha = sp.Symbol('delta_alpha')
sel... | 0 | 0 | 0 | 17,052 | 0 | 0 | 0 | -6 | 196 |
f7537b491f8aa9032d2a36ff9cfe852cd01429d9 | 2,792 | py | Python | vis/plot_2d_neural_outputs.py | ajclaros/rl_legged_walker | 26d0e124ef38045943449c2772b966571117683b | [
"MIT"
] | null | null | null | vis/plot_2d_neural_outputs.py | ajclaros/rl_legged_walker | 26d0e124ef38045943449c2772b966571117683b | [
"MIT"
] | null | null | null | vis/plot_2d_neural_outputs.py | ajclaros/rl_legged_walker | 26d0e124ef38045943449c2772b966571117683b | [
"MIT"
] | null | null | null | import numpy as np
def simulate_ctrnn(ctrnn, stepsize=0.01, init_duration=0, test_duration=10):
"""This function simply provides an average change in output per neuron per time. Optionally can include initial duration to prevent transient changes at start of simulation."""
init_time = np.arange(0.0, init... | 28.783505 | 181 | 0.693768 |
from jason.ctrnn import CTRNN
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import numpy as np
import random
import sys
import json
import os
import math
from util.fitness_functions import fitness_maximize_output_change, fitness_frequency_match
def main():
trial_seed=1
sol_seed=6
... | 0 | 0 | 0 | 0 | 0 | 1,385 | 0 | 52 | 245 |
905865b280914b2496b3b63730fb6307640a91c5 | 1,005 | py | Python | tests/test_DataPulls.py | D0cR3d/PokeFacts | 7bbb8a9e8b53ae68d7da1b99cc72bc0587acf9cd | [
"MIT"
] | null | null | null | tests/test_DataPulls.py | D0cR3d/PokeFacts | 7bbb8a9e8b53ae68d7da1b99cc72bc0587acf9cd | [
"MIT"
] | 2 | 2017-07-04T09:29:14.000Z | 2017-07-06T07:00:27.000Z | tests/test_DataPulls.py | rpokemon/PokeFacts | eec9c784f9c907ee1627e4f22781d7362f9060a8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3 | 43.695652 | 76 | 0.631841 | #!/usr/bin/env python3
import codecs, json
from PokeFacts import DataPulls
class TestDataPulls(object):
def test_ItemStore(self):
store = DataPulls.ItemStore({'term_property': 'term'})
with codecs.open('tests/test_data.json', "r", "utf-8") as data_file:
store.addItems(json.load(data_f... | 0 | 0 | 0 | 907 | 0 | 0 | 0 | 8 | 68 |
510c4afab071a1e81947f0cbec9ca686a8719af7 | 4,653 | py | Python | main.py | MurphyWants/rc-hammer-client | d5d68d60a0481bca309edec1e872565804031ab8 | [
"MIT"
] | null | null | null | main.py | MurphyWants/rc-hammer-client | d5d68d60a0481bca309edec1e872565804031ab8 | [
"MIT"
] | null | null | null | main.py | MurphyWants/rc-hammer-client | d5d68d60a0481bca309edec1e872565804031ab8 | [
"MIT"
] | null | null | null | #!python3
try:
except Exception: # ImportError
from classes import Variable_Holder as VH
import threading
global vars
vars = VH()
if __name__ == "__main__":
print("Main function started:\n")
if not ((Headlights_Pin == False) or (ESC_Pin == False) or (Steering_Pin == False)):
import RPi.GPIO as G... | 29.449367 | 88 | 0.588223 | #!python3
try:
from .Settings import *
except Exception: # ImportError
from Settings import *
import time
from classes import Variable_Holder as VH
import math
import websocket
import json
import threading
global vars
vars = VH()
def set_servo(num, pi):
cos_input = math.cos(math.radians(num))
mid... | 0 | 0 | 0 | 0 | 0 | 3,158 | 0 | -32 | 324 |
ff1df9c5c8855eca5bdd252829cba41c99412f84 | 1,673 | py | Python | esphome/components/max31865/sensor.py | huhuhugo1/esphome | eb895d2095861a4d51f1a5fcd582a97389c27b4f | [
"MIT"
] | null | null | null | esphome/components/max31865/sensor.py | huhuhugo1/esphome | eb895d2095861a4d51f1a5fcd582a97389c27b4f | [
"MIT"
] | null | null | null | esphome/components/max31865/sensor.py | huhuhugo1/esphome | eb895d2095861a4d51f1a5fcd582a97389c27b4f | [
"MIT"
] | null | null | null | import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import sensor, spi
from esphome.const import CONF_MAINS_FILTER, CONF_REFERENCE_RESISTANCE, CONF_RTD_NOMINAL_RESISTANCE, CONF_RTD_WIRES, ICON_THERMOMETER, UNIT_CELSIUS
max31865_ns = cg.esphome_ns.namespace('max31865')
MAX31865Se... | 47.8 | 97 | 0.767484 | import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import sensor, spi
from esphome.const import CONF_ID, CONF_MAINS_FILTER, CONF_REFERENCE_RESISTANCE, \
CONF_RTD_NOMINAL_RESISTANCE, CONF_RTD_WIRES, ICON_THERMOMETER, UNIT_CELSIUS
max31865_ns = cg.esphome_ns.namespace('max318... | 0 | 0 | 0 | 0 | 445 | 0 | 0 | 15 | 23 |
01d46f1812d1aa6a824cfbeb5a383790ba4750a2 | 75 | py | Python | soln/dummy.py | cberzan/kaggle-caterpillar | 05a4abc975ad8eb399b6e9579147e5d5a9193084 | [
"MIT"
] | 11 | 2015-09-28T15:43:04.000Z | 2019-04-07T12:54:25.000Z | soln/dummy.py | cberzan/kaggle-caterpillar | 05a4abc975ad8eb399b6e9579147e5d5a9193084 | [
"MIT"
] | null | null | null | soln/dummy.py | cberzan/kaggle-caterpillar | 05a4abc975ad8eb399b6e9579147e5d5a9193084 | [
"MIT"
] | 8 | 2015-09-03T12:43:35.000Z | 2019-12-31T03:12:54.000Z | # This file exists only so that I can do `os.path.dirname(dummy.__file__)`
| 37.5 | 74 | 0.746667 | # This file exists only so that I can do `os.path.dirname(dummy.__file__)`
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
31d98b00562038ec38e177f53c091bd4853255cf | 10,609 | py | Python | WDL/__init__.py | illusional/miniwdl | f8fc2c4285f44fe87a26fa5a24fd94e7f48597b4 | [
"MIT"
] | null | null | null | WDL/__init__.py | illusional/miniwdl | f8fc2c4285f44fe87a26fa5a24fd94e7f48597b4 | [
"MIT"
] | null | null | null | WDL/__init__.py | illusional/miniwdl | f8fc2c4285f44fe87a26fa5a24fd94e7f48597b4 | [
"MIT"
] | null | null | null | """
`miniwdl <https://github.com/chanzuckerberg/miniwdl/>`_ is a developer toolkit and local runner for
the bioinformatics-focused `Workflow Description Language (WDL) <http://openwdl.org/>`_. This
documentation covers the Python3 ``WDL`` package facilitating parsing & static analysis of WDL
documents.
* `GitHub repo ... | 39.585821 | 254 | 0.661043 | """
`miniwdl <https://github.com/chanzuckerberg/miniwdl/>`_ is a developer toolkit and local runner for
the bioinformatics-focused `Workflow Description Language (WDL) <http://openwdl.org/>`_. This
documentation covers the Python3 ``WDL`` package facilitating parsing & static analysis of WDL
documents.
* `GitHub repo ... | 0 | 0 | 2,421 | 311 | 0 | 95 | 0 | 176 | 181 |
8102267bdc479bec80871dcf3a1ca8a3ad679c31 | 423 | py | Python | petstagram/pets/migrations/0003_like_test.py | ZhivkoZhelyazkov/Petstagram | 0e7ade5175f517f8935d4be0cb8f71cd31a06cf9 | [
"MIT"
] | null | null | null | petstagram/pets/migrations/0003_like_test.py | ZhivkoZhelyazkov/Petstagram | 0e7ade5175f517f8935d4be0cb8f71cd31a06cf9 | [
"MIT"
] | null | null | null | petstagram/pets/migrations/0003_like_test.py | ZhivkoZhelyazkov/Petstagram | 0e7ade5175f517f8935d4be0cb8f71cd31a06cf9 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.1 on 2020-10-11 20:24
| 21.15 | 60 | 0.591017 | # Generated by Django 3.1.1 on 2020-10-11 20:24
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('pets', '0002_auto_20201011_1244'),
]
operations = [
migrations.AddField(
model_name='like',
name='test',
... | 0 | 0 | 0 | 309 | 0 | 0 | 0 | 19 | 46 |
61db9479529ab7e0b3be4a0b9fe476b5d3493304 | 2,000 | py | Python | Code/test_model.py | rutwik777/ML-and-IoT-based-Self-Driving-car | 007a41774c0aa3b72e9c2c43c1cfc188573ad55e | [
"CC0-1.0"
] | null | null | null | Code/test_model.py | rutwik777/ML-and-IoT-based-Self-Driving-car | 007a41774c0aa3b72e9c2c43c1cfc188573ad55e | [
"CC0-1.0"
] | null | null | null | Code/test_model.py | rutwik777/ML-and-IoT-based-Self-Driving-car | 007a41774c0aa3b72e9c2c43c1cfc188573ad55e | [
"CC0-1.0"
] | null | null | null | # test_model.py
import time
from alexnet import alexnet
import serial
arduinoSerial = serial.Serial('com4',9600)
time.sleep(1)
WIDTH = 160
HEIGHT = 120
LR = 1e-3
EPOCHS = 20
MODEL_NAME = 'self-driving-car-fast-final-{}-{}-{}-epochs-930-data.model'.format(LR, 'alexnetv2',EPOCHS)
t_time = 0.09
## ReleaseKey(A)
# ... | 23.255814 | 104 | 0.552 | # test_model.py
import numpy as np
from grabscreen import grab_screen
import cv2
import time
from alexnet import alexnet
from getkeys import key_check
import serial
arduinoSerial = serial.Serial('com4',9600)
time.sleep(1)
import random
WIDTH = 160
HEIGHT = 120
LR = 1e-3
EPOCHS = 20
MODEL_NAME = 'self-driving-car-fas... | 0 | 0 | 0 | 0 | 0 | 1,385 | 0 | -1 | 204 |
9150954c066c33bda0b392995e9bb4c6c3a35da5 | 5,084 | py | Python | openstack_dashboard/api/rest/neutron.py | Hodorable/0602 | 3b1e4cb7458e4f456bfebc52fc2902205c36cc15 | [
"Apache-2.0"
] | 1 | 2017-12-07T05:21:58.000Z | 2017-12-07T05:21:58.000Z | openstack_dashboard/api/rest/neutron.py | Hodorable/0602 | 3b1e4cb7458e4f456bfebc52fc2902205c36cc15 | [
"Apache-2.0"
] | null | null | null | openstack_dashboard/api/rest/neutron.py | Hodorable/0602 | 3b1e4cb7458e4f456bfebc52fc2902205c36cc15 | [
"Apache-2.0"
] | null | null | null | #
# (c) Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# 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 ap... | 37.109489 | 87 | 0.653029 | #
# (c) Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# 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 ap... | 0 | 4,183 | 0 | 0 | 0 | 0 | 0 | 88 | 160 |
4fe879acf3b1bdf20cb1db9c1f6f377eb4303255 | 5,419 | py | Python | bean/grid_sizer_dialog.py | CASL/VERAview | 89b18f239ca5228185b80d5392068981d7733d3b | [
"BSD-3-Clause"
] | 7 | 2017-04-21T05:35:16.000Z | 2022-02-28T20:14:42.000Z | bean/grid_sizer_dialog.py | CASL/VERAview | 89b18f239ca5228185b80d5392068981d7733d3b | [
"BSD-3-Clause"
] | 2 | 2019-02-27T15:25:34.000Z | 2021-05-26T17:01:59.000Z | bean/grid_sizer_dialog.py | CASL/VERAview | 89b18f239ca5228185b80d5392068981d7733d3b | [
"BSD-3-Clause"
] | 3 | 2019-07-09T08:31:34.000Z | 2022-03-08T03:18:48.000Z | #!/usr/bin/env python
# $Id$
#------------------------------------------------------------------------
# NAME: grid_sizer_dialog.py -
# HISTORY: -
# 2017-07-21 leerw@ornl.gov -
# Fixing _OnCharHook for Linux.
# 2017-03-31 leerw@ornl.gov -
# Added EVT_CHAR_HOOK
# 2015-02-14 leerw@ornl.gov -
#--... | 28.371728 | 77 | 0.442702 | #!/usr/bin/env python
# $Id$
#------------------------------------------------------------------------
# NAME: grid_sizer_dialog.py -
# HISTORY: -
# 2017-07-21 leerw@ornl.gov -
# Fixing _OnCharHook for Linux.
# 2017-03-31 leerw@ornl.gov -
# Added EVT_CHAR_HOOK
# 2015-02-14 leerw@ornl.gov -
#--... | 0 | 163 | 0 | 4,389 | 0 | 0 | 0 | 9 | 45 |
b903ed12cff76a8c3358bc008cfa3c3fc439c0dd | 6,249 | py | Python | osg_configure/configure_modules/pbs.py | mmascher/osg-configure | 0a8490f87ff1b3340796f94ed657b62b19602347 | [
"Apache-2.0"
] | null | null | null | osg_configure/configure_modules/pbs.py | mmascher/osg-configure | 0a8490f87ff1b3340796f94ed657b62b19602347 | [
"Apache-2.0"
] | null | null | null | osg_configure/configure_modules/pbs.py | mmascher/osg-configure | 0a8490f87ff1b3340796f94ed657b62b19602347 | [
"Apache-2.0"
] | null | null | null | """ Module to handle attributes related to the pbs jobmanager
configuration """
__all__ = ['PBSConfiguration']
| 41.384106 | 115 | 0.603617 | """ Module to handle attributes related to the pbs jobmanager
configuration """
import os
import logging
from osg_configure.modules import utilities
from osg_configure.modules import configfile
from osg_configure.modules import validation
from osg_configure.modules.jobmanagerconfiguration import JobManagerConfigurat... | 0 | 0 | 0 | 5,869 | 0 | 0 | 0 | 109 | 157 |
312977492b5df68a1fd16270301071daf1e7767c | 16,405 | py | Python | DQMOffline/Trigger/python/DisplacedJet_Monitor_cff.py | pasmuss/cmssw | 566f40c323beef46134485a45ea53349f59ae534 | [
"Apache-2.0"
] | null | null | null | DQMOffline/Trigger/python/DisplacedJet_Monitor_cff.py | pasmuss/cmssw | 566f40c323beef46134485a45ea53349f59ae534 | [
"Apache-2.0"
] | null | null | null | DQMOffline/Trigger/python/DisplacedJet_Monitor_cff.py | pasmuss/cmssw | 566f40c323beef46134485a45ea53349f59ae534 | [
"Apache-2.0"
] | null | null | null | import FWCore.ParameterSet.Config as cms
from DQMOffline.Trigger.HTMonitor_cfi import hltHTmonitoring
from DQMOffline.Trigger.JetMonitor_cfi import hltJetMETmonitoring
DisplacedJetIter2TracksMonitoringHLT = trackingMonHLT.clone()
DisplacedJetIter2TracksMonitoringHLT.FolderName = 'HLT/EXO/DisplacedJet/Tracking/i... | 78.492823 | 211 | 0.880098 | import FWCore.ParameterSet.Config as cms
from DQMOffline.Trigger.HTMonitor_cfi import hltHTmonitoring
from DQMOffline.Trigger.JetMonitor_cfi import hltJetMETmonitoring
from DQMOffline.Trigger.TrackingMonitoring_cff import *
DisplacedJetIter2TracksMonitoringHLT = trackingMonHLT.clone()
DisplacedJetIter2TracksMonitor... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 34 | 24 |
0b6514b479918edb10d5edaed7d5c591a271ac8a | 8,276 | py | Python | primitive.py | dp-cont/dp-cont | 193bea06c1861645f16bd080e45eb0f282e8469a | [
"MIT"
] | 3 | 2021-06-28T20:49:19.000Z | 2022-03-24T02:01:24.000Z | primitive.py | dp-cont/dp-cont | 193bea06c1861645f16bd080e45eb0f282e8469a | [
"MIT"
] | null | null | null | primitive.py | dp-cont/dp-cont | 193bea06c1861645f16bd080e45eb0f282e8469a | [
"MIT"
] | 1 | 2021-02-03T22:00:50.000Z | 2021-02-03T22:00:50.000Z |
# noisy max
'''some LDP primitives'''
# stochastic rounding (Duchi et al.)
# piecewise mechanism (Wang et al.)
# square wave (Li et al.)
| 34.198347 | 132 | 0.55957 | import numpy as np
from scipy import special
from numpy import linalg as LA
def laplace(beta, data):
output = data + np.random.laplace(0, beta, len(data))
return output
def smooth_ell(p_rank, b, max_ell, data):
m = len(data)
data = np.append([0] * m, data)
data = np.append(data, [max_ell] * m)
... | 0 | 0 | 0 | 0 | 0 | 7,844 | 0 | 10 | 270 |
6314e51f9fc94df754ce929422f893b378669703 | 13,322 | py | Python | utils/residualload.py | maep-tools/MAEP-SDDP_sourcecode | f951a630cb5aa323eeb359a08b67c66035662293 | [
"Unlicense"
] | 2 | 2021-09-09T17:19:58.000Z | 2021-12-15T14:22:56.000Z | utils/residualload.py | maep-tools/model-maep | f951a630cb5aa323eeb359a08b67c66035662293 | [
"Unlicense"
] | null | null | null | utils/residualload.py | maep-tools/model-maep | f951a630cb5aa323eeb359a08b67c66035662293 | [
"Unlicense"
] | 5 | 2019-02-15T18:44:16.000Z | 2021-09-09T17:20:02.000Z |
############################################################################### | 40.740061 | 150 | 0.506005 | import pickle
def aggr_energy(dict_data, Param):
import numpy as np
from utils.mipproblem import fisrt_vec, pelp_vec
dict_wind = pickle.load( open( "savedata/windspeed_save.p", "rb" ) )
dict_solD = pickle.load( open( "savedata/solarradDist.p", "rb" ) )
dict_solL = pickle.load( open( "save... | 0 | 0 | 0 | 0 | 0 | 13,155 | 0 | -8 | 95 |
3c0daa5a31a67e635725474cc99b373b14c8e6e9 | 336 | py | Python | 20190209_SWIG/example2/setup.py | 3x3x3/Presentations | 3c31b136ed4d9214bb3730fa41a4a575da38edc9 | [
"MIT"
] | null | null | null | 20190209_SWIG/example2/setup.py | 3x3x3/Presentations | 3c31b136ed4d9214bb3730fa41a4a575da38edc9 | [
"MIT"
] | null | null | null | 20190209_SWIG/example2/setup.py | 3x3x3/Presentations | 3c31b136ed4d9214bb3730fa41a4a575da38edc9 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from setuptools import setup, Extension
packages = [
"swig_ex2",
]
ext_modules = [
Extension(
name="_swig_ex2",
sources=["ex2.c", "ex2_wrap.c"],
),
]
setup(
name="swig_ex2",
version="1.0.0",
description="SWIG Example2",
ext_modules=ext_modules,
packages=packages,
package_dir={"sw... | 14.608696 | 39 | 0.654762 | # -*- coding: utf-8 -*-
from setuptools import setup, Extension
packages = [
"swig_ex2",
]
ext_modules = [
Extension(
name="_swig_ex2",
sources=["ex2.c", "ex2_wrap.c"],
),
]
setup(
name="swig_ex2",
version="1.0.0",
description="SWIG Example2",
ext_modules=ext_modules,
packages=packages,
package_dir={"sw... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
5cfc13d7f239c86cab1f4b97845e639498d9a98c | 713 | py | Python | setup.py | mrzhangboss/hookman | e1bef52f18f8f53f437477bad72607716c01b605 | [
"Apache-2.0"
] | null | null | null | setup.py | mrzhangboss/hookman | e1bef52f18f8f53f437477bad72607716c01b605 | [
"Apache-2.0"
] | null | null | null | setup.py | mrzhangboss/hookman | e1bef52f18f8f53f437477bad72607716c01b605 | [
"Apache-2.0"
] | null | null | null | # -*- coding:utf-8 -*-
from __future__ import absolute_import, unicode_literals, print_function
from setuptools import setup, find_packages
# todo: add install_requires and test_requires
setup(name='hookman',
version='0.1.2',
packages=find_packages(),
test_requires = ['py.test>=2.92', 'mock'],
... | 37.526316 | 92 | 0.681627 | # -*- coding:utf-8 -*-
from __future__ import absolute_import, unicode_literals, print_function
from setuptools import setup, find_packages
# todo: add install_requires and test_requires
setup(name='hookman',
version='0.1.2',
packages=find_packages(),
test_requires = ['py.test>=2.92', 'mock'],
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
10b01385472c3bf2d2ca2f856566151a55231a09 | 887 | py | Python | myproject.py | akshat0047/Fraped | c2208aa7c770392664a41371d7a599770e0dbb7d | [
"MIT"
] | null | null | null | myproject.py | akshat0047/Fraped | c2208aa7c770392664a41371d7a599770e0dbb7d | [
"MIT"
] | null | null | null | myproject.py | akshat0047/Fraped | c2208aa7c770392664a41371d7a599770e0dbb7d | [
"MIT"
] | null | null | null | from app import app
"""
If Twisted's WSGI server is not desired in favor for solutions like uwsgi or gunicorn or anything similar,
the `crochet` library can execute Twisted code in an isolated thread. Be EXTREMELY careful with this solution!
Python's WSGI servers generally use threads, as does `crochet`, and/or process... | 38.565217 | 110 | 0.738444 | from app import app
"""
If Twisted's WSGI server is not desired in favor for solutions like uwsgi or gunicorn or anything similar,
the `crochet` library can execute Twisted code in an isolated thread. Be EXTREMELY careful with this solution!
Python's WSGI servers generally use threads, as does `crochet`, and/or process... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7c70729f88b3127aec5498cc52269217e8c2a7e2 | 2,663 | py | Python | src/pyherc/events/__init__.py | tuturto/pyherc | 4e7c72a4d80d335f7d3c48cecac96cd7105acac4 | [
"MIT"
] | 25 | 2015-07-21T12:40:42.000Z | 2021-09-23T09:00:45.000Z | src/pyherc/events/__init__.py | tuturto/pyherc | 4e7c72a4d80d335f7d3c48cecac96cd7105acac4 | [
"MIT"
] | 65 | 2015-02-15T19:42:19.000Z | 2018-01-03T10:22:35.000Z | src/pyherc/events/__init__.py | tuturto/pyherc | 4e7c72a4d80d335f7d3c48cecac96cd7105acac4 | [
"MIT"
] | 3 | 2017-06-15T13:07:49.000Z | 2019-04-15T02:18:39.000Z | # -*- coding: utf-8 -*-
# Copyright (c) 2010-2017 Tuukka Turto
#
# 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, copy,... | 49.314815 | 86 | 0.772062 | # -*- coding: utf-8 -*-
# Copyright (c) 2010-2017 Tuukka Turto
#
# 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, copy,... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1,043 | 397 |
72c0a95eec9375b10a7aab985a7bd93ee563b2ef | 4,161 | py | Python | src/server/tcp_server.py | polzbit/tcp_reverse_shell | d18bb6136d1a7bbd5dd44685b7e6906e55865705 | [
"MIT"
] | null | null | null | src/server/tcp_server.py | polzbit/tcp_reverse_shell | d18bb6136d1a7bbd5dd44685b7e6906e55865705 | [
"MIT"
] | null | null | null | src/server/tcp_server.py | polzbit/tcp_reverse_shell | d18bb6136d1a7bbd5dd44685b7e6906e55865705 | [
"MIT"
] | null | null | null | # TCP Server
if __name__ == "__main__":
main() | 41.19802 | 129 | 0.57342 | # TCP Server
from socket import socket, AF_INET, SOCK_STREAM
from Crypto.PublicKey import RSA
from Crypto.Cipher import AES, PKCS1_OAEP
from Crypto.Util import Counter
import os
class Server:
''' Shell Server '''
def __init__(self):
self.IP = '<SERVER-IP-ADDRESS>'
self.PORT = 8080
... | 0 | 0 | 0 | 3,861 | 0 | 25 | 0 | 55 | 166 |
6b2234f49a8b57fe4bf6fd97f1ef5ca5137dfade | 2,342 | py | Python | Apps/phdigitalshadows/dsapi/service/infrastructure_service.py | ryanbsaunders/phantom-apps | 1befda793a08d366fbd443894f993efb1baf9635 | [
"Apache-2.0"
] | 74 | 2019-10-22T02:00:53.000Z | 2022-03-15T12:56:13.000Z | Apps/phdigitalshadows/dsapi/service/infrastructure_service.py | ryanbsaunders/phantom-apps | 1befda793a08d366fbd443894f993efb1baf9635 | [
"Apache-2.0"
] | 375 | 2019-10-22T20:53:50.000Z | 2021-11-09T21:28:43.000Z | Apps/phdigitalshadows/dsapi/service/infrastructure_service.py | ryanbsaunders/phantom-apps | 1befda793a08d366fbd443894f993efb1baf9635 | [
"Apache-2.0"
] | 175 | 2019-10-23T15:30:42.000Z | 2021-11-05T21:33:31.000Z | # File: infrastructure_service.py
#
# Licensed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt)
#
| 32.985915 | 106 | 0.599488 | # File: infrastructure_service.py
#
# Licensed under Apache 2.0 (https://www.apache.org/licenses/LICENSE-2.0.txt)
#
from .ds_base_service import DSBaseService
from .ds_find_service import DSFindService
from ..model.infrastructure import Infrastructure
class InfrastructureService(DSFindService):
def __init__(se... | 0 | 929 | 0 | 1,135 | 0 | 0 | 0 | 70 | 91 |
3563857b8dcbacfabfb8b623eed375f16c61d5c9 | 2,952 | py | Python | raspberrypi/pi3_client/wifi_handle.py | alexisdal/agv-line-follower | 538dfce20354508744df338a26d4f6d68ac6095b | [
"MIT"
] | 1 | 2019-09-02T17:06:11.000Z | 2019-09-02T17:06:11.000Z | raspberrypi/pi3_client/wifi_handle.py | alexisdal/agv-line-follower | 538dfce20354508744df338a26d4f6d68ac6095b | [
"MIT"
] | null | null | null | raspberrypi/pi3_client/wifi_handle.py | alexisdal/agv-line-follower | 538dfce20354508744df338a26d4f6d68ac6095b | [
"MIT"
] | null | null | null | # this Python file uses the following encoding: utf-8
#RSSI=$(grep wlan0 /proc/net/wireless | awk '{print $4}' | tr -d '.')
#root@mtbr00622:~# cat /proc/net/wireless
#Inter-| sta-| Quality | Discarded packets | Missed | WE
# face | tus | link level noise | nwid crypt frag retry misc | b... | 40.438356 | 136 | 0.557249 | # this Python file uses the following encoding: utf-8
import os # to execute shall cmds
import time # to sleep()
import redis # to interface with the queue of requests. installed with => python3 -m pip install redis
import requests # because if's simpler to use for an http query than the default python . installed w... | 0 | 0 | 0 | 0 | 0 | 1,903 | 0 | -37 | 435 |
373bc6df16ccb1c78421ca0bf49271077d209643 | 1,949 | py | Python | smoke/convert/firework_to_nc.py | minnieteng/smoke_project | cc3c8f16f7759fe29e46d3cec32a3ed6ca86bd5f | [
"Apache-2.0"
] | null | null | null | smoke/convert/firework_to_nc.py | minnieteng/smoke_project | cc3c8f16f7759fe29e46d3cec32a3ed6ca86bd5f | [
"Apache-2.0"
] | null | null | null | smoke/convert/firework_to_nc.py | minnieteng/smoke_project | cc3c8f16f7759fe29e46d3cec32a3ed6ca86bd5f | [
"Apache-2.0"
] | null | null | null | """
Functions to transform firework model files to netCDF files
"""
import logging
import smoke.utils.utilities as utilities
logging.getLogger(__name__).addHandler(logging.NullHandler())
def firework_to_xr(firework_file):
""" Loading and returning data from firework
geotiff files as of file format includin... | 29.089552 | 109 | 0.703951 | """
Functions to transform firework model files to netCDF files
"""
import logging
import os
import sys
import numpy as np
import datetime
import xarray as xr
import click
import smoke.utils.utilities as utilities
from pathlib import Path
from smoke.load.parsers import *
logging.getLogger(__name__).addHandler(loggin... | 0 | 789 | 0 | 0 | 0 | 275 | 0 | -29 | 223 |
94312290ddda3b32c4f4cb1ef88624b5da111b0e | 4,170 | py | Python | contact_updater/tests.py | projectkrang/foia-hub | 0f9a6de2ff76a1049852bd5cb0c06ed2d131f790 | [
"CC0-1.0"
] | 2 | 2015-04-14T19:42:04.000Z | 2017-05-09T16:38:16.000Z | contact_updater/tests.py | projectkrang/foia-hub | 0f9a6de2ff76a1049852bd5cb0c06ed2d131f790 | [
"CC0-1.0"
] | 16 | 2015-02-17T19:24:33.000Z | 2015-05-08T20:58:53.000Z | contact_updater/tests.py | projectkrang/foia-hub | 0f9a6de2ff76a1049852bd5cb0c06ed2d131f790 | [
"CC0-1.0"
] | 1 | 2015-02-17T20:10:29.000Z | 2015-02-17T20:10:29.000Z |
api_data = {
'offices': [],
'public_liaison_email': None,
'foia_libraries': [{'url': 'http://www.amtrak.com/library'}],
'simple_processing_time': 1.0,
'name': 'AMTRAK',
'common_requests': [],
'phone': '202-906-3741',
'abbreviation': 'NRPC',
'request_form_url': None,
'agency_slu... | 32.076923 | 79 | 0.606954 | from django.test import TestCase
from django.core.urlresolvers import reverse
from contact_updater import views
api_data = {
'offices': [],
'public_liaison_email': None,
'foia_libraries': [{'url': 'http://www.amtrak.com/library'}],
'simple_processing_time': 1.0,
'name': 'AMTRAK',
'common_requ... | 0 | 0 | 0 | 2,969 | 0 | 0 | 0 | 46 | 136 |
b2c15d1c3315dfbd24248641c3995085b2c7cd04 | 5,820 | py | Python | mask/eolearn/mask/masking.py | chorng/eo-learn | a1a3c6fa5568d398f5e43f5ad5aecdfeb05e8d3c | [
"MIT"
] | null | null | null | mask/eolearn/mask/masking.py | chorng/eo-learn | a1a3c6fa5568d398f5e43f5ad5aecdfeb05e8d3c | [
"MIT"
] | null | null | null | mask/eolearn/mask/masking.py | chorng/eo-learn | a1a3c6fa5568d398f5e43f5ad5aecdfeb05e8d3c | [
"MIT"
] | null | null | null | """
Module for creating mask features
Credits:
Copyright (c) 2017-2022 Matej Aleksandrov, Matej Bati, Grega Milinski, Domagoj Korais, Matic Lubej (Sinergise)
Copyright (c) 2017-2022 iga Luki, Devis Peressutti, Nejc Vesel, Jovan Vinji, Ane Zupanc (Sinergise)
Copyright (c) 2019-2020 Jernej Puc, Lojze ust (Sinergise)
Cop... | 42.173913 | 120 | 0.682474 | """
Module for creating mask features
Credits:
Copyright (c) 2017-2022 Matej Aleksandrov, Matej Batič, Grega Milčinski, Domagoj Korais, Matic Lubej (Sinergise)
Copyright (c) 2017-2022 Žiga Lukšič, Devis Peressutti, Nejc Vesel, Jovan Višnjić, Anže Zupanc (Sinergise)
Copyright (c) 2019-2020 Jernej Puc, Lojze Žust (Siner... | 20 | 0 | 0 | 3,551 | 0 | 0 | 0 | 36 | 114 |
de5882bacfdfa39c408052cb576f8b74974e4b51 | 341 | py | Python | files/5_with.py | fcafedericoguerra/Python | 130381d51ddc9192859d2512715a86db8aa5869d | [
"MIT"
] | 1 | 2019-10-14T18:17:27.000Z | 2019-10-14T18:17:27.000Z | files/5_with.py | fcafedericoguerra/Python | 130381d51ddc9192859d2512715a86db8aa5869d | [
"MIT"
] | 3 | 2019-05-03T21:22:36.000Z | 2019-05-03T21:24:50.000Z | files/5_with.py | fcafedericoguerra/Python | 130381d51ddc9192859d2512715a86db8aa5869d | [
"MIT"
] | 50 | 2019-04-24T22:52:19.000Z | 2021-11-04T01:57:33.000Z | # -*- coding: utf-8 -*-
import locale
############## Manejo de archivos ##############
with open("5_with.py", "r", encoding='utf-8') as file: #With permite cerrar el archivo automaticamente cuando se ejecute el bloque
print(locale.getpreferredencoding())
# LANG environment variable
print(locale.setlocale(... | 31 | 130 | 0.653959 | # -*- coding: utf-8 -*-
import locale
############## Manejo de archivos ##############
with open("5_with.py", "r", encoding='utf-8') as file: #With permite cerrar el archivo automaticamente cuando se ejecute el bloque
print(locale.getpreferredencoding())
# LANG environment variable
print(locale.setlocale(... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ca2a3d943c65f6613fda2db5af2fb7cc2370ada0 | 1,075 | py | Python | PYQT5/Line_edit.py | Amara-Manikanta/Python-GUI | 0356e7cae7f1c51d0781bf431c386ee7262608b1 | [
"MIT"
] | null | null | null | PYQT5/Line_edit.py | Amara-Manikanta/Python-GUI | 0356e7cae7f1c51d0781bf431c386ee7262608b1 | [
"MIT"
] | null | null | null | PYQT5/Line_edit.py | Amara-Manikanta/Python-GUI | 0356e7cae7f1c51d0781bf431c386ee7262608b1 | [
"MIT"
] | null | null | null |
if __name__=='__main__':
main()
| 27.564103 | 84 | 0.651163 | import sys
from PyQt5.QtWidgets import *
class Windows(QWidget):
def __init__(self):
super().__init__()
self.setWindowTitle("Using Line Edits")
self.setGeometry(50,50,350,350)
self.UI()
def UI(self):
self.nameTextBox= QLineEdit(self)
self.nameTextBox.setPlacehol... | 0 | 0 | 0 | 880 | 0 | 69 | 0 | -3 | 90 |
5b7788ca1a6abf922214c236be57040bca916688 | 2,207 | py | Python | tests/tag_handlers/test_import_handler.py | an-otter-world/marshpy | 42aed8e5f316358792356c7e550f844a08bf206e | [
"WTFPL"
] | null | null | null | tests/tag_handlers/test_import_handler.py | an-otter-world/marshpy | 42aed8e5f316358792356c7e550f844a08bf206e | [
"WTFPL"
] | 16 | 2021-03-26T08:32:29.000Z | 2021-03-27T10:37:24.000Z | tests/tag_handlers/test_import_handler.py | an-otter-world/marshpy | 42aed8e5f316358792356c7e550f844a08bf206e | [
"WTFPL"
] | null | null | null | """Import handler tests."""
from pathlib import Path
from marshpy.core.constants import UNDEFINED
from marshpy.core.errors import ErrorCode
from marshpy.tag_handlers.import_handler import ImportHandler
from tests.tag_handlers.path_handler_helpers import check_path_tag
from tests.tag_handlers.path_handler_helpers impo... | 24.522222 | 73 | 0.636158 | """Import handler tests."""
from pathlib import Path
from marshpy.core.constants import UNDEFINED
from marshpy.core.errors import ErrorCode
from marshpy.tag_handlers.import_handler import ImportHandler
from tests.tag_handlers.path_handler_helpers import check_path_tag
from tests.tag_handlers.path_handler_helpers impo... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
03c4e4c2cf1b6e16b0820e68f2fcc27ec213049e | 1,195 | py | Python | yadi/context.py | fcracker79/yadi | e0327295b062c24cf85323c8fcc414c8dc4fe4a4 | [
"MIT"
] | 3 | 2018-03-09T09:12:32.000Z | 2018-03-20T13:41:50.000Z | yadi/context.py | fcracker79/yadi | e0327295b062c24cf85323c8fcc414c8dc4fe4a4 | [
"MIT"
] | 1 | 2018-03-09T09:11:43.000Z | 2018-03-11T16:18:10.000Z | yadi/context.py | fcracker79/yadi | e0327295b062c24cf85323c8fcc414c8dc4fe4a4 | [
"MIT"
] | null | null | null |
SINGLETON = 'singleton'
PROTOTYPE = 'prototype'
| 21.339286 | 91 | 0.658577 | import abc
import sys
import typing
from yadi import listeners
class Scope(metaclass=abc.ABCMeta):
@property
@abc.abstractmethod
def name(self) -> str:
pass
@abc.abstractmethod
def get(self, key: str) -> typing.Optional[object]:
pass
@abc.abstractmethod
def set(self, key... | 0 | 700 | 0 | 65 | 0 | 0 | 0 | -25 | 403 |
920bbd298c739af9cfab836361ac97b3aaa1b339 | 4,863 | py | Python | setup.py | YSmart/YSmart | fdf442ed19559105cc6c8fdabca665603ec1aef6 | [
"Apache-2.0"
] | 10 | 2015-06-28T02:09:17.000Z | 2021-04-18T01:20:38.000Z | setup.py | YSmart/YSmart | fdf442ed19559105cc6c8fdabca665603ec1aef6 | [
"Apache-2.0"
] | null | null | null | setup.py | YSmart/YSmart | fdf442ed19559105cc6c8fdabca665603ec1aef6 | [
"Apache-2.0"
] | 8 | 2015-09-17T13:01:13.000Z | 2020-03-31T15:35:03.000Z | #!/usr/bin/env python
"""
Copyright (c) 2012 The Ohio State University.
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 req... | 41.211864 | 172 | 0.506683 | #!/usr/bin/env python
"""
Copyright (c) 2012 The Ohio State University.
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 req... | 0 | 0 | 0 | 0 | 0 | 3,919 | 0 | -15 | 159 |
a2513891f6a03d54c2d28ea72b15fcb9969af2b2 | 976 | py | Python | unit_tests/clients/create_pool.py | jaredlunde/cargo-orm | 1d5524d359bd52a991edc738982b7df2149d9c69 | [
"MIT"
] | 3 | 2017-02-10T08:03:21.000Z | 2017-02-25T04:55:48.000Z | unit_tests/clients/create_pool.py | jaredlunde/cargo-orm | 1d5524d359bd52a991edc738982b7df2149d9c69 | [
"MIT"
] | null | null | null | unit_tests/clients/create_pool.py | jaredlunde/cargo-orm | 1d5524d359bd52a991edc738982b7df2149d9c69 | [
"MIT"
] | null | null | null | #!/usr/bin/python3 -S
# -*- coding: utf-8 -*-
"""
`Unit tests for cargo.clients.create_pool`
------------------------------------------------------
2016 Jared Lunde The MIT License (MIT)
http://github.com/jaredlunde
"""
import unittest
if __name__ == '__main__':
# Unit test
unittest.main()
| 25.684211 | 80 | 0.61373 | #!/usr/bin/python3 -S
# -*- coding: utf-8 -*-
"""
`Unit tests for cargo.clients.create_pool`
--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--·--
2016 Jared Lunde © The MIT License (MIT)
http://github.com/jaredlunde
"""
import unittest
from multiprocessing import cpu_count
from ca... | 54 | 64 | 0 | 440 | 0 | 0 | 0 | 64 | 68 |
6790a9fa05d96e048617e89c7439e1a024eb557c | 1,637 | py | Python | scripts/polygon2cog_test.py | itko/scanbox | 9a00c11eafb4cc2faa69bfcc76bdf0d8e295dcf3 | [
"BSD-3-Clause"
] | 1 | 2020-01-09T09:30:23.000Z | 2020-01-09T09:30:23.000Z | scripts/polygon2cog_test.py | itko/scanbox | 9a00c11eafb4cc2faa69bfcc76bdf0d8e295dcf3 | [
"BSD-3-Clause"
] | 23 | 2018-03-19T20:54:52.000Z | 2018-05-16T12:36:59.000Z | scripts/polygon2cog_test.py | itko/scanbox | 9a00c11eafb4cc2faa69bfcc76bdf0d8e295dcf3 | [
"BSD-3-Clause"
] | 1 | 2018-03-14T20:00:43.000Z | 2018-03-14T20:00:43.000Z | import unittest
if __name__ == '__main__':
unittest.main()
| 37.204545 | 86 | 0.597434 | import polygon2cog as p2c
import unittest
import numpy as np
def normalize(v):
return v / np.linalg.norm(v)
class TestComputeNearestPoints(unittest.TestCase):
def test_general_close(self):
ray1 = (np.array([0,0,3]), normalize(np.array([3,2,-1]) - np.array([0,0,3])))
ray2 = (np.array([-3,0,0]),... | 0 | 0 | 0 | 1,425 | 0 | 29 | 0 | 1 | 113 |
1f621b763bacb3fda0ec7e2435b7a4eff36b6eed | 4,405 | py | Python | icecaps/decoding/basic_decoder_custom.py | janithwanni/icecaps | 15efca1b896478f37b520385d591ae8bbac3e0e1 | [
"MIT"
] | 277 | 2019-07-31T17:23:42.000Z | 2022-01-28T11:19:16.000Z | icecaps/decoding/basic_decoder_custom.py | janithwanni/icecaps | 15efca1b896478f37b520385d591ae8bbac3e0e1 | [
"MIT"
] | 15 | 2019-09-04T14:28:38.000Z | 2022-03-31T09:18:11.000Z | icecaps/decoding/basic_decoder_custom.py | janithwanni/icecaps | 15efca1b896478f37b520385d591ae8bbac3e0e1 | [
"MIT"
] | 47 | 2019-08-29T19:54:48.000Z | 2021-09-18T05:30:07.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
| 37.330508 | 95 | 0.657662 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import tensorflow as tf
from tensorflow.contrib.seq2seq.python.ops import basic_decoder
from tensorflow.python.framework import ops
from tensorflow.python.ops import nn_ops
from tensorflow.py... | 0 | 746 | 0 | 3,270 | 0 | 0 | 0 | 100 | 179 |
d96772e57682557ed5f4d64394823e3044fe3ddd | 4,666 | py | Python | voice_enhance/architectures/baseline/discriminator.py | ericlearning/Progressive-Image-Translation-Network | 972c54dfdbc4c065328f7fc54b2b47c2cefcc609 | [
"MIT"
] | 2 | 2019-05-11T12:25:55.000Z | 2019-10-17T16:10:34.000Z | voice_enhance/architectures/baseline/discriminator.py | ericlearning/Progressive-Image-Translation-Network | 972c54dfdbc4c065328f7fc54b2b47c2cefcc609 | [
"MIT"
] | null | null | null | voice_enhance/architectures/baseline/discriminator.py | ericlearning/Progressive-Image-Translation-Network | 972c54dfdbc4c065328f7fc54b2b47c2cefcc609 | [
"MIT"
] | null | null | null | import torch.nn as nn
| 31.106667 | 159 | 0.668453 | import math
import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.nn.utils.spectral_norm as SpectralNorm
def get_norm(norm_type, size):
if(norm_type == 'batchnorm'):
return nn.BatchNorm2d(size)
elif(norm_type == 'instancenorm'):
return nn.InstanceNorm2d(size)
class N... | 0 | 0 | 0 | 4,262 | 0 | 139 | 0 | 18 | 225 |
0d4bc0f5f535c2a14ab30e726f897a769f6a43fb | 269 | py | Python | afterglow_core/views/ajax_api/__init__.py | SkynetRTN/afterglow-access-server | 3d8d62f622577fdd1ae7b0076cb536251f7bf0cd | [
"Apache-2.0"
] | 2 | 2021-05-24T15:12:07.000Z | 2022-02-17T19:58:16.000Z | afterglow_core/views/ajax_api/__init__.py | SkynetRTN/afterglow-access-server | 3d8d62f622577fdd1ae7b0076cb536251f7bf0cd | [
"Apache-2.0"
] | 1 | 2022-02-27T03:01:06.000Z | 2022-02-27T03:01:06.000Z | afterglow_core/views/ajax_api/__init__.py | SkynetRTN/afterglow-access-server | 3d8d62f622577fdd1ae7b0076cb536251f7bf0cd | [
"Apache-2.0"
] | 2 | 2021-06-08T18:16:40.000Z | 2021-07-09T14:19:49.000Z | """
Afterglow Core: AJAX API endpoints
"""
url_prefix = '/ajax/'
| 14.157895 | 34 | 0.736059 | """
Afterglow Core: AJAX API endpoints
"""
url_prefix = '/ajax/'
from .app_authorizations import *
from .tokens import *
from .sessions import *
from .initialize import *
from .oauth2_providers import *
from .oauth2_clients import *
from .server_status import *
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 43 | 155 |
07316d4ee1496cde23d8a0d1f792c8012b4e7beb | 10,241 | py | Python | translators/cameras/interactive.py | Mango-3/blenderseed | e13f09becf396f1691c26a8d0bfff9cc05f75e42 | [
"MIT"
] | 256 | 2015-03-29T06:17:49.000Z | 2022-03-31T03:45:52.000Z | translators/cameras/interactive.py | Mango-3/blenderseed | e13f09becf396f1691c26a8d0bfff9cc05f75e42 | [
"MIT"
] | 366 | 2017-02-06T18:45:01.000Z | 2021-09-22T07:25:13.000Z | translators/cameras/interactive.py | Mango-3/blenderseed | e13f09becf396f1691c26a8d0bfff9cc05f75e42 | [
"MIT"
] | 56 | 2015-03-09T09:02:57.000Z | 2022-01-07T15:53:43.000Z | #
# This source file is part of appleseed.
# Visit http://appleseedhq.net/ for additional information and resources.
#
# This software is released under the MIT license.
#
# Copyright (c) 2019 Jonathan Dent, The appleseedhq Organization
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# ... | 38.212687 | 127 | 0.670052 | #
# This source file is part of appleseed.
# Visit http://appleseedhq.net/ for additional information and resources.
#
# This software is released under the MIT license.
#
# Copyright (c) 2019 Jonathan Dent, The appleseedhq Organization
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# ... | 0 | 41 | 0 | 8,694 | 0 | 0 | 0 | 17 | 136 |