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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
9cff5f10a44e765e3d80e0dd2f9eefb81aff5b65 | 242 | wsgi | Python | application.wsgi | cerivera/slicknot | 8c3570aefd7717038c9ddad5741cd6764e870a5e | [
"MIT"
] | 1 | 2018-01-29T19:18:12.000Z | 2018-01-29T19:18:12.000Z | application.wsgi | cerivera/slicknot | 8c3570aefd7717038c9ddad5741cd6764e870a5e | [
"MIT"
] | null | null | null | application.wsgi | cerivera/slicknot | 8c3570aefd7717038c9ddad5741cd6764e870a5e | [
"MIT"
] | null | null | null | import os, sys
PROJECT_DIR = '/www/slicknot'
activate_this = os.path.join(PROJECT_DIR, 'bin', 'activate_this.py')
execfile(activate_this, dict(__file__=activate_this))
sys.path.append(PROJECT_DIR)
| 20.166667 | 68 | 0.780992 | import os, sys
PROJECT_DIR = '/www/slicknot'
activate_this = os.path.join(PROJECT_DIR, 'bin', 'activate_this.py')
execfile(activate_this, dict(__file__=activate_this))
sys.path.append(PROJECT_DIR)
from slicknot import app as application
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 18 | 23 |
03276702f61644404540f29b73d17f28e61eec50 | 4,649 | py | Python | model_building.py | VivanVatsa/ds-salary-proj | b78b5498d2e3326799cae445ba47d6e6a5637ccb | [
"MIT"
] | 5 | 2020-12-30T06:17:19.000Z | 2021-12-14T21:26:57.000Z | model_building.py | VivanVatsa/ds-salary-proj | b78b5498d2e3326799cae445ba47d6e6a5637ccb | [
"MIT"
] | null | null | null | model_building.py | VivanVatsa/ds-salary-proj | b78b5498d2e3326799cae445ba47d6e6a5637ccb | [
"MIT"
] | 5 | 2021-01-19T14:06:34.000Z | 2022-02-25T15:57:16.000Z | #%%
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
df = pd.read_csv("data_eda.csv")
# choose the relevant columns
#%%
df.columns
#%%
df_model = df[[
"avg_salary",
"Rating",
"Size",
"Type of ownership",
"Industry",
"Sector",
"Revenue",
"num_comp",
"hourly",
... | 20.662222 | 78 | 0.569585 | #%%
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np
df = pd.read_csv("data_eda.csv")
# choose the relevant columns
#%%
df.columns
#%%
df_model = df[[
"avg_salary",
"Rating",
"Size",
"Type of ownership",
"Industry",
"Sector",
"Revenue",
"num_comp",
"hourly",
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f5f333a78a2c35bb1f7233264267a0be6328d43d | 1,397 | py | Python | moonfire_tokenomics/data/bond.py | moonfire-ventures/tokenomics | 4152bfd0e831262139ce50c6baae2748f19af850 | [
"MIT"
] | 2 | 2022-03-30T17:12:03.000Z | 2022-03-30T17:14:20.000Z | moonfire_tokenomics/data/bond.py | moonfire-ventures/tokenomics | 4152bfd0e831262139ce50c6baae2748f19af850 | [
"MIT"
] | null | null | null | moonfire_tokenomics/data/bond.py | moonfire-ventures/tokenomics | 4152bfd0e831262139ce50c6baae2748f19af850 | [
"MIT"
] | null | null | null | from moonfire_tokenomics.data_types import Allocation, AllocationRecord, Blockchain, Category, CommonType, Sector, Token
bond = Token(
name="BOND",
project="Barnbridge",
sector=Sector.DEFI,
blockchain=[Blockchain.ETH],
category=[Category.GOV],
capped=True,
allocations=[
Allocation(
... | 45.064516 | 120 | 0.652112 | from moonfire_tokenomics.data_types import Allocation, AllocationRecord, Blockchain, Category, CommonType, Sector, Token
bond = Token(
name="BOND",
project="Barnbridge",
sector=Sector.DEFI,
blockchain=[Blockchain.ETH],
category=[Category.GOV],
capped=True,
allocations=[
Allocation(
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
210b1c62d53e192545e5946ae8887183419aff3c | 3,315 | py | Python | recipe/test_imports.py | cryoem/eman-dependencies-feedstock | 74a2cc4d3abcec69dc3fff20761ce0191192eaea | [
"BSD-3-Clause"
] | null | null | null | recipe/test_imports.py | cryoem/eman-dependencies-feedstock | 74a2cc4d3abcec69dc3fff20761ce0191192eaea | [
"BSD-3-Clause"
] | 2 | 2020-04-28T13:38:02.000Z | 2020-09-07T10:57:03.000Z | recipe/test_imports.py | cryoem/eman-dependencies-feedstock | 74a2cc4d3abcec69dc3fff20761ce0191192eaea | [
"BSD-3-Clause"
] | 2 | 2020-04-28T13:32:13.000Z | 2020-09-07T10:44:19.000Z | from copy import copy
from os import path
from pprint import pprint
from time import time
import matplotlib
import matplotlib.cm
import matplotlib.mlab
import numpy
import os
import scipy
import scipy.ndimage
import tensorflow
import xml.etree.ElementTree
| 23.34507 | 59 | 0.855505 | from bisect import insort
from bsddb3 import db
from builtins import object
from builtins import range
from collections import Counter
from collections import MutableMapping
from collections import defaultdict
from copy import copy
from copy import deepcopy
from distutils.spawn import find_executable
from functools imp... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 243 | 2,816 |
4ed69dfa5da472187979c2575ab7e6ca57fb5151 | 315 | py | Python | molssi_2019/tests/test_molssi_2019.py | semodi/molssi_2019 | 42cf94c7f79abb35ce250345180e4b064bd13091 | [
"BSD-3-Clause"
] | null | null | null | molssi_2019/tests/test_molssi_2019.py | semodi/molssi_2019 | 42cf94c7f79abb35ce250345180e4b064bd13091 | [
"BSD-3-Clause"
] | null | null | null | molssi_2019/tests/test_molssi_2019.py | semodi/molssi_2019 | 42cf94c7f79abb35ce250345180e4b064bd13091 | [
"BSD-3-Clause"
] | null | null | null | """
Unit and regression test for the molssi_2019 package.
"""
# Import package, test suite, and other packages as needed
import sys
def test_molssi_2019_imported():
"""Sample test, will always pass so long as import statement worked"""
assert "molssi_2019" in sys.modules
| 24.230769 | 74 | 0.75873 | """
Unit and regression test for the molssi_2019 package.
"""
# Import package, test suite, and other packages as needed
import molssi_2019
import pytest
import sys
def test_molssi_2019_imported():
"""Sample test, will always pass so long as import statement worked"""
assert "molssi_2019" in sys.modules
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | -11 | 44 |
52a8b2f7dadef45b5615fdb467a4abca3a5ca5b3 | 1,082 | py | Python | config/api_router.py | BFSSI-Bioinformatics-Lab/bmh_lims | 02892449a2c17e629732f5580d62596a72b279b0 | [
"MIT"
] | null | null | null | config/api_router.py | BFSSI-Bioinformatics-Lab/bmh_lims | 02892449a2c17e629732f5580d62596a72b279b0 | [
"MIT"
] | 7 | 2020-09-28T13:42:56.000Z | 2021-01-28T15:48:10.000Z | config/api_router.py | bfssi-forest-dussault/bmh_lims | 02892449a2c17e629732f5580d62596a72b279b0 | [
"MIT"
] | 1 | 2021-01-18T18:15:18.000Z | 2021-01-18T18:15:18.000Z | from django.conf import settings
from rest_framework.routers import DefaultRouter, SimpleRouter
from bmh_lims.users.api.views import UserViewSet
from bmh_lims.database.api.views import SampleViewSet, WorkflowBatchViewSet, LabViewSet, ProjectViewSet, WorkflowSampleViewSet, WorkflowDefinitionViewSet, WorkflowSampleBatch... | 45.083333 | 120 | 0.829945 | from django.conf import settings
from rest_framework.routers import DefaultRouter, SimpleRouter
from bmh_lims.users.api.views import UserViewSet
from bmh_lims.database.api.views import SampleViewSet, WorkflowBatchViewSet, LabViewSet, ProjectViewSet, \
WorkflowSampleViewSet, WorkflowDefinitionViewSet, WorkflowSampl... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 0 |
ea62d75b5e2981df134663446712fdc9ea660c2e | 738 | py | Python | objects_classes.py | thethirdone-g/py_basics | f31782ecf309ad922add7b055f2315573b01a05c | [
"MIT"
] | null | null | null | objects_classes.py | thethirdone-g/py_basics | f31782ecf309ad922add7b055f2315573b01a05c | [
"MIT"
] | null | null | null | objects_classes.py | thethirdone-g/py_basics | f31782ecf309ad922add7b055f2315573b01a05c | [
"MIT"
] | null | null | null | # Classes are templates, objects are instances of that class.
# I'll use coins as examples of classes and objects :
coin1 = Penny() # Instantiating the coin class to this coin1 object.
print(type()) # Should print <class'__main__Penny'>
coin1.value # Should print out 1.0 | 19.945946 | 68 | 0.650407 | # Classes are templates, objects are instances of that class.
# I'll use coins as examples of classes and objects :
class Penny: # Defining the class.
def __init__(self, rare=False): # Defining a class method.
self.rare = rare
if self.rare:
self.value = 1.25
else:
self.value = 1.00
s... | 0 | 0 | 0 | 417 | 0 | 0 | 0 | 0 | 46 |
6f838b7b104692669ee23abeb686183ec82253d9 | 8,468 | py | Python | web-interface/graph_bak2.py | espoo-urban-planning/urbanplanningGAN | e921211b7a9f9f02d16e8f14ea29bf81139886c2 | [
"MIT"
] | null | null | null | web-interface/graph_bak2.py | espoo-urban-planning/urbanplanningGAN | e921211b7a9f9f02d16e8f14ea29bf81139886c2 | [
"MIT"
] | null | null | null | web-interface/graph_bak2.py | espoo-urban-planning/urbanplanningGAN | e921211b7a9f9f02d16e8f14ea29bf81139886c2 | [
"MIT"
] | null | null | null | import cv2
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import numpy
import math
img = cv2.imread('thinning.png',0)
nodes = []
nodeMap = np.empty([512, 512], dtype=int)
edgesOfNodes = []
edges = []
#I need list of all edges with duplicates
#[start id] [end id]
#each edge can have connectio... | 31.479554 | 163 | 0.58479 | import cv2
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
import numpy
import math
img = cv2.imread('thinning.png',0)
nodes = []
nodeMap = np.empty([512, 512], dtype=int)
edgesOfNodes = []
edges = []
#I need list of all edges with duplicates
#[start id] [end id]
#each edge can have connectio... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 33 | 90 |
25fa4b96a9be96bd8b09aef57043698d57061c46 | 2,897 | py | Python | parser.py | seungwonpark/shaynman | 21d11e686a183a0d5f30b280745cafe203a5b060 | [
"MIT"
] | null | null | null | parser.py | seungwonpark/shaynman | 21d11e686a183a0d5f30b280745cafe203a5b060 | [
"MIT"
] | 1 | 2017-08-04T12:14:29.000Z | 2017-08-06T10:17:19.000Z | parser.py | seungwonpark/shaynman | 21d11e686a183a0d5f30b280745cafe203a5b060 | [
"MIT"
] | null | null | null | import schedule
import time
with open('token.txt', 'r') as f:
bot_token = f.read().replace('\n','')
with open('secret.txt', 'r') as f:
err_bot_token, admin_no = f.read().replace('\n','').split(',')
handler()
schedule.every(1).minutes.do(handler)
while True:
schedule.run_pending()
time.sleep(1)
| 32.920455 | 131 | 0.614774 | from lecturelists import *
import requests
import re
import schedule
import time
with open('token.txt', 'r') as f:
bot_token = f.read().replace('\n','')
with open('secret.txt', 'r') as f:
err_bot_token, admin_no = f.read().replace('\n','').split(',')
def handler():
try:
job()
except Exception as e: #Connection... | 18 | 0 | 0 | 0 | 0 | 2,487 | 0 | -13 | 112 |
06065bdc7d1076d0090cc4d10c140b9fa7f7e796 | 925 | py | Python | src/MotorBase.py | LeoWhite/PiWars2020 | cd2bea0abf5519e8ad22d9d78f00bb43ceaea76f | [
"MIT"
] | null | null | null | src/MotorBase.py | LeoWhite/PiWars2020 | cd2bea0abf5519e8ad22d9d78f00bb43ceaea76f | [
"MIT"
] | 1 | 2020-01-01T21:53:41.000Z | 2020-01-01T21:53:41.000Z | src/MotorBase.py | LeoWhite/PiWars2020 | cd2bea0abf5519e8ad22d9d78f00bb43ceaea76f | [
"MIT"
] | null | null | null | #! /usr/bin/python3
# A Motor class used for abstraction purposes
| 25.694444 | 80 | 0.568649 | #! /usr/bin/python3
# A Motor class used for abstraction purposes
class MotorBase(object):
def __init__(self):
# As this is a stubbed out class there isn't anything we need to do here
# Possibly define some max ranges or other globals
#print("MotorBase init")
return
def set_l... | 0 | 0 | 0 | 835 | 0 | 0 | 0 | 0 | 23 |
7c56f8b011d5086b9774e046ac5ca3a34d47a91e | 923 | py | Python | shops/machine_learning_exercises/modules/toolbox/tester.py | mtaung/bazaar | 3b82ffaec3767b3412d5e0460f315b59329d613a | [
"MIT"
] | null | null | null | shops/machine_learning_exercises/modules/toolbox/tester.py | mtaung/bazaar | 3b82ffaec3767b3412d5e0460f315b59329d613a | [
"MIT"
] | null | null | null | shops/machine_learning_exercises/modules/toolbox/tester.py | mtaung/bazaar | 3b82ffaec3767b3412d5e0460f315b59329d613a | [
"MIT"
] | null | null | null | from sklearn.model_selection import StratifiedShuffleSplit
from sklearn.datasets import make_classification
from .scorer import Scorer
def test_classification(models, one_hot=False):
'''
'''
for name, model in models.items():
X, y = make_classification(
n_samples=10000,
n_... | 28.84375 | 68 | 0.603467 | from sklearn.model_selection import StratifiedShuffleSplit
from sklearn.datasets import make_classification
from .scorer import Scorer
def test_classification(models, one_hot=False):
'''
'''
for name, model in models.items():
X, y = make_classification(
n_samples=10000,
n_... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d45a741da36be48ed13b91ff8edd4695cff48d0e | 4,763 | py | Python | tests/memtest.py | DistrictDataLabs/minke | e41e8583f1386dbad5249aad740343c984832f1e | [
"MIT"
] | 14 | 2017-05-25T09:29:54.000Z | 2019-06-10T05:09:16.000Z | tests/memtest.py | DistrictDataLabs/minke | e41e8583f1386dbad5249aad740343c984832f1e | [
"MIT"
] | null | null | null | tests/memtest.py | DistrictDataLabs/minke | e41e8583f1386dbad5249aad740343c984832f1e | [
"MIT"
] | 9 | 2017-05-24T10:57:10.000Z | 2022-01-05T02:57:35.000Z | #!/usr/bin/env python
# tests.memtest
# Short script to exercise the corpus reader memory usage.
#
# Author: Benjamin Bengfort <bbengfort@districtdatalabs.com>
# Created: Tue Apr 19 16:38:28 2016 -0400
#
# Copyright (C) 2016 District Data Labs
# For license information, see LICENSE.txt
#
# ID: memtest.py [0753dd0] b... | 30.532051 | 86 | 0.512282 | #!/usr/bin/env python
# tests.memtest
# Short script to exercise the corpus reader memory usage.
#
# Author: Benjamin Bengfort <bbengfort@districtdatalabs.com>
# Created: Tue Apr 19 16:38:28 2016 -0400
#
# Copyright (C) 2016 District Data Labs
# For license information, see LICENSE.txt
#
# ID: memtest.py [0753dd0] b... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
394fc7a7e56281072fc62de2361607639b4f16fc | 561 | py | Python | tests/test_xpath.py | mattdennewitz/pat | 782ebf29a75ab9b35d45fc11d2eb7a50fa2f611b | [
"MIT"
] | null | null | null | tests/test_xpath.py | mattdennewitz/pat | 782ebf29a75ab9b35d45fc11d2eb7a50fa2f611b | [
"MIT"
] | null | null | null | tests/test_xpath.py | mattdennewitz/pat | 782ebf29a75ab9b35d45fc11d2eb7a50fa2f611b | [
"MIT"
] | null | null | null | import pytest
from lxml.etree import XPathEvalError
from pat import pat
def test_valid_xpath(html_blob):
"""Ensures a valid XPath produces results
"""
# extract only the first table
xpath = '/descendant::table[1]'
results = pat(html_blob, xpath_query=xpath)
assert len(results) == 1
def t... | 20.035714 | 49 | 0.69697 | import pytest
from lxml.etree import XPathEvalError
from pat import pat
def test_valid_xpath(html_blob):
"""Ensures a valid XPath produces results
"""
# extract only the first table
xpath = '/descendant::table[1]'
results = pat(html_blob, xpath_query=xpath)
assert len(results) == 1
def t... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a0fed588d0a32e06a6d2e00cceb4d66701cbb3d7 | 1,228 | py | Python | main/migrations/0002_auto_20191014_0247.py | washucode/instagram-clone | dccb76f49d7675ee0dcf3a4e2d55d2ad97262c3d | [
"MIT"
] | null | null | null | main/migrations/0002_auto_20191014_0247.py | washucode/instagram-clone | dccb76f49d7675ee0dcf3a4e2d55d2ad97262c3d | [
"MIT"
] | 6 | 2020-06-05T23:37:47.000Z | 2022-02-10T11:11:07.000Z | main/migrations/0002_auto_20191014_0247.py | washucode/instagram-clone | dccb76f49d7675ee0dcf3a4e2d55d2ad97262c3d | [
"MIT"
] | null | null | null | # Generated by Django 2.2.6 on 2019-10-14 02:47
| 37.212121 | 155 | 0.620521 | # Generated by Django 2.2.6 on 2019-10-14 02:47
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('main', '0001_initial'),
... | 0 | 0 | 0 | 1,048 | 0 | 0 | 0 | 41 | 90 |
6297fb7719bf66d24a8e3b576b31bc621b21b8e2 | 1,130 | py | Python | average.py | ChibiMuse/itc110-python-practice | 4be26e5b8ae753b57bc6e00eabde13ea1566e930 | [
"Apache-2.0"
] | null | null | null | average.py | ChibiMuse/itc110-python-practice | 4be26e5b8ae753b57bc6e00eabde13ea1566e930 | [
"Apache-2.0"
] | 1 | 2019-11-08T02:09:57.000Z | 2019-11-08T02:09:57.000Z | average.py | ChibiMuse/itc110-python-practice | 4be26e5b8ae753b57bc6e00eabde13ea1566e930 | [
"Apache-2.0"
] | null | null | null | #Programs that calculate the averages of numbers.
#call the program from main.
#The first program is for a set amount of three numbers.
#The second program is more flexible for a user defined amount of numbers.
main()
| 33.235294 | 104 | 0.624779 | #Programs that calculate the averages of numbers.
#call the program from main.
def main():
average_list()
#The first program is for a set amount of three numbers.
def average():
x,y,z = eval(input("Enter the three numbers you wish to average, seperated by commas (no spaces)"))
average = (x + y ... | 0 | 0 | 0 | 0 | 0 | 824 | 0 | 0 | 69 |
8cb6576c903f4062a9c0c904436f872cf4d43449 | 11,133 | py | Python | dp/infos.py | dico-api/dico-dp | 605930b381c4c11b0105333050e8de836b0c8bf3 | [
"MIT"
] | 6 | 2021-09-21T14:27:39.000Z | 2021-09-26T12:59:46.000Z | dp/infos.py | dico-api/dico-dp | 605930b381c4c11b0105333050e8de836b0c8bf3 | [
"MIT"
] | 1 | 2021-11-03T08:01:45.000Z | 2021-11-04T15:04:25.000Z | dp/infos.py | dico-api/dico-dp | 605930b381c4c11b0105333050e8de836b0c8bf3 | [
"MIT"
] | null | null | null |
try:
from dico_interaction import __version__ as __inter_version__
except ImportError:
__inter_version__ = None
privileged = ["GUILD_MEMBERS", "GUILD_PRESENCES"]
| 58.904762 | 163 | 0.584838 | import datetime
import platform
import dico
import dico_command
import psutil
from dico.utils import rgb
from . import __version__
from .utils import parse_bytesize, parse_second
try:
from dico_interaction import __version__ as __inter_version__
except ImportError:
__inter_version__ = None
privileged = ["GU... | 3 | 0 | 0 | 0 | 0 | 10,635 | 0 | 3 | 316 |
0e0f314e01c190a0b87ad7178b2cb55b45e887ab | 2,205 | py | Python | supervised_learning/regression/partial_least_squares_regression/sample.py | niektuytel/Machine_Learning | 0cd5656ca8076c383fd81c5e32a49969a20ad042 | [
"MIT"
] | 11 | 2021-07-05T15:51:35.000Z | 2022-03-19T15:17:37.000Z | supervised_learning/regression/partial_least_squares_regression/sample.py | niektuytel/Machine_Learning | 0cd5656ca8076c383fd81c5e32a49969a20ad042 | [
"MIT"
] | null | null | null | supervised_learning/regression/partial_least_squares_regression/sample.py | niektuytel/Machine_Learning | 0cd5656ca8076c383fd81c5e32a49969a20ad042 | [
"MIT"
] | null | null | null | import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.signal import savgol_filter
# dataset
data = pd.read_csv("../../../_data/peach_spectra_brix.csv")
data.head()
y_train = data['Brix'].values
x_train = data.values[:, 1:]
# Plot the mses
# Plot the data
wl = np.arange(1100, 2300, 2)
X... | 26.25 | 94 | 0.649887 | from sys import stdout
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from scipy.signal import savgol_filter
from sklearn.cross_decomposition import PLSRegression
from sklearn.model_selection import cross_val_predict
from sklearn.metrics import mean_squared_error, r2_score
# dataset
data = pd... | 0 | 0 | 0 | 0 | 0 | 769 | 0 | 100 | 134 |
790d18c000cbd34272ce5e58feb3eb2b358ab314 | 223 | py | Python | models/layer/__init__.py | LegenDong/IQIYI_VID_FACE_2019 | 258ff9282206e7b7074ed9ada5ef928bc9305ec6 | [
"MIT"
] | 17 | 2019-07-11T02:41:01.000Z | 2022-01-13T05:13:24.000Z | models/layer/__init__.py | xmpy/IQIYI_VID_FACE_2019 | 258ff9282206e7b7074ed9ada5ef928bc9305ec6 | [
"MIT"
] | 1 | 2021-04-16T15:37:12.000Z | 2021-04-17T13:46:57.000Z | models/layer/__init__.py | LegenDong/IQIYI_VID_FACE_2019 | 258ff9282206e7b7074ed9ada5ef928bc9305ec6 | [
"MIT"
] | 5 | 2019-07-23T02:18:04.000Z | 2021-07-14T03:42:32.000Z | # -*- coding: utf-8 -*-
# @Time : 2019/5/11 15:12
# @Author : LegenDong
# @User : legendong
# @File : __init__.py.py
# @Software: PyCharm
| 22.3 | 38 | 0.654709 | # -*- coding: utf-8 -*-
# @Time : 2019/5/11 15:12
# @Author : LegenDong
# @User : legendong
# @File : __init__.py.py
# @Software: PyCharm
from .channel_attention_layer import *
from .nan_attention_layer import *
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 30 | 45 |
ca94ec91014b313a97c2ffd31348b102ded4bc66 | 232 | py | Python | assistant/app/config.py | BugLight/fleetcor-assistant | c3d97d88ef94e5469d5e34c0d6ec7d2523144cdb | [
"MIT"
] | 1 | 2019-03-27T10:08:22.000Z | 2019-03-27T10:08:22.000Z | assistant/app/config.py | BugLight/fleetcor-assistant | c3d97d88ef94e5469d5e34c0d6ec7d2523144cdb | [
"MIT"
] | null | null | null | assistant/app/config.py | BugLight/fleetcor-assistant | c3d97d88ef94e5469d5e34c0d6ec7d2523144cdb | [
"MIT"
] | 1 | 2019-01-04T12:08:03.000Z | 2019-01-04T12:08:03.000Z | import os
from distutils.util import strtobool
DEBUG = strtobool(os.environ.get('DEBUG', 'yes'))
SECRET_KEY = os.environ.get('SECRET', 'defaultsecret')
APPLICATION_ROOT = '/api/assistant'
API_URL = 'http://localhost/api/accounts'
| 25.777778 | 54 | 0.75 | import os
from distutils.util import strtobool
DEBUG = strtobool(os.environ.get('DEBUG', 'yes'))
SECRET_KEY = os.environ.get('SECRET', 'defaultsecret')
APPLICATION_ROOT = '/api/assistant'
API_URL = 'http://localhost/api/accounts'
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
b113f64e4f1118eff553568098279f8785d3b50e | 3,034 | py | Python | metrics/tpr_norm_diff.py | predictive-analytics-lab/fairness-comparison | dacbe7b6557248e2c1c5cfcd46ddae76e0dd69b7 | [
"Apache-2.0"
] | 1 | 2020-02-26T23:20:37.000Z | 2020-02-26T23:20:37.000Z | metrics/tpr_norm_diff.py | predictive-analytics-lab/fairness-comparison | dacbe7b6557248e2c1c5cfcd46ddae76e0dd69b7 | [
"Apache-2.0"
] | 1 | 2018-11-08T16:24:07.000Z | 2018-11-08T16:24:07.000Z | metrics/tpr_norm_diff.py | predictive-analytics-lab/fairness-comparison | dacbe7b6557248e2c1c5cfcd46ddae76e0dd69b7 | [
"Apache-2.0"
] | null | null | null |
def calc_tpr_protected(actual, predicted, sensitive, unprotected_vals, positive_pred, is_tnr=False):
"""
Returns P(C=YES|Y=YES, sensitive=privileged) and P(C=YES|Y=YES, sensitive=not privileged)
in that order where C is the predicited classification and where all not privileged values are
considered... | 37.45679 | 100 | 0.669084 | import math
from metrics.Metric import Metric
class TPRNormDiff(Metric):
"""
This metric calculates the normalized TPR difference.
Multiple protected classes are treated as one large group, so that this compares the privileged
class to all non-privileged classes as a group.
"""
def __init__(... | 0 | 0 | 0 | 1,291 | 0 | 0 | 0 | 2 | 91 |
1634343acce8e3db9260ce1debd4c6846851305a | 16,381 | py | Python | python/tvm/topi/x86/conv2d_alter_op.py | new-TonyWang/tvm | 6b9f0abf935cbed82480326460eaaeb1a95bf9ca | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | null | null | null | python/tvm/topi/x86/conv2d_alter_op.py | new-TonyWang/tvm | 6b9f0abf935cbed82480326460eaaeb1a95bf9ca | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | null | null | null | python/tvm/topi/x86/conv2d_alter_op.py | new-TonyWang/tvm | 6b9f0abf935cbed82480326460eaaeb1a95bf9ca | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | null | null | null | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 39.567633 | 100 | 0.577376 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 90 | 14,917 | 0 | 0 | 0 | 0 | 0 | 115 | 244 |
aa40a5af94a5c85dd46a44f40a0f1372074a5eb9 | 8,922 | py | Python | BWSEditor.py | MinN-11/berwick-saga-editor-randomizer | afa641b99d0f95c3258c7e40878d50b9f5f24f9c | [
"MIT"
] | 3 | 2021-02-14T14:51:35.000Z | 2021-04-03T21:31:00.000Z | BWSEditor.py | MinN-11/berwick-saga-editor-randomizer | afa641b99d0f95c3258c7e40878d50b9f5f24f9c | [
"MIT"
] | null | null | null | BWSEditor.py | MinN-11/berwick-saga-editor-randomizer | afa641b99d0f95c3258c7e40878d50b9f5f24f9c | [
"MIT"
] | null | null | null |
# returns value and modify_mode
if __name__ == '__main__':
main()
| 44.834171 | 124 | 0.503138 | import sys
import os
from BWSTableEditors import *
# returns value and modify_mode
def try_eval(s):
try:
if s == "max":
return 101, 0
sgn = 1 if s.startswith("+") else -1 if s.startswith("-") else 2 if s.startswith("*") else 0
val = abs(int(s, 0))
return val, sgn
ex... | 0 | 0 | 0 | 0 | 0 | 8,679 | 0 | -15 | 180 |
0acb2abd3627f3403761f2b1aacbf4765ae67e00 | 1,623 | py | Python | geotrek/altimetry/urls.py | jmdecastel/GEOTADMIN | 15547c0a99ae4c541ca517cdbc2cf17ab5c96f87 | [
"BSD-2-Clause"
] | null | null | null | geotrek/altimetry/urls.py | jmdecastel/GEOTADMIN | 15547c0a99ae4c541ca517cdbc2cf17ab5c96f87 | [
"BSD-2-Clause"
] | null | null | null | geotrek/altimetry/urls.py | jmdecastel/GEOTADMIN | 15547c0a99ae4c541ca517cdbc2cf17ab5c96f87 | [
"BSD-2-Clause"
] | null | null | null | from django.conf import settings
from django.conf.urls import patterns, url
from geotrek.altimetry.views import (serve_elevation_chart)
urlpatterns = patterns(
'',
url(r'^%s/profiles/(?P<model_name>.+)-(?P<pk>\d+).png$' % settings.MEDIA_URL.strip('/'), serve_elevation_chart),
)
| 43.864865 | 116 | 0.642021 | from django.conf import settings
from django.conf.urls import patterns, url
from mapentity.registry import MapEntityOptions
from geotrek.altimetry.views import (ElevationProfile, ElevationChart,
ElevationArea, serve_elevation_chart)
urlpatterns = patterns(
'',
url(r'^%s/p... | 0 | 0 | 0 | 1,175 | 0 | 0 | 0 | 112 | 45 |
dd1d5dab9dbb4e8ddbb10ae378ba9a29e4da0a03 | 17,948 | py | Python | pyfec/utils.py | newsdev/nyt-pyfec | 3504ddb2dbcb08b51a9fd9eb55bdf7974f79cd35 | [
"Apache-2.0"
] | 26 | 2015-09-01T00:38:57.000Z | 2020-02-13T04:18:02.000Z | pyfec/utils.py | newsdev/nyt-pyfec | 3504ddb2dbcb08b51a9fd9eb55bdf7974f79cd35 | [
"Apache-2.0"
] | 19 | 2015-08-31T20:21:58.000Z | 2017-06-29T15:02:22.000Z | pyfec/utils.py | newsdev/nyt-pyfec | 3504ddb2dbcb08b51a9fd9eb55bdf7974f79cd35 | [
"Apache-2.0"
] | 4 | 2016-03-17T16:45:40.000Z | 2019-08-14T20:15:19.000Z | import datetime
from dateutil import parser
SCHEDULE_FIELDS = {'A': ['back_reference_sched_name', 'back_reference_tran_id_number', 'conduit_city', 'conduit_name', 'conduit_state', 'conduit_street1', 'conduit_street2', 'conduit_zip', 'contribution_aggregate', 'contribution_amount', 'contribution_date', 'contribution_d... | 48.771739 | 3,845 | 0.722086 | import datetime
import exceptions
import string
from dateutil import parser
SCHEDULE_FIELDS = {'A': ['back_reference_sched_name', 'back_reference_tran_id_number', 'conduit_city', 'conduit_name', 'conduit_state', 'conduit_street1', 'conduit_street2', 'conduit_zip', 'contribution_aggregate', 'contribution_amount', 'con... | 0 | 0 | 0 | 209 | 0 | 3,850 | 0 | -12 | 227 |
d768c057eb38ac111019977c81f1eff0551e1d03 | 348 | py | Python | app.py | Baltasarq/Equations | edbc280dc3cf7bf5f58a4a7699914b55ae7ab30f | [
"MIT"
] | null | null | null | app.py | Baltasarq/Equations | edbc280dc3cf7bf5f58a4a7699914b55ae7ab30f | [
"MIT"
] | null | null | null | app.py | Baltasarq/Equations | edbc280dc3cf7bf5f58a4a7699914b55ae7ab30f | [
"MIT"
] | null | null | null | # Equation (c) Baltasar 2019 MIT License <baltasarq@gmail.com>
from solver.solve import solve
from parser import parser
if __name__ == "__main__":
eqs = parser("x = 5 + 3\n2 = y + 3\nz = x + y")
print("\n".join([str(eq) for eq in eqs]))
print(solve(eqs))
| 29 | 62 | 0.692529 | # Equation (c) Baltasar 2019 MIT License <baltasarq@gmail.com>
from equations.Equation import Equation
from equations.Component import create
from solver.solve import solve
from parser import parser
if __name__ == "__main__":
eqs = parser("x = 5 + 3\n2 = y + 3\nz = x + y")
print("\n".join([str(eq) for eq in e... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 35 | 45 |
3430ee88d3d75e2011879961cc8ae0ca3e966ae2 | 51 | py | Python | app.py | akolpakov/aiortc-media-proxy | dfa6b7de6ceddcde53f78998b9d286b45dc54eb0 | [
"MIT"
] | 3 | 2020-04-18T13:38:22.000Z | 2020-06-05T15:48:12.000Z | app.py | akolpakov/aiortc-media-proxy | dfa6b7de6ceddcde53f78998b9d286b45dc54eb0 | [
"MIT"
] | null | null | null | app.py | akolpakov/aiortc-media-proxy | dfa6b7de6ceddcde53f78998b9d286b45dc54eb0 | [
"MIT"
] | 1 | 2019-12-19T03:58:36.000Z | 2019-12-19T03:58:36.000Z | from aiortc_media_proxy.server import init
init()
| 12.75 | 42 | 0.823529 | from aiortc_media_proxy.server import init
init()
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
4f7eadeff29e825eecd011fae2e486b757106c64 | 7,752 | py | Python | experiments/SciTail_NLI/benchmark_paraphrases_generation.py | matejklemen/paraphrase-nli | d31ecba7e54eea4c3b098a2de7bc35f538e4e6dc | [
"MIT"
] | null | null | null | experiments/SciTail_NLI/benchmark_paraphrases_generation.py | matejklemen/paraphrase-nli | d31ecba7e54eea4c3b098a2de7bc35f538e4e6dc | [
"MIT"
] | null | null | null | experiments/SciTail_NLI/benchmark_paraphrases_generation.py | matejklemen/paraphrase-nli | d31ecba7e54eea4c3b098a2de7bc35f538e4e6dc | [
"MIT"
] | null | null | null | import json
import logging
import os
import sys
from argparse import ArgumentParser
import re
import numpy as np
import pandas as pd
import torch
from transformers import GPT2Tokenizer
from src.data.cleaning import mask_not_na, inds_unique, mask_long_enough
from src.data.nli import TransformersSeqPairDataset
from src... | 43.307263 | 149 | 0.736197 | import json
import logging
import os
import sys
from argparse import ArgumentParser
import re
import numpy as np
import pandas as pd
import torch
from transformers import GPT2Tokenizer
from src.data.cleaning import mask_not_na, inds_unique, mask_long_enough
from src.data.nli import TransformersSeqPairDataset
from src... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ff06a26e195f45d4e02f514792879b2884a560fc | 2,798 | py | Python | build.py | Prodesire/py-terraform | 693d30a20226bffa74781c97b6a394c5f85a8509 | [
"MIT"
] | 6 | 2022-03-10T16:23:12.000Z | 2022-03-31T14:51:49.000Z | build.py | Prodesire/py-libterraform | 693d30a20226bffa74781c97b6a394c5f85a8509 | [
"MIT"
] | null | null | null | build.py | Prodesire/py-libterraform | 693d30a20226bffa74781c97b6a394c5f85a8509 | [
"MIT"
] | null | null | null | import os
import platform
import shutil
import subprocess
lib_filename = 'libterraform.dll' if platform.system() == 'Windows' else 'libterraform.so'
header_filename = 'libterraform.h'
tf_filename = 'libterraform.go'
root = os.path.dirname(os.path.abspath(__file__))
terraform_dirname = os.path.join(root, 'terraform')
t... | 38.328767 | 100 | 0.681201 | import os
import platform
import shutil
import subprocess
lib_filename = 'libterraform.dll' if platform.system() == 'Windows' else 'libterraform.so'
header_filename = 'libterraform.h'
tf_filename = 'libterraform.go'
root = os.path.dirname(os.path.abspath(__file__))
terraform_dirname = os.path.join(root, 'terraform')
t... | 0 | 0 | 0 | 16 | 0 | 0 | 0 | 0 | 23 |
1573004c99f4375476e86f102a2a42a240037366 | 1,523 | py | Python | evaluate_baseline.py | Leon-Francis/AttackViaGan | 9924f48a7540dd2765d9c0f7ab90ca5ce100370b | [
"Apache-2.0"
] | 2 | 2021-01-23T13:20:17.000Z | 2021-04-23T11:47:34.000Z | evaluate_baseline.py | Leon-Francis/AttackViaGan | 9924f48a7540dd2765d9c0f7ab90ca5ce100370b | [
"Apache-2.0"
] | null | null | null | evaluate_baseline.py | Leon-Francis/AttackViaGan | 9924f48a7540dd2765d9c0f7ab90ca5ce100370b | [
"Apache-2.0"
] | null | null | null | from torch.utils.data import DataLoader
from baseline_module.baseline_model_builder import BaselineModelBuilder
from config import BaselineConfig
from data import AGNEWS_Dataset
from tools import logging
if __name__ == "__main__":
baseline_model_builder = BaselineModelBuilder('AGNEWS',
... | 38.075 | 78 | 0.571898 | import torch
from torch.utils.data import DataLoader
from baseline_module.baseline_model_builder import BaselineModelBuilder
from config import BaselineConfig
from data import AGNEWS_Dataset
from tools import logging
def eval_bert_baseline_Classification(model, test_data):
with torch.no_grad():
model.eval... | 0 | 0 | 0 | 0 | 0 | 517 | 0 | -9 | 45 |
377d1da4c41259fc9b3f391ea595e799c747d6ce | 6,482 | py | Python | crys3d/images.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 155 | 2016-11-23T12:52:16.000Z | 2022-03-31T15:35:44.000Z | crys3d/images.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 590 | 2016-12-10T11:31:18.000Z | 2022-03-30T23:10:09.000Z | crys3d/images.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 115 | 2016-11-15T08:17:28.000Z | 2022-02-09T15:30:14.000Z | from __future__ import absolute_import, division, print_function
from gltbx.images import img_data
inspector_img = img_data(width=32, height=32, mask=-1, encoded_data = """\
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff... | 76.258824 | 79 | 0.9693 | from __future__ import absolute_import, division, print_function
from gltbx.images import img_data
inspector_img = img_data(width=32, height=32, mask=-1, encoded_data = """\
ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff\
fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
2642d690f2672a2901ae9c2eb20410281abc4095 | 581 | py | Python | day04/tests.py | andrewyang96/AdventOfCode2017 | 665d7869fb8677f41c07ca2177b4fe3ea3356fec | [
"MIT"
] | null | null | null | day04/tests.py | andrewyang96/AdventOfCode2017 | 665d7869fb8677f41c07ca2177b4fe3ea3356fec | [
"MIT"
] | null | null | null | day04/tests.py | andrewyang96/AdventOfCode2017 | 665d7869fb8677f41c07ca2177b4fe3ea3356fec | [
"MIT"
] | null | null | null | from solution import valid
from solution import valid2
with open('input.txt', 'r') as f:
passphrases = [p.split() for p in f]
assert valid(['aa bb cc dd ee'.split()]) == 1
assert valid(['aa bb cc dd aa'.split()]) == 0
assert valid(['aa bb cc dd aaa'.split()]) == 1
print(valid(passphrases))
assert valid2(['abcde... | 29.05 | 56 | 0.654045 | from solution import valid
from solution import valid2
with open('input.txt', 'r') as f:
passphrases = [p.split() for p in f]
assert valid(['aa bb cc dd ee'.split()]) == 1
assert valid(['aa bb cc dd aa'.split()]) == 0
assert valid(['aa bb cc dd aaa'.split()]) == 1
print(valid(passphrases))
assert valid2(['abcde... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
36e97263472cf2adb806fde3bfccf423d921435c | 745 | py | Python | webscraping_basic/3_requests.py | tunealog/python-web-scraping | 0d625fb610f5a0979a008c2e2c9ddd31d8ef9c17 | [
"MIT"
] | null | null | null | webscraping_basic/3_requests.py | tunealog/python-web-scraping | 0d625fb610f5a0979a008c2e2c9ddd31d8ef9c17 | [
"MIT"
] | null | null | null | webscraping_basic/3_requests.py | tunealog/python-web-scraping | 0d625fb610f5a0979a008c2e2c9ddd31d8ef9c17 | [
"MIT"
] | null | null | null | # Python Web Scraping
# Title : requests
# Date : 2020-08-10
# Creator : tunealog
import requests
res = requests.get("https://google.com")
res_err = requests.get("https://tunealog.tistory.com")
# Response Code : 200 - No Problem
print("Response Code : ", res.status_code)
# Response Code : 403 - Problem
print("Respo... | 21.285714 | 59 | 0.699329 | # Python Web Scraping
# Title : requests
# Date : 2020-08-10
# Creator : tunealog
import requests
res = requests.get("https://google.com")
res_err = requests.get("https://tunealog.tistory.com")
# Response Code : 200 - No Problem
print("Response Code : ", res.status_code)
# Response Code : 403 - Problem
print("Respo... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9d6c5c728f45b4edd74f62890bac92d23e290a4d | 10,625 | py | Python | get_cdf/get_new.py | 2218084076/hotpoor_autoclick_xhs | a52446ba691ac19e43410a465dc63f940c0e444d | [
"Apache-2.0"
] | 1 | 2021-12-21T10:42:46.000Z | 2021-12-21T10:42:46.000Z | get_cdf/get_new.py | 2218084076/hotpoor_autoclick_xhs | a52446ba691ac19e43410a465dc63f940c0e444d | [
"Apache-2.0"
] | null | null | null | get_cdf/get_new.py | 2218084076/hotpoor_autoclick_xhs | a52446ba691ac19e43410a465dc63f940c0e444d | [
"Apache-2.0"
] | null | null | null |
# 921.6
# 2022/01/15
urls = ["tomford-product.html?productId=400463&goodsId=524636&warehouseId=10","tomford-product.html?productId=413813&goodsId=537981&warehouseId=10","tomford-product.html?productId=438131&goodsId=562140&warehouseId=10","tomford-product.html?productId=424801&goodsId=548831&warehouseId=10","tomford-... | 42.5 | 638 | 0.631718 | import pyautogui
import time
import pyperclip
# 打开审查元素位置 921.6
# 2022/01/15
urls = ["tomford-product.html?productId=400463&goodsId=524636&warehouseId=10","tomford-product.html?productId=413813&goodsId=537981&warehouseId=10","tomford-product.html?productId=438131&goodsId=562140&warehouseId=10","tomford-product.html?pro... | 132 | 0 | 0 | 0 | 0 | 3,724 | 0 | -20 | 89 |
16903ef30258ce12cb9916656c7ebd3f6213b1f7 | 7,049 | py | Python | vscvs/trainers/gan/bimodal.py | fcoclavero/vscvs | 27fab0bc62fb68da044cf6f2516e3c1853f77533 | [
"MIT"
] | 1 | 2019-07-02T19:07:15.000Z | 2019-07-02T19:07:15.000Z | vscvs/trainers/gan/bimodal.py | fcoclavero/vscvs | 27fab0bc62fb68da044cf6f2516e3c1853f77533 | [
"MIT"
] | 2 | 2019-10-23T18:05:37.000Z | 2020-09-25T14:16:25.000Z | vscvs/trainers/gan/bimodal.py | fcoclavero/vscvs | 27fab0bc62fb68da044cf6f2516e3c1853f77533 | [
"MIT"
] | null | null | null | __author__ = ["Francisco Clavero"]
__email__ = ["fcoclavero32@gmail.com"]
__status__ = "Prototype"
""" Ignite trainer for a Bimodal GAN architecture. """
| 34.553922 | 120 | 0.690311 | __author__ = ["Francisco Clavero"]
__email__ = ["fcoclavero32@gmail.com"]
__status__ = "Prototype"
""" Ignite trainer for a Bimodal GAN architecture. """
from abc import ABC
from typing import Callable
from overrides import overrides
from torch.nn import BCEWithLogitsLoss
from vscvs.decorators import kwargs_param... | 3 | 3,891 | 0 | 2,049 | 0 | 0 | 0 | 455 | 492 |
ba149ce8aa60390d3862afc64bf0e16b50dbdc9b | 802 | py | Python | diin_text/_nbdev.py | pandya6988/diin_text | 85c37fef41ef48c65ce03a94bb3cacb8af5dc1b1 | [
"Apache-2.0"
] | null | null | null | diin_text/_nbdev.py | pandya6988/diin_text | 85c37fef41ef48c65ce03a94bb3cacb8af5dc1b1 | [
"Apache-2.0"
] | null | null | null | diin_text/_nbdev.py | pandya6988/diin_text | 85c37fef41ef48c65ce03a94bb3cacb8af5dc1b1 | [
"Apache-2.0"
] | null | null | null | # AUTOGENERATED BY NBDEV! DO NOT EDIT!
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"generate_translator": "00_data.ipynb",
"default_translator_path": "00_data.ipynb",
"strip_html": "00_data.ipynb",
"OriTraTranslation": "00_data.ipynb",
"create_ori_trans_d... | 33.416667 | 65 | 0.662095 | # AUTOGENERATED BY NBDEV! DO NOT EDIT!
__all__ = ["index", "modules", "custom_doc_links", "git_url"]
index = {"generate_translator": "00_data.ipynb",
"default_translator_path": "00_data.ipynb",
"strip_html": "00_data.ipynb",
"OriTraTranslation": "00_data.ipynb",
"create_ori_trans_d... | 0 | 0 | 0 | 0 | 0 | 18 | 0 | 0 | 23 |
a197bb1579d24a5fd6de9e10d9e2bc6e9a52065d | 5,841 | py | Python | nonutils/service.py | 233a344a455/nbutils | 9c99e22ef7efe6574560ac5eaa9a9b5d7f9305f5 | [
"MIT"
] | null | null | null | nonutils/service.py | 233a344a455/nbutils | 9c99e22ef7efe6574560ac5eaa9a9b5d7f9305f5 | [
"MIT"
] | null | null | null | nonutils/service.py | 233a344a455/nbutils | 9c99e22ef7efe6574560ac5eaa9a9b5d7f9305f5 | [
"MIT"
] | null | null | null | from typing import Dict
# A dict for preserving all maintained services
# {sv_name: sv_obj}
services: Dict[str, Service] = {}
| 39.734694 | 119 | 0.57045 | from typing import Optional, Union, Tuple, Set, List, Dict
from loguru import logger
from nonebot.adapters import Bot, Event
from nonebot.handler import Handler
from nonebot.permission import Permission
from nonebot.typing import T_Handler
from nonutils.command import Command
from nonutils.stringres import Rstr
cla... | 393 | 493 | 0 | 4,774 | 0 | 0 | 0 | 135 | 179 |
6438de08e30fd66867fea62cd5246b7e44b99eeb | 261 | py | Python | mysite/medicare/admin.py | marufahmedtushar/Medi_Care | bc3dc9449924cfaf6fa1e0e8795af84169e45f69 | [
"Apache-2.0"
] | null | null | null | mysite/medicare/admin.py | marufahmedtushar/Medi_Care | bc3dc9449924cfaf6fa1e0e8795af84169e45f69 | [
"Apache-2.0"
] | null | null | null | mysite/medicare/admin.py | marufahmedtushar/Medi_Care | bc3dc9449924cfaf6fa1e0e8795af84169e45f69 | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from . models import Doctor, Contact, Prescription_pictures, Bloodds
# Register your models here.
admin.site.register(Doctor)
admin.site.register(Contact)
admin.site.register(Prescription_pictures)
admin.site.register(Bloodds)
| 23.727273 | 66 | 0.827586 | from django.contrib import admin
from . models import Doctor, Contact,Prescription_pictures,Bloodds
# Register your models here.
admin.site.register(Doctor)
admin.site.register(Contact)
admin.site.register(Prescription_pictures)
admin.site.register(Bloodds)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | -2 | 0 |
d709f5b90555e0dc86e0736188bacceed10eacfd | 9,285 | py | Python | pulotu/scripts/initializedb.py | clld/pulotu | 85c8590ca05ce0c98deb4ca1fada94d7597d46f0 | [
"Apache-2.0"
] | null | null | null | pulotu/scripts/initializedb.py | clld/pulotu | 85c8590ca05ce0c98deb4ca1fada94d7597d46f0 | [
"Apache-2.0"
] | 1 | 2021-11-19T16:50:11.000Z | 2021-11-19T16:55:17.000Z | pulotu/scripts/initializedb.py | clld/pulotu | 85c8590ca05ce0c98deb4ca1fada94d7597d46f0 | [
"Apache-2.0"
] | 1 | 2021-11-22T13:28:14.000Z | 2021-11-22T13:28:14.000Z | import itertools
from sqlalchemy.orm import joinedload
from clld.db.meta import DBSession
from clld.db.models import common
def prime_cache(args):
"""If data needs to be denormalized for lookup, do that here.
This procedure should be separate from the db initialization, because
it will have to be ru... | 35.037736 | 113 | 0.559612 | import math
import itertools
import collections
from sqlalchemy.orm import joinedload
from pycldf import Sources
from clldutils.misc import nfilter
from clldutils.color import qualitative_colors
from clldutils.text import strip_brackets
from clld.cliutil import Data, bibtex2source
from clld.db.meta import DBSession
fr... | 0 | 252 | 0 | 1,254 | 0 | 6,644 | 0 | 69 | 335 |
417ccc7cfe1255124924924d235b9828253ed24c | 880 | py | Python | model/time_series/facebook_prophet.py | ibodumas/missing_stock_prices | ce2429cf91d5bd863093d32a56c1158eb2dc6a09 | [
"MIT"
] | 1 | 2020-06-10T06:58:06.000Z | 2020-06-10T06:58:06.000Z | model/time_series/facebook_prophet.py | ibodumas/missing_stock_prices | ce2429cf91d5bd863093d32a56c1158eb2dc6a09 | [
"MIT"
] | null | null | null | model/time_series/facebook_prophet.py | ibodumas/missing_stock_prices | ce2429cf91d5bd863093d32a56c1158eb2dc6a09 | [
"MIT"
] | 1 | 2021-05-08T18:12:19.000Z | 2021-05-08T18:12:19.000Z | ##
from model import data_processing
import util
import pandas as pd
from sklearn import metrics
from sklearn.model_selection import GridSearchCV
from model.estimator import FBProphetEstimator
x_train = pd.DataFrame({"ds": data_processing.X_TRAIN})
y_train = pd.DataFrame({"y": data_processing.Y_TRAIN})
x_test = pd.Da... | 28.387097 | 76 | 0.790909 | ##
from model import data_processing
import util
import pandas as pd
from sklearn import metrics
from sklearn.model_selection import GridSearchCV
from model.estimator import FBProphetEstimator
x_train = pd.DataFrame({"ds": data_processing.X_TRAIN})
y_train = pd.DataFrame({"y": data_processing.Y_TRAIN})
x_test = pd.Da... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
13a33ba2146ac36be8c8fa249ed8bfada92b8894 | 12,196 | py | Python | python/oneflow/utils/vision/transforms/functional_tensor.py | grybd/oneflow | 82237ad096a10527591660c09b61444c42917e69 | [
"Apache-2.0"
] | 3,285 | 2020-07-31T05:51:22.000Z | 2022-03-31T15:20:16.000Z | python/oneflow/utils/vision/transforms/functional_tensor.py | grybd/oneflow | 82237ad096a10527591660c09b61444c42917e69 | [
"Apache-2.0"
] | 2,417 | 2020-07-31T06:28:58.000Z | 2022-03-31T23:04:14.000Z | python/oneflow/utils/vision/transforms/functional_tensor.py | grybd/oneflow | 82237ad096a10527591660c09b61444c42917e69 | [
"Apache-2.0"
] | 520 | 2020-07-31T05:52:42.000Z | 2022-03-29T02:38:11.000Z | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 31.760417 | 88 | 0.618235 | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 0 | 0 | 0 | 0 | 0 | 11,121 | 0 | 36 | 434 |
9bd9fead80fab142ddf05e946efead66aa45d8f5 | 1,599 | py | Python | shop/__main__.py | techieji/shop | 48296856ebf0dd2b3940115d444053da060954eb | [
"MIT"
] | null | null | null | shop/__main__.py | techieji/shop | 48296856ebf0dd2b3940115d444053da060954eb | [
"MIT"
] | null | null | null | shop/__main__.py | techieji/shop | 48296856ebf0dd2b3940115d444053da060954eb | [
"MIT"
] | null | null | null | from .svm import Shop, DummyShop
shop = w if (w := Shop.load(silent=True)) else DummyShop()
cli.add_command(init)
cli.add_command(save)
cli.add_command(backup)
cli.add_command(restore)
cli.add_command(revert)
cli.add_command(advance)
cli.add_command(inspect)
cli.add_command(debug)
if __name__ == '__main__':
cli(... | 23.173913 | 90 | 0.688555 | import click
from halo import Halo
from .svm import Shop, DummyShop
from .exceptions import Failure
shop = w if (w := Shop.load(silent=True)) else DummyShop()
@click.group()
def cli():
pass
@click.command()
def init():
shop = Shop.init()
@click.command()
@click.option('--reason', help="The changes made in t... | 0 | 851 | 0 | 0 | 0 | 129 | 0 | 1 | 296 |
43512a863cacc4ef4c5bf6201f4ffd0cebcc7712 | 4,820 | py | Python | setup.py | AndreasDa/tftpy | c39fa7e1a32ca570ecf17de2be9eebe223e13be7 | [
"MIT"
] | null | null | null | setup.py | AndreasDa/tftpy | c39fa7e1a32ca570ecf17de2be9eebe223e13be7 | [
"MIT"
] | null | null | null | setup.py | AndreasDa/tftpy | c39fa7e1a32ca570ecf17de2be9eebe223e13be7 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf8 -*-
# vim: ts=4 sw=4 et ai:
from distutils.core import setup
long_description = """\
Copyright, Michael P. Soulier, 2010.
About Release 0.7.0:
====================
Various bugfixes and refactoring for improved logging.
Now requiring python 2.7+ and tightening syntax in
prepar... | 30.506329 | 78 | 0.681535 | #!/usr/bin/env python
# -*- coding: utf8 -*-
# vim: ts=4 sw=4 et ai:
from distutils.core import setup
long_description = """\
Copyright, Michael P. Soulier, 2010.
About Release 0.7.0:
====================
Various bugfixes and refactoring for improved logging.
Now requiring python 2.7+ and tightening syntax in
prepar... | 2 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d5687372a3adcc0e9868726b8869e0d3d8042fca | 6,962 | py | Python | BALMOREL add-on/ResidEVHPaggr_step2.py | pietrononis94/ResidentialFlexAddon_Thesis | 58788361cf2e16504cf72189b4266b92335e57a6 | [
"MIT"
] | null | null | null | BALMOREL add-on/ResidEVHPaggr_step2.py | pietrononis94/ResidentialFlexAddon_Thesis | 58788361cf2e16504cf72189b4266b92335e57a6 | [
"MIT"
] | null | null | null | BALMOREL add-on/ResidEVHPaggr_step2.py | pietrononis94/ResidentialFlexAddon_Thesis | 58788361cf2e16504cf72189b4266b92335e57a6 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
### This file reads optimal load scheduling from Julia ouput and generates aggregated
### consumption of alll categories, as in as in section 7.2.3 - step 2, following project report.
### Result is saved in csv and then converted to inc from xls2gdx ibrary in excel VBA.
# Sce... | 65.679245 | 205 | 0.66547 | import gdxpds as gd
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
### This file reads optimal load scheduling from Julia ouput and generates aggregated
### consumption of alll categories, as in as in section 7.2.3 - step 2, following project report.
### Result is saved in csv and then conver... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 44 |
1199b5605411281efc3d3e2427992389c3aaa429 | 2,263 | py | Python | numba/tests/extension_types/test_extension_types.py | glycerine/numba | 4cb9e4f0b3cabd9e6a144fa4f3f7e5d6bee45635 | [
"BSD-2-Clause"
] | 1 | 2019-04-17T10:03:53.000Z | 2019-04-17T10:03:53.000Z | numba/tests/extension_types/test_extension_types.py | glycerine/numba | 4cb9e4f0b3cabd9e6a144fa4f3f7e5d6bee45635 | [
"BSD-2-Clause"
] | null | null | null | numba/tests/extension_types/test_extension_types.py | glycerine/numba | 4cb9e4f0b3cabd9e6a144fa4f3f7e5d6bee45635 | [
"BSD-2-Clause"
] | null | null | null |
if __name__ == '__main__':
import doctest
doctest.testmod() | 21.552381 | 83 | 0.581529 | import sys
from numba import extension_types
from numba import *
def format_str(msg, *values):
return msg % values
@jit
class MyExtension(object):
"""
>>> obj = MyExtension(10.0)
>>> obj.value
10.0
>>> obj._numba_attrs.value
10.0
>>> obj.setvalue(20.0)
>>> obj.getvalue()
20.0
... | 0 | 2,028 | 0 | 0 | 0 | 32 | 0 | -1 | 136 |
858fde1af5dfea5919675159c8eeb0d0fcc04ab4 | 300 | py | Python | setup.py | pgaudillere/alesisvsysex | 08f6f89804dd2972594d05b790a9023f7bf2de41 | [
"MIT"
] | 9 | 2017-11-13T14:58:25.000Z | 2019-09-30T19:14:09.000Z | setup.py | pgaudillere/alesisvsysex | 08f6f89804dd2972594d05b790a9023f7bf2de41 | [
"MIT"
] | 5 | 2018-01-05T14:52:50.000Z | 2019-06-23T05:24:23.000Z | setup.py | pgaudillere/alesisvsysex | 08f6f89804dd2972594d05b790a9023f7bf2de41 | [
"MIT"
] | 4 | 2019-12-12T07:54:59.000Z | 2022-03-20T19:16:08.000Z | from setuptools import setup, find_packages
setup(
name="alesisvsysex",
version="0.0.1",
install_requires=["pytest", "python-rtmidi", "mido", "vext.pyqt5"],
packages=find_packages(),
entry_points={
'console_scripts': ['alesisvsysex=alesisvsysex.__main__:main'],
}
)
| 23.076923 | 71 | 0.666667 | from setuptools import setup, find_packages
setup(
name="alesisvsysex",
version="0.0.1",
install_requires=["pytest", "python-rtmidi", "mido", "vext.pyqt5"],
packages=find_packages(),
entry_points={
'console_scripts': ['alesisvsysex=alesisvsysex.__main__:main'],
}
)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
126378d1a4feb187ac6295e7ac767746537e63b3 | 5,825 | py | Python | pypaypal/entities/webexp.py | ivcuello/pypaypal | 957cbd4e8d2127b0fc639825ce3a3924acd3216d | [
"Apache-2.0"
] | 1 | 2022-01-18T03:01:34.000Z | 2022-01-18T03:01:34.000Z | pypaypal/entities/webexp.py | ivcuello/pypaypal | 957cbd4e8d2127b0fc639825ce3a3924acd3216d | [
"Apache-2.0"
] | 10 | 2021-01-31T14:33:16.000Z | 2021-01-31T14:45:02.000Z | pypaypal/entities/webexp.py | ivcuello/pypaypal | 957cbd4e8d2127b0fc639825ce3a3924acd3216d | [
"Apache-2.0"
] | null | null | null | """
Module with all Payment Expirience Web Profiles related entities.
""" | 39.62585 | 124 | 0.681202 | """
Module with all Payment Expirience Web Profiles related entities.
"""
from enum import Enum
from typing import Type, List
from pypaypal.entities.base import (
T,
PayPalEntity,
ResponseType
)
class LandingPageType(Enum):
BILLING = 1
LOGIN = 2
class UserAction(Enum):
CONTINUE = 1
... | 0 | 3,102 | 0 | 2,325 | 0 | 0 | 0 | 69 | 252 |
6cc41a663dffb131cbb3867fad62141780d8dd51 | 714 | py | Python | Solutions/Problem9.py | igerry/ProjectEulerInPython | b65785556f19b038d8cd0e1ff24afaeb9103f499 | [
"Apache-2.0"
] | null | null | null | Solutions/Problem9.py | igerry/ProjectEulerInPython | b65785556f19b038d8cd0e1ff24afaeb9103f499 | [
"Apache-2.0"
] | null | null | null | Solutions/Problem9.py | igerry/ProjectEulerInPython | b65785556f19b038d8cd0e1ff24afaeb9103f499 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
p = Problem9()
print(p.solution()) | 23.032258 | 82 | 0.484594 | #!/usr/bin/python
class Problem9:
'''
Special Pythagorean triplet
Problem 9
31875000
A Pythagorean triplet is a set of three natural numbers, a < b < c, for which,
a^2 + b^2 = c^2
For example, 3^2 + 4^2 = 9 + 16 = 25 = 5^2.
There exists exactly one Pythagorean triplet for which a + b... | 0 | 0 | 0 | 637 | 0 | 0 | 0 | 0 | 23 |
c4d7134005af220fb5994f7517c8935fdff3308b | 1,843 | py | Python | preprocessing/visualization.py | microsoft/PySiamTracking | a82dabeaa42a7816dbd8e823da7b7e92ebb622ce | [
"MIT"
] | 28 | 2020-03-18T04:41:21.000Z | 2022-02-24T16:44:01.000Z | preprocessing/visualization.py | HengFan2010/PySiamTracking | a82dabeaa42a7816dbd8e823da7b7e92ebb622ce | [
"MIT"
] | 1 | 2020-04-05T15:23:22.000Z | 2020-04-07T16:23:12.000Z | preprocessing/visualization.py | HengFan2010/PySiamTracking | a82dabeaa42a7816dbd8e823da7b7e92ebb622ce | [
"MIT"
] | 11 | 2020-03-19T00:30:06.000Z | 2021-11-10T08:22:35.000Z | import os
import cv2
import numpy as np
import argparse
import zipfile
import _pickle as pickle
def parse_args():
"""
Parse input arguments
"""
parser = argparse.ArgumentParser(description='Visualization crop results')
parser.add_argument('--annotation', dest='annotation',
... | 30.213115 | 90 | 0.533912 | import os
import cv2
import numpy as np
import argparse
import zipfile
import _pickle as pickle
def parse_args():
"""
Parse input arguments
"""
parser = argparse.ArgumentParser(description='Visualization crop results')
parser.add_argument('--annotation', dest='annotation',
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
94ede3570d2bfe99822229a3df5d5939bc2f2090 | 2,922 | py | Python | psutilcli/procsmem.py | giampaolo/psutil-cli | 163d65c42e2e89794d4167465fa9e8656fd166a3 | [
"MIT"
] | 2 | 2017-03-25T08:34:36.000Z | 2017-05-04T06:30:21.000Z | psutilcli/procsmem.py | giampaolo/psutil-cli | 163d65c42e2e89794d4167465fa9e8656fd166a3 | [
"MIT"
] | 1 | 2017-03-24T20:16:52.000Z | 2017-03-24T20:16:52.000Z | psutilcli/procsmem.py | giampaolo/psutil-cli | 163d65c42e2e89794d4167465fa9e8656fd166a3 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Usage: psutil-procsmem [-h] [-s SORT]
Options:
-h --help # print this help
-s [SORT] --sort [SORT] # sort by column, either uss, pss, swap or pss
Description:
Show "real" (USS) memory usage about all (querable) processes.
"USS" (Unique Set Size) memory is probably the... | 27.566038 | 75 | 0.551677 | #!/usr/bin/env python
"""Usage: psutil-procsmem [-h] [-s SORT]
Options:
-h --help # print this help
-s [SORT] --sort [SORT] # sort by column, either uss, pss, swap or pss
Description:
Show "real" (USS) memory usage about all (querable) processes.
"USS" (Unique Set Size) memory is probably the... | 0 | 0 | 0 | 0 | 0 | 1,984 | 0 | 46 | 201 |
54d8a35960dd60c23133aaf9ca351578c919374f | 450 | py | Python | tests/test_uwsgicache.py | kalekseev/django-cache-url | 5203e23229f39430f81e17bc9deef069bfa0e3cd | [
"MIT"
] | 41 | 2015-03-02T16:14:34.000Z | 2021-02-22T06:20:47.000Z | tests/test_uwsgicache.py | kalekseev/django-cache-url | 5203e23229f39430f81e17bc9deef069bfa0e3cd | [
"MIT"
] | 21 | 2015-05-05T15:24:33.000Z | 2020-02-07T15:54:34.000Z | tests/test_uwsgicache.py | kalekseev/django-cache-url | 5203e23229f39430f81e17bc9deef069bfa0e3cd | [
"MIT"
] | 18 | 2015-02-27T13:15:13.000Z | 2020-05-31T16:18:39.000Z | from __future__ import unicode_literals
| 25 | 55 | 0.733333 | from __future__ import unicode_literals
import django_cache_url
def test_uwsgicache_url_returns_uwsgicache_cache():
url = 'uwsgicache://cachename/'
config = django_cache_url.parse(url)
assert config['BACKEND'] == 'uwsgicache.UWSGICache'
assert config['LOCATION'] == 'cachename'
def test_uwsgicache_... | 0 | 0 | 0 | 0 | 0 | 337 | 0 | 2 | 69 |
fcbbd36c8924f1b64e9ee1a6349a3d564d0d251e | 1,663 | py | Python | graph_modifications.py | jmkinder1/code-samples | 9c6cd3c6f16579a6c1f5210779b8ec6ad53fbdba | [
"BSD-3-Clause"
] | 5 | 2021-07-17T05:19:00.000Z | 2022-01-05T05:39:50.000Z | graph_modifications.py | jmkinder1/code-samples | 9c6cd3c6f16579a6c1f5210779b8ec6ad53fbdba | [
"BSD-3-Clause"
] | null | null | null | graph_modifications.py | jmkinder1/code-samples | 9c6cd3c6f16579a6c1f5210779b8ec6ad53fbdba | [
"BSD-3-Clause"
] | 8 | 2020-12-26T23:41:27.000Z | 2022-02-24T22:18:41.000Z | # graph_modifications.py
# -------------------------------------------------------------------------
# This script creates a simple plot with two lines, then modifies many
# features of the plot, including axis labels, labels and legend, line
# style, tick labels, and title.
# ------------------------------------------... | 32.607843 | 82 | 0.66386 | # graph_modifications.py
# -------------------------------------------------------------------------
# This script creates a simple plot with two lines, then modifies many
# features of the plot, including axis labels, labels and legend, line
# style, tick labels, and title.
# ------------------------------------------... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c0359d8f2336e2b4ce9de00e06a420c99d8dfe1b | 2,763 | py | Python | permafrost/calc_ALT.py | rishabhdutta/InSAR_utils | 578ac360a4c39c4b72919b8452de255d036d5bdc | [
"MIT"
] | 5 | 2020-07-20T16:58:16.000Z | 2022-02-16T02:54:42.000Z | permafrost/calc_ALT.py | rishabhdutta/InSAR_utils | 578ac360a4c39c4b72919b8452de255d036d5bdc | [
"MIT"
] | null | null | null | permafrost/calc_ALT.py | rishabhdutta/InSAR_utils | 578ac360a4c39c4b72919b8452de255d036d5bdc | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 20 09:58:50 2020
@author: duttar
Description: Inverting for ALT from the seasonal subsidence results
Using mixed soil conditions:
a) .9 porosity for top organic layer
b) exponential decay of porosity below organic layer
c) .44 porosity ... | 30.7 | 111 | 0.700688 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Jul 20 09:58:50 2020
@author: duttar
Description: Inverting for ALT from the seasonal subsidence results
Using mixed soil conditions:
a) .9 porosity for top organic layer
b) exponential decay of porosity below organic layer
c) .44 porosity ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 24 | 44 |
16fe5181caee6267fddb0197a4afe31a86326446 | 328 | py | Python | geojson_pydantic/types.py | regisfbrilhante/geojson-pydantic | 5df6f23e47a1daeb16cb112b6930704a72c05dbf | [
"MIT"
] | 73 | 2020-05-21T22:58:41.000Z | 2022-03-29T11:33:11.000Z | geojson_pydantic/types.py | sthagen/geojson-pydantic | 84a945c244ced0de76f152cfabc295a9b7b8e8bb | [
"MIT"
] | 50 | 2020-08-05T12:48:24.000Z | 2022-03-31T11:39:23.000Z | geojson_pydantic/types.py | sthagen/geojson-pydantic | 84a945c244ced0de76f152cfabc295a9b7b8e8bb | [
"MIT"
] | 17 | 2020-07-31T16:54:31.000Z | 2022-03-23T13:23:04.000Z | """Types for geojson_pydantic models"""
from typing import Tuple, Union
NumType = Union[float, int]
BBox = Union[
Tuple[NumType, NumType, NumType, NumType], # 2D bbox
Tuple[NumType, NumType, NumType, NumType, NumType, NumType], # 3D bbox
]
Position = Union[Tuple[NumType, NumType], Tuple[NumType, NumType, Nu... | 29.818182 | 75 | 0.716463 | """Types for geojson_pydantic models"""
from typing import Tuple, Union
NumType = Union[float, int]
BBox = Union[
Tuple[NumType, NumType, NumType, NumType], # 2D bbox
Tuple[NumType, NumType, NumType, NumType, NumType, NumType], # 3D bbox
]
Position = Union[Tuple[NumType, NumType], Tuple[NumType, NumType, Nu... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8eb33104fc930d12a69ef5978e60926afa893d12 | 1,412 | py | Python | cubic-bezier.py | chsupark/cubic-bezier | 0017e7c81b1f93403670849a2103897f4da35f95 | [
"MIT"
] | 1 | 2021-04-20T11:22:09.000Z | 2021-04-20T11:22:09.000Z | cubic-bezier.py | chsupark/cubic-bezier | 0017e7c81b1f93403670849a2103897f4da35f95 | [
"MIT"
] | null | null | null | cubic-bezier.py | chsupark/cubic-bezier | 0017e7c81b1f93403670849a2103897f4da35f95 | [
"MIT"
] | null | null | null | MAX_ITERATIONS = 15
TOLERANCE = 0.001
# https://en.wikipedia.org/wiki/B%C3%A9zier_curve
# P0(0, 0), P1(x1, y1), P2(x2, y2), P3(1, 1)
# B(t) = ((1-t)^3)*P0 + (3t(1-t)^2)*P1 + (3t^2(1-t))*P2 + t^3*P3
# = (3t(1-t)^2)*P1 + (3t^2(1-t))*P2 + t^3
# Returns f(t) or z(t) by given value x1, x2 or y1, ... | 36.205128 | 74 | 0.541076 | MAX_ITERATIONS = 15
TOLERANCE = 0.001
# https://en.wikipedia.org/wiki/B%C3%A9zier_curve
# P0(0, 0), P1(x1, y1), P2(x2, y2), P3(1, 1)
# B(t) = ((1-t)^3)*P0 + (3t(1-t)^2)*P1 + (3t^2(1-t))*P2 + t^3*P3
# = (3t(1-t)^2)*P1 + (3t^2(1-t))*P2 + t^3
# Returns f(t) or z(t) by given value x1, x2 or y1, ... | 0 | 0 | 0 | 0 | 0 | 839 | 0 | 0 | 95 |
378db59db583db4e3cfbd64448fa3e85fea5699b | 616 | py | Python | config/dev.py | Askr-ssy/rig | ba8782fe56eff0a0389ed0fdf4a6ff4f419d96b0 | [
"MIT"
] | null | null | null | config/dev.py | Askr-ssy/rig | ba8782fe56eff0a0389ed0fdf4a6ff4f419d96b0 | [
"MIT"
] | null | null | null | config/dev.py | Askr-ssy/rig | ba8782fe56eff0a0389ed0fdf4a6ff4f419d96b0 | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
| 22.814815 | 73 | 0.599026 | # -*- encoding: utf-8 -*-
from .base import BaseConfig
class DevConfig(BaseConfig):
MYSQL_HOST = '192.168.2.229'
MYSQL_ACCOUNT = 'web'
MYSQL_PASSWORD = 'ES$v1J8j'
MYSQL_DATABASE = 'nlp_m_beta'
MYSQL_PORT = 3306
# redis链接
REDIS_HOST = 'redis.service'
REDIS_ACCOUNT = ''
REDIS_SENTIE... | 6 | 0 | 0 | 535 | 0 | 0 | 0 | 7 | 45 |
d6969730e0c442fe00720cee0a456f408b135e2a | 905 | py | Python | geokey_wegovnow/urls.py | ExCiteS/geokey-wegonow | 66df7e17fa3eb2d8da2e56e39236b019f98a2a08 | [
"MIT"
] | null | null | null | geokey_wegovnow/urls.py | ExCiteS/geokey-wegonow | 66df7e17fa3eb2d8da2e56e39236b019f98a2a08 | [
"MIT"
] | 2 | 2017-02-22T13:20:29.000Z | 2018-11-07T16:39:33.000Z | geokey_wegovnow/urls.py | ExCiteS/geokey-wegonow | 66df7e17fa3eb2d8da2e56e39236b019f98a2a08 | [
"MIT"
] | null | null | null | """All URLs for the WeGovNow extension."""
from django.conf.urls import include, url
from rest_framework.urlpatterns import format_suffix_patterns
from geokey_wegovnow import views
# ###########################
# ADMIN VIEWS
# ###########################
adminpatterns = [
url(r'^admin/profile/settings/$',
... | 21.547619 | 79 | 0.543646 | """All URLs for the WeGovNow extension."""
from django.conf.urls import include, url
from rest_framework.urlpatterns import format_suffix_patterns
from geokey_wegovnow import views
# ###########################
# ADMIN VIEWS
# ###########################
adminpatterns = [
url(r'^admin/profile/settings/$',
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d229ff3014d2974ec47228eae763c94765edda43 | 12,966 | py | Python | ecs.py | ijin/ecs-deity | 80c6e6f0a6829efb62551fe09595e4f3bc286c25 | [
"MIT"
] | 15 | 2018-02-15T11:28:11.000Z | 2019-02-15T05:38:37.000Z | ecs.py | ijin/ecs-deity | 80c6e6f0a6829efb62551fe09595e4f3bc286c25 | [
"MIT"
] | null | null | null | ecs.py | ijin/ecs-deity | 80c6e6f0a6829efb62551fe09595e4f3bc286c25 | [
"MIT"
] | 1 | 2018-03-09T09:09:52.000Z | 2018-03-09T09:09:52.000Z | import os
import boto3
from notification import SnsNotification
region = os.getenv('AWS_REGION','ap-northeast-1')
SNS_ARN = os.environ['sns_arn']
CHANNEL = os.environ['channel']
REPO_OMMIT = os.environ['repo_ommit']
alb = boto3.client('elbv2', region_name=region)
ecs = boto3.client('ecs', region_name=region)
icon = '... | 37.365994 | 218 | 0.614916 | import os
import json
import random
import boto3
from time import sleep
from notification import SnsNotification
region = os.getenv('AWS_REGION','ap-northeast-1')
SNS_ARN = os.environ['sns_arn']
CHANNEL = os.environ['channel']
REPO_OMMIT = os.environ['repo_ommit']
alb = boto3.client('elbv2', region_name=region)
ecs =... | 0 | 0 | 0 | 0 | 0 | 11,638 | 0 | -17 | 383 |
b38fdaf474cf508850d66aaf31f9c36aa506a61f | 7,684 | py | Python | cptk/core/chef.py | RealA10N/cptk | e500d948e91bb70661adc3c2539b149704c734a1 | [
"Apache-2.0"
] | 5 | 2021-12-25T01:49:45.000Z | 2022-03-27T10:30:14.000Z | cptk/core/chef.py | RealA10N/cptk | e500d948e91bb70661adc3c2539b149704c734a1 | [
"Apache-2.0"
] | 39 | 2021-12-24T16:35:07.000Z | 2022-03-18T23:15:14.000Z | cptk/core/chef.py | RealA10N/cptk | e500d948e91bb70661adc3c2539b149704c734a1 | [
"Apache-2.0"
] | 2 | 2022-01-12T19:13:20.000Z | 2022-01-12T19:32:05.000Z | from __future__ import annotations
from typing import TypeVar
import cptk.constants
T = TypeVar('T')
| 31.621399 | 81 | 0.596694 | from __future__ import annotations
import os
import subprocess
import sys
import time
from dataclasses import dataclass
from threading import Timer
from typing import TypeVar
import cptk.constants
import cptk.utils
from cptk.core.system import System
from cptk.local.problem import LocalProblem
from cptk.scrape import... | 0 | 298 | 0 | 6,898 | 0 | 0 | 0 | 20 | 359 |
3f0f573387393c03ecef1816659123e9d7abdf6c | 7,700 | py | Python | index.py | serjolas1/CoursesWebsite | 413969ea0b6857af36e9d86715181c0b2d51c319 | [
"MIT"
] | 4 | 2021-04-04T06:31:01.000Z | 2021-04-08T23:35:40.000Z | index.py | serjolas1/CoursesWebsite | 413969ea0b6857af36e9d86715181c0b2d51c319 | [
"MIT"
] | null | null | null | index.py | serjolas1/CoursesWebsite | 413969ea0b6857af36e9d86715181c0b2d51c319 | [
"MIT"
] | null | null | null | from cs50 import SQL
from flask import Flask
from flask_session import Session
from tempfile import mkdtemp
from pyrebase import pyrebase
app = Flask(__name__)
# Ensure templates are auto-reloaded
app.config["TEMPLATES_AUTO_RELOAD"] = True
# Ensure responses aren't cached
# Configure session to use filesystem (inst... | 35.981308 | 222 | 0.679481 | import os
import re
from uuid import uuid4
from cs50 import SQL
from flask import Flask, flash, render_template, redirect, request, session, json
from flask_session import Session
from tempfile import mkdtemp
from helpers import login_required
from werkzeug.security import generate_password_hash, check_password_hash
fr... | 0 | 5,262 | 0 | 0 | 0 | 501 | 0 | 127 | 461 |
bc35276d60b1270ee5982dcc5b96753e532a43bf | 3,197 | py | Python | melange/tests/unit/test_pagination.py | CiscoSystems/melange | d8ff17ecb9466b64dbd064710489ea62843e6636 | [
"Apache-2.0"
] | 1 | 2016-05-25T13:48:06.000Z | 2016-05-25T13:48:06.000Z | melange/tests/unit/test_pagination.py | openstack-attic/melange | 6ec8d7068e09505614dfc5f3edccfbe26aa50fe4 | [
"Apache-2.0"
] | null | null | null | melange/tests/unit/test_pagination.py | openstack-attic/melange | 6ec8d7068e09505614dfc5f3edccfbe26aa50fe4 | [
"Apache-2.0"
] | null | null | null | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/... | 43.202703 | 79 | 0.673444 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright 2011 OpenStack LLC.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/... | 0 | 0 | 0 | 2,254 | 0 | 0 | 0 | 111 | 156 |
d3335c013da4ff05d6b9bf5c6dae8c44ca48ad5a | 1,613 | py | Python | iseq/sam.py | Miachol/iseq | 7d05900dff43e1b0e0c1f017b55a1e56f9148f86 | [
"Apache-2.0"
] | 12 | 2017-10-27T02:03:23.000Z | 2021-07-06T08:57:15.000Z | iseq/sam.py | Miachol/iseq | 7d05900dff43e1b0e0c1f017b55a1e56f9148f86 | [
"Apache-2.0"
] | null | null | null | iseq/sam.py | Miachol/iseq | 7d05900dff43e1b0e0c1f017b55a1e56f9148f86 | [
"Apache-2.0"
] | 3 | 2019-04-01T07:40:47.000Z | 2020-11-04T11:59:15.000Z | #!/usr/bin/env python
# coding=utf-8
"""Module Description
Copyright (c) 2017 Jianfeng Li <lee_jianfeng@sjtu.edu.cn>
This code is free software; you can redistribute it and/or modify it
under the terms of the MIT License.
@sam: Sam File Class
@status: experimental
@version: 0.0.1
@author: Jianfeng Li
@contact: lee_ji... | 36.659091 | 114 | 0.642281 | #!/usr/bin/env python
# coding=utf-8
"""Module Description
Copyright (c) 2017 Jianfeng Li <lee_jianfeng@sjtu.edu.cn>
This code is free software; you can redistribute it and/or modify it
under the terms of the MIT License.
@sam: Sam File Class
@status: experimental
@version: 0.0.1
@author: Jianfeng Li
@contact: lee_ji... | 0 | 0 | 0 | 1,203 | 0 | 0 | 0 | 0 | 67 |
8d695b5652d04f49cc89619584c2dc6616838ab7 | 7,988 | py | Python | src/monopsr/core/trainer.py | minghanz/monopsr | f3cb31909666012dfcf38e5fe0b0f6feb3801560 | [
"MIT"
] | 104 | 2019-08-13T01:26:19.000Z | 2022-03-30T12:08:00.000Z | src/monopsr/core/trainer.py | weidezhang/monopsr | e194d2547f10e7ab50d786762dcf9f5619069ce8 | [
"MIT"
] | 5 | 2020-01-28T22:16:24.000Z | 2022-02-09T23:33:07.000Z | src/monopsr/core/trainer.py | weidezhang/monopsr | e194d2547f10e7ab50d786762dcf9f5619069ce8 | [
"MIT"
] | 25 | 2019-08-12T23:31:40.000Z | 2022-02-12T02:27:12.000Z | """Detection model trainer.
This file provides a generic training method to train a
DetectionModel.
"""
import datetime
import os
import tensorflow as tf
import time
import monopsr
from monopsr.builders import optimizer_builder, net_builder
from monopsr.core import checkpoint_utils
from monopsr.core import summary_ut... | 37.502347 | 98 | 0.671132 | """Detection model trainer.
This file provides a generic training method to train a
DetectionModel.
"""
import datetime
import os
import tensorflow as tf
import time
import monopsr
from monopsr.builders import optimizer_builder, net_builder
from monopsr.core import checkpoint_utils
from monopsr.core import summary_ut... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
3f2b474a38b3a8c12534772869758af0bb8c8f39 | 419 | py | Python | 5day/Net01.py | jsjang93/joony | 62f7a325094c887212b894932263bf84500e0f03 | [
"MIT"
] | null | null | null | 5day/Net01.py | jsjang93/joony | 62f7a325094c887212b894932263bf84500e0f03 | [
"MIT"
] | null | null | null | 5day/Net01.py | jsjang93/joony | 62f7a325094c887212b894932263bf84500e0f03 | [
"MIT"
] | null | null | null | # Net01.py
# Server
# command A
svrIP = '59.29.224.54' # Host IP
svrPort = 64000
svrAddr = (svrIP,svrPort)
svrSocket = socket(AF_INET,SOCK_STREAM)
svrSocket.bind(svrAddr)
svrSocket.listen(0)
# Listening
# Connect
cliSocket, cliAddr = svrSocket.accept()
# (send)
cliSocket.send(b"Welcome Py Server")
# (recv)... | 19.045455 | 39 | 0.720764 | # Net01.py
# Server
# command A 창에서 실행
from socket import *
svrIP = '59.29.224.54' # Host IP
svrPort = 64000
svrAddr = (svrIP,svrPort)
svrSocket = socket(AF_INET,SOCK_STREAM)
svrSocket.bind(svrAddr)
svrSocket.listen(0)
# Listening 상태 완료
# Connect 허락
cliSocket, cliAddr = svrSocket.accept()
# 메세지 전송(send)
cliSocket.... | 63 | 0 | 0 | 0 | 0 | 0 | 0 | -1 | 22 |
a1ec5e6d5bbfce43aaf83f35097308a0f00c7c3d | 1,786 | py | Python | someip_fuzzer/heartbeat.py | cfanatic/someip-protocol-fuzzer | 5977f62580f02a95568c0715dd6bb2eb804d0a81 | [
"MIT"
] | null | null | null | someip_fuzzer/heartbeat.py | cfanatic/someip-protocol-fuzzer | 5977f62580f02a95568c0715dd6bb2eb804d0a81 | [
"MIT"
] | null | null | null | someip_fuzzer/heartbeat.py | cfanatic/someip-protocol-fuzzer | 5977f62580f02a95568c0715dd6bb2eb804d0a81 | [
"MIT"
] | null | null | null |
load_contrib("automotive.someip")
| 35.019608 | 98 | 0.577828 | from scapy.all import *
from someip_fuzzer.config import config
from someip_fuzzer.log import log_info
from someip_fuzzer.types import *
from queue import Queue
import threading
import time
load_contrib("automotive.someip")
class Heartbeat(threading.Thread):
def __init__(self, excq):
super().__init__()
... | 0 | 0 | 0 | 1,538 | 0 | 0 | 0 | 36 | 177 |
a0d4eed49c6a1f032c73385cfa56cd9a30b328a2 | 3,086 | py | Python | attic/static.py | eblade/attic | 19de913bc2cf61beffd4c754299a89b3e3e0cbf4 | [
"MIT"
] | null | null | null | attic/static.py | eblade/attic | 19de913bc2cf61beffd4c754299a89b3e3e0cbf4 | [
"MIT"
] | null | null | null | attic/static.py | eblade/attic | 19de913bc2cf61beffd4c754299a89b3e3e0cbf4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import mimetypes
mimetypes.add_type("text/gemini", ".gmi")
| 32.829787 | 79 | 0.567401 | #!/usr/bin/env python3
import pathlib
import typing as t
import mimetypes
mimetypes.add_type("text/gemini", ".gmi")
class ResolvedFile:
def __init__(self, filepath: pathlib.Path, mimetype: str = None):
self.path = filepath
if mimetype is not None:
self.mimetype = mimetype
e... | 0 | 0 | 0 | 2,894 | 0 | 0 | 0 | -10 | 114 |
86c8236fe9570a81e18265f744481ef93fb45114 | 1,451 | py | Python | setup.py | henrystokeley/pgsheets | 555c2af1b570cee5c206b36c339403892dbd47b1 | [
"MIT"
] | 7 | 2015-07-21T07:19:02.000Z | 2018-04-23T22:00:30.000Z | setup.py | robin900/pgsheets | 555c2af1b570cee5c206b36c339403892dbd47b1 | [
"MIT"
] | 3 | 2016-03-14T15:39:10.000Z | 2016-03-29T19:47:23.000Z | setup.py | robin900/pgsheets | 555c2af1b570cee5c206b36c339403892dbd47b1 | [
"MIT"
] | 3 | 2016-03-10T01:32:12.000Z | 2021-05-09T17:09:10.000Z | import re
from setuptools import setup, find_packages
if __name__ == '__main__':
# get requirements
with open('requirements.txt') as f:
requirements = f.read()
requirements = [
r for r in requirements.splitlines() if r != '']
# get readme
with open('README.rst') as f:
... | 33.744186 | 75 | 0.555479 | import re
from setuptools import setup, find_packages
if __name__ == '__main__':
# get requirements
with open('requirements.txt') as f:
requirements = f.read()
requirements = [
r for r in requirements.splitlines() if r != '']
# get readme
with open('README.rst') as f:
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d77a820fbf1c026b2c4c5d73a7b6482f0b91a35a | 5,868 | py | Python | c5_irlf_wang.py | Jayshil/csfrd | 9f9e8ccea93f464cfd7cf45c06b05738194d3da5 | [
"MIT"
] | null | null | null | c5_irlf_wang.py | Jayshil/csfrd | 9f9e8ccea93f464cfd7cf45c06b05738194d3da5 | [
"MIT"
] | null | null | null | c5_irlf_wang.py | Jayshil/csfrd | 9f9e8ccea93f464cfd7cf45c06b05738194d3da5 | [
"MIT"
] | null | null | null | import numpy as np
import scipy.integrate as inte
import astropy.constants as con
import astropy.units as u
from tqdm import tqdm
import os
import irlf as irlf
# LF Parameters
zdo = np.array([0.0, 0.3, 0.45, 0.6, 0.8, 1.0, 1.2, 1.7, 2.0, 2.5, 3.0, 4.2, 5.0])
zup = np.array([0.3, 0.45, 0.6, 0.8, 1.0, 1.2, 1.7, 2.0, 2.5... | 36 | 129 | 0.599523 | import numpy as np
import matplotlib.pyplot as plt
import scipy.integrate as inte
import astropy.constants as con
import astropy.units as u
from tqdm import tqdm
import os
import utils as utl
import irlf as irlf
# LF Parameters
zdo = np.array([0.0, 0.3, 0.45, 0.6, 0.8, 1.0, 1.2, 1.7, 2.0, 2.5, 3.0, 4.2, 5.0])
zup = np... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 44 |
75863c2a587b059265d14ae522264c99f3bf22a8 | 412 | py | Python | src/pyoram/utils.py | marcjulian/pyoram | 963bdc103196c0e014cc4934856e103b76420f07 | [
"MIT"
] | 6 | 2016-02-10T11:04:57.000Z | 2020-03-04T18:32:07.000Z | src/pyoram/utils.py | marcjulian/pyoram | 963bdc103196c0e014cc4934856e103b76420f07 | [
"MIT"
] | null | null | null | src/pyoram/utils.py | marcjulian/pyoram | 963bdc103196c0e014cc4934856e103b76420f07 | [
"MIT"
] | null | null | null |
WRITE_MODE = 'w'
READ_MODE = 'r'
READ_WRITE_MODE = 'r+'
READ_BINARY_MODE = 'rb'
WRITE_BINARY_MODE = 'wb'
KEY_MAP_FILE_NAME = 'key.map'
FILE_MAP_FILE_NAME = 'file.map'
POSITION_MAP_FILE_NAME = 'position.map'
STASH_FOLDER_NAME = 'stash'
CLOUD_MAP_FILE_NAME = 'cloud.map'
LOG_FILE_NAME = 'pyoram.log'
| 16.48 | 39 | 0.73301 | import base64
WRITE_MODE = 'w'
READ_MODE = 'r'
READ_WRITE_MODE = 'r+'
READ_BINARY_MODE = 'rb'
WRITE_BINARY_MODE = 'wb'
KEY_MAP_FILE_NAME = 'key.map'
FILE_MAP_FILE_NAME = 'file.map'
POSITION_MAP_FILE_NAME = 'position.map'
STASH_FOLDER_NAME = 'stash'
CLOUD_MAP_FILE_NAME = 'cloud.map'
LOG_FILE_NAME = 'pyoram.log'
de... | 0 | 0 | 0 | 0 | 0 | 48 | 0 | -8 | 68 |
d2ea80444d86d925b78e0e23cb20b9563a6bfcb5 | 5,309 | py | Python | sonarqube/community/measures.py | shijl-0925/python-sonarqube-api | afd89a196bd8c1d120a1e9ffe1738f9f9460e748 | [
"MIT"
] | 71 | 2020-09-10T08:05:08.000Z | 2020-09-25T05:54:01.000Z | sonarqube/community/measures.py | swede0925/python-sonarqube | afd89a196bd8c1d120a1e9ffe1738f9f9460e748 | [
"MIT"
] | 2 | 2020-09-10T19:52:16.000Z | 2020-09-19T12:58:05.000Z | sonarqube/community/measures.py | swede0925/python-sonarqube | afd89a196bd8c1d120a1e9ffe1738f9f9460e748 | [
"MIT"
] | 1 | 2020-10-22T19:14:56.000Z | 2020-10-22T19:14:56.000Z | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Author: Jialiang Shi
| 37.387324 | 123 | 0.653042 | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# @Author: Jialiang Shi
from sonarqube.utils.rest_client import RestClient
from sonarqube.utils.config import (
API_MEASURES_COMPONENT_ENDPOINT,
API_MEASURES_COMPONENT_TREE_ENDPOINT,
API_MEASURES_SEARCH_HISTORY_ENDPOINT,
)
from sonarqube.utils.common import GET, ... | 0 | 4,599 | 0 | 356 | 0 | 0 | 0 | 195 | 89 |
2b20761ae106a9c8c1925795f05833b69d126c0d | 7,540 | py | Python | FindPath.py | hoodedpaladin/HoodTracker | 49c589aaaf006d06570c8cd93a3a6280b9025bbf | [
"MIT"
] | 5 | 2021-02-12T08:54:45.000Z | 2022-03-24T00:00:15.000Z | FindPath.py | hoodedpaladin/HoodTracker | 49c589aaaf006d06570c8cd93a3a6280b9025bbf | [
"MIT"
] | 1 | 2021-12-30T20:56:04.000Z | 2022-01-07T22:03:09.000Z | FindPath.py | hoodedpaladin/HoodTracker | 49c589aaaf006d06570c8cd93a3a6280b9025bbf | [
"MIT"
] | 1 | 2020-10-09T10:46:33.000Z | 2020-10-09T10:46:33.000Z | import PySide2.QtWidgets as QtWidgets
| 39.684211 | 195 | 0.645756 | import HoodTracker
from CommonUtils import *
import PySide2.QtWidgets as QtWidgets
class Visit:
def __init__(self, age, region, steps, string, previous):
self.age = age
self.region = region
self.steps = steps
self.string = string
self.previous = previous
def getHistory(s... | 0 | 0 | 0 | 4,070 | 0 | 3,318 | 0 | 1 | 113 |
24cac461c24ed51e7d1296f415d4612c372dee9f | 11,417 | py | Python | src/tomate/db_types/plotting/plot_object.py | Descanonge/tomate | 6b24dc4a03230f45ad92670919a225c7e93e8118 | [
"MIT"
] | null | null | null | src/tomate/db_types/plotting/plot_object.py | Descanonge/tomate | 6b24dc4a03230f45ad92670919a225c7e93e8118 | [
"MIT"
] | null | null | null | src/tomate/db_types/plotting/plot_object.py | Descanonge/tomate | 6b24dc4a03230f45ad92670919a225c7e93e8118 | [
"MIT"
] | null | null | null | """Abstract object containing information about plots."""
# This file is part of the 'tomate' project
# (http://github.com/Descanonge/tomate) and subject
# to the MIT License as defined in the file 'LICENSE',
# at the root of this project. 2020 Clment HACK
from typing import TYPE_CHECKING
if TYPE_CHECKING:
| 34.492447 | 86 | 0.570465 | """Abstract object containing information about plots."""
# This file is part of the 'tomate' project
# (http://github.com/Descanonge/tomate) and subject
# to the MIT License as defined in the file 'LICENSE',
# at the root of this project. © 2020 Clément HAËCK
from typing import Any, Dict, List, Union, TYPE_CHECKING... | 6 | 902 | 0 | 9,787 | 0 | 0 | 0 | 206 | 205 |
835b321a47e17b051904dec35911ad556cd535e9 | 5,428 | py | Python | LinearLassoRegression.py | prakhardogra921/Year-Prediction-using-Regression | bac8e88f2443837c931d6ba1029daddb4b256fc3 | [
"MIT"
] | null | null | null | LinearLassoRegression.py | prakhardogra921/Year-Prediction-using-Regression | bac8e88f2443837c931d6ba1029daddb4b256fc3 | [
"MIT"
] | null | null | null | LinearLassoRegression.py | prakhardogra921/Year-Prediction-using-Regression | bac8e88f2443837c931d6ba1029daddb4b256fc3 | [
"MIT"
] | null | null | null | # Reference Source: https://github.com/llSourcell/linear_regression_live/blob/master/demo.py
import pandas as pd
import numpy as np
from sklearn.preprocessing import StandardScaler
import matplotlib.pyplot as plt
from sklearn.utils import shuffle
from sklearn.metrics import explained_variance_score, mean_absolute_erro... | 36.186667 | 162 | 0.609248 | # Reference Source: https://github.com/llSourcell/linear_regression_live/blob/master/demo.py
import pandas as pd
import numpy as np
from sklearn.model_selection import train_test_split
from sklearn.preprocessing import StandardScaler
import matplotlib.pyplot as plt
from sklearn.utils import shuffle
from sklearn.metric... | 0 | 0 | 0 | 1,270 | 0 | 0 | 0 | 56 | 45 |
1f5a2e10a17e9544d0d3a40f91106bf0ca495f75 | 902 | py | Python | setup.py | bdragon300/sparsedlist | 5f706b4bcee177a4898dcc0a5becf83553c794dd | [
"Apache-2.0"
] | null | null | null | setup.py | bdragon300/sparsedlist | 5f706b4bcee177a4898dcc0a5becf83553c794dd | [
"Apache-2.0"
] | null | null | null | setup.py | bdragon300/sparsedlist | 5f706b4bcee177a4898dcc0a5becf83553c794dd | [
"Apache-2.0"
] | null | null | null | import setuptools
with open("README.rst", "r") as fh:
long_description = fh.read()
setuptools.setup(
name='sparsedlist',
version='0.4',
packages=[''],
url='https://github.com/bdragon300/sparsedlist',
license='Apache-2.0',
author='Igor Derkach',
author_email='gosha753951@gmail.com',
... | 30.066667 | 70 | 0.638581 | import setuptools
with open("README.rst", "r") as fh:
long_description = fh.read()
setuptools.setup(
name='sparsedlist',
version='0.4',
packages=[''],
url='https://github.com/bdragon300/sparsedlist',
license='Apache-2.0',
author='Igor Derkach',
author_email='gosha753951@gmail.com',
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
37c004eec2b0d5cc9e6d9eef9e9df368266a7c00 | 2,225 | py | Python | src/scripts/prepare_collection_result_vary_scale.py | yifan-you-37/omnihang | c80b699b2cf2cf3422201cc8c3fa572d0e01d5a2 | [
"MIT"
] | 1 | 2022-01-16T20:24:09.000Z | 2022-01-16T20:24:09.000Z | src/scripts/prepare_collection_result_vary_scale.py | yifan-you-37/omnihang | c80b699b2cf2cf3422201cc8c3fa572d0e01d5a2 | [
"MIT"
] | null | null | null | src/scripts/prepare_collection_result_vary_scale.py | yifan-you-37/omnihang | c80b699b2cf2cf3422201cc8c3fa572d0e01d5a2 | [
"MIT"
] | 1 | 2022-03-16T03:14:37.000Z | 2022-03-16T03:14:37.000Z | import numpy as np
import random
# np.random.seed(5)
# random.seed(5)
import sys
import os
import argparse
sys.path.insert(1, '../utils/')
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("--home_dir_data", default="../data")
args = parser.parse_args()
data_dir = os.path.join(arg... | 25.574713 | 89 | 0.698876 | import time
import numpy as np
import random
# np.random.seed(5)
# random.seed(5)
import sys
import os
import argparse
sys.path.insert(1, '../utils/')
from coord_helper import *
from data_helper import *
import bullet_client as bc
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument("... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 4 | 90 |
f03e4d78ae9e9885e3e1cbf176f7c1d9d673b000 | 413 | py | Python | Twitter-OA/Anagram-Difference.py | xizhang77/CodingInterview | c5e7777e6a5b691bb410c25f29ae0f51a6598a12 | [
"MIT"
] | 1 | 2021-06-12T04:47:05.000Z | 2021-06-12T04:47:05.000Z | Twitter-OA/Anagram-Difference.py | xizhang77/CodingInterview | c5e7777e6a5b691bb410c25f29ae0f51a6598a12 | [
"MIT"
] | null | null | null | Twitter-OA/Anagram-Difference.py | xizhang77/CodingInterview | c5e7777e6a5b691bb410c25f29ae0f51a6598a12 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
'''
Anagram Difference - https://www.hackerrank.com/challenges/anagram/problem
''' | 20.65 | 74 | 0.624697 | # -*- coding: utf-8 -*-
'''
Anagram Difference - https://www.hackerrank.com/challenges/anagram/problem
'''
class Solution(object):
def anagram(self, s):
if len(s)%2:
return -1
count1, count2 = Counter(s[:len(s)/2]), Counter(s[len(s)/2:])
if count1 == count2:
return 0
for key in count1:
if key in c... | 0 | 0 | 0 | 283 | 0 | 0 | 0 | 0 | 23 |
bd0ec4070930f9f616e5d129681d5b039ab1675a | 431 | py | Python | app/authentication/migrations/0008_user_sub.py | getmetamapper/metamapper | 0b2f67eec03fbf7ece35ff9f58ea9bb2dde4d85f | [
"BSD-2-Clause"
] | 53 | 2020-07-01T23:11:59.000Z | 2022-03-31T19:10:28.000Z | app/authentication/migrations/0008_user_sub.py | getmetamapper/metamapper | 0b2f67eec03fbf7ece35ff9f58ea9bb2dde4d85f | [
"BSD-2-Clause"
] | 5 | 2020-11-25T19:48:57.000Z | 2022-02-27T23:50:18.000Z | app/authentication/migrations/0008_user_sub.py | getmetamapper/metamapper | 0b2f67eec03fbf7ece35ff9f58ea9bb2dde4d85f | [
"BSD-2-Clause"
] | 5 | 2020-08-29T16:43:59.000Z | 2022-01-17T19:05:30.000Z | # Generated by Django 3.0.8 on 2020-08-21 17:43
| 22.684211 | 89 | 0.61949 | # Generated by Django 3.0.8 on 2020-08-21 17:43
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('authentication', '0007_workspace_beacon_consent'),
]
operations = [
migrations.AddField(
model_name='user',
name='su... | 0 | 0 | 0 | 317 | 0 | 0 | 0 | 19 | 46 |
266750508e19dbce61a5f8937c9575385a3fbdc9 | 3,872 | py | Python | examples/_chem_kinet.py | slayoo/pyodesys | 8e1afb195dadf6c6f8e765873bc9dd0fae067c39 | [
"BSD-2-Clause"
] | 82 | 2015-09-29T16:51:03.000Z | 2022-02-02T13:26:50.000Z | examples/_chem_kinet.py | slayoo/pyodesys | 8e1afb195dadf6c6f8e765873bc9dd0fae067c39 | [
"BSD-2-Clause"
] | 28 | 2015-09-29T14:40:45.000Z | 2021-09-18T19:29:50.000Z | examples/_chem_kinet.py | slayoo/pyodesys | 8e1afb195dadf6c6f8e765873bc9dd0fae067c39 | [
"BSD-2-Clause"
] | 13 | 2016-03-18T14:00:39.000Z | 2021-09-17T13:54:29.000Z | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
radiolysis1 = """
H4sIAGqdpVgC/42YD1BURRjA7x0gpliplalYYhes4PkHJTHzuFfQIqBXinFlz/OEpxwBssdhJFH4
F5Qs/IuomJZZURqQIlqkaZam1Yzk6KCj0zQ26VQETZM5I/Ru9zje3b31i5vhvd397bfft/vt7vu+
sqBSokPW/jqdLtfukott+fY8uZAIEtGzWoM8r8RYiuxktIEEWfu6a... | 45.023256 | 91 | 0.803461 | # -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
import codecs
import gzip
import pickle
from functools import reduce
from itertools import chain
from operator import mul
from pyodesys.symbolic import SymbolicSys
def get_odesys(reac, prod, names, SymbSys, inact_reac=None, *... | 0 | 0 | 0 | 0 | 1,093 | 383 | 0 | 10 | 202 |
1a0aefee8c8d805efa2ee9a89c9800631e4044e2 | 20,989 | py | Python | test_pytapo.py | Depau/pytapo | c56bba4f442a6be369eb898736ef2dc50fbeb69d | [
"MIT"
] | null | null | null | test_pytapo.py | Depau/pytapo | c56bba4f442a6be369eb898736ef2dc50fbeb69d | [
"MIT"
] | null | null | null | test_pytapo.py | Depau/pytapo | c56bba4f442a6be369eb898736ef2dc50fbeb69d | [
"MIT"
] | null | null | null | import os
user = os.environ.get("PYTAPO_USER")
password = os.environ.get("PYTAPO_PASSWORD")
invalidPassword = "{password}_invalid".format(password=password)
host = os.environ.get("PYTAPO_IP")
"""
util functions for unit tests
"""
"""
unit tests below
"""
| 30.070201 | 88 | 0.635571 | import os
import pytest
import json
import time
from pytapo import Tapo
import mock
user = os.environ.get("PYTAPO_USER")
password = os.environ.get("PYTAPO_PASSWORD")
invalidPassword = "{password}_invalid".format(password=password)
host = os.environ.get("PYTAPO_IP")
"""
util functions for unit tests
"""
def setOsd(t... | 0 | 0 | 0 | 510 | 0 | 19,210 | 0 | -36 | 1,007 |
115edd329a78a1257c5b50e9f817642feb21777f | 110 | py | Python | zeitslots_to_json.py | omehling/faim_website | 0131c834dc6e653ce5c890723b433a43bb1628b9 | [
"MIT"
] | null | null | null | zeitslots_to_json.py | omehling/faim_website | 0131c834dc6e653ce5c890723b433a43bb1628b9 | [
"MIT"
] | null | null | null | zeitslots_to_json.py | omehling/faim_website | 0131c834dc6e653ce5c890723b433a43bb1628b9 | [
"MIT"
] | null | null | null | import pandas as pd
dfcsv=pd.read_csv('gruppen-zeitslots-vers3.csv')
dfcsv.T.to_json('gruppen-zeitslots.json') | 36.666667 | 48 | 0.8 | import pandas as pd
dfcsv=pd.read_csv('gruppen-zeitslots-vers3.csv')
dfcsv.T.to_json('gruppen-zeitslots.json') | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
79630b8839e196ad7f6a72e593d07acd38b792fc | 482 | py | Python | python/asyncio/coding_dojang/urlopen.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/asyncio/coding_dojang/urlopen.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | python/asyncio/coding_dojang/urlopen.py | zeroam/TIL | 43e3573be44c7f7aa4600ff8a34e99a65cbdc5d1 | [
"MIT"
] | null | null | null | from time import time
from urllib.request import Request, urlopen
urls = [
"https://www.google.com/search?q=" + i
for i in ["apple", "pear", "grape", "pineapple", "orange", "strawberry", "pie", "helloworld"]
]
begin = time()
result = []
for url in urls:
request = Request(url, headers={"User-Agent": "Mozil... | 24.1 | 97 | 0.636929 | from time import time
from urllib.request import Request, urlopen
urls = [
"https://www.google.com/search?q=" + i
for i in ["apple", "pear", "grape", "pineapple", "orange", "strawberry", "pie", "helloworld"]
]
begin = time()
result = []
for url in urls:
request = Request(url, headers={"User-Agent": "Mozil... | 15 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c802e5b2fab877ebd4d024d2a3ec2028a5ed42c9 | 3,927 | py | Python | authors/apps/authentication/tests/test_social_auth.py | bl4ck4ndbr0wn/ah-centauri-backend | 5a31840856de4b361fe2594dfa7a33d7774d3fe2 | [
"BSD-3-Clause"
] | 1 | 2019-04-29T15:22:42.000Z | 2019-04-29T15:22:42.000Z | authors/apps/authentication/tests/test_social_auth.py | andela/ah-centauri-backend | 5a31840856de4b361fe2594dfa7a33d7774d3fe2 | [
"BSD-3-Clause"
] | 20 | 2019-03-28T10:50:53.000Z | 2022-02-10T07:48:36.000Z | authors/apps/authentication/tests/test_social_auth.py | bl4ck4ndbr0wn/ah-centauri-backend | 5a31840856de4b361fe2594dfa7a33d7774d3fe2 | [
"BSD-3-Clause"
] | 6 | 2019-05-21T22:28:08.000Z | 2020-03-12T08:35:34.000Z | from django.urls import reverse
FACEBOOK_URL = reverse('authentication:facebook')
GOOGLE_URL = reverse('authentication:google')
TWITTER_URL = reverse('authentication:twitter')
GOOGLE_VALIDATION = "authors.apps.authentication.validators.SocialValidation.google_auth_validation"
FACEBOOK_VALIDATION = "authors.apps.aut... | 35.0625 | 104 | 0.586453 | from unittest.mock import patch
from django.contrib.auth import get_user_model
from django.test import TestCase
from django.urls import reverse
from rest_framework import status
from rest_framework.test import APIClient
FACEBOOK_URL = reverse('authentication:facebook')
GOOGLE_URL = reverse('authentication:google')
T... | 0 | 0 | 0 | 2,925 | 0 | 276 | 0 | 78 | 157 |
67ac1da7291971e09db296fbc7c7676ef681ca68 | 2,396 | py | Python | tools/check_font.py | Sand0001/OCR_textrender_jap_chn_eng | 87a01946bb8cd5229d2babcdf42a18df5b3e561f | [
"MIT"
] | null | null | null | tools/check_font.py | Sand0001/OCR_textrender_jap_chn_eng | 87a01946bb8cd5229d2babcdf42a18df5b3e561f | [
"MIT"
] | null | null | null | tools/check_font.py | Sand0001/OCR_textrender_jap_chn_eng | 87a01946bb8cd5229d2babcdf42a18df5b3e561f | [
"MIT"
] | null | null | null | import argparse
import glob
import sys
import os
sys.path.insert(0, os.path.abspath(os.path.join(__file__, '../', '../')))
from libs.utils import load_chars
from libs.font_utils import check_font_chars, load_font
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Find chars not support by so... | 34.724638 | 103 | 0.595993 | import argparse
import glob
import sys
import os
import time
sys.path.insert(0, os.path.abspath(os.path.join(__file__, '../', '../')))
from libs.utils import load_chars
from libs.font_utils import check_font_chars, load_font
if __name__ == '__main__':
parser = argparse.ArgumentParser(description='Find chars not s... | 42 | 0 | 0 | 0 | 0 | 0 | 0 | -10 | 22 |
cb660e588ed2dd70b693eef97f7dfea88a3495e4 | 3,526 | py | Python | bot.py | teamshortcut/Discord-Nickname-Moderation | 6a2b9993516fec1d9c086481f74b456e5c73ae10 | [
"MIT"
] | null | null | null | bot.py | teamshortcut/Discord-Nickname-Moderation | 6a2b9993516fec1d9c086481f74b456e5c73ae10 | [
"MIT"
] | 1 | 2021-03-12T03:57:06.000Z | 2021-03-12T03:57:06.000Z | bot.py | teamshortcut/Discord-Nickname-Moderation | 6a2b9993516fec1d9c086481f74b456e5c73ae10 | [
"MIT"
] | 2 | 2021-04-19T16:53:59.000Z | 2022-02-09T16:15:09.000Z | # Import libraries
import discord
TOKEN = "XXXX"
ADMIN_ROLES = [00000000000000000, 00000000000000000] # insert numerical IDs of admin roles here - bot will ignore changes made by these users
BOT_ROLE_ID = 00000000000000000 # numerical ID of the role given to this bot - changes made by this role will be ignored
STATIC_... | 39.177778 | 141 | 0.663925 | # Import libraries
import discord
import re
TOKEN = "XXXX"
ADMIN_ROLES = [00000000000000000, 00000000000000000] # insert numerical IDs of admin roles here - bot will ignore changes made by these users
BOT_ROLE_ID = 00000000000000000 # numerical ID of the role given to this bot - changes made by this role will be ignor... | 0 | 2,297 | 0 | 0 | 0 | 158 | 0 | -12 | 133 |
aa873def05e9db96cd1bc0704efa07caa7039686 | 84 | py | Python | cities/admin.py | seanbradley/Simpletown | d14dffba5030b574be3e01f8792a97ec0c049df4 | [
"Apache-2.0"
] | 3 | 2015-10-23T13:00:02.000Z | 2020-02-08T11:04:53.000Z | cities/admin.py | seanbradley/Simpletown | d14dffba5030b574be3e01f8792a97ec0c049df4 | [
"Apache-2.0"
] | null | null | null | cities/admin.py | seanbradley/Simpletown | d14dffba5030b574be3e01f8792a97ec0c049df4 | [
"Apache-2.0"
] | null | null | null | from django.contrib import admin
from models import City
admin.site.register(City)
| 16.8 | 32 | 0.821429 | from django.contrib import admin
from models import City
admin.site.register(City)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8aebaea1e05dbd49fc9ab031ea56513c5e1a57f2 | 124 | py | Python | tests/__init__.py | EricaMaurer/db-factfinder | 6f8b73f927673a7d2587fda070b140828df98fdf | [
"MIT"
] | null | null | null | tests/__init__.py | EricaMaurer/db-factfinder | 6f8b73f927673a7d2587fda070b140828df98fdf | [
"MIT"
] | 112 | 2020-10-29T20:10:59.000Z | 2021-09-13T18:53:49.000Z | tests/__init__.py | EricaMaurer/db-factfinder | 6f8b73f927673a7d2587fda070b140828df98fdf | [
"MIT"
] | 1 | 2021-07-20T00:45:02.000Z | 2021-07-20T00:45:02.000Z | import os
from dotenv import load_dotenv
# Load environmental variables
load_dotenv()
api_key = os.environ.get("API_KEY")
| 15.5 | 35 | 0.790323 | import os
from dotenv import load_dotenv
# Load environmental variables
load_dotenv()
api_key = os.environ.get("API_KEY")
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ca5faaf822b2e0d12c4c15f7e6e821e93d98f9b7 | 12,479 | py | Python | Pyscripts/ShortPaper/4.PlotFunction/PF04_FRIpredict.py | ArdenB/fireflies | cff2d6292c30fc49f0d1564b135c5c4abd75fdc8 | [
"MIT"
] | null | null | null | Pyscripts/ShortPaper/4.PlotFunction/PF04_FRIpredict.py | ArdenB/fireflies | cff2d6292c30fc49f0d1564b135c5c4abd75fdc8 | [
"MIT"
] | null | null | null | Pyscripts/ShortPaper/4.PlotFunction/PF04_FRIpredict.py | ArdenB/fireflies | cff2d6292c30fc49f0d1564b135c5c4abd75fdc8 | [
"MIT"
] | null | null | null | """
Script goal,
Predict future FRI based on current climate
"""
#==============================================================================
__title__ = "FRI Prediction"
__author__ = "Arden Burrell"
__version__ = "v1.0(27.11.2019)"
__email__ = "arden.burrell@gmail.com"
#===========================... | 34.567867 | 235 | 0.613911 | """
Script goal,
Predict future FRI based on current climate
"""
#==============================================================================
__title__ = "FRI Prediction"
__author__ = "Arden Burrell"
__version__ = "v1.0(27.11.2019)"
__email__ = "arden.burrell@gmail.com"
#===========================... | 0 | 0 | 0 | 0 | 0 | 9,809 | 0 | 121 | 632 |
d3ee9f9356b31161f861448a85c20e84aed5649c | 1,681 | py | Python | examples/diffusion/time_advection_diffusion.py | Gkdnz/SfePy | a3a39d4e087705e9e0e8884cbf63513a2ded2108 | [
"BSD-3-Clause"
] | null | null | null | examples/diffusion/time_advection_diffusion.py | Gkdnz/SfePy | a3a39d4e087705e9e0e8884cbf63513a2ded2108 | [
"BSD-3-Clause"
] | null | null | null | examples/diffusion/time_advection_diffusion.py | Gkdnz/SfePy | a3a39d4e087705e9e0e8884cbf63513a2ded2108 | [
"BSD-3-Clause"
] | null | null | null | r"""
The transient advection-diffusion equation with a given divergence-free
advection velocity.
Find :math:`u` such that:
.. math::
\int_{\Omega} s \pdiff{u}{t}
+ \int_{\Omega} s \nabla \cdot \left(\ul{v} u \right)
+ \int_{\Omega} D \nabla s \cdot \nabla u
= 0
\;, \quad \forall s \;.
View the re... | 20.753086 | 71 | 0.501487 | r"""
The transient advection-diffusion equation with a given divergence-free
advection velocity.
Find :math:`u` such that:
.. math::
\int_{\Omega} s \pdiff{u}{t}
+ \int_{\Omega} s \nabla \cdot \left(\ul{v} u \right)
+ \int_{\Omega} D \nabla s \cdot \nabla u
= 0
\;, \quad \forall s \;.
View the re... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
15823c0ba5903b7438dc729199f5b920f1e59f37 | 17,515 | py | Python | outputModel4.py | lpeska/RecSysChallenge2018 | 0783f1b4ba58b1f2fe85b65267395e16543281c8 | [
"Apache-2.0"
] | null | null | null | outputModel4.py | lpeska/RecSysChallenge2018 | 0783f1b4ba58b1f2fe85b65267395e16543281c8 | [
"Apache-2.0"
] | null | null | null | outputModel4.py | lpeska/RecSysChallenge2018 | 0783f1b4ba58b1f2fe85b65267395e16543281c8 | [
"Apache-2.0"
] | null | null | null | """
shows deep stats for the MPD
- calculates similarity and multiplies it with the track popularity
- if the track was unknown, decrease its similarity weight
usage:
python deeper_stats.py path-to-mpd-data/
"""
#import sys
#from sklearn.neighbors import NearestNeighbors
MOST_POPULAR_WEIGHT = ... | 36.951477 | 206 | 0.641793 | """
shows deep stats for the MPD
- calculates similarity and multiplies it with the track popularity
- if the track was unknown, decrease its similarity weight
usage:
python deeper_stats.py path-to-mpd-data/
"""
#import sys
import json
import re
import collections
import os
import gzip
import p... | 0 | 0 | 0 | 0 | 0 | 15,498 | 0 | -65 | 403 |
5e726286e55675f000d6f71caa71094e39fdd5d2 | 9,496 | py | Python | tests/test_params.py | pyadorn/adorn | a34a9a20c1a80c7bdbee0fa641c2bd17e20e60e6 | [
"Apache-2.0"
] | 3 | 2021-12-11T03:52:57.000Z | 2022-03-22T20:42:56.000Z | tests/test_params.py | pyadorn/adorn | a34a9a20c1a80c7bdbee0fa641c2bd17e20e60e6 | [
"Apache-2.0"
] | 12 | 2021-12-31T19:22:09.000Z | 2022-03-21T03:49:13.000Z | tests/test_params.py | pyadorn/adorn | a34a9a20c1a80c7bdbee0fa641c2bd17e20e60e6 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Jacob Baumbach
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 28.775758 | 86 | 0.553496 | # Copyright 2021 Jacob Baumbach
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writin... | 0 | 1,115 | 0 | 0 | 0 | 5,432 | 0 | 86 | 774 |
e4cdd874b0855d578d87dc339527e33b980429ac | 371 | py | Python | hw05/filefuzzer.py | jake-billings/edu-csci2312 | 4220a3e2859299b9d2ebfc43f01f69d440198979 | [
"MIT"
] | 1 | 2020-12-02T23:18:13.000Z | 2020-12-02T23:18:13.000Z | hw05/filefuzzer.py | jake-billings/edu-csci2312 | 4220a3e2859299b9d2ebfc43f01f69d440198979 | [
"MIT"
] | null | null | null | hw05/filefuzzer.py | jake-billings/edu-csci2312 | 4220a3e2859299b9d2ebfc43f01f69d440198979 | [
"MIT"
] | 1 | 2020-11-15T10:51:27.000Z | 2020-11-15T10:51:27.000Z | # filefuzzer.py
#
# python script
#
# "file fuzzer"
#
# generates a bunch of random data using os.urandom then writes it to fuzzy.csv
# this was used to generate fuzzy.csv
# fuzzy.csv is used to test error handling when reading data
import os
with open('fuzzy.csv', 'wb') as fout:
fout.write(os.urandom(1024*50)) # ... | 28.538462 | 89 | 0.738544 | # filefuzzer.py
#
# python script
#
# "file fuzzer"
#
# generates a bunch of random data using os.urandom then writes it to fuzzy.csv
# this was used to generate fuzzy.csv
# fuzzy.csv is used to test error handling when reading data
import os
with open('fuzzy.csv', 'wb') as fout:
fout.write(os.urandom(1024*50)) # ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
a0f76f57a1a7c6578d56dc151d0b2a25ce558cb2 | 1,417 | py | Python | src/docs/gen.py | DancingQuanta/dylos-calibration | 43d067310672a717fc38a69fcc198b274e8a01d9 | [
"MIT"
] | null | null | null | src/docs/gen.py | DancingQuanta/dylos-calibration | 43d067310672a717fc38a69fcc198b274e8a01d9 | [
"MIT"
] | null | null | null | src/docs/gen.py | DancingQuanta/dylos-calibration | 43d067310672a717fc38a69fcc198b274e8a01d9 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# -*- coding: utf-8 -*-
if __name__ == '__main__':
main()
| 29.520833 | 86 | 0.657022 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import os
import argparse
import json
import jinja2
def render_template(templateFile, dataFile, outputFile):
# Setting up Jinja
env = jinja2.Environment(
block_start_string = '\BLOCK{',
block_end_string = '}',
variable_start_string = '\VAR{',
... | 0 | 0 | 0 | 0 | 0 | 1,236 | 0 | -36 | 135 |
fe9b91b62e804e69f40d95be11cc459cbddb71ef | 1,036 | py | Python | tests/plugins/test_gsheet.py | aborruso/frictionless-py | 2b27d87ac042119d93320051c5be78d9ebf954b6 | [
"MIT"
] | null | null | null | tests/plugins/test_gsheet.py | aborruso/frictionless-py | 2b27d87ac042119d93320051c5be78d9ebf954b6 | [
"MIT"
] | null | null | null | tests/plugins/test_gsheet.py | aborruso/frictionless-py | 2b27d87ac042119d93320051c5be78d9ebf954b6 | [
"MIT"
] | null | null | null |
# Loader
| 32.375 | 117 | 0.69305 | import pytest
from frictionless import Table, exceptions
# Loader
@pytest.mark.ci
def test_table_gsheet():
source = "https://docs.google.com/spreadsheets/d/1mHIWnDvW9cALRMq9OdNfRwjAthCUFUOACPp0Lkyl7b4/edit?usp=sharing"
with Table(source) as table:
assert table.header == ["id", "name"]
assert... | 18 | 890 | 0 | 0 | 0 | 0 | 0 | 13 | 113 |
0412907c43eb0232d0e9ab99e97c3d8bf5f10367 | 2,709 | py | Python | lib/tfflat/logger.py | Ascend-Huawei/PoseFix | 9b287934879beadc71daa3a642cbbb4a0feb1db5 | [
"Apache-2.0"
] | null | null | null | lib/tfflat/logger.py | Ascend-Huawei/PoseFix | 9b287934879beadc71daa3a642cbbb4a0feb1db5 | [
"Apache-2.0"
] | null | null | null | lib/tfflat/logger.py | Ascend-Huawei/PoseFix | 9b287934879beadc71daa3a642cbbb4a0feb1db5 | [
"Apache-2.0"
] | 1 | 2021-08-19T09:51:25.000Z | 2021-08-19T09:51:25.000Z | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 33.444444 | 78 | 0.663714 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 0 | 0 | 0 | 1,185 | 0 | 0 | 0 | -7 | 90 |
de681ad28a94811b4a8a2aabf49cc6529b3caaa5 | 434 | py | Python | examples/relay/call-fax-receive.py | ramarketing/signalwire-python | c0663bdd0454faaa39f42af7c936cea1d43e1842 | [
"MIT"
] | 23 | 2018-12-19T14:48:18.000Z | 2022-01-11T03:58:36.000Z | examples/relay/call-fax-receive.py | ramarketing/signalwire-python | c0663bdd0454faaa39f42af7c936cea1d43e1842 | [
"MIT"
] | 13 | 2018-10-17T12:57:54.000Z | 2021-09-01T21:46:01.000Z | examples/relay/call-fax-receive.py | ramarketing/signalwire-python | c0663bdd0454faaa39f42af7c936cea1d43e1842 | [
"MIT"
] | 12 | 2020-01-21T14:29:43.000Z | 2022-01-11T07:48:06.000Z |
r = Receiver()
r.run()
| 22.842105 | 46 | 0.670507 | import logging
import os
from signalwire.relay.consumer import Consumer
class Receiver(Consumer):
def setup(self):
self.project = os.getenv('PROJECT', '')
self.token = os.getenv('TOKEN', '')
self.contexts = ['office', 'home']
async def on_incoming_call(self, call):
await call.answer()
fax = aw... | 0 | 0 | 144 | 171 | 0 | 0 | 0 | 6 | 89 |
48ae91ed24a763379f1ead4b74dffcdc57bb4a12 | 1,557 | py | Python | plugins/multiarch.py | Ferruck/basement | cbd2542abc66ba3df1636fb560681be1ab1623d2 | [
"MIT"
] | 5 | 2016-12-05T12:18:52.000Z | 2022-03-13T00:08:01.000Z | plugins/multiarch.py | Ferruck/basement | cbd2542abc66ba3df1636fb560681be1ab1623d2 | [
"MIT"
] | 97 | 2019-09-03T18:53:45.000Z | 2022-03-31T19:42:31.000Z | plugins/multiarch.py | Ferruck/basement | cbd2542abc66ba3df1636fb560681be1ab1623d2 | [
"MIT"
] | 10 | 2017-05-07T19:43:34.000Z | 2021-09-06T19:51:45.000Z |
# TODO: support more architectures; support musl/dietlibc
# get host architecture
# get host autoconf triple
# set or replace vendor field in autoconf triplet
manifest = {
'apiVersion' : "0.15",
'stringFunctions' : {
"gen-autoconf" : genAutoconf,
"host-arch" : hostArch,
"host-autoco... | 28.309091 | 71 | 0.622351 | from bob.errors import ParseError
import fnmatch
import platform
# TODO: support more architectures; support musl/dietlibc
# get host architecture
def hostArch(args, **options):
m = platform.uname().machine
if m == "x86_64":
return m
elif m == "AMD64":
return "x86_64"
elif m.startswith... | 0 | 0 | 0 | 0 | 0 | 1,078 | 0 | -1 | 132 |
64e7e94c97dd6fe47aed97415cb479c976c502ab | 4,927 | py | Python | wallets/viewsets.py | narnikgamarnikus/wallets | 651adf6f422fcd61be0142247404145743a8b51d | [
"MIT"
] | 1 | 2019-06-03T15:26:17.000Z | 2019-06-03T15:26:17.000Z | wallets/viewsets.py | narnikgamarnikus/wallets | 651adf6f422fcd61be0142247404145743a8b51d | [
"MIT"
] | null | null | null | wallets/viewsets.py | narnikgamarnikus/wallets | 651adf6f422fcd61be0142247404145743a8b51d | [
"MIT"
] | 1 | 2021-05-13T01:21:46.000Z | 2021-05-13T01:21:46.000Z |
'''
class BcyViewSet(BaseViewSet):
"""
A simple ViewSet for listing or retrieving Bitcocins testnet addresses.
"""
serializer_class = BcySerializer
queryset = Bcy.objects.all()
permissions = [IsOwnerOrReadOnly]
model = Bcy
'''
| 31.183544 | 78 | 0.637102 | from .models import Btc, Ltc, Dash, Doge # Bcy
from rest_framework import viewsets
from rest_framework import status
from rest_framework.response import Response
from .serializers import (BtcSerializer, LtcSerializer, DashSerializer,
DogeSerializer, WithdrawSerializer) # BcySerializer
from... | 0 | 2,290 | 0 | 1,583 | 0 | 0 | 0 | 355 | 436 |
860d07cd50283c4ee5ea3d24483d1b15e4c43c18 | 230 | py | Python | django_crud_example/todos/templatetags/string_utils.py | black-redoc/django_crud_example | 143ef8edfd5346087d1c577491460507c87e8e22 | [
"MIT"
] | null | null | null | django_crud_example/todos/templatetags/string_utils.py | black-redoc/django_crud_example | 143ef8edfd5346087d1c577491460507c87e8e22 | [
"MIT"
] | null | null | null | django_crud_example/todos/templatetags/string_utils.py | black-redoc/django_crud_example | 143ef8edfd5346087d1c577491460507c87e8e22 | [
"MIT"
] | null | null | null | from django import template
register = template.Library() | 28.75 | 71 | 0.695652 | from django import template
register = template.Library()
@register.filter
def cut_text(value):
""" returns a cut string if its length is greater than 50 chars """
return value if len(value) <= 50 else f"{value[:50]}..." | 0 | 149 | 0 | 0 | 0 | 0 | 0 | 0 | 23 |
96e7e410438066575ec0b8d259b2e39824ae6702 | 1,585 | py | Python | tests/argus_test.py | riptano/argus | df1f7e772cdaa78632faff8198a12f8947f1dc6d | [
"Apache-2.0"
] | 2 | 2018-02-05T18:13:32.000Z | 2018-04-23T17:08:20.000Z | tests/argus_test.py | riptano/argus | df1f7e772cdaa78632faff8198a12f8947f1dc6d | [
"Apache-2.0"
] | 119 | 2018-02-20T21:15:43.000Z | 2019-03-08T20:43:10.000Z | tests/argus_test.py | riptano/argus | df1f7e772cdaa78632faff8198a12f8947f1dc6d | [
"Apache-2.0"
] | 6 | 2018-02-01T23:01:20.000Z | 2019-12-26T15:35:32.000Z | # Copyright 2018 DataStax, 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 agreed to in writin... | 30.480769 | 74 | 0.704732 | # Copyright 2018 DataStax, 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 agreed to in writin... | 0 | 430 | 0 | 412 | 0 | 0 | 0 | 5 | 113 |
54e303d6ead63b0c056de91b3eaf8e7bf1f18436 | 581 | py | Python | Class_10/exercise4.py | travism16/Python-Course | d8c522fc31c7830c3ceabf7a35022a9e33e1d706 | [
"Apache-2.0"
] | null | null | null | Class_10/exercise4.py | travism16/Python-Course | d8c522fc31c7830c3ceabf7a35022a9e33e1d706 | [
"Apache-2.0"
] | null | null | null | Class_10/exercise4.py | travism16/Python-Course | d8c522fc31c7830c3ceabf7a35022a9e33e1d706 | [
"Apache-2.0"
] | null | null | null | from my_functions import ssh_command2
from my_devices import devices_list
from concurrent.futures import ProcessPoolExecutor, as_completed
from datetime import datetime
start_time = datetime.now()
max_procs = 5
pool = ProcessPoolExecutor(max_procs)
future_list = []
for device in devices_list:
future = pool.submi... | 23.24 | 64 | 0.755594 | from my_functions import ssh_command2
from my_devices import devices_list
from concurrent.futures import ProcessPoolExecutor, as_completed
from datetime import datetime
start_time = datetime.now()
max_procs = 5
pool = ProcessPoolExecutor(max_procs)
future_list = []
for device in devices_list:
future = pool.submi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
75284442863182f2e67bf30020f2f36a68b83ddd | 13,507 | py | Python | baselines/bigcn/model/Twitter/BiGCN_Twitter-ORG.py | JihoChoi/dynamic-gcn-deprecated-TBU | ff315206811b757f2f61f0776917e6a7d43c9379 | [
"MIT"
] | 1 | 2022-02-24T09:17:31.000Z | 2022-02-24T09:17:31.000Z | baselines/bigcn/model/Twitter/BiGCN_Twitter-ORG.py | JihoChoi/dynamic-gcn-deprecated-TBU | ff315206811b757f2f61f0776917e6a7d43c9379 | [
"MIT"
] | null | null | null | baselines/bigcn/model/Twitter/BiGCN_Twitter-ORG.py | JihoChoi/dynamic-gcn-deprecated-TBU | ff315206811b757f2f61f0776917e6a7d43c9379 | [
"MIT"
] | null | null | null | import sys, os
sys.path.append(os.getcwd())
import torch as th
from torch_scatter import scatter_mean
from Process.rand5fold import load5foldData
from torch_geometric.nn import GCNConv
import copy
# th.manual_seed(100)
# th.cuda.manual_seed_all(100)
# random.seed(12345)
# th.manual_seed(12345)
# th.cuda.manual_seed_a... | 42.209375 | 223 | 0.637077 | import sys,os
import random
sys.path.append(os.getcwd())
from Process.process import *
import torch as th
from torch_scatter import scatter_mean
import torch.nn.functional as F
import numpy as np
from tools.earlystopping import EarlyStopping
from torch_geometric.data import DataLoader
from tqdm import tqdm
from Process... | 3 | 0 | 0 | 2,899 | 0 | 6,771 | 0 | 73 | 450 |