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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f73f99f5c6bc8e37a9204d4a16a4a6e113fe5dfc | 16,991 | py | Python | Bot/Botconnection.py | Pyruths/DiscordRPbot | 87d4235fbec060f5bbcfabb6f2202913612ce28c | [
"MIT"
] | null | null | null | Bot/Botconnection.py | Pyruths/DiscordRPbot | 87d4235fbec060f5bbcfabb6f2202913612ce28c | [
"MIT"
] | 19 | 2018-06-21T10:51:13.000Z | 2018-06-28T01:38:38.000Z | Bot/Botconnection.py | Pyruths/DiscordRPbot | 87d4235fbec060f5bbcfabb6f2202913612ce28c | [
"MIT"
] | null | null | null | """
Author : Robin Phoeng
Date : 24/06/2018
"""
import discord
from discord.ext.commands import Bot
from discord.ext import commands
import asyncio
import time
import random
from Game import Game
import DiscordUtility
import BarFactory
from Bar import Box
Client = discord.Client()
bot = commands.... | 29.44714 | 115 | 0.55447 |
import discord
from discord.ext.commands import Bot
from discord.ext import commands
import asyncio
import time
import random
from Game import Game
import DiscordUtility
import BarFactory
from Bar import Box
Client = discord.Client()
bot = commands.Bot(command_prefix="!")
playerRole = None
GMRole =... | true | true |
f73f9b112de272e505cb728a2db1c9467a469b1c | 391 | py | Python | parking/wsgi.py | thiagomurtinho/djangoStudies | c17e922980f5f2944616fb6f6c7365f19ce07016 | [
"MIT"
] | null | null | null | parking/wsgi.py | thiagomurtinho/djangoStudies | c17e922980f5f2944616fb6f6c7365f19ce07016 | [
"MIT"
] | null | null | null | parking/wsgi.py | thiagomurtinho/djangoStudies | c17e922980f5f2944616fb6f6c7365f19ce07016 | [
"MIT"
] | null | null | null | """
WSGI config for parking project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/2.2/howto/deployment/wsgi/
"""
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTI... | 23 | 78 | 0.785166 |
import os
from django.core.wsgi import get_wsgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'parking.settings')
application = get_wsgi_application()
| true | true |
f73f9c9ec83fd452dcd6f025882f76f905f91372 | 2,048 | py | Python | centralized/cbs/a_star.py | KSHITIJBITHEL/multi_agent_path_planning | 1deb3a6d317ba11ba9b211b5e3c4118801460479 | [
"MIT"
] | 411 | 2019-05-31T06:36:03.000Z | 2022-03-31T10:24:34.000Z | centralized/cbs/a_star.py | hxdaze/multi_agent_path_planning | b516bcc4fc2099d38bc3a82d046b35cb68ecfeb6 | [
"MIT"
] | 6 | 2020-10-16T13:04:56.000Z | 2021-11-16T09:36:19.000Z | centralized/cbs/a_star.py | hxdaze/multi_agent_path_planning | b516bcc4fc2099d38bc3a82d046b35cb68ecfeb6 | [
"MIT"
] | 131 | 2019-05-31T07:59:43.000Z | 2022-03-18T05:11:28.000Z | """
AStar search
author: Ashwin Bose (@atb033)
"""
class AStar():
def __init__(self, env):
self.agent_dict = env.agent_dict
self.admissible_heuristic = env.admissible_heuristic
self.is_at_goal = env.is_at_goal
self.get_neighbors = env.get_neighbors
def reconstruct_path(self,... | 28.84507 | 105 | 0.583008 |
class AStar():
def __init__(self, env):
self.agent_dict = env.agent_dict
self.admissible_heuristic = env.admissible_heuristic
self.is_at_goal = env.is_at_goal
self.get_neighbors = env.get_neighbors
def reconstruct_path(self, came_from, current):
total_path = [current]
... | true | true |
f73f9ce54ee2ea1e5d13bc9e77854e316a49ed8b | 1,230 | py | Python | webapp/polls/migrations/0001_initial.py | franramirez688/simple-app-django | e8cb17d0ab49244564902d16d5129941b8591c89 | [
"MIT"
] | null | null | null | webapp/polls/migrations/0001_initial.py | franramirez688/simple-app-django | e8cb17d0ab49244564902d16d5129941b8591c89 | [
"MIT"
] | null | null | null | webapp/polls/migrations/0001_initial.py | franramirez688/simple-app-django | e8cb17d0ab49244564902d16d5129941b8591c89 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by Django 1.10.1 on 2016-11-22 19:33
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Crea... | 31.538462 | 114 | 0.585366 |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Choice',
fields=[
... | true | true |
f73f9de7124e8f1e53399ada5aea6b7d489a17fd | 8,991 | py | Python | download.py | pgalatic/backgrounder | e65cb0395d616f66277a1b6088f1b354c0457b58 | [
"MIT"
] | null | null | null | download.py | pgalatic/backgrounder | e65cb0395d616f66277a1b6088f1b354c0457b58 | [
"MIT"
] | null | null | null | download.py | pgalatic/backgrounder | e65cb0395d616f66277a1b6088f1b354c0457b58 | [
"MIT"
] | null | null | null | # author: Paul Galatic github.com/pgalatic
#
# file handles downloading images
#
import os
import random
import logging
import datetime
import requests
from PIL import Image
from reddit import Reddit
from PIL import ImageChops
from imgur_album_downloader.imguralbum import ImgurAlbumDownloader
NO_ERROR = 0
ERR_NOT_IMA... | 32.576087 | 96 | 0.615504 |
import os
import random
import logging
import datetime
import requests
from PIL import Image
from reddit import Reddit
from PIL import ImageChops
from imgur_album_downloader.imguralbum import ImgurAlbumDownloader
NO_ERROR = 0
ERR_NOT_IMAGE = 1
ERR_DUPLICATE_IMAGE = 2
ERR_DUPLICATE_GALLERY = 3
def get_logger():
... | true | true |
f73f9e1cc5c2d338e6511f7da9a270608239b3fd | 190 | py | Python | shoptools/contrib/accounts/__init__.py | gregplaysguitar/django-shoptools | 7af9b69409d146b3627931430714b934122a2498 | [
"BSD-3-Clause"
] | 3 | 2015-09-11T01:24:25.000Z | 2018-08-19T16:47:09.000Z | shoptools/contrib/accounts/__init__.py | gregplaysguitar/django-shoptools | 7af9b69409d146b3627931430714b934122a2498 | [
"BSD-3-Clause"
] | 29 | 2015-10-06T22:15:50.000Z | 2017-12-14T20:50:52.000Z | shoptools/contrib/accounts/__init__.py | gregplaysguitar/django-shoptools | 7af9b69409d146b3627931430714b934122a2498 | [
"BSD-3-Clause"
] | 5 | 2015-10-05T23:33:51.000Z | 2019-01-14T19:49:40.000Z | def get_account(user):
from .models import Account
return Account.objects.for_user(user)
def get_data(request):
from .util import account_data
return account_data(request)
| 21.111111 | 41 | 0.747368 | def get_account(user):
from .models import Account
return Account.objects.for_user(user)
def get_data(request):
from .util import account_data
return account_data(request)
| true | true |
f73f9e4214f31ec53980459c18ae248c7e2ac35c | 2,700 | py | Python | Banking-Inference/code.py | tbhuwan14/ga-learner-dsb-repo | 1d2271037214e6203a0ff92bae75aff32964263e | [
"MIT"
] | null | null | null | Banking-Inference/code.py | tbhuwan14/ga-learner-dsb-repo | 1d2271037214e6203a0ff92bae75aff32964263e | [
"MIT"
] | null | null | null | Banking-Inference/code.py | tbhuwan14/ga-learner-dsb-repo | 1d2271037214e6203a0ff92bae75aff32964263e | [
"MIT"
] | null | null | null | # --------------
import pandas as pd
import scipy.stats as stats
import math
import numpy as np
import warnings
warnings.filterwarnings('ignore')
#Sample_Size
sample_size=2000
#Z_Critical Score
z_critical = stats.norm.ppf(q = 0.95)
# path [File location variable]
data=pd.read_csv(path)
#C... | 23.893805 | 135 | 0.678148 |
import pandas as pd
import scipy.stats as stats
import math
import numpy as np
import warnings
warnings.filterwarnings('ignore')
sample_size=2000
z_critical = stats.norm.ppf(q = 0.95)
data=pd.read_csv(path)
data_sample=data.sample(n=sample_size,random_state=0)
sample_mean=data_sample['insta... | true | true |
f73f9e745137460756822d083bce206bf01201b3 | 1,761 | py | Python | demo_realsense.py | ahmed-shariff/robust_hand_tracking | 265da51345d65026fea6c4018ee652f295a2192d | [
"MIT"
] | 3 | 2019-11-12T18:46:37.000Z | 2020-01-26T08:19:41.000Z | demo_realsense.py | ahmed-shariff/robust_hand_tracking | 265da51345d65026fea6c4018ee652f295a2192d | [
"MIT"
] | 1 | 2019-10-07T12:14:36.000Z | 2020-08-12T19:46:58.000Z | demo_realsense.py | ahmed-shariff/robust_hand_tracking | 265da51345d65026fea6c4018ee652f295a2192d | [
"MIT"
] | 1 | 2019-11-13T16:20:21.000Z | 2019-11-13T16:20:21.000Z | from utils import *
from darknet import Darknet
import cv2
import pyrealsense2 as rs
def demo(cfgfile, weightfile):
m = Darknet(cfgfile)
m.print_network()
m.load_weights(weightfile)
print('Loading weights from %s... Done!' % (weightfile))
class_names = load_class_names(namesfile)
use_cuda = 1... | 28.403226 | 83 | 0.599091 | from utils import *
from darknet import Darknet
import cv2
import pyrealsense2 as rs
def demo(cfgfile, weightfile):
m = Darknet(cfgfile)
m.print_network()
m.load_weights(weightfile)
print('Loading weights from %s... Done!' % (weightfile))
class_names = load_class_names(namesfile)
use_cuda = 1... | true | true |
f73f9ffd549f5a4f8d6b472312582008e26497ed | 18,453 | py | Python | utility_belt/_version.py | ajsilveira/utility_belt | b593400bdbe1bcda89117615175045f6eefda74a | [
"MIT"
] | null | null | null | utility_belt/_version.py | ajsilveira/utility_belt | b593400bdbe1bcda89117615175045f6eefda74a | [
"MIT"
] | null | null | null | utility_belt/_version.py | ajsilveira/utility_belt | b593400bdbe1bcda89117615175045f6eefda74a | [
"MIT"
] | null | null | null |
# This file helps to compute a version number in source trees obtained from
# git-archive tarball (such as those provided by githubs download-from-tag
# feature). Distribution tarballs (built by setup.py sdist) and build
# directories (produced by setup.py build) will contain a much shorter file
# that just contains t... | 35.418426 | 79 | 0.58462 |
import errno
import os
import re
import subprocess
import sys
def get_keywords():
git_refnames = "$Format:%d$"
git_full = "$Format:%H$"
git_date = "$Format:%ci$"
keywords = {"refnames": git_refnames, "full": git_full, "date": git_date}
return keywords
class Version... | true | true |
f73fa0079d5e7b4d943b50a571bcacca8bb0bb54 | 2,558 | py | Python | tests/test_algolia.py | Kinto/kinto-algolia | f7bfdf795dc2073a69b7c31df1e650e2b51d05d7 | [
"Apache-2.0"
] | null | null | null | tests/test_algolia.py | Kinto/kinto-algolia | f7bfdf795dc2073a69b7c31df1e650e2b51d05d7 | [
"Apache-2.0"
] | 35 | 2018-04-11T15:14:42.000Z | 2021-06-25T15:18:04.000Z | tests/test_algolia.py | Kinto/kinto-algolia | f7bfdf795dc2073a69b7c31df1e650e2b51d05d7 | [
"Apache-2.0"
] | null | null | null | import unittest
from unittest import mock
from algoliasearch.exceptions import AlgoliaException
from . import BaseWebTest
class RecordIndexing(BaseWebTest, unittest.TestCase):
def setUp(self):
self.app.put("/buckets/bid", headers=self.headers)
self.app.put("/buckets/bid/collections/cid", header... | 41.258065 | 82 | 0.582095 | import unittest
from unittest import mock
from algoliasearch.exceptions import AlgoliaException
from . import BaseWebTest
class RecordIndexing(BaseWebTest, unittest.TestCase):
def setUp(self):
self.app.put("/buckets/bid", headers=self.headers)
self.app.put("/buckets/bid/collections/cid", header... | true | true |
f73fa03c62ec20728da0e2ff3d6fb5c4b4237e88 | 2,870 | py | Python | datasets/Pedestron_dataset.py | And1210/SRGAN | 200731d6249c674d0ed556ba287ad7a7698f88b5 | [
"MIT"
] | null | null | null | datasets/Pedestron_dataset.py | And1210/SRGAN | 200731d6249c674d0ed556ba287ad7a7698f88b5 | [
"MIT"
] | null | null | null | datasets/Pedestron_dataset.py | And1210/SRGAN | 200731d6249c674d0ed556ba287ad7a7698f88b5 | [
"MIT"
] | null | null | null | import os
import cv2
import numpy as np
import pandas as pd
from torchvision.transforms import transforms
from torch.utils.data import Dataset
from datasets.base_dataset import BaseDataset
from utils.augmenters.augment import seg
import xml.etree.ElementTree as ET
from PIL import Image
import matplotlib.pyplot as plt
... | 36.329114 | 127 | 0.64669 | import os
import cv2
import numpy as np
import pandas as pd
from torchvision.transforms import transforms
from torch.utils.data import Dataset
from datasets.base_dataset import BaseDataset
from utils.augmenters.augment import seg
import xml.etree.ElementTree as ET
from PIL import Image
import matplotlib.pyplot as plt
... | true | true |
f73fa0e7d887021f4475455ce5f0b6fd0e4178c2 | 2,995 | py | Python | sdk/cosmos/azure-cosmos/azure/cosmos/_resource_throttle_retry_policy.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/cosmos/azure-cosmos/azure/cosmos/_resource_throttle_retry_policy.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/cosmos/azure-cosmos/azure/cosmos/_resource_throttle_retry_policy.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # The MIT License (MIT)
# Copyright (c) 2014 Microsoft Corporation
# 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... | 49.098361 | 112 | 0.745576 |
from . import http_constants
class ResourceThrottleRetryPolicy(object):
def __init__(self, max_retry_attempt_count, fixed_retry_interval_in_milliseconds, max_wait_time_in_seconds):
self._max_retry_attempt_count = max_retry_attempt_count
self._fixed_retry_interval_in_milliseco... | true | true |
f73fa12df7353fdea2cb2d8967b74c105dccc570 | 2,328 | py | Python | Failed_attempts/bdwmspider_v1_requests.py | MengXiangxi/bdwmspider | fbc210ab70e13117f92838d8c4223c02b0ead207 | [
"MIT"
] | null | null | null | Failed_attempts/bdwmspider_v1_requests.py | MengXiangxi/bdwmspider | fbc210ab70e13117f92838d8c4223c02b0ead207 | [
"MIT"
] | null | null | null | Failed_attempts/bdwmspider_v1_requests.py | MengXiangxi/bdwmspider | fbc210ab70e13117f92838d8c4223c02b0ead207 | [
"MIT"
] | null | null | null | # -*- coding: UTF-8 -*-
import requests
import time
def html_parse(uid, html_content):
html_len = len(html_content)
uname = ""
duty = "user"
vip = "NA"
for i in range(0, html_len):
line_content = html_content[i].strip()
if line_content.find("bbsid") >= 1:
uname = line_co... | 36.952381 | 74 | 0.558419 |
import requests
import time
def html_parse(uid, html_content):
html_len = len(html_content)
uname = ""
duty = "user"
vip = "NA"
for i in range(0, html_len):
line_content = html_content[i].strip()
if line_content.find("bbsid") >= 1:
uname = line_content[20:-7]
if... | true | true |
f73fa1845adfc635af6ad3e8dc1ca3f36ffa130d | 2,339 | py | Python | bus.py | ondrejtichy07/next-bus | 94e8bd954b3c49028bad7c78b8159399f384ffe0 | [
"MIT"
] | null | null | null | bus.py | ondrejtichy07/next-bus | 94e8bd954b3c49028bad7c78b8159399f384ffe0 | [
"MIT"
] | null | null | null | bus.py | ondrejtichy07/next-bus | 94e8bd954b3c49028bad7c78b8159399f384ffe0 | [
"MIT"
] | null | null | null | import requests
import re
import time
import os
from datetime import datetime, timezone
from bs4 import BeautifulSoup
from sty import fg, bg, ef, rs
URL = "https://pid.cz/zastavkova-tabla/?stop=Hlavn%C3%AD&stanoviste=A"
def get_data():
try:
req = requests.get(URL)
soup = BeautifulSoup(req.conten... | 33.414286 | 129 | 0.475844 | import requests
import re
import time
import os
from datetime import datetime, timezone
from bs4 import BeautifulSoup
from sty import fg, bg, ef, rs
URL = "https://pid.cz/zastavkova-tabla/?stop=Hlavn%C3%AD&stanoviste=A"
def get_data():
try:
req = requests.get(URL)
soup = BeautifulSoup(req.conten... | true | true |
f73fa1f78a5053b83d747fb873f6f3145e19d93a | 5,482 | py | Python | PyMesh/third_party/pybind11/tests/test_iostream.py | VincentLefevre/3D-parallax | 8eab905fcc591e1bd7ddbbb01ad21427286c02e3 | [
"MIT"
] | 73 | 2021-01-05T07:25:51.000Z | 2022-03-17T20:46:01.000Z | pybind11/tests/test_iostream.py | alherit/kd-switch-cpp | 7b99e9e20eeb06fbd93b149c0bd5c5de47965f6e | [
"MIT"
] | 1 | 2021-01-05T11:45:36.000Z | 2021-01-05T20:55:28.000Z | pybind11/tests/test_iostream.py | alherit/kd-switch-cpp | 7b99e9e20eeb06fbd93b149c0bd5c5de47965f6e | [
"MIT"
] | 4 | 2021-01-05T10:27:50.000Z | 2021-01-06T12:02:57.000Z | from pybind11_tests import iostream as m
import sys
from contextlib import contextmanager
try:
# Python 3
from io import StringIO
except ImportError:
# Python 2
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
try:
# Python ... | 25.497674 | 72 | 0.602882 | from pybind11_tests import iostream as m
import sys
from contextlib import contextmanager
try:
from io import StringIO
except ImportError:
try:
from cStringIO import StringIO
except ImportError:
from StringIO import StringIO
try:
from contextlib import red... | true | true |
f73fa3e275fd4974a047a6be39bd103c334bd8e8 | 13,640 | py | Python | astroquery/skyview/core.py | eteq/astroquery | 70db53f8f047a2ee3481fd3242e6b364bc1ca639 | [
"BSD-3-Clause"
] | null | null | null | astroquery/skyview/core.py | eteq/astroquery | 70db53f8f047a2ee3481fd3242e6b364bc1ca639 | [
"BSD-3-Clause"
] | null | null | null | astroquery/skyview/core.py | eteq/astroquery | 70db53f8f047a2ee3481fd3242e6b364bc1ca639 | [
"BSD-3-Clause"
] | null | null | null | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import pprint
from bs4 import BeautifulSoup
from astropy.extern.six.moves.urllib import parse as urlparse
from astropy.extern import six
from astropy import units as u
from . import conf
from ..query import BaseQuery
from ..utils import prepend_docstr_nor... | 42.492212 | 94 | 0.568328 |
import pprint
from bs4 import BeautifulSoup
from astropy.extern.six.moves.urllib import parse as urlparse
from astropy.extern import six
from astropy import units as u
from . import conf
from ..query import BaseQuery
from ..utils import prepend_docstr_noreturns, commons, async_to_sync
__doctest_skip__ = [
'SkyV... | true | true |
f73fa44a7c480a7946b2a268d8d7e12cec99978c | 1,293 | py | Python | content/notebooks/nb_tools.py | ueapy/ueapy.github.io | 920f25f4189512a77aa6b79eae133db0f14e514a | [
"MIT"
] | 2 | 2016-02-02T06:15:38.000Z | 2016-11-28T10:31:43.000Z | content/notebooks/nb_tools.py | ueapy/ueapy.github.io | 920f25f4189512a77aa6b79eae133db0f14e514a | [
"MIT"
] | null | null | null | content/notebooks/nb_tools.py | ueapy/ueapy.github.io | 920f25f4189512a77aa6b79eae133db0f14e514a | [
"MIT"
] | 3 | 2016-01-22T11:27:08.000Z | 2018-02-09T16:20:57.000Z | import os
from datetime import datetime
def connect_notebook_to_post(name='Untitled', title='New post', tags='ipython', author='UEA'):
"""
Write a header to a markdown blog post and return an HTML string with links to the notebook.
Idea taken from http://ocefpaf.github.com/python4oceanographers
""... | 34.945946 | 146 | 0.559938 | import os
from datetime import datetime
def connect_notebook_to_post(name='Untitled', title='New post', tags='ipython', author='UEA'):
hour = datetime.utcnow().strftime('%H:%M')
date = '-'.join(name.split('-')[:3])
metadata = dict(title=title,
date=date,
hour=hour... | true | true |
f73fa5b77be8ca16201c64c4280b185333821ae0 | 13,740 | py | Python | incendio/junos/junos.py | ktbyers/incendio_old | d48007208d07c2aebe75b10669f3bcfbfabe2b51 | [
"Apache-2.0"
] | 2 | 2019-10-28T10:25:31.000Z | 2021-07-15T18:11:23.000Z | incendio/junos/junos.py | ktbyers/incendio_old | d48007208d07c2aebe75b10669f3bcfbfabe2b51 | [
"Apache-2.0"
] | 5 | 2019-09-26T21:57:27.000Z | 2019-10-31T02:44:19.000Z | incendio/junos/junos.py | ktbyers/incendio_old | d48007208d07c2aebe75b10669f3bcfbfabe2b51 | [
"Apache-2.0"
] | 1 | 2019-09-20T17:44:16.000Z | 2019-09-20T17:44:16.000Z | # -*- coding: utf-8 -*-
# Copyright 2015 Spotify AB. All rights reserved.
#
# The contents of this file are 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/LICE... | 34.78481 | 97 | 0.569578 |
import re
import json
import logging
from collections import OrderedDict
from lxml import etree
from jnpr.junos import Device
from jnpr.junos.utils.config import Config
from jnpr.junos.exception import ConfigLoadError
from jnpr.junos.exception import ConnectTimeoutError
from jnpr.junos.exception imp... | true | true |
f73fa5cb9ea62373af24e3719703f52601a23c0c | 4,349 | py | Python | c4_1026_mymaze.py | Julia-Run/Problem-Solving-with-Algorithms-and-Data-Structures-using-Python | 8c7d06e701baf524108475229b092e0fa730479f | [
"MIT"
] | null | null | null | c4_1026_mymaze.py | Julia-Run/Problem-Solving-with-Algorithms-and-Data-Structures-using-Python | 8c7d06e701baf524108475229b092e0fa730479f | [
"MIT"
] | null | null | null | c4_1026_mymaze.py | Julia-Run/Problem-Solving-with-Algorithms-and-Data-Structures-using-Python | 8c7d06e701baf524108475229b092e0fa730479f | [
"MIT"
] | null | null | null | from turtle import *
PART_OF_PATH = 'O'
TRIED = '.'
OBSTACLE = '+'
DEAD_END = '-'
# 假设or判断语句中有x个并列条件,只要第一个条件满足,就会直接进入下一步。
# 先沿着第一支一直往下算,算不通就返回上一级的第二支。。。上一级全部不通就返回上上一级的第二支。。。如此循环,确定第一个条件是T or F
class Maze(object):
def __init__(self, filename):
# 把txt文件转换成list。确认S的初始位置
rowsInMaze =... | 32.94697 | 106 | 0.55691 | from turtle import *
PART_OF_PATH = 'O'
TRIED = '.'
OBSTACLE = '+'
DEAD_END = '-'
class Maze(object):
def __init__(self, filename):
rowsInMaze = 0
colsInMaze = 0
self.mazelist = []
file = open(filename, 'r')
for line in file:
rowl... | true | true |
f73fa6fc99819e25aa5ed2c48dce10b7fb4c9afa | 5,456 | py | Python | morph_net/network_regularizers/cost_calculator.py | ORNL-BSEC/morph-net | eb1a493ca07ba4992af1f91ab3b73a6c4fb9cca8 | [
"Apache-2.0"
] | null | null | null | morph_net/network_regularizers/cost_calculator.py | ORNL-BSEC/morph-net | eb1a493ca07ba4992af1f91ab3b73a6c4fb9cca8 | [
"Apache-2.0"
] | null | null | null | morph_net/network_regularizers/cost_calculator.py | ORNL-BSEC/morph-net | eb1a493ca07ba4992af1f91ab3b73a6c4fb9cca8 | [
"Apache-2.0"
] | 1 | 2019-04-26T14:50:13.000Z | 2019-04-26T14:50:13.000Z | """CostCalculator that computes network cost or regularization loss."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
CONV2D_OPS = ('Conv2D', 'Conv2DBackpropInput', 'DepthwiseConv2dNative')
FLOP_OPS = CONV2D_OPS + ('MatMul',)
SUP... | 34.974359 | 80 | 0.703262 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import tensorflow as tf
CONV2D_OPS = ('Conv2D', 'Conv2DBackpropInput', 'DepthwiseConv2dNative')
FLOP_OPS = CONV2D_OPS + ('MatMul',)
SUPPORTED_OPS = FLOP_OPS + (
'Add', 'AddN', 'ConcatV2', 'FusedBatchNorm... | true | true |
f73fa74fa93adde5eee5b422d21e017127e4b0a1 | 402 | py | Python | .env/lib/python3.8/site-packages/aws_cdk/aws_kinesisfirehose/_jsii/__init__.py | careck/begariver-cdk | 5b88f82ae545e374712521b2eb6412c2e2a30e6a | [
"MIT"
] | null | null | null | .env/lib/python3.8/site-packages/aws_cdk/aws_kinesisfirehose/_jsii/__init__.py | careck/begariver-cdk | 5b88f82ae545e374712521b2eb6412c2e2a30e6a | [
"MIT"
] | null | null | null | .env/lib/python3.8/site-packages/aws_cdk/aws_kinesisfirehose/_jsii/__init__.py | careck/begariver-cdk | 5b88f82ae545e374712521b2eb6412c2e2a30e6a | [
"MIT"
] | null | null | null | import abc
import builtins
import datetime
import enum
import typing
import jsii
import publication
import typing_extensions
import aws_cdk.core._jsii
import constructs._jsii
__jsii_assembly__ = jsii.JSIIAssembly.load(
"@aws-cdk/aws-kinesisfirehose",
"1.108.1",
__name__[0:-6],
"aws-kinesisfirehose@1.... | 15.461538 | 43 | 0.746269 | import abc
import builtins
import datetime
import enum
import typing
import jsii
import publication
import typing_extensions
import aws_cdk.core._jsii
import constructs._jsii
__jsii_assembly__ = jsii.JSIIAssembly.load(
"@aws-cdk/aws-kinesisfirehose",
"1.108.1",
__name__[0:-6],
"aws-kinesisfirehose@1.... | true | true |
f73fa9c4609e78e2857a19ba98b920037d751d5e | 404 | py | Python | tests/test_shapely.py | rhaDHI/mikeio | eb24503d935df969eac32569a41d223d6f0e2edf | [
"BSD-3-Clause"
] | 65 | 2019-11-27T13:42:52.000Z | 2022-03-31T11:41:56.000Z | tests/test_shapely.py | rhaDHI/mikeio | eb24503d935df969eac32569a41d223d6f0e2edf | [
"BSD-3-Clause"
] | 178 | 2019-12-17T19:43:04.000Z | 2022-03-31T06:54:06.000Z | tests/test_shapely.py | rhaDHI/mikeio | eb24503d935df969eac32569a41d223d6f0e2edf | [
"BSD-3-Clause"
] | 41 | 2019-12-17T18:21:04.000Z | 2022-03-16T12:15:40.000Z | import os
import pytest
from mikeio import Dfsu
##################################################
# these tests will not run if shapely is not installed
##################################################
pytest.importorskip("shapely")
def test_to_shapely():
filename = os.path.join("tests", "testdata", "oresund... | 23.764706 | 72 | 0.537129 | import os
import pytest
from mikeio import Dfsu
| true | true |
f73faaffb933934878da485d569a0835d685c3fb | 6,734 | py | Python | haiku/_src/layer_norm_test.py | timwillhack/dm-haikuBah2 | b76a3db3a39b82c8a1ae5a81a8a0173c23c252e5 | [
"Apache-2.0"
] | 1,647 | 2020-02-21T14:24:31.000Z | 2022-03-31T04:31:34.000Z | haiku/_src/layer_norm_test.py | timwillhack/dm-haikuBah2 | b76a3db3a39b82c8a1ae5a81a8a0173c23c252e5 | [
"Apache-2.0"
] | 169 | 2020-02-21T14:07:25.000Z | 2022-03-31T13:08:28.000Z | haiku/_src/layer_norm_test.py | timwillhack/dm-haikuBah2 | b76a3db3a39b82c8a1ae5a81a8a0173c23c252e5 | [
"Apache-2.0"
] | 159 | 2020-02-21T19:31:02.000Z | 2022-03-29T12:41:35.000Z | # Copyright 2019 DeepMind Technologies Limited. 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 ... | 37.620112 | 80 | 0.651025 |
import itertools
from absl.testing import absltest
from absl.testing import parameterized
from haiku._src import initializers
from haiku._src import layer_norm
from haiku._src import test_utils
from haiku._src import transform
import jax
import jax.numpy as jnp
import numpy as np
class LayerNormTest(p... | true | true |
f73fab220dbc91f849f0e969c80530f25fa72d93 | 34,043 | py | Python | venv/Lib/site-packages/scipy/fftpack/tests/test_basic.py | unbun/snake.ai | 0c017357608dc7c06af0ca3ca57d870641461207 | [
"MIT"
] | 6,989 | 2017-07-18T06:23:18.000Z | 2022-03-31T15:58:36.000Z | venv/Lib/site-packages/scipy/fftpack/tests/test_basic.py | unbun/snake.ai | 0c017357608dc7c06af0ca3ca57d870641461207 | [
"MIT"
] | 1,978 | 2017-07-18T09:17:58.000Z | 2022-03-31T14:28:43.000Z | venv/Lib/site-packages/scipy/fftpack/tests/test_basic.py | unbun/snake.ai | 0c017357608dc7c06af0ca3ca57d870641461207 | [
"MIT"
] | 1,228 | 2017-07-18T09:03:13.000Z | 2022-03-29T05:57:40.000Z | # Created by Pearu Peterson, September 2002
from __future__ import division, print_function, absolute_import
__usage__ = """
Build fftpack:
python setup_fftpack.py build
Run tests if scipy is installed:
python -c 'import scipy;scipy.fftpack.test()'
Run tests if fftpack is not installed:
python tests/test_basic.... | 34.987667 | 161 | 0.521047 |
from __future__ import division, print_function, absolute_import
__usage__ = """
Build fftpack:
python setup_fftpack.py build
Run tests if scipy is installed:
python -c 'import scipy;scipy.fftpack.test()'
Run tests if fftpack is not installed:
python tests/test_basic.py
"""
from numpy.testing import (assert_,... | true | true |
f73fac3104c1b8033b3177b27485492a051025c5 | 55 | py | Python | test.py | diyanqi/converter | 9a0c59509c3b31ee5ed5b4ef71a8991bfd39f9f5 | [
"Apache-2.0"
] | null | null | null | test.py | diyanqi/converter | 9a0c59509c3b31ee5ed5b4ef71a8991bfd39f9f5 | [
"Apache-2.0"
] | null | null | null | test.py | diyanqi/converter | 9a0c59509c3b31ee5ed5b4ef71a8991bfd39f9f5 | [
"Apache-2.0"
] | null | null | null | from lib import *
audio2audio("test1.mp3","test1.wav") | 18.333333 | 36 | 0.727273 | from lib import *
audio2audio("test1.mp3","test1.wav") | true | true |
f73fac7dfc88703ce8ae7071b3e4b35b864c630c | 906 | py | Python | latin_scansion/textproto.py | jillianchang/LatinScansion | 2b387c8d35e526e4d1746f471d96ba9ce41a187e | [
"Apache-2.0"
] | 1 | 2021-10-06T15:59:31.000Z | 2021-10-06T15:59:31.000Z | latin_scansion/textproto.py | kylebgorman/latin_scansion | 2b387c8d35e526e4d1746f471d96ba9ce41a187e | [
"Apache-2.0"
] | 7 | 2021-10-06T14:32:58.000Z | 2022-03-28T14:34:54.000Z | latin_scansion/textproto.py | kylebgorman/latin_scansion | 2b387c8d35e526e4d1746f471d96ba9ce41a187e | [
"Apache-2.0"
] | 2 | 2022-02-17T20:05:06.000Z | 2022-02-17T20:06:57.000Z | """Code for reading and writing scansion text-format protocol buffers."""
from google.protobuf import text_format # type: ignore
from . import scansion_pb2 # type: ignore
# TODO(kbg): Add read and write functions for Verse messages, if needed.
def read_document(path: str) -> scansion_pb2.Document:
"""Reads... | 25.166667 | 73 | 0.683223 |
from google.protobuf import text_format
from . import scansion_pb2
def read_document(path: str) -> scansion_pb2.Document:
document = scansion_pb2.Document()
with open(path, "r") as source:
text_format.ParseLines(source, document)
return document
def write_document(document: scansion_pb... | true | true |
f73face1ca4bdde16ab6a447f021938f799aa52d | 1,351 | py | Python | watcher/tests/applier/messaging/test_trigger_action_plan_endpoint.py | ajaytikoo/watcher | 6dbac1f6ae7f3e10dfdcef5721fa4af7af54e159 | [
"Apache-2.0"
] | 64 | 2015-10-18T02:57:24.000Z | 2022-01-13T11:27:51.000Z | watcher/tests/applier/messaging/test_trigger_action_plan_endpoint.py | ajaytikoo/watcher | 6dbac1f6ae7f3e10dfdcef5721fa4af7af54e159 | [
"Apache-2.0"
] | null | null | null | watcher/tests/applier/messaging/test_trigger_action_plan_endpoint.py | ajaytikoo/watcher | 6dbac1f6ae7f3e10dfdcef5721fa4af7af54e159 | [
"Apache-2.0"
] | 35 | 2015-12-25T13:53:21.000Z | 2021-07-19T15:50:16.000Z | # -*- encoding: utf-8 -*-
# Copyright (c) 2015 b<>com
#
# Authors: Jean-Emile DARTOIS <jean-emile.dartois@b-com.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/... | 34.641026 | 74 | 0.713546 |
from unittest import mock
from watcher.applier.messaging import trigger
from watcher.common import utils
from watcher.tests import base
class TestTriggerActionPlan(base.TestCase):
def __init__(self, *args, **kwds):
super(TestTriggerActionPlan, self).__init__(*args, **kwds)
sel... | true | true |
f73fae25872282f55556165e302753b5a8c0c263 | 1,032 | py | Python | tests/tf/examples/test_01_getting_started.py | bschifferer/models-1 | b6042dbd1b98150cc50fd7d2cb6c07033f42fd35 | [
"Apache-2.0"
] | null | null | null | tests/tf/examples/test_01_getting_started.py | bschifferer/models-1 | b6042dbd1b98150cc50fd7d2cb6c07033f42fd35 | [
"Apache-2.0"
] | null | null | null | tests/tf/examples/test_01_getting_started.py | bschifferer/models-1 | b6042dbd1b98150cc50fd7d2cb6c07033f42fd35 | [
"Apache-2.0"
] | null | null | null | from testbook import testbook
from tests.conftest import REPO_ROOT
@testbook(REPO_ROOT / "examples/01-Getting-started.ipynb", execute=False)
def test_func(tb):
tb.inject(
"""
from unittest.mock import patch
from merlin.datasets.synthetic import generate_data
mock_train, mock_valid... | 29.485714 | 73 | 0.627907 | from testbook import testbook
from tests.conftest import REPO_ROOT
@testbook(REPO_ROOT / "examples/01-Getting-started.ipynb", execute=False)
def test_func(tb):
tb.inject(
"""
from unittest.mock import patch
from merlin.datasets.synthetic import generate_data
mock_train, mock_valid... | true | true |
f73faeda80c60f6feda0845bca9461177db00247 | 102 | py | Python | manage.py | kamujun/flask-vue-experiments | 057cb25a481ffa0ea9b1b27b131d3d8bf814dfe7 | [
"MIT"
] | 1 | 2018-09-07T00:00:58.000Z | 2018-09-07T00:00:58.000Z | manage.py | kamujun/flask-vue-experiments | 057cb25a481ffa0ea9b1b27b131d3d8bf814dfe7 | [
"MIT"
] | null | null | null | manage.py | kamujun/flask-vue-experiments | 057cb25a481ffa0ea9b1b27b131d3d8bf814dfe7 | [
"MIT"
] | null | null | null | from server.app import create_app
app = create_app()
app.run(host='127.0.0.1', port=5000, debug=True) | 25.5 | 48 | 0.735294 | from server.app import create_app
app = create_app()
app.run(host='127.0.0.1', port=5000, debug=True) | true | true |
f73faf5082d77ef649d002b15cd61650492950d2 | 6,201 | py | Python | modules/python/pylib/syslogng/debuggercli/tests/test_commandlinelexer.py | balabit-deps/balabit-os-6-syslog-ng | c8d0fafc8eaca8ed690b2ad17ab1d93820bd07f6 | [
"BSD-4-Clause-UC"
] | null | null | null | modules/python/pylib/syslogng/debuggercli/tests/test_commandlinelexer.py | balabit-deps/balabit-os-6-syslog-ng | c8d0fafc8eaca8ed690b2ad17ab1d93820bd07f6 | [
"BSD-4-Clause-UC"
] | null | null | null | modules/python/pylib/syslogng/debuggercli/tests/test_commandlinelexer.py | balabit-deps/balabit-os-6-syslog-ng | c8d0fafc8eaca8ed690b2ad17ab1d93820bd07f6 | [
"BSD-4-Clause-UC"
] | null | null | null | #############################################################################
# Copyright (c) 2015-2016 Balabit
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License version 2 as published
# by the Free Software Foundation, or (at your option) an... | 39.75 | 94 | 0.710208 | true | true | |
f73fafab6cb698711387b845d08bcfca7970e9dc | 454 | py | Python | update-participants.py | gleitz/iron-blogger | 4c8c9df107cf6d87601387ab59a5ce576f72d7e5 | [
"MIT"
] | 3 | 2017-12-18T16:01:33.000Z | 2019-08-15T00:17:19.000Z | update-participants.py | Guinster/iron-blogger | 8155e100c521710d62b8d60e625ea0a504a8af9d | [
"MIT"
] | 2 | 2016-03-05T01:54:51.000Z | 2016-07-14T16:02:06.000Z | update-participants.py | Guinster/iron-blogger | 8155e100c521710d62b8d60e625ea0a504a8af9d | [
"MIT"
] | 4 | 2015-02-22T22:42:25.000Z | 2018-03-01T21:18:57.000Z | #!/usr/bin/python
import render
import xmlrpclib
import json
from config import *
with open('secret.txt', 'r') as f:
secret = json.load(f)
passwd = secret['wordpress']['password']
x = xmlrpclib.ServerProxy(XMLRPC_ENDPOINT)
page = x.wp.getPage(BLOG_ID, PARTICIPANTS_PAGE_ID, USER, passwd)
text = render.rende... | 22.7 | 70 | 0.737885 |
import render
import xmlrpclib
import json
from config import *
with open('secret.txt', 'r') as f:
secret = json.load(f)
passwd = secret['wordpress']['password']
x = xmlrpclib.ServerProxy(XMLRPC_ENDPOINT)
page = x.wp.getPage(BLOG_ID, PARTICIPANTS_PAGE_ID, USER, passwd)
text = render.render_template('templ... | true | true |
f73fb072969e91b3f3b8ab6f0b567f6f5d1e1b1a | 446 | py | Python | kittenkollector/__init__.py | jedevc/hack-the-midlands | 679177174b8681430d0fd3cb8f0b50a272b1c6df | [
"MIT"
] | null | null | null | kittenkollector/__init__.py | jedevc/hack-the-midlands | 679177174b8681430d0fd3cb8f0b50a272b1c6df | [
"MIT"
] | null | null | null | kittenkollector/__init__.py | jedevc/hack-the-midlands | 679177174b8681430d0fd3cb8f0b50a272b1c6df | [
"MIT"
] | null | null | null | import flask
from flask import Flask
from .database import Database
app = Flask(__name__)
DATABASE = '/tmp/kittens.db'
def get_db():
db = getattr(flask.g, '_database', None)
if not db:
db = flask.g._database = Database(DATABASE)
return db
@app.teardown_appcontext
def close_db(exception):
db... | 18.583333 | 51 | 0.692825 | import flask
from flask import Flask
from .database import Database
app = Flask(__name__)
DATABASE = '/tmp/kittens.db'
def get_db():
db = getattr(flask.g, '_database', None)
if not db:
db = flask.g._database = Database(DATABASE)
return db
@app.teardown_appcontext
def close_db(exception):
db... | true | true |
f73fb09254c517b9185aad902c702759c44b4e74 | 1,057 | py | Python | irt/Irt.py | camilos-ufm/Compiler | e29f750a13323b59583f4acd7d3a51d3e29cc0e6 | [
"MIT"
] | 1 | 2020-09-20T03:24:24.000Z | 2020-09-20T03:24:24.000Z | irt/Irt.py | camilos-ufm/Compiler | e29f750a13323b59583f4acd7d3a51d3e29cc0e6 | [
"MIT"
] | null | null | null | irt/Irt.py | camilos-ufm/Compiler | e29f750a13323b59583f4acd7d3a51d3e29cc0e6 | [
"MIT"
] | 1 | 2021-09-20T19:09:52.000Z | 2021-09-20T19:09:52.000Z | import objects.Symbol as Symbol
import objects.Token as Token
import objects.Node as Node
import objects.Program as Program
import parser.ParseDFA as ParseDFA
import re
from anytree import Node as Node_any
from anytree import RenderTree
from anytree.exporter import DotExporter
class Irt:
def irt(self, main_program... | 33.03125 | 63 | 0.642384 | import objects.Symbol as Symbol
import objects.Token as Token
import objects.Node as Node
import objects.Program as Program
import parser.ParseDFA as ParseDFA
import re
from anytree import Node as Node_any
from anytree import RenderTree
from anytree.exporter import DotExporter
class Irt:
def irt(self, main_program... | true | true |
f73fb207de5264b711287d6d8d075b9ed6c379f5 | 1,521 | py | Python | spiders/moe/all/tianjin.py | JJYYYY/policy_crawl | e5f7612163c00049f2e6859e81babb3e0f30aca4 | [
"Apache-2.0"
] | 3 | 2020-04-15T07:17:04.000Z | 2020-09-21T13:06:57.000Z | spiders/moe/all/tianjin.py | JJYYYY/policy_crawl | e5f7612163c00049f2e6859e81babb3e0f30aca4 | [
"Apache-2.0"
] | null | null | null | spiders/moe/all/tianjin.py | JJYYYY/policy_crawl | e5f7612163c00049f2e6859e81babb3e0f30aca4 | [
"Apache-2.0"
] | 4 | 2020-03-23T02:09:18.000Z | 2021-04-18T08:30:08.000Z | import re
import time
from pyquery import PyQuery as pq
from policy_crawl.common.fetch import get,post
from policy_crawl.common.save import save
from policy_crawl.common.logger import alllog,errorlog
def parse_detail(html,url):
alllog.logger.info("天津市教育厅: %s"%url)
doc=pq(html)
data={}
data["title"]=d... | 28.166667 | 92 | 0.592373 | import re
import time
from pyquery import PyQuery as pq
from policy_crawl.common.fetch import get,post
from policy_crawl.common.save import save
from policy_crawl.common.logger import alllog,errorlog
def parse_detail(html,url):
alllog.logger.info("天津市教育厅: %s"%url)
doc=pq(html)
data={}
data["title"]=d... | true | true |
f73fb239e006d9422e4a37f94a664055c3ac1efb | 9,705 | py | Python | tools/python/boutiques/publisher.py | boutiques/boutiques-schema | 5a2374e87dd837cb83fec9603f32e3c9085613ba | [
"MIT"
] | 54 | 2016-07-21T19:14:13.000Z | 2021-11-16T11:49:15.000Z | tools/python/boutiques/publisher.py | boutiques/boutiques-schema | 5a2374e87dd837cb83fec9603f32e3c9085613ba | [
"MIT"
] | 539 | 2016-07-20T20:09:38.000Z | 2022-03-17T00:45:26.000Z | tools/python/boutiques/publisher.py | boutiques/boutiques-schema | 5a2374e87dd837cb83fec9603f32e3c9085613ba | [
"MIT"
] | 52 | 2016-07-22T18:09:59.000Z | 2021-02-03T15:22:55.000Z | #!/usr/bin/env python
from boutiques.validator import validate_descriptor, ValidationError
from boutiques.logger import raise_error, print_info
from boutiques.zenodoHelper import ZenodoError, ZenodoHelper
from boutiques.util.utils import customSortDescriptorByKey
import simplejson as json
import requests
import os
c... | 44.723502 | 79 | 0.566512 |
from boutiques.validator import validate_descriptor, ValidationError
from boutiques.logger import raise_error, print_info
from boutiques.zenodoHelper import ZenodoError, ZenodoHelper
from boutiques.util.utils import customSortDescriptorByKey
import simplejson as json
import requests
import os
class Publisher():
... | true | true |
f73fb2a8a307bf6009f2b5f26b6e89cf305daae6 | 3,771 | py | Python | pysimt/utils/filterchain.py | welvin21/pysimt | 6250b33dc518b3195da4fc9cc8d32ba7ada958c0 | [
"MIT"
] | 34 | 2020-09-21T10:49:57.000Z | 2022-01-08T04:50:42.000Z | pysimt/utils/filterchain.py | welvin21/pysimt | 6250b33dc518b3195da4fc9cc8d32ba7ada958c0 | [
"MIT"
] | 2 | 2021-01-08T03:52:51.000Z | 2021-09-10T07:45:05.000Z | pysimt/utils/filterchain.py | welvin21/pysimt | 6250b33dc518b3195da4fc9cc8d32ba7ada958c0 | [
"MIT"
] | 5 | 2021-04-23T09:30:51.000Z | 2022-01-09T08:40:45.000Z | import re
import pathlib
from typing import List, Union
from .resource_mgr import res_mgr
from .io import fopen
class FilterChain:
"""A sequential filter chain to post-process list of tokens. The **available
filters are:**
`c2w`: Stitches back space delimited characters to words.
Necessary for w... | 37.336634 | 86 | 0.563511 | import re
import pathlib
from typing import List, Union
from .resource_mgr import res_mgr
from .io import fopen
class FilterChain:
_FILTERS = {
'de-bpe': lambda s: s.replace("@@ ", "").replace("@@", "").replace(" ##", ""),
'de-tag': lambda s: re.sub('<[a-zA-Z][a-zA-Z]>', '', s),
... | true | true |
f73fb65f2309f803e8bcd29ae83790cf931a1922 | 442 | py | Python | packages/python/plotly/plotly/validators/isosurface/_text.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/isosurface/_text.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | packages/python/plotly/plotly/validators/isosurface/_text.py | mastermind88/plotly.py | efa70710df1af22958e1be080e105130042f1839 | [
"MIT"
] | null | null | null | import _plotly_utils.basevalidators
class TextValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="text", parent_name="isosurface", **kwargs):
super(TextValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
arra... | 34 | 79 | 0.656109 | import _plotly_utils.basevalidators
class TextValidator(_plotly_utils.basevalidators.StringValidator):
def __init__(self, plotly_name="text", parent_name="isosurface", **kwargs):
super(TextValidator, self).__init__(
plotly_name=plotly_name,
parent_name=parent_name,
arra... | true | true |
f73fb68b392a779e7c6ed88caa2756f265725fd2 | 12,961 | py | Python | secure_message/repository/retriever.py | uk-gov-mirror/ONSdigital.ras-secure-message | 741eed651eea47dd1a13c7c93b1b1796584cdf2b | [
"MIT"
] | null | null | null | secure_message/repository/retriever.py | uk-gov-mirror/ONSdigital.ras-secure-message | 741eed651eea47dd1a13c7c93b1b1796584cdf2b | [
"MIT"
] | null | null | null | secure_message/repository/retriever.py | uk-gov-mirror/ONSdigital.ras-secure-message | 741eed651eea47dd1a13c7c93b1b1796584cdf2b | [
"MIT"
] | null | null | null | import logging
from flask import jsonify
from sqlalchemy import and_, func, or_
from sqlalchemy.exc import SQLAlchemyError
from sqlalchemy.orm.exc import NoResultFound
from structlog import wrap_logger
from werkzeug.exceptions import InternalServerError, NotFound, Forbidden
from secure_message.constants import NON_SP... | 44.386986 | 119 | 0.666538 | import logging
from flask import jsonify
from sqlalchemy import and_, func, or_
from sqlalchemy.exc import SQLAlchemyError
from sqlalchemy.orm.exc import NoResultFound
from structlog import wrap_logger
from werkzeug.exceptions import InternalServerError, NotFound, Forbidden
from secure_message.constants import NON_SP... | true | true |
f73fb6bdf6bbfd188f849174455ff8c71dda6202 | 1,131 | py | Python | iot_message/factory.py | bkosciow/python_iot-1 | f3cd2bdbb75cb9afe13fecb603b5b8c026d23500 | [
"MIT"
] | null | null | null | iot_message/factory.py | bkosciow/python_iot-1 | f3cd2bdbb75cb9afe13fecb603b5b8c026d23500 | [
"MIT"
] | null | null | null | iot_message/factory.py | bkosciow/python_iot-1 | f3cd2bdbb75cb9afe13fecb603b5b8c026d23500 | [
"MIT"
] | null | null | null | #!/usr/bin/python3
import json
from iot_message.message import Message
import iot_message.exception as ex
class MessageFactory(object):
"""Class MessageFactory"""
@classmethod
def create(cls, data=None):
if data is None:
return Message()
else:
return cls._decode(dat... | 26.302326 | 91 | 0.576481 |
import json
from iot_message.message import Message
import iot_message.exception as ex
class MessageFactory(object):
@classmethod
def create(cls, data=None):
if data is None:
return Message()
else:
return cls._decode(data)
@classmethod
def _decode(cls, message... | true | true |
f73fb76832ea35f93bfd23dbc4cbfd6628576e72 | 1,917 | py | Python | tests/test_toqasm.py | minatoyuichiro/Blueqat | 1be0150ca48bf40527936561d1bf4687dbf435b4 | [
"Apache-2.0"
] | 357 | 2019-02-24T07:21:03.000Z | 2022-03-15T22:59:13.000Z | tests/test_toqasm.py | mdrft/blueqat | 6c5f26b377bc3ce0d02adec8b9132d70870b3d95 | [
"Apache-2.0"
] | 35 | 2019-03-29T02:13:09.000Z | 2021-10-15T02:19:06.000Z | tests/test_toqasm.py | mdrft/blueqat | 6c5f26b377bc3ce0d02adec8b9132d70870b3d95 | [
"Apache-2.0"
] | 49 | 2019-03-09T13:19:40.000Z | 2022-03-11T08:31:16.000Z | # Copyright 2019 The Blueqat Developers
#
# 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 i... | 26.260274 | 74 | 0.600417 |
from blueqat import Circuit
QASM = """OPENQASM 2.0;
include "qelib1.inc";
qreg q[3];
creg c[3];
h q[0];
h q[1];
cx q[0],q[1];
rz(1.23) q[2];
x q[2];
y q[2];
cz q[2],q[1];
z q[1];
ry(4.56) q[0];
u(1.0,2.0,3.0) q[0];
cu(2.0,3.0,1.0,0.5) q[2],q[0];
reset q[1];
measure q[0] -> c[0];
measure q[1] -> c[1];
mea... | true | true |
f73fb89a1b397a2ae3610f9ae1ca2cc1928b565e | 2,713 | py | Python | data/data-pipeline/data_pipeline/etl/sources/michigan_ejscreen/etl.py | snowcoding/justice40-tool | b6a6813bb5d617abf400cafc97da891618541558 | [
"CC0-1.0"
] | 59 | 2021-05-10T21:43:36.000Z | 2022-03-30T17:57:17.000Z | data/data-pipeline/data_pipeline/etl/sources/michigan_ejscreen/etl.py | snowcoding/justice40-tool | b6a6813bb5d617abf400cafc97da891618541558 | [
"CC0-1.0"
] | 1,259 | 2021-05-10T18:21:26.000Z | 2022-03-31T21:35:49.000Z | data/data-pipeline/data_pipeline/etl/sources/michigan_ejscreen/etl.py | snowcoding/justice40-tool | b6a6813bb5d617abf400cafc97da891618541558 | [
"CC0-1.0"
] | 24 | 2021-05-15T00:58:39.000Z | 2022-03-24T23:18:17.000Z | import pandas as pd
from data_pipeline.etl.base import ExtractTransformLoad
from data_pipeline.utils import get_module_logger
from data_pipeline.score import field_names
from data_pipeline.config import settings
logger = get_module_logger(__name__)
class MichiganEnviroScreenETL(ExtractTransformLoad):
"""Michiga... | 38.757143 | 134 | 0.69038 | import pandas as pd
from data_pipeline.etl.base import ExtractTransformLoad
from data_pipeline.utils import get_module_logger
from data_pipeline.score import field_names
from data_pipeline.config import settings
logger = get_module_logger(__name__)
class MichiganEnviroScreenETL(ExtractTransformLoad):
def __ini... | true | true |
f73fb8ffc4defaa425376abe9586ab0a9915b844 | 12,797 | py | Python | magnificat/drw_dataset.py | jiwoncpark/lens-classification | c1faf4dbbd4a16f2df74a34fd593ec7128750252 | [
"MIT"
] | null | null | null | magnificat/drw_dataset.py | jiwoncpark/lens-classification | c1faf4dbbd4a16f2df74a34fd593ec7128750252 | [
"MIT"
] | 21 | 2018-05-29T20:13:11.000Z | 2018-07-13T02:32:35.000Z | magnificat/drw_dataset.py | jiwoncpark/lens-classification | c1faf4dbbd4a16f2df74a34fd593ec7128750252 | [
"MIT"
] | null | null | null | import os
import os.path as osp
import numpy as np
import torch
from torch.utils.data import Dataset
from tqdm import tqdm
from torch.utils.data import DataLoader
from magnificat import drw_utils
from magnificat.cadence import LSSTCadence
class DRWDataset(Dataset):
bp_to_int = dict(zip(list('ugrizy'), range(6)))... | 39.742236 | 117 | 0.575994 | import os
import os.path as osp
import numpy as np
import torch
from torch.utils.data import Dataset
from tqdm import tqdm
from torch.utils.data import DataLoader
from magnificat import drw_utils
from magnificat.cadence import LSSTCadence
class DRWDataset(Dataset):
bp_to_int = dict(zip(list('ugrizy'), range(6)))... | true | true |
f73fb930a1317a98ee904128b7f83cb50aae25bf | 3,962 | py | Python | examples/client_side/decentralization.py | jld23/sasoptpy | f96911f04d6c0c01fce902f1f995935583df69a8 | [
"Apache-2.0"
] | 20 | 2017-12-22T18:29:55.000Z | 2021-09-12T15:04:39.000Z | examples/client_side/decentralization.py | jld23/sasoptpy | f96911f04d6c0c01fce902f1f995935583df69a8 | [
"Apache-2.0"
] | 9 | 2019-01-24T14:52:33.000Z | 2022-03-16T14:14:35.000Z | examples/client_side/decentralization.py | jld23/sasoptpy | f96911f04d6c0c01fce902f1f995935583df69a8 | [
"Apache-2.0"
] | 12 | 2017-12-22T19:37:16.000Z | 2021-07-30T21:04:03.000Z | import sasoptpy as so
import pandas as pd
def test(cas_conn):
m = so.Model(name='decentralization', session=cas_conn)
DEPTS = ['A', 'B', 'C', 'D', 'E']
CITIES = ['Bristol', 'Brighton', 'London']
benefit_data = pd.DataFrame([
['Bristol', 10, 15, 10, 20, 5],
['Brighton', 10, 20, 15, 1... | 33.016667 | 79 | 0.491923 | import sasoptpy as so
import pandas as pd
def test(cas_conn):
m = so.Model(name='decentralization', session=cas_conn)
DEPTS = ['A', 'B', 'C', 'D', 'E']
CITIES = ['Bristol', 'Brighton', 'London']
benefit_data = pd.DataFrame([
['Bristol', 10, 15, 10, 20, 5],
['Brighton', 10, 20, 15, 1... | true | true |
f73fb994147b367fef76c2be78cf458e879933f6 | 2,157 | py | Python | tests/test_chinese.py | yangwanyuan/aliyun-oss-python-sdk | df1e8fa3b1f6ab50745e5cfdc8bdbc3baba88f5f | [
"MIT"
] | 1 | 2019-12-31T03:43:56.000Z | 2019-12-31T03:43:56.000Z | tests/test_chinese.py | yangwanyuan/aliyun-oss-python-sdk | df1e8fa3b1f6ab50745e5cfdc8bdbc3baba88f5f | [
"MIT"
] | null | null | null | tests/test_chinese.py | yangwanyuan/aliyun-oss-python-sdk | df1e8fa3b1f6ab50745e5cfdc8bdbc3baba88f5f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import unittest
import sys
import oss2
from oss2 import to_bytes, to_string
from common import *
class TestChinese(OssTestCase):
def test_unicode_content(self):
key = self.random_key()
content = u'几天后,阿里巴巴为侄子和马尔佳娜举行了隆重的婚礼。'
self.bucket.put_object(key, content)
... | 31.26087 | 119 | 0.610107 |
import unittest
import sys
import oss2
from oss2 import to_bytes, to_string
from common import *
class TestChinese(OssTestCase):
def test_unicode_content(self):
key = self.random_key()
content = u'几天后,阿里巴巴为侄子和马尔佳娜举行了隆重的婚礼。'
self.bucket.put_object(key, content)
self.assertEqual... | true | true |
f73fb9cf172a2bdaf0decc24111fde17be790d59 | 10,282 | py | Python | tests/ut/python/dataset/test_pyfunc_multiprocess.py | Shigangli/mindspore | 351ce03fb2721335695afd77e8535d15670571f4 | [
"Apache-2.0"
] | 1 | 2022-02-23T09:13:43.000Z | 2022-02-23T09:13:43.000Z | tests/ut/python/dataset/test_pyfunc_multiprocess.py | Shigangli/mindspore | 351ce03fb2721335695afd77e8535d15670571f4 | [
"Apache-2.0"
] | null | null | null | tests/ut/python/dataset/test_pyfunc_multiprocess.py | Shigangli/mindspore | 351ce03fb2721335695afd77e8535d15670571f4 | [
"Apache-2.0"
] | null | null | null | # Copyright 2022 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... | 37.663004 | 110 | 0.722622 |
import numpy as np
import pytest
import mindspore.dataset as ds
import mindspore.dataset.transforms.py_transforms as py_transforms
import mindspore.dataset.vision.py_transforms as py_vision
from util import visualize_list
MNIST_DATA_DIR = "../data/dataset/testMnistData"
TF_DATA_DIR = ["../data/dataset/te... | true | true |
f73fba42208099db035e3d9c23d5b3deca4169cd | 368 | py | Python | setup.py | lotube/lotube-crawler | 2473c4dd56ea36c85ebadc76afd4747fba06a147 | [
"MIT"
] | null | null | null | setup.py | lotube/lotube-crawler | 2473c4dd56ea36c85ebadc76afd4747fba06a147 | [
"MIT"
] | null | null | null | setup.py | lotube/lotube-crawler | 2473c4dd56ea36c85ebadc76afd4747fba06a147 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
#from distutils.core import setup
from setuptools import setup
setup(name='lotube-crawler',
version='1.0',
description='LOTube video crawler',
author='lotube',
url='https://github.com/zurfyx',
packages=[
'lotube_crawler',
'lotube_crawler.base',
'lotube_crawler.extractor',
... | 18.4 | 37 | 0.679348 |
from setuptools import setup
setup(name='lotube-crawler',
version='1.0',
description='LOTube video crawler',
author='lotube',
url='https://github.com/zurfyx',
packages=[
'lotube_crawler',
'lotube_crawler.base',
'lotube_crawler.extractor',
],
install_requires=[
'requests',
],
)
| true | true |
f73fbb12aa1c25d93f541b1578a54ec9289ca84d | 938 | py | Python | beam.py | draplater/empty-parser | 05eb8c596c4e5ba26b5c954161e52bb1490ee402 | [
"Apache-2.0"
] | 9 | 2018-08-13T03:03:39.000Z | 2021-05-24T20:05:25.000Z | beam.py | draplater/empty-parser | 05eb8c596c4e5ba26b5c954161e52bb1490ee402 | [
"Apache-2.0"
] | 1 | 2018-08-03T12:37:52.000Z | 2018-08-03T15:30:41.000Z | beam.py | draplater/empty-parser | 05eb8c596c4e5ba26b5c954161e52bb1490ee402 | [
"Apache-2.0"
] | null | null | null | import heapq
from operator import attrgetter
class Beam(object):
def __init__(self, maxsize, key=attrgetter("score")):
self.key = key
self.maxsize = maxsize
self.beam = []
def push(self, x):
key = self.key(x)
if len(self.beam) < self.maxsize:
heapq.heappush... | 24.051282 | 57 | 0.574627 | import heapq
from operator import attrgetter
class Beam(object):
def __init__(self, maxsize, key=attrgetter("score")):
self.key = key
self.maxsize = maxsize
self.beam = []
def push(self, x):
key = self.key(x)
if len(self.beam) < self.maxsize:
heapq.heappush... | true | true |
f73fbc564e0828048e01df61a9a1548cb0d9da1d | 666 | py | Python | workerInfra/domain/driverInterface.py | jtom38/newsbot.worker | 6f5d93c474d21542f1af20e3b2537f26e2bcbbc3 | [
"MIT"
] | 1 | 2021-09-23T16:19:46.000Z | 2021-09-23T16:19:46.000Z | workerInfra/domain/driverInterface.py | jtom38/newsbot.worker | 6f5d93c474d21542f1af20e3b2537f26e2bcbbc3 | [
"MIT"
] | 10 | 2021-09-26T05:53:11.000Z | 2022-01-07T00:38:46.000Z | workerInfra/domain/driverInterface.py | jtom38/newsbot.worker | 6f5d93c474d21542f1af20e3b2537f26e2bcbbc3 | [
"MIT"
] | null | null | null | from abc import ABC, abstractclassmethod
class DriverInterface(ABC):
@abstractclassmethod
def start(self) -> object:
raise NotImplementedError()
@abstractclassmethod
def getContent(self) -> str:
raise NotImplementedError()
@abstractclassmethod
def goTo(self) -> None:
... | 23.785714 | 53 | 0.677177 | from abc import ABC, abstractclassmethod
class DriverInterface(ABC):
@abstractclassmethod
def start(self) -> object:
raise NotImplementedError()
@abstractclassmethod
def getContent(self) -> str:
raise NotImplementedError()
@abstractclassmethod
def goTo(self) -> None:
... | true | true |
f73fbcfa823b80a2c0818fd436bc5ba69feec56d | 15,130 | py | Python | tools/ctor_evaller.py | devnexen/emscripten | 7cec58d739efa86fda71ffb188df554c2c5f8058 | [
"MIT"
] | 1 | 2021-02-10T04:30:14.000Z | 2021-02-10T04:30:14.000Z | tools/ctor_evaller.py | devnexen/emscripten | 7cec58d739efa86fda71ffb188df554c2c5f8058 | [
"MIT"
] | null | null | null | tools/ctor_evaller.py | devnexen/emscripten | 7cec58d739efa86fda71ffb188df554c2c5f8058 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# Copyright 2016 The Emscripten Authors. All rights reserved.
# Emscripten is available under two separate licenses, the MIT license and the
# University of Illinois/NCSA Open Source License. Both these licenses can be
# found in the LICENSE file.
"""Tries to evaluate global constructors, apply... | 36.196172 | 199 | 0.674488 |
import json
import logging
import os
import subprocess
import sys
import time
sys.path.insert(1, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
from tools import shared, js_optimizer, jsrun, building
from tools.tempfiles import try_delete
js_file = sys.argv[1]
binary_file = sys.argv[2]
total_m... | true | true |
f73fbdbf87c7b280e78e852e70efb1f4e41483e7 | 772 | py | Python | type2_model.py | lvyufeng/Captcha_recognition | 9be02e3489ad30bb4442818f226e4e03ffe620f9 | [
"MIT"
] | null | null | null | type2_model.py | lvyufeng/Captcha_recognition | 9be02e3489ad30bb4442818f226e4e03ffe620f9 | [
"MIT"
] | null | null | null | type2_model.py | lvyufeng/Captcha_recognition | 9be02e3489ad30bb4442818f226e4e03ffe620f9 | [
"MIT"
] | null | null | null |
def simple_cnn():
model = Sequential()
model.add(Convolution2D(32, 1, 4, 4, border_mode='full', activation='relu'))
model.add(Convolution2D(32, 32, 4, 4, activation='relu'))
model.add(MaxPooling2D(poolsize=(3, 3)))
model.add(Dropout(0.25))
model.add(Convolution2D(64, 32, 4, 4, border_mode='full... | 42.888889 | 81 | 0.670984 |
def simple_cnn():
model = Sequential()
model.add(Convolution2D(32, 1, 4, 4, border_mode='full', activation='relu'))
model.add(Convolution2D(32, 32, 4, 4, activation='relu'))
model.add(MaxPooling2D(poolsize=(3, 3)))
model.add(Dropout(0.25))
model.add(Convolution2D(64, 32, 4, 4, border_mode='full... | true | true |
f73fbdcc8619f3f6499a378dc4f305d527afff23 | 436 | py | Python | src/share_rest_api/setup.py | flecoqui/sharing-data-rest-api | a468861c941099f3a1546f764e76194f6a9ff066 | [
"MIT"
] | null | null | null | src/share_rest_api/setup.py | flecoqui/sharing-data-rest-api | a468861c941099f3a1546f764e76194f6a9ff066 | [
"MIT"
] | null | null | null | src/share_rest_api/setup.py | flecoqui/sharing-data-rest-api | a468861c941099f3a1546f764e76194f6a9ff066 | [
"MIT"
] | null | null | null | from setuptools import find_packages, setup
setup(
name="share_rest_api",
package_dir={"": "src"},
packages=find_packages("src"),
package_data={},
include_package_data=True,
version="0.0.1",
long_description="...",
long_description_content_type="text/markdown",
keywords=["python"],
... | 22.947368 | 50 | 0.630734 | from setuptools import find_packages, setup
setup(
name="share_rest_api",
package_dir={"": "src"},
packages=find_packages("src"),
package_data={},
include_package_data=True,
version="0.0.1",
long_description="...",
long_description_content_type="text/markdown",
keywords=["python"],
... | true | true |
f73fbe04e298000a0f78868c7f187c43298ddfa0 | 1,913 | py | Python | bangpy-ops/utils/generate_all_ops_header.py | SS7D631/cambricon | 51e7884ce1f94189f71624f62377228dea552abb | [
"Apache-2.0"
] | 1 | 2022-02-22T06:43:28.000Z | 2022-02-22T06:43:28.000Z | bangpy-ops/utils/generate_all_ops_header.py | SS7D631/cambricon | 51e7884ce1f94189f71624f62377228dea552abb | [
"Apache-2.0"
] | null | null | null | bangpy-ops/utils/generate_all_ops_header.py | SS7D631/cambricon | 51e7884ce1f94189f71624f62377228dea552abb | [
"Apache-2.0"
] | 1 | 2022-03-03T07:27:46.000Z | 2022-03-03T07:27:46.000Z | # Copyright (C) [2021] by Cambricon, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish... | 41.586957 | 82 | 0.693152 |
import os
import sys
def main():
if len(sys.argv) == 1:
raise ValueError("Please input at least one operator header file.")
header_lists = sys.argv[1].split(",")
header_lists = [i for i in header_lists if i != ""]
build_path = os.environ.get("BANGPY_BUILD_PATH", "")
if ... | true | true |
f73fbf5da777638b01486536f81f23f5c512bc56 | 9,185 | py | Python | monolog/monolog.py | Ckoetael/monolog | 914a4a9aa9651b2ee06380f9c6d130ee6602500f | [
"MIT"
] | null | null | null | monolog/monolog.py | Ckoetael/monolog | 914a4a9aa9651b2ee06380f9c6d130ee6602500f | [
"MIT"
] | null | null | null | monolog/monolog.py | Ckoetael/monolog | 914a4a9aa9651b2ee06380f9c6d130ee6602500f | [
"MIT"
] | null | null | null | # /usr/bin/python
# -*- coding: utf-8 -*-
"""
MongoDB logger module
"""
import datetime
import logging
import os
import json
import inspect
import random
from typing import Optional
from pymongo import MongoClient
class MongoLogger:
"""
MongoDB logger class.\n
"""
LEVELS = {'crit': 50, 'err': 40, 'wa... | 33.768382 | 111 | 0.554709 |
import datetime
import logging
import os
import json
import inspect
import random
from typing import Optional
from pymongo import MongoClient
class MongoLogger:
LEVELS = {'crit': 50, 'err': 40, 'warn': 30, 'info': 20, 'debug': 10}
def __init__(self, collection_name='default_logger', pid='', config_file="m... | true | true |
f73fbfb8229436cce1527b5e9a743b4259996cd8 | 45,269 | py | Python | codes/models/modules/architecture.py | kingsj0405/Explorable-Super-Resolution | 6582477ec1e2b0c6f4bd781552ac880fabdb4496 | [
"Apache-2.0"
] | 54 | 2020-06-16T07:44:19.000Z | 2022-03-01T06:23:38.000Z | codes/models/modules/architecture.py | kingsj0405/Explorable-Super-Resolution | 6582477ec1e2b0c6f4bd781552ac880fabdb4496 | [
"Apache-2.0"
] | 6 | 2020-07-01T08:59:24.000Z | 2021-02-22T19:58:23.000Z | codes/models/modules/architecture.py | kingsj0405/Explorable-Super-Resolution | 6582477ec1e2b0c6f4bd781552ac880fabdb4496 | [
"Apache-2.0"
] | 11 | 2020-06-16T21:28:00.000Z | 2022-01-06T12:28:58.000Z | import math
import torch
import torch.nn as nn
import torch.nn.init as init
import torchvision
from . import block as B
from . import spectral_norm as SN
import functools
import numpy as np
import os
import models.modules.archs_util as arch_util
import torch.nn.functional as F
import re
####################
# Generato... | 50.131783 | 225 | 0.625329 | import math
import torch
import torch.nn as nn
import torch.nn.init as init
import torchvision
from . import block as B
from . import spectral_norm as SN
import functools
import numpy as np
import os
import models.modules.archs_util as arch_util
import torch.nn.functional as F
import re
b)
if self.up... | true | true |
f73fbfca958e487fc30ecab967cf9db69f064b65 | 1,128 | py | Python | Phython-Exercise/ex041.py | laryssagoncalves/Python-Projects | a08bf31ff3bb486b64642165b258a7f8be69d199 | [
"MIT"
] | null | null | null | Phython-Exercise/ex041.py | laryssagoncalves/Python-Projects | a08bf31ff3bb486b64642165b258a7f8be69d199 | [
"MIT"
] | null | null | null | Phython-Exercise/ex041.py | laryssagoncalves/Python-Projects | a08bf31ff3bb486b64642165b258a7f8be69d199 | [
"MIT"
] | null | null | null | #importando biblioteca de ano e pausa de apresentação
from datetime import date
from time import sleep
print('-*'*25)
print(' '*6,'CONFEDERAÇÃO NACIONAL DE NATAÇÃO')
print('-*'*25)
sleep(2)
print(''' As Categorias de Atletas são:
– Até 9 anos: MIRIM
– Até 14 anos: INFANTIL
– Até 19 anos: JÚNIOR
– Até 25 anos: SÊNIOR
–... | 27.512195 | 58 | 0.617908 |
from datetime import date
from time import sleep
print('-*'*25)
print(' '*6,'CONFEDERAÇÃO NACIONAL DE NATAÇÃO')
print('-*'*25)
sleep(2)
print(''' As Categorias de Atletas são:
– Até 9 anos: MIRIM
– Até 14 anos: INFANTIL
– Até 19 anos: JÚNIOR
– Até 25 anos: SÊNIOR
– Acima de 25 anos: MASTER''')
print('-*'*25)
sleep(3)... | true | true |
f73fc03c47f9d69ef60fd3b2bbe39aed13c16162 | 619 | py | Python | vup/version.py | arecarn/vup | 40880c172adc13b3e518fd366a2d6ca77f2016a1 | [
"MIT"
] | null | null | null | vup/version.py | arecarn/vup | 40880c172adc13b3e518fd366a2d6ca77f2016a1 | [
"MIT"
] | null | null | null | vup/version.py | arecarn/vup | 40880c172adc13b3e518fd366a2d6ca77f2016a1 | [
"MIT"
] | null | null | null | """
This files purpose is to the be one place of truth for the version of this
project.
The variable __version__ is a string following the guidelines of semantic
versioning. The general guidelines are as follows
Given a version number MAJOR.MINOR.PATCH, increment the:
1. MAJOR version when you make incompatible API ... | 34.388889 | 76 | 0.79483 |
__version__ = '0.1.0-beta'
| true | true |
f73fc0a35ae450a2eaeed9a01bcc1e021600f5ce | 1,712 | py | Python | tests/handlers/test_base_handler_without_unsafe.py | appotry/thumbor | c2e75918da09ddd3086e8eeaca00d1d2747cf57c | [
"MIT"
] | null | null | null | tests/handlers/test_base_handler_without_unsafe.py | appotry/thumbor | c2e75918da09ddd3086e8eeaca00d1d2747cf57c | [
"MIT"
] | null | null | null | tests/handlers/test_base_handler_without_unsafe.py | appotry/thumbor | c2e75918da09ddd3086e8eeaca00d1d2747cf57c | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# thumbor imaging service
# https://github.com/thumbor/thumbor/wiki
# Licensed under the MIT license:
# http://www.opensource.org/licenses/mit-license
# Copyright (c) 2011 globo.com thumbor@googlegroups.com
from preggy import expect
from tornado.testing import gen_test
from... | 33.568627 | 115 | 0.73014 |
from preggy import expect
from tornado.testing import gen_test
from tests.fixtures.images import (
default_image,
)
from thumbor.config import Config
from thumbor.context import Context, ServerParameters
from thumbor.importer import Importer
from tests.handlers.test_base_handler import BaseImagingTestCas... | true | true |
f73fc1884c8d340c0ade296169db473fe6173a2f | 12,309 | pyw | Python | pinganalysis.pyw | joshuathomas2/ping_analysis | 189e5110226fb8fa5ce94281b641fc4e1c9b846b | [
"MIT"
] | null | null | null | pinganalysis.pyw | joshuathomas2/ping_analysis | 189e5110226fb8fa5ce94281b641fc4e1c9b846b | [
"MIT"
] | 3 | 2019-06-13T06:59:19.000Z | 2020-03-01T04:41:40.000Z | pinganalysis.pyw | joshuathomas2/ping_analysis | 189e5110226fb8fa5ce94281b641fc4e1c9b846b | [
"MIT"
] | null | null | null | import tkinter as tk
import subprocess
import json
import os
import re
class PingAnalysis:
def __init__(self):
self.settings_file = open("settings.json", "r")
self.settings_json = json.load(self.settings_file)
self.settings_file.close()
self.FONT_SMALL = (f"{self.settings_json['FO... | 41.03 | 121 | 0.639776 | import tkinter as tk
import subprocess
import json
import os
import re
class PingAnalysis:
def __init__(self):
self.settings_file = open("settings.json", "r")
self.settings_json = json.load(self.settings_file)
self.settings_file.close()
self.FONT_SMALL = (f"{self.settings_json['FO... | true | true |
f73fc1b0950dcb7b54849eb321480af6da26bbe2 | 4,704 | py | Python | samples/python/network_api_pytorch_mnist/model.py | L-Net-1992/TensorRT | 34b664d404001bd724cb56b52a6e0e05e1fd97f2 | [
"Apache-2.0"
] | null | null | null | samples/python/network_api_pytorch_mnist/model.py | L-Net-1992/TensorRT | 34b664d404001bd724cb56b52a6e0e05e1fd97f2 | [
"Apache-2.0"
] | null | null | null | samples/python/network_api_pytorch_mnist/model.py | L-Net-1992/TensorRT | 34b664d404001bd724cb56b52a6e0e05e1fd97f2 | [
"Apache-2.0"
] | null | null | null | #
# SPDX-FileCopyrightText: Copyright (c) 1993-2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# 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... | 39.2 | 198 | 0.608206 |
import torch
import torch.nn as nn
import torch.nn.functional as F
import torch.optim as optim
from torchvision import datasets, transforms
from torch.autograd import Variable
import numpy as np
import os
from random import randint
class Net(nn.Module):
def __init__(self):
super(Net, s... | true | true |
f73fc1c99f41a3f9d8453faeb6830db314e02382 | 13,650 | py | Python | sdk/synapse/azure-synapse-artifacts/azure/synapse/artifacts/aio/operations/_metastore_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | 1 | 2022-02-01T18:50:12.000Z | 2022-02-01T18:50:12.000Z | sdk/synapse/azure-synapse-artifacts/azure/synapse/artifacts/aio/operations/_metastore_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | sdk/synapse/azure-synapse-artifacts/azure/synapse/artifacts/aio/operations/_metastore_operations.py | vincenttran-msft/azure-sdk-for-python | 348b56f9f03eeb3f7b502eed51daf494ffff874d | [
"MIT"
] | null | null | null | # pylint: disable=too-many-lines
# 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) AutoRe... | 43.196203 | 153 | 0.659487 |
from typing import Any, Callable, Dict, Optional, TypeVar
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport import AsyncHttpResponse
from azure... | true | true |
f73fc2b93dc5d6b12783d9478e93a1915a5c0028 | 1,108 | py | Python | day07/d7a.py | AlexMabry/aoc20 | ce3fa021134b91b96d50b2f73be66a7516f9809e | [
"MIT"
] | null | null | null | day07/d7a.py | AlexMabry/aoc20 | ce3fa021134b91b96d50b2f73be66a7516f9809e | [
"MIT"
] | null | null | null | day07/d7a.py | AlexMabry/aoc20 | ce3fa021134b91b96d50b2f73be66a7516f9809e | [
"MIT"
] | null | null | null | from collections import defaultdict
def condense_line(line):
necessary = line.replace(' bags', '').replace(' bag', '').replace('.', '')
segmented = necessary.replace(' contain ', ':').replace(', ', ':').split(':')
return segmented[0], segmented[1:]
def decode_bag_rules(rules):
bags = defaultdict(set... | 27.7 | 93 | 0.657942 | from collections import defaultdict
def condense_line(line):
necessary = line.replace(' bags', '').replace(' bag', '').replace('.', '')
segmented = necessary.replace(' contain ', ':').replace(', ', ':').split(':')
return segmented[0], segmented[1:]
def decode_bag_rules(rules):
bags = defaultdict(set... | true | true |
f73fc383e5e38aae2140ea3dd8394b3d528f6e10 | 1,909 | py | Python | meraki/api/wireless_settings.py | fsandberg/dashboard-api-python | c01ff038643a39bd12660d2719375eeb05c7ba24 | [
"MIT"
] | null | null | null | meraki/api/wireless_settings.py | fsandberg/dashboard-api-python | c01ff038643a39bd12660d2719375eeb05c7ba24 | [
"MIT"
] | null | null | null | meraki/api/wireless_settings.py | fsandberg/dashboard-api-python | c01ff038643a39bd12660d2719375eeb05c7ba24 | [
"MIT"
] | null | null | null | class WirelessSettings(object):
def __init__(self, session):
super(WirelessSettings, self).__init__()
self._session = session
def getNetworkWirelessSettings(self, networkId: str):
"""
**Return the wireless settings for a network**
https://developer.cisco.com/docs/mer... | 40.617021 | 167 | 0.648507 | class WirelessSettings(object):
def __init__(self, session):
super(WirelessSettings, self).__init__()
self._session = session
def getNetworkWirelessSettings(self, networkId: str):
metadata = {
'tags': ['Wireless settings'],
'operation': 'getNetworkWirelessSe... | true | true |
f73fc399c4a6caa3996f1a0e8169648805091cf8 | 3,978 | py | Python | bpnet/samplers.py | mlweilert/bpnet | dcc9e8d805f9de774ae9dcc62c20504915be614f | [
"MIT"
] | 93 | 2019-08-15T19:49:19.000Z | 2022-03-04T08:23:44.000Z | bpnet/samplers.py | mlweilert/bpnet | dcc9e8d805f9de774ae9dcc62c20504915be614f | [
"MIT"
] | 29 | 2019-08-15T15:44:44.000Z | 2022-03-28T06:56:07.000Z | bpnet/samplers.py | mlweilert/bpnet | dcc9e8d805f9de774ae9dcc62c20504915be614f | [
"MIT"
] | 24 | 2019-08-29T18:54:36.000Z | 2022-03-23T21:04:46.000Z | """
Module implementing different samplers for the chipnexus data
"""
import pandas as pd
import numpy as np
from kipoi_utils.external.torch.sampler import Sampler
from kipoi_utils.data_utils import iterable_cycle
import warnings
import gin
def get_batch_sizes(p_vec, batch_size, verbose=True):
"""Compute the indi... | 30.837209 | 109 | 0.640271 | import pandas as pd
import numpy as np
from kipoi_utils.external.torch.sampler import Sampler
from kipoi_utils.data_utils import iterable_cycle
import warnings
import gin
def get_batch_sizes(p_vec, batch_size, verbose=True):
p_vec = np.array(p_vec) / sum(p_vec)
batch_sizes = np.round(p_vec * batch_size).asty... | true | true |
f73fc3d2359fda3602e199fd640afb18ee70807c | 5,256 | py | Python | opt/BayesianOptimization/main_classification.py | Neronjust2017/keras-project | 919e67e10b0bf518eb9cc63df68c79fe2bb71b36 | [
"Apache-2.0"
] | 2 | 2020-07-07T12:29:02.000Z | 2020-09-16T15:33:02.000Z | opt/BayesianOptimization/main_classification.py | Neronjust2017/keras-project | 919e67e10b0bf518eb9cc63df68c79fe2bb71b36 | [
"Apache-2.0"
] | 1 | 2020-10-04T12:08:27.000Z | 2020-10-05T05:05:39.000Z | opt/BayesianOptimization/main_classification.py | Neronjust2017/keras-project | 919e67e10b0bf518eb9cc63df68c79fe2bb71b36 | [
"Apache-2.0"
] | null | null | null | from comet_ml import experiment
from data_loader.uts_classification_data_loader import UtsClassificationDataLoader
from models.uts_classification_model import UtsClassificationModel
from trainers.uts_classification_trainer import UtsClassificationTrainer
from evaluater.uts_classification_evaluater import UtsClassificat... | 42.048 | 129 | 0.570967 | from comet_ml import experiment
from data_loader.uts_classification_data_loader import UtsClassificationDataLoader
from models.uts_classification_model import UtsClassificationModel
from trainers.uts_classification_trainer import UtsClassificationTrainer
from evaluater.uts_classification_evaluater import UtsClassificat... | true | true |
f73fc46868fcdc0ad66d0b3c9dac72d5a6b21779 | 272 | py | Python | src/ga/interfaces/fitness.py | technote-space/genetic-algorithms-py | a37e0a34c5970987d76fda6b14a48d9ab0579e33 | [
"MIT"
] | 3 | 2020-09-03T18:02:30.000Z | 2020-09-08T18:09:38.000Z | src/ga/interfaces/fitness.py | Amplil/genetic-algorithms-py | 4788c73b1b9d57eac904e8eb99d9140457201e6b | [
"MIT"
] | 7 | 2020-09-08T16:57:19.000Z | 2022-03-12T00:51:26.000Z | src/ga/interfaces/fitness.py | Amplil/genetic-algorithms-py | 4788c73b1b9d57eac904e8eb99d9140457201e6b | [
"MIT"
] | 1 | 2021-04-14T11:10:50.000Z | 2021-04-14T11:10:50.000Z | from abc import ABCMeta, abstractmethod
from .chromosome import IChromosome
class IFitness(metaclass=ABCMeta):
"""
Description:
------------
適応度のinterface
"""
@abstractmethod
def evaluate(self, chromosome: IChromosome) -> None:
pass
| 18.133333 | 56 | 0.647059 | from abc import ABCMeta, abstractmethod
from .chromosome import IChromosome
class IFitness(metaclass=ABCMeta):
@abstractmethod
def evaluate(self, chromosome: IChromosome) -> None:
pass
| true | true |
f73fc546c74388f4133e5cb1b21397db05491945 | 16,161 | py | Python | sumo_rl/environment/env.py | ankitdipto/sumo-rl | 70d75d463fa09d0ecfc10589b66955c22c8df41b | [
"MIT"
] | null | null | null | sumo_rl/environment/env.py | ankitdipto/sumo-rl | 70d75d463fa09d0ecfc10589b66955c22c8df41b | [
"MIT"
] | null | null | null | sumo_rl/environment/env.py | ankitdipto/sumo-rl | 70d75d463fa09d0ecfc10589b66955c22c8df41b | [
"MIT"
] | null | null | null | import os
import sys
from pathlib import Path
from typing import Optional, Union, Tuple
import sumo_rl
if 'SUMO_HOME' in os.environ:
tools = os.path.join(os.environ['SUMO_HOME'], 'tools')
sys.path.append(tools)
else:
sys.exit("Please declare the environment variable 'SUMO_HOME'")
import traci
import sumolib... | 39.225728 | 196 | 0.602747 | import os
import sys
from pathlib import Path
from typing import Optional, Union, Tuple
import sumo_rl
if 'SUMO_HOME' in os.environ:
tools = os.path.join(os.environ['SUMO_HOME'], 'tools')
sys.path.append(tools)
else:
sys.exit("Please declare the environment variable 'SUMO_HOME'")
import traci
import sumolib... | true | true |
f73fc54b008744bbbd8a18ff609e52d35a7f90fb | 7,804 | py | Python | pdb2pqr/pdb2pqr/pdb2pka/example.py | ashermancinelli/apbs-pdb2pqr | 0b1bc0126331cf3f1e08667ccc70dae8eda5cd00 | [
"BSD-3-Clause"
] | null | null | null | pdb2pqr/pdb2pqr/pdb2pka/example.py | ashermancinelli/apbs-pdb2pqr | 0b1bc0126331cf3f1e08667ccc70dae8eda5cd00 | [
"BSD-3-Clause"
] | null | null | null | pdb2pqr/pdb2pqr/pdb2pka/example.py | ashermancinelli/apbs-pdb2pqr | 0b1bc0126331cf3f1e08667ccc70dae8eda5cd00 | [
"BSD-3-Clause"
] | null | null | null | """APBS interface for PDB2PQR
Authors: Todd Dolinsky, Jens Erik Nielsen
"""
import logging
import time
import string
from src import psize
from src import inputgen
from apbslib import *
_LOGGER = logging.getLogger(__name__)
Python_kb = 1.3806581e-23
Python_Na = 6.0221367e+23
NOSH_MAXMOL = 20
NOSH_MAXCALC = 20
... | 26.544218 | 93 | 0.603152 |
import logging
import time
import string
from src import psize
from src import inputgen
from apbslib import *
_LOGGER = logging.getLogger(__name__)
Python_kb = 1.3806581e-23
Python_Na = 6.0221367e+23
NOSH_MAXMOL = 20
NOSH_MAXCALC = 20
class APBSError(Exception):
def __init__(self, value):
self.v... | true | true |
f73fc5bf605fb9e53fcfcfa4cda69aeecfe2a273 | 1,132 | py | Python | unit_tests/example.py | alliedel/anomalyframework_python | 63c56d9fb2e1dc37dfca494805e7fa179e078623 | [
"MIT"
] | 15 | 2018-12-28T07:32:56.000Z | 2022-02-20T00:17:34.000Z | unit_tests/example.py | alliedel/anomalyframework_python | 63c56d9fb2e1dc37dfca494805e7fa179e078623 | [
"MIT"
] | 1 | 2018-04-06T18:14:12.000Z | 2018-07-11T11:18:34.000Z | unit_tests/example.py | alliedel/anomalyframework_python | 63c56d9fb2e1dc37dfca494805e7fa179e078623 | [
"MIT"
] | 5 | 2018-02-07T19:08:09.000Z | 2019-07-01T23:17:23.000Z | import os
import shutil
import subprocess
runinfo_fname = os.path.abspath('./example.runinfo')
output_directory = os.path.abspath('./runfiles/output/')
if os.path.isdir(output_directory):
shutil.rmtree(output_directory, ignore_errors=True)
print('making {}'.format(output_directory))
os.mkdir(output_directory)
pri... | 41.925926 | 124 | 0.750883 | import os
import shutil
import subprocess
runinfo_fname = os.path.abspath('./example.runinfo')
output_directory = os.path.abspath('./runfiles/output/')
if os.path.isdir(output_directory):
shutil.rmtree(output_directory, ignore_errors=True)
print('making {}'.format(output_directory))
os.mkdir(output_directory)
pri... | true | true |
f73fc74043465426004365e949344373e3103d24 | 1,037 | py | Python | python/013_Roman_to_Integer.py | dvlpsh/leetcode-1 | f965328af72113ac8a5a9d6624868c1502be937b | [
"MIT"
] | 4,416 | 2016-03-30T15:02:26.000Z | 2022-03-31T16:31:03.000Z | python/013_Roman_to_Integer.py | YinpuLi/leetcode-6 | 1371de2631d745efba39de41b51c3424e35da434 | [
"MIT"
] | 20 | 2018-11-17T13:46:25.000Z | 2022-03-13T05:37:06.000Z | python/013_Roman_to_Integer.py | YinpuLi/leetcode-6 | 1371de2631d745efba39de41b51c3424e35da434 | [
"MIT"
] | 1,374 | 2017-05-26T15:44:30.000Z | 2022-03-30T19:21:02.000Z | class Solution:
# def romanToInt(self, s):
# """
# :type s: str
# :rtype: int
# """
# roman = {'I': 1, 'V': 5, 'X': 10,
# 'L': 50, 'C': 100, 'D': 500, 'M': 1000}
# result = 0
# last = s[-1]
# for t in reversed(s):
# if t ==... | 28.805556 | 58 | 0.344262 | class Solution:
# :type s: str
# :rtype: int
# """
def romanToInt(self, s):
roman = {'I': 1, 'V': 5, 'X': 10,
'L': 50, 'C': 100, 'D': 500, 'M': 1000}
prev, total = 0, 0
... | true | true |
f73fc8f919bae0fcafd115cb36aaedb71a3ea934 | 10,529 | py | Python | automod/chatbot/chatbot.py | 4006G2/AutoMod | f40d04ebc0a6949eb351e8d928951c6b464a439a | [
"MIT"
] | null | null | null | automod/chatbot/chatbot.py | 4006G2/AutoMod | f40d04ebc0a6949eb351e8d928951c6b464a439a | [
"MIT"
] | 3 | 2019-11-05T16:39:41.000Z | 2019-11-05T16:41:24.000Z | automod/chatbot/chatbot.py | 4006G2/AutoMod | f40d04ebc0a6949eb351e8d928951c6b464a439a | [
"MIT"
] | 1 | 2019-11-13T16:49:52.000Z | 2019-11-13T16:49:52.000Z | __author__ = "Benedict Thompson", "Hon Lam Lee"
__version__ = "0.1p"
import random
import re
from enum import Enum
import os
import csv
import requests
import time
import datetime
class MessageTone(Enum):
POSITIVE = 1
NEUTRAL = 0
NEGATIVE = -1
class WarningLevel(Enum):
WARNING = 0
MUTE = 1
... | 34.296417 | 122 | 0.563111 | __author__ = "Benedict Thompson", "Hon Lam Lee"
__version__ = "0.1p"
import random
import re
from enum import Enum
import os
import csv
import requests
import time
import datetime
class MessageTone(Enum):
POSITIVE = 1
NEUTRAL = 0
NEGATIVE = -1
class WarningLevel(Enum):
WARNING = 0
MUTE = 1
... | true | true |
f73fc9d9bb899e6cf67484ff02e98102112127dc | 4,268 | py | Python | trimesh/remesh.py | nick-parker/trimesh | a7bc1e0489ec98e3a3516088a7e64c8beca8b41a | [
"MIT"
] | null | null | null | trimesh/remesh.py | nick-parker/trimesh | a7bc1e0489ec98e3a3516088a7e64c8beca8b41a | [
"MIT"
] | null | null | null | trimesh/remesh.py | nick-parker/trimesh | a7bc1e0489ec98e3a3516088a7e64c8beca8b41a | [
"MIT"
] | 1 | 2019-05-31T03:37:21.000Z | 2019-05-31T03:37:21.000Z | """
remesh.py
-------------
Deal with re- triangulation of existing meshes.
"""
import numpy as np
import collections
from . import util
from . import grouping
def subdivide(vertices, faces, face_index=None):
"""
Subdivide a mesh into smaller triangles.
Parameters
----------
vertices: (n,3) f... | 34.699187 | 89 | 0.590206 |
import numpy as np
import collections
from . import util
from . import grouping
def subdivide(vertices, faces, face_index=None):
if face_index is None:
face_index = np.arange(len(faces))
else:
face_index = np.asanyarray(face_index)
faces = faces[face_index]
triangles = ve... | true | true |
f73fcac5d487a71147f917ccf69a8fcb629dd8ff | 8,125 | py | Python | service/server.py | LandRegistry/login-api | a9c7128498f9ec4dede07d0c915cc1a4c0e37a43 | [
"MIT"
] | null | null | null | service/server.py | LandRegistry/login-api | a9c7128498f9ec4dede07d0c915cc1a4c0e37a43 | [
"MIT"
] | 8 | 2015-05-29T14:25:32.000Z | 2015-08-06T15:36:17.000Z | service/server.py | LandRegistry/login-api | a9c7128498f9ec4dede07d0c915cc1a4c0e37a43 | [
"MIT"
] | 2 | 2016-11-22T12:26:32.000Z | 2021-04-11T06:05:42.000Z | from flask import request, Response # type: ignore
import json
import logging
import logging.config # type: ignore
from service import app, auditing, db_access, security
AUTH_FAILURE_RESPONSE_BODY = json.dumps({'error': 'Invalid credentials'})
INVALID_REQUEST_RESPONSE_BODY = json.dumps({'error': 'Invalid request'}... | 33.29918 | 98 | 0.6976 | from flask import request, Response
import json
import logging
import logging.config
from service import app, auditing, db_access, security
AUTH_FAILURE_RESPONSE_BODY = json.dumps({'error': 'Invalid credentials'})
INVALID_REQUEST_RESPONSE_BODY = json.dumps({'error': 'Invalid request'})
INTERNAL_SERVER_ERROR_RESP... | true | true |
f73fcae4cac435af6622a4c09f90d75680bb983b | 540 | py | Python | kutana/backend.py | sakost/kutana | 7695902803f17e1ce6109b5f9a8a7c24126d322f | [
"MIT"
] | null | null | null | kutana/backend.py | sakost/kutana | 7695902803f17e1ce6109b5f9a8a7c24126d322f | [
"MIT"
] | null | null | null | kutana/backend.py | sakost/kutana | 7695902803f17e1ce6109b5f9a8a7c24126d322f | [
"MIT"
] | null | null | null | class Backend:
async def on_start(self, app):
pass
async def on_shutdown(self, app):
pass
def prepare_context(self, ctx):
pass
async def perform_updates_request(self, submit_update):
raise NotImplementedError
async def perform_send(self, target_id, message, attach... | 23.478261 | 74 | 0.677778 | class Backend:
async def on_start(self, app):
pass
async def on_shutdown(self, app):
pass
def prepare_context(self, ctx):
pass
async def perform_updates_request(self, submit_update):
raise NotImplementedError
async def perform_send(self, target_id, message, attach... | true | true |
f73fcb9173d1a31f57f21a9c8c079fcfe223bb2a | 13,898 | py | Python | nlu/pipe/viz/streamlit_viz/viz_building_blocks/word_similarity.py | Murat-Karadag/nlu | 6a2b5995ea543e63c40baaca1bf9ad8a9db36757 | [
"Apache-2.0"
] | null | null | null | nlu/pipe/viz/streamlit_viz/viz_building_blocks/word_similarity.py | Murat-Karadag/nlu | 6a2b5995ea543e63c40baaca1bf9ad8a9db36757 | [
"Apache-2.0"
] | null | null | null | nlu/pipe/viz/streamlit_viz/viz_building_blocks/word_similarity.py | Murat-Karadag/nlu | 6a2b5995ea543e63c40baaca1bf9ad8a9db36757 | [
"Apache-2.0"
] | null | null | null | import nlu
from nlu.discovery import Discoverer
from nlu.pipe.utils.storage_ref_utils import StorageRefUtils
from typing import List, Tuple, Optional, Dict, Union
import streamlit as st
from nlu.utils.modelhub.modelhub_utils import ModelHubUtils
import numpy as np
import pandas as pd
from nlu.pipe.viz.streamlit_viz.st... | 59.905172 | 170 | 0.57627 | import nlu
from nlu.discovery import Discoverer
from nlu.pipe.utils.storage_ref_utils import StorageRefUtils
from typing import List, Tuple, Optional, Dict, Union
import streamlit as st
from nlu.utils.modelhub.modelhub_utils import ModelHubUtils
import numpy as np
import pandas as pd
from nlu.pipe.viz.streamlit_viz.st... | true | true |
f73fcd684e0e8e2ccaed9d8ecc82f67af840f1df | 6,875 | py | Python | tests/logging/test_terse_json.py | maxkratz/synapse | e46ac85d674d90fa01aa49aee9587093ab6d8677 | [
"Apache-2.0"
] | null | null | null | tests/logging/test_terse_json.py | maxkratz/synapse | e46ac85d674d90fa01aa49aee9587093ab6d8677 | [
"Apache-2.0"
] | null | null | null | tests/logging/test_terse_json.py | maxkratz/synapse | e46ac85d674d90fa01aa49aee9587093ab6d8677 | [
"Apache-2.0"
] | null | null | null | # Copyright 2019 The Matrix.org Foundation C.I.C.
#
# 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... | 34.20398 | 90 | 0.614109 |
import json
import logging
from io import BytesIO, StringIO
from unittest.mock import Mock, patch
from twisted.web.server import Request
from synapse.http.site import SynapseRequest
from synapse.logging._terse_json import JsonFormatter, TerseJsonFormatter
from synapse.logging.context import LoggingContex... | true | true |
f73fce718d68732a8fd3a18406cfcdbed3513839 | 55 | py | Python | modules/liteflownet/network/correlation/__init__.py | adnortje/deepvideo | 76d09ee8696355bc29ee57c1ef2ff61474c5ed41 | [
"CC0-1.0"
] | 37 | 2019-11-23T06:42:12.000Z | 2022-01-25T16:08:28.000Z | modules/liteflownet/network/correlation/__init__.py | sangramch/deepvideo | 16e622434b9843238b8092f94da2c58a4346788d | [
"CC0-1.0"
] | 4 | 2020-04-11T12:36:27.000Z | 2021-07-26T10:12:53.000Z | modules/liteflownet/network/correlation/__init__.py | sangramch/deepvideo | 16e622434b9843238b8092f94da2c58a4346788d | [
"CC0-1.0"
] | 9 | 2019-12-13T07:30:58.000Z | 2020-07-15T05:32:17.000Z | # imports
from .correlation import FunctionCorrelation
| 18.333333 | 44 | 0.854545 |
from .correlation import FunctionCorrelation
| true | true |
f73fcf166687f802261c11c6f4b6269388291c38 | 673 | py | Python | app/modules/frest/validate/user.py | h4wldev/frest | 80987ae21df72225d9518547f52b5c7d28a045d3 | [
"MIT"
] | 5 | 2018-11-19T23:41:04.000Z | 2019-09-23T03:51:05.000Z | app/modules/frest/validate/user.py | h4wldev/frest | 80987ae21df72225d9518547f52b5c7d28a045d3 | [
"MIT"
] | null | null | null | app/modules/frest/validate/user.py | h4wldev/frest | 80987ae21df72225d9518547f52b5c7d28a045d3 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
from wtforms import Form, StringField, PasswordField, validators
class modificationForm(Form):
username = StringField('User Name', [
validators.Optional(),
validators.Length(min=2, max=20)
])
email = StringField('Email', [
validators.Optional(),
vali... | 28.041667 | 98 | 0.618128 |
from wtforms import Form, StringField, PasswordField, validators
class modificationForm(Form):
username = StringField('User Name', [
validators.Optional(),
validators.Length(min=2, max=20)
])
email = StringField('Email', [
validators.Optional(),
validators.Length(min=5),
... | true | true |
f73fcf8398ed2538055045c9a774e42ac46bf5ec | 23,075 | py | Python | evaluation/evaluate_simulation_coda_gan.py | joannetruong/habitat-api | aad2fd7b8545dce44daefd4b7b3941672eb96ee3 | [
"MIT"
] | null | null | null | evaluation/evaluate_simulation_coda_gan.py | joannetruong/habitat-api | aad2fd7b8545dce44daefd4b7b3941672eb96ee3 | [
"MIT"
] | null | null | null | evaluation/evaluate_simulation_coda_gan.py | joannetruong/habitat-api | aad2fd7b8545dce44daefd4b7b3941672eb96ee3 | [
"MIT"
] | null | null | null | import matplotlib.pyplot as plt
import argparse
import os
from collections import defaultdict
import habitat
import numpy as np
import quaternion
import torch
from evaluate_reality import load_model
from gym.spaces.dict_space import Dict as SpaceDict
from habitat.tasks.utils import cartesian_to_polar
from habitat.util... | 43.050373 | 200 | 0.628126 | import matplotlib.pyplot as plt
import argparse
import os
from collections import defaultdict
import habitat
import numpy as np
import quaternion
import torch
from evaluate_reality import load_model
from gym.spaces.dict_space import Dict as SpaceDict
from habitat.tasks.utils import cartesian_to_polar
from habitat.util... | true | true |
f73fd1495b591c300050e3f34d00fb155bdf0191 | 13,710 | py | Python | data.py | casperg92/MaSIF_colab | f030061276cc21b812bb3be652124b75dcdf7e5b | [
"MIT"
] | 8 | 2022-02-21T12:54:25.000Z | 2022-03-22T00:35:26.000Z | data.py | casperg92/MaSIF_colab | f030061276cc21b812bb3be652124b75dcdf7e5b | [
"MIT"
] | 1 | 2022-03-19T02:44:08.000Z | 2022-03-21T12:20:59.000Z | data.py | casperg92/MaSIF_colab | f030061276cc21b812bb3be652124b75dcdf7e5b | [
"MIT"
] | 2 | 2022-03-18T08:59:38.000Z | 2022-03-26T11:48:59.000Z | import torch
from torch_geometric.data import InMemoryDataset, Data, DataLoader
from torch_geometric.transforms import Compose
import numpy as np
from scipy.spatial.transform import Rotation
import math
import urllib.request
import tarfile
from pathlib import Path
import requests
from data_preprocessing.convert_pdb2npy... | 33.196126 | 105 | 0.608096 | import torch
from torch_geometric.data import InMemoryDataset, Data, DataLoader
from torch_geometric.transforms import Compose
import numpy as np
from scipy.spatial.transform import Rotation
import math
import urllib.request
import tarfile
from pathlib import Path
import requests
from data_preprocessing.convert_pdb2npy... | true | true |
f73fd1dca04eb320de7ad6d0740ce11fb9fabbb3 | 89 | py | Python | tests/test_settings.py | kimedward/django-queryset-signals | efb1b21a35bfe0499dc8ed50f6e0793dbab38dc1 | [
"BSD-2-Clause"
] | 3 | 2019-10-08T12:30:32.000Z | 2022-02-08T07:39:10.000Z | tests/test_settings.py | kimedward/django-queryset-signals | efb1b21a35bfe0499dc8ed50f6e0793dbab38dc1 | [
"BSD-2-Clause"
] | null | null | null | tests/test_settings.py | kimedward/django-queryset-signals | efb1b21a35bfe0499dc8ed50f6e0793dbab38dc1 | [
"BSD-2-Clause"
] | 2 | 2019-06-18T06:59:11.000Z | 2021-04-16T15:05:11.000Z | from interface.settings import *
SECRET_KEY = 'fake-key'
INSTALLED_APPS.append("tests")
| 17.8 | 32 | 0.775281 | from interface.settings import *
SECRET_KEY = 'fake-key'
INSTALLED_APPS.append("tests")
| true | true |
f73fd22a29923ff8b255ada2841cd085f58352de | 43,253 | py | Python | spark_fhir_schemas/r4/resources/evidence.py | imranq2/SparkFhirSchemas | 24debae6980fb520fe55aa199bdfd43c0092eb9c | [
"Apache-2.0"
] | 2 | 2020-10-31T23:25:01.000Z | 2021-06-09T14:12:42.000Z | spark_fhir_schemas/r4/resources/evidence.py | imranq2/SparkFhirSchemas | 24debae6980fb520fe55aa199bdfd43c0092eb9c | [
"Apache-2.0"
] | null | null | null | spark_fhir_schemas/r4/resources/evidence.py | imranq2/SparkFhirSchemas | 24debae6980fb520fe55aa199bdfd43c0092eb9c | [
"Apache-2.0"
] | null | null | null | from typing import Union, List, Optional
from pyspark.sql.types import (
StructType,
StructField,
StringType,
ArrayType,
DateType,
DataType,
)
# This file is auto-generated by generate_schema so do not edit it manually
# noinspection PyPep8Naming
class EvidenceSchema:
"""
The Evidence... | 53.267241 | 106 | 0.561834 | from typing import Union, List, Optional
from pyspark.sql.types import (
StructType,
StructField,
StringType,
ArrayType,
DateType,
DataType,
)
class EvidenceSchema:
@staticmethod
def get_schema(
max_nesting_depth: Optional[int] = 6,
nesting_depth: int = 0,
... | true | true |
f73fd2db73a81c85c5096f846163cea5c915a03e | 43 | py | Python | unity.py | slin1972/unity | bede13b04ee2c45ad87fcb878c89254e5f48ac8c | [
"Apache-2.0"
] | null | null | null | unity.py | slin1972/unity | bede13b04ee2c45ad87fcb878c89254e5f48ac8c | [
"Apache-2.0"
] | null | null | null | unity.py | slin1972/unity | bede13b04ee2c45ad87fcb878c89254e5f48ac8c | [
"Apache-2.0"
] | null | null | null | import sys
def get():
return sys.path | 8.6 | 19 | 0.651163 | import sys
def get():
return sys.path | true | true |
f73fd305383c0854cdf691b5b7f8e6c3807aba87 | 634 | py | Python | python_aulas/desaf053_palindromo.py | gilsonaureliano/Python-aulas | 64269872acd482bcf297941ba28d30f13f29c752 | [
"MIT"
] | 1 | 2021-08-05T13:52:12.000Z | 2021-08-05T13:52:12.000Z | python_aulas/desaf053_palindromo.py | gilsonaureliano/Python-aulas | 64269872acd482bcf297941ba28d30f13f29c752 | [
"MIT"
] | null | null | null | python_aulas/desaf053_palindromo.py | gilsonaureliano/Python-aulas | 64269872acd482bcf297941ba28d30f13f29c752 | [
"MIT"
] | null | null | null | p = str(input('EScreva uma frase: ')).lower() # vai ler e dizer se lido normal e de traz para frente é igaul
palavras = p.split()
sem = ''.join(palavras)
print(sem)
l = p.replace(" ", "") # reescreve trocando os espaços vazios por nada - uni as palavras
print(l)
n = len(l)
# print(n)
# print('++++++++')
for cnt in ra... | 28.818182 | 109 | 0.572555 | p = str(input('EScreva uma frase: ')).lower()
palavras = p.split()
sem = ''.join(palavras)
print(sem)
l = p.replace(" ", "")
print(l)
n = len(l)
for cnt in range (n -1 , -1, -1):
print('{}'.format(l[cnt]), end= '')
s = 0
for c in range(0, n):
if l[c] == l[n - 1 - c]:
s = s + 1
if s == n:
... | true | true |
f73fd378176eca639680b35c1dcaeb83012da26b | 23,330 | py | Python | mistral/tests/unit/engine/test_error_handling.py | soda-research/mistral | 550a3de9c2defc7ce26336cb705d9c8d87bbaddd | [
"Apache-2.0"
] | null | null | null | mistral/tests/unit/engine/test_error_handling.py | soda-research/mistral | 550a3de9c2defc7ce26336cb705d9c8d87bbaddd | [
"Apache-2.0"
] | 5 | 2019-08-14T06:46:03.000Z | 2021-12-13T20:01:25.000Z | mistral/tests/unit/engine/test_error_handling.py | soda-research/mistral | 550a3de9c2defc7ce26336cb705d9c8d87bbaddd | [
"Apache-2.0"
] | 2 | 2020-03-15T01:24:15.000Z | 2020-07-22T20:34:26.000Z | # Copyright 2016 - Nokia Networks.
#
# 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 ... | 28.313107 | 78 | 0.585384 |
import mock
from oslo_config import cfg
from oslo_db import exception as db_exc
from mistral.db.v2 import api as db_api
from mistral import exceptions as exc
from mistral.services import workbooks as wb_service
from mistral.services import workflows as wf_service
from mistral.tests.unit.engine import bas... | true | true |
f73fd383a2670a43c60510181c59db467f95f30a | 1,262 | py | Python | CriptografiaClasica/menuCifrados.py | samuel14luis/Proyecto-en-Python-criptograf-a-II | 2c1812299f46aa7fb8f289d78ca9004fe334b618 | [
"MIT"
] | null | null | null | CriptografiaClasica/menuCifrados.py | samuel14luis/Proyecto-en-Python-criptograf-a-II | 2c1812299f46aa7fb8f289d78ca9004fe334b618 | [
"MIT"
] | null | null | null | CriptografiaClasica/menuCifrados.py | samuel14luis/Proyecto-en-Python-criptograf-a-II | 2c1812299f46aa7fb8f289d78ca9004fe334b618 | [
"MIT"
] | null | null | null | from utilidades.consola import *
#Menu CC = Criptografía Clásica
def menuCifrados(cifrado,oconfig):
cont = 0
eleccion = 'seguir'
output_config = oconfig #Configuración de salida consola:5, html:7, txt:11
menu = [
'[1] Configurar Salida',
'[2] Cifrar',
'[3] Descifrar',
... | 26.851064 | 81 | 0.481775 | from utilidades.consola import *
def menuCifrados(cifrado,oconfig):
cont = 0
eleccion = 'seguir'
output_config = oconfig
menu = [
'[1] Configurar Salida',
'[2] Cifrar',
'[3] Descifrar',
'[4] Breve descripción',
'[0] volver'
]
while elecc... | true | true |
f73fd3ec8a8fd645f1fc3c851bcdc3fd55263dad | 1,518 | py | Python | pdm/cli/commands/add.py | nasyxx/pdm | 229e4552c800db0241d9d6e9140256c4bcce2a6d | [
"MIT"
] | null | null | null | pdm/cli/commands/add.py | nasyxx/pdm | 229e4552c800db0241d9d6e9140256c4bcce2a6d | [
"MIT"
] | null | null | null | pdm/cli/commands/add.py | nasyxx/pdm | 229e4552c800db0241d9d6e9140256c4bcce2a6d | [
"MIT"
] | null | null | null | import argparse
from pdm.cli import actions
from pdm.cli.commands.base import BaseCommand
from pdm.cli.options import packages_group, save_strategy_group, update_strategy_group
from pdm.project import Project
class Command(BaseCommand):
"""Add package(s) to pyproject.toml and install them"""
def add_argumen... | 33.733333 | 86 | 0.620553 | import argparse
from pdm.cli import actions
from pdm.cli.commands.base import BaseCommand
from pdm.cli.options import packages_group, save_strategy_group, update_strategy_group
from pdm.project import Project
class Command(BaseCommand):
def add_arguments(self, parser: argparse.ArgumentParser) -> None:
p... | true | true |
f73fd49d2aba8862e4ce36970fd15a0a77d48d4b | 18,065 | py | Python | WS2012R2/lisa/tools/middleware_bench/utils/setup.py | LiliDeng/lis-test | a551326349e1aea86f51678098c747f6a092b4f6 | [
"Apache-2.0"
] | null | null | null | WS2012R2/lisa/tools/middleware_bench/utils/setup.py | LiliDeng/lis-test | a551326349e1aea86f51678098c747f6a092b4f6 | [
"Apache-2.0"
] | null | null | null | WS2012R2/lisa/tools/middleware_bench/utils/setup.py | LiliDeng/lis-test | a551326349e1aea86f51678098c747f6a092b4f6 | [
"Apache-2.0"
] | null | null | null | """
Linux on Hyper-V and Azure Test Code, ver. 1.0.0
Copyright (c) Microsoft 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/LICEN... | 48.561828 | 108 | 0.556214 |
import os
import sys
import time
import logging
from utils import constants
from utils.cmdshell import SSHClient
from report.db_utils import upload_results
from paramiko.ssh_exception import NoValidConnectionsError
from providers.amazon_service import AWSConnector
from providers.azure_service import AzureConnector
f... | true | true |
f73fd65ba3f4f67b3be615f0787b574a68d75308 | 1,883 | py | Python | homeassistant/components/synology_chat/notify.py | basicpail/core | 5cc54618c5af3f75c08314bf2375cc7ac40d2b7e | [
"Apache-2.0"
] | 11 | 2018-02-16T15:35:47.000Z | 2020-01-14T15:20:00.000Z | homeassistant/components/synology_chat/notify.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 87 | 2020-07-06T22:22:54.000Z | 2022-03-31T06:01:46.000Z | homeassistant/components/synology_chat/notify.py | jagadeeshvenkatesh/core | 1bd982668449815fee2105478569f8e4b5670add | [
"Apache-2.0"
] | 11 | 2020-12-16T13:48:14.000Z | 2022-02-01T00:28:05.000Z | """SynologyChat platform for notify component."""
import json
import logging
import requests
import voluptuous as vol
from homeassistant.components.notify import (
ATTR_DATA,
PLATFORM_SCHEMA,
BaseNotificationService,
)
from homeassistant.const import CONF_RESOURCE, CONF_VERIFY_SSL, HTTP_CREATED, HTTP_OK
i... | 28.530303 | 85 | 0.682953 | import json
import logging
import requests
import voluptuous as vol
from homeassistant.components.notify import (
ATTR_DATA,
PLATFORM_SCHEMA,
BaseNotificationService,
)
from homeassistant.const import CONF_RESOURCE, CONF_VERIFY_SSL, HTTP_CREATED, HTTP_OK
import homeassistant.helpers.config_validation as c... | true | true |
f73fd69cc5e988e7dbebd91a63cf5222b39b3ded | 6,979 | py | Python | saleor/graphql/channel/tests/test_channel_delete_mutations.py | ibutiti/saleor | fffe9a54c01aa07131102474dcb1519e0b59da74 | [
"BSD-3-Clause"
] | 2 | 2021-05-16T13:46:07.000Z | 2021-05-16T13:49:21.000Z | saleor/graphql/channel/tests/test_channel_delete_mutations.py | Niranjoyyengkhom/saleor | 4e6c4fe10476508e6b5c06fb1f38f9dc1dfc81a5 | [
"CC-BY-4.0"
] | 73 | 2021-06-07T04:47:10.000Z | 2022-03-14T04:52:43.000Z | saleor/graphql/channel/tests/test_channel_delete_mutations.py | Niranjoyyengkhom/saleor | 4e6c4fe10476508e6b5c06fb1f38f9dc1dfc81a5 | [
"CC-BY-4.0"
] | null | null | null | import graphene
from ....channel.error_codes import ChannelErrorCode
from ....channel.models import Channel
from ....checkout.models import Checkout
from ....order.models import Order
from ...tests.utils import assert_no_permission, get_graphql_content
CHANNEL_DELETE_MUTATION = """
mutation deleteChannel($id: ID!... | 30.609649 | 85 | 0.703826 | import graphene
from ....channel.error_codes import ChannelErrorCode
from ....channel.models import Channel
from ....checkout.models import Checkout
from ....order.models import Order
from ...tests.utils import assert_no_permission, get_graphql_content
CHANNEL_DELETE_MUTATION = """
mutation deleteChannel($id: ID!... | true | true |
f73fd717c9da03652c377b089be0262106c2d31d | 4,245 | py | Python | git_tools/tag_all_repos.py | bnemanich/open-ce | df79cdb0779814d6500cc1f7d19b376b7cce3c90 | [
"Apache-2.0"
] | null | null | null | git_tools/tag_all_repos.py | bnemanich/open-ce | df79cdb0779814d6500cc1f7d19b376b7cce3c90 | [
"Apache-2.0"
] | null | null | null | git_tools/tag_all_repos.py | bnemanich/open-ce | df79cdb0779814d6500cc1f7d19b376b7cce3c90 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
"""
*****************************************************************
Licensed Materials - Property of IBM
(C) Copyright IBM Corp. 2020. All Rights Reserved.
US Government Users Restricted Rights - Use, duplication or
disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
**************... | 40.04717 | 121 | 0.570554 |
import os
import sys
import pathlib
import git_utils
sys.path.append(os.path.join(pathlib.Path(__file__).parent.absolute(), '..', 'open-ce'))
import inputs
def _make_parser():
parser = inputs.make_parser([git_utils.Argument.PUBLIC_ACCESS_TOKEN, git_utils.Argument.REPO_DIR,
g... | true | true |
f73fd7272fa3697daf761f35832072079728476b | 949 | py | Python | examples/projections/misc/misc_robinson.py | daroari/pygmt | e022851d62814a9255ed2bb63ae092b666b832b9 | [
"BSD-3-Clause"
] | 1 | 2021-05-11T03:55:25.000Z | 2021-05-11T03:55:25.000Z | examples/projections/misc/misc_robinson.py | daroari/pygmt | e022851d62814a9255ed2bb63ae092b666b832b9 | [
"BSD-3-Clause"
] | 22 | 2021-03-24T07:58:59.000Z | 2022-03-29T12:07:09.000Z | examples/projections/misc/misc_robinson.py | daroari/pygmt | e022851d62814a9255ed2bb63ae092b666b832b9 | [
"BSD-3-Clause"
] | 1 | 2021-11-03T07:47:18.000Z | 2021-11-03T07:47:18.000Z | """
Robinson
========
The Robinson projection, presented by the American geographer and cartographer
Arthur H. Robinson in 1963, is a modified cylindrical projection that is neither
conformal nor equal-area. Central meridian and all parallels are straight lines; other
meridians are curved. It uses lookup tables rather... | 39.541667 | 87 | 0.736565 | import pygmt
fig = pygmt.Figure()
fig.coast(region="d", projection="N12c", land="goldenrod", water="snow2", frame="afg")
fig.show()
| true | true |
f73fd79056c9c9bd7be77bd38b3781bf169233af | 10,139 | py | Python | del2rpp/__main__.py | dcower/del2rpp | d0afa4ec39c2060b44e772f87a6700807d8d8155 | [
"MIT"
] | 34 | 2019-12-31T15:00:32.000Z | 2022-01-21T00:29:59.000Z | del2rpp/__main__.py | dcower/del2rpp | d0afa4ec39c2060b44e772f87a6700807d8d8155 | [
"MIT"
] | 5 | 2019-12-31T00:15:39.000Z | 2020-02-23T21:33:03.000Z | del2rpp/__main__.py | dcower/del2rpp | d0afa4ec39c2060b44e772f87a6700807d8d8155 | [
"MIT"
] | 2 | 2020-11-16T06:29:33.000Z | 2022-02-02T18:43:23.000Z | #! /usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import base64
import binascii
import os
import struct
import traceback
import uuid
import xml.etree.ElementTree as ET
from . import kit, util
try:
# Try local import first.
from pydel import pydel
except:
import pydel
import rpp
def convert_note... | 29.21902 | 100 | 0.643752 |
import argparse
import base64
import binascii
import os
import struct
import traceback
import uuid
import xml.etree.ElementTree as ET
from . import kit, util
try:
from pydel import pydel
except:
import pydel
import rpp
def convert_notes_to_midi(channel, notes, clip_length, instance_length):
notes = pyd... | true | true |
f73fd997858b140c8c23c586cd621da33baa263c | 177 | py | Python | docs/urls.py | marekbaranowski98/WebFilm | 5d78bb9518070c195feffc2181735b93be019ca0 | [
"MIT"
] | null | null | null | docs/urls.py | marekbaranowski98/WebFilm | 5d78bb9518070c195feffc2181735b93be019ca0 | [
"MIT"
] | null | null | null | docs/urls.py | marekbaranowski98/WebFilm | 5d78bb9518070c195feffc2181735b93be019ca0 | [
"MIT"
] | null | null | null | """Docs URL Configuration
path api/ load swagger docs api
"""
from django.urls import path
from .views import show_api_docs
urlpatterns = [
path('api/', show_api_docs),
]
| 16.090909 | 32 | 0.723164 | from django.urls import path
from .views import show_api_docs
urlpatterns = [
path('api/', show_api_docs),
]
| true | true |
f73fd9a3b07c1e7d19eef156034339528da1f3fc | 29,515 | py | Python | src/genie/libs/parser/iosxr/show_routing.py | pwoconnor/genieparser | 6c764dea0f452d75bc02f3aff3dbe16aec543c81 | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/iosxr/show_routing.py | pwoconnor/genieparser | 6c764dea0f452d75bc02f3aff3dbe16aec543c81 | [
"Apache-2.0"
] | null | null | null | src/genie/libs/parser/iosxr/show_routing.py | pwoconnor/genieparser | 6c764dea0f452d75bc02f3aff3dbe16aec543c81 | [
"Apache-2.0"
] | null | null | null | '''
show_route.py
'''
import re
from genie.metaparser import MetaParser
from genie.metaparser.util.schemaengine import Schema, \
Any, \
Optional
# ====================================================
# schema for show route ipv4
# ===... | 47.451768 | 135 | 0.448619 | import re
from genie.metaparser import MetaParser
from genie.metaparser.util.schemaengine import Schema, \
Any, \
Optional
class ShowRouteIpv4Schema(MetaParser):
schema = {
'vrf': {
Any(): {
Op... | true | true |
f73fdace9325573559e633c5faad1e42640367ba | 3,711 | py | Python | toy/bitcoin_notifications.py | KiwiShow/PythonWeb | a489bc2ab16f06f7cc4524bab6b45b2653bfb1bd | [
"MIT"
] | 7 | 2018-02-24T13:41:21.000Z | 2022-02-06T04:59:13.000Z | toy/bitcoin_notifications.py | KiwiShow/PythonWeb | a489bc2ab16f06f7cc4524bab6b45b2653bfb1bd | [
"MIT"
] | 6 | 2018-02-25T11:50:42.000Z | 2021-12-13T19:55:13.000Z | toy/bitcoin_notifications.py | KiwiShow/PythonWeb | a489bc2ab16f06f7cc4524bab6b45b2653bfb1bd | [
"MIT"
] | 1 | 2018-03-01T02:43:15.000Z | 2018-03-01T02:43:15.000Z | import requests
import time
from datetime import datetime
# Please limit requests to no more than 30 per minute.
# Endpoints update every 5 minutes.
# 获取比特币价格的api
# CoinMarketCap Public API Documentation Version 2
BITCOIN_API_URL = 'https://api.coinmarketcap.com/v2/ticker/1/'
# 触发IFTTT的api
# https://maker.ifttt.com/t... | 31.184874 | 93 | 0.676637 | import requests
import time
from datetime import datetime
BITCOIN_API_URL = 'https://api.coinmarketcap.com/v2/ticker/1/'
IFTTT_WEBHOOKS_URL = 'https://maker.ifttt.com/trigger/{}/with/key/bjvkZ1gI-LkEK8nSUdKMYB'
def get_latest_bitcoin_price():
response = requests.get(BITCOIN_API_URL)
response_json = re... | true | true |
f73fdb67bb1ac8f123f4ed95b1bee18a88b4c0bb | 277 | py | Python | setup.py | vnetserg/barrage | c5bd486ca2b9e3642b37846648593bfc54f2874c | [
"MIT"
] | 2 | 2017-10-28T07:30:10.000Z | 2020-07-04T17:25:47.000Z | setup.py | vnetserg/barrage | c5bd486ca2b9e3642b37846648593bfc54f2874c | [
"MIT"
] | null | null | null | setup.py | vnetserg/barrage | c5bd486ca2b9e3642b37846648593bfc54f2874c | [
"MIT"
] | null | null | null | #!/usr/bin/env python
import os
import pip
from setuptools import setup
setup(
name='barrage',
version='0.1.0',
description='Competitive programming testing script',
author='Sergei Fomin',
author_email='sergio-dna@yandex.ru',
packages=['barrage'],
)
| 17.3125 | 57 | 0.685921 |
import os
import pip
from setuptools import setup
setup(
name='barrage',
version='0.1.0',
description='Competitive programming testing script',
author='Sergei Fomin',
author_email='sergio-dna@yandex.ru',
packages=['barrage'],
)
| true | true |
f73fdb73eb1ef2f5709d253b40321ce4a9e79559 | 12,388 | py | Python | pyseq/check_system.py | nygctech/PySeq2500V2 | 37db3a5d11e33579535d7afc422b98bb84a780b0 | [
"MIT"
] | 3 | 2019-12-09T08:41:13.000Z | 2019-12-17T08:35:31.000Z | pyseq/check_system.py | nygctech/PySeq2500V2 | 37db3a5d11e33579535d7afc422b98bb84a780b0 | [
"MIT"
] | null | null | null | pyseq/check_system.py | nygctech/PySeq2500V2 | 37db3a5d11e33579535d7afc422b98bb84a780b0 | [
"MIT"
] | 1 | 2020-01-10T08:10:26.000Z | 2020-01-10T08:10:26.000Z | import logging
import warnings
import time
import os
import sys
from os.path import join
from . import image_analysis as ia
from . import methods
def error(text):
hs.message('ERROR::'+text)
if instrument_status['FPGA']:
hs.f.LED(1, 'yellow')
def setup_logger(log_path):
"""Create a logger and retu... | 27.107221 | 89 | 0.561027 | import logging
import warnings
import time
import os
import sys
from os.path import join
from . import image_analysis as ia
from . import methods
def error(text):
hs.message('ERROR::'+text)
if instrument_status['FPGA']:
hs.f.LED(1, 'yellow')
def setup_logger(log_path):
logger = logging.get... | true | true |
f73fdba671be811f9a1ac06ad5ffaf049594985f | 1,477 | py | Python | backend/places/google_places_helper.py | nuwen/saveourfaves-server | 4c05a1507ae0ee4c279f79372d97d7a7930b476a | [
"MIT"
] | 25 | 2020-03-20T15:14:02.000Z | 2021-11-08T09:08:47.000Z | backend/places/google_places_helper.py | nuwen/saveourfaves-server | 4c05a1507ae0ee4c279f79372d97d7a7930b476a | [
"MIT"
] | 8 | 2020-03-23T06:53:55.000Z | 2021-06-10T18:43:11.000Z | backend/places/google_places_helper.py | JHBP/supportSeattleOrg | 1c180a2040c3b88757b2fc645160021bfef7656e | [
"MIT"
] | 33 | 2020-03-20T18:21:07.000Z | 2021-05-02T01:05:32.000Z | from django.conf import settings
from places.models import Place
import requests
PLACES_API_ROOT = "https://maps.googleapis.com/maps/api/place"
PLACES_DETAILS_URL = "{ROOT_URL}/details/json?inputtype=textquery&key={key}&place_id={place_id}&fields={fields}"
PLACES_PHOTO_URL = "{ROOT_URL}/photo?key={key}&photoreference... | 34.348837 | 112 | 0.718348 | from django.conf import settings
from places.models import Place
import requests
PLACES_API_ROOT = "https://maps.googleapis.com/maps/api/place"
PLACES_DETAILS_URL = "{ROOT_URL}/details/json?inputtype=textquery&key={key}&place_id={place_id}&fields={fields}"
PLACES_PHOTO_URL = "{ROOT_URL}/photo?key={key}&photoreference... | true | true |
f73fdc13c82959e81fbeaf4965f0fbf343b71bc5 | 1,061 | py | Python | plugins/spotify/lyrics.py | Hydrayt777/spotify_userbot | 9f42384f75f289e9fde11ca2f87d4ab9a0d93228 | [
"MIT"
] | 3 | 2021-02-09T16:45:07.000Z | 2022-02-07T08:55:10.000Z | plugins/spotify/lyrics.py | code-rgb/spotify_userbot | 299e872d8ad6c133e38579f0e13f105b11b03ee1 | [
"MIT"
] | null | null | null | plugins/spotify/lyrics.py | code-rgb/spotify_userbot | 299e872d8ad6c133e38579f0e13f105b11b03ee1 | [
"MIT"
] | 9 | 2020-07-19T20:19:36.000Z | 2020-11-15T10:18:41.000Z | from telethon import events
import asyncio
from PyLyrics import *
from __main__ import client
from constants import Config
CMD_PREFIX = Config.CMD_PREFIX
@client.on(events.NewMessage(outgoing=True, pattern=CMD_PREFIX + "lyrics (.*)"))
async def _(event):
if event.fwd_from:
return
i = 0
input_str... | 31.205882 | 85 | 0.584354 | from telethon import events
import asyncio
from PyLyrics import *
from __main__ import client
from constants import Config
CMD_PREFIX = Config.CMD_PREFIX
@client.on(events.NewMessage(outgoing=True, pattern=CMD_PREFIX + "lyrics (.*)"))
async def _(event):
if event.fwd_from:
return
i = 0
input_str... | true | true |
f73fdccf4f7335095c0f4f509b7818e1139d3e8e | 2,216 | py | Python | flexget/plugins/input/input_csv.py | Crupuk/Flexget | 0ede246fd4b90e3cd75120ba13746187e11968d2 | [
"MIT"
] | null | null | null | flexget/plugins/input/input_csv.py | Crupuk/Flexget | 0ede246fd4b90e3cd75120ba13746187e11968d2 | [
"MIT"
] | null | null | null | flexget/plugins/input/input_csv.py | Crupuk/Flexget | 0ede246fd4b90e3cd75120ba13746187e11968d2 | [
"MIT"
] | null | null | null | from __future__ import unicode_literals, division, absolute_import
import logging
import csv
from requests import RequestException
from flexget.entry import Entry
from flexget.plugin import register_plugin, PluginError
from flexget.utils.cached_input import cached
log = logging.getLogger('csv')
class InputCSV(obje... | 30.356164 | 85 | 0.573105 | from __future__ import unicode_literals, division, absolute_import
import logging
import csv
from requests import RequestException
from flexget.entry import Entry
from flexget.plugin import register_plugin, PluginError
from flexget.utils.cached_input import cached
log = logging.getLogger('csv')
class InputCSV(obje... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.