hexsha stringlengths 40 40 | size int64 4 1.02M | ext stringclasses 8
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 209 | max_stars_repo_name stringlengths 5 121 | 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 209 | max_issues_repo_name stringlengths 5 121 | max_issues_repo_head_hexsha stringlengths 40 40 | max_issues_repo_licenses listlengths 1 10 | max_issues_count int64 1 67k ⌀ | 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 209 | max_forks_repo_name stringlengths 5 121 | 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 4 1.02M | avg_line_length float64 1.07 66.1k | max_line_length int64 4 266k | alphanum_fraction float64 0.01 1 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
2e37655c7659dc37db772ca1af7fa4bf6b6ece46 | 6,218 | py | Python | shape/shape.py | jcolekaplan/computer_vision | 48d39b081a7b6b699019052eeae36ab703bb34eb | [
"MIT"
] | null | null | null | shape/shape.py | jcolekaplan/computer_vision | 48d39b081a7b6b699019052eeae36ab703bb34eb | [
"MIT"
] | null | null | null | shape/shape.py | jcolekaplan/computer_vision | 48d39b081a7b6b699019052eeae36ab703bb34eb | [
"MIT"
] | null | null | null | """
Jacob Kaplan
shape.py
Purpose: Given a set of point coordinates in R^2 , compute and output the following:
(a) The minimum and maximum x and y values.
(b) The center of mass (average) x and y values.
(c) The axis along which the data varies the least and the standard deviation of this v... | 33.793478 | 100 | 0.542618 |
1940e4a739882716d2e9e4f8e6a181ae12b793c5 | 2,641 | py | Python | bot1.py | Nihal-Srivastava05/Hackoween-Hacktoberfest2021 | 531041ab6e68488d4d491c10b7a5949c61618cc8 | [
"MIT"
] | 19 | 2021-10-03T06:12:28.000Z | 2021-10-30T13:07:56.000Z | bot1.py | Nihal-Srivastava05/Hackoween-Hacktoberfest2021 | 531041ab6e68488d4d491c10b7a5949c61618cc8 | [
"MIT"
] | 68 | 2021-10-03T05:59:13.000Z | 2021-10-31T17:34:40.000Z | bot1.py | Nihal-Srivastava05/Hackoween-Hacktoberfest2021 | 531041ab6e68488d4d491c10b7a5949c61618cc8 | [
"MIT"
] | 122 | 2021-10-01T03:01:59.000Z | 2021-11-02T16:45:42.000Z | import pyautogui
import webbrowser
import time
import os
import fnmatch
import shutil
pyautogui.moveTo(427,398, duration=0.25)
pyautogui.click(427,398, button='left',duration=0.25)
a=0.25
b=a*2
c=a/2
pyautogui.press('space')
pyautogui.moveTo(412, 275, duration=0.25)
pyautogui.click(412, 275,button='lef... | 21.471545 | 54 | 0.699356 |
0f6c965351a0ecfe39185b5276edd6f185010e1d | 707 | py | Python | src/oop/deck.py | JadielTeofilo/General-Algorithms | dfcf86c6ecd727573079f8971187c47bdb7a37bb | [
"MIT"
] | null | null | null | src/oop/deck.py | JadielTeofilo/General-Algorithms | dfcf86c6ecd727573079f8971187c47bdb7a37bb | [
"MIT"
] | null | null | null | src/oop/deck.py | JadielTeofilo/General-Algorithms | dfcf86c6ecd727573079f8971187c47bdb7a37bb | [
"MIT"
] | null | null | null | """
Deck of Cards: Design the data structures for a generic deck of cards. Explain how you would subclass the data structures to implement blackjack.
Does it mean the classical deck of cards?
Yes, 52 cards, 13 ranks, 4 suits
"""
import enum
import dataclasses
class Suit(enum.Enum):
hearts = 1
sp... | 13.862745 | 145 | 0.595474 |
57d9718124f9a19f52eb845ea535d6fe90b3ce4b | 1,626 | py | Python | admin/base/urls.py | h-ci-user01/osf.h-test | a61db2c639a26031aa5b7f58c4dd719919aa5ece | [
"Apache-2.0"
] | null | null | null | admin/base/urls.py | h-ci-user01/osf.h-test | a61db2c639a26031aa5b7f58c4dd719919aa5ece | [
"Apache-2.0"
] | 18 | 2020-03-24T15:26:02.000Z | 2022-03-08T21:30:39.000Z | admin/base/urls.py | h-ci-user01/osf.h-test | a61db2c639a26031aa5b7f58c4dd719919aa5ece | [
"Apache-2.0"
] | null | null | null | from django.conf.urls import include, url
from django.contrib import admin
from settings import ADMIN_BASE
from . import views
base_pattern = '^{}'.format(ADMIN_BASE)
urlpatterns = [
### ADMIN ###
url(
base_pattern,
include([
url(r'^$', views.home, name='home'),
url(r... | 42.789474 | 115 | 0.568266 |
3a2232d1f5aa555cb815acc2f1fdfae2beb52c82 | 7,274 | py | Python | mars/tensor/stats/tests/test_stats_execute.py | snsnlou/mars | 6b8eec162eccc8bb980a98ca2cf1e6a4b866d302 | [
"Apache-2.0"
] | 1 | 2021-11-30T12:07:21.000Z | 2021-11-30T12:07:21.000Z | mars/tensor/stats/tests/test_stats_execute.py | snsnlou/mars | 6b8eec162eccc8bb980a98ca2cf1e6a4b866d302 | [
"Apache-2.0"
] | null | null | null | mars/tensor/stats/tests/test_stats_execute.py | snsnlou/mars | 6b8eec162eccc8bb980a98ca2cf1e6a4b866d302 | [
"Apache-2.0"
] | null | null | null | # Copyright 1999-2020 Alibaba Group Holding 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 a... | 35.140097 | 99 | 0.60022 |
6af2f20742d8aa62cfe724b8ce8112d7b6bc9b34 | 4,349 | py | Python | vyvodi/layers/dense_hierarchical.py | nickolasgryga/vyvodi | e5390119152f7f40b3ba2a748e75e1ef25b5d240 | [
"Apache-2.0"
] | 1 | 2022-01-31T15:21:45.000Z | 2022-01-31T15:21:45.000Z | vyvodi/layers/dense_hierarchical.py | nickolasgryga/vyvodi | e5390119152f7f40b3ba2a748e75e1ef25b5d240 | [
"Apache-2.0"
] | 6 | 2022-01-31T15:22:31.000Z | 2022-02-02T16:22:44.000Z | vyvodi/layers/dense_hierarchical.py | vyvodi/vyvodi | 06702fc59c90766f6d15e975ce4f8d60fa3481ee | [
"Apache-2.0"
] | 1 | 2022-02-04T18:30:39.000Z | 2022-02-04T18:30:39.000Z | import tensorflow as tf
import tensorflow_probability as tfp
from tensorflow_probability.python.layers.dense_variational_v2 import (
_make_kl_divergence_penalty
)
tfk = tf.keras
tfkl = tf.keras.layers
tfpl = tfp.layers
tfd = tfp.distributions
tfb = tfp.bijectors
class DenseHierarchical(tfkl.Layer):
"""Dense ... | 32.699248 | 77 | 0.604277 |
fc71eeae71cee189adb8cbd414ce26921b83fd25 | 9,282 | py | Python | kolga/libs/docker.py | riksu-raksu/k-lga | d9f940a34decbf805456e6b04bc3b641b0e860fd | [
"MIT"
] | null | null | null | kolga/libs/docker.py | riksu-raksu/k-lga | d9f940a34decbf805456e6b04bc3b641b0e860fd | [
"MIT"
] | null | null | null | kolga/libs/docker.py | riksu-raksu/k-lga | d9f940a34decbf805456e6b04bc3b641b0e860fd | [
"MIT"
] | null | null | null | import re
from pathlib import Path
from typing import Dict, List
from kolga.utils.logger import logger
from kolga.utils.models import DockerImage, ImageStage
from ..settings import settings
from ..utils.general import get_environment_vars_by_prefix, run_os_command
class Docker:
"""
A wrapper class around va... | 33.268817 | 96 | 0.58371 |
40eeb811b0e8536a5fe9bf934debf738fc287e89 | 21,089 | py | Python | TICC_solver.py | PKandarp/TICC | 6d380ec45720027080f59857991bb33337058977 | [
"BSD-2-Clause"
] | 393 | 2017-04-21T18:18:16.000Z | 2022-03-30T10:55:34.000Z | TICC_solver.py | PKandarp/TICC | 6d380ec45720027080f59857991bb33337058977 | [
"BSD-2-Clause"
] | 70 | 2017-05-01T13:21:00.000Z | 2022-03-24T03:02:26.000Z | TICC_solver.py | PKandarp/TICC | 6d380ec45720027080f59857991bb33337058977 | [
"BSD-2-Clause"
] | 150 | 2017-03-04T00:07:16.000Z | 2022-03-23T23:59:03.000Z | import numpy as np
import math, time, collections, os, errno, sys, code, random
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from sklearn import mixture
from sklearn.cluster import KMeans
import pandas as pd
from multiprocessing import Pool
from src.TICC_helper import *
from src.admm_solver ... | 52.200495 | 130 | 0.611978 |
1faf2a8187170ea8e67cbb26c38caaaf98862a06 | 5,076 | py | Python | profiles_api/views.py | ConnorDBurge/profiles-rest-api | cea2adcbad7a8089af2489d3e062650623b15171 | [
"MIT"
] | null | null | null | profiles_api/views.py | ConnorDBurge/profiles-rest-api | cea2adcbad7a8089af2489d3e062650623b15171 | [
"MIT"
] | null | null | null | profiles_api/views.py | ConnorDBurge/profiles-rest-api | cea2adcbad7a8089af2489d3e062650623b15171 | [
"MIT"
] | null | null | null | from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework import status
from rest_framework import viewsets
from rest_framework import filters
from rest_framework.authentication import TokenAuthentication
from rest_framework.authtoken.views import ObtainAuthToken
from res... | 38.454545 | 82 | 0.666864 |
49c3c55b9bd427040a9e09e289661866fbbb79ce | 2,472 | py | Python | src/pytest_zebrunner/selenium_integration.py | aliscovsky/python-agent-pytest | d1bd4017fc5355c18da1da92272b689386d9d790 | [
"Apache-2.0"
] | null | null | null | src/pytest_zebrunner/selenium_integration.py | aliscovsky/python-agent-pytest | d1bd4017fc5355c18da1da92272b689386d9d790 | [
"Apache-2.0"
] | null | null | null | src/pytest_zebrunner/selenium_integration.py | aliscovsky/python-agent-pytest | d1bd4017fc5355c18da1da92272b689386d9d790 | [
"Apache-2.0"
] | null | null | null | import logging
from typing import Any, Dict
from pytest_zebrunner.context import zebrunner_context
logger = logging.getLogger(__name__)
class SeleniumSession:
def __init__(self, reporting_service) -> None: # type: ignore
self._active_sessions: Dict[str, Any] = {}
self.reporting_service = report... | 38.030769 | 101 | 0.677184 |
c64a67bf463c782bb227f972e74d0a2f39b8aa1e | 1,641 | py | Python | examples/ad_manager/v202011/label_service/create_labels.py | bx2/googleads-python-lib | 72481b1dd05266a760034ef853596e014cc48805 | [
"Apache-2.0"
] | null | null | null | examples/ad_manager/v202011/label_service/create_labels.py | bx2/googleads-python-lib | 72481b1dd05266a760034ef853596e014cc48805 | [
"Apache-2.0"
] | null | null | null | examples/ad_manager/v202011/label_service/create_labels.py | bx2/googleads-python-lib | 72481b1dd05266a760034ef853596e014cc48805 | [
"Apache-2.0"
] | 1 | 2021-06-23T09:15:34.000Z | 2021-06-23T09:15:34.000Z | #!/usr/bin/env python
#
# Copyright 2015 Google Inc. 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 requir... | 29.303571 | 77 | 0.707495 |
4f90b9bc9da8c49b3e133dd01375bd7cb77e832a | 2,912 | py | Python | pkgs/burp-ui-monitor/burpui_monitor-decoy/security.py | PaliPalo/burp-ui | affbed705f5b35a630ca1a96c01e6dea1bfbeddb | [
"BSD-3-Clause"
] | 93 | 2015-02-10T16:01:46.000Z | 2021-12-02T21:21:42.000Z | pkgs/burp-ui-monitor/burpui_monitor-decoy/security.py | PaliPalo/burp-ui | affbed705f5b35a630ca1a96c01e6dea1bfbeddb | [
"BSD-3-Clause"
] | 5 | 2015-12-18T19:34:46.000Z | 2021-09-17T14:18:10.000Z | pkgs/burp-ui-monitor/burpui_monitor-decoy/security.py | PaliPalo/burp-ui | affbed705f5b35a630ca1a96c01e6dea1bfbeddb | [
"BSD-3-Clause"
] | 17 | 2015-09-21T22:24:05.000Z | 2021-10-01T14:28:47.000Z | # -*- coding: utf8 -*-
"""
.. module:: burpui.security
:platform: Unix
:synopsis: Burp-UI security module.
.. moduleauthor:: Ziirish <hi+burpui@ziirish.me>
"""
from ._compat import to_unicode, urlparse, urljoin
def sanitize_string(string, strict=True, paranoid=False):
"""Return a 'safe' version of the s... | 33.471264 | 85 | 0.567308 |
5ec56f32c96b212941cfaee86e77c94b1e1bd129 | 2,512 | py | Python | metrics/accf1.py | ColinWine/Multi-modal-Multi-label-Facial-Action-Unit-Detection-with-Transformer | 93871bed9078d5bf6b4bb37407c9dce87c569b55 | [
"MIT"
] | null | null | null | metrics/accf1.py | ColinWine/Multi-modal-Multi-label-Facial-Action-Unit-Detection-with-Transformer | 93871bed9078d5bf6b4bb37407c9dce87c569b55 | [
"MIT"
] | null | null | null | metrics/accf1.py | ColinWine/Multi-modal-Multi-label-Facial-Action-Unit-Detection-with-Transformer | 93871bed9078d5bf6b4bb37407c9dce87c569b55 | [
"MIT"
] | null | null | null | import numpy as np
from sklearn.metrics import f1_score, accuracy_score
def acc_f1_score(y_true, y_pred, ignore_index=None, normalize=False, average='macro', **kwargs):
"""Multi-class f1 score and accuracy"""
y_true = np.asarray(y_true)
y_pred = np.asarray(y_pred)
if ignore_index is not None:
... | 32.205128 | 96 | 0.57285 |
77e13aec01637c051d31ff315fefbf23b734a76d | 4,025 | py | Python | flickr-data-tool.py | lucasrangit/flickr-data-tool | 1df74c7910fc02b29fadf835cb623f1699638d0f | [
"Apache-2.0"
] | 1 | 2019-01-04T00:22:53.000Z | 2019-01-04T00:22:53.000Z | flickr-data-tool.py | lucasrangit/flickr-data-tool | 1df74c7910fc02b29fadf835cb623f1699638d0f | [
"Apache-2.0"
] | null | null | null | flickr-data-tool.py | lucasrangit/flickr-data-tool | 1df74c7910fc02b29fadf835cb623f1699638d0f | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python3
"""
Flickr Data Tool
Requires Flickr data in two directories: metadata (json) and data (photo/video).
Features:
* Recreate albums as "Title - Description" and hardlink photos/videos.
"""
import argparse
from glob import glob
import json
import os
from pprint import pprint
import shutil
import... | 28.75 | 99 | 0.637764 |
aab3fafdeb8199a03db2a05c91b3a195bd861531 | 74,997 | py | Python | API_Automation/Shared/resources/shared_nbs_nasa/parametros_nbs_nasa.py | yjoaoMarco/automacao-site-vw-epeca | 7c3ab025b280b0af5e8bae9c3060e8335e978e78 | [
"MIT"
] | null | null | null | API_Automation/Shared/resources/shared_nbs_nasa/parametros_nbs_nasa.py | yjoaoMarco/automacao-site-vw-epeca | 7c3ab025b280b0af5e8bae9c3060e8335e978e78 | [
"MIT"
] | null | null | null | API_Automation/Shared/resources/shared_nbs_nasa/parametros_nbs_nasa.py | yjoaoMarco/automacao-site-vw-epeca | 7c3ab025b280b0af5e8bae9c3060e8335e978e78 | [
"MIT"
] | null | null | null | def nbs_nasa_token():
return{
"method": "POST",
"endpoint": "http://201.47.184.196:8080/nbs-infra/security/token?usuario=EPECASVW&senha=nbs&idioma=PT&pacote=ASSOBRAV",
"body": "",
"headers": ""
}
def nbs_nasa_conexao():
return{
"method": "GET",
"endpoint"... | 22.913841 | 1,113 | 0.536115 |
7f467675fad3ea982c5bed72aa0a85f787798221 | 8,763 | py | Python | tasklib/serializing.py | xerus2000/tasklib | d912f4371ceef0c7028a63d76d2152b27cc12943 | [
"BSD-3-Clause"
] | null | null | null | tasklib/serializing.py | xerus2000/tasklib | d912f4371ceef0c7028a63d76d2152b27cc12943 | [
"BSD-3-Clause"
] | null | null | null | tasklib/serializing.py | xerus2000/tasklib | d912f4371ceef0c7028a63d76d2152b27cc12943 | [
"BSD-3-Clause"
] | null | null | null | import datetime
import importlib
import json
import pytz
import tzlocal
from .lazy import LazyUUIDTaskSet, LazyUUIDTask
DATE_FORMAT = '%Y%m%dT%H%M%SZ'
local_zone = tzlocal.get_localzone()
class SerializingObject(object):
"""
Common ancestor for TaskResource & TaskWarriorFilter, since they both
need to ... | 34.5 | 79 | 0.652288 |
d39c256d6bc350df51df242952f9c1953dae4c50 | 36,385 | py | Python | EQTransformer/utils/associator.py | malcolmw/EQTransformer | 130dcfbeb72d1d2044fe06cdf755d70e241d3281 | [
"MIT"
] | null | null | null | EQTransformer/utils/associator.py | malcolmw/EQTransformer | 130dcfbeb72d1d2044fe06cdf755d70e241d3281 | [
"MIT"
] | null | null | null | EQTransformer/utils/associator.py | malcolmw/EQTransformer | 130dcfbeb72d1d2044fe06cdf755d70e241d3281 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Fri Dec 27 18:52:42 2019
@author: mostafamousavi
last update: 06/23/2020
"""
from datetime import datetime, timedelta
from tqdm import tqdm
import numpy as np
import json
import os
import platform
import sqlite3
import pandas as pd
import csv
from os imp... | 51.246479 | 293 | 0.425587 |
dfed16dafca39835d8c05ee21101ae4b27c154ef | 29,989 | py | Python | tests/sandbox/.venv_ccf_sandbox/lib/python3.8/site-packages/sklearn/ensemble/_hist_gradient_boosting/tests/test_gradient_boosting.py | iLuSIAnn/test | 10d0a20dc1a646b5c1f6c7bff2960e3f5df0510e | [
"Apache-2.0"
] | 76 | 2020-07-06T14:44:05.000Z | 2022-02-14T15:30:21.000Z | tests/sandbox/.venv_ccf_sandbox/lib/python3.8/site-packages/sklearn/ensemble/_hist_gradient_boosting/tests/test_gradient_boosting.py | iLuSIAnn/test | 10d0a20dc1a646b5c1f6c7bff2960e3f5df0510e | [
"Apache-2.0"
] | 37 | 2020-10-20T08:30:53.000Z | 2020-12-22T13:15:45.000Z | tests/sandbox/.venv_ccf_sandbox/lib/python3.8/site-packages/sklearn/ensemble/_hist_gradient_boosting/tests/test_gradient_boosting.py | iLuSIAnn/test | 10d0a20dc1a646b5c1f6c7bff2960e3f5df0510e | [
"Apache-2.0"
] | 13 | 2020-09-07T07:24:35.000Z | 2022-02-24T04:56:16.000Z | import numpy as np
import pytest
from numpy.testing import assert_allclose, assert_array_equal
from sklearn.datasets import make_classification, make_regression
from sklearn.datasets import make_low_rank_matrix
from sklearn.preprocessing import KBinsDiscretizer, MinMaxScaler
from sklearn.model_selection import train_te... | 40.145917 | 79 | 0.661476 |
ea27b534b8676ffc1abddcfeb4380adcf0e073ab | 934 | py | Python | useful_scripts/src/worm_gene_length_calculator.py | dangeles/WormFiles | fbdddc1700cb9c21a6ca0fc9430f63f6e32b441b | [
"MIT"
] | null | null | null | useful_scripts/src/worm_gene_length_calculator.py | dangeles/WormFiles | fbdddc1700cb9c21a6ca0fc9430f63f6e32b441b | [
"MIT"
] | null | null | null | useful_scripts/src/worm_gene_length_calculator.py | dangeles/WormFiles | fbdddc1700cb9c21a6ca0fc9430f63f6e32b441b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Spyder Editor
A script to obtain all gene lengths in c. elegans
@david angeles
dangeles@caltech.edu
"""
import pandas as pd
fname= '../input/Caenorhabditis_elegans.WBcel235.rel79.cdna.all.fa'
wbids=[]
gene_lengths= []
with open(fname, 'r') as f:
i= 0
gene= ''
for line in ... | 21.72093 | 75 | 0.555675 |
64f9d7d9a3fab2422aedfe04a673b3ff93a5372a | 2,649 | py | Python | SRC/orientationmap/GUI/orientmapwhowidget.py | usnistgov/OOF3D | 4fd423a48aea9c5dc207520f02de53ae184be74c | [
"X11"
] | 31 | 2015-04-01T15:59:36.000Z | 2022-03-18T20:21:47.000Z | SRC/orientationmap/GUI/orientmapwhowidget.py | usnistgov/OOF3D | 4fd423a48aea9c5dc207520f02de53ae184be74c | [
"X11"
] | 3 | 2015-02-06T19:30:24.000Z | 2017-05-25T14:14:31.000Z | SRC/orientationmap/GUI/orientmapwhowidget.py | usnistgov/OOF3D | 4fd423a48aea9c5dc207520f02de53ae184be74c | [
"X11"
] | 7 | 2015-01-23T15:19:22.000Z | 2021-06-09T09:03:59.000Z | # -*- python -*-
# This software was produced by NIST, an agency of the U.S. government,
# and by statute is not subject to copyright in the United States.
# Recipients of this software assume all responsibilities associated
# with its operation, modification and maintenance. However, to
# facilitate maintenance we as... | 43.42623 | 79 | 0.727444 |
1da5d5ca65dffbf2f838fd8b83b18eea6c102d73 | 536 | py | Python | code/test.py | tas09009/Thredup-database | c52532239800463c850676f3e827ae955bef6e32 | [
"CNRI-Python"
] | null | null | null | code/test.py | tas09009/Thredup-database | c52532239800463c850676f3e827ae955bef6e32 | [
"CNRI-Python"
] | null | null | null | code/test.py | tas09009/Thredup-database | c52532239800463c850676f3e827ae955bef6e32 | [
"CNRI-Python"
] | 4 | 2020-11-02T17:10:19.000Z | 2022-03-18T18:08:45.000Z | import glob
import pandas as pd
import os, re
file_name = "coats"
# product = '61% Cotton, 36% Acrylic, 3% Other'
df = pd.read_csv(f'/home/taniya/Projects/thredup-scraper-api/data/test_runs/merged_{file_name}.csv')
df_materials_banned = ~df.Materials.str.contains("Polyester|Polyamide|Polyethylene|Polymide|Acrylic|... | 33.5 | 130 | 0.798507 |
7e00bd9760cda68822ea1b1ad416fc8a995bb3ed | 24,284 | py | Python | test/test_uri_parser.py | naomielst/mongo-python-driver | e3d1d6f5b48101654a05493fd6eec7fe3fa014bd | [
"Apache-2.0"
] | null | null | null | test/test_uri_parser.py | naomielst/mongo-python-driver | e3d1d6f5b48101654a05493fd6eec7fe3fa014bd | [
"Apache-2.0"
] | 1 | 2021-12-24T11:32:17.000Z | 2021-12-24T11:32:17.000Z | test/test_uri_parser.py | naomielst/mongo-python-driver | e3d1d6f5b48101654a05493fd6eec7fe3fa014bd | [
"Apache-2.0"
] | null | null | null | # Copyright 2011-present MongoDB, 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 law or agreed to in wri... | 46.079696 | 88 | 0.543444 |
fed67d4f8ed2abe095aa1b142c375288f7119fbc | 8,139 | py | Python | easyai/model/seg/encnet_seg.py | lpj0822/image_point_cloud_det | 7b20e2f42f3f2ff4881485da58ad188a1f0d0e0f | [
"MIT"
] | 1 | 2020-09-05T09:18:56.000Z | 2020-09-05T09:18:56.000Z | easyai/model/seg/encnet_seg.py | lpj0822/image_point_cloud_det | 7b20e2f42f3f2ff4881485da58ad188a1f0d0e0f | [
"MIT"
] | 8 | 2020-04-20T02:18:55.000Z | 2022-03-12T00:24:50.000Z | easyai/model/seg/encnet_seg.py | lpj0822/image_point_cloud_det | 7b20e2f42f3f2ff4881485da58ad188a1f0d0e0f | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# Author:
"""
title = {FastFCN: Rethinking Dilated Convolution in the Backbone for Semantic Segmentation},
author = {Wu, Huikai and Zhang, Junge and Huang, Kaiqi and Liang, Kongming and Yu Yizhou},
booktitle = {arXiv preprint arXiv:1903.11816},
year = {2019}
"""
from... | 45.724719 | 96 | 0.56948 |
706214c426fea3b063bf62fdcb4e466ba022aca3 | 897 | py | Python | share/qt/clean_mac_info_plist.py | GWaddell/Musicoin | c90377b2ac16423733011d174882d211140ff4d1 | [
"MIT"
] | 1 | 2016-11-06T09:28:35.000Z | 2016-11-06T09:28:35.000Z | share/qt/clean_mac_info_plist.py | Musicoin/musicoin | c90377b2ac16423733011d174882d211140ff4d1 | [
"MIT"
] | 1 | 2016-12-18T14:34:12.000Z | 2016-12-18T14:34:12.000Z | share/qt/clean_mac_info_plist.py | GWaddell/Musicoin | c90377b2ac16423733011d174882d211140ff4d1 | [
"MIT"
] | 1 | 2016-10-04T00:53:47.000Z | 2016-10-04T00:53:47.000Z | #!/usr/bin/env python
# Jonas Schnelli, 2013
# make sure the Musicoin-Qt.app contains the right plist (including the right version)
# fix made because of serval bugs in Qt mac deployment (https://bugreports.qt-project.org/browse/QTBUG-21267)
from string import Template
from datetime import date
bitcoinDir = "./";
in... | 29.9 | 109 | 0.725753 |
8684821d1ca5ef889b49372c0b609217f147f8d5 | 366 | py | Python | QuotesScrape/QuotesScrape/pipelines.py | Andrewzekid/BrainyQuoteScraper | 741f4696e17d052e967570dd922b49f337abf16f | [
"MIT"
] | null | null | null | QuotesScrape/QuotesScrape/pipelines.py | Andrewzekid/BrainyQuoteScraper | 741f4696e17d052e967570dd922b49f337abf16f | [
"MIT"
] | null | null | null | QuotesScrape/QuotesScrape/pipelines.py | Andrewzekid/BrainyQuoteScraper | 741f4696e17d052e967570dd922b49f337abf16f | [
"MIT"
] | null | null | null | # Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html
# useful for handling different item types with a single interface
from itemadapter import ItemAdapter
class QuotesscrapePipeline:
def process_... | 26.142857 | 66 | 0.770492 |
c2c499001bcc1a12394c049b0acc5611dde8bda4 | 18,730 | py | Python | lib/id3c/api/datastore.py | UWIT-IAM/uw-redcap-client | 38a1eb426fa80697446df7a466a41e0305382606 | [
"MIT"
] | null | null | null | lib/id3c/api/datastore.py | UWIT-IAM/uw-redcap-client | 38a1eb426fa80697446df7a466a41e0305382606 | [
"MIT"
] | null | null | null | lib/id3c/api/datastore.py | UWIT-IAM/uw-redcap-client | 38a1eb426fa80697446df7a466a41e0305382606 | [
"MIT"
] | null | null | null | """
Datastore abstraction for our database.
"""
import logging
import psycopg2
from functools import wraps
from psycopg2 import DataError, DatabaseError, IntegrityError, ProgrammingError
from psycopg2.errors import InsufficientPrivilege
from typing import Any
from uuid import UUID
from werkzeug.exceptions import Forbid... | 39.020833 | 154 | 0.625734 |
a04534a0667316cefe26778be85a10d3eb9fe38e | 6,780 | py | Python | finance/migrations/0001_initial.py | Evineit/Savings-django-webapp | 710ddf2a9b5287f769a299168c4741751c756d8d | [
"Apache-2.0"
] | null | null | null | finance/migrations/0001_initial.py | Evineit/Savings-django-webapp | 710ddf2a9b5287f769a299168c4741751c756d8d | [
"Apache-2.0"
] | null | null | null | finance/migrations/0001_initial.py | Evineit/Savings-django-webapp | 710ddf2a9b5287f769a299168c4741751c756d8d | [
"Apache-2.0"
] | null | null | null | # Generated by Django 3.1 on 2020-10-19 03:25
from django.conf import settings
import django.contrib.auth.models
import django.contrib.auth.validators
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
class Migration(migrations.Migration):
initial = True
... | 61.081081 | 329 | 0.626254 |
d5cd175f46699b2362d6b184be3aa9b7b62cc13b | 7,873 | py | Python | examples/DeepWisdom/Auto_Tabular/explore.py | zichuan-scott-xu/automl-workflow | d108e55da943775953b9f1801311a86ac07e58a0 | [
"Apache-2.0"
] | 3 | 2020-12-15T02:40:43.000Z | 2021-01-14T02:32:13.000Z | examples/DeepWisdom/Auto_Tabular/explore.py | zichuan-scott-xu/automl-workflow | d108e55da943775953b9f1801311a86ac07e58a0 | [
"Apache-2.0"
] | null | null | null | examples/DeepWisdom/Auto_Tabular/explore.py | zichuan-scott-xu/automl-workflow | d108e55da943775953b9f1801311a86ac07e58a0 | [
"Apache-2.0"
] | 4 | 2021-01-07T05:41:38.000Z | 2021-04-07T08:02:22.000Z | import numpy as np
import gc
import collections
from tensorflow.python.keras import backend as K
from Auto_Tabular.feature.feat_engine import FeatEngine
from Auto_Tabular.utils.log_utils import log, timeit
class Explore:
def __init__(self, metadata, info, model_space, data_space):
self.metadata = metada... | 36.962441 | 125 | 0.583259 |
9e37b7caeb8933cd6154466cb8ae149fcf13b5ba | 52,801 | py | Python | superset/utils/core.py | ditutu/superset | 4cb79e50172cc857d73dc3ba76f9f2063d97d762 | [
"Apache-2.0"
] | 2 | 2021-03-17T18:41:18.000Z | 2021-05-27T16:45:12.000Z | superset/utils/core.py | ditutu/superset | 4cb79e50172cc857d73dc3ba76f9f2063d97d762 | [
"Apache-2.0"
] | 17 | 2021-03-18T21:17:31.000Z | 2021-12-06T13:54:03.000Z | superset/utils/core.py | ditutu/superset | 4cb79e50172cc857d73dc3ba76f9f2063d97d762 | [
"Apache-2.0"
] | 1 | 2022-01-10T13:31:22.000Z | 2022-01-10T13:31:22.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 31.504177 | 96 | 0.633605 |
d77ef7dc921cda66823367da292df6f07d81b68a | 170 | py | Python | tests/examples-bad/classmethod3.py | JohannesBuchner/pystrict3 | f442a89ac6a23f4323daed8ef829d8e9e1197f90 | [
"BSD-2-Clause"
] | 1 | 2020-06-05T08:53:26.000Z | 2020-06-05T08:53:26.000Z | tests/examples-bad/classmethod3.py | JohannesBuchner/pystrict3 | f442a89ac6a23f4323daed8ef829d8e9e1197f90 | [
"BSD-2-Clause"
] | 1 | 2020-06-04T13:47:19.000Z | 2020-06-04T13:47:57.000Z | tests/examples-bad/classmethod3.py | JohannesBuchner/pystrict3 | f442a89ac6a23f4323daed8ef829d8e9e1197f90 | [
"BSD-2-Clause"
] | 1 | 2020-11-07T17:02:46.000Z | 2020-11-07T17:02:46.000Z | class FooMany(object):
def __init__(self, a):
self.a = a
def foo(self, b):
self.fookwargs(self.a, self.b, c=1, d=2)
def fookwargs(self, a, b, **kwargs):
pass
| 15.454545 | 42 | 0.623529 |
475799d7b4e75a2f2a5961d9d9e64ae80589e8d9 | 17,233 | py | Python | tests/tests.py | malware-revealer/extractor | c92e7c845024126daacc5e7c4f84af800bf86dcd | [
"MIT"
] | 10 | 2019-08-12T21:50:31.000Z | 2021-07-23T15:42:30.000Z | tests/tests.py | malware-revealer/extractor | c92e7c845024126daacc5e7c4f84af800bf86dcd | [
"MIT"
] | 4 | 2019-10-05T14:00:25.000Z | 2019-10-06T22:05:53.000Z | tests/tests.py | malware-revealer/extractor | c92e7c845024126daacc5e7c4f84af800bf86dcd | [
"MIT"
] | 2 | 2019-10-06T12:31:20.000Z | 2020-10-03T13:33:45.000Z | import unittest
import json
import mrextractor
PE_EXE_DIR = "./test_assets/executables/pe"
ELF_EXE_DIR = "test_assets/executables/elf"
EXPECTED_FEATURES_DIR = "test_assets/expected_features"
EXTRACTED_FEATURES_DIR = "test_assets/extracted_features"
CONFS_DIR = "test_assets/extractor_confs"
PE_0_HASH = "071df5b74f08... | 34.328685 | 78 | 0.593512 |
4ed65632fbb63741a05f0b6bafebe6d5ec456286 | 1,400 | py | Python | jtyoui/web/interfaces.py | vanton/Jtyoui | c44d66b038ac5f4e2d75b68b3493d02f7b7b385e | [
"MIT"
] | 1 | 2019-12-24T00:57:47.000Z | 2019-12-24T00:57:47.000Z | jtyoui/web/interfaces.py | liangxioa/Jtyoui | 5a584cbf12d644b6c4fb13167d8841a383afbbac | [
"MIT"
] | null | null | null | jtyoui/web/interfaces.py | liangxioa/Jtyoui | 5a584cbf12d644b6c4fb13167d8841a383afbbac | [
"MIT"
] | null | null | null | #!/usr/bin/python3.7
# -*- coding: utf-8 -*-
# @Time : 2019/8/13 16:23
# @Author: Jtyoui@qq.com
import json
import time
import requests
def interface_test(dict_, address, record_time=True, **kwargs):
"""简单接口测试
:param dict_: 传入的参数
:param address: url地址
:param kwargs: 参考requests.post **kwargs
:par... | 25.925926 | 84 | 0.659286 |
42395c3c5ff5316e5f0fc5d517f37052f03088ee | 3,386 | py | Python | openml_data_integration/protobuf_generator/openml_1497/server.py | tuix/tutorials | 733d35a8a39df079e8c2432c441b70785ab08440 | [
"Apache-2.0"
] | 8 | 2020-04-21T13:29:04.000Z | 2021-12-13T08:59:09.000Z | openml_data_integration/protobuf_generator/openml_1497/server.py | tuix/tutorials | 733d35a8a39df079e8c2432c441b70785ab08440 | [
"Apache-2.0"
] | 3 | 2021-04-27T11:03:04.000Z | 2021-05-24T18:22:57.000Z | openml_data_integration/protobuf_generator/openml_1497/server.py | tuix/tutorials | 733d35a8a39df079e8c2432c441b70785ab08440 | [
"Apache-2.0"
] | 6 | 2020-07-06T08:23:25.000Z | 2021-11-24T10:39:34.000Z | # date: 2021.07.14
# author: Raul Saavedra raul.saavedra.felipe@iais.fraunhofer.de
import grpc
from concurrent import futures
import time
import numpy
# import constant with the hardcoded openml data ID number
import myconstants
# import the generated grpc related classes for python
import model_pb2
import model_pb2... | 39.835294 | 81 | 0.492912 |
0c53f0c9c0aeac49ecac14399579494a64d7c1d4 | 1,929 | py | Python | tryalgo/matrix_chain_mult.py | Shloub/tryalgo | ec01a16dd6a6053047f1948531bd5e9b2abf0fab | [
"MIT"
] | null | null | null | tryalgo/matrix_chain_mult.py | Shloub/tryalgo | ec01a16dd6a6053047f1948531bd5e9b2abf0fab | [
"MIT"
] | null | null | null | tryalgo/matrix_chain_mult.py | Shloub/tryalgo | ec01a16dd6a6053047f1948531bd5e9b2abf0fab | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Matrix chain multiplication
# multiplication de matrices
# jill-jenn vie et christoph durr - 2014-2015
# snip{
def matrix_mult_opt_order(M):
"""Matrix chain multiplication optimal order
:param M: list of matrices
:returns: matrices opt, arg, such that opt[... | 32.15 | 77 | 0.523069 |
c3fc26f37f7163d03a71200dd7080e11ddc2cf09 | 940 | py | Python | mi/dataset/driver/ctdbp_p/dcl/test/test_ctdbp_p_dcl_recovered_driver.py | petercable/mi-dataset | d3c1607ea31af85fbba5719a31d4a60bf39f8dd3 | [
"BSD-2-Clause"
] | 1 | 2015-05-10T01:08:44.000Z | 2015-05-10T01:08:44.000Z | mi/dataset/driver/ctdbp_p/dcl/test/test_ctdbp_p_dcl_recovered_driver.py | petercable/mi-dataset | d3c1607ea31af85fbba5719a31d4a60bf39f8dd3 | [
"BSD-2-Clause"
] | null | null | null | mi/dataset/driver/ctdbp_p/dcl/test/test_ctdbp_p_dcl_recovered_driver.py | petercable/mi-dataset | d3c1607ea31af85fbba5719a31d4a60bf39f8dd3 | [
"BSD-2-Clause"
] | 9 | 2015-04-15T21:09:08.000Z | 2019-11-15T03:18:53.000Z | import os
import unittest
from nose.plugins.attrib import attr
from mi.core.log import get_logger
from mi.dataset.dataset_driver import ParticleDataHandler
from mi.dataset.driver.ctdbp_p.dcl.ctdbp_p_dcl_recovered_driver import parse
from mi.dataset.driver.ctdbp_p.dcl.resource import RESOURCE_PATH
_author__ = 'jeff ro... | 27.647059 | 85 | 0.757447 |
e1c626a9cf2bd6b774cae0ab45064f6c0079180d | 214 | py | Python | .history/spider_20210123234046.py | KustomApe/yahoauc_spider | bea630bbe1aa88e5138a98137c21865f316fdc96 | [
"MIT"
] | null | null | null | .history/spider_20210123234046.py | KustomApe/yahoauc_spider | bea630bbe1aa88e5138a98137c21865f316fdc96 | [
"MIT"
] | null | null | null | .history/spider_20210123234046.py | KustomApe/yahoauc_spider | bea630bbe1aa88e5138a98137c21865f316fdc96 | [
"MIT"
] | null | null | null | import requests
import urllib.request as urlreq
from bs4 import BeautifulSoup
def main():
url = 'https://auctions.yahoo.co.jp/'
r = urlreq.Request(url)
with urlreq.urlopen(r) as r:
r = r.read() | 23.777778 | 41 | 0.668224 |
08e33bdce52c5502afd883eb8b07e5f6cff1db7f | 10,101 | py | Python | grodddroid/AnalyseAndroBlareTools/algo/logconverter_m.py | demirdagemir/thesis | 4a48bddf815c91729e27484548bb7bbf7ddeda64 | [
"MIT"
] | null | null | null | grodddroid/AnalyseAndroBlareTools/algo/logconverter_m.py | demirdagemir/thesis | 4a48bddf815c91729e27484548bb7bbf7ddeda64 | [
"MIT"
] | null | null | null | grodddroid/AnalyseAndroBlareTools/algo/logconverter_m.py | demirdagemir/thesis | 4a48bddf815c91729e27484548bb7bbf7ddeda64 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import sys
import graphtodot
import argparse
import time
import ply.lex as lex
import networkx as nx
import ply.yacc as yacc
import math
import string
import libsystemflowgraph as lsfg
import re
import os.path
import os
from multiprocessing import Pool
# Define a list of couple (pattern, substit... | 37.690299 | 240 | 0.604891 |
110a0d936cbf3f495059983a0b5237314fb45221 | 32,427 | py | Python | src/dawgdictionary.py | tommyy911/Netskrafl | 6d2cee482290ae64693ea3bcf7e1695abd8fede1 | [
"MIT",
"Unlicense"
] | null | null | null | src/dawgdictionary.py | tommyy911/Netskrafl | 6d2cee482290ae64693ea3bcf7e1695abd8fede1 | [
"MIT",
"Unlicense"
] | 1 | 2021-05-07T11:39:47.000Z | 2021-05-07T11:39:47.000Z | src/dawgdictionary.py | tommyy911/Netskrafl | 6d2cee482290ae64693ea3bcf7e1695abd8fede1 | [
"MIT",
"Unlicense"
] | null | null | null | # -*- coding: utf-8 -*-
""" Word dictionary implemented with a DAWG
Copyright (C) 2019 Miðeind ehf.
Author: Vilhjálmur Þorsteinsson
The GNU General Public License, version 3, applies to this software.
For further information, see https://github.com/mideind/Netskrafl
DawgDictionary uses a Directe... | 38.881295 | 98 | 0.599007 |
f173e7dbf50ff691f2be74f836777c5fb53cb2b8 | 1,082 | py | Python | IO/PreferenceManager.py | EpicTofuu/Froggers | 0395ef801fe11a7881fd32fd570bf3135a4a761f | [
"MIT"
] | 1 | 2020-11-17T04:32:55.000Z | 2020-11-17T04:32:55.000Z | IO/PreferenceManager.py | EpicTofuu/Froggers | 0395ef801fe11a7881fd32fd570bf3135a4a761f | [
"MIT"
] | null | null | null | IO/PreferenceManager.py | EpicTofuu/Froggers | 0395ef801fe11a7881fd32fd570bf3135a4a761f | [
"MIT"
] | null | null | null | import pickle
# handles ALL save data
# despite the file being called pref, the file contains main game data
# that needs to persist during runs. The naming is used to deter tampering.
class PreferenceManager:
def __init__(self) -> None:
self.Preferences = dict()
# write the state to a file
def wr... | 36.066667 | 91 | 0.625693 |
2188a931c434e3191ccee29456c6f1f507d0febd | 38,893 | py | Python | pymc/tests/test_distributions_moments.py | astoeriko/pymc | 7b4bccda2b2f5b0a3de2fd6505d2056b54ddeb98 | [
"Apache-2.0"
] | 1 | 2020-01-18T05:28:55.000Z | 2020-01-18T05:28:55.000Z | pymc/tests/test_distributions_moments.py | astoeriko/pymc | 7b4bccda2b2f5b0a3de2fd6505d2056b54ddeb98 | [
"Apache-2.0"
] | 1 | 2020-08-03T09:42:56.000Z | 2020-08-03T09:42:56.000Z | pymc/tests/test_distributions_moments.py | astoeriko/pymc | 7b4bccda2b2f5b0a3de2fd6505d2056b54ddeb98 | [
"Apache-2.0"
] | null | null | null | import aesara
import numpy as np
import pytest
import scipy.stats as st
from aesara import tensor as at
from scipy import special
import pymc as pm
from pymc.distributions import (
AsymmetricLaplace,
Bernoulli,
Beta,
BetaBinomial,
Binomial,
Categorical,
Cauchy,
ChiSquared,
Constan... | 29.486732 | 96 | 0.536729 |
d09c6a2310b00e4391111e7b58661f4ab0beab08 | 179 | py | Python | studyPython2/advanced_usage/para_attr/parrot.py | fairylyk/studyPy | b227b92ac5707fba665942adbaba6943940819fd | [
"Apache-2.0"
] | null | null | null | studyPython2/advanced_usage/para_attr/parrot.py | fairylyk/studyPy | b227b92ac5707fba665942adbaba6943940819fd | [
"Apache-2.0"
] | 1 | 2021-03-25T22:44:19.000Z | 2021-03-25T22:44:19.000Z | studyPython2/advanced_usage/para_attr/parrot.py | fairylyk/studyPy | b227b92ac5707fba665942adbaba6943940819fd | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
# vim: set fileencoding=utf-8 :
from bird import Bird
from flyable import Flyable
class Parrot(Bird, Flyable):
def wing(self):
print "I have wing" | 17.9 | 31 | 0.687151 |
a4450707aa7cbf09c272826de40930d3c18cf350 | 10,701 | py | Python | scripts/updateversion.py | heyjohnlim/ADOdb | ee5c4364da4e5e557b48db84d94e526fab4e072a | [
"BSD-3-Clause"
] | null | null | null | scripts/updateversion.py | heyjohnlim/ADOdb | ee5c4364da4e5e557b48db84d94e526fab4e072a | [
"BSD-3-Clause"
] | null | null | null | scripts/updateversion.py | heyjohnlim/ADOdb | ee5c4364da4e5e557b48db84d94e526fab4e072a | [
"BSD-3-Clause"
] | 1 | 2019-05-27T11:24:29.000Z | 2019-05-27T11:24:29.000Z | #!/usr/bin/python -u
'''
ADOdb version update script
Updates the version number, and release date in all php and html files
'''
from datetime import date
import getopt
import os
from os import path
import re
import subprocess
import sys
# ADOdb version validation regex
# These are used by sed - they are not... | 26.7525 | 77 | 0.577423 |
63b6f6375cb76cdfb4493c51f8278ecec72edd16 | 63 | py | Python | python/doit/05/sleep1.py | gangserver/py_test | 869bdfa5c94c3b6a15b87e0c3de6b2cdaca821f4 | [
"Apache-2.0"
] | null | null | null | python/doit/05/sleep1.py | gangserver/py_test | 869bdfa5c94c3b6a15b87e0c3de6b2cdaca821f4 | [
"Apache-2.0"
] | null | null | null | python/doit/05/sleep1.py | gangserver/py_test | 869bdfa5c94c3b6a15b87e0c3de6b2cdaca821f4 | [
"Apache-2.0"
] | null | null | null | import time
for i in range(10):
print(i)
time.sleep(1) | 12.6 | 19 | 0.619048 |
6fcddb22e525f98d8e4a4c08e039e92d93321664 | 3,528 | py | Python | petstagram/petstagram/accounts/views.py | BoyanPeychinov/python_web_basics | 2f892ac119f7fe3a5c03fc5e7b35670dc609a70f | [
"MIT"
] | 1 | 2021-07-20T12:16:34.000Z | 2021-07-20T12:16:34.000Z | petstagram/petstagram/accounts/views.py | BoyanPeychinov/python_web_basics | 2f892ac119f7fe3a5c03fc5e7b35670dc609a70f | [
"MIT"
] | null | null | null | petstagram/petstagram/accounts/views.py | BoyanPeychinov/python_web_basics | 2f892ac119f7fe3a5c03fc5e7b35670dc609a70f | [
"MIT"
] | null | null | null | from django.contrib.auth import login, logout, authenticate
from django.contrib.auth.decorators import login_required
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.auth.views import LoginView
from django.core.exceptions import ValidationError
from django.shortcuts import render, redirect... | 28.918033 | 74 | 0.641723 |
4191dbd87dcc57324d738a02328559017a72554c | 1,066 | py | Python | email_notification/tests/test_senders.py | juhasuv/tilavarauspalvelu-core | ba1f3241f7ea5b3949c410c7de2a58c4be951966 | [
"MIT"
] | null | null | null | email_notification/tests/test_senders.py | juhasuv/tilavarauspalvelu-core | ba1f3241f7ea5b3949c410c7de2a58c4be951966 | [
"MIT"
] | null | null | null | email_notification/tests/test_senders.py | juhasuv/tilavarauspalvelu-core | ba1f3241f7ea5b3949c410c7de2a58c4be951966 | [
"MIT"
] | null | null | null | from assertpy import assert_that
from django.core import mail
from django.test import override_settings
from email_notification.models import EmailType
from email_notification.sender.senders import send_reservation_email_notification
from email_notification.tests.base import ReservationEmailBaseTestCase
@override_se... | 46.347826 | 86 | 0.789869 |
501e53a42c5c6295ec17ee9c2af82dd40481bbc3 | 24,879 | py | Python | autoload/leaderf/python/leaderf/bufTagExpl.py | lu5je0/LeaderF | 6cf6862013892200e64945af3a01157a4eb76293 | [
"Apache-2.0"
] | 1,914 | 2015-01-16T07:39:58.000Z | 2022-03-31T15:19:52.000Z | autoload/leaderf/python/leaderf/bufTagExpl.py | lu5je0/LeaderF | 6cf6862013892200e64945af3a01157a4eb76293 | [
"Apache-2.0"
] | 833 | 2015-07-20T08:57:34.000Z | 2022-03-24T07:33:12.000Z | autoload/leaderf/python/leaderf/bufTagExpl.py | lu5je0/LeaderF | 6cf6862013892200e64945af3a01157a4eb76293 | [
"Apache-2.0"
] | 232 | 2015-08-25T08:18:13.000Z | 2022-03-08T11:18:41.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import vim
import re
import os
import sys
import os.path
import tempfile
import itertools
import multiprocessing
from .utils import *
from .explorer import *
from .manager import *
from .asyncExecutor import AsyncExecutor
#************************************************... | 41.673367 | 133 | 0.514571 |
78e6eeffcc8cb5f473de5f785facfa4e28a37fb7 | 293 | py | Python | PythonExercicios/ex109/teste.py | lordvinick/Python | c03fd08d4c204104bf0196b0bd129427fd2067ae | [
"MIT"
] | null | null | null | PythonExercicios/ex109/teste.py | lordvinick/Python | c03fd08d4c204104bf0196b0bd129427fd2067ae | [
"MIT"
] | null | null | null | PythonExercicios/ex109/teste.py | lordvinick/Python | c03fd08d4c204104bf0196b0bd129427fd2067ae | [
"MIT"
] | null | null | null | from ex109 import moeda
p = float(input('Digite o preço: R$'))
print(f'A metade de {moeda.moeda(p)} é {moeda.metade(p)}')
print(f'O dobro de {moeda.moeda(p)} é {moeda.dobro(p, True)}')
print(f'Aumentando 10% temos {moeda.aumentar(p, True)}')
print(f'Reduzindo 13% temos {moeda.diminuir(p)}')
| 36.625 | 62 | 0.686007 |
adc49f2d95f0d3ae888c59f393cd8731fecfa808 | 3,597 | py | Python | src/greentranslator/livy.py | ResearchSoftwareInstitute/greendatatranslator | b20fb52288ed0560158e3a0dec375888ea90e400 | [
"BSD-3-Clause"
] | 2 | 2018-06-25T18:36:45.000Z | 2019-01-29T16:29:36.000Z | src/greentranslator/livy.py | ResearchSoftwareInstitute/greendatatranslator | b20fb52288ed0560158e3a0dec375888ea90e400 | [
"BSD-3-Clause"
] | 183 | 2017-02-07T18:50:59.000Z | 2020-04-01T15:10:27.000Z | src/greentranslator/livy.py | ResearchSoftwareInstitute/greendatatranslator | b20fb52288ed0560158e3a0dec375888ea90e400 | [
"BSD-3-Clause"
] | null | null | null | import json, pprint, requests, textwrap, time, sys, atexit
from string import Template
class LivyContext(object):
def __init__(self, host='http://localhost:8998', kind='pyspark'):
self.host = host
self.data = { 'kind' : kind }
self.headers = { 'Content-Type': 'application/json' }
r ... | 36.333333 | 117 | 0.547679 |
28c7828a6c24cd0c3000d66f6e3b0c7b5980263b | 2,723 | py | Python | etc/reservoir_operation/dam_params/src/get_annualmax_mean.py | DirkEilander/CaMa-Flood_v4 | a8e6a157a08c2a0144b8143bc2eb78d5d81eb9a7 | [
"Apache-2.0"
] | 22 | 2021-01-17T15:22:33.000Z | 2022-01-22T15:14:50.000Z | etc/reservoir_operation/dam_params/src/get_annualmax_mean.py | zhongwangwei/CaMa-Flood_v4 | da1d1745568648858f02984b1e5b7ad05bc9bd3c | [
"Apache-2.0"
] | 3 | 2021-01-19T08:30:50.000Z | 2021-07-16T08:19:01.000Z | etc/reservoir_operation/dam_params/src/get_annualmax_mean.py | zhongwangwei/CaMa-Flood_v4 | da1d1745568648858f02984b1e5b7ad05bc9bd3c | [
"Apache-2.0"
] | 25 | 2021-01-17T15:22:35.000Z | 2022-01-15T08:32:48.000Z | import calendar
from datetime import datetime
import os
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.ticker as tick
import pandas as pd
import matplotlib.dates as mdates
from matplotlib import colors
from scipy.signal import argrelmax
import sys
print(os.path.basename(__file__))
#### initial s... | 28.364583 | 81 | 0.618803 |
e47ea2d194f0472f02d705994cc2bfe843ae1930 | 15 | py | Python | example/multiple_sources/settings.py | RonnyPfannschmidt/dynaconf | 3223f6586aa6ae3ef7b5cd7d198fb950f5038526 | [
"MIT"
] | 2,293 | 2015-08-14T22:39:31.000Z | 2022-03-31T12:44:49.000Z | example/multiple_sources/settings.py | RonnyPfannschmidt/dynaconf | 3223f6586aa6ae3ef7b5cd7d198fb950f5038526 | [
"MIT"
] | 676 | 2015-08-20T19:29:56.000Z | 2022-03-31T13:45:51.000Z | example/multiple_sources/settings.py | RonnyPfannschmidt/dynaconf | 3223f6586aa6ae3ef7b5cd7d198fb950f5038526 | [
"MIT"
] | 255 | 2015-12-02T21:16:33.000Z | 2022-03-20T22:03:46.000Z | PYTHON_VAR = 1
| 7.5 | 14 | 0.733333 |
09b0d84080bc62f7fe29fcdaab0e19c519f84b65 | 806 | py | Python | setup.py | admariner/GA4-Measurement-Protocol-Python | c42cb0f62be6d7fea2f96e880559e513d7707672 | [
"BSD-3-Clause"
] | 19 | 2020-11-18T20:49:12.000Z | 2022-02-08T04:49:36.000Z | setup.py | admariner/GA4-Measurement-Protocol-Python | c42cb0f62be6d7fea2f96e880559e513d7707672 | [
"BSD-3-Clause"
] | 18 | 2020-11-20T21:04:20.000Z | 2022-01-20T03:28:52.000Z | setup.py | admariner/GA4-Measurement-Protocol-Python | c42cb0f62be6d7fea2f96e880559e513d7707672 | [
"BSD-3-Clause"
] | 6 | 2020-11-18T15:16:44.000Z | 2022-01-18T01:24:19.000Z | from setuptools import setup
import sys
try:
long_description=open('DESCRIPTION.rst', 'rt').read()
except Exception:
long_description="Google Analytics 4 Measurement Protocol in Python; an implementation of Google's Analytics 4 Measurement Protocol"
VERSION = '1.1.1'
setup(
name = "ga4mp",
descriptio... | 26 | 136 | 0.705955 |
49758cecb4fe1316090ecc7a38b40915b6bf6792 | 1,588 | py | Python | tests/ex_redundant_ik_grad_descent.py | DerekYJC/bmi_python | 7b9cf3f294a33688db24b0863c1035e9cc6999ea | [
"Apache-2.0"
] | null | null | null | tests/ex_redundant_ik_grad_descent.py | DerekYJC/bmi_python | 7b9cf3f294a33688db24b0863c1035e9cc6999ea | [
"Apache-2.0"
] | 12 | 2020-07-31T18:58:31.000Z | 2022-02-10T14:36:00.000Z | tests/ex_redundant_ik_grad_descent.py | DerekYJC/bmi_python | 7b9cf3f294a33688db24b0863c1035e9cc6999ea | [
"Apache-2.0"
] | 4 | 2020-03-06T15:39:00.000Z | 2021-05-26T17:03:21.000Z | #!/usr/bin/python
'''
Example of inverse kinematics using the simple gradient descent method
'''
from riglib.bmi import robot_arms
reload(robot_arms)
import numpy as np
import matplotlib.pyplot as plt
import time
pi = np.pi
q = np.array([0, 90, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]) * pi/180
q_sub = q[1::3]
chain = robot_a... | 30.538462 | 104 | 0.706549 |
735659b0a525ca3326e55b0957523487606d5119 | 1,835 | py | Python | github-announcer.py | NURDspace/github-announcer | d59938c54704ae4a46ba31fbdcff81e39b22e71d | [
"BSD-3-Clause"
] | null | null | null | github-announcer.py | NURDspace/github-announcer | d59938c54704ae4a46ba31fbdcff81e39b22e71d | [
"BSD-3-Clause"
] | null | null | null | github-announcer.py | NURDspace/github-announcer | d59938c54704ae4a46ba31fbdcff81e39b22e71d | [
"BSD-3-Clause"
] | null | null | null | #! /usr/bin/python3
# pip3 install pygithub
# pip3 install feedgen
from dateutil import parser
from feedgen.feed import FeedGenerator
import github
import sqlite3
n_items = 25
db = '/root/nurdspace/github-announcer.db'
file_out = '/var/www/htdocs.keetweej.vanheusden.com/ns-gh-rss.xml'
github_auth_token = ' something... | 23.525641 | 88 | 0.627248 |
d2e558b503c7a1229c174a811f891b3c13b3df0a | 11,605 | py | Python | main_custom_modified_cross_attention.py | agoel00/LowFER | 4723cb12e1d89c58621ec34c4eb5221c1b51d018 | [
"MIT"
] | null | null | null | main_custom_modified_cross_attention.py | agoel00/LowFER | 4723cb12e1d89c58621ec34c4eb5221c1b51d018 | [
"MIT"
] | null | null | null | main_custom_modified_cross_attention.py | agoel00/LowFER | 4723cb12e1d89c58621ec34c4eb5221c1b51d018 | [
"MIT"
] | 2 | 2021-01-06T15:18:01.000Z | 2021-01-07T04:20:37.000Z | import os
from load_data import Data
import numpy as np
import torch
import time
from collections import defaultdict
from model_cross_attention_modified import *
from torch.optim.lr_scheduler import ExponentialLR
import argparse
import logging
import math
logging.basicConfig(format='%(asctime)s - %(levelname)s - %(nam... | 45.155642 | 117 | 0.578113 |
7fa22151185c7447c108c593c0b72bd5fdad1c45 | 5,194 | py | Python | tests/test_face_areas_normals.py | janEbert/pytorch3d | accdac80fb29e82f72d4e8e73135ba8fd790b6c0 | [
"MIT",
"BSD-3-Clause"
] | 1 | 2022-01-24T20:51:16.000Z | 2022-01-24T20:51:16.000Z | tests/test_face_areas_normals.py | janEbert/pytorch3d | accdac80fb29e82f72d4e8e73135ba8fd790b6c0 | [
"MIT",
"BSD-3-Clause"
] | null | null | null | tests/test_face_areas_normals.py | janEbert/pytorch3d | accdac80fb29e82f72d4e8e73135ba8fd790b6c0 | [
"MIT",
"BSD-3-Clause"
] | 1 | 2022-03-29T04:29:06.000Z | 2022-03-29T04:29:06.000Z | # Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import unittest
import torch
from common_testing import TestCaseMixin, get_random_cuda_device
from pytorch3d.... | 36.069444 | 86 | 0.651136 |
4cb61360a5b75518595430b3c7519ff390f0be01 | 2,628 | py | Python | fase.py | joaovicentefs/pythonbirds | aed41a4d8eecd6dccbb1aede74eae1cd62bbba94 | [
"MIT"
] | null | null | null | fase.py | joaovicentefs/pythonbirds | aed41a4d8eecd6dccbb1aede74eae1cd62bbba94 | [
"MIT"
] | null | null | null | fase.py | joaovicentefs/pythonbirds | aed41a4d8eecd6dccbb1aede74eae1cd62bbba94 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from itertools import chain
from atores import ATIVO
VITORIA = 'VITORIA'
DERROTA = 'DERROTA'
EM_ANDAMENTO = 'EM_ANDAMENTO'
class Ponto():
def __init__(self, x, y, caracter):
self.caracter = caracter
self.x = round(x)
self.y = round(y)
def __eq__(self, other):... | 24.560748 | 100 | 0.606164 |
3eae84d575bedf9a7ce3cda9378e31d167cd0f05 | 1,160 | py | Python | passl/hooks/byolClip_hook.py | WangFeng18/PASSL | d03c0928434a26d4eefe2c24b229168d620f864c | [
"Apache-2.0"
] | 1 | 2021-04-02T09:59:20.000Z | 2021-04-02T09:59:20.000Z | passl/hooks/byolClip_hook.py | WangFeng18/PASSL | d03c0928434a26d4eefe2c24b229168d620f864c | [
"Apache-2.0"
] | null | null | null | passl/hooks/byolClip_hook.py | WangFeng18/PASSL | d03c0928434a26d4eefe2c24b229168d620f864c | [
"Apache-2.0"
] | null | null | null | # Copyright (c) 2021 PaddlePaddle Authors. All Rights Reserve.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applic... | 36.25 | 74 | 0.675862 |
3333bc1cf17aafa82f16a178b098b89cc5119452 | 3,511 | py | Python | env/lib/python3.7/site-packages/docusign_rooms/models/e_sign_permission_profile_list.py | davidgacc/docusign | e63167101656d0066d481844576ce687ea80eb91 | [
"MIT"
] | null | null | null | env/lib/python3.7/site-packages/docusign_rooms/models/e_sign_permission_profile_list.py | davidgacc/docusign | e63167101656d0066d481844576ce687ea80eb91 | [
"MIT"
] | null | null | null | env/lib/python3.7/site-packages/docusign_rooms/models/e_sign_permission_profile_list.py | davidgacc/docusign | e63167101656d0066d481844576ce687ea80eb91 | [
"MIT"
] | null | null | null | # coding: utf-8
"""
DocuSign Rooms API - v2
An API for an integrator to access the features of DocuSign Rooms # noqa: E501
OpenAPI spec version: v2
Contact: devcenter@docusign.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import pprint
import re # noqa: F401
import... | 30.267241 | 109 | 0.606665 |
6af33f209b68c2133eb30f8c95f288f6cb392146 | 2,541 | py | Python | RasPi_Dev/ros_ws/devel/lib/python2.7/dist-packages/rtabmap_ros/cfg/CameraConfig.py | QianheYu/xtark_driver_dev | 1708888161cf20c0d1f45c99d0da4467d69c26c8 | [
"BSD-3-Clause"
] | 1 | 2022-03-11T03:31:15.000Z | 2022-03-11T03:31:15.000Z | RasPi_Dev/ros_ws/devel/lib/python2.7/dist-packages/rtabmap_ros/cfg/CameraConfig.py | bravetree/xtark_driver_dev | 1708888161cf20c0d1f45c99d0da4467d69c26c8 | [
"BSD-3-Clause"
] | null | null | null | RasPi_Dev/ros_ws/devel/lib/python2.7/dist-packages/rtabmap_ros/cfg/CameraConfig.py | bravetree/xtark_driver_dev | 1708888161cf20c0d1f45c99d0da4467d69c26c8 | [
"BSD-3-Clause"
] | null | null | null | ## *********************************************************
##
## File autogenerated for the rtabmap_ros package
## by the dynamic_reconfigure package.
## Please do not edit.
##
## ********************************************************/
from dynamic_reconfigure.encoding import extract_params
inf = float('inf')
co... | 68.675676 | 1,666 | 0.63046 |
70e9ba91eeffc5e2f2f01af06eb66aa8d489d51f | 368 | py | Python | irs/search/schema.py | nitish6174/TFIDF_vs_BM25 | bf7962d37ffc3ff8e236393ad57f3f9cf2ead655 | [
"MIT"
] | 1 | 2020-08-13T03:04:14.000Z | 2020-08-13T03:04:14.000Z | irs/search/schema.py | nitish6174/TFIDF_vs_BM25 | bf7962d37ffc3ff8e236393ad57f3f9cf2ead655 | [
"MIT"
] | null | null | null | irs/search/schema.py | nitish6174/TFIDF_vs_BM25 | bf7962d37ffc3ff8e236393ad57f3f9cf2ead655 | [
"MIT"
] | null | null | null | from whoosh.fields import SchemaClass, TEXT, ID, DATETIME
from whoosh.analysis import StemmingAnalyzer
class RedditSchema(SchemaClass):
url = ID(stored=True)
title = TEXT(analyzer=StemmingAnalyzer(), stored=True, field_boost=5.0)
body = TEXT(analyzer=StemmingAnalyzer(), stored=True)
created = DATETIME... | 33.454545 | 75 | 0.75 |
9437ce36788c025a98483c092b2eb6681ce9882c | 10,664 | py | Python | data_loader.py | Shreypandey/crispy-enigma | 59d49e659c44063fea52fa8ea30fb9bb4d8f6f5e | [
"Apache-2.0"
] | null | null | null | data_loader.py | Shreypandey/crispy-enigma | 59d49e659c44063fea52fa8ea30fb9bb4d8f6f5e | [
"Apache-2.0"
] | null | null | null | data_loader.py | Shreypandey/crispy-enigma | 59d49e659c44063fea52fa8ea30fb9bb4d8f6f5e | [
"Apache-2.0"
] | null | null | null | import os
import copy
import json
import logging
import torch
from torch.utils.data import TensorDataset
from utils import get_intent_labels, get_slot_labels
logger = logging.getLogger(__name__)
class InputExample(object):
"""
A single training/test example for simple sequence classification.
Args:
... | 41.494163 | 135 | 0.632689 |
a76da428275ea926d6b150c208314c68e95e618b | 2,011 | py | Python | experiments/karla/diplomski-rad/blade/pb/datasets/n20-indel-classes/finished-experiments/model-n20-mix-pb-indel-classes-9.py | lvrcek/consensus-net | 560957f315751822e1ddf8c097eb7b712ceadff3 | [
"MIT"
] | null | null | null | experiments/karla/diplomski-rad/blade/pb/datasets/n20-indel-classes/finished-experiments/model-n20-mix-pb-indel-classes-9.py | lvrcek/consensus-net | 560957f315751822e1ddf8c097eb7b712ceadff3 | [
"MIT"
] | null | null | null | experiments/karla/diplomski-rad/blade/pb/datasets/n20-indel-classes/finished-experiments/model-n20-mix-pb-indel-classes-9.py | lvrcek/consensus-net | 560957f315751822e1ddf8c097eb7b712ceadff3 | [
"MIT"
] | 1 | 2018-12-23T13:50:29.000Z | 2018-12-23T13:50:29.000Z | from comet_ml import Experiment
experiment = Experiment(api_key="oda8KKpxlDgWmJG5KsYrrhmIV", project_name="consensusnet")
import numpy as np
from keras.models import Model
from keras.layers import Dense, Dropout, Activation, Flatten, BatchNormalization, Input
from keras.layers import Conv1D, MaxPooling1D, Conv2D, Max... | 31.920635 | 132 | 0.708105 |
7d6632f06cb204e8e8d04481fe6c36268354a60e | 9,764 | py | Python | script/model/mini_trainer.py | eppingere/terrier | ffe1b96cfa364ad7053f1224655472b2eb69f910 | [
"MIT"
] | 2 | 2020-06-03T19:46:43.000Z | 2020-07-11T00:46:08.000Z | script/model/mini_trainer.py | thepinetree/terrier | eeb6a17e4927b9d8ccafbc3ee23f1ff6e4365069 | [
"MIT"
] | 11 | 2020-06-28T03:43:06.000Z | 2020-10-28T02:33:57.000Z | script/model/mini_trainer.py | thepinetree/terrier | eeb6a17e4927b9d8ccafbc3ee23f1ff6e4365069 | [
"MIT"
] | 1 | 2020-06-03T03:21:51.000Z | 2020-06-03T03:21:51.000Z | #!/usr/bin/env python3
import glob
import os
import numpy as np
import argparse
import pickle
import logging
from sklearn import model_selection
import model
from util import io_util, logging_util
from data_class import opunit_data
from info import data_info
from training_util import data_transforming_util, result_w... | 48.577114 | 131 | 0.620442 |
f86a3dd3476977dc1a1b1649aed647baf6c46ab2 | 3,772 | py | Python | translator/kor_to_braille.py | firekim2/korean_to_braille | 3d516488486e04de835f3c5c92612ed4f10c64ae | [
"MIT"
] | 2 | 2019-08-07T12:22:06.000Z | 2021-07-20T15:17:44.000Z | translator/kor_to_braille.py | firekim2/korean_to_braille | 3d516488486e04de835f3c5c92612ed4f10c64ae | [
"MIT"
] | null | null | null | translator/kor_to_braille.py | firekim2/korean_to_braille | 3d516488486e04de835f3c5c92612ed4f10c64ae | [
"MIT"
] | 1 | 2021-04-27T04:28:33.000Z | 2021-04-27T04:28:33.000Z | from . import map_kor_to_braille
import re
UNRECOGNIZED = '?'
open_quotes = True
BASE_CODE, CHOSUNG, JUNGSUNG = 44032, 588, 28
# 초성 리스트. 00 ~ 18
CHOSUNG_LIST = ['ㄱ', 'ㄲ', 'ㄴ', 'ㄷ', 'ㄸ', 'ㄹ', 'ㅁ',
'ㅂ', 'ㅃ', 'ㅅ', 'ㅆ', 'ㅇ', 'ㅈ', 'ㅉ',
'ㅊ', 'ㅋ', 'ㅌ', 'ㅍ', 'ㅎ']
# 중성 리스트. 00 ~ 20
JUNGSUNG... | 35.584906 | 157 | 0.537911 |
003c761f532b196555958a4ed97e09da46eae940 | 2,239 | py | Python | contrib/tasks/wsss/train_val/validate.py | HAL-42/AlchemyCat | ca924755ff48e2ff74543bb0e446376eb2b1f150 | [
"Apache-2.0"
] | 8 | 2020-01-08T19:42:01.000Z | 2021-12-28T08:30:56.000Z | contrib/tasks/wsss/train_val/validate.py | HAL-42/AlchemyCat | ca924755ff48e2ff74543bb0e446376eb2b1f150 | [
"Apache-2.0"
] | 2 | 2020-09-10T12:22:57.000Z | 2022-02-17T05:21:22.000Z | contrib/tasks/wsss/train_val/validate.py | HAL-42/AlchemyCat | ca924755ff48e2ff74543bb0e446376eb2b1f150 | [
"Apache-2.0"
] | 1 | 2021-05-12T01:50:27.000Z | 2021-05-12T01:50:27.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
@Author : Xiaobo Yang
@Contact : hal_42@zju.edu.cn
@Time : 2021/7/23 3:45
@File : validate.py
@Software: PyCharm
@Desc :
"""
from tqdm import tqdm
import numpy as np
import torch
from torch import nn
from torch.utils.tensorboard import SummaryWriter
from al... | 36.112903 | 101 | 0.584636 |
f2f2684410d42ed760d238e77b89c2faff492445 | 298 | py | Python | selenium_stealth/navigator_webdriver.py | anhdhbn/selenium-stealth | c79e8b319faab1dfb81a0a90b80c2f8303b89b4b | [
"MIT"
] | 154 | 2020-11-05T13:24:25.000Z | 2022-03-31T13:30:40.000Z | selenium_stealth/navigator_webdriver.py | anhdhbn/selenium-stealth | c79e8b319faab1dfb81a0a90b80c2f8303b89b4b | [
"MIT"
] | 21 | 2020-11-05T13:25:47.000Z | 2022-02-16T21:33:57.000Z | selenium_stealth/navigator_webdriver.py | anhdhbn/selenium-stealth | c79e8b319faab1dfb81a0a90b80c2f8303b89b4b | [
"MIT"
] | 57 | 2020-11-06T19:06:44.000Z | 2022-03-31T07:17:50.000Z | from pathlib import Path
from .wrapper import evaluateOnNewDocument
from selenium.webdriver import Chrome as Driver
def navigator_webdriver(driver: Driver, **kwargs) -> None:
evaluateOnNewDocument(
driver, Path(__file__).parent.joinpath("js/navigator.webdriver.js").read_text()
)
| 29.8 | 87 | 0.765101 |
ab3ba9e8fa4243b739a999964b4a9c69dbfc0baf | 768 | py | Python | alembic/versions/7e30cf9b2d8b_.py | dudeisbrendan03/here | 9ff28572d49b1be038c1798cc353142e64d3fbef | [
"EFL-2.0"
] | 16 | 2015-11-11T06:35:14.000Z | 2020-12-04T14:36:31.000Z | alembic/versions/7e30cf9b2d8b_.py | dudeisbrendan03/here | 9ff28572d49b1be038c1798cc353142e64d3fbef | [
"EFL-2.0"
] | 142 | 2015-11-16T22:07:20.000Z | 2020-04-26T04:18:01.000Z | alembic/versions/7e30cf9b2d8b_.py | dudeisbrendan03/here | 9ff28572d49b1be038c1798cc353142e64d3fbef | [
"EFL-2.0"
] | 32 | 2015-11-15T09:38:12.000Z | 2020-02-29T19:25:20.000Z | """Use C collation by default for starsystem tables.
Revision ID: 7e30cf9b2d8b
Revises: 46e931c30648
Create Date: 2016-02-15 15:19:49.306682
"""
# revision identifiers, used by Alembic.
revision = '7e30cf9b2d8b'
down_revision = '46e931c30648'
branch_labels = None
depends_on = None
from alembic import op
import sqla... | 25.6 | 85 | 0.736979 |
85d3770c0f6f107aef51c0fab5eaaeb4a589da37 | 9,626 | py | Python | run.py | wellupgeek/qq_auto_sign_in | 58c058419cd1cfbea65f187ce3f75c91c76c9401 | [
"MIT"
] | 1 | 2020-04-25T09:16:58.000Z | 2020-04-25T09:16:58.000Z | run.py | wellupgeek/qq_auto_sign_in | 58c058419cd1cfbea65f187ce3f75c91c76c9401 | [
"MIT"
] | 3 | 2021-06-08T21:10:39.000Z | 2022-03-12T00:20:59.000Z | run.py | wellupgeek/qq_auto_sign_in | 58c058419cd1cfbea65f187ce3f75c91c76c9401 | [
"MIT"
] | null | null | null | import win32con, win32gui
from PIL import ImageGrab
import os, time, re, json
from time import sleep
from aip import AipOcr
import logging
import logging.handlers
import win32clipboard as w
# 截图部分
class QQ_shot_screen(object):
def __init__(self, name, savepath):
self.name = name
self.savepath = sa... | 34.134752 | 126 | 0.569915 |
e7beed384e0bd9d0dff1e12a164d18341be031b8 | 6,653 | py | Python | tests/ut/python/parallel/test_auto_parallel_two_matmul.py | TommyLike/mindspore | 401dabb786a9097d6dd84f391657d266b04e9a37 | [
"Apache-2.0"
] | null | null | null | tests/ut/python/parallel/test_auto_parallel_two_matmul.py | TommyLike/mindspore | 401dabb786a9097d6dd84f391657d266b04e9a37 | [
"Apache-2.0"
] | null | null | null | tests/ut/python/parallel/test_auto_parallel_two_matmul.py | TommyLike/mindspore | 401dabb786a9097d6dd84f391657d266b04e9a37 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | 46.852113 | 106 | 0.711258 |
fb5831d9ba93e06aa241c75309e7d3d162666010 | 3,646 | py | Python | mergify_engine/actions/post_check.py | jsoref/mergify-engine | 90f24bfb33136e180c722f9d33f8704859e655d6 | [
"Apache-2.0"
] | null | null | null | mergify_engine/actions/post_check.py | jsoref/mergify-engine | 90f24bfb33136e180c722f9d33f8704859e655d6 | [
"Apache-2.0"
] | null | null | null | mergify_engine/actions/post_check.py | jsoref/mergify-engine | 90f24bfb33136e180c722f9d33f8704859e655d6 | [
"Apache-2.0"
] | null | null | null | # -*- encoding: utf-8 -*-
#
# Copyright © 2020 Mergify SAS
#
# 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 applicab... | 33.145455 | 117 | 0.619035 |
b0c8dfc754dfacfa3d3e35c1bb1f30b8728bb032 | 26,424 | py | Python | rpython/rlib/clibffi.py | m4sterchain/mesapy | ed546d59a21b36feb93e2309d5c6b75aa0ad95c9 | [
"Apache-2.0",
"OpenSSL"
] | 381 | 2018-08-18T03:37:22.000Z | 2022-02-06T23:57:36.000Z | rpython/rlib/clibffi.py | m4sterchain/mesapy | ed546d59a21b36feb93e2309d5c6b75aa0ad95c9 | [
"Apache-2.0",
"OpenSSL"
] | 16 | 2018-09-22T18:12:47.000Z | 2022-02-22T20:03:59.000Z | rpython/rlib/clibffi.py | m4sterchain/mesapy | ed546d59a21b36feb93e2309d5c6b75aa0ad95c9 | [
"Apache-2.0",
"OpenSSL"
] | 30 | 2018-08-20T03:16:34.000Z | 2022-01-12T17:39:22.000Z | """ Libffi wrapping
"""
from __future__ import with_statement
from rpython.rtyper.tool import rffi_platform
from rpython.rtyper.lltypesystem import lltype, rffi
from rpython.rtyper.tool import rffi_platform
from rpython.rlib.unroll import unrolling_iterable
from rpython.rlib.rarithmetic import intmask, is_emulated_lon... | 37.11236 | 102 | 0.62553 |
f7bb1fbf24203dab5b90d5f24d2bf96684f94102 | 921 | py | Python | examples/tut1.py | opetlund/TMM4135-CALFEM | e15621a6fec3bef7f07cfbc9abb80ad10551d6d0 | [
"MIT"
] | null | null | null | examples/tut1.py | opetlund/TMM4135-CALFEM | e15621a6fec3bef7f07cfbc9abb80ad10551d6d0 | [
"MIT"
] | null | null | null | examples/tut1.py | opetlund/TMM4135-CALFEM | e15621a6fec3bef7f07cfbc9abb80ad10551d6d0 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
Created on Sat Mar 3 22:08:29 2018
@author: Jonas Lindemann
"""
import calfem.geometry as cfg
import calfem.mesh as cfm
import calfem.vis as cfv
# ----- Define geometry
g = cfg.Geometry()
g.point([0.0, 0.0]) # point 0
g.point([5.0, 0.0], marker=20) # point 1
g.point([2.5, 4.0]) # point... | 17.377358 | 57 | 0.639522 |
82bfb2c406587cfbb226e7090f50fa6edbbe8fc6 | 1,838 | py | Python | Incident-Response/Tools/dfirtrack/dfirtrack_main/tests/reason/test_reason_forms.py | sn0b4ll/Incident-Playbook | cf519f58fcd4255674662b3620ea97c1091c1efb | [
"MIT"
] | 1 | 2021-07-24T17:22:50.000Z | 2021-07-24T17:22:50.000Z | Incident-Response/Tools/dfirtrack/dfirtrack_main/tests/reason/test_reason_forms.py | sn0b4ll/Incident-Playbook | cf519f58fcd4255674662b3620ea97c1091c1efb | [
"MIT"
] | 2 | 2022-02-28T03:40:31.000Z | 2022-02-28T03:40:52.000Z | Incident-Response/Tools/dfirtrack/dfirtrack_main/tests/reason/test_reason_forms.py | sn0b4ll/Incident-Playbook | cf519f58fcd4255674662b3620ea97c1091c1efb | [
"MIT"
] | 2 | 2022-02-25T08:34:51.000Z | 2022-03-16T17:29:44.000Z | from django.test import TestCase
from dfirtrack_main.forms import ReasonForm
class ReasonFormTestCase(TestCase):
""" reason form tests """
def test_reason_name_form_label(self):
""" test form label """
# get object
form = ReasonForm()
# compare
self.assertEqual(form.fi... | 28.276923 | 84 | 0.603373 |
28d1a99688a1772d6c9882b99bb9d0d9dc870924 | 6,109 | py | Python | torchbenchmark/models/BERT_pytorch/bert_pytorch/trainer/pretrain.py | Chillee/benchmark | 91e1b2871327e44b9b7d24d173ca93720fb6565b | [
"BSD-3-Clause"
] | 1 | 2021-07-30T08:47:09.000Z | 2021-07-30T08:47:09.000Z | torchbenchmark/models/BERT_pytorch/bert_pytorch/trainer/pretrain.py | Chillee/benchmark | 91e1b2871327e44b9b7d24d173ca93720fb6565b | [
"BSD-3-Clause"
] | null | null | null | torchbenchmark/models/BERT_pytorch/bert_pytorch/trainer/pretrain.py | Chillee/benchmark | 91e1b2871327e44b9b7d24d173ca93720fb6565b | [
"BSD-3-Clause"
] | 2 | 2020-07-27T21:48:20.000Z | 2020-07-30T16:57:02.000Z | import torch
import torch.nn as nn
from torch.optim import Adam
from torch.utils.data import DataLoader
from ..model import BERTLM, BERT
from .optim_schedule import ScheduledOptim
import tqdm
class BERTTrainer:
"""
BERTTrainer make the pretrained BERT model with two LM training method.
1. Masked La... | 39.412903 | 108 | 0.62056 |
6e277314c57e29c1c8241f4c19b1225cf04458e7 | 32,257 | py | Python | bbfreeze/modulegraph/modulegraph.py | mccredie/bbfreeze | c74223318826ebd1a19aed15cba5641055ff0187 | [
"Zlib",
"MIT"
] | 33 | 2015-01-25T18:30:31.000Z | 2021-03-17T08:53:29.000Z | bbfreeze/modulegraph/modulegraph.py | mccredie/bbfreeze | c74223318826ebd1a19aed15cba5641055ff0187 | [
"Zlib",
"MIT"
] | 8 | 2015-10-30T07:07:41.000Z | 2017-06-30T16:55:40.000Z | bbfreeze/modulegraph/modulegraph.py | mccredie/bbfreeze | c74223318826ebd1a19aed15cba5641055ff0187 | [
"Zlib",
"MIT"
] | 17 | 2015-03-11T09:38:29.000Z | 2022-01-06T23:19:48.000Z | """
Find modules used by a script, using bytecode analysis.
Based on the stdlib modulefinder by Thomas Heller and Just van Rossum,
but uses a graph data structure and 2.3 features
"""
from pkg_resources import require
require("altgraph")
import dis
import imp
import marshal
import os
import sys
import new
import str... | 34.759698 | 98 | 0.533435 |
742b5246be64f9761939aefc4d01a265a26d2551 | 437 | py | Python | solowpy/__init__.py | davidrpugh/solowPy | 91577e04481cec80679ae571ec2bdaa5788151b4 | [
"MIT"
] | 31 | 2016-02-29T00:20:53.000Z | 2022-01-26T17:40:38.000Z | solowpy/__init__.py | rfonsek/solowPy | 91577e04481cec80679ae571ec2bdaa5788151b4 | [
"MIT"
] | 11 | 2015-04-04T20:01:35.000Z | 2017-02-20T05:42:49.000Z | solowpy/__init__.py | rfonsek/solowPy | 91577e04481cec80679ae571ec2bdaa5788151b4 | [
"MIT"
] | 20 | 2015-08-23T23:42:09.000Z | 2022-02-23T08:00:53.000Z | """
models directory imports
objects imported here will live in the `solowpy` namespace
"""
__all__ = ['model', 'Model', 'CobbDouglasModel', 'CESModel']
from . model import Model
from . import model
from . cobb_douglas import CobbDouglasModel
from . import cobb_douglas
from . ces import CESModel
from . import ces
#... | 21.85 | 60 | 0.775744 |
e9d8c071af79946867b0b3b63fd607b47bbe25d0 | 730 | py | Python | adapters/rgb_adapter.py | russdan/domoticz-zigbee2mqtt-plugin | d47895eab44bc87fc19ce151698d2afe9554fadc | [
"MIT"
] | 146 | 2018-09-19T11:38:48.000Z | 2022-03-21T11:54:12.000Z | adapters/rgb_adapter.py | russdan/domoticz-zigbee2mqtt-plugin | d47895eab44bc87fc19ce151698d2afe9554fadc | [
"MIT"
] | 783 | 2018-09-28T17:07:14.000Z | 2022-03-31T10:18:27.000Z | adapters/rgb_adapter.py | russdan/domoticz-zigbee2mqtt-plugin | d47895eab44bc87fc19ce151698d2afe9554fadc | [
"MIT"
] | 147 | 2018-09-25T18:39:51.000Z | 2022-03-01T19:31:27.000Z | from adapters.base_adapter import Adapter
from adapters.generic.mixins.rgb import RGBMixin
from devices.rgb_light import RGBLight
class RGBAdapter(Adapter, RGBMixin):
def __init__(self):
super().__init__()
self.dimmer = RGBLight('light', 'state_brightness_color')
self.devices.append(self.d... | 33.181818 | 82 | 0.682192 |
ba85d0a93156c015345cddd54aff119481f6b0b8 | 6,157 | py | Python | powerspectrum_interface/pyhmx/hmx.py | tilmantroester/pyhmcode | 0c10c81b86de308f2c6af108b7d5691751889da2 | [
"MIT"
] | 2 | 2021-09-16T07:18:43.000Z | 2022-02-24T13:31:14.000Z | powerspectrum_interface/pyhmx/hmx.py | tilmantroester/pyhmcode | 0c10c81b86de308f2c6af108b7d5691751889da2 | [
"MIT"
] | 1 | 2021-07-28T11:53:09.000Z | 2021-07-28T12:47:25.000Z | powerspectrum_interface/pyhmx/hmx.py | tilmantroester/pyhmcode | 0c10c81b86de308f2c6af108b7d5691751889da2 | [
"MIT"
] | null | null | null | import os
import ctypes as ct
import numpy as np
def _array_ctype(ndim, dtype=np.float64, flags="F"):
return [ct.POINTER(ct.c_int)]*ndim + [np.ctypeslib.ndpointer(ndim=ndim, dtype=dtype, flags=flags)]
def _array_arg(a):
arr = a
return (*(ct.c_int(s) for s in arr.shape), arr)
def _load_lib(libname, path=N... | 44.941606 | 124 | 0.529641 |
31d746d6db97ef618ceb59557ec4d5b91ac99494 | 2,009 | py | Python | conflowgen/api/truck_arrival_distribution_manager.py | 1kastner/conflowgen | 02f242517f1377ce45685099bf3196578321751a | [
"MIT"
] | 5 | 2022-02-16T11:44:42.000Z | 2022-02-24T20:02:17.000Z | conflowgen/api/truck_arrival_distribution_manager.py | 1kastner/conflowgen | 02f242517f1377ce45685099bf3196578321751a | [
"MIT"
] | 90 | 2021-12-08T14:05:44.000Z | 2022-03-24T08:53:31.000Z | conflowgen/api/truck_arrival_distribution_manager.py | 1kastner/conflowgen | 02f242517f1377ce45685099bf3196578321751a | [
"MIT"
] | 5 | 2021-12-07T16:05:15.000Z | 2022-02-16T08:24:07.000Z | from typing import Dict
from conflowgen.api import AbstractDistributionManager
from conflowgen.domain_models.distribution_repositories.truck_arrival_distribution_repository import \
TruckArrivalDistributionRepository
class TruckArrivalDistributionManager(AbstractDistributionManager):
"""
This manager pro... | 44.644444 | 120 | 0.726232 |
7a8881b50edf122022ff77e68ce51de385727175 | 873 | py | Python | tests/test_fixtures.py | hdsr-mid/path_finder | 4d74b07501d3676e6aabfccd7045ace48aa4a4cf | [
"MIT"
] | null | null | null | tests/test_fixtures.py | hdsr-mid/path_finder | 4d74b07501d3676e6aabfccd7045ace48aa4a4cf | [
"MIT"
] | null | null | null | tests/test_fixtures.py | hdsr-mid/path_finder | 4d74b07501d3676e6aabfccd7045ace48aa4a4cf | [
"MIT"
] | null | null | null | from tests.fixtures import temp_tree_structure1
# silence flake8
temp_tree_structure1 = temp_tree_structure1
def test_temp_tree_structure(temp_tree_structure1):
"""Ensure a certain dir+file structure for tests that use temp_tree_structure."""
glob_pattern = "*.txt"
assert len(list(temp_tree_structure1.g... | 43.65 | 96 | 0.720504 |
86648a324a1001ebcc9d595dff3f38cfd0abee17 | 12,182 | py | Python | BatchProcesses/merge_xrfs_into_ana_v7_2frame_from_J_ana.py | johnmgregoire/JCAPDataProcess | c8120e5b2f8fc840a6307b40293dccaf94bd8c2c | [
"BSD-3-Clause"
] | 5 | 2017-03-24T21:05:22.000Z | 2021-09-15T18:18:05.000Z | BatchProcesses/merge_xrfs_into_ana_v7_2frame_from_J_ana.py | johnmgregoire/JCAPDataProcess | c8120e5b2f8fc840a6307b40293dccaf94bd8c2c | [
"BSD-3-Clause"
] | null | null | null | BatchProcesses/merge_xrfs_into_ana_v7_2frame_from_J_ana.py | johnmgregoire/JCAPDataProcess | c8120e5b2f8fc840a6307b40293dccaf94bd8c2c | [
"BSD-3-Clause"
] | null | null | null | import numpy, copy, operator
if __name__ == "__main__":
import os, sys
#Needed for running line-by-line
#__file__=r'D:\Google Drive\Documents\PythonCode\JCAP\JCAPDataProcess\BatchProcesses\merge_xrfs_into_ana_v7_2frame_from_J_ana.py'
sys.path.append(os.path.split(os.path.split(os.path.realpath(__file__)... | 53.902655 | 337 | 0.723362 |
a9aa01050da5966f0658348a92dce3f2d4c33761 | 3,953 | py | Python | awwards/tests.py | marykamau2/awwards | 0cb85991b31f8b3d2b4baf5eb985d8ee633ee4ff | [
"MIT"
] | null | null | null | awwards/tests.py | marykamau2/awwards | 0cb85991b31f8b3d2b4baf5eb985d8ee633ee4ff | [
"MIT"
] | null | null | null | awwards/tests.py | marykamau2/awwards | 0cb85991b31f8b3d2b4baf5eb985d8ee633ee4ff | [
"MIT"
] | null | null | null |
# from django.test import TestCase
# from .models import Project,Rating
# from django.contrib.auth.models import User
# # Create your tests here.
# class ProjectTestClass(TestCase):
# # Set up method
# def setUp(self):
# # Creating a new location and saving it
# self.new_user=User(username='ma... | 37.292453 | 174 | 0.659246 |
33e6935e71b35816a75d00d4c350408d6be482fb | 3,302 | py | Python | NextcordUtils/InviteTracker.py | amirdadfar9192/NextcordUtils | 83b2eb5d330d06383cd0f51688cdf95cdbbf09eb | [
"MIT"
] | null | null | null | NextcordUtils/InviteTracker.py | amirdadfar9192/NextcordUtils | 83b2eb5d330d06383cd0f51688cdf95cdbbf09eb | [
"MIT"
] | null | null | null | NextcordUtils/InviteTracker.py | amirdadfar9192/NextcordUtils | 83b2eb5d330d06383cd0f51688cdf95cdbbf09eb | [
"MIT"
] | null | null | null | from nextcord.errors import Forbidden
from nextcord import AuditLogAction
from datetime import datetime
from asyncio import sleep
class InviteTracker():
def __init__(self, bot):
self.bot = bot
self._cache = {}
self.add_listeners()
def add_listeners(self):
self.bot.add_liste... | 44.621622 | 198 | 0.606299 |
117cf5e4b476dea158c55faad3fece6cb28bbe6a | 14,628 | py | Python | test/jpypetest/test_jfloat.py | baztian/jpype | 034d44e6c719995c25e9cd61348ebc1860030a9b | [
"Apache-2.0"
] | null | null | null | test/jpypetest/test_jfloat.py | baztian/jpype | 034d44e6c719995c25e9cd61348ebc1860030a9b | [
"Apache-2.0"
] | null | null | null | test/jpypetest/test_jfloat.py | baztian/jpype | 034d44e6c719995c25e9cd61348ebc1860030a9b | [
"Apache-2.0"
] | null | null | null | import sys
import jpype
import common
import random
import _jpype
import jpype
from jpype import java
from jpype.types import *
try:
import numpy as np
except ImportError:
pass
class JFloatTestCase(common.JPypeTestCase):
def setUp(self):
common.JPypeTestCase.setUp(self)
self.value = 1.0 + ... | 34.257611 | 80 | 0.615463 |
e618a19851dc52e6fff2cab183752ffa80ce4f67 | 3,548 | py | Python | tests/test_formatter.py | leplatrem/logging-color-formatter | 189b21a7bbff3b54091c3d0994553082de2b5460 | [
"Apache-2.0"
] | 1 | 2017-06-30T03:30:27.000Z | 2017-06-30T03:30:27.000Z | tests/test_formatter.py | leplatrem/logging-color-formatter | 189b21a7bbff3b54091c3d0994553082de2b5460 | [
"Apache-2.0"
] | null | null | null | tests/test_formatter.py | leplatrem/logging-color-formatter | 189b21a7bbff3b54091c3d0994553082de2b5460 | [
"Apache-2.0"
] | null | null | null | import logging
import re
import unittest
from io import StringIO
import mock
from logging_color_formatter import ColorFormatter
def strip_ansi(text):
"""
Strip ANSI sequences (colors) from text.
Source: http://stackoverflow.com/a/15780675
"""
SEQUENCES = r'\x1b\[([0-9,A-Z]{1,2}(;[0-9]{1,2})?(;[0... | 33.158879 | 84 | 0.620913 |
9b098905ce3eef9497157a2a185b25e88182db94 | 1,627 | py | Python | 2020/day10.py | Bug38/AoC | 576ee0d3745242b71240a62c121c52bc92f7253e | [
"MIT"
] | null | null | null | 2020/day10.py | Bug38/AoC | 576ee0d3745242b71240a62c121c52bc92f7253e | [
"MIT"
] | null | null | null | 2020/day10.py | Bug38/AoC | 576ee0d3745242b71240a62c121c52bc92f7253e | [
"MIT"
] | null | null | null | import utils
adapters = utils.getIntsFromFile("day10.input")
# adapters = [16,10,15,5,1,11,7,19,6,12,4]
# adapters = [28,33,18,42,31,14,46,20,48,47,24,23,49,45,19,38,39,11,1,32,25,35,8,17,7,9,4,2,34,10,3]
outletJoltage = 0
deviceJoltage = max(adapters) + 3
adapters.append(outletJoltage)
adapters.append(deviceJoltage)... | 15.064815 | 100 | 0.577136 |
1c7c3a354f1605af714fc55a36934c2d23960fba | 6,840 | py | Python | networkapi/api_deploy/facade.py | vinicius-marinho/GloboNetworkAPI | 94651d3b4dd180769bc40ec966814f3427ccfb5b | [
"Apache-2.0"
] | 73 | 2015-04-13T17:56:11.000Z | 2022-03-24T06:13:07.000Z | networkapi/api_deploy/facade.py | leopoldomauricio/GloboNetworkAPI | 3b5b2e336d9eb53b2c113977bfe466b23a50aa29 | [
"Apache-2.0"
] | 99 | 2015-04-03T01:04:46.000Z | 2021-10-03T23:24:48.000Z | networkapi/api_deploy/facade.py | leopoldomauricio/GloboNetworkAPI | 3b5b2e336d9eb53b2c113977bfe466b23a50aa29 | [
"Apache-2.0"
] | 64 | 2015-08-05T21:26:29.000Z | 2022-03-22T01:06:28.000Z | # -*- coding: utf-8 -*-
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "Lic... | 35.076923 | 104 | 0.715789 |
ddbac8c5780a4d0e4b8b6f3a7b0ed2cc864ca52e | 182 | py | Python | main.py | TheSynt4x/discord-bot | ddc7c6fb4f96ca7ba7fe4759d254234a84ae414d | [
"MIT"
] | null | null | null | main.py | TheSynt4x/discord-bot | ddc7c6fb4f96ca7ba7fe4759d254234a84ae414d | [
"MIT"
] | null | null | null | main.py | TheSynt4x/discord-bot | ddc7c6fb4f96ca7ba7fe4759d254234a84ae414d | [
"MIT"
] | null | null | null | from bot.core._config import settings
from bot.events import bot
for cog in settings.COGS:
bot.load_extension('bot.cogs.%s' % cog.get('name'))
bot.run(settings.TOKEN, bot=False)
| 22.75 | 53 | 0.747253 |
0b5b828b19b32d86e006ce35e0ade28db128adc0 | 1,304 | py | Python | praw_memories/cache/__init__.py | elnuno/praw_memories | dcab9cf795d8d9c34684fb1087c7907c56630cc2 | [
"Apache-2.0"
] | 1 | 2017-04-08T03:16:48.000Z | 2017-04-08T03:16:48.000Z | praw_memories/cache/__init__.py | elnuno/praw_memories | dcab9cf795d8d9c34684fb1087c7907c56630cc2 | [
"Apache-2.0"
] | null | null | null | praw_memories/cache/__init__.py | elnuno/praw_memories | dcab9cf795d8d9c34684fb1087c7907c56630cc2 | [
"Apache-2.0"
] | null | null | null | import praw
from packaging.version import Version
class LegacyCachingReddit(praw.Reddit):
def __init__(self, site_name=None, caching_session=None,
requestor_class=None, requestor_kwargs=None,
**config_settings):
super().__init__(site_name=site_name, **config_settings)
... | 37.257143 | 79 | 0.661043 |
03231229e7aa006ae857eab6f1a6caa1e2487b7d | 5,842 | py | Python | code/gpt_decoder.py | felixwzh/DialoGPT | 11db966dc85e1de5a623690b0e430ca3c95fef49 | [
"MIT"
] | null | null | null | code/gpt_decoder.py | felixwzh/DialoGPT | 11db966dc85e1de5a623690b0e430ca3c95fef49 | [
"MIT"
] | null | null | null | code/gpt_decoder.py | felixwzh/DialoGPT | 11db966dc85e1de5a623690b0e430ca3c95fef49 | [
"MIT"
] | null | null | null | import os
import torch
import torch.nn.functional as F
from transformers import GPT2Tokenizer, GPT2LMHeadModel, GPT2Config
import argparse
from tqdm.auto import tqdm
from pathlib import Path
def reinput(text):
# global conditioned_tokens
# os.system('cls' if os.name == 'nt' else 'clear')
conditioned_tokens = tokeni... | 36.061728 | 136 | 0.75368 |
c180eb60d8f6c85256a71fc9c9d9c00c672e2b23 | 6,768 | py | Python | dein/.cache/init.vim/temp/19020/20170514021125/rplugin/python3/denite/prompt/key.py | riggtravis/nvim-config | b8d37c5c6471fd86e8e24aa564ac9852cae0ea36 | [
"MIT"
] | null | null | null | dein/.cache/init.vim/temp/19020/20170514021125/rplugin/python3/denite/prompt/key.py | riggtravis/nvim-config | b8d37c5c6471fd86e8e24aa564ac9852cae0ea36 | [
"MIT"
] | null | null | null | dein/.cache/init.vim/temp/19020/20170514021125/rplugin/python3/denite/prompt/key.py | riggtravis/nvim-config | b8d37c5c6471fd86e8e24aa564ac9852cae0ea36 | [
"MIT"
] | null | null | null | """Key module."""
from collections import namedtuple
from .util import ensure_bytes, ensure_str, int2char
ESCAPE_QUOTE = str.maketrans({
'"': '\\"',
})
CTRL_KEY = b'\x80\xfc\x04'
META_KEY = b'\x80\xfc\x08'
CTRL_SHIFT_KEY = b'\x80\xfc\x06'
# :help key-notation
SPECIAL_KEYS = {
'C-@': b'\x80\xffX', # Vim i... | 28.677966 | 79 | 0.54669 |
be56e048c1ddc46a412eed19505b3a6eb6274938 | 3,957 | py | Python | object_track/object_tracker.py | returnfly/home_security_camera | 55f4ee7e6b715bd7547f5eda07ea942e90b5d593 | [
"MIT"
] | null | null | null | object_track/object_tracker.py | returnfly/home_security_camera | 55f4ee7e6b715bd7547f5eda07ea942e90b5d593 | [
"MIT"
] | null | null | null | object_track/object_tracker.py | returnfly/home_security_camera | 55f4ee7e6b715bd7547f5eda07ea942e90b5d593 | [
"MIT"
] | null | null | null | # USAGE
# python object_tracker.py --prototxt deploy.prototxt --model res10_300x300_ssd_iter_140000.caffemodel
# import the necessary packages
from pyimagesearch.centroidtracker import CentroidTracker
from imutils.video import VideoStream
import numpy as np
import argparse
import imutils
import time
import cv2
from py... | 32.975 | 102 | 0.691433 |
b023405a31ea7fcdc54ee1b962a145abe1813de5 | 99 | py | Python | wemeet/globaltables/apps.py | Ketan-Suthar/wemeet | 964d933de0e40dbf11256c612889d1aa54fe8377 | [
"MIT"
] | 2 | 2021-05-08T08:35:20.000Z | 2021-05-09T05:14:53.000Z | wemeet/globaltables/apps.py | Ketan-Suthar/wemeet | 964d933de0e40dbf11256c612889d1aa54fe8377 | [
"MIT"
] | null | null | null | wemeet/globaltables/apps.py | Ketan-Suthar/wemeet | 964d933de0e40dbf11256c612889d1aa54fe8377 | [
"MIT"
] | null | null | null | from django.apps import AppConfig
class GlobaltablesConfig(AppConfig):
name = 'globaltables'
| 16.5 | 36 | 0.777778 |
bbfd51c293e2484af01279ab86d376d9469b0117 | 719 | py | Python | regressor/regressor.py | gmaher/GenericML | 510140e298b9cd8a2e0499b0e460ef0b4f3489cd | [
"MIT"
] | null | null | null | regressor/regressor.py | gmaher/GenericML | 510140e298b9cd8a2e0499b0e460ef0b4f3489cd | [
"MIT"
] | null | null | null | regressor/regressor.py | gmaher/GenericML | 510140e298b9cd8a2e0499b0e460ef0b4f3489cd | [
"MIT"
] | null | null | null | class Regressor(object):
def __init__(self):
pass
def predict(X):
pass
def fit(X,Y):
pass
class TFRegressor(Regressor):
def __init__(self,x_plh,y_plh,output_op,train_op,session,copy_op=None):
self.x = x_plh
self.y = y_plh
self.output_op = output_op
... | 27.653846 | 75 | 0.603616 |
9055606cea7abecc6bddcddc2a44dfbbdacdcb7e | 1,398 | py | Python | aula15/exercicio3.py | ArseniumGX/bluemer-modulo1-python | 2f7c69252a9a86cc573c192d1d9685b0c20466f8 | [
"MIT"
] | null | null | null | aula15/exercicio3.py | ArseniumGX/bluemer-modulo1-python | 2f7c69252a9a86cc573c192d1d9685b0c20466f8 | [
"MIT"
] | null | null | null | aula15/exercicio3.py | ArseniumGX/bluemer-modulo1-python | 2f7c69252a9a86cc573c192d1d9685b0c20466f8 | [
"MIT"
] | null | null | null | # 03 - Data com mês por extenso. Construa uma função que receba uma data no
# formato DD/MM/AAAA e devolva uma string no formato D de mesPorExtenso de
# AAAA. Opcionalmente, valide a data e retorne NULL caso a data seja inválida.
# Considere que Fevereiro tem 28 dias e que a cada 4 anos temos ano bisexto, sendo
# que n... | 42.363636 | 102 | 0.595851 |
f837ad26c052e75691611f1480f7aaf8956124c6 | 1,512 | py | Python | multi_class_news_classification/train.py | prakharchoudhary/MLworld | eb7e15e67772dfa3f12b59164af0603a3f36bc7c | [
"MIT"
] | 7 | 2017-06-17T09:23:24.000Z | 2019-10-02T08:56:25.000Z | multi_class_news_classification/train.py | prakharchoudhary/MLworld | eb7e15e67772dfa3f12b59164af0603a3f36bc7c | [
"MIT"
] | null | null | null | multi_class_news_classification/train.py | prakharchoudhary/MLworld | eb7e15e67772dfa3f12b59164af0603a3f36bc7c | [
"MIT"
] | 1 | 2020-02-04T08:25:40.000Z | 2020-02-04T08:25:40.000Z | import numpy as np
from keras.datasets import reuters
import nnet
import pickle
# load the dataset and prepare train and test data
(train_data, train_labels), (test_data, test_labels) = \
reuters.load_data(num_words=10000)
# decoding newswires back to text
word_index = reuters.get_word_index()
reverse_word_index ... | 28 | 66 | 0.734788 |
89d5035ceb00096ea1a598f0c11d7a591247b712 | 11,373 | py | Python | moto/ec2/responses/vpc_peering_connections.py | oakbramble/moto | 6350d8ec4c59eaf12b83385b6acd386e5c2f5593 | [
"Apache-2.0"
] | null | null | null | moto/ec2/responses/vpc_peering_connections.py | oakbramble/moto | 6350d8ec4c59eaf12b83385b6acd386e5c2f5593 | [
"Apache-2.0"
] | 1 | 2021-09-13T04:39:03.000Z | 2021-09-13T04:39:03.000Z | moto/ec2/responses/vpc_peering_connections.py | oakbramble/moto | 6350d8ec4c59eaf12b83385b6acd386e5c2f5593 | [
"Apache-2.0"
] | null | null | null | from __future__ import unicode_literals
from moto.core.responses import BaseResponse
from moto.core import ACCOUNT_ID
class VPCPeeringConnections(BaseResponse):
def create_vpc_peering_connection(self):
peer_region = self._get_param("PeerRegion")
tags = self._get_multi_param("TagSpecification")
... | 46.044534 | 176 | 0.736921 |
14c1673a04e2e60c13ba993fc3cd1eb14cd83bca | 2,900 | py | Python | app.py | Xeslley/Primeira_API_REST | 892d5aee6217dcabc28c4aded39cf3c3366c4b08 | [
"MIT"
] | null | null | null | app.py | Xeslley/Primeira_API_REST | 892d5aee6217dcabc28c4aded39cf3c3366c4b08 | [
"MIT"
] | null | null | null | app.py | Xeslley/Primeira_API_REST | 892d5aee6217dcabc28c4aded39cf3c3366c4b08 | [
"MIT"
] | null | null | null | #imports das libs padrao do python
import json
#imports de terceiros
from flask import Flask, request, jsonify
from loguru import logger
#imports do proprio prj
from statsapi import data_store, operation
app = Flask(__name__)
#save received list
@app.route("/data",methods=["POST"])
def save_data():
logger.info... | 30.526316 | 104 | 0.661034 |
ee2ebe73ee0dbe2c41f134b9a869b124610a97a1 | 5,057 | py | Python | sdk/python/pulumi_kubernetes/core/v1/PodTemplate.py | MatheusMiranda/pulumi-kubernetes | eecebd55fe96f63365194182a69d99eda625bb96 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_kubernetes/core/v1/PodTemplate.py | MatheusMiranda/pulumi-kubernetes | eecebd55fe96f63365194182a69d99eda625bb96 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_kubernetes/core/v1/PodTemplate.py | MatheusMiranda/pulumi-kubernetes | eecebd55fe96f63365194182a69d99eda625bb96 | [
"Apache-2.0"
] | null | null | null | # *** WARNING: this file was generated by the Pulumi Kubernetes codegen tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
from typing import Optional
import pulumi
import pulumi.runtime
from pulumi import Input, ResourceOptions
from ... import tables, version
... | 42.141667 | 114 | 0.684398 |
8d746b601bf247450d56c13014b506f85d3900a2 | 1,254 | py | Python | servers/python/v2/server.py | laser/polyglot-distributed-systems | 6532c52979f67c76f17e0d9ec384e0c34634478a | [
"MIT"
] | 3 | 2016-01-04T03:01:19.000Z | 2020-03-30T16:23:43.000Z | servers/python/v2/server.py | laser/polyglot-distributed-systems | 6532c52979f67c76f17e0d9ec384e0c34634478a | [
"MIT"
] | null | null | null | servers/python/v2/server.py | laser/polyglot-distributed-systems | 6532c52979f67c76f17e0d9ec384e0c34634478a | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import barrister
from bottle import run, post, request
from store import Store, RecordNotFound, UserDataInvalid, MaxTodosExceeded
from functools import wraps
import sys
import code
class TodoManager:
def __init__(self, store):
self.store = store
def readTodos(self):
return self.sto... | 24.588235 | 74 | 0.750399 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.