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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
d7e636d3d64063bcb97ad001385d2875f365c42a | 1,419 | py | Python | effective_python/metaclass_property/confirm_subclass.py | ftconan/python3 | eb63ba33960072f792ecce6db809866b38c402f8 | [
"MIT"
] | 1 | 2018-12-19T22:07:56.000Z | 2018-12-19T22:07:56.000Z | effective_python/metaclass_property/confirm_subclass.py | ftconan/python3 | eb63ba33960072f792ecce6db809866b38c402f8 | [
"MIT"
] | 12 | 2020-03-14T05:32:26.000Z | 2022-03-12T00:08:49.000Z | effective_python/metaclass_property/confirm_subclass.py | ftconan/python3 | eb63ba33960072f792ecce6db809866b38c402f8 | [
"MIT"
] | 1 | 2018-12-19T22:08:00.000Z | 2018-12-19T22:08:00.000Z | """
@author: magician
@file: confirm_subclass.py
@date: 2020/1/14
"""
if __name__ == '__main__':
print('Before Class')
try:
except Exception as e:
print(e)
print('After Class')
| 18.192308 | 58 | 0.538407 | """
@author: magician
@file: confirm_subclass.py
@date: 2020/1/14
"""
class Meta(type):
"""
Meta
"""
def __new__(meta, name, bases, class_dict):
print(meta, name, bases, class_dict)
return type.__new__(meta, name, bases, class_dict)
class MyClass(object, metaclass=Meta):
"""... | 0 | 58 | 0 | 1,004 | 0 | 0 | 0 | 0 | 145 |
243cd76a122be32db8b6099cc8850f0875085453 | 2,309 | py | Python | Geometry/ForwardCommonData/python/testForwardXML_cfi.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 1 | 2021-11-30T16:24:46.000Z | 2021-11-30T16:24:46.000Z | Geometry/ForwardCommonData/python/testForwardXML_cfi.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 4 | 2021-11-29T13:57:56.000Z | 2022-03-29T06:28:36.000Z | Geometry/ForwardCommonData/python/testForwardXML_cfi.py | PKUfudawei/cmssw | 8fbb5ce74398269c8a32956d7c7943766770c093 | [
"Apache-2.0"
] | 1 | 2022-02-27T06:12:26.000Z | 2022-02-27T06:12:26.000Z | import FWCore.ParameterSet.Config as cms
XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource",
geomXMLFiles = cms.vstring(
'Geometry/CMSCommonData/data/materials/2021/v3/materials.xml',
'Geometry/CMSCommonData/data/rotations.xml',
'Geometry/CMSCommonData/data/extend/v3/cmsexte... | 56.317073 | 82 | 0.728021 | import FWCore.ParameterSet.Config as cms
XMLIdealGeometryESSource = cms.ESSource("XMLIdealGeometryESSource",
geomXMLFiles = cms.vstring(
'Geometry/CMSCommonData/data/materials/2021/v3/materials.xml',
'Geometry/CMSCommonData/data/rotations.xml',
'Geometry/CMSCommonData/data/extend/v3/cmsexte... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
dbeafa580c18ce1f9935d21c5c0dd724455a6ada | 12,269 | py | Python | wbb/utils/dbfunctions.py | sppidy/WilliamButcherBot | 8cbd1593dd44a5384f7b1c4d630aa65271282e3e | [
"MIT"
] | null | null | null | wbb/utils/dbfunctions.py | sppidy/WilliamButcherBot | 8cbd1593dd44a5384f7b1c4d630aa65271282e3e | [
"MIT"
] | null | null | null | wbb/utils/dbfunctions.py | sppidy/WilliamButcherBot | 8cbd1593dd44a5384f7b1c4d630aa65271282e3e | [
"MIT"
] | null | null | null | """
MIT License
Copyright (c) 2021 TheHamkerCat
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, ... | 24.735887 | 78 | 0.615291 | """
MIT License
Copyright (c) 2021 TheHamkerCat
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, ... | 0 | 0 | 9,652 | 0 | 0 | 0 | 0 | 15 | 1,011 |
49de79cb6c84fe14e0275dff4c478a1045fd3ede | 1,308 | py | Python | explicalib/calibration/evaluation/diagrams/discrete_diagrams.py | euranova/estimating_eces | 9bfa81dd7a39ebe069c5b11b8e7a9bf9017e9350 | [
"MIT"
] | 2 | 2021-11-30T18:44:11.000Z | 2021-11-30T18:44:19.000Z | explicalib/calibration/evaluation/diagrams/discrete_diagrams.py | euranova/estimating_eces | 9bfa81dd7a39ebe069c5b11b8e7a9bf9017e9350 | [
"MIT"
] | null | null | null | explicalib/calibration/evaluation/diagrams/discrete_diagrams.py | euranova/estimating_eces | 9bfa81dd7a39ebe069c5b11b8e7a9bf9017e9350 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
@author: nicolas.posocco
"""
| 39.636364 | 113 | 0.703364 | # -*- coding: utf-8 -*-
"""
@author: nicolas.posocco
"""
from sklearn.calibration import calibration_curve
import numpy as np
def reliability_diagram(label_of_interest, scores, n_bins):
# label_of_interest
assert type(label_of_interest) is np.ndarray, \
"label_of_interest should be an np.ndarray, not... | 0 | 0 | 0 | 0 | 0 | 1,157 | 0 | 25 | 68 |
12561c7b297f03c8a4ed8c22313832ae6dd69b64 | 815 | py | Python | src/aoikfiletypeasso/sac.py | AoiKuiyuyou/AoikWinFileTypeAsso | 294570f729660b7f374ec6c128c9644b8f0eace0 | [
"MIT"
] | 3 | 2016-09-24T16:01:05.000Z | 2020-06-16T07:40:14.000Z | src/aoikfiletypeasso/sac.py | AoiKuiyuyou/AoikFileTypeAsso | 294570f729660b7f374ec6c128c9644b8f0eace0 | [
"MIT"
] | null | null | null | src/aoikfiletypeasso/sac.py | AoiKuiyuyou/AoikFileTypeAsso | 294570f729660b7f374ec6c128c9644b8f0eace0 | [
"MIT"
] | null | null | null | # coding: utf-8
#
# File name "sac" means "SHCNE_ASSOCCHANGED" used at 4xc5k9H.
#
from __future__ import absolute_import
import sys
#/
if __name__ == '__main__':
sys.exit(main())
| 19.404762 | 89 | 0.650307 | # coding: utf-8
#
# File name "sac" means "SHCNE_ASSOCCHANGED" used at 4xc5k9H.
#
from __future__ import absolute_import
import sys
#/
def main():
#/
sys.stderr.write('#/ Send shell change notification, to make changes take effect.\n')
try:
import win32com.shell.shell as shell
import win... | 0 | 0 | 0 | 0 | 0 | 606 | 0 | 0 | 22 |
ccf3e84481404af3c4b3cd4070a56149409c72b0 | 326 | py | Python | ReadingGauges/ComputerSide/GrabberGaugesOutput_python3/ScriptRunGrabber.py | jerabaul29/PaddleAndUltrasonicGauges | 5c6ba80ddfd44190eb21d5c61979ac802a54cb99 | [
"MIT"
] | 2 | 2021-02-03T12:55:57.000Z | 2021-02-11T07:07:06.000Z | ReadingGauges/ComputerSide/GrabberGaugesOutput_python3/ScriptRunGrabber.py | jerabaul29/PaddleAndUltrasonicGauges | 5c6ba80ddfd44190eb21d5c61979ac802a54cb99 | [
"MIT"
] | null | null | null | ReadingGauges/ComputerSide/GrabberGaugesOutput_python3/ScriptRunGrabber.py | jerabaul29/PaddleAndUltrasonicGauges | 5c6ba80ddfd44190eb21d5c61979ac802a54cb99 | [
"MIT"
] | null | null | null | import Grabber
gauge_grabber = Grabber.grabb_serial_values()
gauge_grabber.init()
gauge_grabber.grabb(10)
gauge_grabber.convert_grabbed_to_numpy()
gauge_grabber.plot_grabbed_data()
gauge_grabber.clean_numpy_dict()
gauge_grabber.save_cleaned_dict_numpy('test_saving')
gauge_grabber.save_cleaned_dict_numpy_csv('test_sav... | 27.166667 | 56 | 0.868098 | import Grabber
gauge_grabber = Grabber.grabb_serial_values()
gauge_grabber.init()
gauge_grabber.grabb(10)
gauge_grabber.convert_grabbed_to_numpy()
gauge_grabber.plot_grabbed_data()
gauge_grabber.clean_numpy_dict()
gauge_grabber.save_cleaned_dict_numpy('test_saving')
gauge_grabber.save_cleaned_dict_numpy_csv('test_sav... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
cc20e3149a11c3be4fc61095e2693ba607d9e501 | 5,488 | py | Python | src/stdout.py | X-EcutiOnner/fileobj | 7e4120759450bbdd1eee4ec26c8a757a8af48093 | [
"BSD-2-Clause"
] | 17 | 2015-05-23T11:09:46.000Z | 2021-12-10T14:28:01.000Z | src/stdout.py | X-EcutiOnner/fileobj | 7e4120759450bbdd1eee4ec26c8a757a8af48093 | [
"BSD-2-Clause"
] | 3 | 2015-03-23T04:35:25.000Z | 2017-09-15T07:12:15.000Z | src/stdout.py | X-EcutiOnner/fileobj | 7e4120759450bbdd1eee4ec26c8a757a8af48093 | [
"BSD-2-Clause"
] | 2 | 2016-01-07T00:38:13.000Z | 2020-12-02T08:27:28.000Z | # Copyright (c) 2014, Tomohiro Kusumi
# All rights reserved.
#
# 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 conditions and... | 24.5 | 81 | 0.647959 | # Copyright (c) 2014, Tomohiro Kusumi
# All rights reserved.
#
# 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 conditions and... | 0 | 0 | 0 | 2,075 | 37 | 577 | 0 | -11 | 524 |
02283df57f4319a703ace0e80322454df4dd0614 | 3,493 | py | Python | software/permacam_processing/image_quality_process.py | lab11/Task2 | 3c3451599dd303cd1e2469e5b9e36e1b4ca49fa6 | [
"Apache-2.0"
] | 21 | 2018-08-29T18:58:26.000Z | 2022-01-12T09:08:04.000Z | software/permacam_processing/image_quality_process.py | lab11/permamote | 3c3451599dd303cd1e2469e5b9e36e1b4ca49fa6 | [
"Apache-2.0"
] | 9 | 2017-11-08T03:22:58.000Z | 2020-05-02T18:23:12.000Z | software/permacam_processing/image_quality_process.py | lab11/Task2 | 3c3451599dd303cd1e2469e5b9e36e1b4ca49fa6 | [
"Apache-2.0"
] | 8 | 2018-10-28T23:44:23.000Z | 2021-07-11T05:18:02.000Z | #!/usr/bin/env python3
import argparse
from glob import glob
from skimage import exposure
from PIL import Image
import colour
import numpy as np
import pandas as pd
import os
from colour_demosaicing import (demosaicing_CFA_Bayer_Menon2007)
cctf_encoding = colour.cctf_encoding
parser = argparse.ArgumentParser(descrip... | 34.245098 | 121 | 0.604924 | #!/usr/bin/env python3
import argparse
from glob import glob
from skimage import exposure
from PIL import Image
import colour
import numpy as np
import pandas as pd
import os
from colour_demosaicing import (
demosaicing_CFA_Bayer_bilinear,
demosaicing_CFA_Bayer_Malvar2004,
demosaicing_CFA_Bayer_Menon2007,... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 104 | 0 |
fd261e8c4a8691fb747969570204d7a92c2cb98d | 2,307 | py | Python | Code/packages/migrations/0001_initial.py | praktianerJones/LSD | 8ca07bfcf53347dc466be0cae260387c90f0c2ed | [
"BSD-3-Clause"
] | 2 | 2021-12-15T21:58:43.000Z | 2021-12-15T22:17:26.000Z | Code/packages/migrations/0001_initial.py | praktianerJones/LSD | 8ca07bfcf53347dc466be0cae260387c90f0c2ed | [
"BSD-3-Clause"
] | null | null | null | Code/packages/migrations/0001_initial.py | praktianerJones/LSD | 8ca07bfcf53347dc466be0cae260387c90f0c2ed | [
"BSD-3-Clause"
] | 1 | 2021-12-19T17:02:02.000Z | 2021-12-19T17:02:02.000Z | # Generated by Django 2.1.7 on 2020-10-22 12:55
import django.db.models.deletion
| 31.60274 | 82 | 0.397486 | # Generated by Django 2.1.7 on 2020-10-22 12:55
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AU... | 0 | 0 | 0 | 2,097 | 0 | 0 | 0 | 37 | 90 |
4765077027b875beb3bbe235bb22451c6aed58b9 | 2,655 | py | Python | src/website/misc/mail.py | wooyek/secure-share | b3b1dd6a03dc278e881e866a5554254523d33a81 | [
"MIT"
] | null | null | null | src/website/misc/mail.py | wooyek/secure-share | b3b1dd6a03dc278e881e866a5554254523d33a81 | [
"MIT"
] | 1 | 2020-05-01T10:53:25.000Z | 2020-05-01T10:53:25.000Z | src/website/misc/mail.py | wooyek/secure-share | b3b1dd6a03dc278e881e866a5554254523d33a81 | [
"MIT"
] | null | null | null | # coding=utf-8
# Copyright 2015 Brave Labs sp. z o.o.
# All rights reserved.
#
# This source code and all resulting intermediate files are CONFIDENTIAL and
# PROPRIETY TRADE SECRETS of Brave Labs sp. z o.o.
# Use is subject to license terms. See NOTICE file of this project for details.
import json
import logging
from s... | 34.480519 | 94 | 0.711864 | # coding=utf-8
# Copyright 2015 Brave Labs sp. z o.o.
# All rights reserved.
#
# This source code and all resulting intermediate files are CONFIDENTIAL and
# PROPRIETY TRADE SECRETS of Brave Labs sp. z o.o.
# Use is subject to license terms. See NOTICE file of this project for details.
import json
import logging
from s... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
e7588964b2c66c2e1a9c460176fbd519c621d0aa | 1,256 | py | Python | main.py | hiroyaiyori/MultiAgentQlearning | 9e5161edad6b9e83995f3bb70bb159047e2dab79 | [
"Apache-2.0"
] | null | null | null | main.py | hiroyaiyori/MultiAgentQlearning | 9e5161edad6b9e83995f3bb70bb159047e2dab79 | [
"Apache-2.0"
] | null | null | null | main.py | hiroyaiyori/MultiAgentQlearning | 9e5161edad6b9e83995f3bb70bb159047e2dab79 | [
"Apache-2.0"
] | null | null | null | import matplotlib.pyplot as plt
from field import Field
from qvalue import Hunter
if __name__ == "__main__":
h0 = Hunter(0)
h1 = Hunter(1)
epi_itern_l = []
for i in range(EPISODE_N):
f = Field()
itern = 0
while True:
fin = qlearn_step(f, h0, h1)
itern... | 22.428571 | 62 | 0.610669 | import random
import matplotlib.pyplot as plt
from setting import *
from field import Field
from qvalue import Hunter
def qlearn_step(f: Field, h0: Hunter, h1: Hunter):
# move hunter0
m0 = h0.decide_movement(f)
pre_s0 = h0.h_recognize(f)
f.move_agent(0, m0)
# move hunter1
m1 = h1.decide_mov... | 0 | 0 | 0 | 0 | 0 | 613 | 0 | -8 | 68 |
4dd52bce4b143c4fbffd44bc3c50266b8901f019 | 4,976 | py | Python | rlpyt/runners/multigpu_sync.py | DilipA/rlpyt | edfd46484c56a47b4671006a16a642e6808da393 | [
"MIT"
] | null | null | null | rlpyt/runners/multigpu_sync.py | DilipA/rlpyt | edfd46484c56a47b4671006a16a642e6808da393 | [
"MIT"
] | null | null | null | rlpyt/runners/multigpu_sync.py | DilipA/rlpyt | edfd46484c56a47b4671006a16a642e6808da393 | [
"MIT"
] | 1 | 2020-06-23T14:13:40.000Z | 2020-06-23T14:13:40.000Z |
###############################################################################
# Master
###############################################################################
###############################################################################
# Worker
#######################################################... | 28.434286 | 79 | 0.567725 |
import multiprocessing as mp
import time
import torch.distributed
from rlpyt.runners.minibatch_rl import MinibatchRl
from rlpyt.runners.minibatch_rl_eval import MinibatchRlEval
from rlpyt.utils.seed import make_seed
from rlpyt.utils.collections import AttrDict
from rlpyt.utils.quick_args import save__init__args
###... | 0 | 90 | 0 | 3,633 | 0 | 416 | 0 | 137 | 339 |
d85adc875950cf9304a2a13e89a8e00037af958b | 8,324 | py | Python | src/python/pants/backend/python/rules/python_test_runner.py | mpopenko-exos/pants | 47d27037c8b13291fc9023e56ddd1b1defdf1b8e | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/python/rules/python_test_runner.py | mpopenko-exos/pants | 47d27037c8b13291fc9023e56ddd1b1defdf1b8e | [
"Apache-2.0"
] | 1 | 2018-09-04T17:37:34.000Z | 2018-09-04T19:42:58.000Z | src/python/pants/backend/python/rules/python_test_runner.py | mpopenko-exos/pants | 47d27037c8b13291fc9023e56ddd1b1defdf1b8e | [
"Apache-2.0"
] | null | null | null | # Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from textwrap import dedent
from typing import Optional
DEFAULT_COVERAGE_CONFIG = dedent(f"""
[run]
branch = True
timid = False
relative_files = True
""")
def calculate_timeo... | 38.359447 | 117 | 0.780995 | # Copyright 2018 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import os
from dataclasses import dataclass
from textwrap import dedent
from typing import Optional, Tuple
from pants.backend.python.rules.pex import Pex
from pants.backend.python.rules.p... | 0 | 5,106 | 0 | 0 | 0 | 845 | 0 | 875 | 603 |
ac0722f5355939a163b27b591dc7ab3e9e9bd82a | 817 | py | Python | blog_config.py | misalabs/misalabs.com | f2c95f124f01a718c5bf9331457d75bae0e892bd | [
"MIT"
] | null | null | null | blog_config.py | misalabs/misalabs.com | f2c95f124f01a718c5bf9331457d75bae0e892bd | [
"MIT"
] | null | null | null | blog_config.py | misalabs/misalabs.com | f2c95f124f01a718c5bf9331457d75bae0e892bd | [
"MIT"
] | null | null | null | # coding: utf-8 -*-
# TITLE / SUBTITLE / AUTHOR
# The title, subtitle, and author of the blog
TITLE = "Misa Montes"
SUBTITLE = "blog"
AUTHOR = "Misa"
METADATA_TAGS = ['title', 'author']
# POSTS_PER_PAGE
# The number of posts that will appear on each page of index.html
POSTS_PER_PAGE = 3
# SUMMARY_DELIMITOR
# Used to ... | 29.178571 | 78 | 0.740514 | # coding: utf-8 -*-
# TITLE / SUBTITLE / AUTHOR
# The title, subtitle, and author of the blog
TITLE = "Misa Montes"
SUBTITLE = "blog"
AUTHOR = "Misa"
METADATA_TAGS = ['title', 'author']
# POSTS_PER_PAGE
# The number of posts that will appear on each page of index.html
POSTS_PER_PAGE = 3
# SUMMARY_DELIMITOR
# Used to ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ee0f794b0f5448c23e5ed4a42cf4a22fac9055fd | 509 | py | Python | tAPP/2/P2.py | ArvinZJC/UofG_PGT_PSD_Python | d90e9bb0b53b14c6b1d7e657c3c61e2792e0d9c4 | [
"MIT"
] | null | null | null | tAPP/2/P2.py | ArvinZJC/UofG_PGT_PSD_Python | d90e9bb0b53b14c6b1d7e657c3c61e2792e0d9c4 | [
"MIT"
] | null | null | null | tAPP/2/P2.py | ArvinZJC/UofG_PGT_PSD_Python | d90e9bb0b53b14c6b1d7e657c3c61e2792e0d9c4 | [
"MIT"
] | null | null | null | '''
Description: Problem 2 (rearrange the code)
Version: 1.0.2.20210118
Author: Arvin Zhao
Date: 2021-01-14 22:35:43
Last Editors: Arvin Zhao
LastEditTime: 2021-01-18 18:11:03
'''
line = input('Enter a string: ')
i = 0
is_palindrome = True
while i < len(line) / 2 and is_palindrome:
if line[i] != line[len(line) - ... | 20.36 | 43 | 0.646365 | '''
Description: Problem 2 (rearrange the code)
Version: 1.0.2.20210118
Author: Arvin Zhao
Date: 2021-01-14 22:35:43
Last Editors: Arvin Zhao
LastEditTime: 2021-01-18 18:11:03
'''
line = input('Enter a string: ')
i = 0
is_palindrome = True
while i < len(line) / 2 and is_palindrome:
if line[i] != line[len(line) - ... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ed9616c041b5bba086b27dc907c55bb00c486b21 | 1,762 | py | Python | classes/buildings.py | AlbatrosCZ/RP-bot | f605550ebb9009a9846048da645db91e385d4f35 | [
"MIT"
] | null | null | null | classes/buildings.py | AlbatrosCZ/RP-bot | f605550ebb9009a9846048da645db91e385d4f35 | [
"MIT"
] | null | null | null | classes/buildings.py | AlbatrosCZ/RP-bot | f605550ebb9009a9846048da645db91e385d4f35 | [
"MIT"
] | null | null | null | """
name - jmno
pozition - pozice (x, y)
can_train - sla pro trening jednotky (integer) - pokud je m jednotka alespo jedno z tchto sel me budova trnovat tuto jednotku (m vc spolench sel tm krat doba trningu)
defend_power ... | 46.368421 | 247 | 0.536322 | """
name - jméno
pozition - pozice (x, y)
can_train - čísla pro trening jednotky (integer) - pokud je má jednotka alespoň jedno z těchto čísel může budova trénovat tuto jednotku (čím víc společných čísel tím kratší doba tréningu... | 122 | 0 | 0 | 926 | 0 | 0 | 0 | 0 | 44 |
0dfa8249c34d3a763ad92b788a6d4f1a0321b4b8 | 1,870 | py | Python | Labs/Lab10/lab10a.py | tonysulfaro/CSE-231 | 0e3ff5422fe42624a90a17d7f33174346662a6fc | [
"MIT"
] | 2 | 2021-09-23T19:17:24.000Z | 2021-11-29T09:03:56.000Z | Labs/Lab10/lab10a.py | tonysulfaro/CSE-231 | 0e3ff5422fe42624a90a17d7f33174346662a6fc | [
"MIT"
] | null | null | null | Labs/Lab10/lab10a.py | tonysulfaro/CSE-231 | 0e3ff5422fe42624a90a17d7f33174346662a6fc | [
"MIT"
] | 1 | 2020-10-25T13:03:18.000Z | 2020-10-25T13:03:18.000Z | ##
## Demonstrate some of the operations of the Deck and Card classes
##
import cards
# Seed the random number generator to a specific value so every execution
# of the program uses the same sequence of random numbers (for testing).
import random
random.seed( 100 )
# Create a deck of cards
my_deck = cards.Deck()
... | 24.285714 | 85 | 0.665775 | ##
## Demonstrate some of the operations of the Deck and Card classes
##
import cards
# Seed the random number generator to a specific value so every execution
# of the program uses the same sequence of random numbers (for testing).
import random
random.seed( 100 )
# Create a deck of cards
my_deck = cards.Deck()
... | 0 | 0 | 0 | 0 | 0 | 829 | 0 | 0 | 23 |
bb993e3d8ef9c6f08b033e56942c9442d4a223c0 | 4,886 | py | Python | src/ur_online_control/ur_direct/structure.py | createchaos/ur_online_control_2 | 22b0ec6b7ffa2c74b55dd214e7b854bec9922ccb | [
"MIT"
] | null | null | null | src/ur_online_control/ur_direct/structure.py | createchaos/ur_online_control_2 | 22b0ec6b7ffa2c74b55dd214e7b854bec9922ccb | [
"MIT"
] | null | null | null | src/ur_online_control/ur_direct/structure.py | createchaos/ur_online_control_2 | 22b0ec6b7ffa2c74b55dd214e7b854bec9922ccb | [
"MIT"
] | null | null | null | from __future__ import absolute_import
__all__ = [
'URCommandScript'
]
| 35.926471 | 117 | 0.575931 | from __future__ import absolute_import
import os
import socket
from ur_online_control.ur_direct.mixins.airpick_mixins import AirpickMixins
__all__ = [
'URCommandScript'
]
class URCommandScript(AirpickMixins):
"""Class containing commands for the UR Robot system"""
def __init__(self, server_ip=None, serve... | 0 | 0 | 0 | 4,685 | 0 | 0 | 0 | 34 | 89 |
728f3b3c609ce6bb2af3cd08ab99688368ec0879 | 1,168 | py | Python | genemunge/data/cleanup.py | unlearnai/genemunge | a7dc07706ae2bf487a04fcda5623013c055030a3 | [
"CC-BY-4.0"
] | 21 | 2018-04-06T17:03:52.000Z | 2020-06-29T12:56:43.000Z | genemunge/data/cleanup.py | unlearnai/genemunge | a7dc07706ae2bf487a04fcda5623013c055030a3 | [
"CC-BY-4.0"
] | 5 | 2018-04-10T19:32:33.000Z | 2018-07-17T18:07:48.000Z | genemunge/data/cleanup.py | unlearnai/genemunge | a7dc07706ae2bf487a04fcda5623013c055030a3 | [
"CC-BY-4.0"
] | 5 | 2018-04-11T05:42:52.000Z | 2019-04-02T03:43:52.000Z | import os
import contextlib
filepath = os.path.dirname(os.path.abspath(__file__))
def remove_installed_data_files():
"""
Removes some of the files that are downloaded during install.
Args:
None
Returns:
None
"""
# remove the GO file
with contextlib.suppress(FileNotFound... | 29.2 | 77 | 0.697774 | import os
import contextlib
filepath = os.path.dirname(os.path.abspath(__file__))
def remove_installed_data_files():
"""
Removes some of the files that are downloaded during install.
Args:
None
Returns:
None
"""
# remove the GO file
with contextlib.suppress(FileNotFound... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
cbc363039e6a67e61d37d79f26466d4524013356 | 42 | py | Python | test/integration/ElseIfStart/else if start.py | HighSchoolHacking/GLS-Draft | 9e418b6290e7c8e3f2da87668784bdba1cde5a76 | [
"MIT"
] | 30 | 2019-10-29T12:47:50.000Z | 2022-02-12T06:41:39.000Z | test/integration/ElseIfStart/else if start.py | HighSchoolHacking/GLS-Draft | 9e418b6290e7c8e3f2da87668784bdba1cde5a76 | [
"MIT"
] | 247 | 2017-09-21T17:11:18.000Z | 2019-10-08T12:59:07.000Z | test/integration/ElseIfStart/else if start.py | HighSchoolHacking/GLS-Draft | 9e418b6290e7c8e3f2da87668784bdba1cde5a76 | [
"MIT"
] | 17 | 2017-10-01T16:53:20.000Z | 2018-11-28T07:20:35.000Z | #
if aaa:
# ...
elif bbb:
# ...
#
| 6 | 9 | 0.285714 | #
if aaa:
# ...
elif bbb:
# ...
#
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
8a6089511fc4904952eb4fa9eb272cd7236b50fa | 6,550 | py | Python | model/videoQA.py | MikeWangWZHL/StarterCode | e271c5dff2d9c4344c2fecd81bb0b5dfe2749cf2 | [
"MIT"
] | 63 | 2021-06-07T18:16:55.000Z | 2022-03-29T09:41:05.000Z | model/videoQA.py | MikeWangWZHL/StarterCode | e271c5dff2d9c4344c2fecd81bb0b5dfe2749cf2 | [
"MIT"
] | 16 | 2021-07-08T07:42:28.000Z | 2022-01-14T06:40:57.000Z | model/videoQA.py | MikeWangWZHL/StarterCode | e271c5dff2d9c4344c2fecd81bb0b5dfe2749cf2 | [
"MIT"
] | 5 | 2021-07-19T08:23:45.000Z | 2022-02-02T02:49:48.000Z | """
Copyright (c) Microsoft Corporation.
Licensed under the MIT license.
HERO for Video Question Answering Tasks, shared by:
1. TVQA
2. How2QA
3. VLEP
4. VIOLIN
copied/modified from HERO
(https://github.com/linjieli222/HERO)
"""
| 41.455696 | 81 | 0.563206 | """
Copyright (c) Microsoft Corporation.
Licensed under the MIT license.
HERO for Video Question Answering Tasks, shared by:
1. TVQA
2. How2QA
3. VLEP
4. VIOLIN
copied/modified from HERO
(https://github.com/linjieli222/HERO)
"""
from collections import defaultdict
import copy
import torch
from torch import nn
from t... | 0 | 0 | 0 | 6,076 | 0 | 0 | 0 | 41 | 201 |
a41809e1c5cdadc95d16313cf867c2d8f5f87176 | 24,261 | py | Python | cardgame_channels_app/tests.py | cyface/cardgame_channels | 22f2bef190ee20999eae27e6aa9ce138a78ae47f | [
"MIT"
] | null | null | null | cardgame_channels_app/tests.py | cyface/cardgame_channels | 22f2bef190ee20999eae27e6aa9ce138a78ae47f | [
"MIT"
] | null | null | null | cardgame_channels_app/tests.py | cyface/cardgame_channels | 22f2bef190ee20999eae27e6aa9ce138a78ae47f | [
"MIT"
] | null | null | null | import logging
LOGGER = logging.getLogger("cardgame_channels_app")
| 61.420253 | 228 | 0.676765 | import logging
from channels.test import ChannelTestCase, WSClient
from .game_logic import add_player_to_game
from .models import Player, Game, CardGamePlayer, Card
LOGGER = logging.getLogger("cardgame_channels_app")
class GameModelTests(ChannelTestCase):
fixtures = ['test_card_data.json'] # 100 green and 100... | 0 | 0 | 0 | 23,993 | 0 | 0 | 0 | 84 | 114 |
dce07b739ca43d0c08ddf16db1417665536ad16a | 16,447 | py | Python | pyt_utilities.py | realtechsupport/return_to_bali | 6af3b8163ef583e9d9ad3fb5d381e62714ce8c6f | [
"CC-BY-4.0"
] | null | null | null | pyt_utilities.py | realtechsupport/return_to_bali | 6af3b8163ef583e9d9ad3fb5d381e62714ce8c6f | [
"CC-BY-4.0"
] | null | null | null | pyt_utilities.py | realtechsupport/return_to_bali | 6af3b8163ef583e9d9ad3fb5d381e62714ce8c6f | [
"CC-BY-4.0"
] | null | null | null | # pyt_utilities.py (python3)
# utilities for CNN training with pytorch; data preparation, training, evaluation
# added saving checkpoint
# FEB 2020 / 21
# sources:
# https://pytorch.org/tutorials/beginner/transfer_learning_tutorial.html#load-data
# https://pytorch.org/tutorials/beginner/finetuning_torchvision_models_t... | 42.830729 | 196 | 0.588436 | # pyt_utilities.py (python3)
# utilities for CNN training with pytorch; data preparation, training, evaluation
# added saving checkpoint
# FEB 2020 / 21
# sources:
# https://pytorch.org/tutorials/beginner/transfer_learning_tutorial.html#load-data
# https://pytorch.org/tutorials/beginner/finetuning_torchvision_models_t... | 0 | 0 | 0 | 1,102 | 0 | 10,861 | 0 | 101 | 529 |
ae1a7f1f3b28ebe4b6ed9d9b5a1557a03091f6d4 | 10,706 | py | Python | data_preperation/cricsheet/load_data.py | vv-varun/IPL-DataAnalysis | 936827aedcbc4f0a2204888210b3e20fcd46b0e6 | [
"MIT"
] | null | null | null | data_preperation/cricsheet/load_data.py | vv-varun/IPL-DataAnalysis | 936827aedcbc4f0a2204888210b3e20fcd46b0e6 | [
"MIT"
] | null | null | null | data_preperation/cricsheet/load_data.py | vv-varun/IPL-DataAnalysis | 936827aedcbc4f0a2204888210b3e20fcd46b0e6 | [
"MIT"
] | null | null | null | import mysql.connector
from os import path
import shutil
db_connection = mysql.connector.connect(
host="localhost",
port=3308,
user="root",
passwd="",
database="ipldata"
)
# Global Variable
player_data = {}
# Query Team details by name
# Add new player to DB.
# Get Player details by name
# Read data fro... | 37.697183 | 153 | 0.621054 | import mysql.connector
import yaml
from os import path, listdir
import shutil
import datetime
db_connection = mysql.connector.connect(
host="localhost",
port=3308,
user="root",
passwd="",
database="ipldata"
)
# Global Variable
player_data = {}
# Query Team details by name
def queryTeamDetailsByName(team_na... | 0 | 0 | 0 | 0 | 0 | 9,642 | 0 | -7 | 221 |
a258ffb0adf5980dfb80e491c805881a5b484263 | 5,868 | py | Python | resources/mgltools_x86_64Linux2_1.5.6/MGLToolsPckgs/MolKit/groParser.py | J-E-J-S/aaRS-Pipeline | 43f59f28ab06e4b16328c3bc405cdddc6e69ac44 | [
"MIT"
] | 8 | 2021-12-14T21:30:01.000Z | 2022-02-14T11:30:03.000Z | resources/mgltools_x86_64Linux2_1.5.6/MGLToolsPckgs/MolKit/groParser.py | J-E-J-S/aaRS-Pipeline | 43f59f28ab06e4b16328c3bc405cdddc6e69ac44 | [
"MIT"
] | null | null | null | resources/mgltools_x86_64Linux2_1.5.6/MGLToolsPckgs/MolKit/groParser.py | J-E-J-S/aaRS-Pipeline | 43f59f28ab06e4b16328c3bc405cdddc6e69ac44 | [
"MIT"
] | 1 | 2021-11-04T21:48:14.000Z | 2021-11-04T21:48:14.000Z | #
#
#
#
#
#
#$Id: groParser.py,v 1.11 2006/12/15 19:53:29 annao Exp $
#
"""
Module Gromacs Parser.
"""
import os, types
from MolKit.moleculeParser import MoleculeParser
from MolKit.protein import Protein, Chain, ChainSet, Residue, ResidueSet, ProteinSet
from MolKit.molecule import Atom, AtomSet, Bond, BondSet, ... | 36 | 179 | 0.512781 | #
#
#
#
#
#
#$Id: groParser.py,v 1.11 2006/12/15 19:53:29 annao Exp $
#
"""
Module Gromacs Parser.
"""
import os,types
from MolKit.moleculeParser import MoleculeParser
from MolKit.protein import Protein, Chain, ChainSet, Residue, ResidueSet, ProteinSet
from MolKit.molecule import Atom, AtomSet, Bond, BondSet, H... | 0 | 0 | 0 | 5,293 | 0 | 0 | 0 | -1 | 23 |
cd271e097e85b39119ac5d57f5185c0f3eb0adae | 3,675 | py | Python | webiopi_0.7.1/python/webiopi/devices/bus.py | Masterkriz/rpi3-webiopi | 3c627a2769394a9cd5687e32fe779e9280c17e9b | [
"Apache-2.0"
] | 63 | 2016-09-01T13:10:59.000Z | 2021-04-28T16:00:22.000Z | webiopi_0.7.1/python/webiopi/devices/bus.py | Masterkriz/rpi3-webiopi | 3c627a2769394a9cd5687e32fe779e9280c17e9b | [
"Apache-2.0"
] | 56 | 2016-09-08T21:59:25.000Z | 2021-04-29T07:44:39.000Z | services/webiopi/src/python/webiopi/devices/bus.py | creative-workflow/pi-setup | d6d28cb8d34ef71b1e8ac95dd94099bfad08837a | [
"MIT"
] | 24 | 2016-10-30T03:20:02.000Z | 2021-04-28T15:03:07.000Z | # Copyright 2012-2013 Eric Ptak - trouch.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 31.144068 | 128 | 0.594558 | # Copyright 2012-2013 Eric Ptak - trouch.com
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable l... | 0 | 0 | 0 | 1,049 | 0 | 1,310 | 0 | -3 | 290 |
0323291efc8d205fb0aa73cee0fb59b5fd6e516a | 345,898 | py | Python | 3algo/homo/1_2_7datap.py | allengrr/deadlock_project | 933878077c45a7df04daa087407bb2620c064617 | [
"MIT"
] | null | null | null | 3algo/homo/1_2_7datap.py | allengrr/deadlock_project | 933878077c45a7df04daa087407bb2620c064617 | [
"MIT"
] | null | null | null | 3algo/homo/1_2_7datap.py | allengrr/deadlock_project | 933878077c45a7df04daa087407bb2620c064617 | [
"MIT"
] | 1 | 2021-03-21T17:54:26.000Z | 2021-03-21T17:54:26.000Z |
wt1_2_7 = {'192.168.122.112': [6.0527, 8.4551, 7.8479, 7.6681, 7.4932, 6.4745, 6.4198, 8.2644, 10.7811, 10.3783, 9.9412, 9.5791, 9.2604, 9.4337, 9.2044, 8.9888, 8.8576, 8.6938, 8.5687, 8.4276, 8.3159, 8.203, 8.3446, 8.2226, 8.127, 8.0167, 7.9279, 7.8576, 7.9614, 7.9092, 7.8796, 7.8118, 7.747, 7.8486, 7.7813, 7.8853, 7... | 20,346.941176 | 322,402 | 0.621296 |
wt1_2_7 = {'192.168.122.112': [6.0527, 8.4551, 7.8479, 7.6681, 7.4932, 6.4745, 6.4198, 8.2644, 10.7811, 10.3783, 9.9412, 9.5791, 9.2604, 9.4337, 9.2044, 8.9888, 8.8576, 8.6938, 8.5687, 8.4276, 8.3159, 8.203, 8.3446, 8.2226, 8.127, 8.0167, 7.9279, 7.8576, 7.9614, 7.9092, 7.8796, 7.8118, 7.747, 7.8486, 7.7813, 7.8853, 7... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
fa8d31d66b14a0e8182646257c68eb38f41cd82f | 3,517 | py | Python | lib/turkish_nltk/trnltk/morphology/contextful/likelihoodmetrics/contextlessdistribution/contextlessdistributioncalculator.py | myasiny/wordembed | d4df516a4ac6eed71d1cc6e085638e895c525de6 | [
"MIT"
] | null | null | null | lib/turkish_nltk/trnltk/morphology/contextful/likelihoodmetrics/contextlessdistribution/contextlessdistributioncalculator.py | myasiny/wordembed | d4df516a4ac6eed71d1cc6e085638e895c525de6 | [
"MIT"
] | null | null | null | lib/turkish_nltk/trnltk/morphology/contextful/likelihoodmetrics/contextlessdistribution/contextlessdistributioncalculator.py | myasiny/wordembed | d4df516a4ac6eed71d1cc6e085638e895c525de6 | [
"MIT"
] | null | null | null | """
Copyright 2012 Ali Ok (aliokATapacheDOTorg)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wr... | 48.178082 | 147 | 0.76315 | """
Copyright 2012 Ali Ok (aliokATapacheDOTorg)
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in wr... | 0 | 0 | 0 | 2,749 | 0 | 0 | 0 | 113 | 45 |
6f99d3106f3bc1094a862c8c7aa78296741c8631 | 2,810 | py | Python | jaqs/data/basic/position.py | WestXu/JAQS | 3c9389afab518f188b8628af72297d750c07dfb1 | [
"Apache-2.0"
] | 602 | 2017-11-21T00:39:40.000Z | 2022-03-16T06:13:08.000Z | jaqs/data/basic/position.py | WestXu/JAQS | 3c9389afab518f188b8628af72297d750c07dfb1 | [
"Apache-2.0"
] | 63 | 2017-12-08T08:21:16.000Z | 2020-03-07T13:57:35.000Z | jaqs/data/basic/position.py | WestXu/JAQS | 3c9389afab518f188b8628af72297d750c07dfb1 | [
"Apache-2.0"
] | 365 | 2017-11-21T01:38:36.000Z | 2022-03-30T15:55:30.000Z | # encoding:utf-8
| 23.813559 | 79 | 0.552313 | # encoding:utf-8
class Position(object):
"""
Basic position class.
Attributes
----------
symbol : str
List of securities.
side : str
("Long", "Short"). Positions of different sides will not be merged.
cost_price : float
Average cost price of current net position.
... | 0 | 315 | 0 | 2,430 | 0 | 0 | 0 | 0 | 46 |
7c155ca3ad86c8e2034ae70bd090f75f9ba1e72c | 10,758 | py | Python | conductor/conductor/controller/translator_svc.py | onap/optf-has | dd06e2675aedd7ae6344f2f51e70bbd468f36ce5 | [
"Apache-2.0"
] | 4 | 2019-02-14T19:18:09.000Z | 2019-10-21T17:17:59.000Z | conductor/conductor/controller/translator_svc.py | onap/optf-has | dd06e2675aedd7ae6344f2f51e70bbd468f36ce5 | [
"Apache-2.0"
] | null | null | null | conductor/conductor/controller/translator_svc.py | onap/optf-has | dd06e2675aedd7ae6344f2f51e70bbd468f36ce5 | [
"Apache-2.0"
] | 4 | 2019-05-09T07:05:54.000Z | 2020-11-20T05:56:47.000Z | #
# -------------------------------------------------------------------------
# Copyright (c) 2015-2017 AT&T Intellectual Property
# Copyright (C) 2020 Wipro Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ma... | 39.844444 | 113 | 0.604109 | #
# -------------------------------------------------------------------------
# Copyright (c) 2015-2017 AT&T Intellectual Property
# Copyright (C) 2020 Wipro Limited.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You ma... | 0 | 0 | 0 | 8,572 | 0 | 0 | 0 | 330 | 356 |
100224c5e87268947545ef064b470a911e6290c0 | 1,266 | py | Python | src/findenum.py | WOWZON3/RoseOnline | ec17901400fedb1a4705a8a8bb69925910c5b0cd | [
"Apache-2.0"
] | 1 | 2020-03-09T22:19:26.000Z | 2020-03-09T22:19:26.000Z | src/findenum.py | WOWZON3/RoseOnline | ec17901400fedb1a4705a8a8bb69925910c5b0cd | [
"Apache-2.0"
] | null | null | null | src/findenum.py | WOWZON3/RoseOnline | ec17901400fedb1a4705a8a8bb69925910c5b0cd | [
"Apache-2.0"
] | null | null | null | #!/bin/python3
enum = {}
previousValue = None
with open("rosecommon/include/epackettype.h", "r") as f:
for i in range(46):
f.readline()
for line in f:
if "};" in line:
break
name, value = parse(line)
if value:
enum[name] = value
while True:
value = i... | 25.32 | 56 | 0.50237 | #!/bin/python3
enum = {}
previousValue = None
def parse(line):
global previousValue
line = line.strip()
if len(line) == 0:
return None, None
id = line.find("//")
if id != -1:
line = line[:id]
line = line.strip()
line = line[:-1]
line = line.split("=")
line[0] = line... | 0 | 0 | 0 | 0 | 0 | 668 | 0 | 0 | 23 |
07f45e7eb5d042bbd5cc5645219b308998496484 | 15,270 | py | Python | addon_common/common/utils.py | senjacob/retopoflow | 7817bb7d68f98e5ae2c7835f28eeafe76367789e | [
"OML"
] | null | null | null | addon_common/common/utils.py | senjacob/retopoflow | 7817bb7d68f98e5ae2c7835f28eeafe76367789e | [
"OML"
] | null | null | null | addon_common/common/utils.py | senjacob/retopoflow | 7817bb7d68f98e5ae2c7835f28eeafe76367789e | [
"OML"
] | null | null | null | '''
Copyright (C) 2021 CG Cookie
http://cgcookie.com
hello@cgcookie.com
Created by Jonathan Denning, Jonathan Williamson
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 3 ... | 33.123644 | 97 | 0.576228 | '''
Copyright (C) 2021 CG Cookie
http://cgcookie.com
hello@cgcookie.com
Created by Jonathan Denning, Jonathan Williamson
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 3 ... | 0 | 84 | 0 | 2,210 | 260 | 9,602 | 0 | 84 | 975 |
9751201d5d87e45e65a5fb9c8931abc18fb84269 | 1,575 | py | Python | src/speech_distillation/custom_discriminator.py | AlonKellner/hifi-gan | e842836a0c879289c1848e922695ea1117715739 | [
"MIT"
] | null | null | null | src/speech_distillation/custom_discriminator.py | AlonKellner/hifi-gan | e842836a0c879289c1848e922695ea1117715739 | [
"MIT"
] | null | null | null | src/speech_distillation/custom_discriminator.py | AlonKellner/hifi-gan | e842836a0c879289c1848e922695ea1117715739 | [
"MIT"
] | null | null | null | import torch.nn as nn
| 38.414634 | 105 | 0.645079 | import torch
import torch.nn as nn
import torch.nn.functional as f
class AllInOneDiscriminator(nn.Module):
def __init__(self, pre_model, blocks, post_model):
super(AllInOneDiscriminator, self).__init__()
self.pre_model = pre_model
self.blocks = blocks
self.post_model = po... | 0 | 0 | 0 | 1,451 | 0 | 0 | 0 | 1 | 96 |
1946612015dd895b8e3ea0ba5a88d89c172ea93a | 279 | py | Python | hrsalespipes/system/templatetags/custom_tags.py | hanztura/hrsalespipes | 77accf3132726ced05d84fa2a41891b841f310b8 | [
"Apache-2.0"
] | 3 | 2020-03-26T12:43:43.000Z | 2021-05-10T14:35:51.000Z | hrsalespipes/system/templatetags/custom_tags.py | hanztura/hrsalespipes | 77accf3132726ced05d84fa2a41891b841f310b8 | [
"Apache-2.0"
] | 5 | 2021-04-08T21:15:15.000Z | 2022-02-10T11:03:12.000Z | hrsalespipes/system/templatetags/custom_tags.py | hanztura/hrsalespipes | 77accf3132726ced05d84fa2a41891b841f310b8 | [
"Apache-2.0"
] | 1 | 2022-01-30T19:24:48.000Z | 2022-01-30T19:24:48.000Z |
from django import template
register = template.Library()
| 21.461538 | 65 | 0.792115 | import json
from django import template
from django.utils.html import mark_safe
register = template.Library()
@register.simple_tag
def many_to_many_uuid_to_string(values):
values_in_json = json.dumps([str(value) for value in values])
return mark_safe(values_in_json)
| 0 | 143 | 0 | 0 | 0 | 0 | 0 | 8 | 67 |
222f2b885bae826ffd49b963ae706336578e70ae | 770 | py | Python | test/AggregationTest.py | drbobdugan/smoss | 3232ddfbb89450143a0fbca54c9be75730e3b3ec | [
"MIT"
] | null | null | null | test/AggregationTest.py | drbobdugan/smoss | 3232ddfbb89450143a0fbca54c9be75730e3b3ec | [
"MIT"
] | 3 | 2018-04-15T16:34:00.000Z | 2018-04-15T16:48:43.000Z | test/AggregationTest.py | CSC400-S18/smoss | 3232ddfbb89450143a0fbca54c9be75730e3b3ec | [
"MIT"
] | 1 | 2019-02-21T02:27:40.000Z | 2019-02-21T02:27:40.000Z | import unittest
if __name__ == '__main__':
unittest.main()
| 27.5 | 78 | 0.672727 | import unittest
from Aggregation import Aggregation
class MyTestCase(unittest.TestCase):
def setUp(self):
self.aggregation = Aggregation("name", 0) #(Name, Data)
def test_getName(self):
self.assertEqual(self.aggregation.getName(), "name")
def test_setName(self):
self.aggregation.s... | 0 | 0 | 0 | 646 | 0 | 0 | 0 | 14 | 45 |
1f6db259e333de15840e73f5d1d44c55e1081bcd | 4,737 | py | Python | CV/HW10/HW10.py | r07922003/NTU | 4414b656643bc0079c12617190fa2a519d2331f8 | [
"MIT"
] | null | null | null | CV/HW10/HW10.py | r07922003/NTU | 4414b656643bc0079c12617190fa2a519d2331f8 | [
"MIT"
] | null | null | null | CV/HW10/HW10.py | r07922003/NTU | 4414b656643bc0079c12617190fa2a519d2331f8 | [
"MIT"
] | null | null | null |
# coding: utf-8
from PIL import Image
import numpy as np
lena = Image.open("lena.bmp")
mask1 = np.array([[0 , 1 , 0],
[1 ,-4 , 1],
[0 , 1 , 0]])
mask2 = (1/3) * np.array([[1, 1, 1],
[1,-8, 1],
[1, 1, 1]])
minimum_mask = (1/3... | 41.920354 | 149 | 0.411231 |
# coding: utf-8
from PIL import Image, ImageDraw
import numpy as np
def Laplace(img,threshold,mask):
pixel = img.load()
img_new = Image.new(img.mode,img.size)
array = np.zeros((img.width,img.height))
for i in range(1,img.width-1):
for j in range(1,img.height-1):
temp = 0
... | 0 | 0 | 0 | 0 | 0 | 1,232 | 0 | 11 | 50 |
b4eafd640caac93dd636f0f796b99b6a750bf17c | 3,519 | py | Python | src/State.py | CURocketEngineering/firefly_chi | 4a6bd3f4a5f0e98fd3fb70e7b121409e490c980b | [
"MIT"
] | 2 | 2020-08-27T23:21:19.000Z | 2021-03-27T17:46:36.000Z | src/State.py | CURocketEngineering/firefly_chi | 4a6bd3f4a5f0e98fd3fb70e7b121409e490c980b | [
"MIT"
] | 4 | 2020-05-31T21:21:55.000Z | 2021-03-02T03:19:10.000Z | src/State.py | CURocketEngineering/firefly_chi | 4a6bd3f4a5f0e98fd3fb70e7b121409e490c980b | [
"MIT"
] | null | null | null | """
State.py
========
Perform actions of the rocket and manage state.
`hooks` is a dictionary mapping a hook string to a
list of functions to thread when the hook occurs.
"""
| 30.868421 | 78 | 0.580563 | """
State.py
========
Perform actions of the rocket and manage state.
`hooks` is a dictionary mapping a hook string to a
list of functions to thread when the hook occurs.
"""
import datetime
from os import system
from threading import Thread
class State:
def __init__(self, conf, data, hooks={}):
self.ho... | 0 | 0 | 0 | 3,251 | 0 | 0 | 0 | 1 | 90 |
cb5cc264838a049bb01efdf466c2192f20d6e36e | 1,361 | py | Python | red_light_detection/red_interval_extraction.py | nickchenchj/darknet | 49e0dcfed005a8982e4fc80885f234e9cffee4c8 | [
"BSD-3-Clause"
] | null | null | null | red_light_detection/red_interval_extraction.py | nickchenchj/darknet | 49e0dcfed005a8982e4fc80885f234e9cffee4c8 | [
"BSD-3-Clause"
] | null | null | null | red_light_detection/red_interval_extraction.py | nickchenchj/darknet | 49e0dcfed005a8982e4fc80885f234e9cffee4c8 | [
"BSD-3-Clause"
] | null | null | null | import sys
if __name__ == '__main__':
if len(sys.argv) < 5:
print("Error: too few arguments")
print("Usage: python3 %s <input-filename> <output-filename> <sample-size> <threshold>" % (sys.argv[0]))
sys.exit()
input_filename = sys.argv[1]
output_filename = sys.argv[2]
sample_siz... | 29.586957 | 111 | 0.587068 | import sys
if __name__ == '__main__':
if len(sys.argv) < 5:
print("Error: too few arguments")
print("Usage: python3 %s <input-filename> <output-filename> <sample-size> <threshold>" % (sys.argv[0]))
sys.exit()
input_filename = sys.argv[1]
output_filename = sys.argv[2]
sample_siz... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
d9cc10ef963e540b44c33e4e5ec9838d481d7efb | 1,617 | py | Python | recorded_future/unit_test/test_lookup_vulnerability.py | killstrelok/insightconnect-plugins | 911358925f4233ab273dbd8172e8b7b9188ebc01 | [
"MIT"
] | null | null | null | recorded_future/unit_test/test_lookup_vulnerability.py | killstrelok/insightconnect-plugins | 911358925f4233ab273dbd8172e8b7b9188ebc01 | [
"MIT"
] | 1 | 2021-02-23T23:57:37.000Z | 2021-02-23T23:57:37.000Z | recorded_future/unit_test/test_lookup_vulnerability.py | killstrelok/insightconnect-plugins | 911358925f4233ab273dbd8172e8b7b9188ebc01 | [
"MIT"
] | null | null | null | import sys
import os
sys.path.append(os.path.abspath('../'))
| 35.933333 | 116 | 0.669759 | import sys
import os
sys.path.append(os.path.abspath('../'))
from unittest import TestCase
from komand_recorded_future.connection.connection import Connection
from komand_recorded_future.actions.lookup_vulnerability import LookupVulnerability
import json
import logging
class TestLookupVulnerability(TestCase):
de... | 0 | 0 | 0 | 1,322 | 0 | 0 | 0 | 99 | 134 |
1b03939b378717b4bea67bc3c3be919838f1e96f | 2,049 | py | Python | docs/02.AI_ML/code-1905/day04/demo07_vc2.py | mheanng/PythonNote | e3e5ede07968fab0a45f6ac4db96e62092c17026 | [
"Apache-2.0"
] | 2 | 2020-04-09T05:56:23.000Z | 2021-03-25T18:42:36.000Z | docs/02.AI_ML/code-1905/day04/demo07_vc2.py | mheanng/PythonNote | e3e5ede07968fab0a45f6ac4db96e62092c17026 | [
"Apache-2.0"
] | 22 | 2020-04-09T06:09:14.000Z | 2021-01-06T01:05:32.000Z | docs/02.AI_ML/code-1905/day04/demo07_vc2.py | mheanng/PythonNote | e3e5ede07968fab0a45f6ac4db96e62092c17026 | [
"Apache-2.0"
] | 6 | 2020-03-09T07:19:21.000Z | 2021-01-05T23:23:42.000Z | """
demo06_vc.py
"""
import numpy as np
import sklearn.preprocessing as sp
import sklearn.ensemble as se
#
data = np.loadtxt('../ml_data/car.txt',
delimiter=',', dtype='U20',
converters={0:f, 1:f, 2:f, 3:f, 4:f, 5:f, 6:f})
#
data = data.T
train_x, train_y = [], []
encoders = []
for col in range(len(data)):
l... | 25.296296 | 57 | 0.665691 | """
demo06_vc.py 验证曲线
"""
import numpy as np
import sklearn.preprocessing as sp
import sklearn.ensemble as se
import sklearn.model_selection as ms
import matplotlib.pyplot as mp
def f(s):
return str(s, encoding='utf-8')
# 读取文件
data = np.loadtxt('../ml_data/car.txt',
delimiter=',', dtype='U20',
converters={0:f,... | 390 | 0 | 0 | 0 | 0 | 21 | 0 | 24 | 67 |
20aba656cffc937d4c4331116e4220baff9c76ba | 1,313 | py | Python | trivia/create_app.py | Xevion/trivia | 5e7a659f8c4a7516a039ea9585d266be983b071d | [
"MIT"
] | null | null | null | trivia/create_app.py | Xevion/trivia | 5e7a659f8c4a7516a039ea9585d266be983b071d | [
"MIT"
] | null | null | null | trivia/create_app.py | Xevion/trivia | 5e7a659f8c4a7516a039ea9585d266be983b071d | [
"MIT"
] | null | null | null | from flask_apscheduler import APScheduler
scheduler: APScheduler = None
| 29.177778 | 86 | 0.644326 | from flask import Flask
from flask_apscheduler import APScheduler
from trivia.config import configs
scheduler: APScheduler = None
def create_app(env=None):
app = Flask(__name__)
if not env:
env = app.config['ENV']
app.config.from_object(configs[env])
# Fixes poor whitespace rendering in te... | 0 | 0 | 0 | 0 | 0 | 1,157 | 0 | 14 | 68 |
d169bdd391bd55defad7a541f6c8edfe9454a3fb | 299 | py | Python | ELAB04/04-06.py | tawanchaiii/01204111_63 | edf1174f287f5174d93729d9b5c940c74d3b6553 | [
"WTFPL"
] | null | null | null | ELAB04/04-06.py | tawanchaiii/01204111_63 | edf1174f287f5174d93729d9b5c940c74d3b6553 | [
"WTFPL"
] | null | null | null | ELAB04/04-06.py | tawanchaiii/01204111_63 | edf1174f287f5174d93729d9b5c940c74d3b6553 | [
"WTFPL"
] | null | null | null | t = int(input("Input: "))
for i in range(t) :
ans = ''
for j in range(i+1) :
ans += str(cal(i,j)) + " "
###print(f"({i},{j} )",end=" ")
print(ans) | 21.357143 | 42 | 0.454849 | def fac(n) :
if n==0:
return 1
else :
return n * fac(n-1)
def cal(a,b):
return int (fac(a) / (fac(b)*fac(a-b)))
t = int(input("Input: "))
for i in range(t) :
ans = ''
for j in range(i+1) :
ans += str(cal(i,j)) + " "
###print(f"({i},{j} )",end=" ")
print(ans) | 0 | 0 | 0 | 0 | 0 | 87 | 0 | 0 | 46 |
12e9e185652313844f0d61cf6bee19810f22d361 | 7,581 | py | Python | lib/net_util.py | asjchen/skyflow_pollution | d54bc2ae2ad3235631f1a337249535b11a6c29bd | [
"BSD-3-Clause"
] | 3 | 2018-01-09T11:11:34.000Z | 2021-05-23T16:09:17.000Z | lib/net_util.py | asjchen/skyflow_pollution | d54bc2ae2ad3235631f1a337249535b11a6c29bd | [
"BSD-3-Clause"
] | null | null | null | lib/net_util.py | asjchen/skyflow_pollution | d54bc2ae2ad3235631f1a337249535b11a6c29bd | [
"BSD-3-Clause"
] | 3 | 2017-01-04T23:44:52.000Z | 2017-01-05T09:51:19.000Z | """
Functions common to both neural networks
"""
import math
import numpy as np
import data_util
import test_util
import feed_forward_nn
import elman_rnn
from nn_globals import NetHyperparams
from nn_globals import OUTPUT_DIM, NUM_VARS
def stochastic_gradient_descent(network_setup, train_data, model, \
verbose=2,... | 39.279793 | 85 | 0.669437 | """
Functions common to both neural networks
"""
import math
import numpy as np
import data_util
import test_util
import feed_forward_nn
import elman_rnn
from nn_globals import NetHyperparams
from nn_globals import OUTPUT_DIM, NUM_VARS
def stochastic_gradient_descent(network_setup, train_data, model, \
verbose=2,... | 0 | 0 | 0 | 0 | 0 | 4,835 | 0 | 0 | 92 |
6c26d63d7ae8a7c7c7e69a1f99e9275446c1f3fb | 955 | py | Python | WEEKS/CD_Sata-Structures/_RESOURCES/pygorithm/pygorithm/strings/anagram.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 4,736 | 2017-08-06T03:36:33.000Z | 2022-03-31T07:32:55.000Z | WEEKS/CD_Sata-Structures/_RESOURCES/pygorithm/pygorithm/strings/anagram.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 56 | 2017-08-06T16:34:49.000Z | 2022-02-09T19:41:02.000Z | WEEKS/CD_Sata-Structures/_RESOURCES/pygorithm/pygorithm/strings/anagram.py | webdevhub42/Lambda | b04b84fb5b82fe7c8b12680149e25ae0d27a0960 | [
"MIT"
] | 658 | 2017-08-06T08:52:02.000Z | 2022-03-15T12:09:08.000Z | """
Author: OMKAR PATHAK
Created On: 17th August 2017
"""
from collections import Counter
import inspect
def is_anagram(word, _list):
"""ANAGRAM
An anagram is direct word switch or word play,
the result of rearranging the letters of a word
or phrase to produce a new word or phrase, using
all the o... | 25.131579 | 55 | 0.659686 | """
Author: OMKAR PATHAK
Created On: 17th August 2017
"""
from collections import Counter
import inspect
def is_anagram(word, _list):
"""ANAGRAM
An anagram is direct word switch or word play,
the result of rearranging the letters of a word
or phrase to produce a new word or phrase, using
all the o... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
69155fa92fa29e1f8e7e8803b79f8acd0d8c1a18 | 6,551 | py | Python | scripts/update_package_cache.py | KenMacD/pipx | 2ecc668acf472ad6956cc682499c077c1130d17e | [
"MIT"
] | 3,573 | 2019-02-06T07:13:28.000Z | 2021-05-27T02:34:20.000Z | scripts/update_package_cache.py | KenMacD/pipx | 2ecc668acf472ad6956cc682499c077c1130d17e | [
"MIT"
] | 533 | 2019-02-06T19:37:59.000Z | 2021-05-27T04:05:30.000Z | scripts/update_package_cache.py | KenMacD/pipx | 2ecc668acf472ad6956cc682499c077c1130d17e | [
"MIT"
] | 187 | 2019-02-24T21:56:21.000Z | 2021-05-21T15:46:13.000Z | #!/usr/bin/env python3
import argparse
import sys
from typing import List
def process_command_line(argv: List[str]) -> argparse.Namespace:
"""Process command line invocation arguments and switches.
Args:
argv: list of arguments, or `None` from ``sys.argv[1:]``.
Returns:
argparse.Namespac... | 33.423469 | 101 | 0.601893 | #!/usr/bin/env python3
import argparse
import re
import subprocess
import sys
from pathlib import Path
from typing import List
from list_test_packages import create_test_packages_list
from test_packages_support import get_platform_list_path, get_platform_packages_dir_path
def process_command_line(argv: List[str]) ->... | 0 | 0 | 0 | 0 | 0 | 4,771 | 0 | 89 | 157 |
6714fbeb710fcef63d832311201eece32ab3f7e1 | 5,669 | py | Python | airflow/dags/etl.py | Ayazdi/tweetbot | d9b3ddd77ba530d6a192fe53f65a4d9994c3a092 | [
"MIT"
] | null | null | null | airflow/dags/etl.py | Ayazdi/tweetbot | d9b3ddd77ba530d6a192fe53f65a4d9994c3a092 | [
"MIT"
] | null | null | null | airflow/dags/etl.py | Ayazdi/tweetbot | d9b3ddd77ba530d6a192fe53f65a4d9994c3a092 | [
"MIT"
] | null | null | null | import time
from datetime import datetime, timedelta
import random
import re
import logging
from config import SLACK_TOKEN
import pandas as pd
import slack
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
from pymongo import MongoClient
from sqlalchemy import create_engi... | 33.946108 | 155 | 0.676133 | import time
from datetime import datetime, timedelta
import random
import re
import logging
from config import SLACK_TOKEN
import pandas as pd
import slack
from airflow import DAG
from airflow.operators.python_operator import PythonOperator
from pymongo import MongoClient
from sqlalchemy import create_engi... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 50 | 46 |
07e7e3e2137257e0b56dc2a7750cbb5cde4f42cd | 114 | py | Python | chapter09/example07.py | YordanIH/Intro_to_CS_w_Python | eebbb8efd7ef0d07be9bc45b6b1e8f20737ce01a | [
"MIT"
] | null | null | null | chapter09/example07.py | YordanIH/Intro_to_CS_w_Python | eebbb8efd7ef0d07be9bc45b6b1e8f20737ce01a | [
"MIT"
] | null | null | null | chapter09/example07.py | YordanIH/Intro_to_CS_w_Python | eebbb8efd7ef0d07be9bc45b6b1e8f20737ce01a | [
"MIT"
] | null | null | null | #looping over the generated range of numbers
total = 0
for i in range(1, 101):
total = total + i
print(total) | 19 | 44 | 0.692982 | #looping over the generated range of numbers
total = 0
for i in range(1, 101):
total = total + i
print(total) | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
0ea7768fd185301fdacd4b292ea08a02f037179e | 21,031 | py | Python | train_cloudcast.py | tianyu-z/Super-SloMo | 55a278cc46b6edb731895548b5a5c26e9b3439ae | [
"MIT"
] | null | null | null | train_cloudcast.py | tianyu-z/Super-SloMo | 55a278cc46b6edb731895548b5a5c26e9b3439ae | [
"MIT"
] | null | null | null | train_cloudcast.py | tianyu-z/Super-SloMo | 55a278cc46b6edb731895548b5a5c26e9b3439ae | [
"MIT"
] | null | null | null | # [Super SloMo]
##High Quality Estimation of Multiple Intermediate Frames for Video Interpolation
from comet_ml import Experiment, ExistingExperiment
import argparse
import torch
import torchvision
import torchvision.transforms as transforms
import torch.optim as optim
import torch.nn as nn
import model
import dataload... | 31.578078 | 149 | 0.595787 | # [Super SloMo]
##High Quality Estimation of Multiple Intermediate Frames for Video Interpolation
from comet_ml import Experiment, ExistingExperiment
import argparse
import torch
import torchvision
import torchvision.transforms as transforms
import torch.optim as optim
import torch.nn as nn
import torch.nn.functional a... | 0 | 0 | 0 | 0 | 0 | 4,748 | 0 | 73 | 186 |
dd5c591d8629070d56f3f787c2b2d5d71c6c3c42 | 448 | py | Python | test/test_tokenize/case2.py | xupingmao/subpy | c956f151ed1ebd2faeaf1565352b59ca5a8fa0b4 | [
"MIT"
] | 6 | 2015-10-11T15:06:54.000Z | 2016-07-03T06:06:52.000Z | test/test_tokenize/case2.py | xupingmao/snake | c956f151ed1ebd2faeaf1565352b59ca5a8fa0b4 | [
"MIT"
] | 7 | 2015-08-03T12:01:21.000Z | 2016-04-24T09:00:09.000Z | test/test_tokenize/case2.py | xupingmao/snake | c956f151ed1ebd2faeaf1565352b59ca5a8fa0b4 | [
"MIT"
] | 2 | 2016-04-18T14:51:25.000Z | 2016-04-18T15:07:09.000Z | # -*- coding:utf-8 -*-
# @author xupingmao
# @since 2022/04/10 15:06:25
# @modified 2022/04/10 15:10:04
# @filename case2.py
input_text = """
def foo(bar):
return bar * 5
"""
output = [
"nl", "nl",
"def", "def",
"name", "foo",
"(", "(",
"name", "bar",
")", ")",
":", ":",
"nl", "nl"... | 15.448276 | 31 | 0.419643 | # -*- coding:utf-8 -*-
# @author xupingmao
# @since 2022/04/10 15:06:25
# @modified 2022/04/10 15:10:04
# @filename case2.py
input_text = """
def foo(bar):
return bar * 5
"""
output = [
"nl", "nl",
"def", "def",
"name", "foo",
"(", "(",
"name", "bar",
")", ")",
":", ":",
"nl", "nl"... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6efc3b3f2991661bf76fd6544abf0ea9b3f3a66e | 153 | py | Python | hadTopTools/__init__.py | mdkdrnevich/DeepHadTopTagger | 560b51b98e0d9a3a78a0986408ad4d2a30f9960f | [
"MIT"
] | 3 | 2018-04-14T18:07:00.000Z | 2020-07-15T13:21:49.000Z | hadTopTools/__init__.py | mdkdrnevich/DeepHadTopTagger | 560b51b98e0d9a3a78a0986408ad4d2a30f9960f | [
"MIT"
] | null | null | null | hadTopTools/__init__.py | mdkdrnevich/DeepHadTopTagger | 560b51b98e0d9a3a78a0986408ad4d2a30f9960f | [
"MIT"
] | null | null | null | import matplotlib as mpl
mpl.use("Agg") | 30.6 | 81 | 0.803922 | import matplotlib as mpl
mpl.use("Agg")
from .utils import CollisionDataset, AutoencoderDataset, train, test, plot_curves
from . import nn_classes as nn | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 69 | 45 |
3636d7aab0b716744fe8b791609bf4d2625e4679 | 4,760 | py | Python | survey_system_files/views.py | CompSci17/Survey-System | b30ddb3c4dc6d65504bbef58bb1600becc4bb6f5 | [
"MIT"
] | 1 | 2020-10-19T15:27:54.000Z | 2020-10-19T15:27:54.000Z | survey_system_files/views.py | CompSci17/Survey-System | b30ddb3c4dc6d65504bbef58bb1600becc4bb6f5 | [
"MIT"
] | 1 | 2020-07-14T15:03:02.000Z | 2020-07-14T15:03:02.000Z | survey_system_files/views.py | CompSci17/Survey-System | b30ddb3c4dc6d65504bbef58bb1600becc4bb6f5 | [
"MIT"
] | null | null | null |
# Create your views here.
| 29.02439 | 197 | 0.65021 | import uuid
import hashlib
from django.shortcuts import render
from django.http import HttpResponseRedirect, HttpResponse
from .models import Survey, Question, Answers
from .forms import SurveyForm
from .results import Results
# Create your views here.
def survey_list( request, *args, **kwargs ):
# Get a list of al... | 0 | 0 | 0 | 0 | 0 | 4,434 | 0 | 73 | 224 |
9d7b4fe660aa92ee6eb5bbd020297c0ee9cb4dd1 | 2,873 | py | Python | src/mnist/train.py | iden-kalemaj/SIDP | ee6da502cc6c0f42042b54d6329b3bd8c67fb991 | [
"Apache-2.0"
] | 10 | 2020-06-22T22:11:43.000Z | 2021-11-10T12:25:53.000Z | src/mnist/train.py | iden-kalemaj/SIDP | ee6da502cc6c0f42042b54d6329b3bd8c67fb991 | [
"Apache-2.0"
] | 2 | 2020-12-10T09:25:59.000Z | 2021-12-27T09:33:36.000Z | src/mnist/train.py | iden-kalemaj/SIDP | ee6da502cc6c0f42042b54d6329b3bd8c67fb991 | [
"Apache-2.0"
] | 3 | 2020-07-11T05:45:06.000Z | 2022-03-03T21:08:56.000Z | import torchvision.transforms as transforms
| 31.571429 | 107 | 0.649147 | import torch
from torchvision import datasets
from torch.utils.data import DataLoader, RandomSampler
import torchvision.transforms as transforms
from tqdm import tqdm
from .dataset import data_loaders, axi_loader
def train(model, criterion, optimizer, device, train_loader, clip, noise_multiplier, batch_size, axi_x):
... | 0 | 0 | 0 | 0 | 0 | 2,575 | 0 | 59 | 179 |
a9c9d9ad9a74e5fe13167144fcd090943b6c7714 | 2,297 | py | Python | main/General_Circuit/Meta_Reporter.py | user-ccarr/ECIF | b858c22b9c2959efbc52ab93f21eac94663598ad | [
"BSD-3-Clause"
] | null | null | null | main/General_Circuit/Meta_Reporter.py | user-ccarr/ECIF | b858c22b9c2959efbc52ab93f21eac94663598ad | [
"BSD-3-Clause"
] | null | null | null | main/General_Circuit/Meta_Reporter.py | user-ccarr/ECIF | b858c22b9c2959efbc52ab93f21eac94663598ad | [
"BSD-3-Clause"
] | null | null | null | import yaml
import sys
def meta_report(meta_data_loc="Experiment_Data.yml"):
"""
Reads meta data from file called "Experiment_Data.yml" and adds a report
Parameters
----------
meta_data_loc : str
the path to file that contains experiment meta data
Returns
-------
con... | 40.298246 | 150 | 0.627775 | import yaml
import sys
def meta_report(meta_data_loc="Experiment_Data.yml"):
"""
Reads meta data from file called "Experiment_Data.yml" and adds a report
Parameters
----------
meta_data_loc : str
the path to file that contains experiment meta data
Returns
-------
con... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c741e0fabfcf222376d9c9ed9b7269d024ada2be | 33,048 | py | Python | src/nunavut/lang/__init__.py | DNedic/nunavut | 61232b31b82ba1b6a3b0bf82392975399a541137 | [
"MIT",
"BSD-3-Clause"
] | 24 | 2019-05-14T19:31:49.000Z | 2021-11-20T09:39:48.000Z | src/nunavut/lang/__init__.py | DNedic/nunavut | 61232b31b82ba1b6a3b0bf82392975399a541137 | [
"MIT",
"BSD-3-Clause"
] | 163 | 2019-05-14T06:03:01.000Z | 2022-03-31T18:21:15.000Z | src/nunavut/lang/__init__.py | DNedic/nunavut | 61232b31b82ba1b6a3b0bf82392975399a541137 | [
"MIT",
"BSD-3-Clause"
] | 12 | 2019-11-24T06:21:43.000Z | 2022-02-23T13:42:51.000Z | #
# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# Copyright (C) 2018-2020 UAVCAN Development Team <uavcan.org>
# This software is distributed under the terms of the MIT License.
#
"""Language-specific support in nunavut.
This package contains modules that provide specific support for gene... | 43.656539 | 120 | 0.645576 | #
# Copyright 2021 Amazon.com, Inc. or its affiliates. All Rights Reserved.
# Copyright (C) 2018-2020 UAVCAN Development Team <uavcan.org>
# This software is distributed under the terms of the MIT License.
#
"""Language-specific support in nunavut.
This package contains modules that provide specific support for gene... | 0 | 6,310 | 0 | 25,937 | 0 | 0 | 0 | 53 | 314 |
3121ed78f11108b68e6bcfba53bebde2323837e6 | 10,692 | py | Python | test/cal_accuracy.py | goroyabu/etnet | 9d8e65fd9e8263eb9e84ac903e07638edba292b4 | [
"MIT"
] | null | null | null | test/cal_accuracy.py | goroyabu/etnet | 9d8e65fd9e8263eb9e84ac903e07638edba292b4 | [
"MIT"
] | null | null | null | test/cal_accuracy.py | goroyabu/etnet | 9d8e65fd9e8263eb9e84ac903e07638edba292b4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import torch.nn as nn
import torch.optim as optim
if __name__ == "__main__":
parser = usage()
args = parser.parse_args()
for file in args.file:
main(file, args)
# main()
| 31.447059 | 129 | 0.601104 | #!/usr/bin/env python3
import os
import argparse
import time
import torch
import torch.nn as nn
import torch.optim as optim
from torch.utils.data import DataLoader
import numpy
from ROOT import TFile, TH1D, TH2D, TCanvas
from ROOT import gROOT, gPad, gStyle
import ROOT
from etnet.dataset import EtrackDataset
from e... | 0 | 0 | 0 | 0 | 0 | 10,120 | 0 | 33 | 315 |
8b79540aa0e5c98c7cc1c464554ec367c707f147 | 89,543 | py | Python | pyvdk/types/objects.py | UT1C/pyVDK | 168177c4006acc7f57be36f189bee8101e10253d | [
"MIT"
] | 16 | 2020-11-24T18:27:59.000Z | 2021-05-14T19:25:44.000Z | pyvdk/types/objects.py | UT1C/pyVDK | 168177c4006acc7f57be36f189bee8101e10253d | [
"MIT"
] | 1 | 2021-04-21T14:35:55.000Z | 2021-06-26T04:18:44.000Z | pyvdk/types/objects.py | UT1C/pyVDK | 168177c4006acc7f57be36f189bee8101e10253d | [
"MIT"
] | 2 | 2020-12-03T16:56:31.000Z | 2020-12-19T16:28:58.000Z | # -*- coding: utf-8 -*-
#
... | 21.289349 | 90 | 0.676837 | # -*- coding: utf-8 -*-
#
import enum
import json
from typing import Any, Callable, Dict, List, Optional, Union
from pydantic import Json
from .abc import Model
class AccountAccountCounters(Model):
app_requests: int
events: int
faves: int
friends: int
friends_suggestions: int
friends_recomme... | 0 | 0 | 0 | 77,911 | 0 | 0 | 0 | 25 | 11,014 |
79ebda0ce039164287373a53487e4e2f1bccc2b6 | 3,649 | py | Python | project/pro2-typing_test/utils.py | zltshadow/CS61A-2019-summer | 0f5dd0be5f51927364aec1bc974526837328b695 | [
"MIT"
] | 3 | 2021-11-21T06:09:39.000Z | 2022-03-12T08:05:27.000Z | project/pro2-typing_test/utils.py | zltshadow/CS61A-2019-summer | 0f5dd0be5f51927364aec1bc974526837328b695 | [
"MIT"
] | null | null | null | project/pro2-typing_test/utils.py | zltshadow/CS61A-2019-summer | 0f5dd0be5f51927364aec1bc974526837328b695 | [
"MIT"
] | null | null | null | from math import sqrt
############################################################################################
# Important: Read over the information in the "Appendix: Utility Functions" in the Project #
# Project Specification in order to better understand how to use the functions below. #
##################... | 26.635036 | 92 | 0.585366 | from math import sqrt
import string
############################################################################################
# Important: Read over the information in the "Appendix: Utility Functions" in the Project #
# Project Specification in order to better understand how to use the functions below. #
####... | 0 | 0 | 0 | 0 | 0 | 186 | 0 | -8 | 46 |
de57dabc2f021eb3cff5c6361aadded8586e7845 | 1,632 | py | Python | aws_sam/fargateIR/tests/integration/test_full.py | andrewkrug/fargate-ir | 9c5c49c34f435a8eb9123d686643890957724f25 | [
"Apache-2.0"
] | 11 | 2019-12-05T17:56:34.000Z | 2022-02-25T10:24:30.000Z | aws_sam/fargateIR/tests/integration/test_full.py | andrewkrug/fargate-ir | 9c5c49c34f435a8eb9123d686643890957724f25 | [
"Apache-2.0"
] | 2 | 2019-12-05T16:42:53.000Z | 2019-12-05T17:38:31.000Z | aws_sam/fargateIR/tests/integration/test_full.py | andrewkrug/fargate-ir | 9c5c49c34f435a8eb9123d686643890957724f25 | [
"Apache-2.0"
] | 2 | 2019-12-06T03:18:10.000Z | 2019-12-27T15:27:53.000Z |
# Use an event structure that follows GuardDuty Schema 2.0 to simulate a ticketing system integration.
EVENT_FIXTURE = {
"detail-type": "GuardDuty Finding",
"source": "aws.guardduty",
"detail": {
"schemaVersion": "2.0",
"accountId": "874153891031",
"region": "us-west-2",
"p... | 30.792453 | 102 | 0.586397 | import os
from lambda_handler import handle
# Use an event structure that follows GuardDuty Schema 2.0 to simulate a ticketing system integration.
EVENT_FIXTURE = {
"detail-type": "GuardDuty Finding",
"source": "aws.guardduty",
"detail": {
"schemaVersion": "2.0",
"accountId": "874153891031... | 0 | 0 | 0 | 0 | 0 | 476 | 0 | 0 | 67 |
ced0e92053dfc14cd64b84707b6b59c2d18deccc | 340 | py | Python | setup.py | rmatsum836/pyfooty | 621fe06b4517223aab875cb60a88ee5825506c21 | [
"MIT"
] | 1 | 2020-11-08T23:50:26.000Z | 2020-11-08T23:50:26.000Z | setup.py | rmatsum836/pyfooty | 621fe06b4517223aab875cb60a88ee5825506c21 | [
"MIT"
] | 2 | 2021-01-05T00:29:54.000Z | 2021-01-05T00:56:16.000Z | setup.py | rmatsum836/pyfooty | 621fe06b4517223aab875cb60a88ee5825506c21 | [
"MIT"
] | null | null | null | from setuptools import setup
setup(name='pyfooty',
version='0.0',
description='Parse the fbref website with python',
url='https://github.com/rmatsum836/pyfooty',
author='Ray Matsumoto',
author_email='raymatsum@gmail.com',
license='MIT',
packages=['pyfooty'],
... | 28.333333 | 58 | 0.617647 | from setuptools import setup
setup(name='pyfooty',
version='0.0',
description='Parse the fbref website with python',
url='https://github.com/rmatsum836/pyfooty',
author='Ray Matsumoto',
author_email='raymatsum@gmail.com',
license='MIT',
packages=['pyfooty'],
... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
6b680c1b1fcbc411b748a75b07e98af22697f813 | 19,783 | py | Python | compflow/fortran.py | jb753/compflow | 7ede6cb860a2573a1ab5e7e40b1591c3e72c3783 | [
"MIT"
] | null | null | null | compflow/fortran.py | jb753/compflow | 7ede6cb860a2573a1ab5e7e40b1591c3e72c3783 | [
"MIT"
] | 1 | 2022-03-04T12:10:26.000Z | 2022-03-14T22:57:56.000Z | compflow/fortran.py | jb753/compflow | 7ede6cb860a2573a1ab5e7e40b1591c3e72c3783 | [
"MIT"
] | null | null | null | """This module wraps the fortran backend."""
import numpy as np
import compflow_fort_from_Ma as fort_from_Ma
import compflow_fort_der_from_Ma as fort_der_from_Ma
import compflow_fort_to_Ma as fort_to_Ma
def _restore_shape(func, args):
"""Call a function and restore output to same shape as first argument."""
s... | 27.211829 | 115 | 0.577769 | """This module wraps the fortran backend."""
import numpy as np
import compflow_fort_from_Ma as fort_from_Ma
import compflow_fort_der_from_Ma as fort_der_from_Ma
import compflow_fort_to_Ma as fort_to_Ma
def _restore_shape(func, args):
"""Call a function and restore output to same shape as first argument."""
s... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
ed0b665e5274119fc4253441bc0c65ee3ffef274 | 7,378 | py | Python | userbot/plugins/ping.py | aksr-aashish/FIREXUSERBOT | dff0b7bf028cb27779626ce523402346cc990402 | [
"MIT"
] | null | null | null | userbot/plugins/ping.py | aksr-aashish/FIREXUSERBOT | dff0b7bf028cb27779626ce523402346cc990402 | [
"MIT"
] | 1 | 2022-01-09T11:35:06.000Z | 2022-01-09T11:35:06.000Z | userbot/plugins/ping.py | aksr-aashish/FIREXUSERBOT | dff0b7bf028cb27779626ce523402346cc990402 | [
"MIT"
] | null | null | null | import datetime
import os
from .. import ALIVE_NAME
from ..cmdhelp import CmdHelp
DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "eviral User"
eviral = borg.uid
eviral_IMG = os.environ.get(
"PING_PIC", "https://te.legra.ph/file/a59da36828333262c9848.jpg"
)
start = datetime.datetime.now()
end = datetime.datetim... | 82.898876 | 410 | 0.197343 | import asyncio
import datetime
import os
from .. import ALIVE_NAME
from ..cmdhelp import CmdHelp
from ..utils import admin_cmd, edit_or_reply, sudo_cmd
from . import *
DEFAULTUSER = str(ALIVE_NAME) if ALIVE_NAME else "eviral User"
eviral = borg.uid
eviral_IMG = os.environ.get(
"PING_PIC", "https://te.legra.ph/fil... | 14,009 | 2,325 | 0 | 0 | 0 | 0 | 0 | 20 | 112 |
ee73b60e03568dfaebc7bf0d67bd3f2349a997e1 | 965 | py | Python | collate_info.py | justincely/hstcos_dark_data | a42042ae7babc73c7feb5058186ea4fa42e9c0be | [
"BSD-3-Clause"
] | null | null | null | collate_info.py | justincely/hstcos_dark_data | a42042ae7babc73c7feb5058186ea4fa42e9c0be | [
"BSD-3-Clause"
] | null | null | null | collate_info.py | justincely/hstcos_dark_data | a42042ae7babc73c7feb5058186ea4fa42e9c0be | [
"BSD-3-Clause"
] | null | null | null | import glob
import json
from copy import deepcopy
import numpy as np
from astropy.table import Table
from astropy.time import Time
from cos_monitoring import dark
from cos_monitoring.dark import solar
solar.get_solar_data("./")
data = Table.read('solar_flux.txt', format='ascii')
all_info = []
for item in glob.glo... | 20.978261 | 82 | 0.634197 | import glob
import json
from copy import deepcopy
import numpy as np
from astropy.table import Table
from astropy.time import Time
from cos_monitoring import dark
from cos_monitoring.dark import solar
import pdb
solar.get_solar_data("./")
data = Table.read('solar_flux.txt', format='ascii')
all_info = []
for item... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | -11 | 23 |
c7607658161aabf0b09b3024ff70cf6f856fe8d3 | 2,225 | py | Python | noisysystem_temp/Analysis/PositivePhiAnalysis.py | Tom271/InteractingParticleSystems | 1cfc8b228077c2465e71d82cc288d713d3755392 | [
"MIT"
] | 1 | 2019-10-22T19:48:22.000Z | 2019-10-22T19:48:22.000Z | noisysystem_temp/Analysis/PositivePhiAnalysis.py | Tom271/InteractingParticleSystems | 1cfc8b228077c2465e71d82cc288d713d3755392 | [
"MIT"
] | 1 | 2019-10-22T21:32:19.000Z | 2019-10-22T21:32:19.000Z | noisysystem_temp/Analysis/PositivePhiAnalysis.py | Tom271/InteractingParticleSystems | 1cfc8b228077c2465e71d82cc288d713d3755392 | [
"MIT"
] | 1 | 2019-10-22T19:49:38.000Z | 2019-10-22T19:49:38.000Z | from matplotlib import rc
import matplotlib.pyplot as plt
import os
import seaborn as sns
from particle.plotting import (plot_averaged_convergence_from_clusters, plot_averaged_avg_vel, plot_avg_vel)
sns.set(style="white", context="talk")
search_parameters = {
# "particle_count": 480,
# "G": "Smooth",
# "... | 33.208955 | 86 | 0.698876 | from matplotlib import rc
import matplotlib.pyplot as plt
import os
import seaborn as sns
from particle.plotting import (
plot_averaged_convergence_from_clusters,
plot_averaged_avg_vel,
plot_avg_vel,
)
sns.set(style="white", context="talk")
search_parameters = {
# "particle_count": 480,
# "G": "S... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 15 | 0 |
d3eb3879f29d5a988281b193f192ff03806bb576 | 8,310 | py | Python | codemetrics/vega.py | Wonshtrum/codemetrics | ae82a742aeedc7fc1edf39a817edb3d41ea3887d | [
"MIT"
] | 6 | 2019-08-07T09:11:35.000Z | 2021-06-22T10:58:33.000Z | codemetrics/vega.py | Wonshtrum/codemetrics | ae82a742aeedc7fc1edf39a817edb3d41ea3887d | [
"MIT"
] | 11 | 2019-09-25T22:04:44.000Z | 2022-03-23T03:06:05.000Z | codemetrics/vega.py | Wonshtrum/codemetrics | ae82a742aeedc7fc1edf39a817edb3d41ea3887d | [
"MIT"
] | 4 | 2019-02-23T15:25:35.000Z | 2021-06-22T12:11:20.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import os
import typing
import pandas as pd
from . import internals
def build_hierarchy(
data: pd.DataFrame,
get_parent=os.path.dirname,
root: str = "",
max_iter: int = 100,
col_name: typing.Optional[str] = None,
) -> pd.DataFrame:
"... | 31.83908 | 94 | 0.541637 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
import os
import typing
import pandas as pd
from . import internals
def build_hierarchy(
data: pd.DataFrame,
get_parent=os.path.dirname,
root: str = "",
max_iter: int = 100,
col_name: typing.Optional[str] = None,
) -> pd.DataFrame:
"... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
565de340dea6258a5a31b85b0559d11b832043c5 | 1,414 | py | Python | master/Alarm_dialog.py | chingchan1996/Distributed-Resource-Monitoring-System | d85a74616307bf5ba7ae5b363512c1fd487143a5 | [
"Apache-2.0"
] | null | null | null | master/Alarm_dialog.py | chingchan1996/Distributed-Resource-Monitoring-System | d85a74616307bf5ba7ae5b363512c1fd487143a5 | [
"Apache-2.0"
] | null | null | null | master/Alarm_dialog.py | chingchan1996/Distributed-Resource-Monitoring-System | d85a74616307bf5ba7ae5b363512c1fd487143a5 | [
"Apache-2.0"
] | null | null | null | from PyQt5 import QtWidgets
import sys
if __name__ == '__main__':
app = QtWidgets.QApplication(sys.argv)
form = AlarmDialog("Slave3", "CPU overloading", "CPU usage > 95%", "50%", "2017/11/25 12:00")
form.setWindowTitle('Alarm')
form.show()
sys.exit(app.exec_()) | 36.25641 | 104 | 0.662659 | from Alarm_dialog_ui import Alarm_Ui_Dialog
from PyQt5 import QtCore, QtWidgets, QtGui
import threading
import sys
class AlarmDialog(QtWidgets.QMainWindow):
def __init__(self, hostname, problem, threshold, current, time):
QtWidgets.QWidget.__init__(self)
self.ui = Alarm_Ui_Dialog()
... | 0 | 0 | 0 | 996 | 0 | 0 | 0 | 32 | 96 |
927d226a221c8200e40efd7d6c8599a8cd204230 | 2,725 | py | Python | zaqar/storage/sqlalchemy/migration/alembic_migrations/versions/001_liberty.py | mail2nsrajesh/zaqar | a68a03a228732050b33c2a7f35d1caa9f3467718 | [
"Apache-2.0"
] | 97 | 2015-01-02T09:35:23.000Z | 2022-03-25T00:38:45.000Z | zaqar/storage/sqlalchemy/migration/alembic_migrations/versions/001_liberty.py | mail2nsrajesh/zaqar | a68a03a228732050b33c2a7f35d1caa9f3467718 | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | zaqar/storage/sqlalchemy/migration/alembic_migrations/versions/001_liberty.py | mail2nsrajesh/zaqar | a68a03a228732050b33c2a7f35d1caa9f3467718 | [
"Apache-2.0"
] | 44 | 2015-01-28T03:01:28.000Z | 2021-05-13T18:55:19.000Z | # Copyright 2016 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 37.328767 | 71 | 0.540917 | # Copyright 2016 OpenStack Foundation.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in ... | 0 | 0 | 0 | 0 | 0 | 1,842 | 0 | 3 | 68 |
8c996016d532556f72b8858fadfdec8cbc13fd3b | 1,188 | py | Python | article/models.py | hexa-yagnenok/myblog | ebba71516ce2ebb6b05fcb8c889a54924b9284c9 | [
"MIT"
] | null | null | null | article/models.py | hexa-yagnenok/myblog | ebba71516ce2ebb6b05fcb8c889a54924b9284c9 | [
"MIT"
] | null | null | null | article/models.py | hexa-yagnenok/myblog | ebba71516ce2ebb6b05fcb8c889a54924b9284c9 | [
"MIT"
] | null | null | null |
# Create your models here. | 47.52 | 112 | 0.768519 | from django.db import models
from ckeditor.fields import RichTextField
# Create your models here.
class Article(models.Model):
author=models.ForeignKey("auth.User",on_delete=models.CASCADE)
title = models.CharField(max_length=50,verbose_name= "Title")
content=RichTextField(verbose_name="Content")
crea... | 8 | 0 | 0 | 1,041 | 0 | 0 | 0 | 27 | 89 |
2ee0c3e1ef08b9ecf5b43f9f4cd90918f39395df | 5,971 | py | Python | lib/util.py | jhkennedy/processflow | c404bd3ad043fd6ae18d4f24d735777574faa660 | [
"MIT"
] | null | null | null | lib/util.py | jhkennedy/processflow | c404bd3ad043fd6ae18d4f24d735777574faa660 | [
"MIT"
] | null | null | null | lib/util.py | jhkennedy/processflow | c404bd3ad043fd6ae18d4f24d735777574faa660 | [
"MIT"
] | null | null | null | import logging
import sys
import traceback
import re
import os
import socket
import jinja2
import json
from shutil import rmtree
from time import sleep
from datetime import datetime
from string import Formatter
from lib.jobstatus import ReverseMap, JobStatus
from mailer import Mailer
from models import DataFile
def... | 30.156566 | 94 | 0.624016 | import logging
import sys
import traceback
import re
import os
import socket
import jinja2
import json
from shutil import rmtree
from time import sleep
from datetime import datetime
from string import Formatter
from lib.jobstatus import ReverseMap, JobStatus
from mailer import Mailer
from models import DataFile
def... | 0 | 0 | 0 | 180 | 0 | 540 | 0 | 0 | 46 |
f4aa9a6ca0730f8fd955fa36c1c422547825b170 | 3,519 | py | Python | lino/utils/mldbc/fields.py | NewRGB/lino | 43799e42107169ff173d3b8bc0324d5773471499 | [
"BSD-2-Clause"
] | 1 | 2019-11-13T19:38:50.000Z | 2019-11-13T19:38:50.000Z | lino/utils/mldbc/fields.py | NewRGB/lino | 43799e42107169ff173d3b8bc0324d5773471499 | [
"BSD-2-Clause"
] | null | null | null | lino/utils/mldbc/fields.py | NewRGB/lino | 43799e42107169ff173d3b8bc0324d5773471499 | [
"BSD-2-Clause"
] | null | null | null | # -*- coding: UTF-8 -*-
# Copyright 2012-2017 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
"""Defines the babel field classes (:class:`BabelCharField` and
:class:`BabelTextField`) and the :class:`LanguageField` class.
**Babel fields** are fields which "generate" in the Django model a
series of normal ... | 31.419643 | 111 | 0.674339 | # -*- coding: UTF-8 -*-
# Copyright 2012-2017 Rumma & Ko Ltd
# License: BSD (see file COPYING for details)
"""Defines the babel field classes (:class:`BabelCharField` and
:class:`BabelTextField`) and the :class:`LanguageField` class.
**Babel fields** are fields which "generate" in the Django model a
series of normal ... | 0 | 0 | 0 | 1,469 | 0 | 0 | 0 | 62 | 137 |
9adec4e977a6a1862dcf1dc6a136a4af18c39044 | 1,100 | py | Python | 2016/day02/day02-pt2.py | mcbor/advent_of_code_2016 | 14453b970d3e0f031ae6a66f2028652b6ed870dd | [
"MIT"
] | 1 | 2016-12-17T10:53:22.000Z | 2016-12-17T10:53:22.000Z | 2016/day02/day02-pt2.py | mcbor/adventofcode | 14453b970d3e0f031ae6a66f2028652b6ed870dd | [
"MIT"
] | null | null | null | 2016/day02/day02-pt2.py | mcbor/adventofcode | 14453b970d3e0f031ae6a66f2028652b6ed870dd | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Advent of Code 2016 - Day 2, Part Two
import sys
from turtle import Vec2D
keypad = [[None, None, '1', None, None],
[None, '2', '3', '4', None],
[ '5', '6', '7', '8', '9'],
[None, 'A', 'B', 'C', None],
[None, None, 'D', None, None]]
moves = ... | 26.829268 | 67 | 0.48 | #!/usr/bin/env python3
# Advent of Code 2016 - Day 2, Part Two
import sys
from turtle import Vec2D
keypad = [[None, None, '1', None, None],
[None, '2', '3', '4', None],
[ '5', '6', '7', '8', '9'],
[None, 'A', 'B', 'C', None],
[None, None, 'D', None, None]]
moves = ... | 0 | 0 | 0 | 0 | 0 | 518 | 0 | 0 | 77 |
49fab2ca3160ce1caa8610ee409dddbe3785c054 | 91 | py | Python | tests/data/directive/conf.py | t4ngo/sphinxcontrib-multilatex | cb63e0ef5d3059aa9db892abfd550a60a1e650a1 | [
"Apache-2.0"
] | 1 | 2016-09-10T10:16:03.000Z | 2016-09-10T10:16:03.000Z | tests/data/directive/conf.py | t4ngo/sphinxcontrib-multilatex | cb63e0ef5d3059aa9db892abfd550a60a1e650a1 | [
"Apache-2.0"
] | null | null | null | tests/data/directive/conf.py | t4ngo/sphinxcontrib-multilatex | cb63e0ef5d3059aa9db892abfd550a60a1e650a1 | [
"Apache-2.0"
] | null | null | null | source_suffix = ".txt"
master_doc = "index"
extensions = ["sphinxcontrib.multilatex"]
| 18.2 | 42 | 0.703297 | source_suffix = ".txt"
master_doc = "index"
extensions = ["sphinxcontrib.multilatex"]
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
c70fb720099cd2599c5ecd57955fdb2d15a4cf94 | 2,282 | py | Python | src/magento2/language-csv-fixer.py | jeremycurny/devops-py | eea36ff2bcd97affaae929a67ed289fe9e462ff0 | [
"MIT"
] | null | null | null | src/magento2/language-csv-fixer.py | jeremycurny/devops-py | eea36ff2bcd97affaae929a67ed289fe9e462ff0 | [
"MIT"
] | null | null | null | src/magento2/language-csv-fixer.py | jeremycurny/devops-py | eea36ff2bcd97affaae929a67ed289fe9e462ff0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import csv, json, operator, os, sys
import xml.etree.ElementTree as ET
composerJsonPath = 'composer.json'
languageXmlPath = 'language.xml'
if not os.path.exists(composerJsonPath):
# File does not exists
print "File " + composerJsonPath + " not found"
sys.exit(1)
if not os.path.exists(lan... | 30.026316 | 93 | 0.608677 | #!/usr/bin/env python
import csv, json, operator, os, sys
import xml.etree.ElementTree as ET
composerJsonPath = 'composer.json'
languageXmlPath = 'language.xml'
if not os.path.exists(composerJsonPath):
# File does not exists
print "File " + composerJsonPath + " not found"
sys.exit(1)
if not os.path.exists(lan... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
44c2d4091b0b65c4e713d3fb92c8d2106838080c | 1,340 | py | Python | mopy/impl/dvonn/action.py | TylerSandman/mopy | df66bb728f6dacee8ee6267a8802a4b71a04fd43 | [
"MIT"
] | null | null | null | mopy/impl/dvonn/action.py | TylerSandman/mopy | df66bb728f6dacee8ee6267a8802a4b71a04fd43 | [
"MIT"
] | null | null | null | mopy/impl/dvonn/action.py | TylerSandman/mopy | df66bb728f6dacee8ee6267a8802a4b71a04fd43 | [
"MIT"
] | null | null | null | """This module contains a representation of an action in the game Dvonn."""
| 31.904762 | 79 | 0.567164 | """This module contains a representation of an action in the game Dvonn."""
from mopy.action import Action
from enum import Enum
class DvonnAction(Action):
class Type(Enum):
PLACE = 1
MOVE = 2
def __init__(self, type_, end, start=None):
"""
Create an action rep... | 0 | 0 | 0 | 1,179 | 0 | 0 | 0 | 9 | 73 |
2f6fc55efb4642bc95fccfcc575e39d053da1f03 | 1,069 | py | Python | data/transcoder_evaluation_gfg/python/COUNT_NUMBERS_CAN_CONSTRUCTED_USING_TWO_NUMBERS.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 241 | 2021-07-20T08:35:20.000Z | 2022-03-31T02:39:08.000Z | data/transcoder_evaluation_gfg/python/COUNT_NUMBERS_CAN_CONSTRUCTED_USING_TWO_NUMBERS.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 49 | 2021-07-22T23:18:42.000Z | 2022-03-24T09:15:26.000Z | data/transcoder_evaluation_gfg/python/COUNT_NUMBERS_CAN_CONSTRUCTED_USING_TWO_NUMBERS.py | mxl1n/CodeGen | e5101dd5c5e9c3720c70c80f78b18f13e118335a | [
"MIT"
] | 71 | 2021-07-21T05:17:52.000Z | 2022-03-29T23:49:28.000Z | # Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
#TOFILL
if __name__ == '__main__':
param = [
(23,16,16,),
(56,95,6,),
(30,63,1,),
(51,89,46,),
(21,99... | 24.860465 | 64 | 0.466791 | # Copyright (c) 2019-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the license found in the
# LICENSE file in the root directory of this source tree.
#
def f_gold ( n , x , y ) :
arr = [ False for i in range ( n + 2 ) ]
if ( x <= n ) :
arr [ x ] = True
if ( y ... | 0 | 0 | 0 | 0 | 0 | 417 | 0 | 0 | 22 |
cb2b2350e7afa94fce2f50c53e2912e1644d082c | 559 | py | Python | python/005/005.py | seaneshbaugh/rosetta-euler | 14f24dfc347e7d9a4c9c0f090acf2811aa65f453 | [
"MIT"
] | 36 | 2015-01-24T08:11:52.000Z | 2021-03-21T00:32:00.000Z | python/005/005.py | seaneshbaugh/rosetta-euler | 14f24dfc347e7d9a4c9c0f090acf2811aa65f453 | [
"MIT"
] | null | null | null | python/005/005.py | seaneshbaugh/rosetta-euler | 14f24dfc347e7d9a4c9c0f090acf2811aa65f453 | [
"MIT"
] | 4 | 2015-01-24T08:17:42.000Z | 2022-01-11T16:10:56.000Z | from operator import mul
from functools import reduce
print(reduce(mul, reduce(overlap, [prime_factors(x) for x in range(1, 21)])))
| 15.108108 | 77 | 0.509839 | from operator import mul
from functools import reduce
def prime_factors(n):
found = False
v = 2
i = 2
while i < n -1 and found == False:
if n % i == 0:
found = True
v = i
i += 1
if found:
factors = [v] + prime_factors(n // v)
else:
f... | 0 | 0 | 0 | 0 | 0 | 380 | 0 | 0 | 46 |
ca7c7edf7ff446e57c190dc6666d3e16fbd106a2 | 792 | py | Python | docker-min/mkimage/just-bash.py | robnagler/container-play | 8f112a1bdaf14d9be0a62a548a08a34f03c193f6 | [
"Apache-2.0"
] | null | null | null | docker-min/mkimage/just-bash.py | robnagler/container-play | 8f112a1bdaf14d9be0a62a548a08a34f03c193f6 | [
"Apache-2.0"
] | null | null | null | docker-min/mkimage/just-bash.py | robnagler/container-play | 8f112a1bdaf14d9be0a62a548a08a34f03c193f6 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# ./mkimage.sh --tag m1 m1.py
from __future__ import absolute_import, division, print_function
import os
import subprocess
import sys
files=[
'/usr/bin/bash',
'/usr/bin/ls',
]
os.chdir(sys.argv[1])
os.umask(0o22)
for d in (
'etc',
'tmp',
'var/tmp',
'usr/bin',
'usr/li... | 16.851064 | 64 | 0.565657 | #!/usr/bin/env python
# ./mkimage.sh --tag m1 m1.py
from __future__ import absolute_import, division, print_function
import os
import shutil
import subprocess
import sys
files=[
'/usr/bin/bash',
'/usr/bin/ls',
]
os.chdir(sys.argv[1])
os.umask(0o22)
for d in (
'etc',
'tmp',
'var/tmp',
'usr/bin... | 0 | 0 | 0 | 0 | 0 | 44 | 0 | -8 | 45 |
d9bda7d97a3a63c0a34725e21d88e1e13fa70eeb | 2,610 | py | Python | ch07/bagging.py | stoneflyop1/py_machine_learning | 18fd635d312f957ca4fcc23d856a1bcd4cf95f48 | [
"MIT"
] | null | null | null | ch07/bagging.py | stoneflyop1/py_machine_learning | 18fd635d312f957ca4fcc23d856a1bcd4cf95f48 | [
"MIT"
] | null | null | null | ch07/bagging.py | stoneflyop1/py_machine_learning | 18fd635d312f957ca4fcc23d856a1bcd4cf95f48 | [
"MIT"
] | null | null | null | import pandas as pd
df_wine = pd.read_csv('../data/wine.data', header=None)
df_wine.columns = [
'Class label', 'Alcohol', 'Malic acid', 'Ash', 'Alcalinity of ash',
'Magnesium', 'TOtal phenols', 'Flavanoids', 'Nonflavanoid phenols',
'Proanthocyanins', 'Color intensity', 'Hue',
'OD280/OD315 of diluted win... | 37.285714 | 82 | 0.702682 | import pandas as pd
df_wine = pd.read_csv('../data/wine.data', header=None)
df_wine.columns = [
'Class label', 'Alcohol', 'Malic acid', 'Ash', 'Alcalinity of ash',
'Magnesium', 'TOtal phenols', 'Flavanoids', 'Nonflavanoid phenols',
'Proanthocyanins', 'Color intensity', 'Hue',
'OD280/OD315 of diluted win... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
44ca70b70e43421fd03a35b311c2fb12bc1b0a12 | 251 | py | Python | scraping/views.py | stepacool/work4sharingPy | c6ffdb3ac8a2956181c290bc4617e3cb11e13dba | [
"MIT"
] | null | null | null | scraping/views.py | stepacool/work4sharingPy | c6ffdb3ac8a2956181c290bc4617e3cb11e13dba | [
"MIT"
] | 5 | 2021-03-19T01:48:51.000Z | 2021-09-22T18:52:20.000Z | scraping/views.py | stepacool/work4sharingPy | c6ffdb3ac8a2956181c290bc4617e3cb11e13dba | [
"MIT"
] | 2 | 2020-04-16T20:23:11.000Z | 2020-04-18T12:35:46.000Z |
# Create your views here.
| 22.818182 | 51 | 0.844622 | from django.shortcuts import render
# Create your views here.
from rest_framework.generics import CreateAPIView
from scraping.serializers import EmployeeSerializer
class CreateEmployeeView(CreateAPIView):
serializer_class = EmployeeSerializer
| 0 | 0 | 0 | 61 | 0 | 0 | 0 | 72 | 90 |
1e70df7c2ef9bce6a79c55efd4279997fce505e9 | 7,610 | py | Python | src/test_verbindung_ms&r.py | technikamateur/robolab | 1509c0c558f5c5d9a6cf944a21e79b07486853a0 | [
"MIT"
] | null | null | null | src/test_verbindung_ms&r.py | technikamateur/robolab | 1509c0c558f5c5d9a6cf944a21e79b07486853a0 | [
"MIT"
] | null | null | null | src/test_verbindung_ms&r.py | technikamateur/robolab | 1509c0c558f5c5d9a6cf944a21e79b07486853a0 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 18 11:15:09 2019
@author: panyongyi
"""
#!/usr/bin/env python3
# Suggestion: Do not import the ev3dev.ev3 module in this file
import paho.mqtt.client as mqtt
import uuid
from planet import Direction
client = mqtt.Client(client_id=str(uuid.uu... | 31.708333 | 236 | 0.595795 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Mar 18 11:15:09 2019
@author: panyongyi
"""
#!/usr/bin/env python3
# Suggestion: Do not import the ev3dev.ev3 module in this file
import json
import paho.mqtt.client as mqtt
import uuid
import time
from planet import Planet, Direction
class Communi... | 0 | 0 | 0 | 6,552 | 0 | 0 | 0 | -12 | 67 |
d7fa780746f7314c474e988e5736d6c252c9a458 | 500 | py | Python | biblio/migrations/0003_book_isbn.py | DanicoSantos/librhes | 616ed1444d47c50dfbd6ecda0d32ee216d2044cb | [
"MIT"
] | null | null | null | biblio/migrations/0003_book_isbn.py | DanicoSantos/librhes | 616ed1444d47c50dfbd6ecda0d32ee216d2044cb | [
"MIT"
] | null | null | null | biblio/migrations/0003_book_isbn.py | DanicoSantos/librhes | 616ed1444d47c50dfbd6ecda0d32ee216d2044cb | [
"MIT"
] | null | null | null | # Generated by Django 3.2.7 on 2021-09-09 18:23
| 26.315789 | 167 | 0.628 | # Generated by Django 3.2.7 on 2021-09-09 18:23
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('biblio', '0002_rename_isbn_book_genre'),
]
operations = [
migrations.AddField(
model_name='book',
name='isbn',
... | 0 | 0 | 0 | 386 | 0 | 0 | 0 | 19 | 46 |
7d614047f48da2ec532109926d3175e03253eb47 | 2,276 | py | Python | pytorch-frontend/caffe2/python/operator_test/channel_backprop_stats_op_test.py | AndreasKaratzas/stonne | 2915fcc46cc94196303d81abbd1d79a56d6dd4a9 | [
"MIT"
] | 40 | 2021-06-01T07:37:59.000Z | 2022-03-25T01:42:09.000Z | pytorch-frontend/caffe2/python/operator_test/channel_backprop_stats_op_test.py | AndreasKaratzas/stonne | 2915fcc46cc94196303d81abbd1d79a56d6dd4a9 | [
"MIT"
] | 14 | 2021-06-01T11:52:46.000Z | 2022-03-25T02:13:08.000Z | pytorch-frontend/caffe2/python/operator_test/channel_backprop_stats_op_test.py | AndreasKaratzas/stonne | 2915fcc46cc94196303d81abbd1d79a56d6dd4a9 | [
"MIT"
] | 7 | 2021-07-20T19:34:26.000Z | 2022-03-13T21:07:36.000Z | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import unittest
if __name__ == "__main__":
unittest.main()
| 36.126984 | 79 | 0.59007 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from caffe2.python import core
import caffe2.python.hypothesis_test_util as hu
from hypothesis import given, settings
import caffe2.python.serialized_test.serialized_test... | 0 | 1,734 | 0 | 37 | 0 | 0 | 0 | 108 | 182 |
47fcdec47eb87ee97751e3275df1278d4abe7646 | 6,012 | py | Python | spycial/erf.py | person142/spycial | d017048c8c09ee0714f438cb75c2e221e068baee | [
"BSD-3-Clause"
] | 6 | 2019-04-04T21:53:40.000Z | 2020-02-10T17:16:40.000Z | spycial/erf.py | person142/special | d017048c8c09ee0714f438cb75c2e221e068baee | [
"BSD-3-Clause"
] | null | null | null | spycial/erf.py | person142/special | d017048c8c09ee0714f438cb75c2e221e068baee | [
"BSD-3-Clause"
] | 1 | 2019-09-14T15:09:21.000Z | 2019-09-14T15:09:21.000Z | """Code adapted from Boost, which is:
(C) Copyright John Maddock 2006.
Use, modification and distribution are subject to the
Boost Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
"""
import numpy as np
P1 = np.array([
-0.000322780120964605683... | 26.72 | 69 | 0.618596 | """Code adapted from Boost, which is:
(C) Copyright John Maddock 2006.
Use, modification and distribution are subject to the
Boost Software License, Version 1.0. (See accompanying file
LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
"""
from numba import njit, vectorize
import numpy as np
from . imp... | 0 | 3,621 | 0 | 0 | 0 | 0 | 0 | 24 | 182 |
729b980ba4203cd8152efa3abec70e7a6d8e8e89 | 2,499 | py | Python | adsa/demo.py | jtkorhonen/droplet-shape-solver | a88422d0505cb5b0b52419758b4e7c1c6910ecfe | [
"MIT"
] | null | null | null | adsa/demo.py | jtkorhonen/droplet-shape-solver | a88422d0505cb5b0b52419758b4e7c1c6910ecfe | [
"MIT"
] | null | null | null | adsa/demo.py | jtkorhonen/droplet-shape-solver | a88422d0505cb5b0b52419758b4e7c1c6910ecfe | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""A simulation and visualization demonstration.
This module runs a simple demonstration of the capabilities of the adsa
simulations and analysis.
"""
| 34.708333 | 95 | 0.585034 | # -*- coding: utf-8 -*-
"""A simulation and visualization demonstration.
This module runs a simple demonstration of the capabilities of the adsa
simulations and analysis.
"""
import logging
from pathlib import Path
import csv
from .solver import simulate_droplet_shape
from .analysis import calculate_volume
from .visu... | 2 | 0 | 0 | 0 | 0 | 2,053 | 0 | 67 | 201 |
31be368eb110b35254e54ddbccc580822d685138 | 14,497 | py | Python | tools/run.py | stamp711/DBx1000 | 928912dd7e005ce5a63ad94fdcde412ab893e678 | [
"ISC"
] | null | null | null | tools/run.py | stamp711/DBx1000 | 928912dd7e005ce5a63ad94fdcde412ab893e678 | [
"ISC"
] | null | null | null | tools/run.py | stamp711/DBx1000 | 928912dd7e005ce5a63ad94fdcde412ab893e678 | [
"ISC"
] | null | null | null |
#scheduler = CondorScheduler()
scheduler = BasicScheduler()
app_flags = {}
trials = ['', '_1', '_2']
trials = ['']
#thds = [4, 8] #, 16, 20, 24, 28, 32]
thds = [8, 16, 32]
thds = [4, 8, 16, 20, 24, 28, 32]
thds = [16]
thds = [4, 8, 16, 24, 32]
num_logger = 4
benchmarks = ['TPCC']
benchmarks = ['YCSB', 'TPCC']
be... | 29.346154 | 82 | 0.631579 | from condor_scheduler import *
from basic_scheduler import *
from helper import *
#scheduler = CondorScheduler()
scheduler = BasicScheduler()
def add_dbms_job(app_flags = {}, executable = "./rundb", output_dir = "results/"):
app_args = " "
for key in app_flags.keys():
if key in args_mapping.keys():
app_args +... | 0 | 0 | 0 | 0 | 0 | 414 | 0 | 16 | 89 |
56e2f739f22e14fa46944fddc6d4bb6c6f1226be | 152 | py | Python | compiled/construct/opaque_with_param.py | smarek/ci_targets | c5edee7b0901fd8e7f75f85245ea4209b38e0cb3 | [
"MIT"
] | 4 | 2017-04-08T12:55:11.000Z | 2020-12-05T21:09:31.000Z | compiled/construct/opaque_with_param.py | smarek/ci_targets | c5edee7b0901fd8e7f75f85245ea4209b38e0cb3 | [
"MIT"
] | 7 | 2018-04-23T01:30:33.000Z | 2020-10-30T23:56:14.000Z | compiled/construct/opaque_with_param.py | smarek/ci_targets | c5edee7b0901fd8e7f75f85245ea4209b38e0cb3 | [
"MIT"
] | 6 | 2017-04-08T11:41:14.000Z | 2020-10-30T22:47:31.000Z |
opaque_with_param = Struct(
'one' / LazyBound(lambda: params_def),
)
_schema = opaque_with_param
| 16.888889 | 39 | 0.763158 | from construct import *
from construct.lib import *
opaque_with_param = Struct(
'one' / LazyBound(lambda: params_def),
)
_schema = opaque_with_param
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | 8 | 44 |
85b9d73931a1a3a5f2a12915b8b01497ab128c23 | 521,619 | py | Python | sympy/integrals/rubi/rules/inverse_hyperbolic.py | STALKER2010/sympy-bleeding-edge | 81233029a9a30866747f6da2c0e9604d1681d474 | [
"BSD-3-Clause"
] | 2 | 2018-12-05T02:30:43.000Z | 2020-11-14T01:43:15.000Z | sympy/integrals/rubi/rules/inverse_hyperbolic.py | STALKER2010/sympy-bleeding-edge | 81233029a9a30866747f6da2c0e9604d1681d474 | [
"BSD-3-Clause"
] | 1 | 2017-10-23T06:56:43.000Z | 2017-10-23T06:56:43.000Z | sympy/integrals/rubi/rules/inverse_hyperbolic.py | STALKER2010/sympy-bleeding-edge | 81233029a9a30866747f6da2c0e9604d1681d474 | [
"BSD-3-Clause"
] | 1 | 2020-10-02T15:05:03.000Z | 2020-10-02T15:05:03.000Z | from sympy.external import import_module
matchpy = import_module("matchpy")
if matchpy:
from sympy import sqrt
from sympy.integrals.rubi.symbol import WC
A_, B_, C_, F_, G_, H_, a_, b_, c_, d_, e_, f_, g_, h_, i_, j_, k_, l_, m_, n_, p_, q_, r_, t_, u_, v_, s_, w_, x_, y_, z_ = [WC(i) for i in 'ABCFGHabcd... | 185.563501 | 6,553 | 0.591269 | from sympy.external import import_module
matchpy = import_module("matchpy")
from sympy.utilities.decorator import doctest_depends_on
if matchpy:
from matchpy import Pattern, ReplacementRule, CustomConstraint
from sympy.integrals.rubi.utility_function import (Int, Set, With, Module, Scan, MapAnd, FalseQ, ZeroQ,... | 0 | 0 | 0 | 0 | 0 | 513,811 | 0 | 6,879 | 201 |
00f674dd269b5ded3bd8cfeb250e25da5e9bb9c5 | 1,777 | py | Python | l19z3.py | hubieva-a/lab19 | 516357b25d62bc7aab9a6b45528b4611adf9acdd | [
"MIT"
] | null | null | null | l19z3.py | hubieva-a/lab19 | 516357b25d62bc7aab9a6b45528b4611adf9acdd | [
"MIT"
] | null | null | null | l19z3.py | hubieva-a/lab19 | 516357b25d62bc7aab9a6b45528b4611adf9acdd | [
"MIT"
] | null | null | null |
root = Tk()
text1 = Text(width=20,height=1)
label1 = Label(width=20)
but1 = Button(width=5, height=5, bg='#ff0000')
but2 = Button(width=5, height=5, bg='#ff7d00')
but3 = Button(width=5, height=5, bg='#ffff00')
but4 = Button(width=5, height=5, bg='#00ff00')
but5 = Button(width=5, height=5, bg='#007dff')
but6... | 26.132353 | 47 | 0.62296 | from tkinter import *
def color_red(event):
text1.delete(1.0, "end")
text1.insert(1.0,'Красный')
label1['text'] = '#ff0000'
def color_orange(event):
text1.delete(1.0, "end")
text1.insert(1.0,'Оранжевый')
label1['text'] = '#ff7d00'
def color_yellow(event):
text1.delete(1.0, "e... | 102 | 0 | 0 | 0 | 0 | 631 | 0 | 0 | 198 |
c78e735101ac48aa6d6991855b779aa1b42eaff5 | 40,950 | py | Python | src/rtl/decoder.py | giraffe50/RISCV-M4F | 1b1ed756a8ea02c2d2a11d8472f8603847170ad8 | [
"Apache-2.0"
] | 3 | 2021-01-13T03:41:14.000Z | 2021-03-23T11:31:48.000Z | src/rtl/decoder.py | scutdig/LG-32HP | 1b1ed756a8ea02c2d2a11d8472f8603847170ad8 | [
"Apache-2.0"
] | 1 | 2021-03-01T09:32:59.000Z | 2021-03-01T09:32:59.000Z | src/rtl/decoder.py | scutdig/LG-32HP | 1b1ed756a8ea02c2d2a11d8472f8603847170ad8 | [
"Apache-2.0"
] | 4 | 2021-01-07T03:01:26.000Z | 2021-02-28T02:20:10.000Z | """
Copyright Digisim, Computer Architecture team of South China University of Technology,
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
... | 53.952569 | 136 | 0.522344 | """
Copyright Digisim, Computer Architecture team of South China University of Technology,
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
... | 0 | 0 | 0 | 34,578 | 0 | 5,154 | 0 | 6 | 110 |
bff925f7c3f355eb5ffbb6f8cb0de00147144a52 | 884 | py | Python | xuexiStudyScore_month_v2.py | g-mitu/timeseries | 3b2daf33f9af022d1aae7c4a9caf69b8abd58348 | [
"BSD-3-Clause"
] | null | null | null | xuexiStudyScore_month_v2.py | g-mitu/timeseries | 3b2daf33f9af022d1aae7c4a9caf69b8abd58348 | [
"BSD-3-Clause"
] | null | null | null | xuexiStudyScore_month_v2.py | g-mitu/timeseries | 3b2daf33f9af022d1aae7c4a9caf69b8abd58348 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Fri May 1 10:16:25 2020
@author: winhl
modify 2022-1-6
"""
import pandas as pd
import json
work_dir = "D:/__E__//"
#n0 = "2021s1p9"
n0 = "2021.01-12.xuexi.cn" #2022-1-6
with open(f"{work_dir}/{n0}.json", "r", encoding="utf-8") as f:
fr = f.read()
j1 =... | 22.666667 | 74 | 0.616516 | # -*- coding: utf-8 -*-
"""
Created on Fri May 1 10:16:25 2020
@author: winhl
modify 2022-1-6
"""
import pandas as pd
import json
work_dir = "D:/__E__/支部/积分"
#n0 = "2021s1p9"
n0 = "2021.01-12.xuexi.cn" #2022-1-6
with open(f"{work_dir}/{n0}.json", "r", encoding="utf-8") as f:
fr = f.read()
... | 18 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
cf9ad7ad972d6588d169b5cc55ce7927f2bf7751 | 799 | py | Python | models.py | seanli3/fastGCN | e3704ae2c96363da0d6318f9f2a53df4384474bf | [
"MIT"
] | 28 | 2020-06-03T01:03:05.000Z | 2022-03-26T16:37:36.000Z | models.py | seanli3/fastGCN | e3704ae2c96363da0d6318f9f2a53df4384474bf | [
"MIT"
] | null | null | null | models.py | seanli3/fastGCN | e3704ae2c96363da0d6318f9f2a53df4384474bf | [
"MIT"
] | 4 | 2020-08-12T07:55:50.000Z | 2022-03-11T05:11:24.000Z | import torch.nn as nn
| 31.96 | 76 | 0.652065 | import torch.nn as nn
import torch.nn.functional as F
from layers import GraphConvolution
class GCN(nn.Module):
def __init__(self, nfeat, nhid, nclass, dropout, sampler):
super().__init__()
self.gc1 = GraphConvolution(nfeat, nhid)
self.gc2 = GraphConvolution(nhid, nclass)
self.dro... | 0 | 0 | 0 | 685 | 0 | 0 | 0 | 24 | 67 |
e2dedf6fb31777077279b3ee42c8daaea82f726d | 10,683 | py | Python | _tbnf/fable_modules/fable_library/reflection.py | thautwarm/Typed-BNF | 897a4a2bd389dcb2ca16c6c773b28f0388336f63 | [
"MIT"
] | 38 | 2022-01-01T06:45:27.000Z | 2022-03-20T14:18:38.000Z | lua_parser/fable_sedlex/fable_modules/fable_library/reflection.py | thautwarm/lua-parser-lark | 06cf19bc8595a70823fc0f67462ca29dd9e118a0 | [
"MIT"
] | 7 | 2021-09-17T16:46:50.000Z | 2021-12-31T20:49:35.000Z | _tbnf/fable_modules/fable_library/reflection.py | thautwarm/typed-bnf | b5694a34fe21a064250f2ef88745d8ebad51eb33 | [
"MIT"
] | 3 | 2022-01-01T07:33:44.000Z | 2022-01-09T11:41:33.000Z | from __future__ import annotations
from typing import Any, Callable, List, Union
Constructor = Callable[..., Any]
EnumCase = List[Union[str, int]]
FieldInfo = List[Union[str, "TypeInfo"]]
PropertyInfo = FieldInfo
obj_type: TypeInfo = TypeInfo(fullname="System.Object")
unit_type: TypeInfo = TypeInfo("Mi... | 27.89295 | 106 | 0.666479 | from __future__ import annotations
from argparse import ArgumentError
import functools
from dataclasses import dataclass
from typing import Any, Callable, List, Optional, Type, Union
from .types import Union as FsUnion, FSharpRef, Record
from .util import equal_arrays_with
Constructor = Callable[..., Any]
EnumCase ... | 0 | 543 | 0 | 0 | 0 | 7,760 | 0 | 83 | 1,284 |
75d1e9be3c0054dda73122202f10bfd3443b59e0 | 13,344 | py | Python | cgal4py/domain_decomp/__init__.py | yuki-inaho/cgal4py | 9e61000c01368f9a16844c243ad6aced8611d055 | [
"BSD-3-Clause"
] | 4 | 2020-01-05T06:31:55.000Z | 2021-03-06T03:11:33.000Z | cgal4py/domain_decomp/__init__.py | yuki-inaho/cgal4py | 9e61000c01368f9a16844c243ad6aced8611d055 | [
"BSD-3-Clause"
] | 1 | 2020-03-21T14:59:03.000Z | 2020-03-21T14:59:03.000Z | cgal4py/domain_decomp/__init__.py | yuki-inaho/cgal4py | 9e61000c01368f9a16844c243ad6aced8611d055 | [
"BSD-3-Clause"
] | 1 | 2021-03-07T07:08:11.000Z | 2021-03-07T07:08:11.000Z | import numpy as np
import cykdtree as kdtree
from cgal4py import PY_MAJOR_VERSION
def tree(method, pts, left_edge, right_edge, periodic, *args, **kwargs):
r"""Get tree for a given domain decomposition schema.
Args:
method (str): Domain decomposition method. Supported options are:
'kdtree':... | 43.465798 | 79 | 0.549086 | import numpy as np
import cykdtree as kdtree
from cgal4py import PY_MAJOR_VERSION
def tree(method, pts, left_edge, right_edge, periodic, *args, **kwargs):
r"""Get tree for a given domain decomposition schema.
Args:
method (str): Domain decomposition method. Supported options are:
'kdtree':... | 0 | 1,305 | 0 | 3,031 | 0 | 0 | 0 | 0 | 46 |
47de195050b2ce241f5bd06bf41a7f034574533c | 787 | py | Python | satsound/migrations/0002_auto_20161110_1753.py | saanobhaai/apman | e07452f54fcb895fb6039b6be63abf3861d7b9cb | [
"MIT"
] | null | null | null | satsound/migrations/0002_auto_20161110_1753.py | saanobhaai/apman | e07452f54fcb895fb6039b6be63abf3861d7b9cb | [
"MIT"
] | null | null | null | satsound/migrations/0002_auto_20161110_1753.py | saanobhaai/apman | e07452f54fcb895fb6039b6be63abf3861d7b9cb | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-11-10 17:53
from __future__ import unicode_literals
| 29.148148 | 116 | 0.631512 | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-11-10 17:53
from __future__ import unicode_literals
import django.db.models.deletion
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('satsound', '0001_initial'),
]
operations = [
... | 0 | 0 | 0 | 575 | 0 | 0 | 0 | 30 | 68 |
65ad5cf978781fc39296c7ef6130f2bc6c3e1a86 | 21,851 | py | Python | attic/pyromsguiwx_old.py | rsoutelino/romsview | 0a44e6ef795ff3580960792836adcc64730994d6 | [
"MIT"
] | 2 | 2021-12-11T19:27:37.000Z | 2022-03-05T04:09:18.000Z | attic/pyromsguiwx_old.py | rsoutelino/romsview | 0a44e6ef795ff3580960792836adcc64730994d6 | [
"MIT"
] | null | null | null | attic/pyromsguiwx_old.py | rsoutelino/romsview | 0a44e6ef795ff3580960792836adcc64730994d6 | [
"MIT"
] | 3 | 2021-11-06T20:17:02.000Z | 2022-01-16T09:23:48.000Z | #!/usr/bin/env python
######################################################
# GUI to vizualize ROMS input/output files
# Sep 2021
# rsoutelino@gmail.com
######################################################
import os
import wx
import datetime as dt
import matplotlib.pyplot as plt
# TO-DO LIST: ======================... | 36.540134 | 103 | 0.565558 | #!/usr/bin/env python
######################################################
# GUI to vizualize ROMS input/output files
# Sep 2021
# rsoutelino@gmail.com
######################################################
import os
import wx
import datetime as dt
from matplotlib.backends.backend_wxagg import FigureCanvasWxAgg as F... | 0 | 0 | 0 | 17,687 | 0 | 1,306 | 0 | 176 | 362 |
700588898a4c3e0a8dc6ac4dc1d2cd5ed25b1673 | 1,464 | py | Python | 02_Math/sum_of_pairwise_hamming_distance.py | Sheetal0601/InterviewBit | 72ba1507278dafac6e5fb81da20d372e3d141348 | [
"MIT"
] | 61 | 2018-02-18T08:16:31.000Z | 2022-02-17T17:18:57.000Z | 02_Math/sum_of_pairwise_hamming_distance.py | Sheetal0601/InterviewBit | 72ba1507278dafac6e5fb81da20d372e3d141348 | [
"MIT"
] | 1 | 2018-02-23T20:06:18.000Z | 2019-12-29T18:52:20.000Z | 02_Math/sum_of_pairwise_hamming_distance.py | Sheetal0601/InterviewBit | 72ba1507278dafac6e5fb81da20d372e3d141348 | [
"MIT"
] | 30 | 2018-03-28T19:02:23.000Z | 2021-07-06T20:00:14.000Z | # Sum of pairwise Hamming Distance
# https://www.interviewbit.com/problems/sum-of-pairwise-hamming-distance/
#
# Hamming distance between two non-negative integers is defined as the number of positions at
# which the corresponding bits are different.
#
# For example,
#
# HammingDistance(2, 7) = 2, as only the first and... | 26.142857 | 99 | 0.503415 | # Sum of pairwise Hamming Distance
# https://www.interviewbit.com/problems/sum-of-pairwise-hamming-distance/
#
# Hamming distance between two non-negative integers is defined as the number of positions at
# which the corresponding bits are different.
#
# For example,
#
# HammingDistance(2, 7) = 2, as only the first and... | 0 | 0 | 0 | 354 | 0 | 0 | 0 | 0 | 23 |
a3630273dbac15d887205a06684a473409e30b99 | 1,865 | py | Python | Python/Algorithms/Machine Learning Algorithms/Naive Bayes in python.py | ThunderZ007/Data-Structures-and-Algorithms | 148415faf6472115f6848b1a4e21b660b6d327da | [
"MIT"
] | 245 | 2020-10-05T14:52:37.000Z | 2022-03-29T07:40:38.000Z | Python/Algorithms/Machine Learning Algorithms/Naive Bayes in python.py | ThunderZ007/Data-Structures-and-Algorithms | 148415faf6472115f6848b1a4e21b660b6d327da | [
"MIT"
] | 521 | 2020-10-05T15:25:29.000Z | 2021-11-09T13:24:01.000Z | Python/Algorithms/Machine Learning Algorithms/Naive Bayes in python.py | ThunderZ007/Data-Structures-and-Algorithms | 148415faf6472115f6848b1a4e21b660b6d327da | [
"MIT"
] | 521 | 2020-10-05T15:29:42.000Z | 2022-03-27T10:22:00.000Z | #!/usr/bin/env python
# coding: utf-8
# In[16]:
#importing required packages
import pandas as pd
from sklearn import preprocessing
from sklearn.naive_bayes import BernoulliNB
clf=BernoulliNB()
#loading the data
dataset=pd.read_csv("C:/Users/ASUS/Downloads/train.csv")
dataset.head()
#getting the description of the ... | 25.202703 | 124 | 0.742091 | #!/usr/bin/env python
# coding: utf-8
# In[16]:
#importing required packages
import pandas as pd
from sklearn import preprocessing
from sklearn.model_selection import train_test_split
from sklearn.naive_bayes import GaussianNB
from sklearn.metrics import accuracy_score
from sklearn.metrics import confusion_matrix
fr... | 0 | 0 | 0 | 0 | 0 | 426 | 0 | 96 | 112 |
44ea9fb9dbeae66a8bc24c2056240e71d2dc20e2 | 464 | py | Python | python/basis/11-string.py | weizhenwei/tech-docs-2016 | 253564a1633e9ec75ac94efede57f52c02b29280 | [
"BSD-2-Clause"
] | 3 | 2017-06-09T08:48:07.000Z | 2020-12-13T10:37:44.000Z | python/basis/11-string.py | weizhenwei/tech-docs-sharetome | 253564a1633e9ec75ac94efede57f52c02b29280 | [
"BSD-2-Clause"
] | null | null | null | python/basis/11-string.py | weizhenwei/tech-docs-sharetome | 253564a1633e9ec75ac94efede57f52c02b29280 | [
"BSD-2-Clause"
] | 4 | 2020-04-29T07:03:44.000Z | 2021-07-25T15:12:15.000Z | #!/usr/bin/env python
import math
var1 = "Hello"
var2 = "Worldpress"
print "var1 = ", var1
print "var2 = ", var2
print "var1[0] = ", var1[0]
print "var2[1:5] = ", var2[1:5]
if ('H' in var1):
print "H is in var1 ", var1
else:
print "H is not in var1 ", var1
if ('H' not in var2):
print "H is not in var2... | 15.466667 | 43 | 0.571121 | #!/usr/bin/env python
import math
var1 = "Hello"
var2 = "Worldpress"
print "var1 = ", var1
print "var2 = ", var2
print "var1[0] = ", var1[0]
print "var2[1:5] = ", var2[1:5]
if ('H' in var1):
print "H is in var1 ", var1
else:
print "H is not in var1 ", var1
if ('H' not in var2):
print "H is not in var2... | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 |
62abacff8a003309f019d0e8ef1a6850d38f3dde | 1,707 | py | Python | gunpowder/tensorflow/local_server.py | trivoldus28/gunpowder | 97e9e64709fb616e2c47567b22d5f11a9234fe48 | [
"MIT"
] | 43 | 2017-05-03T22:27:11.000Z | 2022-02-11T19:07:28.000Z | gunpowder/tensorflow/local_server.py | trivoldus28/gunpowder | 97e9e64709fb616e2c47567b22d5f11a9234fe48 | [
"MIT"
] | 102 | 2017-06-09T10:11:06.000Z | 2022-03-29T13:56:37.000Z | gunpowder/tensorflow/local_server.py | trivoldus28/gunpowder | 97e9e64709fb616e2c47567b22d5f11a9234fe48 | [
"MIT"
] | 43 | 2017-04-25T20:25:17.000Z | 2022-02-11T19:07:34.000Z | import logging
logger = logging.getLogger(__name__)
| 34.836735 | 77 | 0.656122 | import logging
import multiprocessing
import ctypes
from gunpowder.ext import tensorflow as tf
from gunpowder.freezable import Freezable
logger = logging.getLogger(__name__)
class LocalServer(Freezable):
'''Wrapper around ``tf.train.Server`` to create a local server on-demand.
This class is necessary because... | 0 | 836 | 0 | 673 | 0 | 0 | 0 | 34 | 111 |
838b2b92c45e629173b0d35fc53eade12724bb23 | 6,945 | py | Python | src/python/pants/backend/go/tailor.py | williamscs/pants | 4d1f2ca1a58e98c27a26adcb0e9b844a27b75a63 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/go/tailor.py | williamscs/pants | 4d1f2ca1a58e98c27a26adcb0e9b844a27b75a63 | [
"Apache-2.0"
] | null | null | null | src/python/pants/backend/go/tailor.py | williamscs/pants | 4d1f2ca1a58e98c27a26adcb0e9b844a27b75a63 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
| 38.370166 | 109 | 0.694168 | # Copyright 2021 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
import itertools
import os
from dataclasses import dataclass
from typing import Dict, List
from pants.backend.go.module import ResolvedGoModule, ResolveGoModuleRequest
from pants.backend.g... | 0 | 5,222 | 0 | 0 | 0 | 373 | 0 | 674 | 537 |
5e55f73c2a86f2dd55e0bb3efcee4238d5951700 | 44 | py | Python | Cursos/dados.py | FranciscoAlveJr/Bot_Telegram | 9960485a4a25648719ef6fafcb3b02c82db79253 | [
"MIT"
] | null | null | null | Cursos/dados.py | FranciscoAlveJr/Bot_Telegram | 9960485a4a25648719ef6fafcb3b02c82db79253 | [
"MIT"
] | null | null | null | Cursos/dados.py | FranciscoAlveJr/Bot_Telegram | 9960485a4a25648719ef6fafcb3b02c82db79253 | [
"MIT"
] | null | null | null | import os
print(os.getcwd())
| 8.8 | 18 | 0.75 | import os
import cursos
print(os.getcwd())
| 0 | 0 | 0 | 0 | 0 | 0 | 0 | -8 | 22 |