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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f711370932f8b4c113c4541c13a5de315eff195e | 1,653 | py | Python | Object detection and depth estimation/catkin_ws/src/f110-fall2018-skeltons/labs/wall_following/scripts/utils/other.py | UF-f1tenth/F1tenth-UFL | 93b0a822c67b2b425664642955342138e65974f4 | [
"Apache-2.0"
] | null | null | null | Object detection and depth estimation/catkin_ws/src/f110-fall2018-skeltons/labs/wall_following/scripts/utils/other.py | UF-f1tenth/F1tenth-UFL | 93b0a822c67b2b425664642955342138e65974f4 | [
"Apache-2.0"
] | null | null | null | Object detection and depth estimation/catkin_ws/src/f110-fall2018-skeltons/labs/wall_following/scripts/utils/other.py | UF-f1tenth/F1tenth-UFL | 93b0a822c67b2b425664642955342138e65974f4 | [
"Apache-2.0"
] | null | null | null | """
Created on Fri Oct 29 18:54:18 2021
@author: Krishna Nuthalapati
"""
import numpy as np
def iou(boxA, boxB):
# determine the (x, y)-coordinates of the intersection rectangle
xA = max(boxA[0], boxB[0])
yA = max(boxA[1], boxB[1])
xB = min(boxA[2], boxB[2])
yB = min(boxA[3], boxB[3])
# compute the area of int... | 30.611111 | 65 | 0.566243 |
import numpy as np
def iou(boxA, boxB):
xA = max(boxA[0], boxB[0])
yA = max(boxA[1], boxB[1])
xB = min(boxA[2], boxB[2])
yB = min(boxA[3], boxB[3])
interArea = max(0, xB - xA + 1) * max(0, yB - yA + 1)
boxAArea = (boxA[2] - boxA[0] + 1) * (boxA[3] - boxA[1] + 1)
boxBArea = (boxB[2] - boxB[0] + 1) * (bo... | true | true |
f711371b1ee98e180d6a5e26233698cd11df382f | 3,458 | py | Python | dedupe/blocking.py | daherman/dedupe | 053d373aaed47201f720c5b6d1a568fc49742cc3 | [
"MIT"
] | null | null | null | dedupe/blocking.py | daherman/dedupe | 053d373aaed47201f720c5b6d1a568fc49742cc3 | [
"MIT"
] | null | null | null | dedupe/blocking.py | daherman/dedupe | 053d373aaed47201f720c5b6d1a568fc49742cc3 | [
"MIT"
] | 1 | 2020-03-12T11:14:37.000Z | 2020-03-12T11:14:37.000Z | #!/usr/bin/python
# -*- coding: utf-8 -*-
from future.utils import viewvalues
from collections import defaultdict
import logging
import time
logger = logging.getLogger(__name__)
def index_list():
return defaultdict(list)
class Blocker:
'''Takes in a record and returns all blocks that record belongs to'''... | 30.333333 | 78 | 0.571139 |
from future.utils import viewvalues
from collections import defaultdict
import logging
import time
logger = logging.getLogger(__name__)
def index_list():
return defaultdict(list)
class Blocker:
def __init__(self, predicates):
self.predicates = predicates
self.index_fields = defaultdi... | true | true |
f711375103856ff1f563ebe9fc08ec01a9b939c2 | 5,805 | py | Python | examples/ssd/ssd_detect.py | yuqj1990/deepano_train | c7247801ccea4c3a5c0be9c9091fc91876dbf279 | [
"Unlicense"
] | 21 | 2019-11-28T06:11:17.000Z | 2020-06-15T00:45:46.000Z | examples/ssd/ssd_detect.py | yuqj1990/deepano_train | c7247801ccea4c3a5c0be9c9091fc91876dbf279 | [
"Unlicense"
] | 12 | 2019-11-20T01:38:28.000Z | 2020-06-30T06:29:40.000Z | examples/ssd/ssd_detect.py | yuqj1990/deepano_train | c7247801ccea4c3a5c0be9c9091fc91876dbf279 | [
"Unlicense"
] | 10 | 2019-11-26T00:50:06.000Z | 2020-06-20T05:43:45.000Z | #encoding=utf8
'''
Detection with SSD
In this example, we will load a SSD model and use it to detect objects.
'''
import os
import sys
import argparse
import numpy as np
from PIL import Image, ImageDraw
# Make sure that caffe is on the python path:
caffe_root = './'
os.chdir(caffe_root)
sys.path.insert(0, os.path.join... | 38.7 | 92 | 0.618432 |
'''
Detection with SSD
In this example, we will load a SSD model and use it to detect objects.
'''
import os
import sys
import argparse
import numpy as np
from PIL import Image, ImageDraw
caffe_root = './'
os.chdir(caffe_root)
sys.path.insert(0, os.path.join(caffe_root, 'python'))
import caffe
from google.protobuf ... | false | true |
f71137f8453b7453a7288e056250a0b4f1b5adfe | 688 | py | Python | openapi_documentor/users/models.py | codeasashu/openapi-documentor | dde825edaac85bb117d06adf0a4eabf1f5da44f5 | [
"MIT"
] | null | null | null | openapi_documentor/users/models.py | codeasashu/openapi-documentor | dde825edaac85bb117d06adf0a4eabf1f5da44f5 | [
"MIT"
] | 5 | 2021-04-06T07:46:47.000Z | 2022-03-02T13:12:20.000Z | openapi_documentor/users/models.py | codeasashu/openapi-documentor | dde825edaac85bb117d06adf0a4eabf1f5da44f5 | [
"MIT"
] | null | null | null | from django.contrib.auth.models import AbstractUser
from django.db.models import CharField
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
class User(AbstractUser):
"""Default user for Openapi Documentor."""
#: First and last name do not cover name patterns around the g... | 29.913043 | 74 | 0.686047 | from django.contrib.auth.models import AbstractUser
from django.db.models import CharField
from django.urls import reverse
from django.utils.translation import gettext_lazy as _
class User(AbstractUser):
name = CharField(_("Name of User"), blank=True, max_length=255)
first_name = None
last_name = ... | true | true |
f7113827be9d6a1cee1e09d156ea82251b27fde6 | 6,164 | py | Python | fgh_gnn/data/graph_builder.py | alstonlo/fgh-gnn | 099aee925a3c5077070803d31b6e45793972239c | [
"MIT"
] | null | null | null | fgh_gnn/data/graph_builder.py | alstonlo/fgh-gnn | 099aee925a3c5077070803d31b6e45793972239c | [
"MIT"
] | null | null | null | fgh_gnn/data/graph_builder.py | alstonlo/fgh-gnn | 099aee925a3c5077070803d31b6e45793972239c | [
"MIT"
] | null | null | null | import itertools
import dgl
import torch
from rdkit import Chem
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import minimum_spanning_tree
from fgh_gnn.utils import FGROUP_MOLS, get_ring_fragments, ogb_graph_to_mol
class FGroupHetGraphBuilder:
def __init__(self, vocab):
self.vocab = voc... | 32.613757 | 79 | 0.602531 | import itertools
import dgl
import torch
from rdkit import Chem
from scipy.sparse import csr_matrix
from scipy.sparse.csgraph import minimum_spanning_tree
from fgh_gnn.utils import FGROUP_MOLS, get_ring_fragments, ogb_graph_to_mol
class FGroupHetGraphBuilder:
def __init__(self, vocab):
self.vocab = voc... | true | true |
f71138b533e46adf6dde35d54e02d04a62c01bd9 | 1,408 | py | Python | translate/cloud-client/translate_v3_get_supported_languages_with_target.py | summersab/python-docs-samples | 7c1e9685fe190f7789d8e1dbcfe8c01a20e3dc66 | [
"Apache-2.0"
] | 2 | 2020-09-19T04:22:52.000Z | 2020-09-23T14:04:17.000Z | translate/cloud-client/translate_v3_get_supported_languages_with_target.py | summersab/python-docs-samples | 7c1e9685fe190f7789d8e1dbcfe8c01a20e3dc66 | [
"Apache-2.0"
] | 1 | 2020-07-23T10:47:32.000Z | 2020-07-23T10:47:32.000Z | translate/cloud-client/translate_v3_get_supported_languages_with_target.py | summersab/python-docs-samples | 7c1e9685fe190f7789d8e1dbcfe8c01a20e3dc66 | [
"Apache-2.0"
] | 2 | 2020-09-13T03:47:22.000Z | 2020-09-23T14:04:19.000Z | # Copyright 2020 Google LLC
#
# 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... | 39.111111 | 81 | 0.758523 |
from google.cloud import translate
def get_supported_languages_with_target(project_id="YOUR_PROJECT_ID"):
client = translate.TranslationServiceClient()
parent = client.location_path(project_id, "global")
response = client.get_supported_languages(
display_language_code="is", ... | true | true |
f711396a297eb7913d70fb420d60db3044534bfe | 209 | py | Python | src/clikit/__init__.py | abn/clikit | c9f96ee7a39a0d59d6cf7b5888589a030f36f051 | [
"MIT"
] | null | null | null | src/clikit/__init__.py | abn/clikit | c9f96ee7a39a0d59d6cf7b5888589a030f36f051 | [
"MIT"
] | null | null | null | src/clikit/__init__.py | abn/clikit | c9f96ee7a39a0d59d6cf7b5888589a030f36f051 | [
"MIT"
] | null | null | null | from .api.config.application_config import ApplicationConfig
from .console_application import ConsoleApplication
from .config.default_application_config import DefaultApplicationConfig
__version__ = "0.2.4"
| 29.857143 | 71 | 0.866029 | from .api.config.application_config import ApplicationConfig
from .console_application import ConsoleApplication
from .config.default_application_config import DefaultApplicationConfig
__version__ = "0.2.4"
| true | true |
f71139c10d5c6ee76dd9bb468e5a746e8d5f597e | 8,862 | py | Python | AT88CK590/fw/LibraryExamples/SHA204/AvrStudio5/engr_10490/test/python/src/aamonitor_filtered.py | Wintekso/CryptoAuth-explorations | b0f7ec0363f5379f3d971e647c0806cfcb08d5f0 | [
"Apache-2.0"
] | 15 | 2017-06-22T23:14:20.000Z | 2021-04-05T18:53:09.000Z | AT88CK590/fw/LibraryExamples/SHA204/AvrStudio5/engr_10490/test/python/src/aamonitor_filtered.py | Wintekso/CryptoAuth-explorations | b0f7ec0363f5379f3d971e647c0806cfcb08d5f0 | [
"Apache-2.0"
] | 2 | 2017-09-15T05:12:51.000Z | 2017-09-15T18:56:15.000Z | AT88CK590/fw/LibraryExamples/SHA204/AvrStudio5/engr_10490/test/python/src/aamonitor_filtered.py | Wintekso/CryptoAuth-explorations | b0f7ec0363f5379f3d971e647c0806cfcb08d5f0 | [
"Apache-2.0"
] | 3 | 2017-06-23T10:51:53.000Z | 2020-05-28T00:56:12.000Z | #!/bin/env python
#==========================================================================
# (c) 2004-2005 Total Phase, Inc.
#--------------------------------------------------------------------------
# Project : Aardvark Sample Code
# File : aamonitor_filtered.py
#-----------------------------------------... | 41.027778 | 88 | 0.484879 |
import sys, time
from aardvark_py import *
BUFFER_SIZE = 32767
TIMEFORMAT = "%Y-%m-%d %H:%M:%S"
def dump (handle, filter_addr, timeout):
print "Waiting %d ms for first transaction..." % timeout
print " Filtering on 0x%03x" % filter_addr
result = a... | false | true |
f7113a0b6eae6c1acd7f596dd110305a0730d168 | 10,904 | py | Python | mdparser.py | galeo/pagedown-editor-only | e053bb61a48e257011a76f82bd0c546d6f044042 | [
"MIT"
] | 2 | 2015-03-02T10:52:52.000Z | 2016-03-13T11:44:01.000Z | mdparser.py | galeo/pagedown-editor-only | e053bb61a48e257011a76f82bd0c546d6f044042 | [
"MIT"
] | null | null | null | mdparser.py | galeo/pagedown-editor-only | e053bb61a48e257011a76f82bd0c546d6f044042 | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
# Markdown parsers.
#
#
# Author: Moogen Tian <http://blog.galeo.me>
#
# Legal:
#
# This file is published under BSD License.
#
# And the code structure references:
#
# * pagewise (by ainm <ainm at gmx.com>, with personal public license)
#
# * mynt (by Andrew Fricke, the autho... | 30.543417 | 95 | 0.573184 |
from __future__ import unicode_literals
import re
import sys
class MDParserException(Exception):
pass
def error(message, *args):
raise MDParserException(message % args)
def warning(message, *args):
sys.stderr.write("WARNING: " + message % args)
def halt(message, *args):
... | true | true |
f7113a19ca443354c370f38ad63f77db03ae42db | 5,269 | py | Python | moment/test/test_isSameOrBefore.py | KrixTam/pymoment | b938cafc4c772df55feb3daa41286eade6f3e310 | [
"MIT"
] | 1 | 2021-04-24T17:51:08.000Z | 2021-04-24T17:51:08.000Z | moment/test/test_isSameOrBefore.py | KrixTam/pymoment | b938cafc4c772df55feb3daa41286eade6f3e310 | [
"MIT"
] | null | null | null | moment/test/test_isSameOrBefore.py | KrixTam/pymoment | b938cafc4c772df55feb3daa41286eade6f3e310 | [
"MIT"
] | null | null | null | import unittest
from moment import moment
class TestIsSameOrBefore(unittest.TestCase):
def test_default(self):
a = moment('2021-04-22 04:02:09.957000 +0800')
b = moment('2021-2-2 13:02:09.957000 +0800')
self.assertTrue(a.isSameOrBefore([2021, 5, 1]))
self.assertFalse(a.isSameOrBef... | 43.908333 | 77 | 0.605808 | import unittest
from moment import moment
class TestIsSameOrBefore(unittest.TestCase):
def test_default(self):
a = moment('2021-04-22 04:02:09.957000 +0800')
b = moment('2021-2-2 13:02:09.957000 +0800')
self.assertTrue(a.isSameOrBefore([2021, 5, 1]))
self.assertFalse(a.isSameOrBef... | true | true |
f7113a7ec84a5912d102e4fdfaf67e71bdf1c10e | 59 | py | Python | dev/ideal.py | baltiloka/fisica | 96e8bb1d4eec9963afa4732e19fb474b3ead1b31 | [
"MIT"
] | null | null | null | dev/ideal.py | baltiloka/fisica | 96e8bb1d4eec9963afa4732e19fb474b3ead1b31 | [
"MIT"
] | null | null | null | dev/ideal.py | baltiloka/fisica | 96e8bb1d4eec9963afa4732e19fb474b3ead1b31 | [
"MIT"
] | null | null | null | """
Version Sofware: 0.0.0
Version Python: 3.7
"""
| 11.8 | 26 | 0.542373 | true | true | |
f7113ad4dce58e0ca6134660c1d3384f46c82957 | 2,323 | py | Python | g_CNN/Optimizers.py | wangjiangtao-NJPI/MachineLearning | 78124b56a26ec68efb3c517a4a2420860b6e4a75 | [
"MIT"
] | null | null | null | g_CNN/Optimizers.py | wangjiangtao-NJPI/MachineLearning | 78124b56a26ec68efb3c517a4a2420860b6e4a75 | [
"MIT"
] | null | null | null | g_CNN/Optimizers.py | wangjiangtao-NJPI/MachineLearning | 78124b56a26ec68efb3c517a4a2420860b6e4a75 | [
"MIT"
] | null | null | null | import os
import sys
root_path = os.path.abspath("../")
if root_path not in sys.path:
sys.path.append(root_path)
import tensorflow as tf
class Optimizer:
def __init__(self, lr=1e-3):
self._lr = lr
self._opt = None
@property
def name(self):
return str(self)
def minimize(s... | 26.701149 | 85 | 0.643134 | import os
import sys
root_path = os.path.abspath("../")
if root_path not in sys.path:
sys.path.append(root_path)
import tensorflow as tf
class Optimizer:
def __init__(self, lr=1e-3):
self._lr = lr
self._opt = None
@property
def name(self):
return str(self)
def minimize(s... | true | true |
f7113ae3426f27603355965e27500b97e47f2abe | 1,296 | py | Python | setup.py | dxxxm/opencv_wrapper | 4838185cf37b8d93190b5761dcc815ba285ff0cf | [
"MIT"
] | 16 | 2019-04-03T18:34:57.000Z | 2021-11-24T09:24:10.000Z | setup.py | anbergem/cvhelper | 4838185cf37b8d93190b5761dcc815ba285ff0cf | [
"MIT"
] | 7 | 2019-04-04T10:31:48.000Z | 2020-06-21T10:16:18.000Z | setup.py | anbergem/cvhelper | 4838185cf37b8d93190b5761dcc815ba285ff0cf | [
"MIT"
] | 3 | 2019-12-20T13:42:19.000Z | 2021-08-13T08:37:14.000Z | import os.path
import sys
from setuptools import setup
with open("README.md", encoding="utf-8") as fh:
long_description = fh.read()
requirements = ["numpy"]
if sys.version_info[1] == 6:
requirements.append("dataclasses")
here = os.path.abspath(os.path.dirname(__file__))
about = {}
with open(os.path.join(h... | 27.574468 | 76 | 0.652778 | import os.path
import sys
from setuptools import setup
with open("README.md", encoding="utf-8") as fh:
long_description = fh.read()
requirements = ["numpy"]
if sys.version_info[1] == 6:
requirements.append("dataclasses")
here = os.path.abspath(os.path.dirname(__file__))
about = {}
with open(os.path.join(h... | true | true |
f7113b355a34d5cbd98cf0956b535f8beac0f567 | 26,950 | py | Python | integration-tests/run-intg-test.py | wso2-incubator/sp-test-integration | 7460ab98df55945e0a2c7351571bb765529a5f45 | [
"Apache-2.0"
] | null | null | null | integration-tests/run-intg-test.py | wso2-incubator/sp-test-integration | 7460ab98df55945e0a2c7351571bb765529a5f45 | [
"Apache-2.0"
] | null | null | null | integration-tests/run-intg-test.py | wso2-incubator/sp-test-integration | 7460ab98df55945e0a2c7351571bb765529a5f45 | [
"Apache-2.0"
] | 2 | 2018-09-05T04:52:17.000Z | 2018-09-05T06:16:53.000Z | # Copyright (c) 2018, WSO2 Inc. (http://wso2.com) All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ap... | 39.985163 | 178 | 0.648646 |
import sys
from xml.etree import ElementTree as ET
import subprocess
import wget
import logging
import inspect
import os
import shutil
import pymysql
import sqlparse
import glob
import ast
import stat
import re
from pathlib import Path
import urllib.request as urllib2
from xml.dom import minidom
import ... | true | true |
f7113c4e2ecd8677cdceb6cc10f2089325dd123b | 7,683 | py | Python | BNN/forget.py | fshp971/mcmc-unlearning | 3113dedca6de33bcaf316b804cb9c1e636db7fd5 | [
"MIT"
] | 5 | 2022-03-16T02:28:27.000Z | 2022-03-29T08:36:57.000Z | BNN/forget.py | fshp971/mcmc-unlearning | 3113dedca6de33bcaf316b804cb9c1e636db7fd5 | [
"MIT"
] | null | null | null | BNN/forget.py | fshp971/mcmc-unlearning | 3113dedca6de33bcaf316b804cb9c1e636db7fd5 | [
"MIT"
] | null | null | null | from datetime import datetime
import os
import pickle
import argparse
import numpy as np
import torch
import torch.nn.functional as F
from mcmc_unlearner import sgmcmcUnlearner
import utils
import models
class myUnlearner(sgmcmcUnlearner):
def _apply_sample(self, z):
x, y = z
if not self.cpu: x, ... | 31.879668 | 116 | 0.63647 | from datetime import datetime
import os
import pickle
import argparse
import numpy as np
import torch
import torch.nn.functional as F
from mcmc_unlearner import sgmcmcUnlearner
import utils
import models
class myUnlearner(sgmcmcUnlearner):
def _apply_sample(self, z):
x, y = z
if not self.cpu: x, ... | true | true |
f7113d3eadd9f0bc689a14dfac6d67b4d3b2ca7f | 2,323 | py | Python | src/timessquare/worker/main.py | lsst-sqre/times-square | 4a8d6183d9ae073d7e6968506e29c671d196446a | [
"MIT"
] | null | null | null | src/timessquare/worker/main.py | lsst-sqre/times-square | 4a8d6183d9ae073d7e6968506e29c671d196446a | [
"MIT"
] | 6 | 2021-12-13T20:19:41.000Z | 2022-03-28T20:09:01.000Z | src/timessquare/worker/main.py | lsst-sqre/times-square | 4a8d6183d9ae073d7e6968506e29c671d196446a | [
"MIT"
] | null | null | null | """Arq-based queue worker lifecycle configuration."""
from __future__ import annotations
import uuid
from typing import Any, Dict
import httpx
import structlog
from safir.dependencies.db_session import db_session_dependency
from safir.logging import configure_logging
from timessquare.config import config
from times... | 26.701149 | 78 | 0.713732 |
from __future__ import annotations
import uuid
from typing import Any, Dict
import httpx
import structlog
from safir.dependencies.db_session import db_session_dependency
from safir.logging import configure_logging
from timessquare.config import config
from timessquare.dependencies.redis import redis_dependency
fro... | true | true |
f7113d8051dae56c9c2db4dc6bfcbafa078a0893 | 2,015 | py | Python | pymongo_opentracing/tracing.py | khvn26/python-pymongo | d878249b6e1cb11007ab00fe44bdd858f6a78724 | [
"Apache-2.0"
] | null | null | null | pymongo_opentracing/tracing.py | khvn26/python-pymongo | d878249b6e1cb11007ab00fe44bdd858f6a78724 | [
"Apache-2.0"
] | null | null | null | pymongo_opentracing/tracing.py | khvn26/python-pymongo | d878249b6e1cb11007ab00fe44bdd858f6a78724 | [
"Apache-2.0"
] | null | null | null | # Copyright (C) 2018 SignalFx, Inc. All rights reserved.
from bson import json_util as json
from opentracing.ext import tags
import pymongo.monitoring
from six import text_type
import opentracing
class CommandTracing(pymongo.monitoring.CommandListener):
_scopes = {}
def __init__(self, tracer=None, span_tags... | 33.583333 | 78 | 0.653598 |
from bson import json_util as json
from opentracing.ext import tags
import pymongo.monitoring
from six import text_type
import opentracing
class CommandTracing(pymongo.monitoring.CommandListener):
_scopes = {}
def __init__(self, tracer=None, span_tags=None):
try:
global_tracer = opentra... | true | true |
f7113ddd020fdfec1185ec67da4041271d3b1e1d | 3,183 | py | Python | files/regressao_linear/regressaolinear1.py | Nina-pinheiro/Data-Science-Python | b6b2bc28f2f8f925e1b43408330641bd72388232 | [
"MIT"
] | 9 | 2021-01-29T14:01:57.000Z | 2022-03-26T00:46:00.000Z | files/regressao_linear/regressaolinear1.py | Nina-pinheiro/machine_learning_statistic_python | b6b2bc28f2f8f925e1b43408330641bd72388232 | [
"MIT"
] | null | null | null | files/regressao_linear/regressaolinear1.py | Nina-pinheiro/machine_learning_statistic_python | b6b2bc28f2f8f925e1b43408330641bd72388232 | [
"MIT"
] | 2 | 2020-07-28T11:25:55.000Z | 2020-08-03T20:04:11.000Z | # Importar as bibliotecas necessárias
import pandas as pd
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_error
import seaborn as sns
from sklearn.linear_model import LinearRegression
# Leitura do dataset
... | 28.168142 | 138 | 0.733585 |
import pandas as pd
import numpy as np
import matplotlib
import matplotlib.pyplot as plt
from sklearn.linear_model import LinearRegression
from sklearn.metrics import mean_squared_error
import seaborn as sns
from sklearn.linear_model import LinearRegression
df = pd.read_csv("dataset/consumo.csv")
df['Temperatu... | true | true |
f7113fc325ff8b58e82cf2a55f7200040cf6703c | 9,272 | py | Python | generate_xfoil/naca4.py | nasa/airfoil-learning | a76dabc0474485d1e573471e70ec4826aeae0517 | [
"NASA-1.3"
] | null | null | null | generate_xfoil/naca4.py | nasa/airfoil-learning | a76dabc0474485d1e573471e70ec4826aeae0517 | [
"NASA-1.3"
] | null | null | null | generate_xfoil/naca4.py | nasa/airfoil-learning | a76dabc0474485d1e573471e70ec4826aeae0517 | [
"NASA-1.3"
] | null | null | null | """
Python 2 and 3 code to generate 4 and 5 digit NACA profiles
The NACA airfoils are airfoil shapes for aircraft wings developed
by the National Advisory Committee for Aeronautics (NACA).
The shape of the NACA airfoils is described using a series of
digits following the word "NACA". The parameters in the numerical
co... | 31.972414 | 120 | 0.586928 |
from math import cos, sin, tan
from math import atan
from math import pi
from math import pow
from math import sqrt
def linspace(start,stop,np):
return [start+(stop-start)*i/(np-1) for i in range(np)]
def interpolate(xa,ya,queryPoints):
n = len(xa)
u, y2 = [0]*n, [0]*n
for... | true | true |
f71140f71757f91e0819a2fc215c3a2331a74823 | 2,033 | py | Python | Experimental setup/Window size test/data6.py | alancsouza/chip_clas | e6df8713ae7dd70a5719af83b3b6cb5686f87e29 | [
"MIT"
] | null | null | null | Experimental setup/Window size test/data6.py | alancsouza/chip_clas | e6df8713ae7dd70a5719af83b3b6cb5686f87e29 | [
"MIT"
] | null | null | null | Experimental setup/Window size test/data6.py | alancsouza/chip_clas | e6df8713ae7dd70a5719af83b3b6cb5686f87e29 | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
data6 = Breast cancer
"""
from chip_clas_new import chip_clas_new
import statistics
from functions import remove_noise
from sklearn.model_selection import train_test_split, KFold
from sklearn.preprocessing import MinMaxScaler
import numpy as np
import pandas as pd
da... | 32.269841 | 166 | 0.666503 |
from chip_clas_new import chip_clas_new
import statistics
from functions import remove_noise
from sklearn.model_selection import train_test_split, KFold
from sklearn.preprocessing import MinMaxScaler
import numpy as np
import pandas as pd
data_name = "Breast cancer"
print(data_name)
url = 'https://archive.ics.uci.e... | true | true |
f7114124785a5e85f61ee49af63f4110720e5cb2 | 2,254 | py | Python | bufu/bufu.py | indigo13love/bufu | de005ec465b3ae0688aaf1821a64573ca014e56a | [
"Apache-2.0"
] | null | null | null | bufu/bufu.py | indigo13love/bufu | de005ec465b3ae0688aaf1821a64573ca014e56a | [
"Apache-2.0"
] | null | null | null | bufu/bufu.py | indigo13love/bufu | de005ec465b3ae0688aaf1821a64573ca014e56a | [
"Apache-2.0"
] | null | null | null | import fire
import snowflake.connector
import configparser
import secrets
import pathlib
class Bufu():
def connect(self):
cp = configparser.ConfigParser()
path = pathlib.Path('~/.snowsql/config')
cp.read(path.expanduser())
conn = snowflake.connector.connect(
user = cp['c... | 29.657895 | 78 | 0.5 | import fire
import snowflake.connector
import configparser
import secrets
import pathlib
class Bufu():
def connect(self):
cp = configparser.ConfigParser()
path = pathlib.Path('~/.snowsql/config')
cp.read(path.expanduser())
conn = snowflake.connector.connect(
user = cp['c... | true | true |
f71142d1bd2737e13ea6097fca600ac378ba836b | 16,033 | py | Python | sfa/data_process/transformation.py | lhcezx/Deteciton_3D | e98b9bb0dd96dfa112e196ec93129caf1ffef39e | [
"MIT"
] | null | null | null | sfa/data_process/transformation.py | lhcezx/Deteciton_3D | e98b9bb0dd96dfa112e196ec93129caf1ffef39e | [
"MIT"
] | null | null | null | sfa/data_process/transformation.py | lhcezx/Deteciton_3D | e98b9bb0dd96dfa112e196ec93129caf1ffef39e | [
"MIT"
] | null | null | null | import os
import sys
import math
import numpy as np
import torch
src_dir = os.path.dirname(os.path.realpath(__file__))
while not src_dir.endswith("sfa"):
src_dir = os.path.dirname(src_dir)
if src_dir not in sys.path:
sys.path.append(src_dir)
from config import kitti_config as cnf
def angle_in_limit(angle):... | 36.11036 | 122 | 0.51132 | import os
import sys
import math
import numpy as np
import torch
src_dir = os.path.dirname(os.path.realpath(__file__))
while not src_dir.endswith("sfa"):
src_dir = os.path.dirname(src_dir)
if src_dir not in sys.path:
sys.path.append(src_dir)
from config import kitti_config as cnf
def angle_in_limit(angle):... | true | true |
f71142dc21ca7466db972f45836c427d9d863a33 | 9,539 | py | Python | src/neuro_comma/dataset.py | art-vish/neuro-comma | 148ff7150e92d734d926a576c50bcabf1ae0ec0a | [
"MIT"
] | 1 | 2021-11-12T21:05:33.000Z | 2021-11-12T21:05:33.000Z | src/neuro_comma/dataset.py | art-vish/neuro-comma | 148ff7150e92d734d926a576c50bcabf1ae0ec0a | [
"MIT"
] | null | null | null | src/neuro_comma/dataset.py | art-vish/neuro-comma | 148ff7150e92d734d926a576c50bcabf1ae0ec0a | [
"MIT"
] | null | null | null | from typing import Dict, List, Optional, Tuple, Union
from typing_extensions import TypedDict
import numpy as np
import torch
from torch import Tensor
from tqdm import tqdm
from transformers import PreTrainedTokenizer
from neuro_comma.augmentation import AUGMENTATIONS
from neuro_comma.pretrained import TOKEN_IDX
cl... | 38.156 | 163 | 0.528672 | from typing import Dict, List, Optional, Tuple, Union
from typing_extensions import TypedDict
import numpy as np
import torch
from torch import Tensor
from tqdm import tqdm
from transformers import PreTrainedTokenizer
from neuro_comma.augmentation import AUGMENTATIONS
from neuro_comma.pretrained import TOKEN_IDX
cl... | true | true |
f71143dd842b9d129c24fafa0c0a8b516d2a0087 | 418 | py | Python | 01-logica-de-programacao-e-algoritmos/Aula 05/5 Recursos avancados com funcoes/5.1 excecoes e erros/ex05.py | rafaelbarretomg/Uninter | 1f84b0103263177122663e991db3a8aeb106a959 | [
"MIT"
] | null | null | null | 01-logica-de-programacao-e-algoritmos/Aula 05/5 Recursos avancados com funcoes/5.1 excecoes e erros/ex05.py | rafaelbarretomg/Uninter | 1f84b0103263177122663e991db3a8aeb106a959 | [
"MIT"
] | null | null | null | 01-logica-de-programacao-e-algoritmos/Aula 05/5 Recursos avancados com funcoes/5.1 excecoes e erros/ex05.py | rafaelbarretomg/Uninter | 1f84b0103263177122663e991db3a8aeb106a959 | [
"MIT"
] | null | null | null | i = 0
while True:
try:
nome = input('Por favor digite o seu nome: ')
ind = int(input('Digite um indice do nome digitado: '))
print(nome[ind])
break
except ValueError:
print('Oops! Nome invalido. Tente novamente...')
except IndexError:
print('Oops! Indice inval... | 27.866667 | 63 | 0.564593 | i = 0
while True:
try:
nome = input('Por favor digite o seu nome: ')
ind = int(input('Digite um indice do nome digitado: '))
print(nome[ind])
break
except ValueError:
print('Oops! Nome invalido. Tente novamente...')
except IndexError:
print('Oops! Indice inval... | true | true |
f71144d3fcf748c12ca08f30fa4fdb097ffc23d5 | 9,496 | py | Python | mutagen/_vorbis.py | lucienimmink/scanner.py | cecaa0a570ba8058321dea1c8efa9f77868effb3 | [
"MIT"
] | 2 | 2020-09-16T07:00:41.000Z | 2020-12-20T19:56:03.000Z | mutagen/_vorbis.py | lucienimmink/scanner.py | cecaa0a570ba8058321dea1c8efa9f77868effb3 | [
"MIT"
] | null | null | null | mutagen/_vorbis.py | lucienimmink/scanner.py | cecaa0a570ba8058321dea1c8efa9f77868effb3 | [
"MIT"
] | 2 | 2020-09-17T08:27:12.000Z | 2021-08-23T11:13:52.000Z | # -*- coding: utf-8 -*-
# Copyright (C) 2005-2006 Joe Wreschnig
# 2013 Christoph Reiter
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or... | 30.731392 | 77 | 0.574031 |
import sys
from io import BytesIO
import mutagen
from mutagen._util import DictMixin, cdata, MutagenError, reraise
def is_valid_key(key):
if isinstance(key, bytes):
raise TypeError("needs to be str not bytes")
for c in key:
if c < " " or c > "}" or c == "=":
return Fal... | true | true |
f7114556d4b105fe47f72182510cb3fda36299a6 | 2,416 | py | Python | sdn-lab/2 - hub/hub2.py | chenyongzhouking/qqq | 19d0d80d8c8897ed198d9ac7f02eae3dd114635c | [
"Apache-2.0"
] | null | null | null | sdn-lab/2 - hub/hub2.py | chenyongzhouking/qqq | 19d0d80d8c8897ed198d9ac7f02eae3dd114635c | [
"Apache-2.0"
] | null | null | null | sdn-lab/2 - hub/hub2.py | chenyongzhouking/qqq | 19d0d80d8c8897ed198d9ac7f02eae3dd114635c | [
"Apache-2.0"
] | null | null | null | # Implementazione openflow di un hub tramite controller
#
# In ogni switch viene caricata un'unica regola
# di default (table miss) con azione di invio al controller
# dell'intero pacchetto. Il controller risponde con una
# packet out con azione flood
#
# NOTA: OpenVSwitch ignora l'opzione OFPCML_NO_BUFFER
# nelle rego... | 30.974359 | 69 | 0.637003 |
# di default (table miss) con azione di invio al controller
# dell'intero pacchetto. Il controller risponde con una
# nelle regole table miss (priorita' 0); pertanto,
from ryu.base import app_manager
from ryu.controller import ofp_event
from ryu.controller.handler import CONFIG_DISPATCHER, MAIN_DISPATCHER
from ... | true | true |
f71145a2da3e9433195622624a9601d75fc97862 | 2,895 | py | Python | grouper/fe/handlers/service_account_create.py | bonniech3n/merou | 47d9de906686fd5b930a49299d3ffbcc0673ae8a | [
"Apache-2.0"
] | null | null | null | grouper/fe/handlers/service_account_create.py | bonniech3n/merou | 47d9de906686fd5b930a49299d3ffbcc0673ae8a | [
"Apache-2.0"
] | null | null | null | grouper/fe/handlers/service_account_create.py | bonniech3n/merou | 47d9de906686fd5b930a49299d3ffbcc0673ae8a | [
"Apache-2.0"
] | null | null | null | from grouper.fe.forms import ServiceAccountCreateForm
from grouper.fe.settings import settings
from grouper.fe.util import GrouperHandler
from grouper.models.group import Group
from grouper.service_account import (
BadMachineSet,
can_create_service_account,
create_service_account,
DuplicateServiceAccoun... | 35.304878 | 99 | 0.591019 | from grouper.fe.forms import ServiceAccountCreateForm
from grouper.fe.settings import settings
from grouper.fe.util import GrouperHandler
from grouper.models.group import Group
from grouper.service_account import (
BadMachineSet,
can_create_service_account,
create_service_account,
DuplicateServiceAccoun... | true | true |
f71145a80fcf271f5514d8ace4aea5cef26e4d8b | 394 | py | Python | generate_params_cont_bath.py | patryk-kubiczek/learning-GF | 779250d139307cb72e5b4e467f46825c984c87ec | [
"MIT"
] | 8 | 2019-08-13T22:20:53.000Z | 2020-07-22T01:48:41.000Z | generate_params_cont_bath.py | patryk-kubiczek/learning-GF | 779250d139307cb72e5b4e467f46825c984c87ec | [
"MIT"
] | null | null | null | generate_params_cont_bath.py | patryk-kubiczek/learning-GF | 779250d139307cb72e5b4e467f46825c984c87ec | [
"MIT"
] | null | null | null | from generate_params import *
n_params = 50
for _ in range(n_params):
random_params_cont_bath(beta=beta,
U_range=[1., 8.],
eps_range=[-1., 1.],
D_range=[2. , 8.],
filename=name("params_cont_bath", beta,... | 30.307692 | 70 | 0.423858 | from generate_params import *
n_params = 50
for _ in range(n_params):
random_params_cont_bath(beta=beta,
U_range=[1., 8.],
eps_range=[-1., 1.],
D_range=[2. , 8.],
filename=name("params_cont_bath", beta,... | true | true |
f71145cadf3e23956ba90f5e44b628c0b29a20a3 | 484 | py | Python | cmsplugin_seocheck/cms_toolbar.py | creimers/cmsplugin_seocheck | b97f38e55dec516ebf0c049cd26b74347e49b86e | [
"BSD-2-Clause"
] | 3 | 2015-05-11T19:46:59.000Z | 2016-07-26T00:20:00.000Z | cmsplugin_seocheck/cms_toolbar.py | creimers/cmsplugin_seocheck | b97f38e55dec516ebf0c049cd26b74347e49b86e | [
"BSD-2-Clause"
] | 2 | 2015-05-09T16:21:26.000Z | 2016-10-29T13:23:35.000Z | cmsplugin_seocheck/cms_toolbar.py | creimers/cmsplugin_seocheck | b97f38e55dec516ebf0c049cd26b74347e49b86e | [
"BSD-2-Clause"
] | 1 | 2018-03-03T16:18:59.000Z | 2018-03-03T16:18:59.000Z | # -*- coding: utf-8 -*-
from django.core.urlresolvers import reverse
from cms.toolbar_base import CMSToolbar
from cms.toolbar_pool import toolbar_pool
@toolbar_pool.register
class SeoCheckToolbar(CMSToolbar):
def populate(self):
seo_check_menu = self.toolbar.get_or_create_menu(
'seo_check... | 28.470588 | 64 | 0.673554 |
from django.core.urlresolvers import reverse
from cms.toolbar_base import CMSToolbar
from cms.toolbar_pool import toolbar_pool
@toolbar_pool.register
class SeoCheckToolbar(CMSToolbar):
def populate(self):
seo_check_menu = self.toolbar.get_or_create_menu(
'seo_check',
'SEO... | true | true |
f7114642c746c750ee68257580dadca691feecd7 | 737 | py | Python | pele_platform/gpcr/main.py | esguerra/pele_platform | c78a049d5e4000b42688f6ba240cf97b67739770 | [
"Apache-2.0"
] | 5 | 2020-03-06T17:26:42.000Z | 2020-10-28T16:24:39.000Z | pele_platform/gpcr/main.py | esguerra/pele_platform | c78a049d5e4000b42688f6ba240cf97b67739770 | [
"Apache-2.0"
] | 37 | 2019-11-28T11:07:47.000Z | 2020-11-23T16:22:50.000Z | pele_platform/gpcr/main.py | esguerra/pele_platform | c78a049d5e4000b42688f6ba240cf97b67739770 | [
"Apache-2.0"
] | 8 | 2019-11-27T15:16:30.000Z | 2020-10-27T10:29:52.000Z | from dataclasses import dataclass
import pele_platform.Adaptive.simulation as si
import pele_platform.Utilities.Parameters.parameters as pv
@dataclass
class GpcrLauncher:
args: pv.ParametersBuilder
def run_gpcr_simulation(self) -> pv.ParametersBuilder:
# Set parameters for GPCR and launch simulation... | 32.043478 | 58 | 0.739484 | from dataclasses import dataclass
import pele_platform.Adaptive.simulation as si
import pele_platform.Utilities.Parameters.parameters as pv
@dataclass
class GpcrLauncher:
args: pv.ParametersBuilder
def run_gpcr_simulation(self) -> pv.ParametersBuilder:
self._set_parameters()
simulat... | true | true |
f71146bbe42ce1d7a3023d062762ef23004c106b | 463 | py | Python | Python3/172.factorial-trailing-zeroes.py | 610yilingliu/leetcode | 30d071b3685c2131bd3462ba77c6c05114f3f227 | [
"MIT"
] | null | null | null | Python3/172.factorial-trailing-zeroes.py | 610yilingliu/leetcode | 30d071b3685c2131bd3462ba77c6c05114f3f227 | [
"MIT"
] | null | null | null | Python3/172.factorial-trailing-zeroes.py | 610yilingliu/leetcode | 30d071b3685c2131bd3462ba77c6c05114f3f227 | [
"MIT"
] | null | null | null | #
# @lc app=leetcode id=172 lang=python3
#
# [172] Factorial Trailing Zeroes
#
# @lc code=start
class Solution:
def trailingZeroes(self, n):
# zero generated by 2 and 5
if n < 5:
return 0
ans = 0
base = 5
while n >= base:
ans += n//base
ba... | 16.535714 | 38 | 0.5054 |
class Solution:
def trailingZeroes(self, n):
if n < 5:
return 0
ans = 0
base = 5
while n >= base:
ans += n//base
base *= 5
return ans
if __name__ == '__main__':
a = Solution()
b = a.trailingZeroes(200)
p... | true | true |
f71146e12c601123c8c8e79c664e15a620ce0608 | 184 | py | Python | GPGO/__init__.py | FNTwin/Bayesian-Optimization | 2f89699648601d4499dcab285a1d7376f0e1ef4b | [
"MIT"
] | 3 | 2020-06-07T19:16:40.000Z | 2020-07-18T21:56:13.000Z | GPGO/__init__.py | FNTwin/Bayesian-Optimization | 2f89699648601d4499dcab285a1d7376f0e1ef4b | [
"MIT"
] | null | null | null | GPGO/__init__.py | FNTwin/Bayesian-Optimization | 2f89699648601d4499dcab285a1d7376f0e1ef4b | [
"MIT"
] | 2 | 2021-01-03T19:09:42.000Z | 2021-01-03T19:09:42.000Z | #from .Opt import BayesianOptimization
from .GaussianProcess import GP
from .GaussianProcess.Kernel import RBF
from .Opt import BayesianOptimization
from .Acquisition import Acquistion | 36.8 | 39 | 0.858696 |
from .GaussianProcess import GP
from .GaussianProcess.Kernel import RBF
from .Opt import BayesianOptimization
from .Acquisition import Acquistion | true | true |
f711480da10ac2397dde2ba6ad95be010af52580 | 5,095 | py | Python | submissions/Thompson/mySearches.py | CDeas9/aima-python | 91c89d898f46a8c472277c9b85c9a282af378937 | [
"MIT"
] | null | null | null | submissions/Thompson/mySearches.py | CDeas9/aima-python | 91c89d898f46a8c472277c9b85c9a282af378937 | [
"MIT"
] | null | null | null | submissions/Thompson/mySearches.py | CDeas9/aima-python | 91c89d898f46a8c472277c9b85c9a282af378937 | [
"MIT"
] | null | null | null | import search
import string
from math import(cos, pi)
# A sample map problem
# sumner_map = search.UndirectedGraph(dict(
# Portland=dict(Mitchellville=7, Fairfield=17, Cottontown=18),
# Cottontown=dict(Portland=18),
# Fairfield=dict(Mitchellville=21, Portland=17),
# Mitchellville=dict(Portland=7, Fairfield... | 29.970588 | 92 | 0.556035 | import search
import string
from math import(cos, pi)
# An abbreviated map of Sumner County, TN.
# This map is unique, to the best of my knowledge.
# '''
norfolk_map = search.UndirectedGraph(dict(
Norfolk=dict(Suffolk=50,Chesapeake=15,VirginiaBeach=35),
Suffolk=dict(Norfolk=50,Chesapeake=35,Hamp... | true | true |
f71148786432618607fcb5a1bef3949e8303ec9a | 12,558 | py | Python | venv/Lib/site-packages/streamlit/caching/hashing.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 19,099 | 2019-08-25T14:00:15.000Z | 2022-03-31T21:00:28.000Z | venv/Lib/site-packages/streamlit/caching/hashing.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 3,078 | 2019-08-25T19:50:14.000Z | 2022-03-31T23:26:14.000Z | venv/Lib/site-packages/streamlit/caching/hashing.py | ajayiagbebaku/NFL-Model | afcc67a85ca7138c58c3334d45988ada2da158ed | [
"MIT"
] | 1,892 | 2019-08-26T04:44:24.000Z | 2022-03-30T16:11:51.000Z | # Copyright 2018-2021 Streamlit Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in wr... | 32.2 | 89 | 0.608218 |
import collections
import functools
import hashlib
import inspect
import io
import os
import pickle
import sys
import tempfile
import threading
import unittest.mock
import weakref
from typing import Any, Pattern, Optional, Dict, List
from streamlit import type_util
from streamlit import util
from streaml... | true | true |
f711488f270af532051f4ab5dbf2bb0e3eb47a6a | 24 | py | Python | src/test.py | nsde/latinum | c9c58e65b1ab6554f9e2d6bc540b2436aa6270a6 | [
"MIT"
] | null | null | null | src/test.py | nsde/latinum | c9c58e65b1ab6554f9e2d6bc540b2436aa6270a6 | [
"MIT"
] | null | null | null | src/test.py | nsde/latinum | c9c58e65b1ab6554f9e2d6bc540b2436aa6270a6 | [
"MIT"
] | null | null | null | print('a b'.split('.s')) | 24 | 24 | 0.541667 | print('a b'.split('.s')) | true | true |
f711491beb33a98ded1b75da64a40b5c95ce8390 | 934 | py | Python | BipHelp/urls.py | Fenn-CS/BipHelp | a343a1b6f4a1374f54a59d12b07ddbe46b4b0225 | [
"Apache-2.0"
] | null | null | null | BipHelp/urls.py | Fenn-CS/BipHelp | a343a1b6f4a1374f54a59d12b07ddbe46b4b0225 | [
"Apache-2.0"
] | null | null | null | BipHelp/urls.py | Fenn-CS/BipHelp | a343a1b6f4a1374f54a59d12b07ddbe46b4b0225 | [
"Apache-2.0"
] | 1 | 2018-10-30T21:51:10.000Z | 2018-10-30T21:51:10.000Z | """BipHelp URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Class-ba... | 35.923077 | 79 | 0.705567 | from django.conf.urls import url, include
from django.contrib import admin
from rest_framework import routers
router = routers.DefaultRouter()
urlpatterns = [
url(r'^', include(router.urls)),
url(r'^admin/', admin.site.urls),
url(r'^api-auth/', include('rest_framework.urls')),
]
| true | true |
f711491c5c5fc5ac07e56331455fd692c0815d01 | 370 | py | Python | web-frameworks/django/iWillTestEachApps/django_filter/models.py | suroegin-learning/learn-python | be5bda86add0dcd6f2fd3db737bb7d0d3ec5f853 | [
"MIT"
] | null | null | null | web-frameworks/django/iWillTestEachApps/django_filter/models.py | suroegin-learning/learn-python | be5bda86add0dcd6f2fd3db737bb7d0d3ec5f853 | [
"MIT"
] | null | null | null | web-frameworks/django/iWillTestEachApps/django_filter/models.py | suroegin-learning/learn-python | be5bda86add0dcd6f2fd3db737bb7d0d3ec5f853 | [
"MIT"
] | null | null | null | from django.db import models
class Manufacturer(models.Model):
name = models.CharField(max_length=255)
class Product(models.Model):
name = models.CharField(max_length=255)
price = models.DecimalField()
description = models.TextField()
release_date = models.DateField()
manufacturer = models.F... | 26.428571 | 76 | 0.748649 | from django.db import models
class Manufacturer(models.Model):
name = models.CharField(max_length=255)
class Product(models.Model):
name = models.CharField(max_length=255)
price = models.DecimalField()
description = models.TextField()
release_date = models.DateField()
manufacturer = models.F... | true | true |
f7114b1798d03f32f8126bb57de8a94ecc904af6 | 4,302 | py | Python | classification_ModelNet40/test.py | DeVriesMatt/pointMLP-pytorch | e9c09a2038551e83b072353f3fd7e3294463e892 | [
"Apache-2.0"
] | null | null | null | classification_ModelNet40/test.py | DeVriesMatt/pointMLP-pytorch | e9c09a2038551e83b072353f3fd7e3294463e892 | [
"Apache-2.0"
] | null | null | null | classification_ModelNet40/test.py | DeVriesMatt/pointMLP-pytorch | e9c09a2038551e83b072353f3fd7e3294463e892 | [
"Apache-2.0"
] | null | null | null | """
python test.py --model pointMLP --msg 20220209053148-404
"""
import argparse
import os
import datetime
import torch
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
from torch.utils.data import DataLoader
import models as mo... | 30.083916 | 86 | 0.600418 | import argparse
import os
import datetime
import torch
import torch.nn.parallel
import torch.backends.cudnn as cudnn
import torch.optim
import torch.utils.data
import torch.utils.data.distributed
from torch.utils.data import DataLoader
import models as models
from utils import progress_bar, IOStream
from data import Mo... | true | true |
f7114b53060ebf330889d349d56e52f921eb0eac | 1,050 | py | Python | qa/rpc-tests/reindex.py | mirzaei-ce/core-filbit | 415073034f471c38a60223af52b8da76c302ae1c | [
"MIT"
] | null | null | null | qa/rpc-tests/reindex.py | mirzaei-ce/core-filbit | 415073034f471c38a60223af52b8da76c302ae1c | [
"MIT"
] | null | null | null | qa/rpc-tests/reindex.py | mirzaei-ce/core-filbit | 415073034f471c38a60223af52b8da76c302ae1c | [
"MIT"
] | null | null | null | #!/usr/bin/env python2
# Copyright (c) 2014-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
#
# Test -reindex with CheckBlockIndex
#
from test_framework.test_framework import FilbitTestFramework
fr... | 31.818182 | 102 | 0.698095 |
from test_framework.test_framework import FilbitTestFramework
from test_framework.util import *
class ReindexTest(FilbitTestFramework):
def setup_chain(self):
print("Initializing test directory "+self.options.tmpdir)
initialize_chain_clean(self.options.tmpdir, 1)
def setup_network(sel... | false | true |
f7114b855ef654c33ec2aa02a726cbcb0a885758 | 720 | py | Python | pydualsense/hidguardian.py | TheComputerDan/pydualsense | c1c10e4eacf37818e31b09f83c0e5aba7001fbad | [
"MIT"
] | null | null | null | pydualsense/hidguardian.py | TheComputerDan/pydualsense | c1c10e4eacf37818e31b09f83c0e5aba7001fbad | [
"MIT"
] | null | null | null | pydualsense/hidguardian.py | TheComputerDan/pydualsense | c1c10e4eacf37818e31b09f83c0e5aba7001fbad | [
"MIT"
] | null | null | null | import winreg
import sys
def check_hide() -> bool:
"""check if hidguardian is used and controller is hidden
"""
if sys.platform.startswith('win32'):
try:
access_reg = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE)
access_key = winreg.OpenKey(... | 37.894737 | 135 | 0.605556 | import winreg
import sys
def check_hide() -> bool:
if sys.platform.startswith('win32'):
try:
access_reg = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE)
access_key = winreg.OpenKey(access_reg, 'SYSTEM\CurrentControlSet\Services\HidGuardian\Parameters', 0, wi... | true | true |
f7114ceafa6e4c5af4457ca817ffc5d52ca75a2f | 4,600 | py | Python | util/rule_ctl/tests/rule_ctl_test.py | linuxgemini/coreruleset | 0873cbeae35c85de72b0292f0d17a26308026c83 | [
"Apache-2.0"
] | 930 | 2020-05-13T17:07:34.000Z | 2022-03-30T02:56:06.000Z | util/rule_ctl/tests/rule_ctl_test.py | linuxgemini/coreruleset | 0873cbeae35c85de72b0292f0d17a26308026c83 | [
"Apache-2.0"
] | 675 | 2020-05-13T20:32:11.000Z | 2022-03-31T22:07:20.000Z | util/rule_ctl/tests/rule_ctl_test.py | linuxgemini/coreruleset | 0873cbeae35c85de72b0292f0d17a26308026c83 | [
"Apache-2.0"
] | 216 | 2020-05-13T16:58:08.000Z | 2022-03-30T20:50:40.000Z | from .helpers import *
class TestFilterRuleId:
def test_filter_rule_id_exact_match(self):
arguments = [
"--filter-rule-id", "12",
"--append-tag", "foo"
]
rule_string = """
SecRule ARGS|ARGS:foo|!ARGS:bar "@rx foo" "id:12"
"""
expected = """
SecRule ARGS|ARGS:... | 23.469388 | 64 | 0.553913 | from .helpers import *
class TestFilterRuleId:
def test_filter_rule_id_exact_match(self):
arguments = [
"--filter-rule-id", "12",
"--append-tag", "foo"
]
rule_string = """
SecRule ARGS|ARGS:foo|!ARGS:bar "@rx foo" "id:12"
"""
expected = """
SecRule ARGS|ARGS:... | true | true |
f7114d567227d1df1f9cb9f60ad3422ee6a8dcd9 | 1,784 | py | Python | backend/models/advices.py | jimbunny/AdminSystem | d9a42e2d8608cb0d9bc88f4c1945da48fb8cc925 | [
"MIT"
] | null | null | null | backend/models/advices.py | jimbunny/AdminSystem | d9a42e2d8608cb0d9bc88f4c1945da48fb8cc925 | [
"MIT"
] | null | null | null | backend/models/advices.py | jimbunny/AdminSystem | d9a42e2d8608cb0d9bc88f4c1945da48fb8cc925 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding:utf-8 -*-
# author:jingtongyu
# datetime:2020/6/7 10:14 下午
# software: PyCharm
from flask import current_app
from . import db
from .base import BaseModel
from sqlalchemy.exc import SQLAlchemyError
from werkzeug.security import generate_password_hash, check_password_hash
import time
... | 28.31746 | 81 | 0.661996 |
from flask import current_app
from . import db
from .base import BaseModel
from sqlalchemy.exc import SQLAlchemyError
from werkzeug.security import generate_password_hash, check_password_hash
import time
class AdvicesModel(db.Model, BaseModel):
__tablename__ = 'advices'
id = db.Column(db.Integer, primar... | true | true |
f7114d5ce30868ac26305f645e0af907645ede7a | 124 | py | Python | python/testData/inspections/PyCompatibilityInspection/builtinLong.py | Starmel/intellij-community | adb89951109732e585d04f33e3fabbc9f9d3b256 | [
"Apache-2.0"
] | 2 | 2019-04-28T07:48:50.000Z | 2020-12-11T14:18:08.000Z | python/testData/inspections/PyCompatibilityInspection/builtinLong.py | Starmel/intellij-community | adb89951109732e585d04f33e3fabbc9f9d3b256 | [
"Apache-2.0"
] | null | null | null | python/testData/inspections/PyCompatibilityInspection/builtinLong.py | Starmel/intellij-community | adb89951109732e585d04f33e3fabbc9f9d3b256 | [
"Apache-2.0"
] | null | null | null | <warning descr="Python versions 3.5, 3.6, 3.7, 3.8, 3.9, 3.10 do not have type long. Use int instead.">long("abc")</warning> | 124 | 124 | 0.669355 | <warning descr="Python versions 3.5, 3.6, 3.7, 3.8, 3.9, 3.10 do not have type long. Use int instead.">long("abc")</warning> | false | true |
f7114e75083e7594277297c3936a74615d8ca5a1 | 7,187 | py | Python | tests/toranj/test-038-clear-address-cache-for-sed.py | ctan-g/openthread | 376f35a49e5c0a5b8170c117d7a930e3a8b3b210 | [
"BSD-3-Clause"
] | 1 | 2020-08-12T06:15:53.000Z | 2020-08-12T06:15:53.000Z | tests/toranj/test-038-clear-address-cache-for-sed.py | ctan-g/openthread | 376f35a49e5c0a5b8170c117d7a930e3a8b3b210 | [
"BSD-3-Clause"
] | null | null | null | tests/toranj/test-038-clear-address-cache-for-sed.py | ctan-g/openthread | 376f35a49e5c0a5b8170c117d7a930e3a8b3b210 | [
"BSD-3-Clause"
] | null | null | null | #!/usr/bin/env python3
#
# Copyright (c) 2019, The OpenThread Authors.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
# 1. Redistributions of source code must retain the above copyright
# ... | 34.552885 | 121 | 0.681647 |
import wpan
from wpan import verify
test_name = __file__[:-3] if __file__.endswith('.py') else __file__
print('-' * 120)
print('Starting \'{}\''.format(test_name))
speedup = 4
wpan.Node.set_time_speedup_factor(speedup)
r1 = wpan.Node()
r2 = wpan.Node()
r3 = wpan.Node()
c = wpan.... | true | true |
f7114f0b8e6cff50b6be4c21a07fc5c0f023fd01 | 864 | py | Python | env/lib/python3.8/site-packages/plotly/validators/volume/_lightposition.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 11,750 | 2015-10-12T07:03:39.000Z | 2022-03-31T20:43:15.000Z | env/lib/python3.8/site-packages/plotly/validators/volume/_lightposition.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 2,951 | 2015-10-12T00:41:25.000Z | 2022-03-31T22:19:26.000Z | env/lib/python3.8/site-packages/plotly/validators/volume/_lightposition.py | acrucetta/Chicago_COVI_WebApp | a37c9f492a20dcd625f8647067394617988de913 | [
"MIT",
"Unlicense"
] | 2,623 | 2015-10-15T14:40:27.000Z | 2022-03-28T16:05:50.000Z | import _plotly_utils.basevalidators
class LightpositionValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="lightposition", parent_name="volume", **kwargs):
super(LightpositionValidator, self).__init__(
plotly_name=plotly_name,
parent_name=pare... | 33.230769 | 84 | 0.568287 | import _plotly_utils.basevalidators
class LightpositionValidator(_plotly_utils.basevalidators.CompoundValidator):
def __init__(self, plotly_name="lightposition", parent_name="volume", **kwargs):
super(LightpositionValidator, self).__init__(
plotly_name=plotly_name,
parent_name=pare... | true | true |
f7114f44e7d867f1454daedb6c4471877ffab72f | 5,380 | py | Python | scripts_hico/HICO_eval/bbox_utils.py | roy881020/VSGNet | a9ba741871d1d7ff401cecf23659f0b75576e7c3 | [
"MIT"
] | 111 | 2020-02-27T16:00:27.000Z | 2022-03-22T08:09:56.000Z | scripts_hico/HICO_eval/bbox_utils.py | roy881020/VSGNet | a9ba741871d1d7ff401cecf23659f0b75576e7c3 | [
"MIT"
] | 21 | 2020-04-24T11:37:59.000Z | 2022-02-28T03:10:08.000Z | scripts_hico/HICO_eval/bbox_utils.py | roy881020/VSGNet | a9ba741871d1d7ff401cecf23659f0b75576e7c3 | [
"MIT"
] | 23 | 2020-03-18T10:50:07.000Z | 2022-02-09T12:35:57.000Z | import numpy as np
#import skimage.draw as skdraw
def add_bbox(img,bbox,color=[0,0,0],fill=False,alpha=1):
x1,y1,x2,y2 = bbox
# Clockwise starting from top left
r = [y1,y1,y2,y2]
c = [x1,x2,x2,x1]
if fill:
coords = skdraw.polygon(r,c,shape=img.shape[0:2])
skdraw.set_color... | 23.189655 | 75 | 0.554461 | import numpy as np
def add_bbox(img,bbox,color=[0,0,0],fill=False,alpha=1):
x1,y1,x2,y2 = bbox
r = [y1,y1,y2,y2]
c = [x1,x2,x2,x1]
if fill:
coords = skdraw.polygon(r,c,shape=img.shape[0:2])
skdraw.set_color(img,coords,color,alpha=alpha)
return
peri_coords =... | true | true |
f7114fba470e1fb01f21f644c0cf7c1507d1186c | 4,585 | py | Python | load_neo4j.py | newmanrs/cloudburst-graph | 6e3a6878b1ae04f07fa35f2c689243a906bd026e | [
"MIT"
] | 1 | 2021-05-30T17:35:20.000Z | 2021-05-30T17:35:20.000Z | load_neo4j.py | newmanrs/cloudburst-graph | 6e3a6878b1ae04f07fa35f2c689243a906bd026e | [
"MIT"
] | 14 | 2021-05-30T03:51:39.000Z | 2021-11-13T03:18:19.000Z | load_neo4j.py | newmanrs/cloudburst-graph | 6e3a6878b1ae04f07fa35f2c689243a906bd026e | [
"MIT"
] | null | null | null | from neo4j import GraphDatabase
import json
import os
def create_beers(tx):
""" Load from the results of cloudburst site scraper """
with open('data/beers.json', 'r') as f:
beer_hops = json.load(f)
beers = beer_hops['beers']
query = """
UNWIND $beers as beer
MERGE (b:Bee... | 26.50289 | 76 | 0.577317 | from neo4j import GraphDatabase
import json
import os
def create_beers(tx):
with open('data/beers.json', 'r') as f:
beer_hops = json.load(f)
beers = beer_hops['beers']
query = """
UNWIND $beers as beer
MERGE (b:Beer {name : beer.beer_name,
abv : beer.abv,
... | true | true |
f7115016c89676f8c77084533e51e99ca21fe5e2 | 517 | py | Python | sort_dict.py | taijiji/python-memo | 627c887cf318a56824c51fef3c486bd8160c340d | [
"MIT"
] | null | null | null | sort_dict.py | taijiji/python-memo | 627c887cf318a56824c51fef3c486bd8160c340d | [
"MIT"
] | null | null | null | sort_dict.py | taijiji/python-memo | 627c887cf318a56824c51fef3c486bd8160c340d | [
"MIT"
] | null | null | null | from pprint import pprint
d = {
'A' : 10,
'B' : 50,
'C' : 40,
}
print(sorted(d)) # ['A', 'B', 'C']
print(sorted(d, key=d.get)) # ['A', 'C', 'B']
print(sorted(d, key=d.get, reverse=True)) # ['B', 'C', 'A']
l = [
{
'id' : 'A',
'keyword' : 10,
},
{
'id' : 'B',
'keyword' : 50,
},
{... | 15.666667 | 59 | 0.419729 | from pprint import pprint
d = {
'A' : 10,
'B' : 50,
'C' : 40,
}
print(sorted(d))
print(sorted(d, key=d.get))
print(sorted(d, key=d.get, reverse=True))
l = [
{
'id' : 'A',
'keyword' : 10,
},
{
'id' : 'B',
'keyword' : 50,
},
{
'id' : 'C',
'keyword' : 40,
},
]
pprint(s... | true | true |
f71151ed9546386e8ded0a2cd7402796a6e469b3 | 978 | py | Python | scripts/strelka-2.9.2.centos6_x86_64/lib/python/configBuildTimeInfo.py | dongxuemin666/RNA-combine | 13e178aae585e16a9a8eda8151d0f34316de0475 | [
"Apache-2.0"
] | 7 | 2021-09-03T09:11:00.000Z | 2022-02-14T15:02:12.000Z | scripts/strelka-2.9.2.centos6_x86_64/lib/python/configBuildTimeInfo.py | dongxuemin666/RNA-combine | 13e178aae585e16a9a8eda8151d0f34316de0475 | [
"Apache-2.0"
] | null | null | null | scripts/strelka-2.9.2.centos6_x86_64/lib/python/configBuildTimeInfo.py | dongxuemin666/RNA-combine | 13e178aae585e16a9a8eda8151d0f34316de0475 | [
"Apache-2.0"
] | 2 | 2022-01-10T13:07:29.000Z | 2022-01-11T22:14:11.000Z | #
# Strelka - Small Variant Caller
# Copyright (c) 2009-2018 Illumina, Inc.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# at your option) any later vers... | 34.928571 | 71 | 0.762781 |
workflowVersion="2.9.2"
buildTime="2018-03-02T22:08:15.960987Z"
| true | true |
f7115465b95c95820af6207e54e3ffcd9ec5c3fc | 3,812 | py | Python | Section_07_code/speech_recognizer.py | PacktPublishing/Python-Machine-Learning-Solutions-V- | 8bb80a43a7c64032c25c1023faaa29bbfbd39d45 | [
"MIT"
] | 1 | 2022-03-16T02:10:30.000Z | 2022-03-16T02:10:30.000Z | Section_07_code/speech_recognizer.py | wensincai/Python-Machine-Learning-Solutions-V- | 130c9881757fa90bbb124d48ddd0c6c1136fa20c | [
"MIT"
] | null | null | null | Section_07_code/speech_recognizer.py | wensincai/Python-Machine-Learning-Solutions-V- | 130c9881757fa90bbb124d48ddd0c6c1136fa20c | [
"MIT"
] | 2 | 2019-05-28T11:58:59.000Z | 2020-09-23T17:21:19.000Z | import os
import argparse
import warnings
import numpy as np
from scipy.io import wavfile
from hmmlearn import hmm
from python_speech_features import mfcc
# Function to parse input arguments
def build_arg_parser():
parser = argparse.ArgumentParser(description='Trains the HMM classifier')
parser.add_argument("-... | 31.766667 | 95 | 0.612802 | import os
import argparse
import warnings
import numpy as np
from scipy.io import wavfile
from hmmlearn import hmm
from python_speech_features import mfcc
def build_arg_parser():
parser = argparse.ArgumentParser(description='Trains the HMM classifier')
parser.add_argument("--input-folder", dest="input_folder"... | true | true |
f71157014d09fab40e49d12085e7b79c88f79c03 | 4,010 | py | Python | src/third_party/beaengine/tests/0fd3.py | CrackerCat/rp | 5fe693c26d76b514efaedb4084f6e37d820db023 | [
"MIT"
] | 1 | 2022-01-17T17:40:29.000Z | 2022-01-17T17:40:29.000Z | src/third_party/beaengine/tests/0fd3.py | CrackerCat/rp | 5fe693c26d76b514efaedb4084f6e37d820db023 | [
"MIT"
] | null | null | null | src/third_party/beaengine/tests/0fd3.py | CrackerCat/rp | 5fe693c26d76b514efaedb4084f6e37d820db023 | [
"MIT"
] | null | null | null | #!/usr/bin/python
# -*- coding: utf-8 -*-
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This progra... | 45.05618 | 80 | 0.669327 |
from headers.BeaEnginePython import *
from nose.tools import *
class TestSuite:
def test(self):
Buffer = bytes.fromhex('660fd39011223344')
myDisasm = Disasm(Buffer)
myDisasm.read()
assert_equal(hex(myDisasm.infos.Instruction.Opcode), '0xfd3')
... | true | true |
f711577e3e237a8ca848394b36f174ba9d6b998e | 4,645 | py | Python | PageBotNano-005-TextBox/MyTypeSpecimen.py | juandelperal/PageBotNano | 7f0d82755d6eb6962f206e5dd0d08c40c0947bde | [
"MIT"
] | null | null | null | PageBotNano-005-TextBox/MyTypeSpecimen.py | juandelperal/PageBotNano | 7f0d82755d6eb6962f206e5dd0d08c40c0947bde | [
"MIT"
] | null | null | null | PageBotNano-005-TextBox/MyTypeSpecimen.py | juandelperal/PageBotNano | 7f0d82755d6eb6962f206e5dd0d08c40c0947bde | [
"MIT"
] | null | null | null | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
# -----------------------------------------------------------------------------
#
# P A G E B O T N A N O
#
# Copyright (c) 2020+ Buro Petr van Blokland + Claudia Mens
# www.pagebot.io
# Licensed under MIT conditions
#
# Supporting DrawBot, www.drawbot.com
# ---... | 41.106195 | 97 | 0.685038 |
from random import random
from pagebotnano_005.document import Document
from pagebotnano_005.elements import Rect, Text, TextBox
from pagebotnano_005.toolbox.loremipsum import loremipsum
class TypeSpecimen(Document):
pass
typeSpecimen = TypeSp... | true | true |
f7115956f5a17031f875ed574bd2db94bd8aaa40 | 142 | py | Python | hcfg/exceptions.py | hyper1923/hcfg | ad37e2bf4a5cc78c4f93331321611d642e52d7d3 | [
"MIT"
] | 4 | 2021-07-25T21:01:33.000Z | 2021-12-17T12:35:16.000Z | hcfg/exceptions.py | hyper1923/hcfg | ad37e2bf4a5cc78c4f93331321611d642e52d7d3 | [
"MIT"
] | null | null | null | hcfg/exceptions.py | hyper1923/hcfg | ad37e2bf4a5cc78c4f93331321611d642e52d7d3 | [
"MIT"
] | 1 | 2021-07-25T21:01:35.000Z | 2021-07-25T21:01:35.000Z |
class hypSyntaxError(Exception):
pass
class hypFileError(Exception):
pass
class hypObjectError(Exception):
pass | 10.923077 | 33 | 0.661972 |
class hypSyntaxError(Exception):
pass
class hypFileError(Exception):
pass
class hypObjectError(Exception):
pass | true | true |
f7115ab9b4c5b56cdf3c82610fb39000f9062f83 | 3,873 | py | Python | Tests/benchmarks/bench_nbody.py | AlexWaygood/Pyjion | 974bd3cf434fad23fbfa1ea9acf43e3387a5c21f | [
"MIT"
] | null | null | null | Tests/benchmarks/bench_nbody.py | AlexWaygood/Pyjion | 974bd3cf434fad23fbfa1ea9acf43e3387a5c21f | [
"MIT"
] | null | null | null | Tests/benchmarks/bench_nbody.py | AlexWaygood/Pyjion | 974bd3cf434fad23fbfa1ea9acf43e3387a5c21f | [
"MIT"
] | null | null | null | # The Computer Language Benchmarks Game
# http://benchmarksgame.alioth.debian.org/
#
# originally by Kevin Carson
# modified by Tupteq, Fredrik Johansson, and Daniel Nanz
# modified by Maciej Fijalkowski
# 2to3
import pyjion
import timeit
import gc
def combinations(l):
result = []
for x in range(len(l) - 1):
... | 29.564885 | 91 | 0.528014 |
import pyjion
import timeit
import gc
def combinations(l):
result = []
for x in range(len(l) - 1):
ls = l[x+1:]
for y in ls:
result.append((l[x],y))
return result
PI = 3.14159265358979323
SOLAR_MASS = 4 * PI * PI
DAYS_PER_YEAR = 365.24
BODIES = {
'sun': ([0.0, 0.0... | true | true |
f7115adab6ff8f96dbe31caef921ac48511b27db | 46,233 | py | Python | tests/unit/test_swift_store.py | citrix-openstack-build/glance_store | 475d144cfe2a3fb5fc49dd0ad0a95fa90790f5b7 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_swift_store.py | citrix-openstack-build/glance_store | 475d144cfe2a3fb5fc49dd0ad0a95fa90790f5b7 | [
"Apache-2.0"
] | null | null | null | tests/unit/test_swift_store.py | citrix-openstack-build/glance_store | 475d144cfe2a3fb5fc49dd0ad0a95fa90790f5b7 | [
"Apache-2.0"
] | null | null | null | # Copyright 2011 OpenStack Foundation
# 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 requ... | 40.272648 | 79 | 0.624165 |
import copy
import fixtures
import hashlib
import httplib
import mock
import tempfile
import uuid
from oslo.config import cfg
from oslotest import moxstubout
import six
import stubout
import swiftclient
from glance_store._drivers.swift import store as swift
from glance_store._drivers.swift import util... | true | true |
f7115afd92f601168a3271828bcd6583a3f27954 | 8,006 | py | Python | magiclink/views.py | lmccartney/django-magiclink | 62b37ee8ed07fd41b259501fc0aba8deaec4bc5f | [
"MIT"
] | 34 | 2020-08-16T05:47:13.000Z | 2022-03-01T18:19:06.000Z | magiclink/views.py | lmccartney/django-magiclink | 62b37ee8ed07fd41b259501fc0aba8deaec4bc5f | [
"MIT"
] | 11 | 2021-01-04T23:51:50.000Z | 2021-09-19T14:21:44.000Z | magiclink/views.py | lmccartney/django-magiclink | 62b37ee8ed07fd41b259501fc0aba8deaec4bc5f | [
"MIT"
] | 5 | 2021-03-19T04:01:23.000Z | 2022-03-01T14:20:21.000Z | import logging
from django.conf import settings as django_settings
from django.contrib.auth import authenticate, get_user_model, login, logout
from django.http import Http404, HttpResponse, HttpResponseRedirect
from django.utils.decorators import method_decorator
from django.views.decorators.cache import never_cache
f... | 36.894009 | 91 | 0.66725 | import logging
from django.conf import settings as django_settings
from django.contrib.auth import authenticate, get_user_model, login, logout
from django.http import Http404, HttpResponse, HttpResponseRedirect
from django.utils.decorators import method_decorator
from django.views.decorators.cache import never_cache
f... | true | true |
f7115b5e8ed27896b0e81e52df3d7ff166edfb54 | 23,257 | py | Python | archiv/urls.py | acdh-oeaw/4dpuzzle | 7856bbd82c7dfa8da1d5f1ad40593219a35b3cfe | [
"MIT"
] | null | null | null | archiv/urls.py | acdh-oeaw/4dpuzzle | 7856bbd82c7dfa8da1d5f1ad40593219a35b3cfe | [
"MIT"
] | 6 | 2020-06-05T18:32:02.000Z | 2022-02-10T07:22:24.000Z | archiv/urls.py | acdh-oeaw/4dpuzzle | 7856bbd82c7dfa8da1d5f1ad40593219a35b3cfe | [
"MIT"
] | 1 | 2020-06-30T13:52:41.000Z | 2020-06-30T13:52:41.000Z | # generated by appcreator
from django.conf.urls import url
from . import views
from . import stats_views
app_name = 'archiv'
urlpatterns = [
url(
r'^match-binary/$',
stats_views.MatchBinaryView.as_view(),
name='match-binary'
),
url(
r'^actor/$',
views.ActorListView.a... | 29.740409 | 66 | 0.588812 |
from django.conf.urls import url
from . import views
from . import stats_views
app_name = 'archiv'
urlpatterns = [
url(
r'^match-binary/$',
stats_views.MatchBinaryView.as_view(),
name='match-binary'
),
url(
r'^actor/$',
views.ActorListView.as_view(),
name='a... | true | true |
f7115b80054333e64fee1293b4991149a2084c6b | 1,073 | py | Python | google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/services/services/conversion_upload_service/transports/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 7 | 2021-02-21T10:39:41.000Z | 2021-12-07T07:31:28.000Z | google/ads/googleads/v7/googleads-py/google/ads/googleads/v7/services/services/conversion_upload_service/transports/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 6 | 2021-02-02T23:46:11.000Z | 2021-11-15T01:46:02.000Z | google/ads/googleads/v8/googleads-py/google/ads/googleads/v8/services/services/conversion_upload_service/transports/__init__.py | googleapis/googleapis-gen | d84824c78563d59b0e58d5664bfaa430e9ad7e7a | [
"Apache-2.0"
] | 4 | 2021-01-28T23:25:45.000Z | 2021-08-30T01:55:16.000Z | # -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... | 33.53125 | 94 | 0.78192 |
from collections import OrderedDict
from typing import Dict, Type
from .base import ConversionUploadServiceTransport
from .grpc import ConversionUploadServiceGrpcTransport
_transport_registry = OrderedDict()
_transport_registry['grpc'] = ConversionUploadServiceGrpcTransport
__all__ = (
'Conve... | true | true |
f7115bc1b282ac71f3a3870ed4dc29099eb9633b | 963 | py | Python | djangofiles/BlogProject/blog/forms.py | manvith263/tricalidee | 69cf66a416be7917eb8cbb3562cff7d5a66df088 | [
"BSD-3-Clause"
] | 1 | 2021-05-11T01:52:35.000Z | 2021-05-11T01:52:35.000Z | djangofiles/BlogProject/blog/forms.py | manvith263/tricalidee | 69cf66a416be7917eb8cbb3562cff7d5a66df088 | [
"BSD-3-Clause"
] | null | null | null | djangofiles/BlogProject/blog/forms.py | manvith263/tricalidee | 69cf66a416be7917eb8cbb3562cff7d5a66df088 | [
"BSD-3-Clause"
] | null | null | null | from django import forms
from .models import Comment, Answer
class CommentForm(forms.ModelForm):
class Meta:
model = Comment
fields = ('text',)
widgets = {
#'author':forms.TextInput(attrs={'class':'textinputclass'}),
'text':forms.Textarea(attrs={'class':'editable m... | 33.206897 | 162 | 0.632399 | from django import forms
from .models import Comment, Answer
class CommentForm(forms.ModelForm):
class Meta:
model = Comment
fields = ('text',)
widgets = {
'text':forms.Textarea(attrs={'class':'editable medium-editor-textarea'}),
}
class AnonymousCommentFo... | true | true |
f7115bce402147b453a9408e3c5208ddc9e7c998 | 4,359 | py | Python | Lib/test/test_pwd.py | michalliu/Python-3.5.1-android | 43fb680c4145a6f1ed19d4ea81c77c4ac1a4a774 | [
"PSF-2.0"
] | null | null | null | Lib/test/test_pwd.py | michalliu/Python-3.5.1-android | 43fb680c4145a6f1ed19d4ea81c77c4ac1a4a774 | [
"PSF-2.0"
] | null | null | null | Lib/test/test_pwd.py | michalliu/Python-3.5.1-android | 43fb680c4145a6f1ed19d4ea81c77c4ac1a4a774 | [
"PSF-2.0"
] | null | null | null | import sys
import unittest
from test import support
pwd = support.import_module('pwd')
class PwdTest(unittest.TestCase):
@unittest.skipUnless(hasattr(pwd, 'getpwall'), 'pwd module does not expose getpwall()')
def test_values(self):
entries = pwd.getpwall()
for e in entries:
self.ass... | 38.236842 | 88 | 0.577197 | import sys
import unittest
from test import support
pwd = support.import_module('pwd')
class PwdTest(unittest.TestCase):
@unittest.skipUnless(hasattr(pwd, 'getpwall'), 'pwd module does not expose getpwall()')
def test_values(self):
entries = pwd.getpwall()
for e in entries:
self.ass... | false | true |
f7115cb7531270e4ff2173d2d1820592f1d4257b | 3,224 | py | Python | Strip.py | brandonskerritt51/Everything | c77141309f48d7cf4791bd73c574a8985d86cdc9 | [
"MIT"
] | 3 | 2020-12-26T18:54:12.000Z | 2021-12-22T16:10:01.000Z | Strip.py | brandonskerritt51/Everything | c77141309f48d7cf4791bd73c574a8985d86cdc9 | [
"MIT"
] | null | null | null | Strip.py | brandonskerritt51/Everything | c77141309f48d7cf4791bd73c574a8985d86cdc9 | [
"MIT"
] | 1 | 2020-02-28T10:58:11.000Z | 2020-02-28T10:58:11.000Z | # strip puncuation custom module
# 12 / 03 / 2015
# Brandon
# https://www.facebook.com/AiiYourBaseRBel0ngToUs
"""
This program was designed to strip puncuation
from a string
This program was made by Brandon in February 2015
and was finished in February 2015
If you have any suggestions or want to help
co... | 23.881481 | 63 | 0.631514 |
import sys
def main():
message = str(input("enter message here to strip "))
message1 = strip(message)
message2 = stripWithSpace(message)
message3 = stripSpaceOnly(message)
print(message1)
print(message2)
print(message3)
close()
def strip(messag... | true | true |
f7115d7c70566ed892299ff982e39d43adecf586 | 2,486 | py | Python | tests/test_reader_table.py | baklanovp/pystella | 47a8b9c3dcd343bf80fba80c8468b803f0f842ce | [
"MIT"
] | 1 | 2019-08-08T13:11:57.000Z | 2019-08-08T13:11:57.000Z | tests/test_reader_table.py | cradesto/pystella | f6f44ed12d9648585a52a09e15d494daa4c70c59 | [
"MIT"
] | 9 | 2015-07-11T16:39:57.000Z | 2021-11-23T07:31:49.000Z | tests/test_reader_table.py | cradesto/pystella | f6f44ed12d9648585a52a09e15d494daa4c70c59 | [
"MIT"
] | 1 | 2019-08-08T13:08:55.000Z | 2019-08-08T13:08:55.000Z | # coding=utf-8
import numpy as np
import unittest
import pystella as ps
# from pystella.rf import band
# from pystella.rf.lc import LightCurve
# from pystella.util.reader_table import read_table_header_float, table2curves, read_obs_table_header, curves2table
__author__ = 'bakl'
def lc_create(b, m=-19, dt=0.):
n... | 41.433333 | 115 | 0.641191 |
import numpy as np
import unittest
import pystella as ps
__author__ = 'bakl'
def lc_create(b, m=-19, dt=0.):
n = 10
time = np.linspace(0. + dt, 200. + dt, n)
mags = m * np.ones(n)
return ps.LightCurve(b, time, mags)
class TestReaderTable(unittest.TestCase):
def test_read_table_header_float... | true | true |
f7115da64a528c5832fc24488f6a9968dd730194 | 33,409 | py | Python | python/tvm/relay/op/nn/_nn.py | CaramelFc/tvm | 0b95de439499122c98857e9006331b53f3578dbc | [
"Apache-2.0"
] | 1 | 2020-09-02T11:58:01.000Z | 2020-09-02T11:58:01.000Z | python/tvm/relay/op/nn/_nn.py | CaramelFc/tvm | 0b95de439499122c98857e9006331b53f3578dbc | [
"Apache-2.0"
] | null | null | null | python/tvm/relay/op/nn/_nn.py | CaramelFc/tvm | 0b95de439499122c98857e9006331b53f3578dbc | [
"Apache-2.0"
] | 2 | 2020-11-26T00:35:02.000Z | 2020-12-07T03:15:56.000Z | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | 31.458569 | 102 | 0.728097 |
from __future__ import absolute_import
from tvm import topi
from tvm.topi.utils import get_const_tuple
from tvm.runtime import convert
from tvm.te.hybrid import script
from .. import op as reg
from .. import strategy
from ..op import OpPattern
from .._tensor import elemwise_shape_func
from ..strategy... | true | true |
f7115dacfbfb5e34e0212cad048528683fc48da9 | 77 | py | Python | tests/test_tensorflow_v2_examples.py | awerdich/TensorFlow_v2_examples | ca8fb57728a821fe53ae01248fc1d8b4a45a0074 | [
"MIT"
] | null | null | null | tests/test_tensorflow_v2_examples.py | awerdich/TensorFlow_v2_examples | ca8fb57728a821fe53ae01248fc1d8b4a45a0074 | [
"MIT"
] | null | null | null | tests/test_tensorflow_v2_examples.py | awerdich/TensorFlow_v2_examples | ca8fb57728a821fe53ae01248fc1d8b4a45a0074 | [
"MIT"
] | null | null | null |
from tensorflow_v2_examples.cli import main
def test_main():
main([])
| 11 | 43 | 0.714286 |
from tensorflow_v2_examples.cli import main
def test_main():
main([])
| true | true |
f7115de338f1de8c6d119b74bc44f2877d482c1c | 15,511 | py | Python | ibis/backends/clickhouse/tests/test_functions.py | jreback/ibis | fdcca59b085416b1311eb268be3886abad1db230 | [
"Apache-2.0"
] | 1 | 2020-08-19T03:36:26.000Z | 2020-08-19T03:36:26.000Z | ibis/backends/clickhouse/tests/test_functions.py | jreback/ibis | fdcca59b085416b1311eb268be3886abad1db230 | [
"Apache-2.0"
] | null | null | null | ibis/backends/clickhouse/tests/test_functions.py | jreback/ibis | fdcca59b085416b1311eb268be3886abad1db230 | [
"Apache-2.0"
] | 2 | 2020-11-27T22:21:50.000Z | 2021-04-03T09:36:25.000Z | import math
import operator
from datetime import date, datetime
from operator import methodcaller
import pandas as pd
import pandas.testing as tm
import pytest
from pytest import param
import ibis
import ibis.expr.datatypes as dt
import ibis.expr.types as ir
from ibis import literal as L
clickhouse_driver = pytest.i... | 28.938433 | 76 | 0.597318 | import math
import operator
from datetime import date, datetime
from operator import methodcaller
import pandas as pd
import pandas.testing as tm
import pytest
from pytest import param
import ibis
import ibis.expr.datatypes as dt
import ibis.expr.types as ir
from ibis import literal as L
clickhouse_driver = pytest.i... | true | true |
f7115e3d4ccc57f2d750c77603f31e4073f99d90 | 13,084 | py | Python | psutil/tests/test_unicode.py | ulisesh/psutil | f7e898b0987f97352c7551bdd9b29b594e1236f6 | [
"BSD-3-Clause"
] | 2 | 2019-12-04T16:24:44.000Z | 2020-04-06T21:49:34.000Z | psutil/tests/test_unicode.py | vsajip/psutil | 2597253a31bc9f49772242cd249f30331d58fd7c | [
"BSD-3-Clause"
] | 7 | 2020-02-12T03:06:52.000Z | 2021-06-10T19:33:14.000Z | psutil/tests/test_unicode.py | vsajip/psutil | 2597253a31bc9f49772242cd249f30331d58fd7c | [
"BSD-3-Clause"
] | 2 | 2018-05-27T00:13:34.000Z | 2018-05-27T00:18:32.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Notes about unicode handling in psutil
======================================
In psutil these are the A... | 35.266846 | 79 | 0.626567 |
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import os
import traceback
import warnings
from contextlib import closing
from psutil import BSD
from psutil import MACOS
from psutil import OPENBSD
from psutil import POSIX
from psutil import WINDOWS
from psuti... | true | true |
f7115eb4887240e20761e2912648621941f790fd | 16,441 | py | Python | configs/example/fs.py | irene-lin/InvisiSpec-1.0 | 696ceb57d48f77da1385f2c9e10dc4615350e607 | [
"BSD-3-Clause"
] | 22 | 2019-11-12T23:37:14.000Z | 2021-12-21T22:17:15.000Z | configs/example/fs.py | limengming/cleanupspec | 5426a0e2e3ce5c00edcb9734617dacf26ab18ef5 | [
"BSD-3-Clause"
] | 8 | 2020-02-05T17:47:10.000Z | 2021-09-06T03:58:56.000Z | configs/example/fs.py | limengming/cleanupspec | 5426a0e2e3ce5c00edcb9734617dacf26ab18ef5 | [
"BSD-3-Clause"
] | 11 | 2020-02-05T17:44:18.000Z | 2021-06-29T18:58:53.000Z | # Copyright (c) 2010-2013, 2016 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implementation of the fun... | 41.413098 | 87 | 0.66766 |
import optparse
import sys
import m5
from m5.defines import buildEnv
from m5.objects import *
from m5.util import addToPath, fatal, warn
from m5.util.fdthelper import *
addToPath('../')
from ruby import Ruby
from common.FSConfig import *
from common.SysPaths import *
from ... | false | true |
f7115ed0be73dd5f07ae66313df67de5eb1bd650 | 23,190 | py | Python | mittab/apps/tab/outround_pairing_views.py | DanielS6/mit-tab | f2b5bb609546514582697b998b8b50a66bc8a396 | [
"MIT"
] | 9 | 2015-01-22T01:19:15.000Z | 2017-11-01T20:09:47.000Z | mittab/apps/tab/outround_pairing_views.py | DanielS6/mit-tab | f2b5bb609546514582697b998b8b50a66bc8a396 | [
"MIT"
] | 152 | 2018-04-06T14:32:51.000Z | 2022-02-11T22:12:53.000Z | mittab/apps/tab/outround_pairing_views.py | DanielS6/mit-tab | f2b5bb609546514582697b998b8b50a66bc8a396 | [
"MIT"
] | 13 | 2015-09-14T00:40:06.000Z | 2018-01-24T04:05:32.000Z | import random
import math
from django.shortcuts import render, get_object_or_404
from django.http import JsonResponse
from django.contrib.auth.decorators import permission_required
from django.db.models import Q
from django.shortcuts import redirect, reverse
from django.utils import timezone
from mittab.apps.tab.help... | 34.924699 | 88 | 0.617119 | import random
import math
from django.shortcuts import render, get_object_or_404
from django.http import JsonResponse
from django.contrib.auth.decorators import permission_required
from django.db.models import Q
from django.shortcuts import redirect, reverse
from django.utils import timezone
from mittab.apps.tab.help... | true | true |
f7115f0749cb5df9d54526ef059c6eea994ea859 | 44,980 | py | Python | appdaemon/app_management.py | chadmccune/appdaemon | 73b49575a72fabf66a5186fe0c603fd041a22ee5 | [
"Apache-2.0"
] | null | null | null | appdaemon/app_management.py | chadmccune/appdaemon | 73b49575a72fabf66a5186fe0c603fd041a22ee5 | [
"Apache-2.0"
] | null | null | null | appdaemon/app_management.py | chadmccune/appdaemon | 73b49575a72fabf66a5186fe0c603fd041a22ee5 | [
"Apache-2.0"
] | null | null | null | import sys
import traceback
import uuid
import os
import importlib
import yaml
import subprocess
import cProfile
import io
import pstats
import logging
import asyncio
import appdaemon.utils as utils
from appdaemon.appdaemon import AppDaemon
class AppManagement:
def __init__(self, ad: AppDaemon, config):
... | 40.595668 | 126 | 0.507915 | import sys
import traceback
import uuid
import os
import importlib
import yaml
import subprocess
import cProfile
import io
import pstats
import logging
import asyncio
import appdaemon.utils as utils
from appdaemon.appdaemon import AppDaemon
class AppManagement:
def __init__(self, ad: AppDaemon, config):
... | true | true |
f7115f40fe58ad8b96583fd0dc9e13f70437a634 | 39,208 | py | Python | venv/Lib/site-packages/statsmodels/tsa/filters/tests/test_filters.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 2 | 2020-11-30T14:04:26.000Z | 2021-11-08T11:29:06.000Z | venv/Lib/site-packages/statsmodels/tsa/filters/tests/test_filters.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 7 | 2020-12-04T04:10:42.000Z | 2021-03-16T00:53:09.000Z | venv/Lib/site-packages/statsmodels/tsa/filters/tests/test_filters.py | EkremBayar/bayar | aad1a32044da671d0b4f11908416044753360b39 | [
"MIT"
] | 1 | 2021-11-16T19:06:53.000Z | 2021-11-16T19:06:53.000Z | from statsmodels.compat.pandas import assert_frame_equal, make_dataframe
from datetime import datetime
import numpy as np
from numpy.testing import (assert_almost_equal, assert_equal, assert_allclose,
assert_raises, assert_)
from numpy import array, column_stack
from statsmodels.tsa.filters... | 50.590968 | 79 | 0.641221 | from statsmodels.compat.pandas import assert_frame_equal, make_dataframe
from datetime import datetime
import numpy as np
from numpy.testing import (assert_almost_equal, assert_equal, assert_allclose,
assert_raises, assert_)
from numpy import array, column_stack
from statsmodels.tsa.filters... | true | true |
f7116008166549e265c58b52b8fbdb0e9ec43e52 | 2,549 | py | Python | templates/template.py | ss005/PyRival | ce94312d429f368b724cdd8d3192935e34b7ba66 | [
"Apache-2.0"
] | null | null | null | templates/template.py | ss005/PyRival | ce94312d429f368b724cdd8d3192935e34b7ba66 | [
"Apache-2.0"
] | null | null | null | templates/template.py | ss005/PyRival | ce94312d429f368b724cdd8d3192935e34b7ba66 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/env python
from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
from __builtin__ import xrange as range
from future_builtins import ascii, filter, hex, map, oct, zip
def main():
pass
# region fastio
BUFSIZE = 8192
... | 27.706522 | 79 | 0.604943 |
from __future__ import division, print_function
import os
import sys
from io import BytesIO, IOBase
if sys.version_info[0] < 3:
from __builtin__ import xrange as range
from future_builtins import ascii, filter, hex, map, oct, zip
def main():
pass
BUFSIZE = 8192
class FastIO(IOBase):
newlines ... | true | true |
f71161ca17d38c1dd04659c07978db4f1cf365c2 | 7,909 | py | Python | xmlrpc_client.py | y11en/tknk_scanner | c6c1b2b9142a3df4d86a1d44d677896d2623ac1e | [
"MIT"
] | 78 | 2018-09-29T19:07:54.000Z | 2022-03-27T20:21:08.000Z | xmlrpc_client.py | y11en/tknk_scanner | c6c1b2b9142a3df4d86a1d44d677896d2623ac1e | [
"MIT"
] | 11 | 2019-06-08T03:20:43.000Z | 2022-01-22T04:15:22.000Z | xmlrpc_client.py | y11en/tknk_scanner | c6c1b2b9142a3df4d86a1d44d677896d2623ac1e | [
"MIT"
] | 23 | 2018-10-01T07:00:49.000Z | 2021-06-10T07:07:19.000Z | #!/usr/bin/env python3
import xmlrpc.client
import os, sys, shutil, json, subprocess, time, yara, hashlib, datetime, requests, magic, redis, socket, pefile
from pathlib import Path
from pymongo import MongoClient
from rq import get_current_job, Queue
from read_avclass_report import run_avclass
from redis import Redis
... | 32.547325 | 207 | 0.580857 |
import xmlrpc.client
import os, sys, shutil, json, subprocess, time, yara, hashlib, datetime, requests, magic, redis, socket, pefile
from pathlib import Path
from pymongo import MongoClient
from rq import get_current_job, Queue
from read_avclass_report import run_avclass
from redis import Redis
with open("tknk.conf"... | true | true |
f71161ef83923d1440360d9a5499009046ba7494 | 1,127 | py | Python | userbot/modules/aeshtetic.py | Wiki28/WikixCilik | a7e8d684e34174001af3e69d1f00de4e98243abe | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/aeshtetic.py | Wiki28/WikixCilik | a7e8d684e34174001af3e69d1f00de4e98243abe | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | userbot/modules/aeshtetic.py | Wiki28/WikixCilik | a7e8d684e34174001af3e69d1f00de4e98243abe | [
"Naumen",
"Condor-1.1",
"MS-PL"
] | null | null | null | # Copyright (C) 2019 The Raphielscape Company LLC.
#
# Licensed under the Raphielscape Public License, Version 1.d (the "License");
# you may not use this file except in compliance with the License.
#
# Ported for Lord-Userbot By liualvinas/Alvin
from telethon import events
from userbot import CMD_HANDLER as cmd
from... | 25.044444 | 78 | 0.640639 |
from telethon import events
from userbot import CMD_HANDLER as cmd
from userbot import CMD_HELP
from userbot.utils import edit_or_reply, cilik_cmd
PRINTABLE_ASCII = range(0x21, 0x7F)
def aesthetify(string):
for c in string:
c = ord(c)
if c in PRINTABLE_ASCII:
c += 0xFF00 - 0x2... | true | true |
f71162543479e13ba7a83e8e598676ad16885311 | 6,609 | py | Python | gamification/core/models.py | stephenrjones/django-gamification | d22882f148375102ec351cb2bc75275083468d73 | [
"Unlicense",
"MIT"
] | 15 | 2015-02-21T09:28:55.000Z | 2021-07-31T17:17:06.000Z | gamification/core/models.py | stephenrjones/django-gamification | d22882f148375102ec351cb2bc75275083468d73 | [
"Unlicense",
"MIT"
] | null | null | null | gamification/core/models.py | stephenrjones/django-gamification | d22882f148375102ec351cb2bc75275083468d73 | [
"Unlicense",
"MIT"
] | 1 | 2017-01-22T09:12:44.000Z | 2017-01-22T09:12:44.000Z | # -*- coding: utf-8 -*-
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# distribute, sub... | 46.216783 | 214 | 0.739144 |
# is provided to the public as a courtesy of the National
# Geospatial-Intelligence Agency.
#
# The above copyright notice and this permission notice shall be
# included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMP... | true | true |
f71163d1f61c4563c96be498ede707c910a8f26d | 441 | py | Python | virtual/lib/python3.6/site-packages/pylint/test/functional/exception_is_binary_op.py | drewheathens/The-Moringa-Tribune | 98ee4d63c9df6f1f7497fc6876960a822d914500 | [
"MIT"
] | 463 | 2015-01-15T08:17:42.000Z | 2022-03-28T15:10:20.000Z | virtual/lib/python3.6/site-packages/pylint/test/functional/exception_is_binary_op.py | drewheathens/The-Moringa-Tribune | 98ee4d63c9df6f1f7497fc6876960a822d914500 | [
"MIT"
] | 52 | 2015-01-06T02:43:59.000Z | 2022-03-14T11:15:21.000Z | virtual/lib/python3.6/site-packages/pylint/test/functional/exception_is_binary_op.py | drewheathens/The-Moringa-Tribune | 98ee4d63c9df6f1f7497fc6876960a822d914500 | [
"MIT"
] | 249 | 2015-01-07T22:49:49.000Z | 2022-03-18T02:32:06.000Z | """Warn about binary operations used as exceptions."""
from __future__ import print_function
try:
pass
except Exception or BaseException: # [binary-op-exception]
print("caught1")
except Exception and BaseException: # [binary-op-exception]
print("caught2")
except Exception or BaseException: # [binary-op-e... | 33.923077 | 68 | 0.734694 | from __future__ import print_function
try:
pass
except Exception or BaseException:
print("caught1")
except Exception and BaseException:
print("caught2")
except Exception or BaseException:
print("caught3")
except (Exception or BaseException) as exc:
print("caught4")
| true | true |
f71163e8df50a1a54f85265542eac2fe7669ebfe | 1,601 | py | Python | djangox/lib/python3.8/site-packages/allauth/socialaccount/providers/__init__.py | DemarcusL/django_wiki_lab | 3b7cf18af7e0f89c94d10eb953ca018a150a2f55 | [
"MIT"
] | 6,342 | 2015-01-01T07:40:30.000Z | 2022-03-31T04:18:30.000Z | djangox/lib/python3.8/site-packages/allauth/socialaccount/providers/__init__.py | DemarcusL/django_wiki_lab | 3b7cf18af7e0f89c94d10eb953ca018a150a2f55 | [
"MIT"
] | 2,198 | 2015-01-02T15:17:45.000Z | 2022-03-28T10:20:43.000Z | djangox/lib/python3.8/site-packages/allauth/socialaccount/providers/__init__.py | DemarcusL/django_wiki_lab | 3b7cf18af7e0f89c94d10eb953ca018a150a2f55 | [
"MIT"
] | 2,928 | 2015-01-01T10:44:13.000Z | 2022-03-31T03:20:16.000Z | import importlib
from collections import OrderedDict
from django.conf import settings
class ProviderRegistry(object):
def __init__(self):
self.provider_map = OrderedDict()
self.loaded = False
def get_list(self, request=None):
self.load()
return [provider_cls(request) for prov... | 33.354167 | 85 | 0.621487 | import importlib
from collections import OrderedDict
from django.conf import settings
class ProviderRegistry(object):
def __init__(self):
self.provider_map = OrderedDict()
self.loaded = False
def get_list(self, request=None):
self.load()
return [provider_cls(request) for prov... | true | true |
f711648b9fb21bbdd671889d8ae822a03e116ae0 | 11,176 | py | Python | pyrats/halos.py | HugoPfister/Pyrats | fc2cab0d1e14b8dd19b3eba361d47f053187ab47 | [
"MIT"
] | null | null | null | pyrats/halos.py | HugoPfister/Pyrats | fc2cab0d1e14b8dd19b3eba361d47f053187ab47 | [
"MIT"
] | null | null | null | pyrats/halos.py | HugoPfister/Pyrats | fc2cab0d1e14b8dd19b3eba361d47f053187ab47 | [
"MIT"
] | null | null | null | #!/usr/bin/env python
"""Module to deal with halos, to be used with HaloMaker.
This module is heavily inspired by the set of IDL routines originally
found in the Ramses Analysis ToolSuite (RATS).
TODO: Some more documentation
"""
import numpy as np
import pandas as pd
import yt
from yt.utilities.logger import ytLo... | 39.631206 | 98 | 0.480494 |
import numpy as np
import pandas as pd
import yt
from yt.utilities.logger import ytLogger as mylog
import yt.utilities.fortran_utils as fpu
from yt.funcs import get_pbar
import os
import pandas as pd
class HaloList(object):
def __init__(self, ds, folder='.', contam=False):
self.folder = folder
... | true | true |
f71166891b5da8b0c4158d35a906f11005268be1 | 6,324 | py | Python | server/devices/views.py | vahidzee/pi-surveillance | 63996d8abc998d0a777d588231ecbc6d484b6451 | [
"MIT"
] | null | null | null | server/devices/views.py | vahidzee/pi-surveillance | 63996d8abc998d0a777d588231ecbc6d484b6451 | [
"MIT"
] | null | null | null | server/devices/views.py | vahidzee/pi-surveillance | 63996d8abc998d0a777d588231ecbc6d484b6451 | [
"MIT"
] | null | null | null | from PIL import Image
from django.conf import settings
from . import forms, recognition
from . import utils
from . import models
from django.shortcuts import render, redirect
from django.contrib import admin
from django.core.mail import send_mail
from django.http import JsonResponse
from django.views.decorators.csrf im... | 42.16 | 116 | 0.638046 | from PIL import Image
from django.conf import settings
from . import forms, recognition
from . import utils
from . import models
from django.shortcuts import render, redirect
from django.contrib import admin
from django.core.mail import send_mail
from django.http import JsonResponse
from django.views.decorators.csrf im... | true | true |
f711678dac36327210c7a3f075c080ff99a8e948 | 1,499 | py | Python | setup.py | candh/totp-cli | 191c46caab3b1a6863336189521b460d45e1223c | [
"MIT"
] | 1 | 2022-01-01T15:53:09.000Z | 2022-01-01T15:53:09.000Z | setup.py | candh/totp-cli | 191c46caab3b1a6863336189521b460d45e1223c | [
"MIT"
] | null | null | null | setup.py | candh/totp-cli | 191c46caab3b1a6863336189521b460d45e1223c | [
"MIT"
] | null | null | null | from setuptools import setup
import sys
import os
if sys.version_info.major < 3:
raise Exception("python3 is required to run this script")
# also cleanup the info.json file before building
if os.path.exists('totpauth/database/info.json'):
os.remove('totpauth/database/info.json')
open('totpauth/database/info.json'... | 31.229167 | 83 | 0.667779 | from setuptools import setup
import sys
import os
if sys.version_info.major < 3:
raise Exception("python3 is required to run this script")
if os.path.exists('totpauth/database/info.json'):
os.remove('totpauth/database/info.json')
open('totpauth/database/info.json', 'w')
setup(
name='totp-cli',
version='1.0'... | true | true |
f71167e5a3698413e13abeed3d48c71b338681ad | 191 | py | Python | web/app/djrq/model/prokyon/album_view.py | bmillham/djrq2 | c84283b75a7c15da1902ebfc32b7d75159c09e20 | [
"MIT"
] | 1 | 2016-11-23T20:50:00.000Z | 2016-11-23T20:50:00.000Z | web/app/djrq/model/prokyon/album_view.py | bmillham/djrq2 | c84283b75a7c15da1902ebfc32b7d75159c09e20 | [
"MIT"
] | 15 | 2017-01-15T04:18:40.000Z | 2017-02-25T04:13:06.000Z | web/app/djrq/model/prokyon/album_view.py | bmillham/djrq2 | c84283b75a7c15da1902ebfc32b7d75159c09e20 | [
"MIT"
] | null | null | null | from . import *
class Album(Base):
__tablename__ = "album_view"
id = Column(Integer, primary_key=True)
fullname = Column(Text)
name = Column(Text)
prefix = Column(Text)
| 19.1 | 42 | 0.65445 | from . import *
class Album(Base):
__tablename__ = "album_view"
id = Column(Integer, primary_key=True)
fullname = Column(Text)
name = Column(Text)
prefix = Column(Text)
| true | true |
f7116863995bc72b2db542ec2e1f8ca284bc4257 | 758 | py | Python | leetcode/python/easy/p1169_invalidTransactions.py | kefirzhang/algorithms | 549e68731d4c05002e35f0499d4f7744f5c63979 | [
"Apache-2.0"
] | null | null | null | leetcode/python/easy/p1169_invalidTransactions.py | kefirzhang/algorithms | 549e68731d4c05002e35f0499d4f7744f5c63979 | [
"Apache-2.0"
] | null | null | null | leetcode/python/easy/p1169_invalidTransactions.py | kefirzhang/algorithms | 549e68731d4c05002e35f0499d4f7744f5c63979 | [
"Apache-2.0"
] | null | null | null | class Solution:
def invalidTransactions(self, transactions):
helper = []
helper_back = []
for transaction in transactions:
tmp_transaction = transaction.split(",")
helper.append(tmp_transaction)
for record in helper:
if int(record[2]) > 1000:
... | 34.454545 | 121 | 0.546174 | class Solution:
def invalidTransactions(self, transactions):
helper = []
helper_back = []
for transaction in transactions:
tmp_transaction = transaction.split(",")
helper.append(tmp_transaction)
for record in helper:
if int(record[2]) > 1000:
... | true | true |
f711693db6db8e214c62c061ee3ce205f8f0b101 | 5,413 | py | Python | tests/pipelines/test_distillation.py | gr33n-made/catalyst | bd413abc908ef7cbdeab42b0e805277a791e3ddb | [
"Apache-2.0"
] | 1 | 2021-09-29T20:30:50.000Z | 2021-09-29T20:30:50.000Z | tests/pipelines/test_distillation.py | gr33n-made/catalyst | bd413abc908ef7cbdeab42b0e805277a791e3ddb | [
"Apache-2.0"
] | null | null | null | tests/pipelines/test_distillation.py | gr33n-made/catalyst | bd413abc908ef7cbdeab42b0e805277a791e3ddb | [
"Apache-2.0"
] | null | null | null | # flake8: noqa
import os
from tempfile import TemporaryDirectory
from pytest import mark
import torch
from torch import nn, optim
from torch.nn import functional as F
from torch.utils.data import DataLoader
from catalyst import dl
from catalyst.contrib.datasets import MNIST
from catalyst.data import ToTensor
from ca... | 30.931429 | 99 | 0.619435 |
import os
from tempfile import TemporaryDirectory
from pytest import mark
import torch
from torch import nn, optim
from torch.nn import functional as F
from torch.utils.data import DataLoader
from catalyst import dl
from catalyst.contrib.datasets import MNIST
from catalyst.data import ToTensor
from catalyst.setting... | true | true |
f71169a59355addf79f185e4ad592858c30dd011 | 576 | py | Python | Data_Science/lesson_2/api_quiz/api_quiz_solution.py | napjon/moocs_solution | 5c96f43f6cb2ae643f482580446869953a99beb6 | [
"MIT"
] | 13 | 2016-04-29T07:21:44.000Z | 2021-09-29T03:20:51.000Z | Data_Science/lesson_2/api_quiz/api_quiz_solution.py | napjon/moocs_solution | 5c96f43f6cb2ae643f482580446869953a99beb6 | [
"MIT"
] | 1 | 2017-02-07T07:37:20.000Z | 2017-02-19T08:37:17.000Z | Data_Science/lesson_2/api_quiz/api_quiz_solution.py | napjon/moocs_solution | 5c96f43f6cb2ae643f482580446869953a99beb6 | [
"MIT"
] | 13 | 2016-01-25T03:23:57.000Z | 2019-10-13T15:29:23.000Z | import json
import requests
import pprint
def api_get_request(url):
# In this exercise, you want to call the last.fm API to get a list of the
# top artists in Spain.
#
# Once you've done this, return the name of the number 1 top artist in Spain.
data = requests.get(url).text
data = json.loads(d... | 30.315789 | 81 | 0.671875 | import json
import requests
import pprint
def api_get_request(url):
data = requests.get(url).text
data = json.loads(data)
#country_data = data['country']
pp = pprint.PrettyPrinter(depth = 4)
#pp.pprint(data)
top_artists = data['topartists']['artist']
#[e['name'] for e in... | true | true |
f71169dddfc98800a555c6b84c121cbb3c2501e0 | 580 | py | Python | tests/integration/models/test_group.py | beanpuppy/infynipy | 585e8734a6c3ed69c2a78d52a394a71303bcc88b | [
"MIT"
] | null | null | null | tests/integration/models/test_group.py | beanpuppy/infynipy | 585e8734a6c3ed69c2a78d52a394a71303bcc88b | [
"MIT"
] | null | null | null | tests/integration/models/test_group.py | beanpuppy/infynipy | 585e8734a6c3ed69c2a78d52a394a71303bcc88b | [
"MIT"
] | null | null | null | from infynipy.models.group import ReferrerGroup
from .. import IntegrationTest, vcrr
class TestReferrerGroup(IntegrationTest):
@vcrr.use_cassette
def test_referrer_group_get_multiple(self):
for group in self.infynity.referrer_groups:
assert isinstance(group, ReferrerGroup)
@vcrr.use_... | 27.619048 | 67 | 0.682759 | from infynipy.models.group import ReferrerGroup
from .. import IntegrationTest, vcrr
class TestReferrerGroup(IntegrationTest):
@vcrr.use_cassette
def test_referrer_group_get_multiple(self):
for group in self.infynity.referrer_groups:
assert isinstance(group, ReferrerGroup)
@vcrr.use_... | true | true |
f7116afc9150f85440d20e85f7548abaa8191c95 | 7,494 | py | Python | official/nlp/modeling/networks/albert_encoder_test.py | mcasanova1445/models | 37be0fdb4abccca633bb3199a4e6f3f71cd174d9 | [
"Apache-2.0"
] | 1 | 2020-09-14T10:46:07.000Z | 2020-09-14T10:46:07.000Z | official/nlp/modeling/networks/albert_encoder_test.py | mdsaifhaider/models | 7214e17eb425963ec3d0295be215d5d26deaeb32 | [
"Apache-2.0"
] | 8 | 2020-05-19T00:52:30.000Z | 2020-06-04T23:57:20.000Z | official/nlp/modeling/networks/albert_encoder_test.py | mdsaifhaider/models | 7214e17eb425963ec3d0295be215d5d26deaeb32 | [
"Apache-2.0"
] | 2 | 2021-10-07T04:47:04.000Z | 2021-12-18T04:18:19.000Z | # Copyright 2022 The TensorFlow 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 applica... | 39.650794 | 101 | 0.72538 |
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from absl.testing import parameterized
import numpy as np
import tensorflow as tf
from tensorflow.python.keras import keras_parameterized
from official.nlp.modeling.networks import albert_enco... | true | true |
f7116afe35be171ca7613c0d3c649949f5a75deb | 5,513 | py | Python | RaspberryPi/ble_lights.py | ippie52/BLE-Tutor | df4fae208d289e988955182c356040243365f66d | [
"MIT"
] | null | null | null | RaspberryPi/ble_lights.py | ippie52/BLE-Tutor | df4fae208d289e988955182c356040243365f66d | [
"MIT"
] | null | null | null | RaspberryPi/ble_lights.py | ippie52/BLE-Tutor | df4fae208d289e988955182c356040243365f66d | [
"MIT"
] | null | null | null | #!/usr/bin/python3
# ------------------------------------------------------------------------------
"""@package ble_lights.py
Sets the attached light values and notifies when they change.
"""
# ------------------------------------------------------------------------------
# Kris Dunning ippie52@gmail.... | 29.015789 | 81 | 0.573372 |
import pybleno as ble
import wiringpi
from typing import Dict
from sys import exit
from time import sleep
from colour_printer import ColourPrinter
class KrisCharacteristic(ColourPrinter, ble.Characteristic):
def __init__(self, settings: Dict[str, any], name: str, colour: str) -> None:
ble.Characterist... | true | true |
f7116b42fc8b5931f1f34af5460f82cc8a0e789a | 7,049 | py | Python | graphql_compiler/compiler/ir_lowering_match/__init__.py | jb-kensho/graphql-compiler | 4511793281698bd55e63fd7a3f25f9cb094084d4 | [
"Apache-2.0"
] | null | null | null | graphql_compiler/compiler/ir_lowering_match/__init__.py | jb-kensho/graphql-compiler | 4511793281698bd55e63fd7a3f25f9cb094084d4 | [
"Apache-2.0"
] | 1 | 2019-04-18T18:23:16.000Z | 2019-04-18T18:23:16.000Z | graphql_compiler/compiler/ir_lowering_match/__init__.py | jb-kensho/graphql-compiler | 4511793281698bd55e63fd7a3f25f9cb094084d4 | [
"Apache-2.0"
] | 1 | 2019-11-21T02:38:27.000Z | 2019-11-21T02:38:27.000Z | # Copyright 2018-present Kensho Technologies, LLC.
import six
from ..blocks import Filter, GlobalOperationsStart
from ..ir_lowering_common import (extract_optional_location_root_info,
extract_simple_optional_location_info,
lower_context_field_existenc... | 54.643411 | 99 | 0.709037 |
import six
from ..blocks import Filter, GlobalOperationsStart
from ..ir_lowering_common import (extract_optional_location_root_info,
extract_simple_optional_location_info,
lower_context_field_existence, merge_consecutive_filter_clauses,
... | true | true |
f7116c404797f3847bdb182bff01976965d6e485 | 63,967 | py | Python | src/sage/schemes/elliptic_curves/padic_lseries.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 3 | 2019-07-15T13:48:24.000Z | 2019-11-08T12:31:43.000Z | src/sage/schemes/elliptic_curves/padic_lseries.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 2 | 2018-10-30T13:40:20.000Z | 2020-07-23T12:13:30.000Z | src/sage/schemes/elliptic_curves/padic_lseries.py | bopopescu/sage | 2d495be78e0bdc7a0a635454290b27bb4f5f70f0 | [
"BSL-1.0"
] | 1 | 2020-07-23T10:29:58.000Z | 2020-07-23T10:29:58.000Z | # -*- coding: utf-8 -*-
r"""
`p`-adic `L`-functions of elliptic curves
To an elliptic curve `E` over the rational numbers and a prime `p`, one
can associate a `p`-adic L-function; at least if `E` does not have additive
reduction at `p`. This function is defined by interpolation of L-values of `E`
at twists. Through th... | 37.429491 | 206 | 0.51783 |
self, '_modular_symbol_negative'):
self.__add_negative_space()
f = self._negative_modular_symbol
self.__measure_data[(n, prec, s)] = (p, alpha, z, w, f)
if quadratic_twist == 1:
if self._E.conductor() % p == 0:
return z *... | true | true |
f7116ca368bdcdd42239a17f140dbe141d3d445c | 2,085 | py | Python | codeMarkDown/MD_Link.py | atria-tools/monk | 4961457f4db5dfa98fc6001a289c24e460e5b025 | [
"Apache-2.0"
] | null | null | null | codeMarkDown/MD_Link.py | atria-tools/monk | 4961457f4db5dfa98fc6001a289c24e460e5b025 | [
"Apache-2.0"
] | 1 | 2015-03-22T12:37:18.000Z | 2015-03-22T12:37:18.000Z | codeMarkDown/MD_Link.py | HeeroYui/monk | 4961457f4db5dfa98fc6001a289c24e460e5b025 | [
"Apache-2.0"
] | null | null | null | #!/usr/bin/python
import monkDebug as debug
import sys
import monkTools
import re
##
## @brief Transcode:
## [http://votre_site.con] => http://votre_site.con
## [http://votre_site.con | text displayed] => text displayed
## [http://votre_site.con text displayed] => text displayed.
##
## @param[in] value String to tra... | 24.529412 | 67 | 0.490647 |
import monkDebug as debug
import sys
import monkTools
import re
value)
value = re.sub(r'\[lib\[(.*?) \| (.*?)\]\]',
r'<a href="../\1">\2</a>',
value)
value = re.sub(r'\[doc\[(.*?) \| (.*?)\]\]',
r'<a href="\1.html">\2</a>',
value)
... | true | true |
f7116d620e942fe3a80596ea660bc2890e9f37d0 | 2,014 | py | Python | catkin_ws/src/00-infrastructure/duckietown/include/duckietown_utils/map_utils.py | yxiao1996/dev | e2181233aaa3d16c472b792b58fc4863983825bd | [
"CC-BY-2.0"
] | 2 | 2018-06-25T02:51:25.000Z | 2018-06-25T02:51:27.000Z | catkin_ws/src/00-infrastructure/duckietown/include/duckietown_utils/map_utils.py | yxiao1996/dev | e2181233aaa3d16c472b792b58fc4863983825bd | [
"CC-BY-2.0"
] | null | null | null | catkin_ws/src/00-infrastructure/duckietown/include/duckietown_utils/map_utils.py | yxiao1996/dev | e2181233aaa3d16c472b792b58fc4863983825bd | [
"CC-BY-2.0"
] | 2 | 2018-09-04T06:44:21.000Z | 2018-10-15T02:30:50.000Z | #!/usr/bin/python
import numpy as np
from scipy import signal
class RandomMapGenerator():
def __init__(self,size=(5,6)):
self.initialize_thresh = 0.5
self.size = size
def initialize(self):
self.map = np.random.random(self.size)
super_thresh_indices = self.map >= self.initial... | 30.059701 | 100 | 0.575472 |
import numpy as np
from scipy import signal
class RandomMapGenerator():
def __init__(self,size=(5,6)):
self.initialize_thresh = 0.5
self.size = size
def initialize(self):
self.map = np.random.random(self.size)
super_thresh_indices = self.map >= self.initialize_thresh
... | false | true |
f7116e8e419ef38b1a22603a973c53b8ef2a6045 | 9,085 | py | Python | karesansui/lib/parser/collectdplugin.py | Kairiw/karesansui | d5a3acfe40b3953fb4f8d6f51e30d0307309a6ee | [
"MIT"
] | null | null | null | karesansui/lib/parser/collectdplugin.py | Kairiw/karesansui | d5a3acfe40b3953fb4f8d6f51e30d0307309a6ee | [
"MIT"
] | null | null | null | karesansui/lib/parser/collectdplugin.py | Kairiw/karesansui | d5a3acfe40b3953fb4f8d6f51e30d0307309a6ee | [
"MIT"
] | null | null | null | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# This file is part of Karesansui Core.
#
# Copyright (C) 2009-2012 HDE, Inc.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restric... | 37.697095 | 155 | 0.612438 |
import os
import re
import sys
import glob
from karesansui.lib.dict_op import DictOp
from karesansui.lib.parser.base.xml_like_conf_parser import xmlLikeConfParser as Parser
from karesansui.lib.utils import preprint_r, r_chgrp, r_chmod
from karesansui.lib.const import VENDOR_SYSCONF_DIR, \
... | true | true |
f7116ee3a17fcb6b15670369732a0331101ec14b | 13,492 | py | Python | inv/models/interfaceclassificationrule.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 84 | 2017-10-22T11:01:39.000Z | 2022-02-27T03:43:48.000Z | inv/models/interfaceclassificationrule.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 22 | 2017-12-11T07:21:56.000Z | 2021-09-23T02:53:50.000Z | inv/models/interfaceclassificationrule.py | prorevizor/noc | 37e44b8afc64318b10699c06a1138eee9e7d6a4e | [
"BSD-3-Clause"
] | 23 | 2017-12-06T06:59:52.000Z | 2022-02-24T00:02:25.000Z | # ---------------------------------------------------------------------
# Interface Classification Rules models
# ---------------------------------------------------------------------
# Copyright (C) 2007-2020 The NOC Project
# See LICENSE for details
# ------------------------------------------------------------------... | 39.335277 | 115 | 0.505633 |
import re
from mongoengine.document import Document, EmbeddedDocument
from mongoengine.fields import StringField, IntField, ListField, EmbeddedDocumentField, BooleanField
from noc.core.mongo.fields import ForeignKeyField, PlainReferenceField
from noc.core.ip import IP
from noc.main.models.prefixtable import... | true | true |
f7116f15bfecc8ac518a725732046cefe35eea97 | 2,520 | py | Python | configs/opamp/biased_pmos_gain/15-layer-ft-all-pool-0.5/config.py | kouroshHakha/circuit-fewshot-code | 32007e119da30632736868a3f643027624bf08d2 | [
"BSD-3-Clause"
] | null | null | null | configs/opamp/biased_pmos_gain/15-layer-ft-all-pool-0.5/config.py | kouroshHakha/circuit-fewshot-code | 32007e119da30632736868a3f643027624bf08d2 | [
"BSD-3-Clause"
] | null | null | null | configs/opamp/biased_pmos_gain/15-layer-ft-all-pool-0.5/config.py | kouroshHakha/circuit-fewshot-code | 32007e119da30632736868a3f643027624bf08d2 | [
"BSD-3-Clause"
] | null | null | null | import time
import hashlib
import torch
from torch_geometric.data import DataLoader
from cgl.utils.params import ParamDict
from cgl.data.graph_data import CircuitInMemDataset, CircuitGraphDataset
# from cgl.models.gnn import DeepGENNet
s = time.time()
print('Loading the dataset ...')
root = '/store/nosnap/results/n... | 32.727273 | 133 | 0.749603 | import time
import hashlib
import torch
from torch_geometric.data import DataLoader
from cgl.utils.params import ParamDict
from cgl.data.graph_data import CircuitInMemDataset, CircuitGraphDataset
s = time.time()
print('Loading the dataset ...')
root = '/store/nosnap/results/ngspice_biased_pmos_gain/two_stage_biase... | true | true |
f7116fb8eeb110ebf0028104837ae9b3e293cbef | 27,964 | py | Python | pandapower/plotting/plotly/traces.py | Zamwell/pandapower | ce51946342109e969b87b60c8883d7eec02d3060 | [
"BSD-3-Clause"
] | null | null | null | pandapower/plotting/plotly/traces.py | Zamwell/pandapower | ce51946342109e969b87b60c8883d7eec02d3060 | [
"BSD-3-Clause"
] | null | null | null | pandapower/plotting/plotly/traces.py | Zamwell/pandapower | ce51946342109e969b87b60c8883d7eec02d3060 | [
"BSD-3-Clause"
] | null | null | null | # -*- coding: utf-8 -*-
# Copyright (c) 2016-2019 by University of Kassel and Fraunhofer Institute for Energy Economics
# and Energy System Technology (IEE), Kassel. All rights reserved.
import math
import numpy as np
import pandas as pd
from packaging import version
from collections.abc import Iterable
from panda... | 41.737313 | 134 | 0.601738 |
import math
import numpy as np
import pandas as pd
from packaging import version
from collections.abc import Iterable
from pandapower.plotting.plotly.get_colors import get_plotly_color, get_plotly_cmap
from pandapower.plotting.plotly.mapbox_plot import _on_map_test, _get_mapbox_token, MapboxTokenMissing
try:
... | true | true |
f7116ff78296699e86d5db80a36bfce9887bbf28 | 41,747 | py | Python | lifelines/tests/utils/test_utils.py | stefan-de/lifelines | 519bd3abe6051bd9fb5da0dfffce24ab86171f3f | [
"MIT"
] | 1 | 2020-11-18T19:54:09.000Z | 2020-11-18T19:54:09.000Z | lifelines/tests/utils/test_utils.py | stefan-de/lifelines | 519bd3abe6051bd9fb5da0dfffce24ab86171f3f | [
"MIT"
] | null | null | null | lifelines/tests/utils/test_utils.py | stefan-de/lifelines | 519bd3abe6051bd9fb5da0dfffce24ab86171f3f | [
"MIT"
] | null | null | null | # -*- coding: utf-8 -*-
import pytest
import os
import numpy as np
import pandas as pd
from pandas.testing import assert_frame_equal, assert_series_equal
import numpy.testing as npt
from numpy.linalg import norm, lstsq
from numpy.random import randn
from flaky import flaky
from lifelines import CoxPHFitter, WeibullA... | 37.917348 | 130 | 0.599612 |
import pytest
import os
import numpy as np
import pandas as pd
from pandas.testing import assert_frame_equal, assert_series_equal
import numpy.testing as npt
from numpy.linalg import norm, lstsq
from numpy.random import randn
from flaky import flaky
from lifelines import CoxPHFitter, WeibullAFTFitter, KaplanMeierFi... | true | true |
f7117002249c5cd4e3d455a21d49ac1b75cdb790 | 21,672 | py | Python | install/tools/script/common/project_utils.py | atframework/atsf4g-co | 7323ccbbc238f7d653f92c8d2aa9079beb4ef09b | [
"MIT"
] | 68 | 2016-09-08T14:36:22.000Z | 2022-03-15T09:45:53.000Z | install/tools/script/common/project_utils.py | atframework/atsf4g-co | 7323ccbbc238f7d653f92c8d2aa9079beb4ef09b | [
"MIT"
] | 3 | 2019-06-09T10:27:23.000Z | 2021-09-09T07:55:37.000Z | install/tools/script/common/project_utils.py | atframework/atsf4g-co | 7323ccbbc238f7d653f92c8d2aa9079beb4ef09b | [
"MIT"
] | 24 | 2016-11-17T12:53:24.000Z | 2021-09-26T07:37:42.000Z | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
import os
import ctypes
import platform
import cgi
import re
import hashlib
import stat
import codecs
import common.print_color
environment_check_shm = None
global_opts = None
global_cahce = dict(id_offset=0, services_type=[])
server_opts = None
server_name = '... | 34.842444 | 125 | 0.656285 |
import sys
import os
import ctypes
import platform
import cgi
import re
import hashlib
import stat
import codecs
import common.print_color
environment_check_shm = None
global_opts = None
global_cahce = dict(id_offset=0, services_type=[])
server_opts = None
server_name = ''
server_index = 1
server_alloc_listen_port ... | true | true |
f7117058f8de1894f09859f44d2ac1935baabe07 | 6,301 | py | Python | src/char/trapsin.py | roozhou/botty | a67a87845687cdf6900af10a13dc7170684faa9a | [
"MIT"
] | null | null | null | src/char/trapsin.py | roozhou/botty | a67a87845687cdf6900af10a13dc7170684faa9a | [
"MIT"
] | null | null | null | src/char/trapsin.py | roozhou/botty | a67a87845687cdf6900af10a13dc7170684faa9a | [
"MIT"
] | null | null | null | import keyboard
from utils.custom_mouse import mouse
from char import IChar
from pather import Pather
from logger import Logger
from screen import convert_abs_to_monitor, convert_screen_to_abs, grab
from config import Config
from utils.misc import wait, rotate_vec, unit_vector
import random
from pather import Location,... | 43.455172 | 133 | 0.628948 | import keyboard
from utils.custom_mouse import mouse
from char import IChar
from pather import Pather
from logger import Logger
from screen import convert_abs_to_monitor, convert_screen_to_abs, grab
from config import Config
from utils.misc import wait, rotate_vec, unit_vector
import random
from pather import Location,... | true | true |
f7117441264ed44f4707d96e06ad13baddd008e2 | 6,635 | py | Python | models/IPCC/model.py | TD21forever/QoS-Predcition-Algorithm-library | f4503462887d719a39c9ccddd6cc55546e783fd5 | [
"MIT"
] | 2 | 2022-02-08T08:19:59.000Z | 2022-02-17T01:42:54.000Z | models/IPCC/model.py | TD21forever/QoS-Predcition-Algorithm-library | f4503462887d719a39c9ccddd6cc55546e783fd5 | [
"MIT"
] | null | null | null | models/IPCC/model.py | TD21forever/QoS-Predcition-Algorithm-library | f4503462887d719a39c9ccddd6cc55546e783fd5 | [
"MIT"
] | null | null | null | import copy
import math
import numpy as np
from tqdm import tqdm
from utils.model_util import triad_to_matrix, nonzero_user_mean, nonzero_item_mean
# 相似度计算库
from scipy.stats import pearsonr
from sklearn.metrics.pairwise import cosine_similarity
class IPCCModel(object):
def __init__(self) -> None:
super()... | 33.341709 | 82 | 0.508063 | import copy
import math
import numpy as np
from tqdm import tqdm
from utils.model_util import triad_to_matrix, nonzero_user_mean, nonzero_item_mean
from scipy.stats import pearsonr
from sklearn.metrics.pairwise import cosine_similarity
class IPCCModel(object):
def __init__(self) -> None:
super().__init_... | true | true |
f71174c8a63e501662fba38d43a6adaa7178d911 | 1,172 | py | Python | tests/date_class_test.py | MartinVardanyan/My-first-project-on-GitHub | 0bfef25b691362f797b990758cc0fd342b72e891 | [
"Apache-2.0"
] | null | null | null | tests/date_class_test.py | MartinVardanyan/My-first-project-on-GitHub | 0bfef25b691362f797b990758cc0fd342b72e891 | [
"Apache-2.0"
] | null | null | null | tests/date_class_test.py | MartinVardanyan/My-first-project-on-GitHub | 0bfef25b691362f797b990758cc0fd342b72e891 | [
"Apache-2.0"
] | null | null | null | from date_class import Date
def test_init_repr(day, month, year):
obj = Date(day, month, year)
print(obj)
def test_get_day(d, m, y):
obj = Date(d, m, y)
print(obj.get_day())
def test_set_day(d, m, y, day):
obj = Date(d, m, y)
obj.set_day(day)
print(obj)
def test_get_month(d, m, y):
... | 16.507042 | 46 | 0.587884 | from date_class import Date
def test_init_repr(day, month, year):
obj = Date(day, month, year)
print(obj)
def test_get_day(d, m, y):
obj = Date(d, m, y)
print(obj.get_day())
def test_set_day(d, m, y, day):
obj = Date(d, m, y)
obj.set_day(day)
print(obj)
def test_get_month(d, m, y):
... | true | true |
f711752191b86c47ba0c964c73a8a06f6a4265dd | 286 | py | Python | steelscript/netshark/core/_exceptions.py | riverbed/steelscript-netshark | a944f18ad79c775ab6c072924b0bbb613d7462d2 | [
"MIT"
] | null | null | null | steelscript/netshark/core/_exceptions.py | riverbed/steelscript-netshark | a944f18ad79c775ab6c072924b0bbb613d7462d2 | [
"MIT"
] | null | null | null | steelscript/netshark/core/_exceptions.py | riverbed/steelscript-netshark | a944f18ad79c775ab6c072924b0bbb613d7462d2 | [
"MIT"
] | 1 | 2019-03-20T01:47:50.000Z | 2019-03-20T01:47:50.000Z | # Copyright (c) 2015 Riverbed Technology, Inc.
#
# This software is licensed under the terms and conditions of the MIT License
# accompanying the software ("License"). This software is distributed "AS IS"
# as set forth in the License.
class NetSharkException(Exception):
pass
| 23.833333 | 78 | 0.748252 |
class NetSharkException(Exception):
pass
| true | true |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.