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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e212049fd4fc09d36d9ec4678b96c6a53faf6ba6 | 18,567 | py | Python | gewittergefahr/gg_utils/probability_distributions.py | dopplerchase/GewitterGefahr | 4415b08dd64f37eba5b1b9e8cc5aa9af24f96593 | [
"MIT"
] | 26 | 2018-10-04T01:07:35.000Z | 2022-01-29T08:49:32.000Z | gewittergefahr/gg_utils/probability_distributions.py | liuximarcus/GewitterGefahr | d819874d616f98a25187bfd3091073a2e6d5279e | [
"MIT"
] | 4 | 2017-12-25T02:01:08.000Z | 2018-12-19T01:54:21.000Z | gewittergefahr/gg_utils/probability_distributions.py | liuximarcus/GewitterGefahr | d819874d616f98a25187bfd3091073a2e6d5279e | [
"MIT"
] | 11 | 2017-12-10T23:05:29.000Z | 2022-01-29T08:49:33.000Z | """Methods for handling probability distributions."""
import numpy
import pandas
import scipy.stats
from gewittergefahr.gg_utils import error_checking
FEATURE_NAMES_KEY = 'feature_names'
FEATURE_MEANS_KEY = 'feature_means'
COVARIANCE_MATRIX_KEY = 'covariance_matrix'
COVAR_MATRIX_INVERSE_KEY = 'covar_matrix_inverse'
C... | 41.536913 | 80 | 0.703237 | """Methods for handling probability distributions."""
import numpy
import pandas
import scipy.stats
from gewittergefahr.gg_utils import error_checking
FEATURE_NAMES_KEY = 'feature_names'
FEATURE_MEANS_KEY = 'feature_means'
COVARIANCE_MATRIX_KEY = 'covariance_matrix'
COVAR_MATRIX_INVERSE_KEY = 'covar_matrix_inverse'
C... | 0 | 0 | 0 |
227779537f3ef4c14a32f8bce5688a45303f3d18 | 948 | py | Python | terroroftinytown/tracker/logs.py | Flashfire42/terroroftinytown | c52be7ac0f7abc37f4c90955e5c96b91f935903a | [
"MIT"
] | 59 | 2015-03-05T21:30:06.000Z | 2022-01-31T05:50:34.000Z | terroroftinytown/tracker/logs.py | Flashfire42/terroroftinytown | c52be7ac0f7abc37f4c90955e5c96b91f935903a | [
"MIT"
] | 33 | 2015-01-10T02:27:08.000Z | 2022-02-08T18:26:56.000Z | terroroftinytown/tracker/logs.py | Flashfire42/terroroftinytown | c52be7ac0f7abc37f4c90955e5c96b91f935903a | [
"MIT"
] | 16 | 2015-03-06T19:51:53.000Z | 2021-11-16T03:50:52.000Z | import gzip
from logging.handlers import TimedRotatingFileHandler
import os
import shutil
| 28.727273 | 77 | 0.64135 | import gzip
from logging.handlers import TimedRotatingFileHandler
import os
import shutil
class LogFilter(object):
def filter(self, record):
if not record.name:
return True
if record.name == 'tornado.access':
return False
return True
class GzipTimedRotatingFileHa... | 688 | 43 | 125 |
84ecb4db74670c45b7795abf14142a9c0e2b2060 | 12,058 | py | Python | wool/comment_pr.py | uc-cdis/wool | a5bcd0fa70289e81fcceb8a1176b277a3d7c3339 | [
"Apache-2.0"
] | null | null | null | wool/comment_pr.py | uc-cdis/wool | a5bcd0fa70289e81fcceb8a1176b277a3d7c3339 | [
"Apache-2.0"
] | 5 | 2019-09-23T19:07:51.000Z | 2021-04-20T17:06:35.000Z | wool/comment_pr.py | uc-cdis/wool | a5bcd0fa70289e81fcceb8a1176b277a3d7c3339 | [
"Apache-2.0"
] | 2 | 2019-09-22T22:07:31.000Z | 2021-04-20T15:41:40.000Z | import json
import os
import re
import subprocess
import sys
from time import sleep
import requests
SIGNATURE = (
"This formatting comment was generated automatically by a script in"
" [uc-cdis/wool](https://github.com/uc-cdis/wool)."
)
ASK_FOR_FORMAT_COMMIT = ["wool", "black", "please format my code"]
d... | 35.780415 | 120 | 0.608559 | import json
import os
import re
import subprocess
import sys
from time import sleep
import requests
SIGNATURE = (
"This formatting comment was generated automatically by a script in"
" [uc-cdis/wool](https://github.com/uc-cdis/wool)."
)
ASK_FOR_FORMAT_COMMIT = ["wool", "black", "please format my code"]
d... | 3,008 | 4 | 95 |
da16d15f6ef6b94d26790b4a05c378a4ad3b8bd0 | 3,096 | py | Python | camera.py | symunona/quadroscope | 8bd9591b6e8201daebc9804a9e35204a9a9eb512 | [
"MIT"
] | null | null | null | camera.py | symunona/quadroscope | 8bd9591b6e8201daebc9804a9e35204a9a9eb512 | [
"MIT"
] | null | null | null | camera.py | symunona/quadroscope | 8bd9591b6e8201daebc9804a9e35204a9a9eb512 | [
"MIT"
] | null | null | null | #
# Quadroscope - entry point
#
# The four camera system for raspberries.
#
import os, os.path, sys, json, time, thread, datetime, logging
import picamera
logging.basicConfig(filename='camera.log', level=logging.DEBUG)
from quadlib.utils import log
from quadlib import convert
from quadlib.updater import Updat... | 30.96 | 119 | 0.677649 | #
# Quadroscope - entry point
#
# The four camera system for raspberries.
#
import os, os.path, sys, json, time, thread, datetime, logging
import picamera
logging.basicConfig(filename='camera.log', level=logging.DEBUG)
from quadlib.utils import log
from quadlib import convert
from quadlib.updater import Updat... | 0 | 0 | 0 |
cc2fccb03fe356c69b7b737cb9f0cce751aa9f6e | 2,078 | py | Python | storyboard/plugin/email/smtp_client.py | Sitcode-Zoograf/storyboard | 5833f87e20722c524a1e4a0b8e1fb82206fb4e5c | [
"Apache-2.0"
] | null | null | null | storyboard/plugin/email/smtp_client.py | Sitcode-Zoograf/storyboard | 5833f87e20722c524a1e4a0b8e1fb82206fb4e5c | [
"Apache-2.0"
] | null | null | null | storyboard/plugin/email/smtp_client.py | Sitcode-Zoograf/storyboard | 5833f87e20722c524a1e4a0b8e1fb82206fb4e5c | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 35.220339 | 78 | 0.67565 | # Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable... | 1,052 | 0 | 54 |
d9e0027d15a7fc1300fbcec3bb5e4514bdd75c45 | 596 | py | Python | examples/_twisted/__init__.py | stepank/pyws | ff39133aabeb56bbb08d66286ac0cc8731eda7dd | [
"MIT"
] | 11 | 2015-01-19T15:43:46.000Z | 2022-03-13T08:23:01.000Z | examples/_twisted/__init__.py | stepank/pyws | ff39133aabeb56bbb08d66286ac0cc8731eda7dd | [
"MIT"
] | 1 | 2015-01-21T07:31:35.000Z | 2015-02-08T17:52:35.000Z | examples/_twisted/__init__.py | stepank/pyws | ff39133aabeb56bbb08d66286ac0cc8731eda7dd | [
"MIT"
] | 11 | 2015-01-19T15:43:49.000Z | 2022-03-04T10:11:24.000Z | #!/usr/bin/env python
from twisted.internet import reactor
from twisted.web.resource import Resource
from twisted.web.server import Site
import os, sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from pyws.adapters._twisted import serve
from server import server
#noinspection ... | 21.285714 | 79 | 0.755034 | #!/usr/bin/env python
from twisted.internet import reactor
from twisted.web.resource import Resource
from twisted.web.server import Site
import os, sys
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
from pyws.adapters._twisted import serve
from server import server
class Simple(Re... | 91 | 48 | 23 |
4dead6e83c636b5353ca03396a612806bfa66ed8 | 95 | py | Python | labs/common/apps.py | DhiaTN/djangolab | 7e0e624ef76d6be4fbf83afe53bea368c6c3590b | [
"MIT"
] | 7 | 2016-03-15T23:45:01.000Z | 2017-04-27T17:25:05.000Z | labs/common/apps.py | DhiaTN/djangolab | 7e0e624ef76d6be4fbf83afe53bea368c6c3590b | [
"MIT"
] | null | null | null | labs/common/apps.py | DhiaTN/djangolab | 7e0e624ef76d6be4fbf83afe53bea368c6c3590b | [
"MIT"
] | null | null | null | from django.apps import AppConfig
| 15.833333 | 33 | 0.757895 | from django.apps import AppConfig
class QuerysetsConfig(AppConfig):
name = 'labs.common'
| 0 | 37 | 23 |
85af3481287a01d52eb4e8aef3c93ae1abf12ca6 | 759 | py | Python | friendly-asyncio/1-threads.py | kangli-bionic/pycon | fa3f338b92f32bd86bf1db1cd4f5eb4674c0be12 | [
"MIT"
] | 32 | 2018-08-25T05:13:47.000Z | 2021-08-18T14:30:39.000Z | friendly-asyncio/1-threads.py | kangli-bionic/pycon | fa3f338b92f32bd86bf1db1cd4f5eb4674c0be12 | [
"MIT"
] | 1 | 2018-08-31T07:18:56.000Z | 2018-08-31T07:18:56.000Z | friendly-asyncio/1-threads.py | kangli-bionic/pycon | fa3f338b92f32bd86bf1db1cd4f5eb4674c0be12 | [
"MIT"
] | 7 | 2018-08-30T14:15:46.000Z | 2021-01-17T11:36:31.000Z | from multiprocessing import Pool as ProcessPool
from multiprocessing.dummy import Pool as ThreadPool
from common import timed
NUM_WORKERS = 8 # four cores
def fib(n):
"""Calculate the n-th element of Fibonacci."""
a, b = 1, 1
while n > 1:
a, b = b, a + b
n -= 1
return a
timed(fib, ... | 19.461538 | 56 | 0.652174 | from multiprocessing import Pool as ProcessPool
from multiprocessing.dummy import Pool as ThreadPool
from common import timed
NUM_WORKERS = 8 # four cores
def fib(n):
"""Calculate the n-th element of Fibonacci."""
a, b = 1, 1
while n > 1:
a, b = b, a + b
n -= 1
return a
timed(fib, ... | 0 | 0 | 0 |
d43fc9c83b533a99e43014d20f51ebbccb9a7a56 | 9,606 | py | Python | photons/equipment/dmm_3458A.py | MSLNZ/pr-single-photons | b3f52d2a2a7cf5385d885f30ae9555e1e7d77ec2 | [
"MIT"
] | null | null | null | photons/equipment/dmm_3458A.py | MSLNZ/pr-single-photons | b3f52d2a2a7cf5385d885f30ae9555e1e7d77ec2 | [
"MIT"
] | null | null | null | photons/equipment/dmm_3458A.py | MSLNZ/pr-single-photons | b3f52d2a2a7cf5385d885f30ae9555e1e7d77ec2 | [
"MIT"
] | null | null | null | """
Communicate with a Keysight 3458A digital multimeter.
"""
from . import equipment
from .dmm import DMM
@equipment(manufacturer=r'Keysight', model=r'3458A')
| 35.577778 | 112 | 0.537268 | """
Communicate with a Keysight 3458A digital multimeter.
"""
from . import equipment
from .dmm import DMM
@equipment(manufacturer=r'Keysight', model=r'3458A')
class Keysight3458A(DMM):
FUNCTIONS = {
1: 'DCV',
'DCV': 'DCV',
'VOLT': 'DCV',
'VOLTAGE': 'DCV',
2: 'ACV',
... | 57 | 9,367 | 22 |
44a74a0c05f94ae4f08572537178a693c204eb52 | 1,511 | py | Python | NLPCode/sentiment_analysis/utils.py | trusthlt/dp-across-nlp-tasks | ec3e03511420044cdb0bb1a3574925d354ff03f4 | [
"Apache-2.0"
] | 1 | 2021-12-21T14:05:34.000Z | 2021-12-21T14:05:34.000Z | NLPCode/sentiment_analysis/utils.py | trusthlt/dp-across-nlp-tasks | ec3e03511420044cdb0bb1a3574925d354ff03f4 | [
"Apache-2.0"
] | null | null | null | NLPCode/sentiment_analysis/utils.py | trusthlt/dp-across-nlp-tasks | ec3e03511420044cdb0bb1a3574925d354ff03f4 | [
"Apache-2.0"
] | null | null | null | import time
import torch
from queue import Queue
import numpy as np
def binary_accuracy(preds, y):
"""
Returns accuracy per batch, i.e. if you get 8/10 right, this returns 0.8, NOT 8
"""
#round predictions to the closest integer
rounded_preds = torch.round(torch.sigmoid(preds))
correct = (roun... | 32.148936 | 99 | 0.627399 | import time
import torch
from queue import Queue
import numpy as np
def binary_accuracy(preds, y):
"""
Returns accuracy per batch, i.e. if you get 8/10 right, this returns 0.8, NOT 8
"""
#round predictions to the closest integer
rounded_preds = torch.round(torch.sigmoid(preds))
correct = (roun... | 977 | -1 | 103 |
bdf499f465a9db7bae8e722e09e73f0abd209a71 | 22,571 | py | Python | src/tallem/cover.py | peekxc/tallem | 949af20c1f50f9b6784ee32463e59123cd64294b | [
"Apache-2.0"
] | null | null | null | src/tallem/cover.py | peekxc/tallem | 949af20c1f50f9b6784ee32463e59123cd64294b | [
"Apache-2.0"
] | null | null | null | src/tallem/cover.py | peekxc/tallem | 949af20c1f50f9b6784ee32463e59123cd64294b | [
"Apache-2.0"
] | 1 | 2021-07-25T04:58:58.000Z | 2021-07-25T04:58:58.000Z | ## cover.py
import array
import numpy as np
import numpy.typing as npt
import scipy.sparse as sp
from numpy.typing import ArrayLike
from scipy.sparse import csc_matrix, diags
from scipy.sparse.csgraph import minimum_spanning_tree,connected_components
from .distance import *
from .distance import is_dist_like
from .uti... | 44.518738 | 183 | 0.691064 | ## cover.py
import array
import numpy as np
import numpy.typing as npt
import scipy.sparse as sp
from numpy.typing import ArrayLike
from scipy.sparse import csc_matrix, diags
from scipy.sparse.csgraph import minimum_spanning_tree,connected_components
from .distance import *
from .distance import is_dist_like
from .uti... | 10,741 | 4,265 | 912 |
f0a9230c0b486a3ffb8e1dc5c23d06f1d958b8a1 | 1,417 | py | Python | courses/machine_learning/deepdive2/production_ml/labs/samples/contrib/versioned-pipeline-ci-samples/mnist-ci-sample/train/mnist.py | memeyankm/training-data-analyst | 33bdca94cb063036f7313a2eaf6e515126d31344 | [
"Apache-2.0"
] | 6,140 | 2016-05-23T16:09:35.000Z | 2022-03-30T19:00:46.000Z | courses/machine_learning/deepdive2/production_ml/labs/samples/contrib/versioned-pipeline-ci-samples/mnist-ci-sample/train/mnist.py | memeyankm/training-data-analyst | 33bdca94cb063036f7313a2eaf6e515126d31344 | [
"Apache-2.0"
] | 7,331 | 2018-05-16T09:03:26.000Z | 2022-03-31T23:22:04.000Z | courses/machine_learning/deepdive2/production_ml/labs/samples/contrib/versioned-pipeline-ci-samples/mnist-ci-sample/train/mnist.py | memeyankm/training-data-analyst | 33bdca94cb063036f7313a2eaf6e515126d31344 | [
"Apache-2.0"
] | 5,110 | 2016-05-27T13:45:18.000Z | 2022-03-31T18:40:42.000Z |
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('--storage_bucket', type=str)
args = parser.parse_args()
mnisttrain(args.storage_bucket) | 34.560976 | 93 | 0.632322 | def mnisttrain(storage_bucket:str):
import tensorflow as tf
import json
mnist = tf.keras.datasets.mnist
(x_train,y_train), (x_test, y_test) = mnist.load_data()
x_train, x_test = x_train/255.0, x_test/255.0
def create_model():
return tf.keras.models.Sequential([
tf.keras.laye... | 1,186 | 0 | 22 |
b99dee293fb5186715b280f10880c3860abf90d4 | 669 | py | Python | CSIKit/legacy/receiver.py | FredeJ/CSIKit | 5ce1b114be3d8b24a05576e5345ef43c9e5cd136 | [
"MIT"
] | 67 | 2020-03-14T03:32:06.000Z | 2022-03-31T18:51:57.000Z | CSIKit/legacy/receiver.py | FredeJ/CSIKit | 5ce1b114be3d8b24a05576e5345ef43c9e5cd136 | [
"MIT"
] | 25 | 2020-09-23T16:43:58.000Z | 2022-03-30T13:20:16.000Z | CSIKit/legacy/receiver.py | FredeJ/CSIKit | 5ce1b114be3d8b24a05576e5345ef43c9e5cd136 | [
"MIT"
] | 18 | 2020-04-01T09:51:35.000Z | 2022-03-09T12:46:24.000Z | import sys
import time
import netlink
import numpy as np
import utils
from read_bfee import BeamformReader
from realtime_graph import RealtimeGraph
if __name__ == "__main__":
rxChains = "ABC"
#utils.configure_rx_chains(rxChains)
gType = "default"
if len(sys.argv) == 2:
gType = sys.argv[1]
... | 20.90625 | 52 | 0.653214 | import sys
import time
import netlink
import numpy as np
import utils
from read_bfee import BeamformReader
from realtime_graph import RealtimeGraph
if __name__ == "__main__":
rxChains = "ABC"
#utils.configure_rx_chains(rxChains)
gType = "default"
if len(sys.argv) == 2:
gType = sys.argv[1]
... | 0 | 0 | 0 |
ab96e27d1a1291539f8c5c2e960e914132af06dc | 35 | py | Python | 003/todo-app/main/todo/forms/__init__.py | akiracadet/django-projects-v1 | 35ab3b88ed9bb9fab7e3d32a8fb838fff6571937 | [
"MIT"
] | null | null | null | 003/todo-app/main/todo/forms/__init__.py | akiracadet/django-projects-v1 | 35ab3b88ed9bb9fab7e3d32a8fb838fff6571937 | [
"MIT"
] | 5 | 2021-03-30T14:07:08.000Z | 2021-09-22T19:28:43.000Z | 006/ui-design/main/todo/forms/__init__.py | akiracadet/django-projects-v1 | 35ab3b88ed9bb9fab7e3d32a8fb838fff6571937 | [
"MIT"
] | null | null | null | from .create import CreateTodoForm
| 17.5 | 34 | 0.857143 | from .create import CreateTodoForm
| 0 | 0 | 0 |
89ffa592791275d03aa24b9f7d75b99b9a140fa2 | 3,712 | py | Python | tests/monkey_patch.py | hz-lschick/mara-google-analytics-downloader | f9cbcc4ee25b026c10b2d6c3be371fad7e13c443 | [
"MIT"
] | null | null | null | tests/monkey_patch.py | hz-lschick/mara-google-analytics-downloader | f9cbcc4ee25b026c10b2d6c3be371fad7e13c443 | [
"MIT"
] | 1 | 2022-01-03T18:53:42.000Z | 2022-01-03T18:53:42.000Z | tests/monkey_patch.py | hz-lschick/mara-google-analytics-downloader | f9cbcc4ee25b026c10b2d6c3be371fad7e13c443 | [
"MIT"
] | 2 | 2021-07-14T18:14:35.000Z | 2022-03-03T14:26:42.000Z | """
Functions for monkey patching functions in other modules. See https://en.wikipedia.org/wiki/Monkey_patch
There are other excellent libraries for this, which unfortunately don't excactly match our use case:
- https://github.com/christophercrouzet/gorilla
- https://github.com/iki/monkeypatch
- https://github.com/thea... | 37.877551 | 119 | 0.708782 | """
Functions for monkey patching functions in other modules. See https://en.wikipedia.org/wiki/Monkey_patch
There are other excellent libraries for this, which unfortunately don't excactly match our use case:
- https://github.com/christophercrouzet/gorilla
- https://github.com/iki/monkeypatch
- https://github.com/thea... | 1,632 | 0 | 54 |
01d1e99b6ac3b7cc153ddc53fde2f0e24f85bd04 | 2,718 | py | Python | contrib/identifier_parser/dask_plugins.py | kubamahnert/panoramic-cli | 036f45a05d39f5762088ce23dbe367b938192f79 | [
"MIT"
] | 5 | 2020-11-13T17:26:59.000Z | 2021-03-19T15:11:26.000Z | contrib/identifier_parser/dask_plugins.py | kubamahnert/panoramic-cli | 036f45a05d39f5762088ce23dbe367b938192f79 | [
"MIT"
] | 5 | 2020-10-28T10:22:35.000Z | 2021-01-27T17:33:58.000Z | contrib/identifier_parser/dask_plugins.py | kubamahnert/panoramic-cli | 036f45a05d39f5762088ce23dbe367b938192f79 | [
"MIT"
] | 3 | 2021-01-26T07:58:03.000Z | 2021-03-11T13:28:34.000Z | import logging
from types import TracebackType
from typing import Optional, cast
from common.exception_enums import ExceptionGroup
from common.exception_handler import ExceptionHandler
from dask.utils import funcname
from distributed import Scheduler, Worker
from distributed.diagnostics.plugin import SchedulerPlugin, ... | 40.567164 | 110 | 0.627299 | import logging
from types import TracebackType
from typing import Optional, cast
from common.exception_enums import ExceptionGroup
from common.exception_handler import ExceptionHandler
from dask.utils import funcname
from distributed import Scheduler, Worker
from distributed.diagnostics.plugin import SchedulerPlugin, ... | 2,074 | 32 | 206 |
e6315b76f200ec6e1da49a8d9dd4d77018d55244 | 165 | py | Python | PIP/Hands-on Exercise 4/Q25.py | ankitrajbiswal/SEM_5 | db716e242e77149a4091e0e564356ddc724aeff0 | [
"Apache-2.0"
] | 10 | 2021-04-24T11:46:48.000Z | 2022-01-17T05:14:37.000Z | PIP/Hands-on Exercise 4/Q25.py | ankitrajbiswal/SEM_5 | db716e242e77149a4091e0e564356ddc724aeff0 | [
"Apache-2.0"
] | 2 | 2021-06-28T11:51:50.000Z | 2021-11-01T08:21:53.000Z | PIP/Hands-on Exercise 4/Q25.py | ankitrajbiswal/SEM_5 | db716e242e77149a4091e0e564356ddc724aeff0 | [
"Apache-2.0"
] | 16 | 2021-04-24T11:46:58.000Z | 2022-03-02T05:08:19.000Z | t=0
s=0
for i in range(1,500):
t=i
for j in range(1,t):
if(t%j==0):
s=s+j
if s==i:
print(s,end=" ")
s=0
t=0 | 15 | 25 | 0.357576 | t=0
s=0
for i in range(1,500):
t=i
for j in range(1,t):
if(t%j==0):
s=s+j
if s==i:
print(s,end=" ")
s=0
t=0 | 0 | 0 | 0 |
8b615de584f2c6fed3d13ce88c1b04d52ac16a83 | 817 | py | Python | dictators/dictators_game/migrations/0006_auto_20210720_0047.py | Kool-Kids-Klan/Dictators | c0f44d6933ec8fe128d3b9c8c638ba0e5914f10a | [
"MIT"
] | 2 | 2022-02-19T18:04:23.000Z | 2022-02-19T18:04:25.000Z | dictators/dictators_game/migrations/0006_auto_20210720_0047.py | xbaran4/Dictators | c0f44d6933ec8fe128d3b9c8c638ba0e5914f10a | [
"MIT"
] | 8 | 2021-07-16T07:28:35.000Z | 2021-07-21T07:35:29.000Z | dictators/dictators_game/migrations/0006_auto_20210720_0047.py | Kool-Kids-Klan/Dictators | c0f44d6933ec8fe128d3b9c8c638ba0e5914f10a | [
"MIT"
] | 1 | 2021-08-23T09:27:47.000Z | 2021-08-23T09:27:47.000Z | # Generated by Django 3.1.8 on 2021-07-20 00:47
import dictators.dictators_game.models
from django.db import migrations, models
| 27.233333 | 146 | 0.603427 | # Generated by Django 3.1.8 on 2021-07-20 00:47
import dictators.dictators_game.models
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dictators_game', '0005_game'),
]
operations = [
migrations.AlterField(
model_name='game',... | 0 | 664 | 23 |
7a02f37952d13a5a8582202115829afc41a6cd5c | 3,895 | py | Python | wagtail_review/wagtail_hooks.py | icanbwell/wagtail-review | 4695f59c9feb94974ceb4a1b03ce8fd836e0ea3e | [
"BSD-3-Clause"
] | 44 | 2018-12-17T16:37:16.000Z | 2022-03-06T15:09:23.000Z | wagtail_review/wagtail_hooks.py | icanbwell/wagtail-review | 4695f59c9feb94974ceb4a1b03ce8fd836e0ea3e | [
"BSD-3-Clause"
] | 33 | 2019-01-07T18:03:14.000Z | 2021-12-15T08:46:57.000Z | wagtail_review/wagtail_hooks.py | icanbwell/wagtail-review | 4695f59c9feb94974ceb4a1b03ce8fd836e0ea3e | [
"BSD-3-Clause"
] | 19 | 2019-01-08T14:08:15.000Z | 2021-10-19T03:16:30.000Z | from django.conf.urls import include, url
from django.contrib import messages as django_messages
from django.templatetags.static import static
from django.shortcuts import redirect
from django.urls import reverse
from django.utils.html import format_html
from django.utils.translation import ugettext_lazy as _
import s... | 34.469027 | 107 | 0.715533 | from django.conf.urls import include, url
from django.contrib import messages as django_messages
from django.templatetags.static import static
from django.shortcuts import redirect
from django.urls import reverse
from django.utils.html import format_html
from django.utils.translation import ugettext_lazy as _
import s... | 2,197 | 508 | 161 |
a84d632a470b0b1bb4fb1a96258c446bdd8ff591 | 10,187 | py | Python | numpy/core/code_generators/genapi.py | efiring/numpy-work | f873f11f3b96ff859debdc91a2c172a6b476f7db | [
"BSD-3-Clause"
] | 1 | 2016-11-11T17:55:13.000Z | 2016-11-11T17:55:13.000Z | numpy/core/code_generators/genapi.py | efiring/numpy-work | f873f11f3b96ff859debdc91a2c172a6b476f7db | [
"BSD-3-Clause"
] | null | null | null | numpy/core/code_generators/genapi.py | efiring/numpy-work | f873f11f3b96ff859debdc91a2c172a6b476f7db | [
"BSD-3-Clause"
] | null | null | null | """
Get API information encoded in C files.
See ``find_function`` for how functions should be formatted, and
``read_order`` for how the order of the functions should be
specified.
"""
import sys, os, re
import md5
import textwrap
from os.path import join
__docformat__ = 'restructuredtext'
# The files under src/ tha... | 32.237342 | 80 | 0.522038 | """
Get API information encoded in C files.
See ``find_function`` for how functions should be formatted, and
``read_order`` for how the order of the functions should be
specified.
"""
import sys, os, re
import md5
import textwrap
from os.path import join
__docformat__ = 'restructuredtext'
# The files under src/ tha... | 4,056 | 9 | 444 |
c016685adf742253aeb88b9fd65776998eb06c95 | 12,791 | py | Python | src/orion/algo/robo/base.py | lebrice/orion.algo.robo | f7e14e305619344ed9afd303fecbfcabda6ae7ce | [
"BSD-3-Clause"
] | null | null | null | src/orion/algo/robo/base.py | lebrice/orion.algo.robo | f7e14e305619344ed9afd303fecbfcabda6ae7ce | [
"BSD-3-Clause"
] | null | null | null | src/orion/algo/robo/base.py | lebrice/orion.algo.robo | f7e14e305619344ed9afd303fecbfcabda6ae7ce | [
"BSD-3-Clause"
] | 2 | 2020-09-28T15:18:19.000Z | 2021-06-29T20:27:18.000Z | """
Base class for RoBO algorithms.
"""
import george
import numpy
from orion.algo.base import BaseAlgorithm
from robo.acquisition_functions.ei import EI
from robo.acquisition_functions.lcb import LCB
from robo.acquisition_functions.log_ei import LogEI
from robo.acquisition_functions.pi import PI
from robo.initial_desi... | 29.955504 | 91 | 0.611133 | """
Base class for RoBO algorithms.
"""
import george
import numpy
from orion.algo.base import BaseAlgorithm
from robo.acquisition_functions.ei import EI
from robo.acquisition_functions.lcb import LCB
from robo.acquisition_functions.log_ei import LogEI
from robo.acquisition_functions.pi import PI
from robo.initial_desi... | 2,349 | 0 | 108 |
60875a7ab9432f3fb7e0e5ed2b1ffc35e3536e4e | 126 | py | Python | development/david.py | DavidVujic/python-polylith-example | d19ca8a4142d34399a1c0f98a7d0e9b1c9becf8e | [
"MIT"
] | null | null | null | development/david.py | DavidVujic/python-polylith-example | d19ca8a4142d34399a1c0f98a7d0e9b1c9becf8e | [
"MIT"
] | null | null | null | development/david.py | DavidVujic/python-polylith-example | d19ca8a4142d34399a1c0f98a7d0e9b1c9becf8e | [
"MIT"
] | null | null | null | from demo.my_logger import getLogger
testing()
| 11.454545 | 36 | 0.674603 | from demo.my_logger import getLogger
def testing():
logger = getLogger("david")
logger.info("HEJHEJ!")
testing()
| 53 | 0 | 23 |
ae07b9be27f24bc21e06d632105e57a3cedd1669 | 6,204 | py | Python | utils.py | ThoroughImages/EasySparse | ebed5ee3c104523d35ccb62795b3b78b8df51d65 | [
"MIT"
] | 5 | 2019-04-24T01:42:42.000Z | 2020-07-28T16:04:10.000Z | utils.py | FinBrain/EasySparse | ebed5ee3c104523d35ccb62795b3b78b8df51d65 | [
"MIT"
] | null | null | null | utils.py | FinBrain/EasySparse | ebed5ee3c104523d35ccb62795b3b78b8df51d65 | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
def read_and_decode_batch(filename_queue, batch_size, capacity, min_after_dequeue):
"""Dequeue a batch of data from the TFRecord.
Args:
filename_queue: Filename Queue of the TFRecord.
batch_size: How many records dequeued each time.
capacity: The... | 36.710059 | 109 | 0.590909 | import tensorflow as tf
import numpy as np
def read_and_decode_batch(filename_queue, batch_size, capacity, min_after_dequeue):
"""Dequeue a batch of data from the TFRecord.
Args:
filename_queue: Filename Queue of the TFRecord.
batch_size: How many records dequeued each time.
capacity: The... | 175 | 0 | 50 |
36011f50763e2763762534e112d2a7cea6f3af2e | 65 | py | Python | experiments/archived/20210203/bag_model/models/__init__.py | fxnnxc/text_summarization | b8c8a5f491bc44622203602941c1514b2e006fe3 | [
"Apache-2.0"
] | 5 | 2020-10-14T02:30:44.000Z | 2021-05-06T12:48:28.000Z | experiments/archived/20210119/bag_model/models/__init__.py | fxnnxc/text_summarization | b8c8a5f491bc44622203602941c1514b2e006fe3 | [
"Apache-2.0"
] | 2 | 2020-12-19T05:59:31.000Z | 2020-12-22T11:05:31.000Z | experiments/archived/20210203/bag_model/models/__init__.py | fxnnxc/text_summarization | b8c8a5f491bc44622203602941c1514b2e006fe3 | [
"Apache-2.0"
] | null | null | null | from .hub_interface import * # noqa
from .model import * # noqa | 32.5 | 36 | 0.707692 | from .hub_interface import * # noqa
from .model import * # noqa | 0 | 0 | 0 |
78de2bb04fd0bb82e0b51f7cfae48adaa0e1cdbc | 6,329 | py | Python | boto/ec2/volumestatus.py | Yurzs/boto | d739d6c52877699206e69b9901bbe92ea437ba5d | [
"MIT"
] | 5,079 | 2015-01-01T03:39:46.000Z | 2022-03-31T07:38:22.000Z | boto/ec2/volumestatus.py | Yurzs/boto | d739d6c52877699206e69b9901bbe92ea437ba5d | [
"MIT"
] | 4,640 | 2015-07-08T16:19:08.000Z | 2019-12-02T15:01:27.000Z | boto/ec2/volumestatus.py | Yurzs/boto | d739d6c52877699206e69b9901bbe92ea437ba5d | [
"MIT"
] | 2,033 | 2015-01-04T07:18:02.000Z | 2022-03-28T19:55:47.000Z | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without... | 30.723301 | 74 | 0.625375 | # Copyright (c) 2012 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2012 Amazon.com, Inc. or its affiliates.
# All Rights Reserved
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without... | 2,963 | 1 | 559 |
e0b51eea3c755704b2a8e38b26d3139be520bd74 | 8,135 | py | Python | youtube_dl_gui/utils.py | goYou/youtube-dl-gui | d5dc0c8b531215540bfe068f463d995c63260c19 | [
"Unlicense"
] | 24 | 2021-04-15T04:24:37.000Z | 2022-03-26T06:10:46.000Z | youtube_dl_gui/utils.py | goYou/youtube-dl-gui | d5dc0c8b531215540bfe068f463d995c63260c19 | [
"Unlicense"
] | 3 | 2021-05-06T16:40:12.000Z | 2022-03-24T17:22:39.000Z | youtube_dl_gui/utils.py | goYou/youtube-dl-gui | d5dc0c8b531215540bfe068f463d995c63260c19 | [
"Unlicense"
] | 2 | 2022-01-27T15:43:51.000Z | 2022-02-06T02:31:09.000Z | # type: ignore[misc]
"""yt-dlg module that contains util functions.
Attributes:
YOUTUBEDL_BIN (string): Youtube-dl binary filename.
"""
from __future__ import annotations
import locale
import math
import os
import subprocess
import sys
from pathlib import Path
from .info import __appname__
IS_WINDOWS = os.nam... | 23.99705 | 81 | 0.629256 | # type: ignore[misc]
"""yt-dlg module that contains util functions.
Attributes:
YOUTUBEDL_BIN (string): Youtube-dl binary filename.
"""
from __future__ import annotations
import locale
import math
import os
import subprocess
import sys
from pathlib import Path
from .info import __appname__
IS_WINDOWS = os.nam... | 412 | 0 | 69 |
99f0e29f55e9574e2f2dc01af3bb4b0d10cebdf9 | 8,856 | py | Python | service/resources/permit_list.py | SFDigitalServices/ooc-permit-list-sd-mspy | e3403db304a4eae380a8f45bcd433bd656bee65f | [
"MIT"
] | null | null | null | service/resources/permit_list.py | SFDigitalServices/ooc-permit-list-sd-mspy | e3403db304a4eae380a8f45bcd433bd656bee65f | [
"MIT"
] | 2 | 2019-08-16T17:34:00.000Z | 2021-06-02T00:07:36.000Z | service/resources/permit_list.py | SFDigitalServices/ooc-permit-list-sd-mspy | e3403db304a4eae380a8f45bcd433bd656bee65f | [
"MIT"
] | null | null | null | """Permit List module"""
import json
import falcon
import jsend
import sentry_sdk
from screendoor_sdk.screendoor import Screendoor
class PermitList():
"""Permit List class"""
scrndr = None
scrndr_proj_id = None
logger_name = ''
referred_label_map = {
'MOD - Referred' : "Mayor's Office of D... | 44.502513 | 343 | 0.538053 | """Permit List module"""
import json
import falcon
import jsend
import sentry_sdk
from screendoor_sdk.screendoor import Screendoor
class PermitList():
"""Permit List class"""
scrndr = None
scrndr_proj_id = None
logger_name = ''
referred_label_map = {
'MOD - Referred' : "Mayor's Office of D... | 57 | 0 | 27 |
aeccec51ce147ccf60b6047c894a4032ca91cbdb | 2,651 | py | Python | redstone/crn.py | thu2thu2/redstone | 5f3722cefb19ac336486018454d8bf813e8add0e | [
"Apache-2.0"
] | 2 | 2021-02-25T19:33:50.000Z | 2022-02-14T23:53:10.000Z | redstone/crn.py | thu2thu2/redstone | 5f3722cefb19ac336486018454d8bf813e8add0e | [
"Apache-2.0"
] | 10 | 2020-10-22T21:13:08.000Z | 2021-05-24T15:28:15.000Z | redstone/crn.py | thu2thu2/redstone | 5f3722cefb19ac336486018454d8bf813e8add0e | [
"Apache-2.0"
] | 2 | 2020-10-21T16:00:51.000Z | 2021-05-24T17:14:37.000Z | # Copyright 2020 Mathew Odden <mathewrodden@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 30.825581 | 263 | 0.669559 | # Copyright 2020 Mathew Odden <mathewrodden@gmail.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law... | 910 | -3 | 126 |
facf943b77bf19acfab5457d23501bd9c20827df | 481 | py | Python | importers/unsdg_indicator.py | codeforIATI/codelist-updater | 624b685756f50444df5eb1af5e6f74f139c8fb46 | [
"MIT"
] | 1 | 2019-11-09T12:43:29.000Z | 2019-11-09T12:43:29.000Z | importers/unsdg_indicator.py | codeforIATI/IATI-Codelists-NonEmbedded-updater | 725a83df8467212c807db3ec3d3e3cd885aa00e4 | [
"MIT"
] | 36 | 2019-11-11T09:41:14.000Z | 2022-03-19T23:12:42.000Z | importers/unsdg_indicator.py | codeforIATI/codelist-updater | 624b685756f50444df5eb1af5e6f74f139c8fb46 | [
"MIT"
] | null | null | null | from .helpers import Importer
if __name__ == '__main__':
run()
| 26.722222 | 176 | 0.636175 | from .helpers import Importer
def run():
url = 'https://docs.google.com/spreadsheets/d/1o1SQDqfFTBgUJO2k83mfFlLtgpwUUkEbc3gjRgIWJSo/export?format=csv&id=1o1SQDqfFTBgUJO2k83mfFlLtgpwUUkEbc3gjRgIWJSo&gid=1990382168'
lookup = [
('code', 'code'),
('name_en', 'name_en'),
('name_fr', 'name_f... | 388 | 0 | 23 |
3950e505818cfeddf61cc510b3f67cc360b10d0b | 1,756 | py | Python | __init__.py | portify/io_mesh_ter | 6c3fcaba493d09d9e9df8590644b3c61042d2cab | [
"MIT"
] | 1 | 2018-12-15T20:06:09.000Z | 2018-12-15T20:06:09.000Z | __init__.py | portify/io_mesh_ter | 6c3fcaba493d09d9e9df8590644b3c61042d2cab | [
"MIT"
] | null | null | null | __init__.py | portify/io_mesh_ter | 6c3fcaba493d09d9e9df8590644b3c61042d2cab | [
"MIT"
] | 2 | 2017-07-15T15:19:08.000Z | 2019-05-14T05:59:12.000Z | bl_info = {
"name": "Torque Terrain (TER) format",
"author": "port",
"version": (0, 0, 1),
"blender": (2, 76, 0),
"location": "File > Import > Torque Terrain",
"description": "Import Torque Terrain (TER) files",
"warning": "",
"support": "COMMUNITY",
"category": "Import-Export"
}
if... | 24.388889 | 75 | 0.606492 | bl_info = {
"name": "Torque Terrain (TER) format",
"author": "port",
"version": (0, 0, 1),
"blender": (2, 76, 0),
"location": "File > Import > Torque Terrain",
"description": "Import Torque Terrain (TER) files",
"warning": "",
"support": "COMMUNITY",
"category": "Import-Export"
}
if... | 489 | 266 | 92 |
580323e6bf604736f290f79f37999030d1319db0 | 4,988 | py | Python | pbtranscript/io/FastaSplitter.py | ylipacbio/pbtranscript | 6b4ef164f191ffd4201feb62b951d9eeac3315b6 | [
"BSD-3-Clause"
] | null | null | null | pbtranscript/io/FastaSplitter.py | ylipacbio/pbtranscript | 6b4ef164f191ffd4201feb62b951d9eeac3315b6 | [
"BSD-3-Clause"
] | null | null | null | pbtranscript/io/FastaSplitter.py | ylipacbio/pbtranscript | 6b4ef164f191ffd4201feb62b951d9eeac3315b6 | [
"BSD-3-Clause"
] | 1 | 2021-02-26T10:08:09.000Z | 2021-02-26T10:08:09.000Z | #!/usr/bin/env python
"""Define Class `FastaSplitter` which splits a fasta file into
smaller files each containing `reads_per_split` reads."""
import os
import os.path as op
import sys
from pbcore.io import FastaWriter
from pbtranscript.Utils import mkdir
from pbtranscript.io.ContigSetReaderWrapper import ContigSetR... | 38.076336 | 93 | 0.606255 | #!/usr/bin/env python
"""Define Class `FastaSplitter` which splits a fasta file into
smaller files each containing `reads_per_split` reads."""
import os
import os.path as op
import sys
from pbcore.io import FastaWriter
from pbtranscript.Utils import mkdir
from pbtranscript.io.ContigSetReaderWrapper import ContigSetR... | 853 | 0 | 54 |
6cba07bae1c733641e0fe0a6cd315a4aea0eb15b | 774 | py | Python | example/rpmd/analyze.py | AkihideHayashi/torchfes1 | 83f01525e6071ffd7a884c8e108f9c25ba2b009b | [
"MIT"
] | null | null | null | example/rpmd/analyze.py | AkihideHayashi/torchfes1 | 83f01525e6071ffd7a884c8e108f9c25ba2b009b | [
"MIT"
] | null | null | null | example/rpmd/analyze.py | AkihideHayashi/torchfes1 | 83f01525e6071ffd7a884c8e108f9c25ba2b009b | [
"MIT"
] | null | null | null | import torch
import numpy as np
import pickle
import matplotlib.pyplot as plt
n_ring = 16
hbar = 1.0
k = 1.0
kbt = 0.1
beta = 10.0
with open('tmp.pkl', 'rb') as f:
pos, pot, kin = pickle.load(f)
pot = torch.stack(pot).mean()
kin = torch.stack(kin).mean()
print(pot + kin)
pos = torch.stack(pos).flatten()
hist,... | 19.846154 | 57 | 0.583979 | import torch
import numpy as np
import pickle
import matplotlib.pyplot as plt
n_ring = 16
hbar = 1.0
k = 1.0
kbt = 0.1
beta = 10.0
def gound(x, hbar, m, k):
# print(hbar, m, k)
omega = torch.sqrt(k / m)
xi = torch.sqrt(m * omega / hbar) * x
return torch.exp(-0.5 * xi * xi)
with open('tmp.pkl', 'rb'... | 137 | 0 | 23 |
9556fd0ecb62d8cbcf36342a6281e2a448d8ddf9 | 290 | py | Python | app/src/utils/exceptions/wrapper_exceptions.py | DIS-SIN/Survista | 853a6e921dce2ca94521eaa8a202a571d9ea8940 | [
"CC0-1.0"
] | 3 | 2019-02-21T20:11:11.000Z | 2019-07-14T19:48:25.000Z | app/src/utils/exceptions/wrapper_exceptions.py | DIS-SIN/Survista | 853a6e921dce2ca94521eaa8a202a571d9ea8940 | [
"CC0-1.0"
] | 8 | 2019-03-21T18:04:41.000Z | 2019-03-21T23:56:51.000Z | app/src/utils/exceptions/wrapper_exceptions.py | DIS-SIN/Survista | 853a6e921dce2ca94521eaa8a202a571d9ea8940 | [
"CC0-1.0"
] | 1 | 2019-01-23T07:13:24.000Z | 2019-01-23T07:13:24.000Z |
class NoCurrentVersionFound(KeyError):
"""
No version node of the a particular parent node could be found
"""
pass
class VersionDoesNotBelongToNode(AssertionError):
"""
The version that is trying to be attached does not belong to the parent node
"""
pass
| 20.714286 | 80 | 0.689655 |
class NoCurrentVersionFound(KeyError):
"""
No version node of the a particular parent node could be found
"""
pass
class VersionDoesNotBelongToNode(AssertionError):
"""
The version that is trying to be attached does not belong to the parent node
"""
pass
| 0 | 0 | 0 |
8b319fd9994d7accfa73ed62a9b79229a5d7de9c | 1,858 | py | Python | dataUtils/jupyter_notebook_header.py | jrwrigh/msResearchTools | bd380d01ed2089f21f422842d33b1fe03185341f | [
"MIT"
] | null | null | null | dataUtils/jupyter_notebook_header.py | jrwrigh/msResearchTools | bd380d01ed2089f21f422842d33b1fe03185341f | [
"MIT"
] | null | null | null | dataUtils/jupyter_notebook_header.py | jrwrigh/msResearchTools | bd380d01ed2089f21f422842d33b1fe03185341f | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import matplotlib as mpl
import pandas as pd
from pathlib import Path
import re
filename = Path('courantnumber_max-rfile.out')
mpl.rcParams['font.family'] = 'serif'
mpl.rcParams['font.serif'] = 'Computer Modern'
mpl.rcParams['font.size'] = 18
mpl.rcParams['mathtext.fontset'] = 'cm'
mpl... | 31.491525 | 70 | 0.656082 | import matplotlib.pyplot as plt
import matplotlib as mpl
import pandas as pd
from pathlib import Path
import re
filename = Path('courantnumber_max-rfile.out')
mpl.rcParams['font.family'] = 'serif'
mpl.rcParams['font.serif'] = 'Computer Modern'
mpl.rcParams['font.size'] = 18
mpl.rcParams['mathtext.fontset'] = 'cm'
mpl... | 671 | 0 | 23 |
291b6346e5bbb09f384baa1936458310443c3995 | 4,495 | py | Python | djangosige/apps/cadastro/forms/inline_formsets.py | MateusMolina/lunoERP | 0880adb93b3a2d3169c6780efa60a229272f927a | [
"MIT"
] | null | null | null | djangosige/apps/cadastro/forms/inline_formsets.py | MateusMolina/lunoERP | 0880adb93b3a2d3169c6780efa60a229272f927a | [
"MIT"
] | null | null | null | djangosige/apps/cadastro/forms/inline_formsets.py | MateusMolina/lunoERP | 0880adb93b3a2d3169c6780efa60a229272f927a | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from django import forms
from django.forms import inlineformset_factory
from django.utils.translation import ugettext_lazy as _
from djangosige.apps.cadastro.models import Pessoa, Endereco, Telefone, Email, Site, Banco, Documento
EnderecoFormSet = inlineformset_factory(
... | 34.05303 | 102 | 0.540378 | # -*- coding: utf-8 -*-
from django import forms
from django.forms import inlineformset_factory
from django.utils.translation import ugettext_lazy as _
from djangosige.apps.cadastro.models import Pessoa, Endereco, Telefone, Email, Site, Banco, Documento
class EnderecoForm(forms.ModelForm):
class Met... | 0 | 3,445 | 150 |
b52ea370fd0cde05b0b769d9e95b919ab16e556f | 959 | py | Python | dmengine/reporting/common.py | xflr6/dmengine | dccae3e404f31c9ecf4f74fa3616c71d47f01f93 | [
"MIT"
] | 2 | 2019-05-23T02:21:17.000Z | 2019-08-13T15:49:27.000Z | dmengine/reporting/common.py | xflr6/dmengine | dccae3e404f31c9ecf4f74fa3616c71d47f01f93 | [
"MIT"
] | null | null | null | dmengine/reporting/common.py | xflr6/dmengine | dccae3e404f31c9ecf4f74fa3616c71d47f01f93 | [
"MIT"
] | 3 | 2015-12-06T22:23:33.000Z | 2020-11-01T17:23:39.000Z | # common.py
TRANSLATE = [('->', '$\\rightarrow$'),
('...', '\\dots '),
('[', '$[$'),
(']', '$]$'),
('_', '\\_')]
| 29.96875 | 79 | 0.505735 | # common.py
TRANSLATE = [('->', '$\\rightarrow$'),
('...', '\\dots '),
('[', '$[$'),
(']', '$]$'),
('_', '\\_')]
def translate(string):
for old, new in TRANSLATE:
string = string.replace(old, new)
return string
def tabular(table, *, row_headings=T... | 745 | 0 | 46 |
f4e9207c57d04de1d95ebf97163f8eb8bb61cf66 | 1,496 | py | Python | src/data.py | maxscheijen/rt-live-netherlands | 1c3323c7a1a850d620882355a13e6123025d6de5 | [
"MIT"
] | null | null | null | src/data.py | maxscheijen/rt-live-netherlands | 1c3323c7a1a850d620882355a13e6123025d6de5 | [
"MIT"
] | 1 | 2021-01-06T00:56:37.000Z | 2021-01-06T00:56:37.000Z | src/data.py | maxscheijen/rt-live-netherlands | 1c3323c7a1a850d620882355a13e6123025d6de5 | [
"MIT"
] | null | null | null | import warnings
import numpy as np
import pandas as pd
warnings.filterwarnings("ignore")
url = "https://data.rivm.nl/covid-19/COVID-19_aantallen_gemeente_per_dag.csv"
def get_data(url: str = url) -> pd.DataFrame:
"""
Get data from url
url: url to csv
"""
return pd.read_csv(url, sep=";", parse_... | 23.015385 | 86 | 0.652406 | import warnings
import numpy as np
import pandas as pd
warnings.filterwarnings("ignore")
url = "https://data.rivm.nl/covid-19/COVID-19_aantallen_gemeente_per_dag.csv"
def get_data(url: str = url) -> pd.DataFrame:
"""
Get data from url
url: url to csv
"""
return pd.read_csv(url, sep=";", parse_... | 0 | 0 | 0 |
062cf30fbf3012c06d14464f3439139f3da0964b | 1,256 | py | Python | ecommerce/DashboardManagement/context_processor.py | AwaleRohin/commerce-fm | cb5b43c999ae5be37957b29de9c07d5affc66fb0 | [
"MIT"
] | 18 | 2020-12-05T14:12:32.000Z | 2022-03-11T20:15:22.000Z | ecommerce/DashboardManagement/context_processor.py | AwaleRohin/commerce-fm | cb5b43c999ae5be37957b29de9c07d5affc66fb0 | [
"MIT"
] | 1 | 2021-07-22T09:23:13.000Z | 2021-07-22T09:23:13.000Z | ecommerce/DashboardManagement/context_processor.py | shakyasaijal/commerce-fm | 358b6925f4b569dc374010d7cc7d4d560ede2b48 | [
"MIT"
] | 13 | 2020-10-15T10:17:35.000Z | 2022-01-29T06:56:24.000Z | from django.conf import settings
from DashboardManagement.common import helper
from Referral import models as refer_models
| 34.888889 | 84 | 0.598726 | from django.conf import settings
from DashboardManagement.common import helper
from Referral import models as refer_models
def context_processor(request):
context = {}
try:
if request.user.is_authenticated:
user_permissions = helper.permission_of_current_user(request.user)
con... | 1,108 | 0 | 23 |
e95ee5f693fc0ff9904dadbbc49431f8d871ef47 | 891 | py | Python | text/11111111/symbols.py | zhangbo2008/fastSpeeck2_chinese_train | ae24c9a3ba40c731dd17a94ea258cf89c8eab8f5 | [
"MIT"
] | 1 | 2021-07-23T15:38:37.000Z | 2021-07-23T15:38:37.000Z | text/11111111/symbols.py | zhangbo2008/fastSpeeck2_chinese_train | ae24c9a3ba40c731dd17a94ea258cf89c8eab8f5 | [
"MIT"
] | null | null | null | text/11111111/symbols.py | zhangbo2008/fastSpeeck2_chinese_train | ae24c9a3ba40c731dd17a94ea258cf89c8eab8f5 | [
"MIT"
] | 2 | 2021-07-23T15:40:28.000Z | 2021-12-13T13:52:46.000Z | """ from https://github.com/keithito/tacotron """
print(1)
from text import cmudict, pinyin
_pad = "_"
_punctuation = "!'(),.:;? "
_special = "-"
_letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
_silences = ["@sp", "@spn", "@sil"]
# Prepend "@" to ARPAbet symbols to ensure uniqueness (some are the ... | 21.731707 | 95 | 0.638608 | """ from https://github.com/keithito/tacotron """
print(1)
from text import cmudict, pinyin
_pad = "_"
_punctuation = "!'(),.:;? "
_special = "-"
_letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
_silences = ["@sp", "@spn", "@sil"]
# Prepend "@" to ARPAbet symbols to ensure uniqueness (some are the ... | 0 | 0 | 0 |
909abaee6d8fb908855b1385a303f328807626ab | 2,194 | py | Python | cog_genesis.py | q1qgames/pixray | 8bd73869af7979068aa7ff8402f5b3ab2b791255 | [
"MIT"
] | 468 | 2021-11-23T08:05:15.000Z | 2022-03-30T13:16:43.000Z | cog_genesis.py | q1qgames/pixray | 8bd73869af7979068aa7ff8402f5b3ab2b791255 | [
"MIT"
] | 53 | 2021-11-26T22:46:36.000Z | 2022-03-28T16:47:02.000Z | cog_genesis.py | q1qgames/pixray | 8bd73869af7979068aa7ff8402f5b3ab2b791255 | [
"MIT"
] | 67 | 2021-11-24T11:34:05.000Z | 2022-03-28T15:17:45.000Z | import cog
from pathlib import Path
import torch
import pixray
import yaml
import pathlib
import os
import yaml
from cogrun import create_temporary_copy
| 37.186441 | 111 | 0.635825 | import cog
from pathlib import Path
import torch
import pixray
import yaml
import pathlib
import os
import yaml
from cogrun import create_temporary_copy
class GenesisPredictor(cog.Predictor):
def setup(self):
print("---> GenesisPredictor Setup")
# Define the input types for a prediction
@cog.inpu... | 40 | 1,977 | 23 |
71ba4a437f7c68dd4fcaa82ee93259a6ea9b5a40 | 782 | py | Python | src/pylero/build_test_results.py | yuxisun1217/pylero | 0210eb2243e02ab218f19a224e94eb63081f13e3 | [
"MIT"
] | null | null | null | src/pylero/build_test_results.py | yuxisun1217/pylero | 0210eb2243e02ab218f19a224e94eb63081f13e3 | [
"MIT"
] | null | null | null | src/pylero/build_test_results.py | yuxisun1217/pylero | 0210eb2243e02ab218f19a224e94eb63081f13e3 | [
"MIT"
] | null | null | null | # -*- coding: utf8 -*-
from __future__ import absolute_import, division, print_function
from __future__ import unicode_literals
from pylero.base_polarion import BasePolarion
class BuildTestResults(BasePolarion):
"""Object to handle the Polarion WSDL tns2:BuildTestResults class
Attributes:
error_count... | 32.583333 | 69 | 0.624041 | # -*- coding: utf8 -*-
from __future__ import absolute_import, division, print_function
from __future__ import unicode_literals
from pylero.base_polarion import BasePolarion
class BuildTestResults(BasePolarion):
"""Object to handle the Polarion WSDL tns2:BuildTestResults class
Attributes:
error_count... | 0 | 0 | 0 |
a45285d3b79448bb97c7ee717d4fafd499859f73 | 439 | py | Python | api/beershops/migrations/0005_beershopreview_score.py | min1995/CSW-capstone-team-1 | b17ced9f55ea85eebf3df510dfc747d75bff0a19 | [
"MIT"
] | null | null | null | api/beershops/migrations/0005_beershopreview_score.py | min1995/CSW-capstone-team-1 | b17ced9f55ea85eebf3df510dfc747d75bff0a19 | [
"MIT"
] | null | null | null | api/beershops/migrations/0005_beershopreview_score.py | min1995/CSW-capstone-team-1 | b17ced9f55ea85eebf3df510dfc747d75bff0a19 | [
"MIT"
] | 2 | 2020-04-13T11:24:51.000Z | 2020-04-13T11:24:51.000Z | # Generated by Django 2.1.2 on 2018-12-09 05:48
from django.db import migrations, models
| 23.105263 | 99 | 0.571754 | # Generated by Django 2.1.2 on 2018-12-09 05:48
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('beershops', '0004_stamp_is_active'),
]
operations = [
migrations.AddField(
model_name='beershopreview',
name='score'... | 0 | 325 | 23 |
26f3dfa8fe650cbb4e860ce2348b4e38337ed786 | 525 | py | Python | Neural Network/SoftMax.py | CodingWillow/MachineLearning | 340c9d91d4178a2ab56921502bdcee73864a1a59 | [
"CC0-1.0"
] | null | null | null | Neural Network/SoftMax.py | CodingWillow/MachineLearning | 340c9d91d4178a2ab56921502bdcee73864a1a59 | [
"CC0-1.0"
] | null | null | null | Neural Network/SoftMax.py | CodingWillow/MachineLearning | 340c9d91d4178a2ab56921502bdcee73864a1a59 | [
"CC0-1.0"
] | null | null | null | import numpy as np
import math
iris = [1.43, -0.4, 0.23]
softmax(iris, 3)
# array([0.684, 0.11 , 0.206])
| 21.875 | 48 | 0.678095 | import numpy as np
import math
iris = [1.43, -0.4, 0.23]
def softmax(arr, decimal_place=None):
# Calculate the softmaxed output
softmax_vals = []
denominator = sum(np.exp(iris))
# Get the softmax value of every input
for i in range(0, len(arr)):
softmaxed = np.exp(arr[i]) / denominator
softmax_val... | 393 | 0 | 23 |
095a35498cea5883f1faf8eca598115418cd75a2 | 2,192 | py | Python | utils/training_helpers.py | kreshuklab/RLForSeg | dd8ed6d3eca6d27b4b96037aeebaeb5ea1598717 | [
"MIT"
] | null | null | null | utils/training_helpers.py | kreshuklab/RLForSeg | dd8ed6d3eca6d27b4b96037aeebaeb5ea1598717 | [
"MIT"
] | null | null | null | utils/training_helpers.py | kreshuklab/RLForSeg | dd8ed6d3eca6d27b4b96037aeebaeb5ea1598717 | [
"MIT"
] | null | null | null | import torch
from elf.segmentation.features import compute_rag
| 37.793103 | 117 | 0.611314 | import torch
from elf.segmentation.features import compute_rag
def update_env_data(env, data_iter, data_set, device, with_gt_edges=False, fe_grad=False):
raw, gt, sp_seg, indices = next(data_iter)
rags = [compute_rag(sseg.numpy()) for sseg in sp_seg]
raw, gt, sp_seg = raw.to(device), gt.to(device), sp_seg... | 1,984 | -3 | 145 |
fc1a33d66a31816b5aa2de30603c924b83006d17 | 1,373 | py | Python | annotation.py | Agrajak/simple_face_annotation | b5ef75834fbeaa80459c8861779e80e7a1620da6 | [
"Unlicense"
] | null | null | null | annotation.py | Agrajak/simple_face_annotation | b5ef75834fbeaa80459c8861779e80e7a1620da6 | [
"Unlicense"
] | null | null | null | annotation.py | Agrajak/simple_face_annotation | b5ef75834fbeaa80459c8861779e80e7a1620da6 | [
"Unlicense"
] | null | null | null | #-*- coding: utf-8 -*-
import os.path as p
import os
import cv2 as cv
import numpy as np
if __name__ == '__main__':
global startNum, name
load_images()
print('[increasing number]_[x]_[y]_[width]_[height]_[name].jpg will be annoated in file name!')
name = input('Name?')
startNum = int(input('Number? (1 is r... | 26.921569 | 97 | 0.642389 | #-*- coding: utf-8 -*-
import os.path as p
import os
import cv2 as cv
import numpy as np
def load_images():
global imageList, input_dir, output_dir
imageList = []
input_dir = p.normpath(os.getcwd()+'/input')
if p.isdir(input_dir) == False:
print(input_dir, 'is not directory!')
exit(1)
for f in os.lis... | 813 | 0 | 45 |
e4f8d3e20a73676f005b7597411885a55cee9cee | 442 | py | Python | investments/ticker.py | FlameFactory/investments | 007ff952ced3d5dfe94652b11345f3d69e4c2438 | [
"MIT"
] | 78 | 2020-04-05T18:11:20.000Z | 2022-03-30T13:12:30.000Z | investments/ticker.py | FlameFactory/investments | 007ff952ced3d5dfe94652b11345f3d69e4c2438 | [
"MIT"
] | 36 | 2020-04-08T08:44:52.000Z | 2022-02-09T11:55:55.000Z | investments/ticker.py | FlameFactory/investments | 007ff952ced3d5dfe94652b11345f3d69e4c2438 | [
"MIT"
] | 18 | 2020-04-14T21:35:08.000Z | 2022-03-22T07:21:20.000Z | from enum import Enum
from typing import NamedTuple
| 15.785714 | 45 | 0.595023 | from enum import Enum
from typing import NamedTuple
class TickerKind(Enum):
Stock = 1
Option = 2
Futures = 3
Bond = 4
Forex = 5
Rdr = 6
Index = 7
Gdr = 8
def __str__(self):
return self.name
def __lt__(self, other):
return self.value < other.value
class Ticke... | 108 | 234 | 46 |
0759dd2b88d4262ebf68fcd5d9c13cd22df2629f | 411 | py | Python | event_manager/types/order.py | zauddelig/celery-attrs-example | 8b8bd95a99a26d9db5275612b7efd9311a5b67b1 | [
"MIT"
] | null | null | null | event_manager/types/order.py | zauddelig/celery-attrs-example | 8b8bd95a99a26d9db5275612b7efd9311a5b67b1 | [
"MIT"
] | null | null | null | event_manager/types/order.py | zauddelig/celery-attrs-example | 8b8bd95a99a26d9db5275612b7efd9311a5b67b1 | [
"MIT"
] | null | null | null | from typing import Callable, List, ClassVar, Sequence
import attr
from event_manager.event import Event
from event_manager.exchanges import ORDER_EXCHANGE
from .order_line import OrderLine
@attr.s
| 22.833333 | 53 | 0.737226 | from typing import Callable, List, ClassVar, Sequence
import attr
from event_manager.event import Event
from event_manager.exchanges import ORDER_EXCHANGE
from .order_line import OrderLine
@attr.s
class Order:
id: int = attr.ib()
lines: Sequence[OrderLine] = attr.ib(
default=list)
submit = Even... | 0 | 189 | 22 |
50571297cdaf5618bbc441ac2e265a14d7b4d17d | 3,045 | py | Python | infra/bots/assets/mips64el_toolchain_linux/create.py | umberto-sonnino/skia | 7ecc54217889025b3e0c512f92fb84d20a26b9f7 | [
"BSD-3-Clause"
] | 1 | 2021-12-21T06:07:28.000Z | 2021-12-21T06:07:28.000Z | infra/bots/assets/mips64el_toolchain_linux/create.py | umberto-sonnino/skia | 7ecc54217889025b3e0c512f92fb84d20a26b9f7 | [
"BSD-3-Clause"
] | 1 | 2019-11-22T15:25:32.000Z | 2019-11-22T15:25:32.000Z | infra/bots/assets/mips64el_toolchain_linux/create.py | promoter/skia | bc5ed776134c60ae13d22cabc8e0f6aca0fdd422 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
#
# Copyright 2018 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Create the asset."""
import argparse
import common
import os
import shutil
import subprocess
import utils
# This is basically all the deps of g++-multilib-... | 32.741935 | 80 | 0.693268 | #!/usr/bin/env python
#
# Copyright 2018 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Create the asset."""
import argparse
import common
import os
import shutil
import subprocess
import utils
# This is basically all the deps of g++-multilib-... | 147 | 0 | 23 |
397da89ddfb6196ceb0c14240c418cbb9f018e6a | 11,122 | py | Python | codes/models/vsrgan_model.py | waitxxxx/TecoGAN-PyTorch | 15d87000ed35d2037317144f54fa0e3d64f34e2f | [
"Apache-2.0"
] | 125 | 2020-10-06T00:45:41.000Z | 2022-03-30T10:12:35.000Z | codes/models/vsrgan_model.py | waitxxxx/TecoGAN-PyTorch | 15d87000ed35d2037317144f54fa0e3d64f34e2f | [
"Apache-2.0"
] | 26 | 2021-01-02T19:38:59.000Z | 2022-03-29T06:26:36.000Z | codes/models/vsrgan_model.py | waitxxxx/TecoGAN-PyTorch | 15d87000ed35d2037317144f54fa0e3d64f34e2f | [
"Apache-2.0"
] | 34 | 2020-10-16T06:36:51.000Z | 2022-03-23T03:06:00.000Z | from collections import OrderedDict
import torch
import torch.optim as optim
import torch.distributed as dist
from .vsr_model import VSRModel
from .networks import define_generator, define_discriminator
from .networks.vgg_nets import VGGFeatureExtractor
from .optim import define_criterion, define_lr_schedule
from uti... | 38.219931 | 87 | 0.586765 | from collections import OrderedDict
import torch
import torch.optim as optim
import torch.distributed as dist
from .vsr_model import VSRModel
from .networks import define_generator, define_discriminator
from .networks.vgg_nets import VGGFeatureExtractor
from .optim import define_criterion, define_lr_schedule
from uti... | 10,468 | 0 | 189 |
96947386aa8180c29c775e2197bd80cce0257159 | 8,182 | py | Python | vectorai/api/image.py | Tiamat-Tech/vectorai | 79e088a70ff79fc6bf18c6a6c0a4f367c1113648 | [
"Apache-2.0"
] | 255 | 2020-09-30T12:32:20.000Z | 2022-03-19T16:12:35.000Z | vectorai/api/image.py | Tiamat-Tech/vectorai | 79e088a70ff79fc6bf18c6a6c0a4f367c1113648 | [
"Apache-2.0"
] | 20 | 2020-10-01T06:14:35.000Z | 2021-04-12T07:22:57.000Z | vectorai/api/image.py | Tiamat-Tech/vectorai | 79e088a70ff79fc6bf18c6a6c0a4f367c1113648 | [
"Apache-2.0"
] | 33 | 2020-10-01T20:52:39.000Z | 2022-03-18T07:17:25.000Z | import io
import base64
import requests
from typing import Dict, List
from .utils import retry, return_curl_or_response
class ViImageClient:
"""
Search and Encoding of Images
"""
@return_curl_or_response('json')
@retry()
def search_image(
self,
collection_name: str,
ima... | 30.303704 | 169 | 0.616109 | import io
import base64
import requests
from typing import Dict, List
from .utils import retry, return_curl_or_response
class ViImageClient:
"""
Search and Encoding of Images
"""
def __init__(self, username, api_key, url=None):
self.username = username
self.api_key = api_key
if ... | 193 | 0 | 26 |
70a1d13df99f533bf3aac2a16749372f4a2843ba | 2,587 | py | Python | src/pypgmc/bayes_net.py | kadeng/pypgmc | 909445fa3a426b07b39b65d2cb8979b1db8cdfca | [
"Apache-2.0"
] | 10 | 2015-03-29T14:57:53.000Z | 2018-10-22T11:40:34.000Z | src/pypgmc/bayes_net.py | kadeng/pypgmc | 909445fa3a426b07b39b65d2cb8979b1db8cdfca | [
"Apache-2.0"
] | null | null | null | src/pypgmc/bayes_net.py | kadeng/pypgmc | 909445fa3a426b07b39b65d2cb8979b1db8cdfca | [
"Apache-2.0"
] | null | null | null |
from . import DiscretePGM, PotentialTable, CliqueTreeInference, LoopyBPInference
import networkx as nx
import pandas
import numpy as np
class BayesNet(DiscretePGM):
''' Implementation of a simple Bayesian Network.'''
def __init__(self, digraph, cardinalities=[], var_names=[]):
''' Construct bayes... | 34.493333 | 105 | 0.581755 |
from . import DiscretePGM, PotentialTable, CliqueTreeInference, LoopyBPInference
import networkx as nx
import pandas
import numpy as np
class BayesNet(DiscretePGM):
''' Implementation of a simple Bayesian Network.'''
def __init__(self, digraph, cardinalities=[], var_names=[]):
''' Construct bayes... | 1,695 | 0 | 133 |
ffd580e28a4a933c827177dd70577d205fad915d | 236 | py | Python | adventure/admin.py | malcolmt/imaginary-maps-in-django | 932b5274c5fc9d574eb9fe916cd69d9409ae77e7 | [
"CC-BY-3.0"
] | 7 | 2015-03-25T16:57:01.000Z | 2018-11-08T20:30:50.000Z | adventure/admin.py | malcolmt/imaginary-maps-in-django | 932b5274c5fc9d574eb9fe916cd69d9409ae77e7 | [
"CC-BY-3.0"
] | null | null | null | adventure/admin.py | malcolmt/imaginary-maps-in-django | 932b5274c5fc9d574eb9fe916cd69d9409ae77e7 | [
"CC-BY-3.0"
] | null | null | null | from django.contrib.gis import admin
from adventure import models
from utils.admin_helper import AdminBase
admin.site.register([models.Track, models.PointOfInterest], AdminBase)
admin.site.register([models.Note, models.FeatureType])
| 26.222222 | 70 | 0.822034 | from django.contrib.gis import admin
from adventure import models
from utils.admin_helper import AdminBase
admin.site.register([models.Track, models.PointOfInterest], AdminBase)
admin.site.register([models.Note, models.FeatureType])
| 0 | 0 | 0 |
9c9031606bae872b6843e86549d545ba8d7dfbea | 1,898 | py | Python | common/grabjoo.py | nkrios/vulnx | 266f19c079e246759cb6e6748f2ec9c22249870c | [
"MIT"
] | 4 | 2019-05-31T02:47:23.000Z | 2020-11-12T16:49:24.000Z | modules/jooGrabber.py | ByXAlem/vulnx | 241233491a70c9dfff20dd982b31a51964136736 | [
"MIT"
] | null | null | null | modules/jooGrabber.py | ByXAlem/vulnx | 241233491a70c9dfff20dd982b31a51964136736 | [
"MIT"
] | null | null | null | """ Joomla Information Gathering """
from common.colors import red, green, bg, G, R, W, Y, G , good , bad , run , info , end , que
import re
import requests
# Find Joomla version and check it on exploit-db | 44.139535 | 93 | 0.586934 | """ Joomla Information Gathering """
from common.colors import red, green, bg, G, R, W, Y, G , good , bad , run , info , end , que
import re
import requests
# Find Joomla version and check it on exploit-db
def joo_version(url,headers):
endpoint = url + "/administrator/manifests/files" + '/joomla.xml'
re... | 1,625 | 0 | 68 |
92bc0eb30b0e51aa3c86c2a98e7785b3342c5f59 | 11,368 | py | Python | create_docs.py | guirava/rubrik-sdk-for-python | 10c58a28088a0b8e241af20ab9ecc802cec63246 | [
"MIT"
] | 4 | 2018-09-06T23:34:32.000Z | 2018-10-08T15:04:22.000Z | create_docs.py | guirava/rubrik-sdk-for-python | 10c58a28088a0b8e241af20ab9ecc802cec63246 | [
"MIT"
] | 1 | 2018-09-05T22:20:12.000Z | 2018-09-06T04:57:23.000Z | create_docs.py | guirava/rubrik-sdk-for-python | 10c58a28088a0b8e241af20ab9ecc802cec63246 | [
"MIT"
] | 3 | 2018-10-01T14:49:47.000Z | 2018-10-03T15:41:12.000Z | # Copyright 2020 Rubrik, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distri... | 32.573066 | 86 | 0.588142 | # Copyright 2020 Rubrik, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distri... | 8,484 | 0 | 230 |
75498d237d12999cb26b0c1eed4fb69b4a2d3d9c | 69 | py | Python | traduki/__init__.py | paylogic/traduki | 56474dbb07f62f4a8254a2d64935a52eea3cfd55 | [
"MIT"
] | 1 | 2020-03-27T10:29:24.000Z | 2020-03-27T10:29:24.000Z | traduki/__init__.py | paylogic/traduki | 56474dbb07f62f4a8254a2d64935a52eea3cfd55 | [
"MIT"
] | 10 | 2015-12-07T10:08:09.000Z | 2020-07-30T09:40:16.000Z | traduki/__init__.py | paylogic/traduki | 56474dbb07f62f4a8254a2d64935a52eea3cfd55 | [
"MIT"
] | 2 | 2015-09-04T14:10:08.000Z | 2018-03-04T18:09:21.000Z | from traduki.sqla import initialize
__all__ = (initialize.__name__)
| 17.25 | 35 | 0.811594 | from traduki.sqla import initialize
__all__ = (initialize.__name__)
| 0 | 0 | 0 |
c991c8254a6585d7033c604f2b9e288f85e59e01 | 7,062 | py | Python | checkio/Elementary/Even the last/test_even_last.py | KenMercusLai/checkio | c7702221e1bc0b0b30425859ffa6c09722949d65 | [
"MIT"
] | 39 | 2015-02-09T13:24:12.000Z | 2019-05-16T17:51:19.000Z | checkio/Elementary/Even the last/test_even_last.py | KenMercusLai/checkio | c7702221e1bc0b0b30425859ffa6c09722949d65 | [
"MIT"
] | 1 | 2019-10-21T16:18:14.000Z | 2019-10-21T16:18:14.000Z | checkio/Elementary/Even the last/test_even_last.py | KenMercusLai/checkio | c7702221e1bc0b0b30425859ffa6c09722949d65 | [
"MIT"
] | 22 | 2015-01-30T18:00:05.000Z | 2021-05-22T02:57:23.000Z | import unittest
from even_last import checkio
if __name__ == "__main__": # pragma: no cover
unittest.main()
| 28.82449 | 87 | 0.225149 | import unittest
from even_last import checkio
class Tests(unittest.TestCase):
TESTS = {
"Basics": [
{"input": [0, 1, 2, 3, 4, 5], "answer": 30, "explanation": "5*(0+2+4)"},
{"input": [1, 3, 5], "answer": 30, "explanation": "5*(1+5)"},
{"input": [6], "answer": 36, "expl... | 210 | 6,712 | 23 |
1e2b4743906887f3a8180187741ed36e07034d2b | 2,496 | py | Python | spotify_API.py | antverdovsky/Upside-Down | 9fd8bb4b1b74f855cb2e7523eecb8bdc58f3e614 | [
"MIT"
] | null | null | null | spotify_API.py | antverdovsky/Upside-Down | 9fd8bb4b1b74f855cb2e7523eecb8bdc58f3e614 | [
"MIT"
] | null | null | null | spotify_API.py | antverdovsky/Upside-Down | 9fd8bb4b1b74f855cb2e7523eecb8bdc58f3e614 | [
"MIT"
] | null | null | null | import spotipy
from spotipy.oauth2 import SpotifyClientCredentials
import json
import random
class spotify_api:
"""
Class that uses that spotify api to get a random song depending
on the mood of the user.
"""
def __init__(self, emotion):
"""
Constructor initialiazes spotify instance... | 32.415584 | 114 | 0.636218 | import spotipy
from spotipy.oauth2 import SpotifyClientCredentials
import json
import random
class spotify_api:
"""
Class that uses that spotify api to get a random song depending
on the mood of the user.
"""
def __init__(self, emotion):
"""
Constructor initialiazes spotify instance... | 0 | 0 | 0 |
8ea12fda0c22a2f3da315318602c99112c4c1339 | 26,568 | py | Python | plumbery/polishers/prepare.py | bernard357/plumbery | 4e7a69040f75ad21d35e3119dd9783e665fee122 | [
"Apache-2.0"
] | 2 | 2016-01-14T15:06:32.000Z | 2016-01-29T09:41:07.000Z | plumbery/polishers/prepare.py | bernard357/plumbery | 4e7a69040f75ad21d35e3119dd9783e665fee122 | [
"Apache-2.0"
] | 7 | 2015-11-26T22:28:45.000Z | 2016-02-10T22:35:56.000Z | plumbery/polishers/prepare.py | bernard357/plumbery | 4e7a69040f75ad21d35e3119dd9783e665fee122 | [
"Apache-2.0"
] | 8 | 2015-11-25T09:56:07.000Z | 2018-07-03T12:34:27.000Z | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | 32.759556 | 82 | 0.508883 | # Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not use ... | 0 | 0 | 0 |
0f4b923a67aeac1f64ea04ad6c59c19171867f3c | 14,542 | py | Python | csmserver/utils.py | csm-aut/csm | b38843a6cdc19a406e6f709c53767bdaaa2fef96 | [
"Apache-2.0"
] | 16 | 2015-06-24T12:04:32.000Z | 2018-12-06T15:12:42.000Z | csmserver/utils.py | csm-aut/csm | b38843a6cdc19a406e6f709c53767bdaaa2fef96 | [
"Apache-2.0"
] | 80 | 2015-05-20T16:33:39.000Z | 2017-11-30T11:31:17.000Z | csmserver/utils.py | csm-aut/csm | b38843a6cdc19a406e6f709c53767bdaaa2fef96 | [
"Apache-2.0"
] | 18 | 2015-03-20T08:36:11.000Z | 2022-02-01T01:19:04.000Z | # =============================================================================
# Copyright (c) 2016, Cisco Systems, Inc
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of sour... | 28.513725 | 107 | 0.625155 | # =============================================================================
# Copyright (c) 2016, Cisco Systems, Inc
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# Redistributions of sour... | 3,487 | 0 | 450 |
2cf1842d0e84ca07dd287e245bf29b0630946a6b | 612 | py | Python | src/utils.py | orangeblock/fanorona | f2369ff28ecb9d1fa9368ea6db8467af91fceef7 | [
"MIT"
] | 1 | 2022-03-13T19:04:05.000Z | 2022-03-13T19:04:05.000Z | src/utils.py | orangeblock/fanorona | f2369ff28ecb9d1fa9368ea6db8467af91fceef7 | [
"MIT"
] | null | null | null | src/utils.py | orangeblock/fanorona | f2369ff28ecb9d1fa9368ea6db8467af91fceef7 | [
"MIT"
] | null | null | null | #
#
# Helper functions used by the modules.
#
#
import pygame
def tsub(tup1, tup2):
""" Subtracts tup1 elements from tup2 elements. """
return (tup1[0]-tup2[0], tup1[1]-tup2[1])
def tadd(tup1, tup2):
""" Adds the elements of tup1 and tup2. """
return (tup1[0]+tup2[0], tup1[1]+tup2[1])
def tflip(tu... | 23.538462 | 62 | 0.635621 | #
#
# Helper functions used by the modules.
#
#
import pygame
def load_image(path):
return pygame.image.load(path).convert_alpha()
def tsub(tup1, tup2):
""" Subtracts tup1 elements from tup2 elements. """
return (tup1[0]-tup2[0], tup1[1]-tup2[1])
def tadd(tup1, tup2):
""" Adds the elements of tup1... | 51 | 0 | 23 |
cc39176da9f0a54de88c3f3e3d184c985a484f90 | 129 | py | Python | src/hyper-model/hypermodel/__init__.py | GrowingData/hyper-model | 7034e8426780618ec97ba3d8a48c85be192554f4 | [
"Apache-2.0"
] | 16 | 2019-10-24T01:09:03.000Z | 2022-02-03T15:24:13.000Z | src/hyper-model/hypermodel/__init__.py | hypermodel/hyper-model | d1a0bd949ef6d20d2cf239ccfef1f1dc267277c0 | [
"Apache-2.0"
] | 2 | 2019-10-24T01:20:37.000Z | 2019-10-30T00:28:38.000Z | src/hyper-model/hypermodel/__init__.py | GrowingData/hyper-model | 7034e8426780618ec97ba3d8a48c85be192554f4 | [
"Apache-2.0"
] | 9 | 2019-10-24T01:09:08.000Z | 2021-11-11T21:47:27.000Z | from hypermodel.utilities.hm_shell import sh
from hypermodel.kubeflow.deploy_dev import deploy_to_dev
import logging
import sys
| 21.5 | 56 | 0.868217 | from hypermodel.utilities.hm_shell import sh
from hypermodel.kubeflow.deploy_dev import deploy_to_dev
import logging
import sys
| 0 | 0 | 0 |
b47fb284d0cd87a73917ee5a1d36c1d5952a2107 | 1,225 | py | Python | grouper/models/group_service_accounts.py | aneeq009/merou | 7a87b43aaf64244932fa460842132a2d9329e704 | [
"Apache-2.0"
] | 58 | 2017-05-26T06:46:24.000Z | 2022-03-25T20:55:51.000Z | grouper/models/group_service_accounts.py | aneeq009/merou | 7a87b43aaf64244932fa460842132a2d9329e704 | [
"Apache-2.0"
] | 74 | 2017-06-16T17:48:37.000Z | 2022-03-28T23:09:54.000Z | grouper/models/group_service_accounts.py | aneeq009/merou | 7a87b43aaf64244932fa460842132a2d9329e704 | [
"Apache-2.0"
] | 43 | 2017-05-20T22:11:51.000Z | 2022-03-25T00:24:56.000Z | from sqlalchemy import Column, ForeignKey, Index, Integer
from sqlalchemy.orm import backref, relationship
from grouper.models.base.model_base import Model
class GroupServiceAccount(Model):
"""Service accounts owned by a group.
A group may own zero or more service accounts. This table holds the mapping betw... | 32.236842 | 99 | 0.684898 | from sqlalchemy import Column, ForeignKey, Index, Integer
from sqlalchemy.orm import backref, relationship
from grouper.models.base.model_base import Model
class GroupServiceAccount(Model):
"""Service accounts owned by a group.
A group may own zero or more service accounts. This table holds the mapping betw... | 191 | 0 | 27 |
87ef01c9abbe3fe5d79a63c380a4332694918b26 | 2,205 | py | Python | assignments/12_grep/grep.py | reidloeffler/be434-fall-2021 | ee2337fd8ba7d3100ffd32ecc4513f95128f5589 | [
"MIT"
] | null | null | null | assignments/12_grep/grep.py | reidloeffler/be434-fall-2021 | ee2337fd8ba7d3100ffd32ecc4513f95128f5589 | [
"MIT"
] | null | null | null | assignments/12_grep/grep.py | reidloeffler/be434-fall-2021 | ee2337fd8ba7d3100ffd32ecc4513f95128f5589 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
"""
Author : reidloeffler <reidloeffler@localhost>
Date : 2021-11-23
Purpose: Assignment 12
"""
import argparse
import sys
# --------------------------------------------------
def get_args():
"""Get command-line arguments"""
parser = argparse.ArgumentParser(
description='Pyt... | 29.4 | 79 | 0.47483 | #!/usr/bin/env python3
"""
Author : reidloeffler <reidloeffler@localhost>
Date : 2021-11-23
Purpose: Assignment 12
"""
import argparse
import sys
# --------------------------------------------------
def get_args():
"""Get command-line arguments"""
parser = argparse.ArgumentParser(
description='Pyt... | 0 | 0 | 0 |
97a684c7e7e4e6379f8c0a25181535b568382da1 | 193 | py | Python | imc/urls.py | VictorArnaud/sdcurve | d5397b0193fb01e94dc93c9fad5e2db195754384 | [
"MIT"
] | null | null | null | imc/urls.py | VictorArnaud/sdcurve | d5397b0193fb01e94dc93c9fad5e2db195754384 | [
"MIT"
] | 8 | 2018-05-17T22:50:18.000Z | 2018-05-19T01:15:26.000Z | imc/urls.py | VWApplications/sdcurve | d5397b0193fb01e94dc93c9fad5e2db195754384 | [
"MIT"
] | 1 | 2018-06-27T00:18:21.000Z | 2018-06-27T00:18:21.000Z | from django.urls import path, include
from .api import urls
app_name = 'imc'
urlpatterns = [
path(
'api/growth-curve/imc/',
include(urls.imc_curves_patterns_api)
),
]
| 16.083333 | 45 | 0.647668 | from django.urls import path, include
from .api import urls
app_name = 'imc'
urlpatterns = [
path(
'api/growth-curve/imc/',
include(urls.imc_curves_patterns_api)
),
]
| 0 | 0 | 0 |
99cc4d42fd4c95307a77961bf2f27eca2fbb122a | 739 | py | Python | spHNF_manip/calc_all_transforms.py | JohnEdChristensen/NiggliOptimize | e90b8c66e7b7e560c460502ee24991af775c625b | [
"MIT"
] | null | null | null | spHNF_manip/calc_all_transforms.py | JohnEdChristensen/NiggliOptimize | e90b8c66e7b7e560c460502ee24991af775c625b | [
"MIT"
] | null | null | null | spHNF_manip/calc_all_transforms.py | JohnEdChristensen/NiggliOptimize | e90b8c66e7b7e560c460502ee24991af775c625b | [
"MIT"
] | null | null | null | import ast
from matrix_tools import *
transformations = numpy.loadtxt("Data/AllDetOfOne.txt")
transformations = numpy.reshape(transformations, (len(transformations) / 3, 3, 3))
with open("Data/NiggliBasis.txt") as f:
lines = f.readlines()
num_of_lines = len(lines)
n_basis_file = open("Data/NiggliBasis.txt", "r")
... | 33.590909 | 87 | 0.729364 | import ast
from matrix_tools import *
transformations = numpy.loadtxt("Data/AllDetOfOne.txt")
transformations = numpy.reshape(transformations, (len(transformations) / 3, 3, 3))
with open("Data/NiggliBasis.txt") as f:
lines = f.readlines()
num_of_lines = len(lines)
n_basis_file = open("Data/NiggliBasis.txt", "r")
... | 0 | 0 | 0 |
3948e0d831ecae650cd1b9353bad938ef9568f57 | 156 | py | Python | cloudy-crocodiles/django/djangocities/graphql/types/query.py | patryk-tech/summer-code-jam-2020 | 361fecf3a0f72a92d26d934cbda880cb44058e7b | [
"MIT"
] | 40 | 2020-08-02T07:38:22.000Z | 2021-07-26T01:46:50.000Z | cloudy-crocodiles/django/djangocities/graphql/types/query.py | patryk-tech/summer-code-jam-2020 | 361fecf3a0f72a92d26d934cbda880cb44058e7b | [
"MIT"
] | 134 | 2020-07-31T12:15:45.000Z | 2020-12-13T04:42:19.000Z | cloudy-crocodiles/django/djangocities/graphql/types/query.py | patryk-tech/summer-code-jam-2020 | 361fecf3a0f72a92d26d934cbda880cb44058e7b | [
"MIT"
] | 101 | 2020-07-31T12:00:47.000Z | 2021-11-01T09:06:58.000Z | from djangocities.user.query import *
from djangocities.cities.query import *
from djangocities.sites.query import *
from djangocities.pages.query import *
| 31.2 | 39 | 0.820513 | from djangocities.user.query import *
from djangocities.cities.query import *
from djangocities.sites.query import *
from djangocities.pages.query import *
| 0 | 0 | 0 |
abbb35f8931618936185abc36350719d4849ac1a | 2,961 | py | Python | cam/train.py | 4the1appdevs/face_recognition | d69d387f6e7bca45eeb15107f67b9c305c6082d0 | [
"Apache-2.0"
] | 1 | 2021-04-01T05:37:54.000Z | 2021-04-01T05:37:54.000Z | cam/train.py | Jzhenli/face_recognition | d69d387f6e7bca45eeb15107f67b9c305c6082d0 | [
"Apache-2.0"
] | null | null | null | cam/train.py | Jzhenli/face_recognition | d69d387f6e7bca45eeb15107f67b9c305c6082d0 | [
"Apache-2.0"
] | 1 | 2021-04-02T00:49:55.000Z | 2021-04-02T00:49:55.000Z | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import os
import dlib
import cv2
import pickle
from sklearn.svm import SVC
from cam.models import dlib_model, classifier_model
FaceDetection = dlib.get_frontal_face_detector()
# face recognition
sp = dlib.shape_predictor(dlib_model.pose_predictor_model_location())
Description... | 29.316832 | 99 | 0.630868 | #!/usr/bin/python
# -*- coding: UTF-8 -*-
import os
import dlib
import cv2
import pickle
from sklearn.svm import SVC
from cam.models import dlib_model, classifier_model
FaceDetection = dlib.get_frontal_face_detector()
# face recognition
sp = dlib.shape_predictor(dlib_model.pose_predictor_model_location())
Description... | 2,396 | 0 | 115 |
a5d0e2e0c18088b5c4ecd858befa447ca26e7703 | 636 | py | Python | pyleecan/Methods/Geometry/SurfRing/discretize.py | IrakozeFD/pyleecan | 5a93bd98755d880176c1ce8ac90f36ca1b907055 | [
"Apache-2.0"
] | 95 | 2019-01-23T04:19:45.000Z | 2022-03-17T18:22:10.000Z | pyleecan/Methods/Geometry/SurfRing/discretize.py | IrakozeFD/pyleecan | 5a93bd98755d880176c1ce8ac90f36ca1b907055 | [
"Apache-2.0"
] | 366 | 2019-02-20T07:15:08.000Z | 2022-03-31T13:37:23.000Z | pyleecan/Methods/Geometry/SurfRing/discretize.py | IrakozeFD/pyleecan | 5a93bd98755d880176c1ce8ac90f36ca1b907055 | [
"Apache-2.0"
] | 74 | 2019-01-24T01:47:31.000Z | 2022-02-25T05:44:42.000Z | # -*-- coding: utf-8 -*
def discretize(self, Npoint=-1):
"""Returns the discretize version of the SurfRing
Parameters
----------
self: SurfRing
A SurfRing object
Npoint : int
Number of point on each line (Default value = -1 => use the line default discretization)
Returns
--... | 26.5 | 96 | 0.646226 | # -*-- coding: utf-8 -*
def discretize(self, Npoint=-1):
"""Returns the discretize version of the SurfRing
Parameters
----------
self: SurfRing
A SurfRing object
Npoint : int
Number of point on each line (Default value = -1 => use the line default discretization)
Returns
--... | 0 | 0 | 0 |
0adeda094a3b3e14de1fe2b8ae4ed7eebef7d414 | 30 | py | Python | python/testData/editing/enterInIncompleteDictComprehension.py | jnthn/intellij-community | 8fa7c8a3ace62400c838e0d5926a7be106aa8557 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/editing/enterInIncompleteDictComprehension.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/editing/enterInIncompleteDictComprehension.py | Cyril-lamirand/intellij-community | 60ab6c61b82fc761dd68363eca7d9d69663cfa39 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | mapping = {foo: bar for<caret> | 30 | 30 | 0.7 | mapping = {foo: bar for<caret> | 0 | 0 | 0 |
b4a30a373b7594718b47ecaf220a3cfeebfb9ad7 | 263 | py | Python | mcts/__init__.py | hwangyale/AlphaGomoku | 7c85a71c710fa8d114b3591e4fd27c8649caccbb | [
"MIT"
] | 3 | 2018-10-30T07:07:40.000Z | 2019-11-22T12:32:32.000Z | mcts/__init__.py | hwangyale/AlphaGomoku | 7c85a71c710fa8d114b3591e4fd27c8649caccbb | [
"MIT"
] | null | null | null | mcts/__init__.py | hwangyale/AlphaGomoku | 7c85a71c710fa8d114b3591e4fd27c8649caccbb | [
"MIT"
] | null | null | null | from ..utils.generic_utils import deserialize_object
from .rollout_mcts import *
from .evaluation_mcts import *
from .rl_evaluation_mcts import *
| 29.222222 | 60 | 0.752852 | from ..utils.generic_utils import deserialize_object
from .rollout_mcts import *
from .evaluation_mcts import *
from .rl_evaluation_mcts import *
def get(config, *args, **kwargs):
glos = globals()
return deserialize_object(config, glos, *args, **kwargs)
| 94 | 0 | 23 |
2fcd393fe03719ac4941f395dc5b0c89f9117a50 | 255 | py | Python | authentication/__init__.py | samarth-ramesh/mtlauncher | 14f4c2b83a39a7775e6dd09ccf60f1382c4a8837 | [
"MIT"
] | null | null | null | authentication/__init__.py | samarth-ramesh/mtlauncher | 14f4c2b83a39a7775e6dd09ccf60f1382c4a8837 | [
"MIT"
] | 1 | 2021-02-13T03:06:31.000Z | 2021-02-13T03:08:33.000Z | authentication/__init__.py | samarth-ramesh/mtlauncher | 14f4c2b83a39a7775e6dd09ccf60f1382c4a8837 | [
"MIT"
] | null | null | null | # This is free software licensed under the MIT license.
# Copyright (c) 2021 Samarth Ramesh <samarthr1@outlook.com>
# You should have recived a copy of the MIT license with this file. In case you ahve not, visit https://github.com/samarth-ramsh/mtlaucher
| 63.75 | 138 | 0.776471 | # This is free software licensed under the MIT license.
# Copyright (c) 2021 Samarth Ramesh <samarthr1@outlook.com>
# You should have recived a copy of the MIT license with this file. In case you ahve not, visit https://github.com/samarth-ramsh/mtlaucher
| 0 | 0 | 0 |
1ad324ea82c8cb5fa6537f0bf51cde0476701191 | 1,519 | py | Python | src/fts3rest/fts3rest/controllers/config/audit.py | Jar-win/fts-rest | 4db0880cf328037b8587b4d16741c40959b47ad2 | [
"Apache-2.0"
] | 1 | 2018-08-28T11:28:09.000Z | 2018-08-28T11:28:09.000Z | src/fts3rest/fts3rest/controllers/config/audit.py | Jar-win/fts-rest | 4db0880cf328037b8587b4d16741c40959b47ad2 | [
"Apache-2.0"
] | 13 | 2019-06-17T13:24:21.000Z | 2022-02-03T16:28:10.000Z | src/fts3rest/fts3rest/controllers/config/audit.py | Jar-win/fts-rest | 4db0880cf328037b8587b4d16741c40959b47ad2 | [
"Apache-2.0"
] | 3 | 2018-11-29T12:16:29.000Z | 2021-02-25T09:16:47.000Z | # Copyright notice:
# Copyright Members of the EMI Collaboration, 2013.
#
# See www.eu-emi.eu for details on the copyright holders
#
# 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... | 31.645833 | 96 | 0.734694 | # Copyright notice:
# Copyright Members of the EMI Collaboration, 2013.
#
# See www.eu-emi.eu for details on the copyright holders
#
# 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... | 0 | 0 | 0 |
f659241f7292d789e054c7f48881102a8b9757e2 | 1,278 | py | Python | utilities.py | nsid10/Hybrid-CRO-for-clustering | 8adf309e6418e00720cb704d6fb35a54693ae92e | [
"CC0-1.0"
] | null | null | null | utilities.py | nsid10/Hybrid-CRO-for-clustering | 8adf309e6418e00720cb704d6fb35a54693ae92e | [
"CC0-1.0"
] | null | null | null | utilities.py | nsid10/Hybrid-CRO-for-clustering | 8adf309e6418e00720cb704d6fb35a54693ae92e | [
"CC0-1.0"
] | null | null | null | import numpy as np
from sklearn.metrics import accuracy_score, f1_score
| 29.045455 | 65 | 0.622848 | import numpy as np
from sklearn.metrics import accuracy_score, f1_score
def normalize(x):
# Mean normalization. Scale to -1 to 1
return (x - x.mean(axis=0)) / (x.max(axis=0) - x.min(axis=0))
def squared_sum_error(centroids, labels, data):
# Squared sum error
distances = 0
for i, c in enumerate(c... | 1,134 | 0 | 69 |
26cf45bb73194a7608d68fc64d6c920a6bd483b1 | 978 | py | Python | migrations/versions/140_service_id_null_for_drafts.py | uk-gov-mirror/alphagov.digitalmarketplace-api | 5a1db63691d0c4a435714837196ab6914badaf62 | [
"MIT"
] | 25 | 2015-01-14T10:45:13.000Z | 2021-05-26T17:21:41.000Z | migrations/versions/140_service_id_null_for_drafts.py | uk-gov-mirror/alphagov.digitalmarketplace-api | 5a1db63691d0c4a435714837196ab6914badaf62 | [
"MIT"
] | 641 | 2015-01-15T11:10:50.000Z | 2021-06-15T22:18:42.000Z | migrations/versions/140_service_id_null_for_drafts.py | uk-gov-mirror/alphagov.digitalmarketplace-api | 5a1db63691d0c4a435714837196ab6914badaf62 | [
"MIT"
] | 22 | 2015-06-13T15:37:45.000Z | 2021-08-19T23:40:49.000Z | """empty message
Revision ID: 140_service_id_null_for_drafts
Revises: 130_acknowledged_at_column
Create Date: 2015-06-22 10:42:37.274484
"""
# revision identifiers, used by Alembic.
revision = '140_service_id_null_for_drafts'
down_revision = '130_acknowledged_at_column'
from alembic import op
import sqlalchemy as s... | 31.548387 | 105 | 0.733129 | """empty message
Revision ID: 140_service_id_null_for_drafts
Revises: 130_acknowledged_at_column
Create Date: 2015-06-22 10:42:37.274484
"""
# revision identifiers, used by Alembic.
revision = '140_service_id_null_for_drafts'
down_revision = '130_acknowledged_at_column'
from alembic import op
import sqlalchemy as s... | 608 | 0 | 46 |
1281cb73ee6bbea74e71a5c2572b5adf9adab7cd | 739 | py | Python | setup.py | tolomea/django-lazy-services | 035220e4945673d6c08930c610149085b4918d82 | [
"BSD-3-Clause"
] | 5 | 2020-03-15T11:38:01.000Z | 2020-03-26T10:29:15.000Z | setup.py | tolomea/django-lazy-services | 035220e4945673d6c08930c610149085b4918d82 | [
"BSD-3-Clause"
] | null | null | null | setup.py | tolomea/django-lazy-services | 035220e4945673d6c08930c610149085b4918d82 | [
"BSD-3-Clause"
] | null | null | null | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="django-lazy-services",
version="0.0.3",
author="Gordon Wrigley",
author_email="gordon.wrigley@gmail.com",
description="A helper for switching between test and production versions of a serv... | 32.130435 | 98 | 0.682003 | import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="django-lazy-services",
version="0.0.3",
author="Gordon Wrigley",
author_email="gordon.wrigley@gmail.com",
description="A helper for switching between test and production versions of a serv... | 0 | 0 | 0 |
92c90e5172e89b98c3309bb01dc9787f15c24859 | 4,218 | py | Python | youtube_dl/extractor/vporn.py | builder07/ytdl | 2c0a5d50af7ecc7302c813d649ee72dcd457a50a | [
"Unlicense"
] | 10 | 2020-05-29T03:20:03.000Z | 2022-03-29T01:05:20.000Z | youtube_dl/extractor/vporn.py | builder07/ytdl | 2c0a5d50af7ecc7302c813d649ee72dcd457a50a | [
"Unlicense"
] | 5 | 2016-04-22T01:33:31.000Z | 2016-08-04T15:33:19.000Z | youtube_dl/extractor/vporn.py | builder07/ytdl | 2c0a5d50af7ecc7302c813d649ee72dcd457a50a | [
"Unlicense"
] | 9 | 2020-05-29T03:21:02.000Z | 2021-04-14T03:26:05.000Z | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
parse_duration,
str_to_int,
)
| 35.745763 | 102 | 0.484116 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
parse_duration,
str_to_int,
)
class VpornIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?vporn\.com/[^/]+/(?P<display_id>[^/]+)/(?P<id>\d+)'
_TESTS = [
{
'url': 'http://... | 2,498 | 1,550 | 23 |
c9b0cf5e39fefd7fca75a9421c4d58198e0d6652 | 603 | py | Python | brain_games/games/prime.py | AndyRiddle/python-project-lvl1 | 1c435e136745e7917fc795c6952964f2598bd528 | [
"MIT"
] | 1 | 2020-08-19T09:34:04.000Z | 2020-08-19T09:34:04.000Z | brain_games/games/prime.py | AndyRiddle/python-project-lvl1 | 1c435e136745e7917fc795c6952964f2598bd528 | [
"MIT"
] | null | null | null | brain_games/games/prime.py | AndyRiddle/python-project-lvl1 | 1c435e136745e7917fc795c6952964f2598bd528 | [
"MIT"
] | null | null | null | import math
import random
FIRST_DIVISOR = 2
LOWER_LIMIT = 1
UPPER_LIMIT = 100
RULE = 'Answer "yes" if given number is prime. Otherwise answer "no".'
| 22.333333 | 74 | 0.658375 | import math
import random
FIRST_DIVISOR = 2
LOWER_LIMIT = 1
UPPER_LIMIT = 100
RULE = 'Answer "yes" if given number is prime. Otherwise answer "no".'
def is_prime(number):
if number <= 1:
return False
for divisor in range(FIRST_DIVISOR, math.ceil(math.sqrt(number) + 1)):
if (number % divisor ... | 404 | 0 | 46 |
e81ab655be52669fbb2578b815e8485c6f3f35f1 | 415 | py | Python | app/chat/guest.py | B-T-S/Build | c6fae1fc44ec6a1ec3c2f01784ac2a1e67017ccc | [
"MIT"
] | 1 | 2020-09-06T11:21:43.000Z | 2020-09-06T11:21:43.000Z | app/chat/guest.py | B-T-S/Build | c6fae1fc44ec6a1ec3c2f01784ac2a1e67017ccc | [
"MIT"
] | null | null | null | app/chat/guest.py | B-T-S/Build | c6fae1fc44ec6a1ec3c2f01784ac2a1e67017ccc | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from flask import Blueprint, request,json
from pusher import pusher
blueprint = Blueprint('guest', __name__)
@blueprint.route('/new/guest', methods=['POST']) | 29.642857 | 67 | 0.595181 | # -*- coding: utf-8 -*-
from flask import Blueprint, request,json
from pusher import pusher
blueprint = Blueprint('guest', __name__)
@blueprint.route('/new/guest', methods=['POST'])
def guestUser():
data = request.json
pusher.trigger(u'general-channel', u'new-guest-details', {
'name' : da... | 210 | 0 | 22 |
64f68cefdeab45e4fb5e25f68a63cda59377cf01 | 1,018 | py | Python | backend/tests/resource_task_list_tests.py | richard-ma/todo | b5199c268a2a979696991f9ed556a11d77d18c94 | [
"MIT"
] | null | null | null | backend/tests/resource_task_list_tests.py | richard-ma/todo | b5199c268a2a979696991f9ed556a11d77d18c94 | [
"MIT"
] | null | null | null | backend/tests/resource_task_list_tests.py | richard-ma/todo | b5199c268a2a979696991f9ed556a11d77d18c94 | [
"MIT"
] | null | null | null | from flask import jsonify
from flask_testing import TestCase
from src.models import db
from src.app import create_app
from src.models.task import Task
| 24.238095 | 61 | 0.666012 | from flask import jsonify
from flask_testing import TestCase
from src.models import db
from src.app import create_app
from src.models.task import Task
class TaskResourceTestCase(TestCase):
def create_app(self):
return create_app()
def setUp(self):
db.create_all()
# example task
... | 666 | 16 | 184 |
aa7cf363c6131e8a0473f50b108580a14025b2a8 | 1,654 | py | Python | ann2snn/validation.py | EthanChen916/STBP-train-and-compression | e16f8f058128e62489b29370b2653a6a453f9977 | [
"MIT"
] | null | null | null | ann2snn/validation.py | EthanChen916/STBP-train-and-compression | e16f8f058128e62489b29370b2653a6a453f9977 | [
"MIT"
] | null | null | null | ann2snn/validation.py | EthanChen916/STBP-train-and-compression | e16f8f058128e62489b29370b2653a6a453f9977 | [
"MIT"
] | null | null | null | import torch
from snn_layers import SpikeTensor
def validate_snn(net, test_loader, device, criterion, timesteps):
"""Perform validation for SNN"""
print("Performing validation for SNN")
# switch to evaluate mode
net.eval()
correct = 0
with torch.no_grad():
for data_test, target in t... | 29.017544 | 91 | 0.600967 | import torch
from snn_layers import SpikeTensor
def validate_snn(net, test_loader, device, criterion, timesteps):
"""Perform validation for SNN"""
print("Performing validation for SNN")
# switch to evaluate mode
net.eval()
correct = 0
with torch.no_grad():
for data_test, target in t... | 0 | 0 | 0 |
0188a89df84bf58d9d8d6543c45e1a24244d6f97 | 11,497 | py | Python | 2 - Modelling data with multiple channels/pixelCNN_RGB.py | Mind-the-Pineapple/Autoregressive-models | 34880e294b0999ddae77965f1f1b18528a7c5add | [
"MIT"
] | 14 | 2020-03-19T08:31:21.000Z | 2021-12-01T02:35:54.000Z | 2 - Modelling data with multiple channels/pixelCNN_RGB.py | Mind-the-Pineapple/Autoregressive-models | 34880e294b0999ddae77965f1f1b18528a7c5add | [
"MIT"
] | null | null | null | 2 - Modelling data with multiple channels/pixelCNN_RGB.py | Mind-the-Pineapple/Autoregressive-models | 34880e294b0999ddae77965f1f1b18528a7c5add | [
"MIT"
] | 2 | 2020-06-24T14:37:30.000Z | 2020-08-06T14:24:03.000Z |
"""Script to train pixelCNN on the CIFAR10 dataset."""
import random as rn
import time
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
from tensorflow import keras
class MaskedConv2D(keras.layers.Layer):
"""Convolutional layers with masks.
Convolutional layers wi... | 39.105442 | 116 | 0.550404 |
"""Script to train pixelCNN on the CIFAR10 dataset."""
import random as rn
import time
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
import tensorflow as tf
from tensorflow import keras
class MaskedConv2D(keras.layers.Layer):
"""Convolutional layers with masks.
Convolutional layers wi... | 3,680 | 0 | 184 |
6e49a8c30afaaac5b64d49fe7e81d8caeed4b991 | 6,607 | py | Python | back-end/main.py | Guilhermeslucas/SPaaS | 6e035f2a1f5fb9d00cf39cc40e002ddd51934b2b | [
"MIT"
] | 2 | 2018-11-12T14:33:06.000Z | 2018-12-18T13:06:24.000Z | back-end/main.py | Guilhermeslucas/SPaaS | 6e035f2a1f5fb9d00cf39cc40e002ddd51934b2b | [
"MIT"
] | 9 | 2018-10-06T20:04:42.000Z | 2018-11-22T20:03:56.000Z | back-end/main.py | Guilhermeslucas/SPaaS | 6e035f2a1f5fb9d00cf39cc40e002ddd51934b2b | [
"MIT"
] | 1 | 2019-03-08T22:50:38.000Z | 2019-03-08T22:50:38.000Z | from flask import Flask, request, Response
import json
import pymongo
from flask_cors import CORS
from bson.json_util import dumps, loads
import os
from azure.storage.blob import BlockBlobService, PublicAccess
from celery import Celery
import subprocess
import uuid
app = Flask(__name__)
CORS(app)
db_cli... | 33.035 | 111 | 0.670955 | from flask import Flask, request, Response
import json
import pymongo
from flask_cors import CORS
from bson.json_util import dumps, loads
import os
from azure.storage.blob import BlockBlobService, PublicAccess
from celery import Celery
import subprocess
import uuid
app = Flask(__name__)
CORS(app)
db_cli... | 4,264 | 0 | 466 |
ab0fad759a493e783d3852db4308501de6662b2d | 15,044 | py | Python | square/api/terminal_api.py | sdolemelipone/square-python-sdk | 4674d4867542ff5a32dc29a4bde483e62df065fb | [
"Apache-2.0"
] | 75 | 2019-08-15T14:40:47.000Z | 2022-03-05T16:24:00.000Z | square/api/terminal_api.py | sdolemelipone/square-python-sdk | 4674d4867542ff5a32dc29a4bde483e62df065fb | [
"Apache-2.0"
] | 13 | 2019-12-10T20:14:02.000Z | 2022-02-01T15:31:37.000Z | square/api/terminal_api.py | sdolemelipone/square-python-sdk | 4674d4867542ff5a32dc29a4bde483e62df065fb | [
"Apache-2.0"
] | 41 | 2019-10-20T20:53:45.000Z | 2022-02-10T02:18:18.000Z | # -*- coding: utf-8 -*-
from square.api_helper import APIHelper
from square.http.api_response import ApiResponse
from square.api.base_api import BaseApi
from square.http.auth.o_auth_2 import OAuth2
class TerminalApi(BaseApi):
"""A Controller to access Endpoints in the square API."""
def create_terminal_che... | 36.692683 | 120 | 0.621377 | # -*- coding: utf-8 -*-
from square.api_helper import APIHelper
from square.http.api_response import ApiResponse
from square.api.base_api import BaseApi
from square.http.auth.o_auth_2 import OAuth2
class TerminalApi(BaseApi):
"""A Controller to access Endpoints in the square API."""
def __init__(self, conf... | 83 | 0 | 27 |
358f62b416eb45930a4be5bd90a2788a2d1554e9 | 2,160 | py | Python | examples/mnist_sem_seg/run.py | JanEGerken/s2cnn-1 | 3b1dd482eb624ebb85749eba0ef9b86a5b5974d4 | [
"MIT"
] | null | null | null | examples/mnist_sem_seg/run.py | JanEGerken/s2cnn-1 | 3b1dd482eb624ebb85749eba0ef9b86a5b5974d4 | [
"MIT"
] | null | null | null | examples/mnist_sem_seg/run.py | JanEGerken/s2cnn-1 | 3b1dd482eb624ebb85749eba0ef9b86a5b5974d4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import argparse
import subprocess
import sys
import os
from pathlib import Path
import get_paths
if __name__ == "__main__":
main()
| 29.189189 | 92 | 0.666667 | #!/usr/bin/env python3
import argparse
import subprocess
import sys
import os
from pathlib import Path
import get_paths
def env_prefix(env):
if env == "local":
return []
if env == "singularity":
container_path = os.path.join(get_paths.get_container_path(), "s2cnn_container.sif")
comm... | 1,878 | 0 | 115 |
f79d00c58224f22b00785b8f5c814a316e01b30a | 3,740 | py | Python | doc/examples/reconst_csd_parallel.py | JohnGriffiths/dipy | 5fb38e9b77547cdaf5eb140730444535733ae01d | [
"BSD-3-Clause"
] | 2 | 2018-07-25T14:04:20.000Z | 2021-02-10T07:10:10.000Z | doc/examples/reconst_csd_parallel.py | JohnGriffiths/dipy | 5fb38e9b77547cdaf5eb140730444535733ae01d | [
"BSD-3-Clause"
] | null | null | null | doc/examples/reconst_csd_parallel.py | JohnGriffiths/dipy | 5fb38e9b77547cdaf5eb140730444535733ae01d | [
"BSD-3-Clause"
] | 2 | 2018-07-24T21:20:54.000Z | 2018-08-27T04:08:24.000Z | """
=================================
Parallel reconstruction using CSD
=================================
This example shows how to use parallelism (multiprocessing) using
``peaks_from_model`` in order to speedup the signal reconstruction
process. For this example will we use the same initial steps
as we used in :ref:... | 32.521739 | 78 | 0.598396 | """
=================================
Parallel reconstruction using CSD
=================================
This example shows how to use parallelism (multiprocessing) using
``peaks_from_model`` in order to speedup the signal reconstruction
process. For this example will we use the same initial steps
as we used in :ref:... | 0 | 0 | 0 |
6173f773053f1a24805015db8abbb52b80e23849 | 928 | py | Python | tests/factories/grading_info.py | mattdricker/lms | 40b8a04f95e69258c6c0d7ada543f4b527918ecf | [
"BSD-2-Clause"
] | 38 | 2017-12-30T23:49:53.000Z | 2022-02-15T21:07:49.000Z | tests/factories/grading_info.py | mattdricker/lms | 40b8a04f95e69258c6c0d7ada543f4b527918ecf | [
"BSD-2-Clause"
] | 1,733 | 2017-11-09T18:46:05.000Z | 2022-03-31T11:05:50.000Z | tests/factories/grading_info.py | mattdricker/lms | 40b8a04f95e69258c6c0d7ada543f4b527918ecf | [
"BSD-2-Clause"
] | 10 | 2018-07-11T17:12:46.000Z | 2022-01-07T20:00:23.000Z | from factory import Faker, make_factory
from factory.alchemy import SQLAlchemyModelFactory
from lms import models
from tests.factories.attributes import (
H_DISPLAY_NAME,
H_USERNAME,
OAUTH_CONSUMER_KEY,
RESOURCE_LINK_ID,
USER_ID,
)
GradingInfo = make_factory(
models.GradingInfo,
FACTORY_CL... | 29.935484 | 82 | 0.733836 | from factory import Faker, make_factory
from factory.alchemy import SQLAlchemyModelFactory
from lms import models
from tests.factories.attributes import (
H_DISPLAY_NAME,
H_USERNAME,
OAUTH_CONSUMER_KEY,
RESOURCE_LINK_ID,
USER_ID,
)
GradingInfo = make_factory(
models.GradingInfo,
FACTORY_CL... | 0 | 0 | 0 |
203b5d7cef79488803785672ae48e1991457db3c | 1,303 | py | Python | main/migrations/0001_initial.py | ericrobskyhuntley/vialab.mit.edu | 1318d03b8eeb106c1662052e1caa53290e206ae7 | [
"MIT"
] | null | null | null | main/migrations/0001_initial.py | ericrobskyhuntley/vialab.mit.edu | 1318d03b8eeb106c1662052e1caa53290e206ae7 | [
"MIT"
] | null | null | null | main/migrations/0001_initial.py | ericrobskyhuntley/vialab.mit.edu | 1318d03b8eeb106c1662052e1caa53290e206ae7 | [
"MIT"
] | null | null | null | # Generated by Django 3.0.4 on 2020-03-31 16:04
from django.db import migrations, models
import markdownx.models
| 39.484848 | 114 | 0.586339 | # Generated by Django 3.0.4 on 2020-03-31 16:04
from django.db import migrations, models
import markdownx.models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='About',
fields=[
('... | 0 | 1,165 | 23 |
0448038af809733f5db8c6f874a128989a16b87e | 10,675 | py | Python | platypush/backend/music/mopidy/__init__.py | BlackLight/platypush | 6c0a8bf2599eb4ab41a6122dbd988075d8b1a63a | [
"MIT"
] | 228 | 2018-01-30T11:17:09.000Z | 2022-03-24T11:22:26.000Z | platypush/backend/music/mopidy/__init__.py | BlackLight/platypush | 6c0a8bf2599eb4ab41a6122dbd988075d8b1a63a | [
"MIT"
] | 167 | 2017-12-11T19:35:38.000Z | 2022-03-27T14:45:30.000Z | platypush/backend/music/mopidy/__init__.py | BlackLight/runbullet | 8d26c8634d2677b4402f0a21b9ab8244b44640db | [
"MIT"
] | 16 | 2018-05-03T07:31:56.000Z | 2021-12-05T19:27:37.000Z | import json
import re
import threading
import websocket
from platypush.backend import Backend
from platypush.message.event.music import MusicPlayEvent, MusicPauseEvent, \
MusicStopEvent, NewPlayingTrackEvent, PlaylistChangeEvent, VolumeChangeEvent, \
PlaybackConsumeModeChangeEvent, PlaybackSingleModeChangeEve... | 39.684015 | 119 | 0.570023 | import json
import re
import threading
import websocket
from platypush.backend import Backend
from platypush.message.event.music import MusicPlayEvent, MusicPauseEvent, \
MusicStopEvent, NewPlayingTrackEvent, PlaylistChangeEvent, VolumeChangeEvent, \
PlaybackConsumeModeChangeEvent, PlaybackSingleModeChangeEve... | 8,493 | 0 | 323 |
d6f8dd459e5fd6d8fdc51891b0fab4d1937e47ab | 30 | py | Python | python/testData/completion/className/classReexportedThroughDunderAll/classReexportedThroughDunderAll.after.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/completion/className/classReexportedThroughDunderAll/classReexportedThroughDunderAll.after.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 173 | 2018-07-05T13:59:39.000Z | 2018-08-09T01:12:03.000Z | python/testData/completion/className/classReexportedThroughDunderAll/classReexportedThroughDunderAll.after.py | truthiswill/intellij-community | fff88cfb0dc168eea18ecb745d3e5b93f57b0b95 | [
"Apache-2.0"
] | 2 | 2020-03-15T08:57:37.000Z | 2020-04-07T04:48:14.000Z | from pkg import Foo
foo = Foo | 10 | 19 | 0.733333 | from pkg import Foo
foo = Foo | 0 | 0 | 0 |
0ad67e256b05e78950478a9ce24f27c1a1f5c5e5 | 720 | py | Python | mp4tag.py | mmjakub/desktop-stuff | ec3b4220b3090921891f9b4b0ddf1c6da3a20dab | [
"BSD-2-Clause"
] | null | null | null | mp4tag.py | mmjakub/desktop-stuff | ec3b4220b3090921891f9b4b0ddf1c6da3a20dab | [
"BSD-2-Clause"
] | null | null | null | mp4tag.py | mmjakub/desktop-stuff | ec3b4220b3090921891f9b4b0ddf1c6da3a20dab | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python3
from mutagen.mp4 import MP4, MP4Cover
from pathlib import Path
import re
album_dir = Path('.')
artist, album, date = re.fullmatch('(.+) - (.+) \((\d{4})\)', album_dir.resolve().name).groups()
tracks = [p.name for p in album_dir.glob('*.m4a')]
total_tracks = len(tracks)
with open('cover.jpg', '... | 27.692308 | 96 | 0.605556 | #!/usr/bin/env python3
from mutagen.mp4 import MP4, MP4Cover
from pathlib import Path
import re
album_dir = Path('.')
artist, album, date = re.fullmatch('(.+) - (.+) \((\d{4})\)', album_dir.resolve().name).groups()
tracks = [p.name for p in album_dir.glob('*.m4a')]
total_tracks = len(tracks)
with open('cover.jpg', '... | 0 | 0 | 0 |
9047773d765f8e18169b154cad59fcf6f8dc24bd | 1,230 | py | Python | test/test_huffman.py | sigmavirus24/hyper | 951756c152aac7819b13962e44b62a13de935d6c | [
"MIT"
] | null | null | null | test/test_huffman.py | sigmavirus24/hyper | 951756c152aac7819b13962e44b62a13de935d6c | [
"MIT"
] | null | null | null | test/test_huffman.py | sigmavirus24/hyper | 951756c152aac7819b13962e44b62a13de935d6c | [
"MIT"
] | null | null | null | from hyper.http20.huffman import HuffmanDecoder, HuffmanEncoder
from hyper.http20.huffman_constants import REQUEST_CODES,REQUEST_CODES_LENGTH
| 53.478261 | 100 | 0.699187 | from hyper.http20.huffman import HuffmanDecoder, HuffmanEncoder
from hyper.http20.huffman_constants import REQUEST_CODES,REQUEST_CODES_LENGTH
class TestHuffman(object):
def test_request_huffman_decoder(self):
decoder = HuffmanDecoder(REQUEST_CODES,REQUEST_CODES_LENGTH)
assert decoder.decode(b'\xf1... | 979 | 5 | 103 |
644d5d5dc96d38b85972cfb4b75679f3a7a641f7 | 410 | py | Python | pos_cashbox/models/pos_cashbox_model.py | nahualventure/pos-addons | 3c911c28c259967fb74e311ddcc8e6ca032c005d | [
"MIT"
] | null | null | null | pos_cashbox/models/pos_cashbox_model.py | nahualventure/pos-addons | 3c911c28c259967fb74e311ddcc8e6ca032c005d | [
"MIT"
] | null | null | null | pos_cashbox/models/pos_cashbox_model.py | nahualventure/pos-addons | 3c911c28c259967fb74e311ddcc8e6ca032c005d | [
"MIT"
] | 1 | 2021-09-05T19:44:25.000Z | 2021-09-05T19:44:25.000Z | # Copyright 2018 Dinar Gabbasov <https://it-projects.info/team/GabbasovDinar>
# License MIT (https://opensource.org/licenses/MIT).
from odoo import fields, models
| 29.285714 | 77 | 0.743902 | # Copyright 2018 Dinar Gabbasov <https://it-projects.info/team/GabbasovDinar>
# License MIT (https://opensource.org/licenses/MIT).
from odoo import fields, models
class PosSession(models.Model):
_inherit = "pos.session"
iface_cashdrawer = fields.Boolean(related="config_id.iface_cashdrawer")
proxy_ip = fi... | 23 | 200 | 23 |
3a93cc5e89f1708fdf2b910669b73cae97386ee6 | 349 | py | Python | music_publisher/apps.py | Huanghibo/django-music-publisher | 298fe497670c02951d617aa6b6a6e03995fa6562 | [
"MIT"
] | 1 | 2021-02-28T07:08:13.000Z | 2021-02-28T07:08:13.000Z | music_publisher/apps.py | Huanghibo/django-music-publisher | 298fe497670c02951d617aa6b6a6e03995fa6562 | [
"MIT"
] | null | null | null | music_publisher/apps.py | Huanghibo/django-music-publisher | 298fe497670c02951d617aa6b6a6e03995fa6562 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class MusicPublisherConfig(AppConfig):
"""Configuration for Music Publisher app.
Attributes:
label (str): app label
name (str): app name
verbose_name (str): app verbose name
"""
name = 'music_publisher'
label = 'music_publisher'
verb... | 20.529412 | 45 | 0.659026 | from django.apps import AppConfig
class MusicPublisherConfig(AppConfig):
"""Configuration for Music Publisher app.
Attributes:
label (str): app label
name (str): app name
verbose_name (str): app verbose name
"""
name = 'music_publisher'
label = 'music_publisher'
verb... | 0 | 0 | 0 |
9af52befc6ec4eb123ca08b40e732b8bb446c7c3 | 2,463 | py | Python | data/prepare_data.py | lucasxlu/HMTNet | b66d92d5e408b0525f535f38bdf08ff1749e0152 | [
"MIT"
] | 11 | 2019-10-28T07:47:03.000Z | 2021-11-18T08:22:34.000Z | data/prepare_data.py | lucasxlu/HMTNet | b66d92d5e408b0525f535f38bdf08ff1749e0152 | [
"MIT"
] | 1 | 2020-06-29T20:07:28.000Z | 2020-06-29T21:18:29.000Z | data/prepare_data.py | lucasxlu/HMTNet | b66d92d5e408b0525f535f38bdf08ff1749e0152 | [
"MIT"
] | 3 | 2021-08-28T00:17:17.000Z | 2021-12-22T12:56:08.000Z | """
script for data preprocessing
"""
import os
import shutil
import pandas as pd
from config.cfg import cfg
def process_gender_imgs():
"""
process gender images
:return:
"""
m_filenames, f_filenames = split_by_attribute('gender')
if not os.path.exists(os.path.join(cfg['gender_base_dir'], ... | 31.177215 | 90 | 0.618352 | """
script for data preprocessing
"""
import os
import shutil
import pandas as pd
from config.cfg import cfg
def split_by_attribute(attr_name='gender'):
df = pd.read_csv(cfg['SCUT_FBP5500_csv'], index_col=False, header=None)
genders = df[0].tolist()
races = df[1].tolist()
files = df[2].tolist()
... | 1,045 | 0 | 23 |
37c098152dfb5fd04a8da8575d2352873809d9ab | 991 | py | Python | blingalytics/sources/static.py | ChowNow/blingalytics | a05c866bc0dc7c56b5106c71c12cf10b37c5bae5 | [
"MIT"
] | null | null | null | blingalytics/sources/static.py | ChowNow/blingalytics | a05c866bc0dc7c56b5106c71c12cf10b37c5bae5 | [
"MIT"
] | 1 | 2019-08-16T07:15:42.000Z | 2019-08-16T15:27:18.000Z | blingalytics/sources/static.py | ChowNow/blingalytics | a05c866bc0dc7c56b5106c71c12cf10b37c5bae5 | [
"MIT"
] | 1 | 2017-06-01T23:32:08.000Z | 2017-06-01T23:32:08.000Z | """
The static source provides a column for inserting static data. It's incredibly
simple and not terribly useful, but it can come in handy from time to time.
For example, if you want to fill a column with a 'coming soon...' message, you
could use a static column.
"""
from __future__ import absolute_import
from blinga... | 31.967742 | 78 | 0.705348 | """
The static source provides a column for inserting static data. It's incredibly
simple and not terribly useful, but it can come in handy from time to time.
For example, if you want to fill a column with a 'coming soon...' message, you
could use a static column.
"""
from __future__ import absolute_import
from blinga... | 261 | 54 | 98 |
cef1b9493cfb0d96d975bf4bf6fc16a22fab08db | 287 | py | Python | spacy_transformers/tests/test_serialize.py | KennethEnevoldsen/spacy-transformers | fa39a94ba276ae3681d14a4b376ea50fadd574b3 | [
"MIT"
] | null | null | null | spacy_transformers/tests/test_serialize.py | KennethEnevoldsen/spacy-transformers | fa39a94ba276ae3681d14a4b376ea50fadd574b3 | [
"MIT"
] | null | null | null | spacy_transformers/tests/test_serialize.py | KennethEnevoldsen/spacy-transformers | fa39a94ba276ae3681d14a4b376ea50fadd574b3 | [
"MIT"
] | null | null | null | from spacy_transformers import TransformerData
import srsly
| 28.7 | 53 | 0.770035 | from spacy_transformers import TransformerData
import srsly
def test_serialize_transformer_data():
data = {"x": TransformerData.empty()}
bytes_data = srsly.msgpack_dumps(data)
new_data = srsly.msgpack_loads(bytes_data)
assert isinstance(new_data["x"], TransformerData)
| 203 | 0 | 23 |
b32d535b247943db34704369d83a7c645c1e07b1 | 746 | py | Python | circuitPython/examples/video2/code.py | BRTSG-FOSS/pico-bteve | 1697b9a972ad5e9c2cecca6d560aa16cab725a61 | [
"MIT"
] | 1 | 2022-01-29T03:16:57.000Z | 2022-01-29T03:16:57.000Z | circuitPython/examples/video2/code.py | BRTSG-FOSS/pico-brteve | 1697b9a972ad5e9c2cecca6d560aa16cab725a61 | [
"MIT"
] | 15 | 2021-09-22T08:36:08.000Z | 2022-01-26T08:51:42.000Z | circuitPython/examples/video2/code.py | BRTSG-FOSS/pico-bteve | 1697b9a972ad5e9c2cecca6d560aa16cab725a61 | [
"MIT"
] | null | null | null | """ Video playback from sdcard/pico flash/eve's connected flash example """
import sys
import video2 as demo
if __name__ == "__main__":
sdcard, eve = eve_init()
eve.calibrate()
while 1:
demo.start(sdcard, eve) | 24.866667 | 75 | 0.604558 | """ Video playback from sdcard/pico flash/eve's connected flash example """
import sys
import video2 as demo
def eve_init():
if sys.implementation.name == "circuitpython":
from brteve.brt_eve_bt817_8 import BrtEve
from brteve.brt_eve_rp2040 import BrtEveRP2040
host = BrtEveRP2040()
... | 483 | 0 | 23 |
4f2e3401da1c93d4b3a0a002d02851918ea731e3 | 832 | py | Python | ckan/tests/cli/test_asset.py | Datatourisme/DATAtourisme.ma | 82c3f12ae93cd694fb8c064ea5d1eef4e3a3a21d | [
"Apache-2.0"
] | 2,805 | 2015-01-02T18:13:15.000Z | 2022-03-31T03:35:01.000Z | ckan/tests/cli/test_asset.py | Datatourisme/DATAtourisme.ma | 82c3f12ae93cd694fb8c064ea5d1eef4e3a3a21d | [
"Apache-2.0"
] | 3,801 | 2015-01-02T11:05:36.000Z | 2022-03-31T19:24:37.000Z | ckan/tests/cli/test_asset.py | cascaoSDC/ckan | 75a08caa7c688ce70229dfea7070cc667a15c5e8 | [
"BSD-3-Clause"
] | 1,689 | 2015-01-02T19:46:43.000Z | 2022-03-28T14:59:43.000Z | # -*- coding: utf-8 -*-
from ckan.cli.cli import ckan
def test_build_and_clean(cli, ckan_config, tmpdir, monkeypatch):
"""After build, there are some folders with assets inside
`%(ckan.storage_path)/webassets`. And after cleaning they must
be empty.
"""
monkeypatch.setitem(ckan_config, u'ckan.s... | 29.714286 | 71 | 0.653846 | # -*- coding: utf-8 -*-
from ckan.cli.cli import ckan
def test_build_and_clean(cli, ckan_config, tmpdir, monkeypatch):
"""After build, there are some folders with assets inside
`%(ckan.storage_path)/webassets`. And after cleaning they must
be empty.
"""
monkeypatch.setitem(ckan_config, u'ckan.s... | 0 | 0 | 0 |
5bed003e5482f72fe2beec7a82e961c08d33b7d2 | 341 | py | Python | pydantic_lib/intro_to_pydantic/ex7_export_model.py | Tomas-Tamantini/sexta-do-python | 267402cbf399a9afd1da57200a02d3a90122b452 | [
"MIT"
] | 5 | 2021-04-16T19:13:28.000Z | 2022-03-10T18:54:37.000Z | pydantic_lib/intro_to_pydantic/ex7_export_model.py | Tomas-Tamantini/sexta-do-python | 267402cbf399a9afd1da57200a02d3a90122b452 | [
"MIT"
] | null | null | null | pydantic_lib/intro_to_pydantic/ex7_export_model.py | Tomas-Tamantini/sexta-do-python | 267402cbf399a9afd1da57200a02d3a90122b452 | [
"MIT"
] | 4 | 2021-04-16T17:55:39.000Z | 2021-09-23T21:26:01.000Z | """Pydantic can convert a model instance to a dictionary, or json string"""
from pydantic_lib.utils import Movie
movie = Movie(title='Friday the 13th', year_of_release=1980, rating='R', box_office='U$93M')
movie_as_dict = movie.dict(exclude={'cast'})
movie_as_json = movie.json(exclude={'cast'})
print(movie_as_dict)
... | 31 | 92 | 0.759531 | """Pydantic can convert a model instance to a dictionary, or json string"""
from pydantic_lib.utils import Movie
movie = Movie(title='Friday the 13th', year_of_release=1980, rating='R', box_office='U$93M')
movie_as_dict = movie.dict(exclude={'cast'})
movie_as_json = movie.json(exclude={'cast'})
print(movie_as_dict)
... | 0 | 0 | 0 |
601dbff2d5c2849834f7a05ff2f6cd6d0aa91cf8 | 897 | py | Python | 90/southpark.py | xtakacsx/bitesofpy | 91487cbf58af5eb58a0343ff2231a90c1032acb0 | [
"MIT"
] | 1 | 2020-01-10T00:05:34.000Z | 2020-01-10T00:05:34.000Z | 90/southpark.py | xtakacsx/bitesofpy | 91487cbf58af5eb58a0343ff2231a90c1032acb0 | [
"MIT"
] | null | null | null | 90/southpark.py | xtakacsx/bitesofpy | 91487cbf58af5eb58a0343ff2231a90c1032acb0 | [
"MIT"
] | null | null | null | from collections import Counter, defaultdict
import csv
import requests
CSV_URL = 'https://raw.githubusercontent.com/pybites/SouthParkData/master/by-season/Season-{}.csv' # noqa E501
def get_season_csv_file(season):
"""Receives a season int, and downloads loads in its
corresponding CSV_URL"""
with r... | 33.222222 | 111 | 0.701226 | from collections import Counter, defaultdict
import csv
import requests
CSV_URL = 'https://raw.githubusercontent.com/pybites/SouthParkData/master/by-season/Season-{}.csv' # noqa E501
def get_season_csv_file(season):
"""Receives a season int, and downloads loads in its
corresponding CSV_URL"""
with r... | 0 | 0 | 0 |