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 958k | max_line_length int64 1 987k | alphanum_fraction float64 0 1 | content_no_comment stringlengths 0 1.01M | is_comment_constant_removed bool 2
classes | is_sharp_comment_removed bool 1
class |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1c3e1fc2ba319da7c82d26f480a4424902c460fc | 24 | py | Python | web/db/__init__.py | ArturSamvelyan/fastapi-sqlalchemy-postgresql-template | c6ed650bd3ffeda98ecc4cd4a0d44b3cae5c1bfb | [
"MIT"
] | null | null | null | web/db/__init__.py | ArturSamvelyan/fastapi-sqlalchemy-postgresql-template | c6ed650bd3ffeda98ecc4cd4a0d44b3cae5c1bfb | [
"MIT"
] | null | null | null | web/db/__init__.py | ArturSamvelyan/fastapi-sqlalchemy-postgresql-template | c6ed650bd3ffeda98ecc4cd4a0d44b3cae5c1bfb | [
"MIT"
] | null | null | null | from .users import users | 24 | 24 | 0.833333 | from .users import users | true | true |
1c3e20b56db40a4968e01553fd867337cdcf67c5 | 25,818 | py | Python | examples/identity-app/images/agents/agent.py | fabio97U/bevel | 02909fec93b3256253279e43ebf0395f38c8eb7e | [
"Apache-2.0"
] | null | null | null | examples/identity-app/images/agents/agent.py | fabio97U/bevel | 02909fec93b3256253279e43ebf0395f38c8eb7e | [
"Apache-2.0"
] | null | null | null | examples/identity-app/images/agents/agent.py | fabio97U/bevel | 02909fec93b3256253279e43ebf0395f38c8eb7e | [
"Apache-2.0"
] | null | null | null | import asyncio
import asyncpg
import functools
import json
import logging
import os
import random
import subprocess
import hashlib
import base58
from timeit import default_timer
from aiohttp import (
web,
ClientSession,
ClientRequest,
ClientResponse,
ClientError,
ClientTimeout... | 37.580786 | 143 | 0.548609 | import asyncio
import asyncpg
import functools
import json
import logging
import os
import random
import subprocess
import hashlib
import base58
from timeit import default_timer
from aiohttp import (
web,
ClientSession,
ClientRequest,
ClientResponse,
ClientError,
ClientTimeout... | true | true |
1c3e2159a603800c25810e4e53b4fd9f5f1e7568 | 1,323 | py | Python | tools/src/blogs/api/interface.py | Symthy/blog-index-manager | d0c2e0b265b35be7cdb5aead1f1543f4b0306bdf | [
"MIT"
] | null | null | null | tools/src/blogs/api/interface.py | Symthy/blog-index-manager | d0c2e0b265b35be7cdb5aead1f1543f4b0306bdf | [
"MIT"
] | 1 | 2022-01-29T08:28:36.000Z | 2022-01-29T08:28:36.000Z | tools/src/blogs/api/interface.py | Symthy/blog-index-manager | d0c2e0b265b35be7cdb5aead1f1543f4b0306bdf | [
"MIT"
] | null | null | null | from abc import ABC, abstractmethod
from typing import Optional
from domain.blog.blog_entry import BlogEntry, BlogEntries
from domain.blog.photo_entry import PhotoEntry
class IBlogApiExecutor(ABC):
@abstractmethod
def execute_get_blog_entry_api(self, entry_id: str) -> Optional[BlogEntry]:
pass
@... | 31.5 | 116 | 0.687831 | from abc import ABC, abstractmethod
from typing import Optional
from domain.blog.blog_entry import BlogEntry, BlogEntries
from domain.blog.photo_entry import PhotoEntry
class IBlogApiExecutor(ABC):
@abstractmethod
def execute_get_blog_entry_api(self, entry_id: str) -> Optional[BlogEntry]:
pass
@... | true | true |
1c3e221f4953258252911fd3d67bb0c47fea6d65 | 5,420 | py | Python | torchvision/datasets/sbd.py | MeepoAII/vision | 6e10e3f88158f12b7a304d3c2f803d2bbdde0823 | [
"BSD-3-Clause"
] | 2 | 2021-05-06T16:13:00.000Z | 2021-11-17T11:25:12.000Z | torchvision/datasets/sbd.py | MeepoAII/vision | 6e10e3f88158f12b7a304d3c2f803d2bbdde0823 | [
"BSD-3-Clause"
] | 3 | 2021-11-20T09:20:18.000Z | 2021-12-13T09:19:25.000Z | torchvision/datasets/sbd.py | MeepoAII/vision | 6e10e3f88158f12b7a304d3c2f803d2bbdde0823 | [
"BSD-3-Clause"
] | 3 | 2020-12-17T22:32:06.000Z | 2022-03-23T01:43:42.000Z | import os
import shutil
from .vision import VisionDataset
from typing import Any, Callable, Optional, Tuple
import numpy as np
from PIL import Image
from .utils import download_url, verify_str_arg
from .voc import download_extract
class SBDataset(VisionDataset):
"""`Semantic Boundaries Dataset <http://home.bhar... | 42.34375 | 109 | 0.631365 | import os
import shutil
from .vision import VisionDataset
from typing import Any, Callable, Optional, Tuple
import numpy as np
from PIL import Image
from .utils import download_url, verify_str_arg
from .voc import download_extract
class SBDataset(VisionDataset):
url = "http://www.eecs.berkeley.edu/Research/Pro... | true | true |
1c3e22847b16126dac089d6b163792fd9ed564a1 | 1,008 | py | Python | src/ralph/deployment/management/commands/nexthostname.py | quamilek/ralph | bf7231ea096924332b874718b33cd1f43f9c783b | [
"Apache-2.0"
] | null | null | null | src/ralph/deployment/management/commands/nexthostname.py | quamilek/ralph | bf7231ea096924332b874718b33cd1f43f9c783b | [
"Apache-2.0"
] | null | null | null | src/ralph/deployment/management/commands/nexthostname.py | quamilek/ralph | bf7231ea096924332b874718b33cd1f43f9c783b | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from django.core.management.base import BaseCommand, CommandError
from ralph.deployment.util import get_next_free_hostname... | 32.516129 | 72 | 0.705357 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from django.core.management.base import BaseCommand, CommandError
from ralph.deployment.util import get_next_free_hostname
from ralph.discovery.models import DataCent... | true | true |
1c3e2365392a03bd6d8df514d57874b8d06fce21 | 6,090 | py | Python | packages/core/minos-microservice-common/tests/test_common/test_model/test_serializers/test_avro/test_schema/test_decoder.py | sorasful/minos-python | 1189330eebf6444627a2af6b29f347670f95a4dd | [
"MIT"
] | 247 | 2022-01-24T14:55:30.000Z | 2022-03-25T12:06:17.000Z | packages/core/minos-microservice-common/tests/test_common/test_model/test_serializers/test_avro/test_schema/test_decoder.py | sorasful/minos-python | 1189330eebf6444627a2af6b29f347670f95a4dd | [
"MIT"
] | 400 | 2021-04-03T08:51:40.000Z | 2022-01-28T11:51:22.000Z | packages/core/minos-microservice-common/tests/test_common/test_model/test_serializers/test_avro/test_schema/test_decoder.py | sorasful/minos-python | 1189330eebf6444627a2af6b29f347670f95a4dd | [
"MIT"
] | 21 | 2022-02-06T17:25:58.000Z | 2022-03-27T04:50:29.000Z | import unittest
from datetime import (
date,
datetime,
time,
timedelta,
)
from typing import (
Any,
Union,
)
from unittest.mock import (
patch,
)
from uuid import (
UUID,
)
from minos.common import (
AvroSchemaDecoder,
MinosMalformedAttributeException,
ModelType,
classna... | 34.40678 | 111 | 0.611823 | import unittest
from datetime import (
date,
datetime,
time,
timedelta,
)
from typing import (
Any,
Union,
)
from unittest.mock import (
patch,
)
from uuid import (
UUID,
)
from minos.common import (
AvroSchemaDecoder,
MinosMalformedAttributeException,
ModelType,
classna... | true | true |
1c3e236cbc8726fe2c849a5d7ff474a88063800c | 14,070 | py | Python | models.py | AliengirlLiv/dreamer-pytorch-1 | 33979d7c61d0406d27ea46b9dcbbd823f765a518 | [
"MIT"
] | null | null | null | models.py | AliengirlLiv/dreamer-pytorch-1 | 33979d7c61d0406d27ea46b9dcbbd823f765a518 | [
"MIT"
] | null | null | null | models.py | AliengirlLiv/dreamer-pytorch-1 | 33979d7c61d0406d27ea46b9dcbbd823f765a518 | [
"MIT"
] | null | null | null | from typing import Optional, List
import torch
from torch import jit, nn
from torch.nn import functional as F
import torch.distributions
from torch.distributions.normal import Normal
from torch.distributions.transforms import Transform, TanhTransform
from torch.distributions.transformed_distribution import TransformedD... | 43.831776 | 264 | 0.703625 | from typing import Optional, List
import torch
from torch import jit, nn
from torch.nn import functional as F
import torch.distributions
from torch.distributions.normal import Normal
from torch.distributions.transforms import Transform, TanhTransform
from torch.distributions.transformed_distribution import TransformedD... | true | true |
1c3e23a077709ee776901018e5e918adc3753882 | 5,253 | py | Python | essmc2/hooks/checkpoint.py | huang-ziyuan/EssentialMC2 | 87141df94c1ac8e426ceec071720b97f5b9d3b88 | [
"MIT"
] | null | null | null | essmc2/hooks/checkpoint.py | huang-ziyuan/EssentialMC2 | 87141df94c1ac8e426ceec071720b97f5b9d3b88 | [
"MIT"
] | null | null | null | essmc2/hooks/checkpoint.py | huang-ziyuan/EssentialMC2 | 87141df94c1ac8e426ceec071720b97f5b9d3b88 | [
"MIT"
] | null | null | null | # Copyright 2021 Alibaba Group Holding Limited. All Rights Reserved.
import os.path as osp
import sys
import warnings
import torch
import torch.distributed as du
from essmc2.utils.file_systems import FS
from .hook import Hook
from .registry import HOOKS
_DEFAULT_CHECKPOINT_PRIORITY = 300
@HOOKS.register_class()
cl... | 46.078947 | 112 | 0.605559 |
import os.path as osp
import sys
import warnings
import torch
import torch.distributed as du
from essmc2.utils.file_systems import FS
from .hook import Hook
from .registry import HOOKS
_DEFAULT_CHECKPOINT_PRIORITY = 300
@HOOKS.register_class()
class CheckpointHook(Hook):
def __init__(self,
i... | true | true |
1c3e24b64b12c99d3c2a85aa3935636a6cba247d | 1,799 | py | Python | scripts/run_experiment_from_doodad.py | richardrl/rlkit | 088dae169a8d5ba1430094eee66f27b2cb7c4998 | [
"MIT"
] | null | null | null | scripts/run_experiment_from_doodad.py | richardrl/rlkit | 088dae169a8d5ba1430094eee66f27b2cb7c4998 | [
"MIT"
] | null | null | null | scripts/run_experiment_from_doodad.py | richardrl/rlkit | 088dae169a8d5ba1430094eee66f27b2cb7c4998 | [
"MIT"
] | null | null | null | import doodad as dd
from rlkit.launchers.launcher_util import run_experiment_here
import torch.multiprocessing as mp
import faulthandler
if __name__ == "__main__":
faulthandler.enable()
import matplotlib
matplotlib.use('agg')
print("set fork")
mp.set_start_method('forkserver')
args_dict = dd.g... | 35.27451 | 77 | 0.625347 | import doodad as dd
from rlkit.launchers.launcher_util import run_experiment_here
import torch.multiprocessing as mp
import faulthandler
if __name__ == "__main__":
faulthandler.enable()
import matplotlib
matplotlib.use('agg')
print("set fork")
mp.set_start_method('forkserver')
args_dict = dd.g... | true | true |
1c3e252741d2610fad7636ac06b808e2e1d03668 | 108 | py | Python | resume/views.py | AkinWilderman/myPort | 3ddeea04ccffe3ed7b66d6dba2c1f2dc00c9eb6c | [
"Apache-2.0"
] | null | null | null | resume/views.py | AkinWilderman/myPort | 3ddeea04ccffe3ed7b66d6dba2c1f2dc00c9eb6c | [
"Apache-2.0"
] | null | null | null | resume/views.py | AkinWilderman/myPort | 3ddeea04ccffe3ed7b66d6dba2c1f2dc00c9eb6c | [
"Apache-2.0"
] | null | null | null | from django.shortcuts import render
def resume(request):
return render(request, 'resume/resume.html')
| 18 | 48 | 0.759259 | from django.shortcuts import render
def resume(request):
return render(request, 'resume/resume.html')
| true | true |
1c3e264641306fb838bde0f6cd3792460c73a77c | 16,387 | py | Python | main.py | chiro2001/cumcm-a | 6e8c11166c98b6683433423a595f346198cc4790 | [
"MIT"
] | null | null | null | main.py | chiro2001/cumcm-a | 6e8c11166c98b6683433423a595f346198cc4790 | [
"MIT"
] | null | null | null | main.py | chiro2001/cumcm-a | 6e8c11166c98b6683433423a595f346198cc4790 | [
"MIT"
] | null | null | null | import os
import argparse
import pandas as pd
import time
import matplotlib.pyplot as plt
import traceback
import torch.optim as optim
from tqdm import trange
import threading
from utils import *
import cv2
from base_logger import logger
from fast import FAST
# 是否使用多线程显示图像
draw_threaded: bool = False
# 一些全局变量
g_fig =... | 39.968293 | 119 | 0.564045 | import os
import argparse
import pandas as pd
import time
import matplotlib.pyplot as plt
import traceback
import torch.optim as optim
from tqdm import trange
import threading
from utils import *
import cv2
from base_logger import logger
from fast import FAST
draw_threaded: bool = False
g_fig = None
g_frame: np.nda... | true | true |
1c3e2743ad3dfe6322f1b8f5dbbb80cc79502c6d | 851 | py | Python | dbupgrade/apply.py | srittau/dbupgrade | 53472599c175768e2269d84ca7aed670d55c202b | [
"MIT"
] | 1 | 2020-10-26T13:28:47.000Z | 2020-10-26T13:28:47.000Z | dbupgrade/apply.py | srittau/dbupgrade | 53472599c175768e2269d84ca7aed670d55c202b | [
"MIT"
] | 83 | 2020-06-02T09:38:02.000Z | 2022-02-01T07:56:05.000Z | dbupgrade/apply.py | srittau/dbupgrade | 53472599c175768e2269d84ca7aed670d55c202b | [
"MIT"
] | null | null | null | import logging
from typing import Sequence
from sqlalchemy.exc import SQLAlchemyError
from dbupgrade.db import update_sql
from dbupgrade.files import FileInfo
def apply_files(db_url: str, files: Sequence[FileInfo]) -> None:
for file_info in files:
try:
apply_file(db_url, file_info)
e... | 25.787879 | 75 | 0.625147 | import logging
from typing import Sequence
from sqlalchemy.exc import SQLAlchemyError
from dbupgrade.db import update_sql
from dbupgrade.files import FileInfo
def apply_files(db_url: str, files: Sequence[FileInfo]) -> None:
for file_info in files:
try:
apply_file(db_url, file_info)
e... | true | true |
1c3e2799e1257b8489558f2dbcfe4857fb38cb9b | 1,507 | py | Python | cci-book/ed6/stacks_and_queues.py | topliceanu/learn | 6f4bb19fffb7b2baa88f047409075d5765ee6308 | [
"MIT"
] | 24 | 2016-03-21T07:53:54.000Z | 2020-06-29T12:16:36.000Z | cci-book/ed6/stacks_and_queues.py | topliceanu/learn | 6f4bb19fffb7b2baa88f047409075d5765ee6308 | [
"MIT"
] | 5 | 2015-09-29T17:12:36.000Z | 2020-03-26T20:51:56.000Z | cci-book/ed6/stacks_and_queues.py | topliceanu/learn | 6f4bb19fffb7b2baa88f047409075d5765ee6308 | [
"MIT"
] | 12 | 2016-05-24T16:48:32.000Z | 2020-10-02T12:22:09.000Z | # -*- coding: utf-8 -*-
class ThreeStacks(object):
""" 3.1 Three in One: Describe how you could use a
single array to implement three stacks.
"""
def __init__(self, size):
self.arr = [None] * size
self.stack1_ptr = 0
self.stack2_ptr = 1
self.stack3_ptr = 2
def pop(s... | 30.14 | 74 | 0.554745 |
class ThreeStacks(object):
def __init__(self, size):
self.arr = [None] * size
self.stack1_ptr = 0
self.stack2_ptr = 1
self.stack3_ptr = 2
def pop(self, stack_no):
pass
def push(self, stack_no, item):
if stack_no == 1:
self.stack1_ptr = self.sta... | true | true |
1c3e27cf69c44694f8da63091c8cb9bdb2fde621 | 1,008 | py | Python | lib/django-1.4/django/__init__.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 26 | 2015-01-20T08:02:38.000Z | 2020-06-10T04:57:41.000Z | lib/django-1.4/django/__init__.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 4 | 2016-02-28T05:53:54.000Z | 2017-01-03T07:39:50.000Z | lib/django-1.4/django/__init__.py | MiCHiLU/google_appengine_sdk | 3da9f20d7e65e26c4938d2c4054bc4f39cbc5522 | [
"Apache-2.0"
] | 13 | 2016-02-28T00:14:23.000Z | 2021-05-03T15:47:36.000Z | VERSION = (1, 4, 13, 'final', 0)
def get_version(version=None):
"""Derives a PEP386-compliant version number from VERSION."""
if version is None:
version = VERSION
assert len(version) == 5
assert version[3] in ('alpha', 'beta', 'rc', 'final')
# Now build the two parts of the version number... | 32.516129 | 65 | 0.575397 | VERSION = (1, 4, 13, 'final', 0)
def get_version(version=None):
if version is None:
version = VERSION
assert len(version) == 5
assert version[3] in ('alpha', 'beta', 'rc', 'final')
parts = 2 if version[2] == 0 else 3
main = '.'.join(str(x) for x in version[:parts])
... | true | true |
1c3e283ff6e40fcdc1cc634891aebc01bad33f95 | 10,106 | py | Python | contrib/spendfrom/spendfrom.py | IngenuityCoin/Ingenuity | 475289926e435a9939358c695f4f10d1503bfa0c | [
"MIT"
] | 4 | 2018-12-06T23:56:18.000Z | 2021-03-06T10:15:33.000Z | contrib/spendfrom/spendfrom.py | IngenuityCoin/Ingenuity | 475289926e435a9939358c695f4f10d1503bfa0c | [
"MIT"
] | null | null | null | contrib/spendfrom/spendfrom.py | IngenuityCoin/Ingenuity | 475289926e435a9939358c695f4f10d1503bfa0c | [
"MIT"
] | 5 | 2018-12-06T23:56:41.000Z | 2021-05-10T06:35:51.000Z | #!/usr/bin/env python
#
# Use the raw transactions API to spend INGYs received on particular addresses,
# and send any change back to that same address.
#
# Example usage:
# spendfrom.py # Lists available funds
# spendfrom.py --from=ADDRESS --to=ADDRESS --amount=11.00
#
# Assumes it will talk to a ingenuityd or inge... | 37.708955 | 111 | 0.635167 |
mport *
import getpass
import math
import os
import os.path
import platform
import sys
import time
from jsonrpc import ServiceProxy, json
BASE_FEE=Decimal("0.001")
def check_json_precision():
n = Decimal("20000000.00000003")
satoshis = int(json.loads(json.dumps(float(n)))*1.0e8)
if satoshis != 20000... | true | true |
1c3e285315e8e1bf8ff79b5fe6dafb98ae8c51fa | 9,590 | py | Python | mykits/gallery-dl-wrap.py | fakegit/mo-han-toolbox | 9d5bbc1fe7f12040715d3a0d3f320a1ad617aed8 | [
"MIT"
] | null | null | null | mykits/gallery-dl-wrap.py | fakegit/mo-han-toolbox | 9d5bbc1fe7f12040715d3a0d3f320a1ad617aed8 | [
"MIT"
] | null | null | null | mykits/gallery-dl-wrap.py | fakegit/mo-han-toolbox | 9d5bbc1fe7f12040715d3a0d3f320a1ad617aed8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
import webbrowser
from mylib.ext.console_app import *
# if os.name != 'nt':
# raise NotImplementedError('launch new console window')
env_var = os.environ
conf_path = fstk.make_path(env_var['gallery_dl_conf']).strip('"')
base_dir = fstk.make_path(env_var['gallery_dl_base_directory... | 39.303279 | 117 | 0.525339 |
import os
import webbrowser
from mylib.ext.console_app import *
env_var = os.environ
conf_path = fstk.make_path(env_var['gallery_dl_conf']).strip('"')
base_dir = fstk.make_path(env_var['gallery_dl_base_directory']).strip('"')
pause_on_error = os.environ.get('PAUSEONERROR', 'yes').lower() in {'yes', 'true', '1'}
... | true | true |
1c3e28b9b4e22d45e6bc49dc9b089760647d975c | 969 | py | Python | exercises/en/exc_03_07.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 2,085 | 2019-04-17T13:10:40.000Z | 2022-03-30T21:51:46.000Z | exercises/en/exc_03_07.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 79 | 2019-04-18T14:42:55.000Z | 2022-03-07T08:15:43.000Z | exercises/en/exc_03_07.py | Jette16/spacy-course | 32df0c8f6192de6c9daba89740a28c0537e4d6a0 | [
"MIT"
] | 361 | 2019-04-17T13:34:32.000Z | 2022-03-28T04:42:45.000Z | import spacy
from spacy.matcher import PhraseMatcher
from spacy.tokens import Span
nlp = spacy.load("en_core_web_sm")
animals = ["Golden Retriever", "cat", "turtle", "Rattus norvegicus"]
animal_patterns = list(nlp.pipe(animals))
print("animal_patterns:", animal_patterns)
matcher = PhraseMatcher(nlp.vocab)
matcher.add(... | 32.3 | 83 | 0.734778 | import spacy
from spacy.matcher import PhraseMatcher
from spacy.tokens import Span
nlp = spacy.load("en_core_web_sm")
animals = ["Golden Retriever", "cat", "turtle", "Rattus norvegicus"]
animal_patterns = list(nlp.pipe(animals))
print("animal_patterns:", animal_patterns)
matcher = PhraseMatcher(nlp.vocab)
matcher.add(... | true | true |
1c3e28f5a566ed14d744c671218a676d561e1fb3 | 2,754 | py | Python | tests/tag/test_tag_sticker.py | annihilatorrrr/sticker-finder | 873468f8de26cc32d1de9b688140569b8086ab5b | [
"MIT"
] | 82 | 2018-11-13T05:39:44.000Z | 2022-01-18T17:08:44.000Z | tests/tag/test_tag_sticker.py | annihilatorrrr/sticker-finder | 873468f8de26cc32d1de9b688140569b8086ab5b | [
"MIT"
] | 25 | 2018-12-02T18:45:52.000Z | 2022-03-21T22:54:19.000Z | tests/tag/test_tag_sticker.py | annihilatorrrr/sticker-finder | 873468f8de26cc32d1de9b688140569b8086ab5b | [
"MIT"
] | 23 | 2019-01-22T20:04:50.000Z | 2022-02-01T14:57:28.000Z | """Test the normal tagging process."""
from tests.helper import assert_sticker_contains_tags
from stickerfinder.models import Tag
from stickerfinder.logic.tag import tag_sticker
def test_add_tags(session, user, sticker_set):
"""Add new tags to a sticker."""
for sticker in sticker_set.stickers:
# Crea... | 33.585366 | 87 | 0.702251 | from tests.helper import assert_sticker_contains_tags
from stickerfinder.models import Tag
from stickerfinder.logic.tag import tag_sticker
def test_add_tags(session, user, sticker_set):
for sticker in sticker_set.stickers:
tag_sticker(session, f"tag-{sticker.file_id}", sticker, user)
sessio... | true | true |
1c3e2932ba0ff0ebb282143338f70a8062bf3935 | 914 | py | Python | build/navigation/costmap_2d/cmake/costmap_2d-genmsg-context.py | lty1994/ros_project | d55ce07c592d545f9a43330fa6bf96af6651575f | [
"BSD-2-Clause"
] | null | null | null | build/navigation/costmap_2d/cmake/costmap_2d-genmsg-context.py | lty1994/ros_project | d55ce07c592d545f9a43330fa6bf96af6651575f | [
"BSD-2-Clause"
] | null | null | null | build/navigation/costmap_2d/cmake/costmap_2d-genmsg-context.py | lty1994/ros_project | d55ce07c592d545f9a43330fa6bf96af6651575f | [
"BSD-2-Clause"
] | null | null | null | # generated from genmsg/cmake/pkg-genmsg.context.in
messages_str = "/home/autolabor/catkin_ws/src/navigation/costmap_2d/msg/VoxelGrid.msg"
services_str = ""
pkg_name = "costmap_2d"
dependencies_str = "std_msgs;geometry_msgs;map_msgs"
langs = "gencpp;geneus;genlisp;gennodejs;genpy"
dep_include_paths_str = "costmap_2d;/... | 76.166667 | 444 | 0.794311 |
messages_str = "/home/autolabor/catkin_ws/src/navigation/costmap_2d/msg/VoxelGrid.msg"
services_str = ""
pkg_name = "costmap_2d"
dependencies_str = "std_msgs;geometry_msgs;map_msgs"
langs = "gencpp;geneus;genlisp;gennodejs;genpy"
dep_include_paths_str = "costmap_2d;/home/autolabor/catkin_ws/src/navigation/costmap_2d/... | true | true |
1c3e29688e081410e4d2cebe46cf7c935368e8e9 | 4,017 | py | Python | websites_metrics_collector/communication/webpages_fetcher.py | antoniodimariano/websites_metrics_collector | 5113a680612b126005ac7f9f52ed35d26b806ea0 | [
"Apache-2.0"
] | null | null | null | websites_metrics_collector/communication/webpages_fetcher.py | antoniodimariano/websites_metrics_collector | 5113a680612b126005ac7f9f52ed35d26b806ea0 | [
"Apache-2.0"
] | null | null | null | websites_metrics_collector/communication/webpages_fetcher.py | antoniodimariano/websites_metrics_collector | 5113a680612b126005ac7f9f52ed35d26b806ea0 | [
"Apache-2.0"
] | null | null | null | import aiohttp
import asyncio
import time
from websites_metrics_collector.helpers.regex_functions import check_patterns_in_webpage
from collections import namedtuple
from typing import Tuple, NamedTuple
WebCheck = namedtuple('WebCheck', ['url', 'http_status', 'elapsed_time', 'pattern_verified'])
async def fetch_url_... | 51.5 | 238 | 0.717202 | import aiohttp
import asyncio
import time
from websites_metrics_collector.helpers.regex_functions import check_patterns_in_webpage
from collections import namedtuple
from typing import Tuple, NamedTuple
WebCheck = namedtuple('WebCheck', ['url', 'http_status', 'elapsed_time', 'pattern_verified'])
async def fetch_url_... | true | true |
1c3e29d0b0480d986c373efdc3b0b54efb1318d0 | 495 | py | Python | sky.py | Evolution0/voxelcraft | 06251870ea668cc54520947003f07e62ec736237 | [
"MIT"
] | 3 | 2021-04-10T21:10:56.000Z | 2021-04-18T12:08:45.000Z | sky.py | Evolution0/voxelcraft | 06251870ea668cc54520947003f07e62ec736237 | [
"MIT"
] | null | null | null | sky.py | Evolution0/voxelcraft | 06251870ea668cc54520947003f07e62ec736237 | [
"MIT"
] | null | null | null | from ursina import *
# 9. Create sky
class Sky(Entity):
def __init__(self):
super().__init__(
parent = scene, # Specifies parent of sky so it scales properly
model = 'sphere', # Specifies sky model
texture = 'assets/sky.jpg', # Sk... | 38.076923 | 92 | 0.50303 | from ursina import *
class Sky(Entity):
def __init__(self):
super().__init__(
parent = scene,
model = 'sphere',
texture = 'assets/sky.jpg',
scale = 1000,
double_sided = True ... | true | true |
1c3e29e29ac16f488b5df61e155bff9bc5c1340c | 877 | py | Python | galileo/framework/pytorch/python/dataset/__init__.py | YaoPu2021/galileo | 0ebee2052bf78205f93f8cbbe0e2884095dd7af7 | [
"Apache-2.0"
] | 115 | 2021-09-09T03:01:58.000Z | 2022-03-30T10:46:26.000Z | galileo/framework/pytorch/python/dataset/__init__.py | Hacky-DH/galileo | e4d5021f0287dc879730dfa287b9a056f152f712 | [
"Apache-2.0"
] | 1 | 2021-12-09T07:34:41.000Z | 2021-12-20T06:24:27.000Z | galileo/framework/pytorch/python/dataset/__init__.py | Hacky-DH/galileo | e4d5021f0287dc879730dfa287b9a056f152f712 | [
"Apache-2.0"
] | 28 | 2021-09-10T08:47:20.000Z | 2022-03-17T07:29:26.000Z | # Copyright 2020 JD.com, Inc. Galileo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by a... | 33.730769 | 80 | 0.676169 |
from . import (
base_dataset,
batched_dataloader,
vertex_dataset,
edge_dataset,
dataset_pipeline,
textline_dataset,
range_dataset,
tensor_dataset,
)
| true | true |
1c3e2a7a0cc37de06ca731cbcf5536d7446fb1d5 | 2,120 | py | Python | examples/rigidbody/plot_rigidbody.py | certik/pydy | d201b75d3e8fd8295b375e52eb4ce4c1f35adfb4 | [
"BSD-3-Clause"
] | 1 | 2016-05-09T06:57:10.000Z | 2016-05-09T06:57:10.000Z | examples/rigidbody/plot_rigidbody.py | certik/pydy | d201b75d3e8fd8295b375e52eb4ce4c1f35adfb4 | [
"BSD-3-Clause"
] | null | null | null | examples/rigidbody/plot_rigidbody.py | certik/pydy | d201b75d3e8fd8295b375e52eb4ce4c1f35adfb4 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python
import rigidbody_lib as rb
from scipy.integrate import odeint
from numpy import array, arange, zeros
# Dimensions of rigid body in the three body fixed directions
# Following are the dimensions of an iPhone 3G taken from apple.com
h = 0.1155 # meters in the 1 direction
w = 0.0621 # met... | 29.444444 | 101 | 0.616981 |
import rigidbody_lib as rb
from scipy.integrate import odeint
from numpy import array, arange, zeros
h = 0.1155
w = 0.0621
d = 0.0123
m = 0.135
g = 0.0081
I11 = m*(w**2 + d**2)/12.
I22 = m*(h**2 + d**2)/12.
I33 = m*(h**2 + w**2)/12.
params = [m, 0, I11, I22, I33]
q0 = [0.0,... | true | true |
1c3e2aa81b6e22c57c854590c745988c1b912547 | 2,089 | py | Python | draw.py | ritterliu/BigData | 32ca80a8a61256b741822c9ff1b037b0384de943 | [
"Apache-2.0"
] | null | null | null | draw.py | ritterliu/BigData | 32ca80a8a61256b741822c9ff1b037b0384de943 | [
"Apache-2.0"
] | null | null | null | draw.py | ritterliu/BigData | 32ca80a8a61256b741822c9ff1b037b0384de943 | [
"Apache-2.0"
] | null | null | null | from numpy import array
from numpy.random import normal
from matplotlib import pyplot
def genData():
heights = []
weights = []
grades = []
N = 100
for i in range(N):
while True:
height = normal(172, 6)
if 0 < height: break
while True:
weight = (... | 25.790123 | 125 | 0.601723 | from numpy import array
from numpy.random import normal
from matplotlib import pyplot
def genData():
heights = []
weights = []
grades = []
N = 100
for i in range(N):
while True:
height = normal(172, 6)
if 0 < height: break
while True:
weight = (... | false | true |
1c3e2b451501a4e34182c8af139665bf7d618113 | 497 | py | Python | practice69.py | ikramulkayes/Python_season2 | d057460d07c5d2d218ecd52e08c1d355add44df2 | [
"MIT"
] | null | null | null | practice69.py | ikramulkayes/Python_season2 | d057460d07c5d2d218ecd52e08c1d355add44df2 | [
"MIT"
] | null | null | null | practice69.py | ikramulkayes/Python_season2 | d057460d07c5d2d218ecd52e08c1d355add44df2 | [
"MIT"
] | null | null | null | class Marks:
def __init__(self,num = None):
self.mark = num
def __add__(self,other):
obj = Marks()
obj.mark = self.mark + other.mark
return obj
Q1 = Marks(int(input("Quiz 1 (out of 10): ")))
Q2 = Marks(int(input("Quiz 2 (out of 10): ")))
Lab = Marks(int(input("Lab (out of 30): "... | 33.133333 | 48 | 0.581489 | class Marks:
def __init__(self,num = None):
self.mark = num
def __add__(self,other):
obj = Marks()
obj.mark = self.mark + other.mark
return obj
Q1 = Marks(int(input("Quiz 1 (out of 10): ")))
Q2 = Marks(int(input("Quiz 2 (out of 10): ")))
Lab = Marks(int(input("Lab (out of 30): "... | true | true |
1c3e2bbadcd5954813727b42a7702e096675d480 | 6,464 | py | Python | snlds/utils.py | shaun95/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-03-13T21:48:52.000Z | 2022-03-13T21:48:52.000Z | snlds/utils.py | shaun95/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | null | null | null | snlds/utils.py | shaun95/google-research | d41bbaca1eb9bfd980ec2b3fd201c3ddb4d1f2e5 | [
"Apache-2.0"
] | 1 | 2022-03-30T07:20:29.000Z | 2022-03-30T07:20:29.000Z | # coding=utf-8
# Copyright 2022 The Google Research Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicab... | 36.727273 | 76 | 0.691368 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import numpy as np
import tensorflow as tf
layers = tf.keras.layers
FLOAT_TYPE = tf.float32
def build_birnn(rnn_type, rnn_hidden_dim):
rnn_type = rnn_type.lower()
if rnn_type == "gru":
... | true | true |
1c3e2bdebb7ce8eab502e84ca3413255a0d6fe7a | 8,786 | py | Python | sdk/python/pulumi_azure_native/avs/v20210601/hcx_enterprise_site.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/avs/v20210601/hcx_enterprise_site.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | sdk/python/pulumi_azure_native/avs/v20210601/hcx_enterprise_site.py | polivbr/pulumi-azure-native | 09571f3bf6bdc4f3621aabefd1ba6c0d4ecfb0e7 | [
"Apache-2.0"
] | null | null | null | # coding=utf-8
# *** WARNING: this file was generated by the Pulumi SDK Generator. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
__... | 44.598985 | 678 | 0.665946 |
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from ... import _utilities
__all__ = ['HcxEnterpriseSiteArgs', 'HcxEnterpriseSite']
@pulumi.input_type
class HcxEnterpriseSiteArgs:
def __init__(__self__, *,
private_cloud_... | true | true |
1c3e2ca8021695e3f7b0ca2fa0cef92808120aef | 10,751 | py | Python | sdk/redhatopenshift/azure-mgmt-redhatopenshift/tests/test_cli_mgmt_redhatopenshift.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/redhatopenshift/azure-mgmt-redhatopenshift/tests/test_cli_mgmt_redhatopenshift.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/redhatopenshift/azure-mgmt-redhatopenshift/tests/test_cli_mgmt_redhatopenshift.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding: utf-8
#-------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for
# license information.
#----------------------------------------------------------------------... | 44.061475 | 237 | 0.61278 |
import unittest
import azure.mgmt.redhatopenshift
from devtools_testutils import AzureMgmtTestCase, ResourceGroupPreparer
AZURE_LOCATION = 'australiaeast'
@unittest.skip("skip test")
class MgmtAzureRedHatOpenShiftClientTest(AzureMgmtTestCase):
def setUp(self):
super(MgmtAzureRedHatOpen... | true | true |
1c3e2d7a94c129453bc740cb391bfd2454d467f1 | 14,082 | py | Python | source/tests/py_tests/names_in_error_messages_test.py | Panzerschrek/U-00DC-Sprache | eb677a66d178985433a62eb6b8a50ce2cdb14b1a | [
"BSD-3-Clause"
] | 45 | 2016-06-21T22:28:43.000Z | 2022-03-26T12:21:46.000Z | source/tests/py_tests/names_in_error_messages_test.py | Panzerschrek/U-00DC-Sprache | eb677a66d178985433a62eb6b8a50ce2cdb14b1a | [
"BSD-3-Clause"
] | 6 | 2020-07-12T18:00:10.000Z | 2021-11-30T11:20:14.000Z | source/tests/py_tests/names_in_error_messages_test.py | Panzerschrek/U-00DC-Sprache | eb677a66d178985433a62eb6b8a50ce2cdb14b1a | [
"BSD-3-Clause"
] | 5 | 2019-09-03T17:20:34.000Z | 2022-01-30T15:10:21.000Z | from py_tests_common import *
def TypeNameInErrorMessage_FundamentalTypes():
c_program_text= """
fn Foo()
{
var i32 x= 0.0f;
}
"""
errors_list= ConvertErrors( tests_lib.build_program_with_errors( c_program_text ) )
assert( len(errors_list) > 0 )
# must print something, like "conversion from f32 to i32"
... | 32.978923 | 102 | 0.687757 | from py_tests_common import *
def TypeNameInErrorMessage_FundamentalTypes():
c_program_text= """
fn Foo()
{
var i32 x= 0.0f;
}
"""
errors_list= ConvertErrors( tests_lib.build_program_with_errors( c_program_text ) )
assert( len(errors_list) > 0 )
assert( errors_list[0].error_code == "TypesMismatch" )
... | true | true |
1c3e2e4500ec56f373ffa34b204ef913befead83 | 892 | py | Python | rankAndTier.py | NullP0interExcepti0n/TierbyPlaytime | ebdfa404aa9e0e85942b6e50c10243606948832a | [
"MIT"
] | 1 | 2018-04-03T15:37:34.000Z | 2018-04-03T15:37:34.000Z | rankAndTier.py | NullP0interExcepti0n/TierbyPlaytime | ebdfa404aa9e0e85942b6e50c10243606948832a | [
"MIT"
] | null | null | null | rankAndTier.py | NullP0interExcepti0n/TierbyPlaytime | ebdfa404aa9e0e85942b6e50c10243606948832a | [
"MIT"
] | null | null | null | import tensorflow as tf
import numpy as np
data = np.loadtxt('./data.csv', delimiter=',', unpack=True, dtype='float32')
playTime = np.transpose(data[0])
rank = np.transpose(data[1])
W = tf.Variable(tf.random_uniform([1], 0, 20000))
b = tf.Variable(tf.random_uniform([1], 1, 2000000))
X = tf.placeholder(tf.float32, n... | 30.758621 | 80 | 0.692825 | import tensorflow as tf
import numpy as np
data = np.loadtxt('./data.csv', delimiter=',', unpack=True, dtype='float32')
playTime = np.transpose(data[0])
rank = np.transpose(data[1])
W = tf.Variable(tf.random_uniform([1], 0, 20000))
b = tf.Variable(tf.random_uniform([1], 1, 2000000))
X = tf.placeholder(tf.float32, n... | true | true |
1c3e2e5dede47d12cc5e4c184ba07d5166260b1c | 1,259 | py | Python | examples/study.cases/CUP2D/optimal-transport/findSample.py | JonathanLehner/korali | 90f97d8e2fed2311f988f39cfe014f23ba7dd6cf | [
"MIT"
] | 43 | 2018-07-26T07:20:42.000Z | 2022-03-02T10:23:12.000Z | examples/study.cases/CUP2D/optimal-transport/findSample.py | JonathanLehner/korali | 90f97d8e2fed2311f988f39cfe014f23ba7dd6cf | [
"MIT"
] | 212 | 2018-09-21T10:44:07.000Z | 2022-03-22T14:33:05.000Z | examples/study.cases/CUP2D/optimal-transport/findSample.py | JonathanLehner/korali | 90f97d8e2fed2311f988f39cfe014f23ba7dd6cf | [
"MIT"
] | 16 | 2018-07-25T15:00:36.000Z | 2022-03-22T14:19:46.000Z | import argparse
import json
import math
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--directory', type=str, help='Directory to check for latest file.', required=True)
parser.add_argument('--objective', type=int, help='Objective function.', required=True)
parser.a... | 27.369565 | 107 | 0.621922 | import argparse
import json
import math
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('--directory', type=str, help='Directory to check for latest file.', required=True)
parser.add_argument('--objective', type=int, help='Objective function.', required=True)
parser.a... | true | true |
1c3e30d6b87fe2900c07eb89a0d860f637827108 | 3,954 | py | Python | salt/utils/psutil_compat.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | 1 | 2020-03-31T22:51:16.000Z | 2020-03-31T22:51:16.000Z | salt/utils/psutil_compat.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | null | null | null | salt/utils/psutil_compat.py | yuriks/salt | d2a5bd8adddb98ec1718d79384aa13b4f37e8028 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-09-30T07:00:01.000Z | 2021-09-30T07:00:01.000Z | # -*- coding: utf-8 -*-
'''
Version agnostic psutil hack to fully support both old (<2.0) and new (>=2.0)
psutil versions.
The old <1.0 psutil API is dropped in psutil 3.0
Should be removed once support for psutil <2.0 is dropped. (eg RHEL 6)
Built off of http://grodola.blogspot.com/2014/01/psutil-20-porting.html
''... | 33.226891 | 109 | 0.608245 |
from __future__ import absolute_import, print_function, unicode_literals
from salt.ext import six
import psutil # pylint: disable=3rd-party-module-not-gated
if psutil.version_info >= (2, 0):
from psutil import * # pylint: disable=wildcard-import,unused-wildcard-import,3rd-party-module-not-gated
else:
... | true | true |
1c3e321b75875673f93646662427b6867f9f25aa | 2,514 | py | Python | experiments/murtaza/multiworld/reset_free/pointmass/pointmass_her_td3_count_based.py | Asap7772/rail-rl-franka-eval | 4bf99072376828193d05b53cf83c7e8f4efbd3ba | [
"MIT"
] | null | null | null | experiments/murtaza/multiworld/reset_free/pointmass/pointmass_her_td3_count_based.py | Asap7772/rail-rl-franka-eval | 4bf99072376828193d05b53cf83c7e8f4efbd3ba | [
"MIT"
] | null | null | null | experiments/murtaza/multiworld/reset_free/pointmass/pointmass_her_td3_count_based.py | Asap7772/rail-rl-franka-eval | 4bf99072376828193d05b53cf83c7e8f4efbd3ba | [
"MIT"
] | null | null | null | import railrl.misc.hyperparameter as hyp
from multiworld.envs.pygame.point2d import Point2DWallEnv
from railrl.data_management.obs_dict_count_based_replay_buffer import ObsDictCountBasedRelabelingBuffer
from railrl.launchers.experiments.murtaza.multiworld_her import her_td3_experiment
from railrl.launchers.launcher_uti... | 32.649351 | 103 | 0.627287 | import railrl.misc.hyperparameter as hyp
from multiworld.envs.pygame.point2d import Point2DWallEnv
from railrl.data_management.obs_dict_count_based_replay_buffer import ObsDictCountBasedRelabelingBuffer
from railrl.launchers.experiments.murtaza.multiworld_her import her_td3_experiment
from railrl.launchers.launcher_uti... | true | true |
1c3e331971bd647943a1017508dcc29d184c53b3 | 6,660 | py | Python | rasa/core/policies/embedding_policy.py | pablhoney/RasaTest | acba90ccae0cf69efc70a7656f85c8d2266b4926 | [
"Apache-2.0"
] | null | null | null | rasa/core/policies/embedding_policy.py | pablhoney/RasaTest | acba90ccae0cf69efc70a7656f85c8d2266b4926 | [
"Apache-2.0"
] | null | null | null | rasa/core/policies/embedding_policy.py | pablhoney/RasaTest | acba90ccae0cf69efc70a7656f85c8d2266b4926 | [
"Apache-2.0"
] | null | null | null | import logging
from typing import Any, Dict, Optional, Text
from rasa.constants import DOCS_URL_MIGRATION_GUIDE
from rasa.core.constants import DEFAULT_POLICY_PRIORITY, DIALOGUE
from rasa.core.featurizers import TrackerFeaturizer
from rasa.core.policies.ted_policy import TEDPolicy
from rasa.utils.tensorflow.constants ... | 39.176471 | 87 | 0.668769 | import logging
from typing import Any, Dict, Optional, Text
from rasa.constants import DOCS_URL_MIGRATION_GUIDE
from rasa.core.constants import DEFAULT_POLICY_PRIORITY, DIALOGUE
from rasa.core.featurizers import TrackerFeaturizer
from rasa.core.policies.ted_policy import TEDPolicy
from rasa.utils.tensorflow.constants ... | true | true |
1c3e33c7f0102c2010cb88e2f21ad95e7f86bb16 | 8,725 | py | Python | core/test.py | xrcui/Pix2Vox | 30ba9518dcfc06add38bf5e8491a6a05fc08eaee | [
"MIT"
] | null | null | null | core/test.py | xrcui/Pix2Vox | 30ba9518dcfc06add38bf5e8491a6a05fc08eaee | [
"MIT"
] | null | null | null | core/test.py | xrcui/Pix2Vox | 30ba9518dcfc06add38bf5e8491a6a05fc08eaee | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
#
# Developed by Haozhe Xie <cshzxie@gmail.com>
import json
import numpy as np
import os
import torch
import torch.backends.cudnn
import torch.utils.data
import utils.binvox_visualization
import utils.data_loaders
import utils.data_transforms
import utils.network_utils
from datetime import da... | 42.560976 | 119 | 0.615931 |
import json
import numpy as np
import os
import torch
import torch.backends.cudnn
import torch.utils.data
import utils.binvox_visualization
import utils.data_loaders
import utils.data_transforms
import utils.network_utils
from datetime import datetime as dt
from models.encoder import Encoder
from models.decoder ... | true | true |
1c3e3463540fc028f1d93f2a5ec8e2f0d1614f17 | 4,399 | py | Python | runners/episode_runner.py | gingkg/pymarl | b5a72b3ab6c89b4a492f5853c02c1ce3f9189ea4 | [
"MIT"
] | 3 | 2021-04-11T07:34:11.000Z | 2022-03-23T08:43:37.000Z | runners/episode_runner.py | gingkg/pymarl | b5a72b3ab6c89b4a492f5853c02c1ce3f9189ea4 | [
"MIT"
] | null | null | null | runners/episode_runner.py | gingkg/pymarl | b5a72b3ab6c89b4a492f5853c02c1ce3f9189ea4 | [
"MIT"
] | 1 | 2021-05-28T11:26:20.000Z | 2021-05-28T11:26:20.000Z | from envs import REGISTRY as env_REGISTRY
from functools import partial
from components.episode_buffer import EpisodeBatch
import numpy as np
class EpisodeRunner:
def __init__(self, args, logger):
self.args = args
self.logger = logger
self.batch_size = self.args.batch_size_run
ass... | 34.367188 | 111 | 0.605592 | from envs import REGISTRY as env_REGISTRY
from functools import partial
from components.episode_buffer import EpisodeBatch
import numpy as np
class EpisodeRunner:
def __init__(self, args, logger):
self.args = args
self.logger = logger
self.batch_size = self.args.batch_size_run
ass... | true | true |
1c3e34bfe2cd4e5b3c1b755fca75ab3620ff4d3c | 1,422 | py | Python | xlsxwriter/test/comparison/test_chart_gradient10.py | Rippling/XlsxWriter-1 | be8d1cb8f8b156cf87bbe5d591f1f5475804be44 | [
"BSD-2-Clause"
] | null | null | null | xlsxwriter/test/comparison/test_chart_gradient10.py | Rippling/XlsxWriter-1 | be8d1cb8f8b156cf87bbe5d591f1f5475804be44 | [
"BSD-2-Clause"
] | null | null | null | xlsxwriter/test/comparison/test_chart_gradient10.py | Rippling/XlsxWriter-1 | be8d1cb8f8b156cf87bbe5d591f1f5475804be44 | [
"BSD-2-Clause"
] | null | null | null | ###############################################################################
#
# Tests for XlsxWriter.
#
# SPDX-License-Identifier: BSD-2-Clause
# Copyright (c), 2013-2021, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparison_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompar... | 25.392857 | 79 | 0.552743 | true | true | |
1c3e3559ddaf9744115065e974ddb78f69bb6858 | 912 | py | Python | example/webservice/module/module.py | errord/sputnik | b83c635a9a160dcd5809265c0d9d231ade33e5ea | [
"BSD-3-Clause"
] | null | null | null | example/webservice/module/module.py | errord/sputnik | b83c635a9a160dcd5809265c0d9d231ade33e5ea | [
"BSD-3-Clause"
] | null | null | null | example/webservice/module/module.py | errord/sputnik | b83c635a9a160dcd5809265c0d9d231ade33e5ea | [
"BSD-3-Clause"
] | 1 | 2018-03-04T04:48:44.000Z | 2018-03-04T04:48:44.000Z | #-*- coding: utf-8 -*
#
# Copyright 2011 shuotao.me
# Copyright 2012 2013 2014 msx.com
# by error.d@gmail.com
# 2014-08-26
#
from datetime import datetime
from sputnik.SpuDBObject import SpuDBObject, Field
from sputnik.SpuDateTime import SpuDateTime
class FoodAndPlace(SpuDBObject):
_table_ = 'sputnik.food_and_pla... | 35.076923 | 88 | 0.673246 |
from datetime import datetime
from sputnik.SpuDBObject import SpuDBObject, Field
from sputnik.SpuDateTime import SpuDateTime
class FoodAndPlace(SpuDBObject):
_table_ = 'sputnik.food_and_place'
def __init__(self, spudb, spucache, debug):
SpuDBObject.__init__(self, FoodAndPlace._table_, spudb, sp... | true | true |
1c3e35c660ab6db7e356e609d03b3debbcd82e20 | 253 | py | Python | randomness/__init__.py | jpmolinamatute/randomness | a9b24098b912637548ba8e89d1260a082c1da734 | [
"Apache-2.0"
] | null | null | null | randomness/__init__.py | jpmolinamatute/randomness | a9b24098b912637548ba8e89d1260a082c1da734 | [
"Apache-2.0"
] | null | null | null | randomness/__init__.py | jpmolinamatute/randomness | a9b24098b912637548ba8e89d1260a082c1da734 | [
"Apache-2.0"
] | null | null | null | # pylint: disable=unused-import
from .db_oauth import OAuth
from .db_library import Library
from .common import TOKEN_URL, str_to_base64, Mark
from .client_aouth import get_access_token, save_access_token
from .client_requests import generate_playlist
| 31.625 | 61 | 0.84585 |
from .db_oauth import OAuth
from .db_library import Library
from .common import TOKEN_URL, str_to_base64, Mark
from .client_aouth import get_access_token, save_access_token
from .client_requests import generate_playlist
| true | true |
1c3e365b10d8d6c328efd3f1e795a8fe15bbcc68 | 1,245 | py | Python | src/consensus/consensus_message_pb2.py | SINTEF-Infosec/sawtooth-consensus-engine-template | f5b895f13bcfa94216a5148104b3b1419df643c1 | [
"MIT"
] | null | null | null | src/consensus/consensus_message_pb2.py | SINTEF-Infosec/sawtooth-consensus-engine-template | f5b895f13bcfa94216a5148104b3b1419df643c1 | [
"MIT"
] | null | null | null | src/consensus/consensus_message_pb2.py | SINTEF-Infosec/sawtooth-consensus-engine-template | f5b895f13bcfa94216a5148104b3b1419df643c1 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Generated by the protocol buffer compiler. DO NOT EDIT!
# source: consensus_message.proto
"""Generated protocol buffer code."""
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message... | 35.571429 | 155 | 0.818474 |
from google.protobuf import descriptor as _descriptor
from google.protobuf import descriptor_pool as _descriptor_pool
from google.protobuf import message as _message
from google.protobuf import reflection as _reflection
from google.protobuf import symbol_database as _symbol_database
_sym_db = _symbol_database.Defa... | true | true |
1c3e393d8d84c64a7dbeda497a5fda44ee5664af | 3,201 | py | Python | plot/dataio.py | psFournier/rltf | aae5451415dc18deda3c0c84580df42a12dc3843 | [
"MIT"
] | null | null | null | plot/dataio.py | psFournier/rltf | aae5451415dc18deda3c0c84580df42a12dc3843 | [
"MIT"
] | null | null | null | plot/dataio.py | psFournier/rltf | aae5451415dc18deda3c0c84580df42a12dc3843 | [
"MIT"
] | null | null | null | import json
import os
from collections import OrderedDict
import numpy as np
import tensorflow as tf
import tabulate
CODE_DIR = os.path.abspath(os.path.dirname(__file__))
CONF_DIR = os.path.join(CODE_DIR, "conf")
def save_scores(scores, file, args):
"""Write scores in table format to a .txt file and to a .tex ... | 26.454545 | 114 | 0.657295 | import json
import os
from collections import OrderedDict
import numpy as np
import tensorflow as tf
import tabulate
CODE_DIR = os.path.abspath(os.path.dirname(__file__))
CONF_DIR = os.path.join(CODE_DIR, "conf")
def save_scores(scores, file, args):
envs = sorted(scores.keys())
labels = [label for label ... | true | true |
1c3e39601e53da411311267ee7a86cb6a1474cd3 | 891 | py | Python | vocalkiev/urls.py | CATALINA-DJAGER/vocalkiev-crm-django | 69d1491a7f94dd9943c9204ac15e8a6ca2a1a3b0 | [
"MIT"
] | null | null | null | vocalkiev/urls.py | CATALINA-DJAGER/vocalkiev-crm-django | 69d1491a7f94dd9943c9204ac15e8a6ca2a1a3b0 | [
"MIT"
] | 1 | 2021-12-02T06:13:15.000Z | 2021-12-02T06:13:15.000Z | vocalkiev/urls.py | CATALINA-DJAGER/vocalkiev-crm-django | 69d1491a7f94dd9943c9204ac15e8a6ca2a1a3b0 | [
"MIT"
] | 1 | 2021-12-02T16:08:44.000Z | 2021-12-02T16:08:44.000Z |
"""vocalkiev URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/3.2/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: path('', views.home, name='home')
Class-bas... | 31.821429 | 77 | 0.710438 |
from django.contrib import admin
from django.urls import include, path
from django.conf.urls.i18n import i18n_patterns
urlpatterns = [
]
urlpatterns += i18n_patterns(
path('', include('crm.urls')),
path('admin', admin.site.urls),
)
| true | true |
1c3e39edd4fba2c79db95c44ce2cbc3db03c56cf | 122 | py | Python | credentials.py | Suraj1127/facebook-crawler | 5f61a30127c3583d19c2f63dc871ae95705a36f7 | [
"MIT"
] | null | null | null | credentials.py | Suraj1127/facebook-crawler | 5f61a30127c3583d19c2f63dc871ae95705a36f7 | [
"MIT"
] | null | null | null | credentials.py | Suraj1127/facebook-crawler | 5f61a30127c3583d19c2f63dc871ae95705a36f7 | [
"MIT"
] | null | null | null | """
Contains credentials, Email or Phone and Password
"""
# enter your credentials here
EMAIL_OR_PHONE = ''
PASSWORD = '' | 17.428571 | 49 | 0.721311 |
EMAIL_OR_PHONE = ''
PASSWORD = '' | true | true |
1c3e3b78b0a80f991205c4899e210a194da71819 | 589 | py | Python | testerlib/models/suite_code.py | mnaumanali94/PYTHON-SDK | 97eceab462d86b8666ff1f74830d30cae5202a35 | [
"MIT"
] | null | null | null | testerlib/models/suite_code.py | mnaumanali94/PYTHON-SDK | 97eceab462d86b8666ff1f74830d30cae5202a35 | [
"MIT"
] | null | null | null | testerlib/models/suite_code.py | mnaumanali94/PYTHON-SDK | 97eceab462d86b8666ff1f74830d30cae5202a35 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
"""
testerlib.models.suite_code
This file was automatically generated for Stamplay by APIMATIC v2.0 ( https://apimatic.io ) on 08/03/2016
"""
class SuiteCode(object):
"""Implementation of the 'SuiteCode' enum.
A integer based enum representing a Suite in a game of cards
... | 19 | 109 | 0.634975 |
class SuiteCode(object):
HEARTS = 1
SPADES = 2
CLUBS = 3
DIAMONDS = 4
| true | true |
1c3e3c2b893f760a44c50c9da620ef79ee4dd129 | 6,894 | py | Python | src/ctf_gameserver/checker/metrics.py | flagbot/ctf-gameserver | cb59363ce93e8cb80bac03da4f150db6f12051aa | [
"ISC"
] | 30 | 2016-11-14T23:26:52.000Z | 2022-02-23T02:06:40.000Z | src/ctf_gameserver/checker/metrics.py | flagbot/ctf-gameserver | cb59363ce93e8cb80bac03da4f150db6f12051aa | [
"ISC"
] | 64 | 2017-04-28T21:19:01.000Z | 2021-06-12T16:40:29.000Z | src/ctf_gameserver/checker/metrics.py | flagbot/ctf-gameserver | cb59363ce93e8cb80bac03da4f150db6f12051aa | [
"ISC"
] | 25 | 2016-11-16T19:37:31.000Z | 2022-02-23T02:06:22.000Z | import logging
import queue
from wsgiref import simple_server
import prometheus_client
from ctf_gameserver.lib.metrics import SilentHandler
def inc(metrics_queue, name, value=1, labels=None):
metrics_queue.put(MetricsMessage(name, 'inc', value, labels))
def dec(metrics_queue, name, value=1, labels=None):
... | 36.47619 | 109 | 0.6481 | import logging
import queue
from wsgiref import simple_server
import prometheus_client
from ctf_gameserver.lib.metrics import SilentHandler
def inc(metrics_queue, name, value=1, labels=None):
metrics_queue.put(MetricsMessage(name, 'inc', value, labels))
def dec(metrics_queue, name, value=1, labels=None):
... | true | true |
1c3e3c5371505395b1b5ede79b55396e902e1f0b | 348 | py | Python | cctbx/sgtbx/direct_space_asu/proto/__init__.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 155 | 2016-11-23T12:52:16.000Z | 2022-03-31T15:35:44.000Z | cctbx/sgtbx/direct_space_asu/proto/__init__.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 590 | 2016-12-10T11:31:18.000Z | 2022-03-30T23:10:09.000Z | cctbx/sgtbx/direct_space_asu/proto/__init__.py | dperl-sol/cctbx_project | b9e390221a2bc4fd00b9122e97c3b79c632c6664 | [
"BSD-3-Clause-LBNL"
] | 115 | 2016-11-15T08:17:28.000Z | 2022-02-09T15:30:14.000Z | from __future__ import absolute_import, division, print_function
import sys
import boost_adaptbx.boost.python as bp
ext = bp.import_ext("cctbx_sgtbx_asu_ext")
from cctbx_sgtbx_asu_ext import *
def asu_show_(asu, f=None):
if f is None:
f = sys.stdout
print(asu.as_string(), file=f)
direct_space_asu.show_compre... | 24.857143 | 64 | 0.79023 | from __future__ import absolute_import, division, print_function
import sys
import boost_adaptbx.boost.python as bp
ext = bp.import_ext("cctbx_sgtbx_asu_ext")
from cctbx_sgtbx_asu_ext import *
def asu_show_(asu, f=None):
if f is None:
f = sys.stdout
print(asu.as_string(), file=f)
direct_space_asu.show_compre... | true | true |
1c3e3c5ad328772370c7da8c0fc0264690bcf649 | 8,357 | py | Python | tests/test_keycache.py | deesto/scitokens | 2eaa31c052093389fc090a89de32afc131c486ee | [
"Apache-2.0"
] | null | null | null | tests/test_keycache.py | deesto/scitokens | 2eaa31c052093389fc090a89de32afc131c486ee | [
"Apache-2.0"
] | null | null | null | tests/test_keycache.py | deesto/scitokens | 2eaa31c052093389fc090a89de32afc131c486ee | [
"Apache-2.0"
] | null | null | null | """
Test the keycache
"""
import os
import tempfile
import shutil
import unittest
from unittest import mock
from scitokens.utils.keycache import KeyCache
from scitokens.utils.errors import UnableToCreateCache
from cryptography.hazmat.primitives.asymmetric.rsa import generate_private_key
from cryptography.hazmat.backen... | 35.411017 | 119 | 0.637669 |
import os
import tempfile
import shutil
import unittest
from unittest import mock
from scitokens.utils.keycache import KeyCache
from scitokens.utils.errors import UnableToCreateCache
from cryptography.hazmat.primitives.asymmetric.rsa import generate_private_key
from cryptography.hazmat.backends import default_backend
... | true | true |
1c3e3dc3cd371984b5da1866b6293f75fd8c2b20 | 351 | py | Python | dashboard/urls.py | JohnRoach/beat-desk | 743e00bed954dbaada3c6e664386c23bc3c35393 | [
"MIT"
] | 1 | 2015-12-30T22:03:42.000Z | 2015-12-30T22:03:42.000Z | dashboard/urls.py | JohnRoach/beat-desk | 743e00bed954dbaada3c6e664386c23bc3c35393 | [
"MIT"
] | null | null | null | dashboard/urls.py | JohnRoach/beat-desk | 743e00bed954dbaada3c6e664386c23bc3c35393 | [
"MIT"
] | null | null | null | from . import views
from django.conf.urls import url
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'posts$', views.posts, name='posts'),
url(r'posts/post/(?P<post_id>[0-9]+)/$', views.post, name='post'),
url(r'logout$', views.logout_user, name='logout_user'),
url(r'login$', views.log... | 29.25 | 70 | 0.635328 | from . import views
from django.conf.urls import url
urlpatterns = [
url(r'^$', views.index, name='index'),
url(r'posts$', views.posts, name='posts'),
url(r'posts/post/(?P<post_id>[0-9]+)/$', views.post, name='post'),
url(r'logout$', views.logout_user, name='logout_user'),
url(r'login$', views.log... | true | true |
1c3e3e2f5dec30762f5afd5a04fa89772914f997 | 1,128 | py | Python | hpc-historias-clinicas/medicos/views.py | btenaglia/hpc-historias-clinicas | 649d8660381381b1c591667760c122d73071d5ec | [
"BSD-3-Clause"
] | null | null | null | hpc-historias-clinicas/medicos/views.py | btenaglia/hpc-historias-clinicas | 649d8660381381b1c591667760c122d73071d5ec | [
"BSD-3-Clause"
] | null | null | null | hpc-historias-clinicas/medicos/views.py | btenaglia/hpc-historias-clinicas | 649d8660381381b1c591667760c122d73071d5ec | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
from django.contrib import messages
from braces.views import LoginRequiredMixin
from django.views.generic import (
ListView,
CreateView,
UpdateView,
DeleteView
)
from .models import Medicos
class MedicosMixin(object):
@property
def success_msg(self):
return No... | 20.888889 | 70 | 0.693262 |
from django.contrib import messages
from braces.views import LoginRequiredMixin
from django.views.generic import (
ListView,
CreateView,
UpdateView,
DeleteView
)
from .models import Medicos
class MedicosMixin(object):
@property
def success_msg(self):
return NotImplemented
def g... | true | true |
1c3e3e3be4e2e71a4c6cf9a26979d0ca814dbfcb | 69 | py | Python | fluent_python/variable/__init__.py | ftconan/python3 | eb63ba33960072f792ecce6db809866b38c402f8 | [
"MIT"
] | 1 | 2018-12-19T22:07:56.000Z | 2018-12-19T22:07:56.000Z | fluent_python/variable/__init__.py | ftconan/python3 | eb63ba33960072f792ecce6db809866b38c402f8 | [
"MIT"
] | 12 | 2020-03-14T05:32:26.000Z | 2022-03-12T00:08:49.000Z | fluent_python/variable/__init__.py | ftconan/python3 | eb63ba33960072f792ecce6db809866b38c402f8 | [
"MIT"
] | 1 | 2018-12-19T22:08:00.000Z | 2018-12-19T22:08:00.000Z | """
@author: magician
@file: __init__.py.py
@date: 2020/10/22
""" | 13.8 | 23 | 0.608696 | true | true | |
1c3e3e76cf5680110bc941958c2cb7a3e671d5f4 | 539 | py | Python | tests/test.py | idmillington/layout | c452d1d7a74c9a74f7639c1b49e2a41c4e354bb5 | [
"MIT"
] | 6 | 2015-08-10T01:43:54.000Z | 2020-10-06T19:09:10.000Z | tests/test.py | idmillington/layout | c452d1d7a74c9a74f7639c1b49e2a41c4e354bb5 | [
"MIT"
] | null | null | null | tests/test.py | idmillington/layout | c452d1d7a74c9a74f7639c1b49e2a41c4e354bb5 | [
"MIT"
] | null | null | null | import os.path
import unittest
import layout
class TestVersion(unittest.TestCase):
def text_version_exists(self):
assert layout.__version__
def test_version_tuple(self):
assert layout.__version_info__
assert len(layout.__version_info__) == 3
for value in layout.__versi... | 26.95 | 76 | 0.666048 | import os.path
import unittest
import layout
class TestVersion(unittest.TestCase):
def text_version_exists(self):
assert layout.__version__
def test_version_tuple(self):
assert layout.__version_info__
assert len(layout.__version_info__) == 3
for value in layout.__versi... | true | true |
1c3e3fa2eeb30250a2c5eee6f0177b7298022c3b | 3,320 | py | Python | 03 - Pandas/b_series.py | 2020-A-Python-GR1/py-sanango-simbana-edison-ubaldo | 5ca5a6a8c8596cc76b0d09f3bb700f0c6c1780e8 | [
"MIT"
] | null | null | null | 03 - Pandas/b_series.py | 2020-A-Python-GR1/py-sanango-simbana-edison-ubaldo | 5ca5a6a8c8596cc76b0d09f3bb700f0c6c1780e8 | [
"MIT"
] | null | null | null | 03 - Pandas/b_series.py | 2020-A-Python-GR1/py-sanango-simbana-edison-ubaldo | 5ca5a6a8c8596cc76b0d09f3bb700f0c6c1780e8 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jul 14 07:57:41 2020
@author: edison
"""
import numpy as np
import pandas as pd
lista_numeros = [1,2,3]
tupla_numeros = (1,2,3)
np_numeros = np.array([1,2,3])
series_a = pd.Series(lista_numeros)
series_b = pd.Series(tupla_numeros)
series_c = pd.Serie... | 19.761905 | 119 | 0.702108 |
import numpy as np
import pandas as pd
lista_numeros = [1,2,3]
tupla_numeros = (1,2,3)
np_numeros = np.array([1,2,3])
series_a = pd.Series(lista_numeros)
series_b = pd.Series(tupla_numeros)
series_c = pd.Series(np_numeros)
series_d = pd.Series(
[True,
False,
12,
12.12,
"EDISON",
None,
... | true | true |
1c3e417eccb4ae602abfb27f20df371f2ec0b0da | 5,520 | py | Python | contrib/seeds/makeseeds.py | ScaMar/ICHIBA | 7524763de06cecedbc8d6c355a429c664bdf1008 | [
"MIT"
] | 2 | 2019-03-09T10:03:47.000Z | 2019-03-23T19:59:08.000Z | contrib/seeds/makeseeds.py | ScaMar/ICHIBA | 7524763de06cecedbc8d6c355a429c664bdf1008 | [
"MIT"
] | null | null | null | contrib/seeds/makeseeds.py | ScaMar/ICHIBA | 7524763de06cecedbc8d6c355a429c664bdf1008 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# Copyright (c) 2013-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Generate seeds.txt from Pieter's DNS seeder
#
NSEEDS=512
MAX_SEEDS_PER_ASN=2
MIN_BLOCKS = 615801
#... | 32.093023 | 186 | 0.567391 |
#
NSEEDS=512
MAX_SEEDS_PER_ASN=2
MIN_BLOCKS = 615801
# These are hosts that have been observed to be behaving strangely (e.g.
# aggressively connecting to every node).
SUSPICIOUS_HOSTS = {
""
}
import re
import sys
import dns.resolver
import collections
PATTERN_IPV4 = re.compile(r"^((\d{1,3})\.(\d{1,3})... | true | true |
1c3e427700e8283980f5d1e25076bee67001188e | 3,242 | py | Python | project/settings.py | martinfaucheux/django-archving | 9b1cc056c2f6e92fa42e31079a5f87037deef4e0 | [
"MIT"
] | 1 | 2022-01-19T19:03:53.000Z | 2022-01-19T19:03:53.000Z | project/settings.py | martinfaucheux/django-archiving | 9b1cc056c2f6e92fa42e31079a5f87037deef4e0 | [
"MIT"
] | null | null | null | project/settings.py | martinfaucheux/django-archiving | 9b1cc056c2f6e92fa42e31079a5f87037deef4e0 | [
"MIT"
] | null | null | null | """
Django settings for project project.
Generated by 'django-admin startproject' using Django 3.2.9.
For more information on this file, see
https://docs.djangoproject.com/en/3.2/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/3.2/ref/settings/
"""
from pathlib... | 25.730159 | 91 | 0.700494 |
from pathlib import Path
BASE_DIR = Path(__file__).resolve().parent.parent
SECRET_KEY = 'django-insecure--*6_ke@q3!$(w!u1g!3fmh&&7iqm=(5p8j!w7rsp#%yb7olt$6'
DEBUG = True
ALLOWED_HOSTS = []
# Application definition
INSTALLED_APPS = [
'django.contrib.admin',
'django.contrib.auth',
'django.contr... | true | true |
1c3e4427f0acdcd97d1d8b28cfb60e335832903b | 11,958 | py | Python | MultiQubit_PulseGenerator/gates.py | philip-krantz/Drivers | 31d05e852f4e30d40d41949f3f76e9322f0be9e8 | [
"MIT"
] | 48 | 2015-11-16T13:35:11.000Z | 2022-02-24T11:02:14.000Z | MultiQubit_PulseGenerator/gates.py | philip-krantz/Drivers | 31d05e852f4e30d40d41949f3f76e9322f0be9e8 | [
"MIT"
] | 30 | 2015-11-16T14:37:46.000Z | 2021-02-22T19:39:34.000Z | MultiQubit_PulseGenerator/gates.py | philip-krantz/Drivers | 31d05e852f4e30d40d41949f3f76e9322f0be9e8 | [
"MIT"
] | 61 | 2015-11-12T18:31:58.000Z | 2022-03-04T12:59:35.000Z | #!/usr/bin/env python3
from copy import copy
import numpy as np
import logging
from sequence import Step
log = logging.getLogger('LabberDriver')
# TODO remove Step dep from CompositeGate
class BaseGate:
"""Base class for a qubit gate.
"""
def get_adjusted_pulse(self, pulse):
pulse = copy(pulse)... | 26.281319 | 79 | 0.594581 |
from copy import copy
import numpy as np
import logging
from sequence import Step
log = logging.getLogger('LabberDriver')
class BaseGate:
def get_adjusted_pulse(self, pulse):
pulse = copy(pulse)
return pulse
def __repr__(self):
return self.__str__()
class OneQubitGate(BaseGate):... | true | true |
1c3e4597b373a87c78c63dc3fc76ffc8ff061d3a | 349 | py | Python | projgrad/tests/basic.py | andim/projgrad | 3854c704b6c413f8d79aa324ef4758676cdb8c68 | [
"MIT"
] | 10 | 2019-01-05T13:51:01.000Z | 2022-03-18T01:32:14.000Z | projgrad/tests/basic.py | andim/projgrad | 3854c704b6c413f8d79aa324ef4758676cdb8c68 | [
"MIT"
] | null | null | null | projgrad/tests/basic.py | andim/projgrad | 3854c704b6c413f8d79aa324ef4758676cdb8c68 | [
"MIT"
] | 6 | 2017-11-16T01:00:09.000Z | 2022-01-17T14:08:26.000Z | import numpy as np
import numpy.testing as npt
import projgrad
def test_basic():
def objective(x):
f = np.sum(x**2)
grad = 2 * x
return f, grad
res = projgrad.minimize(objective, [0.1, 0.7, 0.2], reltol=1e-8)
npt.assert_allclose(res.x, np.ones(3)/3.0)
if __name__ == '__main__'... | 21.8125 | 68 | 0.613181 | import numpy as np
import numpy.testing as npt
import projgrad
def test_basic():
def objective(x):
f = np.sum(x**2)
grad = 2 * x
return f, grad
res = projgrad.minimize(objective, [0.1, 0.7, 0.2], reltol=1e-8)
npt.assert_allclose(res.x, np.ones(3)/3.0)
if __name__ == '__main__'... | true | true |
1c3e4881dd472c3c3641cb8a815e4baf723a9eb9 | 4,758 | py | Python | unionability_search/calculate_unionability.py | guenthermi/table-embeddings | 3ce094483fc5057b18f898d450a7c376d49818fa | [
"MIT"
] | 6 | 2021-03-17T09:53:10.000Z | 2022-03-28T18:26:22.000Z | unionability_search/calculate_unionability.py | guenthermi/table-embeddings | 3ce094483fc5057b18f898d450a7c376d49818fa | [
"MIT"
] | null | null | null | unionability_search/calculate_unionability.py | guenthermi/table-embeddings | 3ce094483fc5057b18f898d450a7c376d49818fa | [
"MIT"
] | null | null | null | import json
import random
from argparse import ArgumentParser, FileType, ArgumentDefaultsHelpFormatter
from web_table_embedding_model import WebTableEmbeddingModel
from fasttext_embedding_model import FasttextEmbeddingModel
from dataset_loader import DatasetLoader
def create_arg_parser():
parser = ArgumentParser... | 40.322034 | 136 | 0.648382 | import json
import random
from argparse import ArgumentParser, FileType, ArgumentDefaultsHelpFormatter
from web_table_embedding_model import WebTableEmbeddingModel
from fasttext_embedding_model import FasttextEmbeddingModel
from dataset_loader import DatasetLoader
def create_arg_parser():
parser = ArgumentParser... | true | true |
1c3e49531beeb3eeeae61b576d87ce5954cb8183 | 13,826 | py | Python | pysnmp/CISCO-PORT-STORM-CONTROL-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 11 | 2021-02-02T16:27:16.000Z | 2021-08-31T06:22:49.000Z | pysnmp/CISCO-PORT-STORM-CONTROL-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 75 | 2021-02-24T17:30:31.000Z | 2021-12-08T00:01:18.000Z | pysnmp/CISCO-PORT-STORM-CONTROL-MIB.py | agustinhenze/mibs.snmplabs.com | 1fc5c07860542b89212f4c8ab807057d9a9206c7 | [
"Apache-2.0"
] | 10 | 2019-04-30T05:51:36.000Z | 2022-02-16T03:33:41.000Z | #
# PySNMP MIB module CISCO-PORT-STORM-CONTROL-MIB (http://snmplabs.com/pysmi)
# ASN.1 source file:///Users/davwang4/Dev/mibs.snmplabs.com/asn1/CISCO-PORT-STORM-CONTROL-MIB
# Produced by pysmi-0.3.4 at Mon Apr 29 17:53:01 2019
# On host DAVWANG4-M-1475 platform Darwin version 18.5.0 by user davwang4
# Using Python vers... | 116.184874 | 2,067 | 0.756907 |
OctetString, ObjectIdentifier, Integer = mibBuilder.importSymbols("ASN1", "OctetString", "ObjectIdentifier", "Integer")
NamedValues, = mibBuilder.importSymbols("ASN1-ENUMERATION", "NamedValues")
ConstraintsUnion, ValueRangeConstraint, ValueSizeConstraint, ConstraintsIntersection, SingleValueConstraint = mibBuild... | true | true |
1c3e49ef3383c56912290e48c5478aca6b0b5d26 | 6,204 | py | Python | userbot/modules/updater.py | sekret666/codeaz | 141d9a656326f4a5a6c149d3433e39cf7396a8d2 | [
"MIT"
] | null | null | null | userbot/modules/updater.py | sekret666/codeaz | 141d9a656326f4a5a6c149d3433e39cf7396a8d2 | [
"MIT"
] | null | null | null | userbot/modules/updater.py | sekret666/codeaz | 141d9a656326f4a5a6c149d3433e39cf7396a8d2 | [
"MIT"
] | 1 | 2021-12-15T06:27:45.000Z | 2021-12-15T06:27:45.000Z | # C O D E A Z \ Samil
"""
Yenilənmə
"""
from os import remove, execle, path, environ
import asyncio
import sys
from git import Repo
from git.exc import GitCommandError, InvalidGitRepositoryError, NoSuchPathError
from userbot import CMD_HELP, HEROKU_APIKEY, HEROKU_APPNAME, UPSTREAM_REPO_URL
from userbot.events impo... | 31.492386 | 106 | 0.605738 |
"""
Yenilənmə
"""
from os import remove, execle, path, environ
import asyncio
import sys
from git import Repo
from git.exc import GitCommandError, InvalidGitRepositoryError, NoSuchPathError
from userbot import CMD_HELP, HEROKU_APIKEY, HEROKU_APPNAME, UPSTREAM_REPO_URL
from userbot.events import register
from user... | false | true |
1c3e4a2aa5c64da844f61435080a6ca743e744d5 | 5,823 | py | Python | project/user/views.py | ownpush/otp_demo_server | a3ec5515cf17c2c7a9411fc05f77de2a46ba7d99 | [
"MIT"
] | 5 | 2016-03-01T02:04:47.000Z | 2017-12-28T22:28:53.000Z | project/user/views.py | ownpush/otp_demo_server | a3ec5515cf17c2c7a9411fc05f77de2a46ba7d99 | [
"MIT"
] | null | null | null | project/user/views.py | ownpush/otp_demo_server | a3ec5515cf17c2c7a9411fc05f77de2a46ba7d99 | [
"MIT"
] | 3 | 2016-03-01T02:04:49.000Z | 2019-02-08T09:55:18.000Z | """
The MIT License (MIT)
Copyright (c) 2016 Fastboot Mobile LLC.
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
... | 32.898305 | 105 | 0.641765 |
t binascii
import os
import json
ypt.generate_password_hash(otp)
print(otp)
device = devices[0]
push_status_txt = sendpush(device.push_id, otp)
push_json = json.loads(push_status_txt)
if "status" in push_json:
if push_json['status'] == "... | true | true |
1c3e4a7f8481de0720dcd6f1810d7ec36b019d1f | 5,716 | py | Python | 2020/bilibili-spider/zone/test.py | lyh543/Some-Codes | 2b295338f802e71c6b613350f1b6e8299856780f | [
"MIT"
] | 3 | 2020-06-05T08:29:16.000Z | 2021-12-09T05:44:54.000Z | 2020/bilibili-spider/zone/test.py | lyh543/Some-Codes | 2b295338f802e71c6b613350f1b6e8299856780f | [
"MIT"
] | null | null | null | 2020/bilibili-spider/zone/test.py | lyh543/Some-Codes | 2b295338f802e71c6b613350f1b6e8299856780f | [
"MIT"
] | 1 | 2020-09-15T14:50:31.000Z | 2020-09-15T14:50:31.000Z | #!/usr/bin/env python3
'''
Bilibili 各分区视频数量查询脚本
作者: WuSiYu(wu.siyu@hotmail.com)
日期: 2018-07-26 00:54
本脚本参考了uupers团队的研究: https://github.com/uupers/BiliSpider/wiki
'''
from urllib import request
import json
ALL_RID = (12, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 37, 39, 41, 46, 47,... | 42.340741 | 459 | 0.501924 |
from urllib import request
import json
ALL_RID = (12, 15, 16, 17, 19, 20, 21, 22, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 37, 39, 41, 46, 47, 50, 51, 53, 54, 56, 59, 60, 65, 67, 71, 74, 75, 76, 77, 79, 80, 82, 83, 85, 86, 94, 95, 96, 98, 114, 116, 118, 120, 121, 122, 124, 125, 126, 127, 128, 130, 131, 134, 135, 13... | true | true |
1c3e4b284b2e2a931344b34edf163c476a161ef9 | 12,893 | py | Python | tests/models/test_gpu.py | javierlorenzod/pytorch-lightning | 6dba26666aa564db414eb238d99a4213006d8220 | [
"Apache-2.0"
] | 1 | 2021-08-05T01:45:26.000Z | 2021-08-05T01:45:26.000Z | tests/models/test_gpu.py | javierlorenzod/pytorch-lightning | 6dba26666aa564db414eb238d99a4213006d8220 | [
"Apache-2.0"
] | null | null | null | tests/models/test_gpu.py | javierlorenzod/pytorch-lightning | 6dba26666aa564db414eb238d99a4213006d8220 | [
"Apache-2.0"
] | 1 | 2021-02-16T00:47:46.000Z | 2021-02-16T00:47:46.000Z | # Copyright The PyTorch Lightning team.
#
# 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... | 39.670769 | 118 | 0.692701 |
from collections import namedtuple
from unittest.mock import patch
import pytest
import torch
from torchtext.data import Batch, Dataset, Example, Field, LabelField
import tests.helpers.pipelines as tpipes
import tests.helpers.utils as tutils
from pytorch_lightning import Trainer
from pytorch_lightning.ut... | true | true |
1c3e4b60b760a917f64869badc26e0447f7b250e | 1,864 | py | Python | doodle/core/models/keyword.py | keakon/Doodle | d349a2686902fe6aac7087e32a7de76495890c0a | [
"MIT"
] | 38 | 2016-02-22T07:49:40.000Z | 2021-07-14T09:46:48.000Z | doodle/core/models/keyword.py | keakon/Doodle | d349a2686902fe6aac7087e32a7de76495890c0a | [
"MIT"
] | 8 | 2016-02-22T07:51:16.000Z | 2018-10-05T02:11:51.000Z | doodle/core/models/keyword.py | keakon/Doodle | d349a2686902fe6aac7087e32a7de76495890c0a | [
"MIT"
] | 16 | 2016-03-27T03:36:16.000Z | 2020-09-23T10:04:52.000Z | # -*- coding: utf-8 -*-
import logging
from doodle.config import CONFIG
from doodle.core.property import IntegerProperty, StringProperty
from doodle.core.redis_client import redis_cache_client
from .base_model import JSONModel
class KeywordArticle(JSONModel):
keywords = StringProperty()
article_id = Intege... | 35.846154 | 115 | 0.656652 |
import logging
from doodle.config import CONFIG
from doodle.core.property import IntegerProperty, StringProperty
from doodle.core.redis_client import redis_cache_client
from .base_model import JSONModel
class KeywordArticle(JSONModel):
keywords = StringProperty()
article_id = IntegerProperty()
def _g... | true | true |
1c3e4baf278cb9e16666ec1e8178813371e0b652 | 1,569 | py | Python | nwb_conversion_tools/utils/metadata.py | miketrumpis/nwb-conversion-tools | 4d5c270b70eb4f1c09f98a6c04b51ccdf20336c1 | [
"BSD-3-Clause"
] | 19 | 2020-05-04T18:40:36.000Z | 2022-01-24T08:53:14.000Z | nwb_conversion_tools/utils/metadata.py | miketrumpis/nwb-conversion-tools | 4d5c270b70eb4f1c09f98a6c04b51ccdf20336c1 | [
"BSD-3-Clause"
] | 369 | 2020-04-06T14:20:08.000Z | 2022-03-31T16:05:48.000Z | nwb_conversion_tools/utils/metadata.py | miketrumpis/nwb-conversion-tools | 4d5c270b70eb4f1c09f98a6c04b51ccdf20336c1 | [
"BSD-3-Clause"
] | 10 | 2020-03-31T20:06:00.000Z | 2022-03-26T08:25:49.000Z | from pathlib import Path
import yaml
import json
class NoDatesSafeLoader(yaml.SafeLoader):
@classmethod
def remove_implicit_resolver(cls, tag_to_remove):
"""
Solution from here: https://stackoverflow.com/a/37958106/11483674
Remove implicit resolvers for a particular tag
Takes ... | 34.108696 | 95 | 0.660293 | from pathlib import Path
import yaml
import json
class NoDatesSafeLoader(yaml.SafeLoader):
@classmethod
def remove_implicit_resolver(cls, tag_to_remove):
if not "yaml_implicit_resolvers" in cls.__dict__:
cls.yaml_implicit_resolvers = cls.yaml_implicit_resolvers.copy()
for first_le... | true | true |
1c3e4c815d7c51fa5a1627fcbb87e19f55a67ceb | 11,265 | py | Python | scitbx/math/curve_fitting.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | scitbx/math/curve_fitting.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | scitbx/math/curve_fitting.py | rimmartin/cctbx_project | 644090f9432d9afc22cfb542fc3ab78ca8e15e5d | [
"BSD-3-Clause-LBNL"
] | null | null | null | from __future__ import division
import math
import libtbx
import libtbx.load_env
from libtbx import adopt_init_args
from scitbx.array_family import flex
import scitbx.lbfgs
import scitbx.math
from scitbx import matrix
class function_base(object):
def __call__(self, x_obs):
raise NotImplementedError
def par... | 31.37883 | 118 | 0.647226 | from __future__ import division
import math
import libtbx
import libtbx.load_env
from libtbx import adopt_init_args
from scitbx.array_family import flex
import scitbx.lbfgs
import scitbx.math
from scitbx import matrix
class function_base(object):
def __call__(self, x_obs):
raise NotImplementedError
def par... | true | true |
1c3e4cb556f40621a237c070e9f08e895f5000c9 | 193 | py | Python | code/util.py | unique-chan/YeLU | e70c1e7ab8504ff8d22a33b681d0538a0f6e5745 | [
"MIT"
] | 1 | 2021-07-01T16:00:54.000Z | 2021-07-01T16:00:54.000Z | code/util.py | unique-chan/YeLU | e70c1e7ab8504ff8d22a33b681d0538a0f6e5745 | [
"MIT"
] | null | null | null | code/util.py | unique-chan/YeLU | e70c1e7ab8504ff8d22a33b681d0538a0f6e5745 | [
"MIT"
] | null | null | null | def parsed_arguments_dict(my_args):
keys = [key for key in dir(my_args) if key[0] != '_']
dict = {}
for key in keys:
dict[key] = eval('my_args.' + str(key))
return dict
| 27.571429 | 57 | 0.585492 | def parsed_arguments_dict(my_args):
keys = [key for key in dir(my_args) if key[0] != '_']
dict = {}
for key in keys:
dict[key] = eval('my_args.' + str(key))
return dict
| true | true |
1c3e4d459da0c92c85b9d2f62df84f0f6e5f3f1a | 3,589 | py | Python | telegram_parser_console/link_generator.py | flexagoon/telegram_parser | 7f0e601c5ba03d48d889fe22561ea702db90e7bd | [
"Apache-2.0"
] | null | null | null | telegram_parser_console/link_generator.py | flexagoon/telegram_parser | 7f0e601c5ba03d48d889fe22561ea702db90e7bd | [
"Apache-2.0"
] | null | null | null | telegram_parser_console/link_generator.py | flexagoon/telegram_parser | 7f0e601c5ba03d48d889fe22561ea702db90e7bd | [
"Apache-2.0"
] | null | null | null | import random, string, itertools
def alphabets_generator():
alphabet = ['1', '2', '3','4' , '5', '6', '7', '8', '9', '0', '_']
for letter in range(97,123): #all letters except first alphabet
alphabet.append(chr(letter))
alphabet1 = [] #first letter alpha... | 37 | 140 | 0.58735 | import random, string, itertools
def alphabets_generator():
alphabet = ['1', '2', '3','4' , '5', '6', '7', '8', '9', '0', '_']
for letter in range(97,123):
alphabet.append(chr(letter))
alphabet1 = []
for letter in range(97,123):
alphabet1.a... | true | true |
1c3e4d48552630c2b67eed26096157fd2ff94ad5 | 9,209 | py | Python | get_turk_useful_res.py | NinaCalvi/OKBC | e25ad0296137ed354593c74509b077a22f60425e | [
"MIT"
] | 6 | 2020-07-06T14:31:18.000Z | 2021-09-13T10:15:14.000Z | get_turk_useful_res.py | NinaCalvi/OKBC | e25ad0296137ed354593c74509b077a22f60425e | [
"MIT"
] | 2 | 2021-09-12T17:49:09.000Z | 2021-09-14T15:28:54.000Z | get_turk_useful_res.py | NinaCalvi/OKBC | e25ad0296137ed354593c74509b077a22f60425e | [
"MIT"
] | 1 | 2021-06-07T01:46:44.000Z | 2021-06-07T01:46:44.000Z | # This code is used to generate an analysis html for the results of the mturk batch of project -
# TexKBC useful? (id=1419750).
# It requires the results.csv downloaded from mturk.
# Quality control is done, by giving all true facts (data from test.txt, which is known to be true)
# If turker choses false, then that hit... | 40.03913 | 162 | 0.621349 |
import pandas as pd
import numpy as np
import pprint
import argparse
import collections
import string
import os
import bs4 as bs
import itertools
ANSWER_OPTIONS = ['true','false']
REASON_OPTIONS = ['know','exp','guess','web']
def get_key_answer(key,id):
return string.Template('Answer.${key}_${id}.on').su... | true | true |
1c3e4e3785dd3453a62a10e3b0d8d4dc0d97b925 | 9,759 | py | Python | modules/obsolete_modules/modules_spect_mmd.py | ravi-0841/spect-pitch-gan | ea4b9ea8396df753e25e0b2cb210288f683d3903 | [
"MIT"
] | null | null | null | modules/obsolete_modules/modules_spect_mmd.py | ravi-0841/spect-pitch-gan | ea4b9ea8396df753e25e0b2cb210288f683d3903 | [
"MIT"
] | null | null | null | modules/obsolete_modules/modules_spect_mmd.py | ravi-0841/spect-pitch-gan | ea4b9ea8396df753e25e0b2cb210288f683d3903 | [
"MIT"
] | null | null | null | import tensorflow as tf
from modules.base_modules_default_init import *
def sampler(input_pitch, input_mfc, final_filters=1, reuse=False, \
scope_name='sampler'):
# Inputs have shape [batch_size, num_features, time]
inputs = tf.concat([input_mfc, input_pitch], axis=1, \
... | 39.510121 | 74 | 0.586536 | import tensorflow as tf
from modules.base_modules_default_init import *
def sampler(input_pitch, input_mfc, final_filters=1, reuse=False, \
scope_name='sampler'):
inputs = tf.concat([input_mfc, input_pitch], axis=1, \
name='sampler_input')
in... | true | true |
1c3e4e762da2a3ebd8df6777b090dcb9b9a5eb3e | 251 | py | Python | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-004/pg-4.4-grade-calculator.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-004/pg-4.4-grade-calculator.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | Python/Books/Learning-Programming-with-Python.Tamim-Shahriar-Subeen/chapter-004/pg-4.4-grade-calculator.py | shihab4t/Books-Code | b637b6b2ad42e11faf87d29047311160fe3b2490 | [
"Unlicense"
] | null | null | null | marks = input("Plase Enter your Marks: ")
marks = int(marks)
if marks >= 80:
grade = "A+"
elif marks >= 70:
grade = "A"
elif marks >= 60:
grade = "A-"
elif marks >= 50:
grade = "B"
else:
grade = "F"
print("Your Grade is", grade)
| 15.6875 | 41 | 0.553785 | marks = input("Plase Enter your Marks: ")
marks = int(marks)
if marks >= 80:
grade = "A+"
elif marks >= 70:
grade = "A"
elif marks >= 60:
grade = "A-"
elif marks >= 50:
grade = "B"
else:
grade = "F"
print("Your Grade is", grade)
| true | true |
1c3e4f66c4687b21cb3f34b0350b3438ab41ebc9 | 1,431 | py | Python | nsd1904/py02/day04/pymysql_crud.py | MrWangwf/nsd2019 | 5e859b4b1926dc098d236be3720779c50d0a55fc | [
"Apache-2.0"
] | 1 | 2019-09-19T04:53:22.000Z | 2019-09-19T04:53:22.000Z | nsd1904/py02/day04/pymysql_crud.py | MrWangwf/nsd2019 | 5e859b4b1926dc098d236be3720779c50d0a55fc | [
"Apache-2.0"
] | null | null | null | nsd1904/py02/day04/pymysql_crud.py | MrWangwf/nsd2019 | 5e859b4b1926dc098d236be3720779c50d0a55fc | [
"Apache-2.0"
] | 1 | 2021-12-28T04:26:02.000Z | 2021-12-28T04:26:02.000Z | import pymysql
# 创建到数据的连接
conn = pymysql.connect(
host='127.0.0.1',
port=3306,
user='root',
passwd='tedu.cn',
db='nsd1904',
charset='utf8'
)
cur = conn.cursor() # 创建游标,相当于文件对象
###################################
# 添加部门
# insert_dep = 'INSERT INTO departments(dep_id, dep_name) VALUES(%s, %s)'
... | 25.105263 | 73 | 0.540881 | import pymysql
conn = pymysql.connect(
host='127.0.0.1',
port=3306,
user='root',
passwd='tedu.cn',
db='nsd1904',
charset='utf8'
)
cur = conn.cursor()
| true | true |
1c3e506c7cd9bffe9f51f40d44ca105d09573419 | 663 | py | Python | daeungram/notifications/migrations/0002_auto_20190513_2141.py | daeunii94/daeungram | 7adea6bce03e2ff45cb8a6587c0a7612a0b855aa | [
"MIT"
] | null | null | null | daeungram/notifications/migrations/0002_auto_20190513_2141.py | daeunii94/daeungram | 7adea6bce03e2ff45cb8a6587c0a7612a0b855aa | [
"MIT"
] | 6 | 2020-09-04T21:25:37.000Z | 2022-02-26T10:47:20.000Z | daeungram/notifications/migrations/0002_auto_20190513_2141.py | daeunii94/daeungram | 7adea6bce03e2ff45cb8a6587c0a7612a0b855aa | [
"MIT"
] | null | null | null | # Generated by Django 2.0.13 on 2019-05-13 12:41
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('notifications', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='notification',
... | 25.5 | 93 | 0.615385 |
from django.db import migrations, models
import django.utils.timezone
class Migration(migrations.Migration):
dependencies = [
('notifications', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='notification',
name='created_at',
field... | true | true |
1c3e50c250c7df75e0b0d02658e0878ba7b1ece9 | 506 | py | Python | test/test.py | ShivanshMishra/beginners-tutorial | 219b58bc6460d481b76cc8e92775a720a72f2d55 | [
"MIT"
] | 4 | 2018-12-24T16:35:07.000Z | 2021-08-29T08:59:58.000Z | test/test.py | ShivanshMishra/beginners-tutorial | 219b58bc6460d481b76cc8e92775a720a72f2d55 | [
"MIT"
] | 1 | 2019-01-15T18:04:07.000Z | 2019-01-15T18:04:07.000Z | test/test.py | ShivanshMishra/beginners-tutorial | 219b58bc6460d481b76cc8e92775a720a72f2d55 | [
"MIT"
] | 19 | 2018-10-10T10:41:40.000Z | 2022-02-22T19:39:15.000Z | from src.search import main
def test():
if len(main("", "PineaPple")) > 0 and main("", "PineaPple")[
0][2] == 'slice of pineapple upside-down cake.':
print("1. Case insensitive query working :)")
else:
print("1. Case insensitive query not working")
if main("", "miles at") == ... | 29.764706 | 86 | 0.55336 | from src.search import main
def test():
if len(main("", "PineaPple")) > 0 and main("", "PineaPple")[
0][2] == 'slice of pineapple upside-down cake.':
print("1. Case insensitive query working :)")
else:
print("1. Case insensitive query not working")
if main("", "miles at") == ... | true | true |
1c3e5273f4da456a4adae683289a7a58bb42048b | 857 | py | Python | mdf.py | ferdielik/mdf | cf8cb4bb1ef55158f5e431ca8a8027a99a6c7f0e | [
"MIT"
] | null | null | null | mdf.py | ferdielik/mdf | cf8cb4bb1ef55158f5e431ca8a8027a99a6c7f0e | [
"MIT"
] | null | null | null | mdf.py | ferdielik/mdf | cf8cb4bb1ef55158f5e431ca8a8027a99a6c7f0e | [
"MIT"
] | null | null | null | # mdf: mit document fetcher
import os, argparse, re, wget
import urllib.request as urllib2
from urllib.parse import urlparse
from bs4 import BeautifulSoup
parser = argparse.ArgumentParser(description='Fetch MIT lecture notes.')
parser.add_argument('--url', type=str, help='an url for fetching documents', required=Tru... | 34.28 | 97 | 0.746791 |
import os, argparse, re, wget
import urllib.request as urllib2
from urllib.parse import urlparse
from bs4 import BeautifulSoup
parser = argparse.ArgumentParser(description='Fetch MIT lecture notes.')
parser.add_argument('--url', type=str, help='an url for fetching documents', required=True)
parser.add_argument('--o... | true | true |
1c3e52fc15eba82355db186e7615fceca4b2570d | 387 | py | Python | Chapter13/educa/educa/asgi.py | sabin-web/Django-3-by-Example | a0239c954d66fee190014fbd3fa975ddb6eeba17 | [
"MIT"
] | 628 | 2019-11-13T14:13:40.000Z | 2022-03-30T19:02:05.000Z | Chapter13/educa/educa/asgi.py | HAKN1999/Django-3-by-Example | a0239c954d66fee190014fbd3fa975ddb6eeba17 | [
"MIT"
] | 96 | 2020-04-17T17:35:33.000Z | 2022-02-17T09:25:06.000Z | Chapter13/educa/educa/asgi.py | HAKN1999/Django-3-by-Example | a0239c954d66fee190014fbd3fa975ddb6eeba17 | [
"MIT"
] | 782 | 2019-10-15T07:29:27.000Z | 2022-03-30T17:25:08.000Z | """
ASGI config for educa project.
It exposes the ASGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/3.0/howto/deployment/asgi/
"""
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTING... | 22.764706 | 78 | 0.782946 |
import os
from django.core.asgi import get_asgi_application
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'educa.settings')
application = get_asgi_application()
| true | true |
1c3e5369d9f22afc39fa65ce87df45fec511d081 | 904 | py | Python | Lib/objc/_DataDetectorsCore.py | snazari/Pyto | bcea7bbef35cab21ce73087b1a0c00a07d07ec72 | [
"MIT"
] | 701 | 2018-10-22T11:54:09.000Z | 2022-03-31T14:39:30.000Z | Lib/objc/_DataDetectorsCore.py | snazari/Pyto | bcea7bbef35cab21ce73087b1a0c00a07d07ec72 | [
"MIT"
] | 229 | 2018-10-24T09:15:31.000Z | 2021-12-24T16:51:37.000Z | Lib/objc/_DataDetectorsCore.py | snazari/Pyto | bcea7bbef35cab21ce73087b1a0c00a07d07ec72 | [
"MIT"
] | 131 | 2018-11-25T18:33:03.000Z | 2022-03-24T03:18:07.000Z | """
Classes from the 'DataDetectorsCore' framework.
"""
try:
from rubicon.objc import ObjCClass
except ValueError:
def ObjCClass(name):
return None
def _Class(name):
try:
return ObjCClass(name)
except NameError:
return None
DDScannerResult = _Class("DDScannerResult")
DDMess... | 27.393939 | 71 | 0.779867 |
try:
from rubicon.objc import ObjCClass
except ValueError:
def ObjCClass(name):
return None
def _Class(name):
try:
return ObjCClass(name)
except NameError:
return None
DDScannerResult = _Class("DDScannerResult")
DDMessageCache = _Class("DDMessageCache")
DDMessageCacheElemen... | true | true |
1c3e54391ff27af20fc3bcfa1e1f3e00e98acf7f | 2,558 | py | Python | tests/ext/django/test_db.py | musicinmybrain/aws-xray-sdk-python | b8e59423f1891351ceb1a0bd585603e0cd46c74c | [
"Apache-2.0"
] | 294 | 2017-10-10T19:01:04.000Z | 2022-03-18T15:52:19.000Z | tests/ext/django/test_db.py | musicinmybrain/aws-xray-sdk-python | b8e59423f1891351ceb1a0bd585603e0cd46c74c | [
"Apache-2.0"
] | 285 | 2017-10-20T09:27:21.000Z | 2022-03-29T15:33:45.000Z | tests/ext/django/test_db.py | musicinmybrain/aws-xray-sdk-python | b8e59423f1891351ceb1a0bd585603e0cd46c74c | [
"Apache-2.0"
] | 134 | 2017-10-11T13:55:17.000Z | 2022-03-23T07:21:17.000Z | import django
import pytest
from aws_xray_sdk.core import xray_recorder
from aws_xray_sdk.core.context import Context
from aws_xray_sdk.ext.django.db import patch_db
@pytest.fixture(scope='module', autouse=True)
def setup():
django.setup()
xray_recorder.configure(context=Context(),
... | 29.068182 | 79 | 0.686083 | import django
import pytest
from aws_xray_sdk.core import xray_recorder
from aws_xray_sdk.core.context import Context
from aws_xray_sdk.ext.django.db import patch_db
@pytest.fixture(scope='module', autouse=True)
def setup():
django.setup()
xray_recorder.configure(context=Context(),
... | true | true |
1c3e546477e59e8ded61d921ed350c2e11799802 | 228 | py | Python | accounts/admin.py | zizoneleesu/do_it_django_a_to_z | 0b2e70bd9aa684016d080b89f15649b05643b865 | [
"MIT"
] | null | null | null | accounts/admin.py | zizoneleesu/do_it_django_a_to_z | 0b2e70bd9aa684016d080b89f15649b05643b865 | [
"MIT"
] | null | null | null | accounts/admin.py | zizoneleesu/do_it_django_a_to_z | 0b2e70bd9aa684016d080b89f15649b05643b865 | [
"MIT"
] | null | null | null | from django.contrib import admin
from .models import User
# Register your models here.
class UserAdmin(admin.ModelAdmin):
list_display = ('username',
'password')
admin.site.register(User, UserAdmin)
| 17.538462 | 36 | 0.688596 | from django.contrib import admin
from .models import User
class UserAdmin(admin.ModelAdmin):
list_display = ('username',
'password')
admin.site.register(User, UserAdmin)
| true | true |
1c3e5537f56c529cc6e68fecdfa6ff529fa172fb | 2,238 | py | Python | python/runtime/explainer.py | Smirenost/sqlflow | fe9da6995fe2625c9ebeb4ee108ada6bf1329ac2 | [
"Apache-2.0"
] | 2 | 2020-08-09T14:30:15.000Z | 2020-09-20T16:33:30.000Z | python/runtime/explainer.py | vmnet04/sqlflow | 244366196e71834ea2a3a67b90406f7e99e4bcf0 | [
"Apache-2.0"
] | 9 | 2020-08-09T11:12:05.000Z | 2020-10-14T00:19:57.000Z | python/runtime/explainer.py | vmnet04/sqlflow | 244366196e71834ea2a3a67b90406f7e99e4bcf0 | [
"Apache-2.0"
] | null | null | null | # Copyright 2020 The SQLFlow Authors. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | 36.096774 | 78 | 0.682306 |
import sys
import matplotlib
import matplotlib.pyplot as plt
from runtime.oss import copyfileobj
def plot_and_save(plotfunc,
oss_dest=None,
oss_ak=None,
oss_sk=None,
oss_endpoint=None,
oss_bucket_name=None,
... | true | true |
1c3e55d605c6247301920b6c2d2be5324e789cb5 | 5,160 | py | Python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_azure_firewall_fqdn_tags_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 2,728 | 2015-01-09T10:19:32.000Z | 2022-03-31T14:50:33.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_azure_firewall_fqdn_tags_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 17,773 | 2015-01-05T15:57:17.000Z | 2022-03-31T23:50:25.000Z | sdk/network/azure-mgmt-network/azure/mgmt/network/v2019_02_01/operations/_azure_firewall_fqdn_tags_operations.py | rsdoherty/azure-sdk-for-python | 6bba5326677468e6660845a703686327178bb7b1 | [
"MIT"
] | 1,916 | 2015-01-19T05:05:41.000Z | 2022-03-31T19:36:44.000Z | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 45.263158 | 133 | 0.661628 |
from typing import TYPE_CHECKING
import warnings
from azure.core.exceptions import ClientAuthenticationError, HttpResponseError, ResourceExistsError, ResourceNotFoundError, map_error
from azure.core.paging import ItemPaged
from azure.core.pipeline import PipelineResponse
from azure.core.pipeline.transport impor... | true | true |
1c3e55d9cf8f0c9f568d667c30c0e10e59977b55 | 9,951 | py | Python | meeko/preparation.py | forlilab/Meeko | 39518e4215eeb20a6498751d890dbfb09dc5f37a | [
"Apache-2.0"
] | 19 | 2021-11-02T17:56:04.000Z | 2022-03-30T18:05:20.000Z | meeko/preparation.py | forlilab/Meeko | 39518e4215eeb20a6498751d890dbfb09dc5f37a | [
"Apache-2.0"
] | 6 | 2021-12-25T04:42:09.000Z | 2022-03-14T17:49:06.000Z | meeko/preparation.py | forlilab/Meeko | 39518e4215eeb20a6498751d890dbfb09dc5f37a | [
"Apache-2.0"
] | 5 | 2021-12-08T12:30:40.000Z | 2022-01-28T06:30:03.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Meeko preparation
#
import os
import sys
from collections import OrderedDict
import warnings
from rdkit import Chem
from .molsetup import OBMoleculeSetup
from .molsetup import RDKitMoleculeSetup
from .atomtyper import AtomTyper
from .bondtyper import BondTyperLegacy
... | 42.892241 | 130 | 0.60195 |
import os
import sys
from collections import OrderedDict
import warnings
from rdkit import Chem
from .molsetup import OBMoleculeSetup
from .molsetup import RDKitMoleculeSetup
from .atomtyper import AtomTyper
from .bondtyper import BondTyperLegacy
from .hydrate import HydrateMoleculeLegacy
from .macrocycle impor... | true | true |
1c3e55e808e02330d778b3785ff224fbb576fff4 | 1,017 | py | Python | Leetcode/Python/_1403.py | Xrenya/algorithms | aded82cacde2f4f2114241907861251e0e2e5638 | [
"MIT"
] | 1 | 2021-11-28T15:03:32.000Z | 2021-11-28T15:03:32.000Z | Leetcode/Python/_1403.py | Xrenya/algorithms | aded82cacde2f4f2114241907861251e0e2e5638 | [
"MIT"
] | null | null | null | Leetcode/Python/_1403.py | Xrenya/algorithms | aded82cacde2f4f2114241907861251e0e2e5638 | [
"MIT"
] | null | null | null | class Solution:
def minSubsequence(self, nums: List[int]) -> List[int]:
def sortInplace(array):
for j in range(1, len(array)):
key = array[j]
i = j - 1
while i>-1 and key<array[i]:
array[i+1] = array[i]
i -= ... | 26.763158 | 65 | 0.427729 | class Solution:
def minSubsequence(self, nums: List[int]) -> List[int]:
def sortInplace(array):
for j in range(1, len(array)):
key = array[j]
i = j - 1
while i>-1 and key<array[i]:
array[i+1] = array[i]
i -= ... | true | true |
1c3e56cc827a8f160297308e7168e413a29ba543 | 23,625 | py | Python | test/framework.py | licko/vpp-1701-original | 884bb9722616b690da912848d12c39b118b63f27 | [
"Apache-2.0"
] | null | null | null | test/framework.py | licko/vpp-1701-original | 884bb9722616b690da912848d12c39b118b63f27 | [
"Apache-2.0"
] | null | null | null | test/framework.py | licko/vpp-1701-original | 884bb9722616b690da912848d12c39b118b63f27 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
import subprocess
import unittest
import tempfile
import time
import resource
from collections import deque
from threading import Thread
from inspect import getdoc
from hook import StepHook, PollHook
from vpp_pg_interface import VppPGInterface
from vpp_lo_interface import VppLoInterface
from vpp_... | 33.846705 | 80 | 0.579005 |
import subprocess
import unittest
import tempfile
import time
import resource
from collections import deque
from threading import Thread
from inspect import getdoc
from hook import StepHook, PollHook
from vpp_pg_interface import VppPGInterface
from vpp_lo_interface import VppLoInterface
from vpp_papi_provider import ... | false | true |
1c3e5785efc594605381dfaf666e99e54412cda7 | 558 | py | Python | cgn/regop/operators/identity_operator.py | FabianKP/cgn | 9963e60c4a4bf4f3869e43d1dfbe11da74887ba5 | [
"MIT"
] | 1 | 2022-03-21T00:40:23.000Z | 2022-03-21T00:40:23.000Z | cgn/regop/operators/identity_operator.py | FabianKP/cgn | 9963e60c4a4bf4f3869e43d1dfbe11da74887ba5 | [
"MIT"
] | null | null | null | cgn/regop/operators/identity_operator.py | FabianKP/cgn | 9963e60c4a4bf4f3869e43d1dfbe11da74887ba5 | [
"MIT"
] | null | null | null |
import numpy as np
from ..regularization_operator import RegularizationOperator
class IdentityOperator(RegularizationOperator):
"""
Corresponds to to the identity operator :math:`I(v) = v`.
"""
def __init__(self, dim):
self._mat = np.identity(dim)
def fwd(self, v: np.ndarray) -> np.ndar... | 22.32 | 61 | 0.596774 |
import numpy as np
from ..regularization_operator import RegularizationOperator
class IdentityOperator(RegularizationOperator):
def __init__(self, dim):
self._mat = np.identity(dim)
def fwd(self, v: np.ndarray) -> np.ndarray:
return v
def adj(self, v: np.ndarray) -> np.ndarray:
... | true | true |
1c3e58d667c0b70d47852665e13afc344c61b3be | 1,524 | py | Python | var/spack/repos/builtin/packages/py-ford/package.py | renjithravindrankannath/spack | 043b2cbb7c99d69a373f3ecbf35bc3b4638bcf85 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/py-ford/package.py | renjithravindrankannath/spack | 043b2cbb7c99d69a373f3ecbf35bc3b4638bcf85 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | null | null | null | var/spack/repos/builtin/packages/py-ford/package.py | renjithravindrankannath/spack | 043b2cbb7c99d69a373f3ecbf35bc3b4638bcf85 | [
"ECL-2.0",
"Apache-2.0",
"MIT-0",
"MIT"
] | 2 | 2019-02-08T20:37:20.000Z | 2019-03-31T15:19:26.000Z | # Copyright 2013-2022 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack.package import *
class PyFord(PythonPackage):
"""FORD, standing for FORtran Documenter, is an automatic d... | 41.189189 | 96 | 0.681102 |
from spack.package import *
class PyFord(PythonPackage):
pypi = "FORD/FORD-6.1.11.tar.gz"
maintainers = ['wscullin']
version('6.1.12', sha256='101191e1aa33cfe780ea5b2d66d02c7281b9b314e82bb138d76809a49c08506a')
version('6.1.11', sha256='feb9a88040e717e84c632e4b023904ab36a463fc9a8ff80c8c7f86... | true | true |
1c3e59634d8299d2a8cbde37093eaae92000aa89 | 1,686 | py | Python | process_data.py | aaron-zou/messenger-analytics | ef44df54d3b5851236e296d973ba0c62aabefcf9 | [
"MIT"
] | null | null | null | process_data.py | aaron-zou/messenger-analytics | ef44df54d3b5851236e296d973ba0c62aabefcf9 | [
"MIT"
] | null | null | null | process_data.py | aaron-zou/messenger-analytics | ef44df54d3b5851236e296d973ba0c62aabefcf9 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
import os
from collections import Counter
import click
import msgpack # TODO: add cache saving and loading
import util
@click.command()
@click.option('--data-path',
required=True,
type=click.Path(writable=False),
help="Path to messages subfolder insi... | 33.72 | 78 | 0.657177 |
import os
from collections import Counter
import click
import msgpack
import util
@click.command()
@click.option('--data-path',
required=True,
type=click.Path(writable=False),
help="Path to messages subfolder inside downloaded data folder")
@click.option('-n', default=50... | true | true |
1c3e5e5858537d5973709b737be108ceedebf419 | 1,435 | py | Python | cogs/war-reporter.py | BeyondBoy1/WookieForce | 9c47bc60d0672e929ce9bcbd47931e235ff81036 | [
"MIT"
] | 1 | 2021-05-31T11:45:48.000Z | 2021-05-31T11:45:48.000Z | cogs/war-reporter.py | BeyondBoy1/WookieForce | 9c47bc60d0672e929ce9bcbd47931e235ff81036 | [
"MIT"
] | null | null | null | cogs/war-reporter.py | BeyondBoy1/WookieForce | 9c47bc60d0672e929ce9bcbd47931e235ff81036 | [
"MIT"
] | null | null | null | import coc
import creds
from discord.ext import commands
CLAN_TAG = creds.clan_tag
WAR_REPORT_CHANNEL_ID = creds.war_channel
REPORT_STYLE = """
{att.attacker.name} (No. {att.attacker.map_position}, TH{att.attacker.town_hall}) just {verb} {att.defender.name}
(No. {att.defender.map_position}, TH{att.defender.town_hal... | 27.596154 | 114 | 0.666899 | import coc
import creds
from discord.ext import commands
CLAN_TAG = creds.clan_tag
WAR_REPORT_CHANNEL_ID = creds.war_channel
REPORT_STYLE = """
{att.attacker.name} (No. {att.attacker.map_position}, TH{att.attacker.town_hall}) just {verb} {att.defender.name}
(No. {att.defender.map_position}, TH{att.defender.town_hal... | true | true |
1c3e5e95c0929efda0ad6e413536850bdd6dd9bb | 1,340 | py | Python | savu/test/travis/plugin_tests/saver_tests/hdf5_saver_test.py | jacob720/Savu | 7afc9e10ea4944ceb39a83574f3142f025cf81e1 | [
"Apache-2.0"
] | 39 | 2015-03-30T14:03:42.000Z | 2022-03-16T16:50:33.000Z | savu/test/travis/plugin_tests/saver_tests/hdf5_saver_test.py | jacob720/Savu | 7afc9e10ea4944ceb39a83574f3142f025cf81e1 | [
"Apache-2.0"
] | 670 | 2015-02-11T11:08:09.000Z | 2022-03-21T09:27:57.000Z | savu/test/travis/plugin_tests/saver_tests/hdf5_saver_test.py | jacob720/Savu | 7afc9e10ea4944ceb39a83574f3142f025cf81e1 | [
"Apache-2.0"
] | 54 | 2015-02-13T14:09:52.000Z | 2022-01-24T13:57:09.000Z | # -*- coding: utf-8 -*-
# Copyright 2014 Diamond Light Source 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 ap... | 30.454545 | 76 | 0.73806 |
import unittest
import savu.test.test_utils as tu
from savu.test.travis.framework_tests.plugin_runner_test import \
run_protected_plugin_runner
class Hdf5SaverTest(unittest.TestCase):
global data_file, experiment
data_file = '24737.nxs'
experiment = None
def test_hdf5_saver(se... | true | true |
1c3e5f127a35de9cd737fa25f47565a78e3c6411 | 5,190 | py | Python | PaddleCV/image_classification/legacy/models/mobilenet.py | suytingwan/models | ccdbfe77d071cc19b55fb9f4b738912e35d982ef | [
"Apache-2.0"
] | 5 | 2021-09-28T13:28:01.000Z | 2021-12-21T07:25:44.000Z | PaddleCV/image_classification/legacy/models/mobilenet.py | suytingwan/models | ccdbfe77d071cc19b55fb9f4b738912e35d982ef | [
"Apache-2.0"
] | 1 | 2019-11-18T03:03:37.000Z | 2019-11-18T03:03:37.000Z | PaddleCV/image_classification/legacy/models/mobilenet.py | suytingwan/models | ccdbfe77d071cc19b55fb9f4b738912e35d982ef | [
"Apache-2.0"
] | 4 | 2021-08-11T08:25:10.000Z | 2021-10-16T07:41:59.000Z | # Copyright (c) 2018 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by app... | 28.833333 | 80 | 0.529672 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import paddle.fluid as fluid
from paddle.fluid.initializer import MSRA
from paddle.fluid.param_attr import ParamAttr
__all__ = ['MobileNet']
train_parameters = {
"input_size": [3, 224, 224],
... | true | true |
1c3e60118f62a2af01266746e8cb66503874e06b | 810 | py | Python | backend/app/deployments/info.py | ComplexData-MILA/HTUI | 2aa7b2c83a2deb7f6fd79d9604913fc85dc25f91 | [
"Apache-2.0"
] | null | null | null | backend/app/deployments/info.py | ComplexData-MILA/HTUI | 2aa7b2c83a2deb7f6fd79d9604913fc85dc25f91 | [
"Apache-2.0"
] | 20 | 2021-11-22T15:16:53.000Z | 2022-01-04T16:55:26.000Z | backend/app/deployments/info.py | ComplexData-MILA/HTUI | 2aa7b2c83a2deb7f6fd79d9604913fc85dc25f91 | [
"Apache-2.0"
] | null | null | null | import ray
from ray import serve
import urllib.parse
from ray.worker import get
from ..app import app
def get_endpoint(deployment_name: str):
return urllib.parse.urlparse(serve.get_deployment(deployment_name).url).path
@serve.deployment(name='info', route_prefix="/", ray_actor_options={"num_cpus": 0.1})
@serve.... | 28.928571 | 113 | 0.644444 | import ray
from ray import serve
import urllib.parse
from ray.worker import get
from ..app import app
def get_endpoint(deployment_name: str):
return urllib.parse.urlparse(serve.get_deployment(deployment_name).url).path
@serve.deployment(name='info', route_prefix="/", ray_actor_options={"num_cpus": 0.1})
@serve.... | true | true |
1c3e6117bda03f7d7b432c1399b91fe766ad7fa8 | 1,105 | py | Python | psp/cainfo.py | ZLLentz/pyca | 5e18525fcd2b39c68c5d8dd4b543d4d8e12dd5f2 | [
"BSD-3-Clause-LBNL"
] | 5 | 2017-04-11T17:47:35.000Z | 2021-08-06T17:38:47.000Z | psp/cainfo.py | ZLLentz/pyca | 5e18525fcd2b39c68c5d8dd4b543d4d8e12dd5f2 | [
"BSD-3-Clause-LBNL"
] | 11 | 2017-09-25T23:32:59.000Z | 2018-06-25T23:38:44.000Z | psp/cainfo.py | ZLLentz/pyca | 5e18525fcd2b39c68c5d8dd4b543d4d8e12dd5f2 | [
"BSD-3-Clause-LBNL"
] | 7 | 2017-09-23T01:56:14.000Z | 2020-12-18T02:24:11.000Z | #!/usr/bin/env python
import sys
import pyca
from options import Options
from Pv import Pv
if __name__ == '__main__':
options = Options(['pvnames'], ['timeout'], [])
try:
options.parse()
except Exception as msg:
options.usage(str(msg))
sys.exit()
pvnames = options.pvnames.spl... | 26.95122 | 79 | 0.541176 |
import sys
import pyca
from options import Options
from Pv import Pv
if __name__ == '__main__':
options = Options(['pvnames'], ['timeout'], [])
try:
options.parse()
except Exception as msg:
options.usage(str(msg))
sys.exit()
pvnames = options.pvnames.split()
if options.... | true | true |
1c3e6226c1833759f2f38ad6e6e1d37b078e47a9 | 13,351 | py | Python | AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_GPUTest_LightComponent.py | pollend/o3de | 02b6b1dbf4d9889b55d4c11e049aa5b1804c9897 | [
"Apache-2.0",
"MIT"
] | 8 | 2021-08-31T02:14:19.000Z | 2021-12-28T19:20:59.000Z | AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_GPUTest_LightComponent.py | pollend/o3de | 02b6b1dbf4d9889b55d4c11e049aa5b1804c9897 | [
"Apache-2.0",
"MIT"
] | 8 | 2021-07-12T13:55:00.000Z | 2021-10-04T14:53:21.000Z | AutomatedTesting/Gem/PythonTests/Atom/tests/hydra_GPUTest_LightComponent.py | pollend/o3de | 02b6b1dbf4d9889b55d4c11e049aa5b1804c9897 | [
"Apache-2.0",
"MIT"
] | 1 | 2021-09-16T05:06:18.000Z | 2021-09-16T05:06:18.000Z | """
Copyright (c) Contributors to the Open 3D Engine Project.
For complete copyright and license terms please see the LICENSE at the root of this distribution.
SPDX-License-Identifier: Apache-2.0 OR MIT
"""
import os
import sys
import azlmbr.asset as asset
import azlmbr.bus as bus
import azlmbr.editor as editor
impor... | 50.958015 | 119 | 0.752453 | import os
import sys
import azlmbr.asset as asset
import azlmbr.bus as bus
import azlmbr.editor as editor
import azlmbr.math as math
import azlmbr.paths
import azlmbr.legacy.general as general
sys.path.append(os.path.join(azlmbr.paths.projectroot, "Gem", "PythonTests"))
import editor_python_test_tools.hydra_editor_u... | true | true |
1c3e62dc38ce4440d5e4870548943f939964bef3 | 8,786 | py | Python | tests/arxml/ar4_portinterface_test.py | zhuhaijun753/autosar-2 | c99e48128cb55dfcde0f1030806977dde4d23218 | [
"MIT"
] | null | null | null | tests/arxml/ar4_portinterface_test.py | zhuhaijun753/autosar-2 | c99e48128cb55dfcde0f1030806977dde4d23218 | [
"MIT"
] | null | null | null | tests/arxml/ar4_portinterface_test.py | zhuhaijun753/autosar-2 | c99e48128cb55dfcde0f1030806977dde4d23218 | [
"MIT"
] | 1 | 2020-03-15T15:05:40.000Z | 2020-03-15T15:05:40.000Z | import os, sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../..')))
import autosar
from tests.arxml.common import ARXMLTestClass
import unittest
def _create_packages(ws):
package=ws.createPackage('DataTypes', role='DataType')
package.createSubPackage('CompuMethods', r... | 56.683871 | 160 | 0.674596 | import os, sys
sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '../..')))
import autosar
from tests.arxml.common import ARXMLTestClass
import unittest
def _create_packages(ws):
package=ws.createPackage('DataTypes', role='DataType')
package.createSubPackage('CompuMethods', r... | true | true |
1c3e630fd839b16105479f88dbb3ae9a39a1958a | 3,059 | py | Python | admissions/grades.py | dsavransky/admissions | ffdba2c93f5a02667f7506965313b8ed7dd9381b | [
"MIT"
] | null | null | null | admissions/grades.py | dsavransky/admissions | ffdba2c93f5a02667f7506965313b8ed7dd9381b | [
"MIT"
] | null | null | null | admissions/grades.py | dsavransky/admissions | ffdba2c93f5a02667f7506965313b8ed7dd9381b | [
"MIT"
] | null | null | null | import numpy as np
import pandas
import scipy.interpolate
import requests
from html.parser import HTMLParser
def scrapegradedata(URL="http://gpa.eng.uci.edu/"):
page = requests.get(URL)
class GradeHTMLParser(HTMLParser):
def __init__(self):
HTMLParser.__init__(self)
self.intr... | 30.287129 | 88 | 0.520758 | import numpy as np
import pandas
import scipy.interpolate
import requests
from html.parser import HTMLParser
def scrapegradedata(URL="http://gpa.eng.uci.edu/"):
page = requests.get(URL)
class GradeHTMLParser(HTMLParser):
def __init__(self):
HTMLParser.__init__(self)
self.intr... | true | true |
1c3e633bf644ebaf5a7f7c2a5e95432142f3c7c9 | 1,004 | py | Python | migrations/versions/4a9fa306c69c_.py | Anioko/frontcms | 3a39c57881ae4d97b3aa65d033e30719aca648ac | [
"MIT"
] | 1 | 2020-06-26T05:03:48.000Z | 2020-06-26T05:03:48.000Z | migrations/versions/4a9fa306c69c_.py | Anioko/frontcms | 3a39c57881ae4d97b3aa65d033e30719aca648ac | [
"MIT"
] | 1 | 2021-06-02T02:15:07.000Z | 2021-06-02T02:15:07.000Z | migrations/versions/4a9fa306c69c_.py | Anioko/frontcms | 3a39c57881ae4d97b3aa65d033e30719aca648ac | [
"MIT"
] | null | null | null | """empty message
Revision ID: 4a9fa306c69c
Revises: 3d2cc737a6c7
Create Date: 2020-07-24 12:48:22.326512
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = '4a9fa306c69c'
down_revision = '3d2cc737a6c7'
branch_labels = None
depends_on = None
def upgrade():
# ... | 27.135135 | 70 | 0.685259 | from alembic import op
import sqlalchemy as sa
revision = '4a9fa306c69c'
down_revision = '3d2cc737a6c7'
branch_labels = None
depends_on = None
def upgrade():
splay_name', sa.String(), nullable=True),
sa.Column('value', sa.String(), nullable=True),
sa.Column('created_at', sa.DateTime(), nullable=True),
... | true | true |
1c3e638e76c10ae20b3ae3c7635e42736dec7735 | 6,727 | py | Python | viabel/convenience.py | SyanneLiu/viabel | 947d7389184f4c5e58e762d7ef771ce1aae19dd4 | [
"MIT"
] | 29 | 2019-10-20T21:10:35.000Z | 2022-02-15T23:43:30.000Z | viabel/convenience.py | SyanneLiu/viabel | 947d7389184f4c5e58e762d7ef771ce1aae19dd4 | [
"MIT"
] | 29 | 2020-10-30T00:53:45.000Z | 2021-03-11T07:41:08.000Z | viabel/convenience.py | SyanneLiu/viabel | 947d7389184f4c5e58e762d7ef771ce1aae19dd4 | [
"MIT"
] | 8 | 2019-10-22T13:08:54.000Z | 2021-07-28T15:28:49.000Z | from viabel._psis import psislw
from viabel.approximations import MFGaussian
from viabel.diagnostics import all_diagnostics
from viabel.models import Model, StanModel
from viabel.objectives import ExclusiveKL
from viabel.optimization import FASO, RMSProp
all = [
'bbvi',
'vi_diagnostics',
]
def bbvi(dimension... | 39.110465 | 94 | 0.662405 | from viabel._psis import psislw
from viabel.approximations import MFGaussian
from viabel.diagnostics import all_diagnostics
from viabel.models import Model, StanModel
from viabel.objectives import ExclusiveKL
from viabel.optimization import FASO, RMSProp
all = [
'bbvi',
'vi_diagnostics',
]
def bbvi(dimension... | true | true |
1c3e64579dc9a5b29cd306056b4a6227f1271f5c | 6,026 | py | Python | monai/metrics/froc.py | benduffy1/MONAI | 046e625b09262261373d7b8039fb652547201368 | [
"Apache-2.0"
] | 3 | 2020-06-22T20:59:14.000Z | 2021-04-09T21:24:45.000Z | monai/metrics/froc.py | Borda/MONAI | e0db5a564225a7cb62e7a23df97267019006302f | [
"Apache-2.0"
] | null | null | null | monai/metrics/froc.py | Borda/MONAI | e0db5a564225a7cb62e7a23df97267019006302f | [
"Apache-2.0"
] | 1 | 2020-06-22T19:22:59.000Z | 2020-06-22T19:22:59.000Z | # Copyright (c) MONAI Consortium
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, so... | 44.308824 | 113 | 0.710919 |
from typing import List, Optional, Tuple, Union
import numpy as np
import torch
def compute_fp_tp_probs(
probs: Union[np.ndarray, torch.Tensor],
y_coord: Union[np.ndarray, torch.Tensor],
x_coord: Union[np.ndarray, torch.Tensor],
evaluation_mask: Union[np.ndarray, torch.Tensor],
labels... | true | true |
1c3e64e83644603f93bba54d178f8945f101db1b | 821 | py | Python | migrations/versions/2021_112212_d0ccd9d7ac0c_.py | fareszr/app | 1f3bc693eccb307234e53653f6fa2cb25ddc0647 | [
"MIT"
] | null | null | null | migrations/versions/2021_112212_d0ccd9d7ac0c_.py | fareszr/app | 1f3bc693eccb307234e53653f6fa2cb25ddc0647 | [
"MIT"
] | null | null | null | migrations/versions/2021_112212_d0ccd9d7ac0c_.py | fareszr/app | 1f3bc693eccb307234e53653f6fa2cb25ddc0647 | [
"MIT"
] | null | null | null | """empty message
Revision ID: d0ccd9d7ac0c
Revises: e7d7ebcea26c
Create Date: 2021-11-22 12:05:31.814178
"""
import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd0ccd9d7ac0c'
down_revision = 'e7d7ebcea26c'
branch_labels = None
depends_on = None... | 25.65625 | 89 | 0.690621 | import sqlalchemy_utils
from alembic import op
import sqlalchemy as sa
revision = 'd0ccd9d7ac0c'
down_revision = 'e7d7ebcea26c'
branch_labels = None
depends_on = None
def upgrade():
| true | true |
1c3e669806f961c690e3e607d0c5ebaae5ffefbe | 2,503 | py | Python | articles/views.py | qwghlm/CommentIsMee | 2c11be1376ec693df28123727c3d86b38404fd71 | [
"MIT"
] | null | null | null | articles/views.py | qwghlm/CommentIsMee | 2c11be1376ec693df28123727c3d86b38404fd71 | [
"MIT"
] | null | null | null | articles/views.py | qwghlm/CommentIsMee | 2c11be1376ec693df28123727c3d86b38404fd71 | [
"MIT"
] | null | null | null | from django.http import HttpResponse
from django.template import RequestContext, loader
from django.shortcuts import render, get_object_or_404, redirect
from django.core.urlresolvers import reverse
from django.core.cache import cache
from articles.models import CIFArticle
from .forms import CIFArticleForm
def index(r... | 32.934211 | 86 | 0.62485 | from django.http import HttpResponse
from django.template import RequestContext, loader
from django.shortcuts import render, get_object_or_404, redirect
from django.core.urlresolvers import reverse
from django.core.cache import cache
from articles.models import CIFArticle
from .forms import CIFArticleForm
def index(r... | false | true |
1c3e66fb87abebcf535ca1b30284269ed5319bb3 | 11,738 | py | Python | yolov5/utils/augmentations.py | tstls/TSB_AI_Vision | f11a2f6c6ee6f275d950c95f8c2fbf519aadcce6 | [
"MIT"
] | null | null | null | yolov5/utils/augmentations.py | tstls/TSB_AI_Vision | f11a2f6c6ee6f275d950c95f8c2fbf519aadcce6 | [
"MIT"
] | null | null | null | yolov5/utils/augmentations.py | tstls/TSB_AI_Vision | f11a2f6c6ee6f275d950c95f8c2fbf519aadcce6 | [
"MIT"
] | null | null | null | # YOLOv5 🚀 by Ultralytics, GPL-3.0 license
"""
Image augmentation functions
"""
import logging
import math
import random
import cv2
import numpy as np
from utils.general import check_version, colorstr, resample_segments, segment2box
from utils.metrics import bbox_ioa
class Albumentations:
# YOLOv5 Albumentati... | 42.071685 | 118 | 0.567388 |
import logging
import math
import random
import cv2
import numpy as np
from utils.general import check_version, colorstr, resample_segments, segment2box
from utils.metrics import bbox_ioa
class Albumentations:
def __init__(self):
self.transform = None
try:
import albumentation... | true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.