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 |
|---|---|---|---|---|---|---|
labs/lab-1/exercises/lab-1.1-introduction-to-tensorflow/1.1-introduction-to-tensorflow.py | rubenandrebarreiro/fct-nova-deep-learning-labs | 1 | 12799551 | <reponame>rubenandrebarreiro/fct-nova-deep-learning-labs
"""
Lab 1.1 - Introduction to TensorFlow
Author:
- <NAME> (<EMAIL>)
- <NAME> (<EMAIL>)
"""
# Import the Libraries and Packages
# Import the Operative System Library as operative_system
import os as operative_system
# Disable all the Debugging Logs from Tenso... | 3.078125 | 3 |
tests/components/meteo_france/conftest.py | jasperro/core | 7 | 12799552 | """Meteo-France generic test utils."""
from unittest.mock import patch
import pytest
@pytest.fixture(autouse=True)
def patch_requests():
"""Stub out services that makes requests."""
patch_client = patch("homeassistant.components.meteo_france.meteofranceClient")
patch_weather_alert = patch(
"homea... | 2.15625 | 2 |
core/spark_utils.py | malashkovv/scientific-paper-processing | 0 | 12799553 | import os
from contextlib import contextmanager
from pyspark.sql import SparkSession
from .log import logger
@contextmanager
def spark_session(config=None):
pre_spark = SparkSession.builder \
.appName('science-papers-ml') \
.master(f"spark://{os.environ.get('SPARK_MASTER_HOST', 'spark-master')}:... | 2.421875 | 2 |
Scripts/stackedBarChart.py | Albertios/PythonInGIS_EagleOwl | 0 | 12799554 | import matplotlib.pyplot as plt
import numpy as np
cnames = [
'#F0F8FF',
'#FAEBD7',
'#00FFFF',
'#7FFFD4',
'#F0FFFF',
'#F5F5DC',
'#FFE4C4',
'#000000',
'#FFEBCD',
'#0000FF',
'#8A2BE2',
'#A52A2A',
'#DEB887',
'#... | 1.398438 | 1 |
scraper/storage_spiders/yensaophuyenvn.py | chongiadung/choinho | 0 | 12799555 | <reponame>chongiadung/choinho
# Auto generated by generator.py. Delete this line if you make modification.
from scrapy.spiders import Rule
from scrapy.linkextractors import LinkExtractor
XPATH = {
'name' : "//h1[@class='nameprod']",
'price' : "//div[@class='c2']/div[@class='imp'][1]/span[@class='price']",
... | 1.851563 | 2 |
datasets/dataset_utils.py | SimuJenni/Correspondences | 0 | 12799556 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | 2.265625 | 2 |
main.py | diekmann/RFC3526_reproduce | 0 | 12799557 | #!/usr/bin/env python3
from decimal import *
from binascii import unhexlify
# need some precision to evaluate PI
getcontext().prec = 2000
# from the python docs
def pi():
"""Compute Pi to the current precision.
>>> print(pi())
3.141592653589793238462643383
"""
getcontext().prec += 2 # extra d... | 3.515625 | 4 |
equipment_engineering/meter_reader_4_pointer/setup.py | afterloe/opencv-practice | 5 | 12799558 | <reponame>afterloe/opencv-practice
#!/usr/bin/env python3
# -*- coding=utf-8 -*-
from setuptools import setup
PROJECT_NAME = "meter_reader_4_pointer"
VERSION = "1.2.0"
setup(
name=PROJECT_NAME,
version=VERSION,
packages=find_packages(),
include_package_data=True,
install_requires=["o... | 1.109375 | 1 |
setup.py | pingf/yadashcomp | 0 | 12799559 | <reponame>pingf/yadashcomp<filename>setup.py
from setuptools import setup
exec (open('yadashcomp/version.py').read())
setup(
name='yadashcomp',
version=__version__,
author='pingf',
packages=['yadashcomp'],
include_package_data=True,
license='MIT',
description='yet another dash components',... | 1.34375 | 1 |
play/botos3write.py | mpechner/Security-Camera | 0 | 12799560 | import boto3
import os
camera='1'
bucket='mikey.com-security'
path='/mnt/cameraimages/images'
s3 = boto3.resource('s3')
for dirName, subdirList, fileList in os.walk(path):
for fname in fileList:
if len(path) == len(dirName):
finame=fname
else:
finame = '%s/%s'%(dirName[len(... | 2.28125 | 2 |
lib/mags_mash/utils/mags_filter.py | kbaseapps/mags_mash | 1 | 12799561 | <reponame>kbaseapps/mags_mash
from installed_clients.WorkspaceClient import Workspace
from installed_clients.DataFileUtilClient import DataFileUtil
import numpy as np
import pandas as pd
import os
from collections import defaultdict
from scipy.cluster.hierarchy import linkage, leaves_list
def create_tree(GOLD, tree_... | 2.453125 | 2 |
codewars/7kyu/dinamuh/SpeedControl/test.py | dinamuh/Training_one | 0 | 12799562 | <filename>codewars/7kyu/dinamuh/SpeedControl/test.py
from main import gps
def test_gps(benchmark):
assert benchmark(gps, 20, [0.0, 0.23, 0.46, 0.69, 0.92, 1.15, 1.38, 1.61]) == 41
assert benchmark(gps, 12, [0.0, 0.11, 0.22, 0.33, 0.44, 0.65, 1.08, 1.26, 1.68, 1.89, 2.1, 2.31, 2.52, 3.25]) == 219
assert be... | 2.59375 | 3 |
thelper/gui/utils.py | crim-ca/thelper | 0 | 12799563 | """Graphical User Interface (GUI) utility module.
This module contains various tools and utilities used to instantiate annotators and GUI elements.
"""
import logging
import thelper.utils
logger = logging.getLogger(__name__)
def create_key_listener(callback):
"""Returns a key press listener based on pynput.key... | 2.90625 | 3 |
exts/__init__.py | rawmeat898/Quote-Finder | 0 | 12799564 | <gh_stars>0
from configparser import ConfigParser
config = ConfigParser()
config.read('data/channels.ini')
| 1.445313 | 1 |
acf_example/httpbin_client/actions/request_inspection.py | Jamim/acf | 5 | 12799565 | from .base import HttpbinAction
class GetHeadersAction(HttpbinAction):
METHOD = 'GET'
URL_COMPONENTS = ['headers']
RESULT_KEY = 'headers'
class GetIPAction(HttpbinAction):
METHOD = 'GET'
URL_COMPONENTS = ['ip']
RESULT_KEY = 'origin'
class GetUserAgentAction(HttpbinAction):
METHOD = ... | 2.21875 | 2 |
session_1/Test.py | idlaviV/intro-to-python | 0 | 12799566 | for index, entry in enumerate({"Tam", "Tim", "Tom"}):
print(f"{index}: {entry}")
for index, entry in enumerate({"Tam", "Tom", "Tim"}):
print(f"{index}: {entry}")
for index, entry in enumerate({"Tam", "Tom", "Tim"}):
print(f"{index}: {entry}")
for index, entry in enumerate({"Tam", "Tom", "Tim"}):
prin... | 3.9375 | 4 |
rllib/agent/on_policy/expected_actor_critic_agent.py | shenao-zhang/DCPU | 8 | 12799567 | """Implementation of Expected-Actor Critic Agent."""
from rllib.algorithms.eac import ExpectedActorCritic
from .actor_critic_agent import ActorCriticAgent
class ExpectedActorCriticAgent(ActorCriticAgent):
"""Implementation of the Advantage-Actor Critic.
TODO: build compatible function approximation.
Re... | 2.328125 | 2 |
Keras_Code/model/nets.py | trungvdhp/mpsnet | 0 | 12799568 | from model.adacos import AdaCos
from model.blocks import NetBlock
from tensorflow.keras.layers import Input, Reshape, Conv2D, Activation, Flatten, Dropout, add
from tensorflow.keras.models import Model
import tensorflow.keras.backend as K
class Net:
def __init__(self, config):
self.model_name = config... | 2.328125 | 2 |
colour.py | joshuawise610/PythonColour | 1 | 12799569 | """A wrapper for the colorama module."""
"""
Copyright 2019 - 2020 <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 b... | 3.46875 | 3 |
Cryptography/MorseCode/morsecode.py | AoWangDrexel/PiApproximationExperiments | 0 | 12799570 | <gh_stars>0
"""
Author: <NAME>
Date: 08/12/19
Description: Morse code encryper and decryter
"""
# The function retrieves the morse code from a text file and cleans it up so the letters
# can be stored in the keys and code into the values
def loadMorseTable():
codes = ""
with open("morseTable.txt", "r") as code... | 4.125 | 4 |
ares/simulations/MultiPhaseMedium.py | astrojhgu/ares | 1 | 12799571 | <filename>ares/simulations/MultiPhaseMedium.py
"""
MultiPhaseMedium.py
Author: <NAME>
Affiliation: University of Colorado at Boulder
Created on: Mon Feb 16 12:46:28 MST 2015
Description:
"""
import numpy as np
from .GasParcel import GasParcel
from ..util import ParameterFile, ProgressBar
from ..util.ReadData impo... | 2.25 | 2 |
web/migrations/0042_auto_20180808_1500.py | ocwc/oerweekapi | 0 | 12799572 | <filename>web/migrations/0042_auto_20180808_1500.py
# -*- coding: utf-8 -*-
# Generated by Django 1.11.15 on 2018-08-08 15:00
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('web', '0041_auto_20180808_1450'),
]... | 1.234375 | 1 |
cata/plotters/unified_plotter.py | seblee97/student_teacher_catastrophic | 2 | 12799573 | import os
from typing import Dict
from typing import Optional
from typing import Union
import pandas as pd
from cata import constants
from cata.plotters import base_plotter
class UnifiedPlotter(base_plotter.BasePlotter):
"""Class for plotting generalisation errors, overlaps etc.
For case when logging is don... | 2.578125 | 3 |
Zad_Decorator/Potwierdzenie.py | Paarzivall/Wzorce-Projektowe | 0 | 12799574 | from Komponent import Komponent
class Potwierdzenie(Komponent):
def drukuj(self):
print("POTWIERDZENIE")
| 1.890625 | 2 |
helpers.py | janosh/auto-repo-config | 0 | 12799575 | import os
from typing import Any
import requests
import yaml
if os.path.exists("gh_token.py"):
from gh_token import GH_TOKEN
else:
GH_TOKEN = os.environ["GH_TOKEN"]
headers = {"Authorization": f"token {GH_TOKEN}"}
def query_gh_gpl_api(query: str) -> dict:
"""Query the GitHub GraphQL API.
Args:
... | 2.765625 | 3 |
kosudoku/montecarlo.py | buzbarstow/collectionmc | 0 | 12799576 | # ------------------------------------------------------------------------------------------------ #
def ImportEssentialityData(fileName):
# Not yet ready for prime time
# Import a defined format essentiality data file
# Assumes that data is in the format: locus tag, gene name, essentiality
from .utils import ParseC... | 2.859375 | 3 |
tests/test_actions.py | pauloromeira/onegram | 150 | 12799577 | import pytest
from onegram.exceptions import NotSupportedError
from onegram import follow, unfollow
from onegram import like, unlike
from onegram import comment, uncomment
from onegram import save, unsave
def test_follow(logged, user, cassette):
if logged:
response = follow(user)
assert response... | 2.375 | 2 |
doc/example.py | ericbulloch/authorize | 1 | 12799578 | <filename>doc/example.py<gh_stars>1-10
from authorize import cim
from pprint import pprint
# Note that you need to specify a delimiter and an encapsulator
# for your account (either in your account dashboard or through
# the constructor of any of the API objects
cim_api = cim.Api(u'LOGIN', u'TRANS_KEY', is_test=True,... | 2.6875 | 3 |
advent_2020/report_repair.py | SutterButter4/AdventOfCode | 0 | 12799579 | <reponame>SutterButter4/AdventOfCode
from typing import List, Tuple, Optional
def report_repair(input_data_filepath: str) -> Tuple[int, int]:
report_data = parse_input(input_data_filepath)
report_data.sort()
pair = find_pair(report_data, 2020)
(a, b) = (-1, -1)
if pair:
(a, b) = pair
... | 3.53125 | 4 |
aws/ec2util.py | skinheadbob/trinity | 2 | 12799580 | import logging
import math
import os
import time
import boto3
from pyspark.sql import SparkSession
def get_asg_inservice_instance_count(asg_name: str, region_name: str) -> int:
client = boto3.client('autoscaling', region_name=region_name)
asg = client.describe_auto_scaling_groups(AutoScalingGroupNames=[asg_n... | 2.296875 | 2 |
account/forms.py | nvvu99/news-aggregator | 0 | 12799581 | from django import forms
from .models import User
from news.models import Category
from django.utils.translation import gettext, gettext_lazy as _
from django.contrib.auth import authenticate, forms as auth_forms
from django.db.models import Q
class LoginForm(forms.Form):
username = forms.CharField(
label... | 2.203125 | 2 |
falcon_rest/session.py | boomletsgo/falcon-rest | 0 | 12799582 | <reponame>boomletsgo/falcon-rest
from contextlib import contextmanager
from sqlalchemy.orm import sessionmaker
@contextmanager
def make(db_engine, **kwargs):
"""Scope a db_session for a context, and close it afterwards"""
db_session = sessionmaker(bind=db_engine, **kwargs)()
try:
yield db_session
... | 2.1875 | 2 |
parabox/behaviour/movable/movable.py | DenisMinich/parabox | 0 | 12799583 | from kivy.properties import (
NumericProperty, ReferenceListProperty, BooleanProperty)
from kivy.vector import Vector
from parabox.base_object import BaseObject
class Movable(BaseObject):
"""Mixins for movable classes"""
velocity_x = NumericProperty(0)
velocity_y = NumericProperty(0)
velocity = R... | 2.921875 | 3 |
app/core/settings.py | oxfn/owtest | 0 | 12799584 | from functools import lru_cache
from pydantic import BaseSettings
class Settings(BaseSettings):
"""Settings model."""
secret_key: str = ""
mongo_url: str = ""
testing: bool = False
@lru_cache(typed=False)
def get_settings() -> Settings:
"""Initialize settings."""
return Settings()
| 2.53125 | 3 |
tests/unittest/test_autograd.py | yuhonghong66/minpy | 1,271 | 12799585 | from __future__ import print_function
import minpy.numpy as mp
import numpy as np
import minpy.dispatch.policy as policy
from minpy.core import convert_args, return_numpy, grad_and_loss, grad, minpy_to_numpy as mn, numpy_to_minpy as nm
import time
# mp.set_policy(policy.OnlyNumPyPolicy())
def test_autograd():
@c... | 2.453125 | 2 |
geometry.py | Justcoderguy/python_training | 0 | 12799586 | from point import Point
__author__ = 'pzqa'
l1 = list(map(lambda i: Point(i, i*i), range(-5, 6)))
l2 = list(filter(lambda el: el.x % 2 == 0, l1))
print(l1)
print(l2)
| 2.65625 | 3 |
Python/python_basic_project.py | Bozmenn/Patika | 0 | 12799587 | #SORU 1_______________________________________________________
l_r=[]
def flatten(l):
for j in l:
if type(j) == list:
flatten(j)
else:
l_r.append(j)
return l_r
x= [[1,"a",["cat"],2],[[[3]],"dog"],4,5]
print(flatten(x))
#SORU 2_________________________________________________________
def rev(l... | 3.78125 | 4 |
main/academy/migrations/0001_initial.py | UsamaKashif/studentutor | 7 | 12799588 | <reponame>UsamaKashif/studentutor<gh_stars>1-10
# Generated by Django 3.0.4 on 2020-08-31 17:24
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
migrations.swappable_depe... | 1.648438 | 2 |
regaudio.py | janhradek/regaudio | 0 | 12799589 | <filename>regaudio.py
#!/usr/bin/env python
'''
Created on Mar 8, 2012
@author: <NAME>, <EMAIL>
Requirements
- Python 3
- PyQt4
- SQLAlchemy
- SQLite
- numpy (diff)
Features
- filter tracks case insensitive, advanced filetring: !a:artist !n:name !r:rating
- groups, group selector, favorites (first in the selector)
-... | 2.234375 | 2 |
analysis & data processing/generate_frequency_from_entity.py | jackwong95/TDS3751_SocialMediaCampaign | 0 | 12799590 | entity = {}
with open("../output/analysis twitter output/entity.txt", "r", encoding="utf-8") as f:
for line in f:
word = line.replace('\n','')
if word not in entity:
entity[word] = 0
entity[word] = entity[word] + 1
with open("../output/analysis output/entity.txt", "r", encoding="utf-8") as f:
for lin... | 2.703125 | 3 |
src/processor.py | OlegDurandin/AuthorStyle | 3 | 12799591 | from abc import ABC, abstractmethod
import os
import spacy_udpipe
from .utils import load_pickled_file
from .settings import PATH_TO_RUS_UDPIPE_MODEL
import spacy
def processTag(tag_representation):
res = {}
if len(tag_representation.split('|')) > 0:
for one_subtag in tag_representation.split('|'):
... | 2.40625 | 2 |
krikos/nn/network.py | ShubhangDesai/nn-micro-framework | 1 | 12799592 | import numpy as np
from krikos.nn.layer import BatchNorm, BatchNorm2d, Dropout
class Network(object):
def __init__(self):
super(Network, self).__init__()
self.diff = (BatchNorm, BatchNorm2d, Dropout)
def train(self, input, target):
raise NotImplementedError
def eval(self, input)... | 2.828125 | 3 |
nonebot-plugin-pixivbot/mongo_helper.py | umimori13/mai-bot | 0 | 12799593 | import getpass
from pymongo import MongoClient
def main():
hostname = input("MongoDB Hostname (Default: localhost): ")
if not hostname:
hostname = "localhost"
port = input("MongoDB Port (Default: 27017): ")
if not port:
port = "27017"
username = input("MongoDB Username: ")
p... | 2.828125 | 3 |
setup.py | renatoliveira/monta | 0 | 12799594 | <filename>setup.py<gh_stars>0
#!/usr/bin/env python3
from setuptools import setup
setup(
name='monta',
version='1.2',
description='Disk mounting shortcut for use with dmenu.',
author='<NAME>',
url='https://github.com/renatoliveira/monta',
include_package_data=True,
package_data={
'': [
'monta',
'licens... | 1.34375 | 1 |
udacity/l02c01_celsius_to_fahrenheit.py | mrdvince/tensorflowdevcert | 1 | 12799595 | <filename>udacity/l02c01_celsius_to_fahrenheit.py<gh_stars>1-10
import tensorflow as tf
import numpy as np
import logging
logger = tf.get_logger()
logger.setLevel(logging.ERROR)
# training data
celsius_q = np.array([-40, -10, 0, 8, 15, 22, 38], dtype=float)
fahrenheit_a = np.array([-40, 14, 32, 46, 59, 72, 100], dtyp... | 3 | 3 |
piggy/piggy.py | facorazza/piggy | 4 | 12799596 | import logging
import json
import time
from random import random, randint
import asyncio
import aiohttp
import aiosqlite
import aiofiles
import regex
from aiohttp.client_exceptions import ClientConnectorError
from piggy import utils
# Logging
logger = logging.getLogger(__name__)
logger.setLevel(logging.DEBUG)
ch... | 2.453125 | 2 |
yaplee/server.py | ThisIsMatin/Yaplee | 1 | 12799597 | import os
import random
import tempfile
import webbrowser
import time
import uuid
import socket
import shutil
import subprocess
import pathlib
from bs4 import BeautifulSoup
from yaplee.errors import UnknownTemplateValue
from yaplee.js.converter import JSFunc
class Server:
def __init__(self, meta) -> None:
... | 2.125 | 2 |
extract_unique_tags_es_xyz.py | MikhailKuklin/Scripts-for-Software-of-Computational-Chemistry-and-Physics | 0 | 12799598 | # import module and read xyz file
from ase.io import read, write
file=read('last3.xyz', index=":")
# create list of tags
tags = []
for structure in file:
if structure.info['config_type'] not in tags:
tags.append(structure.info['config_type'])
# extract unique tags and energy sigma
dict={}
for i in tags:
... | 2.609375 | 3 |
Prescp_transf/venv_lapt/main.py | kowalskaw/Perspective_transformation | 0 | 12799599 | import cv2
import numpy as np
from matplotlib import pyplot as plt
l: list = []
img = None
img_cp = None
def draw_circle(event, x, y, flags, param):
global l
global img
global img_cp
if event == cv2.EVENT_LBUTTONDOWN:
cv2.circle(img_cp, (x, y), 5, (255, 0, 0), -1)
l.append([x, y])
... | 2.984375 | 3 |
tests/test_text.py | UUDigitalHumanitieslab/tei_reader | 13 | 12799600 | <gh_stars>10-100
import unittest
from difflib import Differ
from xml.dom import minidom
from os import linesep
from .context import get_files, tei_reader
from pprint import pprint
class TestText(unittest.TestCase):
def test_files(self):
differ = Differ()
reader = tei_reader.TeiReader()
fo... | 2.5 | 2 |
scryptos/crypto/attack/__init__.py | scryptos/scryptoslib | 30 | 12799601 | <gh_stars>10-100
import scryptos.crypto.attack.rsautil as rsautil
import scryptos.crypto.attack.knapsackutil as knapsackutil
import scryptos.crypto.attack.prngutil as prngutil
| 1.117188 | 1 |
docs/00.Python/demo_pacages/test.py | mheanng/PythonNote | 0 | 12799602 | <reponame>mheanng/PythonNote
from p1 import *
import p1.m1
import p1.m2
import p1.m3
import p1.m4
p1.m4.mm_main()
import p1.pp1.a1
import p1.pp1.a2
import p1.pp1.a3 | 1.085938 | 1 |
wav2vec/project/data_processor/dataset.py | rocabrera/audio-learning | 0 | 12799603 | <reponame>rocabrera/audio-learning
import re
import os
import json
import pandas as pd
from glob import glob
from abc import ABC, abstractmethod
class DataBase(ABC):
@abstractmethod
def make_tidy(self):
pass
@abstractmethod
def parse_data(self) -> pd.DataFrame:
pass
clas... | 2.921875 | 3 |
UnicornHAT/clock.py | gerb030/PiTrials | 0 | 12799604 | <gh_stars>0
#!/usr/bin/env python
import colorsys
import time
from sys import exit
try:
from PIL import Image, ImageDraw, ImageFont
except ImportError:
exit('This script requires the pillow module\nInstall with: sudo pip install pillow')
FONT = ('/usr/share/fonts/truetype/freefont/FreeSansBold.ttf', 12)
uni... | 2.328125 | 2 |
OOP_formy/src/pages/radio_button_page.py | AntonioIonica/Automation_testing | 0 | 12799605 | <gh_stars>0
"""
Radio button page
clicking them in different order
"""
from pages.base_page import BasePage
import time
from selenium.webdriver.common.by import By
class RadioButtonPage(BasePage):
RADIO_BTN_1 = (By.ID, 'radio-button-1')
RADIO_BTN_2 = (By.XPATH, '/html/body/div/div[2]/input')
RADIO_BTN_3 ... | 2.78125 | 3 |
frappe-bench/apps/erpnext/erpnext/patches/v10_0/update_project_in_sle.py | Semicheche/foa_frappe_docker | 1 | 12799606 | # Copyright (c) 2017, Frappe and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def execute():
for doctype in ['Sales Invoice', 'Delivery Note', 'Stock Entry']:
frappe.db.sql(""" update
`tabStock Ledger Entry` sle, `tab{0}` parent_do... | 1.859375 | 2 |
matplotlib/two_line_in_same_plot.py | abhayanigam/Learn_Python_Programming | 1 | 12799607 | <reponame>abhayanigam/Learn_Python_Programming<filename>matplotlib/two_line_in_same_plot.py<gh_stars>1-10
import numpy as np
from matplotlib import pyplot as plt
p = np.array([0,10])
p2 = p*2
p3 = p*3
plt.plot(p,p2,color = 'b',ls = '-.',linewidth = 2)
plt.plot(p,p3,color = 'y',ls = '-',linewidth = 3)
plt.title("Two lin... | 3.625 | 4 |
pypy/jit/codegen/detect_cpu.py | camillobruni/pygirl | 12 | 12799608 | <filename>pypy/jit/codegen/detect_cpu.py
"""
Processor auto-detection
"""
import sys, os
class ProcessorAutodetectError(Exception):
pass
def autodetect():
mach = None
try:
import platform
mach = platform.machine()
except ImportError:
pass
if not mach:
platform = sy... | 2.71875 | 3 |
vtk/styles.py | voltverse/vtk | 0 | 12799609 | <filename>vtk/styles.py
import vtk.term as term
class Style:
def __init__(self):
self.code = 0
def _render(self):
return "{}[{}m".format(term.ESCAPE_CHARACTER, self.code)
class Style_Reset(Style):
def __init__(self):
super()
self.code = 0
class Style_Bold(Style):
... | 2.6875 | 3 |
src/conftest.py | hashihei/python-tools-ftpsdel | 0 | 12799610 | <filename>src/conftest.py
#
#
# RefURL: https://docs.pytest.org/en/latest/example/parametrize.html
#
#
#
# import
#
import pytest
def pytest_addoption(parser):
"""Add pytest command options."""
#RefURL: https://docs.python.org/3/library/argparse.html#the-add-argument-method
parser.addoption(
"--c... | 1.96875 | 2 |
src/opedia_dataset_validator/validator.py | ctberthiaume/opedia_dataset_validator | 0 | 12799611 | from __future__ import unicode_literals
from .error import error
from io import open
import arrow
import os
import oyaml as yaml
import pandas as pd
import re
import sys
# Load dataset file specifications
spec_file_name = 'dataset_file_def.yaml'
spec_file_path = os.path.join(os.path.dirname(__file__), spec_file_name)
... | 2.53125 | 3 |
tools/grad_cam_tools/gfl_post_process.py | HAOCHENYE/yehc_mmdet | 1 | 12799612 | import torch.nn as nn
import torch.nn.functional as F
import torch
SCORE_THRESH = 0.3
STRIDE_SCALE = 8
IOU_THRESH = 0.6
class Integral(nn.Module):
"""A fixed layer for calculating integral result from distribution.
This layer calculates the target location by :math: `sum{P(y_i) * y_i}`,
P(y_i) denotes th... | 2.921875 | 3 |
intro.py | samsmusa/My-manim-master | 0 | 12799613 | <reponame>samsmusa/My-manim-master
from manimlib import *
# from manimlib.imports import *
import numpy as np
text = Text("hello")
text2 = Text("how are you")
text3 = Text("who are you")
ltext = Tex("hello world")
ltext2 = Tex("hey man!")
class intro(Scene):
def construct(self):
text = TexText("hello"," ... | 3.125 | 3 |
generateList.py | 42ip/animatedStickersDB | 4 | 12799614 | import sys,os
arr = []
files = os.listdir(sys.path[0] + '/stickersraw')
st = "{{$a := index .CmdArgs 0 }} \n"
st += "{{$b := cslice "
names = []
for fileName in files:
names.append(fileName.split('.')[0])
names = sorted(names)
n = ""
for name in names:
n += "\"" + name + "\" "
st += n
st += """ }}
{{if or ... | 2.375 | 2 |
Image_Video/image_video_newcode/blur_new.py | marvahm12/PyEng | 0 | 12799615 | import cv2
import sys
import matplotlib.pyplot as plt
def blur_display(infile, nogui=False):
# The first argument is the image
image = cv2.imread(infile)
#conver to grayscale
gray_image = cv2.cvtColor(image, cv2.COLOR_BGR2GRAY)
#blur it
blurred_image = cv2.GaussianBlur(image, (7,7), 0)
... | 3.640625 | 4 |
best_practice_examples/multiple_state_variables_bp.py | kallelzied/PythonTutoriel | 0 | 12799616 | <reponame>kallelzied/PythonTutoriel<filename>best_practice_examples/multiple_state_variables_bp.py
"""multiple_state_variables_bp.py: Giving an example of best practicing with multiple state variables."""
__author__ = "<NAME>"
__copyright__ = """
Copyright 2018 multiple_state_variables_bp.py
Licensed under t... | 3.203125 | 3 |
install/data/apps/internalTools/BAMval/BAMvalwrapper.py | inab/openEBench_vre | 1 | 12799617 | <reponame>inab/openEBench_vre
#!/usr/bin/python2.7
import os
import sys
import argparse
import json
import time
import socket # print localhost
import logging
import re
import pprint
import multiprocessing
#import psutil # available memory
import subprocess
import shutil
import glob
import tarfile
import subprocess
i... | 2.21875 | 2 |
ship_mapper/mapper.py | Diego-Ibarra/ship-mapper | 3 | 12799618 | import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
from matplotlib.patches import FancyBboxPatch
from matplotlib.colors import LinearSegmentedColormap
from mpl_toolkits.basemap import Basemap
import numpy as np
# Suppress matplotlib warnings
np.warnings.filterwarnings('ignore')
import ... | 2.40625 | 2 |
template/{{ cookiecutter.project_slug }}/{{ cookiecutter.project_module }}/cli/__init__.py | seldonPlan/pyscript | 0 | 12799619 | <gh_stars>0
from .init_cfg import init
from .root import root
# add sub-command functions here
root.add_command(init)
| 1.328125 | 1 |
tweezers/ixo/decorators.py | DollSimon/tweezers | 0 | 12799620 | <reponame>DollSimon/tweezers
class lazy(object):
"""
Property for the lazy evaluation of Python attributes. In the example below, the ``expensive_computation()`` is only
called when the attribute ``object.my_attribute`` is accessed for the first time.
Example:
Use the ``@lazy`` decorator for a ... | 3.9375 | 4 |
pymoo/model/repair.py | gabicavalcante/pymoo | 762 | 12799621 | <filename>pymoo/model/repair.py
from abc import abstractmethod
class Repair:
"""
This class is allows to repair individuals after crossover if necessary.
"""
def do(self, problem, pop, **kwargs):
return self._do(problem, pop, **kwargs)
@abstractmethod
def _do(self, problem, pop, **kw... | 3.203125 | 3 |
Server/Python/src/dbs/dao/MySQL/BlockSite/Insert.py | vkuznet/DBS | 8 | 12799622 | #!/usr/bin/env python
""" DAO Object for BlockSite table """
from dbs.dao.Oracle.BlockSite.Insert import Insert as OraBlockSiteInsert
class Insert(OraBlockSiteInsert):
pass
| 1.898438 | 2 |
Extra/plot_error.py | niefermar/APPIAN-PET-APPIAN | 1 | 12799623 | import pandas as pd
import matplotlib
matplotlib.use('Agg')
import matplotlib.pyplot as plt
import seaborn as sns
from glob import glob
from re import sub
from sys import argv, exit
from os.path import splitext
import numpy as np
import os
def load(fn):
df=pd.read_csv(fn)
return(df)
def plot(df0, df, tracer) :
ou... | 2.15625 | 2 |
feedparser/datetimes/greek.py | verhovsky/feedparser | 0 | 12799624 | <reponame>verhovsky/feedparser<filename>feedparser/datetimes/greek.py
from __future__ import absolute_import, unicode_literals
import re
from .rfc822 import _parse_date_rfc822
# Unicode strings for Greek date strings
_greek_months = \
{ \
'\u0399\u03b1\u03bd': 'Jan', # c9e1ed in iso-8859-7
'\u03a6\u03b... | 2.09375 | 2 |
arxiv/__init__.py | cnglen/arxiv.py | 9 | 12799625 | <reponame>cnglen/arxiv.py<gh_stars>1-10
from .arxiv import *
| 0.851563 | 1 |
core/migrations/0002_auto_20191215_0201.py | IS-AgroSmart/MVP | 0 | 12799626 | # Generated by Django 3.0 on 2019-12-15 02:01
import core.models
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import uuid
class Migration(migrations.Migration):
dependencies = [
('core', '0001_initial'),
]
operations = [
migr... | 1.765625 | 2 |
Classifier/classify.py | FoodLossFYDP/AmbrosiaImageService | 0 | 12799627 | import numpy as np
import cv2
cascade = cv2.CascadeClassifier('cascade.xml')
img = cv2.imread('orange.jpg')
gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
oranges = cascade.detectMultiScale(gray, 1.05, 15, 0, (150,150))
for (x,y,w,h) in oranges:
cv2.rectangle(img,(x,y),(x+w,y+h),(255,0,0),2)
imgs = cv2.resize(img,... | 2.71875 | 3 |
armory_config/settings.py | 3ndG4me/Configs | 2 | 12799628 | <reponame>3ndG4me/Configs
#!/usr/bin/python3
import os
import pathlib
data_path = pathlib.Path(str(pathlib.Path().absolute()) + "/armory_data")
home = str(pathlib.Path.home())
abolute_home = "CHANGEME"
custom_modules = abolute_home + "/tools/armory_custom/modules"
custom_reports = abolute_home + "/tools/armory_custo... | 1.648438 | 2 |
tnChecker.py | BlackTurtle123/TN-ETH-Gateway | 0 | 12799629 | <gh_stars>0
import os
import sqlite3 as sqlite
import requests
import time
import base58
import PyCWaves
import traceback
import sharedfunc
from web3 import Web3
from verification import verifier
class TNChecker(object):
def __init__(self, config):
self.config = config
self.dbCon = sq... | 2.34375 | 2 |
src/yellowdog_client/model/compute_requirement_status.py | yellowdog/yellowdog-sdk-python-public | 0 | 12799630 | from enum import Enum
class ComputeRequirementStatus(Enum):
"""
Describes the status of a compute requirement.
The status of a compute requirement provides an aggregated view of the statuses of compute machine instances provisioned for that requirement.
"""
NEW = "NEW"
"""The compute require... | 3.46875 | 3 |
hello.py | jas5mg/cs3240-labdemo | 0 | 12799631 | from helper import greeting
greeting("What's Up", "Jake")
| 1.28125 | 1 |
src/tests/test_bitfinex_algo.py | medvi/python-bitfinex_algo | 0 | 12799632 | <gh_stars>0
import logging
import unittest
from bitfinex_algo.cli import load_config, validate_config
from bitfinex_algo import cli as c
logger = logging.getLogger('bitfinex')
class ConfigTests(unittest.TestCase):
@classmethod
def setUpClass(cls):
logging.disable(logging.CRITICAL)
@classmethod
... | 2.578125 | 3 |
G00364742.py | SomanathanSubramaniyan/Applied-Databases | 0 | 12799633 | # Applied Database
# Final Project
# Section 4.4 - Python program answers
# Author : Somu
#mySQL modules import
import mysql.connector
from mysql.connector import Error
from mysql.connector import errorcode
import pandas as pd
#Mongo modules import
import pymongo
from pymongo import MongoClient
#Pandas pr... | 3.53125 | 4 |
recipes/Python/543261_grade_keeper/recipe-543261.py | tdiprima/code | 2,023 | 12799634 | #! /usr/bin/python
# keep record of grades. Made by <NAME>. 0.1-PUBLIC
# NOTE! All letter answers are to be written in quotes (including dates)!
print """############################################
# Welcome to Gradebook! v 0.1 #
# YOUR LIGHT WEIGHT SCHOOL RECORD MANAGER! #
##############################... | 4.125 | 4 |
Scripts4orthology/orthology_analysis.py | tarunaaggarwal/G.morbida.Comp.Gen | 1 | 12799635 | <gh_stars>1-10
import sys
from collections import Counter
f = open(sys.argv[1], "r")
groups = sys.argv[2:]
one_to_one = []
ortho_plus_paralog = []
one_to_one_notallspecies = []
ortho_plus_paralog_notallspecies = []
group_single = {}
group_paralog = {}
for group in groups:
group_single[group] = []
group_para... | 2.890625 | 3 |
annotations/urls.py | connectik/digital-manifesto | 0 | 12799636 | <gh_stars>0
from __future__ import absolute_import, unicode_literals
from django.conf.urls import url, include
from . import views, api_urls
urlpatterns = [
url(r'^api/', include(api_urls, namespace='api'))
]
| 1.46875 | 1 |
reading/migrations/0008_auto_20200401_1324.py | ericrobskyhuntley/vialab.mit.edu | 0 | 12799637 | # Generated by Django 3.0.4 on 2020-04-01 13:24
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('reading', '0007_auto_20200331_2133'),
]
operations = [
migrations.RenameModel(
old_name='ReadingListMetadata',
new_name='Rea... | 1.65625 | 2 |
cfbackup/core.py | nordicdyno/cfbackup | 1 | 12799638 | """This module provides the main functionality of cfbackup
"""
from __future__ import print_function
import sys
import argparse
import json
import CloudFlare
# https://api.cloudflare.com/#dns-records-for-a-zone-list-dns-records
class CF_DNS_Records(object):
"""
commands for zones manipulation
"""
def ... | 2.703125 | 3 |
run_http_measurements.py | kosekmi/quic-opensand-emulation | 0 | 12799639 | <gh_stars>0
# Original script: https://github.com/Lucapaulo/web-performance/blob/main/run_measurements.py
import re
import time
import selenium.common.exceptions
from selenium import webdriver
from selenium.webdriver.chrome.options import Options as chromeOptions
import sys
from datetime import datetime
import hashlib... | 2.578125 | 3 |
ohsomeTools/OhsomeToolsPlugin.py | GIScience/ohsome-qgis-plugin | 3 | 12799640 | <reponame>GIScience/ohsome-qgis-plugin
# -*- coding: utf-8 -*-
"""
/***************************************************************************
ohsomeTools
A QGIS plugin
QGIS client to query the ohsome API
-------------------
begin ... | 1.085938 | 1 |
dashmat/custom/reviews/main.py | realestate-com-au/python-dashing-deploy | 0 | 12799641 | <filename>dashmat/custom/reviews/main.py
from dashmat.core_modules.base import Module
class Reviews(Module):
@classmethod
def dependencies(kls):
yield "dashmat.core_modules.components.main:Components"
| 1.460938 | 1 |
scripts/load_sim.py | ori-goals/lfd-min-human-effort | 1 | 12799642 | <filename>scripts/load_sim.py
#!/usr/bin/env python
from learn_to_manipulate.simulate import Simulation
import rospy
if __name__ == "__main__" :
rospy.init_node('learn_to_manipulate')
sim = Simulation.load_simulation('/home/marcrigter/2019-08-08-11-49_learnt1_key_teleop0.pkl')
case_number = 10
sim.run... | 1.953125 | 2 |
web_api/yonyou/reqparsers/enum_items.py | zhanghe06/flask_restful | 1 | 12799643 | #!/usr/bin/env python
# encoding: utf-8
"""
@author: zhanghe
@software: PyCharm
@file: enum_items.py
@time: 2018-08-23 15:55
"""
from __future__ import unicode_literals
structure_key_item = 'enum_item'
structure_key_items = 'enum_items'
structure_key_item_cn = '枚举类型'
structure_key_items_cn = '枚举类型'
| 1.3125 | 1 |
awesomo.py | buurz-forks/awesomo | 0 | 12799644 | <filename>awesomo.py
print("Hello, AWESOME-O!")
| 1.265625 | 1 |
goto/gotomagic/text/__init__.py | technocake/goto | 10 | 12799645 | <reponame>technocake/goto
# -*- coding: utf-8 -*-
"""
Text used by GOTO to do UX.
"""
from .text import GotoError, GotoWarning, print_text | 1.289063 | 1 |
covid_api/core/__init__.py | NASA-IMPACT/covid-api | 14 | 12799646 | <gh_stars>10-100
"""covid_api.core"""
| 0.859375 | 1 |
setup.py | NewStore-oss/json-encoder | 0 | 12799647 | import os
from setuptools import setup
VERSION = "1.0.4"
NAMESPACE = "newstore"
NAME = "{}.json_encoder".format(NAMESPACE)
def local_text_file(file_name):
path = os.path.join(os.path.dirname(__file__), file_name)
with open(path, "rt") as fp:
file_data = fp.read()
return file_data
setup(
na... | 1.984375 | 2 |
generalgui/properties/funcs.py | Mandera/generalgui | 1 | 12799648 | from generallibrary import getBaseClassNames, SigInfo, dict_insert, wrapper_transfer
def set_parent_hook(self, parent, _draw=True):
""" :param generalgui.MethodGrouper self:
:param generalgui.MethodGrouper parent: """
if _draw:
for part in self.get_children(depth=-1, include_self=True, gen=Tru... | 2.3125 | 2 |
src/os_aio_pod/main.py | zanachka/os-aio-pod | 4 | 12799649 | <filename>src/os_aio_pod/main.py
from os_aio_pod.cmdline import execute
def main():
command_packages = ["os_aio_pod.commands"]
execute(command_packages=command_packages)
| 1.34375 | 1 |
MaxiNet/WorkerServer/tst_driver.py | bramamurthy/P4SwitchesInMaxiNet | 1 | 12799650 | <filename>MaxiNet/WorkerServer/tst_driver.py<gh_stars>1-10
#!/usr/bin/python2
#
# This is a sample program to emulate P4 Switches in Distributed environment
# using Maxinet. The skeleton application program should be like this
#
import argparse
import atexit
import logging
import os
import signal
import subprocess... | 2.203125 | 2 |