hexsha stringlengths 40 40 | size int64 2 1.02M | ext stringclasses 10
values | lang stringclasses 1
value | max_stars_repo_path stringlengths 4 245 | max_stars_repo_name stringlengths 6 130 | 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 245 | max_issues_repo_name stringlengths 6 130 | 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 245 | max_forks_repo_name stringlengths 6 130 | 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 2 1.02M | avg_line_length float64 1 417k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 1
class | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f713a22268d35fec0c248fbb31768628bbadd87f | 412 | py | Python | csv_to_table/migrations/0004_auto_20200119_1410.py | KariSpace/CRM_Sedicomm | cb19e90ca99c7a50a1841afbfb878191f62dec5c | [
"MIT"
] | null | null | null | csv_to_table/migrations/0004_auto_20200119_1410.py | KariSpace/CRM_Sedicomm | cb19e90ca99c7a50a1841afbfb878191f62dec5c | [
"MIT"
] | null | null | null | csv_to_table/migrations/0004_auto_20200119_1410.py | KariSpace/CRM_Sedicomm | cb19e90ca99c7a50a1841afbfb878191f62dec5c | [
"MIT"
] | null | null | null | # Generated by Django 2.2 on 2020-01-19 12:10
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('csv_to_table', '0003_auto_20200119_1405'),
]
operations = [
migrations.AlterField(
model_name='people',
name='date',
... | 21.684211 | 75 | 0.614078 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('csv_to_table', '0003_auto_20200119_1405'),
]
operations = [
migrations.AlterField(
model_name='people',
name='date',
field=models.DateField(auto_now_ad... | true | true |
f713a32ffa56c392f78bb86890ac67b2a4fb768f | 1,249 | py | Python | classes/abstract_command.py | platofff/quote-bot | ab7e96b8ce67f16e879cf8628cbbbac6d63eab83 | [
"MIT"
] | 1 | 2021-10-16T18:48:05.000Z | 2021-10-16T18:48:05.000Z | classes/abstract_command.py | platofff/quote-bot | ab7e96b8ce67f16e879cf8628cbbbac6d63eab83 | [
"MIT"
] | null | null | null | classes/abstract_command.py | platofff/quote-bot | ab7e96b8ce67f16e879cf8628cbbbac6d63eab83 | [
"MIT"
] | 1 | 2022-01-15T14:11:26.000Z | 2022-01-15T14:11:26.000Z | import json
config = 'config.json'
with open(config, 'r') as f:
data = json.load(f)
default = data["default"]
class AbstractCommand():
def __init__(self, handler = [], description = None):
self.handler = handler
self.description = description
def hdl(self):
return self.ha... | 26.020833 | 73 | 0.453963 | import json
config = 'config.json'
with open(config, 'r') as f:
data = json.load(f)
default = data["default"]
class AbstractCommand():
def __init__(self, handler = [], description = None):
self.handler = handler
self.description = description
def hdl(self):
return self.ha... | true | true |
f713a46f949cdeca6f625144d43e51fc0aacc310 | 24,542 | py | Python | localstack/services/install.py | VanRoy/localstack | 39f1a1c034ae345f87a1485d717428b59308e6fc | [
"Apache-2.0"
] | 1 | 2022-01-05T10:10:38.000Z | 2022-01-05T10:10:38.000Z | localstack/services/install.py | VanRoy/localstack | 39f1a1c034ae345f87a1485d717428b59308e6fc | [
"Apache-2.0"
] | null | null | null | localstack/services/install.py | VanRoy/localstack | 39f1a1c034ae345f87a1485d717428b59308e6fc | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import functools
import glob
import logging
import os
import platform
import re
import shutil
import stat
import sys
import tempfile
import time
from pathlib import Path
from typing import Callable, Dict, List, Tuple
import requests
from plugin import Plugin, PluginManager
from localstack import... | 36.251108 | 164 | 0.691223 |
import functools
import glob
import logging
import os
import platform
import re
import shutil
import stat
import sys
import tempfile
import time
from pathlib import Path
from typing import Callable, Dict, List, Tuple
import requests
from plugin import Plugin, PluginManager
from localstack import config
from localsta... | true | true |
f713a54b6e20ca35a6b59abf3d1037510ba24f26 | 4,880 | py | Python | script_projet/MainAnnotator.py | JyLIU-emma/Complexit-_recettes | 9ae6db442cbf3f10460a5e1b6e2d7d33fdf8f8f3 | [
"CC0-1.0"
] | null | null | null | script_projet/MainAnnotator.py | JyLIU-emma/Complexit-_recettes | 9ae6db442cbf3f10460a5e1b6e2d7d33fdf8f8f3 | [
"CC0-1.0"
] | null | null | null | script_projet/MainAnnotator.py | JyLIU-emma/Complexit-_recettes | 9ae6db442cbf3f10460a5e1b6e2d7d33fdf8f8f3 | [
"CC0-1.0"
] | null | null | null | """
le script principale sert à annoter un répertoire de fichiers xml de recettes
"""
import glob
import re
import os
from oper_utils import xml_to_recipe_annotated
from Ner_classifieur_annote import load_crf_model, predict_text, transform_to_xml_annote
from NER_ingredient_detector import get_content_from_xmlfile
from... | 43.963964 | 207 | 0.647541 |
import glob
import re
import os
from oper_utils import xml_to_recipe_annotated
from Ner_classifieur_annote import load_crf_model, predict_text, transform_to_xml_annote
from NER_ingredient_detector import get_content_from_xmlfile
from ComplexCalculator import ComplexCalculator
modelpath = "../ml_models/model-20210515... | true | true |
f713a559516860b1f3ff1a93a7e37ed2fca2b47d | 526 | py | Python | lognotify/setup.py | shashank-ssriva/lognotify | 800cb76c55d01d8fafde214486059794846887df | [
"MIT"
] | null | null | null | lognotify/setup.py | shashank-ssriva/lognotify | 800cb76c55d01d8fafde214486059794846887df | [
"MIT"
] | null | null | null | lognotify/setup.py | shashank-ssriva/lognotify | 800cb76c55d01d8fafde214486059794846887df | [
"MIT"
] | null | null | null | from setuptools import setup
setup(name='lognotify',
version='0.1',
py_modules = ['lognotify'],
description='A real-time log monitoring & notification utility which pops up a notification (while running your application) whenever it sees an error in log-file.',
url='http://github.com/shashank-s... | 32.875 | 171 | 0.63308 | from setuptools import setup
setup(name='lognotify',
version='0.1',
py_modules = ['lognotify'],
description='A real-time log monitoring & notification utility which pops up a notification (while running your application) whenever it sees an error in log-file.',
url='http://github.com/shashank-s... | true | true |
f713a65884e06087a7d7534a6c0f82513c734815 | 1,428 | py | Python | 60824855-centroid-arcLength-approxPolyDP/centroid_room.py | nathancy/stackoverflow | e9e2e2b8fba61e41526638a13ac7ada6de2d7560 | [
"MIT"
] | 3 | 2019-09-18T10:45:20.000Z | 2021-09-18T08:36:49.000Z | 60824855-centroid-arcLength-approxPolyDP/centroid_room.py | nathancy/stackoverflow | e9e2e2b8fba61e41526638a13ac7ada6de2d7560 | [
"MIT"
] | 1 | 2020-03-19T15:49:31.000Z | 2020-03-30T14:54:03.000Z | 60824855-centroid-arcLength-approxPolyDP/centroid_room.py | nathancy/stackoverflow | e9e2e2b8fba61e41526638a13ac7ada6de2d7560 | [
"MIT"
] | 1 | 2021-04-08T19:30:42.000Z | 2021-04-08T19:30:42.000Z | import cv2
import numpy as np
# Load image, grayscale, Otsu's threshold
image = cv2.imread('1.png')
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
thresh = cv2.threshold(gray, 0, 255, cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU)[1]
# Remove text
cnts = cv2.findContours(thresh, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
cnts... | 34 | 139 | 0.648459 | import cv2
import numpy as np
image = cv2.imread('1.png')
gray = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
thresh = cv2.threshold(gray, 0, 255, cv2.THRESH_BINARY_INV + cv2.THRESH_OTSU)[1]
# Remove text
cnts = cv2.findContours(thresh, cv2.RETR_TREE, cv2.CHAIN_APPROX_SIMPLE)
cnts = cnts[0] if len(cnts) == 2 else cnts[1]... | true | true |
f713a67c0c5b77aacca20f819144495e8969b5c4 | 45,738 | py | Python | conans/client/conan_api.py | kolrami/conan | 93e4191e970d7ea464901c62d680d76517bb76ca | [
"MIT"
] | null | null | null | conans/client/conan_api.py | kolrami/conan | 93e4191e970d7ea464901c62d680d76517bb76ca | [
"MIT"
] | null | null | null | conans/client/conan_api.py | kolrami/conan | 93e4191e970d7ea464901c62d680d76517bb76ca | [
"MIT"
] | null | null | null | import os
import sys
import requests
from collections import OrderedDict
import conans
from conans import __version__ as client_version
from conans.client.cmd.create import create
from conans.client.hook_manager import HookManager
from conans.client.recorder.action_recorder import ActionRecorder
from conans.client.cl... | 45.829659 | 125 | 0.642792 | import os
import sys
import requests
from collections import OrderedDict
import conans
from conans import __version__ as client_version
from conans.client.cmd.create import create
from conans.client.hook_manager import HookManager
from conans.client.recorder.action_recorder import ActionRecorder
from conans.client.cl... | true | true |
f713a7ea6776cb4b67b41e994ff550f530ea010a | 2,778 | py | Python | leaf/selling/order/manager.py | guiqiqi/leaf | 79e34f4b8fba8c6fd208b5a3049103dca2064ab5 | [
"Apache-2.0"
] | 119 | 2020-01-30T04:25:03.000Z | 2022-03-27T07:15:45.000Z | leaf/selling/order/manager.py | guiqiqi/leaf | 79e34f4b8fba8c6fd208b5a3049103dca2064ab5 | [
"Apache-2.0"
] | 8 | 2020-02-02T05:49:47.000Z | 2021-01-25T03:31:09.000Z | leaf/selling/order/manager.py | guiqiqi/leaf | 79e34f4b8fba8c6fd208b5a3049103dca2064ab5 | [
"Apache-2.0"
] | 11 | 2020-01-31T15:07:11.000Z | 2021-03-24T03:47:48.000Z | """
使用有限状态机算法
通过已经创建的事件和状态
对订单状态进行自动的调度
"""
# pylint: disable=arguments-differ
from typing import NoReturn
from ...core.tools import web
from ...core.algorithm import fsm
from . import events
from . import status
from . import settings
# 状态转移表
_TransferTable = (
(status.Created, events.Confirm, status.Confirmed)... | 33.46988 | 74 | 0.658747 |
from typing import NoReturn
from ...core.tools import web
from ...core.algorithm import fsm
from . import events
from . import status
from . import settings
_TransferTable = (
(status.Created, events.Confirm, status.Confirmed),
(status.Created, events.UserClose, status.Closed),
(status.Created, events.... | true | true |
f713a8a1a1549acb0e7bad080484cb845b0706a9 | 1,917 | py | Python | numpy/ma/tests/test_regression.py | WeatherGod/numpy | 5be45b280b258e158b93163b937f8f9c08d30393 | [
"BSD-3-Clause"
] | null | null | null | numpy/ma/tests/test_regression.py | WeatherGod/numpy | 5be45b280b258e158b93163b937f8f9c08d30393 | [
"BSD-3-Clause"
] | null | null | null | numpy/ma/tests/test_regression.py | WeatherGod/numpy | 5be45b280b258e158b93163b937f8f9c08d30393 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import division, absolute_import, print_function
import numpy as np
import numpy.ma as ma
from numpy.testing import *
from numpy.compat import sixu
rlevel = 1
class TestRegression(TestCase):
def test_masked_array_create(self,level=rlevel):
"""Ticket #17"""
x = np.ma.masked_array([... | 28.61194 | 74 | 0.581116 | from __future__ import division, absolute_import, print_function
import numpy as np
import numpy.ma as ma
from numpy.testing import *
from numpy.compat import sixu
rlevel = 1
class TestRegression(TestCase):
def test_masked_array_create(self,level=rlevel):
x = np.ma.masked_array([0,1,2,3,0,4,5,6],mask=[0,... | true | true |
f713a9dc7b039e0ec3ed6a843cbb5ec20cd3d558 | 23,351 | py | Python | source/spot_detection_tracking/trackmate_xml_2d.py | zhanyinx/SPT_analysis | 1cf806c1fd6051e7fc998d2860a16bea6aa9de1a | [
"MIT"
] | 1 | 2021-07-09T11:51:04.000Z | 2021-07-09T11:51:04.000Z | source/spot_detection_tracking/trackmate_xml_2d.py | zhanyinx/SPT_analysis | 1cf806c1fd6051e7fc998d2860a16bea6aa9de1a | [
"MIT"
] | null | null | null | source/spot_detection_tracking/trackmate_xml_2d.py | zhanyinx/SPT_analysis | 1cf806c1fd6051e7fc998d2860a16bea6aa9de1a | [
"MIT"
] | null | null | null | """\U0001F1EB\U0001F1EF \U00002B50 CSV track coordinate to TrackMate XML conversion.
Fiji allows for quick and easy viewing of images. TrackMate can be used to view tracks.
Unfortunately, it isn't that simple to convert "normal" coordinate output into
TrackMate-viewable format.
Requires a "tracks.csv" file that contai... | 30.524183 | 90 | 0.480493 |
import argparse
import os
import tempfile
import xml.dom.minidom
import xml.etree.ElementTree as ET
import numpy as np
import pandas as pd
import skimage.io
def get_gaps(frames):
def __longest_consecutive(a):
a = set(a)
longest = 0
for i in a:
if i - 1 not in a:
... | true | true |
f713ad1b0c007eaefdbe5b1736bad81fd1c6c192 | 5,530 | py | Python | homekit/tools.py | LucaKaufmann/homekit_python | 12f95aba5db676fa9254ccfb4382aa1f6cc8862d | [
"Apache-2.0"
] | null | null | null | homekit/tools.py | LucaKaufmann/homekit_python | 12f95aba5db676fa9254ccfb4382aa1f6cc8862d | [
"Apache-2.0"
] | null | null | null | homekit/tools.py | LucaKaufmann/homekit_python | 12f95aba5db676fa9254ccfb4382aa1f6cc8862d | [
"Apache-2.0"
] | null | null | null | #
# Copyright 2018 Joachim Lusiardi
#
# 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... | 37.619048 | 120 | 0.682098 |
import json
import sys
import base64
import binascii
from homekit.http_impl.http_client import HomeKitHTTPConnection
from homekit.zeroconf_ import find_device_ip_and_port
from homekit.protocol import get_session_keys
from homekit.model.characteristics import CharacteristicFormats
from distutils.util im... | true | true |
f713ad9cc4719c8e9bec1ba17ee8b320554f1bbc | 3,331 | py | Python | tests/test_models/test_engine/test_file_storage.py | yasheymateen/AirBnB_clone | 865cbef47738371f66b9264635a04b983d7accfd | [
"Unlicense"
] | null | null | null | tests/test_models/test_engine/test_file_storage.py | yasheymateen/AirBnB_clone | 865cbef47738371f66b9264635a04b983d7accfd | [
"Unlicense"
] | null | null | null | tests/test_models/test_engine/test_file_storage.py | yasheymateen/AirBnB_clone | 865cbef47738371f66b9264635a04b983d7accfd | [
"Unlicense"
] | null | null | null | #!/usr/bin/python3
"""
This module contains the tests for FileStorage class
"""
import unittest
import io
import sys
import models
from models.engine.file_storage import FileStorage
from models.base_model import BaseModel
from models.user import User
from models.state import State
from models.city import City
from mode... | 33.31 | 75 | 0.65686 |
import unittest
import io
import sys
import models
from models.engine.file_storage import FileStorage
from models.base_model import BaseModel
from models.user import User
from models.state import State
from models.city import City
from models.amenity import Amenity
from models.place import Place
from models.review imp... | true | true |
f713af60491a19d75d5d98d285087f166e61f127 | 12,467 | py | Python | scripts/asr_language_modeling/neural_rescorer/eval_neural_rescorer.py | PatrykNeubauer/NeMo | 3ada744b884dba5f233f22c6991fc6092c6ca8d0 | [
"Apache-2.0"
] | 2 | 2021-09-21T07:36:20.000Z | 2022-02-05T15:29:04.000Z | scripts/asr_language_modeling/neural_rescorer/eval_neural_rescorer.py | PatrykNeubauer/NeMo | 3ada744b884dba5f233f22c6991fc6092c6ca8d0 | [
"Apache-2.0"
] | null | null | null | scripts/asr_language_modeling/neural_rescorer/eval_neural_rescorer.py | PatrykNeubauer/NeMo | 3ada744b884dba5f233f22c6991fc6092c6ca8d0 | [
"Apache-2.0"
] | 12 | 2021-06-20T08:56:10.000Z | 2022-03-16T19:07:10.000Z | # Copyright (c) 2021, NVIDIA CORPORATION. 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... | 43.138408 | 136 | 0.657416 |
import contextlib
import json
from argparse import ArgumentParser
import editdistance
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import torch
import tqdm
from nemo.collections.nlp.models.language_modeling import TransformerLMModel
from nemo.utils import logging
class BeamS... | true | true |
f713afaf83175476277e6164a0ad61b115c896f7 | 1,900 | py | Python | magnetic_diffusion/diffusion1D.py | mattzett/numerical_electromagnetics | 07634817ba854a5515c8c31545b735f651878c5e | [
"MIT"
] | null | null | null | magnetic_diffusion/diffusion1D.py | mattzett/numerical_electromagnetics | 07634817ba854a5515c8c31545b735f651878c5e | [
"MIT"
] | null | null | null | magnetic_diffusion/diffusion1D.py | mattzett/numerical_electromagnetics | 07634817ba854a5515c8c31545b735f651878c5e | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Mon Feb 21 19:43:50 2022
Illustrating a basic transient magnetic diffusion problem, See Jackson Section 5.18
@author: zettergm
"""
import numpy as np
import scipy.sparse.linalg
import scipy.sparse
from scipy.special import erf
import matplotlib.pyplot as ... | 27.142857 | 128 | 0.678947 |
import numpy as np
import scipy.sparse.linalg
import scipy.sparse
from scipy.special import erf
import matplotlib.pyplot as plt
from numpy import pi,sqrt,abs
from difftools import matrix_kernel
mu=4*pi*1e-7
sigma=1e6
D=1/mu/sigma
a=1
H0=1
nu=1/mu/sigma/a**2
lz=250
Nmax=200
z=np.linspace(-5*a,5*a,lz)
dz=z[1]-... | true | true |
f713b03a2ce3c22466f083dc5ee76b456b3c089f | 2,341 | py | Python | src/code.py | Bikin-Bot/cnnindonesia-news-api | 4b137f5dcfa537fe4ece4fcc484cd6ab9166f5ac | [
"MIT"
] | 28 | 2020-06-29T23:18:48.000Z | 2021-12-19T07:15:32.000Z | src/code.py | Bikin-Bot/cnnindonesia-news-api | 4b137f5dcfa537fe4ece4fcc484cd6ab9166f5ac | [
"MIT"
] | 2 | 2020-11-04T06:53:08.000Z | 2022-03-18T09:06:53.000Z | src/code.py | Bikin-Bot/cnnindonesia-news-api | 4b137f5dcfa537fe4ece4fcc484cd6ab9166f5ac | [
"MIT"
] | 17 | 2020-12-11T01:39:45.000Z | 2022-03-29T01:25:24.000Z | from bs4 import BeautifulSoup
from requests import get
import json
class Script:
def query(self, url):
datas = get(url)
soup = BeautifulSoup(datas.text, 'html.parser')
tag = soup.find_all('article')
data = []
for i in tag:
try:
title = i.find('h... | 30.012821 | 84 | 0.513883 | from bs4 import BeautifulSoup
from requests import get
import json
class Script:
def query(self, url):
datas = get(url)
soup = BeautifulSoup(datas.text, 'html.parser')
tag = soup.find_all('article')
data = []
for i in tag:
try:
title = i.find('h... | true | true |
f713b083499d28d14fa6a7c7ae53ff0fb3fad718 | 4,785 | py | Python | extensions/utils.py | Yang-YiFan/DiracDeltaNet | 36487542422d7573fec6e852b9eece18c6cbce21 | [
"Apache-2.0"
] | 30 | 2018-12-27T06:56:26.000Z | 2022-01-10T10:43:53.000Z | extensions/utils.py | heheda365/DiracDeltaNet | 36487542422d7573fec6e852b9eece18c6cbce21 | [
"Apache-2.0"
] | 4 | 2019-11-05T10:44:38.000Z | 2021-06-22T18:41:08.000Z | extensions/utils.py | heheda365/DiracDeltaNet | 36487542422d7573fec6e852b9eece18c6cbce21 | [
"Apache-2.0"
] | 12 | 2018-12-21T08:36:15.000Z | 2021-12-16T08:38:27.000Z | '''Some helper functions for PyTorch, including:
- get_mean_and_std: calculate the mean and std value of dataset.
- msr_init: net parameter initialization.
- progress_bar: progress bar mimic xlua.progress.
'''
import os
import sys
import time
import math
import torch
import torch.nn as nn
impor... | 28.482143 | 97 | 0.543783 | import os
import sys
import time
import math
import torch
import torch.nn as nn
import torch.nn.init as init
import numpy as np
def get_mean_and_std(dataset):
dataloader = torch.utils.data.DataLoader(dataset, batch_size=1, shuffle=True, num_workers=2)
mean = torch.zeros(3)
std = torch.zer... | true | true |
f713b17335259f44d8fc254662e6850b184a61d9 | 9,180 | py | Python | venv/lib/python3.6/site-packages/pip/_vendor/lockfile/__init__.py | aitoehigie/britecore_flask | eef1873dbe6b2cc21f770bc6dec783007ae4493b | [
"MIT"
] | null | null | null | venv/lib/python3.6/site-packages/pip/_vendor/lockfile/__init__.py | aitoehigie/britecore_flask | eef1873dbe6b2cc21f770bc6dec783007ae4493b | [
"MIT"
] | 1 | 2021-06-01T23:32:38.000Z | 2021-06-01T23:32:38.000Z | venv/lib/python3.6/site-packages/pip/_vendor/lockfile/__init__.py | aitoehigie/britecore_flask | eef1873dbe6b2cc21f770bc6dec783007ae4493b | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
lockfile.py - Platform-independent advisory file locks.
Requires Python 2.5 unless you apply 2.4.diff
Locking is done on a per-thread basis instead of a per-process basis.
Usage:
>>> lock = LockFile('somefile')
>>> try:
... lock.acquire()
... except AlreadyLocked:
... print 'some... | 24.285714 | 88 | 0.611329 |
from __future__ import absolute_import
import functools
import os
import socket
import threading
import warnings
if not hasattr(threading, "current_thread"):
threading.current_thread = threading.currentThread
if not hasattr(threading.Thread, "get_name"):
threading.Thread.get_name = threading.Thread.getNam... | true | true |
f713b1ea0c11d8b85504679217766f2c5726271f | 12,913 | py | Python | tests/ut/python/ops/test_tensor_slice.py | XinYao1994/mindspore | 2c1a2bf752a1fde311caddba22633d2f4f63cb4e | [
"Apache-2.0"
] | 2 | 2020-04-28T03:49:10.000Z | 2020-04-28T03:49:13.000Z | tests/ut/python/ops/test_tensor_slice.py | XinYao1994/mindspore | 2c1a2bf752a1fde311caddba22633d2f4f63cb4e | [
"Apache-2.0"
] | null | null | null | tests/ut/python/ops/test_tensor_slice.py | XinYao1994/mindspore | 2c1a2bf752a1fde311caddba22633d2f4f63cb4e | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 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... | 31.962871 | 126 | 0.61016 |
import numpy as np
import pytest
from mindspore import Tensor
from mindspore import context
from mindspore import dtype as mstype
from mindspore.nn import Cell
from ....mindspore_test_framework.mindspore_test import mindspore_test
from ....mindspore_test_framework.pipeline.forward.compile_forward \
... | true | true |
f713b345bd277bc050a9b295cca338adedc276d5 | 1,193 | py | Python | Utils/lockfile.py | RobertCsordas/dnc | 1a01d64d30430e19380084847e84b52c0d58c81e | [
"Apache-2.0"
] | 3 | 2020-10-17T20:34:07.000Z | 2021-04-15T04:01:36.000Z | Utils/lockfile.py | RobertCsordas/dnc | 1a01d64d30430e19380084847e84b52c0d58c81e | [
"Apache-2.0"
] | null | null | null | Utils/lockfile.py | RobertCsordas/dnc | 1a01d64d30430e19380084847e84b52c0d58c81e | [
"Apache-2.0"
] | 1 | 2022-02-23T02:31:41.000Z | 2022-02-23T02:31:41.000Z | # Copyright 2017 Robert Csordas. 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 a... | 28.404762 | 80 | 0.640402 |
import os
import fcntl
class LockFile:
def __init__(self, fname):
self._fname = fname
self._fd = None
def acquire(self):
self._fd=open(self._fname, "w")
os.chmod(self._fname, 0o777)
fcntl.lockf(self._fd, fcntl.LOCK_EX)
def release(self):
f... | true | true |
f713b4a98deb1a3197e73fe21905fc50ff875827 | 139 | py | Python | testes/008 - Copia.py | AlexCaprian/Python | 4d343330bb4e82f639ca103b119f0a9eeee916e0 | [
"MIT"
] | null | null | null | testes/008 - Copia.py | AlexCaprian/Python | 4d343330bb4e82f639ca103b119f0a9eeee916e0 | [
"MIT"
] | null | null | null | testes/008 - Copia.py | AlexCaprian/Python | 4d343330bb4e82f639ca103b119f0a9eeee916e0 | [
"MIT"
] | null | null | null | m=float(input('Quantos metros?'))
c=m*100
mm=m*1000
print('A conversão de {} para centímetros é {} e para milímetros é {}.'.format(m,c,mm)) | 34.75 | 87 | 0.683453 | m=float(input('Quantos metros?'))
c=m*100
mm=m*1000
print('A conversão de {} para centímetros é {} e para milímetros é {}.'.format(m,c,mm)) | true | true |
f713b561e8db2c29bdc9f9f639374ec689869888 | 390 | py | Python | dict01/pinky_brain.py | mikerauer/pyb-class | b7f6202c58df654eb81263d12c2634fa37a27e07 | [
"MIT"
] | null | null | null | dict01/pinky_brain.py | mikerauer/pyb-class | b7f6202c58df654eb81263d12c2634fa37a27e07 | [
"MIT"
] | null | null | null | dict01/pinky_brain.py | mikerauer/pyb-class | b7f6202c58df654eb81263d12c2634fa37a27e07 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
mice = {"number": 2, "names": [{"name": "Pinky", "tag": "the real genius"},{"name": "The Brain", "tag": "insane one"}], "world_domination_status": "pending"}
## print following
## Pinky is the real genius, and The Brain is the insane one
print(f'{mice["names"][0]["name"]} is {mice["names"][0]["tag"]... | 55.714286 | 157 | 0.607692 |
mice = {"number": 2, "names": [{"name": "Pinky", "tag": "the real genius"},{"name": "The Brain", "tag": "insane one"}], "world_domination_status": "pending"}
e["names"][1]["name"]} is the {mice["names"][1]["tag"]}.')
| true | true |
f713b5e3c74cd9f95a301019d4e5f568395f8611 | 3,712 | py | Python | intersight/models/syslog_remote_logging_client_ref.py | ategaw-cisco/intersight-python | 9d6476620507281b1dc358e29ac452d56081bbb0 | [
"Apache-2.0"
] | null | null | null | intersight/models/syslog_remote_logging_client_ref.py | ategaw-cisco/intersight-python | 9d6476620507281b1dc358e29ac452d56081bbb0 | [
"Apache-2.0"
] | null | null | null | intersight/models/syslog_remote_logging_client_ref.py | ategaw-cisco/intersight-python | 9d6476620507281b1dc358e29ac452d56081bbb0 | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Intersight REST API
This is Intersight REST API
OpenAPI spec version: 1.0.9-262
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re
class SyslogRemoteLoggingClientRef(object):
"""
NOT... | 24.746667 | 81 | 0.554149 |
from pprint import pformat
from six import iteritems
import re
class SyslogRemoteLoggingClientRef(object):
swagger_types = {
'moid': 'str',
'object_type': 'str'
}
attribute_map = {
'moid': 'Moid',
'object_type': 'ObjectType'
}
def __init__(self, moid=None, o... | true | true |
f713b6a7b772fb52e300f15bc3b1304b170ad695 | 182 | py | Python | Controllers/EditSessionForm.py | esot0/jmsa-tutoring-backend | f35000c73fbbb31f9b4dcca36e40854dc2e06d23 | [
"MIT"
] | null | null | null | Controllers/EditSessionForm.py | esot0/jmsa-tutoring-backend | f35000c73fbbb31f9b4dcca36e40854dc2e06d23 | [
"MIT"
] | null | null | null | Controllers/EditSessionForm.py | esot0/jmsa-tutoring-backend | f35000c73fbbb31f9b4dcca36e40854dc2e06d23 | [
"MIT"
] | null | null | null | from wtforms import StringField, Form
class EditSessionForm(Form):
subject = StringField('Subject')
date = StringField('Date')
other_user = StringField('Other User')
| 20.222222 | 42 | 0.714286 | from wtforms import StringField, Form
class EditSessionForm(Form):
subject = StringField('Subject')
date = StringField('Date')
other_user = StringField('Other User')
| true | true |
f713b6c9f2f54c3584469cc5be229a9e0af8e5ca | 3,761 | py | Python | components/deprecated/tfx/ExampleGen/CsvExampleGen/with_URI_IO/component.py | Strasser-Pablo/pipelines | a1d513eb412f3ffd44edf82af2fa7edb05c3b952 | [
"Apache-2.0"
] | 2,860 | 2018-05-24T04:55:01.000Z | 2022-03-31T13:49:56.000Z | components/deprecated/tfx/ExampleGen/CsvExampleGen/with_URI_IO/component.py | Strasser-Pablo/pipelines | a1d513eb412f3ffd44edf82af2fa7edb05c3b952 | [
"Apache-2.0"
] | 7,331 | 2018-05-16T09:03:26.000Z | 2022-03-31T23:22:04.000Z | components/deprecated/tfx/ExampleGen/CsvExampleGen/with_URI_IO/component.py | Strasser-Pablo/pipelines | a1d513eb412f3ffd44edf82af2fa7edb05c3b952 | [
"Apache-2.0"
] | 1,359 | 2018-05-15T11:05:41.000Z | 2022-03-31T09:42:09.000Z | from typing import NamedTuple
def CsvExampleGen(
output_examples_uri: 'ExamplesUri',
input_base: str,
input_config: {'JsonObject': {'data_type': 'proto:tfx.components.example_gen.Input'}},
output_config: {'JsonObject': {'data_type': 'proto:tfx.components.example_gen.Output'}},
range_config: {'JsonO... | 44.77381 | 129 | 0.697421 | from typing import NamedTuple
def CsvExampleGen(
output_examples_uri: 'ExamplesUri',
input_base: str,
input_config: {'JsonObject': {'data_type': 'proto:tfx.components.example_gen.Input'}},
output_config: {'JsonObject': {'data_type': 'proto:tfx.components.example_gen.Output'}},
range_config: {'JsonO... | true | true |
f713b7232b0919cbb5b6eac3bc695c1343a44fe2 | 1,808 | py | Python | python/src/main/python/setup.py | radiant-maxar/geowave | 2d9f39d32e4621c8f5965a4dffff0623c1c03231 | [
"Apache-2.0"
] | 280 | 2017-06-14T01:26:19.000Z | 2022-03-28T15:45:23.000Z | python/src/main/python/setup.py | radiant-maxar/geowave | 2d9f39d32e4621c8f5965a4dffff0623c1c03231 | [
"Apache-2.0"
] | 458 | 2017-06-12T20:00:59.000Z | 2022-03-31T04:41:59.000Z | python/src/main/python/setup.py | radiant-maxar/geowave | 2d9f39d32e4621c8f5965a4dffff0623c1c03231 | [
"Apache-2.0"
] | 135 | 2017-06-12T20:39:34.000Z | 2022-03-15T13:42:30.000Z | # Packages up pygw so it's pip-installable
from setuptools import setup, find_packages
with open('README.md', 'r') as fh:
long_description = fh.read()
def get_version():
try:
from maven_version import get_maven_version
version = get_maven_version()
except ModuleNotFoundError:
# If... | 36.16 | 95 | 0.65542 |
from setuptools import setup, find_packages
with open('README.md', 'r') as fh:
long_description = fh.read()
def get_version():
try:
from maven_version import get_maven_version
version = get_maven_version()
except ModuleNotFoundError:
# If maven version isn't found, it must be fro... | true | true |
f713b7cba5b2c11f1ceac74906715a9f7d2dd421 | 657 | py | Python | venv/lib/python3.8/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-numba.py | avrumnoor/NewsSummarizer | a963497ef9bc62d2148aa28e624ea32955992f57 | [
"MIT"
] | 12 | 2020-12-15T15:12:06.000Z | 2022-03-18T16:17:42.000Z | venv/lib/python3.8/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-numba.py | avrumnoor/NewsSummarizer | a963497ef9bc62d2148aa28e624ea32955992f57 | [
"MIT"
] | 20 | 2021-05-03T18:02:23.000Z | 2022-03-12T12:01:04.000Z | venv/lib/python3.8/site-packages/_pyinstaller_hooks_contrib/hooks/stdhooks/hook-numba.py | avrumnoor/NewsSummarizer | a963497ef9bc62d2148aa28e624ea32955992f57 | [
"MIT"
] | 10 | 2020-12-15T15:12:14.000Z | 2022-02-09T21:02:17.000Z | # ------------------------------------------------------------------
# Copyright (c) 2020 PyInstaller Development Team.
#
# This file is distributed under the terms of the GNU General Public
# License (version 2.0 or later).
#
# The full license is available in LICENSE.GPL.txt, distributed with
# this software.
#
# SPD... | 31.285714 | 68 | 0.576865 |
excludedimports = ["IPython", "scipy"]
hiddenimports = ["llvmlite"]
| true | true |
f713b8d08238284849c9342f3be734f7fb3a2bdb | 1,699 | py | Python | Other/GaussianRandomStockPrice.py | AcudoDev/FinanceToolbox | 90676e798f2e8eac164ccfcd6708cc717e1911f2 | [
"MIT"
] | null | null | null | Other/GaussianRandomStockPrice.py | AcudoDev/FinanceToolbox | 90676e798f2e8eac164ccfcd6708cc717e1911f2 | [
"MIT"
] | null | null | null | Other/GaussianRandomStockPrice.py | AcudoDev/FinanceToolbox | 90676e798f2e8eac164ccfcd6708cc717e1911f2 | [
"MIT"
] | null | null | null | import pandas as pd
import numpy as np
import yfinance as yf
from sklearn.linear_model import LinearRegression
import statsmodels
import statsmodels.api as sm
import statsmodels.tsa.stattools as ts
import datetime
import scipy.stats
import math
import openpyxl as pyxl
from scipy import signal
from scipy import stats... | 25.742424 | 88 | 0.649205 | import pandas as pd
import numpy as np
import yfinance as yf
from sklearn.linear_model import LinearRegression
import statsmodels
import statsmodels.api as sm
import statsmodels.tsa.stattools as ts
import datetime
import scipy.stats
import math
import openpyxl as pyxl
from scipy import signal
from scipy import stats... | true | true |
f713ba9833d44add8863407d37e88c84d47ea6f3 | 522 | py | Python | pyschieber/player/random_player.py | Murthy10/pyschieber | f9db28c9553b8f321f6ed71cff04eff7879af5f6 | [
"MIT"
] | 5 | 2018-01-17T08:11:14.000Z | 2018-11-27T11:37:15.000Z | pyschieber/player/random_player.py | Murthy10/pyschieber | f9db28c9553b8f321f6ed71cff04eff7879af5f6 | [
"MIT"
] | 4 | 2018-05-09T08:41:05.000Z | 2018-11-16T08:07:39.000Z | pyschieber/player/random_player.py | Murthy10/pyschieber | f9db28c9553b8f321f6ed71cff04eff7879af5f6 | [
"MIT"
] | 3 | 2018-04-20T07:39:30.000Z | 2018-11-10T12:44:08.000Z | import random
from pyschieber.player.base_player import BasePlayer
from pyschieber.trumpf import Trumpf
class RandomPlayer(BasePlayer):
def choose_trumpf(self, geschoben):
return move(choices=list(Trumpf))
def choose_card(self, state=None):
cards = self.allowed_cards(state=state)
ret... | 22.695652 | 52 | 0.683908 | import random
from pyschieber.player.base_player import BasePlayer
from pyschieber.trumpf import Trumpf
class RandomPlayer(BasePlayer):
def choose_trumpf(self, geschoben):
return move(choices=list(Trumpf))
def choose_card(self, state=None):
cards = self.allowed_cards(state=state)
ret... | true | true |
f713bb1e600d2ca18e6774b088fb0443723b8c85 | 6,909 | py | Python | data/p3BR/R2/benchmark/startQiskit289.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R2/benchmark/startQiskit289.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | data/p3BR/R2/benchmark/startQiskit289.py | UCLA-SEAL/QDiff | d968cbc47fe926b7f88b4adf10490f1edd6f8819 | [
"BSD-3-Clause"
] | null | null | null | # qubit number=3
# total number=60
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collections import Counter
from... | 31.547945 | 140 | 0.636995 |
import numpy as np
from qiskit import QuantumCircuit, execute, Aer, QuantumRegister, ClassicalRegister, transpile, BasicAer, IBMQ
from qiskit.visualization import plot_histogram
from typing import *
from pprint import pprint
from math import log2
from collections import Counter
from qiskit.test.mock import FakeVigo... | true | true |
f713bb216808a56db66a5efb35ac61c688245d4d | 15,257 | py | Python | topi/python/topi/cuda/rcnn/proposal.py | seanlatias/incubator-tvm | 2e5cb16b4cebe53fba4fb3be49b6748738e20224 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | 9 | 2019-12-17T08:03:54.000Z | 2022-01-19T02:34:23.000Z | topi/python/topi/cuda/rcnn/proposal.py | seanlatias/incubator-tvm | 2e5cb16b4cebe53fba4fb3be49b6748738e20224 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | 2 | 2020-06-18T21:15:42.000Z | 2020-06-24T17:38:37.000Z | topi/python/topi/cuda/rcnn/proposal.py | seanlatias/incubator-tvm | 2e5cb16b4cebe53fba4fb3be49b6748738e20224 | [
"Zlib",
"Unlicense",
"Apache-2.0",
"BSD-2-Clause",
"MIT",
"ECL-2.0"
] | 3 | 2020-10-04T20:30:18.000Z | 2022-01-24T18:03:52.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... | 40.044619 | 100 | 0.604575 |
import math
import tvm
from tvm import te
from ...vision.rcnn import generate_anchor, reg_bbox, reg_iou
from ...util import get_const_tuple, get_const_int
def predict_bbox_ir(cls_prob_buf, bbox_pred_buf, im_info_buf, out_buf, scales, ratios,
feature_stride, rpn_min_size, iou_loss)... | true | true |
f713bd33c2d69f8941017073c807f9fb3f287a60 | 50,346 | py | Python | nuitka/optimizations/OptimizeBuiltinCalls.py | jvalduvieco/Nuitka | b93046d5d1c162d416d392d835790936d15a2cf8 | [
"Apache-2.0"
] | null | null | null | nuitka/optimizations/OptimizeBuiltinCalls.py | jvalduvieco/Nuitka | b93046d5d1c162d416d392d835790936d15a2cf8 | [
"Apache-2.0"
] | null | null | null | nuitka/optimizations/OptimizeBuiltinCalls.py | jvalduvieco/Nuitka | b93046d5d1c162d416d392d835790936d15a2cf8 | [
"Apache-2.0"
] | null | null | null | # Copyright 2021, Kay Hayen, mailto:kay.hayen@gmail.com
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | 33.144174 | 88 | 0.648095 |
from nuitka.__past__ import xrange
from nuitka.Errors import NuitkaAssumptionError
from nuitka.nodes.AssignNodes import (
StatementAssignmentVariable,
StatementDelVariable,
)
from nuitka.nodes.AttributeNodes import (
ExpressionAttributeLookup,
ExpressionBuiltinGetattr,
Expression... | true | true |
f713bd605f56403edd2af58f3a6b67b73eebfb33 | 746 | py | Python | release/stubs.min/System/__init___parts/IFormatProvider.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 182 | 2017-06-27T02:26:15.000Z | 2022-03-30T18:53:43.000Z | release/stubs.min/System/__init___parts/IFormatProvider.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 28 | 2017-06-27T13:38:23.000Z | 2022-03-15T11:19:44.000Z | release/stubs.min/System/__init___parts/IFormatProvider.py | htlcnn/ironpython-stubs | 780d829e2104b2789d5f4d6f32b0ec9f2930ca03 | [
"MIT"
] | 67 | 2017-06-28T09:43:59.000Z | 2022-03-20T21:17:10.000Z | class IFormatProvider:
""" Provides a mechanism for retrieving an object to control formatting. """
def GetFormat(self,formatType):
"""
GetFormat(self: IFormatProvider,formatType: Type) -> object
Returns an object that provides formatting services for the specified type.
formatType: An... | 32.434783 | 147 | 0.718499 | class IFormatProvider:
def GetFormat(self,formatType):
pass
def __init__(self,*args):
pass
| true | true |
f713bd7d306ff19bdfc4bafacd88ec5bf2b55af8 | 782 | py | Python | backend/histocat/api/panorama/controller.py | BodenmillerGroup/histocat-web | c598cd07506febf0b7c209626d4eb869761f2e62 | [
"MIT"
] | 4 | 2021-06-14T15:19:25.000Z | 2022-02-09T13:17:39.000Z | backend/histocat/api/panorama/controller.py | BodenmillerGroup/histocat-web | c598cd07506febf0b7c209626d4eb869761f2e62 | [
"MIT"
] | null | null | null | backend/histocat/api/panorama/controller.py | BodenmillerGroup/histocat-web | c598cd07506febf0b7c209626d4eb869761f2e62 | [
"MIT"
] | 1 | 2022-02-09T13:17:41.000Z | 2022-02-09T13:17:41.000Z | import os
from fastapi import APIRouter, Depends
from sqlalchemy.orm import Session
from starlette.responses import FileResponse
from histocat.api.db import get_db
from histocat.core.panorama import service
router = APIRouter()
@router.get("/panoramas/{id}/image", responses={200: {"content": {"image/png": {}}}})
a... | 24.4375 | 85 | 0.649616 | import os
from fastapi import APIRouter, Depends
from sqlalchemy.orm import Session
from starlette.responses import FileResponse
from histocat.api.db import get_db
from histocat.core.panorama import service
router = APIRouter()
@router.get("/panoramas/{id}/image", responses={200: {"content": {"image/png": {}}}})
a... | true | true |
f713bd985d707ee952fc4906911d895395ad2c03 | 2,325 | py | Python | google-cloud-sdk/lib/surface/runtime_config/configs/list.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/lib/surface/runtime_config/configs/list.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | null | null | null | google-cloud-sdk/lib/surface/runtime_config/configs/list.py | bopopescu/searchparty | afdc2805cb1b77bd5ac9fdd1a76217f4841f0ea6 | [
"Apache-2.0"
] | 3 | 2017-07-27T18:44:13.000Z | 2020-07-25T17:48:53.000Z | # Copyright 2016 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 required by applicable law or ag... | 28.703704 | 80 | 0.695914 |
from apitools.base.py import list_pager
from googlecloudsdk.api_lib.runtime_config import util
from googlecloudsdk.calliope import base
class List(base.ListCommand):
DEFAULT_PAGE_SIZE = 100
detailed_help = {
'EXAMPLES': """\
To list all runtime-config resources for the current pr... | true | true |
f713be977bca839114bb2f2747397cf2cbc53701 | 786 | py | Python | filemonitor/migrations/0006_auto_20170523_1706.py | imsilence/shadow-hostmonitor | faa28d7f5bb85212d5a64a60f742b807cf8644f7 | [
"Apache-2.0"
] | 1 | 2019-11-02T14:25:29.000Z | 2019-11-02T14:25:29.000Z | filemonitor/migrations/0006_auto_20170523_1706.py | imsilence/shadow-hostmonitor | faa28d7f5bb85212d5a64a60f742b807cf8644f7 | [
"Apache-2.0"
] | null | null | null | filemonitor/migrations/0006_auto_20170523_1706.py | imsilence/shadow-hostmonitor | faa28d7f5bb85212d5a64a60f742b807cf8644f7 | [
"Apache-2.0"
] | 1 | 2019-11-02T14:25:19.000Z | 2019-11-02T14:25:19.000Z | # -*- coding: utf-8 -*-
# Generated by Django 1.11.1 on 2017-05-23 09:06
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('filemonitor', '0005_auto_20170523_1541'),
]
operations = [
mi... | 25.354839 | 52 | 0.550891 |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('filemonitor', '0005_auto_20170523_1541'),
]
operations = [
migrations.RenameField(
model_name='actualfile',
... | true | true |
f713bed89ea6d867f3c6c6448a2bf04f05614686 | 1,695 | py | Python | async.py | Ethan-Xie/python_study | 0e251709de37d38e3ea9af2202d8f94766d3a64f | [
"MIT"
] | null | null | null | async.py | Ethan-Xie/python_study | 0e251709de37d38e3ea9af2202d8f94766d3a64f | [
"MIT"
] | null | null | null | async.py | Ethan-Xie/python_study | 0e251709de37d38e3ea9af2202d8f94766d3a64f | [
"MIT"
] | null | null | null |
# 使用yield 实现单线程的异步并发效果
import time
def consumer(name):
print("%s 准备吃包子啦!" %name)
while True:
baozi = yield #接收值
print("包子[%s]来了,被[%s]吃了!" %(baozi,name))
def producer(name):
c = consumer("A")
c2 = consumer("B")
c.__next__()
c2.__next__()
print("老子开始做包子了")
for i in ran... | 13.139535 | 48 | 0.532743 |
import time
def consumer(name):
print("%s 准备吃包子啦!" %name)
while True:
baozi = yield
print("包子[%s]来了,被[%s]吃了!" %(baozi,name))
def producer(name):
c = consumer("A")
c2 = consumer("B")
c.__next__()
c2.__next__()
print("老子开始做包子了")
for i in range(1):
time.slee... | true | true |
f713bf3131754f4b99d4daaa838e48deebcdd659 | 3,937 | py | Python | openGaussBase/testcase/GUC/QUERYPLAN/Opengauss_Function_Guc_Queryplan_Case0101.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/GUC/QUERYPLAN/Opengauss_Function_Guc_Queryplan_Case0101.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | openGaussBase/testcase/GUC/QUERYPLAN/Opengauss_Function_Guc_Queryplan_Case0101.py | opengauss-mirror/Yat | aef107a8304b94e5d99b4f1f36eb46755eb8919e | [
"MulanPSL-1.0"
] | null | null | null | """
Copyright (c) 2022 Huawei Technologies Co.,Ltd.
openGauss is licensed under Mulan PSL v2.
You can use this software according to the terms and conditions of the Mulan PSL v2.
You may obtain a copy of Mulan PSL v2 at:
http://license.coscl.org.cn/MulanPSL2
THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, W... | 36.119266 | 84 | 0.624333 | import unittest
from testcase.utils.CommonSH import CommonSH
from testcase.utils.Constant import Constant
from testcase.utils.Logger import Logger
LOG = Logger()
commonsh = CommonSH('dbuser')
class QueryPlan(unittest.TestCase):
def setUp(self):
self.constant = Constant()
LOG.info(
'... | true | true |
f713bf7049d636559b31faa12aae89196f72bea9 | 3,608 | py | Python | docs/samples/specification/azure_key_credential/generated/azure/key/credential/sample/_auto_rest_head_test_service.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 35 | 2018-04-03T12:15:53.000Z | 2022-03-11T14:03:34.000Z | docs/samples/specification/azure_key_credential/generated/azure/key/credential/sample/_auto_rest_head_test_service.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 652 | 2017-08-28T22:44:41.000Z | 2022-03-31T21:20:31.000Z | docs/samples/specification/azure_key_credential/generated/azure/key/credential/sample/_auto_rest_head_test_service.py | cfculhane/autorest.python | 8cbca95faee88d933a58bbbd17b76834faa8d387 | [
"MIT"
] | 29 | 2017-08-28T20:57:01.000Z | 2022-03-11T14:03:38.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 39.217391 | 113 | 0.665188 |
from copy import deepcopy
from typing import TYPE_CHECKING
from azure.core import PipelineClient
from msrest import Deserializer, Serializer
from ._configuration import AutoRestHeadTestServiceConfiguration
from .operations import HttpSuccessOperations
if TYPE_CHECKING:
from typing import Any, Dict, ... | true | true |
f713c0cb8c9f0306d03c4ed99fa96bed9e43aa74 | 713 | py | Python | assignment/migrations/0008_auto_20201218_1203.py | Magesh-sam/E-Assignment | 241252e88b0526afbb97a01b9b1814d693688885 | [
"MIT"
] | 1 | 2020-12-23T07:04:51.000Z | 2020-12-23T07:04:51.000Z | assignment/migrations/0008_auto_20201218_1203.py | Magesh-sam/E-Assignment | 241252e88b0526afbb97a01b9b1814d693688885 | [
"MIT"
] | null | null | null | assignment/migrations/0008_auto_20201218_1203.py | Magesh-sam/E-Assignment | 241252e88b0526afbb97a01b9b1814d693688885 | [
"MIT"
] | null | null | null | # Generated by Django 3.1.4 on 2020-12-18 06:33
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('assignment', '0007_document'),
]
operations = [
migrations.RenameField(
model_name='document',
old_name='description... | 24.586207 | 63 | 0.56662 |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('assignment', '0007_document'),
]
operations = [
migrations.RenameField(
model_name='document',
old_name='description',
new_name='assignmentname',
... | true | true |
f713c211024b61164dea46dcd8cf5c99dd053cc0 | 8,371 | py | Python | datagateway_api/src/common/config.py | MRichards99/datagateway-api | 2e6133636fed950a16190d2f703f152c73bb5b1b | [
"Apache-2.0"
] | null | null | null | datagateway_api/src/common/config.py | MRichards99/datagateway-api | 2e6133636fed950a16190d2f703f152c73bb5b1b | [
"Apache-2.0"
] | null | null | null | datagateway_api/src/common/config.py | MRichards99/datagateway-api | 2e6133636fed950a16190d2f703f152c73bb5b1b | [
"Apache-2.0"
] | null | null | null | import json
import logging
from pathlib import Path
import sys
from typing import Optional
from pydantic import (
BaseModel,
StrictBool,
StrictInt,
StrictStr,
ValidationError,
validator,
)
log = logging.getLogger()
def validate_extension(extension):
"""
Checks that the API extension... | 38.223744 | 88 | 0.687851 | import json
import logging
from pathlib import Path
import sys
from typing import Optional
from pydantic import (
BaseModel,
StrictBool,
StrictInt,
StrictStr,
ValidationError,
validator,
)
log = logging.getLogger()
def validate_extension(extension):
extension = extension.strip()
if... | true | true |
f713c29c86cdc35f0168c2009748e732ac290b18 | 44,536 | py | Python | kolla/common/config.py | priteau/kolla | 2ee796bdce78aadaeaf42796a4f4dce9e7471ce0 | [
"Apache-2.0"
] | null | null | null | kolla/common/config.py | priteau/kolla | 2ee796bdce78aadaeaf42796a4f4dce9e7471ce0 | [
"Apache-2.0"
] | null | null | null | kolla/common/config.py | priteau/kolla | 2ee796bdce78aadaeaf42796a4f4dce9e7471ce0 | [
"Apache-2.0"
] | null | null | null | # 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 under th... | 35.374106 | 78 | 0.505793 |
import itertools
import os
from oslo_config import cfg
from oslo_config import types
from kolla.version import version_info as version
BASE_OS_DISTRO = ['centos', 'rhel', 'ubuntu', 'debian']
BASE_ARCH = ['x86_64', 'ppc64le', 'aarch64']
DEFAULT_BASE_TAGS = {
'centos': '7',
'rhel': '7',
'debia... | true | true |
f713c2cb062950ac487056e50952bf6ad98944fa | 2,603 | py | Python | azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/log_analytics_input_base_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2021-09-07T18:36:04.000Z | 2021-09-07T18:36:04.000Z | azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/log_analytics_input_base_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 2 | 2019-10-02T23:37:38.000Z | 2020-10-02T01:17:31.000Z | azure-mgmt-compute/azure/mgmt/compute/v2018_10_01/models/log_analytics_input_base_py3.py | JonathanGailliez/azure-sdk-for-python | f0f051bfd27f8ea512aea6fc0c3212ee9ee0029b | [
"MIT"
] | 1 | 2019-06-17T22:18:23.000Z | 2019-06-17T22:18:23.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes ... | 44.118644 | 201 | 0.668844 |
from msrest.serialization import Model
class LogAnalyticsInputBase(Model):
_validation = {
'blob_container_sas_uri': {'required': True},
'from_time': {'required': True},
'to_time': {'required': True},
}
_attribute_map = {
'blob_container_sas_uri': {'key': 'blob... | true | true |
f713c3f0a6eab75b579be5aed0e1103595220c9e | 7,372 | py | Python | mailchimp_marketing_asyncio/models/signup_form.py | john-parton/mailchimp-asyncio | 3865ca0867bec8f537dc1e3256aa3a160c00f8a2 | [
"Apache-2.0"
] | null | null | null | mailchimp_marketing_asyncio/models/signup_form.py | john-parton/mailchimp-asyncio | 3865ca0867bec8f537dc1e3256aa3a160c00f8a2 | [
"Apache-2.0"
] | null | null | null | mailchimp_marketing_asyncio/models/signup_form.py | john-parton/mailchimp-asyncio | 3865ca0867bec8f537dc1e3256aa3a160c00f8a2 | [
"Apache-2.0"
] | 1 | 2022-03-09T14:52:22.000Z | 2022-03-09T14:52:22.000Z | # coding: utf-8
"""
Mailchimp Marketing API
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) # noqa: E501
OpenAPI spec version: 3.0.74
Contact: apihelp@mailchimp.com
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
import... | 28.796875 | 126 | 0.589257 |
import pprint
import re
import six
class SignupForm(object):
swagger_types = {
'header': 'SignupFormHeaderOptions',
'contents': 'list[CollectionOfContentForListSignupForms]',
'styles': 'list[CollectionOfElementStyleForListSignupForms]',
'signup_form_url': 'str',
'li... | true | true |
f713c3fd343f05467d069a91846cfa29aed8d972 | 124 | py | Python | old/02/09.py | systemquant/book-pandas-for-finance | 90b7eb9be1de20a12ae72b9bb5d51424a979b174 | [
"MIT"
] | 10 | 2021-02-04T12:49:56.000Z | 2022-03-26T11:28:11.000Z | old/02/09.py | systemquant/book-pandas-for-finance | 90b7eb9be1de20a12ae72b9bb5d51424a979b174 | [
"MIT"
] | 1 | 2022-03-24T03:47:14.000Z | 2022-03-24T03:54:52.000Z | old/02/09.py | systemquant/book-pandas-for-finance | 90b7eb9be1de20a12ae72b9bb5d51424a979b174 | [
"MIT"
] | 4 | 2021-07-17T16:50:15.000Z | 2022-03-22T05:55:34.000Z | data = [("000060", 8.25), ("000020", 5.75), ("039490", 1.3)]
def 정렬규칙(x):
return x[1]
data.sort(key=정렬규칙)
print(data)
| 15.5 | 60 | 0.564516 | data = [("000060", 8.25), ("000020", 5.75), ("039490", 1.3)]
def 정렬규칙(x):
return x[1]
data.sort(key=정렬규칙)
print(data)
| true | true |
f713c43c0962dea49c922bae1e450935719dbbf8 | 3,500 | py | Python | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/features/v2021_07_01/_configuration.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 47.297297 | 125 | 0.693714 |
from typing import Any, TYPE_CHECKING
from azure.core.configuration import Configuration
from azure.core.pipeline import policies
from azure.mgmt.core.policies import ARMChallengeAuthenticationPolicy, ARMHttpLoggingPolicy
from ._version import VERSION
if TYPE_CHECKING:
from azure.core.credentials im... | true | true |
f713c66f57be20c2bd1dddc1a8ba715d1887c1ef | 822 | py | Python | cnns/nnlib/robustness/pni/code/models/noise_layer_robust.py | anonymous-user-commits/perturb-net | 66fc7c4a1234fa34b92bcc85751f0a6e23d80a23 | [
"MIT"
] | null | null | null | cnns/nnlib/robustness/pni/code/models/noise_layer_robust.py | anonymous-user-commits/perturb-net | 66fc7c4a1234fa34b92bcc85751f0a6e23d80a23 | [
"MIT"
] | null | null | null | cnns/nnlib/robustness/pni/code/models/noise_layer_robust.py | anonymous-user-commits/perturb-net | 66fc7c4a1234fa34b92bcc85751f0a6e23d80a23 | [
"MIT"
] | null | null | null | import torch.nn as nn
import torch.nn.functional as F
class noise_Conv2d(nn.Conv2d):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
padding=0, dilation=1,
groups=1, bias=True, noise_std=0.1):
super(noise_Conv2d, self).__init__(in_channels, out_chann... | 34.25 | 75 | 0.559611 | import torch.nn as nn
import torch.nn.functional as F
class noise_Conv2d(nn.Conv2d):
def __init__(self, in_channels, out_channels, kernel_size, stride=1,
padding=0, dilation=1,
groups=1, bias=True, noise_std=0.1):
super(noise_Conv2d, self).__init__(in_channels, out_chann... | true | true |
f713c7525055ce6ba983ba32bc4b5e05efb1bc80 | 2,221 | py | Python | rally/plugins/openstack/context/nova/keypairs.py | aforalee/rallyALi | 8050ca08b0e253aeb19a1cec34f33c648f00136a | [
"Apache-2.0"
] | null | null | null | rally/plugins/openstack/context/nova/keypairs.py | aforalee/rallyALi | 8050ca08b0e253aeb19a1cec34f33c648f00136a | [
"Apache-2.0"
] | null | null | null | rally/plugins/openstack/context/nova/keypairs.py | aforalee/rallyALi | 8050ca08b0e253aeb19a1cec34f33c648f00136a | [
"Apache-2.0"
] | null | null | null | # Copyright 2014: Rackspace UK
# 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... | 35.822581 | 79 | 0.677172 |
import novaclient.exceptions
from rally.common.i18n import _
from rally.common import log as logging
from rally.common import utils
from rally import osclients
from rally.plugins.openstack.context.cleanup import manager as resource_manager
from rally.task import context
LOG = logging.getLogger(__name_... | true | true |
f713c757918c68117662e36f5c6f0adb8d3638a6 | 142 | py | Python | blazingsql/__init__.py | paulhendricks/pyBlazing | 792d286054ec4ae8a0546d57ef758a60812d24c3 | [
"Apache-2.0"
] | 1 | 2020-05-28T14:06:15.000Z | 2020-05-28T14:06:15.000Z | blazingsql/__init__.py | paulhendricks/pyBlazing | 792d286054ec4ae8a0546d57ef758a60812d24c3 | [
"Apache-2.0"
] | null | null | null | blazingsql/__init__.py | paulhendricks/pyBlazing | 792d286054ec4ae8a0546d57ef758a60812d24c3 | [
"Apache-2.0"
] | null | null | null | from pyblazing.apiv2 import context
from pyblazing.apiv2 import make_context
BlazingContext = context.BlazingContext
import pyblazing.apiv2
| 20.285714 | 40 | 0.859155 | from pyblazing.apiv2 import context
from pyblazing.apiv2 import make_context
BlazingContext = context.BlazingContext
import pyblazing.apiv2
| true | true |
f713c763b71c7ae43f02b4463df5842ee7f1a936 | 5,690 | py | Python | test_scripts/test_element_and_compare_to_kratos.py | JoZimmer/ParOptBeam | 50d15d8d822a2718f2932807e06c4a7e02f866a3 | [
"BSD-3-Clause"
] | 1 | 2021-04-09T14:08:20.000Z | 2021-04-09T14:08:20.000Z | test_scripts/test_element_and_compare_to_kratos.py | JoZimmer/ParOptBeam | 50d15d8d822a2718f2932807e06c4a7e02f866a3 | [
"BSD-3-Clause"
] | 2 | 2021-04-28T15:05:01.000Z | 2021-11-10T15:12:56.000Z | test_scripts/test_element_and_compare_to_kratos.py | JoZimmer/ParOptBeam | 50d15d8d822a2718f2932807e06c4a7e02f866a3 | [
"BSD-3-Clause"
] | 2 | 2021-02-01T08:49:45.000Z | 2021-08-10T02:07:36.000Z | from source.element.cr_beam_element import CRBeamElement
import numpy as np
np.set_printoptions(suppress=False, precision=4, linewidth=100)
def test_crbeam_element_update_incremental():
material_params = {'rho': 7850, 'e': 2069000000.0, 'nu': 0.29, 'zeta': 0.05, 'lx_i': 1.2, 'is_nonlinear': True}
element_pa... | 42.462687 | 115 | 0.496485 | from source.element.cr_beam_element import CRBeamElement
import numpy as np
np.set_printoptions(suppress=False, precision=4, linewidth=100)
def test_crbeam_element_update_incremental():
material_params = {'rho': 7850, 'e': 2069000000.0, 'nu': 0.29, 'zeta': 0.05, 'lx_i': 1.2, 'is_nonlinear': True}
element_pa... | true | true |
f713c8014b3825c0746482bc5b3f6306b4660275 | 2,931 | py | Python | TangoChat/core.py | sierra-m/TangoBot | 2a7eafc391a60862b660efaee5c3b9b1c78fac8e | [
"MIT"
] | null | null | null | TangoChat/core.py | sierra-m/TangoBot | 2a7eafc391a60862b660efaee5c3b9b1c78fac8e | [
"MIT"
] | null | null | null | TangoChat/core.py | sierra-m/TangoBot | 2a7eafc391a60862b660efaee5c3b9b1c78fac8e | [
"MIT"
] | null | null | null | from typing import List
import random
import re
class Concept:
def __init__(self, name: str, options: List[str]):
self.name = name.lower()
self.options = options
def next(self):
return random.choice(self.options)
def render_to(self, template):
return [template.format(opti... | 29.606061 | 98 | 0.569089 | from typing import List
import random
import re
class Concept:
def __init__(self, name: str, options: List[str]):
self.name = name.lower()
self.options = options
def next(self):
return random.choice(self.options)
def render_to(self, template):
return [template.format(opti... | true | true |
f713c8c7f32ad47156ece2c400acb571c9609d70 | 5,669 | py | Python | tests/test_plantuml_markdown.py | getnikola/plugins | c9305572359263c719b19dc17bb6770521e08dee | [
"MIT"
] | 53 | 2015-08-14T20:28:05.000Z | 2021-06-02T00:38:23.000Z | tests/test_plantuml_markdown.py | matthew16550/nikola-plugins | fbd784ea737419dd2b5b7365549bf3cf57d66700 | [
"MIT"
] | 280 | 2015-01-10T15:57:44.000Z | 2022-03-27T20:47:08.000Z | tests/test_plantuml_markdown.py | matthew16550/nikola-plugins | fbd784ea737419dd2b5b7365549bf3cf57d66700 | [
"MIT"
] | 93 | 2015-01-26T19:39:02.000Z | 2022-03-24T17:12:42.000Z | import os
import sys
import pytest
from pytest import fixture
if sys.version_info < (3, 6):
raise pytest.skip("plantuml_markdown plugin requires Python >= 3.6", allow_module_level=True)
from tests import V8_PLUGIN_PATH
from tests.conftest import CompileResult
from v8.plantuml_markdown.plantuml_markdown import Pl... | 30.809783 | 106 | 0.550362 | import os
import sys
import pytest
from pytest import fixture
if sys.version_info < (3, 6):
raise pytest.skip("plantuml_markdown plugin requires Python >= 3.6", allow_module_level=True)
from tests import V8_PLUGIN_PATH
from tests.conftest import CompileResult
from v8.plantuml_markdown.plantuml_markdown import Pl... | true | true |
f713c9b41c726431974465bcc7603f9e84650f97 | 15,254 | py | Python | tests/exceptions.py | skulegirl/pyxero | 700d331392fada72ec0a9490e9c4896048a603b2 | [
"BSD-3-Clause"
] | null | null | null | tests/exceptions.py | skulegirl/pyxero | 700d331392fada72ec0a9490e9c4896048a603b2 | [
"BSD-3-Clause"
] | null | null | null | tests/exceptions.py | skulegirl/pyxero | 700d331392fada72ec0a9490e9c4896048a603b2 | [
"BSD-3-Clause"
] | null | null | null | from __future__ import unicode_literals
import unittest
from datetime import date
from mock import Mock, patch
from xero import Xero
from xero.exceptions import (
XeroBadRequest,
XeroExceptionUnknown,
XeroForbidden,
XeroInternalError,
XeroNotAvailable,
XeroNotFound,
XeroNotImplemented,
... | 37.571429 | 148 | 0.592631 | from __future__ import unicode_literals
import unittest
from datetime import date
from mock import Mock, patch
from xero import Xero
from xero.exceptions import (
XeroBadRequest,
XeroExceptionUnknown,
XeroForbidden,
XeroInternalError,
XeroNotAvailable,
XeroNotFound,
XeroNotImplemented,
... | true | true |
f713ca429669bcdd8b420dc01264b77dfd212b9e | 5,496 | py | Python | audio_controller/api_handler/views.py | Maxning1/MusicBox | 19b35569da31efa2d9e62aae83ddbb028a4032f7 | [
"MIT"
] | 1 | 2021-02-07T23:04:21.000Z | 2021-02-07T23:04:21.000Z | audio_controller/api_handler/views.py | Maxning1/MusicBox | 19b35569da31efa2d9e62aae83ddbb028a4032f7 | [
"MIT"
] | null | null | null | audio_controller/api_handler/views.py | Maxning1/MusicBox | 19b35569da31efa2d9e62aae83ddbb028a4032f7 | [
"MIT"
] | null | null | null | from django.shortcuts import render
from rest_framework import generics, status
from .serializers import RoomSerializer, CreateRoomSerializer, UpdateRoomSerializer
from .models import Room
from rest_framework.views import APIView
from rest_framework.response import Response
from django.http import JsonResponse
# Creat... | 43.275591 | 122 | 0.64738 | from django.shortcuts import render
from rest_framework import generics, status
from .serializers import RoomSerializer, CreateRoomSerializer, UpdateRoomSerializer
from .models import Room
from rest_framework.views import APIView
from rest_framework.response import Response
from django.http import JsonResponse
class... | true | true |
f713caaf57b9575f6fccea9f21007d77f54ac6a8 | 1,709 | py | Python | app/core/migrations/0001_initial.py | TecateWine/receipe-app-api | b181aef2abe0b9acdf2ada3f3fd3cfe674345f5f | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | TecateWine/receipe-app-api | b181aef2abe0b9acdf2ada3f3fd3cfe674345f5f | [
"MIT"
] | null | null | null | app/core/migrations/0001_initial.py | TecateWine/receipe-app-api | b181aef2abe0b9acdf2ada3f3fd3cfe674345f5f | [
"MIT"
] | null | null | null | # Generated by Django 2.1.15 on 2019-12-31 00:14
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0009_alter_user_last_name_max_length'),
]
operations = [
migrations.CreateModel(
name='User',
... | 50.264706 | 266 | 0.63897 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
('auth', '0009_alter_user_last_name_max_length'),
]
operations = [
migrations.CreateModel(
name='User',
fields=[
('id', models.Au... | true | true |
f713caea696d748be4a67cfee124977a76d0d29a | 6,072 | py | Python | idrac_powerunit/idrac_powerunit.py | anita-mithran/plugins | 3c34f4b92b9c0ae985dc3b6abfb8c952aba00cd7 | [
"BSD-2-Clause"
] | null | null | null | idrac_powerunit/idrac_powerunit.py | anita-mithran/plugins | 3c34f4b92b9c0ae985dc3b6abfb8c952aba00cd7 | [
"BSD-2-Clause"
] | null | null | null | idrac_powerunit/idrac_powerunit.py | anita-mithran/plugins | 3c34f4b92b9c0ae985dc3b6abfb8c952aba00cd7 | [
"BSD-2-Clause"
] | null | null | null | #!/usr/bin/env python
import json
import SNMPUtil
import argparse
### Monitoring iDRAC Servers - Powerunit Performance
### It uses snmpwalk command to get the hadrware data from the iDRAC Servers.
### SNMPUtil.py is used to get the snmp raw data and parsed to get the output json
### Download and install the latest v... | 42.461538 | 166 | 0.550889 |
import json
import SNMPUtil
import argparse
eption as e:
raise Exception(e)
return output_data
tdata = output_data['units']
appendkeys = False;
if not jsondata: appendkeys = True
for... | true | true |
f713cb45e38bb0e36bf56e9f6b5359fe16568126 | 342 | py | Python | examples/blogengine/email_client.py | perkinslr/nevow-py3 | 69c7a64832a176955af5534febf5a405c511b5eb | [
"MIT"
] | 1 | 2019-11-11T13:58:23.000Z | 2019-11-11T13:58:23.000Z | examples/blogengine/email_client.py | perkinslr/nevow-py3 | 69c7a64832a176955af5534febf5a405c511b5eb | [
"MIT"
] | null | null | null | examples/blogengine/email_client.py | perkinslr/nevow-py3 | 69c7a64832a176955af5534febf5a405c511b5eb | [
"MIT"
] | 1 | 2019-02-28T13:46:26.000Z | 2019-02-28T13:46:26.000Z | import sys, smtplib
fromaddr = input("From: ")
toaddrs = input("To: ").split(',')
print("Enter message, end with ^D:")
msg = ''
while 1:
line = sys.stdin.readline()
if not line:
break
msg = msg + line
# The actual mail send
server = smtplib.SMTP('localhost', 2500)
server.sendmail(fromaddr, toaddr... | 20.117647 | 40 | 0.640351 | import sys, smtplib
fromaddr = input("From: ")
toaddrs = input("To: ").split(',')
print("Enter message, end with ^D:")
msg = ''
while 1:
line = sys.stdin.readline()
if not line:
break
msg = msg + line
server = smtplib.SMTP('localhost', 2500)
server.sendmail(fromaddr, toaddrs, msg)
server.quit()
| true | true |
f713cb5fa957f4d1f054a5bfa70d75e73f16384a | 51,194 | py | Python | discord/client.py | PanKlipcio/discord.py | 9bb4bd8003dcabcfbedfbfc8fe0cee91543c13a5 | [
"MIT"
] | 1 | 2021-07-23T05:56:09.000Z | 2021-07-23T05:56:09.000Z | discord/client.py | PanKlipcio/discord.py | 9bb4bd8003dcabcfbedfbfc8fe0cee91543c13a5 | [
"MIT"
] | null | null | null | discord/client.py | PanKlipcio/discord.py | 9bb4bd8003dcabcfbedfbfc8fe0cee91543c13a5 | [
"MIT"
] | null | null | null | """
The MIT License (MIT)
Copyright (c) 2015-present Rapptz
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, merg... | 33.858466 | 144 | 0.591476 |
from __future__ import annotations
import asyncio
import logging
import signal
import sys
import traceback
from typing import Any, Callable, Coroutine, Dict, Generator, Iterable, List, Optional, Sequence, TYPE_CHECKING, Tuple, TypeVar, Union
import aiohttp
from .user import User
from .invite import Invite
from .tem... | true | true |
f713cb7a449c438cfcce5616f6b52263398ce8bd | 1,121 | py | Python | wowp/tests/test_special_actors.py | coobas/wowp | 9d029b1c26ef65f83a5cd0279a45fe0cb4933ad9 | [
"MIT"
] | 2 | 2017-12-14T08:10:28.000Z | 2017-12-29T13:31:33.000Z | wowp/tests/test_special_actors.py | coobas/wowp | 9d029b1c26ef65f83a5cd0279a45fe0cb4933ad9 | [
"MIT"
] | 4 | 2019-10-19T08:55:04.000Z | 2019-10-22T06:50:18.000Z | wowp/tests/test_special_actors.py | coobas/wowp | 9d029b1c26ef65f83a5cd0279a45fe0cb4933ad9 | [
"MIT"
] | 1 | 2017-12-15T08:22:30.000Z | 2017-12-15T08:22:30.000Z | from __future__ import absolute_import, division, print_function, unicode_literals
from wowp.actors.special import Splitter, Chain
from wowp.schedulers import NaiveScheduler
from wowp.actors import FuncActor
from wowp.util import ConstructorWrapper
def test_splitter():
splitter = Splitter(multiplicity=2, inport_n... | 27.341463 | 82 | 0.668153 | from __future__ import absolute_import, division, print_function, unicode_literals
from wowp.actors.special import Splitter, Chain
from wowp.schedulers import NaiveScheduler
from wowp.actors import FuncActor
from wowp.util import ConstructorWrapper
def test_splitter():
splitter = Splitter(multiplicity=2, inport_n... | true | true |
f713cb97fe8f101eb0e99515797b7446859d5de2 | 25,409 | py | Python | project_generator/tools/uvision.py | knowledgejunkie/project_generator | f43c4a3e20d938a0738a4be19a4179ac22168945 | [
"Apache-2.0"
] | 12 | 2015-01-02T06:59:55.000Z | 2019-12-15T17:08:12.000Z | project_generator/tools/uvision.py | knowledgejunkie/project_generator | f43c4a3e20d938a0738a4be19a4179ac22168945 | [
"Apache-2.0"
] | 65 | 2015-01-16T07:38:08.000Z | 2015-07-06T18:16:48.000Z | project_generator/tools/uvision.py | knowledgejunkie/project_generator | f43c4a3e20d938a0738a4be19a4179ac22168945 | [
"Apache-2.0"
] | 7 | 2015-01-17T09:55:54.000Z | 2019-04-11T06:27:54.000Z | # Copyright 2015 0xc0170
#
# 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, soft... | 44.971681 | 202 | 0.587272 |
import os
import subprocess
import shutil
import logging
import xmltodict
import copy
import re
from codecs import open
from os import getcwd
from os.path import basename, join, normpath
from collections import OrderedDict
from project_generator_definitions.definitions import ProGenDef
from .tool import... | true | true |
f713cd4ccb4c24a7f9ce8c790aa81d48b9aee1af | 947 | py | Python | VSR/Model/__init__.py | soufiomario/VideoSuperResolution | 3677e562df4674b9ff827feecce1806de15131a4 | [
"MIT"
] | 2 | 2021-08-05T08:32:03.000Z | 2021-08-12T09:33:44.000Z | VSR/Model/__init__.py | AbdulMoqeet/VideoSuperResolution | 82c3347554561ff9dfb5e86d9cf0a55239ca662e | [
"MIT"
] | null | null | null | VSR/Model/__init__.py | AbdulMoqeet/VideoSuperResolution | 82c3347554561ff9dfb5e86d9cf0a55239ca662e | [
"MIT"
] | null | null | null | # Copyright (c) 2017-2020 Wenyi Tang.
# Author: Wenyi Tang
# Email: wenyitang@outlook.com
# Update: 2020 - 2 - 7
from importlib import import_module
from ..Backend import BACKEND
__all__ = [
'get_model',
'list_supported_models'
]
def get_model(name: str):
name = name.lower()
try:
if BACKEND == 'pyt... | 26.305556 | 80 | 0.685322 |
from importlib import import_module
from ..Backend import BACKEND
__all__ = [
'get_model',
'list_supported_models'
]
def get_model(name: str):
name = name.lower()
try:
if BACKEND == 'pytorch':
return import_module('.Models', 'VSR.Backend.Torch').get_model(name)
elif BACKEND == 'tensorflow... | true | true |
f713cdf606aeb3b1f7bc76ca741473444b804ed1 | 9,735 | py | Python | advent_of_code/flood_advent/utils.py | mflood/whimsical | e39865193b232cc8fc280f371a76f7ac7d07d782 | [
"Apache-2.0"
] | null | null | null | advent_of_code/flood_advent/utils.py | mflood/whimsical | e39865193b232cc8fc280f371a76f7ac7d07d782 | [
"Apache-2.0"
] | null | null | null | advent_of_code/flood_advent/utils.py | mflood/whimsical | e39865193b232cc8fc280f371a76f7ac7d07d782 | [
"Apache-2.0"
] | null | null | null |
import argparse
import re
import logging
import requests
from typing import Iterator
from typing import List
LOGGER_NAME="advent"
def init_logging(is_verbose: bool):
"""
Creates standard logging for the logger_name passed in
"""
logger = logging.getLogger(LOGGER_NAME)
logger.setLevel(logging.... | 29.5 | 110 | 0.543606 |
import argparse
import re
import logging
import requests
from typing import Iterator
from typing import List
LOGGER_NAME="advent"
def init_logging(is_verbose: bool):
logger = logging.getLogger(LOGGER_NAME)
logger.setLevel(logging.DEBUG)
channel = logging.StreamHandler()
if is_verbose:
channel... | true | true |
f713ce651c7de767cc25c8ccf653e5662e9a0c44 | 1,924 | py | Python | discooord/extras/examples/email.py | TehBigA/discooord | 9a290686664a0c8636958058e28d4115f45c1cc3 | [
"MIT"
] | null | null | null | discooord/extras/examples/email.py | TehBigA/discooord | 9a290686664a0c8636958058e28d4115f45c1cc3 | [
"MIT"
] | 1 | 2016-12-15T02:03:58.000Z | 2016-12-15T02:07:42.000Z | discooord/extras/examples/email.py | TehBigA/discooord | 9a290686664a0c8636958058e28d4115f45c1cc3 | [
"MIT"
] | null | null | null | import poplib
from ...utils import Timer
class EmailChecker(Timer):
'''WARNING: This uses POP3 and by default deletes the emails it reads!'''
username = None
password = None
server = None
port = None
on_mail = None
delete = None
def __init__(self, username, password, server, port=1... | 26 | 108 | 0.519751 | import poplib
from ...utils import Timer
class EmailChecker(Timer):
username = None
password = None
server = None
port = None
on_mail = None
delete = None
def __init__(self, username, password, server, port=110, on_mail=None, delete=True, interval=60):
super(EmailChecker, self)... | true | true |
f713d06ec761c4d741cb3e1577bfbd581ebd687d | 439 | py | Python | python_roms_modules/calc_etat.py | NoeLahaye/InTideScat_JGR | 6849e82b3cda816ca7bdc6ab207e2c857a3f5f5f | [
"CC0-1.0"
] | null | null | null | python_roms_modules/calc_etat.py | NoeLahaye/InTideScat_JGR | 6849e82b3cda816ca7bdc6ab207e2c857a3f5f5f | [
"CC0-1.0"
] | null | null | null | python_roms_modules/calc_etat.py | NoeLahaye/InTideScat_JGR | 6849e82b3cda816ca7bdc6ab207e2c857a3f5f5f | [
"CC0-1.0"
] | null | null | null | from __future__ import print_function, division
import numpy as np
from R_tools import rho2u,rho2v
def calc_etat(ubar,vbar,hflow,pm,pn):
''' compute divergence of barotropic momentum (units m/h)
arrays are (x,y) ordered -- hflow is full column depth (SSE-z_bot)'''
return -( np.diff(rho2u(hflow/pn)*ubar,ax... | 36.583333 | 73 | 0.649203 | from __future__ import print_function, division
import numpy as np
from R_tools import rho2u,rho2v
def calc_etat(ubar,vbar,hflow,pm,pn):
return -( np.diff(rho2u(hflow/pn)*ubar,axis=0)[:,1:-1] \
+ np.diff(rho2v(hflow/pm)*vbar,axis=1)[1:-1,:] )\
* pm[1:-1,1:-1]*pn[1:-1,1:-1]*3600.
| true | true |
f713d171e7f9310b01643e43fb15f40f64caac4e | 172 | py | Python | starter/__init__.py | sjdillon/starter | 6ed51098008c5ae18d1f809dddf81aa3de3e8ce2 | [
"MIT"
] | null | null | null | starter/__init__.py | sjdillon/starter | 6ed51098008c5ae18d1f809dddf81aa3de3e8ce2 | [
"MIT"
] | null | null | null | starter/__init__.py | sjdillon/starter | 6ed51098008c5ae18d1f809dddf81aa3de3e8ce2 | [
"MIT"
] | null | null | null | from .starter_class import StarterClass
from .boto_manager import BotoClientManager
from .config import _CONFIG
__all__ = ['BotoClientManager', 'StarterClass', '_CONFIG']
| 28.666667 | 58 | 0.813953 | from .starter_class import StarterClass
from .boto_manager import BotoClientManager
from .config import _CONFIG
__all__ = ['BotoClientManager', 'StarterClass', '_CONFIG']
| true | true |
f713d17923015c16f0e5cb322bcc69119cb35958 | 8,925 | py | Python | beaconrunner/eth2spec/test/phase0/block_processing/test_process_voluntary_exit.py | casparschwa/beaconrunner | d5430e08b120462beea19f65a4cf335ec9eb9134 | [
"MIT"
] | 5 | 2021-04-08T23:17:19.000Z | 2021-11-02T18:24:37.000Z | tests/core/pyspec/eth2spec/test/phase0/block_processing/test_process_voluntary_exit.py | sthagen/eth2.0-specs | 27b0d1f32e4ce430dd13b447c273a0f64b637066 | [
"CC0-1.0"
] | 127 | 2021-04-09T21:15:08.000Z | 2021-10-19T03:58:26.000Z | tests/core/pyspec/eth2spec/test/phase0/block_processing/test_process_voluntary_exit.py | sthagen/eth2.0-specs | 27b0d1f32e4ce430dd13b447c273a0f64b637066 | [
"CC0-1.0"
] | 1 | 2022-03-06T06:08:17.000Z | 2022-03-06T06:08:17.000Z | from eth2spec.test.context import spec_state_test, expect_assertion_error, always_bls, with_all_phases
from eth2spec.test.helpers.keys import pubkey_to_privkey
from eth2spec.test.helpers.voluntary_exits import sign_voluntary_exit
def run_voluntary_exit_processing(spec, state, signed_voluntary_exit, valid=True):
"... | 39.666667 | 117 | 0.779384 | from eth2spec.test.context import spec_state_test, expect_assertion_error, always_bls, with_all_phases
from eth2spec.test.helpers.keys import pubkey_to_privkey
from eth2spec.test.helpers.voluntary_exits import sign_voluntary_exit
def run_voluntary_exit_processing(spec, state, signed_voluntary_exit, valid=True):
v... | true | true |
f713d1e1ac8fca799a224fac9038388cc476ff10 | 815 | py | Python | src/personal/migrations/0001_initial.py | shopeyinwale/blog | ade90270f4b23cd11e4529e98ad9c6d78b3eae8e | [
"bzip2-1.0.6"
] | null | null | null | src/personal/migrations/0001_initial.py | shopeyinwale/blog | ade90270f4b23cd11e4529e98ad9c6d78b3eae8e | [
"bzip2-1.0.6"
] | 9 | 2021-03-19T11:55:42.000Z | 2022-02-10T14:35:53.000Z | src/personal/migrations/0001_initial.py | shopeyin5/blog | ade90270f4b23cd11e4529e98ad9c6d78b3eae8e | [
"bzip2-1.0.6"
] | null | null | null | # Generated by Django 2.2.2 on 2019-07-29 19:03
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Question',
fields=[
('id', models.AutoField... | 29.107143 | 117 | 0.537423 |
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Question',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize... | true | true |
f713d1f837f20b709093ad344a72f4801ea14f31 | 618 | py | Python | Funny_Js_Crack/16-虾米音乐翻页JS破解/taoyizhu.py | qqizai/Func_Js_Crack | 8cc8586107fecace4b71d0519cfbc760584171b1 | [
"MIT"
] | 18 | 2020-12-09T06:49:46.000Z | 2022-01-27T03:20:36.000Z | Funny_Js_Crack/16-虾米音乐翻页JS破解/taoyizhu.py | sumerzhang/Func_Js_Crack | 8cc8586107fecace4b71d0519cfbc760584171b1 | [
"MIT"
] | null | null | null | Funny_Js_Crack/16-虾米音乐翻页JS破解/taoyizhu.py | sumerzhang/Func_Js_Crack | 8cc8586107fecace4b71d0519cfbc760584171b1 | [
"MIT"
] | 9 | 2020-12-20T08:52:09.000Z | 2021-12-19T09:13:09.000Z | import execjs
def get_js_function(js_path, func_name, *func_args):
'''
获取指定目录下的js代码, 并且指定js代码中函数的名字以及函数的参数。
:param js_path: js代码的位置
:param func_name: js代码中函数的名字
:param func_args: js代码中函数的参数
:return: 返回调用js函数的结果
'''
with open(js_path, encoding='utf-8') as fp:
js = fp.read()
... | 24.72 | 62 | 0.621359 | import execjs
def get_js_function(js_path, func_name, *func_args):
with open(js_path, encoding='utf-8') as fp:
js = fp.read()
ctx = execjs.compile(js)
return ctx.call(func_name, func_args[0], func_args[1])
if __name__ == '__main__':
passwd = get_js_function('xiami.js', '_s', ""... | true | true |
f713d227c0e8d9d2e332c2aa25f7e7796a1d69f9 | 5,727 | py | Python | samples/client/petstore-security-test/python/petstore_api/apis/fake_api.py | zhiyongwang/swagger-codegen | fb3d4e61bb5c7f5ea343d8eac2d0842c2ffe685e | [
"Apache-2.0"
] | 1 | 2019-05-24T14:03:57.000Z | 2019-05-24T14:03:57.000Z | samples/client/petstore-security-test/python/petstore_api/apis/fake_api.py | zhiyongwang/swagger-codegen | fb3d4e61bb5c7f5ea343d8eac2d0842c2ffe685e | [
"Apache-2.0"
] | null | null | null | samples/client/petstore-security-test/python/petstore_api/apis/fake_api.py | zhiyongwang/swagger-codegen | fb3d4e61bb5c7f5ea343d8eac2d0842c2ffe685e | [
"Apache-2.0"
] | null | null | null | # coding: utf-8
"""
Swagger Petstore */ ' \" =end -- \\r\\n \\n \\r
This spec is mainly for testing Petstore server and contains fake endpoints, models. Please do not use this for any other purpose. Special characters: \" \\ */ ' \" =end --
OpenAPI spec version: 1.0.0 */ ' \" =end -- \\r\\n \\n \... | 38.959184 | 184 | 0.572027 |
from __future__ import absolute_import
import sys
import os
import re
from six import iteritems
from ..configuration import Configuration
from ..api_client import ApiClient
class FakeApi(object):
def __init__(self, api_client=None):
config = Configuration()
if api_client:
self... | true | true |
f713d2dfa0940a023fa6c459b519fe50dd7f2466 | 407 | py | Python | onem2m/util.py | franjial/ghostm2m | 2e7898761237cb12f4fddd55665b3a15fb84dddc | [
"MIT"
] | null | null | null | onem2m/util.py | franjial/ghostm2m | 2e7898761237cb12f4fddd55665b3a15fb84dddc | [
"MIT"
] | null | null | null | onem2m/util.py | franjial/ghostm2m | 2e7898761237cb12f4fddd55665b3a15fb84dddc | [
"MIT"
] | null | null | null | class Singleton(type):
"""
"""
_instances = {}
def __call__(cls, *args, **kwargs):
"""
Possible changes to the value of the `__init__` argument do not affect
the returned instance.
"""
if cls not in cls._instances:
instance = super().__call__(*args, ... | 27.133333 | 78 | 0.560197 | class Singleton(type):
_instances = {}
def __call__(cls, *args, **kwargs):
if cls not in cls._instances:
instance = super().__call__(*args, **kwargs)
cls._instances[cls] = instance
return cls._instances[cls] | true | true |
f713d2ef2e90d06531edcf6a3efcb4a1542366f0 | 397 | py | Python | to_do_list/to_do_list/asgi.py | sanjaykrishnan/to-do-list-backend | fbc322aac526afc69ba2385a4d503b2e9fd096c0 | [
"MIT"
] | null | null | null | to_do_list/to_do_list/asgi.py | sanjaykrishnan/to-do-list-backend | fbc322aac526afc69ba2385a4d503b2e9fd096c0 | [
"MIT"
] | null | null | null | to_do_list/to_do_list/asgi.py | sanjaykrishnan/to-do-list-backend | fbc322aac526afc69ba2385a4d503b2e9fd096c0 | [
"MIT"
] | null | null | null | """
ASGI config for to_do_list project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.1/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SE... | 23.352941 | 78 | 0.788413 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'to_do_list.settings')
application = get_asgi_application()
| true | true |
f713d3498adfa663334e6f44326c17d626d08012 | 8,682 | py | Python | qa/rpc-tests/rawtransactions.py | v1nc0/macclone14.3 | e91fb2566205b5f4e2e1b2384cd93309a24261c4 | [
"MIT"
] | null | null | null | qa/rpc-tests/rawtransactions.py | v1nc0/macclone14.3 | e91fb2566205b5f4e2e1b2384cd93309a24261c4 | [
"MIT"
] | null | null | null | qa/rpc-tests/rawtransactions.py | v1nc0/macclone14.3 | e91fb2566205b5f4e2e1b2384cd93309a24261c4 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2014-2016 The Machinecoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""rawtranscation RPCs QA test.
# Tests the following RPCs:
# - createrawtransaction
# - signra... | 44.752577 | 147 | 0.644782 |
from test_framework.test_framework import MachinecoinTestFramework
from test_framework.util import *
class RawTransactionsTest(MachinecoinTestFramework):
def __init__(self):
super().__init__()
self.setup_clean_chain = True
self.num_nodes = 3
def setup_network(self, split=False):... | true | true |
f713d39ef8fd6add029331f47f48d93c39cfe6a7 | 1,039 | py | Python | tests/test_laguerre_inv.py | jab0707/UncertainSCI | 569c978c4f67dd7bb37e730276f2a376b8639235 | [
"MIT"
] | 1 | 2021-07-25T17:02:36.000Z | 2021-07-25T17:02:36.000Z | tests/test_laguerre_inv.py | jab0707/UncertainSCI | 569c978c4f67dd7bb37e730276f2a376b8639235 | [
"MIT"
] | 70 | 2020-04-09T17:38:12.000Z | 2022-03-18T17:06:09.000Z | tests/test_laguerre_inv.py | jab0707/UncertainSCI | 569c978c4f67dd7bb37e730276f2a376b8639235 | [
"MIT"
] | 7 | 2020-05-28T17:26:05.000Z | 2021-08-13T21:41:10.000Z | import unittest
import numpy as np
from UncertainSCI.families import LaguerrePolynomials
class IDistTestCase(unittest.TestCase):
"""
Tests for (Laguerre polynomial) inversed induced distributions.
"""
def test_idistinv_laguerre(self):
"""Evaluation of Laguerre inversed induced distribution ... | 25.341463 | 94 | 0.596728 | import unittest
import numpy as np
from UncertainSCI.families import LaguerrePolynomials
class IDistTestCase(unittest.TestCase):
def test_idistinv_laguerre(self):
rho = 11*np.random.random() - 1
L = LaguerrePolynomials(rho=rho)
n = int(np.ceil(10*np.random.rand(1))[0])
... | true | true |
f713d436a3df74fcfc8664b3066de64a6190fdca | 2,796 | py | Python | michiru/modules/logger.py | moeIO/michiru | f1bafb90c2d82debee9e0402b426eba592038f24 | [
"WTFPL"
] | 1 | 2018-01-25T15:39:12.000Z | 2018-01-25T15:39:12.000Z | michiru/modules/logger.py | moeIO/michiru | f1bafb90c2d82debee9e0402b426eba592038f24 | [
"WTFPL"
] | null | null | null | michiru/modules/logger.py | moeIO/michiru | f1bafb90c2d82debee9e0402b426eba592038f24 | [
"WTFPL"
] | null | null | null | # Logging module.
import os
from os import path
import datetime
from michiru import config
from michiru.modules import hook
## Module information.
__name__ = 'logger'
__author__ = 'Shiz'
__license__ = 'WTFPL'
__desc__ = 'Log activities.'
config.item('logger.path', path.join('{local}', 'logs', '{server}', '{channel... | 31.772727 | 150 | 0.670601 |
import os
from os import path
import datetime
from michiru import config
from michiru.modules import hook
__author__ = 'Shiz'
__license__ = 'WTFPL'
__desc__ = 'Log activities.'
config.item('logger.path', path.join('{local}', 'logs', '{server}', '{channel}.log'))
config.item('logger.date_format', '%Y/%m/%d %H:%M:%... | true | true |
f713d6cad3bb95d57bc72cad5289e97d9d7f1a6b | 2,225 | py | Python | coding/fetching_RE.py | Thyme-The-Herb/Web-Scraping | 80fbc0370ebb0152ce778fe5b985f1703ec4839b | [
"MIT"
] | null | null | null | coding/fetching_RE.py | Thyme-The-Herb/Web-Scraping | 80fbc0370ebb0152ce778fe5b985f1703ec4839b | [
"MIT"
] | null | null | null | coding/fetching_RE.py | Thyme-The-Herb/Web-Scraping | 80fbc0370ebb0152ce778fe5b985f1703ec4839b | [
"MIT"
] | null | null | null | from bs4 import BeautifulSoup
from selenium import webdriver
import selenium as se
from selenium.webdriver.chrome.options import Options
# This is the temporary url **** Need to make it dynamic
url = "https://www.realestate.co.nz/residential/sale?by=featured&lct=d225&maxba=2&maxbe=4&maxp=1400000&ql=80&scat=1"
# Compo... | 40.454545 | 124 | 0.670112 | from bs4 import BeautifulSoup
from selenium import webdriver
import selenium as se
from selenium.webdriver.chrome.options import Options
url = "https://www.realestate.co.nz/residential/sale?by=featured&lct=d225&maxba=2&maxbe=4&maxp=1400000&ql=80&scat=1"
options = se.webdriver.ChromeOptions() ... | true | true |
f713d72ab83c2f34fb2686c69f7fc5ff3e1e1581 | 13,844 | py | Python | tests/messages_tests/base.py | kkoralsky/django | 924af638e4d4fb8eb46a19ac0cafcb2e83480cf3 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/messages_tests/base.py | kkoralsky/django | 924af638e4d4fb8eb46a19ac0cafcb2e83480cf3 | [
"PSF-2.0",
"BSD-3-Clause"
] | null | null | null | tests/messages_tests/base.py | kkoralsky/django | 924af638e4d4fb8eb46a19ac0cafcb2e83480cf3 | [
"PSF-2.0",
"BSD-3-Clause"
] | 1 | 2020-02-06T10:31:51.000Z | 2020-02-06T10:31:51.000Z | from django import http
from django.contrib.messages import constants, get_level, set_level, utils
from django.contrib.messages.api import MessageFailure
from django.contrib.messages.constants import DEFAULT_LEVELS
from django.contrib.messages.storage import base, default_storage
from django.contrib.messages.storage.ba... | 36.917333 | 99 | 0.630526 | from django import http
from django.contrib.messages import constants, get_level, set_level, utils
from django.contrib.messages.api import MessageFailure
from django.contrib.messages.constants import DEFAULT_LEVELS
from django.contrib.messages.storage import base, default_storage
from django.contrib.messages.storage.ba... | true | true |
f713d8b7796ccabed8db2a1d07dbfb48bd718890 | 6,406 | py | Python | opps/containers/admin.py | mauler/opps | 24a8d81434b8c17eafc894d51c1c3adbb67d7d07 | [
"MIT"
] | null | null | null | opps/containers/admin.py | mauler/opps | 24a8d81434b8c17eafc894d51c1c3adbb67d7d07 | [
"MIT"
] | null | null | null | opps/containers/admin.py | mauler/opps | 24a8d81434b8c17eafc894d51c1c3adbb67d7d07 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import json
from django.contrib import admin
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from .models import Container, ContainerImage, Mirror
from .models import ContainerBox, ContainerBoxConta... | 35.005464 | 78 | 0.642523 |
import json
from django.contrib import admin
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
from .models import Container, ContainerImage, Mirror
from .models import ContainerBox, ContainerBoxContainers
from .forms import ContainerBoxContain... | true | true |
f713d8ddadb695ef35b334d9bdb44a3532a72d22 | 448 | py | Python | map_objects/tile.py | MikeChunko/rogue | 7974a55f732ec03c47321ccbd8950ff8856bd5f2 | [
"BSD-2-Clause"
] | null | null | null | map_objects/tile.py | MikeChunko/rogue | 7974a55f732ec03c47321ccbd8950ff8856bd5f2 | [
"BSD-2-Clause"
] | null | null | null | map_objects/tile.py | MikeChunko/rogue | 7974a55f732ec03c47321ccbd8950ff8856bd5f2 | [
"BSD-2-Clause"
] | null | null | null | # File name: tile.py
# Author: Michael Chunko
# Python Version: 3.7
# This file contains the class representing a tile on a map
class Tile:
def __init__(self, blocked=True, block_sight=None, seen=False):
self.blocked = blocked
# By default, a blocked tile also blocks sight
if block_sight... | 23.578947 | 67 | 0.640625 |
class Tile:
def __init__(self, blocked=True, block_sight=None, seen=False):
self.blocked = blocked
if block_sight is None:
self.block_sight = blocked
else:
self.block_sight = blocked
self.seen = seen
| true | true |
f713d947567df750231c71b544d1b9bc0cef1b63 | 1,978 | py | Python | panoptes_aggregation/running_reducers/tess_user_reducer.py | alnah005/aggregation-for-caesar | b2422f4c007857531ac3ff2636b567adb667dd0c | [
"Apache-2.0"
] | 9 | 2018-04-11T13:44:32.000Z | 2022-03-09T16:39:26.000Z | panoptes_aggregation/running_reducers/tess_user_reducer.py | alnah005/aggregation-for-caesar | b2422f4c007857531ac3ff2636b567adb667dd0c | [
"Apache-2.0"
] | 217 | 2017-07-27T09:20:15.000Z | 2022-03-21T11:15:33.000Z | panoptes_aggregation/running_reducers/tess_user_reducer.py | hughdickinson/aggregation-for-caesar | d6bca0a1126e0397315d5773401c71075c33ee2f | [
"Apache-2.0"
] | 10 | 2018-11-12T21:36:48.000Z | 2022-02-07T11:50:03.000Z | '''
TESS User Reducer
-----------------
This module porvides functions to calculate uesr weights for the TESS project.
Extracts are from Ceasars `PluckFieldExtractor`.
'''
from .running_reducer_wrapper import running_reducer_wrapper
import numpy as np
@running_reducer_wrapper(relevant_reduction=True)
def tess_user_re... | 31.903226 | 103 | 0.636502 | from .running_reducer_wrapper import running_reducer_wrapper
import numpy as np
@running_reducer_wrapper(relevant_reduction=True)
def tess_user_reducer(data, **kwargs):
success = [d['success'] for d in data[0]['feedback']]
store = kwargs.pop('store')
relevant_reduction = kwargs.pop('relevant_reduction')[0... | true | true |
f713d95566b79d1732ae7300f0c55116e9f79c8b | 1,017 | bzl | Python | tools/bazel_deps.bzl | rockwotj/run_binary_example | cf613bdb2cd2c1e411e50ad53980d1c022498a88 | [
"MIT"
] | null | null | null | tools/bazel_deps.bzl | rockwotj/run_binary_example | cf613bdb2cd2c1e411e50ad53980d1c022498a88 | [
"MIT"
] | null | null | null | tools/bazel_deps.bzl | rockwotj/run_binary_example | cf613bdb2cd2c1e411e50ad53980d1c022498a88 | [
"MIT"
] | null | null | null | # Third-party dependencies fetched by Bazel
# Unlike WORKSPACE, the content of this file is unordered.
# We keep them separate to make the WORKSPACE file more maintainable.
# Install the nodejs "bootstrap" package
# This provides the basic tools for running and packaging nodejs programs in Bazel
load("@bazel_tools//to... | 44.217391 | 112 | 0.72468 |
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def fetch_dependencies():
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = "e79c08a488cc5ac40981987d862c7320cee8741122a2649e9b08e850b6f20442",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/down... | true | true |
f713d960b564dbd5eb8dda394cd9127243da4a02 | 70 | py | Python | preprocess/__init__.py | failyang/tensorflow-examples | 48da6cd25138d448a4ddf7710e8abab0392c453c | [
"MIT"
] | null | null | null | preprocess/__init__.py | failyang/tensorflow-examples | 48da6cd25138d448a4ddf7710e8abab0392c453c | [
"MIT"
] | null | null | null | preprocess/__init__.py | failyang/tensorflow-examples | 48da6cd25138d448a4ddf7710e8abab0392c453c | [
"MIT"
] | null | null | null | from __future__ import absolute_import
from .data_prep import img_pad | 23.333333 | 38 | 0.871429 | from __future__ import absolute_import
from .data_prep import img_pad | true | true |
f713d990afcddb0cf000499c6b9a2e37b17481d0 | 171 | py | Python | cors/resources/checkandremove.py | ziransun/wpt | ab8f451eb39eb198584d547f5d965ef54df2a86a | [
"BSD-3-Clause"
] | 8 | 2019-04-09T21:13:05.000Z | 2021-11-23T17:25:18.000Z | cors/resources/checkandremove.py | ziransun/wpt | ab8f451eb39eb198584d547f5d965ef54df2a86a | [
"BSD-3-Clause"
] | 21 | 2021-03-31T19:48:22.000Z | 2022-03-12T00:24:53.000Z | cors/resources/checkandremove.py | ziransun/wpt | ab8f451eb39eb198584d547f5d965ef54df2a86a | [
"BSD-3-Clause"
] | 11 | 2019-04-12T01:20:16.000Z | 2021-11-23T17:25:02.000Z | def main(request, response):
token = request.GET.first("token")
if request.server.stash.remove(token) is not None:
return "1"
else:
return "0"
| 24.428571 | 54 | 0.614035 | def main(request, response):
token = request.GET.first("token")
if request.server.stash.remove(token) is not None:
return "1"
else:
return "0"
| true | true |
f713d9fffdd9e54ff53f7c4fe224e681bcfb2723 | 8,280 | py | Python | pcdet/models/backbones_3d/spconv_unet.py | StarGazer1995/OpenPCDet | 4af33e8badb0c8e68c7c94c71b0ec5667aad2348 | [
"Apache-2.0"
] | null | null | null | pcdet/models/backbones_3d/spconv_unet.py | StarGazer1995/OpenPCDet | 4af33e8badb0c8e68c7c94c71b0ec5667aad2348 | [
"Apache-2.0"
] | null | null | null | pcdet/models/backbones_3d/spconv_unet.py | StarGazer1995/OpenPCDet | 4af33e8badb0c8e68c7c94c71b0ec5667aad2348 | [
"Apache-2.0"
] | null | null | null | import torch
import torch.nn as nn
import spconv
from functools import partial
from .spconv_backbone import post_act_block
from ...utils import common_utils
class SparseBasicBlock(spconv.SparseModule):
expansion = 1
def __init__(self, inplanes, planes, stride=1, downsample=None, indice_key=None, norm_fn=None... | 40 | 117 | 0.608937 | import torch
import torch.nn as nn
import spconv
from functools import partial
from .spconv_backbone import post_act_block
from ...utils import common_utils
class SparseBasicBlock(spconv.SparseModule):
expansion = 1
def __init__(self, inplanes, planes, stride=1, downsample=None, indice_key=None, norm_fn=None... | true | true |
f713dab102d61680c2f1adddccfa93c5ec27ff39 | 1,194 | py | Python | rich/_lru_cache.py | hultner-technologies/rich | 7a50f9d3f299a2ed44e36aa241e0a15323add317 | [
"MIT"
] | 2 | 2021-05-11T19:27:06.000Z | 2021-05-12T06:08:08.000Z | rich/_lru_cache.py | hultner-technologies/rich | 7a50f9d3f299a2ed44e36aa241e0a15323add317 | [
"MIT"
] | 2 | 2020-05-09T12:42:28.000Z | 2020-05-09T14:44:04.000Z | rich/_lru_cache.py | hultner-technologies/rich | 7a50f9d3f299a2ed44e36aa241e0a15323add317 | [
"MIT"
] | 1 | 2020-05-04T08:13:02.000Z | 2020-05-04T08:13:02.000Z | from collections import OrderedDict
from typing import Dict, Generic, Mapping, TypeVar
CacheKey = TypeVar("CacheKey")
CacheValue = TypeVar("CacheValue")
class LRUCache(Generic[CacheKey, CacheValue], OrderedDict):
"""
A dictionary-like container that stores a given maximum items.
If an additional item i... | 34.114286 | 83 | 0.675042 | from collections import OrderedDict
from typing import Dict, Generic, Mapping, TypeVar
CacheKey = TypeVar("CacheKey")
CacheValue = TypeVar("CacheValue")
class LRUCache(Generic[CacheKey, CacheValue], OrderedDict):
def __init__(self, cache_size: int) -> None:
self.cache_size = cache_size
super(LR... | true | true |
f713dac0b4da63916336159fcfe479841e59456e | 1,950 | py | Python | hdfs_namenode/setup.py | byronwolfman/integrations-core | e89d31cf760cb0829a524929104eb400ec93ec2e | [
"BSD-3-Clause"
] | null | null | null | hdfs_namenode/setup.py | byronwolfman/integrations-core | e89d31cf760cb0829a524929104eb400ec93ec2e | [
"BSD-3-Clause"
] | null | null | null | hdfs_namenode/setup.py | byronwolfman/integrations-core | e89d31cf760cb0829a524929104eb400ec93ec2e | [
"BSD-3-Clause"
] | null | null | null | # (C) Datadog, Inc. 2018
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
# Always prefer setuptools over distutils
from setuptools import setup
# To use a consistent encoding
from codecs import open
from os import path
HERE = path.abspath(path.dirname(__file__))
# Get the long descr... | 28.26087 | 83 | 0.691282 |
from setuptools import setup
from codecs import open
from os import path
HERE = path.abspath(path.dirname(__file__))
with open(path.join(HERE, 'README.md'), encoding='utf-8') as f:
long_description = f.read()
ABOUT = {}
with open(path.join(HERE, "datadog_checks", "hdfs_namenode", "__about__.py")) as f:
... | true | true |
f713dbe3cb55df4e874d577344ebd20f05b89914 | 5,140 | py | Python | temp/train_cnn.py | ChenLi0830/Clevo-Categorization-Service | 44b509786849a6dce610171d86e5da68ad748b4b | [
"Apache-2.0"
] | null | null | null | temp/train_cnn.py | ChenLi0830/Clevo-Categorization-Service | 44b509786849a6dce610171d86e5da68ad748b4b | [
"Apache-2.0"
] | null | null | null | temp/train_cnn.py | ChenLi0830/Clevo-Categorization-Service | 44b509786849a6dce610171d86e5da68ad748b4b | [
"Apache-2.0"
] | null | null | null | '''This example demonstrates the use of Convolution1D for text classification.
'''
from __future__ import print_function
import sys
sys.path.append('/Users/wangwei/anaconda2/envs/python3_keras/lib/python3.6/site-packages')
from keras.preprocessing import sequence
from keras.models import Sequential
from keras.layer... | 29.54023 | 93 | 0.630739 |
from __future__ import print_function
import sys
sys.path.append('/Users/wangwei/anaconda2/envs/python3_keras/lib/python3.6/site-packages')
from keras.preprocessing import sequence
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation
from keras.layers import Embedding
from keras.l... | true | true |
f713dda96bfadd28ecfe9efd69a5b821b0f53e52 | 19,840 | py | Python | cogs/boards.py | wpmjones/donationbot | dd2913df09b61d4fe4738fe9df14ff8bc4ec6f95 | [
"MIT"
] | null | null | null | cogs/boards.py | wpmjones/donationbot | dd2913df09b61d4fe4738fe9df14ff8bc4ec6f95 | [
"MIT"
] | null | null | null | cogs/boards.py | wpmjones/donationbot | dd2913df09b61d4fe4738fe9df14ff8bc4ec6f95 | [
"MIT"
] | null | null | null | import asyncio
import asyncpg
import coc
import discord
import logging
import math
from collections import namedtuple
from datetime import datetime
from discord.ext import commands, tasks
from cogs.utils.db_objects import DatabaseMessage
from cogs.utils.formatters import CLYTable, get_render_type
from cogs.utils impo... | 39.055118 | 111 | 0.526563 | import asyncio
import asyncpg
import coc
import discord
import logging
import math
from collections import namedtuple
from datetime import datetime
from discord.ext import commands, tasks
from cogs.utils.db_objects import DatabaseMessage
from cogs.utils.formatters import CLYTable, get_render_type
from cogs.utils impo... | true | true |
f713de87a046a2be2116ea80ff02e9b22a5d08de | 24,907 | py | Python | modules/s3/s3notify.py | sahana/eden-core | 6af086d0617e84483aa74317c897ecffbe232596 | [
"MIT"
] | 2 | 2018-04-06T08:18:21.000Z | 2021-09-17T11:45:00.000Z | modules/s3/s3notify.py | sahana/eden-core | 6af086d0617e84483aa74317c897ecffbe232596 | [
"MIT"
] | 2 | 2015-02-14T18:58:17.000Z | 2015-02-24T07:22:39.000Z | modules/s3/s3notify.py | sahana/eden-core | 6af086d0617e84483aa74317c897ecffbe232596 | [
"MIT"
] | 3 | 2015-02-11T10:31:26.000Z | 2021-09-17T11:46:29.000Z | # -*- coding: utf-8 -*-
""" S3 Notifications
@copyright: 2011-2021 (c) Sahana Software Foundation
@license: MIT
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
re... | 37.680787 | 88 | 0.500462 |
import datetime
import json
import os
import string
import sys
from io import StringIO
from urllib.parse import urlencode
from urllib import parse as urlparse
from urllib import request as urllib2
from urllib.request import urlopen
from urllib.error import HTTPError
from uuid import uuid4
from gluon import current... | true | true |
f713de958e85322d46d14b9bb7f2720bd65ba18e | 577 | py | Python | tests/test_int.py | stephend017/pyparcel | addef8f5da9fce8d0204fb264f7735bd607c9619 | [
"MIT"
] | null | null | null | tests/test_int.py | stephend017/pyparcel | addef8f5da9fce8d0204fb264f7735bd607c9619 | [
"MIT"
] | null | null | null | tests/test_int.py | stephend017/pyparcel | addef8f5da9fce8d0204fb264f7735bd607c9619 | [
"MIT"
] | null | null | null | import struct
import unittest
from typing import List
import pyparcel
DATA: List[int] = [
-1 << 31,
-1000,
-57,
-26,
-20,
-5,
-2,
-1,
0,
1,
2,
5,
20,
57,
1000,
(1 << 31) - 1,
]
class MyTestCase(unittest.TestCase):
def test_pack(self):
for i... | 14.794872 | 73 | 0.535529 | import struct
import unittest
from typing import List
import pyparcel
DATA: List[int] = [
-1 << 31,
-1000,
-57,
-26,
-20,
-5,
-2,
-1,
0,
1,
2,
5,
20,
57,
1000,
(1 << 31) - 1,
]
class MyTestCase(unittest.TestCase):
def test_pack(self):
for i... | true | true |
f713df1edf0e8bc7dd726bc88abbe1a02611bb76 | 2,984 | py | Python | adamp/sgdp.py | MOONJOOYOUNG/AdamP | 64a63106a2ac62bcbe90627f2a83ec1b488f3416 | [
"MIT"
] | 1 | 2021-07-09T21:00:57.000Z | 2021-07-09T21:00:57.000Z | adamp/sgdp.py | MOONJOOYOUNG/AdamP | 64a63106a2ac62bcbe90627f2a83ec1b488f3416 | [
"MIT"
] | null | null | null | adamp/sgdp.py | MOONJOOYOUNG/AdamP | 64a63106a2ac62bcbe90627f2a83ec1b488f3416 | [
"MIT"
] | null | null | null | """
AdamP
Copyright (c) 2020-present NAVER Corp.
MIT license
"""
import torch
import torch.nn as nn
from torch.optim.optimizer import Optimizer, required
import math
class SGDP(Optimizer):
def __init__(self, params, lr=required, momentum=0, dampening=0,
weight_decay=0, nesterov=False, eps=1e-8, d... | 32.086022 | 115 | 0.529491 |
import torch
import torch.nn as nn
from torch.optim.optimizer import Optimizer, required
import math
class SGDP(Optimizer):
def __init__(self, params, lr=required, momentum=0, dampening=0,
weight_decay=0, nesterov=False, eps=1e-8, delta=0.1, wd_ratio=0.1):
defaults = dict(lr=lr, momentum=... | true | true |
f713dfb9ff4a0320ae7a2df342bfd77d79da60df | 1,422 | py | Python | api/api.py | PranavPusarla/WeightTracker | 16a4241b44535555d924ec39d1969b6e13c4d0a9 | [
"MIT"
] | null | null | null | api/api.py | PranavPusarla/WeightTracker | 16a4241b44535555d924ec39d1969b6e13c4d0a9 | [
"MIT"
] | null | null | null | api/api.py | PranavPusarla/WeightTracker | 16a4241b44535555d924ec39d1969b6e13c4d0a9 | [
"MIT"
] | null | null | null | from flask import Flask, jsonify, send_file, url_for
import data_functions
from datetime import datetime
app = Flask(__name__) #__name__ is a special variable in python that creates an instance of the web app
@app.route("/", methods =['GET'])
def hello():
return ("Hello World")
@app.route("/hello")
def helloo():... | 37.421053 | 103 | 0.734177 | from flask import Flask, jsonify, send_file, url_for
import data_functions
from datetime import datetime
app = Flask(__name__)
@app.route("/", methods =['GET'])
def hello():
return ("Hello World")
@app.route("/hello")
def helloo():
return "Hello Not World"
@app.route("/total_loss/<first_name>/<last_name>",... | true | true |
f713e15ef2d53b7068d6ee22edb42b05f24f1d54 | 337 | py | Python | torch_nlp_utils/common/checks.py | Nemexur/torch_data_utils | c3949f29ffb0b206ddee15dd8b83a34654ff11f3 | [
"Apache-2.0"
] | 2 | 2020-06-14T15:00:25.000Z | 2020-06-15T06:03:28.000Z | torch_nlp_utils/common/checks.py | Nemexur/torch-nlp-utils | c3949f29ffb0b206ddee15dd8b83a34654ff11f3 | [
"Apache-2.0"
] | null | null | null | torch_nlp_utils/common/checks.py | Nemexur/torch-nlp-utils | c3949f29ffb0b206ddee15dd8b83a34654ff11f3 | [
"Apache-2.0"
] | 1 | 2020-06-15T06:03:12.000Z | 2020-06-15T06:03:12.000Z | class ConfigurationError(Exception):
"""
The exception raised by any object when it's misconfigured
(e.g. missing properties, invalid properties, unknown properties).
"""
def __init__(self, message):
super().__init__()
self.message = message
def __str__(self):
return re... | 25.923077 | 70 | 0.658754 | class ConfigurationError(Exception):
def __init__(self, message):
super().__init__()
self.message = message
def __str__(self):
return repr(self.message)
| true | true |
f713e2f59198bac6d20cc010ae1e11de776dd8f8 | 2,655 | py | Python | databuilder/setup.py | abhishek-ch/amundsen | 0988547cd4e551488001f8327dd5db67198d9060 | [
"Apache-2.0"
] | null | null | null | databuilder/setup.py | abhishek-ch/amundsen | 0988547cd4e551488001f8327dd5db67198d9060 | [
"Apache-2.0"
] | null | null | null | databuilder/setup.py | abhishek-ch/amundsen | 0988547cd4e551488001f8327dd5db67198d9060 | [
"Apache-2.0"
] | 1 | 2021-07-19T11:30:55.000Z | 2021-07-19T11:30:55.000Z | # Copyright Contributors to the Amundsen project.
# SPDX-License-Identifier: Apache-2.0
from setuptools import find_packages, setup
__version__ = '4.3.1'
requirements = [
"neo4j-driver>=1.7.2,<4.0",
"pytz>=2018.4",
"statsd>=3.2.1",
"retrying>=1.3.3",
"requests>=2.23.0,<3.0",
"elasticsearch>... | 21.24 | 78 | 0.583804 |
from setuptools import find_packages, setup
__version__ = '4.3.1'
requirements = [
"neo4j-driver>=1.7.2,<4.0",
"pytz>=2018.4",
"statsd>=3.2.1",
"retrying>=1.3.3",
"requests>=2.23.0,<3.0",
"elasticsearch>=6.2.0,<7.0",
"pyhocon>=0.3.42",
"unidecode",
"Jinja2>=2.10.0,<2.12",
... | true | true |
f713e34b34f9d2fa0ac1d2261cc79b95c3f4b50f | 27,503 | py | Python | performer/fast_attention/jax/fast_attention.py | deepneuralmachine/google-research | d2ce2cf0f5c004f8d78bfeddf6e88e88f4840231 | [
"Apache-2.0"
] | 7 | 2021-06-15T05:54:29.000Z | 2022-02-21T06:57:06.000Z | performer/fast_attention/jax/fast_attention.py | deepneuralmachine/google-research | d2ce2cf0f5c004f8d78bfeddf6e88e88f4840231 | [
"Apache-2.0"
] | 12 | 2021-08-25T16:15:31.000Z | 2022-02-10T05:10:37.000Z | performer/fast_attention/jax/fast_attention.py | deepneuralmachine/google-research | d2ce2cf0f5c004f8d78bfeddf6e88e88f4840231 | [
"Apache-2.0"
] | 5 | 2021-11-25T07:40:17.000Z | 2022-03-22T11:13:39.000Z | # coding=utf-8
# Copyright 2021 The Google Research 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 applicab... | 38.198611 | 141 | 0.612406 |
import abc
from collections.abc import Iterable
import functools
from absl import logging
import gin
import jax
from jax import lax
from jax import random
import jax.numpy as jnp
import numpy as onp
gin.external_configurable(jnp.cos, 'jcos')
gin.external_configurable(jnp.sin, 'jsin')
gin.external_... | true | true |
f713e45808fac231d5822afc0ad72188540cb0ee | 788 | py | Python | mars/services/web/tests/extra_handler.py | ConanoutlooklvTBS/mars | 7030566fd9e9fc02b6b4064ef7bd86f6c24a2f60 | [
"Apache-2.0"
] | 2,413 | 2018-12-06T09:37:11.000Z | 2022-03-30T15:47:39.000Z | mars/services/web/tests/extra_handler.py | ConanoutlooklvTBS/mars | 7030566fd9e9fc02b6b4064ef7bd86f6c24a2f60 | [
"Apache-2.0"
] | 1,335 | 2018-12-07T03:06:18.000Z | 2022-03-31T11:45:57.000Z | mars/services/web/tests/extra_handler.py | ConanoutlooklvTBS/mars | 7030566fd9e9fc02b6b4064ef7bd86f6c24a2f60 | [
"Apache-2.0"
] | 329 | 2018-12-07T03:12:41.000Z | 2022-03-29T21:49:57.000Z | # Copyright 1999-2021 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... | 30.307692 | 74 | 0.748731 |
from ..core import MarsRequestHandler
class ExtraTestHandler(MarsRequestHandler):
def get(self):
self.write('Test')
web_handlers = {
'/api/extra_test': ExtraTestHandler
}
| true | true |
f713e54ac61b29b80119ca3f3e51c995911ef04d | 1,294 | bzl | Python | dotnet/private/actions/resx_net.bzl | nolen777/rules_mono | b49c210478c2240fcc7be655c9fc37d751610fb1 | [
"Apache-2.0"
] | null | null | null | dotnet/private/actions/resx_net.bzl | nolen777/rules_mono | b49c210478c2240fcc7be655c9fc37d751610fb1 | [
"Apache-2.0"
] | null | null | null | dotnet/private/actions/resx_net.bzl | nolen777/rules_mono | b49c210478c2240fcc7be655c9fc37d751610fb1 | [
"Apache-2.0"
] | null | null | null | load(
"@rules_mono//dotnet/private:providers.bzl",
"DotnetLibrary",
)
def _make_runner_arglist(dotnet, source, output):
args = dotnet.actions.args()
args.add("/useSourcePath")
if type(source) == "Target":
args.add_all(source.files)
else:
args.add(source)
args.add(output)
... | 23.107143 | 83 | 0.572643 | load(
"@rules_mono//dotnet/private:providers.bzl",
"DotnetLibrary",
)
def _make_runner_arglist(dotnet, source, output):
args = dotnet.actions.args()
args.add("/useSourcePath")
if type(source) == "Target":
args.add_all(source.files)
else:
args.add(source)
args.add(output)
... | true | true |
f713e55caf6b99004ecc3241794afbf437dab6fc | 1,098 | py | Python | python/main.py | jamesGadoury/robot-search | d7ec99aef71acb113240437321d3b2868c67cf30 | [
"MIT"
] | 1 | 2020-12-28T15:30:48.000Z | 2020-12-28T15:30:48.000Z | python/main.py | jamesGadoury/robot-search | d7ec99aef71acb113240437321d3b2868c67cf30 | [
"MIT"
] | null | null | null | python/main.py | jamesGadoury/robot-search | d7ec99aef71acb113240437321d3b2868c67cf30 | [
"MIT"
] | null | null | null | import pathgraph
import robotsearch
import unittest
class TestGraphMethods(unittest.TestCase):
def test_create_undirected_graph(self):
self.assertTrue(isinstance(pathgraph.graph_by_type("undirected"), pathgraph.UndirectedGraph))
def test_create_directed_graph(self):
self.assertTrue(isinst... | 37.862069 | 101 | 0.73224 | import pathgraph
import robotsearch
import unittest
class TestGraphMethods(unittest.TestCase):
def test_create_undirected_graph(self):
self.assertTrue(isinstance(pathgraph.graph_by_type("undirected"), pathgraph.UndirectedGraph))
def test_create_directed_graph(self):
self.assertTrue(isinst... | true | true |
f713e5f6c485bc439394846d31e1724342ae0b37 | 13,276 | py | Python | qtp_diversity/tests/test_validate.py | antgonza/qtp-diversity | 0c2ec84711decf798ea6ffdb3e97dc9582ba4035 | [
"BSD-3-Clause"
] | null | null | null | qtp_diversity/tests/test_validate.py | antgonza/qtp-diversity | 0c2ec84711decf798ea6ffdb3e97dc9582ba4035 | [
"BSD-3-Clause"
] | null | null | null | qtp_diversity/tests/test_validate.py | antgonza/qtp-diversity | 0c2ec84711decf798ea6ffdb3e97dc9582ba4035 | [
"BSD-3-Clause"
] | null | null | null | # -----------------------------------------------------------------------------
# Copyright (c) 2014--, The Qiita Development Team.
#
# Distributed under the terms of the BSD 3-clause License.
#
# The full license is in the file LICENSE, distributed with this software.
# ------------------------------------------------... | 43.960265 | 79 | 0.597017 |
from unittest import main
from tempfile import mkdtemp, mkstemp
from os.path import exists, isdir, join
from os import remove, close
from shutil import rmtree
from json import dumps
from skbio.stats.distance import randdm
from skbio import OrdinationResults
from qiita_client import ArtifactInfo
from qiita_clie... | true | true |
f713e63d648cc648889f7311c7603febef324301 | 1,113 | py | Python | __scraping__/bit.do - requests/main.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 140 | 2017-02-21T22:49:04.000Z | 2022-03-22T17:51:58.000Z | __scraping__/bit.do - requests/main.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 5 | 2017-12-02T19:55:00.000Z | 2021-09-22T23:18:39.000Z | __scraping__/bit.do - requests/main.py | whitmans-max/python-examples | 881a8f23f0eebc76816a0078e19951893f0daaaa | [
"MIT"
] | 79 | 2017-01-25T10:53:33.000Z | 2022-03-11T16:13:57.000Z |
# date: 2019.04.21
# https://stackoverflow.com/a/55778640/1832058
import requests
# not need Sessions
s = requests.Session()
s.headers.update({
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Encoding': 'gzip, deflate',
'Accept-Language': 'pl,en-US;q=0.7,en;q=0.3',
... | 22.26 | 90 | 0.630728 |
import requests
s = requests.Session()
s.headers.update({
'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
'Accept-Encoding': 'gzip, deflate',
'Accept-Language': 'pl,en-US;q=0.7,en;q=0.3',
'Cache-Control': 'no-cache',
'Connection': 'keep-alive',
})
headers={... | true | true |
f713e76a06efdb4f9ded490c7a6cb8a5cf4c458f | 84,590 | py | Python | astropy/coordinates/sky_coordinate.py | methane/astropy | 1a065d5ce403e226799cfb3d606fda33be0a6c08 | [
"BSD-3-Clause"
] | null | null | null | astropy/coordinates/sky_coordinate.py | methane/astropy | 1a065d5ce403e226799cfb3d606fda33be0a6c08 | [
"BSD-3-Clause"
] | null | null | null | astropy/coordinates/sky_coordinate.py | methane/astropy | 1a065d5ce403e226799cfb3d606fda33be0a6c08 | [
"BSD-3-Clause"
] | null | null | null | import re
import copy
import warnings
import operator
import numpy as np
from astropy import _erfa as erfa
from astropy.utils.compat.misc import override__dir__
from astropy import units as u
from astropy.constants import c as speed_of_light
from astropy.utils.data_info import MixinInfo
from astropy.utils import Shap... | 43.268542 | 139 | 0.60519 | import re
import copy
import warnings
import operator
import numpy as np
from astropy import _erfa as erfa
from astropy.utils.compat.misc import override__dir__
from astropy import units as u
from astropy.constants import c as speed_of_light
from astropy.utils.data_info import MixinInfo
from astropy.utils import Shap... | true | true |
f713e7b42f1da89d365885b3f25e6ebfed8d99bf | 211 | py | Python | chevah/compat/tests/normal/testing/__init__.py | chevah/compat | d22e5f551a628f8a1652c9f2eea306e17930cb8f | [
"BSD-3-Clause"
] | 5 | 2016-12-03T22:54:50.000Z | 2021-11-17T11:17:39.000Z | chevah/compat/tests/normal/testing/__init__.py | chevah/compat | d22e5f551a628f8a1652c9f2eea306e17930cb8f | [
"BSD-3-Clause"
] | 76 | 2015-01-22T16:00:31.000Z | 2022-02-09T22:13:34.000Z | chevah/compat/tests/normal/testing/__init__.py | chevah/compat | d22e5f551a628f8a1652c9f2eea306e17930cb8f | [
"BSD-3-Clause"
] | 1 | 2016-12-10T15:57:31.000Z | 2016-12-10T15:57:31.000Z | # Copyright (c) 2012 Adi Roiban.
# See LICENSE for details.
"""
Unit tests for empirical package.
"""
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
| 23.444444 | 38 | 0.796209 |
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.