hexsha stringlengths 40 40 | size int64 10 805k | ext stringclasses 6
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 176 | max_stars_repo_name stringlengths 7 114 | max_stars_repo_head_hexsha stringlengths 40 40 | max_stars_repo_licenses listlengths 1 10 | max_stars_count int64 1 191k ⌀ | 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 176 | max_issues_repo_name stringlengths 7 114 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 48.5k ⌀ | 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 176 | max_forks_repo_name stringlengths 7 114 | max_forks_repo_head_hexsha stringlengths 40 40 | 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 10 805k | avg_line_length float64 5.53 11k | max_line_length int64 10 129k | alphanum_fraction float64 0.13 0.93 | content_no_comment stringlengths 0 449k | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f70672aa722039df7c65c58b8395cfaf528b8611 | 2,709 | py | Python | resources/PyInstaller-3.0/build/lib/PyInstaller/hooks/hook-osgeo.py | dvt32/mypymodoro | 7d2db639ea828e4db9caa84cd6f747f542ab22d8 | [
"MIT"
] | null | null | null | resources/PyInstaller-3.0/build/lib/PyInstaller/hooks/hook-osgeo.py | dvt32/mypymodoro | 7d2db639ea828e4db9caa84cd6f747f542ab22d8 | [
"MIT"
] | null | null | null | resources/PyInstaller-3.0/build/lib/PyInstaller/hooks/hook-osgeo.py | dvt32/mypymodoro | 7d2db639ea828e4db9caa84cd6f747f542ab22d8 | [
"MIT"
] | null | null | null | #-----------------------------------------------------------------------------
# Copyright (c) 2015, PyInstaller Development Team.
#
# Distributed under the terms of the GNU General Public License with exception
# for distributing bootloader.
#
# The full license is in the file COPYING.txt, distributed with this softwa... | 35.181818 | 79 | 0.656331 |
from PyInstaller.utils.hooks import collect_data_files
from PyInstaller.compat import is_win, is_darwin
import os
import sys
is_conda = False
datas = collect_data_files('osgeo', subdir=os.path.join('data', 'gdal'))
if len(datas) == 0:
if hasattr(sys, 'real_prefix'):
r... | true | true |
f706739fa5fbb45a327cc6482a6f9e131f810e2c | 1,404 | py | Python | visualizer/plot_mf_param_opt/plot_time_cost_bar.py | buctlab/NIO | 094e688dd1cd3def7f31cd16ff927d4324651422 | [
"Apache-2.0"
] | 4 | 2020-09-23T09:12:10.000Z | 2022-01-17T08:43:32.000Z | visualizer/plot_mf_param_opt/plot_time_cost_bar.py | buctlab/NIO | 094e688dd1cd3def7f31cd16ff927d4324651422 | [
"Apache-2.0"
] | null | null | null | visualizer/plot_mf_param_opt/plot_time_cost_bar.py | buctlab/NIO | 094e688dd1cd3def7f31cd16ff927d4324651422 | [
"Apache-2.0"
] | 5 | 2020-12-02T08:03:55.000Z | 2022-03-05T18:04:00.000Z | import matplotlib.pyplot as plt
import pandas as pd
from numpy import arange, array
import os
import logging
logging.basicConfig()
logger = logging.getLogger('PlotTimeCost')
logger.setLevel('INFO')
class PlotTimeCostBar:
def __init__(self, data, path, show=False):
self.data = data
self.path = pa... | 28.653061 | 89 | 0.608262 | import matplotlib.pyplot as plt
import pandas as pd
from numpy import arange, array
import os
import logging
logging.basicConfig()
logger = logging.getLogger('PlotTimeCost')
logger.setLevel('INFO')
class PlotTimeCostBar:
def __init__(self, data, path, show=False):
self.data = data
self.path = pa... | true | true |
f70673edb1ad0d08db54b71d1e68bb9ae522843f | 684 | py | Python | src/advisor/arch_specific_libs.py | arm-hpc/porting-advisor | c21567d7ecb56da5ee24d56a0dee7776818512dc | [
"Apache-2.0"
] | 13 | 2019-04-03T11:00:07.000Z | 2021-11-26T18:56:28.000Z | src/advisor/arch_specific_libs.py | AGSaidi/porting-advisor | c21567d7ecb56da5ee24d56a0dee7776818512dc | [
"Apache-2.0"
] | 3 | 2020-02-28T15:40:08.000Z | 2020-10-29T12:03:26.000Z | src/advisor/arch_specific_libs.py | AGSaidi/porting-advisor | c21567d7ecb56da5ee24d56a0dee7776818512dc | [
"Apache-2.0"
] | 8 | 2018-09-07T14:27:29.000Z | 2022-03-17T21:34:01.000Z | """
Copyright 2017 Arm Ltd.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distribut... | 32.571429 | 72 | 0.776316 |
ARCH_SPECIFIC_LIBS = ['mkl', 'otherarch']
| true | true |
f70673f5570dd23f5a1dd998aff6e2dbdb0079a2 | 127 | py | Python | tests/secret.sample.py | timgates42/pyqqweibo | 73541a9690c00002a354b2a868b89a21b91e4149 | [
"MIT"
] | 10 | 2015-02-17T10:22:27.000Z | 2020-04-23T07:06:51.000Z | tests/secret.sample.py | timgates42/pyqqweibo | 73541a9690c00002a354b2a868b89a21b91e4149 | [
"MIT"
] | null | null | null | tests/secret.sample.py | timgates42/pyqqweibo | 73541a9690c00002a354b2a868b89a21b91e4149 | [
"MIT"
] | 14 | 2015-01-23T07:11:34.000Z | 2021-11-11T18:53:51.000Z | apiKey = 'yours'
apiSecret = 'yours'
callbackUrl = 'http://fledna.duapp.com/query'
openid = 'yours'
accessToken = 'yours'
| 21.166667 | 46 | 0.677165 | apiKey = 'yours'
apiSecret = 'yours'
callbackUrl = 'http://fledna.duapp.com/query'
openid = 'yours'
accessToken = 'yours'
| true | true |
f70674791126348c11902e49706beab957aa7f7b | 4,373 | py | Python | mfinancials/params.py | tobigs/mfinancials | 38143337d2eaff6b84dc8b521a3410b9d05b0498 | [
"MIT"
] | 8 | 2021-03-17T05:45:52.000Z | 2022-03-29T16:18:06.000Z | mfinancials/params.py | tobigs/mfinancials | 38143337d2eaff6b84dc8b521a3410b9d05b0498 | [
"MIT"
] | 1 | 2021-03-10T19:30:21.000Z | 2021-03-10T19:30:21.000Z | mfinancials/params.py | tobigs/mfinancials | 38143337d2eaff6b84dc8b521a3410b9d05b0498 | [
"MIT"
] | 6 | 2021-05-22T14:45:38.000Z | 2022-03-29T23:04:21.000Z | # https://stockmarketmba.com/globalstockexchanges.php
exchanges = {
'USA': None,
'Germany': 'XETR',
'Hong Kong': 'XHKG',
'Japan': 'XTKS',
'France': 'XPAR',
'Canada': 'XTSE',
'United Kingdom': 'XLON',
'Switzerland': 'XSWX',
'Australia': 'XASX',
'South Korea': 'XKRX',
'The Net... | 18.070248 | 53 | 0.453693 |
exchanges = {
'USA': None,
'Germany': 'XETR',
'Hong Kong': 'XHKG',
'Japan': 'XTKS',
'France': 'XPAR',
'Canada': 'XTSE',
'United Kingdom': 'XLON',
'Switzerland': 'XSWX',
'Australia': 'XASX',
'South Korea': 'XKRX',
'The Netherlands': 'XAMS',
'Spain': 'XMAD',
'Russia':... | true | true |
f706757372648f1bb78c919e84d326060050601e | 1,428 | py | Python | gaphor/services/helpservice/__init__.py | mrmonkington/gaphor | f0fcd4deb90d24b14723840a689fac901f645a43 | [
"Apache-2.0"
] | 1 | 2022-03-20T16:09:42.000Z | 2022-03-20T16:09:42.000Z | gaphor/services/helpservice/__init__.py | mrmonkington/gaphor | f0fcd4deb90d24b14723840a689fac901f645a43 | [
"Apache-2.0"
] | null | null | null | gaphor/services/helpservice/__init__.py | mrmonkington/gaphor | f0fcd4deb90d24b14723840a689fac901f645a43 | [
"Apache-2.0"
] | null | null | null | """About and help services.
(help browser anyone?)
"""
import importlib
import importlib_metadata
from gi.repository import Gtk
from gaphor.abc import ActionProvider, Service
from gaphor.core import action
class HelpService(Service, ActionProvider):
def __init__(self, session):
self.session = session... | 25.052632 | 81 | 0.656162 |
import importlib
import importlib_metadata
from gi.repository import Gtk
from gaphor.abc import ActionProvider, Service
from gaphor.core import action
class HelpService(Service, ActionProvider):
def __init__(self, session):
self.session = session
def shutdown(self):
pass
@property
... | true | true |
f7067627521e33597da4f2ba253134093bbe5702 | 2,245 | py | Python | scripts/docker/gitlab_pull_script.py | DistributedSystemsGroup/sysadmin-dsp | baa3cfddcf34a0ef9e4f13f44593aa7fbb85750a | [
"Apache-2.0"
] | null | null | null | scripts/docker/gitlab_pull_script.py | DistributedSystemsGroup/sysadmin-dsp | baa3cfddcf34a0ef9e4f13f44593aa7fbb85750a | [
"Apache-2.0"
] | null | null | null | scripts/docker/gitlab_pull_script.py | DistributedSystemsGroup/sysadmin-dsp | baa3cfddcf34a0ef9e4f13f44593aa7fbb85750a | [
"Apache-2.0"
] | null | null | null | import requests
import zipfile
import io
import json
import os
import traceback
GITLAB_TOKEN=""
token_header = {'PRIVATE-TOKEN': GITLAB_TOKEN}
GROUP = 'zoe-apps'
ZAPP_STORE_PATH = '/mnt/cephfs/zoe-apps/'
def get_projects(group):
prj_list = []
r = requests.get("http://gitlab.eurecom.fr/api/v4/groups/{}/projec... | 29.539474 | 158 | 0.628508 | import requests
import zipfile
import io
import json
import os
import traceback
GITLAB_TOKEN=""
token_header = {'PRIVATE-TOKEN': GITLAB_TOKEN}
GROUP = 'zoe-apps'
ZAPP_STORE_PATH = '/mnt/cephfs/zoe-apps/'
def get_projects(group):
prj_list = []
r = requests.get("http://gitlab.eurecom.fr/api/v4/groups/{}/projec... | true | true |
f70677404e18700788256cc515b25444d1a1ebcf | 5,883 | py | Python | blur_faces.py | bernardolemos/Automatic_Face_Blurt | 7f9127763b391dacc0f89b62a05fe149f02a065b | [
"MIT"
] | 3 | 2019-06-13T16:00:06.000Z | 2020-02-05T06:07:24.000Z | blur_faces.py | bernardolemos/Automatic_Face_Blurt | 7f9127763b391dacc0f89b62a05fe149f02a065b | [
"MIT"
] | null | null | null | blur_faces.py | bernardolemos/Automatic_Face_Blurt | 7f9127763b391dacc0f89b62a05fe149f02a065b | [
"MIT"
] | 1 | 2020-02-05T06:07:28.000Z | 2020-02-05T06:07:28.000Z | import os
import cv2
import time
import argparse
import numpy as np
from mtcnn import detect_face
import tensorflow as tf
from PIL import Image, ImageDraw
## MTCNN face localizer
def mtcnn_localize_faces(image, pnet, rnet, onet, minsize=20, threshold=[0.7, 0.8, 0.85], factor=0.75):
"""
Localize faces & its lan... | 35.227545 | 125 | 0.539011 | import os
import cv2
import time
import argparse
import numpy as np
from mtcnn import detect_face
import tensorflow as tf
from PIL import Image, ImageDraw
ces(image, pnet, rnet, onet, minsize=20, threshold=[0.7, 0.8, 0.85], factor=0.75):
image = image[:, :, 0:3]
bounding_boxes, landmarks = detect_face.de... | true | true |
f706774ab0f755da20c73a6c6fef7ea6134137eb | 6,859 | py | Python | planning_sat/encoder.py | debbynirwan/planning_sat | 9d685919cba0e02fb8cbfde8979b3f5a3573777e | [
"Apache-2.0"
] | null | null | null | planning_sat/encoder.py | debbynirwan/planning_sat | 9d685919cba0e02fb8cbfde8979b3f5a3573777e | [
"Apache-2.0"
] | null | null | null | planning_sat/encoder.py | debbynirwan/planning_sat | 9d685919cba0e02fb8cbfde8979b3f5a3573777e | [
"Apache-2.0"
] | 1 | 2021-08-10T01:54:59.000Z | 2021-08-10T01:54:59.000Z | """Encoder
Description:
This module encodes Planning Problem to Propositional Formulas in CNF
(Conjunctive Normal Form)
License:
Copyright 2021 Debby Nirwan
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may... | 34.817259 | 76 | 0.564222 | from .pddl_adapter import PlanningProblem
from enum import Enum
from itertools import combinations
class Operator(Enum):
AND = 0,
OR = 1,
IMPLIES = 2
class Clause(object):
def __init__(self, fluent=None):
if fluent:
self._clause = [fluent]
self._single = True
... | true | true |
f70677dc8597d83e2bd3d09d7603a6f282e8a7ce | 472 | py | Python | src/main/libs/neverbounce/verify_email.py | dle8/Kronos | fefa5dc620c8b303016339536d126182c651fa49 | [
"MIT"
] | null | null | null | src/main/libs/neverbounce/verify_email.py | dle8/Kronos | fefa5dc620c8b303016339536d126182c651fa49 | [
"MIT"
] | 2 | 2021-03-31T19:35:51.000Z | 2021-12-13T20:34:59.000Z | src/main/libs/neverbounce/verify_email.py | dle8/Kronos | fefa5dc620c8b303016339536d126182c651fa49 | [
"MIT"
] | 2 | 2020-01-20T20:26:08.000Z | 2021-07-31T18:57:47.000Z | from src.main.config import config
import requests
import json
def validate_email(email):
try:
api_response = requests.post(
config.EMAIL_VERIFICATION_URL.format(config.NEVERBOUNCE_API_KEY, email)
).content
api_response = json.loads(api_response)
if api_response['resul... | 27.764706 | 83 | 0.680085 | from src.main.config import config
import requests
import json
def validate_email(email):
try:
api_response = requests.post(
config.EMAIL_VERIFICATION_URL.format(config.NEVERBOUNCE_API_KEY, email)
).content
api_response = json.loads(api_response)
if api_response['resul... | true | true |
f7067826d1c1dbe6bb41790739f99a7690af8fd0 | 3,956 | py | Python | tests/test_gridcellarea.py | mcuntz/pyjams | 1393c68a9e21a1e7b88291229120641fdaddc998 | [
"MIT"
] | 2 | 2021-11-06T10:44:37.000Z | 2022-03-10T18:13:00.000Z | tests/test_gridcellarea.py | mcuntz/pyjams | 1393c68a9e21a1e7b88291229120641fdaddc998 | [
"MIT"
] | null | null | null | tests/test_gridcellarea.py | mcuntz/pyjams | 1393c68a9e21a1e7b88291229120641fdaddc998 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""
This is the unittest for gridcellarea module.
python -m unittest -v tests/test_gridcellarea.py
python -m pytest --cov=pyjams --cov-report term-missing -v tests/test_gridcellarea.py
"""
import unittest
def _flatten(itr):
import numpy as np
fitr = np.array(itr).flatten()
if len(f... | 32.694215 | 85 | 0.594034 |
import unittest
def _flatten(itr):
import numpy as np
fitr = np.array(itr).flatten()
if len(fitr) == 0:
return list(fitr)
else:
if isinstance(fitr[0], str):
return [ i for i in fitr ]
else:
return [ i if np.isfinite(i) else np.finfo(float).max
... | true | true |
f70678f600702d6632f1d141f8a3b2452abad75b | 28 | py | Python | rlib/algorithms/a2c/__init__.py | MarcioPorto/rlib | 5919f2dc52105000a23a25c31bbac260ca63565f | [
"MIT"
] | 1 | 2019-09-08T08:33:13.000Z | 2019-09-08T08:33:13.000Z | rlib/algorithms/a2c/__init__.py | MarcioPorto/rlib | 5919f2dc52105000a23a25c31bbac260ca63565f | [
"MIT"
] | 26 | 2019-03-15T03:11:21.000Z | 2022-03-11T23:42:46.000Z | rlib/algorithms/a2c/__init__.py | MarcioPorto/rlib | 5919f2dc52105000a23a25c31bbac260ca63565f | [
"MIT"
] | null | null | null | from .agent import A2CAgent
| 14 | 27 | 0.821429 | from .agent import A2CAgent
| true | true |
f70678f85dfd38862c085d75df80208b87c5a08c | 5,484 | py | Python | loan_estimator/loan_estimator.py | sudheernaidu53/other_utils | 8e7f32ff0a3ded3910a957d821d6f4eb15bae3d8 | [
"MIT"
] | null | null | null | loan_estimator/loan_estimator.py | sudheernaidu53/other_utils | 8e7f32ff0a3ded3910a957d821d6f4eb15bae3d8 | [
"MIT"
] | null | null | null | loan_estimator/loan_estimator.py | sudheernaidu53/other_utils | 8e7f32ff0a3ded3910a957d821d6f4eb15bae3d8 | [
"MIT"
] | 1 | 2021-02-12T04:15:33.000Z | 2021-02-12T04:15:33.000Z | # This file is to get a rough estimation of how much you need to pay or how many months you need to pay for a loan
import pandas as pd
import numpy as np
from IPython.display import display
def group(number):
"""show money in laks and crores (indian way of presenting money)"""
s = '%d' % number
groups = [... | 40.323529 | 134 | 0.580233 |
import pandas as pd
import numpy as np
from IPython.display import display
def group(number):
s = '%d' % number
groups = []
groups.append(s[-3:])
s = s[:-3]
while s and s[-1].isdigit():
groups.append(s[-2:])
s = s[:-2]
return s + ','.join(reversed(groups))
class loan:
de... | true | true |
f7067981ef0bca0bb6f5bc61f52e181f4e519911 | 6,923 | py | Python | chap 5/5_5.py | hmhuy2000/Reinforcement-Learning-SuttonBartoI | 97ca9dc11c4cb4fda74b144e658c3eac756131ff | [
"MIT"
] | null | null | null | chap 5/5_5.py | hmhuy2000/Reinforcement-Learning-SuttonBartoI | 97ca9dc11c4cb4fda74b144e658c3eac756131ff | [
"MIT"
] | null | null | null | chap 5/5_5.py | hmhuy2000/Reinforcement-Learning-SuttonBartoI | 97ca9dc11c4cb4fda74b144e658c3eac756131ff | [
"MIT"
] | null | null | null | import numpy as np
import matplotlib.pyplot as plt
from tqdm import trange
import seaborn as sns
import random
# ========================== CFG =======================
class CFG:
HIT = 1
STOP = 0
actions = [STOP, HIT]
WIN = 1
DRAW = 0
LOSE = -1
# ======================== function ==========... | 30.90625 | 135 | 0.535462 | import numpy as np
import matplotlib.pyplot as plt
from tqdm import trange
import seaborn as sns
import random
class CFG:
HIT = 1
STOP = 0
actions = [STOP, HIT]
WIN = 1
DRAW = 0
LOSE = -1
def random_card():
card = np.random.randint(13) + 1
card = min(card, 10)
return card
de... | true | true |
f7067994d4239d7ef09a88efd23d3fc0e3f2bff7 | 1,277 | py | Python | ros2_workspace/src/yakusha/yakusha/__init__.py | ichiro-its/kumo-playground | 26163a5d80a81976482014855cf2796a44182608 | [
"MIT"
] | 1 | 2021-04-25T09:34:20.000Z | 2021-04-25T09:34:20.000Z | ros2_workspace/src/yakusha/yakusha/__init__.py | ichiro-its/kumo-playground | 26163a5d80a81976482014855cf2796a44182608 | [
"MIT"
] | 13 | 2021-03-29T15:55:34.000Z | 2021-05-15T00:18:15.000Z | ros2_workspace/src/yakusha/yakusha/__init__.py | ichiro-its/kumo-playground | 26163a5d80a81976482014855cf2796a44182608 | [
"MIT"
] | 1 | 2021-12-02T01:29:17.000Z | 2021-12-02T01:29:17.000Z | # Copyright (c) 2021 ICHIRO ITS
#
# 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, distribu... | 44.034483 | 79 | 0.784652 |
import yakusha.data_types
from yakusha.json_to_msg import dict_to_msg, json_to_msg
from yakusha.msg_to_json import msg_to_dict, msg_to_json
| true | true |
f7067a8e77562a63acba5a0d4e8fdea154520fbd | 576 | py | Python | fake-news/training-testing-classification-model/fakeNewsModel-CountVectorizer.py | SebastianMM-96/regex-wordToken | 1e707f03638ebe9365974bcced8ab8b0d42c1295 | [
"MIT"
] | null | null | null | fake-news/training-testing-classification-model/fakeNewsModel-CountVectorizer.py | SebastianMM-96/regex-wordToken | 1e707f03638ebe9365974bcced8ab8b0d42c1295 | [
"MIT"
] | null | null | null | fake-news/training-testing-classification-model/fakeNewsModel-CountVectorizer.py | SebastianMM-96/regex-wordToken | 1e707f03638ebe9365974bcced8ab8b0d42c1295 | [
"MIT"
] | null | null | null | # Import the necessary modules
from sklearn.naive_bayes import MultinomialNB
from sklearn import metrics
# Instantiate a Multinomial Naive Bayes classifier: nb_classifier
nb_classifier = MultinomialNB()
# Fit the classifier to the training data
nb_classifier.fit(count_train, y_train)
# Create the predicted tags: pre... | 28.8 | 68 | 0.798611 |
from sklearn.naive_bayes import MultinomialNB
from sklearn import metrics
nb_classifier = MultinomialNB()
nb_classifier.fit(count_train, y_train)
pred = nb_classifier.predict(count_test)
score = metrics.accuracy_score(y_test, pred)
print(score)
cm = metrics.confusion_matrix(y_test, pred, labels=['FAKE', 'REA... | true | true |
f7067b40c3f23c01634b2d6a7d953557c9bdd695 | 3,330 | py | Python | torch/nn/quantized/modules/__init__.py | MagiaSN/pytorch | 7513455c743d3d644b45a804902c1a0d14b69f45 | [
"Intel"
] | 1 | 2021-04-11T08:27:46.000Z | 2021-04-11T08:27:46.000Z | torch/nn/quantized/modules/__init__.py | MagiaSN/pytorch | 7513455c743d3d644b45a804902c1a0d14b69f45 | [
"Intel"
] | 1 | 2022-01-18T12:17:29.000Z | 2022-01-18T12:17:29.000Z | torch/nn/quantized/modules/__init__.py | MagiaSN/pytorch | 7513455c743d3d644b45a804902c1a0d14b69f45 | [
"Intel"
] | 2 | 2021-07-02T10:18:21.000Z | 2021-08-18T10:10:28.000Z | import torch
from torch.nn.modules.pooling import MaxPool2d
from .activation import ReLU6, Hardswish, ELU, LeakyReLU, Sigmoid
from .batchnorm import BatchNorm2d, BatchNorm3d
from .normalization import LayerNorm, GroupNorm, InstanceNorm1d, \
InstanceNorm2d, InstanceNorm3d
from .conv import _ConvNd, Conv1d, Conv2d, ... | 28.706897 | 106 | 0.622523 | import torch
from torch.nn.modules.pooling import MaxPool2d
from .activation import ReLU6, Hardswish, ELU, LeakyReLU, Sigmoid
from .batchnorm import BatchNorm2d, BatchNorm3d
from .normalization import LayerNorm, GroupNorm, InstanceNorm1d, \
InstanceNorm2d, InstanceNorm3d
from .conv import _ConvNd, Conv1d, Conv2d, ... | true | true |
f7067be753cc445b10c0d9912f04875f705e5ab3 | 3,587 | py | Python | tests/common/gcp_type/instance_test.py | aarontp/forseti-security | 6d03c14114468ff6170846392b7d14a0619fa9f0 | [
"Apache-2.0"
] | 921 | 2017-03-09T01:01:24.000Z | 2019-04-16T11:38:25.000Z | tests/common/gcp_type/instance_test.py | aarontp/forseti-security | 6d03c14114468ff6170846392b7d14a0619fa9f0 | [
"Apache-2.0"
] | 1,996 | 2017-03-03T22:07:50.000Z | 2019-04-17T00:02:28.000Z | tests/common/gcp_type/instance_test.py | aarontp/forseti-security | 6d03c14114468ff6170846392b7d14a0619fa9f0 | [
"Apache-2.0"
] | 241 | 2017-03-09T01:00:04.000Z | 2019-04-15T18:53:35.000Z | # Copyright 2017 The Forseti Security Authors. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | 47.826667 | 80 | 0.649847 |
from tests.common.gcp_type.test_data import fake_instance
from tests.unittest_utils import ForsetiTestCase
from google.cloud.forseti.common.gcp_type import instance
class InstanceTest(ForsetiTestCase):
def test_network_interface_creation(self):
network_interfaces = (instance.Instance(
... | true | true |
f7067c61d06353f0f8cb08b8e8817370c131abbf | 14,887 | py | Python | src/data/fetch_sample_suppl_data.py | luiservela/AstraZeneca | 071e23f0111ece0a414ee4c4dc5dfca25c089979 | [
"Unlicense"
] | 3 | 2019-06-27T22:29:05.000Z | 2021-10-05T14:35:51.000Z | src/data/fetch_sample_suppl_data.py | cchamber/AstraZenecaMar19 | 7e6573a3c5e1f9c362a9e6f0abbaf9e5e40f78d7 | [
"Unlicense"
] | null | null | null | src/data/fetch_sample_suppl_data.py | cchamber/AstraZenecaMar19 | 7e6573a3c5e1f9c362a9e6f0abbaf9e5e40f78d7 | [
"Unlicense"
] | 1 | 2021-01-05T18:06:21.000Z | 2021-01-05T18:06:21.000Z | """ Script to fetch supplemental informations about all the samples that are linked with the geo series of interest"""
import numpy as n
import pandas as pd
import pickle
import os
import sys
import re
from urllib.request import urlopen
from urllib.error import HTTPError, URLError
import time
try:
from urllib.error... | 46.962145 | 287 | 0.673742 | import numpy as n
import pandas as pd
import pickle
import os
import sys
import re
from urllib.request import urlopen
from urllib.error import HTTPError, URLError
import time
try:
from urllib.error import HTTPError
except ImportError:
from urllib2 import HTTPError
print("\n## fetch detailed informatio... | true | true |
f7067cb425874240d208eb1146084a66ce2a4c89 | 7,050 | py | Python | test/test_preproc.py | hirano1412/bdpy | cee6f36dcdf4f4d29fc3a6980777e1c3d7c66cbb | [
"MIT"
] | 18 | 2018-01-22T04:18:48.000Z | 2022-03-12T09:42:03.000Z | test/test_preproc.py | hirano1412/bdpy | cee6f36dcdf4f4d29fc3a6980777e1c3d7c66cbb | [
"MIT"
] | 13 | 2018-05-01T08:31:14.000Z | 2022-02-21T06:45:34.000Z | test/test_preproc.py | hirano1412/bdpy | cee6f36dcdf4f4d29fc3a6980777e1c3d7c66cbb | [
"MIT"
] | 15 | 2019-03-04T02:43:46.000Z | 2022-02-17T00:41:47.000Z | '''Tests for bdpy.preprocessor'''
from unittest import TestCase, TestLoader, TextTestRunner
import numpy as np
from scipy.signal import detrend
from bdpy import preproc
class TestPreprocessor(TestCase):
'''Tests of 'preprocessor' module'''
@classmethod
def test_average_sample(cls):
'''Test fo... | 37.700535 | 78 | 0.462695 |
from unittest import TestCase, TestLoader, TextTestRunner
import numpy as np
from scipy.signal import detrend
from bdpy import preproc
class TestPreprocessor(TestCase):
@classmethod
def test_average_sample(cls):
x = np.random.rand(10, 100)
group = np.array([1, 1, 1, 1, 1, 2, 2, 2, 2, 2])... | true | true |
f7067eb59ecf84037cd2076ea887ad6b2e4cbb83 | 6,868 | py | Python | bindings/python/ensmallen_graph/datasets/string/streptomycesflavidovirens.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/streptomycesflavidovirens.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | bindings/python/ensmallen_graph/datasets/string/streptomycesflavidovirens.py | caufieldjh/ensmallen_graph | 14e98b1cdbc73193a84a913d7d4f2b2b3eb2c43a | [
"MIT"
] | null | null | null | """
This file offers the methods to automatically retrieve the graph Streptomyces flavidovirens.
The graph is automatically retrieved from the STRING repository.
Report
---------------------
At the time of rendering these methods (please see datetime below), the graph
had the following characteristics:
Datetime: ... | 35.958115 | 223 | 0.711415 | from typing import Dict
from ..automatic_graph_retrieval import AutomaticallyRetrievedGraph
from ...ensmallen_graph import EnsmallenGraph
def StreptomycesFlavidovirens(
directed: bool = False,
verbose: int = 2,
cache_path: str = "graphs/string",
**additional_graph_kwargs: Dict
) -> EnsmallenGraph:
... | true | true |
f7067f0c5cdbd0b14d1c6a82c25360b73f17bd62 | 1,273 | py | Python | QWeb/internal/user.py | kivipe/qweb | abf5881aa67412e4a243b13a59528a3c80aa2f52 | [
"Apache-2.0"
] | 33 | 2021-03-16T12:26:44.000Z | 2022-03-30T17:44:57.000Z | QWeb/internal/user.py | kivipe/qweb | abf5881aa67412e4a243b13a59528a3c80aa2f52 | [
"Apache-2.0"
] | 24 | 2021-03-18T16:21:37.000Z | 2022-03-24T17:52:14.000Z | QWeb/internal/user.py | kivipe/qweb | abf5881aa67412e4a243b13a59528a3c80aa2f52 | [
"Apache-2.0"
] | 13 | 2021-03-24T17:48:50.000Z | 2022-02-25T03:22:01.000Z | # -*- coding: utf-8 -*-
# --------------------------
# Copyright © 2014 - Qentinel Group.
#
# 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/LIC... | 31.825 | 94 | 0.643362 |
import os
def is_root():
try:
# most likely won't need proper Windows support here anyway.
uid = os.getuid()
except AttributeError:
return False
if uid == 0:
return True
return False
def is_docker():
path = '/proc/self/cgroup'
... | true | true |
f7067f1f8d78ea4f57878f4461fa45b40372e1d9 | 454 | py | Python | money_manager/finance/migrations/0003_auto_20200224_1138.py | peeomid/money_manager | 49957fcd43d1af3045725ad339e72c446b83f1ce | [
"MIT"
] | null | null | null | money_manager/finance/migrations/0003_auto_20200224_1138.py | peeomid/money_manager | 49957fcd43d1af3045725ad339e72c446b83f1ce | [
"MIT"
] | 3 | 2022-02-13T07:39:15.000Z | 2022-02-27T00:44:16.000Z | money_manager/finance/migrations/0003_auto_20200224_1138.py | peeomid/money_manager | 49957fcd43d1af3045725ad339e72c446b83f1ce | [
"MIT"
] | null | null | null | # Generated by Django 2.2.10 on 2020-02-24 11:38
from django.conf import settings
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('finance', '0002_auto_20200224_1125'),
]
operations = [
... | 22.7 | 66 | 0.645374 |
from django.conf import settings
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('finance', '0002_auto_20200224_1125'),
]
operations = [
migrations.AlterUniqueTogether(
... | true | true |
f706803aeae5b59b0dcae40fc38d35e4d2c143e6 | 1,418 | py | Python | migrations/versions/156b555e16b7_.py | barackmaund1/Pitches-app | 9e2b2c1199cc73678caf9a5e52545f3c43bc2e81 | [
"MIT"
] | null | null | null | migrations/versions/156b555e16b7_.py | barackmaund1/Pitches-app | 9e2b2c1199cc73678caf9a5e52545f3c43bc2e81 | [
"MIT"
] | 3 | 2021-06-08T21:27:28.000Z | 2022-03-12T00:27:44.000Z | migrations/versions/156b555e16b7_.py | barackmaund1/Pitches-app | 9e2b2c1199cc73678caf9a5e52545f3c43bc2e81 | [
"MIT"
] | null | null | null | """empty message
Revision ID: 156b555e16b7
Revises: fc1cedce5988
Create Date: 2020-05-04 10:39:56.803842
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '156b555e16b7'
down_revision = 'fc1cedce5988'
branch_labels = None
depends_on = None
def upgrade():
# ... | 30.170213 | 79 | 0.62976 | from alembic import op
import sqlalchemy as sa
revision = '156b555e16b7'
down_revision = 'fc1cedce5988'
branch_labels = None
depends_on = None
def upgrade():
existing_type=sa.VARCHAR(length=256),
nullable=False)
op.alter_column('posts', 'title',
existing_type=sa.VARCHAR(len... | true | true |
f706806019eb320b1f3dec9df1a1d4f26ac8c8f5 | 1,252 | py | Python | compile.py | CubicEngines/Quip | 2a443cf7fa13e433f6acfaa4823b93c733e0b0dc | [
"MIT"
] | null | null | null | compile.py | CubicEngines/Quip | 2a443cf7fa13e433f6acfaa4823b93c733e0b0dc | [
"MIT"
] | null | null | null | compile.py | CubicEngines/Quip | 2a443cf7fa13e433f6acfaa4823b93c733e0b0dc | [
"MIT"
] | null | null | null | import sys
def error():
quit(f'Error on Line {line_num}:\n{line}')
__author__ = 'Aarav Dave'
if len(sys.argv) > 1:
__file__ = sys.argv[1]
else:
__file__ = 'code.qps'
vars = {}
nest = []
with open(__file__) as file:
for line_num, line in enumerate(file.readlines()):
line = line.rstrip()
... | 22.357143 | 54 | 0.423323 | import sys
def error():
quit(f'Error on Line {line_num}:\n{line}')
__author__ = 'Aarav Dave'
if len(sys.argv) > 1:
__file__ = sys.argv[1]
else:
__file__ = 'code.qps'
vars = {}
nest = []
with open(__file__) as file:
for line_num, line in enumerate(file.readlines()):
line = line.rstrip()
... | true | true |
f7068076351b8074e629a22d9147251c2d37a1fd | 759 | py | Python | stanza/__init__.py | danielhers/stanza | d747a7b781da203c286ec51e3842fecb8b0abb15 | [
"Apache-2.0"
] | 1 | 2021-02-28T00:18:45.000Z | 2021-02-28T00:18:45.000Z | stanza/__init__.py | danielhers/stanza | d747a7b781da203c286ec51e3842fecb8b0abb15 | [
"Apache-2.0"
] | null | null | null | stanza/__init__.py | danielhers/stanza | d747a7b781da203c286ec51e3842fecb8b0abb15 | [
"Apache-2.0"
] | 1 | 2020-07-13T17:56:33.000Z | 2020-07-13T17:56:33.000Z | from stanza.pipeline.core import Pipeline
from stanza.models.common.doc import Document
from stanza.utils.resources import download
from stanza._version import __version__, __resources_version__
import logging.config
logging.config.dictConfig(
{
"version": 1,
"disable_existing_loggers": False,
... | 27.107143 | 67 | 0.513834 | from stanza.pipeline.core import Pipeline
from stanza.models.common.doc import Document
from stanza.utils.resources import download
from stanza._version import __version__, __resources_version__
import logging.config
logging.config.dictConfig(
{
"version": 1,
"disable_existing_loggers": False,
... | true | true |
f70681fdd9cd359066a40a0b208e8e3a58187948 | 531 | py | Python | thingsusers/utils.py | e-k-m/thingsusers | e186376b51952737b18705b469b14ad6dd9d2481 | [
"MIT"
] | null | null | null | thingsusers/utils.py | e-k-m/thingsusers | e186376b51952737b18705b469b14ad6dd9d2481 | [
"MIT"
] | null | null | null | thingsusers/utils.py | e-k-m/thingsusers | e186376b51952737b18705b469b14ad6dd9d2481 | [
"MIT"
] | null | null | null | # NOTE: A place for helper utilities and decorators.
from wtoolzexceptions import exceptions
import flask
import marshmallow
def parse(schema, location):
if location == "args":
p = flask.request.args
elif location == "json":
p = flask.request.json
elif location == "view_args":
p ... | 24.136364 | 66 | 0.6629 |
from wtoolzexceptions import exceptions
import flask
import marshmallow
def parse(schema, location):
if location == "args":
p = flask.request.args
elif location == "json":
p = flask.request.json
elif location == "view_args":
p = flask.request.view_args
else:
raise Va... | true | true |
f706824abe4a1ad64505bc54311236e8f12ff42d | 2,163 | py | Python | P14a_mapper.py | victordpc/Ejercicios-CyBD | eb61068ac53614a28338a3a4ea7250ad67b18649 | [
"MIT"
] | 2 | 2019-02-05T16:08:48.000Z | 2019-10-01T13:19:12.000Z | P14a_mapper.py | victordpc/Ejercicios-CyBD | eb61068ac53614a28338a3a4ea7250ad67b18649 | [
"MIT"
] | null | null | null | P14a_mapper.py | victordpc/Ejercicios-CyBD | eb61068ac53614a28338a3a4ea7250ad67b18649 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# Victor del Pino
import sys
import re
linea = 0
ignorar = ""
contador = 100
impreso=0
"""
f1 = open('../ext/movies/movies.csv', 'r')
for line in f1:
if linea == 0:
re.sub(r'^\W+|\W+$', '', ignorar)
linea = linea + 1
else:
line = re.sub(r'^\W+|\W+$', '', line) # pa... | 26.060241 | 91 | 0.47804 |
import sys
import re
linea = 0
ignorar = ""
contador = 100
impreso=0
f1 = open('../ext/movies/movies.csv', 'r')
f2 = open('../ext/movies/ratings.csv', 'r')
for line in f1:
if linea == 0:
re.sub(r'^\W+|\W+$', '', ignorar)
linea = linea + 1
else:
line = re.sub(r'^\W+|\W+$', '', line) ... | true | true |
f70683b2fced3d16338a58a7e54703c6b71a3f8f | 211 | py | Python | tkp/telescope/lofar/__init__.py | ajstewart/tkp | 2aab1d021d10e3d1f3c4c8a836aea96ac6ae413f | [
"BSD-2-Clause"
] | 9 | 2015-04-30T22:10:14.000Z | 2020-06-09T01:24:20.000Z | tkp/telescope/lofar/__init__.py | ajstewart/tkp | 2aab1d021d10e3d1f3c4c8a836aea96ac6ae413f | [
"BSD-2-Clause"
] | 218 | 2015-01-08T11:10:57.000Z | 2021-11-25T05:52:42.000Z | tkp/telescope/lofar/__init__.py | ajstewart/tkp | 2aab1d021d10e3d1f3c4c8a836aea96ac6ae413f | [
"BSD-2-Clause"
] | 14 | 2015-03-11T11:21:58.000Z | 2020-06-16T09:15:57.000Z | """
Functions for calculating LOFAR hardware specific properties.
"""
import tkp.telescope.lofar.antennaarrays
import tkp.telescope.lofar.beam
import tkp.telescope.lofar.noise
import tkp.telescope.lofar.quality
| 26.375 | 61 | 0.829384 | import tkp.telescope.lofar.antennaarrays
import tkp.telescope.lofar.beam
import tkp.telescope.lofar.noise
import tkp.telescope.lofar.quality
| true | true |
f70684742df3517801cf56522e48f2624556b116 | 31,181 | py | Python | camkes/visualCAmkES/View/Instance_Widget.py | aisamanra/camkes-tool | 4bcf3f22ef7e73f8755ca1b5e7165dd6a23e89f3 | [
"BSD-2-Clause"
] | null | null | null | camkes/visualCAmkES/View/Instance_Widget.py | aisamanra/camkes-tool | 4bcf3f22ef7e73f8755ca1b5e7165dd6a23e89f3 | [
"BSD-2-Clause"
] | null | null | null | camkes/visualCAmkES/View/Instance_Widget.py | aisamanra/camkes-tool | 4bcf3f22ef7e73f8755ca1b5e7165dd6a23e89f3 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2017, Data61
# Commonwealth Scientific and Industrial Research Organisation (CSIRO)
# ABN 41 687 119 230.
#
# This software may be distributed and modified according to the terms of
# the BSD 2-Clause license. Note that NO WARRANTY is provided.
# See "LICENSE_... | 36.640423 | 120 | 0.62692 |
import six
import math
from PyQt5 import QtGui, QtWidgets, QtCore
import Connection_Widget
from Model import Common
from Interface.Property import PropertyInterface
from Instance_Property_Widget import InstancePropertyWidget
class InstanceWidget(QtWidgets.QGraphicsWidget, PropertyInterface):
"""
... | false | true |
f70684c21cdc11e1cb9dd4dc9d7fff19496733ff | 4,649 | py | Python | dooble/marble.py | dbrattli/dooble | 87ab281e3448a8d8246bd851cbaa1bed2804b13c | [
"MIT"
] | 5 | 2019-02-14T05:07:29.000Z | 2020-09-24T10:56:53.000Z | dooble/marble.py | dbrattli/dooble | 87ab281e3448a8d8246bd851cbaa1bed2804b13c | [
"MIT"
] | 7 | 2019-04-04T21:02:51.000Z | 2019-05-27T21:06:55.000Z | dooble/marble.py | dbrattli/dooble | 87ab281e3448a8d8246bd851cbaa1bed2804b13c | [
"MIT"
] | 2 | 2019-04-04T15:15:41.000Z | 2019-05-25T05:29:45.000Z | from collections import namedtuple
Item = namedtuple('Item', ['item', 'at'])
ObsItem = namedtuple('ObsItem', ['at'])
Link = namedtuple('Link', ['from_x', 'from_y', 'to_x', 'to_y'])
class Observable(object):
def __init__(self, start, is_child=False):
self.label = None
self.start = start
se... | 30.788079 | 74 | 0.533018 | from collections import namedtuple
Item = namedtuple('Item', ['item', 'at'])
ObsItem = namedtuple('ObsItem', ['at'])
Link = namedtuple('Link', ['from_x', 'from_y', 'to_x', 'to_y'])
class Observable(object):
def __init__(self, start, is_child=False):
self.label = None
self.start = start
se... | true | true |
f70685e0539561c43c36173cbae2e2e58063b06a | 3,874 | py | Python | RankAggregation/SimpleRankAggregation.py | ogarokpeter/gene_network_sirius_2019 | 419cc430dbde4332acf5cd6eb5cfa669270c53af | [
"MIT"
] | null | null | null | RankAggregation/SimpleRankAggregation.py | ogarokpeter/gene_network_sirius_2019 | 419cc430dbde4332acf5cd6eb5cfa669270c53af | [
"MIT"
] | null | null | null | RankAggregation/SimpleRankAggregation.py | ogarokpeter/gene_network_sirius_2019 | 419cc430dbde4332acf5cd6eb5cfa669270c53af | [
"MIT"
] | 1 | 2019-03-08T18:03:35.000Z | 2019-03-08T18:03:35.000Z | # RUN WITH /usr/bin/python3 minet.py (python 3.6)
import sys
import numpy as np
from sklearn.metrics import roc_curve, auc
import pandas as pd
def compute_aggregated_matrix(matrixfiles_num, matrixfiles, savematrixfile, saveresultfile, coeffs=[1, 1, 1, 1]):
# matrixfiles_num = int(sys.argv[1])
# matrixfiles =... | 42.571429 | 259 | 0.675529 |
import sys
import numpy as np
from sklearn.metrics import roc_curve, auc
import pandas as pd
def compute_aggregated_matrix(matrixfiles_num, matrixfiles, savematrixfile, saveresultfile, coeffs=[1, 1, 1, 1]):
matrices = [pd.read_csv(f, index_col=0, sep='\t') for f in matrixfiles]
genes = m... | true | true |
f70687b778ebfb0d162e0f4310736908c09258ba | 1,849 | py | Python | task/views.py | soltanoff/dj_task_queue | b219756d607d7b42bd33d8d603cad7a425962011 | [
"MIT"
] | null | null | null | task/views.py | soltanoff/dj_task_queue | b219756d607d7b42bd33d8d603cad7a425962011 | [
"MIT"
] | 1 | 2018-12-03T11:32:52.000Z | 2018-12-03T11:32:52.000Z | task/views.py | soltanoff/dj_task_queue | b219756d607d7b42bd33d8d603cad7a425962011 | [
"MIT"
] | null | null | null | from django.core.exceptions import ObjectDoesNotExist
from django.http import JsonResponse
from rest_framework import status, permissions
from rest_framework.decorators import api_view, permission_classes
from task.models import TaskModel, Status
from worker import WORKER_LIST
from worker.settings import NEW_TASK_EVEN... | 32.438596 | 114 | 0.699297 | from django.core.exceptions import ObjectDoesNotExist
from django.http import JsonResponse
from rest_framework import status, permissions
from rest_framework.decorators import api_view, permission_classes
from task.models import TaskModel, Status
from worker import WORKER_LIST
from worker.settings import NEW_TASK_EVEN... | true | true |
f706884e7a7754bdc52b2c2781865c4714f7005d | 11,512 | py | Python | sciencebeam_trainer_delft/sequence_labelling/models.py | elifesciences/sciencebeam-trainer-delft | 0f7da96cdf32acf1538a5fded192255158883ba0 | [
"MIT"
] | 5 | 2019-10-19T13:00:34.000Z | 2022-01-16T17:31:42.000Z | sciencebeam_trainer_delft/sequence_labelling/models.py | elifesciences/sciencebeam-trainer-delft | 0f7da96cdf32acf1538a5fded192255158883ba0 | [
"MIT"
] | 162 | 2019-08-22T10:28:46.000Z | 2022-03-28T17:33:16.000Z | sciencebeam_trainer_delft/sequence_labelling/models.py | elifesciences/sciencebeam-trainer-delft | 0f7da96cdf32acf1538a5fded192255158883ba0 | [
"MIT"
] | null | null | null | import logging
import json
from typing import List, Type, Union
from keras.models import Model
from keras.layers.merge import Concatenate
from keras.layers import (
Dense, LSTM, Bidirectional, Embedding, Input, Dropout,
TimeDistributed
)
import delft.sequenceLabelling.wrapper
from delft.utilities.layers impor... | 35.421538 | 98 | 0.663134 | import logging
import json
from typing import List, Type, Union
from keras.models import Model
from keras.layers.merge import Concatenate
from keras.layers import (
Dense, LSTM, Bidirectional, Embedding, Input, Dropout,
TimeDistributed
)
import delft.sequenceLabelling.wrapper
from delft.utilities.layers impor... | true | true |
f70688b8660b92134638c30597da19a14dcc7551 | 3,840 | py | Python | rqalpha/utils/default_future_info.py | tigerlee/rqalpha | 5ff9f30bb39922ba0520a49595e0757778046aa5 | [
"Apache-2.0"
] | 1 | 2019-04-22T14:29:24.000Z | 2019-04-22T14:29:24.000Z | rqalpha/utils/default_future_info.py | 1M15M3/rqalpha | eeee5859c30728a2dbc5d6a30a7ebcc6fde8b5ee | [
"Apache-2.0"
] | null | null | null | rqalpha/utils/default_future_info.py | 1M15M3/rqalpha | eeee5859c30728a2dbc5d6a30a7ebcc6fde8b5ee | [
"Apache-2.0"
] | 1 | 2021-11-03T15:42:57.000Z | 2021-11-03T15:42:57.000Z | # -*- coding: utf-8 -*-
#
# Copyright 2017 Ricequant, Inc
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | 40 | 124 | 0.639583 |
from datetime import time
from rqalpha.utils.datetime_func import TimeRange
TRADING_PERIOD_DICT = dict()
STOCK_TRADING_PERIOD = [
TimeRange(start=time(9, 31), end=time(11, 30)),
TimeRange(start=time(13, 1), end=time(15, 0)),
]
time_period1 = [
TimeRange(start=time(9, 1), end=time(10, 15... | true | true |
f70689c0598e37b23f537d8430a44fbf7482c1f0 | 1,184 | py | Python | explorer/apps.py | vrjbvishnu/django-sql-explorer | b3b52e6dc1af6c73558bda8da7aecd5ce01e3591 | [
"MIT"
] | 4 | 2020-01-25T22:42:00.000Z | 2020-03-27T21:18:06.000Z | explorer/apps.py | vrjbvishnu/django-sql-explorer | b3b52e6dc1af6c73558bda8da7aecd5ce01e3591 | [
"MIT"
] | null | null | null | explorer/apps.py | vrjbvishnu/django-sql-explorer | b3b52e6dc1af6c73558bda8da7aecd5ce01e3591 | [
"MIT"
] | 2 | 2020-02-27T16:56:46.000Z | 2020-02-27T20:29:43.000Z | from django.apps import AppConfig
from django.db import connections as djcs
from django.core.exceptions import ImproperlyConfigured
class ExplorerAppConfig(AppConfig):
name = 'explorer'
def ready(self):
from explorer.schema import build_async_schemas
_validate_connections()
build_asy... | 30.358974 | 116 | 0.722973 | from django.apps import AppConfig
from django.db import connections as djcs
from django.core.exceptions import ImproperlyConfigured
class ExplorerAppConfig(AppConfig):
name = 'explorer'
def ready(self):
from explorer.schema import build_async_schemas
_validate_connections()
build_asy... | true | true |
f70689f798224a5c75433d169d757edae96203a8 | 1,658 | py | Python | webscraper/defib/scrapers.py | Ba12ley/webscraper | 3deb6a88a23727eaa6fb2167e860f94c0e7bf68d | [
"MIT"
] | null | null | null | webscraper/defib/scrapers.py | Ba12ley/webscraper | 3deb6a88a23727eaa6fb2167e860f94c0e7bf68d | [
"MIT"
] | null | null | null | webscraper/defib/scrapers.py | Ba12ley/webscraper | 3deb6a88a23727eaa6fb2167e860f94c0e7bf68d | [
"MIT"
] | null | null | null | # #beautifulsoup does not work with dynamically created sites
# import requests
# from bs4 import BeautifulSoup
# # The url to scrape added in tasks.py
# # URL = "https://www.opendatani.gov.uk/dataset?q=defib|AED|defibrilator"
#
#
# def scrape(url):
# # set the page and use the requests page on the url
# page =... | 36.043478 | 97 | 0.701448 | romeOptions()
options.add_argument(" - incognito")
browser = webdriver.Chrome(executable_path='./chromedriver', chrome_options=options)
browser.get(url)
timeout = 10
try:
WebDriverWait(browser, timeout).until(
EC.visibility_of_element_located(
(By.XPATH, "//ul[@c... | true | true |
f7068bc6c60087b910cdc44596395b69eac9610e | 1,631 | py | Python | processing/data_collection/gazette/spiders/mg_contagem.py | jobedylbas/querido-diario | d6f755854ed707cbb4ba37067787712f7a44faca | [
"MIT"
] | 2 | 2020-10-16T20:06:19.000Z | 2020-10-20T01:59:30.000Z | processing/data_collection/gazette/spiders/mg_contagem.py | GinLuc/querido-diario | 90b1619b9c50e0e7f9bd754e80a5708188e05e54 | [
"MIT"
] | 4 | 2021-02-10T02:36:48.000Z | 2022-03-02T14:55:34.000Z | processing/data_collection/gazette/spiders/mg_contagem.py | GinLuc/querido-diario | 90b1619b9c50e0e7f9bd754e80a5708188e05e54 | [
"MIT"
] | null | null | null | import dateparser
from gazette.items import Gazette
from gazette.spiders.base import BaseGazetteSpider
class MgContagemSpider(BaseGazetteSpider):
TERRITORY_ID = "3118601"
name = "mg_contagem"
allowed_domains = ["contagem.mg.gov.br"]
start_urls = ["http://www.contagem.mg.gov.br/?se=doc"]
def parse... | 33.979167 | 86 | 0.590435 | import dateparser
from gazette.items import Gazette
from gazette.spiders.base import BaseGazetteSpider
class MgContagemSpider(BaseGazetteSpider):
TERRITORY_ID = "3118601"
name = "mg_contagem"
allowed_domains = ["contagem.mg.gov.br"]
start_urls = ["http://www.contagem.mg.gov.br/?se=doc"]
def parse... | true | true |
f7068f0a19221ca72216f8f3e7b17a296c07a979 | 2,774 | py | Python | core/agents/models/customs/da3.py | Yoshi-0921/MAEXP | cc03fdd46db9b1838df8f7782b4bd1b2bb3f11d5 | [
"MIT"
] | null | null | null | core/agents/models/customs/da3.py | Yoshi-0921/MAEXP | cc03fdd46db9b1838df8f7782b4bd1b2bb3f11d5 | [
"MIT"
] | 10 | 2021-07-04T06:32:59.000Z | 2021-11-06T04:05:24.000Z | core/agents/models/customs/da3.py | Yoshi-0921/MAEXP | cc03fdd46db9b1838df8f7782b4bd1b2bb3f11d5 | [
"MIT"
] | null | null | null | """Source code for distributed attentional actor architecture (DA3) model.
Author: Yoshinari Motokawa <yoshinari.moto@fuji.waseda.jp>
"""
from typing import List
import torch
from core.utils.logging import initialize_logging
from omegaconf import DictConfig
from torch import nn
from ..hard_shrink_attention import Ha... | 29.827957 | 87 | 0.612473 | from typing import List
import torch
from core.utils.logging import initialize_logging
from omegaconf import DictConfig
from torch import nn
from ..hard_shrink_attention import HardShrinkBlock
from ..vit import Block, PatchEmbed
logger = initialize_logging(__name__)
class DA3(nn.Module):
def __init__(self, con... | true | true |
f7068f5658b2b1c4e4c19c1dc0c4c9b77820a6f6 | 1,518 | py | Python | src/urlcaching.py | chris-ch/sec-edgar | aa2192d42583ee839e345c1ff3394758134a3f35 | [
"Apache-2.0"
] | null | null | null | src/urlcaching.py | chris-ch/sec-edgar | aa2192d42583ee839e345c1ff3394758134a3f35 | [
"Apache-2.0"
] | null | null | null | src/urlcaching.py | chris-ch/sec-edgar | aa2192d42583ee839e345c1ff3394758134a3f35 | [
"Apache-2.0"
] | null | null | null | import logging
import shelve
from ftplib import FTP
import requests
import requests_cache
from io import BytesIO
_cache_file_path = None
def set_cache_http(cache_file_path):
requests_cache.install_cache(cache_file_path)
def open_url(url):
return requests.get(url).text
def set_cache_ftp(cache_file_path):... | 23.353846 | 80 | 0.646245 | import logging
import shelve
from ftplib import FTP
import requests
import requests_cache
from io import BytesIO
_cache_file_path = None
def set_cache_http(cache_file_path):
requests_cache.install_cache(cache_file_path)
def open_url(url):
return requests.get(url).text
def set_cache_ftp(cache_file_path):... | true | true |
f7068f8d25bbd05cb4f16af045f2ca4797f6eda3 | 1,361 | py | Python | exps/default/nano.py | itec-hust/MusicYOLO | d980a0c0a3723a6c25772c2f7150a82baa1a4ec3 | [
"Apache-2.0"
] | 1 | 2022-01-29T15:47:50.000Z | 2022-01-29T15:47:50.000Z | exps/default/nano.py | xk-wang/MusicYOLO | d980a0c0a3723a6c25772c2f7150a82baa1a4ec3 | [
"Apache-2.0"
] | null | null | null | exps/default/nano.py | xk-wang/MusicYOLO | d980a0c0a3723a6c25772c2f7150a82baa1a4ec3 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
# -*- coding:utf-8 -*-
# Copyright (c) Megvii, Inc. and its affiliates.
import os
import torch.nn as nn
from yolox.exp import Exp as MyExp
class Exp(MyExp):
def __init__(self):
super(Exp, self).__init__()
self.depth = 0.33
self.width = 0.25
... | 33.195122 | 100 | 0.577517 |
import os
import torch.nn as nn
from yolox.exp import Exp as MyExp
class Exp(MyExp):
def __init__(self):
super(Exp, self).__init__()
self.depth = 0.33
self.width = 0.25
self.scale = (0.5, 1.5)
self.random_size = (10, 20)
self.test_size = (416, 4... | true | true |
f7069193e3c783cb9050783e8ee2273abc656995 | 370 | py | Python | Vault7/Lost-in-Translation/windows/Resources/Ops/PyScripts/overseer/plugins/shares.py | dendisuhubdy/grokmachine | 120a21a25c2730ed356739231ec8b99fc0575c8b | [
"BSD-3-Clause"
] | 46 | 2017-05-15T11:15:08.000Z | 2018-07-02T03:32:52.000Z | Vault7/Lost-in-Translation/windows/Resources/Ops/PyScripts/overseer/plugins/shares.py | dendisuhubdy/grokmachine | 120a21a25c2730ed356739231ec8b99fc0575c8b | [
"BSD-3-Clause"
] | null | null | null | Vault7/Lost-in-Translation/windows/Resources/Ops/PyScripts/overseer/plugins/shares.py | dendisuhubdy/grokmachine | 120a21a25c2730ed356739231ec8b99fc0575c8b | [
"BSD-3-Clause"
] | 24 | 2017-05-17T03:26:17.000Z | 2018-07-09T07:00:50.000Z |
import dsz
MENU_TEXT = 'Run shares commands'
def main():
dsz.ui.Echo('Running shares -list and shares -query...', dsz.GOOD)
dsz.control.echo.Off()
dsz.cmd.Run('background log shares -list', dsz.RUN_FLAG_RECORD)
dsz.cmd.Run('background log shares -query', dsz.RUN_FLAG_RECORD)
dsz.control.e... | 30.833333 | 71 | 0.662162 |
import dsz
MENU_TEXT = 'Run shares commands'
def main():
dsz.ui.Echo('Running shares -list and shares -query...', dsz.GOOD)
dsz.control.echo.Off()
dsz.cmd.Run('background log shares -list', dsz.RUN_FLAG_RECORD)
dsz.cmd.Run('background log shares -query', dsz.RUN_FLAG_RECORD)
dsz.control.e... | true | true |
f70691ad03a30e679f0179ffa0bb507c498f2867 | 648 | py | Python | repos/system_upgrade/el7toel8/actors/removebootfiles/actor.py | panovotn/leapp-repository | e80bdbf65393e68bc2e91b43b46fdd9b9b787878 | [
"Apache-2.0"
] | null | null | null | repos/system_upgrade/el7toel8/actors/removebootfiles/actor.py | panovotn/leapp-repository | e80bdbf65393e68bc2e91b43b46fdd9b9b787878 | [
"Apache-2.0"
] | 1 | 2020-06-15T18:32:21.000Z | 2020-06-15T18:32:21.000Z | repos/system_upgrade/el7toel8/actors/removebootfiles/actor.py | panovotn/leapp-repository | e80bdbf65393e68bc2e91b43b46fdd9b9b787878 | [
"Apache-2.0"
] | null | null | null | from leapp.actors import Actor
from leapp.libraries.actor.library import remove_boot_files
from leapp.models import BootContent
from leapp.tags import IPUWorkflowTag, PreparationPhaseTag
class RemoveBootFiles(Actor):
"""
Remove Leapp provided initramfs from boot partition.
Since Leapp provided initramfs ... | 29.454545 | 95 | 0.75 | from leapp.actors import Actor
from leapp.libraries.actor.library import remove_boot_files
from leapp.models import BootContent
from leapp.tags import IPUWorkflowTag, PreparationPhaseTag
class RemoveBootFiles(Actor):
name = 'remove_boot_files'
consumes = (BootContent,)
produces = ()
tags = (IPUWorkfl... | true | true |
f706928635f24a19e6d86ce8a2ee5af95fa8a1a9 | 2,296 | py | Python | mainService/mainService/apps/core_sample/migrations/0001_initial.py | Godis715/Core-Sample-Analysis | 892b3d322e9ce86dab0da9754b902b504b2e0d8b | [
"Apache-2.0"
] | 2 | 2019-09-18T10:59:21.000Z | 2019-10-02T16:50:05.000Z | mainService/mainService/apps/core_sample/migrations/0001_initial.py | Godis715/Core-Sample-Analysis | 892b3d322e9ce86dab0da9754b902b504b2e0d8b | [
"Apache-2.0"
] | 78 | 2019-09-20T16:56:18.000Z | 2022-03-12T00:04:37.000Z | mainService/mainService/apps/core_sample/migrations/0001_initial.py | Godis715/Core-Sample-Analysis | 892b3d322e9ce86dab0da9754b902b504b2e0d8b | [
"Apache-2.0"
] | 1 | 2019-10-03T20:49:34.000Z | 2019-10-03T20:49:34.000Z | # Generated by Django 2.2.6 on 2019-10-13 23:29
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
... | 44.153846 | 161 | 0.593641 |
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]
operations = [
migrations.Crea... | true | true |
f70692a8ae432dd5887db3d1d7913f7a3126fe50 | 13,474 | py | Python | LightBerries/LightStrings.py | joeferg425/ws281x_lightberries | c6a5a3ffeeb3642b34e3e6e3b759af9e4725efce | [
"MIT"
] | 1 | 2021-06-30T08:22:40.000Z | 2021-06-30T08:22:40.000Z | LightBerries/LightStrings.py | joeferg425/ws281x_lightberries | c6a5a3ffeeb3642b34e3e6e3b759af9e4725efce | [
"MIT"
] | null | null | null | LightBerries/LightStrings.py | joeferg425/ws281x_lightberries | c6a5a3ffeeb3642b34e3e6e3b759af9e4725efce | [
"MIT"
] | null | null | null | """Defines basic light string data and functions."""
import os
import sys
import atexit
import inspect
import time
import logging
from typing import Any, Optional, Sequence, Union, overload
from nptyping import NDArray
import numpy as np
from LightBerries.LightBerryExceptions import LightStringException
from LightBerri... | 35.645503 | 109 | 0.550096 | import os
import sys
import atexit
import inspect
import time
import logging
from typing import Any, Optional, Sequence, Union, overload
from nptyping import NDArray
import numpy as np
from LightBerries.LightBerryExceptions import LightStringException
from LightBerries.RpiWS281xPatch import rpi_ws281x
from LightBerries... | true | true |
f70692cdcc69b9d45199d27b26f1d4ee034f4d7b | 391 | py | Python | pps_aventura/aventuras/migrations/0013_evento_ourevent.py | bruseghini92/pps-aventura | 2a8d320c58d69df15fb66f9e99a3298cb6cf7396 | [
"MIT"
] | null | null | null | pps_aventura/aventuras/migrations/0013_evento_ourevent.py | bruseghini92/pps-aventura | 2a8d320c58d69df15fb66f9e99a3298cb6cf7396 | [
"MIT"
] | 3 | 2018-05-29T14:31:04.000Z | 2018-06-05T21:26:41.000Z | pps_aventura/aventuras/migrations/0013_evento_ourevent.py | bruseghini92/pps-aventura | 2a8d320c58d69df15fb66f9e99a3298cb6cf7396 | [
"MIT"
] | 1 | 2018-08-31T00:07:43.000Z | 2018-08-31T00:07:43.000Z | # Generated by Django 2.0.5 on 2018-07-05 16:09
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('aventuras', '0012_auto_20180705_1244'),
]
operations = [
migrations.AddField(
model_name='evento',
name='ourEvent',
... | 20.578947 | 53 | 0.603581 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('aventuras', '0012_auto_20180705_1244'),
]
operations = [
migrations.AddField(
model_name='evento',
name='ourEvent',
field=models.BooleanField(default=F... | true | true |
f706945fa3abe44df5cb590f968dcb41ef4127ff | 2,207 | py | Python | Sketches/MPS/BugReports/FixTests/Kamaelia/Examples/TCP_Systems/SSL/https.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 12 | 2015-10-20T10:22:01.000Z | 2021-07-19T10:09:44.000Z | Sketches/MPS/BugReports/FixTests/Kamaelia/Examples/TCP_Systems/SSL/https.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 2 | 2015-10-20T10:22:55.000Z | 2017-02-13T11:05:25.000Z | Sketches/MPS/BugReports/FixTests/Kamaelia/Examples/TCP_Systems/SSL/https.py | sparkslabs/kamaelia_orig | 24b5f855a63421a1f7c6c7a35a7f4629ed955316 | [
"Apache-2.0"
] | 6 | 2015-03-09T12:51:59.000Z | 2020-03-01T13:06:21.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2010 British Broadcasting Corporation and Kamaelia Contributors(1)
#
# (1) Kamaelia Contributors are listed in the AUTHORS file and at
# http://www.kamaelia.org/AUTHORS - please extend this file,
# not this notice.
#
# Licensed under the Apache License, Ver... | 39.410714 | 101 | 0.732669 |
from Kamaelia.Chassis.Graphline import Graphline
from Kamaelia.Internet.TCPClient import TCPClient
from Kamaelia.Util.Console import ConsoleEchoer, ConsoleReader
from Kamaelia.Util.OneShot import OneShot
print """
This is a simple demonstration program that shows that it is possible to
build simpl... | false | true |
f7069496755b403817d7772feb350edd883cb548 | 1,684 | py | Python | mlprodict/onnxrt/ops_cpu/op_solve.py | xadupre/mlprodict | f82c8a26a60104948c67849b1c4af95ca812c153 | [
"MIT"
] | 1 | 2020-12-18T03:49:53.000Z | 2020-12-18T03:49:53.000Z | mlprodict/onnxrt/ops_cpu/op_solve.py | xadupre/mlprodict | f82c8a26a60104948c67849b1c4af95ca812c153 | [
"MIT"
] | null | null | null | mlprodict/onnxrt/ops_cpu/op_solve.py | xadupre/mlprodict | f82c8a26a60104948c67849b1c4af95ca812c153 | [
"MIT"
] | null | null | null | # -*- encoding: utf-8 -*-
# pylint: disable=E0203,E1101,C0111
"""
@file
@brief Runtime operator.
"""
from scipy.linalg import solve
from ._op import OpRunBinaryNum
from ._new_ops import OperatorSchema
class Solve(OpRunBinaryNum):
atts = {'lower': False,
'transposed': False}
def __init__(self, on... | 30.618182 | 76 | 0.5962 |
from scipy.linalg import solve
from ._op import OpRunBinaryNum
from ._new_ops import OperatorSchema
class Solve(OpRunBinaryNum):
atts = {'lower': False,
'transposed': False}
def __init__(self, onnx_node, desc=None, **options):
OpRunBinaryNum.__init__(self, onnx_node, desc=desc,
... | true | true |
f70695530a6a554915e5ced27afaec503323e2a4 | 1,470 | py | Python | .history/my_classes/FirstClassFunctions/LambdaExpressions_20210704154925.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | .history/my_classes/FirstClassFunctions/LambdaExpressions_20210704154925.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | .history/my_classes/FirstClassFunctions/LambdaExpressions_20210704154925.py | minefarmer/deep-Dive-1 | b0675b853180c5b5781888266ea63a3793b8d855 | [
"Unlicense"
] | null | null | null | """[Lambda Expressions]
Lambda expressions are simply another way to create functions anonymous functions
keyword \ parameter list optional
\ \ the : is required, even for zero arguments
\ \ / / this expression is evaluated and returned when the lamb... | 17.710843 | 161 | 0.629932 | """[Lambda Expressions]
Lambda expressions are simply another way to create functions anonymous functions
keyword \ parameter list optional
\ \ the : is required, even for zero arguments
\ \ / / this expression is evaluated and returned when the lamb... | false | true |
f706967cb2a36dfdf4e6774fbc3098ce8a749eed | 1,514 | py | Python | script/eval_fromnote.py | gargrohin/optimistic_GAN_training | b9215e052e830941ec023cb37d44424680eb9570 | [
"MIT"
] | null | null | null | script/eval_fromnote.py | gargrohin/optimistic_GAN_training | b9215e052e830941ec023cb37d44424680eb9570 | [
"MIT"
] | null | null | null | script/eval_fromnote.py | gargrohin/optimistic_GAN_training | b9215e052e830941ec023cb37d44424680eb9570 | [
"MIT"
] | null | null | null | from os.path import join,exists,realpath,dirname,basename
from os import makedirs,listdir, system
import numpy as np, _pickle as cPickle, editdistance, seaborn as sns
import matplotlib.pyplot as plt, pandas as pd, itertools, glob, h5py
from scipy.stats import entropy
from matplotlib.font_manager import FontProperties
f... | 32.212766 | 77 | 0.673052 | from os.path import join,exists,realpath,dirname,basename
from os import makedirs,listdir, system
import numpy as np, _pickle as cPickle, editdistance, seaborn as sns
import matplotlib.pyplot as plt, pandas as pd, itertools, glob, h5py
from scipy.stats import entropy
from matplotlib.font_manager import FontProperties
f... | true | true |
f70696ca8c121b8cdbf49791af9ebd1bae2a2aa4 | 39 | py | Python | geco/mips/loading/__init__.py | FreestyleBuild/GeCO | 6db1a549b3145b3bc5d3025a9bccc03be6575564 | [
"MIT"
] | 8 | 2020-12-16T09:59:05.000Z | 2022-03-18T09:48:43.000Z | geco/mips/loading/__init__.py | FreestyleBuild/GeCO | 6db1a549b3145b3bc5d3025a9bccc03be6575564 | [
"MIT"
] | 101 | 2020-11-09T10:20:03.000Z | 2022-03-24T13:50:06.000Z | geco/mips/loading/__init__.py | FreestyleBuild/GeCO | 6db1a549b3145b3bc5d3025a9bccc03be6575564 | [
"MIT"
] | 3 | 2021-04-06T13:26:03.000Z | 2022-03-22T13:22:16.000Z | from geco.mips.loading.miplib import *
| 19.5 | 38 | 0.794872 | from geco.mips.loading.miplib import *
| true | true |
f70698357c195065e25dc67b4c6d0107c206d985 | 5,928 | py | Python | python/rikai/types/vision.py | smellslikeml/rikai | 179526dfe98b21059371d83f7540e3d43aa1200f | [
"Apache-2.0"
] | null | null | null | python/rikai/types/vision.py | smellslikeml/rikai | 179526dfe98b21059371d83f7540e3d43aa1200f | [
"Apache-2.0"
] | null | null | null | python/rikai/types/vision.py | smellslikeml/rikai | 179526dfe98b21059371d83f7540e3d43aa1200f | [
"Apache-2.0"
] | 1 | 2021-04-02T16:54:59.000Z | 2021-04-02T16:54:59.000Z | #
# 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 writing, software
# distributed un... | 31.700535 | 144 | 0.61724 |
from __future__ import annotations
from io import IOBase
from pathlib import Path
from tempfile import NamedTemporaryFile
from typing import Union
from urllib.parse import urlparse
import numpy as np
from PIL import Image as PILImage
from rikai.internal.uri_utils import normalize_uri
from rikai.io im... | true | true |
f70698463a0cbf45bebc308f18e3b83cf51d7450 | 7,228 | py | Python | godot/ui/graph_menu.py | rwl/godot | 013687c9e8983d2aa2ceebb8a76c5c4f1e37c90f | [
"MIT"
] | 4 | 2016-05-09T05:59:03.000Z | 2018-02-14T18:49:53.000Z | godot/ui/graph_menu.py | rwl/godot | 013687c9e8983d2aa2ceebb8a76c5c4f1e37c90f | [
"MIT"
] | null | null | null | godot/ui/graph_menu.py | rwl/godot | 013687c9e8983d2aa2ceebb8a76c5c4f1e37c90f | [
"MIT"
] | null | null | null | #------------------------------------------------------------------------------
# Copyright (c) 2008 Richard W. Lincoln
#
# 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 restricti... | 40.836158 | 79 | 0.567654 |
from os.path import join, dirname
from enthought.pyface.api import ImageResource
from enthought.traits.ui.menu import MenuBar, ToolBar, Menu, Action
new_action = Action(name="&New", accelerator="Ctrl+N", action="new_model",
image=ImageResource("new"), tooltip="New (Ctrl+N)")
open_a... | true | true |
f706991277f45e992af406c0120a970ba552b6b9 | 22,208 | py | Python | pytorch_blade/tests/tensorrt/test_support_info.py | JamesTheZ/BladeDISC | e6c76ee557ebfccd560d44f6b6276bbc4e0a8a34 | [
"Apache-2.0"
] | 328 | 2021-12-20T03:29:35.000Z | 2022-03-31T14:27:23.000Z | pytorch_blade/tests/tensorrt/test_support_info.py | JamesTheZ/BladeDISC | e6c76ee557ebfccd560d44f6b6276bbc4e0a8a34 | [
"Apache-2.0"
] | 82 | 2021-12-20T09:15:16.000Z | 2022-03-31T09:33:48.000Z | pytorch_blade/tests/tensorrt/test_support_info.py | JamesTheZ/BladeDISC | e6c76ee557ebfccd560d44f6b6276bbc4e0a8a34 | [
"Apache-2.0"
] | 66 | 2021-12-21T17:28:27.000Z | 2022-03-29T12:08:34.000Z | # Copyright 2022 The BladeDISC Authors. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or ... | 42.060606 | 149 | 0.463932 |
import collections
import unittest
import torch
from torch.nn import functional as F
from torch_blade import tensorrt
from torch_blade import utils
from torch_blade import tools
from torch_blade import Config
from torch_blade.logging import logger
from torch_blade.testing.common_utils import Feedforward, Tes... | true | true |
f7069a6a95f386c58a28b6f0dd7028ecdf44d7e0 | 61 | py | Python | proxypool/collectors/__init__.py | franklingu/proxypool | 0d72eb964c58b111f30c5ad329d41d56257c7392 | [
"MIT"
] | 6 | 2018-08-07T09:51:15.000Z | 2020-02-10T08:24:00.000Z | proxypool/collectors/__init__.py | franklingu/proxypool | 0d72eb964c58b111f30c5ad329d41d56257c7392 | [
"MIT"
] | 5 | 2017-11-13T03:24:10.000Z | 2019-07-03T06:12:49.000Z | proxypool/collectors/__init__.py | franklingu/proxypool | 0d72eb964c58b111f30c5ad329d41d56257c7392 | [
"MIT"
] | 3 | 2018-03-06T02:50:19.000Z | 2019-10-05T05:12:34.000Z | """Collectors to crawl free IP proxies from the internet
"""
| 20.333333 | 56 | 0.737705 | true | true | |
f7069ad5cd690049be553a52ca617fd202dc1d2b | 477 | py | Python | exceptions.py | evacs/astr-119-hw-2 | 06e33dc76da326b41a2a089532984b8506fc4b41 | [
"MIT"
] | null | null | null | exceptions.py | evacs/astr-119-hw-2 | 06e33dc76da326b41a2a089532984b8506fc4b41 | [
"MIT"
] | 1 | 2020-10-15T01:00:09.000Z | 2020-10-17T01:10:11.000Z | exceptions.py | evacs/astr-119-hw-2 | 06e33dc76da326b41a2a089532984b8506fc4b41 | [
"MIT"
] | null | null | null | #dealing with unexpected results
#great for writing complex programs
try:
print (a) #throw an exception
except:
print("a is not defined")
#a is not defined, instead of crashing program,
#we can ask it to tell us what the problem is
try:
print(a)
except NameError: #if this is the error...
print("... | 20.73913 | 49 | 0.668763 |
try:
print (a)
except:
print("a is not defined")
try:
print(a)
except NameError:
print("a still isn't defined")
except: #if not...
print("Something else is wrong")
print(a) #this will not work and will
#BREAK the program
| true | true |
f7069cc396a911e8a97605e174d005cfe2569cb4 | 10,438 | py | Python | models/pegasus/params/public_params.py | alirezasalemi7/ARMAN | e935f38cb8ee58af09c4e0174e83e91fab90a478 | [
"Apache-2.0"
] | 4 | 2021-11-03T15:14:44.000Z | 2022-01-23T07:37:21.000Z | models/pegasus/params/public_params.py | alirezasalemi7/ARMAN | e935f38cb8ee58af09c4e0174e83e91fab90a478 | [
"Apache-2.0"
] | null | null | null | models/pegasus/params/public_params.py | alirezasalemi7/ARMAN | e935f38cb8ee58af09c4e0174e83e91fab90a478 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The PEGASUS Authors..
#
# 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... | 33.88961 | 79 | 0.655777 |
import functools
from pegasus.data import parsers
from pegasus.eval import estimator_metrics
from pegasus.eval import text_eval
from pegasus.models import transformer
from pegasus.ops import public_parsing_ops
from pegasus.params import pegasus_params
from pegasus.params import registry
from tensorflow.c... | true | true |
f7069eb6a228e2cc18d313595a27245a6929ef57 | 940 | py | Python | figthesis/figlaserpos.py | Gattocrucco/sipmfilter | 74215d6c53b998808fc6c677b46030234d996bdf | [
"CC-BY-4.0",
"MIT"
] | null | null | null | figthesis/figlaserpos.py | Gattocrucco/sipmfilter | 74215d6c53b998808fc6c677b46030234d996bdf | [
"CC-BY-4.0",
"MIT"
] | null | null | null | figthesis/figlaserpos.py | Gattocrucco/sipmfilter | 74215d6c53b998808fc6c677b46030234d996bdf | [
"CC-BY-4.0",
"MIT"
] | null | null | null | from matplotlib import pyplot as plt
import figlatex
import afterpulse_tile21
import textbox
import colormap
vov = 5.5
################
ap21 = afterpulse_tile21.AfterPulseTile21(vov)
fig = plt.figure(num='figlaserpos-0', clear=True, figsize=[4.5, 3])
ap21.sim.hist('mainpos-offset', 'mainnpe==1', fig=fig, selectio... | 24.736842 | 126 | 0.698936 | from matplotlib import pyplot as plt
import figlatex
import afterpulse_tile21
import textbox
import colormap
vov = 5.5
p21.sim.hist('mainpos-offset', 'mainnpe==1', fig=fig, selection=False)
ax, = fig.get_axes()
textbox.textbox(ax, f'{vov} VoV', fontsize='medium', loc='lower center')
ax.set_xlabel('Laser peak positio... | true | true |
f7069f3fba6ba122309b2735e91da48781567d19 | 259 | py | Python | main2.py | brybalti/Exercise-01b-Guessing-Game | 4ea335cd52543d293a15ea74b61928ed239363db | [
"MIT"
] | null | null | null | main2.py | brybalti/Exercise-01b-Guessing-Game | 4ea335cd52543d293a15ea74b61928ed239363db | [
"MIT"
] | null | null | null | main2.py | brybalti/Exercise-01b-Guessing-Game | 4ea335cd52543d293a15ea74b61928ed239363db | [
"MIT"
] | null | null | null | import random
number = random.randrange(1,10)
guess = input("Guess a number from 1 to 10: ")
guess = int(guess)
if guess == number:
print("Great job! You got it!")
else:
print("Sorry, better luck next time.")
print("The number was " + str(number)) | 28.777778 | 46 | 0.664093 | import random
number = random.randrange(1,10)
guess = input("Guess a number from 1 to 10: ")
guess = int(guess)
if guess == number:
print("Great job! You got it!")
else:
print("Sorry, better luck next time.")
print("The number was " + str(number)) | true | true |
f7069fdd9bc678159d67424672df5a4d163f8320 | 242 | py | Python | octopus/modules/romeo/settings.py | CottageLabs/magnificent-octopus-oacwellcome-fork | b1c8c412cf9a3fe66fca1c8e92ed074c9821663e | [
"Apache-2.0"
] | 2 | 2016-02-22T04:31:30.000Z | 2021-08-03T23:58:36.000Z | octopus/modules/romeo/settings.py | CottageLabs/magnificent-octopus-oacwellcome-fork | b1c8c412cf9a3fe66fca1c8e92ed074c9821663e | [
"Apache-2.0"
] | 9 | 2015-01-04T14:00:05.000Z | 2021-12-13T19:35:07.000Z | octopus/modules/romeo/settings.py | CottageLabs/magnificent-octopus-oacwellcome-fork | b1c8c412cf9a3fe66fca1c8e92ed074c9821663e | [
"Apache-2.0"
] | 3 | 2016-09-09T13:39:45.000Z | 2018-02-19T14:23:12.000Z | # Your Romeo API key, required for accessing the RoMEO API
# override this in your local config
ROMEO_API_KEY = ""
ROMEO_API_BASE_URL = "http://www.sherpa.ac.uk/romeo/api29.php"
ROMEO_DOWNLOAD_BASE_URL = "http://www.sherpa.ac.uk/downloads/" | 34.571429 | 62 | 0.764463 |
ROMEO_API_KEY = ""
ROMEO_API_BASE_URL = "http://www.sherpa.ac.uk/romeo/api29.php"
ROMEO_DOWNLOAD_BASE_URL = "http://www.sherpa.ac.uk/downloads/" | true | true |
f706a02423adb62b8551f2af584d2c827ad429d7 | 876 | py | Python | virtool_workflow/abc/data_providers/indexes.py | BlakeASmith/virtool-workflow | 80db243103a0019de61d7392786c0a1a565039e8 | [
"MIT"
] | null | null | null | virtool_workflow/abc/data_providers/indexes.py | BlakeASmith/virtool-workflow | 80db243103a0019de61d7392786c0a1a565039e8 | [
"MIT"
] | null | null | null | virtool_workflow/abc/data_providers/indexes.py | BlakeASmith/virtool-workflow | 80db243103a0019de61d7392786c0a1a565039e8 | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
from pathlib import Path
from virtool_workflow.data_model import Index
from virtool_workflow.data_model.files import VirtoolFileFormat
class AbstractIndexProvider(ABC):
@abstractmethod
async def get(self) -> Index:
"""Get the current index."""
...
@ab... | 27.375 | 119 | 0.666667 | from abc import ABC, abstractmethod
from pathlib import Path
from virtool_workflow.data_model import Index
from virtool_workflow.data_model.files import VirtoolFileFormat
class AbstractIndexProvider(ABC):
@abstractmethod
async def get(self) -> Index:
...
@abstractmethod
async def upload(sel... | true | true |
f706a10b8475928caf8192b9516fe3fca364cfbd | 1,989 | py | Python | kakaopy/packet.py | smartwe/bot | efc370cccac7be7ff77a9f9bacd5052b3a20b4b3 | [
"MIT"
] | 16 | 2021-06-01T04:49:51.000Z | 2022-03-31T17:56:10.000Z | kakaopy/packet.py | smartwe/bot | efc370cccac7be7ff77a9f9bacd5052b3a20b4b3 | [
"MIT"
] | 4 | 2021-06-22T18:33:23.000Z | 2022-02-08T13:24:54.000Z | kakaopy/packet.py | smartwe/bot | efc370cccac7be7ff77a9f9bacd5052b3a20b4b3 | [
"MIT"
] | 2 | 2021-07-06T04:35:14.000Z | 2021-09-07T05:19:09.000Z | import os
import io
import struct
import bson
class Packet:
def __init__(self, packet_id=0, status_code=0, packet_name="", body_type=0, body=b""):
self.packet_id = packet_id
self.status_code = status_code
self.packet_name = packet_name
self.body_type = body_type
self.body_... | 29.686567 | 90 | 0.597285 | import os
import io
import struct
import bson
class Packet:
def __init__(self, packet_id=0, status_code=0, packet_name="", body_type=0, body=b""):
self.packet_id = packet_id
self.status_code = status_code
self.packet_name = packet_name
self.body_type = body_type
self.body_... | true | true |
f706a124cc4abc297528dbba31fad0fa2371f8e5 | 3,544 | py | Python | python_scripts/steemdebugnode/private_testnet.py | horsecoin/surfd-master | 7892fa91305f84322b96593555d759b21dcb0bc9 | [
"MIT"
] | null | null | null | python_scripts/steemdebugnode/private_testnet.py | horsecoin/surfd-master | 7892fa91305f84322b96593555d759b21dcb0bc9 | [
"MIT"
] | null | null | null | python_scripts/steemdebugnode/private_testnet.py | horsecoin/surfd-master | 7892fa91305f84322b96593555d759b21dcb0bc9 | [
"MIT"
] | null | null | null | """
This test module will only run on a POSIX system. Windows support *may* be added at some point in the future.
"""
# Global imports
import json, operator, os, signal, sys
from argparse import ArgumentParser
from datetime import datetime
from pathlib import Path
from time import sleep
from time import time
# local ... | 36.536082 | 127 | 0.656038 |
import json, operator, os, signal, sys
from argparse import ArgumentParser
from datetime import datetime
from pathlib import Path
from time import sleep
from time import time
from surfdebugnode import DebugNode
from surfapi.surfnoderpc import SurfNodeRPC
WAITING = True
def main( ):
global WAITING
import os,... | true | true |
f706a14fb32d49d6bf6ecb46a09aa8d009ee5f44 | 11,971 | py | Python | deutschland/jobsuche/model/job_search_response_embedded.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | deutschland/jobsuche/model/job_search_response_embedded.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | deutschland/jobsuche/model/job_search_response_embedded.py | kiranmusze/deutschland | 86d8ead3f38ad88ad66bb338b9f5a8db06992344 | [
"Apache-2.0"
] | null | null | null | """
Bundesagentur für Arbeit: Jobsuche API
Die größte Stellendatenbank Deutschlands durchsuchen, Details zu Stellenanzeigen und Informationen über Arbeitgeber abrufen. <br><br> Die Authentifizierung funktioniert per OAuth 2 Client Credentials mit JWTs. Folgende Client-Credentials können dafür verwendet werden:... | 42.601423 | 405 | 0.574722 |
import re
import sys
from deutschland.jobsuche.model_utils import (
ApiTypeError,
ModelComposed,
ModelNormal,
ModelSimple,
cached_property,
change_keys_js_to_python,
convert_js_args_to_python_args,
date,
datetime,
file_type,
none_type,
validate_get_composed_info,... | true | true |
f706a257861e7a4cfb34ff0ce4749f6e412ba3a3 | 836 | py | Python | test_tools/simgen_templates_example.py | d3s-trento/wcb | 9f4b7a6131ea3f1f9c7cfcbfaa39b9396ed43339 | [
"BSD-3-Clause"
] | null | null | null | test_tools/simgen_templates_example.py | d3s-trento/wcb | 9f4b7a6131ea3f1f9c7cfcbfaa39b9396ed43339 | [
"BSD-3-Clause"
] | null | null | null | test_tools/simgen_templates_example.py | d3s-trento/wcb | 9f4b7a6131ea3f1f9c7cfcbfaa39b9396ed43339 | [
"BSD-3-Clause"
] | null | null | null | TESTBED_TEMPLATE = \
r"""
{
"name" : "WCB Test",
"description" : "Run WCB for {{ duration_minutes }} minutes",
"start_time" : "{{ start_time }}",
"duration" : {{ duration_seconds }},
"binaries" : {
"hardware" : "firefly",
"bin_file": "{{ abs_bin_path }}",
"programAddress":... | 30.962963 | 140 | 0.505981 | TESTBED_TEMPLATE = \
r"""
{
"name" : "WCB Test",
"description" : "Run WCB for {{ duration_minutes }} minutes",
"start_time" : "{{ start_time }}",
"duration" : {{ duration_seconds }},
"binaries" : {
"hardware" : "firefly",
"bin_file": "{{ abs_bin_path }}",
"programAddress":... | true | true |
f706a3a833314a32d1968e059ad552092cc8b4ce | 2,189 | py | Python | examples/simple/salpeter.py | egpbos/amuse | 64b3bc5b7fef9496012b023578c4d71cecef92b7 | [
"Apache-2.0"
] | null | null | null | examples/simple/salpeter.py | egpbos/amuse | 64b3bc5b7fef9496012b023578c4d71cecef92b7 | [
"Apache-2.0"
] | null | null | null | examples/simple/salpeter.py | egpbos/amuse | 64b3bc5b7fef9496012b023578c4d71cecef92b7 | [
"Apache-2.0"
] | 2 | 2021-11-19T04:41:37.000Z | 2021-11-20T02:11:17.000Z | """
Generates a cluster using a plummer model with a salpeter Initial Mass Function.
Compares the generated IMF against the expected line.
"""
import numpy
from matplotlib import pyplot
from amuse.units import units
from amuse.units import nbody_system
from amuse.ic.plummer import new_plummer_model
from amuse.ic.salp... | 29.581081 | 80 | 0.660576 |
import numpy
from matplotlib import pyplot
from amuse.units import units
from amuse.units import nbody_system
from amuse.ic.plummer import new_plummer_model
from amuse.ic.salpeter import new_salpeter_mass_distribution
def new_cluster(number_of_stars = 1000):
masses = new_salpeter_mass_distribution(
numbe... | true | true |
f706a3ca456031fd70100e686a82a6c834b7ce04 | 1,922 | py | Python | Intra_MLP.py | suyukun666/UFO | e57016948b03cd2f75155d2958cea69b6e4b56f8 | [
"MIT"
] | 122 | 2022-03-10T02:54:57.000Z | 2022-03-28T11:27:58.000Z | Intra_MLP.py | xiaotantanya/UFO | ba481b39b80d78c98e11cc22444d69de9e010439 | [
"MIT"
] | 1 | 2022-03-15T15:03:46.000Z | 2022-03-21T13:24:12.000Z | Intra_MLP.py | xiaotantanya/UFO | ba481b39b80d78c98e11cc22444d69de9e010439 | [
"MIT"
] | 17 | 2022-03-11T03:41:28.000Z | 2022-03-30T09:21:49.000Z | import torch
import numpy
# codes of this function are borrowed from https://github.com/yanx27/Pointnet_Pointnet2_pytorch/blob/master/models/pointnet2_utils.py
def index_points(device, points, idx):
"""
Input:
points: input points data, [B, N, C]
idx: sample index data, [B, S]
Return:
... | 36.264151 | 155 | 0.636316 | import torch
import numpy
def index_points(device, points, idx):
B = points.shape[0]
view_shape = list(idx.shape)
view_shape[1:] = [1] * (len(view_shape) - 1)
repeat_shape = list(idx.shape)
repeat_shape[0] = 1
batch_indices = torch.arange(B, dtype=torch.long).cuda().view(view_shape).repea... | true | true |
f706a43c41eec64152c1fa09ce37d08d93622e85 | 5,801 | py | Python | kospeech/data/audio/parser.py | triplet02/KoSpeech | 74d267b76ec72cf8bc916982af9a58df2dc1ee4e | [
"Apache-2.0"
] | 2 | 2021-01-17T18:39:33.000Z | 2021-01-18T06:03:08.000Z | kospeech/data/audio/parser.py | triplet02/KoSpeech | 74d267b76ec72cf8bc916982af9a58df2dc1ee4e | [
"Apache-2.0"
] | null | null | null | kospeech/data/audio/parser.py | triplet02/KoSpeech | 74d267b76ec72cf8bc916982af9a58df2dc1ee4e | [
"Apache-2.0"
] | null | null | null | import numpy as np
from torch import Tensor, FloatTensor
from kospeech.data.audio.core import load_audio
from kospeech.data.audio.augment import NoiseInjector, SpecAugment
from kospeech.data.audio.feature import MelSpectrogram, MFCC, Spectrogram, FilterBank
class AudioParser(object):
"""
Provides inteface of ... | 46.408 | 117 | 0.677987 | import numpy as np
from torch import Tensor, FloatTensor
from kospeech.data.audio.core import load_audio
from kospeech.data.audio.augment import NoiseInjector, SpecAugment
from kospeech.data.audio.feature import MelSpectrogram, MFCC, Spectrogram, FilterBank
class AudioParser(object):
def __init__(self, dataset_pa... | true | true |
f706a484ec49eef744d0b0cc0afe2df6ad1a87a2 | 109,500 | py | Python | pybind/nos/v6_0_2c/interface/port_channel/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/nos/v6_0_2c/interface/port_channel/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | null | null | null | pybind/nos/v6_0_2c/interface/port_channel/__init__.py | shivharis/pybind | 4e1c6d54b9fd722ccec25546ba2413d79ce337e6 | [
"Apache-2.0"
] | 1 | 2021-11-05T22:15:42.000Z | 2021-11-05T22:15:42.000Z |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | 85.480094 | 851 | 0.737096 |
from operator import attrgetter
import pyangbind.lib.xpathhelper as xpathhelper
from pyangbind.lib.yangtypes import RestrictedPrecisionDecimalType, RestrictedClassType, TypedListType
from pyangbind.lib.yangtypes import YANGBool, YANGListType, YANGDynClass, ReferenceType
from pyangbind.lib.base import PybindBase
from d... | true | true |
f706a4a8c75daa9d85ed44d7c095675a721fd47e | 43,435 | py | Python | ceilometer/tests/test_pipeline.py | rackerlabs/instrumented-ceilometer | 6ac5215ac0476120d9c99adcabc9cad0d32963da | [
"Apache-2.0"
] | 3 | 2021-04-18T00:37:48.000Z | 2021-07-21T10:20:11.000Z | ceilometer/tests/test_pipeline.py | lexxito/monitoring | bec8dfb8d3610331c7ae5ec543e0b8da0948c164 | [
"Apache-2.0"
] | null | null | null | ceilometer/tests/test_pipeline.py | lexxito/monitoring | bec8dfb8d3610331c7ae5ec543e0b8da0948c164 | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
#
# Copyright © 2013 Intel Corp.
#
# Authors: Yunhong Jiang <yunhong.jiang@intel.com>
# Julien Danjou <julien@danjou.info>
#
# 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 ... | 40.593458 | 77 | 0.556279 |
import datetime
from stevedore import extension
from ceilometer.openstack.common.fixture import mockpatch
from ceilometer.openstack.common import test
from ceilometer.openstack.common import timeutils
from ceilometer import pipeline
from ceilometer import publisher
from ceilometer.publisher import ... | true | true |
f706a589d3fb275249aed24c6541c7108e172fcf | 3,167 | py | Python | python/tennis_unittest.py | shesko/Tennis-Refactoring-Kata | 7f08f39f043c715f077d1c648d3013a0e224fa51 | [
"MIT"
] | null | null | null | python/tennis_unittest.py | shesko/Tennis-Refactoring-Kata | 7f08f39f043c715f077d1c648d3013a0e224fa51 | [
"MIT"
] | null | null | null | python/tennis_unittest.py | shesko/Tennis-Refactoring-Kata | 7f08f39f043c715f077d1c648d3013a0e224fa51 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import unittest
from tennis import TennisGame1
test_cases = [
(0, 0, "Love-All", '0-0', 'player1', 'player2'),
(1, 1, "Fifteen-All", '0-0', 'player1', 'player2'),
(2, 2, "Thirty-All", '0-0', 'player1', 'player2'),
(3, 3, "Deuce", '0-0', 'player1', 'player2'),
(4, 4, "Deuce... | 38.156627 | 78 | 0.545627 |
import unittest
from tennis import TennisGame1
test_cases = [
(0, 0, "Love-All", '0-0', 'player1', 'player2'),
(1, 1, "Fifteen-All", '0-0', 'player1', 'player2'),
(2, 2, "Thirty-All", '0-0', 'player1', 'player2'),
(3, 3, "Deuce", '0-0', 'player1', 'player2'),
(4, 4, "Deuce", '0-0', 'player1', 'p... | true | true |
f706a5af320fb4679b716893db30cd266907c40c | 11,282 | py | Python | lib/cros_test_lib_unittest.py | khromiumos/chromiumos-chromite | a42a85481cdd9d635dc40a04585e427f89f3bb3f | [
"BSD-3-Clause"
] | null | null | null | lib/cros_test_lib_unittest.py | khromiumos/chromiumos-chromite | a42a85481cdd9d635dc40a04585e427f89f3bb3f | [
"BSD-3-Clause"
] | 2 | 2021-03-26T00:29:32.000Z | 2021-04-30T21:29:33.000Z | lib/cros_test_lib_unittest.py | khromiumos/chromiumos-chromite | a42a85481cdd9d635dc40a04585e427f89f3bb3f | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2012 The Chromium OS Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Unittest for cros_test_lib (tests for tests? Who'd a thunk it)."""
from __future__ import print_function
import os
import... | 35.477987 | 80 | 0.697749 |
from __future__ import print_function
import os
import subprocess
import sys
import time
import unittest
import mock
from chromite.lib import cros_test_lib
from chromite.lib import cros_build_lib
from chromite.lib import osutils
from chromite.lib import partial_mock
from chromite.lib import timeout_util
Dir... | true | true |
f706a61bad7f4069f8d1a28731f0bca8cd9d6c03 | 3,343 | py | Python | inference_demo.py | YujunLiao/solo | e6b4d0e79bb9f43e9abd93d4372954406ef07a54 | [
"BSD-2-Clause"
] | null | null | null | inference_demo.py | YujunLiao/solo | e6b4d0e79bb9f43e9abd93d4372954406ef07a54 | [
"BSD-2-Clause"
] | null | null | null | inference_demo.py | YujunLiao/solo | e6b4d0e79bb9f43e9abd93d4372954406ef07a54 | [
"BSD-2-Clause"
] | null | null | null | import os
import time
import socket
from mmdet.apis import init_detector, inference_detector, show_result_pyplot, show_result_ins
import mmcv
# map
# config_file = '../configs/solo/decoupled_solo_r50_fpn_8gpu_3x.py'
# # download the checkpoint from model zoo and put it in `checkpoints/`
# checkpoint_file = '../checkp... | 31.838095 | 121 | 0.714628 | import os
import time
import socket
from mmdet.apis import init_detector, inference_detector, show_result_pyplot, show_result_ins
import mmcv
48_r18_fpn_8gpu_3x.py'
checkpoint_file = './work_dir/0602/ps-X10DRG/solov2_light_448_r18_fpn_8gpu_3x/epoch_36.pth'
print(config_file)
cuda_n = 0
print('gpu:', cuda_n)
o... | true | true |
f706a6ca2cd4b8fd9fecae6f0740a939cff0fcc7 | 6,506 | py | Python | tournament.py | markmelnic/IS-Project | 85a4418c1ec9da4bd4fd105c20f4ca5c50d99ff5 | [
"MIT"
] | null | null | null | tournament.py | markmelnic/IS-Project | 85a4418c1ec9da4bd4fd105c20f4ca5c50d99ff5 | [
"MIT"
] | null | null | null | tournament.py | markmelnic/IS-Project | 85a4418c1ec9da4bd4fd105c20f4ca5c50d99ff5 | [
"MIT"
] | null | null | null | from argparse import ArgumentParser
from api import State, util, engine
import random, csv, os
from rich import print
def run_tournament(options):
'''
NOTES FOR THE CSV FILENAME
the first bot is the tracked one, the other is the opponent
for example in T_Dataset_ml-rdeep.csv
ml is the tracked playe... | 43.086093 | 201 | 0.512757 | from argparse import ArgumentParser
from api import State, util, engine
import random, csv, os
from rich import print
def run_tournament(options):
botnames = options.players.split(",")
bots = [util.load_player(botname) for botname in botnames]
n = len(bots)
wins = [0] * n
matches = [(p1, p2) for... | true | true |
f706a7567d60da507071c0588c09bc17e39cfb76 | 14,695 | py | Python | PaddleDetection/deploy/pptracking/python/mot/tracker/jde_tracker.py | ZhangJianAI-CV/Awesome-project | b07c8c270bd511246133541c4aee28c2472c633f | [
"MIT"
] | 3 | 2022-03-23T08:48:06.000Z | 2022-03-28T01:59:34.000Z | PaddleDetection/deploy/pptracking/python/mot/tracker/jde_tracker.py | ZhangJianAI-CV/Awesome-project | b07c8c270bd511246133541c4aee28c2472c633f | [
"MIT"
] | null | null | null | PaddleDetection/deploy/pptracking/python/mot/tracker/jde_tracker.py | ZhangJianAI-CV/Awesome-project | b07c8c270bd511246133541c4aee28c2472c633f | [
"MIT"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by appli... | 46.503165 | 109 | 0.581626 |
import numpy as np
from collections import defaultdict
from ..matching import jde_matching as matching
from ..motion import KalmanFilter
from .base_jde_tracker import TrackState, STrack
from .base_jde_tracker import joint_stracks, sub_stracks, remove_duplicate_stracks
__all__ = ['JDETracker']
class JD... | true | true |
f706a75cf2b29db87a980a5713363c0db752b9b6 | 408 | py | Python | utils/cmpcodesize/tests/test_list_function_sizes.py | truecat/swift | eefc5df1bb7c3a5e0c7e63603c979cd5cf670e7a | [
"Apache-2.0"
] | null | null | null | utils/cmpcodesize/tests/test_list_function_sizes.py | truecat/swift | eefc5df1bb7c3a5e0c7e63603c979cd5cf670e7a | [
"Apache-2.0"
] | null | null | null | utils/cmpcodesize/tests/test_list_function_sizes.py | truecat/swift | eefc5df1bb7c3a5e0c7e63603c979cd5cf670e7a | [
"Apache-2.0"
] | null | null | null | import unittest
from cmpcodesize.compare import listFunctionSizes
class ListFunctionSizesTestCase(unittest.TestCase):
def test_when_size_array_is_none_raises(self):
with self.assertRaises(TypeError):
listFunctionSizes(None)
def test_when_size_array_is_empty_returns_none(self):
se... | 24 | 57 | 0.757353 | import unittest
from cmpcodesize.compare import listFunctionSizes
class ListFunctionSizesTestCase(unittest.TestCase):
def test_when_size_array_is_none_raises(self):
with self.assertRaises(TypeError):
listFunctionSizes(None)
def test_when_size_array_is_empty_returns_none(self):
se... | true | true |
f706a7791f6907ebdc39dec5dd12726e1fb69051 | 53,885 | py | Python | vislab/datasets/flickr_api.py | hertzmann/vislab | fcded208637fb51edfeaef1bde0bf766f9af1941 | [
"BSD-2-Clause"
] | 113 | 2015-01-20T18:13:21.000Z | 2021-08-08T05:17:57.000Z | vislab/datasets/flickr_api.py | Jai-Chaudhary/vislab | 9bb0e2b332797d7a6deb2b8d6b6e98d3c692cee6 | [
"BSD-2-Clause"
] | 2 | 2015-06-08T18:10:22.000Z | 2017-10-10T02:45:53.000Z | vislab/datasets/flickr_api.py | Jai-Chaudhary/vislab | 9bb0e2b332797d7a6deb2b8d6b6e98d3c692cee6 | [
"BSD-2-Clause"
] | 70 | 2015-01-07T03:08:05.000Z | 2022-02-13T13:04:04.000Z | """
flickr.py
Copyright 2004-2006 James Clarke <james@jamesclarke.info>
Portions Copyright 2007-2008 Joshua Henderson <joshhendo@gmail.com>
THIS SOFTWARE IS SUPPLIED WITHOUT WARRANTY OF ANY KIND, AND MAY BE
COPIED, MODIFIED OR DISTRIBUTED IN ANY WAY, AS LONG AS THIS NOTICE
AND ACKNOWLEDGEMENT OF AUTHORSHIP... | 35.803987 | 129 | 0.612935 | """
flickr.py
Copyright 2004-2006 James Clarke <james@jamesclarke.info>
Portions Copyright 2007-2008 Joshua Henderson <joshhendo@gmail.com>
THIS SOFTWARE IS SUPPLIED WITHOUT WARRANTY OF ANY KIND, AND MAY BE
COPIED, MODIFIED OR DISTRIBUTED IN ANY WAY, AS LONG AS THIS NOTICE
AND ACKNOWLEDGEMENT OF AUTHORSHIP... | false | true |
f706a8b3823c08472531cb786584d23bf3ec6afd | 56 | py | Python | 002-dataType/number.py | sailengsi/sls-python-study | a7b771da8896c4cf2f9ea2e925881191e9dd09c5 | [
"Apache-2.0"
] | null | null | null | 002-dataType/number.py | sailengsi/sls-python-study | a7b771da8896c4cf2f9ea2e925881191e9dd09c5 | [
"Apache-2.0"
] | null | null | null | 002-dataType/number.py | sailengsi/sls-python-study | a7b771da8896c4cf2f9ea2e925881191e9dd09c5 | [
"Apache-2.0"
] | null | null | null | '''
数字类型:
int 整形
float 浮点型
Complex 啥东西
''' | 9.333333 | 15 | 0.482143 | true | true | |
f706a8f6de54db0f8cb7e58da5a6d585e853d4b6 | 530 | py | Python | queries/portuguese/query1_pt.py | Gender-Analysis-of-STEM/data-extraction | 9c91f064f5d0c4824a0b4fc8b2cda9189c9064db | [
"MIT"
] | null | null | null | queries/portuguese/query1_pt.py | Gender-Analysis-of-STEM/data-extraction | 9c91f064f5d0c4824a0b4fc8b2cda9189c9064db | [
"MIT"
] | null | null | null | queries/portuguese/query1_pt.py | Gender-Analysis-of-STEM/data-extraction | 9c91f064f5d0c4824a0b4fc8b2cda9189c9064db | [
"MIT"
] | null | null | null | import twint
c = twint.Config()
c.Since = "2021-02-01"
c.Until = "2021-03-14"
c.Search = "(mulher OR mulheres OR garotinha OR garotas OR menina OR garotas) AND \
((engenheira OR cientista OR arquiteta OR programação OR biologa) OR \
(engenharia OR ciência OR stem)) OR \
(matemática)... | 35.333333 | 116 | 0.669811 | import twint
c = twint.Config()
c.Since = "2021-02-01"
c.Until = "2021-03-14"
c.Search = "(mulher OR mulheres OR garotinha OR garotas OR menina OR garotas) AND \
((engenheira OR cientista OR arquiteta OR programação OR biologa) OR \
(engenharia OR ciência OR stem)) OR \
(matemática)... | true | true |
f706a8fce9016a4b81af3eb12d790beac65b912f | 1,682 | py | Python | tools/train_net.py | tkhe/simple-mtcnn | f39b66ec958efc745e1af8a4e0c65a63e0d4a6d8 | [
"MIT"
] | null | null | null | tools/train_net.py | tkhe/simple-mtcnn | f39b66ec958efc745e1af8a4e0c65a63e0d4a6d8 | [
"MIT"
] | null | null | null | tools/train_net.py | tkhe/simple-mtcnn | f39b66ec958efc745e1af8a4e0c65a63e0d4a6d8 | [
"MIT"
] | null | null | null | import argparse
import pprint
import sys
import torch
import torchvision.transforms as transforms
from torch.utils.data import DataLoader
from mtcnn.config import cfg
from mtcnn.datasets.iteration_based_batch_sampler import build_batch_sampler
from mtcnn.datasets.roidb import get_roidb
from mtcnn.engine.trainer impor... | 24.028571 | 76 | 0.716409 | import argparse
import pprint
import sys
import torch
import torchvision.transforms as transforms
from torch.utils.data import DataLoader
from mtcnn.config import cfg
from mtcnn.datasets.iteration_based_batch_sampler import build_batch_sampler
from mtcnn.datasets.roidb import get_roidb
from mtcnn.engine.trainer impor... | true | true |
f706a94a9b09425648213d179ae481bc46d6a770 | 16,855 | py | Python | api-dev/venv/lib/python3.6/site-packages/eth_abi/decoding.py | twaddle-dev/CoVid-19 | 37b1ca12d7ca1a066ab1c0d4a02d9b038d44e62f | [
"Apache-2.0"
] | 127 | 2017-12-03T17:46:21.000Z | 2022-03-18T14:21:30.000Z | api-dev/venv/lib/python3.6/site-packages/eth_abi/decoding.py | twaddle-dev/CoVid-19 | 37b1ca12d7ca1a066ab1c0d4a02d9b038d44e62f | [
"Apache-2.0"
] | 99 | 2017-12-13T09:02:36.000Z | 2022-03-26T13:44:53.000Z | api-dev/venv/lib/python3.6/site-packages/eth_abi/decoding.py | twaddle-dev/CoVid-19 | 37b1ca12d7ca1a066ab1c0d4a02d9b038d44e62f | [
"Apache-2.0"
] | 72 | 2017-11-23T18:39:16.000Z | 2022-03-24T06:42:05.000Z | import abc
import decimal
import io
from typing import (
Any,
)
from eth_utils import (
big_endian_to_int,
to_normalized_address,
to_tuple,
)
from eth_abi.base import (
BaseCoder,
parse_tuple_type_str,
parse_type_str,
)
from eth_abi.exceptions import (
DecodingError,
InsufficientDa... | 29.884752 | 85 | 0.63008 | import abc
import decimal
import io
from typing import (
Any,
)
from eth_utils import (
big_endian_to_int,
to_normalized_address,
to_tuple,
)
from eth_abi.base import (
BaseCoder,
parse_tuple_type_str,
parse_type_str,
)
from eth_abi.exceptions import (
DecodingError,
InsufficientDa... | true | true |
f706a96f4f1441735d657e7345c228e3b824de31 | 1,137 | py | Python | tests/test_pathutils.py | Cdayz/BlackSheep | 42c708c90c29299981e4bf0ed466d262f1ade0e5 | [
"MIT"
] | 482 | 2018-12-20T09:30:23.000Z | 2021-02-08T18:34:16.000Z | tests/test_pathutils.py | Cdayz/BlackSheep | 42c708c90c29299981e4bf0ed466d262f1ade0e5 | [
"MIT"
] | 125 | 2021-02-15T09:29:51.000Z | 2022-03-25T19:48:23.000Z | tests/test_pathutils.py | Cdayz/BlackSheep | 42c708c90c29299981e4bf0ed466d262f1ade0e5 | [
"MIT"
] | 27 | 2021-03-20T16:17:58.000Z | 2022-03-02T19:37:42.000Z | import pytest
from blacksheep.common.files.pathsutils import (
get_file_extension_from_name,
get_mime_type_from_name,
)
@pytest.mark.parametrize(
"full_path,expected_result",
[
("hello.txt", ".txt"),
(".gitignore", ".gitignore"),
("ØØ Void.album", ".album"),
("", ""),
... | 28.425 | 69 | 0.62445 | import pytest
from blacksheep.common.files.pathsutils import (
get_file_extension_from_name,
get_mime_type_from_name,
)
@pytest.mark.parametrize(
"full_path,expected_result",
[
("hello.txt", ".txt"),
(".gitignore", ".gitignore"),
("ØØ Void.album", ".album"),
("", ""),
... | true | true |
f706a9d80562c2325114abf50dd0ab2cf4b0f272 | 906 | py | Python | Mundo 01/Ex-004.py | Git-Eduardo-Henrique/CEV-Python | b1d4ad5923a214a28c9992d2fc9329ee4d8a1292 | [
"MIT"
] | null | null | null | Mundo 01/Ex-004.py | Git-Eduardo-Henrique/CEV-Python | b1d4ad5923a214a28c9992d2fc9329ee4d8a1292 | [
"MIT"
] | null | null | null | Mundo 01/Ex-004.py | Git-Eduardo-Henrique/CEV-Python | b1d4ad5923a214a28c9992d2fc9329ee4d8a1292 | [
"MIT"
] | null | null | null | # tipo = coleta caracteres digitos para dizer seu tipo, se é numerio,etc..
# ========================================================================
# titulo e coleta de dados
print("\033[33m============[ EX 004 ]============")
print(34 * "=", "\033[m")
tipo = input("digite \033[33malgo\033[m: ")
print(34 * "\033[33m=... | 53.294118 | 74 | 0.471302 |
print("\033[33m============[ EX 004 ]============")
print(34 * "=", "\033[m")
tipo = input("digite \033[33malgo\033[m: ")
print(34 * "\033[33m=", "\033[m")
print(f"({tipo}) é do tipo: \033[33m{type(tipo)}\033[m")
print(f"({tipo}) é numero? \033[33m{tipo.isalnum()}\033[m")
print(f"({tipo}) é alpha numerico? \033[33... | true | true |
f706ab3863c54bbd61e59442ca836355a7848c87 | 8,388 | py | Python | src/nexuscli/cli.py | bt-thiago/nexus3-cli | c12b746881bf7a3f2c9ee804f238b71ea25ab346 | [
"MIT"
] | null | null | null | src/nexuscli/cli.py | bt-thiago/nexus3-cli | c12b746881bf7a3f2c9ee804f238b71ea25ab346 | [
"MIT"
] | null | null | null | src/nexuscli/cli.py | bt-thiago/nexus3-cli | c12b746881bf7a3f2c9ee804f238b71ea25ab346 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""Nexus 3 CLI
Usage:
nexus3 --help, -h
nexus3 login
nexus3 (list|ls) <repository_path>
nexus3 (upload|up) <from_src> <to_repository>
nexus3 repo create hosted maven <repo_name>
[--blob=<store_name>] [--version=<v_policy>]
[--layout=<l_policy>] [--strict-content]
... | 32.3861 | 79 | 0.660587 |
import getpass
import inflect
import json
import sys
import types
from docopt import docopt
from nexuscli.exception import NexusClientConfigurationNotFound
from nexuscli.nexus_client import NexusClient
from nexuscli import repository
PLURAL = inflect.engine().plural
def _input(prompt, default=None):
if sys.ve... | true | true |
f706ab3ca6a8cf42d5c1f2f39e4eda2739c1ffa1 | 3,896 | py | Python | Code/bing_wallpaper/bing_wallpaper.py | nanhuayu/hello-world | 4c97477d72cc5d46b65ab3a36b10f6b7dfff3e95 | [
"MIT"
] | null | null | null | Code/bing_wallpaper/bing_wallpaper.py | nanhuayu/hello-world | 4c97477d72cc5d46b65ab3a36b10f6b7dfff3e95 | [
"MIT"
] | null | null | null | Code/bing_wallpaper/bing_wallpaper.py | nanhuayu/hello-world | 4c97477d72cc5d46b65ab3a36b10f6b7dfff3e95 | [
"MIT"
] | null | null | null | #! /usr/bin/python3
# Author: Maximilian Muth <mail@maxi-muth.de>
# https://github.com/mammuth/bing-wallpaper
# Version: 1.0
# License: GPL-2.0
# Description: Downloads the Bing picture of the Day and sets it as wallpaper (Linux / Windows).
import datetime
from urllib.request import urlopen, urlretrieve
from xml.dom i... | 37.104762 | 119 | 0.646304 |
import datetime
from urllib.request import urlopen, urlretrieve
from xml.dom import minidom
import os
import sys
def join_path(*args):
if isinstance(args[0], list):
path_list = args[0]
else:
path_list = args
val = [str(v).strip(' ') for v in path_list]
return os.path.normpa... | true | true |
f706ab899d0001361673b7377645e8a530ea2352 | 9,873 | py | Python | core/data_stream.py | kedartatwawadi/stanford_compression_library | a472a81c71aeb81e181421e42aed75971a1cf4be | [
"MIT"
] | 2 | 2022-01-10T06:18:47.000Z | 2022-01-10T06:18:55.000Z | core/data_stream.py | kedartatwawadi/stanford_compression_library | a472a81c71aeb81e181421e42aed75971a1cf4be | [
"MIT"
] | 20 | 2021-10-17T23:40:52.000Z | 2022-03-08T04:35:42.000Z | core/data_stream.py | kedartatwawadi/stanford_compression_library | a472a81c71aeb81e181421e42aed75971a1cf4be | [
"MIT"
] | null | null | null | import abc
import tempfile
import os
import typing
from core.data_block import DataBlock
Symbol = typing.Any
class DataStream(abc.ABC):
"""abstract class to represent a Data Stream
The DataStream facilitates the block interface.
From the interface standpoint, the two functions which are useful are:
... | 32.584158 | 122 | 0.637597 | import abc
import tempfile
import os
import typing
from core.data_block import DataBlock
Symbol = typing.Any
class DataStream(abc.ABC):
@abc.abstractmethod
def seek(self, pos: int):
pass
@abc.abstractmethod
def get_symbol(self):
pass
def get_block(self, block_size: int) -> Data... | true | true |
f706ac25a665907adb02d8278b86d830d56db685 | 240 | py | Python | reverse.py | subecho/pycarolinas_hypothesis | 9875a24fbbde4a5b4e1e459ba79520ca96c7277f | [
"MIT"
] | null | null | null | reverse.py | subecho/pycarolinas_hypothesis | 9875a24fbbde4a5b4e1e459ba79520ca96c7277f | [
"MIT"
] | null | null | null | reverse.py | subecho/pycarolinas_hypothesis | 9875a24fbbde4a5b4e1e459ba79520ca96c7277f | [
"MIT"
] | null | null | null | def reverse_string(a_string: str):
"""Take the input a_string and return it reversed (e.g. "hello" becomes
"olleh"."""
reversed_string = ""
for i in range(len(a_string)):
reversed_string += a_string[~i]
return reversed_string
| 30 | 73 | 0.7 | def reverse_string(a_string: str):
reversed_string = ""
for i in range(len(a_string)):
reversed_string += a_string[~i]
return reversed_string
| true | true |
f706ac41f003b9f5949025c1d816184bd84d4f9a | 950 | py | Python | programs/pgm16_10.py | danielsunzhongyuan/python_practice | 79bc88db1c52ee2f5607f6f9fec1bbacea2804ff | [
"Apache-2.0"
] | null | null | null | programs/pgm16_10.py | danielsunzhongyuan/python_practice | 79bc88db1c52ee2f5607f6f9fec1bbacea2804ff | [
"Apache-2.0"
] | null | null | null | programs/pgm16_10.py | danielsunzhongyuan/python_practice | 79bc88db1c52ee2f5607f6f9fec1bbacea2804ff | [
"Apache-2.0"
] | null | null | null | #
# This file contains the Python code from Program 16.10 of
# "Data Structures and Algorithms
# with Object-Oriented Design Patterns in Python"
# by Bruno R. Preiss.
#
# Copyright (c) 2003 by Bruno R. Preiss, P.Eng. All rights reserved.
#
# http://www.brpreiss.com/books/opus7/programs/pgm16_10.txt
#
class Graph(Conta... | 31.666667 | 69 | 0.622105 |
# with Object-Oriented Design Patterns in Python"
class Graph(Container):
def breadthFirstTraversal(self, visitor, start):
assert isinstance(visitor, Visitor)
enqueued = Array(self._numberOfVertices)
for v in xrange(self._numberOfVertices):
enqueued[v] = False
q... | true | true |
f706aca450625fdd6bb4ff271d147b1e50a74511 | 1,317 | py | Python | nginup/lib.py | grplyler/nginup | 2c704d28194734e6c70c7be2d639b50dce59e96f | [
"MIT"
] | null | null | null | nginup/lib.py | grplyler/nginup | 2c704d28194734e6c70c7be2d639b50dce59e96f | [
"MIT"
] | 1 | 2020-09-24T20:52:28.000Z | 2020-09-24T20:52:28.000Z | nginup/lib.py | grplyler/nginup | 2c704d28194734e6c70c7be2d639b50dce59e96f | [
"MIT"
] | null | null | null | from os import path, system, mkdir
from shutil import rmtree
from jinja2 import Template
from . import config
from .log import log
print(__file__)
def get_template(name):
template_path = path.join(path.dirname(__file__), 'templates/', name + ".jinja2")
with open(template_path) as file_:
template = Te... | 26.877551 | 85 | 0.637813 | from os import path, system, mkdir
from shutil import rmtree
from jinja2 import Template
from . import config
from .log import log
print(__file__)
def get_template(name):
template_path = path.join(path.dirname(__file__), 'templates/', name + ".jinja2")
with open(template_path) as file_:
template = Te... | true | true |
f706ad8732338ca449fcd82ae0be9e39bad24ae1 | 1,811 | py | Python | mcp/config.py | fkmclane/MCP | e80c3e12c163e9a67870d83340f434c5ed94e075 | [
"MIT"
] | null | null | null | mcp/config.py | fkmclane/MCP | e80c3e12c163e9a67870d83340f434c5ed94e075 | [
"MIT"
] | 15 | 2015-06-13T22:37:25.000Z | 2018-07-07T12:56:35.000Z | mcp/config.py | lilyinstarlight/MCP | e80c3e12c163e9a67870d83340f434c5ed94e075 | [
"MIT"
] | null | null | null | # prefix where servers are kept
prefix = '/var/lib/mcp/servers'
# whether or not to allow server creation
creation = True
# whether to put servers and scripts in a container
container = False
# directory where the sources are kept; ignored if creation is disabled
sources = '/var/lib/mcp/sources'
# temprorary direct... | 27.439394 | 97 | 0.743236 |
prefix = '/var/lib/mcp/servers'
creation = True
container = False
sources = '/var/lib/mcp/sources'
tmp = '/tmp/mcp'
config = '/var/lib/mcp/config'
scripting = '/var/lib/mcp/scripting'
database = '/var/db/mcp'
maxlogsize = 100
portrange = (4534, 4634)
log = '/var/log/mcp/manager.log'
cmdlog = '/va... | true | true |
f706af07b572ec69764fa714a8534e8926f9e901 | 43,100 | py | Python | electrum/gui/qt/transaction_dialog.py | c4pt000/electrum-uraniumx | 4a10156eab96c33570c3d2a4ca04ac42f05d5552 | [
"MIT"
] | 1 | 2022-02-24T20:13:49.000Z | 2022-02-24T20:13:49.000Z | electrum/gui/qt/transaction_dialog.py | c4pt000/electrum-uraniumx | 4a10156eab96c33570c3d2a4ca04ac42f05d5552 | [
"MIT"
] | null | null | null | electrum/gui/qt/transaction_dialog.py | c4pt000/electrum-uraniumx | 4a10156eab96c33570c3d2a4ca04ac42f05d5552 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#
# Electrum - lightweight UraniumX client
# Copyright (C) 2012 thomasv@gitorious
#
# 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 with... | 42.800397 | 147 | 0.642622 |
import sys
import copy
import datetime
import traceback
import time
from typing import TYPE_CHECKING, Callable, Optional, List, Union
from functools import partial
from decimal import Decimal
from PyQt5.QtCore import QSize, Qt
from PyQt5.QtGui import QTextCharFormat, QBrush, QFont, QPixmap
fro... | true | true |
f706b01ae93e66c966f1fe50b1935e713601dc1b | 9,534 | py | Python | iputil/geoip.py | kolanos/iputil | a23641edf1fd941768eebb1938340d2173ac2e11 | [
"MIT"
] | 1 | 2016-05-18T17:59:39.000Z | 2016-05-18T17:59:39.000Z | iputil/geoip.py | kolanos/iputil | a23641edf1fd941768eebb1938340d2173ac2e11 | [
"MIT"
] | null | null | null | iputil/geoip.py | kolanos/iputil | a23641edf1fd941768eebb1938340d2173ac2e11 | [
"MIT"
] | null | null | null | from collections import defaultdict
import json
import mmap
import operator
import os
import socket
from struct import Struct
MMDB_META_DATA_START = '\xAB\xCD\xEFMaxMind.com'
MMDB_META_DATA_BLOCK_MAX_SIZE = 131072
MMDB_DATA_SECTION_SEPARATOR = 16
unpack_int = Struct('>I').unpack
unpack_long = Struct('>Q').unpack
unpa... | 29.79375 | 84 | 0.568387 | from collections import defaultdict
import json
import mmap
import operator
import os
import socket
from struct import Struct
MMDB_META_DATA_START = '\xAB\xCD\xEFMaxMind.com'
MMDB_META_DATA_BLOCK_MAX_SIZE = 131072
MMDB_DATA_SECTION_SEPARATOR = 16
unpack_int = Struct('>I').unpack
unpack_long = Struct('>Q').unpack
unpa... | true | true |
f706b04f393bf0aca226245425bde4b5c0446a3e | 6,530 | py | Python | python/fem/norm.py | NegriLuca/pigasus | d5057b771f81cfa05bb08ea4b0fd99088150cd7a | [
"MIT"
] | 1 | 2021-10-21T17:15:26.000Z | 2021-10-21T17:15:26.000Z | python/fem/norm.py | NegriLuca/pigasus | d5057b771f81cfa05bb08ea4b0fd99088150cd7a | [
"MIT"
] | null | null | null | python/fem/norm.py | NegriLuca/pigasus | d5057b771f81cfa05bb08ea4b0fd99088150cd7a | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
#! /usr/bin/python
# To change this template, choose Tools | Templates
# and open the template in the editor.
__author__="ARA"
__all__ = ['norm']
__date__ ="$Feb 14, 2012 11:40:06 AM$"
from . import common_obj as _com
from . import constants as _cst
import numpy as _np
from .pigasusObject imp... | 32.65 | 103 | 0.554058 |
__author__="ARA"
__all__ = ['norm']
__date__ ="$Feb 14, 2012 11:40:06 AM$"
from . import common_obj as _com
from . import constants as _cst
import numpy as _np
from .pigasusObject import *
class norm(pigasusObject):
def __init__ ( self, field = None, type = None, func = None, paramevalfunc = False, exact = ... | true | true |
f706b1429b8bc5d67a45dbfe2d3bbdba82f7c46c | 1,221 | py | Python | xclim/__init__.py | raquel-ucl/xclim | 6102e542e6e08072a60879d6200f9340207cd50e | [
"Apache-2.0"
] | 1 | 2022-02-03T13:46:58.000Z | 2022-02-03T13:46:58.000Z | xclim/__init__.py | raquel-ucl/xclim | 6102e542e6e08072a60879d6200f9340207cd50e | [
"Apache-2.0"
] | null | null | null | xclim/__init__.py | raquel-ucl/xclim | 6102e542e6e08072a60879d6200f9340207cd50e | [
"Apache-2.0"
] | null | null | null | # -*- coding: utf-8 -*-
"""Climate indices computation package based on Xarray."""
from importlib.resources import contents, path
from xclim.core import units # noqa
from xclim.core.indicator import build_indicator_module_from_yaml
from xclim.core.locales import load_locale
from xclim.core.options import set_options ... | 37 | 70 | 0.715807 |
from importlib.resources import contents, path
from xclim.core import units
from xclim.core.indicator import build_indicator_module_from_yaml
from xclim.core.locales import load_locale
from xclim.core.options import set_options
from xclim.indicators import atmos, land, seaIce
__author__ = """Travis Logan"""
__... | true | true |
f706b1796726f3c751385b944454f98cf5aa5eae | 3,104 | py | Python | networkx-d3-v2/lib/gdata/tlslite/VerifierDB.py | suraj-testing2/Clock_Websites | 0e65331da40cfd3766f1bde17f0a9c7ff6666dea | [
"Apache-2.0"
] | 2,293 | 2015-01-02T12:46:10.000Z | 2022-03-29T09:45:43.000Z | third_party/tlslite/tlslite/VerifierDB.py | 1065672644894730302/Chromium | 239dd49e906be4909e293d8991e998c9816eaa35 | [
"BSD-3-Clause"
] | 315 | 2015-05-31T11:55:46.000Z | 2022-01-12T08:36:37.000Z | third_party/tlslite/tlslite/VerifierDB.py | 1065672644894730302/Chromium | 239dd49e906be4909e293d8991e998c9816eaa35 | [
"BSD-3-Clause"
] | 1,033 | 2015-01-04T07:48:40.000Z | 2022-03-24T09:34:37.000Z | """Class for storing SRP password verifiers."""
from utils.cryptomath import *
from utils.compat import *
import mathtls
from BaseDB import BaseDB
class VerifierDB(BaseDB):
"""This class represent an in-memory or on-disk database of SRP
password verifiers.
A VerifierDB can be passed to a server handshake... | 34.488889 | 71 | 0.638209 |
from utils.cryptomath import *
from utils.compat import *
import mathtls
from BaseDB import BaseDB
class VerifierDB(BaseDB):
def __init__(self, filename=None):
BaseDB.__init__(self, filename, "verifier")
def _getItem(self, username, valueStr):
(N, g, salt, verifier) = valueStr.split(" ")
... | true | true |
f706b279409a9817c96740389d9ea969d5de5613 | 370 | py | Python | Config/config_port.py | WingsSec/Meppo | 454aa6ce6cc3e93cadb2dc0c455c56fa5e0f1a94 | [
"MIT"
] | 60 | 2022-03-22T02:40:41.000Z | 2022-03-29T06:23:57.000Z | Config/config_port.py | BambooLove/Meppo | 96e023c0b07c09f334b44fcfb9abfe741a082f0f | [
"MIT"
] | null | null | null | Config/config_port.py | BambooLove/Meppo | 96e023c0b07c09f334b44fcfb9abfe741a082f0f | [
"MIT"
] | 9 | 2022-03-22T12:10:44.000Z | 2022-03-25T07:37:01.000Z | #!/usr/bin/env python3
# _*_ coding:utf-8 _*_
'''
____ _ _ _ _ __ __ _
| _ \ __ _| |__ | |__ (_) |_| \/ | __ _ ___| | __
| |_) / _` | '_ \| '_ \| | __| |\/| |/ _` / __| |/ /
| _ < (_| | |_) | |_) | | |_| | | | (_| \__ \ <
|_| \_\__,_|_.__/|_.__/|_|\__|_| |_|\__,_|___/_|\_\
'''
# 协议... | 24.666667 | 52 | 0.372973 |
HTTP_PORT=['80']
HTTPS_PORT=['443','8443'] | true | true |
f706b3732f16caf966a60526790b2ccb67e4d050 | 392 | py | Python | nablapps/poll/migrations/0008_remove_poll_content_type.py | Amund211/nablaweb | 8105c34615d4b67637e982545fbc6489a131c1f3 | [
"MIT"
] | 17 | 2019-10-07T15:10:58.000Z | 2022-01-21T14:18:07.000Z | nablapps/poll/migrations/0008_remove_poll_content_type.py | Amund211/nablaweb | 8105c34615d4b67637e982545fbc6489a131c1f3 | [
"MIT"
] | 222 | 2019-10-07T15:04:51.000Z | 2022-03-24T12:14:16.000Z | nablapps/poll/migrations/0008_remove_poll_content_type.py | Amund211/nablaweb | 8105c34615d4b67637e982545fbc6489a131c1f3 | [
"MIT"
] | 7 | 2019-10-10T18:53:42.000Z | 2021-10-18T02:13:09.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.9.3 on 2016-04-02 16:27
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("poll", "0007_poll_content_type"),
]
operations = [
migrations.RemoveField(
... | 19.6 | 47 | 0.612245 |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
("poll", "0007_poll_content_type"),
]
operations = [
migrations.RemoveField(
model_name="poll",
name="content_type",
),
... | true | true |
f706b37e75056eba2c57092bbc85939594f5292f | 311 | py | Python | tests/test_dispatch.py | jmwri/cmdbus | 3b9881d59f4c2556154547d0774f511b3851caff | [
"MIT"
] | null | null | null | tests/test_dispatch.py | jmwri/cmdbus | 3b9881d59f4c2556154547d0774f511b3851caff | [
"MIT"
] | null | null | null | tests/test_dispatch.py | jmwri/cmdbus | 3b9881d59f4c2556154547d0774f511b3851caff | [
"MIT"
] | null | null | null | from cmdbus import cmdbus, Command
class AddCommand(Command):
def __init__(self, v1: int, v2: int):
self.v1 = v1
self.v2 = v2
def handle(self):
return self.v1 + self.v2
def test_dispatch():
cmd = AddCommand(3, 5)
result = cmdbus.dispatch(cmd)
assert result is 8
| 18.294118 | 41 | 0.617363 | from cmdbus import cmdbus, Command
class AddCommand(Command):
def __init__(self, v1: int, v2: int):
self.v1 = v1
self.v2 = v2
def handle(self):
return self.v1 + self.v2
def test_dispatch():
cmd = AddCommand(3, 5)
result = cmdbus.dispatch(cmd)
assert result is 8
| true | true |
f706b4db8909be1777165f29f6fcf6ec02303d5e | 3,372 | py | Python | octconv.py | iacolippo/octconv-pytorch | 032641413f1e8ece2893118e13cd1815d71ce0a9 | [
"Apache-2.0"
] | 242 | 2019-04-16T16:17:59.000Z | 2022-03-28T02:58:31.000Z | octconv.py | iacolippo/octconv-pytorch | 032641413f1e8ece2893118e13cd1815d71ce0a9 | [
"Apache-2.0"
] | 9 | 2019-04-19T08:26:57.000Z | 2019-05-03T13:27:38.000Z | octconv.py | iacolippo/octconv-pytorch | 032641413f1e8ece2893118e13cd1815d71ce0a9 | [
"Apache-2.0"
] | 27 | 2019-04-16T15:01:27.000Z | 2020-05-17T08:22:31.000Z | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
class OctConv(nn.Module):
def __init__(self, ch_in, ch_out, kernel_size, stride=1, alphas=(0.5, 0.5)):
super(OctConv, self).__init__()
self.alpha_in, self.alpha_out = alphas
assert 0 <= self.alpha_in <= 1... | 43.792208 | 113 | 0.586002 | import numpy as np
import torch
import torch.nn as nn
import torch.nn.functional as F
class OctConv(nn.Module):
def __init__(self, ch_in, ch_out, kernel_size, stride=1, alphas=(0.5, 0.5)):
super(OctConv, self).__init__()
self.alpha_in, self.alpha_out = alphas
assert 0 <= self.alpha_in <= 1... | true | true |
f706b5c7b7170aa564ab95043081ff8f13e50ac2 | 10,184 | py | Python | third_party/tvcm/tvcm/parse_html_deps_unittest.py | bpsinc-native/src_third_party_trace-viewer | 1968c6eb82a51e388415f86434e6c6d2f95e1c35 | [
"BSD-3-Clause"
] | null | null | null | third_party/tvcm/tvcm/parse_html_deps_unittest.py | bpsinc-native/src_third_party_trace-viewer | 1968c6eb82a51e388415f86434e6c6d2f95e1c35 | [
"BSD-3-Clause"
] | null | null | null | third_party/tvcm/tvcm/parse_html_deps_unittest.py | bpsinc-native/src_third_party_trace-viewer | 1968c6eb82a51e388415f86434e6c6d2f95e1c35 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
# Copyright (c) 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import re
import unittest
from tvcm import parse_html_deps
from tvcm import module as module_module
from tvcm import html_generati... | 33.5 | 88 | 0.631186 |
import re
import unittest
from tvcm import parse_html_deps
from tvcm import module as module_module
from tvcm import html_generation_controller
class ParseTests(unittest.TestCase):
def test_parse_empty(self):
parser = parse_html_deps.HTMLModuleParser()
module = parser.Parse("")
self.assertEquals([... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.