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 |
|---|---|---|---|---|---|---|
skyportal/plot.py | dannygoldstein/skyportal | 0 | 12700 | import numpy as np
import pandas as pd
from bokeh.core.json_encoder import serialize_json
from bokeh.core.properties import List, String
from bokeh.document import Document
from bokeh.layouts import row, column
from bokeh.models import CustomJS, HoverTool, Range1d, Slider, Button
from bokeh.models.widgets import Check... | 1.734375 | 2 |
lib/session.py | Hiteshsuhas/err-stackstorm | 15 | 12701 | # coding:utf-8
import uuid
import string
import hashlib
import logging
from lib.errors import SessionExpiredError, SessionConsumedError
from datetime import datetime as dt
from random import SystemRandom
LOG = logging.getLogger("errbot.plugin.st2.session")
def generate_password(length=8):
rnd = SystemRandom()
... | 2.5 | 2 |
junopy/entities/bill.py | robertons/junopy | 3 | 12702 | <filename>junopy/entities/bill.py
# -*- coding: utf-8 -*-
from .lib import *
class Bill(JunoEntity):
def __init__(cls, **kw):
cls.__route__ = '/bill-payments'
cls.__metadata__ = {}
# FIELDS
cls.id = String(max=80)
cls.digitalAccountId = String(max=100)
cls.billType = ObjList(context=cls, key='status', ... | 2.171875 | 2 |
accounts/signals.py | julesc00/challenge | 0 | 12703 | <gh_stars>0
from django.db.models.signals import post_save
from django.contrib.auth.signals import user_logged_in, user_logged_out, user_login_failed
from django.contrib.auth.models import User
from django.contrib.auth.models import Group
from django.dispatch import receiver
from .models import Usuario, LoginLog
def... | 2.203125 | 2 |
Python Scripting/Python - POC-3/DvdApp.py | vaibhavkrishna-bhosle/Trendnxt-Projects | 0 | 12704 | <reponame>vaibhavkrishna-bhosle/Trendnxt-Projects<filename>Python Scripting/Python - POC-3/DvdApp.py
import mysql.connector
from mysql.connector.errors import ProgrammingError
from mysql.connector import Error
from DvdOperations import DvdStore
database = "db4"
def CreateDatabase(database):
mydb = mysql.connector... | 3.078125 | 3 |
cloudshell/rest/api.py | QualiSystems/cloudshell-rest-api | 1 | 12705 | <reponame>QualiSystems/cloudshell-rest-api
#!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import json
try:
import urllib2
except:
import urllib.request as urllib2
from requests import delete, get, post, put
from cloudshell.rest.exceptions import ShellNotFoundException, FeatureUnavailable
class Packagin... | 2.59375 | 3 |
data/scripts/classes/team_row.py | matt-waite/lol-reference | 1 | 12706 | <reponame>matt-waite/lol-reference
from classes import oracles_headers
class TeamRow:
COLUMNS = oracles_headers.oracles_columns
def __init__(self, row):
self.ROW = row
def GetCell(self, name):
return self.ROW[self.COLUMNS[name]]
def GetDatabaseObject(self):
game = {
... | 3.1875 | 3 |
startup/97-standard-plans.py | MikeHart85/SIX_profile_collection | 0 | 12707 | def pol_V(offset=None):
yield from mv(m1_simple_fbk,0)
cur_mono_e = pgm.en.user_readback.value
yield from mv(epu1.table,6) # 4 = 3rd harmonic; 6 = "testing V" 1st harmonic
if offset is not None:
yield from mv(epu1.offset,offset)
yield from mv(epu1.phase,28.5)
yield from mv(pgm.en,cur_mon... | 2.375 | 2 |
speechpro/cloud/speech/synthesis/rest/cloud_client/api/__init__.py | speechpro/cloud-python | 15 | 12708 | from __future__ import absolute_import
# flake8: noqa
# import apis into api package
import speechpro.cloud.speech.synthesis.rest.cloud_client.api.session_api
import speechpro.cloud.speech.synthesis.rest.cloud_client.api.synthesize_api
| 1.101563 | 1 |
learn_pyqt5/checkable_bar.py | liusong-cn/python | 1 | 12709 | # _*_ coding:utf-8 _*_
# author:ls
# time:2020/3/19 0019
import sys
from PyQt5.QtWidgets import QApplication,QAction,QMainWindow
from PyQt5.QtGui import QIcon
class Example(QMainWindow):
def __init__(self):
super().__init__()
self.setui()
def setui(self):
self.statusbar = self.statusB... | 2.640625 | 3 |
service/test.py | ksiomelo/cubix | 3 | 12710 | <reponame>ksiomelo/cubix<gh_stars>1-10
#!/usr/bin/env python
import pika
import time
import json
import StringIO
#from fca.concept import Concept
from casa import Casa
#from fca.readwrite import cxt
def read_cxt_string(data):
input_file = StringIO.StringIO(data)
assert input_file.readline().strip() == "B",\
... | 2.125 | 2 |
src/nia/selections/rank.py | salar-shdk/nia | 8 | 12711 | from .selection import Selection
import numpy as np
class Rank(Selection):
@Selection.initializer
def __init__(self, size=20):
pass
def select(self, population, fitness):
indexes = fitness.argsort()
return (population[indexes])[:self.size], (fitness[indexes])[:self.size]
| 2.984375 | 3 |
app.py | juergenpointinger/status-dashboard | 0 | 12712 | # Standard library imports
import logging
import os
# Third party imports
import dash
import dash_bootstrap_components as dbc
from flask_caching import Cache
import plotly.io as pio
# Local application imports
from modules.gitlab import GitLab
import settings
# Initialize logging mechanism
logging.bas... | 2.171875 | 2 |
tests/scanner/test_data/fake_retention_scanner_data.py | ogreface/forseti-security | 0 | 12713 | <reponame>ogreface/forseti-security<filename>tests/scanner/test_data/fake_retention_scanner_data.py
# Copyright 2018 The Forseti Security 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 ... | 1.6875 | 2 |
libsonyapi/camera.py | BugsForDays/libsonyapi | 13 | 12714 | import socket
import requests
import json
import xml.etree.ElementTree as ET
class Camera(object):
def __init__(self):
"""
create camera object
"""
self.xml_url = self.discover()
self.name, self.api_version, self.services = self.connect(self.xml_url)
self.camera_end... | 3 | 3 |
utility_functions_flu.py | neherlab/treetime_validation | 4 | 12715 | <reponame>neherlab/treetime_validation
#!/usr/bin/env python
"""
This module defines functions to facilitate operations with data specific
to Flu trees and alignments.
"""
import numpy as np
from Bio import AlignIO, Phylo
from Bio.Align import MultipleSeqAlignment
import random
import subprocess
import datetime
impor... | 2.65625 | 3 |
python/632.smallest-range-covering-elements-from-k-lists.py | stavanmehta/leetcode | 0 | 12716 | class Solution:
def smallestRange(self, nums: List[List[int]]) -> List[int]:
| 2.296875 | 2 |
add_label.py | Mause/pull_requests | 0 | 12717 | from asyncio import get_event_loop
from dataclasses import dataclass, field
from typing import Dict, List, Optional, Union
from aiohttp import ClientSession
from pydantic import BaseModel
from sgqlc.endpoint.base import BaseEndpoint
from sgqlc.operation import Operation
from sgqlc_schemas.github.schema import (
Ad... | 2.140625 | 2 |
DataEngineering/Chapter7/7.6/financialdata/financialdata/scheduler.py | yz830620/FinMindBook | 5 | 12718 | <gh_stars>1-10
import time
import datetime
from apscheduler.schedulers.background import BackgroundScheduler
from financialdata.producer import Update
from loguru import logger
def sent_crawler_task():
# 將此段,改成發送任務的程式碼
# logger.info(f"sent_crawler_task {dataset}")
today = datetime.datetime.today().date()... | 2.4375 | 2 |
openmc_plasma_source/plotting/plot_tokamak_source.py | mdfaisal98/openmc-plasma-source | 0 | 12719 | <reponame>mdfaisal98/openmc-plasma-source
import matplotlib.pyplot as plt
from matplotlib import cm
import numpy as np
def scatter_tokamak_source(source, quantity=None, **kwargs):
"""Create a 2D scatter plot of the tokamak source.
See https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.scatter.html
... | 3.015625 | 3 |
Exercício feitos pela primeira vez/ex046.py | Claayton/pythonExerciciosLinux | 1 | 12720 | #Exercício046
from time import sleep
import emoji
print('\033[32mCONTAGEM REGRESSIVA PARA O ANO NOVO:\033[m')
sleep(1)
for c in range(10, 0 - 1, -1):#repete os números de 10 até o 0
print(c)
sleep(1)
print(emoji.emojize("\033[31m:boom::boom::boom:KABUM:boom::boom::boom:", use_aliases=True))
print(emoji.emojize(... | 3.09375 | 3 |
bmds/bmds2/logic/rules.py | shapiromatron/bmds | 2 | 12721 | import abc
import math
from ... import constants
class Rule(abc.ABC):
def __init__(self, failure_bin, **kwargs):
self.failure_bin = failure_bin
self.enabled = kwargs.get("enabled", True)
self.threshold = kwargs.get("threshold", float("nan"))
self.rule_name = kwargs.get("rule_name"... | 3.015625 | 3 |
nets/static/conv_rnn_convT.py | MaximilienLC/nevo | 0 | 12722 | <filename>nets/static/conv_rnn_convT.py
# Copyright 2022 <NAME>.
#
# 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 appl... | 2.34375 | 2 |
ors2bryton.py | andbue/ors2bryton | 0 | 12723 | <reponame>andbue/ors2bryton
from sys import argv
from os.path import splitext
from lxml import etree
from struct import pack
def main():
print(argv)
gpx = argv[1]
"""
bryton:
1: go ahead
2: right
3: left
4: slight right
5: slight left
6: close rig... | 2.625 | 3 |
src/main/python/smart/smartplots3_run.py | cday97/beam | 123 | 12724 | import pandas as pd
import smartplots3_setup
def createSetup(name,expansion_factor,percapita_factor,plot_size,settings):
plt_setup_smart={
'name': name,
'expansion_factor':expansion_factor,
'percapita_factor':percapita_factor,
'scenarios_itr': [],
'scenarios_id':[],
... | 2.46875 | 2 |
genrl/deep/agents/sac/__init__.py | ajaysub110/JigglypuffRL | 0 | 12725 | <gh_stars>0
from genrl.deep.agents.sac.sac import SAC # noqa
| 0.976563 | 1 |
contrib/libs/cxxsupp/libsan/generate_symbolizer.py | HeyLey/catboost | 6,989 | 12726 | import os
import sys
def main():
print 'const char* ya_get_symbolizer_gen() {'
print ' return "{}";'.format(os.path.join(os.path.dirname(sys.argv[1]), 'llvm-symbolizer'))
print '}'
if __name__ == '__main__':
main()
| 1.664063 | 2 |
scripts/scheduler/scheduler.py | OCHA-DAP/hdx-scraper-unosat-flood-portal | 1 | 12727 | #!/usr/bin/python
# -*- coding: utf-8 -*-
import os
import sys
import time
import schedule
dir = os.path.split(os.path.split(os.path.realpath(__file__))[0])[0]
sys.path.append(dir)
from utilities.prompt_format import item
from unosat_flood_portal_collect import collect as Collect
def Wrapper(patch=False):
'''Wrap... | 2.359375 | 2 |
grAdapt/sampling/initializer/Vertices.py | mkduong-ai/grAdapt | 25 | 12728 | # python
# import warnings
# Third party imports
import numpy as np
# grAdapt
from .base import Initial
from grAdapt.utils.sampling import sample_corner_bounds
class Vertices(Initial):
"""
Samples vertices if n_evals >= 2 ** len(bounds).
Else low discrepancy sequences are sampled.
"""
def __ini... | 2.921875 | 3 |
thirdweb/modules/base.py | princetonwong/python-sdk | 1 | 12729 | <reponame>princetonwong/python-sdk
"""Base Module."""
from abc import ABC, abstractmethod
from typing import Callable, Dict, List, Optional, Union, cast
from eth_account.account import LocalAccount
from thirdweb_web3 import Web3
from thirdweb_web3.types import TxReceipt
from zero_ex.contract_wrappers import TxParams
... | 1.992188 | 2 |
data_util.py | shiyu-wangbyte/leadopt | 0 | 12730 | # Copyright 2021 <NAME>
# 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, software
#... | 2.34375 | 2 |
add_socket_response_event.py | Kur0den/kur0bot | 1 | 12731 | <reponame>Kur0den/kur0bot<gh_stars>1-10
from discord.gateway import DiscordWebSocket, utils, _log, KeepAliveHandler, ReconnectWebSocket
async def received_message(self, msg, /):
if type(msg) is bytes:
self._buffer.extend(msg)
if len(msg) < 4 or msg[-4:] != b'\x00\x00\xff\xff':
r... | 2.25 | 2 |
Image_detection_codes/Keras_training/test2.py | pasadyash/CitizenServiceApp | 0 | 12732 | import numpy as np
np.random.seed(123) # for reproducibility
from keras.models import Sequential
from keras.layers import Dense, Dropout, Activation, Flatten
from keras.layers import Convolution2D, MaxPooling2D
from keras.utils import np_utils
from dataset_pothole import pothole
from keras.models import model_from_j... | 2.890625 | 3 |
platform/web/api/device/models.py | JMSHDev/regent.dev | 1 | 12733 | import hashlib
import random
import string
import logging
from django.db import models
LOG = logging.getLogger(__name__)
class Device(models.Model):
name = models.CharField(max_length=50, unique=True)
customer = models.CharField(max_length=50)
agent_status = models.CharField(max_length=10, default="off... | 2.25 | 2 |
armageddon/__init__.py | acse-ns1321/asteroid-impact-simulator | 0 | 12734 | # flake8:NOQA
"""Python asteroid airburst calculator"""
from .solver import *
from .damage import *
from .locator import *
from .mapping import *
| 1.070313 | 1 |
proxy_server/backend_services.py | lmanzurv/django_proxy_server | 11 | 12735 | from django.contrib.auth import SESSION_KEY
from django.core.cache import cache
from django.conf import settings
from django.http import HttpResponse, HttpResponseServerError
from proxy_server.response import AJAX_REQUEST
import httplib, json, proxy_server
def invoke_backend_service(method, function_path, json_data=di... | 2.109375 | 2 |
py/trawl_analyzer/TrawlSensorsDB_model.py | nwfsc-fram/pyFieldSoftware | 0 | 12736 | <reponame>nwfsc-fram/pyFieldSoftware<gh_stars>0
# from peewee import *
from playhouse.apsw_ext import TextField, IntegerField, PrimaryKeyField
from py.trawl_analyzer.Settings import SensorsModel as BaseModel
# database = SqliteDatabase('data\clean_sensors.db', **{})
class UnknownField(object):
def __init__(self... | 2.171875 | 2 |
src/statemachine.py | CEOAI-ABM/SIR-Modelling | 1 | 12737 | import transitions
from functools import partial
# from transitions import transitions.Machine
# TODO: whenever there is a state chage store the following
# (DAY,function_called) -> Stored for every person for agent status, state and Testing state
class AgentStatusA(object):
"""The Statemachine of the agent"""
stat... | 3.046875 | 3 |
hard-gists/5898352/snippet.py | jjhenkel/dockerizeme | 21 | 12738 | <gh_stars>10-100
import os
import scipy.io.wavfile as wav
# install lame
# install bleeding edge scipy (needs new cython)
fname = 'XC135672-Red-winged\ Blackbird1301.mp3'
oname = 'temp.wav'
cmd = 'lame --decode {0} {1}'.format( fname,oname )
os.system(cmd)
data = wav.read(oname)
# your code goes here
print len(data[1])... | 2.3125 | 2 |
examples/home-assistant/custom_components/evacalor/config_flow.py | fredericvl/pyevacalor | 2 | 12739 | """Config flow for Eva Calor."""
from collections import OrderedDict
import logging
import uuid
from pyevacalor import ( # pylint: disable=redefined-builtin
ConnectionError,
Error as EvaCalorError,
UnauthorizedError,
evacalor,
)
import voluptuous as vol
from homeassistant import config_entries
from h... | 2.15625 | 2 |
library_samples/Python3/ocs_sample_library_preview/Dataview/Dataview.py | osi-awoodall/OSI-Samples-OCS | 0 | 12740 | # Dataview.py
#
import json
from .DataviewQuery import DataviewQuery
from .DataviewMapping import DataviewMapping
from .DataviewIndexConfig import DataviewIndexConfig
from .DataviewGroupRule import DataviewGroupRule
class Dataview(object):
"""
Dataview definition
"""
def __init__(
self,
... | 2.453125 | 2 |
PYTHON_Code/TestGUI.py | ROBO-BEV/BARISTO | 8 | 12741 | <gh_stars>1-10
from tkinter import *
window0 = Tk()
window0.geometry('960x540')
#tk.iconbitmap(default='ROBO_BEV_LOGO.ico')
window0.title("BARISTO")
photo = PhotoImage(file="Page1.png")
widget = Label(window0, image=photo)
widget.photo = photo
widget = Label(window0, text="10", fg="white", font=("Source Sans Pro",5... | 2.984375 | 3 |
handlers/play.py | AftahBagas/AlphaMusik | 0 | 12742 | from os import path
from telethon import Client
from telethon.types import Message, Voice
from callsmusic import callsmusic, queues
import converter
from downloaders import youtube
from config import BOT_NAME as bn, DURATION_LIMIT
from helpers.filters import command, other_filters
from helpers.decorators import err... | 2.328125 | 2 |
Sindri/Properties.py | mrcsbrn/TCC_software | 11 | 12743 | <filename>Sindri/Properties.py
from __future__ import annotations
from constants import DBL_EPSILON
class DeltaProp(object):
def __init__(self, cp: float, h: float, s: float, g: float, u: float, a: float):
self.Cp = cp
self.H = h
self.S = s
self.G = g
self.U = u
se... | 2.875 | 3 |
algorithms/randcommuns.py | eXascaleInfolab/clubmark | 14 | 12744 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:Brief: Produces rand disjoint communities (clusters) for the given network with sizes similar in the ground truth.
:Description:
Takes number of the resulting communities and their sizes from the specified groundtruth (actually any sample
of the community structure, ... | 2.53125 | 3 |
utils/save_atten.py | xiaomengyc/SPG | 152 | 12745 | <reponame>xiaomengyc/SPG
import numpy as np
import cv2
import os
import torch
import os
import time
from torchvision import models, transforms
from torch.utils.data import DataLoader
from torch.optim import SGD
from torch.autograd import Variable
idx2catename = {'voc20': ['aeroplane','bicycle','bird','boat','bottle','... | 2.109375 | 2 |
integration/config/service_names.py | hawflau/serverless-application-model | 0 | 12746 | <gh_stars>0
COGNITO = "Cognito"
SERVERLESS_REPO = "ServerlessRepo"
MODE = "Mode"
XRAY = "XRay"
LAYERS = "Layers"
HTTP_API = "HttpApi"
IOT = "IoT"
CODE_DEPLOY = "CodeDeploy"
ARM = "ARM"
GATEWAY_RESPONSES = "GatewayResponses"
MSK = "MSK"
KMS = "KMS"
CWE_CWS_DLQ = "CweCwsDlq"
CODE_SIGN = "CodeSign"
MQ = "MQ"
USAGE_PLANS =... | 1.320313 | 1 |
tools/onnx_utilis/export_vfe_weight.py | neolixcn/OpenPCDet | 0 | 12747 | import onnx
import onnxruntime
import torch
import onnx.numpy_helper
# added by huxi, load rpn config
from pcdet.pointpillar_quantize_config import load_rpn_config_json
# ========================================
config_dict = load_rpn_config_json.get_config()
onnx_model_file = config_dict["vfe_onnx_file"]
onnx_mode... | 1.914063 | 2 |
color_extractor/cluster.py | hcoura/color-extractor | 276 | 12748 | <filename>color_extractor/cluster.py
from sklearn.cluster import KMeans
from .exceptions import KMeansException
from .task import Task
class Cluster(Task):
"""
Use the K-Means algorithm to group pixels by clusters. The algorithm tries
to determine the optimal number of clusters for the given pixels.
... | 2.96875 | 3 |
notebooks/datasets.py | jweill-aws/jupyterlab-data-explorer | 173 | 12749 | <reponame>jweill-aws/jupyterlab-data-explorer
#
# @license BSD-3-Clause
#
# Copyright (c) 2019 Project Jupyter Contributors.
# Distributed under the terms of the 3-Clause BSD License.
import IPython.display
import pandas
def output_url(url):
IPython.display.publish_display_data(
{"application/x.jupyter.r... | 1.617188 | 2 |
django_india/conf.py | k-mullapudi/django-india | 0 | 12750 | <filename>django_india/conf.py
import django.conf
url_bases = {
'geonames': {
'dump': 'http://download.geonames.org/export/dump/',
'zip': 'http://download.geonames.org/export/zip/',
},
}
india_country_code = 'IN'
files = {
'state': {
'filename': '',
'urls': [
u... | 2.015625 | 2 |
src/dao/evaluation_dao.py | Asconius/trading-bot | 2 | 12751 | <filename>src/dao/evaluation_dao.py<gh_stars>1-10
from decimal import Decimal
from typing import List
from src.dao.dao import DAO
from src.dto.attempt_dto import AttemptDTO
from src.entity.evaluation_entity import EvaluationEntity
from src.utils.utils import Utils
class EvaluationDAO:
@staticmethod
def creat... | 2.421875 | 2 |
src/lib/others/info_gathering/finder/finding_comment.py | nahuelhm17/vault_scanner | 230 | 12752 | #! /usr/bin/python
import requests
import re
from bs4 import BeautifulSoup
import colors
class FindingComments(object):
def __init__(self, url):
self.url = url
self.comment_list = ['<!--(.*)-->']
self.found_comments = {}
def get_soure_code(self):
resp_text = requests.get(sel... | 3.09375 | 3 |
micro-benchmark-key-errs/snippets/dicts/type_coercion/main.py | WenJinfeng/PyCG | 121 | 12753 | d = {"1": "a"}
d[1]
d["1"]
| 2.5 | 2 |
scripts/link_assignment.py | metagenomics/antibio | 4 | 12754 | #!/usr/bin/python
# This program revises the existing overview file.
# If a keyword is found in an Abstract of an accession of a gene, the url of the abstract is added to the overview file
# The revised overview.txt is created in the same directory of the old one and named overview_new.txt
"""
Usage: link_assignment.py... | 3.109375 | 3 |
app/views.py | LauretteMongina/Instagram-clone | 0 | 12755 | from django.shortcuts import render,redirect,get_object_or_404
from django.contrib.auth.decorators import login_required
from .models import *
import cloudinary
import cloudinary.uploader
import cloudinary.api
from django.http import HttpResponseRedirect, JsonResponse
from .forms import RegistrationForm, UpdateUserForm... | 2.09375 | 2 |
at_export_config.py | Fmstrat/FreeCAD-ArchTextures | 21 | 12756 | <reponame>Fmstrat/FreeCAD-ArchTextures<gh_stars>10-100
import FreeCAD, FreeCADGui
from arch_texture_utils.resource_utils import iconPath
import arch_texture_utils.qtutils as qtutils
from arch_texture_utils.selection_utils import findSelectedTextureConfig
class ExportTextureConfigCommand:
toolbarName = 'ArchTextur... | 1.992188 | 2 |
barcode/charsets/ean.py | Azd325/python-barcode | 0 | 12757 | <reponame>Azd325/python-barcode<gh_stars>0
EDGE = '101'
MIDDLE = '01010'
CODES = {
'A': (
'0001101', '0011001', '0010011', '0111101', '0100011', '0110001',
'0101111', '0111011', '0110111', '0001011'
),
'B': (
'0100111', '0110011', '0011011', '0100001', '0011101', '0111001',
'... | 2.40625 | 2 |
Sushant_Boosting/code.py | sushant-bahekar/ga-learner-dsmp-repo | 0 | 12758 | # --------------
import pandas as pd
from sklearn.model_selection import train_test_split
#path - Path of file
# Code starts here
df = pd.read_csv(path)
df.head(5)
X = df.drop(['customerID','Churn'],1)
y = df['Churn']
X_train,X_test,y_train,y_test = train_test_split(X, y, test_size = 0.3, random_state = 0)
# --... | 3.34375 | 3 |
slsgd.py | xcgoner/ecml2019-slsgd | 3 | 12759 | import argparse, time, logging, os, math, random
os.environ["MXNET_USE_OPERATOR_TUNING"] = "0"
import numpy as np
from scipy import stats
import mxnet as mx
from mxnet import gluon, nd
from mxnet import autograd as ag
from mxnet.gluon import nn
from mxnet.gluon.data.vision import transforms
from gluoncv.model_zoo im... | 1.945313 | 2 |
predictor.py | MIC-DKFZ/DetectionAndRegression | 40 | 12760 | #!/usr/bin/env python
# Copyright 2019 Division of Medical Image Computing, German Cancer Research Center (DKFZ).
#
# 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... | 1.882813 | 2 |
archive/jonesboro/__init__.py | jayktee/scrapers-us-municipal | 67 | 12761 | <filename>archive/jonesboro/__init__.py
from pupa.scrape import Jurisdiction
from legistar.ext.pupa import LegistarPeopleScraper
class Jonesboro(Jurisdiction):
division_id = 'ocd-division/country:us/state:ar/place:jonesboro'
jurisdiction_id = 'ocd-jurisdiction/country:us/state:ar/place:jonesboro/government'
... | 1.773438 | 2 |
src/config.py | La-tale/MessyTable | 32 | 12762 | <filename>src/config.py<gh_stars>10-100
import yaml
import os
def parse_config(args):
"""
prepare configs
"""
file_dir = os.path.dirname(os.path.realpath('__file__'))
messytable_dir = os.path.realpath(os.path.join(file_dir, '..'))
config_pathname = os.path.join(messytable_dir,'models',args.conf... | 2.3125 | 2 |
tests/settings.py | josemarimanio/django-adminlte2-templates | 10 | 12763 | <filename>tests/settings.py
import os
BASE_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
SECRET_KEY = <KEY>' # nosec
INSTALLED_APPS = [
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.sites',
'adminlte2_templates',
'tests... | 1.703125 | 2 |
two-variables-function-fitting/fxy_gen.py | ettoremessina/fitting-with-mlp-using-tensorflow | 9 | 12764 | <filename>two-variables-function-fitting/fxy_gen.py
import argparse
import numpy as np
import csv
if __name__ == "__main__":
parser = argparse.ArgumentParser(description='fxy_gen.py generates a synthetic dataset file calling a two-variables real function on a rectangle')
parser.add_argument('--dsout',
... | 3.0625 | 3 |
custom/icds_reports/dashboard_utils.py | tstalka/commcare-hq | 0 | 12765 | <filename>custom/icds_reports/dashboard_utils.py<gh_stars>0
from corehq.apps.locations.util import location_hierarchy_config
from custom.icds_reports.utils import icds_pre_release_features
def get_dashboard_template_context(domain, couch_user):
context = {}
context['location_hierarchy'] = location_hierarchy_c... | 1.898438 | 2 |
data_input.py | zpcore/OnePass | 0 | 12766 | import json
import string, sys
from random import *
class Token:
def __init__(self):
self.company, self.website, self.email, self.username, self.password = None, None, None, None, None
def get_input(self):
while(self.company in (None,'')):
self.company = input('Account Association:')
if(self.company in (N... | 3.46875 | 3 |
examples/python/test_dict.py | SmartEconomyWorkshop/workshop | 79 | 12767 | <gh_stars>10-100
from boa_test.tests.boa_test import BoaTest
from boa.compiler import Compiler
from neo.Settings import settings
from neo.Prompt.Commands.BuildNRun import TestBuild
class TestContract(BoaTest):
def test_dict1(self):
output = Compiler.instance().load('%s/boa_test/example/DictTest1.py' % T... | 2.203125 | 2 |
deployment_classifier/setup.py | m-santh/VayuAnukulani | 1 | 12768 | from setuptools import find_packages
from setuptools import setup
REQUIRED_PACKAGES = ['tensorflow==1.8.0','pandas==0.23.1','setuptools==38.7.0','numpy==1.14.1','Keras==2.1.4','scikit_learn==0.19.1','h5py']
setup(
name='classifier',
version='0.1',
install_requires=REQUIRED_PACKAGES,
packages=find_pack... | 1.328125 | 1 |
day5.py | zsmoore/Advent-Of-Code-2017 | 0 | 12769 | <filename>day5.py<gh_stars>0
import sys
import copy
def main():
in_file = open(sys.argv[1], 'r')
jumps = []
for line in in_file.readlines():
jumps.append(int(line.strip()))
#print(compute_exit(jumps))
print(compute_exit2(jumps))
def compute_exit(jump_list):
current_ind = 0
st... | 3.28125 | 3 |
pycudasirecon/_recon_params.py | tlambert03/pycudasirecon | 2 | 12770 | import os
from contextlib import contextmanager
from tempfile import NamedTemporaryFile
from typing import Optional, Sequence
from pydantic import BaseModel, Field, FilePath
@contextmanager
def temp_config(**kwargs):
"""A context manager that creates a temporary config file for SIMReconstructor.
`**kwargs` ... | 2.359375 | 2 |
tesseract_converters/tesseract_to_sa_converter.py | superannotateai/annotateonline-input-converters | 10 | 12771 | <reponame>superannotateai/annotateonline-input-converters
import os
import json
import argparse
def main():
parser = argparse.ArgumentParser()
parser.add_argument(
'--input',
help='Path to input files or folder\
with tesseract dict format.\
File ... | 2.75 | 3 |
fhirclient/r4models/contract_tests.py | cspears-mitre/CapStatement | 1 | 12772 | <filename>fhirclient/r4models/contract_tests.py<gh_stars>1-10
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Generated from FHIR 3.6.0-bd605d07 on 2018-12-20.
# 2018, SMART Health IT.
import os
import io
import unittest
import json
from . import contract
from .fhirdate import FHIRDate
class ContractTests(unitt... | 2.421875 | 2 |
evaluation/evaluation.py | Ennosigaeon/xautoml | 4 | 12773 | import math
import matplotlib.pyplot as plt
import numpy as np
import pandas as pd
import seaborn as sns
from scipy.stats import ttest_ind
from sklearn.preprocessing import LabelEncoder
def load_data():
questionnaire = pd.read_excel('XAutoML.xlsx')
encoder = LabelEncoder()
encoder.classes_ = np.array([... | 3.03125 | 3 |
matplotlib/tutorials_python/colors/colors.py | gottaegbert/penter | 13 | 12774 | """
*****************
Specifying Colors
*****************
Matplotlib recognizes the following formats to specify a color:
* an RGB or RGBA (red, green, blue, alpha) tuple of float values in closed
interval ``[0, 1]`` (e.g., ``(0.1, 0.2, 0.5)`` or ``(0.1, 0.2, 0.5, 0.3)``);
* a hex RGB or RGBA string (e.g., ``'#0f0f... | 3.21875 | 3 |
12-listComprehensions.py | pgiardiniere/notes-WhirlwindTourOfPython | 0 | 12775 | # List Comprehensions
#########################
### Basic List Comprehensions
#########################
# allow us to circumvent constructing lists with for loops
l = [] # The Old Way
for n in range(12):
l.append(n**2)
[n ** 2 for n in range(12)] # Comprehension way
# General Syntax:
# [ ... | 4.09375 | 4 |
src/chemical_roles/export/cli.py | bgyori/chemical-roles | 5 | 12776 | # -*- coding: utf-8 -*-
"""CLI for Chemical Roles exporters."""
import os
import click
from ..constants import DATA
@click.group()
def export():
"""Export the database."""
@export.command(name='all')
@click.pass_context
def export_all(ctx):
"""Export all."""
ctx.invoke(summary)
ctx.invoke(obo)
... | 2.09375 | 2 |
gdsfactory/geometry/write_drc.py | jorgepadilla19/gdsfactory | 42 | 12777 | <filename>gdsfactory/geometry/write_drc.py
"""Write DRC rule decks in klayout.
TODO:
- add min area
- define derived layers (composed rules)
"""
import pathlib
from dataclasses import asdict, is_dataclass
from typing import List, Optional
try:
from typing import Literal
except ImportError:
from typing_exten... | 2.609375 | 3 |
virtus/core/migrations/0004_auto_20180417_1625.py | eltonjncorreia/gerenciar-dados-virtus | 0 | 12778 | # Generated by Django 2.0.4 on 2018-04-17 19:25
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('core', '0003_auto_20180417_1613'),
]
operations = [
migrations.CreateModel(
name='Item',
fields=[
('... | 1.820313 | 2 |
image_demo.py | a888999a/yolov3fusion1 | 7 | 12779 | <filename>image_demo.py<gh_stars>1-10
#! /usr/bin/env python
# coding=utf-8
#================================================================
# Copyright (C) 2019 * Ltd. All rights reserved.
#
# Editor : VIM
# File name : image_demo.py
# Author : YunYang1994
# Created date: 2019-01-20 16:06:06
# ... | 2.234375 | 2 |
Sensor/main.py | mahsahadian/EdgeBenchmarkTool | 0 | 12780 | <gh_stars>0
import cv2
from datetime import *
import time
import logging
import base64
import sys
import os
import shutil
import paho.mqtt.client as mqtt
from influxdb import InfluxDBClient
import datetime
import sys
import re
from typing import NamedTuple
import json
from dotenv import load_dotenv
load_dotenv("s... | 2.640625 | 3 |
oxide/plugins/other/StartupItems.py | john-clark/rust-oxide-umod | 13 | 12781 | <reponame>john-clark/rust-oxide-umod<gh_stars>10-100
# Note:
# I add an underscore at the biginning of the variable name for example: "_variable" to prevent
# conflicts with build-in variables from Oxide.
# Use to manage the player's inventory.
import ItemManager
# Use to get player's information.
import Base... | 2.53125 | 3 |
error_handler.py | jrg1381/sm_asr_console | 2 | 12782 | # encoding: utf-8
""" Parameterized decorator for catching errors and displaying them in an error popup """
from enum import Enum
import npyscreen
class DialogType(Enum):
"""
Enum defining the type of dialog.
CONFIRM - the dialog waits until the user clicks OK
BRIEF - the dialog appears for a few sec... | 3.1875 | 3 |
parlai/tasks/taskmaster2/agents.py | min942773/parlai_wandb | 2 | 12783 | #!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.
"""
Taskmaster-2 implementation for ParlAI.
No official train/valid/test splits are available as of 2020-05-18, so we m... | 1.835938 | 2 |
jmeter_api/timers/__init__.py | dashawn888/jmeter_api | 11 | 12784 | <reponame>dashawn888/jmeter_api
from jmeter_api.timers.constant_throughput_timer.elements import ConstantThroughputTimer, BasedOn
from jmeter_api.timers.constant_timer.elements import ConstantTimer
from jmeter_api.timers.uniform_random_timer.elements import UniformRandTimer
| 1.265625 | 1 |
tensorfn/distributed/launch.py | rosinality/tensorfn | 13 | 12785 | <gh_stars>10-100
import os
import torch
from torch import distributed as dist
from torch import multiprocessing as mp
from tensorfn import distributed as dist_fn
def find_free_port():
import socket
sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
sock.bind(("", 0))
port = sock.getsockname(... | 2.171875 | 2 |
VideoStitchingSubsystem/StereoCameraAPIs/MonoLensStream.py | AriaPahlavan/see-through-adas-core | 0 | 12786 | <reponame>AriaPahlavan/see-through-adas-core<gh_stars>0
from enum import Enum
from threading import Thread
import cv2
import time
class Resolution(Enum):
_32p = (64, 32)
_96p = (128, 96)
_120p = (160, 120)
_144p = (256, 144)
_240p = (360, 240)
_288p = (480, 272)
_360p = (480, 360)
_48... | 2.515625 | 3 |
sdk/python/approzium/mysql/connector/pooling.py | UpGado/approzium | 59 | 12787 | from mysql.connector.pooling import MySQLConnectionPool
from ._connect import _parse_kwargs, _patch_MySQLConnection
class MySQLConnectionPool(MySQLConnectionPool):
def set_config(self, **kwargs):
kwargs = _parse_kwargs(kwargs)
super(MySQLConnectionPool, self).set_config(**kwargs)
def add_con... | 2.40625 | 2 |
app/network_x_tools/network_x_utils.py | ThembiNsele/ClimateMind-Backend | 6 | 12788 | <reponame>ThembiNsele/ClimateMind-Backend
class network_x_utils:
"""
This class provides commonly used utils which are shared between all different types
of NetworkX nodes (Feed Items, Solutions, Myths). For each of these, we want to be
able to pull basic information like the IRI, Descriptions, Images... | 2.921875 | 3 |
setup.py | Faust-Wang/vswarm | 21 | 12789 | <filename>setup.py
# Do not manually invoke this setup.py, use catkin instead!
from setuptools import setup
from catkin_pkg.python_setup import generate_distutils_setup
setup_args = generate_distutils_setup(
packages=['vswarm'],
package_dir={'': 'src'}
)
setup(**setup_args)
| 1.359375 | 1 |
实例学习Numpy与Matplotlib/创建 numpy.array.py | shao1chuan/pythonbook | 95 | 12790 |
import numpy as np
nparr = np.array([i for i in range(10)])
a = np.zeros(10)
f = np.zeros(10,dtype=float)
n = np.full((3,5),44)
r = np.random.randint(0,100,size=(3,5))
r2 = np.random.random((3,5))
x = np.linspace(0,100,50)
print(nparr,a,f,n,r,r2,x) | 3.203125 | 3 |
examples/DecryptLoginExamples/crawlers/weibomonitor/weibomonitor.py | hedou/DecryptLogin | 0 | 12791 | <reponame>hedou/DecryptLogin
'''
Function:
微博监控
Author:
Charles
微信公众号:
Charles的皮卡丘
'''
import re
import time
from DecryptLogin import login
'''微博监控'''
class WeiboMonitor():
def __init__(self, username, password, time_interval=30):
_, self.session = self.login(username, password)
self.h... | 2.578125 | 3 |
crawlai/items/critter/base_critter.py | apockill/CreepyCrawlAI | 13 | 12792 | <reponame>apockill/CreepyCrawlAI
from godot.bindings import ResourceLoader
from crawlai.grid_item import GridItem
from crawlai.items.food import Food
from crawlai.math_utils import clamp
from crawlai.turn import Turn
from crawlai.position import Position
_critter_resource = ResourceLoader.load("res://Game/Critter/Cri... | 2.609375 | 3 |
exercises/networking_selfpaced/networking-workshop/collections/ansible_collections/community/general/plugins/doc_fragments/nios.py | tr3ck3r/linklight | 17 | 12793 | # -*- coding: utf-8 -*-
# Copyright: (c) 2015, <NAME> <<EMAIL>>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
class ModuleDocFragment(object):
# Standard files documentation fragment
DOCUMENTATION = r'''
options:
provider:
description:
- A dict obje... | 1.804688 | 2 |
torchrec/metrics/rec_metric.py | xing-liu/torchrec | 814 | 12794 | #!/usr/bin/env python3
# Copyright (c) Meta Platforms, Inc. and affiliates.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
#!/usr/bin/env python3
import abc
import math
from collections import defaultdict, dequ... | 1.835938 | 2 |
alison.py | johanhoiness/SlothBot | 1 | 12795 | <reponame>johanhoiness/SlothBot
__author__ = 'JohnHiness'
import sys
import os
import random
import time
import string
import connection
from time import strftime
import ceq
import json, urllib2
import thread
args = sys.argv
req_files = ['filegen.py', 'connection.py', 'commands.py', 'general.py', 'automatics.py']
fo... | 2.640625 | 3 |
pyroomacoustics/experimental/tests/test_deconvolution.py | HemaZ/pyroomacoustics | 1 | 12796 | <filename>pyroomacoustics/experimental/tests/test_deconvolution.py<gh_stars>1-10
from unittest import TestCase
import numpy as np
from scipy.signal import fftconvolve
import pyroomacoustics as pra
# fix seed for repeatability
np.random.seed(0)
h_len = 30
x_len = 1000
SNR = 1000. # decibels
h_lp = np.fft.irfft(np.... | 2.484375 | 2 |
pthelper/img_to_txt.py | hkcountryman/veg-scanner | 0 | 12797 | import cv2 as cv
from deskew import determine_skew
import numpy as np
from PIL import Image, ImageFilter, ImageOps
from pytesseract import image_to_string
from skimage import io
from skimage.color import rgb2gray
from skimage.transform import rotate
from spellchecker import SpellChecker
import traceback
# On Windows, ... | 2.90625 | 3 |
scripts/training.py | tobinsouth/privacy-preserving-synthetic-mobility-data | 0 | 12798 | <reponame>tobinsouth/privacy-preserving-synthetic-mobility-data<gh_stars>0
# Params
learning_rate = 0.001
k = 0.0025
x0 =2500
epochs = 4
batch_size=16
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
import torch, numpy as np
from tqdm import tqdm
# Get the dataloader
from dataloader import get_t... | 2.015625 | 2 |
tests/compute/planar/test_rotateZ.py | ianna/vector | 0 | 12799 | # Copyright (c) 2019-2021, <NAME>, <NAME>, <NAME>, and <NAME>.
#
# Distributed under the 3-clause BSD license, see accompanying file LICENSE
# or https://github.com/scikit-hep/vector for details.
import numpy
import pytest
import vector.backends.numpy_
import vector.backends.object_
def test_xy():
vec = vector.... | 2.203125 | 2 |