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 |
|---|---|---|---|---|---|---|
language/python/Lib_beautifulsoup/beautifulsoup.py | LIU2016/Demo | 1 | 12798551 | <filename>language/python/Lib_beautifulsoup/beautifulsoup.py
'''
比xpath lxml 更方便的
节点选择器:
若有同名节点,只输出第一个,不存在,输出None :soup.title
直接子节点:
contents、children
孙子节点选择器:
descendants
方法选择器:
find find_all
css选择器:
select
获取文本:
get_text,string属性
获取属性值:
... | 3.359375 | 3 |
dataflows_aws/__init__.py | frictionlessdata/dataflows-aws | 2 | 12798552 | <reponame>frictionlessdata/dataflows-aws
from .processors.change_acl_on_s3 import change_acl_on_s3
from .processors.dump_to_s3 import S3Dumper as dump_to_s3
| 1.148438 | 1 |
link_pred_tasker.py | sykailak/evolvegcn | 0 | 12798553 | <reponame>sykailak/evolvegcn<gh_stars>0
#FINAL NODE2VEC
import torch
import taskers_utils as tu
import utils as u
from stellargraph import StellarGraph
import pandas as pd
from stellargraph.data import BiasedRandomWalk
from gensim.models import Word2Vec
import numpy as np
import scipy.sparse as sp
import logging
log... | 1.9375 | 2 |
plugins/msg.py | popa222455/botTWO | 9 | 12798554 | <reponame>popa222455/botTWO
from database import *
from plugin_system import Plugin
plugin = Plugin("Отправка сообщения",
usage=["напиши [id] [сообщение] - написать сообщение пользователю",
"анонимно [id] [сообщение] - написать анонимное сообщение пользователю"
... | 2.359375 | 2 |
cryptonite/challenge/migrations/0010_challenge_users.py | pshrmn/cryptonite | 1 | 12798555 | <filename>cryptonite/challenge/migrations/0010_challenge_users.py
# -*- coding: utf-8 -*-
# Generated by Django 1.10 on 2016-09-21 06:10
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('cryptographer', '0001_crypto... | 1.632813 | 2 |
cap-3/13-Deletando_dados-DeleteFrom-Where.py | igoradriano/manipulacao-dados-python-bd | 0 | 12798556 | <filename>cap-3/13-Deletando_dados-DeleteFrom-Where.py<gh_stars>0
import sqlite3 as conector
try:
# Criando uma conexão e um cursor
conexao = conector.connect("./meu_banco.db")
cursor = conexao.cursor()
print("Cursor e Conexao criados com sucesso")
# Deletando com uma string sem delimitador "?"
... | 3.109375 | 3 |
behave_webdriver/utils.py | stevegibson/behave-webdriver | 43 | 12798557 | <reponame>stevegibson/behave-webdriver
from os import getenv
import six
from behave_webdriver.driver import (Chrome,
Firefox,
Ie,
Edge,
Opera,
... | 2.75 | 3 |
patchlion/0000/DrawHeadImage.py | saurabh896/python-1 | 3,976 | 12798558 | <filename>patchlion/0000/DrawHeadImage.py<gh_stars>1000+
# -*- coding: utf-8 -*-
__author__ = 'PatchLion'
from PIL import Image, ImageDraw,ImageFont
def drawNumberOnIcon(imgpath, number):
img = Image.open(imgpath)
if (None == img):
print('打开图片失败')
return
img = img.resize((160, 160))
... | 2.8125 | 3 |
Chapter_5_Mathematics/Combinatorics/kattis_anti11.py | BrandonTang89/CP4_Code | 2 | 12798559 | '''
Kattis - anti11
Let f(x) be the number of x length binary strings without 11 ending with 1
Let g(x) be the numebr of x length binary strings without 11 ending with 0
f(2) = 1 {01}
g(2) = 2 {00, 10}
f(x+1) = g(x) {...01}
g(x+1) = f(x) + g(x) {...00, ...10}
ans(x) = f(x) + g(x)
Time: O(10000), Space: O(10000)
'''... | 3.0625 | 3 |
Arrays/OddOneOut.py | d3xt3r0/Data-Structures-And-Algorithms | 4 | 12798560 | # Odd one out from hackerearth solution
def oddOneOut(arr : list) :
n = len(arr)
arr.sort()
summation = sum(arr)
actual_sum = int((n+1)/2 * (2*arr[0] + (n*2)))
print(actual_sum)
return actual_sum - summation
if __name__ == '__main__' :
arr = list(map(int, input("Enter the elements in... | 3.765625 | 4 |
src/drone_ai/scripts/helpers/tracking/objects.py | Tao-wecorp/drone_sim | 0 | 12798561 | #! /usr/bin/env python
import cv2 as cv
import numpy as np
| 1.195313 | 1 |
broker/src/ave/broker/profile.py | yiu31802/ave | 17 | 12798562 | # Copyright (C) 2013 Sony Mobile Communications AB.
# All rights, including trade secret rights, reserved.
from ave.profile import Profile
from ave.handset.profile import HandsetProfile
from ave.workspace import WorkspaceProfile
from ave.base_workspace import BaseWorkspaceProfile
from av... | 1.8125 | 2 |
evaluator.py | jmribeiro/pddpg-hfo | 0 | 12798563 | <gh_stars>0
from learner import Learner
import os
import argparse
import time
import numpy as np
import torch
from agents.random_agent import RandomAgent
from agents.pddpg_agent import PDDPGAgent
from agents.mapddpg_agent import MAPDDPGAgent
from envs import offense_mid_action
from utils.redis_manager import connect_re... | 2.078125 | 2 |
finetuning/v1/evaluate.py | wietsedv/bertje | 104 | 12798564 | <gh_stars>100-1000
import argparse
import os
from collections import Counter
from sklearn.metrics import confusion_matrix, classification_report
def read_labels(filename):
labels = []
with open(filename) as f:
for line in f:
line = line.strip()
if len(line) == 0:
... | 2.671875 | 3 |
src/download_and_extract_zip.py | jufu/DSCI_522_Group_10 | 0 | 12798565 | <reponame>jufu/DSCI_522_Group_10
# author: <NAME>
# date: 2020-11-19
"""Downloads a zip file and extracts all to a specified path
Usage: download_and_extract_zip.py --url=<url> --out_file=<out_file>
Options:
<url> URL to download zip file from (must be a zip file with no password)
<out_path> ... | 3.578125 | 4 |
tdcosim/test/der_test_manual_config.py | tdcosim/TDcoSim | 18 | 12798566 | <gh_stars>10-100
# -*- coding: utf-8 -*-
"""
Created on Thu May 7 16:21:41 2020
@author: splathottam
"""
import os
import tdcosim
dirlocation= os.path.dirname(tdcosim.__file__)
dirlocation = dirlocation[0:len(dirlocation)-8]
test_config = {
"nodenumber": 11,
"filePath": [os.path.join(dirlocation,"SampleData\\DNe... | 1.65625 | 2 |
rlkit/rlkit/launchers/scalor_training.py | martius-lab/SMORL | 9 | 12798567 | import time
from multiworld.core.image_env import ImageEnv, unormalize_image, normalize_image
from rlkit.core import logger
import cv2
import numpy as np
import os.path as osp
from rlkit.samplers.data_collector.scalor_env import WrappedEnvPathCollector as SCALORWrappedEnvPathCollector
from rlkit.torch.scalor.scalor i... | 1.84375 | 2 |
git_functions.py | psyonara/pylint-diff | 0 | 12798568 | import subprocess
def is_branch_merged(branch):
"""
Checks if given branch is merged into current branch.
:param branch: Name of branch
:return: True/False
"""
proc = subprocess.Popen(["git", "branch", "--merged"], stdout=subprocess.PIPE)
result = proc.stdout.read().decode()
return bra... | 3.53125 | 4 |
examples/tutorials/frames.py | yohaimagen/pygmt | 0 | 12798569 | """
Frames, ticks, titles, and labels
=================================
Setting the style of the map frames, ticks, etc, is handled by the ``frame`` argument
that all plotting methods of :class:`pygmt.Figure`.
"""
import pygmt
########################################################################################
#... | 3.71875 | 4 |
bot/migrations/0006_auto_20171229_2354.py | CdecPGL/LBot | 1 | 12798570 | # Generated by Django 2.0 on 2017-12-29 14:54
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('bot', '0005_auto_20171229_2354'),
]
operations = [
migrations.AlterField(
model_name='user',
name='authority',
... | 1.726563 | 2 |
upf_queue.py | ckrybus/redis-unique-priority-queue | 0 | 12798571 | <reponame>ckrybus/redis-unique-priority-queue
import itertools
lua_insert_script = """
local key = KEYS[1]
for i=1, #ARGV, 2 do
local priority = ARGV[i]
local member = ARGV[i + 1]
local score = redis.call('zscore', key, member)
if not score then
-- add, because the ... | 3.15625 | 3 |
pstock/base.py | obendidi/pstock | 5 | 12798572 | <filename>pstock/base.py
from __future__ import annotations
import typing as tp
from abc import ABC, abstractmethod
from datetime import datetime
import pandas as pd
import pendulum
from pydantic import BaseModel as _BaseModel
from pydantic import PrivateAttr
class BaseModel(_BaseModel):
_created_at: datetime =... | 2.5625 | 3 |
finicityapi/controllers/deprecated_controller.py | monarchmoney/finicity-python | 0 | 12798573 | <reponame>monarchmoney/finicity-python
# -*- coding: utf-8 -*-
from finicityapi.api_helper import APIHelper
from finicityapi.configuration import Configuration
from finicityapi.controllers.base_controller import BaseController
from finicityapi.http.auth.custom_header_auth import CustomHeaderAuth
from finicityapi... | 2.015625 | 2 |
perceptron/digit_recognition.py | lstefanello/perceptron | 0 | 12798574 | import perceptron as pc
import numpy as np
def mnist_load(file, samples):
raw_data = np.array(np.genfromtxt(file, delimiter=',', max_rows=samples))
labels = raw_data[:,0]
data = np.delete(raw_data, 0, 1)/255.0
return (data, labels)
def main():
print("loading data...")
samples = 10000
batch... | 3.234375 | 3 |
tests/clients/git/test_git.py | zaibon/js-ng | 2 | 12798575 | <gh_stars>1-10
from jumpscale.loader import j
from tests.base_tests import BaseTests
class GitTests(BaseTests):
def setUp(self):
super().setUp()
self.instance_name = self.random_name()
self.repo_dir = j.sals.fs.join_paths("/tmp", self.random_name())
self.repo_name = "js-ng"
... | 2.125 | 2 |
UtilsPlot.py | felipegb94/ToFSim | 12 | 12798576 | <filename>UtilsPlot.py
"""UtilsPlot
Attributes:
colors (TYPE): Colors for plotting
plotParams (TYPE): Default plotting parameters
"""
#### Python imports
#### Library imports
import numpy as np
import matplotlib as mpl
import matplotlib.pyplot as plt
# from IPython.core import debugger
# breakpoi... | 2.3125 | 2 |
AutoAcademicCV/textfile.py | german-arroyo-moreno/AutoAcademia | 0 | 12798577 | <reponame>german-arroyo-moreno/AutoAcademia
# encoding: utf-8
"""
Copyright 2018 (c) <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 ... | 2.453125 | 2 |
guess.py | Olayinka2020/ds_wkday_class | 0 | 12798578 | <reponame>Olayinka2020/ds_wkday_class
# the idea is that we'll have a secret word that we store inside of our program and then the user
# will interact with the program to try and guess the secret word
# we want the user to be able to keep guessing what the secret word is until they finally get the word.
secret_word ... | 4.4375 | 4 |
gym_graph_coloring/envs/graph_coloring.py | dankiy/gym-graph-coloring | 0 | 12798579 | import networkx as nx
import matplotlib.pyplot as plt
import numpy as np
from gym import spaces, Env
class NXColoringEnv(Env):
def __init__(self, generator=nx.barabasi_albert_graph, **kwargs):
'''
generator — netwokrx graph generator,
kwargs — generator named arguments
'''
self.G = generator(**k... | 2.734375 | 3 |
backend/wmg/config.py | chanzuckerberg/dcp-prototype | 2 | 12798580 | import os
from backend.corpora.common.utils.secret_config import SecretConfig
class WmgConfig(SecretConfig):
def __init__(self, *args, **kwargs):
super().__init__("backend", secret_name="wmg_config", **kwargs)
# TODO: promote this impl to parent class, if new behavior works universally
def __get... | 2.140625 | 2 |
contact_sort.py | onelharrison/labs | 0 | 12798581 | <gh_stars>0
"""
The following code explores the presentation of contacts
in an on-screen phone book in which a contact's
first name xor last name may be missing and contacts can
be sorted by first name xor last name.
A true sort by first name and last name is implemented as well as
correspending sort procedures with a... | 3.890625 | 4 |
bin/download-prebuilt-firmware.py | baldurmen/HDMI2USB-mode-switch | 7 | 12798582 | <reponame>baldurmen/HDMI2USB-mode-switch<gh_stars>1-10
#!/usr/bin/env python
# FIXME: Make this work under Python 2
import argparse
import csv
import doctest
import json
import os
import pickle
import sys
import time
import urllib.request
from collections import namedtuple
from datetime import datetime
class Targe... | 2.53125 | 3 |
src/test_quick_sort.py | han8909227/data-structures | 1 | 12798583 | """Test my quick sort algorithm tests."""
from quick_sort import quick_sort, _quicksort
import pytest
from random import randint
@pytest.fixture(scope='function')
def list_ten():
"""Make a list of 10 vals."""
return [x for x in range(10)]
@pytest.fixture(scope='function')
def rand_ten():
"""Make a rando... | 3.375 | 3 |
homework4/problem1.py | jojonium/CS-539-Machine-Learning | 0 | 12798584 | import numpy as np
# Note: please don't import any new package. You should solve this problem using only the package(s) above.
#-------------------------------------------------------------------------
'''
Problem 1: Multi-Armed Bandit Problem (15 points)
In this problem, you will implement the epsilon-greedy ... | 3.328125 | 3 |
src/photometer.py | yeutterg/beautiful-photometry | 1 | 12798585 | """Photometer
These functions handle data files from spectrophotometers for easy and direct import
The functions are:
* uprtek_import_spectrum - Imports the spectrum from a UPRtek spectrophotometer
* uprtek_import_r_vals - Imports the R values generated by a UPRtek spectrophotometer
* uprtek_file_import ... | 3.046875 | 3 |
twitter_explorer/views.py | jrstarke/TweetSeeker | 2 | 12798586 | '''
Copyright 2011-2012 <NAME>, The CHISEL group and contributors
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.921875 | 2 |
share/dht/script/run.py | tspoon4/codenote | 0 | 12798587 | <filename>share/dht/script/run.py
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
import gc
import sys
import json
import time
import signal
import subprocess
# In[ ]:
CONFIG = '/mnt/data/script/config.json'
DHT = '/mnt/data/script/dht_crawl.py'
META = '/mnt/data/script/dht_metadata.py'
GEOIP = '/mnt/data/script/... | 2.21875 | 2 |
GeekforGeeks Array practice/check_sort.py | gurusabarish/python-programs | 2 | 12798588 | def check(lst, l):
for i in range(l):
if lst[0]<=lst[i]:
sort = 1
else:
sort = 0
break
print(sort)
T = int(input())
for i in range(T):
n = int(input())
arr = list(map(int, input().split()))
check(arr, n)
| 3.34375 | 3 |
examples/overnight_hold.py | turingdata/alpaca-trade-api-python | 1 | 12798589 | <gh_stars>1-10
import alpaca_trade_api as tradeapi
from alpaca_trade_api.rest import TimeFrame
from alpaca_trade_api.rest_async import gather_with_concurrency, AsyncRest
from alpaca_trade_api.entity_v2 import BarsV2
from concurrent.futures import ThreadPoolExecutor, ProcessPoolExecutor
import pandas as pd
import stati... | 2.4375 | 2 |
alfacoins/__init__.py | iRhonin/alfacoins | 0 | 12798590 | <filename>alfacoins/__init__.py
from .gateway import ALFACoins
from .exceptions import APIException, ServerException
__version__ = '0.1.0a2'
| 1.25 | 1 |
build-tools/scripts/update_gpu_list.py | daniel-falk/nnabla-ext-cuda | 103 | 12798591 | <gh_stars>100-1000
# Copyright 2021 Sony Corporation.
# Copyright 2021 Sony Group 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... | 2.296875 | 2 |
3test.py | zerovm/zpython2 | 4 | 12798592 | #!/usr/bin/python
import os
import sys
import subprocess
import socket
import tempfile
import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-f', '--file', help='file containing tests list')
args = parser.parse_args()
# will use it as return code for script
test_result = 0
devnull = open(os.devnull... | 2.203125 | 2 |
plot.py | Neuromancer43/Physics | 0 | 12798593 | <filename>plot.py
# -*- coding: utf-8 -*-
import numpy as np
import matplotlib.pylab as plt
data=np.loadtxt('./data/u2_sweep.csv')[:,:11]
#plt.figure().dpi=120
#plt.plot(data[0],data[1],'co-',label='Simulation')
#plt.plot(data[0],180/3.14*np.arctan(data[0]),'lightsalmon',linestyle='--',label='Experience')
#plt.ylabe... | 2.84375 | 3 |
cephalus/modules/input_prediction.py | TrueAGI/Cephalus | 0 | 12798594 | <gh_stars>0
from typing import Optional, Tuple, Callable
import tensorflow as tf
from tensorflow.keras import Sequential
from tensorflow.keras.layers import Dense
from cephalus.frame import StateFrame
from cephalus.kernel import StateKernel
from cephalus.modules.interface import StateKernelModule
__all__ = [
'In... | 2.390625 | 2 |
src/helpers/flags.py | betoSolares/minicomp | 1 | 12798595 | import getopt
import os
import sys
# Help message to show
def help_message():
print("usage: minij [OPTIONS] [FILE]\n")
print("OPTIONS:")
print(" -h, --help Show help for the command")
print(" -o, --output Specify the output file")
# Try to get all the values passed to the program
def parse... | 2.984375 | 3 |
contact_test.py | BrianNgeno/python_contacts | 0 | 12798596 | import unittest
import pyperclip
from module_contact import Contact
class TestContact(unittest.TestCase):
def setUp(self):
self.new_contact = Contact("James","Muriuki","0712345678","<EMAIL>")
def test_init(self):
self.assertEqual(self.new_contact.first_name,"James")
self.assertEqual(self... | 3.21875 | 3 |
vize/150401032/client.py | hasan-se/blm304 | 2 | 12798597 | <gh_stars>1-10
# Enes TEKİN 150401032
import socket
import sys
import os
import pickle
IP = input('Bağlanmak istediğiniz sunucu IP: ')
PORT = 42
buf = 2048
ADDR = (IP,PORT)
client = socket.socket(socket.AF_INET,socket.SOCK_DGRAM)
while True:
cmd = input('\n1. Sunucu listesini listelemek için ... | 2.734375 | 3 |
test_IGV.py | toniher/igv.js-flask | 25 | 12798598 | import unittest
import struct
from igvjs import app
class TestIGV(unittest.TestCase):
def setUp(self):
app.config['TESTING'] = True
app.config['ALLOWED_EMAILS'] = 'test_emails.txt'
app.config['USES_OAUTH'] = True
app.config['PUBLIC_DIR'] = None
self.app = app.test_client()
... | 2.4375 | 2 |
cave/com.raytheon.viz.gfe/localization/gfe/userPython/smartTools/CheckSkyWithPoP.py | srcarter3/awips2 | 0 | 12798599 | <reponame>srcarter3/awips2
##
# This software was developed and / or modified by Raytheon Company,
# pursuant to Contract DG133W-05-CQ-1067 with the US Government.
#
# U.S. EXPORT CONTROLLED TECHNICAL DATA
# This software product contains export-restricted data whose
# export/transfer/disclosure is restricted by U.... | 1.539063 | 2 |
proliantutils/ilo/constants.py | anta-nok/proliantutils | 0 | 12798600 | <reponame>anta-nok/proliantutils
# Copyright 2017 Hewlett Packard Enterprise Development LP
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://... | 1.03125 | 1 |
set-1/level-6.py | tritoke/matasano-crypto-challenges | 0 | 12798601 | <reponame>tritoke/matasano-crypto-challenges
import base64
import string
import itertools
with open("6.txt", "r") as the_file:
b64data = the_file.read().replace("\n", "")
data = base64.standard_b64decode(b64data)
print(data)
def hamming_distance(x, y):
# finds the xor of the numbers in the two lists
... | 3.203125 | 3 |
slideshow.py | recursethenreverse/numerouter | 0 | 12798602 | from urllib.request import urlopen
from io import BytesIO
import time
import tkinter as tk
from PIL import Image, ImageTk
import json
from rmq import RMQiface
urls = [
'https://cdn.revjet.com/s3/csp/1578955925683/shine.png',
'https://cdn.revjet.com/s3/csp/1578955925683/logo.svg',
'https://tpc.googlesyndi... | 2.34375 | 2 |
src/core/actions/create_branch.py | victoraugustofd/git-phoenix | 5 | 12798603 | <filename>src/core/actions/create_branch.py
from dataclasses import dataclass
from src.core.actions.executable import Executable
from src.core.actions.executable import _validate_pattern
from src.core.models import ActionExecution
from src.core.px_git import checkout_new_branch
from src.core.px_questionary import conf... | 2.171875 | 2 |
01_mysite/blog/forms.py | victordomingos/Learning_Django | 1 | 12798604 | <filename>01_mysite/blog/forms.py
from django import forms
from .models import Artigo, Comentario
class ArtigoForm(forms.ModelForm):
class Meta:
model = Artigo
fields = ('titulo', 'texto',)
class ComentarioForm(forms.ModelForm):
class Meta:
model = Comentario
fields = ('auto... | 2.15625 | 2 |
invenio_app_ils/records/resolver/resolver.py | lauren-d/invenio-app-ils | 0 | 12798605 | <filename>invenio_app_ils/records/resolver/resolver.py
# -*- coding: utf-8 -*-
#
# Copyright (C) 2018-2019 CERN.
#
# invenio-app-ils is free software; you can redistribute it and/or modify it
# under the terms of the MIT License; see LICENSE file for more details.
"""Resolvers common."""
def get_field_value_for_reco... | 2.109375 | 2 |
src/ralph/networks/migrations/0008_auto_20160808_0719.py | DoNnMyTh/ralph | 1,668 | 12798606 | <reponame>DoNnMyTh/ralph<gh_stars>1000+
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
import ipaddress
from itertools import chain
from django.db import migrations, models
IPADDRESS_STATUS_RESERVED = 2
def _reserve_margin_addresses(network, bottom_count, top_count, IPAddress):
ips = []
... | 2.296875 | 2 |
sysrev/models.py | iliawnek/SystematicReview | 0 | 12798607 | from django.contrib.auth.models import User
from django.core.exceptions import ValidationError
from django.core.urlresolvers import reverse
from django.db import models
from django.template.defaultfilters import slugify
from django.utils.html import escape
from django.db import transaction
from sy... | 2.046875 | 2 |
tools/bpy_smooth_tiles.py | Avnerus/3d-tiles-validator | 1 | 12798608 | import sys
import bpy
if __name__ == "__main__":
args = sys.argv[sys.argv.index('--'):]
print(args)
bpy.ops.import_scene.gltf(filepath=args[1])
obj = bpy.context.active_object
mod = obj.modifiers.new("CorrectiveSmooth", 'CORRECTIVE_SMOOTH')
mod.factor = 0.1
mod.scale = 1.5
bpy.ops.obj... | 1.945313 | 2 |
APIs/samples/VehiclePlayer/ConvertFromXML/convert.py | AVSimulation/SCANeR-Samples-Pack | 0 | 12798609 | import os
import sys
import xml.etree.ElementTree as ET
from pyproj import Proj,Transformer
def createSCANeRMDL(fileName,type):
#Creation du fichier MDL
templateFileName = "template/template_"+type+".mdl"
templateFile = open(templateFileName, "r")
template= templateFile.read()
content = template... | 2.59375 | 3 |
meiduo_mall/utils/viewsMixin.py | joinik/meiduo_mall | 0 | 12798610 | from django.contrib.auth.mixins import LoginRequiredMixin
from django import http
class LoginRequiredJSONMixin(LoginRequiredMixin):
"""Verify that the current user is authenticated."""
def handle_no_permission(self):
return http.JsonResponse({'code': 400, 'errmsg': '用户未登录'}) | 2.046875 | 2 |
python/hello_world.py | kayabe/deadfrog-lib | 7 | 12798611 | from deadfroglib import *
# set up the window
screen_w = 800
screen_h = 600
win = CreateWin(50, 50, screen_w, screen_h, True, 'Hello World Example')
# Choose a font
font = CreateTextRenderer("Courier", 8, True)
# set up the colors
BLACK = 0x00000000
WHITE = 0xffffffff
while not win.contents.windowClosed:
bmp =... | 3.21875 | 3 |
thelma/repositories/rdb/mappers/worklistseriesmember.py | fogathmann/TheLMA | 1 | 12798612 | """
This file is part of the TheLMA (THe Laboratory Management Application) project.
See LICENSE.txt for licensing, CONTRIBUTORS.txt for contributor information.
Worklist series member mapper.
"""
from sqlalchemy.orm import mapper
from sqlalchemy.orm import relationship
from thelma.entities.liquidtransfer import Plan... | 2.1875 | 2 |
msumastro/header_processing/astrometry.py | mwcraig/msumastro | 4 | 12798613 | import logging
import subprocess
from os import path, remove, rename
import tempfile
from textwrap import dedent
__all__ = ['call_astrometry', 'add_astrometry']
logger = logging.getLogger(__name__)
def call_astrometry(filename, sextractor=False,
custom_sextractor_config=False, feder_settings=Tru... | 2.234375 | 2 |
punica/deploy/deploy_contract.py | lucas7788/punica-python | 0 | 12798614 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import os
import time
import getpass
from ontology.common.address import Address
from ontology.ont_sdk import OntologySdk
from punica.utils.file_system import (
read_avm,
read_wallet
)
from punica.utils.handle_config import (
handle_network_config,
hand... | 1.6875 | 2 |
img/nwcod.py | Heccubernny/web-scraping | 0 | 12798615 | <gh_stars>0
#-------------------------------------------------------------------------------
# Name: Image Downloader
# Purpose: To download images and save links of any image from any website link
#
# Author: Heccubernny
#
# Created: 17/04/2020
# Copyright: (c) Heccubernny 2020
# Licence: CR... | 3.484375 | 3 |
process_data/all/code/split_voxel_then_img.py | hailieqh/3D-Object-Primitive-Graph | 2 | 12798616 | import scipy.io
import numpy as np
import os
import random
import json
import pdb
def check_image_voxel_match(cls):
root = os.path.abspath('.')
out_dir = os.path.join(root, '../output', cls)
# out_dir = '/Users/heqian/Research/projects/primitive-based_3d/data/all_classes/chair'
voxel_txt_dir = os.path... | 2.234375 | 2 |
poe_client/client.py | moowiz/poe-client | 5 | 12798617 | import logging
from types import TracebackType
from typing import Callable, Dict, List, Optional, Type, TypeVar
import aiohttp
from yarl import URL
from poe_client.rate_limiter import RateLimiter
from poe_client.schemas.account import Account, Realm
from poe_client.schemas.character import Character
from poe_client.s... | 2.171875 | 2 |
Ex.15-Numpy.py | aguinaldolorandi/100-exercicios-Numpy | 0 | 12798618 | #Exercícios Numpy-15
#*******************
import numpy as np
arr=np.ones((10,10))
arr[1:-1,1:-1]=0
print(arr)
print()
arr_zero=np.zeros((8,8))
arr_zero=np.pad(arr_zero,pad_width=1,mode='constant',constant_values=1)
print(arr_zero) | 3.328125 | 3 |
parser-stories.py | labsletemps/barometre-parite | 1 | 12798619 | <filename>parser-stories.py
# coding: utf-8
import requests
from bs4 import BeautifulSoup
import pandas as pd
import re
from math import nan
# config
from define import config
# NLP
import spacy
import gender_guesser.detector as gender
# time
import datetime
import time
# to send MQTT message
import paho.mqtt.clie... | 3 | 3 |
crazyflie_driver/src/test_follower.py | xqgex/CrazyFlie_ros | 2 | 12798620 | <filename>crazyflie_driver/src/test_follower.py
#!/usr/bin/env python
import rospy
import crazyflie
import time
import uav_trajectory
if __name__ == '__main__':
rospy.init_node('test_high_level')
cf = crazyflie.Crazyflie("crazyflie", "crazyflie")
wand = crazyflie.Crazyflie("wand", "wand")
cf.setParam("command... | 2.4375 | 2 |
acceleration_sensor.py | therealjtgill/slam | 0 | 12798621 | import numpy as np
class AccelerationSensor:
def __init__(self, measurement_covariance):
self.R_meas = measurement_covariance
def getMeasurements(self, true_accel):
return np.random.multivariate_normal(true_accel, self.R_meas)
| 2.859375 | 3 |
eds/openmtc-gevent/server/openmtc-server/src/openmtc_server/plugins/transport_android_intent/IntentError.py | piyush82/elastest-device-emulator-service | 0 | 12798622 | <reponame>piyush82/elastest-device-emulator-service<filename>eds/openmtc-gevent/server/openmtc-server/src/openmtc_server/plugins/transport_android_intent/IntentError.py
#from client import IntentClient
class IntentError(Exception):
pass
# def sendIntent(self, context, action, issuer):
# client = IntentC... | 1.65625 | 2 |
iamheadless_projects/lookups/pagination.py | plain-ie/iamheadless_projects | 0 | 12798623 | import json
import math
from django.core.serializers import serialize
from django.db.models.query import QuerySet
ALLOWED_FORMATS = [
'dict',
'json',
'queryset'
]
class Pagination:
def __init__(
self,
page=1,
pages=1,
queryset=QuerySet(),
... | 2.359375 | 2 |
src/petronia/core/platform/api/locale/__init__.py | groboclown/petronia | 19 | 12798624 | <filename>src/petronia/core/platform/api/locale/__init__.py
"""
Information regarding the current user locale.
TODO should this be its own extension? It seems like it should, but that
would mean asking for a translation would need to go through the event bus,
and that doesn't seem right.
"""
| 1.21875 | 1 |
compareSamples.py | golharam/bam-matcher | 0 | 12798625 | <reponame>golharam/bam-matcher
#!/usr/bin/env python
'''
Script to compare genotypes
Not every sample is going to have a meltedResults.txt. For a list of samples (sample1, ..., sampleN),
an all v all nieve approach would require O(n^2) comparisons, but really, we can do this in O(n log(n)).
For example, 5 samples... | 2.640625 | 3 |
pkpdapp/pkpdapp/wsgi.py | pkpdapp-team/pkpdapp | 4 | 12798626 | #
# This file is part of PKPDApp (https://github.com/pkpdapp-team/pkpdapp) which
# is released under the BSD 3-clause license. See accompanying LICENSE.md for
# copyright notice and full license details.
#
"""
WSGI config for pkpdapp project.
It exposes the WSGI callable as a module-level variable named ``application... | 1.421875 | 1 |
generation/SGAN/models.py | nyw-pathfinder/Deep-Learning-Bootcamp-with-PyTorch | 15 | 12798627 | <filename>generation/SGAN/models.py
import torch.nn as nn
class AuxiliaryClassifier(nn.Module):
def __init__(self, in_features, n_classes, kernel_size=1, stride=1, padding=0, bias=False, softmax=False,
cnn=False):
super(AuxiliaryClassifier, self).__init__()
if cnn:
cla... | 2.625 | 3 |
instance_based/tagvote.py | vohoaiviet/tag-image-retrieval | 50 | 12798628 | <reponame>vohoaiviet/tag-image-retrieval
import sys, os, time, random
from basic.constant import ROOT_PATH
from basic.common import printStatus, readRankingResults
from basic.util import readImageSet
from basic.annotationtable import readConcepts
from util.simpleknn import simpleknn
#from sandbox.pquan.pqsearch import... | 2.421875 | 2 |
awe/parser.py | dankilman/pages | 97 | 12798629 | import inspect
import six
import yaml
from . import view
SPECIAL_KWARGS_KEYS = {'id', 'cols', 'updater'}
_init_cache = {}
class ParserContext(object):
def __init__(self, inputs):
self.inputs = inputs or {}
class Parser(object):
def __init__(self, registry):
self.registry = registry
... | 2.359375 | 2 |
users/management/commands/utils/init_models.py | GolamMullick/HR_PROJECT | 0 | 12798630 | from users.models import Model
def init_models(license):
Model.load_on_migrate(license)
print("models worked!!") | 1.75 | 2 |
pydefect/analyzer/band_edge_states.py | kumagai-group/pydefect | 20 | 12798631 | <filename>pydefect/analyzer/band_edge_states.py<gh_stars>10-100
# -*- coding: utf-8 -*-
# Copyright (c) 2020. Distributed under the terms of the MIT License.
from dataclasses import dataclass
from typing import List, Dict, Tuple, Optional, Set
import numpy as np
from monty.json import MSONable
from pydefect.defaults ... | 2.21875 | 2 |
tests/create_table_test.py | aescwork/sqlitemgr | 1 | 12798632 | <reponame>aescwork/sqlitemgr
import unittest
import os
import sys
sys.path.append("../sqlitemgr/")
import sqlitemgr as sqm
class CreateTableTest(unittest.TestCase):
"""
The way the create_table function is being tested is to have the SQLiteMgr object compose and execute an SQL statement to create a table in fruit.... | 3.75 | 4 |
tests/data/queue_report_test.py | seoss/scs_core | 3 | 12798633 | <reponame>seoss/scs_core
#!/usr/bin/env python3
"""
Created on 27 Aug 2019
@author: <NAME> (<EMAIL>)
"""
from scs_core.data.queue_report import QueueReport, ClientStatus
# --------------------------------------------------------------------------------------------------------------------
filename = '/tmp/southcoa... | 1.679688 | 2 |
websocket_server/quick.py | CylonicRaider/websocket-server | 1 | 12798634 | <filename>websocket_server/quick.py
# websocket_server -- WebSocket/HTTP server/client library
# https://github.com/CylonicRaider/websocket-server
"""
Convenience functions for quick usage.
"""
import sys
import argparse
from .server import WebSocketMixIn
from .httpserver import WSSHTTPServer, RoutingRequestHandler
... | 2.828125 | 3 |
test/test_del_contact.py | vyacheslavmarkov/python_training | 0 | 12798635 | <gh_stars>0
from model.contact import Contact
import random
def test_delete_first_contact(app, db, check_ui):
if len(db.get_contact_list()) == 0:
app.contact.create(Contact(firstname="Tester", middlename="Something", lastname="Trump",
photo="picture.jpg", nickname="super... | 2.40625 | 2 |
IMLearn/metalearners/adaboost.py | dani3lwinter/IML.HUJI | 0 | 12798636 | <reponame>dani3lwinter/IML.HUJI<filename>IMLearn/metalearners/adaboost.py
import numpy as np
# from ...base import BaseEstimator
from IMLearn.base import BaseEstimator
from typing import Callable, NoReturn
from IMLearn.metrics import misclassification_error
class AdaBoost(BaseEstimator):
"""
AdaBoost class f... | 2.9375 | 3 |
montydb/engine/core/__init__.py | gitter-badger/MontyDB | 0 | 12798637 | <gh_stars>0
from .field_walker import (
FieldWalker,
FieldWriteError,
_no_val,
)
from .weighted import (
Weighted,
gravity,
_cmp_decimal,
_decimal128_INF,
_decimal128_NaN_ls,
)
__all__ = [
"FieldWalker",
"FieldWriteError",
"_no_val",
"Weighted",
"gravity",
"_... | 1.5 | 2 |
pydigree/__init__.py | jameshicks/pydigree | 18 | 12798638 | #!/usr/bin/env python
import sys
if sys.version_info < (3,3):
raise ImportError('pydigree requires Python 3')
# Common functions (cumsum, table, etc)
import pydigree.common
from pydigree.ibs import ibs
from pydigree.rand import set_seed
# Functions for navigating pedigree structures
from pydigree.paths import p... | 1.734375 | 2 |
sandbox/python/speed test/basicTest.py | atabulog/rpi-dashboard | 0 | 12798639 | <reponame>atabulog/rpi-dashboard<gh_stars>0
"""
author(s): <NAME>
date: 12/30/21
email: <EMAIL>
=========================================================
This file is subject to the MIT license copyright notice.
=========================================================
Script to test speedtest related objects.
"""
#... | 1.882813 | 2 |
main.py | szabolcsdombi/heightmap-multitexture-terrain | 1 | 12798640 | <filename>main.py
import math
import struct
import GLWindow
import ModernGL
from PIL import Image
from pyrr import Matrix44
wnd = GLWindow.create_window()
ctx = ModernGL.create_context()
prog = ctx.program([
ctx.vertex_shader('''
#version 330
uniform mat4 Mvp;
uniform sampler2D Heightmap... | 2.15625 | 2 |
pubmedmetrics/db.py | wenwei-dev/PubMedMetrics | 3 | 12798641 | import os
import logging
from contextlib import contextmanager
from sqlite3 import dbapi2 as sqlite
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
from sqlalchemy import Column, String, Integer, Sequence
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.dialects.sqlit... | 2.75 | 3 |
scripts/pyvision/gui/SimpleLiveDemo.py | wolfram2012/ros_track_ssd | 0 | 12798642 | '''
This file provides a basic framework for a live demo. In this case the
demo is for face and eye detection.
Copyright <NAME>
Created on Jul 9, 2011
@author: bolme
'''
import pyvision as pv
import cv
from pyvision.face.CascadeDetector import CascadeDetector
from pyvision.face.FilterEyeLocator import FilterEyeLoc... | 2.828125 | 3 |
src/Loan Classification.py | Sami-ul/Loan-Classification | 2 | 12798643 | #!/usr/bin/env python
# coding: utf-8
# # Loan Classification Project
# In[1]:
# Libraries we need
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
from sklearn.preprocessing import StandardScaler
from sklearn.model_selection import train_test_split
from sklearn.discri... | 3.046875 | 3 |
InBuiltExcptionHandling.py | ShanmukhaSrinivas/python-75-hackathon | 0 | 12798644 | <filename>InBuiltExcptionHandling.py
#Handling Built-in Exceptions
try:
a=[int(i) for i in input('Enter a list:').split()]
except Exception as e:
print(e)
else:
print(sum(a))
| 2.9375 | 3 |
gerador_de_senha.py | marcelo-py/gerador_de_senhas | 1 | 12798645 | from random import randint, choice, shuffle
"""gerador de senha simples
ele basicamente pega todo tipo de caractere digitado pelo usuário
e depois de cada um deles é colocado um número de 1 a 10 e mais um símbolo"""
letras = list()
senha = list()
chave = input('Digite a base da sua senha: ')
while len(chave) >... | 3.90625 | 4 |
3vennsvg.py | rwst/wikidata-molbio | 2 | 12798646 | from sys import *
from matplotlib_venn import venn3, venn3_circles
from matplotlib import pyplot as plt
s1 = set(open('wd-inst-of-prot', 'r').readlines())
s2 = set(open('wd-subc-of-prot', 'r').readlines())
s3 = set(open('wd-refseqp', 'r').readlines())
#s4 = set(open('t4', 'r').readlines())
venn3([s3,s2,s1], ('RefSeq',... | 2.171875 | 2 |
test_plot.py | EntropyF/ia-flood-risk-project | 0 | 12798647 | import datetime
from floodsystem.datafetcher import fetch_measure_levels
from floodsystem.stationdata import build_station_list
from floodsystem.plot import plot_water_levels, plot_water_level_with_fit
stations = build_station_list()
import numpy as np
def test_polt_water_level_with_fit():
x = np.linspace(1, 100... | 2.65625 | 3 |
src/OTLMOW/OTLModel/Datatypes/KlLEMarkeringSoort.py | davidvlaminck/OTLClassPython | 2 | 12798648 | <gh_stars>1-10
# coding=utf-8
from OTLMOW.OTLModel.Datatypes.KeuzelijstField import KeuzelijstField
from OTLMOW.OTLModel.Datatypes.KeuzelijstWaarde import KeuzelijstWaarde
# Generated with OTLEnumerationCreator. To modify: extend, do not edit
class KlLEMarkeringSoort(KeuzelijstField):
"""Mogelijke markeringsoorte... | 1.84375 | 2 |
CSIKit/csi/frames/esp.py | serrhini/CSIKit | 0 | 12798649 | from CSIKit.csi import CSIFrame
import ast
import numpy as np
class ESP32CSIFrame(CSIFrame):
# https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/network/esp_wifi.html#_CPPv418wifi_pkt_rx_ctrl_t
__slots__ = ["type", "role", "mac", "rssi", "rate", "sig_mode", "mcs", "bandwidth", "smoot... | 2.3125 | 2 |
examples/simple_expression/exp_autoencoder.py | m-colombo/tf_tree | 0 | 12798650 | from tensorflow_trees.encoder import Encoder, EncoderCellsBuilder
from tensorflow_trees.decoder import Decoder, DecoderCellsBuilder
from examples.simple_expression.exp_definition import BinaryExpressionTreeGen, NaryExpressionTreeGen
from tensorflow_trees.definition import Tree
from examples.simple_expression.flags_def... | 2.171875 | 2 |