hexsha stringlengths 40 40 | size int64 7 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 125 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 125 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 125 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.77 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 7 1.04M | filtered:remove_function_no_docstring int64 -102 942k | filtered:remove_class_no_docstring int64 -354 977k | filtered:remove_delete_markers int64 0 60.1k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
6d6245173ff2c471b2e9485d27570adcc1bc3c40 | 165 | py | Python | exercicios nivel 0/ex014.py | Carlosxc-dev/LINGUAGEM_PYTHON | 5d512038d9c841dea96e4ccea18da76265318199 | [
"MIT"
] | 1 | 2021-11-25T00:29:07.000Z | 2021-11-25T00:29:07.000Z | exercicios nivel 0/ex014.py | Carlosxc-dev/LINGUAGEM_PYTHON | 5d512038d9c841dea96e4ccea18da76265318199 | [
"MIT"
] | null | null | null | exercicios nivel 0/ex014.py | Carlosxc-dev/LINGUAGEM_PYTHON | 5d512038d9c841dea96e4ccea18da76265318199 | [
"MIT"
] | null | null | null | # modulos
import math # bibliotecas com adicionais para o python
n = int(input('digite o n:'))
raiz = math.sqrt(n)
print('a raiz de {} e {:.2f}'.format(n, raiz))
| 20.625 | 55 | 0.654545 | # modulos
import math # bibliotecas com adicionais para o python
n = int(input('digite o n:'))
raiz = math.sqrt(n)
print('a raiz de {} e {:.2f}'.format(n, raiz))
| 0 | 0 | 0 |
7efaded0632a0876bf92bab173f255288ec5ce81 | 12,283 | py | Python | DP_FL_recreate/F_DPAGD_alltoGPU.py | a8252525/DP_FL_recreation | 6981adc044d40d963b49e662374e9ca2b8f5df5c | [
"Apache-2.0"
] | null | null | null | DP_FL_recreate/F_DPAGD_alltoGPU.py | a8252525/DP_FL_recreation | 6981adc044d40d963b49e662374e9ca2b8f5df5c | [
"Apache-2.0"
] | null | null | null | DP_FL_recreate/F_DPAGD_alltoGPU.py | a8252525/DP_FL_recreation | 6981adc044d40d963b49e662374e9ca2b8f5df5c | [
"Apache-2.0"
] | 1 | 2020-12-09T05:56:32.000Z | 2020-12-09T05:56:32.000Z | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
import numpy as np
from torch.utils.tensorboard import SummaryWriter
from torch.utils.data import SubsetRandomSampler
import rando... | 29.037825 | 135 | 0.627941 | #!/usr/bin/env python
# coding: utf-8
# In[1]:
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
import numpy as np
from torch.utils.tensorboard import SummaryWriter
from torch.utils.data import SubsetRandomSampler
import rando... | 7,905 | -3 | 385 |
576a98d337376163c915fb73550443bbe9bb7898 | 4,638 | py | Python | hddm_fit.py | anne-urai/2022_Urai_choicehistory_MEG | b9ef84a193eae45f9a9c6748d5ef4efe0c7caf7d | [
"MIT"
] | 2 | 2022-02-23T10:31:54.000Z | 2022-02-23T10:31:56.000Z | hddm_fit.py | anne-urai/2022_Urai_choicehistory_MEG | b9ef84a193eae45f9a9c6748d5ef4efe0c7caf7d | [
"MIT"
] | null | null | null | hddm_fit.py | anne-urai/2022_Urai_choicehistory_MEG | b9ef84a193eae45f9a9c6748d5ef4efe0c7caf7d | [
"MIT"
] | 1 | 2021-10-19T13:46:13.000Z | 2021-10-19T13:46:13.000Z | """
fit HDDM model, with history terms, to data from IBL mice
Anne Urai, 2019, CSHL
"""
# ============================================ #
# GETTING STARTED
# ============================================ #
import matplotlib as mpl
mpl.use('Agg') # to still plot even when no display is defined
from optparse import Opt... | 30.715232 | 93 | 0.555412 | """
fit HDDM model, with history terms, to data from IBL mice
Anne Urai, 2019, CSHL
"""
# ============================================ #
# GETTING STARTED
# ============================================ #
import matplotlib as mpl
mpl.use('Agg') # to still plot even when no display is defined
from optparse import Opt... | 0 | 0 | 0 |
c783329b7c6b84c015335fac713f25e0de7cf26c | 2,759 | py | Python | backend/kernel/Entities/User.py | josuuribe/sapereaude | 2e221fa9c5cc5c1a5fa927146e15bfd950766009 | [
"Apache-2.0"
] | null | null | null | backend/kernel/Entities/User.py | josuuribe/sapereaude | 2e221fa9c5cc5c1a5fa927146e15bfd950766009 | [
"Apache-2.0"
] | null | null | null | backend/kernel/Entities/User.py | josuuribe/sapereaude | 2e221fa9c5cc5c1a5fa927146e15bfd950766009 | [
"Apache-2.0"
] | null | null | null | from kernel.Entities import Command
class User:
"""
Class that represents a user entity that stores all functionality related to
application user.
"""
def get_id(self):
"""
Get user id.
:return: The user id.
"""
return self.__id__
def set_id(self, id):... | 26.27619 | 99 | 0.550199 | from kernel.Entities import Command
class User:
"""
Class that represents a user entity that stores all functionality related to
application user.
"""
def __init__(self):
self.__id__ = None
self.__name__ = None
self.__code__ = None
self.__commands__ = list()
... | 145 | 0 | 27 |
bd898c24cc8b3279692a479e6ea107e5ace24256 | 11,391 | py | Python | solvers/brick_heads/part_selection.py | Anthony102899/Lego-ImageGenerator | 52b19c8bb20f77a3394675e7c037c943a50c1e15 | [
"Unlicense"
] | 1 | 2022-03-20T10:23:38.000Z | 2022-03-20T10:23:38.000Z | solvers/brick_heads/part_selection.py | Anthony102899/Lego-ImageGenerator | 52b19c8bb20f77a3394675e7c037c943a50c1e15 | [
"Unlicense"
] | null | null | null | solvers/brick_heads/part_selection.py | Anthony102899/Lego-ImageGenerator | 52b19c8bb20f77a3394675e7c037c943a50c1e15 | [
"Unlicense"
] | null | null | null | from bricks_modeling.database import ldraw_colors
from typing import List
import solvers.brick_heads.config as conf
from bricks_modeling.file_IO.model_reader import read_bricks_from_file
import os
from typing import Tuple
from solvers.brick_heads import texture_to_brick
from solvers.brick_heads.lego_util import get_ran... | 30.786486 | 128 | 0.653235 | from bricks_modeling.database import ldraw_colors
from typing import List
import solvers.brick_heads.config as conf
from bricks_modeling.file_IO.model_reader import read_bricks_from_file
import os
from typing import Tuple
from solvers.brick_heads import texture_to_brick
from solvers.brick_heads.lego_util import get_ran... | 10,522 | 0 | 298 |
7880458bccb12da78c7a14002582207fcad7c2d2 | 3,387 | py | Python | example/squeeze_net/model_keras.py | steerapi/webdnn | 1df51cc094e5a528cfd3452c264905708eadb491 | [
"MIT"
] | 1 | 2018-07-26T13:52:21.000Z | 2018-07-26T13:52:21.000Z | example/squeeze_net/model_keras.py | steerapi/webdnn | 1df51cc094e5a528cfd3452c264905708eadb491 | [
"MIT"
] | null | null | null | example/squeeze_net/model_keras.py | steerapi/webdnn | 1df51cc094e5a528cfd3452c264905708eadb491 | [
"MIT"
] | null | null | null | """
This source code is created based on https://github.com/wohlert/keras-squeezenet
---------------------------------------------------------------------------------------------------------------------------------------
https://github.com/wohlert/keras-squeezenet
MIT License
Copyright (c) 2016 Jesper Wohlert
Permi... | 43.987013 | 135 | 0.680543 | """
This source code is created based on https://github.com/wohlert/keras-squeezenet
---------------------------------------------------------------------------------------------------------------------------------------
https://github.com/wohlert/keras-squeezenet
MIT License
Copyright (c) 2016 Jesper Wohlert
Permi... | 1,669 | 0 | 46 |
8a0aabb9016d9eb961db1fd58af12b948aa8dded | 14,934 | py | Python | sonic_package_manager/main.py | sg893052/sonic-utilities | fdb79b8d65b8ca22232f4e6b140f593dd01613d5 | [
"Apache-2.0"
] | 1 | 2022-01-29T01:31:49.000Z | 2022-01-29T01:31:49.000Z | sonic_package_manager/main.py | sg893052/sonic-utilities | fdb79b8d65b8ca22232f4e6b140f593dd01613d5 | [
"Apache-2.0"
] | 6 | 2021-03-17T18:55:32.000Z | 2021-12-17T07:00:27.000Z | sonic_package_manager/main.py | sg893052/sonic-utilities | fdb79b8d65b8ca22232f4e6b140f593dd01613d5 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import functools
import json
import os
import sys
import typing
import click
import click_log
import tabulate
from natsort import natsorted
from sonic_package_manager.database import PackageEntry, PackageDatabase
from sonic_package_manager.errors import PackageManagerError
from sonic_package_ma... | 31.978587 | 131 | 0.623878 | #!/usr/bin/env python
import functools
import json
import os
import sys
import typing
import click
import click_log
import tabulate
from natsort import natsorted
from sonic_package_manager.database import PackageEntry, PackageDatabase
from sonic_package_manager.errors import PackageManagerError
from sonic_package_ma... | 1,076 | 0 | 81 |
14864e9ce1e48da428f75c8d09596b5ba3faa26e | 627 | py | Python | watermelonbook/3.5linear_discriminant_analysis.py | zjhdota/practice | de28003e7adf6140dfc06a1ffa3a808e514dbbc0 | [
"MIT"
] | 1 | 2018-01-10T11:08:48.000Z | 2018-01-10T11:08:48.000Z | watermelonbook/3.5linear_discriminant_analysis.py | zjhdota/practice | de28003e7adf6140dfc06a1ffa3a808e514dbbc0 | [
"MIT"
] | 1 | 2021-01-31T04:21:48.000Z | 2021-01-31T04:21:48.000Z | watermelonbook/3.5linear_discriminant_analysis.py | zjhdota/practice | de28003e7adf6140dfc06a1ffa3a808e514dbbc0 | [
"MIT"
] | null | null | null | import numpy as np
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
from sklearn.model_selection import train_test_split
from sklearn import metrics
data = np.loadtxt('watermelon_data.csv', delimiter=',')
X = data[:, 1:3]
y = data[:, 3]
X_train, X_test, y_train, y_test = train_test_split(X, y, te... | 29.857143 | 88 | 0.776715 | import numpy as np
from sklearn.discriminant_analysis import LinearDiscriminantAnalysis
from sklearn.model_selection import train_test_split
from sklearn import metrics
data = np.loadtxt('watermelon_data.csv', delimiter=',')
X = data[:, 1:3]
y = data[:, 3]
X_train, X_test, y_train, y_test = train_test_split(X, y, te... | 0 | 0 | 0 |
33a573c0c07d5124e7908c07ee3064cda87eb02d | 18,833 | py | Python | ipapi/ipt/ipt_keep_countours_near_rois.py | tpmp-inra/ipso_cli | 6de4097dcb1536b546d9e2cdeb61057e5f931537 | [
"MIT"
] | null | null | null | ipapi/ipt/ipt_keep_countours_near_rois.py | tpmp-inra/ipso_cli | 6de4097dcb1536b546d9e2cdeb61057e5f931537 | [
"MIT"
] | 1 | 2020-11-10T15:23:41.000Z | 2020-11-10T15:23:41.000Z | ipapi/ipt/ipt_keep_countours_near_rois.py | tpmp-inra/ipso_cli | 6de4097dcb1536b546d9e2cdeb61057e5f931537 | [
"MIT"
] | null | null | null | import logging
logger = logging.getLogger(__name__)
import numpy as np
import cv2
from ipapi.base.ipt_abstract import IptBase
from ipapi.base import ip_common as ipc
| 42.899772 | 112 | 0.449636 | import logging
logger = logging.getLogger(__name__)
import numpy as np
import cv2
from ipapi.base.ipt_abstract import IptBase
from ipapi.base import ip_common as ipc
class IptKeepCountoursNearRois(IptBase):
def build_params(self):
self.add_enabled_checkbox()
self.add_roi_selector(... | 3,912 | 14,717 | 24 |
e22e852e8c6d47efb939fd42202b1c11a7255c4f | 3,585 | py | Python | daemon/core/emulator/sessionconfig.py | b00ga/core | e0842197e389f3f14c73dc5db6cc26f78e665f62 | [
"BSD-2-Clause"
] | null | null | null | daemon/core/emulator/sessionconfig.py | b00ga/core | e0842197e389f3f14c73dc5db6cc26f78e665f62 | [
"BSD-2-Clause"
] | null | null | null | daemon/core/emulator/sessionconfig.py | b00ga/core | e0842197e389f3f14c73dc5db6cc26f78e665f62 | [
"BSD-2-Clause"
] | null | null | null | from typing import Any, List
from core.config import ConfigurableManager, ConfigurableOptions, Configuration
from core.emulator.enumerations import ConfigDataTypes, RegisterTlvs
from core.plugins.sdt import Sdt
class SessionConfig(ConfigurableManager, ConfigurableOptions):
"""
Provides session configuration.... | 32.008929 | 86 | 0.597211 | from typing import Any, List
from core.config import ConfigurableManager, ConfigurableOptions, Configuration
from core.emulator.enumerations import ConfigDataTypes, RegisterTlvs
from core.plugins.sdt import Sdt
class SessionConfig(ConfigurableManager, ConfigurableOptions):
"""
Provides session configuration.... | 81 | 0 | 27 |
eb910a9241b0454c8f96bf68d8ce64ff1059a689 | 234 | py | Python | 0/4/4153/4153.py | chr0m3/boj-codes | d71d0a22d0a3ae62c225f382442461275f56fe8f | [
"MIT"
] | 3 | 2017-07-08T16:29:06.000Z | 2020-07-20T00:17:45.000Z | 0/4/4153/4153.py | chr0m3/boj-codes | d71d0a22d0a3ae62c225f382442461275f56fe8f | [
"MIT"
] | null | null | null | 0/4/4153/4153.py | chr0m3/boj-codes | d71d0a22d0a3ae62c225f382442461275f56fe8f | [
"MIT"
] | 2 | 2017-11-20T14:06:06.000Z | 2020-07-20T00:17:47.000Z | while True:
lengths = list(map(int, input().split()))
lengths.sort()
if lengths[2] == 0:
break
if lengths[0] ** 2 + lengths[1] ** 2 == lengths[2] ** 2:
print('right')
else:
print('wrong')
| 19.5 | 60 | 0.495726 | while True:
lengths = list(map(int, input().split()))
lengths.sort()
if lengths[2] == 0:
break
if lengths[0] ** 2 + lengths[1] ** 2 == lengths[2] ** 2:
print('right')
else:
print('wrong')
| 0 | 0 | 0 |
105ed07870376eaa6c5b9310a6e97efb05c08b47 | 2,579 | py | Python | identidude/forms.py | laurivosandi/identidude | 7302775bd97ab9f845bc686835c763028adcf76e | [
"MIT"
] | 6 | 2017-06-10T16:21:14.000Z | 2021-01-10T08:03:24.000Z | identidude/forms.py | laurivosandi/ldap2rest | 7302775bd97ab9f845bc686835c763028adcf76e | [
"MIT"
] | null | null | null | identidude/forms.py | laurivosandi/ldap2rest | 7302775bd97ab9f845bc686835c763028adcf76e | [
"MIT"
] | 3 | 2018-08-26T21:53:28.000Z | 2020-05-15T22:51:16.000Z |
import re
import falcon
RE_CHECKBOX = re.compile(r"(on|yes|1|true)$", re.IGNORECASE)
RE_USERNAME = re.compile(r"[a-z][a-z0-9]{1,31}$")
RE_PASSWORD = re.compile(r"[A-Za-z0-9@#$%^&+=]{8,}$")
RE_DATE = re.compile(r"\d\d\d\d-\d\d-\d\d$")
RE_PHONE = re.compile(r"\+[0-9]+( [0-9]+)*$")
RE_EMAIL = re.compile(r"(^[-!#$%&'*+/=... | 47.759259 | 209 | 0.579682 |
import re
import falcon
RE_CHECKBOX = re.compile(r"(on|yes|1|true)$", re.IGNORECASE)
RE_USERNAME = re.compile(r"[a-z][a-z0-9]{1,31}$")
RE_PASSWORD = re.compile(r"[A-Za-z0-9@#$%^&+=]{8,}$")
RE_DATE = re.compile(r"\d\d\d\d-\d\d-\d\d$")
RE_PHONE = re.compile(r"\+[0-9]+( [0-9]+)*$")
RE_EMAIL = re.compile(r"(^[-!#$%&'*+/=... | 1,959 | 0 | 46 |
77fd2f79cb8c85d343c0c09d6554c0a9fe55b593 | 1,515 | py | Python | example/perfbench/protein-time-to-solution.py | yhtang/GraphDot | 3d5ed4fbb2f6912052baa42780b436da76979691 | [
"BSD-3-Clause-LBNL"
] | 9 | 2020-02-14T18:07:39.000Z | 2021-12-15T12:07:31.000Z | example/perfbench/protein-time-to-solution.py | yhtang/graphdot | 3d5ed4fbb2f6912052baa42780b436da76979691 | [
"BSD-3-Clause-LBNL"
] | 3 | 2020-03-19T19:07:26.000Z | 2021-02-24T06:08:51.000Z | example/perfbench/protein-time-to-solution.py | yhtang/graphdot | 3d5ed4fbb2f6912052baa42780b436da76979691 | [
"BSD-3-Clause-LBNL"
] | 3 | 2019-10-17T06:11:18.000Z | 2021-05-07T11:56:33.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Performance benchmark on molecular graphs generated from protein crystal
structures."""
import json
import sys
import os
import re
from ase import Atoms
from graphdot.graph import Graph
from graphdot.kernel.molecular import Tang2019MolecularKernel
arg_dict = {}
for arg ... | 25.677966 | 75 | 0.623102 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Performance benchmark on molecular graphs generated from protein crystal
structures."""
import json
import sys
import os
import re
from ase import Atoms
from graphdot.graph import Graph
from graphdot.kernel.molecular import Tang2019MolecularKernel
arg_dict = {}
for arg ... | 0 | 0 | 0 |
669832230136a3fa9c9693ee1ea936065e9f4912 | 201 | py | Python | codestepbystep/crawl.py | aleeper/python_sandbox | 2c320e043735f99fac68308fe2692c819cf5a636 | [
"MIT"
] | null | null | null | codestepbystep/crawl.py | aleeper/python_sandbox | 2c320e043735f99fac68308fe2692c819cf5a636 | [
"MIT"
] | null | null | null | codestepbystep/crawl.py | aleeper/python_sandbox | 2c320e043735f99fac68308fe2692c819cf5a636 | [
"MIT"
] | null | null | null | import os
if __name__ == '__main__':
main()
| 14.357143 | 51 | 0.641791 | import os
def crawl(filename, indent = ""):
files = os.listdir(filename)
print(files)
def main():
crawl("/Users/leeper/Documents/aleeper-config")
if __name__ == '__main__':
main()
| 104 | 0 | 46 |
82c99b63b4a52834c56e86aee079a341a11360fb | 4,691 | py | Python | pyscf/lib/tblis_einsum.py | crisely09/pyscf | cb92f7974bd9c87c0ef5b2b52abf5d3219b3d6b6 | [
"Apache-2.0"
] | 1 | 2020-01-05T13:50:50.000Z | 2020-01-05T13:50:50.000Z | pyscf/lib/tblis_einsum.py | crisely09/pyscf | cb92f7974bd9c87c0ef5b2b52abf5d3219b3d6b6 | [
"Apache-2.0"
] | null | null | null | pyscf/lib/tblis_einsum.py | crisely09/pyscf | cb92f7974bd9c87c0ef5b2b52abf5d3219b3d6b6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. 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
#
# U... | 35.537879 | 80 | 0.661053 | #!/usr/bin/env python
# Copyright 2014-2018 The PySCF Developers. 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
#
# U... | 0 | 0 | 0 |
0c40c949bdd68969b7dad841c9c9d72e0c453b92 | 1,899 | py | Python | addTweetTextColumn.py | AntonisKotsis/Polarization-Measurements | 777c22616a7915d878080f23015f08b1121d4f9c | [
"MIT"
] | null | null | null | addTweetTextColumn.py | AntonisKotsis/Polarization-Measurements | 777c22616a7915d878080f23015f08b1121d4f9c | [
"MIT"
] | null | null | null | addTweetTextColumn.py | AntonisKotsis/Polarization-Measurements | 777c22616a7915d878080f23015f08b1121d4f9c | [
"MIT"
] | null | null | null | import sqlite3
import tweepy as tw
# Author:Mitos-Kotsis Antonios #
# cs3028@uoi.gr #
#========================================================#
db_connection=sqlite3.connect('tweet.db')
cursor=db_connection.cursor()
update_cursor=db_connection.cursor()
#Defining personal dev keys
consumer_key=''
c... | 33.910714 | 98 | 0.745656 | import sqlite3
import tweepy as tw
# Author:Mitos-Kotsis Antonios #
# cs3028@uoi.gr #
#========================================================#
db_connection=sqlite3.connect('tweet.db')
cursor=db_connection.cursor()
update_cursor=db_connection.cursor()
#Defining personal dev keys
consumer_key=''
c... | 0 | 0 | 0 |
4cf9383fedde96336a4c27bc7722954acadef078 | 6,581 | py | Python | scripts/svi_mlp_regression_demo_tfp.py | vipavlovic/pyprobml | 59a2edc682d0163955db5e2f27491ad772b60141 | [
"MIT"
] | 4,895 | 2016-08-17T22:28:34.000Z | 2022-03-31T17:07:15.000Z | scripts/svi_mlp_regression_demo_tfp.py | vipavlovic/pyprobml | 59a2edc682d0163955db5e2f27491ad772b60141 | [
"MIT"
] | 446 | 2016-09-17T14:35:29.000Z | 2022-03-31T19:59:33.000Z | scripts/svi_mlp_regression_demo_tfp.py | vipavlovic/pyprobml | 59a2edc682d0163955db5e2f27491ad772b60141 | [
"MIT"
] | 1,160 | 2016-08-18T23:19:27.000Z | 2022-03-31T12:44:07.000Z | # Nonlinear regression using variational inference for parameters.
# For simplicity we treat output noise variance as a fixed parameter.
# Adapted from
# https://brendanhasz.github.io/2019/07/23/bayesian-density-net.html
import superimport
from __future__ import absolute_import
from __future__ import division
from _... | 29.511211 | 90 | 0.631211 | # Nonlinear regression using variational inference for parameters.
# For simplicity we treat output noise variance as a fixed parameter.
# Adapted from
# https://brendanhasz.github.io/2019/07/23/bayesian-density-net.html
import superimport
from __future__ import absolute_import
from __future__ import division
from _... | 1,296 | 0 | 71 |
55c26a4c4c096f33b6dfc385c41bb9fb67347a02 | 2,744 | py | Python | molsysmt/_private_tools/set_arguments.py | dprada/molsysmt | 83f150bfe3cfa7603566a0ed4aed79d9b0c97f5d | [
"MIT"
] | null | null | null | molsysmt/_private_tools/set_arguments.py | dprada/molsysmt | 83f150bfe3cfa7603566a0ed4aed79d9b0c97f5d | [
"MIT"
] | null | null | null | molsysmt/_private_tools/set_arguments.py | dprada/molsysmt | 83f150bfe3cfa7603566a0ed4aed79d9b0c97f5d | [
"MIT"
] | null | null | null | from molsysmt._private_tools.exceptions import BadCallError
where_set_argument = {
'atom_name' : ['elements'],
'atom_id' : ['elements'],
'atom_type' : ['elements'],
'group_name' : ['elements'],
'group_id' : ['elements'],
'group_type' : ['elements'],
'component_name' : ['elements'],
'co... | 29.191489 | 84 | 0.62172 | from molsysmt._private_tools.exceptions import BadCallError
where_set_argument = {
'atom_name' : ['elements'],
'atom_id' : ['elements'],
'atom_type' : ['elements'],
'group_name' : ['elements'],
'group_id' : ['elements'],
'group_type' : ['elements'],
'component_name' : ['elements'],
'co... | 446 | 0 | 23 |
a291384b8569c033af6f2f699fda803cc7a2f55d | 121 | py | Python | tools/nuitka-run-script.py | philicheese2003/ToontownProjectAltisServer | cfa225d1bdddacdbd29b621382347fce17e1dc66 | [
"Apache-2.0"
] | 3 | 2020-01-02T08:43:36.000Z | 2020-07-05T08:59:02.000Z | tools/nuitka-run-script.py | philicheese2003/ToontownProjectAltisServer | cfa225d1bdddacdbd29b621382347fce17e1dc66 | [
"Apache-2.0"
] | null | null | null | tools/nuitka-run-script.py | philicheese2003/ToontownProjectAltisServer | cfa225d1bdddacdbd29b621382347fce17e1dc66 | [
"Apache-2.0"
] | 1 | 2020-03-11T17:38:45.000Z | 2020-03-11T17:38:45.000Z | #!C:\Python27_64\python.exe
# -*- coding: utf-8 -*-
# Launcher for Nuitka
import nuitka.__main__
nuitka.__main__.main()
| 17.285714 | 27 | 0.710744 | #!C:\Python27_64\python.exe
# -*- coding: utf-8 -*-
# Launcher for Nuitka
import nuitka.__main__
nuitka.__main__.main()
| 0 | 0 | 0 |
bac60dd3d1a588be55138a9d7b3b329d0326d521 | 603 | py | Python | models/transformer/module/simpleloss_compute.py | MolecularAI/deep-molecular-optimization | 815fecabd210662db1a89c4a2ab13d5e0ff9c037 | [
"Apache-2.0"
] | 52 | 2020-10-30T08:08:11.000Z | 2022-03-31T15:17:30.000Z | models/transformer/module/simpleloss_compute.py | jcheminform/deep-molecular-optimization | d077d9372a3110341480fdd835e165b1b924e526 | [
"Apache-2.0"
] | 2 | 2021-05-20T17:52:03.000Z | 2022-03-30T19:42:53.000Z | models/transformer/module/simpleloss_compute.py | jcheminform/deep-molecular-optimization | d077d9372a3110341480fdd835e165b1b924e526 | [
"Apache-2.0"
] | 12 | 2020-11-12T12:23:59.000Z | 2021-12-30T15:24:09.000Z |
class SimpleLossCompute:
"A simple loss compute and train function."
| 26.217391 | 70 | 0.565506 |
class SimpleLossCompute:
"A simple loss compute and train function."
def __init__(self, generator, loss_function, opt):
self.generator = generator
self.loss_function = loss_function
self.opt = opt
def __call__(self, x, y, norm):
x = self.generator(x)
loss = self.... | 475 | 0 | 54 |
82921f345e7e759c12f6954fa2b4d83ac0c8834a | 5,396 | py | Python | aha/components/dg_sae.py | ProjectAGI/aha | 53a98ea42526dca56517dc97fffad874772f10f2 | [
"Apache-2.0"
] | 2 | 2020-10-08T13:35:24.000Z | 2020-12-19T18:33:36.000Z | aha/components/dg_sae.py | ProjectAGI/aha | 53a98ea42526dca56517dc97fffad874772f10f2 | [
"Apache-2.0"
] | null | null | null | aha/components/dg_sae.py | ProjectAGI/aha | 53a98ea42526dca56517dc97fffad874772f10f2 | [
"Apache-2.0"
] | 1 | 2021-02-02T08:28:06.000Z | 2021-02-02T08:28:06.000Z | # Copyright (C) 2019 Project AGI
#
# 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 writi... | 39.101449 | 99 | 0.676983 | # Copyright (C) 2019 Project AGI
#
# 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 writi... | 812 | 0 | 99 |
e8b188c6e1235de44d96bcb85ef83f96ec08fca9 | 2,659 | py | Python | Test1.py | cfuser/GraphSAGE_in_dgl | 79cc290da76020fdebf52ec9a7cc20505f3b1daa | [
"Apache-2.0"
] | 3 | 2021-12-22T10:57:31.000Z | 2022-03-06T18:58:55.000Z | Test1.py | cfuser/GraphSAGE_in_dgl | 79cc290da76020fdebf52ec9a7cc20505f3b1daa | [
"Apache-2.0"
] | null | null | null | Test1.py | cfuser/GraphSAGE_in_dgl | 79cc290da76020fdebf52ec9a7cc20505f3b1daa | [
"Apache-2.0"
] | null | null | null | import dgl.data
import dgl
import torch
import torch.nn as nn
import torch.nn.functional as F
import itertools
import numpy as np
import scipy.sparse as sp
dataset = dgl.data.CoraGraphDataset()
g = dataset[0]
# Split edge set for training and testing
u, v = g.edges()
eids = np.arange(g.number_of_edges())
eids = np.... | 34.532468 | 89 | 0.690861 | import dgl.data
import dgl
import torch
import torch.nn as nn
import torch.nn.functional as F
import itertools
import numpy as np
import scipy.sparse as sp
dataset = dgl.data.CoraGraphDataset()
g = dataset[0]
# Split edge set for training and testing
u, v = g.edges()
eids = np.arange(g.number_of_edges())
eids = np.... | 691 | 15 | 124 |
ade56a79540ccbee057d3f2ee5d799c095c3e15e | 6,790 | py | Python | AWD_Auto_Defend_Framework/File_Protect.py | hillmanyoung/AWD | 6abe8f96c1b457a22f0bb15ca6ed901e922fc38c | [
"MIT"
] | 146 | 2019-07-05T12:36:33.000Z | 2021-12-05T18:20:26.000Z | AWD_Auto_Defend_Framework/File_Protect.py | ZacharyZcR/AWD- | 6abe8f96c1b457a22f0bb15ca6ed901e922fc38c | [
"MIT"
] | null | null | null | AWD_Auto_Defend_Framework/File_Protect.py | ZacharyZcR/AWD- | 6abe8f96c1b457a22f0bb15ca6ed901e922fc38c | [
"MIT"
] | 36 | 2019-07-05T12:38:21.000Z | 2021-05-26T11:44:13.000Z | # -*- coding:utf-8 -*-
import os
import hashlib
import time
import shutil
print "*******************************************************"
print "**************AWD_Auto_Defend_Framework****************"
print "*******************************************************"
global tgt
tgt = './backup'
while (1):
print "*****... | 27.601626 | 98 | 0.561856 | # -*- coding:utf-8 -*-
import os
import hashlib
import time
import shutil
def file_tree(startpath):
for root,dirs,files in os.walk(startpath,topdown=True):
level = root.replace(startpath,'').count(os.sep)
dir_indent = "|---" * (level-1) + "|---"
file_indent = "|---" * level + "|---"
if not level:
print ro... | 5,717 | 0 | 191 |
7503d7ea36e601ae03dc6c8f1601a8fbb3002e8e | 1,527 | py | Python | people/loader/util.py | datalets/mri-connect | d54125be7d6adb3a11349487d7ad4ea1364ab338 | [
"MIT"
] | null | null | null | people/loader/util.py | datalets/mri-connect | d54125be7d6adb3a11349487d7ad4ea1364ab338 | [
"MIT"
] | null | null | null | people/loader/util.py | datalets/mri-connect | d54125be7d6adb3a11349487d7ad4ea1364ab338 | [
"MIT"
] | 1 | 2020-11-30T10:22:14.000Z | 2020-11-30T10:22:14.000Z | import re
# Correct commas inside of a linked field
# Check for valid link
# Correct publication lists
# Create linked objects
# Fetch an object by source_id (numeric identifier used in source DB)
# Quick check of the number of lines
| 28.277778 | 69 | 0.595285 | import re
# Correct commas inside of a linked field
def fix_bracketed_lists(data):
for fix in re.findall(r'\([^\s]*,[ ]*[^\s]*\)', data):
data = data.replace(fix, fix.replace(',', ' /'))
return data
# Check for valid link
def fix_url(link):
link = link.strip()
if len(link) > 3 and not link.sta... | 1,156 | 0 | 132 |
513d4bbc42843a9e9ee2749cdcd9ba3ef61e891b | 1,777 | py | Python | functions/figure.py | chiluf/visvis.dev | 373846ea25044b7ca50f44c63dab4248e14deacd | [
"BSD-3-Clause"
] | null | null | null | functions/figure.py | chiluf/visvis.dev | 373846ea25044b7ca50f44c63dab4248e14deacd | [
"BSD-3-Clause"
] | null | null | null | functions/figure.py | chiluf/visvis.dev | 373846ea25044b7ca50f44c63dab4248e14deacd | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (C) 2012, Almar Klein
#
# Visvis is distributed under the terms of the (new) BSD License.
# The full license can be found in 'license.txt'.
import visvis.backends as backends
from visvis import BaseFigure
def figure(fig=None):
""" figure(fig=None)
Set the specified fi... | 30.118644 | 71 | 0.602701 | # -*- coding: utf-8 -*-
# Copyright (C) 2012, Almar Klein
#
# Visvis is distributed under the terms of the (new) BSD License.
# The full license can be found in 'license.txt'.
import visvis.backends as backends
from visvis import BaseFigure
def figure(fig=None):
""" figure(fig=None)
Set the specified fi... | 0 | 0 | 0 |
5d6a2b9f7b9031b053920939652fa79e28ebb77c | 2,802 | py | Python | pcg_libraries/src/pcg_gazebo/log.py | boschresearch/pcg_gazebo_pkgs | 1c112d01847ca4f8da61ce9b273e13d13bc7eb73 | [
"Apache-2.0",
"BSD-3-Clause"
] | 42 | 2019-06-26T09:46:03.000Z | 2022-03-18T17:56:26.000Z | pcg_libraries/src/pcg_gazebo/log.py | boschresearch/pcg_gazebo_pkgs | 1c112d01847ca4f8da61ce9b273e13d13bc7eb73 | [
"Apache-2.0",
"BSD-3-Clause"
] | 9 | 2019-07-18T10:36:05.000Z | 2020-10-02T15:26:32.000Z | pcg_libraries/src/pcg_gazebo/log.py | boschresearch/pcg_gazebo_pkgs | 1c112d01847ca4f8da61ce9b273e13d13bc7eb73 | [
"Apache-2.0",
"BSD-3-Clause"
] | 2 | 2019-11-01T03:20:11.000Z | 2020-10-15T23:23:44.000Z | # Copyright (c) 2019 - The Procedural Generation for Gazebo authors
# For information on the respective copyright owner see the NOTICE file
#
# 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
#
#... | 32.206897 | 81 | 0.67202 | # Copyright (c) 2019 - The Procedural Generation for Gazebo authors
# For information on the respective copyright owner see the NOTICE file
#
# 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
#
#... | 1,617 | 0 | 92 |
070884e0364a80571896b92062fe0317bb15be1b | 4,798 | py | Python | ob2/dockergrader/rpc.py | octobear2/ob2 | 864d833f41eea99930847d7e8d8b6f62f81f50db | [
"BSD-2-Clause"
] | 17 | 2016-01-08T04:39:55.000Z | 2019-09-02T21:50:53.000Z | ob2/dockergrader/rpc.py | octobear2/ob2 | 864d833f41eea99930847d7e8d8b6f62f81f50db | [
"BSD-2-Clause"
] | 15 | 2016-01-08T00:32:16.000Z | 2019-05-12T20:03:49.000Z | ob2/dockergrader/rpc.py | octobear2/ob2 | 864d833f41eea99930847d7e8d8b6f62f81f50db | [
"BSD-2-Clause"
] | 6 | 2016-01-27T22:54:24.000Z | 2019-05-12T01:02:03.000Z | import docker
from docker.utils import create_host_config
from docker.utils.types import Ulimit
from requests.exceptions import ConnectionError, ReadTimeout
import ob2.config as config
| 42.087719 | 96 | 0.61609 | import docker
from docker.utils import create_host_config
from docker.utils.types import Ulimit
from requests.exceptions import ConnectionError, ReadTimeout
import ob2.config as config
class DockerClient(object):
def __init__(self, sock="unix://var/run/docker.sock"):
self.client = docker.Client(base_url=... | 1,654 | 2,886 | 69 |
c9c37fd34f672efd901c4e655257231f4eb42817 | 4,285 | py | Python | tyler.py | mastro35/tyler | 9f26ca4db45308a006f7848fa58079ca28eb9873 | [
"Apache-2.0"
] | 1 | 2020-05-03T09:09:07.000Z | 2020-05-03T09:09:07.000Z | tyler.py | mastro35/tyler | 9f26ca4db45308a006f7848fa58079ca28eb9873 | [
"Apache-2.0"
] | null | null | null | tyler.py | mastro35/tyler | 9f26ca4db45308a006f7848fa58079ca28eb9873 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Tyler - a python tail supporting rolling files
# Copyright (C) 2016 Davide Mastromatteo - @mastro35
# ----------------------------------------------------
import sys
import os
import time
import platform
class Tyler(object):
"""
Creates an iterable object tha... | 26.288344 | 76 | 0.518553 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Tyler - a python tail supporting rolling files
# Copyright (C) 2016 Davide Mastromatteo - @mastro35
# ----------------------------------------------------
import sys
import os
import time
import platform
class Tyler(object):
"""
Creates an iterable object tha... | 627 | 0 | 135 |
dd3eba2f3cfeb5b844d86f7592b074e4b17541a7 | 1,611 | py | Python | molsysmt/native/io/topology/__init__.py | dprada/molsysmt | 83f150bfe3cfa7603566a0ed4aed79d9b0c97f5d | [
"MIT"
] | null | null | null | molsysmt/native/io/topology/__init__.py | dprada/molsysmt | 83f150bfe3cfa7603566a0ed4aed79d9b0c97f5d | [
"MIT"
] | null | null | null | molsysmt/native/io/topology/__init__.py | dprada/molsysmt | 83f150bfe3cfa7603566a0ed4aed79d9b0c97f5d | [
"MIT"
] | null | null | null | from .mdtraj_Topology import from_mdtraj_Topology, to_mdtraj_Topology
from .mdtraj_Trajectory import from_mdtraj_Trajectory
from .mmtf_MMTFDecoder import from_mmtf_MMTFDecoder
from .openmm_PDBFile import from_openmm_PDBFile
from .openmm_GromacsGroFile import from_openmm_GromacsGroFile
from .openmm_Topology import from_... | 50.34375 | 85 | 0.898821 | from .mdtraj_Topology import from_mdtraj_Topology, to_mdtraj_Topology
from .mdtraj_Trajectory import from_mdtraj_Trajectory
from .mmtf_MMTFDecoder import from_mmtf_MMTFDecoder
from .openmm_PDBFile import from_openmm_PDBFile
from .openmm_GromacsGroFile import from_openmm_GromacsGroFile
from .openmm_Topology import from_... | 0 | 0 | 0 |
3f8bb9eb1c06e74a71d17c721a27b300ebe46b80 | 433 | py | Python | app/app/views.py | campenr/richardcampendotcom | b4ccb4a2693747abd18d210fa9e2ee5f0304113c | [
"BSD-3-Clause"
] | null | null | null | app/app/views.py | campenr/richardcampendotcom | b4ccb4a2693747abd18d210fa9e2ee5f0304113c | [
"BSD-3-Clause"
] | 1 | 2020-02-16T01:21:31.000Z | 2020-02-16T01:21:31.000Z | app/app/views.py | campenr/richardcampendotcom | b4ccb4a2693747abd18d210fa9e2ee5f0304113c | [
"BSD-3-Clause"
] | null | null | null | from flask import render_template
from app import flask_app
@flask_app.route('/')
@flask_app.route('/software')
@flask_app.route('/publications')
@flask_app.errorhandler(404)
| 18.041667 | 47 | 0.741339 | from flask import render_template
from app import flask_app
@flask_app.route('/')
def about():
return render_template("about.html")
@flask_app.route('/software')
def software():
return render_template('software.html')
@flask_app.route('/publications')
def publications():
return render_template('publi... | 161 | 0 | 88 |
8b59242e63d79f99f0760b0785f1a54d63c7df86 | 1,520 | py | Python | tests/test_submission_builder.py | mverteuil/mig3-client | 2603e78ac37b76dcd1e162ff3a0a042ab1d77269 | [
"MIT"
] | 3 | 2019-04-26T19:43:47.000Z | 2019-05-04T02:23:36.000Z | tests/test_submission_builder.py | mverteuil/mig3-client | 2603e78ac37b76dcd1e162ff3a0a042ab1d77269 | [
"MIT"
] | 32 | 2019-05-04T02:22:46.000Z | 2021-07-14T10:22:05.000Z | tests/test_submission_builder.py | mverteuil/mig3-client | 2603e78ac37b76dcd1e162ff3a0a042ab1d77269 | [
"MIT"
] | 2 | 2019-05-02T20:49:31.000Z | 2019-05-04T02:20:55.000Z | # -*- coding: utf-8 -*-
import mock
from mig3_client import SubmissionBuilder
def test_minimum_viable_submission(converted_tests):
"""Should produce something"""
submission = SubmissionBuilder("t", "b", converted_tests).build()
assert submission is not None
def test_configuration_id(converted_tests):
... | 38 | 90 | 0.701974 | # -*- coding: utf-8 -*-
import mock
from mig3_client import SubmissionBuilder
def test_minimum_viable_submission(converted_tests):
"""Should produce something"""
submission = SubmissionBuilder("t", "b", converted_tests).build()
assert submission is not None
def test_configuration_id(converted_tests):
... | 0 | 0 | 0 |
ee9aab0826782f6ab2df4d71ea72cc622f596803 | 2,865 | py | Python | termicoder/utils/code.py | apb7/termicoder | f0540a2fb4fe0858fa6a9d63e722ad5aa525e14a | [
"MIT"
] | 1 | 2018-06-22T06:59:24.000Z | 2018-06-22T06:59:24.000Z | termicoder/utils/code.py | apb7/termicoder | f0540a2fb4fe0858fa6a9d63e722ad5aa525e14a | [
"MIT"
] | null | null | null | termicoder/utils/code.py | apb7/termicoder | f0540a2fb4fe0858fa6a9d63e722ad5aa525e14a | [
"MIT"
] | null | null | null | import click
import os
import sys
import subprocess
import termicoder.utils.display as display
import json
lang_map = {
".py": "python",
".c": "c",
".cpp": "cpp",
".cc": "cpp",
".c++": "cpp",
".java": "java"
}
# TODO: a default name for code file
| 28.088235 | 78 | 0.588831 | import click
import os
import sys
import subprocess
import termicoder.utils.display as display
import json
lang_map = {
".py": "python",
".c": "c",
".cpp": "cpp",
".cc": "cpp",
".c++": "cpp",
".java": "java"
}
def edit_templates():
click.confirm("This will open the templates folder in fil... | 2,496 | 0 | 92 |
217378a3c46509843d298f90c41c54e498db1d5d | 3,109 | py | Python | test.py | brotchie/pyevmc | fca18cc4b6840997a5c012d2ee20e052674b8858 | [
"MIT"
] | null | null | null | test.py | brotchie/pyevmc | fca18cc4b6840997a5c012d2ee20e052674b8858 | [
"MIT"
] | null | null | null | test.py | brotchie/pyevmc | fca18cc4b6840997a5c012d2ee20e052674b8858 | [
"MIT"
] | null | null | null | """Tests for EVMC Python bindings.
Note, these tests rely on a valid EVMC implementation. Set the EVMC_MODULE
environment variable to your EMVC shared library. For example, if using
evmone compiled in the parent directory:
$ EVMC_MODULE=../evmone/build/lib/libevmone.so python3 test.py
"""
import os
import unittes... | 28.522936 | 96 | 0.627855 | """Tests for EVMC Python bindings.
Note, these tests rely on a valid EVMC implementation. Set the EVMC_MODULE
environment variable to your EMVC shared library. For example, if using
evmone compiled in the parent directory:
$ EVMC_MODULE=../evmone/build/lib/libevmone.so python3 test.py
"""
import os
import unittes... | 1,783 | 30 | 258 |
0623f1f660d231bc13e4c31bc2c6cd4b10effbc6 | 238 | py | Python | tests/test_comparisons.py | thegreathippo/ezparse | 1dc3184e74b8b1f85ff5c7248efa78613e65d837 | [
"MIT"
] | null | null | null | tests/test_comparisons.py | thegreathippo/ezparse | 1dc3184e74b8b1f85ff5c7248efa78613e65d837 | [
"MIT"
] | null | null | null | tests/test_comparisons.py | thegreathippo/ezparse | 1dc3184e74b8b1f85ff5c7248efa78613e65d837 | [
"MIT"
] | null | null | null | from .context import ezparse
import unittest
if __name__ == '__main__':
unittest.main()
| 15.866667 | 47 | 0.672269 | from .context import ezparse
import unittest
class TestParserComparisons(unittest.TestCase):
def setUp(self):
self.parser = ezparse.Parser()
def test(self):
pass
if __name__ == '__main__':
unittest.main()
| 41 | 26 | 77 |
b11cd90a3f9a9b8349f3a05a003622b0bfd70fda | 3,454 | py | Python | PytorchRouting/DecisionLayers/Others/GumbelSoftmax.py | oleksost/RoutingNetworks | 7e3e9219b7389d5af2a832a4882bc9fda0e7fd21 | [
"Apache-2.0"
] | 63 | 2018-07-19T20:12:55.000Z | 2022-03-31T14:59:37.000Z | PytorchRouting/DecisionLayers/Others/GumbelSoftmax.py | oleksost/RoutingNetworks | 7e3e9219b7389d5af2a832a4882bc9fda0e7fd21 | [
"Apache-2.0"
] | 2 | 2019-08-08T18:28:13.000Z | 2019-09-24T16:46:22.000Z | PytorchRouting/DecisionLayers/Others/GumbelSoftmax.py | oleksost/RoutingNetworks | 7e3e9219b7389d5af2a832a4882bc9fda0e7fd21 | [
"Apache-2.0"
] | 16 | 2018-07-25T05:56:51.000Z | 2021-01-09T02:47:05.000Z | """
This file defines class GumbelSoftmax.
@author: Clemens Rosenbaum :: cgbr@cs.umass.edu
@created: 6/12/18
"""
import math
import torch
import torch.nn as nn
from torch.autograd import Variable
from ..Decision import Decision
class GumbelSoftmax(Decision):
"""
Class GumbelSoftmax defines a decision making... | 35.244898 | 112 | 0.649392 | """
This file defines class GumbelSoftmax.
@author: Clemens Rosenbaum :: cgbr@cs.umass.edu
@created: 6/12/18
"""
import math
import torch
import torch.nn as nn
from torch.autograd import Variable
from ..Decision import Decision
class GumbelSoftmax(Decision):
"""
Class GumbelSoftmax defines a decision making... | 2,507 | 0 | 294 |
dc44532d91f8ff6f92c01f0d475ba8e57b156932 | 1,784 | py | Python | plos_bio_scripts/concatenate_fastq_sample_replicates_from_same_visno.py | zhiru-liu/microbiome_evolution | 5a08fbf41357d845236e3ff46c31315929d2b649 | [
"BSD-2-Clause"
] | null | null | null | plos_bio_scripts/concatenate_fastq_sample_replicates_from_same_visno.py | zhiru-liu/microbiome_evolution | 5a08fbf41357d845236e3ff46c31315929d2b649 | [
"BSD-2-Clause"
] | null | null | null | plos_bio_scripts/concatenate_fastq_sample_replicates_from_same_visno.py | zhiru-liu/microbiome_evolution | 5a08fbf41357d845236e3ff46c31315929d2b649 | [
"BSD-2-Clause"
] | null | null | null | import os
import sys
from parsers import parse_midas_data
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("subject_id", help="name of subject to process")
args = parser.parse_args()
subject = args.subject_id
subject_sample_time_map = parse_midas_data.parse_subject_sample_time_map()
for visno i... | 68.615385 | 329 | 0.785314 | import os
import sys
from parsers import parse_midas_data
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("subject_id", help="name of subject to process")
args = parser.parse_args()
subject = args.subject_id
subject_sample_time_map = parse_midas_data.parse_subject_sample_time_map()
for visno i... | 0 | 0 | 0 |
f916686f5798eb1904edfc4ef91c835b783c9add | 383 | py | Python | recreate.py | tjguk/incident-database | 88beef4581185a9f465166f014a31d97465cb216 | [
"MIT"
] | 1 | 2018-07-10T13:56:41.000Z | 2018-07-10T13:56:41.000Z | recreate.py | tjguk/incident-database | 88beef4581185a9f465166f014a31d97465cb216 | [
"MIT"
] | null | null | null | recreate.py | tjguk/incident-database | 88beef4581185a9f465166f014a31d97465cb216 | [
"MIT"
] | null | null | null | import os, sys
from incidents import db, IncidentStatus
if __name__ == '__main__':
if os.path.exists("incidents/incidents.db"):
os.remove("incidents/incidents.db")
db.create_all()
db.session.add(IncidentStatus("Open", 1))
db.session.add(IncidentStatus("Pending", 2))
db.sessio... | 23.9375 | 49 | 0.655352 | import os, sys
from incidents import db, IncidentStatus
if __name__ == '__main__':
if os.path.exists("incidents/incidents.db"):
os.remove("incidents/incidents.db")
db.create_all()
db.session.add(IncidentStatus("Open", 1))
db.session.add(IncidentStatus("Pending", 2))
db.sessio... | 0 | 0 | 0 |
62a055a8f85843d8830c623dd866958f97102a0e | 77,866 | py | Python | factory/glideFactoryMonitoring.py | ddbox/glideinwms | 1d0efbc1186ff9bd4cc3010fde6681b4cbe7cd54 | [
"Apache-2.0"
] | null | null | null | factory/glideFactoryMonitoring.py | ddbox/glideinwms | 1d0efbc1186ff9bd4cc3010fde6681b4cbe7cd54 | [
"Apache-2.0"
] | null | null | null | factory/glideFactoryMonitoring.py | ddbox/glideinwms | 1d0efbc1186ff9bd4cc3010fde6681b4cbe7cd54 | [
"Apache-2.0"
] | null | null | null | # SPDX-FileCopyrightText: 2009 Fermi Research Alliance, LLC
# SPDX-License-Identifier: Apache-2.0
#
# Project:
# glideinWMS
#
# File Version:
#
# Description:
# This module implements the functions needed
# to monitor the glidein factory
#
# Author:
# Igor Sfiligoi (Dec 11th 2006)
#
import copy
import json
im... | 39.972279 | 352 | 0.541173 | # SPDX-FileCopyrightText: 2009 Fermi Research Alliance, LLC
# SPDX-License-Identifier: Apache-2.0
#
# Project:
# glideinWMS
#
# File Version:
#
# Description:
# This module implements the functions needed
# to monitor the glidein factory
#
# Author:
# Igor Sfiligoi (Dec 11th 2006)
#
import copy
import json
im... | 32,661 | 20,175 | 788 |
c42cb4c8f64eb4a905c75fe882d39f12d4de36b5 | 2,401 | py | Python | webapp/element43/apps/feedreader/tasks.py | Ososope/eve_online | b368f77aaff403e5f1523a1a0e01d105fed0ada9 | [
"BSD-3-Clause"
] | null | null | null | webapp/element43/apps/feedreader/tasks.py | Ososope/eve_online | b368f77aaff403e5f1523a1a0e01d105fed0ada9 | [
"BSD-3-Clause"
] | null | null | null | webapp/element43/apps/feedreader/tasks.py | Ososope/eve_online | b368f77aaff403e5f1523a1a0e01d105fed0ada9 | [
"BSD-3-Clause"
] | null | null | null | # Datetime Packages
from time import mktime
from datetime import timedelta
from datetime import datetime
import pytz
# Celery Imports
from celery.task import Task, PeriodicTask
from celery.utils.log import get_task_logger
# Feedparser
import feedparser
# Models
from models import Feed, FeedItem
# Logger object
LOGG... | 28.583333 | 120 | 0.607663 | # Datetime Packages
from time import mktime
from datetime import timedelta
from datetime import datetime
import pytz
# Celery Imports
from celery.task import Task, PeriodicTask
from celery.utils.log import get_task_logger
# Feedparser
import feedparser
# Models
from models import Feed, FeedItem
# Logger object
LOGG... | 1,722 | 0 | 54 |
edb782c7f6267005dd2b8b742261b90c442c3db4 | 5,277 | py | Python | markov.py | nbowen/codebro-bot | c40dc8c560d671b8871b6af2884d9ceaa4734679 | [
"MIT"
] | null | null | null | markov.py | nbowen/codebro-bot | c40dc8c560d671b8871b6af2884d9ceaa4734679 | [
"MIT"
] | 2 | 2017-08-08T16:45:38.000Z | 2021-08-23T04:02:01.000Z | markov.py | nbowen/codebro-bot | c40dc8c560d671b8871b6af2884d9ceaa4734679 | [
"MIT"
] | 6 | 2017-11-03T01:16:59.000Z | 2021-08-24T20:31:29.000Z | import random
import yaml
from itertools import chain, groupby
START_TOK = "<START>"
STOP_TOK = "<STOP>"
STOP = object()
START = object()
# instantiate a Markov object with the source file
| 34.717105 | 93 | 0.55126 | import random
import yaml
from itertools import chain, groupby
START_TOK = "<START>"
STOP_TOK = "<STOP>"
STOP = object()
START = object()
# instantiate a Markov object with the source file
class Markov:
def __init__(self, input_file: str, output_file: str, ignore_words):
if input_file == output_file:
... | 1,700 | 3,363 | 22 |
1d93bfa334af183d98404abf2081bbc7654e005f | 78 | py | Python | tests/__init__.py | shridarpatil/desktop_recorder | 838c99354d6eadb9cb939612958c141ad463c748 | [
"MIT"
] | null | null | null | tests/__init__.py | shridarpatil/desktop_recorder | 838c99354d6eadb9cb939612958c141ad463c748 | [
"MIT"
] | 64 | 2017-09-29T18:02:33.000Z | 2019-02-28T06:00:35.000Z | tests/__init__.py | shridarpatil/desktop_recorder | 838c99354d6eadb9cb939612958c141ad463c748 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Unit test package for desktop_screen_recorder."""
| 19.5 | 52 | 0.653846 | # -*- coding: utf-8 -*-
"""Unit test package for desktop_screen_recorder."""
| 0 | 0 | 0 |
b545348c3116cc45f223a460855d8f1436da655b | 4,467 | py | Python | tests/requests_cache/backends/storage/serialize.py | rathnadeep/cbapi-python | 55375d8796a9d88d00bd16df13d71a2d8d76dd9c | [
"MIT"
] | 3 | 2019-01-23T19:11:33.000Z | 2022-02-25T02:06:51.000Z | tests/requests_cache/backends/storage/serialize.py | rathnadeep/cbapi-python | 55375d8796a9d88d00bd16df13d71a2d8d76dd9c | [
"MIT"
] | 1 | 2020-10-21T22:38:13.000Z | 2020-10-27T21:50:36.000Z | tests/requests_cache/backends/storage/serialize.py | jjfallete/cbapi-python | 8b92584edca5605cd94afa7656fd04c282b875b8 | [
"MIT"
] | 3 | 2019-03-12T23:01:28.000Z | 2021-07-23T03:57:22.000Z | import base64
import io
import json
import zlib
from requests.structures import CaseInsensitiveDict
from .compat import HTTPResponse, text_type
| 32.136691 | 78 | 0.564361 | import base64
import io
import json
import zlib
from requests.structures import CaseInsensitiveDict
from .compat import HTTPResponse, text_type
def _b64_encode_bytes(b):
return base64.b64encode(b).decode("ascii")
def _b64_encode_str(s):
return _b64_encode_bytes(s.encode("utf8"))
def _b64_encode(s):
... | 2,839 | 1,339 | 138 |
266e24140a234db040762b3648f07f9379631e25 | 543 | py | Python | src/posts/sitemaps.py | pratik-devkota/notesewa | f93e8da43ce48aba43d86ed21861acf099b03f40 | [
"MIT"
] | null | null | null | src/posts/sitemaps.py | pratik-devkota/notesewa | f93e8da43ce48aba43d86ed21861acf099b03f40 | [
"MIT"
] | null | null | null | src/posts/sitemaps.py | pratik-devkota/notesewa | f93e8da43ce48aba43d86ed21861acf099b03f40 | [
"MIT"
] | 1 | 2021-04-12T12:12:23.000Z | 2021-04-12T12:12:23.000Z | # core django imports
from django.contrib.sitemaps import Sitemap
# app imports
from posts.models import Post
class PostSiteMap(Sitemap):
"""
A sitemap class indicating the objects, change frequency, and
various pages of our website for better search engine indexing
"""
changefreq = 'weekly'
... | 20.111111 | 66 | 0.661142 | # core django imports
from django.contrib.sitemaps import Sitemap
# app imports
from posts.models import Post
class PostSiteMap(Sitemap):
"""
A sitemap class indicating the objects, change frequency, and
various pages of our website for better search engine indexing
"""
changefreq = 'weekly'
... | 30 | 0 | 26 |
0557cafa6452a8390e1a39347eceeb73cdfb441e | 3,164 | py | Python | orgs/migrations/0009_auto_20200418_1855.py | PudgyPoppins/caps | 8e57d1ab970bcb850938b4103e8d736e5afb8e80 | [
"Apache-2.0"
] | null | null | null | orgs/migrations/0009_auto_20200418_1855.py | PudgyPoppins/caps | 8e57d1ab970bcb850938b4103e8d736e5afb8e80 | [
"Apache-2.0"
] | null | null | null | orgs/migrations/0009_auto_20200418_1855.py | PudgyPoppins/caps | 8e57d1ab970bcb850938b4103e8d736e5afb8e80 | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.0.5 on 2020-04-18 18:55
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
| 45.855072 | 162 | 0.632427 | # Generated by Django 3.0.5 on 2020-04-18 18:55
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('network', '0003_auto_20200128_2104'),
migrations.swapp... | 0 | 2,955 | 23 |
73a5e2762c70a64047bbba2bad7b2659fa7a78d2 | 1,648 | py | Python | spacy/lang/az/lex_attrs.py | snosrap/spaCy | 3f68bbcfec44ef55d101e6db742d353b72652129 | [
"MIT"
] | 22,040 | 2016-10-03T11:58:15.000Z | 2022-03-31T21:08:19.000Z | spacy/lang/az/lex_attrs.py | snosrap/spaCy | 3f68bbcfec44ef55d101e6db742d353b72652129 | [
"MIT"
] | 6,927 | 2016-10-03T13:11:11.000Z | 2022-03-31T17:01:25.000Z | spacy/lang/az/lex_attrs.py | snosrap/spaCy | 3f68bbcfec44ef55d101e6db742d353b72652129 | [
"MIT"
] | 4,403 | 2016-10-04T03:36:33.000Z | 2022-03-31T14:12:34.000Z | from ...attrs import LIKE_NUM
# Eleven, twelve etc. are written separate: on bir, on iki
_num_words = [
"bir",
"iki",
"üç",
"dörd",
"beş",
"altı",
"yeddi",
"səkkiz",
"doqquz",
"on",
"iyirmi",
"otuz",
"qırx",
"əlli",
"altmış",
"yetmiş",
"səksən",
... | 18.311111 | 66 | 0.529733 | from ...attrs import LIKE_NUM
# Eleven, twelve etc. are written separate: on bir, on iki
_num_words = [
"bir",
"iki",
"üç",
"dörd",
"beş",
"altı",
"yeddi",
"səkkiz",
"doqquz",
"on",
"iyirmi",
"otuz",
"qırx",
"əlli",
"altmış",
"yetmiş",
"səksən",
... | 647 | 0 | 23 |
3be10189c54d298dbd30664473dab5cbc74413ef | 810 | py | Python | Project Euler Questions 1 - 10/Project Euler Question 5.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | 1 | 2020-02-11T02:03:02.000Z | 2020-02-11T02:03:02.000Z | Project Euler Questions 1 - 10/Project Euler Question 5.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | Project Euler Questions 1 - 10/Project Euler Question 5.py | Clayton-Threm/Coding-Practice | 6671e8a15f9e797338caa617dae45093f4157bc1 | [
"MIT"
] | null | null | null | #Project Euler Queestion 5
#2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
#What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?
highest_factor = 20
factor = highest_factor
x = highest_factor
while x >= 0:
if ... | 33.75 | 118 | 0.669136 | #Project Euler Queestion 5
#2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
#What is the smallest positive number that is evenly divisible by all of the numbers from 1 to 20?
highest_factor = 20
factor = highest_factor
x = highest_factor
while x >= 0:
if ... | 0 | 0 | 0 |
63b8909a6a3bfda3dce10c5f3a8be6bb08158572 | 1,634 | py | Python | midterm_16012020/alessandro_reggiani_script.py | allereggiani22/programming_alessandro_reggiani | 4b8f9ee1805a29cc6cd3a8b8d93bda5a7efb97ea | [
"MIT"
] | 1 | 2020-01-13T13:46:48.000Z | 2020-01-13T13:46:48.000Z | midterm_16012020/alessandro_reggiani_script.py | allereggiani22/programming_alessandro_reggiani | 4b8f9ee1805a29cc6cd3a8b8d93bda5a7efb97ea | [
"MIT"
] | null | null | null | midterm_16012020/alessandro_reggiani_script.py | allereggiani22/programming_alessandro_reggiani | 4b8f9ee1805a29cc6cd3a8b8d93bda5a7efb97ea | [
"MIT"
] | null | null | null | """
Define a function to generate dictionary from matrix
do the same for other matrix
read sequences from fasta file
define function with arguments (seq1, seq2, matrix) to score the alignments
call the function for each matrix and each alignment
print results in some nice way
"""
BLOSUM=matrix_to_dict("./BLOSUM62_squ... | 22.694444 | 75 | 0.658507 | """
Define a function to generate dictionary from matrix
do the same for other matrix
read sequences from fasta file
define function with arguments (seq1, seq2, matrix) to score the alignments
call the function for each matrix and each alignment
print results in some nice way
"""
def matrix_to_dict(filepath):
fil... | 586 | 0 | 69 |
ad56041677a94e3f6b05ad14c129f7683390b5cf | 507 | py | Python | post/forms.py | MichaelNjoroge254/Instagram-App | 0a33e5909190efb24c0adc3ce38b5846e3723e73 | [
"MIT"
] | null | null | null | post/forms.py | MichaelNjoroge254/Instagram-App | 0a33e5909190efb24c0adc3ce38b5846e3723e73 | [
"MIT"
] | null | null | null | post/forms.py | MichaelNjoroge254/Instagram-App | 0a33e5909190efb24c0adc3ce38b5846e3723e73 | [
"MIT"
] | null | null | null | from django import forms
from post.models import Post
from django.forms import ClearableFileInput | 39 | 100 | 0.755424 | from django import forms
from post.models import Post
from django.forms import ClearableFileInput
class NewPostForm(forms.ModelForm):
content = forms.FileField(widget=forms.ClearableFileInput(attrs={'multiple': True}), required=True)
caption = forms.CharField(widget=forms.Textarea(attrs={'class': 'input is-medium'}... | 0 | 386 | 23 |
a5e1bda80068ec02ba1b78a61b76c95409209ae3 | 3,014 | py | Python | scripts/keras-regression-cnns/cnn_regression.py | MattBixley/Histology | 159655dc55d7959dadefbd2f5a490b8a03034ffb | [
"MIT"
] | null | null | null | scripts/keras-regression-cnns/cnn_regression.py | MattBixley/Histology | 159655dc55d7959dadefbd2f5a490b8a03034ffb | [
"MIT"
] | 3 | 2021-09-08T01:56:43.000Z | 2022-03-12T00:26:33.000Z | scripts/keras-regression-cnns/cnn_regression.py | MattBixley/Histology | 159655dc55d7959dadefbd2f5a490b8a03034ffb | [
"MIT"
] | null | null | null | # USAGE
# python cnn_regression.py --dataset Houses-dataset/Houses\ Dataset/
# import the necessary packages
from tensorflow.keras.optimizers import Adam
from sklearn.model_selection import train_test_split
from pyimagesearch import datasets
from pyimagesearch import models
import numpy as np
import argparse
import lo... | 38.151899 | 69 | 0.757133 | # USAGE
# python cnn_regression.py --dataset Houses-dataset/Houses\ Dataset/
# import the necessary packages
from tensorflow.keras.optimizers import Adam
from sklearn.model_selection import train_test_split
from pyimagesearch import datasets
from pyimagesearch import models
import numpy as np
import argparse
import lo... | 0 | 0 | 0 |
699a5027b6e478683fd3e6fcf46b9e27bf77421b | 2,639 | py | Python | test/sqlite_test.py | littlecharacter/AutoWork | feebb8459f889b7a9165073be8fd44ba544cbb35 | [
"Apache-2.0"
] | null | null | null | test/sqlite_test.py | littlecharacter/AutoWork | feebb8459f889b7a9165073be8fd44ba544cbb35 | [
"Apache-2.0"
] | null | null | null | test/sqlite_test.py | littlecharacter/AutoWork | feebb8459f889b7a9165073be8fd44ba544cbb35 | [
"Apache-2.0"
] | null | null | null | # https://www.jianshu.com/p/ba8a27cf7da1
# https://www.cnblogs.com/goldsunshine/p/15259246.html
import sqlite3
import peewee
import datetime
import core.orm as orm
db = peewee.SqliteDatabase('../db/auto_work.db')
if __name__ == "__main__":
pass
# test_insert_record()
# test_select_record()
# ... | 26.128713 | 112 | 0.67033 | # https://www.jianshu.com/p/ba8a27cf7da1
# https://www.cnblogs.com/goldsunshine/p/15259246.html
import sqlite3
import peewee
import datetime
import core.orm as orm
db = peewee.SqliteDatabase('../db/auto_work.db')
class BaseModel(peewee.Model):
class Meta:
database = db
class WorkItem(BaseModel):
na... | 1,212 | 336 | 161 |
722aab15d3ccfa3fd1ab495c207bcdeed0a9a9d9 | 47 | py | Python | glance/painters/__init__.py | filonik/glance | 053e5e9567c76774b56597dfa854fd29efaf48fd | [
"MIT"
] | null | null | null | glance/painters/__init__.py | filonik/glance | 053e5e9567c76774b56597dfa854fd29efaf48fd | [
"MIT"
] | null | null | null | glance/painters/__init__.py | filonik/glance | 053e5e9567c76774b56597dfa854fd29efaf48fd | [
"MIT"
] | null | null | null | from .painters import *
from .textures import * | 23.5 | 23 | 0.765957 | from .painters import *
from .textures import * | 0 | 0 | 0 |
a3d57364826178addf9f55884ab9f6adce826f83 | 1,413 | py | Python | spikeinterface/widgets/probemap.py | JuliaSprenger/spikeinterface | d5d3d3992a6d430d7008e16db4ee030734e685e5 | [
"MIT"
] | 116 | 2019-07-12T14:33:43.000Z | 2022-03-29T01:10:00.000Z | spikeinterface/widgets/probemap.py | JuliaSprenger/spikeinterface | d5d3d3992a6d430d7008e16db4ee030734e685e5 | [
"MIT"
] | 424 | 2019-07-15T13:29:34.000Z | 2022-03-30T13:30:45.000Z | spikeinterface/widgets/probemap.py | JuliaSprenger/spikeinterface | d5d3d3992a6d430d7008e16db4ee030734e685e5 | [
"MIT"
] | 60 | 2019-08-26T11:59:07.000Z | 2022-03-24T20:05:38.000Z | import numpy as np
import matplotlib.pylab as plt
from .basewidget import BaseWidget
from probeinterface.plotting import plot_probe
class ProbeMapWidget(BaseWidget):
"""
Plot the probe of a recording.
Parameters
----------
recording: RecordingExtractor
The recording extractor object
... | 25.690909 | 92 | 0.673036 | import numpy as np
import matplotlib.pylab as plt
from .basewidget import BaseWidget
from probeinterface.plotting import plot_probe
class ProbeMapWidget(BaseWidget):
"""
Plot the probe of a recording.
Parameters
----------
recording: RecordingExtractor
The recording extractor object
... | 531 | 0 | 104 |
49ce4847193866e5c312b3091e78e2bddf49c7e1 | 6,229 | py | Python | pads/circle_pack.py | thisiscam/PADS | 13eb364e3b248cffd03ec796d9bd93747e6afffb | [
"MIT"
] | 9 | 2018-03-15T12:40:29.000Z | 2022-03-07T03:05:22.000Z | pads/circle_pack.py | thisiscam/PADS | 13eb364e3b248cffd03ec796d9bd93747e6afffb | [
"MIT"
] | null | null | null | pads/circle_pack.py | thisiscam/PADS | 13eb364e3b248cffd03ec796d9bd93747e6afffb | [
"MIT"
] | 7 | 2015-12-19T14:11:30.000Z | 2022-02-15T23:42:12.000Z | """circle_pack.py
Compute circle packings according to the Koebe-Thurston-Andreev theory,
Following a numerical algorithm by C. R. Collins and K. Stephenson,
"A Circle Packing Algorithm", Comp. Geom. Theory and Appl. 2003.
"""
from __future__ import division
from math import pi, acos, sin, e
tolerance = 1 + 10e-12 ... | 37.524096 | 79 | 0.569754 | """circle_pack.py
Compute circle packings according to the Koebe-Thurston-Andreev theory,
Following a numerical algorithm by C. R. Collins and K. Stephenson,
"A Circle Packing Algorithm", Comp. Geom. Theory and Appl. 2003.
"""
from __future__ import division
from math import pi, acos, sin, e
tolerance = 1 + 10e-12 ... | 0 | 0 | 0 |
3e6e3a53dfa76d727f29154f57e1d78a575aae6e | 12,468 | py | Python | lavavu/server.py | rbeucher/LavaVu | 317a234d69ba3eb06a827a1f8658feb031fe358b | [
"CC-BY-4.0"
] | 23 | 2016-01-26T23:06:53.000Z | 2019-06-11T08:31:32.000Z | lavavu/server.py | rbeucher/LavaVu | 317a234d69ba3eb06a827a1f8658feb031fe358b | [
"CC-BY-4.0"
] | 73 | 2016-03-16T03:02:35.000Z | 2019-07-18T07:29:52.000Z | lavavu/server.py | rbeucher/LavaVu | 317a234d69ba3eb06a827a1f8658feb031fe358b | [
"CC-BY-4.0"
] | 6 | 2016-03-25T23:22:49.000Z | 2018-01-16T14:38:09.000Z | import urllib
import os
import threading
import time
import errno
from functools import partial
import weakref
import base64
import json
import socket
from socketserver import ThreadingMixIn
from http.server import SimpleHTTPRequestHandler, HTTPServer
from urllib.parse import unquote
from urllib.parse import urlparse
... | 36.244186 | 117 | 0.549968 | import urllib
import os
import threading
import time
import errno
from functools import partial
import weakref
import base64
import json
import socket
from socketserver import ThreadingMixIn
from http.server import SimpleHTTPRequestHandler, HTTPServer
from urllib.parse import unquote
from urllib.parse import urlparse
... | 10,981 | 88 | 410 |
35379bf364e71424562fe1367e0c3c4565f9ab2b | 193 | py | Python | authentication/urls.py | king-11/Images_backend | c0223e551fc5c2f42b960161e06d688678d13e22 | [
"MIT"
] | 1 | 2021-05-04T09:38:01.000Z | 2021-05-04T09:38:01.000Z | authentication/urls.py | king-11/Images_backend | c0223e551fc5c2f42b960161e06d688678d13e22 | [
"MIT"
] | 6 | 2021-04-06T18:24:10.000Z | 2021-09-22T19:30:21.000Z | authentication/urls.py | king-11/Images_backend | c0223e551fc5c2f42b960161e06d688678d13e22 | [
"MIT"
] | null | null | null | from .views import *
from django.urls import path
urlpatterns = [
path('login/', LoginView.as_view()),
path('register/', RegisterView.as_view()),
path('me/', UserView.as_view())
]
| 21.444444 | 46 | 0.658031 | from .views import *
from django.urls import path
urlpatterns = [
path('login/', LoginView.as_view()),
path('register/', RegisterView.as_view()),
path('me/', UserView.as_view())
]
| 0 | 0 | 0 |
e3e20958857abf5f383239059b5095d65eebfea8 | 12,231 | py | Python | river/datasets/synth/agrawal.py | f3d3r1c00/river | bbf8af07ee75c30f416d5d4dc7ce4c61efc70fab | [
"BSD-3-Clause"
] | 2 | 2021-04-13T09:19:42.000Z | 2021-12-22T13:43:15.000Z | river/datasets/synth/agrawal.py | f3d3r1c00/river | bbf8af07ee75c30f416d5d4dc7ce4c61efc70fab | [
"BSD-3-Clause"
] | null | null | null | river/datasets/synth/agrawal.py | f3d3r1c00/river | bbf8af07ee75c30f416d5d4dc7ce4c61efc70fab | [
"BSD-3-Clause"
] | null | null | null | import numpy as np
from river.utils.skmultiflow_utils import check_random_state
from .. import base
class Agrawal(base.SyntheticDataset):
r"""Agrawal stream generator.
The generator was introduced by Agrawal et al. [^1], and was a common
source of data for early work on scaling up decision tree learner... | 38.102804 | 96 | 0.579102 | import numpy as np
from river.utils.skmultiflow_utils import check_random_state
from .. import base
class Agrawal(base.SyntheticDataset):
r"""Agrawal stream generator.
The generator was introduced by Agrawal et al. [^1], and was a common
source of data for early work on scaling up decision tree learner... | 8,008 | 0 | 341 |
a84223e69f00c547c566010230e0ae6b340bcc19 | 1,942 | py | Python | sdg/data_schemas/DataSchemaInputBase.py | Defra-Data-Science-Centre-of-Excellence/sdg-build | 716a7597e5cb7de248915b21fa1a9e4a5cd1e0e0 | [
"MIT"
] | 7 | 2019-02-25T03:50:17.000Z | 2022-03-31T12:58:42.000Z | sdg/data_schemas/DataSchemaInputBase.py | Defra-Data-Science-Centre-of-Excellence/sdg-build | 716a7597e5cb7de248915b21fa1a9e4a5cd1e0e0 | [
"MIT"
] | 185 | 2019-01-14T15:35:53.000Z | 2022-03-28T19:16:37.000Z | sdg/data_schemas/DataSchemaInputBase.py | Defra-Data-Science-Centre-of-Excellence/sdg-build | 716a7597e5cb7de248915b21fa1a9e4a5cd1e0e0 | [
"MIT"
] | 18 | 2019-01-14T11:20:05.000Z | 2022-02-08T14:10:17.000Z | # -*- coding: utf-8 -*-
import frictionless
from pprint import pprint
class DataSchemaInputBase:
"""A base class for importing a data schema, querying it, and validating with it.
This class assumes imported schema are valid Table Schema.
See here: https://specs.frictionlessdata.io/table-schema/
"""
... | 29.424242 | 90 | 0.615345 | # -*- coding: utf-8 -*-
import frictionless
from pprint import pprint
class DataSchemaInputBase:
"""A base class for importing a data schema, querying it, and validating with it.
This class assumes imported schema are valid Table Schema.
See here: https://specs.frictionlessdata.io/table-schema/
"""
... | 372 | 0 | 54 |
c636b30189070a6ba48d55e1ed46be87e0091759 | 696 | py | Python | api/healthcheck/views.py | cad106uk/market-access-api | a357c33bbec93408b193e598a5628634126e9e99 | [
"MIT"
] | null | null | null | api/healthcheck/views.py | cad106uk/market-access-api | a357c33bbec93408b193e598a5628634126e9e99 | [
"MIT"
] | null | null | null | api/healthcheck/views.py | cad106uk/market-access-api | a357c33bbec93408b193e598a5628634126e9e99 | [
"MIT"
] | null | null | null | import time
from django.conf import settings
from hawkrest import HawkAuthentication
from rest_framework.generics import GenericAPIView
from rest_framework.response import Response
from api.core.permissions import IsAuthenticated
from .checks import db_check
| 25.777778 | 57 | 0.704023 | import time
from django.conf import settings
from hawkrest import HawkAuthentication
from rest_framework.generics import GenericAPIView
from rest_framework.response import Response
from api.core.permissions import IsAuthenticated
from .checks import db_check
class HealthCheckView(GenericAPIView):
if settings.HA... | 156 | 255 | 23 |
38862babc5adc5b0a0ec6c7ac624852c2524a957 | 11,977 | py | Python | Yukki/Plugins/stream.py | xsyn1100/YukkiMusic-Old | 92400708b6d796f83fc6c59130176605b050e9ab | [
"MIT"
] | null | null | null | Yukki/Plugins/stream.py | xsyn1100/YukkiMusic-Old | 92400708b6d796f83fc6c59130176605b050e9ab | [
"MIT"
] | null | null | null | Yukki/Plugins/stream.py | xsyn1100/YukkiMusic-Old | 92400708b6d796f83fc6c59130176605b050e9ab | [
"MIT"
] | null | null | null | import asyncio
import os
from Yukki.YukkiUtilities.tgcallsrun import ASS_ACC
from pyrogram import Client, filters
from pyrogram.errors import UserAlreadyParticipant, UserNotParticipant
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message
from pytgcalls import StreamType
from pytgcalls.types.i... | 36.626911 | 153 | 0.513818 | import asyncio
import os
from Yukki.YukkiUtilities.tgcallsrun import ASS_ACC
from pyrogram import Client, filters
from pyrogram.errors import UserAlreadyParticipant, UserNotParticipant
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup, Message
from pytgcalls import StreamType
from pytgcalls.types.i... | 11,031 | 0 | 90 |
beecaaa936e3c7ed89ba6461a22917b7f985debc | 4,366 | py | Python | alipay/aop/api/domain/AlipayInsCooperationRegionQrcodeApplyModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayInsCooperationRegionQrcodeApplyModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | alipay/aop/api/domain/AlipayInsCooperationRegionQrcodeApplyModel.py | articuly/alipay-sdk-python-all | 0259cd28eca0f219b97dac7f41c2458441d5e7a6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
| 31.410072 | 79 | 0.585662 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import simplejson as json
from alipay.aop.api.constant.ParamConstants import *
class AlipayInsCooperationRegionQrcodeApplyModel(object):
def __init__(self):
self._agent_id = None
self._agent_name = None
self._agent_phone = None
self._... | 3,447 | 767 | 23 |
b13052844a086fda3e5ae4b23f91438557366084 | 6,983 | py | Python | LinearRegression/lib/regression.py | simehaa/MachineLearning | c6303329ebe4adefed2fa1009eeff898990b4c2c | [
"MIT"
] | 1 | 2019-11-19T07:48:20.000Z | 2019-11-19T07:48:20.000Z | LinearRegression/lib/regression.py | simehaa/MachineLearning | c6303329ebe4adefed2fa1009eeff898990b4c2c | [
"MIT"
] | null | null | null | LinearRegression/lib/regression.py | simehaa/MachineLearning | c6303329ebe4adefed2fa1009eeff898990b4c2c | [
"MIT"
] | null | null | null | import numpy as np
from sklearn.linear_model import Lasso, Ridge
from sklearn.preprocessing import scale
from math import floor
class Regression:
"""
Info:
Regression class which uses sklearn. Includes functions to solve:
* Ordinary Least Squares (OLS).
* Ridge regression.
* Lasso regression.
... | 31.174107 | 87 | 0.551482 | import numpy as np
from sklearn.linear_model import Lasso, Ridge
from sklearn.preprocessing import scale
from math import floor
class Regression:
"""
Info:
Regression class which uses sklearn. Includes functions to solve:
* Ordinary Least Squares (OLS).
* Ridge regression.
* Lasso regression.
... | 387 | 0 | 81 |
6d8da068c265f1808aa19d84276d58e734ff8be6 | 280 | py | Python | tests/test_utils.py | kclowes/py_ecc | 832f3901b9987294698d3b1a6448133da99daf60 | [
"MIT"
] | 122 | 2017-07-15T14:17:43.000Z | 2022-03-15T13:26:45.000Z | tests/test_utils.py | kclowes/py_ecc | 832f3901b9987294698d3b1a6448133da99daf60 | [
"MIT"
] | 97 | 2017-07-17T16:01:53.000Z | 2022-01-06T23:27:40.000Z | tests/test_utils.py | kclowes/py_ecc | 832f3901b9987294698d3b1a6448133da99daf60 | [
"MIT"
] | 75 | 2017-07-17T21:04:26.000Z | 2022-03-03T10:22:43.000Z | import pytest
from py_ecc.utils import prime_field_inv
@pytest.mark.parametrize(
'a,n,result',
[
(0, 7, 0),
(7, 7, 0),
(2, 7, 4),
(10, 7, 5),
]
)
| 16.470588 | 46 | 0.539286 | import pytest
from py_ecc.utils import prime_field_inv
@pytest.mark.parametrize(
'a,n,result',
[
(0, 7, 0),
(7, 7, 0),
(2, 7, 4),
(10, 7, 5),
]
)
def test_prime_field_inv(a, n, result):
assert prime_field_inv(a, n) % n == result
| 65 | 0 | 22 |
8e8e381d5f80ac88a14b12bcc1bd30c47d674f64 | 2,450 | py | Python | lpm.py | markmelnic/Light-Pollution-Map | 66a9eb9dc9530df0fbd70c03bb797833218c3dd3 | [
"MIT"
] | null | null | null | lpm.py | markmelnic/Light-Pollution-Map | 66a9eb9dc9530df0fbd70c03bb797833218c3dd3 | [
"MIT"
] | null | null | null | lpm.py | markmelnic/Light-Pollution-Map | 66a9eb9dc9530df0fbd70c03bb797833218c3dd3 | [
"MIT"
] | 1 | 2021-01-21T17:48:00.000Z | 2021-01-21T17:48:00.000Z | import googlemaps, requests, scalg, json
from geopy.distance import geodesic
from datetime import datetime
from .utils import find_pollution_coords
| 48.039216 | 151 | 0.62898 | import googlemaps, requests, scalg, json
from geopy.distance import geodesic
from datetime import datetime
from .utils import find_pollution_coords
class LPM:
def __init__(self, kmz_obj, geo_key: str, weather_key: str) -> None:
self.kmz_obj = kmz_obj
self.weather_key = weather_key
self.gma... | 2,182 | -11 | 130 |
dc7fa411fdf281048ffb09830e9fe26a61c47623 | 2,860 | py | Python | function/spider/spider_charpter_info.py | txu2k8/novel-web-server | 1b77d637a6229d916b724ca2735afc00c6175368 | [
"MIT"
] | null | null | null | function/spider/spider_charpter_info.py | txu2k8/novel-web-server | 1b77d637a6229d916b724ca2735afc00c6175368 | [
"MIT"
] | null | null | null | function/spider/spider_charpter_info.py | txu2k8/novel-web-server | 1b77d637a6229d916b724ca2735afc00c6175368 | [
"MIT"
] | null | null | null | '''
将一本小说内容插入到MYSQL中
'''
import time
import pymysql
from selenium import webdriver
from pyquery import PyQuery as pq
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
#url = 'https://book.tianya.cn/chapte... | 30.425532 | 99 | 0.637762 | '''
将一本小说内容插入到MYSQL中
'''
import time
import pymysql
from selenium import webdriver
from pyquery import PyQuery as pq
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
#url = 'https://book.tianya.cn/chapte... | 1,822 | 0 | 113 |
e32bad95d1fcbbaff381975ac251328ca09fad48 | 36 | py | Python | edsnlp/pipelines/core/matcher/__init__.py | MohamedBsh/edsnlp | a58b31d62e14b029ed390364a7e15d99c1decd16 | [
"BSD-3-Clause"
] | 32 | 2022-03-08T16:45:09.000Z | 2022-03-31T15:21:00.000Z | edsnlp/pipelines/core/matcher/__init__.py | MohamedBsh/edsnlp | a58b31d62e14b029ed390364a7e15d99c1decd16 | [
"BSD-3-Clause"
] | 19 | 2022-03-09T11:44:43.000Z | 2022-03-31T14:32:06.000Z | edsnlp/pipelines/core/matcher/__init__.py | MohamedBsh/edsnlp | a58b31d62e14b029ed390364a7e15d99c1decd16 | [
"BSD-3-Clause"
] | 1 | 2022-03-11T16:14:21.000Z | 2022-03-11T16:14:21.000Z | from .matcher import GenericMatcher
| 18 | 35 | 0.861111 | from .matcher import GenericMatcher
| 0 | 0 | 0 |
e572f5c1e3667bd0ddfa07d24d44b0c3fe020f3b | 14,584 | py | Python | gui/view_model.py | zmyml/parking_labeler | 62ab975c3aae161469b6469d38469c03169ee467 | [
"MIT"
] | null | null | null | gui/view_model.py | zmyml/parking_labeler | 62ab975c3aae161469b6469d38469c03169ee467 | [
"MIT"
] | null | null | null | gui/view_model.py | zmyml/parking_labeler | 62ab975c3aae161469b6469d38469c03169ee467 | [
"MIT"
] | null | null | null | from .model import ImageWidth, ImageHeight, Camera, ImageList, Record, RecordList
from .view import OpenDialog, ErrorDialog, MainWindow
import datetime
from functools import reduce
import PIL.ImageQt
from PySide2 import QtCore, QtGui, QtWidgets
ImageViewWidth = 800
ImageViewHeight = 600
| 31.842795 | 119 | 0.577208 | from .model import ImageWidth, ImageHeight, Camera, ImageList, Record, RecordList
from .view import OpenDialog, ErrorDialog, MainWindow
import datetime
from functools import reduce
import PIL.ImageQt
from PySide2 import QtCore, QtGui, QtWidgets
ImageViewWidth = 800
ImageViewHeight = 600
def _strftime(timestamp):
... | 12,536 | 1,398 | 465 |
8c37ae1787f946e862a857ab4b5c48cfc750ca59 | 9,273 | py | Python | vendor/pyLibrary/env/flask_wrappers.py | klahnakoski/auth0-api | eda9c2554c641da76687f64445b8d35543d012d9 | [
"MIT"
] | null | null | null | vendor/pyLibrary/env/flask_wrappers.py | klahnakoski/auth0-api | eda9c2554c641da76687f64445b8d35543d012d9 | [
"MIT"
] | null | null | null | vendor/pyLibrary/env/flask_wrappers.py | klahnakoski/auth0-api | eda9c2554c641da76687f64445b8d35543d012d9 | [
"MIT"
] | null | null | null | # encoding: utf-8
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import, division,... | 30.009709 | 101 | 0.585787 | # encoding: utf-8
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
#
# Author: Kyle Lahnakoski (kyle@lahnakoski.com)
#
from __future__ import absolute_import, division,... | 3,788 | 0 | 269 |
b9274fb0b48365fcc0159de099c8bdec3f97941b | 710 | py | Python | cipherInterface.py | Kchao1910/Playfair-Cipher | 57b2771134d041d2c8dd23e3c577efb10e14a26c | [
"MIT"
] | 1 | 2019-03-17T04:31:47.000Z | 2019-03-17T04:31:47.000Z | cipher.py | Kchao1910/Playfair-Cipher | 57b2771134d041d2c8dd23e3c577efb10e14a26c | [
"MIT"
] | null | null | null | cipher.py | Kchao1910/Playfair-Cipher | 57b2771134d041d2c8dd23e3c577efb10e14a26c | [
"MIT"
] | 1 | 2021-04-09T06:58:03.000Z | 2021-04-09T06:58:03.000Z | import sys
import re
from collections import OrderedDict
import cipherCheck
import playfair_cipher
import vigenere_cipher
# start of main()
cipherList = ['PLF', 'RTS', 'RFC', 'VIG', 'CES']
# Remember that the first argument of the script is the file name, thus start at index 1
cipherName = str(sys.argv[1])
key = str... | 29.583333 | 88 | 0.777465 | import sys
import re
from collections import OrderedDict
import cipherCheck
import playfair_cipher
import vigenere_cipher
# start of main()
cipherList = ['PLF', 'RTS', 'RFC', 'VIG', 'CES']
# Remember that the first argument of the script is the file name, thus start at index 1
cipherName = str(sys.argv[1])
key = str... | 0 | 0 | 0 |
4b6d0cdd99151ef98a2509f8b36bf9dfc902ff55 | 313 | py | Python | airtech_api/flight/migrations/0002_auto_20190404_1621.py | chidioguejiofor/airtech-api | 45d77da0cc4230dd3cb7ab4cbb5168a9239850f5 | [
"MIT"
] | 1 | 2019-04-04T12:27:55.000Z | 2019-04-04T12:27:55.000Z | airtech_api/flight/migrations/0002_auto_20190404_1621.py | chidioguejiofor/airtech-api | 45d77da0cc4230dd3cb7ab4cbb5168a9239850f5 | [
"MIT"
] | 34 | 2019-03-26T11:18:17.000Z | 2022-02-10T08:12:36.000Z | airtech_api/flight/migrations/0002_auto_20190404_1621.py | chidioguejiofor/airtech-api | 45d77da0cc4230dd3cb7ab4cbb5168a9239850f5 | [
"MIT"
] | null | null | null | # Generated by Django 2.2 on 2019-04-04 16:21
from django.db import migrations
| 17.388889 | 45 | 0.57508 | # Generated by Django 2.2 on 2019-04-04 16:21
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('flight', '0001_initial'),
]
operations = [
migrations.AlterModelTable(
name='flight',
table='Flight',
),
]
| 0 | 209 | 23 |
18162c4587efee7db2f7c7eafed92cdf1dd67fee | 740 | py | Python | payments/migrations/0007_finalize_payments_organization_meta.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | 13 | 2015-11-29T12:19:12.000Z | 2021-02-21T15:42:11.000Z | payments/migrations/0007_finalize_payments_organization_meta.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | 23 | 2015-04-29T19:43:34.000Z | 2021-02-10T05:50:17.000Z | payments/migrations/0007_finalize_payments_organization_meta.py | darkismus/kompassi | 35dea2c7af2857a69cae5c5982b48f01ba56da1f | [
"CC-BY-3.0"
] | 11 | 2015-09-20T18:59:00.000Z | 2020-02-07T08:47:34.000Z | # Generated by Django 2.2.10 on 2020-07-21 17:16
from django.db import migrations, models
import django.db.models.deletion
| 29.6 | 121 | 0.647297 | # Generated by Django 2.2.10 on 2020-07-21 17:16
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('payments', '0006_populate_payments_organization_meta'),
]
operations = [
migrations.AlterField(
... | 0 | 592 | 23 |
91f079ecdad8c3e1affeb142399ec62ba4e52a45 | 12,238 | py | Python | server.py | sagarsangwan/student-portal | 420195a733b207776b661835fd0db840101e2088 | [
"MIT"
] | null | null | null | server.py | sagarsangwan/student-portal | 420195a733b207776b661835fd0db840101e2088 | [
"MIT"
] | null | null | null | server.py | sagarsangwan/student-portal | 420195a733b207776b661835fd0db840101e2088 | [
"MIT"
] | null | null | null | from flask import Flask, render_template, request, make_response, send_file, redirect
import os
import secrets
import json
import requests
import re
import difflib
from flask_mysqldb import MySQL
from difflib import get_close_matches
from dotenv import load_dotenv
from googleapiclient.http import MediaFileUpload
from g... | 34.866097 | 120 | 0.60353 | from flask import Flask, render_template, request, make_response, send_file, redirect
import os
import secrets
import json
import requests
import re
import difflib
from flask_mysqldb import MySQL
from difflib import get_close_matches
from dotenv import load_dotenv
from googleapiclient.http import MediaFileUpload
from g... | 10,204 | 0 | 378 |
b41b31e3c81a5da38164ad09513e8c38724bfe19 | 5,050 | py | Python | pysit/solvers/wavefield_vector.py | zfang-slim/pysit | 8fca42b9749841abc302d1f8195a1437fad7ae4d | [
"BSD-3-Clause"
] | 64 | 2015-09-08T06:23:27.000Z | 2022-03-09T23:35:24.000Z | pysit/solvers/wavefield_vector.py | zfang-slim/pysit | 8fca42b9749841abc302d1f8195a1437fad7ae4d | [
"BSD-3-Clause"
] | 23 | 2015-10-08T01:14:24.000Z | 2021-07-15T11:37:05.000Z | pysit/solvers/wavefield_vector.py | zfang-slim/pysit | 8fca42b9749841abc302d1f8195a1437fad7ae4d | [
"BSD-3-Clause"
] | 48 | 2015-06-25T14:48:22.000Z | 2021-12-06T19:50:25.000Z | import numpy as np
import warnings
__all__ = ['WavefieldVectorBase']
if __name__ == '__main__':
m = Mesh()
W = WavefieldVectorBase(m)
MW = MyWFV(m)
W._data += np.arange(5).reshape(W._data.shape)
MW._data += np.arange(MW._data.shape[0]).reshape(MW._data.shape) | 30.606061 | 119 | 0.574059 | import numpy as np
import warnings
__all__ = ['WavefieldVectorBase']
class WavefieldVectorBase(object):
aux_names = []
def __init__(self, mesh, dtype=np.double, data=None):
self.mesh = mesh
#these if statements manage the compact operator flag
if self.mesh.z.lbc.type == 'pml':
... | 3,968 | 686 | 107 |
d4389c6e3b2c0437ccff9623eeaeac1ea52ec11b | 4,415 | py | Python | examples/kubernetes/scripts/analyzer/serializator.py | katarzyna-z/workload-collocation-agent | 49e7e5f0cb13ffd81552e7722d40b3900053e56a | [
"Apache-2.0"
] | null | null | null | examples/kubernetes/scripts/analyzer/serializator.py | katarzyna-z/workload-collocation-agent | 49e7e5f0cb13ffd81552e7722d40b3900053e56a | [
"Apache-2.0"
] | null | null | null | examples/kubernetes/scripts/analyzer/serializator.py | katarzyna-z/workload-collocation-agent | 49e7e5f0cb13ffd81552e7722d40b3900053e56a | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 47.98913 | 99 | 0.634881 | # Copyright (c) 2020 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | 2,266 | 0 | 131 |
37af31cedf8dcc4a28fc81ce714ff29de954f4f7 | 1,612 | py | Python | cupProject/cupApp/views.py | cs-fullstack-2019-spring/django-moreviews-cw-ChelsGreg | 89a6d1a4c33c87fb6d9cc305c1734e85304cc735 | [
"Apache-2.0"
] | null | null | null | cupProject/cupApp/views.py | cs-fullstack-2019-spring/django-moreviews-cw-ChelsGreg | 89a6d1a4c33c87fb6d9cc305c1734e85304cc735 | [
"Apache-2.0"
] | null | null | null | cupProject/cupApp/views.py | cs-fullstack-2019-spring/django-moreviews-cw-ChelsGreg | 89a6d1a4c33c87fb6d9cc305c1734e85304cc735 | [
"Apache-2.0"
] | null | null | null | from django.shortcuts import render
from django.http import HttpResponse
from .models import Cup
# Create your views here.
#
# TEST FUNCTION
# FUNCTION FOR HELLO, NAME
# FUNCTION FOR NUMBER TIMES 2
# FUNCTION TO ADD NUMBERS TO SUM
# FUNCTION TO CREATE NEW CUP OBJECT
# FILTERS FOR MANUFACTURE DATE
# CHANGE MATER... | 26.42623 | 92 | 0.701613 | from django.shortcuts import render
from django.http import HttpResponse
from .models import Cup
# Create your views here.
#
# TEST FUNCTION
def index(request):
return HttpResponse("Test URL")
# FUNCTION FOR HELLO, NAME
def helloThere(request, name):
return HttpResponse("Hello, " + name + "!")
# FUNCTION FOR... | 1,049 | 0 | 176 |
5bbbbbc812ea5a0ff3545d0bd30d6e6989bf1a0f | 6,380 | py | Python | workchains/launcher/launch_phonon.py | abelcarreras/aiida_extensions | cce3fe537d041fdae87c5a60ce433e6de3fc30cf | [
"MIT"
] | null | null | null | workchains/launcher/launch_phonon.py | abelcarreras/aiida_extensions | cce3fe537d041fdae87c5a60ce433e6de3fc30cf | [
"MIT"
] | null | null | null | workchains/launcher/launch_phonon.py | abelcarreras/aiida_extensions | cce3fe537d041fdae87c5a60ce433e6de3fc30cf | [
"MIT"
] | null | null | null |
# Works run by the daemon (using submit)
from aiida import load_dbenv, is_dbenv_loaded
if not is_dbenv_loaded():
load_dbenv()
from aiida.orm import CalculationFactory, DataFactory
from aiida.work.run import run, submit, async
from aiida.orm.data.structure import StructureData
from aiida.orm.data.base import Str,... | 36.045198 | 139 | 0.541223 |
# Works run by the daemon (using submit)
from aiida import load_dbenv, is_dbenv_loaded
if not is_dbenv_loaded():
load_dbenv()
from aiida.orm import CalculationFactory, DataFactory
from aiida.work.run import run, submit, async
from aiida.orm.data.structure import StructureData
from aiida.orm.data.base import Str,... | 0 | 0 | 0 |
f4037134482cd2dce70ff0d781ce82edf71ae942 | 6,315 | py | Python | utils/clustering.py | ficolo/science-radar | 3929493d93aa3712e4f48e7ab23b659daedb3b1f | [
"Apache-2.0"
] | 1 | 2019-10-03T02:04:12.000Z | 2019-10-03T02:04:12.000Z | utils/clustering.py | ficolo/science-radar | 3929493d93aa3712e4f48e7ab23b659daedb3b1f | [
"Apache-2.0"
] | null | null | null | utils/clustering.py | ficolo/science-radar | 3929493d93aa3712e4f48e7ab23b659daedb3b1f | [
"Apache-2.0"
] | null | null | null | from utils.mongodb_access import get_references_annotations, get_references_count
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.cluster import DBSCAN
from time import time
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets.samples_generator import make_blobs
from sklearn... | 38.272727 | 142 | 0.685511 | from utils.mongodb_access import get_references_annotations, get_references_count
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.cluster import DBSCAN
from time import time
import numpy as np
import matplotlib.pyplot as plt
from sklearn.datasets.samples_generator import make_blobs
from sklearn... | 3,331 | 0 | 115 |
e976b8214e50743fed1938933b12e0d902966808 | 571 | py | Python | exe28.py | henrique-alvaro/EXERCICIOS | dd2509a682009ee4a01f0ca346d960ab09cc284b | [
"MIT"
] | null | null | null | exe28.py | henrique-alvaro/EXERCICIOS | dd2509a682009ee4a01f0ca346d960ab09cc284b | [
"MIT"
] | null | null | null | exe28.py | henrique-alvaro/EXERCICIOS | dd2509a682009ee4a01f0ca346d960ab09cc284b | [
"MIT"
] | null | null | null | # criando um jogo de adivinha
from random import randint
from time import sleep
# fazendo o computador sortear um numero de 0 ate 5
cpu = randint(0, 5)
print('<< TENTE ADIVINHAR >>')
# pedindo qual numero o jogador vai jogar
jogador = int(input('Jogador tente adivinhar o numero entre (0, 5): '))
# analisando se o jogad... | 33.588235 | 71 | 0.700525 | # criando um jogo de adivinha
from random import randint
from time import sleep
# fazendo o computador sortear um numero de 0 ate 5
cpu = randint(0, 5)
print('<< TENTE ADIVINHAR >>')
# pedindo qual numero o jogador vai jogar
jogador = int(input('Jogador tente adivinhar o numero entre (0, 5): '))
# analisando se o jogad... | 0 | 0 | 0 |
2ecfb090fe75914469d0a2b1b91258e07b51bcc8 | 1,550 | py | Python | atados_core/management/commands/changenonprofitslug.py | fidelisrafael/atados-api | 00611115e180b184c68729816a36e094f0f0dcd1 | [
"MIT"
] | null | null | null | atados_core/management/commands/changenonprofitslug.py | fidelisrafael/atados-api | 00611115e180b184c68729816a36e094f0f0dcd1 | [
"MIT"
] | null | null | null | atados_core/management/commands/changenonprofitslug.py | fidelisrafael/atados-api | 00611115e180b184c68729816a36e094f0f0dcd1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand, CommandError
from atados_core.models import Nonprofit, Project
| 31.632653 | 83 | 0.622581 | # -*- coding: utf-8 -*-
from django.core.management.base import BaseCommand, CommandError
from atados_core.models import Nonprofit, Project
class Command(BaseCommand):
args = '<old_slug new_slug>'
help = 'Change slug name for for nonprofit'
def handle(self, *args, **options):
try:
old_slug, new_slug ... | 1,278 | 108 | 23 |
6d78c4c13d6769d89775cd4bd87f7b8d2a2024ab | 27 | py | Python | multihash/version.py | odesenfans/pymultihash | 093365f20f6d8627c1fae13e0f4e0b35e9b39ad2 | [
"MIT"
] | 18 | 2016-02-10T11:50:52.000Z | 2021-10-01T19:33:56.000Z | multihash/version.py | odesenfans/pymultihash | 093365f20f6d8627c1fae13e0f4e0b35e9b39ad2 | [
"MIT"
] | 12 | 2016-06-06T12:40:23.000Z | 2022-03-02T21:49:25.000Z | multihash/version.py | odesenfans/pymultihash | 093365f20f6d8627c1fae13e0f4e0b35e9b39ad2 | [
"MIT"
] | 9 | 2016-05-14T22:46:39.000Z | 2022-01-21T22:48:16.000Z | __version__ = '0.9.0.dev1'
| 13.5 | 26 | 0.666667 | __version__ = '0.9.0.dev1'
| 0 | 0 | 0 |
cd6ff40760182eca6a15642ce8d1dd26f88716b9 | 483 | py | Python | test/test.py | kaleksandrov/python-thread-pool-executor | 53aff7eef61332f9dd94bc18d0f56f16aed894d5 | [
"MIT"
] | 1 | 2015-12-15T06:50:14.000Z | 2015-12-15T06:50:14.000Z | test/test.py | kaleksandrov/python-thread-pool-executor | 53aff7eef61332f9dd94bc18d0f56f16aed894d5 | [
"MIT"
] | null | null | null | test/test.py | kaleksandrov/python-thread-pool-executor | 53aff7eef61332f9dd94bc18d0f56f16aed894d5 | [
"MIT"
] | 1 | 2021-08-25T13:15:44.000Z | 2021-08-25T13:15:44.000Z | #!/usr/bin/env python
import sys
sys.path.append('../src')
from random import random
from threading import RLock
from time import sleep
from threadingex.threadpoolexecutor import ThreadPoolExecutor
lock = RLock()
result = {}
executor = ThreadPoolExecutor(10)
for i in range(100):
executor.submit(task, i)
ex... | 15.580645 | 61 | 0.724638 | #!/usr/bin/env python
import sys
sys.path.append('../src')
from random import random
from threading import RLock
from time import sleep
from threadingex.threadpoolexecutor import ThreadPoolExecutor
lock = RLock()
result = {}
def task(value):
sleep(random())
with lock:
result[value] = value ** 2
... | 65 | 0 | 23 |
1fb6da394aa521d67e63346cb2e2105622574250 | 2,510 | py | Python | setup.py | petronije2002/PqrUpload | db22af08dac1243569e5f3dd8cdb4e010b215878 | [
"MIT"
] | null | null | null | setup.py | petronije2002/PqrUpload | db22af08dac1243569e5f3dd8cdb4e010b215878 | [
"MIT"
] | 3 | 2020-03-24T17:35:36.000Z | 2021-02-02T22:12:56.000Z | setup.py | petronije2002/PqrUpload | db22af08dac1243569e5f3dd8cdb4e010b215878 | [
"MIT"
] | null | null | null | import setuptools
from distutils.core import setup
setup(
name = 'PqrUploadModule', # How you named your package folder (MyLib)
packages = ['PqrUploadModule'], # Chose the same as "name"
version = '0.0.12', # Start with a small number and increase it with every change you make
license='MIT', ... | 33.918919 | 146 | 0.655378 | import setuptools
from distutils.core import setup
setup(
name = 'PqrUploadModule', # How you named your package folder (MyLib)
packages = ['PqrUploadModule'], # Chose the same as "name"
version = '0.0.12', # Start with a small number and increase it with every change you make
license='MIT', ... | 0 | 0 | 0 |
af51e6002bbc6f380207972586789598a0147a80 | 3,428 | py | Python | docs/sample_code/gradient_accumulation/train_and_eval_boost.py | mindspore-ai/docs | e7cbd69fe2bbd7870aa4591510ed3342ec6a3d41 | [
"Apache-2.0",
"CC-BY-4.0"
] | 288 | 2020-03-28T07:00:25.000Z | 2021-12-26T14:56:31.000Z | docs/sample_code/gradient_accumulation/train_and_eval_boost.py | mindspore-ai/docs | e7cbd69fe2bbd7870aa4591510ed3342ec6a3d41 | [
"Apache-2.0",
"CC-BY-4.0"
] | 1 | 2021-07-21T08:11:58.000Z | 2021-07-21T08:11:58.000Z | docs/sample_code/gradient_accumulation/train_and_eval_boost.py | mindspore-ai/docs | e7cbd69fe2bbd7870aa4591510ed3342ec6a3d41 | [
"Apache-2.0",
"CC-BY-4.0"
] | 37 | 2020-03-30T06:38:37.000Z | 2021-09-17T05:47:59.000Z | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 44.519481 | 97 | 0.692824 | # Copyright 2021 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 582 | 0 | 53 |
6de2e74d557832664276c05413ad091c457e6051 | 777 | py | Python | scraper/utils.py | aarora08/nasa-apod-scraper | cf6c7b33835350ee49bf1e98f96a021b31b7d53f | [
"MIT"
] | null | null | null | scraper/utils.py | aarora08/nasa-apod-scraper | cf6c7b33835350ee49bf1e98f96a021b31b7d53f | [
"MIT"
] | null | null | null | scraper/utils.py | aarora08/nasa-apod-scraper | cf6c7b33835350ee49bf1e98f96a021b31b7d53f | [
"MIT"
] | null | null | null | import json
from datetime import date, datetime, timedelta
from pathlib import Path
from typing import Iterator
| 33.782609 | 70 | 0.698842 | import json
from datetime import date, datetime, timedelta
from pathlib import Path
from typing import Iterator
def date_range(start_date: date, end_date: date) -> Iterator:
for n in range(int((end_date - start_date).days)):
yield start_date + timedelta(n)
async def log_failed_results(failed_urls, log_d... | 617 | 0 | 46 |
2f7e7065c08d429fad635662ac1f15d34be09068 | 747 | py | Python | tests/test_reactions.py | Sillocan/dpytest | d644d73d767b6b1ea15f01b9a4bfcce87424f9fc | [
"MIT"
] | 4 | 2021-01-16T13:54:30.000Z | 2021-04-21T21:03:09.000Z | tests/test_reactions.py | Sillocan/dpytest | d644d73d767b6b1ea15f01b9a4bfcce87424f9fc | [
"MIT"
] | 9 | 2020-08-31T14:04:15.000Z | 2021-06-18T10:06:54.000Z | tests/test_reactions.py | Sillocan/dpytest | d644d73d767b6b1ea15f01b9a4bfcce87424f9fc | [
"MIT"
] | 3 | 2021-01-08T09:19:36.000Z | 2021-04-21T14:53:09.000Z | import pytest
@pytest.mark.asyncio
@pytest.mark.asyncio
| 26.678571 | 103 | 0.689424 | import pytest
@pytest.mark.asyncio
async def test_add_reaction(bot):
g = bot.guilds[0]
c = g.text_channels[0]
message = await c.send("Test Message")
await message.add_reaction("😂")
# This is d.py/discord's fault, the message object from send isn't the same as the one in the state
message = ... | 652 | 0 | 44 |
0f22cc5d0281d7dff59ccf6e3b47c7eb49e03b0a | 610 | py | Python | nlidbTranslator/api/__init__.py | DataManagementLab/univerSQL | 1e37f089c1f1dfc8756c183db019a90e5a9a2c2c | [
"MIT"
] | null | null | null | nlidbTranslator/api/__init__.py | DataManagementLab/univerSQL | 1e37f089c1f1dfc8756c183db019a90e5a9a2c2c | [
"MIT"
] | null | null | null | nlidbTranslator/api/__init__.py | DataManagementLab/univerSQL | 1e37f089c1f1dfc8756c183db019a90e5a9a2c2c | [
"MIT"
] | null | null | null | import sys
from api.analysis import translators
from api.paths import PROJECT_ROOT
# allow for imports of translator code as "translator.module"
sys.path.append(str(PROJECT_ROOT / "translators"))
# allow for imports of adapter code as "adapter.translator.module"
sys.path.append(str(PROJECT_ROOT / "nlidbTranslator/a... | 30.5 | 90 | 0.778689 | import sys
from api.analysis import translators
from api.paths import PROJECT_ROOT
# allow for imports of translator code as "translator.module"
sys.path.append(str(PROJECT_ROOT / "translators"))
# allow for imports of adapter code as "adapter.translator.module"
sys.path.append(str(PROJECT_ROOT / "nlidbTranslator/a... | 0 | 0 | 0 |
be2b4882c9b9c8c5c38eacb792a6d3280a52f270 | 1,659 | py | Python | tasks.py | RayFoulk/PythonDemo | 2134c51d2fa479308a715ddf692b01189bb757c7 | [
"MIT"
] | null | null | null | tasks.py | RayFoulk/PythonDemo | 2134c51d2fa479308a715ddf692b01189bb757c7 | [
"MIT"
] | null | null | null | tasks.py | RayFoulk/PythonDemo | 2134c51d2fa479308a715ddf692b01189bb757c7 | [
"MIT"
] | null | null | null | import os
import pathlib
from invoke import (
task,
)
ROOT_PATH = pathlib.Path(__file__).resolve().parent
ROOT_PATH_STR = str(ROOT_PATH)
@task()
def clean(context):
"""
Clean the project
:param context: invoke context
"""
with context.cd(ROOT_PATH_STR):
context.run('git clean -fd')
... | 23.366197 | 79 | 0.64135 | import os
import pathlib
from invoke import (
task,
)
ROOT_PATH = pathlib.Path(__file__).resolve().parent
ROOT_PATH_STR = str(ROOT_PATH)
@task()
def clean(context):
"""
Clean the project
:param context: invoke context
"""
with context.cd(ROOT_PATH_STR):
context.run('git clean -fd')
... | 0 | 0 | 0 |
e6b34aed109e0fb773fcc927112667f38c52e168 | 861 | py | Python | src/moonshot/utils/image_utils.py | rpeloff/moonshot | f58ddaa15c2bea416731e3bd1f2c5de86d6aa115 | [
"MIT"
] | 4 | 2019-10-29T09:50:59.000Z | 2019-11-22T19:01:07.000Z | src/moonshot/utils/image_utils.py | rpeloff/moonshot | f58ddaa15c2bea416731e3bd1f2c5de86d6aa115 | [
"MIT"
] | null | null | null | src/moonshot/utils/image_utils.py | rpeloff/moonshot | f58ddaa15c2bea416731e3bd1f2c5de86d6aa115 | [
"MIT"
] | null | null | null | """Utility functions for manipulating image data.
Author: Ryan Eloff
Contact: ryan.peter.eloff@gmail.com
Date: July 2019
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from skimage.io import imread
def load_image_array(image_pat... | 26.090909 | 84 | 0.708479 | """Utility functions for manipulating image data.
Author: Ryan Eloff
Contact: ryan.peter.eloff@gmail.com
Date: July 2019
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
from skimage.io import imread
def load_image_array(image_pat... | 0 | 0 | 0 |
bf1859ab0665815dab10e43bd66ddd020f612197 | 1,877 | py | Python | src/util/data_util.py | Iliricon/DeepNotebooks | 036c807753254504c8546fbdfc91a86cd94e6a3d | [
"Apache-2.0"
] | 5 | 2019-03-01T14:45:54.000Z | 2020-04-27T02:39:50.000Z | src/util/data_util.py | cvoelcker/DeepNotebooks | 036c807753254504c8546fbdfc91a86cd94e6a3d | [
"Apache-2.0"
] | 3 | 2018-12-13T13:11:13.000Z | 2019-03-18T17:01:43.000Z | src/util/data_util.py | Iliricon/DeepNotebooks | 036c807753254504c8546fbdfc91a86cd94e6a3d | [
"Apache-2.0"
] | 2 | 2020-03-30T16:20:55.000Z | 2020-11-06T02:26:33.000Z | """
@author Claas Voelcker
Utils module containing some data utility functions
"""
import numpy as np
from src.util.spn_util import get_categoricals
def get_categorical_data(spn, df, dictionary, header=1, types=False, date=False, assert_nan=False):
"""
:param spn:
:param df:
:param dictionary:
... | 30.770492 | 128 | 0.661161 | """
@author Claas Voelcker
Utils module containing some data utility functions
"""
import numpy as np
from src.util.spn_util import get_categoricals
def get_categorical_data(spn, df, dictionary, header=1, types=False, date=False, assert_nan=False):
"""
:param spn:
:param df:
:param dictionary:
... | 0 | 0 | 0 |
ef831a67bd75d3d51f3b3e54553dc40350c61b9b | 3,261 | py | Python | src/hades/bin/check_database.py | agdsn/hades | 78782831b840188b14e37c0673a6d6e9712f64ce | [
"MIT"
] | 8 | 2015-04-27T00:41:03.000Z | 2021-11-14T17:15:26.000Z | src/hades/bin/check_database.py | agdsn/hades | 78782831b840188b14e37c0673a6d6e9712f64ce | [
"MIT"
] | 84 | 2015-04-27T12:15:00.000Z | 2021-11-28T19:06:23.000Z | src/hades/bin/check_database.py | agdsn/hades | 78782831b840188b14e37c0673a6d6e9712f64ce | [
"MIT"
] | 4 | 2015-11-14T16:20:40.000Z | 2017-09-05T00:27:49.000Z | #!/usr/bin/env python3
"""Check the status of the Hades database.
Try to select data as the different hades users from the database to check if
the database is running and accessible.
"""
import contextlib
import logging
import os
import pwd
import sys
from typing import Iterable
from sqlalchemy import Table, exists,... | 32.287129 | 80 | 0.6636 | #!/usr/bin/env python3
"""Check the status of the Hades database.
Try to select data as the different hades users from the database to check if
the database is running and accessible.
"""
import contextlib
import logging
import os
import pwd
import sys
from typing import Iterable
from sqlalchemy import Table, exists,... | 1,250 | 0 | 46 |
133d4af39702f3499201453afadb4d55cb5917a1 | 4,027 | py | Python | scripts/convtransformer/2D.py | TimDettmers/sched | e16735f2c2eb6a51f5cf29ead534041574034e2e | [
"MIT"
] | 1 | 2020-04-22T17:49:48.000Z | 2020-04-22T17:49:48.000Z | scripts/convtransformer/2D.py | TimDettmers/sched | e16735f2c2eb6a51f5cf29ead534041574034e2e | [
"MIT"
] | null | null | null | scripts/convtransformer/2D.py | TimDettmers/sched | e16735f2c2eb6a51f5cf29ead534041574034e2e | [
"MIT"
] | null | null | null | import itertools
import gpuscheduler
import argparse
import os
from itertools import product
parser = argparse.ArgumentParser(description='Compute script.')
parser.add_argument('--dry', action='store_true')
parser.add_argument('--verbose', action='store_true')
args = parser.parse_args()
#s = gpuscheduler.Scheduler('/... | 32.475806 | 285 | 0.659051 | import itertools
import gpuscheduler
import argparse
import os
from itertools import product
parser = argparse.ArgumentParser(description='Compute script.')
parser.add_argument('--dry', action='store_true')
parser.add_argument('--verbose', action='store_true')
args = parser.parse_args()
#s = gpuscheduler.Scheduler('/... | 0 | 0 | 0 |
5f9a7c2a14d3e23d564737736774ae7411d34445 | 4,382 | py | Python | yesaide/worker.py | ouihelp/yesaide | e234b918947f4baf4a66608cd4df47a2a46d98d3 | [
"MIT"
] | null | null | null | yesaide/worker.py | ouihelp/yesaide | e234b918947f4baf4a66608cd4df47a2a46d98d3 | [
"MIT"
] | 3 | 2017-11-08T14:25:36.000Z | 2020-07-27T12:21:41.000Z | yesaide/worker.py | ouihelp/yesaide | e234b918947f4baf4a66608cd4df47a2a46d98d3 | [
"MIT"
] | null | null | null | from yesaide import YesaideRuntimeError
class RawWorker(object):
"""Deepest worker, root of all the interactions, only ensure that
a sqlalchemy database session is available in `self._dbsession`."""
class SupervisedWorker(RawWorker):
"""Worker intended to be used inside a foreman."""
class MappingMana... | 33.19697 | 89 | 0.615472 | from yesaide import YesaideRuntimeError
class RawWorker(object):
"""Deepest worker, root of all the interactions, only ensure that
a sqlalchemy database session is available in `self._dbsession`."""
def __init__(self, dbsession):
self._dbsession = dbsession
class SupervisedWorker(RawWorker):
... | 807 | 0 | 81 |
0f4fe85ee8719ab88c1e26588ecd8b620a1a13ff | 817 | py | Python | mla_game/apps/transcript/migrations/0015_auto_20171027_1252.py | amazingwebdev/django-FixIt | 698aa7e4c45f07d86fbf209d1caca017ed136675 | [
"MIT"
] | null | null | null | mla_game/apps/transcript/migrations/0015_auto_20171027_1252.py | amazingwebdev/django-FixIt | 698aa7e4c45f07d86fbf209d1caca017ed136675 | [
"MIT"
] | null | null | null | mla_game/apps/transcript/migrations/0015_auto_20171027_1252.py | amazingwebdev/django-FixIt | 698aa7e4c45f07d86fbf209d1caca017ed136675 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-10-27 12:52
from __future__ import unicode_literals
from django.db import migrations
| 24.757576 | 59 | 0.665851 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-10-27 12:52
from __future__ import unicode_literals
from django.db import migrations
def create_votes(apps, schema_editor):
TranscriptPhraseDownvote = apps.get_model(
'transcript', 'TranscriptPhraseDownvote'
)
TranscriptPhraseVote = app... | 455 | 167 | 46 |
55f86bf32670e94353a9369e3b19d5f9426c13c6 | 585 | py | Python | offer/16-shu-zhi-de-zheng-shu-ci-fang-lcof.py | wanglongjiang/leetcode | c61d2e719e81575cfb5bde9d64e15cee7cf01ef3 | [
"MIT"
] | 2 | 2021-03-14T11:38:26.000Z | 2021-03-14T11:38:30.000Z | offer/16-shu-zhi-de-zheng-shu-ci-fang-lcof.py | wanglongjiang/leetcode | c61d2e719e81575cfb5bde9d64e15cee7cf01ef3 | [
"MIT"
] | null | null | null | offer/16-shu-zhi-de-zheng-shu-ci-fang-lcof.py | wanglongjiang/leetcode | c61d2e719e81575cfb5bde9d64e15cee7cf01ef3 | [
"MIT"
] | 1 | 2022-01-17T19:33:23.000Z | 2022-01-17T19:33:23.000Z | '''
剑指 Offer 16. 数值的整数次方
实现 pow(x, n) ,即计算 x 的 n 次幂函数(即,xn)。不得使用库函数,同时不需要考虑大数问题。
'''
s = Solution()
print(s.myPow(2.0, 10) == 1024.0)
print(s.myPow(2.1, 3) == 9.261)
print(s.myPow(2.0, -2) == 0.25)
| 20.892857 | 55 | 0.473504 | '''
剑指 Offer 16. 数值的整数次方
实现 pow(x, n) ,即计算 x 的 n 次幂函数(即,xn)。不得使用库函数,同时不需要考虑大数问题。
'''
class Solution:
def myPow(self, x: float, n: int) -> float:
neg = n >= 0
n = abs(n)
product = 1
product2n = x
while n > 0:
if n & 1 == 1:
product = product * pro... | 341 | -6 | 49 |
768a403177f9bb1328b4a83e3dfb3171e1f6ef68 | 983 | py | Python | taroapp/cmd/ps.py | taro-suite/taro | baa76e75706bc824a799928d9b7548431b898338 | [
"MIT"
] | null | null | null | taroapp/cmd/ps.py | taro-suite/taro | baa76e75706bc824a799928d9b7548431b898338 | [
"MIT"
] | 26 | 2021-04-05T12:32:21.000Z | 2022-03-22T12:53:44.000Z | taroapp/cmd/ps.py | taro-suite/taro | baa76e75706bc824a799928d9b7548431b898338 | [
"MIT"
] | 1 | 2021-04-16T21:04:53.000Z | 2021-04-16T21:04:53.000Z | import json
from pygments import highlight
from pygments.formatters.terminal import TerminalFormatter
from pygments.lexers.data import JsonLexer
import taro.client
from taro import dto, util
from taro.jobs.job import JobInfoCollection,JobInfo
from taroapp import printer
from taroapp.view import instance as view_inst
... | 33.896552 | 96 | 0.7294 | import json
from pygments import highlight
from pygments.formatters.terminal import TerminalFormatter
from pygments.lexers.data import JsonLexer
import taro.client
from taro import dto, util
from taro.jobs.job import JobInfoCollection,JobInfo
from taroapp import printer
from taroapp.view import instance as view_inst
... | 639 | 0 | 23 |
7a5672dae65c7771cc160bc0ef36a606c64ee1ac | 679 | py | Python | modbus_client/types.py | KrystianD/modbus_client | 0dfae4933f3745d184a057d65f8d394a895e4580 | [
"MIT"
] | null | null | null | modbus_client/types.py | KrystianD/modbus_client | 0dfae4933f3745d184a057d65f8d394a895e4580 | [
"MIT"
] | null | null | null | modbus_client/types.py | KrystianD/modbus_client | 0dfae4933f3745d184a057d65f8d394a895e4580 | [
"MIT"
] | null | null | null | from dataclasses import dataclass, field
from enum import Enum
from typing import Dict, Tuple, Union
RegisterValue = Union[int, bool]
@dataclass
__all__ = [
"RegisterType",
"ModbusReadSession",
"RegisterValueType",
]
| 18.351351 | 95 | 0.680412 | from dataclasses import dataclass, field
from enum import Enum
from typing import Dict, Tuple, Union
class RegisterType(Enum):
Coil = 1
DiscreteInputs = 2
InputRegister = 4
HoldingRegister = 5
class RegisterValueType(str, Enum):
S16 = 'int16'
U16 = 'uint16'
S32BE = 'int32be'
S32LE = ... | 0 | 374 | 68 |
15322b73bc8a724ee64d588d51570a6786ab1c00 | 9,950 | py | Python | gimmemotifs/config.py | littleblackfish/gimmemotifs | 913a6e5db378493155273e2c0f8ab0dc11ab219e | [
"MIT"
] | null | null | null | gimmemotifs/config.py | littleblackfish/gimmemotifs | 913a6e5db378493155273e2c0f8ab0dc11ab219e | [
"MIT"
] | null | null | null | gimmemotifs/config.py | littleblackfish/gimmemotifs | 913a6e5db378493155273e2c0f8ab0dc11ab219e | [
"MIT"
] | null | null | null | # Copyright (c) 2009-2016 Simon van Heeringen <simon.vanheeringen@gmail.com>
#
# This module is free software. You can redistribute it and/or modify it under
# the terms of the MIT License, see the file COPYING included with this
# distribution.
""" Configuration for GimmeMotifs """
import configparser
import sysconf... | 33.056478 | 178 | 0.565729 | # Copyright (c) 2009-2016 Simon van Heeringen <simon.vanheeringen@gmail.com>
#
# This module is free software. You can redistribute it and/or modify it under
# the terms of the MIT License, see the file COPYING included with this
# distribution.
""" Configuration for GimmeMotifs """
import configparser
import sysconf... | 5,927 | 0 | 711 |
88f1fe9b11b63cec1989aac27dd795cfa5c003ea | 1,672 | py | Python | accounts/migrations/0002_profile_address_profile_birthday_profile_city_and_more.py | sisekelohub/sisekelo | 7e1b0de6abf07e65ed746d0d929c3de37fb421c3 | [
"MIT"
] | 1 | 2022-02-20T16:03:04.000Z | 2022-02-20T16:03:04.000Z | accounts/migrations/0002_profile_address_profile_birthday_profile_city_and_more.py | sisekelohub/sisekelo | 7e1b0de6abf07e65ed746d0d929c3de37fb421c3 | [
"MIT"
] | null | null | null | accounts/migrations/0002_profile_address_profile_birthday_profile_city_and_more.py | sisekelohub/sisekelo | 7e1b0de6abf07e65ed746d0d929c3de37fb421c3 | [
"MIT"
] | null | null | null | # Generated by Django 4.0 on 2022-01-08 14:12
from django.db import migrations, models
import django.db.models.deletion
| 32.784314 | 170 | 0.577153 | # Generated by Django 4.0 on 2022-01-08 14:12
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('auth', '0012_alter_user_first_name_max_length'),
('accounts', '0001_initial'),
]
operations = [
migra... | 0 | 1,527 | 23 |
d3db17ea359215b53d0416234718b268218c1960 | 7,997 | py | Python | auto_graph_visualizer/visualizer.py | idekerlab/auto-graph-visualizer | 14d2427ee650a2df5dcd1d886c5e648a6acc5c9e | [
"MIT"
] | 3 | 2019-09-23T05:37:51.000Z | 2021-11-21T22:59:52.000Z | auto_graph_visualizer/visualizer.py | idekerlab/auto-graph-visualizer | 14d2427ee650a2df5dcd1d886c5e648a6acc5c9e | [
"MIT"
] | null | null | null | auto_graph_visualizer/visualizer.py | idekerlab/auto-graph-visualizer | 14d2427ee650a2df5dcd1d886c5e648a6acc5c9e | [
"MIT"
] | 1 | 2019-11-18T03:21:32.000Z | 2019-11-18T03:21:32.000Z | import pandas as pd
import igraph
from ndex2.nice_cx_network import NiceCXNetwork
import ndex2.client as nc
import ndex2
import networkx as nx
from fa2 import ForceAtlas2
from .utils import *
import math
import json
import os
import numpy as np
| 37.544601 | 107 | 0.590972 | import pandas as pd
import igraph
from ndex2.nice_cx_network import NiceCXNetwork
import ndex2.client as nc
import ndex2
import networkx as nx
from fa2 import ForceAtlas2
from .utils import *
import math
import json
import os
import numpy as np
class graph_status:
def __init__(self, graph):
self.graph = g... | 7,486 | 3 | 261 |
7dd2d6b8573dbbcc19896501a41ba515956ebaa6 | 1,007 | py | Python | button-led.py | InitialState/piot-101 | 434ddcde3da6ade4c9fd5ce9ee248661dda649df | [
"MIT"
] | 49 | 2015-04-23T00:48:13.000Z | 2016-08-07T18:26:23.000Z | button-led.py | InitialState/piot-101 | 434ddcde3da6ade4c9fd5ce9ee248661dda649df | [
"MIT"
] | null | null | null | button-led.py | InitialState/piot-101 | 434ddcde3da6ade4c9fd5ce9ee248661dda649df | [
"MIT"
] | 21 | 2015-03-26T01:57:05.000Z | 2016-06-28T00:19:05.000Z | # Import library that lets you control the Pi's GPIO pins
import RPi.GPIO as io
# Import time for delays
from time import sleep
# Disables messages about GPIO pins already being in use
io.setwarnings(False)
# Numbering scheme that corresponds to breakout board and pin layout
io.setmode(io.BCM)
led_io_pin = 17
butto... | 26.5 | 68 | 0.711023 | # Import library that lets you control the Pi's GPIO pins
import RPi.GPIO as io
# Import time for delays
from time import sleep
# Disables messages about GPIO pins already being in use
io.setwarnings(False)
# Numbering scheme that corresponds to breakout board and pin layout
io.setmode(io.BCM)
led_io_pin = 17
butto... | 0 | 0 | 0 |
1a619a87f68ed772f96359ba80920b880851dad1 | 179 | py | Python | Init_Guide/urllib-use/urlread.py | coedfetr/STTP-python | 607d5c03e233dd7c6938ea2495a04701dcf5aed6 | [
"Apache-2.0"
] | null | null | null | Init_Guide/urllib-use/urlread.py | coedfetr/STTP-python | 607d5c03e233dd7c6938ea2495a04701dcf5aed6 | [
"Apache-2.0"
] | null | null | null | Init_Guide/urllib-use/urlread.py | coedfetr/STTP-python | 607d5c03e233dd7c6938ea2495a04701dcf5aed6 | [
"Apache-2.0"
] | 4 | 2015-12-24T05:34:46.000Z | 2020-03-10T03:39:16.000Z | import urllib2
url = "http://www.google.com/"
# get response from url
response = urllib2.urlopen(url)
fh = open('downloaded_file.html', "w")
fh.write(response.read())
fh.close()
| 19.888889 | 38 | 0.709497 | import urllib2
url = "http://www.google.com/"
# get response from url
response = urllib2.urlopen(url)
fh = open('downloaded_file.html', "w")
fh.write(response.read())
fh.close()
| 0 | 0 | 0 |