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 |
|---|---|---|---|---|---|---|
settings.py | ONSdigital/sdx-rabbit-monitor | 1 | 12769151 | <filename>settings.py
import logging
import os
LOGGING_FORMAT = "%(asctime)s|%(levelname)s: sdx-rabbit-monitor: %(message)s"
LOGGING_LEVEL = logging.getLevelName(os.getenv('LOGGING_LEVEL', 'DEBUG'))
PORT = os.getenv('SDX_RABBIT_MONITOR_PORT')
RABBITMQ_DEFAULT_PASS = os.getenv('SDX_RABBIT_MONITOR_PASS')
RABBITMQ_DEFAU... | 2.171875 | 2 |
orchestra/migrations/0002_auto_20141229_1543.py | ksbek/orchestra | 0 | 12769152 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import jsonfield.fields
class Migration(migrations.Migration):
dependencies = [
('orchestra', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='task',
... | 1.617188 | 2 |
fuelclient/fuelclient/tests/test_client.py | Zipfer/fuel-web | 0 | 12769153 | # -*- coding: utf-8 -*-
#
# Copyright 2013-2014 Mirantis, 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... | 1.828125 | 2 |
lcfeatures/results/cm.py | oscarpimentel/astro-lightcurves-features | 0 | 12769154 | from __future__ import print_function
from __future__ import division
from . import _C
import numpy as np
import fuzzytools.files as ftfiles
import fuzzytools.strings as ftstrings
from fuzzytools.datascience.cms import ConfusionMatrix
from fuzzytools.matplotlib.cm_plots import plot_custom_confusion_matrix
import matpl... | 1.8125 | 2 |
vortexasdk/api/onshore_inventory.py | VorTECHsa/python-sdk | 9 | 12769155 | <reponame>VorTECHsa/python-sdk
from dataclasses import dataclass
from typing import Optional
from vortexasdk.api.asset_tank import AssetTank
from vortexasdk.api.serdes import FromDictMixin
from vortexasdk.api.shared_types import ISODate
from vortexasdk.api.id import ID
@dataclass(frozen=True)
class OnshoreInventory(... | 2.5 | 2 |
WebGarageSale/ApplicationGarage/urls.py | dayojohn19/Garage_Sale | 0 | 12769156 | <filename>WebGarageSale/ApplicationGarage/urls.py
from django.urls import path
from . import views
urlpatterns = [
path("", views.index, name="index"),
path("magbenta/", views.magbenta, name="magbenta"),
path("BagongBenta", views.BagongBenta, name="bagongbenta"),
path("KuhainAngListing", views.getList... | 1.898438 | 2 |
homeworks/kirill_shevchuk/lesson11/level04.py | tgrx/Z22 | 0 | 12769157 | <filename>homeworks/kirill_shevchuk/lesson11/level04.py
from homeworks.kirill_shevchuk.lesson11 import level03
class User(level03.User):
def validate(self):
validate_name(self.name)
validate_email(self.email)
email_name = self.email.split("@")[0]
email_adres = self.email.split("@")... | 3.734375 | 4 |
app2/views.py | hazemnossier/multidb | 0 | 12769158 | from django.shortcuts import render
# Create your views here.
from django.shortcuts import render
from .forms import fill_me_form
def fill_view2(request):
if request.method == 'POST':
print('watashi ga kitta 2 ')
form = fill_me_form(request.POST)
if form.is_valid():
data = fo... | 2.328125 | 2 |
matplot.py | buggoing/pythonTools | 0 | 12769159 | #coding: utf8
import matplotlib.pyplot as plt
import math
import numpy as np
xList = range(100)
y1 = [x*x for x in xList]
y2 = [math.sin(x) for x in xList]
y3 = [math.sqrt(x) for x in xList]
def draw():
# plt.plot(y1, 'b-', label='y=x*x')
plt.plot(y2, label='y=sin(x)')
plt.plot(y3, 'r*', label='y=sqrt(... | 3.546875 | 4 |
ARRAYS/Easy/Shuffle the Array/Code.py | HassanRahim26/LEETCODE | 3 | 12769160 | <reponame>HassanRahim26/LEETCODE
#PROBLEM LINK:- https://leetcode.com/problems/shuffle-the-array/
class Solution:
def shuffle(self, nums, n):
v = []
for i in range(n):
v.append(nums[i])
v.append(nums[i+n])
return v
| 3.734375 | 4 |
alacode/migrations/0002_auto_20200116_1512.py | vanatteveldt/alacode | 0 | 12769161 | # Generated by Django 3.0.2 on 2020-01-16 15:12
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('alacode', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='code',
name='q12',
field=mo... | 2.375 | 2 |
tests/test_boundary.py | denisvasilik/binalyzer-template-provider | 0 | 12769162 | <filename>tests/test_boundary.py
"""
test_boundary
~~~~~~~~~~~~~
This module implements tests related to a template's boundary. A boundary
attribute influences the following attributes:
* Offset of current template
* Absolute address of current template
* Size of current template
* Siz... | 2.921875 | 3 |
app/zipcode_jp/models.py | miyagi389/zipcode-ja-python-django | 0 | 12769163 | <reponame>miyagi389/zipcode-ja-python-django
# -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function, unicode_literals
from django.db import models
from django.db.models import Q
from django.utils.encoding import python_2_unicode_compatible
from model_utils.models import TimeStampedMode... | 2.3125 | 2 |
molecule/default/tests/test_default.py | HadrienPatte/ansible-role-deluge | 0 | 12769164 | <filename>molecule/default/tests/test_default.py
import os
import testinfra.utils.ansible_runner
import pytest
testinfra_hosts = testinfra.utils.ansible_runner.AnsibleRunner(
os.environ['MOLECULE_INVENTORY_FILE']).get_hosts('all')
@pytest.mark.parametrize('name', [
('deluged'),
])
def test_package_is_insta... | 2.0625 | 2 |
tamilnlp/WikiByCategory.py | AshokR/TamilNLP | 64 | 12769165 | #!/usr/bin/python3
# -*- coding: utf-8 -*-
from wikiapi import WikiApi
import requests, pprint
# This is suitable for extracting content that is organized by categories and sub-categories
# This code requires the wiki-api python library created by <NAME> of UK
# https://github.com/richardasaurus/wiki-api
# Note that ... | 3.171875 | 3 |
robo_ai/resources/oauth.py | robo-ai/roboai-python-sdk | 0 | 12769166 | <reponame>robo-ai/roboai-python-sdk
import requests
from requests.auth import HTTPBasicAuth
from robo_ai.exception.api_error import ApiError
from robo_ai.exception.invalid_credentials_error import InvalidCredentialsError
from robo_ai.exception.invalid_token_error import InvalidTokenError
from robo_ai.model.auth.access... | 2.6875 | 3 |
middleware/legato/driver/controller/interface/parallel_smc/config/parallel_smc.py | rbryson74/gfx | 0 | 12769167 | # coding: utf-8
##############################################################################
# Copyright (C) 2018 Microchip Technology Inc. and its subsidiaries.
#
# Subject to your compliance with these terms, you may use Microchip software
# and any derivatives exclusively with Microchip products. It is your
# resp... | 1.132813 | 1 |
anvilfs/workloadidentitycredentials.py | anvilproject/fs.anvilfs | 3 | 12769168 | import datetime
from google.auth import credentials
import json
class WorkloadIdentityCredentials(credentials.Scoped, credentials.Credentials):
def __init__(self, scopes):
super(WorkloadIdentityCredentials, self).__init__()
self._scopes = scopes
def with_scopes(self, scopes):
return W... | 2.59375 | 3 |
projects/min_max_average_finder/main.py | PrasadHonrao/python-samples | 3 | 12769169 | input_numbers = input('Enter numbers separated by a space : ').split()
max = int(input_numbers[0])
min = int(input_numbers[0])
avg = 0
sum = 0
for i in range(0, len(input_numbers)):
input_numbers[i] = int(input_numbers[i])
sum = sum + input_numbers[i]
if input_numbers[i] > max:
max = input_nu... | 3.765625 | 4 |
gadget/instrumentation/api/__init__.py | rlnsanz/inspectional-rara-parakeet | 1 | 12769170 | <gh_stars>1-10
from .experiment import *
| 1.070313 | 1 |
mak/build_framework/build/host/windows.py | motor-dev/Motor | 4 | 12769171 | import os
def build(bld):
environ = getattr(bld, 'environ', os.environ)
environ['PATH'] = os.pathsep.join([bld.bldnode.parent.parent.make_node("host/win32/bin").abspath(), environ['PATH']])
if bld.env.PATH:
bld.env.PATH = [bld.bldnode.parent.parent.make_node("host/win32/bin").abspath()] + bld.env.... | 2.09375 | 2 |
pagetools/menus/tests/test_views.py | theithec/pagetools | 0 | 12769172 | <filename>pagetools/menus/tests/test_views.py
from django.test import RequestFactory
from django.views.generic import DetailView
from pagetools.menus.tests import MenuDataTestCase
from pagetools.menus.views import SelectedMenuentriesMixin
from pagetools.tests.test_models import ConcretePublishableLangModel
class Sel... | 2.125 | 2 |
py_paperdb.py | sungcheolkim78/py_paperdb | 0 | 12769173 | <gh_stars>0
""" py_paperdb """
import pandas as pd
import numpy as np
import os
import re
import tqdm
import pickle
import subprocess
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.decomposition import LatentDirichletAllocation
from py_readpaper import Paper
import bibdb
import filedb
fro... | 2.265625 | 2 |
dashboard/migrations/0029_auto_20210818_0515.py | zidandff/primaseru | 0 | 12769174 | # Generated by Django 3.2.5 on 2021-08-18 05:15
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('dashboard', '0028_alter_participantrepayment_payment_1'),
]
operations = [
migrations.AddField(
model_name='participantrepayment... | 1.429688 | 1 |
DenseFusion/tools/train.py | KochPJ/AutoPoseEstimation | 8 | 12769175 | # --------------------------------------------------------
# DenseFusion 6D Object Pose Estimation by Iterative Dense Fusion
# Licensed under The MIT License [see LICENSE for details]
# Written by Chen
# --------------------------------------------------------
import argparse
import os
import random
import time
import... | 1.632813 | 2 |
custom_components/edgeos/managers/config_flow_manager.py | kcleong/homeassistant-config | 0 | 12769176 | <reponame>kcleong/homeassistant-config
import logging
from typing import Optional
from cryptography.fernet import InvalidToken
from homeassistant.config_entries import ConfigEntry
from ..clients.web_api import EdgeOSWebAPI
from ..helpers import get_ha
from ..helpers.const import *
from ..managers.configuration_manag... | 1.984375 | 2 |
opencv_tutorial/opencv_python_tutorials/Image_Processing/hough_line_transfom.py | zeroam/TIL | 0 | 12769177 | <filename>opencv_tutorial/opencv_python_tutorials/Image_Processing/hough_line_transfom.py
# -*- coding: utf-8 -*-
"""
Created on Thu Apr 4 14:52:34 2019
@author: jone
"""
#%%
import cv2
import numpy as np
def nothing(x):
pass
img = cv2.imread('img/chessboard2.jpg')
img = cv2.resize(img, (800, 800))
gray = cv2.c... | 3.34375 | 3 |
Python/control/trajectory_controller.py | hpbader42/Klampt | 1 | 12769178 | <gh_stars>1-10
from controller import BaseController
from klampt.model import trajectory
class TrajectoryController(BaseController):
"""A controller that takes in a trajectory and outputs the position along
the trajectory. If type is a 2-tuple, this will also output the
derivative of the trajectory"""
... | 3.390625 | 3 |
beqcatalogue/__init__.py | bmiller/beqcatalogue | 0 | 12769179 | import csv
import os
import re
from operator import itemgetter
from typing import Tuple
from urllib import parse
import json
from itertools import groupby
from markdown.extensions.toc import slugify
from iir import xml_to_filt
def extract_from_repo(path1: str, path2: str, content_type: str):
'''
extracts b... | 2.53125 | 3 |
galaxytoqrcode.py | chrislintott/GZMaze | 0 | 12769180 | <reponame>chrislintott/GZMaze
import qrcode # get this https://pypi.python.org/pypi/qrcode eg with pip install qrcode
import json
import matplotlib.pyplot as plt
#Set up parameters for getting stuff
url = 'https://panoptes.zooniverse.org/api/subjects?workflow_id=2076&sort=queued'
headers = {'Content-Type':'applicatio... | 2.90625 | 3 |
Ekeopara_Praise/Phase 2/STRINGS/Day33 Tasks/Task3.py | CodedLadiesInnovateTech/-python-challenge-solutions | 6 | 12769181 | '''3. Write a Python program to print the square and cube symbol in the
area of a rectangle and volume of a cylinder.
Sample output:
The area of the rectangle is 1256.66cm2
The volume of the cylinder is 1254.725cm3'''
area = 1256.66
volume = 1254.725
print(f"The area of the rectangle is {round(area, 2)}cm2")
print(f... | 4.4375 | 4 |
tests/apisports/test_client.py | MikeSmithEU/apisports | 0 | 12769182 | import os
from contextlib import contextmanager
from math import ceil
import pytest
import requests
import requests_mock
from apisports import _client_class
from apisports._client import ClientMeta, ClientInitError
from apisports.data import SingleData, NoneData, SimpleData, PagedData
from helpers import assert_respo... | 2.140625 | 2 |
python/data-wrangling-components/tests/engine/test_ungroup.py | microsoft/data-wrangling-components | 4 | 12769183 | #
# Copyright (c) Microsoft. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project.
#
from data_wrangling_components.engine.verbs.groupby import groupby
from data_wrangling_components.engine.verbs.ungroup import ungroup
from data_wrangling_components.types import Step, Verb
fro... | 2.359375 | 2 |
src/mylib/lgb/util.py | murez/mobile-semantic-segmentation | 713 | 12769184 | <reponame>murez/mobile-semantic-segmentation
from typing import List
import pandas as pd
from lightgbm import Booster
def make_imp_df(boosters: List[Booster]) -> pd.DataFrame:
df = pd.concat([
pd.DataFrame({'name': b.feature_name(), 'importance': b.feature_importance()})
for b in boosters
])
... | 2.640625 | 3 |
tests_basic/test_winstonlutz.py | alanphys/pylinac | 0 | 12769185 | <reponame>alanphys/pylinac
import copy
import io
import os.path as osp
import tempfile
from unittest import TestCase
import matplotlib.pyplot as plt
import pylinac
from pylinac import WinstonLutz
from pylinac.winston_lutz import Axis, WinstonLutzResult
from pylinac.core.geometry import Vector, vector_is_close
from te... | 2.109375 | 2 |
django_test/users/urls.py | sdfxisme/lesson21 | 0 | 12769186 | <reponame>sdfxisme/lesson21<filename>django_test/users/urls.py
from django.contrib import admin
from django.urls import path, include
from . import views
from django.contrib.auth.views import LogoutView
app_name = 'users'
urlpatterns = [
path('logout/', LogoutView.as_view(), name='logout'),
path('login/', view... | 1.976563 | 2 |
boxing_py/boxing.py | br-n518/small_games | 0 | 12769187 | #!/usr/bin/env python3
def clear_screen(lines=128):
if not isinstance(lines, int) or lines < 64:
lines = 64
print( '\n' * lines, end='' )
class Player:
def __init__(self, n):
self.score = 0
self.name = n
self.attack1 = ''
self.attack2 = ''
self.guard = ''
... | 3.75 | 4 |
DyCommon/Ui/DyStatsDataFrameTableWidget.py | Leonardo-YXH/DevilYuan | 135 | 12769188 | <filename>DyCommon/Ui/DyStatsDataFrameTableWidget.py
from PyQt5 import QtCore
import pandas as pd
from DyCommon.Ui.DyStatsTableWidget import *
class DyStatsDataFrameTableWidget(DyStatsTableWidget):
"""
只显示DF的列,index需要用户自己转换成列
"""
def __init__(self, df, parent=None):
super().__init__(pare... | 2.609375 | 3 |
gesund_projekt/xps/migrations/0002_xp_datestamp.py | asis2016/gesund-projekt | 0 | 12769189 | <reponame>asis2016/gesund-projekt
# Generated by Django 4.0.1 on 2022-06-05 06:46
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('xps', '0001_initial'),
]
operations = [
migrations.AddField(
model_name='xp',
name... | 1.539063 | 2 |
test.py | elffer/ubi_pingan | 0 | 12769190 | <reponame>elffer/ubi_pingan
# -*- coding:utf8 -*-
import os
import csv
import pandas as pd
import numpy as np
from sklearn.linear_model import LinearRegression
from sklearn.preprocessing import StandardScaler
from sklearn.ensemble import ExtraTreesClassifier
from sklearn.feature_selection import SelectFromModel... | 2.5625 | 3 |
Artesian/Query/_QueryParameters/VersionSelectionType.py | AndreaCuneo/Artesian.SDK-Python | 0 | 12769191 | <filename>Artesian/Query/_QueryParameters/VersionSelectionType.py<gh_stars>0
from enum import Enum
class VersionSelectionType(Enum):
LastN = 1
MUV = 2
LastOfDays = 3
LastOfMonths = 4
Version = 5
MostRecent = 6 | 1.8125 | 2 |
sw/groundstation/groundstation.py | nzjrs/wasp | 2 | 12769192 | #!/usr/bin/env python
import sys
import os.path
import logging
import optparse
if os.name == "posix":
stream = sys.stderr
else:
#when running from py2exe, if anything is printed to stderr
#then the app shows an annoying dialog when closed
stream = sys.stdout
logging.basicConfig(
level=logging.DEBU... | 2.125 | 2 |
setup.py | comfort-framework/comfort-callgraph | 0 | 12769193 | <gh_stars>0
import os
from setuptools import setup, find_packages, Command
class CleanCommand(Command):
"""Custom clean command to tidy up the project root."""
user_options = []
def initialize_options(self):
pass
def finalize_options(self):
pass
def run(self):
os.system... | 1.695313 | 2 |
restfly/__init__.py | AlainODea/restfly | 7 | 12769194 | <reponame>AlainODea/restfly
'''
RESTfly package
'''
from .version import VERSION as __version__ # noqa: F401
from .session import APISession # noqa: F401
from .endpoint import APIEndpoint # noqa: F401
from .iterator import APIIterator # noqa: F401
| 1.039063 | 1 |
wotpy/wot/wot.py | JKRhb/wot-py | 24 | 12769195 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Class that serves as the WoT entrypoint.
"""
import json
import logging
import warnings
import six
import tornado.concurrent
import tornado.gen
import tornado.ioloop
from rx import Observable
from six.moves import range
from tornado.httpclient import AsyncHTTPClient,... | 2.09375 | 2 |
util/addser.py | chriswaudby/pp | 0 | 12769196 | <gh_stars>0
#!/usr/bin/env python
import sys
import argparse
import numpy as np
import nmrglue as ng
parser = argparse.ArgumentParser(description='Sum a collection of bruker ser files. Data will be truncated to fit shortest ser file.')
parser.add_argument('-out', metavar='outputser', dest='out', help='Output filename... | 2.703125 | 3 |
rjgtoys/cli/examples/greeter3.py | bobgautier/rjgtoys-cli | 0 | 12769197 | <filename>rjgtoys/cli/examples/greeter3.py
"""Example tool"""
from rjgtoys.cli import Tool
tool = Tool.from_yaml("""
_package: rjgtoys.cli.examples
say hello: hello.HelloCommand
say goodbye: goodbye.GoodbyeCommand
"""
)
if __name__ == "__main__":
import sys
sys.exit(tool.main())
| 1.484375 | 1 |
examples/demo_project/master_service/app/migrations/0002_fixtures.py | akodelia/django-cqrs | 52 | 12769198 | # Copyright © 2021 Ingram Micro Inc. All rights reserved.
from django.db import migrations
def create_users(apps, schema_editor):
User = apps.get_model('app', 'User')
to_create = []
for username in ('Mal', 'Zoe', 'Wash', 'Inara', 'Jayne', 'Kaylee', 'Simon', 'River'):
to_create.append(User(userna... | 2.0625 | 2 |
last_time/reading_utils.py | abdelabdalla/deepmind-research | 0 | 12769199 | <filename>last_time/reading_utils.py
import functools
import numpy as np
import tensorflow as tf
_FEATURE_DESCRIPTION = {
'velocity': tf.io.VarLenFeature(tf.string)
}
_FEATURE_DTYPES = {
'velocity': {
'in': np.float32,
'out': tf.float32
}
}
_CONTEXT_FEATURES = {
'key': tf.io.FixedLenF... | 2.328125 | 2 |
tests/test_kpm.py | lise1020/pybinding | 159 | 12769200 | <reponame>lise1020/pybinding
import pytest
import numpy as np
import pybinding as pb
from pybinding.repository import graphene, group6_tmd
models = {
'graphene-pristine': [graphene.monolayer(), pb.rectangle(15)],
'graphene-pristine-oversized': [graphene.monolayer(), pb.rectangle(20)],
'graphene-const_pote... | 1.960938 | 2 |
src/autotrainer/custom_vision_tests.py | JasonTheDeveloper/Custom-Vision-Autotrainer | 10 | 12769201 |
import os
import unittest
from azure.cognitiveservices.vision.customvision.training import CustomVisionTrainingClient
from azure.cognitiveservices.vision.customvision.training.models import Project, ImageUrlCreateEntry
from autotrainer.blob.blob_client import LabelledBlob
from autotrainer.custom_vision.custo... | 2.328125 | 2 |
pyranges/methods/coverage.py | iamjli/pyranges | 0 | 12769202 | import numpy as np
import pandas as pd
from ncls import NCLS
def _number_overlapping(scdf, ocdf, **kwargs):
keep_nonoverlapping = kwargs.get("keep_nonoverlapping", True)
column_name = kwargs.get("overlap_col", True)
if scdf.empty:
return None
if ocdf.empty:
if keep_nonoverlapping:
... | 2.390625 | 2 |
fabric_bolt/web_hooks/forms.py | abossard/fabric-bolt | 1 | 12769203 | from django import forms
from django.core.urlresolvers import reverse
from crispy_forms.helper import FormHelper
from crispy_forms.layout import Layout, ButtonHolder, Submit, HTML
from fabric_bolt.web_hooks import models
class HookCreateForm(forms.ModelForm):
button_prefix = "Create"
project = forms.CharF... | 2.234375 | 2 |
draw_boundingbox.py | chao0716/topbag | 0 | 12769204 | # -*- coding: utf-8 -*-
"""
Created on Wed Mar 13 16:51:06 2019
@author: chaoz
"""
import xml.etree.ElementTree as ET
import cv2
import os
import numpy as np
only1=0
kdanfkn=0
total_sc=0
image_dir='C:\\Users\\chaoz\\Desktop\\testset'
sname='RGB.png'
dname='D.png'
xmlname='xml'
RGB_dirlist=[]
depth_dirlist=[]
xml_dir... | 2.40625 | 2 |
pennylane/transforms/classical_jacobian.py | aglitoiu/pennylane | 0 | 12769205 | # Copyright 2018-2021 Xanadu Quantum Technologies 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 applicabl... | 1.953125 | 2 |
ipynb/matter/py-server/save-data-on-site.py | NeuPhysics/codebase | 0 | 12769206 | <reponame>NeuPhysics/codebase
import numpy as np
from scipy.integrate import odeint
from scipy.integrate import ode
import matplotlib.pylab as plt
import csv
import time
endpoint = 1000000000; # integration range
dx = 10.0; # step size
lam0 = 0.845258; # in unit of omegam, omegam = 3.66619*10^-17
dellam = np.array([0... | 2.015625 | 2 |
main.py | noirdevelopment/noirGen | 3 | 12769207 | import os
import sys
import platform
import numpy
import threading
import ctypes
import string
import random
import requests
import json
from colorama import Fore
VALID = 0
INVALID = 0
BOOST_LENGTH = 24
CLASSIC_LENGTH = 16
CODESET = []
BASEURL = "https://discord.gift/"
CODESET[:0] = string.ascii_letters + string... | 2.21875 | 2 |
autodcf/company/income_statement.py | jackmoody11/AutoDCF | 14 | 12769208 | <gh_stars>10-100
import datetime
def now(offset=0):
"""Utility for getting current time or current time minus offset number of years.
Args:
offset (int): Number of years to subtract from current year. Defaults to 0.
Returns:
date (datetime.datetime): Date offset from today by offset numb... | 3.609375 | 4 |
projects/resources/python/benchmark/benchmark_main.py | QiZhou1512/grcuda | 0 | 12769209 | <filename>projects/resources/python/benchmark/benchmark_main.py
import argparse
from distutils.util import strtobool
from bench.bench_1 import Benchmark1
from bench.bench_2 import Benchmark2
from bench.bench_3 import Benchmark3
from bench.bench_4 import Benchmark4
from bench.bench_5 import Benchmark5
from bench.bench_... | 1.921875 | 2 |
ptrello/core/config.py | Ibistylus/ptrello | 0 | 12769210 | <filename>ptrello/core/config.py
#!/usr/bin/env python
import logging
import logging.config
import yaml
import os
logger = logging.getLogger("ptrello."+__name__)
logger.setLevel("DEBUG")
# Check environment variable first:
env_var = os.environ.get("PTRELLO") or ""
# Check home directory second
user_path = os.path.j... | 2.390625 | 2 |
Audit.py | FireSpark142/Unit_4 | 0 | 12769211 | #!/usr/bin/env python
# coding: utf-8
# In[28]:
import xml.etree.cElementTree as ET
from collections import defaultdict
import re
import pprint
OSMFILE = (r"C:\Users\Marcus\Documents\School Documents\Python Environments\Unit_4\sample1percent.osm")
street_type_re = re.compile(r'\b\S+\.?$', re.IGNORECASE)
postcodes_re ... | 3.53125 | 4 |
appion/bin/prepRefineXmippML3D.py | leschzinerlab/myami-3.2-freeHand | 0 | 12769212 | #!/usr/bin/env python
#appion
from appionlib import apPrepXmipp3D
from appionlib import apDisplay
class XmippPrepML3DRefinement(apPrepXmipp3D.XmippPrep3DRefinement):
def setRefineMethod(self):
self.refinemethod = 'xmippml3d'
#=====================
if __name__ == "__main__":
app = XmippPrepML3DRefinement()
app.s... | 2.15625 | 2 |
steps/step28.py | choiking10/mytorch | 0 | 12769213 | <reponame>choiking10/mytorch
import numpy as np
from mytorch import as_variable
from tests.complex_functions import rosenbrock
def ex1():
x0 = as_variable(0.0)
x1 = as_variable(2.0)
y = rosenbrock(x0, x1)
y.backward()
print(x0.grad, x1.grad)
def ex2():
x0 = as_variable(0.0)
x1 = as_varia... | 2.921875 | 3 |
s7.py | matthewmuccio/InterviewPrepKit | 2 | 12769214 | #!/usr/bin/env python3
import math
import os
# Complete the minimumPasses function below.
def minimumPasses(m, w, p, t):
iter = 0
coins = 0
def new_infra(n_items):
new_machines = m
new_workers = w
delta = max(new_machines, new_workers) - min(new_machines, new_workers)
de... | 3.203125 | 3 |
models/linear_models.py | clabrugere/numpy-basics | 1 | 12769215 | import numpy as np
class RidgeRegression:
def __init__(self, bias=True, weight_l2=1e-3, scale=True):
self.bias = bias
self.weight_l2 = weight_l2
self.weights = None
self.scale = scale
def _scale(self, X):
return (X - self._min) / (self._max - self._mi... | 2.875 | 3 |
app/migrations/0002_jobapplicants.py | AyazSaiyed/Yudibot | 0 | 12769216 | # Generated by Django 3.0.5 on 2021-01-13 10:21
from django.db import migrations, models
import django.utils.timezone
import uuid
class Migration(migrations.Migration):
dependencies = [
('app', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='JobApplicants',
... | 1.875 | 2 |
ResultEvaluation.py | adakasky/PROFILE | 0 | 12769217 | <gh_stars>0
import codecs
from BeautifulSoup import BeautifulSoup as bs
import requests
import unicodedata
import time
url = 'https://www.google.com/search?q='
def strip_accents(s):
return ''.join(c for c in unicodedata.normalize('NFD', s)
if unicodedata.category(c) != 'Mn')
if __name__ == ... | 2.890625 | 3 |
Django/board_project/board/admin.py | sug5806/TIL | 0 | 12769218 | <gh_stars>0
from django.contrib import admin
from .models import Category
from .models import Document
from .models import Board
from .models import Comment
# Register your models here.
class BoardOption(admin.ModelAdmin):
list_display = ['id', 'name', 'slug', ]
prepopulated_fields = {'slug': ('name',)}
ad... | 2.125 | 2 |
Yello/core/dataset/sequence.py | teecha/Autonomous_Tello_Drone | 10 | 12769219 | # -*- coding: utf-8 -*-
import numpy as np
from tensorflow.keras.utils import Sequence
from core.dataset import augment
from core.image import read_image, preprocess_image
from core.utils import decode_annotation, decode_name
class Dataset(Sequence):
def __init__(self, cfg, verbose=0):
self.verbose = v... | 2.703125 | 3 |
setup.py | heylouiz/scrapy-sticky-meta-params | 2 | 12769220 | from setuptools import setup
from scrapy_sticky_meta_params import __version__
with open("README.md") as f:
readme = f.read()
setup(
name="scrapy-sticky-meta-params",
version=__version__,
license="MIT license",
description="A spider middleware that forwards meta params through subsequent requests... | 1.578125 | 2 |
changeInPoolSize.py | triesch/synaptic-competition | 0 | 12769221 | #!/usr/bin/env python
# Simple model of receptors diffusing in and out of synapses.
# Simulation of the Dynamcis with the Euler method.
# This simulates the effect of a sudden change in the pool size
#
# <NAME>, January-April 2017
import numpy as np
from matplotlib import pyplot as plt
# parameters
N = 3 ... | 3.296875 | 3 |
ava_asd/activitynet_evaluate.py | tuanchien/asd | 18 | 12769222 | <reponame>tuanchien/asd
# The MIT License (MIT)
#
# Copyright (c) 2015 ActivityNet
#
# 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 righ... | 1.46875 | 1 |
utilities/dashboard/create_dashboard_data.py | covid-19-impact-lab/covidlab-utilities | 2 | 12769223 | <reponame>covid-19-impact-lab/covidlab-utilities<filename>utilities/dashboard/create_dashboard_data.py
from utilities.dashboard.components.intro_page.create_data import create_intro_page_data
from utilities.dashboard.components.run_charts.create_data import create_run_charts_data
from utilities.dashboard.components.box... | 2.21875 | 2 |
dreimac/circularcoords.py | ErnstRoell/ImageAnalysis | 12 | 12769224 | import subprocess
import os
import numpy as np
import matplotlib.pyplot as plt
from mpl_toolkits.mplot3d import Axes3D
from mpl_toolkits.mplot3d import proj3d
import scipy
from scipy.sparse.linalg import lsqr
import time
from matplotlib.offsetbox import OffsetImage, AnnotationBbox
from matplotlib.widgets import Slider,... | 2.203125 | 2 |
bam2fastx/fasta.py | czbiohub/bam2fastx | 0 | 12769225 | # Import modified 'os' module with LC_LANG set so click doesn't complain
from .os_utils import os # noqa: F401
from collections import defaultdict
import click
DELIMITER = "X"
FASTA_PREFIX = "aligned_sequences"
CELL_BARCODE = 'CB'
UMI = 'UB'
BAM_FILENAME = 'possorted_genome_bam.bam'
BARCODES_TSV = 'barcodes.tsv'
... | 2.328125 | 2 |
gtk/13_radioButton.py | ehbc221/thenewboston-python | 0 | 12769226 | <reponame>ehbc221/thenewboston-python
from gi.repository import Gtk
class RadioButtonWindow(Gtk.Window):
def __init__(self):
Gtk.Window.__init__(self, title="RadioButton Demo")
self.set_border_width(10)
hbox = Gtk.Box(spacing=6)
self.add(hbox)
button1 = Gtk.RadioButton.n... | 2.875 | 3 |
django_cradmin/viewhelpers/formview/createview.py | appressoas/django_cradmin | 11 | 12769227 | <filename>django_cradmin/viewhelpers/formview/createview.py
import urllib.parse
from django.utils.translation import gettext_lazy
from django.views.generic import CreateView as DjangoCreateView
from django_cradmin import javascriptregistry
from django_cradmin.viewhelpers.mixins import CommonCradminViewMixin
from . im... | 2.21875 | 2 |
networkx-d3-v2/lib/appengine_sessions/backends/db.py | suraj-testing2/Clock_Websites | 0 | 12769228 | """ Fix Django's 'write-through' (cache and datastore storage) session
backend to work with Appengine's datastore, along with whatever cache
backend is in settings.
Basically a reworking of django.contrib.sessions.backends.db, so have
a look there for definitive docs.
"""
from google.appengine.ext import ndb
from app... | 2.53125 | 3 |
grab/spider/transport/multicurl.py | gonchik/grab | 0 | 12769229 | import pycurl
import select
import six
import logging
from threading import Lock
from grab.error import GrabTooManyRedirectsError
ERROR_TOO_MANY_REFRESH_REDIRECTS = -2
#ERROR_INTERNAL_GRAB_ERROR = -3
ERROR_ABBR = {
ERROR_TOO_MANY_REFRESH_REDIRECTS: 'too-many-refresh-redirects',
#ERROR_INTERNAL_GRAB_ERROR: 'in... | 2.171875 | 2 |
main.py | sivavenub/attention | 0 | 12769230 | <reponame>sivavenub/attention
import torch
from trainer import Trainer
from config import get_config
from utils import prepare_dirs, save_config
from data_loader import get_test_loader, get_train_valid_loader
def main(config):
# ensure directories are setup
prepare_dirs(config)
# ensure reproducibility... | 2.140625 | 2 |
opening_screen.py | krinskils/chess | 2 | 12769231 | import pygame
import screen
import os
import socket
import protocol
import logging
from screen import *
clock = pygame.time.Clock()
BACKGROUND_IMAGE_PATH = os.path.join(PICTURES_PATH, 'opening_screen_picture.png')
bg_image = pygame.image.load(BACKGROUND_IMAGE_PATH)
bg_image = pygame.transform.scale(bg_image, (SCREEN_... | 2.578125 | 3 |
src/viur/ext/tasks/clear_kind.py | XeoN-GHMB/viur_ext | 1 | 12769232 | <filename>src/viur/ext/tasks/clear_kind.py<gh_stars>1-10
import logging, safeeval
from viur.core import errors, utils, skeleton, tasks
from viur.core.bones import baseBone, selectBone, stringBone
@tasks.CallableTask
class TaskClearKind(tasks.CallableTaskBase):
key = "clearKind"
name = "Clear all entities of a... | 2.109375 | 2 |
input_output.py | mixanik379/python_lesson_2 | 0 | 12769233 | # однострочный комментарий
'''
первая строка
вторая строка
'''
print('Hello!')
print('Hello!', 'student!', 123, sep='xxx')
print('Hello!', 'student!', 123, end='yyy')
print()
# Ввод
age = input('Input your age')
print(age, type(age))
print(int(age), type(int(age)))
'''
print(1+1, 'student', sep='yyy', end='!'... | 4.1875 | 4 |
src/plugins_/cfdocs/__init__.py | jcberquist/sublimetext-cfml | 130 | 12769234 | <filename>src/plugins_/cfdocs/__init__.py
from .. import plugin
from .cfdocs import (
get_inline_documentation,
get_completion_docs,
get_goto_cfml_file
)
class CFMLPlugin(plugin.CFMLPlugin):
def get_completion_docs(self, cfml_view):
return get_completion_docs(cfml_view)
def get_inline_do... | 1.75 | 2 |
source/interstate_love_song/plugins/simple.py | ilpvfx/interstate_love_song | 9 | 12769235 | from dataclasses import dataclass
import dataclasses
import argparse
from hashlib import pbkdf2_hmac
from typing import Mapping, Any
from interstate_love_song.mapping.base import *
def hash_pass(s: str, salt="IGNORED"):
"""Hash a password.
Not the best way to store a password since the salt is known, but i... | 3.25 | 3 |
multirotor example/optimization paper demonstration/check_flight_script.py | DesignEngrLab/fmdkit | 8 | 12769236 | <gh_stars>1-10
# -*- coding: utf-8 -*-
"""
Created on Fri Sep 11 10:23:55 2020
@author: <NAME>
"""
from drone_opt import *
import fmdtools.faultsim.propagate as propagate
import fmdtools.resultdisp.graph as graph
mdl_med = x_to_mdl([1,1,80,1,1])
calc_oper(mdl_med)
endresults_med, resgraph, mdlhist_med =propagate.nom... | 1.929688 | 2 |
dissonance/storage/redis.py | jhgg/dissonance | 5 | 12769237 | from collections import UserDict
from six import StringIO
from gevent.lock import Semaphore
from ..utils.importing import import_dotted_path
try:
from cPickle import Unpickler, Pickler
except ImportError:
from pickle import Unpickler, Pickler
try:
StrictRedis = import_dotted_path('redis.StrictRedis')
ex... | 2.125 | 2 |
openbot/plugin.py | jcb1317/OpenBot | 0 | 12769238 | class Plugin(object):
"""
Plugin Base Class
Meant to be inherited for plugins
"""
def __init__(self):
self._commands = {}
def command(self, name, **kwargs):
"""
Decorator to register a coroutine to a plugin command
:param name: Command Name
:return:
... | 3.25 | 3 |
hmcdashboard/common.py | hayesall/hmc-dashboard | 0 | 12769239 | <filename>hmcdashboard/common.py
# Copyright 2022 <NAME>
# MIT License
from collections import namedtuple
from functools import lru_cache
import json
from pathlib import Path
import pandas as pd
import plotly
import plotly.graph_objects as go
from plotly import subplots
# A "View" is a slice of user data with a
# ... | 2.53125 | 3 |
pulse/app.py | emptymalei/social-pulse | 7 | 12769240 | import click
from pulse import Config
from douban import DoubanInterest, DoubanStatus
from github import GitHub
from loguru import logger
from pulse import CombinedPulse
@click.command()
@click.option("-c", "--config", type=click.Path(), help="Path to config")
def pulse(config):
conf = Config(config)
logger.... | 2.21875 | 2 |
year2020/day2/part2.py | kalaspuff/advent-of-code | 0 | 12769241 | <filename>year2020/day2/part2.py
from helpers import int_minus
from values import values
async def run():
for pos_1, pos_2, char, password in values.match_rows(r"^([0-9]+)-([0-9]+) (.): (.*)$", (int_minus, int_minus)):
if bool(password[pos_1] == char) ^ bool(password[pos_2] == char):
values.co... | 2.953125 | 3 |
dogesay/script.py | jinnovation/dogesay | 10 | 12769242 | from argparse import ArgumentParser
import pkgutil
import random
from random import randrange, choice
DOGE_PREFIXES = ["such", "much", "so", "many", "wow", "very"]
DOGE_EJACULATES = ["wow"]
WOW_CHANCE = 8
MAX_WHITESPACE = 15
MIN_WHITESPACE = 2
def doge_syntax(clause):
return clause if len(clause.split())>1 e... | 2.609375 | 3 |
yoapi/models/status.py | YoApp/yo-api | 1 | 12769243 | <filename>yoapi/models/status.py
# -*- coding: utf-8 -*-
"""Status model"""
from flask_mongoengine import Document
from mongoengine import StringField
from .helpers import DocumentMixin, ReferenceField
from yoapi.models import User
class Status(DocumentMixin, Document):
meta = {'collection': 'status',
... | 2.15625 | 2 |
networks/model.py | HighCWu/anime_biggan_toy | 140 | 12769244 | <reponame>HighCWu/anime_biggan_toy
import numpy as np
import paddle.fluid as fluid
from paddle.fluid import layers, dygraph as dg
from paddle.fluid.initializer import Normal, Constant, Uniform
class ModelCache(object):
G = None
D = None
train_mode = False
initialized = False
model_cache = ModelCache
... | 2.796875 | 3 |
StrategyResearch/ma5_ma10.py | webclinic017/stock_quant | 1 | 12769245 | # !/usr/bin/env python
# -*- coding:utf-8 -*-
# @Project : stock_quant
# @Date : 2021/12/19 16:27
# @Author : Adolf
# @File : ma5_ma10.py
# @Function:
import pandas as pd
import pandas_ta as ta
from GetBaseData.hanle_data_show import get_show_data
from Utils.ShowKline.base_kline import draw_chart
pd.set_option(... | 2.421875 | 2 |
onfido/urls.py | snicks1/django-onfido | 0 | 12769246 | <reponame>snicks1/django-onfido
# -*- coding: utf-8 -*-
"""onfido urls."""
from django.conf.urls import url
from onfido.views import status_update
urlpatterns = [
url(r'^webhook/$', status_update, name='status_update'),
]
| 1.382813 | 1 |
pypoll.py | jzebker/Election_Analysis | 0 | 12769247 | #data we need:
#1) total votes cast
#2) list of all aandidates who received votes
#3) percentage of votes each candidate won
#4) number of votes each candidate won
#5) winner of the election based on popular vote
import os
import csv
#assign variable to csv
file_to_load = "../Resources/election_results.csv"
#assign var... | 3.8125 | 4 |
tune.py | HuicheolMoon/P4_ModelOptimization | 0 | 12769248 | import argparse
import copy
import optuna
import os
from datetime import datetime
import torch
import torch.nn as nn
import torch.optim as optim
from src.dataloader import create_dataloader
from src.model import Model
from src.utils.torch_utils import model_info
from src.utils.common import read_yaml
from src.utils.mac... | 1.992188 | 2 |
card_generate.py | minfun/OralCardGenerator | 0 | 12769249 | """
1. 选择题型
普通算式 x +/-/*// y
类型算式1 x +/- y +/- z
类型算式2 x +/- y * z
类型算式3 x +/- y / z
2. 选择题量
3. 生成题目 / 打印题目
"""
import random
import wx
import os
import time
from student import math1, math2, math3, math4
'''
frame(窗口):带标题和边框的最顶层窗体
panel(面板):容器类,提供空间放其他组件,包括其他panel
'''
math_list = [math1, math2, math... | 2.96875 | 3 |
venv/lib/python3.6/site-packages/mypy/version.py | humphrey-mutuma/Awards | 2 | 12769250 | <filename>venv/lib/python3.6/site-packages/mypy/version.py
__version__ = "0.720"
| 1.007813 | 1 |