hexsha stringlengths 40 40 | size int64 6 1.04M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 247 | max_stars_repo_name stringlengths 4 130 | max_stars_repo_head_hexsha stringlengths 40 78 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 368k ⌀ | max_stars_repo_stars_event_min_datetime stringlengths 24 24 ⌀ | max_stars_repo_stars_event_max_datetime stringlengths 24 24 ⌀ | max_issues_repo_path stringlengths 4 247 | max_issues_repo_name stringlengths 4 130 | max_issues_repo_head_hexsha stringlengths 40 78 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 116k ⌀ | max_issues_repo_issues_event_min_datetime stringlengths 24 24 ⌀ | max_issues_repo_issues_event_max_datetime stringlengths 24 24 ⌀ | max_forks_repo_path stringlengths 4 247 | max_forks_repo_name stringlengths 4 130 | max_forks_repo_head_hexsha stringlengths 40 78 | max_forks_repo_licenses listlengths 1 10 | max_forks_count int64 1 105k ⌀ | max_forks_repo_forks_event_min_datetime stringlengths 24 24 ⌀ | max_forks_repo_forks_event_max_datetime stringlengths 24 24 ⌀ | content stringlengths 1 1.04M | avg_line_length float64 1.53 618k | max_line_length int64 1 1.02M | alphanum_fraction float64 0 1 | original_content stringlengths 6 1.04M | filtered:remove_non_ascii int64 0 538k | filtered:remove_decorators int64 0 917k | filtered:remove_async int64 0 722k | filtered:remove_classes int64 -45 1M | filtered:remove_generators int64 0 814k | filtered:remove_function_no_docstring int64 -102 850k | filtered:remove_class_no_docstring int64 -3 5.46k | filtered:remove_unused_imports int64 -1,350 52.4k | filtered:remove_delete_markers int64 0 59.6k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
56c5e20da2cd5885b05e167a228b34272f42dc84 | 667 | py | Python | anormbookmarker/cli/visualization/sa_display.py | jakeogh/anormbookmarker | d8516cc47dd7e5a5484eb9c1e8f44155b7663897 | [
"MIT"
] | 2 | 2017-05-08T04:44:56.000Z | 2017-08-21T06:41:05.000Z | anormbookmarker/cli/visualization/sa_display.py | jakeogh/anormbookmarker | d8516cc47dd7e5a5484eb9c1e8f44155b7663897 | [
"MIT"
] | null | null | null | anormbookmarker/cli/visualization/sa_display.py | jakeogh/anormbookmarker | d8516cc47dd7e5a5484eb9c1e8f44155b7663897 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
#from kcl.sqlalchemy.model.FileRecord import Filename
#from kcl.sqlalchemy.model.FileRecord import Path
| 35.105263 | 80 | 0.841079 | #!/usr/bin/env python3
import click
from anormbookmarker.model.__model__ import *
from anormbookmarker.model.BookmarkClassConstructor import tagbookmarks_table
from anormbookmarker.model.Word import WordMisSpelling
from anormbookmarker.test.test_enviroment import Tag
from anormbookmarker.test.test_enviroment import Bo... | 0 | 80 | 0 | 0 | 0 | 0 | 0 | 259 | 200 |
9b5abae420a1b31c6db257935b5a0ebcff7174af | 144 | py | Python | post-setup.py | TechWritingWhiz/sovrin-client | b5633dd7767b4aaf08f622181f3937a104b290fb | [
"Apache-2.0"
] | 13 | 2017-02-16T11:45:50.000Z | 2017-06-13T20:07:51.000Z | post-setup.py | TechWritingWhiz/sovrin-client | b5633dd7767b4aaf08f622181f3937a104b290fb | [
"Apache-2.0"
] | 20 | 2017-01-27T14:37:07.000Z | 2017-06-28T10:41:39.000Z | post-setup.py | TechWritingWhiz/sovrin-client | b5633dd7767b4aaf08f622181f3937a104b290fb | [
"Apache-2.0"
] | 57 | 2017-01-21T22:29:27.000Z | 2017-06-29T10:24:19.000Z | import os
from sovrin_common.setup_util import Setup
BASE_DIR = os.path.join(os.path.expanduser("~"), ".sovrin")
Setup(BASE_DIR).setupClient() | 24 | 59 | 0.763889 | import os
from sovrin_common.setup_util import Setup
BASE_DIR = os.path.join(os.path.expanduser("~"), ".sovrin")
Setup(BASE_DIR).setupClient() | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
bdd459bfa527d1b8bc8e4ac5b06b6b88f6c4f534 | 9,573 | py | Python | utils/decode_can_frame.py | FutureInLogistics/moteus | 604799baf4fd6e7a9c9f9eab556596c98c112dc0 | [
"Apache-2.0"
] | null | null | null | utils/decode_can_frame.py | FutureInLogistics/moteus | 604799baf4fd6e7a9c9f9eab556596c98c112dc0 | [
"Apache-2.0"
] | null | null | null | utils/decode_can_frame.py | FutureInLogistics/moteus | 604799baf4fd6e7a9c9f9eab556596c98c112dc0 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python3 -B
# Copyright 2022 Josh Pieper, jjp@pobox.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 a... | 35.194853 | 114 | 0.590306 | #!/usr/bin/python3 -B
# Copyright 2022 Josh Pieper, jjp@pobox.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 a... | 0 | 0 | 0 | 2,124 | 0 | 4,336 | 0 | -24 | 274 |
1d3abc324462f5f95eba1671bf3a643a598d1332 | 1,147 | py | Python | setup.py | danielfeloiola/dpckan | 9aea7aa1d7137dca5adf7ad95d8a6d148ab337e5 | [
"MIT"
] | null | null | null | setup.py | danielfeloiola/dpckan | 9aea7aa1d7137dca5adf7ad95d8a6d148ab337e5 | [
"MIT"
] | null | null | null | setup.py | danielfeloiola/dpckan | 9aea7aa1d7137dca5adf7ad95d8a6d148ab337e5 | [
"MIT"
] | null | null | null | from setuptools import setup, find_packages
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
import package_information
if __name__ == '__main__':
# Setting up
setup(
name=package_information.name,
version=package_information.version,
author=package_information.author,
author_... | 32.771429 | 87 | 0.646905 | from setuptools import setup, find_packages
import codecs
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
import package_information
if __name__ == '__main__':
# Setting up
setup(
name=package_information.name,
version=package_information.version,
author=package_information.author,... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -8 | 22 |
d041bf5d099ae907896e7e3de2df467e151b4282 | 9,392 | py | Python | scripts/main.py | anuprulez/similar_galaxy_workflow | b9771e58ad4e6e5b61909b284d4c7d2645626525 | [
"MIT"
] | 1 | 2020-05-31T14:09:58.000Z | 2020-05-31T14:09:58.000Z | scripts/main.py | anuprulez/similar_galaxy_workflow | b9771e58ad4e6e5b61909b284d4c7d2645626525 | [
"MIT"
] | 3 | 2018-04-23T21:02:21.000Z | 2019-10-18T09:05:02.000Z | scripts/main.py | anuprulez/similar_galaxy_workflow | b9771e58ad4e6e5b61909b284d4c7d2645626525 | [
"MIT"
] | 3 | 2018-03-22T08:54:07.000Z | 2019-07-04T17:00:03.000Z | """
Predict next tools in the Galaxy workflows
using machine learning (recurrent neural network)
"""
import argparse
import time
# machine learning library
import keras.callbacks as callbacks
import extract_workflow_connections
import prepare_data
import utils
if __name__ == "__main__":
start_time = time.time... | 48.412371 | 217 | 0.701874 | """
Predict next tools in the Galaxy workflows
using machine learning (recurrent neural network)
"""
import numpy as np
import argparse
import time
# machine learning library
import tensorflow as tf
from keras import backend as K
import keras.callbacks as callbacks
import extract_workflow_connections
import prepare_... | 0 | 2,549 | 0 | 1,076 | 0 | 0 | 0 | 18 | 189 |
7a29ff1e2d77b9832f3d48ceb56b6ac1578a9d19 | 4,935 | py | Python | faces/challenge.py | paskino/ML-exercises | 6f6586595583c9d85be72944ce8a1a97fdcd0d91 | [
"BSD-3-Clause"
] | null | null | null | faces/challenge.py | paskino/ML-exercises | 6f6586595583c9d85be72944ce8a1a97fdcd0d91 | [
"BSD-3-Clause"
] | 2 | 2018-10-21T15:59:43.000Z | 2019-01-27T15:30:52.000Z | faces/challenge.py | paskino/ML-exercises | 6f6586595583c9d85be72944ce8a1a97fdcd0d91 | [
"BSD-3-Clause"
] | null | null | null | '''
Facial recognition data challenge
Data from Evgueni Ovtchinnikov: https://www.dropbox.com/sh/a62wxyw9fpzwt95/AABJE0CEAtqOuLXKo_sOTFMVa?dl=0
https://github.com/evgueni-ovtchinnikov
1. clean the dataset: select only images with more than one face
2. select 70% train 30% cross validation
'''
import numpy
from funct... | 25.837696 | 105 | 0.593516 | '''
Facial recognition data challenge
Data from Evgueni Ovtchinnikov: https://www.dropbox.com/sh/a62wxyw9fpzwt95/AABJE0CEAtqOuLXKo_sOTFMVa?dl=0
https://github.com/evgueni-ovtchinnikov
1. clean the dataset: select only images with more than one face
2. select 70% train 30% cross validation
'''
import numpy
from funct... | 0 | 0 | 0 | 0 | 0 | 72 | 0 | 0 | 24 |
0566a1f6687a7cb51f4fa8c2b41d58aca8e69435 | 1,458 | py | Python | Cartwheel/lib/Python26/Lib/site-packages/OpenGL/raw/GL/EXT/gpu_program_parameters.py | MontyThibault/centre-of-mass-awareness | 58778f148e65749e1dfc443043e9fc054ca3ff4d | [
"MIT"
] | null | null | null | Cartwheel/lib/Python26/Lib/site-packages/OpenGL/raw/GL/EXT/gpu_program_parameters.py | MontyThibault/centre-of-mass-awareness | 58778f148e65749e1dfc443043e9fc054ca3ff4d | [
"MIT"
] | null | null | null | Cartwheel/lib/Python26/Lib/site-packages/OpenGL/raw/GL/EXT/gpu_program_parameters.py | MontyThibault/centre-of-mass-awareness | 58778f148e65749e1dfc443043e9fc054ca3ff4d | [
"MIT"
] | null | null | null | '''OpenGL extension EXT.gpu_program_parameters
The official definition of this extension is available here:
http://oss.sgi.com/projects/ogl-sample/registry/EXT/gpu_program_parameters.txt
Automatically generated by the get_gl_extensions script, do not edit!
'''
from OpenGL import platform, constants, arrays
from Open... | 40.5 | 119 | 0.793553 | '''OpenGL extension EXT.gpu_program_parameters
The official definition of this extension is available here:
http://oss.sgi.com/projects/ogl-sample/registry/EXT/gpu_program_parameters.txt
Automatically generated by the get_gl_extensions script, do not edit!
'''
from OpenGL import platform, constants, constant, arrays... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 44 |
661a072690780c03ca4e1a7c8536ff9fd3e6b78c | 3,295 | py | Python | unit_tests.py | galnegus/smiley-sentiment | 05210b5a521a10f6346b0a2f7787810c75aeab46 | [
"MIT"
] | null | null | null | unit_tests.py | galnegus/smiley-sentiment | 05210b5a521a10f6346b0a2f7787810c75aeab46 | [
"MIT"
] | null | null | null | unit_tests.py | galnegus/smiley-sentiment | 05210b5a521a10f6346b0a2f7787810c75aeab46 | [
"MIT"
] | null | null | null | import unittest
if __name__ == '__main__':
unittest.main()
| 42.792208 | 158 | 0.750228 | import re, unittest
from feature_reduction import *
class UnitTests(unittest.TestCase):
# user pattern tests
def test_user_pattern_token(self):
replace_test = user_pattern.sub(user_token, '@lololol, h@h@h@ ipsum@dolor.co \'@aaa\'')
replace_answer = user_token + ', h@h@h@ ipsum@dolor.co \'' + user_token + '\''
... | 0 | 0 | 0 | 3,171 | 0 | 0 | 0 | 14 | 45 |
a47c3f87741ef98e7a475ca34e8ea398aab075b3 | 8,051 | py | Python | lisalike.py | geoffrey4444/numerical-orbits | 7b27e9e7e39c4fd38468ce638aa081013da9b19a | [
"MIT"
] | null | null | null | lisalike.py | geoffrey4444/numerical-orbits | 7b27e9e7e39c4fd38468ce638aa081013da9b19a | [
"MIT"
] | null | null | null | lisalike.py | geoffrey4444/numerical-orbits | 7b27e9e7e39c4fd38468ce638aa081013da9b19a | [
"MIT"
] | null | null | null | # Functions relevant for LISA-like orbits
#
# A LISA-like orbit has 3 satellites in a triangular configuration.
# Eccentricity and inclination combine to make the triangle
# tumble with a minimal amount of variation in the arm lengths
# See, e.g., K Rajesh Nayak et al, Class. Quantum Grav. 23, 1763 (2006).
... | 58.34058 | 199 | 0.607378 | # Functions relevant for LISA-like orbits
#
# A LISA-like orbit has 3 satellites in a triangular configuration.
# Eccentricity and inclination combine to make the triangle
# tumble with a minimal amount of variation in the arm lengths
# See, e.g., K Rajesh Nayak et al, Class. Quantum Grav. 23, 1763 (2006).
import mat... | 0 | 0 | 0 | 7,583 | 0 | 0 | 0 | 14 | 112 |
ac6c1fb93062e7b35775300860d24ca6f86363e2 | 2,297 | py | Python | src/MLP/Train_Ann.py | NaskIII/skin-cancer-detection | 74352b4f83531abf87d38b59683b4b3e5e630963 | [
"MIT"
] | 1 | 2021-09-03T21:49:18.000Z | 2021-09-03T21:49:18.000Z | src/MLP/Train_Ann.py | NaskIII/skin-cancer-detection | 74352b4f83531abf87d38b59683b4b3e5e630963 | [
"MIT"
] | null | null | null | src/MLP/Train_Ann.py | NaskIII/skin-cancer-detection | 74352b4f83531abf87d38b59683b4b3e5e630963 | [
"MIT"
] | null | null | null |
if __name__ == '__main__':
ann, model = train_network()
save_ann(ann, model)
| 26.709302 | 121 | 0.56552 | from Neural_Network import Neural_Network
def train_network():
ann = Neural_Network()
datasetTrain, datasetTest = ann.load_data(
r'C:\Users\Raphael Nascimento\PycharmProjects\skin-melanoma-detector\src\Data\Dataset_ISIC_Normalizado.csv', 165)
xTrain = datasetTrain[:, 1:10]
yTrain = datasetTrai... | 6 | 0 | 0 | 0 | 0 | 2,117 | 0 | 20 | 68 |
a13c3c541bbc416cbb9283faa27af5c499b9e5cf | 38,027 | py | Python | 0900-hp/hplip-3.21.12/setup.py | rgfaber/dev-toolkit | b7e6b1e35a4bfb8ca9ba75e5556917cc49b88f7f | [
"Apache-2.0"
] | null | null | null | 0900-hp/hplip-3.21.12/setup.py | rgfaber/dev-toolkit | b7e6b1e35a4bfb8ca9ba75e5556917cc49b88f7f | [
"Apache-2.0"
] | null | null | null | 0900-hp/hplip-3.21.12/setup.py | rgfaber/dev-toolkit | b7e6b1e35a4bfb8ca9ba75e5556917cc49b88f7f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# (c) Copyright 2003-2015 HP Development Company, L.P.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (a... | 40.757771 | 274 | 0.50401 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# (c) Copyright 2003-2015 HP Development Company, L.P.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (a... | 0 | 0 | 0 | 0 | 0 | 139 | 0 | -10 | 150 |
d1025a1b3556bbad21ed260c8b4b790bc9e1dbc7 | 3,573 | py | Python | src/sniffer/pyhttp/link_base.py | ptphp/PyLib | 07ac99cf2deb725475f5771b123b9ea1375f5e65 | [
"Apache-2.0"
] | 1 | 2020-02-17T08:18:29.000Z | 2020-02-17T08:18:29.000Z | src/sniffer/pyhttp/link_base.py | ptphp/PyLib | 07ac99cf2deb725475f5771b123b9ea1375f5e65 | [
"Apache-2.0"
] | null | null | null | src/sniffer/pyhttp/link_base.py | ptphp/PyLib | 07ac99cf2deb725475f5771b123b9ea1375f5e65 | [
"Apache-2.0"
] | null | null | null | #encoding=UTF-8
"""
@author ideawu@163.com
@link http://www.ideawu.net/
"""
LINK_ROLE_SERVER = 1
LINK_ROLE_CLIENT = 2
LINK_ROLE_ACCEPT = 3
| 21.267857 | 61 | 0.676742 | #encoding=UTF-8
"""
@author ideawu@163.com
@link http://www.ideawu.net/
"""
import new, socket
from buffer import *
LINK_ROLE_SERVER = 1
LINK_ROLE_CLIENT = 2
LINK_ROLE_ACCEPT = 3
class LinkBase:
def __init__(self, sock=None):
self.id = -1
self.fd = None
self.sock = None
self.local_addr = '' # ip:port
self.... | 339 | 0 | 0 | 3,257 | 0 | 0 | 0 | -4 | 67 |
c0e07cd719fc06a21624cf9c6db2d171d21959fd | 607 | py | Python | python/lambda-container/app.py | gsy0911/aws-cdk-small-examples | e4b4be076d22f5d35f640e59a6ca346988baa1af | [
"Apache-2.0"
] | 2 | 2021-01-19T18:15:22.000Z | 2021-02-09T22:18:09.000Z | python/lambda-container/app.py | gsy0911/aws-cdk-small-examples | e4b4be076d22f5d35f640e59a6ca346988baa1af | [
"Apache-2.0"
] | 14 | 2020-11-20T01:54:27.000Z | 2021-01-12T08:15:39.000Z | python/lambda-container/app.py | gsy0911/aws-cdk-small-examples | e4b4be076d22f5d35f640e59a6ca346988baa1af | [
"Apache-2.0"
] | null | null | null |
if __name__ == "__main__":
main()
| 20.931034 | 58 | 0.589786 | from aws_cdk import (
aws_lambda as lambda_,
core,
)
class LambdaContainer(core.Stack):
def __init__(self, app: core.App, _id: str):
super().__init__(scope=app, id=_id)
_ = lambda_.DockerImageFunction(
scope=self,
id="container_function",
code=lambda_.D... | 0 | 0 | 0 | 387 | 0 | 71 | 0 | 39 | 68 |
0a55c0267a6b0df8495a0f1eda37bf22b685b699 | 1,145 | py | Python | examples/regime_hmm_backtest.py | zhengshouzhi/qstrader-master | 5dc888f72a2ddde8497ff7ae44af68524ec8696c | [
"MIT"
] | 1 | 2018-08-27T07:44:39.000Z | 2018-08-27T07:44:39.000Z | examples/regime_hmm_backtest.py | zhengshouzhi/qstrader-master | 5dc888f72a2ddde8497ff7ae44af68524ec8696c | [
"MIT"
] | null | null | null | examples/regime_hmm_backtest.py | zhengshouzhi/qstrader-master | 5dc888f72a2ddde8497ff7ae44af68524ec8696c | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from qstrader.risk_manager.example import ExampleRiskManager
import datetime
from qstrader.price_handler.yahoo_daily_csv_bar import YahooDailyCsvBarPriceHandler
from qstrader.compat import queue
# regime_hmm_backtest.py | 39.482759 | 83 | 0.883843 | # -*- coding: utf-8 -*-
from qstrader.risk_manager.example import ExampleRiskManager
import os
import datetime
from qstrader.price_handler.yahoo_daily_csv_bar import YahooDailyCsvBarPriceHandler
from qstrader.compat import queue
# regime_hmm_backtest.py
import datetime
import pickle
import click
import numpy as np
fr... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 482 | 419 |
f7a8e478a2010f9346166267de4ed8b1acb67692 | 1,079 | py | Python | lex2/_intf_matcher.py | DeltaRazero/liblex2-py3 | 1d6fe9f11225a436b842bd41afb6e6675e549f98 | [
"Zlib"
] | 1 | 2022-01-11T17:26:37.000Z | 2022-01-11T17:26:37.000Z | lex2/_intf_matcher.py | DeltaRazero/liblex2-py3 | 1d6fe9f11225a436b842bd41afb6e6675e549f98 | [
"Zlib"
] | 1 | 2021-04-19T20:29:38.000Z | 2021-04-19T20:29:38.000Z | lex2/_intf_matcher.py | DeltaRazero/liblex2-py3 | 1d6fe9f11225a436b842bd41afb6e6675e549f98 | [
"Zlib"
] | null | null | null | """<internal>"""
'''
zlib License
(C) 2020-2021 DeltaRazero
All rights reserved.
'''
# ***************************************************************************************
# ***************************************************************************************
# --- INTERFACE GETTERS --- #
| 21.58 | 89 | 0.47544 | """<internal>"""
'''
zlib License
(C) 2020-2021 DeltaRazero
All rights reserved.
'''
# ***************************************************************************************
class _:
'<imports>'
import abc
from . import textio
from .misc import ptr_t
# *******************************************... | 0 | 516 | 0 | 160 | 0 | 0 | 0 | 0 | 100 |
00d0698c7ee709eb61303e6c5087902ada5c93e0 | 6,673 | py | Python | python/oneflow/test/modules/test_consistent_tensor_ops.py | Panlichen/oneflow | ad93c69c9932e5515aa31fb7f157073708810a3d | [
"Apache-2.0"
] | null | null | null | python/oneflow/test/modules/test_consistent_tensor_ops.py | Panlichen/oneflow | ad93c69c9932e5515aa31fb7f157073708810a3d | [
"Apache-2.0"
] | null | null | null | python/oneflow/test/modules/test_consistent_tensor_ops.py | Panlichen/oneflow | ad93c69c9932e5515aa31fb7f157073708810a3d | [
"Apache-2.0"
] | 1 | 2021-12-15T02:14:49.000Z | 2021-12-15T02:14:49.000Z | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 33.873096 | 86 | 0.677357 | """
Copyright 2020 The OneFlow Authors. All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agr... | 0 | 4,371 | 0 | 61 | 0 | 707 | 0 | 75 | 678 |
0c80e9770f494dc247fc7a3426ed8b1bbc1db38f | 9,854 | py | Python | kerasnn.py | elmadj/tf.flights.delay.nn | 212c6a85552262bc6cdd7e4d611d2a507b6c03a2 | [
"Apache-2.0"
] | null | null | null | kerasnn.py | elmadj/tf.flights.delay.nn | 212c6a85552262bc6cdd7e4d611d2a507b6c03a2 | [
"Apache-2.0"
] | null | null | null | kerasnn.py | elmadj/tf.flights.delay.nn | 212c6a85552262bc6cdd7e4d611d2a507b6c03a2 | [
"Apache-2.0"
] | null | null | null | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import keras as k
from keras.layers import Dense, Activation
from keras.optimizers import SGD
import argparse
from sklearn.preprocessing import StandardScaler
from sklearn.... | 37.9 | 152 | 0.619951 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
import keras as k
from keras.layers import Dense, Dropout, Activation, Concatenate
from keras.optimizers import SGD
import os
import argparse
import shutil
import math
... | 0 | 0 | 0 | 0 | 0 | 3,265 | 0 | 191 | 468 |
f995e7a3b8f9bb10a3d7a7a0d85d4f6b627477bd | 1,140 | py | Python | CodinCloud/app.py | creativcoder/CodinCloud | 3fd45326b2c1d3f6afa9502f373f0ca14d4a5edd | [
"MIT"
] | 1 | 2020-02-28T09:46:54.000Z | 2020-02-28T09:46:54.000Z | CodinCloud/app.py | creativcoder/pyjudge | 3fd45326b2c1d3f6afa9502f373f0ca14d4a5edd | [
"MIT"
] | null | null | null | CodinCloud/app.py | creativcoder/pyjudge | 3fd45326b2c1d3f6afa9502f373f0ca14d4a5edd | [
"MIT"
] | null | null | null | import config
import logging
from flask import Flask
logging.basicConfig(level=logging.DEBUG)
app=Flask(__name__)
app.secret = config.KEY
if __name__=='__main__':
app.run()
| 22.8 | 63 | 0.735965 | import os
import config
import logging
import time
from task_handler import CodeTask
import subprocess
from flask import Flask,request,render_template,url_for,jsonify
logging.basicConfig(level=logging.DEBUG)
app=Flask(__name__)
app.secret = config.KEY
@app.route('/')
def index():
return render_template('index.htm... | 0 | 732 | 0 | 0 | 0 | 0 | 0 | 26 | 203 |
46d1a45812ff03a6562d2f9d405174d1b448a8d4 | 2,365 | py | Python | main.py | mrlevitas/Conference-Central | 9f141629e4a08c5e448f73395020990739ae8fc1 | [
"Apache-2.0"
] | 2 | 2015-07-23T00:50:51.000Z | 2015-11-17T04:46:15.000Z | main.py | mrlevitas/Conference-Central | 9f141629e4a08c5e448f73395020990739ae8fc1 | [
"Apache-2.0"
] | null | null | null | main.py | mrlevitas/Conference-Central | 9f141629e4a08c5e448f73395020990739ae8fc1 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import webapp2
SPEAKER_IDENTIFIER = 1234
app = webapp2.WSGIApplication([
('/crons/set_announcement', SetAnnouncementHandler),
('/tasks/send_confirmation_email', SendConfirmationEmailHandler),
('/tasks/add_featured_speaker', AddFeaturedSpeaker),
], debug=True)
| 35.833333 | 93 | 0.65666 | #!/usr/bin/env python
import webapp2
from google.appengine.api import app_identity
from google.appengine.api import mail
from conference import ConferenceApi
from models import SpeakerDict
import logging
SPEAKER_IDENTIFIER = 1234
class SetAnnouncementHandler(webapp2.RequestHandler):
def get(self):
"""Set ... | 0 | 0 | 0 | 1,830 | 0 | 0 | 0 | 57 | 179 |
4fc38576370f82a0326f5979142443a209bd32d1 | 5,399 | py | Python | service_catalog/models/instance.py | Sispheor/squest | f852fe7986521a9d8cd9fb5eb0b56aa15f22548c | [
"Apache-2.0"
] | 112 | 2021-04-21T08:52:55.000Z | 2022-03-01T15:09:19.000Z | service_catalog/models/instance.py | Sispheor/squest | f852fe7986521a9d8cd9fb5eb0b56aa15f22548c | [
"Apache-2.0"
] | 216 | 2021-04-21T09:06:47.000Z | 2022-03-30T14:21:28.000Z | service_catalog/models/instance.py | Sispheor/squest | f852fe7986521a9d8cd9fb5eb0b56aa15f22548c | [
"Apache-2.0"
] | 21 | 2021-04-20T13:53:54.000Z | 2022-03-30T21:43:04.000Z | import logging
from django_fsm import post_transition
from .state_hooks import HookManager
logger = logging.getLogger(__name__)
post_transition.connect(HookManager.trigger_hook_handler, sender=Instance)
| 36.979452 | 104 | 0.708094 | import logging
from django.utils.translation import ugettext_lazy as _
from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.db import models
from django.db.models.signals import pre_save, post_save
from django.dispatch import receiver
from django_fsm import FSMFiel... | 0 | 1,883 | 0 | 2,809 | 0 | 0 | 0 | 229 | 268 |
2ae5e60208764cccf17d08c4595e35389a7ddf40 | 6,154 | py | Python | pytf/loaders.py | Lothiraldan/pytf | 78165288d11b5eb16878ab035e83ece2c8afe0b2 | [
"MIT"
] | null | null | null | pytf/loaders.py | Lothiraldan/pytf | 78165288d11b5eb16878ab035e83ece2c8afe0b2 | [
"MIT"
] | 1 | 2015-01-25T16:37:09.000Z | 2015-01-25T16:37:09.000Z | pytf/loaders.py | Lothiraldan/pytf | 78165288d11b5eb16878ab035e83ece2c8afe0b2 | [
"MIT"
] | null | null | null |
# Unittest compatibility loader
| 32.052083 | 83 | 0.607085 | import inspect
import unittest
from itertools import product
from functools import partial
from pytf.core import Test
class TestLoader(object):
level = 0
def load_object(self, obj, module):
if inspect.isfunction(obj):
return self._load_function(obj, module)
if inspect.isclass(... | 0 | 549 | 0 | 5,159 | 0 | 198 | 0 | 8 | 203 |
456a5ab7786cbb8846e2cc6043f542e7edcb6720 | 285 | py | Python | day2/day2_part2.py | sharkbound/AdventOfCode2018 | 856b38a3363963f62a4959c2e843128fab9f0d95 | [
"MIT"
] | null | null | null | day2/day2_part2.py | sharkbound/AdventOfCode2018 | 856b38a3363963f62a4959c2e843128fab9f0d95 | [
"MIT"
] | null | null | null | day2/day2_part2.py | sharkbound/AdventOfCode2018 | 856b38a3363963f62a4959c2e843128fab9f0d95 | [
"MIT"
] | null | null | null |
print(*solve([*map(str.rstrip, open('data.txt'))]), sep='')
| 28.5 | 71 | 0.494737 | def solve(ids):
for id1 in ids:
for id2 in ids:
if sum(1 for c1, c2 in zip(id1, id2) if c1 != c2) == 1:
yield from (c1 for c1, c2 in zip(id1, id2) if c1 == c2)
return
print(*solve([*map(str.rstrip, open('data.txt'))]), sep='')
| 0 | 0 | 0 | 0 | 201 | 0 | 0 | 0 | 22 |
abe104f63b8455f7a86c43ecd46b561a70cff5c3 | 2,221 | py | Python | tests/test_tools.py | binking/News_website | 7f1ed5d64e46ab5001660c7efb83419bb603da6f | [
"BSD-3-Clause"
] | null | null | null | tests/test_tools.py | binking/News_website | 7f1ed5d64e46ab5001660c7efb83419bb603da6f | [
"BSD-3-Clause"
] | null | null | null | tests/test_tools.py | binking/News_website | 7f1ed5d64e46ab5001660c7efb83419bb603da6f | [
"BSD-3-Clause"
] | null | null | null |
if __name__=='__main__':
test_cache = TestNewsUrlCache()
test_cache.test_initialization()
test_cache.test_push()
test_cache.test_add_existed_ele()
test_cache.test_full()
test_cache.test_practice()
| 30.013514 | 76 | 0.586222 | from news_website.operations.tools import NewsUrlCache
class TestNewsUrlCache():
def test_initialization(self):
print("test_initialization")
test_size = 10
cache = NewsUrlCache(test_size)
print(cache)
assert '%s' % cache == "The Queue's length is 10, used 0: []"
as... | 0 | 0 | 0 | 1,919 | 0 | 0 | 0 | 33 | 45 |
9c78c6b13f1073b29f683cbc542eacdcd8e88433 | 14,937 | py | Python | tests/test_media.py | flaviocpontes/ffmpy | 0d88bcbeaac71ab9bcc18cdfa5594608d4207c93 | [
"MIT"
] | 1 | 2017-05-23T22:28:03.000Z | 2017-05-23T22:28:03.000Z | tests/test_media.py | flaviocpontes/ffmpy | 0d88bcbeaac71ab9bcc18cdfa5594608d4207c93 | [
"MIT"
] | 1 | 2017-01-23T16:40:42.000Z | 2017-01-23T16:40:42.000Z | tests/test_media.py | flaviocpontes/ffmpymedia | 0d88bcbeaac71ab9bcc18cdfa5594608d4207c93 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
| 57.01145 | 119 | 0.514695 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
from ffmpymedia import __author__, __version__, __copyright__, __package__
from os.path import join as joinpath
import unittest
from ffmpymedia.media import *
from tests import TEST_FILE_PATH
class TestMediaStream(unittest.TestCase):
"""
Testes de criação dos o... | 28 | 0 | 0 | 14,587 | 0 | 0 | 0 | 82 | 205 |
44c52430e10a12b357c944589a34aab4b48be394 | 3,045 | py | Python | metactical/metactical/report/pos_discount_report/pos_discount_report.py | aisenyi/metactical | 30a55f38e48f3f8512e92de370b39cf97f452b1d | [
"MIT"
] | null | null | null | metactical/metactical/report/pos_discount_report/pos_discount_report.py | aisenyi/metactical | 30a55f38e48f3f8512e92de370b39cf97f452b1d | [
"MIT"
] | null | null | null | metactical/metactical/report/pos_discount_report/pos_discount_report.py | aisenyi/metactical | 30a55f38e48f3f8512e92de370b39cf97f452b1d | [
"MIT"
] | null | null | null | # Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
| 28.457944 | 115 | 0.655172 | # Copyright (c) 2013, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.desk.reportview import build_match_conditions
from frappe.utils import flt, cint, getdate, now, date_diff
def e... | 0 | 0 | 0 | 0 | 0 | 2,660 | 0 | 65 | 158 |
4dfc2eeaf0046cbddf4ddc2b70d0587937a5a5af | 1,900 | py | Python | tests/test_plugin.py | Jesse-Weinstein-Zonar/nose-watch | 4aefd6f3a18f079c08aaaf68a2d5099fef374125 | [
"BSD-2-Clause"
] | 43 | 2015-01-19T01:44:42.000Z | 2022-03-26T06:28:22.000Z | tests/test_plugin.py | Jesse-Weinstein-Zonar/nose-watch | 4aefd6f3a18f079c08aaaf68a2d5099fef374125 | [
"BSD-2-Clause"
] | 13 | 2015-02-13T10:09:51.000Z | 2018-10-22T02:23:51.000Z | tests/test_plugin.py | Jesse-Weinstein-Zonar/nose-watch | 4aefd6f3a18f079c08aaaf68a2d5099fef374125 | [
"BSD-2-Clause"
] | 9 | 2015-01-10T18:39:54.000Z | 2020-07-06T19:57:18.000Z | """
Main plugin tests.
.. note:: Please to not run nosetests with this plugin for testing the plugin
itself. Also, mock.patch is not much help here as it would try to mock the
module that would be already imported by nose itself if plugin was installed
globally (it would take module from sys.modules).
"""
| 36.538462 | 79 | 0.637368 | """
Main plugin tests.
.. note:: Please to not run nosetests with this plugin for testing the plugin
itself. Also, mock.patch is not much help here as it would try to mock the
module that would be already imported by nose itself if plugin was installed
globally (it would take module from sys.modules).
"""
imp... | 0 | 0 | 0 | 1,473 | 0 | 0 | 0 | 20 | 89 |
b0bb9729a517899f54ff6b85a33fee32daea063e | 10,198 | py | Python | keg_bouncer/model/mixins.py | level12/keg-bouncer | 87482bfe22b943397765cb661f8088a19afe592b | [
"BSD-3-Clause"
] | null | null | null | keg_bouncer/model/mixins.py | level12/keg-bouncer | 87482bfe22b943397765cb661f8088a19afe592b | [
"BSD-3-Clause"
] | 16 | 2015-12-11T05:05:53.000Z | 2017-04-04T19:01:43.000Z | keg_bouncer/model/mixins.py | level12/keg-bouncer | 87482bfe22b943397765cb661f8088a19afe592b | [
"BSD-3-Clause"
] | 1 | 2016-12-12T22:48:45.000Z | 2016-12-12T22:48:45.000Z | from __future__ import absolute_import
def make_password_mixin(history_entity_mixin=object, crypt_context=None):
"""Returns a mixin that adds password history and utility functions for working with passwords.
:param history_entity_mixin: is an optional mixin to add to the password history entity.
... | 39.835938 | 100 | 0.638655 | from __future__ import absolute_import
from six import text_type
import sqlalchemy as sa
from sqlalchemy.ext.declarative import declared_attr
from sqlalchemy.ext.hybrid import hybrid_property
from sqlalchemy.inspection import inspect
import sqlalchemy.orm as saorm
from . import entities as ents
from . import interfac... | 0 | 3,120 | 0 | 5,438 | 0 | 0 | 0 | 106 | 369 |
b453287cb3674869ddac9c2934a89c666a4bc7f3 | 1,972 | py | Python | ayame/exception.py | hattya/ayame | e8bb2b0ace79cd358b1384270cb9c5e809e12b5d | [
"MIT"
] | 1 | 2022-03-05T03:21:13.000Z | 2022-03-05T03:21:13.000Z | ayame/exception.py | hattya/ayame | e8bb2b0ace79cd358b1384270cb9c5e809e12b5d | [
"MIT"
] | 1 | 2021-08-25T13:41:34.000Z | 2021-08-25T13:41:34.000Z | ayame/exception.py | hattya/ayame | e8bb2b0ace79cd358b1384270cb9c5e809e12b5d | [
"MIT"
] | 1 | 2018-03-04T21:47:27.000Z | 2018-03-04T21:47:27.000Z | #
# ayame.exception
#
# Copyright (c) 2011-2021 Akinori Hattori <hattya@gmail.com>
#
# SPDX-License-Identifier: MIT
#
__all__ = ['AyameError', 'ComponentError', 'ConversionError', 'MarkupError',
'RenderingError', 'ResourceError', 'RouteError', 'ValidationError']
| 22.666667 | 91 | 0.608012 | #
# ayame.exception
#
# Copyright (c) 2011-2021 Akinori Hattori <hattya@gmail.com>
#
# SPDX-License-Identifier: MIT
#
__all__ = ['AyameError', 'ComponentError', 'ConversionError', 'MarkupError',
'RenderingError', 'ResourceError', 'RouteError', 'ValidationError']
class AyameError(Exception):
pass
... | 0 | 0 | 0 | 1,453 | 0 | 0 | 0 | 0 | 230 |
0a81ea0ef6d2d874fd43ce68bdd826f3b73b58b6 | 3,006 | py | Python | run_evaluation.py | Wuqiman/AiriaCvlib_runtime | 8f97d6580f1b7a1ded082e87976d0e77b2269f27 | [
"MIT"
] | 1 | 2021-05-19T09:57:36.000Z | 2021-05-19T09:57:36.000Z | run_evaluation.py | Wuqiman/AiriaCvlib_runtime | 8f97d6580f1b7a1ded082e87976d0e77b2269f27 | [
"MIT"
] | null | null | null | run_evaluation.py | Wuqiman/AiriaCvlib_runtime | 8f97d6580f1b7a1ded082e87976d0e77b2269f27 | [
"MIT"
] | 1 | 2019-08-15T06:17:53.000Z | 2019-08-15T06:17:53.000Z | """
The evaluation entry point for WIDER Challenge 2019: Face Detection Accuracy+Runtime Track.
It will be the entrypoint for the evaluation docker once built.
Basically It downloads a list of images and run the face detector on each image.
Then the runtime and detection output will be reported to the evaluation syste... | 33.032967 | 118 | 0.666334 | """
The evaluation entry point for WIDER Challenge 2019: Face Detection Accuracy+Runtime Track.
It will be the entrypoint for the evaluation docker once built.
Basically It downloads a list of images and run the face detector on each image.
Then the runtime and detection output will be reported to the evaluation syste... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f92d3178700ef76d9de749d4bb2ef55d19985f07 | 2,539 | py | Python | tofnet/data/preprocess.py | victorjoos/tof2net | 068f5f08a241dbfb950251bea52fd9379466bf2f | [
"MIT"
] | null | null | null | tofnet/data/preprocess.py | victorjoos/tof2net | 068f5f08a241dbfb950251bea52fd9379466bf2f | [
"MIT"
] | 8 | 2021-02-02T23:07:37.000Z | 2022-03-12T00:51:26.000Z | tofnet/data/preprocess.py | victorjoos/tof2net | 068f5f08a241dbfb950251bea52fd9379466bf2f | [
"MIT"
] | 2 | 2020-10-01T08:23:24.000Z | 2020-11-09T22:01:47.000Z | import cv2
def normalize(imgs, img_type, **kwargs):
""" Normalizes differently depending on type
"""
if img_type in {"image"}:
return imgs/255.0
elif img_type == "mask" or img_type == "class":
return imgs.long()
elif img_type in {"pcd"}:
imgs = imgs
return imgs
... | 29.870588 | 76 | 0.573848 | import cv2
import torch.nn.functional as F
import torch
import matplotlib.pyplot as plt
import cv2
def predict_preprocess():
def _predict(img, img_type, **kwargs):
if img_type in {"pcd"}:
print(img["shape"])
img = torch.tensor(img["points"])
img[torch.isnan(img)] = 0
... | 0 | 0 | 0 | 0 | 0 | 1,968 | 0 | 0 | 226 |
43c8c8ea95976909f215916195b8c67fbec890a8 | 3,448 | py | Python | idgo_admin/exceptions.py | neogeo-technologies/idgo | 23e028b0d7fb2daf54d7e2954e0cc4d7b9be4210 | [
"Apache-2.0"
] | null | null | null | idgo_admin/exceptions.py | neogeo-technologies/idgo | 23e028b0d7fb2daf54d7e2954e0cc4d7b9be4210 | [
"Apache-2.0"
] | 2 | 2018-09-14T07:12:00.000Z | 2019-11-13T09:32:24.000Z | idgo_admin/exceptions.py | neogeo-technologies/idgo | 23e028b0d7fb2daf54d7e2954e0cc4d7b9be4210 | [
"Apache-2.0"
] | 2 | 2019-03-25T08:27:43.000Z | 2019-10-07T15:25:30.000Z | # Copyright (c) 2017-2021 Neogeo-Technologies.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 26.9375 | 94 | 0.609919 | # Copyright (c) 2017-2021 Neogeo-Technologies.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | 22 | 607 | 0 | 1,825 | 0 | 0 | 0 | 16 | 275 |
81b453cb363394127db235b8f56c45563d8ace14 | 2,744 | py | Python | flask/server.py | Tansatija/GithubArt | 388cdc5fde0b8d0779790bb2a27fb058a953d8ac | [
"MIT"
] | 6 | 2019-05-03T19:15:13.000Z | 2021-09-25T20:12:22.000Z | flask/server.py | DumbMachine/GithubArt | 6b739f8740b886578b9ff165968a9266a23c46cc | [
"MIT"
] | 1 | 2019-05-03T19:05:51.000Z | 2019-05-03T19:05:51.000Z | flask/server.py | Tansatija/GithubArt | 388cdc5fde0b8d0779790bb2a27fb058a953d8ac | [
"MIT"
] | 2 | 2021-04-04T14:35:37.000Z | 2021-07-19T04:31:03.000Z | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Another useless python script
@author: ratin
"""
#TODO: Implement Authentication System
#TODO: Implement feature to save in Mongo the books which are asked often
#TODO: Implement feature to ask for the number of books sent in the API
from flask import Flask
from flask... | 26.133333 | 73 | 0.532434 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Another useless python script
@author: ratin
"""
#TODO: Implement Authentication System
#TODO: Implement feature to save in Mongo the books which are asked often
#TODO: Implement feature to ask for the number of books sent in the API
import datetime
import sys
from js... | 0 | 600 | 0 | 0 | 0 | 0 | 0 | 34 | 134 |
e542e61606991c722a71cb4d4a6ec9c34ef5c089 | 805 | py | Python | trhacknodef.py | trhacknonimous/TRHACKNONdef | 7cf308f3058dacdf821b8a0574469b687ecc6381 | [
"Apache-2.0"
] | 1 | 2021-12-21T12:25:51.000Z | 2021-12-21T12:25:51.000Z | trhacknodef.py | trhacknonimous/TRHACKNONdef | 7cf308f3058dacdf821b8a0574469b687ecc6381 | [
"Apache-2.0"
] | null | null | null | trhacknodef.py | trhacknonimous/TRHACKNONdef | 7cf308f3058dacdf821b8a0574469b687ecc6381 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
#####DONT CHANGE THIS########
######################
### Script By TRHACKNOnimous
### www.memanon.ml
### Don't Change This.!!!
######################
import os
os.system("clear")
os.system("mkdir TRHACKNOnimous")
os.system("mv TRHACKNOnimous/ /storage/emulated/0/")
os.system("c... | 33.541667 | 109 | 0.68323 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#####DONT CHANGE THIS########
######################
### Script By TRHACKNOnimous
### www.memanon.ml
### Don't Change This.!!!
######################
import os
import sys
os.system("clear")
os.system("mkdir TRHACKNOnimous")
os.system("mv TRHACKNOnimous/ /storage/emulated/0/")
o... | 6 | 0 | 0 | 0 | 0 | 0 | 0 | -11 | 22 |
f7bc2a4817d97549ce1f456ae9e4053631da76ca | 4,437 | py | Python | src/convert.py | Yacent/ReactTutorialInPDF | 19ce923f883ddb329f7c8bfa53f60513631b9a6a | [
"MIT"
] | null | null | null | src/convert.py | Yacent/ReactTutorialInPDF | 19ce923f883ddb329f7c8bfa53f60513631b9a6a | [
"MIT"
] | null | null | null | src/convert.py | Yacent/ReactTutorialInPDF | 19ce923f883ddb329f7c8bfa53f60513631b9a6a | [
"MIT"
] | null | null | null | # coding=utf-8
#
# 1.
# 2. ul-list
# 3. ul-list a
import os
import logging
import requests
from weasyprint import HTML
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
# global variable
INDEX_URL = 'https://... | 31.920863 | 86 | 0.57922 | # coding=utf-8
# 实现主要思路
# 1. 获取网页教程的内容
# 2. 获取主页当中的ul-list
# 3. 根据获取的ul-list 当中的a 不断发送请求,获取数据,并写入
import os
import logging
import requests
import pickle
from weasyprint import HTML
from bs4 import BeautifulSoup
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import Des... | 948 | 0 | 0 | 0 | 0 | 0 | 0 | -8 | 23 |
41653f40b4621c9f3cf7ce3238a9ba6174580176 | 11,348 | py | Python | dynadb/urls.py | GPCRmd/GPCRmd | 7dc75359ace4a00c1597bdb7a86ebee17d51f09c | [
"Apache-2.0"
] | 3 | 2019-03-06T13:35:38.000Z | 2020-08-05T15:31:29.000Z | dynadb/urls.py | GPCRmd/GPCRmd | 7dc75359ace4a00c1597bdb7a86ebee17d51f09c | [
"Apache-2.0"
] | null | null | null | dynadb/urls.py | GPCRmd/GPCRmd | 7dc75359ace4a00c1597bdb7a86ebee17d51f09c | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
from django.conf.urls import url, patterns #antes: from django.conf.urls import url,patterns
from django.views.generic import TemplateView
from django.conf import settings
from . import views
from haystack.query import SearchQuerySet
from haystack.views import SearchView
from .forms import Ma... | 79.915493 | 175 | 0.700211 | # -*- coding: utf-8 -*-
from django.conf.urls import url,patterns,include #antes: from django.conf.urls import url,patterns
from django.views.generic import TemplateView
from django.contrib import admin
from django.conf import settings
from . import views
from haystack.query import SearchQuerySet
from haystack.views... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 18 | 22 |
dd87d93ed2081ca8d1584e8406400f689a4774e3 | 34,776 | py | Python | venv/lib/python3.6/site-packages/ansible_collections/cisco/ios/plugins/modules/ios_ospf_interfaces.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 1 | 2020-01-22T13:11:23.000Z | 2020-01-22T13:11:23.000Z | venv/lib/python3.6/site-packages/ansible_collections/cisco/ios/plugins/modules/ios_ospf_interfaces.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | 12 | 2020-02-21T07:24:52.000Z | 2020-04-14T09:54:32.000Z | venv/lib/python3.6/site-packages/ansible_collections/cisco/ios/plugins/modules/ios_ospf_interfaces.py | usegalaxy-no/usegalaxy | 75dad095769fe918eb39677f2c887e681a747f3a | [
"MIT"
] | null | null | null | #!/usr/bin/python
#
# -*- coding: utf-8 -*-
# Copyright 2020 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#############################################
# WARNING #
#############################################
#
# This file is ... | 31.5 | 116 | 0.539913 | #!/usr/bin/python
#
# -*- coding: utf-8 -*-
# Copyright 2020 Red Hat
# GNU General Public License v3.0+
# (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#############################################
# WARNING #
#############################################
#
# This file is ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 14 | 0 |
0eae48e5f8713faeacc100a4a7e5283ac3ec081e | 99 | py | Python | accounts/signals.py | rijalanupraj/halkapan | a1b5964034a4086a890f839ba4d3d2885a54235f | [
"MIT"
] | null | null | null | accounts/signals.py | rijalanupraj/halkapan | a1b5964034a4086a890f839ba4d3d2885a54235f | [
"MIT"
] | null | null | null | accounts/signals.py | rijalanupraj/halkapan | a1b5964034a4086a890f839ba4d3d2885a54235f | [
"MIT"
] | null | null | null | from django.dispatch import Signal
user_logged_in = Signal(providing_args=['instance', 'request'])
| 33 | 63 | 0.79798 | from django.dispatch import Signal
user_logged_in = Signal(providing_args=['instance', 'request'])
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ecbb189108b2c5bba0a3e02d2c409f2c25703ac8 | 1,111 | py | Python | Packs/ExpanseV2/Scripts/ExpanseAggregateAttributionIP/ExpanseAggregateAttributionIP_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 799 | 2016-08-02T06:43:14.000Z | 2022-03-31T11:10:11.000Z | Packs/ExpanseV2/Scripts/ExpanseAggregateAttributionIP/ExpanseAggregateAttributionIP_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 9,317 | 2016-08-07T19:00:51.000Z | 2022-03-31T21:56:04.000Z | Packs/ExpanseV2/Scripts/ExpanseAggregateAttributionIP/ExpanseAggregateAttributionIP_test.py | diCagri/content | c532c50b213e6dddb8ae6a378d6d09198e08fc9f | [
"MIT"
] | 1,297 | 2016-08-04T13:59:00.000Z | 2022-03-31T23:43:06.000Z |
import ExpanseAggregateAttributionIP
INPUT = [
{"src": "1.1.1.1", "count": 2},
{"src_ip": "8.8.8.8"},
{"src": "8.8.8.8", "count": 10}
]
CURRENT = [
{"ip": "1.1.1.1", "sightings": 1, "internal": False}
]
RESULT = [
{"ip": "1.1.1.1", "sightings": 3, "internal": False},
{"ip": "8.8.8.8", "sigh... | 25.25 | 69 | 0.60216 | import demistomock as demisto # noqa
import ExpanseAggregateAttributionIP
INPUT = [
{"src": "1.1.1.1", "count": 2},
{"src_ip": "8.8.8.8"},
{"src": "8.8.8.8", "count": 10}
]
CURRENT = [
{"ip": "1.1.1.1", "sightings": 1, "internal": False}
]
RESULT = [
{"ip": "1.1.1.1", "sightings": 3, "internal... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 30 |
9272b186aad2acbc4661815d4cf0bc2a2b4fbddf | 2,065 | py | Python | models/regression/DeepConvLSTM_2.py | Neronjust2017/keras-project | 919e67e10b0bf518eb9cc63df68c79fe2bb71b36 | [
"Apache-2.0"
] | 2 | 2020-07-07T12:29:02.000Z | 2020-09-16T15:33:02.000Z | models/regression/DeepConvLSTM_2.py | Neronjust2017/keras-project | 919e67e10b0bf518eb9cc63df68c79fe2bb71b36 | [
"Apache-2.0"
] | 1 | 2020-10-04T12:08:27.000Z | 2020-10-05T05:05:39.000Z | models/regression/DeepConvLSTM_2.py | Neronjust2017/keras-project | 919e67e10b0bf518eb9cc63df68c79fe2bb71b36 | [
"Apache-2.0"
] | null | null | null | import tensorflow.keras as keras
| 31.769231 | 77 | 0.48862 | import tensorflow.keras as keras
import tensorflow as tf
class DeepConvLSTM2(keras.Model):
def __init__(self, input_dim, output_dim):
super(DeepConvLSTM2, self).__init__()
self.samples = input_dim[2]
self.channels = input_dim[0]
self.rows = 1
self.cols = input_dim[1]
... | 0 | 0 | 0 | 1,985 | 0 | 0 | 0 | 2 | 45 |
bad8917af68ec43ce71ed92928cbf6cfa3debbb5 | 10,197 | py | Python | primer_evauation.py | eastgenomics/primer_designer | 5332d82a4bf1079c985976a9b7b6a04f9573b38a | [
"MIT"
] | 1 | 2021-03-24T22:33:03.000Z | 2021-03-24T22:33:03.000Z | primer_evauation.py | eastgenomics/primer_designer | 5332d82a4bf1079c985976a9b7b6a04f9573b38a | [
"MIT"
] | 1 | 2021-03-24T22:33:11.000Z | 2021-03-24T22:33:11.000Z | primer_evauation.py | eastgenomics/primer_designer | 5332d82a4bf1079c985976a9b7b6a04f9573b38a | [
"MIT"
] | null | null | null | #!/usr/bin/python
#
#
#
#
# Kim Brugger (21 Oct 2015), contact: kbr@brugger.dk
import sys
import os
import pprint
pp = pprint.PrettyPrinter(indent=4)
import re
FLANK = 500
NR_PRIMERS = 4
ALLOWED_MISMATCHES = 4
MAX_MAPPINGS = 5
MAX_PRODUCT_SIZE = 800
MIN_PRODUCT_SIZE = 120
s... | 29.386167 | 149 | 0.521624 | #!/usr/bin/python
#
#
#
#
# Kim Brugger (21 Oct 2015), contact: kbr@brugger.dk
import sys
import os
import pprint
pp = pprint.PrettyPrinter(indent=4)
import re
FLANK = 500
NR_PRIMERS = 4
ALLOWED_MISMATCHES = 4
MAX_MAPPINGS = 5
MAX_PRODUCT_SIZE = 800
MIN_PRODUCT_SIZE = 120
def c... | 0 | 0 | 0 | 0 | 0 | 9,174 | 0 | 0 | 108 |
468b7ced0e8f8a70318c5c31ab90dbec90b9c0e1 | 6,722 | py | Python | homeassistant/components/kaleidescape/sensor.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 30,023 | 2016-04-13T10:17:53.000Z | 2020-03-02T12:56:31.000Z | homeassistant/components/kaleidescape/sensor.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 24,710 | 2016-04-13T08:27:26.000Z | 2020-03-02T12:59:13.000Z | homeassistant/components/kaleidescape/sensor.py | MrDelik/core | 93a66cc357b226389967668441000498a10453bb | [
"Apache-2.0"
] | 11,956 | 2016-04-13T18:42:31.000Z | 2020-03-02T09:32:12.000Z | """Sensor platform for Kaleidescape integration."""
from __future__ import annotations
from typing import TYPE_CHECKING
from homeassistant.const import PERCENTAGE
from homeassistant.helpers.entity import EntityCategory
if TYPE_CHECKING:
SENSOR_TYPES: tuple[KaleidescapeSensorEntityDescription, ...] = (
Kaleide... | 35.946524 | 85 | 0.717792 | """Sensor platform for Kaleidescape integration."""
from __future__ import annotations
from dataclasses import dataclass
from typing import TYPE_CHECKING
from homeassistant.components.sensor import SensorEntity, SensorEntityDescription
from homeassistant.const import PERCENTAGE
from homeassistant.helpers.entity impo... | 0 | 394 | 344 | 600 | 0 | 0 | 0 | 294 | 341 |
9842462bbceae77c84a005622d5cad9050cc08cf | 9,334 | py | Python | jwtcat.py | xrzhev/jwtcat | 64dde89c2e2e7634d9f5d7bbb5a788952e04e345 | [
"Apache-2.0"
] | 1 | 2021-05-04T22:48:00.000Z | 2021-05-04T22:48:00.000Z | jwtcat.py | FDlucifer/jwtcat | 64dde89c2e2e7634d9f5d7bbb5a788952e04e345 | [
"Apache-2.0"
] | null | null | null | jwtcat.py | FDlucifer/jwtcat | 64dde89c2e2e7634d9f5d7bbb5a788952e04e345 | [
"Apache-2.0"
] | 1 | 2021-08-31T14:24:16.000Z | 2021-08-31T14:24:16.000Z | #!/usr/bin/env python3
# Copyright (C) 2017 - 2020 Alexandre Teyar
# 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 applic... | 29.726115 | 238 | 0.610564 | #!/usr/bin/env python3
# Copyright (C) 2017 - 2020 Alexandre Teyar
# 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 applic... | 3 | 0 | 0 | 0 | 0 | 1,808 | 0 | -21 | 133 |
b330967e3f8aafec1bee4bafd68911efd75bd2be | 4,523 | py | Python | MSI-segmentation/MSI-segmentation_L1.0.py | hanghu1024/MSI-segmentation | fe5082575fb2c06a2baffaf89f6da7627fa165ac | [
"MIT"
] | 4 | 2021-06-22T15:27:02.000Z | 2022-03-05T17:07:31.000Z | MSI-segmentation/MSI-segmentation_L1.0.py | hanghu1024/MSI-segmentation | fe5082575fb2c06a2baffaf89f6da7627fa165ac | [
"MIT"
] | null | null | null | MSI-segmentation/MSI-segmentation_L1.0.py | hanghu1024/MSI-segmentation | fe5082575fb2c06a2baffaf89f6da7627fa165ac | [
"MIT"
] | 1 | 2021-12-07T12:51:45.000Z | 2021-12-07T12:51:45.000Z | #===========================================
# import modules, defs and variables
#===========================================
exec(open("./external.py").read())
exec(open("./defs.py").read())
exec(open("./config.py").read())
print('Finish modules, defs and variables import')
#========================================... | 37.380165 | 144 | 0.605129 | #===========================================
# import modules, defs and variables
#===========================================
exec(open("./external.py").read())
exec(open("./defs.py").read())
exec(open("./config.py").read())
print('Finish modules, defs and variables import')
#========================================... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0717646489a2d80fa3f23fe03a050b78b42cbf8a | 40,498 | py | Python | smhr_session/utils.py | alexji/smhr-session | 98cf3dd5da737752e704cffb005f729dfc2711dd | [
"MIT"
] | null | null | null | smhr_session/utils.py | alexji/smhr-session | 98cf3dd5da737752e704cffb005f729dfc2711dd | [
"MIT"
] | null | null | null | smhr_session/utils.py | alexji/smhr-session | 98cf3dd5da737752e704cffb005f729dfc2711dd | [
"MIT"
] | null | null | null | # coding: utf-8
""" Utility functions for Spectroscopy Made Hard """
__author__ = "Andy Casey <andy@astrowizici.st>"
# Standard library
import logging
from six import string_types
from collections import OrderedDict
try:
from subprocess import getstatusoutput
except ImportError: # python 2
from commands im... | 39.978282 | 133 | 0.593486 | # coding: utf-8
""" Utility functions for Spectroscopy Made Hard """
__author__ = "Andy Casey <andy@astrowizici.st>"
# Standard library
import os
import logging
import platform
import string
import sys
import traceback
import tempfile
from six import string_types
from collections import Counter, OrderedDict
try:
... | 0 | 0 | 0 | 0 | 0 | 9,557 | 0 | 100 | 531 |
b29384389eba26985454f182e28e8d39d6a7b891 | 11,406 | py | Python | InstaCartBasketModel.py | ratdee/god | 3349447ca3a418e94cc53a926c09f091e1720ce6 | [
"MIT"
] | null | null | null | InstaCartBasketModel.py | ratdee/god | 3349447ca3a418e94cc53a926c09f091e1720ce6 | [
"MIT"
] | null | null | null | InstaCartBasketModel.py | ratdee/god | 3349447ca3a418e94cc53a926c09f091e1720ce6 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat May 18 16:04:58 2019
@author: Admin
"""
# -*- coding: utf-8 -*-
"""
Created on Mon July 8 17:30:45 2019
@author: Admin
"""
import pandas as pd
import numpy as np
# reading data
order_products_prior_df = pd.read_csv('order_products_prior.csv',... | 31.421488 | 151 | 0.65299 | # -*- coding: utf-8 -*-
"""
Created on Sat May 18 16:04:58 2019
@author: Admin
"""
# -*- coding: utf-8 -*-
"""
Created on Mon July 8 17:30:45 2019
@author: Admin
"""
import pandas as pd
import numpy as np
# reading data
order_products_prior_df = pd.read_csv('order_products_prior.csv',... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
7fd92d07a2e0b82f1ab5b3fd18e39426450f7bfc | 2,152 | py | Python | week2/day8.py | shaunnorris/aoc2020 | 694b83ba26e0c43b4839affc90e4cfab3debbd07 | [
"MIT"
] | null | null | null | week2/day8.py | shaunnorris/aoc2020 | 694b83ba26e0c43b4839affc90e4cfab3debbd07 | [
"MIT"
] | null | null | null | week2/day8.py | shaunnorris/aoc2020 | 694b83ba26e0c43b4839affc90e4cfab3debbd07 | [
"MIT"
] | null | null | null |
testfile = "day8_test_input.txt"
testdata = load_input_file(testfile)
todaylist = load_input_file("day8input.txt")
part1 = run_commands(todaylist)[0]
print("part1:", part1)
part2 = alter_commands(todaylist)
print("part2:", part2)
| 27.240506 | 75 | 0.574349 | import copy
testfile = "day8_test_input.txt"
def test_load_input_file():
assert len(load_input_file(testfile)) == 9
def load_input_file(target):
outputlist = []
with open(target) as f:
raw_list = [line.strip() for line in f]
for line in raw_list:
outputlist.append(line.split(" "))
... | 0 | 0 | 0 | 0 | 0 | 1,761 | 0 | -10 | 160 |
0d36937846c01413e0090a7643f6609fb8616a0a | 445 | py | Python | Ago-Dic-2019/Luis Llanes/Practica1/ejercicio5-7.py | Arbupa/DAS_Sistemas | 52263ab91436b2e5a24ce6f8493aaa2e2fe92fb1 | [
"MIT"
] | 41 | 2017-09-26T09:36:32.000Z | 2022-03-19T18:05:25.000Z | Ago-Dic-2019/Luis Llanes/Practica1/ejercicio5-7.py | Arbupa/DAS_Sistemas | 52263ab91436b2e5a24ce6f8493aaa2e2fe92fb1 | [
"MIT"
] | 67 | 2017-09-11T05:06:12.000Z | 2022-02-14T04:44:04.000Z | Ago-Dic-2019/Luis Llanes/Practica1/ejercicio5-7.py | Arbupa/DAS_Sistemas | 52263ab91436b2e5a24ce6f8493aaa2e2fe92fb1 | [
"MIT"
] | 210 | 2017-09-01T00:10:08.000Z | 2022-03-19T18:05:12.000Z | Frutas_favoritas = ["Mangos", "Manzanas", "Bananas"]
if("Mangos" in Frutas_favoritas):
print("La neta si me gustan mucho los Manguitos")
if("Cocos" in Frutas_favoritas):
print("En verdad me agradan los cocos")
if("Manzanas" in Frutas_favoritas):
print("Me gustan mucho las manzanas")
if("Kiwis" in Frutas... | 27.8125 | 53 | 0.71236 | Frutas_favoritas = ["Mangos", "Manzanas", "Bananas"]
if("Mangos" in Frutas_favoritas):
print("La neta si me gustan mucho los Manguitos")
if("Cocos" in Frutas_favoritas):
print("En verdad me agradan los cocos")
if("Manzanas" in Frutas_favoritas):
print("Me gustan mucho las manzanas")
if("Kiwis" in Frutas... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
98bebd6603bbed75923ed756d9394c967e7166a2 | 2,430 | py | Python | scrapy/get_enti_and_know.py | LouisYZK/recruitKG | 2f65f005230ea0ca05eb45d9e1e689f83dec2720 | [
"MIT"
] | null | null | null | scrapy/get_enti_and_know.py | LouisYZK/recruitKG | 2f65f005230ea0ca05eb45d9e1e689f83dec2720 | [
"MIT"
] | null | null | null | scrapy/get_enti_and_know.py | LouisYZK/recruitKG | 2f65f005230ea0ca05eb45d9e1e689f83dec2720 | [
"MIT"
] | null | null | null | import sqlite3
import time
"""
Input: doc from zhilian_doc.db
Aim:
get the entities/knowledges in the doc.
store them into entites.json/knowledges.json
entities.json:
{
'name+position':List(entities),
}
konwledges.json:
{
'entity':[
['relation', 'entity'],
...
],
}
"""
headers = {
... | 25.851064 | 139 | 0.617695 | import sqlite3
import requests
import json
import time
"""
Input: doc from zhilian_doc.db
Aim:
get the entities/knowledges in the doc.
store them into entites.json/knowledges.json
entities.json:
{
'name+position':List(entities),
}
konwledges.json:
{
'entity':[
['relation', 'entity'],
..... | 3 | 0 | 0 | 0 | 225 | 1,082 | 0 | -16 | 205 |
438643e5aacef760fca7aa171a129595bcaf3cd1 | 26,276 | py | Python | cit-api/pipeline/migrations/0149_auto_20210416_1946.py | bcgov/CIT | b9db4f169b52e9a6293b3ee1e61935888074215a | [
"Apache-2.0"
] | 10 | 2020-11-12T15:13:40.000Z | 2022-03-05T22:33:08.000Z | cit-api/pipeline/migrations/0149_auto_20210416_1946.py | bcgov/CIT | b9db4f169b52e9a6293b3ee1e61935888074215a | [
"Apache-2.0"
] | 28 | 2020-07-17T16:33:55.000Z | 2022-03-21T16:24:25.000Z | cit-api/pipeline/migrations/0149_auto_20210416_1946.py | bcgov/CIT | b9db4f169b52e9a6293b3ee1e61935888074215a | [
"Apache-2.0"
] | 5 | 2020-11-02T23:39:53.000Z | 2022-03-01T19:09:45.000Z | # Generated by Django 2.2.16 on 2021-04-16 19:46
| 61.106977 | 169 | 0.590463 | # Generated by Django 2.2.16 on 2021-04-16 19:46
from django.db import migrations
def change_status(apps, schema_editor):
ApprovalStatus = apps.get_model("pipeline", "ApprovalStatus")
status = ApprovalStatus.objects.get(status_code="CLOS")
status.status_name = "Closed"
status.save()
def undo_change_... | 0 | 0 | 0 | 25,725 | 0 | 397 | 0 | 11 | 92 |
a3fc35eb5e2380fc537e6fcf21e7f38540d03f6c | 6,045 | py | Python | pylearn2/linear/tests/test_cudnn.py | ikervazquezlopez/Pylearn2 | 2971e8f64374ffde572d4cf967aad5342beaf5e0 | [
"BSD-3-Clause"
] | 2,045 | 2015-01-01T14:07:52.000Z | 2022-03-08T08:56:41.000Z | pylearn2/linear/tests/test_cudnn.py | ikervazquezlopez/Pylearn2 | 2971e8f64374ffde572d4cf967aad5342beaf5e0 | [
"BSD-3-Clause"
] | 305 | 2015-01-02T13:18:24.000Z | 2021-08-20T18:03:28.000Z | pylearn2/linear/tests/test_cudnn.py | ikervazquezlopez/Pylearn2 | 2971e8f64374ffde572d4cf967aad5342beaf5e0 | [
"BSD-3-Clause"
] | 976 | 2015-01-01T17:08:51.000Z | 2022-03-25T19:53:17.000Z | """
Tests for the Cudnn code.
"""
__author__ = "Francesco Visin"
__license__ = "3-clause BSD"
__credits__ = "Francesco Visin"
__maintainer__ = "Lisa Lab"
| 35.769231 | 79 | 0.603309 | """
Tests for the Cudnn code.
"""
__author__ = "Francesco Visin"
__license__ = "3-clause BSD"
__credits__ = "Francesco Visin"
__maintainer__ = "Lisa Lab"
import theano
from theano import tensor
from theano.sandbox.cuda.dnn import dnn_available
from pylearn2.linear.conv2d import Conv2D
from pylearn2.linear.cudnn2d im... | 0 | 0 | 0 | 5,469 | 0 | 0 | 0 | 151 | 269 |
1c3b62adbe33c307499ef5ecfd5530a3a22e0a35 | 10,715 | py | Python | jwplatform/upload.py | jwplayer/jwplayer-py | 2f478550414145e9d36b1cdf901dcf5360f8fe2b | [
"MIT"
] | 37 | 2016-09-14T20:34:42.000Z | 2022-02-15T06:47:21.000Z | jwplatform/upload.py | jwplayer/jwplayer-py | 2f478550414145e9d36b1cdf901dcf5360f8fe2b | [
"MIT"
] | 24 | 2016-11-16T21:36:13.000Z | 2022-02-18T14:37:35.000Z | jwplatform/upload.py | jwplayer/jwplayer-py | 2f478550414145e9d36b1cdf901dcf5360f8fe2b | [
"MIT"
] | 45 | 2016-10-13T08:41:35.000Z | 2022-03-06T02:31:23.000Z |
MAX_PAGE_SIZE = 1000
MIN_PART_SIZE = 5 * 1024 * 1024
UPLOAD_BASE_URL = 'upload.jwplayer.com'
MAX_FILE_SIZE = 25 * 1000 * 1024 * 1024
| 37.996454 | 120 | 0.629585 | import http.client
import logging
import math
import os
from dataclasses import dataclass
from enum import Enum
from hashlib import md5
from urllib.parse import urlparse
MAX_PAGE_SIZE = 1000
MIN_PART_SIZE = 5 * 1024 * 1024
UPLOAD_BASE_URL = 'upload.jwplayer.com'
MAX_FILE_SIZE = 25 * 1000 * 1024 * 1024
class UploadTy... | 0 | 918 | 0 | 8,640 | 0 | 565 | 0 | -6 | 452 |
5449d8703937beaae96be29dfe6aa5cc9777ee9b | 3,352 | py | Python | catalog/cached_templates/templates/users.html.py | nateyj/colonial-heritage | 1c7a4115b7bffed9b00c3375ece1641d308addf2 | [
"Apache-2.0"
] | null | null | null | catalog/cached_templates/templates/users.html.py | nateyj/colonial-heritage | 1c7a4115b7bffed9b00c3375ece1641d308addf2 | [
"Apache-2.0"
] | null | null | null | catalog/cached_templates/templates/users.html.py | nateyj/colonial-heritage | 1c7a4115b7bffed9b00c3375ece1641d308addf2 | [
"Apache-2.0"
] | null | null | null | # -*- coding:ascii -*-
from mako import runtime
UNDEFINED = runtime.UNDEFINED
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 10
_modified_time = 1425177385.390867
_enable_loop = True
_template_filename = '/Users/Nate/chf_dmp/account/templates/users.html'
_template_uri = 'users.html'
_source_encodi... | 36.835165 | 333 | 0.605609 | # -*- coding:ascii -*-
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 10
_modified_time = 1425177385.390867
_enable_loop = True
_template_filename = '/Users/Nate/chf_dmp/account/templates/users.html'
_template_uri = 'users.html... | 0 | 0 | 0 | 0 | 0 | 2,456 | 0 | 29 | 115 |
11d8435c09250104be6bc54f46e1e26899f5e541 | 9,456 | py | Python | server/pages/post/modules/serializer.py | Danutu89/NewApp-V2 | ffec4afc1bd0bb8663584b7baf6c7941b2c3f781 | [
"MIT"
] | 1 | 2020-05-26T20:36:39.000Z | 2020-05-26T20:36:39.000Z | server/pages/post/modules/serializer.py | Danutu89/NewApp-V2 | ffec4afc1bd0bb8663584b7baf6c7941b2c3f781 | [
"MIT"
] | 4 | 2021-03-31T19:47:15.000Z | 2022-03-12T00:31:17.000Z | server/pages/post/modules/serializer.py | Danutu89/NewApp-V2 | ffec4afc1bd0bb8663584b7baf6c7941b2c3f781 | [
"MIT"
] | null | null | null |
PostSchemaOnly = PostSchema(many=False)
| 25.626016 | 179 | 0.552453 | from marshmallow import fields, Schema
from marshmallow_sqlalchemy import SQLAlchemyAutoSchema, ModelSchema
from models import Saved_Posts, Post_Likes, User_Following, User, Post_Info, Post, Post_Tags, Comment_Likes, Reply_Likes
from sqlalchemy import and_
from .utilities import cleanhtml
import re
from app import db
... | 0 | 0 | 0 | 8,633 | 0 | 0 | 0 | 165 | 614 |
a8f8cf8794d61748699f9b0cce01ebd6f5e5d5ae | 1,038 | py | Python | app/v1/views/users.py | codeMarble254/storo-v1 | 6386afe9fc65a9f8fef86677b27d120b24dd6244 | [
"MIT"
] | null | null | null | app/v1/views/users.py | codeMarble254/storo-v1 | 6386afe9fc65a9f8fef86677b27d120b24dd6244 | [
"MIT"
] | null | null | null | app/v1/views/users.py | codeMarble254/storo-v1 | 6386afe9fc65a9f8fef86677b27d120b24dd6244 | [
"MIT"
] | 1 | 2018-12-09T20:43:35.000Z | 2018-12-09T20:43:35.000Z | '''This module manages all user endpoints(signup, login, logout etc)'''
| 35.793103 | 87 | 0.683044 | '''This module manages all user endpoints(signup, login, logout etc)'''
from flask import jsonify, make_response
from flask_restful import Resource
from werkzeug.security import generate_password_hash
from .resources import Initialize
from ..models.user import User
from ..utils.users import Validation
class Signup(R... | 0 | 634 | 0 | 76 | 0 | 0 | 0 | 99 | 156 |
f83dc914f243431baf9956b329f4b58d878d24e1 | 1,232 | py | Python | training.py | Laleee/poke-gan | d93506d249ac37fc971ca6504053a9d3461ebf84 | [
"MIT"
] | 2 | 2021-08-07T17:31:37.000Z | 2021-08-24T11:02:51.000Z | training.py | Laleee/poke-gan | d93506d249ac37fc971ca6504053a9d3461ebf84 | [
"MIT"
] | null | null | null | training.py | Laleee/poke-gan | d93506d249ac37fc971ca6504053a9d3461ebf84 | [
"MIT"
] | null | null | null | import torch
import wandb
MAX_SUMMARY_IMAGES = 4
DEVICE = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
assert torch.cuda.is_available()
# LR = 2e-4
EPOCHS = 100
# BATCH_SIZE = 64
NUM_WORKERS = 4
# LAMBDA_L1 = 100
sweep_config = {
'method': 'bayes', # grid, random
'metric': {
'name':... | 22.4 | 69 | 0.560877 | import torch
import wandb
from Trainer import Trainer
MAX_SUMMARY_IMAGES = 4
DEVICE = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
assert torch.cuda.is_available()
# LR = 2e-4
EPOCHS = 100
# BATCH_SIZE = 64
NUM_WORKERS = 4
# LAMBDA_L1 = 100
sweep_config = {
'method': 'bayes', # grid, random
... | 0 | 0 | 0 | 0 | 0 | 422 | 0 | 6 | 49 |
81c8c30dcc284203bcb75fe068adfc4c4550705e | 8,942 | py | Python | lib/twisted/persisted/styles.py | Kagami/kisa | 2597f67e519b8d66fec2684ff5a7726436bb029b | [
"CC0-1.0"
] | 7 | 2015-04-28T13:26:11.000Z | 2020-02-09T17:01:04.000Z | lib/twisted/persisted/styles.py | Kagami/kisa | 2597f67e519b8d66fec2684ff5a7726436bb029b | [
"CC0-1.0"
] | null | null | null | lib/twisted/persisted/styles.py | Kagami/kisa | 2597f67e519b8d66fec2684ff5a7726436bb029b | [
"CC0-1.0"
] | 3 | 2015-03-10T20:56:17.000Z | 2021-08-21T02:44:24.000Z | # -*- test-case-name: twisted.test.test_persisted -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Different styles of persisted objects.
"""
# System Imports
import types
import copy_reg
import inspect
try:
import cStringIO as StringIO
except ImportError:
import StringIO
# ... | 34 | 148 | 0.630508 | # -*- test-case-name: twisted.test.test_persisted -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Different styles of persisted objects.
"""
# System Imports
import types
import copy_reg
import copy
import inspect
import sys
try:
import cStringIO as StringIO
except ImportError:
... | 0 | 0 | 0 | 4,723 | 0 | 391 | 0 | -8 | 204 |
ab78ba6ea21ee758e3dc2d6ed113494570f40da1 | 423 | py | Python | example_app/urls.py | dxillar/django-nepali-datetime-field | 170109103b6dcbcf3d88e518097638edd8dc92fa | [
"MIT"
] | 2 | 2021-07-27T09:31:20.000Z | 2022-01-22T04:51:11.000Z | example_app/urls.py | dxillar/django-nepali-datetime-field | 170109103b6dcbcf3d88e518097638edd8dc92fa | [
"MIT"
] | 1 | 2021-08-16T09:37:43.000Z | 2021-08-16T11:42:46.000Z | example_app/urls.py | dxillar/django-nepali-datetime-field | 170109103b6dcbcf3d88e518097638edd8dc92fa | [
"MIT"
] | null | null | null | from django.urls import path
from . import views
urlpatterns = [
path('example/', views.ExampleListView.as_view(), name='example_list'),
path('example/create', views.ExampleCreateView.as_view(), name='example_create'),
path('example/<int:pk>/update/', views.ExampleUpdateView.as_view(), name='example_updat... | 38.454545 | 95 | 0.723404 | from django.urls import path
from . import views
urlpatterns = [
path('example/', views.ExampleListView.as_view(), name='example_list'),
path('example/create', views.ExampleCreateView.as_view(), name='example_create'),
path('example/<int:pk>/update/', views.ExampleUpdateView.as_view(), name='example_updat... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
f9accf0185672edab98da0816005b9615b99845e | 1,147 | py | Python | ElectronicCommerce/test_case/models/driver.py | Pactortester/JingDongTestProject | b30bb987db9357f0812be64170c31b10a4cceee0 | [
"MIT"
] | null | null | null | ElectronicCommerce/test_case/models/driver.py | Pactortester/JingDongTestProject | b30bb987db9357f0812be64170c31b10a4cceee0 | [
"MIT"
] | null | null | null | ElectronicCommerce/test_case/models/driver.py | Pactortester/JingDongTestProject | b30bb987db9357f0812be64170c31b10a4cceee0 | [
"MIT"
] | 1 | 2021-09-07T02:06:01.000Z | 2021-09-07T02:06:01.000Z |
# start browser
"""
if __name__ == '__main__':
host_list = {'127.0.0.1:4444': 'internet explorer', '127.0.0.1:5555': 'chrome'}
threads = []
files = range(len(host_list))
for host_name, browser_name in host_list.items():
t = Thread(target=browser, args=(host_name, browser_name))
threa... | 27.97561 | 97 | 0.62075 | from threading import Thread
from selenium.webdriver import Remote
from selenium import webdriver
# start browser
def browser():
# browser (chrome, firefox, ie ...)
driver = webdriver.Chrome()
# driver = webdriver.Ie()
# driver = webdriver.Firefox()
# dc = {'platform': 'ANY', 'browserName': 'chrom... | 0 | 0 | 0 | 0 | 0 | 487 | 0 | 32 | 88 |
e0274a74ce7936e51ee707d9e4845ace56c95ffb | 940 | py | Python | lagom/metric/returns.py | zuoxingdong/lagom | 3b6710804dbc79c6dffb369ac87c68f4055ab6cd | [
"MIT"
] | 383 | 2018-07-11T17:43:10.000Z | 2022-01-24T08:46:23.000Z | lagom/metric/returns.py | LorinChen/lagom | 273bb7f5babb1f250f6dba0b5f62c6614f301719 | [
"MIT"
] | 90 | 2018-07-11T23:51:45.000Z | 2021-12-16T08:56:42.000Z | lagom/metric/returns.py | LorinChen/lagom | 273bb7f5babb1f250f6dba0b5f62c6614f301719 | [
"MIT"
] | 32 | 2018-07-12T18:21:03.000Z | 2021-09-15T05:47:48.000Z | import numpy as np
from lagom.transform import geometric_cumsum
from lagom.utils import numpify
def bootstrapped_returns(gamma, rewards, last_V, reach_terminal):
r"""Return (discounted) accumulated returns with bootstrapping for a
batch of episodic transitions.
Formally, suppose we have all rewar... | 29.375 | 95 | 0.647872 | import numpy as np
from lagom.transform import geometric_cumsum
from lagom.utils import numpify
def returns(gamma, rewards):
return geometric_cumsum(gamma, rewards)[0, :].astype(np.float32)
def bootstrapped_returns(gamma, rewards, last_V, reach_terminal):
r"""Return (discounted) accumulated returns with bo... | 0 | 0 | 0 | 0 | 0 | 76 | 0 | 0 | 23 |
7bb94c472fc1b0918cc565d949b96695ed473f73 | 689 | py | Python | generate_console_data.py | MarioPossamato/MariOver | 088adc0c0c9350b5a426093d2efbfce7edf28b24 | [
"MIT"
] | 14 | 2022-03-06T22:25:44.000Z | 2022-03-22T19:49:20.000Z | generate_console_data.py | MarioPossamato/MariOver | 088adc0c0c9350b5a426093d2efbfce7edf28b24 | [
"MIT"
] | 1 | 2022-03-15T06:28:05.000Z | 2022-03-17T09:33:12.000Z | generate_console_data.py | MarioPossamato/MariOver | 088adc0c0c9350b5a426093d2efbfce7edf28b24 | [
"MIT"
] | 1 | 2022-03-09T09:35:21.000Z | 2022-03-09T09:35:21.000Z | from nintendo.dauth import LATEST_VERSION
username = None
password = None
with open("ConsoleData/8000000000000010", mode="rb") as file:
data = file.read()
username_bytes = bytearray(data[0x00064020:0x00064028])
username_bytes.reverse()
username = "0x" + username_bytes.hex().upper()
password = data[0x00064028:0x00... | 34.45 | 79 | 0.711176 | from nintendo.dauth import LATEST_VERSION
username = None
password = None
with open("ConsoleData/8000000000000010", mode="rb") as file:
data = file.read()
username_bytes = bytearray(data[0x00064020:0x00064028])
username_bytes.reverse()
username = "0x" + username_bytes.hex().upper()
password = data[0x00064028:0x00... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
61734459fe44e90b6292840ec0c69472f8b973e6 | 11,811 | py | Python | ALTANTIS/world/world.py | finnbar/ALTANTIS | 8754fcec1845b9b2dcce478554f25d2a50f873b4 | [
"MIT"
] | null | null | null | ALTANTIS/world/world.py | finnbar/ALTANTIS | 8754fcec1845b9b2dcce478554f25d2a50f873b4 | [
"MIT"
] | null | null | null | ALTANTIS/world/world.py | finnbar/ALTANTIS | 8754fcec1845b9b2dcce478554f25d2a50f873b4 | [
"MIT"
] | 1 | 2020-08-30T16:21:10.000Z | 2020-08-30T16:21:10.000Z | """
Deals with the world map, which submarines explore.
"""
from ALTANTIS.utils.consts import X_LIMIT, Y_LIMIT
from typing import List, Any, Dict
undersea_map = [[Cell() for _ in range(Y_LIMIT)] for _ in range(X_LIMIT)]
def map_to_dict() -> Dict[str, Any]:
"""
Converts our map to dict form. Since each of our... | 39.634228 | 207 | 0.605283 | """
Deals with the world map, which submarines explore.
"""
import string
from functools import reduce
from ALTANTIS.utils.text import list_to_and_separated
from ALTANTIS.utils.direction import reverse_dir, directions
from ALTANTIS.utils.consts import X_LIMIT, Y_LIMIT
from ALTANTIS.world.validators import InValidator,... | 0 | 272 | 0 | 8,941 | 0 | 776 | 0 | 238 | 340 |
e0c510106ef78198473f06da95d40e884b02a014 | 1,961 | py | Python | webapp/app.py | fcalderonnearsoft/Workshop-ML | 3e45ffbd36f1fd54f2f2bb51bf9bce13ecff23ea | [
"MIT"
] | null | null | null | webapp/app.py | fcalderonnearsoft/Workshop-ML | 3e45ffbd36f1fd54f2f2bb51bf9bce13ecff23ea | [
"MIT"
] | null | null | null | webapp/app.py | fcalderonnearsoft/Workshop-ML | 3e45ffbd36f1fd54f2f2bb51bf9bce13ecff23ea | [
"MIT"
] | null | null | null | from flask import Flask
import os
import pickle
app = Flask(__name__)
######## Preparing the Predictor
cur_dir = os.path.dirname(__file__)
clf = pickle.load(open(os.path.join(cur_dir,'pkl_objects/diabetes.pkl'), 'rb'))
if __name__ == '__main__':
app.run(debug=True)
#
#
#2,108,64,30.37974684,156.05... | 33.237288 | 153 | 0.587455 | from flask import Flask, render_template, request
from wtforms import Form, TextAreaField, validators
import os
import pickle
app = Flask(__name__)
######## Preparing the Predictor
cur_dir = os.path.dirname(__file__)
clf = pickle.load(open(os.path.join(cur_dir,'pkl_objects/diabetes.pkl'), 'rb'))
def classify(documen... | 0 | 978 | 0 | 158 | 0 | 314 | 0 | 56 | 114 |
92e9a81f33bc75b1870d7a82ff76972027a6c214 | 485 | py | Python | graph/graph_coloring_tests/test_big_file.py | DariaMinieieva/sudoku_project | acfe6b6ff4e0343ad0dae597e783f9da40a7faee | [
"MIT"
] | 5 | 2021-05-27T09:26:30.000Z | 2021-05-28T10:33:46.000Z | graph/graph_coloring_tests/test_big_file.py | DariaMinieieva/sudoku_project | acfe6b6ff4e0343ad0dae597e783f9da40a7faee | [
"MIT"
] | null | null | null | graph/graph_coloring_tests/test_big_file.py | DariaMinieieva/sudoku_project | acfe6b6ff4e0343ad0dae597e783f9da40a7faee | [
"MIT"
] | 1 | 2021-05-28T08:43:05.000Z | 2021-05-28T08:43:05.000Z | """Module to test graph with maximum size that supports coloring algorithm."""
import sys
import os
from time import time
sys.path.append(os.getcwd())
from graph.graph_coloring import Graph
graph = Graph()
graph.create_graph_from_file('graph/graph_coloring_tests/max_size_graph.txt')
start = time()
colored_vertices... | 23.095238 | 78 | 0.752577 | """Module to test graph with maximum size that supports coloring algorithm."""
import sys
import os
from time import time
sys.path.append(os.getcwd())
from graph.graph_coloring import Graph
graph = Graph()
graph.create_graph_from_file('graph/graph_coloring_tests/max_size_graph.txt')
start = time()
colored_vertices... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
871c6f314ff69142514f2c265c9c846749999e69 | 9,791 | py | Python | figures/EOM/EOM-CoM.py | novarios/Thesis | 55feaec71ec2de255c6df52df5229ddaca10790a | [
"MIT"
] | null | null | null | figures/EOM/EOM-CoM.py | novarios/Thesis | 55feaec71ec2de255c6df52df5229ddaca10790a | [
"MIT"
] | null | null | null | figures/EOM/EOM-CoM.py | novarios/Thesis | 55feaec71ec2de255c6df52df5229ddaca10790a | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
from matplotlib import gridspec
from mpl_toolkits.axes_grid.inset_locator import inset_axes
#majorLocatorX = MultipleLocator(2)
#minorLocatorX = MultipleLocator(1)
#majorLocatorY = MultipleLocator(0.05)
#minorLocatorY = MultipleLocator(0.025)
filename1 = '/home/sam/Documents/thesis/dat... | 33.416382 | 104 | 0.563885 | import sys
import matplotlib
import matplotlib.pyplot as plt
import numpy as np
from matplotlib.ticker import MultipleLocator
from matplotlib import gridspec
from mpl_toolkits.axes_grid.inset_locator import inset_axes
#majorLocatorX = MultipleLocator(2)
#minorLocatorX = MultipleLocator(1)
#majorLocatorY = MultipleLoca... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 6 | 88 |
40fe5bd1f5ac1196ee4058078bdcb72613172419 | 388 | py | Python | exercicios/PycharmProjects/exepython/ex042.py | Ojhowribeiro/PythonProjects | a058c0e090a7b96714bbd942c5c03664e4f3744f | [
"MIT"
] | null | null | null | exercicios/PycharmProjects/exepython/ex042.py | Ojhowribeiro/PythonProjects | a058c0e090a7b96714bbd942c5c03664e4f3744f | [
"MIT"
] | null | null | null | exercicios/PycharmProjects/exepython/ex042.py | Ojhowribeiro/PythonProjects | a058c0e090a7b96714bbd942c5c03664e4f3744f | [
"MIT"
] | null | null | null | r1 = float(input('Primeiro segmento: '))
r2 = float(input('segundo segmento: '))
r3 = float(input('terceiro segmento: '))
if r1 < r2 + r3 and r2 < r1 + r3 and r3 < r1 + r2:
print(' um triangulo:')
if r1 == r2 == r3:
print('Equilatero!')
elif r1 != r2 != r3 != r1:
print('Escaleno!')
else... | 27.714286 | 50 | 0.556701 | r1 = float(input('Primeiro segmento: '))
r2 = float(input('segundo segmento: '))
r3 = float(input('terceiro segmento: '))
if r1 < r2 + r3 and r2 < r1 + r3 and r3 < r1 + r2:
print('É um triangulo:')
if r1 == r2 == r3:
print('Equilatero!')
elif r1 != r2 != r3 != r1:
print('Escaleno!')
els... | 4 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
781de0ee0a125c78df965d3af5495763cc850f0a | 5,227 | py | Python | assignments/assignment2/layers.py | NadyaStrogankova/dlcourse_ai | d03e3123b9f801fa3d801ab08e7327df5d48be43 | [
"MIT"
] | null | null | null | assignments/assignment2/layers.py | NadyaStrogankova/dlcourse_ai | d03e3123b9f801fa3d801ab08e7327df5d48be43 | [
"MIT"
] | null | null | null | assignments/assignment2/layers.py | NadyaStrogankova/dlcourse_ai | d03e3123b9f801fa3d801ab08e7327df5d48be43 | [
"MIT"
] | null | null | null | import numpy as np
def l2_regularization(W, reg_strength):
"""
Computes L2 regularization loss on weights and its gradient
Arguments:
W, np array - weights
reg_strength - float value
Returns:
loss, single value - l2 regularization loss
gradient, np.array same shape as W - gra... | 30.213873 | 109 | 0.619476 | import numpy as np
def l2_regularization(W, reg_strength):
"""
Computes L2 regularization loss on weights and its gradient
Arguments:
W, np array - weights
reg_strength - float value
Returns:
loss, single value - l2 regularization loss
gradient, np.array same shape as W - gra... | 0 | 0 | 0 | 2,808 | 0 | 143 | 0 | 0 | 92 |
15695184dfd4802255290df2638fee74c61572f8 | 6,494 | py | Python | noteshrinker/views.py | rejgan318/noteshrinker-django | 65d32b8c15133bbf37104ba152710b6818ddc573 | [
"MIT"
] | 165 | 2016-09-29T01:32:44.000Z | 2022-03-10T22:36:40.000Z | noteshrinker/views.py | rejgan318/noteshrinker-django | 65d32b8c15133bbf37104ba152710b6818ddc573 | [
"MIT"
] | 8 | 2016-10-26T05:47:17.000Z | 2021-06-27T13:36:25.000Z | noteshrinker/views.py | rejgan318/noteshrinker-django | 65d32b8c15133bbf37104ba152710b6818ddc573 | [
"MIT"
] | 30 | 2016-10-23T23:47:08.000Z | 2021-12-26T11:11:03.000Z |
# TODO: 1. - Make uploaded files save between session using session key
# DONE: 2. - - Don't upload from file extensions
# TODO: 3. shrink - Check for missing params in shrink
# DONE: 4. , PNG_ROOT PDF_ROOT - - Check for PNG_ROOT and PDF_ROOT
# TODO: 5. - Check for maximum filename l... | 42.168831 | 175 | 0.695873 | import json
import os
import random
import string
import zipfile
from django.conf import settings
from django.http import Http404, JsonResponse, HttpResponseBadRequest
from django.http import HttpResponse
from django.shortcuts import render
from django.views.decorators.http import require_POST, require_GET
from django... | 1,222 | 2,392 | 0 | 1,254 | 0 | 976 | 0 | 214 | 515 |
6340455722a0e233ef3782030c5cda6f4f9191ee | 3,304 | py | Python | cortex/fmriprep.py | alebel14/pycortex | c8d75b3108cb981fde88f7ebb70592bd3f69a3ea | [
"BSD-2-Clause"
] | 1 | 2020-09-30T02:11:27.000Z | 2020-09-30T02:11:27.000Z | cortex/fmriprep.py | alebel14/pycortex | c8d75b3108cb981fde88f7ebb70592bd3f69a3ea | [
"BSD-2-Clause"
] | null | null | null | cortex/fmriprep.py | alebel14/pycortex | c8d75b3108cb981fde88f7ebb70592bd3f69a3ea | [
"BSD-2-Clause"
] | 1 | 2019-03-04T02:45:59.000Z | 2019-03-04T02:45:59.000Z | from . import database
import os.path as op
import shutil
from .freesurfer import parse_curv
import numpy as np
def import_subj(subject,
source_dir,
session=None,
sname=None):
"""Imports a subject from fmriprep-output.
See https://fmriprep.readthedocs.io/en/stabl... | 38.870588 | 107 | 0.58414 | from . import database
import os.path as op
import shutil
from .freesurfer import parse_curv
import numpy as np
def import_subj(subject,
source_dir,
session=None,
sname=None):
"""Imports a subject from fmriprep-output.
See https://fmriprep.readthedocs.io/en/stabl... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
02ddb609928a9cb820ef7a22bc662c645b8fa8ed | 1,218 | py | Python | radix/__init__.py | otetard/py-radix | df062a57c8bd6aaafd7f76e16ce4abe5dfbd4b8a | [
"BSD-4-Clause-UC"
] | null | null | null | radix/__init__.py | otetard/py-radix | df062a57c8bd6aaafd7f76e16ce4abe5dfbd4b8a | [
"BSD-4-Clause-UC"
] | null | null | null | radix/__init__.py | otetard/py-radix | df062a57c8bd6aaafd7f76e16ce4abe5dfbd4b8a | [
"BSD-4-Clause-UC"
] | 1 | 2022-03-02T20:26:15.000Z | 2022-03-02T20:26:15.000Z | try:
from ._radix import Radix as _Radix
except Exception as e:
__version__ = '1.0.0'
__all__ = ['Radix']
# This acts as an entrypoint to the underlying object (be it a C
# extension or pure python representation, pickle files will work)
| 30.45 | 66 | 0.646141 | try:
from ._radix import Radix as _Radix
except Exception as e:
from .radix import Radix as _Radix
__version__ = '1.0.0'
__all__ = ['Radix']
# This acts as an entrypoint to the underlying object (be it a C
# extension or pure python representation, pickle files will work)
class Radix(object):
def __init_... | 0 | 0 | 0 | 912 | 0 | 0 | 0 | 13 | 48 |
d4f18ce0ff738c966f1e237beffc9da366e3ae64 | 2,521 | py | Python | python/paddle/hapi/logger.py | TingquanGao/Paddle | 9b1015d90b4d498ab58df7cff2c3ed27863ce970 | [
"Apache-2.0"
] | 10 | 2021-05-12T07:20:32.000Z | 2022-03-04T08:21:56.000Z | python/paddle/hapi/logger.py | AFLee/Paddle | 311b3b44fc7d51d4d66d90ab8a3fc0d42231afda | [
"Apache-2.0"
] | 1 | 2021-01-25T09:40:19.000Z | 2021-01-25T09:40:19.000Z | python/paddle/hapi/logger.py | AFLee/Paddle | 311b3b44fc7d51d4d66d90ab8a3fc0d42231afda | [
"Apache-2.0"
] | 25 | 2019-12-07T02:14:14.000Z | 2021-12-30T06:16:30.000Z | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 35.013889 | 94 | 0.678302 | # Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
810f92db062fdf62ffd23425e50d565e2ea12589 | 10,919 | py | Python | pytorch/torch_train.py | LianShuaiLong/Codebook | fd67440d2de80b48aa90b9f7ea5d459baee0a6d8 | [
"MIT"
] | null | null | null | pytorch/torch_train.py | LianShuaiLong/Codebook | fd67440d2de80b48aa90b9f7ea5d459baee0a6d8 | [
"MIT"
] | null | null | null | pytorch/torch_train.py | LianShuaiLong/Codebook | fd67440d2de80b48aa90b9f7ea5d459baee0a6d8 | [
"MIT"
] | null | null | null | import torch
import torch.nn as nn
import numpy as np
#***************************************************#
criterion = nn.CrossEntropyLoss()
optimizer = torch.optim.Adam(model.parameters(),lr=learning_rate)
device = 'cuda' if torch.cuda.is_available() else 'cpu'
model = model.to(device)
for epoch in range(train_ep... | 34.553797 | 111 | 0.637513 | import torch
import torch.nn as nn
import numpy as np
#********************模型训练*******************************#
criterion = nn.CrossEntropyLoss()
optimizer = torch.optim.Adam(model.parameters(),lr=learning_rate)
device = 'cuda' if torch.cuda.is_available() else 'cpu'
model = model.to(device)
for epoch in range(trai... | 1,713 | 0 | 0 | 2,696 | 0 | 0 | 0 | -1 | 44 |
a2feaa66fb720cdce480b8608dce5a48d06ecb63 | 343 | py | Python | settings.py | AbduazizZiyodov/google-it | 04ead41ebf99991a53816d3a3436bc18200534d9 | [
"MIT"
] | 5 | 2021-07-20T05:53:19.000Z | 2022-01-08T16:39:36.000Z | settings.py | AbduazizZiyodov/google-it | 04ead41ebf99991a53816d3a3436bc18200534d9 | [
"MIT"
] | null | null | null | settings.py | AbduazizZiyodov/google-it | 04ead41ebf99991a53816d3a3436bc18200534d9 | [
"MIT"
] | null | null | null | from os import getenv
from dotenv import load_dotenv
load_dotenv()
BOT_TOKEN = getenv("TELEGRAM_API_TOKEN")
GROUP_CHAT_ID = getenv("GROUP_CHAT_ID")
CHANNEL_NAME = getenv("CHANNEL_NAME")
SUPER_USER_ID = getenv("SUPER_USER_ID") # sudo :)
GOOGLE_API_KEY = getenv('GOOGLE_API_KEY')
CSE_ID = getenv('CSE_ID')
SENTRY_DSN... | 22.866667 | 50 | 0.772595 | from os import getenv
from dotenv import load_dotenv
load_dotenv()
BOT_TOKEN = getenv("TELEGRAM_API_TOKEN")
GROUP_CHAT_ID = getenv("GROUP_CHAT_ID")
CHANNEL_NAME = getenv("CHANNEL_NAME")
SUPER_USER_ID = getenv("SUPER_USER_ID") # sudo :)
GOOGLE_API_KEY = getenv('GOOGLE_API_KEY')
CSE_ID = getenv('CSE_ID')
SENTRY_DSN... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
43c16e1db9a20e1ecc8fe01ebda719c66c84cf46 | 1,514 | py | Python | scripts/move_client.py | stefanyangwang/mycobot_320_moveit | 95912336e921c48b8da37c1a6bd7db30fec0f1db | [
"BSD-2-Clause"
] | null | null | null | scripts/move_client.py | stefanyangwang/mycobot_320_moveit | 95912336e921c48b8da37c1a6bd7db30fec0f1db | [
"BSD-2-Clause"
] | null | null | null | scripts/move_client.py | stefanyangwang/mycobot_320_moveit | 95912336e921c48b8da37c1a6bd7db30fec0f1db | [
"BSD-2-Clause"
] | 1 | 2022-02-12T20:17:28.000Z | 2022-02-12T20:17:28.000Z | #!/usr/bin/env python
import rospy
if __name__ == '__main__':
rospy.init_node('move_client')
result = move_client()
print(result) | 33.644444 | 66 | 0.693527 | #!/usr/bin/env python
import rospy
import actionlib
from mycobot_320_moveit.msg import *
def move_client():
client = actionlib.SimpleActionClient('move', MultiMoveAction)
print("Waiting for the move server ...")
client.wait_for_server()
print("\n --- Server ready --- \n")
goal = MultiMoveGoal()
... | 0 | 0 | 0 | 0 | 0 | 1,279 | 0 | 10 | 67 |
fc74b9577e20bcc629403331623bb4ddb894d484 | 40,036 | py | Python | OLSS/rcv1/ParamChoice/sep_tune.py | zsdlightning/OLSS | 7fc5d8621adfcaab61defb61719b82aeb05cc1b3 | [
"MIT"
] | 1 | 2018-06-29T10:02:29.000Z | 2018-06-29T10:02:29.000Z | OLSS/rcv1/ParamChoice/sep_tune.py | zsdlightning/OLSS | 7fc5d8621adfcaab61defb61719b82aeb05cc1b3 | [
"MIT"
] | null | null | null | OLSS/rcv1/ParamChoice/sep_tune.py | zsdlightning/OLSS | 7fc5d8621adfcaab61defb61719b82aeb05cc1b3 | [
"MIT"
] | null | null | null | #!/bin/python
import os
import sys
import time
import numpy as np
import scipy as sp
from scipy.stats import norm as normal
from scipy.linalg import block_diag
from scipy.sparse import csr_matrix
import scipy.linalg as linalg
from sklearn import metrics
import random
'''
This version deals with sparse features, VW f... | 46.499419 | 183 | 0.496054 | #!/bin/python
import os
import sys
import time
import numpy as np
import scipy as sp
from scipy.stats import norm as normal
from scipy.special import *
from scipy.linalg import block_diag
from scipy.sparse import csr_matrix
import scipy.linalg as linalg
from sklearn import metrics
import random
'''
This version deal... | 0 | 0 | 0 | 33,172 | 0 | 5,919 | 0 | 6 | 297 |
e024297cf1e1ea4f32ebd218843757ebd132b2de | 2,776 | py | Python | src/synapse/azext_synapse/vendored_sdks/azure_synapse/models/livy_request_base.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 2 | 2021-03-24T21:06:20.000Z | 2021-03-24T21:07:58.000Z | src/synapse/azext_synapse/vendored_sdks/azure_synapse/models/livy_request_base.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 3 | 2020-05-27T20:16:26.000Z | 2020-07-23T19:46:49.000Z | src/synapse/azext_synapse/vendored_sdks/azure_synapse/models/livy_request_base.py | Mannan2812/azure-cli-extensions | e2b34efe23795f6db9c59100534a40f0813c3d95 | [
"MIT"
] | 5 | 2020-05-09T17:47:09.000Z | 2020-10-01T19:52:06.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 36.051948 | 76 | 0.568084 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 0 | 0 | 0 | 2,239 | 0 | 0 | 0 | 17 | 46 |
318dbd4cf83ca98be58a194a8c38e90476d92a30 | 2,498 | py | Python | kernel/spectrum.py | glothe/dna-prediction | e5aa45b1e552c7d22f2782928e9cbac1cfdd2222 | [
"MIT"
] | null | null | null | kernel/spectrum.py | glothe/dna-prediction | e5aa45b1e552c7d22f2782928e9cbac1cfdd2222 | [
"MIT"
] | null | null | null | kernel/spectrum.py | glothe/dna-prediction | e5aa45b1e552c7d22f2782928e9cbac1cfdd2222 | [
"MIT"
] | null | null | null |
TRANSLATION = {
"A": "T",
"T": "A",
"C": "G",
"G": "C"
}
| 27.152174 | 103 | 0.548038 | import functools
from collections import Counter
import numpy as np
from numba import njit
from numba.typed import Dict
from tqdm import tqdm
from kernel.utils import memoize_id, normalize_kernel
TRANSLATION = {
"A": "T",
"T": "A",
"C": "G",
"G": "C"
}
@functools.lru_cache(None)
def complement(x:... | 0 | 2,154 | 0 | 0 | 0 | 0 | 0 | 42 | 226 |
eae98172e8895a24f8d31ce413ff2889797337bb | 8,087 | py | Python | tests/test_helper.py | zchvsre/TreeCorr | 825dc0a9d4754f9d98ebcf9c26dee9597915d650 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | tests/test_helper.py | zchvsre/TreeCorr | 825dc0a9d4754f9d98ebcf9c26dee9597915d650 | [
"BSD-2-Clause-FreeBSD"
] | null | null | null | tests/test_helper.py | zchvsre/TreeCorr | 825dc0a9d4754f9d98ebcf9c26dee9597915d650 | [
"BSD-2-Clause-FreeBSD"
] | 1 | 2020-12-14T16:23:33.000Z | 2020-12-14T16:23:33.000Z | # Copyright (c) 2003-2019 by Mike Jarvis
#
# TreeCorr is free software: redistribution and use in source and binary forms,
# with or without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of condi... | 33.83682 | 120 | 0.629034 | # Copyright (c) 2003-2019 by Mike Jarvis
#
# TreeCorr is free software: redistribution and use in source and binary forms,
# with or without modification, are permitted provided that the following
# conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of condi... | 0 | 674 | 0 | 1,646 | 0 | 432 | 0 | -3 | 265 |
365807fa799c620482b02b59ad08f208daa23081 | 671 | py | Python | backend/api/views.py | 50Bytes-dev/vue-test | de1f1aeaabf16d93ee5ba6f0115ef43cb5c0be7b | [
"MIT"
] | null | null | null | backend/api/views.py | 50Bytes-dev/vue-test | de1f1aeaabf16d93ee5ba6f0115ef43cb5c0be7b | [
"MIT"
] | 13 | 2020-01-05T09:01:03.000Z | 2022-02-26T22:01:35.000Z | backend/api/views.py | 50Bytes-dev/vue-test | de1f1aeaabf16d93ee5ba6f0115ef43cb5c0be7b | [
"MIT"
] | null | null | null | from django.views.generic import TemplateView
from django.views.decorators.cache import never_cache
# Serve Vue Application
index_view = never_cache(TemplateView.as_view(template_name='index.html'))
| 26.84 | 74 | 0.752608 | from django.views.generic import TemplateView
from django.views.decorators.cache import never_cache
from rest_framework import viewsets
from .models import *
# Serve Vue Application
index_view = never_cache(TemplateView.as_view(template_name='index.html'))
class PostViewSet(viewsets.ModelViewSet):
"""
API к... | 164 | 0 | 0 | 282 | 0 | 0 | 0 | 14 | 91 |
0c9d7da300296569dd584e6d10e28c99acc205a9 | 535 | py | Python | src/main/python/helloworld.py | martinchapman/tmrweb | 7dbf699d815ac198948778ad9b9fbd371d17c1b3 | [
"MIT"
] | 2 | 2020-09-21T07:53:10.000Z | 2021-07-16T19:36:06.000Z | src/main/python/helloworld.py | martinchapman/tmrweb | 7dbf699d815ac198948778ad9b9fbd371d17c1b3 | [
"MIT"
] | 1 | 2021-08-31T22:25:33.000Z | 2021-08-31T22:25:33.000Z | src/main/python/helloworld.py | martinchapman/tmrweb | 7dbf699d815ac198948778ad9b9fbd371d17c1b3 | [
"MIT"
] | 4 | 2020-05-01T13:08:58.000Z | 2020-05-04T15:07:50.000Z |
helloworld(); | 41.153846 | 228 | 0.700935 | import sys
from pyswip import Prolog
def helloworld():
prolog = Prolog();
prolog.assertz("use_module(library(semweb/turtle))");
prolog.assertz("use_module(library(semweb/rdf_http_plugin))");
prolog.assertz("use_module(library(semweb/rdf_db))");
for soln in prolog.query("rdf_load('https://www.d... | 0 | 0 | 0 | 0 | 0 | 457 | 0 | -7 | 67 |
883871dac04a34651083669b83444bfa65ba822f | 4,492 | py | Python | BusinessCardParser/BusinessCardParser.py | dariangarcia-404/breezy-palm-tree | 4c6403addda32209799fb84be97f1008b823f28f | [
"MIT"
] | null | null | null | BusinessCardParser/BusinessCardParser.py | dariangarcia-404/breezy-palm-tree | 4c6403addda32209799fb84be97f1008b823f28f | [
"MIT"
] | null | null | null | BusinessCardParser/BusinessCardParser.py | dariangarcia-404/breezy-palm-tree | 4c6403addda32209799fb84be97f1008b823f28f | [
"MIT"
] | null | null | null |
DIVIDER = "~" # CONSTANT which defines dividing str between card entries in a file
""" Function starter
* does the heavy lifting (I/O, calling methods)
Input(s): n/a
Output(s): a (dictionary) containing contacts with name (string) as key
Runtime: O(n), n = number of business cards
"""
... | 36.819672 | 104 | 0.563001 | import spacy
import ContactInfo
DIVIDER = "~" # CONSTANT which defines dividing str between card entries in a file
class BusinessCardParser:
def __init__(self):
parse = True # could be used as flag in future dev
""" Function getContactInfo
Input(s): document with text from one b... | 0 | 0 | 0 | 2,566 | 0 | 1,455 | 0 | -12 | 118 |
13526b075b407598c9ed9715d00c04476fd42e21 | 573 | py | Python | tests/test_python_check.py | SoftwareStartups/pygithook | 2fa9186a4b8981cc2926fd49917a52a85a563b82 | [
"MIT"
] | null | null | null | tests/test_python_check.py | SoftwareStartups/pygithook | 2fa9186a4b8981cc2926fd49917a52a85a563b82 | [
"MIT"
] | null | null | null | tests/test_python_check.py | SoftwareStartups/pygithook | 2fa9186a4b8981cc2926fd49917a52a85a563b82 | [
"MIT"
] | null | null | null | """Testsuite for vfgithook.pylint_check"""
from vfgithook import pylint_check
from . import util
# pylint: disable=protected-access
def test_is_python_file(gitrepo):
"""Test pylint_check.is_python_file"""
# Extension
file_a = util.write_file(gitrepo, 'a.py', '')
assert pylint_check._is_python_fil... | 22.92 | 67 | 0.710297 | """Testsuite for vfgithook.pylint_check"""
from vfgithook import pylint_check
from . import util
# pylint: disable=protected-access
def test_is_python_file(gitrepo):
"""Test pylint_check.is_python_file"""
# Extension
file_a = util.write_file(gitrepo, 'a.py', '')
assert pylint_check._is_python_fil... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
9964dfc6eb57f2989b5fa962e1e9f520802f8a82 | 1,542 | py | Python | modules/radiusd.py | dhtech/puppet-modules | a5ddcdc6a01d87052043f075f417e692a26883a8 | [
"BSD-3-Clause"
] | 3 | 2018-10-23T21:14:01.000Z | 2018-11-28T08:55:12.000Z | modules/radiusd.py | dhtech/puppet-modules | a5ddcdc6a01d87052043f075f417e692a26883a8 | [
"BSD-3-Clause"
] | 125 | 2018-10-26T08:35:52.000Z | 2021-11-28T13:18:48.000Z | modules/radiusd.py | dhtech/puppet-modules | a5ddcdc6a01d87052043f075f417e692a26883a8 | [
"BSD-3-Clause"
] | 2 | 2021-11-18T19:09:49.000Z | 2021-11-26T12:56:19.000Z | # Copyright 2018 dhtech
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file
# vim: ts=4: sts=4: sw=4: expandtab
| 30.84 | 57 | 0.661479 | # Copyright 2018 dhtech
#
# Use of this source code is governed by a BSD-style
# license that can be found in the LICENSE file
import lib
def generate(host, *args):
access_node_ips = lib.resolve_nodes_to_ip(
lib.get_nodes_with_layer('access'))
dist_node_ips = lib.resolve_nodes_to_ip(
... | 0 | 0 | 0 | 0 | 0 | 1,343 | 0 | -11 | 45 |
fc93e4b656c844361c9ae7b2fbcaa70e55f59061 | 658 | py | Python | Sentiment.py | Elon-Chan/Sentiment-Analysis | dd7ec0dcdc4944a7366c289707aa46788558e0a2 | [
"MIT"
] | null | null | null | Sentiment.py | Elon-Chan/Sentiment-Analysis | dd7ec0dcdc4944a7366c289707aa46788558e0a2 | [
"MIT"
] | null | null | null | Sentiment.py | Elon-Chan/Sentiment-Analysis | dd7ec0dcdc4944a7366c289707aa46788558e0a2 | [
"MIT"
] | null | null | null | import dash
import dash_core_components as dcc # graphs etc
import dash_html_components as html # tags etc
app = dash.Dash() # dash can combine wth flask
app.layout = html.Div(children=[
dcc.Input(id = "Input", value = "Enter Something", type = "text"),
html.Div(id = "Output")
])
if __name__ == "__ma... | 25.307692 | 68 | 0.699088 | import dash
from dash.dependencies import Input, Output
import dash_core_components as dcc # graphs etc
import dash_html_components as html # tags etc
app = dash.Dash() # dash can combine wth flask
app.layout = html.Div(children=[
dcc.Input(id = "Input", value = "Enter Something", type = "text"),
html.Div(... | 0 | 233 | 0 | 0 | 0 | 0 | 0 | 22 | 48 |
d032a6823e79d63d9ed63bc9a034259c6ad8939d | 71 | py | Python | cachetclient/__init__.py | neutron-ah/cachet-client | ad233e4b3ced956ad698e110ae547ba10d15f9a2 | [
"MIT"
] | null | null | null | cachetclient/__init__.py | neutron-ah/cachet-client | ad233e4b3ced956ad698e110ae547ba10d15f9a2 | [
"MIT"
] | null | null | null | cachetclient/__init__.py | neutron-ah/cachet-client | ad233e4b3ced956ad698e110ae547ba10d15f9a2 | [
"MIT"
] | null | null | null |
___version__ = '3.0.0'
| 17.75 | 46 | 0.746479 | from cachetclient.client import Client # noqa
___version__ = '3.0.0'
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 17 | 30 |
044933f4e745b3f4ae6f65b666a90c8f86de3d53 | 6,160 | py | Python | main/collocation_processor_v2.py | dr1315/Collocation_v2 | b0fceedb4e5dcdd3900e56854435dea48a132642 | [
"MIT"
] | null | null | null | main/collocation_processor_v2.py | dr1315/Collocation_v2 | b0fceedb4e5dcdd3900e56854435dea48a132642 | [
"MIT"
] | null | null | null | main/collocation_processor_v2.py | dr1315/Collocation_v2 | b0fceedb4e5dcdd3900e56854435dea48a132642 | [
"MIT"
] | null | null | null | '''
Main processor for v2 of the collocation between CALIOP and Himawari-8.
'''
import os
if __name__ == '__main__':
import argparse
parser = argparse.ArgumentParser()
parser.add_argument(
"-l",
"--list_of_files",
nargs="?",
type=str,
help="name of .txt file listi... | 44.963504 | 296 | 0.677597 | '''
Main processor for v2 of the collocation between CALIOP and Himawari-8.
'''
import os
import sys
import traceback
from datetime import datetime
from pyhdf.SD import SD, SDC
def log_w_message(message):
dt_now = datetime.now().strftime("%d/%m/%Y %H:%M:%S.%f")
dt_message = f'{dt_now} - {message}'
print(... | 0 | 0 | 0 | 0 | 0 | 4,860 | 0 | -1 | 230 |
4c2fb08ef1f0a5f702a10eed2b5a89ceea0f9097 | 7,534 | py | Python | bitmovin_api_sdk/models/audio_mix_input_stream_channel.py | jaythecaesarean/bitmovin-api-sdk-python | 48166511fcb9082041c552ace55a9b66cc59b794 | [
"MIT"
] | 11 | 2019-07-03T10:41:16.000Z | 2022-02-25T21:48:06.000Z | bitmovin_api_sdk/models/audio_mix_input_stream_channel.py | jaythecaesarean/bitmovin-api-sdk-python | 48166511fcb9082041c552ace55a9b66cc59b794 | [
"MIT"
] | 8 | 2019-11-23T00:01:25.000Z | 2021-04-29T12:30:31.000Z | bitmovin_api_sdk/models/audio_mix_input_stream_channel.py | jaythecaesarean/bitmovin-api-sdk-python | 48166511fcb9082041c552ace55a9b66cc59b794 | [
"MIT"
] | 13 | 2020-01-02T14:58:18.000Z | 2022-03-26T12:10:30.000Z | # coding: utf-8
| 35.706161 | 164 | 0.655296 | # coding: utf-8
from enum import Enum
from six import string_types, iteritems
from bitmovin_api_sdk.common.poscheck import poscheck_model
from bitmovin_api_sdk.models.audio_mix_channel_type import AudioMixChannelType
import pprint
import six
class AudioMixInputStreamChannel(object):
@poscheck_model
def __ini... | 0 | 5,367 | 0 | 1,900 | 0 | 0 | 0 | 94 | 156 |
5ddcb4984ecded396bfad62244969faef3d13010 | 1,342 | py | Python | integrationtest/vm/virtualrouter/suite_teardown.py | sherry546/zstack-woodpecker | 54a37459f2d72ce6820974feaa6eb55772c3d2ce | [
"Apache-2.0"
] | 1 | 2021-03-21T12:41:11.000Z | 2021-03-21T12:41:11.000Z | integrationtest/vm/virtualrouter/suite_teardown.py | sherry546/zstack-woodpecker | 54a37459f2d72ce6820974feaa6eb55772c3d2ce | [
"Apache-2.0"
] | null | null | null | integrationtest/vm/virtualrouter/suite_teardown.py | sherry546/zstack-woodpecker | 54a37459f2d72ce6820974feaa6eb55772c3d2ce | [
"Apache-2.0"
] | 1 | 2017-05-19T06:40:40.000Z | 2017-05-19T06:40:40.000Z | '''
Integration Test Teardown case
@author: Youyk
'''
import zstacklib.utils.linux as linux
import zstacklib.utils.http as http
import zstackwoodpecker.setup_actions as setup_actions
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.clean_util as clean_util
import zstackwoodpecker.test_lib as te... | 33.55 | 116 | 0.777198 | '''
Integration Test Teardown case
@author: Youyk
'''
import zstacklib.utils.linux as linux
import zstacklib.utils.http as http
import zstackwoodpecker.setup_actions as setup_actions
import zstackwoodpecker.test_util as test_util
import zstackwoodpecker.clean_util as clean_util
import zstackwoodpecker.test_lib as te... | 0 | 0 | 0 | 0 | 0 | 895 | 0 | 29 | 45 |
488a4bfce3b9103661a834646b1fcb2c2647966c | 921 | py | Python | setup.py | rhysjaques/ringdown | eca49a2d0da37e4d95e5b2dfa5a454c534e73ebe | [
"MIT"
] | 2 | 2020-11-12T01:51:08.000Z | 2021-08-23T11:47:39.000Z | setup.py | rhysjaques/ringdown | eca49a2d0da37e4d95e5b2dfa5a454c534e73ebe | [
"MIT"
] | null | null | null | setup.py | rhysjaques/ringdown | eca49a2d0da37e4d95e5b2dfa5a454c534e73ebe | [
"MIT"
] | 1 | 2021-01-13T14:35:20.000Z | 2021-01-13T14:35:20.000Z | from setuptools import setup
import os
import re
VERSION_REGEX = re.compile("__version__ = \"(.*?)\"")
CONTENTS = readfile(
os.path.join(
os.path.dirname(os.path.abspath(__file__)),
"ringdown",
"__init__.py"
)
)
VERSION = VERSION_REGEX.findall(CONTENTS)[0]
setup(
name="ringdown",... | 24.236842 | 67 | 0.62975 | from setuptools import setup
import os
import re
def readfile(filename):
with open(filename, encoding="utf-8") as fp:
filecontents = fp.read()
return filecontents
VERSION_REGEX = re.compile("__version__ = \"(.*?)\"")
CONTENTS = readfile(
os.path.join(
os.path.dirname(os.path.abspath(__fi... | 0 | 0 | 0 | 0 | 0 | 108 | 0 | 0 | 23 |
bf2391ee72be3d88acb4bb10c7ed3d06f2f32f68 | 6,756 | py | Python | gradcam.py | Fuchai/pytorch-grad-cam | 0f5f5ff35c029cb3cdc6496fe9e1dfee8a0dc9f5 | [
"MIT"
] | null | null | null | gradcam.py | Fuchai/pytorch-grad-cam | 0f5f5ff35c029cb3cdc6496fe9e1dfee8a0dc9f5 | [
"MIT"
] | null | null | null | gradcam.py | Fuchai/pytorch-grad-cam | 0f5f5ff35c029cb3cdc6496fe9e1dfee8a0dc9f5 | [
"MIT"
] | null | null | null |
import cv2
import numpy as np
from torchvision import models
def deprocess_image(img):
""" see https://github.com/jacobgil/keras-grad-cam/blob/master/grad-cam.py#L65 """
img = img - np.mean(img)
img = img / (np.std(img) + 1e-5)
img = img * 0.1
img = img + 0.5
img = np.clip(img, 0, 1)
... | 32.018957 | 86 | 0.657786 | import argparse
import cv2
import numpy as np
import torch
from torch.autograd import Function
from torchvision import models, transforms
class ModelWrapper:
def __init__(self, model, feature_module):
self.model = model
self.feature_module = feature_module
self.feature_gradients = None
... | 0 | 433 | 0 | 3,417 | 0 | 871 | 0 | 11 | 280 |
dbc09da959b036ed7a75ab06984c4b5d62ed3480 | 116 | py | Python | Python/URI PROBLEMAS/1011 - Esfera.py | guimaraesalves/material-python | d56b6b24ae35a67d394b43cb1ef4420805c7bd9b | [
"MIT"
] | null | null | null | Python/URI PROBLEMAS/1011 - Esfera.py | guimaraesalves/material-python | d56b6b24ae35a67d394b43cb1ef4420805c7bd9b | [
"MIT"
] | null | null | null | Python/URI PROBLEMAS/1011 - Esfera.py | guimaraesalves/material-python | d56b6b24ae35a67d394b43cb1ef4420805c7bd9b | [
"MIT"
] | null | null | null | raio = int(input())
pi = 3.14159
volume = float(4.0 * pi * (raio* raio * raio) / 3)
print("VOLUME = %0.3f" %volume)
| 23.2 | 50 | 0.586207 | raio = int(input())
pi = 3.14159
volume = float(4.0 * pi * (raio* raio * raio) / 3)
print("VOLUME = %0.3f" %volume)
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
53305877f3de42158e7f734b77f6b463c545f540 | 1,299 | py | Python | timsort/timsort_test.py | MercyFlesh/algorithms | d9bfe6c2506c2567632222abc878ebc5f1447aaf | [
"Apache-2.0"
] | 1 | 2021-06-13T11:45:18.000Z | 2021-06-13T11:45:18.000Z | timsort/timsort_test.py | MercyFlesh/algorithms | d9bfe6c2506c2567632222abc878ebc5f1447aaf | [
"Apache-2.0"
] | null | null | null | timsort/timsort_test.py | MercyFlesh/algorithms | d9bfe6c2506c2567632222abc878ebc5f1447aaf | [
"Apache-2.0"
] | null | null | null | import unittest
if __name__ == "__main__":
unittest.main()
| 28.23913 | 94 | 0.568899 | import unittest
import matplotlib
import random
import time
import matplotlib.pyplot as plt
from timsort import Timsort
class timsortTest(unittest.TestCase):
#test time sorting an array of n elements
def test_time_froze(self):
data = []
count = 10000
for _ in range(count):... | 0 | 0 | 0 | 1,077 | 0 | 0 | 0 | -6 | 140 |
36db0b5c6de0ffb70fd5bd57eceeb1e2a475fc0e | 3,831 | py | Python | tests/unit/test_report_options.py | Anselmoo/pandas-profiling | 41ee043175eaa1c5b21fcba178110331adcad713 | [
"MIT"
] | 736 | 2016-01-14T03:36:03.000Z | 2018-01-06T00:56:33.000Z | tests/unit/test_report_options.py | Anselmoo/pandas-profiling | 41ee043175eaa1c5b21fcba178110331adcad713 | [
"MIT"
] | 72 | 2016-01-29T12:08:04.000Z | 2018-01-06T11:18:44.000Z | tests/unit/test_report_options.py | sthagen/pandas-profiling-pandas-profiling | 6fd50055126ebebf74c92c6f908f54fa7cd9c816 | [
"MIT"
] | 108 | 2016-01-14T11:48:18.000Z | 2018-01-02T13:35:10.000Z | import pandas as pd
# Generating dummy data
dummy_bool_data = generate_cat_data_series(pd.Series({True: 82, False: 36}))
dummy_cat_data = generate_cat_data_series(
pd.Series(
{
"Amadeou_plus": 75,
"Beta_front": 50,
"Calciumus": 20,
"Dimitrius": 1,
... | 33.902655 | 88 | 0.683895 | import pandas as pd
import pytest
from pandas_profiling import ProfileReport
# Generating dummy data
def generate_cat_data_series(categories):
dummy_data = []
for cat, i in categories.items():
dummy_data.extend([cat, ] * i) # fmt: skip
return pd.DataFrame({"dummy_cat": dummy_data})
dummy_bool_... | 0 | 2,095 | 0 | 0 | 0 | 816 | 0 | 13 | 248 |
19c0dcfcf71c786d0e728ea04aa90bc833d7ee70 | 353 | py | Python | kubernetes_typed/client/models/v1_subject_access_review_status.py | nikhiljha/kubernetes-typed | 4f4b969aa400c88306f92560e56bda6d19b2a895 | [
"Apache-2.0"
] | 22 | 2020-12-10T13:06:02.000Z | 2022-02-13T21:58:15.000Z | kubernetes_typed/client/models/v1_subject_access_review_status.py | nikhiljha/kubernetes-typed | 4f4b969aa400c88306f92560e56bda6d19b2a895 | [
"Apache-2.0"
] | 4 | 2021-03-08T07:06:12.000Z | 2022-03-29T23:41:45.000Z | kubernetes_typed/client/models/v1_subject_access_review_status.py | nikhiljha/kubernetes-typed | 4f4b969aa400c88306f92560e56bda6d19b2a895 | [
"Apache-2.0"
] | 2 | 2021-09-05T19:18:28.000Z | 2022-03-14T02:56:17.000Z | # Code generated by `typeddictgen`. DO NOT EDIT.
"""V1SubjectAccessReviewStatusDict generated type."""
from typing import TypedDict
V1SubjectAccessReviewStatusDict = TypedDict(
"V1SubjectAccessReviewStatusDict",
{
"allowed": bool,
"denied": bool,
"evaluationError": str,
"reason"... | 23.533333 | 53 | 0.66289 | # Code generated by `typeddictgen`. DO NOT EDIT.
"""V1SubjectAccessReviewStatusDict generated type."""
from typing import TypedDict
V1SubjectAccessReviewStatusDict = TypedDict(
"V1SubjectAccessReviewStatusDict",
{
"allowed": bool,
"denied": bool,
"evaluationError": str,
"reason"... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
387e5fec290d4d08ed77489ba1f209a4ea4dd5b0 | 3,411 | py | Python | cap_extra/recognise.py | Apkawa/simple-captcha-ocr-opencv | b0c20c8cac75feac1d10b21b99629ac5d66cd744 | [
"MIT"
] | 1 | 2015-12-29T09:52:58.000Z | 2015-12-29T09:52:58.000Z | cap_extra/recognise.py | Apkawa/simple-captcha-ocr-opencv | b0c20c8cac75feac1d10b21b99629ac5d66cd744 | [
"MIT"
] | null | null | null | cap_extra/recognise.py | Apkawa/simple-captcha-ocr-opencv | b0c20c8cac75feac1d10b21b99629ac5d66cd744 | [
"MIT"
] | null | null | null | """
Copyright 2011 Dmitry Nikulin
This file is part of Captchure.
Captchure is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later ... | 33.441176 | 85 | 0.625916 | """
Copyright 2011 Dmitry Nikulin
This file is part of Captchure.
Captchure is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later ... | 0 | 0 | 0 | 0 | 0 | 2,431 | 0 | 1 | 250 |
2786aa1d3ee81948426359f764eacbd85e2371ee | 128 | py | Python | src/main.py | pffijt/canopen-project | 08922a7e2ee7ee3f76b0a15e14df40e338c597da | [
"MIT"
] | null | null | null | src/main.py | pffijt/canopen-project | 08922a7e2ee7ee3f76b0a15e14df40e338c597da | [
"MIT"
] | null | null | null | src/main.py | pffijt/canopen-project | 08922a7e2ee7ee3f76b0a15e14df40e338c597da | [
"MIT"
] | null | null | null | import canopen
network = canopen.Network()
network.connect(channel='can0', bustype='socketcan')
node = network.add_node(6, '') | 21.333333 | 52 | 0.742188 | import canopen
network = canopen.Network()
network.connect(channel='can0', bustype='socketcan')
node = network.add_node(6, '') | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
494781a2b687058b1ee71c63ce31988e72495630 | 1,950 | py | Python | tests/direct_modulation.py | curio-sitas/fiber-nlse | 41cda9a85705a5a0a29db1c7ab0cbcd4cca35674 | [
"MIT"
] | null | null | null | tests/direct_modulation.py | curio-sitas/fiber-nlse | 41cda9a85705a5a0a29db1c7ab0cbcd4cca35674 | [
"MIT"
] | null | null | null | tests/direct_modulation.py | curio-sitas/fiber-nlse | 41cda9a85705a5a0a29db1c7ab0cbcd4cca35674 | [
"MIT"
] | null | null | null | #%%
import numpy as np
import sys
import pylab as plt
sys.path.append('../')
# Physical units & constants
nm = 1e-9
ps = 1e-12
km = 1e3
mW = 1e-3
GHz = 1e9
Thz = 1e12
m = 1
W = 1
c = 3e8
# Simulation metrics
N_t = 2000
N_z = 1000
# Physical parameters
# Source
T = 500*ps
= 1550 * nm
P0 = 490 * mW
f0 = 10 * GHz... | 20.744681 | 116 | 0.637949 | #%%
import numpy as np
import sys
import pylab as plt
sys.path.append('../')
from fiber_nlse.fiber_nlse import *
# Physical units & constants
nm = 1e-9
ps = 1e-12
km = 1e3
mW = 1e-3
GHz = 1e9
Thz = 1e12
m = 1
W = 1
c = 3e8
# Simulation metrics
N_t = 2000
N_z = 1000
# Physical parameters
# Source
T = 500*ps
λ =... | 32 | 0 | 0 | 0 | 0 | 0 | 0 | 14 | 23 |
0c92987e9c275e624130aae8842a6cf51f12a3ef | 1,022 | py | Python | ProgramFlow/dictandsets/atrocias_hash.py | kumarvgit/python3 | 318c5e7503fafc9c60082fa123e2930bd82a4ec9 | [
"MIT"
] | null | null | null | ProgramFlow/dictandsets/atrocias_hash.py | kumarvgit/python3 | 318c5e7503fafc9c60082fa123e2930bd82a4ec9 | [
"MIT"
] | null | null | null | ProgramFlow/dictandsets/atrocias_hash.py | kumarvgit/python3 | 318c5e7503fafc9c60082fa123e2930bd82a4ec9 | [
"MIT"
] | null | null | null | data = [
("orange", "a sweet, orange, citrus fruit"),
("apple", "good for making cider"),
("lemon", "a sour, yellow citrus fruit"),
("grape", "a small, sweet fruit growing in bunches"),
("melon", "sweet and juicy"),
]
# Convert to ASCII chars
# print(ord("a"))
# print(ord("b"))
# print(ord("z"))
... | 18.25 | 57 | 0.581213 | data = [
("orange", "a sweet, orange, citrus fruit"),
("apple", "good for making cider"),
("lemon", "a sour, yellow citrus fruit"),
("grape", "a small, sweet fruit growing in bunches"),
("melon", "sweet and juicy"),
]
# Convert to ASCII chars
# print(ord("a"))
# print(ord("b"))
# print(ord("z"))
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8878ea06ed16bfc83674cc952a9a3d0d1d2ecfa0 | 198,392 | py | Python | temporary/ferc_util_prep.py | mdbartos/RIPS | ab654138ccdcd8cb7c4ab53092132e0156812e95 | [
"MIT"
] | 1 | 2021-04-02T03:05:55.000Z | 2021-04-02T03:05:55.000Z | temporary/ferc_util_prep.py | mdbartos/RIPS | ab654138ccdcd8cb7c4ab53092132e0156812e95 | [
"MIT"
] | 2 | 2015-05-13T23:35:43.000Z | 2015-05-22T00:51:23.000Z | temporary/ferc_util_prep.py | mdbartos/RIPS | ab654138ccdcd8cb7c4ab53092132e0156812e95 | [
"MIT"
] | 2 | 2015-05-13T23:29:03.000Z | 2015-05-21T22:50:15.000Z | import numpy as np
import pandas as pd
import os
import datetime
homedir = os.path.expanduser('~')
datadir = 'github/RIPS_kircheis/data/eia_form_714/processed/'
fulldir = homedir + '/' + datadir
# li = []
# for d1 in os.listdir('.'):
# for fn in os.listdir('./%s' % d1):
# li.append(fn)
# dir_u = pd.Seri... | 91.005505 | 379 | 0.591062 | import numpy as np
import pandas as pd
import os
import datetime
homedir = os.path.expanduser('~')
datadir = 'github/RIPS_kircheis/data/eia_form_714/processed/'
fulldir = homedir + '/' + datadir
# li = []
# for d1 in os.listdir('.'):
# for fn in os.listdir('./%s' % d1):
# li.append(fn)
# dir_u = pd.Seri... | 0 | 0 | 0 | 0 | 0 | 6,648 | 0 | 0 | 58 |
1b8521730032e7c2ffb0cc02b2601ecc37bd48c9 | 287 | py | Python | Chapter06/ex6_4.py | MJC-code/thinkpython | c92702b64a174e85294b17d8bed870977007842b | [
"Unlicense"
] | null | null | null | Chapter06/ex6_4.py | MJC-code/thinkpython | c92702b64a174e85294b17d8bed870977007842b | [
"Unlicense"
] | null | null | null | Chapter06/ex6_4.py | MJC-code/thinkpython | c92702b64a174e85294b17d8bed870977007842b | [
"Unlicense"
] | null | null | null |
print (is_power(16, 2))
print (is_power(17, 2))
print (is_power(1, 1))
print (is_power(0, 0))
print (is_power(-8 , -2))
print (is_power(-27, -3))
| 17.9375 | 31 | 0.554007 | def is_power(a, b):
if a == b:
return True
elif a % b != 0:
return False
else:
return is_power(a/b, b)
print (is_power(16, 2))
print (is_power(17, 2))
print (is_power(1, 1))
print (is_power(0, 0))
print (is_power(-8 , -2))
print (is_power(-27, -3))
| 0 | 0 | 0 | 0 | 0 | 117 | 0 | 0 | 22 |
d973fd1fe77b39f7ee1f99bab397580e0c606b2c | 8,433 | py | Python | components/cronet/android/test/javaperftests/run.py | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 76 | 2020-09-02T03:05:41.000Z | 2022-03-30T04:40:55.000Z | components/cronet/android/test/javaperftests/run.py | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 45 | 2020-09-02T03:21:37.000Z | 2022-03-31T22:19:45.000Z | components/cronet/android/test/javaperftests/run.py | zealoussnow/chromium | fd8a8914ca0183f0add65ae55f04e287543c7d4a | [
"BSD-3-Clause-No-Nuclear-License-2014",
"BSD-3-Clause"
] | 8 | 2020-07-22T18:49:18.000Z | 2022-02-08T10:27:16.000Z | #!/usr/bin/env python
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This script runs an automated Cronet performance benchmark.
This script:
1. Sets up "USB reverse tethering" which allow network tra... | 37.986486 | 80 | 0.748725 | #!/usr/bin/env python
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""This script runs an automated Cronet performance benchmark.
This script:
1. Sets up "USB reverse tethering" which allow network tra... | 0 | 0 | 0 | 3,136 | 0 | 2,509 | 0 | 138 | 535 |