max_stars_repo_path stringlengths 3 269 | max_stars_repo_name stringlengths 4 119 | max_stars_count int64 0 191k | id stringlengths 1 7 | content stringlengths 6 1.05M | score float64 0.23 5.13 | int_score int64 0 5 |
|---|---|---|---|---|---|---|
src/python/errors.py | Miravalier/canonfire | 1 | 8500 | <reponame>Miravalier/canonfire<gh_stars>1-10
class AuthError(Exception):
pass
class JsonError(Exception):
pass
| 1.289063 | 1 |
vehicle/tests.py | COS301-SE-2020/ctrlintelligencecapstone | 0 | 8501 | <gh_stars>0
from rest_framework.test import APITestCase
from rest_framework.test import APIRequestFactory
import requests
import pytest
import json
from django.core.management import call_command
from django.db.models.signals import pre_save, post_save, pre_delete, post_delete, m2m_changed
from rest_framework.test imp... | 2.109375 | 2 |
simple_exercises/lanesexercises/py_functions2/rep_ex3.py | ilante/programming_immanuela_englander | 0 | 8502 | <filename>simple_exercises/lanesexercises/py_functions2/rep_ex3.py
# 3. Define a function to check whether a number is even
def even(num):
if num%2 == 0:
return True
else:
return False
print(even(4))
print(even(-5))
| 4.09375 | 4 |
book_figures/chapter5/fig_posterior_cauchy.py | aragilar/astroML | 3 | 8503 | <gh_stars>1-10
"""
Posterior for Cauchy Distribution
---------------------------------
Figure 5.11
The solid lines show the posterior pdf :math:`p(\mu|{x_i},I)` (top-left panel)
and the posterior pdf :math:`p(\gamma|{x_i},I)` (top-right panel) for the
two-dimensional pdf from figure 5.10. The dashed lines show the dis... | 2.5 | 2 |
plaso/formatters/file_system.py | SamuelePilleri/plaso | 0 | 8504 | <filename>plaso/formatters/file_system.py
# -*- coding: utf-8 -*-
"""The file system stat event formatter."""
from __future__ import unicode_literals
from dfvfs.lib import definitions as dfvfs_definitions
from plaso.formatters import interface
from plaso.formatters import manager
from plaso.lib import errors
class... | 2.046875 | 2 |
applications/serializers.py | junlegend/back-landing-career | 0 | 8505 | from rest_framework import serializers
from applications.models import Application
class ApplicationSerializer(serializers.Serializer):
content = serializers.JSONField()
portfolio = serializers.FileField()
class ApplicationAdminSerializer(serializers.ModelSerializer):
class Meta:
model = Appli... | 2 | 2 |
qualtrics_iat/qualtrics_tools.py | ycui1/QualtricsIAT | 0 | 8506 | from pathlib import Path
import requests
from requests_toolbelt.multipart.encoder import MultipartEncoder
# api_token = "<KEY>"
# brand_center = "mdanderson.co1"
# data_center = "iad1"
# headers = {"x-api-token": api_token}
class QualtricsTool:
"""Data model to manage Qualtrics-related tools
Parameters:
... | 2.921875 | 3 |
linter.py | dndrsn/SublimeLinter-contrib-cspell | 0 | 8507 | <reponame>dndrsn/SublimeLinter-contrib-cspell
from SublimeLinter.lint import Linter, STREAM_STDOUT
class CSpell(Linter):
cmd = 'cspell stdin'
defaults = {'selector': 'source'}
regex = r'^[^:]*:(?P<line>\d+):(?P<col>\d+) - (?P<message>.*)$'
error_stream = STREAM_STDOUT
| 2.046875 | 2 |
metal/gdb/__init__.py | cHemingway/test | 24 | 8508 | <reponame>cHemingway/test<filename>metal/gdb/__init__.py
from metal.gdb.metal_break import Breakpoint, MetalBreakpoint
from metal.gdb.exitcode import ExitBreakpoint
from metal.gdb.timeout import Timeout
from metal.gdb.newlib import NewlibBreakpoints
from metal.gdb.argv import ArgvBreakpoint
| 1.195313 | 1 |
portfolio/gui/tabresults/righttable.py | timeerr/portfolio | 0 | 8509 | <filename>portfolio/gui/tabresults/righttable.py
#!/usr/bin/python3
from datetime import datetime
from PyQt5.QtWidgets import QTableWidgetItem, QTableWidget, QAbstractItemView, QMenu, QMessageBox
from PyQt5.QtGui import QCursor
from PyQt5.QtCore import Qt, pyqtSignal, QObject
from portfolio.db.fdbhandler import resu... | 2.296875 | 2 |
Day5/overlap_result.py | d4yvie/advent_of_code_2021 | 0 | 8510 | <filename>Day5/overlap_result.py<gh_stars>0
class OverlapResult:
def __init__(self, overlap_map: dict[tuple[float, float], int]):
self._overlap_map = overlap_map
self._overlaps = overlap_map_to_overlaps(overlap_map)
@property
def overlaps(self) -> int:
return self._overlaps
@p... | 2.859375 | 3 |
setup.py | NikolaiT/proxychecker | 1 | 8511 | <filename>setup.py
#!/usr/bin/env python
from distutils.core import setup
VERSION = "0.0.1"
setup(
author='<NAME>',
name = "proxychecker",
version = VERSION,
description = "A Python proxychecker module that makes use of socks",
url = "http://incolumitas.com",
license = "BSD",
author_email ... | 1.242188 | 1 |
charlotte/charlotte.py | puiterwijk/charlotte | 5 | 8512 | <filename>charlotte/charlotte.py
class Config:
def __init__(self, config_file_name):
self.config_file_name = config_file_name
| 1.773438 | 2 |
python/app/plugins/http/Struts2/S2_052.py | taomujian/linbing | 351 | 8513 | #!/usr/bin/env python3
from app.lib.utils.request import request
from app.lib.utils.encode import base64encode
from app.lib.utils.common import get_capta, get_useragent
class S2_052_BaseVerify:
def __init__(self, url):
self.info = {
'name': 'S2-052漏洞,又名CVE-2017-9805漏洞',
'descriptio... | 2.390625 | 2 |
UPD/extension/utils.py | RIDCorix/UPD | 0 | 8514 | <reponame>RIDCorix/UPD<gh_stars>0
import sys
# def get_tools():
# manager = PluginManager()
# manager.setPluginPlaces(["plugins/file_cabinet"])
# manager.collectPlugins()
# return [plugin.plugin_object for plugin in manager.getAllPlugins()]
def get_tools():
import importlib
tools = ['file_cabi... | 2.140625 | 2 |
sbin/preload_findit_coverage_2.py | cariaso/metapub | 28 | 8515 | <filename>sbin/preload_findit_coverage_2.py
from __future__ import absolute_import, print_function, unicode_literals
# "preload" for FindIt #2: iterate over same journal list, but actually
# load a PubMedArticle object on each PMID. (no list output created)
from metapub import FindIt, PubMedFetcher
from metapub.fin... | 2.578125 | 3 |
sgcache/control.py | vfxetc/sgcache | 13 | 8516 | <gh_stars>10-100
from __future__ import absolute_import
from select import select
import errno
import functools
import itertools
import json
import logging
import os
import socket
import threading
import time
import traceback
log = logging.getLogger(__name__)
from .utils import makedirs, unlink
class TimeOut(Exce... | 2.25 | 2 |
lantz/drivers/tektronix/tds1002b.py | mtsolmn/lantz-drivers | 4 | 8517 | <reponame>mtsolmn/lantz-drivers
# -*- coding: utf-8 -*-
"""
lantz.drivers.tektronix.tds1012
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Implements the drivers to control an oscilloscope.
:copyright: 2015 by Lantz Authors, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from lan... | 1.929688 | 2 |
specs/dxgi.py | linkmauve/apitrace | 1 | 8518 | ##########################################################################
#
# Copyright 2014 VMware, Inc
# Copyright 2011 <NAME>
# All Rights Reserved.
#
# 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 t... | 1.273438 | 1 |
code/camera_calib.py | nitchith/CarND-Advanced-Lane-Lines | 0 | 8519 | <filename>code/camera_calib.py<gh_stars>0
import numpy as np
import cv2
import glob
import matplotlib.pyplot as plt
def camera_calibrate(images_list, nx=9, ny=6, show_corners=False):
# prepare object points, like (0,0,0), (1,0,0), (2,0,0) ....,(6,5,0)
objp = np.zeros((ny*nx,3), np.float32)
objp[:,:2] = np.... | 3 | 3 |
python-jenkins/yaml_read_config/custom_log.py | MathiasStadler/docker-jenkins-scripted | 0 | 8520 | """ module logging"""
# logging
| 1.09375 | 1 |
src/stratis_cli/_actions/_pool.py | stratis-storage/stratis-cli | 94 | 8521 | <gh_stars>10-100
# Copyright 2021 Red Hat, 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 agr... | 1.59375 | 2 |
synchrobot/chat_user.py | Esenin/telegram_vk_pipe_bot | 2 | 8522 | <reponame>Esenin/telegram_vk_pipe_bot<filename>synchrobot/chat_user.py
# -*- coding: utf-8 -*-
# Author: <NAME>
import calendar
import time
import datetime as dt
import json
class User(object):
def __init__(self, id, name, last_seen, want_time, muted, username="", additional_keys="{}"):
super(User, self).__init__(... | 2.484375 | 2 |
backend/src/contaxy/schema/auth.py | Felipe-Renck/contaxy | 0 | 8523 | <gh_stars>0
from datetime import datetime, timezone
from enum import Enum
from typing import Dict, List, Optional
import pydantic
from fastapi import HTTPException, Path, status
from pydantic import BaseModel, EmailStr, Field
from contaxy.schema.exceptions import ClientValueError
from contaxy.schema.shared import MAX... | 2.109375 | 2 |
setup.py | richarddwang/hugdatafast | 19 | 8524 | import setuptools
from hugdatafast.__init__ import __version__
with open("README.md", "r") as fh:
long_description = fh.read()
REQUIRED_PKGS = [
'fastai>=2.0.8',
'fastscore>=1.0.1', # change of store_attr api
'datasets',
]
setuptools.setup(
name="hugdatafast",
version=__version__,
author=... | 1.296875 | 1 |
tests/scripts/test_repository_actor_definition.py | drehak/leapp | 0 | 8525 | import pytest
from leapp.repository.actor_definition import ActorDefinition, ActorInspectionFailedError, MultipleActorsError
from leapp.exceptions import UnsupportedDefinitionKindError
from leapp.repository import DefinitionKind
from helpers import repository_dir
import logging
import mock
_FAKE_META_DATA = {
'de... | 2.140625 | 2 |
iHome/house/models.py | yeyuning1/iHome | 2 | 8526 | <gh_stars>1-10
from django.db import models
# Create your models here.
from utils.models import BaseModel
class House(BaseModel):
'''房屋信息'''
user = models.ForeignKey('users.User', on_delete=models.CASCADE, verbose_name='房屋用户')
area = models.ForeignKey('address.Area', on_delete=models.SET_NULL, n... | 2.1875 | 2 |
cltwit/main.py | Psycojoker/cltwit | 0 | 8527 | <filename>cltwit/main.py
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
Cltwit is a command line twitter utility
Author : <NAME>
Date : 2013
"""
import os
import sys
import re
import getopt
import gettext
import sqlite3
import webbrowser
import ConfigParser
from sqlite2csv import sqlite2csv
from cltwitdb import c... | 2.609375 | 3 |
weibo_image_spider/exceptions.py | lonsty/weibo-pic-spider-hd | 0 | 8528 | # @AUTHOR : lonsty
# @DATE : 2020/3/28 18:01
class CookiesExpiredException(Exception):
pass
class NoImagesException(Exception):
pass
class ContentParserError(Exception):
pass
class UserNotFound(Exception):
pass
| 1.5 | 2 |
WebHtmlExample/WebHtmlExample.py | lilei644/python-learning-example | 2 | 8529 | <reponame>lilei644/python-learning-example
import requests
from bs4 import BeautifulSoup
import re
# 设置请求头
# 更换一下爬虫的User-Agent,这是最常规的爬虫设置
headers = {
"User-Agent": 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.132 Safari/537.36'}
# 获取天气信息
def get_weather... | 3.8125 | 4 |
Codi/diode.py | JosepFanals/HELM | 1 | 8530 | import numpy as np
import math
import matplotlib.pyplot as plt
U = 5 # equival a l'E
R = 2 # equival a R1
R2 = 3
P = 1.2
Vt = 0.026
Is = 0.000005
n = 200 # profunditat
Vd = np.zeros(n) # sèries
Vl = np.zeros(n)
I1 = np.zeros(n)
I1[0] = U / R # inicialització de les sèries
Vd[0] = Vt * math.log(1 + I1[0] / Is)... | 2.9375 | 3 |
proxybroker/errors.py | aljeshishe/ProxyBroker | 0 | 8531 | <filename>proxybroker/errors.py
"""Errors."""
class ProxyError(Exception):
pass
class NoProxyError(Exception):
pass
class ResolveError(Exception):
pass
class ProxyConnError(ProxyError):
pass
class ProxyRecvError(ProxyError): # connection_is_reset
pass
class ProxySendError(ProxyError): ... | 2.125 | 2 |
questionanswering/models/pooling.py | lvying1991/KBQA-System | 2 | 8532 | <filename>questionanswering/models/pooling.py
import torch
from torch import nn as nn
from torch import autograd
class LogSumExpPooling1d(nn.Module):
"""Applies a 1D LogSumExp pooling over an input signal composed of several input planes.
LogSumExp is a smooth approximation of the max function.
在由多个输入平面组成... | 3.15625 | 3 |
tests/unit/app/test_session.py | bernease/whylogs-python | 0 | 8533 | <reponame>bernease/whylogs-python
import pytest
from whylogs.app.session import get_or_create_session, get_session, get_logger, reset_default_session, session_from_config
from whylogs.app.config import SessionConfig
from whylogs.app.session import Session
from pandas import util
def test_get_global_session():
_... | 2.484375 | 2 |
Packages/constants.py | Bemesko/Intelligence-of-Home-GUI | 0 | 8534 | <reponame>Bemesko/Intelligence-of-Home-GUI<filename>Packages/constants.py
import enum
BASELINE = "baseline"
ENERGY = "energy"
MAX_PRICE = "max_price"
START_PRICE = "starting_price"
INCREMENT = "increment"
MIN_PRICE = "min_price"
MAX_LOT_SIZE = "max_lot_size_wh"
NAMESERVER_AGENT_AMOUNT = 3
ATTRIBUTE_LIST_LENGTH = 50
N... | 2.640625 | 3 |
target/tests.py | groundupnews/gu | 19 | 8535 | <reponame>groundupnews/gu
from django.contrib.auth.models import User
from django.test import TestCase
from django.test import Client
from django.urls import reverse
from target import models
from django.utils import timezone
# Create your tests here.
class URLSWork(TestCase):
@classmethod
def setUpTestData(... | 2.5625 | 3 |
jenkinsapi/view.py | julienduchesne/jenkinsapi | 0 | 8536 | <reponame>julienduchesne/jenkinsapi
"""
Module for jenkinsapi views
"""
import six
import logging
from jenkinsapi.jenkinsbase import JenkinsBase
from jenkinsapi.job import Job
from jenkinsapi.custom_exceptions import NotFound
log = logging.getLogger(__name__)
class View(JenkinsBase):
"""
View class
""... | 2.265625 | 2 |
core/vision/collection.py | jmarangola/cv-chess | 0 | 8537 | """
Autonomous dataset collection of data for jetson nano
<NAME> - <EMAIL>
"""
import datasets
import json
from datasets import Board, ChessPiece, PieceColor, PieceType
#from realsense_utils import RealSenseCamera
import preprocessing as pr
import cv2
import pandas as pd
import os
from os.path import isfile, join
im... | 2.46875 | 2 |
tests/test_sbfc.py | htwangtw/sbfc | 0 | 8538 | <reponame>htwangtw/sbfc
import os
import numpy as np
import pandas as pd
from nilearn import datasets
from sbfc.parser import seed_base_connectivity
seed = os.path.dirname(__file__) + "/data/difumo64_pcc.nii.gz"
def _make_data_single_run(confound=True):
adhd_dataset = datasets.fetch_adhd(n_subjects=2)
grou... | 2.265625 | 2 |
final_project/machinetranslation/tests/test.py | ChrisOmeh/xzceb-flask_eng_fr | 0 | 8539 | <gh_stars>0
import unittest
from translator import english_to_french, french_to_english
class TestenglishToFrench(unittest.TestCase):
def test1(self):
self.assertEqual(english_to_french(["Hello"]), "Bonjour")
self.assertNotEqual(english_to_french(["Bonjour"]), "Hello")
class TestfrenchToEnglish(un... | 3.25 | 3 |
tests/ut/python/parallel/test_auto_parallel_transformer.py | huxian123/mindspore | 2 | 8540 | <reponame>huxian123/mindspore
# Copyright 2019 Huawei Technologies Co., Ltd
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required ... | 1.828125 | 2 |
cloudcafe/compute/events/models/common.py | rcbops-qa/cloudcafe | 0 | 8541 | <reponame>rcbops-qa/cloudcafe
"""
Copyright 2015 Rackspace
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 agree... | 1.960938 | 2 |
openpyxl/drawing/tests/test_shapes.py | sekcheong/openpyxl | 0 | 8542 | from __future__ import absolute_import
# Copyright (c) 2010-2017 openpyxl
import pytest
from openpyxl.xml.functions import fromstring, tostring
from openpyxl.tests.helper import compare_xml
@pytest.fixture
def GradientFillProperties():
from ..fill import GradientFillProperties
return GradientFillProperties
... | 2.390625 | 2 |
raysect/core/math/function/float/function3d/interpolate/tests/scripts/generate_3d_splines.py | raysect/source | 71 | 8543 | <filename>raysect/core/math/function/float/function3d/interpolate/tests/scripts/generate_3d_splines.py
# Copyright (c) 2014-2021, Dr <NAME>, Raysect Project
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions... | 1.476563 | 1 |
supertokens_python/recipe_module.py | girish946/supertokens-python | 36 | 8544 | # Copyright (c) 2021, VRAI Labs and/or its affiliates. All rights reserved.
#
# This software is licensed under the Apache License, Version 2.0 (the
# "License") as published by the Apache Software Foundation.
#
# You may not use this file except in compliance with the License. You may
# obtain a copy of the License at... | 1.945313 | 2 |
tests/__init__.py | mihaidumitrescu/flake8-html | 36 | 8545 | <filename>tests/__init__.py
# -*- coding: utf-8 -*-
"""Tests go in this directory."""
| 1.117188 | 1 |
datajoint-workflow/{{cookiecutter.github_repo}}/src/{{cookiecutter.__pkg_import_name}}/version.py | Yambottle/dj-workflow-template | 0 | 8546 | __version__ = "{{cookiecutter._pkg_version}}"
| 1.15625 | 1 |
examples/benchmarking/benchmark_bm25.py | shibing624/similarities | 16 | 8547 | <gh_stars>10-100
# -*- coding: utf-8 -*-
"""
@author:XuMing(<EMAIL>)
@description:
"""
import datetime
import os
import pathlib
import random
import sys
from loguru import logger
sys.path.append('../..')
from similarities import BM25Similarity
from similarities.utils import http_get
from similarities.data_loader impo... | 2.296875 | 2 |
tb/test_arp_64.py | sergachev/verilog-ethernet | 2 | 8548 | <reponame>sergachev/verilog-ethernet
#!/usr/bin/env python
"""
Copyright (c) 2014-2018 <NAME>
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... | 1.742188 | 2 |
NitroGenerator.py | ATRS7391/Discord_Nitro_Generator_And_Checker_Python_Version | 2 | 8549 | <reponame>ATRS7391/Discord_Nitro_Generator_And_Checker_Python_Version
import random
import sys
import subprocess
def pip_install(module: str):
subprocess.run([sys.executable, "-m", "pip", "-q", "--disable-pip-version-check", "install", module])
try:
import requests
except:
print("'requests' ... | 2.625 | 3 |
2015/main/13/part2.py | sgravrock/adventofcode | 0 | 8550 | <filename>2015/main/13/part2.py
import sys
import itertools
def readfile(f):
result = {}
for line in f:
fields = line.rstrip().split(" ")
p1 = fields[0]
p2 = fields[10].replace(".", "")
n = int(fields[3])
if fields[2] == "lose":
n *= -1
result[(p1, p2)] = n
return result
def optimal(config):
add_se... | 3.359375 | 3 |
networking/connection/stun_client.py | bcgrendel/python_networking | 0 | 8551 | <reponame>bcgrendel/python_networking
import socket
import sys
import traceback
import struct
import threading;
from threading import Thread;
import time;
import datetime;
import json
#import buffered_message;
import hashlib
from Crypto.PublicKey import RSA
from connection_state import ConnectionState
# publickey = RSA... | 2.96875 | 3 |
tools/wptserve/tests/functional/test_response.py | qanat/wpt | 1 | 8552 | import os
import unittest
import json
import types
from http.client import BadStatusLine
from io import BytesIO
import pytest
wptserve = pytest.importorskip("wptserve")
from .base import TestUsingServer, TestUsingH2Server, doc_root
def send_body_as_header(self):
if self._response.add_required_headers:
s... | 2.421875 | 2 |
bbc1/core/command.py | ks91/bbc1-pub | 89 | 8553 | # -*- coding: utf-8 -*-
"""
Copyright (c) 2017 beyond-blockchain.org.
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 l... | 2.59375 | 3 |
main.py | cmcquinn/cmake-uvision-syncer | 0 | 8554 | """
Usage:
main.py [<project>]
Options:
<project> Path to the .uvprojx file (Keil® µVision5 Project File).
The .uvoptx file (Keil® µVision5 Project Options file) will
be located automatically as it shall be adjacent to the
.uvprojx file, having the same filenam... | 2.890625 | 3 |
scipy/weave/base_spec.py | lesserwhirls/scipy-cwt | 8 | 8555 | <filename>scipy/weave/base_spec.py
class base_converter(object):
"""
Properties:
headers -- list of strings that name the header files needed by this
object.
include_dirs -- list of directories where the header files can be found.
libraries -- list of libraries... | 2.921875 | 3 |
xception/test.py | latentai/model-zoo-models | 8 | 8556 | <filename>xception/test.py
#!/usr/bin/env python3
from utils.model_config_helpers import run_model_test
run_model_test()
| 1.359375 | 1 |
mpunet/bin/cv_split.py | alexsosn/MultiPlanarUNet | 0 | 8557 | <filename>mpunet/bin/cv_split.py
from glob import glob
import sys
import os
import numpy as np
import random
from mpunet.utils import create_folders
import argparse
def get_parser():
parser = argparse.ArgumentParser(description="Prepare a data folder for a"
"CV exp... | 2.953125 | 3 |
src/client/pydaos/raw/conversion.py | gczsjdy/daos | 1 | 8558 | #!/usr/bin/python
"""
(C) Copyright 2018 Intel Corporation.
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 ... | 2.78125 | 3 |
experiments/nmt/utils/vocabulary_coverage.py | lvapeab/GroundHog_INMT | 0 | 8559 | import cPickle
import argparse
parser = argparse.ArgumentParser(
"Computes the coverage of a shortlist in a corpus file")
parser.add_argument("--vocab",
required=True, help="Vocabulary to use (.pkl)")
parser.add_argument("--text",
required=True, help="Beam size, turn... | 2.953125 | 3 |
stores/apps/inventory/migrations/0001_initial.py | diassor/CollectorCity-Market-Place | 135 | 8560 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'ProductType'
db.create_table('inventory_producttype', (
('id', self.gf('django... | 2.171875 | 2 |
src/ralph/deployment/migrations/0005_auto__add_field_archiveddeployment_service__add_field_archiveddeployme.py | vi4m/ralph | 1 | 8561 | <reponame>vi4m/ralph
# -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'ArchivedDeployment.service'
db.add_column('deployment_archiveddeploymen... | 2.15625 | 2 |
SPH/sphbwr_example2.py | RLReed/unotran | 0 | 8562 | import numpy as np
import sys
sys.path.append('/homes/rlreed/workspace/unotran/src')
from coarseBounds import computeBounds, Grouping
import pickle
from makeDLPbasis import makeBasis as makeDLP
from makeKLTbasis import makeBasis as makeKLT
import sph
import sph_dgm
import pydgm
def buildGEO(ass_map):
fine_map = [... | 1.875 | 2 |
src/oci/management_agent/models/management_agent_aggregation_dimensions.py | CentroidChef/oci-python-sdk | 249 | 8563 | # coding: utf-8
# Copyright (c) 2016, 2021, Oracle and/or its affiliates. All rights reserved.
# This software is dual-licensed to you under the Universal Permissive License (UPL) 1.0 as shown at https://oss.oracle.com/licenses/upl or Apache License 2.0 as shown at http://www.apache.org/licenses/LICENSE-2.0. You may c... | 1.71875 | 2 |
py_buycoins/sending.py | Bashorun97/BuyCoins-Python-SDK | 1 | 8564 | from .gcore.queries import GetNetworkFee, GetBalance
from .gcore.mutations import SendCoin
from typing import List, Optional
from .exc import SendLimitError, InvalidClientObject
class Send:
def __init__(self, address: str, cryptocurrency: str, amount: float):
self.address = address
self.cryptocurr... | 2.359375 | 2 |
snippet/example/python/url.py | yp2800/snippet | 94 | 8565 | <gh_stars>10-100
# -*- coding: utf-8 -*-
try:
from urlparse import urlparse, urlunsplit
except ImportError:
from urllib.parse import urlparse, urlunsplit
class URL(object):
DEFAULT_SCHEME = ["http", "https"]
def __init__(self, url, allowed_scheme=None):
self._url = url
self.url = url... | 2.921875 | 3 |
netvisor_api_client/services/dimension.py | tristen-tooming/netvisor-api-client | 0 | 8566 | from .base import Service
from ..requests.dimension import CreateDimensionsRequest, DimensionsListRequest
class DimensionService(Service):
def create(self, data):
request = CreateDimensionsRequest(
self.client,
params={'method': 'add'},
data=data
)
retu... | 2.625 | 3 |
cishouseholds/filter.py | ONS-SST/cis_households | 0 | 8567 | <gh_stars>0
from typing import List
from typing import Union
from pyspark.sql import DataFrame
from pyspark.sql import functions as F
from pyspark.sql.window import Window
def filter_all_not_null(df: DataFrame, reference_columns: List[str]) -> DataFrame:
"""
Filter rows which have NULL values in all the spec... | 3.296875 | 3 |
cscs-checks/cuda/multi_gpu.py | hpc-unibe-ch/reframe | 0 | 8568 | <reponame>hpc-unibe-ch/reframe<gh_stars>0
# Copyright 2016-2020 Swiss National Supercomputing Centre (CSCS/ETH Zurich)
# ReFrame Project Developers. See the top-level LICENSE file for details.
#
# SPDX-License-Identifier: BSD-3-Clause
import os
import reframe.utility.sanity as sn
import reframe as rfm
@rfm.required... | 1.695313 | 2 |
sympy/series/tests/test_demidovich.py | msgoff/sympy | 0 | 8569 | from sympy import (
limit,
Symbol,
oo,
sqrt,
Rational,
log,
exp,
cos,
sin,
tan,
pi,
asin,
together,
root,
S,
)
# Numbers listed with the tests refer to problem numbers in the book
# "Anti-demidovich, problemas resueltos, Ed. URSS"
x = Symbol("x")
def test_... | 3.1875 | 3 |
notion/ctx.py | jfhbrook/notion-tools | 1 | 8570 | from notion.client import NotionClient
from notion.settings import Settings
class Context:
def __init__(self):
self.settings = Settings.from_file()
self._client = None
def get_client(self):
if not self._client:
self.settings.validate()
self._client = NotionClie... | 2.171875 | 2 |
setup.py | rgooler/bootstrap-pip | 0 | 8571 | <filename>setup.py
#!/usr/bin/env python
import os
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
def read(*paths):
"""Build a file path from *paths* and return the contents."""
with open(os.path.join(*paths), 'r') as f:
return f.read()
install_require... | 2.140625 | 2 |
cfdata/tabular/converters/__init__.py | carefree0910/carefree-data | 9 | 8572 | from .base import *
from .string import *
from .categorical import *
from .numerical import *
__all__ = ["Converter", "converter_dict"]
| 1.070313 | 1 |
hello_world.py | BronWang/first_github | 0 | 8573 | def hello_world():
"""打印Hello world"""
message = 'hello world'
print(message.title())
hello_world()
| 2.765625 | 3 |
Python/Samples/Observer/UtObserver.py | plasroom46/DesignPattern.Sample | 9 | 8574 | import unittest
from Observers import Observer, ObserverMailServer, ObserverPbx
from Subjects import Subject, SubjectEflow
class UtVisitor(unittest.TestCase):
def test_observer(self):
# Create observers
pbx = ObserverPbx()
ms = ObserverMailServer()
# Create subject
... | 3.046875 | 3 |
modules/voxelman/config.py | Relintai/pandemonium_engine | 0 | 8575 |
def can_build(env, platform):
return True
def configure(env):
pass
def get_doc_classes():
return [
"WorldArea",
"VoxelLight",
"VoxelLightNode",
"VoxelLevelGenerator",
"VoxelLevelGeneratorFlat",
"VoxelSurfaceMerger",
"VoxelSurfaceSimple",
... | 1.75 | 2 |
Python/2021/day_04/day_04.py | JonoRicci/Advent-Of-Code | 0 | 8576 | <gh_stars>0
"""
Day 04
"""
from logger import logger
def main() -> None:
"""
Import the puzzle input, process and display the results.
"""
puzzle_input = import_list()
logger.debug(puzzle_input)
final_score = play_bingo(puzzle_input)
for result in final_score:
logger.info(f"The f... | 3.71875 | 4 |
timeeval_experiments/algorithms/eif.py | HPI-Information-Systems/TimeEval | 2 | 8577 | from durations import Duration
from typing import Any, Dict, Optional
from timeeval import Algorithm, TrainingType, InputDimensionality
from timeeval.adapters import DockerAdapter
from timeeval.params import ParameterConfig
_eif_parameters: Dict[str, Dict[str, Any]] = {
"extension_level": {
"defaultValue": None,
... | 2.234375 | 2 |
deepchem/models/tf_new_models/graph_models.py | KEHANG/deepchem | 0 | 8578 | """
Convenience classes for assembling graph models.
"""
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
__author__ = "<NAME> and <NAME>"
__copyright__ = "Copyright 2016, Stanford University"
__license__ = "MIT"
import tensorflow as tf
from deepchem.nn.lay... | 3.0625 | 3 |
questionbank/users/urls.py | SyafiqTermizi/questionbank | 1 | 8579 | <filename>questionbank/users/urls.py
from django.urls import path
from .views import (
UserListView, UserUpdateView, UserProfileView, UserDeleteView,
AcceptInvitationView, SpecialtyListView, SpecialtyCreateView, SpecialtyUpdateView,
SpecialtyDeleteView
)
app_name = 'users'
urlpatterns = [
path('', Us... | 2.0625 | 2 |
qiskit_machine_learning/algorithms/regressors/neural_network_regressor.py | Zoufalc/qiskit-machine-learning | 1 | 8580 | <reponame>Zoufalc/qiskit-machine-learning<filename>qiskit_machine_learning/algorithms/regressors/neural_network_regressor.py
# This code is part of Qiskit.
#
# (C) Copyright IBM 2021.
#
# This code is licensed under the Apache License, Version 2.0. You may
# obtain a copy of this license in the LICENSE.txt file in the ... | 2.71875 | 3 |
residuals.py | fbob/mplFOAM | 8 | 8581 | <gh_stars>1-10
#!/usr/bin/env python
# encoding: utf-8
import sys
import getopt
import re
import os
import pylab as plt
import numpy as np
# Define the variables for which the residuals will be plotted
variables = ["Ux", "Uy", "T", "p_rgh", "k", "epsilon"]
# Get the arguments of the script
def usage():
print("Us... | 3.015625 | 3 |
content_generator/vitae.py | empiricalstateofmind/personal_website | 0 | 8582 | <reponame>empiricalstateofmind/personal_website
# Generate the vitae.json file used to populate the Vitae section of the website.
import pandas as pd
import re
from datetime import datetime
from collections import defaultdict
import json
# Publications
def create_publications(filepath):
publications... | 2.78125 | 3 |
cement/ext/ext_generate.py | tomekr/cement | 826 | 8583 | """
Cement generate extension module.
"""
import re
import os
import inspect
import yaml
import shutil
from .. import Controller, minimal_logger, shell
from ..utils.version import VERSION, get_version
LOG = minimal_logger(__name__)
class GenerateTemplateAbstractBase(Controller):
class Meta:
pass
de... | 2.296875 | 2 |
ditto/core/__init__.py | Kvoti/ditto | 0 | 8584 | from . import forms
from . import views
ADMIN_ROLE = "Administrator"
MEMBER_ROLE = "Member"
GUEST_ROLE = "Guest"
DEFAULT_ROLES = [ADMIN_ROLE, MEMBER_ROLE, GUEST_ROLE]
| 1.28125 | 1 |
training_stats/hrm.py | salwator/training_stats | 4 | 8585 | from .gpxfile import get_hr_measurements
from .utils import interpolate
from operator import itemgetter
def __calculate_moving_sums(points, window):
""" Calculates hr moving sums of the window len """
time, hrs = zip(*points)
moving_sum = sum(hrs[0:window])
sums = [(time[0], moving_sum)]
for i, t ... | 3.125 | 3 |
scripts/utils/import_languages.py | mozilla-releng/staging-mozilla-vpn-client | 0 | 8586 | #! /usr/bin/env python3
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import argparse
import xml.etree.ElementTree as ET
import os
import sys
import shutil
import ate... | 2.09375 | 2 |
cogs/filter.py | Velgaster/Discord-User-Vote | 0 | 8587 | from discord.ext import commands
import discord
def setup(client):
client.add_cog(KeyWordFilter(client))
class KeyWordFilter(commands.Cog):
def __init__(self, client):
self.client = client
self.log_ch = self.client.get_channel(int(self.client.SETTINGS.LOG_CHANNEL))
@commands.Cog.listene... | 2.390625 | 2 |
api/app.py | sai-krishna-msk/KickAssist | 0 | 8588 | <gh_stars>0
from ml_model.model import KickModel
import numpy as np
import pandas as pd
import eli5
import joblib
import flask
from flask import Flask, render_template, request, jsonify
app = Flask(__name__)
model_oh = joblib.load('ml_model/estimators/model_oh.sav')
model_hel = joblib.load('ml_model/estimators/model... | 2.65625 | 3 |
snowddl/resolver/primary_key.py | littleK0i/SnowDDL | 21 | 8589 | <reponame>littleK0i/SnowDDL
from snowddl.blueprint import PrimaryKeyBlueprint
from snowddl.resolver.abc_schema_object_resolver import AbstractSchemaObjectResolver, ResolveResult, ObjectType
class PrimaryKeyResolver(AbstractSchemaObjectResolver):
def get_object_type(self) -> ObjectType:
return ObjectType.P... | 2.25 | 2 |
modules/module0/02_datastructures_and_geometry/datastructures_2b.py | tetov/ITA19 | 7 | 8590 | import os
import compas
from compas.datastructures import Mesh
from compas_rhino.artists import MeshArtist
HERE = os.path.dirname(__file__)
DATA = os.path.join(HERE, 'data')
FILE = os.path.join(DATA, 'faces.obj')
mesh = Mesh.from_obj(FILE)
artist = MeshArtist(mesh, layer="Mesh")
artist.draw_vertices(
color={ke... | 2.578125 | 3 |
OOP/Exercises/First_steps_in_OOP_Exercises/8_pokemon/project/pokemon.py | tankishev/Python | 2 | 8591 | <reponame>tankishev/Python<filename>OOP/Exercises/First_steps_in_OOP_Exercises/8_pokemon/project/pokemon.py<gh_stars>1-10
# The Pokemon class should receive a name (string) and health (int) upon initialization.
# It should also have a method called pokemon_details that returns the information about the pokemon:
# "{pok... | 3.84375 | 4 |
tests/test_pandas.py | ONSdigital/ons_utils | 0 | 8592 | """Tests for the pandas helpers in the pd_helpers.py module."""
import pytest
from pandas.testing import assert_frame_equal
from tests.conftest import create_dataframe
from ons_utils.pandas import *
def test_nested_dict_to_df():
"""Test for nested_dict_to_df."""
input_d = {
'bones': {
'f... | 2.984375 | 3 |
lsf_ibutils/ibsub/__init__.py | seanfisk/lsf-ibutils | 0 | 8593 | <filename>lsf_ibutils/ibsub/__init__.py
""":mod:`lsf_ibutils.ibsub` -- Interactive batch submission utility
"""
| 1.078125 | 1 |
build/lib/configger/fishes/__init__.py | PaperDevil/pyconfigger | 2 | 8594 | <reponame>PaperDevil/pyconfigger<gh_stars>1-10
import os
splited_path = os.path.realpath(__file__).split('\\')[:-1]
fish_path = '\\'.join(splited_path)
fish_json_name = "fish.json"
fish_json_path = os.path.join(fish_path, fish_json_name)
| 1.601563 | 2 |
setup.py | IntuitionEngineeringTeam/RedBlackPy | 12 | 8595 | #
# Created by <NAME>.
# Copyright 2018 Intuition. All rights reserved.
#
import os
import platform
from setuptools import setup
from setuptools.command.build_ext import build_ext
from distutils.extension import Extension
from Cython.Build import cythonize
from rbp_setup_tools.code_generation import generate_from_cy... | 1.789063 | 2 |
source/accounts/views.py | kishan2064/hashpy1 | 0 | 8596 | from django.contrib.auth import login, authenticate, REDIRECT_FIELD_NAME, get_user_model
from django.contrib import messages
from django.contrib.auth.mixins import LoginRequiredMixin
from django.contrib.auth.views import PasswordResetView as BasePasswordResetView, SuccessURLAllowedHostsMixin
from django.shortcuts impor... | 1.859375 | 2 |
conversationkg/kgs/writers.py | INDElab/conversationkg | 3 | 8597 | <reponame>INDElab/conversationkg<gh_stars>1-10
from ..conversations.corpus import Conversation
from ..conversations.emails import Email
from collections import Counter
import matplotlib
import pandas as pd
import json
class JSONWriter:
def __init__(self, kg):
self.kg = kg
self.entities = kg.en... | 2.453125 | 2 |
model-test.py | shikew/Handwriting-calculator | 0 | 8598 | import numpy as np
from PIL import Image
from keras.models import load_model
img_gray = Image.open('1002.png')
number = np.array(img_gray)
print(number.shape)
print('准备的图片的shape:',number.flatten().shape)
print('原number:',number)
number = number.astype('float32')
number = number/255 #归一化
number = number.flatten()
pri... | 3.328125 | 3 |
deps/libgdal/gyp-formats/ogr_mem.gyp | khrushjing/node-gdal-async | 42 | 8599 | <gh_stars>10-100
{
"includes": [
"../common.gypi"
],
"targets": [
{
"target_name": "libgdal_ogr_mem_frmt",
"type": "static_library",
"sources": [
"../gdal/ogr/ogrsf_frmts/mem/ogrmemdatasource.cpp",
"../gdal/ogr/ogrsf_frmts/mem/ogrmemlayer.cpp",
"../gdal/ogr/ogrsf_frmts/mem/ogrmemdriver.cpp"
... | 1.007813 | 1 |